(function(e){function t(t){for(var n,r,a=t[0],l=t[1],c=t[2],u=0,p=[];u0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;this.$bvToast.toast(t,{title:"",variant:e,solid:!0})},verifyDefaultValue:function(e){var t=!0;return u.a.map(e.default_value,(function(i,n){e[n]!=i&&(t=!1)})),t}}},h=p,w=(i("b830"),i("2877")),f=Object(w["a"])(h,r,a,!1,null,"088daffc",null),T=f.exports,m=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("b-modal",{ref:"modal",attrs:{"hide-backdrop":"","content-class":"shadow",size:"xl",title:e.TRANSLATIONS.ID_CUSTOM_SCHEDULE_SETTINGS,"hide-footer":""},on:{hide:e.eventHideModal}},[i("b-form",{on:{submit:function(t){return t.stopPropagation(),t.preventDefault(),e.submit(t)}}},[i("b-row",[i("b-col",[i("label",{attrs:{for:"timepicker-placeholder"}},[e._v(e._s(e.TRANSLATIONS.ID_PERIODICITY))]),i("b-form-select",{attrs:{placeholder:e.TRANSLATIONS.ID_CHOOSE_TIME,options:e.optionsPeriodicity},on:{input:function(t){return e.enableValidation(e.row)}},model:{value:e.row.settings.periodicity.value,callback:function(t){e.$set(e.row.settings.periodicity,"value",t)},expression:"row.settings.periodicity.value"}})],1),i("b-col",[i("label",{attrs:{for:"timepicker-placeholder"}},[i("span",{staticStyle:{color:"white"}},[e._v("*")])]),"twicePerDay"==e.row.settings.periodicity.value||"oncePerDay"==e.row.settings.periodicity.value?i("BTimeMixin",{ref:"oncePerDay",attrs:{placeholder:e.TRANSLATIONS.ID_CHOOSE_TIME,local:"en","reset-button":"","reset-value":"00:00:00"},model:{value:e.row.settings.periodicity.oncePerDay,callback:function(t){e.$set(e.row.settings.periodicity,"oncePerDay",t)},expression:"row.settings.periodicity.oncePerDay"}}):e._e()],1),i("b-col",[i("label",{attrs:{for:"timepicker-placeholder"}},[i("span",{staticStyle:{color:"white"}},[e._v("*")])]),"twicePerDay"==e.row.settings.periodicity.value?i("BTimeMixin",{ref:"twicePerDay",attrs:{placeholder:e.TRANSLATIONS.ID_CHOOSE_TIME,local:"en","reset-button":"","reset-value":"00:00:00"},model:{value:e.row.settings.periodicity.twicePerDay,callback:function(t){e.$set(e.row.settings.periodicity,"twicePerDay",t)},expression:"row.settings.periodicity.twicePerDay"}}):e._e(),i("b-form-invalid-feedback",{attrs:{id:"endingTime-feedback"}})],1)],1),i("b-row",{staticClass:"row-padding"},[i("b-col",[i("label",{attrs:{for:"timepicker-placeholder"}},[e._v(e._s(e.TRANSLATIONS.ID_STARTING_TIME))]),i("b-form-timepicker",{attrs:{placeholder:e.TRANSLATIONS.ID_CHOOSE_TIME,local:"en","reset-button":"",disabled:"twicePerDay"===e.row.settings.periodicity.value||"oncePerDay"===e.row.settings.periodicity.value,state:e.validateState("startingTime"),"aria-describedby":"startingTime-feedback"},on:{input:function(t){return e.enableValidation(e.row)}},model:{value:e.row.settings.startingTime,callback:function(t){e.$set(e.row.settings,"startingTime",t)},expression:"row.settings.startingTime"}}),i("b-form-invalid-feedback",{attrs:{id:"startingTime-feedback"}})],1),i("b-col",[i("label",{attrs:{for:"timepicker-placeholder"}},[e._v(e._s(e.TRANSLATIONS.ID_ENDING_TIME))]),i("b-form-timepicker",{attrs:{placeholder:e.TRANSLATIONS.ID_CHOOSE_TIME,local:"en","reset-button":"",disabled:"twicePerDay"===e.row.settings.periodicity.value||"oncePerDay"===e.row.settings.periodicity.value,state:e.validateState("endingTime"),"aria-describedby":"endingTime-feedback"},on:{input:function(t){return e.enableValidation(e.row)}},model:{value:e.row.settings.endingTime,callback:function(t){e.$set(e.row.settings,"endingTime",t)},expression:"row.settings.endingTime"}}),i("b-form-invalid-feedback",{attrs:{id:"endingTime-feedback"}})],1),i("b-col",[i("label",{attrs:{for:"timepicker-placeholder"}},[e._v(e._s(e.TRANSLATIONS.ID_TIME_ZONE))]),i("b-form-select",{attrs:{options:e.timeZone,disabled:!(e.row.settings.startingTime||e.row.settings.endingTime||"twicePerDay"===e.row.settings.periodicity.value||"oncePerDay"===e.row.settings.periodicity.value),state:e.validateState("timezone"),"aria-describedby":"timezone-feedback"},model:{value:e.row.settings.timezone,callback:function(t){e.$set(e.row.settings,"timezone",t)},expression:"row.settings.timezone"}}),i("b-form-invalid-feedback",{attrs:{id:"timezone-feedback"}})],1)],1),i("b-row",{staticClass:"row-padding"},[i("b-col",{attrs:{cols:"8"}},[i("label",{attrs:{for:"timepicker-placeholder"}},[e._v(e._s(e.TRANSLATIONS.ID_REPEAT_EVERY))]),i("b-row",[i("b-col",[i("b-form-input",{attrs:{type:"number",min:"1",formatter:e.formatRepeatEvery},on:{change:function(t){return e.changeRepeatUnit(e.row.settings.everyOn)}},model:{value:e.row.settings.everyOn,callback:function(t){e.$set(e.row.settings,"everyOn",t)},expression:"row.settings.everyOn"}})],1),i("b-col",[i("b-form-select",{attrs:{options:e.optionsRepeatEvery},on:{change:function(t){return e.changeRepeatOption(e.row.settings.everyOn)}},model:{value:e.row.settings.interval,callback:function(t){e.$set(e.row.settings,"interval",t)},expression:"row.settings.interval"}})],1)],1)],1)],1),"d"!=e.row.settings.everyOn?i("b-row",{staticClass:"row-padding"},[i("b-col",[i("label",{attrs:{for:"timepicker-placeholder"}},[e._v(" "+e._s(e.TRANSLATIONS.ID_REPEAT_ON)+" "),i("span",{staticClass:"invalid"},[e._v("*")])]),i("div",[i("b-form-checkbox-group",{staticClass:"options-days",attrs:{options:e.optionsDays,buttons:"","button-variant":"default",size:"sm",name:"buttons-2",state:e.validateState("repeatOn"),"aria-describedby":"repeatOn-feedback"},model:{value:e.row.settings.repeatOn,callback:function(t){e.$set(e.row.settings,"repeatOn",t)},expression:"row.settings.repeatOn"}}),e.$v.row&&e.$v.row.settings&&e.$v.row.settings.repeatOn.$error?i("div",{staticClass:"invalid",attrs:{id:"repeatOn-feedback"}},[e._v(" "+e._s(e.TRANSLATIONS.ID_REQUIRED_FIELD)+" ")]):e._e()],1)])],1):e._e(),i("div",{staticClass:"row-padding"},[i("b-button",{staticClass:"float-right b-button b-success",attrs:{type:"submit"}},[e._v(e._s(e.TRANSLATIONS.ID_SAVE))]),i("span",{staticClass:"float-right w-box40"}),i("b-button",{staticClass:"float-right b-button b-danger",on:{click:e.hide}},[e._v(e._s(e.TRANSLATIONS.ID_CANCEL))])],1)],1)],1)],1)},v=[],S=(i("d3b7"),i("25f0"),i("5753")),b=i("1dce"),g=i("5530"),A=i("326b"),I=i("1947"),_=i("88b7"),y=(i("4de4"),i("a15b"),i("e829")),N=i("93aa"),O=i("7386"),E=i("29b3"),D=Object.assign({},y["a"].props),R={name:"BTimeExtend",mixins:[y["a"]],props:D,render:function(e){var t=this;if(this.hidden)return e();var i=this.valueId,n=this.computedAriaLabelledby,s=[],o=function(n,o,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},l=t.safeId("_spinbutton_".concat(o,"_"))||null;return s.push(l),e(N["a"],{key:o,ref:"spinners",refInFor:!0,class:r,props:Object(g["a"])({id:l,placeholder:"--",vertical:!0,required:!0,disabled:t.disabled,readonly:t.readonly,locale:t.computedLocale,labelIncrement:t.labelIncrement,labelDecrement:t.labelDecrement,wrap:!0,ariaControls:i,min:0},a),scopedSlots:t.spinScopedSlots,on:{change:n}})},r=function(){return e("div",{staticClass:"d-flex flex-column",class:{"text-muted":t.disabled||t.readonly},attrs:{"aria-hidden":"true"}},[e(O["cf"],{props:{shiftV:4,scale:.5}}),e(O["cf"],{props:{shiftV:-4,scale:.5}})])},a=[];a.push(o(this.setHours,"hours","b-time-hours",{value:this.modelHours,max:23,step:1,formatterFn:this.formatHours,ariaLabel:this.labelHours})),a.push(r()),a.push(o(this.setMinutes,"minutes","b-time-minutes",{value:this.modelMinutes,max:59,disabled:!0,step:this.minutesStep||1,formatterFn:this.formatMinutes,ariaLabel:this.labelMinutes})),this.showSeconds&&(a.push(r()),a.push(o(this.setSeconds,"seconds","b-time-seconds",{value:this.modelSeconds,max:59,step:this.secondsStep||1,formatterFn:this.formatSeconds,ariaLabel:this.labelSeconds}))),this.is12Hour&&a.push(o(this.setAmpm,"ampm","b-time-ampm",{value:this.modelAmpm,max:1,formatterFn:this.formatAmpm,ariaLabel:this.labelAmpm,required:!1})),a=e("div",{staticClass:"d-flex align-items-center justify-content-center mx-auto",attrs:{role:"group",tabindex:this.disabled||this.readonly?null:"-1","aria-labelledby":n},on:{keydown:this.onSpinLeftRight,click:function(e){e.target===e.currentTarget&&t.focus()}}},a);var l=e("output",{staticClass:"form-control form-control-sm text-center",class:{disabled:this.disabled||this.readonly},attrs:{id:i,role:"status",for:s.filter(E["a"]).join(" ")||null,tabindex:this.disabled?null:"-1","aria-live":this.isLive?"polite":"off","aria-atomic":"true"},on:{click:this.focus,focus:this.focus}},[e("bdi",this.formattedTimeString),this.computedHMS?e("span",{staticClass:"sr-only"}," (".concat(this.labelSelected,") ")):""]),c=e("header",{staticClass:"b-time-header",class:{"sr-only":this.hideHeader}},[l]),d=this.normalizeSlot("default");return d=d?e("footer",{staticClass:"b-time-footer"},d):e(),e("div",{staticClass:"b-time d-inline-flex flex-column text-center",attrs:{role:"group",lang:this.computedLang||null,"aria-labelledby":n||null,"aria-disabled":this.disabled?"true":null,"aria-readonly":this.readonly&&!this.disabled?"true":null}},[c,a,d])}},L=i("1524"),k=Object.assign({},A["a"].props),x={name:"BTimeMixin",mixins:[A["a"]],props:k,watch:{value:function(e){this.localHMS=e||""}},methods:{onInput:function(e){this.localHMS!==e&&(this.localHMS=e)}},render:function(e){var t=this.localHMS,i=this.disabled,n=this.readonly,s=Object(L["d"])(this.placeholder)?this.labelNoTimeSelected:this.placeholder,o=[];if(this.nowButton){var r=this.labelNowButton;o.push(e(I["a"],{key:"now-btn",props:{size:"sm",disabled:i||n,variant:this.nowButtonVariant},attrs:{"aria-label":r||null},on:{click:this.onNowButton}},r))}if(this.resetButton){o.length>0&&o.push(e("span"," "));var a=this.labelResetButton;o.push(e(I["a"],{key:"reset-btn",props:{size:"sm",disabled:i||n,variant:this.resetButtonVariant},attrs:{"aria-label":a||null},on:{click:this.onResetButton}},a))}if(!this.noCloseButton){o.length>0&&o.push(e("span"," "));var l=this.labelCloseButton;o.push(e(I["a"],{key:"close-btn",props:{size:"sm",disabled:i,variant:this.closeButtonVariant},attrs:{"aria-label":l||null},on:{click:this.onCloseButton}},l))}o.length>0&&(o=[e("div",{staticClass:"b-form-date-controls d-flex flex-wrap",class:{"justify-content-between":o.length>1,"justify-content-end":o.length<2}},o)]);var c=e(R,{ref:"time",staticClass:"b-form-time-control",props:this.timeProps,on:{input:this.onInput,context:this.onContext}},o);return e(_["a"],{ref:"control",staticClass:"b-form-timepicker",props:Object(g["a"])(Object(g["a"])({},this.$props),{},{id:this.safeId(),rtl:this.isRTL,lang:this.computedLang,value:t||"",formattedValue:t?this.formattedValue:"",placeholder:s||""}),on:{show:this.onShow,shown:this.onShown,hidden:this.onHidden},scopedSlots:{"button-content":this.$scopedSlots["button-content"]||this.defaultButtonFn}},[c])}},P=i("b5ae"),C={name:"GridTaskScheduler",props:{options:Array,optionsDays:Array,timeZone:Array,optionsRepeatEvery:Array,optionsPeriodicity:Array},components:{BTimeMixin:x},mixins:[b["validationMixin"]],data:function(){return{TRANSLATIONS:window.TRANSLATIONS,row:{settings:{periodicity:{unit:null,oncePerDay:"00:00:00",twicePerDay:"00:00:00"},startingTime:"",endingTime:"",timeZone:"1",repeatEvery:{unit:1,repeat:"w"},repeatDays:[0,1,2,3,4,5,6]}}}},validations:function(){return this.row.settings.startingTime||this.row.settings.endingTime?{row:{settings:{startingTime:{required:P["required"]},endingTime:{required:P["required"]},timezone:{required:P["required"]},repeatOn:{required:P["required"]}}}}:"oncePerDay"==this.row.settings.periodicity.value||"twicePerDay"==this.row.settings.periodicity.value?{row:{settings:{repeatOn:{required:P["required"]},timezone:{required:P["required"]}}}}:{row:{settings:{repeatOn:{required:P["required"]}}}}},mounted:function(){},methods:{clickSettings:function(e){this.$root.$emit("modalShow",e)},show:function(){this.$refs["modal"].show()},changeRepeatUnit:function(e){"1"==e.toString()?this.optionsRepeatEvery=this.$parent.optionsRepeatSingle:this.optionsRepeatEvery=this.$parent.optionsRepeatPlural},changeRepeatOption:function(e){"d"==e.toString()&&(this.row.settings.repeatOn=[0,1,2,3,4,5,6])},enableValidation:function(e){"oncePerDay"!==e.settings.periodicity.value&&"twicePerDay"!==e.settings.periodicity.value||(e.settings.startingTime="",e.settings.endingTime=""),e.timezone||e.settings.timezone||(e.settings.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone),""==e.settings.startingTime&&""==e.settings.endingTime&&"oncePerDay"!=e.settings.periodicity.value&&"twicePerDay"!=e.settings.periodicity.value&&(e.settings.timezone=null)},save:function(){var e,t=new S["xCron"];this.row.settings.repeatOn=this.formatRepeatOn(this.row.settings.repeatOn),e=t.toExpression(this.row.settings),u.a.extend(this.row,e),this.row.settings.description=t.toDescription(this.row.settings),this.$parent.updateSettings(this.row),e.id=this.row.id,c()({method:"post",url:window.server+"/api/1.0/".concat(window.workspace,"/scheduler"),data:e,headers:{Authorization:"Bearer "+window.credentials.accessToken}}),this.$refs["modal"].hide()},submit:function(){this.$v.row.settings.$touch(),this.$v.row.settings.$anyError||this.save()},hide:function(){this.$refs["modal"].hide()},eventHideModal:function(){var e=new S["xCron"],t=u.a.extend({},this.row);t.settings=u.a.extend({},e.toSettings(t)),this.$parent.updateSettings(t)},validateState:function(e){if(this.$v.row&&this.$v.row.settings&&this.$v.row.settings[e]){var t=this.$v.row.settings[e],i=t.$dirty,n=t.$error;return i?!n:null}return null},formatRepeatOn:function(e){var t=u.a.sortBy(e,(function(e){return e}));return t},makeToast:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;this.$bvToast.toast(t,{variant:e,solid:!0})},formatRepeatEvery:function(e){return String(e).substring(0,3)}}},$=C,M=(i("0867"),Object(w["a"])($,m,v,!1,null,null,null)),Y=M.exports,B={name:"App",components:{GridTaskScheduler:T,ModalTaskSchedule:Y},mounted:function(){var e=this,t=this,i=window.server+"/api/1.0/".concat(window.workspace,"/scheduler")+(window.category?"?category="+window.category:"");c.a.get(i,{headers:{Authorization:"Bearer "+window.credentials.accessToken}}).then((function(t){var i=[],n=[];u.a.forEach(t.data,(function(e){var t=new S["xCron"];e.settings=u.a.extend({},t.toSettings(e)),e.title=window.TRANSLATIONS[e.title]||e.title,e.description=window.TRANSLATIONS[e.description]||e.description,e.enable=1==e.enable,i.push(e)})),u.a.forEach(window.timezoneArray,(function(e){n.push({value:e,text:e})})),e.dataScheduler=i,e.timeZone=n})).catch((function(e){e&&e.message&&"ECONNABORTED"!==e.code&&t.$bvToast.toast(e.message||"",{title:"",variant:"danger",solid:!0})}))},data:function(){return{columns:["enable","service","schedule time","settings"],dataScheduler:[],optionsDays:[{text:window.TRANSLATIONS["ID_WEEKDAY_ABB_1"],value:"1"},{text:window.TRANSLATIONS["ID_WEEKDAY_ABB_2"],value:"2"},{text:window.TRANSLATIONS["ID_WEEKDAY_ABB_3"],value:"3"},{text:window.TRANSLATIONS["ID_WEEKDAY_ABB_4"],value:"4"},{text:window.TRANSLATIONS["ID_WEEKDAY_ABB_5"],value:"5"},{text:window.TRANSLATIONS["ID_WEEKDAY_ABB_6"],value:"6"},{text:window.TRANSLATIONS["ID_WEEKDAY_ABB_0"],value:"0"}],optionsRepeatSingle:[{text:window.TRANSLATIONS["ID_WEEK"],value:"week"},{text:window.TRANSLATIONS["ID_MONTH"],value:"month"},{text:window.TRANSLATIONS["ID_YEAR"],value:"year"}],optionsRepeatPlural:[{text:window.TRANSLATIONS["ID_WEEKS"],value:"week"},{text:window.TRANSLATIONS["ID_MONTHS"],value:"month"},{text:window.TRANSLATIONS["ID_YEARS"],value:"year"}],optionsPeriodicity:[{text:window.TRANSLATIONS["ID_EVERY_MINUTE"],value:"*/1 *"},{text:window.TRANSLATIONS["ID_EVERY_FIVE_MINUTES"],value:"*/5 *"},{text:window.TRANSLATIONS["ID_EVERY_TEN_MINUTES"],value:"*/10 *"},{text:window.TRANSLATIONS["ID_EVERY_FIFTEEN_MINUTES"],value:"*/15 *"},{text:window.TRANSLATIONS["ID_EVERY_THIRTY_MINUTES"],value:"*/30 *"},{text:window.TRANSLATIONS["ID_EVERY_HOUR"],value:"0 */1"},{text:window.TRANSLATIONS["ID_ONCE_PER_DAY"],value:"oncePerDay"},{text:window.TRANSLATIONS["ID_TWICE_PER_DAY"],value:"twicePerDay"}],selected:[]}},methods:{modalShow:function(e){this.$refs["modal"].row=e,this.$refs["modal"].show(),this.$refs["modal"].changeRepeatUnit(e.settings.everyOn),this.$refs["modal"].$v.$reset()},updateSettings:function(e){for(var t=-1,i=0;i1&&(e=e.slice(1),e[5]=+e[0]<12?"AM":"PM",e[0]=+e[0]%12||12),e.join("")}},{key:"intervalToDescription",value:function(e,t){var i="",n={week:window.TRANSLATIONS["ID_WEEK"],month:window.TRANSLATIONS["ID_MONTH"],year:window.TRANSLATIONS["ID_YEAR"]},s={week:window.TRANSLATIONS["ID_WEEKS"],month:window.TRANSLATIONS["ID_MONTHS"],year:window.TRANSLATIONS["ID_YEARS"]};return i+="1"==e?" "+window.TRANSLATIONS["ID_EVERY"].replace("${0}","").replace("${1}",n[t]):" "+window.TRANSLATIONS["ID_EVERY"].replace("${0}",e).replace("${1}",s[t]),"1"==e&&"week"==t&&(i=""),i}},{key:"repeatOnToDescription",value:function(e){for(var t=" on ",i=[window.TRANSLATIONS["ID_WEEKDAY_0"],window.TRANSLATIONS["ID_WEEKDAY_1"],window.TRANSLATIONS["ID_WEEKDAY_2"],window.TRANSLATIONS["ID_WEEKDAY_3"],window.TRANSLATIONS["ID_WEEKDAY_4"],window.TRANSLATIONS["ID_WEEKDAY_5"],window.TRANSLATIONS["ID_WEEKDAY_6"]],n=0;n1&&"0"==s[0]&&(t="twicePerDay",n=s[1].split(",")[1]+":00:00")),{value:t,oncePerDay:i,twicePerDay:n}}}]),e}();e.exports.xCron=o},"6e54":function(e,t,i){},"85ec":function(e,t,i){},b830:function(e,t,i){"use strict";var n=i("ef0c"),s=i.n(n);s.a},ef0c:function(e,t,i){}}); //# sourceMappingURL=app.js.map