@openmrs/esm-patient-vitals-app 9.2.3-pre.7151 → 9.2.3-pre.7164
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +14 -14
- package/dist/3368.js +2 -0
- package/dist/{4326.js.LICENSE.txt → 3368.js.LICENSE.txt} +2 -10
- package/dist/3368.js.map +1 -0
- package/dist/4716.js +1 -1
- package/dist/4716.js.map +1 -1
- package/dist/7738.js +2 -0
- package/dist/{8295.js.LICENSE.txt → 7738.js.LICENSE.txt} +10 -2
- package/dist/7738.js.map +1 -0
- package/dist/831.js +1 -1
- package/dist/831.js.map +1 -1
- package/dist/8895.js +2 -0
- package/dist/8895.js.map +1 -0
- package/dist/8957.js +1 -1
- package/dist/8957.js.map +1 -1
- package/dist/9057.js +1 -1
- package/dist/9057.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.LICENSE.txt +2 -2
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-patient-vitals-app.js +1 -1
- package/dist/openmrs-esm-patient-vitals-app.js.buildmanifest.json +92 -92
- package/dist/openmrs-esm-patient-vitals-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +4 -4
- package/dist/101.js +0 -2
- package/dist/101.js.map +0 -1
- package/dist/4326.js +0 -2
- package/dist/4326.js.map +0 -1
- package/dist/8295.js +0 -2
- package/dist/8295.js.map +0 -1
- /package/dist/{101.js.LICENSE.txt → 8895.js.LICENSE.txt} +0 -0
package/dist/8295.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 8295.js.LICENSE.txt */
|
|
2
|
-
(globalThis.webpackChunk_openmrs_esm_patient_vitals_app=globalThis.webpackChunk_openmrs_esm_patient_vitals_app||[]).push([[8295],{279:function(t){t.exports=function(){"use strict";var t,e,n=1e3,r=6e4,i=36e5,o=864e5,s=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,a=31536e6,l=2628e6,c=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,u={years:a,months:l,days:o,hours:i,minutes:r,seconds:n,milliseconds:1,weeks:6048e5},h=function(t){return t instanceof v},d=function(t,e,n){return new v(t,n,e.$l)},f=function(t){return e.p(t)+"s"},p=function(t){return t<0},m=function(t){return p(t)?Math.ceil(t):Math.floor(t)},g=function(t){return Math.abs(t)},y=function(t,e){return t?p(t)?{negative:!0,format:""+g(t)+e}:{negative:!1,format:""+t+e}:{negative:!1,format:""}},v=function(){function p(t,e,n){var r=this;if(this.$d={},this.$l=n,void 0===t&&(this.$ms=0,this.parseFromMilliseconds()),e)return d(t*u[f(e)],this);if("number"==typeof t)return this.$ms=t,this.parseFromMilliseconds(),this;if("object"==typeof t)return Object.keys(t).forEach((function(e){r.$d[f(e)]=t[e]})),this.calMilliseconds(),this;if("string"==typeof t){var i=t.match(c);if(i){var o=i.slice(2).map((function(t){return null!=t?Number(t):0}));return this.$d.years=o[0],this.$d.months=o[1],this.$d.weeks=o[2],this.$d.days=o[3],this.$d.hours=o[4],this.$d.minutes=o[5],this.$d.seconds=o[6],this.calMilliseconds(),this}}return this}var g=p.prototype;return g.calMilliseconds=function(){var t=this;this.$ms=Object.keys(this.$d).reduce((function(e,n){return e+(t.$d[n]||0)*u[n]}),0)},g.parseFromMilliseconds=function(){var t=this.$ms;this.$d.years=m(t/a),t%=a,this.$d.months=m(t/l),t%=l,this.$d.days=m(t/o),t%=o,this.$d.hours=m(t/i),t%=i,this.$d.minutes=m(t/r),t%=r,this.$d.seconds=m(t/n),t%=n,this.$d.milliseconds=t},g.toISOString=function(){var t=y(this.$d.years,"Y"),e=y(this.$d.months,"M"),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var r=y(n,"D"),i=y(this.$d.hours,"H"),o=y(this.$d.minutes,"M"),s=this.$d.seconds||0;this.$d.milliseconds&&(s+=this.$d.milliseconds/1e3,s=Math.round(1e3*s)/1e3);var a=y(s,"S"),l=t.negative||e.negative||r.negative||i.negative||o.negative||a.negative,c=i.format||o.format||a.format?"T":"",u=(l?"-":"")+"P"+t.format+e.format+r.format+c+i.format+o.format+a.format;return"P"===u||"-P"===u?"P0D":u},g.toJSON=function(){return this.toISOString()},g.format=function(t){var n=t||"YYYY-MM-DDTHH:mm:ss",r={Y:this.$d.years,YY:e.s(this.$d.years,2,"0"),YYYY:e.s(this.$d.years,4,"0"),M:this.$d.months,MM:e.s(this.$d.months,2,"0"),D:this.$d.days,DD:e.s(this.$d.days,2,"0"),H:this.$d.hours,HH:e.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:e.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:e.s(this.$d.seconds,2,"0"),SSS:e.s(this.$d.milliseconds,3,"0")};return n.replace(s,(function(t,e){return e||String(r[t])}))},g.as=function(t){return this.$ms/u[f(t)]},g.get=function(t){var e=this.$ms,n=f(t);return"milliseconds"===n?e%=1e3:e="weeks"===n?m(e/u[n]):this.$d[n],e||0},g.add=function(t,e,n){var r;return r=e?t*u[f(e)]:h(t)?t.$ms:d(t,this).$ms,d(this.$ms+r*(n?-1:1),this)},g.subtract=function(t,e){return this.add(t,e,!0)},g.locale=function(t){var e=this.clone();return e.$l=t,e},g.clone=function(){return d(this.$ms,this)},g.humanize=function(e){return t().add(this.$ms,"ms").locale(this.$l).fromNow(!e)},g.valueOf=function(){return this.asMilliseconds()},g.milliseconds=function(){return this.get("milliseconds")},g.asMilliseconds=function(){return this.as("milliseconds")},g.seconds=function(){return this.get("seconds")},g.asSeconds=function(){return this.as("seconds")},g.minutes=function(){return this.get("minutes")},g.asMinutes=function(){return this.as("minutes")},g.hours=function(){return this.get("hours")},g.asHours=function(){return this.as("hours")},g.days=function(){return this.get("days")},g.asDays=function(){return this.as("days")},g.weeks=function(){return this.get("weeks")},g.asWeeks=function(){return this.as("weeks")},g.months=function(){return this.get("months")},g.asMonths=function(){return this.as("months")},g.years=function(){return this.get("years")},g.asYears=function(){return this.as("years")},p}(),b=function(t,e,n){return t.add(e.years()*n,"y").add(e.months()*n,"M").add(e.days()*n,"d").add(e.hours()*n,"h").add(e.minutes()*n,"m").add(e.seconds()*n,"s").add(e.milliseconds()*n,"ms")};return function(n,r,i){t=i,e=i().$utils(),i.duration=function(t,e){var n=i.locale();return d(t,{$l:n},e)},i.isDuration=h;var o=r.prototype.add,s=r.prototype.subtract;r.prototype.add=function(t,e){return h(t)?b(this,t,1):o.bind(this)(t,e)},r.prototype.subtract=function(t,e){return h(t)?b(this,t,-1):s.bind(this)(t,e)}}}()},5602:function(t){t.exports=function(){"use strict";return function(t,e,n){e.prototype.isToday=function(){var t="YYYY-MM-DD",e=n();return this.format(t)===e.format(t)}}}()},723:function(t,e,n){var r,i;"undefined"!=typeof self&&self,t.exports=(r=n(1343),i=n(3144),function(){"use strict";var t={156:function(t){t.exports=r},111:function(t){t.exports=i},582:function(t,e,n){n.r(e),n.d(e,{__assign:function(){return o},__asyncDelegator:function(){return O},__asyncGenerator:function(){return T},__asyncValues:function(){return S},__await:function(){return x},__awaiter:function(){return p},__classPrivateFieldGet:function(){return C},__classPrivateFieldIn:function(){return L},__classPrivateFieldSet:function(){return R},__createBinding:function(){return g},__decorate:function(){return a},__esDecorate:function(){return c},__exportStar:function(){return y},__extends:function(){return i},__generator:function(){return m},__importDefault:function(){return D},__importStar:function(){return k},__makeTemplateObject:function(){return M},__metadata:function(){return f},__param:function(){return l},__propKey:function(){return h},__read:function(){return b},__rest:function(){return s},__runInitializers:function(){return u},__setFunctionName:function(){return d},__spread:function(){return _},__spreadArray:function(){return E},__spreadArrays:function(){return w},__values:function(){return v}});var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},o.apply(this,arguments)};function s(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function a(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s}function l(t,e){return function(n,r){e(n,r,t)}}function c(t,e,n,r,i,o){function s(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var a,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!e&&t?r.static?t:t.prototype:null,h=e||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),d=!1,f=n.length-1;f>=0;f--){var p={};for(var m in r)p[m]="access"===m?{}:r[m];for(var m in r.access)p.access[m]=r.access[m];p.addInitializer=function(t){if(d)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(t||null))};var g=(0,n[f])("accessor"===l?{get:h.get,set:h.set}:h[c],p);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(a=s(g.get))&&(h.get=a),(a=s(g.set))&&(h.set=a),(a=s(g.init))&&i.unshift(a)}else(a=s(g))&&("field"===l?i.unshift(a):h[c]=a)}u&&Object.defineProperty(u,r.name,h),d=!0}function u(t,e,n){for(var r=arguments.length>2,i=0;i<e.length;i++)n=r?e[i].call(t,n):e[i].call(t);return r?n:void 0}function h(t){return"symbol"==typeof t?t:"".concat(t)}function d(t,e,n){return"symbol"==typeof e&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:n?"".concat(n," ",e):e})}function f(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function p(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{l(r.next(t))}catch(t){o(t)}}function a(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))}function m(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}var g=Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]};function y(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||g(e,t,n)}function v(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function _(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(b(arguments[e]));return t}function w(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r}function E(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function x(t){return this instanceof x?(this.v=t,this):new x(t)}function T(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||a(t,e)}))})}function a(t,e){try{(n=i[t](e)).value instanceof x?Promise.resolve(n.value.v).then(l,c):u(o[0][2],n)}catch(t){u(o[0][3],t)}var n}function l(t){a("next",t)}function c(t){a("throw",t)}function u(t,e){t(e),o.shift(),o.length&&a(o[0][0],o[0][1])}}function O(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:x(t[r](e)),done:!1}:i?i(e):e}:i}}function S(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=v(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){!function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)}(r,i,(e=t[n](e)).done,e.value)}))}}}function M(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var A=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function k(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&g(e,t,n);return A(e,t),e}function D(t){return t&&t.__esModule?t:{default:t}}function C(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function R(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n}function L(t,e){if(null===e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?e===t:t.has(e)}e.default={__extends:i,__assign:o,__rest:s,__decorate:a,__param:l,__metadata:f,__awaiter:p,__generator:m,__createBinding:g,__exportStar:y,__values:v,__read:b,__spread:_,__spreadArrays:w,__spreadArray:E,__await:x,__asyncGenerator:T,__asyncDelegator:O,__asyncValues:S,__makeTemplateObject:M,__importStar:k,__importDefault:D,__classPrivateFieldGet:C,__classPrivateFieldSet:R,__classPrivateFieldIn:L}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return function(){var t=o;Object.defineProperty(t,"__esModule",{value:!0}),t.useReactToPrint=t.PrintContextConsumer=void 0;var e=n(582),r=n(156),i=n(111),s=Object.prototype.hasOwnProperty.call(r,"createContext"),a=Object.prototype.hasOwnProperty.call(r,"useMemo")&&Object.prototype.hasOwnProperty.call(r,"useCallback"),l=s?r.createContext({}):null;t.PrintContextConsumer=l?l.Consumer:function(){return null};var c={copyStyles:!0,pageStyle:"\n @page {\n /* Remove browser default header (title) and footer (url) */\n margin: 0;\n }\n @media print {\n body {\n /* Tell browsers to print background colors */\n -webkit-print-color-adjust: exact; /* Chrome/Safari/Edge/Opera */\n color-adjust: exact; /* Firefox */\n }\n }\n ",removeAfterPrint:!1,suppressErrors:!1},u=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.startPrint=function(t){var e=n.props,r=e.onAfterPrint,i=e.onPrintError,o=e.print,s=e.documentTitle;setTimeout((function(){var e,a;if(t.contentWindow)if(t.contentWindow.focus(),o)o(t).then((function(){return null==r?void 0:r()})).then((function(){return n.handleRemoveIframe()})).catch((function(t){i?i("print",t):n.logMessages(["An error was thrown by the specified `print` function"])}));else{if(t.contentWindow.print){var l=null!==(a=null===(e=t.contentDocument)||void 0===e?void 0:e.title)&&void 0!==a?a:"",c=t.ownerDocument.title;s&&(t.ownerDocument.title=s,t.contentDocument&&(t.contentDocument.title=s)),t.contentWindow.print(),s&&(t.ownerDocument.title=c,t.contentDocument&&(t.contentDocument.title=l))}else n.logMessages(["Printing for this browser is not currently possible: the browser does not have a `print` method available for iframes."]);null==r||r(),n.handleRemoveIframe()}else n.logMessages(["Printing failed because the `contentWindow` of the print iframe did not load. This is possibly an error with `react-to-print`. Please file an issue: https://github.com/gregnb/react-to-print/issues/"])}),500)},n.triggerPrint=function(t){var e=n.props,r=e.onBeforePrint,i=e.onPrintError;if(r){var o=r();o&&"function"==typeof o.then?o.then((function(){n.startPrint(t)})).catch((function(t){i&&i("onBeforePrint",t)})):n.startPrint(t)}else n.startPrint(t)},n.handleClick=function(){var t=n.props,e=t.onBeforeGetContent,r=t.onPrintError;if(e){var i=e();i&&"function"==typeof i.then?i.then(n.handlePrint).catch((function(t){r&&r("onBeforeGetContent",t)})):n.handlePrint()}else n.handlePrint()},n.handlePrint=function(){var t=n.props,r=t.bodyClass,o=t.content,s=t.copyStyles,a=t.fonts,l=t.pageStyle,c=t.nonce,u=o();if(void 0!==u)if(null!==u){var h=document.createElement("iframe");h.width="".concat(document.documentElement.clientWidth,"px"),h.height="".concat(document.documentElement.clientHeight,"px"),h.style.position="absolute",h.style.top="-".concat(document.documentElement.clientHeight+100,"px"),h.style.left="-".concat(document.documentElement.clientWidth+100,"px"),h.id="printWindow",h.srcdoc="<!DOCTYPE html>";var d=(0,i.findDOMNode)(u);if(d){var f=d.cloneNode(!0),p=f instanceof Text,m=document.querySelectorAll("link[rel='stylesheet']"),g=p?[]:f.querySelectorAll("img"),y=p?[]:f.querySelectorAll("video"),v=a?a.length:0;n.numResourcesToLoad=m.length+g.length+y.length+v,n.resourcesLoaded=[],n.resourcesErrored=[];var b=function(t,r){n.resourcesLoaded.includes(t)?n.logMessages(["Tried to mark a resource that has already been handled",t],"debug"):(r?(n.logMessages(e.__spreadArray(['"react-to-print" was unable to load a resource but will continue attempting to print the page'],e.__read(r),!1)),n.resourcesErrored.push(t)):n.resourcesLoaded.push(t),n.resourcesLoaded.length+n.resourcesErrored.length===n.numResourcesToLoad&&n.triggerPrint(h))};h.onload=function(){var t,i,o,u;h.onload=null;var m=h.contentDocument||(null===(i=h.contentWindow)||void 0===i?void 0:i.document);if(m){m.body.appendChild(f),a&&((null===(o=h.contentDocument)||void 0===o?void 0:o.fonts)&&(null===(u=h.contentWindow)||void 0===u?void 0:u.FontFace)?a.forEach((function(t){var e=new FontFace(t.family,t.source,{weight:t.weight,style:t.style});h.contentDocument.fonts.add(e),e.loaded.then((function(){b(e)})).catch((function(t){b(e,["Failed loading the font:",e,"Load error:",t])}))})):(a.forEach((function(t){return b(t)})),n.logMessages(['"react-to-print" is not able to load custom fonts because the browser does not support the FontFace API but will continue attempting to print the page'])));var v="function"==typeof l?l():l;if("string"!=typeof v)n.logMessages(['"react-to-print" expected a "string" from `pageStyle` but received "'.concat(typeof v,'". Styles from `pageStyle` will not be applied.')]);else{var _=m.createElement("style");c&&(_.setAttribute("nonce",c),m.head.setAttribute("nonce",c)),_.appendChild(m.createTextNode(v)),m.head.appendChild(_)}if(r&&(t=m.body.classList).add.apply(t,e.__spreadArray([],e.__read(r.split(" ")),!1)),!p){for(var w=p?[]:d.querySelectorAll("canvas"),E=m.querySelectorAll("canvas"),x=0;x<w.length;++x){var T=w[x],O=E[x].getContext("2d");O&&O.drawImage(T,0,0)}var S=function(t){var e=g[t],n=e.getAttribute("src");if(n){var r=new Image;r.onload=function(){return b(e)},r.onerror=function(t,n,r,i,o){return b(e,["Error loading <img>",e,"Error",o])},r.src=n}else b(e,['Found an <img> tag with an empty "src" attribute. This prevents pre-loading it. The <img> is:',e])};for(x=0;x<g.length;x++)S(x);var M=function(t){var e=y[t];e.preload="auto";var n=e.getAttribute("poster");if(n){var r=new Image;r.onload=function(){return b(e)},r.onerror=function(t,r,i,o,s){return b(e,["Error loading video poster",n,"for video",e,"Error:",s])},r.src=n}else e.readyState>=2?b(e):(e.onloadeddata=function(){return b(e)},e.onerror=function(t,n,r,i,o){return b(e,["Error loading video",e,"Error",o])},e.onstalled=function(){return b(e,["Loading video stalled, skipping",e])})};for(x=0;x<y.length;x++)M(x);var A="input",k=d.querySelectorAll(A),D=m.querySelectorAll(A);for(x=0;x<k.length;x++)D[x].value=k[x].value;var C="input[type=checkbox],input[type=radio]",R=d.querySelectorAll(C),L=m.querySelectorAll(C);for(x=0;x<R.length;x++)L[x].checked=R[x].checked;var P="select",I=d.querySelectorAll(P),N=m.querySelectorAll(P);for(x=0;x<I.length;x++)N[x].value=I[x].value}if(s)for(var B=document.querySelectorAll("style, link[rel='stylesheet']"),j=function(t,e){var r=B[t];if("style"===r.tagName.toLowerCase()){var i=m.createElement(r.tagName),o=r.sheet;if(o){var s="";try{for(var a=o.cssRules.length,l=0;l<a;++l)"string"==typeof o.cssRules[l].cssText&&(s+="".concat(o.cssRules[l].cssText,"\r\n"))}catch(t){n.logMessages(["A stylesheet could not be accessed. This is likely due to the stylesheet having cross-origin imports, and many browsers block script access to cross-origin stylesheets. See https://github.com/gregnb/react-to-print/issues/429 for details. You may be able to load the sheet by both marking the stylesheet with the cross `crossorigin` attribute, and setting the `Access-Control-Allow-Origin` header on the server serving the stylesheet. Alternatively, host the stylesheet on your domain to avoid this issue entirely.",r],"warning")}i.setAttribute("id","react-to-print-".concat(t)),c&&i.setAttribute("nonce",c),i.appendChild(m.createTextNode(s)),m.head.appendChild(i)}}else if(r.getAttribute("href"))if(r.hasAttribute("disabled"))n.logMessages(["`react-to-print` encountered a <link> tag with a `disabled` attribute and will ignore it. Note that the `disabled` attribute is deprecated, and some browsers ignore it. You should stop using it. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-disabled. The <link> is:",r],"warning"),b(r);else{for(var u=m.createElement(r.tagName),h=(l=0,r.attributes.length);l<h;++l){var d=r.attributes[l];d&&u.setAttribute(d.nodeName,d.nodeValue||"")}u.onload=function(){return b(u)},u.onerror=function(t,e,n,r,i){return b(u,["Failed to load",u,"Error:",i])},c&&u.setAttribute("nonce",c),m.head.appendChild(u)}else n.logMessages(["`react-to-print` encountered a <link> tag with an empty `href` attribute. In addition to being invalid HTML, this can cause problems in many browsers, and so the <link> was not loaded. The <link> is:",r],"warning"),b(r)},U=(x=0,B.length);x<U;++x)j(x)}0!==n.numResourcesToLoad&&s||n.triggerPrint(h)},n.handleRemoveIframe(!0),document.body.appendChild(h)}else n.logMessages(['"react-to-print" could not locate the DOM node corresponding with the `content` prop'])}else n.logMessages(['There is nothing to print because the "content" prop returned "null". Please ensure "content" is renderable before allowing "react-to-print" to be called.']);else n.logMessages(["To print a functional component ensure it is wrapped with `React.forwardRef`, and ensure the forwarded ref is used. See the README for an example: https://github.com/gregnb/react-to-print#examples"])},n.handleRemoveIframe=function(t){var e=n.props.removeAfterPrint;if(t||e){var r=document.getElementById("printWindow");r&&document.body.removeChild(r)}},n.logMessages=function(t,e){void 0===e&&(e="error"),n.props.suppressErrors||("error"===e?console.error(t):"warning"===e?console.warn(t):"debug"===e&&console.debug(t))},n}return e.__extends(n,t),n.prototype.render=function(){var t=this.props,e=t.children,n=t.trigger;if(n)return r.cloneElement(n(),{onClick:this.handleClick});if(!l)return this.logMessages(['"react-to-print" requires React ^16.3.0 to be able to use "PrintContext"']),null;var i={handlePrint:this.handleClick};return r.createElement(l.Provider,{value:i},e)},n.defaultProps=c,n}(r.Component);t.default=u,t.useReactToPrint=function(t){if(!a)return t.suppressErrors||console.error('"react-to-print" requires React ^16.8.0 to be able to use "useReactToPrint"'),function(){throw new Error('"react-to-print" requires React ^16.8.0 to be able to use "useReactToPrint"')};var n=r.useMemo((function(){return new u(e.__assign(e.__assign({},c),t))}),[t]);return r.useCallback((function(){return n.handleClick()}),[n])}}(),o}())},1890:(t,e,n)=>{"use strict";n.d(e,{bl:()=>Dw});var r=n(1343),i=Object.defineProperty,o=(t,e,n)=>(((t,e,n)=>{e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,"symbol"!=typeof e?e+"":e,n),n),s=(t=>(t.RENDER_FINISHED="render-finished",t.RESIZE="chart-resize",t.MOUSEOVER="chart-mouseover",t.MOUSEOUT="chart-mouseout",t))(s||{}),a=(t=>(t.SHOW="show-modal",t.HIDE="hide-modal",t))(a||{}),l=(t=>(t.UPDATE="model-update",t))(l||{}),c=(t=>(t.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",t.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",t.BUTTON_CLICK="toolbar-button-click",t))(c||{}),u=(t=>(t.UPDATE="zoom-bar-update",t.SELECTION_START="zoom-bar-selection-start",t.SELECTION_IN_PROGRESS="zoom-bar-selection-in-progress",t.SELECTION_END="zoom-bar-selection-end",t))(u||{}),h=(t=>(t.CHANGE="zoom-domain-change",t))(h||{}),d=(t=>(t.CANVAS_ZOOM_IN="canvas-zoom-in",t.CANVAS_ZOOM_OUT="canvas-zoom-out",t))(d||{}),f=(t=>(t.LABEL_MOUSEOVER="axis-label-mouseover",t.LABEL_MOUSEMOVE="axis-label-mousemove",t.LABEL_CLICK="axis-label-click",t.LABEL_MOUSEOUT="axis-label-mouseout",t.LABEL_FOCUS="axis-label-focus",t.LABEL_BLUR="axis-label-blur",t.RENDER_COMPLETE="axis-render-complete",t))(f||{}),p=(t=>(t.POINT_MOUSEOVER="scatter-mouseover",t.POINT_MOUSEMOVE="scatter-mousemove",t.POINT_CLICK="scatter-click",t.POINT_MOUSEOUT="scatter-mouseout",t))(p||{}),m=(t=>(t.WORD_MOUSEOVER="wordcloud-word-mouseover",t.WORD_MOUSEMOVE="wordcloud-word-mousemove",t.WORD_CLICK="wordcloud-word-click",t.WORD_MOUSEOUT="wordcloud-word-mouseout",t))(m||{}),g=(t=>(t.SLICE_MOUSEOVER="pie-slice-mouseover",t.SLICE_MOUSEMOVE="pie-slice-mousemove",t.SLICE_CLICK="pie-slice-click",t.SLICE_MOUSEOUT="pie-slice-mouseout",t))(g||{}),y=(t=>(t.ARC_MOUSEOVER="gauge-arc-mouseover",t.ARC_MOUSEMOVE="gauge-arc-mousemove",t.ARC_CLICK="gauge-arc-click",t.ARC_MOUSEOUT="gauge-arc-mouseout",t))(y||{}),v=(t=>(t.BAR_MOUSEOVER="bar-mouseover",t.BAR_MOUSEMOVE="bar-mousemove",t.BAR_CLICK="bar-click",t.BAR_MOUSEOUT="bar-mouseout",t))(v||{}),b=(t=>(t.BOX_MOUSEOVER="box-mouseover",t.BOX_MOUSEMOVE="box-mousemove",t.BOX_CLICK="box-click",t.BOX_MOUSEOUT="box-mouseout",t.OUTLIER_MOUSEOVER="outlier-mouseover",t.OUTLIER_MOUSEMOVE="outlier-mousemove",t.OUTLIER_CLICK="outlier-click",t.OUTLIER_MOUSEOUT="outlier-mouseout",t))(b||{}),_=(t=>(t.SCATTER_MOUSEOVER="scatter-mouseover",t.SCATTER_MOUSEMOVE="scatter-mousemove",t.SCATTER_CLICK="scatter-click",t.SCATTER_MOUSEOUT="scatter-mouseout",t))(_||{}),w=(t=>(t.POINT_MOUSEOVER="scatter-mouseover",t.POINT_MOUSEMOVE="scatter-mousemove",t.POINT_CLICK="scatter-click",t.POINT_MOUSEOUT="scatter-mouseout",t))(w||{}),E=(t=>(t.X_AXIS_MOUSEOVER="radar-x-axis-mouseover",t.X_AXIS_MOUSEMOVE="radar-x-axis-mousemove",t.X_AXIS_CLICK="radar-x-axis-click",t.X_AXIS_MOUSEOUT="radar-x-axis-mouseout",t))(E||{}),x=(t=>(t.NODE_MOUSEOVER="tree-node-mouseover",t.NODE_CLICK="tree-node-click",t.NODE_MOUSEOUT="tree-node-mouseout",t))(x||{}),T=(t=>(t.LEAF_MOUSEOVER="leaf-mouseover",t.LEAF_MOUSEMOVE="leaf-mousemove",t.LEAF_CLICK="leaf-click",t.LEAF_MOUSEOUT="leaf-mouseout",t))(T||{}),O=(t=>(t.SHOW="show-tooltip",t.MOVE="move-tooltip",t.HIDE="hide-tooltip",t))(O||{}),S=(t=>(t.SHOW="show-threshold",t.HIDE="hide-threshold",t))(S||{}),M=(t=>(t.ITEM_HOVER="legend-item-onhover",t.ITEM_CLICK="legend-item-onclick",t.ITEM_MOUSEOUT="legend-item-onmouseout",t.ITEMS_UPDATE="legend-items-update",t))(M||{}),A=(t=>(t.CIRCLE_MOUSEOVER="circle-leaf-mouseover",t.CIRCLE_CLICK="circle-leaf-click",t.CIRCLE_MOUSEOUT="circle-leaf-mouseout",t.CIRCLE_MOUSEMOVE="circle-leaf-mousemove",t))(A||{}),k=(t=>(t.NODE_MOUSEOVER="alluvial-node-mouseover",t.NODE_CLICK="alluvial-node-click",t.NODE_MOUSEOUT="alluvial-node-mouseout",t.NODE_MOUSEMOVE="alluvial-node-mousemove",t.LINE_MOUSEOVER="alluvial-line-mouseover",t.LINE_CLICK="alluvial-line-click",t.LINE_MOUSEOUT="alluvial-line-mouseout",t.LINE_MOUSEMOVE="alluvial-line-mousemove",t))(k||{}),D=(t=>(t.METER_MOUSEOVER="meter-mouseover",t.METER_CLICK="meter-click",t.METER_MOUSEOUT="meter-mouseout",t.METER_MOUSEMOVE="meter-mousemove",t))(D||{}),C=(t=>(t.HEATMAP_MOUSEOVER="heatmap-mouseover",t.HEATMAP_CLICK="heatmap-click",t.HEATMAP_MOUSEOUT="heatmap-mouseout",t.HEATMAP_MOUSEMOVE="hetmap-mousemove",t))(C||{}),R=(t=>(t.CHOROPLETH_MOUSEOVER="choropleth-mouseover",t.CHOROPLETH_CLICK="choropleth-click",t.CHOROPLETH_MOUSEOUT="choropleth-mouseout",t.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",t))(R||{});const L=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:k,Area:p,Axis:f,Bar:v,Boxplot:b,CanvasZoom:d,Chart:s,Choropleth:R,CirclePack:A,Gauge:y,Heatmap:C,Legend:M,Line:w,Meter:D,Modal:a,Model:l,Pie:g,Radar:E,Scatter:_,Threshold:S,Toolbar:c,Tooltip:O,Tree:x,Treemap:T,WordCloud:m,ZoomBar:u,ZoomDomain:h},Symbol.toStringTag,{value:"Module"}));var P=(t=>(t.HTML="html",t.SVG="svg",t))(P||{}),I=(t=>(t.WHITE="white",t.G100="g100",t.G90="g90",t.G10="g10",t))(I||{}),N=(t=>(t.BACKGROUND="background",t.FILL="fill",t.STROKE="stroke",t.TOOLTIP="tooltip",t))(N||{}),B=(t=>(t.LEFT="left",t.RIGHT="right",t.TOP="top",t.BOTTOM="bottom",t))(B||{}),j=(t=>(t.GRAPH_VIEW="graph_view",t.SLIDER_VIEW="slider_view",t))(j||{}),U=(t=>(t.END_LINE="end_line",t.MID_LINE="mid_line",t.FRONT_LINE="front_line",t.NONE="none",t))(U||{}),$=(t=>(t.VERTICAL="vertical",t.HORIZONTAL="horizontal",t))($||{}),F=(t=>(t.TIME="time",t.LINEAR="linear",t.LOG="log",t.LABELS="labels",t.LABELS_RATIO="labels-ratio",t))(F||{}),H=(t=>(t.RIGHT="right",t.LEFT="left",t.TOP="top",t.BOTTOM="bottom",t))(H||{}),z=(t=>(t.LEFT="left",t.CENTER="center",t.RIGHT="right",t))(z||{}),V=(t=>(t.HORIZONTAL="horizontal",t.VERTICAL="vertical",t))(V||{}),G=(t=>(t.TREE="tree",t.DENDROGRAM="dendrogram",t))(G||{}),W=(t=>(t.ROW="row",t.COLUMN="column",t.ROW_REVERSE="row-reverse",t.COLUMN_REVERSE="column-reverse",t))(W||{}),Y=(t=>(t.FIXED="fixed",t.PREFERRED="preferred",t.STRETCH="stretch",t))(Y||{}),Z=(t=>(t.CENTER="center",t))(Z||{}),q=(t=>(t.GRID="grid",t.VERT_OR_HORIZ="vertOrHoriz",t.PIE="pie",t.DONUT="donut",t))(q||{}),X=(t=>(t.SEMI="semi",t.FULL="full",t))(X||{}),K=(t=>(t.ALWAYS="always",t.AUTO="auto",t.NEVER="never",t))(K||{}),Q=(t=>(t.SCATTER="scatter",t.LINE="line",t.SIMPLE_BAR="simple-bar",t.STACKED_BAR="stacked-bar",t.GROUPED_BAR="grouped-bar",t.AREA="area",t.STACKED_AREA="stacked-area",t))(Q||{}),J=(t=>(t.EXPORT_CSV="Export as CSV",t.EXPORT_PNG="Export as PNG",t.EXPORT_JPG="Export as JPG",t.ZOOM_IN="Zoom in",t.ZOOM_OUT="Zoom out",t.RESET_ZOOM="Reset zoom",t.MAKE_FULLSCREEN="Make fullscreen",t.SHOW_AS_DATATABLE="Show as data-table",t.CUSTOM="Custom",t))(J||{}),tt=(t=>(t.LEFT="left",t.RIGHT="right",t))(tt||{}),et=(t=>(t.CHECKBOX="checkbox",t.RADIUS="radius",t.AREA="area",t.SIZE="size",t.LINE="line",t.QUARTILE="quartile",t.ZOOM="zoom",t))(et||{}),nt=(t=>(t.ON="on",t.AUTO="auto",t.OFF="off",t))(nt||{}),rt=(t=>(t.DEFAULT="default",t.HOVERABLE="hoverable",t))(rt||{}),it=(t=>(t.geoEqualEarth="geoEqualEarth",t.geoAlbers="geoAlbers",t.geoConicEqualArea="geoConicEqualArea",t.geoConicEquidistant="geoConicEquidistant",t.geoEquirectangular="geoEquirectangular",t.geoMercator="geoMercator",t.geoNaturalEarth1="geoNaturalEarth1",t))(it||{});function ot(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function st(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function at(t){let e,n,r;function i(t,r,i=0,o=t.length){if(i<o){if(0!==e(r,r))return o;do{const e=i+o>>>1;n(t[e],r)<0?i=e+1:o=e}while(i<o)}return i}return 2!==t.length?(e=ot,n=(e,n)=>ot(t(e),n),r=(e,n)=>t(e)-n):(e=t===ot||t===st?t:lt,n=t,r=t),{left:i,center:function(t,e,n=0,o=t.length){const s=i(t,e,n,o-1);return s>n&&r(t[s-1],e)>-r(t[s],e)?s-1:s},right:function(t,r,i=0,o=t.length){if(i<o){if(0!==e(r,r))return o;do{const e=i+o>>>1;n(t[e],r)<=0?i=e+1:o=e}while(i<o)}return i}}}function lt(){return 0}const ct=at(ot).right;at((function(t){return null===t?NaN:+t})).center;const ut=ct;function ht(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r<e&&(r=e)));else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(void 0===n?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}class dt{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let r=0;r<this._n&&r<32;r++){const i=e[r],o=t+i,s=Math.abs(t)<Math.abs(i)?t-(o-i):i-(o-t);s&&(e[n++]=s),t=o}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,r,i=this._n,o=0;if(i>0){for(o=t[--i];i>0&&(e=o,n=t[--i],o=e+n,r=n-(o-e),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(n=2*r,e=o+n,n==e-o&&(o=e))}return o}}class ft extends Map{constructor(t,e=mt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(pt(this,t))}has(t){return super.has(pt(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}(this,t))}}function pt({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function mt(t){return null!==t&&"object"==typeof t?t.valueOf():t}function gt(t){return t}var yt=Array.prototype.slice;function vt(t){return()=>t}const bt=Math.sqrt(50),_t=Math.sqrt(10),wt=Math.sqrt(2);function Et(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=bt?10:o>=_t?5:o>=wt?2:1;let a,l,c;return i<0?(c=Math.pow(10,-i)/s,a=Math.round(t*c),l=Math.round(e*c),a/c<t&&++a,l/c>e&&--l,c=-c):(c=Math.pow(10,i)*s,a=Math.round(t/c),l=Math.round(e/c),a*c<t&&++a,l*c>e&&--l),l<a&&.5<=n&&n<2?Et(t,e,2*n):[a,l,c]}function xt(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const r=e<t,[i,o,s]=r?Et(e,t,n):Et(t,e,n);if(!(o>=i))return[];const a=o-i+1,l=new Array(a);if(r)if(s<0)for(let t=0;t<a;++t)l[t]=(o-t)/-s;else for(let t=0;t<a;++t)l[t]=(o-t)*s;else if(s<0)for(let t=0;t<a;++t)l[t]=(i+t)/-s;else for(let t=0;t<a;++t)l[t]=(i+t)*s;return l}function Tt(t,e,n){return Et(t=+t,e=+e,n=+n)[2]}function Ot(t,e,n){n=+n;const r=(e=+e)<(t=+t),i=r?Tt(e,t,n):Tt(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function St(t){return Math.max(1,Math.ceil(Math.log(function(t){let e=0;for(let n of t)null!=n&&(n=+n)>=n&&++e;return e}(t))/Math.LN2)+1)}function Mt(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n}function At(t){return t}var kt=1,Dt=2,Ct=3,Rt=4,Lt=1e-6;function Pt(t){return"translate("+t+",0)"}function It(t){return"translate(0,"+t+")"}function Nt(t){return e=>+t(e)}function Bt(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function jt(){return!this.__axis}function Ut(t,e){var n=[],r=null,i=null,o=6,s=6,a=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=t===kt||t===Rt?-1:1,u=t===Rt||t===Dt?"x":"y",h=t===kt||t===Ct?Pt:It;function d(d){var f=r??(e.ticks?e.ticks.apply(e,n):e.domain()),p=i??(e.tickFormat?e.tickFormat.apply(e,n):At),m=Math.max(o,0)+a,g=e.range(),y=+g[0]+l,v=+g[g.length-1]+l,b=(e.bandwidth?Bt:Nt)(e.copy(),l),_=d.selection?d.selection():d,w=_.selectAll(".domain").data([null]),E=_.selectAll(".tick").data(f,e).order(),x=E.exit(),T=E.enter().append("g").attr("class","tick"),O=E.select("line"),S=E.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),E=E.merge(T),O=O.merge(T.append("line").attr("stroke","currentColor").attr(u+"2",c*o)),S=S.merge(T.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",t===kt?"0em":t===Ct?"0.71em":"0.32em")),d!==_&&(w=w.transition(d),E=E.transition(d),O=O.transition(d),S=S.transition(d),x=x.transition(d).attr("opacity",Lt).attr("transform",(function(t){return isFinite(t=b(t))?h(t+l):this.getAttribute("transform")})),T.attr("opacity",Lt).attr("transform",(function(t){var e=this.parentNode.__axis;return h((e&&isFinite(e=e(t))?e:b(t))+l)}))),x.remove(),w.attr("d",t===Rt||t===Dt?s?"M"+c*s+","+y+"H"+l+"V"+v+"H"+c*s:"M"+l+","+y+"V"+v:s?"M"+y+","+c*s+"V"+l+"H"+v+"V"+c*s:"M"+y+","+l+"H"+v),E.attr("opacity",1).attr("transform",(function(t){return h(b(t)+l)})),O.attr(u+"2",c*o),S.attr(u,c*m).text(p),_.filter(jt).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===Dt?"start":t===Rt?"end":"middle"),_.each((function(){this.__axis=b}))}return d.scale=function(t){return arguments.length?(e=t,d):e},d.ticks=function(){return n=Array.from(arguments),d},d.tickArguments=function(t){return arguments.length?(n=null==t?[]:Array.from(t),d):n.slice()},d.tickValues=function(t){return arguments.length?(r=null==t?null:Array.from(t),d):r&&r.slice()},d.tickFormat=function(t){return arguments.length?(i=t,d):i},d.tickSize=function(t){return arguments.length?(o=s=+t,d):o},d.tickSizeInner=function(t){return arguments.length?(o=+t,d):o},d.tickSizeOuter=function(t){return arguments.length?(s=+t,d):s},d.tickPadding=function(t){return arguments.length?(a=+t,d):a},d.offset=function(t){return arguments.length?(l=+t,d):l},d}function $t(t){return Ut(kt,t)}function Ft(t){return Ut(Dt,t)}function Ht(t){return Ut(Ct,t)}function zt(t){return Ut(Rt,t)}var Vt={value:()=>{}};function Gt(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new Wt(r)}function Wt(t){this._=t}function Yt(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function Zt(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=Vt,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}Wt.prototype=Gt.prototype={constructor:Wt,on:function(t,e){var n,r=this._,i=function(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}(t+"",r),o=-1,s=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<s;)if(n=(t=i[o]).type)r[n]=Zt(r[n],t.name,e);else if(null==e)for(n in r)r[n]=Zt(r[n],t.name,null);return this}for(;++o<s;)if((n=(t=i[o]).type)&&(n=Yt(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Wt(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};var qt="http://www.w3.org/1999/xhtml";const Xt={svg:"http://www.w3.org/2000/svg",xhtml:qt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Kt(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),Xt.hasOwnProperty(e)?{space:Xt[e],local:t}:t}function Qt(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===qt&&e.documentElement.namespaceURI===qt?e.createElement(t):e.createElementNS(n,t)}}function Jt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function te(t){var e=Kt(t);return(e.local?Jt:Qt)(e)}function ee(){}function ne(t){return null==t?ee:function(){return this.querySelector(t)}}function re(){return[]}function ie(t){return null==t?re:function(){return this.querySelectorAll(t)}}function oe(t){return function(){return this.matches(t)}}function se(t){return function(e){return e.matches(t)}}var ae=Array.prototype.find;function le(){return this.firstElementChild}var ce=Array.prototype.filter;function ue(){return Array.from(this.children)}function he(t){return new Array(t.length)}function de(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function fe(t,e,n,r,i,o){for(var s,a=0,l=e.length,c=o.length;a<c;++a)(s=e[a])?(s.__data__=o[a],r[a]=s):n[a]=new de(t,o[a]);for(;a<l;++a)(s=e[a])&&(i[a]=s)}function pe(t,e,n,r,i,o,s){var a,l,c,u=new Map,h=e.length,d=o.length,f=new Array(h);for(a=0;a<h;++a)(l=e[a])&&(f[a]=c=s.call(l,l.__data__,a,e)+"",u.has(c)?i[a]=l:u.set(c,l));for(a=0;a<d;++a)c=s.call(t,o[a],a,o)+"",(l=u.get(c))?(r[a]=l,l.__data__=o[a],u.delete(c)):n[a]=new de(t,o[a]);for(a=0;a<h;++a)(l=e[a])&&u.get(f[a])===l&&(i[a]=l)}function me(t){return t.__data__}function ge(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function ye(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function ve(t){return function(){this.removeAttribute(t)}}function be(t){return function(){this.removeAttributeNS(t.space,t.local)}}function _e(t,e){return function(){this.setAttribute(t,e)}}function we(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Ee(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function xe(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Te(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Oe(t){return function(){this.style.removeProperty(t)}}function Se(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Me(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Ae(t,e){return t.style.getPropertyValue(e)||Te(t).getComputedStyle(t,null).getPropertyValue(e)}function ke(t){return function(){delete this[t]}}function De(t,e){return function(){this[t]=e}}function Ce(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function Re(t){return t.trim().split(/^|\s+/)}function Le(t){return t.classList||new Pe(t)}function Pe(t){this._node=t,this._names=Re(t.getAttribute("class")||"")}function Ie(t,e){for(var n=Le(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function Ne(t,e){for(var n=Le(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Be(t){return function(){Ie(this,t)}}function je(t){return function(){Ne(this,t)}}function Ue(t,e){return function(){(e.apply(this,arguments)?Ie:Ne)(this,t)}}function $e(){this.textContent=""}function Fe(t){return function(){this.textContent=t}}function He(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function ze(){this.innerHTML=""}function Ve(t){return function(){this.innerHTML=t}}function Ge(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function We(){this.nextSibling&&this.parentNode.appendChild(this)}function Ye(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ze(){return null}function qe(){var t=this.parentNode;t&&t.removeChild(this)}function Xe(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ke(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Qe(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,o=e.length;r<o;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++i]=n:this.removeEventListener(n.type,n.listener,n.options);++i?e.length=i:delete this.__on}}}function Je(t,e,n){return function(){var r,i=this.__on,o=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(i)for(var s=0,a=i.length;s<a;++s)if((r=i[s]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=n),void(r.value=e);this.addEventListener(t.type,o,n),r={type:t.type,name:t.name,value:e,listener:o,options:n},i?i.push(r):this.__on=[r]}}function tn(t,e,n){var r=Te(t),i=r.CustomEvent;"function"==typeof i?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function en(t,e){return function(){return tn(this,t,e)}}function nn(t,e){return function(){return tn(this,t,e.apply(this,arguments))}}de.prototype={constructor:de,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},Pe.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var rn=[null];function on(t,e){this._groups=t,this._parents=e}function sn(){return new on([[document.documentElement]],rn)}function an(t){return"string"==typeof t?new on([[document.querySelector(t)]],[document.documentElement]):new on([[t]],rn)}function ln(t,e){if(t=function(t){let e;for(;e=t.sourceEvent;)t=e;return t}(t),void 0===e&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(e.getScreenCTM().inverse())).x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}on.prototype=sn.prototype={constructor:on,select:function(t){"function"!=typeof t&&(t=ne(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o,s,a=e[i],l=a.length,c=r[i]=new Array(l),u=0;u<l;++u)(o=a[u])&&(s=t.call(o,o.__data__,u,a))&&("__data__"in o&&(s.__data__=o.__data__),c[u]=s);return new on(r,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){return function(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}(t.apply(this,arguments))}}(t):ie(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var s,a=e[o],l=a.length,c=0;c<l;++c)(s=a[c])&&(r.push(t.call(s,s.__data__,c,a)),i.push(s));return new on(r,i)},selectChild:function(t){return this.select(null==t?le:function(t){return function(){return ae.call(this.children,t)}}("function"==typeof t?t:se(t)))},selectChildren:function(t){return this.selectAll(null==t?ue:function(t){return function(){return ce.call(this.children,t)}}("function"==typeof t?t:se(t)))},filter:function(t){"function"!=typeof t&&(t=oe(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o,s=e[i],a=s.length,l=r[i]=[],c=0;c<a;++c)(o=s[c])&&t.call(o,o.__data__,c,s)&&l.push(o);return new on(r,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,me);var n=e?pe:fe,r=this._parents,i=this._groups;"function"!=typeof t&&(t=function(t){return function(){return t}}(t));for(var o=i.length,s=new Array(o),a=new Array(o),l=new Array(o),c=0;c<o;++c){var u=r[c],h=i[c],d=h.length,f=ge(t.call(u,u&&u.__data__,c,r)),p=f.length,m=a[c]=new Array(p),g=s[c]=new Array(p);n(u,h,m,g,l[c]=new Array(d),f,e);for(var y,v,b=0,_=0;b<p;++b)if(y=m[b]){for(b>=_&&(_=b+1);!(v=g[_])&&++_<p;);y._next=v||null}}return(s=new on(s,r))._enter=a,s._exit=l,s},enter:function(){return new on(this._enter||this._groups.map(he),this._parents)},exit:function(){return new on(this._exit||this._groups.map(he),this._parents)},join:function(t,e,n){var r=this.enter(),i=this,o=this.exit();return"function"==typeof t?(r=t(r))&&(r=r.selection()):r=r.append(t+""),null!=e&&(i=e(i))&&(i=i.selection()),null==n?o.remove():n(o),r&&i?r.merge(i).order():i},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,s=Math.min(i,o),a=new Array(i),l=0;l<s;++l)for(var c,u=n[l],h=r[l],d=u.length,f=a[l]=new Array(d),p=0;p<d;++p)(c=u[p]||h[p])&&(f[p]=c);for(;l<i;++l)a[l]=n[l];return new on(a,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,i=t[e],o=i.length-1,s=i[o];--o>=0;)(r=i[o])&&(s&&4^r.compareDocumentPosition(s)&&s.parentNode.insertBefore(r,s),s=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=ye);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var s,a=n[o],l=a.length,c=i[o]=new Array(l),u=0;u<l;++u)(s=a[u])&&(c[u]=s);c.sort(e)}return new on(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null},size:function(){let t=0;for(const e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i,o=e[n],s=0,a=o.length;s<a;++s)(i=o[s])&&t.call(i,i.__data__,s,o);return this},attr:function(t,e){var n=Kt(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?be:ve:"function"==typeof e?n.local?xe:Ee:n.local?we:_e)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?Oe:"function"==typeof e?Me:Se)(t,e,n??"")):Ae(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?ke:"function"==typeof e?Ce:De)(t,e)):this.node()[t]},classed:function(t,e){var n=Re(t+"");if(arguments.length<2){for(var r=Le(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each(("function"==typeof e?Ue:e?Be:je)(n,e))},text:function(t){return arguments.length?this.each(null==t?$e:("function"==typeof t?He:Fe)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?ze:("function"==typeof t?Ge:Ve)(t)):this.node().innerHTML},raise:function(){return this.each(We)},lower:function(){return this.each(Ye)},append:function(t){var e="function"==typeof t?t:te(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:te(t),r=null==e?Ze:"function"==typeof e?e:ne(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(qe)},clone:function(t){return this.select(t?Ke:Xe)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,i,o=function(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),s=o.length;if(!(arguments.length<2)){for(a=e?Je:Qe,r=0;r<s;++r)this.each(a(o[r],e,n));return this}var a=this.node().__on;if(a)for(var l,c=0,u=a.length;c<u;++c)for(r=0,l=a[c];r<s;++r)if((i=o[r]).type===l.type&&i.name===l.name)return l.value},dispatch:function(t,e){return this.each(("function"==typeof e?nn:en)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r,i=t[e],o=0,s=i.length;o<s;++o)(r=i[o])&&(yield r)}};const cn={capture:!0,passive:!1};function un(t){t.preventDefault(),t.stopImmediatePropagation()}function hn(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function dn(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function fn(){}var pn=.7,mn=1/pn,gn="\\s*([+-]?\\d+)\\s*",yn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",vn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",bn=/^#([0-9a-f]{3,8})$/,_n=new RegExp(`^rgb\\(${gn},${gn},${gn}\\)$`),wn=new RegExp(`^rgb\\(${vn},${vn},${vn}\\)$`),En=new RegExp(`^rgba\\(${gn},${gn},${gn},${yn}\\)$`),xn=new RegExp(`^rgba\\(${vn},${vn},${vn},${yn}\\)$`),Tn=new RegExp(`^hsl\\(${yn},${vn},${vn}\\)$`),On=new RegExp(`^hsla\\(${yn},${vn},${vn},${yn}\\)$`),Sn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Mn(){return this.rgb().formatHex()}function An(){return this.rgb().formatRgb()}function kn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=bn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Dn(e):3===n?new Ln(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Cn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Cn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=_n.exec(t))?new Ln(e[1],e[2],e[3],1):(e=wn.exec(t))?new Ln(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=En.exec(t))?Cn(e[1],e[2],e[3],e[4]):(e=xn.exec(t))?Cn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Tn.exec(t))?Un(e[1],e[2]/100,e[3]/100,1):(e=On.exec(t))?Un(e[1],e[2]/100,e[3]/100,e[4]):Sn.hasOwnProperty(t)?Dn(Sn[t]):"transparent"===t?new Ln(NaN,NaN,NaN,0):null}function Dn(t){return new Ln(t>>16&255,t>>8&255,255&t,1)}function Cn(t,e,n,r){return r<=0&&(t=e=n=NaN),new Ln(t,e,n,r)}function Rn(t,e,n,r){return 1===arguments.length?function(t){return t instanceof fn||(t=kn(t)),t?new Ln((t=t.rgb()).r,t.g,t.b,t.opacity):new Ln}(t):new Ln(t,e,n,r??1)}function Ln(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Pn(){return`#${jn(this.r)}${jn(this.g)}${jn(this.b)}`}function In(){const t=Nn(this.opacity);return`${1===t?"rgb(":"rgba("}${Bn(this.r)}, ${Bn(this.g)}, ${Bn(this.b)}${1===t?")":`, ${t})`}`}function Nn(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Bn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function jn(t){return((t=Bn(t))<16?"0":"")+t.toString(16)}function Un(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Fn(t,e,n,r)}function $n(t){if(t instanceof Fn)return new Fn(t.h,t.s,t.l,t.opacity);if(t instanceof fn||(t=kn(t)),!t)return new Fn;if(t instanceof Fn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(s=e===o?(n-r)/a+6*(n<r):n===o?(r-e)/a+2:(e-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new Fn(s,a,l,t.opacity)}function Fn(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Hn(t){return(t=(t||0)%360)<0?t+360:t}function zn(t){return Math.max(0,Math.min(1,t||0))}function Vn(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}hn(fn,kn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Mn,formatHex:Mn,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return $n(this).formatHsl()},formatRgb:An,toString:An}),hn(Ln,Rn,dn(fn,{brighter(t){return t=null==t?mn:Math.pow(mn,t),new Ln(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?pn:Math.pow(pn,t),new Ln(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ln(Bn(this.r),Bn(this.g),Bn(this.b),Nn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Pn,formatHex:Pn,formatHex8:function(){return`#${jn(this.r)}${jn(this.g)}${jn(this.b)}${jn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:In,toString:In})),hn(Fn,(function(t,e,n,r){return 1===arguments.length?$n(t):new Fn(t,e,n,r??1)}),dn(fn,{brighter(t){return t=null==t?mn:Math.pow(mn,t),new Fn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?pn:Math.pow(pn,t),new Fn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Ln(Vn(t>=240?t-240:t+120,i,r),Vn(t,i,r),Vn(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Fn(Hn(this.h),zn(this.s),zn(this.l),Nn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Nn(this.opacity);return`${1===t?"hsl(":"hsla("}${Hn(this.h)}, ${100*zn(this.s)}%, ${100*zn(this.l)}%${1===t?")":`, ${t})`}`}}));const Gn=t=>()=>t;function Wn(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):Gn(isNaN(t)?e:t)}const Yn=function t(e){var n=function(t){return 1==(t=+t)?Wn:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Gn(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=Rn(t)).r,(e=Rn(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),s=Wn(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=s(e),t+""}}return r.gamma=t,r}(1);function Zn(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(o){for(n=0;n<r;++n)i[n]=t[n]*(1-o)+e[n]*o;return i}}function qn(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,o=new Array(i),s=new Array(r);for(n=0;n<i;++n)o[n]=nr(t[n],e[n]);for(;n<r;++n)s[n]=e[n];return function(t){for(n=0;n<i;++n)s[n]=o[n](t);return s}}function Xn(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function Kn(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Qn(t,e){var n,r={},i={};for(n in(null===t||"object"!=typeof t)&&(t={}),(null===e||"object"!=typeof e)&&(e={}),e)n in t?r[n]=nr(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}}var Jn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,tr=new RegExp(Jn.source,"g");function er(t,e){var n,r,i,o=Jn.lastIndex=tr.lastIndex=0,s=-1,a=[],l=[];for(t+="",e+="";(n=Jn.exec(t))&&(r=tr.exec(e));)(i=r.index)>o&&(i=e.slice(o,i),a[s]?a[s]+=i:a[++s]=i),(n=n[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:Kn(n,r)})),o=tr.lastIndex;return o<e.length&&(i=e.slice(o),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var n,r=0;r<e;++r)a[(n=l[r]).i]=n.x(t);return a.join("")})}function nr(t,e){var n,r=typeof e;return null==e||"boolean"===r?Gn(e):("number"===r?Kn:"string"===r?(n=kn(e))?(e=n,Yn):er:e instanceof kn?Yn:e instanceof Date?Xn:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}(e)?Zn:Array.isArray(e)?qn:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Qn:Kn)(t,e)}function rr(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var ir,or=180/Math.PI,sr={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ar(t,e,n,r,i,o){var s,a,l;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(l=t*n+e*r)&&(n-=t*l,r-=e*l),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,l/=a),t*r<e*n&&(t=-t,e=-e,l=-l,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*or,skewX:Math.atan(l)*or,scaleX:s,scaleY:a}}function lr(t,e,n,r){function i(t){return t.length?t.pop()+" ":""}return function(o,s){var a=[],l=[];return o=t(o),s=t(s),function(t,r,i,o,s,a){if(t!==i||r!==o){var l=s.push("translate(",null,e,null,n);a.push({i:l-4,x:Kn(t,i)},{i:l-2,x:Kn(r,o)})}else(i||o)&&s.push("translate("+i+e+o+n)}(o.translateX,o.translateY,s.translateX,s.translateY,a,l),function(t,e,n,o){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Kn(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,s.rotate,a,l),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:Kn(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,s.skewX,a,l),function(t,e,n,r,o,s){if(t!==n||e!==r){var a=o.push(i(o)+"scale(",null,",",null,")");s.push({i:a-4,x:Kn(t,n)},{i:a-2,x:Kn(e,r)})}else(1!==n||1!==r)&&o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,s.scaleX,s.scaleY,a,l),o=s=null,function(t){for(var e,n=-1,r=l.length;++n<r;)a[(e=l[n]).i]=e.x(t);return a.join("")}}}var cr,ur,hr=lr((function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?sr:ar(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),dr=lr((function(t){return null!=t&&(ir||(ir=document.createElementNS("http://www.w3.org/2000/svg","g")),ir.setAttribute("transform",t),t=ir.transform.baseVal.consolidate())?ar((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):sr}),", ",")",")"),fr=0,pr=0,mr=0,gr=1e3,yr=0,vr=0,br=0,_r="object"==typeof performance&&performance.now?performance:Date,wr="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Er(){return vr||(wr(xr),vr=_r.now()+br)}function xr(){vr=0}function Tr(){this._call=this._time=this._next=null}function Or(t,e,n){var r=new Tr;return r.restart(t,e,n),r}function Sr(){vr=(yr=_r.now())+br,fr=pr=0;try{!function(){Er(),++fr;for(var t,e=cr;e;)(t=vr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--fr}()}finally{fr=0,function(){for(var t,e,n=cr,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:cr=e);ur=t,Ar(r)}(),vr=0}}function Mr(){var t=_r.now(),e=t-yr;e>gr&&(br-=e,yr=t)}function Ar(t){fr||(pr&&(pr=clearTimeout(pr)),t-vr>24?(t<1/0&&(pr=setTimeout(Sr,t-_r.now()-br)),mr&&(mr=clearInterval(mr))):(mr||(yr=_r.now(),mr=setInterval(Mr,gr)),fr=1,wr(Sr)))}function kr(t,e,n){var r=new Tr;return e=null==e?0:+e,r.restart((n=>{r.stop(),t(n+e)}),e,n),r}Tr.prototype=Or.prototype={constructor:Tr,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Er():+n)+(null==e?0:+e),!this._next&&ur!==this&&(ur?ur._next=this:cr=this,ur=this),this._call=t,this._time=n,Ar()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ar())}};var Dr=Gt("start","end","cancel","interrupt"),Cr=[],Rr=0,Lr=2,Pr=3,Ir=5,Nr=6;function Br(t,e,n,r,i,o){var s=t.__transition;if(s){if(n in s)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function o(l){var c,u,h,d;if(1!==n.state)return a();for(c in i)if((d=i[c]).name===n.name){if(d.state===Pr)return kr(o);4===d.state?(d.state=Nr,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete i[c]):+c<e&&(d.state=Nr,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete i[c])}if(kr((function(){n.state===Pr&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(l))})),n.state=Lr,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Lr){for(n.state=Pr,r=new Array(h=n.tween.length),c=0,u=-1;c<h;++c)(d=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(r[++u]=d);r.length=u+1}}function s(e){for(var i=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(a),n.state=Ir,1),o=-1,s=r.length;++o<s;)r[o].call(t,i);n.state===Ir&&(n.on.call("end",t,t.__data__,n.index,n.group),a())}function a(){for(var r in n.state=Nr,n.timer.stop(),delete i[e],i)return;delete t.__transition}i[e]=n,n.timer=Or((function(t){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=t&&o(t-n.delay)}),0,n.time)}(t,n,{name:e,index:r,group:i,on:Dr,tween:Cr,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Rr})}function jr(t,e){var n=$r(t,e);if(n.state>Rr)throw new Error("too late; already scheduled");return n}function Ur(t,e){var n=$r(t,e);if(n.state>Pr)throw new Error("too late; already running");return n}function $r(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Fr(t,e){var n,r,i,o=t.__transition,s=!0;if(o){for(i in e=null==e?null:e+"",o)(n=o[i]).name===e?(r=n.state>Lr&&n.state<Ir,n.state=Nr,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[i]):s=!1;s&&delete t.__transition}}function Hr(t,e){var n,r;return function(){var i=Ur(this,t),o=i.tween;if(o!==n)for(var s=0,a=(r=n=o).length;s<a;++s)if(r[s].name===e){(r=r.slice()).splice(s,1);break}i.tween=r}}function zr(t,e,n){var r,i;if("function"!=typeof n)throw new Error;return function(){var o=Ur(this,t),s=o.tween;if(s!==r){i=(r=s).slice();for(var a={name:e,value:n},l=0,c=i.length;l<c;++l)if(i[l].name===e){i[l]=a;break}l===c&&i.push(a)}o.tween=i}}function Vr(t,e,n){var r=t._id;return t.each((function(){var t=Ur(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return $r(t,r).value[e]}}function Gr(t,e){var n;return("number"==typeof e?Kn:e instanceof kn?Yn:(n=kn(e))?(e=n,Yn):er)(t,e)}function Wr(t){return function(){this.removeAttribute(t)}}function Yr(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Zr(t,e,n){var r,i,o=n+"";return function(){var s=this.getAttribute(t);return s===o?null:s===r?i:i=e(r=s,n)}}function qr(t,e,n){var r,i,o=n+"";return function(){var s=this.getAttributeNS(t.space,t.local);return s===o?null:s===r?i:i=e(r=s,n)}}function Xr(t,e,n){var r,i,o;return function(){var s,a,l=n(this);return null==l?void this.removeAttribute(t):(s=this.getAttribute(t))===(a=l+"")?null:s===r&&a===i?o:(i=a,o=e(r=s,l))}}function Kr(t,e,n){var r,i,o;return function(){var s,a,l=n(this);return null==l?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local))===(a=l+"")?null:s===r&&a===i?o:(i=a,o=e(r=s,l))}}function Qr(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}(t,i)),n}return i._value=e,i}function Jr(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&function(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}(t,i)),n}return i._value=e,i}function ti(t,e){return function(){jr(this,t).delay=+e.apply(this,arguments)}}function ei(t,e){return e=+e,function(){jr(this,t).delay=e}}function ni(t,e){return function(){Ur(this,t).duration=+e.apply(this,arguments)}}function ri(t,e){return e=+e,function(){Ur(this,t).duration=e}}var ii=sn.prototype.constructor;function oi(t){return function(){this.style.removeProperty(t)}}var si=0;function ai(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function li(){return++si}var ci=sn.prototype;ai.prototype={constructor:ai,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=ne(t));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var a,l,c=r[s],u=c.length,h=o[s]=new Array(u),d=0;d<u;++d)(a=c[d])&&(l=t.call(a,a.__data__,d,c))&&("__data__"in a&&(l.__data__=a.__data__),h[d]=l,Br(h[d],e,n,d,h,$r(a,n)));return new ai(o,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=ie(t));for(var r=this._groups,i=r.length,o=[],s=[],a=0;a<i;++a)for(var l,c=r[a],u=c.length,h=0;h<u;++h)if(l=c[h]){for(var d,f=t.call(l,l.__data__,h,c),p=$r(l,n),m=0,g=f.length;m<g;++m)(d=f[m])&&Br(d,e,n,m,f,p);o.push(f),s.push(l)}return new ai(o,s,e,n)},selectChild:ci.selectChild,selectChildren:ci.selectChildren,filter:function(t){"function"!=typeof t&&(t=oe(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o,s=e[i],a=s.length,l=r[i]=[],c=0;c<a;++c)(o=s[c])&&t.call(o,o.__data__,c,s)&&l.push(o);return new ai(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),s=new Array(r),a=0;a<o;++a)for(var l,c=e[a],u=n[a],h=c.length,d=s[a]=new Array(h),f=0;f<h;++f)(l=c[f]||u[f])&&(d[f]=l);for(;a<r;++a)s[a]=e[a];return new ai(s,this._parents,this._name,this._id)},selection:function(){return new ii(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=li(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s,a=r[o],l=a.length,c=0;c<l;++c)if(s=a[c]){var u=$r(s,e);Br(s,t,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new ai(r,this._parents,t,n)},call:ci.call,nodes:ci.nodes,node:ci.node,size:ci.size,empty:ci.empty,each:ci.each,on:function(t,e){var n=this._id;return arguments.length<2?$r(this.node(),n).on.on(t):this.each(function(t,e,n){var r,i,o=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?jr:Ur;return function(){var s=o(this,t),a=s.on;a!==r&&(i=(r=a).copy()).on(e,n),s.on=i}}(n,t,e))},attr:function(t,e){var n=Kt(t),r="transform"===n?dr:Gr;return this.attrTween(t,"function"==typeof e?(n.local?Kr:Xr)(n,r,Vr(this,"attr."+t,e)):null==e?(n.local?Yr:Wr)(n):(n.local?qr:Zr)(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=Kt(t);return this.tween(n,(r.local?Qr:Jr)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?hr:Gr;return null==e?this.styleTween(t,function(t,e){var n,r,i;return function(){var o=Ae(this,t),s=(this.style.removeProperty(t),Ae(this,t));return o===s?null:o===n&&s===r?i:i=e(n=o,r=s)}}(t,r)).on("end.style."+t,oi(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,i,o;return function(){var s=Ae(this,t),a=n(this),l=a+"";return null==a&&(this.style.removeProperty(t),l=a=Ae(this,t)),s===l?null:s===r&&l===i?o:(i=l,o=e(r=s,a))}}(t,r,Vr(this,"style."+t,e))).each(function(t,e){var n,r,i,o,s="style."+e,a="end."+s;return function(){var l=Ur(this,t),c=l.on,u=null==l.value[s]?o||(o=oi(e)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(a,i=u),l.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,i,o=n+"";return function(){var s=Ae(this,t);return s===o?null:s===r?i:i=e(r=s,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,function(t,e,n){var r,i;function o(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}(t,o,n)),r}return o._value=e,o}(t,e,n??""))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=e??""}}(Vr(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&function(t){return function(e){this.textContent=t.call(this,e)}}(r)),e}return r._value=t,r}(t))},remove:function(){return this.on("end.remove",(t=this._id,function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}));var t},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,i=$r(this.node(),n).tween,o=0,s=i.length;o<s;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==e?Hr:zr)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?ti:ei)(e,t)):$r(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?ni:ri)(e,t)):$r(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw new Error;return function(){Ur(this,t).ease=e}}(e,t)):$r(this.node(),e).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,e){return function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw new Error;Ur(this,t).ease=n}}(this._id,t))},end:function(){var t,e,n=this,r=n._id,i=n.size();return new Promise((function(o,s){var a={value:s},l={value:function(){0==--i&&o()}};n.each((function(){var n=Ur(this,r),i=n.on;i!==t&&((e=(t=i).copy())._.cancel.push(a),e._.interrupt.push(a),e._.end.push(l)),n.on=e})),0===i&&o()}))},[Symbol.iterator]:ci[Symbol.iterator]};const ui=t=>+t;function hi(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var di={time:null,delay:0,duration:250,ease:hi};function fi(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}sn.prototype.interrupt=function(t){return this.each((function(){Fr(this,t)}))},sn.prototype.transition=function(t){var e,n;t instanceof ai?(e=t._id,t=t._name):(e=li(),(n=di).time=Er(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s,a=r[o],l=a.length,c=0;c<l;++c)(s=a[c])&&Br(s,t,e,c,a,n||fi(s,e));return new ai(r,this._parents,t,e)};const pi=t=>()=>t;function mi(t,{sourceEvent:e,target:n,selection:r,mode:i,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function gi(t){t.preventDefault(),t.stopImmediatePropagation()}var yi={name:"drag"},vi={name:"space"},bi={name:"handle"},_i={name:"center"};const{abs:wi,max:Ei,min:xi}=Math;function Ti(t){return[+t[0],+t[1]]}function Oi(t){return[Ti(t[0]),Ti(t[1])]}var Si={name:"x",handles:["w","e"].map(Li),input:function(t,e){return null==t?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},Mi={name:"y",handles:["n","s"].map(Li),input:function(t,e){return null==t?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},Ai={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},ki={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Di={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Ci={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Ri={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Li(t){return{type:t}}function Pi(t){return!t.ctrlKey&&!t.button}function Ii(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function Ni(){return navigator.maxTouchPoints||"ontouchstart"in this}function Bi(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function ji(){return function(t){var e,n=Ii,r=Pi,i=Ni,o=!0,s=Gt("start","brush","end"),a=6;function l(e){var n=e.property("__brush",m).selectAll(".overlay").data([Li("overlay")]);n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Ai.overlay).merge(n).each((function(){var t=Bi(this).extent;an(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])})),e.selectAll(".selection").data([Li("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Ai.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=e.selectAll(".handle").data(t.handles,(function(t){return t.type}));r.exit().remove(),r.enter().append("rect").attr("class",(function(t){return"handle handle--"+t.type})).attr("cursor",(function(t){return Ai[t.type]})),e.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",d).filter(i).on("touchstart.brush",d).on("touchmove.brush",f).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function c(){var t=an(this),e=Bi(this).selection;e?(t.selectAll(".selection").style("display",null).attr("x",e[0][0]).attr("y",e[0][1]).attr("width",e[1][0]-e[0][0]).attr("height",e[1][1]-e[0][1]),t.selectAll(".handle").style("display",null).attr("x",(function(t){return"e"===t.type[t.type.length-1]?e[1][0]-a/2:e[0][0]-a/2})).attr("y",(function(t){return"s"===t.type[0]?e[1][1]-a/2:e[0][1]-a/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?e[1][0]-e[0][0]+a:a})).attr("height",(function(t){return"e"===t.type||"w"===t.type?e[1][1]-e[0][1]+a:a}))):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(t,e,n){var r=t.__brush.emitter;return!r||n&&r.clean?new h(t,e,n):r}function h(t,e,n){this.that=t,this.args=e,this.state=t.__brush,this.active=0,this.clean=n}function d(n){if((!e||n.touches)&&r.apply(this,arguments)){var i,s,a,l,h,d,f,p,m,g,y,v=this,b=n.target.__data__.type,_="selection"===(o&&n.metaKey?b="overlay":b)?yi:o&&n.altKey?_i:bi,w=t===Mi?null:Ci[b],E=t===Si?null:Ri[b],x=Bi(v),T=x.extent,O=x.selection,S=T[0][0],M=T[0][1],A=T[1][0],k=T[1][1],D=0,C=0,R=w&&E&&o&&n.shiftKey,L=Array.from(n.touches||[n],(t=>{const e=t.identifier;return(t=ln(t,v)).point0=t.slice(),t.identifier=e,t}));Fr(v);var P=u(v,arguments,!0).beforestart();if("overlay"===b){O&&(m=!0);const e=[L[0],L[1]||L[0]];x.selection=O=[[i=t===Mi?S:xi(e[0][0],e[1][0]),a=t===Si?M:xi(e[0][1],e[1][1])],[h=t===Mi?A:Ei(e[0][0],e[1][0]),f=t===Si?k:Ei(e[0][1],e[1][1])]],L.length>1&&U(n)}else i=O[0][0],a=O[0][1],h=O[1][0],f=O[1][1];s=i,l=a,d=h,p=f;var I=an(v).attr("pointer-events","none"),N=I.selectAll(".overlay").attr("cursor",Ai[b]);if(n.touches)P.moved=j,P.ended=$;else{var B=an(n.view).on("mousemove.brush",j,!0).on("mouseup.brush",$,!0);o&&B.on("keydown.brush",(function(t){switch(t.keyCode){case 16:R=w&&E;break;case 18:_===bi&&(w&&(h=d-D*w,i=s+D*w),E&&(f=p-C*E,a=l+C*E),_=_i,U(t));break;case 32:(_===bi||_===_i)&&(w<0?h=d-D:w>0&&(i=s-D),E<0?f=p-C:E>0&&(a=l-C),_=vi,N.attr("cursor",Ai.selection),U(t));break;default:return}gi(t)}),!0).on("keyup.brush",(function(t){switch(t.keyCode){case 16:R&&(g=y=R=!1,U(t));break;case 18:_===_i&&(w<0?h=d:w>0&&(i=s),E<0?f=p:E>0&&(a=l),_=bi,U(t));break;case 32:_===vi&&(t.altKey?(w&&(h=d-D*w,i=s+D*w),E&&(f=p-C*E,a=l+C*E),_=_i):(w<0?h=d:w>0&&(i=s),E<0?f=p:E>0&&(a=l),_=bi),N.attr("cursor",Ai[b]),U(t));break;default:return}gi(t)}),!0),function(t){var e=t.document.documentElement,n=an(t).on("dragstart.drag",un,cn);"onselectstart"in e?n.on("selectstart.drag",un,cn):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(n.view)}c.call(v),P.start(n,_.name)}function j(t){for(const e of t.changedTouches||[t])for(const t of L)t.identifier===e.identifier&&(t.cur=ln(e,v));if(R&&!g&&!y&&1===L.length){const t=L[0];wi(t.cur[0]-t[0])>wi(t.cur[1]-t[1])?y=!0:g=!0}for(const t of L)t.cur&&(t[0]=t.cur[0],t[1]=t.cur[1]);m=!0,gi(t),U(t)}function U(t){const e=L[0],n=e.point0;var r;switch(D=e[0]-n[0],C=e[1]-n[1],_){case vi:case yi:w&&(D=Ei(S-i,xi(A-h,D)),s=i+D,d=h+D),E&&(C=Ei(M-a,xi(k-f,C)),l=a+C,p=f+C);break;case bi:L[1]?(w&&(s=Ei(S,xi(A,L[0][0])),d=Ei(S,xi(A,L[1][0])),w=1),E&&(l=Ei(M,xi(k,L[0][1])),p=Ei(M,xi(k,L[1][1])),E=1)):(w<0?(D=Ei(S-i,xi(A-i,D)),s=i+D,d=h):w>0&&(D=Ei(S-h,xi(A-h,D)),s=i,d=h+D),E<0?(C=Ei(M-a,xi(k-a,C)),l=a+C,p=f):E>0&&(C=Ei(M-f,xi(k-f,C)),l=a,p=f+C));break;case _i:w&&(s=Ei(S,xi(A,i-D*w)),d=Ei(S,xi(A,h+D*w))),E&&(l=Ei(M,xi(k,a-C*E)),p=Ei(M,xi(k,f+C*E)))}d<s&&(w*=-1,r=i,i=h,h=r,r=s,s=d,d=r,b in ki&&N.attr("cursor",Ai[b=ki[b]])),p<l&&(E*=-1,r=a,a=f,f=r,r=l,l=p,p=r,b in Di&&N.attr("cursor",Ai[b=Di[b]])),x.selection&&(O=x.selection),g&&(s=O[0][0],d=O[1][0]),y&&(l=O[0][1],p=O[1][1]),(O[0][0]!==s||O[0][1]!==l||O[1][0]!==d||O[1][1]!==p)&&(x.selection=[[s,l],[d,p]],c.call(v),P.brush(t,_.name))}function $(t){if(function(t){t.stopImmediatePropagation()}(t),t.touches){if(t.touches.length)return;e&&clearTimeout(e),e=setTimeout((function(){e=null}),500)}else(function(t,e){var n=t.document.documentElement,r=an(t).on("dragstart.drag",null);e&&(r.on("click.drag",un,cn),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)})(t.view,m),B.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);I.attr("pointer-events","all"),N.attr("cursor",Ai.overlay),x.selection&&(O=x.selection),function(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}(O)&&(x.selection=null,c.call(v)),P.end(t,_.name)}}function f(t){u(this,arguments).moved(t)}function p(t){u(this,arguments).ended(t)}function m(){var e=this.__brush||{selection:null};return e.extent=Oi(n.apply(this,arguments)),e.dim=t,e}return l.move=function(e,n,r){e.tween?e.on("start.brush",(function(t){u(this,arguments).beforestart().start(t)})).on("interrupt.brush end.brush",(function(t){u(this,arguments).end(t)})).tween("brush",(function(){var e=this,r=e.__brush,i=u(e,arguments),o=r.selection,s=t.input("function"==typeof n?n.apply(this,arguments):n,r.extent),a=nr(o,s);function l(t){r.selection=1===t&&null===s?null:a(t),c.call(e),i.brush()}return null!==o&&null!==s?l:l(1)})):e.each((function(){var e=this,i=arguments,o=e.__brush,s=t.input("function"==typeof n?n.apply(e,i):n,o.extent),a=u(e,i).beforestart();Fr(e),o.selection=null===s?null:s,c.call(e),a.start(r).brush(r).end(r)}))},l.clear=function(t,e){l.move(t,null,e)},h.prototype={beforestart:function(){return 1==++this.active&&(this.state.emitter=this,this.starting=!0),this},start:function(t,e){return this.starting?(this.starting=!1,this.emit("start",t,e)):this.emit("brush",t),this},brush:function(t,e){return this.emit("brush",t,e),this},end:function(t,e){return 0==--this.active&&(delete this.state.emitter,this.emit("end",t,e)),this},emit:function(e,n,r){var i=an(this.that).datum();s.call(e,this.that,new mi(e,{sourceEvent:n,target:l,selection:t.output(this.state.selection),mode:r,dispatch:s}),i)}},l.extent=function(t){return arguments.length?(n="function"==typeof t?t:pi(Oi(t)),l):n},l.filter=function(t){return arguments.length?(r="function"==typeof t?t:pi(!!t),l):r},l.touchable=function(t){return arguments.length?(i="function"==typeof t?t:pi(!!t),l):i},l.handleSize=function(t){return arguments.length?(a=+t,l):a},l.keyModifiers=function(t){return arguments.length?(o=!!t,l):o},l.on=function(){var t=s.on.apply(s,arguments);return t===s?l:t},l}(Si)}const Ui=Math.PI,$i=2*Ui,Fi=1e-6,Hi=$i-Fi;function zi(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}let Vi=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?zi:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return zi;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=Math.round(arguments[e]*n)/n+t[e]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,r){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(t,e,n,r,i,o){this._append`C${+t},${+e},${+n},${+r},${this._x1=+i},${this._y1=+o}`}arcTo(t,e,n,r,i){if(t=+t,e=+e,n=+n,r=+r,(i=+i)<0)throw new Error(`negative radius: ${i}`);let o=this._x1,s=this._y1,a=n-t,l=r-e,c=o-t,u=s-e,h=c*c+u*u;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(h>Fi)if(Math.abs(u*a-l*c)>Fi&&i){let d=n-o,f=r-s,p=a*a+l*l,m=d*d+f*f,g=Math.sqrt(p),y=Math.sqrt(h),v=i*Math.tan((Ui-Math.acos((p+h-m)/(2*g*y)))/2),b=v/y,_=v/g;Math.abs(b-1)>Fi&&this._append`L${t+b*c},${e+b*u}`,this._append`A${i},${i},0,0,${+(u*d>c*f)},${this._x1=t+_*a},${this._y1=e+_*l}`}else this._append`L${this._x1=t},${this._y1=e}`}arc(t,e,n,r,i,o){if(t=+t,e=+e,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(r),a=n*Math.sin(r),l=t+s,c=e+a,u=1^o,h=o?r-i:i-r;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>Fi||Math.abs(this._y1-c)>Fi)&&this._append`L${l},${c}`,n&&(h<0&&(h=h%$i+$i),h>Hi?this._append`A${n},${n},0,1,${u},${t-s},${e-a}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:h>Fi&&this._append`A${n},${n},0,${+(h>=Ui)},${u},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function Gi(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Wi(t){return(t=Gi(Math.abs(t)))?t[1]:NaN}Vi.prototype;var Yi,Zi=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function qi(t){if(!(e=Zi.exec(t)))throw new Error("invalid format: "+t);var e;return new Xi({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Xi(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Ki(t,e){var n=Gi(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}qi.prototype=Xi.prototype,Xi.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const Qi={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Ki(100*t,e),r:Ki,s:function(t,e){var n=Gi(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(Yi=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Gi(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Ji(t){return t}var to,eo,no,ro=Array.prototype.map,io=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];to=function(t){var e=void 0===t.grouping||void 0===t.thousands?Ji:function(t,e){return function(n,r){for(var i=n.length,o=[],s=0,a=t[0],l=0;i>0&&a>0&&(l+a+1>r&&(a=Math.max(1,r-l)),o.push(n.substring(i-=a,i+a)),!((l+=a+1)>r));)a=t[s=(s+1)%t.length];return o.reverse().join(e)}}(ro.call(t.grouping,Number),t.thousands+""),n=void 0===t.currency?"":t.currency[0]+"",r=void 0===t.currency?"":t.currency[1]+"",i=void 0===t.decimal?".":t.decimal+"",o=void 0===t.numerals?Ji:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(ro.call(t.numerals,String)),s=void 0===t.percent?"%":t.percent+"",a=void 0===t.minus?"−":t.minus+"",l=void 0===t.nan?"NaN":t.nan+"";function c(t){var c=(t=qi(t)).fill,u=t.align,h=t.sign,d=t.symbol,f=t.zero,p=t.width,m=t.comma,g=t.precision,y=t.trim,v=t.type;"n"===v?(m=!0,v="g"):Qi[v]||(void 0===g&&(g=12),y=!0,v="g"),(f||"0"===c&&"="===u)&&(f=!0,c="0",u="=");var b="$"===d?n:"#"===d&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",_="$"===d?r:/[%p]/.test(v)?s:"",w=Qi[v],E=/[defgprs%]/.test(v);function x(t){var n,r,s,d=b,x=_;if("c"===v)x=w(t)+x,t="";else{var T=(t=+t)<0||1/t<0;if(t=isNaN(t)?l:w(Math.abs(t),g),y&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),T&&0==+t&&"+"!==h&&(T=!1),d=(T?"("===h?h:a:"-"===h||"("===h?"":h)+d,x=("s"===v?io[8+Yi/3]:"")+x+(T&&"("===h?")":""),E)for(n=-1,r=t.length;++n<r;)if(48>(s=t.charCodeAt(n))||s>57){x=(46===s?i+t.slice(n+1):t.slice(n))+x,t=t.slice(0,n);break}}m&&!f&&(t=e(t,1/0));var O=d.length+t.length+x.length,S=O<p?new Array(p-O+1).join(c):"";switch(m&&f&&(t=e(S+t,S.length?p-x.length:1/0),S=""),u){case"<":t=d+t+x+S;break;case"=":t=d+S+t+x;break;case"^":t=S.slice(0,O=S.length>>1)+d+t+x+S.slice(O);break;default:t=S+d+t+x}return o(t)}return g=void 0===g?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),x.toString=function(){return t+""},x}return{format:c,formatPrefix:function(t,e){var n=c(((t=qi(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(Wi(e)/3))),i=Math.pow(10,-r),o=io[8+r/3];return function(t){return n(i*t)+o}}}}({thousands:",",grouping:[3],currency:["$",""]}),eo=to.format,no=to.formatPrefix;var oo=1e-6,so=Math.PI,ao=so/2,lo=2*so,co=so/180,uo=Math.abs,ho=Math.atan,fo=(Math.atan2,Math.cos),po=(Math.exp,Math.log,Math.sin),mo=(Math.sign,Math.sqrt);Math.tan;function go(t,e){return uo(t)>so&&(t-=Math.round(t/lo)*lo),[t,e]}function yo(){}function vo(t,e){return[t,e]}go.invert=go,new dt,new dt,new dt,yo.prototype={constructor:yo,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},fo(30*co),vo.invert=vo;mo(3);function bo(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function _o(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=Eo)):void 0===e&&(e=wo);for(var n,r,i,o,s,a=new Oo(t),l=[a];n=l.pop();)if((i=e(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new Oo(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(To)}function wo(t){return t.children}function Eo(t){return Array.isArray(t)?t[1]:null}function xo(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function To(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function Oo(t){this.data=t,this.depth=this.height=0,this.parent=null}function So(t,e,n,r,i){for(var o,s=t.children,a=-1,l=s.length,c=t.value&&(r-e)/t.value;++a<l;)(o=s[a]).y0=n,o.y1=i,o.x0=e,o.x1=e+=o.value*c}function Mo(t,e,n,r,i){for(var o,s=t.children,a=-1,l=s.length,c=t.value&&(i-n)/t.value;++a<l;)(o=s[a]).x0=e,o.x1=r,o.y0=n,o.y1=n+=o.value*c}function Ao(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}Oo.prototype=_o.prototype={constructor:Oo,count:function(){return this.eachAfter(bo)},each:function(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this},eachAfter:function(t,e){for(var n,r,i,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)t.call(e,o,++l,this);return this},eachBefore:function(t,e){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(t.call(e,i,++s,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return _o(this).eachBefore(xo)},[Symbol.iterator]:function*(){var t,e,n,r,i=this,o=[i];do{for(t=o.reverse(),o=[];i=t.pop();)if(yield i,e=i.children)for(n=0,r=e.length;n<r;++n)o.push(e[n])}while(o.length)}},Object.create(Oo.prototype),function t(e){function n(t,n,r,i,o){!function(t,e,n,r,i,o){for(var s,a,l,c,u,h,d,f,p,m,g,y=[],v=e.children,b=0,_=0,w=v.length,E=e.value;b<w;){l=i-n,c=o-r;do{u=v[_++].value}while(!u&&_<w);for(h=d=u,g=u*u*(m=Math.max(c/l,l/c)/(E*t)),p=Math.max(d/g,g/h);_<w;++_){if(u+=a=v[_].value,a<h&&(h=a),a>d&&(d=a),g=u*u*m,(f=Math.max(d/g,g/h))>p){u-=a;break}p=f}y.push(s={value:u,dice:l<c,children:v.slice(b,_)}),s.dice?So(s,n,r,i,E?r+=c*u/E:o):Mo(s,n,r,E?n+=l*u/E:i,o),E-=u,b=_}}(e,t,n,r,i,o)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}((1+Math.sqrt(5))/2);const ko=Symbol("implicit");function Do(){var t=new ft,e=[],n=[],r=ko;function i(i){let o=t.get(i);if(void 0===o){if(r!==ko)return r;t.set(i,o=e.push(i)-1)}return n[o%n.length]}return i.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new ft;for(const r of n)t.has(r)||t.set(r,e.push(r)-1);return i},i.range=function(t){return arguments.length?(n=Array.from(t),i):n.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return Do(e,n).unknown(r)},Ao.apply(i,arguments),i}function Co(){var t,e,n=Do().unknown(void 0),r=n.domain,i=n.range,o=0,s=1,a=!1,l=0,c=0,u=.5;function h(){var n=r().length,h=s<o,d=h?s:o,f=h?o:s;t=(f-d)/Math.max(1,n-l+2*c),a&&(t=Math.floor(t)),d+=(f-d-t*(n-l))*u,e=t*(1-l),a&&(d=Math.round(d),e=Math.round(e));var p=function(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r<i;)o[r]=t+r*n;return o}(n).map((function(e){return d+t*e}));return i(h?p.reverse():p)}return delete n.unknown,n.domain=function(t){return arguments.length?(r(t),h()):r()},n.range=function(t){return arguments.length?([o,s]=t,o=+o,s=+s,h()):[o,s]},n.rangeRound=function(t){return[o,s]=t,o=+o,s=+s,a=!0,h()},n.bandwidth=function(){return e},n.step=function(){return t},n.round=function(t){return arguments.length?(a=!!t,h()):a},n.padding=function(t){return arguments.length?(l=Math.min(1,c=+t),h()):l},n.paddingInner=function(t){return arguments.length?(l=Math.min(1,t),h()):l},n.paddingOuter=function(t){return arguments.length?(c=+t,h()):c},n.align=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),h()):u},n.copy=function(){return Co(r(),[o,s]).round(a).paddingInner(l).paddingOuter(c).align(u)},Ao.apply(h(),arguments)}function Ro(t){return+t}var Lo=[0,1];function Po(t){return t}function Io(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:function(t){return function(){return t}}(isNaN(e)?NaN:.5)}function No(t,e,n){var r=t[0],i=t[1],o=e[0],s=e[1];return i<r?(r=Io(i,r),o=n(s,o)):(r=Io(r,i),o=n(o,s)),function(t){return o(r(t))}}function Bo(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),s=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<r;)i[s]=Io(t[s],t[s+1]),o[s]=n(e[s],e[s+1]);return function(e){var n=ut(t,e,1,r)-1;return o[n](i[n](e))}}function jo(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Uo(){var t,e,n,r,i,o,s=Lo,a=Lo,l=nr,c=Po;function u(){var t=Math.min(s.length,a.length);return c!==Po&&(c=function(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(s[0],s[t-1])),r=t>2?Bo:No,i=o=null,h}function h(e){return null==e||isNaN(e=+e)?n:(i||(i=r(s.map(t),a,l)))(t(c(e)))}return h.invert=function(n){return c(e((o||(o=r(a,s.map(t),Kn)))(n)))},h.domain=function(t){return arguments.length?(s=Array.from(t,Ro),u()):s.slice()},h.range=function(t){return arguments.length?(a=Array.from(t),u()):a.slice()},h.rangeRound=function(t){return a=Array.from(t),l=rr,u()},h.clamp=function(t){return arguments.length?(c=!!t||Po,u()):c!==Po},h.interpolate=function(t){return arguments.length?(l=t,u()):l},h.unknown=function(t){return arguments.length?(n=t,h):n},function(n,r){return t=n,e=r,u()}}function $o(){return Uo()(Po,Po)}function Fo(t){var e=t.domain;return t.ticks=function(t){var n=e();return xt(n[0],n[n.length-1],t??10)},t.tickFormat=function(t,n){var r=e();return function(t,e,n,r){var i,o=Ot(t,e,n);switch((r=qi(r??",f")).type){case"s":var s=Math.max(Math.abs(t),Math.abs(e));return null==r.precision&&!isNaN(i=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Wi(e)/3)))-Wi(Math.abs(t)))}(o,s))&&(r.precision=i),no(r,s);case"":case"e":case"g":case"p":case"r":null==r.precision&&!isNaN(i=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Wi(e)-Wi(t))+1}(o,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=i-("e"===r.type));break;case"f":case"%":null==r.precision&&!isNaN(i=function(t){return Math.max(0,-Wi(Math.abs(t)))}(o))&&(r.precision=i-2*("%"===r.type))}return eo(r)}(r[0],r[r.length-1],t??10,n)},t.nice=function(n){null==n&&(n=10);var r,i,o=e(),s=0,a=o.length-1,l=o[s],c=o[a],u=10;for(c<l&&(i=l,l=c,c=i,i=s,s=a,a=i);u-- >0;){if((i=Tt(l,c,n))===r)return o[s]=l,o[a]=c,e(o);if(i>0)l=Math.floor(l/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,c=Math.floor(c*i)/i}r=i}return t},t}function Ho(){var t=$o();return t.copy=function(){return jo(t,Ho())},Ao.apply(t,arguments),Fo(t)}function zo(t,e){var n,r=0,i=(t=t.slice()).length-1,o=t[r],s=t[i];return s<o&&(n=r,r=i,i=n,n=o,o=s,s=n),t[r]=e.floor(o),t[i]=e.ceil(s),t}function Vo(t){return Math.log(t)}function Go(t){return Math.exp(t)}function Wo(t){return-Math.log(-t)}function Yo(t){return-Math.exp(-t)}function Zo(t){return isFinite(t)?+("1e"+t):t<0?0:t}function qo(t){return(e,n)=>-t(-e,n)}function Xo(){const t=function(t){const e=t(Vo,Go),n=e.domain;let r,i,o=10;function s(){return r=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}(o),i=function(t){return 10===t?Zo:t===Math.E?Math.exp:e=>Math.pow(t,e)}(o),n()[0]<0?(r=qo(r),i=qo(i),t(Wo,Yo)):t(Vo,Go),e}return e.base=function(t){return arguments.length?(o=+t,s()):o},e.domain=function(t){return arguments.length?(n(t),s()):n()},e.ticks=t=>{const e=n();let s=e[0],a=e[e.length-1];const l=a<s;l&&([s,a]=[a,s]);let c,u,h=r(s),d=r(a);const f=null==t?10:+t;let p=[];if(!(o%1)&&d-h<f){if(h=Math.floor(h),d=Math.ceil(d),s>0){for(;h<=d;++h)for(c=1;c<o;++c)if(u=h<0?c/i(-h):c*i(h),!(u<s)){if(u>a)break;p.push(u)}}else for(;h<=d;++h)for(c=o-1;c>=1;--c)if(u=h>0?c/i(-h):c*i(h),!(u<s)){if(u>a)break;p.push(u)}2*p.length<f&&(p=xt(s,a,f))}else p=xt(h,d,Math.min(d-h,f)).map(i);return l?p.reverse():p},e.tickFormat=(t,n)=>{if(null==t&&(t=10),null==n&&(n=10===o?"s":","),"function"!=typeof n&&(!(o%1)&&null==(n=qi(n)).precision&&(n.trim=!0),n=eo(n)),t===1/0)return n;const s=Math.max(1,o*t/e.ticks().length);return t=>{let e=t/i(Math.round(r(t)));return e*o<o-.5&&(e*=o),e<=s?n(t):""}},e.nice=()=>n(zo(n(),{floor:t=>i(Math.floor(r(t))),ceil:t=>i(Math.ceil(r(t)))})),e}(Uo()).domain([1,10]);return t.copy=()=>jo(t,Xo()).base(t.base()),Ao.apply(t,arguments),t}const Ko=new Date,Qo=new Date;function Jo(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=e=>(t(e=new Date(+e)),e),i.ceil=n=>(t(n=new Date(n-1)),e(n,1),t(n),n),i.round=t=>{const e=i(t),n=i.ceil(t);return t-e<n-t?e:n},i.offset=(t,n)=>(e(t=new Date(+t),null==n?1:Math.floor(n)),t),i.range=(n,r,o)=>{const s=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return s;let a;do{s.push(a=new Date(+n)),e(n,o),t(n)}while(a<n&&n<r);return s},i.filter=n=>Jo((e=>{if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),((t,r)=>{if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););})),n&&(i.count=(e,r)=>(Ko.setTime(+e),Qo.setTime(+r),t(Ko),t(Qo),Math.floor(n(Ko,Qo))),i.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?e=>r(e)%t==0:e=>i.count(0,e)%t==0):i:null)),i}const ts=Jo((()=>{}),((t,e)=>{t.setTime(+t+e)}),((t,e)=>e-t));ts.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?Jo((e=>{e.setTime(Math.floor(e/t)*t)}),((e,n)=>{e.setTime(+e+n*t)}),((e,n)=>(n-e)/t)):ts:null),ts.range;const es=1e3,ns=6e4,rs=60*ns,is=24*rs,os=7*is,ss=30*is,as=365*is,ls=Jo((t=>{t.setTime(t-t.getMilliseconds())}),((t,e)=>{t.setTime(+t+e*es)}),((t,e)=>(e-t)/es),(t=>t.getUTCSeconds()));ls.range;const cs=Jo((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*es)}),((t,e)=>{t.setTime(+t+e*ns)}),((t,e)=>(e-t)/ns),(t=>t.getMinutes()));cs.range;const us=Jo((t=>{t.setUTCSeconds(0,0)}),((t,e)=>{t.setTime(+t+e*ns)}),((t,e)=>(e-t)/ns),(t=>t.getUTCMinutes()));us.range;const hs=Jo((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*es-t.getMinutes()*ns)}),((t,e)=>{t.setTime(+t+e*rs)}),((t,e)=>(e-t)/rs),(t=>t.getHours()));hs.range;const ds=Jo((t=>{t.setUTCMinutes(0,0,0)}),((t,e)=>{t.setTime(+t+e*rs)}),((t,e)=>(e-t)/rs),(t=>t.getUTCHours()));ds.range;const fs=Jo((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ns)/is),(t=>t.getDate()-1));fs.range;const ps=Jo((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/is),(t=>t.getUTCDate()-1));ps.range;const ms=Jo((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/is),(t=>Math.floor(t/is)));function gs(t){return Jo((e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),((t,e)=>{t.setDate(t.getDate()+7*e)}),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ns)/os))}ms.range;const ys=gs(0),vs=gs(1),bs=gs(2),_s=gs(3),ws=gs(4),Es=gs(5),xs=gs(6);function Ts(t){return Jo((e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)}),((t,e)=>(e-t)/os))}ys.range,vs.range,bs.range,_s.range,ws.range,Es.range,xs.range;const Os=Ts(0),Ss=Ts(1),Ms=Ts(2),As=Ts(3),ks=Ts(4),Ds=Ts(5),Cs=Ts(6);Os.range,Ss.range,Ms.range,As.range,ks.range,Ds.range,Cs.range;const Rs=Jo((t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e)=>{t.setMonth(t.getMonth()+e)}),((t,e)=>e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())),(t=>t.getMonth()));Rs.range;const Ls=Jo((t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)}),((t,e)=>e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())),(t=>t.getUTCMonth()));Ls.range;const Ps=Jo((t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e)=>{t.setFullYear(t.getFullYear()+e)}),((t,e)=>e.getFullYear()-t.getFullYear()),(t=>t.getFullYear()));Ps.every=t=>isFinite(t=Math.floor(t))&&t>0?Jo((e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,n)=>{e.setFullYear(e.getFullYear()+n*t)})):null,Ps.range;const Is=Jo((t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)}),((t,e)=>e.getUTCFullYear()-t.getUTCFullYear()),(t=>t.getUTCFullYear()));Is.every=t=>isFinite(t=Math.floor(t))&&t>0?Jo((e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null,Is.range;const[Ns,Bs]=function(t,e,n,r,i,o){const s=[[ls,1,es],[ls,5,5e3],[ls,15,15e3],[ls,30,3e4],[o,1,ns],[o,5,5*ns],[o,15,15*ns],[o,30,30*ns],[i,1,rs],[i,3,3*rs],[i,6,6*rs],[i,12,12*rs],[r,1,is],[r,2,2*is],[n,1,os],[e,1,ss],[e,3,3*ss],[t,1,as]];function a(e,n,r){const i=Math.abs(n-e)/r,o=at((([,,t])=>t)).right(s,i);if(o===s.length)return t.every(Ot(e/as,n/as,r));if(0===o)return ts.every(Math.max(Ot(e,n,r),1));const[a,l]=s[i/s[o-1][2]<s[o][2]/i?o-1:o];return a.every(l)}return[function(t,e,n){const r=e<t;r&&([t,e]=[e,t]);const i=n&&"function"==typeof n.range?n:a(t,e,n),o=i?i.range(t,+e+1):[];return r?o.reverse():o},a]}(Ps,Rs,ys,fs,hs,cs);function js(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Us(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function $s(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}var Fs,Hs,zs={"-":"",_:" ",0:"0"},Vs=/^\s*\d+/,Gs=/^%/,Ws=/[\\^$*+?|[\]().{}]/g;function Ys(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(e)+i:i)}function Zs(t){return t.replace(Ws,"\\$&")}function qs(t){return new RegExp("^(?:"+t.map(Zs).join("|")+")","i")}function Xs(t){return new Map(t.map(((t,e)=>[t.toLowerCase(),e])))}function Ks(t,e,n){var r=Vs.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Qs(t,e,n){var r=Vs.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function Js(t,e,n){var r=Vs.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function ta(t,e,n){var r=Vs.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function ea(t,e,n){var r=Vs.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function na(t,e,n){var r=Vs.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function ra(t,e,n){var r=Vs.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function ia(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function oa(t,e,n){var r=Vs.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function sa(t,e,n){var r=Vs.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function aa(t,e,n){var r=Vs.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function la(t,e,n){var r=Vs.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function ca(t,e,n){var r=Vs.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function ua(t,e,n){var r=Vs.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function ha(t,e,n){var r=Vs.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function da(t,e,n){var r=Vs.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function fa(t,e,n){var r=Vs.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function pa(t,e,n){var r=Gs.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function ma(t,e,n){var r=Vs.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function ga(t,e,n){var r=Vs.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function ya(t,e){return Ys(t.getDate(),e,2)}function va(t,e){return Ys(t.getHours(),e,2)}function ba(t,e){return Ys(t.getHours()%12||12,e,2)}function _a(t,e){return Ys(1+fs.count(Ps(t),t),e,3)}function wa(t,e){return Ys(t.getMilliseconds(),e,3)}function Ea(t,e){return wa(t,e)+"000"}function xa(t,e){return Ys(t.getMonth()+1,e,2)}function Ta(t,e){return Ys(t.getMinutes(),e,2)}function Oa(t,e){return Ys(t.getSeconds(),e,2)}function Sa(t){var e=t.getDay();return 0===e?7:e}function Ma(t,e){return Ys(ys.count(Ps(t)-1,t),e,2)}function Aa(t){var e=t.getDay();return e>=4||0===e?ws(t):ws.ceil(t)}function ka(t,e){return t=Aa(t),Ys(ws.count(Ps(t),t)+(4===Ps(t).getDay()),e,2)}function Da(t){return t.getDay()}function Ca(t,e){return Ys(vs.count(Ps(t)-1,t),e,2)}function Ra(t,e){return Ys(t.getFullYear()%100,e,2)}function La(t,e){return Ys((t=Aa(t)).getFullYear()%100,e,2)}function Pa(t,e){return Ys(t.getFullYear()%1e4,e,4)}function Ia(t,e){var n=t.getDay();return Ys((t=n>=4||0===n?ws(t):ws.ceil(t)).getFullYear()%1e4,e,4)}function Na(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Ys(e/60|0,"0",2)+Ys(e%60,"0",2)}function Ba(t,e){return Ys(t.getUTCDate(),e,2)}function ja(t,e){return Ys(t.getUTCHours(),e,2)}function Ua(t,e){return Ys(t.getUTCHours()%12||12,e,2)}function $a(t,e){return Ys(1+ps.count(Is(t),t),e,3)}function Fa(t,e){return Ys(t.getUTCMilliseconds(),e,3)}function Ha(t,e){return Fa(t,e)+"000"}function za(t,e){return Ys(t.getUTCMonth()+1,e,2)}function Va(t,e){return Ys(t.getUTCMinutes(),e,2)}function Ga(t,e){return Ys(t.getUTCSeconds(),e,2)}function Wa(t){var e=t.getUTCDay();return 0===e?7:e}function Ya(t,e){return Ys(Os.count(Is(t)-1,t),e,2)}function Za(t){var e=t.getUTCDay();return e>=4||0===e?ks(t):ks.ceil(t)}function qa(t,e){return t=Za(t),Ys(ks.count(Is(t),t)+(4===Is(t).getUTCDay()),e,2)}function Xa(t){return t.getUTCDay()}function Ka(t,e){return Ys(Ss.count(Is(t)-1,t),e,2)}function Qa(t,e){return Ys(t.getUTCFullYear()%100,e,2)}function Ja(t,e){return Ys((t=Za(t)).getUTCFullYear()%100,e,2)}function tl(t,e){return Ys(t.getUTCFullYear()%1e4,e,4)}function el(t,e){var n=t.getUTCDay();return Ys((t=n>=4||0===n?ks(t):ks.ceil(t)).getUTCFullYear()%1e4,e,4)}function nl(){return"+0000"}function rl(){return"%"}function il(t){return+t}function ol(t){return Math.floor(+t/1e3)}function sl(t){return new Date(t)}function al(t){return t instanceof Date?+t:+new Date(+t)}function ll(t,e,n,r,i,o,s,a,l,c){var u=$o(),h=u.invert,d=u.domain,f=c(".%L"),p=c(":%S"),m=c("%I:%M"),g=c("%I %p"),y=c("%a %d"),v=c("%b %d"),b=c("%B"),_=c("%Y");function w(t){return(l(t)<t?f:a(t)<t?p:s(t)<t?m:o(t)<t?g:r(t)<t?i(t)<t?y:v:n(t)<t?b:_)(t)}return u.invert=function(t){return new Date(h(t))},u.domain=function(t){return arguments.length?d(Array.from(t,al)):d().map(sl)},u.ticks=function(e){var n=d();return t(n[0],n[n.length-1],e??10)},u.tickFormat=function(t,e){return null==e?w:c(e)},u.nice=function(t){var n=d();return(!t||"function"!=typeof t.range)&&(t=e(n[0],n[n.length-1],t??10)),t?d(zo(n,t)):u},u.copy=function(){return jo(u,ll(t,e,n,r,i,o,s,a,l,c))},u}function cl(){return Ao.apply(ll(Ns,Bs,Ps,Rs,ys,fs,hs,cs,ls,Hs).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function ul(t){return function(){return t}}Fs=function(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,o=t.days,s=t.shortDays,a=t.months,l=t.shortMonths,c=qs(i),u=Xs(i),h=qs(o),d=Xs(o),f=qs(s),p=Xs(s),m=qs(a),g=Xs(a),y=qs(l),v=Xs(l),b={a:function(t){return s[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return a[t.getMonth()]},c:null,d:ya,e:ya,f:Ea,g:La,G:Ia,H:va,I:ba,j:_a,L:wa,m:xa,M:Ta,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:il,s:ol,S:Oa,u:Sa,U:Ma,V:ka,w:Da,W:Ca,x:null,X:null,y:Ra,Y:Pa,Z:Na,"%":rl},_={a:function(t){return s[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return a[t.getUTCMonth()]},c:null,d:Ba,e:Ba,f:Ha,g:Ja,G:el,H:ja,I:Ua,j:$a,L:Fa,m:za,M:Va,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:il,s:ol,S:Ga,u:Wa,U:Ya,V:qa,w:Xa,W:Ka,x:null,X:null,y:Qa,Y:tl,Z:nl,"%":rl},w={a:function(t,e,n){var r=f.exec(e.slice(n));return r?(t.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(t,e,n){var r=h.exec(e.slice(n));return r?(t.w=d.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(t,e,n){var r=y.exec(e.slice(n));return r?(t.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(t,e,n){var r=m.exec(e.slice(n));return r?(t.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(t,n,r){return T(t,e,n,r)},d:aa,e:aa,f:fa,g:ra,G:na,H:ca,I:ca,j:la,L:da,m:sa,M:ua,p:function(t,e,n){var r=c.exec(e.slice(n));return r?(t.p=u.get(r[0].toLowerCase()),n+r[0].length):-1},q:oa,Q:ma,s:ga,S:ha,u:Qs,U:Js,V:ta,w:Ks,W:ea,x:function(t,e,r){return T(t,n,e,r)},X:function(t,e,n){return T(t,r,e,n)},y:ra,Y:na,Z:ia,"%":pa};function E(t,e){return function(n){var r,i,o,s=[],a=-1,l=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++a<c;)37===t.charCodeAt(a)&&(s.push(t.slice(l,a)),null!=(i=zs[r=t.charAt(++a)])?r=t.charAt(++a):i="e"===r?" ":"0",(o=e[r])&&(r=o(n,i)),s.push(r),l=a+1);return s.push(t.slice(l,a)),s.join("")}}function x(t,e){return function(n){var r,i,o=$s(1900,void 0,1);if(T(o,t,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(e&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=Us($s(o.y,0,1))).getUTCDay(),r=i>4||0===i?Ss.ceil(r):Ss(r),r=ps.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=js($s(o.y,0,1))).getDay(),r=i>4||0===i?vs.ceil(r):vs(r),r=fs.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?Us($s(o.y,0,1)).getUTCDay():js($s(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Us(o)):js(o)}}function T(t,e,n,r){for(var i,o,s=0,a=e.length,l=n.length;s<a;){if(r>=l)return-1;if(37===(i=e.charCodeAt(s++))){if(i=e.charAt(s++),!(o=w[i in zs?e.charAt(s++):i])||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=E(n,b),b.X=E(r,b),b.c=E(e,b),_.x=E(n,_),_.X=E(r,_),_.c=E(e,_),{format:function(t){var e=E(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=x(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=E(t+="",_);return e.toString=function(){return t},e},utcParse:function(t){var e=x(t+="",!0);return e.toString=function(){return t},e}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),Hs=Fs.format,Fs.parse,Fs.utcFormat,Fs.utcParse;const hl=Math.abs,dl=Math.atan2,fl=Math.cos,pl=Math.max,ml=Math.min,gl=Math.sin,yl=Math.sqrt,vl=1e-12,bl=Math.PI,_l=bl/2,wl=2*bl;function El(t){return t>=1?_l:t<=-1?-_l:Math.asin(t)}function xl(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new Vi(e)}function Tl(t){return t.innerRadius}function Ol(t){return t.outerRadius}function Sl(t){return t.startAngle}function Ml(t){return t.endAngle}function Al(t){return t&&t.padAngle}function kl(t,e,n,r,i,o,s){var a=t-n,l=e-r,c=(s?o:-o)/yl(a*a+l*l),u=c*l,h=-c*a,d=t+u,f=e+h,p=n+u,m=r+h,g=(d+p)/2,y=(f+m)/2,v=p-d,b=m-f,_=v*v+b*b,w=i-o,E=d*m-p*f,x=(b<0?-1:1)*yl(pl(0,w*w*_-E*E)),T=(E*b-v*x)/_,O=(-E*v-b*x)/_,S=(E*b+v*x)/_,M=(-E*v+b*x)/_,A=T-g,k=O-y,D=S-g,C=M-y;return A*A+k*k>D*D+C*C&&(T=S,O=M),{cx:T,cy:O,x01:-u,y01:-h,x11:T*(i/w-1),y11:O*(i/w-1)}}function Dl(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Cl(t){this._context=t}function Rl(t){return new Cl(t)}function Ll(t){return t[0]}function Pl(t){return t[1]}function Il(t,e){var n=ul(!0),r=null,i=Rl,o=null,s=xl(a);function a(a){var l,c,u,h=(a=Dl(a)).length,d=!1;for(null==r&&(o=i(u=s())),l=0;l<=h;++l)!(l<h&&n(c=a[l],l,a))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+t(c,l,a),+e(c,l,a));if(u)return o=null,u+""||null}return t="function"==typeof t?t:void 0===t?Ll:ul(t),e="function"==typeof e?e:void 0===e?Pl:ul(e),a.x=function(e){return arguments.length?(t="function"==typeof e?e:ul(+e),a):t},a.y=function(t){return arguments.length?(e="function"==typeof t?t:ul(+t),a):e},a.defined=function(t){return arguments.length?(n="function"==typeof t?t:ul(!!t),a):n},a.curve=function(t){return arguments.length?(i=t,null!=r&&(o=i(r)),a):i},a.context=function(t){return arguments.length?(null==t?r=o=null:o=i(r=t),a):r},a}function Nl(t,e,n){var r=null,i=ul(!0),o=null,s=Rl,a=null,l=xl(c);function c(c){var u,h,d,f,p,m=(c=Dl(c)).length,g=!1,y=new Array(m),v=new Array(m);for(null==o&&(a=s(p=l())),u=0;u<=m;++u){if(!(u<m&&i(f=c[u],u,c))===g)if(g=!g)h=u,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),d=u-1;d>=h;--d)a.point(y[d],v[d]);a.lineEnd(),a.areaEnd()}g&&(y[u]=+t(f,u,c),v[u]=+e(f,u,c),a.point(r?+r(f,u,c):y[u],n?+n(f,u,c):v[u]))}if(p)return a=null,p+""||null}function u(){return Il().defined(i).curve(s).context(o)}return t="function"==typeof t?t:void 0===t?Ll:ul(+t),e="function"==typeof e?e:ul(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?Pl:ul(+n),c.x=function(e){return arguments.length?(t="function"==typeof e?e:ul(+e),r=null,c):t},c.x0=function(e){return arguments.length?(t="function"==typeof e?e:ul(+e),c):t},c.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:ul(+t),c):r},c.y=function(t){return arguments.length?(e="function"==typeof t?t:ul(+t),n=null,c):e},c.y0=function(t){return arguments.length?(e="function"==typeof t?t:ul(+t),c):e},c.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:ul(+t),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(r).y(e)},c.defined=function(t){return arguments.length?(i="function"==typeof t?t:ul(!!t),c):i},c.curve=function(t){return arguments.length?(s=t,null!=o&&(a=s(o)),c):s},c.context=function(t){return arguments.length?(null==t?o=a=null:a=s(o=t),c):o},c}function Bl(t){this._curve=t}function jl(){}function Ul(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function $l(t){this._context=t}function Fl(t){return new $l(t)}function Hl(t){this._context=t}function zl(t){return new Hl(t)}function Vl(t){this._context=t}function Gl(t){return new Vl(t)}function Wl(t,e){this._basis=new $l(t),this._beta=e}Array.prototype.slice,Cl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}},function(t){function e(e){return new Bl(t(e))}e._curve=t}(Rl),Bl.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}},$l.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Ul(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ul(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Hl.prototype={areaStart:jl,areaEnd:jl,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Ul(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Vl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Ul(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Wl.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],o=e[0],s=t[n]-i,a=e[n]-o,l=-1;++l<=n;)r=l/n,this._basis.point(this._beta*t[l]+(1-this._beta)*(i+r*s),this._beta*e[l]+(1-this._beta)*(o+r*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const Yl=function t(e){function n(t){return 1===e?new $l(t):new Wl(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function Zl(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function ql(t,e){this._context=t,this._k=(1-e)/6}ql.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Zl(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Zl(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Xl=function t(e){function n(t){return new ql(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Kl(t,e){this._context=t,this._k=(1-e)/6}Kl.prototype={areaStart:jl,areaEnd:jl,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Zl(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Ql=function t(e){function n(t){return new Kl(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Jl(t,e){this._context=t,this._k=(1-e)/6}Jl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Zl(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const tc=function t(e){function n(t){return new Jl(t,e)}return n.tension=function(e){return t(+e)},n}(0);function ec(t,e,n){var r=t._x1,i=t._y1,o=t._x2,s=t._y2;if(t._l01_a>vl){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>vl){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-e*t._l12_2a)/u,s=(s*c+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(r,i,o,s,t._x2,t._y2)}function nc(t,e){this._context=t,this._alpha=e}nc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:ec(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const rc=function t(e){function n(t){return e?new nc(t,e):new ql(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function ic(t,e){this._context=t,this._alpha=e}ic.prototype={areaStart:jl,areaEnd:jl,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:ec(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const oc=function t(e){function n(t){return e?new ic(t,e):new Kl(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function sc(t,e){this._context=t,this._alpha=e}sc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ec(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const ac=function t(e){function n(t){return e?new sc(t,e):new Jl(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function lc(t){this._context=t}function cc(t){return new lc(t)}function uc(t){return t<0?-1:1}function hc(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),s=(n-t._y1)/(i||r<0&&-0),a=(o*i+s*r)/(r+i);return(uc(o)+uc(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function dc(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function fc(t,e,n){var r=t._x0,i=t._y0,o=t._x1,s=t._y1,a=(o-r)/3;t._context.bezierCurveTo(r+a,i+a*e,o-a,s-a*n,o,s)}function pc(t){this._context=t}function mc(t){this._context=new gc(t)}function gc(t){this._context=t}function yc(t){return new pc(t)}function vc(t){return new mc(t)}function bc(t){this._context=t}function _c(t){var e,n,r=t.length-1,i=new Array(r),o=new Array(r),s=new Array(r);for(i[0]=0,o[0]=2,s[0]=t[0]+2*t[1],e=1;e<r-1;++e)i[e]=1,o[e]=4,s[e]=4*t[e]+2*t[e+1];for(i[r-1]=2,o[r-1]=7,s[r-1]=8*t[r-1]+t[r],e=1;e<r;++e)n=i[e]/o[e-1],o[e]-=n,s[e]-=n*s[e-1];for(i[r-1]=s[r-1]/o[r-1],e=r-2;e>=0;--e)i[e]=(s[e]-i[e+1])/o[e];for(o[r-1]=(t[r]+i[r-1])/2,e=0;e<r-1;++e)o[e]=2*t[e+1]-i[e+1];return[i,o]}function wc(t){return new bc(t)}function Ec(t,e){this._context=t,this._t=e}function xc(t){return new Ec(t,.5)}function Tc(t){return new Ec(t,0)}function Oc(t){return new Ec(t,1)}function Sc(t,e){if((i=t.length)>1)for(var n,r,i,o=1,s=t[e[0]],a=s.length;o<i;++o)for(r=s,s=t[e[o]],n=0;n<a;++n)s[n][1]+=s[n][0]=isNaN(r[n][1])?r[n][0]:r[n][1]}function Mc(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n}function Ac(t,e){return t[e]}function kc(t){const e=[];return e.key=t,e}function Dc(){var t=ul([]),e=Mc,n=Sc,r=Ac;function i(i){var o,s,a=Array.from(t.apply(this,arguments),kc),l=a.length,c=-1;for(const t of i)for(o=0,++c;o<l;++o)(a[o][c]=[0,+r(t,a[o].key,c,i)]).data=t;for(o=0,s=Dl(e(a));o<l;++o)a[s[o]].index=o;return n(a,s),a}return i.keys=function(e){return arguments.length?(t="function"==typeof e?e:ul(Array.from(e)),i):t},i.value=function(t){return arguments.length?(r="function"==typeof t?t:ul(+t),i):r},i.order=function(t){return arguments.length?(e=null==t?Mc:"function"==typeof t?t:ul(Array.from(t)),i):e},i.offset=function(t){return arguments.length?(n=t??Sc,i):n},i}function Cc(t,e){if((a=t.length)>0)for(var n,r,i,o,s,a,l=0,c=t[e[0]].length;l<c;++l)for(o=s=0,n=0;n<a;++n)(i=(r=t[e[n]][l])[1]-r[0])>0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=s,r[0]=s+=i):(r[0]=0,r[1]=i)}function Rc(t,e,n){this.k=t,this.x=e,this.y=n}function Lc(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}function Pc(t){return(e,n)=>{let r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,i=null!=n&&n.width?String(n.width):e;r=t.formattingValues[i]||t.formattingValues[e]}else{const e=t.defaultWidth,i=null!=n&&n.width?String(n.width):t.defaultWidth;r=t.values[i]||t.values[e]}return r[t.argumentCallback?t.argumentCallback(e):e]}}function Ic(t){return(e,n={})=>{const r=n.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(i);if(!o)return null;const s=o[0],a=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?function(t){for(let e=0;e<t.length;e++)if(t[e].test(s))return e}(a):function(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&t[e].test(s))return e}(a);let c;return c=t.valueCallback?t.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c,{value:c,rest:e.slice(s.length)}}}function Nc(t){const e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new t.constructor(+t):"number"==typeof t||"[object Number]"===e||"string"==typeof t||"[object String]"===e?new Date(t):new Date(NaN)}lc.prototype={areaStart:jl,areaEnd:jl,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},pc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:fc(this,this._t0,dc(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,fc(this,dc(this,n=hc(this,t,e)),n);break;default:fc(this,this._t0,n=hc(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(mc.prototype=Object.create(pc.prototype)).point=function(t,e){pc.prototype.point.call(this,e,t)},gc.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}},bc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var r=_c(t),i=_c(e),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],t[s],e[s]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}},Ec.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}},Rc.prototype={constructor:Rc,scale:function(t){return 1===t?this:new Rc(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new Rc(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},Rc.prototype;let Bc={};function jc(){return Bc}function Uc(t,e){var n,r,i,o;const s=jc(),a=(null==e?void 0:e.weekStartsOn)??(null==(r=null==(n=null==e?void 0:e.locale)?void 0:n.options)?void 0:r.weekStartsOn)??s.weekStartsOn??(null==(o=null==(i=s.locale)?void 0:i.options)?void 0:o.weekStartsOn)??0,l=Nc(t),c=l.getDay(),u=(c<a?7:0)+c-a;return l.setDate(l.getDate()-u),l.setHours(0,0,0,0),l}const $c={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"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},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"}},Fc={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Hc={ordinalNumber:(t,e)=>{const 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:Pc({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Pc({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:t=>t-1}),month:Pc({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:Pc({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:Pc({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"})},zc={ordinalNumber:function(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const i=r[0],o=e.match(t.parsePattern);if(!o)return null;let s=t.valueCallback?t.valueCallback(o[0]):o[0];return s=n.valueCallback?n.valueCallback(s):s,{value:s,rest:e.slice(i.length)}}}({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)}),era:Ic({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:Ic({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:t=>t+1}),month:Ic({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:Ic({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:Ic({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"})},Vc={code:"en-US",formatDistance:(t,e,n)=>{let r;const i=$c[t];return r="string"==typeof i?i:1===e?i.one:i.other.replace("{{count}}",e.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:{date:Lc({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Lc({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:Lc({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},formatRelative:(t,e,n,r)=>Fc[t],localize:Hc,match:zc,options:{weekStartsOn:0,firstWeekContainsDate:1}},Gc="object"==typeof global&&global&&global.Object===Object&&global;var Wc="object"==typeof self&&self&&self.Object===Object&&self;const Yc=Gc||Wc||Function("return this")(),Zc=Yc.Symbol;var qc=Object.prototype,Xc=qc.hasOwnProperty,Kc=qc.toString,Qc=Zc?Zc.toStringTag:void 0,Jc=Object.prototype.toString,tu="[object Null]",eu="[object Undefined]",nu=Zc?Zc.toStringTag:void 0;function ru(t){return null==t?void 0===t?eu:tu:nu&&nu in Object(t)?function(t){var e=Xc.call(t,Qc),n=t[Qc];try{t[Qc]=void 0;var r=!0}catch{}var i=Kc.call(t);return r&&(e?t[Qc]=n:delete t[Qc]),i}(t):function(t){return Jc.call(t)}(t)}function iu(t){return null!=t&&"object"==typeof t}var ou="[object Symbol]";function su(t){return"symbol"==typeof t||iu(t)&&ru(t)==ou}const au=Array.isArray;var lu=1/0,cu=Zc?Zc.prototype:void 0,uu=cu?cu.toString:void 0;function hu(t){if("string"==typeof t)return t;if(au(t))return function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}(t,hu)+"";if(su(t))return uu?uu.call(t):"";var e=t+"";return"0"==e&&1/t==-lu?"-0":e}function du(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function fu(t){return t}var pu="[object AsyncFunction]",mu="[object Function]",gu="[object GeneratorFunction]",yu="[object Proxy]";function vu(t){if(!du(t))return!1;var e=ru(t);return e==mu||e==gu||e==pu||e==yu}const bu=Yc["__core-js_shared__"];var _u=function(){var t=/[^.]+$/.exec(bu&&bu.keys&&bu.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),wu=Function.prototype.toString;function Eu(t){if(null!=t){try{return wu.call(t)}catch{}try{return t+""}catch{}}return""}var xu=/^\[object .+?Constructor\]$/,Tu=Function.prototype,Ou=Object.prototype,Su=Tu.toString,Mu=Ou.hasOwnProperty,Au=RegExp("^"+Su.call(Mu).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ku(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!du(t)||function(t){return!!_u&&_u in t}(t))&&(vu(t)?Au:xu).test(Eu(t))}(n)?n:void 0}const Du=ku(Yc,"WeakMap");var Cu=Object.create,Ru=function(){function t(){}return function(e){if(!du(e))return{};if(Cu)return Cu(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();const Lu=Ru;function Pu(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var Iu=Date.now;function Nu(t){return function(){return t}}var Bu=function(){try{var t=ku(Object,"defineProperty");return t({},"",{}),t}catch{}}();const ju=Bu;var Uu=ju?function(t,e){return ju(t,"toString",{configurable:!0,enumerable:!1,value:Nu(e),writable:!0})}:fu,$u=function(t){var e=0,n=0;return function(){var r=Iu(),i=16-(r-n);if(n=r,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Uu);const Fu=$u;function Hu(t){return t!=t}function zu(t,e){return!(null==t||!t.length)&&function(t,e){return e==e?function(t,e){for(var n=-1,r=t.length;++n<r;)if(t[n]===e)return n;return-1}(t,e):function(t,e){for(var n=t.length,r=-1;++r<n;)if(e(t[r],r,t))return r;return-1}(t,Hu)}(t,e)>-1}var Vu=9007199254740991,Gu=/^(?:0|[1-9]\d*)$/;function Wu(t,e){var n=typeof t;return!!(e=e??Vu)&&("number"==n||"symbol"!=n&&Gu.test(t))&&t>-1&&t%1==0&&t<e}function Yu(t,e,n){"__proto__"==e&&ju?ju(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Zu(t,e){return t===e||t!=t&&e!=e}var qu=Object.prototype.hasOwnProperty;function Xu(t,e,n){var r=t[e];(!qu.call(t,e)||!Zu(r,n)||void 0===n&&!(e in t))&&Yu(t,e,n)}function Ku(t,e,n,r){var i=!n;n||(n={});for(var o=-1,s=e.length;++o<s;){var a=e[o],l=r?r(n[a],t[a],a,n,t):void 0;void 0===l&&(l=t[a]),i?Yu(n,a,l):Xu(n,a,l)}return n}var Qu=Math.max;function Ju(t,e){return Fu(function(t,e,n){return e=Qu(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=Qu(r.length-e,0),s=Array(o);++i<o;)s[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=n(s),function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}(t,this,a)}}(t,e,fu),t+"")}var th=9007199254740991;function eh(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=th}function nh(t){return null!=t&&eh(t.length)&&!vu(t)}function rh(t,e,n){if(!du(n))return!1;var r=typeof e;return!!("number"==r?nh(n)&&Wu(e,n.length):"string"==r&&e in n)&&Zu(n[e],t)}var ih=Object.prototype;function oh(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||ih)}function sh(t){return iu(t)&&"[object Arguments]"==ru(t)}var ah=Object.prototype,lh=ah.hasOwnProperty,ch=ah.propertyIsEnumerable,uh=sh(function(){return arguments}())?sh:function(t){return iu(t)&&lh.call(t,"callee")&&!ch.call(t,"callee")};const hh=uh;var dh="object"==typeof exports&&exports&&!exports.nodeType&&exports,fh=dh&&"object"==typeof module&&module&&!module.nodeType&&module,ph=fh&&fh.exports===dh?Yc.Buffer:void 0;const mh=(ph?ph.isBuffer:void 0)||function(){return!1};var gh={};function yh(t){return function(e){return t(e)}}gh["[object Float32Array]"]=gh["[object Float64Array]"]=gh["[object Int8Array]"]=gh["[object Int16Array]"]=gh["[object Int32Array]"]=gh["[object Uint8Array]"]=gh["[object Uint8ClampedArray]"]=gh["[object Uint16Array]"]=gh["[object Uint32Array]"]=!0,gh["[object Arguments]"]=gh["[object Array]"]=gh["[object ArrayBuffer]"]=gh["[object Boolean]"]=gh["[object DataView]"]=gh["[object Date]"]=gh["[object Error]"]=gh["[object Function]"]=gh["[object Map]"]=gh["[object Number]"]=gh["[object Object]"]=gh["[object RegExp]"]=gh["[object Set]"]=gh["[object String]"]=gh["[object WeakMap]"]=!1;var vh="object"==typeof exports&&exports&&!exports.nodeType&&exports,bh=vh&&"object"==typeof module&&module&&!module.nodeType&&module,_h=bh&&bh.exports===vh&&Gc.process;const wh=function(){try{return bh&&bh.require&&bh.require("util").types||_h&&_h.binding&&_h.binding("util")}catch{}}();var Eh=wh&&wh.isTypedArray,xh=Eh?yh(Eh):function(t){return iu(t)&&eh(t.length)&&!!gh[ru(t)]};const Th=xh;var Oh=Object.prototype.hasOwnProperty;function Sh(t,e){var n=au(t),r=!n&&hh(t),i=!n&&!r&&mh(t),o=!n&&!r&&!i&&Th(t),s=n||r||i||o,a=s?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],l=a.length;for(var c in t)(e||Oh.call(t,c))&&(!s||!("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Wu(c,l)))&&a.push(c);return a}function Mh(t,e){return function(n){return t(e(n))}}const Ah=Mh(Object.keys,Object);var kh=Object.prototype.hasOwnProperty;function Dh(t){if(!oh(t))return Ah(t);var e=[];for(var n in Object(t))kh.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Ch(t){return nh(t)?Sh(t):Dh(t)}var Rh=Object.prototype.hasOwnProperty;function Lh(t){return nh(t)?Sh(t,!0):function(t){if(!du(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=oh(t),n=[];for(var r in t)"constructor"==r&&(e||!Rh.call(t,r))||n.push(r);return n}(t)}var Ph=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ih=/^\w*$/;function Nh(t,e){if(au(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!su(t))||Ih.test(t)||!Ph.test(t)||null!=e&&t in Object(e)}const Bh=ku(Object,"create");var jh=Object.prototype.hasOwnProperty,Uh=Object.prototype.hasOwnProperty;function $h(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Fh(t,e){for(var n=t.length;n--;)if(Zu(t[n][0],e))return n;return-1}$h.prototype.clear=function(){this.__data__=Bh?Bh(null):{},this.size=0},$h.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},$h.prototype.get=function(t){var e=this.__data__;if(Bh){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return jh.call(e,t)?e[t]:void 0},$h.prototype.has=function(t){var e=this.__data__;return Bh?void 0!==e[t]:Uh.call(e,t)},$h.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Bh&&void 0===e?"__lodash_hash_undefined__":e,this};var Hh=Array.prototype.splice;function zh(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}zh.prototype.clear=function(){this.__data__=[],this.size=0},zh.prototype.delete=function(t){var e=this.__data__,n=Fh(e,t);return!(n<0||(n==e.length-1?e.pop():Hh.call(e,n,1),--this.size,0))},zh.prototype.get=function(t){var e=this.__data__,n=Fh(e,t);return n<0?void 0:e[n][1]},zh.prototype.has=function(t){return Fh(this.__data__,t)>-1},zh.prototype.set=function(t,e){var n=this.__data__,r=Fh(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};const Vh=ku(Yc,"Map");function Gh(t,e){var n=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?n["string"==typeof e?"string":"hash"]:n.map}function Wh(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Wh.prototype.clear=function(){this.size=0,this.__data__={hash:new $h,map:new(Vh||zh),string:new $h}},Wh.prototype.delete=function(t){var e=Gh(this,t).delete(t);return this.size-=e?1:0,e},Wh.prototype.get=function(t){return Gh(this,t).get(t)},Wh.prototype.has=function(t){return Gh(this,t).has(t)},Wh.prototype.set=function(t,e){var n=Gh(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};function Yh(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Yh.Cache||Wh),n}Yh.Cache=Wh;var Zh=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qh=/\\(\\)?/g,Xh=function(){var t=Yh((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Zh,(function(t,n,r,i){e.push(r?i.replace(qh,"$1"):n||t)})),e}),(function(t){return 500===e.size&&e.clear(),t})),e=t.cache;return t}();const Kh=Xh;function Qh(t){return null==t?"":hu(t)}function Jh(t,e){return au(t)?t:Nh(t,e)?[t]:Kh(Qh(t))}var td=1/0;function ed(t){if("string"==typeof t||su(t))return t;var e=t+"";return"0"==e&&1/t==-td?"-0":e}function nd(t,e){for(var n=0,r=(e=Jh(e,t)).length;null!=t&&n<r;)t=t[ed(e[n++])];return n&&n==r?t:void 0}function rd(t,e,n){var r=null==t?void 0:nd(t,e);return void 0===r?n:r}function id(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var od=Zc?Zc.isConcatSpreadable:void 0;function sd(t){return au(t)||hh(t)||!!(od&&t&&t[od])}function ad(t,e,n,r,i){var o=-1,s=t.length;for(n||(n=sd),i||(i=[]);++o<s;){var a=t[o];e>0&&n(a)?e>1?ad(a,e-1,n,r,i):id(i,a):r||(i[i.length]=a)}return i}const ld=Mh(Object.getPrototypeOf,Object);var cd="[object Object]",ud=Function.prototype,hd=Object.prototype,dd=ud.toString,fd=hd.hasOwnProperty,pd=dd.call(Object);function md(t){var e=this.__data__=new zh(t);this.size=e.size}md.prototype.clear=function(){this.__data__=new zh,this.size=0},md.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},md.prototype.get=function(t){return this.__data__.get(t)},md.prototype.has=function(t){return this.__data__.has(t)},md.prototype.set=function(t,e){var n=this.__data__;if(n instanceof zh){var r=n.__data__;if(!Vh||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Wh(r)}return n.set(t,e),this.size=n.size,this};var gd="object"==typeof exports&&exports&&!exports.nodeType&&exports,yd=gd&&"object"==typeof module&&module&&!module.nodeType&&module,vd=yd&&yd.exports===gd?Yc.Buffer:void 0,bd=vd?vd.allocUnsafe:void 0;function _d(t,e){if(e)return t.slice();var n=t.length,r=bd?bd(n):new t.constructor(n);return t.copy(r),r}function wd(){return[]}var Ed=Object.prototype.propertyIsEnumerable,xd=Object.getOwnPropertySymbols,Td=xd?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s)&&(o[i++]=s)}return o}(xd(t),(function(e){return Ed.call(t,e)})))}:wd;const Od=Td;var Sd=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)id(e,Od(t)),t=ld(t);return e}:wd;const Md=Sd;function Ad(t,e,n){var r=e(t);return au(t)?r:id(r,n(t))}function kd(t){return Ad(t,Ch,Od)}function Dd(t){return Ad(t,Lh,Md)}const Cd=ku(Yc,"DataView"),Rd=ku(Yc,"Promise"),Ld=ku(Yc,"Set");var Pd="[object Map]",Id="[object Promise]",Nd="[object Set]",Bd="[object WeakMap]",jd="[object DataView]",Ud=Eu(Cd),$d=Eu(Vh),Fd=Eu(Rd),Hd=Eu(Ld),zd=Eu(Du),Vd=ru;(Cd&&Vd(new Cd(new ArrayBuffer(1)))!=jd||Vh&&Vd(new Vh)!=Pd||Rd&&Vd(Rd.resolve())!=Id||Ld&&Vd(new Ld)!=Nd||Du&&Vd(new Du)!=Bd)&&(Vd=function(t){var e=ru(t),n="[object Object]"==e?t.constructor:void 0,r=n?Eu(n):"";if(r)switch(r){case Ud:return jd;case $d:return Pd;case Fd:return Id;case Hd:return Nd;case zd:return Bd}return e});const Gd=Vd;var Wd=Object.prototype.hasOwnProperty;const Yd=Yc.Uint8Array;function Zd(t){var e=new t.constructor(t.byteLength);return new Yd(e).set(new Yd(t)),e}var qd=/\w*$/,Xd=Zc?Zc.prototype:void 0,Kd=Xd?Xd.valueOf:void 0;function Qd(t,e){var n=e?Zd(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var Jd="[object Boolean]",tf="[object Date]",ef="[object Map]",nf="[object Number]",rf="[object RegExp]",of="[object Set]",sf="[object String]",af="[object Symbol]",lf="[object ArrayBuffer]",cf="[object DataView]",uf="[object Float32Array]",hf="[object Float64Array]",df="[object Int8Array]",ff="[object Int16Array]",pf="[object Int32Array]",mf="[object Uint8Array]",gf="[object Uint8ClampedArray]",yf="[object Uint16Array]",vf="[object Uint32Array]";function bf(t){return"function"!=typeof t.constructor||oh(t)?{}:Lu(ld(t))}var _f=wh&&wh.isMap,wf=_f?yh(_f):function(t){return iu(t)&&"[object Map]"==Gd(t)};const Ef=wf;var xf=wh&&wh.isSet,Tf=xf?yh(xf):function(t){return iu(t)&&"[object Set]"==Gd(t)};const Of=Tf;var Sf=1,Mf=2,Af=4,kf="[object Arguments]",Df="[object Function]",Cf="[object GeneratorFunction]",Rf="[object Object]",Lf={};function Pf(t,e,n,r,i,o){var s,a=e&Sf,l=e&Mf,c=e&Af;if(n&&(s=i?n(t,r,i,o):n(t)),void 0!==s)return s;if(!du(t))return t;var u=au(t);if(u){if(s=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Wd.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!a)return Pu(t,s)}else{var h=Gd(t),d=h==Df||h==Cf;if(mh(t))return _d(t,a);if(h==Rf||h==kf||d&&!i){if(s=l||d?{}:bf(t),!a)return l?function(t,e){return Ku(t,Md(t),e)}(t,function(t,e){return t&&Ku(e,Lh(e),t)}(s,t)):function(t,e){return Ku(t,Od(t),e)}(t,function(t,e){return t&&Ku(e,Ch(e),t)}(s,t))}else{if(!Lf[h])return i?t:{};s=function(t,e,n){var r=t.constructor;switch(e){case lf:return Zd(t);case Jd:case tf:return new r(+t);case cf:return function(t,e){var n=e?Zd(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case uf:case hf:case df:case ff:case pf:case mf:case gf:case yf:case vf:return Qd(t,n);case ef:return new r;case nf:case sf:return new r(t);case rf:return function(t){var e=new t.constructor(t.source,qd.exec(t));return e.lastIndex=t.lastIndex,e}(t);case of:return new r;case af:return function(t){return Kd?Object(Kd.call(t)):{}}(t)}}(t,h,a)}}o||(o=new md);var f=o.get(t);if(f)return f;o.set(t,s),Of(t)?t.forEach((function(r){s.add(Pf(r,e,n,r,t,o))})):Ef(t)&&t.forEach((function(r,i){s.set(i,Pf(r,e,n,i,t,o))}));var p=u?void 0:(c?l?Dd:kd:l?Lh:Ch)(t);return function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n););}(p||t,(function(r,i){p&&(r=t[i=r]),Xu(s,i,Pf(r,e,n,i,t,o))})),s}Lf[kf]=Lf["[object Array]"]=Lf["[object ArrayBuffer]"]=Lf["[object DataView]"]=Lf["[object Boolean]"]=Lf["[object Date]"]=Lf["[object Float32Array]"]=Lf["[object Float64Array]"]=Lf["[object Int8Array]"]=Lf["[object Int16Array]"]=Lf["[object Int32Array]"]=Lf["[object Map]"]=Lf["[object Number]"]=Lf[Rf]=Lf["[object RegExp]"]=Lf["[object Set]"]=Lf["[object String]"]=Lf["[object Symbol]"]=Lf["[object Uint8Array]"]=Lf["[object Uint8ClampedArray]"]=Lf["[object Uint16Array]"]=Lf["[object Uint32Array]"]=!0,Lf["[object Error]"]=Lf[Df]=Lf["[object WeakMap]"]=!1;var If=1,Nf=4;function Bf(t){return Pf(t,If|Nf)}function jf(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Wh;++e<n;)this.add(t[e])}function Uf(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function $f(t,e){return t.has(e)}jf.prototype.add=jf.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},jf.prototype.has=function(t){return this.__data__.has(t)};var Ff=1,Hf=2;function zf(t,e,n,r,i,o){var s=n&Ff,a=t.length,l=e.length;if(a!=l&&!(s&&l>a))return!1;var c=o.get(t),u=o.get(e);if(c&&u)return c==e&&u==t;var h=-1,d=!0,f=n&Hf?new jf:void 0;for(o.set(t,e),o.set(e,t);++h<a;){var p=t[h],m=e[h];if(r)var g=s?r(m,p,h,e,t,o):r(p,m,h,t,e,o);if(void 0!==g){if(g)continue;d=!1;break}if(f){if(!Uf(e,(function(t,e){if(!$f(f,e)&&(p===t||i(p,t,n,r,o)))return f.push(e)}))){d=!1;break}}else if(p!==m&&!i(p,m,n,r,o)){d=!1;break}}return o.delete(t),o.delete(e),d}function Vf(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function Gf(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var Wf=1,Yf=2,Zf="[object Boolean]",qf="[object Date]",Xf="[object Error]",Kf="[object Map]",Qf="[object Number]",Jf="[object RegExp]",tp="[object Set]",ep="[object String]",np="[object Symbol]",rp="[object ArrayBuffer]",ip="[object DataView]",op=Zc?Zc.prototype:void 0,sp=op?op.valueOf:void 0,ap=1,lp=Object.prototype.hasOwnProperty,cp=1,up="[object Arguments]",hp="[object Array]",dp="[object Object]",fp=Object.prototype.hasOwnProperty;function pp(t,e,n,r,i){return t===e||(null==t||null==e||!iu(t)&&!iu(e)?t!=t&&e!=e:function(t,e,n,r,i,o){var s=au(t),a=au(e),l=s?hp:Gd(t),c=a?hp:Gd(e),u=(l=l==up?dp:l)==dp,h=(c=c==up?dp:c)==dp,d=l==c;if(d&&mh(t)){if(!mh(e))return!1;s=!0,u=!1}if(d&&!u)return o||(o=new md),s||Th(t)?zf(t,e,n,r,i,o):function(t,e,n,r,i,o,s){switch(n){case ip:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case rp:return!(t.byteLength!=e.byteLength||!o(new Yd(t),new Yd(e)));case Zf:case qf:case Qf:return Zu(+t,+e);case Xf:return t.name==e.name&&t.message==e.message;case Jf:case ep:return t==e+"";case Kf:var a=Vf;case tp:var l=r&Wf;if(a||(a=Gf),t.size!=e.size&&!l)return!1;var c=s.get(t);if(c)return c==e;r|=Yf,s.set(t,e);var u=zf(a(t),a(e),r,i,o,s);return s.delete(t),u;case np:if(sp)return sp.call(t)==sp.call(e)}return!1}(t,e,l,n,r,i,o);if(!(n&cp)){var f=u&&fp.call(t,"__wrapped__"),p=h&&fp.call(e,"__wrapped__");if(f||p){var m=f?t.value():t,g=p?e.value():e;return o||(o=new md),i(m,g,n,r,o)}}return!!d&&(o||(o=new md),function(t,e,n,r,i,o){var s=n&ap,a=kd(t),l=a.length;if(l!=kd(e).length&&!s)return!1;for(var c=l;c--;){var u=a[c];if(!(s?u in e:lp.call(e,u)))return!1}var h=o.get(t),d=o.get(e);if(h&&d)return h==e&&d==t;var f=!0;o.set(t,e),o.set(e,t);for(var p=s;++c<l;){var m=t[u=a[c]],g=e[u];if(r)var y=s?r(g,m,u,e,t,o):r(m,g,u,t,e,o);if(!(void 0===y?m===g||i(m,g,n,r,o):y)){f=!1;break}p||(p="constructor"==u)}if(f&&!p){var v=t.constructor,b=e.constructor;v!=b&&"constructor"in t&&"constructor"in e&&!("function"==typeof v&&v instanceof v&&"function"==typeof b&&b instanceof b)&&(f=!1)}return o.delete(t),o.delete(e),f}(t,e,n,r,i,o))}(t,e,n,r,pp,i))}var mp=1,gp=2;function yp(t){return t==t&&!du(t)}function vp(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n))}}function bp(t,e){return null!=t&&e in Object(t)}var _p=1,wp=2;function Ep(t){return"function"==typeof t?t:null==t?fu:"object"==typeof t?au(t)?function(t,e){return Nh(t)&&yp(e)?vp(ed(t),e):function(n){var r=rd(n,t);return void 0===r&&r===e?function(t,e){return null!=t&&function(t,e,n){for(var r=-1,i=(e=Jh(e,t)).length,o=!1;++r<i;){var s=ed(e[r]);if(!(o=null!=t&&n(t,s)))break;t=t[s]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&eh(i)&&Wu(s,i)&&(au(t)||hh(t))}(t,e,bp)}(n,t):pp(e,r,_p|wp)}}(t[0],t[1]):function(t){var e=function(t){for(var e=Ch(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,yp(i)]}return e}(t);return 1==e.length&&e[0][2]?vp(e[0][0],e[0][1]):function(n){return n===t||function(t,e,n,r){var i=n.length,o=i;if(null==t)return!o;for(t=Object(t);i--;){var s=n[i];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<o;){var a=(s=n[i])[0],l=t[a],c=s[1];if(s[2]){if(void 0===l&&!(a in t))return!1}else{var u,h=new md;if(!(void 0===u?pp(c,l,mp|gp,r,h):u))return!1}}return!0}(n,0,e)}}(t):function(t){return Nh(t)?function(t){return function(e){return null==e?void 0:e[t]}}(ed(t)):function(t){return function(e){return nd(e,t)}}(t)}(t)}var xp=function(t,e,n){for(var r=-1,i=Object(t),o=n(t),s=o.length;s--;){var a=o[++r];if(!1===e(i[a],a,i))break}return t};const Tp=xp;function Op(t,e,n){(void 0!==n&&!Zu(t[e],n)||void 0===n&&!(e in t))&&Yu(t,e,n)}function Sp(t){return iu(t)&&nh(t)}function Mp(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function Ap(t,e,n,r,i){t!==e&&Tp(e,(function(o,s){if(i||(i=new md),du(o))!function(t,e,n,r,i,o,s){var a=Mp(t,n),l=Mp(e,n),c=s.get(l);if(c)Op(t,n,c);else{var u=o?o(a,l,n+"",t,e,s):void 0,h=void 0===u;if(h){var d=au(l),f=!d&&mh(l),p=!d&&!f&&Th(l);u=l,d||f||p?au(a)?u=a:Sp(a)?u=Pu(a):f?(h=!1,u=_d(l,!0)):p?(h=!1,u=Qd(l,!0)):u=[]:function(t){if(!iu(t)||ru(t)!=cd)return!1;var e=ld(t);if(null===e)return!0;var n=fd.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&dd.call(n)==pd}(l)||hh(l)?(u=a,hh(a)?u=function(t){return Ku(t,Lh(t))}(a):(!du(a)||vu(a))&&(u=bf(l))):h=!1}h&&(s.set(l,u),i(u,l,r,o,s),s.delete(l)),Op(t,n,u)}}(t,e,s,n,Ap,r,i);else{var a=r?r(Mp(t,s),o,s+"",t,e,i):void 0;void 0===a&&(a=o),Op(t,s,a)}}),Lh)}function kp(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}var Dp=Object.prototype.hasOwnProperty;var Cp=function(t){return Ju((function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(i--,o):void 0,s&&rh(n[0],n[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++r<i;){var a=n[r];a&&t(e,a,r)}return e}))}((function(t,e,n){Ap(t,e,n)}));const Rp=Cp;var Lp=Ld&&1/Gf(new Ld([,-0]))[1]==1/0?function(t){return new Ld(t)}:function(){};const Pp=Lp;var Ip=200;function Np(t,e,n){var r=-1,i=zu,o=t.length,s=!0,a=[],l=a;if(n)s=!1,i=kp;else if(o>=Ip){var c=e?null:Pp(t);if(c)return Gf(c);s=!1,i=$f,l=new jf}else l=e?[]:a;t:for(;++r<o;){var u=t[r],h=e?e(u):u;if(u=n||0!==u?u:0,s&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue t;e&&l.push(h),a.push(u)}else i(l,h,n)||(l!==a&&l.push(h),a.push(u))}return a}var Bp=Ju((function(t){var e=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}(t);return Sp(e)&&(e=void 0),Np(ad(t,1,Sp,!0),Ep(e))}));const jp=Bp;function Up(t){return t&&t.length?Np(t):[]}const $p="cds",Fp=7,Hp=2.5,zp=3.5,Vp={reference:"value",compareTo:"marker"},Gp=4,Wp={duration:1e3,ease:hi,zoomLevel:3},Yp={"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1},Zp={defaultBins:10},qp={items:{status:{ACTIVE:1,DISABLED:0},horizontalSpace:12,verticalSpace:24,textYOffset:8,spaceAfter:4},checkbox:{radius:6.5},radius:{iconData:[{cx:7,cy:7,r:6.5},{cx:7,cy:10,r:3.5}],fill:null,stroke:"#8c8c8c"},line:{yPosition:6,width:24,strokeWidth:1.4,fill:null,stroke:"#999999"},area:{width:24,height:14,fill:"#6f6f6f",stroke:null},size:{iconData:[{width:23,height:12},{width:13,height:6}],fill:null,stroke:"#8D8D8D"},quartile:{iconData:[{x:0,y:0,width:24,height:13},{x:11,y:4,width:1,height:4}]},zoom:{iconData:[{x:0,y:0,width:12,height:12}],color:"#8D8D8D"},color:{barWidth:300,barHeight:8,axisYTranslation:10}},Xp=.3,Kp=1,Qp=24,Jp={horizontalOffset:10},tm={default:{duration:300},pie_slice_mouseover:{duration:100},pie_chart_titles:{duration:375},graph_element_mouseover_fill_update:{duration:100},graph_element_mouseout_fill_update:{duration:100}},em={height:{[j.GRAPH_VIEW]:32,[j.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},nm=[{type:et.RADIUS,name:"Radius"},{type:et.AREA,name:"Poor area"},{type:et.AREA,name:"Satisfactory area"},{type:et.AREA,name:"Great area"},{type:et.QUARTILE,name:"Quartiles"}],rm={type:U.END_LINE,threshold:16,numCharacter:14},im={enabled:!0,position:H.BOTTOM,clickable:!0,truncation:rm,alignment:z.LEFT,order:null,additionalItems:[]},om={enabled:!0,showTotal:!0,truncation:rm,groupLabel:"Group"},sm={top:{visible:!0,includeZero:!0,truncation:rm},bottom:{visible:!0,includeZero:!0,truncation:rm},left:{visible:!0,includeZero:!0,truncation:rm},right:{visible:!0,includeZero:!0,truncation:rm}},am={addSpaceOnEdges:1,showDayName:!1,localeObject:Vc,timeIntervalFormats:{"15seconds":{primary:"MMM d, pp",secondary:"pp"},minute:{primary:"MMM d, p",secondary:"p"},"30minutes":{primary:"MMM d, p",secondary:"p"},hourly:{primary:"MMM d, hh a",secondary:"hh a"},daily:{primary:"MMM d",secondary:"d"},weekly:{primary:"eee, MMM d",secondary:"eee"},monthly:{primary:"MMM yyyy",secondary:"MMM"},quarterly:{primary:"QQQ ''yy",secondary:"QQQ"},yearly:{primary:"yyyy",secondary:"yyyy"}}},lm=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled),cm={width:null,height:null,resizable:!0,theme:I.WHITE,tooltip:om,legend:im,style:{prefix:"cc"},data:{groupMapsTo:"group",loading:!1,selectedGroups:[]},color:{scale:null,pairing:{numberOfVariants:null,option:1},gradient:{enabled:!1}},toolbar:{enabled:!0,numberOfIcons:3,controls:[{type:J.SHOW_AS_DATATABLE},...lm?[{type:J.MAKE_FULLSCREEN}]:[],{type:J.EXPORT_CSV},{type:J.EXPORT_PNG},{type:J.EXPORT_JPG}]}},um=Rp({},cm,{thematic:{projection:it.geoNaturalEarth1}}),hm=Rp({},cm,{axes:sm,timeScale:am,grid:{x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},ruler:{enabled:!0},zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:j.GRAPH_VIEW}}}),dm=Rp({},hm,{bars:{maxWidth:16,spacingFactor:.25},timeScale:Rp(am,{addSpaceOnEdges:1})}),fm=Rp({},dm,{}),pm=Rp({},dm,{}),mm=Rp({},dm,{bars:Rp({},dm.bars,{dividerSize:1.5})}),gm=Rp({},dm,{}),ym=Rp({},hm,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),vm=ym,bm=Rp({},ym,{points:{radius:3,filled:!1,enabled:!0}}),_m=Rp({},bm,{timeScale:Rp(am,{addSpaceOnEdges:0})}),wm=_m,Em=Rp({},hm,{bubble:{radiusMapsTo:"radius",radiusLabel:"Radius",radiusRange:t=>{const e=Math.min(t.width,t.height);return[3*e/400,25*e/400]},fillOpacity:.2,enabled:!0},points:{filled:!0},legend:{additionalItems:[{type:et.RADIUS,name:"Radius"}]}}),xm=Rp({},hm,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:et.AREA,name:"Poor area"},{type:et.AREA,name:"Satisfactory area"},{type:et.AREA,name:"Great area"},{type:et.QUARTILE,name:"Quartiles"}]}}),Tm=Rp({},dm,{bars:{dividerSize:1.5},timeScale:Rp(am,{addSpaceOnEdges:0})}),Om=Rp({},cm,{tooltip:Rp({},om,{wordLabel:"Word",valueLabel:"Value"}),wordCloud:{fontSizeMapsTo:"value",fontSizeRange:t=>{const e=Math.min(t.width,t.height);return[20*e/400,75*e/400]},wordMapsTo:"word"}}),Sm=Rp({},cm,{pie:{labels:{formatter:null,enabled:!0},alignment:z.LEFT,sortFunction:null,valueMapsTo:"value"}}),Mm=Rp({},cm,{legend:{enabled:!1},gauge:{type:X.SEMI,arcWidth:16,deltaArrow:{size:t=>t/8,enabled:!0},showPercentageSymbol:!0,status:null,numberSpacing:10,deltaFontSize:t=>t/8,valueFontSize:t=>t/2.5,numberFormatter:t=>Number(t.toFixed(2))%1!=0?t.toFixed(2).toLocaleString():t.toFixed().toLocaleString(),alignment:z.LEFT}}),Am=Rp({},Sm,{donut:{center:{numberFontSize:t=>`${Math.min(t/100*24,24)}px`,titleFontSize:t=>`${Math.min(t/100*15,15)}px`,titleYPosition:t=>Math.min(t/80*20,20),numberFormatter:t=>Math.floor(t).toLocaleString()},alignment:z.LEFT}}),km=Rp({},cm,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),Dm=Rp({},km,{legend:{enabled:!0}}),Cm=Rp({},cm,{radar:{axes:{angle:"key",value:"value"},alignment:z.LEFT},tooltip:{gridline:{enabled:!0},valueFormatter:t=>t??"N/A"}}),Rm=Rp({},dm,{comboChartTypes:[]}),Lm=Rp({tree:{type:G.TREE}},cm,{}),Pm=Rp({},cm,{data:Rp(cm.data,{groupMapsTo:"name"})}),Im=Rp({},cm,{circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},hierarchyLevel:2},{data:Rp(cm.data,{groupMapsTo:"name"})}),Nm=Rp({},cm,{alluvial:{data:Rp(cm.data,{groupMapsTo:"source"}),nodeAlignment:z.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),Bm=Rp({},cm,{axes:sm,heatmap:{divider:{state:nt.AUTO},colorLegend:{type:"linear"}}}),jm={alluvialChart:Nm,areaChart:_m,axisChart:hm,boxplotChart:gm,bubbleChart:Em,bulletChart:xm,chart:cm,circlePackChart:Im,choroplethChart:Rp({},um,{choropleth:{colorLegend:{type:"linear"}}}),comboChart:Rm,donutChart:Am,gaugeChart:Mm,groupedBarChart:pm,heatmapChart:Bm,histogramChart:Tm,lineChart:bm,lollipopChart:vm,meterChart:km,pieChart:Sm,proportionalMeterChart:Dm,radarChart:Cm,scatterChart:ym,simpleBarChart:fm,stackedAreaChart:wm,stackedBarChart:mm,thematicChart:um,treeChart:Lm,treemapChart:Pm,wordCloudChart:Om};function Um(t){if(!t)return;const e=t.getAttribute("transform").match(/translate\([0-9]+\.?[0-9]*,[0-9]+\.?[0-9]*\)/);if(!e)return null;if(e[0]){const t=e[0].replace(/translate\(/,"").replace(/\)/,"").split(",");return{tx:t[0],ty:t[1]}}return null}function $m(t,e,n){return n>t.length?t:e===U.MID_LINE?t.substr(0,n/2)+"..."+t.substr(-n/2):e===U.FRONT_LINE?"..."+t.substr(-n):e===U.END_LINE?t.substr(0,n)+"...":void 0}function Fm(t,e){const n=Hm(t,"legend","additionalItems"),r=Hm(e,"legend","additionalItems");if(n&&r){const i=r.map((t=>t.type)),o=n.map((t=>t.type)),s=nm.filter((t=>o.includes(t.type)&&!i.includes(t.type)));t.legend.additionalItems=s,e.legend.additionalItems=jp(s,r,"name")}}const Hm=(t,...e)=>{let n=t;if(n){for(const t of e){if(null===n[t]||void 0===n[t])return null;n=n[t]}return n}return null},zm=(t,e)=>e===$.HORIZONTAL?{y0:t.x0,y1:t.x1,x0:t.y0,x1:t.y1}:t;function Vm(t,e,n){return n===$.VERTICAL?[t,e]:[e,t]}const Gm=6048e5,Wm=864e5,Ym=6e4,Zm=36e5;function qm(t){const e=Nc(t);return e.setHours(0,0,0,0),e}function Xm(t){const e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}function Km(t,e){const n=qm(t),r=qm(e),i=n.getTime()-Xm(n),o=r.getTime()-Xm(r);return Math.round((i-o)/Wm)}function Qm(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function Jm(t){return Uc(t,{weekStartsOn:1})}function tg(t){const e=Nc(t),n=e.getFullYear(),r=Qm(t,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=Jm(r),o=Qm(t,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const s=Jm(o);return e.getTime()>=i.getTime()?n+1:e.getTime()>=s.getTime()?n:n-1}function eg(t,e){var n,r,i,o;const s=Nc(t),a=s.getFullYear(),l=jc(),c=(null==e?void 0:e.firstWeekContainsDate)??(null==(r=null==(n=null==e?void 0:e.locale)?void 0:n.options)?void 0:r.firstWeekContainsDate)??l.firstWeekContainsDate??(null==(o=null==(i=l.locale)?void 0:i.options)?void 0:o.firstWeekContainsDate)??1,u=Qm(t,0);u.setFullYear(a+1,0,c),u.setHours(0,0,0,0);const h=Uc(u,e),d=Qm(t,0);d.setFullYear(a,0,c),d.setHours(0,0,0,0);const f=Uc(d,e);return s.getTime()>=h.getTime()?a+1:s.getTime()>=f.getTime()?a:a-1}function ng(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const rg={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return ng("yy"===e?r%100:r,e.length)},M(t,e){const n=t.getMonth();return"M"===e?String(n+1):ng(n+1,2)},d:(t,e)=>ng(t.getDate(),e.length),a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(t,e)=>ng(t.getHours()%12||12,e.length),H:(t,e)=>ng(t.getHours(),e.length),m:(t,e)=>ng(t.getMinutes(),e.length),s:(t,e)=>ng(t.getSeconds(),e.length),S(t,e){const n=e.length,r=t.getMilliseconds();return ng(Math.floor(r*Math.pow(10,n-3)),e.length)}},ig={G:function(t,e,n){const r=t.getFullYear()>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"});default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if("yo"===e){const e=t.getFullYear(),r=e>0?e:1-e;return n.ordinalNumber(r,{unit:"year"})}return rg.y(t,e)},Y:function(t,e,n,r){const i=eg(t,r),o=i>0?i:1-i;return"YY"===e?ng(o%100,2):"Yo"===e?n.ordinalNumber(o,{unit:"year"}):ng(o,e.length)},R:function(t,e){return ng(tg(t),e.length)},u:function(t,e){return ng(t.getFullYear(),e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return ng(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"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return ng(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"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return rg.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"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return ng(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"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const i=function(t,e){const n=Nc(t),r=Uc(n,e).getTime()-function(t,e){var n,r,i,o;const s=jc(),a=(null==e?void 0:e.firstWeekContainsDate)??(null==(r=null==(n=null==e?void 0:e.locale)?void 0:n.options)?void 0:r.firstWeekContainsDate)??s.firstWeekContainsDate??(null==(o=null==(i=s.locale)?void 0:i.options)?void 0:o.firstWeekContainsDate)??1,l=eg(t,e),c=Qm(t,0);return c.setFullYear(l,0,a),c.setHours(0,0,0,0),Uc(c,e)}(n,e).getTime();return Math.round(r/Gm)+1}(t,r);return"wo"===e?n.ordinalNumber(i,{unit:"week"}):ng(i,e.length)},I:function(t,e,n){const r=function(t){const e=Nc(t),n=Jm(e).getTime()-function(t){const e=tg(t),n=Qm(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),Jm(n)}(e).getTime();return Math.round(n/Gm)+1}(t);return"Io"===e?n.ordinalNumber(r,{unit:"week"}):ng(r,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getDate(),{unit:"date"}):rg.d(t,e)},D:function(t,e,n){const r=function(t){const e=Nc(t);return Km(e,function(t){const e=Nc(t),n=Qm(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}(e))+1}(t);return"Do"===e?n.ordinalNumber(r,{unit:"dayOfYear"}):ng(r,e.length)},E:function(t,e,n){const r=t.getDay();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"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const i=t.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return ng(o,2);case"eo":return n.ordinalNumber(o,{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"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const i=t.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return ng(o,e.length);case"co":return n.ordinalNumber(o,{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"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),i=0===r?7:r;switch(e){case"i":return String(i);case"ii":return ng(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"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let i;switch(i=12===r?"noon":0===r?"midnight":r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let i;switch(i=r>=17?"evening":r>=12?"afternoon":r>=4?"morning":"night",e){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),n.ordinalNumber(e,{unit:"hour"})}return rg.h(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getHours(),{unit:"hour"}):rg.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return"Ko"===e?n.ordinalNumber(r,{unit:"hour"}):ng(r,e.length)},k:function(t,e,n){let r=t.getHours();return 0===r&&(r=24),"ko"===e?n.ordinalNumber(r,{unit:"hour"}):ng(r,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):rg.m(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getSeconds(),{unit:"second"}):rg.s(t,e)},S:function(t,e){return rg.S(t,e)},X:function(t,e,n,r){const i=(r._originalDate||t).getTimezoneOffset();if(0===i)return"Z";switch(e){case"X":return sg(i);case"XXXX":case"XX":return ag(i);default:return ag(i,":")}},x:function(t,e,n,r){const i=(r._originalDate||t).getTimezoneOffset();switch(e){case"x":return sg(i);case"xxxx":case"xx":return ag(i);default:return ag(i,":")}},O:function(t,e,n,r){const i=(r._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+og(i,":");default:return"GMT"+ag(i,":")}},z:function(t,e,n,r){const i=(r._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+og(i,":");default:return"GMT"+ag(i,":")}},t:function(t,e,n,r){const i=r._originalDate||t;return ng(Math.floor(i.getTime()/1e3),e.length)},T:function(t,e,n,r){return ng((r._originalDate||t).getTime(),e.length)}};function og(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),o=r%60;return 0===o?n+String(i):n+String(i)+e+ng(o,2)}function sg(t,e){return t%60==0?(t>0?"-":"+")+ng(Math.abs(t)/60,2):ag(t,e)}function ag(t,e=""){const n=t>0?"-":"+",r=Math.abs(t);return n+ng(Math.floor(r/60),2)+e+ng(r%60,2)}const lg=(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"});default:return e.date({width:"full"})}},cg=(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"});default:return e.time({width:"full"})}},ug={p:cg,P:(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return lg(t,e);let o;switch(r){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;default:o=e.dateTime({width:"full"})}return o.replace("{{date}}",lg(r,e)).replace("{{time}}",cg(i,e))}},hg=["D","DD"],dg=["YY","YYYY"];function fg(t,e,n){if("YYYY"===t)throw new RangeError(`Use \`yyyy\` instead of \`YYYY\` (in \`${e}\`) for formatting years to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("YY"===t)throw new RangeError(`Use \`yy\` instead of \`YY\` (in \`${e}\`) for formatting years to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("D"===t)throw new RangeError(`Use \`d\` instead of \`D\` (in \`${e}\`) for formatting days of the month to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if("DD"===t)throw new RangeError(`Use \`dd\` instead of \`DD\` (in \`${e}\`) for formatting days of the month to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`)}const pg=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,mg=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,gg=/^'([^]*?)'?$/,yg=/''/g,vg=/[a-zA-Z]/;function bg(t,e,n){var r,i,o,s,a,l,c,u;const h=jc(),d=(null==n?void 0:n.locale)??h.locale??Vc,f=(null==n?void 0:n.firstWeekContainsDate)??(null==(i=null==(r=null==n?void 0:n.locale)?void 0:r.options)?void 0:i.firstWeekContainsDate)??h.firstWeekContainsDate??(null==(s=null==(o=h.locale)?void 0:o.options)?void 0:s.firstWeekContainsDate)??1,p=(null==n?void 0:n.weekStartsOn)??(null==(l=null==(a=null==n?void 0:n.locale)?void 0:a.options)?void 0:l.weekStartsOn)??h.weekStartsOn??(null==(u=null==(c=h.locale)?void 0:c.options)?void 0:u.weekStartsOn)??0,m=Nc(t);if(!function(t){if(!function(t){return t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)}(t)&&"number"!=typeof t)return!1;const e=Nc(t);return!isNaN(Number(e))}(m))throw new RangeError("Invalid time value");const g={firstWeekContainsDate:f,weekStartsOn:p,locale:d,_originalDate:m};return e.match(mg).map((function(t){const e=t[0];return"p"===e||"P"===e?(0,ug[e])(t,d.formatLong):t})).join("").match(pg).map((function(r){if("''"===r)return"'";const i=r[0];if("'"===i)return function(t){const e=t.match(gg);return e?e[1].replace(yg,"'"):t}(r);const o=ig[i];if(o)return!(null!=n&&n.useAdditionalWeekYearTokens)&&function(t){return-1!==dg.indexOf(t)}(r)&&fg(r,e,String(t)),!(null!=n&&n.useAdditionalDayOfYearTokens)&&function(t){return-1!==hg.indexOf(t)}(r)&&fg(r,e,String(t)),o(m,r,d.localize,g);if(i.match(vg))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");return r})).join("")}var _g=(t=>(t["15seconds"]="15seconds",t.minute="minute",t["30minutes"]="30minutes",t.hourly="hourly",t.daily="daily",t.weekly="weekly",t.monthly="monthly",t.quarterly="quarterly",t.yearly="yearly",t))(_g||{});const wg=[["15seconds",15e3],["minute",6e4],["30minutes",18e5],["hourly",36e5],["daily",864e5],["monthly",2592e6],["quarterly",7776e6],["yearly",31104e6]];function Eg(t,e,n,r,i){const o=0===e,s=2===Number(bg(new Date(t),"c")),a=1===Number(bg(new Date(t),"q")),l=0!==e?n[e-1]:null;switch(r){case"15seconds":case"minute":case"30minutes":case"hourly":return o||function(t){const{s:e,m:n,H:r}=Tg(t);return 0===r&&0===n&&0===e}(t)||Sg(t,l)||Mg(t);case"daily":return i?o||s||Mg(t):o||Sg(t,l)||Mg(t);case"weekly":return o||s||Mg(t);case"monthly":return o||Mg(t);case"quarterly":return o||a;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function xg(t,e,n,r,i){const o=i.showDayName,s="daily"===r&&o?"weekly":r,a=new Date(t),l=Hm(i,"timeIntervalFormats")[s],c=Hm(l,"primary"),u=Hm(l,"secondary");let h=Eg(t,e,n,r,o)?c:u;return"15seconds"===r&&0!==a.getMilliseconds()&&(h=h.replace("pp","h:mm:ss.SSS a")),bg(a,h,{locale:i.localeObject})}function Tg(t){const e=new Date(t);return{M:e.getMonth()+1,d:e.getDate(),H:e.getHours(),m:e.getMinutes(),s:e.getSeconds()}}function Og(t,e){if(_g[e])return e;if(1===t.length)return"15seconds";const n=function(t){if(t)return t.slice(1).map(((e,n)=>e-t[n]))}(t);return function(t){const e=wg.reduce(((e,[,n],r)=>{const i=wg[e][1];return Math.abs(i-t)<Math.abs(n-t)?e:r}),0);return wg[e][0]}(function(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}(n))}function Sg(t,e){return Tg(t).M!==Tg(e).M}function Mg(t){const{M:e,d:n,s:r,m:i,H:o}=Tg(t);return 1===e&&1===n&&0===o&&0===i&&0===r}function Ag(t){return void 0===t?"":t.toISOString()}var kg=(t=>(t.GRAPHICS_DOCUMENT="graphics-document",t.GRAPHICS_OBJECT="graphics-object",t.GRAPHICS_SYMBOL="graphics-symbol",t.GROUP="group",t.DOCUMENT="document",t.CHECKBOX="checkbox",t.BUTTON="button",t.MENU="menu",t.MENU_ITEM="menuitem",t.IMG="img",t))(kg||{}),Dg=function(t,e){if(null==t)return t;if(!nh(t))return function(t,e){return t&&Tp(t,e,Ch)}(t,e);for(var n=t.length,r=-1,i=Object(t);++r<n&&!1!==e(i[r],r,i););return t};const Cg=Dg;function Rg(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var s=t[i];e(r,s,n(s),t)}return r}function Lg(t,e,n,r){return Cg(t,(function(t,i,o){e(r,t,n(t),o)})),r}var Pg=Object.prototype.hasOwnProperty,Ig=function(t){return function(e,n){var r={};return(au(e)?Rg:Lg)(e,t,Ep(n),r)}}((function(t,e,n){Pg.call(t,n)?t[n].push(e):Yu(t,n,[e])}));const Ng=Ig;class Bg{constructor(t){this.state={options:{}},this.colorScale={},this.colorClassNames={},this.services=t}getAllDataFromDomain(t){if(!this.getData())return null;const e=this.getOptions();let n=this.getData();const r=this.getDataGroups(),{groupMapsTo:i}=Hm(e,"data"),o=Hm(e,"axes");return t&&(n=n.filter((e=>t.includes(e[i])))),o&&Object.keys(o).forEach((t=>{const e=o[t].mapsTo,r=o[t].scaleType;if((r===F.LINEAR||r===F.LOG)&&(n=n.map((t=>({...t,[e]:null===t[e]?t[e]:Number(t[e])})))),e&&o[t].domain)if(r===F.LABELS)n=n.filter((n=>o[t].domain.includes(n[e])));else{const[r,i]=o[t].domain;n=n.filter((t=>!(e in t)||t[e]>=r&&t[e]<=i))}})),n.filter((t=>r.find((e=>e.name===t[i]))))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:e}=qp.items.status,n=this.getDataGroups(t),{groupMapsTo:r}=this.getOptions().data;return this.getAllDataFromDomain(t).filter((t=>n.find((n=>n.name===t[r]&&n.status===e))))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(t){const e=this.sanitize(Bf(t)),n=this.generateDataGroups(e);return this.set({data:e,dataGroups:n}),e}getDataGroups(t){return Hm(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter((e=>t.includes(e.name))):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:e}=qp.items.status;return this.getDataGroups(t).filter((t=>t.status===e))}getDataGroupNames(t){return this.getDataGroups(t).map((t=>t.name))}getActiveDataGroupNames(t){return this.getActiveDataGroups(t).map((t=>t.name))}aggregateBinDataByGroup(t){return Ng(t,"group")}getBinConfigurations(){const t=this.getDisplayData(),e=this.getOptions(),n=this.services.cartesianScales.getMainXAxisPosition(),r=this.services.cartesianScales.getDomainIdentifier(),i=e.axes[n],{groupMapsTo:o}=e.data,{bins:s=Zp.defaultBins}=i,a=Array.isArray(s),l=function(){var t=gt,e=ht,n=St;function r(r){Array.isArray(r)||(r=Array.from(r));var i,o,s,a=r.length,l=new Array(a);for(i=0;i<a;++i)l[i]=t(r[i],i,r);var c=e(l),u=c[0],h=c[1],d=n(l,u,h);if(!Array.isArray(d)){const t=h,n=+d;if(e===ht&&([u,h]=function(t,e,n){let r;for(;;){const i=Tt(t,e,n);if(i===r||0===i||!isFinite(i))return[t,e];i>0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}(u,h,n)),(d=xt(u,h,n))[0]<=u&&(s=Tt(u,h,n)),d[d.length-1]>=h)if(t>=h&&e===ht){const t=Tt(u,h,n);isFinite(t)&&(t>0?h=(Math.floor(h/t)+1)*t:t<0&&(h=(Math.ceil(h*-t)+1)/-t))}else d.pop()}for(var f=d.length,p=0,m=f;d[p]<=u;)++p;for(;d[m-1]>h;)--m;(p||m<f)&&(d=d.slice(p,m),f=m-p);var g,y=new Array(f+1);for(i=0;i<=f;++i)(g=y[i]=[]).x0=i>0?d[i-1]:u,g.x1=i<f?d[i]:h;if(isFinite(s)){if(s>0)for(i=0;i<a;++i)null!=(o=l[i])&&u<=o&&o<=h&&y[Math.min(f,Math.floor((o-u)/s))].push(r[i]);else if(s<0)for(i=0;i<a;++i)if(null!=(o=l[i])&&u<=o&&o<=h){const t=Math.floor((u-o)*s);y[Math.min(f,t+(d[t]<=o))].push(r[i])}}else for(i=0;i<a;++i)null!=(o=l[i])&&u<=o&&o<=h&&y[ut(d,o,0,f)].push(r[i]);return y}return r.value=function(e){return arguments.length?(t="function"==typeof e?e:vt(e),r):t},r.domain=function(t){return arguments.length?(e="function"==typeof t?t:vt([t[0],t[1]]),r):e},r.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:vt(Array.isArray(t)?yt.call(t):t),r):n},r}().value((t=>t[r])).thresholds(s)(t);if(a)l[l.length-1].x1=s[s.length-1];else{const t=l[0].x1-l[0].x0;l[l.length-1].x1=+l[l.length-1].x0+t}const c=a?[s[0],s[s.length-1]]:[l[0].x0,l[l.length-1].x1],u=Array.from(new Set(t.map((t=>t[o])))),h=[];return l.forEach((t=>{const e=`${t.x0}-${t.x1}`,n=this.aggregateBinDataByGroup(t);u.forEach((r=>{h.push({group:r,key:e,value:n[r]||0,bin:t.x0})}))})),{bins:l,binsDomain:c}}getBinnedStackedData(){const t=this.getOptions(),{groupMapsTo:e}=t.data,n=this.getActiveDataGroupNames(),{bins:r}=this.getBinConfigurations(),i=this.getDataValuesGroupedByKeys({bins:r});return Dc().keys(n)(i).map(((t,r)=>Object.keys(t).filter((t=>!isNaN(t))).map((i=>{const o=t[i];return o[e]=n[r],o}))))}getGroupedData(t){const e=this.getDisplayData(t),n={},{groupMapsTo:r}=this.getOptions().data;return e.map((t=>{const e=t[r];null!==n[e]&&void 0!==n[e]?n[e].push(t):n[e]=[t]})),Object.keys(n).map((t=>({name:t,data:n[t]})))}getStackKeys({bins:t=null,groups:e=null}={bins:null,groups:null}){const n=this.getOptions(),r=this.getDisplayData(e);let i;i=t?t.map((t=>`${t.x0}:${t.x1}`)):Up(r.map((t=>{const e=this.services.cartesianScales.getDomainIdentifier(t);return t[e]instanceof Date?Ag(t[e]):t[e]&&"function"==typeof t[e].toString?t[e].toString():t[e]})));const o=this.services.cartesianScales.domainAxisPosition,s=n.axes[o].scaleType;return s===F.TIME?i.sort(((t,e)=>new Date(t)-new Date(e))):(s===F.LOG||s===F.LINEAR)&&i.sort(((t,e)=>t-e)),i}getDataValuesGroupedByKeys({bins:t=null,groups:e=null}){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getDisplayData(e),o=this.getDataGroupNames(),s=this.getStackKeys({bins:t,groups:e});return t?s.map((e=>{const[n,i]=e.split(":"),s={x0:n,x1:i},a=t.find((t=>t.x0.toString()===n.toString()));return o.forEach((t=>{s[t]=a.filter((e=>e[r]===t)).length})),s})):s.map((t=>{const e={sharedStackKey:t};return o.forEach((n=>{const o=i.find((e=>{const i=this.services.cartesianScales.getDomainIdentifier(e);return e[r]===n&&Object.prototype.hasOwnProperty.call(e,i)&&(e[i]instanceof Date?Ag(e[i])===t:e[i].toString()===t)})),s=this.services.cartesianScales.getRangeIdentifier(e);e[n]=o?o[s]:null})),e}))}getStackedData({percentage:t=!1,groups:e=null,divergent:n=!1}){const r=this.getOptions(),{groupMapsTo:i}=r.data,o=this.getActiveDataGroupNames(e),s=this.getDataValuesGroupedByKeys({groups:e});if(t){const t=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r}(s.map((t=>[t.sharedStackKey,0])));s.forEach((e=>{o.forEach((n=>{t[e.sharedStackKey]+=e[n]}))})),s.forEach((e=>{o.forEach((n=>{const r=t[e.sharedStackKey];t[e.sharedStackKey]?e[n]=e[n]/r*100:e[n]=0}))}))}return(n?Dc().offset(Cc):Dc()).keys(o)(s).map(((t,e)=>Object.keys(t).filter((t=>!isNaN(t))).map((n=>{const r=t[n];return r[i]=o[e],r}))))}getOptions(){return this.state.options}set(t,e){this.state=Object.assign({},this.state,t);const n=Object.assign({skipUpdate:!1,animate:!0},e);n.skipUpdate||this.update(n.animate)}get(t){return t?this.state[t]:this.state}setOptions(t){const e=this.getOptions();Fm(e,t),this.set({options:Rp(e,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(L.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:e,DISABLED:n}=qp.items.status,r=this.getDataGroups(),i=r.some((t=>t.status===n)),o=r.filter((t=>t.status===e));if(i)if(1===o.length&&o[0].name===t)r.forEach(((t,n)=>{r[n].status=e}));else{const i=r.findIndex((e=>e.name===t));r[i].status=r[i].status===n?e:n}else r.forEach(((i,o)=>{r[o].status=i.name===t?e:n}));const s=r.filter((t=>t.status===e)),a=this.getOptions();r.some((t=>t.status===n))?a.data.selectedGroups=s.map((t=>t.name)):a.data.selectedGroups=[],this.services.events.dispatchEvent(L.Legend.ITEMS_UPDATE,{dataGroups:r}),this.set({dataGroups:r})}getIsFilled(t,e,n,r){const i=this.getOptions();return i.getIsFilled?i.getIsFilled(t,e,n,r):r}getFillColor(t,e,n){const r=this.getOptions(),i=Hm(this.colorScale,t);return r.getFillColor?r.getFillColor(t,e,n,i):i}getStrokeColor(t,e,n){const r=this.getOptions(),i=Hm(this.colorScale,t);return r.getStrokeColor?r.getStrokeColor(t,e,n,i):i}isUserProvidedColorScaleValid(){const t=Hm(this.getOptions(),"color","scale"),e=this.getDataGroups();return null!=t&&0!=Object.keys(t).length&&e.some((e=>Object.keys(t).includes(e.name)))}getColorClassName(t){const e=this.colorClassNames(t.dataGroupName);let n=t.originalClassName;return t.classNameTypes.forEach((r=>n=t.originalClassName?`${n} ${r}-${e}`:`${r}-${e}`)),n||""}getStatus(){return null}getAllDataGroupsNames(){return this.allDataGroups}transformToTabularData(t){console.warn("We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://charts.carbondesignsystem.com/?path=/story/docs-tutorials--tabular-data-format");const e=[],{datasets:n,labels:r}=t;return n.forEach((t=>{t.data.forEach(((n,i)=>{let o;const s=Hm(t,"label");if(null===s){o=Hm(r,i)||"Ungrouped"}else o=s;const a={group:o,key:r[i]};isNaN(n)?(a.value=n.value,a.date=n.date):a.value=n,e.push(a)}))})),e}getTabularDataArray(){return[]}exportToCSV(){const t=this.getTabularDataArray().map((t=>t.map((t=>`"${("–"===t?"–":t).split(/[,;'"`]/).map((t=>function(t){const e=t.trim();return["=","+","-","@","\t","\r"].includes(e.charAt(0))?` ${e}`:/[,\"\n]/.test(e)?`"${e}"`:e}(t))).join("")}"`)))).map((t=>t.join(","))).join("\n"),e=this.getOptions();let n="myChart";const r=Hm(e,"fileDownload","fileName");"function"==typeof r?n=r("csv"):"string"==typeof r&&(n=r),this.services.files.downloadCSV(t,`${n}.csv`)}getTabularData(t){return Array.isArray(t)?t:this.transformToTabularData(t)}sanitize(t){return this.getTabularData(t)}updateAllDataGroups(){this.allDataGroups?this.getDataGroupNames().forEach((t=>{-1===this.allDataGroups.indexOf(t)&&this.allDataGroups.push(t)})):this.allDataGroups=this.getDataGroupNames()}generateDataGroups(t){const{groupMapsTo:e}=this.getOptions().data,{ACTIVE:n,DISABLED:r}=qp.items.status,i=this.getOptions(),o=Up(t.map((t=>t[e])));i.data.selectedGroups.length&&(i.data.selectedGroups.every((t=>o.includes(t)))||(i.data.selectedGroups=[]));const s=t=>!i.data.selectedGroups.length||i.data.selectedGroups.includes(t)?n:r;return o.map((t=>({name:t,status:s(t)})))}setCustomColorScale(){if(!this.isUserProvidedColorScaleValid())return;const t=this.getOptions(),e=Hm(t,"color","scale");Object.keys(e).forEach((t=>{this.allDataGroups.includes(t)||console.warn(`"${t}" does not exist in data groups.`)})),this.allDataGroups.filter((t=>e[t])).forEach((t=>this.colorScale[t]=e[t]))}setColorClassNames(){const t=Hm(this.getOptions(),"color","pairing");let e=Hm(t,"numberOfVariants");(!e||e<this.allDataGroups.length)&&(e=this.allDataGroups.length);let n=Hm(t,"option");const r=e>5?14:e;n=n<=Yp[`${r}-color`]?n:1;const i=this.allDataGroups.map(((t,e)=>`${r}-${n}-${e%14+1}`));this.colorClassNames=Do().range(i).domain(this.allDataGroups)}}let jg=class extends Bg{constructor(t){super(t),this.axisFlavor=rt.DEFAULT}assignRangeAndDomains(){const{cartesianScales:t}=this.services,e=this.getOptions(),n=t.isDualAxes(),r={primaryDomain:t.domainAxisPosition,primaryRange:t.rangeAxisPosition,secondaryDomain:null,secondaryRange:null};return n&&(r.secondaryDomain=t.secondaryDomainAxisPosition,r.secondaryRange=t.secondaryRangeAxisPosition),Object.keys(r).forEach((n=>{const i=r[n];t.scales[i]?r[n]={position:i,label:t.getScaleLabel(i),identifier:Hm(e,"axes",i,"mapsTo")}:r[n]=null})),r}getTabularDataArray(){const t=this.getDisplayData(),e=this.getOptions(),{groupMapsTo:n}=e.data,{cartesianScales:r}=this.services,{primaryDomain:i,primaryRange:o,secondaryDomain:s,secondaryRange:a}=this.assignRangeAndDomains();let l;return r.getDomainAxisScaleType()===F.TIME&&(l=t=>bg(t,"MMM d, yyyy")),[["Group",i.label,o.label,...s?[s.label]:[],...a?[a.label]:[]],...t.map((t=>[t[n],null===t[i.identifier]?"–":l?l(t[i.identifier]):t[i.identifier],null===t[o.identifier]||isNaN(t[o.identifier])?"–":t[o.identifier].toLocaleString(),...s?[null===t[s.identifier]?"–":t[s.identifier]]:[],...a?[null===t[a.identifier]||isNaN(t[a.identifier])?"–":t[a.identifier]]:[]]))]}setData(t){let e;if(t&&(e=super.setData(t),Hm(this.getOptions(),"zoomBar",B.TOP,"enabled"))){const t=Hm(this.getOptions(),"zoomBar",B.TOP,"data");this.setZoomBarData(t)}return e}setZoomBarData(t){const e=t?this.sanitize(Bf(t)):this.getDisplayData();let n=e;const{cartesianScales:r}=this.services;if(e&&r.domainAxisPosition&&r.rangeAxisPosition){const t=r.getDomainIdentifier(),i=r.getRangeIdentifier();let o=e.map((e=>e[t].getTime()));o=Up(o).sort(),n=o.map((n=>{let r=0;const o={};return e.forEach((e=>{e[t].getTime()===n&&(r+=e[i])})),o[t]=new Date(n),o[i]=r,o}))}this.set({zoomBarData:n})}getZoomBarData(){return this.get("zoomBarData")}sanitizeDateValues(t){const e=this.getOptions();if(!e.axes)return t;const n=[];return Object.keys(B).forEach((t=>{const r=B[t],i=e.axes[r];if(i&&i.scaleType===F.TIME){const t=i.mapsTo;(null!==t||void 0!==t)&&n.push(t)}})),n.length>0&&t.forEach((t=>{n.forEach((e=>{null===Hm(t,e,"getTime")&&(t[e]=new Date(t[e]))}))})),t}sanitize(t){return t=super.sanitize(t),this.sanitizeDateValues(t)}};var Ug=/\s/,$g=/^\s+/;var Fg=NaN,Hg=/^[-+]0x[0-9a-f]+$/i,zg=/^0b[01]+$/i,Vg=/^0o[0-7]+$/i,Gg=parseInt;function Wg(t){if("number"==typeof t)return t;if(su(t))return Fg;if(du(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=du(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=function(t){return t&&t.slice(0,function(t){for(var e=t.length;e--&&Ug.test(t.charAt(e)););return e}(t)+1).replace($g,"")}(t);var n=zg.test(t);return n||Vg.test(t)?Gg(t.slice(2),n?2:8):Hg.test(t)?Fg:+t}const Yg=function(){return Yc.Date.now()};var Zg=Math.max,qg=Math.min;const Xg=(()=>{let t=0;return()=>(t+=1,`u${`0000${(Math.random()*36**4|0).toString(36)}`.slice(-4)}${t}`)})();function Kg(t){const e=[];for(let n=0,r=t.length;n<r;n++)e.push(t[n]);return e}function Qg(t,e){const n=(t.ownerDocument.defaultView||window).getComputedStyle(t).getPropertyValue(e);return n?parseFloat(n.replace("px","")):0}function Jg(t,e={}){const n=e.width||function(t){const e=Qg(t,"border-left-width"),n=Qg(t,"border-right-width");return t.clientWidth+e+n}(t),r=e.height||function(t){const e=Qg(t,"border-top-width"),n=Qg(t,"border-bottom-width");return t.clientHeight+e+n}(t);return{width:n,height:r}}const ty=16384;function ey(t){return new Promise(((e,n)=>{const r=new Image;r.decode=()=>e(r),r.onload=()=>e(r),r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=t}))}const ny=(t,e)=>{if(t instanceof e)return!0;const n=Object.getPrototypeOf(t);return null!==n&&(n.constructor.name===e.name||ny(n,e))};function ry(t,e,n){const r=window.getComputedStyle(t,n),i=r.getPropertyValue("content");if(""===i||"none"===i)return;const o=Xg();try{e.className=`${e.className} ${o}`}catch{return}const s=document.createElement("style");s.appendChild(function(t,e,n){const r=`.${t}:${e}`,i=n.cssText?function(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}(n):function(t){return Kg(t).map((e=>`${e}: ${t.getPropertyValue(e)}${t.getPropertyPriority(e)?" !important":""};`)).join(" ")}(n);return document.createTextNode(`${r}{${i}}`)}(o,n,r)),e.appendChild(s)}const iy="application/font-woff",oy="image/jpeg",sy={woff:iy,woff2:iy,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:oy,jpeg:oy,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function ay(t){const e=function(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}(t).toLowerCase();return sy[e]||""}function ly(t){return-1!==t.search(/^(data:)/)}function cy(t,e){return`data:${e};base64,${t}`}async function uy(t,e,n){const r=await fetch(t,e);if(404===r.status)throw new Error(`Resource "${r.url}" not found`);const i=await r.blob();return new Promise(((t,e)=>{const o=new FileReader;o.onerror=e,o.onloadend=()=>{try{t(n({res:r,result:o.result}))}catch(t){e(t)}},o.readAsDataURL(i)}))}const hy={};async function dy(t,e,n){const r=function(t,e,n){let r=t.replace(/\?.*/,"");return n&&(r=t),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),e?`[${e}]${r}`:r}(t,e,n.includeQueryParams);if(null!=hy[r])return hy[r];let i;n.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+(new Date).getTime());try{const r=await uy(t,n.fetchRequestInit,(({res:t,result:n})=>(e||(e=t.headers.get("Content-Type")||""),function(t){return t.split(/,/)[1]}(n))));i=cy(r,e)}catch(e){i=n.imagePlaceholder||"";let r=`Failed to fetch resource: ${t}`;e&&(r="string"==typeof e?e:e.message),r&&console.warn(r)}return hy[r]=i,i}const fy=t=>null!=t.tagName&&"SLOT"===t.tagName.toUpperCase();async function py(t,e,n){return n||!e.filter||e.filter(t)?Promise.resolve(t).then((t=>async function(t,e){return ny(t,HTMLCanvasElement)?async function(t){const e=t.toDataURL();return"data:,"===e?t.cloneNode(!1):ey(e)}(t):ny(t,HTMLVideoElement)?async function(t,e){if(t.currentSrc){const e=document.createElement("canvas"),n=e.getContext("2d");return e.width=t.clientWidth,e.height=t.clientHeight,null==n||n.drawImage(t,0,0,e.width,e.height),ey(e.toDataURL())}const n=t.poster,r=ay(n);return ey(await dy(n,r,e))}(t,e):ny(t,HTMLIFrameElement)?async function(t){var e;try{if(null!==(e=null==t?void 0:t.contentDocument)&&void 0!==e&&e.body)return await py(t.contentDocument.body,{},!0)}catch{}return t.cloneNode(!1)}(t):t.cloneNode(!1)}(t,e))).then((n=>async function(t,e,n){var r,i;let o=[];return o=fy(t)&&t.assignedNodes?Kg(t.assignedNodes()):ny(t,HTMLIFrameElement)&&null!==(r=t.contentDocument)&&void 0!==r&&r.body?Kg(t.contentDocument.body.childNodes):Kg((null!==(i=t.shadowRoot)&&void 0!==i?i:t).childNodes),0===o.length||ny(t,HTMLVideoElement)||await o.reduce(((t,r)=>t.then((()=>py(r,n))).then((t=>{t&&e.appendChild(t)}))),Promise.resolve()),e}(t,n,e))).then((e=>function(t,e){return ny(e,Element)&&(function(t,e){const n=e.style;if(!n)return;const r=window.getComputedStyle(t);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):Kg(r).forEach((i=>{let o=r.getPropertyValue(i);"font-size"===i&&o.endsWith("px")&&(o=Math.floor(parseFloat(o.substring(0,o.length-2)))-.1+"px"),ny(t,HTMLIFrameElement)&&"display"===i&&"inline"===o&&(o="block"),"d"===i&&e.getAttribute("d")&&(o=`path(${e.getAttribute("d")})`),n.setProperty(i,o,r.getPropertyPriority(i))}))}(t,e),function(t,e){ry(t,e,":before"),ry(t,e,":after")}(t,e),function(t,e){ny(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),ny(t,HTMLInputElement)&&e.setAttribute("value",t.value)}(t,e),function(t,e){if(ny(t,HTMLSelectElement)){const n=e,r=Array.from(n.children).find((e=>t.value===e.getAttribute("value")));r&&r.setAttribute("selected","")}}(t,e)),e}(t,e))).then((t=>async function(t,e){const n=t.querySelectorAll?t.querySelectorAll("use"):[];if(0===n.length)return t;const r={};for(let i=0;i<n.length;i++){const o=n[i].getAttribute("xlink:href");if(o){const n=t.querySelector(o),i=document.querySelector(o);!n&&i&&!r[o]&&(r[o]=await py(i,e,!0))}}const i=Object.values(r);if(i.length){const e="http://www.w3.org/1999/xhtml",n=document.createElementNS(e,"svg");n.setAttribute("xmlns",e),n.style.position="absolute",n.style.width="0",n.style.height="0",n.style.overflow="hidden",n.style.display="none";const r=document.createElementNS(e,"defs");n.appendChild(r);for(let t=0;t<i.length;t++)r.appendChild(i[t]);t.appendChild(n)}return t}(t,e))):null}const my=/url\((['"]?)([^'"]+?)\1\)/g,gy=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,yy=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function vy(t){return-1!==t.search(my)}async function by(t,e,n){if(!vy(t))return t;const r=function(t,{preferredFontFormat:e}){return e?t.replace(yy,(t=>{for(;;){const[n,,r]=gy.exec(t)||[];if(!r)return"";if(r===e)return`src: ${n};`}})):t}(t,n);return function(t){const e=[];return t.replace(my,((t,n,r)=>(e.push(r),t))),e.filter((t=>!ly(t)))}(r).reduce(((t,r)=>t.then((t=>async function(t,e,n,r,i){try{const o=n?function(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),e&&(r.href=e),i.href=t,i.href}(e,n):e,s=ay(e);let a;return a=i?cy(await i(o),s):await dy(o,s,r),t.replace(function(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}(e),`$1${a}$3`)}catch{}return t}(t,r,e,n)))),Promise.resolve(r))}async function _y(t,e,n){var r;const i=null===(r=e.style)||void 0===r?void 0:r.getPropertyValue(t);if(i){const r=await by(i,null,n);return e.style.setProperty(t,r,e.style.getPropertyPriority(t)),!0}return!1}async function wy(t,e){ny(t,Element)&&(await async function(t,e){await _y("background",t,e)||await _y("background-image",t,e),await _y("mask",t,e)||await _y("mask-image",t,e)}(t,e),await async function(t,e){const n=ny(t,HTMLImageElement);if((!n||ly(t.src))&&(!ny(t,SVGImageElement)||ly(t.href.baseVal)))return;const r=n?t.src:t.href.baseVal,i=await dy(r,ay(r),e);await new Promise(((e,r)=>{t.onload=e,t.onerror=r;const o=t;o.decode&&(o.decode=e),"lazy"===o.loading&&(o.loading="eager"),n?(t.srcset="",t.src=i):t.href.baseVal=i}))}(t,e),await async function(t,e){const n=Kg(t.childNodes).map((t=>wy(t,e)));await Promise.all(n).then((()=>t))}(t,e))}const Ey={};async function xy(t){let e=Ey[t];return null!=e||(e={url:t,cssText:await(await fetch(t)).text()},Ey[t]=e),e}async function Ty(t,e){let n=t.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,i=(n.match(/url\([^)]+\)/g)||[]).map((async i=>{let o=i.replace(r,"$1");return o.startsWith("https://")||(o=new URL(o,t.url).href),uy(o,e.fetchRequestInit,(({result:t})=>(n=n.replace(i,`url(${t})`),[i,t])))}));return Promise.all(i).then((()=>n))}function Oy(t){if(null==t)return[];const e=[];let n=t.replace(/(\/\*[\s\S]*?\*\/)/gi,"");const r=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const t=r.exec(n);if(null===t)break;e.push(t[0])}n=n.replace(r,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,o=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let t=i.exec(n);if(null===t){if(t=o.exec(n),null===t)break;i.lastIndex=o.lastIndex}else o.lastIndex=i.lastIndex;e.push(t[0])}return e}async function Sy(t,e){const n=null!=e.fontEmbedCSS?e.fontEmbedCSS:e.skipFonts?null:await async function(t,e){const n=await async function(t,e){if(null==t.ownerDocument)throw new Error("Provided element is not within a Document");const n=Kg(t.ownerDocument.styleSheets),r=await async function(t,e){const n=[],r=[];return t.forEach((n=>{if("cssRules"in n)try{Kg(n.cssRules||[]).forEach(((t,i)=>{if(t.type===CSSRule.IMPORT_RULE){let o=i+1;const s=xy(t.href).then((t=>Ty(t,e))).then((t=>Oy(t).forEach((t=>{try{n.insertRule(t,t.startsWith("@import")?o+=1:n.cssRules.length)}catch(e){console.error("Error inserting rule from remote css",{rule:t,error:e})}})))).catch((t=>{console.error("Error loading remote css",t.toString())}));r.push(s)}}))}catch(i){const o=t.find((t=>null==t.href))||document.styleSheets[0];null!=n.href&&r.push(xy(n.href).then((t=>Ty(t,e))).then((t=>Oy(t).forEach((t=>{o.insertRule(t,n.cssRules.length)})))).catch((t=>{console.error("Error loading remote stylesheet",t)}))),console.error("Error inlining remote css file",i)}})),Promise.all(r).then((()=>(t.forEach((t=>{if("cssRules"in t)try{Kg(t.cssRules||[]).forEach((t=>{n.push(t)}))}catch(e){console.error(`Error while reading CSS rules from ${t.href}`,e)}})),n)))}(n,e);return function(t){return t.filter((t=>t.type===CSSRule.FONT_FACE_RULE)).filter((t=>vy(t.style.getPropertyValue("src"))))}(r)}(t,e);return(await Promise.all(n.map((t=>{const n=t.parentStyleSheet?t.parentStyleSheet.href:null;return by(t.cssText,n,e)})))).join("\n")}(t,e);if(n){const e=document.createElement("style"),r=document.createTextNode(n);e.appendChild(r),t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}}async function My(t,e={}){const{width:n,height:r}=Jg(t,e),i=await py(t,e,!0);return await Sy(i,e),await wy(i,e),function(t,e){const{style:n}=t;e.backgroundColor&&(n.backgroundColor=e.backgroundColor),e.width&&(n.width=`${e.width}px`),e.height&&(n.height=`${e.height}px`);const r=e.style;null!=r&&Object.keys(r).forEach((t=>{n[t]=r[t]}))}(i,e),await async function(t,e,n){const r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),o=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${e}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${e} ${n}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),i.appendChild(o),o.appendChild(t),async function(t){return Promise.resolve().then((()=>(new XMLSerializer).serializeToString(t))).then(encodeURIComponent).then((t=>`data:image/svg+xml;charset=utf-8,${t}`))}(i)}(i,n,r)}async function Ay(t,e={}){const{width:n,height:r}=Jg(t,e),i=await My(t,e),o=await ey(i),s=document.createElement("canvas"),a=s.getContext("2d"),l=e.pixelRatio||function(){let t,e;try{e=process}catch{}const n=e&&e.env?e.env.devicePixelRatio:null;return n&&(t=parseInt(n,10),Number.isNaN(t)&&(t=1)),t||window.devicePixelRatio||1}(),c=e.canvasWidth||n,u=e.canvasHeight||r;return s.width=c*l,s.height=u*l,e.skipAutoScale||function(t){(t.width>ty||t.height>ty)&&(t.width>ty&&t.height>ty?t.width>t.height?(t.height*=ty/t.width,t.width=ty):(t.width*=ty/t.height,t.height=ty):t.width>ty?(t.height*=ty/t.width,t.width=ty):(t.width*=ty/t.height,t.height=ty))}(s),s.style.width=`${c}`,s.style.height=`${u}`,e.backgroundColor&&(a.fillStyle=e.backgroundColor,a.fillRect(0,0,s.width,s.height)),a.drawImage(o,0,0,s.width,s.height),s}class ky{constructor(t,e){this.model=t,this.services=e,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}}let Dy=class t extends ky{constructor(t,e){super(t,e),this.chartID=""}static getHTMLElementSize(t){return{width:t.clientWidth,height:t.clientHeight}}static getSVGElementSize(t,e={useAttrs:!1,useClientDimensions:!1,useBBox:!1,useBoundingRect:!1}){t.attr||(t=an(t));const n={width:0,height:0},r=t=>{t&&Object.keys(n).forEach((e=>{if(t[e]){const r=t[e],i=parseFloat(r);r&&i>n[e]&&-1===(""+r).indexOf("%")&&(n[e]=i)}}))},i={width:t.attr("width"),height:t.attr("height")},o=t.node();let s,a,l,c,u;try{"function"==typeof o.getBBox&&(s=o.getBBox(),a={width:s.width,height:s.height})}catch(t){console.error(t)}try{"function"==typeof(null==o?void 0:o.getBoundingClientRect)&&(l=o.getBoundingClientRect(),c={width:l.width,height:l.height})}catch(t){console.error(t)}if(o instanceof SVGSVGElement&&(u={width:o.clientWidth,height:o.clientHeight}),e){if(e.useAttrs&&(r(i),n.width>0&&n.height>0))return n;if(e.useClientDimensions&&(r(u),n.width>0&&n.height>0))return u;if(e.useBBox&&(r(a),n.width>0&&n.height>0))return a;if(e.useBoundingRect&&(r(c),n.width>0&&n.height>0))return c}try{r({width:Hm(t.node(),"width","baseVal","value"),height:Hm(t.node(),"height","baseVal","value")})}catch{r(u),r(a),r(i)}return n}static appendOrSelect(t,e){const n=t.select(`${e}`);if(n.empty()){let n,r,i=e.split("#");return 2===i.length?(n=i[0],i=i[1].split("."),r=i[0]):(i=e.split("."),n=i[0]),t.append(n).attr("id",r).attr("class",i.slice(1).join(" "))}return n}init(){this.styleHolderElement(),this.initializeID(),this.addMainContainer(),this.model.getOptions().resizable&&this.addResizeListener(),this.addHolderListeners(),this.handleFullscreenChange()}getChartID(){return this.chartID}generateElementIDString(t){return`chart-${this.chartID}-${t}`}initializeID(){this.chartID=Math.floor(281474976710656*(1+Math.random())).toString(16)}addMainContainer(){const t=this.model.getOptions(),e=Hm(t,"style","prefix"),n=an(this.getHolder()).append("div").classed(`${$p}--${e}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");n.append("g").attr("class","DONT_STYLE_ME_css_styles_verifier"),this.mainContainer=n.node()}update(){this.styleHolderElement()}styleHolderElement(){const t=this.getHolder(),{width:e,height:n,theme:r}=this.model.getOptions();e!==this.width&&(t.style.width=e,this.width=e),n!==this.height&&(t.style.height=n,this.height=n),an(this.getHolder()).classed(`${$p}--chart-holder`,!0).attr("data-carbon-theme",r)}getHolder(){return this.model.get("holder")}exportToJPG(){const t=this,e=this.model.getOptions(),n=an(this.getHolder());n.classed("filled",!0),async function(t,e={}){return(await Ay(t,e)).toDataURL("image/jpeg",e.quality||1)}(this.getMainContainer(),{quality:1,filter:t=>!(t.classList&&t.classList.contains("cds--cc--toolbar"))}).then((function(r){var i;let o="myChart";const s=Hm(e,"fileDownload","fileName");"function"==typeof s?o=s("jpg"):"string"==typeof s&&(o=s),null==(i=t.services.files)||i.downloadImage(r,`${o}.jpg`),n.classed("filled",!1)}))}exportToPNG(){const t=this,e=this.model.getOptions(),n=an(this.getHolder());n.classed("filled",!0),async function(t,e={}){return(await Ay(t,e)).toDataURL()}(this.getMainContainer(),{quality:1,filter:t=>!(t.classList&&t.classList.contains("cds--cc--toolbar"))}).then((function(r){var i;let o="myChart";const s=Hm(e,"fileDownload","fileName");"function"==typeof s?o=s("png"):"string"==typeof s&&(o=s),null==(i=t.services.files)||i.downloadImage(r,`${o}.png`),n.classed("filled",!1)})).catch((function(t){console.error("oops, something went wrong!",t)}))}toggleFullscreen(){const t=this.getHolder();an(t).classed("fullscreen")&&(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen():t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.msRequestFullscreen&&t.msRequestFullscreen()}handleFullscreenChange(){document.addEventListener("fullscreenchange",(()=>{const t=an(this.getHolder()),e=t.classed("fullscreen");t.classed("fullscreen",!e)}))}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:e}=t.getSVGElementSize(an(this.mainContainer),{useBBox:!0}),n=an(this.mainContainer).attr("class"),r=an(this.mainContainer).selectAll(`.${n} > svg`);let i=0;r.nodes().forEach((function(e){i+=Number(t.getSVGElementSize(an(e),{useBBox:!0}).height)})),i<=e?an(this.mainContainer).attr("height",i):an(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&an(t).on("mouseover",(()=>{var t;null==(t=this.services.events)||t.dispatchEvent(L.Chart.MOUSEOVER)})).on("mouseout",(()=>{var t;null==(t=this.services.events)||t.dispatchEvent(L.Chart.MOUSEOUT)}))}addResizeListener(){const t=this.getHolder();if(!t)return;let e=t.clientWidth,n=t.clientHeight;const r=function(t,e,n){var r,i,o,s,a,l,c=0,u=!1,h=!1,d=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function f(e){var n=r,o=i;return r=i=void 0,c=e,s=t.apply(o,n)}function p(t){var n=t-l;return void 0===l||n>=e||n<0||h&&t-c>=o}function m(){var t=Yg();if(p(t))return g(t);a=setTimeout(m,function(t){var n=e-(t-l);return h?qg(n,o-(t-c)):n}(t))}function g(t){return a=void 0,d&&r?f(t):(r=i=void 0,s)}function y(){var t=Yg(),n=p(t);if(r=arguments,i=this,l=t,n){if(void 0===a)return function(t){return c=t,a=setTimeout(m,e),u?f(t):s}(l);if(h)return clearTimeout(a),a=setTimeout(m,e),f(l)}return void 0===a&&(a=setTimeout(m,e)),s}return e=Wg(e)||0,du(n)&&(u=!!n.leading,o=(h="maxWait"in n)?Zg(Wg(n.maxWait)||0,e):o,d="trailing"in n?!!n.trailing:d),y.cancel=function(){void 0!==a&&clearTimeout(a),c=0,r=l=i=a=void 0},y.flush=function(){return void 0===a?s:g(Yg())},y}((()=>{var r;t&&(Math.abs(e-t.clientWidth)>1||Math.abs(n-t.clientHeight)>1)&&(e=t.clientWidth,n=t.clientHeight,null==(r=this.services.events)||r.dispatchEvent(L.Chart.RESIZE))}),12.5);new ResizeObserver(r).observe(t)}},Cy=class t extends ky{static appendOrUpdateLinearGradient(t){let e=t.svg.select(`defs linearGradient#${t.id}`);e.empty()&&(e=t.svg.append("defs").append("linearGradient").attr("id",t.id).attr("x1",t.x1).attr("x2",t.x2).attr("y1",t.y1).attr("y2",t.y2)),e.selectAll("stop").remove(),e.selectAll("stop").data(t.stops).enter().append("stop").attr("offset",(t=>t.offset)).style("stop-color",(t=>t.color)).style("stop-opacity",(t=>t.opacity))}static getOffsetRatio(t){return(100*Math.abs(t[1])/Math.abs(t[0]-t[1])).toFixed(2)+"%"}static getStops(e,n){let r=[{offset:"0%",color:n,opacity:"0.6"},{offset:"80%",color:n,opacity:"0"}];return e[0]<0&&e[1]>0&&(r=[{offset:"0%",color:n,opacity:"0.6"},{offset:t.getOffsetRatio(e),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),r}};var Ry=Math.PI,Ly=2*Ry,Py=1e-6,Iy=Ly-Py;function Ny(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function By(t){if(t.__esModule)return t;var e=t.default;if("function"==typeof e){var n=function t(){return this instanceof t?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:function(){return t[e]}})})),n}Ny.prototype=function(){return new Ny}.prototype={constructor:Ny,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,r){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(t,e,n,r,i,o){this._+="C"+ +t+","+ +e+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(t,e,n,r,i){t=+t,e=+e,n=+n,r=+r,i=+i;var o=this._x1,s=this._y1,a=n-t,l=r-e,c=o-t,u=s-e,h=c*c+u*u;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(h>Py)if(Math.abs(u*a-l*c)>Py&&i){var d=n-o,f=r-s,p=a*a+l*l,m=d*d+f*f,g=Math.sqrt(p),y=Math.sqrt(h),v=i*Math.tan((Ry-Math.acos((p+h-m)/(2*g*y)))/2),b=v/y,_=v/g;Math.abs(b-1)>Py&&(this._+="L"+(t+b*c)+","+(e+b*u)),this._+="A"+i+","+i+",0,0,"+ +(u*d>c*f)+","+(this._x1=t+_*a)+","+(this._y1=e+_*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e)},arc:function(t,e,n,r,i,o){t=+t,e=+e,o=!!o;var s=(n=+n)*Math.cos(r),a=n*Math.sin(r),l=t+s,c=e+a,u=1^o,h=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>Py||Math.abs(this._y1-c)>Py)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%Ly+Ly),h>Iy?this._+="A"+n+","+n+",0,1,"+u+","+(t-s)+","+(e-a)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>Py&&(this._+="A"+n+","+n+",0,"+ +(h>=Ry)+","+u+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}},Array.prototype.slice;var jy={value:function(){}};function Uy(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new $y(r)}function $y(t){this._=t}function Fy(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function Hy(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=jy,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}$y.prototype=Uy.prototype={constructor:$y,on:function(t,e){var n,r=this._,i=function(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}(t+"",r),o=-1,s=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<s;)if(n=(t=i[o]).type)r[n]=Hy(r[n],t.name,e);else if(null==e)for(n in r)r[n]=Hy(r[n],t.name,null);return this}for(;++o<s;)if((n=(t=i[o]).type)&&(n=Fy(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new $y(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}},By(Object.freeze(Object.defineProperty({__proto__:null,dispatch:Uy},Symbol.toStringTag,{value:"Module"}))).dispatch,Math.PI;var zy=function(t){return function(e){return null==t?void 0:t[e]}}({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"});const Vy=zy;var Gy=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Wy=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g"),Yy=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Zy=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,qy="\\ud800-\\udfff",Xy="\\u2700-\\u27bf",Ky="a-z\\xdf-\\xf6\\xf8-\\xff",Qy="A-Z\\xc0-\\xd6\\xd8-\\xde",Jy="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",tv="["+Jy+"]",ev="\\d+",nv="["+Xy+"]",rv="["+Ky+"]",iv="[^"+qy+Jy+ev+Xy+Ky+Qy+"]",ov="(?:\\ud83c[\\udde6-\\uddff]){2}",sv="[\\ud800-\\udbff][\\udc00-\\udfff]",av="["+Qy+"]",lv="(?:"+rv+"|"+iv+")",cv="(?:"+av+"|"+iv+")",uv="(?:['’](?:d|ll|m|re|s|t|ve))?",hv="(?:['’](?:D|LL|M|RE|S|T|VE))?",dv="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",fv="[\\ufe0e\\ufe0f]?",pv=fv+dv+"(?:\\u200d(?:"+["[^"+qy+"]",ov,sv].join("|")+")"+fv+dv+")*",mv="(?:"+[nv,ov,sv].join("|")+")"+pv,gv=RegExp([av+"?"+rv+"+"+uv+"(?="+[tv,av,"$"].join("|")+")",cv+"+"+hv+"(?="+[tv,av+lv,"$"].join("|")+")",av+"?"+lv+"+"+uv,av+"+"+hv,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ev,mv].join("|"),"g");var yv=RegExp("['’]","g");function vv(t){return function(e){return function(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)n=e(n,t[r],r,t);return n}(function(t,e,n){return t=Qh(t),void 0===(e=n?void 0:e)?function(t){return Zy.test(t)}(t)?function(t){return t.match(gv)||[]}(t):function(t){return t.match(Yy)||[]}(t):t.match(e)||[]}(function(t){return(t=Qh(t))&&t.replace(Gy,Vy).replace(Wy,"")}(e).replace(yv,"")),t,"")}}function bv(t,e){var n;return Cg(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function _v(t,e,n){var r=au(t)?Uf:bv;return n&&rh(t,e,n)&&(e=void 0),r(t,Ep(e))}vv((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}));let wv=class{constructor(t,e,n){if(this.type="",this.renderType=P.HTML,this.id="",this.parent=void 0,this.configs={},this.model=t,this.services=e,n&&(this.configs=n,this.configs.id)){const t=Hm(this.model.getOptions(),"style","prefix");this.id=`${t}--${this.configs.id}`}this.parent||this.setParent(an(this.services.domUtils.getMainContainer()))}init(){}render(t=!0){console.error("Error: Component did not provide the required render function.")}destroy(){}setModel(t){this.model=t}setServices(t){this.services=t}setParent(t){var e;const n=this.parent;if(this.parent=t,(!n||n.node()!==t.node())&&this.type){const t=Hm(this.model.getOptions(),"style","prefix");null==(e=this.parent)||e.classed(`${$p}--${t}--${this.type}`,!0),n&&n.classed(`${$p}--${t}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(t={withinChartClip:!1}){if(this.type){const e=Hm(this.model.getOptions(),"style","prefix"),n=this.id?`#${this.id}`:"",r=Dy.appendOrSelect(this.parent,`${this.renderType===P.SVG?"svg":"div"}${n}.${$p}--${e}--${this.type}`);if(t.withinChartClip){const t=this.model.get("chartClipId");if(t){const e=an(`#${t}`).select("rect");0!==e.size()&&parseFloat(e.attr("height"))>0&&r.attr("clip-path",`url(#${t})`)}}return r.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?Rp({},this.model.getOptions(),this.configs.options):this.model.getOptions()}};const{entries:Ev,setPrototypeOf:xv,isFrozen:Tv,getPrototypeOf:Ov,getOwnPropertyDescriptor:Sv}=Object;let{freeze:Mv,seal:Av,create:kv}=Object,{apply:Dv,construct:Cv}=typeof Reflect<"u"&&Reflect;Mv||(Mv=function(t){return t}),Av||(Av=function(t){return t}),Dv||(Dv=function(t,e,n){return t.apply(e,n)}),Cv||(Cv=function(t,e){return new t(...e)});const Rv=zv(Array.prototype.forEach),Lv=zv(Array.prototype.pop),Pv=zv(Array.prototype.push),Iv=zv(String.prototype.toLowerCase),Nv=zv(String.prototype.toString),Bv=zv(String.prototype.match),jv=zv(String.prototype.replace),Uv=zv(String.prototype.indexOf),$v=zv(String.prototype.trim),Fv=zv(RegExp.prototype.test),Hv=function(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Cv(t,n)}}(TypeError);function zv(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Dv(t,e,r)}}function Vv(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Iv;xv&&xv(t,null);let r=e.length;for(;r--;){let i=e[r];if("string"==typeof i){const t=n(i);t!==i&&(Tv(e)||(e[r]=t),i=t)}t[i]=!0}return t}function Gv(t){const e=kv(null);for(const[n,r]of Ev(t))void 0!==Sv(t,n)&&(e[n]=r);return e}function Wv(t,e){for(;null!==t;){const n=Sv(t,e);if(n){if(n.get)return zv(n.get);if("function"==typeof n.value)return zv(n.value)}t=Ov(t)}return function(t){return console.warn("fallback value for",t),null}}const Yv=Mv(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Zv=Mv(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),qv=Mv(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Xv=Mv(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Kv=Mv(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Qv=Mv(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Jv=Mv(["#text"]),tb=Mv(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),eb=Mv(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),nb=Mv(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),rb=Mv(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ib=Av(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ob=Av(/<%[\w\W]*|[\w\W]*%>/gm),sb=Av(/\${[\w\W]*}/gm),ab=Av(/^data-[\-\w.\u00B7-\uFFFF]/),lb=Av(/^aria-[\-\w]+$/),cb=Av(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ub=Av(/^(?:\w+script|data):/i),hb=Av(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),db=Av(/^html$/i);var fb=Object.freeze({__proto__:null,MUSTACHE_EXPR:ib,ERB_EXPR:ob,TMPLIT_EXPR:sb,DATA_ATTR:ab,ARIA_ATTR:lb,IS_ALLOWED_URI:cb,IS_SCRIPT_OR_DATA:ub,ATTR_WHITESPACE:hb,DOCTYPE_NAME:db}),pb=function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:typeof window>"u"?null:window;const n=e=>t(e);if(n.version="3.0.6",n.removed=[],!e||!e.document||9!==e.document.nodeType)return n.isSupported=!1,n;let{document:r}=e;const i=r,o=i.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:l,Element:c,NodeFilter:u,NamedNodeMap:h=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=e,m=c.prototype,g=Wv(m,"cloneNode"),y=Wv(m,"nextSibling"),v=Wv(m,"childNodes"),b=Wv(m,"parentNode");if("function"==typeof a){const t=r.createElement("template");t.content&&t.content.ownerDocument&&(r=t.content.ownerDocument)}let _,w="";const{implementation:E,createNodeIterator:x,createDocumentFragment:T,getElementsByTagName:O}=r,{importNode:S}=i;let M={};n.isSupported="function"==typeof Ev&&"function"==typeof b&&E&&void 0!==E.createHTMLDocument;const{MUSTACHE_EXPR:A,ERB_EXPR:k,TMPLIT_EXPR:D,DATA_ATTR:C,ARIA_ATTR:R,IS_SCRIPT_OR_DATA:L,ATTR_WHITESPACE:P}=fb;let{IS_ALLOWED_URI:I}=fb,N=null;const B=Vv({},[...Yv,...Zv,...qv,...Kv,...Jv]);let j=null;const U=Vv({},[...tb,...eb,...nb,...rb]);let $=Object.seal(kv(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),F=null,H=null,z=!0,V=!0,G=!1,W=!0,Y=!1,Z=!1,q=!1,X=!1,K=!1,Q=!1,J=!1,tt=!0,et=!1,nt=!0,rt=!1,it={},ot=null;const st=Vv({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let at=null;const lt=Vv({},["audio","video","img","source","image","track"]);let ct=null;const ut=Vv({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ht="http://www.w3.org/1998/Math/MathML",dt="http://www.w3.org/2000/svg",ft="http://www.w3.org/1999/xhtml";let pt=ft,mt=!1,gt=null;const yt=Vv({},[ht,dt,ft],Nv);let vt=null;const bt=["application/xhtml+xml","text/html"];let _t=null,wt=null;const Et=r.createElement("form"),xt=function(t){return t instanceof RegExp||t instanceof Function},Tt=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!wt||wt!==t){if((!t||"object"!=typeof t)&&(t={}),t=Gv(t),vt=vt=-1===bt.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,_t="application/xhtml+xml"===vt?Nv:Iv,N="ALLOWED_TAGS"in t?Vv({},t.ALLOWED_TAGS,_t):B,j="ALLOWED_ATTR"in t?Vv({},t.ALLOWED_ATTR,_t):U,gt="ALLOWED_NAMESPACES"in t?Vv({},t.ALLOWED_NAMESPACES,Nv):yt,ct="ADD_URI_SAFE_ATTR"in t?Vv(Gv(ut),t.ADD_URI_SAFE_ATTR,_t):ut,at="ADD_DATA_URI_TAGS"in t?Vv(Gv(lt),t.ADD_DATA_URI_TAGS,_t):lt,ot="FORBID_CONTENTS"in t?Vv({},t.FORBID_CONTENTS,_t):st,F="FORBID_TAGS"in t?Vv({},t.FORBID_TAGS,_t):{},H="FORBID_ATTR"in t?Vv({},t.FORBID_ATTR,_t):{},it="USE_PROFILES"in t&&t.USE_PROFILES,z=!1!==t.ALLOW_ARIA_ATTR,V=!1!==t.ALLOW_DATA_ATTR,G=t.ALLOW_UNKNOWN_PROTOCOLS||!1,W=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,Y=t.SAFE_FOR_TEMPLATES||!1,Z=t.WHOLE_DOCUMENT||!1,K=t.RETURN_DOM||!1,Q=t.RETURN_DOM_FRAGMENT||!1,J=t.RETURN_TRUSTED_TYPE||!1,X=t.FORCE_BODY||!1,tt=!1!==t.SANITIZE_DOM,et=t.SANITIZE_NAMED_PROPS||!1,nt=!1!==t.KEEP_CONTENT,rt=t.IN_PLACE||!1,I=t.ALLOWED_URI_REGEXP||cb,pt=t.NAMESPACE||ft,$=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&xt(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&($.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&xt(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&($.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&($.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(V=!1),Q&&(K=!0),it&&(N=Vv({},[...Jv]),j=[],!0===it.html&&(Vv(N,Yv),Vv(j,tb)),!0===it.svg&&(Vv(N,Zv),Vv(j,eb),Vv(j,rb)),!0===it.svgFilters&&(Vv(N,qv),Vv(j,eb),Vv(j,rb)),!0===it.mathMl&&(Vv(N,Kv),Vv(j,nb),Vv(j,rb))),t.ADD_TAGS&&(N===B&&(N=Gv(N)),Vv(N,t.ADD_TAGS,_t)),t.ADD_ATTR&&(j===U&&(j=Gv(j)),Vv(j,t.ADD_ATTR,_t)),t.ADD_URI_SAFE_ATTR&&Vv(ct,t.ADD_URI_SAFE_ATTR,_t),t.FORBID_CONTENTS&&(ot===st&&(ot=Gv(ot)),Vv(ot,t.FORBID_CONTENTS,_t)),nt&&(N["#text"]=!0),Z&&Vv(N,["html","head","body"]),N.table&&(Vv(N,["tbody"]),delete F.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw Hv('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw Hv('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');_=t.TRUSTED_TYPES_POLICY,w=_.createHTML("")}else void 0===_&&(_=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";e&&e.hasAttribute(r)&&(n=e.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return t.createPolicy(i,{createHTML:t=>t,createScriptURL:t=>t})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}}(p,o)),null!==_&&"string"==typeof w&&(w=_.createHTML(""));Mv&&Mv(t),wt=t}},Ot=Vv({},["mi","mo","mn","ms","mtext"]),St=Vv({},["foreignobject","desc","title","annotation-xml"]),Mt=Vv({},["title","style","font","a","script"]),At=Vv({},Zv);Vv(At,qv),Vv(At,Xv);const kt=Vv({},Kv);Vv(kt,Qv);const Dt=function(t){Pv(n.removed,{element:t});try{t.parentNode.removeChild(t)}catch{t.remove()}},Ct=function(t,e){try{Pv(n.removed,{attribute:e.getAttributeNode(t),from:e})}catch{Pv(n.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t&&!j[t])if(K||Q)try{Dt(e)}catch{}else try{e.setAttribute(t,"")}catch{}},Rt=function(t){let e=null,n=null;if(X)t="<remove></remove>"+t;else{const e=Bv(t,/^[\r\n\t ]+/);n=e&&e[0]}"application/xhtml+xml"===vt&&pt===ft&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const i=_?_.createHTML(t):t;if(pt===ft)try{e=(new f).parseFromString(i,vt)}catch{}if(!e||!e.documentElement){e=E.createDocument(pt,"template",null);try{e.documentElement.innerHTML=mt?w:i}catch{}}const o=e.body||e.documentElement;return t&&n&&o.insertBefore(r.createTextNode(n),o.childNodes[0]||null),pt===ft?O.call(e,Z?"html":"body")[0]:Z?e.documentElement:o},Lt=function(t){return x.call(t.ownerDocument||t,t,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null)},Pt=function(t){return"function"==typeof l&&t instanceof l},It=function(t,e,r){M[t]&&Rv(M[t],(t=>{t.call(n,e,r,wt)}))},Nt=function(t){let e=null;if(It("beforeSanitizeElements",t,null),function(t){return t instanceof d&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||!(t.attributes instanceof h)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes)}(t))return Dt(t),!0;const r=_t(t.nodeName);if(It("uponSanitizeElement",t,{tagName:r,allowedTags:N}),t.hasChildNodes()&&!Pt(t.firstElementChild)&&Fv(/<[/\w]/g,t.innerHTML)&&Fv(/<[/\w]/g,t.textContent))return Dt(t),!0;if(!N[r]||F[r]){if(!F[r]&&jt(r)&&($.tagNameCheck instanceof RegExp&&Fv($.tagNameCheck,r)||$.tagNameCheck instanceof Function&&$.tagNameCheck(r)))return!1;if(nt&&!ot[r]){const e=b(t)||t.parentNode,n=v(t)||t.childNodes;if(n&&e)for(let r=n.length-1;r>=0;--r)e.insertBefore(g(n[r],!0),y(t))}return Dt(t),!0}return t instanceof c&&!function(t){let e=b(t);(!e||!e.tagName)&&(e={namespaceURI:pt,tagName:"template"});const n=Iv(t.tagName),r=Iv(e.tagName);return!!gt[t.namespaceURI]&&(t.namespaceURI===dt?e.namespaceURI===ft?"svg"===n:e.namespaceURI===ht?"svg"===n&&("annotation-xml"===r||Ot[r]):!!At[n]:t.namespaceURI===ht?e.namespaceURI===ft?"math"===n:e.namespaceURI===dt?"math"===n&&St[r]:!!kt[n]:t.namespaceURI===ft?!(e.namespaceURI===dt&&!St[r]||e.namespaceURI===ht&&!Ot[r])&&!kt[n]&&(Mt[n]||!At[n]):!("application/xhtml+xml"!==vt||!gt[t.namespaceURI]))}(t)||("noscript"===r||"noembed"===r||"noframes"===r)&&Fv(/<\/no(script|embed|frames)/i,t.innerHTML)?(Dt(t),!0):(Y&&3===t.nodeType&&(e=t.textContent,Rv([A,k,D],(t=>{e=jv(e,t," ")})),t.textContent!==e&&(Pv(n.removed,{element:t.cloneNode()}),t.textContent=e)),It("afterSanitizeElements",t,null),!1)},Bt=function(t,e,n){if(tt&&("id"===e||"name"===e)&&(n in r||n in Et))return!1;if((!V||H[e]||!Fv(C,e))&&(!z||!Fv(R,e)))if(!j[e]||H[e]){if(!(jt(t)&&($.tagNameCheck instanceof RegExp&&Fv($.tagNameCheck,t)||$.tagNameCheck instanceof Function&&$.tagNameCheck(t))&&($.attributeNameCheck instanceof RegExp&&Fv($.attributeNameCheck,e)||$.attributeNameCheck instanceof Function&&$.attributeNameCheck(e))||"is"===e&&$.allowCustomizedBuiltInElements&&($.tagNameCheck instanceof RegExp&&Fv($.tagNameCheck,n)||$.tagNameCheck instanceof Function&&$.tagNameCheck(n))))return!1}else if(!ct[e]&&!Fv(I,jv(n,P,""))&&("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==Uv(n,"data:")||!at[t])&&(!G||Fv(L,jv(n,P,"")))&&n)return!1;return!0},jt=function(t){return t.indexOf("-")>0},Ut=function(t){It("beforeSanitizeAttributes",t,null);const{attributes:e}=t;if(!e)return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:j};let i=e.length;for(;i--;){const o=e[i],{name:s,namespaceURI:a,value:l}=o,c=_t(s);let u="value"===s?l:$v(l);if(r.attrName=c,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,It("uponSanitizeAttribute",t,r),u=r.attrValue,r.forceKeepAttr||(Ct(s,t),!r.keepAttr))continue;if(!W&&Fv(/\/>/i,u)){Ct(s,t);continue}Y&&Rv([A,k,D],(t=>{u=jv(u,t," ")}));const h=_t(t.nodeName);if(Bt(h,c,u)){if(et&&("id"===c||"name"===c)&&(Ct(s,t),u="user-content-"+u),_&&"object"==typeof p&&"function"==typeof p.getAttributeType&&!a)switch(p.getAttributeType(h,c)){case"TrustedHTML":u=_.createHTML(u);break;case"TrustedScriptURL":u=_.createScriptURL(u)}try{a?t.setAttributeNS(a,s,u):t.setAttribute(s,u),Lv(n.removed)}catch{}}}It("afterSanitizeAttributes",t,null)},$t=function t(e){let n=null;const r=Lt(e);for(It("beforeSanitizeShadowDOM",e,null);n=r.nextNode();)It("uponSanitizeShadowNode",n,null),!Nt(n)&&(n.content instanceof s&&t(n.content),Ut(n));It("afterSanitizeShadowDOM",e,null)};return n.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,o=null,a=null,c=null;if(mt=!t,mt&&(t="\x3c!--\x3e"),"string"!=typeof t&&!Pt(t)){if("function"!=typeof t.toString)throw Hv("toString is not a function");if("string"!=typeof(t=t.toString()))throw Hv("dirty is not a string, aborting")}if(!n.isSupported)return t;if(q||Tt(e),n.removed=[],"string"==typeof t&&(rt=!1),rt){if(t.nodeName){const e=_t(t.nodeName);if(!N[e]||F[e])throw Hv("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof l)r=Rt("\x3c!----\x3e"),o=r.ownerDocument.importNode(t,!0),1===o.nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?r=o:r.appendChild(o);else{if(!K&&!Y&&!Z&&-1===t.indexOf("<"))return _&&J?_.createHTML(t):t;if(r=Rt(t),!r)return K?null:J?w:""}r&&X&&Dt(r.firstChild);const u=Lt(rt?t:r);for(;a=u.nextNode();)Nt(a)||(a.content instanceof s&&$t(a.content),Ut(a));if(rt)return t;if(K){if(Q)for(c=T.call(r.ownerDocument);r.firstChild;)c.appendChild(r.firstChild);else c=r;return(j.shadowroot||j.shadowrootmode)&&(c=S.call(i,c,!0)),c}let h=Z?r.outerHTML:r.innerHTML;return Z&&N["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&Fv(db,r.ownerDocument.doctype.name)&&(h="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+h),Y&&Rv([A,k,D],(t=>{h=jv(h,t," ")})),_&&J?_.createHTML(h):h},n.setConfig=function(){Tt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),q=!0},n.clearConfig=function(){wt=null,q=!1},n.isValidAttribute=function(t,e,n){wt||Tt({});const r=_t(t),i=_t(e);return Bt(r,i,n)},n.addHook=function(t,e){"function"==typeof e&&(M[t]=M[t]||[],Pv(M[t],e))},n.removeHook=function(t){if(M[t])return Lv(M[t])},n.removeHooks=function(t){M[t]&&(M[t]=[])},n.removeAllHooks=function(){M={}},n}();const mb=t=>pb.sanitize(t,{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),gb=t=>pb.sanitize(t,{ALLOWED_TAGS:[]}),yb=class t extends wv{constructor(){super(...arguments),this.type="toolbar",this.renderType=P.HTML}init(){const t=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(L.Toolbar.SHOW_OVERFLOW_MENU,(()=>{this.renderOverflowMenu(),document.body.addEventListener("click",t)})),this.services.events.addEventListener(L.Toolbar.HIDE_OVERFLOW_MENU,(()=>{document.body.removeEventListener("click",t)}))}render(t=!0){const e=this.getComponentContainer().attr("role","toolbar").attr("aria-label",`chart-${this.services.domUtils.getChartID()} toolbar`);if(Hm(this.getOptions(),"data","loading"))e.html(""),this.overflowMenu=null;else{this.overflowMenu||(this.overflowMenu=e.append("div").attr("class","cds--overflow-menu-options cds--overflow-menu--flip cds--overflow-menu-options cds--overflow-menu--flip").attr("tabindex",-1).html("<ul role='menu'></ul>"));const{buttonList:t,overflowMenuItemList:n}=this.getControlConfigs();n&&t.push(this.getOverflowButtonConfig());const r=e.selectAll("div.toolbar-control").data(t,(t=>t.id));r.exit().remove();const i=r.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu"),o=this;i.merge(r).classed("disabled",(t=>t.shouldBeDisabled())).attr("aria-disabled",(t=>t.shouldBeDisabled())).attr("aria-label",(t=>t.title)).html((t=>`\n\t\t\t<button\n\t\t\t\tclass="cds--overflow-menu__trigger cds--overflow-menu__trigger"\n\t\t\t\taria-haspopup="true" aria-expanded="false" id="${this.services.domUtils.generateElementIDString(`control-${gb(t.id)}`)}" aria-label="${gb(t.title)}">\n\t\t\t\t<svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" class="cds--overflow-menu__icon cds--overflow-menu__icon" viewBox="0 0 32 32" aria-hidden="true">\n\t\t\t\t\t${(t=>pb.sanitize(t,{NAMESPACE:"http://www.w3.org/2000/svg",USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}))(t.iconSVG.content)}\n\t\t\t\t</svg>\n\t\t\t</button>`)).each((function(t,e){an(this).select("svg").style("will-change","transform").style("width",void 0!==t.iconSVG.width?t.iconSVG.width:"20px").style("height",void 0!==t.iconSVG.height?t.iconSVG.height:"20px"),an(this).select("button").on("click",(e=>{t.shouldBeDisabled()||o.triggerFunctionAndEvent(t,e,this)})).on("keydown",(n=>{n.key&&"Enter"===n.key||" "===n.key?(n.preventDefault(),o.triggerFunctionAndEvent(t,n,this)):n.key&&"ArrowLeft"===n.key?o.focusOnPreviousEnabledToolbarItem(e):n.key&&"ArrowRight"===n.key&&o.focusOnNextEnabledToolbarItem(e)}))})),this.overflowButton=this.getComponentContainer().select(`button.cds--overflow-menu__trigger#${this.services.domUtils.generateElementIDString("control-toolbar-overflow-menu")}`)}}renderOverflowMenu(){const{overflowMenuItemList:t}=this.getControlConfigs(),e=this.overflowMenu.select("ul").selectAll("li.cds--overflow-menu-options__option").data(t,(t=>Hm(t,"id")));e.exit().remove();const n=e.enter().append("li").attr("id",(t=>this.services.domUtils.generateElementIDString(`control-${t.id}`))).attr("class","cds--overflow-menu-options__option cds--overflow-menu-options__option").attr("role","menuitem").attr("tabindex",1);n.append("button").attr("class","cds--overflow-menu-options__btn cds--overflow-menu-options__btn"),n.merge(e).classed("cds--overflow-menu-options__option--disabled",(t=>t.shouldBeDisabled())).classed("cds--overflow-menu-options__option--disabled",(t=>t.shouldBeDisabled())).attr("aria-disabled",(t=>t.shouldBeDisabled())).selectAll("button").text((t=>t.text))}isOverflowMenuOpen(){return this.overflowMenu.classed("is-open")}updateOverflowMenu(t){this.overflowMenu&&(this.overflowMenu.classed("is-open",t),this.overflowButton&&(this.overflowButton.attr("aria-expanded",t),an(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",t).classed("cds--overflow-menu--open",t)),t?this.services.events.dispatchEvent(L.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(L.Toolbar.HIDE_OVERFLOW_MENU))}focusOnPreviousEnabledToolbarItem(t){const e=this.getToolbarButtonItems();let n=e.length;for(let r=t-1;r>=0;r--)if(!e[r].shouldBeDisabled()){n=r;break}if(n<e.length){const t=an(`button#${this.services.domUtils.generateElementIDString(`control-${e[n].id}`)}`).node();"focus"in t&&t.focus()}}focusOnNextEnabledToolbarItem(t){const e=this.getToolbarButtonItems();let n=-1;for(let r=t+1;r<e.length;r++)if(!e[r].shouldBeDisabled()){n=r;break}if(n>-1){const t=an(`button#${this.services.domUtils.generateElementIDString(`control-${e[n].id}`)}`).node();"focus"in t&&t.focus()}}focusOnPreviousEnabledMenuItem(t){const e=this.getOverflowMenuItems();let n=e.length;for(let r=t-1;r>=0;r--)if(!e[r].shouldBeDisabled()){n=r;break}if(n<e.length){const t=an(`#${this.services.domUtils.generateElementIDString(`control-${e[n].id}`)} button`).node();"focus"in t&&t.focus()}}focusOnNextEnabledMenuItem(t){const e=this.getOverflowMenuItems();let n=-1;for(let r=t+1;r<e.length;r++)if(!e[r].shouldBeDisabled()){n=r;break}if(n>-1){const t=an(`#${this.services.domUtils.generateElementIDString(`control-${e[n].id}`)} button`).node();"focus"in t&&t.focus()}}toggleOverflowMenu(t){if(this.isOverflowMenuOpen())this.updateOverflowMenu(!1);else{this.updateOverflowMenu(!0);const e=this;this.getOverflowMenuItems().forEach(((n,r)=>{const i=an(`#${this.services.domUtils.generateElementIDString(`control-${n.id}`)}`);null!==i&&(i.on("click",(()=>{e.triggerFunctionAndEvent(n,t,i.node()),e.updateOverflowMenu(!1)})),i.on("keydown",(o=>{o&&"Enter"===o.key?e.triggerFunctionAndEvent(n,t,i.node()):o&&"ArrowUp"===o.key?e.focusOnPreviousEnabledMenuItem(r):o&&"ArrowDown"===o.key?e.focusOnNextEnabledMenuItem(r):o&&"Escape"===o.key&&e.updateOverflowMenu(!1),o.preventDefault()})))})),e.focusOnNextEnabledMenuItem(-1)}t&&t.stopImmediatePropagation()}triggerFunctionAndEvent(t,e,n){"function"==typeof t.shouldBeDisabled&&t.shouldBeDisabled()||("function"==typeof t.clickFunction&&t.clickFunction(e),this.services.events.dispatchEvent(L.Toolbar.BUTTON_CLICK,{control:t,event:e,element:n}))}getControlConfigs(){const e=Hm(this.getOptions(),"toolbar","numberOfIcons")-1,n=Hm(this.getOptions(),"toolbar","controls"),r=[],i=[],o=[];return n.forEach((n=>{let s=null;n.type===J.CUSTOM?(null===Hm(n,"id")&&(n.id="toolbar-button-"+t.buttonID++),null===Hm(n,"shouldBeDisabled")&&(n.shouldBeDisabled=()=>!1),s=n):s=this.getControlConfigByType(n.type),s&&(s.text=n.text?n.text:n.type,-1!==s.id.indexOf("toolbar-export")?r.push(s):i.length<e?null===Hm(s,"iconSVG","content")?o.push(s):i.push(s):o.push(s))})),o.push(...r),o.length?{buttonList:i,overflowMenuItemList:o}:{buttonList:i}}getToolbarButtonItems(){const{buttonList:t,overflowMenuItemList:e}=this.getControlConfigs();return e&&t.push(this.getOverflowButtonConfig()),t||[]}getOverflowMenuItems(){const{overflowMenuItemList:t}=this.getControlConfigs();return t||[]}getOverflowButtonConfig(){return{id:"toolbar-overflow-menu",title:"More options",shouldBeDisabled:()=>!1,iconSVG:{content:'<circle cx="16" cy="8" r="2"></circle>\n\t\t\t\t<circle cx="16" cy="16" r="2"></circle>\n\t\t\t\t<circle cx="16" cy="24" r="2"></circle>'},clickFunction:t=>this.toggleOverflowMenu(t)}}getControlConfigByType(t){const e=this.services.zoom&&this.services.zoom.isZoomBarEnabled()&&!this.services.zoom.isEmptyState(),n=this.model.getDisplayData();let r;switch(t){case J.ZOOM_IN:e&&(r={id:"toolbar-zoomIn",title:"Zoom in",shouldBeDisabled:()=>this.services.zoom.isMinZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomIn()});break;case J.ZOOM_OUT:e&&(r={id:"toolbar-zoomOut",title:"Zoom out",shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomOut()});break;case J.RESET_ZOOM:e&&(r={id:"toolbar-resetZoom",title:"Reset zoom",shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.resetZoomDomain()});break;case J.MAKE_FULLSCREEN:r={id:"toolbar-makefullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:"Make fullscreen",shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case J.SHOW_AS_DATATABLE:r={id:"toolbar-showasdatatable",iconSVG:{content:this.getControlIconByType(t)},title:"Show as table",shouldBeDisabled:()=>0===n.length,clickFunction:()=>this.services.events.dispatchEvent(L.Modal.SHOW)};break;case J.EXPORT_CSV:r={id:"toolbar-export-CSV",title:"Export as CSV",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.model.exportToCSV()};break;case J.EXPORT_PNG:r={id:"toolbar-export-PNG",title:"Export as PNG",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToPNG()};break;case J.EXPORT_JPG:r={id:"toolbar-export-JPG",title:"Export as JPG",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToJPG()};break;default:throw Error("Not supported toolbar control type: "+t)}return r}getControlIconByType(t){switch(t){case J.ZOOM_IN:return'<polygon points="19 13 15 13 15 9 13 9 13 13 9 13 9 15 13 15 13 19 15 19 15 15 19 15 19 13"/>\n\t\t\t\t\t\t<path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>';case J.ZOOM_OUT:return'<rect x="9" y="13" width="10" height="2"/>\n\t\t\t\t\t\t<path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>';case J.RESET_ZOOM:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case J.MAKE_FULLSCREEN:return'<polygon points="21 2 21 4 26.59 4 17 13.58 18.41 15 28 5.41 28 11 30 11 30 2 21 2"/><polygon points="15 18.42 13.59 17 4 26.59 4 21 2 21 2 30 11 30 11 28 5.41 28 15 18.42"/>';case J.SHOW_AS_DATATABLE:return'<rect x="4" y="6" width="18" height="2"/><rect x="4" y="12" width="18" height="2"/><rect x="4" y="18" width="18" height="2"/><rect x="4" y="24" width="18" height="2"/><rect x="26" y="6" width="2" height="2"/><rect x="26" y="12" width="2" height="2"/><rect x="26" y="18" width="2" height="2"/><rect x="26" y="24" width="2" height="2"/>';case J.EXPORT_CSV:case J.EXPORT_JPG:case J.EXPORT_PNG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';default:throw Error("Not supported toolbar control type: "+t)}}};yb.buttonID=0;let vb=yb;const bb=class t extends wv{constructor(e,n,r,i){super(e,n,i),this.type="layout",this.configs=i,this.children=r,this._instanceID=t.instanceID++,this.init()}init(){this.children.forEach((t=>{t.components.forEach((t=>{t.init()}))}))}getPreferedAndFixedSizeSum(){const t=this.parent;let e=0;return t.selectAll(`div.layout-child-${this._instanceID}`).filter((t=>{const e=Hm(t,"growth");return e===Y.PREFERRED||e===Y.FIXED})).each((function(t){e+=t.size})),e}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter((t=>Hm(t,"growth")===Y.STRETCH)).size()}render(t=!0){const e=this.parent,{width:n,height:r}=Dy.getHTMLElementSize(e.node()),i=this.configs.direction===W.ROW||this.configs.direction===W.ROW_REVERSE,o=Hm(this.model.getOptions(),"style","prefix"),s=e.classed(`${$p}--${o}--layout-row`,this.configs.direction===W.ROW).classed(`${$p}--${o}--layout-row-reverse`,this.configs.direction===W.ROW_REVERSE).classed(`${$p}--${o}--layout-column`,this.configs.direction===W.COLUMN).classed(`${$p}--${o}--layout-column-reverse`,this.configs.direction===W.COLUMN_REVERSE).classed(`${$p}--${o}--layout-alignitems-center`,this.configs.alignItems===Z.CENTER).selectAll(`div.layout-child-${this._instanceID}`).data(this.children,(t=>t.id));s.enter().append("div").merge(e.selectAll(`div.layout-child-${this._instanceID}`)).attr("class",(t=>`layout-child layout-child-${this._instanceID} ${t.id}`)).each((function(e){e.components.forEach((n=>{const r=an(this),i=Hm(e,"renderType")===P.SVG;n.setParent(i?Dy.appendOrSelect(r,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):r);const o=Hm(e,"growth");(o===Y.PREFERRED||o===Y.FIXED)&&n.render(t)}))})),e.selectAll(`div.layout-child-${this._instanceID}`).style("height",null).style("width",null).each((function(t){const e=Hm(t,"growth"),o=Hm(t,"renderType")===P.SVG?Dy.getSVGElementSize(an(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):Dy.getHTMLElementSize(this);if(e===Y.PREFERRED){const e=i?o.width:o.height,s=i?n:r;t.size=e/s*100}})),s.exit().remove(),this.children.filter((t=>Hm(t,"growth")===Y.STRETCH)).forEach((t=>{t.size=(100-+this.getPreferedAndFixedSizeSum())/+this.getNumOfStretchChildren()}));const a=e.selectAll(`div.layout-child-${this._instanceID}`).data(this.children,(t=>t.id));i?a.style("width",(t=>t.size/100*n+"px")).style("height","100%"):a.style("height",(t=>t.size/100*r+"px")).style("width","100%"),a.each((function(e){e.components.forEach((n=>{Hm(e,"growth")===Y.STRETCH&&n.render(t)}))}))}setModel(t){super.setModel(t),this.children.forEach((e=>{e.components.forEach((e=>e.setModel(t)))}))}setServices(t){super.setServices(t),this.children.forEach((e=>{e.components.forEach((e=>e.setServices(t)))}))}destroy(){this.children.forEach((t=>{t.components.forEach((t=>t.destroy()))}))}};bb.instanceID=Math.floor(99999999999*Math.random());let _b=bb;class wb extends wv{constructor(){super(...arguments),this.type="spacer"}render(t=!1){this.getComponentContainer().style("width",`${this.configs.size||Qp}px`).style("height",`${this.configs.size||Qp}px`).attr("opacity",0)}}var Eb="bx",xb="\n a[href], area[href], input:not([disabled]):not([tabindex='-1']),\n button:not([disabled]):not([tabindex='-1']),select:not([disabled]):not([tabindex='-1']),\n textarea:not([disabled]):not([tabindex='-1']),\n iframe, object, embed, *[tabindex]:not([tabindex='-1']), *[contenteditable=true]\n ";function Tb(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ob(t){return t.reduce((function(t,e){return Array.isArray(e)?t.push.apply(t,function(t){return function(t){if(Array.isArray(t))return Tb(t)}(t)||function(t){if(typeof Symbol<"u"&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return Tb(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Tb(t,e)}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(Ob(e))):t.push(e),t}),[])}function Sb(t){return(Sb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Mb(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ab(t,e){return(Ab=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function kb(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Db(t){return(Db=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Cb(t){return(Cb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Rb(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Lb(){return Lb=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ib(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Lb.apply(this,arguments)}function Pb(t,e){return(Pb=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ib(t){return(Ib=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Nb(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return t.addEventListener.apply(t,n),{release:function(){return t.removeEventListener.apply(t,n),null}}}function Bb(t){return(Bb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jb(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ub(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function $b(t,e){return($b=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Fb(t){return(Fb=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Hb(t,e){var n=t.target,r=t.currentTarget;if("function"==typeof n.matches){if(n.matches(e))return n;if(n.matches("".concat(e," *"))){var i=n.closest(e);if((r.nodeType===Node.DOCUMENT_NODE?r.documentElement:r).contains(i))return i}}}function zb(t){if(!t||"function"==typeof t)return{launchingElement:null,launchingEvent:null};var e=t.delegateTarget||t.currentTarget||t,n=t.currentTarget&&t;if(e&&!e.nodeType)throw new TypeError("DOM Node should be given for launching element.");if(n&&!n.type)throw new TypeError("DOM event should be given for launching event.");return{launchingElement:e,launchingEvent:n}}function Vb(t){return(Vb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Gb(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Wb(t,e){return(Wb=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Yb(t){return(Yb=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Zb=[function(t){var e=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$b(t,e)}(n,t);var e=function(t){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=Fb(t);if(e){var i=Fb(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(t,e){if(e&&("object"===Bb(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}(n);function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),e.apply(this,arguments)}return function(t,e){e&&Ub(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1})}(n,[{key:"_changeState",value:function(){throw new Error("_changeState() should be overridden to perform actual change in state.")}},{key:"changeState",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i="string"==typeof n[0]?n.shift():void 0,o=Object(n[0])===n[0]&&"function"!=typeof n[0]?n.shift():void 0,s="function"==typeof n[0]?n.shift():void 0;if("function"!=typeof this.shouldStateBeChanged||this.shouldStateBeChanged(i,o)){var a={group:o&&o.group,state:i},l=[a.group,i].filter(Boolean).join("-").split("-").map((function(t){return t[0].toUpperCase()+t.substr(1)})).join(""),c=new CustomEvent(this.options["eventBefore".concat(l)],{bubbles:!0,cancelable:!0,detail:o}),u=o&&o.delegatorNode||this.element;if(u.dispatchEvent(c)){var h=[i,o].filter(Boolean);this._changeState.apply(this,function(t){return function(t){if(Array.isArray(t))return jb(t)}(t)||function(t){if(typeof Symbol<"u"&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return jb(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jb(t,e)}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(h).concat([function(){u.dispatchEvent(new CustomEvent(t.options["eventAfter".concat(l)],{bubbles:!0,cancelable:!0,detail:o})),s&&s()}]))}else if(s){var d=new Error("Changing state (".concat(JSON.stringify(a),") has been canceled."));d.canceled=!0,s(d)}}else s&&s(null,!0)}}]),n}(t);return e},function(t){var e=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wb(t,e)}(n,t);var e=function(t){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=Yb(t);if(e){var i=Yb(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(t,e){if(e&&("object"===Vb(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}(n);function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),e.apply(this,arguments)}return function(t,e){e&&Gb(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1})}(n,[{key:"show",value:function(t,e){(!t||"function"==typeof t)&&(e=t),this.changeState("shown",zb(t),e)}},{key:"hide",value:function(t,e){(!t||"function"==typeof t)&&(e=t),this.changeState("hidden",zb(t),e)}}]),n}(t);return e}];function qb(t){return(qb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Xb(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Kb(t,e){return(Kb=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Qb(t){return(Qb=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Jb(t){return(Jb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function t_(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function e_(t,e){return(e_=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function n_(t){return(n_=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var r_=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&e_(t,e)}(n,t);var e=function(t){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=n_(t);if(e){var i=n_(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(t,e){if(e&&("object"===Jb(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}(n);function n(t,r){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),(i=e.call(this,t,r))._handleFocusinListener=void 0,i._handleKeydownListener=void 0,i._handleFocusin=function(t){var e=i.element.querySelector(i.options.selectorModalContainer)||i.element;i.element.classList.contains(i.options.classVisible)&&!e.contains(t.target)&&i.options.selectorsFloatingMenus.every((function(e){return!Hb(t,e)}))&&i.element.querySelector(xb).focus()},i._hookCloseActions(),i}return function(t,e,n){e&&t_(t.prototype,e),n&&t_(t,n),Object.defineProperty(t,"prototype",{writable:!1})}(n,[{key:"createdByLauncher",value:function(t){this.show(t)}},{key:"shouldStateBeChanged",value:function(t){return"shown"===t?!this.element.classList.contains(this.options.classVisible):this.element.classList.contains(this.options.classVisible)}},{key:"_changeState",value:function(t,e,n){var r,i=this;if(this._handleFocusinListener&&(this._handleFocusinListener=this.unmanage(this._handleFocusinListener).release()),"shown"===t){var o="onfocusin"in this.element.ownerDocument.defaultView,s=o?"focusin":"focus";this._handleFocusinListener=this.manage(Nb(this.element.ownerDocument,s,this._handleFocusin,!o))}"hidden"===t?(this.element.classList.toggle(this.options.classVisible,!1),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!1),(this.options.selectorFocusOnClose||this.previouslyFocusedNode)&&(this.element.ownerDocument.querySelector(this.options.selectorFocusOnClose)||this.previouslyFocusedNode).focus()):"shown"===t&&(this.element.classList.toggle(this.options.classVisible,!0),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!0)),r=this.manage(Nb(this.element,"transitionend",(function(){r&&(r=i.unmanage(r).release()),"shown"===t&&i.element.offsetWidth>0&&i.element.offsetHeight>0&&(i.previouslyFocusedNode=i.element.ownerDocument.activeElement,(i.element.querySelector(i.options.selectorPrimaryFocus)||i.element.querySelector(xb)).focus()),n()})))}},{key:"_hookCloseActions",value:function(){var t=this;this.manage(Nb(this.element,"click",(function(e){var n=Hb(e,t.options.selectorModalClose);n&&(e.delegateTarget=n),(n||e.target===t.element)&&t.hide(e)}))),this._handleKeydownListener&&(this._handleKeydownListener=this.unmanage(this._handleKeydownListener).release()),this._handleKeydownListener=this.manage(Nb(this.element.ownerDocument.body,"keydown",(function(e){27===e.which&&t.shouldStateBeChanged("hidden")&&(e.stopPropagation(),t.hide(e))})))}}],[{key:"options",get:function(){var t=Eb;return{selectorInit:"[data-modal]",selectorModalClose:"[data-modal-close]",selectorPrimaryFocus:"[data-modal-primary-focus]",selectorsFloatingMenus:[".".concat(t,"--overflow-menu-options"),".".concat(t,"--tooltip"),".flatpickr-calendar"],selectorModalContainer:".".concat(t,"--modal-container"),classVisible:"is-visible",classBody:"".concat(t,"--body--with-modal-open"),attribInitTarget:"data-modal-target",initEventNames:["click"],eventBeforeShown:"modal-beingshown",eventAfterShown:"modal-shown",eventBeforeHidden:"modal-beinghidden",eventAfterHidden:"modal-hidden"}}}]),n.components=new WeakMap,n}(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return Ob(e).reduce((function(t,e){return e(t)}),function(){return function(t){return Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}))}())}((function(t){var e=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ab(t,e)}(n,t);var e=function(t){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=Db(t);if(e){var i=Db(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(t,e){if(e&&("object"===Sb(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return kb(t)}(this,n)}}(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),(r=e.call(this,t,i)).children=[],!t||t.nodeType!==Node.ELEMENT_NODE)throw new TypeError("DOM element should be given to initialize this widget.");return r.element=t,r.options=Object.assign(Object.create(r.constructor.options),i),r.constructor.components.set(r.element,kb(r)),r}return function(t,e,n){e&&Mb(t.prototype,e),n&&Mb(t,n),Object.defineProperty(t,"prototype",{writable:!1})}(n,[{key:"release",value:function(){for(var t=this.children.pop();t;t=this.children.pop())t.release();return this.constructor.components.delete(this.element),null}}],[{key:"create",value:function(t,e){return this.components.get(t)||new this(t,e)}}]),n}(t);return e}),(function(t){var e=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Kb(t,e)}(n,t);var e=function(t){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=Qb(t);if(e){var i=Qb(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(t,e){if(e&&("object"===qb(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}(n);function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),e.apply(this,arguments)}return function(t,e,n){n&&Xb(t,n),Object.defineProperty(t,"prototype",{writable:!1})}(n,0,[{key:"init",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object.assign(Object.create(this.options),n);if(!e||e.nodeType!==Node.ELEMENT_NODE&&e.nodeType!==Node.DOCUMENT_NODE)throw new TypeError("DOM document or DOM element should be given to search for and initialize this widget.");if(e.nodeType!==Node.ELEMENT_NODE||!e.matches(r.selectorInit)){var i=r.initEventNames.map((function(i){return Nb(e,i,(function(e){var i=Hb(e,"[".concat(r.attribInitTarget,"]"));if(i){e.delegateTarget=i;var o=i.ownerDocument.querySelectorAll(i.getAttribute(r.attribInitTarget));if(o.length>1)throw new Error("Target widget must be unique.");if(1===o.length){"A"===i.tagName&&e.preventDefault();var s=t.create(o[0],n);"function"==typeof s.createdByLauncher&&s.createdByLauncher(e)}}}))}));return{release:function(){for(var t=i.pop();t;t=i.pop())t.release()}}}return this.create(e,n),""}}]),n.forLazyInit=!0,n}(t);return e}),Zb,(function(t){var e=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Pb(t,e)}(n,t);var e=function(t){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=Ib(t);if(e){var i=Ib(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(t,e){if(e&&("object"===Cb(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}(n);function n(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(t=e.call.apply(e,[this].concat(i))).handles=new Set,t}return function(t,e){e&&Rb(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1})}(n,[{key:"manage",value:function(t){return this.handles.add(t),t}},{key:"unmanage",value:function(t){return this.handles.delete(t),t}},{key:"release",value:function(){var t=this;return this.handles.forEach((function(e){e.release(),t.handles.delete(e)})),Lb(Ib(n.prototype),"release",this).call(this)}}]),n}(t);return e})));const i_=r_;class o_ extends wv{constructor(t,e,n){super(t,e,n),this.type="modal",this.isEventListenerAdded=!1,this.handleShowModal=()=>{this.modal.attr("data-modal",!0).attr("class","cds--modal").attr("role","dialog").attr("aria-modal",!0).attr("aria-labelledby","modal-title").attr("aria-describedby","modal-description").attr("tabindex",-1),this.modal.html(this.getModalHTML()),this.modal.select("div.cds--modal-footer button.cds--btn").on("click",(()=>this.model.exportToCSV())),i_.create(this.modal.node()).show(),document.addEventListener("modal-hidden",this.handleHideModal)},this.handleHideModal=()=>{this.modal.attr("role",null).attr("aria-modal",null).attr("aria-labelledby",null).attr("aria-describedby",null).attr("tabindex",null),document.removeEventListener("modal-hidden",this.handleHideModal)},this.init()}addEventListeners(){this.services.events.addEventListener(L.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(L.Modal.SHOW,this.handleShowModal)}getModalHTML(){const t=this.model.getOptions(),e=Hm(t,"style","prefix"),n=this.model.getTabularDataArray();return`\n\t\t<div class="cds--modal-container cds--modal-container">\n\t\t\t<div class="cds--modal-header cds--modal-header">\n\t\t\t\t<p class="cds--modal-header__label cds--type-delta cds--modal-header__label cds--type-delta" id="modal-title">Tabular representation</p>\n\n\t\t\t\t<p class="cds--modal-header__heading cds--type-beta cds--modal-header__heading cds--type-beta" id="modal-description">${gb(t.title)}</p>\n\n\t\t\t\t<button class="cds--modal-close cds--modal-close" type="button" data-modal-close aria-label="close modal" data-modal-primary-focus>\n\t\t\t\t\t<svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" aria-label="Close" width="20" height="20" viewBox="0 0 32 32" role="img" class="cds--modal-close__icon cds--modal-close__icon">\n\t\t\t\t\t\t<path d="M24 9.4L22.6 8 16 14.6 9.4 8 8 9.4 14.6 16 8 22.6 9.4 24 16 17.4 22.6 24 24 22.6 17.4 16 24 9.4z"></path>\n\t\t\t\t\t</svg>\n\t\t\t\t</button>\n\t\t\t</div>\n\n\t\t\t<div class="cds--modal-content cds--modal-content">\n\t\t\t\t<table class="cds--data-table cds--data-table--no-border cds--data-table cds--data-table--no-border">\n\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t${rd(n,0).map((t=>`<th scope="col">\n\t\t\t\t\t\t\t\t<div class="cds--table-header-label cds--table-header-label">${gb(t)}</div>\n\t\t\t\t\t\t\t</th>`)).join("")}\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</thead>\n\n\t\t\t\t\t<tbody>${n.slice(1).map((t=>`\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t${t.map((t=>`<td>${gb(t)}</td>`)).join("")}\n\t\t\t\t\t\t\t</tr>`)).join("")}\n\t\t\t\t\t</tbody>\n\t\t\t\t</table>\n\t\t\t</div>\n\n\t\t\t<div class="cds--modal-footer cds--modal-footer">\n\t\t\t <div class="${$p}--${e}-modal-footer-spacer"></div>\n\t\t\t <button class="cds--btn cds--btn--primary cds--btn cds--btn--primary" type="button" data-modal-primary-focus>Download as CSV</button>\n\t\t\t</div>\n\t\t</div>`}render(t=!1){const e=this.model.getOptions();if(!this.isEventListenerAdded){const t=an(this.services.domUtils.getHolder()),n=Hm(e,"style","prefix");this.modal=Dy.appendOrSelect(t,`div.${$p}--${n}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class s_ extends wv{constructor(){super(...arguments),this.type="title",this.renderType=P.HTML}render(t=!1){const e=this.getComponentContainer(),n=Hm(this.getOptions(),"title"),r=e.selectAll("p.title").data([n]);if(r.enter().append("p").classed("title",!0).attr("role","heading").attr("aria-level",2).merge(r).html((t=>gb(t))),r.node()&&r.node().offsetWidth<r.node().scrollWidth){const t=this;r.on("mouseover",(function(e){t.services.events.dispatchEvent(L.Tooltip.SHOW,{event:e,hoveredElement:r,content:r.text()})})).on("mousemove",(function(e){t.services.events.dispatchEvent(L.Tooltip.MOVE,{event:e})})).on("mouseout",(function(){t.services.events.dispatchEvent(L.Tooltip.HIDE)}))}r.exit().remove()}truncateTitle(t,e){if(e<=0)return;const n=t.text();if(t.node().getComputedTextLength()>e){t.append("tspan").text("...");const r=Dy.appendOrSelect(t,"tspan").node().getComputedTextLength(),i=t.text(),o=this.getSubstringIndex(t.node(),0,i.length-1,e-r);t.html(i.substring(0,o-1)).append("tspan").text("...");const s=this;t.on("mouseover",(function(e){s.services.events.dispatchEvent(L.Tooltip.SHOW,{event:e,hoveredElement:t,content:n})})).on("mousemove",(function(t){s.services.events.dispatchEvent(L.Tooltip.MOVE,{event:t})})).on("mouseout",(function(){s.services.events.dispatchEvent(L.Tooltip.HIDE)}))}}getMaxTitleWidth(){return Dy.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(t,e,n,r){const i=Math.floor((n+e)/2);return t.getSubStringLength(0,i)>r?this.getSubstringIndex(t,e,i,r):t.getSubStringLength(0,i)<r?t.getSubStringLength(0,i+1)>r?i:this.getSubstringIndex(t,i,n,r):i}}class a_ extends wv{constructor(){super(...arguments),this.type="legend",this.renderType=P.HTML}render(t=!1){const e=this.getOptions(),n=Hm(e,"legend"),r=Hm(n,"alignment"),i=Hm(e,"legend","orientation");let o=this.model.getDataGroups();const{DISABLED:s}=qp.items.status,a=o.some((t=>t.status===s)),l=Hm(n,"order"),c=this.getComponentContainer().classed("center-aligned",r===z.CENTER).classed("right-aligned",r===z.RIGHT).classed(i,!0).classed("has-deactivated-items",a).attr("role",kg.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");l&&(o=this.sortDataGroups(o,l));const u=c.selectAll("div.legend-item").data(o,(t=>t.name)),h=u.enter().append("div").attr("class","legend-item");h.merge(c.selectAll("div.legend-item")).classed("active",(function(t){return t.status===qp.items.status.ACTIVE}));const d=Hm(this.getOptions(),"legend","clickable");c.classed("clickable",d&&o.length>1);const f=qp.checkbox.radius,p=h.append("div").classed("checkbox",!0),m=p.merge(u.select("div.checkbox")).attr("role",kg.CHECKBOX).attr("tabindex",d?0:-1).attr("aria-labelledby",((t,e)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${e}-title`))).attr("aria-checked",(({status:t})=>t===qp.items.status.ACTIVE)).attr("width",2*f).attr("height",2*f).attr("class",(t=>this.model.getColorClassName({classNameTypes:[N.BACKGROUND],dataGroupName:t.name,originalClassName:"checkbox"}))).style("background",(t=>t.status===qp.items.status.ACTIVE?this.model.getFillColor(t.name)||this.model.getStrokeColor(t.name):null)).classed("active",(function(t){return t.status===qp.items.status.ACTIVE}));p.append("svg").attr("focusable",!1).attr("preserveAspectRatio","xMidYMid meet").attr("xmlns","http://www.w3.org/2000/svg").attr("width","11").attr("height","11").attr("viewBox","0 0 31 28").attr("aria-hidden",!0).style("will-change","transform").append("path").attr("d","M13 21.2l-7.1-7.1-1.4 1.4 7.1 7.1L13 24 27.1 9.9l-1.4-1.5z"),h.append("p").merge(u.select("p"));const g=Hm(e,"legend","additionalItems");if(g&&o.length){const t=this,e=c.selectAll("div.additional-item").data(g);e.exit().remove();const n=e.enter().append("div").merge(e).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",((t,e)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${m.size()+e}-title`)));n.selectAll("*").remove();let r,i=1;n.append("svg").classed("icon",!0).each((function(e){const n=an(this);r&&r==e.type?i++:(r=e.type,i=1),t.addAdditionalItem(n,e,i)})),n.append("p").merge(n.select("p")),this.truncateLegendText()}u.exit().on("mouseover",null).on("click",null).on("mouseout",null).remove(),d&&h.size()>1&&this.addEventListeners()}sortDataGroups(t,e){if(t.sort(((t,n)=>e.indexOf(t.name)-e.indexOf(n.name))),e.length<t.length){const n=t.length-e.length;return t.slice(n).concat(t.slice(0,n))}return t}addAdditionalItem(t,e,n){const{width:r,height:i}=qp.area;if(e.type===et.RADIUS?t.style("width",`${i}px`).style("height",`${i}px`):t.style("width",`${r}px`).style("height",`${i}px`),e.type===et.RADIUS){const{iconData:n,fill:r,stroke:i}=qp.radius;t.attr("fill","none").selectAll("circle").data(n).enter().append("circle").classed("radius",!0).attr("role",kg.IMG).attr("aria-label","radius").attr("cx",(t=>t.cx)).attr("cy",(t=>t.cy)).attr("r",(t=>t.r)).style("fill",e.fill?e.fill:r).style("stroke",e.stroke?e.stroke:i)}else if(e.type===et.LINE){const i=qp.line;t.select("line.line").empty()&&t.append("line").classed(`line-${n}`,!0).attr("role",kg.IMG).attr("aria-label","line").attr("x1",0).attr("y1",i.yPosition).attr("x2",r).attr("y2",i.yPosition).style("stroke",e.stroke?e.stroke:i.stroke).style("stroke-width",i.strokeWidth)}else if(e.type===et.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${n}`,!0).attr("role",kg.IMG).attr("aria-label","area").attr("width",r).attr("height",i).style("fill",n>3&&!e.fill?qp.area.fill:e.fill).style("stroke",e.stroke);else if(e.type===et.SIZE){const{iconData:n,fill:r,stroke:i}=qp.size;t.attr("fill","none").attr("role",kg.IMG).attr("aria-label","size").selectAll("rect").data(n).enter().append("rect").classed("size",!0).attr("width",(t=>t.width)).attr("height",(t=>t.height)).attr("y",(()=>0)).style("fill",e.fill?e.fill:r).style("stroke",e.stroke?e.stroke:i).style("stroke-width",1)}else if(e.type===et.QUARTILE){const{iconData:e}=qp.quartile;t.selectAll("rect").attr("role",kg.IMG).attr("aria-label","quartile").data(e).enter().append("rect").attr("class",((t,e)=>"quartile-"+(0===e?"wrapper":"line"))).attr("x",(t=>t.x)).attr("y",(t=>t.y)).attr("width",(t=>t.width)).attr("height",(t=>t.height))}else if(e.type===et.ZOOM){const{iconData:n,color:r}=Hm(qp,"zoom"),i=t.attr("role",kg.IMG).attr("aria-label","zoom").selectAll("g.icon").data(n).enter();i.append("g").attr("x",(t=>t.x)).attr("y",(t=>t.y)).attr("width",(t=>t.width)).attr("height",(t=>t.height)).append("polygon").attr("points","7.7 4.82 5.78 4.82 5.78 2.89 4.82 2.89 4.82 4.82 2.89 4.82 2.89 5.78 4.82 5.78 4.82 7.7 5.78 7.7 5.78 5.78 7.7 5.78 7.7 4.82").attr("fill",(()=>e.color?e.color:r)),i.append("path").attr("d","M9.36,8.67A5.22,5.22,0,0,0,10.59,5.3,5.3,5.3,0,1,0,5.3,10.59,5.22,5.22,0,0,0,8.67,9.36L12.32,13l.68-.68Zm-4.06,1A4.34,4.34,0,1,1,9.63,5.3,4.33,4.33,0,0,1,5.3,9.63Z").attr("fill",(()=>e.color?e.color:r))}}truncateLegendText(){const t=this.getComponentContainer(),e=Hm(this.getOptions(),"legend","truncation"),n=Hm(e,"type"),r=Hm(e,"threshold"),i=Hm(e,"numCharacter"),o=t.selectAll("div.legend-item p");o.attr("id",(function(){return(this.parentNode.querySelector("div.checkbox")||this.parentNode).getAttribute("aria-labelledby")})),n!==U.NONE?o.html((function(t){const e=gb(t.name);return e.length>r&&e.length!==i?$m(e,n,i):e})):o.html((t=>gb(t.name)))}addEventListeners(){const t=this,e=this.getComponentContainer(),n=this.getOptions(),r=Hm(n,"legend"),i=Hm(r,"truncation");e.selectAll("div.legend-item").on("mouseover",(function(e){t.services.events.dispatchEvent(L.Legend.ITEM_HOVER,{hoveredElement:an(this)});const n=an(this);n.select("div.checkbox").classed("hovered",!0);const r=n.datum();r.name.length>i.threshold&&i.numCharacter<r.name.length&&i.type!==U.NONE&&t.services.events.dispatchEvent(L.Tooltip.SHOW,{event:e,hoveredElement:n,content:r.name})})).on("mousemove",(function(e){an(this).datum().name.length>i.threshold&&i.type!==U.NONE&&t.services.events.dispatchEvent(L.Tooltip.MOVE,{event:e})})).on("click",(function(){t.services.events.dispatchEvent(L.Legend.ITEM_CLICK,{clickedElement:an(this)});const e=an(this).datum();t.model.toggleDataLabel(e.name)})).on("mouseout",(function(){const e=an(this);e.select("div.checkbox").classed("hovered",!1),e.datum().name.length>i.threshold&&i.type!==U.NONE&&t.services.events.dispatchEvent(L.Tooltip.HIDE),t.services.events.dispatchEvent(L.Legend.ITEM_MOUSEOUT,{hoveredElement:e})})),e.selectAll("div.legend-item div.checkbox").on("keyup",(function(e){e.key&&"Tab"===e.key&&t.services.events.dispatchEvent(L.Legend.ITEM_HOVER,{hoveredElement:an(this)})})),e.selectAll("div.legend-item div.checkbox").on("keydown",(function(e,n){e.key&&" "===e.key?(e.preventDefault(),t.model.toggleDataLabel(n.name)):e.key&&"Tab"===e.key&&t.services.events.dispatchEvent(L.Legend.ITEM_MOUSEOUT,{hoveredElement:an(this)})})),e.selectAll("g.additional-item").on("mouseover",(function(e){const n=an(this),r=n.datum();r.name.length>i.threshold&&t.services.events.dispatchEvent(L.Tooltip.SHOW,{event:e,hoveredElement:n,content:r.name})}))}}class l_ extends wv{constructor(t,e,n){super(t,e,n),this.type="chart-clip",this.renderType=P.SVG,this.chartClipId="chart-clip-id-"+Math.floor(99999999999*Math.random()),this.init()}init(){this.model.set({chartClipId:this.chartClipId},{skipUpdate:!0})}render(t=!0){this.createClipPath()}createClipPath(){const t=this.parent,{cartesianScales:e}=this.services;if(!e)throw new Error("Service cartesianScales was undefined");const n=e.getMainXScale(),r=e.getMainYScale(),[i,o]=n.range(),[s,a]=r.range();if(!t)throw new Error("svg is undefined");this.chartClipPath=Dy.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const l=Dy.appendOrSelect(this.chartClipPath,`rect.${this.type}`);o-i>0&&l.attr("x",i).attr("y",a).attr("width",o-i).attr("height",s-a),this.chartClipPath.merge(l).lower()}}class c_ extends l_{constructor(){super(...arguments),this.type="canvas-chart-clip",this.chartClipId="canvas-chart-clip-id-"+Math.floor(99999999999*Math.random())}createClipPath(){const t=this.parent,{width:e,height:n}=Dy.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=Dy.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const r=Dy.appendOrSelect(this.chartClipPath,`rect.${this.type}`);r.attr("x",0).attr("y",0).attr("width",e).attr("height",n),this.chartClipPath.merge(r).lower()}}var u_,h_;!function(t){t.LEFT="left",t.RIGHT="right",t.TOP="top",t.BOTTOM="bottom"}(h_||(h_={}));var d_=((u_={})[h_.LEFT]=function(t,e,n){return{top:t.top-Math.round(e.offsetHeight/2)+Math.round(n.height/2),left:Math.round(t.left-e.offsetWidth)}},u_[h_.RIGHT]=function(t,e,n){return{top:t.top-Math.round(e.offsetHeight/2)+Math.round(n.height/2),left:Math.round(t.left+n.width)}},u_[h_.TOP]=function(t,e,n){return{top:Math.round(t.top-e.offsetHeight),left:t.left-Math.round(e.offsetWidth/2)+Math.round(n.width/2)}},u_[h_.BOTTOM]=function(t,e,n){return{top:Math.round(t.top+n.height),left:t.left-Math.round(e.offsetWidth/2)+Math.round(n.width/2)}},u_),f_=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},p_=function(){function t(t){void 0===t&&(t={}),this.positions=d_,this.positions=Object.assign({},d_,t)}return t.prototype.getRelativeOffset=function(t){for(var e={left:t.offsetLeft,top:t.offsetTop};t.offsetParent&&"static"===getComputedStyle(t.offsetParent).position;)e.left+=t.offsetLeft,e.top+=t.offsetTop,t=t.offsetParent;return e},t.prototype.getAbsoluteOffset=function(t){for(var e=t,n={top:0,left:0};e.offsetParent;){var r=getComputedStyle(e.offsetParent);"static"===r.position&&r.marginLeft&&r.marginTop&&(parseInt(r.marginTop,10)&&(n.top+=parseInt(r.marginTop,10)),parseInt(r.marginLeft,10)&&(n.left+=parseInt(r.marginLeft,10))),e=e.offsetParent}var i=t.getBoundingClientRect(),o=document.body.getBoundingClientRect();return{top:i.top-o.top+n.top,left:i.left-o.left+n.left}},t.prototype.findRelative=function(t,e,n){var r=this.getRelativeOffset(t),i=t.getBoundingClientRect();return this.calculatePosition(r,i,e,n)},t.prototype.findAbsolute=function(t,e,n){var r=this.getAbsoluteOffset(t),i=t.getBoundingClientRect();return this.calculatePosition(r,i,e,n)},t.prototype.findPosition=function(t,e,n,r){void 0===r&&(r=this.getAbsoluteOffset.bind(this));var i=r(t),o=t.getBoundingClientRect();return this.calculatePosition(i,o,e,n)},t.prototype.findPositionAt=function(t,e,n){return this.calculatePosition(t,{top:0,left:0,height:0,width:0},e,n)},t.prototype.getPlacementBox=function(t,e){var n=t.offsetHeight+e.top,r=t.offsetWidth+e.left;return{top:e.top,bottom:n,left:e.left,right:r}},t.prototype.addOffset=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Object.assign({},t,{top:t.top+e,left:t.left+n})},t.prototype.setElement=function(t,e){t.style.top=e.top+"px",t.style.left=e.left+"px"},t.prototype.findBestPlacement=function(t,e,n,r,i){var o=this;void 0===r&&(r=this.defaultContainerFunction.bind(this)),void 0===i&&(i=this.findPosition.bind(this));var s=n.map((function(n){var s=i(t,e,n),a=o.getPlacementBox(e,s),l=0,c=0,u=r();a.top<u.top?l=u.top-a.top:a.bottom>u.height&&(l=a.bottom-u.height),a.left<u.left?c=u.left-a.left:a.right>u.width&&(c=a.right-u.width),l&&!c?c=1:c&&!l&&(l=1);var h=e.offsetHeight*e.offsetWidth;return{placement:n,weight:(h-l*c)/h}}));return s.sort((function(t,e){return e.weight-t.weight})),s[0].placement},t.prototype.findBestPlacementAt=function(t,e,n,r){var i=this;return void 0===r&&(r=this.defaultContainerFunction.bind(this)),this.findBestPlacement(null,e,n,r,(function(e,n,r){return i.findPositionAt(t,n,r)}))},t.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:f_.innerHeight,width:f_.innerWidth}},t.prototype.calculatePosition=function(t,e,n,r){return this.positions[r]?this.positions[r](t,n,e):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},t}();new p_;class m_ extends wv{constructor(t,e,n){super(t,e,n),this.type="tooltip",this.renderType=P.HTML,this.isEventListenerAdded=!1,this.positionService=new p_,this.handleShowTooltip=t=>{const e=t.detail.data||t.detail.items;let n;const r=this.formatItems(this.getItems(t));n=t.detail.content?`<div class="title-tooltip"><p>${mb(t.detail.content)}</p></div>`:mb(this.getTooltipHTML(r));const i=Dy.appendOrSelect(this.tooltip,"div.content-box");if(Hm(this.getOptions(),"tooltip","customHTML"))if(t.detail.content){const e=`<div class="title-tooltip"><p>${mb(t.detail.content)}</p></div>`;i.html(e)}else i.html(`<div class="title-tooltip"><p>${mb(this.model.getOptions().tooltip.customHTML(e,n))}</p></div>`);else i.html(n);i.selectAll(".datapoint-tooltip").each((function(t,e){const n=r[e];r[e]&&r[e].color&&an(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",n.color)})),this.positionTooltip(t),this.tooltip.classed("hidden",!1).attr("aria-hidden",!1)},this.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener(L.Tooltip.MOVE,(t=>{!1===this.tooltip.classed("hidden")&&this.positionTooltip(t)})),this.services.events.addEventListener(L.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(L.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(L.Chart.MOUSEOUT,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(L.Tooltip.MOVE,null),this.services.events.removeEventListener(L.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(L.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(L.Chart.MOUSEOUT,this.handleHideTooltip)}getItems(t){return t.detail.items?t.detail.items:[]}formatItems(t){const e=this.getOptions(),n=Hm(e,"tooltip","truncation","type"),r=Hm(e,"tooltip","truncation","threshold"),i=Hm(e,"tooltip","truncation","numCharacter");return n!==U.NONE?t.map((t=>{const e=t.labelIcon?12:0;return t.value=t.value?this.valueFormatter(t.value,t.label):t.value,t.label&&t.label.length+e>r&&(t.label=$m(t.label,n,i)),t.value&&t.value.length>r&&(t.value=$m(t.value,n,i)),t})):t.map((t=>(t.value=t.value?this.valueFormatter(t.value,t.label):t.value,t)))}getTooltipHTML(t){return'<ul class="multi-tooltip">'+t.map((t=>`<li>\n\t\t\t\t\t<div class="datapoint-tooltip${t.bold?" bold":""}">\n\t\t\t\t\t\t${t.class||t.color?`<div class="tooltip-color ${t.class}"></div>`:""}\n\t\t\t\t\t\t<div class="label">\n\t\t\t\t\t\t<p>${t.label||""}</p>\n\t\t\t\t\t\t${t.labelIcon?`<span class="label-icon"/>${t.labelIcon}</span>`:""}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t${void 0===t.value||null===t.value?"":`<p class="value"/>${t.value}</p>`}\n\t\t\t\t\t</div>\n\t\t\t\t</li>`)).join("")+"</ul>"}valueFormatter(t,e){const n=this.getOptions(),r=Hm(n,"tooltip","valueFormatter");if(r)return r(t,e);if("function"==typeof t.getTime)return bg(t,"MMM d, yyyy");try{if("string"==typeof t&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(t))return bg(Date.parse(t),"MMM d, yyyy")}catch{}return t.toLocaleString()}render(t=!1){const e=this.getOptions(),n=Hm(e,"tooltip","enabled");if(n){const t=an(this.services.domUtils.getHolder()),n=Hm(e,"style","prefix");this.tooltip=Dy.appendOrSelect(t,`div.${$p}--${n}--tooltip`),this.tooltip.style("max-width",null).attr("role","tooltip"),this.isEventListenerAdded||(this.addTooltipEventListener(),this.isEventListenerAdded=!0),this.tooltip.classed("hidden",!0)}else!n&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}positionTooltip(t){const e=this.services.domUtils.getHolder(),n=this.tooltip.node(),r=this.getOptions(),i=Hm(r,"zoomBar","top","enabled");let o=Hm(t,"detail","mousePosition");if(o){const t=Hm(r,"zoomBar","top","type"),e=em.height[t];i&&(o[1]+=e+em.spacerHeight)}else o=ln(Hm(t,"detail","event"),e);const s=e.offsetWidth,a=e.offsetHeight;let l;l=o[0]/s>.9?h_.LEFT:o[0]/s<.1?h_.RIGHT:this.positionService.findBestPlacementAt({left:o[0],top:o[1]},n,[h_.RIGHT,h_.LEFT,h_.TOP,h_.BOTTOM],(()=>({top:void 0,left:void 0,width:s,height:a})));let{horizontalOffset:c}=Jp;l===h_.LEFT&&(c*=-1);const u=this.positionService.findPositionAt({left:o[0]+c,top:o[1]},n,l);this.positionService.setElement(n,u)}}const g_=class t extends wv{constructor(){super(...arguments),this.type="grid-brush",this.renderType=P.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(e=!0){const n=this.parent,r=this.getComponentContainer();if(!n)throw new Error("SVG was not defined");const i=Dy.appendOrSelect(n,"svg.chart-grid-backdrop"),o=Dy.appendOrSelect(i,`g.${this.type}`),s=Dy.appendOrSelect(o,this.selectionSelector),{width:a,height:l}=Dy.getSVGElementSize(i,{useAttrs:!0}),{cartesianScales:c}=this.services,u=c.getMainXScaleType(),h=c.getMainXScale(),[d]=h.range();r.attr("transform",`translate(${d},0)`);const f=Dy.appendOrSelect(r,this.frontSelectionSelector);if(h&&u===F.TIME){let e=this.model.get("zoomDomain");void 0===e&&(e=this.services.zoom.getDefaultZoomBarDomain(),e&&this.model.set({zoomDomain:e},{animate:!1}));const n=e=>{const n=e[1]-e[0];let r="0,"+n.toString();const i=Math.floor(l/t.DASH_LENGTH),o=i*t.DASH_LENGTH;for(let e=0;e<i;e++)r+=","+t.DASH_LENGTH;r+=","+(l-o),i%2==1&&(r+=",0"),r+=","+n.toString(),r+=","+l.toString(),f.attr("stroke-dasharray",r)},r=t=>{const e=t.selection;null===e||e[0]===e[1]||(f.attr("x",parseFloat(s.attr("x"))+parseFloat(i.attr("x"))).attr("y",s.attr("y")).attr("width",s.attr("width")).attr("height",s.attr("height")).style("cursor","pointer").style("display",null),n(e))},c=(t,n)=>{const r=cl().range([0,a]).domain(e);let i=[r.invert(t),r.invert(n)];i[0].valueOf()===i[1].valueOf()&&(i=this.services.zoom.getDefaultZoomBarDomain()),(e[0].valueOf()!==i[0].valueOf()||e[1].valueOf()!==i[1].valueOf())&&this.services.zoom.handleDomainChange(i)};let u;const h=t=>{const e=t.selection;null!==e&&(c(e[0],e[1]),o.call(u.move,null),f.style("display","none"))};0!=l&&0!=a&&(u=ji().extent([[0,0],[a-1,l]]).on("start brush end",r).on("end.brushed",h),o.call(u));const d=this.services.zoom.getZoomRatio();i.on("click",(function(t){if(t.shiftKey){const t=this.services.domUtils.getHolder(),e=ln(o.node(),t)[0];let n=e-a*d/2;n<0&&(n=0);let r=e+a*d/2;r>a&&(r=a),c(n,r)}}))}}};g_.DASH_LENGTH=4;let y_=g_;class v_ extends wv{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=P.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(99999999999*Math.random()),this.brush=ji(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(L.ZoomBar.UPDATE,this.render.bind(this));const t=Hm(this.getOptions(),"zoomBar",B.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const e=this.getComponentContainer(),n=this.services.zoom.isZoomBarLoading(B.TOP),r=this.services.zoom.isZoomBarLocked(B.TOP),i=Hm(this.getOptions(),"zoomBar",B.TOP,"type"),o=Hm(this.getOptions(),"axes",B.BOTTOM,"highlights"),s=em.height[i],{width:a}=Dy.getSVGElementSize(this.parent,{useAttrs:!0});if(0===a)return;let l=0;const c=this.model.get("axesMargins");c&&c.left&&(l=c.left);const u=Dy.appendOrSelect(e,"svg.zoom-container").attr("width","100%").attr("height",s).attr("opacity",1);if(Dy.appendOrSelect(e,"rect.zoom-spacer").attr("x",0).attr("y",s).attr("width","100%").attr("height",em.spacerHeight).attr("opacity",1).attr("fill","none"),i===j.GRAPH_VIEW?Dy.appendOrSelect(u,"rect.zoom-bg").attr("x",l).attr("y",0).attr("width",a-l).attr("height","100%").classed("zoom-bg-skeleton",n).style("stroke",n?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):i===j.SLIDER_VIEW&&Dy.appendOrSelect(u,"rect.zoom-slider-bg").attr("x",l).attr("y",s/2-1).attr("width",a-l).attr("height",2).classed("zoom-slider-bg-skeleton",n).style("stroke",n?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),n)return void this.renderSkeleton(u,l,a);const{cartesianScales:h}=this.services,d=h.getMainXScale(),f=h.getMainYScale(),p=h.getMainXScaleType();if(d&&p===F.TIME){let t=this.services.zoom.getZoomBarData();if(function(t){if(null==t)return!0;if(nh(t)&&(au(t)||"string"==typeof t||"function"==typeof t.splice||mh(t)||Th(t)||hh(t)))return!t.length;var e=Gd(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(oh(t))return!Dh(t).length;for(var n in t)if(Dp.call(t,n))return!1;return!0}(t)||1===t.length)return;this.xScale=d.copy(),this.yScale=f.copy();const n=this.services.zoom.getDefaultZoomBarDomain(t);t=this.compensateDataForDefaultDomain(t,n);const c=this.model.get("initialZoomDomain"),h=Hm(this.getOptions(),"zoomBar",B.TOP,"initialZoomDomain");h&&h[0]&&h[1]&&(h[0]=new Date(h[0]),h[1]=new Date(h[1])),!h||c&&c[0].valueOf()===h[0].valueOf()&&c[1].valueOf()===h[1].valueOf()?null===h&&null!==c&&this.model.set({initialZoomDomain:null,zoomDomain:Rp([],n)},{skipUpdate:!0}):this.model.set({initialZoomDomain:Rp([],h),zoomDomain:h?Rp([],h):n},{skipUpdate:!0}),this.xScale.range([l,a]).domain(n),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,s-6]).domain(ht(t,(t=>t.value)));const p=this.model.get("zoomDomain");if(i===j.GRAPH_VIEW&&(this.renderZoomBarArea(u,"path.zoom-graph-area-unselected",t,null),this.updateClipPath(e,this.clipId,0,0,0,0),this.renderZoomBarArea(u,"path.zoom-graph-area",t,this.clipId),this.renderZoomBarBaseline(u,l,a),o)){const t=o.highlightStartMapsTo,e=o.highlightEndMapsTo,n=o.color,r=o.labelMapsTo;o.data.forEach(((i,o)=>{Dy.appendOrSelect(u,`rect.highlight-${o}`).attr("height",s-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(i[t])).attr("width",this.xScale(i[e])-this.xScale(i[t])).style("fill",n&&n.scale[i[r]]?n.scale[i[r]]:null).style("fill-opacity",.1).style("stroke",n&&n.scale[i[r]]?n.scale[i[r]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")}))}this.addBrushEventListener(p,l,a);const m=Dy.appendOrSelect(e,this.brushSelector).call(this.brush);if(void 0!==p)if(p[0].valueOf()===p[1].valueOf())m.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const t=p.map((t=>this.xScale(t)));t[1]-t[0]<this.MIN_SELECTION_DIFF||(m.call(this.brush.move,t),this.updateBrushHandle(this.getComponentContainer(),t))}r&&(this.brush.filter((()=>!1)),m.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(t,e,n){const r=Hm(this.getOptions(),"zoomBar",B.TOP,"type"),i=em.height[r];this.brush.extent([[e,0],[n,i]]).on("start brush end",null).on("start brush end",(e=>{const n=e.selection;null===n?this.handleBrushedEvent(e,t,this.xScale,this.xScale.range()):n[0]===n[1]||this.handleBrushedEvent(e,t,this.xScale,n)}))}handleBrushedEvent(t,e,n,r){const i=[n.invert(r[0]),n.invert(r[1])];if(this.updateBrushHandle(this.getComponentContainer(),r),null!=t.sourceEvent&&("mousemove"===t.sourceEvent.type||"mouseup"===t.sourceEvent.type||"mousedown"===t.sourceEvent.type||"touchstart"===t.sourceEvent.type||"touchmove"===t.sourceEvent.type||"touchend"===t.sourceEvent.type)){let n;(void 0===e||e[0]!==i[0]||e[1]!==i[1])&&this.services.zoom.handleDomainChange(i,{dispatchEvent:!1}),"start"===t.type?n=L.ZoomBar.SELECTION_START:"brush"===t.type?n=L.ZoomBar.SELECTION_IN_PROGRESS:"end"===t.type&&(n=L.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(L.ZoomDomain.CHANGE,{newDomain:i})),this.services.events.dispatchEvent(n,{selection:r,newDomain:i})}}updateBrushHandle(t,e){const n=this,r=em.handleWidth,i=Hm(this.getOptions(),"zoomBar",B.TOP,"type"),o=em.height[i],s=-r/2,a=em.handleBarWidth,l=i===j.GRAPH_VIEW?em.handleBarHeight:6,c=-a/2,u=(o-l)/2;t.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",(function(t){return"w"===t.type?Math.max(e[0]+s,n.maxSelectionRange[0]):"e"===t.type?Math.min(e[1]+s,n.maxSelectionRange[1]-r):void 0})).attr("y",0).attr("width",r).attr("height",o).attr("cursor","ew-resize").style("display",null);const h=t.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);h.enter().append("rect").attr("class",(function(t){return"handle-bar handle-bar--"+t.type})),h.attr("x",(function(t){return"w"===t.type?Math.max(e[0]+c,n.maxSelectionRange[0]-s+c):"e"===t.type?Math.min(e[1]+c,n.maxSelectionRange[1]+s+c):void 0})).attr("y",u).attr("width",a).attr("height",l).attr("cursor","ew-resize"),i===j.SLIDER_VIEW&&this.updateSliderSelectedArea(e),this.updateClipPath(t,this.clipId,e[0],0,e[1]-e[0],o)}updateSliderSelectedArea(t){const e=Hm(this.getOptions(),"zoomBar",B.TOP,"type"),n=em.height[e],r=this.getComponentContainer().select("svg.zoom-container");Dy.appendOrSelect(r,"rect.zoom-slider-selected-area").attr("x",t[0]).attr("y",n/2-1).attr("width",t[1]-t[0]).attr("height",2)}renderZoomBarArea(t,e,n,r){const{cartesianScales:i}=this.services,o=i.getMainXAxisPosition(),s=i.getMainYAxisPosition(),a=i.getMainXScaleType(),l=i.getMainYScaleType(),c=(t,e,n)=>r=>i.getValueFromScale(t,e,n,r),u=c(this.xScale,a,o),h=c(this.yScale,l,s),d=Hm(this.getOptions(),"zoomBar",B.TOP,"type"),f=em.height[d],p=Nl().x((t=>u(t))).y0(f).y1((t=>f-h(t))),m=Dy.appendOrSelect(t,e).datum(n).attr("d",p);r&&m.attr("clip-path",`url(#${r})`)}updateClipPath(t,e,n,r,i,o){const s=Dy.appendOrSelect(t,"clipPath").attr("id",e);Dy.appendOrSelect(s,"rect").attr("x",n).attr("y",r).attr("width",i).attr("height",o)}compensateDataForDefaultDomain(t,e){if(!t||t.length<2)return;const n=Bf(t),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier();if(Number(e[0])<Number(n[0][r])){const t={};t[r]=e[0],t[i]=0,n.unshift(t)}if(Number(e[1])>Number(n[n.length-1][r])){const t={};t[r]=e[1],t[i]=0,n.push(t)}return n}renderZoomBarBaseline(t,e,n,r=!1){const i=Hm(this.model.getOptions(),"zoomBar",B.TOP,"type"),o=em.height[i],s=Il()([[e,o],[n,o]]);Dy.appendOrSelect(t,"path.zoom-bg-baseline").attr("d",s).classed("zoom-bg-baseline-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(t,e,n){this.renderZoomBarArea(t,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(t,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),Dy.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),Hm(this.getOptions(),"zoomBar",B.TOP,"type")===j.GRAPH_VIEW&&this.renderZoomBarBaseline(t,e,n,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(L.ZoomBar.UPDATE,this.render.bind(this))}}class b_ extends wv{constructor(t,e){super(t,e),this.type="threshold",this.renderType=P.SVG,this.positionService=new p_}render(t=!1){const e=Hm(this.getOptions(),"axes"),n=[];Object.keys(e).forEach((t=>{if(Object.values(B).includes(t)){const r=e[t];r.thresholds&&r.thresholds.length>0&&n.push({axisPosition:t,thresholds:r.thresholds,correspondingDatasets:null==r?void 0:r.correspondingDatasets,mapsTo:null==r?void 0:r.mapsTo})}}));const r=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-thresholds").data(n,(t=>t.axisPosition));r.exit().attr("opacity",0).remove();const i=r.enter().append("g").merge(r);i.attr("class",(t=>`axis-thresholds ${t.axisPosition}`));const o=i.selectAll("g.threshold-group").data((t=>t.thresholds.map((e=>(e.axisPosition=t.axisPosition,e.datum=this.constructDatumObj(t,e),e)))));o.exit().attr("opacity",0).remove();const s=o.enter().append("g");s.append("line").attr("class","threshold-line"),s.append("rect").attr("class","threshold-hoverable-area"),s.merge(o).attr("class","threshold-group");const a=this;i.each((function({axisPosition:e}){const n=a.services.cartesianScales.getScaleByPosition(e),r=a.services.cartesianScales.getScaleTypeByPosition(e);let i=null,o=null;e===B.LEFT||e===B.RIGHT?(o=n,i=a.services.cartesianScales.getMainXScale()):(i=n,o=a.services.cartesianScales.getMainYScale());const s=r===F.LABELS,[l,c]=i.range(),[u,h]=o.range(),{cartesianScales:d}=a.services,f=d.getOrientation(),[p,m]=Vm((t=>d.getDomainValue(t)),(t=>d.getRangeValue(t)),f),g=an(this);e===B.TOP||e===B.BOTTOM?(g.selectAll("line.threshold-line").transition().call((e=>a.services.transitions.setupTransition({transition:e,name:"threshold-line-update",animate:t}))).attr("y1",h).attr("y2",u).attr("x1",(({datum:t})=>p(t)+(s?n.step()/2:0))).attr("x2",(({datum:t})=>p(t)+(s?n.step()/2:0))).style("stroke",(({fillColor:t})=>t)),g.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",(({datum:t})=>-p(t))).attr("width",Math.abs(u-h)).classed("rotate",!0)):(g.selectAll("line.threshold-line").transition().call((e=>a.services.transitions.setupTransition({transition:e,name:"threshold-line-update",animate:t}))).attr("x1",l).attr("x2",c).attr("y1",(({datum:t})=>m(t)+(s?n.step()/2:0))).attr("y2",(({datum:t})=>m(t)+(s?n.step()/2:0))).style("stroke",(({fillColor:t})=>t)),g.selectAll("rect.threshold-hoverable-area").attr("x",l).attr("y",(({datum:t})=>m(t))).attr("width",Math.abs(c-l)).classed("rotate",!1))})),this.services.events.addEventListener(L.Threshold.SHOW,(t=>{this.setThresholdLabelPosition(t.detail),this.label.classed("hidden",!1)})),this.services.events.addEventListener(L.Threshold.HIDE,(()=>{this.label.classed("hidden",!0)})),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(t){const{value:e,axisPosition:n}=t,r=this.getOptions();if(this.services.cartesianScales.getScaleTypeByPosition(n)===F.TIME){const t=[B.LEFT,B.RIGHT].includes(n),i=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),s=t?o:i,a=Hm(r,"timeScale"),l=Og(s.ticks(),Hm(a,"timeInterval"));return xg(e,0,s.ticks(),l,a)}return e.toLocaleString("en")}appendThresholdLabel(){const t=an(this.services.domUtils.getHolder()),e=Hm(this.getOptions(),"style","prefix");this.label=Dy.appendOrSelect(t,`div.${$p}--${e}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:e}){const n=this.services.domUtils.getHolder(),r=ln(t,n),i=e.valueFormatter?e.valueFormatter(e.value):this.getFormattedValue(e);this.label.html(gb(`${e.label||"Threshold"}: ${i}`)).style("background-color",e.fillColor);const o=this.label.node(),s=this.positionService.findBestPlacementAt({left:r[0],top:r[1]},o,[h_.RIGHT,h_.LEFT,h_.TOP,h_.BOTTOM],(()=>({top:void 0,left:void 0,width:n.offsetWidth,height:n.offsetHeight}))),a=this.positionService.findPositionAt({left:r[0],top:r[1]},o,s);this.positionService.setElement(o,a)}constructDatumObj(t,e){const n={};return t.correspondingDatasets&&(n.group=Hm(t,"correspondingDatasets",0)),n[t.mapsTo]=e.value,n}addEventListeners(){const t=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",(function(e){an(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(L.Threshold.SHOW,{event:e,hoveredElement:an(this),datum:an(this).datum()})})).on("mouseout",(function(e){an(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(L.Threshold.HIDE,{event:e,hoveredElement:an(this),datum:an(this).datum()})}))}}class __ extends wv{constructor(t,e){super(t,e),this.type="highlight",this.renderType=P.SVG,this.positionService=new p_,this.highlightStrokeWidth=1}render(t=!1){const e=Hm(this.getOptions(),"axes"),n=[];Object.keys(e).forEach((t=>{if(Object.values(B).includes(t)){const r=e[t];r.highlights&&r.highlights.data.length>0&&n.push({axisPosition:t,highlightStartMapsTo:r.highlights.highlightStartMapsTo,highlightEndMapsTo:r.highlights.highlightEndMapsTo,labelMapsTo:r.highlights.labelMapsTo,highlight:r.highlights.data,color:r.highlights.color})}}));const r=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-highlight").data(n,(t=>t.axisPosition));r.exit().attr("opacity",0).remove();const i=r.enter().append("g").merge(r);i.attr("class",(t=>`axis-highlight ${t.axisPosition}`));const o=i.selectAll("g.highlight-group").data((t=>t.highlight.map((e=>(e.axisPosition=t.axisPosition,e.highlightStartMapsTo=t.highlightStartMapsTo,e.labelMapsTo=t.labelMapsTo,e.color=t.color,e.highlightEndMapsTo=t.highlightEndMapsTo,e)))));o.exit().attr("opacity",0).remove();const s=o.enter().append("g");s.append("rect").attr("class","highlight-bar"),s.append("line").attr("class","highlight-line"),s.merge(o).attr("class","highlight-group");const a=this;i.each((function({axisPosition:e}){const n=a.services.cartesianScales.getMainXScale(),r=a.services.cartesianScales.getMainYScale(),[i,o]=n.range(),[s,l]=r.range(),{cartesianScales:c}=a.services,u=c.getOrientation(),[h,d]=Vm((t=>c.getDomainValue(t)),(t=>c.getRangeValue(t)),u),f=an(this);e===B.TOP||e===B.BOTTOM?f.selectAll("rect.highlight-bar").transition().call((e=>a.services.transitions.setupTransition({transition:e,name:"highlight-bar-update",animate:t}))).attr("y",Math.max(l+a.highlightStrokeWidth,0)).attr("height",Math.max(s-2*a.highlightStrokeWidth,0)).attr("x",(({highlightStartMapsTo:t,...e})=>h(e[t]))).attr("width",(({highlightStartMapsTo:t,highlightEndMapsTo:e,...n})=>Math.max(h(n[e])-h(n[t]),0))).style("stroke",(({color:t,labelMapsTo:e,...n})=>t&&t.scale[n[e]]?t.scale[n[e]]:null)).style("stroke-dasharray","2, 2").attr("stroke-width",a.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",(({color:t,labelMapsTo:e,...n})=>t&&t.scale[n[e]]?t.scale[n[e]]:null)):f.selectAll("rect.highlight-bar").transition().call((e=>a.services.transitions.setupTransition({transition:e,name:"highlight-bar-update",animate:t}))).attr("x",i).attr("width",Math.max(o-i,0)).attr("y",(({highlightEndMapsTo:t,...e})=>d(e[t]))).attr("height",(({highlightStartMapsTo:t,highlightEndMapsTo:e,...n})=>Math.max(d(n[t])-d(n[e]),0))).style("stroke",(({color:t,labelMapsTo:e,...n})=>t&&t.scale[n[e]]?t.scale[n[e]]:null)).style("stroke-dasharray","2, 2").attr("stroke-width",a.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",(({color:t,labelMapsTo:e,...n})=>t&&t.scale[n[e]]?t.scale[n[e]]:null))}))}}class w_ extends m_{getItems(t){if(t.detail.items)return t.detail.items;const{data:e}=t.detail;if(!e||!e.length||!e[0])return[];const n=this.getOptions(),{cartesianScales:r}=this.services,i=r.getDomainIdentifier(),o=r.isDualAxes(),{groupMapsTo:s}=n.data,a=r.getDomainLabel();let l=r.getRangeLabel();const c=e[0][i];let u;if(1===e.length){const i=e[0],h=r.getRangeIdentifier(i);if(o){const t=r.getRangeAxisPosition({datum:i,groups:[i[s]]});l=r.getScaleLabel(t)}const d=i[h];u=[{label:a,value:c},...Array.isArray(d)&&2===d.length?[{label:"Start",value:d[0]},{label:"End",value:d[1]}]:[{label:l,value:i[h]}]],t.detail.additionalItems&&t.detail.additionalItems.forEach((t=>u.push({label:t.label,value:t.value}))),u.push({label:n.tooltip.groupLabel,value:i[s],color:this.model.getFillColor(i[s]),class:this.model.getColorClassName({classNameTypes:[N.TOOLTIP],dataGroupName:i[s]})})}else if(e.length>1&&(u=[{label:a,value:c}],u=u.concat(e.map((t=>{const e=t[r.getRangeIdentifier(t)];return{label:t[s],value:Array.isArray(e)&&2===e.length?`${e[0]} - ${e[1]}`:e,color:this.model.getFillColor(t[s]),class:this.model.getColorClassName({classNameTypes:[N.TOOLTIP],dataGroupName:t[s]})}})).sort(((t,e)=>e.value-t.value))),!o&&!0===Hm(n,"tooltip","showTotal"))){const t=r.getRangeIdentifier();u.push({label:rd(n,"tooltip.totalLabel")||"Total",value:e.reduce(((e,n)=>e+n[t]),0),bold:!0})}return u}}class E_ extends wv{constructor(){super(...arguments),this.type="grid",this.renderType=P.SVG}render(t=!0){const e=Hm(this.getOptions(),"grid","x","enabled"),n=Hm(this.getOptions(),"grid","y","enabled");this.drawBackdrop(e,n),(e||n)&&(e&&(Dy.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),n&&(Dy.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(t)))}drawXGrid(t){const e=this.parent,n=this.backdrop.attr("height"),r=Ht(this.services.cartesianScales.getMainXScale()).tickSizeInner(-n).tickSizeOuter(0);if(Hm(this.getOptions(),"grid","x","alignWithAxisTicks")){const t=this.services.cartesianScales.getDomainAxisPosition(),e=Hm(this.getOptions(),"axes",t,"ticks","values");e&&r.tickValues(e)}else{const t=Hm(this.getOptions(),"grid","x","numberOfTicks");r.ticks(t)}const i=e.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${n})`);t?i.transition().call((e=>this.services.transitions.setupTransition({transition:e,name:"grid-update",animate:t}))).call(r):i.call(r),this.cleanGrid(i)}drawYGrid(t){const e=this.parent,n=this.backdrop.attr("width"),r=zt(this.services.cartesianScales.getMainYScale()).tickSizeInner(-n).tickSizeOuter(0);if(Hm(this.getOptions(),"grid","y","alignWithAxisTicks")){const t=this.services.cartesianScales.getRangeAxisPosition(),e=Hm(this.getOptions(),"axes",t,"ticks","values");e&&r.tickValues(e)}else{const t=Hm(this.getOptions(),"grid","y","numberOfTicks");r.ticks(t)}const i=e.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?i.transition().call((e=>this.services.transitions.setupTransition({transition:e,name:"grid-update",animate:t}))).call(r):i.call(r),this.cleanGrid(i)}getGridlineThreshold(t){const e=this.parent,n=e.selectAll(".x.grid .tick").nodes().sort(((t,e)=>Number(Um(t).tx)-Number(Um(e).tx)));let r=-1;if(!n.length)return;n.forEach((e=>{t[0]>=+Um(e).tx&&r++}));const i=r+1<n.length?r+1:n.length,o=n[r],s=n[i];let a;if(o)if(s)a=+Um(s).tx-+Um(o).tx;else{const t=e.select("rect.chart-grid-backdrop").node();a=Dy.getSVGElementSize(t).width-+Um(o).tx}else a=+Um(s).tx;const{threshold:l}=this.getOptions().tooltip.gridline;return a*l}getActiveGridline(t){const e=Hm(this.getOptions,"tooltip","gridline","threshold")||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter((function(){const n=Um(this),r=Number(n.tx)-e,i=Number(n.tx)+e;return r<=t[0]&&t[0]<=i}))}drawBackdrop(t,e){const n=this.parent,r=this.services.cartesianScales.getMainXScale(),i=this.services.cartesianScales.getMainYScale(),[o,s]=r.range(),[a,l]=i.range();this.backdrop=Dy.appendOrSelect(n,"svg.chart-grid-backdrop");const c=Dy.appendOrSelect(this.backdrop,t||e?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(c).attr("x",o).attr("y",l).attr("width",Math.abs(s-o)).attr("height",Math.abs(a-l)).lower(),c.attr("width","100%").attr("height","100%")}cleanGrid(t){t.selectAll("text").remove(),t.select(".domain").remove()}}class x_ extends wv{constructor(){super(...arguments),this.type="line",this.renderType=P.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:e}=t.detail;this.parent.selectAll("path.line").transition("legend-hover-line").call((t=>this.services.transitions.setupTransition({transition:t,name:"legend-hover-line"}))).attr("opacity",(t=>t.name!==e.datum().name?Xp:Kp))},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.line").transition("legend-mouseout-line").call((t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"}))).attr("opacity",Kp)}}init(){const{events:t}=this.services;t.addEventListener(L.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(L.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const e=this.getComponentContainer({withinChartClip:!0}),{cartesianScales:n,curves:r}=this.services,[i,o]=Vm((t=>n.getDomainValue(t)),(t=>n.getRangeValue(t)),n.getOrientation()),s=this.getOptions(),a=Il().x(i).y(o).curve(r.getD3Curve()).defined((t=>null!=t[n.getRangeIdentifier(t)]));let l=[];if(this.configs.stacked){const t=Object.keys(s.axes).some((t=>s.axes[t].percentage)),{groupMapsTo:e}=s.data;l=this.model.getStackedData({groups:this.configs.groups,percentage:t}).map((t=>{const n=this.services.cartesianScales.getDomainIdentifier(t),r=this.services.cartesianScales.getRangeIdentifier(t);return{name:Hm(t,0,e),data:t.map((t=>({[n]:t.data.sharedStackKey,[e]:t[e],[r]:t[1]}))),hidden:!_v(t,(t=>t[0]!==t[1]))}}))}else l=this.model.getGroupedData(this.configs.groups);const c=e.selectAll("path.line").data(l,(t=>t.name));c.exit().attr("opacity",0).remove(),c.enter().append("path").classed("line",!0).attr("opacity",0).merge(c).data(l,(t=>t.name)).attr("class",(t=>this.model.getColorClassName({classNameTypes:[N.STROKE],dataGroupName:t.name,originalClassName:"line"}))).style("stroke",(t=>this.model.getStrokeColor(t.name))).attr("role",kg.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",(t=>{const{data:e}=t;return e.map((t=>t[this.services.cartesianScales.getRangeIdentifier(t)])).join(",")})).transition().call((e=>this.services.transitions.setupTransition({transition:e,name:"line-update-enter",animate:t}))).attr("opacity",(t=>t.hidden?0:1)).attr("d",(t=>{const{data:e}=t;return a(e)}))}destroy(){const t=this.services.events;t.removeEventListener(L.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(L.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class T_ extends wv{constructor(){super(...arguments),this.type="ruler",this.renderType=P.SVG,this.isXGridEnabled=Hm(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=Hm(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const e=Hm(this.getOptions(),"ruler","enabled");this.drawBackdrop(),e&&!this.isEventListenerAdded?this.addBackdropEventListeners():!e&&this.isEventListenerAdded&&this.removeBackdropEventListeners()}removeBackdropEventListeners(){this.isEventListenerAdded=!1,this.backdrop.on("mousemove mouseover mouseout",null)}formatTooltipData(t){return t}showRuler(t,[e,n]){const r=this.parent,i=this.services.cartesianScales.getOrientation(),o=this.model.getDisplayData(),s=this.services.cartesianScales.getRangeScale(),[a,l]=s.range(),c=i===$.HORIZONTAL?n:e,u=Dy.appendOrSelect(r,"g.ruler").attr("aria-label","ruler"),h=Dy.appendOrSelect(u,"line.ruler-line"),d=r.selectAll("[role=graphics-symbol]"),f=o.map((t=>({domainValue:this.services.cartesianScales.getDomainValue(t),originalData:t}))).filter((t=>function(t,e){return t>e-5&&t<e+5}(t.domainValue,c)));if(this.pointsWithinLine&&f.length===this.pointsWithinLine.length&&f.map((t=>t.domainValue)).join()===this.pointsWithinLine.map((t=>t.domainValue)).join())return this.pointsWithinLine=f,this.services.events.dispatchEvent(L.Tooltip.MOVE,{mousePosition:[e,n]});this.pointsWithinLine=f;const p=this.pointsWithinLine.reduce(((t,e)=>{if(0===t.length)return t.push(e),t;const n=t[0].domainValue,r=Math.abs(c-e.domainValue),i=Math.abs(c-n);return r>i||(r<i?t=[e]:t.push(e)),t}),[]);if(p.length>0){const t=p.map((t=>t.originalData)).filter((t=>null!=t[this.services.cartesianScales.getRangeIdentifier(t)])),r=p.map((t=>t.domainValue)),o=d.filter((t=>{const e=this.services.cartesianScales.getDomainValue(t);return r.includes(e)}));this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!function(t,e){return pp(t,e)}(this.elementsToHighlight,o)&&this.hideRuler(),o.dispatch("mouseover"),this.elementsToHighlight=o,this.services.events.dispatchEvent(L.Tooltip.SHOW,{mousePosition:[e,n],hoveredElement:h,data:this.formatTooltipData(t)}),u.attr("opacity",1);const s=p[0];"horizontal"===i?h.attr("x1",l).attr("x2",a).attr("y1",s.domainValue).attr("y2",s.domainValue):h.attr("y1",l).attr("y2",a).attr("x1",s.domainValue).attr("x2",s.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,e=Dy.appendOrSelect(t,"g.ruler");t.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(L.Tooltip.HIDE),e.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const t=this,e=this.services.domUtils.getHolder(),n=this.model.getDisplayData();let r=function(e){const n=ln(e,t.parent.node());t.showRuler(e,n)};n.length>100&&(r=function(t,e,n){let r=null;return function(...i){const o=this;o.mousePosition=ln(i[0],n),clearTimeout(r),r=setTimeout((function(){t.apply(o,i)}),e)}}((function(e){const{mousePosition:n}=this;t.showRuler(e,n)}),n.length%50*12.5,e)),this.backdrop.on("mousemove mouseover",r).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const t=this.parent;this.backdrop=Dy.appendOrSelect(t,"svg.chart-grid-backdrop")}}class O_ extends wv{constructor(){super(...arguments),this.type="scatter",this.renderType=P.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call((t=>{var e;return null==(e=this.services.transitions)?void 0:e.setupTransition({transition:t,name:"chart-holder-hover-scatter"})})).attr("opacity",1)},this.handleChartHolderOnMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-mouseout-scatter").call((t=>{var e;return null==(e=this.services.transitions)?void 0:e.setupTransition({transition:t,name:"chart-holder-mouseout-scatter"})})).attr("opacity",0)},this.handleLegendOnHover=t=>{const{hoveredElement:e}=t.detail,{groupMapsTo:n}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call((t=>{var e;return null==(e=this.services.transitions)?void 0:e.setupTransition({transition:t,name:"legend-hover-scatter"})})).attr("opacity",(t=>t[n]!==e.datum().name?.3:1))},this.handleLegendMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-mouseout-scatter").call((t=>{var e;return null==(e=this.services.transitions)?void 0:e.setupTransition({transition:t,name:"legend-mouseout-scatter"})})).attr("opacity",1)}}init(){const{events:t}=this.services;if(!t)throw new Error("Services events are undefined.");t.addEventListener(L.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(L.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:e}=this.configs;e&&(t.addEventListener(L.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(L.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(t){const{cartesianScales:e}=this.services;if(!e)throw new Error("Services cartesianScales are undefined.");const n=e.getDomainIdentifier(t),r=this.model.get("zoomDomain");return void 0!==r?t.filter((t=>t[n].getTime()>=r[0].getTime()&&t[n].getTime()<=r[1].getTime())):t}getScatterData(){const t=this.getOptions(),{stacked:e}=this.configs;let n;if(e){const e=Object.keys(t.axes).some((e=>t.axes[e].percentage));n=this.model.getStackedData({groups:this.configs.groups,percentage:e})}else{const{cartesianScales:t}=this.services;if(!t)throw new Error("Services cartesianScales are undefined.");n=this.model.getDisplayData(this.configs.groups).filter((e=>{const n=t.getRangeIdentifier(e);return void 0!==e[n]&&null!==e[n]}))}return this.filterBasedOnZoomDomain(n)}render(t){if(!Hm(this.getOptions(),"points","enabled")&&!Hm(this.getOptions(),"bubble","enabled"))return;const e=this.getComponentContainer({withinChartClip:!0}),n=this.getOptions(),{groupMapsTo:r}=n.data,{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales are undefined.");const o=i.getDomainIdentifier(),s=e.selectAll("circle.dot").data(this.getScatterData(),(t=>`${t[r]}-${t[o]}`));s.exit().attr("opacity",0).remove();const a=s.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(s);this.styleCircles(a,t),this.addEventListeners()}isDatapointThresholdAnomaly(t){const{handleThresholds:e}=this.configs;if(!e)return!1;const{cartesianScales:n}=this.services;if(!n)throw new Error("Cartesian scales service is undefined");const r=n.getOrientation(),[i,o]=Vm(n.getHighestDomainThreshold(),n.getHighestRangeThreshold(),r),[s,a]=Vm((t=>n.getDomainValue(t)),(t=>n.getRangeValue(t)),r),l=s(t),c=a(t);return o&&i?c<=o.scaleValue&&l>=i.scaleValue:o?c<=o.scaleValue:!!i&&l>=i.scaleValue}styleCircles(t,e){const n=this.getOptions(),{filled:r,fillOpacity:i}=n.points,{cartesianScales:o}=this.services;if(!o)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:s}=n.data,[a,l]=Vm((t=>o.getDomainValue(t)),(t=>o.getRangeValue(t)),o.getOrientation()),{fadeInOnChartHolderMouseover:c}=this.configs;t.raise().classed("dot",!0).attr("class",(t=>{const e=o.getDomainIdentifier(t),n=this.model.getIsFilled(t[s],t[e],t,r)?[N.FILL,N.STROKE]:[N.STROKE];return this.model.getColorClassName({classNameTypes:n,dataGroupName:t[s],originalClassName:"dot"})||""})).classed("threshold-anomaly",(t=>this.isDatapointThresholdAnomaly(t))).classed("filled",(t=>{const e=o.getDomainIdentifier(t);return this.model.getIsFilled(t[s],t[e],t,r)})).classed("unfilled",(t=>{const e=o.getDomainIdentifier(t);return!this.model.getIsFilled(t[s],t[e],t,r)})).transition().call((t=>{var n;return null==(n=this.services.transitions)?void 0:n.setupTransition({transition:t,name:"scatter-update-enter",animate:e})})).attr("cx",a).attr("cy",l).attr("r",n.points.radius).style("fill",(t=>{const e=o.getDomainIdentifier(t);if(this.model.getIsFilled(t[s],t[e],t,r))return this.model.getFillColor(t[s],t[e],t)})).style("stroke",(t=>{const e=o.getDomainIdentifier(t);return this.model.getStrokeColor(t[s],t[e],t)})).attr("fill-opacity",r?i:1).attr("opacity",c?0:1).attr("role",kg.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",(t=>t[o.getRangeIdentifier(t)])),this.addEventListeners()}getTooltipAdditionalItems(t){return null}addEventListeners(){const t=this,{groupMapsTo:e}=t.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle").on("mouseover",(function(n,r){var i,o;const s=an(this);s.classed("hovered",!0).attr("class",(n=>t.model.getColorClassName({classNameTypes:[N.FILL],dataGroupName:n[e],originalClassName:s.attr("class")}))).style("fill",(n=>{var r;const i=null==(r=t.services.cartesianScales)?void 0:r.getDomainIdentifier(n);return t.model.getFillColor(n[e],n[i],n)})).classed("unfilled",!1),null==(i=t.services.events)||i.dispatchEvent(L.Tooltip.SHOW,{event:n,hoveredElement:s,data:[r],additionalItems:t.getTooltipAdditionalItems(r)}),null==(o=t.services.events)||o.dispatchEvent(L.Scatter.SCATTER_MOUSEOVER,{event:n,element:s,datum:r})})).on("mousemove",(function(e,n){var r,i;const o=an(this);null==(r=t.services.events)||r.dispatchEvent(L.Scatter.SCATTER_MOUSEMOVE,{event:e,element:o,datum:n}),null==(i=t.services.events)||i.dispatchEvent(L.Tooltip.MOVE,{event:e})})).on("click",(function(e,n){var r;null==(r=t.services.events)||r.dispatchEvent(L.Scatter.SCATTER_CLICK,{event:e,element:an(this),datum:n})})).on("mouseout",(function(n,r){var i,o,s;const a=an(this);if(a.classed("hovered",!1),!t.configs.filled){const{filled:n}=t.getOptions().points,o=null==(i=t.services.cartesianScales)?void 0:i.getDomainIdentifier(r),s=t.model.getIsFilled(r[e],r[o],r,n);a.classed("unfilled",!s).style("fill",(r=>s||n?t.model.getFillColor(r[e],r[o],r):null))}null==(o=t.services.events)||o.dispatchEvent(L.Scatter.SCATTER_MOUSEOUT,{event:n,element:a,datum:r}),null==(s=t.services.events)||s.dispatchEvent(L.Tooltip.HIDE,{hoveredElement:a})}))}destroy(){var t;null==(t=this.parent)||t.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:e}=this.services;if(!e)throw new Error("Services events undefined");e.removeEventListener(L.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(L.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),e.removeEventListener(L.Chart.MOUSEOVER,this.handleChartHolderOnHover),e.removeEventListener(L.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}class S_ extends wv{constructor(t,e,n){super(t,e,n),this.type="axes",this.renderType=P.SVG,this.truncation={[B.LEFT]:!1,[B.RIGHT]:!1,[B.TOP]:!1,[B.BOTTOM]:!1},n&&(this.configs=n),this.margins=this.configs.margins}render(t=!0){const{position:e}=this.configs,n=this.getOptions(),r=Hm(n,"axes",e,"visible"),i=this.getComponentContainer(),{width:o,height:s}=Dy.getSVGElementSize(i,{useAttrs:!0}),a=Dy.appendOrSelect(i,`g.axis.${e}`);let l,c;if(e===B.BOTTOM||e===B.TOP?(l=this.configs.axes[B.LEFT]?this.margins.left:0,c=this.configs.axes[B.RIGHT]?o-this.margins.right:o):(l=s-this.margins.bottom,c=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const u=this.services.cartesianScales.getScaleByPosition(e);let h;switch(this.scaleType===F.LABELS||this.scaleType===F.LABELS_RATIO?u.rangeRound([l,c]):u.range([l,c]),e){case B.LEFT:h=zt;break;case B.BOTTOM:h=Ht;break;case B.RIGHT:h=Ft;break;case B.TOP:h=$t}a.attr("aria-label",`${e} axis`);const d=!a.select("g.ticks").empty();let f=Dy.appendOrSelect(a,"g.ticks");d||(f.attr("role",`${kg.GRAPHICS_OBJECT} ${kg.GROUP}`),f.attr("aria-label",`${e} ticks`));const p=Dy.appendOrSelect(a,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${e} ticks`),m=Hm(n,"axes",e),g=this.scaleType===F.TIME||m.scaleType===F.TIME,y=e===B.LEFT||e===B.RIGHT,v=this.model.get("zoomDomain");if(v&&g&&!y&&u.domain(v),!r)return void f.attr("aria-hidden",!0);const b=Hm(m,"scaleType"),_=Hm(n,"data","loading"),w=Hm(m,"ticks","number"),E=Hm(m,"ticks","values"),x=Hm(m,"truncation","type"),T=Hm(m,"truncation","threshold"),O=Hm(m,"truncation","numCharacter"),S=null!==w,M=Hm(n,"timeScale"),A=Dy.appendOrSelect(p,"g.tick"),k=Dy.appendOrSelect(A,"text").text("0"),D=Dy.getSVGElementSize(k.node(),{useBBox:!0}).height;A.remove();const C=this.scaleType||m.scaleType||F.LINEAR,R=h(u).tickSizeOuter(0);if(u.ticks){let t;if(S?t=w:(t=Fp,y&&(t=this.getNumberOfFittingTicks(s,D,Hp))),1===u.ticks().length&&0===u.ticks()[0]&&(t=0),R.ticks(t),g)if(u.ticks(t).length){const r=Hm(n,"timeScale","addSpaceOnEdges"),i=Hm(n,"axes",e,"domain"),o=u.copy();r&&!i&&o.nice(t);const s=o.ticks(t);r&&s.length>2&&!i&&(s.splice(s.length-1,1),s.splice(0,1)),R.tickValues(s)}else R.tickValues([])}let L;const P=Hm(m,"ticks","formatter");if(g){const t=Og(R.tickValues(),Hm(n,"timeScale","timeInterval"));L=null===P?(e,n)=>xg(e,n,R.tickValues(),t,M):(e,n)=>{const r=xg(e,n,R.tickValues(),t,M);return P(e,n,r)}}else null===P?C===F.LINEAR&&(L=t=>t.toLocaleString()):L=P;R.tickFormat(L);const[I,N]=this.services.cartesianScales.getScaleByPosition(e).domain();let j;if(E){if(g)E.forEach(((t,e)=>{void 0===t.getTime&&(E[e]=new Date(t))})),j=E.filter((t=>{const e=t.getTime();return e>=new Date(I).getTime()&&e<=new Date(N).getTime()}));else if(b===F.LABELS){const t=this.services.cartesianScales.getScaleByPosition(e).domain();j=E.filter((e=>t.includes(e)))}else j=E.filter((t=>t>=I&&t<=N));R.tickValues(j)}switch(e){case B.LEFT:f.attr("transform",`translate(${this.margins.left}, 0)`);break;case B.BOTTOM:f.attr("transform",`translate(0, ${s-this.margins.bottom})`);break;case B.RIGHT:f.attr("transform",`translate(${o-this.margins.right}, 0)`);break;case B.TOP:f.attr("transform",`translate(0, ${this.margins.top})`)}const $=this.model.isDataEmpty();if(m.title){const t=Dy.appendOrSelect(a,"text.axis-title").html($||_?"":gb(m.title)),n=Hm(m,"titleOrientation");let r;switch(e){case B.LEFT:n===tt.RIGHT?t.attr("transform","rotate(90)").attr("y",0).attr("x",u.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):t.attr("transform","rotate(-90)").attr("y",0).attr("x",-u.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case B.BOTTOM:t.attr("transform",`translate(${this.margins.left/2+u.range()[1]/2}, ${s+4})`).style("text-anchor","middle");break;case B.RIGHT:n===tt.LEFT?t.attr("transform","rotate(-90)").attr("y",o).attr("x",-u.range()[0]/2).style("text-anchor","middle"):t.attr("transform","rotate(90)").attr("y",-o).attr("x",u.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case B.TOP:r=Dy.getSVGElementSize(t,{useBBox:!0}).height,t.attr("transform",`translate(${this.margins.left/2+u.range()[1]/2}, ${r/2})`).style("text-anchor","middle")}}if(g){const e=Og(R.tickValues(),Hm(n,"timeScale","timeInterval")),r=M.showDayName,i=f;t&&(f=f.transition().call((e=>this.services.transitions.setupTransition({transition:e,name:"axis-update",animate:t})))),f=f.call(R),i.selectAll(".tick").data(R.tickValues(),u).order().select("text").style("font-weight",((t,n)=>Eg(t,n,R.tickValues(),e,r)?"bold":"normal"))}else f=t&&d?f.transition().call((e=>this.services.transitions.setupTransition({transition:e,name:"axis-update",animate:t}))).call(R):f.call(R);if(p.call(R),e===B.BOTTOM||e===B.TOP){let t=!1;const n=Hm(m,"ticks","rotation");if(n===K.ALWAYS)t=!0;else if(n===K.NEVER)t=!1;else if(!n||n===K.AUTO)if(u.step)t=p.selectAll("g.tick text").nodes().some((t=>Dy.getSVGElementSize(t,{useBBox:!0}).width>=u.step()));else{t=!1;const e=p.append("text").text("A"),n=Dy.getSVGElementSize(e.node(),{useBBox:!0}).width;let r;p.selectAll("g.tick").each((function(){const e=an(this),i=parseFloat(Hm(Um(this),"tx"));null!==i&&r+e.text().length*n*.8>=i&&(t=!0),r=i})),e.remove()}t?(S||(R.ticks(this.getNumberOfFittingTicks(o,D,zp)),p.call(R),f.call(R)),a.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",e===B.TOP?"start":"end")):a.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(_?a.attr("opacity",0):a.attr("opacity",1),f.selectAll("g.tick").attr("aria-label",(t=>t)),p.selectAll("g.tick").attr("aria-label",(t=>t)),x!==U.NONE&&b===F.LABELS&&!E){const t=this.services.cartesianScales.getScaleDomain(e);if(t.length>0){const n=i.select(`g.axis.${e} g.ticks g.tick`).html();a.selectAll("g.ticks g.tick").html(n);const r=this;a.selectAll("g.tick text").data(t).text((function(t){return t.length>T?(r.truncation[e]=!0,$m(t,x,O)):t})),this.getInvisibleAxisRef().selectAll("g.tick text").data(t).text((function(t){return t.length>T?$m(t,x,O):t})),a.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),a.selectAll("g.tick text").data(t)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:e}=this.configs,n=Dy.appendOrSelect(t,`g.axis.${e}`),r=this.getOptions(),i=Hm(r,"axes",e),o=Hm(i,"scaleType"),s=Hm(i,"truncation","threshold"),a=this;n.selectAll("g.tick text").on("mouseover",(function(t,e){a.services.events.dispatchEvent(L.Axis.LABEL_MOUSEOVER,{event:t,element:an(this),datum:e}),o===F.LABELS&&e.length>s&&a.services.events.dispatchEvent(L.Tooltip.SHOW,{event:t,hoveredElement:an(this),content:e})})).on("mousemove",(function(t,e){a.services.events.dispatchEvent(L.Axis.LABEL_MOUSEMOVE,{event:t,element:an(this),datum:e}),o===F.LABELS&&e.length>s&&a.services.events.dispatchEvent(L.Tooltip.MOVE,{event:t})})).on("click",(function(t,e){a.services.events.dispatchEvent(L.Axis.LABEL_CLICK,{event:t,element:an(this),datum:e})})).on("mouseout",(function(t,e){a.services.events.dispatchEvent(L.Axis.LABEL_MOUSEOUT,{event:t,element:an(this),datum:e}),o===F.LABELS&&a.services.events.dispatchEvent(L.Tooltip.HIDE)}))}getInvisibleAxisRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} g.ticks.invisible`)}getTitleRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} text.axis-title`)}getNumberOfFittingTicks(t,e,n){return function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=Wg(n))==n?n:0),void 0!==e&&(e=(e=Wg(e))==e?e:0),function(t,e,n){return t==t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}(Wg(t),e,n)}(Math.floor(t/(e*n)),2,Fp)}destroy(){const t=this.getComponentContainer(),{position:e}=this.configs;Dy.appendOrSelect(t,`g.axis.${e}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class M_ extends S_{constructor(t,e,n){super(t,e,n)}render(t=!0){super.render(t),super.destroy();const e=this.configs.position,n=this.getComponentContainer(),r=Dy.appendOrSelect(n,`g.axis.${e}`),i=this;r.selectAll("g.tick").each((function(t,n){const r=an(this);r.classed("tick-hover",!0).attr("tabindex",0===n?0:-1);const o=r.select("text"),{width:s,height:a}=Dy.getSVGElementSize(o,{useBBox:!0}),l=Dy.appendOrSelect(r,"rect.axis-holder");let c=0,u=0;switch(e){case B.LEFT:c=-s+Number(o.attr("x")),u=-a/2;break;case B.RIGHT:c=Math.abs(Number(o.attr("x"))),u=-a/2;break;case B.TOP:c=-s/2,u=-a+Number(o.attr("y"))/2,i.truncation[e]&&(c=0,l.attr("transform","rotate(-45)"));break;case B.BOTTOM:c=-s/2,u=a/2-2,i.truncation[e]&&(c=-s,l.attr("transform","rotate(-45)"))}l.attr("x",c-Gp).attr("y",u).attr("width",s+2*Gp).attr("height",a).lower()})),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:e}=this.configs,n=Dy.appendOrSelect(t,`g.axis.${e}`),r=this.getOptions(),i=Hm(r,"axes",e),o=Hm(i,"scaleType"),s=Hm(i,"truncation","threshold"),a=this;n.selectAll("g.tick.tick-hover").on("mouseover",(function(t){const e=an(this).select("text"),n=e.datum();a.services.events.dispatchEvent(L.Axis.LABEL_MOUSEOVER,{event:t,element:e,datum:n}),o===F.LABELS&&n.length>s&&a.services.events.dispatchEvent(L.Tooltip.SHOW,{event:t,element:e,datum:n})})).on("mousemove",(function(t){const e=an(this).select("text"),n=e.datum();a.services.events.dispatchEvent(L.Axis.LABEL_MOUSEMOVE,{event:t,element:e,datum:n}),a.services.events.dispatchEvent(L.Tooltip.MOVE,{event:t})})).on("click",(function(t){a.services.events.dispatchEvent(L.Axis.LABEL_CLICK,{event:t,element:an(this).select("text"),datum:an(this).select("text").datum()})})).on("mouseout",(function(t){a.services.events.dispatchEvent(L.Axis.LABEL_MOUSEOUT,{event:t,element:an(this).select("text"),datum:an(this).select("text").datum()}),o===F.LABELS&&a.services.events.dispatchEvent(L.Tooltip.HIDE)})).on("focus",(function(t){const e={clientX:0,clientY:0};if(t.target){t.target.focus();const n=t.target.getBoundingClientRect();e.clientX=n.x,e.clientY=n.y}a.services.events.dispatchEvent(L.Axis.LABEL_FOCUS,{event:{...t,...e},element:an(this),datum:an(this).select("text").datum()})})).on("blur",(function(t){a.services.events.dispatchEvent(L.Axis.LABEL_BLUR,{event:t,element:an(this),datum:an(this).select("text").datum()})})).on("keydown",(function(t){t.key&&"Escape"===t.key&&(a.services.events.dispatchEvent(L.Tooltip.HIDE),a.services.events.dispatchEvent(L.Axis.LABEL_BLUR,{event:t,element:an(this),datum:an(this).select("text").datum()})),e===B.LEFT||e===B.RIGHT?t.key&&"ArrowUp"===t.key?a.goNext(this,t):t.key&&"ArrowDown"===t.key&&a.goPrevious(this,t):t.key&&"ArrowLeft"===t.key?a.goPrevious(this,t):t.key&&"ArrowRight"===t.key&&a.goNext(this,t)}))}goNext(t,e){t.nextElementSibling&&"path"!==t.nextElementSibling.tagName&&t.nextElementSibling.dispatchEvent(new Event("focus")),e.preventDefault()}goPrevious(t,e){t.previousElementSibling&&"path"!==t.previousElementSibling.tagName&&t.previousElementSibling.dispatchEvent(new Event("focus")),e.preventDefault()}destroy(){const t=this.getComponentContainer(),{position:e}=this.configs;Dy.appendOrSelect(t,`g.axis.${e}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class A_ extends wv{constructor(){super(...arguments),this.type="2D-axes",this.renderType=P.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const e={},n=Object.keys(B),r=Hm(this.getOptions(),"axes");n.forEach((t=>{r[B[t]]&&(e[B[t]]=!0)})),this.configs.axes=e,n.forEach((t=>{const e=B[t];if(this.configs.axes[e]&&!this.children[e]){const t={position:e,axes:this.configs.axes,margins:this.margins},n=this.model.axisFlavor===rt.DEFAULT?new S_(this.model,this.services,t):new M_(this.model,this.services,t);n.setModel(this.model),n.setServices(this.services),n.setParent(this.parent),this.children[e]=n}})),Object.keys(this.children).forEach((e=>{this.children[e].render(t)}));const i={};Object.keys(this.children).forEach((t=>{const e=this.children[t],n=e.configs.position,r=e.getInvisibleAxisRef(),{width:o,height:s}=Dy.getSVGElementSize(r,{useBBox:!0});let a;switch(e.getTitleRef().empty()?a=0:(a=Dy.getSVGElementSize(e.getTitleRef(),{useBBox:!0}).height,(n===B.LEFT||n===B.RIGHT)&&(a+=5)),n){case B.TOP:i.top=s+a;break;case B.BOTTOM:i.bottom=s+a;break;case B.LEFT:i.left=o+a;break;case B.RIGHT:i.right=o+a}})),this.services.events.dispatchEvent(L.Axis.RENDER_COMPLETE),Object.keys(i).some((t=>this.margins[t]!==i[t]))&&(this.margins=Object.assign(this.margins,i),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(L.ZoomBar.UPDATE),Object.keys(this.children).forEach((t=>{this.children[t].margins=this.margins})),this.render(!0))}}class k_ extends wv{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const e=Hm(this.getOptions(),"data","loading");e?this.renderSkeleton(e):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===q.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===q.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===q.PIE)this.renderPieSkeleton(t);else{if(this.configs.skeleton!==q.DONUT)throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`);this.renderDonutSkeleton(t)}}renderGridSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawXGrid(t),this.drawYGrid(t),t&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(t){const e=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(t),e===$.VERTICAL&&this.drawYGrid(t),e===$.HORIZONTAL&&this.drawXGrid(t),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(t){const e=this.computeOuterRadius();this.drawRing(e,0,t),t&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(t){const e=this.computeOuterRadius(),n=this.computeInnerRadius();this.drawRing(e,n,t),t&&this.setShimmerEffect("shimmer-areas")}setScales(){const t=this.services.cartesianScales.getMainXScale().range(),e=this.services.cartesianScales.getMainYScale().range();this.xScale=Ho().domain([0,1]).range(t),this.yScale=Ho().domain([0,1]).range(e)}drawBackdrop(t){const e=this.parent,{width:n,height:r}=Dy.getSVGElementSize(e,{useAttrs:!0});this.backdrop=Dy.appendOrSelect(e,"svg.chart-skeleton.DAII").attr("width",n).attr("height",r);const i=Dy.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");i.attr("width","100%").attr("height","100%");const[o]=this.xScale.range(),[,s]=this.yScale.range();this.backdrop.merge(i).attr("x",o).attr("y",s),i.classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(t){const e=+this.backdrop.attr("width"),n=Hm(this.getOptions(),"grid","x","numberOfTicks"),r=this.xScale.ticks(n).map((t=>t*e)),i=Dy.appendOrSelect(this.backdrop,"g.x.skeleton"),o=i.selectAll("line").data(r);o.enter().append("line").merge(o).attr("x1",(t=>t)).attr("x2",(t=>t)).attr("y1",0).attr("y2","100%"),i.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawYGrid(t){const e=+this.backdrop.attr("height"),n=this.backdrop.attr("width"),r=Hm(this.getOptions(),"grid","y","numberOfTicks"),i=this.xScale.ticks(r).map((t=>t*e)),o=Dy.appendOrSelect(this.backdrop,"g.y.skeleton"),s=o.selectAll("line").data(i);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",(t=>t)).attr("y2",(t=>t)),o.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawRing(t,e,n=!0){const r=this.parent,{width:i,height:o}=Dy.getSVGElementSize(r,{useAttrs:!0}),s=Dy.appendOrSelect(r,"svg.chart-skeleton").attr("width",i).attr("height",o),a=0===e?"pie":"donut",l=Hm(this.getOptions(),a,"alignment");Dy.appendOrSelect(s,"rect.chart-skeleton-area-container").attr("width",i).attr("height",o).attr("fill","none");const c=function(){var t=Tl,e=Ol,n=ul(0),r=null,i=Sl,o=Ml,s=Al,a=null,l=xl(c);function c(){var c,u,h=+t.apply(this,arguments),d=+e.apply(this,arguments),f=i.apply(this,arguments)-_l,p=o.apply(this,arguments)-_l,m=hl(p-f),g=p>f;if(a||(a=c=l()),d<h&&(u=d,d=h,h=u),d>vl)if(m>wl-vl)a.moveTo(d*fl(f),d*gl(f)),a.arc(0,0,d,f,p,!g),h>vl&&(a.moveTo(h*fl(p),h*gl(p)),a.arc(0,0,h,p,f,g));else{var y,v,b=f,_=p,w=f,E=p,x=m,T=m,O=s.apply(this,arguments)/2,S=O>vl&&(r?+r.apply(this,arguments):yl(h*h+d*d)),M=ml(hl(d-h)/2,+n.apply(this,arguments)),A=M,k=M;if(S>vl){var D=El(S/h*gl(O)),C=El(S/d*gl(O));(x-=2*D)>vl?(w+=D*=g?1:-1,E-=D):(x=0,w=E=(f+p)/2),(T-=2*C)>vl?(b+=C*=g?1:-1,_-=C):(T=0,b=_=(f+p)/2)}var R=d*fl(b),L=d*gl(b),P=h*fl(E),I=h*gl(E);if(M>vl){var N,B=d*fl(_),j=d*gl(_),U=h*fl(w),$=h*gl(w);if(m<bl)if(N=function(t,e,n,r,i,o,s,a){var l=n-t,c=r-e,u=s-i,h=a-o,d=h*l-u*c;if(!(d*d<vl))return[t+(d=(u*(e-o)-h*(t-i))/d)*l,e+d*c]}(R,L,U,$,B,j,P,I)){var F=R-N[0],H=L-N[1],z=B-N[0],V=j-N[1],G=1/gl(function(t){return t>1?0:t<-1?bl:Math.acos(t)}((F*z+H*V)/(yl(F*F+H*H)*yl(z*z+V*V)))/2),W=yl(N[0]*N[0]+N[1]*N[1]);A=ml(M,(h-W)/(G-1)),k=ml(M,(d-W)/(G+1))}else A=k=0}T>vl?k>vl?(y=kl(U,$,R,L,d,k,g),v=kl(B,j,P,I,d,k,g),a.moveTo(y.cx+y.x01,y.cy+y.y01),k<M?a.arc(y.cx,y.cy,k,dl(y.y01,y.x01),dl(v.y01,v.x01),!g):(a.arc(y.cx,y.cy,k,dl(y.y01,y.x01),dl(y.y11,y.x11),!g),a.arc(0,0,d,dl(y.cy+y.y11,y.cx+y.x11),dl(v.cy+v.y11,v.cx+v.x11),!g),a.arc(v.cx,v.cy,k,dl(v.y11,v.x11),dl(v.y01,v.x01),!g))):(a.moveTo(R,L),a.arc(0,0,d,b,_,!g)):a.moveTo(R,L),h>vl&&x>vl?A>vl?(y=kl(P,I,B,j,h,-A,g),v=kl(R,L,U,$,h,-A,g),a.lineTo(y.cx+y.x01,y.cy+y.y01),A<M?a.arc(y.cx,y.cy,A,dl(y.y01,y.x01),dl(v.y01,v.x01),!g):(a.arc(y.cx,y.cy,A,dl(y.y01,y.x01),dl(y.y11,y.x11),!g),a.arc(0,0,h,dl(y.cy+y.y11,y.cx+y.x11),dl(v.cy+v.y11,v.cx+v.x11),g),a.arc(v.cx,v.cy,A,dl(v.y11,v.x11),dl(v.y01,v.x01),!g))):a.arc(0,0,h,E,w,g):a.lineTo(P,I)}else a.moveTo(0,0);if(a.closePath(),c)return a=null,c+""||null}return c.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-bl/2;return[fl(r)*n,gl(r)*n]},c.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:ul(+e),c):t},c.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:ul(+t),c):e},c.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:ul(+t),c):n},c.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:ul(+t),c):r},c.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:ul(+t),c):i},c.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:ul(+t),c):o},c.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:ul(+t),c):s},c.context=function(t){return arguments.length?(a=t??null,c):a},c}().innerRadius(e).outerRadius(t).startAngle(0).endAngle(2*Math.PI),u=t+Math.abs(-15),h=t+(Math.min(i,o)-2*t)/2,d=Dy.appendOrSelect(s,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${u}, ${h})`).attr("d",c).classed("shimmer-effect-areas",n).classed("empty-state-areas",!n).style("fill",n?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let f=t+30;l===z.CENTER?f=i/2:l===z.RIGHT&&(f=i-t-30);const p=t+20;d.attr("transform",`translate(${f}, ${p})`)}computeOuterRadius(){const{width:t,height:e}=Dy.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,e)/2-15}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(t){const e="stop-bg-shimmer",n=this.parent.select(".chart-skeleton"),{width:r}=Dy.getSVGElementSize(this.parent,{useAttrs:!0}),i=r,o=Dy.appendOrSelect(n,"defs").lower(),s=Dy.appendOrSelect(o,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(t)).attr("class",t).attr("x1",0-3*.2*r).attr("x2",i).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),a=`\n\t\t\t<stop class="${e}" offset="0"></stop>\n\t\t\t<stop class="stop-shimmer" offset="0.2"></stop>\n\t\t\t<stop class="${e}" offset="0.4"></stop>\n\t\t`;s.html(a),function t(){s.attr("gradientTransform",`translate(${0-3*.2*r}, 0)`).transition().duration(2e3).delay(1e3).ease(ui).attr("gradientTransform",`translate(${i+3*.2*r}, 0)`).on("end",t)}()}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class D_ extends wv{constructor(){super(...arguments),this.type="zero-line",this.renderType=P.SVG}render(t){const e=this.services.cartesianScales.getRangeAxisPosition({groups:this.configs.groups}),n=this.services.cartesianScales.getScaleByPosition(e),[r,i]=n.domain(),o=r>0&&i<0||r<0&&i>0,s=this.getComponentContainer();if(!o)return void s.selectAll("line.domain").remove();const[a,l]=this.services.cartesianScales.getDomainScale().range();let c=+n(0)+.5;c||(c=n.range()[0]);const u=zm({x0:a,x1:l,y0:c,y1:c},this.services.cartesianScales.getOrientation());Dy.appendOrSelect(s,"line.domain").transition().call((e=>this.services.transitions.setupTransition({transition:e,name:"zero-line-update",animate:t}))).attr("y1",u.y0).attr("y2",u.y1).attr("x1",u.x0).attr("x2",u.x1)}}class C_ extends k_{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const e=Hm(this.getOptions(),"data","loading"),n=!(Hm(this.getOptions(),"grid","x","enabled")||Hm(this.getOptions(),"grid","y","enabled")||Hm(this.getOptions(),"axes","bottom","visible")||Hm(this.getOptions(),"axes","left","visible"));e&&!n?super.renderGridSkeleton(e):e&&n?this.renderSparklineSkeleton(e):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const e=this.backdrop.attr("width"),n=Dy.appendOrSelect(this.backdrop,"g.y.skeleton"),r=n.selectAll("line").data([100]);r.enter().append("line").merge(r).attr("x1",0).attr("x2",e).attr("y1",(t=>t)).attr("y2",(t=>t)),n.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const t=this.parent;this.backdrop=Dy.appendOrSelect(t,"svg.chart-skeleton.DAII"),Dy.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}function R_(t){return null!=t&&t.length?ad(t,1):[]}class L_ extends ky{zoomIn(t,e,n){let r,i,o;const s=n||Wp;t&&(r=t.x,i=t.y,o=2);const{width:a,height:l}=Dy.getSVGElementSize(this.services.domUtils.getHolder(),{useClientDimensions:!0});e.transition().duration(s.duration).ease(s.ease).attr("transform",`translate(${a/2}, ${l/2}) scale(${o}) translate(${-r},${-i})`),this.services.events.dispatchEvent(L.CanvasZoom.CANVAS_ZOOM_IN,{element:an(t)})}zoomOut(t,e){const n=e||Wp;t.transition().duration(n.duration).ease(n.ease).attr("transform",""),this.services.events.dispatchEvent(L.CanvasZoom.CANVAS_ZOOM_OUT)}}class P_ extends ky{init(){this.documentFragment=document.createDocumentFragment()}addEventListener(t,e){this.documentFragment.addEventListener(t,e)}removeEventListener(t,e){this.documentFragment.removeEventListener(t,e)}dispatchEvent(t,e){let n;e?n=new CustomEvent(t,{detail:e}):(n=document.createEvent("Event"),n.initEvent(t,!1,!0)),this.documentFragment.dispatchEvent(n)}}class I_ extends ky{constructor(t,e){super(t,e)}downloadCSV(t,e){const n=document.createElement("a"),r="text/csv;encoding:utf-8";if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([t],{type:r}),e);else if(URL&&"download"in n){const i=URL.createObjectURL(new Blob([t],{type:r}));n.href=i,n.setAttribute("download",e),document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(i)}else location.href=`data:application/octet-stream,${encodeURIComponent(t)}`}downloadImage(t,e){const n=document.createElement("a");n.download=e,n.href=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}}class N_ extends ky{constructor(){super(...arguments),this.pendingTransitions={}}init(){var t;null==(t=this.services.events)||t.addEventListener(L.Model.UPDATE,(()=>{this.pendingTransitions={}}))}setupTransition({transition:t,name:e,animate:n}){return this.pendingTransitions[t._id]=t,t.on("end interrupt cancel",(()=>{delete this.pendingTransitions[t._id]})),!1===this.model.getOptions().animations||!1===n?t.duration(0):t.duration(Hm(tm,e,"duration")||tm.default.duration)}getPendingTransitions(){return this.pendingTransitions}}function B_(t,e){const n=Nc(t),r=Nc(e),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}function j_(t,e){const n=Nc(t);if(isNaN(e))return Qm(t,NaN);if(!e)return n;const r=n.getDate(),i=Qm(t,n.getTime());return i.setMonth(n.getMonth()+e+1,0),r>=i.getDate()?i:(n.setFullYear(i.getFullYear(),i.getMonth(),r),n)}function U_(t,e){return j_(t,12*e)}function $_(t,e){return U_(t,-e)}function F_(t,e){const n=Nc(t),r=Nc(e),i=B_(n,r),o=Math.abs(function(t,e){const n=Nc(t),r=Nc(e);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}(n,r));let s;if(o<1)s=0;else{1===n.getMonth()&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*o);let e=B_(n,r)===-i;(function(t){const e=Nc(t);return+function(t){const e=Nc(t);return e.setHours(23,59,59,999),e}(e)==+function(t){const e=Nc(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}(e)})(Nc(t))&&1===o&&1===B_(t,r)&&(e=!1),s=i*(o-Number(e))}return 0===s?0:s}function H_(t,e){return j_(t,-e)}function z_(t,e){const n=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return n<0?-1:n>0?1:n}function V_(t,e){const n=Nc(t);return isNaN(e)?Qm(t,NaN):(e&&n.setDate(n.getDate()+e),n)}function G_(t,e){return V_(t,-e)}function W_(t,e){return Nc(t).getTime()-Nc(e).getTime()}function Y_(t){return t?Math[t]:Math.trunc}function Z_(t,e){return Qm(t,+Nc(t)+e)}function q_(t,e){return Z_(t,e*Zm)}function X_(t,e){return q_(t,-e)}function K_(t,e,n){const r=W_(t,e)/Ym;return Y_(null==n?void 0:n.roundingMethod)(r)}function Q_(t,e){return Z_(t,e*Ym)}function J_(t,e){return Q_(t,-e)}function tw(t,e,n){const r=W_(t,e)/1e3;return Y_(null==n?void 0:n.roundingMethod)(r)}function ew(t,e){return Z_(t,1e3*e)}function nw(t,e){return ew(t,-e)}class rw extends ky{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:t=null}={}){if(this.dualAxes&&t){const e=this.model.getOptions(),{groupMapsTo:n}=e.data,r=Hm(e,"axes",this.secondaryDomainAxisPosition),i=t[n];if(null!=r&&r.correspondingDatasets&&r.correspondingDatasets.includes(i))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:e=null}={}){if(this.dualAxes){const n=this.model.getOptions(),{groupMapsTo:r}=n.data,i=Hm(n,"axes",this.secondaryRangeAxisPosition);let o;if(null!==t?o=t[r]:e&&e.length>0&&(o=e[0]),null!=i&&i.correspondingDatasets&&i.correspondingDatasets.includes(o))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return Hm(this.model.getOptions(),"axes",t)}getDomainAxisOptions(){const t=this.getDomainAxisPosition();return this.getAxisOptions(t)}getRangeAxisOptions(){const t=this.getRangeAxisPosition();return this.getAxisOptions(t)}getScaleLabel(t){return this.getAxisOptions(t).title||(t===B.BOTTOM||t===B.TOP?"x-value":"y-value")}getDomainLabel(){return this.getScaleLabel(this.getDomainAxisPosition())}getRangeLabel(){return this.getScaleLabel(this.getRangeAxisPosition())}update(){this.determineAxisDuality(),this.findDomainAndRangeAxes(),this.determineOrientation(),Object.keys(B).map((t=>B[t])).forEach((t=>{this.scales[t]=this.createScale(t)}))}findDomainAndRangeAxes(){const t=this.findVerticalAxesPositions(),e=this.findHorizontalAxesPositions(),n=this.findDomainAndRangeAxesPositions(t,e);this.domainAxisPosition=n.primaryDomainAxisPosition,this.rangeAxisPosition=n.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=n.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=n.secondaryRangeAxisPosition)}determineOrientation(){this.rangeAxisPosition!==B.LEFT&&this.rangeAxisPosition!==B.RIGHT||this.domainAxisPosition!==B.BOTTOM&&this.domainAxisPosition!==B.TOP?this.orientation=$.HORIZONTAL:this.orientation=$.VERTICAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var t,e,n,r;const i=this.model.getOptions(),o=Hm(i,"axes");(null!=(t=o[B.LEFT])&&t.correspondingDatasets&&o[B.RIGHT]||null!=(e=o[B.RIGHT])&&e.correspondingDatasets&&o[B.LEFT]||null!=(n=o[B.TOP])&&n.correspondingDatasets&&o[B.BOTTOM]||null!=(r=o[B.BOTTOM])&&r.correspondingDatasets&&o[B.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const e=Hm(this.model.getOptions(),"axes",t,"domain");if(e&&!Array.isArray(e))throw new Error(`Domain in ${t} axis is not a valid array`);if(Array.isArray(e)&&(this.scaleTypes[t]===F.LINEAR||this.scaleTypes[t]===F.TIME)&&2!==e.length)throw new Error(`There can only be 2 elements in domain for scale type: ${this.scaleTypes[t]}`);return e}getOrientation(){return this.orientation}getScaleByPosition(t){return this.scales[t]}getScaleTypeByPosition(t){return this.scaleTypes[t]}getDomainAxisScaleType(){const t=this.getDomainAxisPosition();return this.getScaleTypeByPosition(t)}getRangeAxisScaleType(){const t=this.getRangeAxisPosition();return this.getScaleTypeByPosition(t)}getDomainScale(){return this.scales[this.domainAxisPosition]}getRangeScale(){return this.scales[this.rangeAxisPosition]}getMainXAxisPosition(){const t=[B.BOTTOM,B.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find((e=>t.indexOf(e)>-1))}getMainYAxisPosition(){const t=[B.LEFT,B.RIGHT];return[this.domainAxisPosition,this.rangeAxisPosition].find((e=>t.indexOf(e)>-1))}getMainXScale(){return this.scales[this.getMainXAxisPosition()]}getMainYScale(){return this.scales[this.getMainYAxisPosition()]}getValueFromScale(t,e,n,r){const i=this.model.getOptions(),o=Hm(i,"axes")[n],{mapsTo:s}=o,a=null!==Hm(r,s)?r[s]:r;let l;switch(e){case F.LABELS:l=t(a)+t.step()/2;break;case F.TIME:l=t(new Date(a));break;default:l=t(a)}return l}getBoundedScaledValues(t){const{bounds:e}=this.model.getOptions(),n=this.getRangeAxisPosition({datum:t}),r=this.scales[n],i=this.model.getOptions(),o=Hm(i,"axes")[n],{mapsTo:s}=o,a=void 0!==t[s]?t[s]:t;return[r(null!==Hm(t,e.upperBoundMapsTo)?t[e.upperBoundMapsTo]:a),r(null!==Hm(t,e.lowerBoundMapsTo)?t[e.lowerBoundMapsTo]:a)]}getValueThroughAxisPosition(t,e){const n=this.scaleTypes[t],r=this.scales[t];return this.getValueFromScale(r,n,t,e)}getDomainValue(t){const e=this.getDomainAxisPosition({datum:t});return this.getValueThroughAxisPosition(e,t)}getRangeValue(t){const e=this.getRangeAxisPosition({datum:t});return this.getValueThroughAxisPosition(e,t)}getMainXScaleType(){return this.getScaleTypeByPosition(this.getMainXAxisPosition())}getMainYScaleType(){return this.getScaleTypeByPosition(this.getMainYAxisPosition())}getDomainIdentifier(t){const e=this.model.getOptions();return Hm(e,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const e=this.model.getOptions();return Hm(e,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,e){const n=this.model.getOptions(),r=Hm(n,"axes",t);return r.scaleType===F.TIME?function(t,e){const n=new Date(t[0]),r=new Date(t[1]);return function(t,e){const n=Nc(t),r=Nc(e),i=B_(n,r),o=Math.abs(function(t,e){const n=Nc(t),r=Nc(e);return n.getFullYear()-r.getFullYear()}(n,r));n.setFullYear(1584),r.setFullYear(1584);const s=i*(o-+(B_(n,r)===-i));return 0===s?0:s}(r,n)>1?[$_(n,e),U_(r,e)]:F_(r,n)>1?[H_(n,e),j_(r,e)]:function(t,e){const n=Nc(t),r=Nc(e),i=z_(n,r),o=Math.abs(Km(n,r));n.setDate(n.getDate()-i*o);const s=i*(o-+(z_(n,r)===-i));return 0===s?0:s}(r,n)>1?[G_(n,e),V_(r,e)]:function(t,e){const n=W_(t,e)/Zm;return Y_(void 0)(n)}(r,n)>1?[X_(n,e),q_(r,e)]:K_(r,n)>30?[J_(n,30*e),Q_(r,30*e)]:K_(r,n)>1?[J_(n,e),Q_(r,e)]:tw(r,n)>15?[nw(n,15*e),ew(r,15*e)]:tw(r,n)>1?[nw(n,e),ew(r,e)]:[n,r]}(e,Hm(n,"timeScale","addSpaceOnEdges")):function([t,e],n,r){const i=(e-t)*n,o=e<=0&&e+i>0?0:e+i;let s=t>=0&&t-i<0?0:t-i;if(r===F.LOG&&s<=0){if(t<=0)throw Error("Data must have values greater than 0 if log scale type is used.");s=t}return[s,o]}(e,.1,r.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),e=Hm(t,"axes"),n=this.isDualAxes();return null===Hm(e,B.LEFT)&&null!==Hm(e,B.RIGHT)||!0===Hm(e,B.RIGHT,"main")||n&&Hm(e,B.LEFT,"correspondingDatasets")?{primary:B.RIGHT,secondary:B.LEFT}:{primary:B.LEFT,secondary:B.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),e=Hm(t,"axes"),n=this.isDualAxes();return null===Hm(e,B.BOTTOM)&&null!==Hm(e,B.TOP)||!0===Hm(e,B.TOP,"main")||n&&Hm(e,B.BOTTOM,"correspondingDatasets")?{primary:B.TOP,secondary:B.BOTTOM}:{primary:B.BOTTOM,secondary:B.TOP}}findDomainAndRangeAxesPositions(t,e){const n=this.model.getOptions(),r=Hm(n,"axes",t.primary),i=Hm(n,"axes",e.primary),o=r.scaleType||F.LINEAR,s=i.scaleType||F.LINEAR,a={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return a.primaryDomainAxisPosition=e.primary,a.primaryRangeAxisPosition=t.primary,a.secondaryDomainAxisPosition=e.secondary,a.secondaryRangeAxisPosition=t.secondary,(!(s===F.LABELS||s===F.TIME)&&o===F.LABELS||o===F.TIME)&&(a.primaryDomainAxisPosition=t.primary,a.primaryRangeAxisPosition=e.primary,a.secondaryDomainAxisPosition=t.secondary,a.secondaryRangeAxisPosition=e.secondary),a}getScaleDomain(t){const e=this.model.getOptions(),n=Hm(e,"axes",t),r=Hm(e,"bounds"),{includeZero:i}=n,o=Hm(n,"scaleType")||F.LINEAR;if(this.model.isDataEmpty())return[];if(n.binned){const{bins:t}=this.model.getBinConfigurations();return[0,Mt(t,(t=>t.length))]}if(n.limitDomainToBins){const{bins:t}=this.model.getBinConfigurations(),e=this.model.getStackKeys({bins:t});return[e[0].split(":")[0],e[e.length-1].split(":")[1]]}const s=this.model.getDisplayData(),{extendLinearDomainBy:a,mapsTo:l,percentage:c,thresholds:u}=n,{reference:h,compareTo:d}=Vp;if(n.domain)return o===F.LABELS?n.domain:(o===F.TIME&&(n.domain=n.domain.map((t=>void 0===t.getTime?new Date(t):t))),this.extendsDomain(t,n.domain));if(c)return[0,100];if(n&&o===F.LABELS)return Up(s.map((t=>t[l])));let f,p;const m=this.model.getDataGroupNames();if(o===F.LABELS_RATIO)return s.map((t=>`${t[h]}/${t[d]}`));if(o===F.TIME)p=s.map((t=>+new Date(t[l])));else if(r&&e.axes)p=[],s.forEach((t=>{p.push(t[l]),t[r.upperBoundMapsTo]&&p.push(t[r.upperBoundMapsTo]),t[r.lowerBoundMapsTo]&&p.push(t[r.lowerBoundMapsTo])}));else if(!0===n.stacked&&m&&t===this.getRangeAxisPosition()){const{groupMapsTo:t}=e.data,n=this.model.getDataValuesGroupedByKeys({groups:m}),r=s.filter((e=>!m.includes(e[t]))),i=[];n.forEach((t=>{const{...e}=t;let n=0,r=0;Object.values(e).forEach((t=>{isNaN(t)||(t<0?r+=t:n+=t)})),i.push([r,n])})),p=[...R_(i),...r.map((t=>t[l]))]}else p=[],s.forEach((t=>{const e=t[l];Array.isArray(e)&&2===e.length?(p.push(e[0]),p.push(e[1])):(a&&p.push(Math.max(t[l],t[a])),p.push(e))}));return o!==F.TIME&&o!==F.LOG&&i&&p.push(0),u&&u.length>0&&u.forEach((t=>{const e=Hm(t,"value");null!==e&&p.push(e)})),f=ht(p),f=this.extendsDomain(t,f),f}createScale(t){const e=this.model.getOptions(),n=Hm(e,"axes",t);if(!n)return null;const r=Hm(n,"scaleType")||F.LINEAR;let i;return this.scaleTypes[t]=r,i=r===F.TIME?cl():r===F.LOG?Xo().base(n.base||10):r===F.LABELS||r===F.LABELS_RATIO?Co():Ho(),i.domain(this.getScaleDomain(t)),i}getHighestDomainThreshold(){const t=Hm(this.model.getOptions(),"axes"),e=this.getDomainAxisPosition(),{thresholds:n}=t[e];if(!Array.isArray(n)||Array.isArray(n)&&!n.length)return null;const r=this.getDomainScale(),i=n.sort(((t,e)=>e.value-t.value))[0];return this.getScaleTypeByPosition(e)===F.TIME&&("string"==typeof i.value||void 0===i.value.getTime)&&(i.value=new Date(i.value)),{threshold:i,scaleValue:r(i.value)}}getHighestRangeThreshold(){const t=Hm(this.model.getOptions(),"axes"),e=this.getRangeAxisPosition(),{thresholds:n}=t[e];if(!Array.isArray(n)||Array.isArray(n)&&!n.length)return null;const r=this.getRangeScale(),i=n.sort(((t,e)=>e.value-t.value))[0];return{threshold:i,scaleValue:r(i.value)}}}class iw extends ky{constructor(){super(...arguments),this.curveTypes={curveLinear:Rl,curveLinearClosed:cc,curveBasis:Fl,curveBasisClosed:zl,curveBasisOpen:Gl,curveBundle:Yl,curveCardinal:Xl,curveCardinalClosed:Ql,curveCardinalOpen:tc,curveCatmullRom:rc,curveCatmullRomClosed:oc,curveCatmullRomOpen:ac,curveMonotoneX:yc,curveMonotoneY:vc,curveNatural:wc,curveStep:xc,curveStepAfter:Oc,curveStepBefore:Tc}}getD3Curve(){let t="curveLinear";const e=this.model.getOptions().curve;if(e&&(t="string"==typeof e?e:e.name),this.curveTypes[t]){let n=this.curveTypes[t];return e&&Object.keys(e).forEach((t=>{n[t]&&(n=n[t](e[t]))})),n}return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}}class ow extends ky{isZoomBarEnabled(){if(!this.services.cartesianScales||!Hm(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),e=Hm(this.model.getOptions(),"axes",t,"scaleType");return t===B.BOTTOM&&e===F.TIME}getZoomBarData(){const t=this.model.getZoomBarData();return t&&t.length>1?t:this.model.getDisplayData()}getDefaultZoomBarDomain(t){if(!this.services.zoom)throw new Error("Services zoom not defined");const e=t||this.services.zoom.getZoomBarData(),{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales undefined");const r=n.getMainXAxisPosition(),i=n.getDomainIdentifier(),o=Hm(this.model.getOptions(),"axes",r,"domain");if(Array.isArray(o)&&2===o.length)return o;if(!r)throw new Error("Not defined: mainXAxisPosition");return n.extendsDomain(r,ht(e,(t=>t[i])))}handleDomainChange(t,e={dispatchEvent:!0}){var n;this.model.set({zoomDomain:t},{animate:!1}),e.dispatchEvent&&(null==(n=this.services.events)||n.dispatchEvent(L.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return Hm(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,e){var n;const r=this.model.get("zoomDomain"),i=Object.assign({stacked:!1},e),o=Hm(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&o&&r){const e=i.stacked?"sharedStackKey":null==(n=this.services.cartesianScales)?void 0:n.getDomainIdentifier(),o=t.filter((t=>new Date(t[e])>=r[0]&&new Date(t[e])<=r[1]));if(o.length>0)return o}return t}zoomIn(t=this.getZoomRatio()){var e;const n=this.model.get("zoomDomain"),r=em.handleWidth,i=null==(e=this.services.cartesianScales)?void 0:e.getMainXScale().copy();i.domain(this.getDefaultZoomBarDomain());const o=i(n[0]),s=i(n[1]);if(s-o<r+1)return;const a=i.range(),l=s-o,c=Math.min((a[1]-a[0])/2*(t/2),l/2);let u=o+c,h=s-c;u>=h&&(u=o+l/2-r/2,h=s-l/2+r/2);const d=[i.invert(u),i.invert(h)];(n[0].valueOf()!==d[0].valueOf()||n[1].valueOf()!==d[1].valueOf())&&this.handleDomainChange(d)}zoomOut(t=this.getZoomRatio()){const e=this.model.get("zoomDomain");if(!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const n=this.services.cartesianScales.getMainXScale().copy();n.domain(this.getDefaultZoomBarDomain());const r=n(e[0]),i=n(e[1]),o=n.range(),s=(o[1]-o[0])/2*(t/2),a=Math.max(r-s,o[0]),l=Math.min(i+s,o[1]),c=[n.invert(a),n.invert(l)];(e[0].valueOf()!==c[0].valueOf()||e[1].valueOf()!==c[1].valueOf())&&this.handleDomainChange(c)}resetZoomDomain(){const t=this.model.get("zoomDomain"),e=this.getDefaultZoomBarDomain();(t[0].valueOf()!==e[0].valueOf()||t[1].valueOf()!==e[1].valueOf())&&this.handleDomainChange(e)}isMinZoomDomain(){const t=this.model.get("zoomDomain"),e=this.getDefaultZoomBarDomain();return!(!t||!e)&&(t[1].valueOf()-t[0].valueOf())/(e[1].valueOf()-e[0].valueOf())<Hm(this.model.getOptions(),"zoomBar","minZoomRatio")}isMaxZoomDomain(){const t=this.model.get("zoomDomain"),e=this.getDefaultZoomBarDomain();return!(!t||!e||t[0].valueOf()!==e[0].valueOf()||t[1].valueOf()!==e[1].valueOf())}isEmptyState(){return 0===this.getZoomBarData().length}isZoomBarLoading(t){return Hm(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return Hm(this.model.getOptions(),"zoomBar",t,"locked")}}var sw=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function aw(t){return sw.test(t)}var lw="\\ud800-\\udfff",cw="["+lw+"]",uw="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",hw="\\ud83c[\\udffb-\\udfff]",dw="[^"+lw+"]",fw="(?:\\ud83c[\\udde6-\\uddff]){2}",pw="[\\ud800-\\udbff][\\udc00-\\udfff]",mw="(?:"+uw+"|"+hw+")?",gw="[\\ufe0e\\ufe0f]?",yw=gw+mw+"(?:\\u200d(?:"+[dw,fw,pw].join("|")+")"+gw+mw+")*",vw="(?:"+[dw+uw+"?",uw,fw,pw,cw].join("|")+")",bw=RegExp(hw+"(?="+hw+")|"+vw+yw,"g");var _w=function(t){var e=aw(t=Qh(t))?function(t){return aw(t)?function(t){return t.match(bw)||[]}(t):function(t){return t.split("")}(t)}(t):void 0,n=e?e[0]:t.charAt(0),r=e?function(t,e,n){var r=t.length;return n=void 0===n?r:n,!e&&n>=r?t:function(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}(t,e,n)}(e,1).join(""):t.slice(1);return n.toUpperCase()+r};const ww=_w;vv((function(t,e,n){return e=e.toLowerCase(),t+(n?function(t){return ww(Qh(t).toLowerCase())}(e):e)}));class Ew{constructor(t,e){this.components=[],this.services={canvasZoom:L_,domUtils:Dy,events:P_,files:I_,gradientUtils:Cy,transitions:N_},this.model=new Bg(this.services)}init(t,e){this.model.set({holder:t},{skipUpdate:!0}),Object.keys(this.services).forEach((t=>{const e=this.services[t];this.services[t]=new e(this.model,this.services)})),this.services.events.addEventListener(L.Model.UPDATE,(t=>{const e=!!Hm(t,"detail","animate");this.update(e)})),this.model.setData(e.data),this.services.events.addEventListener(L.Chart.RESIZE,(()=>{this.update(!1)})),this.components=this.getComponents(),this.update()}getComponents(){return console.error("getComponents() method is not implemented"),[]}update(t=!0){if(!this.components)return;Object.keys(this.services).forEach((t=>{this.services[t].update()})),this.components.forEach((e=>e.render(t)));const e=this.services.transitions.getPendingTransitions(),n=Object.keys(e).map((t=>e[t].end().catch((t=>t))));Promise.all(n).then((()=>this.services.events.dispatchEvent(L.Chart.RENDER_FINISHED)))}destroy(){this.components.forEach((t=>t.destroy())),this.services.domUtils.getHolder().remove(),this.model.set({destroyed:!0},{skipUpdate:!0})}getChartComponents(t,e){const n=this.model.getOptions(),r=Hm(n,"toolbar","enabled"),i={id:"legend",components:[new a_(this.model,this.services)],growth:Y.PREFERRED},o=Hm(n,"canvasZoom","enabled");o&&!0===o&&t.push(new c_(this.model,this.services));const s=!!this.model.getOptions().title,a={id:"title",components:[new s_(this.model,this.services)],growth:Y.STRETCH},l={id:"toolbar",components:[new vb(this.model,this.services)],growth:Y.PREFERRED},c={id:"header",components:[new _b(this.model,this.services,[a,...r?[l]:[]],{direction:W.ROW,alignItems:Z.CENTER})],growth:Y.PREFERRED},u={id:"graph-frame",components:t,growth:Y.STRETCH,renderType:Hm(e,"graphFrameRenderType")||P.SVG},h=!0!==Hm(e,"excludeLegend")&&!1!==n.legend.enabled;let d=W.COLUMN;if(h){const t=Hm(n,"legend","position");"left"===t?(d=W.ROW,n.legend.orientation||(n.legend.orientation=V.VERTICAL)):"right"===t?(d=W.ROW_REVERSE,n.legend.orientation||(n.legend.orientation=V.VERTICAL)):"bottom"===t&&(d=W.COLUMN_REVERSE)}const f={id:"spacer",components:[new wb(this.model,this.services)],growth:Y.PREFERRED},p={id:"full-frame",components:[new _b(this.model,this.services,[...h?[i]:[],...h?[f]:[],u],{direction:d})],growth:Y.STRETCH},m=[];if(s||r){m.push(c);const t={id:"spacer",components:[new wb(this.model,this.services,r?{size:15}:void 0)],growth:Y.PREFERRED};m.push(t)}return m.push(p),[new m_(this.model,this.services),new o_(this.model,this.services),new _b(this.model,this.services,m,{direction:W.COLUMN})]}}class xw extends Ew{constructor(t,e){super(t,e),this.services=Object.assign(this.services,{cartesianScales:rw,curves:iw,zoom:ow}),this.model=new jg(this.services)}getAxisChartComponents(t,e){const n=this.model.getOptions(),r=Hm(n,"zoomBar",B.TOP,"enabled"),i=Hm(n,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const o=this.services.cartesianScales.getMainXAxisPosition(),s=Hm(n,"axes",o,"scaleType"),a=r&&o===B.BOTTOM&&s===F.TIME,l=this.services.zoom.isZoomBarLocked(B.TOP),c=!!this.model.getOptions().title,u={id:"title",components:[new s_(this.model,this.services)],growth:Y.STRETCH},h={id:"toolbar",components:[new vb(this.model,this.services)],growth:Y.PREFERRED},d={id:"header",components:[new _b(this.model,this.services,[u,...i?[h]:[]],{direction:W.ROW,alignItems:Z.CENTER})],growth:Y.PREFERRED},f={id:"legend",components:[new a_(this.model,this.services)],growth:Y.PREFERRED};a&&!l&&t.push(new l_(this.model,this.services),new y_(this.model,this.services)),t.push(new b_(this.model,this.services)),t.push(new __(this.model,this.services));const p={id:"graph-frame",components:t,growth:Y.STRETCH,renderType:P.SVG},m=!1!==Hm(e,"legend","enabled")&&!1!==this.model.getOptions().legend.enabled;let g=W.COLUMN;if(m){const t=Hm(this.model.getOptions(),"legend","position");t===H.LEFT?(g=W.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=V.VERTICAL)):t===H.RIGHT?(g=W.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=V.VERTICAL)):t===H.BOTTOM&&(g=W.COLUMN_REVERSE)}const y={id:"spacer",components:[new wb(this.model,this.services)],growth:Y.PREFERRED},v={id:"full-frame",components:[new _b(this.model,this.services,[...m?[f]:[],...m?[y]:[],p],{direction:g})],growth:Y.STRETCH},b={id:"zoom-bar",components:[new v_(this.model,this.services)],growth:Y.PREFERRED,renderType:P.SVG},_=[];if(c||i){_.push(d);const t={id:"spacer",components:[new wb(this.model,this.services,i?{size:15}:void 0)],growth:Y.PREFERRED};_.push(t)}return a&&_.push(b),_.push(v),[new w_(this.model,this.services),new o_(this.model,this.services),new _b(this.model,this.services,_,{direction:W.COLUMN})]}}Q.LINE,Q.SCATTER,Q.AREA,Q.STACKED_AREA,Q.SIMPLE_BAR,Q.GROUPED_BAR,Q.STACKED_BAR;class Tw extends xw{constructor(t,e){super(t,e),this.model.setOptions(function(t,e){var n;const r=Bf(t),i=Object.keys(e.axes||{});null!=(n=null==e?void 0:e.toolbar)&&n.controls&&delete r.toolbar.controls,0===i.length&&delete r.axes;for(const t in r.axes)if(i.includes(t)){const n=e.axes[t];if((n.primary||n.secondary)&&console.warn("`primary` & `secondary` are no longer needed for axis configurations. Read more here https://charts.carbondesignsystem.com/?path=/story/docs-tutorials--tabular-data-format"),null==n.mapsTo){const t=n.scaleType;null==t?n.mapsTo="value":t===F.TIME?n.mapsTo="date":t===F.LABELS&&(n.mapsTo="key")}}else delete r.axes[t];return Fm(r,e),Rp(r,e)}(jm.lineChart,e.options)),this.init(t,e)}getComponents(){const t=[new A_(this.model,this.services),new E_(this.model,this.services),new T_(this.model,this.services),new x_(this.model,this.services),new O_(this.model,this.services,{handleThresholds:!0}),new C_(this.model,this.services),new D_(this.model,this.services)];return this.getAxisChartComponents(t)}}var Ow,Sw={exports:{}},Mw={};Sw.exports=function(){if(Ow)return Mw;Ow=1;var t=r,e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,o=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function a(t,n,r){var a,l={},c=null,u=null;for(a in void 0!==r&&(c=""+r),void 0!==n.key&&(c=""+n.key),void 0!==n.ref&&(u=n.ref),n)i.call(n,a)&&!s.hasOwnProperty(a)&&(l[a]=n[a]);if(t&&t.defaultProps)for(a in n=t.defaultProps)void 0===l[a]&&(l[a]=n[a]);return{$$typeof:e,type:t,key:c,ref:u,props:l,_owner:o.current}}return Mw.Fragment=n,Mw.jsx=a,Mw.jsxs=a,Mw}();var Aw=Sw.exports;class kw extends r.PureComponent{constructor(){super(...arguments),o(this,"chart"),o(this,"chartRef",r.createRef())}createChart(t,e,n){throw new Error("Method not implemented.")}componentDidMount(){this.chartRef.current&&!this.chart&&(this.chart=this.createChart(this.chartRef.current,this.props.data,this.props.options))}componentDidUpdate(t){var e,n;this.props.data!==t.data&&(null==(e=this.chart)||e.model.setData(this.props.data)),this.props.options!==t.options&&(null==(n=this.chart)||n.model.setOptions(this.props.options))}render(){return Aw.jsx("div",{ref:this.chartRef,className:"chart-holder"})}}class Dw extends kw{createChart(t,e,n){return new Tw(t,{data:e,options:n})}}!function(t){!function(){var e={}.hasOwnProperty;function n(){for(var t="",e=0;e<arguments.length;e++){var n=arguments[e];n&&(t=i(t,r(n)))}return t}function r(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var r="";for(var o in t)e.call(t,o)&&t[o]&&(r=i(r,o));return r}function i(t,e){return e?t?t+" "+e:t+e:t}t.exports?(n.default=n,t.exports=n):window.classNames=n}()}({exports:{}})}}]);
|