UNPKG

gantt-source_management

Version:

Gantt, Schedule,

98 lines 411 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).GSTC=e()}(this,(function(){"use strict"; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */var t;const e=globalThis.trustedTypes,i=e?e.createPolicy("lit-html",{createHTML:t=>t}):void 0,a=`lit$${(Math.random()+"").slice(9)}$`,s="?"+a,n=`<${s}>`,o=document,r=(t="")=>o.createComment(t),l=t=>null===t||"object"!=typeof t&&"function"!=typeof t,c=Array.isArray,u=t=>{var e;return c(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])},h=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,d=/-->/g,m=/>/g,g=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,f=/'/g,p=/"/g,b=/^(?:script|style|textarea|title)$/i,v=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),y=v(1),w=v(2),k=Symbol.for("lit-noChange"),x=Symbol.for("lit-nothing"),D=new WeakMap,$=(t,e,i)=>{var a,s;const n=null!==(a=null==i?void 0:i.renderBefore)&&void 0!==a?a:e;let o=n._$litPart$;if(void 0===o){const t=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:null;n._$litPart$=o=new T(e.insertBefore(r(),t),t,void 0,null!=i?i:{})}return o._$AI(t),o},S=o.createTreeWalker(o,129,null,!1),P=(t,e)=>{const s=t.length-1,o=[];let r,l=2===e?"<svg>":"",c=h;for(let e=0;e<s;e++){const i=t[e];let s,u,v=-1,y=0;for(;y<i.length&&(c.lastIndex=y,u=c.exec(i),null!==u);)y=c.lastIndex,c===h?"!--"===u[1]?c=d:void 0!==u[1]?c=m:void 0!==u[2]?(b.test(u[2])&&(r=RegExp("</"+u[2],"g")),c=g):void 0!==u[3]&&(c=g):c===g?">"===u[0]?(c=null!=r?r:h,v=-1):void 0===u[1]?v=-2:(v=c.lastIndex-u[2].length,s=u[1],c=void 0===u[3]?g:'"'===u[3]?p:f):c===p||c===f?c=g:c===d||c===m?c=h:(c=g,r=void 0);const w=c===g&&t[e+1].startsWith("/>")?" ":"";l+=c===h?i+n:v>=0?(o.push(s),i.slice(0,v)+"$lit$"+i.slice(v)+a+w):i+a+(-2===v?(o.push(void 0),e):w)}const u=l+(t[s]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==i?i.createHTML(u):u,o]};class C{constructor({strings:t,_$litType$:i},n){let o;this.parts=[];let l=0,c=0;const u=t.length-1,h=this.parts,[d,m]=P(t,i);if(this.el=C.createElement(d,n),S.currentNode=this.el.content,2===i){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=S.nextNode())&&h.length<u;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(a)){const i=m[c++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+"$lit$").split(a),e=/([.?@])?(.*)/.exec(i);h.push({type:1,index:l,name:e[2],strings:t,ctor:"."===e[1]?M:"?"===e[1]?_:"@"===e[1]?j:A})}else h.push({type:6,index:l})}for(const e of t)o.removeAttribute(e)}if(b.test(o.tagName)){const t=o.textContent.split(a),i=t.length-1;if(i>0){o.textContent=e?e.emptyScript:"";for(let e=0;e<i;e++)o.append(t[e],r()),S.nextNode(),h.push({type:2,index:++l});o.append(t[i],r())}}}else if(8===o.nodeType)if(o.data===s)h.push({type:2,index:l});else{let t=-1;for(;-1!==(t=o.data.indexOf(a,t+1));)h.push({type:7,index:l}),t+=a.length-1}l++}}static createElement(t,e){const i=o.createElement("template");return i.innerHTML=t,i}}function z(t,e,i=t,a){var s,n,o,r;if(e===k)return e;let c=void 0!==a?null===(s=i._$Cl)||void 0===s?void 0:s[a]:i._$Cu;const u=l(e)?void 0:e._$litDirective$;return(null==c?void 0:c.constructor)!==u&&(null===(n=null==c?void 0:c._$AO)||void 0===n||n.call(c,!1),void 0===u?c=void 0:(c=new u(t),c._$AT(t,i,a)),void 0!==a?(null!==(o=(r=i)._$Cl)&&void 0!==o?o:r._$Cl=[])[a]=c:i._$Cu=c),void 0!==c&&(e=z(t,c._$AS(t,e.values),c,a)),e}class I{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:i},parts:a}=this._$AD,s=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:o).importNode(i,!0);S.currentNode=s;let n=S.nextNode(),r=0,l=0,c=a[0];for(;void 0!==c;){if(r===c.index){let e;2===c.type?e=new T(n,n.nextSibling,this,t):1===c.type?e=new c.ctor(n,c.name,c.strings,this,t):6===c.type&&(e=new R(n,this,t)),this.v.push(e),c=a[++l]}r!==(null==c?void 0:c.index)&&(n=S.nextNode(),r++)}return s}m(t){let e=0;for(const i of this.v)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class T{constructor(t,e,i,a){var s;this.type=2,this._$AH=x,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=a,this._$Cg=null===(s=null==a?void 0:a.isConnected)||void 0===s||s}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=z(this,t,e),l(t)?t===x||null==t||""===t?(this._$AH!==x&&this._$AR(),this._$AH=x):t!==this._$AH&&t!==k&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.k(t):u(t)?this.S(t):this.$(t)}M(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.M(t))}$(t){this._$AH!==x&&l(this._$AH)?this._$AA.nextSibling.data=t:this.k(o.createTextNode(t)),this._$AH=t}T(t){var e;const{values:i,_$litType$:a}=t,s="number"==typeof a?this._$AC(t):(void 0===a.el&&(a.el=C.createElement(a.h,this.options)),a);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===s)this._$AH.m(i);else{const t=new I(s,this),e=t.p(this.options);t.m(i),this.k(e),this._$AH=t}}_$AC(t){let e=D.get(t.strings);return void 0===e&&D.set(t.strings,e=new C(t)),e}S(t){c(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,a=0;for(const s of t)a===e.length?e.push(i=new T(this.M(r()),this.M(r()),this,this.options)):i=e[a],i._$AI(s),a++;a<e.length&&(this._$AR(i&&i._$AB.nextSibling,a),e.length=a)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cg=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class A{constructor(t,e,i,a,s){this.type=1,this._$AH=x,this._$AN=void 0,this.element=t,this.name=e,this._$AM=a,this.options=s,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=x}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,a){const s=this.strings;let n=!1;if(void 0===s)t=z(this,t,e,0),n=!l(t)||t!==this._$AH&&t!==k,n&&(this._$AH=t);else{const a=t;let o,r;for(t=s[0],o=0;o<s.length-1;o++)r=z(this,a[i+o],e,o),r===k&&(r=this._$AH[o]),n||(n=!l(r)||r!==this._$AH[o]),r===x?t=x:t!==x&&(t+=(null!=r?r:"")+s[o+1]),this._$AH[o]=r}n&&!a&&this.C(t)}C(t){t===x?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class M extends A{constructor(){super(...arguments),this.type=3}C(t){this.element[this.name]=t===x?void 0:t}}const W=e?e.emptyScript:"";class _ extends A{constructor(){super(...arguments),this.type=4}C(t){t&&t!==x?this.element.setAttribute(this.name,W):this.element.removeAttribute(this.name)}}class j extends A{constructor(t,e,i,a,s){super(t,e,i,a,s),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=z(this,t,e,0))&&void 0!==i?i:x)===k)return;const a=this._$AH,s=t===x&&a!==x||t.capture!==a.capture||t.once!==a.once||t.passive!==a.passive,n=t!==x&&(a===x||s);s&&this.element.removeEventListener(this.name,this,a),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class R{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){z(this,t)}}const O={L:"$lit$",P:a,V:s,I:1,N:P,R:I,j:u,D:z,H:T,F:A,O:_,W:j,B:M,Z:R},L=window.litHtmlPolyfillSupport;null==L||L(C,T),(null!==(t=globalThis.litHtmlVersions)&&void 0!==t?t:globalThis.litHtmlVersions=[]).push("2.2.6");var E=Object.freeze({__proto__:null,_$LH:O,html:y,noChange:k,nothing:x,render:$,svg:w}); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const N={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},G=t=>(...e)=>({_$litDirective$:t,values:e});class B{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}} /** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const{H:H}=O,V=(t,e)=>{var i,a;return void 0===e?void 0!==(null===(i=t)||void 0===i?void 0:i._$litType$):(null===(a=t)||void 0===a?void 0:a._$litType$)===e},q=t=>void 0===t.strings,Y=()=>document.createComment(""),F=(t,e,i)=>{var a;const s=t._$AA.parentNode,n=void 0===e?t._$AB:e._$AA;if(void 0===i){const e=s.insertBefore(Y(),n),a=s.insertBefore(Y(),n);i=new H(e,a,t,t.options)}else{const e=i._$AB.nextSibling,o=i._$AM,r=o!==t;if(r){let e;null===(a=i._$AQ)||void 0===a||a.call(i,t),i._$AM=t,void 0!==i._$AP&&(e=t._$AU)!==o._$AU&&i._$AP(e)}if(e!==n||r){let t=i._$AA;for(;t!==e;){const e=t.nextSibling;s.insertBefore(t,n),t=e}}}return i},U=(t,e,i=t)=>(t._$AI(e,i),t),K={},Z=(t,e=K)=>t._$AH=e,Q=t=>t._$AH,J=t=>{var e;null===(e=t._$AP)||void 0===e||e.call(t,!1,!0);let i=t._$AA;const a=t._$AB.nextSibling;for(;i!==a;){const t=i.nextSibling;i.remove(),i=t}},X=t=>{t._$AR()},tt=(t,e)=>{var i,a;const s=t._$AN;if(void 0===s)return!1;for(const t of s)null===(a=(i=t)._$AO)||void 0===a||a.call(i,e,!1),tt(t,e);return!0},et=t=>{let e,i;do{if(void 0===(e=t._$AM))break;i=e._$AN,i.delete(t),t=e}while(0===(null==i?void 0:i.size))},it=t=>{for(let e;e=t._$AM;t=e){let i=e._$AN;if(void 0===i)e._$AN=i=new Set;else if(i.has(t))break;i.add(t),nt(e)}}; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */function at(t){void 0!==this._$AN?(et(this),this._$AM=t,it(this)):this._$AM=t}function st(t,e=!1,i=0){const a=this._$AH,s=this._$AN;if(void 0!==s&&0!==s.size)if(e)if(Array.isArray(a))for(let t=i;t<a.length;t++)tt(a[t],!1),et(a[t]);else null!=a&&(tt(a,!1),et(a));else tt(this,t)}const nt=t=>{var e,i,a,s;t.type==N.CHILD&&(null!==(e=(a=t)._$AP)&&void 0!==e||(a._$AP=st),null!==(i=(s=t)._$AQ)&&void 0!==i||(s._$AQ=at))};class ot extends B{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),it(this),this.isConnected=t._$AU}_$AO(t,e=!0){var i,a;t!==this.isConnected&&(this.isConnected=t,t?null===(i=this.reconnected)||void 0===i||i.call(this):null===(a=this.disconnected)||void 0===a||a.call(this)),e&&(tt(this,t),et(this))}setValue(t){if(q(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}} /** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause */class rt{constructor(t){this.U=t}disconnect(){this.U=void 0}reconnect(t){this.U=t}deref(){return this.U}}class lt{constructor(){this.Y=void 0,this.q=void 0}get(){return this.Y}pause(){var t;null!==(t=this.Y)&&void 0!==t||(this.Y=new Promise((t=>this.q=t)))}resume(){var t;null===(t=this.q)||void 0===t||t.call(this),this.Y=this.q=void 0}} /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */class ct extends ot{constructor(){super(...arguments),this._$CG=new rt(this),this._$CK=new lt}render(t,e){return k}update(t,[e,i]){if(this.isConnected||this.disconnected(),e===this._$CX)return;this._$CX=e;let a=0;const{_$CG:s,_$CK:n}=this;return(async(t,e)=>{for await(const i of t)if(!1===await e(i))return})(e,(async t=>{for(;n.get();)await n.get();const o=s.deref();if(void 0!==o){if(o._$CX!==e)return!1;void 0!==i&&(t=i(t,a)),o.commitValue(t,a),a++}return!0})),k}commitValue(t,e){this.setValue(t)}disconnected(){this._$CG.disconnect(),this._$CK.pause()}reconnected(){this._$CG.reconnect(this),this._$CK.resume()}}const ut=G(ct),ht=G(class extends ct{constructor(t){if(super(t),t.type!==N.CHILD)throw Error("asyncAppend can only be used in child expressions")}update(t,e){return this._$CJ=t,super.update(t,e)}commitValue(t,e){0===e&&X(this._$CJ);const i=F(this._$CJ);U(i,t)}}),dt=G(class extends B{constructor(t){super(t),this.tt=new WeakMap}render(t){return[t]}update(t,[e]){if(V(this.it)&&(!V(e)||this.it.strings!==e.strings)){const e=Q(t).pop();let i=this.tt.get(this.it.strings);if(void 0===i){const t=document.createDocumentFragment();i=$(x,t),i.setConnected(!1),this.tt.set(this.it.strings,i)}Z(i,[e]),F(i,void 0,e)}if(V(e)){if(!V(this.it)||this.it.strings!==e.strings){const i=this.tt.get(e.strings);if(void 0!==i){const e=Q(i).pop();X(t),F(t,void 0,e),Z(t,[e])}}this.it=e}else this.it=void 0;return this.render(e)}}),mt={},gt=G(class extends B{constructor(){super(...arguments),this.nt=mt}render(t,e){return e()}update(t,[e,i]){if(Array.isArray(e)){if(Array.isArray(this.nt)&&this.nt.length===e.length&&e.every(((t,e)=>t===this.nt[e])))return k}else if(this.nt===e)return k;return this.nt=Array.isArray(e)?Array.from(e):e,this.render(e,i)}}),ft=t=>null!=t?t:x /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */,pt=(t,e,i)=>{const a=new Map;for(let s=e;s<=i;s++)a.set(t[s],s);return a},bt=G(class extends B{constructor(t){if(super(t),t.type!==N.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,i){let a;void 0===i?i=e:void 0!==e&&(a=e);const s=[],n=[];let o=0;for(const e of t)s[o]=a?a(e,o):o,n[o]=i(e,o),o++;return{values:n,keys:s}}render(t,e,i){return this.dt(t,e,i).values}update(t,[e,i,a]){var s;const n=Q(t),{values:o,keys:r}=this.dt(e,i,a);if(!Array.isArray(n))return this.ut=r,o;const l=null!==(s=this.ut)&&void 0!==s?s:this.ut=[],c=[];let u,h,d=0,m=n.length-1,g=0,f=o.length-1;for(;d<=m&&g<=f;)if(null===n[d])d++;else if(null===n[m])m--;else if(l[d]===r[g])c[g]=U(n[d],o[g]),d++,g++;else if(l[m]===r[f])c[f]=U(n[m],o[f]),m--,f--;else if(l[d]===r[f])c[f]=U(n[d],o[f]),F(t,c[f+1],n[d]),d++,f--;else if(l[m]===r[g])c[g]=U(n[m],o[g]),F(t,n[d],n[m]),m--,g++;else if(void 0===u&&(u=pt(r,g,f),h=pt(l,d,m)),u.has(l[d]))if(u.has(l[m])){const e=h.get(r[g]),i=void 0!==e?n[e]:null;if(null===i){const e=F(t,n[d]);U(e,o[g]),c[g]=e}else c[g]=U(i,o[g]),F(t,n[d],i),n[e]=null;g++}else J(n[m]),m--;else J(n[d]),d++;for(;g<=f;){const e=F(t,c[f+1]);U(e,o[g]),c[g++]=e}for(;d<=m;){const t=n[d++];null!==t&&J(t)}return this.ut=r,Z(t,c),k}}); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ class vt extends B{constructor(t){if(super(t),this.it=x,t.type!==N.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===x||null==t)return this.ft=void 0,this.it=t;if(t===k)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this.ft;this.it=t;const e=[t];return e.raw=e,this.ft={_$litType$:this.constructor.resultType,strings:e,values:[]}}}vt.directiveName="unsafeHTML",vt.resultType=1;const yt=G(vt),wt=t=>!(t=>null===t||"object"!=typeof t&&"function"!=typeof t)(t)&&"function"==typeof t.then; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */class kt extends ot{constructor(){super(...arguments),this._$Cwt=1073741823,this._$Cyt=[],this._$CG=new rt(this),this._$CK=new lt}render(...t){var e;return null!==(e=t.find((t=>!wt(t))))&&void 0!==e?e:k}update(t,e){const i=this._$Cyt;let a=i.length;this._$Cyt=e;const s=this._$CG,n=this._$CK;this.isConnected||this.disconnected();for(let t=0;t<e.length&&!(t>this._$Cwt);t++){const o=e[t];if(!wt(o))return this._$Cwt=t,o;t<a&&o===i[t]||(this._$Cwt=1073741823,a=0,Promise.resolve(o).then((async t=>{for(;n.get();)await n.get();const e=s.deref();if(void 0!==e){const i=e._$Cyt.indexOf(o);i>-1&&i<e._$Cwt&&(e._$Cwt=i,e.setValue(t))}})))}return k}disconnected(){this._$CG.disconnect(),this._$CK.pause()}reconnected(){this._$CG.reconnect(this),this._$CK.resume()}}const xt=G(kt),Dt=G(class extends B{constructor(t){if(super(t),t.type!==N.PROPERTY&&t.type!==N.ATTRIBUTE&&t.type!==N.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!q(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===k||e===x)return e;const i=t.element,a=t.name;if(t.type===N.PROPERTY){if(e===i[a])return k}else if(t.type===N.BOOLEAN_ATTRIBUTE){if(!!e===i.hasAttribute(a))return k}else if(t.type===N.ATTRIBUTE&&i.getAttribute(a)===e+"")return k;return Z(t),e}}),$t=G(class extends B{constructor(t){var e;if(super(t),t.type!==N.ATTRIBUTE||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,i)=>{const a=t[i];return null==a?e:e+`${i=i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${a};`}),"")}update(t,[e]){const{style:i}=t.element;if(void 0===this.ct){this.ct=new Set;for(const t in e)this.ct.add(t);return this.render(e)}this.ct.forEach((t=>{null==e[t]&&(this.ct.delete(t),t.includes("-")?i.removeProperty(t):i[t]="")}));for(const t in e){const a=e[t];null!=a&&(this.ct.add(t),t.includes("-")?i.setProperty(t,a):i[t]=a)}return k}}),St=G(class extends B{constructor(t){var e;if(super(t),t.type!==N.ATTRIBUTE||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){var i,a;if(void 0===this.et){this.et=new Set,void 0!==t.strings&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!(null===(i=this.st)||void 0===i?void 0:i.has(t))&&this.et.add(t);return this.render(e)}const s=t.element.classList;this.et.forEach((t=>{t in e||(s.remove(t),this.et.delete(t))}));for(const t in e){const i=!!e[t];i===this.et.has(t)||(null===(a=this.st)||void 0===a?void 0:a.has(t))||(i?(s.add(t),this.et.add(t)):(s.remove(t),this.et.delete(t)))}return k}}); /** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ /** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ function Pt(t,e,i){return t?e():null==i?void 0:i()} /** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const Ct=(t,e,i)=>{for(const i of e)if(i[0]===t)return(0,i[1])();return null==i?void 0:i()}; /** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause */function*zt(t,e){if(void 0!==t){let i=0;for(const a of t)yield e(a,i++)}} /** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause */function*It(t,e){const i="function"==typeof e;if(void 0!==t){let a=-1;for(const s of t)a>-1&&(yield i?e(a):e),a++,yield s}} /** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause */function*Tt(t,e,i=1){const a=void 0===e?0:t;null!=e||(e=t);for(let t=a;i>0?t<e:e<t;t+=i)yield t} /** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const At=G(class extends B{constructor(t){if(super(t),t.type!==N.CHILD)throw Error("templateContent can only be used in child bindings")}render(t){return this.vt===t?k:(this.vt=t,document.importNode(t.content,!0))}}); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */class Mt extends vt{}Mt.directiveName="unsafeSVG",Mt.resultType=2;const Wt=G(Mt); /** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause */class _t{}const jt=new WeakMap,Rt=G(class extends ot{render(t){return x}update(t,[e]){var i;const a=e!==this.U;return a&&void 0!==this.U&&this.ot(void 0),(a||this.rt!==this.lt)&&(this.U=e,this.ht=null===(i=t.options)||void 0===i?void 0:i.host,this.ot(this.lt=t.element)),x}ot(t){var e;if("function"==typeof this.U){const i=null!==(e=this.ht)&&void 0!==e?e:globalThis;let a=jt.get(i);void 0===a&&(a=new WeakMap,jt.set(i,a)),void 0!==a.get(this.U)&&this.U.call(this.ht,void 0),a.set(this.U,t),void 0!==t&&this.U.call(this.ht,t)}else this.U.value=t}get rt(){var t,e,i;return"function"==typeof this.U?null===(e=jt.get(null!==(t=this.ht)&&void 0!==t?t:globalThis))||void 0===e?void 0:e.get(this.U):null===(i=this.U)||void 0===i?void 0:i.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}}),Ot=new WeakMap;class Lt extends B{update(t,e){return e[0].execute(t),k}render(t){return t.toString()}}class Et{constructor(t,e={schedule:!1}){this.schedule=!1,this.style=t,this._directive=G(Lt),this.execute=this.execute.bind(this),this.schedule=e.schedule}directive(){return this._directive(this)}setStyle(t){for(const t in this.style)delete this.style[t];for(const e in t)this.style[e]=t[e]}toString(){return Object.keys(this.style).reduce(((t,e)=>{const i=this.style[e];return null==i?t:t+`${e=e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}_getInternalStyle(){return this.element?Ot.get(this.element):null}updateStyle(t,e,i){const a=i.previousStyle;for(const t of e)t&&!this.style[t]&&(i.toRemove.includes(t)||i.toRemove.push(t));for(const t in a)t&&t in this.style&&!this.style[t]&&e.includes(t)&&(i.toRemove.includes(t)||i.toRemove.push(t));for(const t in this.style){if(!t)continue;if(!(t in this.style))continue;const s=this.style[t];if(!s)continue;const n=a[t];void 0!==n&&n===s&&e.includes(t)||i.toUpdate.push(t)}if(i.toRemove.length||i.toUpdate.length){for(const e of i.toRemove)t.removeProperty(e),t[e]&&delete t[e],i.elementStyles=i.elementStyles.filter((t=>t!==e));for(const e of i.toUpdate){const a=this.style[e];a&&(e.includes("-")?t.setProperty(e,a):t[e]=a,i.elementStyles.includes(e)||i.elementStyles.push(e))}i.previousStyle=Object.assign({},this.style)}}execute(t){const e=t.element;let i;this.element=e,Ot.has(e)?i=Ot.get(e):(i={toUpdate:[],toRemove:[],previousStyle:{},elementStyles:[],styleTaken:!1},Ot.set(e,i)),i.toRemove.length=0,i.toUpdate.length=0;const a=e.style;let s;if(i.styleTaken)s=i.elementStyles;else{i.elementStyles=s=[];for(let t=i.length;t--;)s.push(a[t]);i.styleTaken=!0}this.schedule?requestAnimationFrame((()=>{this.updateStyle(a,s,i)})):this.updateStyle(a,s,i),Ot.set(e,i)}}const Nt=new WeakMap;const Gt=G(class extends B{render(t){return x}update(t,e){if("boolean"!=typeof e[0])throw new Error("[vido] Detach directive argument should be a boolean.");let i=e[0];const a=t.element;if(i)Nt.has(t)||Nt.set(t,{element:a,nextSibling:a.nextSibling,previousSibling:a.previousSibling,parent:a.parentNode}),a.remove();else{const e=Nt.get(t);e&&(e.nextSibling&&e.nextSibling.parentNode?e.nextSibling.parentNode.insertBefore(e.element,e.nextSibling):e.previousSibling&&e.previousSibling.parentNode?e.previousSibling.parentNode.appendChild(e.element):e.parent&&e.parent.appendChild(e.element),Nt.delete(t))}return this.render(i)}});class Bt{constructor(){this.isAction=!0}}Bt.prototype.isAction=!0;const Ht={element:document.createTextNode(""),axis:"xy",threshold:10,onDown(){},onMove(){},onUp(){},onWheel(){}},Vt="undefined"!=typeof PointerEvent;let qt=0;class Yt extends Bt{constructor(t,e){super(),this.moving="",this.initialX=0,this.initialY=0,this.lastY=0,this.lastX=0,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onWheel=this.onWheel.bind(this),this.element=t,this.id=++qt,this.options=Object.assign(Object.assign({},Ht),e.pointerOptions),Vt?(t.addEventListener("pointerdown",this.onPointerDown),document.addEventListener("pointermove",this.onPointerMove),document.addEventListener("pointerup",this.onPointerUp)):(t.addEventListener("touchstart",this.onPointerDown),document.addEventListener("touchmove",this.onPointerMove,{passive:!1}),document.addEventListener("touchend",this.onPointerUp),document.addEventListener("touchcancel",this.onPointerUp),t.addEventListener("mousedown",this.onPointerDown),document.addEventListener("mousemove",this.onPointerMove,{passive:!1}),document.addEventListener("mouseup",this.onPointerUp))}normalizeMouseWheelEvent(t){let e=t.deltaX||0,i=t.deltaY||0,a=t.deltaZ||0;const s=t.deltaMode,n=parseInt(getComputedStyle(t.target).getPropertyValue("line-height"));let o=1;switch(s){case 1:o=n;break;case 2:o=window.height}return e*=o,i*=o,a*=o,{x:e,y:i,z:a,event:t}}onWheel(t){const e=this.normalizeMouseWheelEvent(t);this.options.onWheel(e)}normalizePointerEvent(t){let e={x:0,y:0,pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0,event:t};switch(t.type){case"wheel":const i=this.normalizeMouseWheelEvent(t);e.x=i.x,e.y=i.y,e.pageX=e.x,e.pageY=e.y,e.screenX=e.x,e.screenY=e.y,e.clientX=e.x,e.clientY=e.y;break;case"touchstart":case"touchmove":case"touchend":case"touchcancel":e.x=t.changedTouches[0].screenX,e.y=t.changedTouches[0].screenY,e.pageX=t.changedTouches[0].pageX,e.pageY=t.changedTouches[0].pageY,e.screenX=t.changedTouches[0].screenX,e.screenY=t.changedTouches[0].screenY,e.clientX=t.changedTouches[0].clientX,e.clientY=t.changedTouches[0].clientY;break;default:e.x=t.x,e.y=t.y,e.pageX=t.pageX,e.pageY=t.pageY,e.screenX=t.screenX,e.screenY=t.screenY,e.clientX=t.clientX,e.clientY=t.clientY}return e}onPointerDown(t){if("mousedown"===t.type&&0!==t.button)return;this.moving="xy";const e=this.normalizePointerEvent(t);this.lastX=e.x,this.lastY=e.y,this.initialX=e.x,this.initialY=e.y,this.options.onDown(e)}handleX(t){let e=t.x-this.lastX;return this.lastY=t.y,this.lastX=t.x,e}handleY(t){let e=t.y-this.lastY;return this.lastY=t.y,this.lastX=t.x,e}onPointerMove(t){if(""===this.moving||"mousemove"===t.type&&0!==t.button)return;const e=this.normalizePointerEvent(t);if("x|y"===this.options.axis){let i=0,a=0;("x"===this.moving||"xy"===this.moving&&Math.abs(e.x-this.initialX)>this.options.threshold)&&(this.moving="x",i=this.handleX(e)),("y"===this.moving||"xy"===this.moving&&Math.abs(e.y-this.initialY)>this.options.threshold)&&(this.moving="y",a=this.handleY(e)),this.options.onMove({movementX:i,movementY:a,x:e.x,y:e.y,initialX:this.initialX,initialY:this.initialY,lastX:this.lastX,lastY:this.lastY,event:t})}else if("xy"===this.options.axis){let i=0,a=0;Math.abs(e.x-this.initialX)>this.options.threshold&&(i=this.handleX(e)),Math.abs(e.y-this.initialY)>this.options.threshold&&(a=this.handleY(e)),this.options.onMove({movementX:i,movementY:a,x:e.x,y:e.y,initialX:this.initialX,initialY:this.initialY,lastX:this.lastX,lastY:this.lastY,event:t})}else if("x"===this.options.axis)("x"===this.moving||"xy"===this.moving&&Math.abs(e.x-this.initialX)>this.options.threshold)&&(this.moving="x",this.options.onMove({movementX:this.handleX(e),movementY:0,initialX:this.initialX,initialY:this.initialY,lastX:this.lastX,lastY:this.lastY,event:t}));else if("y"===this.options.axis){let i=0;("y"===this.moving||"xy"===this.moving&&Math.abs(e.y-this.initialY)>this.options.threshold)&&(this.moving="y",i=this.handleY(e)),this.options.onMove({movementX:0,movementY:i,x:e.x,y:e.y,initialX:this.initialX,initialY:this.initialY,lastX:this.lastX,lastY:this.lastY,event:t})}}onPointerUp(t){this.moving="";const e=this.normalizePointerEvent(t);this.options.onUp({movementX:0,movementY:0,x:e.x,y:e.y,initialX:this.initialX,initialY:this.initialY,lastX:this.lastX,lastY:this.lastY,event:t}),this.lastY=0,this.lastX=0}destroy(t){Vt?(t.removeEventListener("pointerdown",this.onPointerDown),document.removeEventListener("pointermove",this.onPointerMove),document.removeEventListener("pointerup",this.onPointerUp)):(t.removeEventListener("mousedown",this.onPointerDown),document.removeEventListener("mousemove",this.onPointerMove),document.removeEventListener("mouseup",this.onPointerUp),t.removeEventListener("touchstart",this.onPointerDown),document.removeEventListener("touchmove",this.onPointerMove),document.removeEventListener("touchend",this.onPointerUp),document.removeEventListener("touchcancel",this.onPointerUp))}}function Ft(t){let e=0;return function(i){e||(e=requestAnimationFrame((function(){e=0,t.apply(void 0,[i])})))}}function Ut(t){return null==t||"string"==typeof t||"number"==typeof t||"boolean"==typeof t||"bigint"==typeof t||"symbol"==typeof t}function Kt(t){return!Ut(t)&&(t&&t.constructor?"Object"===t.constructor.name:"object"==typeof t&&null!==t)}function Zt(t){return!Ut(t)&&(Array.isArray(t)||Kt(t))}function Qt(t,...e){const i=e.shift();if(Kt(i)){Kt(t)||(t=Object.create(null));for(const e in i){const a=i[e];Zt(a)?t[e]=Qt(t[e],a):t[e]=a}}else if(Array.isArray(i)){const e=i.length;Array.isArray(t)?t.length=e:t=new Array(e);let a=0;for(;a<e;a++){const e=i[a];Zt(e)?t[a]=Qt(t[a],e):t[a]=e}void 0!==i.raw&&(t.raw=i.raw.slice())}else t=i;return e.length?Qt(t,...e):t}function Jt(t){if(void 0!==t.actions){const e=t.actions.map((t=>{const e=Object.assign({},t),i=Object.assign({},e.props);return delete i.state,delete i.api,delete e.element,e.props=i,e}));t.actions=e}return Qt({},t)}var Xt={mergeDeep:Qt,clone:Jt,schedule:Ft};class te{constructor(t,e){this.slotInstances={},this.destroyed=!1,this.vido=t,this.props=e,this.destroy=this.destroy.bind(this),this.change=this.change.bind(this),this.html=this.html.bind(this),this.getInstances=this.getInstances.bind(this),this.setComponents=this.setComponents.bind(this),this.vido.onDestroy((()=>{this.destroy()}))}setComponents(t){if(t&&!this.destroyed){for(const e in t){const i=t[e];void 0===this.slotInstances[e]&&(this.slotInstances[e]=[]);for(const t of this.slotInstances[e])t.destroy();this.slotInstances[e].length=0;for(const t of i)this.slotInstances[e].push(this.vido.createComponent(t,this.props))}this.vido.update()}}destroy(){if(!this.destroyed){for(const t in this.slotInstances){for(const e of this.slotInstances[t])e.destroy();this.slotInstances[t].length=0}this.destroyed=!0}}change(t,e=void 0){if(!this.destroyed)for(const i in this.slotInstances){const a=this.slotInstances[i];for(const i of a)i.change(t,e)}}getInstances(t){return this.destroyed?[]:void 0===t?this.slotInstances:this.slotInstances[t]}html(t,e){if(this.destroyed)return;if(!this.slotInstances[t]||0===this.slotInstances[t].length)return e;let i=e;for(const e of this.slotInstances[t])i=e.html(i);return i}getProps(){return this.props}isDestroyed(){return this.destroyed}}class ee extends B{update(t,e){if("function"!=typeof e[0])throw new Error("[vido] GetElementDirective argument should be a function.");(0,e[0])(t.element)}render(){return x}}function ie(t,e){let i=0;const a=new Map;let s,n,o=new Map,r=0;const l=[],c=Promise.resolve(),u={},h=function(t){return class extends B{update(e,i){const a=e.element,s=i[0],n=i[1],o=i[2];for(const e of n)if(void 0!==e){let i;if(t.has(s))for(const n of t.get(s))if(n.componentAction.create===e&&n.element===a){i=n;break}if(i)i.props=o;else{void 0!==a.vido&&delete a.vido;const i={instance:s,componentAction:{create:e,update(){},destroy(){}},element:a,props:o};let n=[];t.has(s)&&(n=t.get(s)),n.push(i),t.set(s,n)}}}render(t,e,i){return x}}}(o);class d{constructor(t){this.instance=t}create(t,e){const i=G(h);return()=>i(this.instance,t,e)}}const m=function(t,e,i){return class{constructor(t,e,i={}){this.destroyed=!1,this.instance=t,this.name=e.name,this.vidoInstance=e,this.props=i,this.destroy=this.destroy.bind(this),this.update=this.update.bind(this),this.change=this.change.bind(this),this.html=this.html.bind(this)}destroy(){this.destroyed||(this.vidoInstance.debug&&(console.groupCollapsed(`destroying component ${this.instance}`),console.log(i({components:t.keys(),actionsByInstance:e})),console.trace(),console.groupEnd()),this.vidoInstance.destroyComponent(this.instance,this.vidoInstance),this.destroyed=!0)}update(a=void 0){return this.vidoInstance.debug&&(console.groupCollapsed(`updating component ${this.instance}`),console.log(i({components:t.keys(),actionsByInstance:e})),console.trace(),console.groupEnd()),this.vidoInstance.updateTemplate(a)}change(a,s={}){this.vidoInstance.debug&&(console.groupCollapsed(`changing component ${this.instance}`),console.log(i({props:this.props,newProps:a,components:t.keys(),actionsByInstance:e})),console.trace(),console.groupEnd());const n=t.get(this.instance);n&&n.change(a,s)}html(e={}){const i=t.get(this.instance);if(i&&!i.destroyed)return i.update(e,this.vidoInstance)}_getComponents(){return t}_getActions(){return e}}}(a,o,Jt),g=function(t,e,i){return class{constructor(t,e,i){this.destroyed=!1,this.instance=t,this.vidoInstance=e,this.renderFunction=i,this.destroy=this.destroy.bind(this),this.update=this.update.bind(this),this.change=this.change.bind(this)}destroy(){if(!this.destroyed){this.vidoInstance.debug&&(console.groupCollapsed(`component destroy method fired ${this.instance}`),console.log(i({props:this.vidoInstance.props,components:t.keys(),destroyable:this.vidoInstance.destroyable,actionsByInstance:e})),console.trace(),console.groupEnd()),this.content&&"function"==typeof this.content.destroy&&this.content.destroy();for(const t of this.vidoInstance.destroyable)t();this.vidoInstance.onChangeFunctions.length=0,this.vidoInstance.destroyable.length=0,this.vidoInstance.destroyed=!0,this.destroyed=!0,this.vidoInstance.update()}}update(a={}){return this.vidoInstance.debug&&(console.groupCollapsed(`component update method fired ${this.instance}`),console.log(i({components:t.keys(),actionsByInstance:e})),console.trace(),console.groupEnd()),this.renderFunction(a)}change(a,s={leave:!1}){const n=a;this.vidoInstance.debug&&(console.groupCollapsed(`component change method fired ${this.instance}`),console.log(i({props:n,components:t.keys(),onChangeFunctions:this.vidoInstance.onChangeFunctions,changedProps:a,actionsByInstance:e})),console.trace(),console.groupEnd());for(const t of this.vidoInstance.onChangeFunctions)t(a,s)}}}(a,o,Jt);class f{constructor(i="",s=""){this.instance="",this.name="",this.destroyable=[],this.destroyed=!1,this.onChangeFunctions=[],this.debug=!1,this.state=t,this.api=e,this.lastProps={},this.html=y,this.svg=w,this.lithtml=E,this.directive=G,this.asyncAppend=ht,this.asyncReplace=ut,this.cache=dt,this.classMap=St,this.styleMap=$t,this.StyleMap=Et,this.guard=gt,this.live=Dt,this.ifDefined=ft,this.repeat=bt,this.unsafeHTML=yt,this.until=xt,this.when=Pt,this.choose=Ct,this.map=zt,this.join=It,this.range=Tt,this.templateContent=At,this.unsafeSVG=Wt,this.ref=Rt,this.schedule=Ft,this.getElement=G(ee),this.actionsByInstance=()=>{},this.detach=Gt,this.PointerAction=Yt,this.Action=Bt,this.Slots=te,this._components=a,this._actions=o,this.instance=i,this.reuseComponents=this.reuseComponents.bind(this),this.onDestroy=this.onDestroy.bind(this),this.onChange=this.onChange.bind(this),this.update=this.update.bind(this),this.destroyComponent=this.destroyComponent.bind(this);for(const t in u)this[t]=u[t].bind(this);this.name=s,this.Actions=new d(i)}static addMethod(t,e){u[t]=e}onDestroy(t){this.destroyable.push(t)}onChange(t){this.onChangeFunctions.push(t)}update(t){return this.updateTemplate(t)}reuseComponents(t,e,i,a,s=!0,n=!1){const o=[],r=t.length,l=e.length;let c=!1;!s||void 0!==e&&0!==e.length||(c=!0);let u=0;if(r<l){let s=l-r;for(;s;){const n=e[l-s],r=this.createComponent(a,i(n));t.push(r),o.push(r),s--}}else if(r>l){let e=r-l;if(s)c=!0,u=r-e;else{for(;e;){const i=r-e;o.push(t[i]),t[i].destroy(),e--}t.length=l}}let h=0;n&&console.log("modified components",o),n&&console.log("current components",t),n&&console.log("data array",e);for(const a of t){const t=e[h];n&&console.log(`reuse components data at '${h}'`,t),a&&!o.includes(a)&&(n&&console.log("getProps fn result",i(t)),a.change(i(t),{leave:c&&h>=u})),h++}}createComponent(t,e={}){const s=t.name+":"+i++;let n;n=new f(s,t.name);const r=new m(s,n,e),l=new g(s,n,t(n,e));return a.set(s,l),a.get(s).change(e),n.debug&&(console.groupCollapsed(`component created ${s}`),console.log(Jt({props:e,components:a.keys(),actionsByInstance:o})),console.trace(),console.groupEnd()),r}destroyComponent(t,e){if(e.debug&&(console.groupCollapsed(`destroying component ${t}...`),console.log(Jt({components:a.keys(),actionsByInstance:o})),console.trace(),console.groupEnd()),o.has(t))for(const e of o.get(t))"function"==typeof e.componentAction.destroy&&e.componentAction.destroy(e.element,e.props);o.delete(t);const i=a.get(t);i?(i.destroy(),a.delete(t),e.debug&&(console.groupCollapsed(`component destroyed ${t}`),console.log(Jt({components:a.keys(),actionsByInstance:o})),console.trace(),console.groupEnd())):console.warn(`No component to destroy! [${t}]`)}executeActions(){for(const t of o.values()){for(const e of t)if(void 0===e.element.vido){const t=a.get(e.instance);e.isActive=function(){return t&&!1===t.destroyed};const i=e.componentAction,s=i.create;if(void 0!==s){let t;t=s.prototype&&(s.prototype.isAction||s.prototype.update||s.prototype.destroy)||s.isAction?new s(e.element,e.props):s(e.element,e.props),void 0!==t&&("function"==typeof t?i.destroy=t:("function"==typeof t.update&&(i.update=t.update.bind(t)),"function"==typeof t.destroy&&(i.destroy=t.destroy.bind(t))))}}else e.element.vido=e.props,"function"==typeof e.componentAction.update&&e.isActive()&&e.componentAction.update(e.element,e.props);for(const e of t)e.element.vido=e.props}}updateTemplate(t=void 0){return t&&l.push(t),new Promise((t=>{const e=++r,i=this;c.then((function(){if(e===r){r=0,i.render();for(const t of l)t();l.length=0,t(null)}}))}))}createApp(t){n=t.element;const e=this.createComponent(t.component,t.props);return s=e.instance,this.render(),e}render(){const t=a.get(s);t?($(t.update(),n),this.executeActions()):n&&n.remove()}}return new f}ie.lithtml=E,ie.Action=Bt,ie.Directive=B,ie.StyleMap=Et,ie.PointerAction=Yt,ie.Slots=te,ie.directives={schedule:Ft,detach:Gt,styleMap:$t,classMap:St,asyncAppend:ht,asyncReplace:ut,cache:dt,guard:gt,live:Dt,ifDefined:ft,repeat:bt,unsafeHTML:yt,until:xt,when:Pt,choose:Ct,map:zt,join:It,range:Tt,templateContent:At,unsafeSVG:Wt,ref:Rt};const ae=E;var se=Object.freeze({__proto__:null,Action:Bt,AsyncReplaceDirective:ct,Directive:B,PartType:N,PointerAction:Yt,Slots:te,StyleMap:Et,UnsafeHTMLDirective:vt,UntilDirective:kt,_$LH:O,asyncAppend:ht,asyncReplace:ut,cache:dt,choose:Ct,classMap:St,createRef:()=>new _t,default:ie,detach:Gt,directive:G,guard:gt,helpers:Xt,html:y,ifDefined:ft,join:It,lit:ae,lithtml:E,map:zt,noChange:k,nothing:x,range:Tt,ref:Rt,render:$,repeat:bt,schedule:Ft,styleMap:$t,svg:w,templateContent:At,unsafeHTML:yt,unsafeSVG:Wt,until:xt,when:Pt}),ne=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self,{exports:{}});!function(t){t.exports=function(){var t=1e3,e=6e4,i=36e5,a="millisecond",s="second",n="minute",o="hour",r="day",l="week",c="month",u="quarter",h="year",d="date",m="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}},b=function(t,e,i){var a=String(t);return!a||a.length>=e?t:""+Array(e+1-a.length).join(i)+t},v={s:b,z:function(t){var e=-t.utcOffset(),i=Math.abs(e),a=Math.floor(i/60),s=i%60;return(e<=0?"+":"-")+b(a,2,"0")+":"+b(s,2,"0")},m:function t(e,i){if(e.date()<i.date())return-t(i,e);var a=12*(i.year()-e.year())+(i.month()-e.month()),s=e.clone().add(a,c),n=i-s<0,o=e.clone().add(a+(n?-1:1),c);return+(-(a+(i-s)/(n?s-o:o-s))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:c,y:h,w:l,d:r,D:d,h:o,m:n,s:s,ms:a,Q:u}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},y="en",w={};w[y]=p;var k="$isDayjsObject",x=function(t){return t instanceof P||!(!t||!t[k])},D=function t(e,i,a){var s;if(!e)return y;if("string"==typeof e){var n=e.toLowerCase();w[n]&&(s=n),i&&(w[n]=i,s=n);var o=e.split("-");if(!s&&o.length>1)return t(o[0])}else{var r=e.name;w[r]=e,s=r}return!a&&s&&(y=s),s||!a&&y},$=function(t,e){if(x(t))return t.clone();var i="object"==typeof e?e:{};return i.date=t,i.args=arguments,new P(i)},S=v;S.l=D,S.i=x,S.w=function(t,e){return $(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var P=function(){function p(t){this.$L=D(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[k]=!0}var b=p.prototype;return b.parse=function(t){this.$d=function(t){var e=t.date,i=t.utc;if(null===e)return new Date(NaN);if(S.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var a=e.match(g);if(a){var s=a[2]-1||0,n=(a[7]||"0").substring(0,3);return i?new Date(Date.UTC(a[1],s,a[3]||1,a[4]||0,a[5]||0,a[6]||0,n)):new Date(a[1],s,a[3]||1,a[4]||0,a[5]||0,a[6]||0,n)}}return new Date(e)}(t),this.init()},b.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},b.$utils=function(){return S},b.isValid=function(){return!(this.$d.toString()===m)},b.isSame=function(t,e){var i=$(t);return this.startOf(e)<=i&&i<=this.endOf(e)},b.isAfter=function(t,e){return $(t)<this.startOf(e)},b.isBefore=function(t,e){return this.endOf(e)<$(t)},b.$g=function(t,e,i){return S.u(t)?this[e]:this.set(i,t)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(t,e){var i=this,a=!!S.u(e)||e,u=S.p(t),m=function(t,e){var s=S.w(i.$u?Date.UTC(i.$y,e,t):new Date(i.$y,e,t),i);return a?s:s.endOf(r)},g=function(t,e){return S.w(i.toDate()[t].apply(i.toDate("s"),(a?[0,0,0,0]:[23,59,59,999]).slice(e)),i)},f=this.$W,p=this.$M,b=this.$D,v="set"+(this.$u?"UTC":"");switch(u){case h:return a?m(1,0):m(31,11);case c:return a?m(1,p):m(0,p+1);case l:var y=this.$locale().weekStart||0,w=(f<y?f+7:f)-y;return m(a?b-w:b+(6-w),p);case r:case d:return g(v+"Hours",0);case o:return g(v+"Minutes",1);case n:return g(v+"Seconds",2);case s:return g(v+"Milliseconds",3);default:return this.clone()}},b.endOf=function(t){return this.startOf(t,!1)},b.$set=function(t,e){var i,l=S.p(t),u="set"+(this.$u?"UTC":""),m=(i={},i[r]=u+"Date",i[d]=u+"Date",i[c]=u+"Month",i[h]=u+"FullYear",i[o]=u+"Hours",i[n]=u+"Minutes",i[s]=u+"Seconds",i[a]=u+"Milliseconds",i)[l],g=l===r?this.$D+(e-this.$W):e;if(l===c||l===h){var f=this.clone().set(d,1);f.$d[m](g),f.init(),this.$d=f.set(d,Math.min(this.$D,f.daysInMonth())).$d}else m&&this.$d[m](g);return this.init(),this},b.set=function(t,e){return this.clone().$set(t,e)},b.get=function(t){return this[S.p(t)]()},b.add=function(a,u){var d,m=this;a=Number(a);var g=S.p(u),f=function(t){var e=$(m);return S.w(e.date(e.date()+Math.round(t*a)),m)};if(g===c)return this.set(c,this.$M+a);if(g===h)return this.set(h,this.$y+a);if(g===r)return f(1);if(g===l)return f(7);var p=(d={},d[n]=e,d[o]=i,d[s]=t,d)[g]||1,b=this.$d.getTime()+a*p;return S.w(b,this)},b.subtract=function(t,e){return this.add(-1*t,e)},b.format=function(t){var e=this,i=this.$locale();if(!this.isValid())return i.invalidDate||m;var a=t||"YYYY-MM-DDTHH:mm:ssZ",s=S.z(this),n=this.$H,o=this.$m,r=this.$M,l=i.weekdays,c=i.months,u=i.meridiem,h=function(t,i,s,n){return t&&(t[i]||t(e,a))||s[i].slice(0,n)},d=function(t){return S.s(n%12||12,t,"0")},g=u||function(t,e,i){var a=t<12?"AM":"PM";return i?a.toLowerCase():a};return a.replace(f,(function(t,a){return a||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return S.s(e.$y,4,"0");case"M":return r+1;case"MM":return S.s(r+1,2,"0");case"MMM":return h(i.monthsShort,r,c,3);case"MMMM":return h(c,r);case"D":return e.$D;case"DD":return S.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(i.weekdaysMin,e.$W,l,2);case"ddd":return h(i.weekdaysShort,e.$W,l,3);case"dddd":return l[e.$W];case"H":return String(n);case"HH":return S.s(n,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return g(n,o,!0);case"A":return g(n,o,!1);case"m":return String(o);case"mm":return S.s(o,2,"0");case"s":return String(e.$s);case"ss":return S.s(e.$s,2,"0");case"SSS":return S.s(e.$ms,3,"0");case"Z":return s}return null}(t)||s.replace(":","")}))},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(a,d,m){var g,f=this,p=S.p(d),b=$(a),v=(b.utcOffset()-this.utcOffset())*e,y=this-b,w=function(){return S.m(f,b)};switch(p){case h:g=w()/12;break;case c:g=w();break;case u:g=w()/3;break;case l:g=(y-v)/6048e5;break;case r:g=(y-v)/864e5;break;case o:g=y/i;break;case n:g=y/e;break;case s:g=y/t;break;default:g=y}return m?g:S.a(g)},b.daysInMonth=function(){return this.endOf(c).$D},b.$locale=function(){return w[this.$L]},b.locale=function(t,e){if(!t)return this.$L;var i=this.clone(),a=D(t,e,!0);return a&&(i.$L=a),i},b.clone=function(){return S.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},p}(),C=P.prototype;return $.prototype=C,[["$ms",a],["$s",s],["$m",n],["$H",o],["$W",r],["$M",c],["$y",h],["$D",d]].forEach((function(t){C[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),$.extend=function(t,e){return t.$i||(t(e,P,$),t.$i=!0),$},$.locale=D,$.isDayjs=x,$.unix=function(t){return $(1e3*t)},$.en=w[y],$.Ls=w,$.p={},$}()}(ne);var oe=ne.exports,re={exports:{}};!function(t){t.exports=function(){var t="minute",e=/[+-]\d\d(?::?\d\d)?/g,i=/([+-]|\d\d)/g;return function(a,s,n){var o=s.prototype;n.utc=function(t){return new s({date:t,utc:!0,args:arguments})},o.utc=function(e){var i=n(this.toDate(),{locale:this.$L,utc:!0});return e?i.add(this.utcOffset(),t):i},o.local=function(){return n(this.toDate(),{locale:this.$L,utc:!1})};var r=o.parse;o.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),r.call(this,t)};var l=o.init;o.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else l.call(this)};var c=o.utcOffset;o.utcOffset=function(a,s){var n=this.$utils().u;if(n(a))return this.$u?0:n(this.$offset)?c.call(this):this.$offset;if("string"==typeof a&&(a=function(t){void 0===t&&(t="");var a=t.match(e);if(!a)return null;var s=(""+a[0]).match(i)||["-",0,0],n=s[0],o=60*+s[1]+ +s[2];return 0===o?0:"+"===n?o:-o}(a),null===a))return this;var o=Math.abs(a)<=16?60*a:a,r=this;if(s)return r.$offset=o,r.$u=0===a,r;if(0!==a){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(r=this.local().add(o+l,t)).$offset=o,r.$x.$localOffset=l}else r=this.utc();return r};var u=o.format;o.format=function(t){var e=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return u.call(this,e)},o.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var h=o.toDate;o.toDate=function(t){return"s"===t&&this.$offset?n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var d=o.diff;o.diff=function(t,e,i){if(t&&this.$u===t.$u)return d.call(this,t,e,i);var a=this.local(),s=n(t).local();return d.call(a,s,e,i)}}}()}(re);var le=re.exports,ce={exports:{}};!function(t){t.exports=function(){var t,e,i=1e3,a=6e4,s=36e5,n=864e5,o=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,r=31536e6,l=2628e6,c=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,u={years:r,months:l,days:n,hours:s,minutes:a,seconds:i,milliseconds:1,weeks:6048e5},h=function(t){return t instanceof v},d=function(t,e,i){return new v(t,i,e.$l)},m=function(t){return e.p(t)+"s"},g=function(t){return t<0},f=function(t){return g(t)?Math.ceil(t):Math.floor(t)},p=function(t){return Math.abs(t)},b=function(t,e){return t?g(t)?{negative:!0,format:""+p(t)+e}:{negative:!1,format:""+t+e}:{negative:!1,format:""}},v=function(){function g(t,e,i){var a=this;if(this.$d={},this.$l=i,void 0===t&&(this.$ms=0,this.parseFromMilliseconds()),e)return d(t*u[m(e)],this);if("number"==typeof t)return this.$ms=t,this.parseFromMilliseconds(),this;if("object"==typeof t)return Object.keys(t).forEach((function(e){a.$d[m(e)]=t[e]})),this.calMilliseconds(),this;if("string"==typeof t){var s=t.match(c);if(s){var n=s.slice(2).map((function(t){return null!=t?Number(t):0}));return this.$d.years=n[0],this.$d.months=n[1],this.$d.weeks=n[2],this.$d.days=n[3],this.$d.hours=n[4],this.$d.minutes=n[5],this.$d.seconds=n[6],this.calMilliseconds(),this}}return this}var p=g.prototype;return p.calMilliseconds=function(){var t=this;this.$ms=Object.keys(this.$d).reduce((function(e,i){return e+(t.$d[i]||0)*u[i]}),0)},p.parseFromMilliseconds=function(){var t=this.$ms;this.$d.years=f(t/r),t%=r,this.$d.months=f(t/l