PageSourceSearch

https://web.jibble.io/assets/Holidays-AkJEaDEo.js

js jibble.io collected 2026-10-01 12:26:37 UTC 44,202 bytes, 1 lines download raw bytes

1var na=Object.defineProperty;var sa=(e,a,m)=>a in e?na(e,a,{enumerable:!0,configurable:!0,writable:!0,value:m}):e[a]=m;var De=(e,a,m)=>sa(e,typeof a!="symbol"?a+"":a,m);import{I as X,bp as q,d as ae,ek as da,H as M,M as ra,at as ia,C as V,r as w,o as n,c as D,w as t,b as l,t as u,e as R,F as G,l as d,bt as ua,dB as ma,x as E,f as b,h as He,b4 as ie,Y as re,be as fe,f1 as ca,Q as _,k as U,L as F,cC as ye,as as ee,R as te,bz as pa,c5 as fa,f2 as ya,f3 as ha,O as Se,ar as je,_ as oe,U as Le,n as he,a1 as Be,V as x,aG as va,b1 as ga,aE as ba,P as Fe,aC as Ye,S as we,g as Ca,ao as Ie,j as Ue,bq as ce,br as Ae,bh as Re,cH as ze,ai as Da,b3 as Ee,aa as $a,bv as wa,ac as ka,ak as Oe,bg as Va,f4 as Sa,dC as Ra,bb as Ta,f5 as Ia,aM as Ua,a8 as Aa}from"./app-D1nM95Vy.js";import{L as Ea}from"./Tabs-CslX9PIt.js";import{L as Oa}from"./index-D_PXu1sT.js";import{u as Na}from"./upperFirst-BeeMO1Jz.js";import{_ as Pa}from"./EditableCard.vue_vue_type_script_setup_true_lang-DpcjUAl7.js";import{U as Ma}from"./update-context-C5ltHlix.js";import{r as ve}from"./validation-B5tP7zzu.js";import{S as _e}from"./crud-store-base-5AuINrpH.js";import{s as Qe,f as ke,P as Ha}from"./metrics-DL11lIQc.js";import{u as qe}from"./forms-BiYe-LOg.js";import{J as ja}from"./JBtnPreviewSelector-CGEb6bc7.js";import{U as Ve}from"./UnitAvatars-Co7MSlRq.js";import{U as La,a as Ba,_ as Fa}from"./NoSearchResult.vue_vue_type_script_setup_true_lang-DaQZQos6.js";import{C as Ya}from"./calendar-days-Bm1bESZZ.js";import{_ as za}from"./Panel.vue_vue_type_script_setup_true_lang-DxtfuR8n.js";import{R as _a}from"./RightSidebar-CtU6nvmt.js";import{a as Ge}from"./time-off-CT2FqcQc.js";import{D as Qa}from"./DurationInput-u5uLj_ut.js";import{T as qa}from"./TimePicker-BM0JpmwC.js";import{S as Ga}from"./ScheduleSelector-CK3iSWna.js";import{D as Wa}from"./DeleteModal-Cj74-lov.js";import{P as Ja}from"./PricingPlanTooltip-BDkrUj_q.js";import"./index-Dm0Y5in-.js";import"./index-CH13HvmE.js";import"./upperFirst-s8K2lUOm.js";import"./_baseSlice-DkFNCYmM.js";import"./QSlideTransition-m3A9_agM.js";import"./Avatar-BJ4oNd1Y.js";import"./QImg-DzskvO7X.js";import"./search-Cvqf93EV.js";import"./touch-BjYP5sR0.js";import"./helper-yYhCU5XJ.js";import"./multi-level-approval-yiAIn87V.js";import"./_baseDifference-CtCULOg-.js";import"./_arrayIncludesWith-pBMhzuR3.js";import"./last-oQFn8hUT.js";import"./pick-DPJI8lUp.js";import"./_flatRest-CCi_r9pE.js";import"./work-schedule-DDE-IeKM.js";import"./RestrictionChip-Eg50mWB2.js";import"./clock-in-out-DKm1QWgp.js";class Te extends _e{constructor(){super(X().workspace.calendars);De(this,"peopleService",X().workspace.people);De(this,"groupsService",X().workspace.groups)}updatePeopleAndGroups(m,i){const f=[];if(i){const{removedAll:g,addedPersonIds:y,removedPersonIds:s,addedGroupIds:v,removedGroupIds:c}=i;if(g){const o={calendarId:null},p={calendarId:q.from(m)};f.push(this.peopleService.update(o,p),this.groupsService.update(o,p))}else{if(s.length){const o={calendarId:null},p={id:{in:s.map(q.from)},calendarId:q.from(m)};f.push(this.peopleService.update(o,p))}if(c.length){const o={calendarId:null},p={id:{in:c.map(q.from)},calendarId:q.from(m)};f.push(this.groupsService.update(o,p))}}if(y.length){const o={calendarId:m},p={id:{in:y.map(q.from)},calendarId:{ne:q.from(m)}};f.push(this.peopleService.update(o,p))}if(v.length){const o={calendarId:m},p={id:{in:v.map(q.from)},calendarId:{ne:q.from(m)}};f.push(this.groupsService.update(o,p))}}return f}async update(m,i,f){const g=[];i&&g.push(this.api.update(m,i));const y=this.updatePeopleAndGroups(m,f);g.push(...y),await Promise.all(g)}async create(m,i){const f=await this.api.create(m),g=this.updatePeopleAndGroups(f.id,i);return await Promise.all(g),f}}class We extends _e{constructor(){super(X().workspace.calendarImports)}async importCalendar(a){await this.api.import(a.id,a.importSourceId,a.region)}}const Ka={class:"mb-1"},Xa={key:0},Za={class:"inline-block ellipsis text-black",style:{"vertical-align":"middle","max-width":"360px"}},xa={class:"column"},et={class:"flex no-wrap items-center"},at={class:"mr-1"},tt={style:{"list-style":"none"},class:"pl-0"},lt=["innerHTML"],ot=["innerHTML"],nt=["innerHTML"],st={class:"q-gutter-sm"},dt={key:1,class:"column"},rt=ae({__name:"CalendarUpdater",props:{calendars:{}},emits:["confirmed","close"],setup(e,{emit:a}){const m=e,i=a,f=X(),{formatLocaleDate:g}=da({weekday:"short"}),y=U(()=>m.calendars.filter(r=>r.importSource)),s=Object.freeze({id:ra(),name:Na(`${M("common.labels.all")} (${y.value.length})`)}),v=ia("dropdown"),c=U(()=>[s,...y.value]),o=V(c.value.map(r=>r.id)),p=V("all"),S={all:M("holidays.labels.refreshDateTypes.all"),future:M("holidays.labels.refreshDateTypes.future"),specific:M("holidays.labels.refreshDateTypes.specific")},T=V(),k=U(()=>m.calendars.length===1),N=U(()=>k.value?M("holidays.titles.refreshSpecificCalendar",{calendarName:m.calendars[0].name}):M("holidays.titles.refreshImportedCalendars")),O=V(!1),H=V(!1),L=U(()=>o.value.length===0),C=U(()=>o.value.length===c.value.length),Q=U(()=>g(T.value?F.parseZone(T.value):F.utc()));function W(){O.value=!1}async function J(){switch(p.value){case"future":T.value=F.utc().add(1,"day").format(ye.DateOnly);break;case"specific":T.value=T.value??F.utc().format(ye.DateOnly);break;case"all":default:T.value=void 0;break}try{H.value=!0;const r=o.value.filter(h=>
1h!==s.id);await f.workspace.calendars.refreshCalendars(r,T.value),k.value?ee(M("holidays.messages.specificCalendarUpdated",{calendarName:m.calendars[0].name})):ee(M("holidays.messages.multipleCalendarsUpdated")),i("confirmed")}catch(r){te(r)}finally{H.value=!1,i("close")}}function K(r){var h;r.id===s.id&&(o.value.includes(s.id)?o.value=[]:o.value=c.value.map(j=>j.id)),C.value&&((h=v.value)==null||h.toggleOption(s))}return(r,h)=>{const $=w("j-banner"),j=w("j-interactive-tooltip"),Y=w("base-modal");return n(),D(Y,{actions:"",loading:H.value,width:534,disabled:L.value,"confirm-button-text":r.$t("common.actions.refresh"),onConfirm:J,onCancel:h[4]||(h[4]=P=>r.$emit("close"))},{title:t(()=>[E(u(N.value),1)]),content:t(()=>[l("p",null,u(r.$t("holidays.messages.updateCalendarToLatest")),1),k.value?b("",!0):(n(),R(G,{key:0},[l("div",Ka,u(r.$t("holidays.labels.calendars")),1),d(ua,{ref_key:"dropdown",ref:v,modelValue:o.value,"onUpdate:modelValue":h[0]||(h[0]=P=>o.value=P),options:c.value,"debounce-interval":0,multiple:"",outlined:"","not-clearable":"","data-testid":"dropdown-selected-calendars-to-refresh",onItemClick:K},{selection:t(({item:P,index:I})=>[I===0?(n(),R(G,{key:0},[C.value?(n(),R("span",Xa,u(c.value[0].name),1)):(n(),R(G,{key:1},[l("span",Za,u(P.name),1),o.value.length>1?(n(),D(ma,{key:0,color:"grey-3",rounded:"",class:"ml-1"},{default:t(()=>[E(" +"+u(o.value.length-1),1)]),_:1})):b("",!0)],64))],64)):b("",!0)]),_:1},8,["modelValue","options"]),d($,{type:"info",class:"my-4"},{default:t(()=>[E(u(r.$t("holidays.messages.manualCalendarsCantBeUpdated")),1)]),_:1})],64)),l("div",xa,[l("div",et,[l("span",at,u(r.$t("holidays.labels.calendarRefreshOptions")),1),d(j,{"icon-size":"sm",position:"top"},{default:t(()=>[l("ul",tt,[l("li",{innerHTML:r.$t("holidays.tooltips.refreshOptions.allDates")},null,8,lt),l("li",{innerHTML:r.$t("holidays.tooltips.refreshOptions.futureDates")},null,8,ot),l("li",{innerHTML:r.$t("holidays.tooltips.refreshOptions.specificDate")},null,8,nt)])]),_:1})]),l("div",st,[(n(),R(G,null,He(S,(P,I)=>d(ie,{key:"refresh-type-"+I,modelValue:p.value,"onUpdate:modelValue":h[1]||(h[1]=B=>p.value=B),val:I,class:"ml-0 mr-4"},{default:t(()=>[E(u(P),1)]),_:2},1032,["modelValue","val"])),64))])]),p.value==="specific"?(n(),R("div",dt,[l("div",null,u(r.$t("common.labels.selectedDate")),1),d(re,{"model-value":Q.value,"input-class":"text-weight-bold",class:"mt-2 bordered--readonly",outlined:"",readonly:""},{append:t(()=>[d(_,{name:"calendar-thin",color:"grey-3",class:"cursor-pointer"})]),default:t(()=>[d(fe,{modelValue:O.value,"onUpdate:modelValue":h[3]||(h[3]=P=>O.value=P)},{default:t(()=>[d(ca,{modelValue:T.value,"onUpdate:modelValue":h[2]||(h[2]=P=>T.value=P),landscape:"",class:"inherit-width",onChange:W},null,8,["modelValue"])]),_:1},8,["modelValue"])]),_:1},8,["model-value"])])):b("",!0)]),_:1},8,["loading","disabled","confirm-button-text"])}}});function Ne(e){if(e===!1)return 0;if(e===!0||e===void 0)return 1;const a=parseInt(e,10);return isNaN(a)?0:a}const Pe=pa({name:"close-popup",beforeMount(e,{value:a}){const m={depth:Ne(a),handler(i){m.depth!==0&&setTimeout(()=>{const f=ya(e);f!==void 0&&ha(f,i,m.depth)})},handlerKey(i){fa(i,13)===!0&&m.handler(i)}};e.__qclosepopup=m,e.addEventListener("click",m.handler),e.addEventListener("keyup",m.handlerKey)},updated(e,{value:a,oldValue:m}){a!==m&&(e.__qclosepopup.depth=Ne(a))},beforeUnmount(e){const a=e.__qclosepopup;e.removeEventListener("click",a.handler),e.removeEventListener("keyup",a.handlerKey),delete e.__qclosepopup}}),pe={id:"",name:"",default:!1,manual:!1,people:[],groups:[]},Je={name:"",region:"",syncData:"",id:""},it={id:"",organizationId:"",name:"",date:"",calendarId:"",calendar:pe,status:Qe.Manual,rules:[]},ut=M("holidays.labels.defaultImportedCalendar"),mt=ae({props:{modelValue:{type:Object,required:!0},isDefault:{type:Boolean,default:!1},loading:{default:!1,type:Boolean}},emits:["update:options","update:modelValue"],setup(e,{emit:a}){const{formRef:m,isFormInvalid:i}=qe(),f=new We,g=V(!1);let y=je({...Je});const s=V([]),v=f.items,c=U(()=>!e.modelValue.id),o=U({get:()=>e.modelValue.manual?"true":"false",set:k=>{a("update:modelValue",{...e.modelValue,manual:k==="true"})}});Se(async()=>{g.value=!0;try{await f.list({orderby:{name:"asc"}})}catch(k){te(k)}finally{g.value=!1}});function p(){const k=v.value.find(N=>N.syncData===y.syncData);k&&(s.value=k.availableRegions,y.region="")}function S(){if(e.modelValue.manual)return;const k=v.value.find(N=>N.syncData===y.syncData);k&&e.modelValue.name===""&&(e.modelValue.name=`${ut} (${k.name})`),y.name=e.modelValue.name}function T(){S(),p(),a("update:options",y)}return{rules:ve,calendarOptions:y,loadingCountriesAndRegions:g,countries:v,onCountryChange:T,regions:s,isNew:c,manual:o,formRef:m,isFormInvalid:i}}}),ct={class:"row items-baseline mt-6"},pt={class:"col-3 text-right mr-3"},ft={class:"col-8"},yt={class:"row items-center mt-4 mb-6"},ht={class:"col-8 offset-3"},vt={class:"row items-center"},gt={nohref:""},bt={class:"mb-3"},Ct={key:0},Dt={class:"row items-baseline"},$t={class:"col-3 text-right mr-3"},wt={class:"col-8"},kt={class:"text-body2 text-black"},Vt={class:"row"},St={class:"col-8 offset-3"},Rt={class:"text-body2 text-black"};function Tt(e,a,m,i,f,g){const y=w("j-checkbox"),s=w("j-interactive-tooltip"),v=w("j-autocomplete");return n(),D(Le,{ref:"formRef",greedy:""},{default:t(()=>[l("div",ct,[l("div",pt,u(e.$t("holidays.labels.calendarName")),1),l("div",ft,[d(re,{"model-value":e.modelValue.name,"data-testid":"name-a-calendar",rules:e.rules.itemName,outlined:"",placeholder:e.$t("holidays.labels.calendarName"),color:"primary",class:"text-weight-bold",disable:e.loading,"onUpdate:modelValue":a[0]||(a[0]=c=>e.$emit("update:modelValue",{...e.modelValue,name:c}
1))},null,8,["model-value","rules","placeholder","disable"])])]),l("div",yt,[l("div",ht,[l("div",vt,[d(y,{modelValue:e.modelValue.default,"onUpdate:modelValue":a[1]||(a[1]=c=>e.modelValue.default=c),disable:e.isDefault||e.loading,label:e.$t("holidays.labels.makeDefault"),class:"mt-0 mr-3 ml-3",onChange:a[2]||(a[2]=c=>e.$emit("update:modelValue",{...e.modelValue,default:c}))},null,8,["modelValue","disable","label"]),l("a",gt,[d(s,{"icon-size":"20px"},{default:t(()=>[l("div",bt,u(e.$t("holidays.labels.defaultTooltipNote1")),1),l("div",null,u(e.$t("holidays.labels.defaultTooltipNote2")),1)]),_:1})])])])]),e.isNew?(n(),R("div",Ct,[l("div",Dt,[l("div",$t,u(e.$t("common.titles.holidays")),1),l("div",wt,[d(ie,{modelValue:e.manual,"onUpdate:modelValue":a[3]||(a[3]=c=>e.manual=c),"data-testid":"import-from-calendar",label:"",val:"false"},{default:t(()=>[l("span",kt,u(e.$t("holidays.labels.importFromCalendar")),1)]),_:1},8,["modelValue"]),e.modelValue.manual?b("",!0):(n(),D(v,{key:0,modelValue:e.calendarOptions.syncData,"onUpdate:modelValue":[a[4]||(a[4]=c=>e.calendarOptions.syncData=c),e.onCountryChange],"data-testid":"country-or-region",options:e.countries,loading:e.loadingCountriesAndRegions,class:"mt-2 ml-2 text-weight-bold",placeholder:e.$t("holidays.labels.selectCountryOrRegion"),"no-data-text":e.$t("holidays.emptyStates.noCountryOrRegion"),rules:e.rules.notEmpty,"option-label":"name","option-value":"syncData"},null,8,["modelValue","options","loading","placeholder","no-data-text","rules","onUpdate:modelValue"])),!e.modelValue.manual&&e.regions.length?(n(),D(v,{key:1,modelValue:e.calendarOptions.region,"onUpdate:modelValue":a[5]||(a[5]=c=>e.calendarOptions.region=c),options:e.regions,loading:e.loadingCountriesAndRegions,placeholder:e.$t("holidays.labels.selectRegion"),"no-data-text":e.$t("holidays.emptyStates.noRegionFound"),class:"mt-2 mb-4 ml-2 text-weight-bold","hide-bottom-space":""},null,8,["modelValue","options","loading","placeholder","no-data-text"])):b("",!0)])]),l("div",Vt,[l("div",St,[d(ie,{modelValue:e.manual,"onUpdate:modelValue":a[6]||(a[6]=c=>e.manual=c),"data-testid":"add-manually",class:"ml-3 mb-1",val:"true"},{default:t(()=>[l("span",Rt,u(e.$t("holidays.labels.addManually")),1)]),_:1},8,["modelValue"])])])])):b("",!0)]),_:1},512)}const Me=oe(mt,[["render",Tt]]),It={key:1,class:"row items-center mt-3 mb-2"},Ut={key:2,class:"row mt-4"},At={class:"col"},Et={key:0,class:"text-body2 default-text"},Ot={key:2,class:"text-grey-3 text-italic mt-3 text-body2"},Nt={key:3,class:"row"},Pt={class:"col-3 text-right mt-2 mr-2"},Mt={class:"col-8"},Ht={class:"text-grey-2 mt-2 text-caption"},jt=ae({__name:"Member",props:{modelValue:{type:Object,required:!0},editing:{type:Boolean,default:!1},loading:{default:!1,type:Boolean}},setup(e){const a=e,m=U(()=>a.modelValue.groups.length+a.modelValue.people.length),i=U(()=>m.value>0);return(f,g)=>{const y=w("j-banner"),s=w("j-interactive-tooltip");return n(),R(G,null,[e.modelValue.default?(n(),D(y,{key:0,type:"warning",elevated:""},{default:t(()=>[E(u(f.$t("holidays.labels.peopleAndGroups.memberAssignmentNote")),1)]),_:1})):!e.editing||e.editing&&!e.modelValue.default?(n(),R("div",It,[l("div",{class:he(["mr-2 text-weight-bolder text-uppercase",{"default-text":e.modelValue.default}])},u(f.$t("common.titles.members")),3),e.editing?(n(),D(s,{key:0,"icon-size":"18px"},{default:t(()=>[E(u(f.$t("holidays.labels.memberNote")),1)]),_:1})):b("",!0)])):b("",!0),e.editing?b("",!0):(n(),R("div",Ut,[l("div",At,[e.modelValue.default?(n(),R("span",Et,u(f.$t("holidays.labels.memberNote")),1)):i.value?(n(),D(Ve,{key:1,data:e.modelValue},null,8,["data"])):(n(),R("span",Ot,u(f.$t("holidays.emptyStates.noMembersAssigned")),1))])])),e.editing&&!e.modelValue.default&&i.value?(n(),R("div",Nt,[l("div",Pt,u(f.$t("common.labels.assignTo")),1),l("div",Mt,[d(ja,{disabled:"",readonly:""},{default:t(()=>[d(Ve,{data:e.modelValue},null,8,["data"])]),_:1}),l("div",Ht,u(f.$t("holidays.labels.assignMemberNote")),1)])])):b("",!0),d(La,{class:he(["mt-3",{"text-center":e.editing&&i.value&&!e.modelValue.default}]),type:"calendar",entity:e.modelValue},null,8,["class","entity"]),e.editing&&!e.modelValue.default?(n(),D(Be,{key:4,class:"mt-9"})):b("",!0)],64)}}}),Lt=ae({props:{calendar:{type:Object,required:!0},calendars:{type:Array,default:()=>[]}},emits:["close","confirm"],setup(e,{emit:a}){const m=new Te,i=X(),f=V(!1),g=U(()=>e.calendars),y=U(()=>g.value.filter(S=>S.id!==e.calendar.id)),s=U(()=>y.value.length&&(e.calendar.groups.length||e.calendar.people.length)),v=V(y.value.length===1?y.value[0].id:""),c=U(()=>!s.value||v.value),o=async()=>{f.value=!0;try{await p(),await i.workspace.calendars.delete(e.calendar.id),ee(M("holidays.dialogs.calendarDelete.calendarDeleted"))}catch(S){te(S)}finally{f.value=!1,a("confirm")}};async function p(){var T;if(!v.value||(T=y.value.find(k=>k.id===v.value))!=null&&T.default)return;const S=g.value.find(k=>k.id===e.calendar.id);await m.update(v.value,void 0,{removedAll:!1,addedPersonIds:(S==null?void 0:S.people.map(k=>k.id))||[],removedPersonIds:[],addedGroupIds:(S==null?void 0:S.groups.map(k=>k.id))||[],removedGroupIds:[]}),ee(M("holidays.dialogs.calendarDelete.calendarMembersUpdated"))}
1return{loading:f,isFormValid:c,showReassign:s,deleteCalendar:o,reassignCalendars:y,reassignTo:v}}}),Bt={class:"mt-4 mb-8"},Ft={key:0},Yt={class:"mb-2"},zt={class:"mt-4 text-right"};function _t(e,a,m,i,f,g){const y=w("j-autocomplete"),s=w("base-modal");return n(),D(s,{onCancel:a[1]||(a[1]=v=>e.$emit("close"))},{title:t(()=>[E(u(e.$t("common.titles.deleteItem",{item:e.calendar.name})),1)]),content:t(()=>[l("div",Bt,[E(u(e.$t("common.labels.takeNoteThat"))+" ",1),l("ul",null,[l("li",null,u(e.$t("holidays.dialogs.calendarDelete.content1")),1),l("li",null,u(e.$t("holidays.dialogs.calendarDelete.content2")),1)])]),e.showReassign?(n(),R("div",Ft,[l("div",Yt,u(e.$t("holidays.dialogs.calendarDelete.reassignMembersTo"))+":",1),d(y,{modelValue:e.reassignTo,"onUpdate:modelValue":a[0]||(a[0]=v=>e.reassignTo=v),options:e.reassignCalendars,disable:e.reassignCalendars.length===1,"option-value":"id","option-label":"name",placeholder:e.$t("holidays.dialogs.calendarDelete.selectCalendar")},null,8,["modelValue","options","disable","placeholder"])])):b("",!0)]),footer:t(()=>[l("div",zt,[d(x,{color:"negative",loading:e.loading,disable:!e.isFormValid,onClick:e.deleteCalendar},{default:t(()=>[E(u(e.$t("common.actions.confirm")),1)]),_:1},8,["loading","disable","onClick"])])]),_:1})}const Qt=oe(Lt,[["render",_t]]),Ke=Symbol("CalendarsEventBus"),$e=5;function qt(){const e=va(Ke);if(e)return e;throw new Error("Calendars event bus has not been provided")}function Gt(){return ga()}class Wt extends Ba{update(a,m,i){return this.batchUpdate("calendarId",a,m,i)}}const Jt=ae({components:{CalendarDeleteModal:Qt,EditableCard:Pa,Holiday:Me,CalendarAssignees:jt},props:{calendar:{type:Object,required:!0},isDefault:{type:Boolean,default:!1},calendars:{type:Array,default:()=>[]}},emits:["refreshCalendar"],setup(e,{emit:a}){const m=new Te,i=new We,f=qt(),g=i.items,y=X(),s=ba(),v=V(),c=new Wt(y.workspace),o=V(),p=V(!1),S=V(!1),T=V({...Je}),k=V(!1),N=U(()=>!e.calendar.id),O=new Ma({getValue:()=>({...Fe(e.calendar)}),onUpdated:async $=>{k.value=!0,N.value?await H($):await L($),k.value=!1,p.value=!1}});async function H($){const j=await m.create({name:$.name,default:$.default});if(o.value&&await c.update(j.id,e.calendar,o.value),$.manual)f.emit("ResetCalendarDays");else{await i.list();const Y=g.value.find(I=>I.syncData===T.value.syncData),P={id:j.id,importSourceId:Y.id,region:T.value.region};await i.importCalendar(P),ee(M("holidays.labels.calendarCreated"))}f.emit("CalendarCreated",j.id)}async function L($){await m.update($.id,{default:$.default,name:$.name}),o.value&&await c.update($.id,e.calendar,o.value),ee(M("holidays.labels.calendarSaved")),f.emit("CalendarUpdated")}function C($){p.value=$}async function Q(){var $;
1await(($=v.value)==null?void 0:$.isFormInvalid())||O.update()}function W(){O.reset(),p.value=!1,N.value&&f.emit("CalendarCreationCanceled")}function J(){a("refreshCalendar")}const K=()=>{S.value=!0},r=()=>{S.value=!1,f.emit("CalendarDeleted")};function h({personIds:$,groupIds:j}){o.value={groups:j.map(Y=>({id:Y})),people:$.map(Y=>({id:Y}))}}return Se(()=>{s.on("UnitAssignmentChange",h)}),Ye(()=>{s.off("UnitAssignmentChange",h)}),we(()=>e.calendar,$=>{$.id?p.value=!1:p.value=!0,O.reset()}),{editing:p,onEditingChange:C,updateContext:O,Holiday:Me,onSubmit:Q,onCancel:W,isNew:N,calendarOptions:T,loading:k,onClickRefresh:J,onClickDelete:K,onDelete:r,showDeleteModal:S,holidayRef:v}}}),Kt={class:"column flex-fill"},Xt={key:1,class:"text-large text-transform-none text-weight-bold text-secondary"},Zt={key:1,class:"mt-4"};function xt(e,a,m,i,f,g){const y=w("j-skeleton"),s=w("holiday"),v=w("calendar-assignees"),c=w("editable-card"),o=w("calendar-delete-modal");return n(),R("div",null,[d(c,{editing:e.editing,collapsible:!0,collapsed:!0,"action-btn-disabled":e.loading,loading:e.loading,"onUpdate:editing":e.onEditingChange,onCancel:e.onCancel,onConfirm:e.onSubmit},{title:t(()=>[l("div",Kt,[!e.editing&&!e.updateContext.value.name?(n(),D(y,{key:0,class:"pa-0 ma-0",type:"text",style:{width:"150px"}})):(n(),R("div",Xt,[E(u(e.updateContext.value.name)+" ",1),e.calendar.importSource?(n(),D(_,{key:0,name:"folder-arrow-down-thin",size:"md",class:"mb-2"},{default:t(()=>[d(Re,null,{default:t(()=>[E(u(e.$t("holidays.tooltips.calendarImportedFromGoogle")),1)]),_:1})]),_:1})):b("",!0)]))])]),button:t(()=>[d(x,{icon:"ellipsis-horizontal",round:"",size:"sm",color:"grey","text-color":"secondary",style:{height:"36px",width:"36px"}},{default:t(()=>[d(fe,{"transition-show":"slide","transition-hide":"slide"},{default:t(()=>[d(Ca,null,{default:t(()=>[e.calendar.importSource?Ie((n(),D(Ue,{key:0,clickable:"",onClick:e.onClickRefresh},{default:t(()=>[d(ce,{side:""},{default:t(()=>[d(_,{name:"arrow-counterclockwise",size:"24px",color:"grey-1"})]),_:1}),d(ce,null,{default:t(()=>[d(Ae,null,{default:t(()=>[E(u(e.$t("holidays.labels.refreshIndividualCalendar")),1)]),_:1})]),_:1})]),_:1},8,["onClick"])),[[Pe]]):b("",!0),e.calendar.default?b("",!0):Ie((n(),D(Ue,{key:1,clickable:"",onClick:e.onClickDelete},{default:t(()=>[d(ce,{side:""},{default:t(()=>[d(_,{name:"bin",size:"24px",color:"grey-1"})]),_:1}),d(ce,null,{default:t(()=>[d(Ae,null,{default:t(()=>[E(u(e.$t("holidays.labels.deleteCalendar")),1)]),_:1})]),_:1})]),_:1},8,["onClick"])),[[Pe]])]),_:1})]),_:1})]),_:1})]),body:t(()=>[e.editing?(n(),D(s,{key:0,ref:"holidayRef",options:e.calendarOptions,"onUpdate:options":a[0]||(a[0]=p=>e.calendarOptions=p),"model-value":e.updateContext.value,"is-default":e.isDefault,loading:e.loading,"onUpdate:modelValue":a[1]||(a[1]=p=>e.updateContext.replace(p))},null,8,["options","model-value","is-default","loading"])):b("",!0),d(v,{"model-value":e.updateContext.value,editing:e.editing,loading:e.loading},null,8,["model-value","editing","loading"]),e.calendar.importSource?(n(),R("div",Zt,[E(u(e.$t("holidays.labels.calendarInfo.country",{countryName:e.calendar.importSource.name}))+" ",1),e.calendar.calendarImportSourceExtraOption?(n(),R(G,{key:0},[a[3]||(a[3]=l("span",{class:"mx-1 text-grey-4"},"•",-1)),E(" "+u(e.$t("holidays.labels.calendarInfo.region",{regionName:e.calendar.calendarImportSourceExtraOption})),1)],64)):b("",!0)])):b("",!0)]),_:1},8,["editing","action-btn-disabled","loading","onUpdate:editing","onCancel","onConfirm"]),e.showDeleteModal?(n(),D(o,{key:0,calendar:e.calendar,calendars:e.calendars,onClose:a[2]||(a[2]=p=>e.showDeleteModal=!1),onConfirm:e.onDelete},null,8,["calendar","calendars","onConfirm"])):b("",!0)])}const el=oe(Jt,[["render",xt]]),al=ae({components:{ScheduleSelector:Ga,DurationInput:Qa,TimePicker:qa},props:{rule:{type:Object,required:!0},errors:{type:Object,required:!0,default:()=>({})},operationType:{type:String,required:!0},loadingSchedules:Boolean},emits:["deleteRow","update:rule","updated"],setup(e,{emit:a}){const{shortenedDaySchedulePropertyTuple:m,shortenedDayRuleOperationMap:i}=Ge(),f=U(()=>m.map(([p,S])=>({id:p,name:S}))),g=U({get:()=>e.rule,set:p=>{a("update:rule",p)}}),y=U(()=>{var S;const p=[];return g.value.scheduleProperty==="ExpectedWorkHours"&&p.push({id:"Are",name:i.Are},{id:"AreUntil",name:i.AreUntil}),(S=g.value.scheduleProperty)!=null&&S.includes("Daily")&&p.push({id:"StartsAfter",name:i.StartsAfter},{id:"StartsAt",name:i.StartsAt}),p.push({id:"ReducedBy",name:i.ReducedBy}),p.filter(T=>!!T)});function s(){g.value.spanValue=ze.None,g.value.timeOfDayValue=F({hours:12}).format(F.HTML5_FMT.TIME_MS)}function v(){g.value.operation=(y.value[0]||{}).id,s()}const c=U(()=>g.value.scheduleProperty==="ExpectedWorkHours"?"PT24H":"PT23H59M");function o(p){a("updated",p)}return{ruleOperationItems:y,shortenedDayScheduleProperties:f,TimeRangeStyle:ke,shortenedDayRule:g,resetRuleValues:s,updateOperation:v,maxDuration:c,update:o,rules:ve}}}),tl={class:"row items-center justify-between mb-6"},ll={class:"col-12 pb-0"},ol={class:"mb-2"},nl={class:"col-5"},sl={class:"text-grey-2 text-body2"},dl={class:"col-3 px-2"},rl={class:"col-3 pr-1"},il={class:"col-1"},ul={class:"col-12 px-0 pt-1"},ml={class:"row items-center ml-4"},cl={class:"text-body2 text-black"},pl={class:"text-body2 text-black"},fl={key:0,class:"col-11 pt-0 px-0"},yl={class:"ml-8"},hl={key:1,class:"col-12"},vl={class:"v-messages text-negative text-weight-bold"};function gl(e,a,m,i,f,g){const y=w("duration-input"),s=w("time-picker"),v=w("j-skeleton"),c=w("schedule-selector");return n(),R("div",tl,[l("div",ll,[l("div",ol,u(e.$t("holidays.labels.shortenedDay.shortenedDayRule")),1)]),l("div",nl,[d(Ee,{modelValue:e.shortenedDayRule.scheduleProperty,"onUpdate:modelValue":[a[0]||(a[0]=o=>e.shortenedDayRule.scheduleProperty=o),a[1]||(a[1]=()=>{e.update("error"),e.update("ScheduleProperty"),e.updateOperation()})],options:e.shortenedDayScheduleProperties,outlined:"","hide-bottom-sp
1ace":"",class:"select-placeholder","option-label":"name","option-value":"id","map-options":"","emit-value":""},Da({_:2},[e.shortenedDayRule.scheduleProperty?void 0:{name:"prepend",fn:t(()=>[l("span",sl,u(e.$t("holidays.labels.shortenedDay.selectAProperty")),1)]),key:"0"}]),1032,["modelValue","options"])]),e.shortenedDayRule.scheduleProperty?(n(),R(G,{key:0},[l("div",dl,[d(Ee,{modelValue:e.shortenedDayRule.operation,"onUpdate:modelValue":[a[2]||(a[2]=o=>e.shortenedDayRule.operation=o),a[3]||(a[3]=()=>{e.update("Operation"),e.resetRuleValues()})],options:e.ruleOperationItems,outlined:"","hide-bottom-space":"","option-label":"name","option-value":"id","error-message":e.errors.Operation,"map-options":"","emit-value":""},null,8,["modelValue","options","error-message"])]),l("div",rl,[e.operationType===e.TimeRangeStyle.Hours?(n(),D(y,{key:0,modelValue:e.shortenedDayRule.spanValue,"onUpdate:modelValue":[a[4]||(a[4]=o=>e.shortenedDayRule.spanValue=o),a[5]||(a[5]=o=>e.update("SpanValue"))],"error-message":e.errors.SpanValue,"allow-text-wrap":"","max-duration":e.maxDuration},null,8,["modelValue","error-message","max-duration"])):(n(),D(s,{key:1,modelValue:e.shortenedDayRule.timeOfDayValue,"onUpdate:modelValue":[a[6]||(a[6]=o=>e.shortenedDayRule.timeOfDayValue=o),a[7]||(a[7]=o=>e.update("TimeOfDayValue"))],rules:e.rules.notEmpty,format:"iso","error-message":e.errors.TimeOfDayValue},null,8,["modelValue","rules","error-message"]))])],64)):b("",!0),l("div",il,[d(x,{icon:"bin",color:"grey","text-color":"secondary",size:"sm",round:"",class:"ml-3",onClick:a[8]||(a[8]=o=>e.$emit("deleteRow"))},{default:t(()=>[d(Re,null,{default:t(()=>[E(u(e.$t("common.actions.remove")),1)]),_:1})]),_:1})]),e.shortenedDayRule.scheduleProperty?(n(),R(G,{key:1},[l("div",ul,[d($a,{class:"mt-0",borderless:"","hide-bottom-space":"",error:e.errors.hasOwnProperty("ApplyTo"),"error-messages":e.errors.ApplyTo},{default:t(()=>[l("div",ml,[d(ie,{modelValue:e.shortenedDayRule.applyTo,"onUpdate:modelValue":[a[9]||(a[9]=o=>e.shortenedDayRule.applyTo=o),a[10]||(a[10]=o=>e.update("ApplyTo"))],val:"AllSchedules",class:"mr-4 mb-0"},{default:t(()=>[l("span",cl,u(e.$t("holidays.labels.shortenedDay.applyToAllSchedules")),1)]),_:1},8,["modelValue"]),d(ie,{modelValue:e.shortenedDayRule.applyTo,"onUpdate:modelValue":[a[11]||(a[11]=o=>e.shortenedDayRule.applyTo=o),a[12]||(a[12]=o=>e.update("ApplyTo"))],val:"SelectedSchedules"},{default:t(()=>[l("span",pl,u(e.$t("holidays.labels.shortenedDay.applyOnlyToSelectedSchedules")),1)]),_:1},8,["modelValue"])])]),_:1},8,["error","error-messages"])]),e.shortenedDayRule.applyTo==="SelectedSchedules"?(n(),R("div",fl,[l("div",yl,[e.loadingSchedules?(n(),D(v,{key:0,type:"text"})):(n(),D(c,{key:1,modelValue:e.shortenedDayRule.schedules,"onUpdate:modelValue":[a[13]||(a[13]=o=>e.shortenedDayRule.schedules=o),a[14]||(a[14]=o=>e.update("Schedules"))],multiple:"","error-messages":e.errors.Schedules},null,8,["modelValue","error-messages"]))])])):b("",!0),e.errors.error?(n(),R("div",hl,[l("span",vl,u(e.errors.error),1)])):b("",!0)],64)):b("",!0)])}const bl=oe(al,[["render",gl]]),Cl=ae({components:{RightSidebar:_a,ShortenedDayRuleRow:bl},props:{calendarId:{type:String,required:!0},dayToEdit:{type:Object,required:!0},year:{type:Number,default:F().format("YYYY")}},emits:["close","calendarDays"],setup(e,{emit:a}){const m=X(),{getOperationValueType:i}=Ge(),{formRef:f,isFormInvalid:g}=qe(),y=V(!1),s=je(Fe(e.dayToEdit)),v=V(""),c=U(()=>F(e.year,"YYYY").startOf("year").format(ye.YearMonthSlash)),o=U(()=>F(e.year,"YYYY").endOf("year").format(ye.YearMonthSlash)),p=V([]);function S(r){var h;(h=s.rules)==null||h.splice(r,1)}function T(){var r;(r=s.rules)==null||r.push({scheduleProperty:null,operation:null,spanValue:ze.None,timeOfDayValue:F({hours:12}).format(F.HTML5_FMT.TIME_MS),applyTo:"AllSchedules"})}const k=U(()=>{var r;return(r=s.rules)==null?void 0:r.some(h=>h.scheduleProperty==="All"&&h.applyTo==="AllSchedules")}),N=V([]);async function O(){var $,j,Y,P;if(await g())return;const r=W();y.value=!0;const h=($=s.rules)==null?void 0:$.map(I=>(i(I.operation)===ke.Hours?delete I.timeOfDayValue:delete I.spanValue,I.applyTo==="AllSchedules"&&delete I.schedules,{...I})).filter(I=>I.scheduleProperty);try{const I=h==null?void 0:h.map(B=>{var z;return{...B,schedules:((z=B.schedules)==null?void 0:z.map(Z=>wa(Z,["id","name"])))??[]}});if(e.dayToEdit.id)await m.workspace.calendarDays.update(s.id,{name:s.name,date:s.date,rules:I});else{const B=r.map(z=>({id:z.id,name:z.name,date:z.date,calendarId:e.calendarId,status:Qe.Manual,rules:I}));await m.workspace.calendarDays.createBatch(B)}a("calendarDays"),ee(M("timeOff.messages.holidayUpdated")),a("close")}catch(I){const B=(P=(Y=(j=I==null?void 0:I.response)==null?void 0:j.data)==null?void 0:Y.error)==null?void 0:P.details;if(B!=null&&B.length){const z=Array(h==null?void 0:h.length).fill(null).map(()=>({}));
1N.value=B.reduce((Z,ne)=>{const[se,ge="error"]=ne.target.split("."),ue=se.match(/\d+/);if(!se||!ue)return Z;const be=Number(ue[0]);return Z[be][ge]=ne.message,Z},[...z])}else te(I)}finally{y.value=!1}}function H(r){r[0]!==r[1]&&(v.value=r[1]),s.date=r[0]}function L(r,h){const $=F(r);return F(h).diff($,"days",!0)}function C(r){return v.value?L(r,v.value)>=0||"Start date must be at least one day before end date":!0}function Q(r){return r?s.date?L(s.date,r)>=0||"End date must be at least one day after start date":"Start date must be set":!0}function W(){if(!v.value)return[s];const r=L(s.date,v.value),h=[];for(let $=0;$<=r;$++)h.push({...s,date:F(s.date).add($,"days").format("YYYY-MM-DD")});return h}function J(r,h){N.value[r]&&delete N.value[r][h]}we(()=>s.date,()=>{var r;v.value&&((r=f.value)==null||r.validate())}),we(v,()=>{var r;s&&((r=f.value)==null||r.validate())});const K=[...ve.notEmpty,C];return{saving:y,maxDate:o,minDate:c,saveItem:O,startDate:s,endDate:v,rules:ve,validateEndDate:Q,validateStartDate:C,startDateRules:K,TimeRangeStyle:ke,getOperationValueType:i,addShortenedDayRule:T,deleteShortenedDayRule:S,isAddRuleButtonDisabled:k,errors:N,updateErrors:J,formRef:f,dateRange:p,onStartDateChange:H}}}),Dl={class:"form-label text-capitalize"},$l={class:"row mb-4"};function wl(e,a,m,i,f,g){const y=w("j-date-picker"),s=w("shortened-day-rule-row"),v=w("right-sidebar");return n(),D(v,{saving:e.saving,width:720,onCancel:a[4]||(a[4]=c=>e.$emit("close")),onConfirm:a[5]||(a[5]=c=>e.saveItem())},{title:t(()=>[E(u(e.dayToEdit.id?e.$t("holidays.actions.editHoliday"):e.$t("holidays.actions.addHoliday")),1)]),content:t(()=>[d(Le,{ref:"formRef"},{default:t(()=>[l("label",null,u(e.$t("holidays.labels.holidayName")),1),d(re,{modelValue:e.startDate.name,"onUpdate:modelValue":a[0]||(a[0]=c=>e.startDate.name=c),"data-testid":"name-a-holiday",rules:e.rules.itemName,outlined:"",color:"primary",placeholder:e.$t("holidays.labels.holidayName"),class:"text-weight-bold mb-7"},null,8,["modelValue","rules","placeholder"]),l("label",Dl,u(e.dayToEdit.id?e.$t("common.labels.date"):e.$t("common.labels.dates")),1),l("div",$l,[d(re,{"data-testid":"start-date","model-value":e.startDate.date,rules:e.startDateRules,color:"primary",placeholder:e.$t("holidays.labels.startDate"),class:"bordered--readonly mb-2 text-weight-bold",outlined:"",readonly:""},{append:t(()=>[d(_,{name:"calendar-thin"})]),default:t(()=>[d(fe,{"max-width":"290px"},{default:t(()=>[d(y,{modelValue:e.dateRange,"onUpdate:modelValue":[a[1]||(a[1]=c=>e.dateRange=c),e.onStartDateChange],range:"","navigation-min-year-month":e.minDate,"navigation-max-year-month":e.maxDate},null,8,["modelValue","navigation-min-year-month","navigation-max-year-month","onUpdate:modelValue"])]),_:1})]),_:1},8,["model-value","rules","placeholder"]),e.dayToEdit.id?b("",!0):(n(),D(re,{key:0,"data-testid":"end-date","model-value":e.endDate,rules:[e.validateEndDate],color:"primary",placeholder:e.$t("holidays.labels.endDateOptional"),class:"bordered--readonly text-weight-bold ml-2",outlined:"",readonly:""},{append:t(()=>[e.endDate?(n(),D(_,{key:0,name:"xmark",color:"grey-3",size:"16px",left:"",class:"cursor-pointer",onClick:a[2]||(a[2]=c=>e.endDate="")})):b("",!0),d(_,{name:"calendar-thin"})]),default:t(()=>[d(fe,{"max-width":"290px"},{default:t(()=>[d(y,{modelValue:e.endDate,"onUpdate:modelValue":a[3]||(a[3]=c=>e.endDate=c),"navigation-min-year-month":e.minDate,"navigation-max-year-month":e.maxDate},null,8,["modelValue","navigation-min-year-month","navigation-max-year-month"])]),_:1})]),_:1},8,["model-value","rules","placeholder"]))]),e.startDate.rules?(n(!0),R(G,{key:0},He(e.startDate.rules,(c,o)=>(n(),D(s,{key:o,rule:c,errors:e.errors[o],"operation-type":e.getOperationValueType(c.operation),onDeleteRow:p=>e.deleteShortenedDayRule(o),onUpdated:p=>e.updateErrors(o,p)},null,8,["rule","errors","operation-type","onDeleteRow","onUpdated"]))),128)):b("",!0),d(x,{color:"primary",flat:"",dense:"",disable:e.isAddRuleButtonDisabled,onClick:e.addShortenedDayRule},{default:t(()=>[d(_,{name:"plus-add-create",size:"16px",class:"mr-1"}),E(" "+u(e.$t("holidays.actions.addShortenedDayRule")),1)]),_:1},8,["disable","onClick"])]),_:1},512)]),_:1},8,["saving"])}const kl=oe(Cl,[["render",wl]]),Vl=ae({components:{LeftPanelTabs:Ea,LeftPanel:Oa,CalendarCard:el,CalendarUpdater:rt,EditablePanel:za,HolidayEdit:kl,HolidayDelete:Wa,UnitAvatars:Ve,NoSearchResult:Fa,PricingPlanTooltip:Ja},props:{calendarId:{type:String}},setup(e){const a=X(),{findRestriction:m}=ka(),i=Gt();Ua(Ke,i);const f=[{name:"name",label:"",field:"name",align:"left"},{label:Oe(M("common.labels.date")),name:"date",field:"date",sortable:!0,align:"left"},{label:Oe(M("common.labels.day")),name:"day",field:"day",align:"left"},{label:"",name:"actions",field:""}],g=new Ya,y=new Te,s=y.items,v=g.items,c=U(()=>({filter:{"year(Date)":T.value,calendarId:q.from(O.value.id)}})),o=V(!1),p=new Date().getFullYear(),S=[p-1,p,p+1],T=V(S[1]),k=V(!0),N=V(0),O=V({...pe}),H=V(!1),L=V(!1),C=V(!1),Q=V(),W=V(!1),J=V({id:"",name:""}),K=V(!1),r=V(!1),h=V(void 0),$=U(()=>s.value.length===0&&!!h.value&&h.value.length>0),j=U(()=>s.value.length>0||$.value),Y=U(()=>Ta(m(Ia,N.value))),P=S.map(A=>({attrs:{style:{height:"24px",minHeight:0,lineHeight:0}},value:A,label:A.toString()}));Se(async()=>{await Ce(),i.on("FetchCalendars",le),i.on("ResetCalendarDays",B),i.on("CalendarCreated",se),i.on("CalendarUpdated",ne),i.on("CalendarDeleted",Z),i.on("CalendarCreationCanceled",z)}),Ye(()=>{i.off("FetchCalendars",le),i.off("ResetCalendarDays",B),i.off("CalendarCreated",se),i.off("CalendarUpdated",ne),i.off("CalendarDeleted",Z),i.off("CalendarCreationCanceled",z)});async function I(){if(s.value.length===0)O.value={...pe},O.value.default=!0,H.value=!0;else{const A=e.calendarId?s.value.find(me=>me.id===e.calendarId)??s.value[0]:s.value[0];O.value=Object.assign({manual:!1},A),H.value=A==null?void 0:A.default,await g.fetch(c.value)}}const B=()=>g.reset();async function z(){I(),de()}async function Z(){await Ce()}async function ne(){await le(),O.value=s.value.find(A=>A.id===O.value.id)}async function se(A){la(),await le();const me=s.value.find(oa=>oa.id===A);me&&(O.value={...me,manual:!1},T.value=S[1],de())}function ge(){L.value=!1,r.value=!0}function ue(){L.value=!0,r.value=!0}async function be(){await le(),L.value||I()}async function le(){try{k.value=!0;const A={expand:{people:{top:$e*2,select:["id","fullName","picture"],
1count:!0,orderby:{fullName:"asc"},filter:{status:{ne:Ha.Removed}}},groups:{top:$e*2,select:["id","name"],count:!0,orderby:{name:"asc"}},importSource:{select:["name"]}},select:["id","name","default","calendarImportSourceExtraOption"],orderby:{default:"desc",name:"asc"}};await y.fetch(A,h.value??void 0),h.value||(N.value=s.value.length)}catch(A){te(A)}finally{k.value=!1}}const Xe=Va(A=>{O.value={...A,manual:!1},H.value=A.default,de()},500);function Ze(){O.value={...pe,manual:!1,default:s.value.length===0},H.value=s.value.length===0}async function de(){o.value=!0;try{await g.fetch(c.value)}catch(A){te(A)}finally{o.value=!1}}function xe(A){Q.value=A||it,C.value=!0}async function ea(){try{K.value=!0,await a.workspace.calendarDays.delete(J.value.id),await de(),W.value=!1,ee(M("timeOff.messages.holidayDeleted"))}catch(A){te(A)}finally{K.value=!1}}function aa(A){J.value=A,W.value=!0}const ta=async()=>{await Ce()},la=async()=>{h.value=""},Ce=async()=>{await le(),await I()};return{calendars:s,loading:k,calendar:O,onCalendarItemClick:Xe,onRefreshAllCalendars:ge,onRefreshSingleCalendar:ue,onCalendarRefreshed:be,addNewCalendar:Ze,isDefault:H,isUpdatingIndividualCalendar:L,headers:f,calendarDays:v,calendarDaysFilter:c,calendarDaysLoading:o,years:S,selectedYear:T,updateCalendarDays:de,showEditHolidaySidebar:C,calendarDayToEdit:Q,editHoliday:xe,showDeleteHolidayModal:W,deleteHoliday:ea,deletingHoliday:K,holidayToDelete:J,confirmHolidayDestroy:aa,dateFormat:Ra,dateFormatWeekName:Sa,yearOptions:P,shouldShowCalendarUpdaterDialog:r,MAX_UNITS_PREVIEW_COUNT:$e,searchTerm:h,onSearchCalendar:ta,hasNoSearchResult:$,hasCalendar:j,unfilteredCalendarCount:N,maxCalendarCountRestriction:Y}}}),Sl="/assets/manage-shifts-jWaWulp8.svg",Rl={class:"row"},Tl={class:"col-auto tabbed-page__container"},Il={key:1},Ul={class:"row justify-between"},Al={key:0,class:"text-small text-uppercase"},El={key:0,class:"col col-1"},Ol={key:1,class:"text-grey-3 text-italic mt-3 text-body2"},Nl={key:1,class:"text-body2 text-grey-2 ma-5"},Pl={class:"col column no-wrap tabbed-page__container overflow-hidden-y"},Ml={class:"tabs-top-right-section row items-center mr-4"},Hl={class:"flex-center no-wrap flex"},jl={class:"row justify-end"},Ll={class:"text-right"},Bl={class:"column items-center"},Fl={class:"mb-1 text-body1 mt-6 text-weight-bold"},Yl={class:"mb-6 text-body2 text-grey-6"};function zl(e,a,m,i,f,g){const y=w("search-text-field"),s=w("pricing-plan-tooltip"),v=w("j-skeleton"),c=w("unit-avatars"),o=w("left-panel-tabs"),p=w("no-search-result"),S=w("left-panel"),T=w("calendar-card"),k=w("editable-panel"),N=w("j-table"),O=w("holiday-edit"),H=w("holiday-delete"),L=w("calendar-updater");return n(),R("div",Rl,[l("div",Tl,[d(S,null,{"top-action":t(()=>[e.hasCalendar?(n(),D(y,{key:0,modelValue:e.searchTerm,"onUpdate:modelValue":a[0]||(a[0]=C=>e.searchTerm=C),modelModifiers:{trim:!0},class:"px-8",height:"56px","data-testid":"searchable-dropdown-input",autofocus:"",clearable:"",debounce:500,placeholder:e.$t("common.placeholders.search"),onSearch:e.onSearchCalendar},null,8,["modelValue","placeholder","onSearch"])):b("",!0),d(Be),e.hasCalendar?(n(),D(s,{key:1,"model-value":e.maxCalendarCountRestriction,"data-testid":"holiday-calendar-pricing-tooltip"},{default:t(()=>[d(x,{flat:"",color:"primary",class:"ml-2 my-2","data-testid":"button-add-new-calendar",disable:e.maxCalendarCountRestriction.restricted||e.loading,onClick:a[1]||(a[1]=C=>e.addNewCalendar())},{default:t(()=>[d(_,{name:"plus-add-create-thin",size:"24px",class:"mr-2"}),E(" "+u(e.$t("holidays.labels.addNewCalendar")),1)]),_:1},8,["disable"])]),_:1},8,["model-value"])):b("",!0)]),content:t(()=>[e.loading?(n(),D(v,{key:0,type:"article",repeat:3})):(n(),R("div",Il,[e.calendars.length?(n(),D(o,{key:0,items:e.calendars,"model-value":e.calendar,"onUpdate:modelValue":e.onCalendarItemClick},{title:t(({item:C})=>[l("div",Ul,[l("div",{class:he(["col",C.importSource?"col-11":"col-12"])},[E(u(C.name)+" ",1),C.default?(n(),R("div",Al,u(e.$t("holidays.labels.calendarDefault")),1)):b("",!0)],2),C.importSource?(n(),R("div",El,[d(_,{name:"folder-arrow-down-thin",size:"20px"},{default:t(()=>[d(Re,null,{default:t(()=>[E(u(e.$t("holidays.tooltips.calendarImportedFromGoogle")),1)]),_:1})]),_:1})])):b("",!0)])]),content:t(({item:C})=>[C.default?b("",!0):(n(),R(G,{key:0},[C.people.length+C.groups.length>0?(n(),D(c,{key:0,data:C,max:e.MAX_UNITS_PREVIEW_COUNT,"border-color":"secondary-5","item-size":31,class:"mt-2"},null,8,["data","max"])):(n(),R("span",Ol,u(e.$t("common.emptyStates.noAssignedPeopleOrGroups")),1))],64))]),_:1},8,["items","model-value","onUpdate:modelValue"])):e.hasNoSearchResult?b("",!0):(n(),R("div",Nl,u(e.$t("holidays.emptyStates.noCalendarsAdded")),1))])),!e.loading&&e.hasNoSearchResult?(n(),D(p,{key:2,"data-testid":"holidays-no-search-results","search-term":e.searchTerm},null,8,["search-term"])):b("",!0)]),_:1})]),l("div",Pl,[l("div",Ml,[d(x,{class:"btn-compact",color:"text-secondary",outline:"",onClick:e.onRefreshAllCalendars},{default:t(()=>[l("div",Hl,[d(_,{name:"arrow-counterclockwise",left:"",size:"16px"}),E(" "+u(e.$t("holidays.actions.refreshCalendars")),1)])]),_:1},8,["onClick"])]),e.hasNoSearchResult?b("",!0):(n(),D(T,{key:0,calendar:e.calendar,"is-default":e.isDefault,calendars:e.calendars,class:he(["px-9 py-8",{"overflow-auto":!e.calendar.id}]),onRefreshCalendar:e.onRefreshSingleCalendar},null,8,["calendar","is-default","calendars","class","onRefreshCalendar"])),e.loading?(n(),D(v,{key:1,type:"table"})):e.calendar.id?(n(),D(N,{key:2,pagination:{sortBy:"date"},"data-testid":"holidays",columns:e.headers,rows:e.calendarDays,"table-class":"data-table data-table--select","hide-bottom":e.calendarDays.length>0,"row-key":"id",loading:e.calendarDaysLoading},{"header-cell-name":t(()=>[d(Aa,{modelValue:e.selectedYear,"onUpdate:modelValue":[a[2]||(a[2]=C=>e.selectedYear=C),e.updateCalendarDays],options:e.yearOptions,color:"grey-3"},null,8,["modelValue","options","onUpdate:modelValue"])]),"header-cell-actions":t(()=>[l("div",jl,[e.calendarDays.length>0?(n(),D(x,{key:0,"data-testid":"add-holiday",color:"primary",class:"btn-compact",onClick:a[3]||(a[3]=C=>e.editHoliday())},{default:t(()=>[E(u(e.$t("holidays.actions.addHoliday")),1)]),_:1})):b("",!0)])]),"body-cell-date":t(({row:C})=>[E(u(e.dateFormat(C.date)),1)]),"body-cell-day":t(({row:C})=>[E(u(e.dateFormatWeekName(C.date)),1)]),"body-cell-actions":t(({row:C})=>[l("div",Ll,[d(k,{remove:"",onEdit:Q=>e.editHoliday(C),onArchive:Q=>e.confirmHolidayDestroy(C)},null,8,["onEdit","onArchive"])])]),"no-data":t(()=>[l("div",Bl,[a[9]||(a[9]=l("img",{src:Sl},null,-1)),l("p",Fl,u(e.$t("common.emptyStates.noHolidays")),1),l("p",Yl,u(e.$t("holidays.labels.rememberToTimeOff")),1),d(x,{color:"primary",class:"text-weight-bold text-subtitle2",onClick:a[4]||(a[4]=C=>e.editHoliday())},{default:t(()=>[E(u(e.$t("holidays.actions.addHoliday")),1)]),_:1})])]),_:1},8,["columns","rows","hide-bottom","loading"])):b("",!0),e.showEditHolidaySidebar?(n(),D(O,{key:3,"calendar-id":e.calendar.id,"day-to-edit":e.calendarDayToEdit,year:e.selectedYear,onClose:a[5]||(a[5]=C=>e.showEditHolidaySidebar=!1),onCalendarDays:e.updateCalendarDays},null,8,["calendar-id","day-to-edit","year","onCalendarDays"])):b("",!0),e.showDeleteHolidayModal?(n(),D(H,{key:4,deleting:e.deletingHoliday,name:e.holidayToDelete.name,onConfirm:e.deleteHoliday,onClose:a[6]||(a[6]=C=>e.showDeleteHolidayModal=!1)},null,8,["deleting","name","onConfirm"])):b("",!0),e.shouldShowCalendarUpdaterDialog?(n(),D(L,{key:5,calendars:e.isUpdatingIndividualCalendar?[e.calendar]:e.calendars,onClose:a[7]||(a[7]=C=>e.shouldShowCalendarUpdaterDialog=!1),onConfirmed:a[8]||(a[8]=C=>e.onCalendarRefreshed())},null,8,["calendars"])):b("",!0)])])}const Oo=oe(Vl,[["render",zl],["__scopeId","data-v-da6c8c29"]]);export{Oo as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.