UNPKG

gantt-schedule-timeline-calendar

Version:

Gantt, Schedule, Timeline, Calendar components all in one. [gantt, timeline, schedule, scheduler, calendar, booking, gantt chart, reservation, javascript gantt, javascript timeline, javascript schedule, javascript scheduler, javascript calendar, javascrip

577 lines 185 kB
import{d as t,u as e,a as o,S as i,A as a,h as s,l as n,v as l,D as r,_ as c,m as d,b as h,c as u,p as m,P as f,e as g,f as p,J as w,V as b}from"./vendor.esm.min.js";
/**
 * Gantt-Schedule-Timeline-Calendar Time api
 *
 * @copyright NEURONET - Rafal Pospiech
 * @author    Rafal Pospiech <neuronet.io@gmail.com>
 * @module    gantt-schedule-timeline-calendar
 * @link      https://github.com/neuronetio/gantt-schedule-timeline-calendar
 * @link      https://gantt-schedule-timeline-calendar.neuronet.io
 * @version   3.40.5
 * @released  2025-03-24
 * @license   SEE LICENSE IN LICENSE FILE
 */class v{constructor(i,a){this.utcMode=!1,this.unsubs=[],this.currentDateLastCheck=0,this.state=i,this.api=a,this.dayjs=t,this.dayjs.extend(e),this.dayjs.extend(o),this.unsubs.push(i.subscribe("config.utcMode",(t=>{this.utcMode=t}))),this.unsubs.push(i.subscribe("config.locale",(t=>{if(!t.name)throw new Error("Locale must have a name property.");this.locale=t,this.dayjs.locale(this.locale,null,!0)})))}destroy(){for(const t of this.unsubs)t()}date(e=void 0){return this.utcMode?t.utc(e).locale(this.locale.name):e?t(e).locale(this.locale.name):t().locale(this.locale.name)}recalculateTime(){this.api.main.recalculateTimes([{name:"all"}])}recalculateFromTo(t,e=!1){const o=t.period;if((t=Object.assign({},t)).from=+t.from,t.to=+t.to,t.fromDate=this.date(t.from).startOf(o),t.from=t.fromDate.valueOf(),t.toDate=this.date(t.to).endOf(o),t.to=t.toDate.valueOf(),!t.autoExpandTimeFromItems||t.calculatedZoomMode)return t;let i=Number.MAX_SAFE_INTEGER,a=0;const s=this.state.get("config.chart.items");if(Object.keys(s).length>0&&(0===t.from||0===t.to||e)){for(const t in s){const e=s[t];e.time.start<i&&e.time.start&&(i=e.time.start),e.time.end>a&&(a=e.time.end)}i<t.from&&(t.fromDate=this.date(i).startOf(o),t.from=t.fromDate.valueOf()),a>t.to&&(t.toDate=this.date(a).endOf(o),t.to=t.toDate.valueOf())}return t}getCenter(t){return t.leftGlobal+Math.round((t.rightGlobal-t.leftGlobal)/2)}isInCurrentView(t,e=this.state.get("$data.chart.time")){const o=t.valueOf();return!(o<e.leftGlobal||o>e.rightGlobal)}recalculateDatesWidths(t,e=this.state.get("$data.chart.time")){if(!e.timePerPixel)throw new Error("[gantt-schedule-timeline-calendar] No timePerPixel");for(const o of t){if(!o.leftGlobal||!o.rightGlobal)throw new Error("[gantt-schedule-timeline-calendar] No date leftGlobal or rightGlobal.");o.width=(o.rightGlobal+1-o.leftGlobal)/e.timePerPixel}return t}recalculateDatesPositions(t,e=this.state.get("$data.chart.time"),o=!0,i=!1){let a=0;if(o)for(const o of t){if(o.leftGlobal>=e.leftGlobal)break;if(isNaN(o.width))throw new Error("[gantt-schedule-timeline-calendar] NaN date width.");a-=o.width}for(let o of t){if(i&&(o=this.api.mergeDeep({},o)),o.leftPx=a,o.rightPx=a+o.width,isNaN(o.leftPx)||isNaN(o.rightPx))throw new Error("[gantt-schedule-timeline-calendar] Date leftPx or rightPx is a NaN.");o.currentView&&(o.currentView.leftPx=o.leftPx-e.leftPx,o.currentView.rightPx=o.rightPx-e.leftPx,o.currentView.width=o.currentView.rightPx-o.currentView.leftPx),a+=o.width}return t}setDatesCacheLevel(t,e,o=this.state.get("$data.chart.time")){if(!e.length)return;o.datesCache||(o.datesCache={timePerPixel:0,levels:[]}),o.datesCache.timePerPixel=o.timePerPixel,o.datesCache.levels[t]||(o.datesCache.levels[t]={leftTime:0,rightTime:0,dates:[]});const i=o.datesCache.levels[t];i.leftTime=e[0].leftGlobal,i.rightTime=e[e.length-1].rightGlobal,i.dates=[...e]}addDatesToCacheLevel(t,e,o=this.state.get("$data.chart.time")){if(!e.length)return;if(!o.datesCache)return;if(o.datesCache.timePerPixel!==o.timePerPixel)return e;const i=e[0],a=e[e.length-1],s=o.datesCache.levels[t];if(!s)return e;if(s.leftTime<=i.leftGlobal&&s.rightTime>=a.rightGlobal)return s.dates;if(s.dates.length>=1e6)throw new Error("[gantt-schedule-timeline-calendar] To many dates.");const n=[];if(i.leftGlobal<s.leftTime){for(const t of e){if(!(t.leftGlobal<s.leftTime))break;n.push(t)}s.leftTime=n[0].leftGlobal}for(const t of s.dates)n.push(t);if(a.rightGlobal>s.rightTime){for(const t of e)t.rightGlobal>s.rightTime&&n.push(t);s.rightTime=n[n.length-1].rightGlobal}return s.dates=n,s.dates}isLevelDateInCache(t,e,o=this.state.get("$data.chart.time")){if(!o.datesCache)return!1;if(o.datesCache.timePerPixel!==o.timePerPixel)return!1;const i=o.datesCache.levels[t];return!(!i||!i.dates.length)&&(e>=i.leftTime&&e<=i.rightTime)}getLevelDatesFromCache(t,e,o,i=this.state.get("$data.chart.time")){if(i.datesCache.timePerPixel!==i.timePerPixel)return[];const a=i.datesCache.levels[t];if(!a)return[];if(!(e>=a.leftTime&&o<=a.rightTime))return[];let s=0,n=0,l=!1;const r=a.dates.length;for(;n<r;n++){const t=a.dates[n];if(t.rightGlobal>=e&&(l=!0),t.rightGlobal>=o)break;l||s++}return{[Symbol.iterator](){let t=s;return{next:()=>t<=n?{value:a.dates[t++],done:!1}:(t=s,{done:!0})}},length:n-s+1}}getLevelDateFromCache(t,e,o=this.state.get("$data.chart.time")){if(!this.isLevelDateInCache(t,e,o))return null;for(const i of o.datesCache.levels[t].dates)if(i.rightGlobal>=e)return i;return null}getAllLevelDatesFromCache(t,e=this.state.get("$data.chart.time")){return e.datesCache.levels[t].dates}findOrCreateMainDateAtTime(t,e=this.state.get("$data.chart.time")){if(this.isLevelDateInCache(e.level,t,e))return this.getLevelDateFromCache(e.level,t,e);let o=[];e.datesCache.levels[e.level]&&(o=e.datesCache.levels[e.level].dates),o=this.addMissingDates(o,this.date(t),e);for(const e of o)if(e.rightGlobal>=t)return e;return null}addMissingDates(t,e,o=this.state.get("$data.chart.time"),i=!0){if(!t.length)return[];const a=t[0],s=t[t.length-1];if(!(e.valueOf()<a.leftGlobal||e.valueOf()>s.rightGlobal))return t;if(this.isLevelDateInCache(o.level,e.valueOf(),o))return this.getAllLevelDatesFromCache(o.level,o);const n=t.length;let l=t;if(i){l=new Array(n);for(let e=0;e<n;e++)l[e]=this.api.mergeDeep({},t[e])}const r=this.state.get(`config.chart.calendarLevels.${o.level}`),c=this.getCurrentFormatForLevel(r,o);let d=1;if("number"==typeof c.periodIncrement&&(d=c.periodIncrement),e.valueOf()<a.leftGlobal){if("function"==typeof c.periodIncrement)return t;const s=a.leftGlobalDate.subtract(1,"ms");let n=a.leftGlobalDate.subtract(d,o.period).startOf(o.period);for(;e.valueOf()<n.valueOf();)n=n.subtract(d,o.period).startOf(o.period);let r=[];do{r=this.generatePeriodDates({leftDate:n,rightDate:s,period:o.period,level:this.state.get(`config.chart.calendarLevels.${o.level}`),levelIndex:o.level,callOnDate:!0,callOnLevelDates:!0,time:o}),n=n.subtract(1,o.period)}while(!r.length||r[0].leftGlobal>e.valueOf());return r=r.filter((t=>!l.find((e=>e.leftGlobal===t.leftGlobal)))),t=[...r,...l],t=this.recalculateDatesWidths(t,o),t=this.recalculateDatesPositions(t,o,!0,i),this.addDatesToCacheLevel(o.level,t,o)}if(e.valueOf()>s.rightGlobal){let a=s.rightGlobalDate.add(d,o.period).endOf(o.period);for(;e.valueOf()>a.valueOf();)a=a.add(d,o.period).endOf(o.period);let n=this.generatePeriodDates({leftDate:s.rightGlobalDate.add(1,"ms"),rightDate:a,period:o.period,level:this.state.get(`config.chart.calendarLevels.${o.level}`),levelIndex:o.level,callOnDate:!0,callOnLevelDates:!0,time:o});return n=n.filter((t=>!l.find((e=>e.leftGlobal===t.leftGlobal)))),t=[...l,...n],t=this.recalculateDatesWidths(t,o),t=this.recalculateDatesPositions(t,o,!0,i),this.addDatesToCacheLevel(o.level,t,o)}return l}getGlobalOffsetPxFromDates(t,e=!0,o=this.state.get("$data.chart.time"),i=void 0){const a=t.valueOf();if(!o.allDates||0===o.allDates.length)return-100;if(void 0===i&&(i=o.allDates[o.level]),e&&(i=this.addMissingDates(i,t,o)),!i||0===i.length)return-1;let s;for(let t=0,e=i.length;t<e;t++){const e=i[t];if(a<=e.rightGlobal+1){s=e;break}}return s?a<s.leftGlobal?s.leftPx:s.rightPx-(s.rightGlobal-a)/o.timePerPixel:a<=o.leftGlobal?0:a>=o.rightGlobal?o.totalViewDurationPx+(a-o.rightGlobal+1)/o.timePerPixel:-1}getViewOffsetPxFromDates(t,e=!0,o=this.state.get("$data.chart.time"),i=void 0,a=!0){i||(i=o.allDates[o.level]),a&&(i=this.addMissingDates(i,t,o));const s=this.getDatesDiffPx(o.leftGlobalDate,t,o,!0,i);return e?this.limitOffsetPxToView(s):s}limitOffsetPxToView(t,e=this.state.get("$data.chart.time")){if(t<0)return 0;if(!e.levels.length)return e.width;const o=e.levels[e.level];if(!o.length)return e.width;const i=o[o.length-1];return t>i.currentView.rightPx?i.currentView.rightPx:t}findDateAtViewOffsetPx(t,e){return e.find((e=>e.currentView.rightPx>=t))}findDateIndex(t,e){let o=0;for(const i of e){if(i.rightGlobal>=t)return o;o++}return-1}findDateAtTime(t,e=void 0){if(!e){const t=this.state.get("$data.chart.time");e=t.allDates[t.level]}return e.find((e=>e.rightGlobal>=t))}getMainDateFromRelativePosition(t,e){const o=t.leftPx+e,i=this.state.get("$data.chart.time"),a=i.allDates[i.level];for(const t of a)if(t.rightPx>o)return t}getTimeFromOffsetPx(t,e=!0,o=this.state.get("$data.chart.time"),i=void 0){let a=t;e&&(a+=o.leftPx),i||(i=o.allDates[o.level]);const s=this.state.get(`config.chart.calendarLevels.${o.level}`),n=this.getCurrentFormatForLevel(s,o);let l=1;if("number"==typeof n.periodIncrement&&(l=n.periodIncrement),a<0){if("function"==typeof n.periodIncrement)return o.from;let t,e=o.fromDate.subtract(l,o.period).startOf(o.period),i=0;for(let s=0;s<1e3;s++){const s=this.generatePeriodDates({leftDate:e,rightDate:e.add(l,o.period).subtract(1,"ms"),period:o.period,time:o,level:this.state.get(`config.chart.calendarLevels.${o.level}`),levelIndex:o.level,callOnDate:!0,callOnLevelDates:!0,expandIfMissing:!1});if(s.length&&(t=s[0],i-=t.width,i<=a))return t.leftGlobal+(a-i)*o.timePerPixel;e=e.subtract(l,o.period).startOf(o.period)}}else if(a>o.totalViewDurationPx){let t,e=o.toDate.add(1,o.period).startOf(o.period),i=o.totalViewDurationPx;for(let s=0;s<1e3;s++){const s=this.generatePeriodDates({leftDate:e,rightDate:e.add(l,o.period).subtract(1,"ms"),period:o.period,time:o,level:this.state.get(`config.chart.calendarLevels.${o.level}`),levelIndex:o.level,callOnDate:!0,callOnLevelDates:!0,expandIfMissing:!1});if(s.length&&(t=s[0],i+=t.width,i>a))return t.rightGlobal+1-(i-a)*o.timePerPixel;e=e.add(l,o.period).startOf(o.period)}}for(let t=0,e=i.length;t<e;t++){const e=i[t];if(e.rightPx>a){const t=(e.rightPx-a)*o.timePerPixel;return e.rightGlobal+1-t}}const r=i[i.length-1];return r.rightGlobal+1-(r.rightPx-a)*o.timePerPixel}getCurrentFormatForLevel(t,e){return t.find((t=>+e.zoom<=+t.zoomTo))}alignLevelToMain(t,e,o=this.state.get("$data.chart.time")){if(t===o.level)return e;if(!this.state.get("config.chart.time.alignLevelsToMain"))return e;const i=o.allDates[o.level];if(!i||!i.length)return e;if(!e||!e.length)return e;const a=e.length;for(let t=0;t<a;t++){const a=e[t];let s,n=!1,l=0;for(const t of i){if(t.rightGlobal>=a.leftGlobal){if(!n)if(t.leftGlobal>=a.leftGlobal)a.leftGlobal=t.leftGlobal,a.leftGlobalDate=this.date(a.leftGlobal),a.leftPx=t.leftPx;else{const e=(t.rightGlobal-a.leftGlobal)/o.timePerPixel;l=-(t.width-e)}n=!0}if(t.leftGlobal>a.rightGlobal)break;n&&(l+=t.width,s=t)}if(s)if(s.rightGlobal<=a.rightGlobal)a.rightGlobal=s.rightGlobal,a.rightGlobalDate=this.date(a.rightGlobal),a.width=l,a.rightPx=a.leftPx+a.width;else{const t=(s.rightGlobal-a.rightGlobal)/o.timePerPixel;a.width=l-t,a.rightPx=a.leftPx+a.width}}return e}stopCheckingCurrentDates(){this.checkCurrentDateTimeoutId&&clearTimeout(this.checkCurrentDateTimeoutId)}checkCurrentDates(t=!1,e=this.state.get("$data.chart.time")){const o=this.date().valueOf(),i=e.checkCurrentDateInterval;if(this.stopCheckingCurrentDates(),t&&(this.checkCurrentDateTimeoutId=setTimeout((()=>{this.checkCurrentDates(t,e)}),i)),o-this.currentDateLastCheck<i)return;const a=e.allDates;let s=!1;for(const t of a){const e=t.length;for(let i=0;i<e;i++){const a=t[i],n=a.current;a.current=!1,a.previous=!1,a.next=!1,a.leftGlobal<=o&&a.rightGlobal>=o&&(!0!==n&&(s=!0),a.current=!0,i>0&&(t[i-1].previous=!0),i+1<e&&(t[i+1].next=!0))}}this.currentDateLastCheck=o,s&&this.state.update("$data.chart.time.levels",(t=>t),{data:"current-time"}),this.api.render()}getDSTDiffForLevel(t,e,o,i=this.state.get("$data.chart.time")){const a=this.api.time.getLevelDatesFromCache(t,e,o,i);let s=0;for(const t of a)t.DST.diffMs&&e<=t.DST.afterTime&&o>t.DST.afterTime&&(s+=t.DST.diffMs);return s}setDatesDST(t){for(const e of t){const t=e.rightGlobal-e.leftGlobal,o=e.rightGlobalDate.utc(!0).valueOf()-e.leftGlobalDate.utc(!0).valueOf();if(t!==o){e.DST={diffMs:t-o,afterTime:0,afterDate:null};for(let t=0;t<9216;t++)if(e.leftGlobalDate.add(t,"hour").hour()!==e.leftGlobalDate.utc(!0).add(t,"hour").hour()){e.DST.afterDate=e.leftGlobalDate.add(t,"hour").subtract(1,"ms"),e.DST.afterTime=e.DST.afterDate.valueOf();break}}}return t}_generatePeriodDates(t){const e=[];t=Object.assign({},t);const{datesCount:o,rightDate:i,period:a,level:s,levelIndex:n,time:l,originalLeftDate:r,format:c}=t;let d=t.leftDate;const h=this.date().valueOf();for(let t=0;t<o;t++){let t=c.periodIncrement||1;"function"==typeof t&&(t=t({currentDates:e,date:d,leftDate:r,rightDate:i,period:a,level:s,levelIndex:n,time:l,vido:this.api.vido,api:this.api}));const o=d.add(t-1,a).endOf(a),u=d.valueOf()<=h&&o.valueOf()>=h,m={id:`gstcid-${d.valueOf()}`,leftGlobal:d.valueOf(),leftGlobalDate:d,rightGlobalDate:o,rightGlobal:o.valueOf(),width:0,leftPx:0,rightPx:0,period:a,formatted:null,current:u,previous:!1,next:!1,periodIncrementedBy:t,DST:{diffMs:0,afterTime:0,afterDate:null}};u&&e.length&&(e[e.length-1].previous=!0),e.length&&e[e.length-1].current&&(m.next=!0);const f=m.rightGlobal+1-m.leftGlobal;m.width=f/l.timePerPixel,e.push(m),d=d.add(t||1,a)}return this.setDatesDST(e)}generatePeriodDates({leftDate:t,rightDate:e,period:o,level:i,levelIndex:a,time:s,callOnDate:n,callOnLevelDates:l,expandIfMissing:r=!0}){if(!s.timePerPixel)return[];const c=this.getCurrentFormatForLevel(i,s);t=t.startOf(o),e=e.endOf(o);const d=Math.ceil(e.diff(t,o,!0)),h=t.clone();let u=this._generatePeriodDates({datesCount:d,leftDate:t,rightDate:e,period:o,level:i,levelIndex:a,time:s,originalLeftDate:h,format:c});if(n){const t=[];for(let e=0;e<u.length;e++){let o=u[e];if(o){for(let t=0,e=s.onDate.length;t<e;t++)o=s.onDate[t]({date:o,format:c,time:s,level:i,levelIndex:a});o&&t.push(o)}}u=t}if(l)for(let t=0,e=s.onLevelDates.length;t<e;t++)u=s.onLevelDates[t]({dates:u,format:c,time:s,level:i,levelIndex:a});if((!u.length||u[u.length-1].rightGlobal<e.valueOf())&&r){let r=this._generatePeriodDates({datesCount:d+100,leftDate:t,rightDate:e,period:o,level:i,levelIndex:a,time:s,originalLeftDate:h,format:c});if(n){const t=[];for(let e=0;e<r.length;e++){let o=r[e];if(o){for(let t=0,e=s.onDate.length;t<e;t++)o=s.onDate[t]({date:o,format:c,time:s,level:i,levelIndex:a});o&&t.push(o)}}r=t}if(l)for(let t=0,e=s.onLevelDates.length;t<e;t++)r=s.onLevelDates[t]({dates:r,format:c,time:s,level:i,levelIndex:a});const u=[];for(const t of r)if(u.push(t),t.rightGlobal>=e.valueOf())return u}this.addDatesToCacheLevel(a,u,s);const m=[];for(const t of u)if(m.push(t),t.rightGlobal>=e.valueOf())return m;return m}getDatesDiffPx(t,e,o,i=!0,a=void 0){let s=e.valueOf(),n=t.valueOf();if(n===s)return 0;let l,r,c=0,d=!1;if(s<n){const o=t;t=e,n=s,s=(e=o).valueOf(),d=!0}if(void 0===a){if(!o.allDates||!o.allDates.length||!o.allDates[o.level])return 0;a=o.allDates[o.level]}if(0===a.length)return 0;if(this.isLevelDateInCache(o.level,n,o)?a=this.getAllLevelDatesFromCache(o.level,o):n<a[0].leftGlobal&&(a=this.addMissingDates(a,t,o)),this.isLevelDateInCache(o.level,s,o))a=this.getAllLevelDatesFromCache(o.level,o);else{s>a[a.length-1].rightGlobalDate.clone().valueOf()&&(a=this.addMissingDates(a,e,o))}this.addDatesToCacheLevel(o.level,a,o);let h=!1,u=0;for(const t of a)if(t.rightGlobal+1>=n&&!h&&(h=!0,r=t),h&&(c+=t.width),t.rightGlobal+1>=s){l=t,u=t.width;break}if(i){let t=n-r.leftGlobal;n<r.leftGlobal&&(t=0);let e=l.rightGlobal+1-s;l.leftGlobal>s&&(e=l.rightGlobal+1-l.leftGlobal);const i=(e+t)/o.timePerPixel;return d?-(c-i):c-i}return c-=u,d?-c:c}getDatesDiffMs(t,e,o,i=!0,a=void 0){if(t.valueOf()===e.valueOf())return 0;let s,n,l=0,r=!1;if(e.valueOf()<t.valueOf()){const o=t;t=e,e=o,r=!0}if(void 0===a){if(!o.allDates||!o.allDates.length||!o.allDates[o.level])return 0;a=o.allDates[o.level]}if(0===a.length)return 0;if(this.isLevelDateInCache(o.level,t.valueOf(),o)?a=this.getAllLevelDatesFromCache(o.level,o):t.valueOf()<a[0].leftGlobal&&(a=this.addMissingDates(a,t,o)),this.isLevelDateInCache(o.level,e.valueOf(),o))a=this.getAllLevelDatesFromCache(o.level,o);else{const t=a[a.length-1].rightGlobalDate.clone();e.valueOf()>t.valueOf()&&(a=this.addMissingDates(a,e,o))}this.addDatesToCacheLevel(o.level,a,o);let c=!1,d=0;for(const o of a)if(o.rightGlobal+1>=t.valueOf()&&!c&&(c=!0,n=o),c&&(l+=o.rightGlobal+1-o.leftGlobal),o.rightGlobal+1>=e.valueOf()){s=o,d=o.rightGlobal+1-o.leftGlobal;break}if(i){let o=t.valueOf()-n.leftGlobal;t.valueOf()<n.leftGlobal&&(o=0);let i=s.rightGlobal+1-e.valueOf();s.leftGlobal>e.valueOf()&&(i=s.rightGlobal+1-s.leftGlobal);const a=i+o;return r?-(l-a):l-a}return l-=d,r?-l:l}addTimeFromDates(t,e,o=this.state.get("$data.chart.time")){if(!o.allDates||!o.allDates.length||!o.allDates[o.level])return t+e;if(!e)return t;let i=this.getAllLevelDatesFromCache(o.level,o);const a=this.date(t);i=this.addMissingDates(i,a,o,!0);let s=this.findDateIndex(t,i),n=t-i[s].leftGlobal;n<0&&(n=0);let l=0;if(e>0){for(;l<e;){const t=i[s];if(l+=t.rightGlobal+1-t.leftGlobal,n&&(l-=n,n=0),l>=e)break;s++,i[s]||(i=this.addMissingDates(i,t.leftGlobalDate.add(1,o.period),o,!0))}return i[s].rightGlobal+1-(l-e)}for(;l>e;){let t=i[s];if(l-=n,n&&(n=0),l<=e)break;if(s--,s<0&&(i=this.addMissingDates(i,t.leftGlobalDate.subtract(1,o.period),o,!0),s=0),t=i[s],l-=t.rightGlobal+1-t.leftGlobal,l<=e)break}return i[s].leftGlobal+(-l+e)}getLeftViewDate(t=this.state.get("$data.chart.time")){if(!t.levels||!t.levels.length)return null;const e=t.levels[t.level];return e.length?e[0]:null}getRightViewDate(t=this.state.get("$data.chart.time")){if(!t.levels||!t.levels.length||!t.levels[t.level])return null;const e=t.levels[t.level];return e.length?e[e.length-1]:null}getLowerPeriod(t){switch(t){case"year":return"month";case"month":case"week":return"day";case"day":return"hour";case"hour":return"minute";case"minute":return"second";case"second":return"millisecond";default:return t}}getHigherPeriod(t){switch(t){case"month":return"year";case"week":case"day":return"month";case"hour":return"day";case"minute":return"hour";case"second":return"minute";case"millisecond":return"second";default:return t}}}
/**
 * Gantt-Schedule-Timeline-Calendar IDApi
 *
 * @copyright NEURONET - Rafal Pospiech
 * @author    Rafal Pospiech <neuronet.io@gmail.com>
 * @module    gantt-schedule-timeline-calendar
 * @link      https://github.com/neuronetio/gantt-schedule-timeline-calendar
 * @link      https://gantt-schedule-timeline-calendar.neuronet.io
 * @version   3.40.5
 * @released  2025-03-24
 * @license   SEE LICENSE IN LICENSE FILE
 */var y=new class{constructor(){this.GSTCID=this.GSTCID.bind(this),this.isGSTCID=this.isGSTCID.bind(this),this.sourceID=this.sourceID.bind(this)}GSTCID(t){return this.isGSTCID(t)?t:`gstcid-${t}`}isGSTCID(t){return String(t).startsWith("gstcid-")}sourceID(t){return this.isGSTCID(t)?t.substring(7):t}};
/**
 * Gantt-Schedule-Timeline-Calendar Slots
 *
 * @copyright NEURONET - Rafal Pospiech
 * @author    Rafal Pospiech <neuronet.io@gmail.com>
 * @module    gantt-schedule-timeline-calendar
 * @link      https://github.com/neuronetio/gantt-schedule-timeline-calendar
 * @link      https://gantt-schedule-timeline-calendar.neuronet.io
 * @version   3.40.5
 * @released  2025-03-24
 * @license   SEE LICENSE IN LICENSE FILE
 */class P extends i{constructor(t,e,o){super(e,o),this.subs=[],this.name=t,this.subs.push(e.state.subscribe(`config.slots.${t}`,this.setComponents,{queue:!0}))}destroy(){this.subs.forEach((t=>t())),super.destroy()}getName(){return this.name}}function D(t,e,o){return new P(t,e,o)}
/**
 * Gantt-Schedule-Timeline-Calendar helpers
 *
 * @copyright NEURONET - Rafal Pospiech
 * @author    Rafal Pospiech <neuronet.io@gmail.com>
 * @module    gantt-schedule-timeline-calendar
 * @link      https://github.com/neuronetio/gantt-schedule-timeline-calendar
 * @link      https://gantt-schedule-timeline-calendar.neuronet.io
 * @version   3.40.5
 * @released  2025-03-24
 * @license   SEE LICENSE IN LICENSE FILE
 */const x="gstc";function C(t,e=""){let o=`${x}__${t}`;return t===x&&(o=x),e?`${o} ${o}--${e.replace(":","-")}`:o}function W(t,e){let o=`${x}__${t}`;return t===x&&(o=x),`${o}--${e}`}
/**
 * Api functions
 *
 * @copyright NEURONET - Rafal Pospiech
 * @author    Rafal Pospiech <neuronet.io@gmail.com>
 * @module    gantt-schedule-timeline-calendar
 * @link      https://github.com/neuronetio/gantt-schedule-timeline-calendar
 * @link      https://gantt-schedule-timeline-calendar.neuronet.io
 * @version   3.40.5
 * @released  2025-03-24
 * @license   SEE LICENSE IN LICENSE FILE
 */let $=0;const I=new Map;function S(t){return I.get(t.apiId)}class M{constructor(t){this.apiId=0,this.name=x,this.debug=!1,this.plugins={},this.iconsCache={},this.unsubscribes=[],this.mutedMethods=new Set,this.mergeDeep=null,this.generateSlots=D,this.getClass=C,this.getId=W,this.GSTCID=y.GSTCID,this.isGSTCID=y.isGSTCID,this.sourceID=y.sourceID,this.allActions=[],this.keysToKeep=["id","parents","children","allChildren","parentId"],this.apiId=++$,I.set(this.apiId,{rowsDataWithParentsExpanded:[],rowsIdsWithParentsExpanded:[],rowsWithParentsExpanded:[],rowsWithParentsExpandedAsMap:new Map,rowsPositionsMap:{id:"",dataIndex:0,keys:[]},allRowsIds:[],allRowsAsArray:[],rowsWithParentsExpandedDataIndexMap:new Map,itemsAsArray:[],itemsDataAsArray:[]}),this.state=t,this.time=new v(this.state,this),this.unsubscribes.push(this.state.subscribe("config.debug",(t=>this.debug=t))),this.unsubscribes.push(this.state.subscribe("config.chart.items;",(()=>this.resetRowsOverlappingCalculated()))),this.unsubscribes.push(this.state.subscribe("config.chart.items.:itemId.time",(t=>{var e;if(t.length){const o=this.getRowsData();if(!o)return;const i=this.state.get("config.chart.items");for(const a of t)if(null===(e=a.params)||void 0===e?void 0:e.itemId){const t=i[a.params.itemId];if(t){o[t.rowId].overlappingCalculated=!1}}}}),{bulk:!0,bulkValue:!1})),this.debug&&(window.state=t)}schedule(t){let e=0;return function(...o){e||(e=requestAnimationFrame((function(){e=0,t(...o)})))}}render(){return this.vido.update()}getListenerPosition(t){for(const e of this.state.getListeners().values())for(const o of e.listeners)if(o[1].fn===t)return o[0]}setVido(t){this.vido=t}clone(t){return this.mergeDeep({},t)}setMergeDeep(t){this.mergeDeep=t}log(...t){this.debug&&console.log.call(console,...t)}getInitializedPlugins(){return this.state.get("$data.initializedPlugins")}pluginInitialized(t){this.getInitializedPlugins().add(t)}pluginDestroyed(t){this.getInitializedPlugins().delete(t)}clearPluginsPositions(){this.getInitializedPlugins().clear()}isPluginInitialized(t){return this.getInitializedPlugins().has(t)}getPluginPosition(t){return[...this.getInitializedPlugins()].indexOf(t)}getPluginsPositions(){const t={};let e=0;for(const o of this.getInitializedPlugins())t[o]=e++;return t}isPluginInitializedBefore(t,e){return this.getPluginPosition(t)<this.getPluginPosition(e)}getActions(t){this.allActions.includes(t)||this.allActions.push(t);let e=this.state.get("config.actions."+t);return void 0===e&&(e=[]),e.slice()}isItemHorizontallyInViewport(t,e=void 0,o=void 0){if(!e||!o){const t=this.state.get().config.chart.time;e=t.leftGlobal,o=t.rightGlobal}return t.time.start<=o&&t.time.end>=e}getChildrenLinkedItemsIds(t,e,o=[]){const i=e[t];if(i.linkedWith&&i.linkedWith.length){o.includes(t)||o.push(t);for(const t of i.linkedWith){if(o.includes(t))continue;o.push(t);const i=e[t];i.linkedWith&&i.linkedWith.length&&this.getChildrenLinkedItemsIds(t,e,o)}}return o}collectAllLinkedItems(){const t=[],e=new Map,o=this.getAllItemsAsArray(),i=this.getItemsData();for(const e of o){const o=e.id;void 0===i[o]?t.push(o):i[e.id].linkedWith=e.linkedWith||[]}if(t.length)throw new Error(`Items with id [${t.join(", ")}] does not exists in "$data.chart.items". TIP: For performance reasons, state is mutable, so try not to modify items from the "state.get" method before you copy them (with "gstc.api.clone(items)" for example).`);for(const t of o){const o=t.id;if(e.has(o))continue;const a=this.getChildrenLinkedItemsIds(o,i);i[o].linkedWith.splice(i[o].linkedWith.length,0,...a);const s=Array.from(new Set(i[o].linkedWith));i[o].linkedWith=s.filter((t=>t!==o)),e.set(o,!0);for(const t of s)i[t].linkedWith=s.filter((e=>e!==t)),e.set(t,!0)}}getChildrenDependantItemsIds(t,e,o=[]){if(t.dependant&&t.dependant.length)for(const i of t.dependant){if(o.includes(i))continue;o.push(i);const a=e[i];if(!a)throw new Error(`Dependant item not found [id:'${i}'] found in item [id:'${t.id}']`);a.dependant&&a.dependant.length&&this.getChildrenDependantItemsIds(a,e,o)}return o}calculateItemVerticalPosition(t,e=null,o=null,i=null){if(i||(i=this.getItem(t)),e||(e=this.getItemData(t)),o||(o=this.getRowData(i.rowId)),i.gap&&e||(this.prepareItem(i),e=this.getItemData(t)),!o)return e.position;const a=o.position.top+i.gap.top,s=e.position.rowTop+i.gap.top,n=this.getRowViewTop(o.id);let l=n+e.position.actualRowTop;return n===1/0?l=1/0:-1===n&&(l=-1),e.position.top=a,e.position.actualRowTop=s,e.position.viewTop=l,e.position}setItemDataOutOfView(t,e=this.state.get("$data.chart.time")){t.outOfView||(t.outOfView={left:!1,right:!1,whole:!1});const o=t.time.startDate.valueOf(),i=t.time.endDate.valueOf();return t.outOfView.left=o<e.leftGlobal||o>=e.rightGlobal,t.outOfView.right=i>e.rightGlobal||i<=e.leftGlobal,t.outOfView.whole=i<=e.leftGlobal||o>=e.rightGlobal,t}calculateItemHorizontalPosition(t,e=null,o=null,i=this.state.get("$data.chart.time"),a=null){if(a||(a=this.getItem(t)),e||(e=this.getItemData(t)),o||(o=this.getRowData(a.rowId)),!o)return e.position;const s=e.time.startDate.valueOf()===a.time.start?e.time.startDate:this.time.date(a.time.start),n=e.time.endDate.valueOf()===a.time.end?e.time.endDate:this.time.date(a.time.end),l=this.time.getViewOffsetPxFromDates(s,!1,i),r=this.time.getViewOffsetPxFromDates(n.add(1,"ms"),!1,i);e.position.left=l,e.position.actualLeft=this.time.limitOffsetPxToView(l,i),e.position.right=r,e.position.actualRight=this.time.limitOffsetPxToView(r,i),e.width=r-l;let c=this.time.getViewOffsetPxFromDates(n,!1,i);c===r&&(c-=1/i.timePerPixel),e.timeWidth=c-l,e.actualWidth=e.position.actualRight-e.position.actualLeft;const d=this.state.get("config.chart.item.minWidth");return"number"==typeof d&&e.actualWidth<d&&(e.actualWidth=d),this.setItemDataOutOfView(e,i),e.position}calculateItemPosition(t,e=null,o=null,i=this.state.get("$data.chart.time"),a=null){return e||(e=this.state.get(`$data.chart.items.${t}`)),a||(a=this.state.get(`config.chart.items.${t}`)),o||(o=this.state.get(`$data.list.rows.${a.rowId}`)),this.calculateItemHorizontalPosition(t,e,o,i,a),this.calculateItemVerticalPosition(t,e,o,a),e.position}getItemPosition(t,e,o,i,a){var s,n;return void 0===e&&(e=null),void 0===o&&(o=null),void 0===i&&(i=null===(n=null===(s=this.state.get().$data)||void 0===s?void 0:s.chart)||void 0===n?void 0:n.time),void 0===a&&(a=null),a||(a=this.getItem(t)),e||(e=this.getItemData(t)),0===e.position.left&&0===e.position.right&&this.calculateItemPosition(t,e,o,i,a),e.position}getRow(t){return this.state.get().config.list.rows[t]}getRows(t){if(!t.length)return[];const e=this.getAllRows(),o=[];for(const i of t)e[i]&&o.push(e[i]);return o}getAllRows(){var t,e;return null===(e=null===(t=this.state.get().config)||void 0===t?void 0:t.list)||void 0===e?void 0:e.rows}getVisibleRowsId(){var t,e;return null===(e=null===(t=this.state.get().$data)||void 0===t?void 0:t.list)||void 0===e?void 0:e.visibleRows}getRowsData(){var t,e;return null===(e=null===(t=this.state.get().$data)||void 0===t?void 0:t.list)||void 0===e?void 0:e.rows}setRowsData(t){this.state.update("$data.list.rows",t)}getRowData(t){return this.state.get().$data.list.rows[t]}setRowData(t,e){this.state.update(`$data.list.rows.${t}`,e)}getItem(t){return this.state.get().config.chart.items[t]}getItems(t=[],e=this.getAllItems()){const o=[];for(const i of t)e[i]&&o.push(e[i]);return o}getAllItemsAsArray(){return S(this).itemsAsArray}getAllItemsDataAsArray(){return S(this).itemsDataAsArray}getAllItems(){return this.state.get().config.chart.items}getItemData(t){const e=this.state.get();if(e.$data&&e.$data.chart&&e.$data.chart.items)return e.$data.chart.items[t]}getItemsData(){const t=this.state.get();if(t.$data&&t.$data.chart)return t.$data.chart.items}setItemData(t,e){this.state.update(`$data.chart.items.${t}`,(t=>{for(const o in e)t[o]=e[o];return t}))}setItemsData(t){this.state.update("$data.chart.items",t)}prepareDependantItems(t,e){return this.getChildrenDependantItemsIds(t,e).filter((e=>e!==t.id))}prepareItem(t,e=this.state.get().config.chart.item.height,o=this.getItemsData(),i=this.getAllItems(),a=this.getAllRows()){let s=t.id;if(s=String(s),t.id=s,o[t.id]||(o[t.id]={id:t.id,actualHeight:0,outerHeight:0,time:null,position:{left:0,actualLeft:0,right:0,actualRight:0,rowTop:t.rowTop||0,actualRowTop:t.actualRowTop||0,top:0,viewTop:0},outOfView:{left:!1,right:!1,whole:!1},width:-1,actualWidth:-1,timeWidth:-1,detached:!1,linkedWith:[],dependant:this.getChildrenDependantItemsIds(t,i)}),t.time||console.error("There is something wrong with this item.",t),"number"!=typeof t.time.start||"number"!=typeof t.time.end)throw new Error('[gantt-schedule-timeline-calendar] Item "time.start" and "time.end" values should be a number (unix epoch milliseconds).');const n=t.rowId;if("string"!=typeof n)throw new Error('[gantt-schedule-timeline-calendar] Item "rowId" should be a string.');if(!n.startsWith("gstcid-"))throw new Error('[gantt-schedule-timeline-calendar] Item "rowId" should start with "gstcid-".');if(!a[n])throw new Error(`[gantt-schedule-timeline-calendar] Row for item "${t.id}" does not exists ("${n}"). TIP: Try updating the rows first to make sure the rows for the items exist.`);t.time.start=+t.time.start,t.time.end=+t.time.end,t.id=String(t.id);const l=this.state.get().config.chart.item;"number"!=typeof t.height&&(t.height=e),o[t.id].time=function(t,e,o){let i,a;return{get startDate(){return i||(i=o.time.date(t)),i},get endDate(){return a||(a=o.time.date(e)),a},set startDate(e){i=e,t=e.valueOf()},set endDate(t){a=t,e=t.valueOf()}}}(t.time.start,t.time.end,this),o[t.id].actualHeight=t.height,void 0===t.overlap&&(t.overlap=l.overlap),"number"!=typeof t.top&&(t.top=0),t.gap||(t.gap={}),"number"!=typeof t.gap.top&&(t.gap.top=l.gap.top),"number"!=typeof t.gap.bottom&&(t.gap.bottom=l.gap.bottom),"number"!=typeof t.minWidth&&(t.minWidth=l.minWidth),o[t.id].outerHeight=o[t.id].actualHeight+t.gap.top+t.gap.bottom,o[t.id].position.actualRowTop=o[t.id].position.rowTop+t.gap.top}prepareItems(t){const e=this.state.get("config.chart.item.height"),o=this.getItemsData(),i=S(this);i.itemsAsArray.length=0,i.itemsDataAsArray.length=0;for(const a in t){const s=t[a];this.prepareItem(s,e,o,t),i.itemsAsArray.push(t[a]),i.itemsDataAsArray.push(o[a])}return this.collectAllLinkedItems(),t}sortRowsByChildren(t,e={},o=this.state.get("config.list.rows"),i=this.state.get("$data.list.rows")){for(const a of t){const t=o[a],s=i[a],n=t.parentId&&e[t.parentId]||!t.parentId;!e[a]&&n&&(e[a]=t),s.children.length&&this.sortRowsByChildren(s.children,e,o,i)}return e}getSortableValue(t,e){return"string"==typeof t?e[t]:"function"==typeof t?t({row:e,vido:this.vido}):""}sortRowsByColumn(t,e=!0){const o=this.state.get("config.list.sort.compare");let i=this.getAllRows();const a=S(this);if(0===a.allRowsIds.length)return i;const s=a.allRowsAsArray;o?s.sort(o(t)):s.sort(((o,i)=>{const a=this.getSortableValue(t.sortable,o),s=this.getSortableValue(t.sortable,i);return"number"==typeof a?e?a-s:s-a:"string"==typeof a?e?a.localeCompare(s):s.localeCompare(a):void 0}));const n=s.map((t=>t.id)),l=this.getRowsData();for(const t of n){const e=l[t];e.children&&e.children.length&&e.children.sort(((t,e)=>n.indexOf(t)-n.indexOf(e)))}i=this.sortRowsByChildren(n),this.state.update("config.list.rows",i,{data:"sortRowsByColumn"});const r=this.getScrollTop();return this.state.get("config.scroll.vertical.byPixels")?this.setScrollTop(r.absolutePosPx):this.setScrollTop(r.dataIndex,r.preciseOffset),i}fillEmptyRowValues(t){const e=this.state.get("config.list.row.height"),o=this.getRowsData();let i=0;for(let a in t){const s=t[a];let n=o[a];if(a=String(a),s.id=a,"string"!=typeof a)throw new Error('[gantt-schedule-timeline-calendar] Row "id" must be a string.');if(!a.startsWith("gstcid-"))throw new Error(`[gantt-schedule-timeline-calendar] Row "id" should start with "gstcid-" (your row id: "${a}").`);if(a.startsWith("gstcid-gstcid-"))throw new Error(`[gantt-schedule-timeline-calendar] Your row "id" is wrapped more than once. It should look like this "gstcid-something" and it looks like this: "${a}".`);o[a]||(n={id:s.id,parentId:s.parentId,parents:[],children:[],allChildren:[],position:{top:0,bottom:0},items:[],itemsOrder:[],itemsTimeSectors:[],actualHeight:0,outerHeight:0,parentsExpanded:!0,inView:!0,overlappingCalculated:!1}),"number"!=typeof s.height&&(s.height=e),n.actualHeight=s.height,"boolean"!=typeof s.expanded&&(s.expanded=!1),n.position.top=i,"object"!=typeof s.gap&&(s.gap={}),"number"!=typeof s.gap.top&&(s.gap.top=0),"number"!=typeof s.gap.bottom&&(s.gap.bottom=0),void 0===s.visible&&(s.visible=!0),n.outerHeight=n.actualHeight+s.gap.top+s.gap.bottom,o[a]=n,i+=n.outerHeight}return t}itemsOnTheSameLevel(t,e){const o=t.position.rowTop+t.outerHeight,i=e.position.rowTop+e.outerHeight;return e.position.rowTop<=t.position.rowTop&&i>t.position.rowTop||(e.position.rowTop>=t.position.rowTop&&e.position.rowTop<o||e.position.rowTop>=t.position.rowTop&&i<o)}itemsTimeOverlaps(t,e){return e.time.start>=t.time.start&&e.time.start<=t.time.end||(e.time.end>=t.time.start&&e.time.end<=t.time.end||(e.time.start>=t.time.start&&e.time.end<=t.time.end||e.time.start<=t.time.start&&e.time.end>=t.time.end))}itemsOverlaps(t,e,o,i){const a=e.time.start&&t.time.start&&e.time.end&&t.time.end;return t.id!==e.id&&a&&this.itemsOnTheSameLevel(o,i)&&this.itemsTimeOverlaps(t,e)}itemOverlapsWithOthers(t,e,o=0){const i=this.getItemsData();for(let a=o,s=e.length;a<s;a++){const o=e[a];if(this.itemsOverlaps(t,o,i[t.id],i[o.id]))return o}return null}makeChildren(t,e={parents:[]}){if("object"!=typeof t)return[];t.children||(t.children=[]),t.allChildren||(t.allChildren=[]),t.parents||(t.parents=[...e.parents]),t.parentId&&"undefined"!==t.parentId&&t.parents.push(t.parentId);for(const e in t)if("id"!==e&&"parentId"!==e&&"children"!==e&&"allChildren"!==e&&"parents"!==e){"undefined"!==e&&(t.children.push(e),t.allChildren.push(e));const o=t[e];if("object"!=typeof o)continue;const i=this.makeChildren(o,t);t.allChildren.splice(t.allChildren.length,0,...i)}return t.allChildren}clearNested(t){for(const e in t)"object"!=typeof t[e]||Array.isArray(t[e])||this.clearNested(t[e]),this.keysToKeep.includes(e)||delete t[e],"parentId"===e&&"undefined"===t[e]&&(t[e]=void 0);return t}fastTree(t,e=null){var o,i;if(!e){e={undefined:{},id:"undefined"};for(const i in t){const a=t[i];e[a.id]||(e[a.id]={parentId:null!==(o=a.parentId)&&void 0!==o?o:"undefined",id:a.id})}}for(const t in e){const o=e[t];e[null!==(i=o.parentId)&&void 0!==i?i:"undefined"][o.id]=o}this.makeChildren(e[void 0]),delete e[void 0],delete e.id,delete e.parents,delete e.children,delete e.allChildren;for(const t in e)e[t]=this.clearNested(e[t]);return e}updateRowItemsAndItemRowMapForItem(t,e,o,i,a){var s,n,l;if(void 0===o&&(o=null===(s=this.state.get().$data)||void 0===s?void 0:s.itemRowMap),void 0===i&&(i=null===(l=null===(n=this.state.get().$data)||void 0===n?void 0:n.list)||void 0===l?void 0:l.rows),void 0===a&&(a=this.state.get().config.chart.items),!i[e])return;i[e].items||(i[e].items=[]);const r=o[t];r!==e&&(r&&i[r]&&(i[r].items=i[r].items.filter((e=>e!==t)).sort(((t,e)=>a[t].time.start-a[e].time.start))),o[t]=e,i[e].items.includes(t)||(i[e].items.push(t),this.timeSectorsItemsAddOrUpdate([a[t]],i[e].itemsTimeSectors)),r&&e!==r&&(i[r]&&(i[r].overlappingCalculated=!1),i[e]&&(i[e].overlappingCalculated=!1),this.timeSectorsDeleteItems([t],i[r].itemsTimeSectors)))}sortRowItemsInAddOrder(t,e){e.itemsOrder=e.items.slice(),e.itemsOrder.sort(((e,o)=>t[e]-t[o]))}sortRowItemsByTime(t){t.items=t.items.sort(((t,e)=>this.getItem(t).time.start-this.getItem(e).time.start))}makeTreeMap(t,e,o=!1){let i=this.state.get("$data.treeMap");if(!o||!i){i=this.fastTree(t);for(const e in t){const o=t[e],a=i[e];for(const t in a)o[t]=a[t]}}const a=this.state.get("$data.reloading")?{}:this.state.get("$data.itemRowMap"),s={};let n=0;const l=this.getAllItems();for(const t of e){const e=l[t];s[e.id]=n,this.updateRowItemsAndItemRowMapForItem(e.id,e.rowId,a),n++}for(const e in t){const o=t[e];this.sortRowItemsInAddOrder(s,o),o.itemsTimeSectors=this.timeSectorsGenerate(this.getItems(o.items))}return this.state.update("$data.itemRowMap",a),o||this.state.update("$data.treeMap",i),t}_updateRowsWithParentsExpandedCache(t){const e=S(this);e.rowsIdsWithParentsExpanded.length=0,e.rowsIdsWithParentsExpanded.splice(0,0,...t),e.rowsWithParentsExpanded.length=0,e.rowsDataWithParentsExpanded.length=0,e.rowsWithParentsExpandedDataIndexMap.clear();const o=this.state.get("config.list.rows"),i=this.state.get("$data.list.rows");e.rowsWithParentsExpandedAsMap.clear();let a=0;for(const t of e.rowsIdsWithParentsExpanded){const s=o[t];s&&(e.rowsWithParentsExpanded.push(s),e.rowsWithParentsExpandedAsMap.set(t,s),e.rowsDataWithParentsExpanded.push(i[t]),e.rowsWithParentsExpandedDataIndexMap.set(t,a),a++)}}generateRowsWithParentsExpanded(t){const e=[],o=this.getRowsData();t:for(const i in t){if(!o[i]||!o[i].parents)return[];if(this.isRowVisible(i)){for(const e of o[i].parents){const o=t[e];if(!o||!o.expanded)continue t}e.push(i)}}return this._updateRowsWithParentsExpandedCache(e),e}getRowInfoFromTop(t){const e=this.state.get("config.list.rows"),o=this.state.get("$data.list.rows"),i=this.getRowPositionMapNode(t);return{dataIndex:i.dataIndex,row:e[i.id],rowData:o[i.id]}}getRowViewTop(t,e=this.state.get("$data.list.rows"),o=this.state.get("$data.scroll.vertical")){return e[t].position.top-o.absolutePosPx-o.preciseOffset}parentsExpanded(t){return S(this).rowsWithParentsExpandedAsMap.has(t)}setAllRowsIdsCache(t){const e=S(this);e.allRowsIds=t;const o=this.state.get("config.list.rows");e.allRowsAsArray.length=0;for(const i of t)e.allRowsAsArray.push(o[i])}resetRowsOverlappingCalculated(t=this.getRowsData()){for(const e in t)t[e].overlappingCalculated=!1}timeSectorItemFits(t,e){return t.time.start>=e.from&&t.time.start<=e.to||t.time.end>=e.from&&t.time.end<=e.to||t.time.start<=e.from&&t.time.end>=e.to}timeSectorsGenerate(t,e=this.state.get().$data.chart.time,o=10){const i=[];if(e.from===e.to)return i;const a=this,s=Math.ceil((e.to-e.from)/o);for(let n=0;n<o;n++){const o={from:e.from+s*n,to:e.from+s*(n+1)-1,items:[],get fromDate(){return a.time.date(this.from)},get toDate(){return a.time.date(this.to)}};for(const e of t)this.timeSectorItemFits(e,o)&&o.items.push(e.id);i.push(o)}return i}timeSectorsItemsAddOrUpdate(t,e){for(const o of e)for(const e of t)if(this.timeSectorItemFits(e,o)){if(o.items.includes(e.id))continue;o.items.push(e.id)}else o.items=o.items.filter((t=>t!==e.id));return e}timeSectorsDeleteItems(t,e){for(const o of e)o.items=o.items.filter((e=>!t.includes(e)));return e}timeSectorsGenerateForRows(t=!1,e=this.getRowsData(),o=this.state.get().$data.chart.time,i=10){if(o.from===o.to)return e;const a=this.state.get().$data.list.rowsIds;for(const s of a){const a=e[s];!t&&a.itemsTimeSectors&&0!==a.itemsTimeSectors.length||(a.itemsTimeSectors=this.timeSectorsGenerate(this.getItems(a.itemsOrder),o,i))}return e}fixOverlappedItemsByTimeSectors(t){if(t.overlappingCalculated)return;if(this.isMutedMethod("fixOverlapped"))return;const e=this.getItemsData(),o=t.itemsTimeSectors=this.timeSectorsGenerate(this.getItems(t.itemsOrder)),i=this.getItems(t.items);for(const t of i){if(t.overlap)continue;const o=e[t.id];o&&(o.position.rowTop=t.top)}for(const t of o){const o=t.items,i=this.getItems(o);let a=0;for(const t of i){if(t.overlap)continue;const o=e[t.id];if(!o)continue;o.position.actualRowTop=o.position.rowTop+t.gap.top;let s=this.itemOverlapsWithOthers(t,i,a);if(s)for(;s;){const e=this.getItemData(s.id),n=i.findIndex((t=>t.id===s.id));n<a?(o.position.rowTop+=e.outerHeight,o.position.actualRowTop=o.position.rowTop+t.gap.top):(e.position.rowTop+=o.outerHeight,e.position.actualRowTop=e.position.rowTop+s.gap.top),s=this.itemOverlapsWithOthers(t,i)}a++}}o.length>0&&(t.overlappingCalculated=!0)}recalculateRowHeight(t,e){if(!e||!t||!t.gap)return 0;let o=0;const i=this.getItemsData();if(!i)return 0;if(!1===t.visible)return e.actualHeight=0,e.outerHeight=0,0;const a=this.getItems(e.itemsOrder);this.fixOverlappedItemsByTimeSectors(e);for(const t of a){const e=i[t.id];o=Math.max(o,e.position.rowTop+e.outerHeight)}return o<t.height&&(o=t.height),e.actualHeight=o,e.outerHeight=e.actualHeight+t.gap.top+t.gap.bottom,e.outerHeight}calculateVisibleRowsHeights(){var t;if(this.isMutedMethod("calculateVisibleRowsHeights"))return!1;const e=this.state.get("$data.list.visibleRows");let o=0;const i=this.getAllRows(),a=this.getRowsData();let s=!1;for(const n of e){const e=(null===(t=a[n])||void 0===t?void 0:t.outerHeight)||0,l=this.recalculateRowHeight(i[n],a[n]);e!==l&&(s=!0),o+=l}return this.state.update("$data.list.visibleRowsHeight",o),s&&this.measureRows(),s}getRealChartHeight(t=!0){const e=this.state.get("$data.scroll.vertical.preciseOffset")||0,o=t?this.state.get("config.innerHeight"):this.state.get("$data.chart.dimensions.heightWithoutScrollBar"),i=this.state.get("config.additionalSpace");return o-i.top-i.bottom+-1*e}getLastRowId(t=S(this).rowsIdsWithParentsExpanded,e=this.state.get("$data.scroll.vertical")){return t[this.getLastRowIndex(t,e)]}getLastRowIndex(t=S(this).rowsIdsWithParentsExpanded,e=this.state.get("$data.scroll.vertical")){return t.length-e.lastPageCount}generateRowsPositionsMap(t,e=0,o={id:"",dataIndex:0,keys:[]}){if(0===t.length)return o;if(1===t.length)return o[t[0].position.top]={id:t[0].id,dataIndex:e,keys:[]},o.keys=[t[0].position.top],o;const i=Math.floor(t.length/2),a=e,s=e+i,n=t.slice(1,i),l=t.slice(i+1);o.keys.push(t[0].position.top),o.keys.push(t[i].position.top);const r=o[t[0].position.top]={id:t[0].id,dataIndex:a,keys:[]},c=o[t[i].position.top]={id:t[i].id,dataIndex:s,keys:[]};return this.generateRowsPositionsMap(n,a+1,r),this.generateRowsPositionsMap(l,s+1,c),o}getRowPositionMapNode(t,e=S(this).rowsPositionsMap){return t>=e.keys[1]?this.getRowPositionMapNode(t,e[e.keys[1]]):t>=e.keys[0]?this.getRowPositionMapNode(t,e[e.keys[0]]):e}measureRows(t=!1){if(this.isMutedMethod("measureRows"))return;const e=this.state.get("$data.scroll.vertical"),o=this.state.get("config.list.rows"),i=this.getRealChartHeight(),a=this.getRowsData(),s=S(this);if(void 0===e.dataIndex)return[];const n=this.state.get("$data.list.rowsIds");let l=0;if(e.data&&(l=s.rowsWithParentsExpandedDataIndexMap.get(e.data.id),-1===l)){const t=this.getLastRowId(s.rowsIdsWithParentsExpanded,e);l=s.rowsWithParentsExpandedDataIndexMap.get(t)}let r=0,c=0,d=0;for(let h=n.length;d<h;d++){const h=n[d],u=s.rowsWithParentsExpandedAsMap.has(h),m=this.getRowViewTop(h,a,e),f=d>=l&&m<=i,g=a[h];if(!g)return[];t&&(g.overlappingCalculated=!1),this.recalculateRowHeight(o[h],g),g.inView=f,g.parentsExpanded=u,g.position.top=r,c=r+g.outerHeight,g.position.bottom=c,u&&(r+=g.outerHeight)}return s.rowsPositionsMap=this.generateRowsPositionsMap(s.rowsDataWithParentsExpanded),this.state.update("$data.list.rows",a,{data:"measureRows"}),this.state.update("$data.list.rowsHeight",c),this.state.update("$data.scroll.vertical.absoluteSize",c),c}isRowVisible(t,e=this.getAllRows(),o=this.getRowsData()){if(!e[t])return!1;if(!1===e[t].visible)return!1;if(!o[t])return!1;const i=o[t].parents;for(const t of i)if(!e[t]||!1===e[t].visible)return!1;return!0}getVisibleRows(){const t=this.state.get("$data.scroll.vertical"),e=S(this),o=e.rowsIdsWithParentsExpanded,i=this.getRowsData();if(!t.data)return[];const a=this.getRealChartHeight();if(!a)return[];let s=e.rowsWithParentsExpandedDataIndexMap.get(t.data.id);-1!==s&&void 0!==s||(s=t.dataIndex>e.rowsDataWithParentsExpanded.length-1?o.length-t.lastPageCount:t.dataIndex);const n=[];let l,r;for(let e=s,c=o.length;e<c;e++){const s=o[e];if(i[s]&&(r=i[s],l=this.getRowViewTop(s,i,t),l>=0&&l<=a?(n.push(s),r.parentsExpanded=!0):r.parentsExpanded=!1,l>a))break}return n}normalizeMouseWheelEvent(t){let e=t.deltaX||0,o=t.deltaY||0,i=t.deltaZ||0;const a=t.deltaMode,s=this.state.get("config.list.rowHeight");let n=1;switch(a){case 1:s&&(n=s);break;case 2:n=window.height}return e*=n,o*=n,i*=n,{x:e,y:o,z:i,event:t}}resetHorizontalScroll(t=this.state.get("$data.scroll.horizontal")){t.data=null,t.dataId="",t.dataIndex=0,t.handlePosPx=0,t.absolutePosPx=0,t.preciseOffset=0;const e=this.state.get("$data.chart.time");if(!e.allDates||!e.allDates.length)return;const o=e.allDates[e.level];if(!o||!o.length)return;const i=o[0];return t.data=Object.assign({},i),t.dataId=i.id,t}resetVerticalScroll(t=this.state.get("$data.scroll.vertical")){return t.data=null,t.dataId="",t.dataIndex=0,t.handlePosPx=0,t.absolutePosPx=0,t.preciseOffset=0,t.data=null,t.dataId=null,t}limitHorizontalScrollToView(t=this.state.get("$data.chart.time")){const e=this.state.get("$data.scroll.horizontal");if(!t.allDates||!t.allDates.length)return;const o=t.allDates[t.level].length-e.lastPageCount;e.dataIndex>o&&this.setScrollLeft(o,0,t)}calculateHorizontalScrollPosPxFromDates(t,e=0,o=this.state.get("$data.scroll.horizontal"),i=this.state.get("$data.chart.time")){if(i.calculatedZoomMode)return 0;if(void 0===t&&(t=0),!i.allDates||!i.allDates.length)return;const a=i.allDates[i.level];if(!a||!a.length)return;let s,n=0,l=0;if("number"==typeof t||""===t){""===t&&(t=0),l=t,s=a[l],s||(l=0,s=a[l]);const e=i.allDates[i.level].length-o.lastPageCount;l>e&&e>=0&&(l=e,s=a[l])}else if("string"==typeof t)for(let e=0;e<a.length;e++){const o=a[e];if(o.id===t){s=o,l=e;break}}if(!s&&o.data)for(let t=0;t<a.length;t++){const e=a[t];if(e.leftGlobal>=o.data.leftGlobal){s=e,l=t;break}}if(s||(l>0?(l=a.length-1,s=a[l]):(s=a[0],l=0)),l>a.length-o.lastPageCount&&(l=a.length-o.lastPageCount,s=a[l]),o.data=Object.assign({},s),n=s.leftPx-e,o.dataIndex=l,o.dataId=s.id,n){const t=n/o.absoluteSizeWithoutLastPage*o.maxHandlePosPx;o.handlePosPx=Math.max(t,0)}else o.handlePosPx=0;return o.handlePosPx>o.maxHandlePosPx&&(o.handlePosPx=Math.max(o.maxHandlePosPx,0)),o.preciseOffset=e,o.maxHandlePosPx>0?o.percent=o.handlePosPx/o.maxHandlePosPx*100:o.percent=0,o.absolutePosPx=Math.max(n,0),o}setScrollLeftByPixels(t){const e=this.state.get("$data.chart.time"),o=e.allDates[e.level];return o&&o.length?(t<0&&(t=0),this.state.update("$data.scroll.horizontal",(i=>{t>i.absoluteSizeWithoutLastPage&&(t=i.absoluteSizeWithoutLastPage);let a=0;const s=Math.round(t);let n;for(n of o){if(Math.round(n.rightPx)>s)break;a++}return i.dataIndex=a,i.dataId=n.id,i.preciseOffset=n.leftPx-t,this.calculateHorizontalScrollSizeAndPosFromDates(e.totalViewDurationPx,e,i,!1),t=i.absolutePosPx,i}),{data:"set-scroll-left"}),t):0}setScrollLeft(t,e=0,o=this.state.get("$data.chart.time")){if(o.calculatedZoomMode)return 0;if(this.state.get("config.scroll.horizontal.byPixels")){if("number"!=typeof t)throw new Error("When 'config.scroll.horizontal.byPixels' is true, 'dataIndexOrDateId' must be a number.");return t<0&&(t=0),this.setScrollLeftByPixels(t)}let i=0;const a=o.allDates[o.level];return a&&a.length?(this.state.update("$data.scroll.horizontal",(s=>{let n,l;if("number"==typeof t||""===t)n=t,l=a[n];else if("string"==typeof t)for(let e=0;e<a.length;e++)if(a[e].id===t){l=a[e],n=e;break}return l||(n>0?(n=a.length-1,l=a[n]):(n=0,l=a[0])),s.dataIndex=n,s.dataId=l.id,s.preciseOffset=e,this.calculateHorizontalScrollSizeAndPosFromDates(o.totalViewDurationPx,o,s,!1),i=s.absolutePosPx,s}),{data:"set-scroll-left"}),i):0}scrollToTime(t,e=!0){const o=this.state.get("$data.chart.time");if(o.calculatedZoomMode)return 0;if(!o.allDates)return 0;const i=this.time.findDateAtTime(t,o.allDates[o.level]);if(!i)return console.warn(`[gstc.api.scrollToTime] Time out of bounds (${t} -> ${this.time.date(t).format("YYYY-MM-DD HH:mm:ss")}).`),0;let a,s=0,n=0;if(e){const e=this.getChartWidth(!0)/2;n=(t-i.leftGlobal)/o.timePerPixel,i.rightPx<e&&(n=0);const l=-(e-n);if(a=this.time.getMainDateFromRelativePosition(i,l),!a)return console.warn(`[gstc.api.scrollToTime] Time out of bounds (${t} -> ${this.time.date(t).format("YYYY-MM-DD HH:mm:ss")}).`),0;s=o.allDates[o.level].indexOf(a)}else s=o.allDates[o.level].indexOf(i),n=(t-i.leftGlobal)/o.timePerPixel,a=i;if(-1===s)return 0;return this.state.get("config.scroll.horizontal").byPixels?this.setScrollLeft(a.leftPx+(e?a.width/2:0)):this.setScrollLeft(s,-n)}getScrollLeft(){return this.state.get("$data.scroll.horizontal")}getScrollSize(t){const e=this.state.get("$data.scroll.vertical.visible")?this.state.get("$data.chart.dimensions.widthWithoutScrollBar"):this.state.get("$data.chart.dimensions.width"),o=this.state.get("$data.scroll.horizontal.visible")?this.state.get("$data.chart.dimensions.heightWithoutScrollBar"):this.state.get("$data.chart.dimensions.innerHeight"),i=this.state.get("config.additionalSpace");return"horizontal"===t?e:o-i.top-i.bottom}getLastPageDatesWidth(t,e){let o=0,i=0;if(0===e.length)return{lastPageSize:o,lastPageCount:i};const a=this.state.get("config.scroll.horizontal"),s=a.byPixels||a.precise;for(let a=e.length-1;a>=0;a--){const s=e[a];if(o+=s.width,o>=t){o-=s.width;break}i++}return 0===o&&(o=t),s&&(o=t),{lastPageSize:o,lastPageCount:i}}calculateInitialChartWidth(t=!1){const e=this.state.get("config.initialWidth"),o=this.state.get("config.list.columns.data");let i=0;for(const t in o){i+=o[t].width}let a=e-i;return t&&(a-=this.state.get("config.scroll.horizontal.width")||0),a}getChartWidth(t=!1){let e=t?this.state.get("$data.chart.dimensions.widthWithoutScrollBar"):this.state.get("$data.chart.dimensions.width");return e||(e=this.calculateInitialChartWidth(t)),e}isHorizontalScrollVisible(t){const e=this.state.get("$data.scroll.horizontal");if(null!==e.data)return e.visible;const o=this.state.get("config.scroll.horizontal"),i=this.state.get("$data.chart.time"),a=i.totalViewDurationPx,s=this.getChartWidth(t),n=i.allDates[i.level];if(!n||!n.length)return!1;const{lastPageSize:l,lastPageCount:r}=this.getLastPageDatesWidth(s,n),c=this.getScrollSize("horizontal");let d=l/a*c;d<o.minInnerSize&&(d=o.minInnerSize);return!(r===n.length||c===d)}calculateHorizontalScrollSizeAndPosFromDates(t,e=this.state.get("$data.chart.time"),o=this.state.get("$data.scroll.horizontal"),i=!0){if(!e.allDates.length)return;const a=e.allDates[e.level],s=this.state.get("$data.scroll.vertical.visible"),n=this.getChartWidth(s),l=t,{lastPageSize:r,lastPageCount:c}=this.getLastPageDatesWidth(n,a),d=l-r,h=this.state.get("config.scroll.horizontal"),u=this.getScrollSize("horizontal");let m=r/l*u;m<h.minInnerSize&&(m=h.minInnerSize);const f=o.visible,g=!(c===a.length||u===m),p=Math.max(u?u-m:0,0);return o.absoluteSize=l,o.absoluteSizeWithoutLastPage=Math.max(d,0),o.innerHandleSize=m,o.maxHandlePosPx=p,o.scrollSize=g?u:0,o.lastPageCount=c,o.lastPageSize=r,o.visible=g,this.calculateHorizontalScrollPosPxFromDates(o.dataId,o.preciseOffset,o,e),i&&this.state.update("$data.scroll.horizontal",o),f!==g&&this.calculateVerticalScrollSize(),o}getLastPageRowsHeight(t,e){let o=0,i=0;const a=this.state.get("config.additionalSpace"),s=t-a.top-a.bottom;if(0===e.length)return{lastPageSize:o,lastPageCount:i};const n=this.getRowsData();for(let t=e.length-1;t>=0;t--){const a=n[e[t]];if(o+=a.outerHeight,o>=s){o-=a.outerHeight;break}i++}0===o&&(o=t);const l=this.state.get("config.scroll.vertical");return(l.byPixels||l.precise)&&(o=t),{lastPageSize:o,lastPageCount:i}}calculateVerticalScrollSize(){const t=this.state.get("$data.list.rowsWithParentsExpanded"),e=this.state.get("$data.list.rowsHeight"),o=this.isHorizontalScrollVisible(!0)?this.state.get("$data.chart.dimensions.heightWithoutScrollBar"):this.state.get("$data.chart.dimensions.innerHeight"),{lastPageSize:i,lastPageCount:a}=this.getLastPageRowsHeight(o,t),s=this.state.get("config.scroll.vertical"),n=o;let l=i/e*n;l<s.minInnerSize&&(l=s.minInnerSize);const r=!(a===t.length||n===l),c=n-l;this.state.update("$data.scroll.vertical",(o=>{if(o.absoluteSize=e,o.absoluteSizeWithoutLastPage=e-i,o.innerHandleSize=l,o.maxHandlePosPx=c,o.scrollSize=r?n:0,o.lastPageCount=a,o.lastPageSize=i,o.handlePosPx>c&&(o.handlePosPx=c),o.dataIndex>t.length-a){const e=this.getAllRows(),i=this.getRowsData();o.dataIndex=t.length-a;const s=t[o.dataIndex];e&&s?(o.data=e[s],o.dataId=o.data.id,o.absolutePosPx=i[s].position.top):(o.dataIndex=0,o.dataId="",o.data=null,o.handlePosPx=0,o.absolutePosPx=0),o.preciseOffset=0}else{const e=this.getRowsData(),i=t[o.dataIndex];e[i]&&(o.data=e[i],o.dataId=i,o.absolutePosPx=o.data.position.top-o.preciseOffset)}return o.visible=r,o}))}setScrollTopByPixels(t){const e=S(this),o=this.state.get("$data.scroll.vertical.absoluteSizeWithoutLastPage");t>o&&(t=o);let{dataIndex:i,row:a,rowData:s}=this.getRowInfoFromTop(t);if(!s)return;const n=s.position.top-t;return this.state.update("$data.scroll.vertical",(o=>{const l=e.rowsWithParentsExpanded.length-o.lastPageCount;if(i>l){if(i=l,a=e.rowsWithParentsExpanded[i],!a&&(i=0,a=e.rowsWithParentsExpanded[i],!a))return t=0,this.resetVerticalScroll(o);s=this.getRowData(a.id)}return o.data=e.rowsWithParentsExpanded[i],o.dataId=o.data.id,o.preciseOffset=n,o.handlePosPx=t?Math.round(t/o.absoluteSizeWithoutLastPage*o.maxHandlePosPx):0,o.handlePosPx>o.maxHandlePosPx&&(o.handlePosPx=o.maxHandlePosPx),o.percent=o.handlePosPx/o.maxHandlePosPx*100,o.dataIndex=i,o.absolutePosPx=t,o}),{data:"set-scroll-top"}),t}setScrollTop(t=0,e=0){if(this.state.get("config.scroll.vertical.byPixels")){if("number"!=typeof t)throw new Error("When 'config.scroll.vertical.byPixels' is true, 'dataIndexOrRowId' must be a number.");return t<0&&(t=0),this.setScrollTopByPixels(t)}const o=S(this),i=o.rowsIdsWithParentsExpanded;let a,s,n=0;if("string"==typeof t){const e=t;if(a=this.getRow(e),s=this.getRowData(a.id),this.parentsExpanded(e))n=i.indexOf(e);else for(const t of s.parents)this.parentsExpanded(t)&&(n=i.indexOf(t));if(!a)throw new Error(`Row with id: '${e}' not found. Maybe use GSTC.api.GSTCID(id) or check if row exists.`)}else{if("number"!=typeof t)throw new Error("[gstc.api.setScrollTop] Wrong dataIndex value. Must be `string` (for `rowId`) or `number` (for array index) only.");if(n=t,o.rowsWithParentsExpanded[n]||0===n||(n=0),!o.rowsWithParentsExpanded[n])return;a=o.rowsWithParentsExpanded[n],s=this.getRowData(a.id)}let l=0;return this.state.update("$data.scroll.vertical",(t=>{const i=o.rowsWithParentsExpanded.length-t.lastPageCount;if(n>i){if(n=i,a=o.rowsWithParentsExpanded[n],!a&&(n=0,a=o.rowsWithParentsExpanded[n],!a))return l=0,this.resetVerticalScroll(t);s=this.getRowData(a.id)}return l=s.position.top-e,t.data=o.rowsWithParentsExpanded[n],t.dataId=t.data.id,t.preciseOffset=e,t.handlePosPx=l?Math.round(l/t.absoluteSizeWithoutLastPage*t.maxHandlePosPx):0,t.handlePosPx>t.maxHandlePosPx&&(t.handlePosPx=t.maxHandlePosPx),t.percent=t.handlePosPx/t.maxHandlePosPx*100,t.dataIndex=n,t.absolutePosPx=l,t}),{data:"set-scroll-top"}),l}getScrollTop(){return this.state.get("$data.scroll.vertical")}getCurrentCalendarLevels(){return this.state.get("$data.chart.time.levels")}getGridCells(t=void 0){const e=this.state.get("$data.chart.grid.cells");if(!e)return[];if(void 0!==t){const o=t.length,i=new Array(o);for(let a=0;a<o;a++)i[a]=e[t[a]];return i}return Object.values(e)}getAllGridCells(){return this.state.get("$data.chart.grid.cells")}getGridRows(t=void 0){const e=this.state.get("$data.chart.grid.rows");return void 0!==t?e?Object.values(e).filter((e=>t.includes(e.row.id))):[]:e?Object.values(e):[]}getAllGridRows(){return this.state.get("$data.chart.grid.rows")}getGridCell(t){return this.state.get(`$data.chart.grid.cells.${t}`)}getGridRow(t){return this.state.get(`$data.chart.grid.rows.${t}`)}muteMethod(t){this.mutedMethods.add(t)}unmuteMethod(t){this.mutedMethods.delete(t)}isMutedMethod(t){return this.mutedMethods.has(t)}getSVGIconSrc(t){return"string"==typeof this.iconsCache[t]||(this.iconsCache[t]="data:image/svg+xml;base64,"+btoa(t)),this.iconsCache[t]}destroy(){for(const t of this.unsubscribes)t();this.unsubscribes=[],this.debug&&delete window.state}}
/**
 * ScrollBar component
 *
 * @copyright NEURONET - Rafal Pospiech
 * @author    Rafal Pospiech <neuronet.io@gmail.com>
 * @module    gantt-schedule-timeline-calendar
 * @link      https://github.com/neuronetio/gantt-schedule-timeline-calendar
 * @link      https://gantt-schedule-timeline-calendar.neuronet.io
 * @version   3.40.5
 * @released  2025-03-24
 * @license   SEE LICENSE IN LICENSE FILE
 */function G(t,e){const{onDestroy:o,state:i,cache:s,api:n,html:l,StyleMap:r,Actions:c,update:d}=t,h="scroll-bar";let u,m,f="",g="";o(i.subscribe("config.classNames",(()=>{u=n.getClass(h),m=n.getClass(h+"-inner")})));const p="horizontal"===e.type?"height":"width",w="height"===p?"width":"height",b="horizontal"===e.type?"left":"top",v=new r({}),y=new r({}),P={maxPosPx:0,innerHandleSize:0,scrollSize:0,dataId:""};o(i.subscribeAll("horizontal"===e.type?[`config.scroll.${e.type}`,`$data.scroll.${e.type}`]:[`config.scroll.${e.type}`,`$data.scroll.${e.type}`,"$data.chart.dimensions.heightWithoutScrollBar","$data.list.rowsWithParentsExpanded","$data.list.rowsHeight","config.additionalSpace"],(function(t,o){const a=i.get(`config.scroll.${e.type}`),s=i.get(`$data.scroll.${e.type}`),l=n.getScrollSize(e.type),r=s.innerHandleSize,c=s.maxHandlePosPx,h=s.dataId,u=i.get("config.additionalSpace"),m=i.get("$data.chart.time");if(!m.allDates||!m.allDates.length||!m.allDates[m.level])return;if(s.visible?v.style.display="flex":v.style.display="none",v.style[p]=a.width+"px",v.style[w]=l+"px","vertical"===e.type&&(v.style.top=i.get("config.headerHeight")+u.top+"px"),!s.lastPageSize||!s.absoluteSize||!l)return;y.style[p]="100%",y.style[w]=r+"px";!("set-scroll-top"===o.options.data||"set-scroll-left"===o.options.data)&&function(t,e,o,i){const a=P.maxPosPx!==t||P.innerHandleSize!==e||P.scrollSize!==o||P.dataId!==i;return a&&(P.maxPosPx=t,P.innerHandleSize=e,P.scrollSize=o,P.dataId=i),a}(c,r,l,h)&&("horizontal"===e.type?a.byPixels?n.setScrollLeft(s.absolutePosPx):n.setScrollLeft(s.dataIndex,s.preciseOffset):a.byPixels?n.setScrollTop(s.absolutePosPx):n.setScrollTop(s.dataIndex,s.preciseOffset)),d()}),{group:!0,bulkValue:!1}));const D=n.getActions(h);D.push(class extends a{constructor(t){super();const o=`$data.elements.scroll-bar--${e.type}`;i.get(o)||i.update(o,t,{only:null})}update(){}destroy(){}});const x={api:n,state:i,props:e,componentName:h},C=c.create(D,x),W=[class extends a{constructor(t){super(),this.moving=!1,this.initialPointerPos=0,this.initialHandlePos=0,this.currentPos=0,this.currentPointerPos=0,this.lastDataIndex=0,this.lastOffset=0,this.dataIndex=0,this.previousRowId="",i.update(`$data.elements.scroll-bar-inner--${e.type}`,t,{only:null}),this.bodyClassName=i.get("config.scroll.bodyClassName"),this.pointerDown=this.pointerDown.bind(this),this.pointerUp=this.pointerUp.bind(this);const o=this.pointerMove.bind(this);this.pointerMove=o,this.unsubscribe=i.subscribe(`$data.scroll.${e.type}`,this.dataChanged.bind(this)),this.destroy=this.destroy.bind(this),t.addEventListener("pointerdown",this.pointerDown),document.addEventListener("pointermove",this.pointerMove),document.addEventListener("pointerup",this.pointerUp)}destroy(t){this.unsubscribe(),t.removeEventListener("pointerdown",this.pointerDown),document.removeEventListener("pointermove",this.pointerMove),document.removeEventListener("pointerup",this.pointerUp)}dataChanged(){const t=i.get(`$data.scroll.${e.type}`),o=i.get("$data.chart.time");if(!o.allDates.length)return;const a=o.allDates[o.level],s=t.dataIndex;if(this.lastDataIndex=s,"horizontal"===e.type&&a&&a.length)this.currentPos=t.handlePosPx,y.style[b]=this.currentPos+"px",d();else if("vertical"===e.type){if(!i.get("$data.list.rowsWithParentsExpanded").length)return;this.currentPos=t.handlePosPx,y.style[b]=this.currentPos+"px",d()}}limitPosition(t){return Math.max(Math.min(t,i.get(`$data.scroll.${e.type}.maxHandlePosPx`)),0)}pointerDown(t){t.stopPropagation(),t.preventDefault(),n.muteMethod("calculateRowsHeight"),document.body.classList.add(this.bodyClassName),requestAnimationFrame((()=>{this.moving=!0,this.initialPointerPos="horizontal"===e.type?t.pageX:t.pageY,this.initialHandlePos=i.get(`$data.scroll.${e.type}.handlePosPx`),g=" "+n.getClass(h)+"-inner--active",f=" "+n.getClass(h)+"--active",d()}))}pointerUp(t){this.moving&&(n.unmuteMethod("calculateRowsHeight"),t.preventDefault(),t.stopPropagation(),document.body.classList.remove(this.bodyClassName)),this.moving=!1,g="",f="",d()}pointerMoveRead(t){this.currentPointerPos="horizontal"===e.type?t.pageX:t.pageY}pointerMoveWrite(){const t=i.get(`config.scroll.${e.type}`),o=i.get(`$data.scroll.${e.type}`),a=this.currentPointerPos-this.initialPointerPos;this.currentPos=this.limitPosition(this.initialHandlePos+a);const s=i.get("$data.chart.time");if(!s.allDates.length)return;const l=s.allDates[s.level],r=this.currentPos/o.maxHandlePosPx*o.absoluteSizeWithoutLastPage,c=Math.round(r);if("horizontal"===e.type){let e,o=0,i=0,a=0;for(let t=l.length;o<t&&(e=l[o],a=Math.round(e.rightPx),!(a>c));o++);t.precise&&a!==c&&(i=e.leftPx-r),o||(o=0),e||(e=l[0]),this.dataIndex=o,this.lastDate=l[o],t.byPixels?n.setScrollLeft(r):n.setScrollLeft(e.id,i),this.lastDataIndex=o,this.lastOffset=i}else{const{dataIndex:e,row:o,rowData:i}=n.getRowInfoFromTop(r);let a=0;t.precise&&i.position.top!==r&&(a=i.position.top-r),this.dataIndex=e,this.previousRowId=o.id,t.byPixels?n.setScrollTop(r):n.setScrollTop(e,a),this.lastDataIndex=e,this.lastOffset=a}}pointerMove(t){this.moving&&(t.stopPropagation(),t.preventDefault(),requestAnimationFrame((()=>{this.pointerMoveRead(t)})),requestAnimationFrame((()=>{this.pointerMoveWrite()})))}}],$=c.create(W,x),I=n.generateSlots(h,t,e);function S({classNameOuter:t,classNameOuterActive:e,classNameInner:o,classNameInnerActive:i,styleMapInner:a,styleMapOuter:s,innerActions:n,outerActions:l,slots:r,cache:c,html:d,vido:h,props:u}){return c(!u||!u.type?null:r.html("outer",d`
              <div
                data-actions=${l()}
                class=${t+" "+t+"--"+u.type+e}
                style=${s.directive()}
              >
                ${r.html("inner",d`
                    <div
                      data-actions=${n()}
                      class=${o+" "+o+"--"+u.type+i}
                      style=${a.directive()}
                    >
                      ${r.html("content")}
                    </div>
                  `)}
              </div>
            `))}let M=S;return o(i.subscribe(`config.templates.${h}`,(t=>{M=null!=t?t:S,d()}))),()=>M({innerActions:$,outerActions:C,classNameOuter:u,classNameOuterActive:f,classNameInner:m,classNameInnerActive:g,cache:s,styleMapInner:y,styleMapOuter:v,slots:I,html:l,vido:t,props:e})}
/**
 * List component
 *
 * @copyright NEURONET - Rafal Pospiech
 * @author    Rafal Pospiech <neuronet.io@gmail.com>
 * @module    gantt-schedule-timeline-calendar
 * @link      https://github.com/neuronetio/gantt-schedule-timeline-calendar
 * @link      https://gantt-schedule-timeline-calendar.neuronet.io
 * @version   3.40.5
 * @released  2025-03-24
 * @license   SEE LICENSE IN LICENSE FILE
 */function z(t,e={}){const{api:o,state:i,onDestroy:a,Actions:s,update:n,reuseComponents:l,html:r,StyleMap:c,cache:d}=t,h="list",u=o.getActions(h);let m,f;const g=Object.assign(Object.assign({},e),{list:m,percent:f,api:o,state:i,componentName:h});let p;const w=i.subscribe("config.components.ListColumn",(t=>p=t));!function(){const t=i.get("config.list.expander.icons"),e={};for(const i in t){const a=t[i];e[i]=o.getSVGIconSrc(a)}i.update("$data.list.expander.icons",e)}(),function(){const t={open:"",close:""},e=i.get("config.list.toggle.icons");for(const i in e){const a=e[i];t[i]=o.getSVGIconSrc(a)}i.update("$data.list.toggle.icons",t)}();const b=o.getClass(h),v=o.generateSlots(h,t,e);a(i.subscribe("config.list",(function(){m=i.get("config.list"),f=m.columns.percent,g.list=m,g.percent=f,n()})));const y=[];a(i.subscribe("config.list.columns.data",(function(t){const e=Object.values(t).filter((t=>!t.hidden)).sort(((t,e)=>"number"==typeof t.position&&"number"==typeof e.position?t.position-e.position:0));l(y,e,(t=>({column:t})),p,!0),n()})));const P=new c({height:"","--expander-padding-width":"","--expander-size":""});let D;function x(t){D||(D=t.offsetWidth,0===f&&(D=0),i.update("$data.list.width",D))}a(i.subscribeAll(["$data.height","config.list.expander"],(()=>{const t=i.get("config.list.expander");P.style.height=i.get("$data.height")+"px",P.style["--expander-padding-width"]=t.padding+"px",P.style["--expander-size"]=t.size+"px",n()}),{group:!0})),a((()=>{y.forEach((t=>t.destroy())),w()}));u.push(class{constructor(t,e){e.state.update("$data.elements.list",t),x(t)}update(t){return x(t)}});const C=s.create(u,g);function W({className:t,styleMap:e,list:o,listColumns:i,actions:a,slots:s,html:n,cache:l,vido:r,props:c}){return s.html("outer",l(o.columns.percent>0?n`
              <div class=${t} data-actions=${a()} style=${e.directive()}>
                ${s.html("content",i.map((t=>t.html())))}
              </div>
            `:""))}let $=W;return a(i.subscribe(`config.templates.${h}`,(t=>{$=null!=t?t:W,n()}))),()=>$({list:m,className:b,actions:C,styleMap:P,listColumns:y,slots:v,cache:d,html:r,vido:t,props:e})}
/**
 * ListColumn component
 *
 * @copyright NEURONET - Rafal Pospiech
 * @author    Rafal Pospiech <neuronet.io@gmail.com>
 * @module    gantt-schedule-timeline-calendar
 * @link      https://github.com/neuronetio/gantt-schedule-timeline-calendar
 * @link      https://gantt-schedule-timeline-calendar.neuronet.io
 * @version   3.40.5
 * @released  2025-03-24
 * @license   SEE LICENSE IN LICENSE FILE
 */class T{constructor(t,e){let o=!1,i=e.state.get("$data.elements.list-columns");void 0===i&&(i=[],o=!0),i.includes(t)||(i.push(t),o=!0),o&&e.state.update("$data.elements.list-columns",i,{only:null})}destroy(t,e){e.state.update("$data.elements.list-columns",(e=>e.filter((e=>e!==t))),{only:null})}}function k(t,e){const{api:o,state:i,onDestroy:a,onChange:s,cache:n,Actions:l,update:r,createComponent:c,reuseComponents:d,html:h,StyleMap:u}=t,m=[];let f,g;m.push(i.subscribe("config.components.ListColumnRow",(t=>f=t))),m.push(i.subscribe("config.components.ListColumnHeader",(t=>g=t)));const p=Object.assign(Object.assign({},e),{api:o,state:i,componentName:"list-column"}),w={column:e.column,state:i,api:o,componentName:"list-column-headers"},b={api:o,state:i,componentName:"list-column-rows"},v="list-column",y=v+"-rows",P=v+"-rows-offset",D=o.getActions(v),x=o.getActions(y),C=o.getClass(v,e.column.id),W=o.getClass(P,e.column.id),$=o.getClass(y,e.column.id);let I,S=o.getId(v,e&&e.column?e.column.id:"");const M=new u({width:"","--width":""}),G=new u({height:""}),z=new u({"margin-top":"0px"});let k=i.get("config.additionalSpace");const L=o.generateSlots(v,t,e);let R;function O(){if(!e||!e.column)return;const t=i.get("config.list");if(!t.columns.data[e.column.id])return;I=t.columns.data[e.column.id].width*t.columns.percent*.01,R=I;const a=Math.round(o.getRealChartHeight());M.style.width=R+"px",M.style["--width"]=R+"px",z.style.height=a+"px",G.style.top=i.get("config.headerHeight")+k.top+"px"}a(i.subscribeAll(["config.list.columns.percent","config.list.columns.resizer.width","$data.chart.dimensions.width","$data.chart.dimensions.heightWithoutScrollBar","$data.list.width","$data.list.visibleRowsHeight","config.additionalSpace.top"],O,{group:!0}));const A=c(g,e);a(A.destroy);const V=[],N={};function _(){var t;if(!e||!e.column)return;i.mute(_);const a=i.get("$data.list.visibleRows")||[],s=o.getRows(a),n=o.getRowsData();for(const o of s){const i=N[o.id]=null!==(t=N[o.id])&&void 0!==t?t:{};i.column=e.column,i.row=o,i.rowData=n[o.id],i.width=R}for(const t in N)a.includes(t)||delete N[t];d(V,s,(t=>t&&N[t.id]),f,!0),L.change(e),i.unmute(_)}s((t=>{if((e=t)&&e.column&&e.column.id){S=o.getId(v,e&&e.column?e.column.id:"");for(const t in e)p[t]=e[t];O(),A.change(e),_()}})),a(i.subscribeAll(["$data.list.visibleRows","$data.list.visibleRowsHeight","$data.list.rows","config.list.rows","config.chart.items.*.height","config.chart.items.*.rowId","config.chart.items.*.time"],_,{group:!0,bulkValue:!1})),a(i.subscribe("$data.scroll.vertical.preciseOffset",(t=>{z.style.transform=`translateY(${Math.round(t)||0}px)`,r()}))),a(i.subscribe("config.additionalSpace",(t=>{k=t}))),a((()=>{V.forEach((t=>t.destroy())),m.forEach((t=>t()))})),D.push(T);const H=l.create(D,w),B=l.create(x,b);function E({className:t,classNameOffset:e,classNameContainer:o,containerStyleMap:i,offsetStyleMap:a,widthStyleMap:s,visibleRows:n,rowActions:l,elId:r,headerActions:c,ListColumnHeader:d,html:h,cache:u,vido:m,props:f}){return u(f&&f.column?L.html("outer",h`
              <div
                class=${t}
                data-gstcid=${f.column.id}
                data-actions=${c()}
                style=${s.directive()}
              >
                ${L.html("inner",h` ${d.html()}${L.html("container-outer",h`
        <div
          class=${o}
          data-gstcid=${f.column.id}
          data-actions=${l()}
          style=${i.directive()}
        >
          ${L.html("container-inner",h`
        <div class=${e} data-gstcid=${f.column.id} style=${a.directive()}>
          ${L.html("content",n.map((t=>t.html())))}
        </div>
      `)}
        </div>
      `)} `)}
              </div>
            `):null)}let j=E;return a(i.subscribe(`config.templates.${v}`,(t=>{j=null!=t?t:E,r()}))),()=>j({classNameOffset:W,offsetStyleMap:z,visibleRows:V,classNameContainer:$,containerStyleMap:G,rowActions:B,className:C,elId:S,headerActions:H,widthStyleMap:M,ListColumnHeader:A,html:h,cache:n,vido:t,props:e})}
/**
 * ListColumnHeader component
 *
 * @copyright NEURONET - Rafal Pospiech
 * @author    Rafal Pospiech <neuronet.io@gmail.com>
 * @module    gantt-schedule-timeline-calendar
 * @link      https://github.com/neuronetio/gantt-schedule-timeline-calendar
 * @link      https://gantt-schedule-timeline-calendar.neuronet.io
 * @version   3.40.5
 * @released  2025-03-24
 * @license   SEE LICENSE IN LICENSE FILE
 */function L(t,e){const{api:o,state:i,onDestroy:a,cache:s,onChange:n,Actions:l,update:r,createComponent:c,html:d,StyleMap:h}=t,u="list-column-header",m=Object.assign(Object.assign({},e),{api:o,state:i,componentName:u}),f=o.getActions(u),g=[];let p;g.push(i.subscribe("config.components.ListColumnHeaderResizer",(t=>p=t)));const w=c(p,e);let b;g.push(i.subscribe("config.components.ListColumnRowExpander",(t=>b=t)));const v=c(b,e);a((()=>{w.destroy(),v.destroy(),g.forEach((t=>t()))}));const y=o.generateSlots(u,t,e),P=o.getClass(u),D=o.getClass(u+"-content");let x=o.getId(u,e.column.id);n((t=>{e=t;for(const t in e)m[t]=e[t];x=o.getId(u,e.column.id),w.change(e),v.change(e),y.change(t)}));const C=new h({height:"","--height":"","--paddings-count":""});a(i.subscribe("config.headerHeight",(()=>{const t=i.get("config");C.style.height=t.headerHeight+"px",C.style["--height"]=t.headerHeight+"px",C.style["--paddings-count"]="1",r()})));const W=l.create(f,m);function $({className:t,contentClass:e,styleMap:o,elId:i,cache:a,ListColumnRowExpander:s,ListColumnHeaderResizer:n,actions:l,slots:r,html:c,vido:d,props:h}){return a(!h||!h.column?null:r.html("outer",c`
              <div
                class=${t}
                data-gstcid=${h.column.id}
                style=${o.directive()}
                data-actions=${l()}
              >
                ${r.html("content",h.column.expander?c`
        <div class=${e}>
          ${s.html(h.column)}${n.html(h.column)}
        </div>
      `:c` <div class=${e}>${n.html(h.column)}</div> `)}
              </div>
            `))}let I=$;return a(i.subscribe(`config.templates.${u}`,(t=>{I=null!=t?t:$,r()}))),()=>I({className:P,contentClass:D,cache:s,styleMap:C,elId:x,ListColumnRowExpander:v,ListColumnHeaderResizer:w,actions:W,slots:y,html:d,vido:t,props:e})}
/**
 * ListColumnHeaderResizer component
 *
 * @copyright NEURONET - Rafal Pospiech
 * @author    Rafal Pospiech <neuronet.io@gmail.com>
 * @module    gantt-schedule-timeline-calendar
 * @link      https://github.com/neuronetio/gantt-schedule-timeline-calendar
 * @link      https://gantt-schedule-timeline-calendar.neuronet.io
 * @version   3.40.5
 * @released  2025-03-24
 * @license   SEE LICENSE IN LICENSE FILE
 */function R(t,e){const{api:o,state:i,onDestroy:a,cache:s,update:n,html:l,Actions:r,onChange:c,PointerAction:d,StyleMap:h,unsafeHTML:u}=t,m="list-column-header-resizer",f=o.getActions(m),g=o.getActions(m+"-dots"),p={up:"",down:""};let w,b,v,y;a(i.subscribe("config.list.sort.icons",(t=>{p.up=o.getSVGIconSrc(t.up),p.down=o.getSVGIconSrc(t.down)}))),w=o.getClass(m),b=o.getClass(m+"-container"),v=o.getClass(m+"-dots"),y=o.getClass(m+"-dots-dot");const P=o.getClass(m+"-sort-icon");let D;const x=new h({});let C=!1;const W=o.generateSlots(m,t,e);let $=!0,I=0;const S={componentName:m,column:e.column,api:o,state:i,pointerOptions:{axis:"x",onMove:function({movementX:t,event:o}){if(!$)return;t&&(o.preventDefault(),o.stopPropagation());let a=i.get("config.list.columns.minWidth");"number"==typeof e.column.minWidth&&(a=e.column.minWidth),I+=t,I<a&&(I=a),C&&i.update(`config.list.columns.data.${e.column.id}.width`,I)}}};function M(){if(!e||!e.column||!e.column.id)return;S.column=e.column,w=o.getClass(m,e.column.id),b=o.getClass(m+"-container",e.column.id),v=o.getClass(m+"-dots",e.column.id),y=o.getClass(m+"-dots-dot",e.column.id),$=!("resizer"in e.column)||e.column.resizer;const t=i.get("config.list");D=I=e.column.width*t.columns.percent*.01,x.style["--width"]=t.columns.resizer.width+"px",C=t.columns.resizer.inRealTime,i.update("$data.list.width",D),W.change(e),n()}c((t=>{e=t,M()})),a(i.subscribeAll(["config.list.columns.percent","config.list.columns.resizer.width","config.list.columns.resizer.inRealTime"],M,{group:!0}));let G=[1,2,3,4,5,6,7,8];a(i.subscribe("config.list.columns.resizer.dots",(t=>{G=[];for(let e=0;e<t;e++)G.push(e);n()})));let z=!0;function T(){e.column.sortable&&(z=!z,i.update("config.list.sort",(t=>(t.activeColumnId=e.column.id,t.asc=z,t))))}let k=!1;a(i.subscribe("config.list.sort",(t=>{if(t.activeColumnId===e.column.id)return z=t.asc,void(k=!0);k=!1}))),g.push(d);const L=r.create(f,S),R=r.create(g,S);function O({className:t,containerClass:e,iconClass:o,dotsClass:i,dotClass:a,dotsStyleMap:s,dots:n,onLabelClick:l,dotsActions:r,resizer:c,icons:d,sortActive:h,cache:u,asc:m,actions:f,slots:g,html:p,unsafeHTML:w,vido:b,props:v}){const y=!v||!v.column;function P(){return v.column.sortable&&h?m?p` <img src="${d.down}" class=${o} /> `:p` <img src="${d.up}" class=${o} /> `:null}function D(){return y?null:"function"==typeof v.column.header.content?v.column.header.content({column:v.column,vido:b}):v.column.header.content}return u(y?null:g.html("outer",p`
              <div class=${t} data-gstcid=${v.column.id} data-actions=${f()}>
                ${g.html("container-outer",c?y?null:p`
        <div class=${e} @click=${l}>
          ${g.html("content",v.column.header.html?w(v.column.header.html):D())}
          ${P()}
        </div>
        <div class=${i} style=${s.directive()} data-actions=${r()}>
          ${n.map((()=>p` <div class=${a} /> `))}
        </div>
      `:y?null:p`
        <div class=${e} @click=${l}>
          ${g.html("content",v.column.header.html?w(v.column.header.html):D())}
          ${P()}
        </div>
      `)}
              </div>
            `))}let A=O;return a(i.subscribe(`config.templates.${m}`,(t=>{A=null!=t?t:O,n()}))),()=>A({className:w,containerClass:b,onLabelClick:T,iconClass:P,cache:s,dotsClass:v,dotsStyleMap:x,dotsActions:R,dots:G,dotClass:y,resizer:$,icons:p,sortActive:k,asc:z,actions:L,slots:W,html:l,unsafeHTML:u,vido:t,props:e})}
/**
 * ListColumnRow component
 *
 * @copyright NEURONET - Rafal Pospiech
 * @author    Rafal Pospiech <neuronet.io@gmail.com>
 * @module    gantt-schedule-timeline-calendar
 * @link      https://github.com/neuronetio/gantt-schedule-timeline-calendar
 * @link      https://gantt-schedule-timeline-calendar.neuronet.io
 * @version   3.40.5
 * @released  2025-03-24
 * @license   SEE LICENSE IN LICENSE FILE
 */class O{constructor(t,e){let o=e.state.get("$data.elements.list-column-rows"),i=!1;void 0===o&&(i=!0,o=[]),o.includes(t)||(o.push(t),i=!0),i&&e.state.update("$data.elements.list-column-rows",o,{only:null})}destroy(t,e){e.state.update("$data.elements.list-column-rows",(e=>e.filter((e=>e!==t))),{only:null})}}function A(t,e){const{api:o,state:i,onDestroy:a,cache:s,Actions:n,update:l,html:r,createComponent:c,onChange:d,StyleMap:h,unsafeHTML:u}=t,m="list-column-row",f=Object.assign(Object.assign({},e),{api:o,state:i,componentName:m});let g,p=!1;a(i.subscribe("config.components.ListColumnRowExpander",(t=>g=t)));const w=new h(e.column.expander?{height:"",top:"","--height":"","--expander-padding-width":"","--expander-size":""}:{height:"",top:"","--height":""}),b=c(g,{row:e.row}),v=o.getClass(m),y=o.getClass(m+"-content");let P=o.getClass(m);const D=o.generateSlots(m,t,e);let x;d((function(a,s){var n;if(s.leave||!a||void 0===a.row||void 0===a.column)return p=!0,D.change(a,s),void l();p=!1,e=a;for(const t in e)f[t]=e[t];if(!e.column||!e.row||!e.rowData)return p=!0,D.change(a,s),void l();if(void 0===e.column||void 0===e.row)return;x=e.column.isHTML?void 0===e.row?null:"function"==typeof e.column.data?u(e.column.data({row:e.row,vido:t})):"function"==typeof e.row[e.column.data]?u(e.row[e.column.data]({row:e.row,vido:t})):"string"==typeof e.row[e.column.data]?u(e.row[e.column.data]):null:void 0===e.row?null:"function"==typeof e.column.data?e.column.data({row:e.row,vido:t}):"function"==typeof e.row[e.column.data]?e.row[e.column.data]({row:e.row,vido:t}):e.row[e.column.data];const r=i.get("config.list.expander");for(const t in w.style)delete w.style[t];w.style.height=e.rowData.outerHeight+"px",w.style["--height"]=e.rowData.outerHeight+"px",e.column.expander&&(w.style["--expander-padding-width"]=r.padding*(e.rowData.parents.length+1)+"px");const c=i.get("config.list.rows");for(const t of e.rowData.parents){const e=c[t];if("object"==typeof e.style&&"Object"===e.style.constructor.name&&"object"==typeof e.style.children){const t=e.style.children;for(const e in t)w.style[e]=t[e]}}if(null===(n=null==e?void 0:e.row)||void 0===n?void 0:n.style)for(const t in e.row.style)w.style[t]=e.row.style[t];if(e.row.classNames){if(Array.isArray(e.row.classNames)&&e.row.classNames.length)P=o.getClass(m)+" "+e.row.classNames.join(" ");else if("function"==typeof e.row.classNames){const i=e.row.classNames({row:e.row,vido:t});Array.isArray(i)&&i.length&&(P=o.getClass(m)+" "+i.join(" "))}}else P=v;b&&b.change(e),D.change(e,s),l()})),a((()=>{b&&b.destroy()}));const C=o.getActions(m);C.includes(O)||C.push(O);const W=n.create(C,f);function $({classNameCurrent:t,classNameContent:e,styleMap:o,cache:i,shouldDetach:a,content:s,ListColumnRowExpander:n,slots:l,actions:r,html:c,vido:d,props:h}){return i(a||!h||!h.column||!h.row?null:l.html("outer",c`
              <div
                class=${t}
                data-gstcid=${h.row.id}
                style=${o.directive()}
                data-actions=${r()}
              >
                ${l.html("inner",c`
                    ${h.column.expander?n.html():null}
                    <div class=${e}>${l.html("content",s)}</div>
                  `)}
              </div>
            `))}let I=$;return a(i.subscribe(`config.templates.${m}`,(t=>{I=null!=t?t:$,l()}))),()=>I({classNameCurrent:P,cache:s,shouldDetach:p,styleMap:w,ListColumnRowExpander:b,classNameContent:y,slots:D,actions:W,content:x,html:r,vido:t,props:e})}
/**
 * ListColumnRowExpander component
 *
 * @copyright NEURONET - Rafal Pospiech
 * @author    Rafal Pospiech <neuronet.io@gmail.com>
 * @module    gantt-schedule-timeline-calendar
 * @link      https://github.com/neuronetio/gantt-schedule-timeline-calendar
 * @link      https://gantt-schedule-timeline-calendar.neuronet.io
 * @version   3.40.5
 * @released  2025-03-24
 * @license   SEE LICENSE IN LICENSE FILE
 */function V(t,e){const{api:o,state:i,onDestroy:a,Actions:s,html:n,cache:l,createComponent:r,onChange:c,update:d}=t,h="list-column-row-expander",u=o.getActions(h),m=Object.assign(Object.assign({},e),{api:o,state:i,componentName:h}),f=o.getClass(h);let g;const p=i.subscribe("config.components.ListColumnRowExpanderToggle",(t=>g=t)),w=r(g,e);a((()=>{w.destroy(),p()}));const b=o.generateSlots(h,t,e);e.row&&c((function(t){if((e=t)&&e.row&&e.rowData){for(const t in e)m[t]=e[t];w.change(e),b.change(t),d()}}));const v=s.create(u,m);function y({className:t,ListColumnRowExpanderToggle:e,slots:o,actions:i,html:a,cache:s,vido:n,props:l}){return s(!l?null:o.html("outer",a`
              <div class=${t} data-gstcid=${l.row?l.row.id:""} data-action=${i()}>
                ${o.html("content",e.html())}
              </div>
            `))}let P=y;return a(i.subscribe(`config.templates.${h}`,(t=>{P=null!=t?t:y,d()}))),()=>P({className:f,ListColumnRowExpanderToggle:w,slots:b,actions:v,html:n,cache:l,vido:t,props:e})}
/**
 * ListColumnRowExpanderToggle component
 *
 * @copyright NEURONET - Rafal Pospiech
 * @author    Rafal Pospiech <neuronet.io@gmail.com>
 * @module    gantt-schedule-timeline-calendar
 * @link      https://github.com/neuronetio/gantt-schedule-timeline-calendar
 * @link      https://gantt-schedule-timeline-calendar.neuronet.io
 * @version   3.40.5
 * @released  2025-03-24
 * @license   SEE LICENSE IN LICENSE FILE
 */function N(t,e){const{api:o,state:i,cache:a,onDestroy:s,Actions:n,update:l,html:r,onChange:c}=t,d="list-column-row-expander-toggle",h=Object.assign(Object.assign({},e),{api:o,state:i,componentName:d}),u=o.getActions(d),m=o.getClass(d),f=o.getClass(d+"-child"),g=o.getClass(d+"-open"),p=o.getClass(d+"-closed");let w,b,v,y=!1;s(i.subscribe("$data.list.expander.icons",(t=>{t&&(w=t.child,b=t.open,v=t.closed),l()})));const P=o.generateSlots(d,t,e);e.row?(c((function(t){if(e&&e.row){e=t;for(const t in e)h[t]=e[t];y=e.row.expanded,P.change(t),l()}})),s((function(){}))):s(i.subscribe("config.list.rows.*.expanded",(function(t){for(const e of t)if(e.value){y=!0;break}l()}),{bulk:!0}));const D=n.create(u,h);function x(){y=!y,e.row?i.update(`config.list.rows.${e.row.id}.expanded`,y,{data:{name:"expanded",rowId:e.row.id,expanded:y}}):i.update("config.list.rows",(t=>{for(const e in t)t[e].expanded=y;return t}),{only:["*.expanded"],data:{name:"expanded"}})}function C({className:t,classNameChild:e,classNameOpen:o,classNameClosed:i,expanded:a,iconChild:s,iconOpen:n,iconClosed:l,toggle:r,cache:c,slots:d,actions:h,html:u,vido:m,props:f}){return c(!f?null:d.html("outer",u`
              <div
                class=${t}
                data-gstcid=${f.row?f.row.id:""}
                data-action=${h()}
                @click=${r}
              >
                ${d.html("content",s?0===(null===(p=null===(g=f.rowData)||void 0===g?void 0:g.children)||void 0===p?void 0:p.length)?u` <img width="16" height="16" class=${e} src=${s} /> `:a?u` <img width="16" height="16" class=${o} src=${n} /> `:u` <img width="16" height="16" class=${i} src=${l} /> `:"")}
              </div>
            `));var g,p}let W=C;return s(i.subscribe(`config.templates.${d}`,(t=>{W=null!=t?t:C,l()}))),()=>W({className:m,classNameChild:f,iconChild:w,expanded:y,cache:a,classNameOpen:g,classNameClosed:p,iconOpen:b,iconClosed:v,toggle:x,slots:P,actions:D,html:r,vido:t,props:e})}
/**
 * ListToggle component
 *
 * @copyright NEURONET - Rafal Pospiech
 * @author    Rafal Pospiech <neuronet.io@gmail.com>
 * @module    gantt-schedule-timeline-calendar
 * @link      https://github.com/neuronetio/gantt-schedule-timeline-calendar
 * @link      https://gantt-schedule-timeline-calendar.neuronet.io
 * @version   3.40.5
 * @released  2025-03-24
 * @license   SEE LICENSE IN LICENSE FILE
 */function _(t,e={}){const{html:o,onDestroy:i,api:a,state:s,update:n,StyleMap:l,Actions:r,onChange:c}=t,d="list-toggle",h=a.getClass(d),u=Object.assign(Object.assign({},e),{api:a,state:s,componentName:d});let m={open:"",close:""};i(s.subscribe("$data.list.toggle.icons",(t=>{t&&(m=t,n())})));const f=new l({top:"0px"});i(s.subscribe("$data.scroll.vertical.preciseOffset",(t=>{f.style.top=(-1*Math.round(t)||0)+"px"})));let g=!0;i(s.subscribe("config.list.columns.percent",(t=>g=0!==t)));let p=!1;function w(){p=!0}function b(){p&&(p=!1,s.update("config.list.columns.percent",(t=>0===t?100:0)))}c((t=>{e=t;for(const o in t)u[o]=e[o]}));const v=a.getActions(d),y=r.create(v,u),P=a.generateSlots(d,t,e);function D({className:t,styleMap:e,pointerDown:o,pointerUp:i,open:a,toggleIconsSrc:s,actions:n,slots:l,html:r,vido:c,props:d}){return l.html("outer",r`
        <div
          class=${t}
          style=${e.directive()}
          @pointerdown=${o}
          @pointerup=${i}
          actions=${n()}
        >
          ${l.html("content",r` <img src=${a?s.close:s.open} /> `)}
        </div>
      `)}let x=D;return i(s.subscribe(`config.templates.${d}`,(t=>{x=null!=t?t:D,n()}))),()=>x({className:h,styleMap:f,pointerDown:w,pointerUp:b,open:g,toggleIconsSrc:m,actions:y,slots:P,html:o,vido:t,props:e})}
/**
 * Chart component
 *
 * @copyright NEURONET - Rafal Pospiech
 * @author    Rafal Pospiech <neuronet.io@gmail.com>
 * @module    gantt-schedule-timeline-calendar
 * @link      https://github.com/neuronetio/gantt-schedule-timeline-calendar
 * @link      https://gantt-schedule-timeline-calendar.neuronet.io
 * @version   3.40.5
 * @released  2025-03-24
 * @license   SEE LICENSE IN LICENSE FILE
 */function H(t,e={}){const{api:o,state:i,onDestroy:a,Actions:s,html:n,createComponent:l,update:r}=t,c="chart",d=[];let h,u,m;d.push(i.subscribe("config.components.ChartCalendar",(t=>h=t))),d.push(i.subscribe("config.components.ChartTimeline",(t=>u=t))),d.push(i.subscribe("config.components.ScrollBar",(t=>m=t)));const f=l(h);a(f.destroy);const g=l(u);a(g.destroy);const p=l(m,{type:"horizontal"});a(p.destroy);const w=l(m,{type:"vertical"});a(w.destroy),a((()=>{d.forEach((t=>t()))}));const b=o.getClass(c),v=o.getActions(c);let y=!1;a(i.subscribe("config.chart.time.calculatedZoomMode",(t=>{y=t,r()})));const P={handleEvent:function(t){t.type},passive:!1,capture:!1};let D,x=0;v.push((function(t){D||(D=new ResizeObserver((()=>{const e=t.offsetWidth,o=t.offsetHeight,a=e-i.get("config.scroll.horizontal.width"),s=i.get("config.headerHeight");x!==e&&(x=e,i.update("$data.chart.dimensions",(t=>(t.width=e,t.widthWithoutScrollBar=a,t.height=o,t.innerHeight=o-s,t))))})),D.observe(t),i.update("$data.elements.chart",t))})),a((()=>{D.disconnect()}));const C={api:o,state:i,componentName:c},W=s.create(v,C),$=o.generateSlots(c,t,e);function I({className:t,onWheel:e,ChartCalendar:o,ChartTimeline:i,ScrollBarVertical:a,calculatedZoomMode:s,ScrollBarHorizontal:n,actions:l,slots:r,html:c,vido:d,props:h}){return r.html("outer",c`
        <div class=${t} data-actions=${l()} @wheel=${e}>
          ${r.html("content",c`
              ${o.html()}${i.html()}${a.html()}
              ${s?null:n.html()}
            `)}
        </div>
      `)}let S=I;return a(i.subscribe(`config.templates.${c}`,(t=>{S=null!=t?t:I,r()}))),()=>S({className:b,onWheel:P,ChartCalendar:f,ChartTimeline:g,ScrollBarVertical:w,calculatedZoomMode:y,ScrollBarHorizontal:p,actions:W,slots:$,html:n,vido:t,props:e})}
/**
 * ChartCalendar component
 *
 * @copyright NEURONET - Rafal Pospiech
 * @author    Rafal Pospiech <neuronet.io@gmail.com>
 * @module    gantt-schedule-timeline-calendar
 * @link      https://github.com/neuronetio/gantt-schedule-timeline-calendar
 * @link      https://gantt-schedule-timeline-calendar.neuronet.io
 * @version   3.40.5
 * @released  2025-03-24
 * @license   SEE LICENSE IN LICENSE FILE
 */function B(t,e){const{api:o,state:i,onDestroy:a,Actions:s,update:n,reuseComponents:l,html:r,StyleMap:c}=t,d="chart-calendar",h=o.getActions(d),u=Object.assign(Object.assign({},e),{api:o,state:i,componentName:d}),m=i.get("config.components.ChartCalendarDate"),f=o.getClass(d);let g;const p=new c({height:"","--headerHeight":"","margin-left":""});a(i.subscribe("config.headerHeight",(t=>{g=t,p.style.height=g+"px",p.style["--calendar-height"]=g+"px",n()})));let w=[],b=0;a(i.subscribeAll(["$data.chart.time.levels","config.chart.time","$data.chart.time","config.chart.calendarLevels"],(()=>{const t=i.get("$data.chart.time.levels");let e=0;if(t.length!==b){b=t.length,w.forEach((t=>t.forEach((t=>t.destroy())))),w=[];for(let t=0;t<b;t++)w.push([])}for(const i of t){if(!i.length)continue;let t="YYYY-MM-DD HH";switch(i[0].period){case"day":t="YYYY-MM-DD";break;case"week":t="YYYY-MM-ww";break;case"month":t="YYYY-MM";break;case"year":t="YYYY"}const a=o.time.date().format(t);l(w[e],i,(o=>o&&{level:e,date:o,currentDate:a,currentDateFormat:t}),m,!0),e++}n()}),{bulk:!0,bulkValue:!1})),a((()=>{w.forEach((t=>t.forEach((t=>t.destroy()))))})),h.push((t=>{i.update("$data.elements.chart-calendar",t)}));const v=s.create(h,u),y=o.generateSlots(d,t,e);function P({className:t,styleMap:e,components:o,actions:i,slots:a,html:s,vido:n,props:l}){return a.html("outer",s`
        <div class=${t} data-actions=${i()} style=${e.directive()}>
          ${a.html("inner",o.length?o.map(((e,o)=>e&&e.length?s`
                        <div class=${t+"-dates "+t+`-dates--level-${o}`}>
                          ${a.html("content",e.map((t=>t.html())))}
                        </div>
                      `:null)):null)}
        </div>
      `)}let D=P;return a(i.subscribe(`config.templates.${d}`,(t=>{D=null!=t?t:P,n()}))),()=>D({className:f,styleMap:p,components:w,actions:v,slots:y,html:r,vido:t,props:e})}
/**
 * ChartCalendarDate component
 *
 * @copyright NEURONET - Rafal Pospiech
 * @author    Rafal Pospiech <neuronet.io@gmail.com>
 * @module    gantt-schedule-timeline-calendar
 * @link      https://github.com/neuronetio/gantt-schedule-timeline-calendar
 * @link      https://gantt-schedule-timeline-calendar.neuronet.io
 * @version   3.40.5
 * @released  2025-03-24
 * @license   SEE LICENSE IN LICENSE FILE
 */class E extends a{constructor(t,e){super(),e.state.update("$data.elements.chart-calendar-dates",(e=>(void 0===e&&(e=[]),e.includes(t)||e.push(t),e)))}}function j(t,e){const{api:o,state:i,onDestroy:a,Actions:s,update:n,onChange:l,html:r,StyleMap:c,cache:d}=t,h="chart-calendar-date",u=o.getActions(h),m=o.getClass(h);let f,g="",p="";l((()=>{f=i.get("config.chart.time")}));const w=new c({width:"0px"},{schedule:!1});let b="";let v=!1;const y=o.generateSlots(h,t,e);let P,D;const x={date:e.date,period:e.period,api:o,state:i,componentName:h};l(((t,o)=>{if(o.leave)return v=!0,y.change(t,o),n();v=!1,P=e.level===f.level,D=P?m+"--main-date ":m+"--non-main-date ",e=t,x.date=e.date,x.period=e.period,function(){if(!e||!e.date)return;const t=i.get(`config.chart.calendarLevels.${e.level}`);w.style.width=e.date.currentView.width+"px",w.style.left=e.date.currentView.leftPx+"px";const o=t.find((t=>+f.zoom<=+t.zoomTo));g=e.date.current?" gstc-current":e.date.next?" gstc-next":e.date.previous?" gstc-previous":"",p=m+"-content "+m+`-content--${e.date.period}`+g,o.classNames&&Array.isArray(o.classNames)?(p+=" "+o.classNames.join(" "),b=" "+o.classNames.join(" ")):b="",n()}(),y.change(t,o)})),u.includes(E)||u.push(E);const C=s.create(u,x);function W({className:t,mainClass:e,additionalClass:o,formatClassName:i,finalClassName:a,styleMap:s,cache:n,shouldDetach:l,actions:r,slots:c,html:d,vido:h,props:u}){return n(l||!u||!u.date?null:c.html("outer",d`
              <div
                class=${t+" "+t+`--${u.date.period} `+e+t+`--level-${u.level}`+o+i}
                data-gstcid=${u.date.id}
                style=${s.directive()}
                data-actions=${r()}
              >
                ${c.html("content",d`<div class=${a.trim()}>${u.date.formatted}</div>`)}
              </div>
            `))}let $=W;return a(i.subscribe(`config.templates.${h}`,(t=>{$=null!=t?t:W,n()}))),()=>$({className:m,mainClass:D,additionalClass:g,formatClassName:b,styleMap:w,finalClassName:p,cache:d,shouldDetach:v,actions:C,slots:y,html:r,vido:t,props:e})}
/**
 * ChartTimeline component
 *
 * @copyright NEURONET - Rafal Pospiech
 * @author    Rafal Pospiech <neuronet.io@gmail.com>
 * @module    gantt-schedule-timeline-calendar
 * @link      https://github.com/neuronetio/gantt-schedule-timeline-calendar
 * @link      https://gantt-schedule-timeline-calendar.neuronet.io
 * @version   3.40.5
 * @released  2025-03-24
 * @license   SEE LICENSE IN LICENSE FILE
 */function Y(t,e){const{api:o,state:i,onDestroy:a,Action:s,Actions:n,update:l,html:r,createComponent:c,StyleMap:d}=t,h="chart-timeline",u=Object.assign(Object.assign({},e),{api:o,state:i,componentName:h});let m,f,g;a(i.subscribe("config.components.ChartTimelineGrid",(t=>{m&&m.destroy(),m=c(t)}))),a((()=>{m&&m.destroy()})),a(i.subscribe("config.components.ChartTimelineItems",(t=>{f&&f.destroy(),f=c(t)}))),a((()=>{f&&f.destroy()})),a(i.subscribe("config.components.ListToggle",(t=>{g&&g.destroy(),g=c(t)}))),a((()=>{g&&g.destroy()}));const p=o.generateSlots(h,t,e),w=o.getClass(h),b=o.getClass(h+"-inner");let v;a(i.subscribe("config.list.toggle.display",(t=>v=t)));const y=new d({}),P=new d({});let D,x;a(i.subscribe("config.additionalSpace",(t=>{D=t,l()}))),a(i.subscribe("config.headerHeight",(t=>{x=t,l()}))),a(i.subscribeAll(["$data.chart.dimensions.heightWithoutScrollBar","$data.scroll.vertical.offset","$data.chart.dimensions.width","$data.list.visibleRowsHeight","$data.chart.time.dates.day","config.headerHeight","config.additionalSpace"],(function(){const t=i.get("$data.chart.dimensions.width"),e=Math.round(o.getRealChartHeight(!0));y.style.height=i.get("config.innerHeight")+"px",y.style["--height"]=y.style.height,y.style.top=D.top+x+"px",t?(y.style.width=t+"px",y.style["--width"]=t+"px"):(y.style.width="0px",y.style["--width"]="0px"),P.style.height=e+"px",P.style.width=t?t+"px":"0px";const a=i.get("$data.scroll.vertical.preciseOffset")||0;P.style.transform=`translateY(${Math.round(a)}px)`,l()}),{group:!0,bulkValue:!1}));let C=[];a(i.subscribe("config.actions.chart-timeline",(t=>{C=t}))),C.push(class extends s{constructor(t){super();i.get("$data.elements.chart-timeline")!==t&&i.update("$data.elements.chart-timeline",t)}});const W=n.create(C,u);function $({className:t,classNameInner:e,styleMap:o,innerStyleMap:i,Grid:a,Items:s,showToggle:n,ListToggle:l,actions:r,slots:c,html:d,vido:h,props:u}){return c.html("outer",d`
        <div class=${t} style=${o.directive()} data-actions=${r()}>
          ${c.html("inner",d`
              <div class=${e} style=${i.directive()}>
                ${c.html("content",d` ${a.html()}${s.html()}${n?l.html():""} `)}
              </div>
            `)}
        </div>
      `)}let I=$;return a(i.subscribe(`config.templates.${h}`,(t=>{I=null!=t?t:$,l()}))),()=>I({className:w,styleMap:y,classNameInner:b,Grid:m,innerStyleMap:P,Items:f,showToggle:v,ListToggle:g,actions:W,slots:p,html:r,vido:t,props:e})}
/**
 * ChartTimelineGrid component
 *
 * @copyright NEURONET - Rafal Pospiech
 * @author    Rafal Pospiech <neuronet.io@gmail.com>
 * @module    gantt-schedule-timeline-calendar
 * @link      https://github.com/neuronetio/gantt-schedule-timeline-calendar
 * @link      https://gantt-schedule-timeline-calendar.neuronet.io
 * @version   3.40.5
 * @released  2025-03-24
 * @license   SEE LICENSE IN LICENSE FILE
 */class F{constructor(t,e){e.state.get("$data.elements.chart-timeline-grid")!==t&&e.state.update("$data.elements.chart-timeline-grid",t,{only:null})}destroy(t,e){e.state.update("$data.elements",(t=>(delete t["chart-timeline-grid"],t)),{only:null})}}function U(t,e){const{api:o,state:i,onDestroy:a,Actions:s,update:n,html:l,reuseComponents:r,StyleMap:c}=t,d="chart-timeline-grid",h=o.getActions(d),u={api:o,state:i,componentName:d},m=i.get("config.components.ChartTimelineGridRow"),f=o.getClass(d);let g;a(i.subscribe("config.chart.grid.cell.onCreate",(t=>g=t)));const p=[],w={},b=new Map,v=new c({});function y(t){let e=t.month()+1;e<10&&(e="0"+e);let o=t.date();o<10&&(o="0"+o);let i=t.hour();i<10&&(i="0"+i);let a=t.minute();a<10&&(a="0"+a);let s=t.second();return s<10&&(s="0"+s),`${t.year()}-${e}-${o}T${i}-${a}-${s}`}a(i.subscribeAll(["$data.scroll.vertical.preciseOffset","$data.chart.dimensions.width","$data.chart.dimensions.heightWithoutScrollBar"],(function(){const t=i.get("$data.chart.dimensions.width"),e=o.getRealChartHeight();v.style.height=Math.round(e)+"px",v.style.width=t+"px"}),{group:!0}));let P="",D=0,x=0,C="",W=0,$="",I=0,S=0;function M(){const t=o.getGridRows();r(p,t||[],(t=>t),m,!0),n()}a(i.subscribeAll(["$data.list.rowsHeight","$data.list.visibleRows","$data.list.visibleRowsHeight","$data.chart.time.levels","$data.scroll","config.list.rows;","config.list.rows.*;"],(function(e,a){const s=i.get("$data.chart.time"),n=i.get(`$data.chart.time.levels.${s.level}`),l=s.levels[s.level];if(!l||!l.length)return;const r=s.levels[s.level].map((t=>t.currentView.width)).join(",");if(!n||0===n.length)return void i.update("$data.chart.grid",{rows:{},cells:{}});const c=o.getRowsData(),d=i.get("$data.list.visibleRows"),h=d.map((t=>c[t].outerHeight)).join("|"),u=d.join("|"),m=i.get("$data.scroll");if(u===P&&D===s.leftGlobal&&x===s.rightGlobal&&h===C&&W===n.length&&$===r&&m.horizontal.handlePosPx===I&&m.vertical.handlePosPx===S)return"$data.chart.time.levels"===a.path.listener?M():void 0;I=m.horizontal.handlePosPx,S=m.vertical.handlePosPx,D=s.leftGlobal,x=s.rightGlobal,$=r,C=h;let f=0;if(u!==P)for(const t in w)delete w[t];else if(W!==n.length)for(const t in w)w[t].cells.length=0;W=n.length;const p=o.getAllRows(),v=i.get("$data.chart.grid.cells");for(const t in v)delete v[t];for(const e of d){const o=p[e],i=c[e];if(!o||!i)continue;let a,s;u!==P?a=[]:(a=w[e].cells,a.length=0);for(const e of n){let s;b.has(e.leftGlobal)?s=b.get(e.leftGlobal):(s=y(e.leftGlobalDate),b.set(e.leftGlobal,s));const n=o.id+"-"+s;let l;if(v[n])l=v[n],l.id=n,l.time=e,l.row=o,l.rowData=i,l.top=f,l.vido=t,l.content=null;else{const a=Object.create(null);a.id=n,a.time=e,a.row=o,a.rowData=i,a.top=f,a.vido=t,a.content=null,l=a}for(const t of g)l.content=t(l);v[l.id]=l,a.push(l.id)}w[e]?(s=w[e],s.row=o,s.rowData=i,s.cells=a,s.top=f):s={row:o,rowData:i,cells:a,top:f},w[e]=s,f+=i.outerHeight}P=u,i.update("$data.chart.grid",{rows:w,cells:v})}),{group:!0,bulkValue:!1})),a(i.subscribe("$data.chart.grid",M,{group:!0})),a((()=>{p.forEach((t=>t.destroy()))})),h.push(F);const G=s.create(h,u),z=o.generateSlots(d,t,e);function T({className:t,styleMap:e,rowsComponents:o,actions:i,slots:a,html:s,vido:n,props:l}){return a.html("outer",s`
        <div class=${t} data-actions=${i()} style=${e.directive()}>
          ${a.html("content",o.map((t=>t.html())))}
        </div>
      `)}let k=T;return a(i.subscribe(`config.templates.${d}`,(t=>{k=null!=t?t:T,n()}))),()=>k({className:f,styleMap:v,rowsComponents:p,actions:G,slots:z,html:l,vido:t,props:e})}
/**
 * ChartTimelineGridRow component
 *
 * @copyright NEURONET - Rafal Pospiech
 * @author    Rafal Pospiech <neuronet.io@gmail.com>
 * @module    gantt-schedule-timeline-calendar
 * @link      https://github.com/neuronetio/gantt-schedule-timeline-calendar
 * @link      https://gantt-schedule-timeline-calendar.neuronet.io
 * @version   3.40.5
 * @released  2025-03-24
 * @license   SEE LICENSE IN LICENSE FILE
 */class Z{constructor(t,e){let o=!1,i=e.state.get("$data.elements.chart-timeline-grid-rows");void 0===i&&(i=[],o=!0),i.includes(t)||(i.push(t),o=!0),o&&e.state.update("$data.elements.chart-timeline-grid-rows",i,{only:null})}destroy(t,e){e.state.update("$data.elements.chart-timeline-grid-rows",(e=>e.filter((e=>e!==t))),{only:null})}}function K(t,e){const{api:o,state:i,onDestroy:a,cache:s,Actions:n,update:l,html:r,reuseComponents:c,onChange:d,StyleMap:h}=t,u="chart-timeline-grid-row",m=Object.assign(Object.assign({},e),{api:o,state:i,componentName:u});let f;a(i.subscribe("config.components.ChartTimelineGridRowCell",(t=>f=t)));const g=o.getActions(u),p=o.getClass(u),w=new h({height:e.row.height+"px"});let b=!1;const v=o.generateSlots(u,t,e),y=[];d((function(t,i){if(!t||i.leave||void 0===t.row)return b=!0,c(y,[],(t=>t),f,!0),v.change(t,i),void l();b=!1,e=t;const a=o.getGridCells(e.cells);if(c(y,a,(t=>t),f,!0),w.setStyle({}),w.style.height=e.rowData.outerHeight+"px",e.row.style)for(const t in e.row.style)w.style[t]=e.row.style[t];for(const t in e)m[t]=e[t];v.change(t,i)})),a((function(){y.forEach((t=>t.destroy()))})),-1===g.indexOf(Z)&&g.push(Z);const P=n.create(g,m);function D({className:t,styleMap:e,rowsCellsComponents:o,cache:i,shouldDetach:a,actions:s,slots:n,html:l,vido:r,props:c}){return i(a||!c||!c.row?null:n.html("outer",l`
              <div
                class=${t}
                data-gstcid=${c.row.id}
                data-actions=${s()}
                style=${e.directive()}
              >
                ${n.html("content",o.map((t=>t.html())))}
              </div>
            `))}let x=D;return a(i.subscribe(`config.templates.${u}`,(t=>{x=null!=t?t:D,l()}))),()=>x({className:p,styleMap:w,rowsCellsComponents:y,cache:s,shouldDetach:b,actions:P,slots:v,html:r,vido:t,props:e})}
/**
 * ChartTimelineGridRowCell component
 *
 * @copyright NEURONET - Rafal Pospiech
 * @author    Rafal Pospiech <neuronet.io@gmail.com>
 * @module    gantt-schedule-timeline-calendar
 * @link      https://github.com/neuronetio/gantt-schedule-timeline-calendar
 * @link      https://gantt-schedule-timeline-calendar.neuronet.io
 * @version   3.40.5
 * @released  2025-03-24
 * @license   SEE LICENSE IN LICENSE FILE
 */class J{constructor(t,e){let o=!1,i=e.state.get("$data.elements.chart-timeline-grid-row-cells");void 0===i&&(i=[],o=!0),i.includes(t)||(i.push(t),o=!0),o&&e.state.update("$data.elements.chart-timeline-grid-row-cells",i,{only:null})}destroy(t,e){e.state.update("$data.elements.chart-timeline-grid-row-cells",(e=>e.filter((e=>e!==t))),{only:[""]})}}function q(t,e){const{api:o,state:i,cache:a,Actions:s,html:n,onChange:l,onDestroy:r,StyleMap:c,update:d}=t,h="chart-timeline-grid-row-cell",u=Object.assign(Object.assign({},e),{api:o,state:i,componentName:h});let m=!1;const f=o.getActions(h),g=o.generateSlots(h,t,e);let p;function w(t){p=o.getClass(h),t&&t.time&&t.time.current&&(p+=" current")}w(e);const b=new c({width:"",height:""});l((function(t,o){var i,a;if(!t||o.leave||void 0===t.row)return m=!0,g.change(t,o),void d();m=!1,e=t;for(const t in e)u[t]=e[t];if(w(e),b.setStyle({}),e&&e.row){if(b.style.width=((null===(a=null===(i=null==e?void 0:e.time)||void 0===i?void 0:i.currentView)||void 0===a?void 0:a.width)||0)+"px",e.row.style)for(const t in e.row.style)b.style[t]=e.row.style[t];g.change(e,o),d()}})),f.push(J);const v=s.create(f,u);function y({className:t,styleMap:e,cache:o,shouldDetach:i,actions:a,slots:s,html:n,vido:l,props:r}){var c;return o(i||!r||!r.id?null:s.html("outer",n`
              <div class=${t} data-gstcid=${r.id} data-actions=${a()} style=${e.directive()}>
                ${s.html("content",null!==(c=r&&r.content)&&void 0!==c?c:null)}
              </div>
            `))}let P=y;return r(i.subscribe(`config.templates.${h}`,(t=>{P=null!=t?t:y,d()}))),()=>P({className:p,styleMap:b,cache:a,shouldDetach:m,actions:v,slots:g,html:n,vido:t,props:e})}
/**
 * ChartTimelineItems component
 *
 * @copyright NEURONET - Rafal Pospiech
 * @author    Rafal Pospiech <neuronet.io@gmail.com>
 * @module    gantt-schedule-timeline-calendar
 * @link      https://github.com/neuronetio/gantt-schedule-timeline-calendar
 * @link      https://gantt-schedule-timeline-calendar.neuronet.io
 * @version   3.40.5
 * @released  2025-03-24
 * @license   SEE LICENSE IN LICENSE FILE
 */function Q(t,e={}){const{api:o,state:i,onDestroy:a,Actions:s,update:n,html:l,reuseComponents:r,StyleMap:c}=t,d="chart-timeline-items";let h,u;a(i.subscribe(`config.actions.${d}`,(t=>h=t))),a(i.subscribe("config.components.ChartTimelineItemsRow",(t=>u=t)));const m=o.getClass(d),f=new c({});let g;a(i.subscribeAll(["$data.chart.dimensions.heightWithoutScrollBar","$data.chart.dimensions.width","$data.scroll.vertical.preciseOffset"],(function(){const t=i.get("$data.chart.dimensions.width"),e=o.getRealChartHeight();f.style.width=t+"px",f.style.height=e+"px"}),{group:!0})),a(i.subscribe("config.debug",(t=>g=t)));const p=[],w={};a(i.subscribeAll(["$data.list.visibleRows","config.list.rows","config.components.ChartTimelineItemsRow","config.chart.items","$data.chart.items","$data.chart.time","$data.chart.viewPortVisibleItems","config.templates"],(function t(e,a){i.mute(t),g&&console.log("[items.ts] Updating item & rows components.");const s=i.get("$data.list.visibleRows")||[],l=o.getRows(s),c=o.getRowsData();for(const t of l)w[t.id]||(w[t.id]={}),w[t.id].row=t,w[t.id].rowData=c[t.id];for(const t in w)s.includes(t)||delete w[t];r(p,l,(t=>t?w[t.id]:null),u,!0),n(),i.unmute(t)}),{group:!0,bulkValue:!1})),a((()=>{p.forEach((t=>t.destroy()))}));const b={api:o,state:i,componentName:d},v=s.create(h,b),y=o.generateSlots(d,t,e);function P({className:t,styleMap:e,rowsComponents:o,actions:i,slots:a,html:s,vido:n,props:l}){return a.html("outer",s`
        <div class=${t} style=${e.directive()} data-actions=${i()}>
          ${a.html("content",o.map((t=>t.html())))}
        </div>
      `)}let D=P;return a(i.subscribe(`config.templates.${d}`,(t=>{D=null!=t?t:P,n()}))),()=>D({className:m,styleMap:f,rowsComponents:p,actions:v,slots:y,html:l,vido:t,props:e})}
/**
 * ChartTimelineItemsRow component
 *
 * @copyright NEURONET - Rafal Pospiech
 * @author    Rafal Pospiech <neuronet.io@gmail.com>
 * @module    gantt-schedule-timeline-calendar
 * @link      https://github.com/neuronetio/gantt-schedule-timeline-calendar
 * @link      https://gantt-schedule-timeline-calendar.neuronet.io
 * @version   3.40.5
 * @released  2025-03-24
 * @license   SEE LICENSE IN LICENSE FILE
 */class X{constructor(t,e){let o=!1,i=e.state.get("$data.elements.chart-timeline-items-rows");void 0===i&&(i=[],o=!0),i.includes(t)||(i.push(t),o=!0),o&&e.state.update("$data.elements.chart-timeline-items-rows",i,{only:null})}destroy(t,e){e.state.update("$data.elements.chart-timeline-items-rows",(e=>e.filter((e=>e!==t))),{only:null})}}function tt(t,e){const{api:o,state:i,onDestroy:a,cache:s,Actions:n,update:l,html:r,onChange:c,reuseComponents:d,StyleMap:h}=t,u="chart-timeline-items-row",m=Object.assign(Object.assign({},e),{api:o,state:i,componentName:u});let f;a(i.subscribe("config.components.ChartTimelineItemsRowItem",(t=>f=t)));let g="";const p=[],w=new h({width:"",height:""});let b=!1;function v(t=e.rowData,o=null){const a=i.get("$data.chart");b=!1,w.style.width=a.dimensions.width+"px",e?(w.style.height=t.outerHeight+"px",w.style["--row-height"]=t.outerHeight+"px",l()):b=!0}function y(t,e){if(!t||!e)return b=!0,d(p,[],(()=>null),f,!0),l();const i=e.items;if(void 0===i)return b=!0,d(p,[],(()=>null),f,!0),v(),l();const a=o.getItems(i).filter((t=>o.isItemHorizontallyInViewport(t)));d(p,a,(e=>({row:t,item:e,itemData:e?o.getItemData(e.id):null})),f,!0),v(),l()}const P=o.getClass(u),D=o.generateSlots(u,t,e);c((function(o,i){if(i.leave||!o||void 0===o.row)return b=!0,d(p,[],(()=>null),f,!0),D.change(o,i),l();e=o;for(const t in e)m[t]=e[t];if(e.row.classNames){if(Array.isArray(e.row.classNames)&&e.row.classNames.length)g=P+" "+e.row.classNames.join(" ");else if("function"==typeof e.row.classNames){const o=e.row.classNames({row:e.row,vido:t});Array.isArray(o)&&o.length&&(g=P+" "+o.join(" "))}}else g=P;y(e.row,e.rowData),D.change(o,i),l()})),a(i.subscribe("$data.chart.dimensions.width",(()=>y(e.row,e.rowData)))),a((()=>{p.forEach((t=>t.destroy()))}));const x=o.getActions(u);x.push(X);const C=n.create(x,m);function W({classNameCurrent:t,styleMap:e,shouldDetach:o,itemComponents:i,actions:a,slots:s,cache:n,html:l,vido:r,props:c}){return n(o||!c||!c.row?null:s.html("outer",l`
              <div
                class=${t}
                data-gstcid=${c.row.id}
                data-actions=${a()}
                style=${e.directive()}
              >
                ${s.html("content",i.map((t=>t.html())))}
              </div>
            `))}let $=W;return a(i.subscribe(`config.templates.${u}`,(t=>{$=null!=t?t:W,l()}))),()=>$({cache:s,shouldDetach:b,classNameCurrent:g,styleMap:w,itemComponents:p,actions:C,slots:D,html:r,vido:t,props:e})}
/**
 * ChartTimelineItemsRowItem component
 *
 * @copyright NEURONET - Rafal Pospiech
 * @author    Rafal Pospiech <neuronet.io@gmail.com>
 * @module    gantt-schedule-timeline-calendar
 * @link      https://github.com/neuronetio/gantt-schedule-timeline-calendar
 * @link      https://gantt-schedule-timeline-calendar.neuronet.io
 * @version   3.40.5
 * @released  2025-03-24
 * @license   SEE LICENSE IN LICENSE FILE
 */class et{constructor(t,e){let o=!1,i=e.state.get("$data.elements.chart-timeline-items-row-items");void 0===i&&(i=[],o=!0),i.includes(t)||(i.push(t),o=!0),o&&e.state.update("$data.elements.chart-timeline-items-row-items",i,{only:null})}destroy(t,e){e.state.update("$data.elements.chart-timeline-items-row-items",(e=>e.filter((e=>e!==t))),{only:null})}}function ot(t,e){const{api:o,state:i,cache:a,onDestroy:s,Actions:n,update:l,html:r,onChange:c,unsafeHTML:d,StyleMap:h}=t;let u,m,f=0,g=0;s(i.subscribe("config.chart.spacing",(t=>{"number"==typeof t?(g=t,f=0):("number"==typeof t.left&&(f=t.left),"number"==typeof t.right&&(g=t.right)),l()})));const p="chart-timeline-items-row-item";let w=0,b=0,v=!1,y="";const P=new h({width:"",height:"",left:"",top:""}),D=new h({}),x=new h({}),C={item:e.item,itemData:e.itemData,row:e.row,left:w,width:b,api:o,state:i,componentName:p},W=o.getClass(p),$=o.getClass(p+"-label"),I=o.generateSlots(p,t,e);let S,M=!1;s(i.subscribe("config.chart.item.cutIcons",(t=>{S={left:o.getSVGIconSrc(t.left),right:o.getSVGIconSrc(t.right)}})));const G=o.getClass(`${p}-cut`)+" "+o.getClass(`${p}--left-cut-icon`),z=o.getClass(`${p}-cut-image`),T=()=>r`
    <div class=${G} style=${D.directive()}>
      <img src="${S.left}" width="18" height="18" class=${z} />
    </div>
  `,k=o.getClass(`${p}-cut`)+" "+o.getClass(`${p}--right-cut-icon`),L=o.getClass(`${p}-cut-image`),R=()=>r`
    <div class=${k} style=${x.directive()}>
      <img src="${S.right}" width="18" height="18" class=${L} />
    </div>
  `;c((function(a,s){if(s.leave||void 0===a.row||void 0===a.item)return v=!0,M=!0,I.change(a,s),l();M=!1,v=!1,(e=a).item.id===u&&e.row.id===m||(u=e.item.id,m=e.row.id),C.item=e.item,C.itemData=e.itemData,C.row=e.row,function(){var a;if(M)return l();const s=i.get("$data.chart.time");if(v||0===s.levels.length||!s.levels[s.level]||0===s.levels[s.level].length)return M=!0,l();if(!e.item||!e.itemData)return M=!0,l();if(!i.get().$data.chart.verticallyVisibleItems.includes(e.item.id))return M=!0,l();const n=e.itemData;if(w=n.position.actualLeft+f,b=n.actualWidth-g-f,e.item.time.end<s.leftGlobal||e.item.time.start>s.rightGlobal||b<=0)return M=!0,n.detached=M,l();if(y=W,e.item.time.start<s.leftGlobal?(D.style.display="flex",y+=" "+o.getClass(p+"--left-cut")):D.style.display="none",e.item.time.end>s.rightGlobal?(x.style.display="flex",y+=" "+o.getClass(p+"--right-cut")):x.style.display="none",e.item.classNames)if(Array.isArray(e.item.classNames)&&e.item.classNames.length)y+=" "+e.item.classNames.join(" ");else if("function"==typeof e.item.classNames){const o=e.item.classNames({item:e.item,vido:t});Array.isArray(o)&&(y+=" "+o.join(" "))}const r=P.style.width,c=P.style.left,d=P.style.top,h=P.style.height;P.setStyle({});const u=o.isItemHorizontallyInViewport(e.item,s.leftGlobal,s.rightGlobal);if(M=!u,n.detached=M,u?(P.style.width=b+"px",P.style.left=w+"px",P.style.top=n.position.actualRowTop+"px",P.style.height=n.actualHeight+"px"):(P.style.width=r,P.style.left=c,P.style.top=d,P.style.height=h),null===(a=null==e?void 0:e.item)||void 0===a?void 0:a.style)for(const t in e.item.style)P.style[t]=e.item.style[t];C.left=w,C.width=b,l()}(),I.change(a,s),l()}));const O=o.getActions(p);O.push(et);const A=n.create(O,C);function V(){return e.item?e.item.isHTML?e.item&&e.item.label?"function"==typeof e.item.label?d(e.item.label({item:e.item,vido:t})):"string"==typeof e.item.label?d(e.item.label):null:null:e.item&&e.item.label?"function"==typeof e.item.label?e.item.label({item:e.item,vido:t}):e.item.label:null:null}function N({className:t,labelClassName:e,styleMap:o,cache:i,shouldDetach:a,cutterLeft:s,cutterRight:n,getContent:l,actions:r,slots:c,html:d,vido:h,props:u}){return i(a||!u||!u.item?null:c.html("outer",d`
              <div
                class=${t}
                data-gstcid=${u.item.id}
                data-actions=${r()}
                style=${o.directive()}
              >
                ${c.html("inner",d`
                    ${s()}
                    <div class=${e}>${c.html("content",l())}</div>
                    ${n()}
                  `)}
              </div>
            `))}let _=N;return c((()=>{const t=i.get(`config.templates.${p}`);_=null!=t?t:N,l()})),()=>_({className:y,labelClassName:$,cache:a,shouldDetach:M,styleMap:P,cutterLeft:T,cutterRight:R,getContent:V,actions:A,slots:I,html:r,vido:t,props:e})}
/**
 * Gantt-Schedule-Timeline-Calendar default configuration
 *
 * @copyright NEURONET - Rafal Pospiech
 * @author    Rafal Pospiech <neuronet.io@gmail.com>
 * @module    gantt-schedule-timeline-calendar
 * @link      https://github.com/neuronetio/gantt-schedule-timeline-calendar
 * @link      https://gantt-schedule-timeline-calendar.neuronet.io
 * @version   3.40.5
 * @released  2025-03-24
 * @license   SEE LICENSE IN LICENSE FILE
 */const it=["main","scroll-bar","list","list-column","list-column-header","list-column-header-resizer","list-column-row","list-column-row-expander","list-column-row-expander-toggle","list-toggle","chart","chart-calendar","chart-calendar-date","chart-timeline","chart-timeline-grid","chart-timeline-grid-row","chart-timeline-grid-row-cell","chart-timeline-items","chart-timeline-items-row","chart-timeline-items-row-item"];function at(){const t={};return it.forEach((e=>t[e]=[])),t}function st(){const t={};return it.forEach((e=>t[e]=null)),t}function nt(){const t={};return it.forEach((e=>{t[e]={outer:[],inner:[],"container-outer":[],"container-inner":[],content:[]}})),t}function lt(){const t=[{zoomTo:17,period:"day",periodIncrement:1,classNames:["gstc-date-medium gstc-date-left"],format:({timeStart:t})=>t.format("DD MMMM YYYY (dddd)")},{zoomTo:23,period:"month",periodIncrement:1,format:({timeStart:t})=>t.format("MMMM YYYY")},{zoomTo:24,period:"month",periodIncrement:1,format:({timeStart:t})=>t.format("MMMM 'YY")},{zoomTo:25,period:"month",periodIncrement:1,format:({timeStart:t})=>t.format("MMM YYYY")},{zoomTo:27,period:"year",periodIncrement:1,format:({timeStart:t})=>t.format("YYYY")},{zoomTo:100,period:"year",periodIncrement:1,format:()=>null}],e=[{zoomTo:9,period:"minute",classNames:["gstc-date-medium"],main:!0,periodIncrement:1,format:({timeStart:t})=>t.format("HH:mm")},{zoomTo:11,period:"minute",classNames:["gstc-date-medium"],main:!0,periodIncrement:5,format:({timeStart:t})=>t.format("HH:mm")},{zoomTo:12,period:"minute",classNames:["gstc-date-medium"],main:!0,periodIncrement:15,format:({timeStart:t})=>t.format("HH:mm")},{zoomTo:13,period:"minute",classNames:["gstc-date-medium"],main:!0,periodIncrement:30,format:({timeStart:t})=>t.format("HH:mm")},{zoomTo:16,period:"hour",classNames:["gstc-date-medium"],main:!0,periodIncrement:1,format:({timeStart:t})=>t.format("HH:mm")},{zoomTo:17,period:"hour",main:!0,periodIncrement:1,format:({timeStart:t})=>t.format("HH")},{zoomTo:19,period:"day",main:!0,periodIncrement:1,classNames:["gstc-date-medium"],format:({timeStart:t,className:e,vido:o})=>o.html`<span class="${e}-content gstc-date-bold">${t.format("DD")}</span> <span class="${e}-content gstc-date-thin">${t.format("dddd")}</span>`},{zoomTo:20,period:"day",main:!0,periodIncrement:1,format:({timeStart:t,vido:e,className:o})=>e.html`<div class="${o}-content gstc-date-top">${t.format("DD")}</div><div class="${o}-content gstc-date-small">${t.format("dddd")}</div>`},{zoomTo:21,period:"day",main:!0,periodIncrement:1,format:({timeStart:t,vido:e,className:o})=>e.html`<div class="${o}-content gstc-date-top">${t.format("DD")}</div><div class="${o}-content gstc-date-small">${t.format("ddd")}</div>`},{zoomTo:22,period:"day",main:!0,periodIncrement:1,classNames:["gstc-date-vertical"],format:({timeStart:t,className:e,vido:o})=>o.html`<div class="${e}-content gstc-date-top">${t.format("DD")}</div><div class="${e}-content gstc-date-extra-small">${t.format("ddd")}</div>`},{zoomTo:23,period:"week",main:!0,periodIncrement:1,format:({timeStart:t,timeEnd:e,className:o,vido:i})=>i.html`<div class="${o}-content gstc-date-top">${t.format("DD")} - ${e.format("DD")}</div><div class="${o}-content gstc-date-small gstc-date-thin">${t.format("ddd")} - ${e.format("dd")}</div>`},{zoomTo:25,period:"week",main:!0,periodIncrement:1,classNames:["gstc-date-vertical"],format:({timeStart:t,timeEnd:e,className:o,vido:i})=>i.html`<div class="${o}-content gstc-date-top gstc-date-small gstc-date-normal">${t.format("DD")}</div><div class="gstc-dash gstc-date-small">-</div><div class="${o}-content gstc-date-small gstc-date-normal">${e.format("DD")}</div>`},{zoomTo:26,period:"month",main:!0,periodIncrement:1,classNames:["gstc-date-month-level-1"],format:({timeStart:t,vido:e,className:o})=>e.html`<div class="${o}-content gstc-date-top">${t.format("MMM")}</div><div class="${o}-content gstc-date-small gstc-date-bottom">${t.format("MM")}</div>`},{zoomTo:27,period:"month",main:!0,periodIncrement:1,classNames:["gstc-date-vertical"],format:({timeStart:t,className:e,vido:o})=>o.html`<div class="${e}-content gstc-date-top">${t.format("MM")}</div><div class="${e}-content gstc-date-extra-small">${t.format("MMM")}</div>`},{zoomTo:28,period:"year",main:!0,periodIncrement:1,classNames:["gstc-date-big"],format:({timeStart:t})=>t.format("YYYY")},{zoomTo:29,period:"year",main:!0,periodIncrement:1,classNames:["gstc-date-medium"],format:({timeStart:t})=>t.format("YYYY")},{zoomTo:30,period:"year",main:!0,periodIncrement:1,classNames:["gstc-date-medium"],format:({timeStart:t})=>t.format("YY")},{zoomTo:100,period:"year",main:!0,periodIncrement:1,format:()=>null}];return{licenseKey:"",debug:!1,plugins:[],plugin:{},innerHeight:428,initialWidth:1024,additionalSpace:{top:0,bottom:0},headerHeight:72,autoInnerHeight:!1,components:{ScrollBar:G,List:z,ListColumn:k,ListColumnHeader:L,ListColumnHeaderResizer:R,ListColumnRow:A,ListColumnRowExpander:V,ListColumnRowExpanderToggle:N,ListToggle:_,Chart:H,ChartCalendar:B,ChartCalendarDate:j,ChartTimeline:Y,ChartTimelineGrid:U,ChartTimelineGridRow:K,ChartTimelineGridRowCell:q,ChartTimelineItems:Q,ChartTimelineItemsRow:tt,ChartTimelineItemsRowItem:ot},slots:nt(),list:{rows:{},row:{height:40,gap:{top:0,bottom:0}},columns:{percent:100,resizer:{width:10,inRealTime:!0,dots:6},minWidth:50,data:{}},expander:{padding:18,size:20,icon:{width:16,height:16},icons:{child:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><ellipse ry="4" rx="4" id="svg_1" cy="12" cx="12" fill="#000000B0"/></svg>',open:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"/><path fill="none" d="M0 0h24v24H0V0z"/></svg>',closed:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"/><path fill="none" d="M0 0h24v24H0V0z"/></svg>'}},toggle:{display:!0,icons:{open:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path stroke="null" d="m16.406954,16.012672l4.00393,-4.012673l-4.00393,-4.012673l1.232651,-1.232651l5.245324,5.245324l-5.245324,5.245324l-1.232651,-1.232651z"/><path stroke="null" d="m-0.343497,12.97734zm1.620144,0l11.341011,0l0,-1.954681l-11.341011,0l0,1.954681zm0,3.909362l11.341011,0l0,-1.954681l-11.341011,0l0,1.954681zm0,-9.773404l0,1.95468l11.341011,0l0,-1.95468l-11.341011,0z"/></svg>',close:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path transform="rotate(-180 4.392796516418457,12) " stroke="null" d="m1.153809,16.012672l4.00393,-4.012673l-4.00393,-4.012673l1.232651,-1.232651l5.245324,5.245324l-5.245324,5.245324l-1.232651,-1.232651z"/><path stroke="null" d="m9.773297,12.97734zm1.620144,0l11.341011,0l0,-1.954681l-11.341011,0l0,1.954681zm0,3.909362l11.341011,0l0,-1.954681l-11.341011,0l0,1.954681zm0,-9.773404l0,1.95468l11.341011,0l0,-1.95468l-11.341011,0z"/></svg>'}},sort:{compare:null,asc:!0,activeColumnId:null,icons:{up:'<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" class="feather feather-arrow-up"><line x1="12" y1="19" x2="12" y2="5"></line><polyline points="5 12 12 5 19 12"></polyline></svg>',down:'<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" class="feather feather-arrow-down"><line x1="12" y1="5" x2="12" y2="19"></line><polyline points="19 12 12 19 5 12"></polyline></svg>'}}},scroll:{bodyClassName:"gstc-scrolling",horizontal:{width:20,minInnerSize:40,multiplier:1,precise:!0,byPixels:!0},vertical:{width:20,minInnerSize:40,multiplier:1,precise:!0,byPixels:!0}},chart:{time:{period:"day",from:0,to:0,zoom:20,leftGlobal:0,centerGlobal:0,rightGlobal:0,calculatedZoomMode:!1,onLevelDates:[],onCurrentViewLevelDates:[],onDate:[],allDates:[],autoExpandTimeFromItems:!1,alignLevelsToMain:!0,timePerPixel:0,checkCurrentDateInterval:3e5,datesCache:{timePerPixel:0,levels:[]}},calendarLevels:[t,e],grid:{cell:{onCreate:[]}},item:{gap:{top:4,bottom:4},rowTop:0,height:32,minWidth:10,overlap:!1,cutIcons:{left:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" width="1em" height="1em" style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path d="M20 9v6h-8v4.84L4.16 12L12 4.16V9h8z" fill="#ffffff"/><rect x="0" y="0" width="24" height="24" fill="rgba(0, 0, 0, 0)" /></svg>',right:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" width="1em" height="1em" style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path d="M4 15V9h8V4.16L19.84 12L12 19.84V15H4z" fill="#ffffff"/><rect x="0" y="0" width="24" height="24" fill="rgba(0, 0, 0, 0)" /></svg>'}},items:{},spacing:4},actions:at(),templates:st(),locale:{name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekStart:0,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},ordinal:t=>{const e=["th","st","nd","rd"],o=t%100;return`[${t}${e[(o-20)%10]||e[o]||e[0]}]`}},utcMode:!1,merge:(t,e)=>s.mergeDeep({},t,e),useLast:!0,Promise:Promise,mute:[],version:"3.40.5"}}const rt=s.mergeDeep;function ct(t){const e=lt();let o=function(t,e){return s.mergeDeep(t,e)};"function"==typeof t.merge&&(o=t.merge);const i=function(t,e,o){const i=o({},e.actions),a=o({},t.actions||{});let s=[...Object.keys(i),...Object.keys(a)];s=s.filter((t=>s.includes(t)));const n={};for(const t of s)n[t]=[],void 0!==i[t]&&Array.isArray(i[t])&&(n[t]=[...i[t]]),void 0!==a[t]&&Array.isArray(a[t])&&(n[t]=[...n[t],...a[t]]);return delete t.actions,delete e.actions,n}(t,e,o),a={config:o(e,t)};return a.config.actions=i,a}t.extend(e),t.extend(o);const dt=!0;const ht=lt().locale,ut={name:"gstc",GSTCID:y.GSTCID,isGSTCID:y.isGSTCID,sourceID:y.sourceID,fromArray(t){const e=this.GSTCID,o={};for(const i of t)i.id=e(i.id),"rowId"in i&&(i.rowId=e(i.rowId)),"parentId"in i&&(i.parentId=e(i.parentId)),"dependant"in i&&(i.dependant=i.dependant.map((t=>e(t)))),"linkedWith"in i&&(i.linkedWith=i.linkedWith.map((t=>e(t)))),o[i.id]=i;return o},stateFromConfig:function(t){return this.state=new r(ct(t),{delimiter:".",useMute:dt,maxSimultaneousJobs:1e3,Promise:t.Promise,debug:!!t.debug,useCache:!1,useSplitCache:!0,useIndicesCache:!1,defaultBulkValue:!1})},wasmStateFromConfig:function(t,e="./wildcard_matcher_bg.wasm"){return c(this,void 0,void 0,(function*(){return this.state=new r(ct(t),{delimiter:".",useMute:dt,maxSimultaneousJobs:1e3}),yield this.state.loadWasmMatcher(e),this.state}))},merge:rt,mergeDeep:rt,clone:function(t){return rt({},t)},lithtml:n,html:n,vido:l,date:(e,o=!1,i=rt({},ht))=>(t.locale(i,null,!0),o?e?t.utc(e).locale(i.name):t.utc().locale(i.name):e?t(e).locale(i.name):t().locale(i.name)),setPeriod(t){return this.state.update("config.chart.time.period",t),this.state.get("config.chart.time.zoom")},dayjs:t};
