simple-gantt-chart
Version:
Very simple vanilla JavaScript library for displaying projects as Gantt Charts.
2 lines • 41.9 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ganttchart=e():t.ganttchart=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){var t;return function(){if(null!=t)return t;var e=window.document.createElement("div"),n=window.document.createElement("div");return e.style.width="100px",e.style.overflowX="scroll",n.style.width="100px",window.document.body.appendChild(e),window.document.body.appendChild(n),t=e.offsetHeight-n.offsetHeight,window.document.body.removeChild(e),window.document.body.removeChild(n),t}}();e.default=r},function(t,e,n){"use strict";n.r(e),n.d(e,"GanttChart",(function(){return se}));var r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),i=new Uint8Array(16);function a(){if(!r)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(i)}for(var o=[],s=0;s<256;++s)o[s]=(s+256).toString(16).substr(1);var u=function(t,e){var n=e||0,r=o;return[r[t[n++]],r[t[n++]],r[t[n++]],r[t[n++]],"-",r[t[n++]],r[t[n++]],"-",r[t[n++]],r[t[n++]],"-",r[t[n++]],r[t[n++]],"-",r[t[n++]],r[t[n++]],r[t[n++]],r[t[n++]],r[t[n++]],r[t[n++]]].join("")};var c=function(t,e,n){var r=e&&n||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var i=(t=t||{}).random||(t.rng||a)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e)for(var o=0;o<16;++o)e[r+o]=i[o];return e||u(i)};function d(t,e){if(e.length<t)throw new TypeError(t+" argument"+t>1?"s":" required, but only "+e.length+" present")}function l(t){d(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}function h(t){const e=new Date(t);return e.setHours(0,0,0,0),e}function f(t){return t.getTime()%6e4}function g(t){var e=new Date(t.getTime()),n=Math.ceil(e.getTimezoneOffset());return e.setSeconds(0,0),6e4*n+(n>0?(6e4+f(e))%6e4:f(e))}function w(t){d(1,arguments);var e=l(t);return e.setHours(0,0,0,0),e}function m(t,e){d(2,arguments);var n=w(t),r=w(e),i=n.getTime()-g(n),a=r.getTime()-g(r);return Math.round((i-a)/864e5)}function b(t){d(1,arguments);var e=l(t);return!isNaN(e)}var p={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function y(t){return function(e){var n=e||{},r=n.width?String(n.width):t.defaultWidth;return t.formats[r]||t.formats[t.defaultWidth]}}var v={date:y({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:y({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:y({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},x={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function _(t){return function(e,n){var r,i=n||{};if("formatting"===(i.context?String(i.context):"standalone")&&t.formattingValues){var a=t.defaultFormattingWidth||t.defaultWidth,o=i.width?String(i.width):a;r=t.formattingValues[o]||t.formattingValues[a]}else{var s=t.defaultWidth,u=i.width?String(i.width):t.defaultWidth;r=t.values[u]||t.values[s]}return r[t.argumentCallback?t.argumentCallback(e):e]}}function T(t){return function(e,n){var r=String(e),i=n||{},a=i.width,o=a&&t.matchPatterns[a]||t.matchPatterns[t.defaultMatchWidth],s=r.match(o);if(!s)return null;var u,c=s[0],d=a&&t.parsePatterns[a]||t.parsePatterns[t.defaultParseWidth];return u="[object Array]"===Object.prototype.toString.call(d)?function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return n}(d,(function(t){return t.test(r)})):function(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}(d,(function(t){return t.test(r)})),u=t.valueCallback?t.valueCallback(u):u,{value:u=i.valueCallback?i.valueCallback(u):u,rest:r.slice(c.length)}}}var C,k={code:"en-US",formatDistance:function(t,e,n){var r;return n=n||{},r="string"==typeof p[t]?p[t]:1===e?p[t].one:p[t].other.replace("{{count}}",e),n.addSuffix?n.comparison>0?"in "+r:r+" ago":r},formatLong:v,formatRelative:function(t,e,n,r){return x[t]},localize:{ordinalNumber:function(t,e){var n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:_({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:_({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return Number(t)-1}}),month:_({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:_({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:_({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(C={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t,e){var n=String(t),r=e||{},i=n.match(C.matchPattern);if(!i)return null;var a=i[0],o=n.match(C.parsePattern);if(!o)return null;var s=C.valueCallback?C.valueCallback(o[0]):o[0];return{value:s=r.valueCallback?r.valueCallback(s):s,rest:n.slice(a.length)}}),era:T({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:T({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:T({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:T({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:T({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function M(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function E(t,e){d(2,arguments);var n=l(t).getTime(),r=M(e);return new Date(n+r)}function P(t,e){d(2,arguments);var n=M(e);return E(t,-n)}function D(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length<e;)r="0"+r;return n+r}var $={y:function(t,e){var n=t.getUTCFullYear(),r=n>0?n:1-n;return D("yy"===e?r%100:r,e.length)},M:function(t,e){var n=t.getUTCMonth();return"M"===e?String(n+1):D(n+1,2)},d:function(t,e){return D(t.getUTCDate(),e.length)},a:function(t,e){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":case"aaa":return n.toUpperCase();case"aaaaa":return n[0];case"aaaa":default:return"am"===n?"a.m.":"p.m."}},h:function(t,e){return D(t.getUTCHours()%12||12,e.length)},H:function(t,e){return D(t.getUTCHours(),e.length)},m:function(t,e){return D(t.getUTCMinutes(),e.length)},s:function(t,e){return D(t.getUTCSeconds(),e.length)},S:function(t,e){var n=e.length,r=t.getUTCMilliseconds();return D(Math.floor(r*Math.pow(10,n-3)),e.length)}};function S(t){d(1,arguments);var e=1,n=l(t),r=n.getUTCDay(),i=(r<e?7:0)+r-e;return n.setUTCDate(n.getUTCDate()-i),n.setUTCHours(0,0,0,0),n}function W(t){d(1,arguments);var e=l(t),n=e.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var i=S(r),a=new Date(0);a.setUTCFullYear(n,0,4),a.setUTCHours(0,0,0,0);var o=S(a);return e.getTime()>=i.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function H(t){d(1,arguments);var e=W(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var r=S(n);return r}function z(t,e){d(1,arguments);var n=e||{},r=n.locale,i=r&&r.options&&r.options.weekStartsOn,a=null==i?0:M(i),o=null==n.weekStartsOn?a:M(n.weekStartsOn);if(!(o>=0&&o<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=l(t),u=s.getUTCDay(),c=(u<o?7:0)+u-o;return s.setUTCDate(s.getUTCDate()-c),s.setUTCHours(0,0,0,0),s}function O(t,e){d(1,arguments);var n=l(t,e),r=n.getUTCFullYear(),i=e||{},a=i.locale,o=a&&a.options&&a.options.firstWeekContainsDate,s=null==o?1:M(o),u=null==i.firstWeekContainsDate?s:M(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=new Date(0);c.setUTCFullYear(r+1,0,u),c.setUTCHours(0,0,0,0);var h=z(c,e),f=new Date(0);f.setUTCFullYear(r,0,u),f.setUTCHours(0,0,0,0);var g=z(f,e);return n.getTime()>=h.getTime()?r+1:n.getTime()>=g.getTime()?r:r-1}function U(t,e){d(1,arguments);var n=e||{},r=n.locale,i=r&&r.options&&r.options.firstWeekContainsDate,a=null==i?1:M(i),o=null==n.firstWeekContainsDate?a:M(n.firstWeekContainsDate),s=O(t,e),u=new Date(0);u.setUTCFullYear(s,0,o),u.setUTCHours(0,0,0,0);var c=z(u,e);return c}var j="midnight",A="noon",L="morning",N="afternoon",Y="evening",q="night";function B(t,e){var n=t>0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),a=r%60;if(0===a)return n+String(i);var o=e||"";return n+String(i)+o+D(a,2)}function F(t,e){return t%60==0?(t>0?"-":"+")+D(Math.abs(t)/60,2):R(t,e)}function R(t,e){var n=e||"",r=t>0?"-":"+",i=Math.abs(t);return r+D(Math.floor(i/60),2)+n+D(i%60,2)}var X={G:function(t,e,n){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if("yo"===e){var r=t.getUTCFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return $.y(t,e)},Y:function(t,e,n,r){var i=O(t,r),a=i>0?i:1-i;return"YY"===e?D(a%100,2):"Yo"===e?n.ordinalNumber(a,{unit:"year"}):D(a,e.length)},R:function(t,e){return D(W(t),e.length)},u:function(t,e){return D(t.getUTCFullYear(),e.length)},Q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return D(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return D(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){var r=t.getUTCMonth();switch(e){case"M":case"MM":return $.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return D(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){var i=function(t,e){d(1,arguments);var n=l(t),r=z(n,e).getTime()-U(n,e).getTime();return Math.round(r/6048e5)+1}(t,r);return"wo"===e?n.ordinalNumber(i,{unit:"week"}):D(i,e.length)},I:function(t,e,n){var r=function(t){d(1,arguments);var e=l(t),n=S(e).getTime()-H(e).getTime();return Math.round(n/6048e5)+1}(t);return"Io"===e?n.ordinalNumber(r,{unit:"week"}):D(r,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):$.d(t,e)},D:function(t,e,n){var r=function(t){d(1,arguments);var e=l(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime(),i=n-r;return Math.floor(i/864e5)+1}(t);return"Do"===e?n.ordinalNumber(r,{unit:"dayOfYear"}):D(r,e.length)},E:function(t,e,n){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){var i=t.getUTCDay(),a=(i-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return D(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){var i=t.getUTCDay(),a=(i-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return D(a,e.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,n){var r=t.getUTCDay(),i=0===r?7:r;switch(e){case"i":return String(i);case"ii":return D(i,e.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){var r,i=t.getUTCHours();switch(r=12===i?A:0===i?j:i/12>=1?"pm":"am",e){case"b":case"bb":case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){var r,i=t.getUTCHours();switch(r=i>=17?Y:i>=12?N:i>=4?L:q,e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){var r=t.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return $.h(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):$.H(t,e)},K:function(t,e,n){var r=t.getUTCHours()%12;return"Ko"===e?n.ordinalNumber(r,{unit:"hour"}):D(r,e.length)},k:function(t,e,n){var r=t.getUTCHours();return 0===r&&(r=24),"ko"===e?n.ordinalNumber(r,{unit:"hour"}):D(r,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):$.m(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):$.s(t,e)},S:function(t,e){return $.S(t,e)},X:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();if(0===i)return"Z";switch(e){case"X":return F(i);case"XXXX":case"XX":return R(i);case"XXXXX":case"XXX":default:return R(i,":")}},x:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"x":return F(i);case"xxxx":case"xx":return R(i);case"xxxxx":case"xxx":default:return R(i,":")}},O:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+B(i,":");case"OOOO":default:return"GMT"+R(i,":")}},z:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+B(i,":");case"zzzz":default:return"GMT"+R(i,":")}},t:function(t,e,n,r){var i=r._originalDate||t;return D(Math.floor(i.getTime()/1e3),e.length)},T:function(t,e,n,r){return D((r._originalDate||t).getTime(),e.length)}};function V(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}}function Q(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}}var G={p:Q,P:function(t,e){var n,r=t.match(/(P+)(p+)?/),i=r[1],a=r[2];if(!a)return V(t,e);switch(i){case"P":n=e.dateTime({width:"short"});break;case"PP":n=e.dateTime({width:"medium"});break;case"PPP":n=e.dateTime({width:"long"});break;case"PPPP":default:n=e.dateTime({width:"full"})}return n.replace("{{date}}",V(i,e)).replace("{{time}}",Q(a,e))}},I=["D","DD"],J=["YY","YYYY"];function K(t){return-1!==I.indexOf(t)}function Z(t){return-1!==J.indexOf(t)}function tt(t){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` for formatting years; see: https://git.io/fxCyr");if("YY"===t)throw new RangeError("Use `yy` instead of `YY` for formatting years; see: https://git.io/fxCyr");if("D"===t)throw new RangeError("Use `d` instead of `D` for formatting days of the month; see: https://git.io/fxCyr");if("DD"===t)throw new RangeError("Use `dd` instead of `DD` for formatting days of the month; see: https://git.io/fxCyr")}var et,nt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,it=/^'([^]*?)'?$/,at=/''/g,ot=/[a-zA-Z]/;function st(t,e,n){d(2,arguments);var r=String(e),i=n||{},a=i.locale||k,o=a.options&&a.options.firstWeekContainsDate,s=null==o?1:M(o),u=null==i.firstWeekContainsDate?s:M(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=a.options&&a.options.weekStartsOn,h=null==c?0:M(c),f=null==i.weekStartsOn?h:M(i.weekStartsOn);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!a.localize)throw new RangeError("locale must contain localize property");if(!a.formatLong)throw new RangeError("locale must contain formatLong property");var w=l(t);if(!b(w))throw new RangeError("Invalid time value");var m=g(w),p=P(w,m),y={firstWeekContainsDate:u,weekStartsOn:f,locale:a,_originalDate:w},v=r.match(rt).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,G[e])(t,a.formatLong,y):t})).join("").match(nt).map((function(t){if("''"===t)return"'";var e=t[0];if("'"===e)return ut(t);var n=X[e];if(n)return!i.useAdditionalWeekYearTokens&&Z(t)&&tt(t),!i.useAdditionalDayOfYearTokens&&K(t)&&tt(t),n(p,t,a.localize,y);if(e.match(ot))throw new RangeError("Format string contains an unescaped latin alphabet character `"+e+"`");return t})).join("");return v}function ut(t){return t.match(it)[1].replace(at,"'")}function ct(t,e){d(2,arguments);var n=l(t),r=M(e);return n.setDate(n.getDate()+r),n}function dt(t,e,n,r){switch(t){case"day":return function(t,e,n){if(n<e)throw new Error("Invalid date range");const r=h(e);let i=h(n);const a=m(i,r);a<31&&(i=ct(i,31-a));const o=[];let s=0;for(let e=new Date(r);e<=i;e=ct(e,1))o.push({day:new Date(e),dayAsString:st(e,"d. MMM"),left:s}),s+=t;return o}(e,n,r);default:throw new TypeError(`Invalid scale "${t}"`)}}!function(t){t.day="day"}(et||(et={}));class lt{constructor(){const t=new Date;this.id=c(),this.columns=[{id:"text",title:"Tasks"},{id:"days",title:"Days",width:60}],this.scale=et.day,this.scaleStart=h(function(t){d(1,arguments);var e=l(t);return e.setDate(1),e.setHours(0,0,0,0),e}(t)),this.scaleEnd=h(function(t){d(1,arguments);var e=l(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}(t)),this.treeWidthPercentage=30,this.timelineCellWidth=60,this.lineHeight=34,this.tasks=[],this.links=[],this.callbackTaskClick=null,this.callbackTaskDblClick=null}setConfig(t){if(void 0!==t.treeWidthPercentage){if(!("number"==typeof t.treeWidthPercentage&&t.treeWidthPercentage>=0&&t.treeWidthPercentage<=100))throw new TypeError(`The option "treeWidthPercentage" must be a number between 0 and 100: ${t.treeWidthPercentage}`);this.treeWidthPercentage=t.treeWidthPercentage}void 0!==t.columns&&(this.columns=function(t){if(!Array.isArray(t))throw new TypeError('The option "columns" must be an array');const e=[],n=t.map(t=>{if(-1!==e.indexOf(t.id))throw new TypeError(`The option columns uses the id "${t.id}" more then once`);return e.push(t.id),Object.assign({},t)});return["text","days"].forEach(t=>{if(-1===e.indexOf(t))throw new TypeError(`The option "columns" does not contain the required column "${t}"`)}),n}(t.columns))}getRootElement(){const t=document.getElementById(this.id);if(null===t)throw new Error(`The element with id "${this.id}" cannot be found`);return t}getElementByClassName(t){const e=this.getRootElement().querySelector(`.${t}`);if(null===e)throw new Error(`The selector ".${t}" cannot be found`);return e}getElementsByClassName(t){return this.getRootElement().querySelectorAll(`.${t}`)}}function ht(t){return function(t){return"number"==typeof t&&!Number.isNaN(t)&&Number.isFinite(t)}(t)&&t%1==0}function ft(t,e){if(!Array.isArray(t)||!t.every(t=>"object"==typeof t))throw new Error('The method "setData" expects the first parameter to be an array of tasks');let n=null,r=null;const i=[];e.tasks=t.map(t=>{if(!ht(t.id)||t.id<=0)throw new TypeError('The property "id" must be a positive integer');if(-1!==i.indexOf(t.id))throw new TypeError(`The task id "${t.id}" is used more then once`);if(i.push(t.id),"string"!=typeof t.text)throw new TypeError(`The property "text" in task "${t.id}" must be a string`);if(!b(t.startDate))throw new TypeError(`The property "startDate" in task "${t.id}" must be a Date`);if(!ht(t.days)||t.days<=0)throw new TypeError('The property "days" must be a positive integer');const e=ct(t.startDate,t.days);return(null===n||t.startDate<n)&&(n=t.startDate),(null===r||e>r)&&(r=e),{id:t.id,text:t.text,startDate:t.startDate,endDate:e,days:t.days}}),null!==n&&(e.scaleStart=n),null!==r&&(e.scaleEnd=r),e.links=function(t,e){const n=[];return t.forEach(t=>{if(Array.isArray(t.dependencies)){if(r=t.dependencies,new Set(r).size!==r.length)throw new TypeError(`The dependencies in the task with id "${t.id}" contain duplicates`);t.dependencies.forEach(r=>{if(-1===e.indexOf(r))throw new TypeError(`The task with id "${t.id}" has an invalid dependency "${r}"`);n.push({source:r,target:t.id})})}var r}),n}(t,i)}class gt{constructor(t={}){if(this._styles={},t instanceof gt)this._styles=Object.assign({},t._styles);else for(const e in t){const n=e.toLocaleLowerCase();if(this._styles.hasOwnProperty(n))throw new TypeError(`Duplicate style "${n}"`);this._styles[n]=t[e]}}merge(t){for(const e in t){const n=e.toLocaleLowerCase();this._styles[n]=t[e]}}getComponent(t){const e=t.toLowerCase();return this._styles.hasOwnProperty(e)?this._styles[e]:null}setComponent(t,e){this._styles[t.toLowerCase()]=e}hasComponent(t){return null!==this.getComponent(t)}toString(){const t=[];for(const e in this._styles)t.push(`${e}:${this._styles[e]};`);return t.join("")}}class wt{constructor(t={}){if(this._attributes={},t instanceof wt)this._attributes=Object.assign({},t._attributes);else for(const e in t){const n=e.toLowerCase(),r=t[e];if("string"!=typeof r&&"number"!=typeof r)throw new TypeError(`Invalid type of value in attribute "${e}"`);if(this._attributes.hasOwnProperty(n))throw new TypeError(`Duplicate attribute "${e}"`);this._attributes[n]=r.toString()}}getAttribute(t){const e=t.toLowerCase();return this._attributes.hasOwnProperty(e)?this._attributes[e]:null}setAttribute(t,e){this._attributes[t.toLowerCase()]=e.toString()}hasAttribute(t){return null!==this.getAttribute(t)}pushValue(t,e){const n=e.toString();if(0===n.length||this.hasValue(t,n))return;const r=this.getAttribute(t);this.setAttribute(t,function(t,e){let n=null===t?"":t;e.length>0&&(n+=(n.length>0?" ":"")+e);return n}(null!==r?r:"",n))}hasValue(t,e){const n=this.getAttribute(t);return null!==n&&0!==n.length&&-1!==n.split(" ").indexOf(e.toString())}toString(){const t=[];for(const e in this._attributes)t.push(`${e}="${this._attributes[e]}"`);return t.join(" ")}appyAttributes(t){for(const e in this._attributes)t.setAttribute(e,this._attributes[e])}}function mt(t,e){const n=function(t){if(t instanceof wt)return t.toString();if("object"==typeof t&&null!==t){return new wt(t).toString()}return""}(e);return`<${t}${n.length>0?" "+n:""}>`}function bt(t,e={},n="",r={}){return function(t,e={},n={}){const r=new wt(n),i=new gt(e).toString();if(r.hasAttribute("class")||r.hasAttribute("style"))throw new Error('The parameter "attributes" cannot contain a "class" or "style" attribute');return"string"==typeof t?r.setAttribute("class",t):t.length>0&&r.setAttribute("class",t.join(" ")),i.length>0&&r.setAttribute("style",i),mt("div",r)}(t,e,r)+n+"</div>"}const pt="gc_root_container_view",yt="gc_header_view",vt="gc_body_view",xt="gc_scrollbar_view",_t="gc_tree_header_view",Tt="gc_tree_header_row",Ct="gc_tree_header_cell",kt="gc_tree_table_view",Mt="gc_tree_table_row",Et="gc_tree_table_cell",Pt="gc_tree_scrollbar_cell",Dt="gc_timeline_header_view",$t="gc_timeline_header_gap_view",St="gc_timeline_header_row",Wt="gc_timeline_header_cell",Ht="gc_timeline_table_view",zt="gc_timeline_table_grid_view",Ot="gc_timeline_table_task_view",Ut="gc_timeline_table_link_view",jt="gc_timeline_table_row",At="gc_timeline_table_cell",Lt="gc_timeline_table_task",Nt="gc_timeline_scrollbar_cell",Yt="gc_timeline_scrollbar_gap",qt="gc_border_bottom",Bt="gc_border_left",Ft="gc_border_right_wide";var Rt,Xt=n(0),Vt=n.n(Xt);class Qt{constructor(t,e){this._config=t,this._width=e,this._header=function(t,e){const n=t.reduce((t,e)=>("number"==typeof e.width&&(t+=e.width),t),0),r=t.filter(t=>"number"!=typeof t.width).length,i=Math.round((e-n)/r);return t.map(t=>({title:t.title,id:t.id,width:"number"==typeof t.width?t.width:i}))}(t.columns,e)}getHeader(){const t={"box-sizing":"border-box",width:`${this._width}px`,display:"flex","flex-direction":"row"},e=function(t,e){const n=t.map((e,n)=>function(t,e,n){const r=[Ct,qt];e||r.push(Bt);n&&r.push(Ft);return bt(r,{height:"inherit",width:`${t.width}px`,"min-width":`${t.width}px`,"box-sizing":"border-box"},t.title)}(e,0===n,n===t.length-1)).join("");return bt(Tt,{height:`${e}px`,"box-sizing":"border-box",display:"flex","flex-direction":"row"},n)}(this._header,this._config.lineHeight);return bt(_t,t,e)}getTable(){const t=this._config.tasks.map(t=>function(t,e,n){const r=e.map((n,r)=>function(t,e,n,r){const i=[Et];n||i.push(Bt);r&&i.push(Ft);const a=t[e.id];return bt(i,{height:"inherit",width:`${e.width}px`,"box-sizing":"border-box"},a,{"data-columnid":e.id,"data-taskid":t.id})}(t,n,0===r,r===e.length-1)).join("");return bt([Mt,qt],{height:`${n}px`,width:"inherit","box-sizing":"border-box",display:"flex","flex-direction":"row"},r,{"data-taskid":t.id})}(t,this._header,this._config.lineHeight)).join("");return bt(kt,{"box-sizing":"border-box",width:`${this._width}px`},t)}}!function(t){t.left="left",t.right="right",t.up="up",t.down="down"}(Rt||(Rt={}));class Gt{constructor(t){this._lastPosition=Object.assign({},t),this._vectors=[]}getVectors(){return this._vectors}getLastPosition(){return this._lastPosition}addVector(t,e){let{x:n,y:r}=this._lastPosition;switch(t){case Rt.left:n-=e;break;case Rt.right:n+=e;break;case Rt.up:r-=e;break;case Rt.down:r+=e;break;default:throw new TypeError(`Invalid direction "${t}"`)}this.addLineToPoint({x:n,y:r})}addLineToPoint(t){const e=this._lastPosition,n=Object.assign({},t),r=Gt._getDirection(e,n);this._vectors.push({x:e.x,y:e.y,direction:r,size:Math.abs(r===Rt.left||r===Rt.right?e.x-n.x:e.y-n.y)}),this._lastPosition=n}static _getDirection(t,e){return e.x<t.x?Rt.left:e.x>t.x?Rt.right:e.y>t.y?Rt.down:Rt.up}}function It(t){const e=function(t,e,n){const r={x:t.left+t.width,y:t.top},i={x:e.left,y:e.top};r.x+=1,r.y-=2,i.y-=2;const a=new Gt({x:r.x,y:r.y}),o=i.x-r.x;if(o>24)a.addVector(Rt.right,o/2),a.addVector(Rt.down,i.y-r.y),a.addVector(Rt.right,o/2);else{const t=i.y-r.y,e=t>0?1:-1;a.addVector(Rt.right,12),a.addVector(Rt.down,e*(n/2)),a.addVector(Rt.right,i.x-r.x-24),a.addVector(Rt.down,e*(Math.abs(t)-n/2)),a.addVector(Rt.right,12)}return{vectors:a.getVectors(),lastPoint:a.getLastPosition()}}(t.source,t.target,t.lineHeight),n=e.vectors.map((n,r)=>(r===e.vectors.length-1&&(n.size-=6),function(t,e,n,r){const i=function(t,e,n){const r=t.size+e;switch(t.direction){case Rt.left:case Rt.right:return{height:e,width:r,top:(n-e)/2,left:(n-e)/2};case Rt.up:case Rt.down:return{height:r,width:e,top:(n-e)/2,left:(n-e)/2};default:throw new Error(`Invalid direction "${t.direction}"`)}}(t,n,r),a=bt(`gc_link_line_${t.direction}`,{position:"absolute","margin-top":`${i.top}px`,"margin-left":`${i.left}px`,height:`${i.height}px`,width:`${i.width}px`}),o=function(t,e,n){const r=t.y+(e-n)/2;switch(t.direction){case Rt.left:return{top:r,height:n,lineHeight:n,left:t.x-t.size-n/2,width:t.size+n};case Rt.right:return{top:r,lineHeight:n,height:n,left:t.x-n/2,width:t.size+n};case Rt.up:return{top:r-t.size,lineHeight:t.size+n,height:t.size+n,left:t.x-n/2,width:n};case Rt.down:return{top:r,lineHeight:t.size+n,height:t.size+n,left:t.x-n/2,width:n};default:throw new TypeError(`Invalid direction "${t.direction}"`)}}(t,e,r);return bt("gc_link_container_view",{position:"absolute",top:`${o.top}px`,left:`${o.left}px`,height:`${o.height}px`,width:`${o.width}px`},a)}(n,t.lineHeight,2,t.lineHeight))).join(""),r=e.vectors[e.vectors.length-1].direction;return n+function(t,e,n,r){let i=t.y,a=t.x;switch(e){case Rt.right:i-=(r-n)/2,a-=r;break;case Rt.left:i-=(r-n)/2;break;case Rt.up:a-=r;break;case Rt.down:i+=2*r,a-=r;break;default:throw new Error(`Invalid direction "${e}"`)}return bt(`gc_link_arrow_${e}`,{position:"absolute","margin-top":"-3px",top:`${i}px`,left:`${a}px`})}(e.lastPoint,r,t.lineHeight,6)}class Jt{constructor(t,e){this._config=t,this._width=e,this._scale=dt(t.scale,t.timelineCellWidth,t.scaleStart,t.scaleEnd),this._taskModel=function(t,e,n,r){if(t.length<1)throw new Error("The scale is empty");const i=t[0].day;return e.map((t,e)=>{const a=m(t.startDate,i),o=m(t.endDate,t.startDate);return{task:t,top:n*e+2,left:a*r,height:n-4-1,width:o*r}})}(this._scale,this._config.tasks,this._config.lineHeight,t.timelineCellWidth)}getTimelineHeight(){return this._config.tasks.length*this._config.lineHeight}getTimelineWidth(){return this._scale.length*this._config.timelineCellWidth}getHeader(){const t=function(t,e,n){let r="";for(let e=0;e<t.length;e++)r+=Kt(t[e],n,0===e);return bt(St,{"box-sizing":"border-box",height:`${e}px`,display:"flex","flex-direction":"row"},r)}(this._scale,this._config.lineHeight,this._config.timelineCellWidth);return bt(Dt,{"box-sizing":"border-box",width:`${this._width}px`,display:"flex","flex-direction":"row","overflow-x":"hidden","overflow-y":"hidden"},t)}getTable(){const t=this.getTimelineHeight(),e=function(t,e,n,r,i,a){let o="";for(let t=0;t<a.length;t++)o+=Zt(i,n,r);return bt(zt,{"box-sizing":"border-box",position:"absolute",top:0,left:0,height:`${t}px`,width:`${e}px`},o)}(t,this._width,this._config.lineHeight,this._config.timelineCellWidth,this._scale,this._config.tasks),n=function(t,e,n){let r="";for(let t=0;t<n.length;t++)r+=(i=n[t],bt(Lt,{"box-sizing":"border-box",position:"absolute",top:`${i.top}px`,left:`${i.left}px`,height:`${i.height}px`,width:`${i.width}px`,"z-index":10},i.task.text,{"data-taskid":i.task.id.toString(),"data-date":i.task.startDate.getTime().toString()}));var i;return bt(Ot,{"box-sizing":"border-box",position:"absolute",top:0,left:0,height:`${t}px`,width:`${e}px`},r)}(t,this._width,this._taskModel),r=function(t,e,n,r,i){let a="";for(let t=0;t<i.length;t++){const e=i[t];a+=It({lineHeight:n,link:e,source:ee(r,e.source),target:ee(r,e.target)})}return bt(Ut,{"box-sizing":"border-box",position:"absolute",top:0,left:0,height:`${t}px`,width:`${e}px`},a)}(t,this._width,this._config.lineHeight,this._taskModel,this._config.links);return bt(Ht,{"box-sizing":"border-box",position:"relative",width:`${this._width}px`,height:`${t}px`,"overflow-x":"hidden","overflow-y":"hidden"},e+n+r)}attach(){const t=this._config.getElementByClassName(Ht);t.addEventListener("click",t=>this._onTaskEventHandler(t),!1),t.addEventListener("dblclick",t=>this._onTaskEventHandler(t),!1)}_onTaskEventHandler(t){let e=null;switch(t.type){case"click":e=this._config.callbackTaskClick;break;case"dblclick":e=this._config.callbackTaskDblClick;break;default:throw new Error(`Invalid event type "${t.type}"`)}if(null===e)return;const n=t.target;if(n.matches(`.${Lt}`)){const t=n.getAttribute("data-taskid");if(null===t)throw new TypeError('Attribute "data-taskid" not found');const r=parseInt(t,10),i=this._config.tasks.find(t=>t.id===r);if(void 0===i)throw new TypeError(`Task with id "${r}" not found`);e(i)}}}function Kt(t,e,n){const r=[Wt,qt];return n||r.push(Bt),bt(r,{"box-sizing":"border-box",height:"inherit",width:`${e}px`,"min-width":`${e}px`},t.dayAsString)}function Zt(t,e,n){let r="";for(let e=0;e<t.length;e++)r+=te(n,0===e);return bt([jt,qt],{"box-sizing":"border-box",height:`${e}px`,"flex-direction":"row",display:"flex"},r)}function te(t,e){const n=[At,qt];return e||n.push(Bt),bt(n,{"box-sizing":"border-box",height:"inherit",width:`${t}px`,"min-width":`${t}px`})}function ee(t,e){const n=t.find(t=>t.task.id===e);if(void 0===n)throw new Error(`Cannot find task with id "${e}"`);return n}class ne{constructor(t,e,n,r,i){this._config=t,this._scrollbarHeight=e,this._treeContainerWidth=n,this._timelineContainerWidth=r,this._timelineWidth=i}getMarkup(){const t=bt(Pt,{"box-sizing":"border-box",height:`${this._scrollbarHeight}px`,width:`${this._treeContainerWidth}px`}),e=bt("",{"box-sizing":"border-box",height:`${this._scrollbarHeight}px`,width:`${this._timelineWidth}px`});return t+bt(Nt,{"box-sizing":"border-box",height:`${this._scrollbarHeight}px`,width:`${this._timelineContainerWidth}px`,"overflow-y":"hidden","overflow-x":"scroll"},e)+bt(Yt,{"box-sizing":"border-box",display:"flex","flex-direction":"row",height:`${this._scrollbarHeight}px`,width:`${this._scrollbarHeight}px`})}attach(){const t=this._config.getElementByClassName(Nt),e=this._config.getElementByClassName(Dt),n=this._config.getElementByClassName(Ht);let r=0,i=!1;t.addEventListener("scroll",t=>{const a=function(t){if(null===t||null===t.target)return null;{const e=t.target;return"number"==typeof e.scrollLeft?e.scrollLeft:null}}(t);null!==a&&(r=a,i||(window.requestAnimationFrame(()=>{e.scrollLeft=r,n.scrollLeft=r,i=!1}),i=!0))})}}function re(t,e){const n=Vt()(),r=function(t){if("function"!=typeof t.getBoundingClientRect)throw new Error("Unsupported browser: getBoundingClientRect is missing on element");const e=t.getBoundingClientRect(),n=document.documentElement||document.body.parentNode||document.body,r=window.pageYOffset||n.scrollTop||document.body.scrollTop,i=window.pageXOffset||n.scrollLeft||document.body.scrollLeft,a=n.clientTop||document.body.clientTop||0,o=n.clientLeft||document.body.clientLeft||0;return{y:Math.round(e.top+r-a),x:Math.round(e.left+i-o),width:Math.round(t.offsetWidth),height:Math.round(t.offsetHeight),right:Math.round(document.body.offsetWidth-e.right),bottom:Math.round(document.body.offsetHeight-e.bottom)}}(t),i=r.height,a=r.width,o=e.lineHeight,s=i-e.lineHeight-n,u=Math.round(r.width*e.treeWidthPercentage/100),c=r.width-u-n,d=new Qt(e,u),l=d.getHeader(),h=d.getTable(),f=new Jt(e,c),g=f.getHeader(),w=f.getTable(),m=bt($t,{"box-sizing":"border-box",height:`${o}px`,width:`${n}px`}),b=bt(yt,{"box-sizing":"border-box",display:"flex","flex-direction":"row",height:`${o}px`,width:`${a}px`},l+g+m),p=bt(vt,{position:"relative","box-sizing":"border-box",display:"flex","flex-direction":"row",height:`${s}px`,width:`${a}px`,"overflow-y":"scroll","overflow-x":"hidden"},h+w),y=new ne(e,n,u,c,f.getTimelineWidth()),v=bt(xt,{"box-sizing":"border-box",display:"flex","flex-direction":"row",height:`${n}px`,width:`${a}px`},y.getMarkup());!function(t,e,n=[],r={},i="",a={}){const o=new wt(a),s=new gt(r).toString();if(o.hasAttribute("class")||o.hasAttribute("style"))throw new Error('The parameter "attributes" cannot contain a "class" or "style" attribute');"string"==typeof n?o.setAttribute("class",n):n.length>0&&o.setAttribute("class",n.join(" ")),s.length>0&&o.setAttribute("style",s);const u=document.createElement(e);o.appyAttributes(u),i.length>0&&(u.innerHTML=i),t.appendChild(u)}(t,"div",pt,{height:`${i}px`,width:`${a}px`,"box-sizing":"border-box",margin:0,padding:0,overflow:"hidden"},b+p+v,{id:e.id}),y.attach(),f.attach()}var ie,ae=function(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n},oe=function(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)};class se{constructor(){ie.set(this,void 0),ae(this,ie,new lt)}setConfig(t){oe(this,ie).setConfig(t)}setData(t){ft(t,oe(this,ie))}attachTaskClickEvent(t,e){switch(t){case"click":oe(this,ie).callbackTaskClick=e;break;case"dblclick":oe(this,ie).callbackTaskDblClick=e;break;default:throw new TypeError('The event type must be "click" or "dblclick"')}}render(t){re(t,oe(this,ie))}}ie=new WeakMap}])}));
//# sourceMappingURL=index.js.map