/*! For license information please see 98a16bd0.js.LICENSE.txt */ (()=>{var t={860:function(t){t.exports=function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",o="second",i="minute",s="hour",a="day",l="week",c="month",d="quarter",h="year",u="date",p="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|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,v={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"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},g=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},m={s:g,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),o=n%60;return(e<=0?"+":"-")+g(r,2,"0")+":"+g(o,2,"0")},m:function t(e,n){if(e.date()1)return t(s[0])}else{var a=e.name;$[a]=e,o=a}return!r&&o&&(b=o),o||!r&&b},E=function(t,e){if(x(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new S(n)},_=m;_.l=k,_.i=x,_.w=function(t,e){return E(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var S=function(){function v(t){this.$L=k(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[w]=!0}var g=v.prototype;return g.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(_.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(f);if(r){var o=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(e)}(t),this.init()},g.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()},g.$utils=function(){return _},g.isValid=function(){return!(this.$d.toString()===p)},g.isSame=function(t,e){var n=E(t);return this.startOf(e)<=n&&n<=this.endOf(e)},g.isAfter=function(t,e){return E(t){var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=n(860),e=n.n(t);class r{constructor(t,n,r=e()().year()){if(this.isUserDragging=!1,this.lastMouseX=0,this.currentDayWidth=30,this.handleMouseDown=t=>{this.isUserDragging=!0,this.lastMouseX=t.clientX},this.handleMouseMove=t=>{if(this.isUserDragging){const e=t.clientX-this.lastMouseX;this.chartContainer.scrollBy(-e,0),this.lastMouseX=t.clientX}},this.handleMouseUp=()=>{this.isUserDragging=!1},this.currentYear=r,this.taskList=n,this.chartContainer=document.querySelector(t),!this.chartContainer)throw new Error(`Container with selector ${t} not found`);this.renderChart(),this.handleMouseWheelInView(),this.centerOnCurrentDay(),this.updateDayWidthOnScroll()}getDaysOfMonth(t,e){return new Date(t,e+1,0).getDate()}renderChart(){this.chartContainer.innerHTML="";const t=document.createElement("div");t.className="timeline-container";const n=document.createElement("div");n.className="task-container",this.chartContainer.addEventListener("mousedown",this.handleMouseDown),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp);const r=document.createElement("div");r.className="months-row";const o=document.createElement("div");o.className="days-row";let i=0;for(let t=0;t<12;t++){const a=document.createElement("div");a.className="month",a.textContent=`${window.i18n[(s=t+1,{1:"January",2:"February",3:"March",4:"April",5:"May",6:"June",7:"July",8:"August",9:"September",10:"October",11:"November",12:"December"}[s])]}`,a.style.left=`${i}px`,r.appendChild(a);const l=this.getDaysOfMonth(this.currentYear,t);if(i>0){const t=document.createElement("div");t.style.position="absolute",t.style.height="100%",t.style.width="0",t.style.borderLeft="1px dashed var(--color-border)",t.style.left=`${i}px`,n.appendChild(t)}for(let n=1;n<=l;n++){const r=document.createElement("div");r.className="day";const s=`${this.currentYear}-${t+1}-${n}`;r.setAttribute("data-ymd",e()(s).format("YYYY-MM-DD")),r.textContent=`${n}`,r.style.position="absolute",r.style.left=`${i}px`,o.appendChild(r),i+=this.currentDayWidth}}var s;this.taskList.forEach(((t,r)=>{const o=document.createElement("div"),i=e()(),s=e()(t.start),a=e()(t.end),l=a.isBefore(i)?"expired":s.isBefore(i)&&a.isAfter(i)?"doing":"todo";o.classList.add("task-bar","ellipsis",l),o.setAttribute("data-start",e()(t.start).format("YYYY-MM-DD")),o.setAttribute("data-end",e()(t.end).format("YYYY-MM-DD")),o.style.position="absolute",o.style.padding="6px",o.style.display="flex",o.style.alignItems="center",o.style.lineHeight="1",o.style.top=34*r+"px";const c=e()(t.end).diff(t.start,"day");o.innerHTML=`${c} 天${t.title}`,n.appendChild(o),o.addEventListener("click",(()=>{var n;const r=document.createElement("cosy-popup"),o=`\n
\n

${`${e()(t.start).format("DD/MM/YYYY")} - ${e()(t.end).format("DD/MM/YYYY")}`}

\n

${null!==(n=t.content)&&void 0!==n?n:t.title}

\n
\n `;r.innerHTML=o,document.body.append(r)}))})),t.appendChild(r),t.appendChild(o),this.chartContainer.appendChild(t),this.chartContainer.appendChild(n),this.renderTodayVerticalLine(),this.updateTaskBars()}centerOnCurrentDay(){const t=new Date,e=t.getFullYear(),n=t.getMonth(),r=t.getDate();if(this.currentYear===e){let t=0;for(let r=0;r{t.deltaY>0&&this.currentDayWidth<5||(this.currentDayWidth*=t.deltaY>0?.9:1.1,this.renderChart(),this.updateDayWidthOnScroll(),this.updateTaskBars())}))}updateDayWidthOnScroll(){const t=[...this.chartContainer.querySelectorAll(".day")];this.currentDayWidth<25?t.forEach(((t,e)=>{t.style.display=e%8==0?"block":"none"})):t.forEach((t=>{t.style.display="block"})),this.updateTaskBars()}updateTaskBars(){[...this.chartContainer.querySelectorAll(".task-bar")].forEach((t=>{const n=t.getAttribute("data-start"),r=t.getAttribute("data-end"),o=this.chartContainer.querySelector(`.day[data-ymd="${n}"]`),i=this.chartContainer.querySelector(`.day[data-ymd="${e()(r).format("YYYY-MM-DD")}"]`);if(o&&i){const e=parseInt(o.style.left,10),n=parseInt(i.style.left,10)-e;t.style.left=`${e}px`,t.style.width=`${n}px`}}))}renderTodayVerticalLine(){const t=e()().format("YYYY-MM-DD"),n=this.chartContainer.querySelector(`.day[data-ymd="${t}"]`);if(!n)return;n.classList.add("today");const r=+n.style.left.replace("px","")+n.offsetWidth/2,o=document.createElement("div");o.className="today-vertical-line",o.style.position="absolute",o.style.height="100%",o.style.width="0",o.style.borderLeft="2px dashed var(--color-primary)",o.style.left=r-2-1+"px";this.chartContainer.querySelector(".task-container").appendChild(o)}updateTasks(t,e){this.currentDayWidth=30,this.currentYear=e,this.taskList=t,this.renderChart()}}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:document,r=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0});n.dispatchEvent(r)}},{key:"on",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:document).addEventListener(t,e)}},{key:"off",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:document).removeEventListener(t,e)}}],n&&i(e.prototype,n),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),a=new s;const l=globalThis,c=l.ShadowRoot&&(void 0===l.ShadyCSS||l.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,d=Symbol(),h=new WeakMap;class u{constructor(t,e,n){if(this._$cssResult$=!0,n!==d)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(c&&void 0===t){const n=void 0!==e&&1===e.length;n&&(t=h.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&h.set(e,t))}return t}toString(){return this.cssText}}const p=(t,...e)=>{const n=1===t.length?t[0]:e.reduce(((e,n,r)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[r+1]),t[0]);return new u(n,t,d)},f=c?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const n of t.cssRules)e+=n.cssText;return(t=>new u("string"==typeof t?t:t+"",void 0,d))(e)})(t):t,{is:y,defineProperty:v,getOwnPropertyDescriptor:g,getOwnPropertyNames:m,getOwnPropertySymbols:b,getPrototypeOf:$}=Object,w=globalThis,x=w.trustedTypes,k=x?x.emptyScript:"",E=w.reactiveElementPolyfillSupport,_=(t,e)=>t,S={toAttribute(t,e){switch(e){case Boolean:t=t?k:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=null!==t;break;case Number:n=null===t?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},A=(t,e)=>!y(t,e),C={attribute:!0,type:String,converter:S,reflect:!1,hasChanged:A};Symbol.metadata??=Symbol("metadata"),w.litPropertyMetadata??=new WeakMap;class D extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=C){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(t,n,e);void 0!==r&&v(this.prototype,t,r)}}static getPropertyDescriptor(t,e,n){const{get:r,set:o}=g(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return r?.call(this)},set(e){const i=r?.call(this);o.call(this,e),this.requestUpdate(t,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??C}static _$Ei(){if(this.hasOwnProperty(_("elementProperties")))return;const t=$(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(_("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(_("properties"))){const t=this.properties,e=[...m(t),...b(t)];for(const n of e)this.createProperty(n,t[n])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,n]of e)this.elementProperties.set(t,n)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const n=this._$Eu(t,e);void 0!==n&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const t of n)e.unshift(f(t))}else void 0!==t&&e.push(f(t));return e}static _$Eu(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$Eg=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$ES(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$E_??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$E_?.delete(t)}_$ES(){const t=new Map,e=this.constructor.elementProperties;for(const n of e.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(c)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const n of e){const e=document.createElement("style"),r=l.litNonce;void 0!==r&&e.setAttribute("nonce",r),e.textContent=n.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$E_?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$E_?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,n){this._$AK(t,n)}_$EO(t,e){const n=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,n);if(void 0!==r&&!0===n.reflect){const o=(void 0!==n.converter?.toAttribute?n.converter:S).toAttribute(e,n.type);this._$Em=t,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){const n=this.constructor,r=n._$Eh.get(t);if(void 0!==r&&this._$Em!==r){const t=n.getPropertyOptions(r),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:S;this._$Em=r,this[r]=o.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,n,r=!1,o){if(void 0!==t){if(n??=this.constructor.getPropertyOptions(t),!(n.hasChanged??A)(r?o:this[t],e))return;this.C(t,e,n)}!1===this.isUpdatePending&&(this._$Eg=this._$EP())}C(t,e,n){this._$AL.has(t)||this._$AL.set(t,e),!0===n.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,n]of t)!0!==n.wrapped||this._$AL.has(e)||void 0===this[e]||this.C(e,this[e],n)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$E_?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$ET()}catch(e){throw t=!1,this._$ET(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$E_?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EO(t,this[t]))),this._$ET()}updated(t){}firstUpdated(t){}}D.elementStyles=[],D.shadowRootOptions={mode:"open"},D[_("elementProperties")]=new Map,D[_("finalized")]=new Map,E?.({ReactiveElement:D}),(w.reactiveElementVersions??=[]).push("2.0.2");const M=globalThis,O=M.trustedTypes,P=O?O.createPolicy("lit-html",{createHTML:t=>t}):void 0,z="$lit$",T=`lit$${(Math.random()+"").slice(9)}$`,L="?"+T,N=`<${L}>`,U=document,Y=()=>U.createComment(""),W=t=>null===t||"object"!=typeof t&&"function"!=typeof t,j=Array.isArray,H=t=>j(t)||"function"==typeof t?.[Symbol.iterator],R="[ \t\n\f\r]",B=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,I=/-->/g,q=/>/g,X=RegExp(`>|${R}(?:([^\\s"'>=/]+)(${R}*=${R}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),V=/'/g,F=/"/g,J=/^(?:script|style|textarea|title)$/i,Z=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),K=Z(1),Q=(Z(2),Symbol.for("lit-noChange")),G=Symbol.for("lit-nothing"),tt=new WeakMap,et=U.createTreeWalker(U,129);function nt(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==P?P.createHTML(e):e}const rt=(t,e)=>{const n=t.length-1,r=[];let o,i=2===e?"":"",s=B;for(let e=0;e"===l[0]?(s=o??B,c=-1):void 0===l[1]?c=-2:(c=s.lastIndex-l[2].length,a=l[1],s=void 0===l[3]?X:'"'===l[3]?F:V):s===F||s===V?s=X:s===I||s===q?s=B:(s=X,o=void 0);const h=s===X&&t[e+1].startsWith("/>")?" ":"";i+=s===B?n+N:c>=0?(r.push(a),n.slice(0,c)+z+n.slice(c)+T+h):n+T+(-2===c?e:h)}return[nt(t,i+(t[n]||"")+(2===e?"":"")),r]};class ot{constructor({strings:t,_$litType$:e},n){let r;this.parts=[];let o=0,i=0;const s=t.length-1,a=this.parts,[l,c]=rt(t,e);if(this.el=ot.createElement(l,n),et.currentNode=this.el.content,2===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=et.nextNode())&&a.length0){r.textContent=O?O.emptyScript:"";for(let n=0;n2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=G}_$AI(t,e=this,n,r){const o=this.strings;let i=!1;if(void 0===o)t=it(this,t,e,0),i=!W(t)||t!==this._$AH&&t!==Q,i&&(this._$AH=t);else{const r=t;let s,a;for(t=o[0],s=0;s{const r=n?.renderBefore??e;let o=r._$litPart$;if(void 0===o){const t=n?.renderBefore??null;r._$litPart$=o=new at(e.insertBefore(Y(),t),t,void 0,n??{})}return o._$AI(t),o})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Q}}ft._$litElement$=!0,ft.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:ft});const yt=globalThis.litElementPolyfillSupport;yt?.({LitElement:ft});(globalThis.litElementVersions??=[]).push("4.0.2");const vt={attribute:!0,type:String,converter:S,reflect:!1,hasChanged:A},gt=(t=vt,e,n)=>{const{kind:r,metadata:o}=n;let i=globalThis.litPropertyMetadata.get(o);if(void 0===i&&globalThis.litPropertyMetadata.set(o,i=new Map),i.set(n.name,t),"accessor"===r){const{name:r}=n;return{set(n){const o=e.get.call(this);e.set.call(this,n),this.requestUpdate(r,o,t)},init(e){return void 0!==e&&this.C(r,void 0,t),e}}}if("setter"===r){const{name:r}=n;return function(n){const o=this[r];e.call(this,n),this.requestUpdate(r,o,t)}}throw Error("Unsupported decorator location: "+r)};function mt(t){return(e,n)=>"object"==typeof n?gt(t,e,n):((t,e,n)=>{const r=e.hasOwnProperty(n);return e.constructor.createProperty(n,r?{...t,wrapped:!0}:t),r?Object.getOwnPropertyDescriptor(e,n):void 0})(t,e,n)}var bt,$t,wt,xt,kt,Et,_t,St,At,Ct,Dt,Mt,Ot,Pt,zt,Tt,Lt,Nt,Ut,Yt,Wt,jt,Ht,Rt,Bt,It,qt;function Xt(){return Xt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=te(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Xt.apply(this,arguments)}function Vt(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function Ft(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Jt(t,e){for(var n=0;n=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,n,s):o(e,n))||s);return i>3&&s&&Object.defineProperty(e,n,s),s}"function"==typeof SuppressedError&&SuppressedError;var re=function(t){Kt(n,t);var e=Gt(n);function n(){var t;return Ft(this,n),(t=e.call(this)).invisible=!1,t.uid=t.generateUniqueId(),t.eventBus=a,t}return Zt(n,[{key:"generateUniqueId",value:function(){return"unique-".concat(Math.random().toString(36).slice(2,11))}}]),n}(ft);re.styles=p(bt||(bt=Vt(["\n :host([invisible]) {\n display: none;\n }\n :host([disabled]) {\n pointer-events: none;\n opacity: 0.6;\n }\n "]))),ne([mt({type:String})],re.prototype,"uid",void 0),ne([mt({type:Boolean})],re.prototype,"disabled",void 0),ne([mt({type:Boolean,reflect:!0})],re.prototype,"invisible",void 0);var oe=function(t){Kt(n,t);var e=Gt(n);function n(){var t;return Ft(this,n),(t=e.apply(this,arguments)).size="md",t.type="solid",t}return Zt(n,[{key:"render",value:function(){return K($t||($t=Vt(['\n \x3c!-- prefix图标插槽 --\x3e\n \n \x3c!-- 文本插槽 --\x3e\n \n \x3c!-- suffix图标插槽 --\x3e\n \n '])),this.size,this.round?"round":"",this.handleClick,this.type)}},{key:"handleClick",value:function(){var t=this.uid;this.eventBus.emit("cosy-button:click:".concat(t),{uid:t})}}],[{key:"styles",get:function(){return[re.styles,p(wt||(wt=Vt(['\n button {\n transition: all 0.3s ease;\n background-color: var(--color-button-bg);\n border-width: 1px;\n border-color: var(--color-button-border);\n color: var(--color-button-font);\n text-align: center;\n text-decoration: none;\n border-radius: var(--radius-base, 4px);\n display: inline-flex;\n gap: 6px;\n align-items: center;\n cursor: pointer;\n }\n button:hover {\n color: var(--color-button-font-hover);\n background-color: var(--color-button-bg-hover);\n border-color: var(--color-button-border-hover);\n }\n ::slotted([slot="content"]) {\n padding-right: 2px;\n line-height: 1.5;\n }\n .round {\n border-radius: 16px;\n }\n .size-sm {\n padding: 2px 6px;\n font-size: 12px;\n }\n .size-md {\n padding: 2px 6px;\n font-size: 14px;\n }\n .size-lg {\n padding: 2px 6px;\n font-size: 16px;\n }\n\n .size-sm ::slotted([slot="prefix"]),\n .size-sm ::slotted([slot="suffix"]) {\n width: 12px;\n height: 12px;\n }\n\n .size-md ::slotted([slot="prefix"]),\n .size-md ::slotted([slot="suffix"]) {\n width: 14px;\n height: 14px;\n }\n\n .size-lg ::slotted([slot="prefix"]),\n .size-lg ::slotted([slot="suffix"]) {\n width: 16px;\n height: 16px;\n }\n '])))]}}]),n}(re);ne([mt({type:String})],oe.prototype,"size",void 0),ne([mt({type:String})],oe.prototype,"type",void 0),ne([mt({type:Boolean})],oe.prototype,"round",void 0),customElements.get("cosy-button")||customElements.define("cosy-button",oe);var ie="cosy-icon",se=function(t){Kt(n,t);var e=Gt(n);function n(){var t;return Ft(this,n),(t=e.apply(this,arguments)).size="md",t.blank=!1,t.buttonStyle=!1,t}return Zt(n,[{key:"render",value:function(){if(this.href){var t=this.blank?"blank":"";return K(kt||(kt=Vt([''])),this.href,t,this.size)}return K(xt||(xt=Vt([''])),this.size)}}],[{key:"styles",get:function(){return[re.styles,p(Et||(Et=Vt(["\n :host {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n }\n a {\n color: var(--color-icon);\n text-decoration: none;\n transition: color 0.3s;\n cursor: pointer;\n }\n a:hover {\n color: var(--color-icon-hover);\n }\n .size-sm {\n width: 16px;\n height: 16px;\n }\n .size-md {\n width: 20px;\n height: 20px;\n }\n .size-lg {\n width: 24px;\n height: 24px;\n }\n svg {\n width: 100%;\n height: 100%;\n fill: currentColor;\n }\n :host([bordered]) {\n background: var(--color-button-bg);\n border: 1px solid var(--color-button-border);\n border-radius: var(--raius-base, 4px);\n }\n :host([bordered]:hover) {\n background: var(--color-button-bg-hover);\n border-color: var(--color-button-border-hover);\n }\n "])))]}}]),n}(re);ne([mt({type:String})],se.prototype,"size",void 0),ne([mt({type:String})],se.prototype,"href",void 0),ne([mt({type:Boolean})],se.prototype,"blank",void 0),ne([mt({type:Boolean,attribute:"bordered"})],se.prototype,"buttonStyle",void 0),customElements.get(ie)||customElements.define(ie,se);var ae=function(t){Kt(n,t);var e=Gt(n);function n(){var t;return Ft(this,n),(t=e.apply(this,arguments)).size="md",t}return Zt(n,[{key:"render",value:function(){return K(_t||(_t=Vt(["
\n \n
"])),"size-".concat(this.size))}}],[{key:"styles",get:function(){return[re.styles,p(St||(St=Vt(["\n div {\n display: inline-flex;\n padding: 6px;\n border-radius: var(--radius-base, 4px);\n background-color: var(--color-short-key-bg);\n color: var(--color-short-key-font);\n }\n .size-sm {\n padding: 2px;\n }\n .size-md {\n padding: 4px;\n }\n .size-lg {\n padding: 6px;\n }\n span {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n text-transform: capitalize;\n height: 14px;\n min-width: 14px;\n font-size: 14px;\n }\n svg {\n width: 100%;\n height: 100%;\n fill: currentColor;\n }\n "])))]}}]),n}(re);ne([mt({type:String})],ae.prototype,"size",void 0),customElements.get("cosy-short-key")||customElements.define("cosy-short-key",ae);var le=function(t){Kt(n,t);var e=Gt(n);function n(){var t;return Ft(this,n),(t=e.apply(this,arguments)).placeholder="搜索",t.iconOnly=!1,t}return Zt(n,[{key:"handleClick",value:function(){}},{key:"render",value:function(){return K(At||(At=Vt(['\n \n \n \n \n \n ','\n \n '])),this.handleClick,this.iconOnly?"icon-only":"",this.placeholder)}}],[{key:"styles",get:function(){return[re.styles,p(Ct||(Ct=Vt(["\n form {\n display: flex;\n align-items: center;\n padding: 0 6px;\n height: 32px;\n border-radius: var(--radius-base, 4px);\n background: var(--color-search-bg);\n border: 1px solid var(--color-search-border);\n transition: all 0.3s;\n cursor: pointer;\n }\n .icon-only {\n display: inline-flex;\n justify-content: center;\n padding: 6px;\n height: auto;\n }\n .icon-only span {\n display: none;\n }\n .icon-only slot {\n display: none;\n }\n form:hover {\n border-color: var(--color-search-border-hover);\n }\n svg {\n transition: all 0.3s;\n color: var(--color-search-font);\n width: 16px;\n height: 16px;\n }\n span {\n flex: 1;\n padding: 0 6px;\n font-size: 13px;\n color: var(--color-search-font);\n }\n "])))]}}]),n}(re);ne([mt({type:String})],le.prototype,"placeholder",void 0),ne([mt({type:Boolean,attribute:"icon-only"})],le.prototype,"iconOnly",void 0),customElements.get("cosy-search")||customElements.define("cosy-search",le);var ce=function(t){Kt(n,t);var e=Gt(n);function n(){var t;return Ft(this,n),(t=e.apply(this,arguments)).checked=!1,t.size="md",t}return Zt(n,[{key:"toggleChecked",value:function(){this.checked=!this.checked}},{key:"render",value:function(){return K(Dt||(Dt=Vt(['\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n '])),this.size,this.toggleChecked)}}],[{key:"styles",get:function(){return[re.styles,p(Mt||(Mt=Vt(["\n .switch-sm {\n --switch-width: 36px; /* 默认宽度 */\n --switch-height: 18px; /* 默认高度 */\n --switch-radius: 9px; /* 默认圆角 */\n }\n .switch-md {\n --switch-width: 42px; /* 默认宽度 */\n --switch-height: 20px; /* 默认高度 */\n --switch-radius: 10px; /* 默认圆角 */\n }\n .switch-lg {\n --switch-width: 48px; /* 默认宽度 */\n --switch-height: 24px; /* 默认高度 */\n --switch-radius: 12px; /* 默认圆角 */\n }\n .switch {\n width: var(--switch-width);\n height: var(--switch-height);\n border-radius: var(--switch-radius);\n background-color: var(--color-switch-track-bg);\n border: 1px solid var(--color-switch-border);\n position: relative;\n cursor: pointer;\n transition: border 0.3s, background-color 0.3s;\n }\n .switch:hover {\n border-color: var(--color-switch-border-hover);\n }\n .switch-knob {\n position: absolute;\n width: 50%;\n height: 100%;\n background-color: var(--color-switch-bg);\n border-radius: var(--switch-radius);\n transition: background-color 0.3s, border 0.3s, left 0.3s;\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n transform: scale(1.05);\n left: 0;\n }\n :host([checked]) .switch {\n background-color: var(--color-switch-track-bg-checked);\n }\n :host([checked]) .switch-knob {\n left: 50%;\n color: var(--color-switch-font-checked);\n background-color: var(--color-switch-bg-checked);\n }\n .content {\n position: absolute;\n width: 100%;\n height: 100%;\n display: none;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n }\n .content ::slotted(*) {\n max-width: 70%;\n max-height: 70%;\n text-align: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n :host(:not([checked])) .content-left,\n :host([checked]) .content-right {\n display: flex;\n }\n "])))]}}]),n}(re);ne([mt({type:Boolean,reflect:!0})],ce.prototype,"checked",void 0),ne([mt({type:String})],ce.prototype,"size",void 0),customElements.get("cosy-switch")||customElements.define("cosy-switch",ce);var de=function(t){Kt(n,t);var e=Gt(n);function n(){var t;return Ft(this,n),(t=e.apply(this,arguments)).placement="bottom",t.maxWidth="220px",t.textWrap=!1,t.textWrapWidth="220px",t.fontColor="var(--color-font-1)",t}return Zt(n,[{key:"render",value:function(){return K(Ot||(Ot=Vt(['
\n \n
'])),this.placement,this.fontColor,this.maxWidth,this.textWrap?"wrap":"nowrap",this.textWrap?1.5:1,this.textWrap?this.textWrapWidth:"inherit")}}],[{key:"styles",get:function(){return[re.styles,p(Pt||(Pt=Vt(["\n .tooltip {\n position: relative;\n display: inline-flex;\n user-select: none;\n }\n .tooltip-content {\n display: inline-block;\n visibility: hidden;\n opacity: 0;\n background-color: var(--color-tooltip-bg);\n border: 1px solid var(--color-tooltip-border);\n backdrop-filter: var(--color-frost-bg);\n padding: 4px 8px;\n border-radius: var(--radius-base, 4px);\n position: absolute;\n z-index: 1;\n font-size: 13px;\n transition: opacity 0.3s ease, visibility 0.3s;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .tooltip:hover .tooltip-content {\n visibility: visible;\n opacity: 1;\n }\n .top {\n bottom: calc(100% + 6px);\n left: 50%;\n transform: translateX(-50%);\n }\n .top-left {\n left: 0;\n bottom: calc(100% + 6px);\n }\n .top-right {\n right: 0;\n bottom: 115%;\n }\n .bottom {\n top: calc(100% + 6px);\n left: 50%;\n transform: translateX(-50%);\n }\n .bottom-left {\n left: 0;\n top: calc(100% + 6px);\n }\n .bottom-right {\n right: 0;\n top: calc(100% + 6px);\n }\n .left {\n right: calc(100% + 6px);\n top: 50%;\n transform: translateY(-50%);\n }\n .right {\n left: calc(100% + 6px);\n top: 50%;\n transform: translateY(-50%);\n }\n "])))]}}]),n}(re);ne([mt({type:String})],de.prototype,"placement",void 0),ne([mt({type:String,attribute:"max-width"})],de.prototype,"maxWidth",void 0),ne([mt({type:Boolean,attribute:"text-wrap"})],de.prototype,"textWrap",void 0),ne([mt({type:String,attribute:"text-wrap-width"})],de.prototype,"textWrapWidth",void 0),ne([mt({type:String,attribute:"font-color"})],de.prototype,"fontColor",void 0),customElements.get("cosy-tooltip")||customElements.define("cosy-tooltip",de);var he="cosy-drag-box",ue=function(t){Kt(n,t);var e=Gt(n);function n(){var t;return Ft(this,n),(t=e.apply(this,arguments)).trigger="right",t.minWidth=100,t.hideThreshold=50,t.dragging=null,t.startX=0,t.startWidth=0,t.drag=function(e){if(t.dragging){t.updateDraggerOpacity();var n=e.clientX-t.startX,r="left"===t.dragging?t.startWidth-n:t.startWidth+n;r>t.minWidth?t.style.width="".concat(r,"px"):r\n '])),e,(function(n){return t.startDrag(n,e)}))},t}return Zt(n,[{key:"updateDraggerOpacity",value:function(){var t,e,n=this;null===(e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelectorAll(".dragger"))||void 0===e||e.forEach((function(t){n.dragging?t.style.opacity="1":t.removeAttribute("style")}))}},{key:"render",value:function(){var t="min-width: ".concat(this.minWidth,"px;border-").concat(this.trigger,":1px solid var(--color-border);height:100%");return K(Tt||(Tt=Vt(['\n
\n ',"\n \n
\n "])),t,this.renderDragger())}}],[{key:"styles",get:function(){return[re.styles,p(Lt||(Lt=Vt(["\n :host {\n display: block;\n position: relative;\n overflow-x: hidden;\n }\n .dragger {\n position: absolute;\n background-color: var(--color-dragger);\n opacity: 0;\n transition: opacity 0.2s;\n }\n .dragger:hover {\n opacity: 1;\n }\n .dragger[dragging] {\n opacity: 1;\n }\n .dragger-left,\n .dragger-right {\n top: 0;\n bottom: 0;\n width: 3px;\n cursor: col-resize;\n }\n .dragger-left {\n left: 0;\n }\n .dragger-right {\n right: 0;\n }\n "])))]}}]),n}(re);ne([mt({type:String})],ue.prototype,"trigger",void 0),ne([mt({type:Number,attribute:"min-width"})],ue.prototype,"minWidth",void 0),ne([mt({type:Number,attribute:"threshold"})],ue.prototype,"hideThreshold",void 0),customElements.get(he)||customElements.define(he,ue);var pe=function(t){Kt(n,t);var e=Gt(n);function n(){var t;return Ft(this,n),(t=e.apply(this,arguments)).margin="1rem 0",t}return Zt(n,[{key:"render",value:function(){return K(Nt||(Nt=Vt(['
'])),this.margin)}}],[{key:"styles",get:function(){return[re.styles,p(Ut||(Ut=Vt(["\n div {\n height: 1px;\n background-image: linear-gradient(\n to right,\n transparent,\n var(--color-border),\n transparent\n );\n }\n "])))]}}]),n}(re);ne([mt({type:String})],pe.prototype,"margin",void 0),customElements.get("cosy-divider")||customElements.define("cosy-divider",pe);var fe="cosy-popup",ye=function(t){Kt(n,t);var e=Gt(n);function n(){return Ft(this,n),e.apply(this,arguments)}return Zt(n,[{key:"destroy",value:function(){this.parentNode&&this.parentNode.removeChild(this)}},{key:"onBackdropClick",value:function(t){t.target===this&&this.destroy()}},{key:"connectedCallback",value:function(){Xt(te(n.prototype),"connectedCallback",this).call(this),this.addEventListener("click",this.onBackdropClick)}},{key:"disconnectedCallback",value:function(){this.removeEventListener("click",this.onBackdropClick),Xt(te(n.prototype),"disconnectedCallback",this).call(this)}},{key:"render",value:function(){return K(Yt||(Yt=Vt(['\n
\n \n
\n '])))}}],[{key:"styles",get:function(){return p(Wt||(Wt=Vt(["\n :host {\n display: block;\n position: fixed;\n padding: 24px;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: var(--color-popup-mask-bg); /* 半透明蒙版 */\n backdrop-filter: blur(5px); /* 模糊效果 */\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 19940121;\n }\n .content {\n background: var(--color-popup-bg);\n padding: 20px;\n border-radius: var(--radius-base, 4px);\n box-shadow: rgba(0, 0, 0, 0.2) 0px 16px 70px;\n backdrop-filter: blur(20px) saturate(190%) contrast(70%) brightness(80%);\n border: 0.5px solid var(--color-popup-border);\n }\n "])))}}]),n}(re);customElements.get(fe)||customElements.define(fe,ye);var ve=function(t){Kt(n,t);var e=Gt(n);function n(){var t;return Ft(this,n),(t=e.apply(this,arguments)).blank=!1,t}return Zt(n,[{key:"render",value:function(){var t=this.href?this.href:"javascript:void(0);",e=this.blank?"blank":"";return K(jt||(jt=Vt(['\n \n \n '])),this.bordered?"bordered":"",t,e,this.color?"dot "+this.color:"")}}],[{key:"styles",get:function(){return[re.styles,p(Ht||(Ht=Vt(["\n a {\n padding: 4px;\n transition: all 0.3s ease;\n background-color: var(--color-label-bg);\n color: var(--color-label-font);\n border-radius: var(--radius-base, 4px);\n display: inline-flex;\n align-items: center;\n font-size: 12px;\n text-decoration: none;\n user-select: none;\n }\n .bordered {\n border: 1px solid var(--color-label-border);\n }\n a:hover {\n border-color: var(--color-label-border-hover);\n /* background-color: var(--color-label-bg-hover); */\n color: var(--color-label-font-hover);\n }\n .round {\n border-radius: 16px;\n }\n .dot {\n margin-right: 6px;\n display: inline-block;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n }\n .yellow {\n background: var(--color-yellow);\n }\n .orange {\n background: var(--color-orange);\n }\n .teal {\n background: var(--color-teal);\n }\n .red {\n background: var(--color-red);\n }\n .blue {\n background: var(--color-blue);\n }\n .grey {\n background: var(--color-grey);\n }\n .green {\n background: var(--color-green);\n }\n "])))]}}]),n}(re);ne([mt({type:String})],ve.prototype,"color",void 0),ne([mt({type:Boolean})],ve.prototype,"bordered",void 0),ne([mt({type:String})],ve.prototype,"href",void 0),ne([mt({type:Boolean})],ve.prototype,"blank",void 0),customElements.get("cosy-label")||customElements.define("cosy-label",ve);var ge="cosy-card",me=function(t){Kt(n,t);var e=Gt(n);function n(){return Ft(this,n),e.apply(this,arguments)}return Zt(n,[{key:"handleCardMouseMove",value:function(t){var e=t.detail,n=e.mouseX,r=e.mouseY,o=this.getBoundingClientRect(),i=n-o.left,s=r-o.top;this.style.setProperty("--mouse-x","".concat(i,"px")),this.style.setProperty("--mouse-y","".concat(s,"px"))}},{key:"connectedCallback",value:function(){var t=this;Xt(te(n.prototype),"connectedCallback",this).call(this),this.eventBus.on("card-group:mousemove",(function(e){return t.handleCardMouseMove(e)}))}},{key:"disconnectedCallback",value:function(){Xt(te(n.prototype),"disconnectedCallback",this).call(this),this.eventBus.off("card-group:mousemove",this.handleCardMouseMove)}},{key:"render",value:function(){return K(Rt||(Rt=Vt(['\n
\n
\n
'])))}}],[{key:"styles",get:function(){return[re.styles,p(Bt||(Bt=Vt(['\n .card {\n background-color: var(--color-border);\n border-radius: 10px;\n cursor: pointer;\n display: inline-flex;\n flex-direction: column;\n position: relative;\n color: var(--color-font);\n }\n\n .card::before,\n .card::after {\n border-radius: inherit;\n content: "";\n height: 100%;\n left: 0px;\n opacity: 0;\n position: absolute;\n top: 0px;\n transition: opacity 500ms;\n width: 100%;\n background: radial-gradient(\n 800px circle at var(--mouse-x) var(--mouse-y),\n var(--color-radial-before),\n transparent 40%\n );\n z-index: 3;\n }\n\n .card::after {\n background: radial-gradient(\n 800px circle at var(--mouse-x) var(--mouse-y),\n var(--color-radial-after),\n transparent 40%\n );\n opacity: 1;\n z-index: 1;\n }\n\n .mask {\n position: absolute;\n background-color: var(--color-bg-2);\n border-radius: inherit;\n inset: 1px;\n z-index: 2;\n }\n\n .content {\n z-index: 4;\n }\n '])))]}}]),n}(re);customElements.get(ge)||customElements.define(ge,me);var be="cosy-card-group",$e=function(t){Kt(n,t);var e=Gt(n);function n(){var t;return Ft(this,n),(t=e.apply(this,arguments)).row=3,t}return Zt(n,[{key:"handleMouseMove",value:function(t){var e=t.clientX,n=t.clientY;this.eventBus.emit("card-group:mousemove",{mouseX:e,mouseY:n})}},{key:"render",value:function(){return K(It||(It=Vt(['\n \n '])),this.handleMouseMove)}}],[{key:"styles",get:function(){return[re.styles,p(qt||(qt=Vt(["\n .card-group {\n display: grid;\n justify-items: center;\n align-items: center;\n gap: 12px;\n }\n "])))]}}]),n}(re);ne([mt({type:Number})],$e.prototype,"row",void 0),customElements.get(be)||customElements.define(be,$e);var we=function(){function t(e,n,r){Ft(this,t),this.dropdownElement=null,this.selector=e,this.options=n,this.element=document.querySelector(this.selector),this.onClickItem=r.onClickItem,this.init()}return Zt(t,[{key:"init",value:function(){this.element&&(this.element.addEventListener("click",this.toggleDropdown.bind(this)),document.addEventListener("click",this.handleDocumentClick.bind(this)))}},{key:"toggleDropdown",value:function(e){e.stopPropagation(),t.activeDropdown&&t.activeDropdown!==this&&t.activeDropdown.removeDropdown(),this.dropdownElement?this.removeDropdown():(this.createDropdown(),t.activeDropdown=this)}},{key:"fadeIn",value:function(t,e){var n=0,r=16.7/e;!function e(){if((n+=r)>=1)return n=1,void(t.style.opacity=String(n));t.style.opacity=String(n),requestAnimationFrame(e)}()}},{key:"fadeOut",value:function(t,e,n){var r=1,o=16.7/e,i=t;!function t(){if(i){if((r-=o)<=0)return r=0,i.style.opacity=String(r),void n();i.style.opacity=String(r),requestAnimationFrame(t)}}()}},{key:"createDropdown",value:function(){var t,e=this;this.dropdownElement=document.createElement("div"),this.dropdownElement.style.opacity="0",this.options.forEach((function(t){var n=document.createElement("div");if(n.style.padding="8px 12px",n.style.color="var(--color-font-2)",n.style.borderRadius="var(--radius-base, 4px)",n.style.fontSize="13px",n.style.cursor="pointer",n.style.display="flex",n.style.alignItems="center",t.icon){var r=document.createElement("span");r.innerHTML=t.icon,r.style.marginRight="8px",r.style.width="16px",r.style.height="16px",n.appendChild(r)}var o=document.createTextNode(String(t.label));n.appendChild(o),n.addEventListener("click",(function(){var n;null===(n=e.onClickItem)||void 0===n||n.call(e,t),e.removeDropdown()})),n.addEventListener("mouseenter",(function(){n.style.backgroundColor="var(--color-dropdown-hover)",n.style.color="var(--color-font)"})),n.addEventListener("mouseleave",(function(){n.style.backgroundColor="",n.style.color="var(--color-font-2)"})),e.dropdownElement.appendChild(n)})),document.body.appendChild(this.dropdownElement),this.dropdownElement.style.position="absolute",this.dropdownElement.style.padding="6px 4px",this.dropdownElement.style.borderRadius="var(--radius-base,4px)",this.dropdownElement.style.background="var(--color-dropdown-bg)",this.dropdownElement.style.backdropFilter="var(--color-frost-bg)",this.dropdownElement.style.border="1px solid var(--color-dropdown-border)",this.dropdownElement.style.boxShadow="var(--color-dropdown-shadow)";var n=null===(t=document.querySelector(this.selector))||void 0===t?void 0:t.getBoundingClientRect();this.dropdownElement.style.top="".concat(n.top,"px"),this.dropdownElement.style.left="".concat(n.left,"px"),this.dropdownElement.style.minWidth="".concat(n.width,"px"),this.fadeIn(this.dropdownElement,150)}},{key:"removeDropdown",value:function(){var t=this;if(this.dropdownElement){var e=this.dropdownElement;this.fadeOut(e,150,(function(){e.remove(),t.dropdownElement===e&&(t.dropdownElement=null)}))}}},{key:"handleDocumentClick",value:function(){this.removeDropdown()}}]),t}();we.activeDropdown=null;var xe=function(){function t(e,n){Ft(this,t),this.popoverElement=null,this.options=n,this.element="string"==typeof e?document.querySelector(e):e,this.init()}return Zt(t,[{key:"init",value:function(){this.element&&(this.element.addEventListener("click",this.togglePopover.bind(this)),document.addEventListener("click",this.handleDocumentClick.bind(this)))}},{key:"togglePopover",value:function(e){e.stopPropagation(),t.activePopover&&t.activePopover!==this&&t.activePopover.removePopover(),this.popoverElement?this.removePopover():(this.createPopover(),t.activePopover=this)}},{key:"fadeIn",value:function(t,e){var n=0,r=16.7/e;!function e(){if((n+=r)>=1)return n=1,void(t.style.opacity=String(n));t.style.opacity=String(n),requestAnimationFrame(e)}()}},{key:"fadeOut",value:function(t,e,n){var r=1,o=16.7/e,i=t;!function t(){if(i){if((r-=o)<=0)return r=0,i.style.opacity=String(r),void n();i.style.opacity=String(r),requestAnimationFrame(t)}}()}},{key:"createPopover",value:function(){var t=this;this.popoverElement=document.createElement("div");var e=this.options.classNames,n=void 0===e?[]:e;if(this.popoverElement.classList.add("popover-content","scrollbar-obtrusive"),n.forEach((function(e){var n;return null===(n=t.popoverElement)||void 0===n?void 0:n.classList.add(e)})),this.popoverElement.style.opacity="0",this.options.title){var r=document.createElement("p");r.textContent=this.options.title,r.style.margin="0 0 8px 0",r.style.fontSize="12px",r.style.color="var(--color-font-2)",this.popoverElement.appendChild(r)}if(this.options.content){var o=document.createElement("p");o.style.margin="0",o.textContent=this.options.content,this.popoverElement.appendChild(o)}document.body.appendChild(this.popoverElement);var i=this.options.styles,s=void 0===i?null:i;if(s)for(var a in s)this.popoverElement.style.setProperty(a,s[a]);this.popoverElement.style.lineHeight="1.5",this.popoverElement.style.zIndex="20231026",this.popoverElement.style.overflow="auto",this.popoverElement.style.padding="10px",this.popoverElement.style.borderRadius="var(--radius)",this.popoverElement.style.backdropFilter="var(--dropdown-bdf)",this.popoverElement.style.background="var(--dropdown-bg)",this.popoverElement.style.border="var(--dropdown-border)",this.popoverElement.style.boxShadow="var(--dropdown-boxShadow)",this.fadeIn(this.popoverElement,150)}},{key:"removePopover",value:function(){var t=this;if(this.popoverElement){var e=this.popoverElement;this.fadeOut(e,150,(function(){e.remove(),t.popoverElement===e&&(t.popoverElement=null)}))}}},{key:"handleDocumentClick",value:function(t){t.target&&this.popoverElement&&this.popoverElement.contains(t.target)||this.removePopover()}}]),t}();xe.activePopover=null;const ke=(t,n)=>n.map((n=>Object.assign(Object.assign({},n),{start:e()(`${t}-${n.start}`).toString(),end:e()(`${t}-${n.end}`).toString()})));var Ee;Ee=()=>{const{roadmapYears:t=null,initYear:n}=window,o=document.querySelector("#tody-button");if(n===e()().year().toString()&&o&&(o.style.display="inherit"),t){const p=Object.keys(t).map((t=>({value:String(Number(t)),label:Number(t)})));new we("#year-dropdown",p,{onClickItem:n=>{const{value:r}=n;document.querySelector("#year-dropdown span").textContent=r,o.style.display=r===e()().year().toString()?"inherit":"none";const i=ke(r,t[r]);y.updateTasks(i,Number(r))}});const f=ke(n,t[n]),y=new r("#gantt-container",f);null==o||o.addEventListener("click",(()=>y.centerOnCurrentDay())),s=(i={key:"d",preventDefault:!0,handler:()=>y.centerOnCurrentDay()}).key,a=i.handler,l=i.preventDefault,c=void 0!==l&&l,d=s.toLowerCase().split("+").map((function(t){return t.trim()})),h=/Mac|iPod|iPhone|iPad/.test(navigator.platform),u=function(t){var e=d.every((function(e){return"control"===e?h?t.metaKey:t.ctrlKey:t.key.toLowerCase()===e}));e&&(c&&t.preventDefault(),a(t))},document.addEventListener("keydown",u)}var i,s,a,l,c,d,h,u},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",Ee):Ee()})()})();