apexgantt 3.7.0 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apexgantt.es.js +8688 -0
- package/apexgantt.es.min.js +1 -1
- package/apexgantt.min.js +1 -1
- package/demo/accessibility-demo.html +217 -0
- package/demo/baseline.html +154 -0
- package/demo/critical-path.html +225 -0
- package/demo/css-theming.html +445 -0
- package/demo/dependency-types.html +284 -0
- package/demo/events-demo.html +5 -11
- package/demo/gantt-performance.html +287 -0
- package/demo/import-demos.html +280 -0
- package/demo/issue-2.html +177 -0
- package/demo/issue-3.html +249 -0
- package/demo/issue-reset-series.html +195 -0
- package/demo/issue-scale.html +199 -0
- package/demo/mixed-contexts.html +263 -0
- package/demo/responsive-height-test.html +171 -0
- package/demo/row-virtualizer-demo.html +148 -0
- package/lib/gantt.d.ts +31 -40
- package/lib/keyboard/KeyboardNavigationManager.d.ts +41 -0
- package/lib/managers/LayoutManager.d.ts +46 -0
- package/lib/managers/ScrollManager.d.ts +84 -0
- package/lib/managers/StyleManager.d.ts +60 -0
- package/lib/managers/ZoomManager.d.ts +49 -0
- package/lib/models/Annotation.d.ts +1 -1
- package/lib/models/ArrowLink.d.ts +72 -3
- package/lib/models/Bar.d.ts +11 -0
- package/lib/models/BarDragManager.d.ts +0 -1
- package/lib/models/DataManager.d.ts +8 -6
- package/lib/models/DataParser.d.ts +7 -2
- package/lib/models/DateUtils.d.ts +24 -0
- package/lib/models/Options.d.ts +36 -3
- package/lib/models/RowVirtualizer.d.ts +85 -0
- package/lib/models/TaskUtils.d.ts +31 -0
- package/lib/models/Tasks.d.ts +45 -4
- package/lib/models/TimeLine.d.ts +10 -1
- package/lib/models/VirtualScrollCoordinator.d.ts +167 -0
- package/lib/styles/Gantt.style.d.ts +1 -1
- package/lib/styles/Timeline.style.d.ts +1 -1
- package/lib/types/events.d.ts +1 -0
- package/lib/util/animation.util.d.ts +61 -0
- package/lib/util/arrow.util.d.ts +2 -1
- package/lib/util/critical-path.util.d.ts +21 -0
- package/lib/util/cssVars.d.ts +34 -0
- package/lib/util/ganttExport.d.ts +1 -1
- package/lib/util/logger.d.ts +4 -0
- package/lib/util/selectors.d.ts +32 -0
- package/package.json +2 -3
package/apexgantt.es.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
class t{constructor(t,e){this.injectedStyles=new Set,this.chartContainer=null,this.instanceId=e||Math.random().toString(36).substr(2,9),this.context=this.detectContext(t),this.chartContainer=t}getChartContainer(){return this.chartContainer}getChartScopedContainer(){return this.context===document?document.body||document.getElementsByTagName("body")[0]:this.chartContainer||this.context}detectContext(t){const e=t.getRootNode();return e instanceof ShadowRoot?e:document}getContext(){return this.context}getInstanceId(){return this.instanceId}isShadowDOM(){return this.context instanceof ShadowRoot}createElement(t){return document.createElement(t)}createElementNS(t,e){return document.createElementNS(t,e)}createTextNode(t){return document.createTextNode(t)}getElementById(t){return this.context===document?document.getElementById(t):this.context.querySelector(`#${t}`)}getElementsByClassName(t){if(this.context===document)return document.getElementsByClassName(t);const e=this.context.querySelectorAll(`.${t}`),n=Array.from(e);return{item:t=>n[t]||null,get length(){return n.length},[Symbol.iterator]:()=>n[Symbol.iterator](),...Object.fromEntries(n.map(((t,e)=>[e,t])))}}querySelector(t){return this.context.querySelector(t)}querySelectorAll(t){return this.context.querySelectorAll(t)}getAppendContainer(){return this.context===document?document.body||document.getElementsByTagName("body")[0]:this.context}getChartBounds(){var t;return(null==(t=this.chartContainer)?void 0:t.getBoundingClientRect())||new DOMRect}getBody(){if(this.context===document)return document.body||document.getElementsByTagName("body")[0];return this.context.host}dispatchEvent(t){this.context===document?document.dispatchEvent(t):this.context.dispatchEvent(t)}addEventListener(t,e,n){this.context===document||"mousemove"===t||"mouseup"===t||"keydown"===t?document.addEventListener(t,e,n):this.context.addEventListener(t,e,n)}removeEventListener(t,e,n){this.context===document||"mousemove"===t||"mouseup"===t||"keydown"===t?document.removeEventListener(t,e,n):this.context.removeEventListener(t,e,n)}injectStyles(t,e,n={}){const{force:r=!1,priority:i="normal"}=n;if(!r&&this.injectedStyles.has(e))return;if(r){const t=this.context.querySelector(`#${e}`);t&&(t.remove(),this.injectedStyles.delete(e))}if(this.context.querySelector(`#${e}`)&&!r)return void this.injectedStyles.add(e);const o=document.createElement("style");if(o.id=e,o.textContent=t,"normal"!==i&&o.setAttribute("data-priority",i),this.context===document)document.head.appendChild(o);else{const t=this.context;"high"===i?t.insertBefore(o,t.firstChild):t.appendChild(o)}this.injectedStyles.add(e)}injectStylesheets(t){t.forEach((({content:t,id:e,options:n})=>{this.injectStyles(t,e,n)}))}hasInjectedStyles(t){return this.injectedStyles.has(t)}removeStyles(t){const e=this.context.querySelector(`#${t}`);e&&(e.remove(),this.injectedStyles.delete(t))}removeAllStyles(){this.injectedStyles.forEach((t=>{const e=this.context.querySelector(`#${t}`);e&&e.remove()})),this.injectedStyles.clear()}getInjectedStyleIds(){return Array.from(this.injectedStyles)}getActiveElement(){if(this.context===document)return document.activeElement;return this.context.activeElement||document.activeElement}destroy(){this.removeAllStyles(),this.injectedStyles.clear()}}class e{constructor(e,n){if(!e)throw new Error("Container element is required");this.element=e,this.chartContext=new t(e,n)}getContext(){return this.chartContext}isShadowDOM(){return this.chartContext.isShadowDOM()}getTooltipContainer(){return this.chartContext.getAppendContainer()}injectStyles(t,e){this.chartContext.injectStyles(t,e)}createElement(t){return this.chartContext.createElement(t)}querySelector(t){return this.chartContext.querySelector(t)}addEventListener(t,e,n){this.chartContext.addEventListener(t,e,n)}removeEventListener(t,e,n){this.chartContext.removeEventListener(t,e,n)}dispatchEvent(t){this.chartContext.dispatchEvent(t)}destroy(){this.chartContext.destroy()}getInstanceId(){return this.chartContext.getInstanceId()}}const n=class{static decodeLicenseData(t){try{const e=window.atob(t),n=JSON.parse(e);return n.issueDate&&n.expiryDate&&n.plan?{expiryDate:n.expiryDate,issueDate:n.issueDate,plan:n.plan,valid:!0}:null}catch{return null}}static generateLicenseKey(t,e,n="standard"){const r={expiryDate:e,issueDate:t,plan:n};return`APEX-${window.btoa(JSON.stringify(r))}`}static getLicenseStatus(){return this.licenseKey?(this.validationResult||(this.validationResult=this.validateLicense(this.licenseKey)),this.validationResult):{expired:!1,valid:!1}}static isLicenseValid(){return!!this.licenseKey&&(this.validationResult||(this.validationResult=this.validateLicense(this.licenseKey)),this.validationResult.valid)}static setLicense(t){this.licenseKey=t,this.validationResult=this.validateLicense(t),this.validationResult.valid}static validateLicense(t){try{if(!t.startsWith("APEX-"))return{expired:!1,message:'Invalid license key format. License key must start with "APEX-".',valid:!1};const e=t.split("-");if(2!==e.length)return{expired:!1,message:"Invalid license key format. Expected format: APEX-{encoded-data}.",valid:!1};const n=e[1],r=this.decodeLicenseData(n);if(!r)return{expired:!1,message:"Invalid license key. Unable to decode license data.",valid:!1};const i=new Date;return new Date(r.expiryDate)<i?{data:r,expired:!0,message:`License expired on ${r.expiryDate}. Please renew your license.`,valid:!1}:{data:r,expired:!1,valid:!0}}catch{return{expired:!1,message:"Invalid license key format or corrupted data.",valid:!1}}}};n.licenseKey=null,n.validationResult=null;let r=n;const i={},o=[];function s(t,e){if(Array.isArray(t))for(const n of t)s(n,e);else if("object"!=typeof t)l(Object.getOwnPropertyNames(e)),i[t]=Object.assign(i[t]||{},e);else for(const e in t)s(e,t[e])}function a(t){return i[t]||{}}function l(t){o.push(...t)}function u(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)i.push(e(t[n]));return i}function c(t){return t%360*Math.PI/180}function h(t){return t.charAt(0).toUpperCase()+t.slice(1)}function d(t,e,n,r){return null!=e&&null!=n||(r=r||t.bbox(),null==e?e=r.width/r.height*n:null==n&&(n=r.height/r.width*e)),{width:e,height:n}}function f(t,e){const n=t.origin;let r=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=n&&([r,i]=Array.isArray(n)?n:"object"==typeof n?[n.x,n.y]:[n,n]);const o="string"==typeof r,s="string"==typeof i;if(o||s){const{height:t,width:n,x:a,y:l}=e.bbox();o&&(r=r.includes("left")?a:r.includes("right")?a+n:a+n/2),s&&(i=i.includes("top")?l:i.includes("bottom")?l+t:l+t/2)}return[r,i]}const p=new Set(["desc","metadata","title"]),m=t=>p.has(t.nodeName),g=(t,e,n={})=>{const r={...e};for(const t in r)r[t].valueOf()===n[t]&&delete r[t];Object.keys(r).length?t.node.setAttribute("data-svgjs",JSON.stringify(r)):(t.node.removeAttribute("data-svgjs"),t.node.removeAttribute("svgjs:data"))},y="http://www.w3.org/2000/svg",v="http://www.w3.org/2000/xmlns/",b="http://www.w3.org/1999/xlink",w={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};class x{}const _={},k="___SYMBOL___ROOT___";function C(t,e=y){return w.document.createElementNS(e,t)}function S(t,e=!1){if(t instanceof x)return t;if("object"==typeof t)return M(t);if(null==t)return new _[k];if("string"==typeof t&&"<"!==t.charAt(0))return M(w.document.querySelector(t));const n=e?w.document.createElement("div"):C("svg");return n.innerHTML=t,t=M(n.firstChild),n.removeChild(n.firstChild),t}function E(t,e){return e&&(e instanceof w.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:C(t)}function T(t){if(!t)return null;if(t.instance instanceof x)return t.instance;if("#document-fragment"===t.nodeName)return new _.Fragment(t);let e=h(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":_[e]||(e="Dom"),new _[e](t)}let M=T;function A(t,e=t.name,n=!1){return _[e]=t,n&&(_[k]=t),l(Object.getOwnPropertyNames(t.prototype)),t}let D=1e3;function $(t){return"Svgjs"+h(t)+D++}function z(t){for(let e=t.children.length-1;e>=0;e--)z(t.children[e]);return t.id?(t.id=$(t.nodeName),t):t}function I(t,e){let n,r;for(r=(t=Array.isArray(t)?t:[t]).length-1;r>=0;r--)for(n in e)t[r].prototype[n]=e[n]}function O(t){return function(...e){const n=e[e.length-1];return!n||n.constructor!==Object||n instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(n)}}s("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=S(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=S(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=S(t)).before(this),this},insertAfter:function(t){return(t=S(t)).after(this),this}});const F=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,L=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,B=/rgb\((\d+),(\d+),(\d+)\)/,j=/(#[a-z_][a-z0-9\-_]*)/i,R=/\)\s*,?\s*/,N=/\s/g,H=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,q=/^rgb\(/,P=/^(\s+)?$/,W=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Y=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,U=/[\s,]+/,X=/[MLHVCSQTAZ]/i;function V(t){const e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function G(t,e){for(let n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function K(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}s("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(U)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),s("Dom",{css:function(t,e){const n={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);n[e[0]]=e[1]})),n;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=e;n[e]=this.node.style.getPropertyValue(t)}return n}if("string"==typeof t)return this.node.style.getPropertyValue(t);if("object"==typeof t)for(const e in t)this.node.style.setProperty(e,null==t[e]||P.test(t[e])?"":t[e])}return 2===arguments.length&&this.node.style.setProperty(t,null==e||P.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),s("Dom",{data:function(t,e,n){if(null==t)return this.data(u(function(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)e(t[n])&&i.push(t[n]);return i}(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const n of t)e[n]=this.data(n);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(e){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===n||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),s("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const e in t)this.remember(e,t[e]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class Z{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof Z||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e){const{random:n,round:r,sin:i,PI:o}=Math;if("vibrant"===t){const t=24*n()+57,e=38*n()+45,r=360*n();return new Z(t,e,r,"lch")}if("sine"===t){const t=r(80*i(2*o*(e=null==e?n():e)/.5+.01)+150),s=r(50*i(2*o*e/.5+4.6)+200),a=r(100*i(2*o*e/.5+2.3)+150);return new Z(t,s,a)}if("pastel"===t){const t=8*n()+86,e=17*n()+9,r=360*n();return new Z(t,e,r,"lch")}if("dark"===t){const t=10+10*n(),e=50*n()+86,r=360*n();return new Z(t,e,r,"lch")}if("rgb"===t){const t=255*n(),e=255*n(),r=255*n();return new Z(t,e,r)}if("lab"===t){const t=100*n(),e=256*n()-128,r=256*n()-128;return new Z(t,e,r,"lab")}if("grey"===t){const t=255*n();return new Z(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(H.test(t)||q.test(t))}cmyk(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,o]=[t,e,n].map((t=>t/255)),s=Math.min(1-r,1-i,1-o);if(1===s)return new Z(0,0,0,1,"cmyk");return new Z((1-r-s)/(1-s),(1-i-s)/(1-s),(1-o-s)/(1-s),s,"cmyk")}hsl(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,o]=[t,e,n].map((t=>t/255)),s=Math.max(r,i,o),a=Math.min(r,i,o),l=(s+a)/2,u=s===a,c=s-a;return new Z(360*(u?0:s===r?((i-o)/c+(i<o?6:0))/6:s===i?((o-r)/c+2)/6:s===o?((r-i)/c+4)/6:0),100*(u?0:l>.5?c/(2-s-a):c/(s+a)),100*l,"hsl")}init(t=0,e=0,n=0,r=0,i="rgb"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if("number"==typeof t)i="string"==typeof r?r:i,r="string"==typeof r?0:r,Object.assign(this,{_a:t,_b:e,_c:n,_d:r,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const n=function(t,e){const n=G(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:G(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:G(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:G(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:G(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:G(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return n.space=e||n.space,n}(t,e);Object.assign(this,n)}else if("string"==typeof t)if(q.test(t)){const e=t.replace(N,""),[n,r,i]=B.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}else{if(!H.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,r,i]=L.exec((o=t,4===o.length?["#",o.substring(1,2),o.substring(1,2),o.substring(2,3),o.substring(2,3),o.substring(3,4),o.substring(3,4)].join(""):o)).map(e);Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}}var o;const{_a:s,_b:a,_c:l,_d:u}=this,c="rgb"===this.space?{r:s,g:a,b:l}:"xyz"===this.space?{x:s,y:a,z:l}:"hsl"===this.space?{h:s,s:a,l:l}:"lab"===this.space?{l:s,a:a,b:l}:"lch"===this.space?{l:s,c:a,h:l}:"cmyk"===this.space?{c:s,m:a,y:l,k:u}:{};Object.assign(this,c)}lab(){const{x:t,y:e,z:n}=this.xyz();return new Z(116*e-16,500*(t-e),200*(e-n),"lab")}lch(){const{l:t,a:e,b:n}=this.lab(),r=Math.sqrt(e**2+n**2);let i=180*Math.atan2(n,e)/Math.PI;i<0&&(i*=-1,i=360-i);return new Z(t,r,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:n}=this;if("lab"===this.space||"lch"===this.space){let{l:r,a:i,b:o}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;i=t*Math.cos(n*e),o=t*Math.sin(n*e)}const s=(r+16)/116,a=i/500+s,l=s-o/200,u=16/116,c=.008856,h=7.787;t=.95047*(a**3>c?a**3:(a-u)/h),e=1*(s**3>c?s**3:(s-u)/h),n=1.08883*(l**3>c?l**3:(l-u)/h)}const r=3.2406*t+-1.5372*e+-.4986*n,i=-.9689*t+1.8758*e+.0415*n,o=.0557*t+-.204*e+1.057*n,s=Math.pow,a=.0031308,l=r>a?1.055*s(r,1/2.4)-.055:12.92*r,u=i>a?1.055*s(i,1/2.4)-.055:12.92*i,c=o>a?1.055*s(o,1/2.4)-.055:12.92*o;return new Z(255*l,255*u,255*c)}if("hsl"===this.space){let{h:t,s:e,l:n}=this;if(t/=360,e/=100,n/=100,0===e){n*=255;return new Z(n,n,n)}const r=n<.5?n*(1+e):n+e-n*e,i=2*n-r,o=255*K(i,r,t+1/3),s=255*K(i,r,t),a=255*K(i,r,t-1/3);return new Z(o,s,a)}if("cmyk"===this.space){const{c:t,m:e,y:n,k:r}=this,i=255*(1-Math.min(1,t*(1-r)+r)),o=255*(1-Math.min(1,e*(1-r)+r)),s=255*(1-Math.min(1,n*(1-r)+r));return new Z(i,o,s)}return this;var t}toArray(){const{_a:t,_b:e,_c:n,_d:r,space:i}=this;return[t,e,n,r,i]}toHex(){const[t,e,n]=this._clamped().map(V);return`#${t}${e}${n}`}toRgb(){const[t,e,n]=this._clamped();return`rgb(${t},${e},${n})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,o]=[t,e,n].map((t=>t/255)),s=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,l=o>.04045?Math.pow((o+.055)/1.055,2.4):o/12.92,u=(.4124*s+.3576*a+.1805*l)/.95047,c=(.2126*s+.7152*a+.0722*l)/1,h=(.0193*s+.1192*a+.9505*l)/1.08883,d=u>.008856?Math.pow(u,1/3):7.787*u+16/116,f=c>.008856?Math.pow(c,1/3):7.787*c+16/116,p=h>.008856?Math.pow(h,1/3):7.787*h+16/116;return new Z(d,f,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:r,min:i,round:o}=Math;return[t,e,n].map((t=>r(0,i(o(t),255))))}}class J{constructor(...t){this.init(...t)}clone(){return new J(this)}init(t,e){const n=0,r=0,i=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==i.x?n:i.x,this.y=null==i.y?r:i.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){tt.isMatrixLike(t)||(t=new tt(t));const{x:e,y:n}=this;return this.x=t.a*e+t.c*n+t.e,this.y=t.b*e+t.d*n+t.f,this}}function Q(t,e,n){return Math.abs(e-t)<1e-6}class tt{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,n=t.flip&&(e||"x"===t.flip)?-1:1,r=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,o=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,s=t.scale&&t.scale.length?t.scale[0]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleX)?t.scaleX*n:n,a=t.scale&&t.scale.length?t.scale[1]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleY)?t.scaleY*r:r,l=t.shear||0,u=t.rotate||t.theta||0,c=new J(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),h=c.x,d=c.y,f=new J(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=f.x,m=f.y,g=new J(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,v=g.y,b=new J(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:s,scaleY:a,skewX:i,skewY:o,shear:l,theta:u,rx:b.x,ry:b.y,tx:y,ty:v,ox:h,oy:d,px:p,py:m}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,n){const r=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,o=t.a*e.c+t.c*e.d,s=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,l=t.f+t.b*e.e+t.d*e.f;return n.a=r,n.b=i,n.c=o,n.d=s,n.e=a,n.f=l,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const r=t||0,i=e||0;return this.translateO(-r,-i).lmultiplyO(n).translateO(r,i)}clone(){return new tt(this)}decompose(t=0,e=0){const n=this.a,r=this.b,i=this.c,o=this.d,s=this.e,a=this.f,l=n*o-r*i,u=l>0?1:-1,c=u*Math.sqrt(n*n+r*r),h=Math.atan2(u*r,u*n),d=180/Math.PI*h,f=Math.cos(h),p=Math.sin(h),m=(n*i+r*o)/l,g=i*c/(m*n-r)||o*c/(m*r+n);return{scaleX:c,scaleY:g,shear:m,rotate:d,translateX:s-t+t*f*c+e*(m*f*c-p*g),translateY:a-e+t*p*c+e*(m*p*c+f*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new tt(t);return Q(this.a,e.a)&&Q(this.b,e.b)&&Q(this.c,e.c)&&Q(this.d,e.d)&&Q(this.e,e.e)&&Q(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=tt.fromArray([1,0,0,1,0,0]);return t=t instanceof St?t.matrixify():"string"==typeof t?tt.fromArray(t.split(U).map(parseFloat)):Array.isArray(t)?tt.fromArray(t):"object"==typeof t&&tt.isMatrixLike(t)?t:"object"==typeof t?(new tt).transform(t):6===arguments.length?tt.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,n=this.c,r=this.d,i=this.e,o=this.f,s=t*r-e*n;if(!s)throw new Error("Cannot invert "+this);const a=r/s,l=-e/s,u=-n/s,c=t/s,h=-(a*i+u*o),d=-(l*i+c*o);return this.a=a,this.b=l,this.c=u,this.d=c,this.e=h,this.f=d,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof tt?t:new tt(t);return tt.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof tt?t:new tt(t);return tt.matrixMultiply(this,e,this)}rotate(t,e,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=c(t);const r=Math.cos(t),i=Math.sin(t),{a:o,b:s,c:a,d:l,e:u,f:h}=this;return this.a=o*r-s*i,this.b=s*r+o*i,this.c=a*r-l*i,this.d=l*r+a*i,this.e=u*r-h*i+n*i-e*r+e,this.f=h*r+u*i-e*i-n*r+n,this}scale(){return this.clone().scaleO(...arguments)}scaleO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t);const{a:i,b:o,c:s,d:a,e:l,f:u}=this;return this.a=i*t,this.b=o*e,this.c=s*t,this.d=a*e,this.e=l*t-n*t+n,this.f=u*e-r*e+r,this}shear(t,e,n){return this.clone().shearO(t,e,n)}shearO(t,e=0,n=0){const{a:r,b:i,c:o,d:s,e:a,f:l}=this;return this.a=r+i*t,this.c=o+s*t,this.e=a+l*t-n*t,this}skew(){return this.clone().skewO(...arguments)}skewO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t),t=c(t),e=c(e);const i=Math.tan(t),o=Math.tan(e),{a:s,b:a,c:l,d:u,e:h,f:d}=this;return this.a=s+a*i,this.b=a+s*o,this.c=l+u*i,this.d=u+l*o,this.e=h+d*i-r*i,this.f=d+h*o-n*o,this}skewX(t,e,n){return this.skew(t,0,e,n)}skewY(t,e,n){return this.skew(0,t,e,n)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(tt.isMatrixLike(t)){return new tt(t).multiplyO(this)}const e=tt.formatTransforms(t),{x:n,y:r}=new J(e.ox,e.oy).transform(this),i=(new tt).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-n,-r).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(n,r);if(isFinite(e.px)||isFinite(e.py)){const t=new J(n,r).transform(i),o=isFinite(e.px)?e.px-t.x:0,s=isFinite(e.py)?e.py-t.y:0;i.translateO(o,s)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function et(){if(!et.nodes){const t=S().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;et.nodes={svg:t,path:e}}if(!et.nodes.svg.node.parentNode){const t=w.document.body||w.document.documentElement;et.nodes.svg.addTo(t)}return et.nodes}function nt(t){return!(t.width||t.height||t.x||t.y)}A(tt,"Matrix");class rt{constructor(...t){this.init(...t)}addOffset(){return this.x+=w.window.pageXOffset,this.y+=w.window.pageYOffset,new rt(this)}init(t){return t="string"==typeof t?t.split(U).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return nt(this)}merge(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),r=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-n;return new rt(e,n,r,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof tt||(t=new tt(t));let e=1/0,n=-1/0,r=1/0,i=-1/0;return[new J(this.x,this.y),new J(this.x2,this.y),new J(this.x,this.y2),new J(this.x2,this.y2)].forEach((function(o){o=o.transform(t),e=Math.min(e,o.x),n=Math.max(n,o.x),r=Math.min(r,o.y),i=Math.max(i,o.y)})),new rt(e,r,n-e,i-r)}}function it(t,e,n){let r;try{if(r=e(t.node),nt(r)&&((i=t.node)!==w.document&&!(w.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===w.document}).call(w.document.documentElement,i)))throw new Error("Element not in the dom")}catch(e){r=n(t)}var i;return r}s({viewbox:{viewbox(t,e,n,r){return null==t?new rt(this.attr("viewBox")):this.attr("viewBox",new rt(t,e,n,r))},zoom(t,e){let{width:n,height:r}=this.attr(["width","height"]);if((n||r)&&"string"!=typeof n&&"string"!=typeof r||(n=this.node.clientWidth,r=this.node.clientHeight),!n||!r)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),o=n/i.width,s=r/i.height,a=Math.min(o,s);if(null==t)return a;let l=a/t;l===1/0&&(l=Number.MAX_SAFE_INTEGER/100),e=e||new J(n/2/o+i.x,r/2/s+i.y);const u=new rt(i).transform(new tt({scale:l,origin:e}));return this.viewbox(u)}}}),A(rt,"Box");class ot extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}I([ot],{each(t,...e){return"function"==typeof t?this.map(((e,n,r)=>t.call(e,e,n,r))):this.map((n=>n[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const st=["toArray","constructor","each"];function at(t,e){return new ot(u((e||w.document).querySelectorAll(t),(function(t){return T(t)})))}ot.extend=function(t){t=t.reduce(((t,e)=>(st.includes(e)||"_"===e[0]||(e in Array.prototype&&(t["$"+e]=Array.prototype[e]),t[e]=function(...t){return this.each(e,...t)}),t)),{}),I([ot],t)};let lt=0;const ut={};function ct(t){let e=t.getEventHolder();return e===w.window&&(e=ut),e.events||(e.events={}),e.events}function ht(t){return t.getEventTarget()}function dt(t,e,n,r,i){const o=n.bind(r||t),s=S(t),a=ct(s),l=ht(s);e=Array.isArray(e)?e:e.split(U),n._svgjsListenerId||(n._svgjsListenerId=++lt),e.forEach((function(t){const e=t.split(".")[0],r=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][r]=a[e][r]||{},a[e][r][n._svgjsListenerId]=o,l.addEventListener(e,o,i||!1)}))}function ft(t,e,n,r){const i=S(t),o=ct(i),s=ht(i);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(U)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let l,u;if(n)o[e]&&o[e][a||"*"]&&(s.removeEventListener(e,o[e][a||"*"][n],r||!1),delete o[e][a||"*"][n]);else if(e&&a){if(o[e]&&o[e][a]){for(u in o[e][a])ft(s,[e,a].join("."),u);delete o[e][a]}}else if(a)for(t in o)for(l in o[t])a===l&&ft(s,[t,a].join("."));else if(e){if(o[e]){for(l in o[e])ft(s,[e,l].join("."));delete o[e]}}else{for(t in o)ft(s,t);!function(t){let e=t.getEventHolder();e===w.window&&(e=ut),e.events&&(e.events={})}(i)}}))}class pt extends x{addEventListener(){}dispatch(t,e,n){return function(t,e,n,r){const i=ht(t);return e instanceof w.window.Event||(e=new w.window.CustomEvent(e,{detail:n,cancelable:!0,...r})),i.dispatchEvent(e),e}(this,t,e,n)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const n=e[t.type];for(const e in n)for(const r in n[e])n[e][r](t);return!t.defaultPrevented}fire(t,e,n){return this.dispatch(t,e,n),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,n){return ft(this,t,e,n),this}on(t,e,n,r){return dt(this,t,e,n,r),this}removeEventListener(){}}function mt(){}A(pt,"EventTarget");const gt=400,yt=">",vt=0,bt={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};class wt extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(U).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class xt{constructor(...t){this.init(...t)}convert(t){return new xt(this.value,t)}divide(t){return t=new xt(t),new xt(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(F))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof xt&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new xt(t),new xt(this-t,this.unit||t.unit)}plus(t){return t=new xt(t),new xt(this+t,this.unit||t.unit)}times(t){return t=new xt(t),new xt(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const _t=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),kt=[];class Ct extends pt{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=S(t)).removeNamespace&&this.node instanceof w.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return S(t).put(this,e)}children(){return new ot(u(this.node.children,(function(t){return T(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,e=!0){this.writeDataToDom();let n=this.node.cloneNode(t);return e&&(n=z(n)),new this.constructor(n)}each(t,e){const n=this.children();let r,i;for(r=0,i=n.length;r<i;r++)t.apply(n[r],[r,n]),e&&n[r].each(t,e);return this}element(t,e){return this.put(new Ct(C(t),e))}first(){return T(this.node.firstChild)}get(t){return T(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=0}html(t,e){return this.xml(t,e,"http://www.w3.org/1999/xhtml")}id(t){return void 0!==t||this.node.id||(this.node.id=$(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return T(this.node.lastChild)}matches(t){const e=this.node,n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=T(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=T(e.node.parentNode));return e}put(t,e){return t=S(t),this.add(t,e),t}putIn(t,e){return S(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=S(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const n=10**t,r=this.attr(e);for(const t in r)"number"==typeof r[t]&&(r[t]=Math.round(r[t]*n)/n);return this.attr(r),this}svg(t,e){return this.xml(t,e,y)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const n=e.index(this);return e.put(t,n).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let n=this;if(null!=t){if(n=T(n.node.cloneNode(!0)),e){const e=t(n);if(n=e||n,!1===e)return""}n.each((function(){const e=t(this),n=e||this;!1===e?this.remove():e&&this!==n&&this.replace(n)}),!0)}return e?n.node.outerHTML:n.node.innerHTML}e=null!=e&&e;const r=C("wrapper",n),i=w.document.createDocumentFragment();r.innerHTML=t;for(let t=r.children.length;t--;)i.appendChild(r.firstElementChild);const o=this.parent();return e?this.replace(i)&&o:this.add(i)}}I(Ct,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=W.test(n.nodeValue)?parseFloat(n.nodeValue):n.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?bt[t]:W.test(e)?parseFloat(e):e;"number"==typeof(e=kt.reduce(((e,n)=>n(t,e,this)),e))?e=new xt(e):_t.has(t)&&Z.isColor(e)?e=new Z(e):e.constructor===Array&&(e=new wt(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof n?this.node.setAttributeNS(n,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return at(t,this.node)},findOne:function(t){return T(this.node.querySelector(t))}}),A(Ct,"Dom");class St extends Ct{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,(t.hasAttribute("data-svgjs")||t.hasAttribute("svgjs:data"))&&this.setData(JSON.parse(t.getAttribute("data-svgjs"))??JSON.parse(t.getAttribute("svgjs:data"))??{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new xt(t).plus(this.x()))}dy(t=0){return this.y(new xt(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){const e="string"==typeof t;e||(t=S(t));const n=new ot;let r=this;for(;(r=r.parent())&&r.node!==w.document&&"#document-fragment"!==r.nodeName&&(n.push(r),e||r.node!==t.node)&&(!e||!r.matches(t));)if(r.node===this.root().node)return null;return n}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(j);return e?S(e[1]):null}root(){const t=this.parent(_[k]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=d(this,t,e);return this.width(new xt(n.width)).height(new xt(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return g(this,this.dom),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}I(St,{bbox:function(){const t=it(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(et().svg).show(),n=e.node.getBBox();return e.remove(),n}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new rt(t)},rbox:function(t){const e=it(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new rt(e);return t?n.transform(t.screenCTM().inverseO()):n.addOffset()},inside:function(t,e){const n=this.bbox();return t>n.x&&e>n.y&&t<n.x+n.width&&e<n.y+n.height},point:function(t,e){return new J(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new tt(this.node.getCTM())},screenCTM:function(){try{if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new tt(e)}return new tt(this.node.getScreenCTM())}catch(t){return new tt}}}),A(St,"Element");const Et={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let n;e[t]=function(e){if(void 0===e)return this.attr(t);if("string"==typeof e||e instanceof Z||Z.isRgb(e)||e instanceof St)this.attr(t,e);else for(n=Et[t].length-1;n>=0;n--)null!=e[Et[t][n]]&&this.attr(Et.prefix(t,Et[t][n]),e[Et[t][n]]);return this},s(["Element","Runner"],e)})),s(["Element","Runner"],{matrix:function(t,e,n,r,i,o){return null==t?new tt(this):this.attr("transform",new tt(t,e,n,r,i,o))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:r},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:r},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),s("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new xt(t)):this.rx(t).ry(e)}}),s("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new J(this.node.getPointAtLength(t))}}),s(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}});s("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel","contextmenu","wheel","pointerdown","pointermove","pointerup","pointerleave","pointercancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),s("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(R).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(U).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(tt.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new tt)},toParent:function(t,e){if(this===t)return this;if(m(this.node))return this.addTo(t,e);const n=this.screenCTM(),r=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(r.multiply(n)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new tt(this).decompose();return null==t?e:e[t]}tt.isMatrixLike(t)||(t={...t,origin:f(t,this)});const n=new tt(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});class Tt extends St{flatten(){return this.each((function(){if(this instanceof Tt)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(n,r){return r[r.length-n-1].toParent(t,e)})),this.remove()}}A(Tt,"Container");class Mt extends Tt{constructor(t,e=t){super(E("defs",t),e)}flatten(){return this}ungroup(){return this}}A(Mt,"Defs");class At extends St{}function Dt(t){return this.attr("rx",t)}function $t(t){return this.attr("ry",t)}function zt(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function It(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Ot(t){return this.attr("cx",t)}function Ft(t){return this.attr("cy",t)}function Lt(t){return null==t?2*this.rx():this.rx(new xt(t).divide(2))}function Bt(t){return null==t?2*this.ry():this.ry(new xt(t).divide(2))}A(At,"Shape");const jt=Object.freeze(Object.defineProperty({__proto__:null,cx:Ot,cy:Ft,height:Bt,rx:Dt,ry:$t,width:Lt,x:zt,y:It},Symbol.toStringTag,{value:"Module"}));class Rt extends At{constructor(t,e=t){super(E("ellipse",t),e)}size(t,e){const n=d(this,t,e);return this.rx(new xt(n.width).divide(2)).ry(new xt(n.height).divide(2))}}I(Rt,jt),s("Container",{ellipse:O((function(t=0,e=t){return this.put(new Rt).size(t,e).move(0,0)}))}),A(Rt,"Ellipse");class Nt extends Ct{constructor(t=w.document.createDocumentFragment()){super(t)}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){const t=new Ct(C("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}}function Ht(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new xt(t),fy:new xt(e)}):this.attr({x1:new xt(t),y1:new xt(e)})}function qt(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new xt(t),cy:new xt(e)}):this.attr({x2:new xt(t),y2:new xt(e)})}A(Nt,"Fragment");const Pt=Object.freeze(Object.defineProperty({__proto__:null,from:Ht,to:qt},Symbol.toStringTag,{value:"Module"}));class Wt extends Tt{constructor(t,e){super(E(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,n){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,n)}bbox(){return new rt}targets(){return at("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}I(Wt,Pt),s({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:O((function(t,e){return this.put(new Wt(t)).update(e)}))}}),A(Wt,"Gradient");class Yt extends Tt{constructor(t,e=t){super(E("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new rt}targets(){return at("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}s({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:O((function(t,e,n){return this.put(new Yt).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),A(Yt,"Pattern");class Ut extends At{constructor(t,e=t){super(E("image",t),e)}load(t,e){if(!t)return this;const n=new w.window.Image;return dt(n,"load",(function(t){const r=this.parent(Yt);0===this.width()&&0===this.height()&&this.size(n.width,n.height),r instanceof Yt&&0===r.width()&&0===r.height()&&r.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),dt(n,"load error",(function(){ft(n)})),this.attr("href",n.src=t,b)}}var Xt;Xt=function(t,e,n){return"fill"!==t&&"stroke"!==t||Y.test(e)&&(e=n.root().defs().image(e)),e instanceof Ut&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},kt.push(Xt),s({Container:{image:O((function(t,e){return this.put(new Ut).size(0,0).load(t,e)}))}}),A(Ut,"Image");class Vt extends wt{bbox(){let t=-1/0,e=-1/0,n=1/0,r=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),n=Math.min(i[0],n),r=Math.min(i[1],r)})),new rt(n,r,t-n,e-r)}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let n=this.length-1;n>=0;n--)this[n]=[this[n][0]+t,this[n][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(U).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,r=t.length;n<r;n+=2)e.push([t[n],t[n+1]]);return e}size(t,e){let n;const r=this.bbox();for(n=this.length-1;n>=0;n--)r.width&&(this[n][0]=(this[n][0]-r.x)*t/r.width+r.x),r.height&&(this[n][1]=(this[n][1]-r.y)*e/r.height+r.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,n=this.length;e<n;e++)t.push(this[e].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){tt.isMatrixLike(t)||(t=new tt(t));for(let e=this.length;e--;){const[n,r]=this[e];this[e][0]=t.a*n+t.c*r+t.e,this[e][1]=t.b*n+t.d*r+t.f}return this}}const Gt=Vt;const Kt=Object.freeze(Object.defineProperty({__proto__:null,MorphArray:Gt,height:function(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)},width:function(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)},x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}},Symbol.toStringTag,{value:"Module"}));class Zt extends At{constructor(t,e=t){super(E("line",t),e)}array(){return new Vt([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,e){return this.attr(this.array().move(t,e).toLine())}plot(t,e,n,r){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:r}:new Vt(t).toLine(),this.attr(t))}size(t,e){const n=d(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}}I(Zt,Kt),s({Container:{line:O((function(...t){return Zt.prototype.plot.apply(this.put(new Zt),null!=t[0]?t:[0,0,0,0])}))}}),A(Zt,"Line");class Jt extends Tt{constructor(t,e=t){super(E("marker",t),e)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,e){return this.attr("refX",t).attr("refY",e)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}}function Qt(t,e){return function(n){return null==n?this[t]:(this[t]=n,e&&e.call(this),this)}}s({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:O((function(t,e,n){return this.put(new Jt).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}))},marker:{marker(t,e,n,r){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof Jt?arguments[1]:this.defs().marker(e,n,r),this.attr(i,t)}}}),A(Jt,"Marker");const te={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,n,r){return function(i){return i<0?t>0?e/t*i:n>0?r/n*i:0:i>1?n<1?(1-r)/(1-n)*i+(r-n)/(1-n):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*r+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(r,i=!1)=>{let o=Math.floor(r*t);const s=r*o%1==0;return"start"!==e&&"both"!==e||++o,i&&s&&--o,r>=0&&o<0&&(o=0),r<=1&&o>n&&(o=n),o/n}}};class ee{done(){return!1}}class ne extends ee{constructor(t=yt){super(),this.ease=te[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}}class re extends ee{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,r){return this.stepper(t,e,n,r)}}function ie(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,r=Math.log(e/100+1e-10),i=-r/Math.sqrt(n*n+r*r),o=3.9/(i*t);this.d=2*i*o,this.k=o*o}I(class extends re{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;n>100&&(n=16),n/=1e3;const i=r.velocity||0,o=-this.d*i-this.k*(t-e),s=t+i*n+o*n*n/2;return r.velocity=i+o*n,r.done=Math.abs(e-s)+Math.abs(i)<.002,r.done?e:s}},{duration:Qt("_duration",ie),overshoot:Qt("_overshoot",ie)});I(class extends re{constructor(t=.1,e=.01,n=0,r=1e3){super(),this.p(t).i(e).d(n).windup(r)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;const i=e-t;let o=(r.integral||0)+i*n;const s=(i-(r.error||0))/n,a=this._windup;return!1!==a&&(o=Math.max(-a,Math.min(o,a))),r.error=i,r.integral=o,r.done=Math.abs(i)<.001,r.done?e:t+(this.P*i+this.I*o+this.D*s)}},{windup:Qt("_windup"),p:Qt("P"),i:Qt("I"),d:Qt("D")});const oe={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},se={M:function(t,e,n){return e.x=n.x=t[0],e.y=n.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,n){return e.x=n.x,e.y=n.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},ae="mlhvqtcsaz".split("");for(let t=0,e=ae.length;t<e;++t)se[ae[t]]=function(t){return function(e,n,r){if("H"===t)e[0]=e[0]+n.x;else if("V"===t)e[0]=e[0]+n.y;else if("A"===t)e[5]=e[5]+n.x,e[6]=e[6]+n.y;else for(let t=0,r=e.length;t<r;++t)e[t]=e[t]+(t%2?n.y:n.x);return se[t](e,n,r)}}(ae[t].toUpperCase());function le(t){return t.segment.length&&t.segment.length-1===oe[t.segment[0].toUpperCase()]}function ue(t,e){t.inNumber&&ce(t,!1);const n=X.test(e);if(n)t.segment=[e];else{const e=t.lastCommand,n=e.toLowerCase(),r=e===n;t.segment=["m"===n?r?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],n}function ce(t,e){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=e,t.number="",t.pointSeen=!1,t.hasExponent=!1,le(t)&&he(t)}function he(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return se[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function de(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),n=t.segment.length;return e&&(4===n||5===n)}function fe(t){return"E"===t.lastToken.toUpperCase()}const pe=new Set([" ",",","\t","\n","\r","\f"]);class me extends wt{bbox(){return et().path.setAttribute("d",this.toString()),new rt(et.nodes.path.getBBox())}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let n,r=this.length-1;r>=0;r--)n=this[r][0],"M"===n||"L"===n||"T"===n?(this[r][1]+=t,this[r][2]+=e):"H"===n?this[r][1]+=t:"V"===n?this[r][1]+=e:"C"===n||"S"===n||"Q"===n?(this[r][1]+=t,this[r][2]+=e,this[r][3]+=t,this[r][4]+=e,"C"===n&&(this[r][5]+=t,this[r][6]+=e)):"A"===n&&(this[r][6]+=t,this[r][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let n=0,r="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new J,p:new J};for(;i.lastToken=r,r=t.charAt(n++);)if(i.inSegment||!ue(i,r))if("."!==r)if(isNaN(parseInt(r)))if(pe.has(r))i.inNumber&&ce(i,!1);else if("-"!==r&&"+"!==r)if("E"!==r.toUpperCase()){if(X.test(r)){if(i.inNumber)ce(i,!1);else{if(!le(i))throw new Error("parser Error");he(i)}--n}}else i.number+=r,i.hasExponent=!0;else{if(i.inNumber&&!fe(i)){ce(i,!1),--n;continue}i.number+=r,i.inNumber=!0}else{if("0"===i.number||de(i)){i.inNumber=!0,i.number=r,ce(i,!0);continue}i.inNumber=!0,i.number+=r}else{if(i.pointSeen||i.hasExponent){ce(i,!1),--n;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=r}return i.inNumber&&ce(i,!1),i.inSegment&&le(i)&&he(i),i.segments}(t)}size(t,e){const n=this.bbox();let r,i;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,r=this.length-1;r>=0;r--)i=this[r][0],"M"===i||"L"===i||"T"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y):"H"===i?this[r][1]=(this[r][1]-n.x)*t/n.width+n.x:"V"===i?this[r][1]=(this[r][1]-n.y)*e/n.height+n.y:"C"===i||"S"===i||"Q"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y,this[r][3]=(this[r][3]-n.x)*t/n.width+n.x,this[r][4]=(this[r][4]-n.y)*e/n.height+n.y,"C"===i&&(this[r][5]=(this[r][5]-n.x)*t/n.width+n.x,this[r][6]=(this[r][6]-n.y)*e/n.height+n.y)):"A"===i&&(this[r][1]=this[r][1]*t/n.width,this[r][2]=this[r][2]*e/n.height,this[r][6]=(this[r][6]-n.x)*t/n.width+n.x,this[r][7]=(this[r][7]-n.y)*e/n.height+n.y);return this}toString(){return function(t){let e="";for(let n=0,r=t.length;n<r;n++)e+=t[n][0],null!=t[n][1]&&(e+=t[n][1],null!=t[n][2]&&(e+=" ",e+=t[n][2],null!=t[n][3]&&(e+=" ",e+=t[n][3],e+=" ",e+=t[n][4],null!=t[n][5]&&(e+=" ",e+=t[n][5],e+=" ",e+=t[n][6],null!=t[n][7]&&(e+=" ",e+=t[n][7])))));return e+" "}(this)}}const ge=t=>{const e=typeof t;return"number"===e?xt:"string"===e?Z.isColor(t)?Z:U.test(t)?X.test(t)?me:wt:F.test(t)?xt:ve:_e.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?wt:"object"===e?xe:ve};class ye{constructor(t){this._stepper=t||new ne("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){return this._morphObj.morph(this._from,this._to,t,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(ge(t));let e=new this._type(t);return this._type===Z&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===xe&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class ve{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class be{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,be.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}be.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const we=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class xe{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,r=e.length;n<r;++n){if(e[n+1]===t[n+1]){if(e[n+1]===Z&&t[n+7]!==e[n+7]){const e=t[n+7],r=new Z(this.values.splice(n+3,5))[e]().toArray();this.values.splice(n+3,0,...r)}n+=e[n+2]+2;continue}if(!t[n+1])return this;const r=(new t[n+1]).toArray(),i=e[n+2]+3;e.splice(n,i,t[n],t[n+1],t[n+2],...r),n+=e[n+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const n in t){const r=ge(t[n]),i=new r(t[n]).toArray();e.push([n,r,i.length,...i])}return e.sort(we),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const n=e.shift(),r=e.shift(),i=e.shift(),o=e.splice(0,i);t[n]=new r(o)}return t}}const _e=[ve,be,xe];class ke extends At{constructor(t,e=t){super(E("path",t),e)}array(){return this._array||(this._array=new me(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new me(t))}size(t,e){const n=d(this,t,e);return this.attr("d",this.array().size(n.width,n.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}ke.prototype.MorphArray=me,s({Container:{path:O((function(t){return this.put(new ke).plot(t||new me)}))}}),A(ke,"Path");const Ce=Object.freeze(Object.defineProperty({__proto__:null,array:function(){return this._array||(this._array=new Vt(this.attr("points")))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new Vt(t))},size:function(t,e){const n=d(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}},Symbol.toStringTag,{value:"Module"}));class Se extends At{constructor(t,e=t){super(E("polygon",t),e)}}s({Container:{polygon:O((function(t){return this.put(new Se).plot(t||new Vt)}))}}),I(Se,Kt),I(Se,Ce),A(Se,"Polygon");class Ee extends At{constructor(t,e=t){super(E("polyline",t),e)}}s({Container:{polyline:O((function(t){return this.put(new Ee).plot(t||new Vt)}))}}),I(Ee,Kt),I(Ee,Ce),A(Ee,"Polyline");class Te extends At{constructor(t,e=t){super(E("rect",t),e)}}I(Te,{rx:Dt,ry:$t}),s({Container:{rect:O((function(t,e){return this.put(new Te).size(t,e)}))}}),A(Te,"Rect");class Me{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const Ae={nextDraw:null,frames:new Me,timeouts:new Me,immediates:new Me,timer:()=>w.window.performance||w.window.Date,transforms:[],frame(t){const e=Ae.frames.push({run:t});return null===Ae.nextDraw&&(Ae.nextDraw=w.window.requestAnimationFrame(Ae._draw)),e},timeout(t,e){e=e||0;const n=Ae.timer().now()+e,r=Ae.timeouts.push({run:t,time:n});return null===Ae.nextDraw&&(Ae.nextDraw=w.window.requestAnimationFrame(Ae._draw)),r},immediate(t){const e=Ae.immediates.push(t);return null===Ae.nextDraw&&(Ae.nextDraw=w.window.requestAnimationFrame(Ae._draw)),e},cancelFrame(t){null!=t&&Ae.frames.remove(t)},clearTimeout(t){null!=t&&Ae.timeouts.remove(t)},cancelImmediate(t){null!=t&&Ae.immediates.remove(t)},_draw(t){let e=null;const n=Ae.timeouts.last();for(;(e=Ae.timeouts.shift())&&(t>=e.time?e.run():Ae.timeouts.push(e),e!==n););let r=null;const i=Ae.frames.last();for(;r!==i&&(r=Ae.frames.shift());)r.run(t);let o=null;for(;o=Ae.immediates.shift();)o();Ae.nextDraw=Ae.timeouts.first()||Ae.frames.first()?w.window.requestAnimationFrame(Ae._draw):null}},De=function(t){const e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},$e=function(){const t=w.window;return(t.performance||t.Date).now()};class ze extends pt{constructor(t=$e){super(),this._timeSource=t,this.terminate()}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const n=Math.abs(e);return this.speed(t?-n:n)}schedule(t,e,n){if(null==t)return this._runners.map(De);let r=0;const i=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)r=i;else if("absolute"===n||"start"===n)r=e,e=0;else if("now"===n)r=this._time;else if("relative"===n){const n=this.getRunnerInfoById(t.id);n&&(r=n.start+e,e=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();r=t?t.start:this._time}}t.unschedule(),t.timeline(this);const o=t.persist(),s={persist:null===o?this._persist:o,start:r+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(s),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return Ae.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=Ae.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let n=e-this._lastSourceTime;t&&(n=0);const r=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=r,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let t=this._runners.length;t--;){const e=this._runners[t],n=e.runner;this._time-e.start<=0&&n.reset()}let i=!1;for(let t=0,e=this._runners.length;t<e;t++){const n=this._runners[t],o=n.runner;let s=r;const a=this._time-n.start;if(a<=0){i=!0;continue}if(a<s&&(s=a),!o.active())continue;if(o.step(s).done){if(!0!==n.persist){o.duration()-o.time()+this._time+n.persist<this._time&&(o.unschedule(),--t,--e)}}else i=!0}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}terminate(){this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}}s({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new ze,this._timeline):(this._timeline=t,this)}}});class Ie extends pt{constructor(t){super(),this.id=Ie.id++,t="function"==typeof(t=null==t?gt:t)?new re(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof re,this._stepper=this._isDeclarative?t:new ne,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new tt,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,n){let r=1,i=!1,o=0;return e=e??vt,n=n||"last","object"!=typeof(t=t??gt)||t instanceof ee||(e=t.delay??e,n=t.when??n,i=t.swing||i,r=t.times??r,o=t.wait??o,t=t.duration??gt),{duration:t,delay:e,swing:i,times:r,wait:o,when:n}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,n){const r=Ie.sanitise(t,e,n),i=new Ie(r.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(r).schedule(r.delay,r.when)}clearTransform(){return this.transforms=new tt,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new ne(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,n){return"object"==typeof t&&(e=t.swing,n=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=n||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),n=(this._time-t*e)/this._duration;return Math.min(t+n,this._times)}const n=t%1,r=e*Math.floor(t)+this._duration*n;return this.time(r)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,n=this._duration,r=this._wait,i=this._times,o=this._swing,s=this._reverse;let a;if(null==t){const t=function(t){const e=o*Math.floor(t%(2*(r+n))/(r+n)),i=e&&!s||!e&&s,a=Math.pow(-1,i)*(t%(r+n))/n+i;return Math.max(Math.min(a,1),0)},l=i*(r+n)-r;return a=e<=0?Math.round(t(1e-5)):e<l?t(e):Math.round(t(l-1e-5)),a}const l=Math.floor(this.loops()),u=o&&l%2==0;return a=l+(u&&!s||s&&u?t:1-t),this.loops(a)}progress(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}queue(t,e,n,r){this._queue.push({initialiser:t||mt,runner:e||mt,retarget:n,isTransform:r,initialised:!1,finished:!1});return this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,e,n){if(t instanceof ze||(n=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,n),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),n=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const r=this.duration(),i=this._lastTime<=0&&this._time>0,o=this._lastTime<r&&this._time>=r;this._lastTime=this._time,i&&this.fire("start",this);const s=this._isDeclarative;this.done=!s&&!o&&this._time>=r,this._reseted=!1;let a=!1;return(n||s)&&(this._initialise(n),this.transforms=new tt,a=this._run(s?t:e),this.fire("step",this)),this.done=this.done||a&&s,o&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,n=this._queue.length;e<n;++e){const n=this._queue[e],r=this._isDeclarative||!n.initialised&&t;t=!n.finished,r&&t&&(n.initialiser.call(this),n.initialised=!0)}}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let e=!0;for(let n=0,r=this._queue.length;n<r;++n){const r=this._queue[n],i=r.runner.call(this,t);r.finished=r.finished||!0===i,e=e&&r.finished}return e}_tryRetarget(t,e,n){if(this._history[t]){if(!this._history[t].caller.initialised){const e=this._queue.indexOf(this._history[t].caller);return this._queue.splice(e,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,e,n):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const r=this.timeline();return r&&r.play(),!0}return!1}}Ie.id=0;class Oe{constructor(t=new tt,e=-1,n=!0){this.transforms=t,this.id=e,this.done=n}clearTransformsFromQueue(){}}I([Ie,Oe],{mergeWith(t){return new Oe(t.transforms.lmultiply(this.transforms),t.id)}});const Fe=(t,e)=>t.lmultiplyO(e),Le=t=>t.transforms;function Be(){const t=this._transformationRunners.runners.map(Le).reduce(Fe,new tt);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class je{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Oe).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const n=this.ids.indexOf(t+1);return this.ids.splice(n,1,t+1),this.runners.splice(n,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;e<this.runners.length;++e){const n=this.runners[e];if(t&&n.done&&t.done&&(!n._timeline||!n._timeline._runnerIds.includes(n.id))&&(!t._timeline||!t._timeline._runnerIds.includes(t.id))){this.remove(n.id);const r=n.mergeWith(t);this.edit(t.id,r),t=r,--e}else t=n}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}}s({Element:{animate(t,e,n){const r=Ie.sanitise(t,e,n),i=this.timeline();return new Ie(r.duration).loop(r).element(this).timeline(i.play()).schedule(r.delay,r.when)},delay(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((e=>e.id<=t.id)).map(Le).reduce(Fe,new tt)},_addRunner(t){this._transformationRunners.add(t),Ae.cancelImmediate(this._frameId),this._frameId=Ae.immediate(Be.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new je).add(new Oe(new tt(this))))}}});I(Ie,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,n){if("string"==typeof e)return this.styleAttr(t,{[e]:n});let r=e;if(this._tryRetarget(t,r))return this;let i=new ye(this._stepper).to(r),o=Object.keys(r);return this.queue((function(){i=i.from(this.element()[t](o))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const n=Object.keys(e),s=(a=o,n.filter((t=>!a.includes(t))));var a;if(s.length){const e=this.element()[t](s),n=new xe(i.from()).valueOf();Object.assign(n,e),i.from(n)}const l=new xe(i.to()).valueOf();Object.assign(l,e),i.to(l),o=n,r=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new ye(this._stepper).to(new xt(t));return this.queue((function(){n=n.from(this.element().zoom())}),(function(t){return this.element().zoom(n.at(t),e),n.done()}),(function(t,r){e=r,n.to(t)})),this._rememberMorpher("zoom",n),this},transform(t,e,n){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const r=tt.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!r;const i=new ye(this._stepper).type(n?be:tt);let o,s,a,l,u;return this.queue((function(){s=s||this.element(),o=o||f(t,s),u=new tt(e?void 0:s),s._addRunner(this),e||s._clearTransformRunnersBefore(this)}),(function(c){e||this.clearTransform();const{x:h,y:d}=new J(o).transform(s._currentTransform(this));let f=new tt({...t,origin:[h,d]}),p=this._isDeclarative&&a?a:u;if(n){f=f.decompose(h,d),p=p.decompose(h,d);const t=f.rotate,e=p.rotate,n=[t-360,t,t+360],r=n.map((t=>Math.abs(t-e))),i=Math.min(...r),o=r.indexOf(i);f.rotate=n[o]}e&&(r||(f.rotate=t.rotate||0),this._isDeclarative&&l&&(p.rotate=l)),i.from(p),i.to(f);const m=i.at(c);return l=m.rotate,a=new tt(m),this.addTransform(a),s._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(o=f(e,s)),t={...e,origin:o}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},ax(t){return this._queueNumber("ax",t)},ay(t){return this._queueNumber("ay",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new xt(e),this._tryRetarget(t,e))return this;const n=new ye(this._stepper).to(e);let r=null;return this.queue((function(){r=this.element()[t](),n.from(r),n.to(r+e)}),(function(e){return this.element()[t](n.at(e)),n.done()}),(function(t){n.to(r+new xt(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new ye(this._stepper).to(e);return this.queue((function(){n.from(this.element()[t]())}),(function(e){return this.element()[t](n.at(e)),n.done()})),this._rememberMorpher(t,n),this},_queueNumber(t,e){return this._queueObject(t,new xt(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},amove(t,e){return this.ax(t).ay(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let n;return t&&e||(n=this._element.bbox()),t||(t=n.width/n.height*e),e||(e=n.height/n.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,n,r){if(4===arguments.length)return this.plot([t,e,n,r]);if(this._tryRetarget("plot",t))return this;const i=new ye(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,r){return this._queueObject("viewbox",new rt(t,e,n,r))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),I(Ie,{rx:Dt,ry:$t,from:Ht,to:qt}),A(Ie,"Runner");class Re extends Tt{constructor(t,e=t){super(E("svg",t),e),this.namespace()}defs(){return this.isRoot()?T(this.node.querySelector("defs"))||this.put(new Mt):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof w.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:y,version:"1.1"}).attr("xmlns:xlink",b,v):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,v).attr("xmlns:svgjs",null,v)}root(){return this.isRoot()?this:super.root()}}s({Container:{nested:O((function(){return this.put(new Re)}))}}),A(Re,"Svg",!0);let Ne=class extends Tt{constructor(t,e=t){super(E("symbol",t),e)}};s({Container:{symbol:O((function(){return this.put(new Ne)}))}}),A(Ne,"Symbol");const He=Object.freeze(Object.defineProperty({__proto__:null,amove:function(t,e){return this.ax(t).ay(e)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},build:function(t){return this._build=!!t,this},center:function(t,e,n=this.bbox()){return this.cx(t,n).cy(e,n)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)},length:function(){return this.node.getComputedTextLength()},move:function(t,e,n=this.bbox()){return this.x(t,n).y(e,n)},plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(w.document.createTextNode(t)),this},x:function(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)}},Symbol.toStringTag,{value:"Module"}));class qe extends At{constructor(t,e=t){super(E("text",t),e),this.dom.leading=this.dom.leading??new xt(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new xt(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const n=this.dom.leading;this.each((function(r){if(m(this.node))return;const i=w.window.getComputedStyle(this.node).getPropertyValue("font-size"),o=n*new xt(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=o:(this.attr("dy",r?o+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new xt(t.leading||1.3),this}writeDataToDom(){return g(this,this.dom,{leading:1.3}),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let r=0,i=e.length;r<i;++r)"textPath"===e[r].nodeName||m(e[r])?0===r&&(n=r+1):(r!==n&&3!==e[r].nodeType&&!0===T(e[r]).dom.newLined&&(t+="\n"),t+=e[r].textContent);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,n=(t=(t+"").split("\n")).length;e<n;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}I(qe,He),s({Container:{text:O((function(t=""){return this.put(new qe).text(t)})),plain:O((function(t=""){return this.put(new qe).plain(t)}))}}),A(qe,"Text");class Pe extends At{constructor(t,e=t){super(E("tspan",t),e),this._build=!1}dx(t){return this.attr("dx",t)}dy(t){return this.attr("dy",t)}newLine(){this.dom.newLined=!0;const t=this.parent();if(!(t instanceof qe))return this;const e=t.index(this),n=w.window.getComputedStyle(this.node).getPropertyValue("font-size"),r=t.dom.leading*new xt(n);return this.dy(e?r:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}}I(Pe,He),s({Tspan:{tspan:O((function(t=""){const e=new Pe;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),A(Pe,"Tspan");class We extends At{constructor(t,e=t){super(E("circle",t),e)}radius(t){return this.attr("r",t)}rx(t){return this.attr("r",t)}ry(t){return this.rx(t)}size(t){return this.radius(new xt(t).divide(2))}}I(We,{x:zt,y:It,cx:Ot,cy:Ft,width:Lt,height:Bt}),s({Container:{circle:O((function(t=0){return this.put(new We).size(t).move(0,0)}))}}),A(We,"Circle");class Ye extends Tt{constructor(t,e=t){super(E("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return at("svg [clip-path*="+this.id()+"]")}}s({Container:{clip:O((function(){return this.defs().put(new Ye)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof Ye?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),A(Ye,"ClipPath");class Ue extends St{constructor(t,e=t){super(E("foreignObject",t),e)}}s({Container:{foreignObject:O((function(t,e){return this.put(new Ue).size(t,e)}))}}),A(Ue,"ForeignObject");const Xe=Object.freeze(Object.defineProperty({__proto__:null,dmove:function(t,e){return this.children().forEach((n=>{let r;try{r=n.node instanceof w.window.SVGSVGElement?new rt(n.attr(["x","y","width","height"])):n.bbox()}catch(t){return}const i=new tt(n),o=i.translate(t,e).transform(i.inverse()),s=new J(r.x,r.y).transform(o);n.move(s.x,s.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,n=this.bbox()){const r=t-n.x,i=e-n.y;return this.dmove(r,i)},size:function(t,e,n=this.bbox()){const r=d(this,t,e,n),i=r.width/n.width,o=r.height/n.height;return this.children().forEach((t=>{const e=new J(n).transform(new tt(t).inverse());t.scale(i,o,e.x,e.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}},Symbol.toStringTag,{value:"Module"}));class Ve extends Tt{constructor(t,e=t){super(E("g",t),e)}}I(Ve,Xe),s({Container:{group:O((function(){return this.put(new Ve)}))}}),A(Ve,"G");class Ge extends Tt{constructor(t,e=t){super(E("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,b)}}I(Ge,Xe),s({Container:{link:O((function(t){return this.put(new Ge).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const n=e.index(t);return e.add(this,n),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new Ge,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),A(Ge,"A");class Ke extends Tt{constructor(t,e=t){super(E("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return at("svg [mask*="+this.id()+"]")}}s({Container:{mask:O((function(){return this.defs().put(new Ke)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Ke?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),A(Ke,"Mask");class Ze extends St{constructor(t,e=t){super(E("stop",t),e)}update(t){return("number"==typeof t||t instanceof xt)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new xt(t.offset)),this}}s({Gradient:{stop:function(t,e,n){return this.put(new Ze).update(t,e,n)}}}),A(Ze,"Stop");class Je extends St{constructor(t,e=t){super(E("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,n={}){return this.rule("@font-face",{fontFamily:t,src:e,...n})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let n=t+"{";for(const t in e)n+=t.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[t]+";";return n+="}",n}(t,e))}}s("Dom",{style(t,e){return this.put(new Je).rule(t,e)},fontface(t,e,n){return this.put(new Je).font(t,e,n)}}),A(Je,"Style");class Qe extends qe{constructor(t,e=t){super(E("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let n=null;return e&&(n=e.plot(t)),null==t?n:this}track(){return this.reference("href")}}s({Container:{textPath:O((function(t,e){return t instanceof qe||(t=this.text(t)),t.path(e)}))},Text:{path:O((function(t,e=!0){const n=new Qe;let r;if(t instanceof ke||(t=this.defs().path(t)),n.attr("href","#"+t,b),e)for(;r=this.node.firstChild;)n.node.appendChild(r);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:O((function(t){return t instanceof qe||(t=(new qe).addTo(this.parent()).text(t)),t.path(this)})),targets(){return at("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),Qe.prototype.MorphArray=me,A(Qe,"TextPath");class tn extends At{constructor(t,e=t){super(E("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,b)}}s({Container:{use:O((function(t,e){return this.put(new tn).use(t,e)}))}}),A(tn,"Use"),I([Re,Ne,Ut,Yt,Jt],a("viewbox")),I([Zt,Ee,Se,ke],a("marker")),I(qe,a("Text")),I(ke,a("Path")),I(Mt,a("Defs")),I([qe,Pe],a("Tspan")),I([Te,Rt,Wt,Ie],a("radius")),I(pt,a("EventTarget")),I(Ct,a("Dom")),I(St,a("Element")),I(At,a("Shape")),I([Tt,Nt],a("Container")),I(Wt,a("Gradient")),I(Ie,a("Runner")),ot.extend([...new Set(o)]),function(t=[]){_e.push(...[].concat(t))}([xt,Z,rt,tt,wt,Vt,me,J]),I(_e,{to(t){return(new ye).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,n,r,i){return this.fromArray(t.map((function(t,o){return r.step(t,e[o],n,i[o],i)})))}});const en="\n #toolbar {\n display: flex;\n gap: 5px;\n position: absolute;\n right: 10px;\n top: 10px;\n z-index: 100;\n }\n \n .toolbar-item {\n align-items: center;\n background-color: var(--toolbar-bg-color, #FFFFFF);\n border: 1px solid var(--toolbar-border-color, #BCBCBC);\n cursor: pointer;\n display: flex;\n height: 30px;\n justify-content: center;\n width: 30px;\n border-radius: 3px;\n transition: all 0.2s ease;\n position: relative;\n }\n \n .toolbar-item:hover {\n background-color: var(--toolbar-hover-bg-color, #f8f9fa);\n border-color: var(--toolbar-border-color, #999);\n transform: translateY(-1px);\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n }\n \n .toolbar-item:active {\n transform: translateY(0);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n }\n \n .toolbar-item:focus {\n outline: none;\n border-color: var(--button-bg-color, #0066cc);\n box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);\n }\n \n .toolbar-item img {\n width: 16px;\n height: 16px;\n pointer-events: none;\n filter: var(--toolbar-icon-filter, none);\n }\n \n .toolbar-item[disabled] {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n }\n \n /* Tooltip styles */\n .toolbar-item::after {\n content: attr(data-tooltip);\n position: absolute;\n bottom: -35px;\n left: 50%;\n transform: translateX(-50%);\n background: var(--tooltip-bg-color, #333);\n color: var(--tooltip-text-color, white);\n padding: 4px 8px;\n border-radius: 4px;\n font-size: 12px;\n white-space: nowrap;\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.2s ease;\n z-index: 1000;\n }\n \n .toolbar-item::before {\n content: '';\n position: absolute;\n bottom: -25px;\n left: 50%;\n transform: translateX(-50%);\n border: 5px solid transparent;\n border-bottom-color: var(--tooltip-bg-color, #333);\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.2s ease;\n z-index: 1000;\n }\n \n .toolbar-item:hover::after,\n .toolbar-item:hover::before {\n opacity: 1;\n }\n \n /* Shadow DOM specific adjustments */\n :host #toolbar {\n display: flex;\n gap: 5px;\n position: absolute;\n right: 10px;\n top: 10px;\n z-index: 100;\n }\n",nn=class{static createWatermarkPattern(){const t=this.WATERMARK_TEXT;return`url("data:image/svg+xml,${encodeURIComponent(`\n <svg xmlns="http://www.w3.org/2000/svg" width="300" height="200">\n <text \n x="50%" \n y="50%" \n dominant-baseline="middle" \n text-anchor="middle"\n font-family="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Arial, sans-serif"\n font-size="18"\n font-weight="600"\n fill="rgba(134, 134, 134, 0.2)"\n transform="rotate(-35, 100, 60)"\n >${t}</text>\n </svg>\n `.trim())}")`}static add(t){this.remove(t);const e=document.createElement("div");e.classList.add("apexcharts-watermark"),Object.assign(e.style,{backgroundImage:this.createWatermarkPattern(),backgroundRepeat:"repeat",bottom:"0",left:"0",msUserSelect:"none",pointerEvents:"none",position:"absolute",right:"0",top:"0",userSelect:"none",webkitUserSelect:"none",zIndex:"10000"}),"static"===getComputedStyle(t).position&&(t.style.position="relative"),t.appendChild(e)}static exists(t){return!!t.querySelector(`.${this.WATERMARK_CLASS}`)}static remove(t){const e=t.querySelector(`.${this.WATERMARK_CLASS}`);e&&e.remove()}};nn.WATERMARK_CLASS="apexgantt-watermark",nn.WATERMARK_TEXT="APEXCHARTS";let rn=nn;function on(t){const e=t.getRootNode();return e instanceof ShadowRoot?e.host:t.parentElement}function sn(t,e){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=function(t){let e=1,n=1,r=0,i=0,o=t.parentElement;for(;o&&o!==document.body&&o!==document.documentElement;){const t=window.getComputedStyle(o),s=t.scale;if(s&&"none"!==s){const t=s.split(" ").map(parseFloat);1===t.length?(e*=t[0],n*=t[0]):t.length>=2&&(e*=t[0],n*=t[1])}const a=t.transform;if(a&&"none"!==a)try{const t=new DOMMatrix(a);e*=t.a,n*=t.d,r+=t.e,i+=t.f}catch(t){}o=on(o)}return{scaleX:e,scaleY:n,translateX:r,translateY:i}}(e),o=function(t){const e=window.getComputedStyle(t);let n=1,r=1,i=0,o=0,s=0;const a=e.scale;if(a&&"none"!==a){const t=a.split(" ").map(parseFloat);1===t.length?(n=t[0],r=t[0]):t.length>=2&&(n=t[0],r=t[1])}const l=e.transform;if(l&&"none"!==l)try{const t=new DOMMatrix(l);n*=t.a,r*=t.d,i=t.e,o=t.f,s=Math.atan2(t.b,t.a)}catch(t){}return{scaleX:n,scaleY:r,translateX:i,translateY:o,rotation:s}}(t),s=i.scaleX||1,a=i.scaleY||1,l=(n.left-r.left)/s,u=(n.top-r.top)/a,c=n.width/s,h=n.height/a;if(Math.abs(o.rotation)>.01){const t=l+c/2,e=u+h/2;return{left:t,right:t,top:e,bottom:e,width:0,height:0}}return{left:l,right:l+c,top:u,bottom:u+h,width:c,height:h}}var an,ln=(an={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},function(t){return null==an?void 0:an[t]}),un="object"==typeof global&&global&&global.Object===Object&&global,cn="object"==typeof self&&self&&self.Object===Object&&self,hn=un||cn||Function("return this")(),dn=hn.Symbol;var fn=Array.isArray,pn=Object.prototype,mn=pn.hasOwnProperty,gn=pn.toString,yn=dn?dn.toStringTag:void 0;var vn=Object.prototype.toString;var bn="[object Null]",wn="[object Undefined]",xn=dn?dn.toStringTag:void 0;function _n(t){return null==t?void 0===t?wn:bn:xn&&xn in Object(t)?function(t){var e=mn.call(t,yn),n=t[yn];try{t[yn]=void 0;var r=!0}catch(t){}var i=gn.call(t);return r&&(e?t[yn]=n:delete t[yn]),i}(t):function(t){return vn.call(t)}(t)}function kn(t){return null!=t&&"object"==typeof t}var Cn="[object Symbol]";var Sn=1/0,En=dn?dn.prototype:void 0,Tn=En?En.toString:void 0;function Mn(t){if("string"==typeof t)return t;if(fn(t))return function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}(t,Mn)+"";if(function(t){return"symbol"==typeof t||kn(t)&&_n(t)==Cn}(t))return Tn?Tn.call(t):"";var e=t+"";return"0"==e&&1/t==-Sn?"-0":e}function An(t){return null==t?"":Mn(t)}var Dn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,$n=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var zn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var In=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var On="\\ud800-\\udfff",Fn="\\u2700-\\u27bf",Ln="a-z\\xdf-\\xf6\\xf8-\\xff",Bn="A-Z\\xc0-\\xd6\\xd8-\\xde",jn="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Rn="["+jn+"]",Nn="\\d+",Hn="["+Fn+"]",qn="["+Ln+"]",Pn="[^"+On+jn+Nn+Fn+Ln+Bn+"]",Wn="(?:\\ud83c[\\udde6-\\uddff]){2}",Yn="[\\ud800-\\udbff][\\udc00-\\udfff]",Un="["+Bn+"]",Xn="(?:"+qn+"|"+Pn+")",Vn="(?:"+Un+"|"+Pn+")",Gn="(?:['’](?:d|ll|m|re|s|t|ve))?",Kn="(?:['’](?:D|LL|M|RE|S|T|VE))?",Zn="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Jn="[\\ufe0e\\ufe0f]?",Qn=Jn+Zn+("(?:\\u200d(?:"+["[^"+On+"]",Wn,Yn].join("|")+")"+Jn+Zn+")*"),tr="(?:"+[Hn,Wn,Yn].join("|")+")"+Qn,er=RegExp([Un+"?"+qn+"+"+Gn+"(?="+[Rn,Un,"$"].join("|")+")",Vn+"+"+Kn+"(?="+[Rn,Un+Xn,"$"].join("|")+")",Un+"?"+Xn+"+"+Gn,Un+"+"+Kn,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Nn,tr].join("|"),"g");function nr(t,e,n){return t=An(t),void 0===e?function(t){return In.test(t)}(t)?function(t){return t.match(er)||[]}(t):function(t){return t.match(zn)||[]}(t):t.match(e)||[]}var rr=RegExp("['’]","g");var ir,or=(ir=function(t,e,n){return t+(n?"-":"")+e.toLowerCase()},function(t){return function(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;)n=e(n,t[i],i,t);return n}(nr(function(t){return(t=An(t))&&t.replace(Dn,ln).replace($n,"")}(t).replace(rr,"")),ir,"")});const sr=(t,e="apex-tooltip-container")=>{let n=t.getElementById(e);if(!n){n=t.createElement("div"),n.id=e,n.setAttribute("role","tooltip"),n.setAttribute("aria-hidden","true");t.getAppendContainer().appendChild(n)}return n},ar=(t,e="",n,r="")=>{const i=t.getElementById(e);if(!i)return sr(t,e),ar(t,e,n,r);if(n&&r){const t=r.includes("tooltip-content"),e=n.match(/background-color:\s*([^;]+);?/),o=n.match(/color:\s*([^;]+);?/),s=e?e[1]:"#333",a=o?o[1]:"white";i.innerHTML=t?r:`<div class="tooltip-content" style="background-color: ${s}; color: ${a};">${r}</div>`;const l=n+"; display: block !important; visibility: visible !important; opacity: 1 !important;";i.setAttribute("style",l),i.classList.add("visible"),i.setAttribute("aria-hidden","false")}else i.removeAttribute("style"),i.classList.remove("visible"),i.setAttribute("aria-hidden","true"),i.innerHTML=""},lr=(t={})=>{const e=[];for(const n in t){const r=`${or(n)}: ${t[n]};`;e.push(r)}return e.join(" ")};function ur(t,{className:e="",content:n,style:r={}}={}){const i=cr(t,"div",{className:e,innerHTML:n||""});return i.setAttribute("style",lr(r)),i}function cr(t,e,n={}){const r=t.createElement(e);return Object.assign(r,n)}function hr(t,e){if(!t)return"#000000";3===(t=t.replace(/^#/,"")).length&&(t=t.split("").map((t=>t+t)).join(""));const n=parseInt(t,16);let r=n>>16&255,i=n>>8&255,o=255&n;return e*=.299*r+.587*i+.114*o<100?-1:1,r=Math.min(255,Math.max(0,r+e)),i=Math.min(255,Math.max(0,i+e)),o=Math.min(255,Math.max(0,o+e)),`#${(1<<24|r<<16|i<<8|o).toString(16).slice(1)}`}var dr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function fr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var pr={exports:{}};pr.exports=function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",o="minute",s="hour",a="day",l="week",u="month",c="quarter",h="year",d="date",f="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|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,g={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])+"]"}},y=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:y,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+y(r,2,"0")+":"+y(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,u),o=n-i<0,s=e.clone().add(r+(o?-1:1),u);return+(-(r+(n-i)/(o?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:u,y:h,w:l,d:a,D:d,h:s,m:o,s:i,ms:r,Q:c}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},b="en",w={};w[b]=g;var x="$isDayjsObject",_=function(t){return t instanceof E||!(!t||!t[x])},k=function t(e,n,r){var i;if(!e)return b;if("string"==typeof e){var o=e.toLowerCase();w[o]&&(i=o),n&&(w[o]=n,i=o);var s=e.split("-");if(!i&&s.length>1)return t(s[0])}else{var a=e.name;w[a]=e,i=a}return!r&&i&&(b=i),i||!r&&b},C=function(t,e){if(_(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new E(n)},S=v;S.l=k,S.i=_,S.w=function(t,e){return C(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var E=function(){function g(t){this.$L=k(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[x]=!0}var y=g.prototype;return y.parse=function(t){this.$d=function(t){var e=t.date,n=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 r=e.match(p);if(r){var i=r[2]-1||0,o=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)}}return new Date(e)}(t),this.init()},y.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()},y.$utils=function(){return S},y.isValid=function(){return!(this.$d.toString()===f)},y.isSame=function(t,e){var n=C(t);return this.startOf(e)<=n&&n<=this.endOf(e)},y.isAfter=function(t,e){return C(t)<this.startOf(e)},y.isBefore=function(t,e){return this.endOf(e)<C(t)},y.$g=function(t,e,n){return S.u(t)?this[e]:this.set(n,t)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(t,e){var n=this,r=!!S.u(e)||e,c=S.p(t),f=function(t,e){var i=S.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},p=function(t,e){return S.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},m=this.$W,g=this.$M,y=this.$D,v="set"+(this.$u?"UTC":"");switch(c){case h:return r?f(1,0):f(31,11);case u:return r?f(1,g):f(0,g+1);case l:var b=this.$locale().weekStart||0,w=(m<b?m+7:m)-b;return f(r?y-w:y+(6-w),g);case a:case d:return p(v+"Hours",0);case s:return p(v+"Minutes",1);case o:return p(v+"Seconds",2);case i:return p(v+"Milliseconds",3);default:return this.clone()}},y.endOf=function(t){return this.startOf(t,!1)},y.$set=function(t,e){var n,l=S.p(t),c="set"+(this.$u?"UTC":""),f=(n={},n[a]=c+"Date",n[d]=c+"Date",n[u]=c+"Month",n[h]=c+"FullYear",n[s]=c+"Hours",n[o]=c+"Minutes",n[i]=c+"Seconds",n[r]=c+"Milliseconds",n)[l],p=l===a?this.$D+(e-this.$W):e;if(l===u||l===h){var m=this.clone().set(d,1);m.$d[f](p),m.init(),this.$d=m.set(d,Math.min(this.$D,m.daysInMonth())).$d}else f&&this.$d[f](p);return this.init(),this},y.set=function(t,e){return this.clone().$set(t,e)},y.get=function(t){return this[S.p(t)]()},y.add=function(r,c){var d,f=this;r=Number(r);var p=S.p(c),m=function(t){var e=C(f);return S.w(e.date(e.date()+Math.round(t*r)),f)};if(p===u)return this.set(u,this.$M+r);if(p===h)return this.set(h,this.$y+r);if(p===a)return m(1);if(p===l)return m(7);var g=(d={},d[o]=e,d[s]=n,d[i]=t,d)[p]||1,y=this.$d.getTime()+r*g;return S.w(y,this)},y.subtract=function(t,e){return this.add(-1*t,e)},y.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||f;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=S.z(this),o=this.$H,s=this.$m,a=this.$M,l=n.weekdays,u=n.months,c=n.meridiem,h=function(t,n,i,o){return t&&(t[n]||t(e,r))||i[n].slice(0,o)},d=function(t){return S.s(o%12||12,t,"0")},p=c||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(m,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return S.s(e.$y,4,"0");case"M":return a+1;case"MM":return S.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,u,3);case"MMMM":return h(u,a);case"D":return e.$D;case"DD":return S.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,l,2);case"ddd":return h(n.weekdaysShort,e.$W,l,3);case"dddd":return l[e.$W];case"H":return String(o);case"HH":return S.s(o,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return p(o,s,!0);case"A":return p(o,s,!1);case"m":return String(s);case"mm":return S.s(s,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 i}return null}(t)||i.replace(":","")}))},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(r,d,f){var p,m=this,g=S.p(d),y=C(r),v=(y.utcOffset()-this.utcOffset())*e,b=this-y,w=function(){return S.m(m,y)};switch(g){case h:p=w()/12;break;case u:p=w();break;case c:p=w()/3;break;case l:p=(b-v)/6048e5;break;case a:p=(b-v)/864e5;break;case s:p=b/n;break;case o:p=b/e;break;case i:p=b/t;break;default:p=b}return f?p:S.a(p)},y.daysInMonth=function(){return this.endOf(u).$D},y.$locale=function(){return w[this.$L]},y.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=k(t,e,!0);return r&&(n.$L=r),n},y.clone=function(){return S.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},g}(),T=E.prototype;return C.prototype=T,[["$ms",r],["$s",i],["$m",o],["$H",s],["$W",a],["$M",u],["$y",h],["$D",d]].forEach((function(t){T[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),C.extend=function(t,e){return t.$i||(t(e,E,C),t.$i=!0),C},C.locale=k,C.isDayjs=_,C.unix=function(t){return C(1e3*t)},C.en=w[b],C.Ls=w,C.p={},C}();const mr=fr(pr.exports);var gr={exports:{}};const yr=fr(gr.exports=function(t,e){e.prototype.isSameOrBefore=function(t,e){return this.isSame(t,e)||this.isBefore(t,e)}});var vr={exports:{}};vr.exports=function(t,e,n){var r=function(t,e){if(!e||!e.length||1===e.length&&!e[0]||1===e.length&&Array.isArray(e[0])&&!e[0].length)return null;var n;1===e.length&&e[0].length>0&&(e=e[0]),n=(e=e.filter((function(t){return t})))[0];for(var r=1;r<e.length;r+=1)e[r].isValid()&&!e[r][t](n)||(n=e[r]);return n};n.max=function(){var t=[].slice.call(arguments,0);return r("isAfter",t)},n.min=function(){var t=[].slice.call(arguments,0);return r("isBefore",t)}};const br=fr(vr.exports);var wr,xr,_r={exports:{}};const kr=fr(_r.exports=(wr="month",xr="quarter",function(t,e){var n=e.prototype;n.quarter=function(t){return this.$utils().u(t)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(t-1))};var r=n.add;n.add=function(t,e){return t=Number(t),this.$utils().p(e)===xr?this.add(3*t,wr):r.bind(this)(t,e)};var i=n.startOf;n.startOf=function(t,e){var n=this.$utils(),r=!!n.u(e)||e;if(n.p(t)===xr){var o=this.quarter()-1;return r?this.month(3*o).startOf(wr).startOf("day"):this.month(3*o+2).endOf(wr).endOf("day")}return i.bind(this)(t,e)}}));var Cr={exports:{}};Cr.exports=function(t,e){e.prototype.weekday=function(t){var e=this.$locale().weekStart||0,n=this.$W,r=(n<e?n+7:n)-e;return this.$utils().u(t)?r:this.subtract(r,"day").add(t,"day")}};const Sr=fr(Cr.exports);var Er={exports:{}};Er.exports=function(){var t="week",e="year";return function(n,r,i){var o=r.prototype;o.week=function(n){if(void 0===n&&(n=null),null!==n)return this.add(7*(n-this.week()),"day");var r=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var o=i(this).startOf(e).add(1,e).date(r),s=i(this).endOf(t);if(o.isBefore(s))return 1}var a=i(this).startOf(e).date(r).startOf(t).subtract(1,"millisecond"),l=this.diff(a,t,!0);return l<0?i(this).startOf("week").week():Math.ceil(l)},o.weeks=function(t){return void 0===t&&(t=null),this.week(t)}}}();const Tr=fr(Er.exports);function Mr(t,e,n){var r=t.length;return n=void 0===n?r:n,!e&&n>=r?t:function(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}(t,e,n)}var Ar=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function Dr(t){return Ar.test(t)}var $r="\\ud800-\\udfff",zr="["+$r+"]",Ir="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Or="\\ud83c[\\udffb-\\udfff]",Fr="[^"+$r+"]",Lr="(?:\\ud83c[\\udde6-\\uddff]){2}",Br="[\\ud800-\\udbff][\\udc00-\\udfff]",jr="(?:"+Ir+"|"+Or+")"+"?",Rr="[\\ufe0e\\ufe0f]?",Nr=Rr+jr+("(?:\\u200d(?:"+[Fr,Lr,Br].join("|")+")"+Rr+jr+")*"),Hr="(?:"+[Fr+Ir+"?",Ir,Lr,Br,zr].join("|")+")",qr=RegExp(Or+"(?="+Or+")|"+Hr+Nr,"g");function Pr(t){return Dr(t)?function(t){return t.match(qr)||[]}(t):function(t){return t.split("")}(t)}var Wr,Yr=(Wr="toUpperCase",function(t){var e=Dr(t=An(t))?Pr(t):void 0,n=e?e[0]:t.charAt(0),r=e?Mr(e,1).join(""):t.slice(1);return n[Wr]()+r});function Ur(t){return Yr(An(t).toLowerCase())}function Xr(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}var Vr=function(t,e,n){for(var r=-1,i=Object(t),o=n(t),s=o.length;s--;){var a=o[++r];if(!1===e(i[a],a,i))break}return t};function Gr(t){return kn(t)&&"[object Arguments]"==_n(t)}var Kr=Object.prototype,Zr=Kr.hasOwnProperty,Jr=Kr.propertyIsEnumerable,Qr=Gr(function(){return arguments}())?Gr:function(t){return kn(t)&&Zr.call(t,"callee")&&!Jr.call(t,"callee")};var ti="object"==typeof exports&&exports&&!exports.nodeType&&exports,ei=ti&&"object"==typeof module&&module&&!module.nodeType&&module,ni=ei&&ei.exports===ti?hn.Buffer:void 0,ri=(ni?ni.isBuffer:void 0)||function(){return!1},ii=9007199254740991,oi=/^(?:0|[1-9]\d*)$/;function si(t,e){var n=typeof t;return!!(e=null==e?ii:e)&&("number"==n||"symbol"!=n&&oi.test(t))&&t>-1&&t%1==0&&t<e}var ai=9007199254740991;function li(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=ai}var ui={};ui["[object Float32Array]"]=ui["[object Float64Array]"]=ui["[object Int8Array]"]=ui["[object Int16Array]"]=ui["[object Int32Array]"]=ui["[object Uint8Array]"]=ui["[object Uint8ClampedArray]"]=ui["[object Uint16Array]"]=ui["[object Uint32Array]"]=!0,ui["[object Arguments]"]=ui["[object Array]"]=ui["[object ArrayBuffer]"]=ui["[object Boolean]"]=ui["[object DataView]"]=ui["[object Date]"]=ui["[object Error]"]=ui["[object Function]"]=ui["[object Map]"]=ui["[object Number]"]=ui["[object Object]"]=ui["[object RegExp]"]=ui["[object Set]"]=ui["[object String]"]=ui["[object WeakMap]"]=!1;var ci,hi="object"==typeof exports&&exports&&!exports.nodeType&&exports,di=hi&&"object"==typeof module&&module&&!module.nodeType&&module,fi=di&&di.exports===hi&&un.process,pi=function(){try{var t=di&&di.require&&di.require("util").types;return t||fi&&fi.binding&&fi.binding("util")}catch(t){}}(),mi=pi&&pi.isTypedArray,gi=mi?(ci=mi,function(t){return ci(t)}):function(t){return kn(t)&&li(t.length)&&!!ui[_n(t)]},yi=Object.prototype.hasOwnProperty;function vi(t,e){var n=fn(t),r=!n&&Qr(t),i=!n&&!r&&ri(t),o=!n&&!r&&!i&&gi(t),s=n||r||i||o,a=s?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],l=a.length;for(var u in t)!yi.call(t,u)||s&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||si(u,l))||a.push(u);return a}var bi=Object.prototype;var wi=function(t,e){return function(n){return t(e(n))}}(Object.keys,Object),xi=Object.prototype.hasOwnProperty;function _i(t){if(n=(e=t)&&e.constructor,e!==("function"==typeof n&&n.prototype||bi))return wi(t);var e,n,r=[];for(var i in Object(t))xi.call(t,i)&&"constructor"!=i&&r.push(i);return r}var ki="[object AsyncFunction]",Ci="[object Function]",Si="[object GeneratorFunction]",Ei="[object Proxy]";function Ti(t){return null!=t&&li(t.length)&&!function(t){if(!function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}(t))return!1;var e=_n(t);return e==Ci||e==Si||e==ki||e==Ei}(t)}function Mi(t){return Ti(t)?vi(t):_i(t)}var Ai,Di=(Ai=function(t,e){return t&&Vr(t,e,Mi)},function(t,e){if(null==t)return t;if(!Ti(t))return Ai(t,e);for(var n=t.length,r=-1,i=Object(t);++r<n&&!1!==e(i[r],r,i););return t});function $i(t){return t}function zi(t,e){var n;return(fn(t)?Xr:Di)(t,"function"==typeof(n=e)?n:$i)}var Ii,Oi,Fi={exports:{}};Ii=Fi,Oi=Fi.exports,function(){var t,e="Expected a function",n="__lodash_hash_undefined__",r="__lodash_placeholder__",i=16,o=32,s=64,a=128,l=256,u=1/0,c=9007199254740991,h=NaN,d=4294967295,f=[["ary",a],["bind",1],["bindKey",2],["curry",8],["curryRight",i],["flip",512],["partial",o],["partialRight",s],["rearg",l]],p="[object Arguments]",m="[object Array]",g="[object Boolean]",y="[object Date]",v="[object Error]",b="[object Function]",w="[object GeneratorFunction]",x="[object Map]",_="[object Number]",k="[object Object]",C="[object Promise]",S="[object RegExp]",E="[object Set]",T="[object String]",M="[object Symbol]",A="[object WeakMap]",D="[object ArrayBuffer]",$="[object DataView]",z="[object Float32Array]",I="[object Float64Array]",O="[object Int8Array]",F="[object Int16Array]",L="[object Int32Array]",B="[object Uint8Array]",j="[object Uint8ClampedArray]",R="[object Uint16Array]",N="[object Uint32Array]",H=/\b__p \+= '';/g,q=/\b(__p \+=) '' \+/g,P=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,Y=/[&<>"']/g,U=RegExp(W.source),X=RegExp(Y.source),V=/<%-([\s\S]+?)%>/g,G=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,Q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tt=/[\\^$.*+?()[\]{}|]/g,et=RegExp(tt.source),nt=/^\s+/,rt=/\s/,it=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ot=/\{\n\/\* \[wrapped with (.+)\] \*/,st=/,? & /,at=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lt=/[()=,{}\[\]\/\s]/,ut=/\\(\\)?/g,ct=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ht=/\w*$/,dt=/^[-+]0x[0-9a-f]+$/i,ft=/^0b[01]+$/i,pt=/^\[object .+?Constructor\]$/,mt=/^0o[0-7]+$/i,gt=/^(?:0|[1-9]\d*)$/,yt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,vt=/($^)/,bt=/['\n\r\u2028\u2029\\]/g,wt="\\ud800-\\udfff",xt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",_t="\\u2700-\\u27bf",kt="a-z\\xdf-\\xf6\\xf8-\\xff",Ct="A-Z\\xc0-\\xd6\\xd8-\\xde",St="\\ufe0e\\ufe0f",Et="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Tt="['’]",Mt="["+wt+"]",At="["+Et+"]",Dt="["+xt+"]",$t="\\d+",zt="["+_t+"]",It="["+kt+"]",Ot="[^"+wt+Et+$t+_t+kt+Ct+"]",Ft="\\ud83c[\\udffb-\\udfff]",Lt="[^"+wt+"]",Bt="(?:\\ud83c[\\udde6-\\uddff]){2}",jt="[\\ud800-\\udbff][\\udc00-\\udfff]",Rt="["+Ct+"]",Nt="\\u200d",Ht="(?:"+It+"|"+Ot+")",qt="(?:"+Rt+"|"+Ot+")",Pt="(?:['’](?:d|ll|m|re|s|t|ve))?",Wt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Yt="(?:"+Dt+"|"+Ft+")?",Ut="["+St+"]?",Xt=Ut+Yt+"(?:"+Nt+"(?:"+[Lt,Bt,jt].join("|")+")"+Ut+Yt+")*",Vt="(?:"+[zt,Bt,jt].join("|")+")"+Xt,Gt="(?:"+[Lt+Dt+"?",Dt,Bt,jt,Mt].join("|")+")",Kt=RegExp(Tt,"g"),Zt=RegExp(Dt,"g"),Jt=RegExp(Ft+"(?="+Ft+")|"+Gt+Xt,"g"),Qt=RegExp([Rt+"?"+It+"+"+Pt+"(?="+[At,Rt,"$"].join("|")+")",qt+"+"+Wt+"(?="+[At,Rt+Ht,"$"].join("|")+")",Rt+"?"+Ht+"+"+Pt,Rt+"+"+Wt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",$t,Vt].join("|"),"g"),te=RegExp("["+Nt+wt+xt+St+"]"),ee=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ne=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],re=-1,ie={};ie[z]=ie[I]=ie[O]=ie[F]=ie[L]=ie[B]=ie[j]=ie[R]=ie[N]=!0,ie[p]=ie[m]=ie[D]=ie[g]=ie[$]=ie[y]=ie[v]=ie[b]=ie[x]=ie[_]=ie[k]=ie[S]=ie[E]=ie[T]=ie[A]=!1;var oe={};oe[p]=oe[m]=oe[D]=oe[$]=oe[g]=oe[y]=oe[z]=oe[I]=oe[O]=oe[F]=oe[L]=oe[x]=oe[_]=oe[k]=oe[S]=oe[E]=oe[T]=oe[M]=oe[B]=oe[j]=oe[R]=oe[N]=!0,oe[v]=oe[b]=oe[A]=!1;var se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ae=parseFloat,le=parseInt,ue="object"==typeof dr&&dr&&dr.Object===Object&&dr,ce="object"==typeof self&&self&&self.Object===Object&&self,he=ue||ce||Function("return this")(),de=Oi&&!Oi.nodeType&&Oi,fe=de&&Ii&&!Ii.nodeType&&Ii,pe=fe&&fe.exports===de,me=pe&&ue.process,ge=function(){try{var t=fe&&fe.require&&fe.require("util").types;return t||me&&me.binding&&me.binding("util")}catch(t){}}(),ye=ge&&ge.isArrayBuffer,ve=ge&&ge.isDate,be=ge&&ge.isMap,we=ge&&ge.isRegExp,xe=ge&&ge.isSet,_e=ge&&ge.isTypedArray;function ke(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ce(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var s=t[i];e(r,s,n(s),t)}return r}function Se(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Ee(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Te(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Me(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}function Ae(t,e){return!(null==t||!t.length)&&Re(t,e,0)>-1}function De(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function $e(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function ze(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function Ie(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function Oe(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function Fe(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Le=Pe("length");function Be(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}function je(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function Re(t,e,n){return e==e?function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):je(t,He,n)}function Ne(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}function He(t){return t!=t}function qe(t,e){var n=null==t?0:t.length;return n?Ue(t,e)/n:h}function Pe(e){return function(n){return null==n?t:n[e]}}function We(e){return function(n){return null==e?t:e[n]}}function Ye(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}function Ue(e,n){for(var r,i=-1,o=e.length;++i<o;){var s=n(e[i]);s!==t&&(r=r===t?s:r+s)}return r}function Xe(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Ve(t){return t?t.slice(0,hn(t)+1).replace(nt,""):t}function Ge(t){return function(e){return t(e)}}function Ke(t,e){return $e(e,(function(e){return t[e]}))}function Ze(t,e){return t.has(e)}function Je(t,e){for(var n=-1,r=t.length;++n<r&&Re(e,t[n],0)>-1;);return n}function Qe(t,e){for(var n=t.length;n--&&Re(e,t[n],0)>-1;);return n}var tn=We({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),en=We({"&":"&","<":"<",">":">",'"':""","'":"'"});function nn(t){return"\\"+se[t]}function rn(t){return te.test(t)}function on(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function sn(t,e){return function(n){return t(e(n))}}function an(t,e){for(var n=-1,i=t.length,o=0,s=[];++n<i;){var a=t[n];a!==e&&a!==r||(t[n]=r,s[o++]=n)}return s}function ln(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function un(t){return rn(t)?function(t){for(var e=Jt.lastIndex=0;Jt.test(t);)++e;return e}(t):Le(t)}function cn(t){return rn(t)?function(t){return t.match(Jt)||[]}(t):function(t){return t.split("")}(t)}function hn(t){for(var e=t.length;e--&&rt.test(t.charAt(e)););return e}var dn=We({"&":"&","<":"<",">":">",""":'"',"'":"'"}),fn=function rt(wt){var xt,_t=(wt=null==wt?he:fn.defaults(he.Object(),wt,fn.pick(he,ne))).Array,kt=wt.Date,Ct=wt.Error,St=wt.Function,Et=wt.Math,Tt=wt.Object,Mt=wt.RegExp,At=wt.String,Dt=wt.TypeError,$t=_t.prototype,zt=St.prototype,It=Tt.prototype,Ot=wt["__core-js_shared__"],Ft=zt.toString,Lt=It.hasOwnProperty,Bt=0,jt=(xt=/[^.]+$/.exec(Ot&&Ot.keys&&Ot.keys.IE_PROTO||""))?"Symbol(src)_1."+xt:"",Rt=It.toString,Nt=Ft.call(Tt),Ht=he._,qt=Mt("^"+Ft.call(Lt).replace(tt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Pt=pe?wt.Buffer:t,Wt=wt.Symbol,Yt=wt.Uint8Array,Ut=Pt?Pt.allocUnsafe:t,Xt=sn(Tt.getPrototypeOf,Tt),Vt=Tt.create,Gt=It.propertyIsEnumerable,Jt=$t.splice,te=Wt?Wt.isConcatSpreadable:t,se=Wt?Wt.iterator:t,ue=Wt?Wt.toStringTag:t,ce=function(){try{var t=ho(Tt,"defineProperty");return t({},"",{}),t}catch(t){}}(),de=wt.clearTimeout!==he.clearTimeout&&wt.clearTimeout,fe=kt&&kt.now!==he.Date.now&&kt.now,me=wt.setTimeout!==he.setTimeout&&wt.setTimeout,ge=Et.ceil,Le=Et.floor,We=Tt.getOwnPropertySymbols,pn=Pt?Pt.isBuffer:t,mn=wt.isFinite,gn=$t.join,yn=sn(Tt.keys,Tt),vn=Et.max,bn=Et.min,wn=kt.now,xn=wt.parseInt,_n=Et.random,kn=$t.reverse,Cn=ho(wt,"DataView"),Sn=ho(wt,"Map"),En=ho(wt,"Promise"),Tn=ho(wt,"Set"),Mn=ho(wt,"WeakMap"),An=ho(Tt,"create"),Dn=Mn&&new Mn,$n={},zn=jo(Cn),In=jo(Sn),On=jo(En),Fn=jo(Tn),Ln=jo(Mn),Bn=Wt?Wt.prototype:t,jn=Bn?Bn.valueOf:t,Rn=Bn?Bn.toString:t;function Nn(t){if(ea(t)&&!Ws(t)&&!(t instanceof Wn)){if(t instanceof Pn)return t;if(Lt.call(t,"__wrapped__"))return Ro(t)}return new Pn(t)}var Hn=function(){function e(){}return function(n){if(!ta(n))return{};if(Vt)return Vt(n);e.prototype=n;var r=new e;return e.prototype=t,r}}();function qn(){}function Pn(e,n){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=t}function Wn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Yn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Un(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Xn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Vn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Xn;++e<n;)this.add(t[e])}function Gn(t){var e=this.__data__=new Un(t);this.size=e.size}function Kn(t,e){var n=Ws(t),r=!n&&Ps(t),i=!n&&!r&&Vs(t),o=!n&&!r&&!i&&ua(t),s=n||r||i||o,a=s?Xe(t.length,At):[],l=a.length;for(var u in t)!e&&!Lt.call(t,u)||s&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||bo(u,l))||a.push(u);return a}function Zn(e){var n=e.length;return n?e[Vr(0,n-1)]:t}function Jn(t,e){return Fo(Ai(t),ar(e,0,t.length))}function Qn(t){return Fo(Ai(t))}function tr(e,n,r){(r!==t&&!Ns(e[n],r)||r===t&&!(n in e))&&or(e,n,r)}function er(e,n,r){var i=e[n];Lt.call(e,n)&&Ns(i,r)&&(r!==t||n in e)||or(e,n,r)}function nr(t,e){for(var n=t.length;n--;)if(Ns(t[n][0],e))return n;return-1}function rr(t,e,n,r){return dr(t,(function(t,i,o){e(r,t,n(t),o)})),r}function ir(t,e){return t&&Di(e,$a(e),t)}function or(t,e,n){"__proto__"==e&&ce?ce(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function sr(e,n){for(var r=-1,i=n.length,o=_t(i),s=null==e;++r<i;)o[r]=s?t:Ea(e,n[r]);return o}function ar(e,n,r){return e==e&&(r!==t&&(e=e<=r?e:r),n!==t&&(e=e>=n?e:n)),e}function lr(e,n,r,i,o,s){var a,l=1&n,u=2&n,c=4&n;if(r&&(a=o?r(e,i,o,s):r(e)),a!==t)return a;if(!ta(e))return e;var h=Ws(e);if(h){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Lt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(e),!l)return Ai(e,a)}else{var d=mo(e),f=d==b||d==w;if(Vs(e))return ki(e,l);if(d==k||d==p||f&&!o){if(a=u||f?{}:yo(e),!l)return u?function(t,e){return Di(t,po(t),e)}(e,function(t,e){return t&&Di(e,za(e),t)}(a,e)):function(t,e){return Di(t,fo(t),e)}(e,ir(a,e))}else{if(!oe[d])return o?e:{};a=function(t,e,n){var r,i=t.constructor;switch(e){case D:return Ci(t);case g:case y:return new i(+t);case $:return function(t,e){var n=e?Ci(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case z:case I:case O:case F:case L:case B:case j:case R:case N:return Si(t,n);case x:return new i;case _:case T:return new i(t);case S:return function(t){var e=new t.constructor(t.source,ht.exec(t));return e.lastIndex=t.lastIndex,e}(t);case E:return new i;case M:return r=t,jn?Tt(jn.call(r)):{}}}(e,d,l)}}s||(s=new Gn);var m=s.get(e);if(m)return m;s.set(e,a),sa(e)?e.forEach((function(t){a.add(lr(t,n,r,t,e,s))})):na(e)&&e.forEach((function(t,i){a.set(i,lr(t,n,r,i,e,s))}));var v=h?t:(c?u?io:ro:u?za:$a)(e);return Se(v||e,(function(t,i){v&&(t=e[i=t]),er(a,i,lr(t,n,r,i,e,s))})),a}function ur(e,n,r){var i=r.length;if(null==e)return!i;for(e=Tt(e);i--;){var o=r[i],s=n[o],a=e[o];if(a===t&&!(o in e)||!s(a))return!1}return!0}function cr(n,r,i){if("function"!=typeof n)throw new Dt(e);return $o((function(){n.apply(t,i)}),r)}function hr(t,e,n,r){var i=-1,o=Ae,s=!0,a=t.length,l=[],u=e.length;if(!a)return l;n&&(e=$e(e,Ge(n))),r?(o=De,s=!1):e.length>=200&&(o=Ze,s=!1,e=new Vn(e));t:for(;++i<a;){var c=t[i],h=null==n?c:n(c);if(c=r||0!==c?c:0,s&&h==h){for(var d=u;d--;)if(e[d]===h)continue t;l.push(c)}else o(e,h,r)||l.push(c)}return l}Nn.templateSettings={escape:V,evaluate:G,interpolate:K,variable:"",imports:{_:Nn}},Nn.prototype=qn.prototype,Nn.prototype.constructor=Nn,Pn.prototype=Hn(qn.prototype),Pn.prototype.constructor=Pn,Wn.prototype=Hn(qn.prototype),Wn.prototype.constructor=Wn,Yn.prototype.clear=function(){this.__data__=An?An(null):{},this.size=0},Yn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Yn.prototype.get=function(e){var r=this.__data__;if(An){var i=r[e];return i===n?t:i}return Lt.call(r,e)?r[e]:t},Yn.prototype.has=function(e){var n=this.__data__;return An?n[e]!==t:Lt.call(n,e)},Yn.prototype.set=function(e,r){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=An&&r===t?n:r,this},Un.prototype.clear=function(){this.__data__=[],this.size=0},Un.prototype.delete=function(t){var e=this.__data__,n=nr(e,t);return!(n<0||(n==e.length-1?e.pop():Jt.call(e,n,1),--this.size,0))},Un.prototype.get=function(e){var n=this.__data__,r=nr(n,e);return r<0?t:n[r][1]},Un.prototype.has=function(t){return nr(this.__data__,t)>-1},Un.prototype.set=function(t,e){var n=this.__data__,r=nr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Xn.prototype.clear=function(){this.size=0,this.__data__={hash:new Yn,map:new(Sn||Un),string:new Yn}},Xn.prototype.delete=function(t){var e=uo(this,t).delete(t);return this.size-=e?1:0,e},Xn.prototype.get=function(t){return uo(this,t).get(t)},Xn.prototype.has=function(t){return uo(this,t).has(t)},Xn.prototype.set=function(t,e){var n=uo(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Vn.prototype.add=Vn.prototype.push=function(t){return this.__data__.set(t,n),this},Vn.prototype.has=function(t){return this.__data__.has(t)},Gn.prototype.clear=function(){this.__data__=new Un,this.size=0},Gn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Gn.prototype.get=function(t){return this.__data__.get(t)},Gn.prototype.has=function(t){return this.__data__.has(t)},Gn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Un){var r=n.__data__;if(!Sn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Xn(r)}return n.set(t,e),this.size=n.size,this};var dr=Ii(wr),fr=Ii(xr,!0);function pr(t,e){var n=!0;return dr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function mr(e,n,r){for(var i=-1,o=e.length;++i<o;){var s=e[i],a=n(s);if(null!=a&&(l===t?a==a&&!la(a):r(a,l)))var l=a,u=s}return u}function gr(t,e){var n=[];return dr(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function yr(t,e,n,r,i){var o=-1,s=t.length;for(n||(n=vo),i||(i=[]);++o<s;){var a=t[o];e>0&&n(a)?e>1?yr(a,e-1,n,r,i):ze(i,a):r||(i[i.length]=a)}return i}var vr=Oi(),br=Oi(!0);function wr(t,e){return t&&vr(t,e,$a)}function xr(t,e){return t&&br(t,e,$a)}function _r(t,e){return Me(e,(function(e){return Zs(t[e])}))}function kr(e,n){for(var r=0,i=(n=bi(n,e)).length;null!=e&&r<i;)e=e[Bo(n[r++])];return r&&r==i?e:t}function Cr(t,e,n){var r=e(t);return Ws(t)?r:ze(r,n(t))}function Sr(e){return null==e?e===t?"[object Undefined]":"[object Null]":ue&&ue in Tt(e)?function(e){var n=Lt.call(e,ue),r=e[ue];try{e[ue]=t;var i=!0}catch(t){}var o=Rt.call(e);return i&&(n?e[ue]=r:delete e[ue]),o}(e):function(t){return Rt.call(t)}(e)}function Er(t,e){return t>e}function Tr(t,e){return null!=t&&Lt.call(t,e)}function Mr(t,e){return null!=t&&e in Tt(t)}function Ar(e,n,r){for(var i=r?De:Ae,o=e[0].length,s=e.length,a=s,l=_t(s),u=1/0,c=[];a--;){var h=e[a];a&&n&&(h=$e(h,Ge(n))),u=bn(h.length,u),l[a]=!r&&(n||o>=120&&h.length>=120)?new Vn(a&&h):t}h=e[0];var d=-1,f=l[0];t:for(;++d<o&&c.length<u;){var p=h[d],m=n?n(p):p;if(p=r||0!==p?p:0,!(f?Ze(f,m):i(c,m,r))){for(a=s;--a;){var g=l[a];if(!(g?Ze(g,m):i(e[a],m,r)))continue t}f&&f.push(m),c.push(p)}}return c}function Dr(e,n,r){var i=null==(e=Mo(e,n=bi(n,e)))?e:e[Bo(Ko(n))];return null==i?t:ke(i,e,r)}function $r(t){return ea(t)&&Sr(t)==p}function zr(e,n,r,i,o){return e===n||(null==e||null==n||!ea(e)&&!ea(n)?e!=e&&n!=n:function(e,n,r,i,o,s){var a=Ws(e),l=Ws(n),u=a?m:mo(e),c=l?m:mo(n),h=(u=u==p?k:u)==k,d=(c=c==p?k:c)==k,f=u==c;if(f&&Vs(e)){if(!Vs(n))return!1;a=!0,h=!1}if(f&&!h)return s||(s=new Gn),a||ua(e)?eo(e,n,r,i,o,s):function(t,e,n,r,i,o,s){switch(n){case $:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case D:return!(t.byteLength!=e.byteLength||!o(new Yt(t),new Yt(e)));case g:case y:case _:return Ns(+t,+e);case v:return t.name==e.name&&t.message==e.message;case S:case T:return t==e+"";case x:var a=on;case E:var l=1&r;if(a||(a=ln),t.size!=e.size&&!l)return!1;var u=s.get(t);if(u)return u==e;r|=2,s.set(t,e);var c=eo(a(t),a(e),r,i,o,s);return s.delete(t),c;case M:if(jn)return jn.call(t)==jn.call(e)}return!1}(e,n,u,r,i,o,s);if(!(1&r)){var b=h&&Lt.call(e,"__wrapped__"),w=d&&Lt.call(n,"__wrapped__");if(b||w){var C=b?e.value():e,A=w?n.value():n;return s||(s=new Gn),o(C,A,r,i,s)}}return!!f&&(s||(s=new Gn),function(e,n,r,i,o,s){var a=1&r,l=ro(e),u=l.length,c=ro(n),h=c.length;if(u!=h&&!a)return!1;for(var d=u;d--;){var f=l[d];if(!(a?f in n:Lt.call(n,f)))return!1}var p=s.get(e),m=s.get(n);if(p&&m)return p==n&&m==e;var g=!0;s.set(e,n),s.set(n,e);for(var y=a;++d<u;){var v=e[f=l[d]],b=n[f];if(i)var w=a?i(b,v,f,n,e,s):i(v,b,f,e,n,s);if(!(w===t?v===b||o(v,b,r,i,s):w)){g=!1;break}y||(y="constructor"==f)}if(g&&!y){var x=e.constructor,_=n.constructor;x==_||!("constructor"in e)||!("constructor"in n)||"function"==typeof x&&x instanceof x&&"function"==typeof _&&_ instanceof _||(g=!1)}return s.delete(e),s.delete(n),g}(e,n,r,i,o,s))}(e,n,r,i,zr,o))}function Ir(e,n,r,i){var o=r.length,s=o,a=!i;if(null==e)return!s;for(e=Tt(e);o--;){var l=r[o];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<s;){var u=(l=r[o])[0],c=e[u],h=l[1];if(a&&l[2]){if(c===t&&!(u in e))return!1}else{var d=new Gn;if(i)var f=i(c,h,u,e,n,d);if(!(f===t?zr(h,c,3,i,d):f))return!1}}return!0}function Or(t){return!(!ta(t)||function(t){return!!jt&&jt in t}(t))&&(Zs(t)?qt:pt).test(jo(t))}function Fr(t){return"function"==typeof t?t:null==t?rl:"object"==typeof t?Ws(t)?Hr(t[0],t[1]):Nr(t):dl(t)}function Lr(t){if(!Co(t))return yn(t);var e=[];for(var n in Tt(t))Lt.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Br(t){if(!ta(t))return function(t){var e=[];if(null!=t)for(var n in Tt(t))e.push(n);return e}(t);var e=Co(t),n=[];for(var r in t)("constructor"!=r||!e&&Lt.call(t,r))&&n.push(r);return n}function jr(t,e){return t<e}function Rr(t,e){var n=-1,r=Us(t)?_t(t.length):[];return dr(t,(function(t,i,o){r[++n]=e(t,i,o)})),r}function Nr(t){var e=co(t);return 1==e.length&&e[0][2]?Eo(e[0][0],e[0][1]):function(n){return n===t||Ir(n,t,e)}}function Hr(e,n){return xo(e)&&So(n)?Eo(Bo(e),n):function(r){var i=Ea(r,e);return i===t&&i===n?Ta(r,e):zr(n,i,3)}}function qr(e,n,r,i,o){e!==n&&vr(n,(function(s,a){if(o||(o=new Gn),ta(s))!function(e,n,r,i,o,s,a){var l=Ao(e,r),u=Ao(n,r),c=a.get(u);if(c)tr(e,r,c);else{var h=s?s(l,u,r+"",e,n,a):t,d=h===t;if(d){var f=Ws(u),p=!f&&Vs(u),m=!f&&!p&&ua(u);h=u,f||p||m?Ws(l)?h=l:Xs(l)?h=Ai(l):p?(d=!1,h=ki(u,!0)):m?(d=!1,h=Si(u,!0)):h=[]:ia(u)||Ps(u)?(h=l,Ps(l)?h=ya(l):ta(l)&&!Zs(l)||(h=yo(u))):d=!1}d&&(a.set(u,h),o(h,u,i,s,a),a.delete(u)),tr(e,r,h)}}(e,n,a,r,qr,i,o);else{var l=i?i(Ao(e,a),s,a+"",e,n,o):t;l===t&&(l=s),tr(e,a,l)}}),za)}function Pr(e,n){var r=e.length;if(r)return bo(n+=n<0?r:0,r)?e[n]:t}function Wr(t,e,n){e=e.length?$e(e,(function(t){return Ws(t)?function(e){return kr(e,1===t.length?t[0]:t)}:t})):[rl];var r=-1;return e=$e(e,Ge(lo())),function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(Rr(t,(function(t,n,i){return{criteria:$e(e,(function(e){return e(t)})),index:++r,value:t}})),(function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,s=i.length,a=n.length;++r<s;){var l=Ei(i[r],o[r]);if(l)return r>=a?l:l*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function Yr(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var s=e[r],a=kr(t,s);n(a,s)&&Qr(o,bi(s,t),a)}return o}function Ur(t,e,n,r){var i=r?Ne:Re,o=-1,s=e.length,a=t;for(t===e&&(e=Ai(e)),n&&(a=$e(t,Ge(n)));++o<s;)for(var l=0,u=e[o],c=n?n(u):u;(l=i(a,c,l,r))>-1;)a!==t&&Jt.call(a,l,1),Jt.call(t,l,1);return t}function Xr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;bo(i)?Jt.call(t,i,1):hi(t,i)}}return t}function Vr(t,e){return t+Le(_n()*(e-t+1))}function Gr(t,e){var n="";if(!t||e<1||e>c)return n;do{e%2&&(n+=t),(e=Le(e/2))&&(t+=t)}while(e);return n}function Kr(t,e){return zo(To(t,e,rl),t+"")}function Zr(t){return Zn(Na(t))}function Jr(t,e){var n=Na(t);return Fo(n,ar(e,0,n.length))}function Qr(e,n,r,i){if(!ta(e))return e;for(var o=-1,s=(n=bi(n,e)).length,a=s-1,l=e;null!=l&&++o<s;){var u=Bo(n[o]),c=r;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(o!=a){var h=l[u];(c=i?i(h,u,l):t)===t&&(c=ta(h)?h:bo(n[o+1])?[]:{})}er(l,u,c),l=l[u]}return e}var ti=Dn?function(t,e){return Dn.set(t,e),t}:rl,ei=ce?function(t,e){return ce(t,"toString",{configurable:!0,enumerable:!1,value:tl(e),writable:!0})}:rl;function ni(t){return Fo(Na(t))}function ri(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=_t(i);++r<i;)o[r]=t[r+e];return o}function ii(t,e){var n;return dr(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function oi(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var o=r+i>>>1,s=t[o];null!==s&&!la(s)&&(n?s<=e:s<e)?r=o+1:i=o}return i}return si(t,e,rl,n)}function si(e,n,r,i){var o=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(n=r(n))!=n,l=null===n,u=la(n),c=n===t;o<s;){var h=Le((o+s)/2),d=r(e[h]),f=d!==t,p=null===d,m=d==d,g=la(d);if(a)var y=i||m;else y=c?m&&(i||f):l?m&&f&&(i||!p):u?m&&f&&!p&&(i||!g):!p&&!g&&(i?d<=n:d<n);y?o=h+1:s=h}return bn(s,4294967294)}function ai(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var s=t[n],a=e?e(s):s;if(!n||!Ns(a,l)){var l=a;o[i++]=0===s?0:s}}return o}function li(t){return"number"==typeof t?t:la(t)?h:+t}function ui(t){if("string"==typeof t)return t;if(Ws(t))return $e(t,ui)+"";if(la(t))return Rn?Rn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ci(t,e,n){var r=-1,i=Ae,o=t.length,s=!0,a=[],l=a;if(n)s=!1,i=De;else if(o>=200){var u=e?null:Gi(t);if(u)return ln(u);s=!1,i=Ze,l=new Vn}else l=e?[]:a;t:for(;++r<o;){var c=t[r],h=e?e(c):c;if(c=n||0!==c?c:0,s&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue t;e&&l.push(h),a.push(c)}else i(l,h,n)||(l!==a&&l.push(h),a.push(c))}return a}function hi(t,e){return null==(t=Mo(t,e=bi(e,t)))||delete t[Bo(Ko(e))]}function di(t,e,n,r){return Qr(t,e,n(kr(t,e)),r)}function fi(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?ri(t,r?0:o,r?o+1:i):ri(t,r?o+1:0,r?i:o)}function pi(t,e){var n=t;return n instanceof Wn&&(n=n.value()),Ie(e,(function(t,e){return e.func.apply(e.thisArg,ze([t],e.args))}),n)}function mi(t,e,n){var r=t.length;if(r<2)return r?ci(t[0]):[];for(var i=-1,o=_t(r);++i<r;)for(var s=t[i],a=-1;++a<r;)a!=i&&(o[i]=hr(o[i]||s,t[a],e,n));return ci(yr(o,1),e,n)}function gi(e,n,r){for(var i=-1,o=e.length,s=n.length,a={};++i<o;){var l=i<s?n[i]:t;r(a,e[i],l)}return a}function yi(t){return Xs(t)?t:[]}function vi(t){return"function"==typeof t?t:rl}function bi(t,e){return Ws(t)?t:xo(t,e)?[t]:Lo(va(t))}var wi=Kr;function xi(e,n,r){var i=e.length;return r=r===t?i:r,!n&&r>=i?e:ri(e,n,r)}var _i=de||function(t){return he.clearTimeout(t)};function ki(t,e){if(e)return t.slice();var n=t.length,r=Ut?Ut(n):new t.constructor(n);return t.copy(r),r}function Ci(t){var e=new t.constructor(t.byteLength);return new Yt(e).set(new Yt(t)),e}function Si(t,e){var n=e?Ci(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Ei(e,n){if(e!==n){var r=e!==t,i=null===e,o=e==e,s=la(e),a=n!==t,l=null===n,u=n==n,c=la(n);if(!l&&!c&&!s&&e>n||s&&a&&u&&!l&&!c||i&&a&&u||!r&&u||!o)return 1;if(!i&&!s&&!c&&e<n||c&&r&&o&&!i&&!s||l&&r&&o||!a&&o||!u)return-1}return 0}function Ti(t,e,n,r){for(var i=-1,o=t.length,s=n.length,a=-1,l=e.length,u=vn(o-s,0),c=_t(l+u),h=!r;++a<l;)c[a]=e[a];for(;++i<s;)(h||i<o)&&(c[n[i]]=t[i]);for(;u--;)c[a++]=t[i++];return c}function Mi(t,e,n,r){for(var i=-1,o=t.length,s=-1,a=n.length,l=-1,u=e.length,c=vn(o-a,0),h=_t(c+u),d=!r;++i<c;)h[i]=t[i];for(var f=i;++l<u;)h[f+l]=e[l];for(;++s<a;)(d||i<o)&&(h[f+n[s]]=t[i++]);return h}function Ai(t,e){var n=-1,r=t.length;for(e||(e=_t(r));++n<r;)e[n]=t[n];return e}function Di(e,n,r,i){var o=!r;r||(r={});for(var s=-1,a=n.length;++s<a;){var l=n[s],u=i?i(r[l],e[l],l,r,e):t;u===t&&(u=e[l]),o?or(r,l,u):er(r,l,u)}return r}function $i(t,e){return function(n,r){var i=Ws(n)?Ce:rr,o=e?e():{};return i(n,t,lo(r,2),o)}}function zi(e){return Kr((function(n,r){var i=-1,o=r.length,s=o>1?r[o-1]:t,a=o>2?r[2]:t;for(s=e.length>3&&"function"==typeof s?(o--,s):t,a&&wo(r[0],r[1],a)&&(s=o<3?t:s,o=1),n=Tt(n);++i<o;){var l=r[i];l&&e(n,l,i,s)}return n}))}function Ii(t,e){return function(n,r){if(null==n)return n;if(!Us(n))return t(n,r);for(var i=n.length,o=e?i:-1,s=Tt(n);(e?o--:++o<i)&&!1!==r(s[o],o,s););return n}}function Oi(t){return function(e,n,r){for(var i=-1,o=Tt(e),s=r(e),a=s.length;a--;){var l=s[t?a:++i];if(!1===n(o[l],l,o))break}return e}}function Fi(e){return function(n){var r=rn(n=va(n))?cn(n):t,i=r?r[0]:n.charAt(0),o=r?xi(r,1).join(""):n.slice(1);return i[e]()+o}}function Li(t){return function(e){return Ie(Za(Pa(e).replace(Kt,"")),t,"")}}function Bi(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Hn(t.prototype),r=t.apply(n,e);return ta(r)?r:n}}function ji(e){return function(n,r,i){var o=Tt(n);if(!Us(n)){var s=lo(r,3);n=$a(n),r=function(t){return s(o[t],t,o)}}var a=e(n,r,i);return a>-1?o[s?n[a]:a]:t}}function Ri(n){return no((function(r){var i=r.length,o=i,s=Pn.prototype.thru;for(n&&r.reverse();o--;){var a=r[o];if("function"!=typeof a)throw new Dt(e);if(s&&!l&&"wrapper"==so(a))var l=new Pn([],!0)}for(o=l?o:i;++o<i;){var u=so(a=r[o]),c="wrapper"==u?oo(a):t;l=c&&_o(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?l[so(c[0])].apply(l,c[3]):1==a.length&&_o(a)?l[u]():l.thru(a)}return function(){var t=arguments,e=t[0];if(l&&1==t.length&&Ws(e))return l.plant(e).value();for(var n=0,o=i?r[n].apply(this,t):e;++n<i;)o=r[n].call(this,o);return o}}))}function Ni(e,n,r,i,o,s,l,u,c,h){var d=n&a,f=1&n,p=2&n,m=24&n,g=512&n,y=p?t:Bi(e);return function a(){for(var v=arguments.length,b=_t(v),w=v;w--;)b[w]=arguments[w];if(m)var x=ao(a),_=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(b,x);if(i&&(b=Ti(b,i,o,m)),s&&(b=Mi(b,s,l,m)),v-=_,m&&v<h){var k=an(b,x);return Xi(e,n,Ni,a.placeholder,r,b,k,u,c,h-v)}var C=f?r:this,S=p?C[e]:e;return v=b.length,u?b=function(e,n){for(var r=e.length,i=bn(n.length,r),o=Ai(e);i--;){var s=n[i];e[i]=bo(s,r)?o[s]:t}return e}(b,u):g&&v>1&&b.reverse(),d&&c<v&&(b.length=c),this&&this!==he&&this instanceof a&&(S=y||Bi(S)),S.apply(C,b)}}function Hi(t,e){return function(n,r){return function(t,e,n,r){return wr(t,(function(t,i,o){e(r,n(t),i,o)})),r}(n,t,e(r),{})}}function qi(e,n){return function(r,i){var o;if(r===t&&i===t)return n;if(r!==t&&(o=r),i!==t){if(o===t)return i;"string"==typeof r||"string"==typeof i?(r=ui(r),i=ui(i)):(r=li(r),i=li(i)),o=e(r,i)}return o}}function Pi(t){return no((function(e){return e=$e(e,Ge(lo())),Kr((function(n){var r=this;return t(e,(function(t){return ke(t,r,n)}))}))}))}function Wi(e,n){var r=(n=n===t?" ":ui(n)).length;if(r<2)return r?Gr(n,e):n;var i=Gr(n,ge(e/un(n)));return rn(n)?xi(cn(i),0,e).join(""):i.slice(0,e)}function Yi(e){return function(n,r,i){return i&&"number"!=typeof i&&wo(n,r,i)&&(r=i=t),n=fa(n),r===t?(r=n,n=0):r=fa(r),function(t,e,n,r){for(var i=-1,o=vn(ge((e-t)/(n||1)),0),s=_t(o);o--;)s[r?o:++i]=t,t+=n;return s}(n,r,i=i===t?n<r?1:-1:fa(i),e)}}function Ui(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=ga(e),n=ga(n)),t(e,n)}}function Xi(e,n,r,i,a,l,u,c,h,d){var f=8&n;n|=f?o:s,4&(n&=~(f?s:o))||(n&=-4);var p=[e,n,a,f?l:t,f?u:t,f?t:l,f?t:u,c,h,d],m=r.apply(t,p);return _o(e)&&Do(m,p),m.placeholder=i,Io(m,e,n)}function Vi(t){var e=Et[t];return function(t,n){if(t=ga(t),(n=null==n?0:bn(pa(n),292))&&mn(t)){var r=(va(t)+"e").split("e");return+((r=(va(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Gi=Tn&&1/ln(new Tn([,-0]))[1]==u?function(t){return new Tn(t)}:ll;function Ki(t){return function(e){var n=mo(e);return n==x?on(e):n==E?function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}(e):function(t,e){return $e(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Zi(n,u,c,h,d,f,p,m){var g=2&u;if(!g&&"function"!=typeof n)throw new Dt(e);var y=h?h.length:0;if(y||(u&=-97,h=d=t),p=p===t?p:vn(pa(p),0),m=m===t?m:pa(m),y-=d?d.length:0,u&s){var v=h,b=d;h=d=t}var w=g?t:oo(n),x=[n,u,c,h,d,v,b,f,p,m];if(w&&function(t,e){var n=t[1],i=e[1],o=n|i,s=o<131,u=i==a&&8==n||i==a&&n==l&&t[7].length<=e[8]||384==i&&e[7].length<=e[8]&&8==n;if(!s&&!u)return t;1&i&&(t[2]=e[2],o|=1&n?0:4);var c=e[3];if(c){var h=t[3];t[3]=h?Ti(h,c,e[4]):c,t[4]=h?an(t[3],r):e[4]}(c=e[5])&&(h=t[5],t[5]=h?Mi(h,c,e[6]):c,t[6]=h?an(t[5],r):e[6]),(c=e[7])&&(t[7]=c),i&a&&(t[8]=null==t[8]?e[8]:bn(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=o}(x,w),n=x[0],u=x[1],c=x[2],h=x[3],d=x[4],!(m=x[9]=x[9]===t?g?0:n.length:vn(x[9]-y,0))&&24&u&&(u&=-25),u&&1!=u)_=8==u||u==i?function(e,n,r){var i=Bi(e);return function o(){for(var s=arguments.length,a=_t(s),l=s,u=ao(o);l--;)a[l]=arguments[l];var c=s<3&&a[0]!==u&&a[s-1]!==u?[]:an(a,u);return(s-=c.length)<r?Xi(e,n,Ni,o.placeholder,t,a,c,t,t,r-s):ke(this&&this!==he&&this instanceof o?i:e,this,a)}}(n,u,m):u!=o&&33!=u||d.length?Ni.apply(t,x):function(t,e,n,r){var i=1&e,o=Bi(t);return function e(){for(var s=-1,a=arguments.length,l=-1,u=r.length,c=_t(u+a),h=this&&this!==he&&this instanceof e?o:t;++l<u;)c[l]=r[l];for(;a--;)c[l++]=arguments[++s];return ke(h,i?n:this,c)}}(n,u,c,h);else var _=function(t,e,n){var r=1&e,i=Bi(t);return function e(){return(this&&this!==he&&this instanceof e?i:t).apply(r?n:this,arguments)}}(n,u,c);return Io((w?ti:Do)(_,x),n,u)}function Ji(e,n,r,i){return e===t||Ns(e,It[r])&&!Lt.call(i,r)?n:e}function Qi(e,n,r,i,o,s){return ta(e)&&ta(n)&&(s.set(n,e),qr(e,n,t,Qi,s),s.delete(n)),e}function to(e){return ia(e)?t:e}function eo(e,n,r,i,o,s){var a=1&r,l=e.length,u=n.length;if(l!=u&&!(a&&u>l))return!1;var c=s.get(e),h=s.get(n);if(c&&h)return c==n&&h==e;var d=-1,f=!0,p=2&r?new Vn:t;for(s.set(e,n),s.set(n,e);++d<l;){var m=e[d],g=n[d];if(i)var y=a?i(g,m,d,n,e,s):i(m,g,d,e,n,s);if(y!==t){if(y)continue;f=!1;break}if(p){if(!Fe(n,(function(t,e){if(!Ze(p,e)&&(m===t||o(m,t,r,i,s)))return p.push(e)}))){f=!1;break}}else if(m!==g&&!o(m,g,r,i,s)){f=!1;break}}return s.delete(e),s.delete(n),f}function no(e){return zo(To(e,t,Yo),e+"")}function ro(t){return Cr(t,$a,fo)}function io(t){return Cr(t,za,po)}var oo=Dn?function(t){return Dn.get(t)}:ll;function so(t){for(var e=t.name+"",n=$n[e],r=Lt.call($n,e)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}function ao(t){return(Lt.call(Nn,"placeholder")?Nn:t).placeholder}function lo(){var t=Nn.iteratee||il;return t=t===il?Fr:t,arguments.length?t(arguments[0],arguments[1]):t}function uo(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function co(t){for(var e=$a(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,So(i)]}return e}function ho(e,n){var r=function(e,n){return null==e?t:e[n]}(e,n);return Or(r)?r:t}var fo=We?function(t){return null==t?[]:(t=Tt(t),Me(We(t),(function(e){return Gt.call(t,e)})))}:ml,po=We?function(t){for(var e=[];t;)ze(e,fo(t)),t=Xt(t);return e}:ml,mo=Sr;function go(t,e,n){for(var r=-1,i=(e=bi(e,t)).length,o=!1;++r<i;){var s=Bo(e[r]);if(!(o=null!=t&&n(t,s)))break;t=t[s]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&Qs(i)&&bo(s,i)&&(Ws(t)||Ps(t))}function yo(t){return"function"!=typeof t.constructor||Co(t)?{}:Hn(Xt(t))}function vo(t){return Ws(t)||Ps(t)||!!(te&&t&&t[te])}function bo(t,e){var n=typeof t;return!!(e=null==e?c:e)&&("number"==n||"symbol"!=n&>.test(t))&&t>-1&&t%1==0&&t<e}function wo(t,e,n){if(!ta(n))return!1;var r=typeof e;return!!("number"==r?Us(n)&&bo(e,n.length):"string"==r&&e in n)&&Ns(n[e],t)}function xo(t,e){if(Ws(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!la(t))||J.test(t)||!Z.test(t)||null!=e&&t in Tt(e)}function _o(t){var e=so(t),n=Nn[e];if("function"!=typeof n||!(e in Wn.prototype))return!1;if(t===n)return!0;var r=oo(n);return!!r&&t===r[0]}(Cn&&mo(new Cn(new ArrayBuffer(1)))!=$||Sn&&mo(new Sn)!=x||En&&mo(En.resolve())!=C||Tn&&mo(new Tn)!=E||Mn&&mo(new Mn)!=A)&&(mo=function(e){var n=Sr(e),r=n==k?e.constructor:t,i=r?jo(r):"";if(i)switch(i){case zn:return $;case In:return x;case On:return C;case Fn:return E;case Ln:return A}return n});var ko=Ot?Zs:gl;function Co(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||It)}function So(t){return t==t&&!ta(t)}function Eo(e,n){return function(r){return null!=r&&r[e]===n&&(n!==t||e in Tt(r))}}function To(e,n,r){return n=vn(n===t?e.length-1:n,0),function(){for(var t=arguments,i=-1,o=vn(t.length-n,0),s=_t(o);++i<o;)s[i]=t[n+i];i=-1;for(var a=_t(n+1);++i<n;)a[i]=t[i];return a[n]=r(s),ke(e,this,a)}}function Mo(t,e){return e.length<2?t:kr(t,ri(e,0,-1))}function Ao(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Do=Oo(ti),$o=me||function(t,e){return he.setTimeout(t,e)},zo=Oo(ei);function Io(t,e,n){var r=e+"";return zo(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(it,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Se(f,(function(n){var r="_."+n[0];e&n[1]&&!Ae(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(ot);return e?e[1].split(st):[]}(r),n)))}function Oo(e){var n=0,r=0;return function(){var i=wn(),o=16-(i-r);if(r=i,o>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(t,arguments)}}function Fo(e,n){var r=-1,i=e.length,o=i-1;for(n=n===t?i:n;++r<n;){var s=Vr(r,o),a=e[s];e[s]=e[r],e[r]=a}return e.length=n,e}var Lo=function(t){var e=Os(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Q,(function(t,n,r,i){e.push(r?i.replace(ut,"$1"):n||t)})),e}));function Bo(t){if("string"==typeof t||la(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function jo(t){if(null!=t){try{return Ft.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ro(t){if(t instanceof Wn)return t.clone();var e=new Pn(t.__wrapped__,t.__chain__);return e.__actions__=Ai(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var No=Kr((function(t,e){return Xs(t)?hr(t,yr(e,1,Xs,!0)):[]})),Ho=Kr((function(e,n){var r=Ko(n);return Xs(r)&&(r=t),Xs(e)?hr(e,yr(n,1,Xs,!0),lo(r,2)):[]})),qo=Kr((function(e,n){var r=Ko(n);return Xs(r)&&(r=t),Xs(e)?hr(e,yr(n,1,Xs,!0),t,r):[]}));function Po(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:pa(n);return i<0&&(i=vn(r+i,0)),je(t,lo(e,3),i)}function Wo(e,n,r){var i=null==e?0:e.length;if(!i)return-1;var o=i-1;return r!==t&&(o=pa(r),o=r<0?vn(i+o,0):bn(o,i-1)),je(e,lo(n,3),o,!0)}function Yo(t){return null!=t&&t.length?yr(t,1):[]}function Uo(e){return e&&e.length?e[0]:t}var Xo=Kr((function(t){var e=$e(t,yi);return e.length&&e[0]===t[0]?Ar(e):[]})),Vo=Kr((function(e){var n=Ko(e),r=$e(e,yi);return n===Ko(r)?n=t:r.pop(),r.length&&r[0]===e[0]?Ar(r,lo(n,2)):[]})),Go=Kr((function(e){var n=Ko(e),r=$e(e,yi);return(n="function"==typeof n?n:t)&&r.pop(),r.length&&r[0]===e[0]?Ar(r,t,n):[]}));function Ko(e){var n=null==e?0:e.length;return n?e[n-1]:t}var Zo=Kr(Jo);function Jo(t,e){return t&&t.length&&e&&e.length?Ur(t,e):t}var Qo=no((function(t,e){var n=null==t?0:t.length,r=sr(t,e);return Xr(t,$e(e,(function(t){return bo(t,n)?+t:t})).sort(Ei)),r}));function ts(t){return null==t?t:kn.call(t)}var es=Kr((function(t){return ci(yr(t,1,Xs,!0))})),ns=Kr((function(e){var n=Ko(e);return Xs(n)&&(n=t),ci(yr(e,1,Xs,!0),lo(n,2))})),rs=Kr((function(e){var n=Ko(e);return n="function"==typeof n?n:t,ci(yr(e,1,Xs,!0),t,n)}));function is(t){if(!t||!t.length)return[];var e=0;return t=Me(t,(function(t){if(Xs(t))return e=vn(t.length,e),!0})),Xe(e,(function(e){return $e(t,Pe(e))}))}function os(e,n){if(!e||!e.length)return[];var r=is(e);return null==n?r:$e(r,(function(e){return ke(n,t,e)}))}var ss=Kr((function(t,e){return Xs(t)?hr(t,e):[]})),as=Kr((function(t){return mi(Me(t,Xs))})),ls=Kr((function(e){var n=Ko(e);return Xs(n)&&(n=t),mi(Me(e,Xs),lo(n,2))})),us=Kr((function(e){var n=Ko(e);return n="function"==typeof n?n:t,mi(Me(e,Xs),t,n)})),cs=Kr(is),hs=Kr((function(e){var n=e.length,r=n>1?e[n-1]:t;return r="function"==typeof r?(e.pop(),r):t,os(e,r)}));function ds(t){var e=Nn(t);return e.__chain__=!0,e}function fs(t,e){return e(t)}var ps=no((function(e){var n=e.length,r=n?e[0]:0,i=this.__wrapped__,o=function(t){return sr(t,e)};return!(n>1||this.__actions__.length)&&i instanceof Wn&&bo(r)?((i=i.slice(r,+r+(n?1:0))).__actions__.push({func:fs,args:[o],thisArg:t}),new Pn(i,this.__chain__).thru((function(e){return n&&!e.length&&e.push(t),e}))):this.thru(o)})),ms=$i((function(t,e,n){Lt.call(t,n)?++t[n]:or(t,n,1)})),gs=ji(Po),ys=ji(Wo);function vs(t,e){return(Ws(t)?Se:dr)(t,lo(e,3))}function bs(t,e){return(Ws(t)?Ee:fr)(t,lo(e,3))}var ws=$i((function(t,e,n){Lt.call(t,n)?t[n].push(e):or(t,n,[e])})),xs=Kr((function(t,e,n){var r=-1,i="function"==typeof e,o=Us(t)?_t(t.length):[];return dr(t,(function(t){o[++r]=i?ke(e,t,n):Dr(t,e,n)})),o})),_s=$i((function(t,e,n){or(t,n,e)}));function ks(t,e){return(Ws(t)?$e:Rr)(t,lo(e,3))}var Cs=$i((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),Ss=Kr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&wo(t,e[0],e[1])?e=[]:n>2&&wo(e[0],e[1],e[2])&&(e=[e[0]]),Wr(t,yr(e,1),[])})),Es=fe||function(){return he.Date.now()};function Ts(e,n,r){return n=r?t:n,n=e&&null==n?e.length:n,Zi(e,a,t,t,t,t,n)}function Ms(n,r){var i;if("function"!=typeof r)throw new Dt(e);return n=pa(n),function(){return--n>0&&(i=r.apply(this,arguments)),n<=1&&(r=t),i}}var As=Kr((function(t,e,n){var r=1;if(n.length){var i=an(n,ao(As));r|=o}return Zi(t,r,e,n,i)})),Ds=Kr((function(t,e,n){var r=3;if(n.length){var i=an(n,ao(Ds));r|=o}return Zi(e,r,t,n,i)}));function $s(n,r,i){var o,s,a,l,u,c,h=0,d=!1,f=!1,p=!0;if("function"!=typeof n)throw new Dt(e);function m(e){var r=o,i=s;return o=s=t,h=e,l=n.apply(i,r)}function g(e){var n=e-c;return c===t||n>=r||n<0||f&&e-h>=a}function y(){var t=Es();if(g(t))return v(t);u=$o(y,function(t){var e=r-(t-c);return f?bn(e,a-(t-h)):e}(t))}function v(e){return u=t,p&&o?m(e):(o=s=t,l)}function b(){var e=Es(),n=g(e);if(o=arguments,s=this,c=e,n){if(u===t)return function(t){return h=t,u=$o(y,r),d?m(t):l}(c);if(f)return _i(u),u=$o(y,r),m(c)}return u===t&&(u=$o(y,r)),l}return r=ga(r)||0,ta(i)&&(d=!!i.leading,a=(f="maxWait"in i)?vn(ga(i.maxWait)||0,r):a,p="trailing"in i?!!i.trailing:p),b.cancel=function(){u!==t&&_i(u),h=0,o=c=s=u=t},b.flush=function(){return u===t?l:v(Es())},b}var zs=Kr((function(t,e){return cr(t,1,e)})),Is=Kr((function(t,e,n){return cr(t,ga(e)||0,n)}));function Os(t,n){if("function"!=typeof t||null!=n&&"function"!=typeof n)throw new Dt(e);var r=function(){var e=arguments,i=n?n.apply(this,e):e[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,e);return r.cache=o.set(i,s)||o,s};return r.cache=new(Os.Cache||Xn),r}function Fs(t){if("function"!=typeof t)throw new Dt(e);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Os.Cache=Xn;var Ls=wi((function(t,e){var n=(e=1==e.length&&Ws(e[0])?$e(e[0],Ge(lo())):$e(yr(e,1),Ge(lo()))).length;return Kr((function(r){for(var i=-1,o=bn(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return ke(t,this,r)}))})),Bs=Kr((function(e,n){var r=an(n,ao(Bs));return Zi(e,o,t,n,r)})),js=Kr((function(e,n){var r=an(n,ao(js));return Zi(e,s,t,n,r)})),Rs=no((function(e,n){return Zi(e,l,t,t,t,n)}));function Ns(t,e){return t===e||t!=t&&e!=e}var Hs=Ui(Er),qs=Ui((function(t,e){return t>=e})),Ps=$r(function(){return arguments}())?$r:function(t){return ea(t)&&Lt.call(t,"callee")&&!Gt.call(t,"callee")},Ws=_t.isArray,Ys=ye?Ge(ye):function(t){return ea(t)&&Sr(t)==D};function Us(t){return null!=t&&Qs(t.length)&&!Zs(t)}function Xs(t){return ea(t)&&Us(t)}var Vs=pn||gl,Gs=ve?Ge(ve):function(t){return ea(t)&&Sr(t)==y};function Ks(t){if(!ea(t))return!1;var e=Sr(t);return e==v||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!ia(t)}function Zs(t){if(!ta(t))return!1;var e=Sr(t);return e==b||e==w||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Js(t){return"number"==typeof t&&t==pa(t)}function Qs(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=c}function ta(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ea(t){return null!=t&&"object"==typeof t}var na=be?Ge(be):function(t){return ea(t)&&mo(t)==x};function ra(t){return"number"==typeof t||ea(t)&&Sr(t)==_}function ia(t){if(!ea(t)||Sr(t)!=k)return!1;var e=Xt(t);if(null===e)return!0;var n=Lt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Ft.call(n)==Nt}var oa=we?Ge(we):function(t){return ea(t)&&Sr(t)==S},sa=xe?Ge(xe):function(t){return ea(t)&&mo(t)==E};function aa(t){return"string"==typeof t||!Ws(t)&&ea(t)&&Sr(t)==T}function la(t){return"symbol"==typeof t||ea(t)&&Sr(t)==M}var ua=_e?Ge(_e):function(t){return ea(t)&&Qs(t.length)&&!!ie[Sr(t)]},ca=Ui(jr),ha=Ui((function(t,e){return t<=e}));function da(t){if(!t)return[];if(Us(t))return aa(t)?cn(t):Ai(t);if(se&&t[se])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[se]());var e=mo(t);return(e==x?on:e==E?ln:Na)(t)}function fa(t){return t?(t=ga(t))===u||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function pa(t){var e=fa(t),n=e%1;return e==e?n?e-n:e:0}function ma(t){return t?ar(pa(t),0,d):0}function ga(t){if("number"==typeof t)return t;if(la(t))return h;if(ta(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ta(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ve(t);var n=ft.test(t);return n||mt.test(t)?le(t.slice(2),n?2:8):dt.test(t)?h:+t}function ya(t){return Di(t,za(t))}function va(t){return null==t?"":ui(t)}var ba=zi((function(t,e){if(Co(e)||Us(e))Di(e,$a(e),t);else for(var n in e)Lt.call(e,n)&&er(t,n,e[n])})),wa=zi((function(t,e){Di(e,za(e),t)})),xa=zi((function(t,e,n,r){Di(e,za(e),t,r)})),_a=zi((function(t,e,n,r){Di(e,$a(e),t,r)})),ka=no(sr),Ca=Kr((function(e,n){e=Tt(e);var r=-1,i=n.length,o=i>2?n[2]:t;for(o&&wo(n[0],n[1],o)&&(i=1);++r<i;)for(var s=n[r],a=za(s),l=-1,u=a.length;++l<u;){var c=a[l],h=e[c];(h===t||Ns(h,It[c])&&!Lt.call(e,c))&&(e[c]=s[c])}return e})),Sa=Kr((function(e){return e.push(t,Qi),ke(Oa,t,e)}));function Ea(e,n,r){var i=null==e?t:kr(e,n);return i===t?r:i}function Ta(t,e){return null!=t&&go(t,e,Mr)}var Ma=Hi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Rt.call(e)),t[e]=n}),tl(rl)),Aa=Hi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Rt.call(e)),Lt.call(t,e)?t[e].push(n):t[e]=[n]}),lo),Da=Kr(Dr);function $a(t){return Us(t)?Kn(t):Lr(t)}function za(t){return Us(t)?Kn(t,!0):Br(t)}var Ia=zi((function(t,e,n){qr(t,e,n)})),Oa=zi((function(t,e,n,r){qr(t,e,n,r)})),Fa=no((function(t,e){var n={};if(null==t)return n;var r=!1;e=$e(e,(function(e){return e=bi(e,t),r||(r=e.length>1),e})),Di(t,io(t),n),r&&(n=lr(n,7,to));for(var i=e.length;i--;)hi(n,e[i]);return n})),La=no((function(t,e){return null==t?{}:function(t,e){return Yr(t,e,(function(e,n){return Ta(t,n)}))}(t,e)}));function Ba(t,e){if(null==t)return{};var n=$e(io(t),(function(t){return[t]}));return e=lo(e),Yr(t,n,(function(t,n){return e(t,n[0])}))}var ja=Ki($a),Ra=Ki(za);function Na(t){return null==t?[]:Ke(t,$a(t))}var Ha=Li((function(t,e,n){return e=e.toLowerCase(),t+(n?qa(e):e)}));function qa(t){return Ka(va(t).toLowerCase())}function Pa(t){return(t=va(t))&&t.replace(yt,tn).replace(Zt,"")}var Wa=Li((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ya=Li((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Ua=Fi("toLowerCase"),Xa=Li((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Va=Li((function(t,e,n){return t+(n?" ":"")+Ka(e)})),Ga=Li((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Ka=Fi("toUpperCase");function Za(e,n,r){return e=va(e),(n=r?t:n)===t?function(t){return ee.test(t)}(e)?function(t){return t.match(Qt)||[]}(e):function(t){return t.match(at)||[]}(e):e.match(n)||[]}var Ja=Kr((function(e,n){try{return ke(e,t,n)}catch(t){return Ks(t)?t:new Ct(t)}})),Qa=no((function(t,e){return Se(e,(function(e){e=Bo(e),or(t,e,As(t[e],t))})),t}));function tl(t){return function(){return t}}var el=Ri(),nl=Ri(!0);function rl(t){return t}function il(t){return Fr("function"==typeof t?t:lr(t,1))}var ol=Kr((function(t,e){return function(n){return Dr(n,t,e)}})),sl=Kr((function(t,e){return function(n){return Dr(t,n,e)}}));function al(t,e,n){var r=$a(e),i=_r(e,r);null!=n||ta(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=_r(e,$a(e)));var o=!(ta(n)&&"chain"in n&&!n.chain),s=Zs(t);return Se(i,(function(n){var r=e[n];t[n]=r,s&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__);return(n.__actions__=Ai(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,ze([this.value()],arguments))})})),t}function ll(){}var ul=Pi($e),cl=Pi(Te),hl=Pi(Fe);function dl(t){return xo(t)?Pe(Bo(t)):function(t){return function(e){return kr(e,t)}}(t)}var fl=Yi(),pl=Yi(!0);function ml(){return[]}function gl(){return!1}var yl,vl=qi((function(t,e){return t+e}),0),bl=Vi("ceil"),wl=qi((function(t,e){return t/e}),1),xl=Vi("floor"),_l=qi((function(t,e){return t*e}),1),kl=Vi("round"),Cl=qi((function(t,e){return t-e}),0);return Nn.after=function(t,n){if("function"!=typeof n)throw new Dt(e);return t=pa(t),function(){if(--t<1)return n.apply(this,arguments)}},Nn.ary=Ts,Nn.assign=ba,Nn.assignIn=wa,Nn.assignInWith=xa,Nn.assignWith=_a,Nn.at=ka,Nn.before=Ms,Nn.bind=As,Nn.bindAll=Qa,Nn.bindKey=Ds,Nn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ws(t)?t:[t]},Nn.chain=ds,Nn.chunk=function(e,n,r){n=(r?wo(e,n,r):n===t)?1:vn(pa(n),0);var i=null==e?0:e.length;if(!i||n<1)return[];for(var o=0,s=0,a=_t(ge(i/n));o<i;)a[s++]=ri(e,o,o+=n);return a},Nn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i},Nn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=_t(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return ze(Ws(n)?Ai(n):[n],yr(e,1))},Nn.cond=function(t){var n=null==t?0:t.length,r=lo();return t=n?$e(t,(function(t){if("function"!=typeof t[1])throw new Dt(e);return[r(t[0]),t[1]]})):[],Kr((function(e){for(var r=-1;++r<n;){var i=t[r];if(ke(i[0],this,e))return ke(i[1],this,e)}}))},Nn.conforms=function(t){return function(t){var e=$a(t);return function(n){return ur(n,t,e)}}(lr(t,1))},Nn.constant=tl,Nn.countBy=ms,Nn.create=function(t,e){var n=Hn(t);return null==e?n:ir(n,e)},Nn.curry=function e(n,r,i){var o=Zi(n,8,t,t,t,t,t,r=i?t:r);return o.placeholder=e.placeholder,o},Nn.curryRight=function e(n,r,o){var s=Zi(n,i,t,t,t,t,t,r=o?t:r);return s.placeholder=e.placeholder,s},Nn.debounce=$s,Nn.defaults=Ca,Nn.defaultsDeep=Sa,Nn.defer=zs,Nn.delay=Is,Nn.difference=No,Nn.differenceBy=Ho,Nn.differenceWith=qo,Nn.drop=function(e,n,r){var i=null==e?0:e.length;return i?ri(e,(n=r||n===t?1:pa(n))<0?0:n,i):[]},Nn.dropRight=function(e,n,r){var i=null==e?0:e.length;return i?ri(e,0,(n=i-(n=r||n===t?1:pa(n)))<0?0:n):[]},Nn.dropRightWhile=function(t,e){return t&&t.length?fi(t,lo(e,3),!0,!0):[]},Nn.dropWhile=function(t,e){return t&&t.length?fi(t,lo(e,3),!0):[]},Nn.fill=function(e,n,r,i){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&wo(e,n,r)&&(r=0,i=o),function(e,n,r,i){var o=e.length;for((r=pa(r))<0&&(r=-r>o?0:o+r),(i=i===t||i>o?o:pa(i))<0&&(i+=o),i=r>i?0:ma(i);r<i;)e[r++]=n;return e}(e,n,r,i)):[]},Nn.filter=function(t,e){return(Ws(t)?Me:gr)(t,lo(e,3))},Nn.flatMap=function(t,e){return yr(ks(t,e),1)},Nn.flatMapDeep=function(t,e){return yr(ks(t,e),u)},Nn.flatMapDepth=function(e,n,r){return r=r===t?1:pa(r),yr(ks(e,n),r)},Nn.flatten=Yo,Nn.flattenDeep=function(t){return null!=t&&t.length?yr(t,u):[]},Nn.flattenDepth=function(e,n){return null!=e&&e.length?yr(e,n=n===t?1:pa(n)):[]},Nn.flip=function(t){return Zi(t,512)},Nn.flow=el,Nn.flowRight=nl,Nn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},Nn.functions=function(t){return null==t?[]:_r(t,$a(t))},Nn.functionsIn=function(t){return null==t?[]:_r(t,za(t))},Nn.groupBy=ws,Nn.initial=function(t){return null!=t&&t.length?ri(t,0,-1):[]},Nn.intersection=Xo,Nn.intersectionBy=Vo,Nn.intersectionWith=Go,Nn.invert=Ma,Nn.invertBy=Aa,Nn.invokeMap=xs,Nn.iteratee=il,Nn.keyBy=_s,Nn.keys=$a,Nn.keysIn=za,Nn.map=ks,Nn.mapKeys=function(t,e){var n={};return e=lo(e,3),wr(t,(function(t,r,i){or(n,e(t,r,i),t)})),n},Nn.mapValues=function(t,e){var n={};return e=lo(e,3),wr(t,(function(t,r,i){or(n,r,e(t,r,i))})),n},Nn.matches=function(t){return Nr(lr(t,1))},Nn.matchesProperty=function(t,e){return Hr(t,lr(e,1))},Nn.memoize=Os,Nn.merge=Ia,Nn.mergeWith=Oa,Nn.method=ol,Nn.methodOf=sl,Nn.mixin=al,Nn.negate=Fs,Nn.nthArg=function(t){return t=pa(t),Kr((function(e){return Pr(e,t)}))},Nn.omit=Fa,Nn.omitBy=function(t,e){return Ba(t,Fs(lo(e)))},Nn.once=function(t){return Ms(2,t)},Nn.orderBy=function(e,n,r,i){return null==e?[]:(Ws(n)||(n=null==n?[]:[n]),Ws(r=i?t:r)||(r=null==r?[]:[r]),Wr(e,n,r))},Nn.over=ul,Nn.overArgs=Ls,Nn.overEvery=cl,Nn.overSome=hl,Nn.partial=Bs,Nn.partialRight=js,Nn.partition=Cs,Nn.pick=La,Nn.pickBy=Ba,Nn.property=dl,Nn.propertyOf=function(e){return function(n){return null==e?t:kr(e,n)}},Nn.pull=Zo,Nn.pullAll=Jo,Nn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Ur(t,e,lo(n,2)):t},Nn.pullAllWith=function(e,n,r){return e&&e.length&&n&&n.length?Ur(e,n,t,r):e},Nn.pullAt=Qo,Nn.range=fl,Nn.rangeRight=pl,Nn.rearg=Rs,Nn.reject=function(t,e){return(Ws(t)?Me:gr)(t,Fs(lo(e,3)))},Nn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],o=t.length;for(e=lo(e,3);++r<o;){var s=t[r];e(s,r,t)&&(n.push(s),i.push(r))}return Xr(t,i),n},Nn.rest=function(n,r){if("function"!=typeof n)throw new Dt(e);return Kr(n,r=r===t?r:pa(r))},Nn.reverse=ts,Nn.sampleSize=function(e,n,r){return n=(r?wo(e,n,r):n===t)?1:pa(n),(Ws(e)?Jn:Jr)(e,n)},Nn.set=function(t,e,n){return null==t?t:Qr(t,e,n)},Nn.setWith=function(e,n,r,i){return i="function"==typeof i?i:t,null==e?e:Qr(e,n,r,i)},Nn.shuffle=function(t){return(Ws(t)?Qn:ni)(t)},Nn.slice=function(e,n,r){var i=null==e?0:e.length;return i?(r&&"number"!=typeof r&&wo(e,n,r)?(n=0,r=i):(n=null==n?0:pa(n),r=r===t?i:pa(r)),ri(e,n,r)):[]},Nn.sortBy=Ss,Nn.sortedUniq=function(t){return t&&t.length?ai(t):[]},Nn.sortedUniqBy=function(t,e){return t&&t.length?ai(t,lo(e,2)):[]},Nn.split=function(e,n,r){return r&&"number"!=typeof r&&wo(e,n,r)&&(n=r=t),(r=r===t?d:r>>>0)?(e=va(e))&&("string"==typeof n||null!=n&&!oa(n))&&!(n=ui(n))&&rn(e)?xi(cn(e),0,r):e.split(n,r):[]},Nn.spread=function(t,n){if("function"!=typeof t)throw new Dt(e);return n=null==n?0:vn(pa(n),0),Kr((function(e){var r=e[n],i=xi(e,0,n);return r&&ze(i,r),ke(t,this,i)}))},Nn.tail=function(t){var e=null==t?0:t.length;return e?ri(t,1,e):[]},Nn.take=function(e,n,r){return e&&e.length?ri(e,0,(n=r||n===t?1:pa(n))<0?0:n):[]},Nn.takeRight=function(e,n,r){var i=null==e?0:e.length;return i?ri(e,(n=i-(n=r||n===t?1:pa(n)))<0?0:n,i):[]},Nn.takeRightWhile=function(t,e){return t&&t.length?fi(t,lo(e,3),!1,!0):[]},Nn.takeWhile=function(t,e){return t&&t.length?fi(t,lo(e,3)):[]},Nn.tap=function(t,e){return e(t),t},Nn.throttle=function(t,n,r){var i=!0,o=!0;if("function"!=typeof t)throw new Dt(e);return ta(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),$s(t,n,{leading:i,maxWait:n,trailing:o})},Nn.thru=fs,Nn.toArray=da,Nn.toPairs=ja,Nn.toPairsIn=Ra,Nn.toPath=function(t){return Ws(t)?$e(t,Bo):la(t)?[t]:Ai(Lo(va(t)))},Nn.toPlainObject=ya,Nn.transform=function(t,e,n){var r=Ws(t),i=r||Vs(t)||ua(t);if(e=lo(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:ta(t)&&Zs(o)?Hn(Xt(t)):{}}return(i?Se:wr)(t,(function(t,r,i){return e(n,t,r,i)})),n},Nn.unary=function(t){return Ts(t,1)},Nn.union=es,Nn.unionBy=ns,Nn.unionWith=rs,Nn.uniq=function(t){return t&&t.length?ci(t):[]},Nn.uniqBy=function(t,e){return t&&t.length?ci(t,lo(e,2)):[]},Nn.uniqWith=function(e,n){return n="function"==typeof n?n:t,e&&e.length?ci(e,t,n):[]},Nn.unset=function(t,e){return null==t||hi(t,e)},Nn.unzip=is,Nn.unzipWith=os,Nn.update=function(t,e,n){return null==t?t:di(t,e,vi(n))},Nn.updateWith=function(e,n,r,i){return i="function"==typeof i?i:t,null==e?e:di(e,n,vi(r),i)},Nn.values=Na,Nn.valuesIn=function(t){return null==t?[]:Ke(t,za(t))},Nn.without=ss,Nn.words=Za,Nn.wrap=function(t,e){return Bs(vi(e),t)},Nn.xor=as,Nn.xorBy=ls,Nn.xorWith=us,Nn.zip=cs,Nn.zipObject=function(t,e){return gi(t||[],e||[],er)},Nn.zipObjectDeep=function(t,e){return gi(t||[],e||[],Qr)},Nn.zipWith=hs,Nn.entries=ja,Nn.entriesIn=Ra,Nn.extend=wa,Nn.extendWith=xa,al(Nn,Nn),Nn.add=vl,Nn.attempt=Ja,Nn.camelCase=Ha,Nn.capitalize=qa,Nn.ceil=bl,Nn.clamp=function(e,n,r){return r===t&&(r=n,n=t),r!==t&&(r=(r=ga(r))==r?r:0),n!==t&&(n=(n=ga(n))==n?n:0),ar(ga(e),n,r)},Nn.clone=function(t){return lr(t,4)},Nn.cloneDeep=function(t){return lr(t,5)},Nn.cloneDeepWith=function(e,n){return lr(e,5,n="function"==typeof n?n:t)},Nn.cloneWith=function(e,n){return lr(e,4,n="function"==typeof n?n:t)},Nn.conformsTo=function(t,e){return null==e||ur(t,e,$a(e))},Nn.deburr=Pa,Nn.defaultTo=function(t,e){return null==t||t!=t?e:t},Nn.divide=wl,Nn.endsWith=function(e,n,r){e=va(e),n=ui(n);var i=e.length,o=r=r===t?i:ar(pa(r),0,i);return(r-=n.length)>=0&&e.slice(r,o)==n},Nn.eq=Ns,Nn.escape=function(t){return(t=va(t))&&X.test(t)?t.replace(Y,en):t},Nn.escapeRegExp=function(t){return(t=va(t))&&et.test(t)?t.replace(tt,"\\$&"):t},Nn.every=function(e,n,r){var i=Ws(e)?Te:pr;return r&&wo(e,n,r)&&(n=t),i(e,lo(n,3))},Nn.find=gs,Nn.findIndex=Po,Nn.findKey=function(t,e){return Be(t,lo(e,3),wr)},Nn.findLast=ys,Nn.findLastIndex=Wo,Nn.findLastKey=function(t,e){return Be(t,lo(e,3),xr)},Nn.floor=xl,Nn.forEach=vs,Nn.forEachRight=bs,Nn.forIn=function(t,e){return null==t?t:vr(t,lo(e,3),za)},Nn.forInRight=function(t,e){return null==t?t:br(t,lo(e,3),za)},Nn.forOwn=function(t,e){return t&&wr(t,lo(e,3))},Nn.forOwnRight=function(t,e){return t&&xr(t,lo(e,3))},Nn.get=Ea,Nn.gt=Hs,Nn.gte=qs,Nn.has=function(t,e){return null!=t&&go(t,e,Tr)},Nn.hasIn=Ta,Nn.head=Uo,Nn.identity=rl,Nn.includes=function(t,e,n,r){t=Us(t)?t:Na(t),n=n&&!r?pa(n):0;var i=t.length;return n<0&&(n=vn(i+n,0)),aa(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Re(t,e,n)>-1},Nn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:pa(n);return i<0&&(i=vn(r+i,0)),Re(t,e,i)},Nn.inRange=function(e,n,r){return n=fa(n),r===t?(r=n,n=0):r=fa(r),function(t,e,n){return t>=bn(e,n)&&t<vn(e,n)}(e=ga(e),n,r)},Nn.invoke=Da,Nn.isArguments=Ps,Nn.isArray=Ws,Nn.isArrayBuffer=Ys,Nn.isArrayLike=Us,Nn.isArrayLikeObject=Xs,Nn.isBoolean=function(t){return!0===t||!1===t||ea(t)&&Sr(t)==g},Nn.isBuffer=Vs,Nn.isDate=Gs,Nn.isElement=function(t){return ea(t)&&1===t.nodeType&&!ia(t)},Nn.isEmpty=function(t){if(null==t)return!0;if(Us(t)&&(Ws(t)||"string"==typeof t||"function"==typeof t.splice||Vs(t)||ua(t)||Ps(t)))return!t.length;var e=mo(t);if(e==x||e==E)return!t.size;if(Co(t))return!Lr(t).length;for(var n in t)if(Lt.call(t,n))return!1;return!0},Nn.isEqual=function(t,e){return zr(t,e)},Nn.isEqualWith=function(e,n,r){var i=(r="function"==typeof r?r:t)?r(e,n):t;return i===t?zr(e,n,t,r):!!i},Nn.isError=Ks,Nn.isFinite=function(t){return"number"==typeof t&&mn(t)},Nn.isFunction=Zs,Nn.isInteger=Js,Nn.isLength=Qs,Nn.isMap=na,Nn.isMatch=function(t,e){return t===e||Ir(t,e,co(e))},Nn.isMatchWith=function(e,n,r){return r="function"==typeof r?r:t,Ir(e,n,co(n),r)},Nn.isNaN=function(t){return ra(t)&&t!=+t},Nn.isNative=function(t){if(ko(t))throw new Ct("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Or(t)},Nn.isNil=function(t){return null==t},Nn.isNull=function(t){return null===t},Nn.isNumber=ra,Nn.isObject=ta,Nn.isObjectLike=ea,Nn.isPlainObject=ia,Nn.isRegExp=oa,Nn.isSafeInteger=function(t){return Js(t)&&t>=-9007199254740991&&t<=c},Nn.isSet=sa,Nn.isString=aa,Nn.isSymbol=la,Nn.isTypedArray=ua,Nn.isUndefined=function(e){return e===t},Nn.isWeakMap=function(t){return ea(t)&&mo(t)==A},Nn.isWeakSet=function(t){return ea(t)&&"[object WeakSet]"==Sr(t)},Nn.join=function(t,e){return null==t?"":gn.call(t,e)},Nn.kebabCase=Wa,Nn.last=Ko,Nn.lastIndexOf=function(e,n,r){var i=null==e?0:e.length;if(!i)return-1;var o=i;return r!==t&&(o=(o=pa(r))<0?vn(i+o,0):bn(o,i-1)),n==n?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(e,n,o):je(e,He,o,!0)},Nn.lowerCase=Ya,Nn.lowerFirst=Ua,Nn.lt=ca,Nn.lte=ha,Nn.max=function(e){return e&&e.length?mr(e,rl,Er):t},Nn.maxBy=function(e,n){return e&&e.length?mr(e,lo(n,2),Er):t},Nn.mean=function(t){return qe(t,rl)},Nn.meanBy=function(t,e){return qe(t,lo(e,2))},Nn.min=function(e){return e&&e.length?mr(e,rl,jr):t},Nn.minBy=function(e,n){return e&&e.length?mr(e,lo(n,2),jr):t},Nn.stubArray=ml,Nn.stubFalse=gl,Nn.stubObject=function(){return{}},Nn.stubString=function(){return""},Nn.stubTrue=function(){return!0},Nn.multiply=_l,Nn.nth=function(e,n){return e&&e.length?Pr(e,pa(n)):t},Nn.noConflict=function(){return he._===this&&(he._=Ht),this},Nn.noop=ll,Nn.now=Es,Nn.pad=function(t,e,n){t=va(t);var r=(e=pa(e))?un(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Wi(Le(i),n)+t+Wi(ge(i),n)},Nn.padEnd=function(t,e,n){t=va(t);var r=(e=pa(e))?un(t):0;return e&&r<e?t+Wi(e-r,n):t},Nn.padStart=function(t,e,n){t=va(t);var r=(e=pa(e))?un(t):0;return e&&r<e?Wi(e-r,n)+t:t},Nn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),xn(va(t).replace(nt,""),e||0)},Nn.random=function(e,n,r){if(r&&"boolean"!=typeof r&&wo(e,n,r)&&(n=r=t),r===t&&("boolean"==typeof n?(r=n,n=t):"boolean"==typeof e&&(r=e,e=t)),e===t&&n===t?(e=0,n=1):(e=fa(e),n===t?(n=e,e=0):n=fa(n)),e>n){var i=e;e=n,n=i}if(r||e%1||n%1){var o=_n();return bn(e+o*(n-e+ae("1e-"+((o+"").length-1))),n)}return Vr(e,n)},Nn.reduce=function(t,e,n){var r=Ws(t)?Ie:Ye,i=arguments.length<3;return r(t,lo(e,4),n,i,dr)},Nn.reduceRight=function(t,e,n){var r=Ws(t)?Oe:Ye,i=arguments.length<3;return r(t,lo(e,4),n,i,fr)},Nn.repeat=function(e,n,r){return n=(r?wo(e,n,r):n===t)?1:pa(n),Gr(va(e),n)},Nn.replace=function(){var t=arguments,e=va(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Nn.result=function(e,n,r){var i=-1,o=(n=bi(n,e)).length;for(o||(o=1,e=t);++i<o;){var s=null==e?t:e[Bo(n[i])];s===t&&(i=o,s=r),e=Zs(s)?s.call(e):s}return e},Nn.round=kl,Nn.runInContext=rt,Nn.sample=function(t){return(Ws(t)?Zn:Zr)(t)},Nn.size=function(t){if(null==t)return 0;if(Us(t))return aa(t)?un(t):t.length;var e=mo(t);return e==x||e==E?t.size:Lr(t).length},Nn.snakeCase=Xa,Nn.some=function(e,n,r){var i=Ws(e)?Fe:ii;return r&&wo(e,n,r)&&(n=t),i(e,lo(n,3))},Nn.sortedIndex=function(t,e){return oi(t,e)},Nn.sortedIndexBy=function(t,e,n){return si(t,e,lo(n,2))},Nn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=oi(t,e);if(r<n&&Ns(t[r],e))return r}return-1},Nn.sortedLastIndex=function(t,e){return oi(t,e,!0)},Nn.sortedLastIndexBy=function(t,e,n){return si(t,e,lo(n,2),!0)},Nn.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=oi(t,e,!0)-1;if(Ns(t[n],e))return n}return-1},Nn.startCase=Va,Nn.startsWith=function(t,e,n){return t=va(t),n=null==n?0:ar(pa(n),0,t.length),e=ui(e),t.slice(n,n+e.length)==e},Nn.subtract=Cl,Nn.sum=function(t){return t&&t.length?Ue(t,rl):0},Nn.sumBy=function(t,e){return t&&t.length?Ue(t,lo(e,2)):0},Nn.template=function(e,n,r){var i=Nn.templateSettings;r&&wo(e,n,r)&&(n=t),e=va(e),n=xa({},n,i,Ji);var o,s,a=xa({},n.imports,i.imports,Ji),l=$a(a),u=Ke(a,l),c=0,h=n.interpolate||vt,d="__p += '",f=Mt((n.escape||vt).source+"|"+h.source+"|"+(h===K?ct:vt).source+"|"+(n.evaluate||vt).source+"|$","g"),p="//# sourceURL="+(Lt.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++re+"]")+"\n";e.replace(f,(function(t,n,r,i,a,l){return r||(r=i),d+=e.slice(c,l).replace(bt,nn),n&&(o=!0,d+="' +\n__e("+n+") +\n'"),a&&(s=!0,d+="';\n"+a+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=l+t.length,t})),d+="';\n";var m=Lt.call(n,"variable")&&n.variable;if(m){if(lt.test(m))throw new Ct("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(s?d.replace(H,""):d).replace(q,"$1").replace(P,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var g=Ja((function(){return St(l,p+"return "+d).apply(t,u)}));if(g.source=d,Ks(g))throw g;return g},Nn.times=function(t,e){if((t=pa(t))<1||t>c)return[];var n=d,r=bn(t,d);e=lo(e),t-=d;for(var i=Xe(r,e);++n<t;)e(n);return i},Nn.toFinite=fa,Nn.toInteger=pa,Nn.toLength=ma,Nn.toLower=function(t){return va(t).toLowerCase()},Nn.toNumber=ga,Nn.toSafeInteger=function(t){return t?ar(pa(t),-9007199254740991,c):0===t?t:0},Nn.toString=va,Nn.toUpper=function(t){return va(t).toUpperCase()},Nn.trim=function(e,n,r){if((e=va(e))&&(r||n===t))return Ve(e);if(!e||!(n=ui(n)))return e;var i=cn(e),o=cn(n);return xi(i,Je(i,o),Qe(i,o)+1).join("")},Nn.trimEnd=function(e,n,r){if((e=va(e))&&(r||n===t))return e.slice(0,hn(e)+1);if(!e||!(n=ui(n)))return e;var i=cn(e);return xi(i,0,Qe(i,cn(n))+1).join("")},Nn.trimStart=function(e,n,r){if((e=va(e))&&(r||n===t))return e.replace(nt,"");if(!e||!(n=ui(n)))return e;var i=cn(e);return xi(i,Je(i,cn(n))).join("")},Nn.truncate=function(e,n){var r=30,i="...";if(ta(n)){var o="separator"in n?n.separator:o;r="length"in n?pa(n.length):r,i="omission"in n?ui(n.omission):i}var s=(e=va(e)).length;if(rn(e)){var a=cn(e);s=a.length}if(r>=s)return e;var l=r-un(i);if(l<1)return i;var u=a?xi(a,0,l).join(""):e.slice(0,l);if(o===t)return u+i;if(a&&(l+=u.length-l),oa(o)){if(e.slice(l).search(o)){var c,h=u;for(o.global||(o=Mt(o.source,va(ht.exec(o))+"g")),o.lastIndex=0;c=o.exec(h);)var d=c.index;u=u.slice(0,d===t?l:d)}}else if(e.indexOf(ui(o),l)!=l){var f=u.lastIndexOf(o);f>-1&&(u=u.slice(0,f))}return u+i},Nn.unescape=function(t){return(t=va(t))&&U.test(t)?t.replace(W,dn):t},Nn.uniqueId=function(t){var e=++Bt;return va(t)+e},Nn.upperCase=Ga,Nn.upperFirst=Ka,Nn.each=vs,Nn.eachRight=bs,Nn.first=Uo,al(Nn,(yl={},wr(Nn,(function(t,e){Lt.call(Nn.prototype,e)||(yl[e]=t)})),yl),{chain:!1}),Nn.VERSION="4.17.21",Se(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Nn[t].placeholder=Nn})),Se(["drop","take"],(function(e,n){Wn.prototype[e]=function(r){r=r===t?1:vn(pa(r),0);var i=this.__filtered__&&!n?new Wn(this):this.clone();return i.__filtered__?i.__takeCount__=bn(r,i.__takeCount__):i.__views__.push({size:bn(r,d),type:e+(i.__dir__<0?"Right":"")}),i},Wn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Se(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Wn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:lo(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),Se(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Wn.prototype[t]=function(){return this[n](1).value()[0]}})),Se(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Wn.prototype[t]=function(){return this.__filtered__?new Wn(this):this[n](1)}})),Wn.prototype.compact=function(){return this.filter(rl)},Wn.prototype.find=function(t){return this.filter(t).head()},Wn.prototype.findLast=function(t){return this.reverse().find(t)},Wn.prototype.invokeMap=Kr((function(t,e){return"function"==typeof t?new Wn(this):this.map((function(n){return Dr(n,t,e)}))})),Wn.prototype.reject=function(t){return this.filter(Fs(lo(t)))},Wn.prototype.slice=function(e,n){e=pa(e);var r=this;return r.__filtered__&&(e>0||n<0)?new Wn(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),n!==t&&(r=(n=pa(n))<0?r.dropRight(-n):r.take(n-e)),r)},Wn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Wn.prototype.toArray=function(){return this.take(d)},wr(Wn.prototype,(function(e,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),i=/^(?:head|last)$/.test(n),o=Nn[i?"take"+("last"==n?"Right":""):n],s=i||/^find/.test(n);o&&(Nn.prototype[n]=function(){var n=this.__wrapped__,a=i?[1]:arguments,l=n instanceof Wn,u=a[0],c=l||Ws(n),h=function(t){var e=o.apply(Nn,ze([t],a));return i&&d?e[0]:e};c&&r&&"function"==typeof u&&1!=u.length&&(l=c=!1);var d=this.__chain__,f=!!this.__actions__.length,p=s&&!d,m=l&&!f;if(!s&&c){n=m?n:new Wn(this);var g=e.apply(n,a);return g.__actions__.push({func:fs,args:[h],thisArg:t}),new Pn(g,d)}return p&&m?e.apply(this,a):(g=this.thru(h),p?i?g.value()[0]:g.value():g)})})),Se(["pop","push","shift","sort","splice","unshift"],(function(t){var e=$t[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Nn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Ws(i)?i:[],t)}return this[n]((function(n){return e.apply(Ws(n)?n:[],t)}))}})),wr(Wn.prototype,(function(t,e){var n=Nn[e];if(n){var r=n.name+"";Lt.call($n,r)||($n[r]=[]),$n[r].push({name:e,func:n})}})),$n[Ni(t,2).name]=[{name:"wrapper",func:t}],Wn.prototype.clone=function(){var t=new Wn(this.__wrapped__);return t.__actions__=Ai(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ai(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ai(this.__views__),t},Wn.prototype.reverse=function(){if(this.__filtered__){var t=new Wn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Wn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Ws(t),r=e<0,i=n?t.length:0,o=function(t,e,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],s=o.size;switch(o.type){case"drop":t+=s;break;case"dropRight":e-=s;break;case"take":e=bn(e,t+s);break;case"takeRight":t=vn(t,e-s)}}return{start:t,end:e}}(0,i,this.__views__),s=o.start,a=o.end,l=a-s,u=r?a:s-1,c=this.__iteratees__,h=c.length,d=0,f=bn(l,this.__takeCount__);if(!n||!r&&i==l&&f==l)return pi(t,this.__actions__);var p=[];t:for(;l--&&d<f;){for(var m=-1,g=t[u+=e];++m<h;){var y=c[m],v=y.iteratee,b=y.type,w=v(g);if(2==b)g=w;else if(!w){if(1==b)continue t;break t}}p[d++]=g}return p},Nn.prototype.at=ps,Nn.prototype.chain=function(){return ds(this)},Nn.prototype.commit=function(){return new Pn(this.value(),this.__chain__)},Nn.prototype.next=function(){this.__values__===t&&(this.__values__=da(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?t:this.__values__[this.__index__++]}},Nn.prototype.plant=function(e){for(var n,r=this;r instanceof qn;){var i=Ro(r);i.__index__=0,i.__values__=t,n?o.__wrapped__=i:n=i;var o=i;r=r.__wrapped__}return o.__wrapped__=e,n},Nn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Wn){var n=e;return this.__actions__.length&&(n=new Wn(this)),(n=n.reverse()).__actions__.push({func:fs,args:[ts],thisArg:t}),new Pn(n,this.__chain__)}return this.thru(ts)},Nn.prototype.toJSON=Nn.prototype.valueOf=Nn.prototype.value=function(){return pi(this.__wrapped__,this.__actions__)},Nn.prototype.first=Nn.prototype.head,se&&(Nn.prototype[se]=function(){return this}),Nn}();fe?((fe.exports=fn)._=fn,de._=fn):he._=fn}.call(dr);var Li=Fi.exports;function Bi(t,e){const n=`.bar-container .bar-timeline[data-taskid="${e}"][data-chart-instance="${t.getInstanceId()}"]`,r=t.querySelector(n);return r}function ji(t,e){const n=`.timeline-body .timeline-data-row[data-taskid="${e}"][data-chart-instance="${t.getInstanceId()}"]`,r=t.querySelector(n);return r}const Ri=["day","week","month","quarter","year"];var Ni=(t=>(t.Day="day",t.Month="month",t.Quarter="quarter",t.Week="week",t.Year="year",t))(Ni||{}),Hi=(t=>(t.Horizontal="horizontal",t.Vertical="vertical",t))(Hi||{});class qi{constructor(t,e,n,r,i){this.options=t,this.ganttStartDate=e,this.viewMode=n,this.chartContext=r,this.totalHeight=i}calculateWidth(t){return mr(t.x2).add(1,"day").diff(mr(t.x1),`${this.viewMode}s`,!0)*Pi[this.viewMode]}calculateX(t){return mr(t.x1).diff(this.ganttStartDate.startOf(this.viewMode),`${this.viewMode}s`,!0)*Pi[this.viewMode]}drawAnnotation(t){const e=ur(this.chartContext,{className:"annotation"}),n=this.calculateX(t),r=lr(this.getAnnotationStyles(t,n));if(e.setAttribute("style",r),t.label){const n=this.renderLabel(t);e.append(n)}return e}getAnnotationStyles(t,e){const{annotationBgColor:n,annotationBorderColor:r,annotationBorderWidth:i}=this.options,{bgColor:o,borderColor:s,borderWidth:a}=t;let l=0;const u=t.x2?a||i:(a||i)/2;return t.x2&&(l=this.calculateWidth(t)),{backgroundColor:o||n,borderColor:`${s||r}`,borderStyle:"solid",borderWidth:`${u}px`,height:`${this.totalHeight}px`,left:`${e}px`,position:"absolute",top:"0px",width:l?`${l}px`:"unset",zIndex:"10"}}renderLabel(t){const e=ur(this.chartContext,{className:"annotation-label"}),{annotationBorderColor:n,fontColor:r,fontFamily:i,fontSize:o,fontWeight:s}=this.options,{borderColor:a}=t,{label:l}=t,u=l.fontColor||r,c=l.fontFamily||i,h=l.fontSize||o,d=l.fontWeight||s,f=lr({background:"white",borderColor:`${a||n}`,borderStyle:"solid",borderWidth:"1px",color:u,fontFamily:c,fontSize:h,fontWeight:d,left:"0px",padding:"2px 5px",position:"absolute",top:"-1px",width:"max-content",zIndex:"1"});return e.setAttribute("style",f),e.innerText=t.label.text,e}render(){const t=[];return this.options.annotations.forEach((e=>{t.push(this.drawAnnotation(e))})),t}}const Pi={[Ni.Day]:80,[Ni.Month]:150,[Ni.Quarter]:150,[Ni.Week]:180,[Ni.Year]:180};const Wi=(t,e)=>{const n=function(t,e){const n=mr(t);switch(e){case Ni.Month:return n.daysInMonth();case Ni.Quarter:{const t=n.startOf("quarter");return n.endOf("quarter").diff(t,"day")+1}case Ni.Week:return 7;case Ni.Year:{const t=n.startOf("year");return n.endOf("year").diff(t,"day")+1}default:return 1}}(t,e);return Pi[e]/n},Yi={annotationBorderDashArray:[],annotationBorderWidth:2,annotationOrientation:Hi.Horizontal,annotations:[],barBorderRadius:"5px",barMargin:3,canvasStyle:"border: 1px solid #CACED0; box-sizing: border-box",cellBorderWidth:"1px",enableExport:!0,enableResize:!0,enableTaskDrag:!0,enableTaskEdit:!1,enableTaskResize:!0,enableTooltip:!0,fontFamily:"sans-serif",fontSize:"14px",fontWeight:"400",height:"500px",inputDateFormat:"MM-DD-YYYY",rowHeight:28,series:[],tasksContainerWidth:425,tooltipId:"apexgantt-tooltip-container",tooltipTemplate(t,e){const n=[`<div>\n <strong>Task:</strong>\n <span>${t.name}</span>\n </div>\n `];return t.type===co.Task?n.push(`\n <div>\n <strong>Start:</strong>\n <span>${oo(t,no.StartTime,e)}</span>\n </div>\n <div>\n <strong>End:</strong>\n <span>${oo(t,no.EndTime,e)}</span>\n </div>\n <div>\n <strong>Duration:</strong>\n <span>${oo(t,no.Duration,e)}</span>\n </div>\n <div>\n <strong>Progress:</strong>\n <span>${t.progress}%</span>\n </div>\n `):t.type===co.Milestone&&n.push(`\n <div>\n <strong>Date:</strong>\n <span>${oo(t,no.StartTime,e)}</span>\n </div>\n `),t.dependency&&n.push(`\n <div>\n <strong>Depends on:</strong>\n <span>${t.dependency}</span>\n </div>\n `),`\n <div>\n ${n.join("")}\n </div>\n `},viewMode:Ni.Week,width:"100%"},Ui={annotationBgColor:"#F9D1FC",annotationBorderColor:"#E273EA",arrowColor:"#0D6EFD",backgroundColor:"#FFFFFF",barBackgroundColor:"#87B7FE",barTextColor:"#FFFFFF",borderColor:"#DFE0E1",cellBorderColor:"#eff0f0",fontColor:"#000000",headerBackground:"#F3F3F3",rowBackgroundColors:["#FFFFFF"],tooltipBGColor:"#FFFFFF",tooltipBorderColor:"#BCBCBC"},Xi={annotationBgColor:"#4A2D4D",annotationBorderColor:"#8B4D8F",arrowColor:"#4A9EFF",backgroundColor:"#1E1E1E",barBackgroundColor:"#5B8DEE",barTextColor:"#FFFFFF",borderColor:"#3A3A3A",cellBorderColor:"#3A3A3A",fontColor:"#E0E0E0",headerBackground:"#2A2A2A",rowBackgroundColors:["#1E1E1E","#252525"],tooltipBGColor:"#2D2D2D",tooltipBorderColor:"#444444"};function Vi(t){return{...Yi,..."dark"===t?Xi:Ui}}const Gi=Vi("light"),Ki={TASK_UPDATE:"taskUpdate",TASK_VALIDATION_ERROR:"taskValidationError",TASK_UPDATE_SUCCESS:"taskUpdateSuccess",TASK_UPDATE_ERROR:"taskUpdateError",TASK_DRAGGED:"taskDragged",TASK_RESIZED:"taskResized"};class Zi{constructor(t,e,n,r,i){this.taskId=t,this.options=e,this.chartContext=r,this.dataManager=i,this.dragState={childTasks:[],daysPerPixel:0,initialLeft:0,initialPosition:0,initialStartTime:"",initialEndTime:"",isDragging:!1,parentWidth:0,parentX1:0,parentX2:0,startX:0},this.dragState.daysPerPixel=Wi(this.dataManager.getTaskById(t).startTime,n)}calculateFinalPosition(t,e){const{daysPerPixel:n,initialLeft:r,initialPosition:i,parentX1:o,parentX2:s}=this.dragState,a=t.clientX-i;let l=Math.round(a/n),u=r+l*n;return a<0&&u<=o?(u=o,l=Math.round((o-r)/n)):a>0&&u+e>=s&&(u=s-e,l=Math.round((s-e-r)/n)),{calculatedLeft:u,daysMoved:l}}createMouseDownHandler(t){return e=>{var n;this.task=this.dataManager.getTaskById(this.taskId),this.dragState={...this.dragState,initialLeft:parseInt(t.style.left)||0,initialPosition:e.clientX,initialStartTime:this.task.startTime,initialEndTime:this.task.endTime,isDragging:!0,startX:e.clientX},t.classList.add("dragging");const r=Bi(this.chartContext,this.task.parentId);this.dragState.parentX2=(null==(n=this.chartContext.querySelector(".timeline-body"))?void 0:n.clientWidth)||0,this.dragState.childTasks=this.dataManager.getNestedChildTasks(this.task.id).map((t=>{const e=Bi(this.chartContext,t.id);return e?{...t,element:e,left:parseInt(e.style.left)||0,width:parseInt(e.style.width)||0}:t})),r&&(this.dragState.parentX1=parseInt(r.style.left)||0,this.dragState.parentX2=this.dragState.parentX1+parseInt(r.style.width)||0)}}createMouseMoveHandler(t){return e=>{this.dragState.isDragging&&requestAnimationFrame((()=>{const n=e.clientX-this.dragState.startX,r=parseInt(t.style.left)||0,i=parseInt(t.style.width)||0;this.isOutOfBounds(r,i,n)||(this.moveBar(t,r,n),this.dataManager.updateDependencyArrows(this.task.id,this.chartContext),this.moveChildBars(n),this.dragState.startX=e.clientX)}))}}createMouseUpHandler(t,e){return n=>{if(!this.dragState.isDragging)return;this.dragState.isDragging=!1,t.classList.remove("dragging");const r=parseInt(t.style.width)||0,{calculatedLeft:i,daysMoved:o}=this.calculateFinalPosition(n,r);if(0===o)return void(this.dragState={...this.dragState,isDragging:!1});const s=mr(this.task.startTime).add(o,"day").format(this.options.inputDateFormat),a=mr(this.task.endTime).add(o,"day").format(this.options.inputDateFormat),l=this.dragState.childTasks.map((t=>({taskId:t.id,newStartTime:mr(t.startTime).add(o,"day").format(this.options.inputDateFormat),newEndTime:t.endTime?mr(t.endTime).add(o,"day").format(this.options.inputDateFormat):null}))).filter((t=>null!==t.newEndTime));this.emitTaskDraggedEvent(o,s,a,l),this.updateTaskPosition(t,i,o,e),this.updateChildrenPositions(i,o,e)}}emitTaskDraggedEvent(t,e,n,r){const i={taskId:this.task.id,oldStartTime:this.dragState.initialStartTime,oldEndTime:this.dragState.initialEndTime,newStartTime:e,newEndTime:n,daysMoved:t,affectedChildTasks:r,timestamp:Date.now()},o=new CustomEvent(Ki.TASK_DRAGGED,{detail:i,bubbles:!0,composed:!0,cancelable:!1}),s=this.chartContext.getChartContainer();s&&s.dispatchEvent(o)}isOutOfBounds(t,e,n){const{parentX1:r,parentX2:i}=this.dragState;return n<0&&t<=r||n>0&&t+e>=i}moveBar(t,e,n){t.style.left=`${e+n}px`}moveChildBars(t){this.dragState.childTasks.forEach((e=>{if(e.element){const n=parseInt(e.element.style.left)||0;e.element.style.left=`${n+t}px`,this.dataManager.updateDependencyArrows(e.id,this.chartContext)}}))}updateChildrenPositions(t,e,n){this.dragState.childTasks.forEach((r=>{const i=Bi(this.chartContext,r.id);if(i){const o=t-this.dragState.initialLeft;i.style.left=`${r.left+o}px`;const s=mr(r.startTime).add(e,"day").format(this.options.inputDateFormat),a=r.endTime?mr(r.endTime).add(e,"day").format(this.options.inputDateFormat):null;this.dataManager.updateDependencyArrows(r.id,this.chartContext),null==n||n(r.id,{endTime:a,startTime:s})}}))}updateTaskPosition(t,e,n,r){t.style.left=`${e}px`;const i=mr(this.task.startTime).add(n,"day").format(this.options.inputDateFormat),o=mr(this.task.endTime).add(n,"day").format(this.options.inputDateFormat);this.dataManager.updateDependencyArrows(this.task.id,this.chartContext),null==r||r(this.task.id,{endTime:o,startTime:i})}makeDraggable(t,e){const n=this.createMouseDownHandler(t),r=this.createMouseMoveHandler(t),i=this.createMouseUpHandler(t,e);return t.addEventListener("mousedown",n),this.chartContext.addEventListener("mousemove",r),this.chartContext.addEventListener("mouseup",i),()=>{t.removeEventListener("mousedown",n),this.chartContext.removeEventListener("mousemove",r),this.chartContext.removeEventListener("mouseup",i)}}}class Ji{constructor(t,e,n,r,i){this.taskId=t,this.options=e,this.chartContext=r,this.dataManager=i,this.interactionState={daysPerPixel:0,initialLeft:0,initialPosition:0,initialWidth:0,initialStartTime:"",initialEndTime:"",isResizing:!1,parentWidth:0,parentX1:0,parentX2:0,resizeHandle:null,startX:0},this.interactionState.daysPerPixel=Wi(this.dataManager.getTaskById(t).startTime,n)}createMouseMoveHandler(t){return e=>{this.interactionState.isResizing&&requestAnimationFrame((()=>{const n=e.clientX-this.interactionState.startX,{daysPerPixel:r,parentX1:i,parentX2:o,resizeHandle:s}=this.interactionState,a=parseInt(t.style.left)||0,l=parseInt(t.style.width)||0;if("left"===s){const e=Math.max(i,Math.min(o-r,a+n)),s=l-(e-a);s>=r&&(t.style.left=`${e}px`,t.style.width=`${s}px`)}else{const e=r,i=o-a,s=Math.max(e,Math.min(i,l+n));t.style.width=`${s}px`}this.dataManager.updateDependencyArrows(this.task.id,this.chartContext),this.interactionState.startX=e.clientX}))}}createMouseUpHandler(t,e){return n=>{if(!this.interactionState.isResizing)return;t.classList.remove("resizing");const{daysPerPixel:r,initialLeft:i,initialPosition:o,initialWidth:s,parentX1:a,parentX2:l,resizeHandle:u}=this.interactionState,c=n.clientX-o,h=this.interactionState.initialStartTime,d=this.interactionState.initialEndTime;let f=h,p=d,m=0;if("left"===u){let n=Math.round(c/r),o=i+n*r;c<0&&o<=a&&(n=Math.round((a-i)/r),o=a);let l=s-n*r;if(l<r&&(l=r,o=i+s-r,n=Math.round((o-i)/r)),0===n)return void(this.interactionState={...this.interactionState,isResizing:!1,resizeHandle:null});t.style.left=`${o}px`,t.style.width=`${l}px`,f=mr(this.task.startTime).add(n,"day").format(this.options.inputDateFormat),m=-n,null==e||e(this.task.id,{startTime:f})}else{let n=Math.round(c/r),o=s+n*r;if(o<r?(o=r,n=Math.round((o-s)/r)):i+o>l&&(o=l-i,n=Math.round((o-s)/r)),0===n)return void(this.interactionState={...this.interactionState,isResizing:!1,resizeHandle:null});t.style.width=`${o}px`,p=mr(this.task.endTime).add(n,"day").format(this.options.inputDateFormat),m=n,null==e||e(this.task.id,{endTime:p})}this.emitTaskResizedEvent(u,h,d,f,p,m),this.dataManager.updateDependencyArrows(this.task.id,this.chartContext),this.interactionState={...this.interactionState,isResizing:!1,resizeHandle:null}}}emitTaskResizedEvent(t,e,n,r,i,o){const s={taskId:this.task.id,resizeHandle:t,oldStartTime:e,oldEndTime:n,newStartTime:r,newEndTime:i,durationChange:o,timestamp:Date.now()},a=new CustomEvent(Ki.TASK_RESIZED,{detail:s,bubbles:!0,composed:!0,cancelable:!1}),l=this.chartContext.getChartContainer();l&&l.dispatchEvent(a)}createResizeMouseDownHandler(t){return(e,n)=>{var r;e.stopPropagation(),this.task=this.dataManager.getTaskById(this.taskId),this.interactionState={...this.interactionState,initialLeft:parseInt(t.style.left)||0,initialPosition:e.clientX,initialWidth:parseInt(t.style.width)||0,initialStartTime:this.task.startTime,initialEndTime:this.task.endTime,isResizing:!0,resizeHandle:n,startX:e.clientX},t.classList.add("resizing");const i=Bi(this.chartContext,this.task.parentId);this.interactionState.parentX2=(null==(r=this.chartContext.querySelector(".timeline-body"))?void 0:r.clientWidth)||0,i&&(this.interactionState.parentX1=parseInt(i.style.left)||0,this.interactionState.parentX2=this.interactionState.parentX1+parseInt(i.style.width)||0)}}makeResizable(t,e){const n=t.querySelector(".handle-left"),r=t.querySelector(".handle-right"),i=this.createResizeMouseDownHandler(t),o=this.createMouseMoveHandler(t),s=this.createMouseUpHandler(t,e);return null==n||n.addEventListener("mousedown",(t=>i(t,"left"))),null==r||r.addEventListener("mousedown",(t=>i(t,"right"))),this.chartContext.addEventListener("mousemove",o),this.chartContext.addEventListener("mouseup",s),()=>{null==n||n.removeEventListener("mousedown",(t=>i(t,"left"))),null==r||r.removeEventListener("mousedown",(t=>i(t,"right"))),this.chartContext.removeEventListener("mousemove",o),this.chartContext.removeEventListener("mouseup",s)}}}class Qi{constructor(t,e){this.chartContext=t,this.options=e,this.overlay=null,this.keydownHandler=null,this.clickOutsideHandler=null,this.createDialog(),this.setupEventListeners()}createDialog(){const t=this.chartContext.getInstanceId(),e=this.chartContext.getElementById(`${this.options.id}-container`);if(e){this.container=e;const t=this.container.querySelector(".gantt-dialog");return void this.updateDialogContent(t)}this.container=this.chartContext.createElement("div"),this.container.id=`${this.options.id}-container`,this.container.className="gantt-dialog-container",this.container.setAttribute("role","dialog"),this.container.setAttribute("aria-modal","true"),this.container.setAttribute("aria-labelledby",`${this.options.id}-title`),this.container.setAttribute("data-chart-instance",t),this.options.modal&&(this.overlay=this.chartContext.createElement("div"),this.overlay.className="dialog-overlay",this.container.appendChild(this.overlay));const n=this.chartContext.createElement("div");n.id=this.options.id,n.className="gantt-dialog",this.createDialogStructure(n),this.options.width&&(n.style.width=this.options.width),this.options.height&&(n.style.height=this.options.height),this.container.appendChild(n),!1!==this.options.positionRelativeToChart&&this.positionRelativeToChart();(!1!==this.options.positionRelativeToChart?this.chartContext.getChartContainer():this.chartContext.getAppendContainer()).appendChild(this.container)}createDialogStructure(t){t.innerHTML=`\n <div class="dialog-header">\n <h2 id="${this.options.id}-title-${this.chartContext.getInstanceId()}" class="dialog-title">${this.options.title||""}</h2>\n <button class="dialog-close" aria-label="Close dialog" type="button">×</button>\n </div>\n <div class="dialog-content"></div>\n `,this.updateDialogContent(t)}positionRelativeToChart(){const t=this.chartContext.getChartContainer();if(t){"static"===window.getComputedStyle(t).position&&(t.style.position="relative")}this.container.style.position="absolute",this.container.style.top="0",this.container.style.left="0",this.container.style.width="100%",this.container.style.height="100%",this.container.style.zIndex="999"}setupEventListeners(){const t=this.container.querySelector(".dialog-close");null==t||t.addEventListener("click",(()=>this.hide())),this.options.closeOnEscape&&(this.keydownHandler=t=>{"Escape"===t.key&&this.isVisible()&&(t.preventDefault(),this.hide())},this.chartContext.addEventListener("keydown",this.keydownHandler)),this.options.closeOnClickOutside&&this.overlay&&(this.clickOutsideHandler=t=>{t.target===this.overlay&&this.hide()},this.overlay.addEventListener("click",this.clickOutsideHandler)),this.container.addEventListener("keydown",(t=>{"Tab"===t.key&&this.isVisible()&&this.trapFocus(t)}))}trapFocus(t){const e=this.container.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),n=e[0],r=e[e.length-1],i=this.chartContext.getActiveElement();t.shiftKey?i===n&&(t.preventDefault(),null==r||r.focus()):i===r&&(t.preventDefault(),null==n||n.focus())}updateDialogContent(t){const e=t.querySelector(".dialog-content"),n=t.querySelector(".dialog-title");n&&(n.textContent=this.options.title||""),e&&(e.innerHTML="","string"==typeof this.options.content?e.innerHTML=this.options.content:this.options.content instanceof HTMLElement&&e.appendChild(this.options.content))}cleanupEventListeners(){this.keydownHandler&&(this.chartContext.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=null),this.clickOutsideHandler&&this.overlay&&(this.overlay.removeEventListener("click",this.clickOutsideHandler),this.clickOutsideHandler=null)}destroy(){this.cleanupEventListeners(),this.container.remove()}hide(){this.container.classList.remove("show","animate");const t=this.chartContext.querySelector("[data-dialog-trigger]");null==t||t.focus()}isVisible(){return this.container.classList.contains("show")}setContent(t){const e=this.container.querySelector(".dialog-content");e&&(e.innerHTML="","string"==typeof t?e.innerHTML=t:e.appendChild(t))}show(){const t=this.chartContext.getActiveElement();null==t||t.setAttribute("data-dialog-trigger","true"),this.container.classList.add("show","animate");const e=this.container.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');null==e||e.focus()}}class to{constructor(t,e,n,r,i,o="MM-DD-YYYY"){this.chartContext=t,this.dataManager=e,this.task=n,this.containerElement=r,this.onSubmit=i,this.dateFormat=o,this.errors=[],this.submitButton=null,this.form=this.createForm()}emitEvent(t,e){const n=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0,cancelable:!1});this.containerElement.dispatchEvent(n)}clearError(t){var e;const n=this.form.querySelector(`[name="${t}"]`),r=null==(e=n.parentElement)?void 0:e.querySelector(".form-error");null==r||r.remove(),n.classList.remove("invalid"),this.errors=this.errors.filter((e=>e.field!==t)),this.updateSubmitButton()}createForm(){const t=this.chartContext.createElement("form");t.className="task-form";const e=this.task.barBackgroundColor||"#87B7FE",n=this.task.rowBackgroundColor||"#FFFFFF";return t.innerHTML=`\n <div class="form-group">\n <label for="name">Task Name</label>\n <input type="text" id="name" name="name" value="${this.task.name}">\n </div>\n \n <div class="form-group">\n <label for="startTime">Start Date</label>\n <input type="date" id="startTime" name="startTime" value="${this.formatDate(this.task.startTime)}">\n </div>\n \n <div class="form-group">\n <label for="endTime">End Date</label>\n <input type="date" id="endTime" name="endTime" value="${this.formatDate(this.task.endTime)}">\n </div>\n \n <div class="form-group">\n <label for="progress">Progress (%)</label>\n <input type="number" id="progress" name="progress" min="0" max="100" value="${this.task.progress}">\n </div>\n\n <div class="grid">\n <div class="form-group">\n <label for="barColor">Bar Color</label>\n <div class="color-picker-wrapper">\n <input type="color" id="barColor" name="barBackgroundColor" \n value="${e}"\n title="Choose bar color">\n <span class="color-preview"></span>\n </div>\n </div>\n \n <div class="form-group">\n <label for="rowColor">Row Background Color</label>\n <div class="color-picker-wrapper">\n <input type="color" id="rowColor" name="rowBackgroundColor" \n value="${n}"\n title="Choose row color">\n <span class="color-preview"></span>\n </div>\n </div>\n </div>\n \n <div class="form-actions">\n <button type="submit" class="btn-primary">Update</button>\n </div>\n `,t.addEventListener("submit",this.handleSubmit.bind(this)),this.setupFieldValidation(t),t}formatDate(t){return mr(t,this.dateFormat).format("YYYY-MM-DD")}handleSubmit(t){if(t.preventDefault(),this.errors.length>0)this.emitEvent(Ki.TASK_VALIDATION_ERROR,{taskId:this.task.id,errors:this.errors,timestamp:Date.now()});else try{const t=new FormData(this.form),e={...this.task,barBackgroundColor:t.get("barBackgroundColor"),endTime:mr(t.get("endTime")).format(this.dateFormat),name:t.get("name"),progress:Number(t.get("progress")),rowBackgroundColor:t.get("rowBackgroundColor"),startTime:mr(t.get("startTime")).format(this.dateFormat)},n=this.dataManager.getTaskById(this.task.id);this.emitEvent(Ki.TASK_UPDATE,{taskId:this.task.id,updates:e,updatedTask:{...n,...e},timestamp:Date.now()}),this.onSubmit(e),this.emitEvent(Ki.TASK_UPDATE_SUCCESS,{taskId:this.task.id,updatedTask:{...n,...e},timestamp:Date.now()})}catch(t){this.emitEvent(Ki.TASK_UPDATE_ERROR,{taskId:this.task.id,error:t instanceof Error?t:new Error(String(t)),timestamp:Date.now()})}}setupFieldValidation(t){const e=t.querySelector('[name="name"]'),n=t.querySelector('[name="startTime"]'),r=t.querySelector('[name="endTime"]'),i=t.querySelector('[name="progress"]');null==e||e.addEventListener("change",(()=>{const t=this.validateName(e.value);t?this.showError("name",t):this.clearError("name")}));const o=()=>{const{endError:t,startError:e}=this.validateDates(n.value,r.value);e?this.showError("startTime",e):this.clearError("startTime"),t?this.showError("endTime",t):this.clearError("endTime")};null==n||n.addEventListener("change",o),null==r||r.addEventListener("change",o),null==i||i.addEventListener("change",(()=>{const t=this.validateProgress(Number(i.value));t?this.showError("progress",t):this.clearError("progress")}))}showError(t,e){var n,r;const i=this.form.querySelector(`[name="${t}"]`),o=this.chartContext.createElement("div");o.className="form-error",o.textContent=e;const s=null==(n=i.parentElement)?void 0:n.querySelector(".form-error");null==s||s.remove(),null==(r=i.parentElement)||r.appendChild(o),i.classList.add("invalid"),this.errors.push({field:t,message:e}),this.updateSubmitButton()}updateSubmitButton(){if(this.submitButton||(this.submitButton=this.form.querySelector(".btn-primary")),this.submitButton){const t=this.errors.length>0;this.submitButton.disabled=t,this.submitButton.classList.toggle("btn-disabled",t)}}validateDates(t,e){const n={endError:null,startError:null},r=mr(t),i=mr(e);return t||(n.startError="Start date is required"),e||(n.endError="End date is required"),r.isValid()&&i.isValid()&&i.isBefore(r)&&(n.endError="End date must be after start date"),n}validateName(t){return t.trim()?null:"Task name is required"}validateProgress(t){return t||0===t?isNaN(t)||t<0||t>100?"Progress must be between 0 and 100":null:"Progress is required"}getElement(){return this.form}}class eo{constructor(t,e,n,r,i,o,s){this.task=t,this.ganttStartDate=e,this.options=n,this.viewMode=r,this.index=i,this.chartContext=o,this.dataManager=s,this.tooltipHandler=null}static calculateWidth(t,e,n){const{barMargin:r,rowHeight:i}=n;if(t.type===co.Milestone)return(i-r)/2;const o=mr(t.startTime);return mr(t.endTime).add(1,"days").diff(o,`${e}s`,!0)*Pi[e]}static calculateX(t,e,n,r){const i=mr(t.startTime).diff(e.startOf(n),`${n}s`,!0)*Pi[n];let o=0;if(t.type===co.Milestone){const{barMargin:t,rowHeight:e}=r;o=(e-t)/4*-1}return i+o}calculateHeight(){const{barMargin:t,rowHeight:e}=this.options;return this.task.type===co.Milestone?(e-t)/2:e-2*t}setupTooltip(t){if(!this.options.enableTooltip)return;const{tooltipBGColor:e,tooltipBorderColor:n,fontColor:r,fontFamily:i,fontSize:o,fontWeight:s,tooltipId:a,tooltipTemplate:l,inputDateFormat:u}=this.options;let c=!1,h=null;const d=t=>{c=!0,h&&(clearTimeout(h),h=null);const{x:d,y:f}=((t,e,n=300,r=120,i=20,o=20)=>{const s=window.innerWidth,a=window.innerHeight,l=window.scrollX||document.documentElement.scrollLeft,u=window.scrollY||document.documentElement.scrollTop;let c=t+i+l,h=e+o+u;return t+i+n>s&&(c=t-n-i+l),e+o+r>a&&(h=e-r-o+u),c=Math.max(l+5,c),h=Math.max(u+5,h),{x:c,y:h}})(t.clientX,t.clientY,300,120,5,10),p=l(this.dataManager.getTaskById(this.task.id),u),m=(({bgColor:t,borderColor:e,fontColor:n,fontFamily:r,fontSize:i,fontWeight:o,maxWidth:s,padding:a,x:l,y:u})=>{const c=["position: absolute;","z-index: 1000;","pointer-events: none;"];return c.push("box-sizing: border-box;"),c.push("word-wrap: break-word;"),c.push("overflow-wrap: break-word;"),c.push(`left: ${l}px;`),c.push(`top: ${u}px;`),e&&c.push(`border: 1px solid ${e};`),s&&(c.push(`width: ${s}px;`),c.push(`max-width: ${s}px;`)),c.push("border-radius: 6px;"),c.push("box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);"),c.push("transition: opacity 0.2s ease;"),c.push(`color: ${n||"#000000"};`),c.push(`font-family: ${r||"sans-serif"};`),c.push(`font-weight: ${o||"400"};`),c.push(`font-size: ${i||"14px"};`),c.push(`background-color: ${t||"#FFFFFF"};`),void 0!==a&&c.push(`padding: ${a}px;`),c.join(" ")})({bgColor:e,borderColor:n,fontColor:r,fontFamily:i,fontSize:o,fontWeight:s,maxWidth:300,padding:0,x:d,y:f});ar(this.chartContext,a,m,p)};t.addEventListener("mouseenter",d),t.addEventListener("mousemove",d),t.addEventListener("mouseleave",(()=>{c=!1,h=window.setTimeout((()=>{c||ar(this.chartContext,a)}),100)}))}setupTaskEdit(t,e){if(!this.options.enableTaskEdit)return;const n=this.chartContext.getInstanceId();t.addEventListener("dblclick",(t=>{t.stopPropagation(),t.preventDefault();const r=this.dataManager.getTaskById(this.task.id);if(!r)return;const i=this.chartContext.getChartContainer(),o=new to(this.chartContext,this.dataManager,r,i,(t=>{null==e||e(r.id,t),a.hide()}),this.options.inputDateFormat),s=`taskDialog-${n}-${this.task.id}`,a=new Qi(this.chartContext,{closeOnClickOutside:!1,closeOnEscape:!0,content:o.getElement(),id:s,modal:!0,title:`Edit Task: ${this.task.name}`,width:"400px",positionRelativeToChart:!0});a.show()}))}setupInteractions(t,e){const{enableTaskDrag:n,enableTaskResize:r}=this.options;if(n&&this.makeDraggable(t,e),r&&this.task.type===co.Task){const n=ur(this.chartContext,{className:"bar-handle handle-left"}),r=ur(this.chartContext,{className:"bar-handle handle-right"});t.append(n,r),this.makeResizable(t,e)}}drawBar(t=Li.noop){const{barBackgroundColor:e,barBorderRadius:n}=this.options,r=ur(this.chartContext,{className:"bar-timeline"}),i=ur(this.chartContext,{className:"bar-label",content:this.task.name}),o=ur(this.chartContext,{className:"bar-timeline-progress"}),s=this.task.barBackgroundColor||e,a=lr(this.getBarStyles(s)),l=lr({backgroundColor:hr(s,-80),borderRadius:n,width:`${this.task.progress}%`}),u=this.chartContext.getInstanceId();return r.setAttribute("data-taskid",this.task.id),r.setAttribute("data-chart-instance",u),o.setAttribute("style",l),r.setAttribute("style",a),r.setAttribute("role","progressbar"),r.setAttribute("aria-label",`${this.task.name}: ${this.task.progress}% complete`),r.setAttribute("aria-valuenow",this.task.progress.toString()),r.setAttribute("aria-valuemin","0"),r.setAttribute("aria-valuemax","100"),r.setAttribute("tabindex","0"),this.task.type!==co.Milestone&&r.append(i),r.append(o),this.setupTaskEdit(r,t),this.setupTooltip(r),this.setupInteractions(r,t),r.addEventListener("keydown",(t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),r.dispatchEvent(new MouseEvent("dblclick",{bubbles:!0})))})),r}getBarStyles(t){const{barBackgroundColor:e,barBorderRadius:n,barMargin:r,barTextColor:i,rowHeight:o}=this.options,s=eo.calculateX(this.task,this.ganttStartDate,this.viewMode,this.options),a=eo.calculateWidth(this.task,this.viewMode,this.options),l=this.calculateHeight(),u=t||e;return this.task.type===co.Milestone?{backgroundColor:hr(u,-80),borderRadius:"2px",color:i,height:`${l}px`,left:`${s}px`,top:o/3-r/2+this.index*o+"px",transform:"rotate(45deg)",width:`${a}px`}:{backgroundColor:u,borderRadius:n,color:i,height:`${l}px`,left:`${s}px`,top:`${r+this.index*o}px`,width:`${a}px`}}makeDraggable(t,e){new Zi(this.task.id,this.options,this.viewMode,this.chartContext,this.dataManager).makeDraggable(t,e)}makeResizable(t,e){new Ji(this.task.id,this.options,this.viewMode,this.chartContext,this.dataManager).makeResizable(t,e)}cleanup(){this.tooltipHandler&&(this.tooltipHandler.cleanup(),this.tooltipHandler=null)}}var no=(t=>(t.Duration="duration",t.EndTime="endTime",t.Name="name",t.Progress="progress",t.StartTime="startTime",t))(no||{});const ro={duration:"Duration",name:"Task Name",progress:"Progress",startTime:"Start"},io=[{key:"name",title:ro.name,minWidth:"120px",flexGrow:3},{key:"startTime",title:ro.startTime,minWidth:"70px",flexGrow:1.5},{key:"duration",title:ro.duration,minWidth:"50px",flexGrow:1},{key:"progress",title:ro.progress,minWidth:"50px",flexGrow:1}];function oo(t,e,n){const r=t[e];if("startTime"===e)return mr(r,n).format(n);if("endTime"===e)return mr(r,n).format(n);if("duration"===e){const e=mr(t.startTime,n),r=mr(t.endTime,n);return t.endTime?`${r.diff(e,"d")+1} d`:"0 d"}if("progress"===e){return`${t.progress??0}%`}return r}function so(t,e){const n=`.tasks-container .tasks-data-row[data-taskid="${e}"][data-chart-instance="${t.getInstanceId()}"]`,r=t.querySelector(n);return r}function ao(t,e){return(null==e?void 0:e.length)?e[t%e.length]:"transparent"}function lo(t,e,n){const r=so(t,e),i=ji(t,e);r&&(r.style.backgroundColor=n),i&&(i.style.backgroundColor=n)}const uo=(t,e,n,r,i,o,s)=>{const{taskBar:a,taskBarRow:l,taskRow:u}=((t,e)=>{const n=so(t,e);return{taskBar:Bi(t,e),taskBarRow:ji(t,e),taskRow:n}})(t,n);if(!u||!a)return;const c=e.updateTask(n,r);if(!c)return;if(u.querySelectorAll("td").forEach((r=>{const o=r.getAttribute("data-columnid");if(o&&(r.innerHTML=oo(c,o,i.inputDateFormat),"name"===o))if(e.hasChildren(n)){const i=t.createElement("span");i.className="task-toggle-icon "+(c.collapsed?"collapsed":"expanded"),i.addEventListener("click",(()=>{e.toggleTask(n)})),r.prepend(i)}else{const e=t.createElement("span");e.className="task-toggle-icon-blank",r.prepend(e)}})),r.rowBackgroundColor&&l&&(u.style.backgroundColor=r.rowBackgroundColor,l.style.backgroundColor=r.rowBackgroundColor),r.barBackgroundColor&&(a.style.backgroundColor=r.barBackgroundColor),r.startTime||r.endTime){const t=eo.calculateX(c,s,o,i),e=eo.calculateWidth(c,o,i);a.style.left=`${t}px`,a.style.width=`${e}px`}if(void 0!==r.progress){const t=a.querySelector(".bar-timeline-progress");t&&(t.style.width=`${r.progress}%`),r.barBackgroundColor&&(t.style.backgroundColor=hr(r.barBackgroundColor,-80))}if(r.name){const t=a.querySelector(".bar-label");t&&(t.textContent=r.name)}e.updateDependencyArrows(n,t)};var co=(t=>(t.Milestone="milestone",t.Task="task",t))(co||{});class ho{constructor(t,e,n){this.options=t,this.chartContext=e,this.dataManager=n,this.effectiveColumnList=this.mergeColumnConfig(),this.injectDynamicColumnStyles()}mergeColumnConfig(){return this.options.columnConfig&&0!==this.options.columnConfig.length?io.map((t=>{var e;const n=null==(e=this.options.columnConfig)?void 0:e.find((e=>e.key===t.key));return n?{...t,...n}:t})):io}injectDynamicColumnStyles(){const t=this.effectiveColumnList.map((t=>`minmax(${t.minWidth||"30px"}, ${t.flexGrow||1}fr)`)).join(" ");const e=this.chartContext.getInstanceId(),n=`\n .tasks-container .tasks-header[data-chart-instance="${e}"] .tasks-header-row {\n grid-template-columns: ${t};\n }\n\n .tasks-container .tasks-data-row[data-chart-instance="${e}"] {\n grid-template-columns: ${t};\n }\n `;this.chartContext.injectStyles(n,`tasks-dynamic-columns-${e}`,{priority:"high"})}generateBody(t,e){const n=ur(this.chartContext,{className:"tasks-data-container"});return this.generateRows(t,n,e),n}generateHeader(t){const e=ur(this.chartContext,{className:"tasks-header"}),n=ur(this.chartContext,{className:"tasks-header-row"}),{headerBackground:r,rowHeight:i,fontColor:o}=this.options,s=this.chartContext.getInstanceId();return e.setAttribute("data-chart-instance",s),zi(t,(t=>{const e=ur(this.chartContext,{className:"tasks-header-cell",content:t});e.style.height=2*i+"px",e.style.color=o,n.append(e)})),e.append(n),e.style.background=r,e}generateRow(t,e){const n=ur(this.chartContext,{className:"tasks-data-row"}),{rowHeight:r,fontColor:i}=this.options,o=this.chartContext.getInstanceId();return n.setAttribute("data-taskid",t.id),n.setAttribute("data-chart-instance",o),n.style.height=`${r}px`,zi(this.effectiveColumnList,(({key:s})=>{const a=ur(this.chartContext,{className:"tasks-data-cell",content:oo(t,s,this.options.inputDateFormat)});if(a.setAttribute("data-columnid",s),a.setAttribute("data-chart-instance",o),a.style.height=`${r}px`,a.style.color=i,s===no.Name){if(a.style.paddingLeft=15*t.level+"px",a.style.textAlign="left",a.innerHTML="",this.dataManager.hasChildren(t.id)){const n=cr(this.chartContext,"span",{className:"task-toggle-icon "+(t.collapsed?"collapsed":"expanded")});n.addEventListener("click",(()=>{this.dataManager.toggleTask(t.id),e()})),a.append(n)}else{const t=cr(this.chartContext,"span",{className:"task-toggle-icon-blank"});a.append(t)}const n=cr(this.chartContext,"span",{textContent:t.name});a.append(n)}n.append(a)})),n}generateRows(t,e,n){return zi(t,(t=>{const r=this.generateRow(t,n);e.appendChild(r)})),this.fillEmptyRows(e,t.length,n),e}fillEmptyRows(t,e,n){const r=this.chartContext.querySelector(".gantt-container");if(!r)return;const i=r.clientHeight,o=this.options.rowHeight,s=i-2*o,a=Math.floor(s/o),l=Math.max(0,a-e);for(let e=0;e<l;e++){const n=this.generateEmptyRow(e);t.appendChild(n)}}generateEmptyRow(t){const e=ur(this.chartContext,{className:"tasks-data-row tasks-empty-row"}),{rowHeight:n,fontColor:r}=this.options,i=this.chartContext.getInstanceId();return e.setAttribute("data-taskid",`empty-${t}`),e.setAttribute("data-chart-instance",i),e.style.height=`${n}px`,zi(this.effectiveColumnList,(({key:t})=>{const o=ur(this.chartContext,{className:"tasks-data-cell",content:""});o.setAttribute("data-columnid",t),o.setAttribute("data-chart-instance",i),o.style.height=`${n}px`,o.style.color=r,e.append(o)})),e}render(t){return[this.generateHeader(this.effectiveColumnList.map((t=>t.title))),this.generateBody(this.dataManager.getFlatVisibleTasks(),t)]}}const fo="root";class po{constructor(t=[]){this.dependencies=[],this.taskMap={},this.taskTree={},this.arrowLinkInstanceId=null,this.setTasks(t)}buildTaskTree(t){const e={[fo]:[]};t.forEach((t=>{var n;this.taskMap[t.id]=t,e[t.id]||(e[t.id]=[]),e[t.parentId]||(e[t.parentId]=[]),t.dependency&&this.addDependency(t.dependency,t.id),t.parentId?null==(n=e[t.parentId])||n.push(t.id):e[fo].push(t.id)})),this.taskTree=e}processLevel(){const t=(e,n)=>{e.forEach((e=>{this.taskMap[e.id]={...e,level:n};const r=this.taskTree[e.id].map((t=>this.taskMap[t]));Array.isArray(r)&&t(r,n+1)}))};t(this.getTasks().filter((t=>!t.parentId)),1)}sortTasksByDate(t){const e=(e,n)=>new Date(e[t]).getTime()-new Date(n[t]).getTime(),n=(t,r)=>{t.sort(e),r&&(this.taskTree[r]=t.map((t=>t.id))),t.forEach((t=>{const e=this.taskTree[t.id].map((t=>this.getTaskById(t)));e&&e.length>0&&n(e,t.id)}))},r=this.taskTree[fo].map((t=>this.getTaskById(t)));n(r,fo)}validateTask(t){if("milestone"===t.type){if(!t.id||!t.startTime)throw new Error("Milestone must have an id and start date")}else if(!t.id||!t.startTime||!t.endTime)throw new Error("Task must have an id, start, and end date");return{...t,endTime:t.endTime||t.startTime,progress:t.progress??0,type:t.type??co.Task,level:1}}addDependency(t,e,n="FS"){this.dependencies.push({fromId:t,toId:e,type:n})}addTask(t){const e=this.validateTask(t);this.taskMap[e.id]=e,this.buildTaskTree(this.getTasks())}calculateProgress(){const t=this.getTasks(),e=t.reduce(((t,e)=>t+mr(e.endTime).diff(mr(e.startTime),"day")),0),n=t.reduce(((t,e)=>t+e.progress/100*mr(e.endTime).diff(mr(e.startTime),"day")),0);return e?n/e*100:0}getDateRange(t=0,e){const n=this.getTasks();if(0===n.length){const n=mr().startOf(e);let r=1;switch(e){case"day":r=30;break;case"week":case"month":default:r=12;break;case"quarter":r=4;break;case"year":r=5}const i=n.add(r+t,e);return[n,i]}const r=n.map((t=>mr(t.startTime))),i=n.filter((t=>!!t.endTime)).map((t=>mr(t.endTime)));return[mr.min(r),mr.max(i).add(t,e)]}getFlatSortedTasks(t,e=!1){let n=[];return t.forEach((t=>{n.push(t);const r=this.taskTree[t.id].map((t=>this.taskMap[t]));!e&&t.collapsed||!Array.isArray(r)||(n=n.concat(this.getFlatSortedTasks(r,e)))})),n}getFlatTasks(){return this.getFlatSortedTasks(this.taskTree[fo].map((t=>this.getTaskById(t))),!0)}getFlatVisibleTasks(){return this.getFlatSortedTasks(this.taskTree[fo].map((t=>this.getTaskById(t))))}getNestedChildTasks(t,e=!1){const n=[],r=t=>{var i;if(e&&(null==(i=this.taskMap[t])?void 0:i.collapsed))return;(this.taskTree[t]||[]).forEach((t=>{const e=this.taskMap[t];e&&(n.push(e),r(t))}))};return r(t),n}getTaskById(t){return this.taskMap[t]}getTaskDependencies(t){return{incoming:this.dependencies.filter((e=>e.toId===t)),outgoing:this.dependencies.filter((e=>e.fromId===t))}}getTasks(){return Object.values(this.taskMap)}getTopParentTasks(){return Object.values(this.taskMap).filter((t=>void 0===t.parentId&&t.type===co.Task))}hasChildren(t){return this.taskTree[t].length>0}removeDependency(t,e){this.dependencies=this.dependencies.filter((n=>!(n.fromId===t&&n.toId===e)))}removeTask(t){this.taskMap[t]=void 0,this.buildTaskTree(Object.values(this.taskMap))}setTasks(t){if(!Array.isArray(t))throw new Error("Tasks must be an array");const e=t.map((t=>this.validateTask(t)));this.taskMap={},this.dependencies=[],this.buildTaskTree(e),this.sortTasksByDate("startTime"),this.processLevel()}toggleTask(t){const e=this.getTaskById(t);this.taskMap[t]={...e,collapsed:!e.collapsed}}setArrowLinkInstanceId(t){this.arrowLinkInstanceId=t}updateDependencyArrows(t,e){const n=this.getTaskDependencies(t);[...n.incoming,...n.outgoing].forEach((t=>{const n=this.getTaskById(t.fromId),r=this.getTaskById(t.toId);if(n&&r){const n=(null==e?void 0:e.getInstanceId())||"unknown",r={fromId:t.fromId,toId:t.toId,type:t.type,chartInstanceId:n,arrowLinkInstanceId:this.arrowLinkInstanceId},i=new CustomEvent("dependency-arrow-update",{detail:r,bubbles:!1,cancelable:!1});e?e.dispatchEvent(i):document.dispatchEvent(i)}}))}updateTask(t,e){const n=this.taskMap[t];if(!n)throw new Error(`Task with id "${t}" not found`);const r=this.validateTask({...n,...e});return this.taskMap[t]=r,this.buildTaskTree(this.getTasks()),r}}const mo={1:["Jan","Feb","Mar"],2:["Apr","May","Jun"],3:["Jul","Aug","Sep"],4:["Oct","Nov","Dec"]};function go(t,e,n){const r=[];let i=t.startOf(n);const o=e.startOf(n);for(;i.isSameOrBefore(o);)r.push(i),i=i.add(1,`${n}s`);return r}function yo(t,e){return go(t,e,Ni.Month)}function vo(t,e){return go(t,e,Ni.Year)}function bo(t,e,n){const r=function(t,e){return go(t,e,Ni.Day)}(t,e),i=yo(t,e),o=r.map((t=>t.format("DD MMM")));return[i.map(((r,o)=>0===o?{data:r.format("MMM YYYY"),width:(r.daysInMonth()-t.date()+1)*n}:o===i.length-1?{data:r.format("MMM YYYY"),width:(r.daysInMonth()-(r.daysInMonth()-e.date()))*n}:{data:r.format("MMM YYYY"),width:r.daysInMonth()*n})),o]}function wo(t,e,n){const r=function(t,e){return go(t,e,Ni.Week)}(t,e),i=yo(t,e),o=r.map((t=>`#${t.week()}, ${t.day(0).format("DD MMM")} - ${t.day(6).format("DD MMM")}`));return[i.map(((r,o)=>{if(0===o){const e=r.endOf("month").date()-t.date()+1;return{data:r.format("MMMM, YYYY"),width:(e<7?7:e)/7*n}}if(o===i.length-1){const t=e.date()-r.startOf("month").date()+1;return{data:r.format("MMMM, YYYY"),width:(t<7?7:t)/7*n}}const s=r.endOf("month").date()-r.startOf("month").date()+1;return{data:r.format("MMMM, YYYY"),width:(s<7?7:s)/7*n}})),o]}function xo(t,e,n){const r=function(t,e){const n=[];let r=t.startOf(Ni.Quarter);const i=e.startOf(Ni.Quarter);for(;r.isSameOrBefore(i);)n.push(r),r=r.add(1,`${Ni.Quarter}s`);return n}(t,e),i=vo(t,e),o=r.map((t=>{const e=mo[t.quarter()];return`#${t.quarter()} ${e[0]}-${e[2]}`}));return[i.map(((r,o)=>0===o?{data:r.format("YYYY"),width:(5-t.quarter())*n}:o===i.length-1?{data:r.format("YYYY"),width:e.quarter()*n}:{data:r.format("YYYY"),width:4*n})),o]}class _o{constructor(t,e,n,r){this.viewMode=t,this.options=e,this.chartContext=n,this.dataManager=r}generateHeader(t,e){const n=ur(this.chartContext,{className:"timeline-header"}),r=ur(this.chartContext,{className:"timeline-header-row"}),{headerBackground:i,rowHeight:o,fontColor:s}=this.options,a=this.chartContext.getInstanceId();if(n.setAttribute("data-chart-instance",a),zi(t,(t=>{const n=ur(this.chartContext,{className:"timeline-header-cell",content:t.data,style:{height:e?`${o}px`:2*o+"px",minWidth:`${t.width}px`||"100%",color:s}});r.append(n)})),n.append(r),!e)return n.style.background=i,n;const l=ur(this.chartContext,{className:"timeline-header-row"});return zi(e,(t=>{const e=ur(this.chartContext,{className:"timeline-header-cell",content:t,style:{height:`${o}px`,maxWidth:`${Pi[this.viewMode]}px`,minWidth:`${Pi[this.viewMode]}px`,color:s}});l.append(e)})),n.append(l),n.style.background=i,n}generateRow(t,e){const n=ur(this.chartContext,{className:"timeline-data-row"}),{rowHeight:r}=this.options,i=this.chartContext.getInstanceId();n.setAttribute("data-taskid",t),n.setAttribute("data-chart-instance",i);for(let t=0;t<e;t++){const t=ur(this.chartContext,{className:"timeline-data-cell",style:{height:`${r}px`,minWidth:`${Pi[this.viewMode]}px`}});t.setAttribute("data-chart-instance",i),n.append(t)}return n}generateRows(t,e){const n=ur(this.chartContext,{className:"timeline-body"}),r=this.chartContext.getInstanceId();return n.setAttribute("data-chart-instance",r),t.forEach((t=>{const r=this.generateRow(t.id,e);n.append(r)})),this.fillEmptyRows(n,t.length,e),n}fillEmptyRows(t,e,n){const r=this.chartContext.querySelector(".gantt-container");if(!r)return;const i=r.clientHeight,o=this.options.rowHeight,s=i-2*o,a=Math.floor(s/o),l=Math.max(0,a-e);for(let e=0;e<l;e++){const r=this.generateRow(`empty-${e}`,n);r.classList.add("timeline-empty-row"),t.append(r)}}getHeaderData(t,e,n){return n===Ni.Day?bo(t,e,Pi[this.viewMode]):n===Ni.Week?wo(t,e,Pi[this.viewMode]):n===Ni.Month?function(t,e,n){const r=yo(t,e),i=vo(t,e),o=r.map((t=>t.format("MMMM")));return[i.map(((r,o)=>0===o?{data:r.format("YYYY"),width:(12-t.month())*n}:o===i.length-1?{data:r.format("YYYY"),width:(e.month()+1)*n}:{data:r.format("YYYY"),width:12*n})),o]}(t,e,Pi[this.viewMode]):n===Ni.Quarter?xo(t,e,Pi[this.viewMode]):n===Ni.Year?function(t,e,n){return[vo(t,e).map((t=>({data:t.format("YYYY"),width:n}))),null]}(t,e,Pi[this.viewMode]):null}render(){const t=this.dataManager.getFlatVisibleTasks(),e=this.dataManager.getDateRange(8,this.viewMode),n=this.getHeaderData(e[0],e[1],this.viewMode);if(!n)return null;const[r,i]=n,o=this.generateHeader(r,i),s=this.generateRows(t,(i||r).length),a=ur(this.chartContext,{className:"bar-container"}),l=ur(this.chartContext,{className:"annotation-container"});zi(t,((t,n)=>{const r=new eo(t,e[0],this.options,this.viewMode,n,this.chartContext,this.dataManager).drawBar(((t,n)=>{uo(this.chartContext,this.dataManager,t,n,this.options,this.viewMode,e[0])}));a.append(r)}));const u=t.length*this.options.rowHeight,c=new qi(this.options,e[0],this.viewMode,this.chartContext,u).render();l.append(...c);const h=ur(this.chartContext,{className:"timeline-horizontal-scroll"}),d=ur(this.chartContext,{className:"timeline-horizontal-scroll-content"}),f=this.chartContext.getInstanceId();h.id=`timeline-horizontal-scroll-${f}`;const p=(i||r).length*Pi[this.viewMode];return d.style.width=`${p}px`,d.style.height="1px",h.appendChild(d),[o,l,s,a,h]}}const ko="\n .gantt-dialog-container {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: none;\n z-index: 999;\n overflow: hidden;\n }\n\n .gantt-dialog-container .dialog-overlay {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n }\n\n .gantt-dialog-container .gantt-dialog {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background: var(--dialog-bg-color, white);\n border-radius: 4px;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);\n border: 1px solid var(--dialog-border-color, #eee);\n z-index: 1000;\n min-width: 300px;\n max-width: 90%;\n max-height: 90%;\n display: flex;\n flex-direction: column;\n }\n\n .gantt-dialog .dialog-header {\n padding: 12px 16px;\n border-bottom: 1px solid var(--dialog-border-color, #eee);\n display: flex;\n justify-content: space-between;\n align-items: center;\n background: var(--header-bg-color, #f3f3f3);\n flex-shrink: 0;\n }\n\n .gantt-dialog .dialog-title {\n font-weight: 600;\n font-size: 16px;\n color: var(--header-text-color, #333);\n margin: 0;\n }\n\n .gantt-dialog .dialog-close {\n background: none;\n border: none;\n font-size: 20px;\n cursor: pointer;\n padding: 0;\n color: var(--text-color, #666);\n transition: color 0.2s;\n line-height: 1;\n }\n\n .gantt-dialog .dialog-close:hover {\n color: var(--text-color, #333);\n }\n\n .gantt-dialog .dialog-content {\n padding: 16px;\n overflow-y: auto;\n overflow-x: hidden;\n flex: 1;\n background: var(--dialog-bg-color, white);\n color: var(--text-color, #333);\n }\n\n .gantt-dialog .dialog-content::-webkit-scrollbar {\n width: 8px;\n }\n\n .gantt-dialog .dialog-content::-webkit-scrollbar-track {\n background: var(--dialog-bg-color, #f1f1f1);\n }\n\n .gantt-dialog .dialog-content::-webkit-scrollbar-thumb {\n background: var(--border-color, #888);\n border-radius: 4px;\n }\n\n .gantt-dialog .dialog-content::-webkit-scrollbar-thumb:hover {\n background: var(--text-color, #555);\n }\n\n .gantt-dialog-container.show {\n display: block;\n }\n\n .gantt-dialog-container.animate .dialog-overlay {\n animation: fadeIn 0.2s ease-out;\n }\n\n .gantt-dialog-container.animate .gantt-dialog {\n animation: slideIn 0.3s ease-out;\n }\n\n @keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n\n @keyframes slideIn {\n from {\n opacity: 0;\n transform: translate(-50%, -48%);\n }\n to {\n opacity: 1;\n transform: translate(-50%, -50%);\n }\n }\n\n .gantt-container {\n position: relative;\n }\n",Co="\n .dropdown {\n position: relative;\n display: inline-block;\n }\n\n .dropdown .gantt-action-button {\n border-radius: 4px;\n }\n\n .dropdown.show .gantt-action-button {\n background: var(--toolbar-hover-bg-color, #f8f9fa);\n border-color: var(--button-bg-color, #0066cc);\n }\n \n .dropdown-btn {\n padding: 8px 16px;\n background-color: var(--toolbar-bg-color, #fff);\n color: var(--text-color, rgba(0, 0, 0, 0.7));\n border: 1px solid var(--toolbar-border-color, #ddd);\n cursor: pointer;\n font-weight: bold;\n border-radius: 2px;\n font-family: inherit;\n font-size: inherit;\n line-height: 1.5;\n transition: background-color 0.2s ease, border-color 0.2s ease;\n }\n \n .dropdown-btn:hover {\n background-color: var(--toolbar-hover-bg-color, #f8f9fa);\n border-color: var(--toolbar-border-color, #bbb);\n }\n \n .dropdown-btn:focus {\n outline: none;\n border-color: var(--button-bg-color, #0066cc);\n box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);\n }\n \n .dropdown-content {\n display: none;\n position: absolute;\n background-color: var(--dialog-bg-color, #fff);\n min-width: 160px;\n box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);\n z-index: 1000;\n border-radius: 4px;\n right: 0;\n top: calc(100% + 4px);\n border: 1px solid var(--dialog-border-color, #D9D9D9);\n overflow: hidden;\n }\n \n .dropdown-content a {\n color: var(--text-color, #333);\n padding: 10px 14px;\n text-decoration: none;\n display: block;\n font-family: inherit;\n font-size: 13px;\n line-height: 1.4;\n transition: background-color 0.2s ease;\n cursor: pointer;\n }\n \n .dropdown-content a:hover {\n background-color: var(--toolbar-hover-bg-color, #f1f1f1);\n }\n \n .dropdown-content a:focus {\n background-color: var(--button-hover-bg-color, #e6f3ff);\n outline: none;\n }\n \n .dropdown.show .dropdown-content {\n display: block;\n animation: dropdownSlideDown 0.2s ease-out;\n }\n \n @keyframes dropdownSlideDown {\n from {\n opacity: 0;\n transform: translateY(-5px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n \n /* Shadow DOM specific adjustments */\n :host .dropdown {\n position: relative;\n display: inline-block;\n }\n",So="\n * {\n box-sizing: border-box;\n }\n\n .gantt-container * {\n user-select: none;\n }\n\n .gantt-actions-container {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 6px 10px;\n flex: 0 0 36px;\n min-height: 36px;\n max-height: 36px;\n background-color: var(--background-color, #FFFFFF);\n border-bottom: 1px solid var(--border-color, #DFE0E1);\n }\n\n .gantt-actions-spacer {\n flex: 1;\n min-width: 8px;\n }\n\n .gantt-action-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n padding: 0;\n border: 0;\n border-radius: 4px;\n background: var(--toolbar-bg-color, #fff);\n color: var(--text-color, #333);\n cursor: pointer;\n transition: all 0.15s ease;\n flex-shrink: 0;\n }\n\n .gantt-action-button:hover:not(:disabled) {\n background: var(--toolbar-hover-bg-color, #f8f9fa);\n border-color: var(--toolbar-border-color, #999);\n transform: translateY(-1px);\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);\n }\n\n .gantt-action-button:active:not(:disabled) {\n transform: translateY(0);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);\n }\n\n .gantt-action-button:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n background: var(--toolbar-bg-color, #fafafa);\n }\n\n .gantt-action-button svg {\n width: 16px;\n height: 16px;\n stroke: currentColor;\n flex-shrink: 0;\n }\n\n .gantt-action-separator {\n width: 1px;\n height: 20px;\n background-color: var(--border-color, #DFE0E1);\n margin: 0 4px;\n flex-shrink: 0;\n }\n\n .gantt-view-mode-display {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 4px 10px;\n height: 28px;\n font-size: 13px;\n color: var(--text-color, #666);\n background: var(--toolbar-bg-color, #f8f9fa);\n border-radius: 4px;\n margin-left: 4px;\n font-weight: 500;\n white-space: nowrap;\n flex-shrink: 0;\n }\n\n .gantt-view-mode-display svg {\n width: 14px;\n height: 14px;\n flex-shrink: 0;\n }\n \n .gantt-container {\n display: flex;\n flex: 1 1 auto;\n min-height: 0;\n min-width: 0;\n border: 1px solid var(--border-color, #DFE0E1);\n border-top: none;\n position: relative;\n background-color: var(--background-color, #FFFFFF);\n overflow: hidden;\n height: 100%;\n box-sizing: border-box;\n }\n \n .gantt-button {\n border: 1px solid var(--toolbar-border-color, #D9D9D9);\n border-radius: 2px;\n background: var(--toolbar-bg-color, #fff);\n padding: 4px 12px;\n color: var(--text-color, rgba(0, 0, 0, 0.7));\n line-height: 20px;\n font-weight: bold;\n cursor: pointer;\n transition: background-color 0.2s ease;\n }\n\n .gantt-button:hover {\n background: var(--toolbar-hover-bg-color, #f8f9fa);\n }\n \n .gantt-button:disabled {\n color: rgba(128, 128, 128, 0.5);\n opacity: 0.6;\n }\n",Eo="\n .gantt-container ::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n }\n\n .gantt-container ::-webkit-scrollbar-track {\n background: var(--scrollbar-track-color, #F5F5F5);\n border-radius: 4px;\n }\n\n .gantt-container ::-webkit-scrollbar-thumb {\n background: var(--scrollbar-thumb-color, #C1C1C1);\n border-radius: 4px;\n border: 2px solid var(--scrollbar-track-color, #F5F5F5);\n }\n\n .gantt-container ::-webkit-scrollbar-thumb:hover {\n background: var(--scrollbar-thumb-hover-color, #A8A8A8);\n }\n\n .gantt-container * {\n scrollbar-width: thin;\n scrollbar-color: var(--scrollbar-thumb-color, #C1C1C1) var(--scrollbar-track-color, #F5F5F5);\n }\n\n /* Shadow DOM support */\n :host .gantt-container ::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n }\n\n :host .gantt-container ::-webkit-scrollbar-track {\n background: var(--scrollbar-track-color, #F5F5F5);\n border-radius: 4px;\n }\n\n :host .gantt-container ::-webkit-scrollbar-thumb {\n background: var(--scrollbar-thumb-color, #C1C1C1);\n border-radius: 4px;\n border: 2px solid var(--scrollbar-track-color, #F5F5F5);\n }\n\n :host .gantt-container ::-webkit-scrollbar-thumb:hover {\n background: var(--scrollbar-thumb-hover-color, #A8A8A8);\n }\n\n :host .gantt-container * {\n scrollbar-width: thin;\n scrollbar-color: var(--scrollbar-thumb-color, #C1C1C1) var(--scrollbar-track-color, #F5F5F5);\n }\n",To='\n\n .task-form {\n overflow: visible;\n }\n\n .task-form .form-group {\n margin-bottom: 18px;\n position: relative;\n }\n\n /* extra padding to last form group for breathing room */\n .task-form .form-group:last-of-type {\n margin-bottom: 24px;\n }\n\n .task-form label {\n display: block;\n margin-bottom: 5px;\n font-weight: 500;\n color: var(--text-color, #333);\n }\n\n .task-form input {\n width: 100%;\n padding: 8px;\n border: 1px solid var(--dialog-border-color, #ddd);\n border-radius: 4px;\n font-size: 14px;\n background-color: var(--dialog-bg-color, #fff);\n color: var(--text-color, #333);\n }\n\n .task-form input:focus {\n outline: none;\n border-color: var(--button-bg-color, #0066cc);\n }\n\n .task-form .grid {\n display: flex;\n justify-content: space-between;\n gap: 12px;\n }\n\n .task-form .grid .form-group {\n flex: 1;\n }\n\n .task-form .form-actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n margin-top: 24px;\n padding-top: 16px;\n border-top: 1px solid var(--dialog-border-color, #eee);\n position: sticky;\n bottom: -16px;\n background: var(--dialog-bg-color, white);\n margin-left: -16px;\n margin-right: -16px;\n margin-bottom: -16px;\n padding-left: 16px;\n padding-right: 16px;\n padding-bottom: 16px;\n }\n\n .task-form .btn-primary {\n background: var(--button-bg-color, #0066cc);\n color: var(--button-text-color, white);\n border: none;\n padding: 8px 16px;\n border-radius: 4px;\n cursor: pointer;\n font-weight: 500;\n }\n\n .task-form .btn-primary:hover {\n background: var(--button-hover-bg-color, #0052a3);\n }\n\n .task-form .btn-disabled,\n .task-form .btn-disabled:hover {\n background: #99c2ff;\n cursor: not-allowed;\n opacity: 0.7;\n }\n\n .task-form .form-error {\n position: absolute;\n bottom: -15px;\n left: 0;\n color: #dc3545;\n font-size: 12px;\n margin-top: 4px;\n line-height: 1.2;\n transition: opacity 0.2s ease;\n }\n\n .task-form .invalid {\n border-color: #dc3545;\n }\n\n .task-form .invalid:focus {\n border-color: #dc3545;\n box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);\n }\n\n .color-picker-wrapper {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .color-picker-wrapper input[type="color"] {\n -webkit-appearance: none;\n width: 32px;\n height: 32px;\n padding: 0;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n }\n\n .color-picker-wrapper input[type="color"]::-webkit-color-swatch-wrapper {\n padding: 0;\n }\n\n .color-picker-wrapper input[type="color"]::-webkit-color-swatch {\n border: 1px solid var(--dialog-border-color, #ddd);\n border-radius: 4px;\n }\n\n .color-picker-wrapper .color-preview {\n font-size: 12px;\n color: var(--text-color, #666);\n }\n',Mo="\n .tasks-container {\n height: 100%;\n position: relative;\n display: flex;\n flex-direction: column;\n overflow-x: visible;\n overflow-y: visible;\n }\n\n .tasks-header {\n flex-shrink: 0;\n position: sticky;\n top: 0;\n z-index: 10;\n background-color: var(--header-bg-color, #F3F3F3);\n overflow: hidden;\n }\n\n .tasks-header-row {\n display: grid;\n width: 100%;\n }\n\n .tasks-header-cell {\n padding: 0 10px;\n text-align: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: flex;\n align-items: center;\n border: var(--cell-border-width, 1px) solid var(--cell-border-color, #eff0f0);\n color: var(--text-color, #000);\n box-sizing: border-box;\n font-weight: 600;\n }\n\n .tasks-body-wrapper {\n flex: 1;\n overflow: visible;\n position: relative;\n }\n\n .tasks-data-container {\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n\n .tasks-data-row {\n display: grid;\n width: 100%;\n border-bottom: var(--cell-border-width, 1px) solid var(--cell-border-color, #eff0f0);\n box-sizing: border-box;\n }\n\n .tasks-data-cell {\n padding: 0 10px;\n text-align: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: flex;\n align-items: center;\n border-left: var(--cell-border-width, 1px) solid var(--cell-border-color, #eff0f0);\n border-right: var(--cell-border-width, 1px) solid var(--cell-border-color, #eff0f0);\n color: var(--text-color, #000);\n box-sizing: border-box;\n }\n\n .tasks-data-row .tasks-data-cell:first-child {\n border-left: none;\n }\n\n .tasks-data-row .tasks-data-cell:last-child {\n border-right: none;\n }\n\n .tasks-data-row .task-toggle-icon,\n .tasks-data-row .task-toggle-icon-blank {\n display: inline-block;\n margin-right: 5px;\n width: 10px;\n height: 10px;\n vertical-align: middle;\n flex-shrink: 0;\n }\n\n .tasks-data-row .task-toggle-icon {\n cursor: pointer;\n position: relative;\n }\n\n /* Chevron (expanded) - pointing down */\n .tasks-data-row .task-toggle-icon.expanded::before {\n content: '';\n position: absolute;\n width: 6px;\n height: 6px;\n border-right: 2px solid var(--text-color, #000000);\n border-bottom: 2px solid var(--text-color, #000000);\n transform: rotate(45deg);\n top: 0;\n left: 2px;\n }\n\n /* Chevron - pointing right (collapsed) */\n .tasks-data-row .task-toggle-icon.collapsed::before {\n content: '';\n position: absolute;\n width: 6px;\n height: 6px;\n border-right: 2px solid var(--text-color, #000000);\n border-bottom: 2px solid var(--text-color, #000000);\n transform: rotate(-45deg);\n top: 2px;\n left: 0;\n }\n\n .tasks-data-row .task-toggle-icon:hover::before {\n opacity: 0.7;\n }\n\n /* Shadow DOM specific */\n :host .tasks-container {\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n :host .tasks-header {\n position: sticky;\n top: 0;\n z-index: 10;\n }\n",Ao="\n .gantt-container .timeline-container {\n width: 100%;\n height: 100%;\n position: relative;\n background-color: var(--background-color, #FFFFFF);\n display: flex;\n flex-direction: column;\n overflow: visible;\n padding-bottom: 0;\n box-sizing: border-box;\n }\n\n .timeline-container .timeline-header {\n position: sticky;\n top: 0;\n z-index: 100;\n background-color: var(--header-bg-color, #F3F3F3);\n flex-shrink: 0;\n overflow-x: auto;\n overflow-y: hidden;\n width: 100%;\n scrollbar-width: none; \n -ms-overflow-style: none; \n }\n\n .timeline-container .timeline-header::-webkit-scrollbar {\n display: none;\n height: 0;\n width: 0;\n }\n\n /* Shadow DOM specific */\n :host .timeline-container .timeline-header {\n scrollbar-width: none !important;\n -ms-overflow-style: none !important;\n }\n\n :host .timeline-container .timeline-header::-webkit-scrollbar {\n display: none !important;\n height: 0 !important;\n width: 0 !important;\n }\n\n .timeline-container .timeline-header > .timeline-header-row {\n width: max-content;\n position: relative;\n }\n\n .timeline-container .timeline-body-wrapper {\n flex: 1;\n overflow-x: auto;\n overflow-y: hidden;\n position: relative;\n width: 100%;\n min-height: 0;\n scrollbar-width: none;\n -ms-overflow-style: none;\n padding-bottom: 0; \n margin-bottom: 0;\n }\n\n .timeline-body-wrapper .timeline-horizontal-scroll, .timeline-container .timeline-body-wrapper::-webkit-scrollbar {\n display: none;\n height: 0;\n width: 0;\n }\n\n /* shadow DOM specific */\n :host .timeline-container .timeline-body-wrapper {\n scrollbar-width: none !important;\n -ms-overflow-style: none !important;\n }\n\n :host .timeline-container .timeline-body-wrapper::-webkit-scrollbar {\n display: none !important;\n height: 0 !important;\n width: 0 !important;\n }\n\n\n .timeline-horizontal-scroll {\n position: absolute;\n bottom: 0;\n height: 17px;\n overflow-x: auto;\n overflow-y: hidden;\n z-index: 300;\n background-color: var(--split-bar-color, var(--background-color, #FFFFFF));\n border-top: 1px solid var(--border-color, #DFE0E1);\n box-sizing: border-box;\n display: block;\n visibility: visible;\n opacity: 1;\n pointer-events: auto;\n }\n\n .timeline-horizontal-scroll-content {\n height: 1px;\n width: max-content;\n }\n\n .timeline-container .annotation,\n .timeline-container .annotation-container {\n position: absolute;\n top: 0;\n left: 0;\n pointer-events: none;\n }\n\n .timeline-container .annotation-container > * {\n pointer-events: auto;\n }\n\n .timeline-container .bar-container {\n position: absolute;\n top: 0;\n left: 0;\n pointer-events: none;\n }\n\n .timeline-container .bar-container > * {\n pointer-events: auto;\n }\n\n .timeline-container .bar-timeline {\n position: absolute;\n cursor: move;\n cursor: grab;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .timeline-container .bar-timeline .bar-handle {\n height: 100%;\n width: 5px;\n position: absolute;\n z-index: 1000;\n background: transparent;\n }\n\n .timeline-container .bar-timeline .bar-handle:hover {\n cursor: col-resize;\n }\n\n .resizing {\n pointer-events: none;\n opacity: 0.8;\n }\n\n .timeline-container .bar-timeline .bar-handle.handle-left {\n left: -5px;\n }\n\n .timeline-container .bar-timeline .bar-handle.handle-right {\n right: -5px;\n }\n\n .timeline-container .bar-timeline.dragging {\n cursor: grabbing;\n }\n\n .bar-timeline .bar-timeline-progress {\n position: absolute;\n pointer-events: none;\n height: 100%;\n left: 0;\n }\n\n .bar-timeline .bar-label {\n white-space: nowrap;\n pointer-events: none;\n overflow: hidden;\n z-index: 1;\n }\n\n .timeline-container .timeline-body {\n width: max-content;\n position: relative;\n padding-bottom: 17px;\n }\n \n .timeline-container .timeline-header-row,\n .timeline-container .timeline-data-row {\n display: flex;\n }\n\n .timeline-container .timeline-header-cell,\n .timeline-container .timeline-data-cell {\n padding: 0 10px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: flex;\n align-items: center;\n justify-content: center;\n border: var(--cell-border-width, 1px) solid var(--cell-border-color, #eff0f0);\n color: var(--text-color, #000);\n }\n\n .timeline-container .timeline-header-cell {\n background-color: var(--header-bg-color, #F3F3F3);\n color: var(--header-text-color, #333);\n }\n",Do='\n #apexgantt-tooltip-container,\n [role="tooltip"] {\n position: absolute;\n z-index: 1000;\n pointer-events: none;\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.2s ease;\n font-family: inherit;\n font-size: 13px;\n line-height: 1.4;\n display: none;\n width: 300px !important;\n max-width: 300px !important;\n box-sizing: border-box;\n }\n \n #apexgantt-tooltip-container.visible,\n [role="tooltip"].visible {\n display: block;\n opacity: 1;\n visibility: visible;\n }\n \n #apexgantt-tooltip-container .tooltip-content,\n [role="tooltip"] .tooltip-content {\n padding: 12px 16px;\n border-radius: 6px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);\n width: 100%;\n word-wrap: break-word;\n overflow-wrap: break-word;\n box-sizing: border-box;\n display: block;\n border: 1px solid rgba(255, 255, 255, 0.1);\n }\n \n /* Shadow DOM specific adjustments */\n :host #apexgantt-tooltip-container,\n :host [role="tooltip"] {\n position: absolute;\n z-index: 1000;\n pointer-events: none;\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.2s ease;\n font-family: inherit;\n font-size: 13px;\n line-height: 1.4;\n display: none;\n width: 300px !important;\n max-width: 300px !important;\n box-sizing: border-box;\n }\n \n :host #apexgantt-tooltip-container.visible,\n :host [role="tooltip"].visible {\n display: block;\n opacity: 1;\n visibility: visible;\n }\n\n #apexgantt-tooltip-container .tooltip-content div,\n [role="tooltip"] .tooltip-content div {\n margin: 6px 0;\n word-break: break-word;\n line-height: 1.4;\n }\n \n #apexgantt-tooltip-container .tooltip-content strong,\n [role="tooltip"] .tooltip-content strong {\n font-weight: 600;\n display: inline;\n margin-right: 8px;\n }\n \n #apexgantt-tooltip-container .tooltip-content span,\n [role="tooltip"] .tooltip-content span {\n display: inline;\n }\n \n /* First item (Name) styling */\n #apexgantt-tooltip-container .tooltip-content div:first-child,\n [role="tooltip"] .tooltip-content div:first-child {\n margin-bottom: 10px;\n padding-bottom: 8px;\n border-bottom: 1px solid rgba(255, 255, 255, 0.2);\n }\n \n #apexgantt-tooltip-container .tooltip-content div:first-child strong,\n [role="tooltip"] .tooltip-content div:first-child strong {\n font-weight: 700;\n }\n \n #apexgantt-tooltip-container .tooltip-content div:last-child,\n [role="tooltip"] .tooltip-content div:last-child {\n margin-bottom: 0;\n }\n',$o={paddingX:20,paddingY:15};class zo{constructor(t){this.elements=[],this.chartContext=null,this.instanceId=t||Math.random().toString(36).substr(2,9)}getInstanceId(){return this.instanceId}static calculateArrowPath(t,e,n,r){const i=sn(t,n),o=sn(e,n),s=i.right,a=i.top+i.height/2,l=o.left-2,u=o.top+o.height/2,{paddingX:c,paddingY:h}=r,d=[`M ${s},${a}`];if(l>s){if(u<a){const t=s+c,e=a-h,n=l-c,r=u+h;d.push(`L ${t},${a}`),d.push(`L ${t},${e}`),d.push(`L ${n},${e}`),d.push(`L ${n},${r}`),d.push(`L ${n},${u}`)}else if(u>a){const t=(s+l)/2;if(l-s<20){const t=s+c,e=a+h,n=l-c,r=u-h;d.push(`L ${t},${a}`),d.push(`L ${t},${e}`),d.push(`L ${n},${e}`),d.push(`L ${n},${r}`),d.push(`L ${n},${u}`)}else d.push(`L ${t},${a}`);d.push(`L ${t},${u}`)}}else if(l<s)if(u!==a){const t=s+c,e=a+h*(u<a?-1:1),n=l-c,r=u+h*(u<a?1:-1);d.push(`L ${t},${a}`),d.push(`L ${t},${e}`),d.push(`L ${n},${e}`),d.push(`L ${n},${r}`),d.push(`L ${n},${u}`)}else{const t=s+c,e=a+h,n=l-c,r=u;d.push(`L ${t},${a}`),d.push(`L ${t},${e}`),d.push(`L ${n},${e}`),d.push(`L ${n},${r}`)}return d.push(`L ${l},${u}`),d.join(" ")}static drawArrow(t,e,n,r,i,o,s){const a=s?s.createElementNS("http://www.w3.org/2000/svg","path"):document.createElementNS("http://www.w3.org/2000/svg","path"),l=zo.calculateArrowPath(t,e,n,r);a.setAttribute("d",l);const u=r.arrowColor||"#0D6EFD";a.setAttribute("stroke",u),a.setAttribute("stroke-width","2"),a.setAttribute("fill","transparent");const c=o?`arrowhead-${o}`:"arrowhead";return a.setAttribute("marker-end",`url(#${c})`),a.setAttribute("data-edgeid",i),a.addEventListener("mouseout",(function(){a.setAttribute("stroke",u)})),a}static updateArrow(t,e,n,r,i){const o=n.querySelector(`[data-edgeid="${i}"]`),s=zo.calculateArrowPath(t,e,n,r);o&&o.setAttribute("d",s)}createMarker(t){const e=t?t.createElementNS("http://www.w3.org/2000/svg","marker"):document.createElementNS("http://www.w3.org/2000/svg","marker"),n=`arrowhead-${this.instanceId}`;e.setAttribute("id",n),e.setAttribute("markerWidth","5"),e.setAttribute("markerHeight","5"),e.setAttribute("refX","4"),e.setAttribute("refY","2.5"),e.setAttribute("orient","auto"),e.setAttribute("fill","context-stroke");const r=t?t.createElementNS("http://www.w3.org/2000/svg","polygon"):document.createElementNS("http://www.w3.org/2000/svg","polygon");return r.setAttribute("points","0,0 5,2.5 0,5 1, 2.5"),e.appendChild(r),e}render(t,e,n,r){this.chartContext=r||null;const i=`timeline-arrows-${this.instanceId}`;let o=t.querySelector(`#${i}`);o||(o=r?r.createElementNS("http://www.w3.org/2000/svg","svg"):document.createElementNS("http://www.w3.org/2000/svg","svg"),o.setAttribute("id",i),t.appendChild(o)),this.svg=o,this.options={...$o,...n},this.elements=e,this.svg.setAttribute("style",lr({left:"0",position:"absolute",top:"0"})),this.svg.innerHTML="";const s=r?r.createElementNS("http://www.w3.org/2000/svg","defs"):document.createElementNS("http://www.w3.org/2000/svg","defs"),a=this.createMarker(r);return s.appendChild(a),this.svg.appendChild(s),this.svg.setAttribute("width",`${this.options.width}`),this.svg.setAttribute("height",`${this.options.height}`),this.elements.forEach((({id:t,source:e,target:n})=>{this.svg.appendChild(zo.drawArrow(e,n,this.svg,this.options,t,this.instanceId,r))})),this.svg}}function Io(t,e){t&&Object.assign(t.style,e)}function Oo(t){const e=[];for(let t=0;t<document.styleSheets.length;t++)try{const n=document.styleSheets[t];if(n.href&&!n.href.startsWith(window.location.origin))continue;if(n.cssRules)for(let t=0;t<n.cssRules.length;t++)e.push(n.cssRules[t].cssText)}catch(t){continue}document.querySelectorAll("style").forEach((t=>{t.textContent&&e.push(t.textContent)}));const n=function(t){const e=window.getComputedStyle(t),n=[];for(let e=0;e<t.style.length;e++){const r=t.style[e];if(r.startsWith("--")){const e=t.style.getPropertyValue(r);n.push(`${r}: ${e};`)}}return Array.from(e).forEach((t=>{if(t.startsWith("--")){const r=`${t}: ${e.getPropertyValue(t)};`;n.includes(r)||n.push(r)}})),0===n.length?"":`:root {\n ${n.join("\n ")}\n}`}(t);return n&&e.unshift(n),e.join("\n")}function Fo(t,e){const{contentWidth:n}=e,r=t.querySelector(".timeline-horizontal-scroll");null==r||r.remove();const i=t.querySelector(".timeline-container"),o=t.querySelector(".tasks-container"),s=t.querySelector(".timeline-body-wrapper"),a=t.querySelector(".timeline-header"),l=t.querySelector(".timeline-body"),u=t.querySelector(".bar-container"),c=t.querySelector(".annotation-container");var h;Io(i,{overflow:"visible",maxWidth:"none",width:"auto",position:"relative"}),Io(o,{overflow:"visible",height:"auto",maxHeight:"none"}),Io(s,{overflow:"visible",maxWidth:"none",width:`${n}px`}),s&&(s.scrollLeft=0),Io(a,{overflow:"visible",maxWidth:"none",width:`${n}px`}),a&&(a.scrollLeft=0),h={width:`${n}px`,minWidth:`${n}px`,maxWidth:"none"},[l,u,c].forEach((t=>Io(t,h)))}const Lo=async t=>{try{const e=function(t){const e=t.querySelector(".gantt-container");if(!e)throw new Error("Gantt container not found");const n=e.querySelector(".timeline-container"),r=e.querySelector(".tasks-container");if(!n||!r)throw new Error("Timeline or tasks container not found");return{ganttContainer:e,timelineContainer:n,tasksContainer:r,horizontalScroll:e.querySelector(".timeline-horizontal-scroll"),timelineBodyWrapper:n.querySelector(".timeline-body-wrapper"),timelineHeader:n.querySelector(".timeline-header"),timelineBody:n.querySelector(".timeline-body"),barContainer:n.querySelector(".bar-container"),annotationContainer:n.querySelector(".annotation-container")}}(t),n=function(t){var e,n,r,i;const o=Math.max((null==(e=t.timelineBody)?void 0:e.scrollWidth)||0,(null==(n=t.barContainer)?void 0:n.scrollWidth)||0,(null==(r=t.annotationContainer)?void 0:r.scrollWidth)||0,(null==(i=t.timelineHeader)?void 0:i.scrollWidth)||0),s=t.tasksContainer.scrollWidth;return{contentWidth:o,tasksWidth:s,totalWidth:s+o,totalHeight:Math.max(t.timelineContainer.scrollHeight,t.tasksContainer.scrollHeight)}}(e),r=e.ganttContainer.cloneNode(!0);Fo(r,n),Io(r,{display:"flex",overflow:"visible",width:"fit-content",height:"auto"});const i=Oo(t),o=document.createElement("style");o.textContent=i,r.insertBefore(o,r.firstChild);const s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttribute("width",n.totalWidth.toString()),s.setAttribute("height",n.totalHeight.toString()),s.setAttribute("xmlns","http://www.w3.org/2000/svg"),s.setAttribute("viewBox",`0 0 ${n.totalWidth} ${n.totalHeight}`);const a=document.createElementNS("http://www.w3.org/2000/svg","foreignObject");a.setAttribute("width",n.totalWidth.toString()),a.setAttribute("height",n.totalHeight.toString()),a.setAttribute("x","0"),a.setAttribute("y","0"),a.appendChild(r),s.appendChild(a);const l='<?xml version="1.0" encoding="UTF-8"?>\n'+(new XMLSerializer).serializeToString(s),u=new Blob([l],{type:"image/svg+xml;charset=utf-8"}),c=URL.createObjectURL(u),h=document.createElement("a");h.href=c,h.download=`gantt-chart-${Date.now()}.svg`,document.body.appendChild(h),h.click(),document.body.removeChild(h),setTimeout((()=>URL.revokeObjectURL(c)),100)}catch(t){throw t}},Bo={zoomIn:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="11" cy="11" r="8"/>\n <path d="m21 21-4.35-4.35"/>\n <line x1="11" y1="8" x2="11" y2="14"/>\n <line x1="8" y1="11" x2="14" y2="11"/>\n </svg>',zoomOut:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="11" cy="11" r="8"/>\n <path d="m21 21-4.35-4.35"/>\n <line x1="8" y1="11" x2="14" y2="11"/>\n </svg>',calendar:'<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <rect x="3" y="4" width="18" height="18" rx="2" ry="2"/>\n <line x1="16" y1="2" x2="16" y2="6"/>\n <line x1="8" y1="2" x2="8" y2="6"/>\n <line x1="3" y1="10" x2="21" y2="10"/>\n </svg>',chevronDown:'<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="6 9 12 15 18 9"/>\n </svg>',download:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>\n <polyline points="7 10 12 15 17 10"/>\n <line x1="12" y1="15" x2="12" y2="3"/>\n </svg>'};class jo{constructor(t,e,n,r={}){this.chartContext=t,this.leftContent=e,this.rightContent=n,this.options=r,this.isDragging=!1,this.mouseMoveHandler=null,this.mouseUpHandler=null}getSplitViewStyles(){return"\n .split-view-container {\n display: flex !important;\n height: 100%;\n width: 100%;\n position: relative;\n box-sizing: border-box;\n overflow-x: hidden;\n overflow-y: auto;\n }\n\n .split-view-container .split-left-container {\n flex-grow: 0 !important;\n flex-shrink: 1 !important;\n overflow: visible;\n display: flex !important;\n flex-direction: column;\n position: relative;\n box-sizing: border-box;\n height: fit-content;\n min-height: 100%;\n }\n\n .split-view-container .split-right-container {\n overflow: visible;\n position: relative;\n flex: 1 !important;\n display: flex !important;\n flex-direction: column;\n min-width: 0;\n box-sizing: border-box;\n height: fit-content;\n min-height: 100%;\n }\n \n .split-view-container .split-bar-container {\n cursor: col-resize !important;\n user-select: none !important;\n height: 100%;\n align-items: center;\n background: var(--split-bar-color, #DEE2E6);\n display: flex;\n flex: 0 0 auto;\n justify-content: center;\n min-width: 8px;\n width: 8px;\n z-index: 15;\n position: sticky;\n top: 0;\n box-sizing: border-box;\n border-left: 1px solid var(--split-bar-border-color, #BBBBBB);\n border-right: 1px solid var(--split-bar-border-color, #BBBBBB);\n opacity: 1;\n visibility: visible;\n box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);\n transition: background-color 0.2s ease, border-color 0.2s ease;\n }\n\n .split-view-container .split-bar-container:hover {\n background: var(--split-bar-hover-color, #007BFF);\n border-color: var(--split-bar-hover-border-color, #0056B3);\n }\n\n .split-view-container .split-bar-container .resize-handler {\n border-left: 1.5px solid var(--split-bar-handle-color, #666666);\n border-right: 1.5px solid var(--split-bar-handle-color, #666666);\n height: 20px;\n width: 4px;\n position: relative;\n pointer-events: none;\n box-sizing: border-box;\n background: rgba(102, 102, 102, 0.3);\n display: block;\n border-radius: 1px;\n margin: 0;\n padding: 0;\n opacity: 1;\n visibility: visible;\n transition: background-color 0.2s ease, border-color 0.2s ease;\n }\n\n .split-view-container .split-bar-container:hover .resize-handler {\n background: rgba(255, 255, 255, 0.9);\n border-color: #FFFFFF;\n }\n\n .split-view-container.dragging {\n user-select: none;\n cursor: col-resize;\n }\n\n .split-view-container.dragging * {\n pointer-events: none;\n }\n\n .split-view-container.dragging .split-bar-container {\n pointer-events: all;\n }\n\n :host .split-view-container {\n display: flex !important;\n height: auto;\n width: 100%;\n position: relative;\n box-sizing: border-box;\n overflow-y: auto; /* shadow DOM */\n }\n "}injectStyles(){this.chartContext.injectStyles(this.getSplitViewStyles(),"split-view-styles",{priority:"normal"})}buildElements(){const{leftContainerClass:t="",leftContainerWidth:e=425,rightContainerClass:n=""}=this.options;this.leftContainer=ur(this.chartContext,{className:"split-left-container"+(t?" "+t:""),style:{flexBasis:`${e}px`}}),this.rightContainer=ur(this.chartContext,{className:"split-right-container"+(n?" "+n:"")});const r=ur(this.chartContext,{className:"resize-handler"}),i=ur(this.chartContext,{className:"split-bar-click-area"});i.style.cssText="\n position: absolute;\n top: 0;\n left: 50%;\n transform: translateX(-50%);\n width: 20px;\n height: 100%;\n cursor: col-resize;\n z-index: 10;\n background: transparent;\n display: block;\n box-sizing: border-box;\n ",this.splitBarContainer=ur(this.chartContext,{className:"split-bar-container"}),this.splitBarContainer.setAttribute("role","separator"),this.splitBarContainer.setAttribute("aria-orientation","vertical"),this.splitBarContainer.setAttribute("aria-label","Resize panels"),this.splitBarContainer.setAttribute("tabindex","0"),this.splitBarContainer.append(r,i),Li.isArray(this.leftContent)?this.leftContainer.append(...this.leftContent):this.leftContainer.append(this.leftContent),Li.isArray(this.rightContent)?this.rightContainer.append(...this.rightContent):this.rightContainer.append(this.rightContent)}attachEventListeners(){this.splitBarContainer.addEventListener("mousedown",(t=>{t.preventDefault(),this.isDragging=!0;const e=this.splitBarContainer.closest(".split-view-container");null==e||e.classList.add("dragging"),this.mouseMoveHandler=t=>{var e;if(!this.isDragging)return;const n=null==(e=this.leftContainer.parentElement)?void 0:e.getBoundingClientRect();if(!n)return;const r=t.clientX-n.left,i=n.width-50,o=Math.max(0,Math.min(i,r));this.leftContainer.style.flexBasis=`${o}px`,this.dispatchResizeEvent()},this.mouseUpHandler=()=>{this.isDragging=!1;const t=this.splitBarContainer.closest(".split-view-container");null==t||t.classList.remove("dragging"),this.dispatchResizeEvent(),this.mouseMoveHandler&&(this.chartContext.removeEventListener("mousemove",this.mouseMoveHandler),this.mouseMoveHandler=null),this.mouseUpHandler&&(this.chartContext.removeEventListener("mouseup",this.mouseUpHandler),this.mouseUpHandler=null)},this.chartContext.addEventListener("mousemove",this.mouseMoveHandler),this.chartContext.addEventListener("mouseup",this.mouseUpHandler)})),this.splitBarContainer.addEventListener("keydown",(t=>{let e;const n=parseInt(this.leftContainer.style.flexBasis)||this.options.leftContainerWidth||400;switch(t.key){case"ArrowLeft":t.preventDefault(),e=Math.max(0,n-10),this.leftContainer.style.flexBasis=`${e}px`,this.dispatchResizeEvent();break;case"ArrowRight":t.preventDefault(),e=n+10,this.leftContainer.style.flexBasis=`${e}px`,this.dispatchResizeEvent();break;case"Home":t.preventDefault(),this.leftContainer.style.flexBasis="0px",this.dispatchResizeEvent();break;case"End":{t.preventDefault();const e=this.splitBarContainer.parentElement;if(e){const t=e.clientWidth-50;this.leftContainer.style.flexBasis=`${t}px`}this.dispatchResizeEvent();break}}}))}dispatchResizeEvent(){const t=new CustomEvent("splitview-resize",{bubbles:!0,detail:{leftWidth:parseInt(this.leftContainer.style.flexBasis)||0}});this.chartContext.dispatchEvent(t)}cleanupEventListeners(){this.mouseMoveHandler&&(this.chartContext.removeEventListener("mousemove",this.mouseMoveHandler),this.mouseMoveHandler=null),this.mouseUpHandler&&(this.chartContext.removeEventListener("mouseup",this.mouseUpHandler),this.mouseUpHandler=null)}render(){this.injectStyles(),this.buildElements(),this.attachEventListeners();const t=ur(this.chartContext,{className:"split-view-container"});return t.append(this.leftContainer,this.splitBarContainer,this.rightContainer),[t]}destroy(){this.cleanupEventListeners()}}class Ro{constructor(){this.state={scrollPosition:{horizontal:0,tasksVertical:0,timelineVertical:0},viewMode:Ni.Week,collapsedTasks:new Set}}captureState(t,e,n){const r=t.querySelector(".timeline-horizontal-scroll"),i=t.querySelector(".split-view-container");this.state.scrollPosition={horizontal:(null==r?void 0:r.scrollLeft)||0,tasksVertical:(null==i?void 0:i.scrollTop)||0,timelineVertical:(null==i?void 0:i.scrollTop)||0},this.state.viewMode=n,this.state.collapsedTasks=new Set(e.getFlatTasks().filter((t=>t.collapsed)).map((t=>t.id)))}restoreState(t,e=!1){e||requestAnimationFrame((()=>{const e=t.querySelector(".timeline-horizontal-scroll"),n=t.querySelector(".split-view-container");e&&(e.scrollLeft=this.state.scrollPosition.horizontal),n&&(n.scrollTop=this.state.scrollPosition.tasksVertical);const r=t.querySelector(".timeline-header");r&&(r.scrollLeft=this.state.scrollPosition.horizontal)}))}getViewMode(){return this.state.viewMode}hasState(){return void 0!==this.state.viewMode}clearState(){this.state={scrollPosition:{horizontal:0,tasksVertical:0,timelineVertical:0},viewMode:Ni.Week,collapsedTasks:new Set}}}class No{static getNestedValue(t,e){if(!t||!e)return;const n=e.split(".");let r=t;for(const t of n){if(null==r)return;r=r[t]}return r}static processParsingValue(t,e){if("string"==typeof e)return this.getNestedValue(t,e);const{key:n,transform:r}=e,i=this.getNestedValue(t,n);if(r&&"function"==typeof r)try{return r(i)}catch(t){return i}return i}static parse(t,e){return Array.isArray(t)&&e?t.map(((t,n)=>{try{const n=this.processParsingValue(t,e.id),r=this.processParsingValue(t,e.name),i=this.processParsingValue(t,e.startTime);if(!n||!r||!i)return null;const o={id:n,name:r,startTime:i};if(void 0!==e.endTime){const n=this.processParsingValue(t,e.endTime);void 0!==n&&(o.endTime=n)}if(void 0!==e.progress){const n=this.processParsingValue(t,e.progress);void 0!==n&&(o.progress=n)}if(void 0!==e.type){const n=this.processParsingValue(t,e.type);void 0!==n&&(o.type=n)}if(void 0!==e.parentId){const n=this.processParsingValue(t,e.parentId);void 0!==n&&(o.parentId=n)}if(void 0!==e.dependency){const n=this.processParsingValue(t,e.dependency);void 0!==n&&(o.dependency=n)}if(void 0!==e.barBackgroundColor){const n=this.processParsingValue(t,e.barBackgroundColor);void 0!==n&&(o.barBackgroundColor=n)}if(void 0!==e.rowBackgroundColor){const n=this.processParsingValue(t,e.rowBackgroundColor);void 0!==n&&(o.rowBackgroundColor=n)}if(void 0!==e.collapsed){const n=this.processParsingValue(t,e.collapsed);void 0!==n&&(o.collapsed=n)}return o}catch(t){return null}})).filter((t=>null!==t)):[]}static validateConfig(t){return!!t&&!!(t.id&&t.name&&t.startTime)}}mr.extend(br),mr.extend(yr),mr.extend(Tr),mr.extend(kr),mr.extend(Sr);class Ho extends e{constructor(t,e){super(t,"gantt_"+Math.random().toString(36).substr(2,9)),this.options=Gi,this.stylesInjected=!1,this.zoomHandler=null,this.timelineScrollHandlers={},this.isSyncingScroll=!1,this.scrollbarResizeObserver=null,this.splitBarResizeHandler=null,this.containerResizeObserver=null,this.lastKnownWidth=0,this.lastKnownHeight=0,this.resizeDebounceTimer=null;const n=Vi(null==e?void 0:e.theme);let r;r=(null==e?void 0:e.parsing)?No.validateConfig(e.parsing)?No.parse(e.series,e.parsing):[]:(null==e?void 0:e.series)||[],this.options={...n,...e,series:r},this.viewMode=this.options.viewMode;const i="arrows_"+Math.random().toString(36).substr(2,9);this.arrowLink=new zo(i),this.setupShadowDOMEnvironment(),this.dataManager=new po,this.dataManager.setTasks(this.options.series),this.dataManager.setArrowLinkInstanceId(i),this.stateManager=new Ro}static setLicense(t){r.setLicense(t)}setupShadowDOMEnvironment(){if(!this.isShadowDOM())return;const t=this.chartContext.getContext().host;t&&(t.style.display="block",t.style.boxSizing="border-box",t.style.contain="layout style"),this.element&&(this.element.style.display="block",this.element.style.boxSizing="border-box")}injectGanttStyles(){if(!this.stylesInjected)if(this.isShadowDOM())this.injectStylesDirectly();else try{const t=[{content:So,id:"gantt-core-styles",options:{priority:"high"}},{content:Ao,id:"gantt-timeline-styles"},{content:Mo,id:"gantt-table-styles"},{content:ko,id:"gantt-dialog-styles"},{content:To,id:"gantt-taskform-styles"},{content:Do,id:"gantt-tooltip-styles"},{content:en,id:"gantt-toolbar-styles"},{content:Co,id:"gantt-dropdown-styles"},{content:Eo,id:"gantt-scrollbar-styles"}];this.chartContext.injectStylesheets(t),this.stylesInjected=!0}catch(t){}}injectStylesDirectly(){const t=this.chartContext.getContext();if(t.querySelector("#gantt-all-styles"))return void(this.stylesInjected=!0);const e=document.createElement("style");e.id="gantt-all-styles",e.textContent=`\n /* Shadow DOM CSS Reset - Critical for proper layout */\n :host {\n all: initial;\n display: block;\n contain: layout style;\n }\n \n *, *::before, *::after {\n box-sizing: border-box;\n }\n \n div, table, thead, tbody, tr, td, th {\n display: revert;\n margin: 0;\n padding: 0;\n border: 0;\n }\n \n .split-view-container,\n .gantt-container {\n display: flex !important;\n width: 100% !important;\n height: 100% !important;\n }\n \n .split-left-container,\n .split-right-container {\n display: block !important;\n }\n \n .timeline-container {\n flex: 1 !important;\n overflow: auto !important;\n position: relative !important;\n }\n \n .tasks-container {\n flex-shrink: 0 !important;\n overflow: auto !important;\n }\n\n ${So}\n ${Ao}\n ${Mo}\n ${ko}\n ${To}\n ${Do}\n ${en}\n ${Co}\n ${Eo}\n `,t.insertBefore(e,t.firstChild),this.stylesInjected=!0}handleWatermark(){const t=this.element.querySelector(".gantt-container").parentNode;t&&(r.isLicenseValid()?rn.remove(t):rn.add(t))}setCSSVariables(){const{cellBorderColor:t,cellBorderWidth:e,fontColor:n,headerBackground:r,tooltipBGColor:i,tooltipBorderColor:o,barBackgroundColor:s,backgroundColor:a,borderColor:l,barTextColor:u,arrowColor:c}=this.options;this.element.style.setProperty("--cell-border-color",t),this.element.style.setProperty("--cell-border-width",e),this.element.style.setProperty("--gantt-font-color",n),this.element.style.setProperty("--text-color",n),this.element.style.setProperty("--header-bg-color",r),this.element.style.setProperty("--header-text-color",n),this.element.style.setProperty("--tooltip-bg-color",i),this.element.style.setProperty("--tooltip-border-color",o),this.element.style.setProperty("--tooltip-text-color",n),this.element.style.setProperty("--background-color",a),this.element.style.setProperty("--border-color",l),this.element.style.setProperty("--dialog-bg-color",a),this.element.style.setProperty("--dialog-border-color",l),this.element.style.setProperty("--button-bg-color",s),this.element.style.setProperty("--button-text-color",u),this.element.style.setProperty("--button-hover-bg-color",c),this.element.style.setProperty("--toolbar-bg-color",a),this.element.style.setProperty("--toolbar-border-color",l),this.element.style.setProperty("--toolbar-hover-bg-color",t),this.element.style.setProperty("--scrollbar-track-color",a),this.element.style.setProperty("--scrollbar-thumb-color",l),this.element.style.setProperty("--scrollbar-thumb-hover-color",t),this.element.style.setProperty("--split-bar-color",t),this.element.style.setProperty("--split-bar-hover-color",c),this.element.style.setProperty("--split-bar-border-color",l),this.element.style.setProperty("--split-bar-handle-color",n),this.element.style.setProperty("--split-bar-hover-border-color",c);this.isColorDark(a)?this.element.style.setProperty("--toolbar-icon-filter","invert(1) brightness(2)"):this.element.style.setProperty("--toolbar-icon-filter","none")}isColorDark(t){const e=t.replace("#","");return(.299*parseInt(e.substr(0,2),16)+.587*parseInt(e.substr(2,2),16)+.114*parseInt(e.substr(4,2),16))/255<.5}initializeTooltip(){const{enableTooltip:t,tooltipId:e}=this.options;if(t){const t=sr(this.chartContext,e);if(!this.chartContext.getElementById(e)){this.chartContext.getAppendContainer().appendChild(t)}}}render(t){if(!this.element)throw new Error("Element not found");const e=this.element&&this.element.children.length>0;e&&this.stateManager.captureState(this.element,this.dataManager,this.viewMode);const{enableResize:n,fontColor:r,fontFamily:i,fontSize:o,fontWeight:s,tasksContainerWidth:a,height:l,width:u}=this.options;this.setupChartContainerPositioning(),this.injectGanttStyles(),this.setCSSVariables(),this.initializeTooltip(),this.element.innerHTML="",this.hasExplicitDimensions();const c=this.normalizeDimension(l),h=this.normalizeDimension(u);this.element.style.width=h,this.element.style.height=c,this.element.style.display="flex",this.element.style.flexDirection="column",this.element.style.boxSizing="border-box",this.element.style.overflow="hidden";const d=lr({color:r,fontFamily:i,fontSize:o,fontWeight:s}),f=this.element.getAttribute("style")||"";this.element.setAttribute("style",f+";"+d);const p=ur(this.chartContext,{className:"gantt-actions-container"});this.renderToolbar(p);const m=ur(this.chartContext,{className:"gantt-container"}),g=new _o(this.viewMode,this.options,this.chartContext,this.dataManager).render(),y=new ho(this.options,this.chartContext,this.dataManager).render(this.render.bind(this));g&&this.createLayout(m,y,g,n,a),this.element.appendChild(p),this.element.appendChild(m);const v=m.querySelector(".timeline-horizontal-scroll");return v&&(v.remove(),this.element.appendChild(v)),this.handleWatermark(),this.setupRowBackgroundColors(),this.setupZoomEventListener(),this.setupDependencyArrowEvents(),this.renderDependencyArrows(),requestAnimationFrame((()=>{this.performAfterActions()})),e&&requestAnimationFrame((()=>{this.stateManager.restoreState(this.element)})),this.element}performAfterActions(){this.syncTasksColumnWidths(),this.compensateForScrollbar(),this.updateHorizontalScrollbarContent(),this.setupTimelineHorizontalScroll(),this.positionHorizontalScrollbar(),this.setupContainerResizeObserver(),this.setupScrollbarResizeObserver(),this.setupRowBackgroundColors(),this.disableHeaderMousewheelScroll(),this.fillEmptyRowsAfterRender()}setupChartContainerPositioning(){if(this.element){"static"===window.getComputedStyle(this.element).position&&(this.element.style.position="relative"),this.element.style.isolation="isolate"}}disableHeaderMousewheelScroll(){const t=this.element.querySelector(".timeline-header");if(!t)return;t.addEventListener("wheel",(t=>{t.preventDefault()}),{passive:!1})}createLayout(t,e,n,r,i){t.style.position="relative",t.style.isolation="isolate";const o=this.getInstanceId(),s=ur(this.chartContext,{className:"tasks-container"});let a,l;if(!Array.isArray(e))return;a=e[0],l=e[1];const u=ur(this.chartContext,{className:"tasks-body-wrapper"});u.appendChild(l),s.appendChild(a),s.appendChild(u);const c=ur(this.chartContext,{className:"timeline-container"});c.setAttribute("data-chart-instance",o);const h=n[0];c.appendChild(h);const d=ur(this.chartContext,{className:"timeline-body-wrapper"});for(let t=1;t<n.length-1;t++)d.appendChild(n[t]);c.appendChild(d);const f=n[n.length-1];if(r){const e=new jo(this.chartContext,s,c,{leftContainerClass:"",leftContainerWidth:i,rightContainerClass:""}).render();t.append(...e)}else s.style.flex=`0 0 ${i}px`,t.append(s,c);t.appendChild(f)}syncTasksColumnWidths(){this.element.querySelector(".tasks-container")}setupScrollbarResizeObserver(){if(!this.element)return;this.scrollbarResizeObserver&&this.scrollbarResizeObserver.disconnect(),this.scrollbarResizeObserver=new ResizeObserver((()=>{this.positionHorizontalScrollbar()})),this.scrollbarResizeObserver.observe(this.element);const t=this.element.querySelector(".gantt-container");t&&this.scrollbarResizeObserver.observe(t),this.setupSplitBarResizeListener()}setupSplitBarResizeListener(){this.splitBarResizeHandler&&this.chartContext.removeEventListener("splitview-resize",this.splitBarResizeHandler),this.splitBarResizeHandler=()=>{requestAnimationFrame((()=>{this.positionHorizontalScrollbar()}))},this.chartContext.addEventListener("splitview-resize",this.splitBarResizeHandler)}positionHorizontalScrollbar(){const t=this.element.querySelector(".timeline-horizontal-scroll"),e=this.element.querySelector(".gantt-container"),n=this.element.querySelector(".tasks-container");if(!t||!e)return;e.offsetHeight;const r=n?n.offsetWidth:0,i=this.element.querySelector(".split-bar-container"),o=r+(i?i.offsetWidth:0)+2,s=window.getComputedStyle(this.element),a=parseFloat(s.paddingLeft)||0,l=parseFloat(s.paddingBottom)||0;t.style.left=`${o+a}px`,t.style.bottom=`${l}px`;const u=e.clientWidth-o;t.style.width=`${Math.max(0,u)}px`}compensateForScrollbar(){const t=this.element.querySelector(".tasks-body-wrapper"),e=this.element.querySelector(".tasks-header");if(!t||!e)return;const n=t.offsetWidth-t.clientWidth;e.style.paddingRight="",e.style.boxSizing="",n>0&&(e.style.paddingRight=`${n}px`,e.style.boxSizing="border-box")}setupTimelineHorizontalScroll(){const t=this.element.querySelector(".timeline-horizontal-scroll"),e=this.element.querySelector(".timeline-header"),n=this.element.querySelector(".timeline-body-wrapper");if(!t||!e||!n)return;this.updateHorizontalScrollbarContent(),this.applyScrollbarStylesToElement(t),this.timelineScrollHandlers.bodyScroll&&n.removeEventListener("scroll",this.timelineScrollHandlers.bodyScroll),this.timelineScrollHandlers.horizontalScroll&&t.removeEventListener("scroll",this.timelineScrollHandlers.horizontalScroll);const r=r=>{if(this.isSyncingScroll)return;this.isSyncingScroll=!0;const i=t.scrollLeft;e.scrollLeft=i,n.scrollLeft=i,requestAnimationFrame((()=>{this.isSyncingScroll=!1}))},i=r=>{if(this.isSyncingScroll)return;this.isSyncingScroll=!0;const i=n.scrollLeft;t.scrollLeft=i,e.scrollLeft=i,requestAnimationFrame((()=>{this.isSyncingScroll=!1}))};t.addEventListener("scroll",r,{passive:!0}),n.addEventListener("scroll",i,{passive:!0}),this.timelineScrollHandlers={horizontalScroll:r,bodyScroll:i}}applyScrollbarStylesToElement(t){const{backgroundColor:e}=this.options;if(!this.isColorDark(e))return;const{borderColor:n,cellBorderColor:r}=this.options,i=`scrollbar-${this.getInstanceId()}-${Date.now()}`,o=`\n #${t.id||"timeline-horizontal-scroll"} {\n scrollbar-width: thin;\n scrollbar-color: ${n} ${e};\n }\n \n #${t.id||"timeline-horizontal-scroll"}::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n }\n \n #${t.id||"timeline-horizontal-scroll"}::-webkit-scrollbar-track {\n background: ${e};\n border-radius: 4px;\n }\n \n #${t.id||"timeline-horizontal-scroll"}::-webkit-scrollbar-thumb {\n background: ${n};\n border-radius: 4px;\n border: 2px solid ${e};\n }\n \n #${t.id||"timeline-horizontal-scroll"}::-webkit-scrollbar-thumb:hover {\n background: ${r};\n }\n `;t.id||(t.id=`timeline-horizontal-scroll-${this.getInstanceId()}`),this.chartContext.injectStyles(o,i)}setupZoomEventListener(){const t=this.getInstanceId(),e=this.chartContext.querySelector(`.timeline-container[data-chart-instance="${t}"]`);e&&(this.zoomHandler&&e.removeEventListener("wheel",this.zoomHandler),this.zoomHandler=t=>{if(!t.ctrlKey)return;t.preventDefault();const e=Math.sign(t.deltaY);e<0?this.zoomIn():e>0&&this.zoomOut()},e.addEventListener("wheel",this.zoomHandler))}setupRowBackgroundColors(){this.dataManager.getTopParentTasks().forEach(((t,e)=>{const n=ao(e,this.options.rowBackgroundColors);lo(this.chartContext,t.id,t.rowBackgroundColor||n),this.dataManager.getNestedChildTasks(t.id,!0).forEach((t=>{lo(this.chartContext,t.id,t.rowBackgroundColor||n)}))})),this.dataManager.getFlatTasks().forEach(((t,e)=>{if(!t.parentId&&t.type===co.Milestone){const n=ao(e,this.options.rowBackgroundColors);lo(this.chartContext,t.id,t.rowBackgroundColor||n)}}))}renderDependencyArrows(){const{rowHeight:t}=this.options,e=this.getInstanceId(),n=this.arrowLink.getInstanceId(),r=this.dataManager.getFlatVisibleTasks().filter((t=>!!t.dependency)).map((t=>{const n=`.bar-container [data-taskid="${t.dependency}"][data-chart-instance="${e}"]`,r=`.bar-container [data-taskid="${t.id}"][data-chart-instance="${e}"]`,i=this.element.querySelector(n),o=this.element.querySelector(r);return{id:`${t.dependency}-${t.id}`,source:i,target:o}})).filter((t=>t.source&&t.target)),i=this.element.querySelector(".timeline-body");if(!i)return;const o=`timeline-arrows-${n}`,s=i.querySelector(`#${o}`);s&&s.remove(),0!==r.length&&this.arrowLink.render(i,r,{arrowColor:this.options.arrowColor,height:i.clientHeight,paddingY:t/2,width:i.clientWidth},this.chartContext)}setupDependencyArrowEvents(){const t=this.getInstanceId(),e=this.arrowLink.getInstanceId();this.chartContext.addEventListener("dependency-arrow-update",(n=>{const r=n;if(r.detail.chartInstanceId!==t)return;const i=r.detail.arrowLinkInstanceId||e;!function(t,e,n,r){t.getInstanceId();const i=Bi(t,e),o=Bi(t,n);if(!i||!o)return;const s=t.querySelector(".timeline-body"),a=`timeline-arrows-${r}`,l=null==s?void 0:s.querySelector(`#${a}`);l&&zo.updateArrow(i,o,l,{paddingX:20,paddingY:15},`${e}-${n}`)}(this.chartContext,r.detail.fromId,r.detail.toId,i)}))}rerenderTimeline(){const t=this.element.querySelector(".timeline-container");if(!t)return;const e=t.querySelector(".timeline-header"),n=t.querySelector(".timeline-body-wrapper");if(e&&n){e.innerHTML="",n.innerHTML="";const t=new _o(this.viewMode,this.options,this.chartContext,this.dataManager).render();if(t){const r=t[0];e.innerHTML=r.innerHTML;for(let e=1;e<t.length-1;e++)n.appendChild(t[e])}}else{t.innerHTML="";const e=new _o(this.viewMode,this.options,this.chartContext,this.dataManager).render();if(e){const n=e[0];t.appendChild(n);const r=ur(this.chartContext,{className:"timeline-body-wrapper"});for(let t=1;t<e.length-1;t++)r.appendChild(e[t]);t.appendChild(r)}}requestAnimationFrame((()=>{this.performAfterActions()}))}updateToolbarAfterZoom(){const t=this.element.querySelector(".gantt-actions-container");t&&this.renderToolbar(t)}cleanupEventListeners(){try{if(this.timelineScrollHandlers.bodyScroll||this.timelineScrollHandlers.horizontalScroll){const t=this.element.querySelector(".timeline-horizontal-scroll"),e=this.element.querySelector(".timeline-body-wrapper");t&&this.timelineScrollHandlers.horizontalScroll&&t.removeEventListener("scroll",this.timelineScrollHandlers.horizontalScroll),e&&this.timelineScrollHandlers.bodyScroll&&e.removeEventListener("scroll",this.timelineScrollHandlers.bodyScroll),this.timelineScrollHandlers={}}const t=this.chartContext.querySelector(".timeline-container");if(null==t?void 0:t.parentNode){const e=t.cloneNode(!0);t.parentNode.replaceChild(e,t)}}catch(t){}}cleanupTooltips(){try{const{enableTooltip:t,tooltipId:e}=this.options;if(t){const t=this.chartContext.getElementById(e);t&&(t.style.display="none",t.innerHTML="",t.removeAttribute("style"),t.classList.remove("visible"),t.setAttribute("aria-hidden","true"),this.isShadowDOM()&&t.remove())}}catch(t){}}cleanupDependencyArrows(){try{const t=this.element.querySelector(".timeline-body");if(t&&this.arrowLink){const e=this.arrowLink.getInstanceId(),n=`timeline-arrows-${e}`,r=t.querySelector(`#${n}`);r&&r.remove();t.querySelectorAll("[data-edgeid]").forEach((t=>{const n=t.getAttribute("marker-end");(null==n?void 0:n.includes(`arrowhead-${e}`))&&t.remove()}))}}catch(t){}}createActionButton(t,e,n=!1){const r=this.chartContext.createElement("button");return r.className="gantt-action-button",r.innerHTML=t,r.title=e,r.disabled=n,r.setAttribute("aria-label",e),r}createSeparator(){const t=this.chartContext.createElement("div");return t.className="gantt-action-separator",t}createViewModeDisplay(){const t=this.chartContext.createElement("div");return t.className="gantt-view-mode-display",t.innerHTML=`${Bo.calendar} <span>${Ur(this.viewMode)}</span>`,t.title=`Current view: ${Ur(this.viewMode)}`,t}renderToolbar(t){t.innerHTML="";const e=this.createActionButton(Bo.zoomIn,"Zoom In",this.viewMode===Ri[0]);e.addEventListener("click",(()=>this.zoomIn()));const n=this.createActionButton(Bo.zoomOut,"Zoom Out",this.viewMode===Ri[Ri.length-1]);n.addEventListener("click",(()=>this.zoomOut()));const r=this.createViewModeDisplay(),i=this.chartContext.createElement("div");if(i.className="gantt-actions-spacer",t.append(e,n,this.createSeparator(),r),this.options.enableExport){t.append(i);const e=this.createActionButton(Bo.download,"Export as SVG"),n=()=>this.element;e.addEventListener("click",(()=>{const t=n();if(!t)return void alert("Export failed: Chart not found. Please refresh and try again.");if(t.querySelector(".gantt-container"))try{Lo(t)}catch(t){alert("Export failed. Please check the console for details.")}})),t.append(e)}}update(t){this.element&&!this.isDestroyed()&&this.stateManager.captureState(this.element,this.dataManager,this.viewMode);const e=this.detectCurrentTheme(),n=t.theme,r=n&&n!==e,i=this.stateManager.hasState()?this.stateManager.getViewMode():this.viewMode,o=Object.entries(t).filter((([t,e])=>void 0===e)).map((([t])=>t)),s=Object.entries(t).reduce(((t,[e,n])=>(void 0!==n&&(t[e]=n),t)),{}),a=Vi(n||e);let l,u;if(r){this.cleanupScrollbarStyles();const t=["series","parsing","width","height","viewMode","rowHeight","tasksContainerWidth","inputDateFormat","annotations","enableExport","enableResize","enableTaskDrag","enableTaskEdit","enableTaskResize","enableTooltip","tooltipTemplate","canvasStyle"];l={...a},t.forEach((t=>{void 0!==this.options[t]&&(l[t]=this.options[t])})),l={...l,...s}}else l={...a},Object.entries(this.options).forEach((([t,e])=>{o.includes(t)||(l[t]=e)})),l={...l,...s};t.viewMode||(l.viewMode=i),u=l.parsing?No.validateConfig(l.parsing)?No.parse(l.series,l.parsing):this.options.series:l.series?l.series:this.options.series,this.options={...l,series:u},this.viewMode=this.options.viewMode,this.dataManager.setTasks(this.options.series),this.render(),this.element&&!this.isDestroyed()&&this.stateManager.restoreState(this.element)}detectCurrentTheme(){const t=this.options.backgroundColor;return this.isColorDark(t)?"dark":"light"}fillEmptyRowsAfterRender(){const t=this.element.querySelector(".gantt-container"),e=null==t?void 0:t.querySelector(".timeline-body"),n=null==t?void 0:t.querySelector(".tasks-data-container");if(!t||!e||!n)return;e.querySelectorAll(".timeline-empty-row").forEach((t=>t.remove()));n.querySelectorAll(".tasks-empty-row").forEach((t=>t.remove()));const r=t.clientHeight,i=e.querySelectorAll(".timeline-data-row:not(.timeline-empty-row)").length,o=this.options.rowHeight,s=Math.floor(r/o),a=Math.max(0,s-i);if(0===a)return;let l=0;const u=e.querySelector(".timeline-data-row");if(u)l=u.querySelectorAll(".timeline-data-cell").length;else{const e=t.querySelector(".timeline-header");if(e){l=e.querySelectorAll(".timeline-header-cell").length}}if(0!==l){for(let t=0;t<a;t++){const n=this.createEmptyTimelineRow(t,l);e.appendChild(n)}for(let t=0;t<a;t++){const e=this.createEmptyTaskRow(t);n.appendChild(e)}}}createEmptyTimelineRow(t,e){const n=ur(this.chartContext,{className:"timeline-data-row timeline-empty-row"}),{rowHeight:r}=this.options,i=this.getInstanceId();n.setAttribute("data-taskid",`empty-${t}`),n.setAttribute("data-chart-instance",i),n.style.height=`${r}px`;for(let t=0;t<e;t++){const t=ur(this.chartContext,{className:"timeline-data-cell",style:{height:`${r}px`,minWidth:`${Pi[this.viewMode]}px`}});t.setAttribute("data-chart-instance",i),n.appendChild(t)}return n}createEmptyTaskRow(t){const e=ur(this.chartContext,{className:"tasks-data-row tasks-empty-row"}),{rowHeight:n,fontColor:r}=this.options,i=this.getInstanceId();return e.setAttribute("data-taskid",`empty-${t}`),e.setAttribute("data-chart-instance",i),e.style.height=`${n}px`,io.forEach((({key:t})=>{const o=ur(this.chartContext,{className:"tasks-data-cell",content:""});o.setAttribute("data-columnid",t),o.setAttribute("data-chart-instance",i),o.style.height=`${n}px`,o.style.color=r,e.appendChild(o)})),e}cleanupScrollbarStyles(){try{this.chartContext.getInjectedStyleIds().filter((t=>t.startsWith(`scrollbar-${this.getInstanceId()}`))).forEach((t=>this.chartContext.removeStyles(t)));const t=this.element.querySelector(".timeline-horizontal-scroll");if(t){const e=t.style.width,n=t.style.left,r=t.style.bottom;t.removeAttribute("style"),e&&(t.style.width=e),n&&(t.style.left=n),r&&(t.style.bottom=r)}}catch(t){}}updateTask(t,e){if(!this.dataManager.getTaskById(t))throw new Error(`Task with ID ${t} not found`);const[n]=this.dataManager.getDateRange(0,this.viewMode);uo(this.chartContext,this.dataManager,t,e,this.options,this.viewMode,n)}zoomIn(){if(this.viewMode===Ri[0])return;const t=Ri.findIndex((t=>t===this.viewMode));this.viewMode=Ri[t-1],this.updateToolbarAfterZoom(),this.rerenderTimeline(),this.renderDependencyArrows(),requestAnimationFrame((()=>{this.updateHorizontalScrollbarContent(),this.positionHorizontalScrollbar()}))}zoomOut(){if(this.viewMode===Ri[Ri.length-1])return;const t=Ri.findIndex((t=>t===this.viewMode));this.viewMode=Ri[t+1],this.updateToolbarAfterZoom(),this.rerenderTimeline(),this.renderDependencyArrows(),requestAnimationFrame((()=>{this.updateHorizontalScrollbarContent(),this.positionHorizontalScrollbar()}))}updateHorizontalScrollbarContent(){const t=this.element.querySelector(".timeline-horizontal-scroll"),e=null==t?void 0:t.querySelector(".timeline-horizontal-scroll-content"),n=this.element.querySelector(".timeline-body");if(!t||!e||!n)return;const r=n.scrollWidth;e.style.width=`${r}px`}hasExplicitDimensions(){const t=window.getComputedStyle(this.element),e=t.height,n=t.width;return{height:"auto"!==e&&"0px"!==e,width:"auto"!==n&&"0px"!==n}}normalizeDimension(t){return"number"==typeof t?`${t}px`:t}setupContainerResizeObserver(){if(!this.element)return;this.containerResizeObserver&&this.containerResizeObserver.disconnect();const t=this.normalizeDimension(this.options.width),e=this.normalizeDimension(this.options.height),n="string"==typeof t&&t.includes("%"),r="string"==typeof e&&e.includes("%");(n||r)&&(this.lastKnownWidth=this.element.offsetWidth,this.lastKnownHeight=this.element.offsetHeight,this.containerResizeObserver=new ResizeObserver((t=>{for(const e of t){const t=e.contentRect.width,n=e.contentRect.height,r=Math.abs(t-this.lastKnownWidth)>1,i=Math.abs(n-this.lastKnownHeight)>1;(r||i)&&(this.lastKnownWidth=t,this.lastKnownHeight=n,this.handleContainerResize())}})),this.containerResizeObserver.observe(this.element))}handleContainerResize(){null!==this.resizeDebounceTimer&&window.clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout((()=>{this.performResize(),this.resizeDebounceTimer=null}),150)}performResize(){if(!this.element||this.isDestroyed())return;const t=this.normalizeDimension(this.options.width),e=this.normalizeDimension(this.options.height),n="string"==typeof t&&t.includes("%"),r="string"==typeof e&&e.includes("%");if(n){window.getComputedStyle(this.element.parentElement||this.element).width!==window.getComputedStyle(this.element).width&&requestAnimationFrame((()=>{this.positionHorizontalScrollbar(),this.updateHorizontalScrollbarContent(),this.syncTasksColumnWidths()}))}r&&requestAnimationFrame((()=>{this.fillEmptyRowsAfterRender()}))}destroy(){try{if(this.containerResizeObserver&&(this.containerResizeObserver.disconnect(),this.containerResizeObserver=null),null!==this.resizeDebounceTimer&&(window.clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=null),this.zoomHandler){const t=this.getInstanceId(),e=this.chartContext.querySelector(`.timeline-container[data-chart-instance="${t}"]`);e&&e.removeEventListener("wheel",this.zoomHandler),this.zoomHandler=null}if(this.timelineScrollHandlers.bodyScroll){const t=this.element.querySelector(".timeline-horizontal-scroll");t&&this.timelineScrollHandlers.bodyScroll&&t.removeEventListener("scroll",this.timelineScrollHandlers.bodyScroll),this.timelineScrollHandlers={}}this.scrollbarResizeObserver&&(this.scrollbarResizeObserver.disconnect(),this.scrollbarResizeObserver=null),this.cleanupEventListeners(),this.cleanupTooltips(),this.cleanupDependencyArrows(),this.splitBarResizeHandler&&(this.chartContext.removeEventListener("splitview-resize",this.splitBarResizeHandler),this.splitBarResizeHandler=null);const t=this.element.querySelector(".timeline-horizontal-scroll");(null==t?void 0:t.id)&&this.chartContext.getInjectedStyleIds().filter((t=>t.startsWith(`scrollbar-${this.getInstanceId()}`))).forEach((t=>this.chartContext.removeStyles(t))),this.element.innerHTML="",super.destroy(),this.stylesInjected=!1}catch(t){}}isDestroyed(){return!this.element||""===this.element.innerHTML}}const qo={tooltipBGColor:"#FFFFFF",tooltipBorderColor:"#CCCCCC",tooltipTextColor:"#333333",cellBorderColor:"#EFF0F0",rowBackgroundColors:["#FFFFFF","#F9F9F9"],headerBackground:"#F3F3F3",headerTextColor:"#333333",barBackgroundColor:"#87B7FE",barTextColor:"#FFFFFF",arrowColor:"#0D6EFD",backgroundColor:"#FFFFFF",textColor:"#000000",borderColor:"#DFE0E1",annotationBgColor:"#F9D1FC",annotationBorderColor:"#E273EA",dialogBgColor:"#FFFFFF",dialogBorderColor:"#EEEEEE",buttonBgColor:"#0066CC",buttonTextColor:"#FFFFFF",buttonHoverBgColor:"#0052A3",toolbarBgColor:"#FFFFFF",toolbarBorderColor:"#BCBCBC",toolbarHoverBgColor:"#F8F9FA",scrollbarTrackColor:"#F5F5F5",scrollbarThumbColor:"#C1C1C1",scrollbarThumbHoverColor:"#A8A8A8",splitBarColor:"#DEE2E6",splitBarHoverColor:"#007BFF",splitBarBorderColor:"#BBBBBB",splitBarHandleColor:"#666666"},Po={tooltipBGColor:"#2D2D2D",tooltipBorderColor:"#444444",tooltipTextColor:"#E0E0E0",cellBorderColor:"#3A3A3A",rowBackgroundColors:["#1E1E1E","#252525"],headerBackground:"#2A2A2A",headerTextColor:"#E0E0E0",barBackgroundColor:"#5B8DEE",barTextColor:"#FFFFFF",arrowColor:"#4A9EFF",backgroundColor:"#1E1E1E",textColor:"#E0E0E0",borderColor:"#3A3A3A",annotationBgColor:"#4A2D4D",annotationBorderColor:"#8B4D8F",dialogBgColor:"#2D2D2D",dialogBorderColor:"#444444",buttonBgColor:"#0D6EFD",buttonTextColor:"#FFFFFF",buttonHoverBgColor:"#0B5ED7",toolbarBgColor:"#2D2D2D",toolbarBorderColor:"#444444",toolbarHoverBgColor:"#3A3A3A",scrollbarTrackColor:"#000",scrollbarThumbColor:"#4A4A4A",scrollbarThumbHoverColor:"#5A5A5A",splitBarColor:"#3A3A3A",splitBarHoverColor:"#4A9EFF",splitBarBorderColor:"#4A4A4A",splitBarHandleColor:"#666666"};function Wo(t){return"dark"===t?Po:qo}"undefined"!=typeof window&&(window.ApexGantt=Ho);export{Ho as ApexGantt,no as ColumnKey,Po as DarkTheme,No as DataParser,Ki as GanttEvents,qo as LightTheme,Ni as ViewMode,Ho as default,Wo as getTheme};
|
|
1
|
+
const t=()=>{};class e{constructor(t,e){this.injectedStyles=new Set,this.instanceId=e||Math.random().toString(36).substr(2,9),this.context=this.detectContext(t),this.chartContainer=t}getChartContainer(){return this.chartContainer}getChartScopedContainer(){return this.context===document?document.body||document.getElementsByTagName("body")[0]:this.chartContainer||this.context}detectContext(t){const e=t.getRootNode();return e instanceof ShadowRoot?e:document}getContext(){return this.context}getInstanceId(){return this.instanceId}isShadowDOM(){return this.context instanceof ShadowRoot}createElement(t){return document.createElement(t)}createElementNS(t,e){return document.createElementNS(t,e)}createTextNode(t){return document.createTextNode(t)}getElementById(t){return this.context===document?document.getElementById(t):this.context.querySelector(`#${t}`)}getElementsByClassName(t){if(this.context===document)return document.getElementsByClassName(t);const e=this.context.querySelectorAll(`.${t}`),n=Array.from(e);return{item:t=>n[t]||null,get length(){return n.length},[Symbol.iterator]:()=>n[Symbol.iterator](),...Object.fromEntries(n.map(((t,e)=>[e,t])))}}querySelector(t){return this.context.querySelector(t)}querySelectorAll(t){return this.context.querySelectorAll(t)}getAppendContainer(){return this.context===document?document.body||document.getElementsByTagName("body")[0]:this.context}getChartBounds(){var t;return(null==(t=this.chartContainer)?void 0:t.getBoundingClientRect())||new DOMRect}getBody(){if(this.context===document)return document.body||document.getElementsByTagName("body")[0];return this.context.host}dispatchEvent(t){this.context===document?document.dispatchEvent(t):this.context.dispatchEvent(t)}addEventListener(t,e,n){this.context===document||"mousemove"===t||"mouseup"===t||"keydown"===t?document.addEventListener(t,e,n):this.context.addEventListener(t,e,n)}removeEventListener(t,e,n){this.context===document||"mousemove"===t||"mouseup"===t||"keydown"===t?document.removeEventListener(t,e,n):this.context.removeEventListener(t,e,n)}injectStyles(t,e,n={}){const{force:i=!1,priority:o="normal"}=n;if(!i&&this.injectedStyles.has(e))return;if(i){const t=this.context.querySelector(`#${e}`);t&&(t.remove(),this.injectedStyles.delete(e))}if(this.context.querySelector(`#${e}`)&&!i)return void this.injectedStyles.add(e);const r=document.createElement("style");if(r.id=e,r.textContent=t,"normal"!==o&&r.setAttribute("data-priority",o),this.context===document)document.head.appendChild(r);else{const t=this.context;"high"===o?t.insertBefore(r,t.firstChild):t.appendChild(r)}this.injectedStyles.add(e)}injectStylesheets(t){t.forEach((({content:t,id:e,options:n})=>{this.injectStyles(t,e,n)}))}hasInjectedStyles(t){return this.injectedStyles.has(t)}removeStyles(t){const e=this.context.querySelector(`#${t}`);e&&(e.remove(),this.injectedStyles.delete(t))}removeAllStyles(){this.injectedStyles.forEach((t=>{const e=this.context.querySelector(`#${t}`);e&&e.remove()})),this.injectedStyles.clear()}getInjectedStyleIds(){return Array.from(this.injectedStyles)}getActiveElement(){if(this.context===document)return document.activeElement;return this.context.activeElement||document.activeElement}destroy(){this.removeAllStyles(),this.injectedStyles.clear()}}class n{constructor(t,n){if(!t)throw new Error("Container element is required");this.element=t,this.chartContext=new e(t,n)}getContext(){return this.chartContext}isShadowDOM(){return this.chartContext.isShadowDOM()}getTooltipContainer(){return this.chartContext.getAppendContainer()}injectStyles(t,e){this.chartContext.injectStyles(t,e)}createElement(t){return this.chartContext.createElement(t)}querySelector(t){return this.chartContext.querySelector(t)}addEventListener(t,e,n){this.chartContext.addEventListener(t,e,n)}removeEventListener(t,e,n){this.chartContext.removeEventListener(t,e,n)}dispatchEvent(t){this.chartContext.dispatchEvent(t)}destroy(){this.chartContext.destroy()}getInstanceId(){return this.chartContext.getInstanceId()}}const i=globalThis.console;const o=class{static decodeLicenseData(t){try{const e=window.atob(t),n=JSON.parse(e);return n.issueDate&&n.expiryDate&&n.plan?{domains:Array.isArray(n.domains)?n.domains:void 0,expiryDate:n.expiryDate,issueDate:n.issueDate,plan:n.plan,valid:!0}:null}catch{return null}}static generateLicenseKey(t,e,n="standard",i){const o={expiryDate:e,issueDate:t,plan:n};i&&i.length>0&&(o.domains=i);return`APEX-${window.btoa(JSON.stringify(o))}`}static getLicenseStatus(){return this.licenseKey?(this.validationResult||(this.validationResult=this.validateLicense(this.licenseKey)),this.validationResult):{expired:!1,valid:!1}}static isLicenseValid(){return!!this.licenseKey&&(this.validationResult||(this.validationResult=this.validateLicense(this.licenseKey)),this.validationResult.valid)}static setLicense(t){var e;this.licenseKey=t,this.validationResult=this.validateLicense(t),this.validationResult.valid||(e=`[Apex] ${this.validationResult.message}`,i.error(e))}static validateLicense(t){try{if(!t.startsWith("APEX-"))return{expired:!1,message:'Invalid license key format. License key must start with "APEX-".',valid:!1};const e=t.split("-");if(2!==e.length)return{expired:!1,message:"Invalid license key format. Expected format: APEX-{encoded-data}.",valid:!1};const n=e[1],i=this.decodeLicenseData(n);if(!i)return{expired:!1,message:"Invalid license key. Unable to decode license data.",valid:!1};const o=new Date;if(new Date(i.expiryDate)<o)return{data:i,expired:!0,message:`License expired on ${i.expiryDate}. Please renew your license.`,valid:!1};if(i.domains&&i.domains.length>0){const t="undefined"!=typeof window?window.location.hostname:"";if(!i.domains.some((e=>t===e||t.endsWith(`.${e}`))))return{data:i,expired:!1,message:`License is not valid for this domain (${t}). Allowed domains: ${i.domains.join(", ")}.`,valid:!1}}return{data:i,expired:!1,valid:!0}}catch{return{expired:!1,message:"Invalid license key format or corrupted data.",valid:!1}}}};o.licenseKey=null,o.validationResult=null;let r=o;const a="\n #toolbar {\n display: flex;\n gap: 5px;\n position: absolute;\n right: 10px;\n top: 10px;\n z-index: 100;\n }\n \n .toolbar-item {\n align-items: center;\n background-color: var(--toolbar-bg-color, #FFFFFF);\n border: 1px solid var(--toolbar-border-color, #BCBCBC);\n cursor: pointer;\n display: flex;\n height: 30px;\n justify-content: center;\n width: 30px;\n border-radius: 3px;\n transition: all 0.2s ease;\n position: relative;\n }\n \n .toolbar-item:hover {\n background-color: var(--toolbar-hover-bg-color, #f8f9fa);\n border-color: var(--toolbar-border-color, #999);\n transform: translateY(-1px);\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n }\n \n .toolbar-item:active {\n transform: translateY(0);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n }\n \n .toolbar-item:focus {\n outline: none;\n border-color: var(--button-bg-color, #0066cc);\n box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);\n }\n \n .toolbar-item img {\n width: 16px;\n height: 16px;\n pointer-events: none;\n filter: var(--toolbar-icon-filter, none);\n }\n \n .toolbar-item[disabled] {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n }\n \n /* Tooltip styles */\n .toolbar-item::after {\n content: attr(data-tooltip);\n position: absolute;\n bottom: -35px;\n left: 50%;\n transform: translateX(-50%);\n background: var(--tooltip-bg-color, #333);\n color: var(--tooltip-text-color, white);\n padding: 4px 8px;\n border-radius: 4px;\n font-size: 12px;\n white-space: nowrap;\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.2s ease;\n z-index: 1000;\n }\n \n .toolbar-item::before {\n content: '';\n position: absolute;\n bottom: -25px;\n left: 50%;\n transform: translateX(-50%);\n border: 5px solid transparent;\n border-bottom-color: var(--tooltip-bg-color, #333);\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.2s ease;\n z-index: 1000;\n }\n \n .toolbar-item:hover::after,\n .toolbar-item:hover::before {\n opacity: 1;\n }\n \n /* Shadow DOM specific adjustments */\n :host #toolbar {\n display: flex;\n gap: 5px;\n position: absolute;\n right: 10px;\n top: 10px;\n z-index: 100;\n }\n",s=class{static createWatermarkPattern(){const t=this.WATERMARK_TEXT;return`url("data:image/svg+xml,${encodeURIComponent(`\n <svg xmlns="http://www.w3.org/2000/svg" width="300" height="200">\n <text \n x="50%" \n y="50%" \n dominant-baseline="middle" \n text-anchor="middle"\n font-family="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Arial, sans-serif"\n font-size="18"\n font-weight="600"\n fill="rgba(134, 134, 134, 0.1)"\n transform="rotate(-35, 100, 60)"\n >${t}</text>\n </svg>\n `.trim())}")`}static add(t){this.remove(t);const e=document.createElement("div");e.setAttribute(this.WATERMARK_ATTR,""),Object.assign(e.style,{backgroundImage:this.createWatermarkPattern(),backgroundRepeat:"repeat",bottom:"0",left:"0",msUserSelect:"none",pointerEvents:"none",position:"absolute",right:"0",top:"0",userSelect:"none",webkitUserSelect:"none",zIndex:"10000"}),"static"===getComputedStyle(t).position&&(t.style.position="relative"),t.appendChild(e)}static exists(t){return!!t.querySelector(`[${this.WATERMARK_ATTR}]`)}static remove(t){const e=t.querySelector(`[${this.WATERMARK_ATTR}]`);e&&e.remove()}};s.WATERMARK_ATTR="data-apexcharts-watermark",s.WATERMARK_TEXT="APEXCHARTS";let l=s;function c(t){const e=t.getRootNode();return e instanceof ShadowRoot?e.host:t.parentElement}function d(t,e){const n=t.getBoundingClientRect(),i=e.getBoundingClientRect(),o=function(t){let e=1,n=1,i=0,o=0,r=t.parentElement;for(;r&&r!==document.body&&r!==document.documentElement;){const t=window.getComputedStyle(r),a=t.scale;if(a&&"none"!==a){const t=a.split(" ").map(parseFloat);1===t.length?(e*=t[0],n*=t[0]):t.length>=2&&(e*=t[0],n*=t[1])}const s=t.transform;if(s&&"none"!==s)try{const t=new DOMMatrix(s);e*=t.a,n*=t.d,i+=t.e,o+=t.f}catch{}r=c(r)}return{scaleX:e,scaleY:n,translateX:i,translateY:o}}(e),r=function(t){const e=window.getComputedStyle(t);let n=1,i=1,o=0,r=0,a=0;const s=e.scale;if(s&&"none"!==s){const t=s.split(" ").map(parseFloat);1===t.length?(n=t[0],i=t[0]):t.length>=2&&(n=t[0],i=t[1])}const l=e.transform;if(l&&"none"!==l)try{const t=new DOMMatrix(l);n*=t.a,i*=t.d,o=t.e,r=t.f,a=Math.atan2(t.b,t.a)}catch{}return{scaleX:n,scaleY:i,translateX:o,translateY:r,rotation:a}}(t),a=o.scaleX||1,s=o.scaleY||1,l=(n.left-i.left)/a,d=(n.top-i.top)/s,h=n.width/a,p=n.height/s;if(Math.abs(r.rotation)>.01){const t=l+h/2,e=d+p/2;return{left:t,right:t,top:e,bottom:e,width:0,height:0}}return{left:l,right:l+h,top:d,bottom:d+p,width:h,height:p}}const h="aria-hidden",p=(t,e="apex-tooltip-container")=>{let n=t.getElementById(e);if(!n){n=t.createElement("div"),n.id=e,n.setAttribute("role","tooltip"),n.setAttribute(h,"true");t.getAppendContainer().appendChild(n)}return n},u=(t,e="",n,i="")=>{const o=t.getElementById(e);if(!o)return p(t,e),u(t,e,n,i);if(n&&i){const t=i.includes("tooltip-content"),e=n.match(/background-color:\s*([^;]+);?/),r=n.match(/color:\s*([^;]+);?/),a=e?e[1]:"#333",s=r?r[1]:"white";o.innerHTML=t?i:`<div class="tooltip-content" style="background-color: ${a}; color: ${s};">${i}</div>`;const l=n+"; display: block !important; visibility: visible !important; opacity: 1 !important;";o.setAttribute("style",l),o.classList.add("visible"),o.setAttribute(h,"false")}else o.removeAttribute("style"),o.classList.remove("visible"),o.setAttribute(h,"true"),o.innerHTML=""},m=(t={})=>{const e=[];for(const i in t){const o=`${n=i,n.replace(/([A-Z])/g,(t=>`-${t.toLowerCase()}`))}: ${t[i]};`;e.push(o)}var n;return e.join(" ")};function g(t,{className:e="",content:n,style:i={}}={}){const o=b(t,"div",{className:e,innerHTML:n||""});return o.setAttribute("style",m(i)),o}function b(t,e,n={}){const i=t.createElement(e);return Object.assign(i,n)}function f(t,e){if(!t)return"#000000";3===(t=t.replace(/^#/,"")).length&&(t=t.split("").map((t=>t+t)).join(""));const n=parseInt(t,16);let i=n>>16&255,o=n>>8&255,r=255&n;return e*=.299*i+.587*o+.114*r<100?-1:1,i=Math.min(255,Math.max(0,i+e)),o=Math.min(255,Math.max(0,o+e)),r=Math.min(255,Math.max(0,r+e)),`#${(1<<24|i<<16|o<<8|r).toString(16).slice(1)}`}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function v(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var y={exports:{}};y.exports=function(){var t=1e3,e=6e4,n=36e5,i="millisecond",o="second",r="minute",a="hour",s="day",l="week",c="month",d="quarter",h="year",p="date",u="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|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,b={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])+"]"}},f=function(t,e,n){var i=String(t);return!i||i.length>=e?t:""+Array(e+1-i.length).join(n)+t},v={s:f,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),i=Math.floor(n/60),o=n%60;return(e<=0?"+":"-")+f(i,2,"0")+":"+f(o,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var i=12*(n.year()-e.year())+(n.month()-e.month()),o=e.clone().add(i,c),r=n-o<0,a=e.clone().add(i+(r?-1:1),c);return+(-(i+(n-o)/(r?o-a:a-o))||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:s,D:p,h:a,m:r,s:o,ms:i,Q:d}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},y="en",w={};w[y]=b;var x="$isDayjsObject",C=function(t){return t instanceof E||!(!t||!t[x])},k=function t(e,n,i){var o;if(!e)return y;if("string"==typeof e){var r=e.toLowerCase();w[r]&&(o=r),n&&(w[r]=n,o=r);var a=e.split("-");if(!o&&a.length>1)return t(a[0])}else{var s=e.name;w[s]=e,o=s}return!i&&o&&(y=o),o||!i&&y},S=function(t,e){if(C(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new E(n)},M=v;M.l=k,M.i=C,M.w=function(t,e){return S(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var E=function(){function b(t){this.$L=k(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[x]=!0}var f=b.prototype;return f.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(M.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var i=e.match(m);if(i){var o=i[2]-1||0,r=(i[7]||"0").substring(0,3);return n?new Date(Date.UTC(i[1],o,i[3]||1,i[4]||0,i[5]||0,i[6]||0,r)):new Date(i[1],o,i[3]||1,i[4]||0,i[5]||0,i[6]||0,r)}}return new Date(e)}(t),this.init()},f.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()},f.$utils=function(){return M},f.isValid=function(){return!(this.$d.toString()===u)},f.isSame=function(t,e){var n=S(t);return this.startOf(e)<=n&&n<=this.endOf(e)},f.isAfter=function(t,e){return S(t)<this.startOf(e)},f.isBefore=function(t,e){return this.endOf(e)<S(t)},f.$g=function(t,e,n){return M.u(t)?this[e]:this.set(n,t)},f.unix=function(){return Math.floor(this.valueOf()/1e3)},f.valueOf=function(){return this.$d.getTime()},f.startOf=function(t,e){var n=this,i=!!M.u(e)||e,d=M.p(t),u=function(t,e){var o=M.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return i?o:o.endOf(s)},m=function(t,e){return M.w(n.toDate()[t].apply(n.toDate("s"),(i?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},g=this.$W,b=this.$M,f=this.$D,v="set"+(this.$u?"UTC":"");switch(d){case h:return i?u(1,0):u(31,11);case c:return i?u(1,b):u(0,b+1);case l:var y=this.$locale().weekStart||0,w=(g<y?g+7:g)-y;return u(i?f-w:f+(6-w),b);case s:case p:return m(v+"Hours",0);case a:return m(v+"Minutes",1);case r:return m(v+"Seconds",2);case o:return m(v+"Milliseconds",3);default:return this.clone()}},f.endOf=function(t){return this.startOf(t,!1)},f.$set=function(t,e){var n,l=M.p(t),d="set"+(this.$u?"UTC":""),u=(n={},n[s]=d+"Date",n[p]=d+"Date",n[c]=d+"Month",n[h]=d+"FullYear",n[a]=d+"Hours",n[r]=d+"Minutes",n[o]=d+"Seconds",n[i]=d+"Milliseconds",n)[l],m=l===s?this.$D+(e-this.$W):e;if(l===c||l===h){var g=this.clone().set(p,1);g.$d[u](m),g.init(),this.$d=g.set(p,Math.min(this.$D,g.daysInMonth())).$d}else u&&this.$d[u](m);return this.init(),this},f.set=function(t,e){return this.clone().$set(t,e)},f.get=function(t){return this[M.p(t)]()},f.add=function(i,d){var p,u=this;i=Number(i);var m=M.p(d),g=function(t){var e=S(u);return M.w(e.date(e.date()+Math.round(t*i)),u)};if(m===c)return this.set(c,this.$M+i);if(m===h)return this.set(h,this.$y+i);if(m===s)return g(1);if(m===l)return g(7);var b=(p={},p[r]=e,p[a]=n,p[o]=t,p)[m]||1,f=this.$d.getTime()+i*b;return M.w(f,this)},f.subtract=function(t,e){return this.add(-1*t,e)},f.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||u;var i=t||"YYYY-MM-DDTHH:mm:ssZ",o=M.z(this),r=this.$H,a=this.$m,s=this.$M,l=n.weekdays,c=n.months,d=n.meridiem,h=function(t,n,o,r){return t&&(t[n]||t(e,i))||o[n].slice(0,r)},p=function(t){return M.s(r%12||12,t,"0")},m=d||function(t,e,n){var i=t<12?"AM":"PM";return n?i.toLowerCase():i};return i.replace(g,(function(t,i){return i||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return M.s(e.$y,4,"0");case"M":return s+1;case"MM":return M.s(s+1,2,"0");case"MMM":return h(n.monthsShort,s,c,3);case"MMMM":return h(c,s);case"D":return e.$D;case"DD":return M.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,l,2);case"ddd":return h(n.weekdaysShort,e.$W,l,3);case"dddd":return l[e.$W];case"H":return String(r);case"HH":return M.s(r,2,"0");case"h":return p(1);case"hh":return p(2);case"a":return m(r,a,!0);case"A":return m(r,a,!1);case"m":return String(a);case"mm":return M.s(a,2,"0");case"s":return String(e.$s);case"ss":return M.s(e.$s,2,"0");case"SSS":return M.s(e.$ms,3,"0");case"Z":return o}return null}(t)||o.replace(":","")}))},f.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},f.diff=function(i,p,u){var m,g=this,b=M.p(p),f=S(i),v=(f.utcOffset()-this.utcOffset())*e,y=this-f,w=function(){return M.m(g,f)};switch(b){case h:m=w()/12;break;case c:m=w();break;case d:m=w()/3;break;case l:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case a:m=y/n;break;case r:m=y/e;break;case o:m=y/t;break;default:m=y}return u?m:M.a(m)},f.daysInMonth=function(){return this.endOf(c).$D},f.$locale=function(){return w[this.$L]},f.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),i=k(t,e,!0);return i&&(n.$L=i),n},f.clone=function(){return M.w(this.$d,this)},f.toDate=function(){return new Date(this.valueOf())},f.toJSON=function(){return this.isValid()?this.toISOString():null},f.toISOString=function(){return this.$d.toISOString()},f.toString=function(){return this.$d.toUTCString()},b}(),T=E.prototype;return S.prototype=T,[["$ms",i],["$s",o],["$m",r],["$H",a],["$W",s],["$M",c],["$y",h],["$D",p]].forEach((function(t){T[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),S.extend=function(t,e){return t.$i||(t(e,E,S),t.$i=!0),S},S.locale=k,S.isDayjs=C,S.unix=function(t){return S(1e3*t)},S.en=w[y],S.Ls=w,S.p={},S}();const w=v(y.exports);var x={exports:{}};const C=v(x.exports=function(t,e){e.prototype.isSameOrBefore=function(t,e){return this.isSame(t,e)||this.isBefore(t,e)}});var k={exports:{}};k.exports=function(t,e,n){var i=function(t,e){if(!e||!e.length||1===e.length&&!e[0]||1===e.length&&Array.isArray(e[0])&&!e[0].length)return null;var n;1===e.length&&e[0].length>0&&(e=e[0]),n=(e=e.filter((function(t){return t})))[0];for(var i=1;i<e.length;i+=1)e[i].isValid()&&!e[i][t](n)||(n=e[i]);return n};n.max=function(){var t=[].slice.call(arguments,0);return i("isAfter",t)},n.min=function(){var t=[].slice.call(arguments,0);return i("isBefore",t)}};const S=v(k.exports);var M,E,T={exports:{}};const A=v(T.exports=(M="month",E="quarter",function(t,e){var n=e.prototype;n.quarter=function(t){return this.$utils().u(t)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(t-1))};var i=n.add;n.add=function(t,e){return t=Number(t),this.$utils().p(e)===E?this.add(3*t,M):i.bind(this)(t,e)};var o=n.startOf;n.startOf=function(t,e){var n=this.$utils(),i=!!n.u(e)||e;if(n.p(t)===E){var r=this.quarter()-1;return i?this.month(3*r).startOf(M).startOf("day"):this.month(3*r+2).endOf(M).endOf("day")}return o.bind(this)(t,e)}}));var $={exports:{}};$.exports=function(t,e){e.prototype.weekday=function(t){var e=this.$locale().weekStart||0,n=this.$W,i=(n<e?n+7:n)-e;return this.$utils().u(t)?i:this.subtract(i,"day").add(t,"day")}};const D=v($.exports);var B={exports:{}};B.exports=function(){var t="week",e="year";return function(n,i,o){var r=i.prototype;r.week=function(n){if(void 0===n&&(n=null),null!==n)return this.add(7*(n-this.week()),"day");var i=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var r=o(this).startOf(e).add(1,e).date(i),a=o(this).endOf(t);if(r.isBefore(a))return 1}var s=o(this).startOf(e).date(i).startOf(t).subtract(1,"millisecond"),l=this.diff(s,t,!0);return l<0?o(this).startOf("week").week():Math.ceil(l)},r.weeks=function(t){return void 0===t&&(t=null),this.week(t)}}}();const F=v(B.exports),I=globalThis.console,R={warn(...t){I.warn(...t)},error(...t){I.error(...t)}};function H(t,e){const n=t.getInstanceId(),i=`.bar-container .bar-timeline[data-taskid="${e}"][data-chart-instance="${n}"]`,o=t.querySelector(i);return o||R.warn(`[${n}] Bar element not found for task: ${e}`),o}function z(t,e){const n=t.getInstanceId(),i=`.timeline-body .timeline-data-row[data-taskid="${e}"][data-chart-instance="${n}"]`,o=t.querySelector(i);return o||R.warn(`[${n}] Bar row element not found for task: ${e}`),o}const L=["day","week","month","quarter","year"];var P=(t=>(t.Day="day",t.Month="month",t.Quarter="quarter",t.Week="week",t.Year="year",t))(P||{}),O=(t=>(t.Horizontal="horizontal",t.Vertical="vertical",t))(O||{});class q{constructor(t,e,n,i,o){this.options=t,this.ganttStartDate=e,this.viewMode=n,this.chartContext=i,this.totalHeight=o}calculateWidth(t){return w(t.x2).add(1,"day").diff(w(t.x1),`${this.viewMode}s`,!0)*W[this.viewMode]}calculateX(t){return w(t.x1).diff(this.ganttStartDate.startOf(this.viewMode),`${this.viewMode}s`,!0)*W[this.viewMode]}drawAnnotation(t){const e=g(this.chartContext,{className:"annotation"}),n=this.calculateX(t),i=m(this.getAnnotationStyles(t,n));if(e.setAttribute("style",i),t.label){const n=this.renderLabel(t);e.append(n)}return e}getAnnotationStyles(t,e){const{annotationBgColor:n,annotationBorderColor:i,annotationBorderWidth:o}=this.options,{bgColor:r,borderColor:a,borderWidth:s}=t;let l=0;const c=t.x2?s??o:(s??o??0)/2;return t.x2&&(l=this.calculateWidth(t)),{backgroundColor:r||n,borderColor:`${a||i}`,borderStyle:"solid",borderWidth:`${c}px`,height:`${this.totalHeight}px`,left:`${e}px`,position:"absolute",top:"0px",width:l?`${l}px`:"unset",zIndex:"10"}}renderLabel(t){const e=g(this.chartContext,{className:"annotation-label"}),{annotationBgColor:n,annotationBorderColor:i,fontColor:o,fontFamily:r,fontSize:a,fontWeight:s}=this.options,{bgColor:l,borderColor:c}=t,{label:d}=t;if(!d)return e;const h=d.fontColor||o,p=d.fontFamily||r,u=d.fontSize||a,b=d.fontWeight||s,f=m({background:l||n,borderColor:`${c||i}`,borderStyle:"solid",borderWidth:"1px",color:h,fontFamily:p,fontSize:u,fontWeight:b,left:"0px",padding:"2px 5px",position:"absolute",top:"-1px",width:"max-content",zIndex:"1"});return e.setAttribute("style",f),e.innerText=d.text??"",e}render(){const t=[];return this.options.annotations.forEach((e=>{t.push(this.drawAnnotation(e))})),t}}const W={[P.Day]:80,[P.Month]:150,[P.Quarter]:150,[P.Week]:180,[P.Year]:180};const N=(t,e)=>{const n=function(t,e){const n=w(t);switch(e){case P.Month:return n.daysInMonth();case P.Quarter:{const t=n.startOf("quarter");return n.endOf("quarter").diff(t,"day")+1}case P.Week:return 7;case P.Year:{const t=n.startOf("year");return n.endOf("year").diff(t,"day")+1}default:return 1}}(t,e);return W[e]/n},Y={annotationBorderDashArray:[],annotationBorderWidth:2,annotationOrientation:O.Horizontal,annotations:[],barBorderRadius:"5px",barMargin:8,baseline:{enabled:!1,color:"#b0b8c1"},canvasStyle:"border: 1px solid #CACED0; box-sizing: border-box",criticalBarColor:"#e53935",criticalArrowColor:"#e53935",enableCriticalPath:!1,cellBorderWidth:"1px",enableExport:!0,enableResize:!0,enableTaskDrag:!0,enableTaskEdit:!1,enableTaskResize:!0,enableTooltip:!0,fontFamily:"sans-serif",fontSize:"14px",fontWeight:"400",height:"500px",inputDateFormat:"MM-DD-YYYY",rowHeight:38,series:[],tasksContainerWidth:425,tooltipId:"apexgantt-tooltip-container",tooltipTemplate(t,e){const n=[`<div>\n <strong>Task:</strong>\n <span>${t.name}</span>\n </div>\n `];return t.type===ct.Task?n.push(`\n <div>\n <strong>Start:</strong>\n <span>${it(t,tt.StartTime,e)}</span>\n </div>\n <div>\n <strong>End:</strong>\n <span>${it(t,tt.EndTime,e)}</span>\n </div>\n <div>\n <strong>Duration:</strong>\n <span>${it(t,tt.Duration,e)}</span>\n </div>\n <div>\n <strong>Progress:</strong>\n <span>${t.progress}%</span>\n </div>\n `):t.type===ct.Milestone&&n.push(`\n <div>\n <strong>Date:</strong>\n <span>${it(t,tt.StartTime,e)}</span>\n </div>\n `),t.dependency&&n.push(`\n <div>\n <strong>Depends on:</strong>\n <span>${t.dependency}</span>\n </div>\n `),`\n <div>\n ${n.join("")}\n </div>\n `},viewMode:P.Week,width:"100%"},V={annotationBgColor:"#DBEAFE",annotationBorderColor:"#60A5FA",arrowColor:"#1A6FC4",backgroundColor:"#FFFFFF",barBackgroundColor:"#318CE7",barTextColor:"#FFFFFF",borderColor:"#DFE0E1",cellBorderColor:"#E3EDF8",fontColor:"#000000",headerBackground:"#EBF3FB",rowBackgroundColors:["#FFFFFF"],tooltipBGColor:"#FFFFFF",tooltipBorderColor:"#BCBCBC"},j={annotationBgColor:"#4A2D4D",annotationBorderColor:"#8B4D8F",arrowColor:"#A5B4FC",backgroundColor:"#1E1E1E",barBackgroundColor:"#818CF8",barTextColor:"#FFFFFF",borderColor:"#3A3A3A",cellBorderColor:"#3A3A3A",fontColor:"#E0E0E0",headerBackground:"#2A2A2A",rowBackgroundColors:["#1E1E1E","#252525"],tooltipBGColor:"#2D2D2D",tooltipBorderColor:"#444444"};function _(t){return{...Y,..."dark"===t?j:V}}const U=_("light"),X={TASK_UPDATE:"taskUpdate",TASK_VALIDATION_ERROR:"taskValidationError",TASK_UPDATE_SUCCESS:"taskUpdateSuccess",TASK_UPDATE_ERROR:"taskUpdateError",TASK_DRAGGED:"taskDragged",TASK_RESIZED:"taskResized"};class K{constructor(t,e,n,i,o){this.taskId=t,this.options=e,this.chartContext=i,this.dataManager=o,this.dragState={childTasks:[],daysPerPixel:0,initialLeft:0,initialPosition:0,initialStartTime:"",initialEndTime:"",isDragging:!1,startX:0},this.task=null;const r=this.dataManager.getTaskById(t);if(!r)throw new Error(`BarDragManager: Task with id "${t}" not found`);this.dragState.daysPerPixel=N(r.startTime,n)}calculateFinalPosition(t){const{daysPerPixel:e,initialLeft:n,initialPosition:i}=this.dragState,o=t.clientX-i,r=Math.round(o/e);return{calculatedLeft:n+r*e,daysMoved:r}}createMouseDownHandler(t){return e=>{this.task=this.dataManager.getTaskById(this.taskId),this.task&&(this.dragState={...this.dragState,initialLeft:parseInt(t.style.left)||0,initialPosition:e.clientX,initialStartTime:this.task.startTime,initialEndTime:this.task.endTime,isDragging:!0,startX:e.clientX},t.classList.add("dragging"),t.setAttribute("aria-grabbed","true"),this.dragState.childTasks=this.dataManager.getNestedChildTasks(this.task.id).map((t=>{const e=H(this.chartContext,t.id);return e?{...t,element:e,left:parseInt(e.style.left)||0,width:parseInt(e.style.width)||0}:t})))}}createMouseMoveHandler(t){return e=>{this.dragState.isDragging&&requestAnimationFrame((()=>{const n=e.clientX-this.dragState.startX,i=parseInt(t.style.left)||0;this.moveBar(t,i,n),this.task&&this.dataManager.updateDependencyArrows(this.task.id,this.chartContext),this.moveChildBars(n),this.dragState.startX=e.clientX}))}}createMouseUpHandler(t,e){return n=>{if(!this.dragState.isDragging)return;if(this.dragState.isDragging=!1,t.classList.remove("dragging"),t.setAttribute("aria-grabbed","false"),!this.task)return;const{calculatedLeft:i,daysMoved:o}=this.calculateFinalPosition(n);if(0===o)return void(this.dragState={...this.dragState,isDragging:!1});const r=w(this.task.startTime).add(o,"day").format(this.options.inputDateFormat),a=w(this.task.endTime).add(o,"day").format(this.options.inputDateFormat),s=this.dragState.childTasks.map((t=>({taskId:t.id,newStartTime:w(t.startTime).add(o,"day").format(this.options.inputDateFormat),newEndTime:t.endTime?w(t.endTime).add(o,"day").format(this.options.inputDateFormat):null}))).filter((t=>null!==t.newEndTime));this.emitTaskDraggedEvent(o,r,a,s),this.updateTaskPosition(t,i,o,e),this.updateChildrenPositions(i,o,e)}}emitTaskDraggedEvent(t,e,n,i){if(!this.task)return;const o={taskId:this.task.id,oldStartTime:this.dragState.initialStartTime,oldEndTime:this.dragState.initialEndTime,newStartTime:e,newEndTime:n,daysMoved:t,affectedChildTasks:i,timestamp:Date.now()},r=new CustomEvent(X.TASK_DRAGGED,{detail:o,bubbles:!0,composed:!0,cancelable:!1}),a=this.chartContext.getChartContainer();a&&a.dispatchEvent(r)}moveBar(t,e,n){t.style.left=`${e+n}px`}moveChildBars(t){this.dragState.childTasks.forEach((e=>{if(e.element){const n=parseInt(e.element.style.left)||0;e.element.style.left=`${n+t}px`,this.dataManager.updateDependencyArrows(e.id,this.chartContext)}}))}updateChildrenPositions(t,e,n){this.dragState.childTasks.forEach((i=>{const o=H(this.chartContext,i.id);if(o){const r=t-this.dragState.initialLeft;o.style.left=`${(i.left??0)+r}px`;const a=w(i.startTime).add(e,"day").format(this.options.inputDateFormat),s=i.endTime?w(i.endTime).add(e,"day").format(this.options.inputDateFormat):null;this.dataManager.updateDependencyArrows(i.id,this.chartContext),null==n||n(i.id,{endTime:s??void 0,startTime:a})}}))}updateTaskPosition(t,e,n,i){if(!this.task)return;t.style.left=`${e}px`;const o=w(this.task.startTime).add(n,"day").format(this.options.inputDateFormat),r=w(this.task.endTime).add(n,"day").format(this.options.inputDateFormat);this.dataManager.updateDependencyArrows(this.task.id,this.chartContext),null==i||i(this.task.id,{endTime:r,startTime:o})}makeDraggable(t,e){const n=this.createMouseDownHandler(t),i=this.createMouseMoveHandler(t),o=this.createMouseUpHandler(t,e);return t.addEventListener("mousedown",n),this.chartContext.addEventListener("mousemove",i),this.chartContext.addEventListener("mouseup",o),()=>{t.removeEventListener("mousedown",n),this.chartContext.removeEventListener("mousemove",i),this.chartContext.removeEventListener("mouseup",o)}}}class G{constructor(t,e,n,i,o){this.taskId=t,this.options=e,this.chartContext=i,this.dataManager=o,this.interactionState={daysPerPixel:0,initialLeft:0,initialPosition:0,initialWidth:0,initialStartTime:"",initialEndTime:"",isResizing:!1,resizeHandle:null,startX:0},this.task=null;const r=this.dataManager.getTaskById(t);if(!r)throw new Error(`BarResizeManager: Task with id "${t}" not found`);this.interactionState.daysPerPixel=N(r.startTime,n)}createMouseMoveHandler(t){return e=>{this.interactionState.isResizing&&requestAnimationFrame((()=>{const n=e.clientX-this.interactionState.startX,{daysPerPixel:i,resizeHandle:o}=this.interactionState,r=parseInt(t.style.left)||0,a=parseInt(t.style.width)||0;if("left"===o){const e=Math.max(0,r+n),o=a-(e-r);o>=i&&(t.style.left=`${e}px`,t.style.width=`${o}px`)}else{const e=Math.max(i,a+n);t.style.width=`${e}px`}this.task&&(this.dataManager.updateDependencyArrows(this.task.id,this.chartContext),this.interactionState.startX=e.clientX)}))}}createMouseUpHandler(t,e){return n=>{if(!this.interactionState.isResizing)return;if(!this.task)return;t.classList.remove("resizing");const{daysPerPixel:i,initialLeft:o,initialPosition:r,initialWidth:a,resizeHandle:s}=this.interactionState,l=n.clientX-r,c=this.interactionState.initialStartTime,d=this.interactionState.initialEndTime;let h=c,p=d,u=0;if("left"===s){let n=Math.round(l/i),r=o+n*i,s=a-n*i;if(s<i&&(s=i,r=o+a-i,n=Math.round((r-o)/i)),0===n)return void(this.interactionState={...this.interactionState,isResizing:!1,resizeHandle:null});t.style.left=`${r}px`,t.style.width=`${s}px`,h=w(this.task.startTime).add(n,"day").format(this.options.inputDateFormat),u=-n,null==e||e(this.task.id,{startTime:h})}else{let n=Math.round(l/i),o=a+n*i;if(o<i&&(o=i,n=Math.round((o-a)/i)),0===n)return void(this.interactionState={...this.interactionState,isResizing:!1,resizeHandle:null});t.style.width=`${o}px`,p=w(this.task.endTime).add(n,"day").format(this.options.inputDateFormat),u=n,null==e||e(this.task.id,{endTime:p})}null!==s&&this.emitTaskResizedEvent(s,c,d,h,p,u),this.dataManager.updateDependencyArrows(this.task.id,this.chartContext),this.interactionState={...this.interactionState,isResizing:!1,resizeHandle:null}}}emitTaskResizedEvent(t,e,n,i,o,r){if(!this.task)return;const a={taskId:this.task.id,resizeHandle:t,oldStartTime:e,oldEndTime:n,newStartTime:i,newEndTime:o,durationChange:r,timestamp:Date.now()},s=new CustomEvent(X.TASK_RESIZED,{detail:a,bubbles:!0,composed:!0,cancelable:!1}),l=this.chartContext.getChartContainer();l&&l.dispatchEvent(s)}createResizeMouseDownHandler(t){return(e,n)=>{e.stopPropagation(),this.task=this.dataManager.getTaskById(this.taskId),this.task&&(this.interactionState={...this.interactionState,initialLeft:parseInt(t.style.left)||0,initialPosition:e.clientX,initialWidth:parseInt(t.style.width)||0,initialStartTime:this.task.startTime,initialEndTime:this.task.endTime,isResizing:!0,resizeHandle:n,startX:e.clientX},t.classList.add("resizing"))}}makeResizable(t,e){const n=t.querySelector(".handle-left"),i=t.querySelector(".handle-right"),o=this.createResizeMouseDownHandler(t),r=this.createMouseMoveHandler(t),a=this.createMouseUpHandler(t,e);return null==n||n.addEventListener("mousedown",(t=>o(t,"left"))),null==i||i.addEventListener("mousedown",(t=>o(t,"right"))),this.chartContext.addEventListener("mousemove",r),this.chartContext.addEventListener("mouseup",a),()=>{null==n||n.removeEventListener("mousedown",(t=>o(t,"left"))),null==i||i.removeEventListener("mousedown",(t=>o(t,"right"))),this.chartContext.removeEventListener("mousemove",r),this.chartContext.removeEventListener("mouseup",a)}}}class Q{constructor(t,e){this.chartContext=t,this.options=e,this.overlay=null,this.keydownHandler=null,this.clickOutsideHandler=null,this.createDialog(),this.setupEventListeners()}createDialog(){const t=this.chartContext.getInstanceId(),e=this.chartContext.getElementById(`${this.options.id}-container`);if(e){this.container=e;const t=this.container.querySelector(".gantt-dialog");return void this.updateDialogContent(t)}this.container=this.chartContext.createElement("div"),this.container.id=`${this.options.id}-container`,this.container.className="gantt-dialog-container",this.container.setAttribute("role","dialog"),this.container.setAttribute("aria-modal","true"),this.container.setAttribute("aria-labelledby",`${this.options.id}-title`),this.container.setAttribute("data-chart-instance",t),this.options.modal&&(this.overlay=this.chartContext.createElement("div"),this.overlay.className="dialog-overlay",this.container.appendChild(this.overlay));const n=this.chartContext.createElement("div");n.id=this.options.id,n.className="gantt-dialog",this.createDialogStructure(n),this.options.width&&(n.style.width=this.options.width),this.options.height&&(n.style.height=this.options.height),this.container.appendChild(n),!1!==this.options.positionRelativeToChart&&this.positionRelativeToChart();const i=!1!==this.options.positionRelativeToChart?this.chartContext.getChartContainer():this.chartContext.getAppendContainer();null==i||i.appendChild(this.container)}createDialogStructure(t){t.innerHTML=`\n <div class="dialog-header">\n <h2 id="${this.options.id}-title-${this.chartContext.getInstanceId()}" class="dialog-title">${this.options.title||""}</h2>\n <button class="dialog-close" aria-label="Close dialog" type="button">×</button>\n </div>\n <div class="dialog-content"></div>\n `,this.updateDialogContent(t)}positionRelativeToChart(){const t=this.chartContext.getChartContainer();if(t){"static"===window.getComputedStyle(t).position&&(t.style.position="relative")}this.container.style.position="absolute",this.container.style.top="0",this.container.style.left="0",this.container.style.width="100%",this.container.style.height="100%",this.container.style.zIndex="999"}setupEventListeners(){const t=this.container.querySelector(".dialog-close");null==t||t.addEventListener("click",(()=>this.hide())),this.options.closeOnEscape&&(this.keydownHandler=t=>{"Escape"===t.key&&this.isVisible()&&(t.preventDefault(),this.hide())},this.chartContext.addEventListener("keydown",this.keydownHandler)),this.options.closeOnClickOutside&&this.overlay&&(this.clickOutsideHandler=t=>{t.target===this.overlay&&this.hide()},this.overlay.addEventListener("click",this.clickOutsideHandler)),this.container.addEventListener("keydown",(t=>{"Tab"===t.key&&this.isVisible()&&this.trapFocus(t)}))}trapFocus(t){const e=this.container.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),n=e[0],i=e[e.length-1],o=this.chartContext.getActiveElement();t.shiftKey?o===n&&(t.preventDefault(),null==i||i.focus()):o===i&&(t.preventDefault(),null==n||n.focus())}updateDialogContent(t){const e=t.querySelector(".dialog-content"),n=t.querySelector(".dialog-title");n&&(n.textContent=this.options.title||""),e&&(e.innerHTML="","string"==typeof this.options.content?e.innerHTML=this.options.content:this.options.content instanceof HTMLElement&&e.appendChild(this.options.content))}cleanupEventListeners(){this.keydownHandler&&(this.chartContext.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=null),this.clickOutsideHandler&&this.overlay&&(this.overlay.removeEventListener("click",this.clickOutsideHandler),this.clickOutsideHandler=null)}destroy(){this.cleanupEventListeners(),this.container.remove()}hide(){this.container.classList.remove("show","animate");const t=this.chartContext.querySelector("[data-dialog-trigger]");null==t||t.focus()}isVisible(){return this.container.classList.contains("show")}setContent(t){const e=this.container.querySelector(".dialog-content");e&&(e.innerHTML="","string"==typeof t?e.innerHTML=t:e.appendChild(t))}show(){const t=this.chartContext.getActiveElement();null==t||t.setAttribute("data-dialog-trigger","true"),this.container.classList.add("show","animate");const e=this.container.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');null==e||e.focus()}}class Z{constructor(t,e,n,i,o,r="MM-DD-YYYY"){this.chartContext=t,this.dataManager=e,this.task=n,this.containerElement=i,this.onSubmit=o,this.dateFormat=r,this.errors=[],this.submitButton=null,this.form=this.createForm()}emitEvent(t,e){const n=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0,cancelable:!1});this.containerElement.dispatchEvent(n)}clearError(t){var e;const n=this.form.querySelector(`[name="${t}"]`),i=null==(e=n.parentElement)?void 0:e.querySelector(".form-error");null==i||i.remove(),n.classList.remove("invalid"),this.errors=this.errors.filter((e=>e.field!==t)),this.updateSubmitButton()}createForm(){const t=this.chartContext.createElement("form");t.className="task-form";const e=this.task.barBackgroundColor||"#87B7FE",n=this.task.rowBackgroundColor||"#FFFFFF";return t.innerHTML=`\n <div class="form-group">\n <label for="name">Task Name</label>\n <input type="text" id="name" name="name" value="${this.task.name}">\n </div>\n \n <div class="form-group">\n <label for="startTime">Start Date</label>\n <input type="date" id="startTime" name="startTime" value="${this.formatDate(this.task.startTime)}">\n </div>\n \n <div class="form-group">\n <label for="endTime">End Date</label>\n <input type="date" id="endTime" name="endTime" value="${this.formatDate(this.task.endTime)}">\n </div>\n \n <div class="form-group">\n <label for="progress">Progress (%)</label>\n <input type="number" id="progress" name="progress" min="0" max="100" value="${this.task.progress}">\n </div>\n\n <div class="grid">\n <div class="form-group">\n <label for="barColor">Bar Color</label>\n <div class="color-picker-wrapper">\n <input type="color" id="barColor" name="barBackgroundColor" \n value="${e}"\n title="Choose bar color">\n <span class="color-preview"></span>\n </div>\n </div>\n \n <div class="form-group">\n <label for="rowColor">Row Background Color</label>\n <div class="color-picker-wrapper">\n <input type="color" id="rowColor" name="rowBackgroundColor" \n value="${n}"\n title="Choose row color">\n <span class="color-preview"></span>\n </div>\n </div>\n </div>\n \n <div class="form-actions">\n <button type="submit" class="btn-primary">Update</button>\n </div>\n `,t.addEventListener("submit",this.handleSubmit.bind(this)),this.setupFieldValidation(t),t}formatDate(t){return w(t,this.dateFormat).format("YYYY-MM-DD")}handleSubmit(t){if(t.preventDefault(),this.errors.length>0)this.emitEvent(X.TASK_VALIDATION_ERROR,{taskId:this.task.id,errors:this.errors,timestamp:Date.now()});else try{const t=new FormData(this.form),e={...this.task,barBackgroundColor:t.get("barBackgroundColor"),endTime:w(t.get("endTime")).format(this.dateFormat),name:t.get("name"),progress:Number(t.get("progress")),rowBackgroundColor:t.get("rowBackgroundColor"),startTime:w(t.get("startTime")).format(this.dateFormat)},n=this.dataManager.getTaskById(this.task.id)??this.task;this.emitEvent(X.TASK_UPDATE,{taskId:this.task.id,updates:e,updatedTask:{...n,...e},timestamp:Date.now()}),this.onSubmit(e),this.emitEvent(X.TASK_UPDATE_SUCCESS,{taskId:this.task.id,updatedTask:{...n,...e},timestamp:Date.now()})}catch(t){R.warn(`[TaskForm] Error updating task ${this.task.id}:`,t),this.emitEvent(X.TASK_UPDATE_ERROR,{taskId:this.task.id,error:t instanceof Error?t:new Error(String(t)),timestamp:Date.now()})}}setupFieldValidation(t){const e=t.querySelector('[name="name"]'),n=t.querySelector('[name="startTime"]'),i=t.querySelector('[name="endTime"]'),o=t.querySelector('[name="progress"]');null==e||e.addEventListener("change",(()=>{const t=this.validateName(e.value);t?this.showError("name",t):this.clearError("name")}));const r=()=>{const{endError:t,startError:e}=this.validateDates(n.value,i.value);e?this.showError("startTime",e):this.clearError("startTime"),t?this.showError("endTime",t):this.clearError("endTime")};null==n||n.addEventListener("change",r),null==i||i.addEventListener("change",r),null==o||o.addEventListener("change",(()=>{const t=this.validateProgress(Number(o.value));t?this.showError("progress",t):this.clearError("progress")}))}showError(t,e){var n,i;const o=this.form.querySelector(`[name="${t}"]`),r=this.chartContext.createElement("div");r.className="form-error",r.textContent=e;const a=null==(n=o.parentElement)?void 0:n.querySelector(".form-error");null==a||a.remove(),null==(i=o.parentElement)||i.appendChild(r),o.classList.add("invalid"),this.errors.push({field:t,message:e}),this.updateSubmitButton()}updateSubmitButton(){if(this.submitButton||(this.submitButton=this.form.querySelector(".btn-primary")),this.submitButton){const t=this.errors.length>0;this.submitButton.disabled=t,this.submitButton.classList.toggle("btn-disabled",t)}}validateDates(t,e){const n={endError:null,startError:null},i=w(t),o=w(e);return t||(n.startError="Start date is required"),e||(n.endError="End date is required"),i.isValid()&&o.isValid()&&o.isBefore(i)&&(n.endError="End date must be after start date"),n}validateName(t){return t.trim()?null:"Task name is required"}validateProgress(t){return t||0===t?isNaN(t)||t<0||t>100?"Progress must be between 0 and 100":null:"Progress is required"}getElement(){return this.form}}class J{constructor(t,e,n,i,o,r,a){this.task=t,this.ganttStartDate=e,this.options=n,this.viewMode=i,this.index=o,this.chartContext=r,this.dataManager=a,this.tooltipHandler=null}static calculateWidth(t,e,n){const{barMargin:i,rowHeight:o}=n;if(t.type===ct.Milestone)return(o-i)/2;const r=w(t.startTime);return w(t.endTime).add(1,"days").diff(r,`${e}s`,!0)*W[e]}static calculateX(t,e,n,i){const o=w(t.startTime).diff(e.startOf(n),`${n}s`,!0)*W[n];let r=0;if(t.type===ct.Milestone){const{barMargin:t,rowHeight:e}=i;r=(e-t)/4*-1}return o+r}hasBaseline(){var t;return!(!(null==(t=this.options.baseline)?void 0:t.enabled)||!this.task.baseline)}calculateHeight(){const{barMargin:t,rowHeight:e}=this.options;return this.task.type===ct.Milestone?(e-t)/2:this.hasBaseline()?e-2*t-6-2:e-2*t}setupTooltip(t){if(!this.options.enableTooltip)return;const{tooltipBGColor:e,tooltipBorderColor:n,fontColor:i,fontFamily:o,fontSize:r,fontWeight:a,tooltipId:s,tooltipTemplate:l,inputDateFormat:c}=this.options;let d=!1,h=null;const p=t=>{d=!0,h&&(clearTimeout(h),h=null);const{x:p,y:m}=((t,e,n=300,i=120,o=20,r=20)=>{const a=window.innerWidth,s=window.innerHeight,l=window.scrollX||document.documentElement.scrollLeft,c=window.scrollY||document.documentElement.scrollTop;let d=t+o+l,h=e+r+c;return t+o+n>a&&(d=t-n-o+l),e+r+i>s&&(h=e-i-r+c),d=Math.max(l+5,d),h=Math.max(c+5,h),{x:d,y:h}})(t.clientX,t.clientY,300,120,5,10);if(!l)return;const g=this.dataManager.getTaskById(this.task.id);if(!g)return;const b=l(g,c),f=(({bgColor:t,borderColor:e,fontColor:n,fontFamily:i,fontSize:o,fontWeight:r,maxWidth:a,padding:s,x:l,y:c})=>{const d=["position: absolute;","z-index: 1000;","pointer-events: none;"];return d.push("box-sizing: border-box;"),d.push("word-wrap: break-word;"),d.push("overflow-wrap: break-word;"),d.push(`left: ${l}px;`),d.push(`top: ${c}px;`),e&&d.push(`border: 1px solid ${e};`),a&&(d.push(`width: ${a}px;`),d.push(`max-width: ${a}px;`)),d.push("border-radius: 6px;"),d.push("box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);"),d.push("transition: opacity 0.2s ease;"),d.push(`color: ${n||"#000000"};`),d.push(`font-family: ${i||"sans-serif"};`),d.push(`font-weight: ${r||"400"};`),d.push(`font-size: ${o||"14px"};`),d.push(`background-color: ${t||"#FFFFFF"};`),void 0!==s&&d.push(`padding: ${s}px;`),d.join(" ")})({bgColor:e,borderColor:n,fontColor:i,fontFamily:o,fontSize:r,fontWeight:a,maxWidth:300,padding:0,x:p,y:m});u(this.chartContext,s,f,b)};t.addEventListener("mouseenter",p),t.addEventListener("mousemove",p),t.addEventListener("mouseleave",(()=>{d=!1,h=window.setTimeout((()=>{d||u(this.chartContext,s)}),100)}))}setupTaskEdit(t,e){if(!this.options.enableTaskEdit)return;const n=this.chartContext.getInstanceId();t.addEventListener("dblclick",(t=>{t.stopPropagation(),t.preventDefault();const i=this.dataManager.getTaskById(this.task.id);if(!i)return void R.error(`[${n}] Task not found in dataManager: ${this.task.id}`);const o=this.chartContext.getChartContainer();if(!o)return;const r=new Z(this.chartContext,this.dataManager,i,o,(t=>{null==e||e(i.id,t),s.hide()}),this.options.inputDateFormat),a=`taskDialog-${n}-${this.task.id}`,s=new Q(this.chartContext,{closeOnClickOutside:!1,closeOnEscape:!0,content:r.getElement(),id:a,modal:!0,title:`Edit Task: ${this.task.name}`,width:"400px",positionRelativeToChart:!0});s.show()}))}setupInteractions(t,e){const{enableTaskDrag:n,enableTaskResize:i}=this.options;if(n&&this.makeDraggable(t,e),i&&this.task.type===ct.Task){const n=g(this.chartContext,{className:"bar-handle handle-left"}),i=g(this.chartContext,{className:"bar-handle handle-right"});t.append(n,i),this.makeResizable(t,e)}}drawBar(e=t){const{barBackgroundColor:n,barBorderRadius:i}=this.options,o=g(this.chartContext,{className:"bar-timeline"}),r=g(this.chartContext,{className:"bar-label",content:this.task.name}),a=g(this.chartContext,{className:"bar-timeline-progress"}),s=this.task.barBackgroundColor||n,l=m(this.getBarStyles(s)),c=m({backgroundColor:f(s,-40),borderRadius:i,width:`${this.task.progress}%`}),d=this.chartContext.getInstanceId();o.setAttribute("data-taskid",this.task.id),o.setAttribute("data-chart-instance",d),a.setAttribute("style",c),o.setAttribute("style",l);const h=w(this.task.startTime),p=w(this.task.endTime),u=h.format("MMMM D, YYYY"),b=p.format("MMMM D, YYYY"),v=h.valueOf(),y=p.valueOf(),x=p.diff(h,"day"),{enableTaskDrag:C,enableTaskResize:k}=this.options;return C||k&&this.task.type===ct.Task?(o.setAttribute("role","slider"),o.setAttribute("aria-label",`${this.task.name}: ${u} to ${b}`),o.setAttribute("aria-valuenow",v.toString()),o.setAttribute("aria-valuemin",v.toString()),o.setAttribute("aria-valuemax",y.toString()),o.setAttribute("aria-valuetext",`${u} to ${b}, ${x} days`),o.setAttribute("aria-grabbed","false"),C&&o.setAttribute("aria-dropeffect","move")):(o.setAttribute("role","progressbar"),o.setAttribute("aria-label",`${this.task.name}: ${u} to ${b}, ${this.task.progress}% complete`),o.setAttribute("aria-valuenow",this.task.progress.toString()),o.setAttribute("aria-valuemin","0"),o.setAttribute("aria-valuemax","100")),o.setAttribute("tabindex","0"),this.task.type!==ct.Milestone&&o.append(r),o.append(a),this.setupTaskEdit(o,e),this.setupTooltip(o),this.setupInteractions(o,e),o.addEventListener("keydown",(t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),o.dispatchEvent(new MouseEvent("dblclick",{bubbles:!0})))})),o}drawBaselineBar(){if(!this.hasBaseline())return null;const{barBorderRadius:t,barMargin:e,rowHeight:n}=this.options,i=this.options.baseline.color,o=this.task.baseline,r={...this.task,startTime:o.start,endTime:o.end,type:ct.Task},a=J.calculateX(r,this.ganttStartDate,this.viewMode,this.options),s=J.calculateWidth(r,this.viewMode,this.options),l=e+this.calculateHeight()+2+this.index*n,c=g(this.chartContext,{className:"bar-baseline"});c.setAttribute("aria-hidden","true"),c.setAttribute("data-taskid-baseline",this.task.id);const d=m({backgroundColor:i,borderRadius:t,height:"6px",left:`${a}px`,pointerEvents:"none",top:`${l}px`,width:`${s}px`});return c.setAttribute("style",d),c}getBarStyles(t){const{barBackgroundColor:e,barBorderRadius:n,barMargin:i,barTextColor:o,rowHeight:r}=this.options,a=J.calculateX(this.task,this.ganttStartDate,this.viewMode,this.options),s=J.calculateWidth(this.task,this.viewMode,this.options),l=this.calculateHeight(),c=t||e;return this.task.type===ct.Milestone?{backgroundColor:f(c,-40),borderRadius:"2px",color:o,height:`${l}px`,left:`${a}px`,top:r/3-i/2+this.index*r+"px",transform:"rotate(45deg)",width:`${s}px`}:{backgroundColor:c,borderRadius:n,color:o,height:`${l}px`,left:`${a}px`,top:`${i+this.index*r}px`,width:`${s}px`}}makeDraggable(t,e){new K(this.task.id,this.options,this.viewMode,this.chartContext,this.dataManager).makeDraggable(t,e)}makeResizable(t,e){new G(this.task.id,this.options,this.viewMode,this.chartContext,this.dataManager).makeResizable(t,e)}cleanup(){this.tooltipHandler&&(this.tooltipHandler.cleanup(),this.tooltipHandler=null)}}var tt=(t=>(t.Duration="duration",t.EndTime="endTime",t.Name="name",t.Progress="progress",t.StartTime="startTime",t))(tt||{});const et={duration:"Duration",name:"Task Name",progress:"Progress",startTime:"Start"},nt=[{key:"name",title:et.name,minWidth:"120px",flexGrow:3},{key:"startTime",title:et.startTime,minWidth:"70px",flexGrow:1.5},{key:"duration",title:et.duration,minWidth:"50px",flexGrow:1},{key:"progress",title:et.progress,minWidth:"50px",flexGrow:1}];function it(t,e,n){const i=t[e];if("startTime"===e)return w(i,n).format(n);if("endTime"===e)return w(i,n).format(n);if("duration"===e){const e=w(t.startTime,n),i=w(t.endTime,n);return t.endTime?`${i.diff(e,"d")+1} d`:"0 d"}if("progress"===e){return`${t.progress??0}%`}return i}function ot(t,e){const n=t.getInstanceId(),i=`.tasks-container .tasks-data-row[data-taskid="${e}"][data-chart-instance="${n}"]`,o=t.querySelector(i);return o||R.warn(`[${n}] Task row element not found for task: ${e}`),o}function rt(t,e){return(null==e?void 0:e.length)?e[t%e.length]:"transparent"}function at(t,e,n){const i=ot(t,e),o=z(t,e);i&&(i.style.backgroundColor=n),o&&(o.style.backgroundColor=n)}const st=(t,e,n,i,o,r,a)=>{const{taskBar:s,taskBarRow:l,taskRow:c}=((t,e)=>{const n=ot(t,e);return{taskBar:H(t,e),taskBarRow:z(t,e),taskRow:n}})(t,n);if(!c||!s)return;const d=e.updateTask(n,i);if(!d)return;if(c.querySelectorAll("td").forEach((i=>{const r=i.getAttribute("data-columnid");if(r&&(i.innerHTML=it(d,r,o.inputDateFormat),"name"===r))if(e.hasChildren(n)){const o=t.createElement("span");o.className="task-toggle-icon "+(d.collapsed?"collapsed":"expanded"),o.addEventListener("click",(()=>{e.toggleTask(n)})),i.prepend(o)}else{const e=t.createElement("span");e.className="task-toggle-icon-blank",i.prepend(e)}})),i.rowBackgroundColor&&l&&(c.style.backgroundColor=i.rowBackgroundColor,l.style.backgroundColor=i.rowBackgroundColor),i.barBackgroundColor&&(s.style.backgroundColor=i.barBackgroundColor),i.startTime||i.endTime){const t=J.calculateX(d,a,r,o),e=J.calculateWidth(d,r,o);s.style.left=`${t}px`,s.style.width=`${e}px`}if(void 0!==i.progress){const t=s.querySelector(".bar-timeline-progress");t&&(t.style.width=`${i.progress}%`),i.barBackgroundColor&&(t.style.backgroundColor=f(i.barBackgroundColor,-40))}if(i.name){const t=s.querySelector(".bar-label");t&&(t.textContent=i.name)}e.updateDependencyArrows(n,t)},lt="data-chart-instance";var ct=(t=>(t.Milestone="milestone",t.Task="task",t))(ct||{});function dt(t){return"string"==typeof t?{taskId:t,type:"FS",lag:0}:{taskId:t.taskId,type:t.type??"FS",lag:t.lag??0}}class ht{constructor(t,e,n){this.options=t,this.chartContext=e,this.dataManager=n,this.effectiveColumnList=this.mergeColumnConfig(),this.injectDynamicColumnStyles()}mergeColumnConfig(){return this.options.columnConfig&&0!==this.options.columnConfig.length?nt.map((t=>{var e;const n=null==(e=this.options.columnConfig)?void 0:e.find((e=>e.key===t.key));return n?{...t,...n}:t})):nt}injectDynamicColumnStyles(){const t=this.effectiveColumnList.map((t=>`minmax(${t.minWidth||"30px"}, ${t.flexGrow||1}fr)`)).join(" ");const e=this.chartContext.getInstanceId(),n=`\n .tasks-container .tasks-header[data-chart-instance="${e}"] .tasks-header-row {\n grid-template-columns: ${t};\n }\n\n .tasks-container .tasks-data-row[data-chart-instance="${e}"] {\n grid-template-columns: ${t};\n }\n `;this.chartContext.injectStyles(n,`tasks-dynamic-columns-${e}`,{priority:"high"})}generateBody(t,e,n){const i=g(this.chartContext,{className:"tasks-data-container"}),o=n?n.allTasks:t;return i.setAttribute("role","treegrid"),i.setAttribute("aria-label",this.options.taskListAriaLabel??"Gantt task list"),i.setAttribute("aria-rowcount",o.length.toString()),n?this.generateRowsVirtualized(o,i,e,n.range,n.rowHeight):this.generateRows(t,i,e),i}generateHeader(t){const e=g(this.chartContext,{className:"tasks-header"}),n=g(this.chartContext,{className:"tasks-header-row"}),{rowHeight:i}=this.options,o=this.chartContext.getInstanceId();return e.setAttribute(lt,o),t.forEach((t=>{const e=g(this.chartContext,{className:"tasks-header-cell",content:t});e.style.height=2*i+"px",e.style.color="var(--text-color)",n.append(e)})),e.append(n),e.style.background="var(--header-bg-color)",e}generateRow(t,e,n){const i=g(this.chartContext,{className:"tasks-data-row"}),{rowHeight:o}=this.options,r=this.chartContext.getInstanceId();i.setAttribute("data-taskid",t.id),i.setAttribute(lt,r),i.style.height=`${o}px`,i.setAttribute("role","row"),i.setAttribute("aria-rowindex",n.toString()),i.setAttribute("aria-level",(t.level??1).toString()),i.setAttribute("aria-selected","false"),i.setAttribute("tabindex",1===n?"0":"-1"),this.dataManager.hasChildren(t.id)&&i.setAttribute("aria-expanded",t.collapsed?"false":"true");let a=1;return this.effectiveColumnList.forEach((({key:n})=>{const s=g(this.chartContext,{className:"tasks-data-cell",content:it(t,n,this.options.inputDateFormat)});if(s.setAttribute("data-columnid",n),s.setAttribute(lt,r),s.style.height=`${o}px`,s.style.color="var(--text-color)",s.setAttribute("role","gridcell"),s.setAttribute("aria-colindex",a.toString()),s.setAttribute("aria-readonly","true"),a++,n===tt.Name){if(s.style.paddingLeft=15*(t.level??0)+"px",s.style.textAlign="left",s.innerHTML="",this.dataManager.hasChildren(t.id)){const n=b(this.chartContext,"span",{className:"task-toggle-icon "+(t.collapsed?"collapsed":"expanded")});n.addEventListener("click",(()=>{this.dataManager.toggleTask(t.id),e()})),s.append(n)}else{const t=b(this.chartContext,"span",{className:"task-toggle-icon-blank"});s.append(t)}const n=b(this.chartContext,"span",{textContent:t.name});s.append(n)}i.append(s)})),i}generateRows(t,e,n){return t.forEach(((t,i)=>{const o=this.generateRow(t,n,i+1);e.appendChild(o)})),this.fillEmptyRows(e,t.length,n),e}generateRowsVirtualized(t,e,n,i,o){const{startIndex:r,endIndex:a}=i,s=t.length,l=this.chartContext.createElement("div");l.className="virtualizer-top-spacer",l.style.height=r*o+"px",e.appendChild(l);t.slice(r,a+1).forEach(((t,i)=>{const o=r+i,a=this.generateRow(t,n,o+1);e.appendChild(a)}));const c=Math.max(0,(s-1-a)*o),d=this.chartContext.createElement("div");return d.className="virtualizer-bottom-spacer",d.style.height=`${c}px`,e.appendChild(d),e}fillEmptyRows(t,e,n){const i=this.chartContext.querySelector(".gantt-container");if(!i)return;const o=i.clientHeight,r=this.options.rowHeight,a=o-2*r,s=Math.floor(a/r),l=Math.max(0,s-e);for(let e=0;e<l;e++){const n=this.generateEmptyRow(e);t.appendChild(n)}}generateEmptyRow(t){const e=g(this.chartContext,{className:"tasks-data-row tasks-empty-row"}),{rowHeight:n}=this.options,i=this.chartContext.getInstanceId();return e.setAttribute("data-taskid",`empty-${t}`),e.setAttribute(lt,i),e.style.height=`${n}px`,this.effectiveColumnList.forEach((({key:t})=>{const o=g(this.chartContext,{className:"tasks-data-cell",content:""});o.setAttribute("data-columnid",t),o.setAttribute(lt,i),o.style.height=`${n}px`,o.style.color="var(--text-color)",e.append(o)})),e}render(t,e){const n=this.generateHeader(this.effectiveColumnList.map((t=>t.title))),i=e?e.allTasks.slice(e.range.startIndex,e.range.endIndex+1):this.dataManager.getFlatVisibleTasks();return[n,this.generateBody(i,t,e)]}}const pt="root";class ut{constructor(t=[]){this.dependencies=[],this.taskMap={},this.taskTree={},this.arrowLinkInstanceId=null,this.setTasks(t)}buildTaskTree(t){const e={[pt]:[]};t.forEach((t=>{var n;if(this.taskMap[t.id]=t,e[t.id]||(e[t.id]=[]),void 0===t.parentId||e[t.parentId]||(e[t.parentId]=[]),t.dependency){const{taskId:e,type:n,lag:i}=dt(t.dependency);this.addDependency(e,t.id,n,i)}t.parentId?null==(n=e[t.parentId])||n.push(t.id):e[pt].push(t.id)})),this.taskTree=e}processLevel(){const t=(e,n)=>{e.forEach((e=>{this.taskMap[e.id]={...e,level:n};const i=this.taskTree[e.id].map((t=>this.taskMap[t]));Array.isArray(i)&&t(i,n+1)}))};t(this.getTasks().filter((t=>!t.parentId)),1)}sortTasksByDate(t){const e=(e,n)=>new Date(e[t]).getTime()-new Date(n[t]).getTime(),n=(t,i)=>{t.sort(e),i&&(this.taskTree[i]=t.map((t=>t.id))),t.forEach((t=>{const e=this.taskTree[t.id].map((t=>this.getTaskById(t))).filter((t=>null!==t));e&&e.length>0&&n(e,t.id)}))},i=this.taskTree[pt].map((t=>this.getTaskById(t))).filter((t=>null!==t));n(i,pt)}validateTask(t){if("milestone"===t.type){if(!t.id||!t.startTime)throw new Error("Milestone must have an id and start date")}else if(!t.id||!t.startTime||!t.endTime)throw new Error("Task must have an id, start, and end date");return{...t,endTime:t.endTime||t.startTime,progress:t.progress??0,type:t.type??ct.Task,level:1}}addDependency(t,e,n="FS",i=0){this.dependencies.push({fromId:t,toId:e,type:n,lag:i})}addTask(t){const e=this.validateTask(t);this.taskMap[e.id]=e,this.buildTaskTree(this.getTasks())}calculateProgress(){const t=this.getTasks(),e=t.reduce(((t,e)=>t+w(e.endTime).diff(w(e.startTime),"day")),0),n=t.reduce(((t,e)=>t+e.progress/100*w(e.endTime).diff(w(e.startTime),"day")),0);return e?n/e*100:0}getDateRange(t=0,e){const n=this.getTasks();if(0===n.length){const n=w().startOf(e);let i=1;switch(e){case"day":i=30;break;case"week":case"month":default:i=12;break;case"quarter":i=4;break;case"year":i=5}const o=n.add(i+t,e);return[n,o]}const i=n.map((t=>w(t.startTime))),o=n.filter((t=>!!t.endTime)).map((t=>w(t.endTime)));return[w.min(i),w.max(o).add(t,e)]}getFlatSortedTasks(t,e=!1){let n=[];return t.forEach((t=>{n.push(t);const i=this.taskTree[t.id].map((t=>this.taskMap[t]));!e&&t.collapsed||!Array.isArray(i)||(n=n.concat(this.getFlatSortedTasks(i,e)))})),n}getFlatTasks(){return this.getFlatSortedTasks(this.taskTree[pt].map((t=>this.getTaskById(t))).filter((t=>null!==t)),!0)}getFlatVisibleTasks(){return this.getFlatSortedTasks(this.taskTree[pt].map((t=>this.getTaskById(t))).filter((t=>null!==t)))}getNestedChildTasks(t,e=!1){const n=[],i=t=>{var o;if(e&&(null==(o=this.taskMap[t])?void 0:o.collapsed))return;(this.taskTree[t]||[]).forEach((t=>{const e=this.taskMap[t];e&&(n.push(e),i(t))}))};return i(t),n}getTaskById(t){return this.taskMap[t]}getTaskDependencies(t){return{incoming:this.dependencies.filter((e=>e.toId===t)),outgoing:this.dependencies.filter((e=>e.fromId===t))}}getTasks(){return Object.values(this.taskMap)}getTopParentTasks(){return Object.values(this.taskMap).filter((t=>void 0===t.parentId&&t.type===ct.Task))}hasChildren(t){return this.taskTree[t].length>0}removeDependency(t,e){this.dependencies=this.dependencies.filter((n=>!(n.fromId===t&&n.toId===e)))}removeTask(t){delete this.taskMap[t],this.buildTaskTree(Object.values(this.taskMap))}setTasks(t){if(!Array.isArray(t))throw new Error("Tasks must be an array");const e=t.map((t=>this.validateTask(t)));this.taskMap={},this.dependencies=[],this.buildTaskTree(e),this.sortTasksByDate("startTime"),this.processLevel()}toggleTask(t){const e=this.getTaskById(t);e&&(this.taskMap[t]={...e,collapsed:!e.collapsed})}setArrowLinkInstanceId(t){this.arrowLinkInstanceId=t}updateDependencyArrows(t,e){const n=this.getTaskDependencies(t);[...n.incoming,...n.outgoing].forEach((t=>{const n=this.getTaskById(t.fromId),i=this.getTaskById(t.toId);if(n&&i){const n=(null==e?void 0:e.getInstanceId())||"unknown",i={fromId:t.fromId,toId:t.toId,type:t.type,lag:t.lag,chartInstanceId:n,arrowLinkInstanceId:this.arrowLinkInstanceId??void 0},o=new CustomEvent("dependency-arrow-update",{detail:i,bubbles:!1,cancelable:!1});e?e.dispatchEvent(o):(R.warn(`[${n}] No chartContext provided for dependency arrow update`),document.dispatchEvent(o))}}))}getAllDependencies(){return this.dependencies}updateTask(t,e){const n=this.taskMap[t];if(!n)throw new Error(`Task with id "${t}" not found`);const i=this.validateTask({...n,...e});return this.taskMap[t]=i,this.buildTaskTree(this.getTasks()),i}}const mt="MMMM, YYYY",gt={1:["Jan","Feb","Mar"],2:["Apr","May","Jun"],3:["Jul","Aug","Sep"],4:["Oct","Nov","Dec"]};function bt(t,e,n){const i=[];let o=t.startOf(n);const r=e.startOf(n);for(;o.isSameOrBefore(r);)i.push(o),o=o.add(1,`${n}s`);return i}function ft(t,e){return bt(t,e,P.Month)}function vt(t,e){return bt(t,e,P.Year)}function yt(t,e,n){const i=function(t,e){return bt(t,e,P.Day)}(t,e),o=ft(t,e),r=i.map((t=>t.format("DD MMM")));return[o.map(((i,r)=>0===r?{data:i.format("MMM YYYY"),width:(i.daysInMonth()-t.date()+1)*n}:r===o.length-1?{data:i.format("MMM YYYY"),width:(i.daysInMonth()-(i.daysInMonth()-e.date()))*n}:{data:i.format("MMM YYYY"),width:i.daysInMonth()*n})),r]}function wt(t,e,n){const i=function(t,e){return bt(t,e,P.Week)}(t,e),o=ft(t,e),r=i.map((t=>`#${t.week()}, ${t.day(0).format("DD MMM")} - ${t.day(6).format("DD MMM")}`));return[o.map(((i,r)=>{if(0===r){const e=i.endOf("month").date()-t.date()+1;return{data:i.format(mt),width:(e<7?7:e)/7*n}}if(r===o.length-1){const t=e.date()-i.startOf("month").date()+1;return{data:i.format(mt),width:(t<7?7:t)/7*n}}const a=i.endOf("month").date()-i.startOf("month").date()+1;return{data:i.format(mt),width:(a<7?7:a)/7*n}})),r]}function xt(t,e,n){const i=function(t,e){const n=[];let i=t.startOf(P.Quarter);const o=e.startOf(P.Quarter);for(;i.isSameOrBefore(o);)n.push(i),i=i.add(1,`${P.Quarter}s`);return n}(t,e),o=vt(t,e),r=i.map((t=>{const e=gt[t.quarter()];return`#${t.quarter()} ${e[0]}-${e[2]}`}));return[o.map(((i,r)=>0===r?{data:i.format("YYYY"),width:(5-t.quarter())*n}:r===o.length-1?{data:i.format("YYYY"),width:e.quarter()*n}:{data:i.format("YYYY"),width:4*n})),r]}function Ct(t){return t.classList.contains("gantt-reduced-motion")}function kt(t,e,n){if(Ct(n))return;if("function"!=typeof t.animate)return;const i=Math.min(30*e,500);t.animate([{transformOrigin:"top",transform:"translateY(-8px) scaleY(0)"},{transformOrigin:"top",transform:"translateY(0) scaleY(1)"}],{duration:200,easing:"ease-out",delay:i,fill:"backwards"})}const St="data-chart-instance";class Mt{constructor(t,e,n,i){this.viewMode=t,this.options=e,this.chartContext=n,this.dataManager=i}generateHeader(t,e){const n=g(this.chartContext,{className:"timeline-header"}),i=g(this.chartContext,{className:"timeline-header-row"}),{rowHeight:o}=this.options,r=this.chartContext.getInstanceId();if(n.setAttribute(St,r),n.setAttribute("tabindex","0"),n.setAttribute("aria-label","Timeline header"),t.forEach((t=>{const n=g(this.chartContext,{className:"timeline-header-cell",content:t.data,style:{height:e?`${o}px`:2*o+"px",minWidth:`${t.width}px`||"100%",color:"var(--text-color)"}});i.append(n)})),n.append(i),!e)return n.style.background="var(--header-bg-color)",n;const a=g(this.chartContext,{className:"timeline-header-row"});return e.forEach((t=>{const e=g(this.chartContext,{className:"timeline-header-cell",content:t,style:{height:`${o}px`,maxWidth:`${W[this.viewMode]}px`,minWidth:`${W[this.viewMode]}px`,color:"var(--text-color)"}});a.append(e)})),n.append(a),n.style.background="var(--header-bg-color)",n}generateRow(t,e){const n=g(this.chartContext,{className:"timeline-data-row"}),{rowHeight:i}=this.options,o=this.chartContext.getInstanceId();n.setAttribute("data-taskid",t),n.setAttribute(St,o);for(let t=0;t<e;t++){const t=g(this.chartContext,{className:"timeline-data-cell",style:{height:`${i}px`,minWidth:`${W[this.viewMode]}px`}});t.setAttribute(St,o),n.append(t)}return n}generateRows(t,e){const n=g(this.chartContext,{className:"timeline-body"}),i=this.chartContext.getInstanceId();return n.setAttribute(St,i),t.forEach((t=>{const i=this.generateRow(t.id,e);n.append(i)})),this.fillEmptyRows(n,t.length,e),n}generateRowsVirtualized(t,e,n,i){const o=g(this.chartContext,{className:"timeline-body"}),r=this.chartContext.getInstanceId();o.setAttribute(St,r);const{startIndex:a,endIndex:s}=n,l=t.length,c=this.chartContext.createElement("div");c.className="virtualizer-top-spacer",c.style.height=a*i+"px",o.appendChild(c);t.slice(a,s+1).forEach((t=>{const n=this.generateRow(t.id,e);o.append(n)}));const d=Math.max(0,(l-1-s)*i),h=this.chartContext.createElement("div");return h.className="virtualizer-bottom-spacer",h.style.height=`${d}px`,o.appendChild(h),o}fillEmptyRows(t,e,n){const i=this.chartContext.querySelector(".gantt-container");if(!i)return;const o=i.clientHeight,r=this.options.rowHeight,a=o-2*r,s=Math.floor(a/r),l=Math.max(0,s-e);for(let e=0;e<l;e++){const i=this.generateRow(`empty-${e}`,n);i.classList.add("timeline-empty-row"),t.append(i)}}getHeaderData(t,e,n){return n===P.Day?yt(t,e,W[this.viewMode]):n===P.Week?wt(t,e,W[this.viewMode]):n===P.Month?function(t,e,n){const i=ft(t,e),o=vt(t,e),r=i.map((t=>t.format("MMMM")));return[o.map(((i,r)=>0===r?{data:i.format("YYYY"),width:(12-t.month())*n}:r===o.length-1?{data:i.format("YYYY"),width:(e.month()+1)*n}:{data:i.format("YYYY"),width:12*n})),r]}(t,e,W[this.viewMode]):n===P.Quarter?xt(t,e,W[this.viewMode]):n===P.Year?function(t,e,n){return[vt(t,e).map((t=>({data:t.format("YYYY"),width:n}))),null]}(t,e,W[this.viewMode]):null}render(t,e=new Set){const n=t?t.allTasks:this.dataManager.getFlatVisibleTasks(),i=this.dataManager.getDateRange(8,this.viewMode),o=this.getHeaderData(i[0],i[1],this.viewMode);if(!o)return null;const[r,a]=o,s=this.generateHeader(r,a),l=(a||r).length;let c;c=t?this.generateRowsVirtualized(n,l,t.range,t.rowHeight):this.generateRows(n,l);const d=g(this.chartContext,{className:"bar-container"}),h=g(this.chartContext,{className:"annotation-container"}),p=this.chartContext.getChartContainer();if(t){const{startIndex:o,endIndex:r}=t.range,a=n.length*t.rowHeight;d.style.height=`${a}px`,d.style.width="100%";n.slice(o,r+1).forEach(((t,n)=>{const r=o+n,a=new J(t,i[0],this.options,this.viewMode,r,this.chartContext,this.dataManager),s=a.drawBar(((t,e)=>{st(this.chartContext,this.dataManager,t,e,this.options,this.viewMode,i[0])}));d.append(s),!e.has(t.id)&&p&&kt(s,r,p);const l=a.drawBaselineBar();l&&d.append(l)}))}else n.forEach(((t,n)=>{const o=new J(t,i[0],this.options,this.viewMode,n,this.chartContext,this.dataManager),r=o.drawBar(((t,e)=>{st(this.chartContext,this.dataManager,t,e,this.options,this.viewMode,i[0])}));d.append(r),!e.has(t.id)&&p&&kt(r,n,p);const a=o.drawBaselineBar();a&&d.append(a)}));const u=n.length*this.options.rowHeight,m=new q(this.options,i[0],this.viewMode,this.chartContext,u).render();h.append(...m);const b=g(this.chartContext,{className:"timeline-horizontal-scroll"}),f=g(this.chartContext,{className:"timeline-horizontal-scroll-content"}),v=this.chartContext.getInstanceId();b.id=`timeline-horizontal-scroll-${v}`;const y=(a||r).length*W[this.viewMode];return f.style.width=`${y}px`,f.style.height="1px",b.appendChild(f),[s,h,c,d,b]}}const Et="http://www.w3.org/2000/svg",Tt={paddingX:20,paddingY:15};class At{constructor(t){this.elements=[],this.chartContext=null,this.instanceId=t??"arrow_"+crypto.randomUUID().replace(/-/g,"").substring(0,9)}getInstanceId(){return this.instanceId}static calculateArrowPathFromRects(t,e,n,i="FS"){const{paddingX:o=Tt.paddingX,paddingY:r=Tt.paddingY}=n;switch(i){case"SS":return At.calculateSSPath(t,e,o,r);case"FF":return At.calculateFFPath(t,e,o,r);case"SF":return At.calculateSFPath(t,e,o,r);default:return At.calculateFSPath(t,e,o,r)}}static calculateArrowPath(t,e,n,i,o="FS"){const r=d(t,n),a=d(e,n),{paddingX:s=Tt.paddingX,paddingY:l=Tt.paddingY}=i;switch(o){case"SS":return At.calculateSSPath(r,a,s,l);case"FF":return At.calculateFFPath(r,a,s,l);case"SF":return At.calculateSFPath(r,a,s,l);default:return At.calculateFSPath(r,a,s,l)}}static calculateFSPath(t,e,n,i){const o=t.right,r=t.top+t.height/2,a=e.left-2,s=e.top+e.height/2,l=[`M ${o},${r}`];if(a>o){if(s<r){const t=o+n,e=r-i,c=a-n,d=s+i;l.push(`L ${t},${r}`),l.push(`L ${t},${e}`),l.push(`L ${c},${e}`),l.push(`L ${c},${d}`),l.push(`L ${c},${s}`)}else if(s>r){const e=t.bottom+i-t.height/2,c=(o+a)/2;if(a-o<20){const t=a-n;l.push(`L ${c},${r}`),l.push(`L ${c},${e}`),l.push(`L ${t},${e}`),l.push(`L ${t},${s}`)}else l.push(`L ${c},${r}`),l.push(`L ${c},${e}`),l.push(`L ${c},${s}`)}}else if(a<o)if(s!==r){const t=o+n,e=r+i*(s<r?-1:1),c=a-n,d=s+i*(s<r?1:-1);l.push(`L ${t},${r}`),l.push(`L ${t},${e}`),l.push(`L ${c},${e}`),l.push(`L ${c},${d}`),l.push(`L ${c},${s}`)}else{const t=o+n,e=r+i,c=a-n,d=s;l.push(`L ${t},${r}`),l.push(`L ${t},${e}`),l.push(`L ${c},${e}`),l.push(`L ${c},${d}`)}return l.push(`L ${a},${s}`),l.join(" ")}static calculateSSPath(t,e,n,i){const o=t.left,r=t.top+t.height/2,a=e.left-2,s=e.top+e.height/2,l=Math.min(o,a+2)-n,c=[`M ${o},${r}`];if(r===s)c.push(`L ${l},${r}`),c.push(`L ${l},${s}`);else{const t=r+i*(s>r?1:-1);c.push(`L ${l},${r}`),c.push(`L ${l},${t}`),c.push(`L ${l},${s}`)}return c.push(`L ${a},${s}`),c.join(" ")}static calculateFFPath(t,e,n,i){const o=t.right,r=t.top+t.height/2,a=e.right+2,s=e.top+e.height/2,l=Math.max(o,a-2)+n,c=[`M ${o},${r}`];if(r===s)c.push(`L ${l},${r}`),c.push(`L ${l},${s}`);else{const t=r+i*(s>r?1:-1);c.push(`L ${l},${r}`),c.push(`L ${l},${t}`),c.push(`L ${l},${s}`)}return c.push(`L ${a},${s}`),c.join(" ")}static calculateSFPath(t,e,n,i){const o=t.left,r=t.top+t.height/2,a=e.right+2,s=e.top+e.height/2,l=o-n,c=e.right+n,d=[`M ${o},${r}`];if(d.push(`L ${l},${r}`),r<=s){const e=t.bottom+i-t.height/2;d.push(`L ${l},${e}`),d.push(`L ${c},${e}`),d.push(`L ${c},${s}`)}else{const t=e.top-i;d.push(`L ${l},${t}`),d.push(`L ${c},${t}`),d.push(`L ${c},${s}`)}return d.push(`L ${a},${s}`),d.join(" ")}static drawArrow(t,e,n,i,o,r,a,s="FS",l=0){const c=a?a.createElementNS(Et,"path"):document.createElementNS(Et,"path"),d=At.calculateArrowPath(t,e,n,i,s);c.setAttribute("d",d);const h=i.arrowColor||"#0D6EFD";c.setAttribute("stroke",h),c.setAttribute("stroke-width","2"),c.setAttribute("fill","transparent");const p=r?`arrowhead-${r}`:"arrowhead";return c.setAttribute("marker-end",`url(#${p})`),c.setAttribute("data-edgeid",o),c.setAttribute("data-dependency-type",s),c.addEventListener("mouseout",(function(){c.setAttribute("stroke",h)})),0!==l&&c.setAttribute("data-lag-px",String(l)),c}static updateArrow(t,e,n,i,o,r="FS"){const a=n.querySelector(`[data-edgeid="${o}"]`),s=At.calculateArrowPath(t,e,n,i,r);a&&a.setAttribute("d",s)}createMarker(t){const e=t?t.createElementNS(Et,"marker"):document.createElementNS(Et,"marker"),n=`arrowhead-${this.instanceId}`;e.setAttribute("id",n),e.setAttribute("markerWidth","5"),e.setAttribute("markerHeight","5"),e.setAttribute("refX","4"),e.setAttribute("refY","2.5"),e.setAttribute("orient","auto"),e.setAttribute("fill","context-stroke");const i=t?t.createElementNS(Et,"polygon"):document.createElementNS(Et,"polygon");return i.setAttribute("points","0,0 5,2.5 0,5 1, 2.5"),e.appendChild(i),e}render(t,e,n,i){this.chartContext=i||null;const o=`timeline-arrows-${this.instanceId}`;let r=t.querySelector(`#${o}`);r||(r=i?i.createElementNS(Et,"svg"):document.createElementNS(Et,"svg"),r.setAttribute("id",o),t.appendChild(r)),this.svg=r,this.options={...Tt,...n},this.elements=e,this.svg.setAttribute("style",m({left:"0",position:"absolute",top:"0",pointerEvents:"none"})),this.svg.innerHTML="";const a=i?i.createElementNS(Et,"defs"):document.createElementNS(Et,"defs"),s=this.createMarker(i);return a.appendChild(s),this.svg.appendChild(a),this.svg.setAttribute("width",`${this.options.width}`),this.svg.setAttribute("height",`${this.options.height}`),this.elements.forEach((({id:t,source:e,target:n,dependencyType:o,lagPx:r})=>{this.svg.appendChild(At.drawArrow(e,n,this.svg,this.options,t,this.instanceId,i,o,r))})),this.svg}renderFromRects(t,e,n,i){this.chartContext=i||null;const o=`timeline-arrows-${this.instanceId}`;let r=t.querySelector(`#${o}`);r||(r=i?i.createElementNS(Et,"svg"):document.createElementNS(Et,"svg"),r.setAttribute("id",o),t.appendChild(r)),this.svg=r,this.options={...Tt,...n},this.svg.setAttribute("style",m({left:"0",position:"absolute",top:"0",pointerEvents:"none"})),this.svg.innerHTML="";const a=i?i.createElementNS(Et,"defs"):document.createElementNS(Et,"defs");a.appendChild(this.createMarker(i)),this.svg.appendChild(a),this.svg.setAttribute("width",`${this.options.width}`),this.svg.setAttribute("height",`${this.options.height}`);const s=n.arrowColor||"#0D6EFD",l=`arrowhead-${this.instanceId}`;return e.forEach((({id:t,sourceRect:e,targetRect:n,dependencyType:o="FS",lagPx:r=0})=>{const a=At.calculateArrowPathFromRects(e,n,this.options,o),c=i?i.createElementNS(Et,"path"):document.createElementNS(Et,"path");c.setAttribute("d",a),c.setAttribute("stroke",s),c.setAttribute("stroke-width","2"),c.setAttribute("fill","transparent"),c.setAttribute("marker-end",`url(#${l})`),c.setAttribute("data-edgeid",t),c.setAttribute("data-dependency-type",o),0!==r&&c.setAttribute("data-lag-px",String(r)),c.addEventListener("mouseout",(()=>{c.setAttribute("stroke",s)})),this.svg.appendChild(c)})),this.svg}}const $t={criticalTaskIds:new Set,criticalEdgeKeys:new Set};function Dt(t,e){const n=new Date(t).setHours(0,0,0,0),i=new Date(e).setHours(0,0,0,0);return Math.round((i-n)/864e5)+1}function Bt(t){const e=e=>function(t,e){return getComputedStyle(t).getPropertyValue(e).trim()}(t,e);return{barFill:e("--apex-gantt-bar-fill"),bgColor:e("--apex-gantt-background-color"),rowBgEven:e("--apex-gantt-row-bg-even"),rowBgOdd:e("--apex-gantt-row-bg-odd"),headerBg:e("--apex-gantt-header-bg"),gridLine:e("--apex-gantt-grid-line"),dependencyLine:e("--apex-gantt-dependency-line"),fontFamily:e("--apex-gantt-font-family"),fontSize:e("--apex-gantt-font-size"),fontColor:e("--apex-gantt-font-color")}}const Ft="http://www.w3.org/2000/svg";function It(t,e){t&&Object.assign(t.style,e)}function Rt(t){const e=[];for(let t=0;t<document.styleSheets.length;t++)try{const n=document.styleSheets[t];if(n.href&&!n.href.startsWith(window.location.origin))continue;if(n.cssRules)for(let t=0;t<n.cssRules.length;t++)e.push(n.cssRules[t].cssText)}catch(t){continue}document.querySelectorAll("style").forEach((t=>{t.textContent&&e.push(t.textContent)}));const n=function(t){const e=window.getComputedStyle(t),n=[];for(let e=0;e<t.style.length;e++){const i=t.style[e];if(i.startsWith("--")){const e=t.style.getPropertyValue(i);n.push(`${i}: ${e};`)}}return Array.from(e).forEach((t=>{if(t.startsWith("--")){const i=`${t}: ${e.getPropertyValue(t)};`;n.includes(i)||n.push(i)}})),0===n.length?"":`:root {\n ${n.join("\n ")}\n}`}(t);return n&&e.unshift(n),e.join("\n")}function Ht(t,e){const{contentWidth:n}=e,i=t.querySelector(".timeline-horizontal-scroll");null==i||i.remove();const o=t.querySelector(".timeline-container"),r=t.querySelector(".tasks-container"),a=t.querySelector(".timeline-body-wrapper"),s=t.querySelector(".timeline-header"),l=t.querySelector(".timeline-body"),c=t.querySelector(".bar-container"),d=t.querySelector(".annotation-container");var h;It(o,{overflow:"visible",maxWidth:"none",width:"auto",position:"relative"}),It(r,{overflow:"visible",height:"auto",maxHeight:"none"}),It(a,{overflow:"visible",maxWidth:"none",width:`${n}px`}),a&&(a.scrollLeft=0),It(s,{overflow:"visible",maxWidth:"none",width:`${n}px`}),s&&(s.scrollLeft=0),h={width:`${n}px`,minWidth:`${n}px`,maxWidth:"none"},[l,c,d].forEach((t=>It(t,h)))}const zt=async t=>{try{const e=function(t){const e=t.querySelector(".gantt-container");if(!e)throw new Error("Gantt container not found");const n=e.querySelector(".timeline-container"),i=e.querySelector(".tasks-container");if(!n||!i)throw new Error("Timeline or tasks container not found");return{ganttContainer:e,timelineContainer:n,tasksContainer:i,horizontalScroll:e.querySelector(".timeline-horizontal-scroll"),timelineBodyWrapper:n.querySelector(".timeline-body-wrapper"),timelineHeader:n.querySelector(".timeline-header"),timelineBody:n.querySelector(".timeline-body"),barContainer:n.querySelector(".bar-container"),annotationContainer:n.querySelector(".annotation-container")}}(t),n=function(t){var e,n,i,o;const r=Math.max((null==(e=t.timelineBody)?void 0:e.scrollWidth)||0,(null==(n=t.barContainer)?void 0:n.scrollWidth)||0,(null==(i=t.annotationContainer)?void 0:i.scrollWidth)||0,(null==(o=t.timelineHeader)?void 0:o.scrollWidth)||0),a=t.tasksContainer.scrollWidth;return{contentWidth:r,tasksWidth:a,totalWidth:a+r,totalHeight:Math.max(t.timelineContainer.scrollHeight,t.tasksContainer.scrollHeight)}}(e),i=e.ganttContainer.cloneNode(!0);Ht(i,n),It(i,{display:"flex",overflow:"visible",width:"fit-content",height:"auto"});const o=Rt(t),r=document.createElement("style");r.textContent=o,i.insertBefore(r,i.firstChild);const a=document.createElementNS(Ft,"svg");a.setAttribute("width",n.totalWidth.toString()),a.setAttribute("height",n.totalHeight.toString()),a.setAttribute("xmlns",Ft),a.setAttribute("viewBox",`0 0 ${n.totalWidth} ${n.totalHeight}`);const s=document.createElementNS(Ft,"foreignObject");s.setAttribute("width",n.totalWidth.toString()),s.setAttribute("height",n.totalHeight.toString()),s.setAttribute("x","0"),s.setAttribute("y","0"),s.appendChild(i),a.appendChild(s);const l='<?xml version="1.0" encoding="UTF-8"?>\n'+(new XMLSerializer).serializeToString(a),c=new Blob([l],{type:"image/svg+xml;charset=utf-8"}),d=URL.createObjectURL(c),h=document.createElement("a");h.href=d,h.download=`gantt-chart-${Date.now()}.svg`,document.body.appendChild(h),h.click(),document.body.removeChild(h),setTimeout((()=>URL.revokeObjectURL(d)),100)}catch(t){throw R.error("Error exporting gantt chart:",t),t}},Lt={zoomIn:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="11" cy="11" r="8"/>\n <path d="m21 21-4.35-4.35"/>\n <line x1="11" y1="8" x2="11" y2="14"/>\n <line x1="8" y1="11" x2="14" y2="11"/>\n </svg>',zoomOut:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="11" cy="11" r="8"/>\n <path d="m21 21-4.35-4.35"/>\n <line x1="8" y1="11" x2="14" y2="11"/>\n </svg>',calendar:'<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <rect x="3" y="4" width="18" height="18" rx="2" ry="2"/>\n <line x1="16" y1="2" x2="16" y2="6"/>\n <line x1="8" y1="2" x2="8" y2="6"/>\n <line x1="3" y1="10" x2="21" y2="10"/>\n </svg>',chevronDown:'<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="6 9 12 15 18 9"/>\n </svg>',download:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>\n <polyline points="7 10 12 15 17 10"/>\n <line x1="12" y1="15" x2="12" y2="3"/>\n </svg>'},Pt={ganttContainer:".gantt-container",actionsContainer:".gantt-actions-container",splitBar:".split-bar-container",tasksContainer:".tasks-container",tasksHeader:".tasks-header",tasksBodyWrapper:".tasks-body-wrapper",tasksDataContainer:".tasks-data-container",tasksDataRow:".tasks-data-row",tasksEmptyRow:".tasks-empty-row",tasksDataCell:".tasks-data-cell",timelineContainer:".timeline-container",timelineHeader:".timeline-header",timelineHeaderCell:".timeline-header-cell",timelineBodyWrapper:".timeline-body-wrapper",timelineBody:".timeline-body",timelineDataRow:".timeline-data-row",timelineEmptyRow:".timeline-empty-row",timelineDataCell:".timeline-data-cell",horizontalScroll:".timeline-horizontal-scroll",horizontalScrollContent:".timeline-horizontal-scroll-content",barContainer:".bar-container",virtualizerTopSpacer:".virtualizer-top-spacer",virtualizerBottomSpacer:".virtualizer-bottom-spacer"};class Ot{constructor(){this.state={scrollPosition:{horizontal:0,tasksVertical:0,timelineVertical:0},viewMode:P.Week,collapsedTasks:new Set}}captureState(t,e,n){const i=t.querySelector(".timeline-horizontal-scroll"),o=t.querySelector(".split-view-container");this.state.scrollPosition={horizontal:(null==i?void 0:i.scrollLeft)||0,tasksVertical:(null==o?void 0:o.scrollTop)||0,timelineVertical:(null==o?void 0:o.scrollTop)||0},this.state.viewMode=n,this.state.collapsedTasks=new Set(e.getFlatTasks().filter((t=>t.collapsed)).map((t=>t.id)))}restoreState(t,e=!1){e||requestAnimationFrame((()=>{const e=t.querySelector(".timeline-horizontal-scroll"),n=t.querySelector(".split-view-container");e&&(e.scrollLeft=this.state.scrollPosition.horizontal),n&&(n.scrollTop=this.state.scrollPosition.tasksVertical);const i=t.querySelector(".timeline-header");i&&(i.scrollLeft=this.state.scrollPosition.horizontal)}))}getViewMode(){return this.state.viewMode}hasState(){return void 0!==this.state.viewMode}clearState(){this.state={scrollPosition:{horizontal:0,tasksVertical:0,timelineVertical:0},viewMode:P.Week,collapsedTasks:new Set}}}const qt=["endTime","progress","type","parentId","dependency","barBackgroundColor","rowBackgroundColor","collapsed"];class Wt{static getNestedValue(t,e){if(!t||!e)return;const n=e.split(".");let i=t;for(const t of n){if(null==i)return;i=i[t]}return i}static processParsingValue(t,e){if("string"==typeof e)return this.getNestedValue(t,e);const{key:n,transform:i}=e,o=this.getNestedValue(t,n);if(i&&"function"==typeof i)try{return i(o)}catch(t){return R.warn(`DataParser: Transform function failed for key "${n}":`,t),o}return o}static buildTaskInput(t,e,n){const i=this.processParsingValue(t,e.id),o=this.processParsingValue(t,e.name),r=this.processParsingValue(t,e.startTime);if(!i||!o||!r)return R.warn(`DataParser: Skipping item at index ${n} - missing required fields`,{id:i,name:o,startTime:r,rawItem:t}),null;const a={id:i,name:o,startTime:r};for(const n of qt)if(void 0!==e[n]){const i=this.processParsingValue(t,e[n]);void 0!==i&&(a[n]=i)}return a}static parse(t,e){return Array.isArray(t)?e?t.map(((t,n)=>{try{return this.buildTaskInput(t,e,n)}catch(e){return R.warn(`DataParser: Error parsing item at index ${n}:`,e,t),null}})).filter((t=>null!==t)):(R.warn("DataParser: Parsing config is required"),[]):(R.warn("DataParser: Data must be an array"),[])}static validateConfig(t){return!!t&&(!!(t.id&&t.name&&t.startTime)||(R.warn("DataParser: Parsing config must include id, name, and startTime"),!1))}}const Nt="splitview-resize",Yt="timeline-horizontal-scroll";class Vt{constructor(t,e,n,i,o,r){this.element=t,this.options=e,this.domCache=n,this.chartContext=i,this.instanceId=o,this.getViewMode=r,this.scrollbarResizeObserver=null,this.splitBarResizeHandler=null,this.timelineScrollHandlers={},this.isSyncingScroll=!1}setupTimelineHorizontalScroll(){const t=this.domCache.horizontalScroll,e=this.domCache.timelineHeader,n=this.domCache.timelineBodyWrapper;if(!t||!e||!n)return;this.updateHorizontalScrollbarContent(),this.applyScrollbarStylesToElement(t),this.timelineScrollHandlers.bodyScroll&&n.removeEventListener("scroll",this.timelineScrollHandlers.bodyScroll),this.timelineScrollHandlers.horizontalScroll&&t.removeEventListener("scroll",this.timelineScrollHandlers.horizontalScroll);const i=i=>{if(this.isSyncingScroll)return;this.isSyncingScroll=!0;const o=t.scrollLeft;e.scrollLeft=o,n.scrollLeft=o,requestAnimationFrame((()=>{this.isSyncingScroll=!1}))},o=i=>{if(this.isSyncingScroll)return;this.isSyncingScroll=!0;const o=n.scrollLeft;t.scrollLeft=o,e.scrollLeft=o,requestAnimationFrame((()=>{this.isSyncingScroll=!1}))};t.addEventListener("scroll",i,{passive:!0}),n.addEventListener("scroll",o,{passive:!0}),this.timelineScrollHandlers={horizontalScroll:i,bodyScroll:o}}positionHorizontalScrollbar(){const t=this.domCache.horizontalScroll,e=this.domCache.ganttContainer,n=this.domCache.tasksContainer;if(!t||!e)return void R.warn("Missing elements for scrollbar positioning");e.offsetHeight;const i=n?n.offsetWidth:0,o=this.domCache.splitBar,r=i+(o?o.offsetWidth:0)+2,a=window.getComputedStyle(this.element),s=parseFloat(a.paddingLeft)||0,l=parseFloat(a.paddingBottom)||0;t.style.left=`${r+s}px`,t.style.bottom=`${l}px`;const c=e.clientWidth-r;t.style.width=`${Math.max(0,c)}px`}compensateForScrollbar(){const t=this.domCache.tasksBodyWrapper,e=this.domCache.tasksHeader;if(!t||!e)return;const n=t.offsetWidth-t.clientWidth;e.style.paddingRight="",e.style.boxSizing="",n>0&&(e.style.paddingRight=`${n}px`,e.style.boxSizing="border-box")}setupScrollbarResizeObserver(){if(!this.element)return;this.scrollbarResizeObserver&&this.scrollbarResizeObserver.disconnect(),this.scrollbarResizeObserver=new ResizeObserver((()=>{this.positionHorizontalScrollbar()})),this.scrollbarResizeObserver.observe(this.element);const t=this.domCache.ganttContainer;t&&this.scrollbarResizeObserver.observe(t),this.setupSplitBarResizeListener()}setupSplitBarResizeListener(){this.splitBarResizeHandler&&this.chartContext.removeEventListener(Nt,this.splitBarResizeHandler),this.splitBarResizeHandler=()=>{requestAnimationFrame((()=>{this.positionHorizontalScrollbar()}))},this.chartContext.addEventListener(Nt,this.splitBarResizeHandler)}updateHorizontalScrollbarContent(){const t=this.domCache.horizontalScroll,e=this.domCache.horizontalScrollContent,n=this.domCache.timelineBody;if(!t||!e||!n)return void R.warn("Scrollbar update: Missing elements",{horizontalScroll:!!t,scrollContent:!!e,timelineBody:!!n});const i=n.scrollWidth;e.style.width=`${i}px`}applyScrollbarStylesToElement(t){const{backgroundColor:e}=this.options;if(!this.isColorDark(e))return;const{borderColor:n,cellBorderColor:i}=this.options,o=`scrollbar-${this.instanceId}-${Date.now()}`,r=`\n #${t.id||Yt} {\n scrollbar-width: thin;\n scrollbar-color: ${n} ${e};\n }\n\n #${t.id||Yt}::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n }\n\n #${t.id||Yt}::-webkit-scrollbar-track {\n background: ${e};\n border-radius: 4px;\n }\n\n #${t.id||Yt}::-webkit-scrollbar-thumb {\n background: ${n};\n border-radius: 4px;\n border: 2px solid ${e};\n }\n\n #${t.id||Yt}::-webkit-scrollbar-thumb:hover {\n background: ${i};\n }\n `;t.id||(t.id=`timeline-horizontal-scroll-${this.instanceId}`),this.chartContext.injectStyles(r,o)}updateOptions(t){this.options=t}disableHeaderMousewheelScroll(){const t=this.domCache.timelineHeader;if(!t)return;t.addEventListener("wheel",(t=>{t.preventDefault()}),{passive:!1})}isColorDark(t){const e=t.replace("#","");return(.299*parseInt(e.substring(0,2),16)+.587*parseInt(e.substring(2,4),16)+.114*parseInt(e.substring(4,6),16))/255<.5}cleanup(){if(this.timelineScrollHandlers.bodyScroll||this.timelineScrollHandlers.horizontalScroll){const t=this.domCache.horizontalScroll,e=this.domCache.timelineBodyWrapper;t&&this.timelineScrollHandlers.horizontalScroll&&t.removeEventListener("scroll",this.timelineScrollHandlers.horizontalScroll),e&&this.timelineScrollHandlers.bodyScroll&&e.removeEventListener("scroll",this.timelineScrollHandlers.bodyScroll),this.timelineScrollHandlers={}}this.scrollbarResizeObserver&&(this.scrollbarResizeObserver.disconnect(),this.scrollbarResizeObserver=null),this.splitBarResizeHandler&&(this.chartContext.removeEventListener(Nt,this.splitBarResizeHandler),this.splitBarResizeHandler=null)}}class jt{constructor(t,e,n,i,o,r){this.element=t,this.domCache=e,this.chartContext=n,this.instanceId=i,this.getViewMode=o,this.callbacks=r,this.zoomHandler=null}setupZoomEventListener(){const t=this.instanceId,e=this.domCache.timelineContainer;e?(this.zoomHandler&&e.removeEventListener("wheel",this.zoomHandler),this.zoomHandler=t=>{if(!t.ctrlKey)return;t.preventDefault();const e=Math.sign(t.deltaY);e<0?this.zoomIn():e>0&&this.zoomOut()},e.addEventListener("wheel",this.zoomHandler)):R.warn(`[${t}] Timeline element not found for zoom listener`)}zoomIn(){const t=this.getViewMode();if(t===L[0])return;const e=L.findIndex((e=>e===t)),n=L[e-1];this.callbacks.onViewModeChange(n),this.callbacks.onToolbarUpdate(),this.callbacks.onTimelineRerender(),this.callbacks.onDependencyArrowsRender(),requestAnimationFrame((()=>{this.callbacks.onScrollbarUpdate(),this.callbacks.onScrollbarPosition()}))}zoomOut(){const t=this.getViewMode();if(t===L[L.length-1])return;const e=L.findIndex((e=>e===t)),n=L[e+1];this.callbacks.onViewModeChange(n),this.callbacks.onToolbarUpdate(),this.callbacks.onTimelineRerender(),this.callbacks.onDependencyArrowsRender(),requestAnimationFrame((()=>{this.callbacks.onScrollbarUpdate(),this.callbacks.onScrollbarPosition()}))}updateToolbarAfterZoom(){this.domCache.actionsContainer&&this.callbacks.onToolbarUpdate()}cleanup(){if(this.zoomHandler){const t=this.domCache.timelineContainer;t&&t.removeEventListener("wheel",this.zoomHandler),this.zoomHandler=null}}}const _t="aria-valuenow";class Ut{constructor(t,e,n,i={}){this.chartContext=t,this.leftContent=e,this.rightContent=n,this.options=i,this.isDragging=!1,this.mouseMoveHandler=null,this.mouseUpHandler=null}getSplitViewStyles(){return"\n .split-view-container {\n display: flex !important;\n height: 100%;\n width: 100%;\n position: relative;\n box-sizing: border-box;\n overflow-x: hidden;\n overflow-y: auto;\n }\n\n .split-view-container .split-left-container {\n flex-grow: 0 !important;\n flex-shrink: 1 !important;\n overflow: visible;\n display: flex !important;\n flex-direction: column;\n position: relative;\n box-sizing: border-box;\n height: fit-content;\n min-height: 100%;\n }\n\n .split-view-container .split-right-container {\n overflow: visible;\n position: relative;\n flex: 1 !important;\n display: flex !important;\n flex-direction: column;\n min-width: 0;\n box-sizing: border-box;\n height: fit-content;\n min-height: 100%;\n }\n \n .split-view-container .split-bar-container {\n cursor: col-resize !important;\n user-select: none !important;\n height: 100%;\n align-items: center;\n background: var(--split-bar-color, #DEE2E6);\n display: flex;\n flex: 0 0 auto;\n justify-content: center;\n min-width: 8px;\n width: 8px;\n z-index: 15;\n position: sticky;\n top: 0;\n box-sizing: border-box;\n border-left: 1px solid var(--split-bar-border-color, #BBBBBB);\n border-right: 1px solid var(--split-bar-border-color, #BBBBBB);\n opacity: 1;\n visibility: visible;\n box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);\n transition: background-color 0.2s ease, border-color 0.2s ease;\n }\n\n .split-view-container .split-bar-container:hover {\n background: var(--split-bar-hover-color, #007BFF);\n border-color: var(--split-bar-hover-border-color, #0056B3);\n }\n\n .split-view-container .split-bar-container .resize-handler {\n border-left: 1.5px solid var(--split-bar-handle-color, #666666);\n border-right: 1.5px solid var(--split-bar-handle-color, #666666);\n height: 20px;\n width: 4px;\n position: relative;\n pointer-events: none;\n box-sizing: border-box;\n background: rgba(102, 102, 102, 0.3);\n display: block;\n border-radius: 1px;\n margin: 0;\n padding: 0;\n opacity: 1;\n visibility: visible;\n transition: background-color 0.2s ease, border-color 0.2s ease;\n }\n\n .split-view-container .split-bar-container:hover .resize-handler {\n background: rgba(255, 255, 255, 0.9);\n border-color: #FFFFFF;\n }\n\n .split-view-container.dragging {\n user-select: none;\n cursor: col-resize;\n }\n\n .split-view-container.dragging * {\n pointer-events: none;\n }\n\n .split-view-container.dragging .split-bar-container {\n pointer-events: all;\n }\n\n :host .split-view-container {\n display: flex !important;\n height: auto;\n width: 100%;\n position: relative;\n box-sizing: border-box;\n overflow-y: auto; /* shadow DOM */\n }\n "}injectStyles(){this.chartContext.injectStyles(this.getSplitViewStyles(),"split-view-styles",{priority:"normal"})}buildElements(){const{leftContainerClass:t="",leftContainerWidth:e=425,rightContainerClass:n=""}=this.options;this.leftContainer=g(this.chartContext,{className:"split-left-container"+(t?" "+t:""),style:{flexBasis:`${e}px`}}),this.rightContainer=g(this.chartContext,{className:"split-right-container"+(n?" "+n:"")});const i=g(this.chartContext,{className:"resize-handler"}),o=g(this.chartContext,{className:"split-bar-click-area"});o.style.cssText="\n position: absolute;\n top: 0;\n left: 50%;\n transform: translateX(-50%);\n width: 20px;\n height: 100%;\n cursor: col-resize;\n z-index: 10;\n background: transparent;\n display: block;\n box-sizing: border-box;\n ",this.splitBarContainer=g(this.chartContext,{className:"split-bar-container"}),this.splitBarContainer.setAttribute("role","separator"),this.splitBarContainer.setAttribute("aria-orientation","vertical"),this.splitBarContainer.setAttribute("aria-label","Resize panels"),this.splitBarContainer.setAttribute(_t,String(e)),this.splitBarContainer.setAttribute("aria-valuemin","0"),this.splitBarContainer.setAttribute("aria-valuemax",String(4*e)),this.splitBarContainer.setAttribute("tabindex","0"),this.splitBarContainer.append(i,o),Array.isArray(this.leftContent)?this.leftContainer.append(...this.leftContent):this.leftContainer.append(this.leftContent),Array.isArray(this.rightContent)?this.rightContainer.append(...this.rightContent):this.rightContainer.append(this.rightContent)}attachEventListeners(){this.splitBarContainer.addEventListener("mousedown",(t=>{t.preventDefault(),this.isDragging=!0;const e=this.splitBarContainer.closest(".split-view-container");null==e||e.classList.add("dragging"),this.mouseMoveHandler=t=>{var e;if(!this.isDragging)return;const n=null==(e=this.leftContainer.parentElement)?void 0:e.getBoundingClientRect();if(!n)return;const i=t.clientX-n.left,o=n.width-50,r=Math.max(0,Math.min(o,i));this.leftContainer.style.flexBasis=`${r}px`,this.splitBarContainer.setAttribute(_t,String(Math.round(r))),this.dispatchResizeEvent()},this.mouseUpHandler=()=>{this.isDragging=!1;const t=this.splitBarContainer.closest(".split-view-container");null==t||t.classList.remove("dragging"),this.dispatchResizeEvent(),this.mouseMoveHandler&&(this.chartContext.removeEventListener("mousemove",this.mouseMoveHandler),this.mouseMoveHandler=null),this.mouseUpHandler&&(this.chartContext.removeEventListener("mouseup",this.mouseUpHandler),this.mouseUpHandler=null)},this.chartContext.addEventListener("mousemove",this.mouseMoveHandler),this.chartContext.addEventListener("mouseup",this.mouseUpHandler)})),this.splitBarContainer.addEventListener("keydown",(t=>{let e;const n=parseInt(this.leftContainer.style.flexBasis)||this.options.leftContainerWidth||400;switch(t.key){case"ArrowLeft":t.preventDefault(),e=Math.max(0,n-10),this.leftContainer.style.flexBasis=`${e}px`,this.splitBarContainer.setAttribute(_t,String(e)),this.dispatchResizeEvent();break;case"ArrowRight":t.preventDefault(),e=n+10,this.leftContainer.style.flexBasis=`${e}px`,this.splitBarContainer.setAttribute(_t,String(e)),this.dispatchResizeEvent();break;case"Home":t.preventDefault(),this.leftContainer.style.flexBasis="0px",this.splitBarContainer.setAttribute(_t,"0"),this.dispatchResizeEvent();break;case"End":{t.preventDefault();const e=this.splitBarContainer.parentElement;if(e){const t=e.clientWidth-50;this.leftContainer.style.flexBasis=`${t}px`,this.splitBarContainer.setAttribute(_t,String(Math.round(t)))}this.dispatchResizeEvent();break}}}))}dispatchResizeEvent(){const t=new CustomEvent("splitview-resize",{bubbles:!0,detail:{leftWidth:parseInt(this.leftContainer.style.flexBasis)||0}});this.chartContext.dispatchEvent(t)}cleanupEventListeners(){this.mouseMoveHandler&&(this.chartContext.removeEventListener("mousemove",this.mouseMoveHandler),this.mouseMoveHandler=null),this.mouseUpHandler&&(this.chartContext.removeEventListener("mouseup",this.mouseUpHandler),this.mouseUpHandler=null)}render(){this.injectStyles(),this.buildElements(),this.attachEventListeners();const t=g(this.chartContext,{className:"split-view-container"});return t.append(this.leftContainer,this.splitBarContainer,this.rightContainer),[t]}destroy(){this.cleanupEventListeners()}}const Xt="data-chart-instance";class Kt{constructor(t,e,n,i,o,r){this.element=t,this.options=e,this.domCache=n,this.chartContext=i,this.instanceId=o,this.getViewMode=r}updateOptions(t){this.options=t}setupChartContainerPositioning(){if(this.element){"static"===window.getComputedStyle(this.element).position&&(this.element.style.position="relative"),this.element.style.isolation="isolate"}}createLayout(t,e,n,i,o){t.style.position="relative",t.style.isolation="isolate";const r=this.instanceId,a=g(this.chartContext,{className:Pt.tasksContainer.slice(1)});let s,l;if(!Array.isArray(e))return void R.error("Tasks table should be an array of [header, body]");s=e[0],l=e[1];const c=g(this.chartContext,{className:Pt.tasksBodyWrapper.slice(1)});c.appendChild(l),a.appendChild(s),a.appendChild(c);const d=g(this.chartContext,{className:Pt.timelineContainer.slice(1)});d.setAttribute(Xt,r);const h=n[0];d.appendChild(h);const p=g(this.chartContext,{className:Pt.timelineBodyWrapper.slice(1)});for(let t=1;t<n.length-1;t++)p.appendChild(n[t]);d.appendChild(p);const u=n[n.length-1];if(i){const e=new Ut(this.chartContext,a,d,{leftContainerClass:"",leftContainerWidth:o,rightContainerClass:""}).render();t.append(...e)}else a.style.flex=`0 0 ${o}px`,t.append(a,d);t.appendChild(u)}syncTasksColumnWidths(){this.domCache.tasksContainer}fillEmptyRowsAfterRender(){const t=this.domCache.ganttContainer,e=this.domCache.timelineBody,n=this.domCache.tasksDataContainer;if(!t||!e||!n)return;e.querySelectorAll(Pt.timelineEmptyRow).forEach((t=>t.remove()));n.querySelectorAll(Pt.tasksEmptyRow).forEach((t=>t.remove()));const i=t.clientHeight,o=e.querySelectorAll(`${Pt.timelineDataRow}:not(${Pt.timelineEmptyRow})`).length,r=this.options.rowHeight,a=Math.floor(i/r),s=Math.max(0,a-o);if(0===s)return;let l=0;const c=e.querySelector(Pt.timelineDataRow);if(c)l=c.querySelectorAll(Pt.timelineDataCell).length;else{const t=this.domCache.timelineHeader;if(t){l=t.querySelectorAll(Pt.timelineHeaderCell).length}}if(0!==l){for(let t=0;t<s;t++){const n=this.createEmptyTimelineRow(t,l);e.appendChild(n)}for(let t=0;t<s;t++){const e=this.createEmptyTaskRow(t);n.appendChild(e)}}}createEmptyTimelineRow(t,e){const n=g(this.chartContext,{className:`${Pt.timelineDataRow.slice(1)} ${Pt.timelineEmptyRow.slice(1)}`}),{rowHeight:i}=this.options,o=this.instanceId,r=this.getViewMode();n.setAttribute("data-taskid",`empty-${t}`),n.setAttribute(Xt,o),n.style.height=`${i}px`;for(let t=0;t<e;t++){const t=g(this.chartContext,{className:Pt.timelineDataCell.slice(1),style:{height:`${i}px`,minWidth:`${W[r]}px`}});t.setAttribute(Xt,o),n.appendChild(t)}return n}createEmptyTaskRow(t){const e=g(this.chartContext,{className:`${Pt.tasksDataRow.slice(1)} ${Pt.tasksEmptyRow.slice(1)}`}),{rowHeight:n}=this.options,i=this.instanceId;return e.setAttribute("data-taskid",`empty-${t}`),e.setAttribute(Xt,i),e.style.height=`${n}px`,nt.forEach((({key:t})=>{const o=g(this.chartContext,{className:Pt.tasksDataCell.slice(1),content:""});o.setAttribute("data-columnid",t),o.setAttribute(Xt,i),o.style.height=`${n}px`,o.style.color="var(--text-color)",e.appendChild(o)})),e}}const Gt="\n .gantt-dialog-container {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: none;\n z-index: 999;\n overflow: hidden;\n }\n\n .gantt-dialog-container .dialog-overlay {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n }\n\n .gantt-dialog-container .gantt-dialog {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background: var(--dialog-bg-color, white);\n border-radius: 4px;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);\n border: 1px solid var(--dialog-border-color, #eee);\n z-index: 1000;\n min-width: 300px;\n max-width: 90%;\n max-height: 90%;\n display: flex;\n flex-direction: column;\n }\n\n .gantt-dialog .dialog-header {\n padding: 12px 16px;\n border-bottom: 1px solid var(--dialog-border-color, #eee);\n display: flex;\n justify-content: space-between;\n align-items: center;\n background: var(--header-bg-color, #f3f3f3);\n flex-shrink: 0;\n }\n\n .gantt-dialog .dialog-title {\n font-weight: 600;\n font-size: 16px;\n color: var(--header-text-color, #333);\n margin: 0;\n }\n\n .gantt-dialog .dialog-close {\n background: none;\n border: none;\n font-size: 20px;\n cursor: pointer;\n padding: 0;\n color: var(--text-color, #666);\n transition: color 0.2s;\n line-height: 1;\n }\n\n .gantt-dialog .dialog-close:hover {\n color: var(--text-color, #333);\n }\n\n .gantt-dialog .dialog-content {\n padding: 16px;\n overflow-y: auto;\n overflow-x: hidden;\n flex: 1;\n background: var(--dialog-bg-color, white);\n color: var(--text-color, #333);\n }\n\n .gantt-dialog .dialog-content::-webkit-scrollbar {\n width: 8px;\n }\n\n .gantt-dialog .dialog-content::-webkit-scrollbar-track {\n background: var(--dialog-bg-color, #f1f1f1);\n }\n\n .gantt-dialog .dialog-content::-webkit-scrollbar-thumb {\n background: var(--border-color, #888);\n border-radius: 4px;\n }\n\n .gantt-dialog .dialog-content::-webkit-scrollbar-thumb:hover {\n background: var(--text-color, #555);\n }\n\n .gantt-dialog-container.show {\n display: block;\n }\n\n .gantt-dialog-container.animate .dialog-overlay {\n animation: fadeIn 0.2s ease-out;\n }\n\n .gantt-dialog-container.animate .gantt-dialog {\n animation: slideIn 0.3s ease-out;\n }\n\n @keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n\n @keyframes slideIn {\n from {\n opacity: 0;\n transform: translate(-50%, -48%);\n }\n to {\n opacity: 1;\n transform: translate(-50%, -50%);\n }\n }\n\n .gantt-container {\n position: relative;\n }\n",Qt="\n .dropdown {\n position: relative;\n display: inline-block;\n }\n\n .dropdown .gantt-action-button {\n border-radius: 4px;\n }\n\n .dropdown.show .gantt-action-button {\n background: var(--toolbar-hover-bg-color, #f8f9fa);\n border-color: var(--button-bg-color, #0066cc);\n }\n \n .dropdown-btn {\n padding: 8px 16px;\n background-color: var(--toolbar-bg-color, #fff);\n color: var(--text-color, rgba(0, 0, 0, 0.7));\n border: 1px solid var(--toolbar-border-color, #ddd);\n cursor: pointer;\n font-weight: bold;\n border-radius: 2px;\n font-family: inherit;\n font-size: inherit;\n line-height: 1.5;\n transition: background-color 0.2s ease, border-color 0.2s ease;\n }\n \n .dropdown-btn:hover {\n background-color: var(--toolbar-hover-bg-color, #f8f9fa);\n border-color: var(--toolbar-border-color, #bbb);\n }\n \n .dropdown-btn:focus {\n outline: none;\n border-color: var(--button-bg-color, #0066cc);\n box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);\n }\n \n .dropdown-content {\n display: none;\n position: absolute;\n background-color: var(--dialog-bg-color, #fff);\n min-width: 160px;\n box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);\n z-index: 1000;\n border-radius: 4px;\n right: 0;\n top: calc(100% + 4px);\n border: 1px solid var(--dialog-border-color, #D9D9D9);\n overflow: hidden;\n }\n \n .dropdown-content a {\n color: var(--text-color, #333);\n padding: 10px 14px;\n text-decoration: none;\n display: block;\n font-family: inherit;\n font-size: 13px;\n line-height: 1.4;\n transition: background-color 0.2s ease;\n cursor: pointer;\n }\n \n .dropdown-content a:hover {\n background-color: var(--toolbar-hover-bg-color, #f1f1f1);\n }\n \n .dropdown-content a:focus {\n background-color: var(--button-hover-bg-color, #e6f3ff);\n outline: none;\n }\n \n .dropdown.show .dropdown-content {\n display: block;\n animation: dropdownSlideDown 0.2s ease-out;\n }\n \n @keyframes dropdownSlideDown {\n from {\n opacity: 0;\n transform: translateY(-5px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n \n /* Shadow DOM specific adjustments */\n :host .dropdown {\n position: relative;\n display: inline-block;\n }\n",Zt='\n * {\n box-sizing: border-box;\n }\n\n .gantt-container * {\n user-select: none;\n }\n\n .gantt-actions-container {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 6px 10px;\n flex: 0 0 36px;\n min-height: 36px;\n max-height: 36px;\n background-color: var(--background-color, #FFFFFF);\n border-bottom: 1px solid var(--border-color, #DFE0E1);\n }\n\n .gantt-actions-spacer {\n flex: 1;\n min-width: 8px;\n }\n\n .gantt-action-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n padding: 0;\n border: 0;\n border-radius: 4px;\n background: var(--toolbar-bg-color, #fff);\n color: var(--text-color, #333);\n cursor: pointer;\n transition: all 0.15s ease;\n flex-shrink: 0;\n }\n\n .gantt-action-button:hover:not(:disabled) {\n background: var(--toolbar-hover-bg-color, #f8f9fa);\n border-color: var(--toolbar-border-color, #999);\n transform: translateY(-1px);\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);\n }\n\n .gantt-action-button:active:not(:disabled) {\n transform: translateY(0);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);\n }\n\n .gantt-action-button:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n background: var(--toolbar-bg-color, #fafafa);\n }\n\n .gantt-action-button svg {\n width: 16px;\n height: 16px;\n stroke: currentColor;\n flex-shrink: 0;\n }\n\n .gantt-action-separator {\n width: 1px;\n height: 20px;\n background-color: var(--border-color, #DFE0E1);\n margin: 0 4px;\n flex-shrink: 0;\n }\n\n .gantt-view-mode-display {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 4px 10px;\n height: 28px;\n font-size: 13px;\n color: var(--text-color, #666);\n background: var(--toolbar-bg-color, #f8f9fa);\n border-radius: 4px;\n margin-left: 4px;\n font-weight: 500;\n white-space: nowrap;\n flex-shrink: 0;\n }\n\n .gantt-view-mode-display svg {\n width: 14px;\n height: 14px;\n flex-shrink: 0;\n }\n \n .gantt-container {\n display: flex;\n flex: 1 1 auto;\n min-height: 0;\n min-width: 0;\n border: 1px solid var(--border-color, #DFE0E1);\n border-top: none;\n position: relative;\n background-color: var(--background-color, #FFFFFF);\n overflow: hidden;\n height: 100%;\n box-sizing: border-box;\n }\n \n .gantt-button {\n border: 1px solid var(--toolbar-border-color, #D9D9D9);\n border-radius: 2px;\n background: var(--toolbar-bg-color, #fff);\n padding: 4px 12px;\n color: var(--text-color, rgba(0, 0, 0, 0.7));\n line-height: 20px;\n font-weight: bold;\n cursor: pointer;\n transition: background-color 0.2s ease;\n }\n\n .gantt-button:hover {\n background: var(--toolbar-hover-bg-color, #f8f9fa);\n }\n \n .gantt-button:disabled {\n color: rgba(128, 128, 128, 0.5);\n opacity: 0.6;\n }\n\n /* ── WCAG 2.1 AA: focus styles ─────────────────────────────────────────── */\n\n .tasks-data-row:focus-visible {\n outline: 2px solid var(--focus-ring-color, #005fcc);\n outline-offset: -2px;\n }\n\n .bar-timeline:focus {\n outline: 2px solid var(--focus-ring-color, #005fcc);\n outline-offset: 2px;\n }\n\n .tasks-data-row[aria-selected="true"] {\n background-color: var(--row-selected-bg-color, rgba(0, 95, 204, 0.12));\n }\n\n /* ── prefers-reduced-motion ─────────────────────────────────────────────── */\n\n @media (prefers-reduced-motion: reduce) {\n .bar-timeline,\n .bar-timeline-progress,\n .bar-handle,\n .gantt-action-button,\n .gantt-button,\n .tasks-data-row,\n .gantt-dialog-container,\n .gantt-dialog {\n transition: none !important;\n animation: none !important;\n }\n }\n\n /* JS-detected reduced motion class (mirrors the media query in JS context) */\n .gantt-reduced-motion .bar-timeline,\n .gantt-reduced-motion .bar-timeline-progress,\n .gantt-reduced-motion .bar-handle,\n .gantt-reduced-motion .gantt-action-button,\n .gantt-reduced-motion .gantt-button,\n .gantt-reduced-motion .tasks-data-row,\n .gantt-reduced-motion .gantt-dialog-container,\n .gantt-reduced-motion .gantt-dialog {\n transition: none !important;\n animation: none !important;\n }\n',Jt="\n .gantt-container ::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n }\n\n .gantt-container ::-webkit-scrollbar-track {\n background: var(--scrollbar-track-color, #F5F5F5);\n border-radius: 4px;\n }\n\n .gantt-container ::-webkit-scrollbar-thumb {\n background: var(--scrollbar-thumb-color, #C1C1C1);\n border-radius: 4px;\n border: 2px solid var(--scrollbar-track-color, #F5F5F5);\n }\n\n .gantt-container ::-webkit-scrollbar-thumb:hover {\n background: var(--scrollbar-thumb-hover-color, #A8A8A8);\n }\n\n .gantt-container * {\n scrollbar-width: thin;\n scrollbar-color: var(--scrollbar-thumb-color, #C1C1C1) var(--scrollbar-track-color, #F5F5F5);\n }\n\n /* Shadow DOM support */\n :host .gantt-container ::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n }\n\n :host .gantt-container ::-webkit-scrollbar-track {\n background: var(--scrollbar-track-color, #F5F5F5);\n border-radius: 4px;\n }\n\n :host .gantt-container ::-webkit-scrollbar-thumb {\n background: var(--scrollbar-thumb-color, #C1C1C1);\n border-radius: 4px;\n border: 2px solid var(--scrollbar-track-color, #F5F5F5);\n }\n\n :host .gantt-container ::-webkit-scrollbar-thumb:hover {\n background: var(--scrollbar-thumb-hover-color, #A8A8A8);\n }\n\n :host .gantt-container * {\n scrollbar-width: thin;\n scrollbar-color: var(--scrollbar-thumb-color, #C1C1C1) var(--scrollbar-track-color, #F5F5F5);\n }\n",te='\n\n .task-form {\n overflow: visible;\n }\n\n .task-form .form-group {\n margin-bottom: 18px;\n position: relative;\n }\n\n /* extra padding to last form group for breathing room */\n .task-form .form-group:last-of-type {\n margin-bottom: 24px;\n }\n\n .task-form label {\n display: block;\n margin-bottom: 5px;\n font-weight: 500;\n color: var(--text-color, #333);\n }\n\n .task-form input {\n width: 100%;\n padding: 8px;\n border: 1px solid var(--dialog-border-color, #ddd);\n border-radius: 4px;\n font-size: 14px;\n background-color: var(--dialog-bg-color, #fff);\n color: var(--text-color, #333);\n }\n\n .task-form input:focus {\n outline: none;\n border-color: var(--button-bg-color, #0066cc);\n }\n\n .task-form .grid {\n display: flex;\n justify-content: space-between;\n gap: 12px;\n }\n\n .task-form .grid .form-group {\n flex: 1;\n }\n\n .task-form .form-actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n margin-top: 24px;\n padding-top: 16px;\n border-top: 1px solid var(--dialog-border-color, #eee);\n position: sticky;\n bottom: -16px;\n background: var(--dialog-bg-color, white);\n margin-left: -16px;\n margin-right: -16px;\n margin-bottom: -16px;\n padding-left: 16px;\n padding-right: 16px;\n padding-bottom: 16px;\n }\n\n .task-form .btn-primary {\n background: var(--button-bg-color, #0066cc);\n color: var(--button-text-color, white);\n border: none;\n padding: 8px 16px;\n border-radius: 4px;\n cursor: pointer;\n font-weight: 500;\n }\n\n .task-form .btn-primary:hover {\n background: var(--button-hover-bg-color, #0052a3);\n }\n\n .task-form .btn-disabled,\n .task-form .btn-disabled:hover {\n background: #99c2ff;\n cursor: not-allowed;\n opacity: 0.7;\n }\n\n .task-form .form-error {\n position: absolute;\n bottom: -15px;\n left: 0;\n color: #dc3545;\n font-size: 12px;\n margin-top: 4px;\n line-height: 1.2;\n transition: opacity 0.2s ease;\n }\n\n .task-form .invalid {\n border-color: #dc3545;\n }\n\n .task-form .invalid:focus {\n border-color: #dc3545;\n box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);\n }\n\n .color-picker-wrapper {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .color-picker-wrapper input[type="color"] {\n -webkit-appearance: none;\n width: 32px;\n height: 32px;\n padding: 0;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n }\n\n .color-picker-wrapper input[type="color"]::-webkit-color-swatch-wrapper {\n padding: 0;\n }\n\n .color-picker-wrapper input[type="color"]::-webkit-color-swatch {\n border: 1px solid var(--dialog-border-color, #ddd);\n border-radius: 4px;\n }\n\n .color-picker-wrapper .color-preview {\n font-size: 12px;\n color: var(--text-color, #666);\n }\n',ee="\n .tasks-container {\n height: 100%;\n position: relative;\n display: flex;\n flex-direction: column;\n overflow-x: visible;\n overflow-y: visible;\n }\n\n .tasks-header {\n flex-shrink: 0;\n position: sticky;\n top: 0;\n z-index: 10;\n background-color: var(--header-bg-color, #F3F3F3);\n overflow: hidden;\n }\n\n .tasks-header-row {\n display: grid;\n width: 100%;\n }\n\n .tasks-header-cell {\n padding: 0 10px;\n text-align: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: flex;\n align-items: center;\n border: var(--cell-border-width, 1px) solid var(--cell-border-color, #eff0f0);\n color: var(--text-color, #000);\n box-sizing: border-box;\n font-weight: 600;\n }\n\n .tasks-body-wrapper {\n flex: 1;\n overflow: visible;\n position: relative;\n }\n\n .tasks-data-container {\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n\n .tasks-data-row {\n display: grid;\n width: 100%;\n border-bottom: var(--cell-border-width, 1px) solid var(--cell-border-color, #eff0f0);\n box-sizing: border-box;\n }\n\n .tasks-data-cell {\n padding: 0 10px;\n text-align: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: flex;\n align-items: center;\n border-left: var(--cell-border-width, 1px) solid var(--cell-border-color, #eff0f0);\n border-right: var(--cell-border-width, 1px) solid var(--cell-border-color, #eff0f0);\n color: var(--text-color, #000);\n box-sizing: border-box;\n }\n\n .tasks-data-row .tasks-data-cell:first-child {\n border-left: none;\n }\n\n .tasks-data-row .tasks-data-cell:last-child {\n border-right: none;\n }\n\n .tasks-data-row .task-toggle-icon,\n .tasks-data-row .task-toggle-icon-blank {\n display: inline-block;\n margin-right: 5px;\n width: 10px;\n height: 10px;\n vertical-align: middle;\n flex-shrink: 0;\n }\n\n .tasks-data-row .task-toggle-icon {\n cursor: pointer;\n position: relative;\n }\n\n /* Chevron (expanded) - pointing down */\n .tasks-data-row .task-toggle-icon.expanded::before {\n content: '';\n position: absolute;\n width: 6px;\n height: 6px;\n border-right: 2px solid var(--text-color, #000000);\n border-bottom: 2px solid var(--text-color, #000000);\n transform: rotate(45deg);\n top: 0;\n left: 2px;\n }\n\n /* Chevron - pointing right (collapsed) */\n .tasks-data-row .task-toggle-icon.collapsed::before {\n content: '';\n position: absolute;\n width: 6px;\n height: 6px;\n border-right: 2px solid var(--text-color, #000000);\n border-bottom: 2px solid var(--text-color, #000000);\n transform: rotate(-45deg);\n top: 2px;\n left: 0;\n }\n\n .tasks-data-row .task-toggle-icon:hover::before {\n opacity: 0.7;\n }\n\n /* Shadow DOM specific */\n :host .tasks-container {\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n :host .tasks-header {\n position: sticky;\n top: 0;\n z-index: 10;\n }\n",ne="\n .gantt-container .timeline-container {\n width: 100%;\n height: 100%;\n position: relative;\n background-color: var(--background-color, #FFFFFF);\n display: flex;\n flex-direction: column;\n overflow: visible;\n padding-bottom: 0;\n box-sizing: border-box;\n }\n\n .timeline-container .timeline-header {\n position: sticky;\n top: 0;\n z-index: 100;\n background-color: var(--header-bg-color, #F3F3F3);\n flex-shrink: 0;\n overflow-x: auto;\n overflow-y: hidden;\n width: 100%;\n scrollbar-width: none; \n -ms-overflow-style: none; \n }\n\n .timeline-container .timeline-header::-webkit-scrollbar {\n display: none;\n height: 0;\n width: 0;\n }\n\n /* Shadow DOM specific */\n :host .timeline-container .timeline-header {\n scrollbar-width: none !important;\n -ms-overflow-style: none !important;\n }\n\n :host .timeline-container .timeline-header::-webkit-scrollbar {\n display: none !important;\n height: 0 !important;\n width: 0 !important;\n }\n\n .timeline-container .timeline-header > .timeline-header-row {\n width: max-content;\n position: relative;\n }\n\n .timeline-container .timeline-body-wrapper {\n flex: 1;\n overflow-x: auto;\n overflow-y: hidden;\n position: relative;\n width: 100%;\n min-height: 0;\n scrollbar-width: none;\n -ms-overflow-style: none;\n padding-bottom: 0; \n margin-bottom: 0;\n }\n\n .timeline-body-wrapper .timeline-horizontal-scroll, .timeline-container .timeline-body-wrapper::-webkit-scrollbar {\n display: none;\n height: 0;\n width: 0;\n }\n\n /* shadow DOM specific */\n :host .timeline-container .timeline-body-wrapper {\n scrollbar-width: none !important;\n -ms-overflow-style: none !important;\n }\n\n :host .timeline-container .timeline-body-wrapper::-webkit-scrollbar {\n display: none !important;\n height: 0 !important;\n width: 0 !important;\n }\n\n\n .timeline-horizontal-scroll {\n position: absolute;\n bottom: 0;\n height: 17px;\n overflow-x: auto;\n overflow-y: hidden;\n z-index: 300;\n background-color: var(--split-bar-color, var(--background-color, #FFFFFF));\n border-top: 1px solid var(--border-color, #DFE0E1);\n box-sizing: border-box;\n display: block;\n visibility: visible;\n opacity: 1;\n pointer-events: auto;\n }\n\n .timeline-horizontal-scroll-content {\n height: 1px;\n width: max-content;\n }\n\n .timeline-container .annotation,\n .timeline-container .annotation-container {\n position: absolute;\n top: 0;\n left: 0;\n pointer-events: none;\n }\n\n .timeline-container .annotation-container > * {\n pointer-events: auto;\n }\n\n .timeline-container .bar-container {\n position: absolute;\n top: 0;\n left: 0;\n pointer-events: none;\n }\n\n .timeline-container .bar-container > * {\n pointer-events: auto;\n }\n\n .timeline-container .bar-timeline {\n position: absolute;\n cursor: move;\n cursor: grab;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .timeline-container .bar-timeline .bar-handle {\n height: 100%;\n width: 5px;\n position: absolute;\n z-index: 1000;\n background: transparent;\n }\n\n .timeline-container .bar-timeline .bar-handle:hover {\n cursor: col-resize;\n }\n\n .resizing {\n pointer-events: none;\n opacity: 0.8;\n }\n\n .timeline-container .bar-timeline .bar-handle.handle-left {\n left: -5px;\n }\n\n .timeline-container .bar-timeline .bar-handle.handle-right {\n right: -5px;\n }\n\n .timeline-container .bar-timeline.dragging {\n cursor: grabbing;\n }\n\n .timeline-container .bar-baseline {\n position: absolute;\n pointer-events: none;\n z-index: 1;\n }\n\n .timeline-container .bar-timeline.bar-critical {\n background-color: var(--critical-bar-color, #e53935) !important;\n }\n\n .timeline-container .bar-timeline.bar-critical .bar-timeline-progress {\n background-color: color-mix(in srgb, var(--critical-bar-color, #e53935) 70%, white) !important;\n }\n\n svg path.critical-arrow {\n stroke: var(--critical-arrow-color, #e53935) !important;\n stroke-width: 2.5 !important;\n }\n\n .bar-timeline .bar-timeline-progress {\n position: absolute;\n pointer-events: none;\n height: 100%;\n left: 0;\n }\n\n .bar-timeline .bar-label {\n white-space: nowrap;\n pointer-events: none;\n overflow: hidden;\n z-index: 2;\n }\n\n .timeline-container .timeline-body {\n width: max-content;\n position: relative;\n padding-bottom: 17px;\n }\n \n .timeline-container .timeline-header-row,\n .timeline-container .timeline-data-row {\n display: flex;\n }\n\n .timeline-container .timeline-header-cell,\n .timeline-container .timeline-data-cell {\n padding: 0 10px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: flex;\n align-items: center;\n justify-content: center;\n border: var(--cell-border-width, 1px) solid var(--cell-border-color, #eff0f0);\n color: var(--text-color, #000);\n }\n\n .timeline-container .timeline-header-cell {\n background-color: var(--header-bg-color, #F3F3F3);\n color: var(--header-text-color, #333);\n }\n",ie='\n #apexgantt-tooltip-container,\n [role="tooltip"] {\n position: absolute;\n z-index: 1000;\n pointer-events: none;\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.2s ease;\n font-family: inherit;\n font-size: 13px;\n line-height: 1.4;\n display: none;\n width: 300px !important;\n max-width: 300px !important;\n box-sizing: border-box;\n }\n \n #apexgantt-tooltip-container.visible,\n [role="tooltip"].visible {\n display: block;\n opacity: 1;\n visibility: visible;\n }\n \n #apexgantt-tooltip-container .tooltip-content,\n [role="tooltip"] .tooltip-content {\n padding: 12px 16px;\n border-radius: 6px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);\n width: 100%;\n word-wrap: break-word;\n overflow-wrap: break-word;\n box-sizing: border-box;\n display: block;\n border: 1px solid rgba(255, 255, 255, 0.1);\n }\n \n /* Shadow DOM specific adjustments */\n :host #apexgantt-tooltip-container,\n :host [role="tooltip"] {\n position: absolute;\n z-index: 1000;\n pointer-events: none;\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.2s ease;\n font-family: inherit;\n font-size: 13px;\n line-height: 1.4;\n display: none;\n width: 300px !important;\n max-width: 300px !important;\n box-sizing: border-box;\n }\n \n :host #apexgantt-tooltip-container.visible,\n :host [role="tooltip"].visible {\n display: block;\n opacity: 1;\n visibility: visible;\n }\n\n #apexgantt-tooltip-container .tooltip-content div,\n [role="tooltip"] .tooltip-content div {\n margin: 6px 0;\n word-break: break-word;\n line-height: 1.4;\n }\n \n #apexgantt-tooltip-container .tooltip-content strong,\n [role="tooltip"] .tooltip-content strong {\n font-weight: 600;\n display: inline;\n margin-right: 8px;\n }\n \n #apexgantt-tooltip-container .tooltip-content span,\n [role="tooltip"] .tooltip-content span {\n display: inline;\n }\n \n /* First item (Name) styling */\n #apexgantt-tooltip-container .tooltip-content div:first-child,\n [role="tooltip"] .tooltip-content div:first-child {\n margin-bottom: 10px;\n padding-bottom: 8px;\n border-bottom: 1px solid rgba(255, 255, 255, 0.2);\n }\n \n #apexgantt-tooltip-container .tooltip-content div:first-child strong,\n [role="tooltip"] .tooltip-content div:first-child strong {\n font-weight: 700;\n }\n \n #apexgantt-tooltip-container .tooltip-content div:last-child,\n [role="tooltip"] .tooltip-content div:last-child {\n margin-bottom: 0;\n }\n';class oe{constructor(t,e,n,i,o,r){this.element=t,this.domCache=e,this.options=n,this.chartContext=i,this.isShadowDOM=o,this.instanceId=r,this.stylesInjected=!1}setupShadowDOMEnvironment(){if(!this.isShadowDOM)return;const t=this.chartContext.getContext().host;t&&(t.style.display="block",t.style.boxSizing="border-box",t.style.contain="layout style"),this.element&&(this.element.style.display="block",this.element.style.boxSizing="border-box")}injectGanttStyles(){if(!this.stylesInjected)if(this.isShadowDOM)this.injectStylesDirectly();else try{const t=[{content:Zt,id:"gantt-core-styles",options:{priority:"high"}},{content:ne,id:"gantt-timeline-styles"},{content:ee,id:"gantt-table-styles"},{content:Gt,id:"gantt-dialog-styles"},{content:te,id:"gantt-taskform-styles"},{content:ie,id:"gantt-tooltip-styles"},{content:a,id:"gantt-toolbar-styles"},{content:Qt,id:"gantt-dropdown-styles"},{content:Jt,id:"gantt-scrollbar-styles"}];this.chartContext.injectStylesheets(t),this.stylesInjected=!0}catch(t){R.error("injectGanttStyles: ChartContext injection failed",t)}}injectStylesDirectly(){const t=this.chartContext.getContext();if(t.querySelector("#gantt-all-styles"))return void(this.stylesInjected=!0);const e=document.createElement("style");e.id="gantt-all-styles",e.textContent=`\n /* Shadow DOM CSS Reset - Critical for proper layout */\n :host {\n all: initial;\n display: block;\n contain: layout style;\n }\n\n *, *::before, *::after {\n box-sizing: border-box;\n }\n\n div, table, thead, tbody, tr, td, th {\n display: revert;\n margin: 0;\n padding: 0;\n border: 0;\n }\n\n .split-view-container,\n .gantt-container {\n display: flex !important;\n width: 100% !important;\n height: 100% !important;\n }\n\n .split-left-container,\n .split-right-container {\n display: block !important;\n }\n\n .timeline-container {\n flex: 1 !important;\n overflow: auto !important;\n position: relative !important;\n }\n\n .tasks-container {\n flex-shrink: 0 !important;\n overflow: auto !important;\n }\n\n ${Zt}\n ${ne}\n ${ee}\n ${Gt}\n ${te}\n ${ie}\n ${a}\n ${Qt}\n ${Jt}\n `,t.insertBefore(e,t.firstChild),this.stylesInjected=!0}setCSSVariables(){["--apex-gantt-bar-fill","--apex-gantt-background-color","--apex-gantt-row-bg-even","--apex-gantt-row-bg-odd","--apex-gantt-header-bg","--apex-gantt-grid-line","--apex-gantt-dependency-line","--apex-gantt-font-family","--apex-gantt-font-size","--apex-gantt-font-color"].forEach((t=>this.element.style.removeProperty(t)));const t=Bt(this.element),e=t.gridLine||this.options.cellBorderColor,n=this.options.cellBorderWidth,i=t.fontColor||this.options.fontColor,o=t.headerBg||this.options.headerBackground,{tooltipBGColor:r,tooltipBorderColor:a,borderColor:s,barTextColor:l}=this.options,c=t.bgColor||this.options.backgroundColor,d=t.barFill||this.options.barBackgroundColor,h=t.dependencyLine||this.options.arrowColor,p=[...this.options.rowBackgroundColors??[]];t.rowBgEven&&(p[0]=t.rowBgEven),t.rowBgOdd&&(p[1]=t.rowBgOdd),this.element.style.setProperty("--apex-gantt-row-bg-even",p[0]??""),this.element.style.setProperty("--apex-gantt-row-bg-odd",p[1]??p[0]??""),this.element.style.setProperty("--cell-border-color",e),this.element.style.setProperty("--cell-border-width",n),this.element.style.setProperty("--gantt-font-color",i),this.element.style.setProperty("--text-color",i),this.element.style.setProperty("--header-bg-color",o),this.element.style.setProperty("--header-text-color",i),this.element.style.setProperty("--tooltip-bg-color",r),this.element.style.setProperty("--tooltip-border-color",a),this.element.style.setProperty("--tooltip-text-color",i),this.element.style.setProperty("--background-color",c),this.element.style.setProperty("--border-color",s),this.element.style.setProperty("--dialog-bg-color",c),this.element.style.setProperty("--dialog-border-color",s),this.element.style.setProperty("--button-bg-color",d),this.element.style.setProperty("--button-text-color",l),this.element.style.setProperty("--button-hover-bg-color",h),this.element.style.setProperty("--toolbar-bg-color",c),this.element.style.setProperty("--toolbar-border-color",s),this.element.style.setProperty("--toolbar-hover-bg-color",e),this.element.style.setProperty("--scrollbar-track-color",c),this.element.style.setProperty("--scrollbar-thumb-color",s),this.element.style.setProperty("--scrollbar-thumb-hover-color",e),this.element.style.setProperty("--split-bar-color",e),this.element.style.setProperty("--split-bar-hover-color",h),this.element.style.setProperty("--split-bar-border-color",s),this.element.style.setProperty("--split-bar-handle-color",i),this.element.style.setProperty("--split-bar-hover-border-color",h),this.element.style.setProperty("--critical-bar-color",this.options.criticalBarColor),this.element.style.setProperty("--critical-arrow-color",this.options.criticalArrowColor);this.isColorDark(c)?this.element.style.setProperty("--toolbar-icon-filter","invert(1) brightness(2)"):this.element.style.setProperty("--toolbar-icon-filter","none")}handleWatermark(){const t=this.domCache.ganttContainer;if(!t)return;const e=t.parentNode;e&&(r.isLicenseValid()?l.remove(e):l.add(e))}isColorDark(t){const e=t.replace("#","");return(.299*parseInt(e.substring(0,2),16)+.587*parseInt(e.substring(2,4),16)+.114*parseInt(e.substring(4,6),16))/255<.5}cleanupScrollbarStyles(){try{this.chartContext.getInjectedStyleIds().filter((t=>t.startsWith(`scrollbar-${this.instanceId}`))).forEach((t=>this.chartContext.removeStyles(t)));const t=this.domCache.horizontalScroll;if(t){const e=t.style.width,n=t.style.left,i=t.style.bottom;t.removeAttribute("style"),e&&(t.style.width=e),n&&(t.style.left=n),i&&(t.style.bottom=i)}}catch(t){R.warn("Error cleaning up scrollbar styles:",t)}}updateOptions(t){this.options=t}resetStylesInjected(){this.stylesInjected=!1}areStylesInjected(){return this.stylesInjected}}const re="data-taskid",ae="aria-level";class se{constructor(t,e,n,i){this.chartContext=t,this.dataManager=e,this.getTaskContainer=n,this.reRender=i,this.keydownHandler=null}attach(){this.detach();const t=this.getTaskContainer();t&&(this.initRovingTabindex(t),this.keydownHandler=e=>this.handleKeydown(e,t),t.addEventListener("keydown",this.keydownHandler))}detach(){const t=this.getTaskContainer();t&&this.keydownHandler&&t.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=null}initRovingTabindex(t){this.getVisibleRows(t).forEach(((t,e)=>{t.setAttribute("tabindex",0===e?"0":"-1")}))}getVisibleRows(t){return Array.from(t.querySelectorAll(`${Pt.tasksDataRow}:not(${Pt.tasksEmptyRow})`))}moveFocusToRow(t,e){this.getVisibleRows(e).forEach((t=>t.setAttribute("tabindex","-1"))),t.setAttribute("tabindex","0"),t.focus()}handleKeydown(t,e){const n=this.getVisibleRows(e);if(0===n.length)return;const i=this.chartContext.getActiveElement(),o=i?n.indexOf(i):-1;switch(t.key){case"ArrowDown":{t.preventDefault();const i=n[Math.min(o+1,n.length-1)];i&&this.moveFocusToRow(i,e);break}case"ArrowUp":{t.preventDefault();const i=n[Math.max(o-1,0)];i&&this.moveFocusToRow(i,e);break}case"ArrowRight":{if(t.preventDefault(),o<0||!i)break;const r=i.getAttribute(re);if(!r)break;const a=i.getAttribute("aria-expanded");if("false"===a)this.dataManager.toggleTask(r),this.reRender();else if("true"===a){const t=parseInt(i.getAttribute(ae)||"1",10),r=n[o+1];if(r){parseInt(r.getAttribute(ae)||"1",10)>t&&this.moveFocusToRow(r,e)}}break}case"ArrowLeft":{if(t.preventDefault(),o<0||!i)break;const r=i.getAttribute(re);if(!r)break;if("true"===i.getAttribute("aria-expanded"))this.dataManager.toggleTask(r),this.reRender();else{const t=parseInt(i.getAttribute(ae)||"1",10);if(t<=1)break;for(let i=o-1;i>=0;i--){const o=n[i];if(parseInt(o.getAttribute(ae)||"1",10)<t){this.moveFocusToRow(o,e);break}}}break}case"Home":{t.preventDefault();const i=n[0];i&&this.moveFocusToRow(i,e);break}case"End":{t.preventDefault();const i=n[n.length-1];i&&this.moveFocusToRow(i,e);break}case" ":{if(t.preventDefault(),!i)break;const e="true"===i.getAttribute("aria-selected");i.setAttribute("aria-selected",e?"false":"true");break}case"Enter":{if(t.preventDefault(),!i)break;const e=i.getAttribute(re);if(!e)break;const n=this.chartContext.querySelector(`[data-taskid="${CSS.escape(e)}"].bar-timeline`);n&&n.dispatchEvent(new MouseEvent("dblclick",{bubbles:!0}));break}case"Escape":i&&i.blur()}}}class le{constructor(t){this._scrollTop=0,this._rowHeight=Math.max(1,t.rowHeight),this._overscan=Math.max(0,t.overscan??5),this._totalRows=Math.max(0,t.totalRows),this._containerHeight=Math.max(0,t.containerHeight)}getVisibleRange(){if(0===this._totalRows)return{startIndex:0,endIndex:-1};const t=Math.floor(this._scrollTop/this._rowHeight),e=Math.max(0,t-this._overscan),n=Math.ceil(this._containerHeight/this._rowHeight);return{startIndex:e,endIndex:Math.min(this._totalRows-1,t+n-1+this._overscan)}}getTotalHeight(){return this._totalRows*this._rowHeight}getOffsetForIndex(t){return t*this._rowHeight}getTopSpacerHeight(){const{startIndex:t}=this.getVisibleRange();return t*this._rowHeight}getBottomSpacerHeight(){if(0===this._totalRows)return 0;const{endIndex:t}=this.getVisibleRange();return Math.max(0,(this._totalRows-1-t)*this._rowHeight)}getVisibleCount(){const{startIndex:t,endIndex:e}=this.getVisibleRange();return e<t?0:e-t+1}setScrollTop(t){this._scrollTop=Math.max(0,t)}setTotalRows(t){this._totalRows=Math.max(0,t)}setContainerHeight(t){this._containerHeight=Math.max(0,t)}setOverscan(t){this._overscan=Math.max(0,t)}get scrollTop(){return this._scrollTop}get totalRows(){return this._totalRows}get containerHeight(){return this._containerHeight}get rowHeight(){return this._rowHeight}get overscan(){return this._overscan}}const ce="virtualizer-top-spacer",de="virtualizer-bottom-spacer",he=`.${ce}`,pe=`.${de}`,ue="data-taskid";class me{constructor(t,e,n,i,o,r,a=(()=>{})){this.domRefs=t,this.options=e,this.chartContext=n,this.dataManager=i,this.getViewMode=o,this.onAfterUpdate=r,this.onToggle=a,this.cachedVisibleTasks=[],this.lastVisibleRange=null,this.virtualScrollRAF=null,this.verticalScrollHandler=null,this._isActive=!1,this.renderedTaskIds=new Set,this.virtualizer=new le({rowHeight:e.rowHeight,totalRows:0,containerHeight:0})}get isActive(){return this._isActive}getRenderedTaskIds(){return this.renderedTaskIds}initialise(t){this.cachedVisibleTasks=t;const{rowHeight:e,height:n}=this.options,i="number"==typeof n?Math.max(n-100,200):600,o=Math.ceil(i/e);if(this.virtualizer=new le({rowHeight:e,totalRows:t.length,containerHeight:i,overscan:o}),t.length<=50)return void(this._isActive=!1);this._isActive=!0;const r=this.virtualizer.getVisibleRange();return this.lastVisibleRange=r,this.renderedTaskIds=new Set(t.slice(r.startIndex,r.endIndex+1).map((t=>t.id))),{allTasks:t,range:r,rowHeight:e}}attach(){const{verticalScrollContainer:t}=this.domRefs;if(!t||!this._isActive)return;const e=t.clientHeight;e>0&&(this.virtualizer.setContainerHeight(e),this.virtualizer.setOverscan(Math.ceil(e/this.options.rowHeight))),this.detach(),this.verticalScrollHandler=()=>{const e=t.scrollTop;this.scheduleUpdate(e)},t.addEventListener("scroll",this.verticalScrollHandler,{passive:!0})}detach(){const{verticalScrollContainer:t}=this.domRefs;t&&this.verticalScrollHandler&&t.removeEventListener("scroll",this.verticalScrollHandler),this.verticalScrollHandler=null,null!==this.virtualScrollRAF&&"undefined"!=typeof cancelAnimationFrame&&(cancelAnimationFrame(this.virtualScrollRAF),this.virtualScrollRAF=null),this.lastVisibleRange=null}destroy(){this.detach(),this.cachedVisibleTasks=[],this.renderedTaskIds.clear(),this._isActive=!1}updateTotalRows(t){if(this.cachedVisibleTasks=t,!this._isActive)return;this.virtualizer.setTotalRows(t.length);const e=Math.max(0,t.length*this.virtualizer.rowHeight-this.virtualizer.containerHeight);if(this.virtualizer.scrollTop>e){this.virtualizer.setScrollTop(e);const{verticalScrollContainer:t}=this.domRefs;t&&(t.scrollTop=e)}const n=this.virtualizer.getVisibleRange();this.lastVisibleRange=n,this.applyUpdate(n)}expandAllForExport(){if(!this._isActive)return null;const t=this.cachedVisibleTasks,{rowHeight:e}=this.options,n={startIndex:0,endIndex:t.length-1},i=this.domRefs.tasksDataContainer;if(i){this.patchTasksPanel(t,n,e);const o=i.querySelector(he),r=i.querySelector(pe);o&&(o.style.height="0px"),r&&(r.style.height="0px")}const o=this.domRefs.timelineBody;if(o){this.patchTimelinePanel(t,n,e);const i=o.querySelector(he),r=o.querySelector(pe);i&&(i.style.height="0px"),r&&(r.style.height="0px")}this.patchBars(t,n,e);const r=this.lastVisibleRange;return r?{startIndex:r.startIndex,endIndex:r.endIndex}:null}restoreAfterExport(t){if(!this._isActive)return;const e=t??this.virtualizer.getVisibleRange();this.applyUpdate(e)}handleResize(){if(!this._isActive)return;const{verticalScrollContainer:t}=this.domRefs;t&&this.virtualizer.setContainerHeight(t.clientHeight);const e=this.virtualizer.getVisibleRange();this.lastVisibleRange&&e.startIndex===this.lastVisibleRange.startIndex&&e.endIndex===this.lastVisibleRange.endIndex||(this.lastVisibleRange=e,this.applyUpdate(e))}updateDomRefs(t){this.domRefs=t}scheduleUpdate(t){this.virtualizer.setScrollTop(t),this.cachedVisibleTasks.length<=50||(null!==this.virtualScrollRAF&&"undefined"!=typeof cancelAnimationFrame&&cancelAnimationFrame(this.virtualScrollRAF),"undefined"!=typeof requestAnimationFrame?this.virtualScrollRAF=requestAnimationFrame((()=>{this.virtualScrollRAF=null,this.applyIfChanged()})):this.applyIfChanged())}applyIfChanged(){const t=this.virtualizer.getVisibleRange();this.lastVisibleRange&&t.startIndex===this.lastVisibleRange.startIndex&&t.endIndex===this.lastVisibleRange.endIndex||(this.lastVisibleRange=t,this.applyUpdate(t))}applyUpdate(t){const e=this.cachedVisibleTasks,{rowHeight:n}=this.options;0!==e.length&&(this.patchTasksPanel(e,t,n),this.patchTimelinePanel(e,t,n),this.patchBars(e,t,n),this.onAfterUpdate())}patchTasksPanel(t,e,n){const i=this.domRefs.tasksDataContainer;if(!i)return;const{startIndex:o,endIndex:r}=e,a=t.slice(o,r+1),s=new Set(a.map((t=>t.id))),l=Array.from(i.querySelectorAll(`${Pt.tasksDataRow}:not(${Pt.tasksEmptyRow})`)),c=new Map;l.forEach((t=>{const e=t.getAttribute(ue);e&&c.set(e,t)}));const d=new ht(this.options,this.chartContext,this.dataManager);a.forEach(((t,e)=>{if(!c.has(t.id)){const n=o+e,r=d.generateRow(t,this.onToggle,n+1);i.appendChild(r)}})),c.forEach(((t,e)=>{s.has(e)||i.removeChild(t)})),this.updateSpacers(i,o,r,t.length,n);const h=Array.from(i.querySelectorAll(`${Pt.tasksDataRow}:not(${Pt.tasksEmptyRow})`)),p=new Map;t.forEach(((t,e)=>p.set(t.id,e))),h.sort(((t,e)=>{const n=t.getAttribute(ue)||"",i=e.getAttribute(ue)||"";return(p.get(n)??0)-(p.get(i)??0)}));const u=i.querySelector(pe)||null;h.forEach((t=>{i.insertBefore(t,u)})),h.forEach(((t,e)=>{t.setAttribute("aria-rowindex",(o+e+1).toString())})),this.renderedTaskIds=s}patchTimelinePanel(t,e,n){const i=this.domRefs.timelineBody;if(!i)return;const{startIndex:o,endIndex:r}=e,a=t.slice(o,r+1),s=new Set(a.map((t=>t.id))),l=Array.from(i.querySelectorAll(`${Pt.timelineDataRow}:not(${Pt.timelineEmptyRow})`)),c=new Map;l.forEach((t=>{const e=t.getAttribute(ue);e&&c.set(e,t)}));const d=this.getTimelineCellCount();if(0===d)return;const h=new Mt(this.getViewMode(),this.options,this.chartContext,this.dataManager);a.forEach((t=>{if(!c.has(t.id)){const e=h.generateRow(t.id,d);i.appendChild(e)}})),c.forEach(((t,e)=>{s.has(e)||i.removeChild(t)})),this.updateSpacers(i,o,r,t.length,n);const p=new Map;t.forEach(((t,e)=>p.set(t.id,e)));const u=Array.from(i.querySelectorAll(`${Pt.timelineDataRow}:not(${Pt.timelineEmptyRow})`));u.sort(((t,e)=>{const n=t.getAttribute(ue)||"",i=e.getAttribute(ue)||"";return(p.get(n)??0)-(p.get(i)??0)}));const m=i.querySelector(pe)||null;u.forEach((t=>{i.insertBefore(t,m)}))}patchBars(t,e,n){const i=this.domRefs.barContainer;if(!i)return;const{startIndex:o,endIndex:r}=e,a=this.dataManager.getDateRange(8,this.getViewMode()),s=t.length*n,l=t.slice(o,r+1),c=new Set(l.map((t=>t.id))),d=Array.from(i.querySelectorAll(`[${ue}]`)),h=new Map;d.forEach((t=>{const e=t.getAttribute(ue);e&&h.set(e,t)}));const p=this.chartContext.getChartContainer();l.forEach(((t,e)=>{if(!h.has(t.id)){const n=o+e,r=new J(t,a[0],this.options,this.getViewMode(),n,this.chartContext,this.dataManager),s=r.drawBar(((t,e)=>{st(this.chartContext,this.dataManager,t,e,this.options,this.getViewMode(),a[0])}));i.appendChild(s),p&&kt(s,0,p);const l=r.drawBaselineBar();l&&i.appendChild(l)}})),h.forEach(((t,e)=>{c.has(e)||i.removeChild(t)})),i.style.height=`${s}px`,i.style.width="100%"}updateSpacers(t,e,n,i,o){let r=t.querySelector(he);r||(r=this.chartContext.createElement("div"),r.className=ce,t.insertBefore(r,t.firstChild)),r.style.height=e*o+"px";let a=t.querySelector(pe);a||(a=this.chartContext.createElement("div"),a.className=de,t.appendChild(a));const s=Math.max(0,(i-1-n)*o);a.style.height=`${s}px`}getTimelineCellCount(){var t;const e=null==(t=this.domRefs.timelineBodyWrapper)?void 0:t.closest(".timeline-container");if(!e)return 0;const n=e.querySelectorAll(".timeline-header-row"),i=n[n.length-1];return i?i.querySelectorAll(".timeline-header-cell").length:0}}w.extend(S),w.extend(C),w.extend(F),w.extend(A),w.extend(D);const ge="dependency-arrow-update";class be extends n{constructor(t,e){super(t,"gantt_"+crypto.randomUUID().replace(/-/g,"").substring(0,9)),this.options=U,this.containerResizeObserver=null,this.lastKnownWidth=0,this.lastKnownHeight=0,this.resizeDebounceTimer=null,this.dependencyArrowHandler=null,this.rowHoverHandler=null,this.rowHoverLeaveHandler=null,this.criticalPathResult=null,this.domCache={ganttContainer:null,timelineContainer:null,timelineBody:null,timelineBodyWrapper:null,timelineHeader:null,horizontalScroll:null,horizontalScrollContent:null,tasksContainer:null,tasksBodyWrapper:null,tasksHeader:null,tasksDataContainer:null,splitBar:null,actionsContainer:null},this.keyboardNavigationManager=null,this.virtualScrollCoordinator=null,this.reducedMotionMQL=null,this.reducedMotionHandler=null;const n=_(null==e?void 0:e.theme);let i;(null==e?void 0:e.parsing)?Wt.validateConfig(e.parsing)?i=Wt.parse(e.series,e.parsing):(R.error("ApexGantt: Invalid parsing configuration provided"),i=[]):i=(null==e?void 0:e.series)||[],this.options={...n,...e,baseline:{...n.baseline,...null==e?void 0:e.baseline},series:i},this.viewMode=this.options.viewMode;const o="arrows_"+crypto.randomUUID().replace(/-/g,"").substring(0,9);this.arrowLink=new At(o),this.dataManager=new ut,this.dataManager.setTasks(this.options.series),this.dataManager.setArrowLinkInstanceId(o),this.stateManager=new Ot,this.styleManager=new oe(this.element,this.domCache,this.options,this.chartContext,this.isShadowDOM(),this.getInstanceId()),this.scrollManager=new Vt(this.element,this.options,this.domCache,this.chartContext,this.getInstanceId(),(()=>this.viewMode)),this.layoutManager=new Kt(this.element,this.options,this.domCache,this.chartContext,this.getInstanceId(),(()=>this.viewMode));const r={onViewModeChange:t=>{this.viewMode=t},onToolbarUpdate:()=>{const t=this.domCache.actionsContainer;t&&this.renderToolbar(t)},onTimelineRerender:()=>{this.rerenderTimeline()},onDependencyArrowsRender:()=>{this.renderDependencyArrows(),this.fadeArrowsAfterAnimation(),this.computeCriticalPath(),this.applyCriticalPathHighlighting()},onScrollbarUpdate:()=>{this.scrollManager.updateHorizontalScrollbarContent()},onScrollbarPosition:()=>{this.scrollManager.positionHorizontalScrollbar()}};this.zoomManager=new jt(this.element,this.domCache,this.chartContext,this.getInstanceId(),(()=>this.viewMode),r),this.styleManager.setupShadowDOMEnvironment(),this.keyboardNavigationManager=new se(this.chartContext,this.dataManager,(()=>this.domCache.tasksDataContainer),(()=>this.render())),this.setupReducedMotion()}static setLicense(t){r.setLicense(t)}setupReducedMotion(){if("undefined"==typeof window||!window.matchMedia)return;this.reducedMotionMQL=window.matchMedia("(prefers-reduced-motion: reduce)");const t=t=>{t?this.element.classList.add("gantt-reduced-motion"):this.element.classList.remove("gantt-reduced-motion")};t(this.reducedMotionMQL.matches),this.reducedMotionHandler=e=>t(e.matches),this.reducedMotionMQL.addEventListener("change",this.reducedMotionHandler)}initializeTooltip(){const{enableTooltip:t,tooltipId:e}=this.options;if(t){const t=p(this.chartContext,e);if(!this.chartContext.getElementById(e)){R.warn("Tooltip init: Tooltip not found after creation, appending manually");this.chartContext.getAppendContainer().appendChild(t)}}}render(t){var e;if(!this.element)throw new Error("Element not found");this.virtualScrollCoordinator&&this.virtualScrollCoordinator.detach();const n=this.element&&this.element.children.length>0;n&&this.stateManager.captureState(this.element,this.dataManager,this.viewMode);const{enableResize:i,tasksContainerWidth:o,height:r,width:a}=this.options,s=Bt(this.element),l=s.fontColor||this.options.fontColor,c=s.fontFamily||this.options.fontFamily,d=s.fontSize||this.options.fontSize,{fontWeight:h}=this.options;this.layoutManager.setupChartContainerPositioning(),this.styleManager.injectGanttStyles(),this.styleManager.setCSSVariables(),this.initializeTooltip();const p=new Set(Array.from(this.element.querySelectorAll(".bar-timeline[data-taskid]")).map((t=>t.getAttribute("data-taskid"))));this.element.innerHTML="";const u=this.normalizeDimension(r),m=this.normalizeDimension(a);this.element.style.width=m,this.element.style.height=u,this.element.style.display="flex",this.element.style.flexDirection="column",this.element.style.boxSizing="border-box",this.element.style.overflow="hidden",this.element.style.setProperty("color",l),this.element.style.setProperty("font-family",c),this.element.style.setProperty("font-size",d),this.element.style.setProperty("font-weight",h);const b=g(this.chartContext,{className:Pt.actionsContainer.slice(1)});this.renderToolbar(b);const f=g(this.chartContext,{className:Pt.ganttContainer.slice(1)}),v=this.dataManager.getFlatVisibleTasks();this.initVirtualScrollCoordinator();const y=null==(e=this.virtualScrollCoordinator)?void 0:e.initialise(v),w=new Mt(this.viewMode,this.options,this.chartContext,this.dataManager).render(y,p),x=new ht(this.options,this.chartContext,this.dataManager).render(this.render.bind(this),y);w&&this.layoutManager.createLayout(f,x,w,i,o),this.element.appendChild(b),this.element.appendChild(f);const C=this.element.querySelector(Pt.horizontalScroll);C&&(C.remove(),this.element.appendChild(C)),this.styleManager.handleWatermark(),this.cacheDomElements(),this.setupRowBackgroundColors(),this.zoomManager.setupZoomEventListener(),this.setupDependencyArrowEvents(),this.renderDependencyArrows();const k=new Set(v.map((t=>t.id))),S=p.size>0?new Set([...p,...k].filter((t=>!p.has(t)||!k.has(t)))):void 0;return this.fadeArrowsAfterAnimation(!1,S),this.computeCriticalPath(),this.applyCriticalPathHighlighting(),requestAnimationFrame((()=>{this.performAfterActions()})),n&&requestAnimationFrame((()=>{this.stateManager.restoreState(this.element)})),this.element}cacheDomElements(){var t;this.domCache.ganttContainer=this.element.querySelector(Pt.ganttContainer),this.domCache.timelineContainer=this.element.querySelector(Pt.timelineContainer),this.domCache.timelineBody=this.element.querySelector(Pt.timelineBody),this.domCache.timelineBodyWrapper=this.element.querySelector(Pt.timelineBodyWrapper),this.domCache.timelineHeader=this.element.querySelector(Pt.timelineHeader),this.domCache.horizontalScroll=this.element.querySelector(Pt.horizontalScroll),this.domCache.horizontalScrollContent=(null==(t=this.domCache.horizontalScroll)?void 0:t.querySelector(Pt.horizontalScrollContent))||null,this.domCache.tasksContainer=this.element.querySelector(Pt.tasksContainer),this.domCache.tasksBodyWrapper=this.element.querySelector(Pt.tasksBodyWrapper),this.domCache.tasksHeader=this.element.querySelector(Pt.tasksHeader),this.domCache.tasksDataContainer=this.element.querySelector(Pt.tasksDataContainer),this.domCache.splitBar=this.element.querySelector(Pt.splitBar),this.domCache.actionsContainer=this.element.querySelector(Pt.actionsContainer)}clearDomCache(){this.domCache.ganttContainer=null,this.domCache.timelineContainer=null,this.domCache.timelineBody=null,this.domCache.timelineBodyWrapper=null,this.domCache.timelineHeader=null,this.domCache.horizontalScroll=null,this.domCache.horizontalScrollContent=null,this.domCache.tasksContainer=null,this.domCache.tasksBodyWrapper=null,this.domCache.tasksHeader=null,this.domCache.tasksDataContainer=null,this.domCache.splitBar=null,this.domCache.actionsContainer=null}performAfterActions(){var t,e;if(this.cacheDomElements(),this.layoutManager.syncTasksColumnWidths(),this.scrollManager.compensateForScrollbar(),this.scrollManager.updateHorizontalScrollbarContent(),this.scrollManager.setupTimelineHorizontalScroll(),this.scrollManager.positionHorizontalScrollbar(),this.setupContainerResizeObserver(),this.scrollManager.setupScrollbarResizeObserver(),this.setupRowBackgroundColors(),this.setupRowHoverSync(),this.scrollManager.disableHeaderMousewheelScroll(),(null==(t=this.virtualScrollCoordinator)?void 0:t.isActive)||this.layoutManager.fillEmptyRowsAfterRender(),this.virtualScrollCoordinator){const t=this.element.querySelector(".split-view-container")??this.domCache.ganttContainer;this.virtualScrollCoordinator.updateDomRefs({tasksDataContainer:this.domCache.tasksDataContainer,timelineBody:this.domCache.timelineBody,barContainer:this.element.querySelector(Pt.barContainer),tasksBodyWrapper:this.domCache.tasksBodyWrapper,timelineBodyWrapper:this.domCache.timelineBodyWrapper,verticalScrollContainer:t}),this.virtualScrollCoordinator.attach()}null==(e=this.keyboardNavigationManager)||e.attach()}initVirtualScrollCoordinator(){this.virtualScrollCoordinator&&this.virtualScrollCoordinator.destroy(),this.virtualScrollCoordinator=new me({tasksDataContainer:null,timelineBody:null,barContainer:null,tasksBodyWrapper:null,timelineBodyWrapper:null,verticalScrollContainer:null},this.options,this.chartContext,this.dataManager,(()=>this.viewMode),(()=>{this.setupRowBackgroundColors(),this.renderDependencyArrows(),this.fadeArrowsAfterAnimation(),this.applyCriticalPathHighlighting()}),(()=>this.render()))}setupRowHoverSync(){const t=this.domCache.ganttContainer;if(!t)return;this.rowHoverHandler&&(t.removeEventListener("mousemove",this.rowHoverHandler),this.rowHoverHandler=null),this.rowHoverLeaveHandler&&(t.removeEventListener("mouseleave",this.rowHoverLeaveHandler),this.rowHoverLeaveHandler=null);const e=this.chartContext.getInstanceId(),n=`${Pt.tasksDataRow}[data-chart-instance="${e}"]`,i=`${Pt.timelineDataRow}[data-chart-instance="${e}"]`,o=getComputedStyle(this.element).getPropertyValue("--row-hover-color").trim()||"rgba(0,0,0,0.06)",r=(t,e)=>{const r=this.element.querySelector(`${n}[data-taskid="${t}"]`),a=this.element.querySelector(`${i}[data-taskid="${t}"]`);for(const t of[r,a])t&&(e?(t.dataset.origBg||(t.dataset.origBg=t.style.backgroundColor),t.style.backgroundColor=o):(t.style.backgroundColor=t.dataset.origBg??"",delete t.dataset.origBg))};let a=null;const s=t=>{const o=t.target,s=null==o?void 0:o.closest(`${n}, ${i}`),l=null==o?void 0:o.closest(`[data-taskid][data-chart-instance="${e}"]`),c=(null==s?void 0:s.dataset.taskid)??(null==l?void 0:l.dataset.taskid)??null;c!==a&&(a&&r(a,!1),a=c,a&&r(a,!0))},l=e=>{const{relatedTarget:n}=e;n&&t.contains(n)||(a&&r(a,!1),a=null)};this.rowHoverHandler=s,this.rowHoverLeaveHandler=l,t.addEventListener("mousemove",s),t.addEventListener("mouseleave",l)}setupRowBackgroundColors(){var t;const e=new Map,n=Bt(this.element),i=[...this.options.rowBackgroundColors];n.rowBgEven&&(i[0]=n.rowBgEven),n.rowBgOdd&&(i[1]=n.rowBgOdd);const o=(null==(t=this.virtualScrollCoordinator)?void 0:t.isActive)?this.virtualScrollCoordinator.getRenderedTaskIds():null;this.dataManager.getTopParentTasks().forEach(((t,n)=>{const r=t.rowBackgroundColor||rt(n,i);e.set(t.id,r),o&&!o.has(t.id)||at(this.chartContext,t.id,r)})),this.dataManager.getFlatTasks().forEach((t=>{if(o&&!o.has(t.id))return;if(!t.parentId){if(t.type===ct.Milestone&&!e.has(t.id)){const e=t.rowBackgroundColor||rt(0,i);at(this.chartContext,t.id,e)}return}let n=this.dataManager.getTaskById(t.parentId);for(;null==n?void 0:n.parentId;)n=this.dataManager.getTaskById(n.parentId);const r=n?n.id:t.parentId,a=t.rowBackgroundColor||(e.get(r??"")??"");at(this.chartContext,t.id,a)}))}fadeArrowsAfterAnimation(t=!1,e){var n;const i=`timeline-arrows-${this.arrowLink.getInstanceId()}`;!function(t,e,n=!1,i){if(!t)return;const o=Ct(e);if(i&&i.size>0){const e=Array.from(t.querySelectorAll("path[data-edgeid]")).filter((t=>{const[e,n]=(t.getAttribute("data-edgeid")??"").split("-");return i.has(e)||i.has(n)}));if(0===e.length)return;return n||o?void e.forEach((t=>t.style.opacity="1")):(e.forEach((t=>t.style.opacity="0")),void setTimeout((()=>{e.forEach((t=>{"function"==typeof t.animate?t.animate([{opacity:"0"},{opacity:"1"}],{duration:150,easing:"ease-out",fill:"forwards"}).finished.then((()=>{t.style.opacity="1",t.getAnimations().forEach((t=>t.cancel()))})).catch((()=>{})):t.style.opacity="1"}))}),200))}n||o?t.style.opacity="1":(t.style.opacity="0",setTimeout((()=>{"function"==typeof t.animate?t.animate([{opacity:"0"},{opacity:"1"}],{duration:150,easing:"ease-out",fill:"forwards"}).finished.then((()=>{t.style.opacity="1",t.getAnimations().forEach((t=>t.cancel()))})).catch((()=>{})):t.style.opacity="1"}),200))}((null==(n=this.domCache.timelineBody)?void 0:n.querySelector(`#${i}`))??null,this.element,t,e)}renderDependencyArrows(){var t;const{rowHeight:e,barMargin:n}=this.options,i=this.getInstanceId(),o=this.arrowLink.getInstanceId(),r=this.domCache.timelineBody;if(!r)return void R.warn(`[${i}] Timeline body not found for arrows`);const a=`timeline-arrows-${o}`,s=r.querySelector(`#${a}`);s&&s.remove();const l=this.dataManager.getFlatVisibleTasks(),c=l.filter((t=>!!t.dependency));if(0===c.length)return;const d=new Map;l.forEach(((t,e)=>d.set(t.id,e)));const[h]=this.dataManager.getDateRange(8,this.viewMode),p=e-2*n,u=(t,i)=>{const o=J.calculateX(t,h,this.viewMode,this.options),r=J.calculateWidth(t,this.viewMode,this.options),a=n+i*e;return{left:o,right:o+r,top:a,bottom:a+p,width:r,height:p}},m=(null==(t=this.virtualScrollCoordinator)?void 0:t.isActive)?this.virtualScrollCoordinator.getRenderedTaskIds():null,g=c.flatMap((t=>{const{taskId:e,type:n,lag:i}=dt(t.dependency);if(m&&!m.has(e)&&!m.has(t.id))return[];const o=this.dataManager.getTaskById(e),r=d.get(e),a=d.get(t.id);if(!o||void 0===r||void 0===a)return[];return[{id:`${e}-${t.id}`,sourceRect:u(o,r),targetRect:u(t,a),dependencyType:n,lagPx:i}]}));if(0===g.length)return;const b=l.length*e;this.arrowLink.renderFromRects(r,g,{arrowColor:this.options.arrowColor,height:Math.max(b,r.clientHeight),paddingY:e/2,width:(r.scrollWidth||r.clientWidth)+40},this.chartContext)}setupDependencyArrowEvents(){const t=this.getInstanceId(),e=this.arrowLink.getInstanceId();this.dependencyArrowHandler&&this.chartContext.removeEventListener(ge,this.dependencyArrowHandler),this.dependencyArrowHandler=n=>{const i=n;if(i.detail.chartInstanceId!==t)return;const o=i.detail.arrowLinkInstanceId||e,r=function(t,e,n,i,o="FS",r=38){const a=t.getInstanceId(),s=H(t,e),l=H(t,n);if(!s||!l)return R.warn(`[${a}] Arrow source or target not found: ${e} -> ${n}`),!1;const c=t.querySelector(`.timeline-body[data-chart-instance="${a}"]`),d=`timeline-arrows-${i}`,h=null==c?void 0:c.querySelector(`#${d}`);return h?(At.updateArrow(s,l,h,{paddingX:20,paddingY:r/2},`${e}-${n}`,o),!0):(R.warn(`[${a}] Arrow SVG not found: ${d}`),!1)}(this.chartContext,i.detail.fromId,i.detail.toId,o,i.detail.type,this.options.rowHeight);r||(this.renderDependencyArrows(),this.fadeArrowsAfterAnimation(!0))},this.chartContext.addEventListener(ge,this.dependencyArrowHandler);const n=()=>{this.computeCriticalPath(),this.chartContext.querySelectorAll(".bar-critical").forEach((t=>t.classList.remove("bar-critical"))),this.chartContext.querySelectorAll(".critical-arrow").forEach((t=>t.classList.remove("critical-arrow"))),this.applyCriticalPathHighlighting()},i=this.chartContext.getChartContainer();i&&(i.removeEventListener(X.TASK_DRAGGED,n),i.removeEventListener(X.TASK_RESIZED,n),i.addEventListener(X.TASK_DRAGGED,n),i.addEventListener(X.TASK_RESIZED,n))}computeCriticalPath(){this.options.enableCriticalPath&&(this.criticalPathResult=function(t,e){if(0===t.length||0===e.length)return $t;const n=e.filter((t=>"FS"===t.type));if(0===n.length)return $t;const i=new Map;for(const e of t)i.set(e.id,e);const o=new Map,r=new Map,a=new Map;for(const e of t)a.set(e.id,0),o.set(e.id,[]),r.set(e.id,[]);for(const t of n)i.has(t.fromId)&&i.has(t.toId)&&(o.get(t.fromId).push(t),r.get(t.toId).push(t),a.set(t.toId,(a.get(t.toId)??0)+1));const s=[];for(const[t,e]of a)0===e&&s.push(t);const l=[];for(;s.length>0;){const t=s.shift();l.push(t);for(const e of o.get(t)??[]){const t=(a.get(e.toId)??0)-1;a.set(e.toId,t),0===t&&s.push(e.toId)}}if(l.length!==t.length)return $t;const c=new Map,d=new Map;for(const t of l){const e=i.get(t);if(!e)continue;const n=Dt(e.startTime,e.endTime??e.startTime);let o=0;for(const e of r.get(t)??[]){const t=d.get(e.fromId)??0;o=Math.max(o,t+e.lag+1)}c.set(t,o),d.set(t,o+n-1)}let h=0;for(const t of d.values())t>h&&(h=t);const p=new Map,u=new Map;for(const t of[...l].reverse()){const e=i.get(t);if(!e)continue;const n=Dt(e.startTime,e.endTime??e.startTime),r=o.get(t)??[];let a=h;for(const t of r){const e=u.get(t.toId)??h;a=Math.min(a,e-t.lag-1)}p.set(t,a),u.set(t,a-n+1)}const m=new Set;for(const t of l)0==(u.get(t)??0)-(c.get(t)??0)&&m.add(t);const g=new Set;for(const t of n)if(m.has(t.fromId)&&m.has(t.toId)){const e=d.get(t.fromId)??0,n=c.get(t.toId)??0;e+t.lag+1===n&&g.add(`${t.fromId}->${t.toId}`)}return{criticalTaskIds:m,criticalEdgeKeys:g}}(this.dataManager.getTasks(),this.dataManager.getAllDependencies()))}applyCriticalPathHighlighting(){var t,e;if(!this.options.enableCriticalPath||!this.criticalPathResult)return;for(const e of this.criticalPathResult.criticalTaskIds)null==(t=H(this.chartContext,e))||t.classList.add("bar-critical");const n=this.domCache.timelineBody;for(const t of this.criticalPathResult.criticalEdgeKeys){const[i,o]=t.split("->");null==(e=null==n?void 0:n.querySelector(`[data-edgeid="${i}-${o}"]`))||e.classList.add("critical-arrow")}}rerenderTimeline(){var t;const e=this.domCache.timelineContainer;if(!e)return;const n=new Map;this.element.querySelectorAll(".bar-timeline[data-taskid]").forEach((t=>{const e=t.getAttribute("data-taskid");n.set(e,{left:parseFloat(t.style.left)||0,width:parseFloat(t.style.width)||0})}));const i=this.dataManager.getFlatVisibleTasks(),o=null==(t=this.virtualScrollCoordinator)?void 0:t.initialise(i),r=new Set(i.map((t=>t.id))),a=this.domCache.timelineHeader,s=this.domCache.timelineBodyWrapper;if(a&&s){a.innerHTML="",s.innerHTML="";const t=new Mt(this.viewMode,this.options,this.chartContext,this.dataManager).render(o,r);if(t){const e=t[0];a.innerHTML=e.innerHTML;for(let e=1;e<t.length-1;e++)s.appendChild(t[e])}}else{e.innerHTML="";const t=new Mt(this.viewMode,this.options,this.chartContext,this.dataManager).render(o,r);if(t){const n=t[0];e.appendChild(n);const i=g(this.chartContext,{className:Pt.timelineBodyWrapper.slice(1)});for(let e=1;e<t.length-1;e++)i.appendChild(t[e]);e.appendChild(i)}}this.cacheDomElements(),requestAnimationFrame((()=>{if(n.size>0){const t=this.element;this.element.querySelectorAll(".bar-timeline[data-taskid]").forEach((e=>{const i=e.getAttribute("data-taskid"),o=n.get(i);o&&function(t,e,n,i){if(Ct(i))return;if("function"!=typeof t.animate)return;if(e.left===n.left&&e.width===n.width)return;const o=t.animate([{left:`${e.left}px`,width:`${e.width}px`},{left:`${n.left}px`,width:`${n.width}px`}],{duration:200,easing:"ease-in-out",fill:"forwards"});o.finished.then((()=>o.cancel())).catch((()=>{}))}(e,o,{left:parseFloat(e.style.left)||0,width:parseFloat(e.style.width)||0},t)}))}this.performAfterActions()}))}cleanupEventListeners(){var t,e;try{this.dependencyArrowHandler&&(this.chartContext.removeEventListener(ge,this.dependencyArrowHandler),this.dependencyArrowHandler=null),this.rowHoverHandler&&(null==(t=this.domCache.ganttContainer)||t.removeEventListener("mousemove",this.rowHoverHandler),this.rowHoverHandler=null),this.rowHoverLeaveHandler&&(null==(e=this.domCache.ganttContainer)||e.removeEventListener("mouseleave",this.rowHoverLeaveHandler),this.rowHoverLeaveHandler=null);const n=this.domCache.timelineContainer;if(null==n?void 0:n.parentNode){const t=n.cloneNode(!0);n.parentNode.replaceChild(t,n)}}catch(t){R.warn("Error cleaning up event listeners:",t)}}cleanupTooltips(){try{const{enableTooltip:t,tooltipId:e}=this.options;if(t){const t=this.chartContext.getElementById(e);t&&(t.style.display="none",t.innerHTML="",t.removeAttribute("style"),t.classList.remove("visible"),t.setAttribute("aria-hidden","true"),this.isShadowDOM()&&t.remove())}}catch(t){R.warn("Error cleaning up tooltips:",t)}}cleanupDependencyArrows(){try{const t=this.domCache.timelineBody;if(t&&this.arrowLink){const e=this.arrowLink.getInstanceId(),n=`timeline-arrows-${e}`,i=t.querySelector(`#${n}`);i&&i.remove();t.querySelectorAll("[data-edgeid]").forEach((t=>{const n=t.getAttribute("marker-end");(null==n?void 0:n.includes(`arrowhead-${e}`))&&t.remove()}))}}catch(t){R.warn("Error cleaning up dependency arrows:",t)}}createActionButton(t,e,n=!1){const i=this.chartContext.createElement("button");return i.className="gantt-action-button",i.innerHTML=t,i.title=e,i.disabled=n,i.setAttribute("aria-label",e),i}createSeparator(){const t=this.chartContext.createElement("div");return t.className="gantt-action-separator",t}createViewModeDisplay(){const t=this.chartContext.createElement("div");t.className="gantt-view-mode-display";const e=this.viewMode.charAt(0).toUpperCase()+this.viewMode.slice(1);return t.innerHTML=`${Lt.calendar} <span>${e}</span>`,t.title=`Current view: ${e}`,t}renderToolbar(t){t.innerHTML="";const e=this.createActionButton(Lt.zoomIn,"Zoom In",this.viewMode===L[0]);e.addEventListener("click",(()=>this.zoomIn()));const n=this.createActionButton(Lt.zoomOut,"Zoom Out",this.viewMode===L[L.length-1]);n.addEventListener("click",(()=>this.zoomOut()));const i=this.createViewModeDisplay(),o=this.chartContext.createElement("div");if(o.className="gantt-actions-spacer",t.append(e,n,this.createSeparator(),i),this.options.enableExport){t.append(o);const e=this.createActionButton(Lt.download,"Export as SVG"),n=()=>this.element;e.addEventListener("click",(()=>{var t;const e=n();if(!e)return R.error("Export failed: Chart element not found"),void alert("Export failed: Chart not found. Please refresh and try again.");if(e.querySelector(Pt.ganttContainer))try{const n=(null==(t=this.virtualScrollCoordinator)?void 0:t.expandAllForExport())??null;zt(e).finally((()=>{var t;null==(t=this.virtualScrollCoordinator)||t.restoreAfterExport(n)}))}catch(t){R.error("Export error:",t),alert("Export failed. Please check the console for details.")}else R.error("Export failed: Gantt container not found in chart")})),t.append(e)}}update(t){this.element&&!this.isDestroyed()&&this.stateManager.captureState(this.element,this.dataManager,this.viewMode);const e=this.detectCurrentTheme(),n=t.theme,i=n&&n!==e,o=this.stateManager.hasState()?this.stateManager.getViewMode():this.viewMode,r=new Set(Object.keys(t).filter((e=>void 0===t[e]))),a=Object.fromEntries(Object.entries(t).filter((([,t])=>void 0!==t))),s=_(n||e);let l,c;if(i){this.styleManager.cleanupScrollbarStyles();const t={series:this.options.series,parsing:this.options.parsing,width:this.options.width,height:this.options.height,viewMode:this.options.viewMode,rowHeight:this.options.rowHeight,tasksContainerWidth:this.options.tasksContainerWidth,inputDateFormat:this.options.inputDateFormat,annotations:this.options.annotations,enableExport:this.options.enableExport,enableResize:this.options.enableResize,enableTaskDrag:this.options.enableTaskDrag,enableTaskEdit:this.options.enableTaskEdit,enableTaskResize:this.options.enableTaskResize,enableTooltip:this.options.enableTooltip,tooltipTemplate:this.options.tooltipTemplate,canvasStyle:this.options.canvasStyle};l={...s,...t,...a},l.baseline={...s.baseline,...t.baseline??s.baseline,...a.baseline??{}}}else{const t=Object.fromEntries(Object.entries(this.options).filter((([t])=>!r.has(t))));l={...s,...t,...a},l.baseline={...s.baseline,...t.baseline??s.baseline,...a.baseline??{}}}t.viewMode||(l.viewMode=o),l.parsing?Wt.validateConfig(l.parsing)?c=Wt.parse(l.series,l.parsing):(R.error("ApexGantt: Invalid parsing configuration provided in update()"),c=this.options.series):c=l.series?l.series:this.options.series,this.options={...l,series:c},this.viewMode=this.options.viewMode,this.dataManager.setTasks(this.options.series),this.styleManager.updateOptions(this.options),this.scrollManager.updateOptions(this.options),this.layoutManager.updateOptions(this.options),this.render(),this.element&&!this.isDestroyed()&&this.stateManager.restoreState(this.element)}detectCurrentTheme(){const t=this.options.backgroundColor;return this.styleManager.isColorDark(t)?"dark":"light"}updateTask(t,e){if(!this.dataManager.getTaskById(t))throw new Error(`Task with ID ${t} not found`);const[n]=this.dataManager.getDateRange(0,this.viewMode);st(this.chartContext,this.dataManager,t,e,this.options,this.viewMode,n)}zoomIn(){this.zoomManager.zoomIn()}zoomOut(){this.zoomManager.zoomOut()}normalizeDimension(t){return"number"==typeof t?`${t}px`:t}setupContainerResizeObserver(){if(!this.element)return;this.containerResizeObserver&&this.containerResizeObserver.disconnect();const t=this.normalizeDimension(this.options.width),e=this.normalizeDimension(this.options.height),n="string"==typeof t&&t.includes("%"),i="string"==typeof e&&e.includes("%");(n||i)&&(this.lastKnownWidth=this.element.offsetWidth,this.lastKnownHeight=this.element.offsetHeight,this.containerResizeObserver=new ResizeObserver((t=>{for(const e of t){const t=e.contentRect.width,n=e.contentRect.height,i=Math.abs(t-this.lastKnownWidth)>1,o=Math.abs(n-this.lastKnownHeight)>1;(i||o)&&(this.lastKnownWidth=t,this.lastKnownHeight=n,this.handleContainerResize())}})),this.containerResizeObserver.observe(this.element))}handleContainerResize(){null!==this.resizeDebounceTimer&&window.clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout((()=>{this.performResize(),this.resizeDebounceTimer=null}),150)}performResize(){if(!this.element||this.isDestroyed())return;const t=this.normalizeDimension(this.options.width),e=this.normalizeDimension(this.options.height),n="string"==typeof t&&t.includes("%"),i="string"==typeof e&&e.includes("%");if(n){window.getComputedStyle(this.element.parentElement||this.element).width!==window.getComputedStyle(this.element).width&&requestAnimationFrame((()=>{this.scrollManager.positionHorizontalScrollbar(),this.scrollManager.updateHorizontalScrollbarContent(),this.layoutManager.syncTasksColumnWidths()}))}i&&requestAnimationFrame((()=>{this.layoutManager.fillEmptyRowsAfterRender()}))}destroy(){var t;try{this.virtualScrollCoordinator&&(this.virtualScrollCoordinator.destroy(),this.virtualScrollCoordinator=null),this.containerResizeObserver&&(this.containerResizeObserver.disconnect(),this.containerResizeObserver=null),null!==this.resizeDebounceTimer&&(window.clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=null),this.zoomManager.cleanup(),this.scrollManager.cleanup(),null==(t=this.keyboardNavigationManager)||t.detach(),this.reducedMotionMQL&&this.reducedMotionHandler&&(this.reducedMotionMQL.removeEventListener("change",this.reducedMotionHandler),this.reducedMotionMQL=null,this.reducedMotionHandler=null),this.cleanupEventListeners(),this.cleanupTooltips(),this.cleanupDependencyArrows(),this.element.innerHTML="",this.clearDomCache(),super.destroy()}catch(t){R.error("Error during ApexGantt destruction:",t)}}isDestroyed(){return!this.element||""===this.element.innerHTML}}const fe={tooltipBGColor:"#FFFFFF",tooltipBorderColor:"#CCCCCC",tooltipTextColor:"#333333",cellBorderColor:"#E3EDF8",rowBackgroundColors:["#FFFFFF","#F5F9FF"],headerBackground:"#EBF3FB",headerTextColor:"#333333",barBackgroundColor:"#318CE7",barTextColor:"#FFFFFF",arrowColor:"#1A6FC4",backgroundColor:"#FFFFFF",textColor:"#000000",borderColor:"#DFE0E1",annotationBgColor:"#DBEAFE",annotationBorderColor:"#60A5FA",dialogBgColor:"#FFFFFF",dialogBorderColor:"#EEEEEE",buttonBgColor:"#318CE7",buttonTextColor:"#FFFFFF",buttonHoverBgColor:"#1A6FC4",toolbarBgColor:"#FFFFFF",toolbarBorderColor:"#BCBCBC",toolbarHoverBgColor:"#F0F7FF",scrollbarTrackColor:"#F5F5F5",scrollbarThumbColor:"#C1C1C1",scrollbarThumbHoverColor:"#A8A8A8",splitBarColor:"#DEE2E6",splitBarHoverColor:"#318CE7",splitBarBorderColor:"#BBBBBB",splitBarHandleColor:"#666666"},ve={tooltipBGColor:"#2D2D2D",tooltipBorderColor:"#444444",tooltipTextColor:"#E0E0E0",cellBorderColor:"#3A3A3A",rowBackgroundColors:["#1E1E1E","#252525"],headerBackground:"#2A2A2A",headerTextColor:"#E0E0E0",barBackgroundColor:"#818CF8",barTextColor:"#FFFFFF",arrowColor:"#A5B4FC",backgroundColor:"#1E1E1E",textColor:"#E0E0E0",borderColor:"#3A3A3A",annotationBgColor:"#4A2D4D",annotationBorderColor:"#8B4D8F",dialogBgColor:"#2D2D2D",dialogBorderColor:"#444444",buttonBgColor:"#6366F1",buttonTextColor:"#FFFFFF",buttonHoverBgColor:"#4F46E5",toolbarBgColor:"#2D2D2D",toolbarBorderColor:"#444444",toolbarHoverBgColor:"#3A3A3A",scrollbarTrackColor:"#000",scrollbarThumbColor:"#4A4A4A",scrollbarThumbHoverColor:"#5A5A5A",splitBarColor:"#3A3A3A",splitBarHoverColor:"#818CF8",splitBarBorderColor:"#4A4A4A",splitBarHandleColor:"#666666"};function ye(t){return"dark"===t?ve:fe}"undefined"!=typeof window&&(window.ApexGantt=be);export{be as ApexGantt,tt as ColumnKey,ve as DarkTheme,Wt as DataParser,X as GanttEvents,fe as LightTheme,P as ViewMode,be as default,ye as getTheme};
|