"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[9969],{99969:function(e,t,a){a.r(t),a.d(t,{default:function(){return i},show:function(){return r}}),a(32081),a(23938),a(43512),a(48410),a(63238),a(61418);var o=a(90914),n=a(28469),l=a(44614);function s(e){var t=0,a=e%1;return a&&(t=parseInt(60*a)),n.ZP.getDisplayTime(new Date(2e3,1,1,e,t,0,0))}function r(e){return new Promise((function(t,a){var n=o.default.createDialog({removeOnClose:!0,size:"small"});n.classList.add("formDialog");var r,i,c,u,d,v="";v+=l.ZP.translateHtml('<div class="formDialogHeader"> <button is="paper-icon-button-light" class="btnCancel autoSize" title="${Previous}" tabindex="-1"> <span class="material-icons arrow_back" aria-hidden="true"></span> </button> <h3 class="formDialogHeaderTitle"> ${HeaderAccessSchedule} </h3> </div> <div class="formDialogContent scrollY" style="padding-top:2em"> <div class="dialogContentInner dialog-content-centered"> <form class="scheduleForm" style="margin:auto"> <div class="selectContainer"> <select is="emby-select" id="selectDay" label="${LabelAccessDay}"> <option value="Sunday">${Sunday}</option> <option value="Monday">${Monday}</option> <option value="Tuesday">${Tuesday}</option> <option value="Wednesday">${Wednesday}</option> <option value="Thursday">${Thursday}</option> <option value="Friday">${Friday}</option> <option value="Saturday">${Saturday}</option> <option value="Everyday">${OptionEveryday}</option> <option value="Weekday">${OptionWeekdays}</option> <option value="Weekend">${OptionWeekends}</option> </select> </div> <div class="selectContainer"> <select is="emby-select" class="selectHour" id="selectStart" label="${LabelAccessStart}"></select> </div> <div class="selectContainer"> <select is="emby-select" class="selectHour" id="selectEnd" label="${LabelAccessEnd}"></select> </div> <div class="formDialogFooter"> <button is="emby-button" type="submit" class="raised button-submit block formDialogFooterItem"> <span>${Add}</span> </button> </div> </form> </div> </div> '),n.innerHTML=v,function(e){for(var t="",a=0;a<24;a++)t+='<option value="'.concat(a,'">').concat(s(a),"</option>");t+='<option value="24">'.concat(s(0),"</option>"),e.querySelector("#selectStart").innerHTML=t,e.querySelector("#selectEnd").innerHTML=t}(n),r=n,c=(i=e.schedule).DayOfWeek,u=i.StartHour,d=i.EndHour,r.querySelector("#selectDay").value=c||"Sunday",r.querySelector("#selectStart").value=u||0,r.querySelector("#selectEnd").value=d||0,o.default.open(n),n.addEventListener("close",(function(){n.submitted?t(e.schedule):a()})),n.querySelector(".btnCancel").addEventListener("click",(function(){o.default.close(n)})),n.querySelector("form").addEventListener("submit",(function(t){return function(e,t){var a={DayOfWeek:e.querySelector("#selectDay").value,StartHour:e.querySelector("#selectStart").value,EndHour:e.querySelector("#selectEnd").value};parseFloat(a.StartHour)>=parseFloat(a.EndHour)?alert(l.ZP.translate("ErrorStartHourGreaterThanEnd")):(e.submitted=!0,t.schedule=Object.assign(t.schedule,a),o.default.close(e))}(n,e),t.preventDefault(),!1}))}))}a(20716),a(21865),a(6626);var i={show:r}}}]);