mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-11 18:42:54 +00:00
15 lines
176 KiB
JavaScript
Vendored
15 lines
176 KiB
JavaScript
Vendored
import{D as yc}from"./tui-date-picker.ca22ee8a.js";var wc=Object.defineProperty,Ec=Object.defineProperties,Dc=Object.getOwnPropertyDescriptors,co=Object.getOwnPropertySymbols,na=Object.prototype.hasOwnProperty,oa=Object.prototype.propertyIsEnumerable,Zi=(e,t,n)=>t in e?wc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,R=(e,t)=>{for(var n in t||(t={}))na.call(t,n)&&Zi(e,n,t[n]);if(co)for(var n of co(t))oa.call(t,n)&&Zi(e,n,t[n]);return e},ce=(e,t)=>Ec(e,Dc(t)),gr=(e,t)=>{var n={};for(var o in e)na.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&co)for(var o of co(e))t.indexOf(o)<0&&oa.call(e,o)&&(n[o]=e[o]);return n},On,$,ra,Dn,Ji,ia,uo={},sa=[],Sc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function ot(e,t){for(var n in t)e[n]=t[n];return e}function aa(e){var t=e.parentNode;t&&t.removeChild(e)}function d(e,t,n){var o,r,i,s={};for(i in t)i=="key"?o=t[i]:i=="ref"?r=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?On.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)s[i]===void 0&&(s[i]=e.defaultProps[i]);return Sn(e,s,o,r,null)}function Sn(e,t,n,o,r){var i={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:r==null?++ra:r};return r==null&&$.vnode!=null&&$.vnode(i),i}function Me(e){return e.children}function rt(e,t){this.props=e,this.context=t}function Kt(e,t){if(t==null)return e.__?Kt(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Kt(e):null}function la(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return la(e)}}function vr(e){(!e.__d&&(e.__d=!0)&&Dn.push(e)&&!fo.__r++||Ji!==$.debounceRendering)&&((Ji=$.debounceRendering)||setTimeout)(fo)}function fo(){for(var e;fo.__r=Dn.length;)e=Dn.sort(function(t,n){return t.__v.__b-n.__v.__b}),Dn=[],e.some(function(t){var n,o,r,i,s,a;t.__d&&(s=(i=(n=t).__v).__e,(a=n.__P)&&(o=[],(r=ot({},i)).__v=i.__v+1,Br(a,i,r,n.__n,a.ownerSVGElement!==void 0,i.__h!=null?[s]:null,o,s==null?Kt(i):s,i.__h),fa(o,i),i.__e!=s&&la(i)))})}function ca(e,t,n,o,r,i,s,a,c,u){var l,f,p,m,h,w,v,y=o&&o.__k||sa,E=y.length;for(n.__k=[],l=0;l<t.length;l++)if((m=n.__k[l]=(m=t[l])==null||typeof m=="boolean"?null:typeof m=="string"||typeof m=="number"||typeof m=="bigint"?Sn(null,m,null,null,m):Array.isArray(m)?Sn(Me,{children:m},null,null,null):m.__b>0?Sn(m.type,m.props,m.key,null,m.__v):m)!=null){if(m.__=n,m.__b=n.__b+1,(p=y[l])===null||p&&m.key==p.key&&m.type===p.type)y[l]=void 0;else for(f=0;f<E;f++){if((p=y[f])&&m.key==p.key&&m.type===p.type){y[f]=void 0;break}p=null}Br(e,m,p=p||uo,r,i,s,a,c,u),h=m.__e,(f=m.ref)&&p.ref!=f&&(v||(v=[]),p.ref&&v.push(p.ref,null,m),v.push(f,m.__c||h,m)),h!=null?(w==null&&(w=h),typeof m.type=="function"&&m.__k===p.__k?m.__d=c=ua(m,c,e):c=da(e,m,p,y,h,c),typeof n.type=="function"&&(n.__d=c)):c&&p.__e==c&&c.parentNode!=e&&(c=Kt(p))}for(n.__e=w,l=E;l--;)y[l]!=null&&(typeof n.type=="function"&&y[l].__e!=null&&y[l].__e==n.__d&&(n.__d=Kt(o,l+1)),ma(y[l],y[l]));if(v)for(l=0;l<v.length;l++)pa(v[l],v[++l],v[++l])}function ua(e,t,n){for(var o,r=e.__k,i=0;r&&i<r.length;i++)(o=r[i])&&(o.__=e,t=typeof o.type=="function"?ua(o,t,n):da(n,o,o,r,o.__e,t));return t}function Cn(e,t){return t=t||[],e==null||typeof e=="boolean"||(Array.isArray(e)?e.some(function(n){Cn(n,t)}):t.push(e)),t}function da(e,t,n,o,r,i){var s,a,c;if(t.__d!==void 0)s=t.__d,t.__d=void 0;else if(n==null||r!=i||r.parentNode==null)e:if(i==null||i.parentNode!==e)e.appendChild(r),s=null;else{for(a=i,c=0;(a=a.nextSibling)&&c<o.length;c+=2)if(a==r)break e;e.insertBefore(r,i),s=i}return s!==void 0?s:r.nextSibling}function Tc(e,t,n,o,r){var i;for(i in n)i==="children"||i==="key"||i in t||po(e,i,null,n[i],o);for(i in t)r&&typeof t[i]!="function"||i==="children"||i==="key"||i==="value"||i==="checked"||n[i]===t[i]||po(e,i,t[i],n[i],o)}function Qi(e,t,n){t[0]==="-"?e.setProperty(t,n):e[t]=n==null?"":typeof n!="number"||Sc.test(t)?n:n+"px"}function po(e,t,n,o,r){var i;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||Qi(e.style,t,"");if(n)for(t in n)o&&n[t]===o[t]||Qi(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")i=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o||e.addEventListener(t,i?ts:es,i):e.removeEventListener(t,i?ts:es,i);else if(t!=="dangerouslySetInnerHTML"){if(r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t in e)try{e[t]=n==null?"":n;break e}catch{}typeof n=="function"||(n!=null&&(n!==!1||t[0]==="a"&&t[1]==="r")?e.setAttribute(t,n):e.removeAttribute(t))}}function es(e){this.l[e.type+!1]($.event?$.event(e):e)}function ts(e){this.l[e.type+!0]($.event?$.event(e):e)}function Br(e,t,n,o,r,i,s,a,c){var u,l,f,p,m,h,w,v,y,E,D,C,S,N=t.type;if(t.constructor!==void 0)return null;n.__h!=null&&(c=n.__h,a=t.__e=n.__e,t.__h=null,i=[a]),(u=$.__b)&&u(t);try{e:if(typeof N=="function"){if(v=t.props,y=(u=N.contextType)&&o[u.__c],E=u?y?y.props.value:u.__:o,n.__c?w=(l=t.__c=n.__c).__=l.__E:("prototype"in N&&N.prototype.render?t.__c=l=new N(v,E):(t.__c=l=new rt(v,E),l.constructor=N,l.render=Cc),y&&y.sub(l),l.props=v,l.state||(l.state={}),l.context=E,l.__n=o,f=l.__d=!0,l.__h=[]),l.__s==null&&(l.__s=l.state),N.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=ot({},l.__s)),ot(l.__s,N.getDerivedStateFromProps(v,l.__s))),p=l.props,m=l.state,f)N.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(N.getDerivedStateFromProps==null&&v!==p&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(v,E),!l.__e&&l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(v,l.__s,E)===!1||t.__v===n.__v){l.props=v,l.state=l.__s,t.__v!==n.__v&&(l.__d=!1),l.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(M){M&&(M.__=t)}),l.__h.length&&s.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(v,l.__s,E),l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(p,m,h)})}if(l.context=E,l.props=v,l.__v=t,l.__P=e,D=$.__r,C=0,"prototype"in N&&N.prototype.render)l.state=l.__s,l.__d=!1,D&&D(t),u=l.render(l.props,l.state,l.context);else do l.__d=!1,D&&D(t),u=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++C<25);l.state=l.__s,l.getChildContext!=null&&(o=ot(ot({},o),l.getChildContext())),f||l.getSnapshotBeforeUpdate==null||(h=l.getSnapshotBeforeUpdate(p,m)),S=u!=null&&u.type===Me&&u.key==null?u.props.children:u,ca(e,Array.isArray(S)?S:[S],t,n,o,r,i,s,a,c),l.base=t.__e,t.__h=null,l.__h.length&&s.push(l),w&&(l.__E=l.__=null),l.__e=!1}else i==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=bc(n.__e,t,n,o,r,i,s,c);(u=$.diffed)&&u(t)}catch(M){t.__v=null,(c||i!=null)&&(t.__e=a,t.__h=!!c,i[i.indexOf(a)]=null),$.__e(M,t,n)}}function fa(e,t){$.__c&&$.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(o){o.call(n)})}catch(o){$.__e(o,n.__v)}})}function bc(e,t,n,o,r,i,s,a){var c,u,l,f=n.props,p=t.props,m=t.type,h=0;if(m==="svg"&&(r=!0),i!=null){for(;h<i.length;h++)if((c=i[h])&&"setAttribute"in c==!!m&&(m?c.localName===m:c.nodeType===3)){e=c,i[h]=null;break}}if(e==null){if(m===null)return document.createTextNode(p);e=r?document.createElementNS("http://www.w3.org/2000/svg",m):document.createElement(m,p.is&&p),i=null,a=!1}if(m===null)f===p||a&&e.data===p||(e.data=p);else{if(i=i&&On.call(e.childNodes),u=(f=n.props||uo).dangerouslySetInnerHTML,l=p.dangerouslySetInnerHTML,!a){if(i!=null)for(f={},h=0;h<e.attributes.length;h++)f[e.attributes[h].name]=e.attributes[h].value;(l||u)&&(l&&(u&&l.__html==u.__html||l.__html===e.innerHTML)||(e.innerHTML=l&&l.__html||""))}if(Tc(e,p,f,r,a),l)t.__k=[];else if(h=t.props.children,ca(e,Array.isArray(h)?h:[h],t,n,o,r&&m!=="foreignObject",i,s,i?i[0]:n.__k&&Kt(n,0),a),i!=null)for(h=i.length;h--;)i[h]!=null&&aa(i[h]);a||("value"in p&&(h=p.value)!==void 0&&(h!==e.value||m==="progress"&&!h||m==="option"&&h!==f.value)&&po(e,"value",h,f.value,!1),"checked"in p&&(h=p.checked)!==void 0&&h!==e.checked&&po(e,"checked",h,f.checked,!1))}return e}function pa(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(o){$.__e(o,n)}}function ma(e,t,n){var o,r;if($.unmount&&$.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||pa(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){$.__e(i,t)}o.base=o.__P=null}if(o=e.__k)for(r=0;r<o.length;r++)o[r]&&ma(o[r],t,typeof e.type!="function");n||e.__e==null||aa(e.__e),e.__e=e.__d=void 0}function Cc(e,t,n){return this.constructor(e,n)}function mo(e,t,n){var o,r,i;$.__&&$.__(e,t),r=(o=typeof n=="function")?null:n&&n.__k||t.__k,i=[],Br(t,e=(!o&&n||t).__k=d(Me,null,[e]),r||uo,uo,t.ownerSVGElement!==void 0,!o&&n?[n]:r?null:t.firstChild?On.call(t.childNodes):null,i,!o&&n?n:r?r.__e:t.firstChild,o),fa(i,e)}function kc(e,t,n){var o,r,i,s=ot({},e.props);for(i in t)i=="key"?o=t[i]:i=="ref"?r=t[i]:s[i]=t[i];return arguments.length>2&&(s.children=arguments.length>3?On.call(arguments,2):n),Sn(e.type,s,o||e.key,r||e.ref,null)}function ko(e,t){var n={__c:t="__cC"+ia++,__:e,Consumer:function(o,r){return o.children(r)},Provider:function(o){var r,i;return this.getChildContext||(r=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(s){this.props.value!==s.value&&r.some(vr)},this.sub=function(s){r.push(s);var a=s.componentWillUnmount;s.componentWillUnmount=function(){r.splice(r.indexOf(s),1),a&&a.call(s)}}),o.children}};return n.Provider.__=n.Consumer.contextType=n}On=sa.slice,$={__e:function(e,t,n,o){for(var r,i,s;t=t.__;)if((r=t.__c)&&!r.__)try{if((i=r.constructor)&&i.getDerivedStateFromError!=null&&(r.setState(i.getDerivedStateFromError(e)),s=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(e,o||{}),s=r.__d),s)return r.__E=r}catch(a){e=a}throw e}},ra=0,rt.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=ot({},this.state),typeof e=="function"&&(e=e(ot({},n),this.props)),e&&ot(n,e),e!=null&&this.__v&&(t&&this.__h.push(t),vr(this))},rt.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),vr(this))},rt.prototype.render=Me,Dn=[],fo.__r=0,ia=0;var tn,_e,or,ns,kn=0,ha=[],oo=[],os=$.__b,rs=$.__r,is=$.diffed,ss=$.__c,as=$.unmount;function Ln(e,t){$.__h&&$.__h(_e,e,kn||t),kn=0;var n=_e.__H||(_e.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:oo}),n.__[e]}function se(e){return kn=1,Fr(ga,e)}function Fr(e,t,n){var o=Ln(tn++,2);return o.t=e,o.__c||(o.__=[n?n(t):ga(void 0,t),function(r){var i=o.t(o.__[0],r);o.__[0]!==i&&(o.__=[i,o.__[1]],o.__c.setState({}))}],o.__c=_e),o.__}function oe(e,t){var n=Ln(tn++,3);!$.__s&&Ur(n.__H,t)&&(n.__=e,n.u=t,_e.__H.__h.push(n))}function ht(e,t){var n=Ln(tn++,4);!$.__s&&Ur(n.__H,t)&&(n.__=e,n.u=t,_e.__h.push(n))}function te(e){return kn=5,U(function(){return{current:e}},[])}function U(e,t){var n=Ln(tn++,7);return Ur(n.__H,t)?(n.__V=e(),n.u=t,n.__h=e,n.__V):n.__}function Q(e,t){return kn=8,U(function(){return e},t)}function Nn(e){var t=_e.context[e.__c],n=Ln(tn++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(_e)),t.props.value):e.__}function Nc(){for(var e;e=ha.shift();)if(e.__P)try{e.__H.__h.forEach(ro),e.__H.__h.forEach(_r),e.__H.__h=[]}catch(t){e.__H.__h=[],$.__e(t,e.__v)}}$.__b=function(e){_e=null,os&&os(e)},$.__r=function(e){rs&&rs(e),tn=0;var t=(_e=e.__c).__H;t&&(or===_e?(t.__h=[],_e.__h=[],t.__.forEach(function(n){n.__V=oo,n.u=void 0})):(t.__h.forEach(ro),t.__h.forEach(_r),t.__h=[])),or=_e},$.diffed=function(e){is&&is(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ha.push(t)!==1&&ns===$.requestAnimationFrame||((ns=$.requestAnimationFrame)||function(n){var o,r=function(){clearTimeout(i),ls&&cancelAnimationFrame(o),setTimeout(n)},i=setTimeout(r,100);ls&&(o=requestAnimationFrame(r))})(Nc)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.__V!==oo&&(n.__=n.__V),n.u=void 0,n.__V=oo})),or=_e=null},$.__c=function(e,t){t.some(function(n){try{n.__h.forEach(ro),n.__h=n.__h.filter(function(o){return!o.__||_r(o)})}catch(o){t.some(function(r){r.__h&&(r.__h=[])}),t=[],$.__e(o,n.__v)}}),ss&&ss(e,t)},$.unmount=function(e){as&&as(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(o){try{ro(o)}catch(r){t=r}}),t&&$.__e(t,n.__v))};var ls=typeof requestAnimationFrame=="function";function ro(e){var t=_e,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),_e=t}function _r(e){var t=_e;e.__c=e.__(),_e=t}function Ur(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function ga(e,t){return typeof t=="function"?t(e):t}function ze(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map(function(r){return"'"+r+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function qt(e){return!!e&&!!e[xe]}function bt(e){return!!e&&(function(t){if(!t||typeof t!="object")return!1;var n=Object.getPrototypeOf(t);if(n===null)return!0;var o=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return o===Object||typeof o=="function"&&Function.toString.call(o)===Lc}(e)||Array.isArray(e)||!!e[gs]||!!e.constructor[gs]||zr(e)||Wr(e))}function In(e,t,n){n===void 0&&(n=!1),nn(e)===0?(n?Object.keys:Kr)(e).forEach(function(o){n&&typeof o=="symbol"||t(o,e[o],e)}):e.forEach(function(o,r){return t(r,o,e)})}function nn(e){var t=e[xe];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:zr(e)?2:Wr(e)?3:0}function yr(e,t){return nn(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Ic(e,t){return nn(e)===2?e.get(t):e[t]}function va(e,t,n){var o=nn(e);o===2?e.set(t,n):o===3?(e.delete(t),e.add(n)):e[t]=n}function Mc(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function zr(e){return xc&&e instanceof Map}function Wr(e){return Oc&&e instanceof Set}function Tt(e){return e.o||e.t}function Yr(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=Hc(e);delete t[xe];for(var n=Kr(t),o=0;o<n.length;o++){var r=n[o],i=t[r];i.writable===!1&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[r]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[r]})}return Object.create(Object.getPrototypeOf(e),t)}function Vr(e,t){return t===void 0&&(t=!1),jr(e)||qt(e)||!bt(e)||(nn(e)>1&&(e.set=e.add=e.clear=e.delete=Ac),Object.freeze(e),t&&In(e,function(n,o){return Vr(o,!0)},!0)),e}function Ac(){ze(2)}function jr(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function qe(e){var t=$c[e];return t||ze(18,e),t}function cs(){return Mn}function rr(e,t){t&&(qe("Patches"),e.u=[],e.s=[],e.v=t)}function ho(e){wr(e),e.p.forEach(Rc),e.p=null}function wr(e){e===Mn&&(Mn=e.l)}function us(e){return Mn={p:[],l:Mn,h:e,m:!0,_:0}}function Rc(e){var t=e[xe];t.i===0||t.i===1?t.j():t.O=!0}function ir(e,t){t._=t.p.length;var n=t.p[0],o=e!==void 0&&e!==n;return t.h.g||qe("ES5").S(t,e,o),o?(n[xe].P&&(ho(t),ze(4)),bt(e)&&(e=go(t,e),t.l||vo(t,e)),t.u&&qe("Patches").M(n[xe].t,e,t.u,t.s)):e=go(t,n,[]),ho(t),t.u&&t.v(t.u,t.s),e!==_a?e:void 0}function go(e,t,n){if(jr(t))return t;var o=t[xe];if(!o)return In(t,function(i,s){return ds(e,o,t,i,s,n)},!0),t;if(o.A!==e)return t;if(!o.P)return vo(e,o.t,!0),o.t;if(!o.I){o.I=!0,o.A._--;var r=o.i===4||o.i===5?o.o=Yr(o.k):o.o;In(o.i===3?new Set(r):r,function(i,s){return ds(e,o,r,i,s,n)}),vo(e,r,!1),n&&e.u&&qe("Patches").R(o,n,e.u,e.s)}return o.o}function ds(e,t,n,o,r,i){if(qt(r)){var s=go(e,r,i&&t&&t.i!==3&&!yr(t.D,o)?i.concat(o):void 0);if(va(n,o,s),!qt(s))return;e.m=!1}if(bt(r)&&!jr(r)){if(!e.h.F&&e._<1)return;go(e,r),t&&t.A.l||vo(e,r)}}function vo(e,t,n){n===void 0&&(n=!1),e.h.F&&e.m&&Vr(t,n)}function sr(e,t){var n=e[xe];return(n?Tt(n):e)[t]}function fs(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var o=Object.getOwnPropertyDescriptor(n,t);if(o)return o;n=Object.getPrototypeOf(n)}}function Er(e){e.P||(e.P=!0,e.l&&Er(e.l))}function ar(e){e.o||(e.o=Yr(e.t))}function Dr(e,t,n){var o=zr(t)?qe("MapSet").N(t,n):Wr(t)?qe("MapSet").T(t,n):e.g?function(r,i){var s=Array.isArray(r),a={i:s?1:0,A:i?i.A:cs(),P:!1,I:!1,D:{},l:i,t:r,k:null,o:null,j:null,C:!1},c=a,u=Sr;s&&(c=[a],u=wn);var l=Proxy.revocable(c,u),f=l.revoke,p=l.proxy;return a.k=p,a.j=f,p}(t,n):qe("ES5").J(t,n);return(n?n.A:cs()).p.push(o),o}function Pc(e){return qt(e)||ze(22,e),function t(n){if(!bt(n))return n;var o,r=n[xe],i=nn(n);if(r){if(!r.P&&(r.i<4||!qe("ES5").K(r)))return r.t;r.I=!0,o=ps(n,i),r.I=!1}else o=ps(n,i);return In(o,function(s,a){r&&Ic(r.t,s)===a||va(o,s,t(a))}),i===3?new Set(o):o}(e)}function ps(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Yr(e)}var ms,Mn,Xr=typeof Symbol!="undefined"&&typeof Symbol("x")=="symbol",xc=typeof Map!="undefined",Oc=typeof Set!="undefined",hs=typeof Proxy!="undefined"&&Proxy.revocable!==void 0&&typeof Reflect!="undefined",_a=Xr?Symbol.for("immer-nothing"):((ms={})["immer-nothing"]=!0,ms),gs=Xr?Symbol.for("immer-draftable"):"__$immer_draftable",xe=Xr?Symbol.for("immer-state"):"__$immer_state",Lc=""+Object.prototype.constructor,Kr=typeof Reflect!="undefined"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,Hc=Object.getOwnPropertyDescriptors||function(e){var t={};return Kr(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},$c={},Sr={get:function(e,t){if(t===xe)return e;var n=Tt(e);if(!yr(n,t))return function(r,i,s){var a,c=fs(i,s);return c?"value"in c?c.value:(a=c.get)===null||a===void 0?void 0:a.call(r.k):void 0}(e,n,t);var o=n[t];return e.I||!bt(o)?o:o===sr(e.t,t)?(ar(e),e.o[t]=Dr(e.A.h,o,e)):o},has:function(e,t){return t in Tt(e)},ownKeys:function(e){return Reflect.ownKeys(Tt(e))},set:function(e,t,n){var o=fs(Tt(e),t);if(o!=null&&o.set)return o.set.call(e.k,n),!0;if(!e.P){var r=sr(Tt(e),t),i=r==null?void 0:r[xe];if(i&&i.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(Mc(n,r)&&(n!==void 0||yr(e.t,t)))return!0;ar(e),Er(e)}return e.o[t]===n&&typeof n!="number"&&(n!==void 0||t in e.o)||(e.o[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return sr(e.t,t)!==void 0||t in e.t?(e.D[t]=!1,ar(e),Er(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=Tt(e),o=Reflect.getOwnPropertyDescriptor(n,t);return o&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:o.enumerable,value:n[t]}},defineProperty:function(){ze(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){ze(12)}},wn={};In(Sr,function(e,t){wn[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),wn.deleteProperty=function(e,t){return wn.set.call(this,e,t,void 0)},wn.set=function(e,t,n){return Sr.set.call(this,e[0],t,n,e[0])};var Gc=function(){function e(n){var o=this;this.g=hs,this.F=!0,this.produce=function(r,i,s){if(typeof r=="function"&&typeof i!="function"){var a=i;i=r;var c=o;return function(w){var v=this;w===void 0&&(w=a);for(var y=arguments.length,E=Array(y>1?y-1:0),D=1;D<y;D++)E[D-1]=arguments[D];return c.produce(w,function(C){var S;return(S=i).call.apply(S,[v,C].concat(E))})}}var u;if(typeof i!="function"&&ze(6),s!==void 0&&typeof s!="function"&&ze(7),bt(r)){var l=us(o),f=Dr(o,r,void 0),p=!0;try{u=i(f),p=!1}finally{p?ho(l):wr(l)}return typeof Promise!="undefined"&&u instanceof Promise?u.then(function(w){return rr(l,s),ir(w,l)},function(w){throw ho(l),w}):(rr(l,s),ir(u,l))}if(!r||typeof r!="object"){if((u=i(r))===void 0&&(u=r),u===_a&&(u=void 0),o.F&&Vr(u,!0),s){var m=[],h=[];qe("Patches").M(r,u,m,h),s(m,h)}return u}ze(21,r)},this.produceWithPatches=function(r,i){if(typeof r=="function")return function(u){for(var l=arguments.length,f=Array(l>1?l-1:0),p=1;p<l;p++)f[p-1]=arguments[p];return o.produceWithPatches(u,function(m){return r.apply(void 0,[m].concat(f))})};var s,a,c=o.produce(r,i,function(u,l){s=u,a=l});return typeof Promise!="undefined"&&c instanceof Promise?c.then(function(u){return[u,s,a]}):[c,s,a]},typeof(n==null?void 0:n.useProxies)=="boolean"&&this.setUseProxies(n.useProxies),typeof(n==null?void 0:n.autoFreeze)=="boolean"&&this.setAutoFreeze(n.autoFreeze)}var t=e.prototype;return t.createDraft=function(n){bt(n)||ze(8),qt(n)&&(n=Pc(n));var o=us(this),r=Dr(this,n,void 0);return r[xe].C=!0,wr(o),r},t.finishDraft=function(n,o){var r=n&&n[xe],i=r.A;return rr(i,o),ir(void 0,i)},t.setAutoFreeze=function(n){this.F=n},t.setUseProxies=function(n){n&&!hs&&ze(20),this.g=n},t.applyPatches=function(n,o){var r;for(r=o.length-1;r>=0;r--){var i=o[r];if(i.path.length===0&&i.op==="replace"){n=i.value;break}}r>-1&&(o=o.slice(r+1));var s=qe("Patches").$;return qt(n)?s(n,o):this.produce(n,function(a){return s(a,o)})},e}(),Oe=new Gc,Bc=Oe.produce;Oe.produceWithPatches.bind(Oe);Oe.setAutoFreeze.bind(Oe);Oe.setUseProxies.bind(Oe);Oe.applyPatches.bind(Oe);Oe.createDraft.bind(Oe);Oe.finishDraft.bind(Oe);var J=Bc,Fc=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Uc(e){return e===void 0}var Le=Uc,zc=Le;function Wc(e,t,n){var o=[],r;for(zc(t)&&(t=e||0,e=0),n=n||1,r=n<0?-1:1,t*=r;e*r<t;e+=n)o.push(e);return o}var gt=Wc;const Yc="0",Zt=24,No=2,qr=3,Io=27,lr=5,Vc=280,io=44,Tr=12,jc=12,Xc="12px 17px 0",ya=42,wa=1,Ea=2,Jt=72,vs={color:"#000",backgroundColor:"#a1b56c",dragBackgroundColor:"#a1b56c",borderColor:"#000"},_o=2,_s=9;function Kc(e){return typeof e=="boolean"||e instanceof Boolean}var Zr=Kc;function qc(e){return typeof e=="number"||e instanceof Number}var so=qc;function Zc(e){return e===Object(e)}var ao=Zc;function Jc(e){return typeof e=="string"||e instanceof String}var be=Jc;function Y(e){return Le(e)||e===null}function P(e){return!Y(e)}function Tn(e){return typeof e=="function"}const Qc="toastui-calendar-";function _(...e){const t=[];return e.forEach(n=>{!n||(be(n)?t.push(n):Object.keys(n).forEach(o=>{n[o]&&t.push(o)}))}),t.map(n=>`${Qc}${n}`).join(" ")}function K(e){return`${e}%`}function yo(e){return`${e}px`}function br(e){const t=/(\d+)%/,n=e.match(t),o=/(-?)\s?(\d+)px/,r=e.match(o);return{percent:n?parseInt(n[1],10):0,px:r?parseInt(`${r[1]}${r[2]}`,10):0}}function Da(e,t){const n=e.model.getColors();return Object.keys(vs).reduce((o,r)=>{var i,s;const a=r;return o[a]=(s=(i=n[a])!=null?i:t[a])!=null?s:vs[a],o},{})}const eu=/^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\.)?([0-9]+)?([+-]\d\d(?::?\d\d)?|\s*Z)?$/;function ys(){throw new Error("This operation is not supported.")}function tu(e){const t=eu.exec(e);if(t){const[,n,o,r,i,s,a,,c,u]=t;return{y:Number(n),M:Number(o)-1,d:Number(r),h:Number(i),m:Number(s),s:Number(a),ms:Number(c)||0,zoneInfo:u}}return null}function nu(e){const t=tu(e);if(t&&!t.zoneInfo){const{y:n,M:o,d:r,h:i,m:s,s:a,ms:c}=t;return new Date(n,o,r,i,s,a,c)}return null}class on{constructor(...t){const[n]=t;n instanceof Date?this.d=new Date(n.getTime()):be(n)&&t.length===1&&(this.d=nu(n)),this.d||(this.d=new Date(...t))}setTimezoneOffset(){ys()}setTimezoneName(){ys()}clone(){return new on(this.d)}toDate(){return new Date(this.d.getTime())}toString(){return this.d.toString()}}const ou=["getTime","getTimezoneOffset","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","getMilliseconds","getDay"],ru=["setTime","setFullYear","setMonth","setDate","setHours","setMinutes","setSeconds","setMilliseconds"];ou.forEach(e=>{on.prototype[e]=function(...t){return this.d[e](...t)}});ru.forEach(e=>{on.prototype[e]=function(...t){return this.d[e](...t)}});class Mo extends on{clone(){return new Mo(this.d)}getTimezoneOffset(){return 0}}const iu=["FullYear","Month","Date","Hours","Minutes","Seconds","Milliseconds","Day"],su=["FullYear","Month","Date","Hours","Minutes","Seconds","Milliseconds"];iu.forEach(e=>{const t=`get${e}`;Mo.prototype[t]=function(...n){return this.d[`getUTC${e}`](...n)}});su.forEach(e=>{const t=`set${e}`;Mo.prototype[t]=function(...n){return this.d[`setUTC${e}`](...n)}});const au="Invalid DateTime Format",lu="Invalid IANA Timezone Name",cu="Invalid View Type",An="@toast-ui/calendar: ";class uu extends Error{constructor(t){super(`${An}${lu} - ${t}`),this.name="InvalidTimezoneNameError"}}class du extends Error{constructor(t){super(`${An}${au} - ${t}`),this.name="InvalidDateTimeFormatError"}}class fu extends Error{constructor(t){super(`${An}${cu} - ${t}`),this.name="InvalidViewTypeError"}}const pu={error:(e,...t)=>{console.error(`${An}${e}`,...t)},warn:(e,...t)=>{console.warn(`${An}${e}`,...t)}};let mu=on;function ws(...e){return new mu(...e)}function hu(){return-new Date().getTimezoneOffset()}function bn(e,t=new O){if(!gu())return pu.warn(`Intl.DateTimeFormat is not fully supported. So It will return the local timezone offset only.
|
|
You can use a polyfill to fix this issue.`),-t.toDate().getTimezoneOffset();Sa(e);const n=yu(t,e),o=wu(n);return Math.round((o.getTime()-t.getTime())/60/1e3)}function vn(e,t){t&&Sa(t);const n=new O(e.getFullYear(),0,1),o=new O(e.getFullYear(),6,1);return t?Math.max(-bn(t,n),-bn(t,o))!==-bn(t,e):Math.max(n.getTimezoneOffset(),o.getTimezoneOffset())!==e.toDate().getTimezoneOffset()}const cr={},Es={};function gu(){var e,t;return Tn((t=(e=Intl==null?void 0:Intl.DateTimeFormat)==null?void 0:e.prototype)==null?void 0:t.formatToParts)}function Sa(e){if(Es[e])return!0;try{return Intl.DateTimeFormat("en-US",{timeZone:e}),Es[e]=!0,!0}catch{throw new uu(e)}}function vu(e){if(cr[e])return cr[e];const t=new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",hour12:!1,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"});return cr[e]=t,t}const _u={year:0,month:1,day:2,hour:3,minute:4,second:5};function yu(e,t){return vu(t).formatToParts(e.toDate()).reduce((r,i)=>{const s=_u[i.type];return P(s)&&(r[s]=parseInt(i.value,10)),r},[])}function wu(e){const[t,n,o,r,i,s]=e,a=n-1;return new Date(Date.UTC(t,a,o,r%24,i,s))}function ur(e){return(hu()-e)*Qr}class O{constructor(...t){this.tzOffset=null,t[0]instanceof O?this.d=ws(t[0].getTime()):this.d=ws(...t)}toString(){return this.d.toString()}addFullYear(t){return this.setFullYear(this.getFullYear()+t),this}addMonth(t){return this.setMonth(this.getMonth()+t),this}addDate(t){return this.setDate(this.getDate()+t),this}addHours(t){return this.setHours(this.getHours()+t),this}addMinutes(t){return this.setMinutes(this.getMinutes()+t),this}addSeconds(t){return this.setSeconds(this.getSeconds()+t),this}addMilliseconds(t){return this.setMilliseconds(this.getMilliseconds()+t),this}setWithRaw(t,n,o,r,i,s,a){return this.setFullYear(t,n,o),this.setHours(r,i,s,a),this}toDate(){return this.d.toDate()}valueOf(){return this.getTime()}getTimezoneOffset(){var t;return(t=this.tzOffset)!=null?t:this.d.getTimezoneOffset()}getTime(){return this.d.getTime()}getFullYear(){return this.d.getFullYear()}getMonth(){return this.d.getMonth()}getDate(){return this.d.getDate()}getHours(){return this.d.getHours()}getMinutes(){return this.d.getMinutes()}getSeconds(){return this.d.getSeconds()}getMilliseconds(){return this.d.getMilliseconds()}getDay(){return this.d.getDay()}setTime(t){return this.d.setTime(t)}setFullYear(t,n=this.getMonth(),o=this.getDate()){return this.d.setFullYear(t,n,o)}setMonth(t,n=this.getDate()){return this.d.setMonth(t,n)}setDate(t){return this.d.setDate(t)}setHours(t,n=this.getMinutes(),o=this.getSeconds(),r=this.getMilliseconds()){return this.d.setHours(t,n,o,r)}setMinutes(t,n=this.getSeconds(),o=this.getMilliseconds()){return this.d.setMinutes(t,n,o)}setSeconds(t,n=this.getMilliseconds()){return this.d.setSeconds(t,n)}setMilliseconds(t){return this.d.setMilliseconds(t)}tz(t){if(t==="Local")return new O(this.getTime());const n=be(t)?bn(t,this):t,o=new O(this.getTime()-ur(n));return o.tzOffset=n,o}local(t){if(P(t)){const n=be(t)?bn(t,this):t;return new O(this.getTime()+ur(n))}return new O(this.getTime()+(P(this.tzOffset)?ur(this.tzOffset):0))}}function Eu(e,...t){return t.reduce((n,o)=>(e.hasOwnProperty(o)&&(n[o]=e[o]),n),{})}function Du(e){return Object.assign(Object.create(Object.getPrototypeOf(e)),e)}function Ue(e,t={}){return ao(t)&&Object.keys(t).forEach(n=>{const o=n,r=n;!Array.isArray(t[r])&&ao(e[o])&&ao(t[r])&&!(t[r]instanceof O)?e[o]=Ue(e[o],t[r]):e[o]=t[r]}),e}const Su=["top","left","width","height","exceedLeft","exceedRight","croppedStart","croppedEnd","goingDurationHeight","modelDurationHeight","comingDurationHeight","duplicateEvents","duplicateEventIndex","duplicateStarts","duplicateEnds","duplicateLeft","duplicateWidth","collapse","isMain"];class Ct{constructor(t){this.top=0,this.left=0,this.width=0,this.height=0,this.exceedLeft=!1,this.exceedRight=!1,this.croppedStart=!1,this.croppedEnd=!1,this.goingDurationHeight=0,this.modelDurationHeight=100,this.comingDurationHeight=0,this.duplicateEvents=[],this.duplicateEventIndex=-1,this.duplicateLeft="",this.duplicateWidth="",this.collapse=!1,this.isMain=!1,this.model=t}getUIProps(){return Eu(this,...Su)}setUIProps(t){Object.assign(this,t)}getStarts(){return this.renderStarts?this.renderStarts:this.model.getStarts()}getEnds(){return this.renderEnds?this.renderEnds:this.model.getEnds()}cid(){return this.model.cid()}valueOf(){return this.model}duration(){return this.model.duration()}collidesWith(t,n=!0){const o=[];[this,t].forEach(s=>{s instanceof Ct&&s.duplicateEvents.length>0?o.push({start:s.duplicateStarts,end:s.duplicateEnds,goingDuration:0,comingDuration:0}):o.push({start:s.getStarts(),end:s.getEnds(),goingDuration:s.valueOf().goingDuration,comingDuration:s.valueOf().comingDuration})});const[r,i]=o;return ka({start:r.start.getTime(),end:r.end.getTime(),targetStart:i.start.getTime(),targetEnd:i.end.getTime(),goingDuration:r.goingDuration,comingDuration:r.comingDuration,targetGoingDuration:i.goingDuration,targetComingDuration:i.comingDuration,usingTravelTime:n})}clone(){const t=this.getUIProps(),n=new Ct(this.model);return n.setUIProps(t),this.renderStarts&&(n.renderStarts=new O(this.renderStarts)),this.renderEnds&&(n.renderEnds=new O(this.renderEnds)),n}}function Tu(e,t){return e!==t?e?-1:1:0}function bu(e,t){return Number(e)-Number(t)}function Cu(e,t){const n=String(e),o=String(t);return n===o?0:n>o?1:-1}function ku(e,t){const n=e instanceof Ct?e.model:e,o=t instanceof Ct?t.model:t,r=Tu(n.isAllday||n.hasMultiDates,o.isAllday||o.hasMultiDates);if(r)return r;const i=vt(e.getStarts(),t.getStarts());if(i)return i;const s=e.duration(),a=t.duration();return s<a?1:s>a?-1:n.cid()-o.cid()}function Nu(e,t,n,o){let r=0,i=e.length-1,s,a,c;for(o=o||Cu;r<=i;)if(s=(r+i)/2|0,a=n?n(e[s]):e[s],c=o(a,t),c<0)r=s+1;else if(c>0)i=s-1;else return s;return~i}var kt={bsearch:Nu,compare:{event:{asc:ku},num:{asc:bu}}};function Cr(e){return e[0]}function it(e){return e[e.length-1]}function Jr(e,t){for(let n=e.length-1;n>=0;n-=1)if(t(e[n]))return n;return-1}function Ds(e,t){return e>0?Array.from({length:e},()=>Array.isArray(t)?t.slice():t):[]}var rn=(e=>(e[e.SUN=0]="SUN",e[e.MON=1]="MON",e[e.TUE=2]="TUE",e[e.WED=3]="WED",e[e.THU=4]="THU",e[e.FRI=5]="FRI",e[e.SAT=6]="SAT",e))(rn||{});const Xe=7,Iu=/^(\d{4}[-|/]*\d{2}[-|/]*\d{2})\s?(\d{2}:\d{2}:\d{2})?$/,Mu={millisecondsTo:{},millisecondsFrom:{}},Au=[24,60,60,1e3];function Ne(e,t){let n="",o=0;if(String(e).length>t)return String(e);for(;o<t-1;o+=1)n+="0";return(n+e).slice(t*-1)}function Ss(e){let t=e.getHours();return t===0&&(t=12),t>12&&(t=t%12),t}const Ru={YYYYMMDD(e){return[e.getFullYear(),Ne(e.getMonth()+1,2),Ne(e.getDate(),2)].join("")},YYYY(e){return String(e.getFullYear())},MM(e){return Ne(e.getMonth()+1,2)},DD(e){return Ne(e.getDate(),2)},"HH:mm":function(e){const t=e.getHours(),n=e.getMinutes();return`${Ne(t,2)}:${Ne(n,2)}`},"hh:mm":function(e){const t=Ss(e),n=e.getMinutes();return`${Ne(t,2)}:${Ne(n,2)}`},hh(e){const t=Ss(e);return String(t)},tt(e){return e.getHours()<12?"am":"pm"}},at=864e5,Qr=6e4,Yn=20*Qr,Ta=30*60*1e3;function pe(e,t){let n=t;return Object.entries(Ru).forEach(([o,r])=>{n=n.replace(o,r(e))}),n}function Pu(e,t,n){const o={date:0,hour:1,minute:2,second:3};return!(e in o)||isNaN(t)?0:[t].concat(Au.slice(o[e])).reduce(n)}function Vn(e,t){const n=Mu.millisecondsFrom,o=e+t;if(n[o])return n[o];const r=Pu(e,t,(i,s)=>i*s);return r?(n[o]=r,n[o]):0}function he(e){const t=e?new O(e):new O;return t.setHours(0,0,0,0),t}function kr(e,t,n){const o=e.getTime(),r=t.getTime(),i=new O(e),s=[];let a=o;for(;a<=r&&r>=i.getTime();)s.push(new O(i)),a=a+n,i.addMilliseconds(n);return s}function sn(e){return new O(e)}function vt(e,t){const n=e.getTime(),o=t.getTime();return n<o?-1:n>o?1:0}function xu(e,t){return e.getFullYear()===t.getFullYear()}function Ou(e,t){return xu(e,t)&&e.getMonth()===t.getMonth()}function Nt(e,t){return Ou(e,t)&&e.getDate()===t.getDate()}function ei(e,t){return vt(e,t)===1?e:t}function ba(e,t){return vt(e,t)===-1?e:t}function Ts(e,t=-1){const n=e.match(Iu);let o,r,i;if(!n)throw new du(e);if(e.length>8){o=~e.indexOf("/")?"/":"-";const s=n.splice(1);r=s[0].split(o),i=s[1]?s[1].split(":"):[0,0,0]}else{const[s]=n;r=[s.substr(0,4),s.substr(4,2),s.substr(6,2)],i=[0,0,0]}return new O().setWithRaw(Number(r[0]),Number(r[1])+t,Number(r[2]),Number(i[0]),Number(i[1]),Number(i[2]),0)}function Ae(e){const t=e?new O(e):new O;return t.setHours(23,59,59,999),t}function Ge(e){return e===0||e===6}function ti(e){return e===0}function ni(e){return e===6}function Ca(e){const t=new O(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Lu(e){const t=Ca(e);return t.setMonth(t.getMonth()+1),t.setDate(t.getDate()-1),t.setHours(23,59,59,999),t}function oi(e,t,n,o){const i=100/e,s=e>5?100/(e-1):i;let a=0;const c=gt(n,Xe).concat(gt(e)).slice(0,Xe);t=o?!1:t;const u=c.map(p=>{let m=t?s:i;e>5&&t&&Ge(p)&&(m=s/2);const h={width:m,left:a};return a+=m,h}),{length:l}=u,f=Ds(l,Ds(l,0));return u.forEach(({width:p},m)=>{for(let h=0;h<=m;h+=1)for(let w=m;w<l;w+=1)f[h][w]+=p}),f[0][l-1]=100,{rowStyleInfo:u,cellWidthMap:f.map(p=>p.map(K))}}function wo(e,t){const n=sn(e);return n.setMilliseconds(e.getMilliseconds()+t),n}function Ie(e,t){const n=sn(e);return n.setMinutes(e.getMinutes()+t),n}function Ke(e,t){const n=sn(e);return n.setHours(...t.split(":").map(Number)),n}function It(e,t){const n=sn(e);return n.setDate(e.getDate()+t),n}function Hu(e,t){const n=sn(e);return n.setDate(e.getDate()-t),n}function $u(e,t=1){const n=sn(e);if(t!==0){const o=n.getDate(),r=new O(n.getTime());r.setMonth(n.getMonth()+t+1,0);const i=r.getDate();if(o>=i)return r;n.setFullYear(r.getFullYear(),r.getMonth(),o)}return n}function ri(e,t){const n=new O(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),o=new O(t.getFullYear(),t.getMonth(),t.getDate()).getTime();return Math.round((n-o)/at)}function Gu(e,t,n,o){return n>e&&n<t||o>e&&o<t||n<=e&&o>=t}function ka({start:e,end:t,targetStart:n,targetEnd:o,goingDuration:r,comingDuration:i,targetGoingDuration:s,targetComingDuration:a,usingTravelTime:c}){return Math.abs(t-e)<Yn&&(t+=Yn),Math.abs(t-e)<Yn&&(t+=Yn),c&&(e-=Vn("minute",r),t+=Vn("minute",i),n-=Vn("minute",s),o+=Vn("minute",a)),Gu(e,t,n,o)}function Bu(e,t,n){return e.id===t&&e.calendarId===n}function Fu(){let e=0;return{next(){return e+=1,e}}}const Uu=function(){const e=Fu();return()=>e.next()}();function bs(e){return e.__fe_id||(e.__fe_id=Uu()),e.__fe_id}class ii{constructor(t={}){this.id="",this.calendarId="",this.title="",this.body="",this.isAllday=!1,this.start=new O,this.end=new O,this.goingDuration=0,this.comingDuration=0,this.location="",this.attendees=[],this.category="time",this.dueDateClass="",this.recurrenceRule="",this.state="Busy",this.isVisible=!0,this.isPending=!1,this.isFocused=!1,this.isReadOnly=!1,this.isPrivate=!1,this.customStyle={},this.raw=null,this.hasMultiDates=!1,bs(this),this.init(t)}init({id:t="",calendarId:n="",title:o="",body:r="",isAllday:i=!1,start:s=new O,end:a=new O,goingDuration:c=0,comingDuration:u=0,location:l="",attendees:f=[],category:p="time",dueDateClass:m="",recurrenceRule:h="",state:w="Busy",isVisible:v=!0,isPending:y=!1,isFocused:E=!1,isReadOnly:D=!1,isPrivate:C=!1,color:S,backgroundColor:N,dragBackgroundColor:M,borderColor:H,customStyle:x={},raw:W=null}={}){this.id=t,this.calendarId=n,this.title=o,this.body=r,this.isAllday=p==="allday"?!0:i,this.goingDuration=c,this.comingDuration=u,this.location=l,this.attendees=f,this.category=p,this.dueDateClass=m,this.recurrenceRule=h,this.state=w,this.isVisible=v,this.isPending=y,this.isFocused=E,this.isReadOnly=D,this.isPrivate=C,this.color=S,this.backgroundColor=N,this.dragBackgroundColor=M,this.borderColor=H,this.customStyle=x,this.raw=W,this.isAllday?this.setAlldayPeriod(s,a):this.setTimePeriod(s,a),(p==="milestone"||p==="task")&&(this.start=new O(this.end))}setAlldayPeriod(t,n){let o,r;be(t)?o=Ts(t.substring(0,10)):o=new O(t||Date.now()),be(n)?r=Ts(n.substring(0,10)):r=new O(n||this.start),this.start=o,this.start.setHours(0,0,0),this.end=r||new O(this.start),this.end.setHours(23,59,59)}setTimePeriod(t,n){this.start=new O(t||Date.now()),this.end=new O(n||this.start),n||this.end.setMinutes(this.end.getMinutes()+30),this.hasMultiDates=this.end.getTime()-this.start.getTime()>at}getStarts(){return this.start}getEnds(){return this.end}cid(){return bs(this)}equals(t){return!(this.id!==t.id||this.title!==t.title||this.body!==t.body||this.isAllday!==t.isAllday||vt(this.getStarts(),t.getStarts())!==0||vt(this.getEnds(),t.getEnds())!==0||this.color!==t.color||this.backgroundColor!==t.backgroundColor||this.dragBackgroundColor!==t.dragBackgroundColor||this.borderColor!==t.borderColor)}duration(){const t=Number(this.getStarts()),n=Number(this.getEnds());let o;return this.isAllday?o=Number(Ae(n))-Number(he(t)):o=n-t,o}valueOf(){return this}collidesWith(t,n=!0){return t=t instanceof Ct?t.model:t,ka({start:Number(this.getStarts()),end:Number(this.getEnds()),targetStart:Number(t.getStarts()),targetEnd:Number(t.getEnds()),goingDuration:this.goingDuration,comingDuration:this.comingDuration,targetGoingDuration:t.goingDuration,targetComingDuration:t.comingDuration,usingTravelTime:n})}toEventObject(){return{id:this.id,calendarId:this.calendarId,__cid:this.cid(),title:this.title,body:this.body,isAllday:this.isAllday,start:this.start,end:this.end,goingDuration:this.goingDuration,comingDuration:this.comingDuration,location:this.location,attendees:this.attendees,category:this.category,dueDateClass:this.dueDateClass,recurrenceRule:this.recurrenceRule,state:this.state,isVisible:this.isVisible,isPending:this.isPending,isFocused:this.isFocused,isReadOnly:this.isReadOnly,isPrivate:this.isPrivate,color:this.color,backgroundColor:this.backgroundColor,dragBackgroundColor:this.dragBackgroundColor,borderColor:this.borderColor,customStyle:this.customStyle,raw:this.raw}}getColors(){return{color:this.color,backgroundColor:this.backgroundColor,dragBackgroundColor:this.dragBackgroundColor,borderColor:this.borderColor}}}ii.schema={required:["title"],dateRange:["start","end"]};function zu({model:e}){const{category:t,isAllday:n,hasMultiDates:o}=e;return t==="time"&&!n&&!o}class Ze{constructor(t){this.internalMap=new Map,Tn(t)&&(this.getItemID=t)}static and(...t){const{length:n}=t;return o=>{for(let r=0;r<n;r+=1)if(!t[r].call(null,o))return!1;return!0}}static or(...t){const{length:n}=t;return n?o=>{let r=t[0].call(null,o);for(let i=1;i<n;i+=1)r=r||t[i].call(null,o);return r}:()=>!1}getItemID(t){var n;return(n=t==null?void 0:t._id)!=null?n:""}getFirstItem(){return this.internalMap.values().next().value}add(...t){return t.forEach(n=>{const o=this.getItemID(n);this.internalMap.set(o,n)}),this}remove(...t){const n=[];return t.forEach(o=>{const r=be(o)||so(o)?o:this.getItemID(o);!this.internalMap.has(r)||(n.push(this.internalMap.get(r)),this.internalMap.delete(r))}),n.length===1?n[0]:n}has(t){const n=be(t)||so(t)?t:this.getItemID(t);return this.internalMap.has(n)}get(t){var n;const o=be(t)||so(t)?t:this.getItemID(t);return(n=this.internalMap.get(o))!=null?n:null}doWhenHas(t,n){const o=this.internalMap.get(t);Y(o)||n(o)}filter(t){const n=new Ze;return this.hasOwnProperty("getItemID")&&(n.getItemID=this.getItemID),this.internalMap.forEach(o=>{t(o)===!0&&n.add(o)}),n}groupBy(t){const n={};return this.internalMap.forEach(o=>{var r;let i=Tn(t)?t(o):o[t];Tn(i)&&(i=i.call(o)),(r=n[i])!=null||(n[i]=new Ze(this.getItemID)),n[i].add(o)}),n}find(t){let n=null;const o=this.internalMap.values();let r=o.next();for(;r.done===!1;){if(t(r.value)){n=r.value;break}r=o.next()}return n}sort(t){return this.toArray().sort(t)}each(t){const n=this.internalMap.entries();let o=n.next();for(;o.done===!1;){const[r,i]=o.value;if(t(i,r)===!1)break;o=n.next()}}clear(){this.internalMap.clear()}toArray(){return Array.from(this.internalMap.values())}get size(){return this.internalMap.size}}function Qt(...e){const t=new Ze(n=>n.cid());return e.length&&t.add(...e),t}function Na(e,t){return kr(he(e),Ae(t),at)}function Wu(e){return e.isAllday||e.category==="time"&&Number(e.end)-Number(e.start)>at}function Yu(e){const{model:t}=e;return Wu(t)?"allday":t.category}function Ia(e,t){Na(t.getStarts(),t.getEnds()).forEach(o=>{const r=pe(o,"YYYYMMDD");(e[r]=e[r]||[]).push(t.cid())})}function Ma(e,t){const n=t.cid();Object.values(e).forEach(o=>{const r=o.indexOf(n);~r&&o.splice(r,1)})}function Vu(e,t){return e.events.add(t),Ia(e.idsOfDay,t),t}function ju(e,t){const n=new ii(t);return Vu(e,n)}function Xu(e,t=[]){return t.map(n=>ju(e,n))}function Ku(e,t,n,o){const{idsOfDay:r}=e,i=e.events.find(s=>Bu(s,t,n));return i?(i.init(R(R({},i),o)),Ma(r,i),Ia(r,i),!0):!1}function qu(e,t){return Ma(e.idsOfDay,t),e.events.remove(t),t}function Zu(e){e.idsOfDay={},e.events.clear()}function Ju(e=[]){return{calendar:{calendars:e,events:Qt(),idsOfDay:{}}}}function Qu(e){return{createEvents:t=>e(J(n=>{Xu(n.calendar,t)})),updateEvent:({event:t,eventData:n})=>e(J(o=>{Ku(o.calendar,t.id,t.calendarId,n)})),deleteEvent:t=>e(J(n=>{qu(n.calendar,t)})),clearEvents:()=>e(J(t=>{Zu(t.calendar)})),setCalendars:t=>e(J(n=>{n.calendar.calendars=t})),setCalendarColor:(t,n)=>e(J(o=>{const r=o.calendar.calendars.map(a=>a.id===t?R(R({},a),n):a),i=o.calendar.events.toArray().map(a=>{var c,u,l,f;return a.calendarId===t&&(a.color=(c=n.color)!=null?c:a.color,a.backgroundColor=(u=n.backgroundColor)!=null?u:a.backgroundColor,a.borderColor=(l=n.borderColor)!=null?l:a.borderColor,a.dragBackgroundColor=(f=n.dragBackgroundColor)!=null?f:a.dragBackgroundColor),a}),s=Qt(...i);o.calendar.calendars=r,o.calendar.events=s})),setCalendarVisibility:(t,n)=>e(J(o=>{const r=o.calendar.events.toArray();o.calendar.events=Qt(...r.map(i=>(t.includes(i.calendarId)&&(i.isVisible=n),i)))}))}}var We=(e=>(e[e.IDLE=0]="IDLE",e[e.INIT=1]="INIT",e[e.DRAGGING=2]="DRAGGING",e[e.CANCELED=3]="CANCELED",e))(We||{});function Nr(){return{dnd:{draggingItemType:null,draggingState:0,initX:null,initY:null,x:null,y:null,draggingEventUIModel:null}}}function ed(e){return{initDrag:t=>{e(J(n=>{n.dnd=ce(R(R({},n.dnd),t),{draggingState:1})}))},setDragging:t=>{e(J(n=>{n.dnd=ce(R(R({},n.dnd),t),{draggingState:2})}))},cancelDrag:()=>{e(J(t=>{t.dnd=Nr().dnd,t.dnd.draggingState=3}))},reset:()=>{e(J(t=>{t.dnd=Nr().dnd}))},setDraggingEventUIModel:t=>{e(J(n=>{var o;n.dnd.draggingEventUIModel=(o=t==null?void 0:t.clone())!=null?o:null}))}}}function Aa(){return{gridSelection:{dayGridMonth:null,dayGridWeek:null,timeGrid:null,accumulated:{dayGridMonth:[]}}}}function td(e){return{setGridSelection:(t,n)=>{e(J(o=>{o.gridSelection[t]=n}))},addGridSelection:(t,n)=>{e(J(o=>{t==="dayGridMonth"&&n&&(o.gridSelection.accumulated[t]=[...o.gridSelection.accumulated[t],n],o.gridSelection.dayGridMonth=null)}))},clearAll:()=>e(J(t=>{t.gridSelection=Aa().gridSelection}))}}const Ir=3,Ao=-1;function jn(e,t,n){return Object.keys(e).reduce((o,r)=>r===t?o:o-e[r].height-Ir,n)}function nd(){return{layout:500,weekViewLayout:{lastPanelType:null,dayGridRows:{},selectedDuplicateEventCid:Ao}}}function od(e){return{setLastPanelType:t=>{e(J(n=>{n.weekViewLayout.lastPanelType=t,t&&(n.weekViewLayout.dayGridRows[t].height=jn(n.weekViewLayout.dayGridRows,t,n.layout))}))},updateLayoutHeight:t=>e(J(n=>{const{lastPanelType:o}=n.weekViewLayout;n.layout=t,o&&(n.weekViewLayout.dayGridRows[o].height=jn(n.weekViewLayout.dayGridRows,o,t))})),updateDayGridRowHeight:({rowName:t,height:n})=>e(J(o=>{const{lastPanelType:r}=o.weekViewLayout;o.weekViewLayout.dayGridRows[t]={height:n},r&&(o.weekViewLayout.dayGridRows[r].height=jn(o.weekViewLayout.dayGridRows,r,o.layout))})),updateDayGridRowHeightByDiff:({rowName:t,diff:n})=>e(J(o=>{var r,i,s;const{lastPanelType:a}=o.weekViewLayout,c=(s=(i=(r=o.weekViewLayout.dayGridRows)==null?void 0:r[t])==null?void 0:i.height)!=null?s:Jt;o.weekViewLayout.dayGridRows[t]={height:c+n},a&&(o.weekViewLayout.dayGridRows[a].height=jn(o.weekViewLayout.dayGridRows,a,o.layout))})),setSelectedDuplicateEventCid:t=>e(J(n=>{n.weekViewLayout.selectedDuplicateEventCid=t!=null?t:Ao}))}}function Ro(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Ra=["sun","mon","tue","wed","thu","fri","sat"],Eo=e=>Ra[e];function Pa(e,t){return e.map(n=>{const o=n.getDay(),r=t.length>0?t[o]:Ro(Eo(o));return{date:n.getDate(),day:n.getDay(),dayName:r,isToday:!0,renderDate:"date",dateInstance:n}})}function xa(e){if(!e)return!1;const t={getDuplicateEvents:(n,o)=>o.filter(r=>r.title===n.title&&vt(r.start,n.start)===0&&vt(r.end,n.end)===0).sort((r,i)=>r.calendarId>i.calendarId?1:-1),getMainEvent:n=>it(n)};return Zr(e)?t:R(R({},t),e)}function rd(e={}){const t=R({startDayOfWeek:rn.SUN,dayNames:[],narrowWeekend:!1,workweek:!1,showNowIndicator:!0,showTimezoneCollapseButton:!1,timezonesCollapsed:!1,hourStart:0,hourEnd:24,eventView:!0,taskView:!0,collapseDuplicateEvents:!1},e);return t.collapseDuplicateEvents=xa(t.collapseDuplicateEvents),t}function id(e={}){return R({zones:[]},e)}function sd(e={}){const t=R({dayNames:[],visibleWeeksCount:0,workweek:!1,narrowWeekend:!1,startDayOfWeek:rn.SUN,isAlways6Weeks:!0,visibleEventCount:6},e);return t.dayNames.length===0&&(t.dayNames=Ra.slice()),t}function Oa(e){return Zr(e)?{enableDblClick:e,enableClick:e}:R({enableDblClick:!0,enableClick:!0},e)}const ad=e=>!!e.isVisible;function ld(e={}){var t,n,o,r,i,s;return{options:{defaultView:(t=e.defaultView)!=null?t:"week",useFormPopup:(n=e.useFormPopup)!=null?n:!1,useDetailPopup:(o=e.useDetailPopup)!=null?o:!1,isReadOnly:(r=e.isReadOnly)!=null?r:!1,week:rd(e.week),month:sd(e.month),gridSelection:Oa(e.gridSelection),usageStatistics:(i=e.usageStatistics)!=null?i:!0,eventFilter:(s=e.eventFilter)!=null?s:ad,timezone:id(e.timezone)}}}function cd(e){return{setOptions:(t={})=>e(J(n=>{var o;t.gridSelection&&(t.gridSelection=Oa(t.gridSelection)),(o=t.week)!=null&&o.collapseDuplicateEvents&&(t.week.collapseDuplicateEvents=xa(t.week.collapseDuplicateEvents)),Ue(n.options,t)}))}}var Po=(e=>(e.SeeMore="seeMore",e.Form="form",e.Detail="detail",e))(Po||{});function ud(){return{popup:{seeMore:null,form:null,detail:null}}}function dd(e){return{showSeeMorePopup:t=>e(J(n=>{n.popup.seeMore=t,n.popup.form=null,n.popup.detail=null})),showFormPopup:t=>e(J(n=>{n.popup.form=t,n.popup.seeMore=null,n.popup.detail=null})),showDetailPopup:(t,n)=>e(J(o=>{o.popup.detail=t,o.popup.form=null,n||(o.popup.seeMore=null)})),hideSeeMorePopup:()=>e(J(t=>{t.popup.seeMore=null})),hideFormPopup:()=>e(J(t=>{t.popup.form=null})),hideDetailPopup:()=>e(J(t=>{t.popup.detail=null})),hideAllPopup:()=>e(J(t=>{t.popup.seeMore=null,t.popup.form=null,t.popup.detail=null}))}}const At=()=>{},fd=/^auto$|^$|%/;function Cs(e,t){let n=e.style[t];if((!n||n==="auto")&&document.defaultView){const o=document.defaultView.getComputedStyle(e,null);n=o?o[t]:null}return n==="auto"?null:n}function ks(e){return be(e)?fd.test(e):e===null}function La(e){const t=Cs(e,"width"),n=Cs(e,"height");if((ks(t)||ks(n))&&e.getBoundingClientRect){const{width:o,height:r}=e.getBoundingClientRect();return{width:o||e.offsetWidth,height:r||e.offsetHeight}}return{width:parseFloat(t!=null?t:"0"),height:parseFloat(n!=null?n:"0")}}const pd=typeof Element=="undefined"?At:Element,dr=pd.prototype;dr.matches||dr.webkitMatchesSelector||dr.msMatchesSelector;function Xn(e){return e.replace(/<([^>]+)>/gi,"")}const Wt=60,md={milestone(e){const t=_("icon","ic-milestone");return d(Me,null,d("span",{className:t}),d("span",{style:{backgroundColor:e.backgroundColor}},Xn(e.title)))},milestoneTitle(){return d("span",{className:_("left-content")},"Milestone")},task(e){return`#${e.title}`},taskTitle(){return d("span",{className:_("left-content")},"Task")},alldayTitle(){return d("span",{className:_("left-content")},"All Day")},allday(e){return Xn(e.title)},time(e){const{start:t,title:n}=e;return t?d("span",null,d("strong",null,pe(t,"HH:mm")),"\xA0",d("span",null,Xn(n))):Xn(n)},goingDuration(e){const{goingDuration:t}=e,n=Math.floor(t/Wt),o=t%Wt;return`GoingTime ${Ne(n,2)}:${Ne(o,2)}`},comingDuration(e){const{comingDuration:t}=e,n=Math.floor(t/Wt),o=t%Wt;return`ComingTime ${Ne(n,2)}:${Ne(o,2)}`},monthMoreTitleDate(e){const{date:t,day:n}=e,o=_("more-title-date"),r=_("more-title-day"),i=Ro(Eo(n));return d(Me,null,d("span",{className:o},t),d("span",{className:r},i))},monthMoreClose(){return""},monthGridHeader(e){const t=parseInt(e.date.split("-")[2],10),n=_("weekday-grid-date",{"weekday-grid-date-decorator":e.isToday});return d("span",{className:n},t)},monthGridHeaderExceed(e){const t=_("weekday-grid-more-events");return d("span",{className:t},e," more")},monthGridFooter(e){return""},monthGridFooterExceed(e){return""},monthDayName(e){return e.label},weekDayName(e){const t=_("day-name__date"),n=_("day-name__name");return d(Me,null,d("span",{className:t},e.date),"\xA0\xA0",d("span",{className:n},e.dayName))},weekGridFooterExceed(e){return`+${e}`},collapseBtnTitle(){const e=_("collapse-btn-icon");return d("span",{className:e})},timezoneDisplayLabel({displayLabel:e,timezoneOffset:t}){if(Y(e)&&P(t)){const n=t<0?"-":"+",o=Math.abs(t/Wt),r=Math.abs(t%Wt);return`GMT${n}${Ne(o,2)}:${Ne(r,2)}`}return e},timegridDisplayPrimaryTime(e){const{time:t}=e;return pe(t,"hh tt")},timegridDisplayTime(e){const{time:t}=e;return pe(t,"HH:mm")},timegridNowIndicatorLabel(e){const{time:t,format:n="HH:mm"}=e;return pe(t,n)},popupIsAllday(){return"All day"},popupStateFree(){return"Free"},popupStateBusy(){return"Busy"},titlePlaceholder(){return"Subject"},locationPlaceholder(){return"Location"},startDatePlaceholder(){return"Start date"},endDatePlaceholder(){return"End date"},popupSave(){return"Save"},popupUpdate(){return"Update"},popupEdit(){return"Edit"},popupDelete(){return"Delete"},popupDetailTitle({title:e}){return e},popupDetailDate({isAllday:e,start:t,end:n}){const o="YYYY.MM.DD",r="hh:mm tt",i=`${o} ${r}`,s=pe(t,e?o:r),a=Nt(t,n)?r:i;return e?`${s}${Nt(t,n)?"":` - ${pe(n,o)}`}`:`${pe(t,i)} - ${pe(n,a)}`},popupDetailLocation({location:e}){return e},popupDetailAttendees({attendees:e=[]}){return e.join(", ")},popupDetailState({state:e}){return e||"Busy"},popupDetailRecurrenceRule({recurrenceRule:e}){return e},popupDetailBody({body:e}){return e}};function hd(e={}){return{template:R(R({},md),e)}}function gd(e){return{setTemplate:t=>e(J(n=>{n.template=R(R({},n.template),t)}))}}function vd(e="week"){const t=new O;return t.setHours(0,0,0,0),{view:{currentView:e,renderDate:t}}}function _d(e){return{changeView:t=>e(J(n=>{n.view.currentView=t})),setRenderDate:t=>e(J(n=>{n.view.renderDate=he(t)}))}}const yd=Le(window)||!window.navigator,Ns=yd?oe:ht;function Ha(){const e=ko(null);function t({children:r,store:i}){return d(e.Provider,{value:i,children:r})}return{StoreProvider:t,useStore:(r,i=Object.is)=>{const s=Nn(e);if(Y(s))throw new Error("StoreProvider is not found");const[,a]=Fr(E=>E+1,0),c=s.getState(),u=te(c),l=te(r),f=te(i),p=te(!1),m=te();Le(m.current)&&(m.current=r(c));let h,w=!1;(u.current!==c||l.current!==r||f.current!==i||p.current)&&(h=r(c),w=!i(m.current,h)),Ns(()=>{w&&(m.current=h),u.current=c,l.current=r,f.current=i,p.current=!1});const y=te(c);return Ns(()=>{const E=()=>{try{const C=s.getState(),S=l.current(C);!f.current(m.current,S)&&(u.current=C,m.current=h,a())}catch(C){console.error("[toastui-calendar] failed to update state",C==null?void 0:C.message),p.current=!0,a()}},D=s.subscribe(E);return s.getState()!==y.current&&E(),D},[]),w?h:m.current},useInternalStore:()=>{const r=Nn(e);if(Y(r))throw new Error("StoreProvider is not found");return U(()=>r,[r])}}}function $a(e){let t;const n=new Set,o=c=>{const u=c(t);if(u!==t){const l=t;t=R(R({},t),u),n.forEach(f=>f(t,l))}},r=()=>t,a={setState:o,getState:r,subscribe:(c,u,l)=>{let f=c;if(u){let p=u(t);const m=l!=null?l:Object.is;f=()=>{const h=u(t);if(!m(p,h)){const w=p;p=h,c(p,w)}}}return n.add(f),()=>n.delete(f)},clearListeners:()=>n.clear()};return t=e(o,r,a),a}const wd=e=>t=>ce(R(R(R(R(R(R(R(R({},ld(e)),hd(e.template)),ud()),nd()),Ju(e.calendars)),vd(e.defaultView)),Nr()),Aa()),{dispatch:{options:cd(t),popup:dd(t),weekViewLayout:od(t),calendar:Qu(t),view:_d(t),dnd:ed(t),gridSelection:td(t),template:gd(t)}}),Ed=(e={})=>$a(wd(e)),{StoreProvider:Dd,useStore:F,useInternalStore:Ga}=Ha();function ye(e){return F(Q(t=>e?t.dispatch[e]:t.dispatch,[e]))}function yt(e){return t=>t[e]}const xo=yt("calendar"),Ba=yt("weekViewLayout"),Fa=yt("template"),an=yt("view"),Ye=yt("options"),Rt=yt("dnd");var Mr={exports:{}};/*! @license DOMPurify 2.3.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.8/LICENSE */(function(e,t){(function(n,o){e.exports=o()})(Fc,function(){function n(I){return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},n(I)}function o(I,A){return o=Object.setPrototypeOf||function(Z,de){return Z.__proto__=de,Z},o(I,A)}function r(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function i(I,A,j){return r()?i=Reflect.construct:i=function(de,Ht,dt){var ft=[null];ft.push.apply(ft,Ht);var fn=Function.bind.apply(de,ft),pn=new fn;return dt&&o(pn,dt.prototype),pn},i.apply(null,arguments)}function s(I){return a(I)||c(I)||u(I)||f()}function a(I){if(Array.isArray(I))return l(I)}function c(I){if(typeof Symbol!="undefined"&&I[Symbol.iterator]!=null||I["@@iterator"]!=null)return Array.from(I)}function u(I,A){if(!!I){if(typeof I=="string")return l(I,A);var j=Object.prototype.toString.call(I).slice(8,-1);if(j==="Object"&&I.constructor&&(j=I.constructor.name),j==="Map"||j==="Set")return Array.from(I);if(j==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(j))return l(I,A)}}function l(I,A){(A==null||A>I.length)&&(A=I.length);for(var j=0,Z=new Array(A);j<A;j++)Z[j]=I[j];return Z}function f(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var p=Object.hasOwnProperty,m=Object.setPrototypeOf,h=Object.isFrozen,w=Object.getPrototypeOf,v=Object.getOwnPropertyDescriptor,y=Object.freeze,E=Object.seal,D=Object.create,C=typeof Reflect!="undefined"&&Reflect,S=C.apply,N=C.construct;S||(S=function(A,j,Z){return A.apply(j,Z)}),y||(y=function(A){return A}),E||(E=function(A){return A}),N||(N=function(A,j){return i(A,s(j))});var M=z(Array.prototype.forEach),H=z(Array.prototype.pop),x=z(Array.prototype.push),W=z(String.prototype.toLowerCase),B=z(String.prototype.match),ee=z(String.prototype.replace),q=z(String.prototype.indexOf),T=z(String.prototype.trim),k=z(RegExp.prototype.test),X=me(TypeError);function z(I){return function(A){for(var j=arguments.length,Z=new Array(j>1?j-1:0),de=1;de<j;de++)Z[de-1]=arguments[de];return S(I,A,Z)}}function me(I){return function(){for(var A=arguments.length,j=new Array(A),Z=0;Z<A;Z++)j[Z]=arguments[Z];return N(I,j)}}function V(I,A){m&&m(I,null);for(var j=A.length;j--;){var Z=A[j];if(typeof Z=="string"){var de=W(Z);de!==Z&&(h(A)||(A[j]=de),Z=de)}I[Z]=!0}return I}function ue(I){var A=D(null),j;for(j in I)S(p,I,[j])&&(A[j]=I[j]);return A}function He(I,A){for(;I!==null;){var j=v(I,A);if(j){if(j.get)return z(j.get);if(typeof j.value=="function")return z(j.value)}I=w(I)}function Z(de){return console.warn("fallback value for",de),null}return Z}var ct=y(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Qe=y(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ae=y(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Re=y(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ve=y(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),Et=y(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),xt=y(["#text"]),Ot=y(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),ut=y(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Lt=y(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Hn=y(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Bl=E(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Fl=E(/<%[\w\W]*|[\w\W]*%>/gm),Ul=E(/^data-[\-\w.\u00B7-\uFFFF]/),zl=E(/^aria-[\-\w]+$/),Wl=E(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Yl=E(/^(?:\w+script|data):/i),Vl=E(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),jl=E(/^html$/i),Xl=function(){return typeof window=="undefined"?null:window},Kl=function(A,j){if(n(A)!=="object"||typeof A.createPolicy!="function")return null;var Z=null,de="data-tt-policy-suffix";j.currentScript&&j.currentScript.hasAttribute(de)&&(Z=j.currentScript.getAttribute(de));var Ht="dompurify"+(Z?"#"+Z:"");try{return A.createPolicy(Ht,{createHTML:function(ft){return ft}})}catch{return console.warn("TrustedTypes policy "+Ht+" could not be created."),null}};function ki(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Xl(),A=function(g){return ki(g)};if(A.version="2.3.8",A.removed=[],!I||!I.document||I.document.nodeType!==9)return A.isSupported=!1,A;var j=I.document,Z=I.document,de=I.DocumentFragment,Ht=I.HTMLTemplateElement,dt=I.Node,ft=I.Element,fn=I.NodeFilter,pn=I.NamedNodeMap,Zl=pn===void 0?I.NamedNodeMap||I.MozNamedAttrMap:pn,Jl=I.HTMLFormElement,Ql=I.DOMParser,ec=I.trustedTypes,$n=ft.prototype,tc=He($n,"cloneNode"),nc=He($n,"nextSibling"),oc=He($n,"childNodes"),Bo=He($n,"parentNode");if(typeof Ht=="function"){var Fo=Z.createElement("template");Fo.content&&Fo.content.ownerDocument&&(Z=Fo.content.ownerDocument)}var pt=Kl(ec,j),Ni=pt?pt.createHTML(""):"",Gn=Z,Uo=Gn.implementation,rc=Gn.createNodeIterator,ic=Gn.createDocumentFragment,sc=Gn.getElementsByTagName,ac=j.importNode,Ii={};try{Ii=ue(Z).documentMode?Z.documentMode:{}}catch{}var je={};A.isSupported=typeof Bo=="function"&&Uo&&typeof Uo.createHTMLDocument!="undefined"&&Ii!==9;var zo=Bl,Wo=Fl,lc=Ul,cc=zl,uc=Yl,Mi=Vl,Yo=Wl,ge=null,Ai=V({},[].concat(s(ct),s(Qe),s(ae),s(Ve),s(xt))),we=null,Ri=V({},[].concat(s(Ot),s(ut),s(Lt),s(Hn))),fe=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),mn=null,Vo=null,Pi=!0,jo=!0,xi=!1,$t=!1,Dt=!1,Xo=!1,Ko=!1,Gt=!1,Bn=!1,Fn=!1,Oi=!0,qo=!0,hn=!1,Bt={},Ft=null,Li=V({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Hi=null,$i=V({},["audio","video","img","source","image","track"]),Zo=null,Gi=V({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Jo="http://www.w3.org/1998/Math/MathML",Qo="http://www.w3.org/2000/svg",mt="http://www.w3.org/1999/xhtml",Un=mt,er=!1,Ut,dc=["application/xhtml+xml","text/html"],fc="text/html",St,zt=null,pc=Z.createElement("form"),Bi=function(g){return g instanceof RegExp||g instanceof Function},tr=function(g){zt&&zt===g||((!g||n(g)!=="object")&&(g={}),g=ue(g),ge="ALLOWED_TAGS"in g?V({},g.ALLOWED_TAGS):Ai,we="ALLOWED_ATTR"in g?V({},g.ALLOWED_ATTR):Ri,Zo="ADD_URI_SAFE_ATTR"in g?V(ue(Gi),g.ADD_URI_SAFE_ATTR):Gi,Hi="ADD_DATA_URI_TAGS"in g?V(ue($i),g.ADD_DATA_URI_TAGS):$i,Ft="FORBID_CONTENTS"in g?V({},g.FORBID_CONTENTS):Li,mn="FORBID_TAGS"in g?V({},g.FORBID_TAGS):{},Vo="FORBID_ATTR"in g?V({},g.FORBID_ATTR):{},Bt="USE_PROFILES"in g?g.USE_PROFILES:!1,Pi=g.ALLOW_ARIA_ATTR!==!1,jo=g.ALLOW_DATA_ATTR!==!1,xi=g.ALLOW_UNKNOWN_PROTOCOLS||!1,$t=g.SAFE_FOR_TEMPLATES||!1,Dt=g.WHOLE_DOCUMENT||!1,Gt=g.RETURN_DOM||!1,Bn=g.RETURN_DOM_FRAGMENT||!1,Fn=g.RETURN_TRUSTED_TYPE||!1,Ko=g.FORCE_BODY||!1,Oi=g.SANITIZE_DOM!==!1,qo=g.KEEP_CONTENT!==!1,hn=g.IN_PLACE||!1,Yo=g.ALLOWED_URI_REGEXP||Yo,Un=g.NAMESPACE||mt,g.CUSTOM_ELEMENT_HANDLING&&Bi(g.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(fe.tagNameCheck=g.CUSTOM_ELEMENT_HANDLING.tagNameCheck),g.CUSTOM_ELEMENT_HANDLING&&Bi(g.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(fe.attributeNameCheck=g.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),g.CUSTOM_ELEMENT_HANDLING&&typeof g.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(fe.allowCustomizedBuiltInElements=g.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ut=dc.indexOf(g.PARSER_MEDIA_TYPE)===-1?Ut=fc:Ut=g.PARSER_MEDIA_TYPE,St=Ut==="application/xhtml+xml"?function(b){return b}:W,$t&&(jo=!1),Bn&&(Gt=!0),Bt&&(ge=V({},s(xt)),we=[],Bt.html===!0&&(V(ge,ct),V(we,Ot)),Bt.svg===!0&&(V(ge,Qe),V(we,ut),V(we,Hn)),Bt.svgFilters===!0&&(V(ge,ae),V(we,ut),V(we,Hn)),Bt.mathMl===!0&&(V(ge,Ve),V(we,Lt),V(we,Hn))),g.ADD_TAGS&&(ge===Ai&&(ge=ue(ge)),V(ge,g.ADD_TAGS)),g.ADD_ATTR&&(we===Ri&&(we=ue(we)),V(we,g.ADD_ATTR)),g.ADD_URI_SAFE_ATTR&&V(Zo,g.ADD_URI_SAFE_ATTR),g.FORBID_CONTENTS&&(Ft===Li&&(Ft=ue(Ft)),V(Ft,g.FORBID_CONTENTS)),qo&&(ge["#text"]=!0),Dt&&V(ge,["html","head","body"]),ge.table&&(V(ge,["tbody"]),delete mn.tbody),y&&y(g),zt=g)},Fi=V({},["mi","mo","mn","ms","mtext"]),Ui=V({},["foreignobject","desc","title","annotation-xml"]),mc=V({},["title","style","font","a","script"]),zn=V({},Qe);V(zn,ae),V(zn,Re);var nr=V({},Ve);V(nr,Et);var hc=function(g){var b=Bo(g);(!b||!b.tagName)&&(b={namespaceURI:mt,tagName:"template"});var L=W(g.tagName),re=W(b.tagName);return g.namespaceURI===Qo?b.namespaceURI===mt?L==="svg":b.namespaceURI===Jo?L==="svg"&&(re==="annotation-xml"||Fi[re]):Boolean(zn[L]):g.namespaceURI===Jo?b.namespaceURI===mt?L==="math":b.namespaceURI===Qo?L==="math"&&Ui[re]:Boolean(nr[L]):g.namespaceURI===mt?b.namespaceURI===Qo&&!Ui[re]||b.namespaceURI===Jo&&!Fi[re]?!1:!nr[L]&&(mc[L]||!zn[L]):!1},et=function(g){x(A.removed,{element:g});try{g.parentNode.removeChild(g)}catch{try{g.outerHTML=Ni}catch{g.remove()}}},zi=function(g,b){try{x(A.removed,{attribute:b.getAttributeNode(g),from:b})}catch{x(A.removed,{attribute:null,from:b})}if(b.removeAttribute(g),g==="is"&&!we[g])if(Gt||Bn)try{et(b)}catch{}else try{b.setAttribute(g,"")}catch{}},Wi=function(g){var b,L;if(Ko)g="<remove></remove>"+g;else{var re=B(g,/^[\r\n\t ]+/);L=re&&re[0]}Ut==="application/xhtml+xml"&&(g='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+g+"</body></html>");var ke=pt?pt.createHTML(g):g;if(Un===mt)try{b=new Ql().parseFromString(ke,Ut)}catch{}if(!b||!b.documentElement){b=Uo.createDocument(Un,"template",null);try{b.documentElement.innerHTML=er?"":ke}catch{}}var Te=b.body||b.documentElement;return g&&L&&Te.insertBefore(Z.createTextNode(L),Te.childNodes[0]||null),Un===mt?sc.call(b,Dt?"html":"body")[0]:Dt?b.documentElement:Te},Yi=function(g){return rc.call(g.ownerDocument||g,g,fn.SHOW_ELEMENT|fn.SHOW_COMMENT|fn.SHOW_TEXT,null,!1)},gc=function(g){return g instanceof Jl&&(typeof g.nodeName!="string"||typeof g.textContent!="string"||typeof g.removeChild!="function"||!(g.attributes instanceof Zl)||typeof g.removeAttribute!="function"||typeof g.setAttribute!="function"||typeof g.namespaceURI!="string"||typeof g.insertBefore!="function")},gn=function(g){return n(dt)==="object"?g instanceof dt:g&&n(g)==="object"&&typeof g.nodeType=="number"&&typeof g.nodeName=="string"},tt=function(g,b,L){!je[g]||M(je[g],function(re){re.call(A,b,L,zt)})},Vi=function(g){var b;if(tt("beforeSanitizeElements",g,null),gc(g)||k(/[\u0080-\uFFFF]/,g.nodeName))return et(g),!0;var L=St(g.nodeName);if(tt("uponSanitizeElement",g,{tagName:L,allowedTags:ge}),g.hasChildNodes()&&!gn(g.firstElementChild)&&(!gn(g.content)||!gn(g.content.firstElementChild))&&k(/<[/\w]/g,g.innerHTML)&&k(/<[/\w]/g,g.textContent)||L==="select"&&k(/<template/i,g.innerHTML))return et(g),!0;if(!ge[L]||mn[L]){if(!mn[L]&&Xi(L)&&(fe.tagNameCheck instanceof RegExp&&k(fe.tagNameCheck,L)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(L)))return!1;if(qo&&!Ft[L]){var re=Bo(g)||g.parentNode,ke=oc(g)||g.childNodes;if(ke&&re)for(var Te=ke.length,Ee=Te-1;Ee>=0;--Ee)re.insertBefore(tc(ke[Ee],!0),nc(g))}return et(g),!0}return g instanceof ft&&!hc(g)||(L==="noscript"||L==="noembed")&&k(/<\/no(script|embed)/i,g.innerHTML)?(et(g),!0):($t&&g.nodeType===3&&(b=g.textContent,b=ee(b,zo," "),b=ee(b,Wo," "),g.textContent!==b&&(x(A.removed,{element:g.cloneNode()}),g.textContent=b)),tt("afterSanitizeElements",g,null),!1)},ji=function(g,b,L){if(Oi&&(b==="id"||b==="name")&&(L in Z||L in pc))return!1;if(!(jo&&!Vo[b]&&k(lc,b))){if(!(Pi&&k(cc,b))){if(!we[b]||Vo[b]){if(!(Xi(g)&&(fe.tagNameCheck instanceof RegExp&&k(fe.tagNameCheck,g)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(g))&&(fe.attributeNameCheck instanceof RegExp&&k(fe.attributeNameCheck,b)||fe.attributeNameCheck instanceof Function&&fe.attributeNameCheck(b))||b==="is"&&fe.allowCustomizedBuiltInElements&&(fe.tagNameCheck instanceof RegExp&&k(fe.tagNameCheck,L)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(L))))return!1}else if(!Zo[b]){if(!k(Yo,ee(L,Mi,""))){if(!((b==="src"||b==="xlink:href"||b==="href")&&g!=="script"&&q(L,"data:")===0&&Hi[g])){if(!(xi&&!k(uc,ee(L,Mi,"")))){if(L)return!1}}}}}}return!0},Xi=function(g){return g.indexOf("-")>0},Ki=function(g){var b,L,re,ke;tt("beforeSanitizeAttributes",g,null);var Te=g.attributes;if(!!Te){var Ee={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:we};for(ke=Te.length;ke--;){b=Te[ke];var Wn=b,Ce=Wn.name,qi=Wn.namespaceURI;if(L=Ce==="value"?b.value:T(b.value),re=St(Ce),Ee.attrName=re,Ee.attrValue=L,Ee.keepAttr=!0,Ee.forceKeepAttr=void 0,tt("uponSanitizeAttribute",g,Ee),L=Ee.attrValue,!Ee.forceKeepAttr&&(zi(Ce,g),!!Ee.keepAttr)){if(k(/\/>/i,L)){zi(Ce,g);continue}$t&&(L=ee(L,zo," "),L=ee(L,Wo," "));var _c=St(g.nodeName);if(!!ji(_c,re,L))try{qi?g.setAttributeNS(qi,Ce,L):g.setAttribute(Ce,L),H(A.removed)}catch{}}}tt("afterSanitizeAttributes",g,null)}},vc=function G(g){var b,L=Yi(g);for(tt("beforeSanitizeShadowDOM",g,null);b=L.nextNode();)tt("uponSanitizeShadowNode",b,null),!Vi(b)&&(b.content instanceof de&&G(b.content),Ki(b));tt("afterSanitizeShadowDOM",g,null)};return A.sanitize=function(G,g){var b,L,re,ke,Te;if(er=!G,er&&(G="<!-->"),typeof G!="string"&&!gn(G)){if(typeof G.toString!="function")throw X("toString is not a function");if(G=G.toString(),typeof G!="string")throw X("dirty is not a string, aborting")}if(!A.isSupported){if(n(I.toStaticHTML)==="object"||typeof I.toStaticHTML=="function"){if(typeof G=="string")return I.toStaticHTML(G);if(gn(G))return I.toStaticHTML(G.outerHTML)}return G}if(Xo||tr(g),A.removed=[],typeof G=="string"&&(hn=!1),hn){if(G.nodeName){var Ee=St(G.nodeName);if(!ge[Ee]||mn[Ee])throw X("root node is forbidden and cannot be sanitized in-place")}}else if(G instanceof dt)b=Wi("<!---->"),L=b.ownerDocument.importNode(G,!0),L.nodeType===1&&L.nodeName==="BODY"||L.nodeName==="HTML"?b=L:b.appendChild(L);else{if(!Gt&&!$t&&!Dt&&G.indexOf("<")===-1)return pt&&Fn?pt.createHTML(G):G;if(b=Wi(G),!b)return Gt?null:Fn?Ni:""}b&&Ko&&et(b.firstChild);for(var Wn=Yi(hn?G:b);re=Wn.nextNode();)re.nodeType===3&&re===ke||Vi(re)||(re.content instanceof de&&vc(re.content),Ki(re),ke=re);if(ke=null,hn)return G;if(Gt){if(Bn)for(Te=ic.call(b.ownerDocument);b.firstChild;)Te.appendChild(b.firstChild);else Te=b;return we.shadowroot&&(Te=ac.call(j,Te,!0)),Te}var Ce=Dt?b.outerHTML:b.innerHTML;return Dt&&ge["!doctype"]&&b.ownerDocument&&b.ownerDocument.doctype&&b.ownerDocument.doctype.name&&k(jl,b.ownerDocument.doctype.name)&&(Ce="<!DOCTYPE "+b.ownerDocument.doctype.name+`>
|
|
`+Ce),$t&&(Ce=ee(Ce,zo," "),Ce=ee(Ce,Wo," ")),pt&&Fn?pt.createHTML(Ce):Ce},A.setConfig=function(G){tr(G),Xo=!0},A.clearConfig=function(){zt=null,Xo=!1},A.isValidAttribute=function(G,g,b){zt||tr({});var L=St(G),re=St(g);return ji(L,re,b)},A.addHook=function(G,g){typeof g=="function"&&(je[G]=je[G]||[],x(je[G],g))},A.removeHook=function(G){if(je[G])return H(je[G])},A.removeHooks=function(G){je[G]&&(je[G]=[])},A.removeAllHooks=function(){je={}},A}var ql=ki();return ql})})(Mr);var Do=window.DOMPurify||(window.DOMPurify=Mr.exports.default||Mr.exports);const Kn="data-target-temp";function Sd(){Do.addHook("beforeSanitizeAttributes",e=>{if(e.tagName==="A"){const t=e.getAttribute("target");t?e.setAttribute(Kn,t):e.setAttribute("target","_self")}}),Do.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(Kn)&&(e.setAttribute("target",e.getAttribute(Kn)),e.removeAttribute(Kn),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener"))})}function Td(){Do.removeAllHooks()}function bd(e){return Do.sanitize(e)}function ne({template:e,param:t,as:n="div"}){var o;const i=F(Fa)[e];if(Y(i))return null;const s=i(t);return be(s)?d(n,{className:_(`template-${e}`),dangerouslySetInnerHTML:{__html:bd(s)}}):kc(s,{className:`${(o=s.props.className)!=null?o:""} ${_(`template-${e}`)}`})}const Ua=ko(null),Cd=Ua.Provider,Se=()=>{const e=Nn(Ua);if(!e)throw new Error("useEventBus must be used within a EventBusProvider");return e},Oo=e=>{var t,n,o,r,i;return(i=(r=(o=(n=(t=e.options)==null?void 0:t.timezone)==null?void 0:n.zones)==null?void 0:o[0])==null?void 0:r.timezoneName)!=null?i:"Local"},kd=e=>{var t,n;return(n=(t=e.options)==null?void 0:t.timezone)==null?void 0:n.customOffsetCalculator},za=e=>{var t;return(t=e.options.timezone.zones)!=null?t:[]};function Lo(){const e=F(kd),t=P(e);return Q((n,o=new O)=>o.tz(t?e(n,o.getTime()):n),[e,t])}function Ho(){const e=F(Oo),t=Lo(),n=Q(()=>t(e),[e,t]);return[e,n]}function Nd(e,t){return e==="week"}function Id({dayName:e,theme:t,today:n}){var o,r;const{day:i,dateInstance:s}=e,a=Nt(n,s),c=!a&&s<n;return ti(i)?t.common.holiday.color:c?(o=t.week)==null?void 0:o.pastDay.color:ni(i)?t.common.saturday.color:a?(r=t.week)==null?void 0:r.today.color:t.common.dayName.color}function Md({dayName:e,theme:t}){const{day:n}=e;return ti(n)?t.common.holiday.color:ni(n)?t.common.saturday.color:t.common.dayName.color}function Ad({dayName:e,style:t,type:n,theme:o}){const r=Se(),[,i]=Ho(),s=i(),{day:a}=e,c=n==="week"?Id({dayName:e,theme:o,today:s}):Md({dayName:e,theme:o}),u=`${n}DayName`,l=()=>{Nd(n)&&r.fire("clickDayName",{date:pe(e.dateInstance,"YYYY-MM-DD")})};return d("div",{className:_("day-name-item",n),style:t},d("span",{className:_({[`holiday-${Eo(a)}`]:Ge(a)}),style:{color:c},onClick:l,"data-testid":`dayName-${n}-${Eo(a)}`},d(ne,{template:u,param:e})))}const Wa=yt("common"),Rd=yt("month"),Ya=e=>e.week.dayGridLeft,si=e=>e.week.timeGridLeft,Pd=e=>e.month.moreView,Va=e=>e.month.gridCell,xd={border:"1px solid #e5e5e5",backgroundColor:"white",holiday:{color:"#ff4040"},saturday:{color:"#333"},dayName:{color:"#333"},today:{color:"#fff"},gridSelection:{backgroundColor:"rgba(81, 92, 230, 0.05)",border:"1px solid #515ce6"}},Od={dayName:{borderLeft:"none",borderTop:"1px solid #e5e5e5",borderBottom:"1px solid #e5e5e5",backgroundColor:"inherit"},weekend:{backgroundColor:"inherit"},today:{color:"inherit",backgroundColor:"rgba(81, 92, 230, 0.05)"},pastDay:{color:"#bbb"},panelResizer:{border:"1px solid #e5e5e5"},dayGrid:{borderRight:"1px solid #e5e5e5",backgroundColor:"inherit"},dayGridLeft:{borderRight:"1px solid #e5e5e5",backgroundColor:"inherit",width:"72px"},timeGrid:{borderRight:"1px solid #e5e5e5"},timeGridLeft:{backgroundColor:"inherit",borderRight:"1px solid #e5e5e5",width:"72px"},timeGridLeftAdditionalTimezone:{backgroundColor:"white"},timeGridHalfHourLine:{borderBottom:"none"},timeGridHourLine:{borderBottom:"1px solid #e5e5e5"},nowIndicatorLabel:{color:"#515ce6"},nowIndicatorPast:{border:"1px dashed #515ce6"},nowIndicatorBullet:{backgroundColor:"#515ce6"},nowIndicatorToday:{border:"1px solid #515ce6"},nowIndicatorFuture:{border:"none"},pastTime:{color:"#bbb"},futureTime:{color:"#333"},gridSelection:{color:"#515ce6"}},Ld={dayName:{borderLeft:"none",backgroundColor:"inherit"},holidayExceptThisMonth:{color:"rgba(255, 64, 64, 0.4)"},dayExceptThisMonth:{color:"rgba(51, 51, 51, 0.4)"},weekend:{backgroundColor:"inherit"},moreView:{border:"1px solid #d5d5d5",boxShadow:"0 2px 6px 0 rgba(0, 0, 0, 0.1)",backgroundColor:"white",width:null,height:null},gridCell:{headerHeight:31,footerHeight:null},moreViewTitle:{backgroundColor:"inherit"}};function Hd(e={}){return{common:Ue(xd,e)}}function $d(e){return{setTheme:t=>{e(J(n=>{n.common=Ue(n.common,t.common),n.week=Ue(n.week,t.week),n.month=Ue(n.month,t.month)}))},setCommonTheme:t=>{e(J(n=>{n.common=Ue(n.common,t)}))},setWeekTheme:t=>{e(J(n=>{n.week=Ue(n.week,t)}))},setMonthTheme:t=>{e(J(n=>{n.month=Ue(n.month,t)}))}}}function Gd(e={}){return{month:Ue(Ld,e)}}function Bd(e={}){return{week:Ue(Od,e)}}const Fd=(e={})=>t=>ce(R(R(R({},Hd(e==null?void 0:e.common)),Bd(e==null?void 0:e.week)),Gd(e==null?void 0:e.month)),{dispatch:R({},$d(t))}),Ud=(e={})=>$a(Fd(e)),{StoreProvider:zd,useInternalStore:ig,useStore:ie}=Ha();function Wd(){return ie(Wa)}function ja(){return ie(Rd)}function Yd(e){return{common:{saturday:e.common.saturday,holiday:e.common.holiday,today:e.common.today,dayName:e.common.dayName},week:{pastDay:e.week.pastDay,today:e.week.today,dayName:e.week.dayName}}}function Vd(e){return{common:{saturday:e.common.saturday,holiday:e.common.holiday,today:e.common.today,dayName:e.common.dayName},month:{dayName:e.month.dayName}}}function ai({dayNames:e,marginLeft:t=Yc,rowStyleInfo:n,type:o="month"}){var r,i;const s=ie(o==="month"?Vd:Yd),a=(i=(r=s[o])==null?void 0:r.dayName)!=null?i:{},{backgroundColor:c="white",borderLeft:u=null}=a,l=gr(a,["backgroundColor","borderLeft"]),{borderTop:f=null,borderBottom:p=null}=l;return d("div",{"data-testid":`grid-header-${o}`,className:_("day-names",o),style:{backgroundColor:c,borderTop:f,borderBottom:p}},d("div",{className:_("day-name-container"),style:{marginLeft:t}},e.map((m,h)=>d(Ad,{type:o,key:`dayNames-${m.day}`,dayName:m,style:{width:K(n[h].width),left:K(n[h].left),borderLeft:u},theme:s}))))}const jd=6;var Rn=(e=>(e.header="header",e.footer="footer",e))(Rn||{});function $o(e,t=!0){const n=[];let o;return e.length&&(n[0]=[e[0].cid()],e.slice(1).forEach((r,i)=>{o=e.slice(0,i+1).reverse();const s=o.find(a=>r.collidesWith(a,t));s?n.slice().reverse().some(a=>~a.indexOf(s.cid())?(a.push(r.cid()),!0):!1):n.push([r.cid()])})),n}function Xd(e,t){let{length:n}=e;for(;n>0;)if(n-=1,!Le(e[n][t]))return n;return-1}function Go(e,t,n=!0){const o=[];return t.forEach(r=>{const i=[[]];r.forEach(s=>{const a=e.get(s);let c=0,u=!1,l,f;for(;!u;)f=Xd(i,c),f===-1?(i[0].push(a),u=!0):a.collidesWith(i[f][c],n)||(l=f+1,Le(i[l])&&(i[l]=[]),i[l][c]=a,u=!0),c+=1}),o.push(i)}),o}function Xa(e,t){return n=>{const o=n.getStarts();return!(n.getEnds()<e||o>t)}}function Ka(e,t,n,o){const r=kr(e,t,at).map(i=>pe(i,"YYYYMMDD"));n.forEach(i=>{i.forEach(s=>{s.forEach((a,c)=>{if(!a)return;const u=pe(a.getStarts(),"YYYYMMDD"),l=kr(he(a.getStarts()),Ae(a.getEnds()),at).length;a.top=c,a.left=r.indexOf(u),a.width=l,o==null||o(a)})})})}function Is(e,t,n){return n.getStarts()<e&&(n.exceedLeft=!0,n.renderStarts=new O(e)),n.getEnds()>t&&(n.exceedRight=!0,n.renderEnds=new O(t)),n}function qa(e,t,n){return n instanceof Ze?(n.each(o=>(Is(e,t,o),!0)),null):Is(e,t,n)}function Za(e){const t=new Ze(n=>n.cid());return e.each(function(n){t.add(new Ct(n))}),t}function li({model:e}){return e.isAllday||e.hasMultiDates}function Ja(e){return!li(e)}function Kd(e){e.top=e.top||0,e.top+=1}function qd(e,t,n){n.each(o=>{(o.model.isAllday||o.model.hasMultiDates)&&qa(he(e),Ae(t),o)})}function Zd(e,t,n){const o=[];return e[t].forEach(r=>{n.doWhenHas(r,i=>{o.push(i.top)})}),o.length>0?Math.max(...o):0}function Jd(e,t){const n=t.filter(li),o=t.filter(Ja).sort(kt.compare.event.asc),r={};o.forEach(i=>{const s=pe(i.getStarts(),"YYYYMMDD");let a=r[s];Le(a)&&(a=r[s]=Zd(e,s,n)),r[s]=i.top=a+1})}function Qd(e,t){const n=t.filter(li),o=t.filter(Ja).sort(kt.compare.event.asc),r={};o.forEach(i=>{const s=pe(i.getStarts(),"YYYYMMDD");let a=r[s];if(Le(a)&&(a=r[s]=[],e[s].forEach(c=>{n.doWhenHas(c,u=>{a.push(u.top)})})),a.indexOf(i.top)>=0){const c=Math.max(...a)+1;for(let u=1;u<=c&&(i.top=u,!(a.indexOf(i.top)<0));u+=1);}a.push(i.top)})}function ef(e){e.each(t=>{const{model:n}=t,o=n.getStarts(),r=n.getEnds();n.hasMultiDates=!Nt(o,r),!n.isAllday&&n.hasMultiDates&&(t.renderStarts=he(o),t.renderEnds=Ae(r))})}function tf(e,t){const{start:n,end:o,andFilters:r=[],alldayFirstMode:i=!1}=t,{events:s,idsOfDay:a}=e,c=Ze.and(...[Xa(n,o)].concat(r)),u=s.filter(c),l=Za(u);ef(l),qd(n,o,l);const f=l.sort(kt.compare.event.asc),p=!1,m=$o(f,p),h=Go(l,m,p);return Ka(n,o,h,Kd),i?Jd(a,l):Qd(a,l),h}function nf(e,t){return n=>{const o=n.getStarts(),r=n.getEnds(),i=o.getTime(),s=r.getTime(),a=o.getFullYear(),c=o.getMonth(),u=o.getDate(),l=new O(a,c,u).setHours(e),f=new O(a,c,u).setHours(t);return i>=l&&i<f||s>l&&s<=f||i<l&&s>l||s>f&&i<f}}function of(e,t){return e===0&&t===24?n=>n.sort(kt.compare.event.asc):n=>n.filter(nf(e,t)).sort(kt.compare.event.asc)}function rf(e,t,n,o){const r={};return Na(t,n).forEach(s=>{const a=pe(s,"YYYYMMDD"),c=e[a],u=r[a]=new Ze(l=>l.cid());c&&c.length&&c.forEach(l=>{o.doWhenHas(l,f=>{u.add(f)})})},{}),r}function sf(e,t){const{start:n,end:o,uiModelTimeColl:r,hourStart:i,hourEnd:s}=t,a=rf(e,n,o,r),c={},u=of(i,s),l=!0;return Object.entries(a).forEach(([f,p])=>{const m=u(p),h=$o(m,l),w=Go(p,h,l);c[f]=w}),c}function af(e){e.each(t=>{const{model:n}=t;n.hasMultiDates=!0,t.renderStarts=he(n.getStarts()),t.renderEnds=Ae(n.getEnds())})}function lf(e,t,n){if(!n||!n.size)return[];af(n),qa(e,t,n);const o=n.sort(kt.compare.event.asc),r=!0,i=$o(o,r),s=Go(n,i,r);return Ka(e,t,s),s}function cf(e,t){var n,o;const{start:r,end:i,panels:s,andFilters:a=[],options:c}=t,{events:u,idsOfDay:l}=e,f=(n=c==null?void 0:c.hourStart)!=null?n:0,p=(o=c==null?void 0:c.hourEnd)!=null?o:24,m=Ze.and(...[Xa(r,i)].concat(a)),w=Za(u.filter(m)).groupBy(Yu);return s.reduce((v,y)=>{const{name:E,type:D}=y;return Y(w[E])?v:ce(R({},v),{[E]:D==="daygrid"?lf(r,i,w[E]):sf(l,{start:r,end:i,uiModelTimeColl:w[E],hourStart:f,hourEnd:p})})},{milestone:[],task:[],allday:[],time:{}})}function Ar(e,t,n){const o=Math.max(e,...t);return Math.min(o,...n)}function Qa(e,t,n){return t*n/e}function el(e,t,n){return t<=e&&e<=n}const Je=22,ci=100;function tl(e,t){e.forEach(n=>{n.forEach(o=>{o.forEach((r,i)=>{t(r,i)})})})}function ui(e,t){return({top:n})=>e>=n*t}function uf(e,t){return({top:n})=>e<n*t}function nl(e,t,n){return e.filter(uf(t,n)).length}const df=e=>e.filter(t=>Ge(t.getDay())).length;function di(e,t,n){const o=df(e),r=e.length,i=o===r,s=n/(t&&!i?r*2-o:r),a=e.map(u=>{const l=u.getDay();return!t||i||Ge(l)?s:s*2}),c=a.reduce((u,l,f)=>f?[...u,u[f-1]+a[f-1]]:[0],[]);return{widthList:a,leftList:c}}function So(e,t,n){return e.reduce((o,r,i)=>t<=i&&i<=n?o+r:o,0)}const ff=e=>t=>{const n=he(t.getStarts()),o=he(t.getEnds());return n<=e&&e<=o};function To(e,t){return t.findIndex(n=>e>=he(n)&&e<=Ae(n))}const pf=(e,t,n,o)=>{const{widthList:r}=di(n,o,ci);return{left:e?So(r,0,e-1):0,width:So(r,e!=null?e:0,t<0?n.length-1:t)}},ol=(e,t,n,o)=>{const{widthList:r}=di(n,o,ci);let i=0,s=n.length-1;return n.forEach((a,c)=>{a<=e&&(i=c),a<=t&&(s=c)}),{width:So(r,i,s),left:i?So(r,0,i-1):0}};function mf(e,t,n=!1){const o=e.getStarts(),r=e.getEnds(),{width:i,left:s}=ol(o,r,t,n);return e.width=i,e.left=s,e}function hf(e,t,n){const{idsOfDay:o}=t,r=tf(t,{start:e[0],end:Ae(e[e.length-1])}),i=[];tl(r,a=>{const c=a.model.cid();i[c]=mf(a,e,n)});const s=Object.keys(o).reduce((a,c)=>{const u=o[c];return a[c]=u.map(l=>i[l]).filter(l=>!!l),a},{});return{uiModels:Object.values(i),gridDateEventModelMap:s}}const gf=(e,t,n=!1)=>(tl(e,o=>{const r=o.getStarts(),i=o.getEnds(),{width:s,left:a}=ol(r,i,t,n);o.width=s,o.left=a,o.top+=1}),rl(e)),vf=e=>e.filter(t=>!!t);function rl(e){return e.flatMap(t=>t.flatMap(n=>vf(n)))}const _f=e=>Array.from(new Set(Object.values(e).reduce((t,n)=>t.concat(...rl(n)),[]))),il=(e,t,{narrowWeekend:n,hourStart:o,hourEnd:r,weekStartDate:i,weekEndDate:s})=>{const c=cf(t,{start:i,end:s,panels:[{name:"milestone",type:"daygrid",show:!0},{name:"task",type:"daygrid",show:!0},{name:"allday",type:"daygrid",show:!0},{name:"time",type:"timegrid",show:!0}],andFilters:[],options:{hourStart:o,hourEnd:r}});return Object.keys(c).reduce((u,l)=>{const f=c[l];return ce(R({},u),{[l]:Array.isArray(f)?gf(f,e,n):_f(f)})},{milestone:[],allday:[],task:[],time:[]})};function sl(e,{workweek:t=!1,visibleWeeksCount:n=0,startDayOfWeek:o=0,isAlways6Weeks:r=!0}){const i=new O(e),s=n>0,a=s?i:Ca(i),c=Hu(a,a.getDay()-o+(a.getDay()<o?Xe:0)),u=c.getDay(),l=Lu(i).getDate(),f=ri(c,a),p=l+Math.abs(f);let m=jd;return s?m=n:r===!1&&(m=Math.ceil(p/Xe)),gt(0,m).map(h=>gt(0,Xe).reduce((w,v)=>{const y=h*Xe+v,E=(y+u)%Xe;if(!t||t&&!Ge(E)){const D=It(c,y);w.push(D)}return w},[]))}function al(e,{startDayOfWeek:t=rn.SUN,workweek:n}){const o=he(e),i=o.getDay()-t;return(i>=0?gt(-i,Xe-i):gt(-Xe-i,-i)).reduce((a,c)=>{const u=It(o,c);return n&&Ge(u.getDay())||a.push(u),a},[])}function yf(e,t=!1){const n=e.length,o=n>5&&t,r=o?100/(n-1):100/n;return e.map(i=>{const s=o&&Ge(i.getDay())?r/2:r;return{date:i,width:s}}).reduce((i,s,a)=>{const c=i[a-1];return i.push(ce(R({},s),{left:a===0?0:c.left+c.width})),i},[])}function ll(e,t){var n;const o=yf(e,(n=t.narrowWeekend)!=null?n:!1),r=(t.hourEnd-t.hourStart)*2,i=100/r,s=gt(r).map((a,c)=>{const u=c%2===1,l=t.hourStart+Math.floor(a/2),f=`${l}:${u?"30":"00"}`.padStart(5,"0"),p=(u?`${l+1}:00`:`${l}:30`).padStart(5,"0");return{top:i*c,height:i,startTime:f,endTime:p}});return{columns:o,rows:s}}function wf({clientX:e,clientY:t},{left:n,top:o,clientLeft:r,clientTop:i}){return[e-n-r,t-o-i]}function Ef(e,t,n){const o=Math.floor(Qa(t,e,n));return Ar(o,[0],[e-1])}function fi({rowsCount:e,columnsCount:t,container:n,narrowWeekend:o=!1,startDayOfWeek:r=rn.SUN}){if(Y(n))return()=>null;const i=gt(r,r+t).map(a=>a%Xe),s=o?i.filter(a=>Ge(a)).length:0;return function(c){const{left:u,top:l,width:f,height:p}=n.getBoundingClientRect(),[m,h]=wf(c,{left:u,top:l,clientLeft:n.clientLeft,clientTop:n.clientTop});if(m<0||h<0||m>f||h>p)return null;const w=o?f/(t-s+1):f/t,v=i.map(D=>o&&Ge(D)?w/2:w),y=[];return v.forEach((D,C)=>{C===0?y.push(0):y.push(y[C-1]+v[C-1])}),{columnIndex:Jr(y,D=>m>=D),rowIndex:Ef(e,p,h)}}}function Df(e){return e.common.gridSelection}function pi({type:e,gridSelectionData:t,weekDates:n,narrowWeekend:o}){const{backgroundColor:r,border:i}=ie(Df),{startCellIndex:s,endCellIndex:a}=t,{left:c,width:u}=pf(Math.min(s,a),Math.max(s,a),n,o),l={left:K(c),width:K(u),height:K(100),backgroundColor:r,border:i};return u>0?d("div",{className:_(e,"grid-selection"),style:l}):null}function mi(e,t,n){return{startColumnIndex:n?t.columnIndex:e.columnIndex,startRowIndex:n?t.rowIndex:e.rowIndex,endColumnIndex:n?e.columnIndex:t.columnIndex,endRowIndex:n?e.rowIndex:t.rowIndex}}function Sf(e,t,n){if(Y(e))return null;const{startColumnIndex:o,endColumnIndex:r,endRowIndex:i,startRowIndex:s}=e;if(!el(t,o,r))return null;const u={startRowIndex:s,endRowIndex:i,isSelectingMultipleColumns:o!==r,isStartingColumn:t===o};return o<t&&t<r?(u.startRowIndex=0,u.endRowIndex=n):o!==r&&(o===t?u.endRowIndex=n:r===t&&(u.startRowIndex=0)),u}const Rr={sortSelection:(e,t)=>{const n=e.columnIndex>t.columnIndex||e.columnIndex===t.columnIndex&&e.rowIndex>t.rowIndex;return mi(e,t,n)},getDateFromCollection:(e,t)=>{const n=e,o=Ke(n.columns[t.startColumnIndex].date,n.rows[t.startRowIndex].startTime),r=Ke(n.columns[t.endColumnIndex].date,n.rows[t.endRowIndex].endTime);return[o,r]},calculateSelection:Sf};function Tf(e,t,n){if(!(P(e)&&P(t)&&P(n)))return null;const{startRowIndex:o,startColumnIndex:r,endRowIndex:i,endColumnIndex:s}=e;if(!el(t,Math.min(o,i),Math.max(o,i)))return null;let a=r,c=s;return o<t&&(a=0),i>t&&(c=n-1),{startCellIndex:a,endCellIndex:c}}const bo={sortSelection:(e,t)=>{const n=e.rowIndex>t.rowIndex||e.rowIndex===t.rowIndex&&e.columnIndex>t.columnIndex;return mi(e,t,n)},getDateFromCollection:(e,t)=>{const n=e;return[n[t.startRowIndex][t.startColumnIndex],n[t.endRowIndex][t.endColumnIndex]]},calculateSelection:Tf};function bf(e){return P(e)?{startCellIndex:e.startColumnIndex,endCellIndex:e.endColumnIndex}:null}const Pr={sortSelection:(e,t)=>{const n=e.columnIndex>t.columnIndex;return mi(e,t,n)},getDateFromCollection:(e,t)=>{const n=e;return[n[t.startColumnIndex],n[t.endColumnIndex]]},calculateSelection:bf};function Cf(e){return Pr.calculateSelection(e.gridSelection.dayGridWeek)}function kf({weekDates:e,narrowWeekend:t}){const n=F(Cf);return Y(n)?null:d(pi,{type:"allday",gridSelectionData:n,weekDates:e,narrowWeekend:t})}function cl(e,t){for(var n in t)e[n]=t[n];return e}function xr(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var o in t)if(o!=="__source"&&e[o]!==t[o])return!0;return!1}function Ms(e){this.props=e}function ln(e,t){function n(r){var i=this.props.ref,s=i==r.ref;return!s&&i&&(i.call?i(null):i.current=null),t?!t(this.props,r)||!s:xr(this.props,r)}function o(r){return this.shouldComponentUpdate=n,d(e,r)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o}(Ms.prototype=new rt).isPureReactComponent=!0,Ms.prototype.shouldComponentUpdate=function(e,t){return xr(this.props,e)||xr(this.state,t)};var As=$.__b;$.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),As&&As(e)};var Nf=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function ul(e){function t(n){var o=cl({},n);return delete o.ref,e(o,n.ref||null)}return t.$$typeof=Nf,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var If=$.__e;$.__e=function(e,t,n,o){if(e.then){for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t)}If(e,t,n,o)};var Rs=$.unmount;function fr(){this.__u=0,this.t=null,this.__b=null}function dl(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function qn(){this.u=null,this.o=null}$.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&e.__h===!0&&(e.type=null),Rs&&Rs(e)},(fr.prototype=new rt).__c=function(e,t){var n=t.__c,o=this;o.t==null&&(o.t=[]),o.t.push(n);var r=dl(o.__v),i=!1,s=function(){i||(i=!0,n.__R=null,r?r(a):a())};n.__R=s;var a=function(){if(!--o.__u){if(o.state.__a){var u=o.state.__a;o.__v.__k[0]=function f(p,m,h){return p&&(p.__v=null,p.__k=p.__k&&p.__k.map(function(w){return f(w,m,h)}),p.__c&&p.__c.__P===m&&(p.__e&&h.insertBefore(p.__e,p.__d),p.__c.__e=!0,p.__c.__P=h)),p}(u,u.__c.__P,u.__c.__O)}var l;for(o.setState({__a:o.__b=null});l=o.t.pop();)l.forceUpdate()}},c=t.__h===!0;o.__u++||c||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(s,s)},fr.prototype.componentWillUnmount=function(){this.t=[]},fr.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=function i(s,a,c){return s&&(s.__c&&s.__c.__H&&(s.__c.__H.__.forEach(function(u){typeof u.__c=="function"&&u.__c()}),s.__c.__H=null),(s=cl({},s)).__c!=null&&(s.__c.__P===c&&(s.__c.__P=a),s.__c=null),s.__k=s.__k&&s.__k.map(function(u){return i(u,a,c)})),s}(this.__b,n,o.__O=o.__P)}this.__b=null}var r=t.__a&&d(Me,null,e.fallback);return r&&(r.__h=null),[d(Me,null,t.__a?null:e.children),r]};var Ps=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function Mf(e){return this.getChildContext=function(){return e.context},e.children}function Af(e){var t=this,n=e.i;t.componentWillUnmount=function(){mo(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(o){this.childNodes.push(o),t.i.appendChild(o)},insertBefore:function(o,r){this.childNodes.push(o),t.i.appendChild(o)},removeChild:function(o){this.childNodes.splice(this.childNodes.indexOf(o)>>>1,1),t.i.removeChild(o)}}),mo(d(Mf,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function hi(e,t){var n=d(Af,{__v:e,i:t});return n.containerInfo=t,n}(qn.prototype=new rt).__a=function(e){var t=this,n=dl(t.__v),o=t.o.get(e);return o[0]++,function(r){var i=function(){t.props.revealOrder?(o.push(r),Ps(t,e,o)):r()};n?n(i):i()}},qn.prototype.render=function(e){this.u=null,this.o=new Map;var t=Cn(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},qn.prototype.componentDidUpdate=qn.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){Ps(e,n,t)})};var Rf=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,Pf=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|shape|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,xf=typeof document!="undefined",Of=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/i:/fil|che|ra/i).test(e)};rt.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(rt.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var xs=$.event;function Lf(){}function Hf(){return this.cancelBubble}function $f(){return this.defaultPrevented}$.event=function(e){return xs&&(e=xs(e)),e.persist=Lf,e.isPropagationStopped=Hf,e.isDefaultPrevented=$f,e.nativeEvent=e};var Os={configurable:!0,get:function(){return this.class}},Ls=$.vnode;$.vnode=function(e){var t=e.type,n=e.props,o=n;if(typeof t=="string"){var r=t.indexOf("-")===-1;for(var i in o={},n){var s=n[i];xf&&i==="children"&&t==="noscript"||i==="value"&&"defaultValue"in n&&s==null||(i==="defaultValue"&&"value"in n&&n.value==null?i="value":i==="download"&&s===!0?s="":/ondoubleclick/i.test(i)?i="ondblclick":/^onchange(textarea|input)/i.test(i+t)&&!Of(n.type)?i="oninput":/^onfocus$/i.test(i)?i="onfocusin":/^onblur$/i.test(i)?i="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(i)?i=i.toLowerCase():r&&Pf.test(i)?i=i.replace(/[A-Z0-9]/,"-$&").toLowerCase():s===null&&(s=void 0),/^oninput$/i.test(i)&&(i=i.toLowerCase(),o[i]&&(i="oninputCapture")),o[i]=s)}t=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=Cn(n.children).forEach(function(a){a.props.selected=o.value.indexOf(a.props.value)!=-1})),t=="select"&&o.defaultValue!=null&&(o.value=Cn(n.children).forEach(function(a){a.props.selected=o.multiple?o.defaultValue.indexOf(a.props.value)!=-1:o.defaultValue==a.props.value})),e.props=o,n.class!=n.className&&(Os.enumerable="className"in n,n.className!=null&&(o.class=n.className),Object.defineProperty(o,"className",Os))}e.$$typeof=Rf,Ls&&Ls(e)};var Hs=$.__r;$.__r=function(e){Hs&&Hs(e),e.__c};function Gf(e){return!!e.__k&&(mo(null,e),!0)}function Bf({index:e,exceedCount:t,isClicked:n,onClickExceedCount:o}){const r=()=>o(e),i={display:n?"none":""};return t&&!n?d("span",{className:_("weekday-exceed-in-week"),onClick:r,style:i},d(ne,{template:"weekGridFooterExceed",param:t})):null}function Ff({isClicked:e,isClickedIndex:t,onClickCollapseButton:n}){return e&&t?d("span",{className:_("weekday-exceed-in-week"),onClick:n},d(ne,{template:"collapseBtnTitle"})):null}function Uf({width:e,left:t,index:n,exceedCount:o,isClicked:r,onClickExceedCount:i,isClickedIndex:s,onClickCollapseButton:a,isLastCell:c}){const{borderRight:u,backgroundColor:l}=ie(Q(p=>p.week.dayGrid,[])),f={width:e,left:t,borderRight:c?"none":u,backgroundColor:l};return d("div",{className:_("panel-grid"),style:f},d(Bf,{index:n,exceedCount:o,isClicked:r,onClickExceedCount:i}),d(Ff,{isClickedIndex:s,isClicked:r,onClickCollapseButton:a}))}const fl=ln(function({uiModels:t,weekDates:n,narrowWeekend:o,height:r,clickedIndex:i,isClickedCount:s,onClickExceedCount:a,onClickCollapseButton:c}){const{widthList:l,leftList:f}=di(n,o,ci),p=n.length-1;return d(Me,null,n.map((m,h)=>{const w=K(l[h]),v=K(f[h]),y=t.filter(ff(m)),E=nl(y,r,Je+2),D=h===i,C=h===p;return d(Uf,{key:`panel-grid-${m.getDate()}`,width:w,left:v,index:h,exceedCount:E,isClicked:s,onClickExceedCount:a,isClickedIndex:D,onClickCollapseButton:c,isLastCell:C})}))});function zf({onMouseDown:e}){return d("span",{className:`${_("weekday-resize-handle")} ${_("handle-y")}`,onMouseDown:e,"data-testid":"horizontal-event-resize-icon"},d("i",{className:`${_("icon")} ${_("ic-handle-y")}`}))}const pl=ko(null),Wf=pl.Provider,Pt=()=>{const e=Nn(pl);if(Le(e))throw new Error("LayoutContainerProvider is not found");return e},Yf={panelResizer:"panelResizer"},Pn={resizeEvent:(e,t)=>`event/${e}/resize/${t}`,moveEvent:(e,t)=>`event/${e}/move/${t}`,gridSelection:e=>`gridSelection/${e}`};function ml(e){return F(Q(t=>t.calendar.calendars.find(n=>n.id===e),[e]))}function gi(e){var t;const n=ml((t=e==null?void 0:e.calendarId)!=null?t:null);return U(()=>({color:n==null?void 0:n.color,borderColor:n==null?void 0:n.borderColor,backgroundColor:n==null?void 0:n.backgroundColor,dragBackgroundColor:n==null?void 0:n.dragBackgroundColor}),[n])}var hl=(e=>(e.ESCAPE="Escape",e))(hl||{});const Vf={Escape:27},$s=3;function _t(e,t){const n=Ga(),o=te(e),r=te(t);oe(()=>{o.current=e,r.current=t},[e,t]),oe(()=>n.subscribe(i=>r.current(i),i=>o.current(i)),[e,n])}function jf(e,t){return e.key?e.key===t:e.keyCode===Vf[t]}function Xf(e){return e===0}function Kf(e,t,n,o){return Math.abs(e-n)>=$s||Math.abs(t-o)>=$s}function en(e,{onInit:t,onDragStart:n,onDrag:o,onMouseUp:r,onPressESCKey:i}={}){const{initDrag:s,setDragging:a,cancelDrag:c,reset:u}=ye("dnd"),l=Ga(),f=te(l.getState().dnd);_t(Rt,S=>{f.current=S});const[p,m]=se(!1),h=te(null),w=te(null),v=te(null),y=Q(S=>{!Xf(S.button)||(S.currentTarget&&(S.currentTarget.ondragstart=function(){return!1}),S.preventDefault(),m(!0),s({draggingItemType:e,initX:S.clientX,initY:S.clientY}),t==null||t(S,f.current))},[t,e,s]),E=Q(S=>{const{initX:N,initY:M,draggingState:H,draggingItemType:x}=f.current;if(x!==e){m(!1),u();return}if(!(P(N)&&P(M)&&!Kf(N,M,S.clientX,S.clientY))){if(H<=We.INIT){a({x:S.clientX,y:S.clientY}),n==null||n(S,f.current);return}a({x:S.clientX,y:S.clientY}),o==null||o(S,f.current)}},[e,o,n,a,u]),D=Q(S=>{S.stopPropagation(),p&&(r==null||r(S,f.current),m(!1),u())},[p,r,u]),C=Q(S=>{jf(S,hl.ESCAPE)&&(m(!1),c(),i==null||i(S,f.current))},[i,c]);return oe(()=>{h.current=E,w.current=D,v.current=C},[C,E,D]),oe(()=>{const S=H=>{var x;return(x=h.current)==null?void 0:x.call(h,H)},N=H=>{var x;return(x=w.current)==null?void 0:x.call(w,H)},M=H=>{var x;return(x=v.current)==null?void 0:x.call(v,H)};return p?(document.addEventListener("mousemove",S),document.addEventListener("mouseup",N),document.addEventListener("keydown",M),()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",N),document.removeEventListener("keydown",M)}):At},[p,u]),y}function vi(e,t){return e?t:void 0}function gl(e){return{vertical:e?5:2,horizontal:8}}function qf(e,t){const n=e?0:"2px",o=t?0:"2px";return`${n} ${o} ${o} ${n}`}function Zf({uiModel:e,flat:t,eventHeight:n,isDraggingTarget:o,calendarColor:r}){const{exceedLeft:i,exceedRight:s}=e,{color:a,backgroundColor:c,dragBackgroundColor:u,borderColor:l}=Da(e,r),f={color:a,backgroundColor:o?u:c,borderLeft:i?"none":`3px solid ${l}`,borderRadius:qf(i,s),overflow:"hidden",height:n,lineHeight:yo(n),opacity:o?.5:1},p=gl(t);return R(t?{marginTop:p.vertical}:{marginLeft:i?0:p.horizontal,marginRight:s?0:p.horizontal},f)}function Jf({flat:e,uiModel:t,resizingWidth:n,movingLeft:o,eventHeight:r,headerHeight:i}){const{top:s,left:a,width:c,model:u}=t,l=gl(e),f=e?{}:{width:n||K(c),left:K(o!=null?o:a),top:(s-1)*(r+l.vertical)+i,position:"absolute"};return Object.assign(f,u.customStyle)}function Qf({model:e}){const t=e.calendarId?`${e.calendarId}-`:"",n=e.id?`${e.id}-`:"";return`${t}${n}${e.title}`}const nt={eventBody:_("weekday-event"),eventTitle:_("weekday-event-title"),eventDot:_("weekday-event-dot"),moveEvent:_("dragging--move-event"),resizeEvent:_("dragging--resize-horizontal-event")};function wt({flat:e=!1,uiModel:t,eventHeight:n,headerHeight:o,resizingWidth:r=null,movingLeft:i=null}){const{currentView:s}=F(an),{useDetailPopup:a,isReadOnly:c}=F(Ye),{setDraggingEventUIModel:u}=ye("dnd"),{showDetailPopup:l}=ye("popup"),f=Pt(),p=Se(),m=gi(t.model),[h,w]=se(!1),v=te(null),{isReadOnly:y,id:E,calendarId:D}=t.model,C=P(r)||P(i),S=!c&&!y&&!C,N=z=>{u(t),f==null||f.classList.add(z)},M=z=>{w(!1),f==null||f.classList.remove(z)};_t(Rt,({draggingEventUIModel:z,draggingState:me})=>{me===We.DRAGGING&&(z==null?void 0:z.cid())===t.cid()&&!C?w(!0):w(!1)}),oe(()=>{C||p.fire("afterRenderEvent",t.model.toEventObject())},[]);const H=en(Pn.resizeEvent("dayGrid",`${t.cid()}`),{onDragStart:()=>N(nt.resizeEvent),onMouseUp:()=>M(nt.resizeEvent),onPressESCKey:()=>M(nt.resizeEvent)}),x=en(Pn.moveEvent("dayGrid",`${t.cid()}`),{onDragStart:()=>{S&&N(nt.moveEvent)},onMouseUp:(z,{draggingState:me})=>{M(nt.moveEvent);const V=me<=We.INIT;V&&a&&v.current&&l({event:t.model,eventRect:v.current.getBoundingClientRect()},e),V&&p.fire("clickEvent",{event:t.model.toEventObject(),nativeEvent:z})},onPressESCKey:()=>M(nt.moveEvent)}),W=z=>{z.stopPropagation(),S&&H(z)},B=z=>{c&&p.fire("clickEvent",{event:t.model.toEventObject(),nativeEvent:z})},ee=z=>{c||(z.stopPropagation(),x(z))},q=!h&&s==="month"&&t.model.category==="time"&&Nt(t.model.start,t.model.end),T=!S||e||h||t.exceedRight,k=Jf({uiModel:t,eventHeight:n,headerHeight:o,flat:e,movingLeft:i,resizingWidth:r}),X=Zf({uiModel:t,flat:e,eventHeight:n,isDraggingTarget:h,calendarColor:m});return d("div",{className:_("weekday-event-block",{"weekday-exceed-left":t.exceedLeft,"weekday-exceed-right":t.exceedRight}),style:k,"data-testid":vi(S,Qf(t)),"data-calendar-id":D,"data-event-id":E,ref:v},d("div",{className:nt.eventBody,style:ce(R({},X),{backgroundColor:q?null:X.backgroundColor,borderLeft:q?null:X.borderLeft}),onClick:B,onMouseDown:ee},q?d("span",{className:nt.eventDot,style:{backgroundColor:X.backgroundColor}}):null,d("span",{className:nt.eventTitle},d(ne,{template:t.model.category,param:t.model})),T?null:d(zf,{onMouseDown:W})))}function cn(e,t){const n=te(e);oe(()=>{n.current=e},[e]),oe(()=>{t&&(()=>n.current())()},[t])}function un(e){const[t,n]=se(null);_t(Rt,r=>{if(P(r.x)&&P(r.y)){const i=e({clientX:r.x,clientY:r.y});i&&n(i)}});const o=Q(()=>n(null),[]);return[t,o]}const ep=(e,t,n)=>{function o(r){return new RegExp(`^event/${t}/${n}/\\d+$`).test(r)}return Y(e)?null:o(e)?it(e.split("/")):null};function dn(e,t){const[n,o]=se(!1),[r,i]=se(!1),[s,a]=se(null);return _t(Rt,({draggingItemType:u,draggingEventUIModel:l,draggingState:f})=>{const p=ep(u,e,t),m=Number(p)===(l==null?void 0:l.cid()),h=f===We.IDLE,w=f===We.CANCELED;Y(s)&&m&&a(l),P(s)&&(h||w)&&(o(!0),i(w))}),{isDraggingEnd:n,isDraggingCanceled:r,draggingEvent:s,clearDraggingEvent:()=>{a(null),o(!1),i(!1)}}}function tp({rowStyleInfo:e,gridPositionFinder:t}){const n=Se(),{isDraggingEnd:o,isDraggingCanceled:r,draggingEvent:i,clearDraggingEvent:s}=dn("dayGrid","move"),a=te(null),[c,u]=un(t),{columnIndex:l}=c!=null?c:{},f=U(()=>Y(i)?null:e.findIndex(({left:m})=>m===i.left),[e,i]),p=U(()=>{if(Y(l)||Y(a.current)||Y(f))return null;const m=f+l-a.current;return m<0?-e[-m].left:e[m].left},[l,e,f]);return oe(()=>{Y(a.current)&&P(l)&&(a.current=l)},[l]),cn(()=>{if(!r&&P(i)&&P(l)&&P(p)&&l!==a.current&&P(a.current)){const h=l-a.current,w=new O(i.model.getStarts()),v=new O(i.model.getEnds());w.addDate(h),v.addDate(h),n.fire("beforeUpdateEvent",{event:i.model.toEventObject(),changes:{start:w,end:v}})}s(),u(),a.current=null},o),U(()=>({movingEvent:i,movingLeft:p}),[p,i])}function np({rowStyleInfo:e,gridPositionFinder:t}){const{movingEvent:n,movingLeft:o}=tp({rowStyleInfo:e,gridPositionFinder:t});return Y(n)?null:d(wt,{uiModel:n,eventHeight:Je,headerHeight:0,movingLeft:o})}function op(e,t){const n=To(e.getStarts(),t),o=To(e.getEnds(),t);return{start:n,end:o}}function rp({weekDates:e,gridColWidthMap:t,gridPositionFinder:n}){const o=Se(),{isDraggingEnd:r,isDraggingCanceled:i,draggingEvent:s,clearDraggingEvent:a}=dn("dayGrid","resize"),[c,u]=un(n),{columnIndex:l}=c!=null?c:{},f=U(()=>s?op(s,e):{start:-1,end:-1},[e,s]),p=U(()=>f.start>-1&&P(l)?t[f.start][l]:null,[l,t,f.start]);return cn(()=>{if(!i&&P(s)&&P(l)&&f.start<=l&&f.end!==l){const h=e[l];o.fire("beforeUpdateEvent",{event:s.model.toEventObject(),changes:{end:h}})}u(),a()},r),U(()=>({resizingEvent:s,resizingWidth:p}),[p,s])}function ip({weekDates:e,gridColWidthMap:t,gridPositionFinder:n}){const{resizingEvent:o,resizingWidth:r}=rp({weekDates:e,gridColWidthMap:t,gridPositionFinder:n});return Y(o)?null:d(wt,{uiModel:o,eventHeight:Je,headerHeight:0,resizingWidth:r})}function $e(){const[e,t]=se(null),n=Q(o=>{o&&t(o)},[]);return[e,n]}function vl(e,t){const[n,o]=se(0),[r,i]=se(!1),{updateDayGridRowHeight:s}=ye("weekViewLayout"),a=Q(u=>{i(!0),o(u),s({rowName:t,height:(e+1)*Je})},[t,e,s]),c=Q(()=>{i(!1),s({rowName:t,height:Jt})},[t,s]);return{clickedIndex:n,isClickedCount:r,onClickExceedCount:a,onClickCollapseButton:c}}function sp(e,t,n){let o;const r=s=>{if(o||(o=s),s-o>=t){e(),n(At);return}const c=requestAnimationFrame(r);n(()=>cancelAnimationFrame(c))},i=requestAnimationFrame(r);n(()=>cancelAnimationFrame(i))}function ap({onClick:e,onDblClick:t,delay:n=300}){const o=te(At),r=c=>{o.current=c},i=()=>{o.current()};return oe(()=>i,[]),[c=>{i(),sp(e.bind(null,c),n,r)},c=>{i(),t(c)}]}const lp={dayGridMonth:"month",dayGridWeek:"allday",timeGrid:"time"};function cp(e,t){return e<t?[e,t]:[t,e]}function _i({type:e,selectionSorter:t,dateGetter:n,dateCollection:o,gridPositionFinder:r}){const{useFormPopup:i,gridSelection:s}=F(Ye),{enableDblClick:a,enableClick:c}=s,{setGridSelection:u,addGridSelection:l,clearAll:f}=ye("gridSelection"),{hideAllPopup:p,showFormPopup:m}=ye("popup"),h=Se(),w=Pt(),[v,y]=se(null),[E,D]=se(null),C=te(!1),S=te(null);_t(Q(T=>T.gridSelection[e],[e]),T=>{S.current=T}),_t(Rt,({draggingState:T,draggingItemType:k})=>{C.current=k===N&&T>=We.INIT});const N=Pn.gridSelection(e),M=T=>{const k=r(T);P(E)&&P(k)&&u(e,t(E,k))},[H,x]=ap({onClick:T=>{c&&B(T,!0)},onDblClick:T=>{a&&B(T,!0)},delay:250}),W=T=>{const k=T.detail<=1;if(!(!c&&(!a||k))){if(c){k?H(T):x(T);return}B(T,!0)}},B=(T,k)=>{var X;if(k&&M(T),P(S.current)){const[z,me]=cp(...n(o,S.current));if(i&&P(v)){const He={top:(T.clientY+v.y)/2,left:(T.clientX+v.x)/2};m({isCreationPopup:!0,title:"",location:"",start:z,end:me,isAllday:e!=="timeGrid",isPrivate:!1,popupArrowPointPosition:He,close:f})}const V=`.${_(lp[e])}.${_("grid-selection")}`,ue=Array.from((X=w==null?void 0:w.querySelectorAll(V))!=null?X:[]);h.fire("selectDateTime",{start:z.toDate(),end:me.toDate(),isAllday:e!=="timeGrid",nativeEvent:T,gridSelectionElements:ue})}},ee=Q(()=>{y(null),D(null),u(e,null)},[u,e]),q=en(N,{onInit:T=>{i&&(y({x:T.clientX,y:T.clientY}),p());const k=r(T);P(k)&&D(k),i||l(e,S.current)},onDragStart:T=>{M(T)},onDrag:T=>{C.current&&M(T)},onMouseUp:(T,{draggingState:k})=>{T.stopPropagation();const X=k<=We.INIT;X?W(T):B(T,X)},onPressESCKey:ee});return oe(()=>ee,[ee]),q}const up="alldayTitle";function _l({events:e,weekDates:t,height:n=Jt,options:o={},rowStyleInfo:r,gridColWidthMap:i}){const{isReadOnly:s}=F(Ye),a=ie(Ya),[c,u]=$e(),{narrowWeekend:l=!1,startDayOfWeek:f=rn.SUN}=o,p=U(()=>Math.max(0,...e.map(({top:S})=>S)),[e]),m=U(()=>fi({container:c,rowsCount:1,columnsCount:t.length,narrowWeekend:l,startDayOfWeek:f}),[c,t.length,l,f]),{clickedIndex:h,isClickedCount:w,onClickExceedCount:v,onClickCollapseButton:y}=vl(p,"allday"),E=U(()=>e.filter(ui(n,Je+Ea)).map(S=>d(wt,{key:`allday-DayEvent-${S.cid()}`,uiModel:S,eventHeight:Je,headerHeight:0})),[e,n]),D=_i({type:"dayGridWeek",gridPositionFinder:m,dateCollection:t,selectionSorter:Pr.sortSelection,dateGetter:Pr.getDateFromCollection}),C=S=>{const N=S.target;s||!N.classList.contains(_("panel-grid"))||D(S)};return d(Me,null,d("div",{className:_("panel-title"),style:a},d(ne,{template:up,param:"alldayTitle"})),d("div",{className:_("allday-panel"),ref:u,onMouseDown:C},d("div",{className:_("panel-grid-wrapper")},d(fl,{uiModels:e,weekDates:t,narrowWeekend:l,height:n,clickedIndex:h,isClickedCount:w,onClickExceedCount:v,onClickCollapseButton:y})),d("div",{className:_("panel-allday-events")},E),d(ip,{weekDates:t,gridPositionFinder:m,gridColWidthMap:i}),d(np,{rowStyleInfo:r,gridPositionFinder:m}),d(kf,{weekDates:t,narrowWeekend:l})))}function yl({events:e,weekDates:t,category:n,height:o=Jt,options:r={}}){const i=ie(Ya),s=U(()=>Math.max(0,...e.map(({top:h})=>h)),[e]),{narrowWeekend:a=!1}=r,c=`${n}Title`,{clickedIndex:u,isClickedCount:l,onClickExceedCount:f,onClickCollapseButton:p}=vl(s,n),m=U(()=>e.filter(ui(o,Je+Ea)).map(h=>d(wt,{key:`${n}-DayEvent-${h.cid()}`,uiModel:h,eventHeight:Je,headerHeight:0})),[n,e,o]);return d(Me,null,d("div",{className:_("panel-title"),style:i},d(ne,{template:c,param:n})),d("div",{className:_("allday-panel")},d("div",{className:_("panel-grid-wrapper")},d(fl,{uiModels:e,weekDates:t,narrowWeekend:a,height:o,clickedIndex:u,isClickedCount:l,onClickExceedCount:f,onClickCollapseButton:p})),d("div",{className:_(`panel-${n}-events`)},m)))}const ve={detailItem:_("detail-item"),detailItemIndent:_("detail-item","detail-item-indent"),detailItemSeparate:_("detail-item","detail-item-separate"),sectionDetail:_("popup-section","section-detail"),content:_("content"),locationIcon:_("icon","ic-location-b"),repeatIcon:_("icon","ic-repeat-b"),userIcon:_("icon","ic-user-b"),stateIcon:_("icon","ic-state-b"),calendarDotIcon:_("icon","calendar-dot")};function dp({event:e}){var t,n;const{location:o,recurrenceRule:r,attendees:i,state:s,calendarId:a,body:c}=e,u=ml(a);return d("div",{className:ve.sectionDetail},o&&d("div",{className:ve.detailItem},d("span",{className:ve.locationIcon}),d("span",{className:ve.content},d(ne,{template:"popupDetailLocation",param:e,as:"span"}))),r&&d("div",{className:ve.detailItem},d("span",{className:ve.repeatIcon}),d("span",{className:ve.content},d(ne,{template:"popupDetailRecurrenceRule",param:e,as:"span"}))),i&&d("div",{className:ve.detailItemIndent},d("span",{className:ve.userIcon}),d("span",{className:ve.content},d(ne,{template:"popupDetailAttendees",param:e,as:"span"}))),s&&d("div",{className:ve.detailItem},d("span",{className:ve.stateIcon}),d("span",{className:ve.content},d(ne,{template:"popupDetailState",param:e,as:"span"}))),u&&d("div",{className:ve.detailItem},d("span",{className:ve.calendarDotIcon,style:{backgroundColor:(t=u==null?void 0:u.backgroundColor)!=null?t:""}}),d("span",{className:ve.content},(n=u==null?void 0:u.name)!=null?n:"")),c&&d("div",{className:ve.detailItemSeparate},d("span",{className:ve.content},d(ne,{template:"popupDetailBody",param:e,as:"span"}))))}const pr={sectionHeader:_("popup-section","section-header"),content:_("content"),eventTitle:_("event-title")};function fp({event:e}){return d("div",{className:pr.sectionHeader},d("div",{className:pr.eventTitle},d(ne,{template:"popupDetailTitle",param:e,as:"span"})),d("div",{className:pr.content},d(ne,{template:"popupDetailDate",param:e,as:"span"})))}const pp=_("see-more-popup-slot"),mp=_("event-form-popup-slot"),hp=_("event-detail-popup-slot"),Or=8,gp=["isPrivate","isAllday","isPending","isFocused","isVisible","isReadOnly"];var Vt=(e=>(e.right="right",e.left="left",e))(Vt||{}),jt=(e=>(e.top="top",e.bottom="bottom",e))(jt||{});const wl=ko(null);function vp({children:e}){const[t,n]=$e(),[o,r]=$e(),[i,s]=$e(),[a,c]=$e(),u={container:t,seeMorePopupSlot:o,formPopupSlot:i,detailPopupSlot:a};return d(wl.Provider,{value:u},e,d("div",{ref:n,className:_("floating-layer")},d("div",{ref:r,className:pp}),d("div",{ref:s,className:mp}),d("div",{ref:c,className:hp})))}const yi=e=>{var t;const n=Nn(wl);if(Le(n))throw new Error("FloatingLayerProvider is not found");return(t=n==null?void 0:n[e])!=null?t:null};function El(e,t,n){return e+n.height>t.top+t.height}function Dl(e,t,n){return e+n.width>t.left+t.width}const _p=e=>e.popup[Po.Form],yp=e=>e.popup[Po.Detail],wp=e=>e.popup[Po.SeeMore],Pe={popupContainer:_("popup-container"),detailContainer:_("detail-container"),topLine:_("popup-top-line"),border:_("popup-arrow-border"),fill:_("popup-arrow-fill"),sectionButton:_("popup-section","section-button"),content:_("content"),editIcon:_("icon","ic-edit"),deleteIcon:_("icon","ic-delete"),editButton:_("edit-button"),deleteButton:_("delete-button"),verticalLine:_("vertical-line")};function Ep(e,t,n){let o=e.top+e.height/2-n.height/2,r=e.left+e.width;return El(o,t,n)&&(o=t.top+t.height-n.height),Dl(r,t,n)&&(r=e.left-n.width),[Math.max(o,t.top)+window.scrollY,Math.max(r,t.left)+window.scrollX]}function Dp(e,t,n){const o=e.top+e.height/2+window.scrollY,s=e.left+e.width+n.width>t.left+t.width?Vt.right:Vt.left;return{top:o,direction:s}}function Sp(){const{useFormPopup:e}=F(Ye),t=F(yp),{event:n,eventRect:o}=t!=null?t:{},{showFormPopup:r,hideDetailPopup:i}=ye("popup"),s=gi(n),a=Pt(),c=yi("detailPopupSlot"),u=Se(),l=te(null),[f,p]=se({}),[m,h]=se(0),[w,v]=se(Vt.left),y=U(()=>{const q=w===Vt.right,T=w===Vt.left;return _("popup-arrow",{right:q,left:T})},[w]);if(ht(()=>{if(l.current&&o&&a){const q=a.getBoundingClientRect(),T=l.current.getBoundingClientRect(),[k,X]=Ep(o,q,T),{top:z,direction:me}=Dp(o,q,T);p({top:k,left:X}),h(z-k-Or),v(me)}},[o,a]),Y(n)||Y(o)||Y(c))return null;const{title:E="",isAllday:D=!1,start:C=new O,end:S=new O,location:N,state:M,isReadOnly:H,isPrivate:x}=n,W={top:o.top+o.height/2,left:o.left+o.width/2},B=()=>{e?r({isCreationPopup:!1,event:n,title:E,location:N,start:C,end:S,isAllday:D,isPrivate:x,eventState:M,popupArrowPointPosition:W}):u.fire("beforeUpdateEvent",{event:n.toEventObject(),changes:{}})},ee=()=>{u.fire("beforeDeleteEvent",n.toEventObject()),i()};return hi(d("div",{role:"dialog",className:Pe.popupContainer,ref:l,style:f},d("div",{className:Pe.detailContainer},d(fp,{event:n}),d(dp,{event:n}),!H&&d("div",{className:Pe.sectionButton},d("button",{type:"button",className:Pe.editButton,onClick:B},d("span",{className:Pe.editIcon}),d("span",{className:Pe.content},d(ne,{template:"popupEdit",as:"span"}))),d("div",{className:Pe.verticalLine}),d("button",{type:"button",className:Pe.deleteButton,onClick:ee},d("span",{className:Pe.deleteIcon}),d("span",{className:Pe.content},d(ne,{template:"popupDelete",as:"span"}))))),d("div",{className:Pe.topLine,style:{backgroundColor:s.backgroundColor}}),d("div",{className:y},d("div",{className:Pe.border,style:{top:m}},d("div",{className:Pe.fill})))),c)}const lo={dropdownMenu:_("dropdown-menu"),dropdownMenuItem:_("dropdown-menu-item"),dotIcon:_("icon","dot"),content:_("content")};function Tp({index:e,name:t,backgroundColor:n,onClick:o}){return d("li",{className:lo.dropdownMenuItem,onClick:r=>o(r,e)},d("span",{className:lo.dotIcon,style:{backgroundColor:n}}),d("span",{className:lo.content},t))}function bp({calendars:e,setOpened:t,onChangeIndex:n}){const o=(r,i)=>{r.stopPropagation(),t(!1),n(i)};return d("ul",{className:lo.dropdownMenu},e.map(({name:r,backgroundColor:i="000"},s)=>d(Tp,{key:`dropdown-${r}-${s}`,index:s,name:r,backgroundColor:i,onClick:o})))}function Mt({children:e,classNames:t=[],onClick:n=At}){return d("div",{className:_("popup-section",...t),onClick:n},e)}function Sl(){const[e,t]=se(!1);return{isOpened:e,setOpened:t,toggleDropdown:()=>t(o=>!o)}}var lt=(e=>(e.init="init",e.setCalendarId="setCalendarId",e.setTitle="setTitle",e.setLocation="setLocation",e.setPrivate="setPrivate",e.setAllday="setAllday",e.setState="setState",e.reset="reset",e))(lt||{});const Lr={title:"",location:"",isAllday:!1,isPrivate:!1,state:"Busy"};function Cp(e,t){switch(t.type){case"init":return R(R({},Lr),t.event);case"setCalendarId":return ce(R({},e),{calendarId:t.calendarId});case"setTitle":return ce(R({},e),{title:t.title});case"setLocation":return ce(R({},e),{location:t.location});case"setPrivate":return ce(R({},e),{isPrivate:t.isPrivate});case"setAllday":return ce(R({},e),{isAllday:t.isAllday});case"setState":return ce(R({},e),{state:t.state});case"reset":return R(R({},e),Lr);default:return e}}function kp(e){return Fr(Cp,R({calendarId:e},Lr))}const Zn={popupSection:["dropdown-section","calendar-section"],popupSectionItem:_("popup-section-item","popup-button"),dotIcon:_("icon","dot"),content:_("content","event-calendar")};function Np({calendars:e,selectedCalendarId:t,formStateDispatch:n}){const{isOpened:o,setOpened:r,toggleDropdown:i}=Sl(),s=e.find(l=>l.id===t),{backgroundColor:a="",name:c=""}=s!=null?s:{},u=l=>n({type:lt.setCalendarId,calendarId:e[l].id});return d(Mt,{onClick:i,classNames:Zn.popupSection},d("button",{type:"button",className:Zn.popupSectionItem},d("span",{className:Zn.dotIcon,style:{backgroundColor:a}}),d("span",{className:Zn.content},c),d("span",{className:_("icon","ic-dropdown-arrow",{open:o})})),o&&d(bp,{calendars:e,setOpened:r,onChangeIndex:u}))}const Gs={closeButton:_("popup-button","popup-close"),closeIcon:_("icon","ic-close")};function Tl({type:e,close:t}){const{hideAllPopup:n}=ye("popup"),o=()=>{n(),Tn(t)&&t()};return d("button",{type:"button",className:Gs.closeButton,onClick:o},e==="moreEvents"?d(ne,{template:"monthMoreClose"}):d("i",{className:Gs.closeIcon}))}const Ip={confirmButton:_("popup-button","popup-confirm")};function Mp({children:e}){return d("button",{type:"submit",className:Ip.confirmButton},d("span",null,e))}function Co({template:e,model:t,defaultValue:n=""}){const r=F(Fa)[e];if(Y(r))return n;let i=r(t);return be(i)||(i=n),i}const Be={datePickerContainer:_("datepicker-container"),datePicker:_("popup-section-item","popup-date-picker"),allday:_("popup-section-item","popup-section-allday"),dateIcon:_("icon","ic-date"),dateDash:_("popup-date-dash"),content:_("content")},Ap=ul(function({start:t,end:n,isAllday:o=!1,formStateDispatch:r},i){const{usageStatistics:s}=F(Ye),a=te(null),c=te(null),u=te(null),l=te(null),f=Co({template:"startDatePlaceholder",defaultValue:"Start Date"}),p=Co({template:"endDatePlaceholder",defaultValue:"End Date"}),m=()=>r({type:lt.setAllday,isAllday:!o});return oe(()=>{if(a.current&&c.current&&u.current&&l.current){const h=new O(t),w=new O(n);o&&(h.setHours(12,0,0),w.setHours(13,0,0)),i.current=yc.createRangePicker({startpicker:{date:h.toDate(),input:c.current,container:a.current},endpicker:{date:w.toDate(),input:l.current,container:u.current},format:o?"yyyy-MM-dd":"yyyy-MM-dd HH:mm",timePicker:o?!1:{showMeridiem:!1,usageStatistics:s},usageStatistics:s})}},[t,n,o,s,i]),d(Mt,null,d("div",{className:Be.datePicker},d("span",{className:Be.dateIcon}),d("input",{name:"start",className:Be.content,placeholder:f,ref:c}),d("div",{className:Be.datePickerContainer,ref:a})),d("span",{className:Be.dateDash},"-"),d("div",{className:Be.datePicker},d("span",{className:Be.dateIcon}),d("input",{name:"end",className:Be.content,placeholder:p,ref:l}),d("div",{className:Be.datePickerContainer,ref:u})),d("div",{className:Be.allday,onClick:m},d("span",{className:_("icon",{"ic-checkbox-normal":!o,"ic-checkbox-checked":o})}),d("span",{className:Be.content},d(ne,{template:"popupIsAllday"})),d("input",{name:"isAllday",type:"checkbox",className:_("hidden-input"),value:o?"true":"false",checked:o})))}),Rp=["Busy","Free"],Jn={popupSectionItem:_("popup-section-item","dropdown-menu-item"),dropdownMenu:_("dropdown-menu"),icon:_("icon"),content:_("content")};function Pp({setOpened:e,setEventState:t}){const n=(o,r)=>{o.stopPropagation(),e(!1),t(r)};return d("ul",{className:Jn.dropdownMenu},Rp.map(o=>d("li",{key:o,className:Jn.popupSectionItem,onClick:r=>n(r,o)},d("span",{className:Jn.icon}),d("span",{className:Jn.content},o==="Busy"?d(ne,{template:"popupStateBusy"}):d(ne,{template:"popupStateFree"})))))}const _n={popupSection:["dropdown-section","state-section"],popupSectionItem:_("popup-section-item","popup-button"),stateIcon:_("icon","ic-state"),arrowIcon:_("icon","ic-dropdown-arrow"),content:_("content","event-state")};function xp({eventState:e="Busy",formStateDispatch:t}){const{isOpened:n,setOpened:o,toggleDropdown:r}=Sl(),i=s=>t({type:lt.setState,state:s});return d(Mt,{onClick:r,classNames:_n.popupSection},d("button",{type:"button",className:_n.popupSectionItem},d("span",{className:_n.stateIcon}),d("span",{className:_n.content},e==="Busy"?d(ne,{template:"popupStateBusy"}):d(ne,{template:"popupStateFree"})),d("span",{className:_n.arrowIcon})),n&&d(Pp,{setOpened:o,setEventState:i}))}const mr={popupSectionItem:_("popup-section-item","popup-section-location"),locationIcon:_("icon","ic-location"),content:_("content")};function Op({location:e,formStateDispatch:t}){const n=Co({template:"locationPlaceholder",defaultValue:"Location"}),o=r=>{t({type:lt.setLocation,location:r.currentTarget.value})};return d(Mt,null,d("div",{className:mr.popupSectionItem},d("span",{className:mr.locationIcon}),d("input",{name:"location",className:mr.content,placeholder:n,value:e,onChange:o})))}const Qn={popupSectionItem:_("popup-section-item","popup-section-title"),privateButton:_("popup-section-item","popup-section-private","popup-button"),titleIcon:_("icon","ic-title"),content:_("content")};function Lp({title:e,isPrivate:t=!1,formStateDispatch:n}){const o=Co({template:"titlePlaceholder",defaultValue:"Subject"}),r=()=>n({type:lt.setPrivate,isPrivate:!t}),i=s=>{n({type:lt.setTitle,title:s.currentTarget.value})};return d(Mt,null,d("div",{className:Qn.popupSectionItem},d("span",{className:Qn.titleIcon}),d("input",{name:"title",className:Qn.content,placeholder:o,value:e,onChange:i,required:!0})),d("button",{type:"button",className:Qn.privateButton,onClick:r},d("span",{className:_("icon",{"ic-private":t,"ic-public":!t})}),d("input",{name:"isPrivate",type:"checkbox",className:_("hidden-input"),value:t?"true":"false",checked:t})))}const eo={popupContainer:_("popup-container"),formContainer:_("form-container"),popupArrowBorder:_("popup-arrow-border"),popupArrowFill:_("popup-arrow-fill")};function Hp(e,t,n){let o=e.top-n.height-Or,r=e.left-n.width/2,i=jt.bottom;return o<t.top&&(i=jt.top,o=e.top+Or),El(o,t,n)&&(o=t.top+t.height-n.height),Dl(r,t,n)&&(r=t.left+t.width-n.width),{top:o+window.scrollY,left:Math.max(r,t.left)+window.scrollX,direction:i}}function $p(e){return gp.indexOf(e)!==-1}function Gp(e,t){return Object.entries(t).reduce((n,[o,r])=>{const i=o;return e[i]instanceof O?vt(e[i],r)!==0&&(n[i]=r):e[i]!==r&&(n[i]=r),n},{})}function Bp(){var e;const{calendars:t}=F(xo),{hideAllPopup:n}=ye("popup"),o=F(_p),{start:r,end:i,popupArrowPointPosition:s,close:a,isCreationPopup:c,event:u}=o!=null?o:{},l=Se(),f=yi("formPopupSlot"),[p,m]=kp((e=t[0])==null?void 0:e.id),h=te(null),w=te(null),[v,y]=se({}),[E,D]=se(0),[C,S]=se(jt.bottom),N=Pt(),M=U(()=>{const x=C===jt.top,W=C===jt.bottom;return _("popup-arrow",{top:x,bottom:W})},[C]);if(ht(()=>{if(w.current&&s&&N){const x=N.getBoundingClientRect(),W=w.current.getBoundingClientRect(),{top:B,left:ee,direction:q}=Hp(s,x,W),T=s.left-ee;y({left:ee,top:B}),D(T),S(q)}},[N,s]),oe(()=>{P(o)&&P(u)&&m({type:lt.init,event:{title:o.title,location:o.location,isAllday:o.isAllday,isPrivate:o.isPrivate,calendarId:u.calendarId,state:o.eventState}})},[t,u,m,o]),oe(()=>{Y(o)&&m({type:lt.reset})},[m,o]),Y(r)||Y(i)||Y(f))return null;const H=x=>{var W,B;x.preventDefault();const ee=new FormData(x.target),q=R({},p);if(ee.forEach((T,k)=>{q[k]=$p(k)?T==="true":T}),q.start=new O((W=h.current)==null?void 0:W.getStartDate()),q.end=new O((B=h.current)==null?void 0:B.getEndDate()),c)l.fire("beforeCreateEvent",q);else if(u){const T=Gp(u,q);l.fire("beforeUpdateEvent",{event:u.toEventObject(),changes:T})}n()};return hi(d("div",{role:"dialog",className:eo.popupContainer,ref:w,style:v},d("form",{onSubmit:H},d("div",{className:eo.formContainer},t!=null&&t.length?d(Np,{selectedCalendarId:p.calendarId,calendars:t,formStateDispatch:m}):d(Mt,null),d(Lp,{title:p.title,isPrivate:p.isPrivate,formStateDispatch:m}),d(Op,{location:p.location,formStateDispatch:m}),d(Ap,{start:r,end:i,isAllday:p.isAllday,formStateDispatch:m,ref:h}),d(xp,{eventState:p.state,formStateDispatch:m}),d(Tl,{type:"form",close:a}),d(Mt,null,d(Mp,null,c?d(ne,{template:"popupSave"}):d(ne,{template:"popupUpdate"})))),d("div",{className:M},d("div",{className:eo.popupArrowBorder,style:{left:E}},d("div",{className:eo.popupArrowFill}))))),f)}function Fp(e){return Object.values(e.popup).find(t=>P(t))}function Up(){const e=F(Fp),{hideAllPopup:t}=ye("popup"),n=P(e),o=r=>{var i;r.stopPropagation(),(i=e==null?void 0:e.close)==null||i.call(e),t()};return d("div",{className:_("popup-overlay"),style:{display:n?"block":"none"},onClick:o})}const to={container:_("see-more-container"),seeMore:_("see-more"),header:_("see-more-header"),list:_("month-more-list")};function zp(){const e=F(wp),{date:t,events:n=[],popupPosition:o}=e!=null?e:{},{moreView:r,moreViewTitle:i}=ja(),s=yi("seeMorePopupSlot"),a=Se(),c=te(null),u=Y(t)||Y(o)||Y(s);if(oe(()=>{!u&&c.current&&a.fire("clickMoreEventsBtn",{date:t.toDate(),target:c.current})},[t,a,u]),u)return null;const l={height:io,marginBottom:Tr,padding:Xc,backgroundColor:i.backgroundColor},f={ymd:pe(t,"YYYY-MM-DD"),day:t.getDay(),date:t.getDate().toString().padStart(2,"0")},p={height:`calc(100% - ${io+Tr+jc}px)`};return hi(d("div",{role:"dialog",className:to.container,style:o,ref:c},d("div",{className:to.seeMore,style:r},d("div",{className:to.header,style:l},d(ne,{template:"monthMoreTitleDate",param:f}),d(Tl,{type:"moreEvents"})),d("div",{className:to.list,style:p},n.map(m=>d(wt,{key:`see-more-event-item-${m.cid()}`,uiModel:m,eventHeight:Zt,headerHeight:io,flat:!0}))))),s)}function Wp(e,t){const n={height:K(100)};return e&&(n.width=e),t&&(n.height=t),n}function wi({children:e,width:t,height:n,className:o="",autoAdjustPanels:r=!1}){const{backgroundColor:i}=ie(Wa),[s,a]=$e(),{setLastPanelType:c,updateLayoutHeight:u}=ye("weekViewLayout"),l=Se(),f=U(()=>`${_("layout")} ${o}`,[o]);return ht(()=>{if(s){const p=()=>u(s.offsetHeight);p(),window.addEventListener("resize",p);const m=new ResizeObserver(()=>l.fire("layoutResized",s.getBoundingClientRect()));return m.observe(s),()=>{m.disconnect(),window.removeEventListener("resize",p)}}return At},[s,u,l]),ht(()=>{if(s&&r){const p=Cn(e),m=p[p.length-1];!be(m)&&!so(m)&&!Y(m)&&c(m.props.name)}},[e,c,r,s]),d(Wf,{value:s},d("div",{ref:a,className:f,style:ce(R({},Wp(t,n)),{backgroundColor:i})},s?e:null),d(Bp,null),d(Sp,null),d(zp,null),d(Up,null))}function Yp(e,t){return{height:e,width:"100%",cursor:"row-resize",borderTop:t,borderBottom:t}}function Vp({name:e,height:t}){const n=ie(Q(l=>l.week.panelResizer.border,[])),o=Yp(t,n),r=ce(R({},o),{display:"none",border:"none",backgroundColor:"#999"}),[i,s]=se(r),a=te(null),{updateDayGridRowHeightByDiff:c}=ye("weekViewLayout"),u=en(Yf.panelResizer,{onDragStart:l=>{a.current={left:l.pageX,top:l.pageY}},onDrag:l=>{if(a.current){const f=l.pageY-a.current.top;s(p=>ce(R({},p),{top:f,display:null}))}},onMouseUp:l=>{if(a.current){const f=l.pageY-a.current.top;a.current=null,s(r),c({rowName:e,diff:f})}}});return d("div",{style:{position:"relative"}},d("div",{className:_("panel-resizer"),style:o,onMouseDown:u}),d("div",{className:_("panel-resizer-guide"),style:i}))}function Bs(e,t){return t?Math.min(t,e):e}function jp({initialHeight:e,initialWidth:t,overflowX:n,overflowY:o,maxExpandableWidth:r,maxExpandableHeight:i,minHeight:s,maxHeight:a,minWidth:c,maxWidth:u}){const l={};return t&&(l.width=Bs(t,r),l.height="100%"),e&&(l.width="100%",l.height=Bs(e,i)),n&&(l.overflowX="auto"),o&&(l.overflowY="auto"),ce(R({},l),{minHeight:s,maxHeight:a,minWidth:c,maxWidth:u})}const Xt=ul(function({name:t,initialWidth:n=Jt,initialHeight:o=Jt,overflowX:r,overflowY:i,maxExpandableWidth:s,maxExpandableHeight:a,minHeight:c,maxHeight:u,minWidth:l,maxWidth:f,resizerWidth:p=Ir,resizerHeight:m=Ir,resizable:h,children:w},v){const{updateDayGridRowHeight:y}=ye("weekViewLayout"),{height:E}=F(Q(N=>{var M;return(M=N.weekViewLayout.dayGridRows[t])!=null?M:{}},[t])),D=E!=null?E:o;ht(()=>{y({rowName:t,height:o})},[o,t,y]);const C=jp({initialWidth:n,initialHeight:D,overflowX:r,overflowY:i,maxExpandableWidth:s,maxExpandableHeight:a,minHeight:c,maxHeight:u,minWidth:l,maxWidth:f}),S=U(()=>Y(h)||Zr(h)?!!h:h.includes(t),[h,t]);return d(Me,null,d("div",{className:_("panel",t),style:C,ref:v},w),S?d(Vp,{name:t,width:p,height:m}):null)}),bl="timegrid",De=e=>`${bl}-${e}`,Xp={second:"HH:mm:ss",minute:"HH:mm",hour:"HH:mm",date:"HH:mm",month:"MM.DD",year:"YYYY.MM.DD"},Fe={time:_("event-time"),content:_("event-time-content"),travelTime:_("travel-time"),resizeHandleX:_("resize-handler-x"),moveEvent:_("dragging--move-event"),resizeEvent:_("dragging--resize-vertical-event")};function Kp(e){const{percent:t,px:n}=br(`${e}`);return e>0||t>0||n>0?_o:0}function qp(e,t){return be(e)?e:e>=0?`calc(${K(e)} - ${t}px)`:""}function Zp({uiModel:e,isDraggingTarget:t,hasNextStartTime:n,calendarColor:o,minHeight:r}){const{top:i,left:s,height:a,width:c,duplicateLeft:u,duplicateWidth:l,goingDurationHeight:f,modelDurationHeight:p,comingDurationHeight:m,croppedStart:h,croppedEnd:w}=e,v="white",y=2,E=2,D=Kp(s),{color:C,backgroundColor:S,borderColor:N,dragBackgroundColor:M}=Da(e,o),H={width:qp(l||c,D),height:`calc(${K(Math.max(a,r))} - ${E}px)`,top:K(i),left:u||K(s),borderRadius:y,borderLeft:`3px solid ${N}`,marginLeft:D,color:C,backgroundColor:t?M:S,opacity:t?.5:1,zIndex:n?1:0},x={height:K(f),borderBottom:`1px dashed ${v}`},W={height:K(p)},B={height:K(m),borderTop:`1px dashed ${v}`};return h&&(H.borderTopLeftRadius=0,H.borderTopRightRadius=0),w&&(H.borderBottomLeftRadius=0,H.borderBottomRightRadius=0),{containerStyle:H,goingDurationStyle:x,modelDurationStyle:W,comingDurationStyle:B}}function Jp({uiModel:e,isReadOnlyCalendar:t,isDraggingTarget:n,hasNextStartTime:o}){const{model:r}=e;return!t&&!r.isReadOnly&&!n&&!o}function Ei({uiModel:e,nextStartTime:t,isResizingGuide:n=!1,minHeight:o=0}){const{useDetailPopup:r,isReadOnly:i,week:s}=F(Ye),a=gi(e.model),{collapseDuplicateEvents:c}=s,u=Pt(),{showDetailPopup:l}=ye("popup"),{setDraggingEventUIModel:f}=ye("dnd"),{setSelectedDuplicateEventCid:p}=ye("weekViewLayout"),m=Se(),h=te(null),[w,v]=se(!1),{model:y,goingDurationHeight:E,modelDurationHeight:D,comingDurationHeight:C,croppedEnd:S}=e,{id:N,calendarId:M,customStyle:H}=y,x=P(t),{containerStyle:W,goingDurationStyle:B,modelDurationStyle:ee,comingDurationStyle:q}=Zp({uiModel:e,isDraggingTarget:w,hasNextStartTime:x,calendarColor:a,minHeight:o}),T=x||n;_t(Rt,({draggingEventUIModel:ae,draggingState:Re})=>{Re===We.DRAGGING&&(ae==null?void 0:ae.cid())===e.cid()&&!x&&!n?v(!0):v(!1)}),oe(()=>{n||m.fire("afterRenderEvent",e.model.toEventObject())},[]);const k=ae=>{f(e),u==null||u.classList.add(ae)},X=ae=>{v(!1),u==null||u.classList.remove(ae)},z=en(Pn.moveEvent("timeGrid",`${e.cid()}`),{onDragStart:()=>{ct&&k(Fe.moveEvent)},onMouseUp:(ae,{draggingState:Re})=>{X(Fe.moveEvent);const Ve=Re<=We.INIT;if(Ve&&c){const Et=e.duplicateEvents.length>0?e.cid():Ao;p(Et)}Ve&&r&&h.current&&l({event:e.model,eventRect:h.current.getBoundingClientRect()},!1),Ve&&m.fire("clickEvent",{event:e.model.toEventObject(),nativeEvent:ae})},onPressESCKey:()=>X(Fe.moveEvent)}),me=ae=>{i&&m.fire("clickEvent",{event:e.model.toEventObject(),nativeEvent:ae})},V=ae=>{i||(ae.stopPropagation(),z(ae))},ue=en(Pn.resizeEvent("timeGrid",`${e.cid()}`),{onDragStart:()=>k(Fe.resizeEvent),onMouseUp:()=>X(Fe.resizeEvent),onPressESCKey:()=>X(Fe.resizeEvent)}),He=ae=>{ae.stopPropagation(),ue(ae)},ct=Jp({uiModel:e,isReadOnlyCalendar:i,isDraggingTarget:w,hasNextStartTime:x}),Qe=ct&&!S;return d("div",{"data-testid":`${T?"guide-":""}time-event-${y.title}-${e.cid()}`,"data-calendar-id":M,"data-event-id":N,className:Fe.time,style:R(R({},W),H),onClick:me,onMouseDown:V,ref:h},E?d("div",{className:Fe.travelTime,style:B},d(ne,{template:"goingDuration",param:y})):null,D?d("div",{className:Fe.content,style:ee},d(ne,{template:"time",param:ce(R({},y.toEventObject()),{start:x?t:y.start})})):null,C?d("div",{className:Fe.travelTime,style:q},d(ne,{template:"comingDuration",param:y})):null,Qe?d("div",{className:Fe.resizeHandleX,onMouseDown:He}):null)}function Qp({top:e,height:t,text:n}){const{backgroundColor:o,border:r}=ie(Q(a=>a.common.gridSelection,[])),i=ie(Q(a=>a.week.gridSelection.color,[])),s={top:K(e),height:K(t),backgroundColor:o,border:r};return d("div",{className:_("time","grid-selection"),style:s,"data-testid":`time-grid-selection-${e}-${t}`},n.length>0?d("span",{className:_("grid-selection-label"),style:{color:i}},n):null)}function em({columnIndex:e,timeGridRows:t}){const n=F(Q(r=>Rr.calculateSelection(r.gridSelection.timeGrid,e,t.length-1),[e,t])),o=U(()=>{if(!n)return null;const{startRowIndex:r,endRowIndex:i,isStartingColumn:s,isSelectingMultipleColumns:a}=n,{top:c,startTime:u}=t[r],{top:l,height:f,endTime:p}=t[i],m=l+f-c;let h=`${u} - ${p}`;return a&&(h=s?u:""),{top:c,height:m,text:h}},[n,t]);return Y(o)?null:d(Qp,R({},o))}function tm({gridPositionFinder:e,totalUIModels:t,columnIndex:n,timeGridData:o}){const r=Se(),{isDraggingEnd:i,isDraggingCanceled:s,draggingEvent:a,clearDraggingEvent:c}=dn("timeGrid","resize"),[u,l]=un(e),[f,p]=se(null),m=Q(()=>{p(null),c(),l()},[l,c]),h=U(()=>{if(Y(a))return null;const{columns:y,rows:E}=o,D=t.map(k=>k.filter(X=>X.cid()===a.cid())),C=(k,X)=>z=>{const me=Ke(y[X].date,z.startTime),V=Ke(o.columns[X].date,z.endTime);return me<=k&&k<V},S=D.findIndex(k=>k.length>0),N=D[S][0],{goingDuration:M=0}=N.model,H=Ie(N.getStarts(),-M),x=Math.max(E.findIndex(C(H,S)),0),W=Jr(D,k=>k.length>0),B=D[W][0],{comingDuration:ee=0}=B.model,q=Ie(B.getStarts(),ee);let T=E.findIndex(C(q,W));return T=T>=0?T:E.length-1,{eventStartDateColumnIndex:S,eventStartDateRowIndex:x,eventEndDateColumnIndex:W,eventEndDateRowIndex:T,resizeTargetUIModelColumns:D}},[a,o,t]),w=P(h)&&P(a)&&P(u),v=U(()=>h?o.rows[0].height:0,[h,o.rows]);return oe(()=>{if(w){const{eventStartDateRowIndex:y,eventStartDateColumnIndex:E,eventEndDateColumnIndex:D}=h;if(n===D&&E===D){const C=a.clone(),{height:S,goingDurationHeight:N,comingDurationHeight:M}=C,H=Math.max(v+N*S/100+M*S/100,o.rows[u.rowIndex].top-o.rows[y].top+v),x=N*S/H,W=M*S/H;C.setUIProps({height:H,goingDurationHeight:x,comingDurationHeight:W,modelDurationHeight:100-(x+W)}),p(C)}}},[h,w,n,u,a,o.rows,v]),oe(()=>{if(w){const{resizeTargetUIModelColumns:y,eventStartDateColumnIndex:E,eventEndDateColumnIndex:D}=h;if((n===E||n===D)&&E!==D){let C;n===E?C=y[n][0].clone():(C=a.clone(),C.setUIProps({height:o.rows[u.rowIndex].top+v})),p(C)}}},[h,w,n,u,a,o.rows,v]),cn(()=>{if(!s&&P(h)&&P(u)&&P(a)&&h.eventEndDateColumnIndex===n){const{comingDuration:E=0}=a.model,D=Ie(Ke(o.columns[n].date,o.rows[u.rowIndex].endTime),-E),C=Ie(a.getStarts(),30);r.fire("beforeUpdateEvent",{event:a.model.toEventObject(),changes:{end:ei(C,D)}})}m()},i),f}function nm({gridPositionFinder:e,totalUIModels:t,columnIndex:n,timeGridData:o}){const r=tm({gridPositionFinder:e,totalUIModels:t,columnIndex:n,timeGridData:o});return Y(r)?null:d(Ei,{uiModel:r,isResizingGuide:!0})}const Cl={column:_("column"),backgrounds:_("background-events"),events:_("events")};function om({eventUIModels:e,minEventHeight:t}){const n={marginRight:8};return d("div",{className:Cl.events,style:n},e.map(o=>d(Ei,{key:`${o.valueOf()}-${o.cid()}`,uiModel:o,minHeight:t})))}function rm(e){return{defaultBackgroundColor:e.week.dayGrid.backgroundColor,todayBackgroundColor:e.week.today.backgroundColor,weekendBackgroundColor:e.week.weekend.backgroundColor}}function im({today:e,columnDate:t,defaultBackgroundColor:n,todayBackgroundColor:o,weekendBackgroundColor:r}){const i=Nt(e,t),s=Ge(t.getDay());return i?o:s?r:n}const sm=ln(function({columnDate:t,columnWidth:n,columnIndex:o,totalUIModels:r,gridPositionFinder:i,timeGridData:s,isLastColumn:a}){const{rows:c}=s,u=ie(Q(y=>y.week.timeGrid.borderRight,[])),l=ie(rm),[,f]=Ho(),p=f(),m=im(R({today:p,columnDate:t},l)),h={width:n,backgroundColor:m,borderRight:a?"none":u},w=r[o],v=c[0].height;return d("div",{className:Cl.column,style:h,"data-testid":`timegrid-column-${t.getDay()}`},d(om,{eventUIModels:w,minEventHeight:v}),d(nm,{gridPositionFinder:i,totalUIModels:r,columnIndex:o,timeGridData:s}),d(em,{columnIndex:o,timeGridRows:c}))});function am(e){return{halfHourLineBorder:e.week.timeGridHalfHourLine.borderBottom,hourLineBorder:e.week.timeGridHourLine.borderBottom}}const lm=ln(function({timeGridRows:t}){const{halfHourLineBorder:n,hourLineBorder:o}=ie(am);return d("div",{className:_("gridlines")},t.map((r,i)=>{const s=i%2===0;return d("div",{key:`gridline-${r.startTime}-${r.endTime}`,className:_("gridline-half"),style:{top:K(r.top),height:K(r.height),borderBottom:s?n:o},"data-testid":`gridline-${r.startTime}-${r.endTime}`})}))}),cm=30;function Fs(e,t){const n=e.getHours()-t,o=e.getMinutes();return n*2+Math.floor(o/cm)}function um({draggingEvent:e,columnDiff:t,rowDiff:n,timeGridDataRows:o,currentDate:r}){const i=o[0].height,s=i*o.length,a=n*Ta+t*at,c=Number(o[0].startTime.split(":")[0]),{goingDuration:u=0,comingDuration:l=0}=e.model,f=Ie(e.getStarts(),-u),p=Ie(e.getEnds(),l),m=wo(f,a),h=wo(p,a),w=Math.max(Fs(m,c),0),v=Math.min(Fs(h,c),o.length-1),y=m.getFullYear()<r.getFullYear()||m.getMonth()<r.getMonth()||m.getDate()<r.getDate(),E=h.getFullYear()>r.getFullYear()||h.getMonth()>r.getMonth()||h.getDate()>r.getDate(),D=v-(y?0:w),C=y?0:o[w].top,S=E?s:Math.max(D,1)*i;return{top:C,height:S}}const dm=e=>e.dnd.initX,fm=e=>e.dnd.initY;function pm({gridPositionFinder:e,timeGridData:t}){const n=F(dm),o=F(fm),r=Se(),{isDraggingEnd:i,isDraggingCanceled:s,draggingEvent:a,clearDraggingEvent:c}=dn("timeGrid","move"),[u,l]=un(e),f=te(null);oe(()=>{P(n)&&P(o)&&(f.current=e({clientX:n,clientY:o}))},[e,n,o]);const p=U(()=>Y(f.current)||Y(u)?null:{columnDiff:u.columnIndex-f.current.columnIndex,rowDiff:u.rowIndex-f.current.rowIndex},[u]),m=U(()=>Y(a)?null:a.getStarts(),[a]),h=Q(()=>{l(),c(),f.current=null},[l,c]),w=U(()=>Y(p)||Y(m)?null:wo(m,p.rowDiff*Ta+p.columnDiff*at),[p,m]),v=U(()=>{if(Y(a)||Y(u)||Y(p))return null;const y=a.clone(),{top:E,height:D}=um({draggingEvent:y,columnDiff:p.columnDiff,rowDiff:p.rowDiff,timeGridDataRows:t.rows,currentDate:t.columns[u.columnIndex].date});return y.setUIProps({left:t.columns[u.columnIndex].left,width:t.columns[u.columnIndex].width,top:E,height:D}),y},[u,a,p,t.columns,t.rows]);return cn(()=>{if(!s&&P(a)&&P(u)&&P(p)&&P(w)&&(p.rowDiff!==0||p.columnDiff!==0)){const E=a.duration(),D=wo(w,E);r.fire("beforeUpdateEvent",{event:a.model.toEventObject(),changes:{start:w,end:D}})}h()},i),{movingEvent:v,nextStartTime:w}}function mm({gridPositionFinder:e,timeGridData:t}){const{movingEvent:n,nextStartTime:o}=pm({gridPositionFinder:e,timeGridData:t});return Y(n)?null:d(Ei,{uiModel:n,nextStartTime:o})}const kl={NOW_INDICATOR:"timegrid-now-indicator",NOW_INDICATOR_LABEL:"timegrid-now-indicator-label"},yn={line:_(De("now-indicator")),left:_(De("now-indicator-left")),marker:_(De("now-indicator-marker")),today:_(De("now-indicator-today")),right:_(De("now-indicator-right"))};function hm(e){return{pastBorder:e.week.nowIndicatorPast.border,todayBorder:e.week.nowIndicatorToday.border,futureBorder:e.week.nowIndicatorFuture.border,bulletBackgroundColor:e.week.nowIndicatorBullet.backgroundColor}}function gm({top:e,columnWidth:t,columnCount:n,columnIndex:o}){const{pastBorder:r,todayBorder:i,futureBorder:s,bulletBackgroundColor:a}=ie(hm),c=Pt(),u=Se(),l=te(null),f={left:K(t*o),width:K(t*o)},p={left:K(t*(o+1)),width:K(t*(n-o+1))};return oe(()=>{const m=h=>{var w;const v=(w=c==null?void 0:c.querySelector(`.${_("panel")}.${_("time")}`))!=null?w:null;if(v&&l.current){const{offsetHeight:y}=v,{offsetTop:E}=l.current,D=E-y/2;v.scrollTo?v.scrollTo({top:D,behavior:h}):v.scrollTop=D}};return u.on("scrollToNow",m),()=>u.off("scrollToNow",m)},[u,c]),oe(()=>{u.fire("scrollToNow","smooth")},[u]),d("div",{ref:l,className:yn.line,style:{top:K(e)},"data-testid":kl.NOW_INDICATOR},d("div",{className:yn.left,style:{width:f.width,borderTop:r}}),d("div",{className:yn.marker,style:{left:f.left,backgroundColor:a}}),d("div",{className:yn.today,style:{left:f.left,width:K(t),borderTop:i}}),d("div",{className:yn.right,style:{left:p.left,borderTop:s}}))}const Us={now:De("current-time"),dayDifference:De("day-difference")};function vm({unit:e,top:t,now:n,zonedNow:o}){const r=ie(Q(a=>a.week.nowIndicatorLabel.color,[])),i=U(()=>ri(o,n),[o,n]),s={unit:e,time:o,format:Xp[e]};return d("div",{className:_(Us.now),style:{top:K(t),color:r},"data-testid":kl.NOW_INDICATOR_LABEL},i!==0&&d("span",{className:_(Us.dayDifference)},`[${i>0?"+":"-"}${Math.abs(i)}]`),d(ne,{template:"timegridNowIndicatorLabel",param:s,as:"span"}))}const _m=e=>{var t;return(t=e.options.month.visibleEventCount)!=null?t:6},Di=e=>e.options.week.showNowIndicator,ym=e=>{var t;return(t=e.options.week.showTimezoneCollapseButton)!=null?t:!1},Nl=e=>{var t;return(t=e.options.week.timezonesCollapsed)!=null?t:!1},Yt={timeColumn:De("time-column"),hourRows:De("hour-rows"),time:De("time"),timeLabel:De("time-label"),first:De("time-first"),last:De("time-last"),hidden:De("time-hidden")};function wm(e){return{primaryTimezoneBackgroundColor:e.week.timeGridLeft.backgroundColor,subTimezoneBackgroundColor:e.week.timeGridLeftAdditionalTimezone.backgroundColor}}function Em(e){return{pastTimeColor:e.week.pastTime.color,futureTimeColor:e.week.futureTime.color}}function zs({rowsInfo:e,isPrimary:t,borderRight:n,width:o,nowIndicatorState:r}){var i;const s=F(Di),{primaryTimezoneBackgroundColor:a,subTimezoneBackgroundColor:c}=ie(wm),{pastTimeColor:u,futureTimeColor:l}=ie(Em),f=P(r)?Ie(r.now,(i=e[0].diffFromPrimaryTimezone)!=null?i:0):null,p=t?a:c;return d("div",{role:"rowgroup",className:_(Yt.hourRows),style:{width:K(o),borderRight:n,backgroundColor:p}},e.map(({date:m,top:h,className:w})=>{const y=P(f)&&m<f?u:l;return d("div",{key:m.getTime(),className:w,style:{top:K(h),color:y},role:"row"},d(ne,{template:`timegridDisplay${t?"Primary":""}Time`,param:{time:m},as:"span"}))}),s&&P(r)&&P(f)&&d(vm,{unit:"hour",top:r.top,now:r.now,zonedNow:f}))}const Dm=ln(function({timeGridRows:t,nowIndicatorState:n}){const o=F(Di),r=F(za),i=F(Nl),s=Lo(),{width:a,borderRight:c}=ie(si),u=U(()=>t.filter((v,y)=>y%2===0||y===t.length-1),[t]),l=Q((v,y,E)=>{const D=({top:H,height:x})=>{if(!o||Y(n))return!1;const W=n.top;return H-x<=W&&W<=H+x},C=y===0,S=y===u.length-1,N=_(Yt.time,{[Yt.first]:C,[Yt.last]:S,[Yt.hidden]:D(v)});let M=Ke(new O,S?v.endTime:v.startTime);return P(E)&&(M=Ie(M,E)),{date:M,top:v.top,className:N,diffFromPrimaryTimezone:E}},[u,n,o]),[f,...p]=r,m=p.length>0?100/(p.length+1):100,h=u.map((v,y)=>l(v,y)),w=U(()=>p.length===0?[]:p.reverse().map(v=>{const{timezoneName:y}=v,E=s(f.timezoneName).getTimezoneOffset(),C=s(y).getTimezoneOffset()-E;return u.map((S,N)=>l(S,N,C))}),[l,p,f,u,s]);return d("div",{className:_(Yt.timeColumn),style:{width:a},"data-testid":"timegrid-time-column"},!i&&w.map(v=>d(zs,{key:v[0].diffFromPrimaryTimezone,rowsInfo:v,isPrimary:!1,borderRight:c,width:m,nowIndicatorState:n})),d(zs,{rowsInfo:h,isPrimary:!0,borderRight:c,width:i?100:m,nowIndicatorState:n}))});function Hr(e,t,n){const o=t.getTime(),r=n.getTime(),i=Ar(e.getTime(),[o],[r])-o,s=r-o,a=Qa(s,100,i);return Ar(a,[0],[100])}function $r(e,t,n,o){const r=Hr(e,n,o),s=Hr(t,n,o)-r;return{top:r,height:s}}const Sm=1;function Il(e,t){return n=>{const{goingDuration:o=0,comingDuration:r=0}=n.model,i=Ie(n.getStarts(),-o);return!(Ie(n.getEnds(),r)<=e||i>=t)}}function Tm(e,t){const{renderStart:n,renderEnd:o,modelStart:r,modelEnd:i}=t,{goingDuration:s=0,comingDuration:a=0}=e.model;let c=100;if(s>0){const{height:u}=$r(n,r,n,o);e.goingDurationHeight=u,c-=u}if(a>0){const{height:u}=$r(i,o,n,o);e.comingDurationHeight=u,c-=u}e.modelDurationHeight=c}function bm(e,t){const{goingStart:n,comingEnd:o,startColumnTime:r,endColumnTime:i}=t;n<r&&(e.croppedStart=!0),o>i&&(e.croppedEnd=!0)}function Cm(e,t){const{duplicateEvents:n,duplicateEventIndex:o}=e,r=n[o-1];let i=t;if(r){const{percent:s,px:a}=br(`${r.duplicateLeft}`),{percent:c,px:u}=br(`${r.duplicateWidth}`),l=s+c,f=a+u+_o;l!==0?i=`calc(${K(l)} ${f>0?"+":"-"} ${yo(Math.abs(f))})`:i=yo(f)}else i=K(i);return i}function km(e,t){const{collapse:n}=e;return n?`${_s}px`:`calc(${K(t)} - ${yo((_s+_o)*(e.duplicateEvents.length-1)+_o)})`}function Nm(e,t){const{startColumnTime:n,endColumnTime:o,baseWidth:r,columnIndex:i,renderStart:s,renderEnd:a}=t,{duplicateEvents:c}=e,{top:u,height:l}=$r(s,a,n,o),f={top:u,left:r*i,width:r,height:Math.max(Sm,l),duplicateLeft:"",duplicateWidth:""};c.length>0&&(f.duplicateLeft=Cm(e,f.left),f.duplicateWidth=km(e,f.width)),e.setUIProps(f)}function Im(e,t,n,o,r){const{goingDuration:i=0,comingDuration:s=0}=e.model,a=e.getStarts(),c=e.getEnds(),u=Ie(a,-i),l=Ie(c,s),f=ei(u,o),p=ba(l,r);return{baseWidth:n,columnIndex:t,modelStart:a,modelEnd:c,renderStart:f,renderEnd:p,goingStart:u,comingEnd:l,startColumnTime:o,endColumnTime:r,duplicateEvents:e.duplicateEvents}}function Ml({uiModel:e,columnIndex:t,baseWidth:n,startColumnTime:o,endColumnTime:r,isDuplicateEvent:i=!1}){if(!i&&e.duplicateEvents.length>0){e.duplicateEvents.forEach(a=>{Ml({uiModel:a,columnIndex:t,baseWidth:n,startColumnTime:o,endColumnTime:r,isDuplicateEvent:!0})});return}const s=Im(e,t,n,o,r);Nm(e,s),Tm(e,s),bm(e,s)}function Mm(e,t,n){const{getDuplicateEvents:o,getMainEvent:r}=t,i=e.map(s=>s.model.toEventObject());return e.forEach(s=>{if(s.collapse||s.duplicateEvents.length>0)return;const a=o(s.model.toEventObject(),i);if(a.length<=1)return;const c=r(a),u=a.map(m=>e.find(h=>h.cid()===m.__cid)),l=!!(n>Ao&&a.find(m=>m.__cid===n)),f=a.reduce((m,{start:h,goingDuration:w})=>{const v=Ie(h,-w);return ba(m,v)},a[0].start),p=a.reduce((m,{end:h,comingDuration:w})=>{const v=Ie(h,w);return ei(m,v)},a[0].end);u.forEach((m,h)=>{const w=m.cid()===c.__cid,v=!(l&&m.cid()===n||!l&&w);m.setUIProps({duplicateEvents:u,duplicateEventIndex:h,collapse:v,isMain:w,duplicateStarts:f,duplicateEnds:p})})}),e}function Am(e,t,n,o,r){const i=e.filter(zu).filter(Il(t,n)).sort(kt.compare.event.asc);r&&Mm(i,r,o);const s=i.filter(f=>!f.collapse),a=Qt(...s),c=!0,u=$o(s,c);return Go(a,u,c).forEach(f=>{const p=Math.max(...f.map(h=>h.length)),m=Math.round(100/p);f.forEach(h=>{h.forEach((w,v)=>{Ml({uiModel:w,columnIndex:v,baseWidth:m,startColumnTime:t,endColumnTime:n})})})}),i}function Rm(e,t){const n=te(e);oe(()=>{n.current=e},[e]),oe(()=>{const o=()=>n.current(),r=t!=null?t:-1;if(r>0){const i=setInterval(o,r);return()=>clearInterval(i)}},[t])}function Pm(){const e=te(!0);return oe(()=>()=>{e.current=!1},[]),Q(()=>e.current,[])}const Ws={timegrid:_(bl),scrollArea:_(De("scroll-area"))};function Al({timeGridData:e,events:t}){const{isReadOnly:n,week:{narrowWeekend:o,startDayOfWeek:r,collapseDuplicateEvents:i}}=F(Ye),s=F(Di),a=F(M=>M.weekViewLayout.selectedDuplicateEventCid),[,c]=Ho(),u=Pm(),{width:l}=ie(si),[f,p]=se(null),{columns:m,rows:h}=e,w=m.length-1,v=U(()=>m.map(({date:M})=>t.filter(Il(he(M),Ae(M))).map(H=>H.clone())).map((M,H)=>Am(M,Ke(m[H].date,Cr(h).startTime),Ke(m[H].date,it(h).endTime),a,i)),[m,h,t,a,i]),y=U(()=>{const M=c(),H=m.findIndex(B=>Nt(B.date,M));if(H<0)return null;const x=Ke(m[H].date,e.rows[0].startTime),W=Ke(m[H].date,it(e.rows).endTime);return{startTime:x,endTime:W,currentDateIndex:H}},[m,c,e.rows]),[E,D]=$e(),C=U(()=>fi({rowsCount:h.length,columnsCount:m.length,container:E,narrowWeekend:o,startDayOfWeek:r}),[m.length,E,o,h.length,r]),S=_i({type:"timeGrid",gridPositionFinder:C,selectionSorter:Rr.sortSelection,dateGetter:Rr.getDateFromCollection,dateCollection:e}),N=Q(()=>{if(P(y)){const{startTime:M,endTime:H}=y,x=c();M<=x&&x<=H&&p({top:Hr(x,M,H),now:x})}},[y,c]);return ht(()=>{var M;u()&&(((M=y==null?void 0:y.currentDateIndex)!=null?M:-1)>=0?N():p(null))},[y,u,N]),Rm(N,P(y)?Qr:null),d("div",{className:Ws.timegrid},d("div",{className:Ws.scrollArea},d(Dm,{timeGridRows:h,nowIndicatorState:f}),d("div",{className:_("columns"),style:{left:l},ref:D,onMouseDown:vi(!n,S)},d(lm,{timeGridRows:h}),d(mm,{gridPositionFinder:C,timeGridData:e}),m.map((M,H)=>d(sm,{key:M.date.toString(),timeGridData:e,columnDate:M.date,columnWidth:K(M.width),columnIndex:H,totalUIModels:v,gridPositionFinder:C,isLastColumn:H===w})),s&&P(y)&&P(f)?d(gm,{top:f.top,columnWidth:m[0].width,columnCount:m.length,columnIndex:y.currentDateIndex}):null)))}function xm({isCollapsed:e}){const t=Se(),n=_("icon",{"ic-arrow-right":e,"ic-arrow-left":!e});return d("button",{className:_(De("timezone-collapse-button")),"aria-expanded":!e,onClick:()=>t.fire("clickTimezonesCollapseBtn",e)},d("span",{className:n,role:"img"}))}function Ys({label:e,offset:t,tooltip:n,width:o=100,left:r}){return d("div",{title:n,className:_(De("timezone-label")),style:{width:K(o),height:K(100),left:K(r)},role:"gridcell"},d(ne,{template:"timezoneDisplayLabel",param:{displayLabel:e,timezoneOffset:t},as:"span"}))}function Om(){const e=F(ym),t=F(Nl);return U(()=>({showTimezoneCollapseButton:e,timezonesCollapsed:t}),[e,t])}function Rl({top:e}){const t=F(za),{width:n}=ie(si),o=Lo(),{showTimezoneCollapseButton:r,timezonesCollapsed:i}=Om();if(t.length<=1)return null;const s=t.map(({displayLabel:p,timezoneName:m,tooltip:h})=>Le(p)?{label:null,offset:o(m).getTimezoneOffset(),tooltip:h!=null?h:m}:{label:p,offset:null,tooltip:h!=null?h:m}),[a,...c]=s,u=c.reverse(),l=i?1:t.length,f=100/l;return d("div",{style:{top:e,width:n},role:"columnheader",className:_("timezone-labels-slot")},!i&&u.map((p,m)=>{var h;return d(Ys,R({key:`subTimezone-${(h=p.label)!=null?h:p.offset}`,width:f,left:f*m},p))}),r&&d(xm,{isCollapsed:i}),d(Ys,R({width:f,left:f*u.length},a)))}const Lm={MONTH:"month",WEEK:"week",DAY:"day"},Hm=["milestone","task"],$m=["allday","time"];function Pl(e,t){const n=[];return e===!0?n.push(...Hm):Array.isArray(e)&&n.push(...e),t===!0?n.push(...$m):Array.isArray(t)&&n.push(...t),n}function Gm(e){const t=F(Oo),n=Lo();return U(()=>{if(t==="Local")return e;const o=vn(new O),{timedEvents:r=Qt(),totalEvents:i=Qt()}=e.groupBy(s=>s.category==="time"?"timedEvents":"totalEvents");return r.each(s=>{const a=Du(s);let c=n(t,a.start),u=n(t,a.end);o?(vn(c)||(c=c.addHours(1)),vn(u)||(u=u.addHours(1))):(vn(c)&&(c=c.addHours(-1)),vn(u)&&(u=u.addHours(-1))),a.start=c,a.end=u,i.add(a)}),i},[e,t,n])}function Si(e,...t){const n=U(()=>e.events.filter(Ze.and(...t)),[e.events,t]),o=Gm(n);return U(()=>ce(R({},e),{events:o}),[e,o])}function Bm(e){return/^(event|gridSelection)\/timeGrid/.test(e!=null?e:"")}function xl(e,t){_t(Rt,({y:n,draggingItemType:o,draggingState:r})=>{if(P(e)&&Bm(o)&&r===We.DRAGGING&&P(n)){const{offsetTop:i,offsetHeight:s,scrollHeight:a}=e,c=Math.floor(a/t),u=i+s;if(n<i+c){const l=n-(i+c);e.scrollTop=Math.max(0,e.scrollTop+l)}else if(n>u-c){const l=n-(u-c);e.scrollTop=Math.min(s,e.scrollTop+l)}}})}function Fm(e){var t,n,o;return(o=(n=(t=e.weekViewLayout)==null?void 0:t.dayGridRows)==null?void 0:n.time)==null?void 0:o.height}function Ol(e){const t=F(Fm),[n,o]=se(null);return ht(()=>{P(t)&&e&&o(e.offsetTop)},[t,e]),n}function Um(){const e=F(xo),t=F(Ye),{dayGridRows:n,lastPanelType:o}=F(Ba),{renderDate:r}=F(an);return U(()=>({calendar:e,options:t,gridRowLayout:n,lastPanelType:o,renderDate:r}),[e,t,n,o,r])}function zm(){var e,t;const{calendar:n,options:o,gridRowLayout:r,lastPanelType:i,renderDate:s}=Um(),a=F(Oo),c=ie(Q(q=>q.week.dayGridLeft.width,[])),[u,l]=$e(),f=o.week,{narrowWeekend:p,startDayOfWeek:m,workweek:h,hourStart:w,hourEnd:v,eventView:y,taskView:E}=f,D=U(()=>[s],[s]),C=Pa(D,(t=(e=o.week)==null?void 0:e.dayNames)!=null?t:[]),{rowStyleInfo:S,cellWidthMap:N}=oi(D.length,p,m,h),M=Si(n,o.eventFilter),H=U(()=>{const q=()=>a==="Local"?[he(D[0]),Ae(D[0])]:[he(It(D[0],-1)),Ae(It(D[0],1))],[T,k]=q();return il(D,M,{narrowWeekend:p,hourStart:w,hourEnd:v,weekStartDate:T,weekEndDate:k})},[M,D,v,w,p,a]),x=U(()=>ll(D,{hourStart:w,hourEnd:v,narrowWeekend:p}),[D,v,w,p]),W=Pl(E,y),B=W.map(q=>{var T,k;if(q==="time")return null;const X=q;return d(Xt,{key:X,name:X,resizable:X!==i},X==="allday"?d(_l,{events:H[X],rowStyleInfo:S,gridColWidthMap:N,weekDates:D,height:(T=r[X])==null?void 0:T.height,options:f}):d(yl,{category:X,events:H[X],weekDates:D,height:(k=r[X])==null?void 0:k.height,options:f,gridColWidthMap:N}))});xl(u,x.rows.length);const ee=Ol(u);return d(wi,{className:_("day-view"),autoAdjustPanels:!0},d(Xt,{name:"day-view-day-names",initialHeight:ya+wa*2},d(ai,{type:"week",dayNames:C,marginLeft:c,rowStyleInfo:S})),B,W.includes("time")?d(Xt,{name:"time",autoSize:1,ref:l},d(Al,{events:H.time,timeGridData:x}),d(Rl,{top:ee})):null)}function Wm({rowIndex:e,weekDates:t,narrowWeekend:n}){const o=F(Q(r=>r.gridSelection.accumulated.dayGridMonth.map(i=>bo.calculateSelection(i,e,t.length)),[e,t]));return d("div",{className:_("accumulated-grid-selection")},o.map(r=>r?d(pi,{type:"accumulated",gridSelectionData:r,weekDates:t,narrowWeekend:n}):null))}function Ym({type:e,number:t,onClickButton:n,className:o}){const{reset:r}=ye("dnd"),i=c=>{c.stopPropagation()},s=()=>{r(),n()},a=`monthGrid${e===Rn.header?"Header":"Footer"}Exceed`;return d("button",{type:"button",onMouseDown:i,onClick:s,className:o},d(ne,{template:a,param:t}))}function Vm({date:e,theme:t,renderDate:n,isToday:o}){const r=e.getDay(),s=n.getMonth()===e.getMonth(),{common:{holiday:a,saturday:c,today:u,dayName:l},month:{dayExceptThisMonth:f,holidayExceptThisMonth:p}}=t;return o?u.color:ti(r)?s?a.color:p.color:ni(r)?s?c.color:f.color:s?l.color:f.color}function jm(){const e=Wd(),t=ja();return U(()=>({common:e,month:t}),[e,t])}function Vs({type:e=Rn.header,exceedCount:t=0,date:n,onClickExceedCount:o}){const{renderDate:r}=F(an),[,i]=Ho(),s=jm(),a=s.month.gridCell[`${e}Height`],c=pe(n,"YYYYMMDD"),u=pe(i(),"YYYYMMDD"),l=c===u,f={date:pe(n,"YYYY-MM-DD"),day:n.getDay(),hiddenEventCount:t,isOtherMonth:n.getMonth()!==r.getMonth(),isToday:c===u,month:n.getMonth(),ymd:c},p={color:Vm({date:n,theme:s,isToday:l,renderDate:r})},m=`monthGrid${Ro(e)}`;return Y(a)?null:d("div",{className:_(`grid-cell-${e}`),style:{height:a}},d("span",{className:_("grid-cell-date"),style:p},d(ne,{template:m,param:f})),t?d(Ym,{type:e,number:t,onClickButton:o,className:_("grid-cell-more-events")}):null)}function Xm({grid:e,offsetWidth:t,eventLength:n,layerSize:o}){const r=La(e).height+lr*2;let i=t+lr*2;const{width:s,height:a}=o,c=10;i=Math.max(i,Vc);let u=io+Tr+lr;const l=Zt+No;return n<=c?u+=l*n:u+=l*c,s&&(i=s),a&&(u=a),(isNaN(u)||u<r)&&(u=r),{width:i,height:u}}function Km(e,t,n){const{width:o,height:r,left:i,top:s}=t,{width:a,height:c}=e,u=i+o,l=s+r;let f=n.left+n.width/2-a/2,{top:p}=n;const m=f<i,h=f+a>u,w=p<s,v=p+c>l;return m&&(f=i),h&&(f=u-a),w&&(p=s),v&&(p=l-c),{top:p+window.scrollY-s,left:f+window.scrollX-i}}function qm({layoutContainer:e,cell:t,popupSize:n}){const o=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=Km(n,o,r);return R(R({},n),i)}function Zm(e,t,n){const{width:o,height:r}=ie(Pd),i=Se(),[s,a]=$e(),[c,u]=se(null);return oe(()=>{if(n&&t&&s){const l=()=>{const f=Xm({grid:t,offsetWidth:s.offsetWidth,eventLength:e,layerSize:{width:o,height:r}}),p=qm({cell:s,layoutContainer:n,popupSize:f});return u(p),p};return l(),i.on("layoutResized",l),()=>{i.off("layoutResized",l)}}return At},[n,s,e,t,o,r,i]),{popupPosition:c,containerRefCallback:a}}function Jm(e){return e.month.weekend.backgroundColor}function Qm({date:e,events:t=[],style:n,parentContainer:o,contentAreaHeight:r}){const i=Pt(),{showSeeMorePopup:s}=ye("popup"),a=ie(Jm),{popupPosition:c,containerRefCallback:u}=Zm(t.length,o,i),l=Q(()=>{c&&s({date:e,popupPosition:c,events:t})},[e,t,c,s]),f=nl(t,r,Zt+No);return d("div",{className:_("daygrid-cell"),style:ce(R({},n),{backgroundColor:Ge(e.getDay())?a:"inherit"}),ref:u},d(Vs,{type:Rn.header,exceedCount:f,date:e,onClickExceedCount:l}),d(Vs,{type:Rn.footer,exceedCount:f,date:e,onClickExceedCount:l}))}const eh=ln(function({week:t,rowInfo:n,gridDateEventModelMap:o={},contentAreaHeight:r}){const[i,s]=$e(),a=ie(Q(c=>c.common.border,[]));return d("div",{className:_("weekday-grid"),style:{borderTop:a},ref:s},t.map((c,u)=>{const l=c.getDay(),{width:f,left:p}=n[u],m=pe(he(c),"YYYYMMDD");return d(Qm,{key:`daygrid-cell-${l}`,date:c,style:{width:K(f),left:K(p)},parentContainer:i,events:o[m],contentAreaHeight:r})}))});function th({weekDates:e,narrowWeekend:t,rowIndex:n}){const o=F(Q(r=>bo.calculateSelection(r.gridSelection.dayGridMonth,n,e.length),[n,e.length]));return Y(o)?null:d(pi,{type:"month",gridSelectionData:o,weekDates:e,narrowWeekend:t})}const nh=ln(function({contentAreaHeight:t,eventHeight:n=Je,events:o,name:r,className:i}){const{headerHeight:s}=ie(Va),a=o.filter(ui(t,n+No)).map(c=>d(wt,{key:`${r}-DayEvent-${c.cid()}`,uiModel:c,eventHeight:n,headerHeight:s!=null?s:Io}));return d("div",{className:i},a)});function oh({dateMatrix:e,rowInfo:t,gridPositionFinder:n,rowIndex:o}){const r=Se(),{isDraggingEnd:i,isDraggingCanceled:s,draggingEvent:a,clearDraggingEvent:c}=dn("dayGrid","move"),[u,l]=un(n),f=U(()=>{var p,m;let h=null;return a&&(u==null?void 0:u.rowIndex)===o&&(h=a,h.left=t[(p=u==null?void 0:u.columnIndex)!=null?p:0].left,h.width=t[(m=u==null?void 0:u.columnIndex)!=null?m:0].width),h},[a,u==null?void 0:u.rowIndex,u==null?void 0:u.columnIndex,o,t]);return cn(()=>{if(!s&&P(f)&&P(u)){const m=f.model.getStarts(),h=f.duration(),w=e[u.rowIndex][u.columnIndex],v=ri(w,m)*at,y=new O(m.getTime()+v),E=new O(y.getTime()+h);r.fire("beforeUpdateEvent",{event:f.model.toEventObject(),changes:{start:y,end:E}})}c(),l()},i),f}function rh({dateMatrix:e,gridPositionFinder:t,rowInfo:n,rowIndex:o}){const r=oh({dateMatrix:e,rowInfo:n,gridPositionFinder:t,rowIndex:o});return Y(r)?null:d(wt,{uiModel:r,movingLeft:r.left,eventHeight:Je,headerHeight:qr+Io})}function js(e,t){const n=Math.max(To(e.getStarts(),t),0),o=To(e.getEnds(),t);return{startColumnIndex:n,endColumnIndex:o}}function ih({dateMatrix:e,gridPositionFinder:t,renderedUIModels:n,cellWidthMap:o,rowIndex:r}){const i=Se(),{isDraggingEnd:s,isDraggingCanceled:a,draggingEvent:c,clearDraggingEvent:u}=dn("dayGrid","resize"),[l,f]=un(t),[p,m]=se(null),h=Q(()=>{m(null),f(),u()},[f,u]),w=U(()=>{if(Y(c))return null;const y=n.map(({uiModels:N})=>N.filter(M=>M.cid()===c.cid())),E=y.findIndex(N=>N.length>0),D=Jr(y,N=>N.length>0),C=js(y[E][0],e[E]),S=js(y[D][0],e[D]);return{eventStartDateColumnIndex:C.startColumnIndex,eventStartDateRowIndex:E,eventEndDateColumnIndex:S.endColumnIndex,eventEndDateRowIndex:D,resizeTargetUIModelRows:y}},[e,n,c]),v=P(w)&&P(c)&&P(l);return oe(()=>{if(v&&r===w.eventStartDateRowIndex){const{eventStartDateRowIndex:y,eventStartDateColumnIndex:E}=w,D=w.resizeTargetUIModelRows[y][0].clone();let C;y===l.rowIndex?C=o[E][Math.max(E,l.columnIndex)]:y>l.rowIndex?C=o[E][E]:(C=o[E][e[r].length-1],D.setUIProps({exceedRight:!0})),m([D,C])}},[w,v,o,l,e,r]),oe(()=>{if(v&&w.eventStartDateRowIndex<r&&r<l.rowIndex){const y=c.clone();y.setUIProps({left:0,exceedLeft:!0,exceedRight:!0}),m([y,"100%"])}},[w,v,l,c,r]),oe(()=>{if(v&&w.eventStartDateRowIndex<l.rowIndex&&r===l.rowIndex){const y=c.clone();y.setUIProps({left:0,exceedLeft:!0}),m([y,o[0][l.columnIndex]])}},[w,v,o,l,c,r]),oe(()=>{v&&r>w.eventStartDateRowIndex&&r>l.rowIndex&&m(null)},[v,l,w,r]),cn(()=>{if(v){const{eventStartDateColumnIndex:y,eventStartDateRowIndex:E}=w;if(!a&&(l.rowIndex===E&&l.columnIndex>=y||l.rowIndex>E)){const C=e[l.rowIndex][l.columnIndex];i.fire("beforeUpdateEvent",{event:c.model.toEventObject(),changes:{end:C}})}}h()},s),p}function sh({dateMatrix:e,cellWidthMap:t,gridPositionFinder:n,renderedUIModels:o,rowIndex:r}){const i=ih({dateMatrix:e,gridPositionFinder:n,cellWidthMap:t,renderedUIModels:o,rowIndex:r});if(Y(i))return null;const[s,a]=i;return d("div",{className:_("weekday-events")},d(wt,{key:`resizing-event-${s.cid()}`,uiModel:s,eventHeight:Zt,headerHeight:qr+Io,resizingWidth:a}))}const ah=100;function lh(e){const t=F(_m),{headerHeight:n,footerHeight:o}=ie(Va),r=te(null),[i,s]=se(0);return oe(()=>{if(r.current){const a=La(r.current).height,c=qr+(n!=null?n:Io),u=o!=null?o:0,l=a-c-u,f=t*(e+No);s(Math.min(l,f))}},[o,n,e,t]),{ref:r,cellContentAreaHeight:i}}function ch({dateMatrix:e=[],rowInfo:t=[],cellWidthMap:n=[]}){const[o,r]=$e(),i=F(xo),{ref:s,cellContentAreaHeight:a}=lh(Zt),{eventFilter:c,month:u,isReadOnly:l}=F(Ye),{narrowWeekend:f,startDayOfWeek:p}=u,m=ah/e.length,h=U(()=>fi({container:o,rowsCount:e.length,columnsCount:e[0].length,narrowWeekend:f,startDayOfWeek:p}),[e,o,f,p]),w=Si(i,c),v=U(()=>e.map(E=>hf(E,w,f)),[w,e,f]),y=_i({type:"dayGridMonth",gridPositionFinder:h,dateCollection:e,dateGetter:bo.getDateFromCollection,selectionSorter:bo.sortSelection});return d("div",{ref:r,onMouseDown:vi(!l,y),className:_("month-daygrid")},e.map((E,D)=>{const{uiModels:C,gridDateEventModelMap:S}=v[D];return d("div",{key:`dayGrid-events-${D}`,className:_("month-week-item"),style:{height:K(m)},ref:s},d("div",{className:_("weekday")},d(eh,{gridDateEventModelMap:S,week:E,rowInfo:t,contentAreaHeight:a}),d(nh,{name:"month",events:C,contentAreaHeight:a,eventHeight:Zt,className:_("weekday-events")}),d(th,{weekDates:E,narrowWeekend:f,rowIndex:D}),d(Wm,{rowIndex:D,weekDates:E,narrowWeekend:f})),d(sh,{dateMatrix:e,gridPositionFinder:h,rowIndex:D,cellWidthMap:n,renderedUIModels:v}),d(rh,{dateMatrix:e,gridPositionFinder:h,rowIndex:D,rowInfo:t}))}))}function uh(e){const{dayNames:t,startDayOfWeek:n,workweek:o}=e.month;return[...Array(7)].map((s,a)=>(n+a)%7).map(s=>({day:s,label:Ro(t[s])})).filter(s=>o?!Ge(s.day):!0)}function dh(){const e=F(Ye),{renderDate:t}=F(an),n=uh(e),o=e.month,{narrowWeekend:r,startDayOfWeek:i,workweek:s}=o,a=U(()=>sl(t,o),[o,t]),{rowStyleInfo:c,cellWidthMap:u}=U(()=>oi(n.length,r,i,s),[n.length,r,i,s]),l=c.map((f,p)=>ce(R({},f),{date:a[0][p]}));return d(wi,{className:_("month")},d(ai,{type:"month",dayNames:n,options:o,rowStyleInfo:c}),d(ch,{dateMatrix:a,rowInfo:l,cellWidthMap:u}))}function fh(){const e=F(Ye),t=F(xo),{dayGridRows:n,lastPanelType:o}=F(Ba),{renderDate:r}=F(an);return U(()=>({options:e,calendar:t,gridRowLayout:n,lastPanelType:o,renderDate:r}),[t,n,o,e,r])}function ph(){var e,t;const{options:n,calendar:o,gridRowLayout:r,lastPanelType:i,renderDate:s}=fh(),a=ie(Q(T=>T.week.dayGridLeft.width,[])),c=F(Oo),[u,l]=$e(),f=n.week,{narrowWeekend:p,startDayOfWeek:m,workweek:h,hourStart:w,hourEnd:v,eventView:y,taskView:E}=f,D=U(()=>al(s,f),[s,f]),C=Pa(D,(t=(e=n.week)==null?void 0:e.dayNames)!=null?t:[]),{rowStyleInfo:S,cellWidthMap:N}=oi(D.length,p,m,h),M=Si(o,n.eventFilter),H=U(()=>{const T=()=>c==="Local"?[he(Cr(D)),Ae(it(D))]:[he(It(Cr(D),-1)),Ae(It(it(D),1))],[k,X]=T();return il(D,M,{narrowWeekend:p,hourStart:w,hourEnd:v,weekStartDate:k,weekEndDate:X})},[M,v,w,p,c,D]),x=U(()=>ll(D,{hourStart:w,hourEnd:v,narrowWeekend:p}),[v,w,p,D]),W=Pl(E,y),B=W.map(T=>{var k,X;if(T==="time")return null;const z=T;return d(Xt,{name:z,key:z,resizable:z!==i},z==="allday"?d(_l,{events:H[z],rowStyleInfo:S,gridColWidthMap:N,weekDates:D,height:(k=r[z])==null?void 0:k.height,options:f}):d(yl,{category:z,events:H[z],weekDates:D,height:(X=r[z])==null?void 0:X.height,options:f,gridColWidthMap:N}))}),ee=U(()=>W.includes("time"),[W]);xl(u,x.rows.length);const q=Ol(u);return d(wi,{className:_("week-view"),autoAdjustPanels:!0},d(Xt,{name:"week-view-day-names",initialHeight:ya+wa*2},d(ai,{type:"week",dayNames:C,marginLeft:a,options:f,rowStyleInfo:S})),B,ee?d(Xt,{name:"time",autoSize:1,ref:l},d(Al,{events:H.time,timeGridData:x}),d(Rl,{top:q})):null)}const mh={month:dh,week:ph,day:zm};function hh(){const{currentView:e}=F(an),t=U(()=>mh[e]||(()=>null),[e]);return d(t,null)}var gh=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,vh=/[&<>"]/;function Xs(e){var t=String(e);return vh.test(t)?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):t}var Ks=function(e,t){return String(e).replace(/(\n+)/g,"$1"+(t||" "))},qs=function(e,t,n){return String(e).length>(t||40)||!n&&String(e).indexOf(`
|
|
`)!==-1||String(e).indexOf("<")!==-1},Zs={};function _h(e){var t="";for(var n in e){var o=e[n];o!=null&&o!==""&&(t&&(t+=" "),t+=n[0]=="-"?n:Zs[n]||(Zs[n]=n.replace(/([A-Z])/g,"-$1").toLowerCase()),t+=": ",t+=o,typeof o=="number"&&gh.test(n)===!1&&(t+="px"),t+=";")}return t||void 0}function no(e,t){for(var n in t)e[n]=t[n];return e}function Gr(e,t){return Array.isArray(t)?t.reduce(Gr,e):t!=null&&t!==!1&&e.push(t),e}var yh={shallow:!0},hr=[],wh=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,Js=/[\s\n\\/='"\0<>]/;function Qs(){this.__d=!0}xn.render=xn;var Eh=function(e,t){return xn(e,t,yh)},ea=[];function xn(e,t,n){t=t||{},n=n||{};var o=$.__s;$.__s=!0;var r=En(e,t,n);return $.__c&&$.__c(e,ea),ea.length=0,$.__s=o,r}function En(e,t,n,o,r,i){if(e==null||typeof e=="boolean")return"";if(typeof e!="object")return Xs(e);var s=n.pretty,a=s&&typeof s=="string"?s:" ";if(Array.isArray(e)){for(var c="",u=0;u<e.length;u++)s&&u>0&&(c+=`
|
|
`),c+=En(e[u],t,n,o,r,i);return c}var l,f=e.type,p=e.props,m=!1;if(typeof f=="function"){if(m=!0,!n.shallow||!o&&n.renderRootComponent!==!1){if(f===Me){var h=[];return Gr(h,e.props.children),En(h,t,n,n.shallowHighOrder!==!1,r,i)}var w,v=e.__c={__v:e,context:t,props:e.props,setState:Qs,forceUpdate:Qs,__d:!0,__h:[]};$.__b&&$.__b(e);var y=$.__r;if(f.prototype&&typeof f.prototype.render=="function"){var E=f.contextType,D=E&&t[E.__c],C=E!=null?D?D.props.value:E.__:t;(v=e.__c=new f(p,C)).__v=e,v._dirty=v.__d=!0,v.props=p,v.state==null&&(v.state={}),v._nextState==null&&v.__s==null&&(v._nextState=v.__s=v.state),v.context=C,f.getDerivedStateFromProps?v.state=no(no({},v.state),f.getDerivedStateFromProps(v.props,v.state)):v.componentWillMount&&(v.componentWillMount(),v.state=v._nextState!==v.state?v._nextState:v.__s!==v.state?v.__s:v.state),y&&y(e),w=v.render(v.props,v.state,v.context)}else for(var S=f.contextType,N=S&&t[S.__c],M=S!=null?N?N.props.value:S.__:t,H=0;v.__d&&H++<25;)v.__d=!1,y&&y(e),w=f.call(e.__c,p,M);return v.getChildContext&&(t=no(no({},t),v.getChildContext())),$.diffed&&$.diffed(e),En(w,t,n,n.shallowHighOrder!==!1,r,i)}f=(l=f).displayName||l!==Function&&l.name||function(xt){var Ot=(Function.prototype.toString.call(xt).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!Ot){for(var ut=-1,Lt=hr.length;Lt--;)if(hr[Lt]===xt){ut=Lt;break}ut<0&&(ut=hr.push(xt)-1),Ot="UnnamedComponent"+ut}return Ot}(l)}var x,W,B="<"+f;if(p){var ee=Object.keys(p);n&&n.sortAttributes===!0&&ee.sort();for(var q=0;q<ee.length;q++){var T=ee[q],k=p[T];if(T!=="children"){if(!Js.test(T)&&(n&&n.allAttributes||T!=="key"&&T!=="ref"&&T!=="__self"&&T!=="__source")){if(T==="defaultValue")T="value";else if(T==="defaultChecked")T="checked";else if(T==="defaultSelected")T="selected";else if(T==="className"){if(p.class!==void 0)continue;T="class"}else r&&/^xlink:?./.test(T)&&(T=T.toLowerCase().replace(/^xlink:?/,"xlink:"));if(T==="htmlFor"){if(p.for)continue;T="for"}T==="style"&&k&&typeof k=="object"&&(k=_h(k)),T[0]==="a"&&T[1]==="r"&&typeof k=="boolean"&&(k=String(k));var X=n.attributeHook&&n.attributeHook(T,k,t,n,m);if(X||X==="")B+=X;else if(T==="dangerouslySetInnerHTML")W=k&&k.__html;else if(f==="textarea"&&T==="value")x=k;else if((k||k===0||k==="")&&typeof k!="function"){if(!(k!==!0&&k!==""||(k=T,n&&n.xml))){B=B+" "+T;continue}if(T==="value"){if(f==="select"){i=k;continue}f==="option"&&i==k&&p.selected===void 0&&(B+=" selected")}B=B+" "+T+'="'+Xs(k)+'"'}}}else x=k}}if(s){var z=B.replace(/\n\s*/," ");z===B||~z.indexOf(`
|
|
`)?s&&~B.indexOf(`
|
|
`)&&(B+=`
|
|
`):B=z}if(B+=">",Js.test(f))throw new Error(f+" is not a valid HTML tag name in "+B);var me,V=wh.test(f)||n.voidElements&&n.voidElements.test(f),ue=[];if(W)s&&qs(W)&&(W=`
|
|
`+a+Ks(W,a)),B+=W;else if(x!=null&&Gr(me=[],x).length){for(var He=s&&~B.indexOf(`
|
|
`),ct=!1,Qe=0;Qe<me.length;Qe++){var ae=me[Qe];if(ae!=null&&ae!==!1){var Re=En(ae,t,n,!0,f==="svg"||f!=="foreignObject"&&r,i);if(s&&!He&&qs(Re)&&(He=!0),Re)if(s){var Ve=Re.length>0&&Re[0]!="<";ct&&Ve?ue[ue.length-1]+=Re:ue.push(Re),ct=Ve}else ue.push(Re)}}if(s&&He)for(var Et=ue.length;Et--;)ue[Et]=`
|
|
`+a+Ks(ue[Et],a)}if(ue.length||W)B+=ue.join("");else if(n&&n.xml)return B.substring(0,B.length-1)+" />";return!V||me||W?(s&&~B.indexOf(`
|
|
`)&&(B+=`
|
|
`),B=B+"</"+f+">"):B=B.replace(/>$/," />"),B}xn.shallowRender=Eh;function Dh(e,t,n){var o;n=n||null;for(o in e)if(e.hasOwnProperty(o)&&t.call(n,e[o],o,e)===!1)break}var Ll=Dh,Sh=Ll;function Th(e,t){var n=document.createElement("img"),o="";return Sh(t,function(r,i){o+="&"+i+"="+r}),o=o.substring(1),n.src=e+"?"+o,n.style.display="none",document.body.appendChild(n),document.body.removeChild(n),n}var bh=Th,Ch=Le,kh=bh,Nh=7*24*60*60*1e3;function Ih(e){var t=new Date().getTime();return t-e>Nh}function Mh(e,t){var n="https://www.google-analytics.com/collect",o=location.hostname,r="event",i="use",s="TOAST UI "+e+" for "+o+": Statistics",a=window.localStorage.getItem(s);!Ch(window.tui)&&window.tui.usageStatistics===!1||a&&!Ih(a)||(window.localStorage.setItem(s,new Date().getTime()),setTimeout(function(){(document.readyState==="interactive"||document.readyState==="complete")&&kh(n,{v:1,t:r,tid:t,cid:o,dp:o,dh:e,el:e,ec:i})},1e3))}var Ah=Mh;function ta({theme:e,store:t,eventBus:n,children:o}){return d(Cd,{value:n},d(zd,{store:e},d(Dd,{store:t},d(vp,null,o))))}const Rh="UA-129951699-1";function Ph(e,t){var n=Object.prototype.hasOwnProperty,o,r,i,s;for(i=1,s=arguments.length;i<s;i+=1){o=arguments[i];for(r in o)n.call(o,r)&&(e[r]=o[r])}return e}var xh=Ph;function Oh(e){return e===null}var Lh=Oh,Hh=Le,$h=Lh;function Gh(e){return!Hh(e)&&!$h(e)}var Bh=Gh;function Fh(e){return e instanceof Array}var Hl=Fh;function Uh(e){return e instanceof Function}var zh=Uh;function Wh(e,t,n){var o=0,r=e.length;for(n=n||null;o<r&&t.call(n,e[o],o,e)!==!1;o+=1);}var Yh=Wh,Vh=Hl,jh=Yh,Xh=Ll;function Kh(e,t,n){Vh(e)?jh(e,t,n):Xh(e,t,n)}var qh=Kh,Zh=xh,$l=Bh,Ti=be,bi=ao,Jh=Hl,Ci=zh,st=qh,Gl=/\s+/g;function le(){this.events=null,this.contexts=null}le.mixin=function(e){Zh(e.prototype,le.prototype)};le.prototype._getHandlerItem=function(e,t){var n={handler:e};return t&&(n.context=t),n};le.prototype._safeEvent=function(e){var t=this.events,n;return t||(t=this.events={}),e&&(n=t[e],n||(n=[],t[e]=n),t=n),t};le.prototype._safeContext=function(){var e=this.contexts;return e||(e=this.contexts=[]),e};le.prototype._indexOfContext=function(e){for(var t=this._safeContext(),n=0;t[n];){if(e===t[n][0])return n;n+=1}return-1};le.prototype._memorizeContext=function(e){var t,n;!$l(e)||(t=this._safeContext(),n=this._indexOfContext(e),n>-1?t[n][1]+=1:t.push([e,1]))};le.prototype._forgetContext=function(e){var t,n;!$l(e)||(t=this._safeContext(),n=this._indexOfContext(e),n>-1&&(t[n][1]-=1,t[n][1]<=0&&t.splice(n,1)))};le.prototype._bindEvent=function(e,t,n){var o=this._safeEvent(e);this._memorizeContext(n),o.push(this._getHandlerItem(t,n))};le.prototype.on=function(e,t,n){var o=this;Ti(e)?(e=e.split(Gl),st(e,function(r){o._bindEvent(r,t,n)})):bi(e)&&(n=t,st(e,function(r,i){o.on(i,r,n)}))};le.prototype.once=function(e,t,n){var o=this;if(bi(e)){n=t,st(e,function(i,s){o.once(s,i,n)});return}function r(){t.apply(n,arguments),o.off(e,r,n)}this.on(e,r,n)};le.prototype._spliceMatches=function(e,t){var n=0,o;if(!!Jh(e))for(o=e.length;n<o;n+=1)t(e[n])===!0&&(e.splice(n,1),o-=1,n-=1)};le.prototype._matchHandler=function(e){var t=this;return function(n){var o=e===n.handler;return o&&t._forgetContext(n.context),o}};le.prototype._matchContext=function(e){var t=this;return function(n){var o=e===n.context;return o&&t._forgetContext(n.context),o}};le.prototype._matchHandlerAndContext=function(e,t){var n=this;return function(o){var r=e===o.handler,i=t===o.context,s=r&&i;return s&&n._forgetContext(o.context),s}};le.prototype._offByEventName=function(e,t){var n=this,o=Ci(t),r=n._matchHandler(t);e=e.split(Gl),st(e,function(i){var s=n._safeEvent(i);o?n._spliceMatches(s,r):(st(s,function(a){n._forgetContext(a.context)}),n.events[i]=[])})};le.prototype._offByHandler=function(e){var t=this,n=this._matchHandler(e);st(this._safeEvent(),function(o){t._spliceMatches(o,n)})};le.prototype._offByObject=function(e,t){var n=this,o;this._indexOfContext(e)<0?st(e,function(r,i){n.off(i,r)}):Ti(t)?(o=this._matchContext(e),n._spliceMatches(this._safeEvent(t),o)):Ci(t)?(o=this._matchHandlerAndContext(t,e),st(this._safeEvent(),function(r){n._spliceMatches(r,o)})):(o=this._matchContext(e),st(this._safeEvent(),function(r){n._spliceMatches(r,o)}))};le.prototype.off=function(e,t){Ti(e)?this._offByEventName(e,t):arguments.length?Ci(e)?this._offByHandler(e):bi(e)&&this._offByObject(e,t):(this.events={},this.contexts=[])};le.prototype.fire=function(e){this.invoke.apply(this,arguments)};le.prototype.invoke=function(e){var t,n,o,r;if(!this.hasListener(e))return!0;for(t=this._safeEvent(e),n=Array.prototype.slice.call(arguments,1),o=0;t[o];){if(r=t[o],r.handler.apply(r.context,n)===!1)return!1;o+=1}return!0};le.prototype.hasListener=function(e){return this.getListenerLength(e)>0};le.prototype.getListenerLength=function(e){var t=this._safeEvent(e);return t.length};var Qh=le;class eg extends Qh{on(t,n){return super.on(t,n),this}off(t,n){return super.off(t,n),this}fire(t,...n){return super.fire(t,...n),this}once(t,n){return super.once(t,n),this}}class tg{constructor(t,n={}){var o;this.container=be(t)?(o=document==null?void 0:document.querySelector(t))!=null?o:null:t,this.theme=Ud(n.theme),this.eventBus=new eg,this.store=Ed(n),this.renderRange=this.calculateRenderRange(he()),Sd(),this.getStoreState().options.usageStatistics===!0&&Ah("calendar",Rh)}getStoreState(t){const n=this.store.getState();return t?n[t]:n}getStoreDispatchers(t){const n=this.store.getState().dispatch;return t?n[t]:n}destroy(){this.container&&Gf(this.container),this.store.clearListeners(),this.theme.clearListeners(),this.eventBus.off(),Td();for(const t in this)this.hasOwnProperty(t)&&delete this[t]}calculateMonthRenderDate({renderDate:t,offset:n,monthOptions:o}){let r=new O(t);const{visibleWeeksCount:i}=o;i>0?r=It(r,n*7*i):r=$u(r,n);const s=sl(r,o),[[a]]=s,c=it(it(s));return{renderDate:r,renderRange:{start:a,end:c}}}calculateWeekRenderDate({renderDate:t,offset:n,weekOptions:o}){const r=new O(t);r.addDate(n*7);const i=al(r,o),[s]=i,a=it(i);return{renderDate:r,renderRange:{start:s,end:a}}}calculateDayRenderDate({renderDate:t,offset:n}){const o=new O(t);o.addDate(n);const r=he(o),i=Ae(o);return{renderDate:o,renderRange:{start:r,end:i}}}move(t){if(Y(t))return;const{currentView:n,renderDate:o}=this.getStoreState().view,{options:r}=this.getStoreState(),{setRenderDate:i}=this.getStoreDispatchers().view,s=new O(o);let a={renderDate:s,renderRange:{start:new O(s),end:new O(s)}};n==="month"?a=this.calculateMonthRenderDate({renderDate:o,offset:t,monthOptions:r.month}):n==="week"?a=this.calculateWeekRenderDate({renderDate:o,offset:t,weekOptions:r.week}):n==="day"&&(a=this.calculateDayRenderDate({renderDate:o,offset:t})),i(a.renderDate),this.renderRange=a.renderRange}createEvents(t){const{createEvents:n}=this.getStoreDispatchers("calendar");n(t)}getEventModel(t,n){const{events:o}=this.getStoreState("calendar");return o.find(({id:r,calendarId:i})=>r===t&&i===n)}getEvent(t,n){var o,r;return(r=(o=this.getEventModel(t,n))==null?void 0:o.toEventObject())!=null?r:null}updateEvent(t,n,o){const{updateEvent:r}=this.getStoreDispatchers("calendar"),i=this.getEventModel(t,n);i&&r({event:i,eventData:o})}deleteEvent(t,n){const{deleteEvent:o}=this.getStoreDispatchers("calendar"),r=this.getEventModel(t,n);r&&o(r)}setCalendarVisibility(t,n){const{setCalendarVisibility:o}=this.getStoreDispatchers("calendar"),r=Array.isArray(t)?t:[t];o(r,n)}render(){return P(this.container)&&mo(d(ta,{theme:this.theme,store:this.store,eventBus:this.eventBus},this.getComponent()),this.container),this}renderToString(){return xn(d(ta,{theme:this.theme,store:this.store,eventBus:this.eventBus},this.getComponent()))}clear(){const{clearEvents:t}=this.getStoreDispatchers("calendar");t()}scrollToNow(t="auto"){this.eventBus.fire("scrollToNow",t)}calculateRenderRange(t){const{currentView:n}=this.getStoreState().view,{options:o}=this.getStoreState(),r=new O(t);let i={start:new O(r),end:new O(r)};return n==="month"?i=this.calculateMonthRenderDate({renderDate:t,offset:0,monthOptions:o.month}).renderRange:n==="week"?i=this.calculateWeekRenderDate({renderDate:t,offset:0,weekOptions:o.week}).renderRange:n==="day"&&(i=this.calculateDayRenderDate({renderDate:t,offset:0}).renderRange),i}today(){const{setRenderDate:t}=this.getStoreDispatchers().view,n=new O;t(n),this.renderRange=this.calculateRenderRange(n)}setDate(t){const{setRenderDate:n}=this.getStoreDispatchers("view"),o=new O(t);n(o),this.renderRange=this.calculateRenderRange(o)}next(){this.move(1)}prev(){this.move(-1)}setCalendarColor(t,n){const{setCalendarColor:o}=this.getStoreDispatchers().calendar;o(t,n)}changeView(t){const{changeView:n}=this.getStoreDispatchers("view");n(t),this.renderRange=this.calculateRenderRange(this.getDate())}getElement(t,n){return this.getEvent(t,n)&&this.container?this.container.querySelector(`[data-event-id="${t}"][data-calendar-id="${n}"]`):null}setTheme(t){const{setTheme:n}=this.theme.getState().dispatch;n(t)}getOptions(){const{options:t,template:n}=this.getStoreState(),o=this.theme.getState(),r=gr(o,["dispatch"]);return ce(R({},t),{template:n,theme:r})}setOptions(t){const n=t,{theme:o,template:r}=n,i=gr(n,["theme","template"]),{setTheme:s}=this.theme.getState().dispatch,{options:{setOptions:a},template:{setTemplate:c}}=this.getStoreDispatchers();P(o)&&s(o),P(r)&&c(r),a(i)}getDate(){const{renderDate:t}=this.getStoreState().view;return t}getDateRangeStart(){return this.renderRange.start}getDateRangeEnd(){return this.renderRange.end}getViewName(){const{currentView:t}=this.getStoreState("view");return t}setCalendars(t){const{setCalendars:n}=this.getStoreDispatchers().calendar;n(t)}openFormPopup(t){const{showFormPopup:n}=this.getStoreDispatchers().popup,o=new ii(t),{title:r,location:i,start:s,end:a,isAllday:c,isPrivate:u,state:l}=o;n({isCreationPopup:!0,event:o,title:r,location:i,start:s,end:a,isAllday:c,isPrivate:u,eventState:l})}clearGridSelections(){const{clearAll:t}=this.getStoreDispatchers().gridSelection;t()}fire(t,...n){return this.eventBus.fire(t,...n),this}off(t,n){return this.eventBus.off(t,n),this}on(t,n){return this.eventBus.on(t,n),this}once(t,n){return this.eventBus.once(t,n),this}}function ng(e){return!!Object.values(Lm).find(t=>t===e)}class sg extends tg{constructor(t,n={}){super(t,n);const{defaultView:o="week"}=n;if(!ng(o))throw new fu(o);this.render()}getComponent(){return d(hh,null)}}export{sg as C};
|