/**
 * Main api
 *
 * @copyright NEURONET - Rafal Pospiech
 * @author    Rafal Pospiech <neuronet.io@gmail.com>
 * @module    gantt-schedule-timeline-calendar
 * @link      https://github.com/neuronetio/gantt-schedule-timeline-calendar
 * @link      https://gantt-schedule-timeline-calendar.neuronet.io
 * @version   3.40.5
 * @released  2025-03-24
 * @license   SEE LICENSE IN LICENSE FILE
 */
function mt(t,e){const{api:o,onDestroy:i,state:a,update:s,StyleMap:n}=t,l=o.name,r=new Map;let c;i(a.subscribe("config.debug",(t=>c=t)));let d=!1;function h(t,e){"fullReload"!==e.options.data&&g.fullReload(e,t)}function u(t,e){var o;["config","config.chart.items"].includes(e.path.update)||"config.list.rows"===e.path.update&&"expanded"!==(null===(o=e.options.data)||void 0===o?void 0:o.name)||(["config.list.rows.*.parentId"].includes(e.path.listener)?function(t,e){"subscribe"!==e.type&&"sortRowsByColumn"!==e.options.data&&"fullReload"!==e.options.data&&g.partialReload(!0,e,t)}(t,e):function(t,e){"subscribe"!==e.type&&"fullReload"!==e.options.data&&g.partialReload(!1,e,t)}(t,e))}function m(t=null,e){e&&"subscribe"===e.type||e&&e.options.data&&"update-vertically-visible-items"===e.options.data||g.minimalReload(e,t)}function f(){r.forEach((t=>t())),r.clear(),c&&console.log("Plugins destroyed.")}var g={className:C(l),styleMap:new n({}),initializePlugins(){i(a.subscribe("config.plugins",(e=>{if(void 0!==e&&Array.isArray(e)){r.forEach(((t,o)=>{e.includes(o)||(t(),r.delete(o))}));for(const o of e){if(r.has(o))continue;let e=o(t);"function"!=typeof e&&Object.prototype.hasOwnProperty.call(e,"destroy")?e=e.destroy.bind(e):"function"!=typeof e&&(e=()=>{}),r.set(o,e)}}c&&console.log("Plugins initialized.")}))),i(f)},heightChange(){if(o.isMutedMethod("heightChange"))return;const t=a.get("config"),e=a.get("config.scroll.horizontal.width"),i=t.innerHeight-e;a.multi(!0).update("$data.chart.dimensions.heightWithoutScrollBar",i).update("$data.chart.dimensions.innerHeight",t.innerHeight).update("$data.chart.dimensions.height",t.innerHeight+t.headerHeight).update("$data.height",t.innerHeight+t.headerHeight).done(),g.styleMap.style["--height"]=i+"px",g.styleMap.style.height=t.innerHeight+t.headerHeight+"px",o.calculateVerticalScrollSize(),s()},resizerActiveChange(t){d=t,g.className=C(o.name),d&&(g.className+=` ${o.name}__list-column-header-resizer--active`),s()},generateTreeFromVisibleRows(){if(o.isMutedMethod("generateTreeFromVisibleRows"))return;const t=o.getVisibleRowsId(),e=o.getAllRows(),i=o.getRowsData(),a={},n=[];for(const o of t){e[o];const t=i[o];a[o]=t;for(const e of t.items)n.push(e)}o.makeTreeMap(a,n,!0),s()},generateTree(t=!0){let e=a.get("$data.list.rowsIds");if(!e)return;e=e.slice();const i=a.get("config.list.rows");if(!t)return g.generateTreeFromVisibleRows();o.fillEmptyRowValues(i);let s=o.getAllRows();const n=o.getRowsData(),l=a.get("config.chart.items");o.prepareItems(l),o.makeTreeMap(n,Object.keys(l)),s=o.sortRowsByChildren(Object.values(s).map((t=>t.id)));a.get("config").list.rows=s;const r=Object.keys(s);a.update("$data.list.rowsIds",r),o.setAllRowsIdsCache(r)},prepareExpanded(){if(o.isMutedMethod("prepareExpanded"))return;const t=o.getAllRows();if(!t)return;const e=o.generateRowsWithParentsExpanded(t);a.update("$data.list.rowsWithParentsExpanded",e)},generateVisibleRowsAndItems(){if(o.isMutedMethod("generateVisibleRowsAndItems"))return;const t=o.getVisibleRows(),e=a.get("$data.list.visibleRows")||[];let i=!0;t.length!==e.length?i=!0:t.length&&(i=t.join("|")!==e.join("|"));let n=a.multi(!0);i&&(n=n.update("$data.list.visibleRows",t));const l=[],r=[],c=o.getRowsData(),d=a.get("config.chart.items");for(const e of t){const t=c[e];for(const e of t.items){l.push(e);const t=d[e];t&&o.isItemHorizontallyInViewport(t)&&r.push(e)}}n=n.update("$data.chart.verticallyVisibleItems",l),n=n.update("$data.chart.viewPortVisibleItems",r),n.done(),s()},updateItemsVerticalPositionsOfVisibleRows(){const t=o.getAllItems(),e=o.getItemsData(),i=o.getRowsData(),a=o.getVisibleRows();let s=[];for(const t of a){const e=i[t];e&&(s=s.concat(e.items))}for(const a of s){const s=t[a];s&&o.calculateItemVerticalPosition(a,e[a],i[s.rowId])}},getMutedListeners(){const t=[];return a.isMutedListener(h)&&t.push(h),a.isMutedListener(u)&&t.push(u),a.isMutedListener(m)&&t.push(m),t},triggerLoadedEvent(){Promise.resolve().then((()=>{const t=a.get("$data.elements.main");if(!t)return;const e=t.parentNode;if(!e)return;const o=new Event("gstc-loaded");t.dispatchEvent(o),e.dispatchEvent(o)}))},getLastPageDatesWidth(t,e){if(0===e.length)return 0;let o=0,i=0;if(e.length){if(Math.ceil(e[e.length-1].rightPx)>t)for(let a=e.length-1;a>=0;a--){const s=e[a];if(o+=s.width,o>=t){o-=s.width;break}i++}}return a.update("$data.scroll.horizontal",(t=>(t.lastPageSize=o,t.lastPageCount=i,t))),o},formatDate(e,o,i){const a=C("chart-calendar-date");return e.format({timeStart:o.leftGlobalDate.locale(i),timeEnd:o.rightGlobalDate.locale(i),vido:t,className:a,props:{date:o}})},generatePeriodDates(t,e,i,s){const n=t.period,l=e.fromDate,r=e.toDate,c=a.get("config.locale.name");let d=o.time.generatePeriodDates({leftDate:l,rightDate:r,level:i,levelIndex:s,period:n,time:e,callOnDate:!1,callOnLevelDates:!0});d=o.time.recalculateDatesWidths(d,e),s!==e.level&&(d=o.time.alignLevelToMain(s,d,e)),d=o.time.recalculateDatesPositions(d,e,!1,!1);for(const e of d)e.formatted=g.formatDate(t,e,c);return d},limitGlobal:t=>(t.leftGlobal<t.from&&(t.leftGlobal=t.from,t.leftGlobalDate=o.time.date(t.leftGlobal),t.leftGlobal=t.leftGlobalDate.valueOf()),t.rightGlobal>t.to&&(t.rightGlobal=t.to,t.rightGlobalDate=o.time.date(t.rightGlobal),t.rightGlobal=t.rightGlobalDate.valueOf()),t),setCenter(t){let e=Math.floor(t.rightGlobalDate.diff(t.leftGlobalDate,"millisecond",!0)/2);const i=o.time.getRightViewDate(t);i&&(i.width!==i.currentView.width&&(e-=(i.width-i.currentView.width)*t.timePerPixel),t.centerGlobalDate=t.leftGlobalDate.add(e,"millisecond"),t.centerGlobal=t.centerGlobalDate.valueOf())},guessPeriod(t,e){if(!t.zoom)return t;for(const o of e){const e=o.find((e=>+t.zoom<=+e.zoomTo));e&&e.main&&(t.period=e.period)}return t},getFormatAndLevelIndexForZoom(t,e=a.get("config.chart.calendarLevels")){let o=0,i=0;for(const a of e){for(const e of a)if(e.main&&t<=e.zoomTo)return i=o,{levelIndex:i,format:e};o++}if(!i)throw new Error(`There is no main date format for zoom ${t}.`)},generateAllDates(t,e){if(!t.zoom)return[];t.allDates=new Array(e.length),o.time.stopCheckingCurrentDates();const{format:i,levelIndex:a}=g.getFormatAndLevelIndexForZoom(t.zoom,e);t.level=a,t.allDates[t.level]=g.generatePeriodDates(i,t,e[a],t.level);let s=0;for(const i of e){const e=i.find((e=>+t.zoom<=+e.zoomTo));s!==t.level&&(t.allDates[s]=g.generatePeriodDates(e,t,i,s)),o.time.setDatesCacheLevel(s,t.allDates[s],t),s++}return o.time.checkCurrentDates(!0,t),t.allDates},getPeriodDatesAndCalculateViewOffsetFromAllDates(t,e){if(!t.length)return[];const i=t.filter((t=>t.leftGlobal<e.rightGlobal&&t.rightGlobal>=e.rightGlobal||t.leftGlobal<=e.leftGlobal&&t.rightGlobal>e.leftGlobal||t.leftGlobal>=e.leftGlobal&&t.rightGlobal<=e.rightGlobal));if(!i.length)return[];let a=0;e.leftGlobal>i[0].leftGlobal&&(a=o.time.getDatesDiffPx(e.leftGlobalDate,i[0].leftGlobalDate,e,!0));let s=a;const n=i.length-1;return i.map(((t,i)=>{if(t.currentView={leftPx:s,rightPx:s+t.width,width:t.width+a,leftGlobalDate:o.time.date(t.leftGlobal-a*e.timePerPixel),rightGlobalDate:o.time.date(t.rightGlobal),durationMs:0},t.currentView.durationMs=t.currentView.rightGlobalDate.valueOf()-t.currentView.leftGlobalDate.valueOf(),a=0,s+=t.width,i===n&&t.rightGlobal>e.rightGlobal){let i=0;t.currentView.leftPx<0&&(i=t.currentView.leftPx,t.currentView.leftPx=0),t.currentView.width=(e.rightGlobal+1-t.leftGlobal)/e.timePerPixel+i,t.currentView.rightPx=t.currentView.leftPx+t.currentView.width,t.currentView.rightGlobalDate=o.time.date(t.leftGlobal+t.currentView.width*e.timePerPixel)}return t}))},updateLevels(t,e){t.levels=[],t.currentZoomLevelFormatting=[];let o=0;for(const i of e){const e=i.find((e=>+t.zoom<=+e.zoomTo));if(t.currentZoomLevelFormatting[o]=e,e.main&&(t.format=e,t.level=o),e){let a=g.getPeriodDatesAndCalculateViewOffsetFromAllDates(t.allDates[o],t);t.onCurrentViewLevelDates.forEach((s=>{a=s({dates:a,format:e,time:t,level:i,levelIndex:o})})),t.levels.push(a)}o++}},updateLocale(){const t=a.get("$data.chart.time"),e=a.get("config.locale.name");let o=0;for(const i of t.allDates){const a=t.currentZoomLevelFormatting[o];for(const t of i)t.formatted=g.formatDate(a,t,e);o++}o=0;for(const i of t.levels){const a=t.currentZoomLevelFormatting[o];for(const t of i)t.formatted=g.formatDate(a,t,e);o++}s()},calculateTotalViewDurationFromDates(t){let e=0,o=0;for(const i of t.allDates[t.level])e+=i.width,o+=i.rightGlobal+1-i.leftGlobal;t.totalViewDurationPx=e,t.totalViewDurationMs=o},calculateRightGlobal(t,e,i,s,n){const l=a.get("$data.chart.time"),r=t.endOf(l.period).valueOf(),c=o.time.findDateAtTime(r,i);if(!c)return t.valueOf();let d=i.indexOf(c),h=c.leftGlobal,u=0;for(let t=i.length;d<t;d++){const t=i[d];if(h=t.rightGlobal,u+=t.width,u+s>=e)break}return h+n},updateViewPortVisibleItems(t=!1,e=a.get("$data.chart.time")){const i=a.get("$data.chart.verticallyVisibleItems"),s=o.getItems(i);if(!s)return[];const n=[];for(const t of s)o.isItemHorizontallyInViewport(t,e.leftGlobal,e.rightGlobal)&&n.push(t.id);if(t){a.get("$data.chart").viewPortVisibleItems=n}else a.update("$data.chart.viewPortVisibleItems",n);return s},updateViewPortVisibleItemsPositions(t=a.get("$data.chart.time"),e=a.multi(!0)){const i=a.get("$data.chart.viewPortVisibleItems"),s=o.getItems(i);if(!s)return e;const n=o.getAllRows(),l=o.getRowsData(),r=o.getItemsData();if(!n)return e;if(!t.levels||!t.levels[t.level])return e;let c=!1;for(const i of s){if(!i)return e;const a=n[i.rowId],s=l[i.rowId];if(!a||!s)continue;const d=o.mergeDeep({},r[i.id]),h=d.position,u=o.calculateItemPosition(i.id,r[i.id],s,t,i);for(const t in h)if(u[t]!==h[t]){c=!0;break}if(!c)for(const t in d)if(r[i.id][t]!==d[t]){c=!0;break}}return c&&(e=e.update("$data.chart.items",(t=>t),{data:"update-vertically-visible-items"})),e},calculateLeftAndRightGlobalNormally(t,e){const i=t.allDates[t.level],a=e.preciseOffset*t.timePerPixel;let s=i[e.dataIndex];if(!s&&i.length)s=i[i.length-1];else if(!i.length)return;t.leftGlobal=s.leftGlobal-a,t.leftGlobalDate=o.time.date(t.leftGlobal);let n=e.preciseOffset;const l=o.getChartWidth(!1);let r;for(let o=e.dataIndex;o<i.length;o++){const e=i[o];if(n+=e.width,n>=l){const o=(n-l)*t.timePerPixel;r=e.rightGlobal-o;break}}if(!r){r=i[i.length-1].rightGlobal}t.rightGlobal=r,t.rightGlobalDate=o.time.date(t.rightGlobal)},calculateLeftAndRightGlobalFromCenter(t,e,i){const a=o.getChartWidth(!1),s=t.allDates[t.level];if(s.length||(t.leftGlobal=t.from,t.leftGlobalDate=o.time.date(t.leftGlobal),t.rightGlobal=null,t.rightGlobalDate=null),0===i.handlePosPx){t.leftGlobal=t.fromDate.valueOf(),t.leftGlobalDate=o.time.date(t.leftGlobal),t.rightGlobal=o.time.getTimeFromOffsetPx(a,!1,t),t.rightGlobalDate=o.time.date(t.rightGlobal);const e=s[0];return i.dataId=e.id,i.dataIndex=0,i.preciseOffset=0,t}if(i.handlePosPx===i.maxHandlePosPx){t.rightGlobal=t.toDate.valueOf(),t.rightGlobalDate=o.time.date(t.rightGlobal);let e=s[s.length-1];let n=0,l=s.length-1;for(;l>=0;l--){const t=s[l];if(n+=t.width,n>=a){e=t;break}}const r=(n-a)/t.timePerPixel;t.leftGlobal=e.leftGlobal+r,t.leftGlobalDate=o.time.date(t.leftGlobal);const c=s[s.length-1];return i.dataId=c.id,i.dataIndex=s.length-1,i.preciseOffset=0,t}const n=Math.round(a/2);let l=0;for(const e of s){if(e.rightGlobal>t.centerGlobal)break;l++}if(l>=s.length||t.centerGlobal<s[0].leftGlobal||t.centerGlobal>s[s.length-1].rightGlobal)return g.calculateLeftAndRightGlobalNormally(t,i);const r=e.centerGlobal-s[l].leftGlobal;let c,d=-Math.round(r/t.timePerPixel),h=0;for(let t=l;t>=0;t--){const e=s[t];if(d+=e.width,d>=n){c=e,h=t;break}}c||(c=s[0],d=n);const u=d-n,m=Math.round(u*t.timePerPixel);t.leftGlobal=c.leftGlobal+m,t.leftGlobalDate=o.time.date(t.leftGlobal);let f,p=-u;const w=s.length;for(let t=0;t<w;t++){const e=s[t];if(p+=e.width,p>=a){f=e;break}}f||(f=s[s.length-1],p=a);const b=p-a,v=Math.round(b*t.timePerPixel);return t.rightGlobal=f.rightGlobal-v,t.rightGlobalDate=o.time.date(t.rightGlobal),i.dataId=c.id,i.dataIndex=h,i.preciseOffset=-u,t},updateFromToBasedOnDates(t){const e=t.allDates[t.level];e.length&&(t.from=e[0].leftGlobal,t.fromDate=o.time.date(t.from),t.to=e[e.length-1].rightGlobal,t.toDate=o.time.date(t.to))},recalculateTimes(t){if(o.isMutedMethod("recalculateTimes"))return;const i=a.get("config.chart.time"),n=e({},i),l=a.get("$data.chart.time");n.allDates=l.allDates||new Array(n.levels.length),n.datesCache=l.datesCache||{timePerPixel:0,levels:[]};const r=a.get("config.chart.items");if(!(n.from&&n.to||Object.keys(r).length))return;if("number"!=typeof n.from&&void 0!==n.from||"number"!=typeof n.to&&void 0!==n.to)throw new Error("[gantt-schedule-timeline-calendar] 'config.chart.time.from' and 'config.chart.time.to' must be a number (unix epoch milliseconds).");if(!n.from){let t=1/0;for(const e in r){const o=r[e];t>o.time.start&&(t=o.time.start)}n.from=t}if(!n.to){let t=0;for(const e in r){const o=r[e];t<o.time.end&&(t=o.time.end)}n.to=t}n.fromDate||(n.fromDate=o.time.date(n.from)),n.toDate||(n.toDate=o.time.date(n.to));const c=a.get("$data.scroll.vertical.visible"),d=o.getChartWidth(c),h=a.get("config.chart.calendarLevels"),u=a.get("$data.scroll.horizontal");n.calculatedZoomMode||o.time.recalculateFromTo(n),n.leftGlobal||(n.leftGlobal=n.from);const m=t.filter((t=>"items-out-of-view"===t.name));let f=1/0,p=0;if(m.length)for(const t of m)f>t.from&&(f=t.from),p<t.to&&(p=t.to);let w=!1;if((t.find((t=>"reload"===t.name))||t.find((t=>"all"===t.name))||t.find((t=>"from"===t.name))||t.find((t=>"to"===t.name))||t.find((t=>"zoom"===t.name))||t.find((t=>"calculated-zoom-mode"===t.name))||t.find((t=>"align-levels"===t.name))||t.find((t=>"auto-expand-time"===t.name))||t.find((t=>"locale"===t.name)))&&(w=!0),n.calculatedZoomMode&&d){n.totalViewDurationMs=o.time.date(n.to).add(1,n.period).startOf(n.period).diff(n.from,"millisecond"),n.timePerPixel=n.totalViewDurationMs/d,n.totalViewDurationPx=n.totalViewDurationMs/n.timePerPixel,n.zoom=Math.log(n.timePerPixel)/Math.log(2),o.resetHorizontalScroll(),w&&g.generateAllDates(n,h),g.calculateTotalViewDurationFromDates(n),n.timePerPixel=n.totalViewDurationMs/d,n.zoom=Math.log(n.timePerPixel)/Math.log(2);for(let t=0;t<n.allDates.length;t++)o.time.recalculateDatesWidths(n.allDates[t],n),o.time.recalculateDatesPositions(n.allDates[t],n),o.time.setDatesCacheLevel(t,n.allDates[t],n);g.calculateTotalViewDurationFromDates(n),n.leftGlobal=n.from,n.leftGlobalDate=o.time.date(n.leftGlobal),n.rightGlobal=n.to,n.rightGlobalDate=o.time.date(n.rightGlobal)}else{n.timePerPixel=Math.pow(2,n.zoom),m.length&&n.autoExpandTimeFromItems&&(n.from=f,n.to=p),n.fromDate=o.time.date(n.from).startOf(n.period),n.from=n.fromDate.valueOf(),n.toDate=o.time.date(n.to).endOf(n.period),n.to=n.toDate.valueOf(),w&&g.generateAllDates(n,h),m.length&&n.autoExpandTimeFromItems||g.updateFromToBasedOnDates(n),g.calculateTotalViewDurationFromDates(n);const e=a.get("$data.chart.time");t.find((t=>"zoom"===t.name))&&!t.find((t=>"all"===t.name))&&e.centerGlobalDate?(g.calculateLeftAndRightGlobalFromCenter(n,e,u),o.calculateHorizontalScrollSizeAndPosFromDates(n.totalViewDurationPx,n,u,!1)):(o.calculateHorizontalScrollSizeAndPosFromDates(n.totalViewDurationPx,n,u,!1),g.calculateLeftAndRightGlobalNormally(n,u))}g.updateLevels(n,h),g.limitGlobal(n),n.leftPx=0,n.rightPx=d,n.width=d;const b=n.levels[n.level];if(b&&b.length){const t=b[b.length-1];n.leftPx=b[0].leftPx-u.preciseOffset,n.rightPx=t.rightPx,n.width=n.rightPx}g.setCenter(n);let v=a.multi(!0);v=v.update("config.chart.time",(t=>((t=Object.assign({},t)).zoom=n.zoom,t.level=n.level,t.period=n.format.period,t.leftGlobal=n.leftGlobal,t.leftGlobalDate=n.leftGlobalDate.clone(),t.centerGlobal=n.centerGlobal,t.rightGlobal=n.rightGlobal,t.rightGlobalDate=n.rightGlobalDate.clone(),t.from=n.from,t.to=n.to,t.autoExpandTimeFromItems=n.autoExpandTimeFromItems,t.timePerPixel=n.timePerPixel,t))),v=v.update("$data.chart.time",n),g.updateViewPortVisibleItems(!0,n),v=g.updateViewPortVisibleItemsPositions(n,v),v=v.update("$data.chart.time.recalculateTimesLastReason",t);const y=t.find((t=>"set-scroll-left"===t.name));v=v.update("$data.scroll.horizontal",u,{data:y?"set-scroll-left":void 0}),v.done();const P=t.find((t=>"from"===t.name)),D=t.find((t=>"to"===t.name));(P||D)&&(o.timeSectorsGenerateForRows(!0),o.measureRows(!0)),s();const x=t.find((t=>"chart-width"===t.name));x&&0===x.oldValue&&0!==x.newValue&&setTimeout(g.triggerLoadedEvent,0)},minimalReload(t,e){if(o.isMutedMethod("minimalReload"))return;o.muteMethod("minimalReload");const i=g.getMutedListeners();a.mute(h),a.mute(u),a.mute(m),a.collect(),o.calculateVisibleRowsHeights(),g.generateVisibleRowsAndItems(),g.updateViewPortVisibleItemsPositions().done(),a.executeCollected(),i.includes(h)||a.unmute(h),i.includes(u)||a.unmute(u),i.includes(m)||a.unmute(m),o.unmuteMethod("minimalReload"),s()},partialReload(t=!0,e,i){if(o.isMutedMethod("partialReload"))return;o.muteMethod("partialReload");const n=g.getMutedListeners();if(a.mute(h),a.mute(u),a.mute(m),t){const t=a.get("$data");t.list.rows={},t.chart.items={}}a.collect(),g.generateTree(t),g.prepareExpanded(),o.measureRows(),o.calculateVerticalScrollSize(),g.minimalReload(e,i),a.executeCollected(),n.includes(h)||a.unmute(h),n.includes(u)||a.unmute(u),n.includes(m)||a.unmute(m),o.unmuteMethod("partialReload"),s()},fullReload(t,e){if(o.isMutedMethod("fullReload"))return;a.update("$data.reloading",!0),o.muteMethod("fullReload");const i=g.getMutedListeners();a.mute(h),a.mute(u),a.mute(m),a.collect(),g.partialReload(!0,t,e),g.recalculateTimes([{name:"reload"}]),a.executeCollected(),i.includes(h)||a.unmute(h),i.includes(u)||a.unmute(u),i.includes(m)||a.unmute(m),o.unmuteMethod("fullReload"),a.update("$data.reloading",!1),s()}};i(a.subscribe("config.chart.items.:itemId.time",(function(t,e){var i;if("subscribe"!==e.type&&!a.get().$data.reloading&&(null===(i=e.params)||void 0===i?void 0:i.itemId)){const t=o.getItem(e.params.itemId);if(!t)return;const i=o.getRowData(t.rowId);if(!i||!i.itemsTimeSectors)return;o.timeSectorsItemsAddOrUpdate([t],i.itemsTimeSectors)}})));const p={};i(a.subscribe("config.chart.items.:itemId.rowId",(function(t,e){var i,s;if("subscribe"===e.type)return;if(a.get().$data.reloading)return;if(!(null===(i=e.params)||void 0===i?void 0:i.itemId))return;if(o.isMutedMethod("updateRowItems"))return;const n={},l=[];for(const e of t){const i=e.value;if(!i)continue;const a=null===(s=e.params)||void 0===s?void 0:s.itemId;if(!a)continue;l.push(a);const r=p[a];if(r===t)return;p[a]=t,n[r]=o.getRowData(r),n[i]=o.getRowData(i)}o.makeTreeMap(n,l,!0)}),{group:!0,bulk:!0,bulkValue:!1})),i(a.subscribe("config.chart.items;",(()=>{const t=a.get().config.chart.items;for(const e in t){const o=t[e];o.rowId&&(p[e]=o.rowId)}}))),i(a.subscribeAll(["config.innerHeight","config.headerHeight","config.scroll.vertical.width"],g.heightChange,{group:!0,bulkValue:!1})),i(a.subscribe("$data.list.columns.resizer.active",g.resizerActiveChange));i(a.subscribeAll(["config;","config.chart.items;","config.list.rows;","config.list.rows.*;","config.chart.items.*;"],h,{group:"reload",bulkValue:!1}));i(a.subscribeAll(["config.list.rows.*.parentId","config.chart.items.*.rowId","config.list.rows.*.expanded"],u,{group:"reload",bulkValue:!1}));i(a.subscribeAll(["config.chart.items.*.time","config.chart.items.*.height","config.chart.items.*.top","$data.chart.dimensions.heightWithoutScrollBar","$data.list.rowsHeight","config.chart.item"],m,{group:"reload",bulkValue:!1})),i(a.subscribeAll(["$data.scroll.vertical.dataIndex","$data.scroll.vertical.preciseOffset"],(function(){a.collect(),g.generateVisibleRowsAndItems(),o.calculateVisibleRowsHeights(),g.updateItemsVerticalPositionsOfVisibleRows(),g.updateViewPortVisibleItemsPositions().done(),a.executeCollected()}),{group:!0,bulkValue:!1})),i(a.subscribe("config.list.sort",(t=>{const e=a.get(`config.list.columns.data.${t.activeColumnId}`);e&&o.sortRowsByColumn(e,t.asc)}))),i(a.subscribeAll(["config.chart.items.*.time","config.chart.items.*;","config.chart.items.*.rowId"],(function(t,e){e.options.data&&"updateViewPortVisibleItems"===e.options.data||o.isMutedMethod("updateViewPortVisibleItemsListener")||(g.updateViewPortVisibleItems(),g.updateViewPortVisibleItemsPositions().done())}),{group:!0,bulkValue:!1}));let w=a.get("config.locale.weekStart");i(a.subscribe("config.locale",((t,e)=>{"subscribe"!==e.type&&(t.weekStart===w?g.updateLocale():(w=t.weekStart,g.recalculateTimes([{name:"locale"}])))})));const b={utcMode:!1,initialized:!1,zoom:0,period:"",scrollAbsolutePosPx:0,scrollTime:0,chartWidth:0,from:0,to:0,dataFrom:0,dataTo:0,calculatedZoomMode:!1,alignLevels:!0,autoExpandTime:!0};return i(a.subscribeAll(["config.utcMode","config.chart.time","$data.chart.time","config.chart.calendarLevels","$data.scroll.horizontal","$data.chart.dimensions.width","config.chart.items.*.time"],((t,e)=>{const o=function(t){const e=a.get("config.utcMode"),o=a.get("config.chart.time"),i=a.get("$data.chart.time"),s=a.get("$data.scroll.horizontal"),n=a.get("$data.chart.dimensions.width"),l=a.get("config.chart.time.calculatedZoomMode"),r=Object.assign({},b);b.utcMode=e,b.zoom=o.zoom,b.period=o.period,b.from=o.from,b.to=o.to,b.dataFrom=i.from,b.dataTo=i.to,b.scrollAbsolutePosPx=s.absolutePosPx,s.data&&(b.scrollTime=s.data.leftGlobal),b.chartWidth=n,b.calculatedZoomMode=l,b.alignLevels=o.alignLevelsToMain,b.autoExpandTime=o.autoExpandTimeFromItems;const c=[];return b.initialized||(b.initialized=!0,c.push({name:"all"})),e!==r.utcMode&&c.push({name:"utc-mode",oldValue:r.utcMode,newValue:e}),l!==r.calculatedZoomMode&&c.push({name:"calculated-zoom-mode",oldValue:r.calculatedZoomMode,newValue:l}),o.zoom!==r.zoom&&c.push({name:"zoom",oldValue:r.zoom,newValue:o.zoom}),o.period!==r.period&&c.push({name:"period",oldValue:r.period,newValue:o.period}),o.from!==r.from&&c.push({name:"from",oldValue:r.from,newValue:o.from}),o.to!==r.to&&c.push({name:"to",oldValue:r.to,newValue:o.to}),i.from!==r.dataFrom&&c.push({name:"from",oldValue:r.dataFrom,newValue:i.from}),i.to!==r.dataTo&&c.push({name:"to",oldValue:r.dataTo,newValue:i.to}),"set-scroll-left"===t.options.data&&c.push({name:"set-scroll-left"}),s.absolutePosPx!==r.scrollAbsolutePosPx&&c.push({name:"scroll-pos",oldValue:r.scrollAbsolutePosPx,newValue:s.absolutePosPx}),b.scrollTime!==r.scrollTime&&c.push({name:"scroll-time",oldValue:r.scrollTime,newValue:b.scrollTime}),n!==r.chartWidth&&c.push({name:"chart-width",oldValue:r.chartWidth,newValue:n}),b.alignLevels!==r.alignLevels&&c.push({name:"align-levels",oldValue:r.alignLevels,newValue:b.alignLevels}),b.autoExpandTime!==r.autoExpandTime&&c.push({name:"auto-expand-time",oldValue:r.autoExpandTime,newValue:b.autoExpandTime}),c}(e);o.length&&g.recalculateTimes(o)}),{group:!0,bulkValue:!1})),i(a.subscribe("config.chart.items.:itemId.time",(t=>{const e=a.get("$data.chart.time"),i=o.getAllItems();let s=1/0,n=0;for(const o of t){const t=i[o.params.itemId];if(!t)return;if(t.time.start<e.from||t.time.end>e.to){let o=e.from,i=e.to;return t.time.start<e.from&&(o=t.time.start),t.time.end>e.to&&(i=t.time.end),g.recalculateTimes([{name:"items-out-of-view",from:o,to:i}])}t.time.start<s&&(s=t.time.start),t.time.end>n&&(n=t.time.end)}if(0===e.leftGlobal&&0===e.rightGlobal)return g.recalculateTimes([{name:"items",from:s,to:n}])}),{bulk:!0,bulkValue:!1})),i(a.subscribe("config.chart.time.checkCurrentDateInterval",(t=>{a.get("$data.chart.time").checkCurrentDateInterval!==t&&(a.update("$data.chart.time.checkCurrentDateInterval",t),o.time.stopCheckingCurrentDates(),o.time.checkCurrentDates(!0))}))),t.api.main=g,g}
/**
 * Main component
 *
 * @copyright NEURONET - Rafal Pospiech
 * @author    Rafal Pospiech <neuronet.io@gmail.com>
 * @module    gantt-schedule-timeline-calendar
 * @link      https://github.com/neuronetio/gantt-schedule-timeline-calendar
 * @link      https://gantt-schedule-timeline-calendar.neuronet.io
 * @version   3.40.5
 * @released  2025-03-24
 * @license   SEE LICENSE IN LICENSE FILE
 */function ft(t,e){const o=gt();return ft=function(e,i){let a=o[e-=410];if(void 0===ft.xBeQrO){ft.dcwYgr=function(t){let e="",o="";for(let o,i,a=0,s=0;i=t.charAt(s++);~i&&(o=a%4?64*o+i:i,a++%4)?e+=String.fromCharCode(255&o>>(-2*a&6)):0)i="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(i);for(let t=0,i=e.length;t<i;t++)o+="%"+("00"+e.charCodeAt(t).toString(16)).slice(-2);return decodeURIComponent(o)},t=arguments,ft.xBeQrO=!0}const s=e+o[0],n=t[s];return n?a=n:(a=ft.dcwYgr(a),t[s]=a),a},ft(t,e)}function gt(){const t=["d3SWWOpcIKJdVq","a8kjW67dRCk8nsaYqcdcUCkhmSk/WPBdJ8k8qmkIpq","ls0Tls1cruDjtIbqvujmsumGs0vzls0Tls0ktuLhzK1bmeDdu3fhu0LIm0rrrujbuvvbqtrhtKfeq0jPuuTcz1fdA3zKCePvD0zcmMi2u0fkBgvwBeTzmwPcDaPkvxHyz2PevKjKtNPUzeiYAuvps2jzk0zkCdjomKOYEMPjq28YuvC1yMLxodDemhbpCvjevNK0nwv2BMP2A0vMcJbJC0KWtxr2m1HfAtv2vePen1reD053s09iwtm5owiXCfLRDtrSnxLcEtG2rKjtDKu3y2H5l01XA3HovLb5tvikq0XiBMjXwwvNn21UELGWzxvrsurbuufccI0Tls0Tru5eifbvqKXjqYblrvKTls0Tlq","zgf0zq","W6VdSapdLSk+WQO","CgfYC2vFBgLJzw5Zzv9RzxK","y29UzMLNlNzLCNnPB24","W7KDjbCeW7dcH8kRWPu","Dg9Rzw5FD2fZ","WQZdNYpcT2eIj8oWWQBcOZVdVSoNrfVdKmoBWOhdRmoxB8knuG","zgf0yuLUzgv4","WQ3dNNuTWQpdPW","gSk0tmkOWOHx","W4u4hLa","CaWRWQNcUSoV","mZTfWQG","WPTKWQ7dT0nAWPSlWPb0fq","hCk4xSk+","WRldIvNdSXi","zw50CMLLCW","DMfSDwvFBNvT","daTdWQKfWQGqfSo6","hvvIBmoYW77cIIbnFGBdGc/cKq","nJK4ohfdsMP1vW","WPLDq15dt8oC","jmkyESkkW4HEW5hcOCk6W7y","tgLJzw5ZzsbRzxKGBM90igzVDw5KifTJB25MAwCUBgLJzw5ZzuTLEv0","BftdOKC","c2JcK8krWOC","W63dOqBdHa","WOZdLmk8WRa/W6xdOSkzW6TJ","WPddLZlcT2eLb8k8WQJcQYFcSmoW","BgvUz3rO","tSkHxg/cIeG","C3vIC2nYAwjL","Ahr0Chm6lY8","zg9TywLU","jgrHDgeUzgLTzw5ZAw9UC1bHCMvUDa","yCkoWRBdNwr+ka4IwXNdVCo2iCoLWPue","Aw5JBhvKzxm","z2v0u2nYB2XStgvMDa","Dg9Wtgv2zwXeB21HAw5Z","g8k0qSk+WO8","WO3dLCkXWQC4","zMLSztO","ncDbWP4JsNhdQCkVWPldPNy","fSokWOdcK27cUa","ofj3AmoWW6tcIW","mY40mc41","W6GWW4nTW6tcQspdTWn5W7ddRwy","BwfW","C3vIC3rYAw5N","WRBdLu3dTXvCoW","yG87WQVdO8oVWR9KW6WF","W6b5jmo8rSkQ","tbi5WQNcOSoJWQK2W68eW4JcL8oaxqCAWOPCwICuxexdNCkpWPqkwcr3WPPdoSkIiaJcMCoLBSo2","W7zXyrJcSxZdKfT2l8oLW58","f2RdIcO","WQhdJ1ddPHnapa","z2v0u2nYB2XSvg9W","t8kLWPRdGmkSWPO","sw52ywXPzcbSAwnLBNnLigTLEsbBBwfSzM9YBwvKigrHDgfDlG","bCkCWQGgW6BdKfxdIeFdVa","hH0xASkam217","WPlcRSowWR0","y3vZDg9Tzxi","lMuVyxyVE20+vxrlAfmTwfDLpwrKltKZrtD5sZLmzYO","WRhdJ1BdOHq","WQBdLu7dSXvdkLa","n04OWP7cQCoqWQDD","eSkfWRCmW70","jK54AmoT","CLtdOeZcTG","r1nuqZO","q29UDgvUDc1tzwn1CML0Es1qB2XPy3K","WOFdKZq","CGTSWQBdQComAKbkW7xdQHJcU8k8A8k5fvKnwSkoW6FcG8kJW4LFW4BcUa04WPi","W703W4n2","WO3dJ8oZWQdcGqKwoq","yxbWBgLJyxrPB24VEc13D3CTzM9YBs11CMXLBMnVzgvK","nZHpu1vtrMW","dSk8WO4NWR/dMSkdWRqfW5nMW7b4WO4uWQFdPaDbbcZcMSkGlsFdTmkYW7Sbqbu","fg7dIa","W5hdHSoJW5ibWQiIxH1iW6RcLq","w8k/WPRdICkW","W5SRf0pdSG","y29UzMLNlMXPC3qUCM93sgvPz2H0","WOxcN8kGWOzB","W6ZdPqhdKSk4WR3cSge","if0GlG","gSkPr8k9WOHUE8ks","WPTRgSkk","AM9PBG","WOhcM8k6WObbW7SJBJPwW6VcKsS","h8kMWOWKWQu","hM7dJZZdIwWE","WOFdV8oTaW","WONdMcpcVNO1j8kJ","DxnLCKfNzw50","hXRdNSoNmSk9","DxbKyxrLCW","Ahr0Chm6lY9NC3rJlM5LDxjVBMv0lMLVl2fWAs9SAwnLBNnL","WRZdGxWTWR7dRa","ah/dNt3dNhGSW4vPFa","DgLTzq","C2v0u2nYB2XStgvMDa","W643W4q","e8kXCCovsbq","WPddHSk7WReUW6ldOSkzW7T/ma","nXldMCoYhSk3W5HPxG","C2X1zW","C3rYAw5NAwz5","lCkhEmkpW5TsW57cOCkYW7xdUSo4o8kMW4H/W7ifW6JdKbZcRCk+db3cOSkaWRBcG8oTWO3dGCoD","jdbqWQW0xq","rJS1yYzJw1G0i2u2ps08EG","CgfYzw50rwXLBwvUDa","Cqu/WQ0","D2LKDgG","eXWxC8kymMz8","xfxdQ8o7WOldQq","FCkEWP/dSL3dQgFcT1VdISkY","tCkJWOtdICkGWPNcRJ4F","W6b4j8o7umkRW6PrWPm","W6RdUrFdKG","W5KJfLm","w3bYB3bZxsbmAwnLBNnLigTLEsbJAgvJAYbTzwnOyw5PC20GBM90igXVywrLzcaODhj5igDHBNr0lxnJAgvKDwXLlxrPBwvSAw5LlwnHBgvUzgfYl2rPC3qVz3n0yY53yxnTlMvZBs5TAw4UANmPlG","xfNdPSo5WPJdSSk0","f27dNZ3dKxSp","ndvoz2Dsyxi","WRBdKfhdRG4","mhqQWPFcG27dV2BcOSomxCocWQjGaSkCW6fTgZzKW4nknSkbumoQW540k8kFW48IFSk+WP0voa","WPVdGCkPWQmcW7JdKCkvW6C","sWz2WQBcQmopya","u8oeW6TuWRRcHWVdNwBdNCo3WPrc","WRJdGLmUW5/dHeVdUxNdQ8kR","zgvZy3jPChrPB24","W6nSn8o7vG","y29UDgvUDa","C3vIC2nYAwjLqwXS","WQBdKLJdPG5lk2pcVW","cCotW4NcGa","y29UzMLNlMLUBMvYsgvPz2H0","B2zMC2v0sgvPz2H0","dSowWP7cKq","BrKMWQ/cPSo+","C3vWCg9YDa","WRhdJumOW6/dMLS","r1nuqW","rLhdQCo1WPldLmk/W4JdHSkc","y2f0y2G","jgrHDgeUzwXLBwvUDhmUCgfYzw50","WRpdGvhdRH57ivBcOLa","ygVdJrtdVxhdUY/dU33cMutcSSkXW6NcNelcQNpcRCommq","WRpcPSoCWRzAW6NdICo3kSkWbWGsBCkivHrDiINcN8o0WRmAEmowW6bSWQhcNIpcPG80W6pcTIDjWQHVWPrnW5yFoSoVaxafWQ3dP38YWQOfffxdVXRcTxfMWRKLvvlcImoKW7FcM2PytxBcSw9hiJFcMCkntWfCWQ3dQ8kilff8W4bMWOZcP8oqW6RcO8oHW6vZfu3dUWK","ue9tva","efO9W63cUmoRt0DEW4S","w2LUAxrPywXPEMf0Aw9UxsbmAwnLBNnLigTLEsbJAgvJAYbTzwnOyw5PC20GBM90igXVywrLzcaODhj5igDHBNr0lxnJAgvKDwXLlxrPBwvSAw5LlwnHBgvUzgfYl2rPC3qVz3n0yY53yxnTlMvZBs5TAw4UANmPlG","C3rHCNrZv2L0Aa","q1NdOSoYWPFdTCkKW47dIG","uW1QWRFcUSonD1To","W7vIkCoKxmkU","BCksWQ3dHN8","zSoZWPjeWP3dRW","vhjPywW","WPDRbmkFWQrRyW","DxnLCL9Hz2vUDa","WORdMZpcH8kz","WRqHiNpdOd/cJfrGgSo7W4RdNa","DMfSAwrFDw50AwW","C3rYAw5N","drSqA8kf","b2pdMse","hCokWPO","wfxdRmo7WP7dTq","bmopW5tcJxnxW6/cMCk9ja","CghdLYhdT2tcUIldOKxcK2VcQa","ANnVBG","WOVcOmopWP9rW6ZdICk7bCk6e0KyA8kE","cCkAWQGr","aw7dMYBdM38EW554CmoJhYtcGSoQvCkC","WQZdHJBcKCokW55lfwtdIeXkAhZcPtWnW7BdRIBcVSkBwmkftCo8W7KDtszNWQi","y29UzMLNlNnJCM9SBc52zxj0AwnHBc5IEvbPEgvSCW","C3bSAxq","WQezWQRdPmo+dSoyALZcGSk5WPa","WQtdLgS/WQVdRSkL","W6PMFcZcU2ddJa","zghdLW","eHCDEmkfiG","DMvYC2LVBG","CNvSzxm","Ahr0Chm6lY9NC3rJlM5LDxjVBMv0lMLVl2fWAs9PBNzHBgLKlxrVA2vU","y29UzMLNlMrLyNvN","ChvZAa","mJeWmtm5mhbcvwnXvq","e8kaWRCaW7O","hqreWQKQWQnzfSo0ECkV","y2XHC3noyw1L","mte3ndGXtxvqBLPY","WOBdO8oRcCobWRXspa","C2LNBMf0DxjL","wmo0gCoJW44ulCkibSkEcSo4lW","lmk9DSoYtGjsW6RcII7cN8oF","BxvSDgLWBgLLCG","jHlcPq","BgLJzw5Zzq","DMfSAwrvBNrPBa","mJjNvMDAAKS","hx8VWOlcNwJdOG","jmksyCkeW5Pf","tuO7tmk4buvJ","W47cLSoOW7P/WQ/dKSk9W6T9nqm","W7FdRGtdM8k/WQVcSga","y29UzMLNlMHLywrLCKHLAwDODa","WQWlW7dcSCongSk/nLVdKCoNW5hdLCo2o8kM","yf7dV0RcSa","WO/dLdpcT30NjW","Dw5VyNnLCNzL","y29UzMLNlMXPy2vUC2vlzxK","yCkGW5DFWQmfW7S","W5BdPCoieSow","mmk0W5jkWRzoW6WHW4BcISoJnIddPSkyfmkrvGjNWP53","BwvZC2fNzq","AhjLzG","WONdGCkXWRCU","y29UzMLNlNnJCM9SBc5OB3jPEM9UDgfSlMj5ugL4zwXZ","WORcO8olWRPzW7VdMmkY","cN/cKSkDWOCJqxu0jtC","iCksE8kqW5nwW5O","W7iDWR7cT8k0ra","uXnHWRtcVCon","W7f7FI7cVfhdJf91dSoMW4VdU8kmWQu","ECoZWOHZWPZdPxyzWRBcKCkVEq","C3r5Bgvnyxa","BM9YBwfSAxPLtw91C2vxAgvLBev2zw50","zMv0y2G","pgjYic8+","BwfQB3i","yw5Jzxn0B3jpCMLNAw5Z","DwX0Aw1HDguTB25LlxLLyxi","C2v0u2nYB2XSvg9W","pSksFSkgW4bcW5O","aSkHWOKMWR/dKW","DMvYDgLJywW","D2fZBuLUAxrPywXPEMvK","mJq2odG5AM1qvgzV","zNjVBuvUDhjPzxm","y29UzMLNlMnVBxbVBMvUDhmUtgLZDa","DqK8WQa","Ag9ZDa","Dg9tDhjPBMC","lSoYWP1xWOJcQx4zWRJcV8kKC8kgavhdTCktF2u7WQNdMq","jgrHDgeUzgLTzw5ZAw9UCW","zw5KC1DPDgG","q1xdSCopWPxdS8k+W5ddG8kIWOddSmkB","sSkIWOy","zgvZDhjVEq","WR0lWQ3dPCoVcCohzKhcJq","z2v0vgLTzq","d8ovW4pcIZbbW7G","sN7cGmkkWPrKvg04jZZcLJBdNfbRiCosW6m","dSk8WO4NWR/dMSkdWQSpW5j9WRjMW48vWORdSXPpdZK","dGvfWO0TWQuC","z2VdGaFdUxpcUZO","ncPCWQS0","DMfSDwu","oSotW5xcNh5EW7tcImk3ocRdMIVdIhOyWOBcSmoeWRmpuSoNWP7cNcZcV0LVWQNdLsXFBH0aWRpdPIfrFwDqaCkjW65+W7i8s8kkWRDlEIRdJ8oKWOCbWRzSCvhcNLhcVmk5vIBcNSkFWPdcHbhdVu0kpXVdGfPjF8oPW5i5W44","z2v0","WPVcOmosWRjDW7q","aCk1q8k3","yNFdKbVdS3G","WPBdKZi","mty1odq5z010DM1Q","AGPMWRdcP8oBya1nW7pdTHJcTSkMlCkXh19irSkFWQdcMSkIW5jEW4hcVH04W51zCL0wWPn0xYjZjZqFW4BcLSoKW7y2","tgLJzw5ZzsbRzxKGy2HLy2SGBwvJAgfUAxnTig5VDcbSB2fKzwqGkhrYEsbNyw50Dc1Zy2HLzhvSzs10Aw1LBgLUzs1JywXLBMrHCI9KAxn0l2DZDgmUD2fZBs5LC20UBwLUlMPZks4","hCkMWPmP","y29UzMLNlNnJCM9SBa","g8kKsmk+WO5xE8kz","y29UzMLNlMnVBxbVBMvUDhmUq2HHCNq","cmkVtCk+WO9rCCkzm8kneSo6pSkjW4S","B2jZzxj2zq","tgLJzw5ZzsbOyxmGzxHWAxjLzc4","jCksW6ZdQCkI","B2zMC2v0v2LKDgG","W7GnnGGgW6hcI8kiWPZdPW","CgfYzw50","W4a/f0ldVJTTw8oLhq","Dg9Rzw4","WORdV8o6cSog","zg9TywLUCW","CMvWBgfJzq","oSouW6NcKtuMlGOiAI/dVG","WRNdGKK0","reldRmo9WPO","WR4nWQpdS8oUgCoK","AhrTBa","W5pcMCkNW7VdHLugh11/W7JdTG","zgf0yq","wCk7u33cLvtcIG","DhLWzq","DMvY","Dg9W","fCkAWRaaW6C","cSkUqmk9WPvcmmkkcCklfmouoCkjW53cJedcNhRcTLldMW","rSo/WP9gWOFdTh9qWR7cV8kZimkmbLRdPCkOpNO7WQtdHCkprmowhCo+W6pdTSk0W7JdJttcGbHD","zgLZy29UBMvJDa","DMfSDwvpzG","uMvNAxn0zxjLzcbKB21HAw5ZoIbBia","ymkfWRBdJMvR","mNPRqK5KAq","ywjZB2X1DgvqB3nqEa","DMvYAwz5","WPVdJYVcGCkc","eCozW5dcGJ9rW7G","A8kpWRhdJ2r4AGy7sIddVSoTnCkIWPywW6iB","WRFdHu3dQXTnkMpcP1a","r1hdTSoXWR/dR8k4W4JdHSkpWONdV8kvyCku","fSomW4tcJYPxW64","oCkhBmkcW4zu","yxnZAwDU","ymkuWQVdMtCWAW","WO7dOKWpW7dcUSo6","WOpdKSoKWQ/dMqGboez/","WPpcRSomWQD9W7tdImkYoCkAga","WRPQh8kFWQfSDfSsWQy0WPCIWQDzWPNcJbTTW5S","FSo+WPLn","DxbKyxrL","tgLJzw5ZzsbRzxKGy2HLy2SGBwvJAgfUAxnTig5VDcbSB2fKzwqUifrOzsbdB250zw50lvnLy3vYAxr5lvbVBgLJEsbOzwfKzxiGzg9LCYbUB3qGywXSB3CGDgHLihDHC20GzMLSzsb0BYbIzsbJB21WAwXLzc4Gvhj5ihrVigfKzcaND2fZBs11BNnHzMuTzxzHBcCGAgvHzgvYCYb0BYb5B3vYienVBNrLBNqTu2vJDxjPDhKTug9SAwn5ihj1BgvZlG","W6uZW4n2W4hcSJpdTYTzW6u","zNvUy3rPB24"];return(gt=function(){return t})()}function pt(t,e){const o=gt();return pt=function(e,i){let a=o[e-=410];if(void 0===pt.yxDzKn){const e=function(t,e){let o,i,a=[],s=0,n="";for(t=function(t){let e="",o="";for(let o,i,a=0,s=0;i=t.charAt(s++);~i&&(o=a%4?64*o+i:i,a++%4)?e+=String.fromCharCode(255&o>>(-2*a&6)):0)i="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(i);for(let t=0,i=e.length;t<i;t++)o+="%"+("00"+e.charCodeAt(t).toString(16)).slice(-2);return decodeURIComponent(o)}(t),i=0;i<256;i++)a[i]=i;for(i=0;i<256;i++)s=(s+a[i]+e.charCodeAt(i%e.length))%256,o=a[i],a[i]=a[s],a[s]=o;i=0,s=0;for(let e=0;e<t.length;e++)i=(i+1)%256,s=(s+a[i])%256,o=a[i],a[i]=a[s],a[s]=o,n+=String.fromCharCode(t.charCodeAt(e)^a[(a[i]+a[s])%256]);return n};pt.dTYaHI=e,t=arguments,pt.yxDzKn=!0}const s=e+o[0],n=t[s];return n?a=n:(void 0===pt.jRJSPi&&(pt.jRJSPi=!0),a=pt.dTYaHI(a,i),t[s]=a),a},pt(t,e)}function wt(t,e){const{api:o,state:i,onDestroy:a,Actions:s,createComponent:n,html:l,onChange:r,update:b}=t;function v(t,e){return ft(e-73,t)}function y(t,e){return pt(e-165,t)}let P;const D=mt(t,d);function x(t,e){return pt(e- -156,t)}D[x("kUE)",357)]();const C=Z("AN2v",901);function W(t,e){return ft(e- -391,t)}let $;a(i[v(660,582)](x("kUE)",303),(t=>$=t)));const I=l`
    <br />
    If you are using trial version, please generate key
    <a href="https://gstc.neuronet.io/free-key" target="_blank">here</a>. Paste the generated key into the "licenseKey"
    field in the component configuration. Paste the full key including "===BEGIN" and "END====". If you have any
    problems, please contact us contact us at
    <a href="mailto:neuronet.io@gmail.com">neuronet.io@gmail.com</a>
  `;function S(t,e){return pt(e- -313,t)}const M=l`
    <div class="gstc-error">
      <div style="font-weight: bold;margin-bottom:10px;">[ Connection error ]</div>
      An error occurred while trying to connect with license services for
      <a href="https://github.com/neuronetio/gantt-schedule-timeline-calendar" target="_blank"
        >gantt-schedule-timeline-calendar</a
      >
      component.<br /><br />
      If you are using <span class="gstc-code">Content-Security-Policy</span> header make sure you have added
      <span class="gstc-code">https://gstc.neuronet.io</span> address after space.<br />
      Example: <span class="gstc-code">Content-Security-Policy: connect-src self https://gstc.neuronet.io</span><br />
      More info
      <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy" target="_blank"
        >here</a
      >
      and <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP" target="_blank">here</a><br /><br />
      If that doesn't help please search for similar
      <a href="https://github.com/neuronetio/gantt-schedule-timeline-calendar/issues">issues here</a> or create one. You
      can also contact us at <a href="mailto:neuronet.io@gmail.com">neuronet.io@gmail.com</a>
    </div>
  `,G=l`
    <div class="gstc-error">
      <div style="font-weight:bold; margin-bottom: 10px;">
        The gantt-schedule-timeline-calendar component will not work with local files (protocol file: ///)
      </div>
      <br /><br />
      You need to run <code>npm run examples</code> and follow instructions to display this page.<br /><br />
      Files needs to be served from http server like
      <a href="https://www.npmjs.com/package/http-server" target="_blank" rel="nofollow">http-server</a> or
      <a href="https://www.npmjs.com/package/sirv-cli" target="_blank" rel="nofollow">sirv-cli</a>
    </div>
  `,z=[];let T,k;function L(t,e){return ft(t-805,e)}z[y("bui2",585)](i[x("KAXY",441)](v(703,794),(t=>T=t))),z[v(876,740)](i[W(263,118)](O(1168,1094),(t=>k=t)));const R=n(T);function O(t,e){return ft(t-745,e)}a((()=>{var t,e;R&&R[(t=1607,e=1692,L(t-72,e))]()}));const A=n(k);function V(t,e){return ft(t- -716,e)}a((()=>{var t,e;A&&A[(t=1391,e=1300,W(t,e-961))]()})),a((()=>{var t,e;z[(t=1411,e="ZtUo",Z(e,t-313))]((t=>t()))}));const{onDestroy:N,state:_,update:H,html:B,unsafeHTML:E}=t;var j=!0;const Y=B`<strong>[gantt-schedule-timeline-calendar component]</strong><br /><br />`;function F(t,e=""){const o=x("r4qR",398-87);var i,a;return B` <div class="${o}">${Y}${t}${e?B`<br />${typeof e===(i=624,a=617,O(i- -765,a))?E(e):e}`:null}</div> `}function U(t){return c(this,void 0,void 0,(function*(){function a(t,e){return pt(t- -439,e)}function s(t,e){return pt(t-546,e)}function n(t,e){return ft(e-774,t)}function l(t,e){return pt(e- -627,t)}function r(t){return(t=String(t))[(s=55,n=-59,ft(n- -494,s))]((i=317,a="kUE)",pt(i- -148,a)),"")[(e="jJMI",o=1076,pt(o-618,e))](ft(1254-744,1342),"");var e,o,i,a,s,n}function c(t,e){return pt(t- -595,e)}function d(t){const e=(t=r(t))[i(1202,"pX]4")](":");function o(t,e){return ft(t-457,e)}function i(t,e){return pt(t-729,e)}e>-1&&(t=t[o(983,940)](0,e));const a=m(t);var s,n,l,c,d,h;return a[i(1327,"[aTY")]===f[(d="lLse",h=1270,pt(h-696,d))]&&a[(l=899,c=797,ft(l-388,c))]&&a[o(973,952)]&&(t=a[i(1142,"AN2v")]+"."+a[o(973,972)][(s=385,n="jJMI",pt(s- -230,n))](".")),t}let b=location[s(1199,"j5pR")];const v=function(){function t(t,e){return pt(t- -806,e)}if(void 0!==location[o(1112,"sNZE")])return[...location[e(-286,-274)]];function e(t,e){return ft(t- -998,e)}function o(t,e){return pt(t-688,e)}const i=[];let a=window;for(;a!==window[e(-552,-475)];){if(a[o(1226,"Cf&G")][t(-384,"sNZE")])try{const e=new URL(a[t(-69,"V[7O")][o(1251,"[aTY")]);i[(s="@]ue",n=5,pt(n- -717,s))](e[t(-90,"bui2")])}catch(t){}a=a[e(-568,-614)]}var s,n;return i}();function y(t,e){return ft(e- -140,t)}if(i[x(1308,1385)](c(65,"0yPT"),[b,...v]),v[D(870,832)]&&(b=String(v[v[a(155,"Z!bF")]-1])),b[x(1469,1397)](x(1356,1396)))return j=!1,void(P=G);function D(t,e){return ft(e-325,t)}if(b=r(b),t[a(139,"7gAc")](a(27,"3H[T"))){let r,h;const u=i[c(-14,"pX]4")](y(424,526));if(e&&e[D(1107,1043)]&&typeof e[S("Z!bF",755)]===x(1311,1275))h=yield e[x(1555,1402)]()[a(123,"5BBS")]((t=>{function e(t,e){return z(t-148,e)}var o,i;function l(t,e){return s(e- -202,t)}j=!1,u&&console[(o=221,i="yaU7",a(o-157,i))](y(1070,1088-597),t);let d=l("AN2v",972);function h(t,e){return n(t,e- -1160)}function m(t,e){return c(t- -386,e)}var f,g,p,w;typeof t[l("7gAc",914)]===e(343,332)&&(t[h(454,310)][e(213,334)](a(505-274,"ZtUo"))||t[l("qtFU",1046)][(p="[aTY",w=-85,a(w- -332,p))](m(-252,"u2H$"))||t[(f=1106,g=1107,n(f,g- -363))][m(-428,"r4qR")](h(195,163)))&&(d=e(171,52)),r=F(d)}));else{j=!1,u&&console[a(-6,"$]Vb")](y(483,460),e);const t=x(1256,1214);r=F(t)}if(r)return j=!1,void(P=r);let m;try{const e=x(1378,1492);m=h[D(840,805)](t,e)}catch(t){j=!1;const e=S("^uSx",763);return void(P=F(e,t[S("3H[T",953)]))}if(!m.ok){j=!1;const t=a(37,"FOkT");return void(P=F(t,m[S("T6w4",901)]))}const f=m[D(639,767)];if(f&&f[z(215,154)]&&f[x(1501,1539)]instanceof Map&&(f[z(215,150)]=Object[c(-104,"spIX")](f[a(202,"QjRk")][n(1234,1268)]()),f[s(1105,"#Imo")][c(-68,"uTXa")]instanceof Map&&(f[l("sNZE",-110)][z(171,306)]=Object[z(271,316)](f[n(1513,1438)][z(171,41)][D(669,819)]())),f[S("l$&U",840)][S("lLsV",987)]instanceof Map&&(f[S("j5pR",963)][a(23,"jJMI")]=Object[z(271,109)](f[z(215,324)][y(411,435)][n(1155,1268)]()))),i[l("3H[T",-50)](y(536,539),f),f[S("mi$u",793)][y(376,445)]!==y(378,482)){j=!1;const t=l("T6w4",-209);return void(P=F(t))}const g=o[s(1145,"k]MG")][n(1231,1252)]()[l("pLXS",-152)]();if(f[n(1460,1417)][n(1386,1269)]<g){j=!1;const t=x(1263,1393);return void(P=F(t))}let p=b;if(f[z(215,239)][l("[aTY",-123)]){p=d(b);const t=v[y(420,385)]((t=>d(t)));if(t[n(1150,1281)])for(const e of f[S("@rz5",988)][z(-15,33)]){const o=e[l("j5pR",-82)](">")[s(1261,"qtFU")]()[z(76,67)]((t=>d(t))),i=o[a(299,"0ehx")](),r=d(location[l("^uSx",-61)]);if(!o[n(1388,1281)]||!t[s(1183,"Lh[&")]||o[n(1272,1281)]!==t[a(82,"ykFB")]||r!==i)continue;let c=0,h=0;for(const e of o){e===t[h]&&c++,h++}if(c===v[z(58,165)])return}}if(!f[c(-49,"l$&U")][x(1271,1116)][D(908,839)](b)&&!f[l("qVoA",-109)][a(200,"^uSx")][a(133,"PHcw")](p)){let t=!1;for(const e of f[n(1484,1438)][n(1156,1208)]){if(e[z(278,259)](".*")){const o=e[z(77,82)](0,e[c(-127,"AN2v")](".*")+1);if(b[a(292,"dC(H")](o)){t=!0;break}}if(e[z(65,-76)]("*")){const o=e[c(-166,"Qu[l")](".","\\.")[S("uTXa",754)]("*",".*");if(new RegExp(o)[l("pX]4",-75)](b)){t=!0;break}}}if(!t){j=!1;const t=l("T6w4",-76)+b+"'.";return void(P=F(t,z(3,-18)+f[a(130,"bui2")][x(1271,1312)][S("5GoS",796)](", ")+y(500,424)))}}if(!f[x(1501,1526)][y(530,435)][D(1142,1036)]){if(i[s(1207,"V[7O")](D(787,806))[D(968,982)](".")[0]!==f[l("dC(H",-188)][x(1500,1376)][s(1150,"uTXa")](".")[0]){j=!1;const t=c(-184,"jJMI");return void(P=F(t))}}return}function x(t,e){return ft(t-837,e)}const C=S("dC(H",982),W=z(28,36),$=w;function S(t,e){return pt(e-294,t)}function z(t,e){return ft(t- -449,e)}if(t){if(t[c(-90,"qVoA")](z(99,76)))return function(){function e(t,e){return D(e,t- -779)}let o=null;try{const a=t[r(")wui",718)](5),l=h[r("7gAc",812)](a,C)[e(270,202)](g);o=JSON[n(174,"KAXY")](l),o&&i[s("qtFU",-404)](e(225,343),{for:o[e(86,-23)],domains:[...o[s(")wui",-424)]],type:Object[u(1194,"V[7O")]({},o[u(1271,"sNZE")]),validUntil:Object[M(918,767)]({},o[w(597,560)])})}catch(t){}function s(t,e){return c(e- -272,t)}function n(t,e){return a(t-2,e)}if(!o||!o[s("uTXa",-241)]||!o[n(186,"Z!bF")][s("k]MG",-307)]){j=!1;const t=M(949,839);return void(P=F(t,I))}if(!o[e(220,212)]){j=!1;const t=r("@]ue",740);return void(P=F(t,I))}function r(t,e){return c(e-805,t)}const d=function(t){const e=Object[o(966,1071)]({},t);function o(t,e){return y(e,t-642)}function i(t,e){return a(t-172,e)}return delete e[i(366,"Z!bF")],delete e[i(347,"uTXa")],JSON[o(1088,1136)](e)}(o);function u(t,e){return a(t-1218,e)}function w(t,e){return z(e-329,t)}if(!function(t,e){if(!t||!e)return!1;const o=new $({});var i,a,s,n;return o[(i="Lh[&",a=207,l(i,a-128))](W),o[(s=656,n=536,z(s-649,n))](e,t,p)}(o[(v=686,S=743,y(S,v-152))],d)){j=!1;const t=s("pLXS",-262);return void(P=F(t,I))}var v,S;function M(t,e){return x(e- -534,t)}const G=(new Date)[e(278,203)]();if(o[e(226,303)][M(829,713)]<G){j=!1;const t=D(953,751);P=F(t,I)}else{var T,k;if(o[u(1370,"@]ue")][M(812,713)]===s("AN2v",-167)||o[M(665,747)][(T="qVoA",k=1530,a(k-1271,T))]===w(584,593)){const t=b[s("Z[0U",-258)](":");t>-1&&(b=b[s("sNZE",-380)](0,t));const e=m(b);e[u(1269,"0ehx")]===f[u(1361,"8nIz")]&&e[w(501,391)]&&e[n(215,"AN2v")]&&(b=e[r("3H[T",696)]+"."+e[M(889,819)][w(503,447)]("."))}if(o[s("uTXa",-334)][s("Cf&G",-274)](b));else{j=!1;const t=u(1434,"QjRk")+b+u(1457,"5GoS");P=F(t,I)}}}();const e=y(481,383),r=encodeURIComponent,d=(new Date)[c(0,"u2H$")](),w=h[a(182,"Z[0U")](d,C),v=D(941,914),G=u(d+b,v,{keySize:16})[D(970,1049)](),T=[r(s(1147,"Z!bF"))+"="+r(t),r(x(1560,1614))+"="+r(b),r(S("k]MG",782))+"="+r(location[l("$]Vb",-56)]),r(y(193,292))+"="+r(w),r(n(1243,1219))+"="+r(e),r(y(384,500))+"="+r(navigator[z(124,-4)])][x(1404,1494)]("&"),k=n(1213,1350);window[a(250,"5GoS")](k,{method:y(371,489),redirect:a(196,"KAXY"),headers:{"Content-Type":S("qtFU",881)},body:T})[l("Lh[&",-157)]((t=>{return 200!==t[(i=1264,a="KAXY",s(i-189,a))]&&(j=!1,P=M),t[(e=466,o=617,D(o,e- -510))]();var e,o,i,a}))[a(31,"Lh[&")]((a=>{function n(t,e){return x(e- -1026,t)}function d(t,e){return S(t,e- -120)}function h(t,e){return l(e,t-586)}function u(t,e){return y(t,e- -62)}function m(t,e){return z(e- -242,t)}function f(t,e){return c(t- -256,e)}function g(t,e){return l(e,t-772)}function p(t,e){return s(e- -1346,t)}if(a&&a.ok)if(a[f(-309,"uTXa")]&&a[f(-404,"j5pR")]===G)j=!0,i[n(375,282)](p("l$&U",-278),(()=>{function t(t,e){return n(t,e-659)}function e(t,e){return d(e,t- -875)}var i,s;var l,r,c,h;function u(t,e){return n(t,e-306)}function m(t,e){return p(e,t-328)}return{registeredDomains:a[e(-47,"7gAc")],validUntil:{text:a[t(1107,1150)],value:o[u(698,696)][(c="7gAc",h=-300,f(h-19,c))](a[t(1083,1150)])[u(519,568)]()},type:null!==(i=a[m(146,"ykFB")])&&void 0!==i?i:{text:(l=1549,r=1443,n(r,l-1100)),value:m(-34,"Z!bF")},for:null!==(s=a[e(-158,"uTXa")])&&void 0!==s?s:""}}));else{j=!1;const o=g(642,"l$&U");P=F(o,I);const i=m(-6,-26),s=[r(g(878,"jJMI"))+"="+r(t),r(n(515,534))+"="+r(b),r(u(436,495))+"="+r(location[u(391,495)]),r(f(-435,"PHcw"))+"="+r(e),r(m(-299,-208))+"="+r(String(a[d("5GoS",721)])),r(f(-146,"0yPT"))+"="+r(G),r(C(-92,64))+"="+r(navigator[m(-211,-118)])][u(329,365)]("&");window[u(462,507)](i,{method:C(-103,-176),redirect:p("#Imo",-265),headers:{"Content-Type":m(-227,-137)},body:s})}else if(a){j=!1;const t=E(a[u(652,494)][(w=1323,v=1195,y(w,v-900))](/\n/gi,h(662,"dC(H")));let e=null;a[f(-150,"yaU7")]&&(e=E(a[n(294,421)][n(237,246)](/\n/gi,m(-109,19))));const o=h(487,"@]ue");P=B` <div class="${o}"><strong>${Y} ${t}</strong><br />${e}<br />${I}</div> `}else j=!1,P=M;var w,v;function C(t,e){return D(e,t- -1057)}H()}))[D(1077,949)]((()=>{j=!1,P=M,H()}))}else{j=!1;const t=D(743,826),e=s(1195,"jJMI");P=B` <div class="${e}">${Y} ${t}${I}</div> `}}))}function Z(t,e){return pt(e-362,t)}function K(t,e){return pt(e- -141,t)}N(_[Z("Qu[l",844)](L(1497,1484),(t=>{var e,o;function a(t,e){return Z(e,t- -1221)}U(t)[(e="7gAc",o=-34,y(e,o- -845))]((()=>{H()}))[a(-402,"QjRk")]((t=>{j=!1;const e=n("Lh[&",-17);var o,s;function n(t,e){return a(e-393,t)}P=F(e),i[(o=932,s=959,ft(o-520,s))](ft(164- -502,322))&&console[n("kUE)",170)](a(1308-1683,"PHcw"),t),H()})),H()})));const J={width:0,height:0},q={width:0,height:0};let Q,X,tt,et;function ot(t){function e(t,e){return O(t- -194,e)}function o(t,e){return S(e,t- -355)}const a=t[e(979,1018)],s=t[o(-10,"dC(H")];var n,l;(J[o(-23,"Cf&G")]!==a||J[o(-6,"Cf&G")]!==s)&&(J[e(1143,1205)]=a,J[o(15,"qtFU")]=s,i[(n="T6w4",l=-258,S(n,l- -649))](L(41- -1490,177),J))}class it{constructor(t){function e(t,e){return x(t,e- -401)}var o,a;!Q&&(Q=new ResizeObserver((()=>{ot(t)})),Q[e("PHcw",133)](t),i[(o=-294,a=-232,L(o- -1570,a))](e("yaU7",177),t),ot(t))}[Z("@]ue",851)](){}[Z("pLXS",1044)](t){var e,o;Q[(e="T6w4",o=1257,S(e,o-936))](t)}}function at(t){const e=t[o(987,"qVoA")];function o(t,e){return x(e,t-560)}const a=t[s(-177,-233)];function s(t,e){return L(t- -1599,e)}var n,l,r,c;(q[o(897,"uTXa")]!==e||q[(r=434,c="kUE)",x(c,r-137))]!==a)&&(q[s(-202,-155)]=e,q[(n="@]ue",l=204,x(n,l- -259))]=a,i[s(-323,-318)](S("Lh[&",394- -18),q))}!$[K("$]Vb",532)](it)&&$[O(1412,1532)](it);class st{constructor(t){var e,o;function a(t,e){return O(t-192,e)}t=t[(e=1074,o="PHcw",x(o,e-724))],!X&&(X=new ResizeObserver((()=>{at(t)})),X[a(1362,1507)](t),i[a(1408,1415)](a(1562,1642),t),at(t))}[S("[aTY",166)](){}[L(1535,1507)](t){var e,o,i,a;X[(i=121,a=77,V(i-146,a))](t[(e=369,o=490,L(o- -905,e))])}}!$[W(218,123)](st)&&$[W(336,276)](st),a((()=>{var t,e,o,i;X[(o=143,i=279,V(o-409,i))](),Q[(t="j5pR",e=816,y(t,e-114))]()})),a(i[v(633,686)]([x("lLsV",539),K("V[7O",486)],(()=>{function t(t,e){return v(t,e-266)}function e(t,e){return K(t,e-645)}function o(t,e){return v(t,e- -783)}if(i[(a=666,s=787,V(a-970,s))](Z("sNZE",18- -792))){const a=i[e("ykFB",1151)](t(981,851));if(!a)return;i[t(753,810)](o(24,-94),(()=>{var t,s,n,l;return a[(n=1192,l="Z!bF",e(l,n-40))]-i[(t=-403,s=-358,o(t,s- -60))](W(860,878-439-143))}))}var a,s}),{group:!0})),a(i[v(459,582)](W(40,30),(t=>{var e,o,i,a,s,n,l,r;tt=t[(l="qtFU",r=1077,x(l,r-733))][(s=184,n=184,v(s,n- -566))],et=t[(i=-110,a=-106,V(a- -107,i))][(e="k]MG",o=963,Z(e,o-170))]})));const nt={handleEvent(t){function e(t,e){return x(t,e-835)}function a(t,e){return W(t,e-978)}const s=o[g(1503,1639)](t);if(t[u("sNZE",182)]||s.x){const t=s.x?s.x:s.y,e=o[g(1310,1468)]();return void(t>0?i[g(1207,1352)](g(1494,1539))?o[(r=975,c=1008,L(r- -410,c))](e[h(827,849)]+t*tt):o[(n=1373,l=1406,W(l,n-1184))](e[f(1343,"ZtUo")]+tt):i[h(784,725)](h(1071,1060))?o[f(1575,"Z!bF")](e[a(985,1042)]+t*tt):o[f(1497,"V[7O")](e[f(1431,"lLse")]-tt))}var n,l,r,c;const d=o[g(1329,1467)]();function h(t,e){return L(t- -433,e)}function u(t,e){return Z(t,e- -745)}function m(t,e){return Z(t,e- -803)}function f(t,e){return Z(e,t-485)}function g(t,e){return L(t- -10,e)}if(s.y>0)if(i[f(1397,"PHcw")](u("bui2",173))){const t=i[g(1207,1190)](m("bui2",294));let a=0;a=t?s.y/t*et:s.y*et,o[e("8nIz",1355)](d[h(827,933)]+a)}else o[a(1138,1301)](d[a(1031,1072)]+et);else if(i[g(1207,1240)](g(1451,1358))){const t=i[m("7gAc",116)](h(933,815));let a=0;a=t?s.y/t*et:s.y*et,o[e("0yPT",1210)](d[f(1371,"pX]4")]+a)}else o[f(1367,"0ehx")](d[u("qVoA",223)]-et)},passive:!0},lt=Object[W(144,73)](Object[O(1209,1137)]({},e),{api:o,state:i,componentName:C});r((t=>{for(const e in t)lt[e]=t[e]}));const rt=s[y("0ehx",753)]($,lt),ct=o[Z("5BBS",930)](y("Z[0U",602),t,e);return a(ct[W(264,339)]),()=>j?ct[L(1245,1393)](Z("FOkT",789),l`
            <div
              data-info-url="https://github.com/neuronetio/gantt-schedule-timeline-calendar"
              class=${D[O(1416,1504)]}
              style=${D[L(1512,1442)][K("#Imo",455)]()}
              data-actions=${rt()}
              @wheel=${nt}
            >
              ${ct[O(1185,1096)](v(832,685),l` ${R[V(-276,-119)]()}${A[x("sNZE",258)]()} `)}
            </div>
          `):P}let bt;!function(){function t(t,e){return pt(t- -374,e)}function e(t,e){return pt(e-637,t)}function o(t,e){return ft(t- -698,e)}function i(t,e){return pt(t- -927,e)}const a=gt();for(;;)try{if(157305===parseInt(e("kUE)",1073))/1*(-parseInt(o(-244,-99))/2)+parseInt(pt(-103- -788,"qVoA"))/3+parseInt(i(-297,"T6w4"))/4*(-parseInt((s=717,n=841,ft(s-114,n)))/5)+-parseInt(t(310,"Cf&G"))/6*(-parseInt(o(-26,-162))/7)+-parseInt(e("5BBS",1195))/8+-parseInt(e("sNZE",1312))/9+-parseInt(i(-319,"j5pR"))/10*(-parseInt(t(170,"@]ue"))/11))break;a.push(a.shift())}catch(t){a.push(a.shift())}var s,n}();const vt=new Array(128).fill(void 0);function yt(t){return vt[t]}vt.push(void 0,null,!0,!1);let Pt=vt.length;function Dt(t){const e=yt(t);return function(t){t<132||(vt[t]=Pt,Pt=t)}(t),e}const xt="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};"undefined"!=typeof TextDecoder&&xt.decode();let Ct=null;function Wt(){return null!==Ct&&0!==Ct.byteLength||(Ct=new Uint8Array(bt.memory.buffer)),Ct}function $t(t,e){return t>>>=0,xt.decode(Wt().subarray(t,t+e))}function It(t){Pt===vt.length&&vt.push(vt.length+1);const e=Pt;return Pt=vt[e],vt[e]=t,e}let St=0;const Mt="undefined"!=typeof TextEncoder?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},Gt="function"==typeof Mt.encodeInto?function(t,e){return Mt.encodeInto(t,e)}:function(t,e){const o=Mt.encode(t);return e.set(o),{read:t.length,written:o.length}};function zt(t,e,o){if(void 0===o){const o=Mt.encode(t),i=e(o.length,1)>>>0;return Wt().subarray(i,i+o.length).set(o),St=o.length,i}let i=t.length,a=e(i,1)>>>0;const s=Wt();let n=0;for(;n<i;n++){const e=t.charCodeAt(n);if(e>127)break;s[a+n]=e}if(n!==i){0!==n&&(t=t.slice(n)),a=o(a,i,i=n+3*t.length,1)>>>0;const e=Wt().subarray(a+n,a+i);n+=Gt(t,e).written}return St=n,a}let Tt=null;function kt(){return null!==Tt&&0!==Tt.byteLength||(Tt=new Int32Array(bt.memory.buffer)),Tt}function Lt(){const t={wbg:{}};return t.wbg.__wbindgen_object_drop_ref=function(t){Dt(t)},t.wbg.__wbindgen_string_new=function(t,e){return It($t(t,e))},t.wbg.__wbindgen_bigint_from_i64=function(t){return It(t)},t.wbg.__wbindgen_bigint_from_u64=function(t){return It(BigInt.asUintN(64,t))},t.wbg.__wbindgen_error_new=function(t,e){return It(new Error($t(t,e)))},t.wbg.__wbindgen_object_clone_ref=function(t){return It(yt(t))},t.wbg.__wbg_String_b9412f8799faab3e=function(t,e){const o=zt(String(yt(e)),bt.__wbindgen_malloc,bt.__wbindgen_realloc),i=St;kt()[t/4+1]=i,kt()[t/4+0]=o},t.wbg.__wbindgen_number_new=function(t){return It(t)},t.wbg.__wbg_set_f975102236d3c502=function(t,e,o){yt(t)[Dt(e)]=Dt(o)},t.wbg.__wbg_new_abda76e883ba8a5f=function(){return It(new Error)},t.wbg.__wbg_stack_658279fe44541cf6=function(t,e){const o=zt(yt(e).stack,bt.__wbindgen_malloc,bt.__wbindgen_realloc),i=St;kt()[t/4+1]=i,kt()[t/4+0]=o},t.wbg.__wbg_error_f851667af71bcfc6=function(t,e){let o,i;try{o=t,i=e,console.error($t(t,e))}finally{bt.__wbindgen_free(o,i,1)}},t.wbg.__wbg_new_898a68150f225f2e=function(){return It(new Array)},t.wbg.__wbg_new_56693dbed0c32988=function(){return It(new Map)},t.wbg.__wbg_new_b51585de1b234aff=function(){return It(new Object)},t.wbg.__wbg_set_502d29070ea18557=function(t,e,o){yt(t)[e>>>0]=Dt(o)},t.wbg.__wbg_set_bedc3d02d0f05eb0=function(t,e,o){return It(yt(t).set(yt(e),yt(o)))},t.wbg.__wbindgen_is_string=function(t){return"string"==typeof yt(t)},t.wbg.__wbindgen_throw=function(t,e){throw new Error($t(t,e))},t}function Rt(t,e){return bt=t.exports,Ot.__wbindgen_wasm_module=e,Tt=null,Ct=null,bt}async function Ot(t){if(void 0!==bt)return bt;const e=Lt();("string"==typeof t||"function"==typeof Request&&t instanceof Request||"function"==typeof URL&&t instanceof URL)&&(t=fetch(t));const{instance:o,module:i}=await async function(t,e){if("function"==typeof Response&&t instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(t,e)}catch(e){if("application/wasm"==t.headers.get("Content-Type"))throw e;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",e)}const o=await t.arrayBuffer();return await WebAssembly.instantiate(o,e)}{const o=await WebAssembly.instantiate(t,e);return o instanceof WebAssembly.Instance?{instance:o,module:t}:o}}(await t,e);return Rt(o,i)}var At=Object.freeze({__proto__:null,parse_license_key:function(t,e){const o=zt(t,bt.__wbindgen_malloc,bt.__wbindgen_realloc),i=St,a=zt(e,bt.__wbindgen_malloc,bt.__wbindgen_realloc),s=St;return Dt(bt.parse_license_key(o,i,a,s))},License:class{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,t}free(){const t=this.__destroy_into_raw();bt.__wbg_license_free(t)}},LicenseDate:class{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,t}free(){const t=this.__destroy_into_raw();bt.__wbg_licensedate_free(t)}},LicenseKeyResult:class{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,t}free(){const t=this.__destroy_into_raw();bt.__wbg_licensekeyresult_free(t)}},LicenseResult:class{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,t}free(){const t=this.__destroy_into_raw();bt.__wbg_licenseresult_free(t)}},LicenseType:class{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,t}free(){const t=this.__destroy_into_raw();bt.__wbg_licensetype_free(t)}},ProductInfo:class{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,t}free(){const t=this.__destroy_into_raw();bt.__wbg_productinfo_free(t)}},SignedLicense:class{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,t}free(){const t=this.__destroy_into_raw();bt.__wbg_signedlicense_free(t)}},initSync:function(t){if(void 0!==bt)return bt;const e=Lt();return t instanceof WebAssembly.Module||(t=new WebAssembly.Module(t)),Rt(new WebAssembly.Instance(t,e),t)},default:Ot});
