hisonvue 1.1.21 → 1.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/{HAccordion-a5UZil7t.js → HAccordion-CKbaRrfY.js} +1 -1
  2. package/dist/{HAccordion-Djhoj_2Q.mjs → HAccordion-CNWAodMp.mjs} +2 -2
  3. package/dist/{HBaggie-CD26mD1p.js → HBaggie-BQYZO1MF.js} +1 -1
  4. package/dist/{HBaggie-YMHv54ny.mjs → HBaggie-C-OS7n2D.mjs} +2 -2
  5. package/dist/{HBanner-DEcDBbAa.js → HBanner-8AQVAGPP.js} +1 -1
  6. package/dist/{HBanner-Glkj36dA.mjs → HBanner-D0ImN6h1.mjs} +2 -2
  7. package/dist/{HButton-zN47uq3g.js → HButton-C1AtcoQd.js} +1 -1
  8. package/dist/{HButton-DlOQpSFM.mjs → HButton-CuoH95_k.mjs} +2 -2
  9. package/dist/{HCalendar-Cr2oVDTO.mjs → HCalendar-CnuUn3Xk.mjs} +1 -1
  10. package/dist/{HCalendar-PxP8M1kE.js → HCalendar-DFXWXkci.js} +1 -1
  11. package/dist/{HCaption-DxOZcWcP.js → HCaption-BaelSNHR.js} +1 -1
  12. package/dist/{HCaption-BbrgZlbJ.mjs → HCaption-Di8ePmqg.mjs} +1 -1
  13. package/dist/{HChart-D217Yxxq.js → HChart-DKfoM5dM.js} +1 -1
  14. package/dist/{HChart-BcslvuI8.mjs → HChart-xM2KDiJi.mjs} +1 -1
  15. package/dist/HDrawer-A3BpOuup.js +1 -0
  16. package/dist/{HDrawer-DlMTX7M_.mjs → HDrawer-Vt4JA6pk.mjs} +163 -163
  17. package/dist/{HDropdown-CvV8k1qQ.mjs → HDropdown-BBEH646p.mjs} +2 -2
  18. package/dist/{HDropdown-BhJOYbaN.js → HDropdown-Dj7h-JPP.js} +1 -1
  19. package/dist/{HFileset-C6dqnLa8.js → HFileset-B9EmgNi1.js} +1 -1
  20. package/dist/{HFileset-x00ZXjyE.mjs → HFileset-oi7P1lcc.mjs} +1 -1
  21. package/dist/{HGap-Do40sUXA.mjs → HGap-Bp1hRvbT.mjs} +1 -1
  22. package/dist/{HGap-BgzODoWp.js → HGap-Dy_H_-in.js} +1 -1
  23. package/dist/{HGrid-Dp7v84g5.mjs → HGrid-Bc13aqjL.mjs} +1 -1
  24. package/dist/{HGrid-CAU32_zq.js → HGrid-DDbU5kIr.js} +1 -1
  25. package/dist/{HImagebox-FYftlSK2.mjs → HImagebox-8Uwvm5U0.mjs} +1 -1
  26. package/dist/{HImagebox-XTSKnoBD.js → HImagebox-BVeQuB4p.js} +1 -1
  27. package/dist/{HInput-DxhtO9q3.js → HInput-DHK28wmp.js} +1 -1
  28. package/dist/{HInput-CInEGmfe.mjs → HInput-DoSKCROI.mjs} +1 -1
  29. package/dist/{HInputGroup-Cou5-12U.mjs → HInputGroup-DSUZqea5.mjs} +1 -1
  30. package/dist/{HInputGroup-DrjZO_7J.js → HInputGroup-gD-E8vgq.js} +1 -1
  31. package/dist/{HLabel-uSniKpDF.js → HLabel-BAbaNhJP.js} +1 -1
  32. package/dist/{HLabel-B4n5-mtx.mjs → HLabel-DQVACpDP.mjs} +2 -2
  33. package/dist/{HLayout-BsPro3dN.mjs → HLayout-BoHgIQcJ.mjs} +1 -1
  34. package/dist/{HLayout-wEq-lzHN.js → HLayout-CgaYkiuH.js} +1 -1
  35. package/dist/{HList-Dko7kLGO.mjs → HList-BQEDGW7_.mjs} +2 -2
  36. package/dist/{HList-DcV0Ssb3.js → HList-BROYxKwn.js} +1 -1
  37. package/dist/{HModal-BkjH2wMJ.js → HModal-DTqm3PfL.js} +1 -1
  38. package/dist/{HModal-D_vWZ5My.mjs → HModal-GpwcBz5c.mjs} +1 -1
  39. package/dist/HNote-BotCfjhk.js +1 -0
  40. package/dist/{HNote-CbfXDxO2.mjs → HNote-Dv8mltb0.mjs} +2 -2
  41. package/dist/{HPagination-Cq2OV1tY.mjs → HPagination-DG0I3Orn.mjs} +2 -2
  42. package/dist/{HPagination-HDTloKdH.js → HPagination-DyqohdbC.js} +1 -1
  43. package/dist/{HParagraph-Bg2lZxZR.js → HParagraph-BheX7M-W.js} +1 -1
  44. package/dist/{HParagraph-BUGeL78g.mjs → HParagraph-dWlO5RLM.mjs} +1 -1
  45. package/dist/{HPopup-3KITyE24.js → HPopup-BcGomDSy.js} +1 -1
  46. package/dist/{HPopup-Lqxe1H-e.mjs → HPopup-BrkB_lUB.mjs} +1 -1
  47. package/dist/{HSpinner-BqVl4t2n.js → HSpinner-CjjGcQJD.js} +1 -1
  48. package/dist/{HSpinner-VJJNUuXg.mjs → HSpinner-D6VNpQLM.mjs} +1 -1
  49. package/dist/{HTable-DzbCLDIn.js → HTable-BdNtBsjD.js} +1 -1
  50. package/dist/{HTable-6O4rYicc.mjs → HTable-D2HYTuO9.mjs} +1 -1
  51. package/dist/hisonvue.cjs.js +1 -1
  52. package/dist/hisonvue.es.js +2 -2
  53. package/dist/{index-Cvhi7T4w.mjs → index-CGr5-mvg.mjs} +1 -1
  54. package/dist/{index-5k-aAQlJ.js → index-DcB16odB.js} +1 -1
  55. package/dist/{setButtonCssEvent-BI-R9EJt.js → setButtonCssEvent-CTLQPvWj.js} +1 -1
  56. package/dist/{setButtonCssEvent-BScAn_gY.mjs → setButtonCssEvent-T2QV1cDz.mjs} +1 -1
  57. package/package.json +1 -1
  58. package/dist/HDrawer-CtMgceI2.js +0 -1
  59. package/dist/HNote-DQr6iUu0.js +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),h=require("./index-5k-aAQlJ.js"),Le=require("./_plugin-vue_export-helper-BHFhmbuH.js");var je=Object.defineProperty,xe=(t,e,l)=>e in t?je(t,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[e]=l,P=(t,e,l)=>xe(t,typeof e!="symbol"?e+"":e,l);const ze=(t,e,l)=>{const a=t[e];return a?typeof a=="function"?a():Promise.resolve(a):new Promise((o,s)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(s.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==l?". Note that variables only represent file names one level deep.":""))))})};let ue,Te,Ee,O,de={},U={};class Ye{constructor(e,l=!1){P(this,"texts",{}),P(this,"dateToMinutes",a=>a.getHours()*60+a.getMinutes()),O=this,this._texts=e,!l&&Date&&!Date.prototype.addDays&&this._initDatePrototypes()}_initDatePrototypes(){Date.prototype.addDays=function(e){return O.addDays(this,e)},Date.prototype.subtractDays=function(e){return O.subtractDays(this,e)},Date.prototype.addHours=function(e){return O.addHours(this,e)},Date.prototype.subtractHours=function(e){return O.subtractHours(this,e)},Date.prototype.addMinutes=function(e){return O.addMinutes(this,e)},Date.prototype.subtractMinutes=function(e){return O.subtractMinutes(this,e)},Date.prototype.getWeek=function(){return O.getWeek(this)},Date.prototype.isToday=function(){return O.isToday(this)},Date.prototype.isLeapYear=function(){return O.isLeapYear(this)},Date.prototype.format=function(e="YYYY-MM-DD"){return O.formatDate(this,e)},Date.prototype.formatTime=function(e="HH:mm"){return O.formatTime(this,e)}}removePrototypes(){delete Date.prototype.addDays,delete Date.prototype.subtractDays,delete Date.prototype.addHours,delete Date.prototype.subtractHours,delete Date.prototype.addMinutes,delete Date.prototype.subtractMinutes,delete Date.prototype.getWeek,delete Date.prototype.isToday,delete Date.prototype.isLeapYear,delete Date.prototype.format,delete Date.prototype.formatTime}updateTexts(e){this._texts=e}_todayFormatted(){return Te!==new Date().getDate()&&(ue=new Date,Te=ue.getDate(),Ee=`${ue.getFullYear()}-${ue.getMonth()}-${ue.getDate()}`),Ee}addDays(e,l){const a=new Date(e.valueOf());return a.setDate(a.getDate()+l),a}subtractDays(e,l){const a=new Date(e.valueOf());return a.setDate(a.getDate()-l),a}addHours(e,l){const a=new Date(e.valueOf());return a.setHours(a.getHours()+l),a}subtractHours(e,l){const a=new Date(e.valueOf());return a.setHours(a.getHours()-l),a}addMinutes(e,l){const a=new Date(e.valueOf());return a.setMinutes(a.getMinutes()+l),a}subtractMinutes(e,l){const a=new Date(e.valueOf());return a.setMinutes(a.getMinutes()-l),a}getWeek(e){const l=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())),a=l.getUTCDay()||7;l.setUTCDate(l.getUTCDate()+4-a);const o=new Date(Date.UTC(l.getUTCFullYear(),0,1));return Math.ceil(((l-o)/864e5+1)/7)}isToday(e){return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`===this._todayFormatted()}isLeapYear(e){const l=e.getFullYear();return!(l%400)||l%100&&!(l%4)}getPreviousFirstDayOfWeek(e=null,l){const a=e&&new Date(e.valueOf())||new Date,o=l?7:6;return a.setDate(a.getDate()-(a.getDay()+o)%7),a}stringToDate(e){return e instanceof Date?e:(e.length===10&&(e+=" 00:00"),new Date(e.replace(/-/g,"/")))}countDays(e,l){typeof e=="string"&&(e=e.replace(/-/g,"/")),typeof l=="string"&&(l=l.replace(/-/g,"/")),e=new Date(e).setHours(0,0,0,0),l=new Date(l).setHours(0,0,1,0);const a=(new Date(l).getTimezoneOffset()-new Date(e).getTimezoneOffset())*60*1e3;return Math.ceil((l-e-a)/(24*3600*1e3))}datesInSameTimeStep(e,l,a){return Math.abs(e.getTime()-l.getTime())<=a*60*1e3}formatDate(e,l="YYYY-MM-DD",a=null){if(a||(a=this._texts),l||(l="YYYY-MM-DD"),l==="YYYY-MM-DD")return this.formatDateLite(e);de={},U={};const o={YYYY:()=>this._hydrateDateObject(e,a).YYYY,YY:()=>this._hydrateDateObject(e,a).YY(),M:()=>this._hydrateDateObject(e,a).M,MM:()=>this._hydrateDateObject(e,a).MM(),MMM:()=>this._hydrateDateObject(e,a).MMM(),MMMM:()=>this._hydrateDateObject(e,a).MMMM(),MMMMG:()=>this._hydrateDateObject(e,a).MMMMG(),D:()=>this._hydrateDateObject(e,a).D,DD:()=>this._hydrateDateObject(e,a).DD(),S:()=>this._hydrateDateObject(e,a).S(),d:()=>this._hydrateDateObject(e,a).d,dd:()=>this._hydrateDateObject(e,a).dd(),ddd:()=>this._hydrateDateObject(e,a).ddd(),dddd:()=>this._hydrateDateObject(e,a).dddd(),HH:()=>this._hydrateTimeObject(e,a).HH,H:()=>this._hydrateTimeObject(e,a).H,hh:()=>this._hydrateTimeObject(e,a).hh,h:()=>this._hydrateTimeObject(e,a).h,am:()=>this._hydrateTimeObject(e,a).am,AM:()=>this._hydrateTimeObject(e,a).AM,mm:()=>this._hydrateTimeObject(e,a).mm,m:()=>this._hydrateTimeObject(e,a).m};return l.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g,(s,u)=>{const r=o[u.replace(/\{|\}/g,"")];return r!==void 0?r():u})}formatDateLite(e){const l=e.getMonth()+1,a=e.getDate();return`${e.getFullYear()}-${l<10?"0":""}${l}-${a<10?"0":""}${a}`}formatTime(e,l="HH:mm",a=null,o=!1){let s=!1;if(o){const[m,c,v]=[e.getHours(),e.getMinutes(),e.getSeconds()];m+c+v===141&&(s=!0)}if(e instanceof Date&&l==="HH:mm")return s?"24:00":this.formatTimeLite(e);U={},a||(a=this._texts);const u=this._hydrateTimeObject(e,a),r=l.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g,(m,c)=>{const v=u[c.replace(/\{|\}/g,"")];return v!==void 0?v:c});return s?r.replace("23:59","24:00"):r}formatTimeLite(e){const l=e.getHours(),a=e.getMinutes();return`${(l<10?"0":"")+l}:${(a<10?"0":"")+a}`}_nth(e){if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}_hydrateDateObject(e,l){if(de.D)return de;const a=e.getFullYear(),o=e.getMonth()+1,s=e.getDate(),r=(e.getDay()-1+7)%7;return de={YYYY:a,YY:()=>a.toString().substring(2),M:o,MM:()=>(o<10?"0":"")+o,MMM:()=>l.months[o-1].substring(0,3),MMMM:()=>l.months[o-1],MMMMG:()=>(l.monthsGenitive||l.months)[o-1],D:s,DD:()=>(s<10?"0":"")+s,S:()=>this._nth(s),d:r+1,dd:()=>l.weekDays[r][0],ddd:()=>l.weekDays[r].substr(0,3),dddd:()=>l.weekDays[r]},de}_hydrateTimeObject(e,l){if(U.am)return U;let a,o;e instanceof Date?(a=e.getHours(),o=e.getMinutes()):(a=Math.floor(e/60),o=Math.floor(e%60));const s=a%12?a%12:12,u=(l||{am:"am",pm:"pm"})[a===24||a<12?"am":"pm"];return U={H:a,h:s,HH:(a<10?"0":"")+a,hh:(s<10?"0":"")+s,am:u,AM:u.toUpperCase(),m:o,mm:(o<10?"0":"")+o},U}}const Ie=24*60;class qe{constructor(e){P(this,"_vuecal",null),P(this,"selectCell",(l=!1,a,o)=>{this._vuecal.$emit("cell-click",o?{date:a,split:o}:a),this._vuecal.clickToNavigate||l?this._vuecal.switchToNarrowerView():this._vuecal.dblclickToNavigate&&"ontouchstart"in window&&(this._vuecal.domEvents.dblTapACell.taps++,setTimeout(()=>this._vuecal.domEvents.dblTapACell.taps=0,this._vuecal.domEvents.dblTapACell.timeout),this._vuecal.domEvents.dblTapACell.taps>=2&&(this._vuecal.domEvents.dblTapACell.taps=0,this._vuecal.switchToNarrowerView(),this._vuecal.$emit("cell-dblclick",o?{date:a,split:o}:a)))}),P(this,"keyPressEnterCell",(l,a)=>{this._vuecal.$emit("cell-keypress-enter",a?{date:l,split:a}:l),this._vuecal.switchToNarrowerView()}),P(this,"getPosition",l=>{const{left:a,top:o}=this._vuecal.cellsEl.getBoundingClientRect(),{clientX:s,clientY:u}="ontouchstart"in window&&l.touches?l.touches[0]:l;return{x:s-a,y:u-o}}),P(this,"minutesAtCursor",l=>{let a=0,o={x:0,y:0};const{timeStep:s,timeCellHeight:u,timeFrom:r}=this._vuecal.$props;return typeof l=="number"?a=l:typeof l=="object"&&(o=this.getPosition(l),a=Math.round(o.y*s/parseInt(u)+r)),{minutes:Math.max(Math.min(a,Ie),0),cursorCoords:o}}),this._vuecal=e}}const Re=2,we=24*60;let p,k,ge;class Ue{constructor(e,l){P(this,"_vuecal",null),P(this,"eventDefaults",{_eid:null,start:"",startTimeMinutes:0,end:"",endTimeMinutes:0,title:"",content:"",background:!1,allDay:!1,segments:null,repeat:null,daysCount:1,deletable:!0,deleting:!1,titleEditable:!0,resizable:!0,resizing:!1,draggable:!0,dragging:!1,draggingStatic:!1,focused:!1,class:""}),this._vuecal=e,p=l}createAnEvent(e,l,a){if(typeof e=="string"&&(e=p.stringToDate(e)),!(e instanceof Date))return!1;const o=p.dateToMinutes(e);l=l*1||Re*60;const s=o+l,u=p.addMinutes(new Date(e),l);a.end&&(typeof a.end=="string"&&(a.end=p.stringToDate(a.end)),a.endTimeMinutes=p.dateToMinutes(a.end));const r={...this.eventDefaults,_eid:`${this._vuecal._.uid}_${this._vuecal.eventIdIncrement++}`,start:e,startTimeMinutes:o,end:u,endTimeMinutes:s,segments:null,...a};if(!(typeof this._vuecal.onEventCreate=="function"&&!this._vuecal.onEventCreate(r,()=>this.deleteAnEvent(r))))return r.startDateF!==r.endDateF&&(r.daysCount=p.countDays(r.start,r.end)),this._vuecal.mutableEvents.push(r),this._vuecal.addEventsToView([r]),this._vuecal.emitWithEvent("event-create",r),this._vuecal.$emit("event-change",{event:this._vuecal.cleanupEvent(r),originalEvent:null}),r}addEventSegment(e){e.segments||(e.segments={},e.segments[p.formatDateLite(e.start)]={start:e.start,startTimeMinutes:e.startTimeMinutes,endTimeMinutes:we,isFirstDay:!0,isLastDay:!1});const l=e.segments[p.formatDateLite(e.end)];l&&(l.isLastDay=!1,l.endTimeMinutes=we);const a=p.addDays(e.end,1),o=p.formatDateLite(a);return a.setHours(0,0,0,0),e.segments[o]={start:a,startTimeMinutes:0,endTimeMinutes:e.endTimeMinutes,isFirstDay:!1,isLastDay:!0},e.end=p.addMinutes(a,e.endTimeMinutes),e.daysCount=Object.keys(e.segments).length,o}removeEventSegment(e){let l=Object.keys(e.segments).length;if(l<=1)return p.formatDateLite(e.end);delete e.segments[p.formatDateLite(e.end)],l--;const a=p.subtractDays(e.end,1),o=p.formatDateLite(a),s=e.segments[o];return l?s&&(s.isLastDay=!0,s.endTimeMinutes=e.endTimeMinutes):e.segments=null,e.daysCount=l||1,e.end=a,o}createEventSegments(e,l,a){const o=l.getTime(),s=a.getTime();let u=e.start.getTime(),r=e.end.getTime(),m=!1,c,v,y;for(!e.end.getHours()&&!e.end.getMinutes()&&(r-=1e3),e.segments={},e.repeat?(c=o,v=Math.min(s,e.repeat.until?p.stringToDate(e.repeat.until).getTime():s)):(c=Math.max(o,u),v=Math.min(s,r));c<=v;){let w=!1;const T=p.addDays(new Date(c),1).setHours(0,0,0,0);let g,_,E,D;if(e.repeat){const V=new Date(c),C=p.formatDateLite(V);(m||e.occurrences&&e.occurrences[C])&&(m||(u=e.occurrences[C].start,y=new Date(u).setHours(0,0,0,0),r=e.occurrences[C].end),m=!0,w=!0),g=c===y,_=C===p.formatDateLite(new Date(r)),E=new Date(g?u:c),D=p.formatDateLite(E),_&&(m=!1)}else w=!0,g=c===u,_=v===r&&T>v,E=g?e.start:new Date(c),D=p.formatDateLite(g?e.start:E);w&&(e.segments[D]={start:E,startTimeMinutes:g?e.startTimeMinutes:0,endTimeMinutes:_?e.endTimeMinutes:we,isFirstDay:g,isLastDay:_}),c=T}return e}deleteAnEvent(e){this._vuecal.emitWithEvent("event-delete",e),this._vuecal.mutableEvents=this._vuecal.mutableEvents.filter(l=>l._eid!==e._eid),this._vuecal.view.events=this._vuecal.view.events.filter(l=>l._eid!==e._eid)}checkCellOverlappingEvents(e,l){ge=e.slice(0),k={},e.forEach(o=>{ge.shift(),k[o._eid]||(k[o._eid]={overlaps:[],start:o.start,position:0}),k[o._eid].position=0,ge.forEach(s=>{k[s._eid]||(k[s._eid]={overlaps:[],start:s.start,position:0});const u=this.eventInRange(s,o.start,o.end),r=l.overlapsPerTimeStep?p.datesInSameTimeStep(o.start,s.start,l.timeStep):1;if(!o.background&&!o.allDay&&!s.background&&!s.allDay&&u&&r)k[o._eid].overlaps.push(s._eid),k[o._eid].overlaps=[...new Set(k[o._eid].overlaps)],k[s._eid].overlaps.push(o._eid),k[s._eid].overlaps=[...new Set(k[s._eid].overlaps)],k[s._eid].position++;else{let m,c;(m=(k[o._eid]||{overlaps:[]}).overlaps.indexOf(s._eid))>-1&&k[o._eid].overlaps.splice(m,1),(c=(k[s._eid]||{overlaps:[]}).overlaps.indexOf(o._eid))>-1&&k[s._eid].overlaps.splice(c,1),k[s._eid].position--}})});let a=0;for(const o in k){const s=k[o],u=s.overlaps.map(r=>({id:r,start:k[r].start}));u.push({id:o,start:s.start}),u.sort((r,m)=>r.start<m.start?-1:r.start>m.start?1:r.id>m.id?-1:1),s.position=u.findIndex(r=>r.id===o),a=Math.max(this.getOverlapsStreak(s,k),a)}return[k,a]}getOverlapsStreak(e,l={}){let a=e.overlaps.length+1,o=[];return e.overlaps.forEach(s=>{o.includes(s)||e.overlaps.filter(r=>r!==s).forEach(r=>{l[r].overlaps.includes(s)||o.push(r)})}),o=[...new Set(o)],a-=o.length,a}eventInRange(e,l,a){if(e.allDay||!this._vuecal.time){const u=new Date(e.start).setHours(0,0,0,0);return new Date(e.end).setHours(23,59,0,0)>=new Date(l).setHours(0,0,0,0)&&u<=new Date(a).setHours(0,0,0,0)}const o=e.start.getTime(),s=e.end.getTime();return o<a.getTime()&&s>l.getTime()}}const Ke={class:"vuecal__flex vuecal__weekdays-headings"},Ge=["onClick"],Xe={class:"vuecal__flex weekday-label",grow:""},Je={class:"full"},Ze={class:"small"},Qe={class:"xsmall"},$e={key:0},et={key:0,class:"vuecal__flex vuecal__split-days-headers",grow:""};function tt(t,e,l,a,o,s){return i.openBlock(),i.createElementBlock("div",Ke,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.headings,(u,r)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:r},[u.hide?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["vuecal__flex vuecal__heading",{today:u.today,clickable:s.cellHeadingsClickable}]),style:i.normalizeStyle(s.weekdayCellStyles),onClick:m=>s.view.id==="week"&&s.selectCell(u.date,m),onDblclick:e[0]||(e[0]=m=>s.view.id==="week"&&s.vuecal.dblclickToNavigate&&l.switchToNarrowerView())},[i.createVNode(i.Transition,{name:`slide-fade--${l.transitionDirection}`,appear:s.vuecal.transitions},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("div",{class:"vuecal__flex",column:"",key:s.vuecal.transitions?`${r}-${u.dayOfMonth}`:!1},[i.createElementVNode("div",Xe,[i.renderSlot(t.$slots,"weekday-heading",{heading:s.cleanupHeading(u),view:s.view},()=>[i.createElementVNode("span",Je,i.toDisplayString(u.full),1),i.createElementVNode("span",Ze,i.toDisplayString(u.small),1),i.createElementVNode("span",Qe,i.toDisplayString(u.xsmall),1),u.dayOfMonth?(i.openBlock(),i.createElementBlock("span",$e," "+i.toDisplayString(u.dayOfMonth),1)):i.createCommentVNode("",!0)])]),s.vuecal.hasSplits&&s.vuecal.stickySplitLabels?(i.openBlock(),i.createElementBlock("div",et,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.vuecal.daySplits,(m,c)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["day-split-header",m.class||!1]),key:c},[i.renderSlot(t.$slots,"split-label",{split:m,view:s.view},()=>[i.createTextVNode(i.toDisplayString(m.label),1)])],2))),128))])):i.createCommentVNode("",!0)]))]),_:2},1032,["name","appear"])],46,Ge))],64))),128))])}const K=(t,e)=>{const l=t.__vccOpts||t;for(const[a,o]of e)l[a]=o;return l},it={inject:["vuecal","utils","view"],props:{transitionDirection:{type:String,default:"right"},weekDays:{type:Array,default:()=>[]},switchToNarrowerView:{type:Function,default:()=>{}}},methods:{selectCell(t,e){t.getTime()!==this.view.selectedDate.getTime()&&(this.view.selectedDate=t),this.utils.cell.selectCell(!1,t,e)},cleanupHeading:t=>({label:t.full,date:t.date,...t.today?{today:t.today}:{}})},computed:{headings(){if(!["month","week"].includes(this.view.id))return[];let t=!1;return this.weekDays.map((l,a)=>{const o=this.utils.date.addDays(this.view.startDate,this.vuecal.startWeekOnSunday&&this.vuecal.hideWeekends?a-1:a);return{hide:l.hide,full:l.label,small:l.short||l.label.substr(0,3),xsmall:l.short||l.label.substr(0,1),...this.view.id==="week"?{dayOfMonth:o.getDate(),date:o,today:!t&&this.utils.date.isToday(o)&&!t++}:{}}})},cellWidth(){return 100/(7-this.weekDays.reduce((t,e)=>t+e.hide,0))},weekdayCellStyles(){return{...this.vuecal.hideWeekdays.length?{width:`${this.cellWidth}%`}:{}}},cellHeadingsClickable(){return this.view.id==="week"&&(this.vuecal.clickToNavigate||this.vuecal.dblclickToNavigate)}}},Ve=K(it,[["render",tt]]),st={class:"vuecal__header"},lt={key:0,class:"vuecal__flex vuecal__menu",role:"tablist","aria-label":"Calendar views navigation"},at=["onDragenter","onDragleave","onClick","aria-label"],nt={key:1,class:"vuecal__title-bar"},rt=["aria-label"],ot={class:"vuecal__flex vuecal__title",grow:""},ut=["aria-label"],dt={key:0,class:"vuecal__flex vuecal__split-days-headers"};function ct(t,e,l,a,o,s){const u=i.resolveComponent("weekdays-headings");return i.openBlock(),i.createElementBlock("div",st,[l.options.hideViewSelector?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",lt,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.viewProps.views,(r,m)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:m},[r.enabled?(i.openBlock(),i.createElementBlock("button",{key:0,class:i.normalizeClass(["vuecal__view-btn",{"vuecal__view-btn--active":s.view.id===m,"vuecal__view-btn--highlighted":t.highlightedControl===m}]),type:"button",onDragenter:c=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragEnter(c,m,t.$data),onDragleave:c=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragLeave(c,m,t.$data),onClick:c=>s.switchView(m,null,!0),"aria-label":`${r.label} view`},i.toDisplayString(r.label),43,at)):i.createCommentVNode("",!0)],64))),128))])),l.options.hideTitleBar?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",nt,[i.createElementVNode("button",{class:i.normalizeClass(["vuecal__arrow vuecal__arrow--prev",{"vuecal__arrow--highlighted":t.highlightedControl==="previous"}]),type:"button",onClick:e[0]||(e[0]=(...r)=>s.previous&&s.previous(...r)),onDragenter:e[1]||(e[1]=r=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragEnter(r,"previous",t.$data)),onDragleave:e[2]||(e[2]=r=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragLeave(r,"previous",t.$data)),"aria-label":`Previous ${s.view.id}`},[i.renderSlot(t.$slots,"arrow-prev")],42,rt),i.createElementVNode("div",ot,[i.createVNode(i.Transition,{name:l.options.transitions?`slide-fade--${s.transitionDirection}`:""},{default:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(s.broaderView?"button":"span"),{type:!!s.broaderView&&"button",key:`${s.view.id}${s.view.startDate.toString()}`,onClick:e[3]||(e[3]=r=>!!s.broaderView&&s.switchToBroaderView()),"aria-label":!!s.broaderView&&`Go to ${s.broaderView} view`},{default:i.withCtx(()=>[i.renderSlot(t.$slots,"title")]),_:3},8,["type","aria-label"]))]),_:3},8,["name"])]),l.options.todayButton?(i.openBlock(),i.createElementBlock("button",{key:0,class:i.normalizeClass(["vuecal__today-btn",{"vuecal__today-btn--highlighted":t.highlightedControl==="today"}]),type:"button",onClick:e[4]||(e[4]=(...r)=>s.goToToday&&s.goToToday(...r)),onDragenter:e[5]||(e[5]=r=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragEnter(r,"today",t.$data)),onDragleave:e[6]||(e[6]=r=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragLeave(r,"today",t.$data)),"aria-label":"Today"},[i.renderSlot(t.$slots,"today-button")],34)):i.createCommentVNode("",!0),i.createElementVNode("button",{class:i.normalizeClass(["vuecal__arrow vuecal__arrow--next",{"vuecal__arrow--highlighted":t.highlightedControl==="next"}]),type:"button",onClick:e[7]||(e[7]=(...r)=>s.next&&s.next(...r)),onDragenter:e[8]||(e[8]=r=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragEnter(r,"next",t.$data)),onDragleave:e[9]||(e[9]=r=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragLeave(r,"next",t.$data)),"aria-label":`Next ${s.view.id}`},[i.renderSlot(t.$slots,"arrow-next")],42,ut)])),l.viewProps.weekDaysInHeader?(i.openBlock(),i.createBlock(u,{key:2,"week-days":l.weekDays,"transition-direction":s.transitionDirection,"switch-to-narrower-view":l.switchToNarrowerView},i.createSlots({_:2},[t.$slots["weekday-heading"]?{name:"weekday-heading",fn:i.withCtx(({heading:r,view:m})=>[i.renderSlot(t.$slots,"weekday-heading",{heading:r,view:m})]),key:"0"}:void 0,t.$slots["split-label"]?{name:"split-label",fn:i.withCtx(({split:r})=>[i.renderSlot(t.$slots,"split-label",{split:r,view:s.view})]),key:"1"}:void 0]),1032,["week-days","transition-direction","switch-to-narrower-view"])):i.createCommentVNode("",!0),i.createVNode(i.Transition,{name:`slide-fade--${s.transitionDirection}`},{default:i.withCtx(()=>[s.showDaySplits?(i.openBlock(),i.createElementBlock("div",dt,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.daySplits,(r,m)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["day-split-header",r.class||!1]),key:m},[i.renderSlot(t.$slots,"split-label",{split:r,view:s.view.id},()=>[i.createTextVNode(i.toDisplayString(r.label),1)])],2))),128))])):i.createCommentVNode("",!0)]),_:3},8,["name"])])}const ht={inject:["vuecal","previous","next","switchView","updateSelectedDate","modules","view"],components:{WeekdaysHeadings:Ve},props:{options:{type:Object,default:()=>({})},editEvents:{type:Object,required:!0},hasSplits:{type:[Boolean,Number],default:!1},daySplits:{type:Array,default:()=>[]},viewProps:{type:Object,default:()=>({})},weekDays:{type:Array,default:()=>[]},switchToNarrowerView:{type:Function,default:()=>{}}},data:()=>({highlightedControl:null}),methods:{goToToday(){this.updateSelectedDate(new Date(new Date().setHours(0,0,0,0)))},switchToBroaderView(){this.transitionDirection="left",this.broaderView&&this.switchView(this.broaderView)}},computed:{transitionDirection:{get(){return this.vuecal.transitionDirection},set(t){this.vuecal.transitionDirection=t}},broaderView(){const{enabledViews:t}=this.vuecal;return t[t.indexOf(this.view.id)-1]},showDaySplits(){return this.view.id==="day"&&this.hasSplits&&this.options.stickySplitLabels&&!this.options.minSplitWidth},dnd(){return this.modules.dnd}}},vt=K(ht,[["render",ct]]),mt=["draggable"];function yt(t,e,l,a,o,s){return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["vuecal__event",s.eventClasses]),style:i.normalizeStyle(s.eventStyles),tabindex:"0",onFocus:e[4]||(e[4]=(...u)=>s.focusEvent&&s.focusEvent(...u)),onKeypress:e[5]||(e[5]=i.withKeys(i.withModifiers((...u)=>s.onEnterKeypress&&s.onEnterKeypress(...u),["stop"]),["enter"])),onMouseenter:e[6]||(e[6]=(...u)=>s.onMouseEnter&&s.onMouseEnter(...u)),onMouseleave:e[7]||(e[7]=(...u)=>s.onMouseLeave&&s.onMouseLeave(...u)),onTouchstart:e[8]||(e[8]=i.withModifiers((...u)=>s.onTouchStart&&s.onTouchStart(...u),["stop"])),onMousedown:e[9]||(e[9]=u=>s.onMouseDown(u)),onMouseup:e[10]||(e[10]=(...u)=>s.onMouseUp&&s.onMouseUp(...u)),onTouchend:e[11]||(e[11]=(...u)=>s.onMouseUp&&s.onMouseUp(...u)),onTouchmove:e[12]||(e[12]=(...u)=>s.onTouchMove&&s.onTouchMove(...u)),onDblclick:e[13]||(e[13]=(...u)=>s.onDblClick&&s.onDblClick(...u)),draggable:s.draggable,onDragstart:e[14]||(e[14]=u=>s.draggable&&s.onDragStart(u)),onDragend:e[15]||(e[15]=u=>s.draggable&&s.onDragEnd())},[s.vuecal.editEvents.delete&&l.event.deletable?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__event-delete",onClick:e[0]||(e[0]=i.withModifiers((...u)=>s.deleteEvent&&s.deleteEvent(...u),["stop"])),onTouchstart:e[1]||(e[1]=i.withModifiers((...u)=>s.touchDeleteEvent&&s.touchDeleteEvent(...u),["stop"]))},i.toDisplayString(s.vuecal.texts.deleteEvent),33)):i.createCommentVNode("",!0),i.renderSlot(t.$slots,"event",{event:l.event,view:s.view.id}),s.resizable?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__event-resize-handle",contenteditable:"false",onMousedown:e[2]||(e[2]=i.withModifiers((...u)=>s.onResizeHandleMouseDown&&s.onResizeHandleMouseDown(...u),["stop","prevent"])),onTouchstart:e[3]||(e[3]=i.withModifiers((...u)=>s.onResizeHandleMouseDown&&s.onResizeHandleMouseDown(...u),["stop","prevent"]))},null,32)):i.createCommentVNode("",!0)],46,mt)}const ft={inject:["vuecal","utils","modules","view","domEvents","editEvents"],props:{cellFormattedDate:{type:String,default:""},event:{type:Object,default:()=>({})},cellEvents:{type:Array,default:()=>[]},overlaps:{type:Array,default:()=>[]},eventPosition:{type:Number,default:0},overlapsStreak:{type:Number,default:0},allDay:{type:Boolean,default:!1}},data:()=>({touch:{dragThreshold:30,startX:0,startY:0,dragged:!1}}),methods:{onMouseDown(t,e=!1){if("ontouchstart"in window&&!e)return!1;const{clickHoldAnEvent:l,focusAnEvent:a,resizeAnEvent:o,dragAnEvent:s}=this.domEvents;if(a._eid===this.event._eid&&l._eid===this.event._eid)return!0;this.focusEvent(),l._eid=null,this.vuecal.editEvents.delete&&this.event.deletable&&(l.timeoutId=setTimeout(()=>{!o._eid&&!s._eid&&(l._eid=this.event._eid,this.event.deleting=!0)},l.timeout))},onMouseUp(t){this.domEvents.focusAnEvent._eid===this.event._eid&&!this.touch.dragged&&(this.domEvents.focusAnEvent.mousedUp=!0),this.touch.dragged=!1},onMouseEnter(t){t.preventDefault(),this.vuecal.emitWithEvent("event-mouse-enter",this.event)},onMouseLeave(t){t.preventDefault(),this.vuecal.emitWithEvent("event-mouse-leave",this.event)},onTouchMove(t){if(typeof this.vuecal.onEventClick!="function")return;const{clientX:e,clientY:l}=t.touches[0],{startX:a,startY:o,dragThreshold:s}=this.touch;(Math.abs(e-a)>s||Math.abs(l-o)>s)&&(this.touch.dragged=!0)},onTouchStart(t){this.touch.startX=t.touches[0].clientX,this.touch.startY=t.touches[0].clientY,this.onMouseDown(t,!0)},onEnterKeypress(t){if(typeof this.vuecal.onEventClick=="function")return this.vuecal.onEventClick(this.event,t)},onDblClick(t){if(typeof this.vuecal.onEventDblclick=="function")return this.vuecal.onEventDblclick(this.event,t)},onDragStart(t){this.dnd&&this.dnd.eventDragStart(t,this.event)},onDragEnd(){this.dnd&&this.dnd.eventDragEnd(this.event)},onResizeHandleMouseDown(){this.focusEvent(),this.domEvents.dragAnEvent._eid=null,this.domEvents.resizeAnEvent=Object.assign(this.domEvents.resizeAnEvent,{_eid:this.event._eid,start:(this.segment||this.event).start,split:this.event.split||null,segment:!!this.segment&&this.utils.date.formatDateLite(this.segment.start),originalEnd:new Date((this.segment||this.event).end),originalEndTimeMinutes:this.event.endTimeMinutes}),this.event.resizing=!0},deleteEvent(t=!1){if("ontouchstart"in window&&!t)return!1;this.utils.event.deleteAnEvent(this.event)},touchDeleteEvent(t){this.deleteEvent(!0)},cancelDeleteEvent(){this.event.deleting=!1},focusEvent(){const{focusAnEvent:t}=this.domEvents,e=t._eid;if(e!==this.event._eid){if(e){const l=this.view.events.find(a=>a._eid===e);l&&(l.focused=!1)}this.vuecal.cancelDelete(),this.vuecal.emitWithEvent("event-focus",this.event),t._eid=this.event._eid,this.event.focused=!0}}},computed:{eventDimensions(){const{startTimeMinutes:t,endTimeMinutes:e}=this.segment||this.event;let l=t-this.vuecal.timeFrom;const a=Math.max(Math.round(l*this.vuecal.timeCellHeight/this.vuecal.timeStep),0);l=Math.min(e,this.vuecal.timeTo)-this.vuecal.timeFrom;const o=Math.round(l*this.vuecal.timeCellHeight/this.vuecal.timeStep),s=Math.max(o-a,5);return{top:a,height:s}},eventStyles(){if(this.event.allDay||!this.vuecal.time||!this.event.endTimeMinutes||this.view.id==="month"||this.allDay)return{};let t=100/Math.min(this.overlaps.length+1,this.overlapsStreak),e=100/(this.overlaps.length+1)*this.eventPosition;this.vuecal.minEventWidth&&t<this.vuecal.minEventWidth&&(t=this.vuecal.minEventWidth,e=(100-this.vuecal.minEventWidth)/this.overlaps.length*this.eventPosition);const{top:l,height:a}=this.eventDimensions;return{top:`${l}px`,height:`${a}px`,width:`${t}%`,left:this.event.left&&`${this.event.left}px`||`${e}%`}},eventClasses(){const{isFirstDay:t,isLastDay:e}=this.segment||{};return{[this.event.class]:!!this.event.class,"vuecal__event--focus":this.event.focused,"vuecal__event--resizing":this.event.resizing,"vuecal__event--background":this.event.background,"vuecal__event--deletable":this.event.deleting,"vuecal__event--all-day":this.event.allDay,"vuecal__event--dragging":!this.event.draggingStatic&&this.event.dragging,"vuecal__event--static":this.event.dragging&&this.event.draggingStatic,"vuecal__event--multiple-days":!!this.segment,"event-start":this.segment&&t&&!e,"event-middle":this.segment&&!t&&!e,"event-end":this.segment&&e&&!t}},segment(){return this.event.segments&&this.event.segments[this.cellFormattedDate]||null},draggable(){const{draggable:t,background:e,daysCount:l}=this.event;return this.vuecal.editEvents.drag&&t&&!e&&l===1},resizable(){const{editEvents:t,time:e}=this.vuecal;return t.resize&&this.event.resizable&&e&&!this.allDay&&(!this.segment||this.segment&&this.segment.isLastDay)&&this.view.id!=="month"},dnd(){return this.modules.dnd}}},wt=K(ft,[["render",yt]]),gt=["data-split","aria-label","onTouchstart","onMousedown","onDragover","onDrop"],Dt={key:0,class:"cell-time-labels"},pt=["innerHTML"],kt={key:2,class:"vuecal__cell-events"},Ct=["title"];function bt(t,e,l,a,o,s){const u=i.resolveComponent("event");return i.openBlock(),i.createBlock(i.TransitionGroup,{class:i.normalizeClass(["vuecal__cell",s.cellClasses]),name:`slide-fade--${s.transitionDirection}`,tag:"div",appear:l.options.transitions,style:i.normalizeStyle(s.cellStyles)},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.splitsCount?s.splits:1,(r,m)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["vuecal__flex vuecal__cell-content",s.splitsCount&&s.splitClasses(r)]),key:l.options.transitions?`${s.view.id}-${l.data.content}-${m}`:m,"data-split":s.splitsCount?r.id:!1,column:"",tabindex:"0","aria-label":l.data.content,onFocus:e[0]||(e[0]=c=>s.onCellFocus(c)),onKeypress:e[1]||(e[1]=i.withKeys(c=>s.onCellkeyPressEnter(c),["enter"])),onTouchstart:c=>!s.isDisabled&&s.onCellTouchStart(c,s.splitsCount?r.id:null),onMousedown:c=>!s.isDisabled&&s.onCellMouseDown(c,s.splitsCount?r.id:null),onClick:e[2]||(e[2]=c=>!s.isDisabled&&s.onCellClick(c)),onDblclick:e[3]||(e[3]=c=>!s.isDisabled&&s.onCellDblClick(c)),onContextmenu:e[4]||(e[4]=c=>!s.isDisabled&&l.options.cellContextmenu&&s.onCellContextMenu(c)),onDragenter:e[5]||(e[5]=c=>!s.isDisabled&&l.editEvents.drag&&s.dnd&&s.dnd.cellDragEnter(c,t.$data,l.data.startDate)),onDragover:c=>!s.isDisabled&&l.editEvents.drag&&s.dnd&&s.dnd.cellDragOver(c,t.$data,l.data.startDate,s.splitsCount?r.id:null),onDragleave:e[6]||(e[6]=c=>!s.isDisabled&&l.editEvents.drag&&s.dnd&&s.dnd.cellDragLeave(c,t.$data,l.data.startDate)),onDrop:c=>!s.isDisabled&&l.editEvents.drag&&s.dnd&&s.dnd.cellDragDrop(c,t.$data,l.data.startDate,s.splitsCount?r.id:null)},[l.options.showTimeInCells&&l.options.time&&s.isWeekOrDayView&&!l.allDay?(i.openBlock(),i.createElementBlock("div",Dt,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.vuecal.timeCells,(c,v)=>(i.openBlock(),i.createElementBlock("span",{class:"cell-time-label",key:v},i.toDisplayString(c.label),1))),128))])):i.createCommentVNode("",!0),s.isWeekOrDayView&&!l.allDay&&s.specialHours.length?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(s.specialHours,(c,v)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["vuecal__special-hours",`vuecal__special-hours--day${c.day} ${c.class}`]),style:i.normalizeStyle(`height: ${c.height}px;top: ${c.top}px`)},[c.label?(i.openBlock(),i.createElementBlock("div",{key:0,class:"special-hours-label",innerHTML:c.label},null,8,pt)):i.createCommentVNode("",!0)],6))),256)):i.createCommentVNode("",!0),i.renderSlot(t.$slots,"cell-content",{events:s.events,selectCell:c=>s.selectCell(c,!0),split:s.splitsCount?r:!1}),s.eventsCount&&(s.isWeekOrDayView||s.view.id==="month"&&l.options.eventsOnMonthView)?(i.openBlock(),i.createElementBlock("div",kt,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.splitsCount?r.events:s.events,(c,v)=>(i.openBlock(),i.createBlock(u,{key:v,"cell-formatted-date":l.data.formattedDate,event:c,"all-day":l.allDay,"cell-events":s.splitsCount?r.events:s.events,overlaps:((s.splitsCount?r.overlaps[c._eid]:t.cellOverlaps[c._eid])||[]).overlaps,"event-position":((s.splitsCount?r.overlaps[c._eid]:t.cellOverlaps[c._eid])||[]).position,"overlaps-streak":s.splitsCount?r.overlapsStreak:t.cellOverlapsStreak},{event:i.withCtx(({event:y,view:w})=>[i.renderSlot(t.$slots,"event",{view:w,event:y})]),_:2},1032,["cell-formatted-date","event","all-day","cell-events","overlaps","event-position","overlaps-streak"]))),128))])):i.createCommentVNode("",!0)],42,gt))),128)),s.timelineVisible?(i.openBlock(),i.createElementBlock("div",{class:"vuecal__now-line",style:i.normalizeStyle(`top: ${s.todaysTimePosition}px`),key:l.options.transitions?`${s.view.id}-now-line`:"now-line",title:s.utils.date.formatTime(s.vuecal.now)},null,12,Ct)):i.createCommentVNode("",!0)]),_:3},8,["class","name","appear","style"])}const Tt={inject:["vuecal","utils","modules","view","domEvents"],components:{Event:wt},props:{options:{type:Object,default:()=>({})},editEvents:{type:Object,required:!0},data:{type:Object,required:!0},cellSplits:{type:Array,default:()=>[]},minTimestamp:{type:[Number,null],default:null},maxTimestamp:{type:[Number,null],default:null},cellWidth:{type:[Number,Boolean],default:!1},allDay:{type:Boolean,default:!1}},data:()=>({cellOverlaps:{},cellOverlapsStreak:1,timeAtCursor:null,highlighted:!1,highlightedSplit:null}),methods:{getSplitAtCursor({target:t}){let l=t.classList.contains("vuecal__cell-split")?t:this.vuecal.findAncestor(t,"vuecal__cell-split");return l&&(l=l.attributes["data-split"].value,parseInt(l).toString()===l.toString()&&(l=parseInt(l))),l||null},splitClasses(t){return{"vuecal__cell-split":!0,"vuecal__cell-split--highlighted":this.highlightedSplit===t.id,[t.class]:!!t.class}},checkCellOverlappingEvents(){this.options.time&&this.eventsCount&&!this.splitsCount&&(this.eventsCount===1?(this.cellOverlaps=[],this.cellOverlapsStreak=1):[this.cellOverlaps,this.cellOverlapsStreak]=this.utils.event.checkCellOverlappingEvents(this.events,this.options))},isDOMElementAnEvent(t){return this.vuecal.isDOMElementAnEvent(t)},selectCell(t,e=!1){const l=this.splitsCount?this.getSplitAtCursor(t):null;this.utils.cell.selectCell(e,this.timeAtCursor,l),this.timeAtCursor=null},onCellkeyPressEnter(t){this.isSelected||this.onCellFocus(t);const e=this.splitsCount?this.getSplitAtCursor(t):null;this.utils.cell.keyPressEnterCell(this.timeAtCursor,e),this.timeAtCursor=null},onCellFocus(t){if(!this.isSelected&&!this.isDisabled){this.isSelected=this.data.startDate;const e=this.splitsCount?this.getSplitAtCursor(t):null,l=this.timeAtCursor||this.data.startDate;this.vuecal.$emit("cell-focus",e?{date:l,split:e}:l)}},onCellMouseDown(t,e=null,l=!1){if("ontouchstart"in window&&!l)return!1;this.isSelected||this.onCellFocus(t);const{clickHoldACell:a,focusAnEvent:o}=this.domEvents;this.domEvents.cancelClickEventCreation=!1,a.eventCreated=!1,this.timeAtCursor=new Date(this.data.startDate);const{minutes:s,cursorCoords:{y:u}}=this.vuecal.minutesAtCursor(t);this.timeAtCursor.setMinutes(s);const r=this.isDOMElementAnEvent(t.target);!r&&o._eid&&((this.view.events.find(m=>m._eid===o._eid)||{}).focused=!1),this.editEvents.create&&!r&&this.setUpEventCreation(t,u)},setUpEventCreation(t,e){if(this.options.dragToCreateEvent&&["week","day"].includes(this.view.id)){const{dragCreateAnEvent:l}=this.domEvents;if(l.startCursorY=e,l.split=this.splitsCount?this.getSplitAtCursor(t):null,l.start=this.timeAtCursor,this.options.snapToTime){let a=this.timeAtCursor.getHours()*60+this.timeAtCursor.getMinutes();const o=a+this.options.snapToTime/2;a=o-o%this.options.snapToTime,l.start.setHours(0,a,0,0)}}else this.options.cellClickHold&&["month","week","day"].includes(this.view.id)&&this.setUpCellHoldTimer(t)},setUpCellHoldTimer(t){const{clickHoldACell:e}=this.domEvents;e.cellId=`${this.vuecal._.uid}_${this.data.formattedDate}`,e.split=this.splitsCount?this.getSplitAtCursor(t):null,e.timeoutId=setTimeout(()=>{if(e.cellId&&!this.domEvents.cancelClickEventCreation){const{_eid:l}=this.utils.event.createAnEvent(this.timeAtCursor,null,e.split?{split:e.split}:{});e.eventCreated=l}},e.timeout)},onCellTouchStart(t,e=null){this.onCellMouseDown(t,e,!0)},onCellClick(t){this.isDOMElementAnEvent(t.target)||this.selectCell(t)},onCellDblClick(t){const e=new Date(this.data.startDate);e.setMinutes(this.vuecal.minutesAtCursor(t).minutes);const l=this.splitsCount?this.getSplitAtCursor(t):null;this.vuecal.$emit("cell-dblclick",l?{date:e,split:l}:e),this.options.dblclickToNavigate&&this.vuecal.switchToNarrowerView()},onCellContextMenu(t){t.stopPropagation(),t.preventDefault();const e=new Date(this.data.startDate),{cursorCoords:l,minutes:a}=this.vuecal.minutesAtCursor(t);e.setMinutes(a);const o=this.splitsCount?this.getSplitAtCursor(t):null;this.vuecal.$emit("cell-contextmenu",{date:e,...l,...o||{},e:t})}},computed:{dnd(){return this.modules.dnd},nowInMinutes(){return this.utils.date.dateToMinutes(this.vuecal.now)},isBeforeMinDate(){return this.minTimestamp!==null&&this.minTimestamp>this.data.endDate.getTime()},isAfterMaxDate(){return this.maxTimestamp&&this.maxTimestamp<this.data.startDate.getTime()},isDisabled(){const{disableDays:t}=this.options,{isYearsOrYearView:e}=this.vuecal;return t.length&&t.includes(this.data.formattedDate)&&!e?!0:this.isBeforeMinDate||this.isAfterMaxDate},isSelected:{get(){let t=!1;const{selectedDate:e}=this.view;return this.view.id==="years"?t=e.getFullYear()===this.data.startDate.getFullYear():this.view.id==="year"?t=e.getFullYear()===this.data.startDate.getFullYear()&&e.getMonth()===this.data.startDate.getMonth():t=e.getTime()===this.data.startDate.getTime(),t},set(t){this.view.selectedDate=t,this.vuecal.$emit("update:selected-date",this.view.selectedDate)}},isWeekOrDayView(){return["week","day"].includes(this.view.id)},transitionDirection(){return this.vuecal.transitionDirection},specialHours(){return this.data.specialHours.map(t=>{let{from:e,to:l}=t;return e=Math.max(e,this.options.timeFrom),l=Math.min(l,this.options.timeTo),{...t,height:(l-e)*this.timeScale,top:(e-this.options.timeFrom)*this.timeScale}})},events(){const{startDate:t,endDate:e}=this.data;let l=[];if(!(["years","year"].includes(this.view.id)&&!this.options.eventsCountOnYearView)){if(l=this.view.events.slice(0),this.view.id==="month"&&l.push(...this.view.outOfScopeEvents),l=l.filter(a=>this.utils.event.eventInRange(a,t,e)),this.options.showAllDayEvents&&this.view.id!=="month"&&(l=l.filter(a=>!!a.allDay===this.allDay)),this.options.time&&this.isWeekOrDayView&&!this.allDay){const{timeFrom:a,timeTo:o}=this.options;l=l.filter(s=>{const u=s.daysCount>1&&s.segments[this.data.formattedDate]||{},r=s.daysCount===1&&s.startTimeMinutes<o&&s.endTimeMinutes>a,m=s.daysCount>1&&u.startTimeMinutes<o&&u.endTimeMinutes>a;return s.allDay||r||m||!1})}this.options.time&&this.isWeekOrDayView&&!(this.options.showAllDayEvents&&this.allDay)&&l.sort((a,o)=>a.start<o.start?-1:1),this.cellSplits.length||this.$nextTick(this.checkCellOverlappingEvents)}return l},eventsCount(){return this.events.length},splits(){return this.cellSplits.map((t,e)=>{const l=this.events.filter(s=>s.split===t.id),[a,o]=this.utils.event.checkCellOverlappingEvents(l.filter(s=>!s.background&&!s.allDay),this.options);return{...t,overlaps:a,overlapsStreak:o,events:l}})},splitsCount(){return this.splits.length},cellClasses(){return{[this.data.class]:!!this.data.class,"vuecal__cell--current":this.data.current,"vuecal__cell--today":this.data.today,"vuecal__cell--out-of-scope":this.data.outOfScope,"vuecal__cell--before-min":this.isDisabled&&this.isBeforeMinDate,"vuecal__cell--after-max":this.isDisabled&&this.isAfterMaxDate,"vuecal__cell--disabled":this.isDisabled,"vuecal__cell--selected":this.isSelected,"vuecal__cell--highlighted":this.highlighted,"vuecal__cell--has-splits":this.splitsCount,"vuecal__cell--has-events":this.eventsCount}},cellStyles(){return{...this.cellWidth?{width:`${this.cellWidth}%`}:{}}},timelineVisible(){const{time:t,timeTo:e}=this.options;return this.data.today&&this.isWeekOrDayView&&t&&!this.allDay&&this.nowInMinutes<=e},todaysTimePosition(){if(!this.data.today||!this.options.time)return;const t=this.nowInMinutes-this.options.timeFrom;return Math.round(t*this.timeScale)},timeScale(){return this.options.timeCellHeight/this.options.timeStep}}},Be=K(Tt,[["render",bt]]),Et={key:0,class:"vuecal__all-day-text",style:{width:"3em"}};function St(t,e,l,a,o,s){const u=i.resolveComponent("vuecal-cell");return i.openBlock(),i.createElementBlock("div",{class:"vuecal__flex vuecal__all-day",style:i.normalizeStyle(l.cellOrSplitMinWidth&&{height:l.height})},[l.cellOrSplitMinWidth?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Et,[i.createElementVNode("span",null,i.toDisplayString(l.label),1)])),i.createElementVNode("div",{class:i.normalizeClass(["vuecal__flex vuecal__cells",`${s.view.id}-view`]),grow:"",style:i.normalizeStyle(l.cellOrSplitMinWidth?`min-width: ${l.cellOrSplitMinWidth}px`:"")},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.cells,(r,m)=>(i.openBlock(),i.createBlock(u,{key:m,options:l.options,"edit-events":s.editEvents,data:r,"all-day":!0,"cell-width":l.options.hideWeekdays.length&&(s.vuecal.isWeekView||s.vuecal.isMonthView)&&s.vuecal.cellWidth,"min-timestamp":l.options.minTimestamp,"max-timestamp":l.options.maxTimestamp,"cell-splits":l.daySplits},{event:i.withCtx(({event:c,view:v})=>[i.renderSlot(t.$slots,"event",{view:v,event:c})]),_:2},1032,["options","edit-events","data","cell-width","min-timestamp","max-timestamp","cell-splits"]))),128))],6)],4)}const _t={inject:["vuecal","view","editEvents"],components:{"vuecal-cell":Be},props:{options:{type:Object,required:!0},cells:{type:Array,required:!0},label:{type:String,required:!0},daySplits:{type:Array,default:()=>[]},shortEvents:{type:Boolean,default:!0},height:{type:String,default:""},cellOrSplitMinWidth:{type:Number,default:null}},computed:{hasCellOrSplitWidth(){return!!(this.options.minCellWidth||this.daySplits.length&&this.options.minSplitWidth)}}},Mt=K(_t,[["render",St]]),Vt=["lang"],Bt={class:"default"},Ot={key:0,class:"vuecal__flex vuecal__body",grow:""},Ht=["onBlur","innerHTML"],Wt=["innerHTML"],At=["innerHTML"],Nt={class:"vuecal__flex",row:"",grow:""},Pt={key:0,class:"vuecal__time-column"},Ft={class:"vuecal__time-cell-label"},Lt={key:1,class:"vuecal__flex vuecal__week-numbers",column:""},jt=["wrap","column"],xt=["onBlur","innerHTML"],zt=["innerHTML"],Yt=["innerHTML"],It=["wrap"],qt=["innerHTML"],Rt=["innerHTML"],Ut={key:2,class:"vuecal__cell-events-count"},Kt={key:3,class:"vuecal__no-event"},Gt=["onBlur","innerHTML"],Xt=["innerHTML"],Jt={key:2,class:"vuecal__event-time"},Zt={key:0},Qt={key:1,class:"days-to-end"},$t=["innerHTML"],ei={key:0,class:"vuecal__scrollbar-check"};function ti(t,e,l,a,o,s){const u=i.resolveComponent("vuecal-header"),r=i.resolveComponent("all-day-bar"),m=i.resolveComponent("weekdays-headings"),c=i.resolveComponent("vuecal-cell");return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["vuecal__flex vuecal",s.cssClasses]),column:"",ref:"vuecal",lang:l.locale},[i.createVNode(u,{options:t.$props,"edit-events":s.editEvents,"view-props":{views:s.views,weekDaysInHeader:s.weekDaysInHeader},"week-days":s.weekDays,"has-splits":s.hasSplits,"day-splits":s.daySplits,"switch-to-narrower-view":s.switchToNarrowerView},i.createSlots({"arrow-prev":i.withCtx(()=>[i.renderSlot(t.$slots,"arrow-prev",{},()=>[e[0]||(e[0]=i.createTextVNode(" ")),e[1]||(e[1]=i.createElementVNode("i",{class:"angle"},null,-1)),e[2]||(e[2]=i.createTextVNode(" "))])]),"arrow-next":i.withCtx(()=>[i.renderSlot(t.$slots,"arrow-next",{},()=>[e[3]||(e[3]=i.createTextVNode(" ")),e[4]||(e[4]=i.createElementVNode("i",{class:"angle"},null,-1)),e[5]||(e[5]=i.createTextVNode(" "))])]),"today-button":i.withCtx(()=>[i.renderSlot(t.$slots,"today-button",{},()=>[i.createElementVNode("span",Bt,i.toDisplayString(o.texts.today),1)])]),title:i.withCtx(()=>[i.renderSlot(t.$slots,"title",{title:s.viewTitle,view:o.view},()=>[i.createTextVNode(i.toDisplayString(s.viewTitle),1)])]),_:2},[t.$slots["weekday-heading"]?{name:"weekday-heading",fn:i.withCtx(({heading:v,view:y})=>[i.renderSlot(t.$slots,"weekday-heading",{heading:v,view:y})]),key:"0"}:void 0,t.$slots["split-label"]?{name:"split-label",fn:i.withCtx(({split:v})=>[i.renderSlot(t.$slots,"split-label",{split:v,view:o.view.id})]),key:"1"}:void 0]),1032,["options","edit-events","view-props","week-days","has-splits","day-splits","switch-to-narrower-view"]),l.hideBody?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Ot,[i.createVNode(i.Transition,{name:`slide-fade--${o.transitionDirection}`,appear:l.transitions},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("div",{class:"vuecal__flex",style:{"min-width":"100%"},key:l.transitions?o.view.id:!1,column:""},[l.showAllDayEvents&&s.hasTimeColumn&&(!s.cellOrSplitMinWidth||s.isDayView&&!l.minSplitWidth)?(i.openBlock(),i.createBlock(r,i.normalizeProps(i.mergeProps({key:0},s.allDayBar)),{event:i.withCtx(({event:v,view:y})=>[i.renderSlot(t.$slots,"event",{view:y,event:v},()=>[s.editEvents.title&&v.titleEditable?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__event-title vuecal__event-title--edit",contenteditable:"",onBlur:w=>s.onEventTitleBlur(w,v),innerHTML:v.title},null,40,Ht)):v.title?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__event-title",innerHTML:v.title},null,8,Wt)):i.createCommentVNode("",!0),v.content&&!s.hasShortEvents&&!s.isShortMonthView?(i.openBlock(),i.createElementBlock("div",{key:2,class:"vuecal__event-content",innerHTML:v.content},null,8,At)):i.createCommentVNode("",!0)])]),_:3},16)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["vuecal__bg",{vuecal__flex:!s.hasTimeColumn}]),column:""},[i.createElementVNode("div",Nt,[s.hasTimeColumn?(i.openBlock(),i.createElementBlock("div",Pt,[l.showAllDayEvents&&s.cellOrSplitMinWidth&&!(s.isDayView&&!l.minSplitWidth)?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__all-day-text",style:i.normalizeStyle({height:s.allDayBar.height})},[i.createElementVNode("span",null,i.toDisplayString(o.texts.allDay),1)],4)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.timeCells,(v,y)=>(i.openBlock(),i.createElementBlock("div",{class:"vuecal__time-cell",key:y,style:i.normalizeStyle(`height: ${l.timeCellHeight}px`)},[i.renderSlot(t.$slots,"time-cell",{hours:v.hours,minutes:v.minutes},()=>[e[6]||(e[6]=i.createElementVNode("span",{class:"vuecal__time-cell-line"},null,-1)),i.createElementVNode("span",Ft,i.toDisplayString(v.label),1)])],4))),128))])):i.createCommentVNode("",!0),l.showWeekNumbers&&s.isMonthView?(i.openBlock(),i.createElementBlock("div",Lt,[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(6,v=>i.createElementVNode("div",{class:"vuecal__flex vuecal__week-number-cell",key:v,grow:""},[i.renderSlot(t.$slots,"week-number-cell",{week:s.getWeekNumber(v-1)},()=>[i.createTextVNode(i.toDisplayString(s.getWeekNumber(v-1)),1)])])),64))])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["vuecal__flex vuecal__cells",`${o.view.id}-view`]),grow:"",wrap:!s.cellOrSplitMinWidth||!s.isWeekView,column:!!s.cellOrSplitMinWidth},[s.cellOrSplitMinWidth&&s.isWeekView?(i.openBlock(),i.createBlock(m,{key:0,"transition-direction":o.transitionDirection,"week-days":s.weekDays,"switch-to-narrower-view":s.switchToNarrowerView,style:i.normalizeStyle(s.cellOrSplitMinWidth?`min-width: ${s.cellOrSplitMinWidth}px`:"")},i.createSlots({_:2},[t.$slots["weekday-heading"]?{name:"weekday-heading",fn:i.withCtx(({heading:v,view:y})=>[i.renderSlot(t.$slots,"weekday-heading",{heading:v,view:y})]),key:"0"}:void 0,t.$slots["split-label"]?{name:"split-label",fn:i.withCtx(({split:v})=>[i.renderSlot(t.$slots,"split-label",{split:v,view:o.view.id})]),key:"1"}:void 0]),1032,["transition-direction","week-days","switch-to-narrower-view","style"])):s.hasSplits&&l.stickySplitLabels&&l.minSplitWidth?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__flex vuecal__split-days-headers",style:i.normalizeStyle(s.cellOrSplitMinWidth?`min-width: ${s.cellOrSplitMinWidth}px`:"")},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.daySplits,(v,y)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["day-split-header",v.class||!1]),key:y},[i.renderSlot(t.$slots,"split-label",{split:v,view:o.view.id},()=>[i.createTextVNode(i.toDisplayString(v.label),1)])],2))),128))],4)):i.createCommentVNode("",!0),l.showAllDayEvents&&s.hasTimeColumn&&(s.isWeekView&&s.cellOrSplitMinWidth||s.isDayView&&s.hasSplits&&l.minSplitWidth)?(i.openBlock(),i.createBlock(r,i.normalizeProps(i.mergeProps({key:2},s.allDayBar)),{event:i.withCtx(({event:v,view:y})=>[i.renderSlot(t.$slots,"event",{view:y,event:v},()=>[s.editEvents.title&&v.titleEditable?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__event-title vuecal__event-title--edit",contenteditable:"",onBlur:w=>s.onEventTitleBlur(w,v),innerHTML:v.title},null,40,xt)):v.title?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__event-title",innerHTML:v.title},null,8,zt)):i.createCommentVNode("",!0),v.content&&!s.hasShortEvents&&!s.isShortMonthView?(i.openBlock(),i.createElementBlock("div",{key:2,class:"vuecal__event-content",innerHTML:v.content},null,8,Yt)):i.createCommentVNode("",!0)])]),_:3},16)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:"vuecal__flex",ref:v=>o.cellsEl=v,grow:"",wrap:!s.cellOrSplitMinWidth||!s.isWeekView,style:i.normalizeStyle(s.cellOrSplitMinWidth?`min-width: ${s.cellOrSplitMinWidth}px`:"")},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.viewCells,(v,y)=>(i.openBlock(),i.createBlock(c,{key:y,options:t.$props,"edit-events":s.editEvents,data:v,"cell-width":l.hideWeekdays.length&&(s.isWeekView||s.isMonthView)&&s.cellWidth,"min-timestamp":s.minTimestamp,"max-timestamp":s.maxTimestamp,"cell-splits":s.hasSplits&&s.daySplits||[]},{"cell-content":i.withCtx(({events:w,split:T,selectCell:g})=>[i.renderSlot(t.$slots,"cell-content",{cell:v,view:o.view,goNarrower:g,events:w},()=>[T&&!l.stickySplitLabels?(i.openBlock(),i.createElementBlock("div",{key:0,class:"split-label",innerHTML:T.label},null,8,qt)):i.createCommentVNode("",!0),v.content?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__cell-date",innerHTML:v.content},null,8,Rt)):i.createCommentVNode("",!0),(s.isMonthView&&!l.eventsOnMonthView||s.isYearsOrYearView&&l.eventsCountOnYearView)&&w.length?(i.openBlock(),i.createElementBlock("div",Ut,[i.renderSlot(t.$slots,"events-count",{view:o.view,events:w},()=>[i.createTextVNode(i.toDisplayString(w.length),1)])])):i.createCommentVNode("",!0),!s.cellOrSplitHasEvents(w,T)&&s.isWeekOrDayView?(i.openBlock(),i.createElementBlock("div",Kt,[i.renderSlot(t.$slots,"no-event",{},()=>[i.createTextVNode(i.toDisplayString(o.texts.noEvent),1)])])):i.createCommentVNode("",!0)])]),event:i.withCtx(({event:w,view:T})=>[i.renderSlot(t.$slots,"event",{view:T,event:w},()=>[s.editEvents.title&&w.titleEditable?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__event-title vuecal__event-title--edit",contenteditable:"",onBlur:g=>s.onEventTitleBlur(g,w),innerHTML:w.title},null,40,Gt)):w.title?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__event-title",innerHTML:w.title},null,8,Xt)):i.createCommentVNode("",!0),l.time&&!w.allDay&&!(s.isMonthView&&(w.allDay||l.showAllDayEvents==="short"))&&!s.isShortMonthView?(i.openBlock(),i.createElementBlock("div",Jt,[i.createTextVNode(i.toDisplayString(o.utils.date.formatTime(w.start,s.TimeFormat)),1),w.endTimeMinutes?(i.openBlock(),i.createElementBlock("span",Zt," - "+i.toDisplayString(o.utils.date.formatTime(w.end,s.TimeFormat,null,!0)),1)):i.createCommentVNode("",!0),w.daysCount>1&&(w.segments[v.formattedDate]||{}).isFirstDay?(i.openBlock(),i.createElementBlock("small",Qt," +"+i.toDisplayString(w.daysCount-1)+i.toDisplayString((o.texts.day[0]||"").toLowerCase()),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),w.content&&!(s.isMonthView&&w.allDay&&l.showAllDayEvents==="short")&&!s.isShortMonthView?(i.openBlock(),i.createElementBlock("div",{key:3,class:"vuecal__event-content",innerHTML:w.content},null,8,$t)):i.createCommentVNode("",!0)])]),"no-event":i.withCtx(()=>[i.renderSlot(t.$slots,"no-event",{},()=>[i.createTextVNode(i.toDisplayString(o.texts.noEvent),1)])]),_:2},1032,["options","edit-events","data","cell-width","min-timestamp","max-timestamp","cell-splits"]))),128))],12,It)],10,jt)])],2)]))]),_:3},8,["name","appear"]),o.ready?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",ei,e[7]||(e[7]=[i.createElementVNode("div",null,null,-1)])))]))],10,Vt)}const ce=24*60,me={weekDays:Array(7).fill(""),weekDaysShort:[],months:Array(12).fill(""),years:"",year:"",month:"",week:"",day:"",today:"",noEvent:"",allDay:"",deleteEvent:"",createEvent:"",dateFormat:"dddd MMMM D, YYYY",am:"am",pm:"pm"},Se=["years","year","month","week","day"],_e=new Ye(me),ii={name:"vue-cal",components:{"vuecal-cell":Be,"vuecal-header":vt,WeekdaysHeadings:Ve,AllDayBar:Mt},provide(){return{vuecal:this,utils:this.utils,modules:this.modules,previous:this.previous,next:this.next,switchView:this.switchView,updateSelectedDate:this.updateSelectedDate,editEvents:this.editEvents,view:this.view,domEvents:this.domEvents}},props:{activeView:{type:String,default:"week"},allDayBarHeight:{type:[String,Number],default:"25px"},cellClickHold:{type:Boolean,default:!0},cellContextmenu:{type:Boolean,default:!1},clickToNavigate:{type:Boolean,default:!1},dblclickToNavigate:{type:Boolean,default:!0},disableDatePrototypes:{type:Boolean,default:!1},disableDays:{type:Array,default:()=>[]},disableViews:{type:Array,default:()=>[]},dragToCreateEvent:{type:Boolean,default:!0},dragToCreateThreshold:{type:Number,default:15},editableEvents:{type:[Boolean,Object],default:!1},events:{type:Array,default:()=>[]},eventsCountOnYearView:{type:Boolean,default:!1},eventsOnMonthView:{type:[Boolean,String],default:!1},hideBody:{type:Boolean,default:!1},hideTitleBar:{type:Boolean,default:!1},hideViewSelector:{type:Boolean,default:!1},hideWeekdays:{type:Array,default:()=>[]},hideWeekends:{type:Boolean,default:!1},locale:{type:[String,Object],default:"en"},maxDate:{type:[String,Date],default:""},minCellWidth:{type:Number,default:0},minDate:{type:[String,Date],default:""},minEventWidth:{type:Number,default:0},minSplitWidth:{type:Number,default:0},onEventClick:{type:[Function,null],default:null},onEventCreate:{type:[Function,null],default:null},onEventDblclick:{type:[Function,null],default:null},overlapsPerTimeStep:{type:Boolean,default:!1},resizeX:{type:Boolean,default:!1},selectedDate:{type:[String,Date],default:""},showAllDayEvents:{type:[Boolean,String],default:!1},showTimeInCells:{type:Boolean,default:!1},showWeekNumbers:{type:[Boolean,String],default:!1},snapToTime:{type:Number,default:0},small:{type:Boolean,default:!1},specialHours:{type:Object,default:()=>({})},splitDays:{type:Array,default:()=>[]},startWeekOnSunday:{type:Boolean,default:!1},stickySplitLabels:{type:Boolean,default:!1},time:{type:Boolean,default:!0},timeCellHeight:{type:Number,default:40},timeFormat:{type:String,default:""},timeFrom:{type:Number,default:0},timeStep:{type:Number,default:60},timeTo:{type:Number,default:ce},todayButton:{type:Boolean,default:!1},transitions:{type:Boolean,default:!0},twelveHour:{type:Boolean,default:!1},watchRealTime:{type:Boolean,default:!1},xsmall:{type:Boolean,default:!1}},data(){return{ready:!1,texts:{...me},utils:{date:(this.disableDatePrototypes?_e.removePrototypes():!1)||_e,cell:null,event:null},modules:{dnd:null},cellsEl:null,view:{id:"",title:"",startDate:null,endDate:null,firstCellDate:null,lastCellDate:null,selectedDate:null,events:[]},eventIdIncrement:1,now:new Date,timeTickerIds:[null,null],domEvents:{resizeAnEvent:{_eid:null,start:null,split:null,segment:null,originalEndTimeMinutes:0,originalEnd:null,end:null,startCell:null,endCell:null},dragAnEvent:{_eid:null},dragCreateAnEvent:{startCursorY:null,start:null,split:null,event:null},focusAnEvent:{_eid:null,mousedUp:!1},clickHoldAnEvent:{_eid:null,timeout:1200,timeoutId:null},dblTapACell:{taps:0,timeout:500},clickHoldACell:{cellId:null,split:null,timeout:1200,timeoutId:null,eventCreated:!1},cancelClickEventCreation:!1},mutableEvents:[],transitionDirection:"right"}},methods:{async loadLocale(t){if(typeof this.locale=="object"){this.texts=Object.assign({},me,t),this.utils.date.updateTexts(this.texts);return}const e=await ze(Object.assign({"./i18n/ar.json":()=>Promise.resolve().then(()=>require("./ar.es-CKau4tBl.js")),"./i18n/bg.json":()=>Promise.resolve().then(()=>require("./bg.es-Melqx1M5.js")),"./i18n/bn.json":()=>Promise.resolve().then(()=>require("./bn.es-ClbAZ4WP.js")),"./i18n/bs.json":()=>Promise.resolve().then(()=>require("./bs.es-KjOcbE96.js")),"./i18n/ca.json":()=>Promise.resolve().then(()=>require("./ca.es-BaGTENcW.js")),"./i18n/cs.json":()=>Promise.resolve().then(()=>require("./cs.es-ChOlHqBr.js")),"./i18n/da.json":()=>Promise.resolve().then(()=>require("./da.es-DOFXbf8-.js")),"./i18n/de.json":()=>Promise.resolve().then(()=>require("./de.es-DwE82Kaw.js")),"./i18n/el.json":()=>Promise.resolve().then(()=>require("./el.es-CNrCgzYI.js")),"./i18n/en.json":()=>Promise.resolve().then(()=>require("./en.es-CgL601qd.js")),"./i18n/es.json":()=>Promise.resolve().then(()=>require("./es.es-IdFGKY7Q.js")),"./i18n/et.json":()=>Promise.resolve().then(()=>require("./et.es-BygWmV3P.js")),"./i18n/fa.json":()=>Promise.resolve().then(()=>require("./fa.es-DW_0SmsT.js")),"./i18n/fi.json":()=>Promise.resolve().then(()=>require("./fi.es-pgfJlZ8i.js")),"./i18n/fr.json":()=>Promise.resolve().then(()=>require("./fr.es-OENguFuM.js")),"./i18n/he.json":()=>Promise.resolve().then(()=>require("./he.es-bixEnAeH.js")),"./i18n/hr.json":()=>Promise.resolve().then(()=>require("./hr.es-CkRAP94O.js")),"./i18n/hu.json":()=>Promise.resolve().then(()=>require("./hu.es-DG6HeiQJ.js")),"./i18n/id.json":()=>Promise.resolve().then(()=>require("./id.es-D4tPi6wP.js")),"./i18n/is.json":()=>Promise.resolve().then(()=>require("./is.es-CDFqLYCV.js")),"./i18n/it.json":()=>Promise.resolve().then(()=>require("./it.es-BHgrw_C6.js")),"./i18n/ja.json":()=>Promise.resolve().then(()=>require("./ja.es-D-lxWwyb.js")),"./i18n/ka.json":()=>Promise.resolve().then(()=>require("./ka.es-CnnB6q4A.js")),"./i18n/ko.json":()=>Promise.resolve().then(()=>require("./ko.es-b18aaB3V.js")),"./i18n/lt.json":()=>Promise.resolve().then(()=>require("./lt.es-BY9UQ6wZ.js")),"./i18n/mn.json":()=>Promise.resolve().then(()=>require("./mn.es-YFS7gSdf.js")),"./i18n/nl.json":()=>Promise.resolve().then(()=>require("./nl.es-BEx-4hnj.js")),"./i18n/no.json":()=>Promise.resolve().then(()=>require("./no.es-BQnRWlWR.js")),"./i18n/pl.json":()=>Promise.resolve().then(()=>require("./pl.es-CKCsZ_02.js")),"./i18n/pt-br.json":()=>Promise.resolve().then(()=>require("./pt-br.es-oH7qh6Fd.js")),"./i18n/pt-pt.json":()=>Promise.resolve().then(()=>require("./pt-pt.es-DLk5I0ej.js")),"./i18n/ro.json":()=>Promise.resolve().then(()=>require("./ro.es-DgTen1Dh.js")),"./i18n/ru.json":()=>Promise.resolve().then(()=>require("./ru.es-jGIQfREl.js")),"./i18n/sk.json":()=>Promise.resolve().then(()=>require("./sk.es-D2bhVb26.js")),"./i18n/sl.json":()=>Promise.resolve().then(()=>require("./sl.es-TV8Uraa1.js")),"./i18n/sq.json":()=>Promise.resolve().then(()=>require("./sq.es-Cc65zxbr.js")),"./i18n/sr.json":()=>Promise.resolve().then(()=>require("./sr.es-D5VNA_GW.js")),"./i18n/sv.json":()=>Promise.resolve().then(()=>require("./sv.es-dBeK_DZs.js")),"./i18n/tr.json":()=>Promise.resolve().then(()=>require("./tr.es-BUz4S13G.js")),"./i18n/uk.json":()=>Promise.resolve().then(()=>require("./uk.es-B8uaeLcK.js")),"./i18n/vi.json":()=>Promise.resolve().then(()=>require("./vi.es-2OFMtbQI.js")),"./i18n/zh-cn.json":()=>Promise.resolve().then(()=>require("./zh-cn.es-fDHCbCIg.js")),"./i18n/zh-hk.json":()=>Promise.resolve().then(()=>require("./zh-hk.es-COzeh5F8.js"))}),`./i18n/${t}.json`,3);this.texts=Object.assign({},me,e),this.utils.date.updateTexts(this.texts)},loadDragAndDrop(){Promise.resolve().then(()=>require("./drag-and-drop.es-4ttM1tRs.js")).then(t=>{const{DragAndDrop:e}=t;this.modules.dnd=new e(this)}).catch(()=>console.warn("Vue Cal: Missing drag & drop module."))},validateView(t){return Se.includes(t)||(console.error(`Vue Cal: invalid active-view parameter provided: "${t}".
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),h=require("./index-DcB16odB.js"),Le=require("./_plugin-vue_export-helper-BHFhmbuH.js");var je=Object.defineProperty,xe=(t,e,l)=>e in t?je(t,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[e]=l,P=(t,e,l)=>xe(t,typeof e!="symbol"?e+"":e,l);const ze=(t,e,l)=>{const a=t[e];return a?typeof a=="function"?a():Promise.resolve(a):new Promise((o,s)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(s.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==l?". Note that variables only represent file names one level deep.":""))))})};let ue,Te,Ee,O,de={},U={};class Ye{constructor(e,l=!1){P(this,"texts",{}),P(this,"dateToMinutes",a=>a.getHours()*60+a.getMinutes()),O=this,this._texts=e,!l&&Date&&!Date.prototype.addDays&&this._initDatePrototypes()}_initDatePrototypes(){Date.prototype.addDays=function(e){return O.addDays(this,e)},Date.prototype.subtractDays=function(e){return O.subtractDays(this,e)},Date.prototype.addHours=function(e){return O.addHours(this,e)},Date.prototype.subtractHours=function(e){return O.subtractHours(this,e)},Date.prototype.addMinutes=function(e){return O.addMinutes(this,e)},Date.prototype.subtractMinutes=function(e){return O.subtractMinutes(this,e)},Date.prototype.getWeek=function(){return O.getWeek(this)},Date.prototype.isToday=function(){return O.isToday(this)},Date.prototype.isLeapYear=function(){return O.isLeapYear(this)},Date.prototype.format=function(e="YYYY-MM-DD"){return O.formatDate(this,e)},Date.prototype.formatTime=function(e="HH:mm"){return O.formatTime(this,e)}}removePrototypes(){delete Date.prototype.addDays,delete Date.prototype.subtractDays,delete Date.prototype.addHours,delete Date.prototype.subtractHours,delete Date.prototype.addMinutes,delete Date.prototype.subtractMinutes,delete Date.prototype.getWeek,delete Date.prototype.isToday,delete Date.prototype.isLeapYear,delete Date.prototype.format,delete Date.prototype.formatTime}updateTexts(e){this._texts=e}_todayFormatted(){return Te!==new Date().getDate()&&(ue=new Date,Te=ue.getDate(),Ee=`${ue.getFullYear()}-${ue.getMonth()}-${ue.getDate()}`),Ee}addDays(e,l){const a=new Date(e.valueOf());return a.setDate(a.getDate()+l),a}subtractDays(e,l){const a=new Date(e.valueOf());return a.setDate(a.getDate()-l),a}addHours(e,l){const a=new Date(e.valueOf());return a.setHours(a.getHours()+l),a}subtractHours(e,l){const a=new Date(e.valueOf());return a.setHours(a.getHours()-l),a}addMinutes(e,l){const a=new Date(e.valueOf());return a.setMinutes(a.getMinutes()+l),a}subtractMinutes(e,l){const a=new Date(e.valueOf());return a.setMinutes(a.getMinutes()-l),a}getWeek(e){const l=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())),a=l.getUTCDay()||7;l.setUTCDate(l.getUTCDate()+4-a);const o=new Date(Date.UTC(l.getUTCFullYear(),0,1));return Math.ceil(((l-o)/864e5+1)/7)}isToday(e){return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`===this._todayFormatted()}isLeapYear(e){const l=e.getFullYear();return!(l%400)||l%100&&!(l%4)}getPreviousFirstDayOfWeek(e=null,l){const a=e&&new Date(e.valueOf())||new Date,o=l?7:6;return a.setDate(a.getDate()-(a.getDay()+o)%7),a}stringToDate(e){return e instanceof Date?e:(e.length===10&&(e+=" 00:00"),new Date(e.replace(/-/g,"/")))}countDays(e,l){typeof e=="string"&&(e=e.replace(/-/g,"/")),typeof l=="string"&&(l=l.replace(/-/g,"/")),e=new Date(e).setHours(0,0,0,0),l=new Date(l).setHours(0,0,1,0);const a=(new Date(l).getTimezoneOffset()-new Date(e).getTimezoneOffset())*60*1e3;return Math.ceil((l-e-a)/(24*3600*1e3))}datesInSameTimeStep(e,l,a){return Math.abs(e.getTime()-l.getTime())<=a*60*1e3}formatDate(e,l="YYYY-MM-DD",a=null){if(a||(a=this._texts),l||(l="YYYY-MM-DD"),l==="YYYY-MM-DD")return this.formatDateLite(e);de={},U={};const o={YYYY:()=>this._hydrateDateObject(e,a).YYYY,YY:()=>this._hydrateDateObject(e,a).YY(),M:()=>this._hydrateDateObject(e,a).M,MM:()=>this._hydrateDateObject(e,a).MM(),MMM:()=>this._hydrateDateObject(e,a).MMM(),MMMM:()=>this._hydrateDateObject(e,a).MMMM(),MMMMG:()=>this._hydrateDateObject(e,a).MMMMG(),D:()=>this._hydrateDateObject(e,a).D,DD:()=>this._hydrateDateObject(e,a).DD(),S:()=>this._hydrateDateObject(e,a).S(),d:()=>this._hydrateDateObject(e,a).d,dd:()=>this._hydrateDateObject(e,a).dd(),ddd:()=>this._hydrateDateObject(e,a).ddd(),dddd:()=>this._hydrateDateObject(e,a).dddd(),HH:()=>this._hydrateTimeObject(e,a).HH,H:()=>this._hydrateTimeObject(e,a).H,hh:()=>this._hydrateTimeObject(e,a).hh,h:()=>this._hydrateTimeObject(e,a).h,am:()=>this._hydrateTimeObject(e,a).am,AM:()=>this._hydrateTimeObject(e,a).AM,mm:()=>this._hydrateTimeObject(e,a).mm,m:()=>this._hydrateTimeObject(e,a).m};return l.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g,(s,u)=>{const r=o[u.replace(/\{|\}/g,"")];return r!==void 0?r():u})}formatDateLite(e){const l=e.getMonth()+1,a=e.getDate();return`${e.getFullYear()}-${l<10?"0":""}${l}-${a<10?"0":""}${a}`}formatTime(e,l="HH:mm",a=null,o=!1){let s=!1;if(o){const[m,c,v]=[e.getHours(),e.getMinutes(),e.getSeconds()];m+c+v===141&&(s=!0)}if(e instanceof Date&&l==="HH:mm")return s?"24:00":this.formatTimeLite(e);U={},a||(a=this._texts);const u=this._hydrateTimeObject(e,a),r=l.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g,(m,c)=>{const v=u[c.replace(/\{|\}/g,"")];return v!==void 0?v:c});return s?r.replace("23:59","24:00"):r}formatTimeLite(e){const l=e.getHours(),a=e.getMinutes();return`${(l<10?"0":"")+l}:${(a<10?"0":"")+a}`}_nth(e){if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}_hydrateDateObject(e,l){if(de.D)return de;const a=e.getFullYear(),o=e.getMonth()+1,s=e.getDate(),r=(e.getDay()-1+7)%7;return de={YYYY:a,YY:()=>a.toString().substring(2),M:o,MM:()=>(o<10?"0":"")+o,MMM:()=>l.months[o-1].substring(0,3),MMMM:()=>l.months[o-1],MMMMG:()=>(l.monthsGenitive||l.months)[o-1],D:s,DD:()=>(s<10?"0":"")+s,S:()=>this._nth(s),d:r+1,dd:()=>l.weekDays[r][0],ddd:()=>l.weekDays[r].substr(0,3),dddd:()=>l.weekDays[r]},de}_hydrateTimeObject(e,l){if(U.am)return U;let a,o;e instanceof Date?(a=e.getHours(),o=e.getMinutes()):(a=Math.floor(e/60),o=Math.floor(e%60));const s=a%12?a%12:12,u=(l||{am:"am",pm:"pm"})[a===24||a<12?"am":"pm"];return U={H:a,h:s,HH:(a<10?"0":"")+a,hh:(s<10?"0":"")+s,am:u,AM:u.toUpperCase(),m:o,mm:(o<10?"0":"")+o},U}}const Ie=24*60;class qe{constructor(e){P(this,"_vuecal",null),P(this,"selectCell",(l=!1,a,o)=>{this._vuecal.$emit("cell-click",o?{date:a,split:o}:a),this._vuecal.clickToNavigate||l?this._vuecal.switchToNarrowerView():this._vuecal.dblclickToNavigate&&"ontouchstart"in window&&(this._vuecal.domEvents.dblTapACell.taps++,setTimeout(()=>this._vuecal.domEvents.dblTapACell.taps=0,this._vuecal.domEvents.dblTapACell.timeout),this._vuecal.domEvents.dblTapACell.taps>=2&&(this._vuecal.domEvents.dblTapACell.taps=0,this._vuecal.switchToNarrowerView(),this._vuecal.$emit("cell-dblclick",o?{date:a,split:o}:a)))}),P(this,"keyPressEnterCell",(l,a)=>{this._vuecal.$emit("cell-keypress-enter",a?{date:l,split:a}:l),this._vuecal.switchToNarrowerView()}),P(this,"getPosition",l=>{const{left:a,top:o}=this._vuecal.cellsEl.getBoundingClientRect(),{clientX:s,clientY:u}="ontouchstart"in window&&l.touches?l.touches[0]:l;return{x:s-a,y:u-o}}),P(this,"minutesAtCursor",l=>{let a=0,o={x:0,y:0};const{timeStep:s,timeCellHeight:u,timeFrom:r}=this._vuecal.$props;return typeof l=="number"?a=l:typeof l=="object"&&(o=this.getPosition(l),a=Math.round(o.y*s/parseInt(u)+r)),{minutes:Math.max(Math.min(a,Ie),0),cursorCoords:o}}),this._vuecal=e}}const Re=2,we=24*60;let p,k,ge;class Ue{constructor(e,l){P(this,"_vuecal",null),P(this,"eventDefaults",{_eid:null,start:"",startTimeMinutes:0,end:"",endTimeMinutes:0,title:"",content:"",background:!1,allDay:!1,segments:null,repeat:null,daysCount:1,deletable:!0,deleting:!1,titleEditable:!0,resizable:!0,resizing:!1,draggable:!0,dragging:!1,draggingStatic:!1,focused:!1,class:""}),this._vuecal=e,p=l}createAnEvent(e,l,a){if(typeof e=="string"&&(e=p.stringToDate(e)),!(e instanceof Date))return!1;const o=p.dateToMinutes(e);l=l*1||Re*60;const s=o+l,u=p.addMinutes(new Date(e),l);a.end&&(typeof a.end=="string"&&(a.end=p.stringToDate(a.end)),a.endTimeMinutes=p.dateToMinutes(a.end));const r={...this.eventDefaults,_eid:`${this._vuecal._.uid}_${this._vuecal.eventIdIncrement++}`,start:e,startTimeMinutes:o,end:u,endTimeMinutes:s,segments:null,...a};if(!(typeof this._vuecal.onEventCreate=="function"&&!this._vuecal.onEventCreate(r,()=>this.deleteAnEvent(r))))return r.startDateF!==r.endDateF&&(r.daysCount=p.countDays(r.start,r.end)),this._vuecal.mutableEvents.push(r),this._vuecal.addEventsToView([r]),this._vuecal.emitWithEvent("event-create",r),this._vuecal.$emit("event-change",{event:this._vuecal.cleanupEvent(r),originalEvent:null}),r}addEventSegment(e){e.segments||(e.segments={},e.segments[p.formatDateLite(e.start)]={start:e.start,startTimeMinutes:e.startTimeMinutes,endTimeMinutes:we,isFirstDay:!0,isLastDay:!1});const l=e.segments[p.formatDateLite(e.end)];l&&(l.isLastDay=!1,l.endTimeMinutes=we);const a=p.addDays(e.end,1),o=p.formatDateLite(a);return a.setHours(0,0,0,0),e.segments[o]={start:a,startTimeMinutes:0,endTimeMinutes:e.endTimeMinutes,isFirstDay:!1,isLastDay:!0},e.end=p.addMinutes(a,e.endTimeMinutes),e.daysCount=Object.keys(e.segments).length,o}removeEventSegment(e){let l=Object.keys(e.segments).length;if(l<=1)return p.formatDateLite(e.end);delete e.segments[p.formatDateLite(e.end)],l--;const a=p.subtractDays(e.end,1),o=p.formatDateLite(a),s=e.segments[o];return l?s&&(s.isLastDay=!0,s.endTimeMinutes=e.endTimeMinutes):e.segments=null,e.daysCount=l||1,e.end=a,o}createEventSegments(e,l,a){const o=l.getTime(),s=a.getTime();let u=e.start.getTime(),r=e.end.getTime(),m=!1,c,v,y;for(!e.end.getHours()&&!e.end.getMinutes()&&(r-=1e3),e.segments={},e.repeat?(c=o,v=Math.min(s,e.repeat.until?p.stringToDate(e.repeat.until).getTime():s)):(c=Math.max(o,u),v=Math.min(s,r));c<=v;){let w=!1;const T=p.addDays(new Date(c),1).setHours(0,0,0,0);let g,_,E,D;if(e.repeat){const V=new Date(c),C=p.formatDateLite(V);(m||e.occurrences&&e.occurrences[C])&&(m||(u=e.occurrences[C].start,y=new Date(u).setHours(0,0,0,0),r=e.occurrences[C].end),m=!0,w=!0),g=c===y,_=C===p.formatDateLite(new Date(r)),E=new Date(g?u:c),D=p.formatDateLite(E),_&&(m=!1)}else w=!0,g=c===u,_=v===r&&T>v,E=g?e.start:new Date(c),D=p.formatDateLite(g?e.start:E);w&&(e.segments[D]={start:E,startTimeMinutes:g?e.startTimeMinutes:0,endTimeMinutes:_?e.endTimeMinutes:we,isFirstDay:g,isLastDay:_}),c=T}return e}deleteAnEvent(e){this._vuecal.emitWithEvent("event-delete",e),this._vuecal.mutableEvents=this._vuecal.mutableEvents.filter(l=>l._eid!==e._eid),this._vuecal.view.events=this._vuecal.view.events.filter(l=>l._eid!==e._eid)}checkCellOverlappingEvents(e,l){ge=e.slice(0),k={},e.forEach(o=>{ge.shift(),k[o._eid]||(k[o._eid]={overlaps:[],start:o.start,position:0}),k[o._eid].position=0,ge.forEach(s=>{k[s._eid]||(k[s._eid]={overlaps:[],start:s.start,position:0});const u=this.eventInRange(s,o.start,o.end),r=l.overlapsPerTimeStep?p.datesInSameTimeStep(o.start,s.start,l.timeStep):1;if(!o.background&&!o.allDay&&!s.background&&!s.allDay&&u&&r)k[o._eid].overlaps.push(s._eid),k[o._eid].overlaps=[...new Set(k[o._eid].overlaps)],k[s._eid].overlaps.push(o._eid),k[s._eid].overlaps=[...new Set(k[s._eid].overlaps)],k[s._eid].position++;else{let m,c;(m=(k[o._eid]||{overlaps:[]}).overlaps.indexOf(s._eid))>-1&&k[o._eid].overlaps.splice(m,1),(c=(k[s._eid]||{overlaps:[]}).overlaps.indexOf(o._eid))>-1&&k[s._eid].overlaps.splice(c,1),k[s._eid].position--}})});let a=0;for(const o in k){const s=k[o],u=s.overlaps.map(r=>({id:r,start:k[r].start}));u.push({id:o,start:s.start}),u.sort((r,m)=>r.start<m.start?-1:r.start>m.start?1:r.id>m.id?-1:1),s.position=u.findIndex(r=>r.id===o),a=Math.max(this.getOverlapsStreak(s,k),a)}return[k,a]}getOverlapsStreak(e,l={}){let a=e.overlaps.length+1,o=[];return e.overlaps.forEach(s=>{o.includes(s)||e.overlaps.filter(r=>r!==s).forEach(r=>{l[r].overlaps.includes(s)||o.push(r)})}),o=[...new Set(o)],a-=o.length,a}eventInRange(e,l,a){if(e.allDay||!this._vuecal.time){const u=new Date(e.start).setHours(0,0,0,0);return new Date(e.end).setHours(23,59,0,0)>=new Date(l).setHours(0,0,0,0)&&u<=new Date(a).setHours(0,0,0,0)}const o=e.start.getTime(),s=e.end.getTime();return o<a.getTime()&&s>l.getTime()}}const Ke={class:"vuecal__flex vuecal__weekdays-headings"},Ge=["onClick"],Xe={class:"vuecal__flex weekday-label",grow:""},Je={class:"full"},Ze={class:"small"},Qe={class:"xsmall"},$e={key:0},et={key:0,class:"vuecal__flex vuecal__split-days-headers",grow:""};function tt(t,e,l,a,o,s){return i.openBlock(),i.createElementBlock("div",Ke,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.headings,(u,r)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:r},[u.hide?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["vuecal__flex vuecal__heading",{today:u.today,clickable:s.cellHeadingsClickable}]),style:i.normalizeStyle(s.weekdayCellStyles),onClick:m=>s.view.id==="week"&&s.selectCell(u.date,m),onDblclick:e[0]||(e[0]=m=>s.view.id==="week"&&s.vuecal.dblclickToNavigate&&l.switchToNarrowerView())},[i.createVNode(i.Transition,{name:`slide-fade--${l.transitionDirection}`,appear:s.vuecal.transitions},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("div",{class:"vuecal__flex",column:"",key:s.vuecal.transitions?`${r}-${u.dayOfMonth}`:!1},[i.createElementVNode("div",Xe,[i.renderSlot(t.$slots,"weekday-heading",{heading:s.cleanupHeading(u),view:s.view},()=>[i.createElementVNode("span",Je,i.toDisplayString(u.full),1),i.createElementVNode("span",Ze,i.toDisplayString(u.small),1),i.createElementVNode("span",Qe,i.toDisplayString(u.xsmall),1),u.dayOfMonth?(i.openBlock(),i.createElementBlock("span",$e," "+i.toDisplayString(u.dayOfMonth),1)):i.createCommentVNode("",!0)])]),s.vuecal.hasSplits&&s.vuecal.stickySplitLabels?(i.openBlock(),i.createElementBlock("div",et,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.vuecal.daySplits,(m,c)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["day-split-header",m.class||!1]),key:c},[i.renderSlot(t.$slots,"split-label",{split:m,view:s.view},()=>[i.createTextVNode(i.toDisplayString(m.label),1)])],2))),128))])):i.createCommentVNode("",!0)]))]),_:2},1032,["name","appear"])],46,Ge))],64))),128))])}const K=(t,e)=>{const l=t.__vccOpts||t;for(const[a,o]of e)l[a]=o;return l},it={inject:["vuecal","utils","view"],props:{transitionDirection:{type:String,default:"right"},weekDays:{type:Array,default:()=>[]},switchToNarrowerView:{type:Function,default:()=>{}}},methods:{selectCell(t,e){t.getTime()!==this.view.selectedDate.getTime()&&(this.view.selectedDate=t),this.utils.cell.selectCell(!1,t,e)},cleanupHeading:t=>({label:t.full,date:t.date,...t.today?{today:t.today}:{}})},computed:{headings(){if(!["month","week"].includes(this.view.id))return[];let t=!1;return this.weekDays.map((l,a)=>{const o=this.utils.date.addDays(this.view.startDate,this.vuecal.startWeekOnSunday&&this.vuecal.hideWeekends?a-1:a);return{hide:l.hide,full:l.label,small:l.short||l.label.substr(0,3),xsmall:l.short||l.label.substr(0,1),...this.view.id==="week"?{dayOfMonth:o.getDate(),date:o,today:!t&&this.utils.date.isToday(o)&&!t++}:{}}})},cellWidth(){return 100/(7-this.weekDays.reduce((t,e)=>t+e.hide,0))},weekdayCellStyles(){return{...this.vuecal.hideWeekdays.length?{width:`${this.cellWidth}%`}:{}}},cellHeadingsClickable(){return this.view.id==="week"&&(this.vuecal.clickToNavigate||this.vuecal.dblclickToNavigate)}}},Ve=K(it,[["render",tt]]),st={class:"vuecal__header"},lt={key:0,class:"vuecal__flex vuecal__menu",role:"tablist","aria-label":"Calendar views navigation"},at=["onDragenter","onDragleave","onClick","aria-label"],nt={key:1,class:"vuecal__title-bar"},rt=["aria-label"],ot={class:"vuecal__flex vuecal__title",grow:""},ut=["aria-label"],dt={key:0,class:"vuecal__flex vuecal__split-days-headers"};function ct(t,e,l,a,o,s){const u=i.resolveComponent("weekdays-headings");return i.openBlock(),i.createElementBlock("div",st,[l.options.hideViewSelector?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",lt,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.viewProps.views,(r,m)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:m},[r.enabled?(i.openBlock(),i.createElementBlock("button",{key:0,class:i.normalizeClass(["vuecal__view-btn",{"vuecal__view-btn--active":s.view.id===m,"vuecal__view-btn--highlighted":t.highlightedControl===m}]),type:"button",onDragenter:c=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragEnter(c,m,t.$data),onDragleave:c=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragLeave(c,m,t.$data),onClick:c=>s.switchView(m,null,!0),"aria-label":`${r.label} view`},i.toDisplayString(r.label),43,at)):i.createCommentVNode("",!0)],64))),128))])),l.options.hideTitleBar?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",nt,[i.createElementVNode("button",{class:i.normalizeClass(["vuecal__arrow vuecal__arrow--prev",{"vuecal__arrow--highlighted":t.highlightedControl==="previous"}]),type:"button",onClick:e[0]||(e[0]=(...r)=>s.previous&&s.previous(...r)),onDragenter:e[1]||(e[1]=r=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragEnter(r,"previous",t.$data)),onDragleave:e[2]||(e[2]=r=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragLeave(r,"previous",t.$data)),"aria-label":`Previous ${s.view.id}`},[i.renderSlot(t.$slots,"arrow-prev")],42,rt),i.createElementVNode("div",ot,[i.createVNode(i.Transition,{name:l.options.transitions?`slide-fade--${s.transitionDirection}`:""},{default:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(s.broaderView?"button":"span"),{type:!!s.broaderView&&"button",key:`${s.view.id}${s.view.startDate.toString()}`,onClick:e[3]||(e[3]=r=>!!s.broaderView&&s.switchToBroaderView()),"aria-label":!!s.broaderView&&`Go to ${s.broaderView} view`},{default:i.withCtx(()=>[i.renderSlot(t.$slots,"title")]),_:3},8,["type","aria-label"]))]),_:3},8,["name"])]),l.options.todayButton?(i.openBlock(),i.createElementBlock("button",{key:0,class:i.normalizeClass(["vuecal__today-btn",{"vuecal__today-btn--highlighted":t.highlightedControl==="today"}]),type:"button",onClick:e[4]||(e[4]=(...r)=>s.goToToday&&s.goToToday(...r)),onDragenter:e[5]||(e[5]=r=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragEnter(r,"today",t.$data)),onDragleave:e[6]||(e[6]=r=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragLeave(r,"today",t.$data)),"aria-label":"Today"},[i.renderSlot(t.$slots,"today-button")],34)):i.createCommentVNode("",!0),i.createElementVNode("button",{class:i.normalizeClass(["vuecal__arrow vuecal__arrow--next",{"vuecal__arrow--highlighted":t.highlightedControl==="next"}]),type:"button",onClick:e[7]||(e[7]=(...r)=>s.next&&s.next(...r)),onDragenter:e[8]||(e[8]=r=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragEnter(r,"next",t.$data)),onDragleave:e[9]||(e[9]=r=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragLeave(r,"next",t.$data)),"aria-label":`Next ${s.view.id}`},[i.renderSlot(t.$slots,"arrow-next")],42,ut)])),l.viewProps.weekDaysInHeader?(i.openBlock(),i.createBlock(u,{key:2,"week-days":l.weekDays,"transition-direction":s.transitionDirection,"switch-to-narrower-view":l.switchToNarrowerView},i.createSlots({_:2},[t.$slots["weekday-heading"]?{name:"weekday-heading",fn:i.withCtx(({heading:r,view:m})=>[i.renderSlot(t.$slots,"weekday-heading",{heading:r,view:m})]),key:"0"}:void 0,t.$slots["split-label"]?{name:"split-label",fn:i.withCtx(({split:r})=>[i.renderSlot(t.$slots,"split-label",{split:r,view:s.view})]),key:"1"}:void 0]),1032,["week-days","transition-direction","switch-to-narrower-view"])):i.createCommentVNode("",!0),i.createVNode(i.Transition,{name:`slide-fade--${s.transitionDirection}`},{default:i.withCtx(()=>[s.showDaySplits?(i.openBlock(),i.createElementBlock("div",dt,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.daySplits,(r,m)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["day-split-header",r.class||!1]),key:m},[i.renderSlot(t.$slots,"split-label",{split:r,view:s.view.id},()=>[i.createTextVNode(i.toDisplayString(r.label),1)])],2))),128))])):i.createCommentVNode("",!0)]),_:3},8,["name"])])}const ht={inject:["vuecal","previous","next","switchView","updateSelectedDate","modules","view"],components:{WeekdaysHeadings:Ve},props:{options:{type:Object,default:()=>({})},editEvents:{type:Object,required:!0},hasSplits:{type:[Boolean,Number],default:!1},daySplits:{type:Array,default:()=>[]},viewProps:{type:Object,default:()=>({})},weekDays:{type:Array,default:()=>[]},switchToNarrowerView:{type:Function,default:()=>{}}},data:()=>({highlightedControl:null}),methods:{goToToday(){this.updateSelectedDate(new Date(new Date().setHours(0,0,0,0)))},switchToBroaderView(){this.transitionDirection="left",this.broaderView&&this.switchView(this.broaderView)}},computed:{transitionDirection:{get(){return this.vuecal.transitionDirection},set(t){this.vuecal.transitionDirection=t}},broaderView(){const{enabledViews:t}=this.vuecal;return t[t.indexOf(this.view.id)-1]},showDaySplits(){return this.view.id==="day"&&this.hasSplits&&this.options.stickySplitLabels&&!this.options.minSplitWidth},dnd(){return this.modules.dnd}}},vt=K(ht,[["render",ct]]),mt=["draggable"];function yt(t,e,l,a,o,s){return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["vuecal__event",s.eventClasses]),style:i.normalizeStyle(s.eventStyles),tabindex:"0",onFocus:e[4]||(e[4]=(...u)=>s.focusEvent&&s.focusEvent(...u)),onKeypress:e[5]||(e[5]=i.withKeys(i.withModifiers((...u)=>s.onEnterKeypress&&s.onEnterKeypress(...u),["stop"]),["enter"])),onMouseenter:e[6]||(e[6]=(...u)=>s.onMouseEnter&&s.onMouseEnter(...u)),onMouseleave:e[7]||(e[7]=(...u)=>s.onMouseLeave&&s.onMouseLeave(...u)),onTouchstart:e[8]||(e[8]=i.withModifiers((...u)=>s.onTouchStart&&s.onTouchStart(...u),["stop"])),onMousedown:e[9]||(e[9]=u=>s.onMouseDown(u)),onMouseup:e[10]||(e[10]=(...u)=>s.onMouseUp&&s.onMouseUp(...u)),onTouchend:e[11]||(e[11]=(...u)=>s.onMouseUp&&s.onMouseUp(...u)),onTouchmove:e[12]||(e[12]=(...u)=>s.onTouchMove&&s.onTouchMove(...u)),onDblclick:e[13]||(e[13]=(...u)=>s.onDblClick&&s.onDblClick(...u)),draggable:s.draggable,onDragstart:e[14]||(e[14]=u=>s.draggable&&s.onDragStart(u)),onDragend:e[15]||(e[15]=u=>s.draggable&&s.onDragEnd())},[s.vuecal.editEvents.delete&&l.event.deletable?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__event-delete",onClick:e[0]||(e[0]=i.withModifiers((...u)=>s.deleteEvent&&s.deleteEvent(...u),["stop"])),onTouchstart:e[1]||(e[1]=i.withModifiers((...u)=>s.touchDeleteEvent&&s.touchDeleteEvent(...u),["stop"]))},i.toDisplayString(s.vuecal.texts.deleteEvent),33)):i.createCommentVNode("",!0),i.renderSlot(t.$slots,"event",{event:l.event,view:s.view.id}),s.resizable?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__event-resize-handle",contenteditable:"false",onMousedown:e[2]||(e[2]=i.withModifiers((...u)=>s.onResizeHandleMouseDown&&s.onResizeHandleMouseDown(...u),["stop","prevent"])),onTouchstart:e[3]||(e[3]=i.withModifiers((...u)=>s.onResizeHandleMouseDown&&s.onResizeHandleMouseDown(...u),["stop","prevent"]))},null,32)):i.createCommentVNode("",!0)],46,mt)}const ft={inject:["vuecal","utils","modules","view","domEvents","editEvents"],props:{cellFormattedDate:{type:String,default:""},event:{type:Object,default:()=>({})},cellEvents:{type:Array,default:()=>[]},overlaps:{type:Array,default:()=>[]},eventPosition:{type:Number,default:0},overlapsStreak:{type:Number,default:0},allDay:{type:Boolean,default:!1}},data:()=>({touch:{dragThreshold:30,startX:0,startY:0,dragged:!1}}),methods:{onMouseDown(t,e=!1){if("ontouchstart"in window&&!e)return!1;const{clickHoldAnEvent:l,focusAnEvent:a,resizeAnEvent:o,dragAnEvent:s}=this.domEvents;if(a._eid===this.event._eid&&l._eid===this.event._eid)return!0;this.focusEvent(),l._eid=null,this.vuecal.editEvents.delete&&this.event.deletable&&(l.timeoutId=setTimeout(()=>{!o._eid&&!s._eid&&(l._eid=this.event._eid,this.event.deleting=!0)},l.timeout))},onMouseUp(t){this.domEvents.focusAnEvent._eid===this.event._eid&&!this.touch.dragged&&(this.domEvents.focusAnEvent.mousedUp=!0),this.touch.dragged=!1},onMouseEnter(t){t.preventDefault(),this.vuecal.emitWithEvent("event-mouse-enter",this.event)},onMouseLeave(t){t.preventDefault(),this.vuecal.emitWithEvent("event-mouse-leave",this.event)},onTouchMove(t){if(typeof this.vuecal.onEventClick!="function")return;const{clientX:e,clientY:l}=t.touches[0],{startX:a,startY:o,dragThreshold:s}=this.touch;(Math.abs(e-a)>s||Math.abs(l-o)>s)&&(this.touch.dragged=!0)},onTouchStart(t){this.touch.startX=t.touches[0].clientX,this.touch.startY=t.touches[0].clientY,this.onMouseDown(t,!0)},onEnterKeypress(t){if(typeof this.vuecal.onEventClick=="function")return this.vuecal.onEventClick(this.event,t)},onDblClick(t){if(typeof this.vuecal.onEventDblclick=="function")return this.vuecal.onEventDblclick(this.event,t)},onDragStart(t){this.dnd&&this.dnd.eventDragStart(t,this.event)},onDragEnd(){this.dnd&&this.dnd.eventDragEnd(this.event)},onResizeHandleMouseDown(){this.focusEvent(),this.domEvents.dragAnEvent._eid=null,this.domEvents.resizeAnEvent=Object.assign(this.domEvents.resizeAnEvent,{_eid:this.event._eid,start:(this.segment||this.event).start,split:this.event.split||null,segment:!!this.segment&&this.utils.date.formatDateLite(this.segment.start),originalEnd:new Date((this.segment||this.event).end),originalEndTimeMinutes:this.event.endTimeMinutes}),this.event.resizing=!0},deleteEvent(t=!1){if("ontouchstart"in window&&!t)return!1;this.utils.event.deleteAnEvent(this.event)},touchDeleteEvent(t){this.deleteEvent(!0)},cancelDeleteEvent(){this.event.deleting=!1},focusEvent(){const{focusAnEvent:t}=this.domEvents,e=t._eid;if(e!==this.event._eid){if(e){const l=this.view.events.find(a=>a._eid===e);l&&(l.focused=!1)}this.vuecal.cancelDelete(),this.vuecal.emitWithEvent("event-focus",this.event),t._eid=this.event._eid,this.event.focused=!0}}},computed:{eventDimensions(){const{startTimeMinutes:t,endTimeMinutes:e}=this.segment||this.event;let l=t-this.vuecal.timeFrom;const a=Math.max(Math.round(l*this.vuecal.timeCellHeight/this.vuecal.timeStep),0);l=Math.min(e,this.vuecal.timeTo)-this.vuecal.timeFrom;const o=Math.round(l*this.vuecal.timeCellHeight/this.vuecal.timeStep),s=Math.max(o-a,5);return{top:a,height:s}},eventStyles(){if(this.event.allDay||!this.vuecal.time||!this.event.endTimeMinutes||this.view.id==="month"||this.allDay)return{};let t=100/Math.min(this.overlaps.length+1,this.overlapsStreak),e=100/(this.overlaps.length+1)*this.eventPosition;this.vuecal.minEventWidth&&t<this.vuecal.minEventWidth&&(t=this.vuecal.minEventWidth,e=(100-this.vuecal.minEventWidth)/this.overlaps.length*this.eventPosition);const{top:l,height:a}=this.eventDimensions;return{top:`${l}px`,height:`${a}px`,width:`${t}%`,left:this.event.left&&`${this.event.left}px`||`${e}%`}},eventClasses(){const{isFirstDay:t,isLastDay:e}=this.segment||{};return{[this.event.class]:!!this.event.class,"vuecal__event--focus":this.event.focused,"vuecal__event--resizing":this.event.resizing,"vuecal__event--background":this.event.background,"vuecal__event--deletable":this.event.deleting,"vuecal__event--all-day":this.event.allDay,"vuecal__event--dragging":!this.event.draggingStatic&&this.event.dragging,"vuecal__event--static":this.event.dragging&&this.event.draggingStatic,"vuecal__event--multiple-days":!!this.segment,"event-start":this.segment&&t&&!e,"event-middle":this.segment&&!t&&!e,"event-end":this.segment&&e&&!t}},segment(){return this.event.segments&&this.event.segments[this.cellFormattedDate]||null},draggable(){const{draggable:t,background:e,daysCount:l}=this.event;return this.vuecal.editEvents.drag&&t&&!e&&l===1},resizable(){const{editEvents:t,time:e}=this.vuecal;return t.resize&&this.event.resizable&&e&&!this.allDay&&(!this.segment||this.segment&&this.segment.isLastDay)&&this.view.id!=="month"},dnd(){return this.modules.dnd}}},wt=K(ft,[["render",yt]]),gt=["data-split","aria-label","onTouchstart","onMousedown","onDragover","onDrop"],Dt={key:0,class:"cell-time-labels"},pt=["innerHTML"],kt={key:2,class:"vuecal__cell-events"},Ct=["title"];function bt(t,e,l,a,o,s){const u=i.resolveComponent("event");return i.openBlock(),i.createBlock(i.TransitionGroup,{class:i.normalizeClass(["vuecal__cell",s.cellClasses]),name:`slide-fade--${s.transitionDirection}`,tag:"div",appear:l.options.transitions,style:i.normalizeStyle(s.cellStyles)},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.splitsCount?s.splits:1,(r,m)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["vuecal__flex vuecal__cell-content",s.splitsCount&&s.splitClasses(r)]),key:l.options.transitions?`${s.view.id}-${l.data.content}-${m}`:m,"data-split":s.splitsCount?r.id:!1,column:"",tabindex:"0","aria-label":l.data.content,onFocus:e[0]||(e[0]=c=>s.onCellFocus(c)),onKeypress:e[1]||(e[1]=i.withKeys(c=>s.onCellkeyPressEnter(c),["enter"])),onTouchstart:c=>!s.isDisabled&&s.onCellTouchStart(c,s.splitsCount?r.id:null),onMousedown:c=>!s.isDisabled&&s.onCellMouseDown(c,s.splitsCount?r.id:null),onClick:e[2]||(e[2]=c=>!s.isDisabled&&s.onCellClick(c)),onDblclick:e[3]||(e[3]=c=>!s.isDisabled&&s.onCellDblClick(c)),onContextmenu:e[4]||(e[4]=c=>!s.isDisabled&&l.options.cellContextmenu&&s.onCellContextMenu(c)),onDragenter:e[5]||(e[5]=c=>!s.isDisabled&&l.editEvents.drag&&s.dnd&&s.dnd.cellDragEnter(c,t.$data,l.data.startDate)),onDragover:c=>!s.isDisabled&&l.editEvents.drag&&s.dnd&&s.dnd.cellDragOver(c,t.$data,l.data.startDate,s.splitsCount?r.id:null),onDragleave:e[6]||(e[6]=c=>!s.isDisabled&&l.editEvents.drag&&s.dnd&&s.dnd.cellDragLeave(c,t.$data,l.data.startDate)),onDrop:c=>!s.isDisabled&&l.editEvents.drag&&s.dnd&&s.dnd.cellDragDrop(c,t.$data,l.data.startDate,s.splitsCount?r.id:null)},[l.options.showTimeInCells&&l.options.time&&s.isWeekOrDayView&&!l.allDay?(i.openBlock(),i.createElementBlock("div",Dt,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.vuecal.timeCells,(c,v)=>(i.openBlock(),i.createElementBlock("span",{class:"cell-time-label",key:v},i.toDisplayString(c.label),1))),128))])):i.createCommentVNode("",!0),s.isWeekOrDayView&&!l.allDay&&s.specialHours.length?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(s.specialHours,(c,v)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["vuecal__special-hours",`vuecal__special-hours--day${c.day} ${c.class}`]),style:i.normalizeStyle(`height: ${c.height}px;top: ${c.top}px`)},[c.label?(i.openBlock(),i.createElementBlock("div",{key:0,class:"special-hours-label",innerHTML:c.label},null,8,pt)):i.createCommentVNode("",!0)],6))),256)):i.createCommentVNode("",!0),i.renderSlot(t.$slots,"cell-content",{events:s.events,selectCell:c=>s.selectCell(c,!0),split:s.splitsCount?r:!1}),s.eventsCount&&(s.isWeekOrDayView||s.view.id==="month"&&l.options.eventsOnMonthView)?(i.openBlock(),i.createElementBlock("div",kt,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.splitsCount?r.events:s.events,(c,v)=>(i.openBlock(),i.createBlock(u,{key:v,"cell-formatted-date":l.data.formattedDate,event:c,"all-day":l.allDay,"cell-events":s.splitsCount?r.events:s.events,overlaps:((s.splitsCount?r.overlaps[c._eid]:t.cellOverlaps[c._eid])||[]).overlaps,"event-position":((s.splitsCount?r.overlaps[c._eid]:t.cellOverlaps[c._eid])||[]).position,"overlaps-streak":s.splitsCount?r.overlapsStreak:t.cellOverlapsStreak},{event:i.withCtx(({event:y,view:w})=>[i.renderSlot(t.$slots,"event",{view:w,event:y})]),_:2},1032,["cell-formatted-date","event","all-day","cell-events","overlaps","event-position","overlaps-streak"]))),128))])):i.createCommentVNode("",!0)],42,gt))),128)),s.timelineVisible?(i.openBlock(),i.createElementBlock("div",{class:"vuecal__now-line",style:i.normalizeStyle(`top: ${s.todaysTimePosition}px`),key:l.options.transitions?`${s.view.id}-now-line`:"now-line",title:s.utils.date.formatTime(s.vuecal.now)},null,12,Ct)):i.createCommentVNode("",!0)]),_:3},8,["class","name","appear","style"])}const Tt={inject:["vuecal","utils","modules","view","domEvents"],components:{Event:wt},props:{options:{type:Object,default:()=>({})},editEvents:{type:Object,required:!0},data:{type:Object,required:!0},cellSplits:{type:Array,default:()=>[]},minTimestamp:{type:[Number,null],default:null},maxTimestamp:{type:[Number,null],default:null},cellWidth:{type:[Number,Boolean],default:!1},allDay:{type:Boolean,default:!1}},data:()=>({cellOverlaps:{},cellOverlapsStreak:1,timeAtCursor:null,highlighted:!1,highlightedSplit:null}),methods:{getSplitAtCursor({target:t}){let l=t.classList.contains("vuecal__cell-split")?t:this.vuecal.findAncestor(t,"vuecal__cell-split");return l&&(l=l.attributes["data-split"].value,parseInt(l).toString()===l.toString()&&(l=parseInt(l))),l||null},splitClasses(t){return{"vuecal__cell-split":!0,"vuecal__cell-split--highlighted":this.highlightedSplit===t.id,[t.class]:!!t.class}},checkCellOverlappingEvents(){this.options.time&&this.eventsCount&&!this.splitsCount&&(this.eventsCount===1?(this.cellOverlaps=[],this.cellOverlapsStreak=1):[this.cellOverlaps,this.cellOverlapsStreak]=this.utils.event.checkCellOverlappingEvents(this.events,this.options))},isDOMElementAnEvent(t){return this.vuecal.isDOMElementAnEvent(t)},selectCell(t,e=!1){const l=this.splitsCount?this.getSplitAtCursor(t):null;this.utils.cell.selectCell(e,this.timeAtCursor,l),this.timeAtCursor=null},onCellkeyPressEnter(t){this.isSelected||this.onCellFocus(t);const e=this.splitsCount?this.getSplitAtCursor(t):null;this.utils.cell.keyPressEnterCell(this.timeAtCursor,e),this.timeAtCursor=null},onCellFocus(t){if(!this.isSelected&&!this.isDisabled){this.isSelected=this.data.startDate;const e=this.splitsCount?this.getSplitAtCursor(t):null,l=this.timeAtCursor||this.data.startDate;this.vuecal.$emit("cell-focus",e?{date:l,split:e}:l)}},onCellMouseDown(t,e=null,l=!1){if("ontouchstart"in window&&!l)return!1;this.isSelected||this.onCellFocus(t);const{clickHoldACell:a,focusAnEvent:o}=this.domEvents;this.domEvents.cancelClickEventCreation=!1,a.eventCreated=!1,this.timeAtCursor=new Date(this.data.startDate);const{minutes:s,cursorCoords:{y:u}}=this.vuecal.minutesAtCursor(t);this.timeAtCursor.setMinutes(s);const r=this.isDOMElementAnEvent(t.target);!r&&o._eid&&((this.view.events.find(m=>m._eid===o._eid)||{}).focused=!1),this.editEvents.create&&!r&&this.setUpEventCreation(t,u)},setUpEventCreation(t,e){if(this.options.dragToCreateEvent&&["week","day"].includes(this.view.id)){const{dragCreateAnEvent:l}=this.domEvents;if(l.startCursorY=e,l.split=this.splitsCount?this.getSplitAtCursor(t):null,l.start=this.timeAtCursor,this.options.snapToTime){let a=this.timeAtCursor.getHours()*60+this.timeAtCursor.getMinutes();const o=a+this.options.snapToTime/2;a=o-o%this.options.snapToTime,l.start.setHours(0,a,0,0)}}else this.options.cellClickHold&&["month","week","day"].includes(this.view.id)&&this.setUpCellHoldTimer(t)},setUpCellHoldTimer(t){const{clickHoldACell:e}=this.domEvents;e.cellId=`${this.vuecal._.uid}_${this.data.formattedDate}`,e.split=this.splitsCount?this.getSplitAtCursor(t):null,e.timeoutId=setTimeout(()=>{if(e.cellId&&!this.domEvents.cancelClickEventCreation){const{_eid:l}=this.utils.event.createAnEvent(this.timeAtCursor,null,e.split?{split:e.split}:{});e.eventCreated=l}},e.timeout)},onCellTouchStart(t,e=null){this.onCellMouseDown(t,e,!0)},onCellClick(t){this.isDOMElementAnEvent(t.target)||this.selectCell(t)},onCellDblClick(t){const e=new Date(this.data.startDate);e.setMinutes(this.vuecal.minutesAtCursor(t).minutes);const l=this.splitsCount?this.getSplitAtCursor(t):null;this.vuecal.$emit("cell-dblclick",l?{date:e,split:l}:e),this.options.dblclickToNavigate&&this.vuecal.switchToNarrowerView()},onCellContextMenu(t){t.stopPropagation(),t.preventDefault();const e=new Date(this.data.startDate),{cursorCoords:l,minutes:a}=this.vuecal.minutesAtCursor(t);e.setMinutes(a);const o=this.splitsCount?this.getSplitAtCursor(t):null;this.vuecal.$emit("cell-contextmenu",{date:e,...l,...o||{},e:t})}},computed:{dnd(){return this.modules.dnd},nowInMinutes(){return this.utils.date.dateToMinutes(this.vuecal.now)},isBeforeMinDate(){return this.minTimestamp!==null&&this.minTimestamp>this.data.endDate.getTime()},isAfterMaxDate(){return this.maxTimestamp&&this.maxTimestamp<this.data.startDate.getTime()},isDisabled(){const{disableDays:t}=this.options,{isYearsOrYearView:e}=this.vuecal;return t.length&&t.includes(this.data.formattedDate)&&!e?!0:this.isBeforeMinDate||this.isAfterMaxDate},isSelected:{get(){let t=!1;const{selectedDate:e}=this.view;return this.view.id==="years"?t=e.getFullYear()===this.data.startDate.getFullYear():this.view.id==="year"?t=e.getFullYear()===this.data.startDate.getFullYear()&&e.getMonth()===this.data.startDate.getMonth():t=e.getTime()===this.data.startDate.getTime(),t},set(t){this.view.selectedDate=t,this.vuecal.$emit("update:selected-date",this.view.selectedDate)}},isWeekOrDayView(){return["week","day"].includes(this.view.id)},transitionDirection(){return this.vuecal.transitionDirection},specialHours(){return this.data.specialHours.map(t=>{let{from:e,to:l}=t;return e=Math.max(e,this.options.timeFrom),l=Math.min(l,this.options.timeTo),{...t,height:(l-e)*this.timeScale,top:(e-this.options.timeFrom)*this.timeScale}})},events(){const{startDate:t,endDate:e}=this.data;let l=[];if(!(["years","year"].includes(this.view.id)&&!this.options.eventsCountOnYearView)){if(l=this.view.events.slice(0),this.view.id==="month"&&l.push(...this.view.outOfScopeEvents),l=l.filter(a=>this.utils.event.eventInRange(a,t,e)),this.options.showAllDayEvents&&this.view.id!=="month"&&(l=l.filter(a=>!!a.allDay===this.allDay)),this.options.time&&this.isWeekOrDayView&&!this.allDay){const{timeFrom:a,timeTo:o}=this.options;l=l.filter(s=>{const u=s.daysCount>1&&s.segments[this.data.formattedDate]||{},r=s.daysCount===1&&s.startTimeMinutes<o&&s.endTimeMinutes>a,m=s.daysCount>1&&u.startTimeMinutes<o&&u.endTimeMinutes>a;return s.allDay||r||m||!1})}this.options.time&&this.isWeekOrDayView&&!(this.options.showAllDayEvents&&this.allDay)&&l.sort((a,o)=>a.start<o.start?-1:1),this.cellSplits.length||this.$nextTick(this.checkCellOverlappingEvents)}return l},eventsCount(){return this.events.length},splits(){return this.cellSplits.map((t,e)=>{const l=this.events.filter(s=>s.split===t.id),[a,o]=this.utils.event.checkCellOverlappingEvents(l.filter(s=>!s.background&&!s.allDay),this.options);return{...t,overlaps:a,overlapsStreak:o,events:l}})},splitsCount(){return this.splits.length},cellClasses(){return{[this.data.class]:!!this.data.class,"vuecal__cell--current":this.data.current,"vuecal__cell--today":this.data.today,"vuecal__cell--out-of-scope":this.data.outOfScope,"vuecal__cell--before-min":this.isDisabled&&this.isBeforeMinDate,"vuecal__cell--after-max":this.isDisabled&&this.isAfterMaxDate,"vuecal__cell--disabled":this.isDisabled,"vuecal__cell--selected":this.isSelected,"vuecal__cell--highlighted":this.highlighted,"vuecal__cell--has-splits":this.splitsCount,"vuecal__cell--has-events":this.eventsCount}},cellStyles(){return{...this.cellWidth?{width:`${this.cellWidth}%`}:{}}},timelineVisible(){const{time:t,timeTo:e}=this.options;return this.data.today&&this.isWeekOrDayView&&t&&!this.allDay&&this.nowInMinutes<=e},todaysTimePosition(){if(!this.data.today||!this.options.time)return;const t=this.nowInMinutes-this.options.timeFrom;return Math.round(t*this.timeScale)},timeScale(){return this.options.timeCellHeight/this.options.timeStep}}},Be=K(Tt,[["render",bt]]),Et={key:0,class:"vuecal__all-day-text",style:{width:"3em"}};function St(t,e,l,a,o,s){const u=i.resolveComponent("vuecal-cell");return i.openBlock(),i.createElementBlock("div",{class:"vuecal__flex vuecal__all-day",style:i.normalizeStyle(l.cellOrSplitMinWidth&&{height:l.height})},[l.cellOrSplitMinWidth?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Et,[i.createElementVNode("span",null,i.toDisplayString(l.label),1)])),i.createElementVNode("div",{class:i.normalizeClass(["vuecal__flex vuecal__cells",`${s.view.id}-view`]),grow:"",style:i.normalizeStyle(l.cellOrSplitMinWidth?`min-width: ${l.cellOrSplitMinWidth}px`:"")},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.cells,(r,m)=>(i.openBlock(),i.createBlock(u,{key:m,options:l.options,"edit-events":s.editEvents,data:r,"all-day":!0,"cell-width":l.options.hideWeekdays.length&&(s.vuecal.isWeekView||s.vuecal.isMonthView)&&s.vuecal.cellWidth,"min-timestamp":l.options.minTimestamp,"max-timestamp":l.options.maxTimestamp,"cell-splits":l.daySplits},{event:i.withCtx(({event:c,view:v})=>[i.renderSlot(t.$slots,"event",{view:v,event:c})]),_:2},1032,["options","edit-events","data","cell-width","min-timestamp","max-timestamp","cell-splits"]))),128))],6)],4)}const _t={inject:["vuecal","view","editEvents"],components:{"vuecal-cell":Be},props:{options:{type:Object,required:!0},cells:{type:Array,required:!0},label:{type:String,required:!0},daySplits:{type:Array,default:()=>[]},shortEvents:{type:Boolean,default:!0},height:{type:String,default:""},cellOrSplitMinWidth:{type:Number,default:null}},computed:{hasCellOrSplitWidth(){return!!(this.options.minCellWidth||this.daySplits.length&&this.options.minSplitWidth)}}},Mt=K(_t,[["render",St]]),Vt=["lang"],Bt={class:"default"},Ot={key:0,class:"vuecal__flex vuecal__body",grow:""},Ht=["onBlur","innerHTML"],Wt=["innerHTML"],At=["innerHTML"],Nt={class:"vuecal__flex",row:"",grow:""},Pt={key:0,class:"vuecal__time-column"},Ft={class:"vuecal__time-cell-label"},Lt={key:1,class:"vuecal__flex vuecal__week-numbers",column:""},jt=["wrap","column"],xt=["onBlur","innerHTML"],zt=["innerHTML"],Yt=["innerHTML"],It=["wrap"],qt=["innerHTML"],Rt=["innerHTML"],Ut={key:2,class:"vuecal__cell-events-count"},Kt={key:3,class:"vuecal__no-event"},Gt=["onBlur","innerHTML"],Xt=["innerHTML"],Jt={key:2,class:"vuecal__event-time"},Zt={key:0},Qt={key:1,class:"days-to-end"},$t=["innerHTML"],ei={key:0,class:"vuecal__scrollbar-check"};function ti(t,e,l,a,o,s){const u=i.resolveComponent("vuecal-header"),r=i.resolveComponent("all-day-bar"),m=i.resolveComponent("weekdays-headings"),c=i.resolveComponent("vuecal-cell");return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["vuecal__flex vuecal",s.cssClasses]),column:"",ref:"vuecal",lang:l.locale},[i.createVNode(u,{options:t.$props,"edit-events":s.editEvents,"view-props":{views:s.views,weekDaysInHeader:s.weekDaysInHeader},"week-days":s.weekDays,"has-splits":s.hasSplits,"day-splits":s.daySplits,"switch-to-narrower-view":s.switchToNarrowerView},i.createSlots({"arrow-prev":i.withCtx(()=>[i.renderSlot(t.$slots,"arrow-prev",{},()=>[e[0]||(e[0]=i.createTextVNode(" ")),e[1]||(e[1]=i.createElementVNode("i",{class:"angle"},null,-1)),e[2]||(e[2]=i.createTextVNode(" "))])]),"arrow-next":i.withCtx(()=>[i.renderSlot(t.$slots,"arrow-next",{},()=>[e[3]||(e[3]=i.createTextVNode(" ")),e[4]||(e[4]=i.createElementVNode("i",{class:"angle"},null,-1)),e[5]||(e[5]=i.createTextVNode(" "))])]),"today-button":i.withCtx(()=>[i.renderSlot(t.$slots,"today-button",{},()=>[i.createElementVNode("span",Bt,i.toDisplayString(o.texts.today),1)])]),title:i.withCtx(()=>[i.renderSlot(t.$slots,"title",{title:s.viewTitle,view:o.view},()=>[i.createTextVNode(i.toDisplayString(s.viewTitle),1)])]),_:2},[t.$slots["weekday-heading"]?{name:"weekday-heading",fn:i.withCtx(({heading:v,view:y})=>[i.renderSlot(t.$slots,"weekday-heading",{heading:v,view:y})]),key:"0"}:void 0,t.$slots["split-label"]?{name:"split-label",fn:i.withCtx(({split:v})=>[i.renderSlot(t.$slots,"split-label",{split:v,view:o.view.id})]),key:"1"}:void 0]),1032,["options","edit-events","view-props","week-days","has-splits","day-splits","switch-to-narrower-view"]),l.hideBody?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Ot,[i.createVNode(i.Transition,{name:`slide-fade--${o.transitionDirection}`,appear:l.transitions},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("div",{class:"vuecal__flex",style:{"min-width":"100%"},key:l.transitions?o.view.id:!1,column:""},[l.showAllDayEvents&&s.hasTimeColumn&&(!s.cellOrSplitMinWidth||s.isDayView&&!l.minSplitWidth)?(i.openBlock(),i.createBlock(r,i.normalizeProps(i.mergeProps({key:0},s.allDayBar)),{event:i.withCtx(({event:v,view:y})=>[i.renderSlot(t.$slots,"event",{view:y,event:v},()=>[s.editEvents.title&&v.titleEditable?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__event-title vuecal__event-title--edit",contenteditable:"",onBlur:w=>s.onEventTitleBlur(w,v),innerHTML:v.title},null,40,Ht)):v.title?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__event-title",innerHTML:v.title},null,8,Wt)):i.createCommentVNode("",!0),v.content&&!s.hasShortEvents&&!s.isShortMonthView?(i.openBlock(),i.createElementBlock("div",{key:2,class:"vuecal__event-content",innerHTML:v.content},null,8,At)):i.createCommentVNode("",!0)])]),_:3},16)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["vuecal__bg",{vuecal__flex:!s.hasTimeColumn}]),column:""},[i.createElementVNode("div",Nt,[s.hasTimeColumn?(i.openBlock(),i.createElementBlock("div",Pt,[l.showAllDayEvents&&s.cellOrSplitMinWidth&&!(s.isDayView&&!l.minSplitWidth)?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__all-day-text",style:i.normalizeStyle({height:s.allDayBar.height})},[i.createElementVNode("span",null,i.toDisplayString(o.texts.allDay),1)],4)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.timeCells,(v,y)=>(i.openBlock(),i.createElementBlock("div",{class:"vuecal__time-cell",key:y,style:i.normalizeStyle(`height: ${l.timeCellHeight}px`)},[i.renderSlot(t.$slots,"time-cell",{hours:v.hours,minutes:v.minutes},()=>[e[6]||(e[6]=i.createElementVNode("span",{class:"vuecal__time-cell-line"},null,-1)),i.createElementVNode("span",Ft,i.toDisplayString(v.label),1)])],4))),128))])):i.createCommentVNode("",!0),l.showWeekNumbers&&s.isMonthView?(i.openBlock(),i.createElementBlock("div",Lt,[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(6,v=>i.createElementVNode("div",{class:"vuecal__flex vuecal__week-number-cell",key:v,grow:""},[i.renderSlot(t.$slots,"week-number-cell",{week:s.getWeekNumber(v-1)},()=>[i.createTextVNode(i.toDisplayString(s.getWeekNumber(v-1)),1)])])),64))])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["vuecal__flex vuecal__cells",`${o.view.id}-view`]),grow:"",wrap:!s.cellOrSplitMinWidth||!s.isWeekView,column:!!s.cellOrSplitMinWidth},[s.cellOrSplitMinWidth&&s.isWeekView?(i.openBlock(),i.createBlock(m,{key:0,"transition-direction":o.transitionDirection,"week-days":s.weekDays,"switch-to-narrower-view":s.switchToNarrowerView,style:i.normalizeStyle(s.cellOrSplitMinWidth?`min-width: ${s.cellOrSplitMinWidth}px`:"")},i.createSlots({_:2},[t.$slots["weekday-heading"]?{name:"weekday-heading",fn:i.withCtx(({heading:v,view:y})=>[i.renderSlot(t.$slots,"weekday-heading",{heading:v,view:y})]),key:"0"}:void 0,t.$slots["split-label"]?{name:"split-label",fn:i.withCtx(({split:v})=>[i.renderSlot(t.$slots,"split-label",{split:v,view:o.view.id})]),key:"1"}:void 0]),1032,["transition-direction","week-days","switch-to-narrower-view","style"])):s.hasSplits&&l.stickySplitLabels&&l.minSplitWidth?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__flex vuecal__split-days-headers",style:i.normalizeStyle(s.cellOrSplitMinWidth?`min-width: ${s.cellOrSplitMinWidth}px`:"")},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.daySplits,(v,y)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["day-split-header",v.class||!1]),key:y},[i.renderSlot(t.$slots,"split-label",{split:v,view:o.view.id},()=>[i.createTextVNode(i.toDisplayString(v.label),1)])],2))),128))],4)):i.createCommentVNode("",!0),l.showAllDayEvents&&s.hasTimeColumn&&(s.isWeekView&&s.cellOrSplitMinWidth||s.isDayView&&s.hasSplits&&l.minSplitWidth)?(i.openBlock(),i.createBlock(r,i.normalizeProps(i.mergeProps({key:2},s.allDayBar)),{event:i.withCtx(({event:v,view:y})=>[i.renderSlot(t.$slots,"event",{view:y,event:v},()=>[s.editEvents.title&&v.titleEditable?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__event-title vuecal__event-title--edit",contenteditable:"",onBlur:w=>s.onEventTitleBlur(w,v),innerHTML:v.title},null,40,xt)):v.title?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__event-title",innerHTML:v.title},null,8,zt)):i.createCommentVNode("",!0),v.content&&!s.hasShortEvents&&!s.isShortMonthView?(i.openBlock(),i.createElementBlock("div",{key:2,class:"vuecal__event-content",innerHTML:v.content},null,8,Yt)):i.createCommentVNode("",!0)])]),_:3},16)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:"vuecal__flex",ref:v=>o.cellsEl=v,grow:"",wrap:!s.cellOrSplitMinWidth||!s.isWeekView,style:i.normalizeStyle(s.cellOrSplitMinWidth?`min-width: ${s.cellOrSplitMinWidth}px`:"")},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.viewCells,(v,y)=>(i.openBlock(),i.createBlock(c,{key:y,options:t.$props,"edit-events":s.editEvents,data:v,"cell-width":l.hideWeekdays.length&&(s.isWeekView||s.isMonthView)&&s.cellWidth,"min-timestamp":s.minTimestamp,"max-timestamp":s.maxTimestamp,"cell-splits":s.hasSplits&&s.daySplits||[]},{"cell-content":i.withCtx(({events:w,split:T,selectCell:g})=>[i.renderSlot(t.$slots,"cell-content",{cell:v,view:o.view,goNarrower:g,events:w},()=>[T&&!l.stickySplitLabels?(i.openBlock(),i.createElementBlock("div",{key:0,class:"split-label",innerHTML:T.label},null,8,qt)):i.createCommentVNode("",!0),v.content?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__cell-date",innerHTML:v.content},null,8,Rt)):i.createCommentVNode("",!0),(s.isMonthView&&!l.eventsOnMonthView||s.isYearsOrYearView&&l.eventsCountOnYearView)&&w.length?(i.openBlock(),i.createElementBlock("div",Ut,[i.renderSlot(t.$slots,"events-count",{view:o.view,events:w},()=>[i.createTextVNode(i.toDisplayString(w.length),1)])])):i.createCommentVNode("",!0),!s.cellOrSplitHasEvents(w,T)&&s.isWeekOrDayView?(i.openBlock(),i.createElementBlock("div",Kt,[i.renderSlot(t.$slots,"no-event",{},()=>[i.createTextVNode(i.toDisplayString(o.texts.noEvent),1)])])):i.createCommentVNode("",!0)])]),event:i.withCtx(({event:w,view:T})=>[i.renderSlot(t.$slots,"event",{view:T,event:w},()=>[s.editEvents.title&&w.titleEditable?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__event-title vuecal__event-title--edit",contenteditable:"",onBlur:g=>s.onEventTitleBlur(g,w),innerHTML:w.title},null,40,Gt)):w.title?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__event-title",innerHTML:w.title},null,8,Xt)):i.createCommentVNode("",!0),l.time&&!w.allDay&&!(s.isMonthView&&(w.allDay||l.showAllDayEvents==="short"))&&!s.isShortMonthView?(i.openBlock(),i.createElementBlock("div",Jt,[i.createTextVNode(i.toDisplayString(o.utils.date.formatTime(w.start,s.TimeFormat)),1),w.endTimeMinutes?(i.openBlock(),i.createElementBlock("span",Zt," - "+i.toDisplayString(o.utils.date.formatTime(w.end,s.TimeFormat,null,!0)),1)):i.createCommentVNode("",!0),w.daysCount>1&&(w.segments[v.formattedDate]||{}).isFirstDay?(i.openBlock(),i.createElementBlock("small",Qt," +"+i.toDisplayString(w.daysCount-1)+i.toDisplayString((o.texts.day[0]||"").toLowerCase()),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),w.content&&!(s.isMonthView&&w.allDay&&l.showAllDayEvents==="short")&&!s.isShortMonthView?(i.openBlock(),i.createElementBlock("div",{key:3,class:"vuecal__event-content",innerHTML:w.content},null,8,$t)):i.createCommentVNode("",!0)])]),"no-event":i.withCtx(()=>[i.renderSlot(t.$slots,"no-event",{},()=>[i.createTextVNode(i.toDisplayString(o.texts.noEvent),1)])]),_:2},1032,["options","edit-events","data","cell-width","min-timestamp","max-timestamp","cell-splits"]))),128))],12,It)],10,jt)])],2)]))]),_:3},8,["name","appear"]),o.ready?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",ei,e[7]||(e[7]=[i.createElementVNode("div",null,null,-1)])))]))],10,Vt)}const ce=24*60,me={weekDays:Array(7).fill(""),weekDaysShort:[],months:Array(12).fill(""),years:"",year:"",month:"",week:"",day:"",today:"",noEvent:"",allDay:"",deleteEvent:"",createEvent:"",dateFormat:"dddd MMMM D, YYYY",am:"am",pm:"pm"},Se=["years","year","month","week","day"],_e=new Ye(me),ii={name:"vue-cal",components:{"vuecal-cell":Be,"vuecal-header":vt,WeekdaysHeadings:Ve,AllDayBar:Mt},provide(){return{vuecal:this,utils:this.utils,modules:this.modules,previous:this.previous,next:this.next,switchView:this.switchView,updateSelectedDate:this.updateSelectedDate,editEvents:this.editEvents,view:this.view,domEvents:this.domEvents}},props:{activeView:{type:String,default:"week"},allDayBarHeight:{type:[String,Number],default:"25px"},cellClickHold:{type:Boolean,default:!0},cellContextmenu:{type:Boolean,default:!1},clickToNavigate:{type:Boolean,default:!1},dblclickToNavigate:{type:Boolean,default:!0},disableDatePrototypes:{type:Boolean,default:!1},disableDays:{type:Array,default:()=>[]},disableViews:{type:Array,default:()=>[]},dragToCreateEvent:{type:Boolean,default:!0},dragToCreateThreshold:{type:Number,default:15},editableEvents:{type:[Boolean,Object],default:!1},events:{type:Array,default:()=>[]},eventsCountOnYearView:{type:Boolean,default:!1},eventsOnMonthView:{type:[Boolean,String],default:!1},hideBody:{type:Boolean,default:!1},hideTitleBar:{type:Boolean,default:!1},hideViewSelector:{type:Boolean,default:!1},hideWeekdays:{type:Array,default:()=>[]},hideWeekends:{type:Boolean,default:!1},locale:{type:[String,Object],default:"en"},maxDate:{type:[String,Date],default:""},minCellWidth:{type:Number,default:0},minDate:{type:[String,Date],default:""},minEventWidth:{type:Number,default:0},minSplitWidth:{type:Number,default:0},onEventClick:{type:[Function,null],default:null},onEventCreate:{type:[Function,null],default:null},onEventDblclick:{type:[Function,null],default:null},overlapsPerTimeStep:{type:Boolean,default:!1},resizeX:{type:Boolean,default:!1},selectedDate:{type:[String,Date],default:""},showAllDayEvents:{type:[Boolean,String],default:!1},showTimeInCells:{type:Boolean,default:!1},showWeekNumbers:{type:[Boolean,String],default:!1},snapToTime:{type:Number,default:0},small:{type:Boolean,default:!1},specialHours:{type:Object,default:()=>({})},splitDays:{type:Array,default:()=>[]},startWeekOnSunday:{type:Boolean,default:!1},stickySplitLabels:{type:Boolean,default:!1},time:{type:Boolean,default:!0},timeCellHeight:{type:Number,default:40},timeFormat:{type:String,default:""},timeFrom:{type:Number,default:0},timeStep:{type:Number,default:60},timeTo:{type:Number,default:ce},todayButton:{type:Boolean,default:!1},transitions:{type:Boolean,default:!0},twelveHour:{type:Boolean,default:!1},watchRealTime:{type:Boolean,default:!1},xsmall:{type:Boolean,default:!1}},data(){return{ready:!1,texts:{...me},utils:{date:(this.disableDatePrototypes?_e.removePrototypes():!1)||_e,cell:null,event:null},modules:{dnd:null},cellsEl:null,view:{id:"",title:"",startDate:null,endDate:null,firstCellDate:null,lastCellDate:null,selectedDate:null,events:[]},eventIdIncrement:1,now:new Date,timeTickerIds:[null,null],domEvents:{resizeAnEvent:{_eid:null,start:null,split:null,segment:null,originalEndTimeMinutes:0,originalEnd:null,end:null,startCell:null,endCell:null},dragAnEvent:{_eid:null},dragCreateAnEvent:{startCursorY:null,start:null,split:null,event:null},focusAnEvent:{_eid:null,mousedUp:!1},clickHoldAnEvent:{_eid:null,timeout:1200,timeoutId:null},dblTapACell:{taps:0,timeout:500},clickHoldACell:{cellId:null,split:null,timeout:1200,timeoutId:null,eventCreated:!1},cancelClickEventCreation:!1},mutableEvents:[],transitionDirection:"right"}},methods:{async loadLocale(t){if(typeof this.locale=="object"){this.texts=Object.assign({},me,t),this.utils.date.updateTexts(this.texts);return}const e=await ze(Object.assign({"./i18n/ar.json":()=>Promise.resolve().then(()=>require("./ar.es-CKau4tBl.js")),"./i18n/bg.json":()=>Promise.resolve().then(()=>require("./bg.es-Melqx1M5.js")),"./i18n/bn.json":()=>Promise.resolve().then(()=>require("./bn.es-ClbAZ4WP.js")),"./i18n/bs.json":()=>Promise.resolve().then(()=>require("./bs.es-KjOcbE96.js")),"./i18n/ca.json":()=>Promise.resolve().then(()=>require("./ca.es-BaGTENcW.js")),"./i18n/cs.json":()=>Promise.resolve().then(()=>require("./cs.es-ChOlHqBr.js")),"./i18n/da.json":()=>Promise.resolve().then(()=>require("./da.es-DOFXbf8-.js")),"./i18n/de.json":()=>Promise.resolve().then(()=>require("./de.es-DwE82Kaw.js")),"./i18n/el.json":()=>Promise.resolve().then(()=>require("./el.es-CNrCgzYI.js")),"./i18n/en.json":()=>Promise.resolve().then(()=>require("./en.es-CgL601qd.js")),"./i18n/es.json":()=>Promise.resolve().then(()=>require("./es.es-IdFGKY7Q.js")),"./i18n/et.json":()=>Promise.resolve().then(()=>require("./et.es-BygWmV3P.js")),"./i18n/fa.json":()=>Promise.resolve().then(()=>require("./fa.es-DW_0SmsT.js")),"./i18n/fi.json":()=>Promise.resolve().then(()=>require("./fi.es-pgfJlZ8i.js")),"./i18n/fr.json":()=>Promise.resolve().then(()=>require("./fr.es-OENguFuM.js")),"./i18n/he.json":()=>Promise.resolve().then(()=>require("./he.es-bixEnAeH.js")),"./i18n/hr.json":()=>Promise.resolve().then(()=>require("./hr.es-CkRAP94O.js")),"./i18n/hu.json":()=>Promise.resolve().then(()=>require("./hu.es-DG6HeiQJ.js")),"./i18n/id.json":()=>Promise.resolve().then(()=>require("./id.es-D4tPi6wP.js")),"./i18n/is.json":()=>Promise.resolve().then(()=>require("./is.es-CDFqLYCV.js")),"./i18n/it.json":()=>Promise.resolve().then(()=>require("./it.es-BHgrw_C6.js")),"./i18n/ja.json":()=>Promise.resolve().then(()=>require("./ja.es-D-lxWwyb.js")),"./i18n/ka.json":()=>Promise.resolve().then(()=>require("./ka.es-CnnB6q4A.js")),"./i18n/ko.json":()=>Promise.resolve().then(()=>require("./ko.es-b18aaB3V.js")),"./i18n/lt.json":()=>Promise.resolve().then(()=>require("./lt.es-BY9UQ6wZ.js")),"./i18n/mn.json":()=>Promise.resolve().then(()=>require("./mn.es-YFS7gSdf.js")),"./i18n/nl.json":()=>Promise.resolve().then(()=>require("./nl.es-BEx-4hnj.js")),"./i18n/no.json":()=>Promise.resolve().then(()=>require("./no.es-BQnRWlWR.js")),"./i18n/pl.json":()=>Promise.resolve().then(()=>require("./pl.es-CKCsZ_02.js")),"./i18n/pt-br.json":()=>Promise.resolve().then(()=>require("./pt-br.es-oH7qh6Fd.js")),"./i18n/pt-pt.json":()=>Promise.resolve().then(()=>require("./pt-pt.es-DLk5I0ej.js")),"./i18n/ro.json":()=>Promise.resolve().then(()=>require("./ro.es-DgTen1Dh.js")),"./i18n/ru.json":()=>Promise.resolve().then(()=>require("./ru.es-jGIQfREl.js")),"./i18n/sk.json":()=>Promise.resolve().then(()=>require("./sk.es-D2bhVb26.js")),"./i18n/sl.json":()=>Promise.resolve().then(()=>require("./sl.es-TV8Uraa1.js")),"./i18n/sq.json":()=>Promise.resolve().then(()=>require("./sq.es-Cc65zxbr.js")),"./i18n/sr.json":()=>Promise.resolve().then(()=>require("./sr.es-D5VNA_GW.js")),"./i18n/sv.json":()=>Promise.resolve().then(()=>require("./sv.es-dBeK_DZs.js")),"./i18n/tr.json":()=>Promise.resolve().then(()=>require("./tr.es-BUz4S13G.js")),"./i18n/uk.json":()=>Promise.resolve().then(()=>require("./uk.es-B8uaeLcK.js")),"./i18n/vi.json":()=>Promise.resolve().then(()=>require("./vi.es-2OFMtbQI.js")),"./i18n/zh-cn.json":()=>Promise.resolve().then(()=>require("./zh-cn.es-fDHCbCIg.js")),"./i18n/zh-hk.json":()=>Promise.resolve().then(()=>require("./zh-hk.es-COzeh5F8.js"))}),`./i18n/${t}.json`,3);this.texts=Object.assign({},me,e),this.utils.date.updateTexts(this.texts)},loadDragAndDrop(){Promise.resolve().then(()=>require("./drag-and-drop.es-4ttM1tRs.js")).then(t=>{const{DragAndDrop:e}=t;this.modules.dnd=new e(this)}).catch(()=>console.warn("Vue Cal: Missing drag & drop module."))},validateView(t){return Se.includes(t)||(console.error(`Vue Cal: invalid active-view parameter provided: "${t}".
2
2
  A valid view must be one of: ${Se.join(", ")}.`),t="week"),this.enabledViews.includes(t)||(console.warn(`Vue Cal: the provided active-view "${t}" is disabled. Using the "${this.enabledViews[0]}" view instead.`),t=this.enabledViews[0]),t},switchToNarrowerView(t=null){this.transitionDirection="right";const e=this.enabledViews[this.enabledViews.indexOf(this.view.id)+1];e&&this.switchView(e,t)},switchView(t,e=null,l=!1){t=this.validateView(t);const a=this.utils.date,o=this.view.startDate&&this.view.startDate.getTime();if(this.transitions&&l){if(this.view.id===t)return;const r=this.enabledViews;this.transitionDirection=r.indexOf(this.view.id)>r.indexOf(t)?"left":"right"}const s=this.view.id;switch(this.view.events=[],this.view.id=t,this.view.firstCellDate=null,this.view.lastCellDate=null,e||(e=this.view.selectedDate||this.view.startDate),t){case"years":{this.view.startDate=new Date(Math.floor(e.getFullYear()/25)*25||2e3,0,1),this.view.endDate=new Date(this.view.startDate.getFullYear()+25,0,1),this.view.endDate.setSeconds(-1);break}case"year":{this.view.startDate=new Date(e.getFullYear(),0,1),this.view.endDate=new Date(e.getFullYear()+1,0,1),this.view.endDate.setSeconds(-1);break}case"month":{this.view.startDate=new Date(e.getFullYear(),e.getMonth(),1),this.view.endDate=new Date(e.getFullYear(),e.getMonth()+1,1),this.view.endDate.setSeconds(-1);let r=new Date(this.view.startDate);if(r.getDay()!==(this.startWeekOnSunday?0:1)&&(r=a.getPreviousFirstDayOfWeek(r,this.startWeekOnSunday)),this.view.firstCellDate=r,this.view.lastCellDate=a.addDays(r,41),this.view.lastCellDate.setHours(23,59,59,0),this.hideWeekends){if([0,6].includes(this.view.firstCellDate.getDay())){const m=this.view.firstCellDate.getDay()===6&&!this.startWeekOnSunday?2:1;this.view.firstCellDate=a.addDays(this.view.firstCellDate,m)}if([0,6].includes(this.view.startDate.getDay())){const m=this.view.startDate.getDay()===6?2:1;this.view.startDate=a.addDays(this.view.startDate,m)}if([0,6].includes(this.view.lastCellDate.getDay())){const m=this.view.lastCellDate.getDay()===0&&!this.startWeekOnSunday?2:1;this.view.lastCellDate=a.subtractDays(this.view.lastCellDate,m)}if([0,6].includes(this.view.endDate.getDay())){const m=this.view.endDate.getDay()===0?2:1;this.view.endDate=a.subtractDays(this.view.endDate,m)}}break}case"week":{e=a.getPreviousFirstDayOfWeek(e,this.startWeekOnSunday);const r=this.hideWeekends?5:7;this.view.startDate=this.hideWeekends&&this.startWeekOnSunday?a.addDays(e,1):e,this.view.startDate.setHours(0,0,0,0),this.view.endDate=a.addDays(e,r),this.view.endDate.setSeconds(-1);break}case"day":{this.view.startDate=e,this.view.startDate.setHours(0,0,0,0),this.view.endDate=new Date(e),this.view.endDate.setHours(23,59,59,0);break}}this.addEventsToView();const u=this.view.startDate&&this.view.startDate.getTime();if(!(s===t&&u===o)&&(this.$emit("update:activeView",t),this.ready)){const r=this.view.startDate,m={view:t,startDate:r,endDate:this.view.endDate,...this.isMonthView?{firstCellDate:this.view.firstCellDate,lastCellDate:this.view.lastCellDate,outOfScopeEvents:this.view.outOfScopeEvents.map(this.cleanupEvent)}:{},events:this.view.events.map(this.cleanupEvent),...this.isWeekView?{week:a.getWeek(this.startWeekOnSunday?a.addDays(r,1):r)}:{}};this.$emit("view-change",m)}},previous(){this.previousNext(!1)},next(){this.previousNext()},previousNext(t=!0){const e=this.utils.date;this.transitionDirection=t?"right":"left";const l=t?1:-1;let a=null;const{startDate:o,id:s}=this.view;switch(s){case"years":a=new Date(o.getFullYear()+25*l,0,1);break;case"year":a=new Date(o.getFullYear()+1*l,1,1);break;case"month":a=new Date(o.getFullYear(),o.getMonth()+1*l,1);break;case"week":a=e[t?"addDays":"subtractDays"](e.getPreviousFirstDayOfWeek(o,this.startWeekOnSunday),7);break;case"day":a=e[t?"addDays":"subtractDays"](o,1);const u=a.getDay(),r=this.startWeekOnSunday?u:(u||7)-1;if(this.weekDays[r].hide){const c=this.weekDays.map((y,w)=>({...y,i:w}));let v=0;t?([...c.slice(r),...c].find(y=>(v++,!y.hide)).i,v--):[...c,...c.slice(0,r)].reverse().find(y=>(v++,!y.hide)).i,a=e[t?"addDays":"subtractDays"](a,v)}break}a&&this.switchView(s,a)},addEventsToView(t=[]){const e=this.utils.event,{startDate:l,endDate:a,firstCellDate:o,lastCellDate:s}=this.view;if(t.length||(this.view.events=[]),t=t.length?t:[...this.mutableEvents],!t||this.isYearsOrYearView&&!this.eventsCountOnYearView)return;let u=t.filter(r=>e.eventInRange(r,l,a));!this.isYearsOrYearView&&!(this.isMonthView&&!this.eventsOnMonthView)&&(u=u.map(r=>r.daysCount>1?e.createEventSegments(r,o||l,s||a):r)),this.view.events.push(...u),this.isMonthView&&(this.view.outOfScopeEvents=[],t.forEach(r=>{(e.eventInRange(r,o,l)||e.eventInRange(r,a,s))&&(this.view.events.some(m=>m._eid===r._eid)||this.view.outOfScopeEvents.push(r))}))},findAncestor(t,e){for(;(t=t.parentElement)&&!t.classList.contains(e););return t},isDOMElementAnEvent(t){return t.classList.contains("vuecal__event")||this.findAncestor(t,"vuecal__event")},onMouseMove(t){const{resizeAnEvent:e,dragAnEvent:l,dragCreateAnEvent:a}=this.domEvents;e._eid===null&&l._eid===null&&!a.start||(t.preventDefault(),e._eid?this.eventResizing(t):this.dragToCreateEvent&&a.start&&this.eventDragCreation(t))},onMouseUp(t){const{focusAnEvent:e,resizeAnEvent:l,clickHoldAnEvent:a,clickHoldACell:o,dragCreateAnEvent:s}=this.domEvents,{_eid:u}=a,{_eid:r}=l;let m=!1;const{event:c,start:v}=s,y=this.isDOMElementAnEvent(t.target),w=e.mousedUp;if(e.mousedUp=!1,y&&(this.domEvents.cancelClickEventCreation=!0),o.eventCreated)return;if(r){const{originalEnd:g,originalEndTimeMinutes:_,endTimeMinutes:E}=l,D=this.view.events.find(V=>V._eid===l._eid);if(m=E&&E!==_,D&&D.end.getTime()!==g.getTime()){const V=this.mutableEvents.find(F=>F._eid===l._eid);V.endTimeMinutes=D.endTimeMinutes,V.end=D.end;const C=this.cleanupEvent(D),H={...this.cleanupEvent(D),end:g,endTimeMinutes:D.originalEndTimeMinutes};this.$emit("event-duration-change",{event:C,oldDate:l.originalEnd,originalEvent:H}),this.$emit("event-change",{event:C,originalEvent:H})}D&&(D.resizing=!1),l._eid=null,l.start=null,l.split=null,l.segment=null,l.originalEndTimeMinutes=null,l.originalEnd=null,l.endTimeMinutes=null,l.startCell=null,l.endCell=null}else v&&(c&&(this.emitWithEvent("event-drag-create",c),s.event.resizing=!1),s.start=null,s.split=null,s.event=null);!y&&!r&&this.unfocusEvent(),a.timeoutId&&!u&&(clearTimeout(a.timeoutId),a.timeoutId=null),o.timeoutId&&(clearTimeout(o.timeoutId),o.timeoutId=null);const T=typeof this.onEventClick=="function";if(w&&!m&&!u&&!c&&T){let g=this.view.events.find(_=>_._eid===e._eid);return!g&&this.isMonthView&&(g=this.view.outOfScopeEvents.find(_=>_._eid===e._eid)),g&&this.onEventClick(g,t)}},onKeyUp(t){t.keyCode===27&&this.cancelDelete()},eventResizing(t){const{resizeAnEvent:e}=this.domEvents,l=this.view.events.find(c=>c._eid===e._eid)||{segments:{}},{minutes:a,cursorCoords:o}=this.minutesAtCursor(t),s=l.segments&&l.segments[e.segment],{date:u,event:r}=this.utils,m=Math.max(a,this.timeFrom+1,(s||l).startTimeMinutes+1);if(l.endTimeMinutes=e.endTimeMinutes=m,this.snapToTime){const c=l.endTimeMinutes+this.snapToTime/2;l.endTimeMinutes=c-c%this.snapToTime}if(s&&(s.endTimeMinutes=l.endTimeMinutes),l.end.setHours(0,l.endTimeMinutes,l.endTimeMinutes===ce?-1:0,0),this.resizeX&&this.isWeekView){l.daysCount=u.countDays(l.start,l.end);const c=this.cellsEl,v=c.offsetWidth/c.childElementCount,y=Math.floor(o.x/v);if(e.startCell===null&&(e.startCell=y-(l.daysCount-1)),e.endCell!==y){e.endCell=y;const w=u.addDays(l.start,y-e.startCell),T=Math.max(u.countDays(l.start,w),1);if(T!==l.daysCount){let g=null;T>l.daysCount?g=r.addEventSegment(l):g=r.removeEventSegment(l),e.segment=g,l.endTimeMinutes+=.001}}}this.$emit("event-resizing",{_eid:l._eid,end:l.end,endTimeMinutes:l.endTimeMinutes})},eventDragCreation(t){const{dragCreateAnEvent:e}=this.domEvents,{start:l,startCursorY:a,split:o}=e,s=new Date(l),{minutes:u,cursorCoords:{y:r}}=this.minutesAtCursor(t);if(!(!e.event&&Math.abs(a-r)<this.dragToCreateThreshold))if(e.event){if(s.setHours(0,u,u===ce?-1:0,0),this.snapToTime){let v=s.getHours()*60+s.getMinutes();const y=v+this.snapToTime/2;v=y-y%this.snapToTime,s.setHours(0,v,0,0)}const m=l<s,{event:c}=e;c.start=m?l:s,c.end=m?s:l,c.startTimeMinutes=c.start.getHours()*60+c.start.getMinutes(),c.endTimeMinutes=c.end.getHours()*60+c.end.getMinutes()}else{if(e.event=this.utils.event.createAnEvent(l,1,{split:o}),!e.event){e.start=null,e.split=null,e.event=null;return}e.event.resizing=!0}},unfocusEvent(){const{focusAnEvent:t,clickHoldAnEvent:e}=this.domEvents,l=this.view.events.find(a=>a._eid===(t._eid||e._eid));t._eid=null,e._eid=null,l&&(l.focused=!1,l.deleting=!1)},cancelDelete(){const{clickHoldAnEvent:t}=this.domEvents;if(t._eid){const e=this.view.events.find(l=>l._eid===t._eid);e&&(e.deleting=!1),t._eid=null,t.timeoutId=null}},onEventTitleBlur(t,e){if(e.title===t.target.innerHTML)return;const l=e.title;e.title=t.target.innerHTML;const a=this.cleanupEvent(e);this.$emit("event-title-change",{event:a,oldTitle:l}),this.$emit("event-change",{event:a,originalEvent:{...a,title:l}})},updateMutableEvents(){const t=this.utils.date;this.mutableEvents=[],this.events.forEach(e=>{const l=typeof e.start=="string"?t.stringToDate(e.start):e.start,a=t.formatDateLite(l),o=t.dateToMinutes(l);let s=null;typeof e.end=="string"&&e.end.includes("24:00")?(s=new Date(e.end.replace(" 24:00","")),s.setHours(23,59,59,0)):s=typeof e.end=="string"?t.stringToDate(e.end):e.end;let u=t.formatDateLite(s),r=t.dateToMinutes(s);(!r||r===ce)&&(!this.time||typeof e.end=="string"&&e.end.length===10?s.setHours(23,59,59,0):s.setSeconds(s.getSeconds()-1),u=t.formatDateLite(s),r=ce);const m=a!==u;e=Object.assign({...this.utils.event.eventDefaults},e,{_eid:`${this._.uid}_${this.eventIdIncrement++}`,segments:m?{}:null,start:l,startTimeMinutes:o,end:s,endTimeMinutes:r,daysCount:m?t.countDays(l,s):1,class:e.class}),this.mutableEvents.push(e)})},minutesAtCursor(t){return this.utils.cell.minutesAtCursor(t)},createEvent(t,e,l={}){return this.utils.event.createAnEvent(t,e,l)},cleanupEvent(t){return t={...t},["segments","deletable","deleting","titleEditable","resizable","resizing","draggable","dragging","draggingStatic","focused"].forEach(l=>{l in t&&delete t[l]}),t.repeat||delete t.repeat,t},emitWithEvent(t,e){this.$emit(t,this.cleanupEvent(e))},updateSelectedDate(t){if(t&&typeof t=="string"?t=this.utils.date.stringToDate(t):t=new Date(t),t&&t instanceof Date){const{selectedDate:e}=this.view;e&&(this.transitionDirection=e.getTime()>t.getTime()?"left":"right"),t.setHours(0,0,0,0),(!e||e.getTime()!==t.getTime())&&(this.view.selectedDate=t),this.switchView(this.view.id)}this.$emit("update:selected-date",this.view.selectedDate)},getWeekNumber(t){const e=this.utils.date,a=this.firstCellDateWeekNumber+t,o=this.startWeekOnSunday?1:0;return a>52?e.getWeek(e.addDays(this.view.firstCellDate,7*t+o)):a},timeTick(){this.now=new Date,this.timeTickerIds[1]=setTimeout(this.timeTick,60*1e3)},updateDateTexts(){this.utils.date.updateTexts(this.texts)},alignWithScrollbar(){if(document.getElementById("vuecal-align-with-scrollbar"))return;const t=this.$refs.vuecal.getElementsByClassName("vuecal__scrollbar-check")[0],e=t.offsetWidth-t.children[0].offsetWidth;if(e){const l=document.createElement("style");l.id="vuecal-align-with-scrollbar",l.type="text/css",l.innerHTML=`.vuecal--view-with-time .vuecal__weekdays-headings,.vuecal--view-with-time .vuecal__all-day {padding-right: ${e}px}`,document.head.appendChild(l)}},cellOrSplitHasEvents(t,e=null){return t.length&&(!e&&t.length||e&&t.some(l=>l.split===e.id))}},created(){this.utils.cell=new qe(this),this.utils.event=new Ue(this,this.utils.date),this.loadLocale(this.locale),this.editEvents.drag&&this.loadDragAndDrop(),this.updateMutableEvents(this.events),this.view.id=this.currentView,this.selectedDate?this.updateSelectedDate(this.selectedDate):(this.view.selectedDate=new Date,this.switchView(this.currentView)),this.time&&this.watchRealTime&&(this.timeTickerIds[0]=setTimeout(this.timeTick,(60-this.now.getSeconds())*1e3))},mounted(){const t=this.utils.date,e="ontouchstart"in window,{resize:l,drag:a,create:o,delete:s,title:u}=this.editEvents,r=this.onEventClick&&typeof this.onEventClick=="function";(l||a||o||s||u||r)&&window.addEventListener(e?"touchend":"mouseup",this.onMouseUp),(l||a||o&&this.dragToCreateEvent)&&window.addEventListener(e?"touchmove":"mousemove",this.onMouseMove,{passive:!1}),u&&window.addEventListener("keyup",this.onKeyUp),e&&(this.$refs.vuecal.oncontextmenu=function(v){v.preventDefault(),v.stopPropagation()}),this.hideBody||this.alignWithScrollbar();const m=this.view.startDate,c={view:this.view.id,startDate:m,endDate:this.view.endDate,...this.isMonthView?{firstCellDate:this.view.firstCellDate,lastCellDate:this.view.lastCellDate}:{},events:this.view.events.map(this.cleanupEvent),...this.isWeekView?{week:t.getWeek(this.startWeekOnSunday?t.addDays(m,1):m)}:{}};this.$emit("ready",c),this.ready=!0},beforeUnmount(){const t="ontouchstart"in window;window.removeEventListener(t?"touchmove":"mousemove",this.onMouseMove,{passive:!1}),window.removeEventListener(t?"touchend":"mouseup",this.onMouseUp),window.removeEventListener("keyup",this.onKeyUp),this.timeTickerIds[0]&&clearTimeout(this.timeTickerIds[0]),this.timeTickerIds[1]&&clearTimeout(this.timeTickerIds[1]),this.timeTickerIds=[null,null]},computed:{editEvents(){return this.editableEvents&&typeof this.editableEvents=="object"?{title:!!this.editableEvents.title,drag:!!this.editableEvents.drag,resize:!!this.editableEvents.resize,create:!!this.editableEvents.create,delete:!!this.editableEvents.delete}:{title:!!this.editableEvents,drag:!!this.editableEvents,resize:!!this.editableEvents,create:!!this.editableEvents,delete:!!this.editableEvents}},views(){return{years:{label:this.texts.years,enabled:!this.disableViews.includes("years")},year:{label:this.texts.year,enabled:!this.disableViews.includes("year")},month:{label:this.texts.month,enabled:!this.disableViews.includes("month")},week:{label:this.texts.week,enabled:!this.disableViews.includes("week")},day:{label:this.texts.day,enabled:!this.disableViews.includes("day")}}},currentView(){return this.validateView(this.activeView)},enabledViews(){return Object.keys(this.views).filter(t=>this.views[t].enabled)},hasTimeColumn(){return this.time&&this.isWeekOrDayView},isShortMonthView(){return this.isMonthView&&this.eventsOnMonthView==="short"},firstCellDateWeekNumber(){const t=this.utils.date,e=this.view.firstCellDate;return t.getWeek(this.startWeekOnSunday?t.addDays(e,1):e)},timeCells(){const t=[];for(let e=this.timeFrom,l=this.timeTo;e<l;e+=this.timeStep)t.push({hours:Math.floor(e/60),minutes:e%60,label:this.utils.date.formatTime(e,this.TimeFormat),value:e});return t},TimeFormat(){return this.timeFormat||(this.twelveHour?"h:mm{am}":"HH:mm")},daySplits(){return(this.splitDays.filter(t=>!t.hide)||[]).map((t,e)=>({...t,id:t.id||e+1}))},hasSplits(){return this.daySplits.length&&this.isWeekOrDayView},hasShortEvents(){return this.showAllDayEvents==="short"},cellOrSplitMinWidth(){let t=null;return this.hasSplits&&this.minSplitWidth?t=this.visibleDaysCount*this.minSplitWidth*this.daySplits.length:this.minCellWidth&&this.isWeekView&&(t=this.visibleDaysCount*this.minCellWidth),t},allDayBar(){let t=this.allDayBarHeight||null;return t&&!isNaN(t)&&(t+="px"),{cells:this.viewCells,options:this.$props,label:this.texts.allDay,shortEvents:this.hasShortEvents,daySplits:this.hasSplits&&this.daySplits||[],cellOrSplitMinWidth:this.cellOrSplitMinWidth,height:t}},minTimestamp(){let t=null;return this.minDate&&typeof this.minDate=="string"?t=this.utils.date.stringToDate(this.minDate):this.minDate&&this.minDate instanceof Date&&(t=this.minDate),t?t.getTime():null},maxTimestamp(){let t=null;return this.maxDate&&typeof this.maxDate=="string"?t=this.utils.date.stringToDate(this.maxDate):this.maxDate&&this.maxDate instanceof Date&&(t=this.maxDate),t?t.getTime():null},weekDays(){let{weekDays:t,weekDaysShort:e=[]}=this.texts;return t=t.slice(0).map((l,a)=>({label:l,...e.length?{short:e[a]}:{},hide:this.hideWeekends&&a>=5||this.hideWeekdays.length&&this.hideWeekdays.includes(a+1)})),this.startWeekOnSunday&&t.unshift(t.pop()),t},weekDaysInHeader(){return this.isMonthView||this.isWeekView&&!this.minCellWidth&&!(this.hasSplits&&this.minSplitWidth)},months(){return this.texts.months.map(t=>({label:t}))},specialDayHours(){return!this.specialHours||!Object.keys(this.specialHours).length?{}:Array(7).fill("").map((t,e)=>{let l=this.specialHours[e+1]||[];return Array.isArray(l)||(l=[l]),t=[],l.forEach(({from:a,to:o,class:s,label:u},r)=>{t[r]={day:e+1,from:[null,void 0].includes(a)?null:a*1,to:[null,void 0].includes(o)?null:o*1,class:s||"",label:u||""}}),t})},viewTitle(){const t=this.utils.date;let e="";const l=this.view.startDate,a=l.getFullYear(),o=l.getMonth();switch(this.view.id){case"years":{e=this.texts.years;break}case"year":{e=a;break}case"month":{e=`${this.months[o].label} ${a}`;break}case"week":{const s=this.view.endDate,u=l.getFullYear();let r=this.texts.months[l.getMonth()];this.xsmall&&(r=r.substring(0,3));let m=`${r} ${u}`;if(s.getMonth()!==l.getMonth()){const c=s.getFullYear();let v=this.texts.months[s.getMonth()];this.xsmall&&(v=v.substring(0,3)),u===c?m=`${r} - ${v} ${u}`:this.small?m=`${r.substring(0,3)} ${u} - ${v.substring(0,3)} ${c}`:m=`${r} ${u} - ${v} ${c}`}e=`${this.texts.week} ${t.getWeek(this.startWeekOnSunday?t.addDays(l,1):l)} (${m})`;break}case"day":{e=this.utils.date.formatDate(l,this.texts.dateFormat,this.texts);break}}return e},viewCells(){const t=this.utils.date;let e=[],l=null,a=!1;this.watchRealTime||(this.now=new Date);const o=this.now;switch(this.view.id){case"years":{l=this.view.startDate.getFullYear(),e=Array.apply(null,Array(25)).map((s,u)=>{const r=new Date(l+u,0,1),m=new Date(l+u+1,0,1);return m.setSeconds(-1),{startDate:r,formattedDate:t.formatDateLite(r),endDate:m,content:l+u,current:l+u===o.getFullYear()}});break}case"year":{l=this.view.startDate.getFullYear(),e=Array.apply(null,Array(12)).map((s,u)=>{const r=new Date(l,u,1),m=new Date(l,u+1,1);return m.setSeconds(-1),{startDate:r,formattedDate:t.formatDateLite(r),endDate:m,content:this.xsmall?this.months[u].label.substr(0,3):this.months[u].label,current:u===o.getMonth()&&l===o.getFullYear()}});break}case"month":{const s=this.view.startDate.getMonth(),u=new Date(this.view.firstCellDate);a=!1,e=Array.apply(null,Array(42)).map((r,m)=>{const c=t.addDays(u,m),v=new Date(c);v.setHours(23,59,59,0);const y=!a&&t.isToday(c)&&!a++;return{startDate:c,formattedDate:t.formatDateLite(c),endDate:v,content:c.getDate(),today:y,outOfScope:c.getMonth()!==s,class:`vuecal__cell--day${c.getDay()||7}`}}),(this.hideWeekends||this.hideWeekdays.length)&&(e=e.filter(r=>{const m=r.startDate.getDay()||7;return!(this.hideWeekends&&m>=6||this.hideWeekdays.length&&this.hideWeekdays.includes(m))}));break}case"week":{a=!1;const s=this.view.startDate,u=this.weekDays;e=u.map((r,m)=>{const c=t.addDays(s,this.startWeekOnSunday&&this.hideWeekends?m-1:m),v=new Date(c);v.setHours(23,59,59,0);const y=(c.getDay()||7)-1;return{startDate:c,formattedDate:t.formatDateLite(c),endDate:v,today:!a&&t.isToday(c)&&!a++,specialHours:this.specialDayHours[y]||[]}}).filter((r,m)=>!u[m].hide);break}case"day":{const s=this.view.startDate,u=new Date(this.view.startDate);u.setHours(23,59,59,0);const r=(s.getDay()||7)-1;e=[{startDate:s,formattedDate:t.formatDateLite(s),endDate:u,today:t.isToday(s),specialHours:this.specialDayHours[r]||[]}];break}}return e},visibleDaysCount(){return this.isDayView?1:7-this.weekDays.reduce((t,e)=>t+e.hide,0)},cellWidth(){return 100/this.visibleDaysCount},cssClasses(){const{resizeAnEvent:t,dragAnEvent:e,dragCreateAnEvent:l}=this.domEvents;return{[`vuecal--${this.view.id}-view`]:!0,[`vuecal--${this.locale}`]:this.locale,"vuecal--no-time":!this.time,"vuecal--view-with-time":this.hasTimeColumn,"vuecal--week-numbers":this.showWeekNumbers&&this.isMonthView,"vuecal--twelve-hour":this.twelveHour,"vuecal--click-to-navigate":this.clickToNavigate,"vuecal--hide-weekends":this.hideWeekends,"vuecal--split-days":this.hasSplits,"vuecal--sticky-split-labels":this.hasSplits&&this.stickySplitLabels,"vuecal--overflow-x":this.minCellWidth&&this.isWeekView||this.hasSplits&&this.minSplitWidth,"vuecal--small":this.small,"vuecal--xsmall":this.xsmall,"vuecal--resizing-event":t._eid,"vuecal--drag-creating-event":l.event,"vuecal--dragging-event":e._eid,"vuecal--events-on-month-view":this.eventsOnMonthView,"vuecal--short-events":this.isMonthView&&this.eventsOnMonthView==="short","vuecal--has-touch":typeof window<"u"&&"ontouchstart"in window}},isYearsOrYearView(){return["years","year"].includes(this.view.id)},isYearsView(){return this.view.id==="years"},isYearView(){return this.view.id==="year"},isMonthView(){return this.view.id==="month"},isWeekOrDayView(){return["week","day"].includes(this.view.id)},isWeekView(){return this.view.id==="week"},isDayView(){return this.view.id==="day"}},watch:{events:{handler(t,e){this.updateMutableEvents(t),this.addEventsToView()},deep:!0},locale(t){this.loadLocale(t)},selectedDate(t){this.updateSelectedDate(t)},activeView(t){this.switchView(t)}}},Me=K(ii,[["render",ti]]),si={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},visible:{type:Boolean,default:!0},disable:{type:Boolean,default:!1},selectedDate:{type:[String,Date],default:()=>new Date},events:{type:Array,default:()=>[]},weekendColor:{type:String,required:!1},weekendDays:{type:Array,required:!1,validator:t=>Array.isArray(t)&&t.every(e=>Number.isInteger(e)&&e>=0&&e<=6)},showTodayColor:{type:Boolean,default:!0},selectedColor:{type:String,required:!1},specialTime:{type:Object,required:!1},dateCellMinHeight:{type:Number,required:!1},dateCellMaxHeight:{type:Number,required:!1},disableDays:{type:Array,required:!1,default:void 0},eventsOnMonthView:{type:[String,Boolean],default:!1},hideWeekdays:{type:Array,required:!1,validator:t=>Array.isArray(t)&&t.every(e=>Number.isInteger(e)&&e>=0&&e<=6)},hideWeekends:{type:Boolean,default:!1},locale:{type:String,default:"en"},maxDate:{type:[String,Date],required:!1},minDate:{type:[String,Date],required:!1},startWeekOnSunday:{type:Boolean,default:!1},time:{type:Boolean,default:!0},timeCellHeight:{type:Number,required:!1},timeFormat:{type:String,required:!1,validator:t=>t==null||h.H_CALENDAR_TIME_FORMAT_VALUES.includes(t)},timeFrom:{type:Number,required:!1,validator:t=>t==null||Number.isFinite(t)&&t>=0&&t<=1440},timeStep:{type:Number,required:!1,validator:t=>t==null||Number.isFinite(t)&&t>0&&t<=1440},timeTo:{type:Number,required:!1,validator:t=>t==null||Number.isFinite(t)&&t>=0&&t<=1440},hideTitleBar:{type:Boolean,default:!1},twelveHour:{type:Boolean,default:!1},activeView:{type:String,required:!1,validator:t=>t==null||h.H_CALENDAR_VIEW_VALUES.includes(t)},disableViews:{type:Array,required:!1,validator:t=>t==null||Array.isArray(t)&&t.every(e=>h.H_CALENDAR_VIEW_VALUES.includes(e))}},li=i.defineComponent({name:"HCalendar",components:{VueCal:Me},props:si,emits:["responsive-change","cell-click","view-change","mounted"],setup(t,{emit:e,attrs:l}){const a=t.id||h.getUUID(),o=`hcalendar:${a}`,s=i.ref(null),u=i.ref(null),r=h.useDevice(),m=i.useSlots(),c=i.computed(()=>Object.keys(m)),v=i.ref(t.visible),y=i.ref(t.disable),w=i.computed(()=>v.value?"":"hison-display-none"),T=i.computed(()=>y.value?"hison-disable-calendar":""),g=i.ref(h.hison.utils.getJSDateObject(t.selectedDate)??new Date),_=g.value,E=i.ref(t.events??[]),D=i.ref(t.weekendColor?h.normalizeToRgba(t.weekendColor):void 0),V=i.ref(t.weekendDays),C=i.ref(t.selectedColor?h.normalizeToRgba(t.selectedColor):void 0),H=i.ref(t.showTodayColor),F=i.ref(t.specialTime??{}),q=i.ref(t.dateCellMinHeight),j=i.ref(t.dateCellMaxHeight),G=i.ref(t.disableDays),X=i.ref(t.eventsOnMonthView),J=i.ref(t.hideWeekdays),Z=i.ref(t.hideWeekends),Q=i.ref(t.locale),W=i.ref(y.value?"100-01-01":t.maxDate),x=i.ref(t.minDate),R=i.ref(t.startWeekOnSunday),$=i.ref(t.time),ee=i.ref(t.timeCellHeight),te=i.ref(t.timeFormat),ie=i.ref(t.timeFrom),se=i.ref(t.timeStep),le=i.ref(t.timeTo),ae=i.ref(t.hideTitleBar),ne=i.ref(t.twelveHour),ye=i.ref(t.activeView),re=i.ref(t.disableViews),A=i.ref([]),he=i.ref(!0),ve=i.ref(!1),M=i.ref(!1),z=()=>{var n;if(A.value=h.extractResponsiveClasses(h.toClassString(t.class)||"",r.value),h.getIndexSpecificClassNameFromClassList(A.value,"col")===-1&&A.value.push("hison-col-12"),h.addComponentNameToClass(A.value,"size",h.hisonCloser.componentStyle.size),h.addComponentNameToClass(A.value,"color","primary"),(n=s.value)!=null&&n.$el){const d=s.value.$el;let f=h.getSpecificClassValueFromClassList(A.value,"color");const b=h.getSpecificClassValueFromClassList(A.value,"size");switch((!f||!h.getRGBAFromColorText(f))&&(f="primary"),d.style.setProperty("--vuecal-filled-back-color",h.hisonCloser.componentStyle.componentColor[`${f}`].buttonColor),d.style.setProperty("--vuecal-filled-font-color",h.hisonCloser.componentStyle.componentColor[`${f}`].filledTextColor),h.hisonCloser.componentStyle.invertColor?(d.style.setProperty("--vuecal-empty-back-color",h.hisonCloser.componentStyle.emptyInvertColor),d.style.setProperty("--vuecal-empty-font-color",h.hisonCloser.componentStyle.emptyTextInvertColor),d.style.setProperty("--vuecal-empty-disabled-color",h.applyOpacityToRgba(h.hisonCloser.componentStyle.emptyTextInvertColor,.3)),d.style.setProperty("--vuecal-empty-out-of-scope-font-color",h.applyOpacityToRgba(h.hisonCloser.componentStyle.emptyTextInvertColor,.5)),d.style.setProperty("--vuecal-selected-back-color",C.value?h.getInvertColor(C.value):h.applyOpacityToRgba(h.hisonCloser.componentStyle.componentColor[`${f}`].buttonColor,.5)),d.style.setProperty("--vuecal-weekend-back-color",D.value?h.getInvertColor(D.value):null),d.style.setProperty("--vuecal-today-back-color",H.value?h.applyOpacityToRgba(h.hisonCloser.componentStyle.componentColor[`${f}`].buttonColor,.3):h.hisonCloser.componentStyle.emptyInvertColor)):(d.style.setProperty("--vuecal-empty-back-color",h.hisonCloser.componentStyle.emptyColor),d.style.setProperty("--vuecal-empty-font-color",h.hisonCloser.componentStyle.emptyTextColor),d.style.setProperty("--vuecal-empty-disabled-color",h.applyOpacityToRgba(h.hisonCloser.componentStyle.emptyTextColor,.3)),d.style.setProperty("--vuecal-empty-out-of-scope-font-color",h.applyOpacityToRgba(h.hisonCloser.componentStyle.emptyTextColor,.5)),d.style.setProperty("--vuecal-selected-back-color",C.value?C.value:h.applyOpacityToRgba(h.hisonCloser.componentStyle.componentColor[`${f}`].buttonColor,.5)),d.style.setProperty("--vuecal-weekend-back-color",D.value?D.value:null),d.style.setProperty("--vuecal-today-back-color",H.value?h.applyOpacityToRgba(h.hisonCloser.componentStyle.componentColor[`${f}`].buttonColor,.3):h.hisonCloser.componentStyle.emptyColor)),b){case h.Size.xl:d.style.setProperty("--vuecal-header-font-size","0.9em"),d.style.setProperty("--vuecal-title-button-font-size","1em"),d.style.setProperty("--vuecal-body-font-size","0.9em"),d.style.setProperty("--vuecal-no-event-font-size","0.8em");break;case h.Size.l:d.style.setProperty("--vuecal-header-font-size","0.75em"),d.style.setProperty("--vuecal-title-button-font-size","1em"),d.style.setProperty("--vuecal-body-font-size","0.9em"),d.style.setProperty("--vuecal-no-event-font-size","0.8em");break;case h.Size.m:d.style.setProperty("--vuecal-header-font-size","0.7em"),d.style.setProperty("--vuecal-title-button-font-size","0.6em"),d.style.setProperty("--vuecal-body-font-size","0.8em"),d.style.setProperty("--vuecal-no-event-font-size","0.7em");break;case h.Size.s:d.style.setProperty("--vuecal-header-font-size","0.6em"),d.style.setProperty("--vuecal-title-button-font-size","0.5em"),d.style.setProperty("--vuecal-body-font-size","0.8em"),d.style.setProperty("--vuecal-no-event-font-size","0.7em");break;case h.Size.xs:d.style.setProperty("--vuecal-header-font-size","0.5em"),d.style.setProperty("--vuecal-title-button-font-size","0.4em"),d.style.setProperty("--vuecal-body-font-size","0.7em"),d.style.setProperty("--vuecal-no-event-font-size","0.6em");break}d.style.setProperty("--calendar-clickable-cursor",y.value?"not-allowed":null)}},Oe=n=>{const d=/pm/i.test(n),f=/am/i.test(n),b=n.replace(/[^\d:]/g,"").trim();let S=0,N=0;if(b.includes(":")){const[B,I]=b.split(":");S=parseInt(B,10),N=parseInt(I,10)}else{const B=parseInt(b,10);B<=12&&(f||d)||B<=23?S=B:N=B}return d&&S<12&&(S+=12),f&&S===12&&(S=0),S*60+N},L=n=>{if(!s.value||M.value)return;const d=s.value.$el,f=n??h.hison.utils.getJSDateObject(g.value);if(F.value&&f){const b=f.getDay(),S=F.value[b],N=d.querySelectorAll(".vuecal__time-cell");N.length>0&&S&&Array.isArray(S)?N.forEach(B=>{const I=B.querySelector(".vuecal__time-cell-label");if(I){const Ae=I.textContent,Ce=Oe(Ae);let fe="";S.some(({from:Ne,to:Pe,className:Fe})=>{const be=Ne<=Ce&&Ce<=Pe;return be&&(fe=Fe??""),be})&&B.classList.add(fe||"special_time")}}):N.forEach(B=>{B.classList.forEach(I=>{I!=="vuecal__time-cell"&&B.classList.remove(I)})})}},Y=n=>{if(!M.value&&(n===h.HCalendarView.month||n===h.HCalendarView.week)){const d=s.value.$el,f=V.value?V.value:R.value?[0,6]:[5,6],b=d.querySelectorAll(".vuecal__heading");b.length>0&&b.forEach((S,N)=>{f.includes(N)?S.classList.add("weekend"):S.classList.remove("weekend")})}},oe=n=>{if(!s.value||M.value)return;const d=s.value.$el;d.style.setProperty("--vuecal-cell-content-min_heihgt",n==="month"&&q.value?q.value+"px":null),d.style.setProperty("--vuecal-cell-content-max_heihgt",n==="month"&&j.value?j.value+"px":null),d.style.setProperty("--vuecal-cell-content-overflow",n==="month"&&j.value?"auto":null)},De=n=>{if(!s.value||M.value)return;const d=n??s.value.view.id;D.value&&i.nextTick(()=>Y(d)),oe(d)},He=n=>{M.value||(De(n.view),n.view===h.HCalendarView.day?L(n.startDate):n.view===h.HCalendarView.week&&L(),ye.value=n.view,e("view-change",n))},We=n=>{var f;if(M.value)return;const d=n instanceof Date?n:n.date;y.value?(g.value=_,(f=s.value)==null||f.updateSelectedDate(_)):(g.value=d,e("cell-click",d))},pe=()=>{!he.value||ve.value||M.value||(h.hisonCloser.component.calendarList[a]&&h.hisonCloser.component.calendarList[a].isHisonvueComponent&&console.warn(`[Hisonvue] The calendar ID is at risk of being duplicated. ${a}`),h.unregisterReloadable(o),h.registerReloadable(o,()=>{he.value&&(h.unregisterReloadable(o),ke(),i.nextTick(()=>{he.value&&pe()}))}),s.value&&(z(),L(),De(),u.value={isHisonvueComponent:!0,getId:()=>a,getType:()=>"calendar",isDisable:()=>y.value,setDisable:n=>{y.value=n,y.value?W.value="100-01-01":W.value=t.maxDate},isVisible:()=>v.value,setVisible:n=>{v.value=n},getSelectedDate:(n,d)=>n?g.value:h.hison.utils.getDateWithFormat(g.value,d??h.hison.getDatetimeFormat()),setSelectedDate:n=>{const d=h.hison.utils.getJSDateObject(n);d&&(g.value=d)},getEvents:()=>E.value,setEvents:n=>{E.value=n},getSpecialTime:()=>F.value,setSpecialTime:n=>{F.value=n},getWeekendColor:()=>D.value,setWeekendColor:n=>{if(D.value=h.normalizeToRgba(n),!s.value)return;const d=s.value.$el;d&&(h.hisonCloser.componentStyle.invertColor?d.style.setProperty("--vuecal-weekend-back-color",D.value?h.getInvertColor(D.value):null):d.style.setProperty("--vuecal-weekend-back-color",D.value?D.value:null),Y(s.value.view.id))},getWeekendDays:()=>V.value,setWeekendDays:n=>{V.value=n,Y(s.value.view.id)},isShowTodayColor:()=>H.value,setShowTodayColor:n=>{if(H.value=n,!s.value)return;const d=s.value.$el;if(!d)return;let f=h.getSpecificClassValueFromClassList(A.value,"color");(!f||!h.getRGBAFromColorText(f))&&(f="primary"),h.hisonCloser.componentStyle.invertColor?d.style.setProperty("--vuecal-today-back-color",H.value?h.applyOpacityToRgba(h.hisonCloser.componentStyle.componentColor[`${f}`].buttonColor,.3):h.hisonCloser.componentStyle.emptyInvertColor):d.style.setProperty("--vuecal-today-back-color",H.value?h.applyOpacityToRgba(h.hisonCloser.componentStyle.componentColor[`${f}`].buttonColor,.3):h.hisonCloser.componentStyle.emptyColor)},getSelectedColor:()=>C.value,setSelectedColor:n=>{if(C.value=h.normalizeToRgba(n),!s.value)return;const d=s.value.$el;if(!d)return;let f=h.getSpecificClassValueFromClassList(A.value,"color");h.hisonCloser.componentStyle.invertColor?d.style.setProperty("--vuecal-selected-back-color",C.value?h.getInvertColor(C.value):h.applyOpacityToRgba(h.hisonCloser.componentStyle.componentColor[`${f}`].buttonColor,.5)):d.style.setProperty("--vuecal-selected-back-color",C.value?C.value:h.applyOpacityToRgba(h.hisonCloser.componentStyle.componentColor[`${f}`].buttonColor,.5))},getDateCellMinHeight:()=>q.value,setDateCellMinHeight:n=>{q.value=n,oe(s.value.view.id)},getDateCellMaxHeight:()=>j.value,setDateCellMaxHeight:n=>{j.value=n,oe(s.value.view.id)},getDisableDays:()=>G.value,setDisableDays:n=>{G.value=n},getEventsOnMonthView:()=>X.value,setEventsOnMonthView:n=>{X.value=n},getHideWeekdays:()=>J.value,setHideWeekdays:n=>{J.value=n},getHideWeekends:()=>Z.value,setHideWeekends:n=>{Z.value=n},getLocale:()=>Q.value,setLocale:n=>{Q.value=n},getMaxDate:n=>{if(W.value)return n?y.value?new Date(100,0,1):h.hison.utils.getJSDateObject(W.value):y.value?"100-01-01":h.hison.utils.getDateWithFormat(W.value,h.hison.getDateFormat())},setMaxDate:n=>{W.value=n},getMinDate:n=>{if(x.value)return n?h.hison.utils.getJSDateObject(x.value):h.hison.utils.getDateWithFormat(x.value,h.hison.getDateFormat())},setMinDate:n=>{x.value=n},isStartWeekOnSunday:()=>R.value,setStartWeekOnSunday:n=>{R.value=n,Y(s.value.view.id)},isShowTimeCell:()=>$.value,setShowTimeCell:n=>{$.value=n},getTimeCellHeight:()=>ee.value,setTimeCellHeight:n=>{ee.value=n},getTimeFormat:()=>te.value,setTimeFormat:n=>{te.value=n},getTimeFrom:()=>ie.value,setTimeFrom:n=>{ie.value=n},getTimeStep:()=>se.value,setTimeStep:n=>{se.value=n},getTimeTo:()=>le.value,setTimeTo:n=>{le.value=n},isHideTitleBar:()=>ae.value,setHideTitleBar:n=>{ae.value=n},isTwelveHour:()=>ne.value,setTwelveHour:n=>{ne.value=n},getActiveView:()=>s.value.view.id,setActiveView:n=>{s.value.switchView(n)},getDisableViews:()=>re.value,setDisableViews:n=>{if(re.value=n,n.includes(s.value.view.id)){const d=["years","year","month","week","day"].filter(f=>!n.includes(f));s.value.switchView(d[0])}},reload:()=>h.reloadHisonComponent(o)},h.hisonCloser.component.calendarList[a]=u.value,M.value=!1,e("mounted",u.value)))},ke=()=>{if(ve.value||M.value){h.unregisterReloadable(o),delete h.hisonCloser.component.calendarList[a];return}ve.value=!0,h.unregisterReloadable(o),delete h.hisonCloser.component.calendarList[a],M.value=!0};return i.onMounted(pe),i.onBeforeUnmount(()=>{he.value=!1,ke()}),i.watch(r,n=>{ve.value||M.value||(z(),e("responsive-change",n))}),i.watch(()=>g.value,()=>{M.value||L()}),i.watch(()=>t.selectedDate,n=>{M.value||(g.value=h.hison.utils.getJSDateObject(n)??new Date,L())}),i.watch(()=>t.events,n=>{M.value||(E.value=n)}),i.watch(()=>t.visible,n=>{n!==v.value&&(v.value=!!n)}),i.watch(()=>t.disable,n=>{const d=!!n;d!==y.value&&(y.value=d,W.value=d?"100-01-01":t.maxDate,z())}),i.watch(()=>g.value,()=>L()),i.watch(()=>t.selectedDate,n=>{const d=h.hison.utils.getJSDateObject(n)??new Date;+d!=+g.value&&(g.value=d,L())}),i.watch(()=>t.events,n=>{n!==E.value&&(E.value=n??[])}),i.watch(()=>t.weekendColor,n=>{var f,b;const d=n?h.normalizeToRgba(n):void 0;d!==D.value&&(D.value=d,z(),(b=(f=s.value)==null?void 0:f.view)!=null&&b.id&&Y(s.value.view.id))}),i.watch(()=>t.weekendDays,n=>{var d,f;n&&n!==V.value&&(V.value=n,(f=(d=s.value)==null?void 0:d.view)!=null&&f.id&&Y(s.value.view.id))}),i.watch(()=>t.selectedColor,n=>{const d=n?h.normalizeToRgba(n):void 0;d!==C.value&&(C.value=d,z())}),i.watch(()=>t.showTodayColor,n=>{const d=!!n;d!==H.value&&(H.value=d,z())}),i.watch(()=>t.specialTime,n=>{n!==F.value&&(F.value=n??{},L())}),i.watch(()=>t.dateCellMinHeight,n=>{var d,f;n!==q.value&&(q.value=n,oe(((f=(d=s.value)==null?void 0:d.view)==null?void 0:f.id)||h.HCalendarView.month))}),i.watch(()=>t.dateCellMaxHeight,n=>{var d,f;n!==j.value&&(j.value=n,oe(((f=(d=s.value)==null?void 0:d.view)==null?void 0:f.id)||h.HCalendarView.month))}),i.watch(()=>t.disableDays,n=>{n!==G.value&&(G.value=n)}),i.watch(()=>t.eventsOnMonthView,n=>{n!==X.value&&(X.value=n)}),i.watch(()=>t.hideWeekdays,n=>{n!==J.value&&(J.value=n)}),i.watch(()=>t.hideWeekends,n=>{const d=!!n;d!==Z.value&&(Z.value=d)}),i.watch(()=>t.locale,n=>{n&&n!==Q.value&&(Q.value=n)}),i.watch(()=>t.maxDate,n=>{!y.value&&n!==W.value&&(W.value=n)}),i.watch(()=>t.minDate,n=>{n!==x.value&&(x.value=n)}),i.watch(()=>t.startWeekOnSunday,n=>{var f,b;const d=!!n;d!==R.value&&(R.value=d,(b=(f=s.value)==null?void 0:f.view)!=null&&b.id&&Y(s.value.view.id))}),i.watch(()=>t.time,n=>{const d=!!n;d!==$.value&&($.value=d)}),i.watch(()=>t.timeCellHeight,n=>{n!==ee.value&&(ee.value=n)}),i.watch(()=>t.timeFormat,n=>{n&&n!==te.value&&(te.value=n)}),i.watch(()=>t.timeFrom,n=>{const d=Number(n);(n==null||Number.isFinite(d)&&d>=0&&d<=1440)&&n!==ie.value&&(ie.value=n)}),i.watch(()=>t.timeStep,n=>{const d=Number(n);(n==null||Number.isFinite(d)&&d>0&&d<=1440)&&n!==se.value&&(se.value=n)}),i.watch(()=>t.timeTo,n=>{const d=Number(n);(n==null||Number.isFinite(d)&&d>=0&&d<=1440)&&n!==le.value&&(le.value=n)}),i.watch(()=>t.hideTitleBar,n=>{const d=!!n;d!==ae.value&&(ae.value=d)}),i.watch(()=>t.twelveHour,n=>{const d=!!n;d!==ne.value&&(ne.value=d)}),i.watch(()=>t.activeView,n=>{var d,f,b;n&&n!==((f=(d=s.value)==null?void 0:d.view)==null?void 0:f.id)&&(ye.value=n,(b=s.value)==null||b.switchView(n))}),i.watch(()=>t.disableViews,n=>{if(n!==re.value&&(re.value=n,s.value&&Array.isArray(n)&&n.includes(s.value.view.id))){const d=["years","year","month","week","day"].find(f=>!n.includes(f));d&&s.value.switchView(d)}}),i.watch(()=>t.class,()=>z()),{VueCal:Me,attrs:l,props:t,calendarRef:s,visibleClass:w,disableClass:T,responsiveClassList:A,slotNames:c,selectedDate:g,events:E,disableDays:G,eventsOnMonthView:X,hideWeekdays:J,hideWeekends:Z,locale:Q,maxDate:W,minDate:x,startWeekOnSunday:R,time:$,timeCellHeight:ee,timeFormat:te,timeFrom:ie,timeStep:se,timeTo:le,hideTitleBar:ae,twelveHour:ne,activeView:ye,disableViews:re,onViewChange:He,onCellClick:We}}});function ai(t,e,l,a,o,s){return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["hison-calendar","hison-wrapper",...t.responsiveClassList,t.visibleClass,t.disableClass]),style:i.normalizeStyle(t.props.style)},[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.VueCal),i.mergeProps({ref:"calendarRef"},t.attrs,{"selected-date":t.selectedDate,events:t.events,"dblclick-to-create":!1,"editable-events":!1,"disable-days":t.disableDays,"events-on-month-view":t.eventsOnMonthView,"hide-weekdays":t.hideWeekdays,"hide-weekends":t.hideWeekends,locale:t.locale,"max-date":t.maxDate,"min-date":t.minDate,"start-week-on-sunday":t.startWeekOnSunday,time:t.time,"time-cell-height":t.timeCellHeight,"time-format":t.timeFormat,"time-from":t.timeFrom,"time-step":t.timeStep,"time-to":t.timeTo,"hide-title-bar":t.hideTitleBar,"twelve-hour":t.twelveHour,"active-view":t.activeView,"disable-views":t.disableViews,onViewChange:t.onViewChange,onCellClick:t.onCellClick}),i.createSlots({_:2},[i.renderList(t.slotNames,u=>({name:u,fn:i.withCtx(r=>[i.renderSlot(t.$slots,u,i.normalizeProps(i.guardReactiveProps(r)),void 0,!0)])}))]),1040,["selected-date","events","disable-days","events-on-month-view","hide-weekdays","hide-weekends","locale","max-date","min-date","start-week-on-sunday","time","time-cell-height","time-format","time-from","time-step","time-to","hide-title-bar","twelve-hour","active-view","disable-views","onViewChange","onCellClick"]))],6)}const ni=Le._export_sfc(li,[["render",ai],["__scopeId","data-v-d2b7c900"]]);exports.default=ni;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-5k-aAQlJ.js"),V=require("./_plugin-vue_export-helper-BHFhmbuH.js"),z={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},visible:{type:Boolean,default:!0},title:{type:String,required:!1},text:{type:String,required:!1},level:{type:Number,default:3,validator:t=>Number.isFinite(t)&&t>=1&&t<=6},fontBold:{type:Boolean,default:!0},fontItalic:{type:Boolean,default:!1},fontThruline:{type:Boolean,default:!1},fontUnderline:{type:Boolean,default:!1},textAlign:{type:String,default:null,validator:t=>t==null||o.TEXT_ALIGN_VALUES.includes(t)},border:{type:Boolean,default:!1},backgroundType:{type:String,default:o.BackgroundType.empty,validator:t=>o.BACKGROUND_TYPE_VALUES.includes(t)}},O=e.defineComponent({name:"HCaption",props:z,inheritAttrs:!1,emits:["mounted","responsive-change","click","mousedown","mouseup","mouseover","mouseout"],setup(t,{emit:a}){const A=e.ref(null),u=e.ref(null),i=t.id?t.id:o.getUUID(),C=`hcaption:${i}`,s=o.useDevice(),k=e.useSlots(),c=e.ref(t.visible),d=e.ref(t.title||""),f=e.ref(t.textAlign??o.TextAlign.left),L=e.computed(()=>({textAlign:f.value})),v=e.ref(t.level??3),$=e.computed(()=>`h${Math.min(6,Math.max(1,Number(v.value||3)))}`),m=e.ref(t.fontBold),p=e.ref(t.fontItalic),g=e.ref(t.fontThruline),h=e.ref(t.fontUnderline),y=e.ref(t.border??!1),T=e.ref(t.backgroundType??o.BackgroundType.empty),N=e.computed(()=>c.value?"":"hison-display-none"),x=e.computed(()=>y.value?"hison-border":""),F=e.computed(()=>{switch(T.value){case o.BackgroundType.empty:return"hison-bg-empty";case o.BackgroundType.transparent:return"hison-bg-transparent";default:return"hison-bg-filled"}}),q=e.computed(()=>m.value?"hison-font-bold-important":null),E=e.computed(()=>p.value?"hison-font-italic":null),H=e.computed(()=>g.value?"hison-font-thruline":null),R=e.computed(()=>h.value?"hison-font-underline":null),S=e.computed(()=>k.default?k.default():[]),M=e.computed(()=>S.value.length>0&&S.value.every(n=>n.type===e.Text)),b=e.computed(()=>!!k.default&&!M.value),r=e.ref(t.text||"");e.onMounted(()=>{if(M.value){const n=S.value.map(l=>String(l.children??"")).join("");r.value=n}});const B=e.ref([]),w=()=>{B.value=o.extractResponsiveClasses(o.toClassString(t.class)||"",s.value),o.addComponentNameToClass(B.value,"size",o.hisonCloser.componentStyle.size),o.addComponentNameToClass(B.value,"color","primary")},D=n=>{a("click",n,u.value)},U=()=>{o.hisonCloser.component.captionList[i]&&o.hisonCloser.component.captionList[i].isHisonvueComponent&&console.warn(`[Hisonvue] The caption ID is at risk of being duplicated. ${i}`),o.registerReloadable(C,()=>{I(),e.nextTick(U)}),w(),u.value={isHisonvueComponent:!0,getId:()=>i,getType:()=>"caption",isVisible:()=>c.value,setVisible:n=>{c.value=n},getTitle:()=>d.value,setTitle:n=>{d.value=n},getText:()=>b.value?"":r.value,setText:n=>{b.value||(r.value=n)},getLevel:()=>v.value,setLevel:n=>{const l=Math.min(6,Math.max(1,Number(n)));v.value=l},getTextAlign:()=>f.value,setTextAlign:n=>{(n===o.TextAlign.left||n===o.TextAlign.center||n===o.TextAlign.right)&&(f.value=n)},isFontBold:()=>m.value,setFontBold:n=>{m.value=n},isFontItalic:()=>p.value,setFontItalic:n=>{p.value=n},isFontThruline:()=>g.value,setFontThruline:n=>{g.value=n},isFontUnderline:()=>h.value,setFontUnderline:n=>{h.value=n},isBorder:()=>y.value,setBorder:n=>{y.value=n},getBackgroundType:()=>T.value,setBackgroundType:n=>{T.value=n},reload:()=>o.reloadHisonComponent(C)},o.hisonCloser.component.captionList[i]=u.value,a("mounted",u.value)},I=()=>{o.unregisterReloadable(C),delete o.hisonCloser.component.captionList[i]};return e.onMounted(U),e.onBeforeUnmount(I),e.watch(s,()=>{w(),a("responsive-change",s.value)}),e.watch(()=>t.visible,n=>{n!==c.value&&(c.value=!!n)}),e.watch(()=>t.title,n=>{const l=n??"";l!==d.value&&(d.value=l)}),e.watch(()=>t.text,n=>{if(!b.value){const l=n??"";l!==r.value&&(r.value=l)}}),e.watch(()=>t.level,n=>{const l=Math.min(6,Math.max(1,Number(n??3)));l!==v.value&&(v.value=l)}),e.watch(()=>t.textAlign,n=>{(n==="left"||n==="center"||n==="right")&&n!==f.value&&(f.value=n)}),e.watch(()=>t.fontBold,n=>{const l=!!n;l!==m.value&&(m.value=l)}),e.watch(()=>t.fontItalic,n=>{const l=!!n;l!==p.value&&(p.value=l)}),e.watch(()=>t.fontThruline,n=>{const l=!!n;l!==g.value&&(g.value=l)}),e.watch(()=>t.fontUnderline,n=>{const l=!!n;l!==h.value&&(h.value=l)}),e.watch(()=>t.border,n=>{const l=!!n;l!==y.value&&(y.value=l)}),e.watch(()=>t.backgroundType,n=>{n&&n!==T.value&&(T.value=n)}),e.watch(()=>t.class,()=>w()),{captionRef:A,captionMethods:e.computed(()=>e.unref(u)),props:t,visibleClass:N,fontBoldClass:q,fontItalicClass:E,fontThrulineClass:H,fontUnderlineClass:R,borderClass:x,backgroundTypeClass:F,textAlignStyle:L,renderTag:$,hasElementSlot:b,internalText:r,responsiveClassList:B,onClick:D,title:d}}});function j(t,a,A,u,i,C){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["hison-wrapper",...t.responsiveClassList,t.visibleClass])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.renderTag),{ref:"captionRef",class:e.normalizeClass(["hison-caption",t.fontBoldClass,t.fontItalicClass,t.fontThrulineClass,t.fontUnderlineClass,t.borderClass,t.backgroundTypeClass]),style:e.normalizeStyle([t.textAlignStyle,t.props.style]),title:t.title||void 0,onClick:t.onClick,onMousedown:a[0]||(a[0]=s=>t.$emit("mousedown",s,t.captionMethods)),onMouseup:a[1]||(a[1]=s=>t.$emit("mouseup",s,t.captionMethods)),onMouseover:a[2]||(a[2]=s=>t.$emit("mouseover",s,t.captionMethods)),onMouseout:a[3]||(a[3]=s=>t.$emit("mouseout",s,t.captionMethods))},{default:e.withCtx(()=>[t.hasElementSlot?e.renderSlot(t.$slots,"default",{key:0}):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.internalText),1)],64))]),_:3},40,["class","style","title","onClick"]))],2)}const P=V._export_sfc(O,[["render",j]]);exports.default=P;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-DcB16odB.js"),V=require("./_plugin-vue_export-helper-BHFhmbuH.js"),z={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},visible:{type:Boolean,default:!0},title:{type:String,required:!1},text:{type:String,required:!1},level:{type:Number,default:3,validator:t=>Number.isFinite(t)&&t>=1&&t<=6},fontBold:{type:Boolean,default:!0},fontItalic:{type:Boolean,default:!1},fontThruline:{type:Boolean,default:!1},fontUnderline:{type:Boolean,default:!1},textAlign:{type:String,default:null,validator:t=>t==null||o.TEXT_ALIGN_VALUES.includes(t)},border:{type:Boolean,default:!1},backgroundType:{type:String,default:o.BackgroundType.empty,validator:t=>o.BACKGROUND_TYPE_VALUES.includes(t)}},O=e.defineComponent({name:"HCaption",props:z,inheritAttrs:!1,emits:["mounted","responsive-change","click","mousedown","mouseup","mouseover","mouseout"],setup(t,{emit:a}){const A=e.ref(null),u=e.ref(null),i=t.id?t.id:o.getUUID(),C=`hcaption:${i}`,s=o.useDevice(),k=e.useSlots(),c=e.ref(t.visible),d=e.ref(t.title||""),f=e.ref(t.textAlign??o.TextAlign.left),L=e.computed(()=>({textAlign:f.value})),v=e.ref(t.level??3),$=e.computed(()=>`h${Math.min(6,Math.max(1,Number(v.value||3)))}`),m=e.ref(t.fontBold),p=e.ref(t.fontItalic),g=e.ref(t.fontThruline),h=e.ref(t.fontUnderline),y=e.ref(t.border??!1),T=e.ref(t.backgroundType??o.BackgroundType.empty),N=e.computed(()=>c.value?"":"hison-display-none"),x=e.computed(()=>y.value?"hison-border":""),F=e.computed(()=>{switch(T.value){case o.BackgroundType.empty:return"hison-bg-empty";case o.BackgroundType.transparent:return"hison-bg-transparent";default:return"hison-bg-filled"}}),q=e.computed(()=>m.value?"hison-font-bold-important":null),E=e.computed(()=>p.value?"hison-font-italic":null),H=e.computed(()=>g.value?"hison-font-thruline":null),R=e.computed(()=>h.value?"hison-font-underline":null),S=e.computed(()=>k.default?k.default():[]),M=e.computed(()=>S.value.length>0&&S.value.every(n=>n.type===e.Text)),b=e.computed(()=>!!k.default&&!M.value),r=e.ref(t.text||"");e.onMounted(()=>{if(M.value){const n=S.value.map(l=>String(l.children??"")).join("");r.value=n}});const B=e.ref([]),w=()=>{B.value=o.extractResponsiveClasses(o.toClassString(t.class)||"",s.value),o.addComponentNameToClass(B.value,"size",o.hisonCloser.componentStyle.size),o.addComponentNameToClass(B.value,"color","primary")},D=n=>{a("click",n,u.value)},U=()=>{o.hisonCloser.component.captionList[i]&&o.hisonCloser.component.captionList[i].isHisonvueComponent&&console.warn(`[Hisonvue] The caption ID is at risk of being duplicated. ${i}`),o.registerReloadable(C,()=>{I(),e.nextTick(U)}),w(),u.value={isHisonvueComponent:!0,getId:()=>i,getType:()=>"caption",isVisible:()=>c.value,setVisible:n=>{c.value=n},getTitle:()=>d.value,setTitle:n=>{d.value=n},getText:()=>b.value?"":r.value,setText:n=>{b.value||(r.value=n)},getLevel:()=>v.value,setLevel:n=>{const l=Math.min(6,Math.max(1,Number(n)));v.value=l},getTextAlign:()=>f.value,setTextAlign:n=>{(n===o.TextAlign.left||n===o.TextAlign.center||n===o.TextAlign.right)&&(f.value=n)},isFontBold:()=>m.value,setFontBold:n=>{m.value=n},isFontItalic:()=>p.value,setFontItalic:n=>{p.value=n},isFontThruline:()=>g.value,setFontThruline:n=>{g.value=n},isFontUnderline:()=>h.value,setFontUnderline:n=>{h.value=n},isBorder:()=>y.value,setBorder:n=>{y.value=n},getBackgroundType:()=>T.value,setBackgroundType:n=>{T.value=n},reload:()=>o.reloadHisonComponent(C)},o.hisonCloser.component.captionList[i]=u.value,a("mounted",u.value)},I=()=>{o.unregisterReloadable(C),delete o.hisonCloser.component.captionList[i]};return e.onMounted(U),e.onBeforeUnmount(I),e.watch(s,()=>{w(),a("responsive-change",s.value)}),e.watch(()=>t.visible,n=>{n!==c.value&&(c.value=!!n)}),e.watch(()=>t.title,n=>{const l=n??"";l!==d.value&&(d.value=l)}),e.watch(()=>t.text,n=>{if(!b.value){const l=n??"";l!==r.value&&(r.value=l)}}),e.watch(()=>t.level,n=>{const l=Math.min(6,Math.max(1,Number(n??3)));l!==v.value&&(v.value=l)}),e.watch(()=>t.textAlign,n=>{(n==="left"||n==="center"||n==="right")&&n!==f.value&&(f.value=n)}),e.watch(()=>t.fontBold,n=>{const l=!!n;l!==m.value&&(m.value=l)}),e.watch(()=>t.fontItalic,n=>{const l=!!n;l!==p.value&&(p.value=l)}),e.watch(()=>t.fontThruline,n=>{const l=!!n;l!==g.value&&(g.value=l)}),e.watch(()=>t.fontUnderline,n=>{const l=!!n;l!==h.value&&(h.value=l)}),e.watch(()=>t.border,n=>{const l=!!n;l!==y.value&&(y.value=l)}),e.watch(()=>t.backgroundType,n=>{n&&n!==T.value&&(T.value=n)}),e.watch(()=>t.class,()=>w()),{captionRef:A,captionMethods:e.computed(()=>e.unref(u)),props:t,visibleClass:N,fontBoldClass:q,fontItalicClass:E,fontThrulineClass:H,fontUnderlineClass:R,borderClass:x,backgroundTypeClass:F,textAlignStyle:L,renderTag:$,hasElementSlot:b,internalText:r,responsiveClassList:B,onClick:D,title:d}}});function j(t,a,A,u,i,C){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["hison-wrapper",...t.responsiveClassList,t.visibleClass])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.renderTag),{ref:"captionRef",class:e.normalizeClass(["hison-caption",t.fontBoldClass,t.fontItalicClass,t.fontThrulineClass,t.fontUnderlineClass,t.borderClass,t.backgroundTypeClass]),style:e.normalizeStyle([t.textAlignStyle,t.props.style]),title:t.title||void 0,onClick:t.onClick,onMousedown:a[0]||(a[0]=s=>t.$emit("mousedown",s,t.captionMethods)),onMouseup:a[1]||(a[1]=s=>t.$emit("mouseup",s,t.captionMethods)),onMouseover:a[2]||(a[2]=s=>t.$emit("mouseover",s,t.captionMethods)),onMouseout:a[3]||(a[3]=s=>t.$emit("mouseout",s,t.captionMethods))},{default:e.withCtx(()=>[t.hasElementSlot?e.renderSlot(t.$slots,"default",{key:0}):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.internalText),1)],64))]),_:3},40,["class","style","title","onClick"]))],2)}const P=V._export_sfc(O,[["render",j]]);exports.default=P;
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as J, ref as l, useSlots as Q, computed as o, Text as W, onMounted as R, onBeforeUnmount as Z, watch as a, unref as _, nextTick as ee, createElementBlock as x, openBlock as $, normalizeClass as D, createBlock as te, resolveDynamicComponent as ne, normalizeStyle as le, withCtx as oe, renderSlot as ae, Fragment as se, createTextVNode as ie, toDisplayString as ue } from "vue";
2
- import { B as re, f as M, T as de, g as ce, u as ve, w as A, e as fe, t as me, b as H, h as C, r as ge, c as ye, d as he } from "./index-Cvhi7T4w.mjs";
2
+ import { B as re, f as M, T as de, g as ce, u as ve, w as A, e as fe, t as me, b as H, h as C, r as ge, c as ye, d as he } from "./index-CGr5-mvg.mjs";
3
3
  import { _ as pe } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
4
4
  const Te = {
5
5
  /**
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),r=require("./index-5k-aAQlJ.js"),B=require("./_plugin-vue_export-helper-BHFhmbuH.js"),F={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},type:{type:String,required:!0},modelValue:{type:Object,required:!0},options:{type:Object,required:!1},visible:{type:Boolean,default:!0},loadDelay:{type:Number,default:500}},H=t.defineComponent({name:"HChart",props:F,emits:["update:modelValue","mounted","responsive-change"],setup(n,{emit:w,attrs:q}){const c=n.id||r.getUUID(),u=`hchart:${c}`,h=t.ref(null),s=t.ref(null),p=t.ref(n.visible),L=t.computed(()=>p.value?"":"hison-display-none"),R=r.useDevice(),d=t.ref([]),v=t.ref(!1),y=t.ref(n.loadDelay??500);let l=null,f=!0,o=!1;const i=t.ref(!1),A=()=>{d.value=r.extractResponsiveClasses(r.toClassString(n.class)||"",R.value),r.getIndexSpecificClassNameFromClassList(d.value,"col")===-1&&d.value.push("hison-col-12"),r.addComponentNameToClass(d.value,"size",r.hisonCloser.componentStyle.size),r.addComponentNameToClass(d.value,"color","primary")},m=e=>{if(Array.isArray(e))return e.map(a=>typeof a=="string"?r.getRGBAFromColorText(a)||a:typeof a=="object"&&a!==null?m(a):a);if(typeof e=="object"&&e!==null){const a={};for(const[g,b]of Object.entries(e))if(typeof b=="string"&&/color/i.test(g)){const D=r.getRGBAFromColorText(b);a[g]=D||b}else a[g]=m(b);return a}return e};function j(e){return!e||typeof e!="object"||!Array.isArray(e.datasets)?{datasets:[]}:{...e,datasets:e.datasets.filter(a=>!!a)}}function S(e){return!e||typeof e!="object"?{}:e}function k(){if(!f||o||i.value)return;if(!h.value){console.warn("[mountChart] canvasRef.value is null");return}A(),s.value=t.markRaw(new r.Chart(h.value,{type:n.type,data:j(m(t.toRaw(n.modelValue))),options:S(m(t.toRaw(n.options)))}));const e=s.value;e.isHisonvueComponent=!0,e.getId=()=>c,e.getType=()=>"chart",e.isVisible=()=>p.value,e.setVisible=a=>{p.value=a},e.getLoadDelay=()=>y.value,e.setLoadDelay=a=>{y.value=a},e.reload=()=>r.reloadHisonComponent(u),r.hisonCloser.component.chartList[c]&&r.hisonCloser.component.chartList[c].isHisonvueComponent&&console.warn(`[Hisonvue] The chart ID is at risk of being duplicated. ${c}`),r.hisonCloser.component.chartList[c]=e,i.value=!1,w("mounted",r.hisonCloser.component.chartList[c])}const C=async()=>{var a;if(o||i.value){o=!0,l!==null&&(clearTimeout(l),l=null);return}o=!0,l!==null&&(clearTimeout(l),l=null);const e=s.value;if(e)try{try{(a=e.stop)==null||a.call(e)}catch{}e.destroy()}catch{}finally{s.value=null}delete r.hisonCloser.component.chartList[c],v.value=!0,i.value=!0,await t.nextTick()},T=async()=>{!f||o||v.value&&(v.value=!1,await t.nextTick(),l=window.setTimeout(()=>{!f||o||i.value||requestAnimationFrame(()=>{requestAnimationFrame(()=>{k()})})},y.value))};return r.registerReloadable(u,async()=>{f&&(r.unregisterReloadable(u),await C(),await T(),r.registerReloadable(u,async()=>{f&&(r.unregisterReloadable(u),await C(),await T(),r.registerReloadable(u,async()=>{f&&(r.unregisterReloadable(u),await C(),await T())}))}))}),t.onMounted(async()=>{v.value=!1,i.value=!1,await t.nextTick(),l=window.setTimeout(()=>{!f||o||i.value||requestAnimationFrame(()=>{requestAnimationFrame(()=>{k()})})},y.value)}),t.onBeforeUnmount(async()=>{f=!1,l!==null&&(clearTimeout(l),l=null),await C(),r.unregisterReloadable(u)}),t.watch(R,()=>{var e;o||i.value||(A(),s.value&&(((e=h.value)==null?void 0:e.isConnected)??!0)&&s.value.resize(),w("responsive-change",R.value))}),t.watch(()=>n.modelValue,e=>{v.value||o||i.value||!s.value||!e||typeof e!="object"||!Array.isArray(e.datasets)||(s.value.data=j(m(t.toRaw(e))),s.value.update("none"))},{deep:!0}),t.watch(()=>n.options,e=>{v.value||o||i.value||!s.value||!e||typeof e!="object"||(s.value.options=S(m(t.toRaw(e))),s.value.update("none"))},{deep:!0}),t.watch(()=>n.visible,e=>{e!==p.value&&(p.value=!!e)}),t.watch(()=>n.loadDelay,e=>{const a=Number(e);Number.isFinite(a)&&a>=0&&a!==y.value&&(y.value=a)}),t.watch(()=>n.class,()=>A()),t.watch(()=>n.type,()=>{!o&&!i.value&&r.reloadHisonComponent(u)}),{canvasRef:h,props:n,attrs:q,visibleClass:L,responsiveClassList:d,isPending:v}}});function I(n,w,q,c,u,h){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["hison-chart","hison-wrapper",...n.responsiveClassList,n.visibleClass]),style:t.normalizeStyle(n.props.style)},[n.isPending?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("canvas",t.mergeProps({key:0,ref:"canvasRef"},n.attrs),null,16))],6)}const N=B._export_sfc(H,[["render",I]]);exports.default=N;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),r=require("./index-DcB16odB.js"),B=require("./_plugin-vue_export-helper-BHFhmbuH.js"),F={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},type:{type:String,required:!0},modelValue:{type:Object,required:!0},options:{type:Object,required:!1},visible:{type:Boolean,default:!0},loadDelay:{type:Number,default:500}},H=t.defineComponent({name:"HChart",props:F,emits:["update:modelValue","mounted","responsive-change"],setup(n,{emit:w,attrs:q}){const c=n.id||r.getUUID(),u=`hchart:${c}`,h=t.ref(null),s=t.ref(null),p=t.ref(n.visible),L=t.computed(()=>p.value?"":"hison-display-none"),R=r.useDevice(),d=t.ref([]),v=t.ref(!1),y=t.ref(n.loadDelay??500);let l=null,f=!0,o=!1;const i=t.ref(!1),A=()=>{d.value=r.extractResponsiveClasses(r.toClassString(n.class)||"",R.value),r.getIndexSpecificClassNameFromClassList(d.value,"col")===-1&&d.value.push("hison-col-12"),r.addComponentNameToClass(d.value,"size",r.hisonCloser.componentStyle.size),r.addComponentNameToClass(d.value,"color","primary")},m=e=>{if(Array.isArray(e))return e.map(a=>typeof a=="string"?r.getRGBAFromColorText(a)||a:typeof a=="object"&&a!==null?m(a):a);if(typeof e=="object"&&e!==null){const a={};for(const[g,b]of Object.entries(e))if(typeof b=="string"&&/color/i.test(g)){const D=r.getRGBAFromColorText(b);a[g]=D||b}else a[g]=m(b);return a}return e};function j(e){return!e||typeof e!="object"||!Array.isArray(e.datasets)?{datasets:[]}:{...e,datasets:e.datasets.filter(a=>!!a)}}function S(e){return!e||typeof e!="object"?{}:e}function k(){if(!f||o||i.value)return;if(!h.value){console.warn("[mountChart] canvasRef.value is null");return}A(),s.value=t.markRaw(new r.Chart(h.value,{type:n.type,data:j(m(t.toRaw(n.modelValue))),options:S(m(t.toRaw(n.options)))}));const e=s.value;e.isHisonvueComponent=!0,e.getId=()=>c,e.getType=()=>"chart",e.isVisible=()=>p.value,e.setVisible=a=>{p.value=a},e.getLoadDelay=()=>y.value,e.setLoadDelay=a=>{y.value=a},e.reload=()=>r.reloadHisonComponent(u),r.hisonCloser.component.chartList[c]&&r.hisonCloser.component.chartList[c].isHisonvueComponent&&console.warn(`[Hisonvue] The chart ID is at risk of being duplicated. ${c}`),r.hisonCloser.component.chartList[c]=e,i.value=!1,w("mounted",r.hisonCloser.component.chartList[c])}const C=async()=>{var a;if(o||i.value){o=!0,l!==null&&(clearTimeout(l),l=null);return}o=!0,l!==null&&(clearTimeout(l),l=null);const e=s.value;if(e)try{try{(a=e.stop)==null||a.call(e)}catch{}e.destroy()}catch{}finally{s.value=null}delete r.hisonCloser.component.chartList[c],v.value=!0,i.value=!0,await t.nextTick()},T=async()=>{!f||o||v.value&&(v.value=!1,await t.nextTick(),l=window.setTimeout(()=>{!f||o||i.value||requestAnimationFrame(()=>{requestAnimationFrame(()=>{k()})})},y.value))};return r.registerReloadable(u,async()=>{f&&(r.unregisterReloadable(u),await C(),await T(),r.registerReloadable(u,async()=>{f&&(r.unregisterReloadable(u),await C(),await T(),r.registerReloadable(u,async()=>{f&&(r.unregisterReloadable(u),await C(),await T())}))}))}),t.onMounted(async()=>{v.value=!1,i.value=!1,await t.nextTick(),l=window.setTimeout(()=>{!f||o||i.value||requestAnimationFrame(()=>{requestAnimationFrame(()=>{k()})})},y.value)}),t.onBeforeUnmount(async()=>{f=!1,l!==null&&(clearTimeout(l),l=null),await C(),r.unregisterReloadable(u)}),t.watch(R,()=>{var e;o||i.value||(A(),s.value&&(((e=h.value)==null?void 0:e.isConnected)??!0)&&s.value.resize(),w("responsive-change",R.value))}),t.watch(()=>n.modelValue,e=>{v.value||o||i.value||!s.value||!e||typeof e!="object"||!Array.isArray(e.datasets)||(s.value.data=j(m(t.toRaw(e))),s.value.update("none"))},{deep:!0}),t.watch(()=>n.options,e=>{v.value||o||i.value||!s.value||!e||typeof e!="object"||(s.value.options=S(m(t.toRaw(e))),s.value.update("none"))},{deep:!0}),t.watch(()=>n.visible,e=>{e!==p.value&&(p.value=!!e)}),t.watch(()=>n.loadDelay,e=>{const a=Number(e);Number.isFinite(a)&&a>=0&&a!==y.value&&(y.value=a)}),t.watch(()=>n.class,()=>A()),t.watch(()=>n.type,()=>{!o&&!i.value&&r.reloadHisonComponent(u)}),{canvasRef:h,props:n,attrs:q,visibleClass:L,responsiveClassList:d,isPending:v}}});function I(n,w,q,c,u,h){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["hison-chart","hison-wrapper",...n.responsiveClassList,n.visibleClass]),style:t.normalizeStyle(n.props.style)},[n.isPending?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("canvas",t.mergeProps({key:0,ref:"canvasRef"},n.attrs),null,16))],6)}const N=B._export_sfc(H,[["render",I]]);exports.default=N;
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as _, ref as f, computed as x, onMounted as V, nextTick as S, onBeforeUnmount as E, watch as v, toRaw as A, markRaw as G, createElementBlock as N, openBlock as O, normalizeStyle as M, normalizeClass as J, createCommentVNode as K, mergeProps as Q } from "vue";
2
- import { g as W, u as X, r as T, d as j, c as $, e as Y, t as Z, a as ee, b as z, h as p, p as B, C as te } from "./index-Cvhi7T4w.mjs";
2
+ import { g as W, u as X, r as T, d as j, c as $, e as Y, t as Z, a as ee, b as z, h as p, p as B, C as te } from "./index-CGr5-mvg.mjs";
3
3
  import { _ as ae } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
4
4
  const se = {
5
5
  /**
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),i=require("./index-DcB16odB.js"),J=require("./scrollManager-CEEWQwoK.js"),Ce=require("./_plugin-vue_export-helper-BHFhmbuH.js"),be=["top","bottom","left","right"],ge={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},visible:{type:Boolean,default:!1},border:{type:Boolean,default:!0},zIndex:{type:Number,default:1100},position:{type:String,default:"bottom",validator:l=>be.includes(l)},width:{type:Number,default:null},height:{type:Number,default:null},closeButtonVisible:{type:Boolean,default:!0},closeButtonText:{type:String,default:"X"},closeButtonTitle:{type:String,default:"close"},swipeClose:{type:Boolean,default:!0},showOverlay:{type:Boolean,default:!0},closeClickOverlay:{type:Boolean,default:!0},overlayStyle:{type:[String,Object,Array],required:!1},scrollLock:{type:Boolean,default:!0},enterAnimationClass:{type:String,required:!1},leaveAnimationClass:{type:String,required:!1}},pe=t.defineComponent({name:"HDrawer",props:ge,inheritAttrs:!1,emits:["mounted","responsive-change","open","close"],setup(l,{emit:f}){const u=l.id||i.getUUID(),L=`hdrawer:${u}`,I=i.useDevice(),q=t.ref(null),y=t.ref(null),a=t.ref(l.visible),b=t.ref(l.zIndex??1100),w=t.ref(l.border),S=t.ref(l.showOverlay),k=t.ref(l.closeClickOverlay),g=t.ref(l.scrollLock),n=t.ref(l.position),c=t.ref(l.width??null),v=t.ref(l.height??null),B=t.ref(l.closeButtonVisible),K=t.computed(()=>w.value),Q=t.computed(()=>w.value?"filled":"empty"),N=t.ref(l.closeButtonText||"X"),P=t.ref(l.closeButtonTitle||"Close"),T=t.ref(l.swipeClose),O={top:"hison-drawer-enter-top",bottom:"hison-drawer-enter-bottom",left:"hison-drawer-enter-left",right:"hison-drawer-enter-right"},A={top:"hison-drawer-leave-top",bottom:"hison-drawer-leave-bottom",left:"hison-drawer-leave-left",right:"hison-drawer-leave-right"},h=t.ref(l.enterAnimationClass||O[n.value]),m=t.ref(l.leaveAnimationClass||A[n.value]),x=t.computed(()=>"hison-bg-empty"),_=t.computed(()=>w.value?"hison-border":""),ee=t.computed(()=>a.value?"":"hison-display-none"),$=t.ref([]),H=()=>{var e;$.value=i.extractResponsiveClasses(i.toClassString(l.class)||"",I.value),i.addComponentNameToClass($.value,"size",((e=i.hisonCloser.componentStyle)==null?void 0:e.size)||"m"),i.addComponentNameToClass($.value,"color","primary")},te=t.computed(()=>[...i.extractPrefixedClasses(i.toClassString(l.class)||"","color")]),le=t.computed(()=>a.value&&S.value),oe=t.computed(()=>{const o={zIndex:(b.value??1100)-1},s=l.overlayStyle;return s?Array.isArray(s)?[{...o},...s]:typeof s=="string"?[o,s]:{...o,...s}:o}),ne=()=>{k.value&&d()},se=t.computed(()=>{const e={zIndex:b.value,position:"fixed",inset:"auto"};switch(e.left="",e.right="",e.top="",e.bottom="",n.value){case"top":e.left="0",e.right="0",e.top="0";break;case"bottom":e.left="0",e.right="0",e.bottom="0";break;case"left":e.left="0",e.top="0",e.bottom="0";break;case"right":e.right="0",e.top="0",e.bottom="0";break}return e}),ae=t.computed(()=>{const e={};return n.value==="top"||n.value==="bottom"?(e.width="100vw",v.value!=null&&(e.height=`${v.value}px`),c.value!=null&&(e.width=`${c.value}px`)):(e.height="100vh",c.value!=null&&(e.width=`${c.value}px`),v.value!=null&&(e.height=`${v.value}px`)),e}),z=()=>{g.value&&J.acquireScrollLock(u)},V=()=>{g.value&&J.releaseScrollLock(u)},W=async()=>{const e=y.value;!e||!h.value||(e.classList.remove(m.value),e.offsetWidth,e.classList.add(h.value))},ie=async()=>{const e=y.value;!e||!m.value||(e.classList.remove(h.value),e.offsetWidth,e.classList.add(m.value),await new Promise(o=>setTimeout(o,200)))},E=async()=>{a.value||(a.value=!0,z(),await t.nextTick(),W(),f("open",t.unref(p)))},d=async()=>{if(a.value)try{await ie()}finally{a.value=!1,V(),f("close",t.unref(p))}},re=async()=>a.value?d():E(),ue=()=>d();let R=!1,M=0,U=0;const X=40,ce=e=>{T.value&&(R=!0,M=e.clientX,U=e.clientY,window.addEventListener("pointerup",ve,{once:!0,capture:!0}))},ve=e=>{if(!R)return;R=!1;const o=e.clientX-M,s=e.clientY-U,r=Math.abs(o),C=Math.abs(s);(n.value==="top"&&C>r&&s>X||n.value==="bottom"&&C>r&&s<-40||n.value==="left"&&r>C&&o<-40||n.value==="right"&&r>C&&o>X)&&d()},de=200,fe="ease";function Z(e,o,s,r,C=de,ye=fe){return new Promise(we=>{e.style.transition="none",e.style[o]=`${s}px`,e.offsetWidth,e.style.transition=`${o} ${C}ms ${ye}`,e.style[o]=`${r}px`;const D=()=>{e.removeEventListener("transitionend",D),e.style.transition="",we()};e.addEventListener("transitionend",D),setTimeout(D,C+50)})}const he=t.computed(()=>n.value==="left"||n.value==="right"),me=t.computed(()=>n.value==="top"||n.value==="bottom");async function j(e,o=!0){const s=y.value;if(!s){c.value=e;return}const r=s.getBoundingClientRect().width;if((e??r)===r){c.value=e;return}if(!o||e==null||!he.value){c.value=e;return}c.value=e,await t.nextTick(),await Z(s,"width",r,e)}async function Y(e,o=!0){const s=y.value;if(!s){v.value=e;return}const r=s.getBoundingClientRect().height;if((e??r)===r){v.value=e;return}if(!o||e==null||!me.value){v.value=e;return}v.value=e,await t.nextTick(),await Z(s,"height",r,e)}const p=t.ref(null),F=()=>{i.hisonCloser.component.drawerList[u]&&i.hisonCloser.component.drawerList[u].isHisonvueComponent&&console.warn(`[Hisonvue] The drawer ID is at risk of being duplicated. ${u}`),i.registerReloadable(L,()=>{G(),t.nextTick(F)}),H(),a.value&&(z(),t.nextTick(W)),p.value={isHisonvueComponent:!0,getId:()=>u,getType:()=>"drawer",isVisible:()=>a.value,isOpen:()=>a.value,open:E,close:d,toggle:re,setVisible:e=>e?E():d(),getZIndex:()=>b.value,setZIndex:e=>{b.value=e},getPosition:()=>n.value,setPosition:e=>{n.value=e,l.enterAnimationClass||(h.value=O[n.value]),l.leaveAnimationClass||(m.value=A[n.value])},getWidth:()=>c.value,setWidth:(e,o=!0)=>j(e,o),getHeight:()=>v.value,setHeight:(e,o=!0)=>Y(e,o),isSwipeCloseEnabled:()=>T.value,setSwipeCloseEnabled:e=>{T.value=e},isCloseButtonVisible:()=>B.value,setCloseButtonVisible:e=>{B.value=e},isOverlayShown:()=>S.value,setOverlayShown:e=>{S.value=e},isCloseClickOverlay:()=>k.value,setCloseClickOverlay:e=>{k.value=e},isScrollLocked:()=>g.value,setScrollLock:e=>{g.value=e,a.value&&(e?z():V())},isBorder:()=>w.value,setBorder:e=>{w.value=e},getAnimationClasses:()=>({enter:h.value,leave:m.value}),setAnimationClasses:e=>{"enter"in e&&(h.value=e.enter||""),"leave"in e&&(m.value=e.leave||"")},reload:()=>i.reloadHisonComponent(L)},i.hisonCloser.component.drawerList[u]=p.value,f("mounted",p.value)},G=()=>{i.unregisterReloadable(L),delete i.hisonCloser.component.drawerList[u],a.value&&V()};return t.onMounted(F),t.onBeforeUnmount(G),t.watch(I,e=>{H(),f("responsive-change",e)}),t.watch(()=>l.visible,e=>{const o=!!e;o&&!a.value?E():!o&&a.value&&d()}),t.watch(()=>l.zIndex,e=>{const o=Number(e);Number.isFinite(o)&&o!==b.value&&(b.value=o)}),t.watch(()=>l.border,e=>{const o=!!e;o!==w.value&&(w.value=o)}),t.watch(()=>l.showOverlay,e=>{const o=!!e;o!==S.value&&(S.value=o)}),t.watch(()=>l.closeClickOverlay,e=>{const o=!!e;o!==k.value&&(k.value=o)}),t.watch(()=>l.scrollLock,e=>{const o=!!e;o!==g.value&&(g.value=o,a.value&&(o?z():V()))}),t.watch(()=>l.position,e=>{e&&e!==n.value&&(n.value=e,l.enterAnimationClass||(h.value=O[n.value]),l.leaveAnimationClass||(m.value=A[n.value]))}),t.watch(()=>l.width,e=>{const o=e==null?null:Number(e);o!==c.value&&j(o,!1)}),t.watch(()=>l.height,e=>{const o=e==null?null:Number(e);o!==v.value&&Y(o,!1)}),t.watch(()=>l.closeButtonVisible,e=>{const o=!!e;o!==B.value&&(B.value=o)}),t.watch(()=>l.closeButtonText,e=>{const o=e??"X";o!==N.value&&(N.value=o)}),t.watch(()=>l.closeButtonTitle,e=>{const o=e??"Close";o!==P.value&&(P.value=o)}),t.watch(()=>l.swipeClose,e=>{const o=!!e;o!==T.value&&(T.value=o)}),t.watch(()=>l.enterAnimationClass,e=>{const o=e||O[n.value];o!==h.value&&(h.value=o)}),t.watch(()=>l.leaveAnimationClass,e=>{const o=e||A[n.value];o!==m.value&&(m.value=o)}),t.watch(()=>l.class,()=>H()),{id:u,props:l,wrapperRef:q,drawerRef:y,position:n,visibleClass:ee,responsiveClassList:$,childClassList:te,borderClass:_,backgroundTypeClass:x,wrapperStyle:se,overlayStyleWithZ:oe,isOverlayVisible:le,sizeStyle:ae,closeButtonVisible:B,closeButtonBorder:K,closeButtonBackgroundType:Q,closeButtonText:N,closeButtonTitle:P,onOverlayClick:ne,onClickClose:ue,onSwipePointerDown:ce,drawerMethods:t.computed(()=>t.unref(p))}}});function Se(l,f,u,L,I,q){const y=t.resolveComponent("HButton");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["hison-layer-host",l.visibleClass])},[l.isOverlayVisible?(t.openBlock(),t.createElementBlock("div",{key:0,class:"hison-drawer-overlay",style:t.normalizeStyle(l.overlayStyleWithZ),onClick:f[0]||(f[0]=(...a)=>l.onOverlayClick&&l.onOverlayClick(...a))},null,4)):t.createCommentVNode("",!0),t.createElementVNode("div",{ref:"wrapperRef",class:t.normalizeClass(["hison-drawer-wrapper",`hison-pos-${l.position}`,...l.responsiveClassList]),style:t.normalizeStyle(l.wrapperStyle)},[t.createElementVNode("div",{ref:"drawerRef",class:t.normalizeClass(["hison-drawer",l.borderClass,l.backgroundTypeClass]),style:t.normalizeStyle([l.sizeStyle,l.props.style]),role:"dialog",onPointerdown:f[1]||(f[1]=(...a)=>l.onSwipePointerDown&&l.onSwipePointerDown(...a))},[l.closeButtonVisible?t.renderSlot(l.$slots,"close-button",{key:0,onClick:l.onClickClose,text:l.closeButtonText,title:l.closeButtonTitle||"Close"},()=>[t.createVNode(y,{id:`hison_drawer_close_${l.id}`,class:t.normalizeClass(["hison-drawer-close-btn","hison-pos-right","hison-pos-top","hison-size-s",...l.childClassList]),text:l.closeButtonText,title:l.closeButtonTitle||"Close",border:l.closeButtonBorder,"background-type":l.closeButtonBackgroundType,onClick:l.onClickClose},t.createSlots({default:t.withCtx(()=>[l.$slots["close-label"]?t.renderSlot(l.$slots,"close-label",{key:0}):t.createCommentVNode("",!0)]),_:2},[l.$slots["close-icon"]?{name:"icon",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"close-icon")]),key:"0"}:void 0]),1032,["id","class","text","title","border","background-type","onClick"])]):t.createCommentVNode("",!0),t.renderSlot(l.$slots,"default")],38)],6)],2)}const ke=Ce._export_sfc(pe,[["render",Se]]);exports.default=ke;