/**
 * Gantt-Schedule-Timeline-Calendar component
 *
 * @copyright NEURONET - Rafal Pospiech
 * @author    Rafal Pospiech <neuronet.io@gmail.com>
 * @module    gantt-schedule-timeline-calendar
 * @link      https://github.com/neuronetio/gantt-schedule-timeline-calendar
 * @link      https://gantt-schedule-timeline-calendar.neuronet.io
 * @version   3.40.5
 * @released  2025-03-24
 * @license   SEE LICENSE IN LICENSE FILE
 */
const Vt=async function(t={}){let{importHook:e,serverPath:o}=t,i=new URL("assets/dcf9fc09.wasm",import.meta.url).href;return null!=o&&(i=o+/[^\/\\]*$/.exec(i)[0]),null!=e&&(i=e(i)),await Ot(i),At};function Nt(t){const e=t.state,o=new M(e),i={treeMap:{},itemRowMap:{},list:{visibleRows:[],rowsIds:[],rows:{},visibleRowsHeight:0,rowsWithParentsExpanded:[],rowsHeight:0,width:0},dimensions:{width:0,height:0},chart:{items:{},grid:{cells:{},rows:{}},dimensions:{width:0,widthWithoutScrollBar:0,height:0,innerHeight:0,heightWithoutScrollBar:0},verticallyVisibleItems:[],time:{zoom:0,format:{period:"day",periodIncrement:1,zoomTo:0,format:()=>""},level:0,levels:[],currentZoomLevelFormatting:[],allDates:[],timePerPixel:0,totalViewDurationMs:0,totalViewDurationPx:0,leftGlobal:0,rightGlobal:0,leftPx:0,rightPx:0,period:"day",leftGlobalDate:void 0,rightGlobalDate:void 0,centerGlobal:0,centerGlobalDate:void 0,from:0,to:0,fromDate:void 0,toDate:void 0,autoExpandTimeFromItems:!1,datesCache:{timePerPixel:0,levels:[]}}},scroll:{horizontal:{lastPageSize:0,lastPageCount:0,absoluteSize:0,absoluteSizeWithoutLastPage:0,handlePosPx:0,innerHandleSize:0,absolutePosPx:0,maxHandlePosPx:0,scrollSize:0,dataIndex:0,dataId:"",data:null,preciseOffset:0,visible:!1,percent:0},vertical:{lastPageSize:0,lastPageCount:0,absoluteSize:0,absoluteSizeWithoutLastPage:0,handlePosPx:0,innerHandleSize:0,absolutePosPx:0,maxHandlePosPx:0,scrollSize:0,dataIndex:0,dataId:"",data:null,preciseOffset:0,visible:!1,percent:0}},elements:{},initializedPlugins:new Set};"boolean"==typeof t.debug&&t.debug&&(globalThis.state=e),e.update("",(t=>({config:t.config,$data:i})));const a=b(e,o),s=a.lithtml;o.setVido(a),o.setMergeDeep(d);const n=a.createApp({component:wt,props:{wasmInitialized:Vt},element:t.element}),l=n.vidoInstance.api;const r={state:e,api:l,component:n,destroy:function(){n.destroy(),e.destroy()},reload:function(){r.component.destroy(),r.component=a.createApp({component:wt,props:{wasmInitialized:Vt},element:t.element}),r.api=n.vidoInstance.api,r.component.update()},lithtml:s,Vido:b};return r}const _t=document.createTextNode("");document.createTextNode=function(t){const e=_t.cloneNode(!0);return e.textContent=t,e}.bind(document);const Ht=document.createElement("div"),Bt=document.createElement.bind(document);document.createElement=function(t,...e){if("div"!==t)return Bt(t,...e);return Ht.cloneNode(!0)}.bind(document),Nt.api=ut,Nt.lithtml=n,Nt.Vido=b;export{Nt as default};