@nebula.js/sn-pivot-table 7.8.0 → 7.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/sn-pivot-table.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/sn-pivot-table v7.
|
|
2
|
+
* @nebula.js/sn-pivot-table v7.9.0
|
|
3
3
|
* Copyright (c) 2026 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
@@ -120,4 +120,4 @@ function Sr(e,t){let n;return n=t?hr(e).withConfig({displayName:t.label,shouldFo
|
|
|
120
120
|
/*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
|
|
121
121
|
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,c,u,d,f=e.length,h=e.search(/[0-9\-\+#]/),p=h>0?e.substring(0,h):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=f-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,f):"";if(n=(t="-"===(e=e.substring(h,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=s)&&(t=(+t).toFixed(s+1)),u=e[0].split(o),e[0]=u.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-a;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(d=t[0]).length%l,f=d.length,b=0;b<f;b++)m+=d.charAt(b),!((b-y+1)%l)&&b<f-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},dT({exports:{}});const CT=fO(),kT=fO((e=>mT((t=>{const n=e(CT);n?.applyPatches(t,!0)}),500))),ET=fO(),MT=fO(),_T=fO((e=>e(MT)?.translate??(e=>e))),RT=fO(""),IT=fO((e=>{const t=e(RT).toLowerCase().trim();return({title:e})=>e.toLowerCase().trim().includes(t)})),DT=e=>7005!==e.qError?.qErrorCode,PT=new WeakMap,AT={qInfo:{qType:"AlternativeLayout"},qHyperCubeDef:{qMode:"S",qDimensions:[],qMeasures:[],qInitialDataFetch:[{qTop:0,qLeft:0,qHeight:0,qWidth:0}],excludedNoOfLeftDims:-1,qCalcCond:{qv:"0"}}},OT=function(e,t=IO){return((e,t,n)=>{const r=_O((()=>new WeakMap),RO,t);return _O(e,r,n)})((()=>{const n=new WeakMap,r=new WeakMap,i=fO(0),o=fO([]);o.INTERNAL_onInit=e=>{e.set(o,[()=>e.set(i,(e=>e+1))])},i.debugPrivate=!0,o.debugPrivate=!0;const a=fO((s=>{let l;s(i);try{l=s(a)}catch(e){}const c=s(e);if(!(e=>"function"==typeof(null==e?void 0:e.then))(c))return{v:c};if(c!==(null==l?void 0:l.p)&&c.then((e=>{r.set(c,e);const[t]=s(o);t()}),(e=>{n.set(c,e);const[t]=s(o);t()})),n.has(c))throw n.get(c);return r.has(c)?{p:c,v:r.get(c)}:l&&"v"in l?{p:c,f:t(l.v),v:l.v}:{p:c,f:t()}}));return a.init=void 0,a.debugPrivate=!0,fO((e=>{const t=e(a);return"f"in t?t.f:t.v}),((t,n,...r)=>n(e,...r)))}),e,t)}(fO((async e=>{const t=e(CT);if(t){if(PT.has(t))return PT.get(t);try{const e=await t.app.createSessionObject(AT);return PT.set(t,e),e}catch(e){return void console.error("Error creating alternative layout model:",e)}}}))),LT=fO(null),TT=fO(),qT=LO(((e,t)=>{const n=e(CT),r=e(OT);if(!n||!r)return;const i=async()=>{const e=await n.getLayout();if(e.qSelectionInfo?.qInSelections)return;const i=await n.getEffectiveProperties();await r.applyPatches([{qOp:"replace",qPath:"/qHyperCubeDef/qDimensions",qValue:JSON.stringify(i.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions)},{qOp:"replace",qPath:"/qHyperCubeDef/qMeasures",qValue:JSON.stringify(i.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures)}]);const o=await r.getLayout();t(TT,{layout:structuredClone(e),properties:structuredClone(i),altLayout:structuredClone(o)}),t(LT,null)};return i(),n.Invalidated?.bind(i),()=>{n.Invalidated?.unbind(i)}})),NT=fO((e=>e(TT)?.layout)),jT=fO((e=>e(TT)?.altLayout)),zT=fO((e=>e(TT)?.properties)),FT=fO((e=>{const t=e(TT)?.layout;return t?.qHyperCube.qDimensionInfo.filter(DT)??[]})),WT=fO((e=>{const t=e(TT)?.layout;return t?.qHyperCube.qMeasureInfo.filter(DT)??[]})),$T=fO((e=>{const t=e(NT),n=e(FT),r=e(WT),i=e(zT),o=new Map;return t&&i?(n.forEach(((e,t)=>{o.set(e.cId,{id:e.cId,type:"dimension",def:i.qHyperCubeDef.qDimensions[t]})})),r.forEach(((e,t)=>{o.set(e.cId,{id:e.cId,type:"measure",def:i.qHyperCubeDef.qMeasures[t]})})),i.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions.forEach((e=>{o.set(e.qDef.cId,{id:e.qDef.cId,type:"dimension",def:e})})),i.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures.forEach((e=>{o.set(e.qDef.cId,{id:e.qDef.cId,type:"measure",def:e})})),o):o})),BT=fO((e=>{const t=[...e(FT),...e(WT)].map((e=>e.cId));return new Set(t)})),VT=fO(new Set),HT=fO(new Set),UT=fO((e=>{const t=e(VT),n=e(HT);return e(BT).difference(n).union(t)})),GT=LO(((e,t)=>{e(BT),t(VT,new Set),t(HT,new Set)})),YT=fO((e=>e(UT)),((e,t,n)=>{const r=e(UT).has(n),i=new Set(e(HT)),o=new Set(e(VT));r?(i.add(n),o.delete(n)):(o.add(n),i.delete(n)),t(HT,i),t(VT,o),jO({type:r?"unchecked":"checked",cId:n,handler:e(ET),debouncedApplyPatch:e(kT),fieldInfo:e($T)})})),KT=({props:e,children:t})=>(PO([[CT,e.args.model],[MT,e.args.apis],[ET,e.args.handler]]),kO(GT),kO(qT),t);function XT(e,t){const n=new Set(e),r=new Set(t);return e===t||n.size===r.size&&Array.from(n).every(r.has.bind(r))}function JT(e){return"write"in e}const QT=new WeakMap,ZT={},{read:eq,write:tq}=fO(null);function nq(e,t,n){const[r,i,o,,a]=e,s=r.get(t);if(s)return s;if(n===e){let r=i.get(t);return r||(r=[aq(e,t,n),n],i.set(t,r)),r}const l=n??ZT;let c=o.get(l);c||(c=new WeakMap,o.set(l,c));let u=c.get(t);if(!u){const[r,i]=a?nq(a,t,n):[t];u=[t.read===eq?r:aq(e,t,i),i],c.set(t,u)}return u}function rq(e){for(const t of e[5])t()}function iq(e,t,n,r,i){if(n.read===eq&&JT(n)&&JT(t)&&n.write!==tq&&e!==r){const{write:o}=n;return t.write=oq(e,n.write.bind(n),r,i),()=>{t.write=o}}}function oq(e,t,n,r=n){return function(i,o,...a){return t((function(t){const[r]=nq(e,t,n);return i(r)}),(function(t,...i){const[a]=nq(e,t,n),s=iq(e,a,t,n,r);try{return o(a,...i)}finally{null==s||s()}}),...a)}}function aq(e,t,n){const r=Object.getOwnPropertyDescriptors(t);Object.keys(r).filter((e=>["read","write","debugLabel"].includes(e))).forEach((e=>r[e].configurable=!0));const i=Object.getPrototypeOf(t),o=Object.create(i,r);return o.read!==eq&&(o.read=function(e,t,n){return function(r,i){return t((function(t){const[i]=nq(e,t,n);return r(i)}),i)}}(e,t.read.bind(t),n)),JT(o)&&JT(t)&&o.write!==tq&&(o.write=oq(e,t.write.bind(t),n)),o}function sq({atoms:e=[],atomFamilies:t=[],parentStore:n,name:r}){const i=new WeakSet(e),o=QT.get(n),a=(null==o?void 0:o[3])??n,s=[new WeakMap,new WeakMap,new WeakMap,a,o,new Set,void 0],l=s[0],c=s[5],u=function(e){const t=e[3],n=[...lO(t)],r=n[21],i=n[22],o=n[23],a=n[9],s={};n[9]=(e,t)=>a(l,t),n[21]=p(r),n[22]=f,n[23]=p(o),n[24]=([...e])=>{const t=[m(e[0],c),m(e[1],u),m(e[2]),g(e[3]),e[4],e[5],v(e[6]),p(e[7]),p(e[8]),e[9],p(e[10]),p(e[11],(e=>d(t[0],e))),e[12],e[13],p(e[14]),p(e[15]),p(e[16]),p(e[17]),p(e[18]),p(e[19]),p(e[20]),p(e[21]),p(e[22]),p(e[23]),()=>e];return t};const l=cO(...n);return l;function c(t){const n=new WeakMap;return function(r){let i=n.get(r);if(i)return i;const o=t(r);return o?(i={...o,d:m(o.d,(function(t){return n=>t(nq(e,n)[0])})),p:g(o.p),get n(){return o.n},set n(e){o.n=e},get v(){return o.v},set v(e){o.v=e},get e(){return o.e},set e(e){o.e=e}},n.set(r,i),i):void 0}}function u(e){const t=new WeakMap;return function(n){let r=t.get(n);if(r)return r;const i=e(n);return i?(r={...i,d:g(i.d),t:g(i.t),get u(){return i.u},set u(e){i.u=e}},t.set(n,r),r):void 0}}function d(e,t){return function(n,r){return e.get(r)||(e.set(r,t(n,r)),e.get(r))}}function f(t,n,...r){const[o,a]=nq(e,n),s=iq(e,o,n,a,e);try{return i(t,o,...r)}finally{null==s||s()}}function h(t,n){return function(r,...i){const[o]=nq(e,r);return(n?n(t):t)(o,...i)}}function p(t,n){return function(r,i,...o){const[a]=nq(e,i);return(n?n(t):t)(r,a,...o)}}function m(e,t){return{get:h(e.get.bind(e),t),set:h(e.set.bind(e)),has:h(e.has.bind(e)),delete:h(e.delete.bind(e))}}function g(t){return{get size(){return t.size},add:h(t.add.bind(t)),has:h(t.has.bind(t)),delete:h(t.delete.bind(t)),clear:t.clear.bind(t),forEach:e=>t.forEach(h(e)),*[Symbol.iterator](){for(const n of t)yield nq(e,n)[0]}}}function y(t){if(!t)return;const n=h(t);return n.add=function(n,r){if(void 0===n)return t.add(void 0,r);const[i]=nq(e,n);return t.add(i,r)},n}function v(e){const t={get f(){return e.f},set f(t){e.f=t}};return Object.defineProperties(t,Object.fromEntries(["r","c","m","u"].map((t=>[t,{get:()=>s[t]??(s[t]=y(e[t])),set(n){delete s[t],e[t]=n},configurable:!0,enumerable:!0}])))),Object.assign(t,e)}}(s);s[6]=u,Object.assign(u,{name:r}),QT.set(u,s);for(const t of new Set(e))l.set(t,[aq(s,t,s),s]);for(const e of new Set(t)){for(const t of e.getParams()){const n=e(t);l.has(n)||l.set(n,[aq(s,n,s),s])}const t=e.unstable_listen((({type:e,atom:t})=>{"CREATE"!==e||l.has(t)?"REMOVE"===e&&!i.has(t)&&l.delete(t):l.set(t,[aq(s,t,s),s])}));c.add(t)}return u}const lq=function(e,t){return function(n){const{atoms:r=[],atomFamilies:i=[],children:o,scope:a,name:s}=n,l=t(),c=Array.from(r,(e=>Array.isArray(e)?e[0]:e));function u(){return[a??sq({atoms:c,atomFamilies:i,parentStore:l,name:s}),function(e){return l!==e.parentStore||!XT(c,e.atoms)||!XT(i,e.atomFamilies)||a!==e.providedScope}]}const[[d,f],h]=_e.useState(u);if(f({atoms:c,atomFamilies:i,parentStore:l,providedScope:a})){const e=QT.get(d);e&&rq(e),h(u)}return PO(Array.from(r).filter(Array.isArray),{store:d}),_e.useEffect((()=>{const e=QT.get(d);return()=>{e&&rq(e)}}),[d]),_e.createElement(e,{store:d,children:o})}}(vO,yO);var cq=Object.defineProperty,uq=Object.defineProperties,dq=Object.getOwnPropertyDescriptors,fq=Object.getOwnPropertySymbols,hq=Object.prototype.hasOwnProperty,pq=Object.prototype.propertyIsEnumerable,mq=(e,t,n)=>t in e?cq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gq=(e,t)=>{for(var n in t||(t={}))hq.call(t,n)&&mq(e,n,t[n]);if(fq)for(var n of fq(t))pq.call(t,n)&&mq(e,n,t[n]);return e},yq=(e,t)=>uq(e,dq(t));function vq(e,t,n){if(t===n)return e;const r=e.slice();return r.splice(n,0,r.splice(t,1)[0]),r}function bq(e){return"initialIndex"in e&&"number"==typeof e.initialIndex&&"index"in e&&"number"==typeof e.index}function xq(e,t){return function(e,t,n){var r,i,o;const{source:a,target:s,canceled:l}=t.operation;if(!a||!s||l)return"preventDefault"in t&&t.preventDefault(),e;const c=(e,t)=>e===t||"object"==typeof e&&"id"in e&&e.id===t;if(Array.isArray(e)){const r=e.findIndex((e=>c(e,a.id))),i=e.findIndex((e=>c(e,s.id)));if(-1===r||-1===i){if(bq(a)){const r=a.initialIndex,i=a.index;return r===i||r<0||r>=e.length?("preventDefault"in t&&t.preventDefault(),e):n(e,r,i)}return e}if(!l&&"index"in a&&"number"==typeof a.index){const t=a.index;if(t!==r)return n(e,r,t)}return n(e,r,i)}const u=Object.entries(e);let d,f,h=-1,p=-1;for(const[e,t]of u)if(-1===h&&(h=t.findIndex((e=>c(e,a.id))),-1!==h&&(d=e)),-1===p&&(p=t.findIndex((e=>c(e,s.id))),-1!==p&&(f=e)),-1!==h&&-1!==p)break;if(-1===h&&bq(a)){const r=a.initialGroup,i=a.initialIndex,o=a.group,s=a.index;if(null==r||null==o||!(r in e)||!(o in e))return"preventDefault"in t&&t.preventDefault(),e;if(r===o&&i===s)return"preventDefault"in t&&t.preventDefault(),e;if(r===o)return yq(gq({},e),{[r]:n(e[r],i,s)});const l=e[r][i];return yq(gq({},e),{[r]:[...e[r].slice(0,i),...e[r].slice(i+1)],[o]:[...e[o].slice(0,s),l,...e[o].slice(s)]})}if(!a.manager)return e;const{dragOperation:m}=a.manager,g=null!=(i=null==(r=m.shape)?void 0:r.current.center)?i:m.position.current;if(null==f&&s.id in e){const t=s.shape&&g.y>s.shape.center.y?e[s.id].length:0;f=s.id,p=t}if(null==d||null==f||d===f&&h===p){if(null!=d&&d===f&&h===p&&bq(a)){const t=null!=a.group&&a.group!==d,r=a.index!==h;if(t||r){const t=null!=(o=a.group)?o:d;if(t in e){if(d===t)return yq(gq({},e),{[d]:n(e[d],h,a.index)});const r=e[d][h];return yq(gq({},e),{[d]:[...e[d].slice(0,h),...e[d].slice(h+1)],[t]:[...e[t].slice(0,a.index),r,...e[t].slice(a.index)]})}}}return"preventDefault"in t&&t.preventDefault(),e}if(d===f)return yq(gq({},e),{[d]:n(e[d],h,p)});const y=s.shape&&Math.round(g.y)>Math.round(s.shape.center.y)?1:0,v=e[d][h];return yq(gq({},e),{[d]:[...e[d].slice(0,h),...e[d].slice(h+1)],[f]:[...e[f].slice(0,p+y),v,...e[f].slice(p+y)]})}(e,t,vq)}function wq(e,t){let n=null;const r=new Map,i=new Set;function o(i){let s;if(void 0===t)s=r.get(i);else for(const[e,n]of r)if(t(e,i)){s=n;break}if(void 0!==s){if(!n?.(s[1],i))return s[0];o.remove(i)}const l=e(i);return r.set(i,[l,Date.now()]),a("CREATE",i,l),l}function a(e,t,n){for(const r of i)r({type:e,param:t,atom:n})}return o.unstable_listen=e=>(i.add(e),()=>{i.delete(e)}),o.getParams=()=>r.keys(),o.remove=e=>{if(void 0===t){if(!r.has(e))return;const[t]=r.get(e);r.delete(e),a("REMOVE",e,t)}else for(const[n,[i]]of r)if(t(n,e)){r.delete(n),a("REMOVE",n,i);break}},o.setShouldRemove=e=>{if(n=e,n)for(const[e,[t,i]]of r)n(i,e)&&(r.delete(e),a("REMOVE",e,t))},o}const Sq=({itemIndex:e,sectionIndex:t})=>void 0!==e?`${t}-${e}`:`${t}`,Cq=fO(),kq=fO((e=>e(Cq)?.numberOfSections??0)),Eq=fO((e=>e(Cq)?.numberOfItemsInSection??[])),Mq=fO((e=>e(Cq)?.keyExtractor??Sq)),_q=fO((e=>e(Cq)?.emptyTexts??(()=>({title:"No items",message:"There are no items to display."})))),Rq=fO((e=>e(Cq)?.onDragEnd)),Iq=fO((e=>e(Cq)?.onDragOver)),Dq=fO((e=>e(Cq)?.itemRenderer)),Pq=fO((e=>e(Cq)?.headerRenderer)),Aq=fO((e=>e(Cq)?.dragOverlayRenderer)),Oq=fO((e=>e(Cq)?.onClick)),Lq=fO((e=>{const t=e(kq),n=e(Eq),r=e(Mq),i={};for(let e=0;e<t;e++)i[e]=Array.from({length:n[e]},((t,n)=>r({sectionIndex:e,itemIndex:n})));return i})),Tq=fO(null),qq=fO((e=>e(Tq)),((e,t,n)=>{if(null===n)return void t(Tq,null);const r=e(Tq);t(Tq,{...r,...n})})),Nq=wq((e=>fO(null,((t,n,r)=>{let i;"over"===e?i=t(Iq):"end"===e&&(i=t(Rq),n(qq,null));const{source:o,target:a}=r.operation;if(null===a)return void n(qq,{toIndex:void 0,toSectionIndex:void 0});const s=xq(t(Lq),r)[a.data.sectionIndex].indexOf(o.id),l=-1!==s?s:a.sortable?.index??0;"start"===e?n(qq,{id:o.id,startSection:o.data.sectionKey,startIndex:o.data.itemIndex,startSectionIndex:o.data.sectionIndex}):"over"===e&&n(qq,{toIndex:l,toSectionIndex:a.data.sectionIndex}),i?.({id:o.id,toIndex:l,toSection:a.data.sectionKey,fromSection:o.data.sectionKey,startSection:t(qq)?.startSection??o.data.sectionKey,event:r})})))),jq=[Cq,kq,Eq,Mq,_q,Rq,Dq,Pq,Oq,qq],zq=[Nq],Fq=({props:e,children:t})=>{const n=EO(Cq);return _e.useLayoutEffect((()=>{n(e)}),[e,n]),t};var Wq=Symbol.for("preact-signals");function $q(){if(Gq>1)Gq--;else{for(var e,t=!1;void 0!==Uq;){var n=Uq;for(Uq=void 0,Yq++;void 0!==n;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&Zq(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=r}}if(Yq=0,Gq--,t)throw e}}function Bq(e){if(Gq>0)return e();Gq++;try{return e()}finally{$q()}}var Vq=void 0;function Hq(e){var t=Vq;Vq=void 0;try{return e()}finally{Vq=t}}var Uq=void 0,Gq=0,Yq=0,Kq=0;function Xq(e){if(void 0!==Vq){var t=e.n;if(void 0===t||t.t!==Vq)return t={i:0,S:e,p:Vq.s,n:void 0,t:Vq,e:void 0,x:void 0,r:t},void 0!==Vq.s&&(Vq.s.n=t),Vq.s=t,e.n=t,32&Vq.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=Vq.s,t.n=void 0,Vq.s.n=t,Vq.s=t),t}}function Jq(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function Qq(e,t){return new Jq(e,t)}function Zq(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function eN(e){for(var t=e.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function tN(e){for(var t=e.s,n=void 0;void 0!==t;){var r=t.p;-1===t.i?(t.S.U(t),void 0!==r&&(r.n=t.n),void 0!==t.n&&(t.n.p=r)):n=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=r}e.s=n}function nN(e,t){Jq.call(this,void 0),this.x=e,this.s=void 0,this.g=Kq-1,this.f=4,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function rN(e,t){return new nN(e,t)}function iN(e){var t=e.u;if(e.u=void 0,"function"==typeof t){Gq++;var n=Vq;Vq=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,oN(e),t}finally{Vq=n,$q()}}}function oN(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,iN(e)}function aN(e){if(Vq!==this)throw new Error("Out-of-order effect");tN(this),Vq=e,this.f&=-2,8&this.f&&oN(this),$q()}function sN(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=null==t?void 0:t.name}function lN(e,t){var n=new sN(e,t);try{n.c()}catch(e){throw n.d(),e}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}Jq.prototype.brand=Wq,Jq.prototype.h=function(){return!0},Jq.prototype.S=function(e){var t=this,n=this.t;n!==e&&void 0===e.e&&(e.x=n,this.t=e,void 0!==n?n.e=e:Hq((function(){var e;null==(e=t.W)||e.call(t)})))},Jq.prototype.U=function(e){var t=this;if(void 0!==this.t){var n=e.e,r=e.x;void 0!==n&&(n.x=r,e.e=void 0),void 0!==r&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,void 0===r&&Hq((function(){var e;null==(e=t.Z)||e.call(t)})))}},Jq.prototype.subscribe=function(e){var t=this;return lN((function(){var n=t.value,r=Vq;Vq=void 0;try{e(n)}finally{Vq=r}}),{name:"sub"})},Jq.prototype.valueOf=function(){return this.value},Jq.prototype.toString=function(){return this.value+""},Jq.prototype.toJSON=function(){return this.value},Jq.prototype.peek=function(){var e=Vq;Vq=void 0;try{return this.value}finally{Vq=e}},Object.defineProperty(Jq.prototype,"value",{get:function(){var e=Xq(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Yq>100)throw new Error("Cycle detected");this.v=e,this.i++,Kq++,Gq++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{$q()}}}}),nN.prototype=new Jq,nN.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===Kq)return!0;if(this.g=Kq,this.f|=1,this.i>0&&!Zq(this))return this.f&=-2,!0;var e=Vq;try{eN(this),Vq=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return Vq=e,tN(this),this.f&=-2,!0},nN.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}Jq.prototype.S.call(this,e)},nN.prototype.U=function(e){if(void 0!==this.t&&(Jq.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},nN.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(nN.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Xq(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),sN.prototype.c=function(){var e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();"function"==typeof t&&(this.u=t)}finally{e()}},sN.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,iN(this),eN(this),Gq++;var e=Vq;return Vq=this,aN.bind(this,e)},sN.prototype.N=function(){2&this.f||(this.f|=2,this.o=Uq,Uq=this)},sN.prototype.d=function(){this.f|=8,1&this.f||oN(this)},sN.prototype.dispose=function(){this.d()};var cN,uN,dN,fN,hN,pN,mN,gN,yN,vN,bN,xN,wN,SN,CN,kN,EN,MN,_N,RN,IN=Object.create,DN=Object.defineProperty,PN=Object.defineProperties,AN=Object.getOwnPropertyDescriptor,ON=Object.getOwnPropertyDescriptors,LN=Object.getOwnPropertySymbols,TN=Object.prototype.hasOwnProperty,qN=Object.prototype.propertyIsEnumerable,NN=e=>{throw TypeError(e)},jN=(e,t,n)=>t in e?DN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zN=(e,t)=>DN(e,"name",{value:t,configurable:!0}),FN=["class","method","getter","setter","accessor","field","value","get","set"],WN=e=>void 0!==e&&"function"!=typeof e?NN("Function expected"):e,$N=(e,t,n,r,i)=>({kind:FN[e],name:t,metadata:r,addInitializer:e=>n._?NN("Already initialized"):i.push(WN(e||null))}),BN=(e,t)=>{return jN(t,(n="metadata",(r=Symbol[n])?r:Symbol.for("Symbol."+n)),e[3]);var n,r},VN=(e,t,n,r)=>{for(var i=0,o=e[t>>1],a=o&&o.length;i<a;i++)1&t?o[i].call(n):r=o[i].call(n,r);return r},HN=(e,t,n,r,i,o)=>{var a,s,l,c,u,d=7&t,f=!!(8&t),h=!!(16&t),p=d>3?e.length+1:d?f?1:2:0,m=FN[d+5],g=d>3&&(e[p-1]=[]),y=e[p]||(e[p]=[]),v=d&&(!h&&!f&&(i=i.prototype),d<5&&(d>3||!h)&&AN(d<4?i:{get[n](){return YN(this,o)},set[n](e){return XN(this,o,e)}},n));d?h&&d<4&&zN(o,(d>2?"set ":d>1?"get ":"")+n):zN(i,n);for(var b=r.length-1;b>=0;b--)c=$N(d,n,l={},e[3],y),d&&(c.static=f,c.private=h,u=c.access={has:h?e=>GN(i,e):e=>n in e},3^d&&(u.get=h?e=>(1^d?YN:JN)(e,i,4^d?o:v.get):e=>e[n]),d>2&&(u.set=h?(e,t)=>XN(e,i,t,4^d?o:v.set):(e,t)=>e[n]=t)),s=(0,r[b])(d?d<4?h?o:v[m]:d>4?void 0:{get:v.get,set:v.set}:i,c),l._=1,4^d||void 0===s?WN(s)&&(d>4?g.unshift(s):d?h?o=s:v[m]=s:i=s):"object"!=typeof s||null===s?NN("Object expected"):(WN(a=s.get)&&(v.get=a),WN(a=s.set)&&(v.set=a),WN(a=s.init)&&g.unshift(a));return d||BN(e,i),v&&DN(i,n,v),h?4^d?o:v:i},UN=(e,t,n)=>t.has(e)||NN("Cannot "+n),GN=(e,t)=>Object(t)!==t?NN('Cannot use the "in" operator on this value'):e.has(t),YN=(e,t,n)=>(UN(e,t,"read from private field"),n?n.call(e):t.get(e)),KN=(e,t,n)=>t.has(e)?NN("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),XN=(e,t,n,r)=>(UN(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),JN=(e,t,n)=>(UN(e,t,"access private method"),n);function QN(e,t){if(t){let n;return rN((()=>{const r=e();return r&&n&&t(n,r)?n:(n=r,r)}))}return rN(e)}function ZN(e,t){if(Object.is(e,t))return!0;if(null===e||null===t)return!1;if("function"==typeof e&&"function"==typeof t)return e===t;if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;const n=e.some(((e,n)=>!ZN(e,t[n])));return!n}if("object"==typeof e&&"object"==typeof t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const i=n.some((n=>!ZN(e[n],t[n])));return!i}return!1}function ej({get:e},t){return{init:e=>Qq(e),get(){return e.call(this).value},set(t){const n=e.call(this);n.peek()!==t&&(n.value=t)}}}function tj(e,t){const n=new WeakMap;return function(){let t=n.get(this);return t||(t=QN(e.bind(this)),n.set(this,t)),t.value}}function nj(e=!0){return function(t,n){n.addInitializer((function(){const t="field"===n.kind||n.static?this:Object.getPrototypeOf(this),r=Object.getOwnPropertyDescriptor(t,n.name);r&&Object.defineProperty(t,n.name,((e,t)=>PN(e,ON(t)))(((e,t)=>{for(var n in t||(t={}))TN.call(t,n)&&jN(e,n,t[n]);if(LN)for(var n of LN(t))qN.call(t,n)&&jN(e,n,t[n]);return e})({},r),{enumerable:e}))}))}}function rj(...e){const t=e.map((e=>lN(e)));return()=>t.forEach((e=>e()))}pN=[ej],hN=[ej],fN=[ej],dN=[nj()],uN=[nj()],cN=[nj()];var ij,oj=class{constructor(e,t=Object.is){this.defaultValue=e,this.equals=t,VN(mN,5,this),KN(this,xN),KN(this,gN,VN(mN,8,this)),VN(mN,11,this),KN(this,wN,VN(mN,12,this)),VN(mN,15,this),KN(this,EN,VN(mN,16,this)),VN(mN,19,this),this.reset=this.reset.bind(this),this.reset()}get current(){return YN(this,xN,_N)}get initial(){return YN(this,xN,vN)}get previous(){return YN(this,xN,CN)}set current(e){const t=Hq((()=>YN(this,xN,_N)));e&&t&&this.equals(t,e)||Bq((()=>{YN(this,xN,vN)||XN(this,xN,e,bN),XN(this,xN,t,kN),XN(this,xN,e,RN)}))}reset(e=this.defaultValue){Bq((()=>{XN(this,xN,void 0,kN),XN(this,xN,e,bN),XN(this,xN,e,RN)}))}};function aj(e){return Hq((()=>{const t={};for(const n in e)t[n]=e[n];return t}))}mN=[,,,IN(null)],gN=new WeakMap,xN=new WeakSet,wN=new WeakMap,EN=new WeakMap,yN=HN(mN,20,"#initial",pN,xN,gN),vN=yN.get,bN=yN.set,SN=HN(mN,20,"#previous",hN,xN,wN),CN=SN.get,kN=SN.set,MN=HN(mN,20,"#current",fN,xN,EN),_N=MN.get,RN=MN.set,HN(mN,2,"current",dN,oj),HN(mN,2,"initial",uN,oj),HN(mN,2,"previous",cN,oj),BN(mN,oj);ij=new WeakMap;var sj,lj,cj,uj,dj,fj=Object.create,hj=Object.defineProperty,pj=Object.getOwnPropertyDescriptor,mj=Object.getOwnPropertySymbols,gj=Object.prototype.hasOwnProperty,yj=Object.prototype.propertyIsEnumerable,vj=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),bj=e=>{throw TypeError(e)},xj=Math.pow,wj=(e,t,n)=>t in e?hj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Sj=["class","method","getter","setter","accessor","field","value","get","set"],Cj=e=>void 0!==e&&"function"!=typeof e?bj("Function expected"):e,kj=(e,t,n,r,i)=>({kind:Sj[e],name:t,metadata:r,addInitializer:e=>n._?bj("Already initialized"):i.push(Cj(e||null))}),Ej=(e,t,n,r,i,o)=>{for(var a,s,l,c,u=7&t,d=Sj[u+5],f=e[2]||(e[2]=[]),h=(i=i.prototype,pj(i,n)),p=r.length-1;p>=0;p--)(l=kj(u,n,s={},e[3],f)).static=false,l.private=false,c=l.access={has:e=>n in e},c.get=e=>e[n],a=(0,r[p])(h[d],l),s._=1,Cj(a)&&(h[d]=a);return h&&hj(i,n,h),i},Mj=(e,t,n)=>t.has(e)||bj("Cannot "+n),_j=class e{constructor(e,t){this.x=e,this.y=t}static delta(t,n){return new e(t.x-n.x,t.y-n.y)}static distance(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}static equals(e,t){return e.x===t.x&&e.y===t.y}static from({x:t,y:n}){return new e(t,n)}},Rj=class e{constructor(e,t,n,r){this.left=e,this.top=t,this.width=n,this.height=r,this.scale={x:1,y:1}}get inverseScale(){return{x:1/this.scale.x,y:1/this.scale.y}}translate(t,n){const{top:r,left:i,width:o,height:a,scale:s}=this,l=new e(i+t,r+n,o,a);return l.scale=((e,t)=>{for(var n in t||(t={}))gj.call(t,n)&&wj(e,n,t[n]);if(mj)for(var n of mj(t))yj.call(t,n)&&wj(e,n,t[n]);return e})({},s),l}get boundingRectangle(){const{width:e,height:t,left:n,top:r,right:i,bottom:o}=this;return{width:e,height:t,left:n,top:r,right:i,bottom:o}}get center(){const{left:e,top:t,right:n,bottom:r}=this;return new _j((e+n)/2,(t+r)/2)}get area(){const{width:e,height:t}=this;return e*t}equals(t){if(!(t instanceof e))return!1;const{left:n,top:r,width:i,height:o}=this;return n===t.left&&r===t.top&&i===t.width&&o===t.height}containsPoint(e){const{top:t,left:n,bottom:r,right:i}=this;return t<=e.y&&e.y<=r&&n<=e.x&&e.x<=i}intersectionArea(t){return t instanceof e?function(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),a=i-r,s=o-n;if(r<i&&n<o){return a*s}return 0}(this,t):0}intersectionRatio(e){const{area:t}=this,n=this.intersectionArea(e);return n/(e.area+t-n)}get bottom(){const{top:e,height:t}=this;return e+t}get right(){const{left:e,width:t}=this;return e+t}get aspectRatio(){const{width:e,height:t}=this;return e/t}get corners(){return[{x:this.left,y:this.top},{x:this.right,y:this.top},{x:this.left,y:this.bottom},{x:this.right,y:this.bottom}]}static from({top:t,left:n,width:r,height:i}){return new e(n,t,r,i)}static delta(e,t,n={x:"center",y:"center"}){const r=(e,t)=>{const r=n[t],i="x"===t?e.left:e.top,o="x"===t?e.width:e.height;return"start"==r?i:"end"==r?i+o:i+o/2};return _j.delta({x:r(e,"x"),y:r(e,"y")},{x:r(t,"x"),y:r(t,"y")})}static intersectionRatio(t,n){return e.from(t).intersectionRatio(e.from(n))}};var Ij,Dj=class extends(cj=oj,lj=[tj],sj=[tj],cj){constructor(e){super(_j.from(e),((e,t)=>_j.equals(e,t))),((e,t,n)=>{for(var r=0,i=e[t>>1],o=i&&i.length;r<o;r++)i[r].call(n)})(dj,5,this),((e,t,n)=>{t.has(e)?bj("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n)})(this,uj,0),this.velocity={x:0,y:0}}get delta(){return _j.delta(this.current,this.initial)}get direction(){const{current:e,previous:t}=this;if(!t)return null;const n={x:e.x-t.x,y:e.y-t.y};return n.x||n.y?Math.abs(n.x)>Math.abs(n.y)?n.x>0?"right":"left":n.y>0?"down":"up":null}get current(){return super.current}set current(e){const{current:t}=this,n=_j.from(e),r={x:n.x-t.x,y:n.y-t.y},i=Date.now(),o=i-(Mj(a=this,s=uj,"read from private field"),s.get(a));var a,s;const l=e=>Math.round(e/o*100);Bq((()=>{((e,t,n)=>{Mj(e,t,"write to private field"),t.set(e,n)})(this,uj,i),this.velocity={x:l(r.x),y:l(r.y)},super.current=n}))}reset(e=this.defaultValue){super.reset(_j.from(e)),this.velocity={x:0,y:0}}};function Pj({x:e,y:t},n){const r=Math.abs(e),i=Math.abs(t);return"number"==typeof n?Math.sqrt(xj(r,2)+xj(i,2))>n:"x"in n&&"y"in n?r>n.x&&i>n.y:"x"in n?r>n.x:"y"in n&&i>n.y}dj=(e=>{var t;return[,,,fj(null!=(t=null==e?void 0:e[vj("metadata")])?t:null)]})(cj),uj=new WeakMap,Ej(dj,2,"delta",lj,Dj),Ej(dj,2,"direction",sj,Dj),Ij=dj,wj(Dj,vj("metadata"),Ij[3]);var Aj,Oj,Lj,Tj,qj=(e=>(e.Horizontal="x",e.Vertical="y",e))(qj||{}),Nj=Object.values(qj),jj=Object.create,zj=Object.defineProperty,Fj=Object.defineProperties,Wj=Object.getOwnPropertyDescriptor,$j=Object.getOwnPropertyDescriptors,Bj=Object.getOwnPropertySymbols,Vj=Object.prototype.hasOwnProperty,Hj=Object.prototype.propertyIsEnumerable,Uj=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Gj=e=>{throw TypeError(e)},Yj=(e,t,n)=>t in e?zj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kj=(e,t)=>{for(var n in t||(t={}))Vj.call(t,n)&&Yj(e,n,t[n]);if(Bj)for(var n of Bj(t))Hj.call(t,n)&&Yj(e,n,t[n]);return e},Xj=(e,t)=>Fj(e,$j(t)),Jj=(e,t)=>zj(e,"name",{value:t,configurable:!0}),Qj=(e,t)=>{var n={};for(var r in e)Vj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Bj)for(var r of Bj(e))t.indexOf(r)<0&&Hj.call(e,r)&&(n[r]=e[r]);return n},Zj=e=>{var t;return[,,,jj(null!=(t=null==e?void 0:e[Uj("metadata")])?t:null)]},ez=["class","method","getter","setter","accessor","field","value","get","set"],tz=e=>void 0!==e&&"function"!=typeof e?Gj("Function expected"):e,nz=(e,t,n,r,i)=>({kind:ez[e],name:t,metadata:r,addInitializer:e=>n._?Gj("Already initialized"):i.push(tz(e||null))}),rz=(e,t)=>Yj(t,Uj("metadata"),e[3]),iz=(e,t,n,r)=>{for(var i=0,o=e[t>>1],a=o&&o.length;i<a;i++)1&t?o[i].call(n):r=o[i].call(n,r);return r},oz=(e,t,n,r,i,o)=>{var a,s,l,c,u,d=7&t,f=!!(8&t),h=!!(16&t),p=d>3?e.length+1:d?f?1:2:0,m=ez[d+5],g=d>3&&(e[p-1]=[]),y=e[p]||(e[p]=[]),v=d&&(!h&&!f&&(i=i.prototype),d<5&&(d>3||!h)&&Wj(d<4?i:{get[n](){return lz(this,o)},set[n](e){return uz(this,o,e)}},n));d?h&&d<4&&Jj(o,(d>2?"set ":d>1?"get ":"")+n):Jj(i,n);for(var b=r.length-1;b>=0;b--)c=nz(d,n,l={},e[3],y),d&&(c.static=f,c.private=h,u=c.access={has:h?e=>sz(i,e):e=>n in e},3^d&&(u.get=h?e=>(1^d?lz:dz)(e,i,4^d?o:v.get):e=>e[n]),d>2&&(u.set=h?(e,t)=>uz(e,i,t,4^d?o:v.set):(e,t)=>e[n]=t)),s=(0,r[b])(d?d<4?h?o:v[m]:d>4?void 0:{get:v.get,set:v.set}:i,c),l._=1,4^d||void 0===s?tz(s)&&(d>4?g.unshift(s):d?h?o=s:v[m]=s:i=s):"object"!=typeof s||null===s?Gj("Object expected"):(tz(a=s.get)&&(v.get=a),tz(a=s.set)&&(v.set=a),tz(a=s.init)&&g.unshift(a));return d||rz(e,i),v&&zj(i,n,v),h?4^d?o:v:i},az=(e,t,n)=>t.has(e)||Gj("Cannot "+n),sz=(e,t)=>Object(t)!==t?Gj('Cannot use the "in" operator on this value'):e.has(t),lz=(e,t,n)=>(az(e,t,"read from private field"),n?n.call(e):t.get(e)),cz=(e,t,n)=>t.has(e)?Gj("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),uz=(e,t,n,r)=>(az(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),dz=(e,t,n)=>(az(e,t,"access private method"),n);function fz(e,t){return{plugin:e,options:t}}function hz(e){return t=>fz(e,t)}function pz(e){return"function"==typeof e?{plugin:e,options:void 0}:e}Aj=[ej];var mz=class{constructor(e,t){this.manager=e,this.options=t,cz(this,Lj,iz(Oj,8,this,!1)),iz(Oj,11,this),cz(this,Tj,new Set)}enable(){this.disabled=!1}disable(){this.disabled=!0}isDisabled(){return Hq((()=>this.disabled))}configure(e){this.options=e}registerEffect(e){const t=lN(e.bind(this));return lz(this,Tj).add(t),t}destroy(){lz(this,Tj).forEach((e=>e()))}static configure(e){return fz(this,e)}};Oj=Zj(null),Lj=new WeakMap,Tj=new WeakMap,oz(Oj,4,"disabled",Aj,mz,Lj),rz(Oj,mz);var gz,yz=class extends mz{},vz=class{constructor(e){this.manager=e,this.instances=new Map,cz(this,gz,[])}get values(){return Array.from(this.instances.values())}set values(e){const t=e.map(pz).reduceRight(((e,t)=>e.some((({plugin:e})=>e===t.plugin))?e:[t,...e]),[]),n=t.map((({plugin:e})=>e));for(const e of lz(this,gz))if(!n.includes(e)){if(e.prototype instanceof yz)continue;this.unregister(e)}for(const{plugin:e,options:n}of t)this.register(e,n);uz(this,gz,n)}get(e){return this.instances.get(e)}register(e,t){const n=this.instances.get(e);if(n)return n.options!==t&&(n.options=t),n;const r=new e(this.manager,t);return this.instances.set(e,r),r}unregister(e){const t=this.instances.get(e);t&&(t.destroy(),this.instances.delete(e))}destroy(){for(const e of this.instances.values())e.destroy();this.instances.clear()}};function bz(e,t){return e.priority===t.priority?e.type===t.type?t.value-e.value:t.type-e.type:t.priority-e.priority}gz=new WeakMap;var xz,wz,Sz=[],Cz=class extends mz{constructor(e){super(e),cz(this,xz),cz(this,wz),this.computeCollisions=this.computeCollisions.bind(this),uz(this,wz,Qq(Sz)),this.destroy=rj((()=>{const e=this.computeCollisions(),t=Hq((()=>this.manager.dragOperation.position.current));if(e!==Sz){const e=lz(this,xz);if(uz(this,xz,t),e&&t.x==e.x&&t.y==e.y)return}else uz(this,xz,void 0);lz(this,wz).value=e}),(()=>{const{dragOperation:e}=this.manager;e.status.initialized&&this.forceUpdate()}))}forceUpdate(e=!0){Hq((()=>{e?lz(this,wz).value=this.computeCollisions():uz(this,xz,void 0)}))}computeCollisions(e,t){const{registry:n,dragOperation:r}=this.manager,{source:i,shape:o,status:a}=r;if(!a.initialized||!o)return Sz;const s=[],l=[];for(const o of null!=e?e:n.droppables){if(o.disabled)continue;if(i&&!o.accepts(i))continue;const e=null!=t?t:o.collisionDetector;if(!e)continue;l.push(o),o.shape;const n=Hq((()=>e({droppable:o,dragOperation:r})));n&&(null!=o.collisionPriority&&(n.priority=o.collisionPriority),s.push(n))}return 0===l.length?Sz:(s.sort(bz),s)}get collisions(){return lz(this,wz).value}};xz=new WeakMap,wz=new WeakMap;var kz=class{constructor(){this.registry=new Map}addEventListener(e,t){const{registry:n}=this,r=new Set(n.get(e));return r.add(t),n.set(e,r),()=>this.removeEventListener(e,t)}removeEventListener(e,t){const{registry:n}=this,r=new Set(n.get(e));r.delete(t),n.set(e,r)}dispatch(e,...t){const{registry:n}=this,r=n.get(e);if(r)for(const e of r)e(...t)}},Ez=class extends kz{constructor(e){super(),this.manager=e}dispatch(e,t){const n=[t,this.manager];super.dispatch(e,...n)}};function Mz(e,t=!0){let n=!1;return Xj(Kj({},e),{cancelable:t,get defaultPrevented(){return n},preventDefault(){t&&(n=!0)}})}var _z,Rz,Iz,Dz,Pz,Az,Oz,Lz,Tz,qz=class extends yz{constructor(e){super(e);let t=[];this.destroy=rj((()=>{const{dragOperation:n,collisionObserver:r}=e;n.status.initializing&&(t=[],r.enable())}),(()=>{const{collisionObserver:n,monitor:r}=e,{collisions:i}=n;if(n.isDisabled())return;const o=Mz({collisions:i});if(r.dispatch("collision",o),o.defaultPrevented)return;if(((e,t)=>e.map((({id:e})=>e)).join("")===t.map((({id:e})=>e)).join(""))(i,t))return;t=i;const[a]=i;Hq((()=>{var t;(null==a?void 0:a.id)!==(null==(t=e.dragOperation.target)?void 0:t.id)&&(n.disable(),e.actions.setDropTarget(null==a?void 0:a.id).then((()=>{n.enable()})))}))}))}},Nz=(e=>(e[e.Lowest=0]="Lowest",e[e.Low=1]="Low",e[e.Normal=2]="Normal",e[e.High=3]="High",e[e.Highest=4]="Highest",e))(Nz||{}),jz=(e=>(e[e.Collision=0]="Collision",e[e.ShapeIntersection=1]="ShapeIntersection",e[e.PointerIntersection=2]="PointerIntersection",e))(jz||{});Oz=[ej],Az=[tj],Pz=[tj],Dz=[tj],Iz=[tj],Rz=[tj],_z=[tj];var zz=class{constructor(){iz(Lz,5,this),cz(this,Tz,iz(Lz,8,this,"idle")),iz(Lz,11,this)}get current(){return this.value}get idle(){return"idle"===this.value}get initializing(){return"initializing"===this.value}get initialized(){const{value:e}=this;return"idle"!==e&&"initialization-pending"!==e}get dragging(){return"dragging"===this.value}get dropped(){return"dropped"===this.value}set(e){this.value=e}};Lz=Zj(null),Tz=new WeakMap,oz(Lz,4,"value",Oz,zz,Tz),oz(Lz,2,"current",Az,zz),oz(Lz,2,"idle",Pz,zz),oz(Lz,2,"initializing",Dz,zz),oz(Lz,2,"initialized",Iz,zz),oz(Lz,2,"dragging",Rz,zz),oz(Lz,2,"dropped",_z,zz),rz(Lz,zz);var Fz,Wz,$z,Bz,Vz,Hz,Uz,Gz,Yz,Kz=class{constructor(e){this.manager=e}setDragSource(e){const{dragOperation:t}=this.manager;t.sourceIdentifier="string"==typeof e||"number"==typeof e?e:e.id}setDropTarget(e){return Hq((()=>{const{dragOperation:t}=this.manager,n=null!=e?e:null;if(t.targetIdentifier===n)return Promise.resolve(!1);t.targetIdentifier=n;const r=Mz({operation:t.snapshot()});return t.status.dragging&&this.manager.monitor.dispatch("dragover",r),this.manager.renderer.rendering.then((()=>r.defaultPrevented))}))}start(e){return Hq((()=>{const{dragOperation:t}=this.manager;null!=e.source&&this.setDragSource(e.source);if(!t.source)throw new Error("Cannot start a drag operation without a drag source");if(!t.status.idle)throw new Error("Cannot start a drag operation while another is active");const n=new AbortController,{event:r,coordinates:i}=e;Bq((()=>{t.status.set("initialization-pending"),t.shape=null,t.canceled=!1,t.activatorEvent=null!=r?r:null,t.position.reset(i)}));const o=Mz({operation:t.snapshot()});return this.manager.monitor.dispatch("beforedragstart",o),o.defaultPrevented?(t.reset(),n.abort(),n):(t.status.set("initializing"),t.controller=n,this.manager.renderer.rendering.then((()=>{if(n.signal.aborted)return;const{status:e}=t;"initializing"===e.current&&(t.status.set("dragging"),this.manager.monitor.dispatch("dragstart",{nativeEvent:r,operation:t.snapshot(),cancelable:!1}))})),n)}))}move(e){return Hq((()=>{var t,n;const{dragOperation:r}=this.manager,{status:i,controller:o}=r;if(!i.dragging||!o||o.signal.aborted)return;const a=Mz({nativeEvent:e.event,operation:r.snapshot(),by:e.by,to:e.to},null==(t=e.cancelable)||t);(null==(n=e.propagate)||n)&&this.manager.monitor.dispatch("dragmove",a),queueMicrotask((()=>{var t,n,i,o,s;if(a.defaultPrevented)return;const l=null!=(s=e.to)?s:{x:r.position.current.x+(null!=(n=null==(t=e.by)?void 0:t.x)?n:0),y:r.position.current.y+(null!=(o=null==(i=e.by)?void 0:i.y)?o:0)};r.position.current=l}))}))}stop(e={}){return Hq((()=>{var t,n;const{dragOperation:r}=this.manager,{controller:i}=r;if(!i||i.signal.aborted)return;let o;i.abort();const a=()=>{this.manager.renderer.rendering.then((()=>{r.status.set("dropped");const e=Hq((()=>{var e;return"dropping"===(null==(e=r.source)?void 0:e.status)})),t=()=>{r.controller===i&&(r.controller=void 0),r.reset()};if(e){const{source:e}=r,n=lN((()=>{"idle"===(null==e?void 0:e.status)&&(n(),t())}))}else this.manager.renderer.rendering.then(t)}))};r.canceled=null!=(t=e.canceled)&&t,this.manager.monitor.dispatch("dragend",{nativeEvent:e.event,operation:r.snapshot(),canceled:null!=(n=e.canceled)&&n,suspend:()=>{const e={resume:()=>{},abort:()=>{}};return o=new Promise(((t,n)=>{e.resume=t,e.abort=n})),e}}),o?o.then(a).catch((()=>r.reset())):a()}))}};Bz=[ej],$z=[ej],Wz=[ej],Fz=[ej];var Xz=class{constructor(e,t){cz(this,Hz,iz(Vz,8,this)),iz(Vz,11,this),cz(this,Uz,iz(Vz,12,this)),iz(Vz,15,this),cz(this,Gz,iz(Vz,16,this)),iz(Vz,19,this),cz(this,Yz,iz(Vz,20,this)),iz(Vz,23,this);const{effects:n,id:r,data:i={},disabled:o=!1,register:a=!0}=e;let s=r;this.manager=t,this.id=r,this.data=i,this.disabled=o,this.effects=()=>{var e;return[()=>{const{id:e,manager:t}=this;if(e!==s)return null==t||t.registry.register(this),()=>null==t?void 0:t.registry.unregister(this)},...null!=(e=null==n?void 0:n())?e:[]]},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this),this.destroy=this.destroy.bind(this),t&&a&&queueMicrotask(this.register)}register(){var e;return null==(e=this.manager)?void 0:e.registry.register(this)}unregister(){var e;null==(e=this.manager)||e.registry.unregister(this)}destroy(){var e;null==(e=this.manager)||e.registry.unregister(this)}};Vz=Zj(null),Hz=new WeakMap,Uz=new WeakMap,Gz=new WeakMap,Yz=new WeakMap,oz(Vz,4,"manager",Bz,Xz,Hz),oz(Vz,4,"id",$z,Xz,Uz),oz(Vz,4,"data",Wz,Xz,Gz),oz(Vz,4,"disabled",Fz,Xz,Yz),rz(Vz,Xz);var Jz,Qz,Zz,eF,tF,nF,rF,iF,oF,aF,sF,lF,cF,uF,dF,fF,hF,pF,mF,gF,yF,vF,bF,xF,wF=class{constructor(){this.map=Qq(new Map),this.cleanupFunctions=new WeakMap,this.register=(e,t)=>{const n=this.map.peek(),r=n.get(e),i=()=>this.unregister(e,t);if(r===t)return i;if(r){const e=this.cleanupFunctions.get(r);null==e||e(),this.cleanupFunctions.delete(r)}const o=new Map(n);o.set(e,t),this.map.value=o;const a=rj(...t.effects());return this.cleanupFunctions.set(t,a),i},this.unregister=(e,t)=>{const n=this.map.peek();if(n.get(e)!==t)return;const r=this.cleanupFunctions.get(t);null==r||r(),this.cleanupFunctions.delete(t);const i=new Map(n);i.delete(e),this.map.value=i}}[Symbol.iterator](){return this.map.peek().values()}get value(){return this.map.value.values()}has(e){return this.map.value.has(e)}get(e){return this.map.value.get(e)}destroy(){for(const e of this){const t=this.cleanupFunctions.get(e);null==t||t(),e.destroy()}this.map.value=new Map}},SF=class extends(rF=Xz,nF=[ej],tF=[ej],eF=[ej],Zz=[tj],Qz=[tj],Jz=[tj],rF){constructor(e,t){var n=e,{modifiers:r,type:i,sensors:o}=n,a=Qj(n,["modifiers","type","sensors"]);super(a,t),iz(iF,5,this),cz(this,oF,iz(iF,8,this)),iz(iF,11,this),cz(this,aF,iz(iF,12,this)),iz(iF,15,this),cz(this,sF,iz(iF,16,this,this.isDragSource?"dragging":"idle")),iz(iF,19,this),this.type=i,this.sensors=o,this.modifiers=r,this.alignment=a.alignment}get isDropping(){return"dropping"===this.status&&this.isDragSource}get isDragging(){return"dragging"===this.status&&this.isDragSource}get isDragSource(){var e,t;return(null==(t=null==(e=this.manager)?void 0:e.dragOperation.source)?void 0:t.id)===this.id}};iF=Zj(rF),oF=new WeakMap,aF=new WeakMap,sF=new WeakMap,oz(iF,4,"type",nF,SF,oF),oz(iF,4,"modifiers",tF,SF,aF),oz(iF,4,"status",eF,SF,sF),oz(iF,2,"isDropping",Zz,SF),oz(iF,2,"isDragging",Qz,SF),oz(iF,2,"isDragSource",Jz,SF),rz(iF,SF);var CF=class extends(pF=Xz,hF=[ej],fF=[ej],dF=[ej],uF=[ej],cF=[ej],lF=[tj],pF){constructor(e,t){var n=e,{accept:r,collisionDetector:i,collisionPriority:o,type:a}=n;super(Qj(n,["accept","collisionDetector","collisionPriority","type"]),t),iz(mF,5,this),cz(this,gF,iz(mF,8,this)),iz(mF,11,this),cz(this,yF,iz(mF,12,this)),iz(mF,15,this),cz(this,vF,iz(mF,16,this)),iz(mF,19,this),cz(this,bF,iz(mF,20,this)),iz(mF,23,this),cz(this,xF,iz(mF,24,this)),iz(mF,27,this),this.accept=r,this.collisionDetector=i,this.collisionPriority=o,this.type=a}accepts(e){const{accept:t}=this;return!t||("function"==typeof t?t(e):!!e.type&&(Array.isArray(t)?t.includes(e.type):e.type===t))}get isDropTarget(){var e,t;return(null==(t=null==(e=this.manager)?void 0:e.dragOperation.target)?void 0:t.id)===this.id}};mF=Zj(pF),gF=new WeakMap,yF=new WeakMap,vF=new WeakMap,bF=new WeakMap,xF=new WeakMap,oz(mF,4,"accept",hF,CF,gF),oz(mF,4,"type",fF,CF,yF),oz(mF,4,"collisionDetector",dF,CF,vF),oz(mF,4,"collisionPriority",uF,CF,bF),oz(mF,4,"shape",cF,CF,xF),oz(mF,2,"isDropTarget",lF,CF),rz(mF,CF);var kF,EF=class extends mz{constructor(e,t){super(e,t),this.manager=e,this.options=t}},MF=class extends AbortController{constructor(e,t){super(),this.constraints=e,this.onActivate=t,this.activated=!1;for(const t of null!=e?e:[])t.controller=this}onEvent(e){var t;if(!this.activated)if(null==(t=this.constraints)?void 0:t.length)for(const t of this.constraints)t.onEvent(e);else this.activate(e)}activate(e){this.activated||(this.activated=!0,this.onActivate(e))}abort(e){this.activated=!1,super.abort(e)}},_F=class{constructor(e){this.options=e,cz(this,kF)}set controller(e){uz(this,kF,e),e.signal.addEventListener("abort",(()=>this.abort()))}activate(e){var t;null==(t=lz(this,kF))||t.activate(e)}};kF=new WeakMap;var RF,IF,DF,PF,AF,OF,LF,TF,qF,NF,jF,zF,FF,WF,$F,BF,VF,HF,UF,GF=class extends mz{constructor(e,t){super(e,t),this.manager=e,this.options=t}apply(e){return e.transform}},YF=class{constructor(e){this.draggables=new wF,this.droppables=new wF,this.plugins=new vz(e),this.sensors=new vz(e),this.modifiers=new vz(e)}register(e,t){if(e instanceof SF)return this.draggables.register(e.id,e);if(e instanceof CF)return this.droppables.register(e.id,e);if(e.prototype instanceof GF)return this.modifiers.register(e,t);if(e.prototype instanceof EF)return this.sensors.register(e,t);if(e.prototype instanceof mz)return this.plugins.register(e,t);throw new Error("Invalid instance type")}unregister(e){if(e instanceof Xz)return e instanceof SF?this.draggables.unregister(e.id,e):e instanceof CF?this.droppables.unregister(e.id,e):()=>{};if(e.prototype instanceof GF)return this.modifiers.unregister(e);if(e.prototype instanceof EF)return this.sensors.unregister(e);if(e.prototype instanceof mz)return this.plugins.unregister(e);throw new Error("Invalid instance type")}destroy(){this.draggables.destroy(),this.droppables.destroy(),this.plugins.destroy(),this.sensors.destroy(),this.modifiers.destroy()}};qF=[tj],TF=[ej],LF=[ej],OF=[ej],AF=[ej],PF=[ej],DF=[tj],IF=[tj],RF=[tj];var KF=class{constructor(e){iz(FF,5,this),cz(this,NF),cz(this,jF),cz(this,zF,new oj(void 0,((e,t)=>e&&t?e.equals(t):e===t))),this.status=new zz,cz(this,WF,iz(FF,8,this,!1)),iz(FF,11,this),cz(this,$F,iz(FF,12,this,null)),iz(FF,15,this),cz(this,BF,iz(FF,16,this,null)),iz(FF,19,this),cz(this,VF,iz(FF,20,this,null)),iz(FF,23,this),cz(this,HF,iz(FF,24,this,[])),iz(FF,27,this),this.position=new Dj({x:0,y:0}),cz(this,UF,{x:0,y:0}),uz(this,NF,e)}get shape(){const{current:e,initial:t,previous:n}=lz(this,zF);return e&&t?{current:e,initial:t,previous:n}:null}set shape(e){e?lz(this,zF).current=e:lz(this,zF).reset()}get source(){var e;const t=this.sourceIdentifier;if(null==t)return null;const n=lz(this,NF).registry.draggables.get(t);return n&&uz(this,jF,n),null!=(e=null!=n?n:lz(this,jF))?e:null}get target(){var e;const t=this.targetIdentifier;return null!=t&&null!=(e=lz(this,NF).registry.droppables.get(t))?e:null}get transform(){const{x:e,y:t}=this.position.delta;let n={x:e,y:t};for(const e of this.modifiers)n=e.apply(Xj(Kj({},this.snapshot()),{transform:n}));return uz(this,UF,n),n}snapshot(){return Hq((()=>({source:this.source,target:this.target,activatorEvent:this.activatorEvent,transform:lz(this,UF),shape:this.shape?aj(this.shape):null,position:aj(this.position),status:aj(this.status),canceled:this.canceled})))}reset(){Bq((()=>{this.status.set("idle"),this.sourceIdentifier=null,this.targetIdentifier=null,lz(this,zF).reset(),this.position.reset({x:0,y:0}),uz(this,UF,{x:0,y:0}),this.modifiers=[]}))}};FF=Zj(null),NF=new WeakMap,jF=new WeakMap,zF=new WeakMap,WF=new WeakMap,$F=new WeakMap,BF=new WeakMap,VF=new WeakMap,HF=new WeakMap,UF=new WeakMap,oz(FF,2,"shape",qF,KF),oz(FF,4,"canceled",TF,KF,WF),oz(FF,4,"activatorEvent",LF,KF,$F),oz(FF,4,"sourceIdentifier",OF,KF,BF),oz(FF,4,"targetIdentifier",AF,KF,VF),oz(FF,4,"modifiers",PF,KF,HF),oz(FF,2,"source",DF,KF),oz(FF,2,"target",IF,KF),oz(FF,2,"transform",RF,KF),rz(FF,KF);var XF={get rendering(){return Promise.resolve()}};function JF(e,t){return"function"==typeof e?e(t):null!=e?e:t}var QF=class{constructor(e){var t;this.destroy=()=>{this.dragOperation.status.idle||this.actions.stop({canceled:!0}),this.dragOperation.modifiers.forEach((e=>e.destroy())),this.registry.destroy(),this.collisionObserver.destroy()};const n=null!=e?e:{},r=JF(n.plugins,[]),i=JF(n.sensors,[]),o=JF(n.modifiers,[]),a=null!=(t=n.renderer)?t:XF,s=new Ez(this),l=new YF(this);this.registry=l,this.monitor=s,this.renderer=a,this.actions=new Kz(this),this.dragOperation=new KF(this),this.collisionObserver=new Cz(this),this.plugins=[qz,...r],this.modifiers=o,this.sensors=i;const{destroy:c}=this,u=rj((()=>{var e,t,n;const r=Hq((()=>this.dragOperation.modifiers)),i=this.modifiers;for(const e of r)i.includes(e)||e.destroy();this.dragOperation.modifiers=null!=(n=null==(t=null==(e=this.dragOperation.source)?void 0:e.modifiers)?void 0:t.map((e=>{const{plugin:t,options:n}=pz(e);return new t(this,n)})))?n:i}));this.destroy=()=>{u(),c()}}get plugins(){return this.registry.plugins.values}set plugins(e){this.registry.plugins.values=e}get modifiers(){return this.registry.modifiers.values}set modifiers(e){this.registry.modifiers.values=e}get sensors(){return this.registry.sensors.values}set sensors(e){this.registry.sensors.values=e}},ZF=e=>{throw TypeError(e)},eW=(e,t,n)=>t.has(e)||ZF("Cannot "+n),tW=(e,t,n)=>(eW(e,t,"read from private field"),t.get(e)),nW=(e,t,n)=>t.has(e)?ZF("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),rW=(e,t,n,r)=>(eW(e,t,"write to private field"),t.set(e,n),n),iW=(e,t,n)=>(eW(e,t,"access private method"),n);function oW(e){return!!e&&(e instanceof KeyframeEffect||"getKeyframes"in e&&"function"==typeof e.getKeyframes)}function aW(e,t){const n=e.getAnimations();if(n.length>0)for(const e of n){if("running"!==e.playState)continue;const{effect:n}=e,r=(oW(n)?n.getKeyframes():[]).filter(t);if(r.length>0)return[r[r.length-1],e]}return null}function sW(e){const{width:t,height:n,top:r,left:i,bottom:o,right:a}=e.getBoundingClientRect();return{width:t,height:n,top:r,left:i,bottom:o,right:a}}function lW(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function cW(e){return"nodeType"in e}function uW(e){var t,n,r;return e?lW(e)?e:cW(e)?"defaultView"in e?null!=(t=e.defaultView)?t:window:null!=(r=null==(n=e.ownerDocument)?void 0:n.defaultView)?r:window:window:window}function dW(e){const{Document:t}=uW(e);return e instanceof t||"nodeType"in e&&e.nodeType===Node.DOCUMENT_NODE}function fW(e){return!(!e||lW(e))&&(e instanceof uW(e).HTMLElement||"namespaceURI"in e&&"string"==typeof e.namespaceURI&&e.namespaceURI.endsWith("html"))}function hW(e){return e instanceof uW(e).SVGElement||"namespaceURI"in e&&"string"==typeof e.namespaceURI&&e.namespaceURI.endsWith("svg")}function pW(e){return e?lW(e)?e.document:cW(e)?dW(e)?e:fW(e)||hW(e)?e.ownerDocument:document:document:document}function mW(e,t){if(function(e){return"DETAILS"===e.tagName}(e)&&!1===e.open)return!1;const{overflow:n,overflowX:r,overflowY:i}=getComputedStyle(e);return"visible"===n&&"visible"===r&&"visible"===i}function gW(e,t=e.getBoundingClientRect(),n=0){var r,i,o,a,s;let l=t;const{ownerDocument:c}=e,u=null!=(r=c.defaultView)?r:window;let d=e.parentElement;for(;d&&d!==c.documentElement;){if(!mW(d)){const e=d.getBoundingClientRect(),t=n*(e.bottom-e.top),r=n*(e.right-e.left),i=n*(e.bottom-e.top),o=n*(e.right-e.left);l={top:Math.max(l.top,e.top-t),right:Math.min(l.right,e.right+r),bottom:Math.min(l.bottom,e.bottom+i),left:Math.max(l.left,e.left-o),width:0,height:0},l.width=l.right-l.left,l.height=l.bottom-l.top}d=d.parentElement}const f=u.visualViewport,h=null!=(i=null==f?void 0:f.offsetTop)?i:0,p=null!=(o=null==f?void 0:f.offsetLeft)?o:0,m=null!=(a=null==f?void 0:f.width)?a:u.innerWidth,g=null!=(s=null==f?void 0:f.height)?s:u.innerHeight,y=n*g,v=n*m;return l={top:Math.max(l.top,h-y),right:Math.min(l.right,p+m+v),bottom:Math.min(l.bottom,h+g+y),left:Math.max(l.left,p-v),width:0,height:0},l.width=l.right-l.left,l.height=l.bottom-l.top,l.width<0&&(l.width=0),l.height<0&&(l.height=0),l}function yW(e){return{x:e.clientX,y:e.clientY}}var vW="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function bW(e=document,t=new Set){if(t.has(e))return[];t.add(e);const n=[e];for(const r of Array.from(e.querySelectorAll("iframe, frame")))try{const e=r.contentDocument;e&&!t.has(e)&&n.push(...bW(e,t))}catch(e){}try{const r=e.defaultView;if(r&&r!==window.top){const i=r.parent;i&&i.document&&i.document!==e&&n.push(...bW(i.document,t))}}catch(e){}return n}function xW(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function wW(){var e,t;const n=xW()?window.visualViewport:null;return{x:null!=(e=null==n?void 0:n.offsetLeft)?e:0,y:null!=(t=null==n?void 0:n.offsetTop)?t:0}}function SW(e){return!(!e||!cW(e))&&e instanceof uW(e).ShadowRoot}function CW(e){if(e&&cW(e)){let t=e.getRootNode();if(SW(t))return t;if(t instanceof Document)return t}return pW(e)}function kW(e){return e.matchMedia("(prefers-reduced-motion: reduce)").matches}function EW(e){return"value"in e}function MW(e){return"CANVAS"===e.tagName}function _W(e,{x:t,y:n}){const r=e.elementFromPoint(t,n);if(function(e){return"IFRAME"===(null==e?void 0:e.tagName)}(r)){const{contentDocument:e}=r;if(e){const{left:i,top:o}=r.getBoundingClientRect();return _W(e,{x:t-i,y:n-o})}}return r}var RW=new WeakMap;var IW=class{constructor(){this.entries=new Set,this.clear=()=>{for(const e of this.entries){const[t,{type:n,listener:r,options:i}]=e;t.removeEventListener(n,r,i)}this.entries.clear()}}bind(e,t){const n=Array.isArray(e)?e:[e],r=Array.isArray(t)?t:[t],i=[];for(const e of n)for(const t of r){const{type:n,listener:r,options:o}=t,a=[e,t];e.addEventListener(n,r,o),this.entries.add(a),i.push(a)}return function(){for(const[e,{type:t,listener:n,options:r}]of i)e.removeEventListener(t,n,r)}}};function DW(e){const t=null==e?void 0:e.ownerDocument.defaultView;if(t&&t.self!==t.parent)return t.frameElement}function PW(e,t){const n=()=>performance.now();let r,i;return function(...o){const a=this;i?(null==r||r(),r=function(e,t){const n=setTimeout(e,t);return()=>clearTimeout(n)}((()=>{e.apply(a,o),i=n()}),t-(n()-i))):(e.apply(a,o),i=n())}}var AW,OW=vW?ResizeObserver:class{observe(){}unobserve(){}disconnect(){}},LW=class extends OW{constructor(e){super((t=>{tW(this,AW)?e(t,this):rW(this,AW,!0)})),nW(this,AW,!1)}};AW=new WeakMap;var TW,qW,NW,jW,zW,FW,WW,$W,BW,VW,HW,UW=Array.from({length:100},((e,t)=>t/100)),GW=class{constructor(e,t,n={debug:!1,skipInitial:!1}){this.element=e,this.callback=t,nW(this,BW),this.disconnect=()=>{var e,t,n;rW(this,WW,!0),null==(e=tW(this,NW))||e.disconnect(),null==(t=tW(this,jW))||t.disconnect(),tW(this,zW).disconnect(),null==(n=tW(this,FW))||n.remove()},nW(this,TW,!0),nW(this,qW),nW(this,NW),nW(this,jW),nW(this,zW),nW(this,FW),nW(this,WW,!1),nW(this,$W,PW((()=>{var e,t,n;const{element:r}=this;if(null==(e=tW(this,jW))||e.disconnect(),tW(this,WW)||!tW(this,TW)||!r.isConnected)return;const i=null!=(t=r.ownerDocument)?t:document,{innerHeight:o,innerWidth:a}=null!=(n=i.defaultView)?n:window,s=r.getBoundingClientRect(),l=gW(r,s),{top:c,left:u,bottom:d,right:f}=l,h=-Math.floor(c),p=-Math.floor(u),m=`${h}px ${-Math.floor(a-f)}px ${-Math.floor(o-d)}px ${p}px`;this.boundingClientRect=s,rW(this,jW,new IntersectionObserver((e=>{const[t]=e,{intersectionRect:n}=t;1!==(1!==t.intersectionRatio?t.intersectionRatio:Rj.intersectionRatio(n,gW(r)))&&tW(this,$W).call(this)}),{threshold:UW,rootMargin:m,root:i})),tW(this,jW).observe(r),iW(this,BW,VW).call(this)}),75)),this.boundingClientRect=e.getBoundingClientRect(),rW(this,TW,function(e,t=e.getBoundingClientRect()){const{width:n,height:r}=gW(e,t);return n>0&&r>0}(e,this.boundingClientRect));let r=!0;this.callback=e=>{r&&(r=!1,n.skipInitial)||t(e)};const i=e.ownerDocument;(null==n?void 0:n.debug)&&(rW(this,FW,document.createElement("div")),tW(this,FW).style.background="rgba(0,0,0,0.15)",tW(this,FW).style.position="fixed",tW(this,FW).style.pointerEvents="none",i.body.appendChild(tW(this,FW))),rW(this,zW,new IntersectionObserver((t=>{var n,r;const i=t[t.length-1],{boundingClientRect:o,isIntersecting:a}=i,{width:s,height:l}=o,c=tW(this,TW);rW(this,TW,a),(s||l)&&(c&&!a?(null==(n=tW(this,jW))||n.disconnect(),this.callback(null),null==(r=tW(this,NW))||r.disconnect(),rW(this,NW,void 0),tW(this,FW)&&(tW(this,FW).style.visibility="hidden")):tW(this,$W).call(this),a&&!tW(this,NW)&&(rW(this,NW,new LW(tW(this,$W))),tW(this,NW).observe(e)))}),{threshold:UW,root:i})),tW(this,TW)&&!n.skipInitial&&this.callback(this.boundingClientRect),tW(this,zW).observe(e)}};TW=new WeakMap,qW=new WeakMap,NW=new WeakMap,jW=new WeakMap,zW=new WeakMap,FW=new WeakMap,WW=new WeakMap,$W=new WeakMap,BW=new WeakSet,VW=function(){tW(this,WW)||(iW(this,BW,HW).call(this),function(e,t){return e===t||!(!e||!t)&&e.top==t.top&&e.left==t.left&&e.right==t.right&&e.bottom==t.bottom}(this.boundingClientRect,tW(this,qW))||(this.callback(this.boundingClientRect),rW(this,qW,this.boundingClientRect)))},HW=function(){if(tW(this,FW)){const{top:e,left:t,width:n,height:r}=gW(this.element);tW(this,FW).style.overflow="hidden",tW(this,FW).style.visibility="visible",tW(this,FW).style.top=`${Math.floor(e)}px`,tW(this,FW).style.left=`${Math.floor(t)}px`,tW(this,FW).style.width=`${Math.floor(n)}px`,tW(this,FW).style.height=`${Math.floor(r)}px`}};var YW,KW,XW,JW,QW=new WeakMap,ZW=new WeakMap;function e$(e,t){let n=QW.get(e);if(!n){const t=new GW(e,(t=>{const n=QW.get(e);n&&n.callbacks.forEach((e=>e(t)))}),{skipInitial:!0});n={disconnect:t.disconnect,callbacks:new Set}}return n.callbacks.add(t),QW.set(e,n),()=>{n.callbacks.delete(t),0===n.callbacks.size&&(QW.delete(e),n.disconnect())}}var t$=class{constructor(e,t,n){this.callback=t,nW(this,YW),nW(this,KW,!1),nW(this,XW),nW(this,JW,PW((e=>{if(!tW(this,KW)&&e.target&&"contains"in e.target&&"function"==typeof e.target.contains)for(const t of tW(this,XW))if(e.target.contains(t)){this.callback(tW(this,YW).boundingClientRect);break}}),75));const r=function(e){const t=new Set;let n=DW(e);for(;n;)t.add(n),n=DW(n);return t}(e),i=function(e,t){const n=new Set;for(const r of e){const e=e$(r,t);n.add(e)}return()=>n.forEach((e=>e()))}(r,t),o=function(e,t){var n;const r=e.ownerDocument;if(!ZW.has(r)){const e=new AbortController,t=new Set;document.addEventListener("scroll",(e=>t.forEach((t=>t(e)))),{capture:!0,passive:!0,signal:e.signal}),ZW.set(r,{disconnect:()=>e.abort(),listeners:t})}const{listeners:i,disconnect:o}=null!=(n=ZW.get(r))?n:{};return i&&o?(i.add(t),()=>{i.delete(t),0===i.size&&(o(),ZW.delete(r))}):()=>{}}(e,tW(this,JW));rW(this,XW,r),rW(this,YW,new GW(e,t,n)),this.disconnect=()=>{tW(this,KW)||(rW(this,KW,!0),i(),o(),tW(this,YW).disconnect())}}};function n$(e){return"showPopover"in e&&"hidePopover"in e&&"function"==typeof e.showPopover&&"function"==typeof e.hidePopover}function r$(e){try{n$(e)&&e.isConnected&&e.hasAttribute("popover")&&!e.matches(":popover-open")&&e.showPopover()}catch(e){}}function i$(e){return!(!vW||!e)&&e===pW(e).scrollingElement}function o$(e){var t,n;const r=uW(e),i=i$(e)?function(e){var t,n,r,i;const{documentElement:o}=pW(e),a=uW(e).visualViewport,s=null!=(t=null==a?void 0:a.width)?t:o.clientWidth,l=null!=(n=null==a?void 0:a.height)?n:o.clientHeight,c=null!=(r=null==a?void 0:a.offsetTop)?r:0,u=null!=(i=null==a?void 0:a.offsetLeft)?i:0;return{top:c,left:u,right:u+s,bottom:c+l,width:s,height:l}}(e):sW(e),o=r.visualViewport,a=i$(e)?{height:null!=(t=null==o?void 0:o.height)?t:r.innerHeight,width:null!=(n=null==o?void 0:o.width)?n:r.innerWidth}:{height:e.clientHeight,width:e.clientWidth},s={current:{x:e.scrollLeft,y:e.scrollTop},max:{x:e.scrollWidth-a.width,y:e.scrollHeight-a.height}};return{rect:i,position:s,isTop:s.current.y<=0,isLeft:s.current.x<=0,isBottom:s.current.y>=s.max.y,isRight:s.current.x>=s.max.x}}function a$(e,t){const{isTop:n,isBottom:r,isLeft:i,isRight:o,position:a}=o$(e),{x:s,y:l}=null!=t?t:{x:0,y:0},c=!n&&a.current.y+l>0,u=!r&&a.current.y+l<a.max.y,d=!i&&a.current.x+s>0,f=!o&&a.current.x+s<a.max.x;return{top:c,bottom:u,left:d,right:f,x:d||f,y:c||u}}YW=new WeakMap,KW=new WeakMap,XW=new WeakMap,JW=new WeakMap;var s$=class{constructor(e){this.scheduler=e,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{const{tasks:e,resolvers:t}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(const t of e)t();for(const e of t)e()}}schedule(e){return this.tasks.add(e),this.pending||(this.pending=!0,this.scheduler(this.flush)),new Promise((e=>this.resolvers.add(e)))}},l$=new s$((e=>{"function"==typeof requestAnimationFrame?requestAnimationFrame(e):e()})),c$=new s$((e=>setTimeout(e,50))),u$=new Map,d$=u$.clear.bind(u$);function f$(e,t=!1){if(!t)return h$(e);let n=u$.get(e);return n||(n=h$(e),u$.set(e,n),c$.schedule(d$),n)}function h$(e){return uW(e).getComputedStyle(e)}var p$={excludeElement:!0,escapeShadowDOM:!0};function m$(e,t=p$){const{limit:n,excludeElement:r,escapeShadowDOM:i}=t,o=new Set;return e?function t(a){if(null!=n&&o.size>=n)return o;if(!a)return o;if(dW(a)&&null!=a.scrollingElement&&!o.has(a.scrollingElement))return o.add(a.scrollingElement),o;if(i&&SW(a))return t(a.host);if(!fW(a))return hW(a)?t(a.parentElement):o;if(o.has(a))return o;const s=f$(a,!0);if(r&&a===e||function(e,t=f$(e,!0)){const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const r=t[e];return"string"==typeof r&&n.test(r)}))}(a,s)&&o.add(a),function(e,t=f$(e,!0)){return"fixed"===t.position||"sticky"===t.position}(a,s)){const{scrollingElement:e}=a.ownerDocument;return e&&o.add(e),o}return t(a.parentNode)}(e):o}function g$(e,t=window.frameElement){const n={x:0,y:0,scaleX:1,scaleY:1};if(!e)return n;let r=DW(e);for(;r;){if(r===t)return n;const e=sW(r),{x:i,y:o}=y$(r,e);n.x=n.x+e.left,n.y=n.y+e.top,n.scaleX=n.scaleX*i,n.scaleY=n.scaleY*o,r=DW(r)}return n}function y$(e,t=sW(e)){const n=Math.round(t.width),r=Math.round(t.height);if(fW(e))return{x:n/e.offsetWidth,y:r/e.offsetHeight};const i=f$(e,!0);return{x:(parseFloat(i.width)||n)/n,y:(parseFloat(i.height)||r)/r}}function v$(e){if("none"===e)return null;const[t,n,r="0"]=e.split(" "),i={x:parseFloat(t),y:parseFloat(n),z:parseInt(r,10)};return isNaN(i.x)&&isNaN(i.y)?null:{x:isNaN(i.x)?0:i.x,y:isNaN(i.y)?0:i.y,z:isNaN(i.z)?0:i.z}}function b$(e){var t,n,r,i,o,a,s,l,c;const{scale:u,transform:d,translate:f}=e,h=function(e){if("none"===e)return null;const t=e.split(" "),n=parseFloat(t[0]),r=parseFloat(t[1]);return isNaN(n)&&isNaN(r)?null:{x:isNaN(n)?r:n,y:isNaN(r)?n:r}}(u),p=v$(f),m=function(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(d);if(!m&&!h&&!p)return null;const g=null!=(t=null==h?void 0:h.x)?t:1,y=null!=(n=null==h?void 0:h.y)?n:1,v=null!=(r=null==p?void 0:p.x)?r:0,b=null!=(i=null==p?void 0:p.y)?i:0,x=null!=(o=null==m?void 0:m.x)?o:0,w=null!=(a=null==m?void 0:m.y)?a:0,S=null!=(s=null==m?void 0:m.scaleX)?s:1,C=null!=(l=null==m?void 0:m.scaleY)?l:1;return{x:v+x,y:b+w,z:null!=(c=null==p?void 0:p.z)?c:0,scaleX:g*S,scaleY:y*C}}var x$=(e=>(e[e.Idle=0]="Idle",e[e.Forward=1]="Forward",e[e.Reverse=-1]="Reverse",e))(x$||{}),w$={x:.2,y:.2},S$={x:10,y:10};function C$(e,t,n,r=25,i=w$,o=S$){const{x:a,y:s}=t,{rect:l,isTop:c,isBottom:u,isLeft:d,isRight:f}=o$(e),h=g$(e),p=b$(f$(e,!0)),m=null!==p&&(null==p?void 0:p.scaleX)<0,g=null!==p&&(null==p?void 0:p.scaleY)<0,y=new Rj(l.left*h.scaleX+h.x,l.top*h.scaleY+h.y,l.width*h.scaleX,l.height*h.scaleY),v={x:0,y:0},b={x:0,y:0},x=y.height*i.y,w=y.width*i.x;return(!c||g&&!u)&&s<=y.top+x&&1!==(null==n?void 0:n.y)&&a>=y.left-o.x&&a<=y.right+o.x?(v.y=g?1:-1,b.y=r*Math.abs((y.top+x-s)/x)):(!u||g&&!c)&&s>=y.bottom-x&&-1!==(null==n?void 0:n.y)&&a>=y.left-o.x&&a<=y.right+o.x&&(v.y=g?-1:1,b.y=r*Math.abs((y.bottom-x-s)/x)),(!f||m&&!d)&&a>=y.right-w&&-1!==(null==n?void 0:n.x)&&s>=y.top-o.y&&s<=y.bottom+o.y?(v.x=m?-1:1,b.x=r*Math.abs((y.right-w-a)/w)):(!d||m&&!f)&&a<=y.left+w&&1!==(null==n?void 0:n.x)&&s>=y.top-o.y&&s<=y.bottom+o.y&&(v.x=m?1:-1,b.x=r*Math.abs((y.left+w-a)/w)),{direction:v,speed:b}}function k$(e,t=!1){if("scrollIntoViewIfNeeded"in(n=e)&&"function"==typeof n.scrollIntoViewIfNeeded)return void e.scrollIntoViewIfNeeded(t);var n;if(!fW(e))return e.scrollIntoView();var r=function(e){const[t]=m$(e,{limit:1});return null!=t?t:null}(e);if(!fW(r))return;const i=f$(r,!0),o=parseInt(i.getPropertyValue("border-top-width")),a=parseInt(i.getPropertyValue("border-left-width")),s=e.offsetTop-r.offsetTop<r.scrollTop,l=e.offsetTop-r.offsetTop+e.clientHeight-o>r.scrollTop+r.clientHeight,c=e.offsetLeft-r.offsetLeft<r.scrollLeft,u=e.offsetLeft-r.offsetLeft+e.clientWidth-a>r.scrollLeft+r.clientWidth,d=s&&!l;(s||l)&&t&&(r.scrollTop=e.offsetTop-r.offsetTop-r.clientHeight/2-o+e.clientHeight/2),(c||u)&&t&&(r.scrollLeft=e.offsetLeft-r.offsetLeft-r.clientWidth/2-a+e.clientWidth/2),(s||l||c||u)&&!t&&e.scrollIntoView(d)}function E$({element:e,keyframes:t,options:n}){return e.animate(t,n).finished}function M$(e,t=f$(e).translate,n=!0){if(n){const t=aW(e,(e=>"translate"in e));if(t){const{translate:e=""}=t[0];if("string"==typeof e){const t=v$(e);if(t)return t}}}if(t){const e=v$(t);if(e)return e}return{x:0,y:0,z:0}}var _$=new s$((e=>setTimeout(e,0))),R$=new Map,I$=R$.clear.bind(R$);function D$(e,t){const n=function(e){const t=e.ownerDocument;let n=R$.get(t);if(n)return n;n=t.getAnimations(),R$.set(t,n),_$.schedule(I$);const r=n.filter((t=>oW(t.effect)&&t.effect.target===e));return R$.set(e,r),n}(e).filter((e=>{var n,r;if(oW(e.effect)){const{target:i}=e.effect;if(null==(r=i&&(null==(n=t.isValidTarget)?void 0:n.call(t,i)))||r)return e.effect.getKeyframes().some((e=>{for(const n of t.properties)if(e[n])return!0}))}})).map((e=>{const{effect:t,currentTime:n}=e,r=null==t?void 0:t.getComputedTiming().duration;if(!e.pending&&"finished"!==e.playState)return"number"==typeof r&&"number"==typeof n&&n<r?(e.currentTime=r,()=>{e.currentTime=n}):void 0}));if(n.length>0)return()=>n.forEach((e=>null==e?void 0:e()))}var P$=class extends Rj{constructor(e,t={}){var n,r,i,o;const{frameTransform:a=g$(e),ignoreTransforms:s,getBoundingClientRect:l=sW}=t,c=D$(e,{properties:["transform","translate","scale","width","height"],isValidTarget:t=>(t!==e||xW())&&t.contains(e)}),u=l(e);let d,{top:f,left:h,width:p,height:m}=u;const g=f$(e),y=b$(g),v={x:null!=(n=null==y?void 0:y.scaleX)?n:1,y:null!=(r=null==y?void 0:y.scaleY)?r:1},b=function(e,t){var n;const r=e.getAnimations();let i=null;if(!r.length)return null;for(const e of r){if("running"!==e.playState)continue;const r=oW(e.effect)?e.effect.getKeyframes():[],o=r[r.length-1];if(!o)continue;const{transform:a,translate:s,scale:l}=o;if(a||s||l){const e=b$({transform:"string"==typeof a&&a?a:t.transform,translate:"string"==typeof s&&s?s:t.translate,scale:"string"==typeof l&&l?l:t.scale});e&&(i=i?{x:i.x+e.x,y:i.y+e.y,z:null!=(n=i.z)?n:e.z,scaleX:i.scaleX*e.scaleX,scaleY:i.scaleY*e.scaleY}:e)}}return i}(e,g);null==c||c(),y&&(d=function(e,t,n){const{scaleX:r,scaleY:i,x:o,y:a}=t,s=e.left-o-(1-r)*parseFloat(n),l=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),c=r?e.width/r:e.width,u=i?e.height/i:e.height;return{width:c,height:u,top:l,right:s+c,bottom:l+u,left:s}}(u,y,g.transformOrigin),(s||b)&&(f=d.top,h=d.left,p=d.width,m=d.height));const x={width:null!=(i=null==d?void 0:d.width)?i:p,height:null!=(o=null==d?void 0:d.height)?o:m};if(b&&!s&&d){const e=function(e,t,n){const{scaleX:r,scaleY:i,x:o,y:a}=t,s=e.left+o+(1-r)*parseFloat(n),l=e.top+a+(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),c=r?e.width*r:e.width,u=i?e.height*i:e.height;return{width:c,height:u,top:l,right:s+c,bottom:l+u,left:s}}(d,b,g.transformOrigin);f=e.top,h=e.left,p=e.width,m=e.height,v.x=b.scaleX,v.y=b.scaleY}a&&(s||(h*=a.scaleX,p*=a.scaleX,f*=a.scaleY,m*=a.scaleY),h+=a.x,f+=a.y),super(h,f,p,m),this.scale=v,this.intrinsicWidth=x.width,this.intrinsicHeight=x.height}};function A$(e){return"style"in e&&"object"==typeof e.style&&null!==e.style&&"setProperty"in e.style&&"removeProperty"in e.style&&"function"==typeof e.style.setProperty&&"function"==typeof e.style.removeProperty}var O$=class{constructor(e){this.element=e,this.initial=new Map}set(e,t=""){const{element:n}=this;if(A$(n))for(const[r,i]of Object.entries(e)){const e=`${t}${r}`;this.initial.has(e)||this.initial.set(e,n.style.getPropertyValue(e)),n.style.setProperty(e,"string"==typeof i?i:`${i}px`)}}remove(e,t=""){const{element:n}=this;if(A$(n))for(const r of e){const e=`${t}${r}`;n.style.removeProperty(e)}}reset(){const{element:e}=this;if(A$(e)){for(const[t,n]of this.initial)e.style.setProperty(t,n);""===e.getAttribute("style")&&e.removeAttribute("style")}}};function L$(e){return!!e&&(e instanceof uW(e).Element||cW(e)&&e.nodeType===Node.ELEMENT_NODE)}function T$(e){if(!e)return!1;const{KeyboardEvent:t}=uW(e.target);return e instanceof t}var q$={};function N$(e){const t=null==q$[e]?0:q$[e]+1;return q$[e]=t,`${e}-${t}`}var j$=e=>{var t;return null!=(t=(({dragOperation:e,droppable:t})=>{const n=e.position.current;if(!n)return null;const{id:r}=t;if(!t.shape)return null;if(t.shape.containsPoint(n))return{id:r,value:1/_j.distance(t.shape.center,n),type:jz.PointerIntersection,priority:Nz.High};return null})(e))?t:(({dragOperation:e,droppable:t})=>{const{shape:n}=e;if(!t.shape||!(null==n?void 0:n.current))return null;const r=n.current.intersectionArea(t.shape);if(r){const{position:i}=e,o=_j.distance(t.shape.center,i.current),a=r/(n.current.area+t.shape.area-r)/o;return{id:t.id,value:a,type:jz.ShapeIntersection,priority:Nz.Normal}}return null})(e)},z$=e=>{const{dragOperation:t,droppable:n}=e,{shape:r,position:i}=t;if(!n.shape)return null;const o=r?Rj.from(r.current.boundingRectangle).corners:void 0,a=Rj.from(n.shape.boundingRectangle).corners.reduce(((e,t,n)=>{var r;return e+_j.distance(_j.from(t),null!=(r=null==o?void 0:o[n])?r:i.current)}),0),s=a/4;return{id:n.id,value:1/s,type:jz.Collision,priority:Nz.Normal}},F$=Object.create,W$=Object.defineProperty,$$=Object.defineProperties,B$=Object.getOwnPropertyDescriptor,V$=Object.getOwnPropertyDescriptors,H$=Object.getOwnPropertySymbols,U$=Object.prototype.hasOwnProperty,G$=Object.prototype.propertyIsEnumerable,Y$=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),K$=e=>{throw TypeError(e)},X$=(e,t,n)=>t in e?W$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,J$=(e,t)=>{for(var n in t||(t={}))U$.call(t,n)&&X$(e,n,t[n]);if(H$)for(var n of H$(t))G$.call(t,n)&&X$(e,n,t[n]);return e},Q$=(e,t)=>$$(e,V$(t)),Z$=(e,t)=>W$(e,"name",{value:t,configurable:!0}),eB=(e,t)=>{var n={};for(var r in e)U$.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&H$)for(var r of H$(e))t.indexOf(r)<0&&G$.call(e,r)&&(n[r]=e[r]);return n},tB=e=>{var t;return[,,,F$(null!=(t=null==e?void 0:e[Y$("metadata")])?t:null)]},nB=["class","method","getter","setter","accessor","field","value","get","set"],rB=e=>void 0!==e&&"function"!=typeof e?K$("Function expected"):e,iB=(e,t,n,r,i)=>({kind:nB[e],name:t,metadata:r,addInitializer:e=>n._?K$("Already initialized"):i.push(rB(e||null))}),oB=(e,t)=>X$(t,Y$("metadata"),e[3]),aB=(e,t,n,r)=>{for(var i=0,o=e[t>>1],a=o&&o.length;i<a;i++)1&t?o[i].call(n):r=o[i].call(n,r);return r},sB=(e,t,n,r,i,o)=>{var a,s,l,c,u,d=7&t,f=!!(8&t),h=!!(16&t),p=d>3?e.length+1:d?f?1:2:0,m=nB[d+5],g=d>3&&(e[p-1]=[]),y=e[p]||(e[p]=[]),v=d&&(!h&&!f&&(i=i.prototype),d<5&&(d>3||!h)&&B$(d<4?i:{get[n](){return uB(this,o)},set[n](e){return fB(this,o,e)}},n));d?h&&d<4&&Z$(o,(d>2?"set ":d>1?"get ":"")+n):Z$(i,n);for(var b=r.length-1;b>=0;b--)c=iB(d,n,l={},e[3],y),d&&(c.static=f,c.private=h,u=c.access={has:h?e=>cB(i,e):e=>n in e},3^d&&(u.get=h?e=>(1^d?uB:hB)(e,i,4^d?o:v.get):e=>e[n]),d>2&&(u.set=h?(e,t)=>fB(e,i,t,4^d?o:v.set):(e,t)=>e[n]=t)),s=(0,r[b])(d?d<4?h?o:v[m]:d>4?void 0:{get:v.get,set:v.set}:i,c),l._=1,4^d||void 0===s?rB(s)&&(d>4?g.unshift(s):d?h?o=s:v[m]=s:i=s):"object"!=typeof s||null===s?K$("Object expected"):(rB(a=s.get)&&(v.get=a),rB(a=s.set)&&(v.set=a),rB(a=s.init)&&g.unshift(a));return d||oB(e,i),v&&W$(i,n,v),h?4^d?o:v:i},lB=(e,t,n)=>t.has(e)||K$("Cannot "+n),cB=(e,t)=>Object(t)!==t?K$('Cannot use the "in" operator on this value'):e.has(t),uB=(e,t,n)=>(lB(e,t,"read from private field"),n?n.call(e):t.get(e)),dB=(e,t,n)=>t.has(e)?K$("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),fB=(e,t,n,r)=>(lB(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),hB=(e,t,n)=>(lB(e,t,"access private method"),n),pB="button",mB="draggable",gB="dnd-kit-description",yB="dnd-kit-announcement",vB={draggable:"To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item in a given direction. Press space again to drop the item in its new position, or press escape to cancel."},bB={dragstart({operation:{source:e}}){if(e)return`Picked up draggable item ${e.id}.`},dragover({operation:{source:e,target:t}}){if(e&&e.id!==(null==t?void 0:t.id))return t?`Draggable item ${e.id} was moved over droppable target ${t.id}.`:`Draggable item ${e.id} is no longer over a droppable target.`},dragend({operation:{source:e,target:t},canceled:n}){if(e)return n?`Dragging was cancelled. Draggable item ${e.id} was dropped.`:t?`Draggable item ${e.id} was dropped over droppable target ${t.id}`:`Draggable item ${e.id} was dropped.`}};function xB(e){const t=e.tagName.toLowerCase();return["input","select","textarea","a","button"].includes(t)}var wB=["dragover","dragmove"];var SB,CB,kB,EB,MB,_B,RB,IB,DB,PB,AB,OB,LB,TB=new Map,qB=class extends(MB=yz,EB=[ej],kB=[tj],CB=[tj],SB=[tj],MB){constructor(e){super(e),aB(RB,5,this),dB(this,DB),dB(this,_B,new Set),dB(this,IB,aB(RB,8,this,new Set)),aB(RB,11,this),this.registerEffect(hB(this,DB,PB))}register(e){return uB(this,_B).add(e),()=>{uB(this,_B).delete(e)}}addRoot(e){return Hq((()=>{const t=new Set(this.additionalRoots);t.add(e),this.additionalRoots=t})),()=>{Hq((()=>{const t=new Set(this.additionalRoots);t.delete(e),this.additionalRoots=t}))}}get sourceRoot(){var e;const{source:t}=this.manager.dragOperation;return CW(null!=(e=null==t?void 0:t.element)?e:null)}get targetRoot(){var e;const{target:t}=this.manager.dragOperation;return CW(null!=(e=null==t?void 0:t.element)?e:null)}get roots(){const{status:e}=this.manager.dragOperation;if(e.initializing||e.initialized){const e=[this.sourceRoot,this.targetRoot].filter((e=>null!=e));return new Set([...e,...this.additionalRoots])}return new Set}};RB=tB(MB),_B=new WeakMap,IB=new WeakMap,DB=new WeakSet,PB=function(){const{roots:e}=this,t=[];for(const n of e)for(const e of uB(this,_B))t.push(hB(this,DB,AB).call(this,n,e));return()=>{for(const e of t)e()}},AB=function(e,t){let n=TB.get(e);n||(n=new Map,TB.set(e,n));let r=n.get(t);if(!r){const i=dW(e)?hB(this,DB,OB).call(this,e,n,t):hB(this,DB,LB).call(this,e,n,t);if(!i)return()=>{};r=i,n.set(t,r)}r.refCount++;let i=!1;return()=>{i||(i=!0,r.refCount--,0===r.refCount&&r.cleanup())}},OB=function(e,t,n){const r=e.createElement("style");r.textContent=n,e.head.prepend(r);const i=new MutationObserver((t=>{for(const n of t)for(const t of Array.from(n.removedNodes))if(t===r)return void e.head.prepend(r)}));return i.observe(e.head,{childList:!0}),{refCount:0,cleanup:()=>{i.disconnect(),r.remove(),t.delete(n),0===t.size&&TB.delete(e)}}},LB=function(e,t,n){!("adoptedStyleSheets"in e)||Array.isArray(e.adoptedStyleSheets);const r=e.ownerDocument.defaultView,{CSSStyleSheet:i}=null!=r?r:{};if(!i)return null;const o=new i;return o.replaceSync(n),e.adoptedStyleSheets.push(o),{refCount:0,cleanup:()=>{var r;if(SW(e)&&(null==(r=e.host)?void 0:r.isConnected)){const t=e.adoptedStyleSheets.indexOf(o);-1!==t&&e.adoptedStyleSheets.splice(t,1)}t.delete(n),0===t.size&&TB.delete(e)}}},sB(RB,4,"additionalRoots",EB,qB,IB),sB(RB,2,"sourceRoot",kB,qB),sB(RB,2,"targetRoot",CB,qB),sB(RB,2,"roots",SB,qB),oB(RB,qB);var NB="data-dnd-",jB=`${NB}dropping`,zB="--dnd-",FB=`${NB}dragging`,WB=`${NB}placeholder`,$B=[FB,WB,"popover","aria-pressed","aria-grabbing"],BB=["view-transition-name"],VB=`\n :is(:root,:host) [${FB}] {\n position: fixed !important;\n pointer-events: none !important;\n touch-action: none;\n z-index: calc(infinity);\n will-change: translate;\n top: var(${zB}top, 0px) !important;\n left: var(${zB}left, 0px) !important;\n right: unset !important;\n bottom: unset !important;\n width: var(${zB}width, auto);\n max-width: var(${zB}width, auto);\n height: var(${zB}height, auto);\n max-height: var(${zB}height, auto);\n transition: var(${zB}transition) !important;\n }\n\n :is(:root,:host) [${WB}] {\n transition: none;\n }\n\n :is(:root,:host) [${WB}='hidden'] {\n visibility: hidden;\n }\n\n [${FB}] * {\n pointer-events: none !important;\n }\n\n [${FB}]:not([${jB}]) {\n translate: var(${zB}translate) !important;\n }\n\n [${FB}][style*='${zB}scale'] {\n scale: var(${zB}scale) !important;\n transform-origin: var(${zB}transform-origin) !important;\n }\n\n @layer dnd-kit {\n :where([${FB}][popover]) {\n overflow: visible;\n background: unset;\n border: unset;\n margin: unset;\n padding: unset;\n color: inherit;\n\n &:is(input, button) {\n border: revert;\n background: revert;\n }\n }\n }\n [${FB}]::backdrop, [${NB}overlay]:not([${FB}]) {\n display: none;\n visibility: hidden;\n }\n`.replace(/\n+/g," ").replace(/\s+/g," ").trim();function HB(e,t="hidden"){return Hq((()=>{const{element:n,manager:r}=e;if(!n||!r)return;const i=function(e,t){const n=new Map;for(const r of t)if(r.element&&(e===r.element||e.contains(r.element))){const e=`${NB}${N$("dom-id")}`;r.element.setAttribute(e,""),n.set(r,e)}return n}(n,r.registry.droppables),o=[],a=function(e){const t="input, textarea, select, canvas, [contenteditable]",n=e.cloneNode(!0),r=Array.from(e.querySelectorAll(t));return Array.from(n.querySelectorAll(t)).forEach(((e,t)=>{const n=r[t];if(EW(e)&&EW(n)&&("file"!==e.type&&(e.value=n.value),"radio"===e.type&&e.name&&(e.name=`Cloned__${e.name}`)),MW(e)&&MW(n)&&n.width>0&&n.height>0){const t=e.getContext("2d");null==t||t.drawImage(n,0,0)}})),n}(n),{remove:s}=a;return function(e,t,n){for(const[r,i]of e){if(!r.element)continue;const e=`[${i}]`,o=t.matches(e)?t:t.querySelector(e);if(r.element.removeAttribute(i),!o)continue;const a=r.element;r.proxy=o,o.removeAttribute(i),RW.set(a,o),n.push((()=>{RW.delete(a),r.proxy=void 0}))}}(i,a,o),function(e,t="hidden"){e.setAttribute("inert","true"),e.setAttribute("tab-index","-1"),e.setAttribute("aria-hidden","true"),e.setAttribute(WB,t)}(a,t),a.remove=()=>{o.forEach((e=>e())),s.call(a)},a}))}function UB(e,t){return e===t||DW(e)===DW(t)}function GB(e){const{target:t}=e;"newState"in e&&"closed"===e.newState&&L$(t)&&t.hasAttribute("popover")&&requestAnimationFrame((()=>r$(t)))}function YB(e){return"TR"===e.tagName}var KB,XB,JB,QB,ZB,eV,tV,nV=250,rV="ease";var iV=class extends(XB=mz,KB=[ej],XB){constructor(e,t){super(e,t),dB(this,ZB),dB(this,QB,aB(JB,8,this)),aB(JB,11,this),this.state={initial:{},current:{}};const n=e.registry.plugins.get(qB),r=null==n?void 0:n.register(VB);if(r){const e=this.destroy.bind(this);this.destroy=()=>{r(),e()}}this.registerEffect(hB(this,ZB,eV).bind(this,n)),this.registerEffect(hB(this,ZB,tV))}};JB=tB(XB),QB=new WeakMap,ZB=new WeakSet,eV=function(e){const{overlay:t}=this;if(!t||!e)return;const n=CW(t);return n?e.addRoot(n):void 0},tV=function(){var e,t,n;const{state:r,manager:i,options:o}=this,{dragOperation:a}=i,{position:s,source:l,status:c}=a;if(c.idle)return r.current={},void(r.initial={});if(!l)return;const{element:u,feedback:d}=l;if(!u||"none"===d||!c.initialized||c.initializing)return;const{initial:f}=r,h=null!=(e=this.overlay)?e:u,p=g$(h),m=g$(u),g=!UB(u,h),y=new P$(u,{frameTransform:g?m:null,ignoreTransforms:!g}),v=m.scaleX/p.scaleX,b=m.scaleY/p.scaleY;let{width:x,height:w,top:S,left:C}=y;g&&(x/=v,w/=b);const k=new O$(h),{transition:E,translate:M,boxSizing:_,paddingBlockStart:R,paddingBlockEnd:I,paddingInlineStart:D,paddingInlineEnd:P,borderInlineStartWidth:A,borderInlineEndWidth:O,borderBlockStartWidth:L,borderBlockEndWidth:T}=f$(u),q="clone"===d,N="content-box"===_,j=N?parseInt(D)+parseInt(P)+parseInt(A)+parseInt(O):0,z=N?parseInt(R)+parseInt(I)+parseInt(L)+parseInt(T):0,F="move"===d||this.overlay?null:HB(l,q?"clone":"hidden"),W=Hq((()=>T$(i.dragOperation.activatorEvent)));if("none"!==M){const e=v$(M);e&&!f.translate&&(f.translate=e)}if(!f.transformOrigin){const e=Hq((()=>s.current));f.transformOrigin={x:(e.x-C*p.scaleX-p.x)/(x*p.scaleX),y:(e.y-S*p.scaleY-p.y)/(w*p.scaleY)}}const{transformOrigin:$}=f,B=S*p.scaleY+p.y,V=C*p.scaleX+p.x;if(!f.coordinates&&(f.coordinates={x:V,y:B},1!==v||1!==b)){const{scaleX:e,scaleY:t}=m,{x:n,y:r}=$;f.coordinates.x+=(x*e-x)*n,f.coordinates.y+=(w*t-w)*r}f.dimensions||(f.dimensions={width:x,height:w}),f.frameTransform||(f.frameTransform=p);const H=f.coordinates.x-V,U=f.coordinates.y-B,G=(f.dimensions.width*f.frameTransform.scaleX-x*p.scaleX)*$.x,Y=(f.dimensions.height*f.frameTransform.scaleY-w*p.scaleY)*$.y,K={x:H/p.scaleX+G,y:U/p.scaleY+Y},X=C+K.x,J=S+K.y;h.setAttribute(FB,"true");const Q=Hq((()=>a.transform)),Z=null!=(t=f.translate)?t:{x:0,y:0},ee=Q.x*p.scaleX+Z.x,te=Q.y*p.scaleY+Z.y,ne=wW();if(k.set({width:x-j,height:w-z,top:J+ne.y,left:X+ne.x,translate:`${ee}px ${te}px 0`,transition:E?`${E}, translate 0ms linear`:"",scale:g?`${v} ${b}`:"","transform-origin":`${100*$.x}% ${100*$.y}%`},zB),F&&(u.insertAdjacentElement("afterend",F),null==o?void 0:o.rootElement)){("function"==typeof o.rootElement?o.rootElement(l):o.rootElement).appendChild(u)}let re,ie,oe;n$(h)&&(h.hasAttribute("popover")||h.setAttribute("popover","manual"),r$(h),h.addEventListener("beforetoggle",GB));const ae=(se={placeholder:F,element:u,feedbackElement:h,frameTransform:p,transformOrigin:$,width:x,height:w,top:S,left:C,widthOffset:j,heightOffset:z,delta:K,styles:k,dragOperation:a,getElementMutationObserver:()=>re,getSavedCellWidths:()=>oe,setSavedCellWidths:e=>{oe=e}},new ResizeObserver((()=>{var e,t;const n=new P$(se.placeholder,{frameTransform:se.frameTransform,ignoreTransforms:!0}),r=null!=(e=se.transformOrigin)?e:{x:1,y:1},i=(se.width-n.width)*r.x+se.delta.x,o=(se.height-n.height)*r.y+se.delta.y,a=wW();if(se.styles.set({width:n.width-se.widthOffset,height:n.height-se.heightOffset,top:se.top+o+a.y,left:se.left+i+a.x},zB),null==(t=se.getElementMutationObserver())||t.takeRecords(),YB(se.element)&&YB(se.placeholder)){const e=Array.from(se.element.cells),t=Array.from(se.placeholder.cells);se.getSavedCellWidths()||se.setSavedCellWidths(e.map((e=>e.style.width)));for(const[n,r]of e.entries()){const e=t[n];r.style.width=`${e.getBoundingClientRect().width}px`}}se.dragOperation.shape=new P$(se.feedbackElement)})));var se;const le=new P$(h);Hq((()=>a.shape=le));const ce=uW(h),ue=e=>{this.manager.actions.stop({event:e})},de=kW(ce);W&&ce.addEventListener("resize",ue),"idle"===Hq((()=>l.status))&&requestAnimationFrame((()=>l.status="dragging")),F&&(ae.observe(F),re=function(e,t,n){const r=new MutationObserver((r=>{let i=!1;for(const n of r){if(n.target!==e){i=!0;continue}if("attributes"!==n.type)continue;const r=n.attributeName;if(r.startsWith("aria-")||$B.includes(r))continue;const o=e.getAttribute(r);if("style"===r){if(A$(e)&&A$(t)){const n=e.style;for(const e of Array.from(t.style))""===n.getPropertyValue(e)&&t.style.removeProperty(e);for(const e of Array.from(n)){if(BB.includes(e)||e.startsWith(zB))continue;const r=n.getPropertyValue(e);t.style.setProperty(e,r)}}}else null!==o?t.setAttribute(r,o):t.removeAttribute(r)}i&&n&&(t.innerHTML=e.innerHTML)}));return r.observe(e,{attributes:!0,subtree:!0,childList:!0}),r}(u,F,q),ie=function(e,t,n){const r=new MutationObserver((r=>{for(const i of r)if(0!==i.addedNodes.length)for(const r of Array.from(i.addedNodes)){if(r.contains(e)&&e.nextElementSibling!==t)return e.insertAdjacentElement("afterend",t),void r$(n);if(r.contains(t)&&t.previousElementSibling!==e)return t.insertAdjacentElement("beforebegin",e),void r$(n)}}));return r.observe(e.ownerDocument.body,{childList:!0,subtree:!0}),r}(u,F,h));const fe=null==(n=i.dragOperation.source)?void 0:n.id,he=()=>{var e;if(!W||null==fe)return;const t=i.registry.draggables.get(fe),n=null!=(e=null==t?void 0:t.handle)?e:null==t?void 0:t.element;fW(n)&&n.focus()},pe=()=>{var e;if(null==re||re.disconnect(),null==ie||ie.disconnect(),ae.disconnect(),ce.removeEventListener("resize",ue),n$(h)&&(h.removeEventListener("beforetoggle",GB),h.removeAttribute("popover")),h.removeAttribute(FB),k.reset(),oe&&YB(u)){const t=Array.from(u.cells);for(const[n,r]of t.entries())r.style.width=null!=(e=oe[n])?e:""}l.status="idle";const t=null!=r.current.translate;F&&(t||F.parentElement!==h.parentElement)&&h.isConnected&&F.replaceWith(h),null==F||F.remove()},me=null==o?void 0:o.dropAnimation,ge=this,ye=rj((()=>{var e;const{transform:t,status:n}=a;if((t.x||t.y||r.current.translate)&&n.dragging){const n=null!=(e=f.translate)?e:{x:0,y:0},i={x:t.x/p.scaleX+n.x,y:t.y/p.scaleY+n.y},o=r.current.translate,s=Hq((()=>a.modifiers)),l=Hq((()=>{var e;return null==(e=a.shape)?void 0:e.current})),c=W&&!de?"250ms cubic-bezier(0.25, 1, 0.5, 1)":"0ms linear";if(k.set({transition:`${E}, translate ${c}`,translate:`${i.x}px ${i.y}px 0`},zB),null==re||re.takeRecords(),l&&l!==le&&o&&!s.length){const e=_j.delta(i,o);a.shape=Rj.from(l.boundingRectangle).translate(e.x*p.scaleX,e.y*p.scaleY)}else a.shape=new P$(h);r.current.translate=i}}),(function(){if(a.status.dropped){this.dispose(),l.status="dropping";const e=void 0!==ge.dropAnimation?ge.dropAnimation:me;let t=r.current.translate;const n=null!=t;if(t||u===h||(t={x:0,y:0}),!t||null===e)return void pe();i.renderer.rendering.then((()=>{!function(e){var t,n,r,i;const{animation:o}=e;if("function"==typeof o){const t=o({element:e.element,feedbackElement:e.feedbackElement,placeholder:e.placeholder,translate:e.translate,moved:e.moved});return void Promise.resolve(t).then((()=>{e.cleanup(),requestAnimationFrame(e.restoreFocus)}))}const{duration:a=nV,easing:s=rV}=null!=o?o:{};r$(e.feedbackElement);const[,l]=null!=(t=aW(e.feedbackElement,(e=>"translate"in e)))?t:[];null==l||l.pause();const c=null!=(n=e.placeholder)?n:e.element,u={frameTransform:UB(e.feedbackElement,c)?null:void 0},d=new P$(e.feedbackElement,u),f=null!=(r=v$(f$(e.feedbackElement).translate))?r:e.translate,h=new P$(c,u),p=Rj.delta(d,h,e.alignment),m=f.x-p.x,g=f.y-p.y,y=Math.round(d.intrinsicHeight)!==Math.round(h.intrinsicHeight)?{minHeight:[`${d.intrinsicHeight}px`,`${h.intrinsicHeight}px`],maxHeight:[`${d.intrinsicHeight}px`,`${h.intrinsicHeight}px`]}:{},v=Math.round(d.intrinsicWidth)!==Math.round(h.intrinsicWidth)?{minWidth:[`${d.intrinsicWidth}px`,`${h.intrinsicWidth}px`],maxWidth:[`${d.intrinsicWidth}px`,`${h.intrinsicWidth}px`]}:{};e.styles.set({transition:e.transition},zB),e.feedbackElement.setAttribute(jB,""),null==(i=e.getElementMutationObserver())||i.takeRecords(),E$({element:e.feedbackElement,keyframes:Q$(J$(J$({},y),v),{translate:[`${f.x}px ${f.y}px 0`,`${m}px ${g}px 0`]}),options:{duration:kW(uW(e.feedbackElement))?0:e.moved||e.feedbackElement!==e.element?a:0,easing:s}}).then((()=>{e.feedbackElement.removeAttribute(jB),null==l||l.finish(),e.cleanup(),requestAnimationFrame(e.restoreFocus)}))}({element:u,feedbackElement:h,placeholder:F,translate:t,moved:n,transition:E,alignment:l.alignment,styles:k,animation:null!=e?e:void 0,getElementMutationObserver:()=>re,cleanup:pe,restoreFocus:he})}))}}));return()=>{pe(),ye()}},sB(JB,4,"overlay",KB,iV,QB),oB(JB,iV),iV.configure=hz(iV);var oV,aV,sV,lV,cV,uV,dV,fV=iV,hV=!0;sV=[ej],lV=x$.Forward,oV=[ej],aV=x$.Reverse;var pV=class{constructor(){dB(this,uV,aB(cV,8,this,hV)),aB(cV,11,this),dB(this,dV,aB(cV,12,this,hV)),aB(cV,15,this)}isLocked(e){return e!==x$.Idle&&(null==e?this[x$.Forward]===hV&&this[x$.Reverse]===hV:this[e]===hV)}unlock(e){e!==x$.Idle&&(this[e]=false)}};cV=tB(null),uV=new WeakMap,dV=new WeakMap,sB(cV,4,lV,sV,pV,uV),sB(cV,4,aV,oV,pV,dV),oB(cV,pV);var mV,gV,yV,vV,bV,xV,wV=[x$.Forward,x$.Reverse],SV=class{constructor(){this.x=new pV,this.y=new pV}isLocked(){return this.x.isLocked()&&this.y.isLocked()}},CV=class extends mz{constructor(e){super(e);const t=Qq(new SV);let n=null;this.signal=t,lN((()=>{const{status:r}=e.dragOperation;if(!r.initialized)return n=null,void(t.value=new SV);const{delta:i}=e.dragOperation.position;if(n){const e={x:kV(i.x,n.x),y:kV(i.y,n.y)},r=t.peek();Bq((()=>{for(const t of Nj)for(const n of wV)e[t]===n&&r[t].unlock(n);t.value=r}))}n=i}))}get current(){return this.signal.peek()}};function kV(e,t){return Math.sign(e-t)}var EV=class extends(gV=yz,mV=[ej],gV){constructor(e){super(e),dB(this,vV,aB(yV,8,this,!1)),aB(yV,11,this),dB(this,bV),dB(this,xV,(()=>{if(!uB(this,bV))return;const{element:e,by:t}=uB(this,bV);t.y&&(e.scrollTop+=t.y),t.x&&(e.scrollLeft+=t.x)})),this.scroll=e=>{var t;if(this.disabled)return!1;const n=this.getScrollableElements();if(!n)return fB(this,bV,void 0),!1;const{position:r}=this.manager.dragOperation,i=null==r?void 0:r.current;if(i){const{by:r}=null!=e?e:{},o=r?{x:MV(r.x),y:MV(r.y)}:void 0,a=o?void 0:this.scrollIntentTracker.current;if(null==a?void 0:a.isLocked())return!1;for(const e of n){const n=a$(e,r);if(n.x||n.y){const{speed:n,direction:s}=C$(e,i,o);if(a)for(const e of Nj)a[e].isLocked(s[e])&&(n[e]=0,s[e]=0);if(s.x||s.y){const{x:i,y:o}=null!=r?r:s,a=i*n.x,l=o*n.y;if(a||l){const n=null==(t=uB(this,bV))?void 0:t.by;if(this.autoScrolling&&n){if(n.x&&!a||n.y&&!l)continue}return fB(this,bV,{element:e,by:{x:a,y:l}}),l$.schedule(uB(this,xV)),!0}}}}}return fB(this,bV,void 0),!1};let t=null,n=null;const r=QN((()=>{const{position:n,source:r}=e.dragOperation;if(!n)return null;const i=_W(CW(null==r?void 0:r.element),n.current);return i&&(t=i),null!=i?i:t})),i=QN((()=>{const t=r.value,{documentElement:i}=pW(t);if(!t||t===i){const{target:t}=e.dragOperation,r=null==t?void 0:t.element;if(r){const e=m$(r,{excludeElement:!1});return n=e,e}}if(t){const e=m$(t,{excludeElement:!1});return this.autoScrolling&&n&&e.size<(null==n?void 0:n.size)?n:(n=e,e)}return n=null,null}),ZN);this.getScrollableElements=()=>i.value,this.scrollIntentTracker=new CV(e),this.destroy=e.monitor.addEventListener("dragmove",(t=>{!this.disabled&&!t.defaultPrevented&&T$(e.dragOperation.activatorEvent)&&t.by&&this.scroll({by:t.by})&&t.preventDefault()}))}};function MV(e){return e>0?x$.Forward:e<0?x$.Reverse:x$.Idle}yV=tB(gV),vV=new WeakMap,bV=new WeakMap,xV=new WeakMap,sB(yV,4,"autoScrolling",mV,EV,vV),oB(yV,EV);var _V,RV=new class{constructor(e){this.scheduler=e,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{const{tasks:e,resolvers:t}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(const t of e)t();for(const e of t)e()}}schedule(e){return this.tasks.add(e),this.pending||(this.pending=!0,this.scheduler(this.flush)),new Promise((e=>this.resolvers.add(e)))}}((e=>{"function"==typeof requestAnimationFrame?requestAnimationFrame(e):e()})),IV=class extends mz{constructor(e,t){super(e);const n=e.registry.plugins.get(EV);if(!n)throw new Error("AutoScroller plugin depends on Scroller plugin");this.destroy=lN((()=>{if(this.disabled)return;const{position:t,status:r}=e.dragOperation;if(r.dragging){if(n.scroll()){n.autoScrolling=!0;const e=setInterval((()=>RV.schedule(n.scroll)),10);return()=>{clearInterval(e)}}n.autoScrolling=!1}}))}},DV={capture:!0,passive:!0},PV=class extends yz{constructor(e){super(e),dB(this,_V),this.handleScroll=()=>{null==uB(this,_V)&&fB(this,_V,setTimeout((()=>{this.manager.collisionObserver.forceUpdate(!1),fB(this,_V,void 0)}),50))};const{dragOperation:t}=this.manager;this.destroy=lN((()=>{var e,n,r;if(t.status.dragging){const i=null!=(r=null==(n=null==(e=t.source)?void 0:e.element)?void 0:n.ownerDocument)?r:document;return i.addEventListener("scroll",this.handleScroll,DV),()=>{i.removeEventListener("scroll",this.handleScroll,DV)}}}))}};_V=new WeakMap;function AV(){var e;null==(e=document.getSelection())||e.removeAllRanges()}var OV,LV=Object.freeze({offset:10,keyboardCodes:{start:["Space","Enter"],cancel:["Escape"],end:["Space","Enter","Tab"],up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]},preventActivation(e,t){var n;const r=null!=(n=t.handle)?n:t.element;return e.target!==r}}),TV=class extends EF{constructor(e,t){super(e),this.manager=e,this.options=t,dB(this,OV,[]),this.listeners=new IW,this.handleSourceKeyDown=(e,t,n)=>{if(this.disabled||e.defaultPrevented)return;if(!L$(e.target))return;if(t.disabled)return;const{keyboardCodes:r=LV.keyboardCodes,preventActivation:i=LV.preventActivation}=null!=n?n:{};r.start.includes(e.code)&&this.manager.dragOperation.status.idle&&((null==i?void 0:i(e,t))||this.handleStart(e,t,n))}}bind(e,t=this.options){const n=lN((()=>{var n;const r=null!=(n=e.handle)?n:e.element,i=n=>{T$(n)&&this.handleSourceKeyDown(n,e,t)};if(r)return r.addEventListener("keydown",i),()=>{r.removeEventListener("keydown",i)}}));return n}handleStart(e,t,n){const{element:r}=t;if(!r)throw new Error("Source draggable does not have an associated element");e.preventDefault(),e.stopImmediatePropagation(),k$(r);const{center:i}=new P$(r);if(this.manager.actions.start({event:e,coordinates:{x:i.x,y:i.y},source:t}).signal.aborted)return this.cleanup();this.sideEffects();const o=pW(r),a=[this.listeners.bind(o,[{type:"keydown",listener:e=>this.handleKeyDown(e,t,n),options:{capture:!0}}])];uB(this,OV).push(...a)}handleKeyDown(e,t,n){const{keyboardCodes:r=LV.keyboardCodes}=null!=n?n:{};if(jV(e,[...r.end,...r.cancel])){e.preventDefault();const t=jV(e,r.cancel);this.handleEnd(e,t)}else jV(e,r.up)?this.handleMove("up",e):jV(e,r.down)&&this.handleMove("down",e),jV(e,r.left)?this.handleMove("left",e):jV(e,r.right)&&this.handleMove("right",e)}handleEnd(e,t){this.manager.actions.stop({event:e,canceled:t}),this.cleanup()}handleMove(e,t){var n,r;const{shape:i}=this.manager.dragOperation,o=t.shiftKey?5:1;let a={x:0,y:0},s=null!=(r=null==(n=this.options)?void 0:n.offset)?r:LV.offset;if("number"==typeof s&&(s={x:s,y:s}),i){switch(e){case"up":a={x:0,y:-s.y*o};break;case"down":a={x:0,y:s.y*o};break;case"left":a={x:-s.x*o,y:0};break;case"right":a={x:s.x*o,y:0}}(a.x||a.y)&&(t.preventDefault(),this.manager.actions.move({event:t,by:a}))}}sideEffects(){const e=this.manager.registry.plugins.get(IV);!1===(null==e?void 0:e.disabled)&&(e.disable(),uB(this,OV).push((()=>{e.enable()})))}cleanup(){uB(this,OV).forEach((e=>e())),fB(this,OV,[])}destroy(){this.cleanup(),this.listeners.clear()}};OV=new WeakMap,TV.configure=hz(TV),TV.defaults=LV;var qV,NV=TV;function jV(e,t){return t.includes(e.code)}var zV,FV;qV=new WeakMap;zV=new WeakMap,FV=new WeakMap;var WV=class{};WV.Delay=class extends _F{constructor(){super(...arguments),dB(this,zV),dB(this,FV)}onEvent(e){switch(e.type){case"pointerdown":fB(this,FV,yW(e)),fB(this,zV,setTimeout((()=>this.activate(e)),this.options.value));break;case"pointermove":if(!uB(this,FV))return;const{x:t,y:n}=yW(e);Pj({x:t-uB(this,FV).x,y:n-uB(this,FV).y},this.options.tolerance)&&this.abort();break;case"pointerup":this.abort()}}abort(){uB(this,zV)&&(clearTimeout(uB(this,zV)),fB(this,FV,void 0),fB(this,zV,void 0))}},WV.Distance=class extends _F{constructor(){super(...arguments),dB(this,qV)}onEvent(e){switch(e.type){case"pointerdown":fB(this,qV,yW(e));break;case"pointermove":if(!uB(this,qV))return;const{x:t,y:n}=yW(e),r={x:t-uB(this,qV).x,y:n-uB(this,qV).y},{tolerance:i}=this.options;if(i&&Pj(r,i))return void this.abort();Pj(r,this.options.value)&&this.activate(e);break;case"pointerup":this.abort()}}abort(){fB(this,qV,void 0)}};var $V,BV=Object.freeze({activationConstraints(e,t){var n;const{pointerType:r,target:i}=e;if("mouse"!==r||!L$(i)||t.handle!==i&&!(null==(n=t.handle)?void 0:n.contains(i)))return"touch"===r?[new WV.Delay({value:250,tolerance:5})]:function(e){if(!L$(e))return!1;const{tagName:t}=e;return"INPUT"===t||"TEXTAREA"===t||(n=e).hasAttribute("contenteditable")&&"false"!==n.getAttribute("contenteditable");var n}(i)&&!e.defaultPrevented?[new WV.Delay({value:200,tolerance:0})]:[new WV.Delay({value:200,tolerance:10}),new WV.Distance({value:5})]},preventActivation(e,t){var n;const{target:r}=e;return r!==t.element&&(r!==t.handle&&(!!L$(r)&&(!(null==(n=t.handle)?void 0:n.contains(r))&&Boolean(r.closest('\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n a[href],\n [contenteditable]:not([contenteditable="false"])\n ')))))}}),VV=class extends EF{constructor(e,t){super(e),this.manager=e,this.options=t,dB(this,$V,new Set),this.listeners=new IW,this.latest={event:void 0,coordinates:void 0},this.handleMove=()=>{const{event:e,coordinates:t}=this.latest;e&&t&&this.manager.actions.move({event:e,to:t})},this.handleCancel=this.handleCancel.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}activationConstraints(e,t,n=this.options){const{activationConstraints:r=BV.activationConstraints}=null!=n?n:{};return"function"==typeof r?r(e,t):r}bind(e,t=this.options){const n=lN((()=>{var n;const r=new AbortController,{signal:i}=r,o=n=>{(function(e){if(!e)return!1;const{PointerEvent:t}=uW(e.target);return e instanceof t})(n)&&this.handlePointerDown(n,e,t)};let a=[null!=(n=e.handle)?n:e.element];(null==t?void 0:t.activatorElements)&&(a=Array.isArray(t.activatorElements)?t.activatorElements:t.activatorElements(e));for(const e of a)e&&(KV(e.ownerDocument.defaultView),e.addEventListener("pointerdown",o,{signal:i}));return()=>r.abort()}));return n}handlePointerDown(e,t,n){if(this.disabled||!e.isPrimary||0!==e.button||!L$(e.target)||t.disabled||function(e){return"sensor"in e}(e)||!this.manager.dragOperation.status.idle)return;const{preventActivation:r=BV.preventActivation}=null!=n?n:{};if(null==r?void 0:r(e,t))return;const{target:i}=e,o=fW(i)&&i.draggable&&"true"===i.getAttribute("draggable"),a=g$(t.element),{x:s,y:l}=yW(e);this.initialCoordinates={x:s*a.scaleX+a.x,y:l*a.scaleY+a.y};const c=this.activationConstraints(e,t,n);e.sensor=this;const u=new MF(c,(e=>this.handleStart(t,e)));u.signal.onabort=()=>this.handleCancel(e),u.onEvent(e),this.controller=u;const d=bW(),f=this.listeners.bind(d,[{type:"pointermove",listener:e=>this.handlePointerMove(e,t)},{type:"pointerup",listener:this.handlePointerUp,options:{capture:!0}},{type:"pointercancel",listener:this.handleCancel},{type:"dragstart",listener:o?this.handleCancel:UV,options:{capture:!0}}]);uB(this,$V).add((()=>{f(),this.initialCoordinates=void 0}))}handlePointerMove(e,t){var n,r;if(!1!==(null==(n=this.controller)?void 0:n.activated)){if(this.manager.dragOperation.status.dragging){const n=yW(e),r=g$(t.element);n.x=n.x*r.scaleX+r.x,n.y=n.y*r.scaleY+r.y,e.preventDefault(),e.stopPropagation(),this.latest.event=e,this.latest.coordinates=n,l$.schedule(this.handleMove)}}else null==(r=this.controller)||r.onEvent(e)}handlePointerUp(e){const{status:t}=this.manager.dragOperation;if(!t.idle){e.preventDefault(),e.stopPropagation();const n=!t.initialized;this.manager.actions.stop({event:e,canceled:n})}this.cleanup()}handleKeyDown(e){"Escape"===e.key&&(e.preventDefault(),this.handleCancel(e))}handleStart(e,t){const{manager:n,initialCoordinates:r}=this;if(!r||!n.dragOperation.status.idle)return;if(t.defaultPrevented)return;if(n.actions.start({coordinates:r,event:t,source:e}).signal.aborted)return this.cleanup();t.preventDefault();const i=pW(t.target).body;i.setPointerCapture(t.pointerId);const o=L$(t.target)?[t.target,i]:i,a=this.listeners.bind(o,[{type:"touchmove",listener:UV,options:{passive:!1}},{type:"click",listener:UV},{type:"contextmenu",listener:UV},{type:"keydown",listener:this.handleKeyDown}]);uB(this,$V).add(a)}handleCancel(e){const{dragOperation:t}=this.manager;t.status.initialized&&this.manager.actions.stop({event:e,canceled:!0}),this.cleanup()}cleanup(){this.latest={event:void 0,coordinates:void 0},uB(this,$V).forEach((e=>e())),uB(this,$V).clear()}destroy(){this.cleanup(),this.listeners.clear()}};$V=new WeakMap,VV.configure=hz(VV),VV.defaults=BV;var HV=VV;function UV(e){e.preventDefault()}function GV(){}var YV=new WeakSet;function KV(e){e&&!YV.has(e)&&(e.addEventListener("touchmove",GV,{capture:!1,passive:!1}),YV.add(e))}var XV,JV,QV,ZV,eH,tH,nH,rH,iH,oH,aH,sH,lH,cH,uH,dH,fH,hH,pH={modifiers:[],plugins:[class extends mz{constructor(e,t){super(e);const{id:n,idPrefix:{description:r=gB,announcement:i=yB}={},announcements:o=bB,screenReaderInstructions:a=vB,debounce:s=500}=null!=t?t:{},l=n?`${r}-${n}`:N$(r),c=n?`${i}-${n}`:N$(i);let u,d,f,h;const p=(e=h)=>{f&&e&&(null==f?void 0:f.nodeValue)!==e&&(f.nodeValue=e)},m=()=>l$.schedule(p),g=function(e,t){let n;const r=()=>{clearTimeout(n),n=setTimeout(e,t)};return r.cancel=()=>clearTimeout(n),r}(m,s),y=Object.entries(o).map((([e,t])=>this.manager.monitor.addEventListener(e,((n,r)=>{const i=f;if(!i)return;const o=null==t?void 0:t(n,r);o&&i.nodeValue!==o&&(h=o,wB.includes(e)?g():(m(),g.cancel()))})))),v=()=>{let e=[];(null==u?void 0:u.isConnected)||(u=function(e,t){const n=document.createElement("div");return n.id=e,n.style.setProperty("display","none"),n.textContent=t,n}(l,a.draggable),e.push(u)),(null==d?void 0:d.isConnected)||(d=function(e){const t=document.createElement("div");return t.id=e,t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),t.style.setProperty("position","fixed"),t.style.setProperty("width","1px"),t.style.setProperty("height","1px"),t.style.setProperty("margin","-1px"),t.style.setProperty("border","0"),t.style.setProperty("padding","0"),t.style.setProperty("overflow","hidden"),t.style.setProperty("clip","rect(0 0 0 0)"),t.style.setProperty("clip-path","inset(100%)"),t.style.setProperty("white-space","nowrap"),t}(c),f=document.createTextNode(""),d.appendChild(f),e.push(d)),e.length>0&&document.body.append(...e)},b=new Set;function x(){for(const e of b)e()}this.registerEffect((()=>{var e;b.clear();for(const t of this.manager.registry.draggables.value){const n=null!=(e=t.handle)?e:t.element;if(n){u&&d||b.add(v),xB(n)&&!xW()||n.hasAttribute("tabindex")||b.add((()=>n.setAttribute("tabindex","0"))),n.hasAttribute("role")||"button"===n.tagName.toLowerCase()||b.add((()=>n.setAttribute("role",pB))),n.hasAttribute("aria-roledescription")||b.add((()=>n.setAttribute("aria-roledescription",mB))),n.hasAttribute("aria-describedby")||b.add((()=>n.setAttribute("aria-describedby",l)));for(const e of["aria-pressed","aria-grabbed"]){const r=String(t.isDragging);n.getAttribute(e)!==r&&b.add((()=>n.setAttribute(e,r)))}const e=String(t.disabled);n.getAttribute("aria-disabled")!==e&&b.add((()=>n.setAttribute("aria-disabled",e)))}}b.size>0&&l$.schedule(x)})),this.destroy=()=>{super.destroy(),null==u||u.remove(),null==d||d.remove(),y.forEach((e=>e()))}}},IV,class extends mz{constructor(e,t){super(e,t),this.manager=e;const n=QN((()=>{var e;return pW(null==(e=this.manager.dragOperation.source)?void 0:e.element)}));this.destroy=lN((()=>{var e;const{dragOperation:t}=this.manager,{cursor:r="grabbing",nonce:i}=null!=(e=this.options)?e:{};if(t.status.initialized){const e=n.value,t=e.createElement("style");return i&&t.setAttribute("nonce",i),t.textContent=`* { cursor: ${r} !important; }`,e.head.appendChild(t),()=>t.remove()}}))}},fV,class extends mz{constructor(e,t){super(e,t),this.manager=e,this.destroy=lN((()=>{var e;const{dragOperation:t}=this.manager,{nonce:n}=null!=(e=this.options)?e:{};if(t.status.initialized){const e=document.createElement("style");return n&&e.setAttribute("nonce",n),e.textContent="* { user-select: none !important; -webkit-user-select: none !important; }",document.head.appendChild(e),AV(),document.addEventListener("selectionchange",AV,{capture:!0}),()=>{document.removeEventListener("selectionchange",AV,{capture:!0}),e.remove()}}}))}}],sensors:[HV,NV]},mH=class extends QF{constructor(e={}){const t=JF(e.plugins,pH.plugins),n=JF(e.sensors,pH.sensors),r=JF(e.modifiers,pH.modifiers);super(Q$(J$({},e),{plugins:[PV,EV,qB,...t],sensors:n,modifiers:r}))}},gH=class extends(ZV=SF,QV=[ej],JV=[ej],XV=[ej],ZV){constructor(e,t){var n=e,{element:r,effects:i=()=>[],handle:o,feedback:a="default"}=n,s=eB(n,["element","effects","handle","feedback"]);super(J$({effects:()=>[...i(),()=>{var e,t;const{manager:n}=this;if(!n)return;const r=(null!=(t=null==(e=this.sensors)?void 0:e.map(pz))?t:[...n.sensors]).map((e=>{const t=e instanceof EF?e:n.registry.register(e.plugin),r=e instanceof EF?void 0:e.options;return t.bind(this,r)}));return function(){r.forEach((e=>e()))}}]},s),t),dB(this,tH,aB(eH,8,this)),aB(eH,11,this),dB(this,nH,aB(eH,12,this)),aB(eH,15,this),dB(this,rH,aB(eH,16,this)),aB(eH,19,this),this.element=r,this.handle=o,this.feedback=a}};eH=tB(ZV),tH=new WeakMap,nH=new WeakMap,rH=new WeakMap,sB(eH,4,"handle",QV,gH,tH),sB(eH,4,"element",JV,gH,nH),sB(eH,4,"feedback",XV,gH,rH),oB(eH,gH);var yH=class extends(aH=CF,oH=[ej],iH=[ej],aH){constructor(e,t){var n=e,{element:r,effects:i=()=>[]}=n,o=eB(n,["element","effects"]);const{collisionDetector:a=j$}=o,s=e=>{const{manager:t,element:n}=this;if(!n||null===e)return void(this.shape=void 0);if(!t)return;const r=new P$(n),i=Hq((()=>this.shape));return r&&(null==i?void 0:i.equals(r))?i:(this.shape=r,r)},l=Qq(!1);super(Q$(J$({},o),{collisionDetector:a,effects:()=>[...i(),()=>{const{element:e,manager:t}=this;if(!t)return;const{dragOperation:n}=t,{source:r}=n;l.value=Boolean(r&&n.status.initialized&&e&&!this.disabled&&this.accepts(r))},()=>{const{element:e}=this;if(l.value&&e){const t=new t$(e,s);return()=>{t.disconnect(),this.shape=void 0}}},()=>{var e;if(null==(e=this.manager)?void 0:e.dragOperation.status.initialized)return()=>{this.shape=void 0}}]}),t),dB(this,fH),dB(this,lH,aB(sH,8,this)),aB(sH,11,this),dB(this,hH,aB(sH,12,this)),aB(sH,15,this),this.element=r,this.refreshShape=()=>s()}set element(e){fB(this,fH,e,dH)}get element(){var e;return null!=(e=this.proxy)?e:uB(this,fH,uH)}};function vH(e){var t;if(null!=e)return function(e){return null!=e&&"object"==typeof e&&"current"in e}(e)?null!=(t=e.current)?t:void 0:e}sH=tB(aH),lH=new WeakMap,fH=new WeakSet,hH=new WeakMap,cH=sB(sH,20,"#element",oH,fH,lH),uH=cH.get,dH=cH.set,sB(sH,4,"proxy",iH,yH,hH),oB(sH,yH);var bH="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?_e.useLayoutEffect:_e.useEffect;function xH(){const e=_e.useState(0)[1];return _e.useCallback((()=>{e((e=>e+1))}),[e])}function wH(e,t=[],n=!1){const r=_e.useRef(e);return r.current=e,function(e,t=!1){const n=_e.useRef(e.peek()),r=_e.useRef(!1),i=xH();return bH((()=>lN((()=>{const o=n.current,a=e.value;if(o!==a){if(n.current=a,!r.current)return;t?xb.flushSync(i):i()}}))),[e,t,i]),{get value(){return r.current=!0,e.peek()}}}(_e.useMemo((()=>QN((()=>r.current()))),t),n)}function SH(e,t){const n=_e.useRef(new Map),r=xH();return bH((()=>{if(e)return lN((()=>{var i;let o=!1,a=!1;for(const r of n.current){const[s]=r,l=Hq((()=>r[1])),c=e[s];l!==c&&(o=!0,n.current.set(s,c),a=null!=(i=null==t?void 0:t(s,l,c))&&i)}o&&(a?xb.flushSync(r):r())}));n.current.clear()}),[e]),_e.useMemo((()=>e?new Proxy(e,{get(e,t){const r=e[t];return n.current.set(t,r),r}}):e),[e])}function CH(e,t){e()}function kH(e){const t=_e.useRef(e);return bH((()=>{t.current=e}),[e]),t}function EH(e,t,n=_e.useEffect,r=Object.is){const i=_e.useRef(e);n((()=>{const n=i.current;r(e,n)||(i.current=e,t(e,n))}),[t,e])}function MH(e,t){const n=_e.useRef(vH(e));bH((()=>{const r=vH(e);r!==n.current&&(n.current=r,t(r))}))}var _H=Object.defineProperty,RH=Object.defineProperties,IH=Object.getOwnPropertyDescriptors,DH=Object.getOwnPropertySymbols,PH=Object.prototype.hasOwnProperty,AH=Object.prototype.propertyIsEnumerable,OH=(e,t,n)=>t in e?_H(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,LH=new mH,TH=_e.createContext(LH),qH=_e.memo(_e.forwardRef((({children:e},t)=>{const[n,r]=_e.useState(0),i=_e.useRef(null),o=_e.useRef(null),a=_e.useMemo((()=>({renderer:{get rendering(){var e;return null!=(e=i.current)?e:Promise.resolve()}},trackRendering(e){i.current||(i.current=new Promise((e=>{o.current=e}))),_e.startTransition((()=>{e(),r((e=>e+1))}))}})),[]);return bH((()=>{var e;null==(e=o.current)||e.call(o),i.current=null}),[e,n]),_e.useImperativeHandle(t,(()=>a)),null}))),NH=[void 0,ZN];function jH(e){var t=e,{children:n,onCollision:r,onBeforeDragStart:i,onDragStart:o,onDragMove:a,onDragOver:s,onDragEnd:l}=t,c=((e,t)=>{var n={};for(var r in e)PH.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&DH)for(var r of DH(e))t.indexOf(r)<0&&AH.call(e,r)&&(n[r]=e[r]);return n})(t,["children","onCollision","onBeforeDragStart","onDragStart","onDragMove","onDragOver","onDragEnd"]);const u=_e.useRef(null),{plugins:d,modifiers:f,sensors:h}=c,p=JF(d,pH.plugins),m=JF(h,pH.sensors),g=JF(f,pH.modifiers),y=kH(i),v=kH(o),b=kH(s),x=kH(a),w=kH(l),S=kH(r),C=function(e){const t=_e.useRef(null);t.current||(t.current=e());return _e.useInsertionEffect((()=>()=>{var e;return null==(e=t.current)?void 0:e.destroy()}),[]),t.current}((()=>{var e;return null!=(e=c.manager)?e:new mH(c)}));return _e.useEffect((()=>{if(!u.current)throw new Error("Renderer not found");const{renderer:e,trackRendering:t}=u.current,{monitor:n}=C;C.renderer=e;const r=[n.addEventListener("beforedragstart",(e=>{const n=y.current;n&&t((()=>n(e,C)))})),n.addEventListener("dragstart",(e=>{var t;return null==(t=v.current)?void 0:t.call(v,e,C)})),n.addEventListener("dragover",(e=>{const n=b.current;n&&t((()=>n(e,C)))})),n.addEventListener("dragmove",(e=>{const n=x.current;n&&t((()=>n(e,C)))})),n.addEventListener("dragend",(e=>{const n=w.current;n&&t((()=>n(e,C)))})),n.addEventListener("collision",(e=>{var t;return null==(t=S.current)?void 0:t.call(S,e,C)}))];return()=>r.forEach((e=>e()))}),[C]),EH(p,(()=>C&&(C.plugins=p)),...NH),EH(m,(()=>C&&(C.sensors=m)),...NH),EH(g,(()=>C&&(C.modifiers=g)),...NH),Yi.jsxs(TH.Provider,{value:C,children:[Yi.jsx(qH,{ref:u,children:n}),n]})}function zH(){return _e.useContext(TH)}function FH(e){var t;const n=null!=(t=zH())?t:void 0,[r]=_e.useState((()=>e(n)));return r.manager!==n&&(r.manager=n),bH(r.register,[n,r]),r}function WH({children:e,className:t,dropAnimation:n,style:r,tag:i,disabled:o}){var a;const s=_e.useRef(null),l=zH(),c=null!=(a=wH((()=>null==l?void 0:l.dragOperation.source),[l]).value)?a:null,u="function"==typeof o?o(c):o;_e.useEffect((()=>{if(!s.current||!l||u)return;const e=l.plugins.find((e=>e instanceof fV));return e?(e.overlay=s.current,()=>{e.overlay=void 0}):void 0}),[l,u]),_e.useEffect((()=>{if(!l)return;const e=l.plugins.find((e=>e instanceof fV));return e?(e.dropAnimation=n,()=>{e.dropAnimation=void 0}):void 0}),[l,n]);const d=_e.useMemo((()=>{if(!l)return null;const e=new Proxy(l.registry,{get:(e,t)=>"register"===t||"unregister"===t?$H:e[t]});return new Proxy(l,{get:(t,n)=>"registry"===n?e:t[n]})}),[l]);return Yi.jsx(TH.Provider,{value:d,children:_e.createElement(i||"div",{ref:s,className:t,style:r,"data-dnd-overlay":!0},function(){if(!c||u)return null;if("function"==typeof e)return Yi.jsx(BH,{source:c,children:e});return e}())})}function $H(){return()=>{}}function BH({children:e,source:t}){return e(SH(t))}var VH,HH,UH,GH,YH,KH=Object.create,XH=Object.defineProperty,JH=Object.getOwnPropertyDescriptor,QH=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),ZH=e=>{throw TypeError(e)},eU=["class","method","getter","setter","accessor","field","value","get","set"],tU=e=>void 0!==e&&"function"!=typeof e?ZH("Function expected"):e,nU=(e,t,n,r,i)=>({kind:eU[e],name:t,metadata:r,addInitializer:e=>n._?ZH("Already initialized"):i.push(tU(e||null))}),rU=(e,t,n,r,i,o)=>{for(var a,s,l,c,u=7&t,d=eU[u+5],f=e[2]||(e[2]=[]),h=(i=i.prototype,JH(i,n)),p=r.length-1;p>=0;p--)(l=nU(u,n,s={},e[3],f)).static=false,l.private=false,c=l.access={has:e=>n in e},c.get=e=>e[n],a=(0,r[p])(h[d],l),s._=1,tU(a)&&(h[d]=a);return h&&XH(i,n,h),i},iU=(e,t,n)=>t.has(e)||ZH("Cannot "+n),oU=class e{constructor(e,t){this.x=e,this.y=t}static delta(t,n){return new e(t.x-n.x,t.y-n.y)}static distance(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}static equals(e,t){return e.x===t.x&&e.y===t.y}static from({x:t,y:n}){return new e(t,n)}},aU=class extends(UH=oj,HH=[tj],VH=[tj],UH){constructor(e){super(oU.from(e),((e,t)=>oU.equals(e,t))),((e,t,n)=>{for(var r=0,i=e[t>>1],o=i&&i.length;r<o;r++)i[r].call(n)})(YH,5,this),((e,t,n)=>{t.has(e)?ZH("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n)})(this,GH,0),this.velocity={x:0,y:0}}get delta(){return oU.delta(this.current,this.initial)}get direction(){const{current:e,previous:t}=this;if(!t)return null;const n={x:e.x-t.x,y:e.y-t.y};return n.x||n.y?Math.abs(n.x)>Math.abs(n.y)?n.x>0?"right":"left":n.y>0?"down":"up":null}get current(){return super.current}set current(e){const{current:t}=this,n=oU.from(e),r={x:n.x-t.x,y:n.y-t.y},i=Date.now(),o=i-(iU(a=this,s=GH,"read from private field"),s.get(a));var a,s;const l=e=>Math.round(e/o*100);Bq((()=>{((e,t,n)=>{iU(e,t,"write to private field"),t.set(e,n)})(this,GH,i),this.velocity={x:l(r.x),y:l(r.y)},super.current=n}))}reset(e=this.defaultValue){super.reset(oU.from(e)),this.velocity={x:0,y:0}}};YH=(e=>{var t;return[,,,KH(null!=(t=null==e?void 0:e[QH("metadata")])?t:null)]})(UH),GH=new WeakMap,rU(YH,2,"delta",HH,aU),rU(YH,2,"direction",VH,aU),((e,t)=>{((e,t,n)=>{t in e?XH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(t,QH("metadata"),e[3])})(YH,aU);var sU=(e=>(e.Horizontal="x",e.Vertical="y",e))(sU||{});Object.values(sU);var lU=e=>{var t;return null!=(t=(({dragOperation:e,droppable:t})=>{const n=e.position.current;if(!n)return null;const{id:r}=t;if(!t.shape)return null;if(t.shape.containsPoint(n))return{id:r,value:1/oU.distance(t.shape.center,n),type:jz.PointerIntersection,priority:Nz.High};return null})(e))?t:(({dragOperation:e,droppable:t})=>{const{shape:n}=e;if(!t.shape||!(null==n?void 0:n.current))return null;const r=n.current.intersectionArea(t.shape);if(r){const{position:i}=e,o=oU.distance(t.shape.center,i.current),a=r/(n.current.area+t.shape.area-r)/o;return{id:t.id,value:a,type:jz.ShapeIntersection,priority:Nz.Normal}}return null})(e)};function cU(e){const{collisionDetector:t,data:n,disabled:r,element:i,id:o,accept:a,type:s}=e,l=FH((t=>new yH(((e,t)=>RH(e,IH(t)))(((e,t)=>{for(var n in t||(t={}))PH.call(t,n)&&OH(e,n,t[n]);if(DH)for(var n of DH(t))AH.call(t,n)&&OH(e,n,t[n]);return e})({},e),{register:!1,element:vH(i)}),t))),c=SH(l);return EH(o,(()=>l.id=o)),MH(i,(e=>l.element=e)),EH(a,(()=>l.accept=a),void 0,ZN),EH(t,(()=>l.collisionDetector=null!=t?t:lU)),EH(n,(()=>n&&(l.data=n))),EH(r,(()=>l.disabled=!0===r)),EH(s,(()=>l.type=s)),{droppable:c,get isDropTarget(){return c.isDropTarget},ref:_e.useCallback((e=>{var t,n;(e||!(null==(t=l.element)?void 0:t.isConnected)||(null==(n=l.manager)?void 0:n.dragOperation.status.idle))&&(l.element=null!=e?e:void 0)}),[l])}}const uU=e=>Array.from({length:e},((e,t)=>t)),dU=({id:e,sectionIndex:t,itemIndex:n})=>Yi.jsx("span",{children:`${e}-${t}-${n}`}),fU=Re.memo((()=>{const e=kO(Aq)??dU,{startSectionIndex:t,startIndex:n,id:r}=kO(qq)??{};return"number"!=typeof t||"number"!=typeof n||void 0===r?null:Yi.jsx(WH,{dropAnimation:null,children:Yi.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px",background:"white",boxShadow:"0px 4px 10px 0px rgba(0, 0, 0, 0.15)",borderRadius:"4px",border:"1px solid rgba(0, 0, 0, 0.15)",width:"208px",maxHeight:"32px",fontSize:"12px",lineHeight:"16px"},children:Yi.jsx(e,{id:r,sectionIndex:t,itemIndex:n})})})})),hU=({sectionIndex:e,itemIndex:t,isDragging:n})=>{const r=kO(qq),i=r?.toSectionIndex===e,o=r?.startSectionIndex===e,a=t>(r?.startIndex??t)&&e===r?.startSectionIndex?t-1:t;let s=!1;return o&&r.startIndex===a?s=!1:i&&r.toIndex===a&&(s=!0),Yi.jsx("div",{"data-key":"drop-target-indicator",style:{visibility:s&&!n?"visible":"hidden",padding:0,background:"rgba(64, 64, 64, 1)",borderRadius:2,marginLeft:"4px",width:"calc(100% - 8px)",height:"2px"}})},pU=(e,t)=>e?"2px solid rgba(0, 135, 61, 1)":t?"1px dashed rgba(0, 0, 0, 0.43)":void 0,mU=Re.memo((({sectionIndex:e})=>{const t=kO(Eq)[e],n=kO(Mq),r=kO(_q),i=null!==kO(qq),o=r(e),a=n({sectionIndex:e}),{ref:s,isDropTarget:l}=cU({id:a,type:"section",accept:"item",collisionPriority:Nz.Low,data:{id:a,sectionIndex:e,sectionKey:a}});return!l&&t>0?null:Yi.jsxs(Xx,{ref:s,sx:{margin:"4px",outline:pU(l,i),borderRadius:"4px",boxSizing:"border-box"},children:[Yi.jsx(Xx,{sx:{position:"relative",top:"4px"},children:Yi.jsx(hU,{sectionIndex:e,itemIndex:0,isDragging:!1})}),Yi.jsxs(Xx,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",padding:"20px 4px"},children:[Yi.jsx(fx,{sx:{textAlign:"center",width:"fit-content",maxWidth:"100%",overflowWrap:"break-word",textOverflow:"ellipsis",fontWeight:"600",fontSize:"14px",lineHeight:"16px",color:"rgba(64, 64, 64, 1)"},children:o.title}),Yi.jsx(fx,{sx:{textAlign:"center",width:"fit-content",maxWidth:"100%",overflowWrap:"break-word",textOverflow:"ellipsis",fontSize:"12px",lineHeight:"150%",color:"rgba(64, 64, 64, 1)"},children:o.message})]})]})})),gU=Re.memo((({id:e,sectionIndex:t})=>{const n=kO(Pq);return void 0===n?null:Yi.jsx(n,{id:e,sectionIndex:t})}));var yU=Object.defineProperty,vU=Object.defineProperties,bU=Object.getOwnPropertyDescriptors,xU=Object.getOwnPropertySymbols,wU=Object.prototype.hasOwnProperty,SU=Object.prototype.propertyIsEnumerable,CU=(e,t,n)=>t in e?yU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kU=(e,t)=>{for(var n in t||(t={}))wU.call(t,n)&&CU(e,n,t[n]);if(xU)for(var n of xU(t))SU.call(t,n)&&CU(e,n,t[n]);return e},EU=(e,t)=>vU(e,bU(t)),MU=class extends GF{apply({transform:e}){if(!this.options)return e;const{axis:t,value:n}=this.options;return EU(kU({},e),{[t]:n})}};MU.configure=hz(MU);var _U=MU,RU=_U.configure({axis:"x",value:0});_U.configure({axis:"y",value:0});var IU=class extends GF{apply({transform:e}){var t;const{size:n=20}=null!=(t=this.options)?t:{},r="number"==typeof n?n:n.x,i="number"==typeof n?n:n.y;return EU(kU({},e),{x:Math.ceil(e.x/r)*r,y:Math.ceil(e.y/i)*i})}};IU.configure=hz(IU);var DU=Object.create,PU=Object.defineProperty,AU=Object.defineProperties,OU=Object.getOwnPropertyDescriptor,LU=Object.getOwnPropertyDescriptors,TU=Object.getOwnPropertySymbols,qU=Object.prototype.hasOwnProperty,NU=Object.prototype.propertyIsEnumerable,jU=e=>{throw TypeError(e)},zU=(e,t,n)=>t in e?PU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,FU=(e,t)=>{for(var n in t||(t={}))qU.call(t,n)&&zU(e,n,t[n]);if(TU)for(var n of TU(t))NU.call(t,n)&&zU(e,n,t[n]);return e},WU=(e,t)=>AU(e,LU(t)),$U=["class","method","getter","setter","accessor","field","value","get","set"],BU=e=>void 0!==e&&"function"!=typeof e?jU("Function expected"):e,VU=(e,t,n,r,i)=>({kind:$U[e],name:t,metadata:r,addInitializer:e=>n._?jU("Already initialized"):i.push(BU(e||null))}),HU=(e,t,n,r)=>{for(var i=0,o=e[t>>1],a=o&&o.length;i<a;i++)1&t?o[i].call(n):r=o[i].call(n,r);return r},UU=(e,t,n,r,i,o)=>{for(var a,s,l,c,u,d=7&t,f=e.length+1,h=$U[d+5],p=e[f-1]=[],m=e[f]||(e[f]=[]),g=(i=i.prototype,OU({get[n](){return YU(this,o)},set[n](e){return XU(this,o,e)}},n)),y=r.length-1;y>=0;y--)(c=VU(d,n,l={},e[3],m)).static=false,c.private=false,u=c.access={has:e=>n in e},u.get=e=>e[n],u.set=(e,t)=>e[n]=t,s=(0,r[y])({get:g.get,set:g.set},c),l._=1,void 0===s?BU(s)&&(g[h]=s):"object"!=typeof s||null===s?jU("Object expected"):(BU(a=s.get)&&(g.get=a),BU(a=s.set)&&(g.set=a),BU(a=s.init)&&p.unshift(a));return g&&PU(i,n,g),i},GU=(e,t,n)=>t.has(e)||jU("Cannot "+n),YU=(e,t,n)=>(GU(e,t,"read from private field"),t.get(e)),KU=(e,t,n)=>t.has(e)?jU("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),XU=(e,t,n,r)=>(GU(e,t,"write to private field"),t.set(e,n),n);function JU(e){return e instanceof RG||e instanceof _G}var QU=class extends mz{constructor(e){super(e);const t=lN((()=>{const{dragOperation:t}=e;if(T$(t.activatorEvent)&&JU(t.source)&&t.status.initialized){const t=e.registry.plugins.get(EV);if(t)return t.disable(),()=>t.enable()}})),n=e.monitor.addEventListener("dragmove",((e,t)=>{queueMicrotask((()=>{if(this.disabled||e.defaultPrevented||!e.nativeEvent)return;const{dragOperation:n}=t;if(!T$(e.nativeEvent))return;if(!JU(n.source))return;if(!n.shape)return;const{actions:r,collisionObserver:i,registry:o}=t,{by:a}=e;if(!a)return;const s=function(e){const{x:t,y:n}=e;if(t>0)return"right";if(t<0)return"left";if(n>0)return"down";if(n<0)return"up"}(a),{source:l,target:c}=n,{center:u}=n.shape.current,d=[],f=[];Bq((()=>{for(const e of o.droppables){const{id:t}=e;if(!e.accepts(l)||t===(null==c?void 0:c.id)&&JU(e)||!e.element)continue;let n=e.shape;const r=new P$(e.element,{getBoundingClientRect:e=>gW(e,void 0,.2)});r.height&&r.width&&(("down"==s&&u.y+10<r.center.y||"up"==s&&u.y-10>r.center.y||"left"==s&&u.x-10>r.center.x||"right"==s&&u.x+10<r.center.x)&&(d.push(e),e.shape=r,f.push((()=>e.shape=n))))}})),e.preventDefault(),i.disable();const h=i.computeCollisions(d,z$);Bq((()=>f.forEach((e=>e()))));const[p]=h;if(!p)return;const{id:m}=p,{index:g,group:y}=l.sortable;r.setDropTarget(m).then((()=>{const{source:e,target:t,shape:o}=n;if(!e||!JU(e)||!o)return;const{index:a,group:s,target:l}=e.sortable,c=g!==a||y!==s,u=c?l:null==t?void 0:t.element;if(!u)return;k$(u);const d=new P$(u);if(!d)return;const f=Rj.delta(d,Rj.from(o.current.boundingRectangle),e.alignment);r.move({by:f}),c?r.setDropTarget(e.id).then((()=>i.enable())):i.enable()}))}))}));this.destroy=()=>{n(),t()}}};var ZU=Object.defineProperty,eG=Object.defineProperties,tG=Object.getOwnPropertyDescriptors,nG=Object.getOwnPropertySymbols,rG=Object.prototype.hasOwnProperty,iG=Object.prototype.propertyIsEnumerable,oG=(e,t,n)=>t in e?ZU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,aG=(e,t)=>{for(var n in t||(t={}))rG.call(t,n)&&oG(e,n,t[n]);if(nG)for(var n of nG(t))iG.call(t,n)&&oG(e,n,t[n]);return e},sG=(e,t)=>eG(e,tG(t));function lG(e,t,n){if(t===n)return e;const r=e.slice();return r.splice(n,0,r.splice(t,1)[0]),r}function cG(e){return"initialIndex"in e&&"number"==typeof e.initialIndex&&"index"in e&&"number"==typeof e.index}function uG(e,t){return function(e,t,n){var r,i,o;const{source:a,target:s,canceled:l}=t.operation;if(!a||!s||l)return"preventDefault"in t&&t.preventDefault(),e;const c=(e,t)=>e===t||"object"==typeof e&&"id"in e&&e.id===t;if(Array.isArray(e)){const r=e.findIndex((e=>c(e,a.id))),i=e.findIndex((e=>c(e,s.id)));if(-1===r||-1===i){if(cG(a)){const r=a.initialIndex,i=a.index;return r===i||r<0||r>=e.length?("preventDefault"in t&&t.preventDefault(),e):n(e,r,i)}return e}if(!l&&"index"in a&&"number"==typeof a.index){const t=a.index;if(t!==r)return n(e,r,t)}return n(e,r,i)}const u=Object.entries(e);let d,f,h=-1,p=-1;for(const[e,t]of u)if(-1===h&&(h=t.findIndex((e=>c(e,a.id))),-1!==h&&(d=e)),-1===p&&(p=t.findIndex((e=>c(e,s.id))),-1!==p&&(f=e)),-1!==h&&-1!==p)break;if(-1===h&&cG(a)){const r=a.initialGroup,i=a.initialIndex,o=a.group,s=a.index;if(null==r||null==o||!(r in e)||!(o in e))return"preventDefault"in t&&t.preventDefault(),e;if(r===o&&i===s)return"preventDefault"in t&&t.preventDefault(),e;if(r===o)return sG(aG({},e),{[r]:n(e[r],i,s)});const l=e[r][i];return sG(aG({},e),{[r]:[...e[r].slice(0,i),...e[r].slice(i+1)],[o]:[...e[o].slice(0,s),l,...e[o].slice(s)]})}if(!a.manager)return e;const{dragOperation:m}=a.manager,g=null!=(i=null==(r=m.shape)?void 0:r.current.center)?i:m.position.current;if(null==f&&s.id in e){const t=s.shape&&g.y>s.shape.center.y?e[s.id].length:0;f=s.id,p=t}if(null==d||null==f||d===f&&h===p){if(null!=d&&d===f&&h===p&&cG(a)){const t=null!=a.group&&a.group!==d,r=a.index!==h;if(t||r){const t=null!=(o=a.group)?o:d;if(t in e){if(d===t)return sG(aG({},e),{[d]:n(e[d],h,a.index)});const r=e[d][h];return sG(aG({},e),{[d]:[...e[d].slice(0,h),...e[d].slice(h+1)],[t]:[...e[t].slice(0,a.index),r,...e[t].slice(a.index)]})}}}return"preventDefault"in t&&t.preventDefault(),e}if(d===f)return sG(aG({},e),{[d]:n(e[d],h,p)});const y=s.shape&&Math.round(g.y)>Math.round(s.shape.center.y)?1:0,v=e[d][h];return sG(aG({},e),{[d]:[...e[d].slice(0,h),...e[d].slice(h+1)],[f]:[...e[f].slice(0,p+y),v,...e[f].slice(p+y)]})}(e,t,lG)}var dG="__default__";function fG(e,t,n,r){const i=r<t?"afterend":"beforebegin";n.insertAdjacentElement(i,e)}function hG(e,t){return e.index-t.index}function pG(e){return Array.from(e).sort(hG)}var mG,gG,yG,vG,bG,xG,wG,SG,CG=[QU,class extends mz{constructor(e){super(e);const t=()=>{const t=new Map;for(const n of e.registry.droppables)if(n instanceof RG){const{sortable:e}=n,{group:r}=e;let i=t.get(r);i||(i=new Set,t.set(r,i)),i.add(e)}for(const[e,n]of t)t.set(e,new Set(pG(n)));return t},n=[e.monitor.addEventListener("dragover",((e,n)=>{if(this.disabled)return;const{dragOperation:r}=n,{source:i,target:o}=r;if(!JU(i)||!JU(o))return;if(i.sortable===o.sortable)return;const a=t(),s=i.sortable.group===o.sortable.group,l=a.get(i.sortable.group),c=s?l:a.get(o.sortable.group);l&&c&&queueMicrotask((()=>{e.defaultPrevented||n.renderer.rendering.then((()=>{var r,u,d;const f=t();for(const[e,t]of a.entries()){const n=Array.from(t).entries();for(const[t,i]of n)if(i.index!==t||i.group!==e||!(null==(r=f.get(e))?void 0:r.has(i)))return}const h=i.sortable.element,p=o.sortable.element;if(!p||!h)return;if(!s&&o.id===i.sortable.group)return;const m=pG(l),g=s?m:pG(c),y=null!=(u=i.sortable.group)?u:dG,v=null!=(d=o.sortable.group)?d:dG,b={[y]:m,[v]:g},x=uG(b,e);if(b===x)return;const w=x[v].indexOf(i.sortable),S=x[v].indexOf(o.sortable);n.collisionObserver.disable(),fG(h,w,p,S),Bq((()=>{for(const[e,t]of x[y].entries())t.index=e;if(!s)for(const[e,t]of x[v].entries())t.group=o.sortable.group,t.index=e})),n.actions.setDropTarget(i.id).then((()=>n.collisionObserver.enable()))}))}))})),e.monitor.addEventListener("dragend",((e,n)=>{if(!e.canceled)return;const{dragOperation:r}=n,{source:i}=r;JU(i)&&(i.sortable.initialIndex===i.sortable.index&&i.sortable.initialGroup===i.sortable.group||queueMicrotask((()=>{const e=t(),r=e.get(i.sortable.initialGroup);r&&n.renderer.rendering.then((()=>{for(const[t,n]of e.entries()){const e=Array.from(n).entries();for(const[n,r]of e)if(r.index!==n||r.group!==t)return}const t=pG(r),n=i.sortable.element,o=t[i.sortable.initialIndex],a=null==o?void 0:o.element;o&&a&&n&&(fG(n,o.index,a,i.index),Bq((()=>{for(const[t,n]of e.entries()){const e=Array.from(n).values();for(const t of e)t.index=t.initialIndex,t.group=t.initialGroup}})))}))})))}))];this.destroy=()=>{for(const e of n)e()}}}],kG={duration:250,easing:"cubic-bezier(0.25, 1, 0.5, 1)",idle:!1},EG=new class{constructor(){KN(this,ij,new WeakMap)}get(e,t){var n;return e?null==(n=YN(this,ij).get(e))?void 0:n.get(t):void 0}set(e,t,n){var r;if(e)return YN(this,ij).has(e)||YN(this,ij).set(e,new Map),null==(r=YN(this,ij).get(e))?void 0:r.set(t,n)}clear(e){var t;return e?null==(t=YN(this,ij).get(e))?void 0:t.clear():void 0}};gG=[ej],mG=[ej];var MG=class{constructor(e,t){KU(this,vG,HU(yG,8,this)),HU(yG,11,this),KU(this,bG),KU(this,xG),KU(this,wG,HU(yG,12,this)),HU(yG,15,this),KU(this,SG),this.register=()=>(Bq((()=>{var e,t;null==(e=this.manager)||e.registry.register(this.droppable),null==(t=this.manager)||t.registry.register(this.draggable)})),()=>this.unregister()),this.unregister=()=>{Bq((()=>{var e,t;null==(e=this.manager)||e.registry.unregister(this.droppable),null==(t=this.manager)||t.registry.unregister(this.draggable)}))},this.destroy=()=>{Bq((()=>{this.droppable.destroy(),this.draggable.destroy()}))};var n=e,{effects:r=()=>[],group:i,index:o,sensors:a,type:s,transition:l=kG,plugins:c=CG}=n,u=((e,t)=>{var n={};for(var r in e)qU.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&TU)for(var r of TU(e))t.indexOf(r)<0&&NU.call(e,r)&&(n[r]=e[r]);return n})(n,["effects","group","index","sensors","type","transition","plugins"]);this.droppable=new RG(u,t,this),this.draggable=new _G(WU(FU({},u),{effects:()=>[()=>{var e,t,n;const r=null==(e=this.manager)?void 0:e.dragOperation.status;(null==r?void 0:r.initializing)&&this.id===(null==(n=null==(t=this.manager)?void 0:t.dragOperation.source)?void 0:n.id)&&EG.clear(this.manager),(null==r?void 0:r.dragging)&&EG.set(this.manager,this.id,Hq((()=>({initialIndex:this.index,initialGroup:this.group}))))},()=>{const{index:e,group:t,manager:n}=this,r=YU(this,xG),i=YU(this,bG);e===r&&t===i||(XU(this,xG,e),XU(this,bG,t),this.animate())},()=>{const{target:e}=this,{feedback:t,isDragSource:n}=this.draggable;"move"==t&&n&&(this.droppable.disabled=!e)},()=>{const{manager:e}=this;for(const t of c)null==e||e.registry.register(t)},...r()],type:s,sensors:a}),t,this),XU(this,SG,u.element),this.manager=t,this.index=o,XU(this,xG,o),this.group=i,XU(this,bG,i),this.type=s,this.transition=l}get initialIndex(){var e,t;return null!=(t=null==(e=EG.get(this.manager,this.id))?void 0:e.initialIndex)?t:this.index}get initialGroup(){var e,t;return null!=(t=null==(e=EG.get(this.manager,this.id))?void 0:e.initialGroup)?t:this.group}animate(){Hq((()=>{const{manager:e,transition:t}=this,{shape:n}=this.droppable;if(!e)return;const{idle:r}=e.dragOperation.status;n&&t&&(!r||t.idle)&&e.renderer.rendering.then((()=>{const{element:r}=this;if(!r)return;const i=this.refreshShape();if(!i)return;const o=n.boundingRectangle.left-i.boundingRectangle.left,a=n.boundingRectangle.top-i.boundingRectangle.top,{translate:s}=f$(r),l=M$(r,s,!1),c=M$(r,s);if(o||a){const n=kW(uW(r))?WU(FU({},t),{duration:0}):t;E$({element:r,keyframes:{translate:[`${l.x+o}px ${l.y+a}px ${l.z}`,`${c.x}px ${c.y}px ${c.z}`]},options:n}).then((()=>{e.dragOperation.status.dragging||(this.droppable.shape=void 0)}))}}))}))}get manager(){return this.draggable.manager}set manager(e){Bq((()=>{this.draggable.manager=e,this.droppable.manager=e}))}set element(e){Bq((()=>{const t=YU(this,SG),n=this.droppable.element,r=this.draggable.element;n&&n!==t||(this.droppable.element=e),r&&r!==t||(this.draggable.element=e),XU(this,SG,e)}))}get element(){var e,t;const n=YU(this,SG);if(n)return null!=(t=null!=(e=RW.get(n))?e:n)?t:this.droppable.element}set target(e){this.droppable.element=e}get target(){return this.droppable.element}set source(e){this.draggable.element=e}get source(){return this.draggable.element}get disabled(){return this.draggable.disabled&&this.droppable.disabled}set feedback(e){this.draggable.feedback=e}set disabled(e){Bq((()=>{this.droppable.disabled=e,this.draggable.disabled=e}))}set data(e){Bq((()=>{this.droppable.data=e,this.draggable.data=e}))}set handle(e){this.draggable.handle=e}set id(e){Bq((()=>{this.droppable.id=e,this.draggable.id=e}))}get id(){return this.droppable.id}set sensors(e){this.draggable.sensors=e}set modifiers(e){this.draggable.modifiers=e}set collisionPriority(e){this.droppable.collisionPriority=e}set collisionDetector(e){this.droppable.collisionDetector=null!=e?e:j$}set alignment(e){this.draggable.alignment=e}get alignment(){return this.draggable.alignment}set type(e){Bq((()=>{this.droppable.type=e,this.draggable.type=e}))}get type(){return this.draggable.type}set accept(e){this.droppable.accept=e}get accept(){return this.droppable.accept}get isDropTarget(){return this.droppable.isDropTarget}get isDragSource(){return this.draggable.isDragSource}get isDragging(){return this.draggable.isDragging}get isDropping(){return this.draggable.isDropping}get status(){return this.draggable.status}refreshShape(){return this.droppable.refreshShape()}accepts(e){return this.droppable.accepts(e)}};yG=[,,,DU(null)],vG=new WeakMap,bG=new WeakMap,xG=new WeakMap,wG=new WeakMap,SG=new WeakMap,UU(yG,4,"index",gG,MG,vG),UU(yG,4,"group",mG,MG,wG),((e,t)=>{return zU(t,(n="metadata",(r=Symbol[n])?r:Symbol.for("Symbol."+n)),e[3]);var n,r})(yG,MG);var _G=class extends gH{constructor(e,t,n){super(e,t),this.sortable=n}get index(){return this.sortable.index}get initialIndex(){return this.sortable.initialIndex}get group(){return this.sortable.group}get initialGroup(){return this.sortable.initialGroup}},RG=class extends yH{constructor(e,t,n){super(e,t),this.sortable=n}get index(){return this.sortable.index}get group(){return this.sortable.group}},IG=Object.defineProperty,DG=Object.defineProperties,PG=Object.getOwnPropertyDescriptors,AG=Object.getOwnPropertySymbols,OG=Object.prototype.hasOwnProperty,LG=Object.prototype.propertyIsEnumerable,TG=(e,t,n)=>t in e?IG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qG=(e,t)=>{for(var n in t||(t={}))OG.call(t,n)&&TG(e,n,t[n]);if(AG)for(var n of AG(t))LG.call(t,n)&&TG(e,n,t[n]);return e};function NG(e){const{accept:t,collisionDetector:n,collisionPriority:r,id:i,data:o,element:a,handle:s,index:l,group:c,disabled:u,feedback:d,modifiers:f,sensors:h,target:p,type:m}=e,g=qG(qG({},kG),e.transition),y=FH((t=>new MG(((e,t)=>DG(e,PG(t)))(qG({},e),{transition:g,register:!1,handle:vH(s),element:vH(a),target:vH(p),feedback:d}),t))),v=SH(y,jG);return EH(i,(()=>y.id=i)),bH((()=>{Bq((()=>{y.group=c,y.index=l}))}),[y,c,l]),EH(m,(()=>y.type=m)),EH(t,(()=>y.accept=t),void 0,ZN),EH(o,(()=>o&&(y.data=o))),EH(l,(()=>{var e;(null==(e=y.manager)?void 0:e.dragOperation.status.idle)&&(null==g?void 0:g.idle)&&y.refreshShape()}),CH),MH(s,(e=>y.handle=e)),MH(a,(e=>y.element=e)),MH(p,(e=>y.target=e)),EH(u,(()=>y.disabled=!0===u)),EH(h,(()=>y.sensors=h)),EH(n,(()=>y.collisionDetector=n)),EH(r,(()=>y.collisionPriority=r)),EH(d,(()=>y.feedback=null!=d?d:"default")),EH(g,(()=>y.transition=g),void 0,ZN),EH(f,(()=>y.modifiers=f),void 0,ZN),EH(e.alignment,(()=>y.alignment=e.alignment)),{sortable:v,get isDragging(){return v.isDragging},get isDropping(){return v.isDropping},get isDragSource(){return v.isDragSource},get isDropTarget(){return v.isDropTarget},handleRef:_e.useCallback((e=>{y.handle=null!=e?e:void 0}),[y]),ref:_e.useCallback((e=>{var t,n;(e||!(null==(t=y.element)?void 0:t.isConnected)||(null==(n=y.manager)?void 0:n.dragOperation.status.idle))&&(y.element=null!=e?e:void 0)}),[y]),sourceRef:_e.useCallback((e=>{var t,n;(e||!(null==(t=y.source)?void 0:t.isConnected)||(null==(n=y.manager)?void 0:n.dragOperation.status.idle))&&(y.source=null!=e?e:void 0)}),[y]),targetRef:_e.useCallback((e=>{var t,n;(e||!(null==(t=y.target)?void 0:t.isConnected)||(null==(n=y.manager)?void 0:n.dragOperation.status.idle))&&(y.target=null!=e?e:void 0)}),[y])}}function jG(e,t,n){return!("isDragSource"!==e||n||!t)}const zG=({id:e,itemIndex:t,sectionIndex:n})=>Yi.jsx("div",{children:`${n}:${t} - ${e}`}),FG=({id:e,itemIndex:t,sectionIndex:n})=>{const r=kO(Oq),i=kO(Dq),o=kO(Eq).at(n)??0,a=kO(Mq)({sectionIndex:n}),{ref:s,isDragging:l}=NG({id:e,index:t,type:"item",accept:"item",group:a,modifiers:[RU],plugins:[QU],data:{id:e,sectionIndex:n,sectionKey:a,itemIndex:t}}),c=void 0!==r?()=>{r({id:e,itemIndex:t,sectionIndex:n})}:void 0,u=i??zG;return Yi.jsx(OS,{"data-testid":"section-item",onClick:c,ref:s,"data-dragging":l,sx:{padding:0,backgroundColor:l?"rgba(242, 242, 242, 1)":void 0,borderRadius:l?"4px":void 0},children:Yi.jsxs("div",{style:{width:"100%",opacity:l?.4:1},children:[Yi.jsx(hU,{isDragging:l,itemIndex:t,sectionIndex:n}),Yi.jsx(u,{id:e,itemIndex:t,sectionIndex:n}),t===o-1&&Yi.jsx(hU,{isDragging:l,itemIndex:t+1,sectionIndex:n})]})})},WG=Re.memo(FG),$G=Re.memo((({sectionIndex:e})=>{const t=kO(Mq),n=kO(Eq).at(e)??0,r=t({sectionIndex:e});return Yi.jsxs(Xx,{className:"exploration-list",style:{overflow:"auto"},children:[Yi.jsx(Vw,{}),Yi.jsx(gU,{id:r,sectionIndex:e}),Yi.jsx(Vw,{}),Yi.jsx(mU,{sectionIndex:e}),Yi.jsx(wS,{sx:{padding:"2px 8px"},children:uU(n).map((n=>{const r=t({sectionIndex:e,itemIndex:n});return Yi.jsx(WG,{id:r,itemIndex:n,sectionIndex:e},r)}))})]},r)})),BG=Re.memo((()=>{const e=kO(kq),t=kO(Mq),n=EO(Nq("start")),r=EO(Nq("over")),i=EO(Nq("end"));return Yi.jsxs(jH,{onDragEnd:i,onDragOver:r,onDragStart:n,children:[Yi.jsx(Xx,{style:{display:"flex",flexDirection:"column"},children:uU(e).map((e=>Yi.jsx($G,{sectionIndex:e},t({sectionIndex:e}))))}),Yi.jsx(fU,{})]})})),VG=Re.memo((e=>Yi.jsx(lq,{atoms:jq,atomFamilies:zq,children:Yi.jsx(Fq,{props:e,children:Yi.jsx(BG,{})})}))),HG="12px",UG="nebula-table-utils-head-menu-button",GG="sn-copy-cell";let YG=function(e){return e.Enter="Enter",e.Space=" ",e.Esc="Escape",e.Tab="Tab",e.Shift="Shift",e.Left="ArrowLeft",e.Right="ArrowRight",e.Up="ArrowUp",e.Down="ArrowDown",e.C="c",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.F2="F2",e}({});const KG="nebula-table-utils-column-adjuster";let XG=function(e){return e[e.PixelsMin=30]="PixelsMin",e[e.PixelsMax=7680]="PixelsMax",e[e.PixelsDefault=200]="PixelsDefault",e[e.PercentageMin=1]="PercentageMin",e[e.PercentageMax=100]="PercentageMax",e[e.PercentageDefault=20]="PercentageDefault",e[e.PercentageMaxInIndentMode=75]="PercentageMaxInIndentMode",e[e.AutoMinPivot=80]="AutoMinPivot",e[e.AutoMinTable=120]="AutoMinTable",e}({}),JG=function(e){return e.Auto="auto",e.FitToContent="fitToContent",e.Pixels="pixels",e.Percentage="percentage",e}({});const QG={darker:.15,brighter:.3,opacity:.03},ZG={darker:.3,brighter:.5,opacity:.05};let eY=function(e){return e.Cyclic="C",e}({});const tY=(e,t)=>{const n=new Map;for(const t of e)n.set(t.id,t);return t.reduce(((e,t)=>{const r=n.get(t);return r&&e.push(r),e}),[])},nY=wq((e=>fO((t=>{const n=t(NT),r=t(ET),i=t(LT)?.[e],o=n?.qHyperCube.rankedList?.[e];return i||(r?.isRankedListCorrupt(e)||void 0===o?r?.createRankedList(e):o)})))),rY=(e,t=new Set)=>fO((n=>{const r=n(e),i=n(YT);if(!r||0===r.length)return"disabled";const o=r.filter((e=>!t.has(e.id)));if(0===o.length)return"disabled";const a=o.filter((e=>i.has(e.id))).length;return 0===a?"none":a===o.length?"all":"some"})),iY=(e,t=new Set)=>fO(null,((n,r,i)=>{const o=n(e);o&&0!==o.length&&(e=>{const{items:t,shouldCheckAll:n,get:r,set:i,excludedIds:o}=e,a=t.filter((e=>!o?.has(e.id)));if(0===a.length)return;const s=r(YT),l=new Set,c=new Set;if(a.forEach((e=>{const t=s.has(e.id);t&&!n&&c.add(e.id),!t&&n&&l.add(e.id)})),0===l.size&&0===c.size)return;const u=new Set(r(VT)),d=new Set(r(HT));l.forEach((e=>u.add(e))),l.forEach((e=>d.delete(e))),c.forEach((e=>d.add(e))),c.forEach((e=>u.delete(e))),i(VT,u),i(HT,d),jO({type:"apply",localChecked:l,localUnchecked:c,handler:r(ET),debouncedApplyPatch:r(kT),fieldInfo:r($T)})})({items:o,shouldCheckAll:i,get:n,set:r,excludedIds:t})})),oY=fO((e=>{const t=e(jT);return t?.qHyperCube.qDimensionInfo.filter(DT).map((({cId:e,qFallbackTitle:t})=>({id:e,title:t,alternative:!0})))})),aY=fO((e=>{const t=e(NT),n=e(_T),r=t?.qHyperCube.qEffectiveInterColumnSortOrder.map((e=>{if(-1===e)return{id:-1,title:n("Common.Values")};const{cId:r,qFallbackTitle:i}=t.qHyperCube.qDimensionInfo[e];return{id:r,title:i}}));return r})),sY=fO((e=>{const t=e(_T),n=e(oY),r=e(IT),i=e(nY("columns")),o=e(nY("rows")),a=e(aY);if(void 0===n||void 0===i||void 0===o||void 0===a)return[];const s=[...a,...n].filter(r);return[{id:"rows",title:t("Common.Rows"),items:tY(s,o)},{id:"columns",title:t("Common.Columns"),items:tY(s,i)}]})),lY=wq((e=>fO((t=>t(sY).at(e))))),cY=wq((({sectionIndex:e,itemIndex:t})=>fO((n=>n(lY(e))?.items.at(t)?.title))),((e,t)=>e.sectionIndex===t.sectionIndex&&e.itemIndex===t.itemIndex)),uY=wq((e=>fO((t=>t(lY(e))?.title)))),dY=fO((e=>({sectionIndex:t,itemIndex:n})=>{const r=e(lY(t));return void 0===r?0===t?"rows":"columns":void 0===n?r.id:r.items.at(n)?.id??`missing-item-${t}-${n}`})),fY=fO((e=>e(sY).map((e=>e.items.length)))),hY=wq((e=>rY(fO((t=>t(lY(e))?.items)),new Set([-1])))),pY=wq((e=>iY(fO((t=>t(lY(e))?.items)),new Set([-1])))),mY=fO(null,(async(e,t,{event:n,id:r,toIndex:i,toSection:o,startSection:a})=>{const s=e(ET),l=e(CT),c=e(nY("rows")),u=e(nY("columns")),d=o;if(void 0===s||void 0===l||void 0===c||void 0===u)return;if(n.operation.canceled)return void t(LT,null);if("section"===n.operation.target?.type&&a===o)return void t(LT,null);const f=xq({rows:c,columns:u},n);t(LT,f),"number"==typeof r?await s.movePseudoDimension({toIndex:i,toSection:d}):await s.moveDimension({cId:r,toIndex:i,toSection:d}),await l.applyPatches([{qPath:"/qHyperCubeDef",qOp:"replace",qValue:JSON.stringify(s.properties.qHyperCubeDef)}],!0)})),gY={noItems:{row:"ChartExploration.PivotTable.RowSectionEmpty.Title",column:"ChartExploration.PivotTable.ColumnSectionEmpty.Title",measure:"ChartExploration.PivotTable.MeasureSectionEmpty.Title"},noSearchFound:{row:"ChartExploration.PivotTable.NoRowsFound.Title",column:"ChartExploration.PivotTable.NoColumnsFound.Title",measure:"ChartExploration.PivotTable.NoMeasuresFound.Title"}},yY="ChartExploration.PivotTable.DimensionSectionEmpty.Message",vY="ChartExploration.PivotTable.MeasureSectionEmpty.Message",bY="#177fe6",xY=(e,t,n,r)=>{if("measure"===t)return e(r?gY.noSearchFound.measure:gY.noItems.measure);const i=r?gY.noSearchFound:gY.noItems;return e(n?i.row:i.column)},wY=(e,t,n)=>n?"":e("measure"===t?vY:yY),SY=wq((e=>fO((t=>{const n=t(_T),r=t(RT).length>0;return t=>({title:xY(n,e,0===t,r),message:wY(n,e,r)})})))),CY=SY("measure"),kY=SY("dimensions"),EY=({children:e})=>Yi.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),MY=e=>{const t=kO(cY(e));return Yi.jsx(EY,{children:t})},_Y=fO((e=>{const t=e(jT);return t?.qHyperCube.qMeasureInfo.filter(DT).map((({cId:e,qFallbackTitle:t})=>({id:e,title:t})))})),RY=fO((e=>{const t=e(NT),n=e(_Y),r=e(IT),i=e(nY("measures"));if(void 0===t||void 0===n||void 0===i)return[];const o=t.qHyperCube.qMeasureInfo.filter(DT).map((({cId:e,qFallbackTitle:t})=>({id:e,title:t})));o.push(...n);const a=o.filter(r);return tY(a,i)})),IY=wq((e=>fO((t=>t(RY).at(e)?.title??"")))),DY=fO((e=>({itemIndex:t})=>{const n=e(RY);return void 0===t?"measures":n.at(t)?.id??`missing-item-${t}`})),PY=fO((e=>[e(RY).length])),AY=rY(RY),OY=iY(RY),LY=fO(null,(async(e,t,{id:n,toIndex:r,event:i})=>{const o=e(ET),a=e(CT),s=e(nY("measures"));if(void 0===o||void 0===a||void 0===s||"string"!=typeof n)return;const l=xq({measures:s},i);t(LT,l),await o.moveMeasure({cId:n,toIndex:r}),await a.applyPatches([{qPath:"/qHyperCubeDef",qOp:"replace",qValue:JSON.stringify(o.properties.qHyperCubeDef)}],!0)})),TY=e=>"svg"===e.tagName?"exploration-draggable-icon":e.className,qY=e=>{const t=e.closest(".exploration-list"),n=t?.nextElementSibling||t?.parentElement?.nextElementSibling;return null!==n&&n?n.getElementsByClassName("exploration-section-header")[0]:t?.closest(".exploration-panel")?.getElementsByClassName("exploration-section-header")[0]},NY=e=>{const{currentTarget:t}=e,n=TY(t);let r=t.closest("li")?.previousElementSibling?.getElementsByClassName(n)[0];if(!r){const e=t.closest(".exploration-list"),i=e?.querySelector(".exploration-section-header");if(i)return i;if(r=((e,t)=>{const n=e.closest(".exploration-list"),r=n?.previousElementSibling;if(null===r||!r)return e.closest(".exploration-panel")?.getElementsByClassName(t)[1];const i=r.getElementsByClassName(t);return i.length>0?i[i.length-1]:void 0})(t,n),!r){const e=t.closest(".exploration-panel")?.getElementsByClassName(n)[1];return e??null}}return r},jY=e=>{(e instanceof HTMLElement||e instanceof SVGElement)&&e.focus()},zY=e=>{const t=e.key===YG.Down?(e=>{const{currentTarget:t}=e,n=TY(t),r=t.closest("li");let i=r?.nextElementSibling?.getElementsByClassName(n)[0];return i||(i=qY(t),i)?i:t.closest(".exploration-panel")?.getElementsByClassName(n)[0]})(e):NY(e);t&&jY(t)},FY=(e,t)=>{const{key:n}=e;switch(n){case YG.Tab:e.preventDefault(),e.shiftKey?((e,t)=>{const{currentTarget:n}=e,r=n.closest("ul")?.getElementsByClassName("exploration-item-focus");if(n===t.items.draggableIconRef.current){if(t.itemIndex>=0){const e=r&&r[t.itemIndex];return void(e&&jY(e))}const n=NY(e);n&&jY(n)}if(n===t.items.explorationItemFocusRef.current){const t=n.closest("li")?.previousElementSibling?.getElementsByClassName("exploration-draggable-icon")[0];if(t)return void jY(t);const r=NY(e);r&&jY(r)}})(e,t):((e,t)=>{const{currentTarget:n}=e;if(!e.shiftKey)if(n!==t.items.explorationItemFocusRef.current){if(n===t.items.draggableIconRef.current){const e=n.closest("ul")?.getElementsByClassName("exploration-item-focus");if((e?.length||0)-1>t.itemIndex){const n=e&&e[t.itemIndex+1];return void(n&&jY(n))}const r=qY(n);r&&jY(r)}}else{const e=n.closest("li")?.getElementsByClassName("exploration-draggable-icon")[0];e&&jY(e)}})(e,t);break;case YG.Down:case YG.Up:e.preventDefault(),e.stopPropagation(),zY(e);break;case YG.Enter:case YG.Space:e.preventDefault(),e.stopPropagation(),((e,t)=>{const{currentTarget:n}=e;if(n!==t.items.draggableIconRef.current)if(n!==t.items.explorationItemRef.current)n===t.items.explorationItemFocusRef.current&&t.toggleCheckedById(t.id);else{const e=n.getElementsByClassName("exploration-draggable-icon")[0];jY(e)}else{const e=n.closest("li")?.getElementsByClassName("exploration-item")[0];e&&jY(e)}})(e,t)}},WY=(e,t)=>{const{key:n,currentTarget:r}=e;if(r===t.current&&n===YG.Tab)if(e.preventDefault(),e.shiftKey)((e,t)=>{const{currentTarget:n}=e;if(n!==t.current)return;const r=n.closest('[role="region"]')?.getElementsByTagName("button")[0];r&&jY(r)})(e,t);else{const e=r.parentElement?.getElementsByClassName("exploration-section-header")[0];e&&jY(e)}},$Y=(e,t)=>{const{currentTarget:n}=e;if(n!==t.ref.current)return;const r=t.sectionIndex??2;if(0===r)return void((e,t)=>{const{currentTarget:n}=e;if(n!==t.ref.current)return;const r=n.closest(".exploration-panel")?.getElementsByTagName("input")[0];r&&jY(r)})(e,t);const i=n.closest(".exploration-panel")?.getElementsByClassName("exploration-list")[r-1],o=i?.getElementsByClassName("exploration-item-focus").length??0;if(o>0){const e=i?.getElementsByClassName("exploration-draggable-icon")[o-1];e&&jY(e)}},BY=(e,t)=>{const{key:n}=e;switch(n){case YG.Tab:e.preventDefault(),e.stopPropagation(),e.shiftKey?$Y(e,t):((e,t)=>{const{currentTarget:n}=e;if(n!==t.ref.current)return;const r=n.closest(".exploration-list"),i=r?.getElementsByClassName("exploration-item-focus")[0];i&&jY(i)})(e,t);break;case YG.Down:e.preventDefault(),((e,t)=>{const{currentTarget:n}=e;if(n!==t.ref.current)return;const r=n.closest(".exploration-panel"),i=r?.getElementsByClassName("exploration-section-header").length??0;let o=null;if(0===i)return;const a=t.sectionIndex??2;o=a+1<i?r?.getElementsByClassName("exploration-section-header")[a+1]:r?.getElementsByClassName("exploration-section-header")[0],o&&jY(o)})(e,t);break;case YG.Up:e.preventDefault(),((e,t)=>{const{currentTarget:n}=e;if(n!==t.ref.current)return;const r=n.closest(".exploration-panel"),i=r?.getElementsByClassName("exploration-section-header").length??0;let o=null;if(0===i)return;const a=t.sectionIndex??2;o=a-1>=0?r?.getElementsByClassName("exploration-section-header")[a-1]:r?.getElementsByClassName("exploration-section-header")[i-1],o&&jY(o)})(e,t);break;case YG.Enter:case YG.Space:e.preventDefault(),((e,t)=>{const{currentTarget:n}=e;if(e.preventDefault(),n!==t.ref.current)return;const r="all"!==t.checkState;t.toggleAllCheckboxes(r)})(e,t)}},VY=({children:e})=>Yi.jsx("span",{style:{width:"fit-content",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontWeight:"bold"},children:e}),HY=({children:e,sectionIndex:t})=>{const n=kO(void 0!==t?hY(t):AY),r=EO(void 0!==t?pY(t):OY),i=Re.useRef(null),o={ref:i,toggleAllCheckboxes:r,checkState:n,sectionIndex:t};return Yi.jsxs(Xx,{ref:i,className:"exploration-section-header",tabIndex:0,onKeyDown:e=>{BY(e,o)},sx:{display:"flex",alignItems:"center",width:"100%",padding:"2px 8px 2px 8px",boxSizing:"border-box",fontSize:"12px","&:focus-visible":{boxShadow:`0 0 0 2px ${bY} inset`}},children:[Yi.jsx(Sw,{disabled:"disabled"===n,checked:"all"===n,indeterminate:"some"===n,onChange:e=>{r(e.target.checked)},size:"small",style:{flexShrink:0,padding:9}}),Yi.jsx(VY,{children:e})]})},UY=({sectionIndex:e})=>{const t=kO(uY(e));return Yi.jsx(HY,{sectionIndex:e,children:t})},GY=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 16 16",height:"16px",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M.5 4.774v6.452a2 2 0 0 0 1.154 1.813l5.5 2.566a2 2 0 0 0 1.692 0l5.5-2.566a2 2 0 0 0 1.154-1.813V4.774a2 2 0 0 0-1.154-1.813L8.846.395a2 2 0 0 0-1.692 0l-5.5 2.566A2 2 0 0 0 .5 4.774m1 0v-.032l6 2.428v7.493l-5.423-2.53a1 1 0 0 1-.577-.907zm.545-.89.032-.016 5.5-2.567a1 1 0 0 1 .846 0l5.5 2.567.032.015L8 6.293zm12.455.858v6.484a1 1 0 0 1-.577.906L8.5 14.663V7.17z"})}),YY=_e.forwardRef(GY),KY=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M5.5 1a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zm0 4a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zM5 9.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm.5 3.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zM9 1.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zM9.5 5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zM9 9.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm.5 3.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5z"})}),XY=_e.forwardRef(KY),JY=il("div")({position:"absolute",width:"1px",height:"1px",padding:0,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}),QY=il(XY)((()=>({padding:"6px 6px",flexShrink:0,cursor:"grab","&:focus-visible":{boxShadow:`0 0 0 2px ${bY} inset`}}))),ZY=({children:e})=>Yi.jsx("span",{style:{width:"fit-content",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexGrow:1,paddingLeft:4},children:e}),eK=({icon:e,title:t,...n})=>{const[r,i]=MO(YT),o=kO(_T),a=Re.useRef(null),s=Re.useRef(null),l=Re.useRef(null),c={id:n.id,itemIndex:n.itemIndex,toggleCheckedById:i,items:{explorationItemRef:a,explorationItemFocusRef:s,draggableIconRef:l}};return Yi.jsxs(Xx,{ref:a,className:"exploration-item",onClick:e=>{e.stopPropagation(),i(n.id)},onKeyDown:e=>{FY(e,c)},tabIndex:0,style:{display:"flex",alignItems:"center",width:"100%",cursor:"pointer",padding:0,boxSizing:"border-box",fontSize:"12px"},title:t,sx:{"&:hover":{backgroundColor:"action.hover"},"&:focus-visible":{boxShadow:`0 0 0 2px ${bY} inset`}},children:[Yi.jsxs(Xx,{ref:s,className:"exploration-item-focus",component:"div",tabIndex:0,onKeyDownCapture:e=>{FY(e,c)},sx:{display:"flex",minWidth:0,alignItems:"center",justifyContent:"space-between",flexGrow:1,marginRight:"4px","&:focus-visible":{boxShadow:`0 0 0 2px ${bY} inset`}},children:[Yi.jsx(Sw,{checked:r.has(n.id),"aria-label":o("ChartExploration.ListItem.Label",t),size:"small",tabIndex:-1,style:{padding:9,flexShrink:0,visibility:-1===n.id?"hidden":"visible"}}),Yi.jsx(e,{height:"12px",style:{flexShrink:0}}),Yi.jsx(ZY,{children:t})]}),Yi.jsx(QY,{ref:l,className:"exploration-draggable-icon",tabIndex:0,height:"16px",onClick:e=>{e.stopPropagation()},onKeyDownCapture:e=>{FY(e,c)}})]})},tK=e=>{const t=kO(cY(e))??"";return Yi.jsx(eK,{title:t,icon:YY,...e})},nK=()=>{const e=kO(dY),t=kO(fY),n=kO(kY),r=EO(mY);return Yi.jsx(VG,{numberOfSections:2,numberOfItemsInSection:t,keyExtractor:e,emptyTexts:n,onDragEnd:r,dragOverlayRenderer:MY,headerRenderer:UY,itemRenderer:tK})},rK=({itemIndex:e})=>{const t=kO(IY(e));return Yi.jsx(EY,{children:t})},iK=()=>{const e=kO(_T);return Yi.jsx(HY,{children:e("Common.Values")})},oK=(e,t)=>Yi.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 16 16",height:"16px",role:"img",ref:t,...e,children:[Yi.jsx("path",{d:"M1.5 0a.5.5 0 0 0-.5.5v14a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-6a.5.5 0 0 0-.5-.5H8V.5a.5.5 0 0 0-.5-.5zM2 4V1h5v7.293l-5 5V9h2V8H2V5h2V4zm.707 10 5-5H15v5h-3v-2h-1v2H8v-2H7v2z"}),Yi.jsx("path",{d:"M1.5 0a.5.5 0 0 0-.5.5v14a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-6a.5.5 0 0 0-.5-.5H8V.5a.5.5 0 0 0-.5-.5zM2 4V1h5v7.293l-5 5V9h2V8H2V5h2V4zm.707 10 5-5H15v5h-3v-2h-1v2H8v-2H7v2z"})]}),aK=_e.forwardRef(oK),sK=e=>{const{itemIndex:t}=e,n=kO(IY(t));return Yi.jsx(eK,{title:n,icon:aK,...e})},lK=()=>{const e=kO(DY),t=kO(PY),n=kO(CY),r=EO(LY);return Yi.jsx(Xx,{className:"exploration-header-section",style:{height:"100%",display:"flex",flexDirection:"column-reverse"},children:Yi.jsx(VG,{numberOfSections:1,numberOfItemsInSection:t,keyExtractor:e,emptyTexts:n,onDragEnd:r,dragOverlayRenderer:rK,headerRenderer:iK,itemRenderer:sK})})},cK=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M8.588 11.415a6 6 0 1 1 2.828-2.829l4.101 4a1.5 1.5 0 0 1 .014 2.134l-.707.707a1.5 1.5 0 0 1-2.108.014zM11 6A5 5 0 1 0 1 6a5 5 0 0 0 10 0m-1.52 4.888 3.934 3.837a.5.5 0 0 0 .703-.005l.707-.707a.5.5 0 0 0-.005-.711l-3.926-3.829a6 6 0 0 1-1.413 1.415"})}),uK=_e.forwardRef(cK),dK=()=>{const[e,t]=MO(RT),n=kO(_T),r=Re.useRef(null),[i]=kO(PY),[o=0,a=0]=kO(fY),s=_e.useCallback((e=>{t(e.target.value)}),[t]),l=0===e.length||0===o&&0===a&&0===i?n("Common.Search.NoResultsAvailable"):n("ChartExploration.Pivot.Search.ResultsFound",o.toString(),a.toString(),i.toString());return Yi.jsxs(Xx,{ref:r,onKeyDown:e=>{WY(e,r)},style:{position:"sticky",top:0,zIndex:10,width:"calc(100% - 16px)",backgroundColor:"var(--sprout-common-background-color-weak)",paddingTop:2,paddingRight:8,paddingLeft:8,paddingBottom:8},children:[Yi.jsx(JY,{"data-testid":"screenOnly-search-results","aria-live":"polite","aria-atomic":"true",children:l}),Yi.jsx(OC,{size:"small",fullWidth:!0,"data-testid":"chart-exploration-search-input","aria-label":n("Common.Search.AccessibilityLabel"),type:"search",defaultValue:e,placeholder:n("Common.Search"),onChange:s,startAdornment:Yi.jsx(cS,{position:"start",children:Yi.jsx(uK,{})}),inputProps:{style:{fontSize:"14px",paddingTop:6,paddingBottom:6}}})]})},fK=e=>{const t=((e="light",t=!1)=>ws(wk(0,t)))();return Yi.jsx(al,{theme:t,children:Yi.jsx(vO,{children:Yi.jsx(KT,{props:e,children:Yi.jsxs(Xx,{className:"exploration-panel",style:{display:"flex",flexDirection:"column"},children:[Yi.jsx(dK,{}),Yi.jsx(nK,{}),Yi.jsx(lK,{})]})})})})},hK=e=>{if(e.flags.isEnabled("CLIENT_IM_5973_PIVOT_TABLE_EXPLORATION"))return{component:fK,classification:{tags:["exploration"],exclusive:!0}}};var pK=function(e){return e.CONTAINS="contains",e.MATCHES_EXACTLY="matches_exactly",e.STARTS_WITH="starts_with",e.ENDS_WITH="ends_with",e.BEGINNING_OF_WORD="beginning_of_word",e}(pK||{}),mK=function(e){return e.COMPARE="compare",e.GENERAL="general",e}(mK||{}),gK=function(e){return e.VALUES="values",e.CONDITION="condition",e.SEARCH="search",e.CLEAR_SELECTION="clear_selection",e.TOP_BOTTOM="top_bottom",e}(gK||{}),yK=function(e){return e.FIXED_VALUE="fixed_value",e.CALCULATED_VALUE="calculated_value",e}(yK||{});const vK=e=>e&&"]"!==e?/^[A-Za-z][A-Za-z0-9_]*$/.test(e)||(e=>{if(!e)return!1;if("["===e[0]&&"]"===e[e.length-1]){let t=e.substring(1,e.length-1);if(/^[A-Za-z][A-Za-z0-9_]*$/.test(t))return!0;if(t=t.replace(/\]\]/g,"]"),e===`[${t.replace(/\]/g,"]]")}]`)return!0}return!1})(e)?e:`[${e.replace(/\]/g,"]]")}]`:e,bK=e=>{if(!Array.isArray(e))return"";let t="{<";const n=[];if(e.forEach((e=>{let t=`[${e.field}]${e.exclude?"-":""}={`,r="}",i="";switch(e.type){case gK.SEARCH:i=(e=>{let t="",n="";const r=e.options?.mode;if(!r)return"";switch(r){case pK.BEGINNING_OF_WORD:t="*^",n="*";break;case pK.ENDS_WITH:t="*";break;case pK.STARTS_WITH:n="*";break;case pK.MATCHES_EXACTLY:break;case pK.CONTAINS:default:t="*",n="*"}const i=e.options.values?.[0]??"";return""!==i?`"${t}${i}${n}"`:""})(e);break;case gK.CONDITION:i=(e=>{const{options:t}=e,n=t?.mode===mK.GENERAL,r=t?.modifier?.type===yK.FIXED_VALUE,i=t?.modifier?.operator?t.modifier.operator.split(" "):[];if(0===i.length||!r&&(!t.firstValue?.aggregator||!t.firstValue?.field)||r&&!t.firstValue?.fixedValue||n&&(!t.conditionField?.aggregator||!t.conditionField?.field))return"";let o,a,s="=";n&&r?(o=`${t.conditionField?.aggregator}(${vK(t.conditionField?.field)})`,a=`${t.firstValue?.fixedValue}`):!n&&r?(o="",a=`${t.firstValue?.fixedValue}`,s=""):n||r?(o=`${t.conditionField?.aggregator}(${vK(t.conditionField?.field)})`,a=`${t.firstValue?.aggregator}(${vK(t.firstValue?.field)})`):(o=`${vK(e.field)}`,a=`${t.firstValue?.aggregator}(total ${vK(t.firstValue?.field)})`);const l=`${s}${o}${i[0]}${a}`;let c="";if(i.length>1){if(!r&&(!t.secondValue?.aggregator||!t.secondValue?.field)||r&&!t.secondValue?.fixedValue)return"";let e,a;n&&r?(e=`${t.secondValue?.fixedValue}`,a=` and ${o}`):!n&&r?(e=`${t.secondValue?.fixedValue}`,a=""):n||r?(e=`${t.secondValue?.aggregator}(${vK(t.secondValue?.field)})`,a=` and ${o}`):(e=`${t.secondValue?.aggregator}(total ${vK(t.secondValue?.field)})`,a=` and ${o}`),c=`${a}${i[1]}${e}`}return`"${l}${c}"`})(e);break;case gK.CLEAR_SELECTION:i=`[${e.field}]=`,t="",r="";break;case gK.VALUES:default:i=e.options?.values?e.options.values.map((e=>`'${e.replace(/'/g,"''")}'`)).join(","):""}""!==i&&n.push(`${t}${i}${r}`)})),0===n.length)return;return t+=`${n.join(",")}>}`,t},xK=[];for(let e=0;e<256;++e)xK.push((e+256).toString(16).slice(1));let wK;const SK=new Uint8Array(16);var CK={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function kK(e,t,n){const r=(e=e||{}).random??e.rng?.()??function(){if(!wK){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");wK=crypto.getRandomValues.bind(crypto)}return wK(SK)}();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t=0){return(xK[e[t+0]]+xK[e[t+1]]+xK[e[t+2]]+xK[e[t+3]]+"-"+xK[e[t+4]]+xK[e[t+5]]+"-"+xK[e[t+6]]+xK[e[t+7]]+"-"+xK[e[t+8]]+xK[e[t+9]]+"-"+xK[e[t+10]]+xK[e[t+11]]+xK[e[t+12]]+xK[e[t+13]]+xK[e[t+14]]+xK[e[t+15]]).toLowerCase()}(r)}const EK=()=>crypto?.randomUUID?.()??function(e){return CK.randomUUID&&!e?CK.randomUUID():kK(e)}(),MK=1e3,_K=1e3,RK=e=>{if(0===e.qInterColumnSortOrder.length)return;const t=e.qDimensions,n=((e,t)=>{const n=new Set;for(const t of e){if(n.has(t))return!0;n.add(t)}const r=e.includes(-1),i=e.filter((e=>-1!==e));if(t){const n=r?t.length+1:t.length;if(e.length!==n)return!0}const o=[...i].sort(((e,t)=>e-t));for(let e=0;e<o.length;e++)if(o[e]!==e)return!0;return!1})(e.qInterColumnSortOrder,t);n&&(e.qInterColumnSortOrder=((e,t)=>{const n=[];if(t)for(let e=0;e<t.length;e++)n.push(e);return e.qMeasures.length>=2&&n.push(-1),n})(e,t))},IK=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},DK=e=>{if(!e)return;RK(e);const t=e.qDimensions,{qInterColumnSortOrder:n}=e;((e,t=[])=>{const n=t.filter((e=>-1!==e));for(let r=0;r<n.length;r++)if(-1!==n[r]&&n[r]!==r){const i=n[r],o=n.indexOf(r),a=n[o];IK(n,r,o),IK(e,r,o),IK(t,t.indexOf(i),t.indexOf(a))}})(t,n)},PK=(e,t,n)=>{t.splice(n,1),t.push(e),t.splice(n+1,0,-1)},AK=(e,t,n,r)=>{const i=-1===e?t.length:e;if("number"==typeof r&&r<i){const e=Math.max(r,0);t.splice(e,0,n)}else t.splice(i,0,n)},OK=async(e,t,n,r)=>{const i=e.getDimensions(),o=e.hcProperties.qNoOfLeftDims;return await e.autoSortDimension(t),DK(e.hcProperties),(-1===o||Number.isNaN(+o))&&(e.hcProperties.qNoOfLeftDims=i.length),n?((e,t,n,r)=>{if(!e)return;const{qInterColumnSortOrder:i,qNoOfLeftDims:o}=e,a=t.length,s=i.indexOf(-1),l=-1!==s,c=void 0!==r?r+(o||0):void 0;if(l&&void 0!==c&&s>=c?PK(a,i,s):i.push(a),void 0===r)t.push(n);else if(void 0!==c){const e=l&&c>s?c-1:c;t.splice(e,0,n)}})(e.hcProperties,i,t,r):((e,t,n,r)=>{if(!e||"number"!=typeof e.qNoOfLeftDims)return;const i=e.qNoOfLeftDims,{qInterColumnSortOrder:o}=e,a=t.length,s=o.indexOf(-1),l=-1!==s;if(l&&s>=i)PK(a,o,s),AK(i,t,n,r);else{const e=l?i-1:i;void 0!==r&&r<=e&&l?PK(a,o,s):o.push(a),AK(e,t,n,r)}e.qNoOfLeftDims++})(e.hcProperties,i,t,r),t},LK=e.HyperCubeHandler;class TK extends LK{#e;constructor(e,t){super(e),this.path=e.path,this.#e=t}async addDimension(e,t,n,r){const i=this.getDimensions().some((t=>t.qDef.cId===e?.qDef.cId));if(!e||i)return;const o=t??!1;if(e.qDef.cId||(e.qDef.cId=EK()),r)return this.addAlternativeDimension(e,o,n);if(this.getDimensions().length<this.maxDimensions()){const t=await OK(this,e,o,n);return this.#t({section:o?"columns":"rows",cId:e.qDef.cId,addLast:void 0===n}),t}}async addDimensions(e,t,n){const r=[];for await(const i of e){const e=await this.addDimension(i,n,void 0,t);e&&r.push(e)}return r}addAlternativeDimension(e,t,n){if(!e)return;const r=this.getAlternativeDimensions();void 0===this.hcProperties.excludedNoOfLeftDims&&(this.hcProperties.excludedNoOfLeftDims=r.length);let i=n;return i=void 0===i?t?r.length:this.hcProperties.excludedNoOfLeftDims:t?this.hcProperties.excludedNoOfLeftDims+i:Math.min(i,this.hcProperties.excludedNoOfLeftDims),r.splice(i,0,e),t||this.hcProperties.excludedNoOfLeftDims++,this.#t({section:t?"columns":"rows",cId:e.qDef.cId,alternative:!0,addLast:void 0===n}),e}async addFieldDimension(e,t,n,r={}){const i=this.createFieldDimension(e,t,n);return this.addDimension(i,r.asColumn,void 0,!1)}async addFieldDimensions(e,t={}){const n=e.map((e=>this.createFieldDimension(e.field,e.label,e.defaults)));return this.addDimensions(n,void 0,t.asColumn)}async addLibraryDimensions(e,t={}){const n=e.map((e=>this.createLibraryDimension(e.id,e.defaults)));return this.addDimensions(n,void 0,t.asColumn)}reinsertDimension(e,t,n){e.qDef.cId||(e.qDef.cId=EK());if(this.getDimensions().length<this.maxDimensions())return this.addDimension(e,t,n);return this.reinsertAlternativeDimension(e,n,t)}reinsertAlternativeDimension(e,t,n){const r=this.getDimensions(),i=this.getAlternativeDimensions();if(r.length>=MK)return Promise.resolve();const o="number"==typeof t?t:i.length;return i.splice(o,0,e),this.#t({section:n?"columns":"rows",cId:e.qDef.cId,alternative:!0}),Promise.resolve(e)}async removeDimensions(e,t,n){return Promise.all([...e].reverse().map((e=>this.removeDimension(e,t,n))))}async removeDimension(e,t,n){if(t){const t=this.getAlternativeDimensions().splice(e,1)[0];return!n&&this.hcProperties.excludedNoOfLeftDims&&this.hcProperties.excludedNoOfLeftDims--,this.#n({cId:t.qDef.cId,section:n?"columns":"rows"}),t}const r=this.getDimensions(),i=this.properties.qHyperCubeDef.qNoOfLeftDims,o=this.hcProperties.qInterColumnSortOrder.indexOf(e);"number"==typeof this.properties.qHyperCubeDef.qNoOfLeftDims&&"number"==typeof o&&"number"==typeof i&&o+1<=i&&this.properties.qHyperCubeDef.qNoOfLeftDims--;const a=this.properties.qHyperCubeDef.columnWidths?this.properties.qHyperCubeDef.columnWidths[1]:void 0;Array.isArray(a)&&a.length>e&&a.splice(e,1);const s=r.splice(e,1).at(0);if(s)return((e,t)=>{if(!e)return-1;const n=e.indexOf(t);if(-1===n)return-1;for(let n=0;n<e.length;++n)e[n]>t&&e[n]--;e.splice(n,1)})(this.hcProperties.qInterColumnSortOrder,e),DK(this.hcProperties),this.#n({cId:s.qDef.cId,section:n?"columns":"rows"}),s}async addMeasures(e,t=!1){const n=[];for await(const r of e){const e=await this.addMeasure(r,t,void 0,!0);e&&n.push(e)}return n}addAlternativeMeasures(e,t){const n=this.getAlternativeMeasures(),r=void 0===t?n.length:t,i=n.splice(r,0,e);return this.#r({cId:e.qDef.cId,alternative:!0,addLast:void 0===t}),i}async addMeasure(e,t,n,r){const i=this.getMeasures();if(e.qDef.cId||(e.qDef.cId=EK()),t)return this.addAlternativeMeasures(e,n);if(r||delete e.qDef.qNumFormat,i.length<this.maxMeasures()){const t=1===i.length;return void 0!==n&&n>=0?i.splice(n,0,e):i.push(e),this.autoSortMeasure(e).then((()=>(t&&(this.hcProperties.qInterColumnSortOrder.push(-1),0===this.getDimensions().length&&(this.hcProperties.qNoOfLeftDims=0)),this.#r({cId:e.qDef.cId,addLast:void 0===n}),e)))}return i.length<_K?(this.getAlternativeMeasures().push(e),this.#r({cId:e.qDef.cId,alternative:!0,addLast:void 0===n}),Promise.resolve(e)):Promise.resolve()}reinsertMeasure(e,t){const n=this.getMeasures(),r=this.getAlternativeMeasures(),i=this.hcProperties.qInterColumnSortOrder;if(e.qDef.cId||(e.qDef.cId=EK()),t=void 0!==t?t:n.length,n.length<this.maxMeasures()){if(n.splice(t,0,e),2===n.length){-1===i.indexOf(-1)&&i.push(-1)}this.#r({cId:e.qDef.cId})}else n.length<_K&&(t=r.length,r.splice(t,0,e),this.#r({cId:e.qDef.cId}));return Promise.resolve(e)}async removeMeasure(e,t){if(t&&"number"==typeof e){const t=this.getAlternativeMeasures().splice(e,1)[0];return this.#n({cId:t.qDef.cId,section:"measures"}),t}const n=this.getMeasures();let r,i,o;if("number"==typeof e&&e<n.length){r=2===n.length,i=this.getMeasures().splice(e,1)[0];const t=this.hcProperties.qInterColumnSortOrder;r&&(o=t.indexOf(-1),t.splice(o,1),this.hcProperties.qNoOfLeftDims&&o+1<=this.hcProperties.qNoOfLeftDims&&this.hcProperties.qNoOfLeftDims--)}else"number"==typeof e&&(i=this.getAlternativeMeasures().splice(e-n.length,1)[0]);if(i)return this.#n({cId:i.qDef.cId,section:"measures"}),i}async removeMeasures(e,t){return await Promise.all([...e].reverse().map((e=>this.removeMeasure(e,t)))),e}getSorting(){throw new Error("don't call this")}changeSorting(){throw new Error("don't call this")}setSorting(){throw new Error("don't call this")}getRowDimensions(){const e=this.#i("rows"),t=this.getDimensions();return e.filter((e=>e>=0)).map((e=>t[e]))}getColumnDimensions(){const e=this.#i("columns"),t=this.getDimensions();return e.filter((e=>e>=0)).map((e=>t[e]))}getAlternativeRowDimensions(){const e=this.getAlternativeDimensions(),{excludedNoOfLeftDims:t}=this.hcProperties;return-1===t?e:e.slice(0,t)}getAlternativeColumnDimensions(){const e=this.getAlternativeDimensions(),{excludedNoOfLeftDims:t}=this.hcProperties;return-1===t?[]:e.slice(t)}#o(e){const t=this.hcProperties.rankedList?.[e];return t||this.createRankedList(e)}#a(e){return[...this.#o(e)]}#s(e,t){return void 0===this.hcProperties.rankedList&&(this.hcProperties.rankedList={}),this.hcProperties.rankedList[e]=t,t}#l(e){const t=({qDef:t})=>t.cId===e;if(-1===e){return this.hcProperties.qInterColumnSortOrder.indexOf(-1)+1<=this.hcProperties.qNoOfLeftDims?"rows":"columns"}return this.getRowDimensions().some(t)||this.getAlternativeRowDimensions().some(t)?"rows":this.getColumnDimensions().some(t)||this.getAlternativeColumnDimensions().some(t)?"columns":null}#c(e){const t=({qDef:t})=>t.cId===e;return!(!this.getAlternativeDimensions().some(t)&&!this.getAlternativeMeasures().some(t))}#i(e){const{qInterColumnSortOrder:t,qNoOfLeftDims:n}=this.hcProperties;if(this.#u())return"columns"===e?t:[];switch(e){case"rows":return-1===n?t:t.slice(0,n);case"columns":return-1===n?[]:t.slice(n);default:throw new Error(`Unknown section in #getInterColumnSortOrderBySection: ${e}`)}}#u(){const{qNoOfLeftDims:e}=this.hcProperties,t=-1===e||Number.isNaN(+e);return 0===this.getDimensions().length&&this.getMeasures().length>0&&t}#d(e){const t=this.hcProperties.qInterColumnSortOrder.indexOf(-1);if(-1===t)return!1;if(this.#u())return"columns"===e;if(void 0===this.hcProperties.qNoOfLeftDims)return"rows"===e;switch(e){case"rows":return t+1<=this.hcProperties.qNoOfLeftDims;case"columns":return t+1>this.hcProperties.qNoOfLeftDims;default:return!1}}#f(e,t=!0){const n=e=>-1===e?-1:e.qDef.cId;if("measures"===e)return this.getMeasures().concat(t?this.getAlternativeMeasures():[]).map(n);const r=this.#i(e),i=this.getDimensions(),o=r.map((e=>-1===e?-1:i[e]));switch(e){case"rows":return o.concat(t?this.getAlternativeRowDimensions():[]).map(n);case"columns":return o.concat(t?this.getAlternativeColumnDimensions():[]).map(n);default:throw new Error(`Unknown section in #isCorruptRankedList: ${e}`)}}isRankedListCorrupt(e){const t=this.hcProperties.rankedList?.[e],n=this.properties.qInfo?.qId;if(!t)return!0;if(new Set(t).size!==t.length){const r=t.filter(((e,n)=>t.indexOf(e)!==n));return console.warn("Corrupt ranked list detected: duplicate ids",{duplicates:r,section:e,chartId:n}),!0}const r=this.#f(e);if(t.length!==r.length)return console.warn("Corrupt ranked list detected: length mismatch",{section:e,chartId:n,fieldIds:r,rankedList:t,diff:new Set(r).symmetricDifference(new Set(t))}),!0;const i=r.filter((e=>!t.includes(e)));if(i.length>0)return console.warn("Corrupt ranked list detected: missing ids",{missingIds:i,section:e,chartId:n}),!0;const o=this.#f(e,!1),a=t.filter((e=>o.includes(e))),s=o.filter(((e,t)=>e!==a[t]));return s.length>0&&(console.warn("Corrupt ranked list detected: main field order mismatch",{section:e,chartId:n,orderMismatchIds:s}),!0)}createRankedList(e){switch(e){case"rows":case"columns":return this.#h({section:e});case"measures":return this.#p();default:throw new Error(`Unknown section in getRankedList: ${e}`)}}#h({section:e}){const t=this.getDimensions(),n=this.#i(e),r="columns"===e?this.getAlternativeColumnDimensions():this.getAlternativeRowDimensions(),i=n.map((e=>-1===e?-1:t[e].qDef.cId));return i.push(...r.map((e=>e.qDef.cId))),this.#s(e,i)}#p(){if(void 0!==this.hcProperties.rankedList?.measures)return this.hcProperties.rankedList.measures;const e=[...this.getMeasures(),...this.getAlternativeMeasures()].map((e=>e.qDef.cId));return this.#s("measures",e)}#m({section:e,cId:t,fields:n,addLast:r}){const i=this.#o(e),o=n.findIndex((e=>e.qDef.cId===t)),a=n[o+1]?.qDef.cId,s=n[o-1]?.qDef.cId;if(r)i.push(t);else if(o>=0)if(a){const e=i.indexOf(a);i.splice(e,0,t)}else if(s){const e=i.indexOf(s);i.splice(e+1,0,t)}else i.push(t);return void 0===this.hcProperties.rankedList&&(this.hcProperties.rankedList={}),this.hcProperties.rankedList[e]}#t({section:e,cId:t,alternative:n=!1,addLast:r=!1}){if(void 0===this.hcProperties.rankedList?.[e])return this.#h({section:e});let i=[];return i="columns"===e?n?this.getAlternativeColumnDimensions():this.getColumnDimensions():n?this.getAlternativeRowDimensions():this.getRowDimensions(),this.#m({section:e,cId:t,fields:i,addLast:r})}#r({cId:e,alternative:t=!1,addLast:n=!1}){if(void 0===this.hcProperties.rankedList?.measures)return this.#p();const r=t?this.getAlternativeMeasures():this.getMeasures();return this.#g(),this.#m({section:"measures",cId:e,fields:r,addLast:n})}#g(){const e=this.#o("rows"),t=this.#o("columns");this.#d("rows")&&!e.includes(-1)?e.push(-1):this.#d("columns")&&!t.includes(-1)&&t.push(-1)}#y(){if(this.hcProperties.qInterColumnSortOrder.includes(-1))return;const e=this.#o("rows"),t=this.#o("columns"),n=e.indexOf(-1),r=t.indexOf(-1);-1!==n&&e.splice(n,1),-1!==r&&t.splice(r,1)}#n({cId:e,section:t}){const n=this.#o(t),r=n.indexOf(e);-1!==r&&(n.splice(r,1),this.#y())}async moveMeasureToAlternative(e){const t=this.getMeasures().findIndex((t=>t.qDef.cId===e)),n=this.#a("measures"),r=n.indexOf(e);if(-1===t)return;const i=await this.removeMeasure(t);if(void 0===i)return;const o=n.slice(r+1).find((e=>this.getAlternativeMeasures().some((t=>t.qDef.cId===e)))),a=this.getAlternativeMeasures().findIndex((e=>e.qDef.cId===o));await this.addAlternativeMeasures(i,-1===a?void 0:a),this.#s("measures",n)}async moveMeasureFromAlternative(e){const t=this.getAlternativeMeasures().findIndex((t=>t.qDef.cId===e)),n=this.#a("measures"),r=n.indexOf(e);if(-1===t)return;const i=await this.removeMeasure(t,!0);if(void 0===i)return;const o=this.getMeasures().map((e=>e.qDef.cId)),a=n.slice(r+1).find((e=>o.includes(e))),s=o.findIndex((e=>e===a));await this.addMeasure(i,!1,-1===s?void 0:s),this.#s("measures",n)}async moveDimensionToAlternative(e){const t=this.#l(e),n=this.getDimensions().findIndex((t=>t.qDef.cId===e));if(-1===n||null===t)return;const r=this.#a(t),i=r.indexOf(e),o="columns"===t,a=await this.removeDimension(n,!1,o),s=r.slice(i+1).find((e=>this.getAlternativeDimensions().some((({qDef:t})=>t.cId===e))));let l=this.getAlternativeDimensions().findIndex((({qDef:e})=>e.cId===s));l=-1===l?void 0:l,await this.addAlternativeDimension(a,o,l),this.#s(t,r)}async moveDimensionFromAlternative(e){const t=this.#l(e),n=this.getAlternativeDimensions().findIndex((t=>t.qDef.cId===e));if(-1===n||null===t)return;const r=this.#a(t),i=r.indexOf(e),o="columns"===t,a=await this.removeDimension(n,!0,o),s=this.#f(t,!1),l=r.slice(i+1).find((e=>s.includes(e)));let c=s.findIndex((e=>e===l));c=-1===c?void 0:c,await this.addDimension(a,o,c),this.#s(t,r)}movePseudoDimension({toIndex:e,toSection:t}){const n=this.#l(-1);if(null===n)return void console.error("Cannot move pseudo dimension, unable to find it in any section",{toIndex:e,toSection:t});const r="columns"===t,i=n===t,o=this.#a(t);if(i){const e=o.indexOf(-1);o.splice(e,1)}else{const i=this.#o(n),o=i.indexOf(-1);if(-1===o)return void console.error("Couldn't delete pseudo dimension from current section",{toIndex:e,toSection:t,fromSection:n});i.splice(o,1),this.hcProperties.qNoOfLeftDims=r?Math.max(0,this.hcProperties.qNoOfLeftDims-1):this.hcProperties.qNoOfLeftDims+1}const a=o.slice(0,e).filter((e=>this.#c(e))).length,s=e-a,l=r?this.hcProperties.qNoOfLeftDims+s:s,c=this.hcProperties.qInterColumnSortOrder.indexOf(-1);this.hcProperties.qInterColumnSortOrder.splice(c,1),this.hcProperties.qInterColumnSortOrder.splice(l,0,-1),o.splice(e,0,-1),this.#s(t,o)}async moveDimension({cId:e,toIndex:t,toSection:n}){const r=this.#l(e),i=this.#c(e);if(null===r)return void console.error("Cannot move dimension, unable to find it in any section",{cId:e});const o=(i?this.getAlternativeDimensions():this.getDimensions()).findIndex((({qDef:t})=>t.cId===e));if(-1===o)return void console.error("Couldn't find dimension to move",{cId:e,toIndex:t,toSection:n});const a=this.#a(n),s=a.indexOf(e);-1!==s&&a.splice(s,1);const l=a.slice(0,t).filter((e=>this.#c(e)!==i)).length,c=t-l,u="columns"===n,d="columns"===r,f=await this.removeDimension(o,i,d);await this.addDimension(f,u,c,i),a.splice(t,0,e),this.#s(n,a)}async moveMeasure({cId:e,toIndex:t}){const n=this.#c(e),r=(n?this.getAlternativeMeasures():this.getMeasures()).findIndex((t=>t.qDef.cId===e));if(-1===r)return void console.error("Cannot move measure, unable to find it in any section",{cId:e});const i=this.#a("measures"),o=i.indexOf(e);-1!==o&&i.splice(o,1);const a=i.slice(0,t).filter((e=>this.#c(e)!==n)).length,s=t-a,l=await this.removeMeasure(r,n);void 0!==l&&(await this.addMeasure(l,n,s),i.splice(t,0,e),this.#s("measures",i))}getLabels(){return this.getMeasures().filter((e=>!e.qLibraryId&&!!e.qDef.qLabel)).map((e=>e.qDef.qLabel))}IsHCInStraightMode(){return"S"===this.hcProperties.qMode}getFilters(){return this.properties.filters??[]}getFilter(e){return this.getFilters().find((t=>t.id===e))}addFilterField(e){const t=e.qTags??e.tags,n=Array.isArray(t)&&t.includes("$numeric"),r=e.isDerived,i=Array.isArray(this.properties.filters)?this.properties.filters:[],o={type:"values",field:r?e.value??e.fullname:e.name??e.label??e.field,options:{values:[]},exclude:!1,id:EK(),isNumeric:n};return i.push(o),this.properties.filters=i,this.properties.qHyperCubeDef.qContextSetExpression=bK(i),o}addFilters(e){const t=[];for(const n of e)t.push(this.addFilterField(n));return t}#v(e){const t=this.getFilters();return t.splice(e,1),this.properties.qHyperCubeDef.qContextSetExpression=bK(t),t}removeFilters(e){if(0===e.length)return[];let t=[];const n=[...e].sort(((e,t)=>t-e));t=this.getFilters().filter(((t,n)=>e.includes(n)));for(const e of n)this.#v(e);return t}getAddDimensionLabel(){return this.#e.get("Visualization.Requirements.AddDimension")}}var qK={exports:{}};!function(e){self,e.exports=(()=>{var e={909:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(null!=(t=arguments[f]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(p&&i&&(a(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&a(r)?r:{},s(d,{name:n,newValue:e(p,u,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}},8:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(null!=(t=arguments[f]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(p&&i&&(a(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&a(r)?r:{},s(d,{name:n,newValue:e(p,u,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{r.r(i),r.d(i,{default:()=>Pe});var e=r(229),t=r.n(e);const n=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},o=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},a={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var s="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function c(e){return s+e+l}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=r.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function d(e){return!(!e.fullAccumulation&&!e.fullRange)}function f(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function h(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function p(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function m(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function v(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(y("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(y("MaxString(".concat(t,")")),")'\"}")}function b(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(r&&1===r.length){var c=v(u(r[0],i),p(0));return"".concat(a,"({1<").concat(c,">}").concat(l,")")}if(r&&2===r.length){var d=u(r[0],i),f=u(r[1],i),h=p(0),m=p(1),g=v(d,h),y=v(f,m);return"".concat(a,"({1<").concat(g,",").concat(y,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function x(e){return"".concat(e,"(")}function w(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const S={isFullRange:d,getNumDimensions:w,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=c(h(t));if(!n.showExcludedValues)return a;var s=b({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var u=p(0);return"If(Count(".concat(u,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var d=p(0),f=p(1);return"If(Count(".concat(d,") * Count(").concat(f,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:f,getNumStepComp:function(e,t){if(!d(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return f(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return m(e,t)+n+g(r)},getFunctionPrefix:x,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return x(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:b,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout,i=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===i&&2===w({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=p(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(a,")"):r},simplifyExpression:h,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+s.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:u,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=w({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:c,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:p,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var r=t||e.outputExpression;if(e.base&&e.base.qDef&&(r=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var i=n.qHyperCubeDef.qMeasures.find((function(t){return t.qDef.base&&t.qDef.base.qLibraryId&&e.base&&e.base.qLibraryId?t.qDef.base.qLibraryId===e.base.qLibraryId:null}));i&&t!==i.qDef.qLabel&&(r=i.qLibraryId||i.qDef.base.qLibraryId?"[".concat(i.qDef.qLabel,"]"):i.qDef.base.qDef);var o=function(e){var t=a.OPTIONS.find((function(t){return t.value===e.decomposition}));return t?a.EXPRESSIONS[t.value]:""}(e);r=r.startsWith("=")?r.substr(1):r,r="".concat(o,"(").concat(r,", ").concat(e.steps,")")}return r},getDecomposition:function(e){var t="observed";return Object.values(a.EXPRESSIONS).find((function(n){var r=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return a.EXPRESSIONS[n]&&r.includes(a.EXPRESSIONS[n].toLowerCase())&&(t=n),n})),t}};function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function k(e){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k(e)}var E=t().bind(null,!0),M={},_=Array.isArray;function R(e){return null!=e&&!Array.isArray(e)&&"object"===k(e)}function I(e){return void 0===e}function D(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function P(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach((function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=I(e[n||t])?o:e[t],e=e[n||t]}})),e}function A(e,t){var n=!0;if(R(e)&&R(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(r){A(e[r],t[r])||(n=!1)})),n);if(_(e)&&_(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!A(e[r],t[r]))return!1;return!0}return e===t}M.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach((function(i){var o=function(e){return e?E({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);A(o,a)||D(t,i)||(I(a)?r.push({op:"add",path:s,value:o}):R(o)&&R(a)?r=r.concat(M.generate(a,o,s)):_(o)&&_(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&I(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(A(t,i))return r;if(!I(t[0])&&I(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(r.push({op:"remove",path:"".concat(n,"/").concat(s)}),i.splice(s,1)):r=r.concat(M.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))})),Object.keys(e).forEach((function(i){I(t[i])&&!D(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})})),r},M.apply=function(e,t){t.forEach((function(t){var n,r,i=P(e,t.path),o=t.path.split("/").splice(-1)[0],a=o&&Number.isNaN(+o)?i[o]:i[+o]||i,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,a=e),"add"===t.op||"replace"===t.op)if(_(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(_(a)&&_(t.value)){var l,c=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return C(e)}(r=c)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return C(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(e,t):void 0}}(r)||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.")}())}else if(R(a)&&R(t.value))n=a,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!D(n,e)&&delete n[e]})),E(a,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[o]=t.value}else if("move"===t.op){var u=P(e,t.from);_(i)?i.splice(+o,0,u.splice(+s,1)[0]):(i[o]=u[s],delete u[s])}else"remove"===t.op&&(_(i)?i.splice(+o,1):delete i[o])}))},M.clone=function(e){return E({},e)},M.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},M.updateObject=function(e,t){Object.keys(e).length?M.apply(e,M.generate(e,t)):E(e,t)};const O=M,L=function(e,n,r){if(!e)return Promise.resolve();var i=O.generate(n,r);return t()(!0,n,r),i&&i.length?(i=i.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(i,!0)):Promise.resolve()};var T="accumulation";function q(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===T)return n[r]}function N(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===T)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var j={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const z={translationKey:"properties.modifier.accumulation",needDimension:S.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=S.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=S.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),d=S.getNumStepComp(n,l),f=S.getAboveComp(n,l,u,d),h=S.getRangeComp("RangeSum",f);if(S.needDimension({modifier:n,properties:r,layout:i})){var p=S.getDimComp(c,1),m=S.getDimComp(c,0),g=S.getAggrComp(h,p,m);h=n.showExcludedValues?S.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:s,valueComp:g}):g}return h},extractInputExpression:S.extractInputExpression,initModifier:function(e){S.initModifier(e,j)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(N(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(N(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(N(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(N(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=q(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=q(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(N(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return S.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(T))return!1;var o=q(t,e);return o&&!o.disabled}};return n}};var F="movingAverage";function W(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===F)return n[r]}function $(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===F)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var B={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const V={translationKey:"properties.modifier.movingAverage",needDimension:S.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,a=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var c=s;void 0===c&&(c=S.getNumDimensions({properties:i,layout:a}));var u=o(i,"qHyperCubeDef.qDimensions",[]),d=r.showExcludedValues&&r.nullSuppression,f=S.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:d}),h=S.getNumStepComp(r,c),p=S.getAboveComp(r,c,f,h);if(r.nullSuppression)t=S.getRangeComp("RangeAvg",p);else{var m=S.getRangeComp("RangeSum",p),g=function(e,t){var n=S.getRowNoComp(e,t);if(!S.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,c);t="".concat(m," / ").concat(g)}var y=t;if(S.needDimension({modifier:r,properties:i,layout:a})){var v=S.getDimComp(u,1),b=S.getDimComp(u,0),x=S.getAggrComp(y,v,b);y=r.showExcludedValues?S.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:S.extractInputExpression,initModifier:function(e){S.initModifier(e,B)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat($(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat($(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat($(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat($(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=W(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=W(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat($(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat($(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return S.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(F))return!1;var o=W(t,e);return o&&!o.disabled}};return n}};var H="timeSeriesDecomposition";function U(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===H)return n[r]}function G(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===H)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Y={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const K={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:S.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?S.generateTSDExpression(n,t,r):t},extractInputExpression:S.extractInputExpression,initModifier:function(e,t){S.initModifier(e,Y),""===e.decomposition&&t&&(e.decomposition=S.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(G(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:a.OPTIONS},steps:{refFn:function(t){return"".concat(G(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=U(t,e);if(r){var i=r.steps;r.steps="number"!=typeof i||Number.isNaN(i)?2:Math.abs(i),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map((function(e){return e.qDef.modifiers.map((function(e){return"timeSeriesDecomposition"===e.type?e.steps=i:e.steps=e.steps,e})),e}))}},show:function(t){var n=U(t,e);return n&&!n.fullRange}}},show:function(e,t){return S.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(H))return!1;var o=U(t,e);return o&&!o.disabled}};return n}};var X="difference";function J(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===X)return n[r]}function Q(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===X)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Z={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:S.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:S.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=S.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=S.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),d=S.getAboveComp(n,l,u),f="".concat(u," - ").concat(d);if(S.needDimension({modifier:n,properties:r,layout:i})){var h=S.getDimComp(c,1),p=S.getDimComp(c,0),m=S.getAggrComp(f,h,p);f=n.showExcludedValues?S.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:s,funcComp:"Only",valueComp:m}):m}return f},initModifier:function(e){Object.keys(Z).forEach((function(t){void 0===e[t]&&(e[t]=Z[t])}))},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(Q(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(Q(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(Q(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return S.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(X))return!1;var o=J(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===te)return n[r]}function re(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===te)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function ie(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}var oe={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function ae(e){return 2===e?"{1}":""}function se(e,t,n){return 1===e?"{$<".concat(S.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ce(e,t,n){return 0===e&&t>1?"<".concat(S.getDimDefWithWrapper(n),">"):""}const ue={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:S.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=S.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=S.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),d=n.selectionScope,f=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=ae(t),l=se(t,n,r),c=""===s&&""===l?"":s||l,u=le(i,o),d=ce(i,o,a),f=function(e){for(var t=[],n=0;n<e;n++)t[n]=S.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(c," ").concat(u).concat(d," Aggr(").concat(c," ").concat(e,", ").concat(f,"))")}(u,d,n.field,n.value,f,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach((function(t){void 0===e[t]&&(e[t]=oe[t])}))},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(re(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,options:function(n){return function(e,t,n){var r=[{value:0,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:1,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:2,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return r=function(e,t){if(1===e){var n=ie(t,0);t.splice(n,1)}return t}(ne(e,n).dimensionalScope,r),r}(n,t,e)}},field:{refFn:function(t){return"".concat(re(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then((function(e){return e.map((function(e){return{label:e.qName,value:e.qName}}))}))},show:function(t){return 1===ne(t,e).selectionScope}},value:{refFn:function(t){return"".concat(re(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return 1===ne(t,e).selectionScope}},dimensionalScope:{refFn:function(t){return"".concat(re(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,supportTooltip:!0,options:function(n,r){return function(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:0,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:1,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t){if(e<2){var n=ie(t,0);t.splice(n,1)}return t}(i,o),o=function(e,t){if(0===e){var n=ie(t,1);t.splice(n,1)}return t}(ne(e,r).selectionScope,o),o}(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(re(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(t,n){return 0===(ne(t,e).dimensionalScope||0)&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return S.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ce};var de="qDef.base",fe="qDef.qDef",he="qDef.base.qDef",pe="qLibraryId",me="qDef.base.qLibraryId";const ge={getExpression:function(e){var t=o(e,he);return void 0!==t?t:o(e,fe)},getExpressionRef:function(e){return void 0!==o(e,he)?he:fe},getLibraryIdRef:function(e){return o(e,me)?me:pe},getLibraryId:function(e){return o(e,me)||o(e,pe)},getLabelRef:function(e){return o(e,de)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,de)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ye="qDef.qDef",ve="qDef.base.qDef",be="qLibraryId",xe="qDef.base.qLibraryId",we="qDef.qLabel",Se="qDef.qLabelExpression",Ce="qDef.base.qLabel",ke="qDef.base.qLabelExpression",Ee="qDef.qAggrFunc",Me="qDef.base.qAggrFunc",_e={initBase:function(e,t){(t||_e.isValid(e))&&(n(e,ve,o(e,ye)),n(e,xe,o(e,be)),n(e,Ce,o(e,we)),n(e,ke,o(e,Se)))},restoreBase:function(e){_e.isValid(e)&&(n(e,ye,o(e,ve)),n(e,be,o(e,xe)),n(e,we,o(e,Ce)),n(e,Se,o(e,ke)),o(e,Ee)&&o(e,Me)&&n(e,Ee,o(e,Me)),delete e.qDef.base)},isValid:function(e){var t=o(e,ve),n=o(e,xe);return void 0!==t||void 0!==n}};const Re=_e;function Ie(e){return Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ie(e)}var De={accumulation:z,movingAverage:V,difference:ee,normalization:ue,timeSeriesDecomposition:K};const Pe={modifiers:De,apply:Oe,applyModifiers:Le,cleanUpMeasure:Te,destroy:function(e){e&&Ae[e.id]&&Ae[e.id].masterItemSubscriber&&(Ae[e.id].masterItemSubscriber&&Ae[e.id].masterItemSubscriber.unsubscribe(),delete Ae[e.id])},hasActiveModifiers:qe,getActiveModifier:Ne,initBase:Re.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return De[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return De[e]&&De[e].isApplicable({properties:n,layout:r})}))},measureBase:ge,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach((function(e){var t=Fe(e);Ge({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Qe({modifiers:t,properties:n,layout:r}))})),i&&!o},ifEnableTotalsFunction:je};var Ae={};function Oe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,r=e.properties,i=e.isSnapshot,a=void 0!==i&&i,s=e.masterItem,l=!1;Ae[n.id]=Ae[n.id]||{isFirstTime:!0};var c=Ae[n.id].isFirstTime;if(Ae[n.id].isFirstTime=!1,r&&"object"===Ie(r))return Le({model:n,properties:r});var u=n?n.layout:void 0,d=o(u,"qSelectionInfo.qInSelections");if(a||d)return Promise.resolve(l);var f=o(u,"qHyperCube.qMeasureInfo"),h=Ae[n.id].lastReloadTime;if(Ae[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),qe({measures:f,layout:u})){var p=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return o(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ue({measure:e,properties:n,layout:r})}))}({measures:t,layout:n})}({measures:f,layout:u,model:n,lastReloadTime:h});return p||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return Ge({modifiers:Fe(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:f,layout:u,masterItem:s,isFirstTime:c})?n.getEffectiveProperties().then((function(e){var r=t()(!0,{},e);$e(r);var i=Ze(r);return Ye({model:n}).then((function(t){return Ke({libraryIds:i,model:n}).then((function(i){return p&&function(e){var t=e.properties;ze(t).forEach((function(e){return function(e){var t=e.measure;if(Ue({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach((function(e){if("object"===Ie(e)&&!e.disabled){if(n++,"object"!==Ie(De[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=De[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&Ve(t)&&S.simplifyExpression(t.qDef.base.qDef)!==S.simplifyExpression(r)&&(t.qDef.base.qDef=r)}}))}}({measure:e,properties:t})}))}({properties:r}),Le({model:n,oldProperties:e,properties:r,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:i,dimensionAndFieldList:t})}))}))})):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===Ie(e.base)}))}(f)?n.getEffectiveProperties().then((function(e){return function(e){var n=e.model,r=e.properties,i=Ze(r);return et({model:n,libraryIds:i}).then((function(){var e=t()(!0,{},r);return ze(r).forEach((function(e){return Te(e)})),Je({oldProperties:e,newProperties:r,model:n})}))}({model:n,properties:e})})):Promise.resolve(l)}function Le(e){var n=e.model,r=e.oldProperties,i=e.properties,a=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,c=e.masterItem,u=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===r&&(r=l?t()(!0,{},i):i),$e(i);var f=Ze(i);return et({model:n,libraryIds:f,masterItem:c}).then((function(){return function(e){var n=e.measures,r=e.properties,i=e.model,a=e.libraryItemsProps,s=e.dimensionAndFieldList;if(n||(n=ze(r)),!n.length)return Promise.resolve();if(!qe({measures:n,properties:r}))return n.forEach((function(e){return Te(e)})),Promise.resolve();var l=a?void 0:Ze(r);return Ye({model:i,dimensionAndFieldList:s}).then((function(e){return Ke({libraryIds:l,model:i,libraryItemsProps:a}).then((function(i){n.forEach((function(n){Ge({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;Re.isValid(n)||Re.initBase(n,!0);var l=n.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach((function(e){if("object"===Ie(e)&&!e.disabled){if(s++,"object"!==Ie(De[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");De[e.type].initModifier(e,n);var l=n.qLibraryId||u&&u.qLibraryId;l?function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:De[r.type].generateExpression({expression:s,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=l,n.qDef.qDef=r.outputExpression,(n.qDef.qLabel||a.qMeasure.qLabel)&&(n.qDef.qLabel=a.qMeasure.qLabel),(n.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(n.qDef.qLabelExpression=a.qMeasure.qLabelExpression),n.qDef.quarantine&&n.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(n.qDef.qNumFormat=a.qMeasure.qNumFormat,n.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete n.qLibraryId,n.qDef.coloring=a.qMeasure.coloring,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,libraryId:l,properties:r,libraryItemsProps:i,dimensionAndFieldList:a}):function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof De[r.type].updateModifier&&De[r.type].updateModifier(r,i.qHyperCubeDef);var a=ge.getExpression(n),s=""===a?a:De[r.type].generateExpression({expression:a,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=s,n.qDef.qDef=r.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||a,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:r,dimensionAndFieldList:a}),function(e){var t=o(e,"qDef.qAggrFunc");"Expr"!==t||je(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&je(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(n)}}))}({measure:n,properties:r,libraryItemsProps:i,dimensionAndFieldList:e}),Be(n)):Te(n)}))}))}))}({measures:a,properties:i,model:n,libraryItemsProps:u,dimensionAndFieldList:d}).then((function(){return l?Je({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)}))}))}function Te(e){!function(e){var t=Fe(e);return Array.isArray(t)&&t.some((function(e){return"object"===Ie(e)&&!e.disabled&&!De[e.type]}))}(e)?Re.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Be(e)}function qe(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ge({modifiers:Fe(e),properties:n,layout:r})}))}function Ne(e){var t=Fe(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(De[r.type]&&!r.disabled)return r}}function je(e){var t=Ne(e);return!t||De[t.type].enableTotalsFunction(e)}function ze(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function Fe(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function We(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function $e(e){ze(e).forEach((function(e){return function(e){var n=Ne(e);n&&(void 0!==n.outputExpression&&We(n)!==e.qDef.qDef?delete e.qDef.base:!Re.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)}))}function Be(e){var t=Fe(e);Array.isArray(t)&&t.forEach((function(t){"object"===Ie(t)&&(t.disabled||!De[t.type]&&We(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function Ve(e){return e.base||e.qDef&&e.qDef.base}function He(e){var t=Ve(e);return e.qLibraryId||t&&t.qLibraryId}function Ue(e){var t=e.measure,n=e.properties,r=e.layout;return!He(t)&&Ge({modifiers:Fe(t),properties:n,layout:r})}function Ge(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some((function(e){return!("object"!==Ie(e)||e.disabled||!De[e.type])&&(void 0===i[e.type]&&(i[e.type]=De[e.type].isApplicable({properties:n,layout:r})),i[e.type])}))}function Ye(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then((function(e){i.dimensionList=e}));r.push(o);var a=t.app.getFieldList().then((function(e){i.fieldList=e}));return r.push(a),Promise.all(r).then((function(){return i}))}function Ke(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),Promise.all(s).then((function(){return a}))}function Xe(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Je(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Xe)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&o(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):L(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then((function(){return i})):Promise.resolve(i)}function Qe(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===Ie(e)&&!e.disabled&&De[e.type]&&De[e.type].needDimension({modifier:e,properties:n,layout:r})}))}function Ze(e){var t=ze(e),n=[],r=[],i=!1;return t.forEach((function(t){var r=Fe(t);if(Ge({modifiers:r,properties:e})){var o=He(t);o&&n.push(o),i=i||Qe({modifiers:r,properties:e})}})),o(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&r.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:r}}function et(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(Ae[t.id].masterItemSubscriber=Ae[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},a={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=o(e,"qInfo.qType");return n&&s[n]&&s[n].forEach((function(n){t[n]=o(e,n)})),JSON.stringify(t)}function c(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function u(e,n){return t.app[n](e).then((function(t){r[e]={listener:t.layoutSubscribe(c),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,o=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach((function(e){i[e]=!0})),a={},t.forEach((function(e){a[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(r).forEach((function(e){i[e]||a[e]||(r[e].listener.dispose(),delete r[e])})),t.app&&(Object.keys(i).forEach((function(e){i[e]&&!r[e]&&s.push(u(e,"getMeasure"))})),Object.keys(a).forEach((function(e){a[e]&&!r[e]&&s.push(u(e,"getDimension"))}))),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach((function(e){r[e].listener.dispose()})),r={}}}}({model:t,callback:function(e){return Oe({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),Ae[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}})(),t.default=i.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}function t(n){var r=e(n%62),i=Math.floor(n/62);return i>0?t(i)+r:r}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}n.d(r,{default:()=>$e});const o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(""!==a){if(void 0===i[a]||null===i[a])return n;i=i[a]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return t(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||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.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e)||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.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}const d={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:u};var f=n(8),h=n.n(f);const p=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,a(r.qDimensions));var s,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=i.excludedDimensions).push.apply(s,a(l))},m=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var a,s=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=i.excludedMeasures).push.apply(a,l(s))},g=function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&d.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},y=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},v=function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach((function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])})),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach((function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)}))}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},b=function(e){e.forEach((function(e){h().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))};function x(e,t,n){var r,i,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=o.getValue(e,t);if(!o.isAtomicValue(s))try{if((i=(i=(r=JSON.stringify(s)).match(/:\{/g))?i.length:0)>2&&!a)return;s=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var l=o.getValue(e,"qLayoutExclude.quarantine");l[n]||(l[n]={}),l[n][t]=s}var w=n(909),S=n.n(w);function C(e,t){var n=S()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function k(e,t){return S()(!0,{},t,e)}function E(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var M=Math.pow(2,53)-1;function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const I=function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},D=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},P=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},A=function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},O=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},L=function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=n.data[0];for(t=0;t<s.dimensions.length;++t){var l=C(s.dimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var c=C(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},T=function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var l=k(s.measures[t],a);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var c=k(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},q=function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},a=r.measures||{max:0},s=E(a.max,i.dimensions.length,M),l=E(a.min,i.dimensions.length,0);return{maxDimensions:E(o.max,s,M),minDimensions:E(o.min,l,0),maxMeasures:s,minMeasures:l}},N=function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(d.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,d.indexRemoved(n.qInterColumnSortOrder,o))},j=function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach((function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=S()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some((function(e){return"general"===e.key}))}(t.properties,e)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]})),null===(i=S()(!0,{},n,i)).components&&(i.components=[]),i},z=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>i&&i>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>r||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!i&&a.measures.length>0||!n&&a.dimensions.length>0},F=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>n&&n>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>r)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>i&&i>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},W=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.dimensions&&"function"==typeof r.dimensions.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return _(e)}(t=a.qDimensions)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(e,t):void 0}}(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.")}();a.qDimensions=[],s.forEach((function(e){a.qDimensions.push(e),r.dimensions.added(e,n)}))}},$=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.measures&&"function"==typeof r.measures.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return R(e)}(t=a.qMeasures)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return R(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?R(e,t):void 0}}(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.")}();a.qMeasures=[],s.forEach((function(e){a.qMeasures.push(e),r.measures.added(e,n)}))}},B=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&h().isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))};function V(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach((function(t){o.setValue(e,t,n[t])})),delete e.qLayoutExclude.quarantine[t],!0)}const H={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=o.getValue(a,n||""),l=s.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),p({exportFormat:i,qHyperCubeDef:l}),m({exportFormat:i,qHyperCubeDef:l}),g({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,y({exportFormat:i,properties:a}),n&&(i.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),v({exportFormat:i,properties:a}),r||b(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(x(i.properties,"filters","storedFilters",!0),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(x(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(x(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,a=void 0===i?{}:i,s=e.defaultPropertyValues,l=void 0===s?{}:s,c=e.hypercubePath,u=e.extension,d=e.supportedFilters,f=void 0===d||d,h=e.isHCModifierSupported,p=void 0===h||h,m={qChildren:[]},g=j({exportFormat:t,initialProperties:r,hypercubePath:c}),y=o.getValue(r,c||"").qHyperCubeDef,v=o.getValue(g,c||"").qHyperCubeDef,b=q({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,w=b.minDimensions,S=b.maxMeasures,C=b.minMeasures,k=l.defaultDimension,E=void 0===k?A():k,M=l.defaultMeasure,_=void 0===M?O():M;v.qDimensions.length=0,v.qMeasures.length=0,z({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:S,minMeasures:C})&&F({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:S,minMeasures:C,newHyperCubeDef:v}),L({exportFormat:t,maxDimensions:x,minDimensions:w,newHyperCubeDef:v,defaultDimension:E}),T({exportFormat:t,maxMeasures:S,minMeasures:C,newHyperCubeDef:v,defaultMeasure:_}),W({newProperties:g,dataDefinition:a,hypercubePath:c}),$({newProperties:g,dataDefinition:a,hypercubePath:c}),N({exportFormat:t,newHyperCubeDef:v}),D("qMaxStackedCells",y,v),D("qNoOfLeftDims",y,v),P("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),P("qMode",y,v,"S"),P("qReductionMode",y,v,"N"),P("qSortbyYValue",y,v),P("qIndentMode",y,v),P("qShowTotalsAbove",y,v),I(g,t,r),m.qProperty=g;var R=o.getValue(u||{},"support.modifiers");return B({measures:v.qMeasures,modifierTypes:R}),f&&V(m.qProperty,"storedFilters"),"S"===v.qMode&&p&&V(m.qProperty,"dynamicScript"),m}};var U={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function G(e,t,n,r){t=t||[];var i=u(e,r,n),o=u(t,r,n);if(-1!==i&&-1===o){var a=e.splice(i,1);t.push(a[0])}return t}function Y(e,t){return e.length!==t}const K={create:function(e,t){if(!e||!U[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach((function(e){n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(G(a,t,r,i),Y(t,s))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},X={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},J={colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>0&&X.getNumMeasures(e)<=1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)>0},expression:function(e){return X.getNumMeasures(e)>=1}}},Q={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumMeasures(e)>=1}}};var Z={scatterplot:Q,"sn-scatter-plot":Q,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)<=1},expression:function(e){return X.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>=1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)>=1},expression:function(e){return X.getNumDimensions(e)>=1}}},distributionplot:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var r=d.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function te(e,t){var n=K.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)})),t.forEach((function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)}))}function ne(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function re(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;te(r,i);var l=r[r.length-1];if(l){var c=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),u=o.getValue(t,"color.formatting.qNumFormat"),f=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var h=K.create(K.IDMAP.COLOR_BY_ALTERNATIVE);switch(c.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:h,label:s,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:f});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.qNumFormat,o=e.isCustomFormatted;e.isDimension||(t.matchMeasure=d.findIndexByPropertyValue(n,"qLibraryId",r.key),i&&(t.qNumFormat=i,t.isCustomFormatted=o)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:h,measures:a,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:f})}n?(h.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(h)):l.qAttributeExpressions.push(h)}}}function ie(e,t,n,r){var i,o,a,s={};switch(e){case"dimension":n.qLibraryId?(s.type="dimension",s.name=n.qLibraryId,s.id=n.qLibraryId):(s.type="field",t?(s.name=n.label||n.qDef,s.id=n.qDef):(s.name=n.qDef.qFieldDefs[0],s.label=(a=n.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":i=function(e,t){return t?e.qLibraryId:h().measureBase.getLibraryId(e)}(n,t),i?(s.type="measure",s.name=i,s.id=i,o=function(e,t){return h().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r),o&&(s.expression=o)):(s.type="expression",t?(s.name=n.label||n.qExpression,s.id=n.qExpression):(s.name=n.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}const oe={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function ae(e,t,n,r){var i=t.type,o=e.color,a=o.mode,s=X.getItemLabel(t);switch(ne(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||X.wrapFieldName(t.name),key:X.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:s,key:t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&oe.useMasterNumberFormat(o.formatting)}o.auto=!1,o.mode=a}function se(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byDimDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=ie("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,ae(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),a=Number(i[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===r&&"point"===s}(n,e,t)?0:n.length-1],i=K.IDMAP.COLOR_BY_ALTERNATIVE,a=d.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return ae(e,ie("dimension",!!a,a||r)),!!a}(e,t))return;re({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}const le=function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var r=e.qLayoutExclude;r&&(r.changed||(r.changed={}),r.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},ce=function(e,t){var n={primary:!0};if(e){var r=(Z[t]||J).colorModeOptions||J.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},ue=function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},de=function(e,t){var n,r=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),a=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),l=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?te(a,l):!(n={auto:i,colorMode:r,dimensions:a}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?se(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==s&&!i.length)}({auto:i,colorMode:r,dimensions:a,measures:s,properties:e})?function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=ie("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,ae(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],a=K.IDMAP.COLOR_BY_ALTERNATIVE,s=d.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return ae(e,ie("measure",!!s,s||r[0])),!!s}(e,t))return;re({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),te(r,a)}(e,t)},fe=function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},he=function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},pe=function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},me=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},ge=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ye={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=H.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=K.IDMAP,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return K.moveByIdFromGroup(a,[],"qAttributeDimensions",c),K.moveByIdFromGroup(a,[],"qAttributeExpressions",c),K.moveByIdFromGroup(s,[],"qAttributeExpressions",u),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=H.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:c}),d=u.qProperty,f=o.getValue(d,"visualization"),h=o.getValue(d,"qHyperCubeDef.qDimensions",[]),p=o.getValue(d,"color.mode",""),m=o.getValue(d,"color.auto",""),g=ce(d,f),y=ue({canColorBy:g,autoColor:m,colorMode:p,dimensions:h});return g[p]?he({shouldUpdateColorBy:y,properties:d})&&pe(d):me(d),y&&de(d,"qHyperCubeDef."),ge(d)&&le(d,"color.persistent",!0),fe(h),u}};var ve=["bar","marker","line"];const be=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?V(n,"unsupportedAutoMinMax")||S()(n.measureAxis,t.measureAxis):V(n,"supportedAutoMinMax")||S()(n.measureAxis,t.measureAxis)},xe=function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,a=i.qHyperCubeDef,s=i.measureAxis;if(function(e){var t=e.initialProperties;return!(!e.exportFormat.properties.measureAxes||t.measureAxes||!t.measureAxis||void 0===t.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach((function(e){if(e.qDef.series){var n=e.qDef.series,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),ve.includes(r)&&t[i].type[r]++,t[i].type.total++}})),t}(a);l.length?(o&&(t=l.filter((function(e){return e.type[o]>0})).sort((function(e,t){return t.type[o]-e.type[o]}))),t&&t.length||(t=l.sort((function(e,t){return t.type.total-e.type.total}))),t&&t[0]&&S()(s,n.properties.measureAxes[t[0].axis])):S()(s,n.properties.measureAxes[0])}},we=function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}},Se={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=ye.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),s=a.properties;return o?(x(s,"measureAxis.min","supportedAutoMinMax"),x(s,"measureAxis.max","supportedAutoMinMax")):(x(s,"measureAxis.min","unsupportedAutoMinMax"),x(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=ye.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:c}),d=u.qProperty;return be({initialProperties:n,properties:d}),xe({exportFormat:t,initialProperties:n,properties:d,measureType:a}),we(d.qHyperCubeDef),d.qHyperCubeDef.qColumnOrder=[],d.qHyperCubeDef.columnOrder=[],u}};function Ce(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function ke(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,a);if(void 0!==s){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var c=Ce(n,r,l);o.setValue(t,c,s),o.setValue(i,a,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}function Ee(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,"qDef.cId");if(s){var l=Ce(n,r,s),c=o.getValue(t,l);void 0!==c&&(o.setValue(i,a,c),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}var Me="qHyperCubeDef.qMeasures",_e="conditionalColoring",Re="measures",Ie="qDef.conditionalColoring";const De={quarantine:function(e){ke({properties:e,arrayPath:Me,quarantineName:_e,arrayName:Re,itemPath:Ie})},unquarantine:function(e){Ee({properties:e,arrayPath:Me,itemPath:Ie,arrayName:Re,quarantineName:_e})}};var Pe="qHyperCubeDef.qMeasures",Ae="measures",Oe="qHyperCubeDef.qDimensions",Le="dimensions",Te="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",qe="alternativeMeasures",Ne="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",je="alternativeDimensions",ze="qCalcCondition",Fe="conditionalShowHide";const We={quarantine:function(e){ke({properties:e,arrayPath:Pe,quarantineName:Fe,arrayName:Ae,itemPath:ze}),ke({properties:e,arrayPath:Oe,quarantineName:Fe,arrayName:Le,itemPath:ze})},unquarantine:function(e){Ee({properties:e,arrayPath:Pe,quarantineName:Fe,arrayName:Ae,itemPath:ze}),Ee({properties:e,arrayPath:Oe,quarantineName:Fe,arrayName:Le,itemPath:ze})},quarantineAlternative:function(e){ke({properties:e,arrayPath:Te,quarantineName:Fe,arrayName:qe,itemPath:ze}),ke({properties:e,arrayPath:Ne,quarantineName:Fe,arrayName:je,itemPath:ze})},unquarantineAlternative:function(e){Ee({properties:e,arrayPath:Te,quarantineName:Fe,arrayName:qe,itemPath:ze}),Ee({properties:e,arrayPath:Ne,quarantineName:Fe,arrayName:je,itemPath:ze})}},$e={hypercube:H,colorChart:ye,axisChart:Se,quarantineProperty:x,unquarantineProperty:V,quarantineArrayProp:ke,unquarantineArrayProp:Ee,conditionalColoring:De,conditionalShow:We}})(),r.default})()}(qK);var NK=B(qK.exports);const jK="qHyperCubeDef.qMeasures",zK="measures",FK="qHyperCubeDef.qDimensions",WK="dimensions",$K="qDef.representation",BK="tableRepresentation",VK="qDef.conditionalColoring",HK="conditionalColoring",UK="qMiniChartDef",GK="miniChartDef";function YK(e){const{translator:t}=e;return{targets:[{path:"/qHyperCubeDef",dimensions:{min:1,max:1e3,description(e,n,r){const i="rows"===r?.type?"Visualizations.Descriptions.Row":"Visualizations.Descriptions.Column";return t.get(i)}},measures:{min:1,max:1e3,description:()=>t.get("Visualizations.Descriptions.Values")},filters:{description:()=>t.get("SimpleProperties.Filters.Filter")}}]}}const KK="qHyperCubeDef.qDimensions",XK="dimensions",JK="qOtherTotalSpec.qTotalMode",QK="totalMode",ZK={quarantine(e){NK.quarantineArrayProp({properties:e,arrayPath:KK,quarantineName:QK,arrayName:XK,itemPath:JK})},unquarantine(e){NK.unquarantineArrayProp({properties:e,arrayPath:KK,quarantineName:QK,arrayName:XK,itemPath:JK})}};function eX(e){const t=YK(e);return(e,n,r,i)=>{const o=NK.hypercube.importProperties({exportFormat:e,initialProperties:n,dataDefinition:t.targets[0],hypercubePath:i}),a=o.qProperty.qHyperCubeDef.qDimensions.length,s=o.qProperty.qHyperCubeDef.qMeasures.length;let l,c=o.qProperty.qHyperCubeDef.qInterColumnSortOrder,u=!0;a+s===c.length&&hT(o,"qProperty.qLayoutExclude.quarantine.interColSortOrder",c.concat());const d=o.qProperty.qLayoutExclude.quarantine?.pivotInterColSortOrder;d?(c=d,l=[...d],hT(o,"qProperty.qHyperCubeDef.qInterColumnSortOrder",c),o.qProperty.qLayoutExclude.quarantine&&delete o.qProperty.qLayoutExclude.quarantine.pivotInterColSortOrder):c.length=0;const f=+(c.indexOf(-1)>-1),h=a+f;if(h>c.length)for(let e=c.length;e<h;e++)c.indexOf(e)<0&&c.push(e-f);for(let e=c.length-1;e>=0;e--)c[e]>=a&&c.splice(e,1);s>1&&c.indexOf(-1)<0?c.push(-1):s<2&&c.indexOf(-1)>-1&&c.splice(c.indexOf(-1),1);const p=o.qProperty.qHyperCubeDef.qNoOfLeftDims??-1;if(a>0&&-1===p&&hT(o,"qProperty.qHyperCubeDef.qNoOfLeftDims",a),l?.length===c.length){for(let e=0;e<l.length;e++)if(l[e]!==c[e]){u=!1;break}u&&(NK.unquarantineProperty(o.qProperty,"noOfLeftDims"),NK.unquarantineProperty(o.qProperty,"excludedNoOfLeftDims "))}return NK.unquarantineProperty(o.qProperty,"rankedList"),NK.conditionalShow.unquarantine(o.qProperty),ZK.unquarantine(o.qProperty),(e=>{NK.unquarantineArrayProp({properties:e,arrayPath:FK,itemPath:$K,arrayName:WK,quarantineName:BK}),NK.unquarantineArrayProp({properties:e,arrayPath:jK,itemPath:$K,arrayName:zK,quarantineName:BK}),NK.unquarantineArrayProp({properties:e,arrayPath:jK,itemPath:VK,arrayName:zK,quarantineName:HK}),NK.unquarantineArrayProp({properties:e,arrayPath:jK,itemPath:UK,arrayName:zK,quarantineName:GK})})(o.qProperty),NK.unquarantineProperty(o.qProperty,"pivotTableIndentMode"),o}}function tX(e,t){const n=e.qProperty.qHyperCubeDef.qInterColumnSortOrder,r=n.slice(),i=n.indexOf(-1);i>-1&&n.splice(i,1);const o=NK.hypercube.exportProperties({propertyTree:e,hyperCubePath:t}),a=o.properties.qHyperCubeDef,s=a.qDimensions.length,l=a.qMeasures.length;let c=a.qInterColumnSortOrder;hT(o,"properties.qLayoutExclude.quarantine.pivotInterColSortOrder",r),NK.quarantineProperty(o.properties,"qHyperCubeDef.qNoOfLeftDims","noOfLeftDims"),delete o.properties.qHyperCubeDef.qNoOfLeftDims,NK.quarantineProperty(o.properties,"qHyperCubeDef.rankedList","rankedList"),delete o.properties.qHyperCubeDef.rankedList;const u=o.properties.qLayoutExclude.quarantine?.interColSortOrder;u&&(c=u,hT(o,"properties.qHyperCubeDef.qInterColumnSortOrder",c),hT(o,"data.0.interColumnSortOrder",c),o.properties.qLayoutExclude.quarantine&&delete o.properties.qLayoutExclude.quarantine.interColSortOrder);for(let e=c.length;e<s+l;e++)c.length<=e&&c.push(e);return NK.quarantineProperty(o.properties,"qHyperCubeDef.qIndentMode","pivotTableIndentMode"),NK.quarantineProperty(o.properties,"qHyperCubeDef.excludedNoOfLeftDims ","excludedNoOfLeftDims "),NK.conditionalShow.quarantine(o.properties),ZK.quarantine(o.properties),(e=>{NK.quarantineArrayProp({properties:e,arrayPath:FK,itemPath:$K,arrayName:WK,quarantineName:BK}),NK.quarantineArrayProp({properties:e,arrayPath:jK,itemPath:$K,arrayName:zK,quarantineName:BK}),NK.quarantineArrayProp({properties:e,arrayPath:jK,itemPath:VK,arrayName:zK,quarantineName:HK}),NK.quarantineArrayProp({properties:e,arrayPath:jK,itemPath:UK,arrayName:zK,quarantineName:GK})})(o.properties),o}const nX=e=>({dimensions:{min:1,max:1e3,description(t,n,r){const i="rows"===r?.type?"Visualizations.Descriptions.Row":"Visualizations.Descriptions.Column";return e.translator.get(i)}},measures:{min:1,max:1e3,description:()=>e.translator.get("Visualizations.Descriptions.Values")}}),rX={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond"}}}}};let iX=function(e){return e.Text="text",e.Link="link",e.Image="image",e.ImagesInIndentMode="imagesInIndentMode",e.Indicator="indicator",e.MiniChart="miniChart",e.EditableText="editableText",e.EditableSelector="editableSelector",e}({}),oX=function(e){return e.Attribute="attribute",e.Dimension="dimension",e}({});const aX=e=>{switch(e?.type){case"url":return iX.Link;case"image":return iX.Image;case"indicator":return iX.Indicator;case"miniChart":return iX.MiniChart;default:return iX.Text}},sX=({isImagesEnabled:e})=>({uses:"dimensionRepresentationItems.representationType",options(t,n,r){const{qIndentMode:i}=r.properties.qHyperCubeDef,o=[{value:"text",translation:"Object.Table.Representation.Text"},{value:"url",translation:"Object.Table.Representation.Link"}];return(!i&&e||i)&&o.push({value:"image",translation:"Object.Table.Representation.Image"}),o}}),lX=e=>{if(e)return{representationImage:{uses:"dimensionRepresentationItems.representationImage",show:e=>aX(e.qDef.representation)===iX.Image,items:{imageSize:{options:[{value:"alwaysFit",translation:"properties.backgroundImage.sizeAlwaysFit"},{value:"fitWidth",translation:"properties.backgroundImage.sizeFitWidth"},{value:"fitHeight",translation:"properties.backgroundImage.sizeFitHeight"},{value:"fill",translation:"properties.backgroundImage.sizeStretch"},{value:"originalSize",translation:"properties.backgroundImage.originalSize"}]},imageBoxWidth:{ref:"qDef.representation.imageBox.width",translation:"properties.pivot.representation.image.imageBox.width",type:"number",expression:"optional",defaultValue:24,show:(e,t,n)=>{if(!n.properties.qHyperCubeDef)return!1;const{qInterColumnSortOrder:r,qNoOfLeftDims:i,qDimensions:o,qIndentMode:a}=n.properties.qHyperCubeDef;let s=!1;r?.indexOf(-1);const l=o?.indexOf(e)??1/0;return(r?.slice(0,i)??[]).indexOf(l)>-1&&(s=!0),s&&a}}}}}},cX=e=>{const{anything:t}=e,n=!t.sense?.isUnsupportedFeature?.("tableImages");return{representationType:sX({isImagesEnabled:n}),representationUrlPosition:{uses:"dimensionRepresentationItems.representationUrlPosition",show:e=>aX(e.qDef.representation)===iX.Link},representationUrlLabel:{uses:"dimensionRepresentationItems.representationUrlLabel",show:e=>aX(e.qDef.representation)===iX.Link&&e.qDef.representation?.urlPosition===oX.Dimension},representationLinkUrl:{uses:"dimensionRepresentationItems.representationLinkUrl",show:e=>aX(e.qDef.representation)===iX.Link&&e.qDef.representation?.urlPosition===oX.Attribute},...lX(n)}},uX=(e,t)=>{const{anything:n}=e,r=n.sense?.isUnsupportedFeature,i=!r?.("tableImages")&&t[iX.Image],o=!r?.("qMiniChartDef")&&t[iX.MiniChart],a=!r?.("tableIndicators")&&t[iX.Indicator],s=i&&t[iX.ImagesInIndentMode];return{representationType:{uses:"measureRepresentationItems.representationType",options:(e,t,n)=>(e=>{const{qIndentMode:t}=e.properties.qHyperCubeDef??{},n=[{value:"text",translation:"Object.Table.Representation.Text"}];return(!t&&i||t&&s)&&n.push({value:"image",translation:"Object.Table.Representation.Image"}),a&&n.push({value:"indicator",translation:"Object.Table.Representation.Indicator"}),o&&n.push({value:"miniChart",translation:"Common.MiniChart"}),n})(n)},representationImage:i?{uses:"measureRepresentationItems.representationImage",show:e=>aX(e.qDef.representation)===iX.Image,items:{imageSize:{options:[{value:"alwaysFit",translation:"properties.backgroundImage.sizeAlwaysFit"},{value:"fitWidth",translation:"properties.backgroundImage.sizeFitWidth"},{value:"fitHeight",translation:"properties.backgroundImage.sizeFitHeight"},{value:"fill",translation:"properties.backgroundImage.sizeStretch"},{value:"originalSize",translation:"properties.backgroundImage.originalSize"}]}}}:void 0,representationIndicator:a?{uses:"measureRepresentationItems.representationIndicator"}:void 0,representationMiniChart:o?{uses:"measureRepresentationItems.representationMiniChart"}:void 0}};let dX=function(e){return e.Dimension="dimensions",e.Measures="measures",e.Pivot="pivot",e}({}),fX=function(e){return e.CellForegroundColor="cellForegroundColor",e.CellBackgroundColor="cellBackgroundColor",e.ImageUrl="imageUrl",e.ImageLabel="imageLabel",e.Link="url",e.LinkLabel="urlLabel",e}({}),hX=function(e){return e.TopGrid="topGrid",e.LeftGrid="leftGrid",e.DataGrid="dataGrid",e}({}),pX=function(e){return e.Forward="forward",e.Backward="backward",e.None="none",e}({});const mX="image",gX=(e,t,n)=>{if(!n.properties.qHyperCubeDef.qIndentMode)return!0;const r=n.properties.qHyperCubeDef.qInterColumnSortOrder?.indexOf(-1)??-1;let i=n.properties.qHyperCubeDef.qNoOfLeftDims??-1;r>-1&&r<i&&(i-=1);const o=n.properties.qHyperCubeDef.qDimensions.indexOf(e);return 0===o||o>=i},yX=()=>({type:{type:"string",component:"dropdown",ref:"qDef.columnWidth.type",translation:"Object.Table.Column.Width",options:[{value:JG.Auto,translation:"Common.Auto"},{value:JG.FitToContent,translation:"Object.Table.Column.FitToContent"},{value:JG.Pixels,translation:"Object.Table.Column.Pixels"},{value:JG.Percentage,translation:"Object.Table.Column.Percentage"}],defaultValue:JG.Auto},sizePixels:{ref:"qDef.columnWidth.pixels",translation:"Object.Table.Column.Pixels",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:XG.PixelsDefault,show:e=>e.qDef.columnWidth?.type===JG.Pixels},sizePercentage:{ref:"qDef.columnWidth.percentage",translation:"Object.Table.Column.Percentage",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:XG.PercentageDefault,show:e=>e.qDef.columnWidth?.type===JG.Percentage}}),vX=({key:e,translation:t,env:n})=>{const r=!n.anything.sense?.isUnsupportedFeature?.("tableImages");return{[`${e}Auto`]:{ref:`qDef.${e}.auto`,type:"boolean",component:"switch",translation:t,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}],defaultValue:!0,show:t=>!r||"labelTextAlign"===e||t.qDef.representation?.type!==mX},[e]:{ref:`qDef.${e}.align`,type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"align_left",labelPlacement:"bottom",value:"left",translation:"properties.dock.left"},{component:"icon-item",icon:"align_center",labelPlacement:"bottom",value:"center",translation:"Common.Center"},{component:"icon-item",icon:"align_right",labelPlacement:"bottom",value:"right",translation:"properties.dock.right"}],defaultValue:"left",show:t=>void 0!==t.qDef[e]&&!t.qDef[e].auto&&(!r||"labelTextAlign"===e||t.qDef.representation?.type!==mX)}}},bX="TOTAL_OFF",xX={component:"attribute-expression-reference",defaultValue:[],ref:"qAttributeExpressions",items:[{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.BackgroundExpression",defaultValue:"",id:fX.CellBackgroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.ForegroundExpression",defaultValue:"",id:fX.CellForegroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:fX.LinkLabel,tid:"URLLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:fX.Link,tid:"URLByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:fX.ImageLabel,tid:"ImageLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:fX.ImageUrl,tid:"ImageUrlByExpression",show:!1}]},wX="TOTAL_OFF",SX={component:"attribute-expression-reference",defaultValue:[],ref:"qAttributeExpressions",items:[{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.BackgroundExpression",defaultValue:"",id:fX.CellBackgroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.ForegroundExpression",defaultValue:"",id:fX.CellForegroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:fX.LinkLabel,tid:"URLLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:fX.Link,tid:"URLByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:fX.ImageLabel,tid:"ImageLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:fX.ImageUrl,tid:"ImageUrlByExpression",show:!1}]},CX=e=>{const{translator:t,anything:n,flags:r}=e,i=(e=>{const{translator:t,anything:n}=e;return{type:"items",component:"data-assets-panel-pivot",translation:"Common.Data",items:{dimensions:{type:"array",component:"expandable-items",ref:"qHyperCubeDef.qDimensions",items:{field:{type:"items",translation:"Common.Field",items:{libraryId:{type:"string",component:"library-item",libraryItemType:"dimension",ref:"qLibraryId",translation:"Common.Dimension",show:e=>!!e.qLibraryId},inlineDimension:{component:"inline-dimension",show:e=>!e.qLibraryId},autoSort:{ref:"qDef.autoSort",type:"boolean",defaultValue:!0,show:!1},cId:{ref:"qDef.cId",type:"string",show:!1},nullSuppression:{type:"boolean",ref:"qNullSuppression",defaultValue:!1,translation:"properties.dimensions.showNull",inverted:!0},totalMode:{type:"string",component:"switch",translation:"properties.showTotals",ref:"qOtherTotalSpec.qTotalMode",defaultValue:bX,trueOption:{value:"TOTAL_EXPR",translation:"properties.on"},falseOption:{value:bX,translation:"properties.off"},show:!n.sense?.isUnsupportedFeature?.("totals")&&gX},totalsLabel:{type:"string",component:"expression",expressionType:"StringExpr",ref:"qTotalLabel",translation:"properties.totals.label",defaultValue:()=>t.get("Object.Table.Totals"),show:(e,t,r)=>!n.sense?.isUnsupportedFeature?.("totals")&&e.qOtherTotalSpec?.qTotalMode!==bX&&gX(e,0,r)},dimensionLimits:{uses:"dimensions.items.dimensionLimits"},showOthers:{uses:"dimensions.items.others"},globalGrouping:{type:"boolean",translation:"properties.dimensionLimits.globalGrouping",ref:"qOtherTotalSpec.qGlobalOtherGrouping",defaultValue:!1,show:e=>"OTHER_OFF"!==e.qOtherTotalSpec?.qOtherMode}}},presentation:{type:"items",translation:"properties.presentation",items:{visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Table.Columns.VisibilityCondition",defaultValue:{qv:""},isExpression:e=>"string"==typeof e&&e.trim().length>0},cellColoring:xX,...vX({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...vX({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...cX(e),...yX()}}}},measures:{type:"array",component:"expandable-items",ref:"qHyperCubeDef.qMeasures",items:{field:{type:"items",translation:"Common.Field",items:{libraryId:{type:"string",component:"library-item",libraryItemType:"measure",ref:"qLibraryId",translation:"Common.Measure",show:e=>!!e.qLibraryId},inlineMeasure:{component:"inline-measure",show:e=>!e.qLibraryId},autoSort:{ref:"qDef.autoSort",type:"boolean",defaultValue:!0,show:!1},cId:{ref:"qDef.cId",type:"string",show:!1},numberFormatting:{uses:"measures.items.numberFormatting"}}},presentation:{type:"items",translation:"properties.presentation",items:{visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Table.Columns.VisibilityCondition",defaultValue:{qv:""},isExpression:e=>"string"==typeof e&&e.trim().length>0},cellColoring:xX,...vX({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...vX({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...uX(e,{[iX.Image]:!0,[iX.Indicator]:!0}),...yX()}}}},filter:{type:"object",component:"filter-item-react",ref:"filter",tabName:"SimpleProperties.Filters.Filters"}}}})(e);return r.isEnabled("CLIENT_IM5974_PIVOT_DATA_PROPERTIES")?i:{type:"items",component:"pivot-data",translation:"properties.data",addTranslation:"Property.AddData",items:{dimensions:{type:"array",component:"dimensions",translation:"Common.Dimensions",alternativeTranslation:"properties.alternative.dimensions",ref:"qHyperCubeDef.qDimensions",disabledRef:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",min:1,allowAdd:!0,allowRemove:!0,allowMove:!0,addTranslation:"properties.dimensions.add",grouped:!0,items:{libraryId:{type:"string",component:"library-item",libraryItemType:"dimension",ref:"qLibraryId",translation:"Common.Dimension",show:e=>!!e.qLibraryId},inlineDimension:{component:"inline-dimension",show:e=>!e.qLibraryId},autoSort:{ref:"qDef.autoSort",type:"boolean",defaultValue:!0,show:!1},cId:{ref:"qDef.cId",type:"string",show:!1},nullSuppression:{type:"boolean",ref:"qNullSuppression",defaultValue:!1,translation:"properties.dimensions.showNull",inverted:!0},totalMode:{type:"string",component:"switch",translation:"properties.showTotals",ref:"qOtherTotalSpec.qTotalMode",defaultValue:wX,trueOption:{value:"TOTAL_EXPR",translation:"properties.on"},falseOption:{value:wX,translation:"properties.off"},show:!n.sense?.isUnsupportedFeature?.("totals")&&gX},totalsLabel:{type:"string",component:"expression",expressionType:"StringExpr",ref:"qTotalLabel",translation:"properties.totals.label",defaultValue:()=>t.get("Object.Table.Totals"),show:(e,t,r)=>!n.sense?.isUnsupportedFeature?.("totals")&&e.qOtherTotalSpec?.qTotalMode!==wX&&gX(e,0,r)},dimensionLimits:{uses:"dimensions.items.dimensionLimits"},showOthers:{uses:"dimensions.items.others"},globalGrouping:{type:"boolean",translation:"properties.dimensionLimits.globalGrouping",ref:"qOtherTotalSpec.qGlobalOtherGrouping",defaultValue:!1,show:e=>"OTHER_OFF"!==e.qOtherTotalSpec?.qOtherMode},visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Table.Columns.VisibilityCondition",defaultValue:{qv:""},isExpression:e=>"string"==typeof e&&e.trim().length>0},cellColoring:SX,...vX({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...vX({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...cX(e),...yX()}},measures:{type:"array",component:"measures",translation:"Common.Measures",ref:"qHyperCubeDef.qMeasures",disabledRef:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",min:1,allowAdd:!0,allowRemove:!0,allowMove:!0,addTranslation:"properties.measures.add",grouped:!0,items:{libraryId:{type:"string",component:"library-item",libraryItemType:"measure",ref:"qLibraryId",translation:"Common.Measure",show:e=>!!e.qLibraryId},inlineMeasure:{component:"inline-measure",show:e=>!e.qLibraryId},autoSort:{ref:"qDef.autoSort",type:"boolean",defaultValue:!0,show:!1},cId:{ref:"qDef.cId",type:"string",show:!1},numberFormatting:{uses:"measures.items.numberFormatting"},visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Table.Columns.VisibilityCondition",defaultValue:{qv:""},isExpression:e=>"string"==typeof e&&e.trim().length>0},cellColoring:SX,...vX({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...vX({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...uX(e,{[iX.Image]:!0,[iX.ImagesInIndentMode]:!0,[iX.Indicator]:!0}),...yX()}},filters:{type:"items",translation:"SimpleProperties.Filters.Filters",ref:"filters",allowAdd:!0,allowRemove:!0,allowMove:!1,addTranslation:"properties.filters.add",grouped:!0,items:{filter:{type:"object",component:"filter-item",ref:"filter"}}}}}},kX=DA().palette,EX={TEXT:kX.text.primary,DISABLED:kX.text.disabled,HOVER:kX.action.hover,WHITE:Sk.GREYSCALE_100,BORDER_MEDIUM:Sk.GREYSCALE_85,DARK_MODE_TEXT:Sk.GREYSCALE_95,DARK_MODE_BORDER:Sk.GREYSCALE_95,DARK_MODE_DISABLED:Sk.GREYSCALE_70,TRANSPARENT:"transparent",SELECTED:kX.primary.main,LINK:kX.info.main,ERROR:kX.error.main},MX=(e,t=EX.TEXT,n=EX.WHITE)=>{const r=XO(e),i=XO(t),o=XO(n);return r.isInvalid()?t:function(e,t,n){const r=JO(e,t),i=JO(e,n);if(void 0!==r&&void 0!==i)return r>i?t:n}(r,o,i).getRGB()},_X=e=>{const t=e.getStyle("","","dataColors.selected")||EX.SELECTED,n=function(e,t){const n=XO("#FFFFFF"),r=XO(e),i=XO(t);if(r.isInvalid()||i.isInvalid()||r.getAlpha()<1||i.getAlpha()<1)return t;const o=JO(n,r),a=JO(i,r),s=o>a||o>4.5;return!s&&a>3?i.getHex():s?"#FFFFFF":"#000000"}(t,EX.TEXT);return{background:t,color:n}},RX=(e,t)=>{const n=XO(e);return 0===n.a?(n.setAlpha(t.opacity),n.getString()):n.isDark()?n.getBrightenedColor(t.brighter).getString():n.getDarkenedColor(t.darker).getString()},IX=e=>{const t=XO(e);return t.isInvalid()?null:1===t.a?t.getRGB():t.getRGBA()},DX=e=>{e.stopPropagation(),e.preventDefault()},PX=(e,t,n,r)=>({ref:e,translation:t,dualOutput:!0,type:"object",component:"color-picker",width:"auto",disableNone:r??!1,defaultValue(e,t,i){const o=r?.(e,t,i)??!1,a=i.theme.current(),s=n(a,o);return{color:"transparent"===s?"none":s}}}),AX=(e,t=!1)=>{return{value:e,label:t?(n=e,n.charAt(0).toUpperCase()+n.slice(1)):e,groupHeader:!1,disabled:!1,styles:t?{fontFamily:e}:void 0};var n},OX=({ref:e,themeAccessor:t,translator:n,flags:r})=>({component:"dropdown",ref:e,options:(e,i,o)=>{const a=o.theme.current();return((e,t,n,r)=>{const i=t.fontFamily??"Source Sans Pro, sans-serif",o=t.fontFamilies??[],a=Array.from(new Set([e,i,...o])),s=[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0},...a.sort().map((e=>AX(e,!0)))],l=[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0},...fL(r).filter((e=>!a.includes(e))).map((e=>AX(e,!0)))];return[...s,...l.length>1?l:[]]})(t(a),a,n,r)},defaultValue:(e,n,r)=>t(r.theme.current())}),LX=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],TX=({ref:e,themeAccessor:t,translator:n})=>({component:"dropdown",ref:e,options:(e,r,i)=>{const o=i.theme.current();return((e,t,n)=>{const r=t.fontSize,i=t.fontSizes??[],o=Array.from(new Set([e,r,...i])),a=[{value:"ThemeHeader",label:n.get("properties.themeFontSizes"),metaText:n.get("properties.theme"),groupHeader:!0},...o.sort(((e,t)=>parseInt(e,10)-parseInt(t,10))).map((e=>AX(e,!1)))],s=[{value:"DefaultHeader",label:n.get("properties.allFontSizes"),metaText:n.get("properties.default"),groupHeader:!0},...LX.filter((e=>!o.includes(e))).map((e=>AX(e,!1)))];return[...a,...s.length>1?s:[]]})(t(o),o,n)},defaultValue:(e,n,r)=>t(r.theme.current())}),qX=({section:e,defaultFontStyle:t,translator:n,flags:r,getThemeValue:i,translation:o,disableNoneCallback:a})=>({component:"panel-section",translation:o??`properties.pivot.${e}`,items:{content:{component:"items",ref:"components",key:"theme",items:{fontFamily:OX({ref:`${e}.fontFamily`,themeAccessor:t=>i(t,e,"fontFamily")??t.fontFamily,translator:n,flags:r}),fontWrapperItem:{component:"inline-wrapper",items:{fontStyle:{component:"font-style-buttons",width:!1,ref:`${e}.fontStyle`,defaultValue:t??[]},fontSize:TX({ref:`${e}.fontSize`,themeAccessor:t=>i(t,e,"fontSize")??t.fontSize,translator:n}),fontColor:PX(`${e}.fontColor`,void 0,(t=>i(t,e,"color")??t.color))}},background:PX(`${e}.background`,"properties.background",((t,n)=>{const r=n?EX.WHITE:EX.TRANSPARENT;return i(t,e,"backgroundColor")??r}),a)}}}}),NX=({section:e,defaultFontStyle:t,fallbackBackground:n,getThemeValue:r})=>({component:"panel-section",translation:`properties.pivot.${e}`,items:{content:{component:"items",ref:"components",key:"theme",items:{fontWrapperItem:{component:"inline-wrapper",items:{fontStyle:{component:"font-style-buttons",fullWidth:!0,ref:`${e}.fontStyle`,defaultValue:t??[]},fontColor:PX(`${e}.fontColor`,void 0,(t=>r(t,e,"color")??t.color))}},background:PX(`${e}.background`,"properties.background",(t=>r(t,e,"backgroundColor")??n??"transparent"))}}}}),jX=(e,t)=>({component:"dropdown",ref:e,translation:t,options:[...Array(10).keys()].map((e=>({value:e+1,translation:e+1}))),defaultValue:1}),zX="12px",FX="Source Sans Pro, sans-serif",WX="600",$X=15e3,BX=4/3;let VX=function(e){return e.Transparent="transparent",e.FontSecondary="#737373",e.DividerDark="#595959",e.DividerLight="#D9D9D9",e.NullValueBackground="#F2F2F2",e}({}),HX=function(e){return e.Solid="solid",e.None="none",e}({});const UX={display:"flex",justifyContent:"center",alignItems:"center"},GX={borderStyle:"solid"},YX={boxSizing:"border-box",padding:"4px 8px",userSelect:"none",WebkitUserSelect:"none"},KX={lineHeight:BX,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},XX=e=>({whiteSpace:"unset",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",wordBreak:e>1?"break-word":"break-all"}),JX=(e,t)=>e>0?`${e}px ${HX.Solid} ${t}`:HX.None,QX=(e,t,n,r,i)=>{const o=Number(!t||i?.right),a=Number(!e||i?.bottom);return{borderRight:"rtl"!==r?JX(o,n):HX.None,borderBottom:JX(a,n),borderLeft:"rtl"===r?JX(o,n):HX.None,borderTop:HX.None}},ZX=(e,t,n,r,i,o,a)=>{const s=QX(t,r,i,o,a);return e.isLeftDimension||(e.isLastDimension&&!t&&(s.borderBottom=JX(2,i)),n||(s.borderLeft="rtl"!==o?JX(1,i):"none",s.borderRight="rtl"===o?JX(1,i):"none")),s},eJ=({bottomDivider:e,rightDivider:t,borderColor:n})=>{const r={};return e&&(r.borderBottom=JX(1,n)),t&&(r.borderRight=JX(1,n)),r},tJ=(e,t,n)=>{switch(t){case"header":return e.object?.pivotTableV2?.dimension?.label?.name?.[n];case"dimensionValues":return e.object?.pivotTableV2?.dimension?.label?.value?.[n];case"measureLabels":return e.object?.pivotTableV2?.measure?.label?.name?.[n];case"measureValues":return e.object?.pivotTableV2?.measure?.label?.value?.[n];case"totalValues":return e.object?.pivotTableV2?.total?.label?.value?.[n];case"nullValues":return e.object?.pivotTableV2?.null?.label?.value?.[n];default:return}},nJ=(e,t)=>({type:"items",items:[{component:"styling-panel",chartTitle:"Object.PivotTable",subtitle:"LayerStyleEditor.component.styling",translation:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:!0,items:{headerSection:qX({section:"header",defaultFontStyle:["bold"],translator:e,flags:t,getThemeValue:tJ}),dimensionValueSection:qX({section:"dimensionValues",translator:e,flags:t,getThemeValue:tJ}),measureValueSection:qX({section:"measureValues",translator:e,flags:t,getThemeValue:tJ}),measureLabelSection:NX({section:"measureLabels",getThemeValue:tJ}),totalValuesSection:NX({section:"totalValues",defaultFontStyle:["bold"],getThemeValue:tJ}),nullValuesSection:NX({section:"nullValues",fallbackBackground:VX.NullValueBackground,getThemeValue:tJ}),gridSection:{translation:"properties.pivot.grid",component:"panel-section",items:{gridItems:{component:"items",ref:"components",key:"theme",items:{lineClamp:jX("grid.lineClamp","ThemeStyleEditor.style.rowHeight"),columnLineClamp:jX("grid.columnLineClamp","ThemeStyleEditor.style.columnHeight"),border:PX("grid.border","properties.border",(e=>e.object?.pivotTableV2?.grid?.borderColor??VX.DividerLight)),divider:PX("grid.divider","properties.pivot.divider",(e=>e.object?.pivotTableV2?.grid?.divider?.borderColor??VX.DividerDark)),background:PX("grid.background","properties.background",(e=>e.object?.pivotTableV2?.grid?.backgroundColor??VX.Transparent))}}}}}}]}),rJ=e=>{if(e.isEnabled("CLIENT_IM_5973_PIVOT_TABLE_EXPLORATION"))return{chartExploration:{type:"items",translation:"properties.chartExploration",items:{chartExplorationToggler:{type:"items",component:"chart-exploration-toggler",translation:"properties.enableChartExploration",ref:"enableChartExploration"},visibilityToggler:{show:e=>e.enableChartExploration,component:"buttongroup",translation:"properties.ChartExploration.VisibilityOption",ref:"chartExploration.menuVisibility",options:[{value:"auto",translation:"Common.Auto"},{value:"minimized",translation:"properties.ChartExploration.Minimized"}]}},show:e=>!e.insideContainer}}},iJ=(e,t)=>({uses:"settings",items:{presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:[nJ(e,t),{type:"items",items:{nullValueText:{ref:"nullValueRepresentation.text",type:"string",translation:"properties.pivot.nullValueText",defaultValue:"-"},alwaysFullyExpanded:{ref:"qHyperCubeDef.qAlwaysFullyExpanded",type:"boolean",translation:"properties.pivot.fullyExpanded",defaultValue:!1},indentMode:{ref:"qHyperCubeDef.qIndentMode",type:"boolean",translation:"properties.pivot.indentMode",defaultValue:!1,change(e){e.qHyperCubeDef.qShowTotalsAbove=!0}},type:{type:"string",component:"dropdown",ref:"qHyperCubeDef.indentModeColumnWidth.type",translation:"Object.Table.Column.Width",options:[{value:JG.Auto,translation:"Common.Auto"},{value:JG.Pixels,translation:"Object.Table.Column.Pixels"},{value:JG.Percentage,translation:"Object.Table.Column.Percentage"}],defaultValue:JG.Auto,show:e=>!!e.qHyperCubeDef.qIndentMode},sizePixels:{ref:"qHyperCubeDef.indentModeColumnWidth.pixels",translation:"Object.Table.Column.Pixels",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:XG.PixelsDefault,show:e=>{const t=e.qHyperCubeDef;return t.qIndentMode&&t.indentModeColumnWidth?.type===JG.Pixels}},sizePercentage:{ref:"qHyperCubeDef.indentModeColumnWidth.percentage",translation:"Object.Table.Column.Percentage",component:"expression",expressionType:"ValueExpression",expression:"optional",defaultValue:XG.PercentageDefault,show:e=>{const t=e.qHyperCubeDef;return t.qIndentMode&&t.indentModeColumnWidth?.type===JG.Percentage}},showTotalsAbove:{ref:"qHyperCubeDef.qShowTotalsAbove",type:"boolean",translation:"properties.pivot.showTotalsAbove",defaultValue:!0,show(e){const{qIndentMode:t}=e.qHyperCubeDef;return!t&&!!e.qHyperCubeDef.qDimensions.some((e=>"TOTAL_EXPR"===e.qOtherTotalSpec?.qTotalMode))}},resetProperties:{type:"object",component:"button",translation:"properties.pivot.resetExpansionButton",disabled:e=>!!e.qHyperCubeDef.qAlwaysFullyExpanded,action(e,t,n,r){e.qHyperCubeDef.qExpansionState=[],r.$emit("saveProperties",e)}}}}]},...rJ(t)}}),oJ="auto",aJ={type:"items",translation:"properties.sorting",items:{sortbyY:{type:"items",items:{sortbyYToggle:{ref:"qHyperCubeDef.qSortbyYValue",type:"boolean",component:"switch",translation:"properties.sorting.sortByY.label",convertFunctions:{get:e=>!!e("integer"),set:(e,t)=>{t("integer",e?-1:0)}},options:[{value:!0,translation:"properties.on"},{value:!1,translation:"properties.off"}]},sortbyYOrder:{ref:"qHyperCubeDef.qSortbyYValue",type:"string",component:"dropdown",defaultValue:0,options:[{value:1,translation:"properties.sorting.ascending"},{value:-1,translation:"properties.sorting.descending"}],show:e=>!!e.qHyperCubeDef.qSortbyYValue}}},defaultSorting:{uses:"sorting",items:{dimensions:{showPriority:!1,allowMove:!1},measures:{included:!1}}},searchSorting:{ref:"search.sorting",type:"string",component:"dropdown",defaultValue:oJ,translation:"Object.Table.SortingInSearch",options:[{value:oJ,translation:"Common.Auto"},{value:"inherit",translation:"Object.Table.SortingInSearch.InheritFromDimension"}]}}};function sJ(e){const{translator:t,flags:n}=e;return{type:"items",component:"accordion",items:{data:CX(e),sorting:aJ,addons:rX,settings:iJ(t,n)}}}function lJ(e){return{support:{cssScaling:!0,snapshot:!0,export:!0,exploration:e.flags.isEnabled("CLIENT_IM_5973_PIVOT_TABLE_EXPLORATION"),sharing:!1,exportData:!0,viewData:!0},usePropertyHandler:"pivot-data",definition:sJ(e),importProperties:eX(e),exportProperties:tX,exploration:hK(e),data:nX(e),propertyHandler:e.flags.isEnabled("VNA-147_NEBULA_PIVOT_DATA_HANDLERS")?t=>new TK(t,e.translator):void 0}}const cJ=()=>{let e;const t=new Promise((t=>{e=t}));return{promise:t,resolve:e}};function uJ(t,n){return e.useMemo((()=>t),n)}const dJ={},fJ=t=>{const n=e.useMemo((()=>({current:dJ})),[]);return n.current=n.current===dJ?t:n.current,n},hJ=e=>!!e&&0===XO(e).a,pJ="#grid",mJ=(e,t)=>{const n=t?.closest(e);return n&&window.getComputedStyle(n).backgroundColor},gJ=(e,t,n,r,i)=>{const o=mJ(".qv-object .qv-inner-object",n),a=mJ(".qv-panel-sheet",n),s=mJ(pJ,n)??a,l=(e=>{const t=e.components?.find((e=>"general"===e.key)),n=t?.bgColor?.colorExpression,r=t?.bgColor?.color?.color,i=t?.bgColor?.useColorExpression;if(i&&n)return IX(n);if("none"===r)return"transparent";if(void 0===r)return;const o=XO(r);return o.setAlpha(t?.bgColor?.color?.alpha??o.a),o.getRGBA()})(e),c=r?.(t),u=i?.(t),d=l||c||o||u,f=hJ(d),h=!hJ(p=f?s:d)&&MX(p,EX.TEXT,EX.DARK_MODE_TEXT)===HO(EX.DARK_MODE_TEXT);var p;const m=((e,t,n,r=EX.WHITE)=>e&&!hJ(e)?e:hJ(t)?n&&!hJ(n)?n:r:t)(l,d,s);return{color:d,headerColor:m,isDark:h}},yJ=(t,n,r,i)=>{const o=e.useTheme(),a=((t,n={attributeFilter:["style"],childList:!1,subtree:!1})=>{const[r,i]=e.useState([]);return e.useEffect((()=>{let e;return t&&(e=new MutationObserver((e=>{i(e)})),e.observe(t,n)),()=>{e?.disconnect()}}),[t,n]),r})(n.closest(pJ),{attributeFilter:["style"],childList:!1,subtree:!1,attributeOldValue:!0}).filter((({oldValue:e})=>e?.includes("background"))).map((({oldValue:e})=>e)).join(",");return e.useMemo((()=>({...o,background:gJ(t,o,n,r,i)})),[o.name(),n,r,i,t,a])};function vJ(t,n){const r=e.useMemo((()=>({isLoading:!0})),n),[i,o]=e.usePromise((async()=>{try{return await t()}finally{r.isLoading=!1}}),n);return[i,r.isLoading,o]}const bJ=3,xJ=/\n/g;function wJ(e,t,n){let r=0,i=e.length;if(Number.isNaN(t))return null;if(e.length<=1)return null;if(n(e)<=t)return null;for(;r<=i;){const o=Math.floor((r+i)/2),a=e.slice(0,o),s=e.slice(0,o-1),l=n(a),c=n(s);if(l>t&&c<=t)return e.slice(o-1)||null;if(l===t)return e.slice(o)||null;l<t?r=o+1:i=o}return null}function SJ({fontSize:e="12px",fontFamily:t="Source Sans Pro, Arial, sans-serif",fontStyle:n="normal",fontWeight:r="normal"},i){const{maxNbrLinesOfText:o=bJ,allowLineBreaks:a=!0}=i??{},{estimateWidth:s,measureText:l,estimateLineCount:c}=_e.useMemo((()=>(({fontSize:e="12px",fontFamily:t="Source Sans Pro, Arial, sans-serif",fontStyle:n="normal",fontWeight:r="normal"},i)=>{const{maxNbrLinesOfText:o=bJ,allowLineBreaks:a=!0}=i??{};return()=>{const i=document.createElement("canvas").getContext("2d");i.font=`${n} ${r} ${e} ${t}`;const s=i.measureText.bind(i),l=pT((e=>{if(void 0===e)return 0;if(a){const t=e.split(xJ).map((e=>s(e).width));return t.reduce(((e,t)=>t>e?t:e),0)}const t=e.replace(xJ," ");return s(t).width})),c=e=>+l(e).toFixed(2),u=pT((({text:e,maxWidth:t,isNumeric:n=!1})=>{if(n)return 1;const r=a?e.split(xJ):[e];let i=0;for(const e of r){let n=e;do{i+=1,n=wJ(n,t,c)}while(null!==n&&i<o);if(i>=o)break}return i}),(({text:e,maxWidth:t,isNumeric:n})=>`${e}-${t}-${n?"true":"false"}`));return{measureText:e=>l(e),estimateWidth:e=>l("N")*e,estimateLineCount:u}}})({fontStyle:n,fontWeight:r,fontSize:e,fontFamily:t},{maxNbrLinesOfText:o,allowLineBreaks:a})()),[n,r,e,t,o,a]);return{estimateWidth:s,measureText:l,estimateLineCount:c}}var CJ,kJ=xb;CJ=kJ.createRoot,kJ.hydrateRoot;const EJ="Source Sans Pro, sans-serif";function MJ(e,t){const[n,r]=_e.useState(t),i=n.some(((e,n)=>e!==t[n]));i&&(r(t),e())}var _J={NebulaTableUtils_ColumnAdjuster_ColumnNameLabel:{id:"NebulaTableUtils.ColumnAdjuster.ColumnNameLabel",locale:{"de-DE":"Breite von {0}","en-US":"Width of {0}","es-ES":"Ancho de {0}","fr-FR":"Largeur de {0}","it-IT":"Larghezza di {0}","ja-JP":"{0} の幅","ko-KR":"{0}의 너비","nl-NL":"Breedte van {0}","pl-PL":"Szerokość kolumny {0}","pt-BR":"Comprimento de {0}","ru-RU":'Ширина столбца "{0}"',"sv-SE":"Bredd på {0}","tr-TR":"{0} genişliği","zh-CN":"{0} 的宽度","zh-TW":"{0} 的寬度"}},NebulaTableUtils_MenuGroupLabel_Sorting:{id:"NebulaTableUtils.MenuGroupLabel.Sorting",locale:{"de-DE":"Sortierung","en-US":"Sorting","es-ES":"Ordenación","fr-FR":"Tri","it-IT":"Ordinamento","ja-JP":"ソート","ko-KR":"정렬","nl-NL":"Sorteren","pl-PL":"Sortowanie","pt-BR":"Classificação","ru-RU":"Сортировка","sv-SE":"Sortering","tr-TR":"Sıralama","zh-CN":"排序","zh-TW":"排序"}},NebulaTableUtils_MenuItemLabel_AdjustColumnSize:{id:"NebulaTableUtils.MenuItemLabel.AdjustColumnSize",locale:{"de-DE":"Spaltengröße anpassen","en-US":"Adjust column size","es-ES":"Ajustar el tamaño de columna","fr-FR":"Ajuster la taille de colonne","it-IT":"Regola dimensioni colonna","ja-JP":"列サイズを調整","ko-KR":"열 크기 조정","nl-NL":"Kolomgrootte aanpassen","pl-PL":"Dostosuj rozmiar kolumny","pt-BR":"Ajustar tamanho da coluna","ru-RU":"Настроить размер столбца","sv-SE":"Justera kolumnens storlek","tr-TR":"Sütun boyutunu ayarla","zh-CN":"调节列大小","zh-TW":"調整欄大小"}},NebulaTableUtils_MenuItemLabel_ClearSelections:{id:"NebulaTableUtils.MenuItemLabel.ClearSelections",locale:{"de-DE":"Auswahlen löschen","en-US":"Clear selections","es-ES":"Borrar selecciones","fr-FR":"Effacer les sélections","it-IT":"Cancella selezioni","ja-JP":"選択をクリア","ko-KR":"선택 지우기","nl-NL":"Geselecteerde waarden wissen","pl-PL":"Wyczyść wybory","pt-BR":"Limpar seleções","ru-RU":"Очистить выбранные","sv-SE":"Radera urval","tr-TR":"Seçimleri temizle","zh-CN":"清除选择项","zh-TW":"清除選項"}},NebulaTableUtils_MenuItemLabel_Collapse:{id:"NebulaTableUtils.MenuItemLabel.Collapse",locale:{"de-DE":"Reduzieren","en-US":"Collapse","es-ES":"Contraer","fr-FR":"Réduire","it-IT":"Comprimi","ja-JP":"折りたたむ","ko-KR":"축소","nl-NL":"Samenvouwen","pl-PL":"Zwiń","pt-BR":"Recolher","ru-RU":"Свернуть","sv-SE":"Dölj","tr-TR":"Daralt","zh-CN":"折叠","zh-TW":"收合"}},NebulaTableUtils_MenuItemLabel_ColumnOptions:{id:"NebulaTableUtils.MenuItemLabel.ColumnOptions",locale:{"de-DE":"Spaltenoptionen","en-US":"Column options","es-ES":"Opciones de columna","fr-FR":"Options de colonne","it-IT":"Opzioni colonna","ja-JP":"列オプション","ko-KR":"열 옵션","nl-NL":"Kolomopties","pl-PL":"Opcje kolumny","pt-BR":"Opções da coluna","ru-RU":"Параметры столбца","sv-SE":"Alternativ för kolumn","tr-TR":"Sütun seçenekleri","zh-CN":"列选项","zh-TW":"欄選項"}},NebulaTableUtils_MenuItemLabel_Expand:{id:"NebulaTableUtils.MenuItemLabel.Expand",locale:{"de-DE":"Erweitern","en-US":"Expand","es-ES":"Expandir","fr-FR":"Développer","it-IT":"Espandi","ja-JP":"展開","ko-KR":"확장","nl-NL":"Uitvouwen","pl-PL":"Rozwiń","pt-BR":"Expandir","ru-RU":"Развернуть","sv-SE":"Utöka","tr-TR":"Genişlet","zh-CN":"展开","zh-TW":"展開"}},NebulaTableUtils_MenuItemLabel_Search:{id:"NebulaTableUtils.MenuItemLabel.Search",locale:{"de-DE":"Suchen","en-US":"Search","es-ES":"Buscar","fr-FR":"Rechercher","it-IT":"Cerca","ja-JP":"検索","ko-KR":"검색","nl-NL":"Zoeken","pl-PL":"Wyszukaj","pt-BR":"Pesquisar","ru-RU":"Поиск","sv-SE":"Sök","tr-TR":"Ara","zh-CN":"搜索","zh-TW":"搜尋"}},NebulaTableUtils_MenuItemLabel_SelectAll:{id:"NebulaTableUtils.MenuItemLabel.SelectAll",locale:{"de-DE":"Alle auswählen","en-US":"Select all","es-ES":"Seleccionar todo","fr-FR":"Sélectionner tout","it-IT":"Seleziona tutti","ja-JP":"すべて選択","ko-KR":"모두 선택","nl-NL":"Alles selecteren","pl-PL":"Wybierz wszystko","pt-BR":"Selecionar tudo","ru-RU":"Выбрать все","sv-SE":"Välj alla","tr-TR":"Tümünü seç","zh-CN":"全选","zh-TW":"全選"}},NebulaTableUtils_MenuItemLabel_SelectAlternative:{id:"NebulaTableUtils.MenuItemLabel.SelectAlternative",locale:{"de-DE":"Alternative Werte auswählen","en-US":"Select alternative","es-ES":"Seleccionar alternativos","fr-FR":"Sélectionner des valeurs alternatives","it-IT":"Seleziona alternativi","ja-JP":"代替項目を選択","ko-KR":"대체 가능 값 선택","nl-NL":"Alternatief selecteren","pl-PL":"Wybierz alternatywę","pt-BR":"Selecionar alternativa","ru-RU":"Выбрать альтернативные","sv-SE":"Välj alternativ","tr-TR":"Alternatifi seç","zh-CN":"选择替代项","zh-TW":"選取替代選項"}},NebulaTableUtils_MenuItemLabel_SelectExcluded:{id:"NebulaTableUtils.MenuItemLabel.SelectExcluded",locale:{"de-DE":"Ausgeschlossene Werte auswählen","en-US":"Select excluded","es-ES":"Seleccionar excluidos","fr-FR":"Sélectionner les valeurs exclues","it-IT":"Seleziona esclusi","ja-JP":"除外項目を選択","ko-KR":"제외 항목 선택","nl-NL":"Uitgesloten waarden selecteren","pl-PL":"Wybierz wykluczone","pt-BR":"Selecionar excluídos","ru-RU":"Выбрать исключенные","sv-SE":"Välj uteslutna","tr-TR":"Hariç tutulanı seç","zh-CN":"选择排除项","zh-TW":"選取排除值"}},NebulaTableUtils_MenuItemLabel_SelectPossible:{id:"NebulaTableUtils.MenuItemLabel.SelectPossible",locale:{"de-DE":"Wählbare Werte auswählen","en-US":"Select possible","es-ES":"Seleccionar posibles","fr-FR":"Sélectionner les valeurs possibles","it-IT":"Seleziona possibili","ja-JP":"絞込項目を選択","ko-KR":"사용 가능 항목 선택","nl-NL":"Mogelijke waarden selecteren","pl-PL":"Wybierz możliwe","pt-BR":"Selecionar possíveis","ru-RU":"Выбрать возможные","sv-SE":"Välj möjliga","tr-TR":"Olası olanı seç","zh-CN":"选择可能值","zh-TW":"選取可能值"}},NebulaTableUtils_MenuItemLabel_Selections:{id:"NebulaTableUtils.MenuItemLabel.Selections",locale:{"de-DE":"Auswahlen","en-US":"Selections","es-ES":"Selecciones","fr-FR":"Sélections","it-IT":"Selezioni","ja-JP":"選択","ko-KR":"선택 내용","nl-NL":"Selecties","pl-PL":"Wybory","pt-BR":"Seleções","ru-RU":"Выборки","sv-SE":"Urval","tr-TR":"Seçimler","zh-CN":"选择项","zh-TW":"選項"}},NebulaTableUtils_MenuItemLabel_SortAscending:{id:"NebulaTableUtils.MenuItemLabel.SortAscending",locale:{"de-DE":"In aufsteigender Reihenfolge sortieren","en-US":"Sort ascending","es-ES":"Orden ascendente","fr-FR":"Trier par ordre croissant","it-IT":"Ordinamento crescente","ja-JP":"昇順でソート","ko-KR":"오름차순으로 정렬","nl-NL":"Oplopend sorteren","pl-PL":"Sortuj rosnąco","pt-BR":"Classificar em ordem crescente","ru-RU":"Сортировка по возрастанию","sv-SE":"Sortera stigande","tr-TR":"Artan sıralama","zh-CN":"升序排序","zh-TW":"以遞增方式排序"}},NebulaTableUtils_MenuItemLabel_SortDescending:{id:"NebulaTableUtils.MenuItemLabel.SortDescending",locale:{"de-DE":"In absteigender Reihenfolge sortieren","en-US":"Sort descending","es-ES":"Orden descendente","fr-FR":"Trier par ordre décroissant","it-IT":"Ordinamento decrescente","ja-JP":"降順でソート","ko-KR":"내림차순으로 정렬","nl-NL":"Aflopend sorteren","pl-PL":"Sortuj malejąco","pt-BR":"Classificar em ordem decrescente","ru-RU":"Сортировка по убыванию","sv-SE":"Sortera fallande","tr-TR":"Azalan sıralama","zh-CN":"降序排序","zh-TW":"以遞減方式排序"}},NebulaTableUtils_Pagination_DisplayedRowsLabel:{id:"NebulaTableUtils.Pagination.DisplayedRowsLabel",locale:{"de-DE":"{0} von {1}","en-US":"{0} of {1}","es-ES":"{0} de {1}","fr-FR":"{0} sur {1}","it-IT":"{0} di {1}","ja-JP":"{0} / {1}","ko-KR":"{0}/{1}","nl-NL":"{0} van {1}","pl-PL":"{0} z {1}","pt-BR":"{0} de {1}","ru-RU":"{0} из {1}","sv-SE":"{0} av {1}","tr-TR":"{0} / {1}","zh-CN":"{0} / {1}","zh-TW":"{0} / {1}"}},NebulaTableUtils_Pagination_FirstPage:{id:"NebulaTableUtils.Pagination.FirstPage",locale:{"de-DE":"Zur ersten Seite","en-US":"Go to the first page","es-ES":"Ir a la primera página","fr-FR":"Accéder à la première page","it-IT":"Vai alla prima pagina","ja-JP":"最初のページに移動","ko-KR":"첫 페이지로 이동","nl-NL":"Ga naar de eerste pagina","pl-PL":"Przejdź do pierwszej strony","pt-BR":"Ir para a primeira página","ru-RU":"Перейти к первой странице","sv-SE":"Gå till första sidan","tr-TR":"İlk sayfaya git","zh-CN":"转到第一页","zh-TW":"移至第一頁"}},NebulaTableUtils_Pagination_LastPage:{id:"NebulaTableUtils.Pagination.LastPage",locale:{"de-DE":"Zur letzten Seite","en-US":"Go to the last page","es-ES":"Ir a la última página","fr-FR":"Accéder à la dernière page","it-IT":"Vai all'ultima pagina","ja-JP":"最後のページに移動","ko-KR":"마지막 페이지로 이동","nl-NL":"Ga naar de laatste pagina","pl-PL":"Przejdź do ostatniej strony","pt-BR":"Ir para a última página","ru-RU":"Перейти к последней странице","sv-SE":"Gå till sista sidan","tr-TR":"Son sayfaya git","zh-CN":"转到最后一页","zh-TW":"移至最後一頁"}},NebulaTableUtils_Pagination_NextPage:{id:"NebulaTableUtils.Pagination.NextPage",locale:{"de-DE":"Zur nächsten Seite","en-US":"Go to the next page","es-ES":"Ir a la página siguiente","fr-FR":"Accéder à la page suivante","it-IT":"Vai alla pagina successiva","ja-JP":"次のページに移動","ko-KR":"다음 페이지로 이동","nl-NL":"Ga naar de volgende pagina","pl-PL":"Przejdź do następnej strony","pt-BR":"Ir para a próxima página","ru-RU":"Перейти к следующей странице","sv-SE":"Gå till nästa sida","tr-TR":"Sonraki sayfaya git","zh-CN":"转到下一页","zh-TW":"移至下一頁"}},NebulaTableUtils_Pagination_PreviousPage:{id:"NebulaTableUtils.Pagination.PreviousPage",locale:{"de-DE":"Zur vorherigen Seite","en-US":"Go to the previous page","es-ES":"Ir a la página anterior","fr-FR":"Accéder à la page précédente","it-IT":"Vai alla pagina precedente","ja-JP":"前のページに移動","ko-KR":"이전 페이지로 이동","nl-NL":"Ga naar de vorige pagina","pl-PL":"Przejdź do poprzedniej strony","pt-BR":"Ir para a página anterior","ru-RU":"Перейти к предыдущей странице","sv-SE":"Gå till föregående sida","tr-TR":"Önceki sayfaya git","zh-CN":"转到前一页","zh-TW":"移至上一頁"}},NebulaTableUtils_Pagination_RowsPerPage:{id:"NebulaTableUtils.Pagination.RowsPerPage",locale:{"de-DE":"Zeilen pro Seite","en-US":"Rows per page","es-ES":"Filas por página","fr-FR":"Lignes par page","it-IT":"Righe per pagina","ja-JP":"ページあたりの行数","ko-KR":"페이지별 행 수","nl-NL":"Rijen per pagina","pl-PL":"Wierszy na stronę","pt-BR":"Linhas por página","ru-RU":"Строк на странице","sv-SE":"Rader per sida","tr-TR":"Sayfa başına satır sayısı","zh-CN":"每页行数","zh-TW":"每頁列數"}},NebulaTableUtils_Pagination_SelectPage:{id:"NebulaTableUtils.Pagination.SelectPage",locale:{"de-DE":"Seite auswählen","en-US":"Select page","es-ES":"Seleccionar página","fr-FR":"Sélectionner une page","it-IT":"Seleziona pagina","ja-JP":"ページを選択","ko-KR":"페이지 선택","nl-NL":"Pagina selecteren","pl-PL":"Wybierz stronę","pt-BR":"Selecionar página","ru-RU":"Выберите страницу","sv-SE":"Välj sida","tr-TR":"Sayfa seç","zh-CN":"选择页面","zh-TW":"選取頁面"}}};const RJ=({translator:e})=>(_e.useMemo((()=>{!function(e){if(e&&e.get&&e.add){const t="NebulaTableUtils.MenuGroupLabel.Sorting";if(e.get(t)!==t)return;Object.keys(_J).forEach((t=>{e.add(_J[t])}))}}(e)}),[e]),e),IJ={width:"100%",height:"100%",color:"transparent",background:"transparent",borderColor:"transparent"},DJ={border:0,boxShadow:"none",borderRadius:0,outline:0,width:0,height:0,background:"transparent",cursor:"pointer",visibility:"hidden"},PJ=il("input",{shouldForwardProp:e=>"isLastColumn"!==e&&"hoverColor"!==e})((({isLastColumn:e,hoverColor:t,dir:n})=>({position:"absolute",display:"flex",height:"100%",top:0,marginLeft:"-4px",marginRight:"rtl"===n?"-4px":void 0,touchAction:"none",cursor:"col-resize",pointerEvents:"auto",width:(e?4:9)+"px",justifyContent:e?"flex-end":"center",outline:"none",appearance:"none",WebkitAppearance:"none",backgroundColor:"transparent","&::-webkit-slider-runnable-track":{...IJ},"&::-moz-range-track":{...IJ},"&::-ms-track":{...IJ},"&::-webkit-slider-thumb":{appearance:"none",WebkitAppearance:"none",...DJ},"&::-moz-range-thumb":{...DJ},"&::-ms-thumb":{...DJ},"&:hover:not(:focus, :active)":{"&::after":{backgroundColor:t||"#D9D9D9","@media (hover: none)":{backgroundColor:"none"}}},"&:focus-visible, &:active":{"&::after":{backgroundColor:"#177fe6",borderLeft:"1px solid #fff",borderRight:e?void 0:"1px solid #fff"}},"&::after":{content:'""',height:"100%",width:"3px",position:"absolute"}}))),AJ=({columnWidth:e,keyValue:t,isLastColumn:n,isPivot:r,hoverColor:i,updateWidthCallback:o,confirmWidthCallback:a,handleBlur:s,setIsAdjustingWidth:l,isLeftColumn:c,accessibilityRelatedArgs:u,direction:d="ltr"})=>{const f=RJ({translator:u.translator}),h=_e.useRef({initWidth:e,columnWidth:e,initX:0}),p=n?0:1,m=r&&!c,g=()=>m?h.current.columnWidth-p:"100%",y={left:"rtl"!==d?g():void 0,right:"rtl"===d?g():void 0},v=t=>{h.current={initWidth:e,columnWidth:e,initX:t??h.current.initX}};MJ((()=>{m&&v()}),[e]);const b=e=>{const t=Math.max(e,XG.PixelsMin);h.current.columnWidth=t,o(t)},x=()=>{if(h.current.columnWidth!==h.current.initWidth){const e={type:JG.Pixels,pixels:h.current.columnWidth};a(e)}l?.(!1)},w=e=>{const t="rtl"===d?h.current.initWidth+h.current.initX-e.clientX:h.current.initWidth+e.clientX-h.current.initX;b(t)},S=e=>{DX(e),document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",S),x()},C=e=>{const t="rtl"===d?h.current.initWidth+-h.current.initX-e.touches[0].clientX:h.current.initWidth+e.touches[0].clientX-h.current.initX;b(t)},k=e=>{DX(e),document.removeEventListener("touchmove",C),document.removeEventListener("touchend",k),x()},E=!r&&s?e=>{if(e.key===YG.Left||e.key===YG.Right){DX(e);const t=5,n=e.key===YG.Left?t:-t,r="rtl"===d?n:-n;l?.(!0),b(h.current.columnWidth+r)}else e.key===YG.Space||e.key===YG.Enter?(DX(e),s(e),l?.(!1),x()):e.key===YG.Esc&&(DX(e),s(e),l?.(!1),b(h.current.initWidth))}:void 0,M=f.get("NebulaTableUtils.ColumnAdjuster.ColumnNameLabel",[String(u.columnLabel)]);return Yi.jsx(PJ,{style:y,hoverColor:i,isLastColumn:n,className:KG,"data-testid":KG,onMouseDown:e=>{DX(e),document.addEventListener("mousemove",w),document.addEventListener("mouseup",S),l?.(!0),v(e.clientX)},onDoubleClick:()=>{a({type:JG.FitToContent})},onTouchStart:e=>{1===e.touches.length&&(DX(e),document.addEventListener("touchmove",C),document.addEventListener("touchend",k),l?.(!0),v(e.touches[0].clientX))},onKeyDown:E,onBlur:s,onFocus:()=>{v()},type:"range",tabIndex:-1,"aria-label":M,"aria-valuemin":XG.PixelsMin,"aria-valuemax":XG.PixelsMax,"aria-valuenow":Number(e.toFixed(1)),dir:d},t)},OJ=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M15 4H1V2h14zm0 10H1v-2h14zm0-5H1V7h14z"})}),LJ=_e.forwardRef(OJ),TJ=il(Xx,{shouldForwardProp:e=>"rightAligned"!==e&&"shouldShowMenuIcon"!==e&&"isAccessibleHeader"!==e})((({rightAligned:e,shouldShowMenuIcon:t,isAccessibleHeader:n})=>({...e?{marginRight:"auto"}:{marginLeft:"auto"},height:n?24:void 0,display:t?"flex":"none",fontWeight:"bold",width:n?"100%":void 0,alignItems:"center",justifyContent:"center"}))),qJ=il(LJ,{shouldForwardProp:e=>"isInteractionsActive"!==e})((({isInteractionsActive:e})=>({minWidth:"unset",position:"relative",cursor:e?"pointer":"default"}))),NJ=il(dC)((({theme:e})=>({".MuiList-root":{padding:e.spacing(.5,0)}}))),jJ=il(Vw)((({theme:e})=>({"&.MuiDivider-root":{margin:e.spacing(.5)}}))),zJ=il(gC)((({theme:e})=>({fontSize:"12px",height:24,fontWeight:"bold",padding:`${e.spacing(.25,2)} !important`,marginBottom:e.spacing(.5)}))),FJ=il(gC,{shouldForwardProp:e=>"isSubMenu"!==e&&"isActive"!==e})((({theme:e,isSubMenu:t,isActive:n})=>({width:`calc(220px - ${e.spacing(1)} - ${t?10:0}px)`,maxHeight:32,borderRadius:`${e.spacing(.5)} !important`,margin:`${e.spacing(.25,.5)} !important`,padding:`${e.spacing(1,1.5)} !important`,display:"flex !important",justifyContent:"space-between !important","&&:focus":{boxShadow:"rgb(23, 127, 230) 0px 0px 0px 2px"},position:"relative !important",overflow:"hidden",boxSizing:"border-box !important",background:n?"rgba(0, 0, 0, 0.05)":"transparent"}))),WJ=il("div",{shouldForwardProp:e=>!["direction","isPagination"].includes(e)})((({theme:e,direction:t,isPagination:n})=>({position:"absolute",width:e.spacing(.5),height:16,left:0,right:n||"rtl"!==t?void 0:0,top:"50%",transform:"TranslateY(-50%)",borderRadius:"0 2px 2px 0",background:"#01873d"}))),$J=il("div")((()=>({display:"flex",justifyContent:"space-between",alignItems:"center",maxWidth:"100%"}))),BJ=il(fx)((()=>({fontFamily:'"Source Sans Pro", HelveticaNeue, "Helvetica Neue", Helvetica, Arial, sans-serif',fontSize:"14px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"}))),VJ=il(jS,{shouldForwardProp:e=>!["direction","isPagination"].includes(e)})((({theme:e,direction:t,isPagination:n})=>({width:16,minWidth:"unset !important",marginRight:n||"rtl"!==t?e.spacing(1.5):0,marginLeft:n||"rtl"!==t?void 0:e.spacing(1.5),lineHeight:0}))),HJ=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M8.5 8 4 3.5 5.5 2l6 6-6 6L4 12.5z"})}),UJ=_e.forwardRef(HJ),GJ=e=>{const t=e.nextElementSibling;return t?"HR"===t.tagName?GJ(t):t:e.parentElement?.children?.[0]},YJ=e=>{const t=e.previousElementSibling;if(!t){const t=e.parentElement?.children?.length;return e.parentElement?.children?.[t-1]}return"HR"===t.tagName?YJ(t):t},KJ=e=>{const{key:t,currentTarget:n}=e,r=document.activeElement??n;if(t===YG.Down||t===YG.Up){const n=e=>t===YG.Down?GJ(e):YJ(e);e.preventDefault(),e.stopPropagation();let i=n(r);for(;i;){if("true"!==i.ariaDisabled){i.focus();break}i=n(i)}}},XJ=(e,t)=>e.map((e=>e.map((e=>({...e.groupHeading?{groupHeading:e.groupHeading}:{},items:e.items.map((({onClick:e,...n})=>({...n,...e?{onClick:async n=>{Object.entries(t).forEach((([,e])=>{e(!1)})),await e(n)}}:{}})))})))));let JJ={};const QJ=({autoFocus:e,id:t,onClick:n,itemTitle:r,icon:i,enabled:o,subMenus:a,isSubMenu:s,isActive:l,direction:c,isPagination:u})=>{const[d,f]=_e.useState(!1),h=Re.useRef(null),p=_e.useCallback((e=>{e.stopPropagation(),f(!1)}),[f]);return Yi.jsxs(Yi.Fragment,{children:[Yi.jsxs(FJ,{ref:a?h:null,"data-testid":`menu-item-${t}`,className:"nebula-table-utils-head-menu-item",onClick:async e=>{"keyup"!==e.type&&(n&&(await n(e),JJ={}),a?.length&&(f(!0),JJ[r]=f,e.stopPropagation()))},disabled:!o,autoFocus:e,isSubMenu:!!s,isActive:!!l,onKeyDown:KJ,children:[l?Yi.jsx(WJ,{direction:c,isPagination:u}):null,Yi.jsxs($J,{children:[Yi.jsx(VJ,{direction:c,isPagination:u,children:Yi.jsx(i,{})}),Yi.jsx(BJ,{variant:"body2",children:r})]}),a?.length?Yi.jsx(UJ,{}):null]},t),a?.length?Yi.jsx(nQ,{isSubMenu:!0,open:d,anchorEl:h.current,onClose:p,menuGroups:XJ(a,JJ),transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"top"},direction:c,isPagination:u}):null]})},ZJ=({menuGroup:e,isSubMenu:t,direction:n,isPagination:r})=>e.map((e=>[[e.groupHeading&&Yi.jsx(zJ,{disabled:!0,style:{opacity:1},children:e.groupHeading},e.groupHeading),e.items.map((e=>Yi.jsx(QJ,{...e,isSubMenu:t,direction:n,isPagination:r},e.id)))].filter(Boolean)])),eQ=({itemGroups:e,isSubMenu:t,direction:n,isPagination:r})=>e.map(((i,o)=>[ZJ({menuGroup:i,isSubMenu:t,direction:n,isPagination:r}),o<e.length-1?Yi.jsx(jJ,{"data-testid":"group-divider",variant:"middle"}):void 0])),tQ={appear:0,enter:0,exit:0},nQ=({anchorEl:e,open:t,onClose:n,menuGroups:r,transformOrigin:i,anchorOrigin:o,isSubMenu:a,direction:s,isPagination:l})=>r.length?Yi.jsx(NJ,{className:"nebula-table-utils-head-menu",open:t,anchorEl:e,onClose:n,transitionDuration:tQ,MenuListProps:{id:"nebula-table-utils-head-menu-list-id"},...o?{anchorOrigin:o}:{},...i?{transformOrigin:i}:{},dir:s,children:eQ({itemGroups:r,isSubMenu:a,direction:s,isPagination:l})}):null,rQ=(e,t)=>e.some((e=>t[e]>0)),iQ={canSelectAll:!1,canClearSelections:!1,canSelectPossible:!1,canSelectAlternative:!1,canSelectExcluded:!1},oQ=({open:e,qStateName:t="$",headerData:n,app:r})=>{const[i,o]=_e.useState(null),[a,s]=_e.useState(iQ);return MJ((()=>{e||(s(iQ),o(null))}),[e]),_e.useEffect((()=>{if(!r?.createSessionObject||!n.isDim||!e)return()=>{};let i,a=!1;const l=()=>{i&&r.destroySessionObject(i)};return(async()=>{try{const e=((e,t)=>({qInfo:{qType:"tableListbox"},qListObjectDef:Boolean(t.qLibraryId)?{qLibraryId:t.qLibraryId,qStateName:e}:{qDef:{qFieldDefs:[t.fieldId]},qStateName:e}}))(t,n),c=await r.createSessionObject(e),u=await c.getLayout(),{qStateCounts:d}=u.qListObject?.qDimensionInfo??{};i=u.qInfo?.qId,a?l():(o(c),d&&s((e=>({canSelectAll:rQ(["qOption","qAlternative","qExcluded","qDeselected"],e),canClearSelections:rQ(["qSelected"],e),canSelectPossible:rQ(["qOption"],e),canSelectAlternative:rQ(["qAlternative"],e),canSelectExcluded:rQ(["qAlternative","qExcluded"],e)}))(d)))}catch(e){console.error(e)}})(),()=>{a=!0,l()}}),[e,r,n,t]),{fieldInstance:i,selectionActionsEnabledStatus:a}},aQ=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M3.5 1.793 6.207 4.5l-.707.707-1.5-1.5V14H3V3.707l-1.5 1.5L.793 4.5zM8 4h5v1H8zm0 3h6v1H8zm0 3h7v1H8z"})}),sQ=_e.forwardRef(aQ),lQ=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 16 16",height:"16px",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M1 14.5a.5.5 0 0 0 .5.5H3v1H1.5A1.5 1.5 0 0 1 0 14.5V13h1zm9 1.5H6v-1h4zm5.354-8.646L12.707 10l2.646 2.646-.707.707L12 10.708l-2.646 2.646-.708-.707L11.293 10 8.646 7.354l.708-.708L12 9.293l2.646-2.647zM1 10H0V6h1zm2-9H1.5a.5.5 0 0 0-.5.5V3H0V1.5A1.5 1.5 0 0 1 1.5 0H3zm11.5-1A1.5 1.5 0 0 1 16 1.5V3h-1V1.5a.5.5 0 0 0-.5-.5H13V0zM10 1H6V0h4z"})}),cQ=_e.forwardRef(lQ),uQ=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M3.914 8h8.207L10.5 6.379l.707-.708L14.036 8.5l-2.829 2.828-.707-.707L12.12 9H3.914l1.621 1.621-.707.707L2 8.5l2.828-2.828.707.707zM15 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zm0 13V2h-2v3h-1V2H4v3H3V2H1v12h2v-2h1v2h8v-2h1v2z"})}),dQ=_e.forwardRef(uQ),fQ=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M3 2h1v10.293l1.5-1.5.707.707L3.5 14.207.793 11.5l.707-.707 1.5 1.5zm12 2H8v1h7zM8 7h6v1H8zm5 3H8v1h5z"})}),hQ=_e.forwardRef(fQ),pQ=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M8 15c-3.848 0-7-3.152-7-7s3.152-7 7-7 7 3.152 7 7-3.152 7-7 7m0 1c4.4 0 8-3.6 8-8s-3.6-8-8-8-8 3.6-8 8 3.6 8 8 8m4-7.5H4v-1h8z"})}),mQ=_e.forwardRef(pQ),gQ=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M8 15c-3.848 0-7-3.152-7-7s3.152-7 7-7 7 3.152 7 7-3.152 7-7 7m0 1c4.4 0 8-3.6 8-8s-3.6-8-8-8-8 3.6-8 8 3.6 8 8 8m4-7.5H4v-1h8zM8.5 4v8h-1V4z"})}),yQ=_e.forwardRef(gQ),vQ=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M1 8a7 7 0 1 1 10 6.326V11h-1v5h5v-1h-3.124A8 8 0 1 0 8 16v-1a7 7 0 0 1-7-7"})}),bQ=_e.forwardRef(vQ),xQ=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M9.057 11.164a6 6 0 1 1 2.112-2.116 1 1 0 0 1 .052.044l4.176 4.08a1 1 0 0 1 .009 1.422l-.707.707a1 1 0 0 1-1.406.008l-4.185-4.087a1 1 0 0 1-.05-.058ZM10.5 6a4.5 4.5 0 1 0-9 0 4.5 4.5 0 0 0 9 0"})}),wQ=_e.forwardRef(xQ),SQ=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M3 4v1H1v10h10v-2h1v2a1 1 0 0 1-.883.993L11 16H1a1 1 0 0 1-.993-.883L0 15V5a1 1 0 0 1 .883-.993L1 4zm12-4a1 1 0 0 1 .993.883L16 1v10a1 1 0 0 1-.883.993L15 12H5a1 1 0 0 1-.993-.883L4 11V1a1 1 0 0 1 .883-.993L5 0zm0 1H5v10h10zm-2.36 2.653.72.694L9.143 8.72 6.64 6.125l.72-.694L9.143 7.28z"})}),CQ=_e.forwardRef(SQ),kQ=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M6 15.5a.5.5 0 0 1 .5-.5h3a.5.5 0 1 1 0 1h-3a.5.5 0 0 1-.5-.5m-5-2v1a.5.5 0 0 0 .5.5h1a.5.5 0 1 1 0 1H1a1 1 0 0 1-1-1v-1.5a.5.5 0 1 1 1 0m14 0a.5.5 0 1 1 1 0V15a1 1 0 0 1-1 1h-1.5a.5.5 0 1 1 0-1h1a.5.5 0 0 0 .5-.5zm-14-7v3a.5.5 0 0 1-1 0v-3a.5.5 0 0 1 1 0m15 0v3a.5.5 0 1 1-1 0v-3a.5.5 0 1 1 1 0m-16-4V1a1 1 0 0 1 1-1h1.5a.5.5 0 0 1 0 1h-1a.5.5 0 0 0-.5.5v1a.5.5 0 0 1-1 0m6-2a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3A.5.5 0 0 1 6 .5m9 2v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 1 1 0-1H15a1 1 0 0 1 1 1v1.5a.5.5 0 1 1-1 0M4 4v8l8-8zm0-1h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1"})}),EQ=_e.forwardRef(kQ),MQ=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M6 15.5a.5.5 0 0 1 .5-.5h3a.5.5 0 1 1 0 1h-3a.5.5 0 0 1-.5-.5m-5-2v1a.5.5 0 0 0 .5.5h1a.5.5 0 1 1 0 1H1a1 1 0 0 1-1-1v-1.5a.5.5 0 1 1 1 0m14 0a.5.5 0 1 1 1 0V15a1 1 0 0 1-1 1h-1.5a.5.5 0 1 1 0-1h1a.5.5 0 0 0 .5-.5zm-14-7v3a.5.5 0 0 1-1 0v-3a.5.5 0 0 1 1 0m15 0v3a.5.5 0 1 1-1 0v-3a.5.5 0 1 1 1 0m-16-4V1a1 1 0 0 1 1-1h1.5a.5.5 0 0 1 0 1h-1a.5.5 0 0 0-.5.5v1a.5.5 0 0 1-1 0m6-2a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3A.5.5 0 0 1 6 .5m9 2v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 1 1 0-1H15a1 1 0 0 1 1 1v1.5a.5.5 0 1 1-1 0M4 3h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1"})}),_Q=_e.forwardRef(MQ),RQ=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M6 15.5a.5.5 0 0 1 .5-.5h3a.5.5 0 1 1 0 1h-3a.5.5 0 0 1-.5-.5m-5-2v1a.5.5 0 0 0 .5.5h1a.5.5 0 1 1 0 1H1a1 1 0 0 1-1-1v-1.5a.5.5 0 1 1 1 0m14 0a.5.5 0 1 1 1 0V15a1 1 0 0 1-1 1h-1.5a.5.5 0 1 1 0-1h1a.5.5 0 0 0 .5-.5zm-14-7v3a.5.5 0 0 1-1 0v-3a.5.5 0 0 1 1 0m15 0v3a.5.5 0 1 1-1 0v-3a.5.5 0 1 1 1 0m-16-4V1a1 1 0 0 1 1-1h1.5a.5.5 0 0 1 0 1h-1a.5.5 0 0 0-.5.5v1a.5.5 0 0 1-1 0m6-2a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3A.5.5 0 0 1 6 .5m9 2v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 1 1 0-1H15a1 1 0 0 1 1 1v1.5a.5.5 0 1 1-1 0M4 4v8h8V4zm0-1h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1"})}),IQ=_e.forwardRef(RQ),DQ=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M1 1.5a.5.5 0 0 1 .5-.5H3V0H1.5A1.5 1.5 0 0 0 0 1.5V3h1zM14.5 1a.5.5 0 0 1 .5.5V3h1V1.5A1.5 1.5 0 0 0 14.5 0H13v1zM1 14.5a.5.5 0 0 0 .5.5H3v1H1.5A1.5 1.5 0 0 1 0 14.5V13h1zm14 0a.5.5 0 0 1-.5.5H13v1h1.5a1.5 1.5 0 0 0 1.5-1.5V13h-1zM6 0h4v1H6zM0 6h1v4H0zm15 0h1v4h-1zm-9 9h4v1H6z"})}),PQ=_e.forwardRef(DQ);let AQ=function(e){return e.Sorting="sorting",e.Searching="searching",e.Selections="selections",e.AdjusterHeaderSize="adjustHeaderSize",e}({});const OQ="/qListObjectDef",LQ=({headerData:e,translator:t,menuAvailabilityFlags:n,setOpen:r,sortFromMenu:i,interactions:o,embedListbox:a,fieldInstance:s,selectionActionsEnabledStatus:l,anchorRef:c,focusColumnAdjuster:u,setActiveFieldCallback:d,expandOrCollapseArgs:f})=>{const h=[];if(n[AQ.Sorting]){const{isActivelySorted:n,sortDirection:o}=e,{ascendingEnabled:a,descendingEnabled:s}=(({isActivelySorted:e,sortDirection:t,isPivot:n,isSortedByFirstMeasure:r})=>{let i=!n&&!e||"D"===t,o=!n&&!e||"A"===t;return r&&(i=!1,o=!1),{ascendingEnabled:i,descendingEnabled:o}})(e);h.push([{groupHeading:t.get("NebulaTableUtils.MenuGroupLabel.Sorting"),items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SortAscending"),onClick:async e=>{e.stopPropagation(),await(i?.(e,"A")),r(!1)},icon:sQ,enabled:a,isActive:!!n&&"A"===o,autoFocus:a},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SortDescending"),onClick:async e=>{e.stopPropagation(),await(i?.(e,"D")),r(!1)},icon:hQ,enabled:s,isActive:!!n&&"D"===o,autoFocus:!a&&s}]}])}if(e.isCyclic&&d){const t=[];t.push([{items:[{id:1,itemTitle:e.groupDimensionLabels[e.groupDimensionPos],enabled:!0,icon:bQ,subMenus:[[{items:e.groupDimensionLabels.map(((t,n)=>({id:n+1,itemTitle:t,onClick:async e=>{e.stopPropagation(),r(!1),d(n)},enabled:!0,icon:YY,isActive:e.groupDimensionPos===n})))}]]}]}]),t.length>0&&h.push(...t)}if(e.isDim&&o?.select){const i=[];n[AQ.Searching]&&i.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Search"),onClick:e=>{e.stopPropagation(),r(!1),a()},icon:wQ,enabled:!0}]}]),!e.isLocked&&n[AQ.Selections]&&i.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Selections"),icon:PQ,enabled:!!s,subMenus:[[{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectAll"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.selectListObjectAll(OQ))},icon:CQ,enabled:l.canSelectAll},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectPossible"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.selectListObjectPossible(OQ))},icon:IQ,enabled:l.canSelectPossible},{id:3,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectAlternative"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.selectListObjectAlternative(OQ))},icon:EQ,enabled:l.canSelectAlternative},{id:4,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectExcluded"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.selectListObjectExcluded(OQ))},icon:_Q,enabled:l.canSelectExcluded}]}],[{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.ClearSelections"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.clearSelections(OQ))},icon:cQ,enabled:l.canClearSelections}]}]]}]}]),f&&!f.alwaysFullyExpanded&&h.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Expand"),onClick:async e=>{e.stopPropagation(),e.preventDefault(),r(!1),await f.expandCallback()},icon:yQ,enabled:!0},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Collapse"),onClick:async e=>{e.stopPropagation(),e.preventDefault(),r(!1),await f.collapseCallback()},icon:mQ,enabled:!0}]}]),i.length>0&&h.push(...i)}return n[AQ.AdjusterHeaderSize]&&h.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.AdjustColumnSize"),onClick:e=>{e.stopPropagation(),e.preventDefault(),r(!1),u?.(c)},icon:dQ,enabled:!0}]}]),h},TQ=({open:e,setOpen:t,anchorRef:n,headerData:r,translator:i,interactions:o,menuAvailabilityFlags:a,shouldShowMenuIcon:s=!0,sortRelatedArgs:l,searchRelatedArgs:c,selectionRelatedArgs:u,adjustHeaderSizeRelatedArgs:d,expandOrCollapseArgs:f,model:h,direction:p="ltr",isPagination:m,isAccessibleHeader:g,iconSize:y=HG})=>{const v=_e.useRef(null),b=RJ({translator:i}),{qLibraryId:x,fieldId:w,headTextAlign:S}=r,C=u?.app,{fieldInstance:k,selectionActionsEnabledStatus:E}=oQ({open:e,headerData:r,app:C,qStateName:u?.qStateName}),M=(({model:e,headerData:t})=>{if(e&&"setActiveField"in e&&void 0!==t.dimensionInfoIndex){const n=t.dimensionInfoIndex;return async t=>{try{await e.setActiveField("/qHyperCubeDef",n,t)}catch(e){console.error(e)}}}return null})({model:h,headerData:r}),_=(({qLibraryId:e,fieldId:t,searchRelatedArgs:n,selectionRelatedArgs:r,direction:i,onPopoverClose:o})=>_e.useCallback((()=>{const a=e?{qLibraryId:e,type:"dimension"}:t;if(n?.embed){const{embed:e,listboxRef:t}=n;e.__DO_NOT_USE__.popover(t.current,a,{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"rtl"===i?"right":"left"},sortCriteria:n.sortCriteria,stateName:r?.qStateName,direction:i,onPopoverClose:o})}}),[e,t,n,r?.qStateName,i,o]))({qLibraryId:x,fieldId:w,searchRelatedArgs:c,selectionRelatedArgs:u,direction:p}),R=_e.useCallback((e=>{e.stopPropagation(),t(!1)}),[t]),I=_e.useCallback((e=>{e.stopPropagation(),t((e=>!e))}),[t]);return o.active?Yi.jsxs(TJ,{rightAligned:"right"===S,shouldShowMenuIcon:s,className:"nebula-table-utils-head-menu-wrapper",onClick:!1===g?I:void 0,ref:v,isAccessibleHeader:g,children:[s?Yi.jsx(qJ,{height:y,className:UG,"data-testid":UG,isInteractionsActive:o.active??!1,children:Yi.jsx(LJ,{})}):null,Yi.jsx(nQ,{open:e,anchorEl:!1===g?v.current:n.current,onClose:R,menuGroups:LQ({headerData:r,translator:b,menuAvailabilityFlags:a,setOpen:t,...l,embedListbox:_,interactions:o,fieldInstance:k,selectionActionsEnabledStatus:E,anchorRef:n,focusColumnAdjuster:d?.focusColumnAdjuster,setActiveFieldCallback:M,expandOrCollapseArgs:f}),direction:p,isPagination:m})]}):null},qQ=e=>e.isDark?{background:e.color,borderColor:EX.DARK_MODE_BORDER,color:EX.DARK_MODE_TEXT,disabledColor:EX.DARK_MODE_DISABLED,iconColor:EX.DARK_MODE_TEXT}:{background:e.color,borderColor:EX.BORDER_MEDIUM,color:EX.TEXT,disabledColor:EX.DISABLED},NQ=il(Xx,{shouldForwardProp:e=>"footerStyle"!==e})((({footerStyle:e,theme:t})=>({height:40,display:"flex",justifyContent:"flex-end",alignItems:"center",padding:t.spacing(0,1,0,1),color:e.color,background:e.background,borderTop:`1px solid ${e.borderColor}`}))),jQ=il(XC,{shouldForwardProp:e=>"footerStyle"!==e})((({footerStyle:e,theme:t})=>({background:"inherit",marginRight:t.spacing(1),color:e.color,"& .MuiNativeSelect-icon, .MuiNativeSelect-select":{color:e.iconColor}}))),zQ=il(aw,{shouldForwardProp:e=>"disabledCondition"!==e&&"footerStyle"!==e})((({disabledCondition:e,footerStyle:t,theme:n})=>({color:e?t.disabledColor:t.color,cursor:e?"default":"pointer",marginLeft:n.spacing(1)}))),FQ=il(fx)((({theme:e})=>({color:"inherit",margin:e.spacing(0,1,0,1)}))),WQ=({children:e,footerContainer:t,interactions:n,theme:r,paginationNeeded:i=!0})=>{const o=_e.useMemo((()=>qQ(r.background)),[r]);if(!n.active)return null;const a=i?Yi.jsx(NQ,{footerStyle:o,children:e}):null;return t?wb.createPortal(e,t):a},$Q={},BQ=_e.createContext($Q),VQ=()=>_e.useContext(BQ),HQ=({children:e,direction:t,pageInfo:n,handleChangeRowsPerPage:r,footerContainer:i,isSelectionMode:o,handleChangePage:a,totalRowCount:s,totalColumnCount:l,totalPages:c,keyboard:u,translator:d,theme:f,interactions:h,rect:p,layout:m,visibilityThreshold:g})=>{const y=(e=>!e.enabled||e.active)(u)?0:-1,v=_e.useMemo((()=>qQ(f.background)),[f]),b=i?i.getBoundingClientRect().width:p.width,x=RJ({translator:d}),w=_e.useMemo((()=>({direction:t,pageInfo:n,handleChangeRowsPerPage:r,footerContainer:i,isSelectionMode:o,handleChangePage:a,totalRowCount:s,totalColumnCount:l,totalPages:c,keyboard:u,translator:x,theme:f,interactions:h,rect:p,layout:m,footerStyle:v,tabIndex:y,width:b,visibilityThreshold:g})),[t,n,r,i,o,a,s,l,c,u,x,f,h,p,m,v,y,b,g]);return Yi.jsx(BQ.Provider,{value:w,children:e})};let UQ=function(e){return e.FirstPage="FirstPage",e.LastPage="LastPage",e.NextPage="NextPage",e.PreviousPage="PreviousPage",e}({}),GQ=function(e){return e[e.DisplayedRowsLabel=250]="DisplayedRowsLabel",e[e.FirstPage=350]="FirstPage",e[e.LastPage=350]="LastPage",e[e.RowsPerPage=550]="RowsPerPage",e[e.SelectPage=700]="SelectPage",e}({});const YQ=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"m7 8 4.5 4.5L10 14 4 8l6-6 1.5 1.5z"})}),KQ=_e.forwardRef(YQ),XQ=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"m12 2 1.5 1.5L9 8l4.5 4.5L12 14 6 8zM4 2v12H2V2z"})}),JQ=_e.forwardRef(XQ),QQ=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"m3.5 2 6 6-6 6L2 12.5 6.5 8 2 3.5zM14 2v12h-2V2z"})}),ZQ=_e.forwardRef(QQ),eZ={FirstPage:JQ,PreviousPage:KQ,NextPage:UJ,LastPage:ZQ,FirstPageRTL:ZQ,PreviousPageRTL:UJ,NextPageRTL:KQ,LastPageRTL:JQ},tZ=({disabledCondition:e,pageNumber:t,type:n})=>{const{direction:r,footerStyle:i,handleChangePage:o,translator:a,interactions:s,tabIndex:l}=VQ(),c=n.concat("rtl"===r?"RTL":""),u=eZ[c];return{styledProps:{footerStyle:i,disabledCondition:e,size:"small","data-testid":"pagination-action-icon-button","aria-disabled":e,"aria-label":a.get(`NebulaTableUtils.Pagination.${n}`),title:s.passive?a.get(`NebulaTableUtils.Pagination.${n}`):void 0,tabIndex:l,onClick:e?void 0:()=>{o(t)}},IconComponent:u}},nZ=()=>{const{pageInfo:e,width:t,interactions:n,visibilityThreshold:r}=VQ(),i=0===e.page,{IconComponent:o,styledProps:a}=tZ({type:UQ.FirstPage,disabledCondition:i,pageNumber:0});return t<=(r?.firstPage||GQ.FirstPage)?null:Yi.jsx(zQ,{...a,disabled:!n.active,children:Yi.jsx(o,{height:HG})})},rZ=(e,t,n=!1)=>{n&&e.key===YG.Tab&&!e.shiftKey&&(DX(e),((e,t,n)=>{const r=e.closest(".qv-object-wrapper")?.querySelector(".sel-toolbar-confirm")?.parentElement??document.querySelector("#qv-selection-toolbar-popover .sel-toolbar-confirm")?.parentElement;r?r.focus():t.focusSelection?.(n)})(e.target,t,!1))},iZ=()=>{const{pageInfo:e,keyboard:t,totalPages:n,isSelectionMode:r,width:i,interactions:o,visibilityThreshold:a}=VQ(),s=e.page>=n-1,{IconComponent:l,styledProps:c}=tZ({type:UQ.LastPage,disabledCondition:s,pageNumber:n-1}),u=t.enabled?e=>{rZ(e,t,r)}:void 0;return i<=(a?.lastPage||GQ.LastPage)?null:Yi.jsx(zQ,{...c,onKeyDown:u,disabled:!o.active,children:Yi.jsx(l,{height:HG})})},oZ=()=>{const{pageInfo:e,keyboard:t,totalPages:n,isSelectionMode:r,width:i,interactions:o}=VQ(),a=e.page>=n-1,{IconComponent:s,styledProps:l}=tZ({type:UQ.NextPage,disabledCondition:a,pageNumber:e.page+1}),c=!(i>GQ.FirstPage&&i>GQ.LastPage)&&t.enabled?e=>{rZ(e,t,r)}:void 0;return Yi.jsx(zQ,{...l,onKeyDown:c,disabled:!o.active,children:Yi.jsx(s,{height:HG})})},aZ=()=>{const{pageInfo:e,interactions:t}=VQ(),n=0===e.page,{IconComponent:r,styledProps:i}=tZ({type:UQ.PreviousPage,disabledCondition:n,pageNumber:e.page-1});return Yi.jsx(zQ,{...i,disabled:!t.active,children:Yi.jsx(r,{height:HG})})},sZ=()=>{const{translator:e,width:t,pageInfo:n,totalRowCount:r,visibilityThreshold:i}=VQ(),{page:o,rowsPerPage:a}=n;if(t<=(i?.displayedRowsLabel||GQ.DisplayedRowsLabel))return null;const s=e.get("NebulaTableUtils.Pagination.DisplayedRowsLabel",[`${o*a+1} - ${Math.min((o+1)*a,r)}`,r.toString()]);return Yi.jsx(FQ,{variant:"caption",dir:"ltr",children:s})},lZ=({name:e,value:t,options:n,handleChange:r})=>{const{layout:i,footerStyle:o,translator:a,tabIndex:s,interactions:l}=VQ(),c=i.qInfo.qId,u=a.get(`NebulaTableUtils.Pagination.${e}`),d=`${e}-dropdown`,f=`${d}-label-${c}`,h={tabIndex:s,id:`${d}-${c}`,"data-testid":d,"aria-labelledby":f};return Yi.jsxs(Yi.Fragment,{children:[Yi.jsxs(FQ,{variant:"caption",id:f,children:[u,":"]}),Yi.jsx(jQ,{footerStyle:o,size:"small",native:!0,value:t,onChange:r,inputProps:h,disabled:!l.active,children:n})]})},cZ=()=>{const{pageInfo:e,isSelectionMode:t,totalColumnCount:n,width:r,handleChangeRowsPerPage:i,visibilityThreshold:o}=VQ();if(!(!!e.rowsPerPageOptions?.length&&!t&&r>(o?.rowsPerPage||GQ.RowsPerPage)&&n<=100)||void 0===e.rowsPerPageOptions)return null;const a=Yi.jsx(Yi.Fragment,{children:e.rowsPerPageOptions.map((e=>Yi.jsx("option",{value:e,children:e},e)))});return Yi.jsx(lZ,{name:"RowsPerPage",value:e.rowsPerPage,options:a,handleChange:e=>{i?.(+e.target.value)}})},uZ=1e3,dZ="…",fZ=({totalPages:e,page:t})=>{const n=Math.min(e,uZ),r=n<e&&t>500,i=r?Math.min(500+t,e):n,o=r?Math.max(0,i-uZ):0,a=Array.from(Array(n).keys()).map((e=>{const t=e+o;return Yi.jsx("option",{value:t,children:t+1},t)}));return o>0&&a.unshift(Yi.jsx("option",{value:dZ,disabled:!0,children:dZ},"startMoreOptions")),i<e-1&&a.push(Yi.jsx("option",{value:dZ,disabled:!0,children:dZ},"endMoreOptions")),Yi.jsx(Yi.Fragment,{children:a})},hZ=()=>{const{pageInfo:e,width:t,totalPages:n,handleChangePage:r,visibilityThreshold:i}=VQ(),{page:o}=e;if(t<=(i?.selectPage||GQ.SelectPage))return null;const a=Yi.jsx(fZ,{totalPages:n,page:o});return Yi.jsx(lZ,{name:"SelectPage",value:o,options:a,handleChange:e=>{r(+e.target.value)}})},pZ=e=>Yi.jsxs(HQ,{...e,children:[Yi.jsx(cZ,{}),Yi.jsx(hZ,{}),Yi.jsx(sZ,{}),Yi.jsx(nZ,{}),Yi.jsx(aZ,{}),Yi.jsx(oZ,{}),Yi.jsx(iZ,{})]});var mZ=_e.memo(pZ);const gZ=e=>Yi.jsx(WQ,{...e,children:Yi.jsx(mZ,{...e})}),yZ={},vZ=_e.createContext(yZ),bZ=()=>_e.useContext(vZ),xZ=({rect:e,pageInfo:t,qPivotDataPages:n,updatePageInfo:r,direction:i,children:o})=>{const a=_e.useMemo((()=>({rect:e,pageInfo:t,qPivotDataPages:n,updatePageInfo:r,direction:i})),[e,t,n,r,i]);return Yi.jsx(vZ.Provider,{value:a,children:o})},wZ=_e.createContext({}),SZ=()=>_e.useContext(wZ),CZ=({app:e,model:t,theme:n,embed:r,keyboard:i,translator:o,interactions:a,env:s,children:l})=>{const c=_e.useMemo((()=>({model:t,app:e,interactions:a,embed:r,theme:n,keyboard:i,env:s,translator:o})),[e,a,t,r,n,i,s,o]);return Yi.jsx(wZ.Provider,{value:c,children:l})},kZ=_e.createContext({}),EZ=()=>_e.useContext(kZ),MZ=({children:e,...t})=>Yi.jsx(kZ.Provider,{value:t,children:e}),_Z=()=>{const{text:e,fontFamily:t,fontSize:n,justifyContent:r,alignItems:i,height:o}=(()=>{const{theme:e,translator:t}=SZ(),{layoutService:n}=EZ(),r=e.getStyle("","","fontFamily")??FX;return n.hasData?n.hasLimitedData?{text:t.get("SNPivotTable.LimitedData"),fontSize:"13px",fontFamily:r,alignItems:"center",height:"22px"}:{}:{text:t.get("SNPivotTable.NoData"),fontSize:"16px",fontFamily:r,justifyContent:"center",alignItems:"center",height:"100%"}})();return void 0===e?null:Yi.jsx("div",{style:{display:"flex",justifyContent:r,alignItems:i,width:"100%",height:o},children:Yi.jsx("span",{style:{...KX,fontFamily:t,fontSize:n,fontStyle:"italic",color:"#7b7a78"},children:e})})},RZ="/qHyperCubeDef",IZ=-1,DZ="PSEUDO-DIM",PZ=e=>e===IZ?DZ:(({cId:e})=>e??EK())(e),AZ=({layoutService:e,visibleLeftDimensionInfos:t,cell:n,colIdx:r})=>{n&&(n.canBeResized=!0,n.colIdx=n.colIdx||r,n.dimensionInfoIndex===IZ?n.columnWidthLocation=dX.Measures:n.isLeftDimension?n.columnWidthLocation=dX.Dimension:t.at(-1)===IZ?n.columnWidthLocation=dX.Measures:e.hasPseudoDimOnLeft&&(n.columnWidthLocation=dX.Pivot))},OZ=(e,t,n,r)=>{const i=PZ(n),o=e.getDimensionInfoIndex(n),a=e.isLeftDimension(o);return n===IZ?{id:i,colIdx:-1,label:"",sortDirection:"A",fieldId:"",isLocked:!1,isDim:!1,isCyclic:!1,groupDimensionPos:0,groupDimensionLabels:[],headTextAlign:"left",dimensionInfoIndex:o,canBeResized:!1,isLeftDimension:a,isLastDimension:r,columnWidthLocation:dX.Measures,isPivot:!0,qEffectiveDimensionName:void 0}:{id:i,colIdx:0,label:n.qFallbackTitle,qReverseSort:n.qReverseSort,sortDirection:n.qSortIndicator&&"N"!==n.qSortIndicator?n.qSortIndicator:"A",qLibraryId:n.qLibraryId,fieldId:n.qGroupFieldDefs[n.qGroupPos],isLocked:n.qLocked??!1,columnWidth:n.columnWidth,qApprMaxGlyphCount:n.qApprMaxGlyphCount,isDim:!0,isCyclic:n.qGrouping===eY.Cyclic,groupDimensionPos:n.qGroupPos,groupDimensionLabels:n.qGroupFallbackTitles,headTextAlign:"left",dimensionInfoIndex:o,canBeResized:!1,isLeftDimension:a,isLastDimension:r,columnWidthLocation:dX.Dimension,isPivot:!0,isSortedByFirstMeasure:t.isSortedByFirstMeasure,qEffectiveDimensionName:n.qEffectiveDimensionName}},LZ=({layoutService:e,effectivePropertiesService:t,lastRow:n,lastCol:r})=>{let i=r;var o;n.length>0&&(i=(o=r).at(-1)===IZ?o.slice(0,-1):o);const a=i.length+(n.length?1:0),s=Math.max(1,n.length),l=((e,t)=>Array(e).fill(null).map((()=>Array.from({length:t},(()=>null)))))(a,s);return n.forEach(((n,r,i)=>{const o=r===i.length-1;l[a-1][r]=OZ(e,t,n,o)})),i.forEach(((n,r,i)=>{const o=r===i.length-1;l[r][s-1]=OZ(e,t,n,o)})),l},TZ=(e,t,n,r)=>{const i=((e,t,n,r)=>{let i;return i=0===n.length||n.includes(IZ)?LZ({layoutService:e,effectivePropertiesService:t,lastRow:r,lastCol:n}):(e=>e[0].map(((t,n)=>e.map((e=>e[n])))))(LZ({layoutService:e,effectivePropertiesService:t,lastRow:n,lastCol:r})),e.isIndentModeEnabled&&i[i.length-1].length>1&&(i[i.length-1]=[i.at(-1),...new Array(i[0]?i[0].length-1:0).fill(null)]),i.length&&i.at(-1)?.forEach(((t,n)=>{Array.isArray(t)?t.forEach(((t,n)=>{AZ({layoutService:e,visibleLeftDimensionInfos:r,cell:t,colIdx:n})})):AZ({layoutService:e,visibleLeftDimensionInfos:r,cell:t,colIdx:n})})),i})(e,t,n,r);return{data:i,size:{x:i[0]?.length??0,y:i.length}}};var qZ={fromSearchString:function(e){if(!e)return[];"?"===e[0]&&(e=e.substr(1));const t=[];return e.split("&").forEach((e=>{if(!e)return;const n=e.indexOf("=");let r,i="",o=!1;-1===n?r=e:(r=e.slice(0,n),i=e.slice(n+1),o=!0),t.push(function(e,t,n){return{key:jZ(e),value:jZ(t),useEqualSign:n}}(r,i,o))})),t}},NZ=qZ;function jZ(e){try{return decodeURIComponent(e)}catch{return e}}function zZ(e){if(!(this instanceof zZ))throw new Error("Url needs to be called with the new keyword");if(!e)throw new Error("Url needs a string to operate on");const t=function(e){const t={authorityAndPath:"",search:"",hash:""};let n=e.indexOf("#");-1!==n&&(t.hash=e.substr(n),e=e.substr(0,n));n=e.indexOf("?"),-1!==n&&(t.search=e.substr(n),e=e.substr(0,n));return t.authorityAndPath=e,t}(e);Object.defineProperties(this,{authorityAndPath:{value:t.authorityAndPath},search:{value:t.search},hash:{value:t.hash},searchParams:{get:()=>NZ.fromSearchString(t.search)}})}function FZ(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";")}zZ.encodeAuthorityAndPath=function(e){return encodeURI(e).replace(/%5B/gi,"[").replace(/%5D/gi,"]").replace(/%25/gi,"%")},zZ.encodeSearchParams=function(e){let t,n="";for(let r=0;r<e.length;r++)t=e[r],n+=0===r?"?":"&",n+=FZ(t.key),t.value?n+=`=${FZ(t.value)}`:n+=t.useEqualSign?"=":"";return n};var WZ=zZ;var $Z,BZ=class{_hasNext(){return null!=this._input&&(0!==this._input.length&&this._index<this._input.length)}constructor(e){this._input=e,this._pushback=null,this._temp=null,this._index=0,this._mark=0}pushback(e){this._pushback=e}index(){return this._index}hasNext(){return null!=this._pushback||this._hasNext()}next(){if(null!=this._pushback){const e=this._pushback;return this._pushback=null,e}return this._hasNext()?this._input.charAt(this._index++):null}nextHex(){const e=this.next();return null==e?null:e.match(/[0-9A-Fa-f]/)?e:null}peek(e){return e?!(!this._pushback||this._pushback!==e)||!!this._hasNext()&&this._input.charAt(this._index)===e:this._pushback?this._pushback:this._hasNext()?this._input.charAt(this._index):null}mark(){this._temp=this._pushback,this._mark=this._index}reset(){this._pushback=this._temp,this._index=this._mark}remainder(){let e=this._input.substr(this._index);return null!=this._pushback&&(e=this._pushback+e),e}},VZ=class{decode(e){let t="";const n=new BZ(e);let r;for(;n.hasNext();)r=this.decodeCharacter(n),t+=null!=r?r:n.next();return t}decodeCharacter(e){return e.next()}},HZ=e=>e>=0&&e<=1114111,UZ=e=>e.match(/[\s]/),GZ=class extends VZ{decodeCharacter(e){e.mark();const t=e.next();let n,r,i;if(null==t||"\\"!==t)return e.reset(),null;const o=e.next();if(null==o)return e.reset(),null;switch(o){case"\r":e.peek("\n")&&e.next();case"\n":case"\f":case"\0":return this.decodeCharacter(e)}if("NaN"===parseInt(o,16))return o;for(n=o,r=0;r<5&&(i=e.next(),null!=i&&!UZ(i));r++){if("NaN"===parseInt(i,16)){e.pushback(i);break}n+=i}const a=parseInt(n,16);return HZ(a)?String.fromCharCode(a):"�"}},YZ=class e{constructor(e,t){this._key=e,this._value=t}getKey(){return this._key}getValue(){return this._value}equals(t){return t instanceof e&&(this._key===t._key&&this._value===t._value)}static newInstanceIfNeeded(){let t,n,r=arguments[0];return"string"==typeof arguments[1]?(t=arguments[1],n=r.length):(n=arguments[1],t=arguments[2]),t&&r?(r.length>n&&(r=r.substr(0,n)),new e(r,t)):null}},KZ=class e{setValue(e){this._nextMap=null,this._value=e}getNextNode(e){return this._nextMap?this._nextMap[e]:null}put(t,n,r){let i,o;if(t.length===n)return o=this._value,this.setValue(r),o;const a=t.charAt(n);return this._nextMap?(i=this._nextMap[a],i||(i=new e,this._nextMap[a]=i)):(this._nextMap={},i=new e,this._nextMap[a]=i),i.put(t,n+1,r)}get(e,t){if(e.length<=t)return this._value;const n=this.getNextNode(e.charAt(t));return n?n.get(e,t+1):null}getLongestMatch(e,t){if(e.length<=t)return YZ.newInstanceIfNeeded(e,this._value);const n=this.getNextNode(e.charAt(t));if(!n)return YZ.newInstanceIfNeeded(e,t,this._value);const r=n.getLongestMatch(e,t+1);return r||YZ.newInstanceIfNeeded(e,t,this._value)}},XZ=class{constructor(){this.clear()}getLongestMatch(e){return this.root&&e?this.root.getLongestMatch(e,0):null}getMaxKeyLength(){return this.maxKeyLen}clear(){this.root=null,this.maxKeyLen=0,this.size=0}put(e,t){this.root||(this.root=new KZ);const n=this.root.put(e,0,t);return n||(e.length>this.maxKeyLen&&(this.maxKeyLen=e.length),this.size++,null)}},JZ=(()=>{const e=[],t=[],n=new XZ;let r,i,o;for(r in e["""]="34",e["&"]="38",e["<"]="60",e[">"]="62",e[" "]="160",e["¡"]="161",e["¢"]="162",e["£"]="163",e["¤"]="164",e["¥"]="165",e["¦"]="166",e["§"]="167",e["¨"]="168",e["©"]="169",e["ª"]="170",e["«"]="171",e["¬"]="172",e["­"]="173",e["®"]="174",e["¯"]="175",e["°"]="176",e["±"]="177",e["²"]="178",e["³"]="179",e["´"]="180",e["µ"]="181",e["¶"]="182",e["·"]="183",e["¸"]="184",e["¹"]="185",e["º"]="186",e["»"]="187",e["¼"]="188",e["½"]="189",e["¾"]="190",e["¿"]="191",e["À"]="192",e["Á"]="193",e["Â"]="194",e["Ã"]="195",e["Ä"]="196",e["Å"]="197",e["Æ"]="198",e["Ç"]="199",e["È"]="200",e["É"]="201",e["Ê"]="202",e["Ë"]="203",e["Ì"]="204",e["Í"]="205",e["Î"]="206",e["Ï"]="207",e["Ð"]="208",e["Ñ"]="209",e["Ò"]="210",e["Ó"]="211",e["Ô"]="212",e["Õ"]="213",e["Ö"]="214",e["×"]="215",e["Ø"]="216",e["Ù"]="217",e["Ú"]="218",e["Û"]="219",e["Ü"]="220",e["Ý"]="221",e["Þ"]="222",e["ß"]="223",e["à"]="224",e["á"]="225",e["â"]="226",e["ã"]="227",e["ä"]="228",e["å"]="229",e["æ"]="230",e["ç"]="231",e["è"]="232",e["é"]="233",e["ê"]="234",e["ë"]="235",e["ì"]="236",e["í"]="237",e["î"]="238",e["ï"]="239",e["ð"]="240",e["ñ"]="241",e["ò"]="242",e["ó"]="243",e["ô"]="244",e["õ"]="245",e["ö"]="246",e["÷"]="247",e["ø"]="248",e["ù"]="249",e["ú"]="250",e["û"]="251",e["ü"]="252",e["ý"]="253",e["þ"]="254",e["ÿ"]="255",e["&OElig"]="338",e["&oelig"]="339",e["&Scaron"]="352",e["&scaron"]="353",e["&Yuml"]="376",e["&fnof"]="402",e["&circ"]="710",e["&tilde"]="732",e["&Alpha"]="913",e["&Beta"]="914",e["&Gamma"]="915",e["&Delta"]="916",e["&Epsilon"]="917",e["&Zeta"]="918",e["&Eta"]="919",e["&Theta"]="920",e["&Iota"]="921",e["&Kappa"]="922",e["&Lambda"]="923",e["&Mu"]="924",e["&Nu"]="925",e["&Xi"]="926",e["&Omicron"]="927",e["&Pi"]="928",e["&Rho"]="929",e["&Sigma"]="931",e["&Tau"]="932",e["&Upsilon"]="933",e["&Phi"]="934",e["&Chi"]="935",e["&Psi"]="936",e["&Omega"]="937",e["&alpha"]="945",e["&beta"]="946",e["&gamma"]="947",e["&delta"]="948",e["&epsilon"]="949",e["&zeta"]="950",e["&eta"]="951",e["&theta"]="952",e["&iota"]="953",e["&kappa"]="954",e["&lambda"]="955",e["&mu"]="956",e["&nu"]="957",e["&xi"]="958",e["&omicron"]="959",e["&pi"]="960",e["&rho"]="961",e["&sigmaf"]="962",e["&sigma"]="963",e["&tau"]="964",e["&upsilon"]="965",e["&phi"]="966",e["&chi"]="967",e["&psi"]="968",e["&omega"]="969",e["&thetasym"]="977",e["&upsih"]="978",e["&piv"]="982",e["&ensp"]="8194",e["&emsp"]="8195",e["&thinsp"]="8201",e["&zwnj"]="8204",e["&zwj"]="8205",e["&lrm"]="8206",e["&rlm"]="8207",e["&ndash"]="8211",e["&mdash"]="8212",e["&lsquo"]="8216",e["&rsquo"]="8217",e["&sbquo"]="8218",e["&ldquo"]="8220",e["&rdquo"]="8221",e["&bdquo"]="8222",e["&dagger"]="8224",e["&Dagger"]="8225",e["&bull"]="8226",e["&hellip"]="8230",e["&permil"]="8240",e["&prime"]="8242",e["&Prime"]="8243",e["&lsaquo"]="8249",e["&rsaquo"]="8250",e["&oline"]="8254",e["&frasl"]="8260",e["&euro"]="8364",e["&image"]="8365",e["&weierp"]="8472",e["&real"]="8476",e["&trade"]="8482",e["&alefsym"]="8501",e["&larr"]="8592",e["&uarr"]="8593",e["&rarr"]="8594",e["&darr"]="8595",e["&harr"]="8596",e["&crarr"]="8629",e["&lArr"]="8656",e["&uArr"]="8657",e["&rArr"]="8658",e["&dArr"]="8659",e["&hArr"]="8660",e["&forall"]="8704",e["&part"]="8706",e["&exist"]="8707",e["&empty"]="8709",e["&nabla"]="8711",e["&isin"]="8712",e["¬in"]="8713",e["&ni"]="8715",e["&prod"]="8719",e["&sum"]="8721",e["&minus"]="8722",e["&lowast"]="8727",e["&radic"]="8730",e["&prop"]="8733",e["&infin"]="8734",e["&ang"]="8736",e["&and"]="8743",e["&or"]="8744",e["&cap"]="8745",e["&cup"]="8746",e["&int"]="8747",e["&there4"]="8756",e["&sim"]="8764",e["&cong"]="8773",e["&asymp"]="8776",e["&ne"]="8800",e["&equiv"]="8801",e["&le"]="8804",e["&ge"]="8805",e["&sub"]="8834",e["&sup"]="8835",e["&nsub"]="8836",e["&sube"]="8838",e["&supe"]="8839",e["&oplus"]="8853",e["&otimes"]="8855",e["&perp"]="8869",e["&sdot"]="8901",e["&lceil"]="8968",e["&rceil"]="8969",e["&lfloor"]="8970",e["&rfloor"]="8971",e["&lang"]="9001",e["&rang"]="9002",e["&loz"]="9674",e["&spades"]="9824",e["&clubs"]="9827",e["&hearts"]="9829",e["&diams"]="9830",e)"function"!=typeof e[r]&&e.hasOwnProperty(r)&&(t[e[r]]=r);for(i in t)"function"!=typeof t[i]&&t.hasOwnProperty(i)&&(o=t[i].toLowerCase().substr(1),n.put(o,String.fromCharCode(i)));return n})(),QZ=class extends VZ{decodeCharacter(e){let t;e.mark();const n=e.next();if(null==n||"&"!==n)return e.reset(),null;const r=e.next();if(null==r)return e.reset(),null;if("#"===r){if(t=this._getNumericEntity(e),null!=t)return t}else if(r.match(/[A-Za-z]/)&&(e.pushback(r),t=this._getNamedEntity(e),null!=t))return t;return e.reset(),null}_getNamedEntity(e){let t,n,r,i="";for(t=Math.min(e.remainder().length,JZ.getMaxKeyLength()),r=0;r<t;r++)i+=e.next().toLowerCase();const o=JZ.getLongestMatch(i);if(null==o)return null;for(e.reset(),e.next(),t=o.getKey().length,n=0;n<t;n++)e.next();return e.peek(";")&&e.next(),o.getValue()}_getNumericEntity(e){const t=e.peek();return null==t?null:"x"===t||"X"===t?(e.next(),this._parseHex(e)):this._parseNumber(e)}_parseHex(e){let t,n="";for(;e.hasNext();){if(t=e.peek(),Number.isNaN(+parseInt(t,16))){if(";"===t){e.next();break}break}n+=t,e.next()}const r=parseInt(n,16);return!Number.isNaN(+r)&&HZ(r)?String.fromCharCode(r):null}_parseNumber(e){let t,n="";for(;e.hasNext();){if(t=e.peek(),Number.isNaN(+parseInt(t,10))){if(";"===t){e.next();break}break}n+=t,e.next()}const r=parseInt(n,10);return!Number.isNaN(+r)&&HZ(r)?String.fromCharCode(r):null}},ZZ=class extends VZ{decodeCharacter(e){e.mark();const t=e.next();let n,r,i,o;if(null==t)return e.reset(),null;if("%"!==t)return e.reset(),null;for(n="",r=0;r<2;r++)i=e.nextHex(),null!=i&&(n+=i);return 2===n.length&&(o=parseInt(n,16),HZ(o))?String.fromCharCode(o):(e.reset(),null)}},e0=/^data:(?<!\s)\s*(image\/[\w+-.]+)(?<!\s)\s*(;.*?){0,1}(?<!\s)\s*,(.*)/i,t0=5e6,n0=5e5,r0=(e,t)=>{const{maxByteSizeSvg:n=n0,maxByteSizeImage:r=t0}=t??{},{mimeType:i,encoding:o,data:a}=(e=>{const[,t,n,r]=e0.exec(e.trim())??[];return{encoding:n,data:r,mimeType:t?.toLocaleLowerCase()}})(e);if(!a)return!0;const s=((e,t,n)=>{const r={type:e};if(t?.includes(";base64"))try{return new Blob([atob(n)],r).size}catch{return new Blob([n],r).size}return"image/svg+xml"===e?new Blob([n],r).size:0})(i,o,a);return"image/svg+xml"===i?s<=n:s<=r};"undefined"!=typeof document&&($Z=document.createElement("div"));var i0=Array.prototype.indexOf,o0=[",",".","_"," "],a0=[",",".","-","_"," "],s0={width:["%"],height:["%"]},l0={default:["-"," ","%"],color:["#"," ","(",")"],image:["(",")",":","/","?","&","-",".",'"',"="," "]},c0={background:["(",")",":","%","/","?","&","-"," ",".",'"',"=","#"],"background-image":l0.image,"background-color":l0.color,"border-color":l0.color,"border-image":l0.image,color:l0.color,icon:l0.image,"list-style-image":l0.image,"outline-color":l0.color},u0={attr_name:["^on[a-z]{1,}","style","href","src"],attr_val:["javascript:","data:"],css_key:["behavior","-moz-behavior","-ms-behavior"],css_val:["expression"]};function d0(e,t,n){let r;if(t){if(i0)return i0.call(t,e,n);for(r=t.length,n=n?n<0?Math.max(0,r+n):n:0;n<r;n++)if(n in t&&t[n]===e)return n}return-1}function f0(e){if(null==e)return"";let t="";const n=document.createTextNode(e);return $Z.appendChild(n),t=$Z.innerHTML,$Z.removeChild(n),t}function h0(e,t,n){let r,i,o,a,s,l,c,u,d;for(e=m0(e).toLowerCase(),t=m0(t),o=0;o<u0.attr_name.length;o++)if(e.match(u0.attr_name[o]))throw new Error(`Unsafe attribute name used: ${e}`);for(o=0;o<u0.attr_val.length;o++)if(t.toLowerCase().match(u0.attr_val[o]))throw new Error(`Unsafe attribute value used: ${t}`);if(r=s0[e],r||(r=a0),i="",!n){for(a=0;a<e.length;a++){if(s=e.charAt(a),!s.match(/[a-zA-Z\-0-9]/))throw new Error("Invalid attribute name specified");i+=s}i+='="'}for(l=0;l<t.length;l++)c=t.charAt(l),u=t.charCodeAt(l),!c.match(/[a-zA-Z0-9]/)&&d0(c,r)<0?(d=u.toString(16),i+=`&#x${d};`):i+=c;return n||(i+='"'),i}function p0(e,t,n){let r,i,o,a,s,l,c,u,d,f;if(e=m0(e).toLowerCase(),t=m0(t),d0(e,u0.css_key)>=0)throw new Error(`Unsafe property name used: ${e}`);for(r=0;r<u0.css_val.length;r++)if(t.toLowerCase().indexOf(u0.css_val[r])>=0)throw new Error(`Unsafe property value used: ${t}`);if(i=c0[e],i||(i=l0.default),o="",!n){for(a=0;a<e.length;a++){if(s=e.charAt(a),!s.match(/[a-zA-Z-]/))throw new Error("Invalid Property Name specified");o+=s}o+=": "}for(l=0;l<t.length;l++)c=t.charAt(l),u=t.charCodeAt(l),!c.match(/[a-zA-Z0-9]/)&&d0(c,i)<0?(d=u.toString(16),f="000000".substr(d.length),o+=`\\${f}${d}`):o+=c;return o}function m0(e,t){let n,r,i,o,a=!1;if(null===e)return null;n=e,r=e,i=0;const s=[new QZ,new ZZ,new GZ];for(;!a;){r=n;for(let e=0;e<s.length;e++)o=s[e].decode(n),o!==n&&(i++,n=o);r!==n||(a=!0)}if(t&&i>1)throw new Error("Attack Detected - Multiple/Double Encodings used in input");return n}var g0=[];for(let e=0;e<255;e++)g0[e]=e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122?null:e.toString(16);var y0={html:e=>f0(e.unsafe),css(e){let t,n=[];const r=[],i={};let o="";for(t in e.map?n=e.map:n[e.name]=e.unsafe,n)"function"!=typeof n[t]&&n.hasOwnProperty(t)&&(r[t]=p0(t,n[t],!0),o+=p0(t,n[t],!0),i[t]=r[t]);return e.map?i:o},attr(e){let t=[];const n=[],r={};let i="";e.map?t=e.map:t[e.name]=e.unsafe;for(const e in t)"function"!=typeof t[e]&&t.hasOwnProperty(e)&&(n[e]=h0(e,t[e],!0),i+=h0(e,t[e],!0),r[e]=n[e]);return e.map?r:i}};function v0(e,t){throw new Error(t)}var b0={canonicalize:m0,encode:function(){const e={context:"html",unsafe:null,name:null,map:null,setter:null,strict:!0};return 1===arguments.length&&"object"==typeof arguments[0]?function(){let e,t,n;const r=arguments[0]||{};let i=1;const o=arguments.length;for(;i<o;i++)if(null!=(e=arguments[i]))for(t in e)if(e.hasOwnProperty(t)){if(n=e[t],r===n)continue;void 0!==n&&(r[t]=n)}}(e,arguments[0]):(e.context=arguments[0],2===arguments.length?"html"===e.context?e.unsafe=arguments[1]:"attr"!==e.context&&"css"!==e.context||(e.map=arguments[1]):(e.name=arguments[2],e.unsafe=arguments[1])),"html"===e.context?y0.html(e):"css"===e.context?(null!=e.map&&"object"!=typeof e.map&&v0(this,"Invalid parameter type"),y0.css(e)):"attr"===e.context?(null!=e.map&&"object"!=typeof e.map&&v0(this,"Invalid parameter type"),y0.attr(e)):void v0(this,"Invalid parameter type")},encodeForAttr:h0,encodeForAttr2:function(e){return h0("nonsens",e,!0)},encodeForCSS:p0,encodeForHref:function(e){m0(e),0!==e.search("[a-zA-Z0-9]+:")&&(e=`http://${e}`);const t=new WZ(e),n=WZ.encodeAuthorityAndPath(t.authorityAndPath),r=t.searchParams;e=n+WZ.encodeSearchParams(r)+t.hash;const i=decodeURI(e).toLowerCase();if(-1!==i.indexOf("javascript:"))throw new Error("Attack Detected - Javascript in input");if(-1!==i.indexOf("data:"))throw new Error("Attack Detected - data in input");return e},encodeForJS:function(e,t){let n,r,i,o,a,s;for(t||(t=o0),s="",n=0;n<e.length;n++)i=e.charAt(n),o=e.charCodeAt(n),d0(i,t)>=0||null==g0[o]?s+=i:(r=o.toString(16),o<256?(a="00".substr(r.length),s+=`\\x${a}${r.toUpperCase()}`):(a="0000".substr(r.length),s+=`\\u${a}${r.toUpperCase()}`));return s},encodeForHTML:f0,encodeForURL:function(e,t){let n="";return t&&(t.match(/^[A-Za-z\-0-9]{1,}$/)?n+=m0(t).toLowerCase():v0(this,"Illegal Attribute Name Specified"),n+='="'),n+=encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A"),n+=t?'"':"",n},isSafeDataURL:r0,validateURI:function(e){if(""===e||function(e){if("canParse"in URL)return URL.canParse(e);try{return new URL(e),!0}catch{return!1}}(e))return!1;const t=e.replace(/%2E/gi,".");if(t.match(/[#&=: ]/))return!1;const n=function(e){let t=e,n="";for(;t.length>0;)if(t.startsWith("../")||t.startsWith("./"))t=t.replace(/^\.\.?\//,"");else if(t.startsWith("/./"))t=t.replace(/^\/\.\//,"/");else if("/."===t)t="/";else if(t.startsWith("/../")){t=t.replace(/^\/\.\.\//,"/");const e=n.lastIndexOf("/");-1!==e&&(n=n.slice(0,e))}else if("/.."===t){t="/";const e=n.lastIndexOf("/");-1!==e&&(n=n.slice(0,e))}else if("."===t||".."===t)t="";else{const e=t.match(/^\/?[^/]*/),r=e?e[0]:"";t=t.slice(r.length),n+=r}return n}(t);return""!==n&&"/"!==n&&n}};const x0=(e,t)=>t.qAttrExps?.qValues?.[e],w0=(e,t)=>{switch(e){case"topLeft":default:return{horizontal:"rtl"===t?"flex-end":"flex-start",vertical:"flex-start"};case"centerLeft":return{horizontal:"center",vertical:"flex-start"};case"bottomLeft":return{horizontal:"rtl"===t?"flex-start":"flex-end",vertical:"flex-start"};case"topCenter":return{horizontal:"rtl"===t?"flex-end":"flex-start",vertical:"center"};case"centerCenter":return{horizontal:"center",vertical:"center"};case"bottomCenter":return{horizontal:"rtl"===t?"flex-start":"flex-end",vertical:"center"};case"topRight":return{horizontal:"rtl"===t?"flex-end":"flex-start",vertical:"flex-end"};case"centerRight":return{horizontal:"center",vertical:"flex-end"};case"bottomRight":return{horizontal:"rtl"===t?"flex-start":"flex-end",vertical:"flex-end"}}},S0=({text:e,url:t,imageSize:n,imagePosition:r,labelStructure:i,imageBox:o,direction:a})=>!r||t&&(t.toLowerCase().includes("javascript:")||!b0.isSafeDataURL(t))?{type:iX.Text,url:void 0,text:e,labelStructure:i}:{type:iX.Image,url:t||"",text:e,imageSize:n,resolvedImagePosition:w0(r,a),labelStructure:i,imageBox:o},C0=(e,t,n,r)=>{if(!e.qMiniChart||!t?.miniChart||!n)return{type:iX.Text,text:r};const{minY:i,maxY:o}=((e,t,n)=>{const r="global"===t.yAxis?.scale,i="zeroCenter"===t.yAxis?.position,o=r?n.qYMin:e.qMiniChart.qMin,a=r?n.qYMax:e.qMiniChart.qMax;if(i){const e=Math.max(Math.abs(o),Math.abs(a));return{minY:-e,maxY:e}}return(e=>"zeroBaseline"===e.yAxis?.position||"bars"===e.type&&"auto"===e.yAxis?.position)(t)?{minY:Math.min(0,o),maxY:Math.max(0,a)}:{minY:o,maxY:a}})(e,t.miniChart,n),a={type:t.miniChart.type,qMatrix:e.qMiniChart.qMatrix,minY:i,maxY:o,showDots:!!t.miniChart.showDots,colors:t.miniChart.colors,colorMin:e.qMiniChart.qMin,colorMax:e.qMiniChart.qMax};return{type:iX.MiniChart,text:r,miniChart:a}},k0=(e,t,n)=>{const r=Array.isArray(t.qAttrExps)?t.qAttrExps[0]:t.qAttrExps,i=r?.qValues?.[e];if(i){const e=Number.isNaN(+i.qNum)?void 0:`${i.qNum}`;return i.qText||e}return n?.urlPosition===oX.Attribute?void 0:n?.urlLabel},E0=({labelStructure:e,text:t,url:n})=>{try{if(!n)throw Error("Invalid url");return{type:iX.Link,url:b0.encodeForHref(n),text:t,labelStructure:e}}catch{return{type:iX.Text,url:void 0,text:t,labelStructure:e}}},M0=({cell:e,representationProperties:t,attrExprInfoIndex:n,env:r,conditionalColoring:i,miniChartOnMeasure:o,labelStructure:a,getText:s=e=>e.qText,direction:l,enabledFeatures:c})=>{const u=aX(t),d=s(e);return u===iX.Image&&c[iX.Image]&&!r.anything.sense?.isUnsupportedFeature?.("tableImages")?((e,t,n,r,i,o)=>{const{imageSize:a,imagePosition:s,imageSetting:l,imageLabel:c,imageBox:u}=t??{};if("url"===l){const t=x0(n.imageUrl??-1,e)?.qText;return o&&(o.maskedValue=t??""),S0({text:r,url:t,imageSize:a,imagePosition:s,labelStructure:o,imageBox:u,direction:i})}if("label"===l){const t=o?o.originalValue:r;if(-1===n.imageLabel)return S0({text:c||t||"",url:t,imageSize:a,imagePosition:s,labelStructure:o,imageBox:u,direction:i});const l=x0(n.imageLabel??-1,e)?.qText??r;return S0({text:l,url:t,imageSize:a,imagePosition:s,labelStructure:o,imageBox:u,direction:i})}return{type:iX.Text,url:void 0,labelStructure:o,text:r}})(e,t,n,d,l,a):u===iX.Link?((e,t,n,r,i)=>{const{urlPosition:o}=t??{};if(o===oX.Attribute){const o=k0(n.url??-1,e,t);return E0({labelStructure:r,text:i||o||"",url:o})}if(o===oX.Dimension){const o=k0(n.urlLabel??-1,e,t)||i;return r&&(r.maskedValue=o),E0({text:o,labelStructure:r,url:r?.originalValue??i})}return{type:iX.Text,url:void 0,text:i,labelStructure:r}})(e,t,n,a,d):u===iX.Indicator&&c[iX.Indicator]&&!r.anything.sense?.isUnsupportedFeature?.("tableIndicators")?((e,t,n)=>{const{indicator:r}=e??{};return{type:iX.Indicator,url:void 0,text:n,indicator:{applySegmentColors:r?.applySegmentColors,position:r?.position,showTextValues:r?.showTextValues},indicatorConditionalColoring:t}})(t,i,d):u===iX.MiniChart&&c[iX.MiniChart]&&!r.anything.sense?.isUnsupportedFeature?.("qMiniChartDef")?C0(e,t,o,d):{type:iX.Text,url:void 0,text:d,labelStructure:a}},_0=(e,t)=>{const n=t.qAttrExps,r=n?.qValues?.[e?.cellForegroundColor??-1]?.qText,i=n?.qValues?.[e?.cellBackgroundColor??-1]?.qText,o=i?IX(i):null,a=r?IX(r):null,s=((e,t)=>e||!t?null:MX(t))(a,o);return{color:s??a,background:o}},R0=(e,t)=>t.qSubNodes.reduce(((e,t)=>0===t.qSubNodes.length?e+1:R0(e,t)),e),I0=(e,t,n,r,i,o)=>{const a=i?o.rowsPerPage-n:$X-r;let s=e.qUp+e.qDown;if(i&&0===n){const n=(t+e.qUp)%o.rowsPerPage;s=e.qDown+n}return Math.min(a,R0(s,e))},D0=({node:e,parent:t,root:n,x:r,y:i,pageY:o,layoutService:a,dimensionInfo:s,attrExprInfoIndex:l,isLeftColumn:c=!0,isIndentModeEnabled:u=!1,indentLevel:d,labelStructure:f,env:h,pageInfo:p,direction:m="ltr"})=>{const g=(!u||!c)&&"P"===e.qType,y=((e,t)=>{if(e!==IZ){if(t){const t=aX(e.representation);return t===iX.Link||t===iX.Image?e.representation:{type:iX.Text}}return e.representation}})(s,u),v=(({node:e,isLeftColumn:t,isIndentModeEnabled:n,labelStructure:r,representationType:i,parentOrRootOriginalValue:o})=>{let a=e.qText;if(t&&n&&r){const{originalValue:t,delimeter:n,suffix:s}=r;a=i===iX.Link?"P"===e.qType?o:t:`${t} ${!s||!t&&s?"":n} ${s}`.trim()}return a})({node:e,isLeftColumn:c,isIndentModeEnabled:u,labelStructure:f,representationType:aX(y),parentOrRootOriginalValue:(t||n)?.representation?.labelStructure?.originalValue??""}),b=M0({cell:{...e,qText:v},representationProperties:y,attrExprInfoIndex:l,env:h,labelStructure:f,direction:m,enabledFeatures:{[iX.Image]:!0,[iX.Indicator]:!0}}),x={id:EK(),ref:e,x:r,y:i,pageX:r,pageY:o,mainAxisPageCoord:c?o:r,isLeftColumn:c,parent:t,root:n,children:[],isLeafNode:0===e.qSubNodes.length,leafCount:I0(e,i,o,r,c,p),distanceToNextCell:0,isLockedByDimension:!("object"!=typeof s||!s.qLocked),isTotal:"T"===e.qType||!!t?.isTotal,isEmpty:"E"===e.qType||-4===e.qElemNo,isNull:"U"===e.qType,isPseudoDimension:g,expressionColor:_0(l,e),selectionCellType:c?"L":"T",dimensionInfoIndex:a.getDimensionInfoIndex(s),canBeResized:0===e.qSubNodes.length&&!c,visibleMeasureInfoIndex:g?e.qElemNo:t?.visibleMeasureInfoIndex,representation:b,...void 0!==d&&{indentLevel:d}};return t&&(t.children[x.mainAxisPageCoord-t.mainAxisPageCoord]=x),x},P0=(e,t,n,r,i,o,a,s,l)=>{const{isIndentModeEnabled:c}=i;if(!t.length)return e;let u=0;return function t(d,f,h,p=0,m=-1){e[p]||(e[p]={}),c&&m++;const g=i.leftDimensionInfoIndexes.indexOf(IZ);h.forEach(((h,y)=>{const v={originalValue:h.qText??"",maskedValue:"",delimeter:"-",suffix:""};u+=0===y?0:1;const b=n.qTop-r.page*r.rowsPerPage,x=Math.max(0,b+u-h.qUp),w=n.qTop+u-h.qUp;if(c){if(i.hasPseudoDimOnLeft&&m<=g)if(v.originalValue=h.qText??"",v.maskedValue=h.qText??"","N"===h.qType||"U"===h.qType||"T"===h.qType)"U"===h.qType&&(v.originalValue=i.getNullValueText()),m<g&&(v.suffix=i.visibleMeasureInfo[0].qFallbackTitle);else if("P"===h.qType){v.originalValue=(f||d)?.representation.labelStructure?.originalValue??"",v.maskedValue=(f||d)?.representation.labelStructure?.originalValue??"",v.suffix=h.qText??"";const e=h.qSubNodes;h={...(f||d)?.ref,...h.qText?{qText:h.qText}:{},qSubNodes:e},m=(f||d)?.indentLevel??0}"U"===h.qType&&(v.originalValue=i.getNullValueText())}let S=p;c&&(S=g>=1&&m>=g?m+1:m,0===m&&0===g&&0===h.qSubNodes.length&&(S=0));const C=e.at(p)?.[x],k=c&&void 0===C?.ref.qText||!C?D0({node:h,parent:f,root:d,x:S,y:w,pageY:x,layoutService:i,dimensionInfo:o[S],attrExprInfoIndex:a[S],isLeftColumn:!0,...c&&{isIndentModeEnabled:c,indentLevel:m},env:s,pageInfo:r,labelStructure:v,direction:l}):e[p][x];if(e[p][x]=k,h.qSubNodes.length){const e=c?0:p+1;t(d||k,k,h.qSubNodes,e,m)}}))}(null,null,t,0,-1),e},A0=(e,t)=>{e.slice(0,-1).forEach((e=>{Object.values(e).forEach(((e,n,r)=>{const i=r.at(n+1);e.distanceToNextCell=i?i.mainAxisPageCoord-(e.mainAxisPageCoord+e.leafCount):t-(e.mainAxisPageCoord+e.leafCount)}))}))},O0=(e,t)=>{const n=e[0],r=n?Object.values(n):[],i=t?.isIndentModeEnabled&&t.hasPseudoDimOnLeft?t.visibleMeasureInfo.length-1:0,o=n?.[i],a=r.at(-1);return o?.isTotal?o.isLeafNode?o.mainAxisPageCoord:o.mainAxisPageCoord+o.leafCount-1:a?.isTotal?a.mainAxisPageCoord-1:-1},L0=({prevData:e,nextDataPage:t,pageInfo:n,layoutService:r,visibleLeftDimensionInfo:i,attrExprInfoIndexes:o,env:a,direction:s})=>{const{qLeft:l,qArea:c}=t;if(!l.length)return e;const u=P0(e.grid,l,c,n,r,i,o,a,s);A0(u,n.rowsOnCurrentPage);const d=O0(u,r);return{...e,grid:u,columnCount:u.length,totalDividerIndex:d}},T0=({qArea:e,prevData:t,pivotValuePoints:n,pageInfo:r})=>{const i=[...t];return n.forEach(((t,n)=>{t.forEach(((t,o)=>{const a=e.qTop-r.page*r.rowsPerPage+n,s=e.qLeft+o;Array.isArray(i[a])||(i[a]=[]);const l="U"===t.qType;i[a][s]=i[a][s]??{id:EK(),ref:t,isNull:l}}))})),i},q0=({prevData:e,dataPage:t,pageInfo:n})=>{const{qData:r,qArea:i}=t;return r?.length?T0({qArea:i,prevData:e,pivotValuePoints:r,pageInfo:n}):e},N0=(e,t,n,r,i,o,a,s,l,c)=>{const{isIndentModeEnabled:u}=r;if(!t.length)return e;let d=0;!function t(a,f,h,p=0){e[p]||(e[p]={}),h.forEach(((h,m)=>{d+=0===m?0:1;const g=n.qLeft+d-h.qUp,y=e[p][g]??D0({node:h,parent:f,root:a,x:g,y:p,pageY:p,layoutService:r,dimensionInfo:i[p],attrExprInfoIndex:o[p],isLeftColumn:!1,...u&&{isIndentModeEnabled:u},env:s,pageInfo:l,direction:c});e[p][g]=y,h.qSubNodes.length&&t(a||y,y,h.qSubNodes,p+1)}))}(null,null,t);for(let t=0;t<a-e.length;t++)e.push({});return e},j0=({prevData:e,nextDataPage:t,layoutService:n,visibleTopDimensionInfo:r,attrExprInfoIndexes:i,headerRows:o,env:a,pageInfo:s,direction:l})=>{const{qTop:c,qArea:u}=t;if(!c.length)return e;const d=N0(e.grid,c,u,n,r,i,o,a,s,l);A0(d,n.size.x);const f=O0(d);return{...e,grid:d,rowCount:d.length,totalDividerIndex:f}},z0=e=>-1===e?{}:e.qAttrExprInfo.reduce(((e,{id:t},n)=>(e[t]=n,e)),{}),F0=(e,t)=>{const{env:n}=SZ(),{direction:r}=bZ(),{layoutService:i,effectivePropertiesService:o}=EZ(),{qPivotDataPages:a,pageInfo:s}=bZ(),[l,c]=_e.useState(null),u=((e,t,n)=>_e.useMemo((()=>({left:e.map(z0),top:t.map(z0),measures:n.map(z0)})),[n,e,t]))(e,t,i.visibleMeasureInfo),d=_e.useMemo((()=>TZ(i,o,t,e)),[i,o,t,e]),f=_e.useCallback((()=>a.slice(1).reduce(((e,t)=>q0({prevData:e,dataPage:t,pageInfo:s})),((e,t)=>{const{qData:n,qArea:r}=e;return T0({qArea:r,prevData:[],pivotValuePoints:n,pageInfo:t})})(a[0],s))),[a,s]),h=_e.useCallback((()=>a.slice(1).reduce(((e,o)=>j0({prevData:e,nextDataPage:o,layoutService:i,visibleTopDimensionInfo:t,attrExprInfoIndexes:u.top,headerRows:d.size.y,env:n,pageInfo:s,direction:r})),((e,t,n,r,i,o,a,s)=>{const{qArea:l,qTop:c}=e,u=N0([],c,l,t,n,r,i,o,a,s);A0(u,t.size.x);const d=O0(u);return{grid:u,rowCount:u.length,layoutSize:t.size,totalDividerIndex:d}})(a[0],i,t,u.top,d.size.y,n,s,r))),[a,i,t,u.top,d.size.y,n,s,r]),p=_e.useCallback((()=>a.slice(1).reduce(((t,o)=>L0({prevData:t,nextDataPage:o,pageInfo:s,layoutService:i,visibleLeftDimensionInfo:e,attrExprInfoIndexes:u.left,env:n,direction:r})),((e,t,n,r,i,o,a)=>{const{qArea:s,qLeft:l}=e,c=P0([],l,s,n,t,r,i,o,a);A0(c,n.rowsOnCurrentPage);const u=O0(c,t);return{grid:c,columnCount:c.length,layoutSize:t.size,totalDividerIndex:u}})(a[0],i,s,e,u.left,n,r))),[a,i,s,e,u,n,r]),[m,g]=_e.useState((()=>f())),[y,v]=_e.useState((()=>h())),[b,x]=_e.useState((()=>p()));MJ((()=>{g(f())}),[f]),MJ((()=>{v(h())}),[h]),MJ((()=>{x(p())}),[p]),MJ((()=>{l&&l.forEach((o=>{g((e=>q0({prevData:e,dataPage:o,pageInfo:s}))),v((e=>j0({prevData:e,nextDataPage:o,layoutService:i,visibleTopDimensionInfo:t,attrExprInfoIndexes:u.top,headerRows:d.size.y,env:n,pageInfo:s,direction:r}))),x((t=>L0({prevData:t,nextDataPage:o,pageInfo:s,layoutService:i,visibleLeftDimensionInfo:e,attrExprInfoIndexes:u.left,env:n,direction:r})))}))}),[l]);const w=_e.useCallback((e=>{c(e)}),[]);return{headersData:d,measureData:m,topDimensionData:y,leftDimensionData:b,attrExprInfoIndexes:u,nextPageHandler:w}},W0=Math.sqrt(1e4),$0=e=>({maxNumberOfVisibleRows:Math.ceil(e.height/24),maxNumberOfVisibleColumns:Math.ceil(e.width/XG.PixelsMin)}),B0=e=>{if(null===e)return[];if(e.qWidth*e.qHeight<1e4)return[e];const t=[],n=Math.ceil(e.qWidth/W0),r=Math.ceil(e.qHeight/W0);for(let i=0;i<n;i++)for(let n=0;n<r;n++)t.push({qLeft:e.qLeft+i*W0,qTop:e.qTop+n*W0,qWidth:Math.min(W0,e.qWidth-i*W0),qHeight:Math.min(W0,e.qHeight-n*W0)});return t};function V0({nextPageHandler:e}){const{model:t}=SZ(),{pageInfo:n}=bZ(),{layoutService:r}=EZ(),i=(e=>{const t=_e.useRef(e);return t.current=e,t})(n.page),o=t,a=_e.useCallback((async(e,t)=>{await(o?.collapseLeft(RZ,e,t,!1))}),[o]),s=_e.useCallback((async(e,t)=>{await(o?.collapseTop(RZ,e,t,!1))}),[o]),l=_e.useCallback((async(e,t)=>{await(o?.expandLeft(RZ,e,t,!1))}),[o]),c=_e.useCallback((async(e,t)=>{await(o?.expandTop(RZ,e,t,!1))}),[o]),u=_e.useCallback((async t=>{if(o?.getHyperCubePivotData&&0!==t.length)try{const r=await o.getHyperCubePivotData(RZ,t.reduce(((e,t)=>[...e,...B0(t)]),[]));i.current===n.page&&e(r)}catch(e){console.error(e)}}),[o,e,n,i]),d=_e.useCallback(((e,{dimensionInfoIndex:n,isLeftColumn:i,x:o=0,columnWidthLocation:a})=>{const{qMeasureInfo:s,qDimensionInfo:l,topHeadersColumnWidth:c}=r.layout.qHyperCube;let u=[];switch(a){case dX.Dimension:u=[{qPath:`${RZ}/qDimensions/${n}/qDef/columnWidth`,oldValue:l[n].columnWidth}];break;case dX.Measures:if(i)u=s.map(((e,t)=>({qPath:`${RZ}/qMeasures/${t}/qDef/columnWidth`,oldValue:e.columnWidth})));else{const e=r.getMeasureInfoIndexFromCellIndex(o);u=[{qPath:`${RZ}/qMeasures/${e}/qDef/columnWidth`,oldValue:s[e].columnWidth}]}break;case dX.Pivot:u=[{qPath:`${RZ}/topHeadersColumnWidth`,oldValue:c}]}const d=u.map((t=>{const{qPath:n,oldValue:r}=t;return{qPath:n,qOp:r?"Replace":"Add",qValue:JSON.stringify({...r,...e})}}));t?.applyPatches(d,!0)}),[t,r]),f=_e.useCallback((async e=>{await(o?.applyPatches([{qPath:`${RZ}/indentModeColumnWidth`,qOp:r.layout.qHyperCube.indentModeColumnWidth?"Replace":"Add",qValue:JSON.stringify({...r.indentModeColumnWidth,...e})}],!0))}),[o,r]);return _e.useMemo((()=>({collapseLeft:a,collapseTop:s,expandLeft:l,expandTop:c,applyColumnWidth:d,applyIndentModeColumnWidth:f,fetchPages:u})),[a,s,l,c,d,f,u])}const H0=(e,t,n)=>(r,i)=>{if("P"===r)return IZ;const o=t[n+i];return e[o]},U0=e=>{const t=[],n=(e,r=0)=>{e.slice(0,1).forEach((e=>{t[r]=e.qType,e.qSubNodes.length&&n(e.qSubNodes,r+1)}))};return n(e),t},G0=_e.createContext({}),Y0=()=>_e.useContext(G0),K0=({children:e})=>{const{visibleLeftDimensionInfo:t,visibleTopDimensionInfo:n}=(()=>{const{layoutService:{layout:{qHyperCube:{qNoOfLeftDims:e,qEffectiveInterColumnSortOrder:t,qDimensionInfo:n}}}}=EZ(),{qPivotDataPages:r}=bZ();return _e.useMemo((()=>{const i=U0(r[0]?.qLeft??[]),o=U0(r[0]?.qTop??[]);return{visibleLeftDimensionInfo:i.map(H0(n,t,0)),visibleTopDimensionInfo:o.map(H0(n,t,e))}}),[n,t,e,r])})(),{headersData:r,measureData:i,topDimensionData:o,leftDimensionData:a,attrExprInfoIndexes:s,nextPageHandler:l}=F0(t,n),c=V0({nextPageHandler:l}),u=_e.useMemo((()=>({gridSectionsData:{headersData:r,topDimensionData:o,leftDimensionData:a,measureData:i},visibleDimensionsInfo:{visibleLeftDimensionInfo:t,visibleTopDimensionInfo:n},attrExprInfoIndexes:s,dataModel:c})),[t,n,r,i,o,a,s,c]);return Yi.jsx(G0.Provider,{value:u,children:e})},X0=20,J0=18,Q0=.75,Z0=e=>-1!==e&&e?.representation?.type===iX.Image,e1=({isLeftColumn:e,layoutService:t,representation:n})=>Boolean(e)&&t.isIndentModeEnabled&&n.type===iX.Image,t1=e=>void 0===e?WX:e,n1=(e,t)=>{if(void 0!==e&&!Number.isNaN(+e)){const n=+e;return n>=0?n:t}return t},r1=e=>n1(e,XG.PixelsDefault),i1=(e,t)=>n1(e,XG.PercentageDefault)*t/100,o1=(e,t,n)=>{switch(t?.type){case JG.Pixels:return r1(t.pixels);case JG.Percentage:return i1(t.percentage,e);case JG.FitToContent:case JG.Auto:default:return n}},a1=({headers:e,layoutService:t,effectivePropertiesService:n,estimateWidthForDimensionValue:r,shouldConsiderCombinatedLength:i,measureTextForHeader:o,longestMeasureValuePossible:a})=>e.reduce(((e,s,l)=>{const{layout:{qHyperCube:{qNoOfLeftDims:c,qDimensionInfo:u}}}=t,{id:d,colIdx:f,qApprMaxGlyphCount:h,isLeftDimension:p}=s,m=u.find((e=>e.cId===d)),g={width:24,...m?.representation?.imageBox};if(!p)return e+0;if(d===DZ)return e+0;const y=e1({isLeftColumn:p,layoutService:t,representation:m?.representation||{type:iX.Text}})?g.width+8+4:r(h),v=!n.qAlwaysFullyExpanded&&f<c-1?21:0;let b=0;if(i&&o&&a){b=o("- ")+a}return Math.max(e,24*l+J0+v+y+b)}),0),s1=(e,t,n)=>e.reduce(((e,r)=>{const i=(n?0:1)*J0;return Math.max(e,i+t(r.qFallbackTitle))}),0),l1=(e,t,n,r)=>{const i=100*e/t,o=r*Q0*(i/100),a=i/100*+n;return Math.min(a,o)},c1=(e,t,n,r)=>r*(+n/100)*(100*e/t/100),u1=(e,t)=>e.some((e=>e>=t*Q0)),d1=({layoutService:e,effectivePropertiesService:t,headersData:n,columnWidths:r,tableWidth:i,widthOverride:o,measureTextForHeader:a,estimateWidthForDimensionValue:s,measureTextWidthForMeasuresCombinedWithDimensions:l,translator:c})=>{let u=[];const d=i*Q0,f=n.data[n.data.length-1][0];if(!Array.isArray(f))return{leftGridWidth:0,leftGridColumnWidths:[],leftGridFullWidth:0};const h=Math.min(d,r.at(-1)),p=Math.min(d,a1({headers:f,layoutService:e,effectivePropertiesService:t,estimateWidthForDimensionValue:s})),m=Math.min(d,s1(e.visibleMeasureInfo,a));let g=0;const y=f.findIndex((e=>e.id===DZ)),v=(({layoutService:e,measureTextForHeader:t,translator:n,headersData:r})=>{const{type:i}=e.indentModeColumnWidth;return i===JG.Auto&&r.size.y<=1?t(n.get("SNPivotTable.IndentMode.Rows"))+8+J0+16:24})({layoutService:e,measureTextForHeader:a,translator:c,headersData:n});if(e.hasPseudoDimOnLeft)if(0===y){const e=Math.max(h,p,m);u=[Math.max(v,e-h),h]}else{const n=Math.min(d,s1(e.visibleMeasureInfo,l,!0));g=Math.min(d,a1({headers:f.slice(0,y),layoutService:e,effectivePropertiesService:t,estimateWidthForDimensionValue:s,shouldConsiderCombinatedLength:!0,measureTextForHeader:a,longestMeasureValuePossible:n}));const r=Math.max(h,p,g);u=[Math.max(v,r-h),h]}else u=[Math.max(v,p-h),h];const b=Math.min(d,u.reduce(((e,t)=>e+t),0)),{indentModeColumnWidth:x}=e;o&&o<=d&&(x.type=JG.Pixels,x.pixels=o);return[JG.Pixels,JG.Percentage].includes(x.type)||u1(u,i)?((e,t,n,r)=>{let i=e[0],o=e[1],a=[];const s=e.reduce(((e,t)=>e+t),0),{type:l,pixels:c,percentage:u}=t,d=n1(c,XG.PixelsDefault),f=n1(u,XG.PercentageDefault),h=u1(e,n);l===JG.Auto&&h&&(i>o?i-=o:o-=i),l===JG.Pixels&&d&&(i=l1(e[0],s,d,n),o=l1(e[1],s,d,n)),l===JG.Percentage&&f&&(i=c1(e[0],s,f,n),o=c1(e[1],s,f,n));let p=0;o<=r&&(p=i-5,p>0&&(i-=p,o+=p)),p=o-r,p>0&&(i+=p,o-=p),a=[i,o];const m=a.reduce(((e,t)=>e+t),0);return{leftGridColumnWidths:a,leftGridWidth:m,leftGridFullWidth:m}})(u,x,i,h):{leftGridWidth:b,leftGridColumnWidths:u,leftGridFullWidth:b}};function f1({tableWidth:e}){const t=e*Q0,{styleService:n,layoutService:r,effectivePropertiesService:i}=EZ(),{translator:o}=SZ(),{gridSectionsData:{headersData:a}}=Y0(),{measureText:s}=SJ(n.header,{allowLineBreaks:!1}),{estimateWidth:l,measureText:c}=SJ({...n.dimensionValues,fontWeight:t1(n.dimensionValues.fontWeight)}),{measureText:u}=SJ({...n.dimensionValues,...n.measureLabels}),d=_e.useCallback(((n,d)=>{const{layout:{qHyperCube:{qNoOfLeftDims:f,topHeadersColumnWidth:h}},visibleMeasureInfo:p,isIndentModeEnabled:m,hasPseudoDimOnLeft:g}=r,y=(t=0)=>p.reduce(((n,{qFallbackTitle:r,columnWidth:i})=>{const o=u(r)+J0,a=Math.max(o,t);return Math.max(n,m?a:o1(e,i,a))}),0),v=e=>a.data.reduce(((t,n)=>{const r=n.at(e);if(!r||Array.isArray(r))return t;if(r.id===DZ)return t;const i=(e=>{const{label:t,isLocked:n}=e,r=n?X0:0;return J0+s(t)+X0+r})(r);return Math.max(i,t)}),0);let b=0,x=a.data.at(-1);m&&a.size.x>1&&x&&x[0]&&(x=x[0]);const w=x.map(((o,s)=>{let c=J0;if(m&&1!==a.size.x||!n||void 0===d||d!==o.colIdx){let t;o.columnWidthLocation===dX.Pivot?t=m?void 0:h:o.columnWidthLocation===dX.Dimension&&({columnWidth:t}=o);let n=0;if(o.isLeftDimension)if(o.id===DZ)n=y();else{const e=v(s),t=((e,t)=>{const{qApprMaxGlyphCount:n,isLeftDimension:o,dimensionInfoIndex:a}=e,s=r.getDimensionInfo(a);if(Z0(s))return XG.PixelsDefault;const c=!i.qAlwaysFullyExpanded&&o&&t<f-1?21:0;return J0+l(n)+c})(o,s);n=Math.max(e,t),m&&!g&&s+1===f&&o.columnWidthLocation===dX.Dimension&&a.size.x>1&&(n=e)}else n=v(s),o.columnWidthLocation===dX.Measures&&(n=y(n));m&&1===a.size.x&&(t=r.indentModeColumnWidth),c=m&&!g&&a.size.x>1?n:o1(e,t,n)}else c=m?Math.min(t,n):n;return b+=c,c}));return m&&a.size.x>1?d1({layoutService:r,effectivePropertiesService:i,headersData:a,columnWidths:w,tableWidth:e,widthOverride:n,measureTextForHeader:s,estimateWidthForDimensionValue:l,measureTextWidthForMeasuresCombinedWithDimensions:c,translator:o}):{leftGridWidth:Math.min(t,b),leftGridColumnWidths:w,leftGridFullWidth:b}}),[e,a,r,t,s,u,l,c,o,i]),[f,h]=_e.useState(d);MJ((()=>{h(d())}),[d]);const p=_e.useCallback(((e,t)=>{h(d(e,t))}),[d]);return{...f,overrideLeftGridWidth:p}}function h1({tableWidth:e,verticalScrollbarWidth:t,leftGridWidth:n}){const{styleService:r,layoutService:i}=EZ(),{visibleDimensionsInfo:{visibleTopDimensionInfo:o}}=Y0(),{layout:{qHyperCube:{qNoOfLeftDims:a,qEffectiveInterColumnSortOrder:s}},size:l,visibleMeasureInfo:c}=i,{estimateWidth:u,measureText:d}=SJ(r.measureValues,{allowLineBreaks:!1}),{estimateWidth:f}=SJ({...r.dimensionValues,fontWeight:t1(r.dimensionValues.fontWeight)},{allowLineBreaks:!1}),h=e-n-1,p=o.at(-1),m=p===IZ,g=s.length-a>o.length?21:0,y=_e.useMemo((()=>{const e=m?c:[p],t=l.x/e.length,n=[],r=[];let i=h;const o=(e,r)=>{n[e]=Math.min(XG.PixelsMax,Math.max(XG.PixelsMin,r)),i-=n[e]*t};if(e.forEach(((e,t)=>{if(e?.columnWidth){const{columnWidth:{type:n,pixels:i,percentage:a},qApprMaxGlyphCount:s,qFallbackTitle:l}=e;switch(n){case JG.Pixels:o(t,r1(i));break;case JG.Percentage:o(t,i1(a,h));break;case JG.FitToContent:o(t,((e,t,n)=>n?XG.PixelsDefault:J0+(m?Math.max(u(e),d(t)):Math.max(Math.max(...c.map((e=>u(e.qApprMaxGlyphCount)))),f(e)+g)))(s,l,Z0(e)));break;case JG.Auto:default:r.push(t)}}else r.push(t)})),r.length){const e=r.length*t,o=i/e;r.forEach((e=>{n[e]=Math.max(XG.AutoMinPivot,o)}))}return n}),[m,c,p,l.x,h,u,d,f,g]),v=_e.useMemo((()=>{if(m){const e=c.reduce(((e,t,n)=>e+y[n]),0);return e/c.length}return y[0]}),[m,y,c]),b=parseFloat((t/i.size.x).toFixed(12)),x=_e.useCallback((e=>(m&&void 0!==e?y[i.getMeasureInfoIndexFromCellIndex(e,!0)]:v)-b),[m,y,i,v,b]),w=l.x*v;return{rightGridFullWidth:w,rightGridWidth:Math.min(w,h),getRightGridColumnWidth:x}}const p1=`scrollable-container--${hX.TopGrid}`,m1=`scrollable-container--${hX.LeftGrid}`,g1=`scrollable-container--${hX.DataGrid}`,y1=e=>e&&e instanceof HTMLDivElement?{width:e.offsetWidth-e.clientWidth,height:e.offsetHeight-e.clientHeight}:{width:0,height:0},v1=(e,t)=>e>t?pX.Forward:e<t?pX.Backward:pX.None,b1=({gridRefs:{topGridRef:e,leftGridRef:t,dataGridRef:n},getWrapperElements:r,updateViewService:i,trackScrollDirection:o,interactions:a})=>{const{direction:s}=bZ();_e.useEffect((()=>{const{headerGridWrapperElement:l,topGridWrapperElement:c,leftGridWrapperElement:u,dataGridWrapperElement:d}=r(),f=e=>{const t=e.target;l.scrollLeft=t.scrollLeft,o(e),i?.(e)},h=e=>{const t=e.target;l.scrollTop=t.scrollTop,o(e),i?.(e)},p=r=>{const a=r.target,l=((e,t)=>{const{scrollWidth:n,clientWidth:r,scrollLeft:i}=e,o=n-r;if("rtl"===t){if(i>o)return o;if(i<0)return Math.abs(i)}return i})(a,s);n.current?.scrollTo({scrollLeft:l,scrollTop:a.scrollTop}),c.scrollLeft=l,e.current?.forEach((e=>{e?.scrollTo(l)})),u.scrollTop=d.scrollTop,t.current?.forEach((e=>{e?.scrollTo(a.scrollTop)})),o(r),i?.(r)};return u.addEventListener("scroll",f),c.addEventListener("scroll",h),d.addEventListener("scroll",p),a.scroll||setTimeout((()=>{u.removeEventListener("scroll",f),c.removeEventListener("scroll",h),d.removeEventListener("scroll",p)}),0),()=>{u.removeEventListener("scroll",f),c.removeEventListener("scroll",h),d.removeEventListener("scroll",p)}}),[o,i,a,e,t,n,r,s])},x1=()=>{const{interactions:e}=SZ(),t=_e.useRef(null),n=_e.useRef(null),r=_e.useRef(null),i=_e.useRef(null),o=_e.useRef([]),a=_e.useRef([]),s=_e.useRef(null),{scrollbarsDimensions:{verticalScrollbarWidth:l,horizontalScrollbarHeight:c},resetHorizontalScrollbarHeight:u}=(({topGridWrapperRef:e,leftGridWrapperRef:t,dataGridWrapperRef:n})=>{const[r,i]=_e.useState(0),[o,a]=_e.useState(0);return _e.useLayoutEffect((()=>{if(e.current||n.current){const t=Math.max(y1(e.current).width,y1(n.current).width);r!==t&&i(t)}})),_e.useLayoutEffect((()=>{if(t.current||n.current){const e=Math.max(y1(t.current).height,y1(n.current).height);o!==e&&a(e)}})),{scrollbarsDimensions:{verticalScrollbarWidth:r,horizontalScrollbarHeight:o},resetHorizontalScrollbarHeight:()=>{a(0)}}})({topGridWrapperRef:n,leftGridWrapperRef:r,dataGridWrapperRef:i});(({gridSectionsWrapperRefs:{headerGridWrapperRef:e,topGridWrapperRef:t,leftGridWrapperRef:n,dataGridWrapperRef:r},gridRefs:{topGridRef:i,leftGridRef:o,dataGridRef:a}})=>{const{pageInfo:s}=bZ(),{downloadService:l,viewService:c,layoutService:u}=EZ(),d=_e.useCallback((()=>{const i={left:0,top:0};e.current?.scrollTo(i),t.current?.scrollTo(i),n.current?.scrollTo(i),r.current?.scrollTo(i)}),[e,t,n,r]);_e.useLayoutEffect((()=>{d()}),[s.page,d]),_e.useLayoutEffect((()=>{u.triggerdByExpandOrCollapse||d()}),[u,d]),_e.useLayoutEffect((()=>{if(u.triggerdByExpandOrCollapse){const e=r.current?.scrollLeft??0,t=r.current?.scrollTop??0;o.current?.forEach((e=>{e?.scrollTo(t)})),i.current?.forEach((t=>{t?.scrollTo(e)})),a.current?.scrollTo({scrollTop:t,scrollLeft:e})}}),[u,r,a,o,i]),_e.useLayoutEffect((()=>{(l.isDownloadedAsPDForImage||u.isSnapshot)&&r.current&&n.current&&t.current&&(r.current.scrollTop=c.scrollTop,r.current.scrollLeft=c.scrollLeft,n.current.scrollLeft=c.leftGridScrollLeft,t.current.scrollTop=c.topGridScrollTop)}),[c,l,u,r,n,t])})({gridSectionsWrapperRefs:{headerGridWrapperRef:t,topGridWrapperRef:n,leftGridWrapperRef:r,dataGridWrapperRef:i},gridRefs:{topGridRef:o,leftGridRef:a,dataGridRef:s}});const{trackScrollDirection:d,scrollDirectionRefs:{verticalScrollDirection:f,horizontalScrollDirection:h}}=(()=>{const e=_e.useRef(pX.None),t=_e.useRef(pX.None),n=_e.useRef({prevScrollTop:0,prevScrollLeft:0}),r=_e.useCallback((r=>{if(r instanceof WheelEvent&&(e.current=v1(r.deltaY,0),t.current=v1(r.deltaX,0)),r instanceof Event&&!(r instanceof WheelEvent)){const i=r.target;e.current=v1(i.scrollTop,n.current.prevScrollTop),n.current.prevScrollTop=i.scrollTop,t.current=v1(i.scrollLeft,n.current.prevScrollLeft),n.current.prevScrollLeft=i.scrollLeft}}),[e,t,n]);return{trackScrollDirection:r,scrollDirectionRefs:{verticalScrollDirection:e,horizontalScrollDirection:t}}})(),p=(()=>{const{viewService:e}=EZ();return _e.useCallback((t=>{const n=t.target,r=t.currentTarget,i=n.dataset.key;i===m1&&(e.leftGridScrollLeft=r.scrollLeft),i===g1&&(e.scrollLeft=r.scrollLeft),i===p1&&(e.topGridScrollTop=r.scrollTop),i!==m1&&i!==g1||(e.scrollTop=r.scrollTop)}),[e])})(),m={gridRefs:{topGridRef:o,leftGridRef:a,dataGridRef:s},getWrapperElements:_e.useCallback((()=>({headerGridWrapperElement:t.current,topGridWrapperElement:n.current,leftGridWrapperElement:r.current,dataGridWrapperElement:i.current})),[t,n,r,i]),updateViewService:p,trackScrollDirection:d,interactions:e};return(({gridRefs:{topGridRef:e,leftGridRef:t,dataGridRef:n},getWrapperElements:r,updateViewService:i,trackScrollDirection:o,interactions:a})=>{_e.useEffect((()=>{const{headerGridWrapperElement:i,topGridWrapperElement:s,leftGridWrapperElement:l,dataGridWrapperElement:c}=r(),u=e=>{e.preventDefault(),i.scrollLeft+=e.deltaX,i.scrollTop+=e.deltaY,l.scrollLeft=i.scrollLeft,s.scrollTop=i.scrollTop,o(e)},d=e=>{e.preventDefault(),l.scrollTop+=e.deltaY,t.current?.forEach((e=>{e?.scrollTo(l.scrollTop)})),i.scrollLeft+=e.deltaX,l.scrollLeft=i.scrollLeft,c.scrollTop=l.scrollTop,n.current?.scrollTo({scrollTop:l.scrollTop}),o(e)},f=t=>{t.preventDefault(),s.scrollLeft+=t.deltaX,e.current?.forEach((e=>{e?.scrollTo(s.scrollLeft)})),i.scrollTop+=t.deltaY,s.scrollTop=i.scrollTop,c.scrollLeft=s.scrollLeft,n.current?.scrollTo({scrollLeft:s.scrollLeft}),o(t)},h=r=>{r.preventDefault(),c.scrollLeft+=r.deltaX,c.scrollTop+=r.deltaY,n.current?.scrollTo({scrollLeft:c.scrollLeft,scrollTop:c.scrollTop}),s.scrollLeft=c.scrollLeft,e.current?.forEach((e=>{e?.scrollTo(c.scrollLeft)})),l.scrollTop=c.scrollTop,t.current?.forEach((e=>{e?.scrollTo(c.scrollTop)})),o(r)};return i.addEventListener("wheel",u),l.addEventListener("wheel",d),s.addEventListener("wheel",f),c.addEventListener("wheel",h),a.scroll||setTimeout((()=>{i.removeEventListener("wheel",u),l.removeEventListener("wheel",d),s.removeEventListener("wheel",f),c.removeEventListener("wheel",h)}),0),()=>{i.removeEventListener("wheel",u),l.removeEventListener("wheel",d),s.removeEventListener("wheel",f),c.removeEventListener("wheel",h)}}),[o,i,a,e,t,n,r])})(m),b1(m),{gridSectionsWrapperRefs:{headerGridWrapperRef:t,topGridWrapperRef:n,leftGridWrapperRef:r,dataGridWrapperRef:i},gridRefs:{topGridRef:o,leftGridRef:a,dataGridRef:s},scrollDirectionRefs:{verticalScrollDirection:f,horizontalScrollDirection:h},scrollbarsDimensions:{verticalScrollbarWidth:l,horizontalScrollbarHeight:c,resetHorizontalScrollbarHeight:u}}},w1=()=>{const{layoutService:e}=EZ(),{rect:t,pageInfo:n}=bZ();return _e.useMemo((()=>{let{height:r}=t;return e.hasLimitedData&&(r-=22),n.shouldShowPagination&&(r-=41),{...t,height:r}}),[t,e,n.shouldShowPagination])},S1=({children:e,style:t})=>Yi.jsx("div",{"data-testid":"fullSize",style:t,children:e}),C1=({children:e,style:t})=>{const{direction:n}=bZ();return Yi.jsx("div",{"data-section-id":"GRID",style:{direction:n,display:"grid",...t},children:e})},k1=e=>e&&`scrollable-container--${e}`,E1=({children:e,style:t,origin:n},r)=>{const{interactions:i}=SZ(),o=i.scroll?t:{overflow:"hidden"};return Yi.jsx("div",{"data-testid":"scrollable","data-key":k1(n),style:o,ref:r,children:e})};var M1=Re.forwardRef(E1);const _1=({children:e,style:t})=>{const{direction:n}=bZ();return Yi.jsx("div",{"data-testid":"sticky",style:{position:"sticky",top:0,["rtl"===n?"right":"left"]:0,...t},children:e})};function R1(){return R1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},R1.apply(null,arguments)}function I1(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function D1(e,t){return D1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},D1(e,t)}function P1(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,D1(e,t)}var A1=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function O1(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(r=e[n],i=t[n],!(r===i||A1(r)&&A1(i)))return!1;var r,i;return!0}function L1(e,t){var n;void 0===t&&(t=O1);var r,i=[],o=!1;return function(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];return o&&n===this&&t(a,i)||(r=e.apply(this,a),o=!0,n=this,i=a),r}}function T1(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}var q1="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function N1(e){cancelAnimationFrame(e.id)}function j1(e,t){var n=q1();var r={id:requestAnimationFrame((function i(){q1()-n>=t?e.call(null):r.id=requestAnimationFrame(i)}))};return r}var z1=-1;function F1(e){if(void 0===e&&(e=!1),-1===z1||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),z1=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return z1}var W1=null;function $1(e){if(void 0===e&&(e=!1),null===W1||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),i=r.style;return i.width="100px",i.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?W1="positive-descending":(t.scrollLeft=1,W1=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),W1}return W1}var B1=function(e){var t=e.columnIndex;return e.data,e.rowIndex+":"+t};function V1(e){var t,n=e.getColumnOffset,r=e.getColumnStartIndexForOffset,i=e.getColumnStopIndexForStartIndex,o=e.getColumnWidth,a=e.getEstimatedTotalHeight,s=e.getEstimatedTotalWidth,l=e.getOffsetForColumnAndAlignment,c=e.getOffsetForRowAndAlignment,u=e.getRowHeight,d=e.getRowOffset,f=e.getRowStartIndexForOffset,h=e.getRowStopIndexForStartIndex,p=e.initInstanceProps,m=e.shouldResetStyleCacheOnItemSizeChange,g=e.validateProps;return t=function(e){function t(t){var r;return(r=e.call(this,t)||this)._instanceProps=p(r.props,I1(r)),r._resetIsScrollingTimeoutId=null,r._outerRef=void 0,r.state={instance:I1(r),isScrolling:!1,horizontalScrollDirection:"forward",scrollLeft:"number"==typeof r.props.initialScrollLeft?r.props.initialScrollLeft:0,scrollTop:"number"==typeof r.props.initialScrollTop?r.props.initialScrollTop:0,scrollUpdateWasRequested:!1,verticalScrollDirection:"forward"},r._callOnItemsRendered=void 0,r._callOnItemsRendered=L1((function(e,t,n,i,o,a,s,l){return r.props.onItemsRendered({overscanColumnStartIndex:e,overscanColumnStopIndex:t,overscanRowStartIndex:n,overscanRowStopIndex:i,visibleColumnStartIndex:o,visibleColumnStopIndex:a,visibleRowStartIndex:s,visibleRowStopIndex:l})})),r._callOnScroll=void 0,r._callOnScroll=L1((function(e,t,n,i,o){return r.props.onScroll({horizontalScrollDirection:n,scrollLeft:e,scrollTop:t,verticalScrollDirection:i,scrollUpdateWasRequested:o})})),r._getItemStyle=void 0,r._getItemStyle=function(e,t){var i,a=r.props,s=a.columnWidth,l=a.direction,c=a.rowHeight,f=r._getItemStyleCache(m&&s,m&&l,m&&c),h=e+":"+t;if(f.hasOwnProperty(h))i=f[h];else{var p=n(r.props,t,r._instanceProps),g="rtl"===l;f[h]=i={position:"absolute",left:g?void 0:p,right:g?p:void 0,top:d(r.props,e,r._instanceProps),height:u(r.props,e,r._instanceProps),width:o(r.props,t,r._instanceProps)}}return i},r._getItemStyleCache=void 0,r._getItemStyleCache=L1((function(e,t,n){return{}})),r._onScroll=function(e){var t=e.currentTarget,n=t.clientHeight,i=t.clientWidth,o=t.scrollLeft,a=t.scrollTop,s=t.scrollHeight,l=t.scrollWidth;r.setState((function(e){if(e.scrollLeft===o&&e.scrollTop===a)return null;var t=r.props.direction,c=o;if("rtl"===t)switch($1()){case"negative":c=-o;break;case"positive-descending":c=l-i-o}c=Math.max(0,Math.min(c,l-i));var u=Math.max(0,Math.min(a,s-n));return{isScrolling:!0,horizontalScrollDirection:e.scrollLeft<o?"forward":"backward",scrollLeft:c,scrollTop:u,verticalScrollDirection:e.scrollTop<a?"forward":"backward",scrollUpdateWasRequested:!1}}),r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){null!==r._resetIsScrollingTimeoutId&&N1(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=j1(r._resetIsScrolling,150)},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},(function(){r._getItemStyleCache(-1)}))},r}P1(t,e),t.getDerivedStateFromProps=function(e,t){return H1(e,t),g(e),null};var y=t.prototype;return y.scrollTo=function(e){var t=e.scrollLeft,n=e.scrollTop;void 0!==t&&(t=Math.max(0,t)),void 0!==n&&(n=Math.max(0,n)),this.setState((function(e){return void 0===t&&(t=e.scrollLeft),void 0===n&&(n=e.scrollTop),e.scrollLeft===t&&e.scrollTop===n?null:{horizontalScrollDirection:e.scrollLeft<t?"forward":"backward",scrollLeft:t,scrollTop:n,scrollUpdateWasRequested:!0,verticalScrollDirection:e.scrollTop<n?"forward":"backward"}}),this._resetIsScrollingDebounced)},y.scrollToItem=function(e){var t=e.align,n=void 0===t?"auto":t,r=e.columnIndex,i=e.rowIndex,o=this.props,u=o.columnCount,d=o.height,f=o.rowCount,h=o.width,p=this.state,m=p.scrollLeft,g=p.scrollTop,y=F1();void 0!==r&&(r=Math.max(0,Math.min(r,u-1))),void 0!==i&&(i=Math.max(0,Math.min(i,f-1)));var v=a(this.props,this._instanceProps),b=s(this.props,this._instanceProps)>h?y:0,x=v>d?y:0;this.scrollTo({scrollLeft:void 0!==r?l(this.props,r,n,m,this._instanceProps,x):m,scrollTop:void 0!==i?c(this.props,i,n,g,this._instanceProps,b):g})},y.componentDidMount=function(){var e=this.props,t=e.initialScrollLeft,n=e.initialScrollTop;if(null!=this._outerRef){var r=this._outerRef;"number"==typeof t&&(r.scrollLeft=t),"number"==typeof n&&(r.scrollTop=n)}this._callPropsCallbacks()},y.componentDidUpdate=function(){var e=this.props.direction,t=this.state,n=t.scrollLeft,r=t.scrollTop;if(t.scrollUpdateWasRequested&&null!=this._outerRef){var i=this._outerRef;if("rtl"===e)switch($1()){case"negative":i.scrollLeft=-n;break;case"positive-ascending":i.scrollLeft=n;break;default:var o=i.clientWidth,a=i.scrollWidth;i.scrollLeft=a-o-n}else i.scrollLeft=Math.max(0,n);i.scrollTop=Math.max(0,r)}this._callPropsCallbacks()},y.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&N1(this._resetIsScrollingTimeoutId)},y.render=function(){var e=this.props,t=e.children,n=e.className,r=e.columnCount,i=e.direction,o=e.height,l=e.innerRef,c=e.innerElementType,u=e.innerTagName,d=e.itemData,f=e.itemKey,h=void 0===f?B1:f,p=e.outerElementType,m=e.outerTagName,g=e.rowCount,y=e.style,v=e.useIsScrolling,b=e.width,x=this.state.isScrolling,w=this._getHorizontalRangeToRender(),S=w[0],C=w[1],k=this._getVerticalRangeToRender(),E=k[0],M=k[1],_=[];if(r>0&&g)for(var R=E;R<=M;R++)for(var I=S;I<=C;I++)_.push(_e.createElement(t,{columnIndex:I,data:d,isScrolling:v?x:void 0,key:h({columnIndex:I,data:d,rowIndex:R}),rowIndex:R,style:this._getItemStyle(R,I)}));var D=a(this.props,this._instanceProps),P=s(this.props,this._instanceProps);return _e.createElement(p||m||"div",{className:n,onScroll:this._onScroll,ref:this._outerRefSetter,style:R1({position:"relative",height:o,width:b,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:i},y)},_e.createElement(c||u||"div",{children:_,ref:l,style:{height:D,pointerEvents:x?"none":void 0,width:P}}))},y._callPropsCallbacks=function(){var e=this.props,t=e.columnCount,n=e.onItemsRendered,r=e.onScroll,i=e.rowCount;if("function"==typeof n&&t>0&&i>0){var o=this._getHorizontalRangeToRender(),a=o[0],s=o[1],l=o[2],c=o[3],u=this._getVerticalRangeToRender(),d=u[0],f=u[1],h=u[2],p=u[3];this._callOnItemsRendered(a,s,d,f,l,c,h,p)}if("function"==typeof r){var m=this.state,g=m.horizontalScrollDirection,y=m.scrollLeft,v=m.scrollTop,b=m.scrollUpdateWasRequested,x=m.verticalScrollDirection;this._callOnScroll(y,v,g,x,b)}},y._getHorizontalRangeToRender=function(){var e=this.props,t=e.columnCount,n=e.overscanColumnCount,o=e.overscanColumnsCount,a=e.overscanCount,s=e.rowCount,l=this.state,c=l.horizontalScrollDirection,u=l.isScrolling,d=l.scrollLeft,f=n||o||a||1;if(0===t||0===s)return[0,0,0,0];var h=r(this.props,d,this._instanceProps),p=i(this.props,h,d,this._instanceProps),m=u&&"backward"!==c?1:Math.max(1,f),g=u&&"forward"!==c?1:Math.max(1,f);return[Math.max(0,h-m),Math.max(0,Math.min(t-1,p+g)),h,p]},y._getVerticalRangeToRender=function(){var e=this.props,t=e.columnCount,n=e.overscanCount,r=e.overscanRowCount,i=e.overscanRowsCount,o=e.rowCount,a=this.state,s=a.isScrolling,l=a.verticalScrollDirection,c=a.scrollTop,u=r||i||n||1;if(0===t||0===o)return[0,0,0,0];var d=f(this.props,c,this._instanceProps),p=h(this.props,d,c,this._instanceProps),m=s&&"backward"!==l?1:Math.max(1,u),g=s&&"forward"!==l?1:Math.max(1,u);return[Math.max(0,d-m),Math.max(0,Math.min(o-1,p+g)),d,p]},t}(_e.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,useIsScrolling:!1},t}var H1=function(e,t){e.children,e.direction,e.height,e.innerTagName,e.outerTagName,e.overscanColumnsCount,e.overscanCount,e.overscanRowsCount,e.width,t.instance},U1=function(e,t){var n=e.rowCount,r=t.rowMetadataMap,i=t.estimatedRowHeight,o=t.lastMeasuredRowIndex,a=0;if(o>=n&&(o=n-1),o>=0){var s=r[o];a=s.offset+s.size}return a+(n-o-1)*i},G1=function(e,t){var n=e.columnCount,r=t.columnMetadataMap,i=t.estimatedColumnWidth,o=t.lastMeasuredColumnIndex,a=0;if(o>=n&&(o=n-1),o>=0){var s=r[o];a=s.offset+s.size}return a+(n-o-1)*i},Y1=function(e,t,n,r){var i,o,a;if("column"===e?(i=r.columnMetadataMap,o=t.columnWidth,a=r.lastMeasuredColumnIndex):(i=r.rowMetadataMap,o=t.rowHeight,a=r.lastMeasuredRowIndex),n>a){var s=0;if(a>=0){var l=i[a];s=l.offset+l.size}for(var c=a+1;c<=n;c++){var u=o(c);i[c]={offset:s,size:u},s+=u}"column"===e?r.lastMeasuredColumnIndex=n:r.lastMeasuredRowIndex=n}return i[n]},K1=function(e,t,n,r){var i,o;return"column"===e?(i=n.columnMetadataMap,o=n.lastMeasuredColumnIndex):(i=n.rowMetadataMap,o=n.lastMeasuredRowIndex),(o>0?i[o].offset:0)>=r?X1(e,t,n,o,0,r):J1(e,t,n,Math.max(0,o),r)},X1=function(e,t,n,r,i,o){for(;i<=r;){var a=i+Math.floor((r-i)/2),s=Y1(e,t,a,n).offset;if(s===o)return a;s<o?i=a+1:s>o&&(r=a-1)}return i>0?i-1:0},J1=function(e,t,n,r,i){for(var o="column"===e?t.columnCount:t.rowCount,a=1;r<o&&Y1(e,t,r,n).offset<i;)r+=a,a*=2;return X1(e,t,n,Math.min(r,o-1),Math.floor(r/2),i)},Q1=function(e,t,n,r,i,o,a){var s="column"===e?t.width:t.height,l=Y1(e,t,n,o),c="column"===e?G1(t,o):U1(t,o),u=Math.max(0,Math.min(c-s,l.offset)),d=Math.max(0,l.offset-s+a+l.size);switch("smart"===r&&(r=i>=d-s&&i<=u+s?"auto":"center"),r){case"start":return u;case"end":return d;case"center":return Math.round(d+(u-d)/2);default:return i>=d&&i<=u?i:d>u||i<d?d:u}},Z1=V1({getColumnOffset:function(e,t,n){return Y1("column",e,t,n).offset},getColumnStartIndexForOffset:function(e,t,n){return K1("column",e,n,t)},getColumnStopIndexForStartIndex:function(e,t,n,r){for(var i=e.columnCount,o=e.width,a=Y1("column",e,t,r),s=n+o,l=a.offset+a.size,c=t;c<i-1&&l<s;)c++,l+=Y1("column",e,c,r).size;return c},getColumnWidth:function(e,t,n){return n.columnMetadataMap[t].size},getEstimatedTotalHeight:U1,getEstimatedTotalWidth:G1,getOffsetForColumnAndAlignment:function(e,t,n,r,i,o){return Q1("column",e,t,n,r,i,o)},getOffsetForRowAndAlignment:function(e,t,n,r,i,o){return Q1("row",e,t,n,r,i,o)},getRowOffset:function(e,t,n){return Y1("row",e,t,n).offset},getRowHeight:function(e,t,n){return n.rowMetadataMap[t].size},getRowStartIndexForOffset:function(e,t,n){return K1("row",e,n,t)},getRowStopIndexForStartIndex:function(e,t,n,r){for(var i=e.rowCount,o=e.height,a=Y1("row",e,t,r),s=n+o,l=a.offset+a.size,c=t;c<i-1&&l<s;)c++,l+=Y1("row",e,c,r).size;return c},initInstanceProps:function(e,t){var n=e,r={columnMetadataMap:{},estimatedColumnWidth:n.estimatedColumnWidth||50,estimatedRowHeight:n.estimatedRowHeight||50,lastMeasuredColumnIndex:-1,lastMeasuredRowIndex:-1,rowMetadataMap:{}};return t.resetAfterColumnIndex=function(e,n){void 0===n&&(n=!0),t.resetAfterIndices({columnIndex:e,shouldForceUpdate:n})},t.resetAfterRowIndex=function(e,n){void 0===n&&(n=!0),t.resetAfterIndices({rowIndex:e,shouldForceUpdate:n})},t.resetAfterIndices=function(e){var n=e.columnIndex,i=e.rowIndex,o=e.shouldForceUpdate,a=void 0===o||o;"number"==typeof n&&(r.lastMeasuredColumnIndex=Math.min(r.lastMeasuredColumnIndex,n-1)),"number"==typeof i&&(r.lastMeasuredRowIndex=Math.min(r.lastMeasuredRowIndex,i-1)),t._getItemStyleCache(-1),a&&t.forceUpdate()},r},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.columnWidth,e.rowHeight}}),e2=function(e,t){return e};function t2(e){var t,n=e.getItemOffset,r=e.getEstimatedTotalSize,i=e.getItemSize,o=e.getOffsetForIndexAndAlignment,a=e.getStartIndexForOffset,s=e.getStopIndexForStartIndex,l=e.initInstanceProps,c=e.shouldResetStyleCacheOnItemSizeChange,u=e.validateProps;return t=function(e){function t(t){var r;return(r=e.call(this,t)||this)._instanceProps=l(r.props,I1(r)),r._outerRef=void 0,r._resetIsScrollingTimeoutId=null,r.state={instance:I1(r),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof r.props.initialScrollOffset?r.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},r._callOnItemsRendered=void 0,r._callOnItemsRendered=L1((function(e,t,n,i){return r.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:i})})),r._callOnScroll=void 0,r._callOnScroll=L1((function(e,t,n){return r.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n})})),r._getItemStyle=void 0,r._getItemStyle=function(e){var t,o=r.props,a=o.direction,s=o.itemSize,l=o.layout,u=r._getItemStyleCache(c&&s,c&&l,c&&a);if(u.hasOwnProperty(e))t=u[e];else{var d=n(r.props,e,r._instanceProps),f=i(r.props,e,r._instanceProps),h="horizontal"===a||"horizontal"===l,p="rtl"===a,m=h?d:0;u[e]=t={position:"absolute",left:p?void 0:m,right:p?m:void 0,top:h?0:d,height:h?"100%":f,width:h?f:"100%"}}return t},r._getItemStyleCache=void 0,r._getItemStyleCache=L1((function(e,t,n){return{}})),r._onScrollHorizontal=function(e){var t=e.currentTarget,n=t.clientWidth,i=t.scrollLeft,o=t.scrollWidth;r.setState((function(e){if(e.scrollOffset===i)return null;var t=r.props.direction,a=i;if("rtl"===t)switch($1()){case"negative":a=-i;break;case"positive-descending":a=o-n-i}return a=Math.max(0,Math.min(a,o-n)),{isScrolling:!0,scrollDirection:e.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!1}}),r._resetIsScrollingDebounced)},r._onScrollVertical=function(e){var t=e.currentTarget,n=t.clientHeight,i=t.scrollHeight,o=t.scrollTop;r.setState((function(e){if(e.scrollOffset===o)return null;var t=Math.max(0,Math.min(o,i-n));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}}),r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){null!==r._resetIsScrollingTimeoutId&&N1(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=j1(r._resetIsScrolling,150)},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},(function(){r._getItemStyleCache(-1,null)}))},r}P1(t,e),t.getDerivedStateFromProps=function(e,t){return n2(e,t),u(e),null};var d=t.prototype;return d.scrollTo=function(e){e=Math.max(0,e),this.setState((function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}}),this._resetIsScrollingDebounced)},d.scrollToItem=function(e,t){void 0===t&&(t="auto");var n=this.props,r=n.itemCount,i=n.layout,a=this.state.scrollOffset;e=Math.max(0,Math.min(e,r-1));var s=0;if(this._outerRef){var l=this._outerRef;s="vertical"===i?l.scrollWidth>l.clientWidth?F1():0:l.scrollHeight>l.clientHeight?F1():0}this.scrollTo(o(this.props,e,t,a,this._instanceProps,s))},d.componentDidMount=function(){var e=this.props,t=e.direction,n=e.initialScrollOffset,r=e.layout;if("number"==typeof n&&null!=this._outerRef){var i=this._outerRef;"horizontal"===t||"horizontal"===r?i.scrollLeft=n:i.scrollTop=n}this._callPropsCallbacks()},d.componentDidUpdate=function(){var e=this.props,t=e.direction,n=e.layout,r=this.state,i=r.scrollOffset;if(r.scrollUpdateWasRequested&&null!=this._outerRef){var o=this._outerRef;if("horizontal"===t||"horizontal"===n)if("rtl"===t)switch($1()){case"negative":o.scrollLeft=-i;break;case"positive-ascending":o.scrollLeft=i;break;default:var a=o.clientWidth,s=o.scrollWidth;o.scrollLeft=s-a-i}else o.scrollLeft=i;else o.scrollTop=i}this._callPropsCallbacks()},d.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&N1(this._resetIsScrollingTimeoutId)},d.render=function(){var e=this.props,t=e.children,n=e.className,i=e.direction,o=e.height,a=e.innerRef,s=e.innerElementType,l=e.innerTagName,c=e.itemCount,u=e.itemData,d=e.itemKey,f=void 0===d?e2:d,h=e.layout,p=e.outerElementType,m=e.outerTagName,g=e.style,y=e.useIsScrolling,v=e.width,b=this.state.isScrolling,x="horizontal"===i||"horizontal"===h,w=x?this._onScrollHorizontal:this._onScrollVertical,S=this._getRangeToRender(),C=S[0],k=S[1],E=[];if(c>0)for(var M=C;M<=k;M++)E.push(_e.createElement(t,{data:u,key:f(M,u),index:M,isScrolling:y?b:void 0,style:this._getItemStyle(M)}));var _=r(this.props,this._instanceProps);return _e.createElement(p||m||"div",{className:n,onScroll:w,ref:this._outerRefSetter,style:R1({position:"relative",height:o,width:v,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:i},g)},_e.createElement(s||l||"div",{children:E,ref:a,style:{height:x?"100%":_,pointerEvents:b?"none":void 0,width:x?_:"100%"}}))},d._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],i=e[3];this._callOnItemsRendered(t,n,r,i)}if("function"==typeof this.props.onScroll){var o=this.state,a=o.scrollDirection,s=o.scrollOffset,l=o.scrollUpdateWasRequested;this._callOnScroll(a,s,l)}},d._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,i=r.isScrolling,o=r.scrollDirection,l=r.scrollOffset;if(0===t)return[0,0,0,0];var c=a(this.props,l,this._instanceProps),u=s(this.props,c,l,this._instanceProps),d=i&&"backward"!==o?1:Math.max(1,n),f=i&&"forward"!==o?1:Math.max(1,n);return[Math.max(0,c-d),Math.max(0,Math.min(t-1,u+f)),c,u]},t}(_e.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var n2=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},r2=function(e,t,n){var r=e.itemSize,i=n.itemMetadataMap,o=n.lastMeasuredIndex;if(t>o){var a=0;if(o>=0){var s=i[o];a=s.offset+s.size}for(var l=o+1;l<=t;l++){var c=r(l);i[l]={offset:a,size:c},a+=c}n.lastMeasuredIndex=t}return i[t]},i2=function(e,t,n,r,i){for(;r<=n;){var o=r+Math.floor((n-r)/2),a=r2(e,o,t).offset;if(a===i)return o;a<i?r=o+1:a>i&&(n=o-1)}return r>0?r-1:0},o2=function(e,t,n,r){for(var i=e.itemCount,o=1;n<i&&r2(e,n,t).offset<r;)n+=o,o*=2;return i2(e,t,Math.min(n,i-1),Math.floor(n/2),r)},a2=function(e,t){var n=e.itemCount,r=t.itemMetadataMap,i=t.estimatedItemSize,o=t.lastMeasuredIndex,a=0;if(o>=n&&(o=n-1),o>=0){var s=r[o];a=s.offset+s.size}return a+(n-o-1)*i},s2=t2({getItemOffset:function(e,t,n){return r2(e,t,n).offset},getItemSize:function(e,t,n){return n.itemMetadataMap[t].size},getEstimatedTotalSize:a2,getOffsetForIndexAndAlignment:function(e,t,n,r,i,o){var a=e.direction,s=e.height,l=e.layout,c=e.width,u="horizontal"===a||"horizontal"===l?c:s,d=r2(e,t,i),f=a2(e,i),h=Math.max(0,Math.min(f-u,d.offset)),p=Math.max(0,d.offset-u+d.size+o);switch("smart"===n&&(n=r>=p-u&&r<=h+u?"auto":"center"),n){case"start":return h;case"end":return p;case"center":return Math.round(p+(h-p)/2);default:return r>=p&&r<=h?r:r<p?p:h}},getStartIndexForOffset:function(e,t,n){return function(e,t,n){var r=t.itemMetadataMap,i=t.lastMeasuredIndex;return(i>0?r[i].offset:0)>=n?i2(e,t,i,0,n):o2(e,t,Math.max(0,i),n)}(e,n,t)},getStopIndexForStartIndex:function(e,t,n,r){for(var i=e.direction,o=e.height,a=e.itemCount,s=e.layout,l=e.width,c="horizontal"===i||"horizontal"===s?l:o,u=r2(e,t,r),d=n+c,f=u.offset+u.size,h=t;h<a-1&&f<d;)h++,f+=r2(e,h,r).size;return h},initInstanceProps:function(e,t){var n={itemMetadataMap:{},estimatedItemSize:e.estimatedItemSize||50,lastMeasuredIndex:-1};return t.resetAfterIndex=function(e,r){void 0===r&&(r=!0),n.lastMeasuredIndex=Math.min(n.lastMeasuredIndex,e-1),t._getItemStyleCache(-1),r&&t.forceUpdate()},n},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.itemSize}});function l2(e,t){for(var n in e)if(!(n in t))return!0;for(var r in t)if(e[r]!==t[r])return!0;return!1}var c2=["style"],u2=["style"];function d2(e,t){var n=e.style,r=T1(e,c2),i=t.style,o=T1(t,u2);return!l2(n,i)&&!l2(r,o)}const f2=10,h2=(e,t)=>e.current===pX.Backward?t:0,p2=(e,t,n,r)=>{for(let i=n;i<n+r;i++){const n=e.at(i);if(void 0===n||void 0===n.at(t))return!0}return!1},m2=(e,t)=>e.qLeft+e.qWidth===t.qLeft&&e.qTop===t.qTop&&e.qHeight===t.qHeight,g2=({pageInfo:e,measureData:t,pageTop:n,qHeight:r,startLeft:i,endLeft:o})=>{const a=[],s=e.page*e.rowsPerPage;for(let e=i;e<o;e++)if(p2(t,e,n,r)){const t=a[a.length-1],i={qLeft:e,qTop:n+s,qWidth:1,qHeight:r};void 0!==t&&m2(t,i)?t.qWidth+=i.qWidth:a.push(i)}return a},y2=({pageInfo:e,measureData:t,scrollDirection:n,viewService:r,minBufferStartLeft:i,minBufferEndLeft:o,columnEndIndex:a})=>{const{gridRowStartIndex:s,gridHeight:l}=r,c=n.current===pX.Backward?Math.max(0,i-25):o,u=Math.min(c+25,a);return g2({pageInfo:e,measureData:t,startLeft:c,endLeft:u,pageTop:s,qHeight:l})},v2=({pageInfo:e,measureData:t,scrollDirection:n,layoutService:r,viewService:i})=>{const{startLeft:o,endLeft:a,pageTop:s,qHeight:l}=((e,t,n)=>{const{gridColumnStartIndex:r,gridRowStartIndex:i,gridWidth:o,gridHeight:a}=t,s=e.size.x,l=h2(n,f2),c=Math.max(r-l,0);return{startLeft:c,endLeft:c+Math.min(o+f2,s-c),pageTop:i,qHeight:a}})(r,i,n),c=g2({pageInfo:e,measureData:t,startLeft:o,endLeft:a,pageTop:s,qHeight:l});return c.length>0?[...c,...y2({pageInfo:e,measureData:t,scrollDirection:n,viewService:i,minBufferStartLeft:o,minBufferEndLeft:a,columnEndIndex:r.size.x})]:c},b2=(e,t,n,r)=>{const i=e[n];if(void 0===i)return!0;for(let e=t;e<t+r;e++){if(void 0===i[e])return!0}return!1},x2=(e,t)=>e.qTop+e.qHeight===t.qTop&&e.qLeft===t.qLeft&&e.qWidth===t.qWidth,w2=({startTop:e,endTop:t,qLeft:n,qWidth:r,measureData:i,pageInfo:o})=>{const a=[],s=o.page*o.rowsPerPage;for(let o=e;o<t;o++)if(b2(i,n,o,r)){const e=a.at(-1),t={qLeft:n,qTop:o+s,qWidth:r,qHeight:1};void 0!==e&&x2(e,t)?e.qHeight+=t.qHeight:a.push(t)}return a},S2=({pageInfo:e,measureData:t,scrollDirection:n,viewService:r})=>{const{startTop:i,endTop:o,qLeft:a,qWidth:s}=((e,t,n)=>{const{gridColumnStartIndex:r,gridRowStartIndex:i,gridWidth:o,gridHeight:a}=t,s=h2(n,f2),l=Math.max(i-s,0);return{startTop:l,endTop:l+Math.min(a+f2,e.rowsOnCurrentPage-l),qLeft:r,qWidth:o}})(e,r,n),l=w2({startTop:i,endTop:o,qLeft:a,qWidth:s,measureData:t,pageInfo:e});if(l.length>0){const r=n.current===pX.Backward?Math.max(0,i-25):o,c=Math.min(r+25,e.rowsOnCurrentPage),u=w2({startTop:r,endTop:c,qLeft:a,qWidth:s,measureData:t,pageInfo:e});return[...l,...u]}return l},C2=async(e,t,n,r,i,o,a,s)=>{const{gridColumnStartIndex:l,gridRowStartIndex:c,gridWidth:u,gridHeight:d}=i;let f=[],h=[];o.current!==pX.None&&(f=S2({pageInfo:r,measureData:n,scrollDirection:o,viewService:i})),a.current!==pX.None&&(h=v2({pageInfo:r,measureData:n,scrollDirection:a,layoutService:t,viewService:i})),o.current===pX.None&&a.current===pX.None&&(f=w2({measureData:n,pageInfo:r,qLeft:l,qWidth:u,startTop:c,endTop:c+d}));const p=e.fetchPages([...f,...h]);s.isDownloadedAsPDForImage&&s.waitForPromise(p)},k2=function(e){var t,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,o=0;return function(){t=this;for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];n=s;var c=Date.now()-o,u=function(){o=Date.now(),r=0,e.apply(t,n)};r||(c>=i?u():r=setTimeout(u,i-c))}}(C2,100),E2=mT(C2,75),M2=(e,t,n=!1)=>void 0!==e&&(e.isLeafNode||n&&e.isLeftColumn?e.mainAxisPageCoord===t:e.mainAxisPageCoord+e.leafCount-1===t),_2=({style:e,index:t,isLastRow:n,isLastColumn:r,showLastBorder:i,isLeftColumn:o,showTotalCellDivider:a})=>{const{direction:s}=bZ(),{styleService:{grid:{border:l,divider:c}}}=EZ();return Yi.jsx("div",{style:{...e,...YX,...QX(n,r,l,s,i),...eJ({bottomDivider:a&&o,rightDivider:a&&!o,borderColor:c})},"data-testid":"empty-cell","data-index":t})},R2=({children:e,verticalAlign:t,width:n,right:r,isLeftColumn:i})=>{const{layoutService:{isIndentModeEnabled:o}}=EZ(),a=i&&o;return Yi.jsx("div",{"data-key":"sticky-cell-container",style:{display:"flex",flexDirection:"row",width:n,maxWidth:"100%",maxHeight:"100%",position:"sticky",left:4,top:0,bottom:0,right:r,...!a&&{alignItems:t,alignSelf:t,overflow:"hidden"}},children:e})},I2=e=>{const{type:t,imageSize:n}=e;return t!==iX.Image||"fill"!==n&&"fitWidth"!==n?"fit-content":"100%"},D2=e=>"number"==typeof e&&!Number.isNaN(+e),P2=e=>"string"==typeof e&&e.length>0||"number"==typeof e?+e:NaN,A2=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 16 16",height:"16px",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M7.5 8.5H2v-1h5.5V2h1v5.5H14v1H8.5V14h-1z"})}),O2=_e.forwardRef(A2),L2=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M8 0c4.4 0 8 3.6 8 8s-3.6 8-8 8-8-3.6-8-8 3.6-8 8-8"})}),T2=_e.forwardRef(L2),q2=(e,t)=>Yi.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:[Yi.jsx("path",{d:"M3 9v6.5a.5.5 0 1 1-1 0V.5a.5.5 0 0 1 1 0V1q2.441.639 3.667.639c1.225 0 1.774-.995 3.87-1.196q1.972-.19 3.297.47A.3.3 0 0 1 14 1.18v7.344a.3.3 0 0 1-.417.277q-1.338-.565-3.045-.416c-1.98.172-2.083 1.107-3.871 1.253Q4.879 9.785 3 9"}),Yi.jsx("use",{fillRule:"evenodd"})]}),N2=_e.forwardRef(q2),j2=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M13.9 7.4c-1 1.3-.6 1.5-1.5 4.1-.5 1.8-1.2 2.9-1.7 3.6q-.45.6-.9.9H4.2c-1 0-1.6-.5-1.9-1-.2-.3-.3-.6-.3-1V4.2c0-.4.3-.7.7-.7s.7.3.7.7v3.6l.9-.1V1.6c0-.4.3-.7.7-.7s.7.3.7.7v5.1l1.1-.2V.7C6.7.3 7 0 7.4 0s.7.3.7.7v5.9l1.1.1V1.6c0-.4.3-.7.7-.7s.7.3.7.7v7.7s.1 0 .1-.2l.6-1.4c1.1-2.1 3.1-1.1 2.6-.3"})}),z2=_e.forwardRef(j2),F2=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M5 13h6v1.5c0 .3-.2.5-.5.5H10v.5c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5V15h-.5c-.3 0-.5-.2-.5-.5zm0-1c0-2-3-3-3-7 0-3 3-5 6-5s6 2 6 5c0 4-3 4-3 7H5m-.5-7c.3 0 .5-.2.5-.5s.2-.7.5-1 .6-.5 1-.5c.3 0 .5-.2.5-.5S6.8 2 6.5 2c-.6 0-1.2.3-1.7.8S4 3.9 4 4.5c0 .3.2.5.5.5"})}),W2=_e.forwardRef(F2),$2=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M8 0c4.4 0 8 3.6 8 8s-3.6 8-8 8-8-3.6-8-8 3.6-8 8-8m4.5 9c.25 0 .5-.3.5-.6v-.8c0-.3-.25-.6-.5-.6h-9c-.25 0-.5.3-.5.6v.7c0 .4.25.7.5.7z"})}),B2=_e.forwardRef($2),V2=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 16 16",height:"16px",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M2 7.5h12v1H2z"})}),H2=_e.forwardRef(V2),U2=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M9 7h7a7.004 7.004 0 0 0-7-7zm1-5.917A6.005 6.005 0 0 1 14.917 6H10zM14 9H7V2a7.002 7.002 0 0 0 0 14 7 7 0 0 0 7-7m-8 1h6.917A6.002 6.002 0 0 1 1 9a6 6 0 0 1 5-5.917z"})}),G2=_e.forwardRef(U2),Y2=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M9 9h3.5c.25 0 .5-.3.5-.6v-.8c0-.3-.25-.6-.5-.6H9V3.5c0-.25-.3-.5-.6-.5h-.7c-.4 0-.7.25-.7.5V7H3.5c-.25 0-.5.3-.5.6v.7c0 .4.25.7.5.7H7v3.5c0 .25.3.5.6.5h.8c.3 0 .6-.25.6-.5zM8 0c4.4 0 8 3.6 8 8s-3.6 8-8 8-8-3.6-8-8 3.6-8 8-8"})}),K2=_e.forwardRef(Y2),X2=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"m8.418 1.007.042.08 1.788 4.217 4.571.388a.5.5 0 0 1 .348.811l-.063.065-3.472 3.008 1.043 4.47a.5.5 0 0 1-.664.581l-.081-.04L8 12.217l-3.93 2.372a.5.5 0 0 1-.757-.453l.012-.089 1.043-4.47L.896 6.568a.5.5 0 0 1 .196-.86l.089-.016 4.571-.388L7.54 1.086a.5.5 0 0 1 .878-.08Z"})}),J2=_e.forwardRef(X2),Q2=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M13 14H3a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1"})}),Z2=_e.forwardRef(Q2),e5=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"m6 10 7-7 2 2-7 7-2 2-5-5 2-2z"})}),t5=_e.forwardRef(e5),n5=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M2.4 4h11.2a.2.2 0 0 1 .16.32l-5.6 7.467a.2.2 0 0 1-.32 0L2.24 4.32A.2.2 0 0 1 2.4 4"})}),r5=_e.forwardRef(n5),i5=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M11 2.4v11.2a.2.2 0 0 1-.32.16l-7.467-5.6a.2.2 0 0 1 0-.32l7.467-5.6a.2.2 0 0 1 .32.16"})}),o5=_e.forwardRef(i5),a5=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M4 13.6V2.4a.2.2 0 0 1 .32-.16l7.467 5.6a.2.2 0 0 1 0 .32l-7.467 5.6A.2.2 0 0 1 4 13.6"})}),s5=_e.forwardRef(a5),l5=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M13.6 11H2.4a.2.2 0 0 1-.16-.32l5.6-7.467a.2.2 0 0 1 .32 0l5.6 7.467a.2.2 0 0 1-.16.32"})}),c5=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M14.98 15H1.04c-1.002 0-1.303-.7-.802-1.5l6.82-11.9c.5-.8 1.303-.8 1.804 0l6.92 11.9c.501.8.1 1.5-.803 1.5M8.5 5h-1c-.3 0-.5.2-.5.5V9c0 .3.2.5.5.5h1c.3 0 .5-.2.5-.5V5.5c0-.3-.2-.5-.5-.5m-1 6c-.3 0-.5.2-.5.5v1c0 .3.2.5.5.5h1c.3 0 .5-.2.5-.5v-1c0-.3-.2-.5-.5-.5z"})}),u5={m:t5,"ï":J2,R:_e.forwardRef(l5),S:r5,T:o5,U:s5,P:K2,Q:B2,"è":_e.forwardRef(c5),"¢":z2,"©":N2,"23F4":W2,2013:Z2,"&":G2,add:O2,"minus-2":H2,dot:T2},d5=({size:e,iconKey:t,color:n,pvStyle:r})=>{const i=t&&u5[t];return i&&Yi.jsx("div",{"data-testid":"representation-indicator-icon",style:{color:n,height:e,...r},children:Yi.jsx(i,{style:{height:e}})})},f5=(e,t)=>e.max===e.min?.5:(t-e.min)/(e.max-e.min),h5=(e,t,n)=>{const r=e.paletteColors?e.paletteColors[t]:e.localPaletteColors[t];return n.getColorPickerColor(r)},p5=(e,t,n)=>{const r={previousColor:(i=e.localPaletteColors)[(o=t)-(o>0?1:0)],nextColor:i[o+(o<i.length-1?1:0)]};var i,o;const a=((e,t)=>{const n=e.limits&&e.limits.concat().sort(((e,t)=>e.value-t.value));return{lowerLimit:n&&t>0?n[t-1]:{value:0,gradient:!1},upperLimit:n&&n[t]?n[t]:{value:1,gradient:!1}}})(e,t),s=((e,t,n,r,i)=>{const{upperLimit:o,lowerLimit:a}=e,{previousColor:s,nextColor:l}=t,c=r===o.value?1:(r-a.value)/(o.value-a.value);return a.gradient&&o.gradient?r-a.value<o.value-r?{color:s.color,t:.5-c}:{color:l.color,t:c-.5}:a.gradient?{color:s.color,t:1-(.5+c/2)}:o.gradient?{color:l.color,t:c/2}:{color:i.localPaletteColors[n].color,t:r}})(a,r,t,n,e);return s&&XO(e.localPaletteColors[t].color).blend(XO(s.color),s.t)},m5=(e,t,n)=>{const r=((e,t)=>{const{limits:n}=e;return n&&(e.limits=n.sort(((e,t)=>e.value-t.value)),e.limits=n.map((e=>({...e,value:f5(t,e.value)})))),e})({...e},t),i=r.paletteColors||r.localPaletteColors;return i&&(r.localPaletteColors=i.concat().map(((e,t)=>({color:h5(r,t,n)})))),r},g5=(e,t,n,r)=>{const i=m5(e,n,r),{localPaletteColors:o}=i;if(t<=0)return o[0].color;if(t>=1)return o[o.length-1].color;const a=((e,t)=>{let n="",r=0;const{limits:i,localPaletteColors:o}=e;for(let a=0;a<o.length;a++){const o=i&&i[a]?i[a].value:1;if(t>=r&&t<o){n=p5(e,a,t);break}r=o}return n})(i,t);return a},y5=(e,t)=>{const n=(e=>e.map((e=>e.value??e)).sort(((e,t)=>e-t)))(e),r=n.some((e=>!D2(e)));return 0===n.length||r?(e=>{const t=0===e?0:.5*e;return{min:e-t,max:e+t}})(t):1===n.length?((e,t)=>{const n=e[0]-t;if(0===n||!D2(n)){const e=0===t?.5:Math.abs(.5*t);return{min:t-e,max:t+e}}return n>0?{min:t-.5*Math.abs(t),max:e[0]+2*n}:{min:e[0]+2*n,max:t+.5*Math.abs(t)}})(n,t):((e,t)=>{let n=e[e.length-1]-e[0];return n=n>0?n:1,{min:Math.min(t,e[0])-n/2,max:Math.max(t,e[e.length-1])+n/2}})(n,t)},v5=(e,t)=>{const{limits:n}=e.segments;if(!n)return;const r=((e,t)=>{const{min:n,max:r}=y5(e,t),i=Math.abs(t);return{min:n??t-i,max:r??t+i}})(n,t),i=((e,t,n)=>{const{limits:r,paletteColors:i,localPaletteColors:o}=e.segments;if(!r||!D2(t))return 0;let a=n&&D2(n)?Math.min(n,t):0;const s=r.sort(((e,t)=>e.value-t.value)),l=i||o;for(let e=0;e<l.length;e++){if(e===l.length-1||t<s[e].value&&t>=a)return e;a=s[e].value}return 0})(e,t,r.min);return{limitRange:r,limitPaletteColorIndex:i}},b5=e=>"flex-start"===e?"flex-end":"flex-start",x5=(e,t,n,r)=>{const i=e.indicatorConditionalColoring;if(!i)return;const o=v5(i,t),a=((e,t,n,r)=>{const{segments:i}=e;if(!i||!n)return;const{limits:o}=i;if(!o?.length||!((e,t)=>!(!e||0===e.length||!(e[t]?.gradient??e[t-1]?.gradient)))(o,n.limitPaletteColorIndex))return h5(i,n.limitPaletteColorIndex,r);const a=f5(n.limitRange,t);return g5(i,a,n.limitRange,r)})(i,t,o,r),s=i.segments.paletteColors[o?.limitPaletteColorIndex||0].icon,{indicator:l}=e;let c=l?.position||"right";return"rtl"===n&&(c="right"===c?"left":"right"),{color:a,iconKey:s,position:c}},w5=({representation:e,cellValue:t,textStyle:n})=>{const{styleService:r}=EZ(),{theme:i}=SZ(),{direction:o}=bZ(),{text:a,indicator:s}=e,{showTextValues:l,applySegmentColors:c}=s??{},u=x5(e,t,o,i),{fontSize:d,fontFamily:f,fontStyle:h,fontWeight:p,textDecoration:m}=r.measureValues,g={fontSize:d,fontFamily:f,fontStyle:h,fontWeight:p,textDecoration:m},y=parseInt(d||zX,10),{iconKey:v,color:b,position:x}=u||{},w={display:"flex",paddingTop:2};return l?Yi.jsxs("div",{"data-key":"representation-indicator",style:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"4px",overflow:n?.overflow,color:c?b:n?.color},children:["left"===x&&d5({size:y,iconKey:v,color:b,pvStyle:w}),Yi.jsx("span",{style:{paddingTop:4,overflow:n?.overflow,textOverflow:n?.textOverflow,whiteSpace:"nowrap",direction:t<0?"ltr":void 0,...g},children:a}),"right"===x&&d5({size:y,iconKey:v,color:b,pvStyle:w})]}):(w.paddingTop=5,d5({size:y,iconKey:v,color:b,pvStyle:w}))},S5=(e,t,n)=>{if(e?.auto)return t;switch(e?.align){case"center":return"center";case"left":return"rtl"===n?"flex-end":"flex-start";case"right":return"rtl"===n?"flex-start":"flex-end";default:return t}},C5=(e,t)=>{let{textAlign:n}=t.getDimensionInfo(e.dimensionInfoIndex)??{};return e.isPseudoDimension&&void 0!==e.visibleMeasureInfoIndex&&({labelTextAlign:n}=t.visibleMeasureInfo.at(e.visibleMeasureInfoIndex)??{}),n?.auto||void 0===n?"left":n.align},k5=(e,t,n,r,i)=>{if(i)return;const o=e.representation,a=e1({isLeftColumn:n,layoutService:t,representation:o}),s=n?"flex-start":"center",l=e.representation.resolvedImagePosition?.horizontal;if(e.representation.type===iX.Image)return a&&l&&"center"!==l&&"rtl"===r?b5(l):l??s;if(e.isPseudoDimension&&void 0!==e.visibleMeasureInfoIndex){const{labelTextAlign:n}=t.visibleMeasureInfo[e.visibleMeasureInfoIndex]??{};return S5(n,s,r)}const{textAlign:c}=t.getDimensionInfo(e.dimensionInfoIndex)??{};return S5(c,s,r)},E5=e=>!!e.target?.getAttribute("class")?.includes(KG),M5=(e,t)=>{switch(t.type){case"clearSelections":return{engineSelectedCells:null,activeSelection:null,selectedField:null};case"mouseup":return{...e,activeSelection:null,engineSelectedCells:t.payload.engineSelectedCells};case"mousedown":return{...e,activeSelection:t.payload.activeSelection,selectedField:t.payload.selectedField};case"mouseover":{if(!e.activeSelection)return e;const{index:n}=t.payload,r=Math.min(n,e.activeSelection.startIndex),i=Math.max(n,e.activeSelection.endIndex);if(r===e.activeSelection.startIndex&&i===e.activeSelection.endIndex)return e;const o={...e.activeSelection,startIndex:r,endIndex:i};return o.clientSelectedCells=(e=>{const{getCellFromIndex:t,startIndex:n,endIndex:r,clientSelectedCells:i}=e,o=new Map(i);for(let e=n;e<=r;e++){const n=t(e);"N"===n?.ref.qType&&o.set(n.ref.qElemNo,n)}return o})(o),{...e,activeSelection:o}}default:return e}},_5=e=>null!==e.target?.closest("[data-prevent-selection]"),R5=e=>"A"===e.target?.tagName,I5=({startIndex:e,getCellFromIndex:t,cell:n})=>({type:"mousedown",payload:{activeSelection:{startIndex:e,endIndex:e,getCellFromIndex:t,clientSelectedCells:(new Map).set(n.ref.qElemNo,n)},selectedField:{selectionCellType:n.selectionCellType,index:"L"===n.selectionCellType?n.x:n.y}}});const D5={createMouseDownHandler:()=>()=>{},createMouseOverHandler:()=>()=>{},createPointerUpHandler:()=>()=>{},isSelected:()=>!1,isActive:!1,isLocked:()=>!1},P5=_e.createContext(D5),A5=()=>_e.useContext(P5),O5=({children:e,selections:t})=>{const n=function(e){const{updatePageInfo:t}=bZ(),n=e.isActive(),[r,i]=_e.useReducer(M5,{engineSelectedCells:null,selectedField:null,activeSelection:null});_e.useEffect((()=>{const n=()=>{i({type:"clearSelections"})},r=()=>{n(),t({page:0})};return e.on("deactivated",n),e.on("canceled",n),e.on("confirmed",r),e.on("cleared",n),()=>{e.removeListener("deactivated",n),e.removeListener("canceled",n),e.removeListener("confirmed",r),e.removeListener("cleared",n)}}),[e,t]);const o=_e.useCallback((async()=>{if(!r.activeSelection)return;var t,n;1===r.activeSelection.clientSelectedCells.size&&(t=r.engineSelectedCells,(n=r.activeSelection).clientSelectedCells.forEach(((e,r)=>{t?.has(r)&&(n.clientSelectedCells.delete(r),t.delete(r))})));const o=new Map([...r.engineSelectedCells??new Map,...r.activeSelection.clientSelectedCells]);try{i({type:"mouseup",payload:{engineSelectedCells:o}}),await e.select({method:"selectPivotCells",params:[RZ,Array.from(o,(([,e])=>({qType:e.selectionCellType,qRow:e.y,qCol:e.x})))]})}catch(e){console.error(e),i({type:"mouseup",payload:{engineSelectedCells:r.engineSelectedCells}})}}),[r,e]);_e.useEffect((()=>{if(r.activeSelection)return document.addEventListener("mouseup",o),()=>{document.removeEventListener("mouseup",o)}}),[o,r.activeSelection]);const a=_e.useCallback(((e,t)=>n=>{const r=t(e);E5(n)||_5(n)||R5(n)||!(e=>1===e.buttons)(n)||!r||i(I5({startIndex:e,getCellFromIndex:t,cell:r}))}),[]),s=_e.useCallback((t=>async()=>{r.activeSelection&&(e.isActive()||await e.begin([RZ]),i({type:"mouseover",payload:{index:t}}))}),[r.activeSelection,e]),l=_e.useCallback(((e,t)=>n=>{if("touch"!==n.pointerType)return;const r=t(e);E5(n)||_5(n)||R5(n)||!r||(i(I5({startIndex:e,getCellFromIndex:t,cell:r})),o())}),[o]),c=_e.useCallback((e=>!(!r.engineSelectedCells?.size&&!r.activeSelection?.clientSelectedCells.size||!r.selectedField||e.selectionCellType===r.selectedField.selectionCellType&&("L"===e.selectionCellType?r.selectedField.index===e.x:r.selectedField.index===e.y))),[r.activeSelection?.clientSelectedCells.size,r.engineSelectedCells?.size,r.selectedField]),u=_e.useCallback((e=>!c(e)&&(r.engineSelectedCells?.has(e.ref.qElemNo)||!!r.activeSelection?.clientSelectedCells.has(e.ref.qElemNo))),[c,r.activeSelection?.clientSelectedCells,r.engineSelectedCells]);return _e.useMemo((()=>({isSelected:u,isActive:n,isLocked:c,createMouseDownHandler:a,createMouseOverHandler:s,createPointerUpHandler:l})),[u,n,c,a,s,l])}(t);return Yi.jsx(P5.Provider,{value:n,children:e})},L5=e=>"fill"===e.representation.imageSize,T5=(e,t)=>{let n=e.isLeftColumn?"flex-start":"center";return e.isLeftColumn&&L5(e)&&t&&(n="center"),e.representation.type!==iX.Image||L5(e)?n:e.representation.resolvedImagePosition?.vertical};var q5=function(e){return e.Background="background",e.Color="color",e.FontWeight="fontWeight",e.FontStyle="fontStyle",e.TextDecoration="textDecoration",e}(q5||{});const N5={brighter:.5,darker:.3,opacity:.03},j5=(e,{cell:t,styleService:n})=>{if(e===q5.Background||e===q5.Color){const n=t.expressionColor[e];if(n)return n}return t.isNull?n.nullValues[e]:t.isPseudoDimension?n.measureLabels[e]:t.isTotal?n.totalValues[e]:n.dimensionValues[e]},z5=({styleService:e,isCellSelected:t,cell:n,isCellLocked:r})=>{if(t)return e.selectedColors.background;const i=j5(q5.Background,{cell:n,styleService:e});return!r||!i||n.isPseudoDimension||n.isEmpty||n.isNull||n.isTotal?j5(q5.Background,{cell:n,styleService:e}):`repeating-linear-gradient(\n -45deg,\n ${RX(o=i,N5)} 0px 2px,\n ${o} 0px 4px\n ) border-box`;var o},F5=({cell:e,styleService:t,isCellSelected:n})=>n?t.selectedColors.color:j5(q5.Color,{cell:e,styleService:t}),W5=({cell:e,styleService:t})=>{const{qCanCollapse:n,qCanExpand:r}=e.ref,i=j5(q5.FontWeight,{cell:e,styleService:t});return void 0===i&&(r||n)?WX:i},$5=({cell:e,styleService:t})=>j5(q5.FontStyle,{cell:e,styleService:t}),B5=({cell:e,styleService:t})=>j5(q5.TextDecoration,{cell:e,styleService:t}),V5=e=>e?"pointer":"default",H5=({expandOrCollapse:e,cell:t})=>n=>{e?.(t.y,t.x),n.stopPropagation()},U5=(e,t)=>{if(!e.isLeftColumn||e.representation.type===iX.Image)return{padding:4};return{padding:4,marginTop:t.dimensionValueTextHeight/2-6.5-4}},G5=({cell:e,isLeftColumn:t,isCellSelected:n})=>{const{styleService:r,layoutService:i}=EZ(),{interactions:o}=SZ(),{isActive:a}=A5(),{dataModel:s}=Y0();if(!e.ref.qCanExpand&&!e.ref.qCanCollapse)return null;const l=!o.active||a||!s,c=F5({cell:e,styleService:r,isCellSelected:n}),u=a?.4:1,d=e.ref.qCanExpand?yQ:mQ;let f;f=e.ref.qCanExpand?t?s.expandLeft:s.expandTop:t?s.collapseLeft:s.collapseTop;const h=e1({isLeftColumn:t,layoutService:i,representation:e.representation});return Yi.jsx(d,{opacity:u,color:c,"data-prevent-selection":!l||void 0,"data-testid":e.ref.qCanExpand?"expand-icon":"collapse-icon",height:13,style:{flexShrink:0,cursor:l?"default":"pointer",position:"sticky",top:0,...U5(e,r),...h&&{alignSelf:T5(e)}},onClick:l?void 0:H5({cell:e,expandOrCollapse:f})})},Y5=e=>{switch(e){case"fitHeight":case"fill":case"alwaysFit":return"100%";case"originalSize":return"fit-content";default:return"auto"}},K5=(e,t,n)=>{if("alwaysFit"===e&&t&&!n)return"fit-content";switch(e){case"fitHeight":return"auto";case"originalSize":return"fit-content";case"alwaysFit":return n?"unset":"100%";default:return"100%"}},X5=(e,t)=>{if("alwaysFit"===e)switch(t?.vertical){case"flex-start":return"center top";case"flex-end":return"center bottom";default:return"center center"}},J5=({representation:e,canExpandOrCollapse:t,leafCount:n,isLeftColumn:r,styleService:i,layoutService:o,isMeasureCell:a})=>{const{isIndentModeEnabled:s}=o,l=e1({isLeftColumn:r,layoutService:o,representation:e}),c=t?21:0,u=e.imageBox?.width??24;let d=`calc(100% - ${c}px)`,f=i.headerCellHeight;r&&l&&(d=u),(a||r)&&(f=i.contentCellHeight);let h=f;switch(r&&void 0!==n&&!s&&(h=f*Math.max(n,1)),e.imageSize){case"originalSize":return{maxWidth:d,maxHeight:h,...l?{width:d}:{}};case"fitWidth":return{width:d,maxHeight:h};case"fitHeight":return{height:h,maxWidth:d,...l?{width:d}:{}};case"fill":return{height:h,width:d};default:return{width:d,height:f}}},Q5=e=>{if("alwaysFit"===e)return"contain"},Z5=({suffix:e,delimeter:t})=>` ${e?t:""} ${e}`.trim(),e3=({imageSize:e,resolvedImagePosition:t,isImagesInIndentModeEnabled:n,isMeasureCell:r})=>({width:K5(e,n,r),height:Y5(e),objectFit:Q5(e),objectPosition:X5(e,t),...n&&"alwaysFit"===e?{"max-width":"100%"}:{}}),t3=({representation:e,textStyle:t,isMeasureCell:n})=>{const{imageRef:r,onLoad:i}=(()=>{const{downloadService:e}=EZ(),t=_e.useRef(null),{promise:n,resolve:r}=_e.useMemo((()=>cJ()),[]);return _e.useEffect((()=>(e.isDownloadedAsPDForImage&&(e.waitForPromise(n),t.current?.complete&&r()),()=>{r()})),[t,e,n,r]),{onLoad:_e.useCallback((()=>{r()}),[r]),imageRef:t}})(),{layoutService:{isIndentModeEnabled:o}}=EZ(),{url:a,text:s,imageSize:l,resolvedImagePosition:c}=e,{overflow:u,...d}=t;return Yi.jsx("img",{src:a,alt:s,style:{...e3({imageSize:l,resolvedImagePosition:c,isImagesInIndentModeEnabled:o,isMeasureCell:n}),...d},onLoad:i,ref:r})},n3=({representation:e,textStyle:t,canExpandOrCollapse:n,leafCount:r,isLeftColumn:i=!1,imageContainerHorizontalAlignment:o,isMeasureCell:a})=>{const{styleService:s,layoutService:l}=EZ(),{resolvedImagePosition:c}=e;return Yi.jsx("div",{"data-key":"image-container--image",style:{display:"flex",flexDirection:"column",justifyContent:c?.vertical,alignItems:o,overflow:"hidden",boxSizing:"border-box",border:"4px solid transparent",...J5({representation:e,canExpandOrCollapse:n,leafCount:r,styleService:s,layoutService:l,isLeftColumn:i,isMeasureCell:a})},children:Yi.jsx(t3,{representation:e,textStyle:t,isMeasureCell:!0})})},r3={display:"flex",flexDirection:"row",alignItems:"center"},i3={alignItems:"center",display:"flex",flexDirection:"row",backgroundClip:"padding-box"},o3=(e,t,n,r)=>t?{...i3,...e.nullValues}:n?{...r3,color:e.totalValues.color,background:r??e.totalValues.background}:{...r3,color:e.measureValues.color,background:r??e.measureValues.background},a3=(e,t,n,r,i)=>{const{fontFamily:o,fontSize:a}=e.measureValues,s={...KX,...!n&&XX(e.grid.lineClamp),...t&&{color:t},fontFamily:o,fontSize:a};if(i){const{fontWeight:t,fontStyle:n,textDecoration:r}=e.nullValues;return{...s,fontWeight:t,fontStyle:n,textDecoration:r}}if(r){const{fontWeight:t,fontStyle:n,textDecoration:r}=e.totalValues;return{...s,fontWeight:t,fontStyle:n,textDecoration:r}}const{fontWeight:l,fontStyle:c,textDecoration:u}=e.measureValues;return{...s,fontWeight:void 0===l?WX:l,fontStyle:c,textDecoration:u}},s3=({cell:e,representation:t,color:n,isTotalValueCell:r,cellHorizontalAlignment:i})=>{const{layoutService:o,styleService:a}=EZ(),{isIndentModeEnabled:s}=o,l=e.isNull?o.getNullValueText():t.text,c=t.type===iX.Image,u=t.type===iX.Indicator,d=D2(P2(l)),f=a3(a,n,d,r,e.isNull);if(!s&&c&&!e.isNull||s&&c&&!e.isNull)return Yi.jsx(n3,{isMeasureCell:!0,textStyle:f,representation:t,imageContainerHorizontalAlignment:i});const h=P2(e.isNull?t.text:e.ref.qNum);return u&&D2(h)?Yi.jsx(w5,{representation:t,cellValue:h,textStyle:f}):Yi.jsx("span",{style:{padding:4,direction:d?"ltr":void 0,...f},children:l})},l3=(e,t)=>e?.[t]?.visibleMeasureInfoIndex??0,c3="flex-start",u3=(e,t)=>e.isNull?c3:t.type===iX.Image&&"fill"!==t.imageSize?t.resolvedImagePosition?.vertical:c3,d3=({columnIndex:e,rowIndex:t,style:n,data:r})=>{const{env:i}=SZ(),{pageInfo:o,direction:a}=bZ(),{styleService:s,layoutService:l}=EZ(),{attrExprInfoIndexes:c,gridSectionsData:{measureData:u,leftDimensionData:d,topDimensionData:f},visibleDimensionsInfo:{visibleLeftDimensionInfo:h,visibleTopDimensionInfo:p}}=Y0(),m=(()=>{const{layoutService:{isIndentModeEnabled:e}}=EZ(),{gridSectionsData:{leftDimensionData:t,topDimensionData:n},visibleDimensionsInfo:{visibleLeftDimensionInfo:r,visibleTopDimensionInfo:i}}=Y0(),o=r.length,a=i.length;return _e.useCallback(((r,i)=>!(!n.grid.at(a-1)?.[r]?.isTotal&&!t.grid.at(e?0:o-1)?.[i]?.isTotal)),[n,t,o,a,e])})(),g=(()=>{const{gridSectionsData:{topDimensionData:e},visibleDimensionsInfo:{visibleTopDimensionInfo:t}}=Y0(),n=t.length;return _e.useCallback((t=>{const r=e.grid.at(n-1)?.[t];return M2(r,e.totalDividerIndex)}),[e,n])})(),y=(()=>{const{layoutService:{isIndentModeEnabled:e}}=EZ(),{gridSectionsData:{leftDimensionData:t},visibleDimensionsInfo:{visibleLeftDimensionInfo:n}}=Y0(),r=n.length;return _e.useCallback((n=>{const i=e?0:r-1,o=t.grid.at(i)?.[n];return M2(o,t.totalDividerIndex,e)}),[t,e,r])})(),{showLastBorder:v}=r,b=f.grid.at(p.length-1),x=d.grid.at(h.length-1),{background:w}=s.measureValues,S=u[t]?.[e],C=t===o.rowsOnCurrentPage-1,k=e===l.size.x-1;if(!S)return Yi.jsx(_2,{style:{...n,background:w},isLastRow:C,isLastColumn:k,showLastBorder:v,index:t,isLeftColumn:!1,showTotalCellDivider:!1});const E=l.hasPseudoDimOnLeft?l3(x,t):l3(b,e),M=l.visibleMeasureInfo[E],_=M0({cell:S.ref,representationProperties:M.representation,attrExprInfoIndex:c.measures[E],env:i,direction:a,conditionalColoring:M.conditionalColoring,enabledFeatures:{[iX.Image]:!0,[iX.Indicator]:!0}}),R=!S.isNull&&m(e,t),I=S.isNull?l.getNullValueText():_.text,D=!S.isNull||!Number.isNaN(+I),P=_0(c.measures[E],S.ref),A=((e,t,n,r,i)=>{const{textAlign:o}=t,a=r?"flex-end":"center";return e.isNull||n.type!==iX.Image?S5(o,a,i):n.resolvedImagePosition?.horizontal??"center"})(S,M,_,D,a),O={...o3(s,S.isNull,R,P.background),...QX(C,k,s.grid.border,a,v),...eJ({bottomDivider:y(t),rightDivider:g(e),borderColor:s.grid.divider}),...YX,padding:"0px 4px",display:"flex",justifyContent:A};return Yi.jsx("div",{className:GG,title:I,style:{...O,...n},"data-testid":"measure-value","data-row-index":t,"data-col-index":e,children:Yi.jsx(R2,{width:I2(_),verticalAlign:u3(S,_),children:Yi.jsx(s3,{cell:S,representation:_,isTotalValueCell:R,color:P.color,cellHorizontalAlignment:A})})})};var f3=Re.memo(d3,d2);const h3=(e,t)=>t.list[e]?.id??e.toString(),p3=({columnIndex:e,rowIndex:t,data:n})=>n.grid[t]?.[e]?.id??`${t}-${e}`,m3=e=>({...GX,overflow:"hidden",boxSizing:"content-box",borderWidth:"rtl"===e?"1px 1px 0px 0px":"1px 0px 0px 1px"}),g3=({dataGridRef:e,height:t,rowHightCallback:n,width:r,showLastBorder:i,getRightGridColumnWidth:o,verticalScrollDirection:a,horizontalScrollDirection:s})=>{const{pageInfo:l,direction:c}=bZ(),{layoutService:u,styleService:{grid:{divider:d},contentCellHeight:f}}=EZ(),{dataModel:h,gridSectionsData:{measureData:p}}=Y0(),m={...m3(c),borderColor:d,willChange:"auto",userSelect:"none",WebkitUserSelect:"none"},g=(({verticalScrollDirection:e,horizontalScrollDirection:t})=>{const{pageInfo:n}=bZ(),{downloadService:r,viewService:i,layoutService:o}=EZ(),{dataModel:a,gridSectionsData:{leftDimensionData:s,topDimensionData:l,measureData:c}}=Y0(),u=s.columnCount,d=l.rowCount;return _e.useCallback((async({overscanColumnStartIndex:s,overscanColumnStopIndex:l,overscanRowStartIndex:f,overscanRowStopIndex:h})=>{i.gridColumnStartIndex=s,i.gridRowStartIndex=f,i.gridWidth=l-s+1,i.gridHeight=h-f+1;const p=i.gridWidth+u+(t.current===pX.None?0:f2),m=i.gridHeight+d+(e.current===pX.None?0:f2);let g=k2;m*p>1500&&(g=E2),g(a,o,c,n,i,e,t,r)}),[i,o,a,c,e,t,n,u,d,r])})({verticalScrollDirection:a,horizontalScrollDirection:s});return MJ((()=>{e.current&&e.current.resetAfterColumnIndex(0,!1)}),[e,h,p]),_e.useLayoutEffect((()=>{e.current&&e.current.resetAfterIndices({columnIndex:0,rowIndex:0,shouldForceUpdate:!0})}),[r,t,e,f,c]),0===u.size.x?null:Yi.jsx(Z1,{"data-section-id":"DATA_GRID",ref:e,style:m,columnCount:u.size.x,columnWidth:o,height:t,rowCount:l.rowsOnCurrentPage,rowHeight:n,width:r,itemData:{showLastBorder:i,grid:p},onItemsRendered:g,estimatedRowHeight:n(),estimatedColumnWidth:o(),itemKey:p3,direction:c,children:f3})};var y3=_e.memo(g3);const v3=(e,t)=>Yi.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:[Yi.jsx("path",{d:"M13 7H8zV4.982C13 2.23 10.761 0 8 0S3 2.23 3 4.982V7h.75H3h1.5V5.332C4.5 3.216 5.549 1.5 8 1.5s3.5 1.716 3.5 3.832V7h.75H3a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1H3z"}),Yi.jsx("use",{fillRule:"evenodd"})]}),b3=_e.forwardRef(v3),x3=e=>{const[t,n]=_e.useState(!1);return MJ((()=>{n(!1)}),e),{isAdjustingWidth:t,setIsAdjustingWidth:n}},w3=()=>{const[e,t]=_e.useState(!1),{dataModel:n}=Y0(),{interactions:r}=SZ(),{isAdjustingWidth:i,setIsAdjustingWidth:o}=x3([n]);return{open:e,setOpen:t,handleOpenMenu:e=>{!r.active||E5(e)||i||t(!0)},setIsAdjustingWidth:o}};function S3(e,t){const n=t.expressionColor?.background??e.dimensionValues.background,r=t.isLeftColumn?e.header.background:n,i=r===VX.Transparent?EX.WHITE:r,o=XO(e.grid.border),a=XO(i);return a.isInvalid()||o.isInvalid()||1===o.a?e.grid.border:function(e,t,n){return XO(e.r+(t.r-e.r)*n,e.g+(t.g-e.g)*n,e.b+(t.b-e.b)*n,e.a+(t.a-e.a)*n)}(a,o,o.a).getRGB()}const C3=({cellInfo:e,columnWidth:t,isLastColumn:n,overrideLeftGridWidth:r,setIsAdjustingWidth:i,shouldApplyIndentModeColumnWidth:o,tableWidth:a})=>{const{direction:s}=bZ(),{interactions:l,translator:c}=SZ(),{isActive:u}=A5(),{dataModel:d}=Y0(),{styleService:f}=EZ(),[,h]=_e.useState({});if(!(e.canBeResized&&!!l.active&&!u))return null;const p=S3(f,e);return Yi.jsx(AJ,{isPivot:!0,columnWidth:t,isLastColumn:n,keyValue:`adjuster-${e.dimensionInfoIndex}`,hoverColor:p,updateWidthCallback:t=>{h({}),r&&void 0!==e.colIdx&&r(t,e.colIdx)},confirmWidthCallback:t=>{o?d.applyIndentModeColumnWidth({...t,pixels:Math.min((a??0)*Q0,t.pixels??0)}):d.applyColumnWidth(t,e)},setIsAdjustingWidth:i,isLeftColumn:e.isLeftColumn,accessibilityRelatedArgs:{translator:c,columnLabel:e.label??""},direction:s})},k3=il(Xx,{shouldForwardProp:e=>!["interactions","hoverBackground","background","shouldShowMenuIcon","isDimension"].includes(e)})((({interactions:e,background:t,hoverBackground:n,shouldShowMenuIcon:r,isDimension:i})=>({pointerEvents:i?"all":"none",position:"relative",display:"grid",gridTemplateColumns:r?"1fr 12px":"1fr",gap:8,alignItems:"center",cursor:e.active?"pointer":"default",background:t,"&&:hover":{background:e.active&&i?n:t}}))),E3=il("div",{shouldForwardProp:e=>!["direction"].includes(e)})((({direction:e})=>({position:"absolute",left:"rtl"!==e?0:void 0,bottom:0}))),M3=il("div",{shouldForwardProp:e=>"justifyContent"!==e})((({justifyContent:e})=>({...UX,justifyContent:e??UX.justifyContent,flexDirection:"row",overflow:"hidden",position:"relative",gap:8}))),_3=il("div")((()=>({...UX}))),R3=il("div",{shouldForwardProp:e=>!["fontSize","fontFamily","fontWeight","fontStyle","textDecoration","justifyContent"].includes(e)})((({fontSize:e,fontFamily:t,fontWeight:n,fontStyle:r,textDecoration:i,justifyContent:o})=>({display:"flex",justifyContent:o,alignSelf:"center",flexGrow:1,maxWidth:"100%",fontWeight:n,fontSize:e,fontFamily:t,fontStyle:r,textDecoration:i}))),I3=il(dC)((({theme:e})=>({".MuiList-root":{padding:e.spacing(.5,0)}}))),D3=il(gC,{shouldForwardProp:e=>!["isActive"].includes(e)})((({theme:e,isActive:t})=>({width:220,maxHeight:32,borderRadius:e.spacing(.5),margin:e.spacing(.25,.5),padding:e.spacing(1,1.5),display:"flex",justifyContent:"space-between",position:"relative",overflow:"hidden ",boxSizing:"border-box",background:t?"rgba(0, 0, 0, 0.05)":"transparent","&:hover":{".indent-mode-dropdown-more":{opacity:1}}}))),P3=il("span")({textOverflow:"ellipsis",overflow:"hidden"}),A3=il("div",{shouldForwardProp:e=>"visible"!==e})((({visible:e})=>({opacity:e?1:0,width:X0,display:"flex",justifyContent:"center",alignItems:"center",position:"relative"}))),O3=il("span",{shouldForwardProp:e=>!["padding","alignSelf"].includes(e)})((({padding:e,alignSelf:t})=>({padding:e,alignSelf:t,position:"sticky",top:0})));let L3=function(e){return e.Expand="Expand",e.Collapse="Collapse",e}({});const T3=(e,t)=>({qExcludeList:t===L3.Expand,qPos:{qDimName:e,qElemNo:[]}}),q3=`${RZ}/qExpansionState`,N3=({model:e,qExpansionState:t,qEffectiveDimensionName:n,action:r})=>async()=>{const i=(({qEffectiveDimensionName:e,oldExpansionState:t,action:n})=>{const r=t?.findIndex((t=>t.qPos?.qDimName===e));return{expansionData:T3(e,n),index:r}})({qEffectiveDimensionName:n,oldExpansionState:t,action:r});await(async({model:e,newExpansionState:t,errorMsg:n})=>{const{index:r,expansionData:i}=t;try{let t,n=q3,o="Add";void 0===r?t=JSON.stringify([i]):-1===r?(n=`${q3}/-`,t=JSON.stringify(i)):(n=`${q3}/${r}`,o="Replace",t=JSON.stringify(i)),await e.applyPatches([{qPath:n,qOp:o,qValue:t}],!0)}catch(e){console.error(n,e)}})({model:e,newExpansionState:i,errorMsg:`Failed to ${r} dimension`})},j3=({model:e,effectivePropertiesService:t,cell:n})=>{if(void 0===n.qEffectiveDimensionName)return;const r={model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:n.qEffectiveDimensionName};return{expandCallback:N3({...r,action:L3.Expand}),collapseCallback:N3({...r,action:L3.Collapse}),alwaysFullyExpanded:t.qAlwaysFullyExpanded}},z3={[AQ.Sorting]:!0,[AQ.Selections]:!0,[AQ.Searching]:!0},F3=({cell:e,style:t,isFirstColumn:n,isLastColumn:r,isLastRow:i,changeSortOrder:o,iconsVisibilityStatus:a,columnWidth:s,overrideLeftGridWidth:l,shouldApplyIndentModeColumnWidth:c,tableWidth:u})=>{const d=_e.useRef(null),{styleService:f,layoutService:h,effectivePropertiesService:p}=EZ(),{app:m,interactions:g,embed:y,translator:v,model:b}=SZ(),{fontSize:x,fontFamily:w,fontStyle:S,fontWeight:C,textDecoration:k,color:E,background:M,hoverBackground:_,activeBackground:R}=f.header,I=_e.useRef(null),{shouldShowLockIcon:D,shouldShowMenuIcon:P}=a,{open:A,setOpen:O,handleOpenMenu:L,setIsAdjustingWidth:T}=w3(),{direction:q}=bZ(),N={sortFromMenu:async(t,n)=>{t.stopPropagation(),await o(e,n)}},j={embed:y,listboxRef:d,sortCriteria:h.searchSortFromDimension&&e.isDim?p.getSortCriteriaForDimension(e.dimensionInfoIndex):void 0},z={app:m,qStateName:h.layout.qStateName},{labelTextAlign:F}=h.getDimensionInfo(e.dimensionInfoIndex)??{},W=S5(F,"flex-start",q);return Yi.jsxs(k3,{className:GG,title:e.label,interactions:g,background:A?R:M,hoverBackground:_,shouldShowMenuIcon:P,isDimension:e.isDim,style:{...t,...YX,...ZX(e,i,n,r,f.grid.border,q),color:E},"data-testid":"title-cell",onClick:L,children:[Yi.jsxs(M3,{children:[D?Yi.jsx(_3,{children:Yi.jsx(b3,{height:12})}):null,Yi.jsx(R3,{fontFamily:w,fontSize:x,fontStyle:S,fontWeight:C,textDecoration:k,justifyContent:W,children:Yi.jsx("span",{style:KX,children:e.label})})]}),e.isDim?Yi.jsxs(Yi.Fragment,{children:[Yi.jsx(TQ,{headerData:e,translator:v,anchorRef:I,open:A,setOpen:O,interactions:g,menuAvailabilityFlags:z3,sortRelatedArgs:N,searchRelatedArgs:j,selectionRelatedArgs:z,expandOrCollapseArgs:j3({model:b,effectivePropertiesService:p,cell:e}),shouldShowMenuIcon:P,model:b&&"setActiveField"in b?b:void 0,direction:q,isAccessibleHeader:!0}),Yi.jsx(E3,{ref:d,direction:q}),Yi.jsx(E3,{ref:I,direction:q})]}):null,Yi.jsx(C3,{cellInfo:{...e,isLeftColumn:!0},columnWidth:s,isLastColumn:r,overrideLeftGridWidth:l,setIsAdjustingWidth:T,shouldApplyIndentModeColumnWidth:c,tableWidth:u})]})},W3=({rowSpan:e,columnSpan:t})=>{const{styleService:n}=EZ(),{direction:r}=bZ();return e>0&&t>0?Yi.jsx("div",{style:{...GX,gridRowStart:1,gridRowEnd:`span ${e}`,gridColumnStart:1,gridColumnEnd:`span ${t}`,borderWidth:"rtl"===r?"0px 0px 0px 1px":"0px 1px 0px 0px",borderColor:n.grid.border,background:n.grid.background},"data-testid":"empty-header-cell"}):null},$3=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"m8 9 4.5-4.5L14 6l-4.5 4.5L8 12 2 6l1.5-1.5z"})}),B3=_e.forwardRef($3),V3=(e,t)=>Yi.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:[Yi.jsx("path",{d:"m8 7-4.5 4.5L2 10l6-6 6 6-1.5 1.5z"}),Yi.jsx("use",{fillRule:"evenodd"})]}),H3=_e.forwardRef(V3),U3=({tableWidth:e,leftGridWidth:t,overrideLeftGridWidth:n})=>{const{direction:r}=bZ(),{styleService:i}=EZ(),{interactions:o,translator:a}=SZ(),{isActive:s}=A5(),{dataModel:l}=Y0(),{setIsAdjustingWidth:c}=x3([l]);if(!(!!o.active&&!s))return null;const u=S3(i,{isLeftColumn:!0});return Yi.jsx(AJ,{isPivot:!0,isLastColumn:!0,isLeftColumn:!0,keyValue:"adjuster-indent-row",hoverColor:u,columnWidth:t,updateWidthCallback:t=>{n(Math.min(t,e*Q0))},confirmWidthCallback:r=>{if(r.type===JG.FitToContent)return void l.applyIndentModeColumnWidth({type:JG.Auto});const i=Math.min(r.pixels??t,e*Q0);n(i),l.applyIndentModeColumnWidth({type:JG.Pixels,pixels:i})},setIsAdjustingWidth:c,accessibilityRelatedArgs:{translator:a,columnLabel:a.get("SNPivotTable.IndentMode.Rows")},direction:r})},G3=(e,t)=>Yi.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Yi.jsx("path",{d:"M3 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0m6 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0m5 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2"})}),Y3=_e.forwardRef(G3),K3=({cell:e,changeSortOrder:t})=>{const n=_e.useRef(null),r=_e.useRef(null),{app:i,interactions:o,embed:a,translator:s,model:l}=SZ(),{layoutService:c,effectivePropertiesService:u}=EZ(),{open:d,setOpen:f,handleOpenMenu:h}=w3();return Yi.jsxs(D3,{onClick:h,isActive:d,children:[Yi.jsx(P3,{children:e.label}),Yi.jsxs(A3,{className:"indent-mode-dropdown-more",visible:d,children:[Yi.jsx(Y3,{}),e.isDim?Yi.jsxs(Yi.Fragment,{children:[Yi.jsx(TQ,{headerData:e,translator:s,anchorRef:n,open:d,setOpen:f,interactions:o,menuAvailabilityFlags:z3,sortRelatedArgs:{sortFromMenu:async(n,r)=>{n.stopPropagation(),await t(e,r)}},searchRelatedArgs:{embed:a,listboxRef:r},selectionRelatedArgs:{app:i,qStateName:c.layout.qStateName},expandOrCollapseArgs:j3({model:l,effectivePropertiesService:u,cell:e}),shouldShowMenuIcon:!1,model:l&&"setActiveField"in l?l:void 0}),Yi.jsx(E3,{ref:r}),Yi.jsx(E3,{ref:n})]}):null]})]})},X3=({idx:e,menu:t,menuItems:n,isOnlyOneRow:r})=>{const i=n.at(-1)?.id===DZ,o=e+1<n.length&&n[e+1]?.id===DZ;return!(r&&i&&o)&&(t?.id!==DZ&&e<n.length-1)},J3=({menuItems:e,changeSortOrder:t,overrideLeftGridWidth:n,leftGridWidth:r,tableWidth:i})=>{const{styleService:o}=EZ(),{interactions:a,translator:s}=SZ(),{dataModel:l,gridSectionsData:{headersData:c}}=Y0(),[u,d]=_e.useState(!1),f=_e.useRef(null),{headerCellHeight:h}=o,{color:p,background:m,hoverBackground:g,activeBackground:y,fontFamily:v,fontSize:b,fontStyle:x,fontWeight:w,textDecoration:S}=o.header,{isAdjustingWidth:C}=x3([l]),k=e=>{e.stopPropagation()},E={height:h,gridColumn:`1 / span ${c.size.x}`,gridRow:c.size.y,zIndex:c.size.x-0};return Yi.jsxs(k3,{isDimension:!0,background:u?y:m,interactions:a,hoverBackground:g,style:{...E,...YX,color:p},onClick:e=>{!a.active||E5(e)||C||d(!u)},"data-testid":"indentModeHeaderCellWrapper",children:[Yi.jsxs(M3,{justifyContent:"flex-start",children:[Yi.jsx(R3,{fontFamily:v,fontSize:b,fontStyle:x,fontWeight:w,textDecoration:S,justifyContent:"flex-start",children:Yi.jsx("span",{style:KX,children:s.get("SNPivotTable.IndentMode.Rows")})}),u?Yi.jsx(H3,{}):Yi.jsx(B3,{}),Yi.jsx(E3,{ref:f})]}),Yi.jsx(I3,{open:u,anchorEl:f.current,disableEnforceFocus:!0,children:e.map(((n,r)=>[n&&n.id!==DZ&&Yi.jsx("li",{role:"presentation",onClick:k,onKeyDown:k,children:Yi.jsx(K3,{cell:n,changeSortOrder:t})}),X3({idx:r,menu:n,menuItems:e,isOnlyOneRow:1===c.size.y})&&Yi.jsx(jJ,{"data-testid":"group-divider",variant:"middle"})]))}),Yi.jsx(U3,{tableWidth:i,leftGridWidth:r,overrideLeftGridWidth:n})]})},Q3=({layoutService:e,headersData:t,topRowIndex:n})=>e.isIndentModeEnabled&&t.size.x>1&&n+1===t.size.y,Z3={display:"grid",width:"fit-content"},e4=({tableWidth:e,leftGridWidth:t,columnWidths:n,rowHight:r,changeSortOrder:i,getHeaderCellsIconsVisibilityStatus:o,height:a,overrideLeftGridWidth:s})=>{const{layoutService:l}=EZ(),{gridSectionsData:{headersData:c}}=Y0();return Yi.jsxs("div",{"data-testid":"HEADER_GRID",style:{...Z3,gridTemplateColumns:n.map((e=>`${e}px`)).join(" "),gridTemplateRows:c.data.map((()=>`${r}px`)).join(" "),height:a},children:[c.size.y>1&&Yi.jsx(W3,{columnSpan:c.size.x-1,rowSpan:c.size.y-1}),c.data.map(((a,u)=>{let d=[];if(Q3({layoutService:l,headersData:c,topRowIndex:u})){const n=a.at(0);return Array.isArray(n)&&d.push(Yi.jsx(J3,{menuItems:n,changeSortOrder:i,overrideLeftGridWidth:s,leftGridWidth:t,tableWidth:e},n.at(0)?.id)),d}return d=a.reduce(((t,a,d)=>{if(a&&!Array.isArray(a)){const f=o(d,a.isLocked,a.label),h=l.isIndentModeEnabled&&1===c.size.x;t.push(Yi.jsx(F3,{style:{width:n[d],height:r,gridColumn:l.isIndentModeEnabled&&c.size.x>1?2:d+1,gridRow:u+1,zIndex:c.size.x-d},isLastRow:u===c.size.y-1,isFirstColumn:0===d,isLastColumn:d===c.size.x-1,changeSortOrder:i,cell:a,iconsVisibilityStatus:f,columnWidth:n[d],overrideLeftGridWidth:s,shouldApplyIndentModeColumnWidth:h,tableWidth:e},a.id))}return t}),[]),d}))]})};var t4=_e.memo(e4);const n4=(e,t,n,r)=>{const{layoutService:i}=EZ();_e.useLayoutEffect((()=>{e.current?.forEach((e=>e?.resetAfterIndex(0,!0)))}),[e,t,n,r,i])},r4=(e,t)=>{MJ((()=>{e.current?.forEach((e=>e?.resetAfterIndex(0,!1)))}),[e,t])},i4=(e,t)=>{const{isLast:n,list:r,listValues:i}=t;return n?r[e]:i[e]},o4=()=>{},a4=({children:e,reactWindowStyle:t,cell:n,data:r,showTotalCellDivider:i,isLastRow:o,isLastColumn:a,isLeftColumn:s,isCellSelected:l,isAdjustingWidth:c,index:u})=>{const{styleService:d,layoutService:f}=EZ(),{interactions:h}=SZ(),{direction:p}=bZ(),{isLocked:m,createMouseDownHandler:g,createMouseOverHandler:y,createPointerUpHandler:v}=A5(),{showLastBorder:b}=r,x=m(n)||n.isLockedByDimension,w=!(x||!h.active||!h.select||n.isEmpty||n.isNull||n.isPseudoDimension||n.isTotal||c),S=w?g(u,(e=>i4(e,r))):void 0,C=w?y(u):void 0,k=w?v(u,(e=>i4(e,r))):void 0,E=e1({isLeftColumn:s,layoutService:f,representation:n.representation});return Yi.jsx("div",{className:GG,title:h.passive?n.representation.text:void 0,style:{...t,...QX(o,a,d.grid.border,p,b),...eJ({bottomDivider:i&&s,rightDivider:i&&!s,borderColor:d.grid.divider}),...YX,padding:"rtl"===p?"0px 0px 0px 4px":"0px 4px",cursor:V5(w),background:z5({styleService:d,isCellSelected:l,cell:n,isCellLocked:x}),zIndex:s?void 0:f.size.x-n.x,justifyContent:k5(n,f,s,p,E),display:"flex",...f.isIndentModeEnabled&&s&&{["rtl"===p?"paddingRight":"paddingLeft"]:Math.max(4,24*(n.indentLevel??0))},textAlign:C5(n,f)},"aria-hidden":"true",onMouseDown:S,onMouseOver:C,onPointerUp:k,onKeyUp:o4,role:"button",tabIndex:-1,"data-testid":"dimension-cell","data-x":n.x,"data-page-x":n.pageX,"data-y":n.y,"data-page-y":n.pageY,"data-cell-type":n.ref.qType,"data-dimension-info-index":n.dimensionInfoIndex,children:e})},s4=e=>{e.stopPropagation()},l4=({href:e,text:t,interactions:n,color:r})=>({href:e,title:t,rel:"noreferrer",target:"_blank",underline:"hover",onClick:s4,color:EX.LINK,style:{pointerEvents:n.active?"auto":"none",color:r??void 0,opacity:n.active&&n.passive||r?void 0:.4}}),c4=({href:e,text:t,interactions:n,color:r})=>Yi.jsx(gS,{...l4({href:e,text:t,interactions:n,color:r}),children:t});function u4(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f4(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d4(Object(n),!0).forEach((function(t){u4(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d4(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var h4=Object.prototype.hasOwnProperty,p4=Object.prototype.toString,m4=Object.defineProperty,g4=Object.getOwnPropertyDescriptor,y4=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===p4.call(e)},v4=function(e){if(!e||"[object Object]"!==p4.call(e))return!1;var t,n=h4.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&h4.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||h4.call(e,t)},b4=function(e,t){m4&&"__proto__"===t.name?m4(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},x4=function(e,t){if("__proto__"===t){if(!h4.call(e,t))return;if(g4)return g4(e,t).value}return e[t]},w4=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=x4(s,n),s!==(i=x4(t,n))&&(u&&i&&(v4(i)||(o=y4(i)))?(o?(o=!1,a=r&&y4(r)?r:[]):a=r&&v4(r)?r:{},b4(s,{name:n,newValue:e(u,a,i)})):void 0!==i&&b4(s,{name:n,newValue:i}));return s};function S4(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let a=i.fields.indexOf(e),s=-1,l=-1;if(-1===a)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),s=i.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==l||-1!==s){a=t;break}if(Array.isArray(r)&&r.some(((e,t)=>e!==t))){const e=r.indexOf(a);-1!==e&&(a=e)}return a-=t.qArea.qLeft,a<0||a>=t.qArea.qWidth?-1:l>=0?e=>e[a].qAttrDims.qValues[l]:s>=0?e=>e[a].qAttrExps.qValues[s]:e=>e[a]}function C4(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function k4(e){let{cache:t,f:n,mainCell:r,p:i,page:o,rowIdx:a,row:s,sourceKey:l,target:c,targetProp:u,columnOrder:d}=e,f=r;if(i.field&&i.field!==n){const e=S4(i.field,o,{cache:t},d);if(-1===e)return;f=w4({qRow:a},e(s))}c[u]=C4(i,f,{key:l})}function E4(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const a=t.raw(),s=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:c,main:u}=r.normalizeConfig(i[e],t),d=Object.keys(c),f=!!i[e].trackBy,h=typeof i[e].trackBy,p={},m=[],g=[];for(let t=0;t<a.qDataPages.length;t++){const o=S4(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let y=0;y<a.qDataPages[t].qMatrix.length;y++){const v=a.qDataPages[t].qArea.qTop+y,b=w4({qRow:v},o(a.qDataPages[t].qMatrix[y])),x=C4(u,b,{key:s});if(!(u.filter&&!u.filter(b))){for(let e=0;e<d.length;e++){const r=c[d[e]];let i=r.fields||[r];r.fields&&(x[d[e]]=[]);for(let o=0;o<i.length;o++)k4({cache:n,f:l,mainCell:b,p:i[o],prop:d[e],page:a.qDataPages[t],rowIdx:v,row:a.qDataPages[t].qMatrix[y],sourceKey:s,target:r.fields?x[d[e]]:x,targetProp:r.fields?o:d[e],columnOrder:a.qColumnOrder});if(r.fields){const t=x[d[e]].map((e=>e.value)),n=x[d[e]].map((e=>e.label));x[d[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(x[d[e]].value)}}}f&&r.track({cfg:i[e],itemData:b,obj:x,target:m,tracker:p,trackType:h}),g.push(x)}}}const y=f?r.collect(m,{main:u,propsArr:d,props:c}):g;o=[...o,...y]}return o}function M4(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function _4(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=I4)):void 0===t&&(t=R4);for(var n,r,i,o,a,s=new A4(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new A4(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(P4)}function R4(e){return e.children}function I4(e){return Array.isArray(e)?e[1]:null}function D4(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function P4(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function A4(e){this.data=e,this.depth=this.height=0,this.parent=null}function O4(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}A4.prototype=_4.prototype={constructor:A4,count:function(){return this.eachAfter(M4)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;e=n.pop(),t=r.pop();for(;e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return _4(this).eachBefore(D4)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}};var L4={depth:-1},T4={},q4={};function N4(e){return e.id}function j4(e){return e.parentId}function z4(){var e,t=N4,n=j4;function r(r){var i,o,a,s,l,c,u,d,f=Array.from(r),h=t,p=n,m=new Map;if(null!=e){const t=f.map(((t,n)=>function(e){e=`${e}`;let t=e.length;W4(e,t-1)&&!W4(e,t-2)&&(e=e.slice(0,-1));return"/"===e[0]?e:`/${e}`}(e(t,n,r)))),n=t.map(F4),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(F4(e)),f.push(q4));h=(e,n)=>t[n],p=(e,t)=>n[t]}for(a=0,i=f.length;a<i;++a)o=f[a],c=f[a]=new A4(o),null!=(u=h(o,a,r))&&(u+="")&&(d=c.id=u,m.set(d,m.has(d)?T4:c)),null!=(u=p(o,a,r))&&(u+="")&&(c.parent=u);for(a=0;a<i;++a)if(u=(c=f[a]).parent){if(!(l=m.get(u)))throw new Error("missing: "+u);if(l===T4)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(s)throw new Error("multiple roots");s=c}if(!s)throw new Error("no root");if(null!=e){for(;s.data===q4&&1===s.children.length;)s=s.children[0],--i;for(let e=f.length-1;e>=0&&(c=f[e]).data===q4;--e)c.data=null}if(s.parent=L4,s.eachBefore((function(e){e.depth=e.parent.depth+1,--i})).eachBefore(P4),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=O4(e),r):t},r.parentId=function(e){return arguments.length?(n=O4(e),r):n},r.path=function(t){return arguments.length?(e=O4(t),r):e},r}function F4(e){let t=e.length;if(t<2)return"";for(;--t>1&&!W4(e,t););return e.slice(0,t)}function W4(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function $4(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let r,i=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(i)){const t=[];r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++){let n=$4(r,i[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(i)){const t=new Array(i.length);r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++)t[e]=$4(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function B4(e,t,n){let r=[];if(!e||!e.length)return r;if(t<=0){const t=n>=0?[e[n]]:e;r=[...r,...t]}else for(let i=0;i<e.length;i++)e[i].children&&e[i].children.length&&(r=[...r,...B4(e[i].children,t-1,n)]);return r}function V4(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const r=Math.max(0,Math.min(100,t-e));return e=>B4(e.children,r-1,n)}return!1}const H4=/^qDimensionInfo(?:\/(\d+))?/,U4=/^\/?qMeasureInfo\/(\d+)/,G4=/\/qAttrExprInfo\/(\d+)/,Y4=/\/qAttrDimInfo\/(\d+)/;function K4(e){const t=e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t));return t.filter((t=>t<e.qDimensionInfo.length))}function X4(e,t){let{cube:n}=t;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,c=-1,u=-1,d=r;const f=n.qEffectiveInterColumnSortOrder,h=K4(n);return H4.test(d)&&(i=!0,o=+H4.exec(d)[1],d=r.replace(H4,"")),U4.test(d)&&("K"===n.qMode?c=+U4.exec(d)[1]:f&&-1!==f.indexOf(-1)?(c=+U4.exec(d)[1],u=0):u=+U4.exec(d)[1],d=d.replace(U4,"")),d&&(Y4.exec(d)?s=+Y4.exec(d)[1]:G4.exec(d)&&(a=+G4.exec(d)[1])),l=i?"S"===n.qMode?h[o]:f?f.indexOf(o):o:f&&-1!==f.indexOf(-1)?f.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:s,attrIdx:a}}function J4(e,t){let n,r,i=V4(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?r=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function Q4(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function Z4(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields||[s];let c,u;s.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const d=l[n];let f,h,p,m,g,y;if("primitive"===d.type?(p=d.value,y=String(d.value)):("function"==typeof d.value&&(f=e=>d.value(e,r)),"function"==typeof d.label&&(h=e=>d.label(e,r)),d.accessor?(m=d.accessor(r),Array.isArray(m)?(g=m.map(d.valueAccessor),d.attrAccessor&&(g=g.map(d.attrAccessor)),f&&(p=g.map(f),f=null),h&&(y=g.map(h),h=null),p=d.reduce?d.reduce(p):p,y=d.reduceLabel?d.reduceLabel(y,p):String(p)):(p=d.attrAccessor?d.attrAccessor(d.valueAccessor(m)):d.valueAccessor(m),y=p)):(p=i,y=i)),s.fields){const e=f?f(p):p;c.push(e),u.push(h&&null!=y?h(y):null!=y?y:String(e))}else{const n=f?f(p):p;o[t[e]]={value:n,label:h?h(y):null!=y?y:String(n)},d.field&&(o[t[e]].source={field:d.field.key(),key:a})}}c&&(o[t[e]]={value:"function"==typeof s.value?s.value(c,r):c,label:"function"==typeof s.label?s.label(u,r):u})}}const e6=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=$4(r,e);return o&&o[0]?(t.tree=_4(o[0],n.children||(e=>e[i])),t.tree):null};const t6=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:a}=e;for(let e=0;e<t.length;e++){const i=n[t[e]],s=i.fields?i.fields:[i];for(let e=0;e<s.length;e++){const t=s[e];if(t.field!==a){const e=J4(o,X4(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function n6(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const i=t.raw(),o=t.key(),a="S"===i.qMode?function(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map(((e,t)=>t))}(e),r=e.fields(),i=e.fields().filter((e=>"dimension"===e.type())).map((e=>n.indexOf(r.indexOf(e)))),o=e.fields().filter((e=>"measure"===e.type())).map((e=>n.indexOf(r.indexOf(e)))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let r="__root",l=!1;for(let e=0;e<i.length;e++){var s;const t=n[i[e]],o="".concat(r,"__").concat(null!==(s=t.qElemNumber)&&void 0!==s?s:t.qElemNo);a[o]||(a[o]=f4({__id:o,__parent:r,qValues:[]},t),l=!0),r=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];a[r].qValues.push(t)}}const l=Object.keys(a).map((e=>a[e])),c=z4().id((e=>e.__id)).parentId((e=>e.__parent))(l);return c}(t):e6(i,n,e);if(!a)return null;const s=a.height,l=[];for(let o=0;o<=s;o++){let a=null;if(o>0)if("S"===i.qMode){let e=K4(i)[o-1];a=n.fields[e]}else{let e=i.qEffectiveInterColumnSortOrder[o-1];o>i.qEffectiveInterColumnSortOrder.length&&(e=i.qDimensionInfo.length),a=n.fields[e]}const{props:s,main:c}=r.normalizeConfig(f4(f4({},e),{},{field:a?a.key():void 0}),t),u=Object.keys(s);l[o]={propsArr:u,props:s,main:c};const d=a?X4(a,{cube:i}):{fieldDepth:0};t6({propsArr:u,props:s,cube:i,cache:n,itemDepthObject:d,f:a})}const c=a.copy().descendants(),u=a.descendants();for(let e=0;e<u.length;e++){const t=l[u[e].depth].propsArr,n=l[u[e].depth].props,r=l[u[e].depth].main,i=c[e],a=i.data,s=Q4(r,a,{key:o});Z4({propsArr:t,props:n,item:i,itemData:a,ret:s,sourceKey:o}),u[e].data=s}return a}function r6(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let a=0;a<i.length;a++)if(void 0!==i[a].field){const s=t.raw(),l=t.key();if(!e6(s,n,e))continue;const c="object"==typeof i[a].field?i[a].field:t.field(i[a].field),{props:u,main:d}=r.normalizeConfig(i[a],t),f=Object.keys(u),h=X4(c,{cube:s}),{nodeFn:p,attrFn:m,valueFn:g}=J4({fieldDepth:0},h);t6({propsArr:f,props:u,cube:s,cache:n,itemDepthObject:h,f:c});const y=!!i[a].trackBy,v=typeof i[a].trackBy,b={},x=[],w=p(n.tree),S=[];for(let e=0;e<w.length;e++){const t=w[e],n=m?m(g(t)):g(t);if(d.filter&&!d.filter(n))continue;const o=Q4(d,n,{key:l});Z4({propsArr:f,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[a],itemData:n,obj:o,target:x,tracker:b,trackType:v}),S.push(o)}const C=y?r.collect(x,{main:d,propsArr:f,props:u}):S;o=[...o,...C]}return o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var i6=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){
|
|
122
122
|
/*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
|
|
123
|
-
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,c,u,d,f=e.length,h=e.search(/[0-9\-\+#]/),p=h>0?e.substring(0,h):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=f-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,f):"";if(n=(t="-"===(e=e.substring(h,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=s)&&(t=(+t).toFixed(s+1)),u=e[0].split(o),e[0]=u.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-a;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(d=t[0]).length%l,f=d.length,b=0;b<f;b++)m+=d.charAt(b),!((b-y+1)%l)&&b<f-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}}));function o6(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const a6={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},s6=/%\)?$/,l6=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,c6=/^\(oct\)/i,u6=/^\(dec\)/i,d6=/^\(hex\)/i,f6=/^\(bin\)/i,h6=/^\(rom\)/i,p6=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,m6=/#|0/g;function g6(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function y6(e,t,n){let r;return l6.test(t)?e=g6(e,Number(/\d{2}/.exec(t)[0]),t,n):c6.test(t)?e=g6(e,8,t,n):u6.test(t)?e=g6(e,10,t,n):d6.test(t)?e=g6(e,16,t,n):f6.test(t)?e=g6(e,2,t,n):h6.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}function v6(e,t,n){const r=o6(e);return n?r:new RegExp(r||"",t)}function b6(e,t,n,r){let i,o,a,s,l,c,u,d,f,h=e.pattern;var p,m;r&&(e.abbreviate=!0),p=t,(m=n)&&(m=o6(m)),p&&(p=o6(p)),f=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(m,"[#0]+)?")),a=h.match(f),a=a?a[0]:"",s=a?h.substr(0,h.indexOf(a)):h,l=a?h.substring(h.indexOf(a)+a.length):"",a||(a=h?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(a=a.replace(v6(c,"g"),t)),u=n,n=".",u&&(a=a.replace(v6(u,"g"),n)),d=a.match(/#/g),d=d?d.length:0;const g=h.split(u);let y;g[1]&&(y=g[1].match(m6)),e.prefix=s||"",e.postfix=l||"",e.pattern=h,e.maxPrecision=y?y.length:2,e.percentage=s6.test(h),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(v6(t,null,!0),"|").concat(v6(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=d}class x6{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return a6;const n={};return e.qNumericalAbbreviation.split(t).forEach((e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}(e,this.patternSeparator),this.prepare()}clone(){const e=new x6(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],p6.test(e[0])&&(r.positive.isFunctional=!0),e[1]?p6.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?p6.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||b6(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&b6(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&b6(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,c,u=this._prepared,d="",f="",h=e;if(isNaN(e))return"".concat(h);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,a=u.t,u.isFunctional)e=y6(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let r,i,o=t[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&s<t.length;)s++,o=t[s];s>0&&(r=t[s-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(d=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,c||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+1e-15*(e<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=i6(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(s=i.length;s<n;s++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),f=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=i6(l,e)}e=e.replace(u.numericRegex,(e=>e===a?u.groupTemp:e===o?u.decTemp:"")),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+f+d+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function w6(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=e=>e}=t;let o,a,s=Object.create(null),l=Object.create(null),c=0,u=0;return o=r?function(){return a=i(...arguments),o.has(a)?o.get(a):o.set(a,e(...arguments))}:t=>(a=i(t),o.has(a)?o.get(a):o.set(a,e(t))),o.set=(e,t)=>(c>=n&&(delete s[l[u]],delete l[u],c--,u++),s[e]=t,l[c]=e,c++,t),o.get=e=>s[e],o.has=e=>e in s,o.clear=()=>{s=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function S6(e,t,n,r,i){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new x6(...t)}(i,e,t,n,r),a=w6(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}const C6="D",k6="T",E6="TS",M6="IV",_6=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],R6=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],I6=["January","February","March","April","May","June","July","August","September","October","November","December"],D6=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P6(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function A6(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function O6(e,t){let n,r=function(e){const t=e,n=24*A6(t),r=60*A6(n),i=60*A6(r),o=1e3*A6(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:i,h:o,m:a,s:s,f:l,t:u}}class L6{constructor(e,t,n){const r=e||{};if(r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:_6,qDayNames:R6,qLongMonthNames:I6,qMonthNames:D6}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),!t){t={[k6]:r.qTimeFmt||"hh:mm:ss",[C6]:r.qDateFmt||"YYYY-MM-DD",[E6]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]}this.pattern=t}clone(){const e=new L6(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let r;e instanceof Date?r=function(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),r=O6(e,t));const i=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:P6("".concat(t.year).slice(-2),2),YYY:P6("".concat(t.year).slice(-3),3),def:e=>P6("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:P6("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:P6("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>P6("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>P6("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>P6("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>P6("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const a=new RegExp(o.join("|"),"g"),s=t.replace(a,(e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r}));return s}}function T6(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new L6(...t)}function q6(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=T6(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=w6(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==M6?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}(e):e}function o(e){return e=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=T6(i,e,t),r=w6(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function N6(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:a,type:s,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=a||("dimension"===s?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u="dimension"===s?"first":"avg",d=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return q6(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),S6(n,r,i,o,t)}(t,i),f="dimension"===s?"first":(e,t)=>d(t),h={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>s,origin:()=>l,items:()=>(e||(e=o(h)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:e=>(null==e?void 0:e.qText)||"",reduce:u,reduceLabel:f,formatter:()=>d,tags:()=>t.qTags};return h}function j6(e,t,n,r,i){return(t[e]||[]).map(((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:N6(w4({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=j6("qAttrDimInfo",t,n,a,w4({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=j6("qAttrExprInfo",t,n,a,w4({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=j6("qMeasureInfo",t,n,a,w4({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s}))}function z6(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},i=t;if(!i)throw new Error('Missing "data" input');if(!i.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const o=z6.util,a={cache:r,cube:i,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},s={key:()=>e,raw:()=>i,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,a),fields:()=>r.fields.slice(),extract:e=>a.extractor(e,s,r,o),hierarchy:e=>a.hierarchy(e,s,r,o),_cache:()=>r};"K"===i.qMode||"T"===i.qMode||!i.qMode&&i.qNodesOnDim?(a.extractor=r6,a.hierarchy=n6,a.pages="K"===i.qMode?i.qStackedDataPages:i.qTreeDataPages):"S"===i.qMode?(a.extractor=E4,a.pages=i.qDataPages,a.hierarchy=n6):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},s,r,o);const l="S"===i.qMode?e=>e.qElemNumber:void 0,c="S"===i.qMode?e=>e.qNum:void 0;r.wrappedFields.push(...j6("qDimensionInfo",i,e,"",w4({},a,{value:l,type:"dimension"}))),r.wrappedFields.push(...j6("qMeasureInfo",i,e,"",w4({},a,{value:c,type:"measure"}))),r.fields=r.wrappedFields.map((e=>e.instance));const u=e=>{e.forEach((e=>{r.allFields.push(e.instance),u(e.measures),u(e.attrDims),u(e.attrExps)}))};return u(r.wrappedFields),(n.virtualFields||[]).forEach((t=>{const n=s.field(t.from),i=N6(f4({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>a.extractor({field:e},s,r,o),key:t.key,type:n.type(),localeInfo:a.localeInfo,value:n.value},t.override||{}));r.virtualFields.push(i)})),r.allFields.push(...r.virtualFields),s}const F6=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],W6=/\/qDimensionInfo(?:\/(\d+))?/,$6=/\/qMeasureInfo\/(\d+)/,B6=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,V6=/\/qAttrExprInfo\/(\d+)/,H6=/\/?qHyperCube/,U6=/\/?qTreeData/,G6=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),Y6=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function K6(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],a={},s=e.isActive();let l=!1;if(e.brushes().forEach((e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",a=e=>e;H6.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=G6):U6.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=Y6);let s=!0;if(W6.test(e)&&(r=+W6.exec(e)[1]),$6.test(e)&&(i=+$6.exec(e)[1]),B6.test(e)){i=-1,r=0;const e=+B6.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(V6.test(e)){const e=i;if(t){i=0;const a=$4(o,t);i+=(a.qMeasureInfo||[]).length,r>-1?(i=a.qDimensionInfo.slice(0,r).reduce(((e,t)=>e+t.qAttrExprInfo.length),i),r=-1):(i=a.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),i),i=a.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),i)),i+=+V6.exec(n)[1]}else r>-1?(r=-1,i=+V6.exec(n)[1]):i+=+V6.exec(n)[1]+1}return F6.forEach((e=>{let[t,r]=e;n=n.replace(t,r)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}}))))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,s=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||s>=o)&&o>-1?n.forEach((e=>{a.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:s-o})})):n.forEach((e=>{a.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:t.path,cols:[]}),a.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!a.selectHyperCubeCells.values.length);else{const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}})),!l&&s)return[{method:"resetMadeSelections",params:[]}];var c;a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]});return a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o}function X6(e){z6.util=e.data("matrix").util,e.data("q",z6),e.formatter("q-number",S6),e.formatter("q-time",q6)}X6.qBrushHelper=K6,X6.selections=K6;var J6=Object.prototype.hasOwnProperty,Q6=Object.prototype.toString,Z6=Object.defineProperty,e8=Object.getOwnPropertyDescriptor,t8=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Q6.call(e)},n8=function(e){if(!e||"[object Object]"!==Q6.call(e))return!1;var t,n=J6.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&J6.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||J6.call(e,t)},r8=function(e,t){Z6&&"__proto__"===t.name?Z6(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},i8=function(e,t){if("__proto__"===t){if(!J6.call(e,t))return;if(e8)return e8(e,t).value}return e[t]},o8=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=i8(s,n),s!==(i=i8(t,n))&&(u&&i&&(n8(i)||(o=t8(i)))?(o?(o=!1,a=r&&t8(r)?r:[]):a=r&&n8(r)?r:{},r8(s,{name:n,newValue:e(u,a,i)})):void 0!==i&&r8(s,{name:n,newValue:i}));return s},a8="2.10.0";function s8(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c8(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l8(Object(n),!0).forEach((function(t){s8(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l8(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u8(e){return!!e.changedTouches}function d8(e){return"number"==typeof e&&!isNaN(e)}function f8(e){return"number"!=typeof e||isNaN(e)}function h8(e){const t=e.length;let n=NaN,r=NaN,i=NaN,o=NaN;for(let a=0;a<t;a++)n=isNaN(n)?e[a].x:Math.min(n,e[a].x),r=isNaN(r)?e[a].x:Math.max(r,e[a].x),i=isNaN(i)?e[a].y:Math.min(i,e[a].y),o=isNaN(o)?e[a].y:Math.max(o,e[a].y);return[n,i,r,o]}function p8(e){return[{x:e.x1||0,y:e.y1||0},{x:e.x2||0,y:e.y2||0}]}function m8(e){return[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}]}function g8(e){const[t,n,r,i]=h8(e);return{x:t,y:n,width:r-t,height:i-n}}function y8(e){return{x1:e[0].x,y1:e[0].y,x2:e[1].x,y2:e[1].y}}function v8(e){const{x:t,y:n,width:r,height:i,x1:o,x2:a,y1:s,y2:l,cx:c,cy:u,r:d,vertices:f}=e||{};return d8(c)&&d8(u)&&d8(d)?"circle":d8(o)&&d8(a)&&d8(s)&&d8(l)?"line":d8(t)&&d8(n)&&d8(r)&&d8(i)?"rect":d8(t)&&d8(n)?"point":Array.isArray(f)?f.every((e=>Array.isArray(e)))?"geopolygon":"polygon":null}function b8(e,t){return{x:t.x-e,y:t.y-e,width:t.width+e,height:t.height+e}}var x8=Math.PI,w8=2*x8,S8=1e-6,C8=w8-S8;function k8(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function E8(){return new k8}function M8(e){return function(){return e}}k8.prototype=E8.prototype={constructor:k8,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,o){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var o=this._x1,a=this._y1,s=n-e,l=r-t,c=o-e,u=a-t,d=c*c+u*u;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(d>S8)if(Math.abs(u*s-l*c)>S8&&i){var f=n-o,h=r-a,p=s*s+l*l,m=f*f+h*h,g=Math.sqrt(p),y=Math.sqrt(d),v=i*Math.tan((x8-Math.acos((p+d-m)/(2*g*y)))/2),b=v/y,x=v/g;Math.abs(b-1)>S8&&(this._+="L"+(e+b*c)+","+(t+b*u)),this._+="A"+i+","+i+",0,0,"+ +(u*f>c*h)+","+(this._x1=e+x*s)+","+(this._y1=t+x*l)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,n,r,i,o){e=+e,t=+t,o=!!o;var a=(n=+n)*Math.cos(r),s=n*Math.sin(r),l=e+a,c=t+s,u=1^o,d=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)>S8||Math.abs(this._y1-c)>S8)&&(this._+="L"+l+","+c),n&&(d<0&&(d=d%w8+w8),d>C8?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-s)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):d>S8&&(this._+="A"+n+","+n+",0,"+ +(d>=x8)+","+u+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var _8=Math.abs,R8=Math.atan2,I8=Math.cos,D8=Math.max,P8=Math.min,A8=Math.sin,O8=Math.sqrt,L8=1e-12,T8=Math.PI,q8=T8/2,N8=2*T8;function j8(e){return e>=1?q8:e<=-1?-q8:Math.asin(e)}function z8(e){return e.innerRadius}function F8(e){return e.outerRadius}function W8(e){return e.startAngle}function $8(e){return e.endAngle}function B8(e){return e&&e.padAngle}function V8(e,t,n,r,i,o,a){var s=e-n,l=t-r,c=(a?o:-o)/O8(s*s+l*l),u=c*l,d=-c*s,f=e+u,h=t+d,p=n+u,m=r+d,g=(f+p)/2,y=(h+m)/2,v=p-f,b=m-h,x=v*v+b*b,w=i-o,S=f*m-p*h,C=(b<0?-1:1)*O8(D8(0,w*w*x-S*S)),k=(S*b-v*C)/x,E=(-S*v-b*C)/x,M=(S*b+v*C)/x,_=(-S*v+b*C)/x,R=k-g,I=E-y,D=M-g,P=_-y;return R*R+I*I>D*D+P*P&&(k=M,E=_),{cx:k,cy:E,x01:-u,y01:-d,x11:k*(i/w-1),y11:E*(i/w-1)}}function H8(){var e=z8,t=F8,n=M8(0),r=null,i=W8,o=$8,a=B8,s=null;function l(){var l,c,u=+e.apply(this,arguments),d=+t.apply(this,arguments),f=i.apply(this,arguments)-q8,h=o.apply(this,arguments)-q8,p=_8(h-f),m=h>f;if(s||(s=l=E8()),d<u&&(c=d,d=u,u=c),d>L8)if(p>N8-L8)s.moveTo(d*I8(f),d*A8(f)),s.arc(0,0,d,f,h,!m),u>L8&&(s.moveTo(u*I8(h),u*A8(h)),s.arc(0,0,u,h,f,m));else{var g,y,v=f,b=h,x=f,w=h,S=p,C=p,k=a.apply(this,arguments)/2,E=k>L8&&(r?+r.apply(this,arguments):O8(u*u+d*d)),M=P8(_8(d-u)/2,+n.apply(this,arguments)),_=M,R=M;if(E>L8){var I=j8(E/u*A8(k)),D=j8(E/d*A8(k));(S-=2*I)>L8?(x+=I*=m?1:-1,w-=I):(S=0,x=w=(f+h)/2),(C-=2*D)>L8?(v+=D*=m?1:-1,b-=D):(C=0,v=b=(f+h)/2)}var P=d*I8(v),A=d*A8(v),O=u*I8(w),L=u*A8(w);if(M>L8){var T,q=d*I8(b),N=d*A8(b),j=u*I8(x),z=u*A8(x);if(p<T8&&(T=function(e,t,n,r,i,o,a,s){var l=n-e,c=r-t,u=a-i,d=s-o,f=d*l-u*c;if(!(f*f<L8))return[e+(f=(u*(t-o)-d*(e-i))/f)*l,t+f*c]}(P,A,j,z,q,N,O,L))){var F=P-T[0],W=A-T[1],$=q-T[0],B=N-T[1],V=1/A8(function(e){return e>1?0:e<-1?T8:Math.acos(e)}((F*$+W*B)/(O8(F*F+W*W)*O8($*$+B*B)))/2),H=O8(T[0]*T[0]+T[1]*T[1]);_=P8(M,(u-H)/(V-1)),R=P8(M,(d-H)/(V+1))}}C>L8?R>L8?(g=V8(j,z,P,A,d,R,m),y=V8(q,N,O,L,d,R,m),s.moveTo(g.cx+g.x01,g.cy+g.y01),R<M?s.arc(g.cx,g.cy,R,R8(g.y01,g.x01),R8(y.y01,y.x01),!m):(s.arc(g.cx,g.cy,R,R8(g.y01,g.x01),R8(g.y11,g.x11),!m),s.arc(0,0,d,R8(g.cy+g.y11,g.cx+g.x11),R8(y.cy+y.y11,y.cx+y.x11),!m),s.arc(y.cx,y.cy,R,R8(y.y11,y.x11),R8(y.y01,y.x01),!m))):(s.moveTo(P,A),s.arc(0,0,d,v,b,!m)):s.moveTo(P,A),u>L8&&S>L8?_>L8?(g=V8(O,L,q,N,u,-_,m),y=V8(P,A,j,z,u,-_,m),s.lineTo(g.cx+g.x01,g.cy+g.y01),_<M?s.arc(g.cx,g.cy,_,R8(g.y01,g.x01),R8(y.y01,y.x01),!m):(s.arc(g.cx,g.cy,_,R8(g.y01,g.x01),R8(g.y11,g.x11),!m),s.arc(0,0,u,R8(g.cy+g.y11,g.cx+g.x11),R8(y.cy+y.y11,y.cx+y.x11),m),s.arc(y.cx,y.cy,_,R8(y.y11,y.x11),R8(y.y01,y.x01),!m))):s.arc(0,0,u,w,x,m):s.lineTo(O,L)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-T8/2;return[I8(r)*n,A8(r)*n]},l.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:M8(+t),l):e},l.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:M8(+e),l):t},l.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:M8(+e),l):n},l.padRadius=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:M8(+e),l):r},l.startAngle=function(e){return arguments.length?(i="function"==typeof e?e:M8(+e),l):i},l.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:M8(+e),l):o},l.padAngle=function(e){return arguments.length?(a="function"==typeof e?e:M8(+e),l):a},l.context=function(e){return arguments.length?(s=null==e?null:e,l):s},l}function U8(e){this._context=e}function G8(e){return new U8(e)}function Y8(e){return e[0]}function K8(e){return e[1]}function X8(){var e=Y8,t=null,n=M8(0),r=K8,i=M8(!0),o=null,a=G8,s=null;function l(l){var c,u,d,f,h,p=l.length,m=!1,g=new Array(p),y=new Array(p);for(null==o&&(s=a(h=E8())),c=0;c<=p;++c){if(!(c<p&&i(f=l[c],c,l))===m)if(m=!m)u=c,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=c-1;d>=u;--d)s.point(g[d],y[d]);s.lineEnd(),s.areaEnd()}m&&(g[c]=+e(f,c,l),y[c]=+n(f,c,l),s.point(t?+t(f,c,l):g[c],r?+r(f,c,l):y[c]))}if(h)return s=null,h+""||null}function c(){return function(){var e=Y8,t=K8,n=M8(!0),r=null,i=G8,o=null;function a(a){var s,l,c,u=a.length,d=!1;for(null==r&&(o=i(c=E8())),s=0;s<=u;++s)!(s<u&&n(l=a[s],s,a))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+e(l,s,a),+t(l,s,a));if(c)return o=null,c+""||null}return a.x=function(t){return arguments.length?(e="function"==typeof t?t:M8(+t),a):e},a.y=function(e){return arguments.length?(t="function"==typeof e?e:M8(+e),a):t},a.defined=function(e){return arguments.length?(n="function"==typeof e?e:M8(!!e),a):n},a.curve=function(e){return arguments.length?(i=e,null!=r&&(o=i(r)),a):i},a.context=function(e){return arguments.length?(null==e?r=o=null:o=i(r=e),a):r},a}().defined(i).curve(a).context(o)}return l.x=function(n){return arguments.length?(e="function"==typeof n?n:M8(+n),t=null,l):e},l.x0=function(t){return arguments.length?(e="function"==typeof t?t:M8(+t),l):e},l.x1=function(e){return arguments.length?(t=null==e?null:"function"==typeof e?e:M8(+e),l):t},l.y=function(e){return arguments.length?(n="function"==typeof e?e:M8(+e),r=null,l):n},l.y0=function(e){return arguments.length?(n="function"==typeof e?e:M8(+e),l):n},l.y1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:M8(+e),l):r},l.lineX0=l.lineY0=function(){return c().x(e).y(n)},l.lineY1=function(){return c().x(e).y(r)},l.lineX1=function(){return c().x(t).y(n)},l.defined=function(e){return arguments.length?(i="function"==typeof e?e:M8(!!e),l):i},l.curve=function(e){return arguments.length?(a=e,null!=o&&(s=a(o)),l):a},l.context=function(e){return arguments.length?(null==e?o=s=null:s=a(o=e),l):o},l}function J8(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function Q8(e){return e}U8.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var Z8=Array.prototype.slice;function e7(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function t7(e){this._context=e}function n7(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function r7(e,t){this._context=e,this._k=(1-t)/6}t7.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:e7(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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);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:e7(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},r7.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:n7(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:n7(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var i7=function e(t){function n(e){return new r7(e,t)}return n.tension=function(t){return e(+t)},n}(0);function o7(e,t){this._context=e,this._alpha=t}o7.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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;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(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:!function(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>L8){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>L8){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,o,a,e._x2,e._y2)}(this,e,t)}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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var a7=function e(t){function n(e){return t?new o7(e,t):new r7(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function s7(e){return e<0?-1:1}function l7(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(s7(o)+s7(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function c7(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function u7(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function d7(e){this._context=e}function f7(e){this._context=new h7(e)}function h7(e){this._context=e}function p7(e){this._context=e}function m7(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,o[r-1]=7,a[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/o[t-1],o[t]-=n,a[t]-=n*a[t-1];for(i[r-1]=a[r-1]/o[r-1],t=r-2;t>=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function g7(e,t){this._context=e,this._t=t}function y7(e,t){if((i=e.length)>1)for(var n,r,i,o=1,a=e[t[0]],s=a.length;o<i;++o)for(r=a,a=e[t[o]],n=0;n<s;++n)a[n][1]+=a[n][0]=isNaN(r[n][1])?r[n][0]:r[n][1]}function v7(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function b7(e,t){return e[t]}function x7(e){for(var t,n=-1,r=0,i=e.length,o=-1/0;++n<i;)(t=+e[n][1])>o&&(o=t,r=n);return r}function w7(e){for(var t,n=0,r=-1,i=e.length;++r<i;)(t=+e[r][1])&&(n+=t);return n}function S7(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unspecified",r=arguments.length>2?arguments[2]:void 0;const i={},o=e||{get:()=>{},has:()=>!1,default:()=>{}};function a(e,t){if(!e||"string"!=typeof e)throw new TypeError("Invalid argument: key must be a non-empty string");return!(e in i)&&(i[e]=t,!0)}function s(e){return i[e]||o.get(e)}function l(e,i){if(void 0!==i)return a(e,i);const o=s(e);return r&&void 0===o&&r.warn("".concat(e," does not exist in ").concat(n," registry")),o||s(t)}return t=o.default(),l.add=a,l.get=s,l.has=function(e){return!!i[e]||o.has(e)},l.remove=function(e){const t=i[e];return delete i[e],t},l.getKeys=function(){return Object.keys(i)},l.getValues=function(){return Object.keys(i).map((e=>i[e]))},l.default=function(e){return void 0!==e&&(t=e),t},l.register=a,l}function C7(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function k7(e){return(e=C7(Math.abs(e)))?e[1]:NaN}d7.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:u7(this,this._t0,c7(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,u7(this,c7(this,n=l7(this,e,t)),n);break;default:u7(this,this._t0,n=l7(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(f7.prototype=Object.create(d7.prototype)).point=function(e,t){d7.prototype.point.call(this,t,e)},h7.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}},p7.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var r=m7(e),i=m7(t),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[a],t[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},g7.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var E7,M7=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function _7(e){if(!(t=M7.exec(e)))throw new Error("invalid format: "+e);var t;return new R7({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function R7(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function I7(e,t){var n=C7(e,t);if(!n)return e+"";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")}_7.prototype=R7.prototype,R7.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};var D7={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>I7(100*e,t),r:I7,s:function(e,t){var n=C7(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(E7=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+C7(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function P7(e){return e}var A7,O7,L7,T7=Array.prototype.map,q7=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function N7(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?P7:(t=T7.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(e.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?P7:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(T7.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function d(e){var t=(e=_7(e)).fill,n=e.align,d=e.sign,f=e.symbol,h=e.zero,p=e.width,m=e.comma,g=e.precision,y=e.trim,v=e.type;"n"===v?(m=!0,v="g"):D7[v]||(void 0===g&&(g=12),y=!0,v="g"),(h||"0"===t&&"="===n)&&(h=!0,t="0",n="=");var b="$"===f?i:"#"===f&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===f?o:/[%p]/.test(v)?l:"",w=D7[v],S=/[defgprs%]/.test(v);function C(e){var i,o,l,f=b,C=x;if("c"===v)C=w(e)+C,e="";else{var k=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:w(Math.abs(e),g),y&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(!+e[r])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),k&&0==+e&&"+"!==d&&(k=!1),f=(k?"("===d?d:c:"-"===d||"("===d?"":d)+f,C=("s"===v?q7[8+E7/3]:"")+C+(k&&"("===d?")":""),S)for(i=-1,o=e.length;++i<o;)if(48>(l=e.charCodeAt(i))||l>57){C=(46===l?a+e.slice(i+1):e.slice(i))+C,e=e.slice(0,i);break}}m&&!h&&(e=r(e,1/0));var E=f.length+e.length+C.length,M=E<p?new Array(p-E+1).join(t):"";switch(m&&h&&(e=r(M+e,M.length?p-C.length:1/0),M=""),n){case"<":e=f+e+C+M;break;case"=":e=f+M+e+C;break;case"^":e=M.slice(0,E=M.length>>1)+f+e+C+M.slice(E);break;default:e=M+f+e+C}return s(e)}return g=void 0===g?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),C.toString=function(){return e+""},C}return{format:d,formatPrefix:function(e,t){var n=d(((e=_7(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(k7(t)/3))),i=Math.pow(10,-r),o=q7[8+r/3];return function(e){return n(i*e)+o}}}}!function(e){A7=N7(e),O7=A7.format,L7=A7.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const j7=new Date,z7=new Date;function F7(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{const t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),i.range=(n,r,o)=>{const a=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return a;let s;do{a.push(s=new Date(+n)),t(n,o),e(n)}while(s<n&&n<r);return a},i.filter=n=>F7((t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),((e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););})),n&&(i.count=(t,r)=>(j7.setTime(+t),z7.setTime(+r),e(j7),e(z7),Math.floor(n(j7,z7))),i.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?t=>r(t)%e==0:t=>i.count(0,t)%e==0):i:null)),i}const W7=6e4,$7=864e5,B7=6048e5,V7=F7((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*W7)/$7),(e=>e.getDate()-1));V7.range;const H7=F7((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/$7),(e=>e.getUTCDate()-1));H7.range;const U7=F7((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/$7),(e=>Math.floor(e/$7)));function G7(e){return F7((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*W7)/B7))}U7.range;const Y7=G7(0),K7=G7(1),X7=G7(2),J7=G7(3),Q7=G7(4),Z7=G7(5),e9=G7(6);function t9(e){return F7((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/B7))}Y7.range,K7.range,X7.range,J7.range,Q7.range,Z7.range,e9.range;const n9=t9(0),r9=t9(1),i9=t9(2),o9=t9(3),a9=t9(4),s9=t9(5),l9=t9(6);n9.range,r9.range,i9.range,o9.range,a9.range,s9.range,l9.range;const c9=F7((e=>{e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear()));c9.every=e=>isFinite(e=Math.floor(e))&&e>0?F7((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n*e)})):null,c9.range;const u9=F7((e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));function d9(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function f9(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function h9(e){let t,n,r;function i(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<0?i=t+1:o=t}while(i<o)}return i}return 2!==e.length?(t=d9,n=(t,n)=>d9(e(t),n),r=(t,n)=>e(t)-n):(t=e===d9||e===f9?e:p9,n=e,r=e),{left:i,center:function(e,t,n=0,o=e.length){const a=i(e,t,n,o-1);return a>n&&r(e[a-1],t)>-r(e[a],t)?a-1:a},right:function(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<=0?i=t+1:o=t}while(i<o)}return i}}}function p9(){return 0}u9.every=e=>isFinite(e=Math.floor(e))&&e>0?F7((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null,u9.range;const m9=h9(d9).right;h9((function(e){return null===e?NaN:+e})).center;var g9=m9;class y9 extends Map{constructor(e,t=b9){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,n]of e)this.set(t,n)}get(e){return super.get(v9(this,e))}has(e){return super.has(v9(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},n){const r=t(n);e.has(r)&&(n=e.get(r),e.delete(r));return n}(this,e))}}function v9({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function b9(e){return null!==e&&"object"==typeof e?e.valueOf():e}const x9=Math.sqrt(50),w9=Math.sqrt(10),S9=Math.sqrt(2);function C9(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=x9?10:o>=w9?5:o>=S9?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/a,s=Math.round(e*c),l=Math.round(t*c),s/c<e&&++s,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*a,s=Math.round(e/c),l=Math.round(t/c),s*c<e&&++s,l*c>t&&--l),l<s&&.5<=n&&n<2?C9(e,t,2*n):[s,l,c]}function k9(e,t,n){return C9(e=+e,t=+t,n=+n)[2]}function E9(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function M9(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function _9(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function R9(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,c=T9(i),u=q9(i),d=T9(o),f=q9(o),h=T9(a),p=q9(a),m=T9(s),g=q9(s),y=T9(l),v=q9(l),b={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:ree,e:ree,f:lee,g:bee,G:wee,H:iee,I:oee,j:aee,L:see,m:cee,M:uee,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Vee,s:Hee,S:dee,u:fee,U:hee,V:mee,w:gee,W:yee,x:null,X:null,y:vee,Y:xee,Z:See,"%":Bee},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:Cee,e:Cee,f:Ree,g:zee,G:Wee,H:kee,I:Eee,j:Mee,L:_ee,m:Iee,M:Dee,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Vee,s:Hee,S:Pee,u:Aee,U:Oee,V:Tee,w:qee,W:Nee,x:null,X:null,y:jee,Y:Fee,Z:$ee,"%":Bee},w={a:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return k(e,t,n,r)},d:G9,e:G9,f:Z9,g:B9,G:$9,H:K9,I:K9,j:Y9,L:Q9,m:U9,M:X9,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1},q:H9,Q:tee,s:nee,S:J9,u:j9,U:z9,V:F9,w:N9,W:W9,x:function(e,t,r){return k(e,n,t,r)},X:function(e,t,n){return k(e,r,t,n)},y:B9,Y:$9,Z:V9,"%":eee};function S(e,t){return function(n){var r,i,o,a=[],s=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++s<c;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(i=I9[r=e.charAt(++s)])?r=e.charAt(++s):i="e"===r?" ":"0",(o=t[r])&&(r=o(n,i)),a.push(r),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function C(e,t){return function(n){var r,i,o=_9(1900,void 0,1);if(k(o,e,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(t&&!("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=M9(_9(o.y,0,1))).getUTCDay(),r=i>4||0===i?r9.ceil(r):r9(r),r=H7.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=E9(_9(o.y,0,1))).getDay(),r=i>4||0===i?K7.ceil(r):K7(r),r=V7.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?M9(_9(o.y,0,1)).getUTCDay():E9(_9(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,M9(o)):E9(o)}}function k(e,t,n,r){for(var i,o,a=0,s=t.length,l=n.length;a<s;){if(r>=l)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=w[i in I9?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=S(n,b),b.X=S(r,b),b.c=S(t,b),x.x=S(n,x),x.X=S(r,x),x.c=S(t,x),{format:function(e){var t=S(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=C(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+="",!0);return t.toString=function(){return e},t}}}var I9={"-":"",_:" ",0:"0"},D9=/^\s*\d+/,P9=/^%/,A9=/[\\^$*+?|[\]().{}]/g;function O9(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function L9(e){return e.replace(A9,"\\$&")}function T9(e){return new RegExp("^(?:"+e.map(L9).join("|")+")","i")}function q9(e){return new Map(e.map(((e,t)=>[e.toLowerCase(),t])))}function N9(e,t,n){var r=D9.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function j9(e,t,n){var r=D9.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function z9(e,t,n){var r=D9.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function F9(e,t,n){var r=D9.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function W9(e,t,n){var r=D9.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function $9(e,t,n){var r=D9.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function B9(e,t,n){var r=D9.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function V9(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function H9(e,t,n){var r=D9.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function U9(e,t,n){var r=D9.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function G9(e,t,n){var r=D9.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Y9(e,t,n){var r=D9.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function K9(e,t,n){var r=D9.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function X9(e,t,n){var r=D9.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function J9(e,t,n){var r=D9.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Q9(e,t,n){var r=D9.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Z9(e,t,n){var r=D9.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function eee(e,t,n){var r=P9.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function tee(e,t,n){var r=D9.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function nee(e,t,n){var r=D9.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function ree(e,t){return O9(e.getDate(),t,2)}function iee(e,t){return O9(e.getHours(),t,2)}function oee(e,t){return O9(e.getHours()%12||12,t,2)}function aee(e,t){return O9(1+V7.count(c9(e),e),t,3)}function see(e,t){return O9(e.getMilliseconds(),t,3)}function lee(e,t){return see(e,t)+"000"}function cee(e,t){return O9(e.getMonth()+1,t,2)}function uee(e,t){return O9(e.getMinutes(),t,2)}function dee(e,t){return O9(e.getSeconds(),t,2)}function fee(e){var t=e.getDay();return 0===t?7:t}function hee(e,t){return O9(Y7.count(c9(e)-1,e),t,2)}function pee(e){var t=e.getDay();return t>=4||0===t?Q7(e):Q7.ceil(e)}function mee(e,t){return e=pee(e),O9(Q7.count(c9(e),e)+(4===c9(e).getDay()),t,2)}function gee(e){return e.getDay()}function yee(e,t){return O9(K7.count(c9(e)-1,e),t,2)}function vee(e,t){return O9(e.getFullYear()%100,t,2)}function bee(e,t){return O9((e=pee(e)).getFullYear()%100,t,2)}function xee(e,t){return O9(e.getFullYear()%1e4,t,4)}function wee(e,t){var n=e.getDay();return O9((e=n>=4||0===n?Q7(e):Q7.ceil(e)).getFullYear()%1e4,t,4)}function See(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+O9(t/60|0,"0",2)+O9(t%60,"0",2)}function Cee(e,t){return O9(e.getUTCDate(),t,2)}function kee(e,t){return O9(e.getUTCHours(),t,2)}function Eee(e,t){return O9(e.getUTCHours()%12||12,t,2)}function Mee(e,t){return O9(1+H7.count(u9(e),e),t,3)}function _ee(e,t){return O9(e.getUTCMilliseconds(),t,3)}function Ree(e,t){return _ee(e,t)+"000"}function Iee(e,t){return O9(e.getUTCMonth()+1,t,2)}function Dee(e,t){return O9(e.getUTCMinutes(),t,2)}function Pee(e,t){return O9(e.getUTCSeconds(),t,2)}function Aee(e){var t=e.getUTCDay();return 0===t?7:t}function Oee(e,t){return O9(n9.count(u9(e)-1,e),t,2)}function Lee(e){var t=e.getUTCDay();return t>=4||0===t?a9(e):a9.ceil(e)}function Tee(e,t){return e=Lee(e),O9(a9.count(u9(e),e)+(4===u9(e).getUTCDay()),t,2)}function qee(e){return e.getUTCDay()}function Nee(e,t){return O9(r9.count(u9(e)-1,e),t,2)}function jee(e,t){return O9(e.getUTCFullYear()%100,t,2)}function zee(e,t){return O9((e=Lee(e)).getUTCFullYear()%100,t,2)}function Fee(e,t){return O9(e.getUTCFullYear()%1e4,t,4)}function Wee(e,t){var n=e.getUTCDay();return O9((e=n>=4||0===n?a9(e):a9.ceil(e)).getUTCFullYear()%1e4,t,4)}function $ee(){return"+0000"}function Bee(){return"%"}function Vee(e){return+e}function Hee(e){return Math.floor(+e/1e3)}const Uee=S7();Uee("d3-number",(function(e,t,n){let r,i;function o(e){return i(e)}function a(){o.locale({decimal:n||".",thousands:t||",",grouping:[3],currency:["$",""]})}return o.locale=function(t){return r=N7(t),i=r.format(e),this},a(),o.format=function(e,i,o,s){return(o||s)&&(t=o,n=s,a()),r.format(e)(i)},o.pattern=function(t){return t&&(e=t,i=r.format(t)),e},o})),Uee("d3-time",(function(e){let t=R9({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"]}),n=t.format(e);function r(e){return n(e)}return r.format=function(e,n){return t.format(e)(n)},r.locale=function(){return t=R9(...arguments),n=t.format(e),this},r.parse=function(e,n){return t.parse(e)(n)},r.parsePattern=function(e){return t.parse(e)},r}));const Gee={id:e=>"".concat(e.source,"/").concat(e.key||e.title),key:e=>String(e.key||e.title),tags:e=>e.tags,min:e=>e.min,max:e=>e.max,type:e=>e.type,title:e=>String(e.title),values:e=>e.values,value:e=>e,label:e=>e,formatter:e=>(e=>{if("function"==typeof e.formatter)return e.formatter();const t=e.formatter||{};return Uee(t.type||"d3-number")(t.format||"")})(e)};function Yee(e){let{id:t=Gee.id,key:n=Gee.key,min:r=Gee.min,max:i=Gee.max,type:o=Gee.type,tags:a=Gee.tags,title:s=Gee.title,values:l=Gee.values,value:c=Gee.value,label:u=Gee.label,formatter:d=Gee.formatter}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{id:()=>t(e),key:()=>n(e),raw:()=>e,tags:()=>a(e),type:()=>o(e),min:()=>r(e),max:()=>i(e),title:()=>s(e),items:()=>l(e),formatter:()=>d(e),value:c,label:u}}const Kee=e=>e.filter((e=>"number"==typeof e&&!isNaN(e))),Xee=e=>e.reduce(((e,t)=>e+t),0),Jee={first:e=>e[0],last:e=>e[e.length-1],min:e=>{const t=Kee(e);return t.length?Math.min.apply(null,t):NaN},max:e=>{const t=Kee(e);return t.length?Math.max.apply(null,t):NaN},sum:e=>{const t=Kee(e);return t.length?t.reduce(((e,t)=>e+t),0):NaN},avg:e=>{const t=Kee(e),n=t.length;return n?Xee(t)/n:NaN}};function Qee(e,t,n,r){const i={},o=r.field||(void 0!==e.field?t.field(e.field):null);return Object.keys(n).forEach((a=>{const s=n[a],l=i[a]={};-1!==["number","string","boolean"].indexOf(typeof s)?(l.type="primitive",l.value=s):"function"==typeof s?(l.type="function",l.value=s,l.label=s,l.field=o):"object"==typeof s&&(s.fields?l.fields=s.fields.map((n=>Qee(e,t,{main:n},r).main)):void 0!==s.field?(l.type="field",l.field=t.field(s.field),l.value=l.field.value,l.label=l.field.label):o&&(l.value=o.value,l.label=o.label,l.field=o),"function"==typeof s.filter&&(l.filter=s.filter),void 0!==s.value&&(l.value=s.value),void 0!==s.label&&(l.label=s.label),"function"==typeof s.reduce?l.reduce=s.reduce:s.reduce?l.reduce=Jee[s.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?Jee[l.field.reduce]:l.field.reduce),"function"==typeof s.reduceLabel?l.reduceLabel=s.reduceLabel:s.reduceLabel?l.reduceLabel=Jee[s.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?Jee[l.field.reduceLabel]:l.field.reduceLabel))})),i}function Zee(e,t){const{main:n}=Qee(e,t,{main:{value:e.value,label:e.label,reduce:e.reduce,filter:e.filter}},{});return{props:Qee(e,t,e.props||{},n),main:n}}function ete(e,t,n,r){const i=Array(e.length),o=Array(e.length);let a;for(let t=0;t<e.length;t++)a=r?e[t][r]:e[t],i[t]=a.value,o[t]=a.label;const s=t.reduce,l=t.reduceLabel,c=s?s(i):i,u={value:c,label:l?l(o,c):n?n(c):String(c)};return r&&e[0][r].source?(u.source=e[0][r].source,u):!r&&e[0].source?(u.source=e[0].source,u):u}function tte(e,t){let{main:n,propsArr:r,props:i}=t,o=[];const a=n.field.formatter(),s={};return r.forEach((e=>{s[e]=i[e].field?i[e].field.formatter():e=>e})),o.push(...e.map((e=>{const t=ete(e.items,n,a);return r.forEach((n=>{t[n]=ete(e.items,i[n],s[n],n)})),t}))),o}function nte(e){let{cfg:t,itemData:n,obj:r,target:i,tracker:o,trackType:a}=e;const s="function"===a?t.trackBy(n):n[t.trackBy];let l=o[s];l||(l=o[s]={items:[],id:s},i.push(l)),l.items.push(r)}function rte(e){if(e.length<1e4)return Math.max(...e);let t=-1/0;const n=e.length;for(let r=0;r<n;r++)t<e[r]&&(t=e[r]);return t}function ite(e){if(e.length<1e4)return Math.min(...e);let t=1/0;const n=e.length;for(let r=0;r<n;r++)t>e[r]&&(t=e[r]);return t}const ote={diverging:function(e,t){if((s=e.length)>0)for(var n,r,i,o,a,s,l=0,c=e[t[0]].length;l<c;++l)for(o=a=0,n=0;n<s;++n)(i=(r=e[t[n]][l])[1]-r[0])>=0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=a,r[0]=a+=i):r[0]=o},none:y7,silhouette:function(e,t){if((n=e.length)>0){for(var n,r=0,i=e[t[0]],o=i.length;r<o;++r){for(var a=0,s=0;a<n;++a)s+=e[a][r][1]||0;i[r][1]+=i[r][0]=-s/2}y7(e,t)}},expand:function(e,t){if((r=e.length)>0){for(var n,r,i,o=0,a=e[0].length;o<a;++o){for(i=n=0;n<r;++n)i+=e[n][o][1]||0;if(i)for(n=0;n<r;++n)e[n][o][1]/=i}y7(e,t)}},wiggle:function(e,t){if((i=e.length)>0&&(r=(n=e[t[0]]).length)>0){for(var n,r,i,o=0,a=1;a<r;++a){for(var s=0,l=0,c=0;s<i;++s){for(var u=e[t[s]],d=u[a][1]||0,f=(d-(u[a-1][1]||0))/2,h=0;h<s;++h){var p=e[t[h]];f+=(p[a][1]||0)-(p[a-1][1]||0)}l+=d,c+=f*d}n[a-1][1]+=n[a-1][0]=o,l&&(o-=c/l)}n[a-1][1]+=n[a-1][0]=o,y7(e,t)}}},ate={ascending:function(e){var t=e.map(w7);return v7(e).sort((function(e,n){return t[e]-t[n]}))},insideout:function(e){var t,n,r=e.length,i=e.map(w7),o=function(e){var t=e.map(x7);return v7(e).sort((function(e,n){return t[e]-t[n]}))}(e),a=0,s=0,l=[],c=[];for(t=0;t<r;++t)n=o[t],a<s?(a+=i[n],l.push(n)):(s+=i[n],c.push(n));return c.reverse().concat(l)},none:v7,reverse:function(e){return v7(e).reverse()}};function ste(e,t,n,r){const i=r||e.items,o={},a=t.stackKey,s=t.value,l=t.startProp||"start",c=t.endProp||"end",u=t.offset||"none",d=t.order||"none",f=t.valueRef||"";let h=0,p={};for(let e=0;e<i.length;e++){let t=i[e],n=f?t[f]:null;if(n&&n.source){let e="".concat(n.source.key||"","/").concat(n.source.field);p[e]||(p[e]=n.source)}let r=a(t);o[r]=o[r]||{items:[]},o[r].items.push(t),h=Math.max(h,o[r].items.length)}const m=Array.apply(null,{length:h}).map(Number.call,Number),g=Object.keys(o).map((e=>o[e].items)),y=function(){var e=M8([]),t=v7,n=y7,r=b7;function i(i){var o,a,s=e.apply(this,arguments),l=i.length,c=s.length,u=new Array(c);for(o=0;o<c;++o){for(var d,f=s[o],h=u[o]=new Array(l),p=0;p<l;++p)h[p]=d=[0,+r(i[p],f,p,i)],d.data=i[p];h.key=f}for(o=0,a=t(u);o<c;++o)u[a[o]].index=o;return n(u,a),u}return i.keys=function(t){return arguments.length?(e="function"==typeof t?t:M8(Z8.call(t)),i):e},i.value=function(e){return arguments.length?(r="function"==typeof e?e:M8(+e),i):r},i.order=function(e){return arguments.length?(t=null==e?v7:"function"==typeof e?e:M8(Z8.call(e)),i):t},i.offset=function(e){return arguments.length?(n=null==e?y7:e,i):n},i}().keys(m).value(((e,t)=>e[t]?s(e[t]):0)).order(ate[d]).offset(ote[u]);let v=y(g),b=[];for(let e=0;e<v.length;e++){let t=v[e];for(let e=0;e<t.length;e++){let n=t[e],r=t[e].data[t.key];r&&(r[l]={value:n[0]},r[c]={value:n[1]},b.push(n[0],n[1]))}}let x=Object.keys(p).map((e=>{let t=n(p[e].key);return t?t.field(p[e].field):null})).filter((e=>!!e));const w=Yee({title:x.map((e=>e.title())).join(", "),min:ite(b),max:rte(b),type:"measure",formatter:x[0]?x[0].formatter:void 0});e.fields.push(w)}function lte(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};const r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).logger;if(Array.isArray(e))n.items=e.map((e=>({value:e,label:String(e)})));else if(e){if("collection"in e)n=c8({},t.collection(e.collection));else{const i=t.dataset?t.dataset(e.source):null;let o=e.value||(e=>e),a=e.label||(e=>e);if(e.groupBy||e.mapTo)r.warn('Deprecated "data" configuration',e),n.items=[];else if(e.hierarchy)n.root=i.hierarchy?i.hierarchy(e.hierarchy):null,n.fields=i.fields();else if(e.items)n.items=e.skipNormalize?e.items:e.items.map((e=>({value:o(e),label:String(a(e))})));else if(e.extract){const r=Array.isArray(e.extract)?e.extract:[e.extract];n.items=[];const o=[];r.forEach((e=>{const r=e.source?t.dataset(e.source):i;r&&(n.items=[...n.items,...r.extract(e)],void 0!==e.field&&o.push(r.field(e.field)))})),o.length&&(n.fields=o),e.amend&&Array.isArray(e.amend)&&(n.items=[...n.items,...e.amend])}else if(void 0!==e.field&&i){const t=i.field(e.field);t&&(n.fields||(n.fields=[]),n.fields.push(t),"value"in e||(o=t.value||(e=>e),a=t.label||(e=>e),n.value=o),n.items=t.items().map((t=>({value:o(t),label:String(a(t)),source:{field:e.field}}))))}else e.fields&&e.fields.forEach((e=>{const r="object"==typeof e&&e.source?t.dataset(e.source):i;if(!r)return;let o;o="object"==typeof e&&void 0!==e.field?r.field(e.field):r.field(e),o&&(n.fields||(n.fields=[]),n.fields.push(o))}));n.items&&e.map&&(n.items=n.items.map(e.map))}e&&e.stack&&(Array.isArray(e.stack.stackByKey)?e.stack.stackByKey.forEach((r=>{const i=n.items.filter((e=>{var t;return(null===(t=e.key)||void 0===t?void 0:t.value)&&e.key.value===r}));ste(n,e.stack,t.dataset,i)})):ste(n,e.stack,t.dataset,n.items))}return e&&!Array.isArray(e)&&"function"==typeof e.filter&&n.items&&(n.items=n.items.filter(e.filter)),e&&!Array.isArray(e)&&"function"==typeof e.sort&&n.items&&(n.items=n.items.sort(e.sort)),n}function cte(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:lte;if(e.data){const r=i(e.data,t,n);if(r&&r.fields&&r.fields[0])return r.fields[0].formatter()}if(r=e.formatter?"".concat(e.formatter,"-").concat(e.type||"number"):e.type||"d3-number",n.formatter.has(r)){return n.formatter.get(r)(e.format||"")}throw new Error("Formatter of type '".concat(r,"' was not found"))}function ute(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}const dte=Symbol("implicit");function fte(){var e=new y9,t=[],n=[],r=dte;function i(i){let o=e.get(i);if(void 0===o){if(r!==dte)return r;e.set(i,o=t.push(i)-1)}return n[o%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new y9;for(const r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return fte(t,n).unknown(r)},ute.apply(i,arguments),i}function hte(){var e,t,n=fte().unknown(void 0),r=n.domain,i=n.range,o=0,a=1,s=!1,l=0,c=0,u=.5;function d(){var n=r().length,d=a<o,f=d?a:o,h=d?o:a;e=(h-f)/Math.max(1,n-l+2*c),s&&(e=Math.floor(e)),f+=(h-f-e*(n-l))*u,t=e*(1-l),s&&(f=Math.round(f),t=Math.round(t));var p=function(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++r<i;)o[r]=e+r*n;return o}(n).map((function(t){return f+e*t}));return i(d?p.reverse():p)}return delete n.unknown,n.domain=function(e){return arguments.length?(r(e),d()):r()},n.range=function(e){return arguments.length?([o,a]=e,o=+o,a=+a,d()):[o,a]},n.rangeRound=function(e){return[o,a]=e,o=+o,a=+a,s=!0,d()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(s=!!e,d()):s},n.padding=function(e){return arguments.length?(l=Math.min(1,c=+e),d()):l},n.paddingInner=function(e){return arguments.length?(l=Math.min(1,e),d()):l},n.paddingOuter=function(e){return arguments.length?(c=+e,d()):c},n.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},n.copy=function(){return hte(r(),[o,a]).round(s).paddingInner(l).paddingOuter(c).align(u)},ute.apply(d(),arguments)}function pte(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function mte(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function gte(){}var yte=.7,vte=1/yte,bte="\\s*([+-]?\\d+)\\s*",xte="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",wte="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ste=/^#([0-9a-f]{3,8})$/,Cte=new RegExp(`^rgb\\(${bte},${bte},${bte}\\)$`),kte=new RegExp(`^rgb\\(${wte},${wte},${wte}\\)$`),Ete=new RegExp(`^rgba\\(${bte},${bte},${bte},${xte}\\)$`),Mte=new RegExp(`^rgba\\(${wte},${wte},${wte},${xte}\\)$`),_te=new RegExp(`^hsl\\(${xte},${wte},${wte}\\)$`),Rte=new RegExp(`^hsla\\(${xte},${wte},${wte},${xte}\\)$`),Ite={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 Dte(){return this.rgb().formatHex()}function Pte(){return this.rgb().formatRgb()}function Ate(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ste.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Ote(t):3===n?new qte(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Lte(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Lte(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Cte.exec(e))?new qte(t[1],t[2],t[3],1):(t=kte.exec(e))?new qte(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Ete.exec(e))?Lte(t[1],t[2],t[3],t[4]):(t=Mte.exec(e))?Lte(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=_te.exec(e))?$te(t[1],t[2]/100,t[3]/100,1):(t=Rte.exec(e))?$te(t[1],t[2]/100,t[3]/100,t[4]):Ite.hasOwnProperty(e)?Ote(Ite[e]):"transparent"===e?new qte(NaN,NaN,NaN,0):null}function Ote(e){return new qte(e>>16&255,e>>8&255,255&e,1)}function Lte(e,t,n,r){return r<=0&&(e=t=n=NaN),new qte(e,t,n,r)}function Tte(e,t,n,r){return 1===arguments.length?function(e){return e instanceof gte||(e=Ate(e)),e?new qte((e=e.rgb()).r,e.g,e.b,e.opacity):new qte}(e):new qte(e,t,n,null==r?1:r)}function qte(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Nte(){return`#${Wte(this.r)}${Wte(this.g)}${Wte(this.b)}`}function jte(){const e=zte(this.opacity);return`${1===e?"rgb(":"rgba("}${Fte(this.r)}, ${Fte(this.g)}, ${Fte(this.b)}${1===e?")":`, ${e})`}`}function zte(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Fte(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Wte(e){return((e=Fte(e))<16?"0":"")+e.toString(16)}function $te(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Vte(e,t,n,r)}function Bte(e){if(e instanceof Vte)return new Vte(e.h,e.s,e.l,e.opacity);if(e instanceof gte||(e=Ate(e)),!e)return new Vte;if(e instanceof Vte)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Vte(a,s,l,e.opacity)}function Vte(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Hte(e){return(e=(e||0)%360)<0?e+360:e}function Ute(e){return Math.max(0,Math.min(1,e||0))}function Gte(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}pte(gte,Ate,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Dte,formatHex:Dte,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Bte(this).formatHsl()},formatRgb:Pte,toString:Pte}),pte(qte,Tte,mte(gte,{brighter(e){return e=null==e?vte:Math.pow(vte,e),new qte(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?yte:Math.pow(yte,e),new qte(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new qte(Fte(this.r),Fte(this.g),Fte(this.b),zte(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:Nte,formatHex:Nte,formatHex8:function(){return`#${Wte(this.r)}${Wte(this.g)}${Wte(this.b)}${Wte(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:jte,toString:jte})),pte(Vte,(function(e,t,n,r){return 1===arguments.length?Bte(e):new Vte(e,t,n,null==r?1:r)}),mte(gte,{brighter(e){return e=null==e?vte:Math.pow(vte,e),new Vte(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?yte:Math.pow(yte,e),new Vte(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new qte(Gte(e>=240?e-240:e+120,i,r),Gte(e,i,r),Gte(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Vte(Hte(this.h),Ute(this.s),Ute(this.l),zte(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 e=zte(this.opacity);return`${1===e?"hsl(":"hsla("}${Hte(this.h)}, ${100*Ute(this.s)}%, ${100*Ute(this.l)}%${1===e?")":`, ${e})`}`}}));var Yte=e=>()=>e;function Kte(e){return 1==(e=+e)?Xte:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):Yte(isNaN(t)?n:t)}}function Xte(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Yte(isNaN(e)?t:e)}var Jte=function e(t){var n=Kte(t);function r(e,t){var r=n((e=Tte(e)).r,(t=Tte(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Xte(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function Qte(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(o){for(n=0;n<r;++n)i[n]=e[n]*(1-o)+t[n]*o;return i}}function Zte(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=ane(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<i;++n)a[n]=o[n](e);return a}}function ene(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function tne(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function nne(e,t){var n,r={},i={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=ane(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var rne=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ine=new RegExp(rne.source,"g");function one(e,t){var n,r,i,o=rne.lastIndex=ine.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=rne.exec(e))&&(r=ine.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:tne(n,r)})),o=ine.lastIndex;return o<t.length&&(i=t.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}function ane(e,t){var n,r=typeof t;return null==t||"boolean"===r?Yte(t):("number"===r?tne:"string"===r?(n=Ate(t))?(t=n,Jte):one:t instanceof Ate?Jte:t instanceof Date?ene:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?Qte:Array.isArray(t)?Zte:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?nne:tne)(e,t)}function sne(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function lne(e){return+e}var cne=[0,1];function une(e){return e}function dne(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function fne(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=dne(i,r),o=n(a,o)):(r=dne(r,i),o=n(o,a)),function(e){return o(r(e))}}function hne(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=dne(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=g9(e,t,1,r)-1;return o[n](i[n](t))}}function pne(){var e,t,n,r,i,o,a=cne,s=cne,l=ane,c=une;function u(){var e=Math.min(a.length,s.length);return c!==une&&(c=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(a[0],a[e-1])),r=e>2?hne:fne,i=o=null,d}function d(t){return null==t||isNaN(t=+t)?n:(i||(i=r(a.map(e),s,l)))(e(c(t)))}return d.invert=function(n){return c(t((o||(o=r(s,a.map(e),tne)))(n)))},d.domain=function(e){return arguments.length?(a=Array.from(e,lne),u()):a.slice()},d.range=function(e){return arguments.length?(s=Array.from(e),u()):s.slice()},d.rangeRound=function(e){return s=Array.from(e),l=sne,u()},d.clamp=function(e){return arguments.length?(c=!!e||une,u()):c!==une},d.interpolate=function(e){return arguments.length?(l=e,u()):l},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,u()}}function mne(e,t,n,r){var i,o=function(e,t,n){n=+n;const r=(t=+t)<(e=+e),i=r?k9(t,e,n):k9(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}(e,t,n);switch((r=_7(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(k7(t)/3)))-k7(Math.abs(e)))}(o,a))||(r.precision=i),L7(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,k7(t)-k7(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-k7(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return O7(r)}function gne(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){if(!((n=+n)>0))return[];if((e=+e)==(t=+t))return[e];const r=t<e,[i,o,a]=r?C9(t,e,n):C9(e,t,n);if(!(o>=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let e=0;e<s;++e)l[e]=(o-e)/-a;else for(let e=0;e<s;++e)l[e]=(o-e)*a;else if(a<0)for(let e=0;e<s;++e)l[e]=(i+e)/-a;else for(let e=0;e<s;++e)l[e]=(i+e)*a;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return mne(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i,o=t(),a=0,s=o.length-1,l=o[a],c=o[s],u=10;for(c<l&&(i=l,l=c,c=i,i=a,a=s,s=i);u-- >0;){if((i=k9(l,c,n))===r)return o[a]=l,o[s]=c,t(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 e},e}function yne(){var e=pne()(une,une);return e.copy=function(){return function(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}(e,yne())},ute.apply(e,arguments),gne(e)}function vne(){var e,t=[.5],n=[0,1],r=1;function i(i){return null!=i&&i<=i?n[g9(t,i,0,r)]:e}return i.domain=function(e){return arguments.length?(t=Array.from(e),r=Math.min(t.length,n.length-1),i):t.slice()},i.range=function(e){return arguments.length?(n=Array.from(e),r=Math.min(t.length,n.length-1),i):n.slice()},i.invertExtent=function(e){var r=n.indexOf(e);return[t[r-1],t[r]]},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return vne().domain(t).range(n).unknown(e)},ute.apply(i,arguments)}function bne(e){return void 0===e?e=>e:t=>e(t)}function xne(e){return Math.max(0,Math.min(1,e))}function wne(e){return"object"==typeof e}function Sne(e,t,n){const r=Math.abs(t-n)/(e+1),i=[];for(let o=1;o<=e;o++){const e=o*r;i.push(t<n?t+e:t-e)}return i}function Cne(e,t,n){if(1===e.length)return e;const r=e.concat([]);for(let i=0;i<e.length;i++){let o=e[i],a=e[i+1];0===i&&o!==n.start()?(r.push(...Sne(t,o,a)),o-=a-o,a=e[i],r.push(...Sne(t,o,a))):i===e.length-1&&a!==n.end()?(a=o+(o-e[i-1]),r.push(...Sne(t,o,a))):r.push(...Sne(t,o,a))}return r.filter((e=>e>=n.min()&&e<=n.max()))}function kne(e){let{distance:t,scale:n,minorCount:r=0,unitDivider:i=100,formatter:o}=e;const a=f8(i)||f8(t)?2:Math.max(t/i,2),s=Math.min(1e3,Math.round(a));let l=n.ticks(s);l.length<=1&&(l=n.ticks(s+1));const c=r>0?Cne(l,r,n):l;c.sort(((e,t)=>e-t));const u=c.map(bne(o));return c.map(((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:u[t],value:e,isMinor:-1===l.indexOf(e)}}))}function Ene(e){let{distance:t,scale:n,minorCount:r=0,unitDivider:i=100,formatter:o}=e;const a=f8(i)||f8(t)?2:Math.max(t/i,2),s=Math.min(1e3,Math.round(a)),l=s>10?10:s;n.nice(l);const c=n.ticks(s),u=r>0?Cne(c,r,n):c;u.sort(((e,t)=>e-t));const d=u.map(bne(o));return u.map(((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:d[t],value:e,isMinor:-1===c.indexOf(e)}}))}function Mne(e){let t,{settings:n,scale:r,distance:i,formatter:o=e=>e}=e;const a=n.minorTicks&&!f8(n.minorTicks.count)?Math.min(100,n.minorTicks.count):0;if(Array.isArray(n.ticks.values)){const e=n.ticks.values.filter((e=>"object"==typeof e?!f8(e.value):!f8(e)));t=function(e){let{values:t,scale:n,formatter:r=e=>e}=e;return t.sort(((e,t)=>(wne(e)?e.value:e)-(wne(t)?t.value:t))).filter(((e,t,r)=>{const i=wne(e)?e.value:e;return i<=n.max()&&i>=n.min()&&r.indexOf(e)===t})).map((e=>{const t=wne(e),i=t?e.value:e,o=n(i);return{position:o,value:i,label:t&&void 0!==e.label?e.label:r(i),isMinor:!!t&&!!e.isMinor,start:t&&!isNaN(e.start)?xne(n(e.start)):o,end:t&&!isNaN(e.end)?xne(n(e.end)):o}}))}({values:e,scale:r.copy(),formatter:o})}else if(f8(n.ticks.count)){t=(n.ticks.tight?Ene:kne)({distance:i,minorCount:a,unitDivider:n.ticks.distance,scale:r,formatter:o}),n.ticks.forceBounds&&function(e,t,n){const r=e.map((e=>e.position)),i=t.range();-1===r.indexOf(i[0])?e.splice(0,0,{position:i[0],start:i[0],end:i[0],label:n(t.start()),isMinor:!1,value:t.start()}):e[0]&&e[0].isMinor&&(e[0].isMinor=!1);const o=e[e.length-1];-1===r.indexOf(i[1])?e.push({position:i[1],start:i[1],end:i[1],label:n(t.end()),isMinor:!1,value:t.end()}):o&&o.isMinor&&(o.isMinor=!1)}(t,r,o)}else{t=function(e){let{count:t,minorCount:n,scale:r,formatter:i}=e;return r.ticks((t-1)*n+t).map(((e,t)=>{const o=r(e);return{position:o,start:o,end:o,label:i(e),isMinor:t%(n+1)!=0,value:e}}))}({count:Math.min(1e3,n.ticks.count),minorCount:a,scale:r.copy(),formatter:o})}return t}function _ne(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r={};return Object.keys(t).forEach((i=>{const o=typeof e[i];r[i]="function"===o?e[i](n):"undefined"===o?t[i]:e[i]})),r}const Rne={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},Ine={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},Dne={count:NaN};function Pne(e,t){e.instance||(e.instance=t.copy(),e.instance.domain([t.start(),t.end()]),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}function Ane(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=yne(),i={instance:null,invert:!1},o={data:t,resources:n},a=_ne(e,Rne,o);let s;function l(e){return f8(e)?NaN:r(e)}a.ticks=_ne(e.ticks,Ine,o),a.minorTicks=_ne(e.minorTicks,Dne,o),l.data=()=>t,l.invert=function(e){return r.invert(e)},l.rangeRound=function(e){return r.rangeRound(e),l},l.clamp=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return r.clamp(e),l},l.cachedTicks=function(){return s},l.clearTicksCache=function(){return s=void 0,this},l.ticks=function(e){return null!==e&&"object"==typeof e?(e.settings=e.settings||{},e.settings=o8(!0,{},a,e.settings),e.scale=l,s=Mne(e),s):(s=r.ticks(e),s)},l.nice=function(e){return r.nice(e),l},l.tickFormat=function(e,t){return r.tickFormat(e,t)},l.interpolate=function(e){return r.interpolate(e),l},l.domain=function(e){return arguments.length?(r.domain(e),i.instance&&i.instance.domain([l.start(),l.end()]),l):r.domain()},l.range=function(e){return arguments.length?(r.range(e),l):r.range()},l.start=function(){return l.domain()[0]},l.end=function(){return l.domain()[this.domain().length-1]},l.min=function(){return Math.min(this.start(),this.end())},l.max=function(){return Math.max(this.start(),this.end())},l.classify=function(e){let t=(l.start()-l.end())/e,n=[l.end()],r=[],i=t/2;for(let o=0;o<e;o++){let e=n[n.length-1]||0,o=e+t,a=l(e+i);n.push(o,o),r.push(a,a)}return n.pop(),l.domain(n),l.range(r),l},l.copy=function(){const i=Ane(e,t,n);return i.domain(l.domain()),i.range(l.range()),i.clamp(r.clamp()),i},l.norm=function(e){return Pne(i,l),i.instance(e)},l.normInvert=function(e){return Pne(i,l),i.instance.invert(e)};const{mini:c,maxi:u}=function(e,t){const n=+e.min,r=+e.max;let i=0,o=1;if(t&&t[0]){const n=t.map((e=>e.min())).filter((e=>!isNaN(e))),r=t.map((e=>e.max())).filter((e=>!isNaN(e)));if(i=n.length?Math.min(...n):Number.NaN,o=r.length?Math.max(...r):Number.NaN,isNaN(i)||isNaN(o))i=-1,o=1;else if(i===o&&0===i)i=-1,o=1;else if(i===o&&i)i-=Math.abs(.1*i),o+=Math.abs(.1*o);else if(!isNaN(e.expand)){const t=o-i;i-=t*e.expand,o+=t*e.expand}if(Array.isArray(e.include)){const t=e.include.filter((e=>!isNaN(e)));i=Math.min(...t,i),o=Math.max(...t,o)}}return{mini:isNaN(n)?i:n,maxi:isNaN(r)?o:r}}(a,t?t.fields:[]);return l.domain([c,u]),l.range(a.invert?[1,0]:[0,1]),i.invert=a.invert,l}const One={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function Lne(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={data:t,resources:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}},r=_ne(e,One,n),i=t.items||[],o={},a=[],s=[];function l(e,n){e.data=()=>t,e.datum=e=>i[o[e]],e.start=function(){return e.domain()[0]},e.end=function(){return e.domain()[e.domain().length-1]},e.labels=()=>s,e.ticks=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.scale=e,function(e){let{scale:t}=e;const n=t.domain(),r=t.data().items,i=t.labels?t.labels():n,o=t.bandwidth();return n.map(((e,n)=>{const a=t(e);return{position:a+o/2,label:"".concat(i[n]),data:r?r[n]:void 0,start:a,end:a+o}}))}(t,n.trackBy)}}const c=hte();l(c,e),c.pxScale=function(t){const n=r.maxPxStep;if(isNaN(n))return c;const i=c.domain().length,o=Math.max(1,i-c.paddingInner()+2*c.paddingOuter());if(o*n>=t)return c;const a=c.copy();a.type=c.type,l(a,e);const s=o*n/t,u=(1-s)*c.align();return a.range(r.invert?[s+u,u]:[u,s+u]),a};const u="function"==typeof e.value?e.value:e=>e.datum.value,d="function"==typeof e.label?e.label:e=>e.datum.label;for(let e=0;e<i.length;e++){const t=o8({datum:i[e]},n),r=u(t,e);-1===a.indexOf(r)&&(a.push(r),s.push(d(t,e)),o[r]=e)}return c.domain(a),c.range(r.invert?r.range.slice().reverse():r.range),c.padding(isNaN(r.padding)?0:r.padding),isNaN(r.paddingInner)||c.paddingInner(r.paddingInner),isNaN(r.paddingOuter)||c.paddingOuter(r.paddingOuter),c.align(isNaN(r.align)?.5:r.align),c}const Tne={depth:0};function qne(e,t,n){return e.ancestors().map((e=>t(o8({datum:e.data},n)))).reverse().slice(1).toString()}const Nne=e=>e.min(),jne=e=>e.max();function zne(e,t){const n=e&&!isNaN(e.min),r=e&&!isNaN(e.max);let i=n?+e.min:0,o=r?+e.max:1;if(t&&t.length){if(!n){const e=t.map(Nne).filter(d8);i=e.length?Math.min(...e):i}if(!r){const e=t.map(jne).filter(d8);o=e.length?Math.max(...e):o}}return[i,o]}const Fne={domain:[],range:[],invert:!1,min:NaN,max:NaN};function Wne(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=Ane(e,t,n).clamp(!0).interpolate(Jte),i=_ne(e,Fne,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length,s=r;o8(!0,s,r);const[l,c]=zne(i,t?t.fields:[]),u=o?i.domain.length:-1,d=n.theme?n.theme.palette("sequential",u>0?u:2):[],f=a?i.range:d;return s.range(i.invert?f.slice().reverse():f.slice()),s.domain(o?i.domain:function(e,t,n){const r=e.length;if(2===r)return[t,n];const i=[],o=(n-t)/(r-1);i.push(t);for(let e=1;e<r-1;e++)i.push(t+o*e);return i.push(n),i}(s.range(),l,c)),s}const $ne={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function Bne(e){const t=[];for(let n=0;n<e.length-1;n++)t.push((e[n]+e[n+1])/2);return t}const Vne={domain:[],range:[]};const Hne={domain:[],range:[],unknown:void 0},Une={domain:[],range:[],override:!1};const Gne=S7();function Yne(e,t,n){let r=e.data;e.source&&(n.logger.warn("Deprecated: Scale data source configuration"),r={extract:[]},(Array.isArray(e.source)?e.source:[e.source]).forEach((e=>{r.extract.push({field:e})})));const i=lte(r,t,n);let o,a=e.type||function(e){return e.root?"h-band":e.fields&&e.fields[0]?function(e){const t=e.map((e=>"dimension"===e.type()?"band":"linear"));return-1!==t.indexOf("linear")?"linear":"band"}(e.fields):"linear"}(i);return"color"===a&&(a=i.fields&&i.fields[0]&&"dimension"===i.fields[0].type()?"categorical-color":"sequential-color"),n.scale.has(a)&&(o=n.scale.get(a),o=o(e,i,{theme:n.theme,logger:n.logger}),o.type=a),o}Gne("linear",Ane),Gne("band",Lne),Gne("h-band",(function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={data:n,resources:r},o=_ne(t,One,i);o.ticks=_ne(t.ticks,Tne,i),o.value="function"==typeof t.value?t.value:e=>e.datum.value,o.label="function"==typeof t.label?t.label:e=>e.datum.value;let a=Lne(o);const{values:s,labels:l,items:c,ticks:u}=function(e,t,n){const r=t.ticks.depth,i=t.value,o=t.label,a=[],s=[],l={},c=[];let u=0;if(!e)return{values:a,labels:s,items:l,ticks:c};e.eachAfter((e=>{if(e.depth>0){const t=qne(e,i,n),d=e.leaves()||[e],f=i(o8({datum:e.data},n)),h=o(o8({datum:e.data},n)),p=Array.isArray(e.children),m={key:t,count:d.length,value:f,label:h,leftEdge:qne(d[0],i,n),rightEdge:qne(d[Math.max(d.length-1,0)],i,n),node:e};p?(a.push("SPACER_".concat(u,"_SPACER")),u++):(a.push(t),s.push(h)),(r<=0&&!p||e.depth===r)&&c.push(m),l[t]=m}}));const d=e.height-1;return d>0&&a.splice(-d),{values:a,labels:s,items:l,ticks:c}}(n.root,o,i),d=function(e){const t=String(e),n=c[t];return a(n?o.invert?n.rightEdge:n.leftEdge:t)};o8(!0,d,a),d.bandwidth=function(e){const t=c[String(e)],n=a.bandwidth();if(t&&!t.isLeaf){const e=d(t.leftEdge),r=d(t.rightEdge);return Math.abs(e-r)+n}return n},d.step=function(e){const t=c[String(e)],n=t?t.count:1;let r=a.step();return r*=n,r},d.data=()=>n,d.datum=e=>{const t=c[String(e)];return t?t.node.data:null},d.copy=()=>e(t,n,r),d.labels=()=>l,d.ticks=()=>u.map((e=>{const t=d(e.key),n=d.bandwidth(e.key);return{position:t+n/2,label:e.label,data:e.node.data,start:t,end:t+n}}));const f=a.pxScale;return d.pxScale=function(e){return a=f(e),d},d.domain(s),d})),Gne("sequential-color",Wne),Gne("threshold-color",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=vne(),i=_ne(e,$ne,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length;function s(e){return f8(e)?NaN:r(e)}Object.keys(r).forEach((e=>s[e]=r[e]));const l=t.fields,[c,u]=zne(i,l),d=o?i.domain.length:-1,f=n.theme?n.theme.palette("sequential",d>0?d:2):[];let h=a?i.range:f,p=[];return p=o?i.domain:i.nice?function(e,t,n){const r=2===e.length?10:Math.max(1,e.length),i=yne().domain([t,n]).nice(r).ticks(r);if(!e||!e.length)return i;const o=Math.max(0,e.length-1);for(;i.length>o;)i[0]-t<=n-i[i.length-1]?i.shift():i.pop();return i}(h,c,u):[c+(u-c)/2],h.length>p.length+1?p=function(e,t,n){const r=e.length;if(2===r)return[t+(n-t)/2];const i=[],o=(n-t)/r;for(let e=1;e<r;e++)i.push(t+o*e);return i}(h,c,u):h.length<p.length+1&&(h=function(e,t,n,r){n=e[0],r=e&&e.length>=2?e[e.length-1]:r;const i=Wne().domain([n,r]).range(t);return[n,...Bne(e),r].map((e=>i(e)))}(p,h,c,u)),s.data=()=>t,s.range(i.invert?h.slice().reverse():h),s.domain(p),s})),Gne("categorical-color",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=fte(),i={data:t,resources:n},o=_ne(e,Vne,i),a="function"==typeof e.value?e.value:e=>e.datum.value,s="function"==typeof e.label?e.label:e=>e.datum.label,l=t.items||[],c={},u=[],d=[];for(let e=0;e<l.length;e++){const t=o8({datum:l[e]},i),n=a(t,e);-1===u.indexOf(n)&&(u.push(n),d.push(s(t,e)),c[n]=e)}return r.data=()=>t,r.labels=()=>d,r.label=e=>d[u.indexOf(e)],r.datum=e=>l[c[e]],r.range(o.range),Array.isArray(o.domain)&&o.domain.length?r.domain(o.domain):r.domain(u),r}(e,t,n),i=n.theme,o=_ne(e,Hne,{data:t,resources:n});let a;if(o.explicit=_ne(e.explicit,Une,{data:t,resources:n}),a=Array.isArray(o.range)&&0!==o.range.length?o.range.slice():i?i.palette("categorical",r.domain().length).slice():[],o.unknown)r.unknown(o.unknown);else if(i&&i.palette("unknown")){let e=i.palette("unknown");r.unknown(e[0])}if(Array.isArray(o.explicit.domain)&&o.explicit.domain.length){const e=r.domain().slice(),t=o.explicit.domain,n=Array.isArray(o.explicit.range)?o.explicit.range:[],i=Math.floor(e.length/a.length);for(let e=1;e<i+1;e*=2)a=a.concat(a);if(o.explicit.override)for(let r=0;r<t.length;r++){const i=e.indexOf(t[r]);i>-1&&(a[i]=n[r])}else{const r=t.map(((t,r)=>[e.indexOf(t),t,n[r]])).sort(((e,t)=>e[0]-t[0]));r.forEach((t=>{const n=e.indexOf(t[1]);-1!==n&&a.splice(n,0,t[2])}))}a.length=e.length}return r.range(a),r}));var Kne={};function Xne(){Xne.init.call(this)}Kne.isObject=function(e){return"object"==typeof e&&null!==e},Kne.isNumber=function(e){return"number"==typeof e},Kne.isUndefined=function(e){return void 0===e},Kne.isFunction=function(e){return"function"==typeof e};var Jne=Xne;Xne.EventEmitter=Xne,Xne.prototype._events=void 0,Xne.prototype._maxListeners=void 0,Xne.defaultMaxListeners=10,Xne.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},Xne.prototype.setMaxListeners=function(e){if(!Kne.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},Xne.prototype.emit=function(e){var t,n,r,i,o,a;if(this._events||(this._events={}),"error"===e&&!this._events.error)throw(t=arguments[1])instanceof Error?t:Error('Uncaught, unspecified "error" event.');if(n=this._events[e],Kne.isUndefined(n))return!1;if(Kne.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];n.apply(this,i)}else if(Kne.isObject(n)){for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];for(r=(a=n.slice()).length,o=0;o<r;o++)a[o].apply(this,i)}return!0},Xne.prototype.addListener=function(e,t){var n;if(!Kne.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,Kne.isFunction(t.listener)?t.listener:t),this._events[e]?Kne.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,Kne.isObject(this._events[e])&&!this._events[e].warned)&&((n=Kne.isUndefined(this._maxListeners)?Xne.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,Kne.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),Kne.isFunction(console.trace)&&console.trace()));return this},Xne.prototype.on=Xne.prototype.addListener,Xne.prototype.once=function(e,t){if(!Kne.isFunction(t))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}return r.listener=t,this.on(e,r),this},Xne.prototype.removeListener=function(e,t){var n,r,i,o;if(!Kne.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(n=this._events[e]).length,r=-1,n===t||Kne.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(Kne.isObject(n)){for(o=i;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){r=o;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},Xne.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],Kne.isFunction(n))this.removeListener(e,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},Xne.prototype.listeners=function(e){return this._events&&this._events[e]?Kne.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},Xne.listenerCount=function(e,t){return e._events&&e._events[t]?Kne.isFunction(e._events[t])?1:e._events[t].length:0};var Qne={mixin:e=>(Object.keys(Jne.prototype).forEach((t=>{e[t]=Jne.prototype[t]})),Jne.init(e),e)};function Zne(){let e=0,t=0,n=0,r=0;n=n||e;const i={move(e){this.moveTo(n+e)},moveTo(o){const a=Math.max(e,Math.min(t-r,o));n!==a&&(n=a,i.emit("update"))},update(o){let a=!1;({min:e=e,max:t=t}=o),void 0!==o.viewSize&&o.viewSize!==r&&(r=o.viewSize,a=!0);const s=Math.max(e,Math.min(t-r,n));n!==s&&(n=s,a=!0),a&&i.emit("update")},getState:()=>({min:e,max:t,start:n,viewSize:r})};return Qne.mixin(i),i}function ere(e,t){const n=e.min||0,r=e.max||0,i=e.viewSize||0,o=t||Zne();return o.update({min:n,max:r,viewSize:i}),o}function tre(e,t){return e<=t}function nre(e,t){return e<t}function rre(e,t,n){let r=0;for(;r<e.length&&t>e[r];)++r;return e[r]===t&&n&&++r,r}function ire(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=[];function i(){}return i.configure=function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{includeMax:r=!0,includeMin:i=!0}=n;e=r?tre:nre,t=i?tre:nre},i.add=e=>{let{min:t,max:n}=e;const i=rre(r,t),o=rre(r,n,!0),a=[i,o-i];i%2==0&&a.push(t),o%2==0&&a.push(n);const s=r.join(",");r.splice(...a);return s!==r.join(",")},i.remove=e=>{let{min:t,max:n}=e;const i=rre(r,t),o=rre(r,n,!0),a=[i,o-i];i%2==1&&a.push(t),o%2==1&&a.push(n);const s=r.join(",");r.splice(...a);return s!==r.join(",")},i.set=e=>{const t=r.join(",");r=[],Array.isArray(e)?e.forEach(i.add):i.add(e);return t!==r.join(",")},i.clear=()=>{const e=r.length>0;return r=[],e},i.containsValue=n=>function(e,t,n,r){const i=e.length;for(let o=1;o<i;o+=2)if(n(e[o-1],t)&&r(t,e[o]))return!0;return!1}(r,n,t,e),i.containsRange=e=>{let{min:t,max:n}=e;const i=rre(r,t,!0),o=rre(r,n);return i===o&&o%2==1},i.toggle=e=>i.containsRange(e)?i.remove(e):i.add(e),i.ranges=()=>{const e=[];for(let t=1;t<r.length;t+=2)e.push({min:r[t-1],max:r[t]});return e},i.configure(n),i}function ore(){let e=[];function t(){}return t.add=t=>-1===e.indexOf(t)&&(e.push(t),!0),t.remove=t=>{const n=e.indexOf(t);return-1!==n&&(e.splice(n,1),!0)},t.contains=t=>-1!==e.indexOf(t),t.values=()=>e.slice(),t.clear=()=>e=[],t.toString=()=>e.join(";"),t}const are={key:void 0,includeMin:!0,includeMax:!0};function sre(e){let{items:t,collection:n,vc:r}=e;const i={},o=[];let a,s;for(let e=0,o=t.length;e<o;e++){a=t[e].key,n[a]||(n[a]=r()),s=t[e].values||[t[e].value];for(let e=0;e<s.length;e++)n[a].add(s[e])&&(i[a]=i[a]||[],i[a].push(s[e]))}const l=Object.keys(i);for(let e=0,t=l.length;e<t;e++)a=l[e],o.push({id:a,values:i[a]});return o}function lre(e){let{items:t,collection:n}=e;const r={},i=[];let o,a;for(let e=0,i=t.length;e<i;e++)if(o=t[e].key,n[o]){a=t[e].values||[t[e].value];for(let e=0;e<a.length;e++)n[o].remove(a[e])&&(r[o]=r[o]||[],r[o].push(a[e]))}const s=Object.keys(r);for(let e=0,t=s.length;e<t;e++)o=s[e],i.push({id:o,values:r[o]});return i}function cre(e){const t={};let n,r;for(let i=0,o=e.length;i<o;i++){n=e[i].key,r=e[i].values||[e[i].value],t[n]||(t[n]=[]);for(let e=0;e<r.length;e++){-1===t[n].indexOf(r[e])&&t[n].push(r[e])}}return t}function ure(e){let{key:t,collection:n,obj:r,fn:i,value:o}=e;n[t]||(n[t]=i()),r[t]=r[t]||[],r[t].push(o),n[t].add(o)}function dre(e,t){const n=[],r=Object.keys(e);let i,o;const a=e=>-1===t[i].indexOf(e);for(let s=0,l=r.length;s<l;s++)i=r[s],t[i]?(o=e[i].filter(a),o.length&&n.push({id:i,values:o})):n.push({id:i,values:e[i]});return n}function fre(e,t,n){const r=function(e,t){if(!Object.keys(t).length)return e;const n=e.length,r=Array(n);for(let i=0;i<n;i++)r[i]=e[i].key in t?o8({},e[i],{key:t[e[i].key]}):e[i];return r}(t,n);return e&&e.length?e.reduce(((e,t)=>t(e)),r):r}function hre(e){return e.replace(/(-[a-z])/g,(e=>e.toUpperCase().replace("-","")))}function pre(e){return e.replace(/([A-Z])/g,(e=>"-".concat(e.toLowerCase())))}function mre(e,t,n){let{ranges:r,interceptors:i,rc:o,aliases:a,rangeConfig:s}=n;const l=fre(i["".concat(t,"Ranges")],e,a);let c=!1;return l.forEach((e=>{const n=e.key;if(r[n]||(r[n]=o(s.sources[n]||s.default)),"set"===t)c=r[n][t](e.ranges||e.range)||c;else{const i=e.ranges||[e.range];for(let e=0;e<i.length;e++)c=r[n][t](i[e])||c}})),c}function gre(){let{vc:e=ore,rc:t=ire}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=!1,r={},i={},o={},a={sources:{},default:o8({},are)};const s={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},l=()=>{const e={values:{},ranges:{}};return Object.keys(i).forEach((t=>{e.values[t]=i[t].values()})),Object.keys(r).forEach((t=>{e.ranges[t]=r[t].ranges()})),e},c={ls:[],clear(){this.ls.forEach((e=>e.clear()))},start(){this.ls.forEach((e=>e.start()))},end(){this.ls.forEach((e=>e.end()))},update(){const e=l();this.ls.forEach((t=>t._state(e)))},updateValues(){const e=l();this.ls.forEach((t=>t._state({values:e.values})))},updateRanges(){const e=l();this.ls.forEach((t=>t._state({ranges:e.ranges})))}},u={configure:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(e.ranges)&&e.ranges.length&&(a={sources:{},default:o8({},are)},e.ranges.forEach((e=>{const t={};Object.keys(are).filter((e=>"key"!==e)).forEach((n=>{t[n]=void 0!==e[n]?e[n]:are[n]})),void 0!==e.key?a.sources[e.key]=t:a.default=t})),Object.keys(r).forEach((e=>r[e].configure(a.sources[e]||a.default))),u.emit("update",[],[]))},link:e=>{if(u===e)throw new Error("Can't link to self");c.ls.push(e),e._state(l())},_state:e=>{if(!e)return l();if(e.values){const t=[];Object.keys(e.values).forEach((n=>{i[n]&&e.values[n].join(";")===i[n].toString()||t.push({key:n,values:e.values[n]})})),Object.keys(i).forEach((n=>{e.values[n]||t.push({key:n,values:[]})})),t.length&&u.setValues(t)}if(e.ranges){const t=[];Object.keys(e.ranges).forEach((n=>{r[n]&&e.ranges[n].join(";")===r[n].toString()||t.push({key:n,ranges:e.ranges[n]})})),Object.keys(r).forEach((n=>{e.ranges[n]||t.push({key:n,ranges:[]})})),t.length&&u.setRanges(t)}},start:function(){if(!n){n=!0;for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];u.emit("start",...t),c.start()}},end:function(){if(n){n=!1,r={},i={};for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];u.emit("end",...t),c.end()}},isActive:()=>n,clear:()=>{const e=u.brushes().filter((e=>"value"===e.type&&e.brush.values().length)).map((e=>({id:e.id,values:e.brush.values()}))),t=Object.keys(r).length>0||e.length;r={},i={},t&&(u.emit("update",[],e),c.clear())},brushes:()=>{let e=[];return e=e.concat(Object.keys(r).map((e=>({type:"range",id:e,brush:r[e]})))),e=e.concat(Object.keys(i).map((e=>({type:"value",id:e,brush:i[e]})))),e},addValue:(e,t)=>{u.addValues([{key:e,value:t}])},addValues:t=>{const r=fre(s.addValues,t,o),a=sre({vc:e,collection:i,items:r});u.emit("add-values",r),a.length&&(n||(n=!0,u.emit("start")),u.emit("update",a,[]),c.updateValues())}};return u.setValues=t=>{const r=fre(s.setValues,t,o),a=function(e){let{items:t,vCollection:n,vc:r}=e;const i={},o=cre(t);let a,s=[],l=[];const c={},u=Object.keys(n);for(let e=0,t=u.length;e<t;e++)a=u[e],c[a]=n[a].values().slice(),delete n[a];const d=e=>{n[a]&&n[a].contains(e)||ure({key:a,value:e,collection:n,obj:i,fn:r})},f=Object.keys(o);for(let e=0,t=f.length;e<t;e++)a=f[e],o[a].forEach(d);return l=dre(c,i),s=dre(i,c),[s,l]}({items:r,vCollection:i,vc:e});u.emit("set-values",r),(a[0].length>0||a[1].length>0)&&(n||(n=!0,u.emit("start")),u.emit("update",a[0],a[1]),c.updateValues())},u.removeValue=(e,t)=>{u.removeValues([{key:e,value:t}])},u.removeValues=e=>{const t=fre(s.removeValues,e,o),n=lre({collection:i,items:t});u.emit("remove-values",t),n.length&&(u.emit("update",[],n),c.updateValues())},u.addAndRemoveValues=(t,r)=>{const a=fre(s.addValues,t,o),l=fre(s.removeValues,r,o),d=sre({vc:e,collection:i,items:a}),f=lre({collection:i,items:l});u.emit("add-values",a),u.emit("remove-values",l),(d.length||f.length)&&(n||(n=!0,u.emit("start")),u.emit("update",d,f),c.updateValues())},u.toggleValue=(e,t)=>{u.toggleValues([{key:e,value:t}])},u.toggleValues=t=>{const r=fre(s.toggleValues,t,o),a=function(e){let{items:t,values:n,vc:r}=e;const i={},o={},a=[],s=[],l=cre(t);let c,u,d;const f=Object.keys(l);for(let e=0,t=f.length;e<t;e++){c=f[e],d=l[c];for(let e=0,t=d.length;e<t;e++)u=d[e],n[c]&&n[c].contains(u)?n[c]&&n[c].contains(u)&&(o[c]=o[c]||[],o[c].push(u),n[c].remove(u)):ure({key:c,value:u,collection:n,obj:i,fn:r})}const h=Object.keys(i);for(let e=0,t=h.length;e<t;e++)c=h[e],a.push({id:c,values:i[c]});const p=Object.keys(o);for(let e=0,t=p.length;e<t;e++)c=p[e],s.push({id:c,values:o[c]});return[a,s]}({items:r,values:i,vc:e});u.emit("toggle-values",r),(a[0].length>0||a[1].length>0)&&(n||(n=!0,u.emit("start")),u.emit("update",a[0],a[1]),c.updateValues())},u.containsValue=(e,t)=>{let n=o[e]||e;return!!i[n]&&i[n].contains(t)},u.addRange=(e,t)=>{u.addRanges([{key:e,range:t}])},u.addRanges=e=>{mre(e,"add",{ranges:r,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.removeRange=(e,t)=>{u.removeRanges([{key:e,range:t}])},u.removeRanges=e=>{mre(e,"remove",{ranges:r,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.setRange=(e,t)=>{u.setRanges([{key:e,range:t}])},u.setRanges=e=>{mre(e,"set",{ranges:r,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.toggleRange=(e,t)=>{u.toggleRanges([{key:e,range:t}])},u.toggleRanges=e=>{mre(e,"toggle",{ranges:r,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.containsRangeValue=(e,t)=>{let n=o[e]||e;return!!r[n]&&r[n].containsValue(t)},u.containsRange=(e,t)=>{let n=o[e]||e;return!!r[n]&&r[n].containsRange(t)},u.containsMappedData=(e,t,n)=>{let a=[];const s=Object.keys(e);let l,c,u,d;for(let t=0,n=s.length;t<n;t++){if(l=s[t],"value"===l)c=e,a[t]={key:"",i:t,bool:!1};else{if("source"===l)continue;c=e[l],a[t]={key:l,i:t,bool:!1}}u=c.source&&c.source.field,void 0!==u&&(void 0!==c.source.key&&(u="".concat(c.source.key,"/").concat(u)),u in o&&(u=o[u]),d=c.value,r[u]?a[t].bool=Array.isArray(d)?r[u].containsRange({min:d[0],max:d[1]}):r[u].containsValue(d):i[u]&&i[u].contains(d)&&(a[t].bool=!0))}return t?(a=a.filter((e=>-1!==t.indexOf(e.key))),"and"===n?!!a.length&&!a.some((e=>!1===e.bool)):"xor"===n?!!a.length&&a.some((e=>e.bool))&&a.some((e=>!1===e.bool)):a.some((e=>e.bool))):a.some((e=>e.bool))},u.intercept=(e,t)=>{const n=hre(e);s[n]&&s[n].push(t)},u.removeInterceptor=(e,t)=>{const n=hre(e);if(!s[n])return;const r=s[n].indexOf(t);-1!==r&&s[n].splice(r,1)},u.removeAllInterceptors=e=>{const t=[];if(e){const n=hre(e);s[n]&&s[n].length&&t.push({name:e,handlers:s[n]})}else Object.keys(s).forEach((e=>{s[e].length&&t.push({name:pre(e),handlers:s[e]})}));t.forEach((e=>{e.handlers.slice().forEach((t=>u.removeInterceptor(e.name,t)))}))},u.addKeyAlias=(e,t)=>{o[e]=t},u.removeKeyAlias=e=>{delete o[e]},Qne.mixin(u),u}function yre(e){return e*e*e}function vre(e){return--e*e*e+1}function bre(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}S7();const xre=["stroke","fill","color","backgroundColor","thumbColor"];function wre(e,t){const n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n);let a;for(a=0;a<r;++a)i[a]=Sre(e[a],t[a]);for(;a<n;++a)o[a]=t[a];return function(e){for(a=0;a<r;++a)o[a]=i[a](e);return o}}function Sre(e,t,n){const r=typeof t;let i;return null==t||"boolean"===r?function(e){return()=>e}(t):("number"===r?tne:"string"===r?(i=Ate(t))&&xre.includes(n)?(t=i,Jte):one:t instanceof Ate?Jte:t instanceof Date?ene:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?Qte:Array.isArray(t)?wre:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Cre:tne)(e,t)}function Cre(e,t){const n={},r={};let i;for(i in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)i in e?n[i]=Sre(e[i],t[i],i):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}function kre(e,t){return e.data?e.data.value:"text"===e.type?e.text:t}const Ere={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},Mre=/^\$/;function _re(e){const t=typeof e;return"object"!==t&&"function"!==t&&"undefined"!==t}function Rre(e,t,n){const r=e[t];r&&r.scale&&r.scale.pxScale?r.scale=r.scale.pxScale(n):r&&r.pxScale&&(e[t]=r.pxScale(n))}function Ire(e,t){return e.pxScale?e.pxScale(t):e}const Dre={normalizeSettings:function(e,t,n){const r=o8({},e),i=o8({},t);return Object.keys(r).forEach((e=>{i[e]={};const o=r[e],a=typeof o;if("function"==typeof o)i[e].fn=o;else if(_re(o)){let n=t[e];"string"==typeof n&&Mre.test(n)&&(n=Ere[n]);const r=typeof n;i[e]="undefined"===r||r===a?o:n}else o&&"object"==typeof o&&("function"==typeof o.fn&&(i[e].fn=o.fn),void 0!==o.scale&&(i[e].scale=n.scale(o.scale)),"string"==typeof o.ref&&(i[e].ref=o.ref))})),Object.keys(t).forEach((e=>{if(e in r)return;const n=t[e];"string"===typeof n&&Mre.test(n)?i[e]=Ere[n]:i[e]=n})),i},resolveForItem:function(e,t,n){const r={},i=Object.keys(t),o=i.length,a=e.datum,s=e.datum;for(let l=0;l<o;l++){const o=i[l],c=t[o],u="object"==typeof s&&void 0!==c,d=u&&"string"==typeof c.ref,f=u&&o in s,h=d?s[c.ref]:f?s[o]:a;_re(c)?r[o]=c:u&&c.fn?(c.scale&&(e.scale=c.scale),r[o]=c.fn.call(null,e,n)):u&&c.scale&&h?(r[o]=c.scale(h.value),c.scale.bandwidth&&(r[o]+=c.scale.bandwidth()/2)):d&&h?r[o]=h.value:c.fn?r[o]=c.fn.call(null,e,n):r[o]=c}return r},updateScaleSize:Rre};function Pre(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(((e,t)=>Array.isArray(t.children)?(e.push(...Pre(t.children)),e):(e.push(t),e)),[])}function Are(e,t){let{context:n,data:r,style:i,filter:o,mode:a}=t;const s=e.chart.brush(n),l=r,c=i.active||{},u=i.inactive||{},d=[];Object.keys(c).forEach((e=>{d.push(e)})),Object.keys(u).forEach((e=>{-1===d.indexOf(e)&&d.push(e)}));const f=[];let h=!1;const p=()=>{let t=Pre(e.nodes);return"function"==typeof o&&(t=t.filter(o)),t},m=()=>{const e=p(),t=e.length;let n,r=!1;const i="function"==typeof l?l({brush:s}):l;for(let r=0;r<t;r++){if(n=e[r].data,!n)continue;e[r].__style||(e[r].__style={},d.forEach((t=>{e[r].__style[t]=e[r][t]})));const t=s.containsMappedData(n,i,a),o=f.indexOf(e[r]);let l=!1;t&&-1===o?(f.push(e[r]),l=!0):t||-1===o||(f.splice(o,1),l=!0),e[r].needToUpdate=l||h,e[r].isActive=t}for(let i=0;i<t;i++)if(n=e[i].data,n){if(e[i].needToUpdate){const t=o8({},e[i],e[i].__style),n=e[i].isActive;d.forEach((r=>{e[i][r]=n&&r in c?"function"==typeof c[r]?c[r].call(null,t,f):c[r]:!n&&r in u?"function"==typeof u[r]?u[r].call(null,t,f):u[r]:e[i].__style[r]})),r=!0}delete e[i].needToUpdate}return h=!1,r},g=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,r=p(),i=r.length;for(let e=0;e<i;e++)r[e].data&&(r[e].__style=r[e].__style||{},d.forEach((t=>{r[e].__style[t]=r[e][t],t in u&&(r[e][t]="function"==typeof u[t]?u[t].call(null,r[e]):u[t])})));h=!0,f.length=0,n||e.renderer.render(e.nodes)},y=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,r=p(),i=r.length;for(let e=0;e<i;e++)r[e].__style&&(Object.keys(r[e].__style).forEach((t=>{r[e][t]=r[e].__style[t]})),r[e].__style=void 0);f.length=0,n||e.renderer.render(e.nodes)},v=()=>{if(m()){const t="function"==typeof e.config.sortNodes?e.config.sortNodes(e):e.nodes;"function"==typeof e.config.customRender?e.config.customRender({render:e.renderer.render,nodes:t}):e.renderer.render(t)}};return s.on("start",g),s.on("end",y),s.on("update",v),{isActive:()=>s.isActive(),update:()=>{f.length=0,h=!0,m()},cleanUp:function(){s.removeListener("start",g),s.removeListener("end",y),s.removeListener("update",v)}}}function Ore(e){let{nodes:t,action:n,chart:r,trigger:i}=e;const o=[];for(let e=0;e<t.length;e++){let n=t[e].data;null!==n&&o.push(n)}!function(e){let{dataPoints:t,action:n,chart:r,trigger:i}=e;if(!i)return;const o=i.data||[""];let a={items:[],actionFn:"toggleRanges"},s={items:[],actionFn:"toggleValues"};-1!==["add","remove","set","toggle"].indexOf(n)&&(a.actionFn="".concat(n,"Ranges"),s.actionFn="".concat(n,"Values"));for(let e=0;e<t.length;e++){const n=t[e];n&&o.forEach((e=>{let t=n&&!e?n:n[e];if(t){let e={key:t.source.field};void 0!==t.source.key&&(e.key="".concat(t.source.key,"/").concat(t.source.field)),Array.isArray(t.value)?(e.range={min:t.value[0],max:t.value[1]},a.items.push(e)):(e.value=t.value,s.items.push(e))}}))}i.contexts.forEach((e=>{a.items.length?r.brush(e)[a.actionFn](a.items):r.brush(e)[s.actionFn](s.items)}))}({dataPoints:o,action:n,chart:r,trigger:i})}function Lre(e){let{collisions:t,t:n,config:r,action:i}=e,o=[],a=!1;t.length>0&&(o=t,a=!0,"stop"===n.propagation&&(o=[t[t.length-1]]));const s=o.map((e=>e.node));return Ore({nodes:s,action:i,chart:r.chart,data:r.data,trigger:n}),a}function Tre(e,t,n){const r=n.element().getBoundingClientRect();let i=u8(e)?function(e,t){return 1!==e.changedTouches.length?null:{x:e.changedTouches[0].clientX-t.left,y:e.changedTouches[0].clientY-t.top}}(e,r):function(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}(e,r);return null===i||i.x<0||i.y<0||i.x>r.width||i.y>r.height?[]:(t.touchRadius>0&&u8(e)?i={cx:i.x,cy:i.y,r:t.touchRadius}:t.mouseRadius>0&&!u8(e)&&(i={cx:i.x,cy:i.y,r:t.mouseRadius}),n.itemsAt(i))}function qre(e,t,n){return e?"function"==typeof e?e(t):e:n}const Nre={fill:"fill",stroke:"stroke",opacity:"opacity",strokeWidth:"stroke-width",strokeLinejoin:"stroke-linejoin",fontFamily:"font-family",fontSize:"font-size",fontStyle:"font-style",textDecoration:"text-decoration",fontWeight:"font-weight",baseline:"dominant-baseline",dominantBaseline:"dominant-baseline",anchor:"text-anchor",textAnchor:"text-anchor",maxWidth:"maxWidth",transform:"transform",strokeDasharray:"stroke-dasharray",id:"id"};function jre(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="";for(let t=0;t<e.length;t++){const r=e[t];n+=0===t?"M".concat(r.x," ").concat(r.y):"L".concat(r.x," ").concat(r.y),n+=" "}return t&&(n+="Z"),n}function zre(e,t,n,r){const i=n/2,o=e-r/2,a=t-r/2,s=e-i,l=t-i;return[{x:o,y:a},{x:o,y:l},{x:o+r,y:l},{x:o+r,y:a},{x:s+n,y:a},{x:s+n,y:a+r},{x:o+r,y:a+r},{x:o+r,y:l+n},{x:o,y:l+n},{x:o,y:a+r},{x:s,y:a+r},{x:s,y:a}]}function Fre(e){return-e/180*Math.PI}function Wre(e){return function(e){let t=(.5*(Math.floor(e/Math.PI*2)+2)+.25)*Math.PI,n=Math.cos(Math.abs(t-e))*Math.sqrt(2),r=n*Math.cos(e),i=n*Math.sin(e);return{x1:r<0?1:0,y1:i<0?1:0,x2:r>=0?r:r+1,y2:i>=0?i:i+1}}(Fre(e))}function $re(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Bre(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Vre(e,t){return{x:e.x*t,y:e.y*t}}function Hre(e,t){return e.x-t.x}function Ure(e,t){return e.y-t.y}function Gre(e,t){return Hre(e,t)**2+Ure(e,t)**2}function Yre(e,t){return Math.sqrt(Gre(e,t))}function Kre(e,t){return e.x*t.x+e.y*t.y}function Xre(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};const r=Math.cos(t),i=Math.sin(t),o=Bre(e,n);return $re({x:r*o.x-i*o.y,y:i*o.x+r*o.y},n)}const Jre={up:0,down:180,left:90,right:-90};function Qre(e){let{x:t,y:n,size:r}=e;const i=r/2;return{type:"rect",x:t-i,y:n-i,width:r,height:r}}const Zre=S7();Zre.add("circle",(function(e){return{type:"circle",fill:"black",cx:e.x,cy:e.y,r:e.size/2}})),Zre.add("diamond",(function(e){const t=e.size,n=e.x-t/2,r=e.y-t/2;return{type:"path",fill:"black",d:jre([{x:n,y:r+t/2},{x:n+t/2,y:r},{x:n+t,y:r+t/2},{x:n+t/2,y:r+t},{x:n,y:r+t/2}])}})),Zre.add("saltire",(function(e){const t=Fre(45),n=e.size/2,r=isNaN(e.width)?n/2:e.width,i=Math.min(r,n);let o=e.size;const a=Math.sin(Math.asin(-t))*(i/2);o+=2*(n/Math.sin(-t)-n),o-=2*a;const s={x:e.x,y:e.y},l=zre(e.x,e.y,o,i).map((e=>Xre(e,t,s)));return{type:"path",fill:"black",d:jre(l)}})),Zre.add("square",(function(e){const t=e.size;return{type:"rect",fill:"black",x:e.x-t/2,y:e.y-t/2,width:t,height:t}})),Zre.add("triangle",(function(e){const t=e.size,n={x:e.x,y:e.y},r=Jre[e.direction]||0,i=t/2,o=e.x-i,a=e.y-i;let s=[{x:o,y:a+t},{x:o+i,y:a},{x:o+t,y:a+t},{x:o,y:a+t}];const l=Fre(r);return s=s.map((e=>Xre(e,l,n))),{type:"path",fill:"black",d:jre(s)}})),Zre.add("line",(function(e){const t="vertical"===e.direction,n=e.size/2,r=e.x,i=e.y;return{type:"line",stroke:"black",strokeWidth:1,x1:r-(t?0:n),y1:i-(t?n:0),x2:r+(t?0:n),y2:i+(t?n:0),collider:Qre(e)}})),Zre.add("star",(function(e){const t=e.size,n=[],r=t/2,i=e.points||5,o=Math.min(e.innerRadius||t/2,t)/2,a=isNaN(e.startAngle)?90:e.startAngle,s=360/i;for(let t=1;t<=i;t++){const i=s*t+a,l=Fre(i),c=Fre(i+s/2),u=Math.sin(l),d=Math.cos(l),f=Math.sin(c),h=Math.cos(c);n.push({x:e.x+d*r,y:e.y+u*r}),n.push({x:e.x+h*o,y:e.y+f*o})}return{type:"path",fill:"black",d:jre(n)}})),Zre.add("n-polygon",(function(e){const t=[],n=e.size/2,r=Math.max(isNaN(e.sides)?6:e.sides,3),i=360/r,o=isNaN(e.startAngle)?0:e.startAngle;for(let a=1;a<=r;a++){const r=Fre(i*a+o),s=Math.sin(r),l=Math.cos(r);t.push({x:e.x+l*n,y:e.y+s*n})}return{type:"path",fill:"black",d:jre(t)}})),Zre.add("cross",(function(e){const t=e.x,n=e.y,r=e.size/2,i=isNaN(e.width)?r/2:e.width,o=Math.min(i,r);return{type:"path",fill:"black",d:jre(zre(t,n,e.size,o))}})),Zre.add("bar",(function(e){const t={x:e.x,y:e.y},n="vertical"===e.direction,r=e.size/2,i=r/2/2;let o=[{x:t.x-r,y:t.y+i},{x:t.x-r,y:t.y-i},{x:t.x+r,y:t.y-i},{x:t.x+r,y:t.y+i}];if(n){const e=Fre(90);o=o.map((n=>Xre(n,e,t)))}const a=g8(o);return a.type="rect",a.fill="black",a})),Zre.add("rect",(function(e){const{x:t,y:n,size:r}=e,i=void 0===e.width?r:e.width,o=void 0===e.height?r:e.height;return{type:"rect",fill:"black",x:t-i/2,y:n-o/2,width:i,height:o}})),Zre.add("image",(function(e){const{x:t,y:n}=e,{width:r,height:i,imageSrc:o,position:a,symbol:s,imageScalingFactor:l}=e.imageSettings||{};return{type:"image",x:t,y:n,width:r,height:i,src:o,symbol:s,r:10,cx:0,cy:0,imageScalingFactor:l,imagePosition:a}}));const eie=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Zre;return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=e.get(t.type);if(n){const e=n(t);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(t).forEach((n=>{void 0!==Nre[n]&&"transform"!==n&&(e[n]=t[n])}))}(e,t),void 0!==t.data&&(e.data=t.data),e}return n}};function tie(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{dock:n="center",displayOrder:r=0,prioOrder:i=0,preferredSize:o=0,minimumLayoutMode:a,show:s=!0}=e;n=n||"center";return{computePreferredSize(e){let{inner:n,outer:r,children:i}=e;return"function"==typeof o?o({inner:n,outer:r,children:i,dock:this.dock()},t):o},dock(e){return void 0!==e?(n=e,this):"function"==typeof n?n(t):n},displayOrder(e){return void 0!==e?(r=e,this):"function"==typeof r?r(t):r},prioOrder(e){return void 0!==e?(i=e,this):"function"==typeof i?i(t):i},minimumLayoutMode(e){return void 0!==e?(a=e,this):"function"==typeof a?a(t):a},show(e){return void 0!==e?(s=e,this):"function"==typeof s?s(t):s}}}function nie(e,t,n){const{require:r=[]}=t,i=t.mediator||{},{settings:o,formatter:a,scale:s,data:l,renderer:c,chart:u,dockConfig:d,mediator:f,instance:h,rect:p,style:m,registries:g,resolver:y,update:v,_DO_NOT_USE_getInfo:b,symbol:x,isVisible:w}=n;e.emit=()=>{},w&&(e.isVisible=w),Object.defineProperty(e,"settings",{get:o}),Object.defineProperty(e,"data",{get:l}),Object.defineProperty(e,"formatter",{get:a}),Object.defineProperty(e,"scale",{get:s}),Object.defineProperty(e,"mediator",{get:f}),Object.defineProperty(e,"style",{get:m}),Object.defineProperty(e,"registries",{get:g}),p&&Object.defineProperty(e,"rect",{get:p}),b&&(e._DO_NOT_USE_getInfo=b),Object.keys(t).forEach((n=>{var r;r=n,["on","preferredSize","created","beforeMount","mounted","resize","beforeUpdate","updated","beforeRender","render","beforeUnmount","beforeDestroy","destroyed","defaultSettings","data","settings","formatter","scale","chart","dockConfig","mediator","style","resolver","registries","_DO_NOT_USE_getInfo","symbol","isVisible"].some((e=>e===r))||("function"==typeof t[n]?e[n]=t[n].bind(e):e[n]=t[n])})),r.forEach((t=>{"renderer"===t?Object.defineProperty(e,"renderer",{get:c}):"chart"===t?Object.defineProperty(e,"chart",{get:u}):"dockConfig"===t?Object.defineProperty(e,"dockConfig",{get:d}):"instance"===t?Object.defineProperty(e,"instance",{get:h}):"update"===t&&v?Object.defineProperty(e,"update",{get:v}):"resolver"===t?Object.defineProperty(e,"resolver",{get:y}):"symbol"===t&&Object.defineProperty(e,"symbol",{get:x})})),Object.keys(i).forEach((t=>{e.mediator.on(t,i[t].bind(e))}))}function rie(e,t,n){const r=t=>e[t]?(n.warn("Deprecation Warning the ".concat(t," property should be moved into layout: {} property")),e[t]):e.layout?e.layout[t]:void 0,i={};return i.displayOrder=r("displayOrder"),i.dock=r("dock"),i.prioOrder=r("prioOrder"),i.minimumLayoutMode=r("minimumLayoutMode"),e.layout=e.layout||{},e.layout.displayOrder=void 0!==i.displayOrder?i.displayOrder:e.layout.displayOrder,e.layout.prioOrder=void 0!==i.prioOrder?i.prioOrder:e.layout.prioOrder,e.layout.dock=i.dock||e.layout.dock,e.layout.minimumLayoutMode=i.minimumLayoutMode||e.layout.minimumLayoutMode,i.show=e.show,i.preferredSize=t,i}function iie(e,t,n){Object.keys(n.on||{}).forEach((r=>{e.eventListeners=e.eventListeners||[];const i=n.on[r].bind(e);e.eventListeners.push({event:r,listener:i}),t.on(r,i)})),e.emit=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 t.emit(e,...r)}}function oie(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{defaultSettings:n={},_DO_NOT_USE_getInfo:r=()=>({})}=e,{chart:i,container:o,mediator:a,registries:s,theme:l,renderer:c}=t,u=Qne.mixin({});let d,f,h,p,m,g=t.settings||{},y=o8(!0,{},n,g),v=[],b=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Dre,n={};return{resolve:function(r){let{data:i,settings:o,defaults:a={},scaled:s}=r;const l=n.norm=t.normalizeSettings(o,a,e.chart),c={scale:e.chart.scale,formatter:e.chart.formatter};s&&Object.keys(s).forEach((e=>{l[e]&&t.updateScaleSize(l,e,s[e])}));const u=[];if(!i||!Array.isArray(i.items)){const e={data:i,resources:c};let r=t.resolveForItem(e,n.norm,-1);return{settings:n.norm,item:r}}{let e;for(let r=0,o=i.items.length;r<o;r++){e={datum:i.items[r],data:i,resources:c};let o=t.resolveForItem(e,n.norm,r);o.data=i.items[r],u.push(o)}}return{settings:n.norm,items:u}}}}({chart:i}),x=!1;const w={nodes:[],chart:i,config:y.brush||{},renderer:null},S={tap:[],over:[]},C=[],k={},E=o8({},g);function M(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){const i=void 0!==e[t],o=void 0!==g[t];let a;for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];return i&&("function"==typeof e[t]?a=e[t].call(k,...l):r&&(a=e[t])),o&&("function"==typeof g[t]?a=g[t].call(E,...l):r&&(a=g[t])),i||o||(a=n.call(k,...l)),a}}const _=M("preferredSize",(()=>0),!0),R=M("resize",(e=>{let{inner:t}=e;return t})),I=M("created"),D=M("beforeMount"),P=M("mounted"),A=M("beforeUnmount"),O=M("beforeUpdate"),L=M("updated"),T=M("beforeRender"),q=M("beforeDestroy"),N=M("destroyed"),j=e.render,z=()=>{y.brush&&(y.brush.consume||[]).forEach((e=>{e.context&&e.style&&C.push(Are(w,e))}))},F=()=>{y.brush&&(y.brush.trigger||[]).forEach((e=>{"over"===e.on?S.over.push(e):S.tap.push(e)}))};Object.defineProperty(w,"data",{get:()=>v});const W=y.renderer||e.renderer,$=W?c||s.renderer(W)():c||s.renderer()();"function"==typeof $.settings&&$.settings(y.rendererSettings),w.renderer=$;const B={resources:i.logger?{logger:i.logger()}:{}};let V=tie(rie(y,_,i.logger()),B);const H=e=>{e.key=y.key,e.element=$.element()},U=()=>{};U.dockConfig=()=>V,U.set=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.settings&&(g=e.settings,y=o8(!0,{},n,e.settings),V=tie(rie(y,_,i.logger()),B),w.config=y.brush||{}),y.scale&&(d=i.scale(y.scale)),y.data){const{rendererSettings:e}=y,t="function"==typeof(null==e?void 0:e.progressive)&&e.progressive(),n=lte(y.data,{dataset:i.dataset,collection:i.dataCollection},{logger:i.logger()},i.dataCollection);t?t.isFirst?(v=n,v.items&&(v.items=[...n.items])):v.items&&(v.items=[...v.items,...n.items||[]]):v=n}else v=d?d.data():[];"string"==typeof y.formatter||"object"==typeof y.formatter?f=i.formatter(y.formatter):d&&d.data().fields&&(f=d.data().fields[0].formatter()),m=l.style(y.style||{})},U.resize=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=R({inner:e,outer:t});p=n?$.size(n):$.size(e),E.rect=o8(!0,{computedPhysical:p.computedPhysical,computedOuter:t.computed||t,computedInner:e.computed||e},e),p=o8(!0,{computedOuter:t.computed||t,computedInner:e.computed||e},p)},U.getRect=()=>E.rect;const G=()=>{const e=$.renderArgs?$.renderArgs.slice(0):[],{rendererSettings:t}=y;let n=v;const r="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();return v.items&&r&&(n=c8(c8({},v),{},{items:v.items.slice(r.start,r.end)})),e.push({data:n}),e};let Y,K,X;function J(e){const{rendererSettings:t}=y,n="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();n?n.isFirst?w.nodes=[...e||[]]:w.nodes&&(w.nodes=[...w.nodes,...e||[]]):w.nodes=e}U.beforeMount=D,U.beforeRender=()=>{T({size:p})},U.render=()=>{const e=j.call(k,...G());J(e),$.render(e),Y=e,K=E.rect.computed},U.hide=()=>{U.unmount(),$.size({x:0,y:0,width:0,height:0}),$.clear()},U.beforeUpdate=()=>{O({settings:y,data:v})},U.update=()=>{X&&X.stop();const{rendererSettings:e,brush:t,animations:n}=y;if("function"==typeof(null==e?void 0:e.transform)&&e.transform())return $.render(),void(Y=null);const r=j.call(k,...G());J(r),C.forEach((e=>e.cleanUp())),C.length=0,S.tap=[],S.over=[],t&&(z(),F()),C.forEach((e=>{e.isActive()&&e.update()})),Y&&n&&("function"==typeof n.enabled?n.enabled():n.enabled)?(n.compensateForLayoutChanges&&n.compensateForLayoutChanges({currentNodes:Y,currentRect:E.rect.computed,previousRect:K}),X=function(e,t,n,r){let i,{old:o,current:a}=e,{renderer:s}=t,l=[],c={nodes:[],ips:[]},u={nodes:[],ips:[]},d={nodes:[],ips:[]},f=[],h=null;const p=n.trackBy||kre,m={start(){let e={};if(o.forEach(((t,n)=>{let r=p(t,n);e[r]=t})),a.forEach(((t,n)=>{let r=p(t,n);if(e[r]){if("path"===t.type&&t.points&&t.points.length>0&&"trend"!==t.data.source.key){const n=function(e,t){const n=e.points.filter((e=>!e.dummy)),r=t.points.filter((e=>!e.dummy)),i=r.map((e=>e.data.major.value)),o=n.filter((e=>i.includes(e.data.major.value))).map((e=>e.data.major.value)),a=n.filter((e=>o.includes(e.data.major.value))),s=r.filter((e=>o.includes(e.data.major.value)));return{old:a,current:s}}(e[r],t);d.ips.push(Cre(o8({},e[r],{points:n.old}),o8({},t,{points:n.current}))),l.push(o8({},e[r],{commonPoints:n.old}))}else d.ips.push(Cre(e[r],t)),l.push(e[r]);d.nodes.push(t),e[r]=!1}else c.nodes.push(t),c.ips.push(Cre(o8({},t,{r:.001,opacity:0}),t))})),Object.keys(e).forEach((t=>{e[t]&&(u.nodes.push(e[t]),u.ips.push(Cre(e[t],o8({},e[t],{r:1e-4,opacity:0}))))})),f.push({name:"exiting",easing:yre,duration:200,tweens:u.ips,nodes:[...l]}),f.push({name:"updating",easing:bre,duration:400,tweens:d.ips,nodes:[]}),f.push({name:"entering",easing:vre,duration:200,tweens:c.ips,nodes:[...d.nodes]}),n.isMainComponent){var t;const e=null===(t=n.isMainComponent)||void 0===t?void 0:t.filterFn,i=e?l.filter(e).length:l.length,{isInit:o,shouldBeRemoved:a}=r.getValue("animations.updatingStageMeta");!1===o?(r.setValue("animations.updatingStageMeta.shouldBeRemoved",0===i),r.setValue("animations.updatingStageMeta.isInit",!0)):r.setValue("animations.updatingStageMeta.shouldBeRemoved",a&&0===i)}f.length&&(h=s.getScene(a),f[0].started=Date.now(),"undefined"!=typeof window&&(i=window.requestAnimationFrame(m.tick)))},tick(){let e=f[0];e||m.stop(),e.started||(e.started=Date.now());let t=(Date.now()-e.started)/e.duration,o=[],a=e.tweens.map((n=>n(e.easing(Math.min(1,t)))));const{adjustTweenedNodes:l}=n;if(l&&l(a),o.push(...a),o.push(...e.nodes),s.render(o),t>=1){f.shift();const{isInit:e,shouldBeRemoved:t}=r.getValue("animations.updatingStageMeta");f.length?"updating"===f[0].name&&t&&f.shift():(!0===e&&r.setValue("animations.updatingStageMeta.isInit",!1),m.stop())}i&&(i=window.requestAnimationFrame(m.tick))},stop(){i&&(window.cancelAnimationFrame(i),i=!1)},inProgress:()=>!!i,get targetScene(){return h}};return m}({old:Y,current:r},{renderer:$},n,i.storage),X.start()):$.render(r),Y=r,K=E.rect.computed,$.setKey&&"string"==typeof g.key&&$.setKey(g.key)},U.updated=L,U.destroy=()=>{U.unmount(),q(h),$.destroy(),N(),h=null};const Q=e=>{w.nodes=e,C.forEach((e=>{e.isActive()&&e.update()})),$.render(e)};return nie(k,e,{settings:()=>y,data:()=>v,scale:()=>d,formatter:()=>f,renderer:()=>$,chart:()=>i,dockConfig:()=>V,mediator:()=>a,instance:()=>E,rect:()=>E.rect,style:()=>m,update:()=>Q,registries:()=>s,resolver:()=>b,symbol:()=>eie(s.symbol)}),nie(E,g,{settings:()=>y,data:()=>v,scale:()=>d,formatter:()=>f,renderer:()=>$,chart:()=>i,dockConfig:()=>V,mediator:()=>a,style:()=>m,_DO_NOT_USE_getInfo:r.bind(k),isVisible:()=>x}),U.getBrushedShapes=function(e,t,n){const r=[];if(y.brush&&y.brush.consume){const o=i.brush(e),a=$.findShapes("*");y.brush.consume.filter((t=>t.context===e)).forEach((e=>{for(let i=0;i<a.length;i++){const s=a[i];s.data&&o.containsMappedData(s.data,n||e.data,t)&&(H(s),r.push(s),a.splice(i,1),i--)}}))}return r},U.findShapes=e=>{var t;const n=(null!==(t=X)&&void 0!==t&&t.inProgress()?X.targetScene:$).findShapes(e);for(let e=0,t=n.length;e<t;e++)H(n[e]);return n},U.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=$.itemsAt(e);let r;r=t&&"stop"===t.propagation&&n.length>0?[n.pop().node]:n.map((e=>e.node));for(let e=0,t=r.length;e<t;e++)H(r[e]);return r},U.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.contexts=Array.isArray(t.contexts)?t.contexts:[];Ore({nodes:e,action:t.action||"toggle",trigger:t,chart:i,data:w.data})},U.mount=()=>{h=$.element&&$.element()?h:$.appendTo(o),$.setKey&&"string"==typeof g.key&&$.setKey(g.key),y.brush&&(z(),F()),iie(E,u,g),iie(k,u,e),x=!0},U.mounted=()=>P(h),U.unmount=()=>{[E,k].forEach((e=>{!function(e,t){e.eventListeners&&(e.eventListeners.forEach((e=>{let{event:n,listener:r}=e;t.removeListener(n,r)})),e.eventListeners.length=0),e.emit=()=>{}}(e,u)})),S.tap=[],S.over=[],C.forEach((e=>{e.cleanUp()})),C.length=0,A(),x=!1},U.onBrushTap=e=>{S.tap.forEach((t=>{(function(e){let{e:t,t:n,config:r}=e;return Lre({collisions:Tre(t,n,r.renderer),t:n,config:r,action:qre(n.action,t,"toggle")})})({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&i.toggleBrushing(!0)}))},U.onBrushOver=e=>{S.over.forEach((t=>{(function(e){let{e:t,t:n,config:r}=e;return Lre({collisions:Tre(t,n,r.renderer),t:n,config:r,action:qre(n.action,t,"set")})})({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&i.toggleBrushing(!0)}))},U.def=k,U.ctx=E,U.renderer=()=>$,U.set({settings:g}),I(),U}function aie(e){const t=o8(!0,{},e),n={getAll:()=>t,getValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return n;const r=t.split(".");let i=e;for(let e=0;e<r.length;++e){const t=r[e];if(void 0===i[t])return n;i=i[t]}return i}(t,e,n),setValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return;const r=t.split("."),i=r[r.length-1];let o=e;for(let e=0;e<r.length-1;++e){const t=r[e];void 0===o[t]&&(o[t]=Number.isNaN(+r[e+1])?{}:[]),o=o[t]}void 0!==n?o[i]=n:delete o[i]}(t,e,n)};return n}function sie(e,t,n){const r=$re(function(e,t){const n=Kre(e,t)/Kre(t,t)||1;return{x:t.x*n,y:t.y*n}}(Bre(n,e),Bre(t,e)),e);return r}function lie(e,t,n){return Yre(e,n)+Yre(t,n)-Yre(e,t)<1e-12}function cie(e,t){return e.x>=t.x&&e.x+e.width<=t.x+t.width&&e.y>=t.y&&e.y+e.height<=t.y+t.height}function uie(e){return e.x1===e.x2&&e.y1===e.y2}function die(e){return e.width<=0||e.height<=0}function fie(e){return e.r<=0}function hie(e){return e.edges.length<=2}function pie(e,t){let n=!1;for(let r=0,i=t.edges.length;r<i;r++)if(n=wie(e,y8(t.edges[r])),!0===n)return!0;return!1}function mie(e,t){let n=!1;const{numPolygons:r,polygons:i}=t;for(let t=0;t<r;t++){if(n=Die(e,i[t]),!0===n)return!0}return!1}function gie(e,t){if(fie(e))return!1;return Gre({x:e.cx,y:e.cy},t)<=e.r**2}function yie(e,t){if(die(t)||fie(e))return!1;const n=t.width/2,r=t.height/2,i=t.x+n,o=t.y+r,a=e.r,s=e.cx,l=e.cy,c=Math.abs(s-i),u=Math.abs(l-o);if(c>n+a||u>r+a)return!1;if(c<=n||u<=r)return!0;return(c-n)**2+(u-r)**2<=a**2}function vie(e,t){if(fie(e)||uie(t))return!1;const[n,r]=p8(t);if(gie(e,n)||gie(e,r))return!0;const i={x:e.cx,y:e.cy},o=sie(n,r,i);return Gre(o,i)<=e.r**2&&lie(n,r,o)}function bie(e,t){if(hie(t)||fie(e))return!1;if(xie(t,{x:e.cx,y:e.cy}))return!0;const n=t.edges.length;for(let r=0;r<n;r++){if(vie(e,y8(t.edges[r])))return!0}return!1}function xie(e,t){if(hie(e)||!Eie(e.boundingRect(),t))return!1;const{x:n,y:r}=t,i=e.vertices;let o,a,s,l,c;for(o=!1,l=-1,a=i.length,s=a-1;++l<a;s=l){if(i[l].x===n&&i[l].y===r)return!0;if(i[l].y===i[s].y&&i[l].y===r&&(n-i[l].x)*(n-i[s].x)<=0)return!0;if(i[l].y<r&&r<=i[s].y||i[s].y<r&&r<=i[l].y){if(c=(i[s].x-i[l].x)*(r-i[l].y)/(i[s].y-i[l].y)+i[l].x,n===c)return!0;n<c&&(o=!o)}}return o}function wie(e,t){if(hie(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if(_ie(t,y8(e.edges[n])))return!0}const[n,r]=p8(t);return xie(e,n)||xie(e,r)}function Sie(e,t){if(hie(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if(Mie(t,y8(e.edges[n])))return!0}const[n,r,i,o]=m8(t);return xie(e,n)||xie(e,r)||xie(e,i)||xie(e,o)}function Cie(e,t){return!die(e)&&!die(t)&&(e.x<=t.x+t.width&&t.x<=e.x+e.width&&e.y<=t.y+t.height&&t.y<=e.y+e.height)}function kie(e,t){if(die(e)||die(t))return!1;return[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}].every((t=>Eie(e,t)))}function Eie(e,t){return!die(e)&&(t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height)}function Mie(e,t){if(uie(t)||die(e))return!1;const[n,r]=p8(t);if(Eie(e,n)||Eie(e,r))return!0;const i=m8(e);let o=i.length;for(let e=0;e<o;e++){if(_ie(y8([i[e],i[3!==e?e+1:0]]),t))return!0}return!1}function _ie(e,t){const[n,r]=p8(e),[i,o]=p8(t),a=Hre(r,n),s=Ure(r,n),l=Hre(o,i),c=Ure(o,i),u=Hre(n,i),d=Ure(n,i);let f=c*a-l*s;const h=l*d-c*u,p=a*d-s*u;let m,g;if(0===a&&0===s)return!1;if(0===l&&0===c)return!1;if(0===f){if(0===h&&0===p){if(0===a){if(0===s)return n.x===r.x&&n.y===r.y;m=Ure(i,n)/s,g=Ure(o,n)/s}else m=(i.x-n.x)/a,g=(o.x-n.x)/a;return!(m<0&&g<0||m>1&&g>1)}return!1}const y=h/f;return f=p/f,y>=0&&y<=1&&f>=0&&f<=1}function Rie(e,t){if(uie(e))return!1;const[n,r]=p8(e);return lie(n,r,t)}function Iie(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!Cie(n,r)&&(kie(n,r)?pie(e,t):pie(t,e))}function Die(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!Cie(n,r)&&(kie(r,n)?function(e,t){let n=!1;const{numPolygons:r,polygons:i}=e;for(let e=0;e<r;e++)if(n=Iie(t,i[e]),!0===n)return!0;return!1}(e,t):function(e,t){let n=!1;for(let r=0,i=t.edges.length;r<i;r++)if(n=Oie(e,y8(t.edges[r])),!0===n)return!0;return!1}(e,t))}function Pie(e,t){if(fie(e))return!1;if(Aie(t,{x:e.cx,y:e.cy}))return!0;const{numPolygons:n,polygons:r}=t;for(let t=0;t<n;t++){const n=r[t],i=n.edges.length;for(let t=0;t<i;t++){if(vie(e,y8(n.edges[t])))return!0}}return!1}function Aie(e,t){if(!Eie(e.boundingRect(),t))return!1;const{x:n,y:r}=t,i=e.numPolygons;let o,a,s,l,c,u,d=!1;for(a=0;a<i;a++)for(o=e.vertices[a],c=-1,s=o.length,l=s-1;++c<s;l=c){if(o[c].x===n&&o[c].y===r)return!0;if(o[c].y===o[l].y&&o[c].y===r&&(n-o[c].x)*(n-o[l].x)<=0)return!0;if(o[c].y<r&&r<=o[l].y||o[l].y<r&&r<=o[c].y){if(u=(o[l].x-o[c].x)*(r-o[c].y)/(o[l].y-o[c].y)+o[c].x,n===u)return!0;n<u&&(d=!d)}}return d}function Oie(e,t){const[n,r]=p8(t);if(Aie(e,n)||Aie(e,r))return!0;const{numPolygons:i,polygons:o}=e;for(let e=0;e<i;e++){const n=o[e];for(let e=0,r=n.edges.length;e<r;e++){if(_ie(t,y8(n.edges[e])))return!0}}return!1}function Lie(e,t){const[n,r,i,o]=m8(t);if(Aie(e,n)||Aie(e,r)||Aie(e,i)||Aie(e,o))return!0;const{numPolygons:a,polygons:s}=e;for(let e=0;e<a;e++){const n=s[e];for(let e=0,r=n.edges.length;e<r;e++){if(Mie(t,y8(n.edges[e])))return!0}}return!1}const Tie=/^\$/,qie="@extend";function Nie(e){throw new Error('Cyclical reference for "'.concat(e,'"'))}function jie(e,t,n){if("string"==typeof e){let r=t[e];return-1!==n.indexOf(e)&&Nie(e),Tie.test(r)?(n.push(e),jie(r,t,n)):r}let r=e;const i=o8(!0,{},t,e),o={};if(e[qie]){const o=e[qie];-1!==n.indexOf(o)&&Nie(o);let a=n.slice();a.push(o),r=o8(!0,{},jie(i[o],t,a),e)}return Object.keys(r).forEach((e=>{let t=n.slice();if(e===qie||Tie.test(e))return;o[e]=r[e];let a=o[e];Tie.test(a)&&a in i?(-1!==n.indexOf(a)&&Nie(a),t.push(a),a=i[a],"object"==typeof a||Tie.test(a)&&a in i?o[e]=jie(a,i,t):o[e]=a):"object"==typeof a&&(o[e]=jie(a,i,t))})),o}function zie(e,t){return jie(e,t,[])}function Fie(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=e;const r=e=>{e.forEach((e=>{const n=Array.isArray(e.colors[0])?e.colors:[e.colors];t[e.key]={colors:n,sizes:n.map((e=>e?e.length:0))}}))},i={palette:(e,n)=>((e,n)=>{const r=t[e];if(!r)return[];const i=r.sizes;for(let e=0;e<i.length;e++)if(n<=i[e])return r.colors[e];return r.colors[i.length-1]})(e,n),setPalettes:r,style:e=>zie(e,n),setStyle:t=>{n=o8({},e,t)}};return r(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]),i}function Wie(e){e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.floor(e.width),e.height=Math.floor(e.height)}function $ie(e){const t={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return o8(!0,t,e),t.center.minWidthRatio=Math.min(Math.max(t.center.minWidthRatio,0),1),t.center.minHeightRatio=Math.min(Math.max(t.center.minHeightRatio,0),1),t.center.minWidth=Math.max(t.center.minWidth,0),t.center.minHeight=Math.max(t.center.minHeight,0),t}function Bie(e,t,n,r,i){return{x:isNaN(e)?0:e,y:isNaN(e)?0:t,width:isNaN(e)?0:n,height:isNaN(e)?0:r,margin:isNaN(i)?0:i}}function Vie(e,t,n){if(void 0===e.cachedSize){const r=e.config.dock();let i,o=e.comp.preferredSize({inner:t,outer:n,dock:r});isNaN(o)?o&&!isNaN(o.size)&&(o.width=o.size,o.height=o.size):o={width:o,height:o},i="top"===r||"bottom"===r?o.height:"right"===r||"left"===r?o.width:Math.max(o.width,o.height),e.cachedSize=Math.ceil(i),e.edgeBleed=o.edgeBleed||0}return e.cachedSize}function Hie(e,t){switch(t.config.dock()){case"top":e.y+=t.cachedSize,e.height-=t.cachedSize;break;case"bottom":e.height-=t.cachedSize;break;case"left":e.x+=t.cachedSize,e.width-=t.cachedSize;break;case"right":e.width-=t.cachedSize}}function Uie(e,t){const n=t.edgeBleed;n&&(e.left=Math.max(e.left,n.left||0),e.right=Math.max(e.right,n.right||0),e.top=Math.max(e.top,n.top||0),e.bottom=Math.max(e.bottom,n.bottom||0))}function Gie(e,t,n){t.x<n.left&&(t.width-=n.left-t.x,t.x=n.left);const r=e.width-(t.x+t.width);r<n.right&&(t.width-=n.right-r),t.y<n.top&&(t.height-=n.top-t.y,t.y=n.top);const i=e.height-(t.y+t.height);i<n.bottom&&(t.height-=n.bottom-i)}function Yie(e,t,n,r,i){const o=o8({},t),a=o8({},n);Hie(o,r),Uie(a,r),Gie(e,o,a);const s=function(e,t,n){const r=Math.min(n.center.minWidth,e.width)||Math.max(e.width*n.center.minWidthRatio,1),i=Math.min(n.center.minHeight,e.height)||Math.max(e.height*n.center.minHeightRatio,1);return t.width>=r&&t.height>=i}(e,o,i);return!!s&&(Hie(t,r),Uie(n,r),!0)}function Kie(e){return{x:e.margin.left+e.x*e.scaleRatio.x,y:e.margin.top+e.y*e.scaleRatio.y,width:e.width*e.scaleRatio.x,height:e.height*e.scaleRatio.y}}function Xie(e){return g8([].concat(...e.map(m8)))}function Jie(e){let{visible:t,layoutRect:n,reducedRect:r,containerRect:i,translation:o}=e;const a=Bie(r.x,r.y,r.width,r.height),s=Bie(r.x,r.y,r.width,r.height),l={},c=t.slice(),u=c.slice().sort(((e,t)=>e.config.displayOrder()-t.config.displayOrder()));return t.sort(((e,t)=>{if(e.referencedDocks.length>0&&t.referencedDocks.length>0)return 0;if(t.referencedDocks.length>0)return-1;if(e.referencedDocks.length>0)return 1;const n=e.config.displayOrder()-t.config.displayOrder();return 0===n?c.indexOf(e)-c.indexOf(t):n})).forEach((e=>{let t={},c={};switch(e.config.dock()){case"top":t.height=c.height=e.cachedSize,t.width=n.width,c.width=a.width,t.x=n.x,c.x=a.x,t.y=c.y=a.y-e.cachedSize,a.y-=e.cachedSize,a.height+=e.cachedSize;break;case"bottom":t.x=n.x,c.x=a.x,t.y=c.y=a.y+a.height,t.width=n.width,c.width=a.width,t.height=c.height=e.cachedSize,a.height+=e.cachedSize;break;case"left":t.x=c.x=s.x-e.cachedSize,t.y=n.y,c.y=s.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=s.height,s.x-=e.cachedSize,s.width+=e.cachedSize;break;case"right":t.x=c.x=s.x+s.width,t.y=n.y,c.y=s.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=s.height,s.width+=e.cachedSize;break;case"center":t.x=c.x=r.x,t.y=c.y=r.y,t.width=c.width=r.width,t.height=c.height=r.height;break;default:if(e.referencedDocks.length>0){const n=e.referencedDocks.map((e=>l[e])).filter((e=>!!e));n.length>0&&(t=Xie(n.map((e=>e.outerRect))),c=Xie(n.map((e=>e.r))))}}e.key&&(l[e.key]={r:c,outerRect:t}),function(e,t,n,r){const i={x:r.width/n.width,y:r.height/n.height},o={left:0,top:0};if(n.preserveAspectRatio){const e=i.x<i.y,t=Math.min(i.x,i.y);i.x=t,i.y=t;const a=e?"height":"width",s=(r[a]-n[a]*i.x)*n.align;o.left=e?0:s,o.top=e?s:0}e.scaleRatio=i,e.margin=o,t.scaleRatio=i,t.margin=o,n.scaleRatio=i,n.margin=o}(c,t,n,i),c.edgeBleed=e.edgeBleed,c.computed=Kie(c),t.edgeBleed=e.edgeBleed,t.computed=Kie(t),c.x+=o.x,c.y+=o.y,t.x+=o.x,t.y+=o.y,e.comp.resize(c,t),e.cachedSize=void 0,e.edgeBleed=void 0})),u}function Qie(e,t,n){const r=e.layoutModes||{},i=t.minimumLayoutMode();let o=t.show();return o&&"object"==typeof i?o=r[i.width]&&r[i.height]&&n.width>=r[i.width].width&&n.height>=r[i.height].height:o&&void 0!==i&&(o=r[i]&&n.width>=r[i].width&&n.height>=r[i].height),o}function Zie(e){if(!e.resize||"function"!=typeof e.resize)throw new Error("Component is missing resize function");if(!e.dockConfig&&!e.preferredSize)throw new Error("Component is missing preferredSize function")}function eoe(e){let t=$ie(e);const n={};return n.layout=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e||isNaN(e.x)||isNaN(e.y)||isNaN(e.width)||isNaN(e.height))throw new Error("Invalid rect");if(!n.length)return{visible:[],hidden:[],ordered:[]};const{logicalContainerRect:r,containerRect:i}=function(e,t){const n={x:0,y:0,width:0,height:0},r={x:0,y:0,width:0,height:0};return n.width=e.width||0,n.height=e.height||0,void 0!==t.size&&(n.width=isNaN(t.size.width)?n.width:t.size.width,n.height=isNaN(t.size.height)?n.height:t.size.height),void 0!==t.logicalSize?(r.width=isNaN(t.logicalSize.width)?n.width:t.logicalSize.width,r.height=isNaN(t.logicalSize.height)?n.height:t.logicalSize.height,r.align=isNaN(t.logicalSize.align)?.5:Math.min(Math.max(t.logicalSize.align,0),1),r.preserveAspectRatio=t.logicalSize.preserveAspectRatio):(r.width=n.width,r.height=n.height,r.preserveAspectRatio=!1),Wie(r),Wie(n),{logicalContainerRect:r,containerRect:n}}(e,t),[o,a]=function(e,t,n){const r=[],i=[];for(let o=0;o<e.length;++o){const a=e[o];Zie(a);let s=a.dockConfig;const l=a.key,c=s.dock(),u=/@/.test(c)?c.split(",").map((e=>e.replace(/^\s*@/,""))):[];Qie(t,s,n)?r.push({comp:a,key:l,config:s,referencedDocks:u}):i.push({comp:a,key:l,config:s,referencedDocks:u})}return[r,i]}(n,t,r),s=function(e){let{layoutRect:t,visible:n,hidden:r,settings:i}=e;const o=Bie(t.x,t.y,t.width,t.height),a={left:0,right:0,top:0,bottom:0},s=n.slice();s.sort(((e,t)=>e.config.prioOrder()-t.config.prioOrder()));for(let e=0;e<s.length;++e){const n=s[e];Vie(n,o,t),Yie(t,o,a,n,i)||(r.push(s.splice(e,1)[0]),--e)}!function(e,t){if(0!==t.length)for(let n=0;n<e.length;++n){let r=e[n];if(r.referencedDocks.length){const i=r.referencedDocks.every((e=>t.some((t=>t.key===e))));i&&t.push(e.splice(n,1)[0])}}}(n,r);const l=n.filter((e=>-1!==s.indexOf(e)));return n.length=0,n.push(...l),Gie(t,o,a),o}({layoutRect:r,visible:o,hidden:a,settings:t}),l=Jie({visible:o,layoutRect:r,reducedRect:s,containerRect:i,translation:{x:e.x,y:e.y}});return a.forEach((e=>{e.comp.visible=!1;const t=Bie();e.comp.resize(t,t)})),{visible:o.map((e=>e.comp)),hidden:a.map((e=>e.comp)),ordered:l.map((e=>e.comp))}},n.settings=function(e){t=$ie(e)},n}const toe=(e,t)=>{for(let n=0;n<e.length;n++){const r=e[n];if(r.hasKey&&r.key===t)return e[n]}return null},noe=e=>null==e?void 0:e.map((e=>{const t=e.instance.dockConfig();return{preferredSize:n=>t.computePreferredSize(c8(c8({},n),{},{children:noe(e.children)}))}})),roe=(e,t)=>({visible:[],hidden:t,ordered:[]}),ioe=e=>(t,n)=>{var r;const i=n.map(((e,t)=>{const n=e.instance.dockConfig();return{index:t,key:e.key,dockConfig:n,resize:e.instance.resize,preferredSize:t=>n.computePreferredSize(c8(c8({},t),{},{children:noe(e.children)}))}})),o=e=>n[e.index],{visible:a=i,hidden:s=[],ordered:l=a}=null!==(r=e(t,i))&&void 0!==r?r:{};return{visible:a.map(o),hidden:s.map(o),ordered:l.map(o)}},ooe=e=>"function"==typeof e?ioe(e):(e=>{const t=eoe(e);return ioe(((e,n)=>t.layout(e,n)))})(e);function aoe(e,t,n){const r=t.left-n.left,i=t.top-n.top,o=v8(e),a=o8(!0,{},e);switch(o){case"circle":a.cx+=r,a.cy+=i;break;case"polygon":for(let e=0,t=a.vertices.length;e<t;e++){const t=a.vertices[e];t.x+=r,t.y+=i}break;case"geopolygon":for(let e=0;e<a.vertices.length;e++){const t=a.vertices[e];for(let e=0,n=t.length;e<n;e++){const n=t[e];n.x+=r,n.y+=i}}break;case"line":a.x1+=r,a.y1+=i,a.x2+=r,a.y2+=i;break;case"point":case"rect":a.x+=r,a.y+=i}return a}function soe(e,t){const n=[];let r=0;t.forEach((e=>{n.push(r),r++;const t=e.instance.def.additionalElements&&e.instance.def.additionalElements();t&&(r+=t.length)})),t.forEach(((t,r)=>((e,t,n)=>{const r=t.instance.renderer().element();if(isNaN(n)||!r||!e||!e.children)return;const i=e.children[Math.max(0,n)];if(r===i)return;const o=t.instance.def.additionalElements&&t.instance.def.additionalElements().filter(Boolean);e.insertBefore&&void 0!==i?(e.insertBefore(r,i),o&&o.forEach((t=>{e.insertBefore(t,r)}))):(o&&o.forEach((t=>{e.appendChild(t,r)})),e.appendChild(r))})(e,t,n[r])))}function loe(e,t){let{element:n,data:r=[],settings:i={},on:o={}}=e;const a=t.registries,s=t.logger,l=Fie(t.style,t.palettes),c=[],u=o8({},e),d=function(){const e={};return Qne.mixin(e),e}();let f=[],h=null,p=null,m=null,g=[],y=()=>{},v=()=>{};const b={};let x=!1;const w=function(e){let{createComponent:t}=e;const n={};let r=[],i=[];const o=e=>{const n=t(e);return n&&(r.push(n),e.components&&(n.children=e.components.map((e=>o(e))).filter((e=>!!e)))),n},a=e=>{const t=r.indexOf(e);-1!==t&&r.splice(t,1)},s=(e,t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n],i=t.find((e=>r.hasKey&&r.key===e.key));i?r.children&&i.components&&s(r.children,i.components):(e.splice(n,1),a(r),r.children&&s(r.children,[]),r.instance.destroy())}},l=e=>{let{compList:t,data:n,excludeFromUpdate:r,formatters:i,scales:a,settingsList:s}=e;return s.map((e=>{const s=toe(t,e.key);return r.indexOf(e.key)>-1?(delete s.updateWith,s):s?(e.rendererSettings&&"function"==typeof s.instance.renderer().settings&&s.instance.renderer().settings(e.rendererSettings),e.rendererSettings&&"function"==typeof e.rendererSettings.transform&&e.rendererSettings.transform()?(s.applyTransform=!0,s):(s.updateWith={formatters:i,scales:a,data:n,settings:e},e.components&&(s.children=l({compList:s.children||[],data:n,excludeFromUpdate:r,formatters:i,scales:a,settingsList:e.components})),s)):o(e)})).filter((e=>!!e))},c=e=>{let{components:t,hidden:n,layoutFn:r,ordered:i,rect:o,visible:a}=e;const{visible:s,hidden:l,ordered:u}=r(o,t);a.push(...s),n.push(...l),i.push(...u),s.forEach((e=>{if(e.children){var t,r;const o=ooe(null!==(t=null===(r=e.settings)||void 0===r?void 0:r.strategy)&&void 0!==t?t:{});c({components:e.children,hidden:n,layoutFn:o,ordered:i,rect:e.instance.getRect(),visible:a})}})),l.forEach((e=>{e.children&&c({components:e.children,hidden:n,layoutFn:roe,ordered:i,rect:null,visible:a})}))};return n.destroy=()=>{r.forEach((e=>e.instance.destroy())),r=[],i=[]},n.findComponentByKey=e=>toe(r,e),n.forEach=e=>{r.forEach(e)},n.layout=e=>{let{layoutSettings:t,rect:n}=e;const r=[],o=[],a=[],s=ooe(t);return c({components:i,hidden:o,layoutFn:s,ordered:a,rect:n,visible:r}),{visible:r,hidden:o,ordered:a}},n.set=e=>{let{components:t}=e;i=t.map((e=>o(e))).filter((e=>!!e))},n.update=e=>{let{components:t,data:n,excludeFromUpdate:r,formatters:o,scales:a}=e;s(i,t),i=l({compList:i,data:n,excludeFromUpdate:r,formatters:o,scales:a,settingsList:t})},n}({createComponent:e=>{if(!a.component.has(e.type))return s.warn("Unknown component: ".concat(e.type)),!1;return{instance:oie(a.component(e.type),{settings:e,chart:u,mediator:d,registries:a,theme:l,container:n}),settings:o8(!0,{},e),key:e.key,hasKey:void 0!==e.key}}});function S(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return function(){const r="function"==typeof e[t];let i;for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return i=r?e[t].call(u,...a):n.call(u,...a),i}}const C=()=>{let e;i.dockLayout?(s.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),e=i.dockLayout):e=i.strategy;const t=function(e){if("function"==typeof e.getBoundingClientRect){const{width:t,height:n}=e.getBoundingClientRect();return{x:0,y:0,width:t,height:n}}return{x:0,y:0,width:0,height:0}}(n);return w.layout({layoutSettings:e,rect:t})},k=S("created"),E=S("beforeMount"),M=S("mounted"),_=S("beforeUpdate"),R=S("updated"),I=S("beforeRender"),D=S("beforeDestroy"),P=S("destroyed"),A=function(e,t){let{partialData:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{formatters:r={},scales:i={},scroll:o={}}=t;y=function(e,t){let{types:n,logger:r}=t;const i={},o=[];return Array.isArray(e)?o.push(...e):(r.warn('Deprecated: "data-source" configuration"'),o.push(e)),o.forEach(((e,t)=>{let o=n(e.type);if(o){let n=e.key;void 0===e.key&&(r.warn("Missing key for dataset. Using index '".concat(t,"' as key.")),n=t);let a=o({key:n,data:e.data,config:e.config});i[n]=a}})),e=>e?i[e]:i[Object.keys(i)[0]]}(e,{logger:s,types:a.data}),n||Object.keys(b).forEach((e=>b[e].clear())),t.palettes&&l.setPalettes(t.palettes),t.style&&l.setStyle(t.style),v=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:lte;const i={};return(e||[]).forEach((e=>{if(!e.key)throw new Error('Data collection is missing "key" property');if("object"==typeof e.data&&"collection"in e.data)throw new Error("Data config for collections may not reference other collections");i[e.key]=()=>r(e.data,t,n)})),e=>{let t,n;if("string"==typeof e?t=e:"object"==typeof e&&(t=e.key,n=e),!(t in i))throw new Error("Unknown data collection: ".concat(t));"function"==typeof i[t]&&(i[t]=i[t]());let r=i[t];if(n&&n.fields&&n.fields.filter){let e=r.fields.filter(n.fields.filter);r.fields.length!==e.length&&(r=o8(r,{fields:e}))}return r}}(t.collections,{dataset:y},{logger:s});const c={theme:l,logger:s};h=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Yne;const i={};return{get(o){let a;return"string"==typeof o&&e[o]?a=o:"object"==typeof o&&"scale"in o&&e[o.scale]&&(a=o.scale),a?(i[a]=i[a]||r(e[a],t,n),i[a]):r(o,t,n)},all(){return Object.keys(e).forEach(this.get),i}}}(i,{dataset:y,collection:v},c8(c8({},c),{},{scale:a.scale})),p=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:cte;const i={};return{get(o){let a;return"string"==typeof o&&e[o]?a=o:"object"==typeof o&&"formatter"in o&&e[o.formatter]?a=o.formatter:"object"==typeof o&&"type"in o&&e[o.type]&&(a=o.type),a?(i[a]=i[a]||r(e[a],t,n),i[a]):r(o||{},t,n)},all(){return Object.keys(e).forEach(this.get),i}}}(r,{dataset:y,collection:v},c8(c8({},c),{},{formatter:a.formatter})),m=function(e,t){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=ere(e[r],t?t[r]:null));return n}(o,m)};function O(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},r=e.filter((e=>!!e.key)).map((e=>e.key));g.forEach((e=>{e.key&&-1!==r.indexOf(e.key)?t[e.key]=e:e.destroy()})),g=e.map((e=>{const r=e.key&&t[e.key]?t[e.key]:a.interaction(e.type)(u,d,n);return r.set(e),r}))}const L=e=>{const t=n.getBoundingClientRect(),r="clientX"in e?e.clientX:e.x,i="clientY"in e?e.clientY:e.y,o={x:r-t.left,y:i-t.top},a=[];return f.forEach((e=>{const t=e.instance.getRect();Eie(t.computedPhysical?t.computedPhysical:{x:t.margin.left+t.x*t.scaleRatio.x,y:t.margin.top+t.y*t.scaleRatio.y,width:t.width*t.scaleRatio.x,height:t.height*t.scaleRatio.y},o)&&a.push(e)})),a},T=()=>{if(c.length||!n)return;Object.keys(o).forEach((e=>{const t=o[e].bind(u);n.addEventListener(e,t),c.push({key:e,listener:t})}));const e={},t=t=>{t.touches?(e.x=t.touches[0].clientX,e.y=t.touches[0].clientY,e.multiTouch=t.touches.length>1):(e.x=t.clientX,e.y=t.clientY,e.multiTouch=!1),e.time=Date.now(),e.comps=L(e)},r=t=>{const n=e.comps||L(t);if(!n.every((e=>e.instance.def.disableTriggers))&&("touchend"===t.type&&t.preventDefault(),function(e,t){const n=u8(e),r=n?e.changedTouches[0]:e,i=Date.now()-t.time,o=isNaN(t.x)?0:Math.abs(r.clientX-t.x),a=isNaN(t.y)?0:Math.abs(r.clientY-t.y);return(0===e.button||n)&&!t.multiTouch&&o<=12&&a<=12&&i<=300}(t,e)))for(let e=n.length-1;e>=0;e--){if(n[e].instance.onBrushTap(t),x){x=!1;break}}},i=[];i.push({key:"mousedown",listener:t}),i.push({key:"mouseup",listener:r}),function(e){return"ontouchstart"in e&&"ontouchend"in e||navigator.maxTouchPoints>1}(n)&&(i.push({key:"touchstart",listener:t}),i.push({key:"touchend",listener:r})),i.push({key:"mousemove",listener:e=>{const t=L(e);for(let n=t.length-1;n>=0;n--){if(t[n].instance.onBrushOver(e),x){x=!1;break}}}}),i.forEach((e=>{n.addEventListener(e.key,e.listener),c.push(e)}))},q=()=>{c.forEach((e=>{let{key:t,listener:r}=e;return n.removeEventListener(t,r)})),c.length=0},N=()=>{n.innerHTML="",(()=>{const{components:e=[]}=i;I(),A(r,i),w.set({components:e});const{visible:t,hidden:o,ordered:a}=C();f=t,o.forEach((e=>{e.instance.hide(),e.visible=!1})),t.forEach((e=>e.instance.beforeMount())),t.forEach((e=>e.instance.mount())),t.forEach((e=>e.instance.beforeRender())),t.forEach((e=>e.instance.render())),t.forEach((e=>e.instance.mounted())),t.forEach((e=>{e.visible=!0})),soe(n,a)})(),T(),O(i.interactions)};return u.layoutComponents=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{excludeFromUpdate:t=[]}=e;e.data&&(r=e.data),e.settings&&(i=e.settings,O(e.settings.interactions)),_(),A(r,i);const{formatters:n,scales:o,components:a=[]}=i;w.update({components:a,data:r,excludeFromUpdate:t,formatters:n,scales:o}),w.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),w.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()})),C()},u.update=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{partialData:t,excludeFromUpdate:o=[]}=e;let a;e.data&&(r=e.data),e.settings&&(i=e.settings,O(e.settings.interactions)),_(),A(r,i,{partialData:t});const{formatters:s,scales:l,components:c=[]}=i;w.update({components:c,data:r,excludeFromUpdate:o,formatters:s,scales:l}),w.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),w.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()}));const u=[],d=[];let h;if(t)w.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible&&u.push(e)})),h=u;else{const{visible:e,hidden:t,ordered:n}=C();f=e,h=e,a=n,e.forEach((e=>{e.updateWith&&e.visible?u.push(e):d.push(e)})),t.forEach((e=>{e.instance.hide(),e.visible=!1,delete e.updateWith,e.applyTransform=!1}))}d.forEach((e=>e.instance.beforeMount())),d.forEach((e=>e.instance.mount())),h.forEach((e=>e.instance.beforeRender())),h.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible?e.instance.update():e.instance.render()})),t||soe(n,a),d.forEach((e=>e.instance.mounted())),u.forEach((e=>e.instance.updated())),f.forEach((e=>{delete e.updateWith,e.visible=!0,e.applyTransform=!1})),R()},u.destroy=()=>{D(),w.destroy(),q(),O(),delete u.update,delete u.destroy,P()},u.getAffectedShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"and",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=[];return f.filter((e=>null==r||e.key===r)).forEach((r=>{const o=r.instance.getBrushedShapes(e,t,n);i=[...i,...o]})),i},u.findShapes=e=>{let t=[];return f.forEach((n=>{const r=n.instance.findShapes(e);t=[...t,...r]})),t},u.componentsFromPoint=e=>L(e).map((e=>e.instance.ctx)),u.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[];const i=n.getBoundingClientRect();let o=f;if(Array.isArray(t.components)&&t.components.length>0){const e=t.components.map((e=>e.key));o=f.filter((t=>-1!==e.indexOf(t.key))).map((n=>({instance:n.instance,opts:t.components[e.indexOf(n.key)]})))}for(let n=o.length-1;n>=0;n--){const a=o[n],s=aoe(e,i,a.instance.renderer().element().getBoundingClientRect()),l=a.instance.shapesAt(s,a.opts),c=l.length>0&&"stop"===t.propagation;if(r=[...r,...l],r.length>0&&c)return r}return r},u.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{components:[]};for(let n=0;n<t.components.length;n++){const r=t.components[n].key;f.filter((e=>r===e.key)).forEach((r=>{let i=e.filter((e=>e.key===r.key));r.instance.brushFromShapes(i,t.components[n])}))}},u.scroll=function(){return function(e,t){return t[e]||(t[e]=Zne()),t[e]}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",m)},u.dataset=e=>y(e),u.dataCollection=e=>v(e),u.scales=function(){return h.all()},u.formatters=function(){return p.all()},u.brush=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return b[e]||(b[e]=gre()),b[e]},u.scale=function(e){return h.get(e)},u.formatter=function(e){return p.get(e)},u.toggleBrushing=function(e){x=void 0!==e?e:!x},u.component=e=>{const t=w.findComponentByKey(e);return null==t?void 0:t.instance.ctx},u.logger=()=>s,u.theme=()=>l,u.storage=aie({animations:{updatingStageMeta:{isInit:!1,shouldBeRemoved:!1}}}),Object.defineProperty(u,"interactions",{get:()=>({instances:g,on(){T(),g.forEach((e=>e.on()))},off(){q(),g.forEach((e=>e.off()))}})}),k(),n&&(E(),N(),M(n),u.element=n),u}const coe=e=>{let t=S7(e);return t.prio=e=>e?t.default(e[0]):[t.default()],t.types=()=>t.getKeys(),t};var uoe=S7();function doe(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}const foe=e=>e.filter((e=>"number"==typeof e&&!isNaN(e)));const hoe=e=>{let{key:t,data:n,cache:r,config:i}=e;if(!n)return;let o=n;"string"==typeof o&&(o=(e=>{let{data:t,config:n}=e;const r=t.split("\n"),i=r[0],o=r[1];let a=",";if(n&&n.parse&&n.parse.delimiter)a=n.parse.delimiter;else if(i){const e=[/,/,/\t/,/;/];for(let t=0;t<e.length;t++){const n=e[t];if(i&&o){if(n.test(i)&&n.test(o)&&i.split(n).length===o.split(n).length){a=n;break}}else n.test(i)&&(a=n)}}return r.map((e=>e.split(a)))})({data:n,config:i})),Array.isArray(o)&&function(e){let t,{source:n,data:r,cache:i,config:o}=e,a=r;const s=o&&o.parse;Array.isArray(r[0])?s&&!1===s.headers?t=r[0].map(((e,t)=>t)):(t=r[0],a=r.slice(1)):t=Object.keys(r[0]);const l=!!s&&"function"==typeof s.row&&s.row;let c,u=t;u=s&&"function"==typeof s.fields?s.fields(u.slice()):t.map((e=>({key:e,title:e}))),Array.isArray(r[0])?c=u.map((()=>[])):(c={},u.forEach((e=>{c[e.key]=[]})));for(let e=0;e<a.length;e++){const t=l?l(a[e],e,u):a[e];if(t)if(Array.isArray(t))for(let e=0;e<u.length;e++)c[e].push(t[e]);else for(let e=0;e<u.length;e++)c[u[e].key].push(t[u[e].key])}const d=Array.isArray(c)?e=>c[e]:e=>c[u[e].key];for(let e=0;e<u.length;e++){const t=d(e),r=foe(t),o=r.length>0,a=o?"measure":"dimension",s=o?Math.min(...r):NaN,l=o?Math.max(...r):NaN;i.fields.push(Yee(o8({source:n,key:e,title:u[e].title,values:t,min:s,max:l,type:a},u[e]),{value:u[e].value,label:u[e].label}))}}({data:o,cache:r,source:t,config:i})};function poe(){let{key:e,data:t,config:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={fields:[]},i={key:()=>e,raw:()=>t,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];for(let t=0;t<n.fields.length;t++)if(n.fields[t].key()===e)return n.fields[t];for(let t=0;t<n.fields.length;t++)if(n.fields[t].title()===e)return n.fields[t];return null}(e,{cache:r}),fields:()=>r.fields.slice(),extract:e=>function(e,t){const n=Array.isArray(e)?e:[e];let r=[];return n.forEach((e=>{if(void 0!==e.field){const n=t.field(e.field),i=t.key();if(!n)throw Error("Field '".concat(e.field,"' not found"));const{props:o,main:a}=Zee(e,t),s=Object.keys(o),l=!!e.trackBy,c=typeof e.trackBy,u={},d=[],f=n.items(),h=[];for(let t=0;t<f.length;t++){const n=f[t];if(a.filter&&!a.filter(n))continue;const r=doe(a,n,{key:i});s.forEach((e=>{const a=o[e];let s=a.field?a.field.items()[t]:n;r[e]=doe(a,s,{key:i})})),l&&nte({cfg:e,itemData:n,obj:r,target:d,tracker:u,trackType:c}),h.push(r)}r=l?[...r,...tte(d,{main:a,propsArr:s,props:o})]:[...r,...h]}})),r}(e,i),hierarchy:()=>null};return hoe({key:e,data:t,config:n,cache:r}),i}poe.util={normalizeConfig:Zee,collect:tte,track:nte};const moe=S7();moe.default("matrix"),moe("matrix",poe),moe("default",poe);const goe=S7();function yoe(e,t,n){return Math.max(e,Math.min(t,n))}function voe(e){let{item:t,value:n,boxCenter:r,rendWidth:i,rendHeight:o,flipXY:a,symbol:s}=e,l="x",c="y",u=i,d=o,f=n<.5?90:-90;return a&&(l="y",c="x",u=o,d=i,f=n<.5?180:0),s(o8({},t.oob,{[l]:r*u,[c]:Math.max(t.oob.size/2,Math.min(n*d,d-t.oob.size/2)),startAngle:f}))}function boe(e){let{item:t,boxWidth:n,boxPadding:r,rendWidth:i,rendHeight:o,flipXY:a}=e,s="x",l="y",c="width",u="height",d=i,f=o;a&&(s="y",l="x",c="height",u="width",d=o,f=i);const{actualDiff:h,actualLow:p}=function(e){let{start:t,end:n,minPx:r=.1,maxPx:i=1}=e;const o=Math.max(t,n),a=Math.min(t,n),s=yoe(-.1,1.2,o),l=yoe(-.1,1.2,a),c=s*i-l*i,u=Math.max(r,c),d=(u-c)/2;return{actualDiff:u,startModifier:d,actualLow:l*i-d}}({start:t.start,end:t.end,minPx:t.box.minHeightPx,maxPx:f});return o8({},t.box,{type:"rect",[s]:(r+t.major)*d,[l]:p,[u]:h,[c]:n*d,data:t.data||{},collider:{type:null}})}function xoe(e){let{item:t,from:n,to:r,boxCenter:i,rendWidth:o,rendHeight:a,flipXY:s}=e,l="x1",c="y1",u="x2",d="y2",f=o,h=a;return s&&(l="y1",c="x1",u="y2",d="x2",f=a,h=o),o8({},t.line,{type:"line",[d]:Math.floor(n*h),[l]:i*f,[c]:Math.floor(r*h),[u]:i*f,data:t.data||{},collider:{type:null}})}function woe(e){let{item:t,key:n,position:r,width:i,boxCenter:o,rendWidth:a,rendHeight:s,flipXY:l}=e,c="x1",u="y1",d="x2",f="y2",h=a,p=s;l&&(c="y1",u="x1",d="y2",f="x2",h=s,p=a);const m=i/2;return o8({type:"line"},t[n],{[u]:Math.floor(r*p),[c]:(o-m)*h,[f]:Math.floor(r*p),[d]:(o+m)*h,r:m*h,cx:o*h,cy:r*p,width:i*h,data:t.data||{},collider:{type:null}})}function Soe(e,t,n){const{width:r,maxWidthPx:i,minWidthPx:o}=t.box,a=e>=0?1:-1;let s=Math.min(a*e*r,isNaN(i)?n:i/n);return s=isNaN(o)?s:Math.max(o/n,s),s*a}goe("native",(function(e,t,n){let r,i,o={chart:e,mediator:t,element:n},a=[],s=!0;function l(){"function"==typeof r.enable&&(r.enable=r.enable.bind(o)()),r.enable&&Object.keys(r.events).forEach((e=>{const t=r.events[e].bind(o);n.addEventListener(e,t),a.push({key:e,listener:t})}))}function c(){a.forEach((e=>{let{key:t,listener:r}=e;n.removeEventListener(t,r)})),a=[]}return{get key(){return i},set(e){!function(e){i=e.key,r=e,r.events=r.events||[],void 0===r.enable&&(r.enable=!0)}(e),c(),s&&l()},off(){s=!1,c()},on(){s=!0,0===a.length&&l()},destroy(){c(),o=null,r=null}}}));const Coe={oob:{show:!0,type:"n-polygon",fill:"#999",stroke:"#000",strokeWidth:0,size:10,sides:3,startAngle:-90},box:{show:!0,fill:"#fff",stroke:"#000",strokeWidth:1,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1},line:{show:!0,stroke:"#000",strokeWidth:1},median:{show:!0,stroke:"#000",strokeWidth:1},whisker:{show:!0,stroke:"#000",strokeWidth:1,fill:"",type:"line",width:1}},koe=Object.keys(Coe),Eoe={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},style:{box:"$shape",line:"$shape-guide",whisker:"$shape-guide",median:"$shape-guide--inverted"}},created(){this.state={}},render(e){let{data:t}=e;const{width:n,height:r}=this.rect,i="horizontal"===this.settings.settings.orientation,{style:o,resolver:a,symbol:s}=this,l=koe.filter((e=>!this.settings.settings[e]||!1!==this.settings.settings[e].show)),c={};l.forEach((e=>c[e]=Coe[e]));const u=function(e){let{keys:t,data:n,defaultSettings:r,style:i,settings:o,width:a,height:s,resolver:l}=e;const c=o8(!0,{},r||{},i||{}),u={major:"horizontal"===o.orientation?s:a,minor:"horizontal"===o.orientation?a:s},d=o.major;let f;f="object"==typeof d&&"object"==typeof d.ref&&void 0!==d.ref.start&&void 0!==d.ref.end?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:o8(!0,{},{binStart:{scale:o.major.scale,ref:o.major.ref.start},binEnd:{scale:o.major.scale,ref:o.major.ref.end}})}):"object"==typeof d&&void 0!==d.binStart&&void 0!==d.binEnd?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:o8(!0,{},{binStart:{scale:o.major.scale,ref:"binStart"},binEnd:{scale:o.major.scale,ref:"binEnd"}},o.major)}):l.resolve({data:n,scaled:u,defaults:{major:.5},settings:{major:o.major}});const h=o.minor||{},p={};["start","end","min","max","med"].forEach((e=>{(h[e]||n.items&&n.items.length&&n.items[0][e])&&(p[e]={scale:h.scale,ref:e})}));let m,g={major:f,minor:l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:o8(!0,{},p,h)})};for(let e=0,r=t.length;e<r;e++)o[m]&&!1===o[m].show||(m=t[e],g[m]=l.resolve({data:n,defaults:c[m],settings:o[m],scaled:u}));return g}({keys:l,data:t,defaultSettings:c,style:o,settings:this.settings.settings,width:n,height:r,resolver:a}),{settings:d,items:f}=u,h=function(e){let{width:t,height:n,flipXY:r,resolved:i,keys:o,symbol:a}=e;const s=[],l=i.major.items;if(!l.length)return s;const c=t,u=n,d=r?n:t,f=i.major.settings,h=["start","end","min","max","med"].filter((e=>void 0!==i.minor.settings[e])),p=h.length,m=o.filter((e=>"oob"!==e));let g,y,v,b,x,w,S,C,k;const E=o?o.length:0,M=m?m.length:0,_={box:function(){v.box&&d8(v.start)&&d8(v.end)&&g.push(boe({item:v,boxWidth:b,boxPadding:x,rendWidth:c,rendHeight:u,flipXY:r}))},line:function(){d8(v.min)&&d8(v.start)&&g.push(xoe({item:v,from:v.min,to:v.start,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r})),d8(v.max)&&d8(v.end)&&g.push(xoe({item:v,from:v.max,to:v.end,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))},median:function(){v.median&&d8(v.med)&&g.push(woe({item:v,key:"median",position:v.med,width:b,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))},whisker:function(){if(v.whisker){const e=b*v.whisker.width;d8(v.min)&&g.push(woe({item:v,key:"whisker",position:v.min,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r})),d8(v.max)&&g.push(woe({item:v,key:"whisker",position:v.max,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))}}};function R(){let e,t=-Number.MAX_VALUE,n=Number.MAX_VALUE;for(let r=0;r<p;r++)e=v[h[r]],d8(e)&&(t<e&&(t=e),n>e&&(n=e));S=t<0&&t!==-Number.MAX_VALUE,C=n>1&&n!==Number.MAX_VALUE,k=S||C}for(let e=0,t=l.length;e<t;e++){g=[],y=null;const t=l[e],n=t.data;let h=null,p=null;void 0!==f.binStart?(h=t.binStart,p=t.binEnd,y=f.binStart.scale):(y=f.major.scale,h=y?t.major:0);let I=0;y?y.bandwidth?(I=y.bandwidth(),h-=I/2):I=p-h:I=1,v=o8({},{major:h,majorEnd:p},i.minor.items[e]);for(let t=0;t<E;t++)v[o[t]]=i[o[t]].items[e];if(b=Soe(I,v,d),x=(I-b)/2,w=x+v.major+b/2,R(),k)v.oob&&(S?g.push(voe({item:v,value:0,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r,symbol:a})):C&&g.push(voe({item:v,value:1,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r,symbol:a})));else for(let e=0;e<M;e++)v[m[e]]&&!1===v[m[e]].show||_[m[e]]();const D={type:"container",data:n,collider:{type:"bounds"},children:g};s.push(D)}return s}({width:n,height:r,flipXY:i,resolved:u,keys:l,symbol:s});return h}};const Moe={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},_oe=/px$/,Roe={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},Ioe={imageSrc:void 0,imageScalingFactor:void 0,position:"center-center",symbol:"rectangle",width:void 0,height:void 0},Doe={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function Poe(e,t){return e&&"function"==typeof e.bandwidth?{isBandwidth:!0,value:Math.max(1,e.bandwidth()*t)}:{isBandwidth:!1,value:Math.max(1,t)}}function Aoe(e,t,n,r){let{width:i,height:o}=t;return e.filter((e=>!1!==e.show&&!isNaN(e.x+e.y))).map((e=>{let t=e,a=_oe.test(e.size)?parseInt(e.size,10):n.min+t.size*(n.max-n.min);f8(a)&&(t=Moe,a=n.min+t.size*(n.max-n.min));const[s,l]=function(e){let t=Roe.shape,n={};return"object"==typeof e.shape&&"string"==typeof e.shape.type?(t=e.shape.type,n=e.shape):"string"==typeof e.shape&&(t=e.shape),[t,n]}(t),c=c8(c8({},l),{},{type:s,label:e.label,x:e.x*i,y:e.y*o,fill:t.fill,size:Math.min(n.maxGlobal,Math.max(n.minGlobal,a)),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeDasharray:t.strokeDasharray,opacity:t.opacity,imageSettings:t.imageSettings});t===e.errorShape&&(c.width=t.width);const u=r(c);return u.data=e.data,u}))}const Ooe={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},animations:{enabled:!1,trackBy:e=>e.data.value},style:{item:"$shape"}},render(e){let{data:t}=e;const n=this.resolver.resolve({data:t,defaults:o8({},Roe,this.style.item),settings:this.settings.settings,scaled:{x:this.rect.width,y:this.rect.height}}),{width:r,height:i}=this.rect,o=o8({},Doe,this.settings.settings.sizeLimits),a=n.items;a.length>0&&"image"===a[0].shape&&t.items.forEach(((e,t)=>{a[t].imageSettings=o8({},Ioe,this.settings.settings.imageSettings)}));const s=function(e,t,n,r,i){const o=Poe(e?e.scale:void 0,n),a=Poe(t?t.scale:void 0,r);let s=Math.min(o.value*i[o.isBandwidth?"maxRelDiscrete":"maxRelExtent"],a.value*i[a.isBandwidth?"maxRelDiscrete":"maxRelExtent"]),l=Math.min(o.value*i[o.isBandwidth?"minRelDiscrete":"minRelExtent"],a.value*i[a.isBandwidth?"minRelDiscrete":"minRelExtent"]);return{min:Math.max(1,Math.floor(l)),max:Math.max(1,Math.floor(s)),maxGlobal:i.maxPx,minGlobal:i.minPx}}(n.settings.x,n.settings.y,r,i,o);return Aoe(a,this.rect,s,this.settings.shapeFn||this.symbol)}};const Loe={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function Toe(e,t,n,r){let{x:i,y:o,width:a,height:s}=t;const l=H8(),c={x:i+a/2,y:o+s/2},u=Math.min(a,s)/2,d=Math.min(a,s)/2,f=d/100;return e.map(((e,t)=>{const i=n[t];i.type="path";const o=d*i.outerRadius,a=u*i.innerRadius,s=f*i.cornerRadius;l.innerRadius(a),l.outerRadius(o),l.cornerRadius(s),i.arcDatum=e;const h=l.centroid(e),p=i.offset?function(e,t,n,r){let[i,o]=e;const a=Math.sqrt(i*i+o*o);i/=a,o/=a;const s=n-r;return{x:i*t*s,y:o*t*s}}(h,i.offset,o,a):{x:0,y:0};return i.transform="translate(".concat(p.x,", ").concat(p.y,") translate(").concat(c.x,", ").concat(c.y,")"),i.desc={share:e.value/r,slice:{start:e.startAngle,end:e.endAngle,innerRadius:a,outerRadius:o,cornerRadius:s,offset:{x:c.x+p.x,y:c.y+p.y}}},i}))}function qoe(e,t){return e.slice&&"arc"in e.slice?t.arc:t.data.value}const Noe={require:["chart","resolver"],defaultSettings:{settings:{startAngle:0,endAngle:2*Math.PI,padAngle:0,slice:{}},style:{slice:"$shape"},data:{}},render(e){let{data:t}=e;const n=[],r=[],i=this.settings.settings,{items:o}=this.resolver.resolve({data:t,defaults:o8({},Loe,this.style.slice),settings:i.slice});let a=0;for(let e=0,t=o.length;e<t;e++){const t=qoe(i,o[e]);t>0&&o[e].outerRadius>=o[e].innerRadius&&(n.push(t),r.push(o[e]),a+=t)}const s=function(){var e=Q8,t=J8,n=null,r=M8(0),i=M8(N8),o=M8(0);function a(a){var s,l,c,u,d,f=a.length,h=0,p=new Array(f),m=new Array(f),g=+r.apply(this,arguments),y=Math.min(N8,Math.max(-N8,i.apply(this,arguments)-g)),v=Math.min(Math.abs(y)/f,o.apply(this,arguments)),b=v*(y<0?-1:1);for(s=0;s<f;++s)(d=m[p[s]=s]=+e(a[s],s,a))>0&&(h+=d);for(null!=t?p.sort((function(e,n){return t(m[e],m[n])})):null!=n&&p.sort((function(e,t){return n(a[e],a[t])})),s=0,c=h?(y-f*b)/h:0;s<f;++s,g=u)l=p[s],u=g+((d=m[l])>0?d*c:0)+b,m[l]={data:a[l],index:s,value:d,startAngle:g,endAngle:u,padAngle:v};return m}return a.value=function(t){return arguments.length?(e="function"==typeof t?t:M8(+t),a):e},a.sortValues=function(e){return arguments.length?(t=e,n=null,a):t},a.sort=function(e){return arguments.length?(n=e,t=null,a):n},a.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:M8(+e),a):r},a.endAngle=function(e){return arguments.length?(i="function"==typeof e?e:M8(+e),a):i},a.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:M8(+e),a):o},a}().sortValues(null);s.startAngle(i.startAngle),s.endAngle(i.endAngle),s.padAngle(i.padAngle);return Toe(s(n),o8({},this.rect,{x:0,y:0}),r,a)}};const joe=function(e){function t(t){if(e[t.type]&&e[t.type].condition(t)){const n=e[t.type],r=void 0===n.conditionAppend||n.conditionAppend(t);n.items.forEach((e=>{const n=Math.round(t[e.key]),i=t[e.key]-n;t[e.key]=n,r&&"append"===e.type&&(i>0?t[e.key]+=.5:t[e.key]-=.5)}))}}return void 0===e&&((e={}).line={append:["x1","x2","y1","y2"],round:[],condition:e=>e.x1===e.x2||e.y1===e.y2,conditionAppend:e=>e.strokeWidth%2!=0},e.rect={append:["x","y"],round:["width","height"],condition:()=>!0,conditionAppend:e=>e.strokeWidth%2!=0}),Object.keys(e).forEach((t=>{const n=e[t];n.items=[],n.append.forEach((e=>{n.items.push({key:e,type:"append"})})),n.round.forEach((e=>{n.items.push({key:e,type:"round"})}))})),t.multiple=e=>e.forEach((e=>t(e))),t}();class zoe{constructor(){this.reset(),this.push(...arguments)}static evaluateKey(e,t){if(t){const t=e.substring(0,1),n=e.substring(1);if("x"===t)return"y".concat(n);if("y"===t)return"x".concat(n);if("cx"===e)return"cy";if("cy"===e)return"cx";if("width"===e)return"height";if("height"===e)return"width"}return e}transposeCoordinate(e,t,n){if("number"==typeof t&&isFinite(t)){const r=e.substring(0,1);if("x"===r||"cx"===e)return t*this.width;if("width"===e)return t*this.width;if("r"===e)return t*(n?this.height:this.width);if("y"===r||"cy"===e)return t*this.height;if("height"===e)return t*this.height}return t}push(){return this.storage.push(...arguments),this}processItem(e){let t={};const n=void 0!==e.flipXY?e.flipXY:this.flipXY,r=void 0!==e.crisp?e.crisp:this.crisp;if(e.fn&&"function"==typeof e.fn){let r=n?this.height:this.width,i=n?this.width:this.height;e=e.fn({width:r,height:i,flipXY:n});const o=Object.keys(e);for(let r=0,i=o.length;r<i;r++){let i=o[r];t[zoe.evaluateKey(i,n)]=e[i]}}else{const r=Object.keys(e);for(let i=0,o=r.length;i<o;i++){let o=r[i];const a=zoe.evaluateKey(o,n),s=this.transposeCoordinate(a,e[o],n);t[a]=s}}return r&&joe(t),t}output(){let e=[];for(let t=0,n=this.storage.length;t<n;t++){let n=this.processItem(this.storage[t]);e.push(n)}return e}reset(){this.storage=[],this.flipXY=!1,this.crisp=!1,this.width=0,this.height=0}}function Foe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new zoe(...t)}function Woe(e,t){return e&&t?e.cachedTicks&&e.cachedTicks()||e.ticks({distance:t}):[]}const $oe={created(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender(){this.blueprint=Foe(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){if(this.x=this.settings.x?this.chart.scale(this.settings.x):null,this.y=this.settings.y?this.chart.scale(this.settings.y):null,Rre(this,"x",this.rect.width),Rre(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=o8({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=o8({show:!1},this.style.minorTicks,this.settings.minorTicks||{}),this.lines={x:[],y:[]},this.lines.x=Woe(this.x,this.rect.width),this.lines.y=Woe(this.y,this.rect.height),this.lines.y=this.lines.y.map((e=>o8(e,{flipXY:!0})));let e=e=>{let{dir:t,isMinor:n}=e,r=this.lines[t].filter((e=>!!e.isMinor===n)),i=n?this.settings.minorTicks:this.settings.ticks;this.resolver.resolve({settings:i,data:{items:r,dir:t}}).items.forEach((e=>{let n=e.data;var r,i;e.show&&this.blueprint.push({type:"line",x1:n.position,y1:0,x2:n.position,y2:1,stroke:e.stroke||"black",strokeWidth:void 0!==e.strokeWidth?e.strokeWidth:1,strokeDasharray:void 0!==e.strokeDasharray?e.strokeDasharray:void 0,flipXY:n.flipXY||!1,value:null!==(r=n.value)&&void 0!==r?r:null===(i=n.data)||void 0===i?void 0:i.value,dir:t})}))};return e({dir:"x",isMinor:!1}),e({dir:"x",isMinor:!0}),e({dir:"y",isMinor:!1}),e({dir:"y",isMinor:!0}),this.blueprint.output()}};function Boe(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.8,"left"===r||"right"===r){let i="right"===r;return"\n M ".concat(e," ").concat(t-n,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(i?0:1,", ").concat(e," ").concat(t+n,"\n L ").concat(i?e+n:e-n," ").concat(t," Z\n ")}let i="bottom"===r;return"\n M ".concat(e-n," ").concat(t,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(i?1:0,", ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(i?t+n:t-n," Z\n ")}function Voe(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.75,"left"===r||"right"===r){let i="right"===r;return"\n M ".concat(e+=i?1.5*n:-1.5*n," ").concat(t-n,"\n L ").concat(e," ").concat(t+n,"\n L ").concat(i?e+n:e-n," ").concat(t," Z\n ")}let i="bottom"===r;return t+=i?1.5*n:-1.5*n,"\n M ".concat(e-n," ").concat(t,"\n L ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(i?t+n:t-n," Z\n ")}function Hoe(e,t,n){return e<t||e>n}function Uoe(e,t){if("string"==typeof e.formatter)return t.formatter(e.formatter);if("object"==typeof e.formatter)return t.formatter(e.formatter);if(void 0!==e.scale&&e.scale.data){const t=e.scale.data()&&e.scale.data().fields;return t&&t[0]?t[0].formatter():null}return null}function Goe(e){if(void 0===e)return 0;if("number"==typeof e&&isFinite(e))return e;if("string"==typeof e)switch(e){case"center":case"middle":return.5;case"bottom":case"right":return 1;default:return 0}return 0}function Yoe(e){var t,n;let{chart:r,blueprint:i,renderer:o,p:a,settings:s,items:l,slopeLine:c}=e,u=!0,d=!1,f=!1,h=!1,p=!1,m=o8(!0,{},s.style.line,a.line||{}),g=o8(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},s.style.label||{},{fill:m.stroke});if(d=c?i.processItem({type:"line",x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,stroke:m.stroke||"black",strokeWidth:m.strokeWidth||1,strokeDasharray:m.strokeDasharray,flipXY:!1,value:a.valueInfo?a.valueInfo.id:a.value}):i.processItem({type:"line",x1:a.position,y1:0,x2:a.position,y2:1,stroke:m.stroke||"black",strokeWidth:m.strokeWidth||1,strokeDasharray:m.strokeDasharray,flipXY:a.flipXY||!1,value:a.valueInfo?a.valueInfo.id:a.value}),a.label&&!1!==a.label.show&&(null==c||!c.slope||0===c.slope)){const e=o8(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},s.style.label||{},{fill:m.stroke},a.label);let t,n={width:0,height:0},c="";t=Uoe(a,r),!1!==a.label.showValue&&(t?c=" (".concat(t(a.value),")"):a.scale&&(c=" (".concat(a.value,")"))),c&&(n=o.measureText({text:c,fontFamily:e.fontFamily,fontSize:e.fontSize}));let d=o.measureText({text:e.text||"",fontFamily:e.fontFamily,fontSize:e.fontSize}),g={width:d.width+n.width,height:Math.max(d.height,n.height)},y=e.padding,v=Goe(a.flipXY?e.vAlign:e.align),b=Goe(a.flipXY?e.align:e.vAlign),x=Math.min(1+g.width+2*y,e.maxWidth*i.width,e.maxWidthPx),w=g.height+2*y,S=a.flipXY?w:x,C=a.flipXY?x:w;if(f=i.processItem({fn:t=>{let{width:n,height:r}=t,o=a.position*n-(a.flipXY?w:x)*(1-v);o=a.flipXY?o:Math.max(o,0);return{type:"rect",x:o,y:Math.max(Math.abs(b*r-C*b),0),width:a.flipXY?S:Math.min(S,i.width-o),height:C,stroke:e.background.stroke,strokeWidth:e.background.strokeWidth,fill:e.background.fill,opacity:e.background.opacity}},flipXY:a.flipXY||!1}),f.x<-1||f.x+f.width>i.width+1||f.y<-1||f.y+f.height>i.height+1)f=void 0;else{h={type:"text",text:e.text||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:f.x+y,y:f.y+f.height/2+g.height/3,maxWidth:f.width-2*y-n.width,anchor:"start"},c&&(p={type:"text",text:c||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:h.x+3+(f.width-(n.width+2*y)),y:h.y});for(let e=0,t=l.length;e<t;e++){let t=l[e];"rect"===t.type?Cie(f,t)&&(u=!1):"line"===t.type&&a.flipXY===t.flipXY&&Mie(f,t)&&(u=!1)}}}if(d&&l.push(d),c&&0!==c.slope&&(!1!==(null===(t=c.label)||void 0===t?void 0:t.show)||!1!==(null===(n=c.label)||void 0===n?void 0:n.showValue))){var y,v,b;let e,t;const n=120;let s=!1!==(null===(y=c.label)||void 0===y?void 0:y.show)?null===(v=c.label)||void 0===v?void 0:v.text:"";if(!1!==(null===(b=c.label)||void 0===b?void 0:b.showValue)){var x;const t=Uoe(a,r),n=t?t(c.value):c.value;e="(".concat(c.slope,"x + ").concat(n,")"),s+=null!==(x=c.label)&&void 0!==x&&x.text?" ".concat(e):e}if(s.length>1){var w,S,C;const e=o.measureText({text:s,fontFamily:g.fontFamily,fontSize:g.fontSize});e.width=e.width>n?n:e.width;const a=function(e,t,n){const r=e.scale({scale:"x"}),i=e.scale({scale:"y"});if(t>0){if(r.max()*t+n>=i.max())return!0}else if(t<0&&r.min()*t+n>=i.max())return!0;return!1}(r,c.slope,c.value)?function(e,t,n){const r=e.scale({scale:"x"}),i=e.scale({scale:"y"});return r((i.max()-n)/t)}(r,c.slope,c.value):void 0,u=void 0===a||c.isRtl?g.padding:3*g.padding,f=void 0!==a||c.slope>0?3*g.padding:g.padding,h=function(e,t,n,r,i,o){let a=0;if(void 0!==n){if(n<.8)return a=e.slope<0||e.isRtl?3*o.padding:2*o.padding,e.isRtl,n*i.width+a;if(1===n)return e.isRtl?n*i.width-(r.width+3*o.padding):n*i.width-(r.width+6*o.padding);if(n>.8)return e.isRtl?n*i.width-(r.width+3*o.padding):n*i.width-(r.width+6*o.padding)}else if(e.slope>0)return t.x2-(r.width+2*o.padding);return e.isRtl?t.x1-(r.width+2*o.padding):t.x1}(c,d,a,e,i,g),p=Math.min(d.y1,d.y2);null!==(w=c.label)&&void 0!==w&&w.stroke&&(t={type:"rect",x:c.isRtl?Math.max(h,u)-2:Math.max(h,u)+2,y:Math.abs(Math.max(p,f)-e.height),rx:3,ry:3,width:e.width+g.padding,height:e.height-2,stroke:m.stroke,fill:m.stroke});const y={type:"text",text:s,fill:null!==(S=null===(C=c.label)||void 0===C?void 0:C.stroke)&&void 0!==S?S:m.stroke,opacity:g.opacity,fontFamily:g.fontFamily,fontSize:g.fontSize,x:t?t.x+2:Math.max(h,u)+2,y:t?t.y+e.height-g.padding:Math.abs(Math.max(p,f)-g.padding/2),anchor:"start",title:s,maxWidth:n,width:e.width};(function(e,t,n,r,i){for(let o=0,a=e.length;o<a;o++){const a=e[o];if("text"===(null==a?void 0:a.type)&&Math.abs(a.x-t.x)<Math.max(a.width+r,t.width+r)&&Math.abs(a.y-t.y)<n.height+i)return!0}return!1})(l,y,e,u,f)||(t&&l.push(t),l.push(y))}}u&&f&&h&&(l.push(f,h),p&&l.push(p))}function Koe(e){const t={value:e.value};return e.label&&(t.label=e.label.text),t}function Xoe(e){return void 0!==("function"==typeof e.value?e.value():e.value)}function Joe(e,t){const n=e.min();if(n===e.max()){const r=function(e){const t=e.range();return 2===(null==t?void 0:t.length)&&t[0]>t[1]}(e);if(t<n)return r?2:-1;if(t>n)return r?-1:2}return e(t)}function Qoe(e,t){return e&&t&&Math.abs(e.x-t.x)<1e-15&&Math.abs(e.y-t.y)<1e-15}const Zoe={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:0},style:{oob:{show:!0,width:10,fill:"#1A1A1A",stroke:"transparent",strokeWidth:0,opacity:1,text:{fontFamily:"Arial",stroke:"transparent",fill:"#fff",strokeWidth:0,opacity:1},triangle:{fill:"#4D4D4D",stroke:"transparent",strokeWidth:0,opacity:1},padding:{x:28,y:5}},line:{stroke:"#000"},label:{strokeWidth:0}}},preferredSize:()=>30,beforeRender(){this.blueprint=Foe(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){let e=this.settings;if(this.lines={x:[],y:[]},this.lines.x=e.lines&&e.lines.x||[],this.lines.y=e.lines&&e.lines.y||[],0===this.lines.x.length&&0===this.lines.y.length)return[];const t={x0:[],x1:[],y0:[],y1:[]};this.lines.x=this.lines.x.filter(Xoe).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=Joe(t,e.value);return o8(e,{scale:t,position:n})}return o8(e,{position:e.value})})),this.lines.y=this.lines.y.filter(Xoe).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=Joe(t,e.value);return o8(e,{scale:t,position:n,flipXY:!0})}return o8(e,{position:e.value,flipXY:!0})})),this.lines.x=this.lines.x.filter((e=>!(e.position<0||e.position>1)||(t["x".concat(e.position>1?1:0)].push(Koe(e)),!1))),this.lines.y=this.lines.y.filter((e=>!(!e.slope||0===e.slope)||(!(e.position<0||e.position>1)||(t["y".concat(e.position>1?1:0)].push(Koe(e)),!1))));let n=[];return[...this.lines.x,...this.lines.y].forEach((r=>{if(!0===r.show||void 0===r.show){let i;if(r.slope&&0!==r.slope){const e=this.chart.scale({scale:"x"}),n=this.chart.scale({scale:"y"}),o=e.min(),a=e.max(),s=n.min(),l=n.max();i=c8(c8({},r),{},{x1:void 0,y1:void 0,x2:void 0,y2:void 0});const c=o*r.slope+r.value,u=a*r.slope+r.value,d=(s-r.value)/r.slope,f=(l-r.value)/r.slope;let h=[];Hoe(c,s,l)||(h[0]={x:Joe(e,o),y:Joe(n,c)}),Hoe(d,o,a)||(h[1]={x:Joe(e,d),y:1}),Hoe(u,s,l)||(h[2]={x:Joe(e,a),y:Joe(n,u)}),Hoe(f,o,a)||(h[3]={x:Joe(e,f),y:0});const p=h.filter((e=>!!e)).length;if(p>2&&function(e){Qoe(e[0],e[1])&&(e[1]=void 0),Qoe(e[1],e[2])&&(e[2]=void 0),Qoe(e[2],e[3])&&(e[3]=void 0),Qoe(e[3],e[0])&&(e[3]=void 0)}(h),h=h.filter((e=>!!e)),h.length<2)return void t["y".concat(c>l?0:1)].push(Koe(r));i.x1=h[0].x,i.y1=h[0].y,i.x2=h[1].x,i.y2=h[1].y}else i=void 0;Yoe({chart:this.chart,blueprint:this.blueprint,renderer:this.renderer,p:r,settings:e,items:n,slopeLine:i})}})),e.style.oob.show&&function(e){let{blueprint:t,oob:n,settings:r,items:i}=e;const o=Object.keys(n);let a=r.style.oob||{};for(let e=0,r=o.length;e<r;e++){const r=o[e],s=n[r];if(s.length>0){let e=r.charAt(1),n="y"===r.charAt(0),o=a.padding.x+a.width,l=a.padding.y+a.width,c="bottom";c=n?"1"===e?"bottom":"top":"1"===e?"right":"left";let u=t.processItem({fn:t=>{let{width:r,height:i}=t,u=e*r+("1"===e?-o:o),d=n?l:i-l;return"arc"===a.type?{type:"path",d:Boe(n?d:u,n?u:d,a.width,c),x:u,y:d,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0}:{type:"circle",cx:u,cy:d,r:a.width,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0,opacity:a.opacity,data:s}},flipXY:n}),d=u.cx||u.x,f=u.cy||u.y;const h=s.map((e=>e.label?"".concat(e.label," (").concat(e.value,")"):"(".concat(e.value,")"))),p=h.reduce(((e,t,n)=>0===n?t:"".concat(e,"\n\n").concat(t)),"");let m={type:"text",text:s.length||"",title:p,x:d-.4*a.width,y:f+.4*a.width,fontFamily:a.text.fontFamily,fontSize:"".concat(1.3*a.width,"px"),stroke:a.text.stroke,fill:a.text.fill,strokeWidth:a.text.strokeWidth||0,opacity:a.text.opacity},g={type:"path",d:Voe(d,f,a.width,c),x:d,y:f,stroke:a.triangle.stroke,fill:a.triangle.fill,strokeWidth:a.triangle.strokeWidth||0,opacity:a.triangle.opacity};i.push(u,m,g)}}}({blueprint:this.blueprint,oob:t,settings:e,items:n}),n}};function eae(e){const t={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null}};return"top"===e.align||"bottom"===e.align?(t.x1=e.innerRect.x-e.outerRect.x,t.x2=t.x1+e.innerRect.width,t.y1=t.y2="top"===e.align?e.innerRect.height-e.padding:e.padding):(t.x1=t.x2="left"===e.align?e.innerRect.width-e.padding:e.padding,t.y1=e.innerRect.y-e.outerRect.y,t.y2=t.y1+e.innerRect.height),function(e,t){o8(e,t.style)}(t,e),t}function tae(e){return"string"==typeof e||"number"==typeof e?e:"-"}function nae(e,t,n){n.layered||!n.stepSize?function(e,t){t.collider={type:"polygon",vertices:[{x:t.boundingRect.x,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y+t.boundingRect.height},{x:t.boundingRect.x,y:t.boundingRect.y+t.boundingRect.height}]}}(0,t):n.tilted?function(e,t,n){const r=n.angle*(Math.PI/180),i=Math.max(n.stepSize/2,t.boundingRect.height/2),o="start"===t.anchor,a="end"===t.anchor&&r<0,s="start"===t.anchor&&r>=0,l=t.boundingRect.y+(s||a?t.boundingRect.height:0),c=[{x:t.x-i,y:l},{x:t.x+i,y:l}].map((e=>Xre(e,r,{x:t.x,y:t.y}))),u={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y+t.boundingRect.height},d={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y},f=r>=0?[u,d]:[d,u];c.push(...f),t.collider={type:"polygon",vertices:c}}(0,t,n):function(e,t,n){if("bottom"===n.align||"top"===n.align){const r=e.position*n.innerRect.width+(n.innerRect.x-n.outerRect.x-n.stepSize/2);t.collider={type:"rect",x:r,y:0,width:r<0?n.stepSize+r:n.stepSize,height:n.innerRect.height}}else{const r=e.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);t.collider={type:"rect",x:0,y:r,width:n.innerRect.width,height:r<0?n.stepSize+r:n.stepSize}}const r=t.collider;r.x=Math.max(r.x,0),r.y=Math.max(r.y,0);const i=r.x+r.width-(n.outerRect.x+n.outerRect.width);r.width=i>0?r.width-i:r.width;const o=r.y+r.height-(n.outerRect.y+n.outerRect.height);r.height=o>0?r.height-o:r.height}(e,t,n)}function rae(e,t){const n=isNaN(e.style.align)?.5:Math.min(Math.max(e.style.align,0),1);let r=0;if(e.tilted)r=e.stepSize*n;else{const i=t?e.textRect.height:e.textRect.width;r=Math.max(0,e.stepSize-i)*n}return r}function iae(e,t){var n,r;const i={type:"text",text:tae(e.label),x:0,y:0,maxWidth:t.maxWidth,maxHeight:t.maxHeight,tickValue:null!==(n=e.value)&&void 0!==n?n:null===(r=e.data)||void 0===r?void 0:r.value};return"top"===t.align||"bottom"===t.align?(i.x=e.start*t.innerRect.width+(t.innerRect.x-t.outerRect.x)+rae(t,!1),i.y="top"===t.align?t.innerRect.height:0,i.anchor=t.stepSize?"start":"middle",i.x+=isNaN(t.style.offset)?0:+t.style.offset):(i.y=e.start*t.innerRect.height+(t.innerRect.y-t.outerRect.y)+rae(t,!0),i.x="left"===t.align?t.innerRect.width:0,i.anchor="left"===t.align?"end":"start",i.baseline=t.stepSize?"text-before-edge":"central",i.y+=isNaN(t.style.offset)?0:+t.style.offset),function(e,t){["fill","fontSize","fontFamily"].forEach((n=>{e[n]=t.style[n]}))}(i,t),function(e,t){if(!t.tilted&&!t.stepSize)if("top"===t.align||"bottom"===t.align){const n=0,r=t.outerRect.width,i=Math.min(t.maxWidth/2,t.textRect.width/2),o=e.x-i,a=e.x+i;o<n?(e.anchor="start",e.x=t.innerRect.x-t.outerRect.x):a>r&&(e.anchor="end",e.x=t.innerRect.width+t.innerRect.x)}else{const n=0,r=t.outerRect.height,i=t.maxHeight/2,o=e.y-i,a=e.y+i;o<n?(e.y=t.innerRect.y-t.outerRect.y,e.baseline="text-before-edge"):a>r&&(e.y=t.innerRect.height+(t.innerRect.y-t.outerRect.y),e.baseline="text-after-edge")}}(i,t),function(e,t){"top"===t.align?e.y-=t.padding:"bottom"===t.align?e.y+=t.padding+t.maxHeight:"left"===t.align?e.x-=t.padding:"right"===t.align&&(e.x+=t.padding)}(i,t),function(e,t){if(t.tilted){const n=-t.angle,r=n*(Math.PI/180);"bottom"===t.align?(e.x-=t.maxHeight*Math.sin(r)/2,e.y-=t.maxHeight,e.y+=t.maxHeight*Math.cos(r)/2):e.x-=t.maxHeight*Math.sin(r)/3,e.transform="rotate(".concat(n,", ").concat(e.x,", ").concat(e.y,")"),e.anchor="bottom"===t.align==t.angle<0?"start":"end";const i=Math.cos(r)*t.maxWidth;if("bottom"===t.align==t.angle<0){const n=t.outerRect.width-t.paddingEnd;e.x+i>n&&(e.maxWidth=(n-e.x-10)/Math.cos(r))}else{const n=t.paddingEnd;e.x-i<n&&(e.maxWidth=(e.x-n-10)/Math.cos(r))}}}(i,t),function(e,t){e.boundingRect=t.textBounds(e)}(i,t),nae(e,i,t),i}function oae(e,t){const n={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null},tickValue:e.value};return"top"===t.align||"bottom"===t.align?(n.x1=n.x2=e.position*t.innerRect.width+(t.innerRect.x-t.outerRect.x),n.y1="top"===t.align?t.innerRect.height:0,n.y2="top"===t.align?n.y1-t.tickSize:n.y1+t.tickSize):(n.y1=n.y2=e.position*t.innerRect.height+(t.innerRect.y-t.outerRect.y),n.x1="left"===t.align?t.innerRect.width:0,n.x2="left"===t.align?n.x1-t.tickSize:n.x1+t.tickSize),function(e,t){o8(e,t.style)}(n,t),function(e,t){"top"===t.align?(e.y1-=t.padding,e.y2-=t.padding):"bottom"===t.align?(e.y1+=t.padding,e.y2+=t.padding):"left"===t.align?(e.x1-=t.padding,e.x2-=t.padding):"right"===t.align&&(e.x1+=t.padding,e.x2+=t.padding)}(n,t),function(e,t){const n=e.strokeWidth/2;e.x1===t.innerRect.width?(e.x1-=n,e.x2-=n):0===e.x1?(e.x1+=n,e.x2+=n):e.y1===t.innerRect.height?(e.y1-=n,e.y2-=n):0===e.y1&&(e.y1+=n,e.y2+=n)}(n,t),n}function aae(e){return!e.isMinor&&e.position>=0&&e.position<=1}function sae(e){let{rect:t,state:n,majorTicks:r,measure:i,horizontal:o}=e;return o?function(e){let{majorTicks:t,measureText:n,rect:r,state:i}=e;const o="layered"===i.labels.activeMode?2:1,a=r.width,s=t.map((e=>e.label)).map((e=>"".concat(e.slice(0,1)).concat(e.length>1?"…":""))).map(n).map((e=>e.width));for(let e=0;e<t.length;++e){const n=t[e];if(o*a*Math.abs(n.start-n.end)<s[e])return!0}return!1}({majorTicks:r,measureText:i,rect:t,state:n}):function(e){let{majorTicks:t,measureText:n,rect:r}=e;const i=r.height,o=n("M").height;return!(t.length<2)&&i*Math.abs(t[0].position-t[1].position)<o}({majorTicks:r,measureText:i,rect:t})}function lae(e){let{value:t,maxValue:n,minValue:r,range:i,modifier:o}=e;return isNaN(i)||isNaN(o)||(t=i*o),t>n&&(t=n),t<r&&(t=r),t}function cae(e){let{isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:a,state:s}=e,l=0;const c={left:0,top:0,right:0,bottom:0},{maxLengthPx:u,minLengthPx:d}=a.labels;if(a.labels.show){const e=a.align,f="top"===e||"bottom"===e,h=f?n.inner.width:n.inner.height,p=o.ticks({settings:a,distance:h,formatter:r}).filter(aae),m=e=>{const t=i({text:e,fontSize:a.labels.fontSize,fontFamily:a.labels.fontFamily});return t.width=lae({value:t.width,maxValue:u,minValue:d}),t};if(t&&f&&"auto"===a.labels.mode&&(!function(e){let{majorTicks:t,measure:n,rect:r,state:i,settings:o}=e;const a=o.labels.maxGlyphCount,s="layered"===i.labels.activeMode?2:1,l=o.labels.tiltThreshold?o.labels.tiltThreshold:.7,c=n("…").width,u=r.width;let d=0,f=0;if(isNaN(a))for(let e=0;e<t.length;e++){const r=t[e],i=r.label,o=n(i).width*(i.length>1?l:1);if(f=s*u*Math.abs(r.start-r.end),o+c>f)return!0}else{const e=t.reduce(((e,t)=>Math.min(Math.abs(t.start-t.end),e)),1/0);if(f=s*u*e,d=n("M").width*l*a,d+c>f)return!0}return!1}({majorTicks:p,measure:m,rect:n.inner,state:s,settings:a})?s.labels.activeMode="horizontal":s.labels.activeMode="tilted"),!a.labels.filterOverlapping&&"tilted"!==s.labels.activeMode&&sae({rect:n.inner,state:s,majorTicks:p,measure:m,horizontal:f})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}let g,y;if("tilted"===s.labels.activeMode){const e=Math.abs(a.labels.tiltAngle)*(Math.PI/180);g=t=>lae({value:t.width,maxValue:u,minValue:d})*Math.sin(e)+t.height*Math.cos(e)}else g=f?e=>e.height:e=>lae({value:e.width,maxValue:u,minValue:d});if(f&&"tilted"!==s.labels.activeMode)y=["M"];else if(isNaN(a.labels.maxGlyphCount))y=p.map((e=>e.label));else{let e="";for(let t=0;t<a.labels.maxGlyphCount;t++)e+="M";y=[e]}const v=y.map(m),b=v.map(g),x=Math.max(...b,0);if(l+=x,l+=a.labels.margin,"layered"===s.labels.activeMode&&(l*=2),"tilted"===s.labels.activeMode){const e="bottom"===a.align==a.labels.tiltAngle>=0,t=Math.abs(a.labels.tiltAngle)*(Math.PI/180),r=(x-m("M").height*Math.cos(t))/Math.sin(t),i=e=>Math.min(r,e.width)*Math.cos(t)+e.height,o=(t,r)=>{const i=p[r]?p[r].position:0;return e?t-i*n.inner.width:t-(1-i)*n.inner.width},s=Math.min(a.labels.maxEdgeBleed,Math.max(...v.map(i).map(o),0))+a.paddingEnd;if(c[e?"left":"right"]=s,!a.labels.filterOverlapping&&function(e){let{majorTicks:t,measureText:n,rect:r,bleedSize:i,angle:o}=e;if(t.length<2)return!1;if(0===o)return!0;const a=Math.abs(o),s=1/(Math.min(r.outer.width-i,r.inner.width)*Math.abs(t[0].position-t[1].position));return n("M").height>Math.sin(a*(Math.PI/180))/s}({majorTicks:p,measureText:m,rect:n,bleedSize:s,angle:a.labels.tiltAngle})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}}}return{size:l,edgeBleed:c}}const uae=(e,t,n)=>e.width*Math.abs(t.position-n.position);function dae(e){let{layered:t,major:n,innerRect:r,outerRect:i,tick:o,index:a}=e;const s=t?2:1,l=n[a-s],c=n[a+s],u=l?uae(r,o,l)/2-2:1/0,d=c?uae(r,o,c)/2-2:1/0;return n.length<2?r.width:l?c?2*Math.min(u,d):(e=>{let{innerRect:t,outerRect:n,tick:r,prevWidth:i}=e;const o=t.x-n.x,a=n.width-t.width-o,s=t.width-t.width*r.position+a,l=2*Math.min(i,s),c=1===r.position?t.width/2-2:0;return Math.max(i,l,c)})({innerRect:r,outerRect:i,tick:o,prevWidth:u}):(e=>{let{innerRect:t,outerRect:n,tick:r,nextWidth:i}=e;const o=t.x-n.x,a=t.width*r.position+o,s=2*Math.min(i,a),l=0===r.position?t.width/2-2:0;return Math.max(i,s,l)})({innerRect:r,outerRect:i,tick:o,nextWidth:d})}function fae(e){const t=e.innerRect,n={cx:t.width/2,cy:t.height/2},r=Math.min(t.height,t.width)/2*e.radius,i=r+e.style.strokeWidth,o={visible:!0,type:"path",arcDatum:{startAngle:e.startAngle,endAngle:e.endAngle},transform:"translate(0, 0) translate(".concat(n.cx,", ").concat(n.cy,")"),desc:{share:1,slice:{cornerRadius:0,innerRadius:r,outerRadius:i}},ticks:[]};return function(e,t){o8(e,t.style)}(o,e),o}function hae(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function pae(e,t){const n=t.innerRect,r={cx:n.width/2,cy:n.height/2},i=Math.min(n.height,n.width)/2*t.radius+t.padding,o=t.startAngle,a=t.endAngle,s=t.tickSize,l=a-o;let c=a-e.position*l;c-=Math.PI/2;const u=hae(r.cx,r.cy,i+s,c),d=hae(r.cx,r.cy,i,c),f={type:"line",x1:u.x,y1:u.y,x2:d.x,y2:d.y,value:e.value};return function(e,t){const n=c8({},t.style);o8(e,n)}(f,t),f}function mae(e){return"string"==typeof e||"number"==typeof e?e:"-"}function gae(e,t,n){let r;return r="left"===t?n.x:"right"===t?e.outerRect.width-n.x:Math.max(n.x,e.outerRect.width-n.x),r}function yae(e,t){const n=t.innerRect,r={cx:n.width/2,cy:n.height/2},i=Math.min(n.height,n.width)/2*t.radius+t.padding,o=t.startAngle,a=t.endAngle,s=t.tickSize,l=a-o,c=.2;let u,d;u="top"===t.align||"bottom"===t.align?a-e.position*l:o+e.position*l,d=u<-.2&&u>-Math.PI+c?"left":u>.2&&u<Math.PI-c?"right":"center",u-=Math.PI/2;const f=function(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}(r.cx,r.cy,i+s+6,u);let h;h="left"===d?"end":"right"===d?"start":"middle";const p={type:"text",text:mae(e.label),align:d,x:f.x,y:f.y,maxHeight:t.maxHeight,maxWidth:gae(t,d,f),anchor:h,baseline:"middle"};return function(e,t){["fill","fontSize","fontFamily"].forEach((n=>{e[n]=t.style[n]}))}(p,t),function(e,t){e.boundingRect=t.textBounds(e)}(p,t),function(e,t,n){let r,i;const o=parseFloat(n.fontSize)||0;r=t.y-o/2,i=e.innerRect.height-(t.y+o/2),(r<0||i<0)&&(n.text="")}(t,f,p),p}function vae(e){let t=0;return t+=e.paddingStart,t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function bae(e){let t=0;return t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function xae(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=vae(e)+e.labels.margin,t}function wae(e,t){return e.map((e=>oae(e,t)))}function Sae(e,t){return t?Math.abs(t.end-t.start):e.bandwidth()}function Cae(e){let{textMetrics:t,settings:n,innerRect:r,scale:i,tilted:o,layered:a,tick:s}=e;const l=t.height,c=Sae(i,s),u={width:0,height:l};if("left"===n.align||"right"===n.align)u.width=r.width-xae(n)-n.paddingEnd;else if(a)u.width=c*r.width*2;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);u.width=(r.height-xae(n)-n.paddingEnd-l*Math.cos(e))/Math.sin(e)}else u.width=c*r.width;return u.width=lae({value:u.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),u}function kae(e){let{textMetrics:t,settings:n,innerRect:r,outerRect:i,tilted:o,layered:a,tick:s,index:l,major:c}=e;const u=t.height,d={width:0,height:u};if("left"===n.align||"right"===n.align)d.width=r.width-xae(n)-n.paddingEnd;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);d.width=(r.height-xae(n)-n.paddingEnd-u*Math.cos(e))/Math.sin(e)}else d.width=dae({layered:a,major:c,innerRect:r,outerRect:i,tick:s,index:l});return d.width=lae({value:d.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),d}function Eae(e){let t;function n(){return t=kae,n}function r(){return t=Cae,r}function i(e){let{settings:n,scale:r,innerRect:i,outerRect:o,measureText:a,ticks:s,state:l,textBounds:c}=e;const u=[],d=function(e){return e.filter((e=>!e.isMinor))}(s),f=function(e){return e.filter((e=>e.isMinor))}(s),h={innerRect:i,align:n.align,outerRect:o},p="tilted"===l.labels.activeMode,m="layered"===l.labels.activeMode;let g;if(n.arc&&(h.startAngle=n.arc.startAngle,h.endAngle=n.arc.endAngle,h.radius=n.arc.radius),n.line.show&&(h.style=n.line,h.padding=n.paddingStart,n.arc?u.push(fae(h)):u.push(eae(h))),n.ticks.show&&(h.style=n.ticks,h.tickSize=n.ticks.tickSize,h.padding=vae(n),n.arc?(h.padding=bae(n),g=function(e,t){return e.map((e=>pae(e,t)))}(d,h)):g=wae(d,h)),n.labels.show){const e=xae(n);h.style=n.labels,h.padding=e,h.tilted=p,h.layered=m,h.angle=n.labels.tiltAngle,h.paddingEnd=n.paddingEnd,h.textBounds=c;const s=(e,s)=>{h.textRect=function(e){let{style:t,measureText:n,tick:r}=e;return n({text:r.label,fontSize:t.fontSize,fontFamily:t.fontFamily})}({tick:e,measureText:a,style:h.style});const l=t({textMetrics:h.textRect,settings:n,innerRect:i,outerRect:o,scale:r,tilted:p,layered:m,tick:e,major:d,index:s});h.maxWidth=l.width,h.maxHeight=l.height,h.stepSize=function(e){let{innerRect:t,scale:n,settings:r,tick:i}=e;return("top"===r.align||"bottom"===r.align?t.width:t.height)*Sae(n,i)}({innerRect:i,scale:r,settings:n,tick:e})};let l=[];n.arc?(h.padding=function(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=bae(e)+e.labels.margin,t}(n),l=function(e,t,n){return e.map(((e,r)=>{n(e,r);const i=yae(e,t);return i.data=e.data,i}))}(d,h,s)):l=!m||"top"!==n.align&&"bottom"!==n.align?function(e,t,n){return e.map(((e,r)=>{n(e,r);const i=iae(e,t);return i.data=e.data,i}))}(d,h,s):function(e,t,n,r){const i=t.padding,o=xae(n);return e.map(((e,a)=>{r(e,a);const s=o+t.maxHeight+n.labels.margin;t.layer=a%2,t.padding=a%2==0?i:s;const l=iae(e,t);return l.data=e.data,l}))}(d,h,n,s),n.labels.filterOverlapping&&function(e,t,n){let r=(t,n)=>Cie(b8(1,e[t].boundingRect),b8(1,e[n].boundingRect));if(n&&n.tilted){const t=Math.abs(n.angle);r=(n,r)=>{const i=1/Math.abs(e[n].x-e[r].x),o=Math.sin(t*(Math.PI/180))/i;return e[n].boundingRect.height>o}}for(let n=0;n<=e.length-1;n++)for(let i=n+1;i<=Math.min(n+5,n+(e.length-1));i++)e[n]&&e[i]&&r(n,i)&&(i===e.length-1?(e.splice(n,1),t&&t.splice(n,1)):(e.splice(i,1),t&&t.splice(i,1)),i--,n--)}(l,g,h),u.push(...l)}return n.minorTicks&&n.minorTicks.show&&f.length>0&&(h.style=n.minorTicks,h.tickSize=n.minorTicks.tickSize,h.padding=function(e){return e.line.strokeWidth+e.minorTicks.margin}(n),u.push(...wae(f,h))),g&&u.push(...g),u}return n.build=i,r.build=i,e?r():n()}const Mae={labels:{show:!0,tiltAngle:40,tiltThreshold:.7,maxEdgeBleed:1/0,margin:4,maxLengthPx:150,minLengthPx:0,mode:"auto",maxGlyphCount:NaN,align:.5,offset:0,filterOverlapping:!1},ticks:{show:!1,margin:0,tickSize:4},line:{show:!1},paddingStart:0,paddingEnd:10,align:"auto"},_ae={labels:{show:!0,margin:4,maxLengthPx:150,minLengthPx:0,align:.5,offset:0,filterOverlapping:!0},ticks:{show:!0,margin:0,tickSize:8},minorTicks:{show:!1,tickSize:3,margin:0},line:{show:!0},paddingStart:0,paddingEnd:10,align:"auto"};const Rae={require:["chart","renderer","dockConfig"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{},style:{labels:"$label",ticks:"$guide-line",minorTicks:"$guide-line--minor",line:"$guide-line"}},created(){this.state={isDiscrete:!!this.scale.bandwidth,isHorizontal:!1,labels:{activeMode:"horizontal"},ticks:[],innerRect:{width:0,height:0,x:0,y:0},outerRect:{width:0,height:0,x:0,y:0},defaultDock:void 0,concreteNodeBuilder:void 0,settings:void 0},this.state.isDiscrete?this.state.defaultDock="bottom":this.state.defaultDock="left",this.setState(this.settings)},setState(){this.state.isDiscrete=!!this.scale.bandwidth,this.state.settings=function(e){let{state:t,style:n,settings:r}=e;const i=o8(!0,{},t.isDiscrete?Mae:_ae,n),o=o8(!0,{},i,r.settings),a=r.layout.dock||t.defaultDock;o.dock=a,o.align=function(e,t){const n=["top","bottom"],r=["left","right"];return-1!==n.indexOf(e)&&-1===r.indexOf(t)||-1!==r.indexOf(e)&&-1===n.indexOf(t)?e:t}(r.settings.align,a),o.labels.tiltAngle=Math.max(-90,Math.min(o.labels.tiltAngle,90));const{paddingStart:s,paddingEnd:l}=o;return o.paddingStart="function"==typeof s?s.call(null):s,o.paddingEnd="function"==typeof l?l.call(null):l,o}(this),this.state.concreteNodeBuilder=Eae(this.state.isDiscrete),this.dockConfig.dock(this.state.settings.dock),this.state.isHorizontal="top"===this.state.settings.align||"bottom"===this.state.settings.align,this.state.labels.activeMode=function(e,t,n){const r=t.labels.mode;return n&&e.isHorizontal?"auto"===r?e.labels.activeMode:-1!==["layered","tilted"].indexOf(t.labels.mode)&&-1!==["top","bottom"].indexOf(t.dock)?r:"horizontal":"horizontal"}(this.state,this.state.settings,this.state.isDiscrete)},preferredSize(e){const{formatter:t,state:n,scale:r}=this,i=this.state.isHorizontal?e.inner.width:e.inner.height;this.state.pxScale=Ire(r,i);const o=function(e){let{isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:a,state:s}=e,l=0;const{size:c,edgeBleed:u,isToLarge:d}=cae({isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:a,state:s});if(l+=c,d)return{size:l};if(a.ticks.show&&(l+=a.ticks.margin,l+=a.ticks.tickSize),a.minorTicks&&a.minorTicks.show){const e=a.minorTicks.margin+a.minorTicks.tickSize;e>l&&(l=e)}if(a.line.show){const e=a.line.strokeWidth/2;l+=e,u[function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";default:return e}}(a.align)]=Math.ceil(e)}return l+=a.paddingStart,l+=a.paddingEnd,{size:l,edgeBleed:u}}({isDiscrete:this.state.isDiscrete,rect:{inner:e.inner,outer:e.outer},formatter:t,measureText:this.renderer.measureText,scale:this.state.pxScale,settings:this.state.settings,state:n});return o},beforeUpdate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{settings:t}=e;this.setState(t)},resize(e){const{inner:t,outer:n}=e,r=o8({},t,function(e){let{align:t,inner:n}=e;return"left"===t?{x:n.width+n.x}:"right"===t||"bottom"===t?n:{y:n.y+n.height}}({align:this.state.settings.align,inner:t})),i=n||r;return o8(this.state.innerRect,r),o8(this.state.outerRect,i),n},beforeRender(){const{scale:e,formatter:t}=this,n=this.state.isHorizontal?this.state.innerRect.width:this.state.innerRect.height;this.state.pxScale=Ire(e,n),this.state.ticks=this.state.pxScale.ticks({distance:n,formatter:t}).filter((e=>e.position>=0&&e.position<=1))},render(){const{state:e}=this,t=[];return t.push(...this.state.concreteNodeBuilder.build({settings:this.state.settings,scale:this.state.pxScale,innerRect:this.state.innerRect,outerRect:this.state.outerRect,measureText:this.renderer.measureText,textBounds:this.renderer.textBounds,ticks:this.state.ticks,state:e})),joe.multiple(t),t}};const Iae={render:()=>[]};function Dae(e,t,n){let r="";if("function"==typeof e)r=e();else if("string"==typeof e)r=e;else if(n){const e=(n.data().fields||[]).map((e=>e.title()));r=e.join(t)}return r}function Pae(e,t){let n="middle";return"left"===e?"top"===t?n="end":"bottom"===t&&(n="start"):"right"===e?"top"===t?n="start":"bottom"===t&&(n="end"):"left"===t?n="start":"right"===t&&(n="end"),n}const Aae={require:["renderer","chart"],defaultSettings:{layout:{dock:"bottom",displayOrder:0,prioOrder:0},settings:{paddingStart:5,paddingEnd:5,paddingLeft:0,paddingRight:0,anchor:"center",join:", ",maxLengthPx:NaN},style:{text:"$title"}},created(){this.definitionSettings=this.settings.settings;const e=this.settings.text,t=this.definitionSettings.join;this.title=Dae(e,t,this.scale)},preferredSize(){return this.renderer.measureText({text:this.title,fontSize:this.style.text.fontSize,fontFamily:this.style.text.fontFamily}).height+this.definitionSettings.paddingStart+this.definitionSettings.paddingEnd},render(){const{title:e,definitionSettings:t,rect:n}=this,r=[];return r.push(function(e){let{title:t,definitionSettings:n,dock:r,rect:i,measureText:o,style:a}=e;const s={type:"text",text:t,x:0,y:0,dx:0,dy:0,anchor:Pae(r,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};o8(s,a.text);const l=o(s);if("top"===r||"bottom"===r){let e=i.width/2;"left"===n.anchor?e=n.paddingLeft||0:"right"===n.anchor&&(e=i.width-(n.paddingRight||0)),s.x=e,s.y="top"===r?i.height-n.paddingStart:n.paddingStart+l.height,s.dy="top"===r?-l.height/6:-l.height/3,s.maxWidth=.8*i.width}else{let e=i.height/2;"top"===n.anchor?e=n.paddingStart:"bottom"===n.anchor&&(e=i.height-n.paddingStart),s.y=e,s.x="left"===r?i.width-n.paddingStart:n.paddingStart,s.dx="left"===r?-l.height/3:l.height/3;const t="left"===r?270:90;s.transform="rotate(".concat(t,", ").concat(s.x+s.dx,", ").concat(s.y+s.dy,")"),s.maxWidth=.8*i.height}return isNaN(n.maxLengthPx)||(s.maxWidth=Math.min(s.maxWidth,n.maxLengthPx)),s}({title:e,dock:this.settings.layout.dock,definitionSettings:t,rect:n,measureText:this.renderer.measureText,style:this.style})),r},beforeUpdate(e){e.settings&&(o8(this.settings,e.settings),this.definitionSettings=e.settings.settings);const t=this.settings.text,n=this.definitionSettings.join;this.title=Dae(t,n,this.scale)}};function Oae(e,t){const n=e.settings.layout.dock,r=e.settings.settings.invert,i="top"===n||"bottom"===n,o=i?"width":"height",a=e.rect[o],s=e.chart.scroll(e.settings.scroll);let l;{let e=t[i?"x":"y"];r&&(e=a-e);const n=s.getState();l={startOffset:e,startScroll:n.start,swipe:!1};const o=e/a*(n.max-n.min)+n.min;o<n.start?l.startScroll=o:o>n.start+n.viewSize&&(l.startScroll=o-n.viewSize)}return{update:e=>{let t=e[i?"x":"y"];if(r&&(t=a-t),!l.swipe){if(Math.abs(l.startOffset-t)<=1)return;l.swipe=!0}const n=s.getState(),o=(t-l.startOffset)/a*(n.max-n.min),c=l.startScroll+o;s.moveTo(c)},end:e=>{let t=e[i?"x":"y"];r&&(t=a-t);const n=s.getState();if(l.swipe){const e=(t-l.startOffset)/a*(n.max-n.min),r=l.startScroll+e;s.moveTo(r)}else{const e=t/a*(n.max-n.min)+n.min-n.viewSize/2;s.moveTo(e)}}}}function Lae(e,t){const n=t.element().getBoundingClientRect();return{x:e.center.x-n.left,y:e.center.y-n.top}}const Tae={require:["chart","renderer"],on:{panStart(e){const t=Lae(e,this.renderer),n={x:t.x-e.deltaX,y:t.y-e.deltaY};this.currentMove=Oae(this,n),this.currentMove.update(t)},panMove(e){if(!this.currentMove)return;const t=Lae(e,this.renderer);this.currentMove.update(t)},panEnd(e){if(!this.currentMove)return;const t=Lae(e,this.renderer);this.currentMove.end(t),this.currentMove=null},panCancel(){this.currentMove=null},tap(e){const t=Lae(e,this.renderer);Oae(this,t).end(t)}},defaultSettings:{settings:{backgroundColor:"#eee",thumbColor:"#ccc",width:16}},preferredSize:function(e){const t=this.chart.scroll(this.settings.scroll).getState();if(t.viewSize>=t.max-t.min){return Math.max(e.width,e.height)}return this.settings.settings.width},render:function(e){const t=this.settings.layout.dock,n=this.settings.settings.invert,r="top"===t||"bottom"===t,i=r?"width":"height",o=this.rect[i],a=this.chart.scroll(this.settings.scroll).getState();let s=o*(a.start-a.min)/(a.max-a.min);const l=o*a.viewSize/(a.max-a.min);return n&&(s=o-s-l),e("div",{style:{position:"relative",width:"100%",height:"100%",background:this.settings.settings.backgroundColor,pointerEvents:"auto"}},[].concat(e("div",{class:"scroller",style:{position:"absolute",[r?"left":"top"]:"".concat(s,"px"),[r?"top":"left"]:"25%",[r?"height":"width"]:"50%",[i]:"".concat(Math.max(1,l),"px"),background:this.settings.settings.thumbColor}})))},renderer:"dom"};function qae(e){let{h:t,isVertical:n,value:r,pos:i,align:o,borderHit:a,state:s,idx:l}=e;const c="end"!==o,u=c?{left:"0",top:"0"}:{right:"0",bottom:"0"};let d=0,f="100%",h="100%";return s.targetRect&&"start"===s.settings.bubbles.align?(f="".concat(s.targetRect.x+s.targetRect.width,"px"),h="".concat(s.targetRect.y+s.targetRect.height,"px")):s.targetRect&&"end"===s.settings.bubbles.align&&(d=n?s.targetRect.x:s.targetRect.y,f="".concat(s.rect.width-d,"px"),h="".concat(s.rect.height-d,"px")),c||(i-=a),t("div",{onmouseover(e){e.srcElement.children[0].style.backgroundColor="#000",e.srcElement.children[0].style[n?"height":"width"]="2px"},onmouseout(e){e.srcElement.children[0].style.backgroundColor=s.style.line.stroke,e.srcElement.children[0].style[n?"height":"width"]="1px"},"data-value":r,"data-key":[s.key,"edge",l].join("-"),style:{cursor:n?"ns-resize":"ew-resize",position:"absolute",left:"".concat(n?d:i,"px"),top:"".concat(n?i:d,"px"),height:n?"".concat(a,"px"):h,width:n?f:"".concat(a,"px"),pointerEvents:"auto"}},[t("div",{style:o8({backgroundColor:s.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},u)})])}function Nae(e){let{h:t,isVertical:n,label:r,otherValue:i,rangeIdx:o,idx:a,pos:s,align:l,state:c,value:u}=e;const d="end"!==l,f="outside"===c.settings.bubbles.placement;let h,p="none";n?(h=d?"left":"right",f&&(p=d?"translate(-100%, 0px)":"translate(100%, 0px)")):(h=d?"top":"bottom",f&&(p=d?"translate(0px, -100%)":"translate(0px, 100%)"));let m=c.edit&&c.edit.rangeIdx===o&&c.edit.bubbleIdx===a;const g={position:"relative",borderRadius:"".concat(c.style.bubble.borderRadius,"px"),border:"".concat(c.style.bubble.strokeWidth,"px solid ").concat(c.style.bubble.stroke),backgroundColor:c.style.bubble.fill,color:c.style.bubble.color,fontFamily:c.style.bubble.fontFamily,fontSize:c.style.bubble.fontSize,padding:"4px 8px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"150px",minWidth:"50px",minHeight:"1em",pointerEvents:"auto",transform:n?"translate(0,-50%)":"translate(-50%,0)",cursor:n?"ns-resize":"ew-resize"};let y=c.style.bubble.stroke;const v=m?t("input",{type:"text",value:u,style:c8(c8({},g),{},{textAlign:"start",textOverflow:"",fontSize:"13px"}),onkeyup(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();const t=parseFloat(e.target.value);isNaN(t)?(y="rgba(230, 78, 78, 0.6)",e.target.style.border="".concat(c.style.bubble.strokeWidth,"px solid ").concat(y)):c.onEditConfirmed(o,t,i)}else"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),c.onEditCanceled())}}):t("div",{"data-key":[c.key,"bubble",o,a].join("-"),"data-other-value":i,"data-idx":o,"data-bidx":a,style:g},[r]);return t("div",{style:{position:"absolute",[h]:"0",[n?"top":"left"]:"".concat(s,"px"),transform:p}},[v])}function jae(e){let{h:t,isVertical:n,top:r,height:i,color:o,on:a,opacity:s}=e;return t("div",o8({style:{backgroundColor:o,opacity:s,position:"absolute",left:n?0:"".concat(r,"px"),top:n?"".concat(r,"px"):0,height:n?"".concat(i,"px"):"100%",width:n?"100%":"".concat(i,"px"),pointerEvents:"auto"}},a),[])}function zae(e){let{borderHit:t,els:n,isVertical:r,state:i,vStart:o,vEnd:a,idx:s}=e,l=0;i.targetRect&&(l=r?i.targetRect.y:i.targetRect.x);const c=!!i.scale,u=c?i.scale.norm(o)*i.size:o,d=c?i.scale.norm(a)*i.size:a,f=Math.abs(u-d),h=Math.min(u,d)+l,p=h+f;if(i.targetRect){const e=i.targetFillRect||i.targetRect,t=r?e.height:e.width,s=c?i.scale.norm(o)*t:o,l=c?i.scale.norm(a)*t:a,u=Math.abs(s-l),d=Math.min(s,l),f={h:i.h,isVertical:r,top:d,height:u,color:i.style.target.fill,opacity:i.style.target.opacity};i.style.target.opacity<.8&&(f.on={onmouseover(e){e.srcElement.style.opacity=i.style.target.opacity+.1},onmouseout(e){e.srcElement.style.opacity=i.style.target.opacity}}),n.push(i.h("div",{style:{position:"absolute",left:"".concat(e.x,"px"),top:"".concat(e.y,"px"),height:"".concat(e.height,"px"),width:"".concat(e.width,"px")}},[jae(f)]))}const m=u<d?o:a,g=u<d?a:o,[y,v]=c?i.scale.domain():[Math.min(o,a),Math.max(o,a)],b=m+1e-5>=y&&m-1e-5<=v,x=g-1e-5<=v&&g+1e-5>=y;b&&n.push(qae({h:i.h,isVertical:r,borderHit:t,value:m,pos:h,align:"start",state:i,idx:s})),x&&n.push(qae({h:i.h,isVertical:r,borderHit:t,value:g,pos:p,align:"end",state:i,idx:s}));const w=i.settings.bubbles;if(w&&w.show){w.fontSize,w.fontFamily,w.fill;const e=[o,a];b&&n.push(Nae({h:i.h,isVertical:r,align:w.align,rangeIdx:s,idx:0,otherValue:g,value:m,label:"".concat(i.format(m,e)),pos:h,state:i})),x&&n.push(Nae({h:i.h,isVertical:r,align:w.align,rangeIdx:s,idx:1,otherValue:m,value:g,label:"".concat(i.format(g,e)),pos:p,state:i}))}}function Fae(e){const t=e.active.limitHigh-e.active.end,n=e.active.limitLow-e.active.start;let r=e.current-e.start;return r=r<0?Math.max(r,n):Math.min(r,t),r}function Wae(e){let t=[];const n=0===e.direction;if(Array.isArray(e.ranges)&&e.ranges.forEach(((r,i)=>{e.active&&i===e.active.idx||zae({borderHit:5,els:t,isVertical:n,state:e,vStart:Math.min(r.min,r.max),vEnd:Math.max(r.min,r.max),idx:i})})),e.active){let r=e.start,i=e.current;if(-1!==e.active.idx)if("foo"===e.active.mode)r=Math.min(e.active.start,e.active.end),i=Math.max(e.active.start,e.active.end);else if("modify"===e.active.mode)r=Math.min(e.start,e.current),i=Math.max(e.start,e.current);else{const t=Fae(e);r=e.active.start+t,i=e.active.end+t}zae({borderHit:5,els:t,isVertical:n,state:e,vStart:r,vEnd:i,idx:e.active.idx})}return t}function $ae(e){return{min:e.scale.min(),max:e.scale.max()}}function Bae(e){return{min:0,max:e.direction?e.rect.width:e.rect.height}}function Vae(e,t,n){let r,i,o=e.ranges,a=-1;for(r=0;r<o.length;r++){if(o[r].min<=t&&t<=o[r].max){a=r,n.min=r?o[r-1].max:n.min,n.max=r+1<o.length?o[r+1].min:n.max;break}if(t<o[r].min){n.max=o[r].min,n.min=r?o[r-1].max:n.min;break}}-1===a&&o.length&&r>=o.length&&(n.min=o[o.length-1].max),-1!==a&&(i={idx:a,start:o[a].min,end:o[a].max,limitLow:n.min,limitHigh:n.max,mode:"foo"}),e.active=i}function Hae(e){e.renderer.render(Wae(e))}function Uae(e,t){if(!t||!t.isActive())return[];const n=e.scale.data(),r=(n&&n.fields||[]).map((e=>e.id())),i=t.brushes().filter((e=>"range"===e.type&&-1!==r.indexOf(e.id)))[0];return i?i.brush.ranges():[]}function Gae(e,t){let n,r=1/0;const i=t.domain(),o=t.bandwidth()/2;for(let a=0;a<i.length;++a){const s=Math.abs(e-o-t(i[a]));s<r&&(r=s,n=i[a])}return n}function Yae(e,t){return Math.min(...e)<=Math.max(...t)&&Math.max(...e)>=Math.min(...t)}function Kae(e){const t=e.reduce(((e,t)=>(e.push(...m8(t.bounds)),e)),[]);return g8(t)}const Xae={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{rangeStart(e){this.start(e)},rangeMove(e){this.move(e)},rangeEnd(e){this.end(e)},rangeClear(e){this.clear(e)},bubbleStart(e){this.bubbleStart(e)}},created(){this.state={key:this.settings.key||"brush-range"}},beforeRender(e){this.state.rect=e.size.computedInner},renderRanges(){this.state.started||(this.state.ranges=Uae(this.state,this.state.brushInstance),this.state.active=null,Hae(this.state))},render(e){const t=this.settings.settings;this.state.direction="vertical"===t.direction?0:1;const n=this.renderer.element().getBoundingClientRect(),r=this.state.rect[0===this.state.direction?"height":"width"];let i=Ire(this.chart.scale(t.scale),r);const o=function(e){const t={targetRect:null,targetFillRect:null,scale:null,size:null},n=e.settings.settings,r=n.target&&(n.target.components||(n.target.component?[n.target.component]:[])).map((t=>e.chart.component(t))).filter((e=>!!e&&!!e.rect)),i=n.target&&n.target.selector?e.chart.findShapes(n.target.selector):[],o=n.target&&n.target.fillSelector?e.chart.findShapes(n.target.fillSelector):[];if(i.length>0){const r=Kae(i);if(t.size=r[0===e.state.direction?"height":"width"],t.scale=Ire(e.chart.scale(n.scale),t.size),t.targetRect=r,o.length>0){const e=Kae(o);t.targetFillRect=e}}else if(r&&r.length>0){const n=r.slice(1).reduce(((e,t)=>({x0:Math.min(e.x0,t.rect.computedInner.x),y0:Math.min(e.y0,t.rect.computedInner.y),x1:Math.max(e.x1,t.rect.computedInner.x+t.rect.computedInner.width),y1:Math.max(e.y1,t.rect.computedInner.y+t.rect.computedInner.height)})),{x0:r[0].rect.computedInner.x,y0:r[0].rect.computedInner.y,x1:r[0].rect.computedInner.x+r[0].rect.computedInner.width,y1:r[0].rect.computedInner.y+r[0].rect.computedInner.height});t.targetRect={x:n.x0-e.state.rect.x,y:n.y0-e.state.rect.y,width:n.x1-n.x0,height:n.y1-n.y0}}return t}(this);if(i=o.scale?o.scale:i,this.state.targetRect=o.targetRect,this.state.targetFillRect=o.targetFillRect,this.state.size=null===o.size?r:o.size,this.state.settings=t,this.state.style=this.style,this.state.offset=n,this.state.brush="object"==typeof t.brush?t.brush.context:t.brush,this.state.brushInstance=this.chart.brush(this.state.brush),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.onEditConfirmed=(e,t,n)=>{this.state.edit=null,function(e,t,n,r){let i=e.ranges.map((e=>({min:e.min,max:e.max})));const o=e.scale.min(),a=e.scale.max();i[t]={min:Math.max(o,Math.min(n,r)),max:Math.min(a,Math.max(n,r))},e.ranges[t]=c8({},i[t]);const s=e.scale.data();s&&s.fields&&s.fields.forEach((t=>{e.fauxBrushInstance||e.brushInstance.setRange(t.id(),i)}))}(this.state,e,t,n),this.emit("bubbleEnd"),Hae(this.state)},this.state.onEditCanceled=()=>{this.state.edit=null,Hae(this.state)},this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX"},this.state.format="function"==typeof t.bubbles.label&&((e,n)=>t.bubbles.label.call(void 0,{datum:e,data:n,scale:i,resources:{scale:this.chart.scale,formatter:this.chart.formatter}})),{}.hasOwnProperty.call(i,"norm")){this.state.editable=!0,this.state.observeBrush="object"==typeof t.brush&&t.brush.observe,this.state.fauxBrushInstance=null,this.state.findValues=null,this.state.scale=i;const e=this.state.scale.data();!this.state.format&&e&&e.fields&&e.fields[0]&&(this.state.format=e.fields[0].formatter())}else this.state.editable=!1,this.state.scale=Ane(),this.state.scale.data=i.data,this.state.format||(this.state.format=(e,t)=>Yae(i.range(),t)?function(e,t){const n=t.ticks(),r=t.domain().indexOf(Gae(e,t));return-1!==r?n[r].label:"-"}(e,i):"-"),this.state.fauxBrushInstance=gre(),this.state.findValues=e=>function(e,t){const n=t.domain(),r=t.range(),i=[];return e.forEach((e=>{if(!Yae(r,[e.min,e.max]))return;const o=n.indexOf(Gae(e.min,t)),a=n.indexOf(Gae(e.max,t));i.push.apply(i,n.slice(Math.min(o,a),Math.max(o,a)+1))})),i}(e,i);return this.state.ranges=Uae(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[Wae(this.state)]:[]},mounted(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.on("update",this.renderRanges)},beforeDestroy(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.removeListener("update",this.renderRanges)},start(e){!function(e){let{state:t,e:n,renderer:r,ranges:i,targetSize:o}=e;if(t.started)return;t.edit=null;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);r.element().contains(l)||(l=null);const c={started:!0};t.offset=o8({},r.element().getBoundingClientRect());const u=a-t.offset.left,d=s-t.offset.top;t.offset.left+=t.targetRect?t.targetRect.x:0,t.offset.top+=t.targetRect?t.targetRect.y:0,t.ranges=i(t,t.fauxBrushInstance||t.brushInstance);const f=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],h=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];c.current=t.scale.normInvert(h/t.size),c.start=t.scale.normInvert(f/t.size);let p=t.ranges;const m=$ae(t);let g,y,v=-1;if(l&&l.hasAttribute("data-idx"))v=parseInt(l.getAttribute("data-idx"),10),m.min=v>0?p[v-1].max:m.min,m.max=v+1<p.length?p[v+1].min:m.max;else{for(g=0;g<p.length;g++){if(p[g].min<=c.start&&c.start<=p[g].max){v=g,m.min=g?p[g-1].max:m.min,m.max=g+1<p.length?p[g+1].min:m.max;break}if(c.start<p[g].min){m.max=p[g].min,m.min=g?p[g-1].max:m.min;break}}-1===v&&p.length&&g>=p.length&&(m.min=p[p.length-1].max)}if(-1!==v||t.multi||(c.ranges=[],m.min=t.scale.min(),m.max=t.scale.max()),-1!==v)if(y={idx:v,start:p[v].min,end:p[v].max,limitLow:m.min,limitHigh:m.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),y.mode="modify";else{let e=t.scale.norm(y.start)*t.size,n=t.scale.norm(y.end)*t.size;Math.abs(f-e)<=o?(c.start=y.end,y.mode="modify"):Math.abs(f-n)<=o&&(c.start=y.start,y.mode="modify")}else y={idx:-1,start:c.start,end:c.current,limitLow:m.min,limitHigh:m.max,mode:"current"};c.active=y,"modify"!==y.mode&&t.targetRect&&!Eie(t.targetRect,{x:u,y:d})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:Uae,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e,e.fauxBrushInstance||e.brushInstance);const n=$ae(e);Vae(e,e.current,n)}(this.state,Uae),Hae(this.state),this.state.sourcedFromThisComponent=!0,this.state.active=null)},move(e){this.state.started&&(!function(e,t){const n=(t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset])/e.size,r=e.scale.normInvert(n);e.current=Math.max(Math.min(r,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){let t=e.ranges.map((e=>({min:e.min,max:e.max})));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=Fae(e);t[e.active.idx].min+=n,t[e.active.idx].max+=n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});const n=e.scale.data();n&&n.fields&&n.fields.forEach((n=>{if(e.fauxBrushInstance){let r=Uae(e,e.fauxBrushInstance),i=e.findValues(r),o=e.findValues(t),a=o.filter((e=>-1===i.indexOf(e))),s=i.filter((e=>-1===o.indexOf(e))),l=a.map((e=>({key:n.id(),value:e}))),c=s.map((e=>({key:n.id(),value:e})));e.brushInstance.addAndRemoveValues(l,c),e.fauxBrushInstance.setRange(n.id(),t)}else e.brushInstance.setRange(n.id(),t)}))}(this.state),Hae(this.state))},clear(){this.state.fauxBrushInstance&&this.state.fauxBrushInstance.clear(),this.state.renderer.render([]),this.state.started=!1,this.state.active=null,this.state.sourcedFromThisComponent=!1},bubbleStart(e){if(!this.state.editable)return;const t=e.srcEvent||e,n=t.target,r={rangeIdx:parseInt(n.getAttribute("data-idx"),10),bubbleIdx:parseInt(n.getAttribute("data-bidx"),10)};if(isNaN(r.rangeIdx)||JSON.stringify(r)===JSON.stringify(this.state.edit))return;this.state.edit=r,t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault();const i=n.parentNode;Hae(this.state);const o=i.querySelector("input");o.focus(),o.select()}};function Jae(e){e.renderer.render(Wae(e))}function Qae(e){return e.rc.ranges()}function Zae(e,t){const n={x:e.direction?t.min+e.rect.x:e.rect.x,y:e.direction?e.rect.y:t.min+e.rect.y,width:e.direction?t.max-t.min:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:t.max-t.min};return e.chart.shapesAt(n,e.settings.brush)}const ese={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaClear(e){this.clear(e)}},created(){this.state={key:this.settings.key||"brush-area-dir"}},render(e){this.state.rect=this.rect;const t=this.settings.settings,n="vertical"===t.direction?0:1,r=this.state.rect[0===n?"height":"width"],i=this.renderer.element().getBoundingClientRect(),o=(t.target?t.target.components||[t.target.component]:[]).map((e=>this.chart.component(e))).filter((e=>!!e&&!!e.rect)),a=o[0]?o.slice(1).reduce(((e,t)=>({x0:Math.min(e.x0,t.rect.x),y0:Math.min(e.y0,t.rect.y),x1:Math.max(e.x1,t.rect.x+t.rect.width),y1:Math.max(e.y1,t.rect.y+t.rect.height)})),{x0:o[0].rect.x,y0:o[0].rect.y,x1:o[0].rect.x+o[0].rect.width,y1:o[0].rect.y+o[0].rect.height}):null;return this.state.targetRect=a?{x:a.x0-this.rect.x,y:a.y0-this.rect.y,width:a.x1-a.x0,height:a.y1-a.y0}:null,this.state.style=this.style,this.state.chart=this.chart,this.state.direction=n,this.state.settings=t,this.state.offset=i,this.state.rc=ire(),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.size=r,this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX",area:0===this.state.direction?"height":"width"},this.state.format=function(e,t){return function(e,t,n){const r=Math.min(...n),i=Math.max(...n),o={x:e.direction?r+e.rect.x:e.rect.x,y:e.direction?e.rect.y:r+e.rect.y,width:e.direction?i-r:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:i-r},a=e.chart.shapesAt(o,e.settings.brush);if(0===a.length)return"-";const s=a.reduce(((n,i)=>{const o=n.bounds,a=i.bounds;return t===r?o[e.cssCoord.coord]<=a[e.cssCoord.coord]?n:i:o[e.cssCoord.coord]+o[e.cssCoord.area]>=a[e.cssCoord.coord]+a[e.cssCoord.area]?n:i})),l=e.settings.brush.components.reduce(((e,t)=>e.key===s.key?e:t));return"function"==typeof e.settings.bubbles.label?e.settings.bubbles.label(s.data):Array.isArray(l.data)&&l.data.length?s.data[l.data[0]].label:s.data&&s.data.label?s.data.label:"-"}(this,e,t)},[]},start(e){!function(e){let{state:t,e:n,renderer:r,ranges:i,targetSize:o}=e;if(t.started)return;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);r.element().contains(l)||(l=null);const c={started:!0};t.offset=r.element().getBoundingClientRect(),t.ranges=i(t);const u=a-t.offset.left,d=s-t.offset.top,f=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],h=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];let p=h,m=f;c.start=f,c.current=h;let g=t.ranges;const y=Bae(t);let v,b,x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),y.min=x>0?g[x-1].max:y.min,y.max=x+1<g.length?g[x+1].min:y.max;else{for(v=0;v<g.length;v++){if(g[v].min<=m&&m<=g[v].max){x=v,y.min=v?g[v-1].max:y.min,y.max=v+1<g.length?g[v+1].min:y.max;break}if(m<g[v].min){y.max=g[v].min,y.min=v?g[v-1].max:y.min;break}}-1===x&&g.length&&v>=g.length&&(y.min=g[g.length-1].max)}if(-1!==x||t.multi||(c.ranges=[],y.min=0,y.max=t.direction?t.rect.width:t.rect.height),-1!==x)if(b={idx:x,start:g[x].min,end:g[x].max,limitLow:y.min,limitHigh:y.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),b.mode="modify";else{let e=b.start,t=b.end;Math.abs(f-e)<=o?(c.start=b.end,b.mode="modify"):Math.abs(f-t)<=o&&(c.start=b.start,b.mode="modify")}else b={idx:-1,start:m,end:p,limitLow:y.min,limitHigh:y.max,mode:"current"};c.active=b,"modify"!==b.mode&&t.targetRect&&!Eie(t.targetRect,{x:u,y:d})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:Qae,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e);const n=Bae(e);Vae(e,e.current,n)}(this.state,Qae),Jae(this.state))},move(e){this.state.started&&(!function(e,t){const n=t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset];e.current=Math.max(Math.min(n,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){const t=e.ranges.map((e=>({min:e.min,max:e.max})));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=Fae(e);t[e.active.idx].min=e.active.start+n,t[e.active.idx].max=e.active.end+n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});e.rc.set(t);let n=[];t.forEach((t=>{n=[...n,...Zae(e,t)]})),function(e,t){e.chart.brushFromShapes(t,e.settings.brush)}(e,n)}(this.state),Jae(this.state))},clear(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function tse(e){const t="vertical"===e.direction,n=e.rect[t?"height":"width"],r=e.rect[t?"width":"height"];return function(e){const t=e.brush;if(!t||!t.isActive())return[];const n=e.scale.data(),r=(n&&n.fields||[]).map((e=>e.id())),i=t.brushes().filter((e=>"range"===e.type&&-1!==r.indexOf(e.id)))[0];return i?i.brush.ranges():[]}(e).map((i=>{const o=e.scale(i.min)*n,a=e.scale(i.max)*n,s=Math.min(o,a),l=Math.abs(o-a);return{type:"rect",fill:e.fill,opacity:e.opacity,x:t?0:s,width:t?r:l,y:t?s:0,height:t?l:r}}))}function nse(e,t,n,r){function i(){!function(e){e.renderer.render(tse(e))}(e)}function o(){!function(e){e.renderer.render(tse(e))}(e)}function a(){!function(e){e.renderer.render(tse(e))}(e)}e.brush=t,t&&(t.on("start",i),t.on("update",o),t.on("end",a),e.start=i,e.update=o,e.end=a,e.brush=t,e.scale=n,e.renderer=r)}function rse(e){e.brush&&(e.brush.removeListener("start",e.start),e.brush.removeListener("update",e.update),e.brush.removeListener("end",e.end)),e.start=void 0,e.update=void 0,e.end=void 0,e.brush=void 0,e.scale=void 0,e.renderer=void 0}const ise={require:["chart","settings","renderer"],defaultSettings:{settings:{}},preferredSize:()=>50,created(){this.state={}},render(){const e=this.settings.settings,t=this.chart.brush(e.brush),n=e.direction||"horizontal",r="horizontal"===n?this.rect.width:this.rect.height,i=Ire(this.chart.scale(e.scale),r);return rse(this.state),nse(this.state,t,i,this.renderer),this.state.rect=this.rect,this.state.fill=e.fill||"#ccc",this.state.opacity=void 0!==e.opacity?e.opacity:1,this.state.direction=n,tse(this.state)},beforeDestroy(){rse(this.state)}};function ose(e,t){const n=t.center.x,r=t.center.y;return{x:n-e.left,y:r-e.top}}function ase(e,t,n){return Gre(e,t.points[0])<n.settings.snapIndicator.threshold**2}function sse(e,t){null==e.path.d?e.path.d="M".concat(t.x," ").concat(t.y," "):e.path.d+="L".concat(t.x," ").concat(t.y," "),e.points.push(t)}function lse(e){let{state:t,start:n=null,end:r=null}=e;null!==n&&(t.snapIndicator.x1=n.x,t.snapIndicator.y1=n.y),null!==r&&(t.snapIndicator.x2=r.x,t.snapIndicator.y2=r.y)}function cse(e,t){e.snapIndicator.visible=t}const use={require:["chart","renderer","settings"],defaultSettings:{layout:{displayOrder:0},settings:{brush:{components:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.5},lasso:{fill:"transparent",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:"20, 10"},startPoint:{r:10,fill:"green",stroke:"black",strokeWidth:1,opacity:1}}},on:{lassoStart(e){this.start(e)},lassoEnd(e){this.end(e)},lassoMove(e){this.move(e)},lassoCancel(){this.cancel()}},created(){this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}}},start(e){var t;this.state.active=!0,this.state.path={visible:!0,type:"path",d:null,fill:(t=this.settings.settings.lasso).fill,stroke:t.stroke,strokeWidth:t.strokeWidth,opacity:t.opacity,strokeDasharray:t.strokeDasharray,collider:{type:null}},this.state.snapIndicator=function(e){return{visible:!1,type:"line",x1:0,y1:0,x2:0,y2:0,strokeDasharray:e.strokeDasharray,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,collider:{type:null}}}(this.settings.settings.snapIndicator),this.state.startPoint=function(e){return{visible:!0,type:"circle",cx:0,cy:0,r:e.r,fill:e.fill,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,collider:{type:null}}}(this.settings.settings.startPoint),this.state.rendererBounds=this.renderer.element().getBoundingClientRect(),this.state.componentDelta=function(e,t){const n=e.element.getBoundingClientRect();return{x:t.left-n.left,y:t.top-n.top}}(this.chart,this.state.rendererBounds),this.state.brushConfig=function(e){return e.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts||["lassoBrush"],data:e.data||[""],action:e.action||"add"})))}(this.settings);const n=ose(this.state.rendererBounds,e);sse(this.state,n),lse({state:this.state,start:n}),function(e,t){e.startPoint.cx=t.x,e.startPoint.cy=t.y}(this.state,n)},move(e){if(!this.state.active)return;const t=ose(this.state.rendererBounds,e);ase(t,this.state,this.settings)?cse(this.state,!0):cse(this.state,!1),sse(this.state,t),lse({state:this.state,end:t}),function(e,t){const n=[e.startPoint,e.path,e.snapIndicator].filter((e=>e.visible));t.render(n)}(this.state,this.renderer),function(e,t){if(e.active){const n=e.points[e.points.length-2],r=e.points[e.points.length-1];e.lineBrushShape.x1=n.x+e.componentDelta.x,e.lineBrushShape.y1=n.y+e.componentDelta.y,e.lineBrushShape.x2=r.x+e.componentDelta.x,e.lineBrushShape.y2=r.y+e.componentDelta.y;const i=t.shapesAt(e.lineBrushShape,{components:e.brushConfig});t.brushFromShapes(i,{components:e.brushConfig})}}(this.state,this.chart)},end(e){if(!this.state.active)return;cse(this.state,!1);ase(ose(this.state.rendererBounds,e),this.state,this.settings)&&function(e,t){if(e.active){const n=e.componentDelta.x,r=e.componentDelta.y,i=e.points.map((e=>({x:e.x+n,y:e.y+r}))),o=t.shapesAt({vertices:i},{components:e.brushConfig});t.brushFromShapes(o,{components:e.brushConfig})}}(this.state,this.chart),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([])},cancel(){var e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach((e=>{e.contexts.forEach((e=>{t.brush(e).end()}))})),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([]))},render(){}};function dse(e,t,n,r,i){let o,a=0,s=t.length-1;for(;a<s;){let l=Math.floor((a+s)/2);o=i(t[l]),o[n]+o[r]<e[n]?a=l+1:s=l}return a}function fse(e){let{orientation:t,targetNodes:n,labels:r,container:i}=e,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dse;const a=[],s="v"===t?"x":"y",l="v"===t?"width":"height",c=e=>e.textBounds,u=e=>e.node.localBounds;return(e,t)=>{const{textBounds:d,node:f}=r[t];if(d[s]<i[s]||d[s]+d[l]>i[s]+i[l])return!1;for(let e=o(d,a,s,l,c);e<a.length;e++)if(Cie(d,a[e].textBounds))return!1;const h=o(d,n,s,l,u),p=d[s]+d[l];for(let e=h;e<n.length;e++){const t=n[e].node;if(p<t.localBounds[s])break;if(Cie(d,t.localBounds)&&f!==t)return!1}return a.push(r[t]),!0}}const hse=4;function pse(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function mse(e){const t=typeof e;return("string"===t||"number"===t)&&""!==e}function gse(e){return c8(c8({type:"rect",rx:2,ry:2,fill:e.backgroundColor},e.backgroundBounds),{},{data:"".concat(e.data," ").concat(e.text),rotation:e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal"})}function yse(e,t,n){return n?e.width>=t.height:e.width>=t.width}function vse(e,t,n){return n?e.height>=t.width:e.height>=t.height}function bse(e,t,n,r,i){let o,a;return"v"===e?(o=r||i||yse(t,n,!0),a=vse(t,n,!r)):(o=yse(t,n),a=i||vse(t,n,!1)),o&&a}function xse(e,t,n,r){return e+.5*t+(r-.5)*(t-n)-.5*n}function wse(e,t,n){const r={type:"text",text:t,maxWidth:n.rotate?e.height:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:n.rotate?"end":"start",baseline:"central",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},i=n.textMetrics;if(!n.overflow&&!function(e,t,n){return yse(e,t,n.rotate)&&vse(e,t,n.rotate)}(e,i,n))return!1;const o=.5*i.height;return n.rotate?(r.x=xse(e.x,e.width,i.height,n.align)+o,r.y=xse(e.y,e.height,i.width,n.justify),"right"===n.dock?r.transform="rotate(90, ".concat(r.x+r.dx,", ").concat(r.y+r.dy,") translate(").concat(i.width,", 0)"):r.transform="rotate(-90, ".concat(r.x+r.dx,", ").concat(r.y+r.dy,")")):(r.x=xse(e.x,e.width,i.width,n.align),r.y=xse(e.y,e.height,i.height,n.justify)+o),r}function Sse(e){let{bar:t,view:n,direction:r,position:i,padding:o=hse,measured:a}=e;const s={};if(o8(s,t),i&&"inside"!==i)if("up"===r||"down"===r){const e=Math.max(0,Math.min(t.y,n.height)),o=Math.max(0,Math.min(t.y+t.height,n.height));"outside"===i&&"up"===r||"opposite"===i&&"down"===r?(s.y=0,s.height=e):("outside"===i&&"down"===r||"opposite"===i&&"up"===r)&&(s.y=o,s.height=n.height-o)}else{const e=Math.max(0,Math.min(t.x,n.width)),o=Math.max(0,Math.min(t.x+t.width,n.width));"outside"===i&&"left"===r||"opposite"===i&&"right"===r?(s.x=0,s.width=e):("outside"===i&&"right"===r||"opposite"===i&&"left"===r)&&(s.x=o,s.width=n.width-o)}else;return function(e,t){const n=Math.max(0,Math.min(e.y,t.height)),r=Math.max(0,Math.min(e.y+e.height,t.height)),i=Math.max(0,Math.min(e.x,t.width)),o=Math.max(0,Math.min(e.x+e.width,t.width));e.x=i,e.width=o-i,e.y=n,e.height=r-n}(s,n),function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{top:r=hse,bottom:i=hse,left:o=hse,right:a=hse}=n,s="function"==typeof o?o(t):o,l="function"==typeof a?a(t):a,c="function"==typeof r?r(t):r,u="function"==typeof i?i(t):i;e.x+=s,e.width-=s+l,e.y+=c,e.height-=c+u}(s,a,o),s}function Cse(e){let t,n,r,i,o,{direction:a,fitsHorizontally:s,measured:l,node:c,orientation:u,placementSettings:d,rect:f}=e,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Sse;const p=[],m="h"===u?"width":"height";for(o=0;o<d.length;o++)if(r=d[o],i=h({bar:c.localBounds,view:f,direction:a,position:r.position,padding:r.padding,measured:l}),p.push(i),t=!o||i[m]>t[m]?i:t,bse(u,i,l,s,r.overflow)){n=i;break}return n||(n=t,o=p.indexOf(n)),r=d[o],{bounds:n,placement:r}}function kse(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const{top:o=hse,bottom:a=hse,left:s=hse,right:l=hse}=i,c="function"==typeof s?s(t):s,u="function"==typeof l?l(t):l,d="function"==typeof o?o(t):o,f="function"==typeof a?a(t):a,h=e.x+e.dx,p=e.y+e.dy,m=n?Math.min(t.width,r.height):Math.min(t.height,r.width),g=n?Math.min(t.height,r.height):Math.min(t.width,r.width),y=.5*t.height,v=1e-9;return{x:(n?h-y:h)-c-v,y:(n?p:p-y)-d-v,width:g+(c+u)-v,height:m+(d+f)-v}}function Ese(e){let{chart:t,targetNodes:n,rect:r,fitsHorizontally:i,collectiveOrientation:o}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Cse,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:wse,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:fse;const c=[],u={container:r,targetNodes:n,labels:[],orientation:o};let d,f,h,p,m,g,y,v,b,x,w,S,C,k;for(let e=0,l=n.length;e<l;e++){g=null,f=n[e],h=f.node,C=pse(h,t),b=f.direction,k="left"===b||"right"===b?"h":"v";for(let t=0;t<f.texts.length;t++){if(p=f.texts[t],!mse(p))continue;x=f.labelSettings[t],v=f.measurements[t],S=x.placements;const n=a({direction:b,fitsHorizontally:i,lblStngs:x,measured:v,node:h,orientation:k,placements:S,placementSettings:f.placementSettings[t],rect:r});if(g=n.bounds,w=n.placement,g&&w){var E;m=w.justify;const t="function"==typeof x.linkData?x.linkData(C,e):void 0,n="function"==typeof w.overflow?w.overflow(C,e):w.overflow;"up"===b&&(m=1-m),"opposite"===w.position&&(m=1-m),"left"===b&&(m=1-m);const r=!("h"===o||i);if(d=s(g,p,{justify:"h"===k?w.align:m,align:"h"===k?m:w.align,fontSize:x.fontSize,fontFamily:x.fontFamily,textMetrics:v,rotate:r,overflow:!!n,dock:null!==(E=x.dock)&&void 0!==E?E:"left"}),d){const n=kse(d,v,r,g,w.padding);y="function"==typeof w.fill?w.fill(c8(c8({},C),{},{textBounds:n}),e):w.fill,d.fill=y,void 0!==t&&(d.data=t),"object"==typeof w.background&&(d.backgroundColor="function"==typeof w.background.fill?w.background.fill(c8(c8({},C),{},{textBounds:n}),e):w.background.fill,void 0!==d.backgroundColor&&(d.backgroundBounds=kse(d,v,r,g,w.background.padding))),c.push(d),u.labels.push({node:h,textBounds:n})}}}}const M=c.filter(l(u)),_=M.filter((e=>void 0!==e.backgroundBounds)).map(gse);return[..._,...M]}function Mse(e){const t=2*Math.PI;return(e%t+t)%t}function _se(e,t){e.x+=t,e.width-=2*t,e.y+=t,e.height-=2*t}function Rse(e){return{x:e.x,y:e.y-e.height/2,width:e.width,height:e.height}}function Ise(e,t,n){let{x:r,y:i}=t;if(r*r+i*i>e*e)return null;let o=Math.sin(n),a=Math.cos(n),s=r*a-i*o,l=e*e-s*s;if(l<0)return null;let c=Math.sqrt(l);return{x:s*a+o*c,y:-s*o+a*c}}function Dse(e){let t,n,{radius:r,size:i,angle:o}=e,{width:a,height:s}=i,l={x:a/2,y:s/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(t=Ise(r,l,o),!t)return null;t.y*=-1,n={x:-a,y:0};break;case 1:if(t=Ise(r,l,Math.PI-o),!t)return null;n={x:-a,y:-s};break;case 2:if(t=Ise(r,l,o-Math.PI),!t)return null;t.x*=-1,n={x:0,y:-s};break;case 3:if(t=Ise(r,l,2*Math.PI-o),!t)return null;t.x*=-1,t.y*=-1,n={x:0,y:0};break;default:throw new Error("invalid angle")}return{x:t.x+n.x,y:t.y+n.y,width:a,height:s}}function Pse(e){let{slice:t,measured:n,padding:r}=e,{start:i,end:o,innerRadius:a,outerRadius:s}=t,l=s-a-2*r,c=o-i;if(c<Math.PI){let e=(n.height/2+r)/Math.tan(c/2);e>a&&(l=s-e-2*r)}if(l<0||l<n.minReqWidth)return null;const u=Mse((i+o)/2);let d=s-r,f={x:Math.sin(u)*d,y:-Math.cos(u)*d,width:l,height:n.height};return u<Math.PI?(f.angle=u-Math.PI/2,f.anchor="end"):(f.angle=u+Math.PI/2,f.anchor="start"),f}function Ase(e){let{context:t,node:n,bounds:r}=e;let{start:i,end:o}=n.desc.slice;const a=Mse((i+o)/2);switch(Math.floor(a/(Math.PI/2))){case 0:t.q1maxY=r.y-2,void 0===t.q2minY&&(t.q2minY=r.y+r.height+2);break;case 1:t.q2minY=r.y+r.height+2;break;case 2:t.q3minY=r.y+r.height+2;break;case 3:t.q4maxY=r.y-2,void 0===t.q3minY&&(t.q3minY=r.y+r.height+2)}}function Ose(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Lse(e,t,n){const r={type:"text",text:t,maxWidth:e.width,x:e.x,y:e.y+("top"===e.baseline?e.height/2:0),fill:n.fill,anchor:e.anchor||"start",baseline:"middle",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily};if(!isNaN(e.angle)){let t=e.angle*(360/(2*Math.PI));r.transform="rotate(".concat(t,", ").concat(r.x,", ").concat(r.y,")")}return r}function Tse(e){let t,n,{slice:r,direction:i,position:o,padding:a,measured:s,view:l,context:c,store:u}=e,{start:d,end:f,innerRadius:h,offset:p}=r;switch(o){case"into":t="rotate"===i?Pse({slice:r,measured:s,padding:a}):function(e){let{slice:t,padding:n,measured:r}=e,{start:i,end:o,innerRadius:a,outerRadius:s}=t;const l=Mse((i+o)/2);let c=Dse({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",Mie(c,{x1:0,y1:0,x2:Math.sin(i)*s,y2:-Math.cos(i)*s})||Mie(c,{x1:0,y1:0,x2:Math.sin(o)*s,y2:-Math.cos(o)*s})||yie({cx:0,cy:0,r:a},c)?null:(_se(c,n),c)):null}({slice:r,measured:s,padding:a});break;case"inside":n={start:d,end:f,innerRadius:0,outerRadius:h},t="rotate"===i?Pse({slice:n,measured:s,padding:a}):function(e){let{slice:t,padding:n,measured:r,store:i}=e;const{start:o,end:a,outerRadius:s}=t,l=Mse((o+a)/2);let c=Dse({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",_se(c,n),i.insideLabelBounds.some((e=>Cie(e,c)))?null:(i.insideLabelBounds.push({x:c.x-4,y:c.y,width:c.width+8,height:c.height}),c)):null}({slice:n,measured:s,padding:a,store:u});break;case"outside":t="rotate"===i?function(e){let{slice:t,measured:n,padding:r,view:i}=e,{start:o,end:a,outerRadius:s,offset:l}=t,c=s+r,u=a-o;if(u<Math.PI&&(n.height/2+r)/Math.tan(u/2)>c)return null;const d=Mse((o+a)/2);let f=Math.sin(d)*c,h=-Math.cos(d)*c,p=n.width+1,m=d%Math.PI;if(m>Math.PI/2&&(m=Math.PI-m),Math.cos(m)>.001){let e=h<0?i.y:i.y+i.height,t=Math.abs(e-l.y)/Math.cos(m)-Math.tan(m)*(n.height/2)-2*r-s;t<p&&(p=t)}if(Math.sin(m)>.001){let e=f<0?i.x:i.x+i.width,t=Math.abs(e-l.x)/Math.sin(m)-n.height/2/Math.tan(m)-2*r-s;t<p&&(p=t)}if(p<=0||p<n.minReqWidth)return null;let g={x:f,y:h,width:p,height:n.height};return d<Math.PI?(g.angle=d-Math.PI/2,g.anchor="start"):(g.angle=d+Math.PI/2,g.anchor="end"),g}({slice:r,measured:s,padding:a,view:l}):function(e){let{slice:t,measured:n,padding:r,view:i,context:o}=e,{start:a,end:s,outerRadius:l,offset:c}=t;const u=Mse((a+s)/2);if(function(e,t,n){switch(t){case 0:return e.q1maxY<0;case 1:return e.q2minY>n.height;case 2:return e.q3minY>n.height;case 3:return e.q4maxY<0;default:return!0}}(o,Math.floor(u/(Math.PI/2)),i))return null;let d=l+r+n.height/2,f=Math.sin(u)*d,h=-Math.cos(u)*d,p=n.width+1;if(u<Math.PI){let e=Math.abs(i.x+i.width-(f+c.x));e<p&&(p=e)}else{let e=Math.abs(i.x-(f+c.x));e<p&&(p=e)}if(p<n.minReqWidth)return null;let m={x:f,y:h,width:p,height:n.height};return u<Math.PI?m.anchor="start":m.anchor="end",m}({slice:r,measured:s,padding:a,view:l,context:c});break;default:throw new Error("not implemented")}return t&&(t.x+=p.x,t.y+=p.y,"outside"===o&&"rotate"!==i&&function(e,t,n){const{start:r,end:i,offset:o,outerRadius:a}=n,s=Mse((r+i)/2);switch(Math.floor(s/(Math.PI/2))){case 0:if(void 0!==t.q1maxY){let n=Math.min(e.y,t.q1maxY-e.height),r=e.y-n;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x-2,y1:e.y+2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 1:if(void 0!==t.q2minY){let n=Math.max(e.y,t.q2minY),r=n-e.y;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x-2,y1:e.y-2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 2:if(void 0!==t.q3minY){let n=Math.max(e.y,t.q3minY),r=n-e.y;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x+2,y1:e.y-2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 3:if(void 0!==t.q4maxY){let n=Math.min(e.y,t.q4maxY-e.height),r=e.y-n;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x+2,y1:e.y+2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}}}(t,c,r)),t}function qse(e){let{context:t,direction:n,measured:r,node:i,placementSettings:o,rect:a,store:s}=e,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Tse;for(let e=0;e<o.length;e++){let c=o[e],u=l({context:t,slice:i.desc.slice,view:a,direction:n,position:c.position,measured:r,padding:c.padding,store:s});if(u)return{bounds:u,placement:c}}return{bounds:null,placement:null}}function Nse(e,t,n){const r=t.fontFamily,i="".concat(t.fontSize,"px"),o=n.measureText({text:e,fontFamily:r,fontSize:i});return o.minReqWidth=Math.min(o.width,n.measureText({text:"".concat(e[0],"…"),fontFamily:r,fontSize:i}).width),o}const jse=/\n+|\r+|\r\n/,zse=/\s/,Fse=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function Wse(e){return"string"==typeof e?-1!==e.search(jse):-1!==String(e).search(jse)}function $se(e){return-1!==e.search(zse)}function Bse(e){return-1!==e.search(Fse)}function Vse(e,t,n){return Math.max(t,Math.min(n,e))}function Hse(){let{string:e,separator:t="",reverse:n=!1,measureText:r=e=>({width:e.length,height:1}),mandatoryBreakIdentifiers:i=[Wse],noBreakAllowedIdentifiers:o=[],suppressIdentifier:a=[$se,Wse,e=>""===e],hyphenationIdentifiers:s=[Bse]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const l=String(e).split(t);!function(e){""===e[0]&&e.shift(),""===e[e.length-1]&&e.pop()}(l);const c=l.length,u=n?e=>e>=0:e=>e<c;let d=n?c:-1;function f(e){const t=Vse(e,0,c-1),n=l[t],u=r(n),d=function(e,t,n,r,i){return r.some((r=>r(e,t,n)))?1:i.some((r=>r(e,t,n)))?0:2}(n,t,l,i,o);return{index:t,value:n,breakOpportunity:d,suppress:a.some((e=>e(n,t,l))),hyphenation:s.some((e=>e(n,t,l))),width:u.width,height:u.height,done:!1}}return{next:function(e){return isNaN(e)?n?d--:d++:d=Vse(e,0,c-1),u(d)?f(d):{done:!0}},peek:f,length:c}}const Use="…",Gse=/^\s*\d+(\.\d+)?px\s*$/i;function Yse(e){return"string"===typeof e&&Gse.test(e)}function Kse(e){const t=e["font-size"]||e.fontSize;return Yse(t)?parseFloat(t)*Math.max(isNaN(e.lineHeight)?1.2:e.lineHeight,0):19.2}function Xse(e){const t=e.maxHeight,n=Math.max(e.maxLines,1)||1/0;if(isNaN(t))return n;const r=Kse(e);return Math.max(1,Math.min(Math.floor(t/r),n))}function Jse(e,t){return{lines:[],line:"",width:0,maxLines:Xse(e),maxWidth:e.maxWidth,hyphens:{enabled:"auto"===e.hyphens,char:"‐",metrics:t("‐")}}}function Qse(e){e.lines.push(e.line),e.line="",e.width=0}function Zse(e,t){e.line+=t.value,e.width+=t.width}function ele(e,t,n){if(t.width>e.maxWidth)return t;const r=t.index;for(let i=1;i<5;i++){const o=n.peek(t.index-1);if(!t.hyphenation||!o.hyphenation||0===t.index)return t;if(e.width+e.hyphens.metrics.width<=e.maxWidth)return e.line+=e.hyphens.char,t;if(1===e.line.length)return t;t=n.next(r-i),e.line=e.line.slice(0,-1),e.width-=t.width}return t}function tle(e,t,n){const r=Hse({string:t.value,measureText:n});for(;e.lines.length<e.maxLines;){let t=r.next();if(t.done)break;e.width+t.width>e.maxWidth&&2===t.breakOpportunity&&e.line.length>0?(t=e.hyphens.enabled?ele(e,t,r):t,Qse(e),Zse(e,t)):Zse(e,t)}}function nle(e,t){const n=Hse({string:e.text,separator:"",measureText:t,noBreakAllowedIdentifiers:[(e,t)=>0===t]}),r=Jse(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){Qse(r),i=!1;break}1===e.breakOpportunity?Qse(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?r.width+=e.width:(e=r.hyphens.enabled?ele(r,e,n):e,Qse(r),Zse(r,e)):Zse(r,e)}return{lines:r.lines,reduced:i}}function rle(e,t){const n=Hse({string:e.text,separator:/(\s|-|\u2010)/,measureText:t}),r=Jse(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){Qse(r),i=!1;break}1===e.breakOpportunity?Qse(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?Qse(r):e.width>r.maxWidth?tle(r,e,t):(Qse(r),Zse(r,e)):Zse(r,e)}return{lines:r.lines,reduced:i}}function ile(e){return{"break-all":nle,"break-word":rle}[e.wordBreak]}function ole(e){return t=>{const n=t.node;if(function(e){return"text"===e.type&&!e._lineBreak}(n)){const r=ile(n);if(!r)return;const i=e(n);if(i.width>n.maxWidth||Wse(n.text)){const o=(Kse(n)-i.height)/2,a=r(n,function(e,t){return n=>t({text:n,fontSize:e.fontSize,fontFamily:e.fontFamily})}(n,e));t.node=function(e,t,n,r){const i={type:"container",children:[]};void 0!==t.id&&(i.id=t.id);let o=0;return e.lines.forEach(((a,s)=>{const l=o8({},t);l.text=a,l._lineBreak=!0,o+=n,e.reduced&&s===e.lines.length-1?l.text+=Use:delete l.maxWidth,l.dy=isNaN(l.dy)?o:l.dy+o,o+=r,o+=n,i.children.push(l)})),i}(a,n,o,i.height)}}}}function ale(e,t){const n=e["font-family"]||e.fontFamily,r=e["font-size"]||e.fontSize,i="string"==typeof e.text?e.text:"".concat(e.text),{maxWidth:o}=e;if(void 0===o)return i;let a=t({text:i,fontSize:r,fontFamily:n}).width;if(a<=o)return i;let s=0,l=i.length-1;for(;s<=l;){let e=Math.floor((s+l)/2);a=t({text:i.substr(0,e)+Use,fontSize:r,fontFamily:n}).width,a<=o?s=e+1:l=e-1}return i.substr(0,l)+Use}function sle(e){const t=e.baseline||e["dominant-baseline"];let n=0;const r=parseInt(e.fontSize||e["font-size"],10)||0;switch(t){case"hanging":n=.75*r;break;case"text-before-edge":n=.85*r;break;case"middle":n=.25*r;break;case"central":n=.35*r;break;case"mathemetical":n=r/2;break;case"text-after-edge":case"ideographic":n=.2*-r;break;default:n=0}return n}const lle={},cle={},ule={fontSize:void 0,fontFamily:void 0};let dle;function fle(e,t){return!e&&!t||e===t}function hle(e){let{text:t,fontWeight:n,fontSize:r,fontFamily:i}=e;const o="".concat(t," ").concat(n," ").concat(r," ").concat(i);return"number"!=typeof cle[o]&&(dle=dle||document.createElement("canvas").getContext("2d"),function(e){let{fontWeight:t,fontSize:n,fontFamily:r}=e;fle(ule.fontWeight,t)&&fle(ule.fontSize,n)&&fle(ule.fontFamily,r)||(dle.font=[t,n,r].filter((e=>!!e)).join(" "),ule.fontWeight=t,ule.fontSize=n,ule.fontFamily=r)}({fontWeight:n,fontSize:r,fontFamily:i}),cle[o]=dle.measureText(t).width),cle[o]}function ple(e){return"number"!=typeof lle[e]&&(lle[e]=function(e){if(Yse(e)){const t=parseFloat(e);return t+4*Math.ceil((t+1e-12)/24)}return 16}(e)),lle[e]}function mle(e){let{text:t,fontWeight:n,fontSize:r,fontFamily:i}=e;return{width:hle({text:t,fontWeight:n,fontSize:r,fontFamily:i}),height:ple(r)}}function gle(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:mle;const n=e["font-size"]||e.fontSize,r=e["font-family"]||e.fontFamily,i=t({text:e.text,fontFamily:r,fontSize:n}),o=Math.min(e.maxWidth||i.width,i.width),a=e.x||0,s=e.y||0,l=e.dx||0,c={x:0,y:s+((e.dy||0)+sle(e))-.75*i.height,width:o,height:i.height},u=e["text-anchor"]||e.anchor;return c.x="middle"===u?a+l-o/2:"end"===u?a+l-o:a+l,c}function yle(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:mle;const n=ile(e),r=e["font-size"]||e.fontSize,i=e["font-family"]||e.fontFamily,o=t({text:e.text,fontFamily:i,fontSize:r});if(n&&(o.width>e.maxWidth||Wse(e.text))){const o=n(e,(e=>t({text:e,fontFamily:i,fontSize:r}))),a=o8({},e);let s=0,l="";for(let e=0,n=o.lines.length;e<n;e++){let a=o.lines[e];a+=e===n-1&&o.reduced?Use:"";const c=t({text:a,fontSize:r,fontFamily:i}).width;c>=s&&(s=c,l=a)}a.text=l;const c=gle(a,t);return c.height=Kse(e)*o.lines.length,c}return gle(e,t)}function vle(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function ble(e,t,n){const r={type:"text",text:t,maxWidth:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:"start",baseline:"alphabetical",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},i=n.textMetrics;if(e.width<n.fontSize)return!1;const o=Math.max(0,e.width-i.width);return r.x=e.x+n.align*o,r.y=e.y+i.height/1.2,r}function xle(e){let{cx:t,cy:n,r:r}=e;return{type:"circle",bounds:{cx:t,cy:n,r:r}}}function wle(e){return e.desc&&e.desc.slice?function(e){let{start:t,end:n,innerRadius:r,outerRadius:i,offset:o}=e;if(Math.abs(t+2*Math.PI-n)>1e-12)return{type:null,bounds:null};let a=0!==r?r:i;return xle({cx:o.x,cy:o.y,r:a})}(e.desc.slice):"circle"===e.type?xle(e.attrs):"rect"===e.type?{type:"rect",bounds:e.bounds}:{type:null,bounds:null}}var Sle={bar:function(e){let{settings:t,chart:n,nodes:r,rect:i,renderer:o,style:a}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ese;const l=o8({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},a.label);l.fontSize=parseInt(l.fontSize,10);const c=t.labels.map((e=>o8({},l,t,e))),u=t.labels.map((e=>e.placements.map((n=>o8({},l,t,e,n))))),{fitsHorizontally:d,hasHorizontalDirection:f,targetNodes:h}=function(e){let{nodes:t,rect:n,chart:r,labelSettings:i,placementSettings:o,settings:a,renderer:s}=e;const l={},c=[];let u,d,f,h,p,m,g,y=!0,v=!1;for(let e=0;e<t.length;e++){if(d=t[e],h=d.localBounds,!Cie(h,n))continue;let b=pse(d,r);u={node:d,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(let t=0;t<i.length;t++)m=i[t],f="function"==typeof m.label?m.label(b,e):void 0,mse(f)&&(g="function"==typeof a.direction?a.direction(b,e):a.direction||"up",v=v||"left"===g||"right"===g,l.fontFamily=m.fontFamily,l.fontSize="".concat(m.fontSize,"px"),l.text=f,p=s.measureText(l),u.measurements.push(p),u.texts.push(f),u.labelSettings.push(m),u.placementSettings.push(o[t]),u.direction=g,y=y&&p.width<=h.width-2*hse);c.push(u)}return{targetNodes:c,fitsHorizontally:y,hasHorizontalDirection:v}}({nodes:r,chart:n,renderer:o,settings:t,rect:i,labelSettings:c,placementSettings:u}),p=function(e){let{orientation:t="auto",defaultOrientation:n="h"}=e;switch(t.toLocaleLowerCase()){case"vertical":return"v";case"horizontal":return"h";default:return n}}({orientation:t.orientation,defaultOrientation:f?"h":"v"}),m="h"===p?"y":"x",g="h"===p?"height":"width";return h.sort(((e,t)=>e.node.localBounds[m]+e.node.localBounds[g]-(t.node.localBounds[m]+t.node.localBounds[g]))),s({chart:n,targetNodes:h,stngs:t,rect:i,fitsHorizontally:d,collectiveOrientation:p})},slice:function(e){let{settings:t,chart:n,nodes:r,rect:i,renderer:o,style:a}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qse,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Lse;const c=o8({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},a.label);c.fontSize=parseInt(c.fontSize,10);const u=t.labels.map((e=>o8({},c,t,e))),d=t.labels.map((e=>e.placements.map((n=>o8({},c,t,e,n))))),f=[],h={insideLabelBounds:[]};r=function(e){const t=[],n=[],r=[],i=[];for(let o=0;o<e.length;++o){const{start:a,end:s}=e[o].desc.slice,l=Mse((a+s)/2);switch(Math.floor(l/(Math.PI/2))){case 0:t.push(e[o]);break;case 1:n.push(e[o]);break;case 2:r.push(e[o]);break;case 3:i.push(e[o])}}const o=(e,t)=>Mse((e.desc.slice.start+e.desc.slice.end)/2)-Mse((t.desc.slice.start+t.desc.slice.end)/2),a=(e,t)=>o(t,e);return t.sort(a),n.sort(o),r.sort(a),i.sort(o),t.concat(n,i,r)}(r);const p={};for(let e=0,t=r.length;e<t;e++){const t=r[e],a=Ose(t,n);for(let n=0;n<u.length;n++){const r=u[n],c="function"==typeof r.label?r.label(a,e):"";if(!c)continue;const m="function"==typeof r.direction?r.direction(a,e):r.direction||"horizontal",g="function"==typeof r.linkData?r.linkData(a,e):void 0,y=Nse(c,r,o),v=s({context:p,direction:m,lblStngs:r,measured:y,node:t,placementSettings:d[n],rect:i,store:h}),b=v.bounds,x=v.placement;if(b&&x){if("outside"===x.position&&"rotate"!==m){Ase({context:p,node:t,bounds:b});if(!cie(Rse(b),i))continue}const n="function"==typeof x.fill?x.fill(a,e):x.fill,o=l(b,c,{fill:n,fontSize:r.fontSize,fontFamily:r.fontFamily,textMetrics:y});o&&(void 0!==g&&(o.data=g),f.push(o),b.line&&(b.line.stroke=n,f.push(b.line)))}}}return f},rows:function(e){let{settings:t,chart:n,nodes:r,renderer:i,style:o}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ble;const s=o8({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);s.fontSize=parseInt(s.fontSize,10);const l=o8({},s,t),c=t.labels.map((e=>o8({},l,e))),u={},d=[];for(let e=0,t=r.length;e<t;e++){let t=r[e],o=vle(t,n),{type:s,bounds:f}=wle(t);if(!f)continue;let h,p=0,m=[],g=[],y="circle"===s?2*f.r*.9:f.height;for(p+=l.padding,h=0;h<c.length;h++){let t=c[h],n="function"==typeof t.label?t.label(o,e):"";u.fontFamily=t.fontFamily,u.fontSize="".concat(t.fontSize,"px"),u.text=n;let r=i.measureText(u);if(p+=r.height+t.padding,p>y)break;g.push(n),m.push(r)}const v=h,b=Math.max(0,y-p);let x;for(x="circle"===s?f.cy-.9*f.r:f.y,x+=l.justify*b+l.padding,h=0;h<v;h++){let t,n=c[h];if("circle"===s){let e=Math.max(Math.abs(x-f.cy),Math.abs(x+m[h].height-f.cy)),n=Math.sqrt(f.r*f.r-e*e);t={x:f.cx-n+l.padding,y:x,width:2*n-2*l.padding,height:m[h].height}}else t={x:f.x+l.padding,y:x,width:f.width-2*l.padding,height:m[h].height};x+=m[h].height+l.padding;let r="function"==typeof n.fill?n.fill(o,e):n.fill;const u="function"==typeof n.linkData?n.linkData(o,e):void 0;let p=a(t,g[h],{fill:r,align:n.align,fontSize:n.fontSize,fontFamily:n.fontFamily,textMetrics:m[h]});if(p){if(p.text&&p.text!==Use){const e=ale(p,i.measureText);if(Use===e)continue;p.ellipsed=e}void 0!==u&&(p.data=u),d.push(p)}}}return d}};const Cle={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render(){const e=this.settings.settings,t=[];return(e.sources||[]).forEach((e=>{e.strategy&&Sle[e.strategy.type]&&e.component&&t.push(...function(e,t){let{chart:n,source:r,rect:i,renderer:o,style:a}=e;if(!n.component(r.component))return[];const s=n.findShapes(r.selector).filter((e=>e.key===r.component));return t({chart:n,settings:r.strategy.settings,nodes:s,rect:{x:0,y:0,width:i.width,height:i.height},renderer:o,style:a})}({chart:this.chart,rect:this.rect,renderer:this.renderer,source:e,style:this.style},Sle[e.strategy.type]))})),t}};const kle={layout:{size:1,direction:"ltr",scrollOffset:0},item:{show:!0,label:{fontSize:"12px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:136,lineHeight:1.2},shape:{type:"square",size:12}},title:{show:!0,text:void 0,anchor:"start",fontSize:"16px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:156,lineHeight:1.25}};function Ele(e){let{x:t=0,y:n,item:r,globalMetrics:i,createSymbol:o,direction:a="ltr"}=e,s=r.label.displayObject,l=r.label.bounds,c=r.symbol.meta;const u="rtl"===a;let d={x:u?t+i.maxLabelBounds.width:t+i.maxSymbolSize+i.spacing,y:n,width:i.maxLabelBounds.width,height:Math.max(i.maxSymbolSize,i.maxLabelBounds.height)},f=function(e,t,n){const r=Math.max(0,e.width-t),i=Math.max(0,e.height-t);return{x:e.x+t/2+n.align*r,y:e.y+t/2+n.justify*i}}({x:u?t+i.maxLabelBounds.width+i.spacing:t,y:n,width:i.maxSymbolSize,height:d.height},c.size,{align:void 0===c.align?.5:c.align,justify:void 0===c.justify?.5:c.justify});const h=o(o8({},c,f));return delete h.collider,s.anchor=u?"end":"start",function(e,t,n){const r=n.textMetrics;if(e.height<r.height)return!1;const i=Math.max(0,e.width-r.width);t.baseline="text-before-edge";const o=Math.max(0,e.height-r.height);t.x=e.x+n.align*i,t.y=e.y+n.justify*o+.175*parseInt(t.fontSize,10)}(d,s,{textMetrics:l,fontSize:parseInt(s.fontSize,10),align:0,justify:.5}),{item:{type:"container",data:r.label.displayObject.data,children:[h,s],collider:{type:"rect",x:t,y:n,width:i.maxItemBounds.width,height:i.maxItemBounds.height}},metrics:d}}function Mle(e,t){const n=e.items.length,r=Math.ceil(n/t),i="horizontal"===e.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[i]*r+(r-1)*e.layout.margin[o]}function _le(e,t){let n,r,i,o,{onScroll:a=()=>{}}=t,s=null,l=0;const c={itemize:t=>{n=function(e,t){let n,r,{resolved:i,dock:o}=e,a=[],s=i.items.items,l=i.symbols.items,c=i.labels.items,u=0,d=0,f=0;for(let e=0;e<s.length;e++){if(!1===s[e].show)continue;const i=void 0!==c[e].text?c[e].text:c[e].data.label||"";n=o8({},c[e],{type:"text",fontSize:"".concat(parseInt(c[e].fontSize,10),"px"),text:i,title:i}),r={symbol:{meta:l[e]},label:{displayObject:n,bounds:t.textBounds(n)}},a.push(r),u=Math.max(l[e].size,u),d=Math.max(r.label.bounds.width,d),f=Math.max(r.label.bounds.height,f)}return{items:a,globalMetrics:{spacing:8,maxSymbolSize:u,maxItemBounds:{height:Math.max(u,f),width:u+8+d},maxLabelBounds:{width:d,height:f}},layout:{margin:{vertical:void 0!==i.layout.item.vertical?i.layout.item.vertical:4,horizontal:void 0!==i.layout.item.horizontal?i.layout.item.horizontal:4},mode:i.layout.item.mode,size:i.layout.item.size,orientation:"top"===o||"bottom"===o?"horizontal":"vertical",direction:i.layout.item.direction,scrollOffset:i.layout.item.scrollOffset}}}(t,e.renderer),s=isNaN(n.layout.scrollOffset)?s:n.layout.scrollOffset},getItemsToRender:t=>{i=t.viewRect,l=c.getContentOverflow(i);const a=c.extent();s=Math.max(0,Math.min(s,l)),o=o8({},i);const u="horizontal"===c.orientation()?"x":"y";return o[u]-=s,o["x"===u?"width":"height"]=a,function(e,t,n){let{viewRect:r}=e,{itemized:i,create:o=Ele,parallels:a,createSymbol:s}=n;const l=i.layout.direction,c=i.globalMetrics,u=i.items,d="horizontal"===i.layout.orientation;let f=0;const h=[],p=c.maxItemBounds.height,m=c.maxItemBounds.width,g=i.layout.margin.vertical+p,y=i.layout.margin.horizontal+m;let v=t.x,b=t.y,x=r.x-t.x;for(let e=0;e<u.length;e++){let n=o({y:b,x:"rtl"===l?r.x+x+r.width-m-(v-t.x):v,item:u[e],globalMetrics:c,direction:l,createSymbol:s});if((d&&v>=r.x-m||!d&&b>=r.y-p)&&h.push(n.item),f++,f>=a?(f=0,d?(v+=y,b=t.y):(b+=g,v=t.x)):d?b+=g:v+=y,!d&&b>r.y+r.height)break;if(d&&v>r.x+r.width)break}return h}(t,o,{itemized:n,parallels:r,createSymbol:e.symbol})},parallelize:(e,t)=>(r=function(e,t,n){const r=n.items.length,i="horizontal"===n.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical",a=n.globalMetrics.maxItemBounds[i]*r+(r-1)*n.layout.margin[o];let s=Math.ceil(a/e);if(null!=t){const e="horizontal"===n.layout.orientation?"height":"width",r="width"===e?"horizontal":"vertical",i=n.layout.margin[r]||4,o=Math.floor((t+i)/(i+n.globalMetrics.maxItemBounds[e]));s=Math.min(s,o)}const l=isNaN(n.layout.size)?1:n.layout.size;return Math.max(1,Math.min(s,l))}(e,t,n),r),hasContentOverflow:()=>{const e="horizontal"===n.layout.orientation?"width":"height";return Mle(n,r)>i[e]},getContentOverflow:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;const t="horizontal"===n.layout.orientation?"width":"height";return Math.max(0,Mle(n,r)-e[t])},getNextSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},getPrevSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},hasNext:()=>"horizontal"===c.orientation()?i.x+i.width<o.x+o.width:i.y+i.height<o.y+o.height,hasPrev:()=>"horizontal"===c.orientation()?o.x<i.x:o.y<i.y,next:()=>{c.scroll(-c.getNextSize())},prev:()=>{c.scroll(c.getPrevSize())},scroll:e=>{const t=Math.max(0,Math.min(l,s-e));t!==s&&(s=t,a())},offset:()=>s,orientation:()=>n.layout.orientation,direction:()=>n.layout.direction,extent:()=>Mle(n,r),spread:()=>function(e,t){const n=t,r="horizontal"===e.layout.orientation?"height":"width",i="width"===r?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[r]*n+(n-1)*e.layout.margin[i]}(n,r)};return c}function Rle(e){return Object.keys(e).filter((t=>e[t])).join(" ")}const Ile={up:"▲",right:"▶",down:"▼",left:"◀"};function Dle(e,t){let{size:n,isActive:r,direction:i,nav:o,attrs:a}=t,s={},l="";const c=a;o&&o.button&&("function"==typeof o.button.class?s=o.button.class({direction:i}):o.button.class&&(s=o.button.class),"function"==typeof o.button.content&&(l=o.button.content(e,{direction:i})),void 0!==o.button.tabIndex&&(c.tabindex=o.button.tabIndex));const u={width:"".concat(n,"px"),minWidth:"".concat(n,"px"),height:"".concat(n,"px")};return Object.keys(s).length||(u.border="0",u.background="none"),(!r||o&&o.disabled)&&(c.disabled="disabled"),e("button",o8({class:Rle(s),style:u},c),[l||e("span",{style:{pointerEvents:"none"}},[Ile[i]])])}function Ple(e){let t;const n={itemize:e=>{t=function(e){let{dock:t,navigation:n}=e;return{layout:{orientation:"top"===t||"bottom"===t?"vertical":"horizontal"},navigation:n}}(e)},render:r=>function(e,t,n,r){let{rect:i,itemRenderer:o}=t;if(!e||!e.renderArgs)return;e.size(i);const a=e.renderArgs[0],s="vertical"===n.layout.orientation,l="rtl"===o.direction(),c=o.hasNext(),u=o.hasPrev();if(!u&&!c)return void e.render([]);const d=s?["right","left"]:["down","up"];l&&s&&d.reverse();const f=[a("div",{style:{position:"relative",display:"flex","flex-direction":s?"column":"row","justify-content":"center",height:"100%",pointerEvents:"auto"},dir:l&&!s?"rtl":"ltr"},[Dle(a,{size:32,isActive:c,direction:d[0],attrs:{"data-action":"next","data-component-key":r.settings.key},nav:n.navigation}),Dle(a,{size:32,isActive:u,direction:d[1],attrs:{"data-action":"prev","data-component-key":r.settings.key},nav:n.navigation})])];e.render(f)}(n.renderer,r,t,e),extent:()=>32,spread:()=>64};return n}function Ale(e){let t;const n={itemize:n=>{t=function(e,t){let{resolved:n}=e;if(!1===n.title.item.show)return null;const r=o8({},n.title.item,{type:"text"});if("rtl"===n.layout.item.direction&&(r.anchor&&"start"!==r.anchor?"end"===r.anchor&&(r.anchor="start"):r.anchor="end"),void 0===n.title.settings.text){const e=t.scale.data().fields;r.text=e&&e[0]?e[0].title():""}return{displayObject:r,bounds:t.renderer.textBounds(r)}}(n,e)},render:e=>{!function(e,t,n){let{rect:r}=e;if(!t)return;const i=[];if(t.size(r),n){const e={start:0,end:r.width,middle:r.width/2};i.push(o8({},n.displayObject,{x:e[n.displayObject.anchor]||0,y:0,baseline:"text-before-edge",title:n.displayObject.text}))}t.render(i)}(e,n.renderer,t)},spread:()=>t?t.bounds.height:0,extent:()=>t?t.bounds.width:0};return n}function Ole(e,t,n,r){let i,o,a,{itemRenderer:s,navigationRenderer:l,titleRenderer:c,isPreliminary:u=!1}=r,d=0;const f={x:t.spacing,y:t.spacing,width:e.width-2*t.spacing,height:e.height-2*t.spacing};if(i={x:f.x,y:f.y,width:f.width,height:c.spread()},"horizontal"===n){i={x:f.x,y:f.y,width:c.extent(),height:c.spread()};const e=f.width-i.width-(i.width?t.spacing:0),n=f.height;s.parallelize(e,u?void 0:n);const r=s.extent()>e?l.extent():0,h=s.spread(),p=r?l.spread():0;o={x:i.x+i.width+(i.width?t.spacing:0),y:f.y+Math.max(0,(p-h)/2),width:f.width-r-i.width-(r?t.spacing:0)-(i.width?t.spacing:0),height:n},a={x:o.x+o.width+(r?t.spacing:0),y:f.y,width:r,height:f.height},i.y=o.y;"rtl"===s.direction()&&(a.x=f.x,o.x=a.x+a.width+(a.width?t.spacing:0),i.x=o.x+o.width+(i.width?t.spacing:0)),d=Math.max(i.height,p,s.spread())}else{const e=f.height-i.height-(i.height?t.spacing:0),n=f.width;s.parallelize(e,u?void 0:n);const r=s.extent()>e?l.extent():0;a={x:f.x,y:f.y+f.height-r,width:f.width,height:r},o={x:f.x,y:i.y+i.height+(i.height?t.spacing:0),width:f.width,height:f.height-i.height-(i.height?t.spacing:0)-a.height-(a.height?t.spacing:0)},d=Math.max(c.extent(),r?l.spread():0,s.spread())}return o=o8({},e,{x:e.x+o.x,y:e.y+o.y,width:o.width,height:o.height}),a.x+=e.x,a.y+=e.y,i.x+=e.x,i.y+=e.y,{title:o8({},e,i),content:o8({},e,o),navigation:o8({},e,a),orientation:n,preferredSize:d}}function Lle(e){e.state.resolved=function(e){const t=e.scale.domain();let n={items:[]};const r=e.settings.layout.dock;if("threshold-color"===e.scale.type){const i=e.scale.data().fields[0];let o=e=>String(e);e.settings.formatter?o=e.chart.formatter(e.settings.formatter):i&&(o=i.formatter());for(let e=0;e<t.length-1;e++){const r={value:t[e],label:"".concat(o(t[e])," - < ").concat(o(t[e+1]))};i&&(r.source={field:i.id()}),n.items.push(r)}"vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")&&n.items.reverse()}else{const r=e.scale.labels?e.scale.labels():null;n.items=t.map(((t,n)=>{const i=e.scale.datum?o8({},e.scale.datum(t)):{value:t};return i.value=t,e.scale.label?i.label=e.scale.label(t):r&&(i.label=r[n]),i}))}const i=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:o8(!0,{},kle.title,e.style.title),settings:e.settings.settings.title}),o=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:kle.layout,settings:e.settings.settings.layout}),a=e.resolver.resolve({data:n,defaults:o8(!0,{},kle.item.label,e.style.item.label),settings:(e.settings.settings.item||{}).label}),s=o8(!0,{},(e.settings.settings.item||{}).shape);void 0===s.fill&&e.settings.scale&&(s.fill={scale:e.settings.scale});const l=e.resolver.resolve({data:n,defaults:o8(!0,{},kle.item.shape,e.style.item.shape),settings:s}),c=e.resolver.resolve({data:n,defaults:o8(!0,{},{show:kle.item.show}),settings:{show:(e.settings.settings.item||{}).show}});function u(e,n){let r=e.data.value,i=t[n+1];e.data.value=[r,i]}"threshold-color"===e.scale.type&&("vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")?(c.items.reverse().forEach(u),c.items.reverse()):c.items.forEach(u));return{title:i,labels:a,symbols:l,items:c,layout:o}}(e),e.titleRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.itemRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.navigationRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center",navigation:e.settings.settings.navigation}),e.state.display={spacing:8}}function Tle(e){const{rect:t,settings:n,state:r,itemRenderer:i,navigationRenderer:o,titleRenderer:a}=e,s=n.layout.dock,l="top"===s||"bottom"===s?"horizontal":"vertical",c=Ole(t,r.display,l,{itemRenderer:i,navigationRenderer:o,titleRenderer:a});e.renderer.size(c.content);let u=i.getItemsToRender({viewRect:o8({},c.content,{x:0,y:0})});return o.render({rect:c.navigation,itemRenderer:i}),a.render({rect:c.title}),e.state.views={layout:c},u}const qle={require:["chart","settings","renderer","update","resolver","registries","symbol"],defaultSettings:{settings:{},style:{item:{label:"$label",shape:"$shape"},title:"$title"}},mounted(e){e&&e.parentNode&&(this.navigationRenderer.renderer.appendTo(e.parentNode),this.titleRenderer.renderer.appendTo(e.parentNode),e.parentNode.insertBefore(this.navigationRenderer.renderer.element(),e),e.parentNode.insertBefore(this.titleRenderer.renderer.element(),e)),this.navigationRenderer.render({rect:this.state.views.layout.navigation,itemRenderer:this.itemRenderer}),this.titleRenderer.render({rect:this.state.views.layout.title})},beforeUnmount(){this.navigationRenderer.renderer.clear(),this.titleRenderer.renderer.clear()},on:{panstart(){if(this.state.interaction.started)return;this.itemRenderer.getContentOverflow()&&(this.state.interaction.started=!0,this.state.interaction.delta=0)},panmove(e){if(!this.state.interaction.started)return;const t="horizontal"===this.itemRenderer.orientation()?("rtl"===this.itemRenderer.direction()?-1:1)*e.deltaX:e.deltaY;this.itemRenderer.scroll(t-this.state.interaction.delta),this.state.interaction.delta=t},panend(){this.state.interaction.started=!1},scroll(e){this.itemRenderer.scroll(-e)},next(){this.itemRenderer.next()},prev(){this.itemRenderer.prev()}},created(){this.state={interaction:{}},this.onScroll=()=>{const e=Tle(this);this.update(e)},this.itemRenderer=_le(this,{onScroll:this.onScroll}),this.navigationRenderer=Ple(this),this.titleRenderer=Ale(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),Lle(this)},preferredSize(e){return function(e,t){let n=0;const r=e.settings.layout.dock||"center",i="top"===r||"bottom"===r?"horizontal":"vertical",o=e.state.display,a=Ole(t.inner,o,i,{itemRenderer:e.itemRenderer,navigationRenderer:e.navigationRenderer,titleRenderer:e.titleRenderer,isPreliminary:!0});return n+=o.spacing,n+=a.preferredSize,n+=o.spacing,n}(this,e)},beforeUpdate(){Lle(this)},render(){return Tle(this)},beforeDestroy(){this.navigationRenderer.renderer.destroy(),this.titleRenderer.renderer.destroy()},additionalElements(){return[this.titleRenderer.renderer.element(),this.navigationRenderer.renderer.element()]},_DO_NOT_USE_getInfo(){return{offset:this.itemRenderer.offset()}}};function Nle(e,t){let n=0;const r=e.state.isVertical?"justify":"align",i=e.state.isVertical?"y":"x",o=e.state.isVertical?"height":"width",a=e.state.isVertical?"requiredHeight":"requiredWidth";n=e.state.rect[o]-e.state.legend.length()-e.state.title[a](),n*=Math.min(1,Math.max(e.stgns[r],0)),t[i]+=n}function jle(e,t,n){const r=n[e];return"object"==typeof r?-1!==r.valid.indexOf(t)?t:r.default:n.default}function zle(e){return jle(e.layout.dock,e.settings.title.anchor,{left:{valid:["top"],default:"top"},right:{valid:["top"],default:"top"},top:{valid:["left","right"],default:"left"},bottom:{valid:["left","right"],default:"left"},default:"top"})}function Fle(e,t){const n={x:0,y:0,width:0,height:0},r=e.stgns.padding;return n.x=r.left,n.y=r.top,n.width=t.width-r.left-r.right,n.height=t.height-r.top-r.bottom,n}function Wle(e){const t="top"!==e.settings.layout.dock&&"bottom"!==e.settings.layout.dock,n=e.stgns.title,r=e.chart.scale(e.stgns.fill),i=e.chart.scale(e.stgns.major),o=function(e,t){const n=t.domain();let r=n,i=e.stgns.tick.label;!i&&e.formatter?i=e.formatter:!i&&t.data().fields&&(i=t.data().fields[0].formatter()),"function"==typeof i&&(r=n.map(i).map(String));const o=n.map(((n,i)=>{const o=r[i];return{value:n,label:o,pos:t.norm(parseFloat(n,10)),textMetrics:e.renderer.measureText({text:o,fontSize:e.stgns.tick.fontSize,fontFamily:e.stgns.tick.fontFamily})}}));return o}(e,i),a=function(e){return jle(e.layout.dock,e.settings.tick.anchor,{left:{valid:["left","right"],default:"left"},right:{valid:["left","right"],default:"right"},top:{valid:["top","bottom"],default:"top"},bottom:{valid:["top","bottom"],default:"bottom"},default:"right"})}(e.settings);if(void 0===n.text){const e=i.data().fields;n.text=e&&e[0]?e[0].title():""}const s=e.renderer.measureText({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily}),l=e.renderer.textBounds({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily,maxLines:n.maxLines,maxWidth:n.maxLengthPx,wordBreak:n.wordBreak,hyphens:n.hyphens,lineHeight:n.lineHeight}),c={isVertical:t,nodes:[],title:{anchor:zle(e.settings),textMetrics:s,textBounds:l,requiredWidth:()=>{if(!n.show)return 0;let e=l.width,r=n.maxLengthPx;return t||(e+=n.padding,r+=n.padding),Math.min(e,r,c.rect.width)},requiredHeight:()=>{if(!n.show)return 0;let e=l.height;return t&&(e+=n.padding),Math.min(e,c.rect.height)}},ticks:{values:o,anchor:a,length:Math.min(Math.max(...o.map((e=>e.textMetrics.width))),e.stgns.tick.maxLengthPx),requiredHeight:()=>"top"===a?Math.max(...c.ticks.values.map((e=>e.textMetrics.height)))+e.stgns.tick.padding:0,height:Math.max(...o.map((e=>e.textMetrics.height)))},legend:{fillScale:r,majorScale:i,length:()=>{const n=t?"height":"width",r=t?"requiredHeight":"requiredWidth",i=Math.min(c.rect[n],c.rect[n]*e.stgns.length)-c.title[r]();return Math.max(0,Math.min(i,e.stgns.maxLengthPx))}}};return c}const $le={require:["chart","settings","renderer"],defaultSettings:{layout:{displayOrder:0,dock:"right"},settings:{size:15,length:.5,maxLengthPx:250,align:.5,justify:0,padding:{left:5,right:5,top:5,bottom:5},tick:{label:null,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,anchor:null,padding:5},title:{show:!0,text:void 0,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,padding:5,maxLines:2,wordBreak:"none",lineHeight:1.2,hyphens:"auto",anchor:null}}},preferredSize(e){const t=this.state;t.rect=Fle(this,e.inner);let n=this.stgns.size;const r=t.isVertical?this.stgns.padding.left+this.stgns.padding.right:this.stgns.padding.top+this.stgns.padding.bottom;n+=r;const i=Math.max(e.inner.width,e.inner.height);if("left"===t.ticks.anchor||"right"===t.ticks.anchor){const e=t.ticks.values.reduce(((e,t)=>e+t.textMetrics.height),0);if(e>this.state.legend.length())return i;n+=t.ticks.length}else{if(t.ticks.length>this.state.legend.length())return i;n+=Math.max(...t.ticks.values.map((e=>e.textMetrics.height)))}return n+=this.stgns.tick.padding,this.stgns.title.show&&(n="left"===t.title.anchor||"right"===t.title.anchor?Math.max(t.title.textBounds.height+r,n):Math.max(n,t.title.requiredWidth()+r)),this.state.preferredSize=n,n},created(){this.stgns=this.settings.settings,this.state=Wle(this)},beforeUpdate(e){this.stgns=e.settings.settings,this.state=Wle(this)},beforeRender(e){if(this.state.nodes=[],this.state.rect=Fle(this,e.size),this.stgns.title.show){const e=function(e){const t=e.state,n=e.stgns,r="left"===t.ticks.anchor,i="top"===t.ticks.anchor;let o=t.rect.x,a=t.rect.y,s="start";"left"===t.title.anchor?(o+=t.title.requiredWidth()-n.title.padding,a+=t.title.textMetrics.height,a+=i?t.rect.height-t.title.textBounds.height:0,s="end"):"right"===t.title.anchor?(o+=t.legend.length(),o+=n.title.padding,a+=t.title.textMetrics.height,a+=i?t.rect.height-t.title.textBounds.height:0):"top"===t.title.anchor&&(o+=r?t.rect.width:0,a+=t.title.textMetrics.height,s=r?"end":"start");const l={tag:"legend-title",type:"text",x:o,y:Math.min(a,t.rect.y+t.rect.height),text:n.title.text,fill:n.title.fill,fontSize:n.title.fontSize,fontFamily:n.title.fontFamily,maxWidth:n.title.maxLengthPx,maxLines:n.title.maxLines,wordBreak:n.title.wordBreak,hyphens:n.title.hyphens,lineHeight:n.title.lineHeight,anchor:s,title:n.title.text};return Nle(e,l),l}(this);this.state.nodes.push(e)}const t=function(e){const t=e.state.legend.fillScale,n=e.state.legend.majorScale,r=t.domain().map((e=>({type:"stop",color:t(e),offset:Math.min(1,Math.max(0,n.norm(e)))})));return r.sort(((e,t)=>e.offset-t.offset))}(this),n=function(e,t){const n=e.state,r=e.stgns,i=n.rect;let o=i.x,a=i.y,s=n.isVertical?r.size:n.legend.length(),l=n.isVertical?n.legend.length():r.size;"left"===n.ticks.anchor?o+=n.rect.width-r.size:"top"===n.ticks.anchor&&(a+=n.rect.height-r.size),"top"===n.title.anchor?a+=n.title.requiredHeight():"left"===n.title.anchor&&(o+=n.title.requiredWidth());const c={type:"rect",x:o,y:a,width:s,height:l,fill:{type:"gradient",stops:t,degree:n.isVertical?90:180}};return Nle(e,c),c}(this,t),r=function(e,t){const n=e.state,r=e.stgns;let i="start";const o={type:"rect",x:t.x,y:t.y,width:n.isVertical?0:t.width,height:n.isVertical?t.height:0,fill:"transparent"},a=n.ticks.values.map((a=>{let s=0,l=0,c=0,u="alphabetical";return n.isVertical?(l=t.y+t.height*a.pos,u=0===a.pos?"text-before-edge":"text-after-edge"):s=t.x+t.width*a.pos,"right"===n.ticks.anchor?(s=t.x+r.size+r.tick.padding,o.x=t.x+t.width):"left"===n.ticks.anchor?(s=t.x-r.tick.padding,i="end"):"top"===n.ticks.anchor?(l=t.y-r.tick.padding,c-=.25*a.textMetrics.height,i=0===a.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=t.y+t.height+r.tick.padding,c=.8*a.textMetrics.height,i=0===a.pos?"start":"end",o.y=t.y+t.height),{type:"text",x:s,y:l,dx:0,dy:c,text:a.label,fontSize:r.tick.fontSize,fontFamily:r.tick.fontFamily,fill:r.tick.fill,maxWidth:n.isVertical?r.tick.maxLengthPx:Math.min(r.tick.maxLengthPx,n.legend.length()/2),anchor:i,textBoundsFn:e.renderer.textBounds,title:a.label,baseline:u}}));return{type:"container",id:"legend-seq-ticks",children:[...a,o]}}(this,n),i={id:"legend-seq-target",type:"container",children:[n,r]};this.state.nodes.push(i)},render(){return this.state.nodes}};const Ble={coordinates:{minor:.5,major:.5,layerId:0,defined:!0},layers:{curve:"linear",show:!0,line:{stroke:"#ccc",strokeWidth:1,strokeLinejoin:"miter",strokeDasharray:void 0,opacity:1,show:!0,showMinor0:!0},area:{fill:"#ccc",opacity:.8,show:!0}}};function Vle(e,t){let{generatorType:n,item:r,data:i,major:o,minor:a,layerObj:s,stngs:l}=t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const u={type:"path",points:e,generatorType:n,major:o,minor:a,layerObj:s,stngs:l,opacity:r.opacity,stroke:r.stroke,strokeWidth:r.strokeWidth,strokeLinejoin:r.strokeLinejoin,fill:c||r.fill,data:i};return r.strokeDasharray&&(u.strokeDasharray=r.strokeDasharray),u}function Hle(e){const{metaLayers:t,coordinates:n,layers:r,lines:i,areas:o}=function(e){let{data:t,stngs:n,rect:r,resolver:i,style:o,domain:a}=e;const{width:s,height:l}=r,c=i.resolve({data:t,defaults:Ble.coordinates,settings:n.coordinates||{},scaled:{major:"vertical"===n.orientation?l:s,minor:"vertical"===n.orientation?s:l}}),u=!n.connect&&a.length>2&&("function"==typeof n.coordinates.layerId||"object"==typeof n.coordinates.layerId),d={};let f=0;for(let e=0;e<c.items.length;e++){let t=c.items[e],n=t.layerId;if(u){const e=d[n]?d[n].items[d[n].items.length-1]:null,r=e?a.indexOf(e.data.major?e.data.major.value:e.data.value):null;e&&a.indexOf(t.data.major?t.data.major.value:t.data.value)-1!==r&&d[n].items.push({dummy:!0})}d[n]=d[n]||{order:f++,id:n,items:[],dataItems:[],consumableData:{}},d[n].dataItems.push(t.data),d[n].items.push(t)}const h=Object.keys(d).map((e=>(d[e].consumableData=c8({points:d[e].dataItems},d[e].dataItems[0]),d[e]))),p={items:h.map((e=>e.consumableData))},m=n.layers||{};return{coordinates:c,metaLayers:h,layers:i.resolve({data:p,defaults:{curve:Ble.layers.curve,show:Ble.layers.show},settings:{curve:m.curve,show:m.show}}),lines:i.resolve({data:p,defaults:o8({},Ble.layers.line,o.line),settings:m.line}),areas:i.resolve({data:p,defaults:o8({},Ble.layers.area,o.area),settings:m.area})}}(e),a=[];return t.forEach(((t,s)=>{const l=r.items[s];if(!1===l.show)return;l.datum=l.data,l.data=[],l.id=t.id;const c=[],u=[];let d,f;for(let r=0;r<t.items.length;r++){if(d=t.items[r],f=d.data,!d.dummy){if(isNaN(d.major))continue;e.missingMinor0&&(d.minor0=n.settings.minor.scale?n.settings.minor.scale(f.minor0?f.minor0.value:0):0),isNaN(d.minor)||c.push(d.minor),l.data.push(d.data)}u.push(d)}const h=c.sort(((e,t)=>e-t))[Math.floor((c.length-1)/2)];a.push({layerObj:l,lineObj:i.items[s],areaObj:o.items[s],median:h,points:u,consumableData:t.consumableData})})),a}const Ule={require:["chart","resolver"],defaultSettings:{style:{area:"$shape",line:"$shape-outline"}},created(){},render(e){let{data:t}=e;const{width:n,height:r}=this.rect;this.stngs=this.settings.settings||{};const i=!this.stngs.coordinates||void 0===this.stngs.coordinates.minor0,o=Hle({data:t,stngs:this.stngs,rect:this.rect,resolver:this.resolver,style:this.style,missingMinor0:i,domain:this.stngs.coordinates&&this.stngs.coordinates.major&&this.stngs.coordinates.major.scale?this.chart.scale(this.stngs.coordinates.major.scale).domain():[]});if(this.stngs.layers&&this.stngs.layers.sort){const e=o.map((e=>({id:e.layerObj.id,data:e.layerObj.data}))).sort(this.stngs.layers.sort).map((e=>e.id));o.sort(((t,n)=>e.indexOf(t.layerObj.id)-e.indexOf(n.layerObj.id)))}else o.sort(((e,t)=>e.median-t.median));return function(e,t){let{width:n,height:r,missingMinor0:i,stngs:o}=t;const a=[],s=o.layers||{};return e.forEach((e=>{const{lineObj:t,layerObj:l,areaObj:c,points:u}=e;let d={size:r,p:"y"},f={size:n,p:"x"};if("vertical"===o.orientation){const e=o8(!0,{},f);f=o8(!0,{},d),d=o8(!0,{},e)}s.area&&!1!==c.show&&a.push(Vle(u,{data:e.consumableData,item:c,generatorType:"area",major:f,minor:d,layerObj:l,stngs:o})),t&&!1!==t.show&&(a.push(Vle(u,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"1"),major:f,minor:d,layerObj:l,stngs:o},"none")),!i&&s.area&&!1!==c.show&&!1!==t.showMinor0&&a.push(Vle(u,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"0"),major:f,minor:d,layerObj:l,stngs:o},"none")))})),a}(o,{width:n,height:r,missingMinor0:i,stngs:this.stngs})}};function Gle(e,t){let n,r,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"object"==typeof t.center?(n=t.center.x,r=t.center.y):(n=t.clientX,r=t.clientY);const o=n-e.state.boundingRect.left,a=r-e.state.boundingRect.top;return{x:i?Math.max(0,Math.min(o,e.rect.width)):o,y:i?Math.max(0,Math.min(a,e.rect.height)):a}}function Yle(e,t){return{x:t.x+e.rect.x,y:t.y+e.rect.y}}function Kle(e,t){const n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(e.x,t.x)-n,height:Math.max(e.y,t.y)-r}}const Xle={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:99},settings:{brush:{components:[]}},style:{area:"$selection-area-target"}},on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaCancel(){this.cancel()}},created(){this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1}},preferredSize:()=>0,render(){},start(e){this.state.boundingRect=this.renderer.element().getBoundingClientRect();const t=Gle(this,e,!1);Eie({x:0,y:0,width:this.rect.width,height:this.rect.height},t)&&(this.state.brushConfig=function(e){return e.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts,data:e.data,action:e.action||"set"})))}(this.settings),this.state.start=Gle(this,e),this.state.active=!0)},move(e){var t;this.state.active&&(this.state.end=Gle(this,e),function(e){if(e.state.active){const t=Yle(e,e.state.start),n=Yle(e,e.state.end),r=e.chart.shapesAt(Kle(t,n),{components:e.state.brushConfig});e.chart.brushFromShapes(r,{components:e.state.brushConfig})}}(this),(t=this).renderer.render([o8({type:"rect"},Kle(t.state.start,t.state.end),t.style.area)]))},end(){this.state.active&&(this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))},cancel(){var e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach((e=>{Array.isArray(e.contexts)&&e.contexts.forEach((e=>{t.brush(e).end()}))})),this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))}};function Jle(e,t,n){let{renderer:r,style:i,props:o,h:a}=n;const s=function(e,t){return{tooltip:"function"==typeof e.tooltipClass?e.tooltipClass({dock:t.dock}):e.tooltipClass,content:"function"==typeof e.contentClass?e.contentClass({dock:t.dock}):e.contentClass,arrow:"function"==typeof e.arrowClass?e.arrowClass({dock:t.dock}):e.arrowClass}}(o,t),l=function(e,t,n,r){return r.content({h:e,style:n,data:t})}(a,e,i,o),c=a("div",{dir:o.direction,class:Rle(o8({"pic-tooltip":!0},s.tooltip)),style:o8({position:"relative",display:"inline-block"},t.computedTooltipStyle)},a("div",{style:i.content,class:Rle(o8({"pic-tooltip-content":!0},s.content))},l),a("div",{class:Rle(o8({"pic-tooltip-arrow":!0},s.arrow)),style:o8({},i.arrow,i["arrow-".concat(t.dock)],t.computedArrowStyle)}));return r.render(c),r.element().children[0]}function Qle(e){let{defaultDuration:t,defaultDelay:n}=e,r=null,i=null,o=!1;const a=function(){const e=function(){},t={pending:[],debounced:[],active:[],cancelled:[],rejected:[],fulfilled:[]};let n;return e.set=e=>{n=e,t[n].forEach((t=>t(e)))},e.on=(e,n)=>{Array.isArray(e)?e.forEach((e=>t[e].push(n))):t[e].push(n)},e.destroy=()=>{Object.keys(t).forEach((e=>{t[e].length=0}))},e}(),s=function(){},l=()=>{r=null,i=null,o=!1,a.set("fulfilled")};return s.invoke=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;r&&(clearTimeout(r),a.set("debounced")),a.set("pending"),r=setTimeout((()=>{e(),o=!0,r=null,a.set("active")}),c),s>0&&(i&&clearTimeout(i),i=setTimeout(l,s+Math.max(c,0)))},s.clear=()=>{o?a.set("cancelled"):r&&(clearTimeout(r),a.set("rejected")),i&&clearTimeout(i),r=null,i=null,o=!1},s.on=(e,t)=>{a.on(e,t)},s.destroy=()=>{s.clear(),a.destroy()},s}function Zle(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{left:"translate(-100%,-50%) translateX(".concat(-e,"px)"),right:"translate(".concat(e,"px, -50%)"),top:"translate(-50%, -100%) translateY(".concat(-e,"px)"),bottom:"translate(-50%, ".concat(e,"px)"),inside:"translate(-50%, -50%)"}}function ece(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{left:{x:-e-n,y:-t/2},right:{x:n,y:-t/2},top:{x:-e/2,y:-t-n},bottom:{x:-e/2,y:n},inside:{x:-e/2,y:-t/2}}}function tce(e,t){const n=e>0?"-":"+";return e=Math.abs(e),void 0===t&&(t=e),{left:{left:"100%",top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},right:{left:"".concat(2*-e,"px"),top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},top:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"100%",borderWidth:"".concat(t,"px")},bottom:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"".concat(2*-e,"px"),borderWidth:"".concat(t,"px")},inside:{left:"0px",top:"0px",borderWidth:"0px"}}}function nce(e,t,n,r,i,o){const a=t+o.x,s=n+o.y,l=i;return!(a<0||s<0)&&!(a+r>e.width||s+l>e.height)}function rce(e){let{area:t,vx:n,vy:r,width:i,height:o,offset:a}=e;const s=n+a.x,l=r+a.y,c=i,u=o;let d=s<0?-s:0,f=l<0?-l:0;return d+=s+c>t.width?-(s+c-t.width):0,f+=l+u>t.height?-(l+u-t.height):0,{x:d,y:f}}function ice(e){let{options:t,pointer:n,width:r,height:i,dockOrder:o,x:a,y:s}=e;const{targetBounds:l}=n,c=Zle(t.offset),u=c[t.dock];if(u)return{computedTooltipStyle:{left:"".concat(a,"px"),top:"".concat(s,"px"),transform:u},computedArrowStyle:tce(t.offset)[t.dock],dock:t.dock};const d={width:"target"===t.area?l.width:window.innerWidth,height:"target"===t.area?l.height:window.innerHeight},f=ece(r,i,t.offset),h=[],p="target"===t.area?a:l.left+a,m="target"===t.area?s:l.top+s;for(let e=0;e<o.length;e+=1){const n=o[e],l=rce({area:d,vx:p,vy:m,width:r,height:i,offset:f[n]}),u={left:"".concat(a,"px"),top:"".concat(s,"px"),transform:c[n]},g=tce(t.offset)[n];0!==l.x&&(u.width="".concat(r-20-Math.abs(l.x),"px"),"top"!==n&&"bottom"!==n||(u.left="".concat(a+l.x,"px"),g.left="calc(50% ".concat(l.x>0?"-":"+"," ").concat(Math.abs(l.x),"px)")));const y={computedTooltipStyle:u,computedArrowStyle:g,dock:n,rect:{width:r,height:i}};if(0===l.x&&0===l.y)return y;y.offset=l,h.push(y)}return h.sort(((e,t)=>Math.abs(e.offset.x)-Math.abs(t.offset.x))),h[0]}function oce(e,t,n){const r=e.key?n.component(e.key):n.componentsFromPoint({x:t.clientX,y:t.clientY})[0];if(!r)return{x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1}};const i=r.rect;return o8({scaleRatio:i.scaleRatio},i.computedInner)}const ace={bounds:function(e){let{resources:t,nodes:n,pointer:r,width:i,height:o,options:a}=e;const{targetBounds:s}=r,{x:l,y:c,width:u,height:d}=t.getNodeBoundsRelativeToTarget(n[0]),f={left:{x:l,y:c+d/2},right:{x:l+u,y:c+d/2},top:{x:l+u/2,y:c},bottom:{x:l+u/2,y:c+d},inside:{x:l+u/2,y:c+d/2}},h=Zle(a.offset),p=h[a.dock];if(p)return{computedTooltipStyle:{left:"".concat(f[a.dock].x,"px"),top:"".concat(f[a.dock].y,"px"),transform:p},computedArrowStyle:tce(a.offset)[a.dock],dock:a.dock};const m={width:"target"===a.area?s.width:window.innerWidth,height:"target"===a.area?s.height:window.innerHeight},g=ece(i,o,a.offset),y=["top","left","right","bottom","inside"];for(let e=0;e<y.length;e+=1){const t=y[e];if(nce(m,"target"===a.area?f[t].x:s.left+f[t].x,"target"===a.area?f[t].y:s.top+f[t].y,i,o,g[t]))return{computedTooltipStyle:{left:"".concat(f[t].x,"px"),top:"".concat(f[t].y,"px"),transform:h[t]},computedArrowStyle:tce(a.offset)[t],dock:t}}const v=function(e){let{options:t,docks:n,dockOffsets:r,targetBounds:i,area:o,width:a}=e;const s="top",l="target"===t.area?n[s].x:i.left+n[s].x,c=("target"===t.area?n[s].y:(i.top,n[s].y),r[s]),u=l+c.x,d=(c.y,a);let f=n.top.x;return u<0&&u+d>o.width||(u<0?f-=u:u+d>o.width&&(f-=u+d-o.width)),f}({options:a,docks:f,dockOffsets:g,targetBounds:s,area:m,width:i});return{computedTooltipStyle:{left:"".concat(v,"px"),top:"".concat(f.top.y,"px"),transform:h.top},computedArrowStyle:tce(a.offset+v-f.top.x,a.offset).top,dock:"top"}},pointer:function(e){let{options:t,pointer:n,width:r,height:i}=e;const{x:o,y:a}=n;return ice({x:o,y:a,pointer:n,width:r,height:i,options:t,dockOrder:["top","left","right","bottom"]})},slice:function(e){let{options:t,pointer:n,width:r,height:i,nodes:o,resources:a}=e;const s=o[0],{dx:l,dy:c}=n,u=a.getComponentBoundsFromNode(s),d=l+u.x+u.width/2,f=c+u.y+u.height/2,{start:h,end:p,outerRadius:m}=s.desc.slice,g=(h+p)/2-Math.PI/2,y=2*Math.PI,v=(g%y+y)%y;let b=["top","left","right","bottom"];return"auto"===t.dock&&(b=v<=Math.PI/4||v>=7*Math.PI/4?["right","top","bottom","left"]:v<=3*Math.PI/4?["bottom","left","right","top"]:v<=5*Math.PI/4?["left","top","bottom","right"]:["top","left","right","bottom"]),ice({x:d+m*u.scaleRatio.x*Math.cos(v),y:f+m*u.scaleRatio.y*Math.sin(v),pointer:n,width:r,height:i,options:t,dockOrder:b})}};function sce(e,t){let{width:n,height:r}=e,{chart:i,state:o,props:a}=t;const s={resources:{formatter:i.formatter,scale:i.scale,component:i.component,getComponentBoundsFromNode:e=>oce(e,o.pointer,i),getNodeBoundsRelativeToTarget:e=>function(e,t,n){const r=oce(e,t,n),i=e.bounds;return{x:r.x+t.dx+i.x,y:r.y+t.dy+i.y,width:i.width,height:i.height}}(e,o.pointer,i)},nodes:o.activeNodes,pointer:o.pointer,width:n,height:r},l=typeof a.placement;if("object"===l&&"function"==typeof a.placement.fn)return a.placement.fn(s);let c={type:"pointer",offset:8,dock:"auto",area:"viewport"};"function"===l&&(c=o8(c,a.placement(s))),"object"===l&&ace[a.placement.type]?c=o8(c,a.placement):"string"===l&&ace[a.placement]&&(c=o8(c,{type:a.placement})),s.options=c;const u=ace[c.type](s);let{x:d,y:f,width:h,height:p}=s.resources.getComponentBoundsFromNode(s.nodes[0]);return d+=s.pointer.dx,h+=d,f+=s.pointer.dy,p+=f,u.computedTooltipStyle.left="".concat(Math.min(Math.max(0,d,parseFloat(u.computedTooltipStyle.left)),h),"px"),u.computedTooltipStyle.top="".concat(Math.min(Math.max(0,f,parseFloat(u.computedTooltipStyle.top)),p),"px"),u}let lce;function cce(){lce=null}const uce={duration:8e3,delay:500,filter:e=>e.filter((e=>e.data&&void 0!==e.data.value)),extract:e=>e.node.data.value,content:e=>{let{h:t,data:n}=e;return n.map((e=>t("div",{},e)))},isEqual:(e,t)=>e.length&&e.length===t.length&&e.every(((e,n)=>t[n]&&JSON.stringify(e.data)===JSON.stringify(t[n].data))),placement:{type:"pointer",dock:"auto",offset:8,area:"viewport"},tooltipClass:{},contentClass:{},arrowClass:{},direction:"ltr",appendTo:void 0,beforeShow:void 0,afterShow:void 0,beforeHide:void 0,onHide:void 0,afterHide:void 0};const dce={require:["chart","renderer"],defaultSettings:{settings:uce,style:{tooltip:{},content:{backgroundColor:"$gray-25",color:"$font-color--inverted",fontFamily:"$font-family",fontSize:"$font-size",lineHeight:"$line-height",borderRadius:"4px",padding:"8px",opacity:.9},arrow:{position:"absolute",width:"0px",height:"0px",borderStyle:"solid",color:"$gray-25",opacity:.9},"arrow-bottom":{borderTopColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-top":{borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-right":{borderTopColor:"transparent",borderLeftColor:"transparent",borderBottomColor:"transparent"},"arrow-left":{borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent"}}},renderer:"dom",on:{hide(){this.hide()},show(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.show(e,t)},prevent(e){this.prevent(e)}},hide(){this.dispatcher.clear(),this.state.activeNodes=[],this.state.pointer={}},show(e){let t,{nodes:n,duration:r,delay:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!this.state.prevent&&this.state.targetElement&&(this.state.pointer=function(e,t){let{chart:n,state:r}=t,i=0,o=0;e.center?(i+=e.center.x,o+=e.center.y):(i+=e.clientX,o+=e.clientY);const a=n.element.getBoundingClientRect(),s=r.targetElement.getBoundingClientRect(),l=i,c=o,u=a.left-s.left,d=a.top-s.top,f=i-a.left,h=o-a.top;return i-=s.left,o-=s.top,{x:i,y:o,dx:u,dy:d,cx:f,cy:h,clientX:l,clientY:c,targetBounds:s,chartBounds:a}}(e,this),t=Array.isArray(n)?this.props.filter(n):this.props.filter(this.chart.shapesAt({x:this.state.pointer.cx,y:this.state.pointer.cy})),this.props.isEqual(this.state.activeNodes,t)||(this.dispatcher.clear(),this.state.activeNodes=t,this.state.activeNodes.length&&this.dispatcher.invoke((()=>this.invokeRenderer(this.state.activeNodes)),r,i)))},prevent(e){this.state.prevent=!!e},init(e){this.state={activeNodes:[],pointer:{},targetElement:null,prevent:!1},this.props=e.settings,this.dispatcher=Qle({defaultDuration:this.props.duration,defaultDelay:this.props.delay});const t=this.dispatcher.clear;this.dispatcher.on("pending",(()=>{!function(e){lce&&lce!==e&&lce()}(t),lce=t,"function"==typeof this.props.beforeShow&&this.props.beforeShow.call(void 0,{resources:{formatter:this.chart.formatter,scale:this.chart.scale}})})),this.dispatcher.on(["cancelled","fulfilled"],(()=>{const e={resources:{formatter:this.chart.formatter,scale:this.chart.scale}};"function"==typeof this.props.beforeHide&&this.props.beforeHide.call(void 0,o8({element:this.state.tooltipElm},e)),"function"==typeof this.props.onHide?this.props.onHide.call(void 0,o8({element:this.state.tooltipElm},e)):this.renderer.clear([]),"function"==typeof this.props.afterHide&&this.props.afterHide.call(void 0,e),lce===t&&(lce=null),this.state.tooltipElm=void 0})),this.dispatcher.on("active",(()=>{"function"==typeof this.props.afterShow&&this.props.afterShow.call(void 0,{element:this.state.tooltipElm,resources:{formatter:this.chart.formatter,scale:this.chart.scale}})}))},created(){this.init(this.settings)},beforeUpdate(e){let{settings:t}=e;this.dispatcher&&(this.dispatcher.destroy(),cce()),this.init(t)},render(e){return this.h=e,[]},beforeDestroy(){this.dispatcher.destroy(),cce()},appendTo(){if(this.props.appendTo){this.state.targetElement="function"==typeof this.props.appendTo?this.props.appendTo({resources:{formatter:this.chart.formatter,scale:this.chart.scale}}):this.props.appendTo;const{width:e,height:t}=this.state.targetElement.getBoundingClientRect();this.renderer.destroy(),this.renderer.size({width:e,height:t}),this.renderer.appendTo(this.state.targetElement)}else this.state.targetElement=this.renderer.element()},mounted(){this.appendTo()},updated(){this.appendTo()},invokeRenderer(e){const t=function(e,t){let{chart:n,scale:r,props:i,h:o}=t;const a={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:r,h:o},s=[];return e.forEach((e=>{if("function"==typeof i.extract){const t=o8({node:e},a);s.push(i.extract(t))}})),s}(e,this),n=sce(Jle(t,{},this).getBoundingClientRect(),this);this.state.tooltipElm=Jle(t,n,this)}};const fce={require:["renderer","chart"],defaultSettings:{settings:{target:"",selector:"*",fill:"rgba(0, 255, 0, 0.1)",stroke:"lime",opacity:1,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes(this.props.selector).filter((e=>e.key===this.props.target)),t=e.filter((e=>e.collider)).map((e=>e.collider));t.forEach((e=>{e.fill=this.props.fill,e.stroke=this.props.stroke,e.opacity=this.props.opacity,e.collider={type:null}})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var hce={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},pce=/([astvzqmhlc])([^astvzqmhlc]*)/gi,mce=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function gce(e){const t=[],n=String(e).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(pce,((e,n,r)=>{const i=function(e){const t=e.match(mce);return t?t.map(Number):[]}(r);let o=n.toLowerCase(),a=n;if("m"===o&&i.length>2&&(t.push([a,...i.splice(0,2)]),o="l",a="m"===a?"l":"L"),i.length<hce[o])return"";for(t.push([a,...i.splice(0,hce[o])]);i.length>=hce[o]&&i.length&&hce[o];)t.push([a,...i.splice(0,hce[o])]);return""})),t}const yce=2*Math.PI;function vce(e,t){return{x:.5*(e.x+t.x),y:.5*(e.y+t.y)}}function bce(e,t,n,r,i){const o=1-e;return o**3*t+3*o**2*e*n+3*o*e**2*r+e**3*i}function xce(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8;if(o<1||function(e,t,n,r){return Math.abs(e.x+n.x-(t.x+t.x))+Math.abs(e.y+n.y-(t.y+t.y))+Math.abs(t.x+r.x-(n.x+n.x))+Math.abs(t.y+r.y-(n.y+n.y))}(e,t,n,r)<=10)return i[i.length-1]!==e&&i.push(e),i.push(r),i;const a=vce(e,t),s=vce(t,n),l=vce(n,r),c={x:bce(.5,e.x,t.x,n.x,r.x),y:bce(.5,e.y,t.y,n.y,r.y)},u=vce(a,s),d=vce(s,l);return xce(e,a,u,c,i,o-1),xce(c,d,l,r,i,o-1),i}function wce(e,t,n){const{cp1:r,cp2:i}=function(e,t,n){return{cp1:{x:e.x+2/3*(t.x-e.x),y:e.y+2/3*(t.y-e.y)},cp2:{x:n.x+2/3*(t.x-n.x),y:n.y+2/3*(t.y-n.y)}}}(e,t,n);return xce(e,r,i,n)}function Sce(e,t,n){const r=[],i=!!e[4],o=!!e[5],a=e[3];let s,l,c,u,d=e[6],f=e[7],h=e[1],p=e[2];if("a"===e[0]&&(d+=t,f+=n),t===f&&n===f)return r;if(!h||!p)return r.push({x:d,y:f}),r;({cx:s,cy:l,rx:h,ry:p,sweepAngle:c,startAngle:u}=function(e,t,n,r,i,o,a,s,l){let c,u,d,f,h,p;const m=Fre(n%360),g=Math.cos(m),y=Math.sin(m),v=(s-o)/2,b=(l-a)/2,x=g*v+y*b,w=g*b-y*v;p=x**2/(e=Math.abs(e))**2+w**2/(t=Math.abs(t))**2,p>1&&(p=Math.sqrt(p),e*=p,t*=p);const S=e*w,C=t*x,k=S**2+C**2,E=(e*t)**2-k;let M=Math.sqrt(Math.max(E/k,0));r===i&&(M=-M);const _=M*(S/t),R=M*(-C/e);f=g*_-y*R+(s+o)/2,h=y*_+g*R+(l+a)/2;const I=(x-_)/e,D=(w-R)/t,P=(-x-_)/e,A=(-w-R)/t;return c=Math.atan2(D,I),c+=c<0?yce:0,u=Math.atan2(A,P),u+=u<0?yce:0,d=u-c,!i&&c<u?d-=yce:i&&u<c&&(d+=yce),d%=yce,{startAngle:c,sweepAngle:d,cx:f,cy:h,rx:e,ry:t}}(h,p,a,i,o,d,f,t,n));const m=Math.abs(c*Math.sqrt((h**2+p**2)/2)),g=Math.ceil(m/10),y=c/g;for(let e=1;e<=g;e++){const t=(u+y*e)%yce,n=Math.cos(t),i=Math.sin(t);r.push({x:s+n*h+-i*n,y:l+i*p+n*i})}return r}function Cce(e){const t=gce(e),n=[],r=[];let i=0,o=0,a=null,s=null,l=null,c=null;for(let e=0;e<t.length;++e){const u=t[e],d=u[0];switch("S"!==d&&"s"!==d&&"C"!==d&&"c"!==d&&(a=null,s=null),"T"!==d&&"t"!==d&&"Q"!==d&&"q"!==d&&(l=null,c=null),d){case"m":r.length&&n.push(r.splice(0));case"l":i+=u[1],o+=u[2],r.push({x:i,y:o});break;case"M":r.length&&n.push(r.splice(0));case"L":i=u[1],o=u[2],r.push({x:i,y:o});break;case"H":i=u[1],r.push({x:i,y:o});break;case"h":i+=u[1],r.push({x:i,y:o});break;case"V":o=u[1],r.push({x:i,y:o});break;case"v":o+=u[1],r.push({x:i,y:o});break;case"a":r.push(...Sce(u,i,o)),i+=u[6],o+=u[7];break;case"A":r.push(...Sce(u,i,o)),i=u[6],o=u[7];break;case"c":r.push(...xce({x:i,y:o},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o},{x:u[5]+i,y:u[6]+o})),a=u[3]+i,s=u[4]+o,i+=u[5],o+=u[6];break;case"C":r.push(...xce({x:i,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]},{x:u[5],y:u[6]})),a=u[3],s=u[4],i=u[5],o=u[6];break;case"s":null!==a&&null!==a||(a=i,s=o),r.push(...xce({x:i,y:o},{x:2*i-a,y:2*o-s},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o})),a=u[1]+i,s=u[2]+o,i+=u[3],o+=u[4];break;case"S":null!==a&&null!==a||(a=i,s=o),r.push(...xce({x:i,y:o},{x:2*i-a,y:2*o-s},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),a=u[1],s=u[2],i=u[3],o=u[4];break;case"Q":r.push(...wce({x:i,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),l=u[1],c=u[2],i=u[3],o=u[4];break;case"q":r.push(...wce({x:i,y:o},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o})),l=u[1]+i,c=u[2]+o,i+=u[3],o+=u[4];break;case"T":null!==l&&null!==l||(l=i,c=o),l=2*i-l,c=2*o-c,r.push(...wce({x:i,y:o},{x:l,y:c},{x:u[1],y:u[2]})),i=u[1],o=u[2];break;case"t":null!==l&&null!==l||(l=i,c=o),l=2*i-l,c=2*o-c,r.push(...wce({x:i,y:o},{x:l,y:c},{x:u[1]+i,y:u[2]+o})),i+=u[1],o+=u[2];break;case"z":case"Z":r.length&&r.push({x:r[0].x,y:r[0].y})}}return function(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];Math.abs(n.x-r.x)<1e-12&&Math.abs(n.y-r.y)<1e-12&&(e.splice(t,1),t--)}}(r),n.push(r.splice(0)),n}const kce={require:["renderer","chart"],defaultSettings:{settings:{target:"",fill:"transparent",stroke:"lime",opacity:1,radius:2,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes("path").filter((e=>e.key===this.props.target)),t=[];e.forEach((e=>{Cce(e.attrs.d).forEach((e=>{e.forEach((e=>{t.push({type:"circle",cx:e.x,cy:e.y,r:this.props.radius,fill:this.props.fill,stroke:this.props.stroke,opacity:this.props.opacity,collider:{type:null}})}))}))})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var Ece=[function(e){e.component("box",Eoe),e.component("box-marker",Eoe)},function(e){e.component("point",Ooe),e.component("point-marker",Ooe)},function(e){e.component("pie",Noe)},function(e){e.component("grid-line",$oe)},function(e){e.component("ref-line",Zoe)},function(e){e.component("axis",Rae)},function(e){e.component("container",Iae)},function(e){e.component("text",Aae)},function(e){e.component("scrollbar",Tae)},function(e){e.component("brush-range",Xae),e.component("brush-area-dir",ese)},function(e){e.component("range",ise)},function(e){e.component("brush-lasso",use)},function(e){e.component("labels",Cle)},function(e){e.component("legend-cat",qle)},function(e){e.component("legend-seq",$le)},function(e){e.component("line",Ule)},function(e){e.component("brush-area",Xle)},function(e){e.component("tooltip",dce)},function(e){e.component("debug-collider",fce)},function(e){e.component("debug-path-to-points",kce)}];let Mce=class{constructor(e){this._parent=null,this._children=[],this._ancestors=null,this.type=e,this.data=null}detach(){return this._parent&&this._parent.removeChild(this),this}get parent(){return this._parent}get isBranch(){return this._children&&this._children.length}get children(){return this._children}get ancestors(){return this._ancestors||(this._ancestors=[],this.parent&&this._ancestors.push(this.parent,...this.parent.ancestors)),this._ancestors}get descendants(){let e=[];const t=this.children.length;let n,r;for(n=0;n<t;n++)r=this.children[n],e.push(r),r.children.length&&(e=[...e,...r.descendants]);return e}equals(e){const t=this.children,n=e.children;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(!t[e].equals(n[e]))return!1;return!0}toJSON(){return{type:this.type,children:this.children.map((e=>e.toJSON()))}}};class _ce{constructor(){let{x:e=0,y:t=0,width:n=0,height:r=0,minWidth:i=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x:e,y:t,width:n,height:r,minWidth:i,minHeight:o})}set(){let{x:e=0,y:t=0,width:n=0,height:r=0,minWidth:i=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="rect",n>=0?(this.x=e,this.width=Math.max(n,i)):(this.x=e+Math.min(n,-i),this.width=-Math.min(n,-i)),r>=0?(this.y=t,this.height=Math.max(r,o)):(this.y=t+Math.min(r,-o),this.height=-Math.min(r,-o))}containsPoint(e){return Eie(this,e)}intersectsLine(e){return Mie(this,y8(e))}intersectsRect(e){return Cie(this,g8(e))}intersectsCircle(e){return yie(e,this)}intersectsPolygon(e){return Sie(e,this)}intersectsGeoPolygon(e){return Lie(e,this)}points(){return[{x:this.x,y:this.y},{x:this.x+this.width,y:this.y},{x:this.x+this.width,y:this.y+this.height},{x:this.x,y:this.y+this.height}]}}class Rce{constructor(){let{cx:e=0,cy:t=0,r:n=0,minRadius:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({cx:e,cy:t,r:n,minRadius:r})}set(){let{cx:e=0,cy:t=0,r:n=0,minRadius:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="circle",this.cx=e,this.cy=t,this.r=Math.max(n,r),this.vector={x:this.cx,y:this.cy}}containsPoint(e){return gie(this,e)}intersectsLine(e){return vie(this,y8(e))}intersectsRect(e){return yie(this,g8(e))}intersectsCircle(e){return n=e,!fie(t=this)&&!fie(n)&&(t.cx-n.cx)**2+(t.cy-n.cy)**2<=(t.r+n.r)**2;var t,n}intersectsPolygon(e){return bie(this,e)}intersectsGeoPolygon(e){return Pie(this,e)}points(){return[{x:this.cx,y:this.cy}]}}class Ice{constructor(){let{x1:e=0,y1:t=0,x2:n=0,y2:r=0,tolerance:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x1:e,y1:t,x2:n,y2:r,tolerance:i})}set(){let{x1:e=0,y1:t=0,x2:n=0,y2:r=0,tolerance:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="line",this.x1=e,this.y1=t,this.x2=n,this.y2=r,this.tolerance=Math.max(0,Math.round(i)),this.vectors=this.points(),this.zeroSize=e===n&&t===r}containsPoint(e){if(this.tolerance>0){return vie({cx:e.x,cy:e.y,r:this.tolerance},this)}return Rie(this,e)}intersectsLine(e){return _ie(this,y8(e))}intersectsRect(e){return Mie(g8(e),this)}intersectsCircle(e){return vie(e,this)}intersectsPolygon(e){return wie(e,this)}intersectsGeoPolygon(e){return Oie(e,this)}points(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}class Dce{constructor(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polygon",this.vertices=e.slice(),this.edges=[],function(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}(this.vertices),!(this.vertices.length<=2)){!function(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}(this.vertices),this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.vertices.length;e++)e<this.vertices.length-1&&this.edges.push([this.vertices[e],this.vertices[e+1]]),this.xMin=isNaN(this.xMin)?this.vertices[e].x:Math.min(this.xMin,this.vertices[e].x),this.xMax=isNaN(this.xMax)?this.vertices[e].x:Math.max(this.xMax,this.vertices[e].x),this.yMin=isNaN(this.yMin)?this.vertices[e].y:Math.min(this.yMin,this.vertices[e].y),this.yMax=isNaN(this.yMax)?this.vertices[e].y:Math.max(this.yMax,this.vertices[e].y);this._bounds=null,this._boundingRect=null}}containsPoint(e){return xie(this,e)}intersectsCircle(e){return bie(e,this)}intersectsLine(e){return wie(this,y8(e))}intersectsRect(e){return Sie(this,g8(e))}intersectsPolygon(e){return Iie(this,e)}intersectsGeoPolygon(e){return Die(e,this)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function Pce(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Dce(...t)}function Ace(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function Oce(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}class Lce{constructor(){let{vertices:e=[[]]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="geopolygon",this.vertices=e.slice(),this.numPolygons=this.vertices.length,this.polygons=[],this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.numPolygons;e++)Oce(this.vertices[e]),this.vertices[e].length>2&&Ace(this.vertices[e]),this.polygons[e]=Pce({vertices:this.vertices[e]}),this.xMin=isNaN(this.xMin)?this.polygons[e].xMin:Math.min(this.xMin,this.polygons[e].xMin),this.xMax=isNaN(this.xMax)?this.polygons[e].xMax:Math.max(this.xMax,this.polygons[e].xMax),this.yMin=isNaN(this.yMin)?this.polygons[e].yMin:Math.min(this.yMin,this.polygons[e].yMin),this.yMax=isNaN(this.yMax)?this.polygons[e].yMax:Math.max(this.yMax,this.polygons[e].yMax);this._bounds=null,this._boundingRect=null}containsPoint(e){return Aie(this,e)}intersectsCircle(e){return Pie(e,this)}intersectsLine(e){return Oie(this,y8(e))}intersectsRect(e){return Lie(this,g8(e))}intersectsPolygon(e){return Die(this,e)}intersectsGeoPolygon(e){return function(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!Cie(n,r)&&(kie(r,n)?mie(t,e):mie(e,t))}(this,e)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function Tce(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Lce(...t)}class qce{constructor(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({points:e})}set(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polyline",this.segments=[],this._points=e.slice(),this._points.length>1)for(let e=0,r=this._points.length-1;e<r;e++)t=this._points[e],n=this._points[e+1],(t.x!==n.x||t.y!==n.y)&&this.segments.push({x1:this._points[e].x,y1:this._points[e].y,x2:this._points[e+1].x,y2:this._points[e+1].y});var t,n}containsPoint(e){return this.segments.some((t=>Rie(t,e)))}intersectsCircle(e){return this.segments.some((t=>vie(e,t)))}intersectsLine(e){const t=y8(e);return this.segments.some((e=>_ie(e,t)))}intersectsRect(e){const t=g8(e);return this.segments.some((e=>Mie(t,e)))}intersectsPolygon(e){return this.segments.some((t=>wie(e,t)))}intersectsGeoPolygon(e){return this.segments.some((t=>Oie(e,t)))}points(){return this._points}}const Nce=S7();function jce(e,t){return Nce.get(e)(t)}Nce.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new _ce(...t)})),Nce.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Rce(...t)})),Nce.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Ice(...t)})),Nce.add("polygon",Pce),Nce.add("geopolygon",Tce),Nce.add("polyline",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new qce(...t)}));class zce{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.geometries=[],e.forEach((e=>{const t=jce(e.type,e);t&&this.geometries.push(t)}))}containsPoint(e){return this.geometries.some((t=>t.containsPoint(e)))}intersectsLine(e){return this.geometries.some((t=>t.intersectsLine(e)))}intersectsRect(e){return this.geometries.some((t=>t.intersectsRect(e)))}intersectsCircle(e){return this.geometries.some((t=>t.intersectsCircle(e)))}intersectsPolygon(e){return this.geometries.some((t=>t.intersectsPolygon(e)))}intersectsGeoPolygon(e){return this.geometries.some((t=>t.intersectsGeoPolygon(e)))}}class Fce{constructor(){this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}clone(){return(new Fce).multiply(this)}set(e){return this._elements=e,this}save(){return this._stack.push(this.elements),this}restore(){return this._stack.length&&(this._elements=this._stack.pop()),this}add(e){let t,n;for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]+=e;return this}translate(e,t){return this.multiply([[1,0,e],[0,1,t],[0,0,1]]),this}rotate(e){let t=Math.cos(-e),n=Math.sin(-e);return this.multiply([[t,n,0],[-n,t,0],[0,0,1]]),this}multiply(e){let t,n,r,i;if(e instanceof Fce&&(e=e._elements),Array.isArray(e)){for(r=[[0,0,0],[0,0,0],[0,0,0]],t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)for(i=0;i<3;i++)r[t][n]+=this._elements[t][i]*e[i][n];this._elements=r}else for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]*=e;return this}scale(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.multiply([[e,0,0],[0,t,0],[0,0,1]]),this}transform(e,t,n,r,i,o){return this.multiply([[e,n,i],[t,r,o],[0,0,1]]),this}determinant(){let e=this._elements[0][0],t=this._elements[0][1],n=this._elements[0][2],r=this._elements[1][0],i=this._elements[1][1],o=this._elements[1][2],a=this._elements[2][0],s=this._elements[2][1],l=this._elements[2][2],c=0;return c=e*i*l+t*o*a+n*r*s-n*i*a-t*r*l-e*o*s,c}invert(){let e=this.determinant(),t=this._elements[0][0],n=this._elements[0][1],r=this._elements[0][2],i=this._elements[1][0],o=this._elements[1][1],a=this._elements[1][2],s=this._elements[2][0],l=this._elements[2][1],c=this._elements[2][2];return this._elements=[[o*c-a*l,r*l-n*c,n*a-r*o],[a*s-i*c,t*c-r*s,r*i-t*a],[i*l-o*s,s*n-t*l,t*o-n*i]],this.multiply(1/e),this}transpose(){const e=Object.create(this._elements);return this._elements=[[e[0][0],e[1][0],e[2][0]],[e[0][1],e[1][1],e[2][1]],[e[0][2],e[1][2],e[2][2]]],this}identity(){return this._elements=[[1,0,0],[0,1,0],[0,0,1]],this}toString(){return"".concat(this._elements.map((e=>e.join("\t"))).join("\n"))}isIdentity(){const e=this._elements;return 1===e[0][0]&&0===e[0][1]&&0===e[0][2]&&0===e[1][0]&&1===e[1][1]&&0===e[1][2]&&0===e[2][0]&&0===e[2][1]&&1===e[2][2]}transformPoint(e){let t,n,r=[e.x,e.y,1],i=this._elements,o=[0,0,0];for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)o[t]+=r[n]*i[t][n];return{x:o[0],y:o[1]}}transformPoints(e){let t,n,r,i,o,a=this._elements,s=[];for(i=0;i<e.length;i++){for(t=[e[i].x,e[i].y,1],o=[0,0,0],n=0;n<this._elements.length;n++)for(r=0;r<this._elements[n].length;r++)o[n]+=t[r]*a[n][r];s.push({x:o[0],y:o[1]})}return s}get elements(){const e=this._elements;return[[e[0][0],e[0][1],e[0][2]],[e[1][0],e[1][1],e[1][2]],[e[2][0],e[2][1],e[2][2]]]}}const Wce=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function $ce(e,t){const n=t.args[0]*(Math.PI/180);if(t.args.length>2){const r=t.args[1],i=t.args[2];e.translate(r,i),e.rotate(n),e.translate(-r,-i)}else 1===t.args.length&&e.rotate(n)}function Bce(e,t){const n=t.args[0],r=isNaN(t.args[1])?t.args[0]:t.args[1];e.scale(n,r)}function Vce(e,t){const n=t.args[0],r=isNaN(t.args[1])?0:t.args[1];e.translate(n,r)}function Hce(e,t){t.args.length>=6&&e.transform(...t.args)}function Uce(e,t){const n=function(e){let t,n=[];for(;null!==(t=Wce.exec(e));){const e=t[2].trim(),r=-1===e.indexOf(",")?e.split(" "):e.split(",");n.push({cmd:t[1],args:r.filter((e=>e.trim().length>0)).map((e=>Number(e)))})}return n}(e);let r;for(let e=0,i=n.length;e<i;e++)r=n[e],"rotate"===r.cmd?$ce(t,r):"scale"===r.cmd?Bce(t,r):"matrix"===r.cmd?Hce(t,r):"translate"===r.cmd&&Vce(t,r)}const Gce={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},Yce={type:(e,t)=>t.filter((t=>{const n=t.type;return!!n&&n.toLowerCase()===e.toLowerCase()})),attr:(e,t,n,r)=>r.filter((r=>{const i=r.attrs[e];if(!t)return void 0!==i;if(void 0===i)return!1;switch(t){case"=":return n===String(i);case"!=":return n!==String(i);default:return!1}})),universal:e=>e,tag:(e,t)=>t.filter((t=>{const n=t.tag;return!!n&&-1!==n.trim().split(/\s+/).indexOf(e.replace(".",""))}))};function Kce(e,t){if(!t||!t.length||!e||"function"!=typeof Yce[e.type])return[];switch(e.type){case"type":case"tag":return Yce[e.type](e.value,t);case"attr":return Yce[e.type](e.attribute,e.operator,e.attributeValue,t);case"universal":return Yce[e.type](t);default:return[]}}var Xce={find:function(e,t){const n=[],r=[];let i,o;if(t.isBranch){let a;i=function(e){const t=[];let n,r,i,o;return e.split(/\s*,\s*/).forEach((e=>{e=e.trim(),n=[];const a=t=>{i=e.match(Gce[t]),i&&(o=!0,e=e.slice(i[0].length),r={type:t,value:i[0]},"attr"===t&&(i=i[0].match(/\[(\w[\w\._-]+)?(?:([!]?=)['\"]([\w\s#_-]*)['\"])?\]/),r.attribute=i[1],r.operator=i[2],r.attributeValue=i[3]),n.push(r))};for(;e&&(o=!1,i=e.match(/^\s*([>+~]|\s)\s*/),i&&(o=!0,n.push({type:" ",value:i[0]}),e=e.slice(i[0].length)),Object.keys(Gce).forEach(a),n&&n.length&&t.indexOf(n)<0&&t.push(n),o););})),t}(e),o=t.descendants;for(let e=0,t=i.length;e<t;e++){a=i[e];const t=[];let n=o.slice(),s=!1;a.reverse().forEach((e=>{if(" "===e.type)return t.push(n),n=o.slice(),void(s=!1);n=Kce(e,n),s=!0})),s&&t.push(n);const l=t[0].filter((e=>{let n,r=e.parent;for(let e=1;e<t.length;e++){for(n=t[e].indexOf(r);r&&n<0;)r=r.parent,n=t[e].indexOf(r);if(n<0)return!1}return!0}));r.push(l)}for(let e=0,t=r.length;e<t;e++)for(let t=0,i=r[e].length;t<i;t++)n.indexOf(r[e][t])<0&&n.push(r[e][t])}return n||[]}};function Jce(e,t,n){const r=e.type;let i=e.points();n&&(i=i.every((e=>Array.isArray(e)))?i.map((e=>n.transformPoints(e))):n.transformPoints(i)),function(e,t){for(let n=0,r=e.length;n<r;n++)e[n].x/=t,e[n].y/=t}(i,t);let o=null;if("rect"===r||"bounds"===r)o=g8(i),o.type=r;else if("circle"===r)o=function(e,t){return{cx:e[0].x,cy:e[0].y,r:t}}(i,e.r),o.type=r;else if("line"===r)o=y8(i),o.type=r;else if("polygon"===r||"polyline"===r){o={type:"path",d:jre(i,"polygon"===r)}}else if("geopolygon"===r){let e="";for(let t=0;t<i.length;t++)e+=jre(i[t],!0);o={type:"path",d:e}}return o}class Qce{constructor(e){this._bounds=function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const{x:n,y:r,width:i,height:o}=e.boundingRect?e.boundingRect(t):{x:0,y:0,width:0,height:0};return{x:n,y:r,width:i,height:o}},this._attrs=e.attrs,this._type=e.type,this._data=e.data,this._dpi=e.stage?e.stage.dpi:1,this._collider=()=>function(e,t){if(e.collider){const n=e.modelViewMatrix;return"collection"===e.colliderType?{type:"container",children:e.collider.geometries.map((e=>Jce(e,t,n)))}:Jce(e.collider,t,n)}return null}(e,this._dpi),this._desc=e.desc,this._tag=e.tag,this._children=()=>e.children.map((e=>new Qce(e))),this._parent=()=>e.parent?new Qce(e.parent):null,this._cache={elementBoundingRect:null},this._getElementBoundingRect=()=>(!this._cache.elementBoundingRect&&this.element&&(this._cache.elementBoundingRect=this.element.getBoundingClientRect()),this._cache.elementBoundingRect||{left:0,top:0})}get children(){return this._children()}get parent(){return this._parent()}get type(){return this._type}get data(){return this._data}get attrs(){return this._attrs}set element(e){this._cache.elementBoundingRect=null,this._element=e}get element(){return this._element}set key(e){this._key=e}get key(){return this._key}get bounds(){const e=this._bounds();return e.x/=this._dpi,e.y/=this._dpi,e.width/=this._dpi,e.height/=this._dpi,e}get localBounds(){return this._bounds(!1)}boundsRelativeTo(e){const t=typeof e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.bounds:this.localBounds,r=this._getElementBoundingRect();let i=r.left,o=r.top;if("object"===t&&null!==e&&"function"==typeof e.getBoundingClientRect){const{left:t=0,top:n=0}=e.getBoundingClientRect();i-=t,o-=n}return n.x+=i,n.y+=o,n}get collider(){return this._collider()}get desc(){return this._desc}get tag(){return this._tag}}function Zce(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Qce(...t)}class eue{constructor(e){this._node=Zce(e),this._parent=null,this._input=null}get node(){return this._node}set parent(e){this._parent=e}get parent(){return this._parent}set input(e){this._input=e}get input(){return this._input}}function tue(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new eue(...t)}function nue(e,t){const n=e.parent;if(n&&"stage"!==n.type){t.parent=tue(n);const e=n.parent;e&&"stage"!==e.type&&nue(e,t.parent)}}function rue(e,t,n){if(null===e.colliderType)return null;const r=function(e,t){let n={};if(e.modelViewMatrix)if(Array.isArray(t))n=e.inverseModelViewMatrix.transformPoints(t);else if(isNaN(t.r))Array.isArray(t.vertices)?n.vertices=e.inverseModelViewMatrix.transformPoints(t.vertices):n=e.inverseModelViewMatrix.transformPoint(t);else{const r={x:t.cx,y:t.cy};({x:n.cx,y:n.cy}=e.inverseModelViewMatrix.transformPoint(r)),n.r=t.r}else n=t;return Array.isArray(n.vertices)&&(n=n.vertices.every((e=>Array.isArray(e)))?Tce(n):Pce(n)),n}(e,n);return"frontChild"===e.colliderType?function(e,t,n){for(let r=e.descendants.length-1;r>=0;r--){const i=e.descendants[r];if(null!==i.collider&&i.collider[t](n)){const e=tue(i);return nue(i,e),e}}return null}(e,t,r):function(e,t,n){if(e.collider[t](n)){const t=tue(e);return nue(e,t),t}return null}(e,t,r)}function iue(e,t,n,r){const i=e.length;for(let o=0;o<i;o++){const i=e[o],a=rue(i,t,r);a&&n.push(a),!i.children||a||i.collider||iue(i.children,t,n,r)}}function oue(e,t,n){const r=e.length;for(let i=0;i<r;i++){const r=e[i];if(null!==rue(r,t,n))return!0;if(r.children&&!r.collider)return oue(r.children,t,n)}return!1}function aue(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;let n={};switch(v8(e)){case"circle":return n.cx=e.cx*t,n.cy=e.cy*t,n.r=e.r,["intersectsCircle",n];case"rect":return n=m8(e).map((e=>Vre(e,t))),["intersectsRect",n];case"line":return n=p8(e).map((e=>Vre(e,t))),["intersectsLine",n];case"point":return n=Vre(e,t),["containsPoint",n];case"polygon":return n.vertices=e.vertices.map((e=>Vre(e,t))),["intersectsPolygon",n];case"geopolygon":return n.vertices=e.vertices.map((e=>e.map((e=>Vre(e,t))))),["intersectsGeoPolygon",n];default:return[]}}function sue(e,t){const[n,r]=aue(t,e.dpi),i=[];return n&&(iue([e],n,i,r),function(e,t){for(let n=0,r=t.length;n<r;n++)t[n].input=e}(t,i)),i}function lue(e,t){const[n,r]=aue(t,e.dpi);return oue([e],n,r)}class cue extends Mce{constructor(e){super(e),this._stage=null,this._collider={type:null,definition:null,fn:null},this._attrs={},this._node=null}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.node=e;const{data:t,desc:n,tag:r,strokeReference:i,fillReference:o}=e;!function(e,t){Object.keys(Nre).forEach((n=>{const r=t[n];void 0!==r&&(e[Nre[n]]=r)}))}(this.attrs,e),void 0!==t&&(this.data=t),"object"==typeof n&&(this.desc=o8(!0,{},n)),"string"==typeof r&&(this.tag=r),"string"==typeof i&&(this.strokeReference=i),"string"==typeof o&&(this.fillReference=o)}findShapes(e){return Xce.find(e,this).map((e=>Zce(e)))}getItemsFrom(e){return sue(this,e)}containsPoint(e){return lue(this,e)}intersectsLine(e){return lue(this,e)}intersectsRect(e){return lue(this,e)}intersectsCircle(e){return lue(this,e)}intersectsPolygon(e){return lue(this,e)}intersectsGeoPolygon(e){return lue(this,e)}resolveLocalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Fce;void 0!==this.attrs.transform&&Uce(this.attrs.transform,e),this.modelViewMatrix=e.clone()}resolveGlobalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Fce;const t=this.ancestors;if(t.length>0)for(let n=t.length-1;n>=0;n--)t[n].resolveLocalTransform(e),e=t[n].modelViewMatrix;this.resolveLocalTransform(e)}attr(e){return this.attrs[e]}equals(e){const t=this.attrs,n=Object.keys(t),r=e.attrs,i=Object.keys(r);if(n.length!==i.length)return!1;for(let e=0;e<n.length;e++){const i=n[e];if(!Object.hasOwnProperty.call(r,i))return!1;if(t[i]!==r[i])return!1}return super.equals(e)}toJSON(){const e=super.toJSON();return e.attrs=this.attrs,e}get attrs(){return this._attrs}get stage(){return this._parent&&!this._stage?this._stage=this._parent.stage:this._parent||this._stage===this||(this._stage=null),this._stage}set modelViewMatrix(e){this._mvm=e,this._imvm=null}get modelViewMatrix(){return this._mvm}get inverseModelViewMatrix(){return this._imvm=this._imvm?this._imvm:this._mvm.clone().invert(),this._imvm}set node(e){this._node=e}get node(){return this._node}set collider(e){const t=Array.isArray(e)?"collection":e&&e.type;return"string"!=typeof t?(this._collider.type=null,this._collider.definition=null,void(this._collider.fn=null)):null!==this._collider&&this._collider.type===t&&null!==this._collider.fn?(this._collider.fn.set(e),void(this._collider.definition=e)):(this._collider.type=t,void(this._collider.definition=e))}get collider(){if(null!==this._collider.fn)return this._collider.fn;switch(this._collider.type){case"collection":this._collider.fn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new zce(...t)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=jce("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=jce(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn}get colliderType(){return this._collider.type}}class uue extends Mce{addChild(e){if(!(e&&e instanceof Mce))throw new TypeError("Expecting a Node as argument, but got ".concat(e));if(e===this)throw new Error("Can not add itself as child!");if(e._children&&e._children.length&&this.ancestors.indexOf(e)>=0)throw new Error("Can not add an ancestor as child!");return e._parent&&e._parent!==this&&e._parent.removeChild(e),this._children.push(e),e._parent=this,e._ancestors=null,this}addChildren(e){let t,n=e?e.length:0;for(t=0;t<n;t++)this.addChild(e[t]);return this}removeChild(e){const t=this._children.indexOf(e);return t>=0&&(this._children.splice(t,1),e._parent=null,e._ancestors=null),this}removeChildren(e){let t,n;if(!this._children)return this;if(e)for(n=e.length,t=0;t<n;t++)this.removeChild(e[t]);else for(;this._children.length;)this.removeChild(this._children[0]);return this}}const due=uue.prototype;class fue extends cue{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const{collider:t}=e,n=o8({type:null},t);this.collider=n,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}appendChildRect(e,t){if(void 0!==e.bounds){const n=this.__boundingRect[t]||{},[r,,i]=e.bounds(t),{x:o,y:a}=r,{x:s,y:l}=i,c=isNaN(n.width)?s:Math.max(s,n.width+n.x),u=isNaN(n.height)?l:Math.max(l,n.height+n.y);n.x=isNaN(n.x)?o:Math.min(o,n.x),n.y=isNaN(n.y)?a:Math.min(a,n.y),n.width=c-n.x,n.height=u-n.y,this.__boundingRect[t]=n}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.children.length;for(let n=0;n<t;n++)this.appendChildRect(this.children[n],e);return this.__boundingRect[e]=o8({x:0,y:0,width:0,height:0},this.__boundingRect[e]),this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}addChild(e){const t=due.addChild.call(this,e);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(e,!0);const t=o8({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}addChildren(e){const t=due.addChildren.call(this,e),n=e.length;if(this._collider&&"bounds"===this._collider.type&&n>0){for(let t=0;t<n;t++)this.appendChildRect(e[t],!0);const t=o8({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;if(due.removeChild.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=o8(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}removeChildren(e){if(due.removeChildren.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=o8(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}}function hue(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new fue(...t)}class pue extends fue{constructor(e){super("stage"),this._stage=this,this._dpiRatio=e||1}get dpi(){return this._dpiRatio}}const mue=uue.prototype,gue=["x1","x2","y1","y2","id","offset","style"];class yue extends cue{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let r=0,i=gue.length;r!==i;r++)n=gue[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return mue.addChild.call(this,e)}addChildren(e){return mue.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return mue.removeChild.call(this,e),this}removeChildren(e){return mue.removeChildren.call(this,e),this}}function vue(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new yue(...t)}const bue=uue.prototype,xue=["patternUnits","x","y","width","height","id"];class wue extends cue{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let r=0,i=xue.length;r!==i;r++)n=xue[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return bue.addChild.call(this,e)}addChildren(e){return bue.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return bue.removeChild.call(this,e),this}removeChildren(e){return bue.removeChildren.call(this,e),this}}class Sue extends cue{constructor(){super("rect"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,width:r=0,height:i=0,rx:o=0,ry:a=0,collider:s}=e,l=o8({type:"rect",x:t,y:n,width:r,height:i},s);super.set(e),r>=0?(this.attrs.x=t,this.attrs.width=r):(this.attrs.x=t+r,this.attrs.width=-r),i>=0?(this.attrs.y=n,this.attrs.height=i):(this.attrs.y=n+i,this.attrs.height=-i),o>0&&(this.attrs.rx=o),a>0&&(this.attrs.ry=a),this.collider=l,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=m8(this.attrs),n=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t,[r,i,o,a]=h8(n);return this.__boundingRect[e]={x:r,y:i,width:o-r,height:a-i},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}class Cue extends cue{constructor(){super("circle"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{cx:t=0,cy:n=0,r:r=0,collider:i}=e,o=o8({type:"circle",cx:t,cy:n,r:r},i);super.set(e),this.attrs.cx=t,this.attrs.cy=n,this.attrs.r=r,this.collider=o,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.bounds(e);return this.__boundingRect[e]={x:t[0].x,y:t[0].y,width:t[2].x-t[0].x,height:t[2].y-t[0].y},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const{cx:t,cy:n,r:r,r:i}=this.attrs,o=t-r,a=n-i;let s=2*r,l=2*i,c=[{x:o,y:a},{x:o+s,y:a},{x:o+s,y:a+l},{x:o,y:a+l}];if(e&&this.modelViewMatrix){c=this.modelViewMatrix.transformPoints(c);const[t,n,r,i]=h8(c);s=r-t,l=i-n,this.__bounds[e]=[{x:t,y:n},{x:t+s,y:n},{x:t+s,y:n+l},{x:t,y:n+l}]}else this.__bounds[e]=c;return this.__bounds[e]}}class kue extends cue{constructor(){super("line"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x1:t=0,y1:n=0,x2:r=0,y2:i=0,collider:o}=e;super.set(e),this.attrs.x1=t,this.attrs.y1=n,this.attrs.x2=r,this.attrs.y2=i;const a={type:"line",x1:t,y1:n,x2:r,y2:i};this.collider=o8(a,o),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];let t=p8(this.attrs);e&&this.modelViewMatrix&&(t=this.modelViewMatrix.transformPoints(t));const[n,r,i,o]=h8(t),a=n!==i||r!==o;return this.__boundingRect[e]={x:n,y:r,width:a?Math.max(1,i-n):0,height:a?Math.max(1,o-r):0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}const Eue=Math.PI/2;function Mue(e,t){const n=Math.atan2(t.y-e.y,t.x-e.x);return n<0?n+2*Math.PI:n}function _ue(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}const Rue={step:function(e){return new g7(e,.5)},stepAfter:function(e){return new g7(e,1)},stepBefore:function(e){return new g7(e,0)},linear:G8,basis:function(e){return new t7(e)},cardinal:i7.tension(0),catmullRom:a7,monotonex:function(e){return new d7(e)},monotoney:function(e){return new f7(e)},natural:function(e){return new p7(e)}};function Iue(e){if(e.length<2)return!1;const t=e[0],n=e[e.length-1];return Math.abs(t.x-n.x)<1e-12&&Math.abs(t.y-n.y)<1e-12}class Due extends cue{constructor(){super("path"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(super.set(e),this.segments=[],this.points=[],e.arcDatum){const t=H8();t.innerRadius(e.desc.slice.innerRadius),t.outerRadius(e.desc.slice.outerRadius),t.cornerRadius(e.desc.slice.cornerRadius);const n=t(e.arcDatum);this.attrs.d=n}else if(e.points){const{major:t,minor:n,layerObj:r,points:i,stngs:o,generatorType:a}=e,s=X8(),l=o.coordinates?o.coordinates.defined:null;s[t.p]((e=>e.major*t.size))["".concat(n.p,"1")]((e=>e.minor*n.size))["".concat(n.p,"0")]((e=>e.minor0*n.size)).curve(Rue["monotone"===r.curve?"monotone".concat(t.p):r.curve]),l?s.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)&&e.defined)):s.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)));const c=o.connect?i.filter(s.defined()):i,u=("area"===a?s:s[a]())(c);this.attrs.d=u}else e.d&&(this.attrs.d=e.d);if(this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},Array.isArray(e.collider)||"object"==typeof e.collider&&void 0!==e.collider.type)this.collider=e.collider;else if(this.attrs.d){if(this.segments=Cce(this.attrs.d),this.segments.length>1&&this.segments.every((e=>Iue(e))))return void(this.collider=o8({type:"geopolygon",vertices:this.segments},e.collider));this.segments.forEach((t=>{if(t.length<=1);else if(Iue(t))this.collider=o8({type:"polygon",vertices:t},e.collider);else if("object"==typeof e.collider&&e.collider.visual){const n=this.attrs["stroke-width"]/2;this.collider=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=[],i=[];if("h"===n.forceOrientation){const t=e[0].x<e[1].x?-1:1,n=e[e.length-1].x>e[e.length-2].x?1:-1;e.unshift({x:e[0].x+t,y:e[0].y}),e.push({x:e[e.length-1].x+n,y:e[e.length-1].y})}else if("v"===n.forceOrientation){const t=e[0].y<e[1].y?-1:1,n=e[e.length-1].y>e[e.length-2].y?1:-1;e.unshift({x:e[0].x,y:e[0].y+t}),e.push({x:e[e.length-1].x,y:e[e.length-1].y+n})}const o=e.length-1;for(let n=1;n<o;n++){const a=e[n-1],s=e[n],l=e[n+1],c=Mue(s,a),u=Mue(s,l),d=(c+u)/2,f=d+Math.PI,h=Math.max(d,f),p=Math.min(d,f),m=c>u;if(1===n){const e=Mue(a,s);r.push(_ue(a,e-Eue,t)),i.unshift(_ue(a,e+Eue,t))}const g=m?h:p,y=m?p:h;if(r.push(_ue(s,g,t)),i.unshift(_ue(s,y,t)),n===o-1){const e=Mue(l,s);r.push(_ue(l,e+Eue,t)),i.unshift(_ue(l,e-Eue,t))}}return{type:"polygon",vertices:[...r,...i]}}(t,n,e.collider)}else this.collider=o8({type:"polyline",points:t},e.collider)}))}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];this.points.length||(this.segments=this.segments.length?this.segments:Cce(this.attrs.d),this.points=function(e){const t=[];let n,r=e.length;for(let i=0;i<r;i++){n=e[i];for(let e=0;e<n.length;e++)t.push(n[e])}return t}(this.segments));const t=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(this.points):this.points,[n,r,i,o]=h8(t);return this.__boundingRect[e]={x:n||0,y:r||0,width:i-n||0,height:o-r||0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}function Pue(e){let{data:t,_boundingRect:n,_textBoundsFn:r}=e;return null!=t&&(n||r)}let Aue=class extends cue{constructor(){super("text"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,dx:r=0,dy:i=0,textBoundsFn:o,text:a,title:s,collider:l,boundingRect:c,ellipsed:u}=e;super.set(e),this.attrs.x=t,this.attrs.y=n,this.attrs.dx=r,this.attrs.dy=i,this.attrs.text=a,void 0!==s&&(this.attrs.title=String(s)),"object"==typeof c?this._textBoundsFn=()=>c:"function"==typeof o&&(this._textBoundsFn=o),"string"==typeof u&&(this.ellipsed=u),this.collider=o8({type:Pue(this)?"bounds":null},l),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];if("function"!=typeof this._textBoundsFn)return{x:0,y:0,width:0,height:0};e=this._textBoundsFn(this.attrs);const n=m8(e),r=t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(n):n,[i,o,a,s]=h8(r);return this.__boundingRect[t]={x:i,y:o,width:a-i,height:s-o},this.__boundingRect[t]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}};class Oue extends cue{constructor(){super("image"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,width:r=0,height:i=0,rx:o=0,ry:a=0,src:s,collider:l,cx:c=0,cy:u=0,r:d=0,opacity:f,imageScalingFactor:h,imagePosition:p,symbol:m}=e;let g;g="circle"===e.symbol?o8({type:"circle",cx:c,cy:u,r:d},l):o8({type:"bounds",x:t,y:n,width:r,height:i},l),super.set(e),r>=0?(this.attrs.x=t,this.attrs.width=r):(this.attrs.x=t+r,this.attrs.width=-r),i>=0?(this.attrs.y=n,this.attrs.height=i):(this.attrs.y=n+i,this.attrs.height=-i),o>0&&(this.attrs.rx=o),a>0&&(this.attrs.ry=a),s&&(this.attrs.src=s),this.attrs.r=d,this.attrs.cx=c,this.attrs.cy=u,this.attrs.opacity=void 0!==f?f:1,this.attrs.imageScalingFactor=void 0!==h?h:1,this.attrs.imagePosition=p||"center-center",this.attrs.symbol=m||"rectangle",this.collider=g,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},e.collider||(this.attrs.updateCollider=this.updateCollider.bind(this))}updateCollider(e){let t;t="circle"===e.symbol?o8(this.collider,{type:"circle",cx:e.cx,cy:e.cy,r:e.r}):o8(this.collider,{type:"bounds",x:e.x,y:e.y,width:e.width,height:e.height}),this.collider=t}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=m8(this.attrs),n=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t,[r,i,o,a]=h8(n);return this.__boundingRect[e]={x:r,y:i,width:o-r,height:a-i},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];if("circle"===this._node.symbol){const t=this.boundingRect(e),n=Math.min(t.width,t.height)/2,r=t.x-n,i=t.y-n;let o=2*n,a=2*n,s=[{x:r,y:i},{x:r+o,y:i},{x:r+o,y:i+a},{x:r,y:i+a}];if(e&&this.modelViewMatrix){s=this.modelViewMatrix.transformPoints(s);const[t,n,r,i]=h8(s);o=r-t,a=i-n,this.__bounds[e]=[{x:t,y:n},{x:t+o,y:n},{x:t+o,y:n+a},{x:t,y:n+a}]}else this.__bounds[e]=s;return this.__bounds[e]}const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}const Lue=S7();function Tue(e,t){return Lue.get(e)(t)}Lue.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Sue(...t)})),Lue.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Cue(...t)})),Lue.add("text",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Aue(...t)})),Lue.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new kue(...t)})),Lue.add("path",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Due(...t)})),Lue.add("stage",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new pue(...t)})),Lue.add("container",hue),Lue.add("defs",hue),Lue.add("linearGradient",vue),Lue.add("radialGradient",vue),Lue.add("conicGradient",vue),Lue.add("stop",vue),Lue.add("pattern",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new wue(...t)})),Lue.add("image",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Oue(...t)}));const que=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=[{}];function n(){return t[t.length-1]}return n.save=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i=n(),o={};let a="";for(let t=0;t<e.length;t++)a=e[t],void 0!==i[a]&&(o[a]=i[a]);return o8(o,r),t.push(o),n()},n.restore=function(){t.splice(t.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function Nue(e,t){if(Array.isArray(t))for(let n=0,r=t.length;n<r;n++)t[n](e)}function jue(e,t,n){e.node=n[t],e.index=t}function zue(e,t,n,r){let i=!1;const o={siblings:e,node:null,index:0};for(let a=0,s=e.length;a<s;a++){if(jue(o,a,e),Nue(o,r.create),i="function"==typeof o.node.disabled?o.node.disabled():o.node.disabled,i)continue;o.node=que.save(o.node);const s=Tue(o.node.type,o.node);s&&(o.node.transform&&(n.save(),Uce(o.node.transform,n)),n.isIdentity()||(s.modelViewMatrix=n.clone()),t.addChild(s),o.node.children&&zue(o.node.children,s,n,r),o.node.transform&&n.restore()),que.restore()}}function Fue(e){let{items:t,stage:n,dpi:r,on:i={}}=e;return n||(n=Tue("stage",r)),zue(t,n,new Fce,i),n}function Wue(e,t,n){const{orientation:r,degree:i,stops:o=[]}=n;let a=null;if("radial"===r){const n=t.boundingRect();a=e.createRadialGradient(n.x+n.width/2,n.y+n.height/2,1e-5,n.x+n.width/2,n.y+n.height/2,Math.max(n.width,n.height)/2)}else if("conic"===r){const t=n.startAngle||0,r=n.x||0,i=n.y||0;a=e.createConicGradient(t,r,i)}else{const r=Wre(i);["x1","x2","y1","y2"].forEach((e=>{e in n&&(r[e]=n[e])}));const o=t.boundingRect();a=e.createLinearGradient(o.x+r.x1*o.width,o.y+r.y1*o.height,o.x+r.x2*o.width,o.y+r.y2*o.height)}for(let e=0,t=o.length;e<t;e++){let t=o[e];a.addColorStop(t.offset,t.color)}return a}function $ue(e,t,n){return t.width=e.width,t.height=e.height,n.save(),n.fillStyle=e.fill,e.shapes.forEach((e=>{if("rect"===e.type)n.rect(e.x,e.y,e.width,e.height)})),n.fill(),n.restore(),n.createPattern(t,"repeat")}function Bue(){let{x:e,y:t,width:n,height:r,scaleRatio:i,margin:o,edgeBleed:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const s={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0},edgeBleed:{left:0,right:0,top:0,bottom:0,bool:!1}};return s.x=isNaN(e)?s.x:e,s.y=isNaN(t)?s.y:t,s.width=isNaN(n)?s.width:n,s.height=isNaN(r)?s.height:r,void 0!==i&&(s.scaleRatio.x=isNaN(i.x)?s.scaleRatio.x:i.x,s.scaleRatio.y=isNaN(i.y)?s.scaleRatio.y:i.y),void 0!==o&&(s.margin.left=isNaN(o.left)?0:o.left,s.margin.top=isNaN(o.top)?0:o.top),"object"==typeof a&&["left","right","top","bottom"].forEach((e=>{!isNaN(a[e])&&a[e]>0&&(s.edgeBleed[e]=a[e],s.edgeBleed.bool=!0)})),s.computedPhysical={x:Math.round(s.margin.left+(s.x-s.edgeBleed.left)*s.scaleRatio.x),y:Math.round(s.margin.top+(s.y-s.edgeBleed.top)*s.scaleRatio.y),width:Math.round((s.width+s.edgeBleed.left+s.edgeBleed.right)*s.scaleRatio.x),height:Math.round((s.height+s.edgeBleed.top+s.edgeBleed.bottom)*s.scaleRatio.y)},s}function Vue(){const e={element:()=>{},root:()=>{},settings:()=>{},appendTo:()=>{},getScene:()=>[],render:()=>!1,itemsAt:()=>[],findShapes:()=>[],clear:()=>{},destory:()=>{},size:()=>{},measureText:mle,textBounds:yle,setKey:t=>{e.element().setAttribute("data-key",t)}};return e}function Hue(e){return t=>{let{node:n}=t;"text"!==n.type||null==n.data||n.textBoundsFn||(n.textBoundsFn=e.textBounds)}}const Uue=200,Gue=200;class Yue{constructor(e){this.targetCanvas=e,this.bufferCanvas=e.cloneNode()}updateSize(e){let t,{rect:n,dpiRatio:r,canvasBufferSize:i}=e;t=i?"function"==typeof i?i(n):i:{width:n.computedPhysical.width+2*Uue,height:n.computedPhysical.height+2*Gue},this.bufferCanvas.style.width="".concat(t.width,"px"),this.bufferCanvas.style.height="".concat(t.height,"px"),this.bufferCanvas.width=Math.round(t.width*r),this.bufferCanvas.height=Math.round(t.height*r)}apply(){this.targetCanvas.getContext("2d").drawImage(this.bufferCanvas,0,0)}clear(){this.bufferCanvas.width=this.bufferCanvas.width}getContext(){return this.bufferCanvas.getContext("2d")}}const Kue=S7();function Xue(e){return Array.isArray(e)?e:"string"==typeof e?-1!==e.indexOf(",")?e.split(","):e.split(" "):[]}function Jue(e){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}function Que(e,t){t.setTransform(e[0][0],e[1][0],e[0][1],e[1][1],e[0][2],e[1][2])}function Zue(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=Object.keys(r);for(let i=0,o=n.length;i<o;i++){let o=n[i];const a=o[0],s=o[1],l=o[2];if(a in t.attrs&&!(s in r)&&e[s]!==t.attrs[a]){const n=l?l(t.attrs[a]):t.attrs[a];"function"==typeof e[s]?e[s](n):e[s]=n}}for(let t=0,n=i.length;t<n;t++){const n=i[t];e[n]=r[n]}}function ede(e,t,n,r){for(let i=0,o=e.length;i<o;i++){let o=e[i],a={};t.save(),o.attrs&&(o.attrs.fill||o.attrs.stroke)&&(o.attrs.fill&&"object"==typeof o.attrs.fill&&"gradient"===o.attrs.fill.type?a.fillStyle=Wue(t,o,o.attrs.fill):o.attrs.fill&&"object"==typeof o.attrs.fill&&"pattern"===o.attrs.fill.type&&(a.fillStyle=r.patterns.create(o.attrs.fill)),o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"gradient"===o.attrs.stroke.type?a.strokeStyle=Wue(t,o,o.attrs.stroke):o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"pattern"===o.attrs.stroke.type&&(a.strokeStyle=r.patterns.create(o.attrs.stroke))),Zue(t,o,n,a),o.modelViewMatrix&&Que(o.modelViewMatrix.elements,t),Kue.has(o.type)&&Kue.get(o.type)(o.attrs,{g:t,doFill:"fill"in o.attrs&&"none"!==o.attrs.fill,doStroke:"stroke"in o.attrs&&0!==o.attrs["stroke-width"],ellipsed:o.ellipsed}),o.children&&ede(o.children,t,n,r),t.restore()}}function tde(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Fue;const r={transform:void 0,canvasBufferSize:void 0,progressive:void 0};let i,o=!1,a=Bue();const s=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",Xue]];let l;const c=Vue();return c.element=()=>e,c.root=()=>e,c.settings=e=>(e&&Object.keys(r).forEach((t=>{void 0!==e[t]&&(r[t]=e[t])})),r),c.appendTo=n=>(e||(e=n.ownerDocument.createElement("canvas"),e.style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none"),"function"!=typeof r.transform||t||(t=new Yue(e)),n.appendChild(e),e),c.getScene=r=>{const i=Jue(t&&t.getContext()||e.getContext("2d")),o=a.scaleRatio.x,s=a.scaleRatio.y,l={type:"container",children:r,transform:a.edgeBleed.bool?"translate(".concat(a.edgeBleed.left*i*o,", ").concat(a.edgeBleed.top*i*s,")"):""};return 1===i&&1===o&&1===s||(l.transform+="scale(".concat(i*o,", ").concat(i*s,")")),n({items:[l],dpi:i,on:{create:[ole(c.measureText),Hue(c)]}})},c.render=n=>{if(!e)return!1;l||(l=function(e){const t=e.createElement("canvas"),n=t.getContext("2d");let r={};return{create(e){const i=e.key;return i?(r[i]=r[i]||$ue(e,t,n),r[i]):$ue(e,t,n)},clear(){r={}}}}(e.ownerDocument));const u=t&&t.getContext()||e.getContext("2d"),d=Jue(u),f=t&&r.transform();if(f)return e.width=e.width,function(e){let{el:t,dpiRatio:n,transform:r}=e;if("object"==typeof r){const e=[r.horizontalScaling,r.horizontalSkewing,r.verticalSkewing,r.verticalScaling,r.horizontalMoving*n,r.verticalMoving*n];t.getContext("2d").setTransform(...e)}}({el:e,dpiRatio:d,transform:f}),t.apply(),!0;o&&(e.style.left="".concat(a.computedPhysical.x,"px"),e.style.top="".concat(a.computedPhysical.y,"px"),e.style.width="".concat(a.computedPhysical.width,"px"),e.style.height="".concat(a.computedPhysical.height,"px"),e.width=Math.round(a.computedPhysical.width*d),e.height=Math.round(a.computedPhysical.height*d),t&&t.updateSize({rect:a,dpiRatio:d,canvasBufferSize:r.canvasBufferSize}));const h=c.getScene(n),p=!i||!h.equals(i);l.clear();const m=o||p,g="function"==typeof r.progressive&&r.progressive();return m&&(g&&!g.isFirst||c.clear(),ede(h.children,u,s,{patterns:l})),t&&(e.width=e.width,t.apply()),o=!1,g&&!g.isFirst&&h.children.unshift(...i.children),i=h,m},c.itemsAt=e=>i?i.getItemsFrom(e):[],c.findShapes=e=>i?i.findShapes(e):[],c.clear=()=>(e&&(e.width=e.width),t&&t.clear(),i=null,c),c.size=e=>{if(e){const t=Bue(e);JSON.stringify(a)!==JSON.stringify(t)&&(o=!0,a=t)}return a},c.destroy=()=>{e&&(e.parentElement&&e.parentElement.removeChild(e),e=null),t&&(t=null),i=null},c}function nde(e,t){Kue.add(e,t)}function rde(e,t){return Math.max(0,Math.min(e,t))}const ide=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),ode=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),ade=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function sde(e){return ide.test(e)}function lde(e){return ode.test(e)||ade.test(e)}function cde(e){let t,n,r=e?e.length:0;for(t=0;t<r;t++){if(n=e[t],sde(n))return"ltr";if(lde(n))return"rtl"}return"ltr"}const ude={start:"end",end:"start",center:"center",middle:"middle"};function dde(e,t){return"rtl"===t?ude[e]:e}function fde(e,t){if(fde.cache[e])return void t(fde.cache[e]);const n=new Image;n.src=e,n.onload=()=>{fde.cache[e]=n,t(n)},n.onerror=e=>{console.error("Image load error",e)}}function hde(e,t){const n=[];let r;const i=[],o=[],a=[];let s,l;const c=e=>e.id,u=(e,t)=>{let n;return n="object"==typeof e?"id"in e?e.id:t:e,{content:e,id:"".concat(n,"__").concat(e.type||"")}};e.isTree||(e=e.map(u)),t=t.map(u),s=e.map(c),l=t.map(c);for(let e=0,r=t.length;e<r;e++){-1===s.indexOf(t[e].id)?n.push(t[e]):o.push(t[e])}for(let t=0,n=e.length;t<n;t++){-1===l.indexOf(e[t].id)?i.push(e[t]):a.push(e[t])}for(let e=0,t=n.length;e<t;e++)n[e].content.children&&(n[e].diff=hde([],n[e].content.children),n[e].children=n[e].diff.updatedNew.concat(n[e].diff.added),n[e].children.isTree=!0);for(let e=0,t=o.length;e<t;e++)o[e].diff=hde(a[e].children||[],o[e].content.children||[]),o[e].object=a[e].object,o[e].children=o[e].diff.items;return r=o.concat(n),n.isTree=!0,i.isTree=!0,o.isTree=!0,a.isTree=!0,r.isTree=!0,{added:n,updatedNew:o,updatedOld:a,removed:i,items:r}}function pde(e,t,n){for(let r=0,i=e.length;r<i;r++)e[r].object=n(e[r].content.type,t)}function mde(e,t){for(let n=0,r=e.length;n<r;n++)null!==e[n].object&&void 0!==e[n].object&&(t(e[n].object),e[n].object=null)}function gde(e,t,n,r){let i;for(let o=0,a=e.length;o<a;o++)i=e[o],null!==i.object&&void 0!==i.object&&(n(i.object,i.content),i.diff&&(pde(i.diff.added,i.object,t),mde(i.diff.removed,r),gde(i.diff.items,t,n,r)))}function yde(e,t,n,r,i,o){const a=hde(e,t);return pde(a.added,n,r),mde(a.removed,o),gde(a.items,r,i,o),a.items}fde.cache={},nde("rect",(function(e,t){let{g:n,doFill:r,doStroke:i}=t;n.beginPath(),e.rx>0||e.ry>0?function(e,t,n,r,i,o,a){o=rde(r/2,o>0?o:a),a=rde(i/2,a>0?a:o),e.moveTo(t,n+a),e.lineTo(t,n+i-a),e.quadraticCurveTo(t,n+i,t+o,n+i),e.lineTo(t+r-o,n+i),e.quadraticCurveTo(t+r,n+i,t+r,n+i-a),e.lineTo(t+r,n+a),e.quadraticCurveTo(t+r,n,t+r-o,n),e.lineTo(t+o,n),e.quadraticCurveTo(t,n,t,n+a)}(n,e.x,e.y,e.width,e.height,e.rx,e.ry):n.rect(e.x,e.y,e.width,e.height),r&&n.fill(),i&&n.stroke()})),nde("circle",(function(e,t){let{g:n,doFill:r,doStroke:i}=t;n.beginPath(),n.moveTo(e.cx+e.r,e.cy),n.arc(e.cx,e.cy,e.r,0,2*Math.PI,!1),r&&n.fill(),i&&n.stroke()})),nde("line",(function(e,t){let{g:n,doStroke:r}=t;n.beginPath(),n.moveTo(e.x1,e.y1),n.lineTo(e.x2,e.y2),r&&n.stroke()})),nde("path",(function(e,t){let{g:n,doStroke:r,doFill:i}=t;const o=new Path2D(e.d);i&&n.fill(o),r&&n.stroke(o)})),nde("text",(function(e,t){let{g:n,ellipsed:r,doStroke:i}=t;const o=r||ale(e,mle);n.font=[e["font-style"],e["font-weight"],e["font-size"],e["font-family"]].filter((e=>!!e)).join(" ");const a=cde(e.text);n.canvas.dir!==a&&(n.canvas.dir=a);const s=dde("middle"===e["text-anchor"]?"center":e["text-anchor"],n.canvas.dir);s&&n.textAlign!==s&&(n.textAlign=s);const l=sle(e);n.fillText(o,e.x+e.dx,e.y+e.dy+l),i&&n.strokeText(o,e.x+e.dx,e.y+e.dy+l)})),nde("image",(function(e,t){let{g:n}=t;const r=n.canvas,i=n.getTransform(),o=window.devicePixelRatio||1,a=r.clientWidth*o,s=r.clientHeight*o;r.width===a&&r.height===s||(r.width=a,r.height=s),fde(e.src,(t=>{if(n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,r.width,r.height),n.setTransform(i),n.globalAlpha=e.opacity,e.width||e.height||(e.width=t.naturalWidth*e.imageScalingFactor,e.height=t.naturalHeight*e.imageScalingFactor),function(e){const t=e.imagePosition||"center-center";let n=e.width,r=e.height;if("circle"===e.symbol){const t=Math.min(e.width,e.height)/2;n=2*t,r=2*t}switch(t){case"top-center":e.y-=r/2;break;case"center-left":e.x-=n/2;break;case"center-right":e.x+=n/2;break;case"top-left":e.x-=n/2,e.y-=r/2;break;case"top-right":e.x+=n/2,e.y-=r/2;break;case"bottom-left":e.x-=n/2,e.y+=r/2;break;case"bottom-right":e.x+=n/2,e.y+=r/2;break;case"bottom-center":e.y+=r/2}}(e),"circle"===e.symbol){const r=e.x,i=e.y;e.r=Math.min(e.width,e.height)/2;const o=r-e.width/2,a=i-e.height/2;n.save(),n.beginPath(),n.arc(r,i,e.r,0,2*Math.PI),n.clip(),n.drawImage(t,o,a,e.width,e.height),n.restore()}else e.x-=e.width/2,e.y-=e.height/2,n.drawImage(t,e.x,e.y,e.width,e.height);n.globalAlpha=1,e.updateCollider&&e.updateCollider(e)}))}));const vde="http://www.w3.org/2000/svg",bde=(e,t)=>{if(!e||"string"!=typeof e)throw new Error("Invalid type: ".concat(e));const n=t.ownerDocument.createElementNS(vde,"container"===e?"g":e);return t.appendChild(n),n},xde=e=>{e.parentNode&&e.parentNode.removeChild(e)};function wde(e){let{element:t,attrs:n}=e;return function(){const{width:e,height:r,imagePosition:i,imageScalingFactor:o,symbol:a}=n;let{x:s=0,y:l=0}=n,c=e>0?e:this.naturalWidth,u=r>0?r:this.naturalHeight;switch(o&&(c*=o,u*=o),i){case"top-center":l-=u/2;break;case"center-left":s-=c/2;break;case"center-right":s+=c/2;break;case"top-left":s-=c/2,l-=u/2;break;case"top-right":s+=c/2,l-=u/2;break;case"bottom-left":s-=c/2,l+=u/2;break;case"bottom-right":s+=c/2,l+=u/2;break;case"bottom-center":l+=u/2}if(t.setAttribute("width",c),t.setAttribute("height",u),t.setAttribute("x",s-c/2),t.setAttribute("y",l-u/2),t.setAttribute("preserveAspectRatio","none"),"circle"===a){const e=t.ownerSVGElement;if(!e)return;const n="clip-".concat(Math.random().toString(36).substr(2,9));if(!e.querySelector("#".concat(n))){const t=e.querySelector("defs")||e.insertBefore(document.createElementNS(vde,"defs"),e.firstChild),r=document.createElementNS(vde,"clipPath");r.setAttribute("id",n);const i=document.createElementNS(vde,"circle");i.setAttribute("cx",s),i.setAttribute("cy",l),i.setAttribute("r",Math.min(c,u)/2),r.appendChild(i),t.appendChild(r)}t.setAttribute("clip-path","url(#".concat(n,")"))}}}const Sde=(e,t)=>{if((e=>{switch(e.type){case"circle":return!isNaN(e.attrs.cx)&&!isNaN(e.attrs.cy)&&!isNaN(e.attrs.r);case"line":return!(isNaN(e.attrs.x1)||isNaN(e.attrs.y1)||isNaN(e.attrs.x2)||isNaN(e.attrs.y2));case"rect":return!(isNaN(e.attrs.x)||isNaN(e.attrs.y)||isNaN(e.attrs.width)||isNaN(e.attrs.height));case"text":case"image":return!isNaN(e.attrs.x)&&!isNaN(e.attrs.y);default:return!0}})(t)){for(const n in t.attrs)if("stroke"===n&&t.strokeReference)e.setAttribute("stroke",t.strokeReference);else if("fill"===n&&t.fillReference)e.setAttribute("fill",t.fillReference);else if("text"===n){e.setAttribute("style","white-space: pre"),e.textContent=t.ellipsed||ale(t.attrs,mle);const n=cde(t.attrs.text);"rtl"===n&&(e.setAttribute("direction","rtl"),e.setAttribute("dir","rtl"),e.setAttribute("text-anchor",dde(e.getAttribute("text-anchor"),n)))}else if("text"!==t.type||"dy"!==n&&"dominant-baseline"!==n)if("text"===t.type&&"title"===n&&t.attrs.title){const n=e.ownerDocument.createElementNS(vde,"title");n.textContent=t.attrs.title,e.appendChild(n)}else if("image"===t.type&&"src"===n){e.setAttributeNS("http://www.w3.org/1999/xlink","href",t.attrs.src);let n=new Image;n.src=t.attrs.src,n.onload=wde({element:e,attrs:t.attrs})}else e.setAttribute(n,t.attrs[n]);else{const r=+e.getAttribute(n)||0;let i=0;i="dominant-baseline"===n?sle(t.attrs):t.attrs[n],e.setAttribute("dy",i+r)}if("string"==typeof t.data||"number"==typeof t.data||"boolean"==typeof t.data)e.setAttribute("data",t.data);else if("object"==typeof t.data&&null!==t.data)for(const n in t.data)"string"!=typeof t.data[n]&&"number"!=typeof t.data[n]&&"boolean"!=typeof t.data[n]||e.setAttribute("data-".concat(n),t.data[n])}};class Cde{constructor(e,t,n,r){this.create=e,this.nodeCreator=t,this.nodeMaintainer=n,this.nodeDestroyer=r}render(e,t){return this.create([],e,t,this.nodeCreator,this.nodeMaintainer,this.nodeDestroyer)}}function kde(){return new Cde(yde,bde,Sde,xde)}function Ede(e){let t,n,r,i=0;if(0===(e=JSON.stringify(e)).length)return i;for(t=0,r=e.length;t<r;t++)n=e.charCodeAt(t),i=(i<<5)-i+n,i&=i;return i}function Mde(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:vde,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Fue;const n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:kde)();let r,i,o,a=!1,s=Bue();const l={transform:void 0,disableScreenReader:!1},c=Vue(),u={type:"defs",children:[]},d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ede,n={},r=Date.now();const i={onCreate(i){let o={};i.node&&"object"==typeof i.node.fill&&"pattern"===i.node.fill.type&&i.node.fill.shapes&&(o.fill=i.node.fill),i.node&&"object"==typeof i.node.stroke&&"pattern"===i.node.stroke.type&&i.node.stroke.shapes&&(o.stroke=i.node.stroke),Object.keys(o).forEach((a=>{let s="";const l=o[a],c=t(l),u="picasso-pattern-".concat(r,"-").concat(c);if("undefined"!=typeof window&&(s=window.location.href.split("#")[0]),!n[c]){const t={patternUnits:"userSpaceOnUse",x:0,y:0,width:l.width,height:l.height,type:"pattern",id:u,children:[],fill:l.fill};l.shapes.forEach((e=>{t.children.push(e)})),e.push(t),n[c]=!0}i.node["".concat(a,"Reference")]="url('".concat(s,"#").concat(u,"')")}))},clear(){n={}}};return i}(u.children),f=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ede,n={},r=Date.now();const i={getOrCreateGradient(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fill",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=t(i[o]),l="picasso-gradient-".concat(r,"-").concat(s);if(!n[s]){let{orientation:t,degree:r,stops:a=[]}=i[o],c={};void 0===r&&(r=90),"radial"===t?c.type="radialGradient":(c=Wre(r),["x1","x2","y1","y2"].forEach((e=>{e in i[o]&&(c[e]=i[o][e])})),c.type="linearGradient"),c.id=l,c.children=a.map((e=>{let{offset:t,color:n,opacity:r}=e;return{type:"stop",offset:"".concat(100*t,"%"),style:"stop-color:".concat(n,";stop-opacity:").concat(void 0!==r?r:1)}})),e.push(c),n[s]=l}return"url('".concat(a,"#").concat(l,"')")},onCreate(e){let t="";"undefined"!=typeof window&&(t=window.location.href.split("#")[0]);const n=e.node;n.fill&&"object"==typeof n.fill&&"gradient"===n.fill.type&&(n.fillReference=i.getOrCreateGradient(n,"fill",t)),n.stroke&&"object"==typeof n.stroke&&"gradient"===n.stroke.type&&(n.strokeReference=i.getOrCreateGradient(n,"stroke",t))},clear(){n={}}};return i}(u.children);return c.element=()=>r,c.root=()=>i,c.settings=e=>(e&&Object.keys(l).forEach((t=>{void 0!==e[t]&&(l[t]=e[t])})),l),c.appendTo=t=>(r||(r=t.ownerDocument.createElementNS(e,"svg"),r.style.position="absolute",r.style["-webkit-font-smoothing"]="antialiased",r.style["-moz-osx-font-smoothing"]="antialiased",r.style.pointerEvents="none",r.setAttribute("xmlns",e),i=t.ownerDocument.createElementNS(e,"g"),i.style.pointerEvents="auto",r.appendChild(i)),t.appendChild(r),r),c.getScene=e=>{const n=s.scaleRatio.x,r=s.scaleRatio.y,i={type:"container",children:Array.isArray(e)?[...e,u]:e,transform:s.edgeBleed.bool?"translate(".concat(s.edgeBleed.left*n,", ").concat(s.edgeBleed.top*r,")"):""};return 1===n&&1===r||(i.transform+="scale(".concat(n,", ").concat(r,")")),t({items:[i],on:{create:[e=>{e.node.fillReference=void 0,e.node.strokeReference=void 0},f.onCreate,d.onCreate,ole(c.measureText),Hue(c)]}})},c.render=e=>{if(!r)return!1;const t="function"==typeof l.transform&&l.transform();if(t){const{horizontalScaling:e,horizontalSkewing:n,verticalSkewing:r,verticalScaling:o,horizontalMoving:a,verticalMoving:s}=t;return i.style.transform="matrix(".concat(e,", ").concat(n,", ").concat(r,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}i.style.transform="";l.disableScreenReader&&r.setAttribute("aria-hidden",!0),a&&(r.style.left="".concat(s.computedPhysical.x,"px"),r.style.top="".concat(s.computedPhysical.y,"px"),r.setAttribute("width",s.computedPhysical.width),r.setAttribute("height",s.computedPhysical.height)),f.clear(),d.clear(),u.children.length=0;const h=c.getScene(e),p=!o||!h.equals(o),m=a||p;return m&&(c.clear(),n.render(h.children,i)),a=!1,o=h,m},c.itemsAt=e=>o?o.getItemsFrom(e):[],c.findShapes=e=>o?o.findShapes(e):[],c.clear=()=>{if(!i)return c;o=null;const e=i.cloneNode(!1);return r.replaceChild(e,i),i=e,c},c.destroy=()=>{r&&r.parentNode&&r.parentNode.removeChild(r),r=null,i=null},c.size=e=>{if(e){const t=Bue(e);JSON.stringify(s)!==JSON.stringify(t)&&(a=!0,s=t)}return s},c}var _de,Rde,Ide,Dde,Pde,Ade,Ode,Lde={},Tde=[],qde=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function Nde(e,t){for(var n in t)e[n]=t[n];return e}function jde(e){var t=e.parentNode;t&&t.removeChild(e)}function zde(e,t,n){var r,i,o,a={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?_de.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return Fde(e,a,r,i,null)}function Fde(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++Ide:i};return null==i&&null!=Rde.vnode&&Rde.vnode(o),o}function Wde(e){return e.children}function $de(e,t){this.props=e,this.context=t}function Bde(e,t){if(null==t)return e.__?Bde(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Bde(e):null}function Vde(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return Vde(e)}}function Hde(e){(!e.__d&&(e.__d=!0)&&Dde.push(e)&&!Ude.__r++||Pde!==Rde.debounceRendering)&&((Pde=Rde.debounceRendering)||Ade)(Ude)}function Ude(){var e,t,n,r,i,o,a,s;for(Dde.sort(Ode);e=Dde.shift();)e.__d&&(t=Dde.length,r=void 0,i=void 0,a=(o=(n=e).__v).__e,(s=n.__P)&&(r=[],(i=Nde({},o)).__v=o.__v+1,tfe(s,o,i,n.__n,void 0!==s.ownerSVGElement,null!=o.__h?[a]:null,r,null==a?Bde(o):a,o.__h),nfe(r,o),o.__e!=a&&Vde(o)),Dde.length>t&&Dde.sort(Ode));Ude.__r=0}function Gde(e,t,n,r,i,o,a,s,l,c){var u,d,f,h,p,m,g,y=r&&r.__k||Tde,v=y.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(h=n.__k[u]=null==(h=t[u])||"boolean"==typeof h||"function"==typeof h?null:"string"==typeof h||"number"==typeof h||"bigint"==typeof h?Fde(null,h,null,null,h):Array.isArray(h)?Fde(Wde,{children:h},null,null,null):h.__b>0?Fde(h.type,h.props,h.key,h.ref?h.ref:null,h.__v):h)){if(h.__=n,h.__b=n.__b+1,null===(f=y[u])||f&&h.key==f.key&&h.type===f.type)y[u]=void 0;else for(d=0;d<v;d++){if((f=y[d])&&h.key==f.key&&h.type===f.type){y[d]=void 0;break}f=null}tfe(e,h,f=f||Lde,i,o,a,s,l,c),p=h.__e,(d=h.ref)&&f.ref!=d&&(g||(g=[]),f.ref&&g.push(f.ref,null,h),g.push(d,h.__c||p,h)),null!=p?(null==m&&(m=p),"function"==typeof h.type&&h.__k===f.__k?h.__d=l=Yde(h,l,e):l=Kde(e,h,f,y,p,l),"function"==typeof n.type&&(n.__d=l)):l&&f.__e==l&&l.parentNode!=e&&(l=Bde(f))}for(n.__e=m,u=v;u--;)null!=y[u]&&("function"==typeof n.type&&null!=y[u].__e&&y[u].__e==n.__d&&(n.__d=Xde(r).nextSibling),ofe(y[u],y[u]));if(g)for(u=0;u<g.length;u++)ife(g[u],g[++u],g[++u])}function Yde(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t="function"==typeof r.type?Yde(r,t,n):Kde(n,r,r,i,r.__e,t));return t}function Kde(e,t,n,r,i,o){var a,s,l;if(void 0!==t.__d)a=t.__d,t.__d=void 0;else if(null==n||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),a=null;else{for(s=o,l=0;(s=s.nextSibling)&&l<r.length;l+=1)if(s==i)break e;e.insertBefore(i,o),a=o}return void 0!==a?a:i.nextSibling}function Xde(e){var t,n,r;if(null==e.type||"string"==typeof e.type)return e.__e;if(e.__k)for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(r=Xde(n)))return r;return null}function Jde(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||qde.test(t)?n:n+"px"}function Qde(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Jde(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Jde(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?efe:Zde,o):e.removeEventListener(t,o?efe:Zde,o);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function Zde(e){return this.l[e.type+!1](Rde.event?Rde.event(e):e)}function efe(e){return this.l[e.type+!0](Rde.event?Rde.event(e):e)}function tfe(e,t,n,r,i,o,a,s,l){var c,u,d,f,h,p,m,g,y,v,b,x,w,S,C,k=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,s=t.__e=n.__e,t.__h=null,o=[s]),(c=Rde.__b)&&c(t);try{e:if("function"==typeof k){if(g=t.props,y=(c=k.contextType)&&r[c.__c],v=c?y?y.props.value:c.__:r,n.__c?m=(u=t.__c=n.__c).__=u.__E:("prototype"in k&&k.prototype.render?t.__c=u=new k(g,v):(t.__c=u=new $de(g,v),u.constructor=k,u.render=afe),y&&y.sub(u),u.props=g,u.state||(u.state={}),u.context=v,u.__n=r,d=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=k.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=Nde({},u.__s)),Nde(u.__s,k.getDerivedStateFromProps(g,u.__s))),f=u.props,h=u.state,u.__v=t,d)null==k.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==k.getDerivedStateFromProps&&g!==f&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(g,v),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(g,u.__s,v)||t.__v===n.__v){for(t.__v!==n.__v&&(u.props=g,u.state=u.__s,u.__d=!1),u.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<u._sb.length;b++)u.__h.push(u._sb[b]);u._sb=[],u.__h.length&&a.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(g,u.__s,v),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(f,h,p)}))}if(u.context=v,u.props=g,u.__P=e,x=Rde.__r,w=0,"prototype"in k&&k.prototype.render){for(u.state=u.__s,u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),S=0;S<u._sb.length;S++)u.__h.push(u._sb[S]);u._sb=[]}else do{u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++w<25);u.state=u.__s,null!=u.getChildContext&&(r=Nde(Nde({},r),u.getChildContext())),d||null==u.getSnapshotBeforeUpdate||(p=u.getSnapshotBeforeUpdate(f,h)),C=null!=c&&c.type===Wde&&null==c.key?c.props.children:c,Gde(e,Array.isArray(C)?C:[C],t,n,r,i,o,a,s,l),u.base=t.__e,t.__h=null,u.__h.length&&a.push(u),m&&(u.__E=u.__=null),u.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=rfe(n.__e,t,n,r,i,o,a,l);(c=Rde.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=s,t.__h=!!l,o[o.indexOf(s)]=null),Rde.__e(e,t,n)}}function nfe(e,t){Rde.__c&&Rde.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Rde.__e(e,t.__v)}}))}function rfe(e,t,n,r,i,o,a,s){var l,c,u,d=n.props,f=t.props,h=t.type,p=0;if("svg"===h&&(i=!0),null!=o)for(;p<o.length;p++)if((l=o[p])&&"setAttribute"in l==!!h&&(h?l.localName===h:3===l.nodeType)){e=l,o[p]=null;break}if(null==e){if(null===h)return document.createTextNode(f);e=i?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h,f.is&&f),o=null,s=!1}if(null===h)d===f||s&&e.data===f||(e.data=f);else{if(o=o&&_de.call(e.childNodes),c=(d=n.props||Lde).dangerouslySetInnerHTML,u=f.dangerouslySetInnerHTML,!s){if(null!=o)for(d={},p=0;p<e.attributes.length;p++)d[e.attributes[p].name]=e.attributes[p].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||Qde(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||Qde(e,o,t[o],n[o],r)}(e,f,d,i,s),u)t.__k=[];else if(p=t.props.children,Gde(e,Array.isArray(p)?p:[p],t,n,r,i&&"foreignObject"!==h,o,a,o?o[0]:n.__k&&Bde(n,0),s),null!=o)for(p=o.length;p--;)null!=o[p]&&jde(o[p]);s||("value"in f&&void 0!==(p=f.value)&&(p!==e.value||"progress"===h&&!p||"option"===h&&p!==d.value)&&Qde(e,"value",p,d.value,!1),"checked"in f&&void 0!==(p=f.checked)&&p!==e.checked&&Qde(e,"checked",p,d.checked,!1))}return e}function ife(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Rde.__e(e,n)}}function ofe(e,t,n){var r,i;if(Rde.unmount&&Rde.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||ife(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Rde.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&ofe(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||jde(e.__e),e.__=e.__e=e.__d=void 0}function afe(e,t,n){return this.constructor(e,n)}function sfe(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{createElement:t=document.createElement.bind(document)}=e;let n,r,i=Bue();const o={transform:void 0,disableScreenReader:!1},a=Vue();return a.element=()=>n,a.root=()=>n,a.settings=e=>(e&&Object.keys(o).forEach((t=>{void 0!==e[t]&&(o[t]=e[t])})),o),a.appendTo=e=>(n||(n=t("div"),n.style.position="absolute",n.style["-webkit-font-smoothing"]="antialiased",n.style["-moz-osx-font-smoothing"]="antialiased",n.style.pointerEvents="none"),e.appendChild(n),n),a.render=e=>{if(!n)return!1;const t="function"==typeof o.transform&&o.transform();if(t){const{horizontalScaling:e,horizontalSkewing:r,verticalSkewing:i,verticalScaling:o,horizontalMoving:a,verticalMoving:s}=t;return n.style.transform="matrix(".concat(e,", ").concat(r,", ").concat(i,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}n.style.transform="";let a;return o.disableScreenReader&&n.setAttribute("aria-hidden",!0),n.style.left="".concat(i.computedPhysical.x,"px"),n.style.top="".concat(i.computedPhysical.y,"px"),n.style.width="".concat(i.computedPhysical.width,"px"),n.style.height="".concat(i.computedPhysical.height,"px"),a=Array.isArray(e)?zde("div",null,e):e,r=function(e,t,n){var r,i,o;Rde.__&&Rde.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],tfe(t,e=(!r&&n||t).__k=zde(Wde,null,[e]),i||Lde,Lde,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?_de.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),nfe(o,e)}(a,n,r),!0},a.renderArgs=[zde],a.clear=()=>{if(n){let e=n.firstChild;for(;e;)n.removeChild(e),e=n.firstChild;r=null}return a},a.destroy=()=>{n&&n.parentElement&&n.parentElement.removeChild(n),n=null,r=null},a.size=e=>(e&&(i=Bue(e)),i),a}_de=Tde.slice,Rde={__e:function(e,t,n,r){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),a=i.__d),a)return i.__E=i}catch(t){e=t}throw e}},Ide=0,$de.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Nde({},this.state),"function"==typeof e&&(e=e(Nde({},n),this.props)),e&&Nde(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Hde(this))},$de.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Hde(this))},$de.prototype.render=Wde,Dde=[],Ade="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ode=function(e,t){return e.__v.__b-t.__v.__b},Ude.__r=0;var lfe=[function(e){e.renderer("svg",Mde)},function(e){e.renderer("canvas",tde)},function(e){e.renderer("dom",sfe)}];const cfe={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4};const ufe=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=function(){let{level:e=cfe.OFF,pipe:t=console}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e;const r={[cfe.OFF]:()=>{},[cfe.ERROR]:function(){return t.error(...arguments)},[cfe.WARN]:function(){return t.warn(...arguments)},[cfe.INFO]:function(){return t.info(...arguments)},[cfe.DEBUG]:function(){return t.log(...arguments)}},i=function(e){if(e&&!(n<e)){for(var t=arguments.length,i=new Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];(r[e]||r[cfe.DEBUG])(...i)}};return{log:i,error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(cfe.ERROR,...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(cfe.WARN,...t)},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(cfe.INFO,...t)},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(cfe.DEBUG,...t)},level:e=>("number"==typeof e&&(n=e),n),LOG_LEVEL:cfe}}(t.logger),i={component:S7(n.component,"component",r),data:S7(n.data,"data",r),formatter:S7(n.formatter,"formatter",r),interaction:S7(n.interaction,"interaction",r),renderer:coe(n.renderer),scale:S7(n.scale,"scale",r),symbol:S7(n.symbol,"symbol",r),logger:r};function o(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e({palettes:t.palettes.concat(n.palettes||[]),style:o8({},t.style,n.style),logger:n.logger||t.logger,renderer:n.renderer||t.renderer},i)}return t.renderer&&t.renderer.prio&&i.renderer.default(t.renderer.prio[0]),o.use=function(e){return function(e){e(arguments.length>2?arguments[2]:void 0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i)},o.chart=e=>loe(e,{registries:i,logger:r,style:t.style,palettes:t.palettes}),o.config=()=>t,Object.keys(i).forEach((e=>{o[e]=i[e]})),o.version=a8,o}({renderer:{prio:["svg","canvas"]},logger:{level:0},style:{"$font-family":"'Source Sans Pro', Arial, sans-serif","$font-size":"12px","$line-height":"16px","$font-size--l":"16px","$font-weight":"normal","$gray-100":"#ffffff","$gray-98":"#f9f9f9","$gray-95":"#f2f2f2","$gray-90":"#e6e6e6","$gray-35":"#595959","$gray-30":"#4d4d4d","$gray-25":"#404040","$gray-20":"#333333","$border-95":"rgba(255, 255, 255, 0.05)","$border-90":"rgba(255, 255, 255, 0.1)","$border-80":"rgba(255, 255, 255, 0.2)","$border-20":"rgba(0, 0, 0, 0.2)","$border-10":"rgba(0, 0, 0, 0.1)","$border-5":"rgba(0, 0, 0, 0.05)","$primary-blue":"#3F8AB3","$primary-green":"#6CB33F","$primary-red":"#DC423F","$primary-orange":"#EF960F","$spacing--s":4,$spacing:8,"$spacing--l":12,"$font-color":"$gray-35","$font-color--inverted":"$gray-90","$guide-color":"$gray-90","$guide-color--inverted":"$gray-35",$border:"$border-80","$border--inverted":"$border-10",$shape:{fill:"$primary-blue",strokeWidth:1,stroke:"$border"},"$shape-outline":{stroke:"$primary-blue",strokeWidth:2},"$shape-guide":{stroke:"$guide-color",strokeWidth:1},"$shape-guide--inverted":{"@extend":"$shape-guide",stroke:"$guide-color--inverted"},$label:{fontSize:"$font-size",fontFamily:"$font-family",fill:"$font-color"},"$label--inverted":{$extend:"$label",fill:"$font-color--inverted"},"$label-overlay":{fontSize:"$font-size--l",fontFamily:"$font-family",fill:"$gray-100",color:"$font-color",stroke:"$guide-color--inverted",strokeWidth:1,borderRadius:4},$title:{"@extend":"$label",fontSize:"$font-size--l",fontWeight:"$font-weight",stroke:"$guide-color--inverted",strokeWidth:0},"$guide-line":{strokeWidth:1,stroke:"$guide-color"},"$guide-line--minor":{strokeWidth:1,stroke:"$gray-95"},"$padding--s":{left:"$spacing--s",right:"$spacing--s",top:"$spacing--s",bottom:"$spacing--s"},$padding:{left:"$spacing",right:"$spacing",top:"$spacing",bottom:"$spacing"},"$selection-area-target":{fill:"$primary-green",strokeWidth:0,opacity:.2}},palettes:[{key:"categorical",colors:[["#a54343","#d76c6c","#ec983d","#ecc43d","#f9ec86","#cbe989","#70ba6e","#578b60","#79d69f","#26a0a7","#138185","#65d3da"]]},{key:"diverging",colors:[["#3d52a1","#3a89c9","#77b7e5","#b4ddf7","#e6f5fe","#ffe3aa","#f9bd7e","#ed875e","#d24d3e","#ae1c3e"]]},{key:"sequential",colors:[["rgb(180,221,212)","rgb(34, 83, 90)"]]}]},{component:uoe,data:moe,formatter:Uee,interaction:goe,renderer:coe(),scale:Gne,symbol:Zre});Ece.forEach(ufe.use),lfe.forEach(ufe.use),[].forEach(ufe.use);const dfe=ufe();dfe.use(X6),dfe.renderer.prio(["canvas"]);const ffe=(e,t)=>e&&"center"!==e&&"rtl"===t?b5(e):e,hfe=({cell:e,representation:t,textStyle:n,imageContainerHorizontalAlignment:r})=>{const{imageBox:i}=t,{styleService:{grid:{lineClamp:o}}}=EZ(),{direction:a}=bZ();return Yi.jsxs("div",{style:{display:"grid",gridTemplateColumns:`${i?.width??24}px 1fr`,maxHeight:"fit-content",alignItems:"center",justifyContent:"flex-start",boxSizing:"border-box"},children:[Yi.jsx("div",{"data-key":"image-container--partial-image",style:{display:"flex",flexDirection:"column",justifyContent:T5(e),alignItems:ffe(r,a),overflow:"hidden",boxSizing:"border-box",border:"4px solid transparent",width:i?.width??24,height:"100%"},children:Yi.jsx(t3,{representation:t,textStyle:n})}),Yi.jsx(O3,{padding:4/(o<=2?2:1),alignSelf:T5(e,!0),children:!!t.labelStructure&&Z5(t.labelStructure)})]})},pfe=({suffix:e,delimeter:t})=>` ${e?t:""} ${e}`,mfe=({href:e,text:t,labelStructure:n,interactions:r,color:i})=>Yi.jsxs("span",{children:[Yi.jsx(gS,{...l4({href:e,text:t,interactions:r,color:i}),children:n?.maskedValue?n.maskedValue:n?.originalValue}),!!n&&pfe(n)]}),gfe=({children:e,textStyle:t,shouldEnableStickyText:n})=>Yi.jsx("span",{style:{...t,border:"4px solid transparent",boxSizing:"border-box",...n&&{alignSelf:"flex-start",position:"sticky",top:0}},children:e}),yfe=({isLeftColumn:e,styleService:t,cell:n,isIndentModeEnabled:r})=>e?r?t.grid.lineClamp:Math.max(t.grid.lineClamp,n.leafCount*t.grid.lineClamp):t.grid.columnLineClamp,vfe=({cell:e,isCellSelected:t,isLeftColumn:n})=>{const{direction:r}=bZ(),{isActive:i}=A5(),{layoutService:o,styleService:a}=EZ(),{interactions:s}=SZ(),l=n&&o.isIndentModeEnabled;let c=n&&!e.isNull?(e=>{const{representation:{text:t,labelStructure:n}}=e;if(!n||!n.originalValue)return t;const{originalValue:r,maskedValue:i,suffix:o,delimeter:a}=n;return`${0!==i.length?i:r} ${o?a:""} ${o}`.trim()})(e):e.representation.text;if(e.isEmpty)return null;const u=(({cell:e,styleService:t,isCellSelected:n,isLeftColumn:r,isIndentModeEnabled:i})=>({...KX,...XX(yfe({cell:e,isLeftColumn:r,styleService:t,isIndentModeEnabled:i})),color:F5({cell:e,styleService:t,isCellSelected:n}),fontWeight:W5({cell:e,styleService:t}),fontStyle:$5({cell:e,styleService:t}),textDecoration:B5({cell:e,styleService:t}),fontFamily:t.dimensionValues.fontFamily,fontSize:t.dimensionValues.fontSize}))({cell:e,styleService:a,isCellSelected:t,isLeftColumn:n,isIndentModeEnabled:o.isIndentModeEnabled});if(e.representation.type===iX.Image&&!e.isTotal&&!e.isNull){const{labelStructure:t}=e.representation,i=n&&t&&t.suffix?hfe:n3;return Yi.jsx(i,{cell:e,representation:e.representation,leafCount:e.leafCount,textStyle:u,isLeftColumn:n,canExpandOrCollapse:e.ref.qCanCollapse||e.ref.qCanExpand,imageContainerHorizontalAlignment:k5(e,o,n,r)})}if(e.representation.type===iX.Link&&!i&&!e.isTotal){const t=n&&e.representation.labelStructure?mfe:c4;c=Yi.jsx(t,{text:e.representation.text,labelStructure:e.representation.labelStructure,href:e.representation.url,interactions:s,color:e.expressionColor.color})}return Yi.jsx(gfe,{shouldEnableStickyText:l,textStyle:{...u,...e.representation.type===iX.Image&&e.isNull?{alignSelf:T5(e)}:{}},children:c})},bfe=({index:e,style:t,data:n})=>{const{styleService:r,layoutService:i}=EZ(),{isSelected:o}=A5(),{isLeftColumn:a=!1,showLastBorder:s,itemCount:l,isLast:c,totalDividerIndex:u}=n,{isAdjustingWidth:d,setIsAdjustingWidth:f}=x3([n]),h=i4(e,n),p=a?e===l-1:c,m=a?c:e===l-1,g=M2(h,u,i.isIndentModeEnabled);if(void 0===h){const{background:n}=r.dimensionValues;return Yi.jsx(_2,{style:{...t,background:n},index:e,isLastRow:p,isLastColumn:m,showLastBorder:s,isLeftColumn:a,showTotalCellDivider:g})}const y=o(h);return Yi.jsxs(a4,{reactWindowStyle:t,isLeftColumn:a,isLastRow:p,isLastColumn:m,isCellSelected:y,showTotalCellDivider:g,cell:h,data:n,isAdjustingWidth:d,index:e,children:[Yi.jsxs(R2,{verticalAlign:T5(h),width:I2(h.representation),right:h.isLeftColumn?void 0:4,isLeftColumn:a,children:[Yi.jsx(G5,{isLeftColumn:a,isCellSelected:y,cell:h}),Yi.jsx(vfe,{isLeftColumn:a,isCellSelected:y,cell:h})]}),Yi.jsx(C3,{cellInfo:{...h,columnWidthLocation:h.isPseudoDimension?dX.Measures:dX.Dimension},columnWidth:t.width,isLastColumn:m,setIsAdjustingWidth:f})]})};var xfe=Re.memo(bfe,d2);const wfe=({list:e,listValues:t,isLastRow:n,getRightGridColumnWidth:r})=>i=>{const o=n?e[i]:t.at(i);return o&&0===i&&o.x>0?(o.leafCount+o.x+o.distanceToNextCell)*r():!n&&o?(o.leafCount+o.distanceToNextCell)*r():r(o?.x??i)},Sfe=(e,t,n,r)=>{const i=Object.values(e);let o,a=i.length;return r&&(a=n,o=t/a),{itemCount:a,estimatedItemSize:o,listValues:i}},Cfe=(e,t)=>n=>{e.current&&(e.current[t]=n)},kfe={display:"flex",height:"fit-content",borderWidth:"1px 0px 0px 0px",...GX},Efe={overflow:"hidden",willChange:"auto",flexShrink:0},Mfe=({leftGridRef:e,width:t,height:n,columnWidths:r,showLastBorder:i})=>{const{pageInfo:o,direction:a}=bZ(),{layoutService:s,styleService:{contentCellHeight:l,grid:{divider:c}}}=EZ(),{qSize:u}=s.layout.qHyperCube,{gridSectionsData:{leftDimensionData:d},visibleDimensionsInfo:{visibleLeftDimensionInfo:f}}=Y0();r4(e,d),n4(e,t,n,l);const h=o.rowsOnCurrentPage*l,p={...kfe,borderColor:c,width:r.reduce(((e,t)=>e+t),0)};return Yi.jsx("div",{style:p,"data-section-id":"LEFT_GRID",children:d.grid.map(((t,c)=>{const p=c===d.columnCount-1,m=PZ(f[c]),{itemCount:g,estimatedItemSize:y,listValues:v}=Sfe(t,h,o.rowsOnCurrentPage,p),b=s.isIndentModeEnabled?()=>l:((e,t,n,r,i)=>o=>{const a=r?e[o]:t.at(o);if(a&&0===o&&a.pageY>0)return(a.leafCount+a.pageY+a.distanceToNextCell)*n;if(a&&a.leafCount>0){const e=a.y===i-a.leafCount;return(a.leafCount-(e?a.ref.qUp:0)+a.distanceToNextCell)*n}return n})(t,v,l,p,u.qcy);return Yi.jsx(s2,{ref:Cfe(e,c),style:{...Efe,flexGrow:p?1:0,direction:a},height:n,width:r[c],itemCount:g,itemSize:b,layout:"vertical",itemData:{list:t,isLeftColumn:!0,isLast:p,itemCount:g,showLastBorder:i,listValues:v,totalDividerIndex:d.totalDividerIndex},itemKey:h3,estimatedItemSize:y,children:xfe},m)}))})};var _fe=_e.memo(Mfe);const Rfe={overflow:"hidden",willChange:"auto"},Ife=e=>({...GX,borderWidth:"rtl"===e?"0px 1px 0px 0px":"0px 0px 0px 1px"}),Dfe=({topGridRef:e,rowHightCallback:t,width:n,height:r,showLastBorder:i,getRightGridColumnWidth:o})=>{const{direction:a}=bZ(),{layoutService:s,styleService:{grid:{divider:l},headerCellHeight:c}}=EZ(),{gridSectionsData:{headersData:u,topDimensionData:d}}=Y0(),f={...Ife(a),borderColor:l,height:r};r4(e,d),n4(e,n,r,c);const h=s.size.x*o();return 0===d.rowCount?Yi.jsx("div",{style:{width:n,height:r,...Ife(a)}}):Yi.jsx("div",{style:f,"data-section-id":"TOP_GRID",children:d.grid.map(((r,l)=>{const c=l===d.rowCount-1,{itemCount:f,estimatedItemSize:p,listValues:m}=Sfe(r,h,s.size.x,c),g=(({layoutService:e,headersData:t,topRowIndex:n})=>{const r=t.data.at(n);if(void 0===r)return;const i=t.size.x-1,o=Q3({layoutService:e,headersData:t,topRowIndex:n})?0:i,a=r.at(o),s=Array.isArray(a)?a.at(i):a;return s?e.getDimensionInfo(s.dimensionInfoIndex):void 0})({layoutService:s,headersData:u,topRowIndex:l}),y=g?PZ(g):`empty ${l}`;return Yi.jsx(s2,{ref:Cfe(e,l),style:Rfe,height:t(),width:n,itemCount:f,itemSize:wfe({list:r,listValues:m,isLastRow:c,getRightGridColumnWidth:o}),layout:"horizontal",itemData:{list:r,isLast:c,itemCount:f,showLastBorder:i,listValues:m,totalDividerIndex:d.totalDividerIndex},itemKey:h3,estimatedItemSize:p,direction:a,children:xfe},y)}))})};var Pfe=_e.memo(Dfe);const Afe=()=>{const{styleService:{headerCellHeight:e,contentCellHeight:t}}=EZ(),n=w1(),r=(()=>{const{model:e}=SZ(),t=_e.useCallback((async(t,n)=>{if(!e)throw new Error("No Model provided!");const{qReverseSort:r,dimensionInfoIndex:i,sortDirection:o}=t,a=[];if(n===o)return!1;a.push({qPath:`/qHyperCubeDef/qDimensions/${i}/qDef/qReverseSort`,qOp:"Replace",qValue:(!r).toString()});try{return await e.applyPatches(a,!0),!0}catch(e){return console.error("Error while applying patch: ",e),!1}}),[e]);return t})(),{gridSectionsWrapperRefs:{headerGridWrapperRef:i,topGridWrapperRef:o,leftGridWrapperRef:a,dataGridWrapperRef:s},gridRefs:{topGridRef:l,leftGridRef:c,dataGridRef:u},scrollDirectionRefs:{verticalScrollDirection:d,horizontalScrollDirection:f},scrollbarsDimensions:{verticalScrollbarWidth:h,horizontalScrollbarHeight:p,resetHorizontalScrollbarHeight:m}}=x1(),{leftGridWidth:g,leftGridFullWidth:y,leftGridColumnWidths:v,rightGridFullWidth:b,showLastRightBorder:x,getRightGridColumnWidth:w,getHeaderCellsIconsVisibilityStatus:S,overrideLeftGridWidth:C}=function({tableWidth:e,verticalScrollbarWidth:t,resetHorizontalScrollbarHeight:n}){const{layoutService:r,styleService:i}=EZ(),{gridSectionsData:{headersData:o}}=Y0(),{measureText:a}=SJ(i.header,{allowLineBreaks:!1}),s=f1({tableWidth:e}),l=h1({tableWidth:e,verticalScrollbarWidth:t,leftGridWidth:s.leftGridWidth}),c=s.leftGridWidth+l.rightGridFullWidth+1<e,u=_e.useCallback(((e,t,n="")=>{let i=e;r.isIndentModeEnabled&&(i=1,1===o.size.x&&(i=0));const l=s.leftGridColumnWidths[i];let c=!1,u=!1,d=a(n)+J0;return t&&d+X0<=l&&(u=!0,d+=X0),d+X0<=l&&(c=!0),{shouldShowMenuIcon:c,shouldShowLockIcon:u}}),[s.leftGridColumnWidths,a,r.isIndentModeEnabled,o.size.x]);return _e.useEffect((()=>{const e=s.leftGridWidth===s.leftGridFullWidth,t=l.rightGridWidth===l.rightGridFullWidth;e&&t&&n()}),[n,s.leftGridWidth,s.leftGridFullWidth,l.rightGridWidth,l.rightGridFullWidth]),{...s,...l,showLastRightBorder:c,getHeaderCellsIconsVisibilityStatus:u}}({tableWidth:n.width,verticalScrollbarWidth:h,resetHorizontalScrollbarHeight:m}),{gridScaffoldDimensions:k,headerGridDims:E,topGridDims:M,leftGridDims:_,dataGridDims:R,metadata:{everyThingFitsInTableRectHeight:I,scrollbarsVisibilityStatus:D}}=(({cellHeights:{headerCellHeight:e,contentCellHeight:t},horizontalWidths:{leftGridWidth:n,leftGridOriginalWidth:r,rightGridOriginalWidth:i},scrollBarsDimensions:{verticalScrollbarWidth:o,horizontalScrollbarHeight:a}})=>{const s=w1(),{pageInfo:l}=bZ(),{gridSectionsData:{headersData:c,topDimensionData:u}}=Y0(),d=Math.min(s.height*Q0,Math.max(s.height*Q0-25,s.height-t-a)),f=s.width*Q0,h=l.rowsOnCurrentPage*t,p=Math.max(c.size.y,u.rowCount,1),m=e*p,g=e*p,y=Math.min(f,n),v=s.width-f,b=Math.max(v,s.width-y),x=Math.min(d,m,g),{availableHeight:w,everyThingFitsInTableRectHeight:S,everyThingFitsInTableRectWidth:C}=((e,t,n)=>{const r=t+1+n+o<=s.width,i=e+1+h+a,l=i-s.height<a||i<=s.height;return{availableHeight:l?i:s.height,everyThingFitsInTableRectHeight:l,everyThingFitsInTableRectWidth:r}})(x,y,b),k=w-d,E=Math.max(k,w-x),M=Math.min(E,h),_=Math.min(E,h),R=m+1+h,{visibilityStatus:I,metadata:{hasLeftGridOverflowX:D,hasDataGridOverflowX:P}}=(e=>{const{gridScaffold:{X_AXIS:{leftSectionWidth:t,rightSectionWidth:n},Y_AXIS:{topSectionHeight:r,bottomSectionHeight:i}},gridOriginalWidth:{X_AXIS:{leftSectionFullWidth:o,rightSectionFullWidth:a},Y_AXIS:{topSectionFullHeight:s,bottomSectionFullHeight:l}}}=e,c=s>r,u=o>t,d=a>n,f=l>i;return{visibilityStatus:{topGrid:{overflowX:"hidden",overflowY:c?"scroll":"hidden"},leftGrid:{overflowX:u?"scroll":"hidden",overflowY:"hidden"},dataGrid:{overflowX:d?"scroll":"hidden",overflowY:f?"scroll":"hidden"}},metadata:{hasTopGridOverflowY:c,hasLeftGridOverflowX:u,hasDataGridOverflowX:d,hasDataGridOverflowY:f}}})({gridScaffold:{X_AXIS:{leftSectionWidth:y,rightSectionWidth:b},Y_AXIS:{topSectionHeight:x,bottomSectionHeight:E}},gridOriginalWidth:{X_AXIS:{leftSectionFullWidth:r,rightSectionFullWidth:i},Y_AXIS:{topSectionFullHeight:g,bottomSectionFullHeight:R-g}}});return{gridScaffoldDimensions:{width:s.width,height:s.height,gridTemplateColumns:`${y}px ${b}px`,gridTemplateRows:`${x}px ${E}px`},headerGridDims:{width:-1,height:x},topGridDims:{fullSizeWrapper:{width:i-o+(P?o:0),height:g},stickyWrapper:{width:b-1-o,height:-1},self:{width:Math.min(i,b)-(C?1:0)-o,height:g}},leftGridDims:{fullSizeWrapper:{width:y,height:R-g+(!D&&P?a:0)},stickyWrapper:{width:y,height:E-1-a},self:{width:y,height:Math.max(t,M-(S?0:a-1))}},dataGridDims:{fullSizeWrapper:{width:i-o+(P?o:0),height:R-g+(!P&&D?a:0)},stickyWrapper:{width:b-1-o,height:E-1-a},self:{width:Math.min(i,b)-(C?1:0)-o,height:Math.max(t,_-(S?0:a-1))}},metadata:{everyThingFitsInTableRectHeight:S,scrollbarsVisibilityStatus:I}}})({cellHeights:{headerCellHeight:e,contentCellHeight:t},horizontalWidths:{leftGridWidth:g,leftGridOriginalWidth:y,rightGridOriginalWidth:b},scrollBarsDimensions:{verticalScrollbarWidth:h,horizontalScrollbarHeight:p}}),P=_e.useCallback((()=>e),[e]),A=_e.useCallback((()=>t),[t]);return(()=>{const{downloadService:e}=EZ();_e.useEffect((()=>{e.notifyIsDoneRendering()}))})(),Yi.jsxs(C1,{style:k,children:[Yi.jsx("div",{style:{overflow:"hidden"},ref:i,children:Yi.jsx(t4,{tableWidth:n.width,leftGridWidth:g,columnWidths:v,getHeaderCellsIconsVisibilityStatus:S,rowHight:e,height:E.height,changeSortOrder:r,overrideLeftGridWidth:C})}),Yi.jsx(M1,{style:D.topGrid,origin:hX.TopGrid,ref:o,children:Yi.jsx(S1,{style:M.fullSizeWrapper,children:Yi.jsx(_1,{style:M.stickyWrapper,children:Yi.jsx(Pfe,{topGridRef:l,rowHightCallback:P,...M.self,showLastBorder:{right:x,bottom:!1},getRightGridColumnWidth:w})})})}),Yi.jsx(M1,{style:D.leftGrid,origin:hX.LeftGrid,ref:a,children:Yi.jsx(S1,{style:_.fullSizeWrapper,children:Yi.jsx(_1,{style:_.stickyWrapper,children:Yi.jsx(_fe,{leftGridRef:c,..._.self,columnWidths:v,showLastBorder:{right:!1,bottom:I}})})})}),Yi.jsx(M1,{style:D.dataGrid,origin:hX.DataGrid,ref:s,children:Yi.jsx(S1,{style:R.fullSizeWrapper,children:Yi.jsx(_1,{style:R.stickyWrapper,children:Yi.jsx(y3,{dataGridRef:u,rowHightCallback:A,...R.self,showLastBorder:{right:x,bottom:I},getRightGridColumnWidth:w,verticalScrollDirection:d,horizontalScrollDirection:f})})})})]})},Ofe=()=>{const{keyboard:e,theme:t,interactions:n,translator:r}=SZ(),{pageInfo:i,updatePageInfo:o,rect:a}=bZ(),{layoutService:s}=EZ(),{layout:l,hasData:c}=s;return Yi.jsxs(Yi.Fragment,{children:[c?Yi.jsx(Afe,{}):null,Yi.jsx(_Z,{}),Yi.jsx(gZ,{paginationNeeded:i.shouldShowPagination,handleChangePage:e=>{o({page:e})},pageInfo:i,totalRowCount:i.totalRowCount,totalColumnCount:0,totalPages:i.totalPages,keyboard:e,translator:r,theme:t,interactions:n,rect:a,layout:l})]})};const Lfe=(e,{selections:t,baseObjects:n,coreServices:r,nebulaObjects:i})=>{const o=function(e){const t=DA();return t?.components?.MuiTable?.styleOverrides&&(t.components.MuiTable.styleOverrides.root={}),ws({...t,direction:e})}(n.direction);e.render(Yi.jsx(Re.StrictMode,{children:Yi.jsx(al,{theme:o,children:Yi.jsx(CZ,{...i,children:Yi.jsx(xZ,{...n,children:Yi.jsx(O5,{selections:t,children:Yi.jsx(MZ,{...r,children:Yi.jsx(K0,{children:Yi.jsx(Ofe,{})})})})})})})}))};var Tfe=function(e){return e.FontSize="fontSize",e.FontFamily="fontFamily",e.FontColor="fontColor",e.FontStyle="fontStyle",e.Background="background",e.LineClamp="lineClamp",e.ColumnLineClamp="columnLineClamp",e.Border="border",e.Divider="divider",e}(Tfe||{}),qfe=function(e){return e.Dimension="object.pivotTableV2.dimension",e.Measure="object.pivotTableV2.measure",e.Total="object.pivotTableV2.total",e.Null="object.pivotTableV2.null",e.Grid="object.pivotTableV2",e}(qfe||{}),Nfe=function(e){return e.Grid="grid",e.Divider="grid.divider",e.LabelName="label.name",e.LabelValue="label.value",e}(Nfe||{}),jfe=function(e){return e.FontSize="fontSize",e.FontFamily="fontFamily",e.FontColor="color",e.BackgroundColor="backgroundColor",e.LineClamp="lineClamp",e.ColumnLineClamp="columnLineClamp",e.BorderColor="borderColor",e}(jfe||{});const zfe=e=>e?`${parseInt(e,10)}px`:void 0,Ffe=(e,t)=>{if(t){const n=e.getColorPickerColor(t);return"none"===n?VX.Transparent:n}},Wfe=(e,t)=>+(parseInt(e,10)*BX*t+8).toFixed(2),$fe=(e,t)=>void 0===e?t:e.some((e=>"bold"===e))?WX:"normal",Bfe=e=>e?.some((e=>"italic"===e))?"italic":"normal",Vfe=e=>e?.some((e=>"underline"===e))?"underline":"none",Hfe=document.createElement("textarea");function Ufe(e){Hfe.value=e,document.body.appendChild(Hfe),Hfe.select(),Hfe.setSelectionRange(0,Hfe.value.length),document.execCommand("copy"),document.body.removeChild(Hfe)}Hfe.style.position="absolute",Hfe.style.left="-9999px",Hfe.setAttribute("readonly","");function Gfe(t){e.onContextMenu?.(((e,n)=>{const r=n.target,i=r?.closest(`.${GG}`);i?.title&&e.addItem({translation:"contextMenu.copyCellValue",icon:"lui-icon lui-icon--copy",tid:"copy-cell-context-item",id:"copy-cell-context-item",select:async()=>{(e=>{const t=e.title;t&&(navigator.clipboard?.writeText?navigator.clipboard.writeText(t).catch((()=>{Ufe(t)})):Ufe(t))})(i)}}),t?.forEach((t=>{t(e,n,i)}))}))}const Yfe=({model:e,layoutService:t,effectivePropertiesService:n,translator:r})=>uJ(((i,o,a)=>{if(!e||n.qAlwaysFullyExpanded)return;const s=e,l=i.addItem({translation:"Object.PivotTable.ContextMenu.ExpandCollapse",tid:"expand-collapse-group",id:"expand-collapse-group"}),{qEffectiveDimensionName:c,label:u}=((e,t)=>{const n=((e,t)=>{const n=e?.getAttribute("data-dimension-info-index");if("string"==typeof n)return t.getDimensionInfo(+n)})(e,t);return"object"==typeof n?{qEffectiveDimensionName:n.qEffectiveDimensionName,label:n.qFallbackTitle}:{qEffectiveDimensionName:void 0,label:void 0}})(a,t);l.addItem((e=>({icon:"lui-icon lui-icon--plus",translation:"Object.PivotTable.ContextMenu.ExpandAll",tid:"expand-all",select:async()=>{try{await e.expandTop(RZ,0,0,!0),await e.expandLeft(RZ,0,0,!0)}catch(e){console.error("Failed to expand all",e)}}}))(s)),"string"==typeof c&&l.addItem((({model:e,effectivePropertiesService:t,qEffectiveDimensionName:n,label:r,translator:i})=>({icon:"lui-icon lui-icon--plus",translation:i.get("SNPivotTable.ContextMenu.ExpandDimension",[r??""]),tid:"expand-dimension",id:"expand-dimension",select:N3({model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:n,action:L3.Expand})}))({model:s,effectivePropertiesService:n,qEffectiveDimensionName:c,label:u,translator:r})),l.addItem((e=>({icon:"lui-icon lui-icon--minus",translation:"Object.PivotTable.ContextMenu.CollapseAll",tid:"collapse-all",select:async()=>{try{await e.collapseTop(RZ,0,0,!0),await e.collapseLeft(RZ,0,0,!0)}catch(e){console.error("Failed to collapse all",e)}}}))(s)),"string"==typeof c&&l.addItem((({model:e,effectivePropertiesService:t,qEffectiveDimensionName:n,label:r,translator:i})=>({icon:"lui-icon lui-icon--minus",translation:i.get("SNPivotTable.ContextMenu.CollapseDimension",[r??""]),tid:"collapse-dimension",id:"collapse-dimension",select:N3({model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:n,action:L3.Collapse})}))({model:s,effectivePropertiesService:n,qEffectiveDimensionName:c,label:u,translator:r}))}),[e,t,n]),Kfe=(t,n)=>e.useMemo((()=>(({layout:e})=>{const{qHyperCube:t,nullValueRepresentation:n,snapshotData:r}=e,{qNoOfLeftDims:i,qEffectiveInterColumnSortOrder:o,qMeasureInfo:a,qDimensionInfo:s}=t,l=!!r,c=r?.content?.rowsPerPage??15e3,u={x:Math.min(e.qHyperCube.qSize.qcx,$X),y:Math.min(e.qHyperCube.qSize.qcy,c)},d=o.slice(0,i),f=e=>d.some((t=>t===e)),h=f(IZ),p=new Map(o.map((e=>[s[e]??IZ,e]))),m=a.filter((e=>7005!==e.qError?.qErrorCode));return{layout:e,getNullValueText:()=>n?.text??"-",getMeasureInfoIndexFromCellIndex:(e,t=!1)=>{if(h)return 0;const n=e%m.length;return t?n:a.findIndex((e=>e===m[n]))},getDimensionInfo:e=>e===IZ?void 0:s.at(e),getDimensionInfoIndex:e=>p.get(e)??-1,size:u,isSnapshot:l,hasLimitedData:!l&&u.x<e.qHyperCube.qSize.qcx,hasData:u.x>0&&u.y>0,hasLeftDimensions:0!==e.qHyperCube.qNoOfLeftDims,hasPseudoDimOnLeft:h,leftDimensionInfoIndexes:d,isLeftDimension:f,triggerdByExpandOrCollapse:!!e.qHyperCube.qLastExpandedPos,visibleMeasureInfo:m,isIndentModeEnabled:Boolean(e.qHyperCube.qIndentMode),indentModeColumnWidth:e.qHyperCube.indentModeColumnWidth??{type:JG.Auto,pixels:XG.PixelsDefault,percentage:XG.PercentageDefault},searchSortFromDimension:"inherit"===e.search?.sorting}})({layout:t})),[t,n]),Xfe=({model:e,layoutService:t,viewService:n,pageInfo:r,rect:i})=>{const{layout:o,isSnapshot:a,triggerdByExpandOrCollapse:s}=t,l=(e=>{const t=fJ(e);return t.current=e,t})($0(i));return vJ((async()=>{const{qHyperCube:t}=o,{maxNumberOfVisibleRows:i,maxNumberOfVisibleColumns:c}=l.current;if(a)return o.snapshotData?.content?.qPivotDataPages??[];if(void 0!==e&&"getHyperCubePivotData"in e&&(((e,t,n,r)=>!!e&&(t.gridColumnStartIndex+t.gridWidth>=r||t.gridRowStartIndex+t.gridHeight>=n))(s,n,i,c)||((e,t,n,r)=>{const{qHyperCube:{qPivotDataPages:i,qSize:o}}=e,{qTop:a,qWidth:s,qHeight:l}=i[0]?.qArea??{qTop:0,qWidth:0,qHeight:0};return a<t.page*t.rowsPerPage||s<Math.min(r,o.qcx)||l<Math.min(n,o.qcy)})(o,r,i,c))){const t=((e,t,n,r,i,o)=>{const a=r.page*r.rowsPerPage,s=Math.min(a+r.rowsPerPage,n.qcy),l=Math.min($X,n.qcx);if(n.qcy<a)return null;let c=0,u=a;if(e){c=t.gridColumnStartIndex,u=a+t.gridRowStartIndex;const e=u+t.gridHeight,n=t.gridColumnStartIndex+t.gridWidth;e>s&&(u=Math.max(0,s-i)),n>l&&(c=Math.max(0,l-o))}return{qLeft:c,qTop:u,qWidth:Math.min(l-c,o),qHeight:Math.min(s-u,i)}})(s,n,o.qHyperCube.qSize,r,i,c);return t?e.getHyperCubePivotData(RZ,B0(t)):[]}return t.qPivotDataPages}),[o,a,e,n,r.page,r.rowsPerPage,l,s])},Jfe=({rowsPerPage:e,totalRowCount:t,page:n})=>Math.min(e,t-n*e),Qfe=(e,t,n=15e3)=>({rowsPerPage:n,totalPages:Math.max(1,Math.ceil(e/n)),totalRowCount:e,rowsOnCurrentPage:Jfe({rowsPerPage:n,totalRowCount:e,page:t})}),Zfe=15,ehe=({layoutService:t,viewService:n,rect:r,model:i,pageInfo:o})=>{const{freeResize:a}=e.useOptions();return e.onTakeSnapshot((async e=>{const t=e;if(!t.snapshotData||!i||t.snapshotData.content)return t;if("getHyperCubePivotData"in i){const{scrollTop:e,scrollLeft:a,leftGridScrollLeft:s,topGridScrollTop:l}=n,c=((e,t,n)=>{const{gridColumnStartIndex:r,gridRowStartIndex:i,gridWidth:o,gridHeight:a}=e,s=t.page*t.rowsPerPage,l=Math.max(r-Zfe,0),c=Math.max(s+i-Zfe,s,0),u=$X-l,d=s+t.rowsOnCurrentPage-c;if((e=>0===e.gridWidth&&0===e.gridHeight)(e)){const{maxNumberOfVisibleColumns:e,maxNumberOfVisibleRows:t}=$0(n);return{qLeft:l,qTop:c,qWidth:Math.min(u,e+30),qHeight:Math.min(d,t+30)}}return{qLeft:l,qTop:c,qWidth:Math.min(u,o+30),qHeight:Math.min(d,a+30)}})(n,o,r),u=B0(c),d={qLeft:0,qTop:o.page*o.rowsPerPage,qWidth:1,qHeight:1};t.snapshotData.content={qPivotDataPages:await i.getHyperCubePivotData(RZ,[d,...u]),scrollTop:e,scrollLeft:a,leftGridScrollLeft:s,topGridScrollTop:l,page:o.page,rowsPerPage:o.rowsPerPage},t.snapshotData.object.size.w=r.width,t.snapshotData.object.size.h=r.height}return t})),e.useImperativeHandle((()=>({getViewState:()=>((e,t)=>({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,leftGridScrollLeft:e.leftGridScrollLeft,topGridScrollTop:e.topGridScrollTop,renderPage:t.page}))(n,o)})),[n]),t.layout.snapshotData?.content&&!a?{left:r.left,top:r.top,width:t.layout.snapshotData.object.size.w,height:t.layout.snapshotData.object.size.h}:r};var the={SNPivotTable_ContextMenu_CollapseDimension:{id:"SNPivotTable.ContextMenu.CollapseDimension",locale:{"de-DE":"{0} reduzieren","en-US":"Collapse {0}","es-ES":"Contraer {0}","fr-FR":"Réduire {0}","it-IT":"Comprimi {0}","ja-JP":"{0} を折りたたむ","ko-KR":"{0} 축소","nl-NL":"{0} samenvouwen","pl-PL":"Zwiń {0}","pt-BR":"Recolher {0}","ru-RU":"Свернуть {0}","sv-SE":"Dölj {0}","tr-TR":"{0} öğelerini daralt","zh-CN":"折叠 {0}","zh-TW":"收合 {0}"}},SNPivotTable_ContextMenu_ExpandDimension:{id:"SNPivotTable.ContextMenu.ExpandDimension",locale:{"de-DE":"{0} erweitern","en-US":"Expand {0}","es-ES":"Expandir {0}","fr-FR":"Développer {0}","it-IT":"Espandi {0}","ja-JP":"{0} を展開","ko-KR":"{0} 확장","nl-NL":"{0} uitvouwen","pl-PL":"Rozwiń {0}","pt-BR":"Expandir {0}","ru-RU":"Развернуть {0}","sv-SE":"Visa {0}","tr-TR":"{0} öğelerini genişlet","zh-CN":"展开 {0}","zh-TW":"展開 {0}"}},SNPivotTable_IndentMode_Rows:{id:"SNPivotTable.IndentMode.Rows",locale:{"de-DE":"Zeilen","en-US":"Rows","es-ES":"Filas","fr-FR":"Lignes","it-IT":"Righe","ja-JP":"行","ko-KR":"행","nl-NL":"Rijen","pl-PL":"Wiersze","pt-BR":"Linhas","ru-RU":"Строки","sv-SE":"Rader","tr-TR":"Satırlar","zh-CN":"行","zh-TW":"列"}},SNPivotTable_LimitedData:{id:"SNPivotTable.LimitedData",locale:{"de-DE":"* Derzeit wird eine begrenzte Anzahl Spalten angezeigt","en-US":"* Currently showing a limited number of columns","es-ES":"* Actualmente mostrando un número limitado de columnas","fr-FR":"*Affichage actuel d'un nombre limité de colonnes","it-IT":"* Attualmente visualizzato un numero limitato di colonne","ja-JP":"* 現在、限られた列の数を表示","ko-KR":"* 현재 제한된 수의 열만 표시","nl-NL":"* Op dit moment wordt slechts een beperkt aantal kolommen getoond","pl-PL":"* Obecnie wyświetlana jest ograniczona liczba kolumn","pt-BR":"* Atualmente mostrando um número limitado de colunas","ru-RU":"* В настоящее время отображается ограниченное количество столбцов","sv-SE":"* Visar för närvarande ett begränsat antal kolumner","tr-TR":"*Şu anda sınırlı sayıda sütun gösteriliyor","zh-CN":"* 当前显示的列数有限","zh-TW":"* 目前顯示有限欄數"}},SNPivotTable_NoData:{id:"SNPivotTable.NoData",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, weil es keine Werte enthält.","en-US":"The chart is not displayed because it contains no values.","es-ES":"El gráfico no se muestra porque no contiene valores.","fr-FR":"Le graphique n'est pas affiché, car il ne contient aucune valeur.","it-IT":"Il grafico non è visualizzato poiché non contiene alcun valore.","ja-JP":"チャートには値が含まれていないため、チャートは表示されません。","ko-KR":"차트에 값이 없으므로 차트가 표시되지 않습니다.","nl-NL":"Het diagram wordt niet weergegeven omdat deze geen waarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ nie zawiera wartości.","pt-BR":"O gráfico não foi exibido porque não contém valores.","ru-RU":"Диаграмма не отображается, так как не содержит значений.","sv-SE":"Diagrammet visas inte eftersom det inte innehåller några värden.","tr-TR":"Değer içermemesi nedeniyle grafik görüntülenmiyor.","zh-CN":"图表未显示,因为它不包含任何值。","zh-TW":"系統不會顯示圖表,因為這沒有包含任何值。"}}};const nhe=()=>{const t=e.useTranslator(),n=t.language();return e.useMemo((()=>{!function(e){const t="SNPivotTable_LimitedData";e.get(t)===t&&Object.keys(the).forEach((t=>{e.add(the[t])}))}(t)}),[t]),{translator:t,language:n}},rhe=t=>{const{flags:n}=t,r=e.useElement(),i=(t=>{const n=e.useMemo((()=>CJ(t)),[t]);return e.useEffect((()=>()=>{n.unmount()}),[n]),n})(r),o=e.useStaleLayout(),a=e.useModel(),s=e.useApp(),l=e.useEmbed(),c=e.useKeyboard(),u=(()=>{const{viewState:t}=e.useOptions(),n=fJ(new Set),r=void 0!==window.qlikprinting,{promise:i,resolve:o}=e.useMemo((()=>cJ()),[]),a=uJ((e=>{n.current.add(e)}),[n]),s=uJ(mT((async()=>{await Promise.all(n.current),n.current.clear(),o()}),1e3),[o,n]);return e.usePromise((async()=>{await i}),[i]),e.useMemo((()=>({viewState:t,isDownloadedAsPDForImage:r,notifyIsDoneRendering:s,waitForPromise:a})),[s,r,t,a])})(),d=((t,n)=>{const[r]=vJ((async()=>{if(void 0!==t&&!n.snapshotData&&"getEffectiveProperties"in t)return{...await t.getEffectiveProperties()}}),[t,n]),i=e.useMemo((()=>{const e=void 0!==r?.qHyperCubeDef.qSortbyYValue&&1===Math.abs(r.qHyperCubeDef.qSortbyYValue),t=r?.qHyperCubeDef.qDimensions.map((e=>e.qDef?.qSortCriterias))??[];return{qAlwaysFullyExpanded:r?.qHyperCubeDef.qAlwaysFullyExpanded??!1,qExpansionState:r?.qHyperCubeDef.qExpansionState,isSortedByFirstMeasure:e,getSortCriteriaForDimension:e=>t[e]}}),[r]);return i})(a,o),f=Kfe(o,n),h=(t=>{const n=e.useInteractionState();return{...n,select:!!n.active&&!!n.select&&!t,active:!!n.active&&!t,scroll:!!n.active}})(f.isSnapshot),p=e.useSelections(),m=yJ(o,r),{translator:g,language:y}=nhe(),{pageInfo:v,updatePageInfo:b}=((t,n)=>{const{size:r,layout:{qHyperCube:{qSize:i}}}=t,o=n.isDownloadedAsPDForImage||t.isSnapshot,a=(e=>e.layout.snapshotData?.content?.rowsPerPage)(t),[s,l]=e.useState((()=>{const e=((e,t)=>t.isDownloadedAsPDForImage?t.viewState?.renderPage??0:e.isSnapshot?e.layout.snapshotData?.content?.page??0:0)(t,n);return{page:e,shouldShowPagination:i.qcy>r.y&&!o,...Qfe(i.qcy,e,a)}})),c=t.layout.qHyperCube.qSize.qcy;return e.useEffect((()=>{l((e=>({...e,...Qfe(c,e.page,a),shouldShowPagination:c>t.size.y&&!o})))}),[c,t.size.y,l,o,a]),e.useEffect((()=>{const{page:e,totalPages:t}=s;if(e+1>t){const e=t-1,n=Jfe({...s,page:e});l({...s,page:e,rowsOnCurrentPage:n})}}),[s]),{pageInfo:s,updatePageInfo:e=>{l({...s,...e,rowsOnCurrentPage:Jfe({...s,...e})})}}})(f,u),x=((t,n,r)=>e.useMemo((()=>((e,t)=>{if(e.isDownloadedAsPDForImage){const{viewState:t}=e;return{gridColumnStartIndex:0,gridRowStartIndex:0,gridWidth:0,gridHeight:0,scrollTop:t?.scrollTop??0,scrollLeft:t?.scrollLeft??0,leftGridScrollLeft:t?.leftGridScrollLeft??0,topGridScrollTop:t?.topGridScrollTop??0}}return{gridColumnStartIndex:0,gridRowStartIndex:0,gridWidth:0,gridHeight:0,scrollTop:t?.content?.scrollTop??0,scrollLeft:t?.content?.scrollLeft??0,leftGridScrollLeft:t?.content?.leftGridScrollLeft??0,topGridScrollTop:t?.content?.topGridScrollTop??0}})(r,n.snapshotData)),[r,t.page,n.snapshotData]))(v,o,u),w=ehe({rect:e.useRect(),layoutService:f,viewService:x,model:a,pageInfo:v}),[S,C]=Xfe({model:a,layoutService:f,viewService:x,pageInfo:v,rect:w}),k=e.useMemo((()=>((e,t)=>{const n=t.layout.components?.find((e=>"theme"===e.key)),r=n?.header,i=n?.dimensionValues,o=n?.measureValues,a=n?.measureLabels,s=n?.totalValues,l=n?.nullValues,c=n?.grid,u=(t,n,r)=>e.getStyle(t,n,r),d=+(c?.[Tfe.LineClamp]??u(qfe.Grid,Nfe.Grid,jfe.LineClamp)??1),f=+(c?.[Tfe.ColumnLineClamp]??u(qfe.Grid,Nfe.Grid,jfe.ColumnLineClamp)??1),h=Ffe(e,r?.[Tfe.Background])??u(qfe.Dimension,Nfe.LabelName,jfe.BackgroundColor)??VX.Transparent,p={header:{fontSize:zfe(r?.[Tfe.FontSize])??u(qfe.Dimension,Nfe.LabelName,jfe.FontSize)??zX,fontFamily:r?.[Tfe.FontFamily]??u(qfe.Dimension,Nfe.LabelName,jfe.FontFamily)??FX,fontWeight:$fe(r?.[Tfe.FontStyle],WX),fontStyle:Bfe(r?.[Tfe.FontStyle]),textDecoration:Vfe(r?.[Tfe.FontStyle]),color:Ffe(e,r?.[Tfe.FontColor])??u(qfe.Dimension,Nfe.LabelName,jfe.FontColor)??EX.TEXT,background:h,hoverBackground:RX(h,QG),activeBackground:RX(h,ZG)},dimensionValues:{fontSize:zfe(i?.[Tfe.FontSize])??u(qfe.Dimension,Nfe.LabelValue,jfe.FontSize)??zX,fontFamily:i?.[Tfe.FontFamily]??u(qfe.Dimension,Nfe.LabelValue,jfe.FontFamily)??FX,fontWeight:$fe(i?.[Tfe.FontStyle],void 0),fontStyle:Bfe(i?.[Tfe.FontStyle]),textDecoration:Vfe(i?.[Tfe.FontStyle]),color:Ffe(e,i?.[Tfe.FontColor])??u(qfe.Dimension,Nfe.LabelValue,jfe.FontColor)??EX.TEXT,background:Ffe(e,i?.[Tfe.Background])??u(qfe.Dimension,Nfe.LabelValue,jfe.BackgroundColor)??VX.Transparent},measureValues:{fontSize:zfe(o?.[Tfe.FontSize])??u(qfe.Measure,Nfe.LabelValue,jfe.FontSize)??zX,fontFamily:o?.[Tfe.FontFamily]??u(qfe.Measure,Nfe.LabelValue,jfe.FontFamily)??FX,fontWeight:$fe(o?.[Tfe.FontStyle],"normal"),fontStyle:Bfe(o?.[Tfe.FontStyle]),textDecoration:Vfe(o?.[Tfe.FontStyle]),color:Ffe(e,o?.[Tfe.FontColor])??u(qfe.Measure,Nfe.LabelValue,jfe.FontColor)??VX.FontSecondary,background:Ffe(e,o?.[Tfe.Background])??u(qfe.Measure,Nfe.LabelValue,jfe.BackgroundColor)??VX.Transparent},measureLabels:{fontWeight:$fe(a?.[Tfe.FontStyle],"normal"),fontStyle:Bfe(a?.[Tfe.FontStyle]),textDecoration:Vfe(a?.[Tfe.FontStyle]),color:Ffe(e,a?.[Tfe.FontColor])??u(qfe.Measure,Nfe.LabelName,jfe.FontColor)??VX.FontSecondary,background:Ffe(e,a?.[Tfe.Background])??u(qfe.Measure,Nfe.LabelName,jfe.BackgroundColor)??VX.Transparent},totalValues:{fontWeight:$fe(s?.[Tfe.FontStyle],WX),fontStyle:Bfe(s?.[Tfe.FontStyle]),textDecoration:Vfe(s?.[Tfe.FontStyle]),color:Ffe(e,s?.[Tfe.FontColor])??u(qfe.Total,Nfe.LabelValue,jfe.FontColor)??EX.TEXT,background:Ffe(e,s?.[Tfe.Background])??u(qfe.Total,Nfe.LabelValue,jfe.BackgroundColor)??VX.Transparent},nullValues:{fontWeight:$fe(l?.[Tfe.FontStyle],"normal"),fontStyle:Bfe(l?.[Tfe.FontStyle]),textDecoration:Vfe(l?.[Tfe.FontStyle]),color:Ffe(e,l?.[Tfe.FontColor])??u(qfe.Null,Nfe.LabelValue,jfe.FontColor)??EX.TEXT,background:Ffe(e,l?.[Tfe.Background])??u(qfe.Null,Nfe.LabelValue,jfe.BackgroundColor)??VX.NullValueBackground},grid:{columnLineClamp:f,lineClamp:d,border:Ffe(e,c?.[Tfe.Border])??u(qfe.Grid,Nfe.Grid,jfe.BorderColor)??VX.DividerLight,divider:Ffe(e,c?.[Tfe.Divider])??u(qfe.Grid,Nfe.Divider,jfe.BorderColor)??VX.DividerDark,background:Ffe(e,c?.[Tfe.Background])??u(qfe.Grid,Nfe.Grid,jfe.BackgroundColor)??VX.Transparent},selectedColors:_X(e)};return p.headerCellHeight=Math.max(Wfe(p.header.fontSize,f),Wfe(p.dimensionValues.fontSize,f),32),p.contentCellHeight=Math.max(Wfe(p.measureValues.fontSize,d),Wfe(p.dimensionValues.fontSize,d),24),p.dimensionValueTextHeight=Wfe(p.dimensionValues.fontSize,1),p})(m,f)),[m,f]),E=((e,t,n)=>{const[,r,i]=vJ((async()=>{const t=fL(n.flags),r=e.getStyle("","","fontFamily"),i=e.getStyle("object","label.name","fontFamily"),o=e.getStyle("object","label.value","fontFamily"),a=e.getStyle("","","fontFamilies")??[];return Promise.all([...t,...a,r,i,o,EJ].filter((e=>void 0!==e)).map((async e=>{await document.fonts.load(`600 12px ${e}`),await document.fonts.load(`12px ${e}`)})))}),[t,e,n]);return i?(console.warn("Failed to load fonts:",i),!0):!r})(m,o,t),{direction:M}=e.useOptions();Gfe([Yfe({model:a,layoutService:f,effectivePropertiesService:d,translator:g})]),e.useEffect((()=>{!C&&a&&!!S&&E&&Lfe(i,{selections:p,baseObjects:{rect:w,pageInfo:v,qPivotDataPages:S,updatePageInfo:b,direction:M},nebulaObjects:{env:t,app:s,model:a,embed:l,theme:m,keyboard:c,translator:g,interactions:h},coreServices:{styleService:k,viewService:x,layoutService:f,downloadService:u,effectivePropertiesService:d}})}),[a,s,w,h,p,x,f,u,C,S,k,i,E,g,y,v,b,d,l,c,m,t,M])},ihe={version:"7.8.0",qHyperCubeDef:{qAlwaysFullyExpanded:!1,qDimensions:[],qMeasures:[],qMode:"P",qSuppressMissing:!0,qSuppressZero:!1,qShowTotalsAbove:!0,qInitialDataFetch:[{qTop:0,qLeft:0,qWidth:50,qHeight:50}],qIndentMode:!1},showTitles:!0,title:"",subtitle:"",footnote:"",nullValueRepresentation:{text:"-"},components:[]};return function(e){return{qae:{properties:{initial:{...ihe,qHyperCubeDef:{...ihe.qHyperCubeDef,qIndentMode:!1}}},data:YK(e)},ext:lJ(e),component(){rhe(e)}}}}));
|
|
123
|
+
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,c,u,d,f=e.length,h=e.search(/[0-9\-\+#]/),p=h>0?e.substring(0,h):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=f-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,f):"";if(n=(t="-"===(e=e.substring(h,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=s)&&(t=(+t).toFixed(s+1)),u=e[0].split(o),e[0]=u.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-a;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(d=t[0]).length%l,f=d.length,b=0;b<f;b++)m+=d.charAt(b),!((b-y+1)%l)&&b<f-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}}));function o6(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const a6={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},s6=/%\)?$/,l6=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,c6=/^\(oct\)/i,u6=/^\(dec\)/i,d6=/^\(hex\)/i,f6=/^\(bin\)/i,h6=/^\(rom\)/i,p6=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,m6=/#|0/g;function g6(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function y6(e,t,n){let r;return l6.test(t)?e=g6(e,Number(/\d{2}/.exec(t)[0]),t,n):c6.test(t)?e=g6(e,8,t,n):u6.test(t)?e=g6(e,10,t,n):d6.test(t)?e=g6(e,16,t,n):f6.test(t)?e=g6(e,2,t,n):h6.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}function v6(e,t,n){const r=o6(e);return n?r:new RegExp(r||"",t)}function b6(e,t,n,r){let i,o,a,s,l,c,u,d,f,h=e.pattern;var p,m;r&&(e.abbreviate=!0),p=t,(m=n)&&(m=o6(m)),p&&(p=o6(p)),f=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(m,"[#0]+)?")),a=h.match(f),a=a?a[0]:"",s=a?h.substr(0,h.indexOf(a)):h,l=a?h.substring(h.indexOf(a)+a.length):"",a||(a=h?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(a=a.replace(v6(c,"g"),t)),u=n,n=".",u&&(a=a.replace(v6(u,"g"),n)),d=a.match(/#/g),d=d?d.length:0;const g=h.split(u);let y;g[1]&&(y=g[1].match(m6)),e.prefix=s||"",e.postfix=l||"",e.pattern=h,e.maxPrecision=y?y.length:2,e.percentage=s6.test(h),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(v6(t,null,!0),"|").concat(v6(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=d}class x6{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return a6;const n={};return e.qNumericalAbbreviation.split(t).forEach((e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}(e,this.patternSeparator),this.prepare()}clone(){const e=new x6(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],p6.test(e[0])&&(r.positive.isFunctional=!0),e[1]?p6.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?p6.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||b6(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&b6(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&b6(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,c,u=this._prepared,d="",f="",h=e;if(isNaN(e))return"".concat(h);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,a=u.t,u.isFunctional)e=y6(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let r,i,o=t[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&s<t.length;)s++,o=t[s];s>0&&(r=t[s-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(d=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,c||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+1e-15*(e<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=i6(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(s=i.length;s<n;s++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),f=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=i6(l,e)}e=e.replace(u.numericRegex,(e=>e===a?u.groupTemp:e===o?u.decTemp:"")),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+f+d+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function w6(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=e=>e}=t;let o,a,s=Object.create(null),l=Object.create(null),c=0,u=0;return o=r?function(){return a=i(...arguments),o.has(a)?o.get(a):o.set(a,e(...arguments))}:t=>(a=i(t),o.has(a)?o.get(a):o.set(a,e(t))),o.set=(e,t)=>(c>=n&&(delete s[l[u]],delete l[u],c--,u++),s[e]=t,l[c]=e,c++,t),o.get=e=>s[e],o.has=e=>e in s,o.clear=()=>{s=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function S6(e,t,n,r,i){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new x6(...t)}(i,e,t,n,r),a=w6(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}const C6="D",k6="T",E6="TS",M6="IV",_6=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],R6=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],I6=["January","February","March","April","May","June","July","August","September","October","November","December"],D6=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P6(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function A6(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function O6(e,t){let n,r=function(e){const t=e,n=24*A6(t),r=60*A6(n),i=60*A6(r),o=1e3*A6(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:i,h:o,m:a,s:s,f:l,t:u}}class L6{constructor(e,t,n){const r=e||{};if(r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:_6,qDayNames:R6,qLongMonthNames:I6,qMonthNames:D6}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),!t){t={[k6]:r.qTimeFmt||"hh:mm:ss",[C6]:r.qDateFmt||"YYYY-MM-DD",[E6]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]}this.pattern=t}clone(){const e=new L6(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let r;e instanceof Date?r=function(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),r=O6(e,t));const i=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:P6("".concat(t.year).slice(-2),2),YYY:P6("".concat(t.year).slice(-3),3),def:e=>P6("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:P6("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:P6("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>P6("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>P6("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>P6("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>P6("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const a=new RegExp(o.join("|"),"g"),s=t.replace(a,(e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r}));return s}}function T6(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new L6(...t)}function q6(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=T6(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=w6(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==M6?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}(e):e}function o(e){return e=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=T6(i,e,t),r=w6(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function N6(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:a,type:s,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=a||("dimension"===s?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u="dimension"===s?"first":"avg",d=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return q6(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),S6(n,r,i,o,t)}(t,i),f="dimension"===s?"first":(e,t)=>d(t),h={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>s,origin:()=>l,items:()=>(e||(e=o(h)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:e=>(null==e?void 0:e.qText)||"",reduce:u,reduceLabel:f,formatter:()=>d,tags:()=>t.qTags};return h}function j6(e,t,n,r,i){return(t[e]||[]).map(((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:N6(w4({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=j6("qAttrDimInfo",t,n,a,w4({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=j6("qAttrExprInfo",t,n,a,w4({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=j6("qMeasureInfo",t,n,a,w4({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s}))}function z6(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},i=t;if(!i)throw new Error('Missing "data" input');if(!i.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const o=z6.util,a={cache:r,cube:i,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},s={key:()=>e,raw:()=>i,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,a),fields:()=>r.fields.slice(),extract:e=>a.extractor(e,s,r,o),hierarchy:e=>a.hierarchy(e,s,r,o),_cache:()=>r};"K"===i.qMode||"T"===i.qMode||!i.qMode&&i.qNodesOnDim?(a.extractor=r6,a.hierarchy=n6,a.pages="K"===i.qMode?i.qStackedDataPages:i.qTreeDataPages):"S"===i.qMode?(a.extractor=E4,a.pages=i.qDataPages,a.hierarchy=n6):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},s,r,o);const l="S"===i.qMode?e=>e.qElemNumber:void 0,c="S"===i.qMode?e=>e.qNum:void 0;r.wrappedFields.push(...j6("qDimensionInfo",i,e,"",w4({},a,{value:l,type:"dimension"}))),r.wrappedFields.push(...j6("qMeasureInfo",i,e,"",w4({},a,{value:c,type:"measure"}))),r.fields=r.wrappedFields.map((e=>e.instance));const u=e=>{e.forEach((e=>{r.allFields.push(e.instance),u(e.measures),u(e.attrDims),u(e.attrExps)}))};return u(r.wrappedFields),(n.virtualFields||[]).forEach((t=>{const n=s.field(t.from),i=N6(f4({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>a.extractor({field:e},s,r,o),key:t.key,type:n.type(),localeInfo:a.localeInfo,value:n.value},t.override||{}));r.virtualFields.push(i)})),r.allFields.push(...r.virtualFields),s}const F6=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],W6=/\/qDimensionInfo(?:\/(\d+))?/,$6=/\/qMeasureInfo\/(\d+)/,B6=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,V6=/\/qAttrExprInfo\/(\d+)/,H6=/\/?qHyperCube/,U6=/\/?qTreeData/,G6=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),Y6=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function K6(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],a={},s=e.isActive();let l=!1;if(e.brushes().forEach((e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",a=e=>e;H6.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=G6):U6.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=Y6);let s=!0;if(W6.test(e)&&(r=+W6.exec(e)[1]),$6.test(e)&&(i=+$6.exec(e)[1]),B6.test(e)){i=-1,r=0;const e=+B6.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(V6.test(e)){const e=i;if(t){i=0;const a=$4(o,t);i+=(a.qMeasureInfo||[]).length,r>-1?(i=a.qDimensionInfo.slice(0,r).reduce(((e,t)=>e+t.qAttrExprInfo.length),i),r=-1):(i=a.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),i),i=a.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),i)),i+=+V6.exec(n)[1]}else r>-1?(r=-1,i=+V6.exec(n)[1]):i+=+V6.exec(n)[1]+1}return F6.forEach((e=>{let[t,r]=e;n=n.replace(t,r)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}}))))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,s=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||s>=o)&&o>-1?n.forEach((e=>{a.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:s-o})})):n.forEach((e=>{a.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:t.path,cols:[]}),a.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!a.selectHyperCubeCells.values.length);else{const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}})),!l&&s)return[{method:"resetMadeSelections",params:[]}];var c;a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]});return a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o}function X6(e){z6.util=e.data("matrix").util,e.data("q",z6),e.formatter("q-number",S6),e.formatter("q-time",q6)}X6.qBrushHelper=K6,X6.selections=K6;var J6=Object.prototype.hasOwnProperty,Q6=Object.prototype.toString,Z6=Object.defineProperty,e8=Object.getOwnPropertyDescriptor,t8=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Q6.call(e)},n8=function(e){if(!e||"[object Object]"!==Q6.call(e))return!1;var t,n=J6.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&J6.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||J6.call(e,t)},r8=function(e,t){Z6&&"__proto__"===t.name?Z6(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},i8=function(e,t){if("__proto__"===t){if(!J6.call(e,t))return;if(e8)return e8(e,t).value}return e[t]},o8=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=i8(s,n),s!==(i=i8(t,n))&&(u&&i&&(n8(i)||(o=t8(i)))?(o?(o=!1,a=r&&t8(r)?r:[]):a=r&&n8(r)?r:{},r8(s,{name:n,newValue:e(u,a,i)})):void 0!==i&&r8(s,{name:n,newValue:i}));return s},a8="2.10.0";function s8(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c8(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l8(Object(n),!0).forEach((function(t){s8(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l8(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u8(e){return!!e.changedTouches}function d8(e){return"number"==typeof e&&!isNaN(e)}function f8(e){return"number"!=typeof e||isNaN(e)}function h8(e){const t=e.length;let n=NaN,r=NaN,i=NaN,o=NaN;for(let a=0;a<t;a++)n=isNaN(n)?e[a].x:Math.min(n,e[a].x),r=isNaN(r)?e[a].x:Math.max(r,e[a].x),i=isNaN(i)?e[a].y:Math.min(i,e[a].y),o=isNaN(o)?e[a].y:Math.max(o,e[a].y);return[n,i,r,o]}function p8(e){return[{x:e.x1||0,y:e.y1||0},{x:e.x2||0,y:e.y2||0}]}function m8(e){return[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}]}function g8(e){const[t,n,r,i]=h8(e);return{x:t,y:n,width:r-t,height:i-n}}function y8(e){return{x1:e[0].x,y1:e[0].y,x2:e[1].x,y2:e[1].y}}function v8(e){const{x:t,y:n,width:r,height:i,x1:o,x2:a,y1:s,y2:l,cx:c,cy:u,r:d,vertices:f}=e||{};return d8(c)&&d8(u)&&d8(d)?"circle":d8(o)&&d8(a)&&d8(s)&&d8(l)?"line":d8(t)&&d8(n)&&d8(r)&&d8(i)?"rect":d8(t)&&d8(n)?"point":Array.isArray(f)?f.every((e=>Array.isArray(e)))?"geopolygon":"polygon":null}function b8(e,t){return{x:t.x-e,y:t.y-e,width:t.width+e,height:t.height+e}}var x8=Math.PI,w8=2*x8,S8=1e-6,C8=w8-S8;function k8(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function E8(){return new k8}function M8(e){return function(){return e}}k8.prototype=E8.prototype={constructor:k8,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,o){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var o=this._x1,a=this._y1,s=n-e,l=r-t,c=o-e,u=a-t,d=c*c+u*u;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(d>S8)if(Math.abs(u*s-l*c)>S8&&i){var f=n-o,h=r-a,p=s*s+l*l,m=f*f+h*h,g=Math.sqrt(p),y=Math.sqrt(d),v=i*Math.tan((x8-Math.acos((p+d-m)/(2*g*y)))/2),b=v/y,x=v/g;Math.abs(b-1)>S8&&(this._+="L"+(e+b*c)+","+(t+b*u)),this._+="A"+i+","+i+",0,0,"+ +(u*f>c*h)+","+(this._x1=e+x*s)+","+(this._y1=t+x*l)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,n,r,i,o){e=+e,t=+t,o=!!o;var a=(n=+n)*Math.cos(r),s=n*Math.sin(r),l=e+a,c=t+s,u=1^o,d=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)>S8||Math.abs(this._y1-c)>S8)&&(this._+="L"+l+","+c),n&&(d<0&&(d=d%w8+w8),d>C8?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-s)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):d>S8&&(this._+="A"+n+","+n+",0,"+ +(d>=x8)+","+u+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var _8=Math.abs,R8=Math.atan2,I8=Math.cos,D8=Math.max,P8=Math.min,A8=Math.sin,O8=Math.sqrt,L8=1e-12,T8=Math.PI,q8=T8/2,N8=2*T8;function j8(e){return e>=1?q8:e<=-1?-q8:Math.asin(e)}function z8(e){return e.innerRadius}function F8(e){return e.outerRadius}function W8(e){return e.startAngle}function $8(e){return e.endAngle}function B8(e){return e&&e.padAngle}function V8(e,t,n,r,i,o,a){var s=e-n,l=t-r,c=(a?o:-o)/O8(s*s+l*l),u=c*l,d=-c*s,f=e+u,h=t+d,p=n+u,m=r+d,g=(f+p)/2,y=(h+m)/2,v=p-f,b=m-h,x=v*v+b*b,w=i-o,S=f*m-p*h,C=(b<0?-1:1)*O8(D8(0,w*w*x-S*S)),k=(S*b-v*C)/x,E=(-S*v-b*C)/x,M=(S*b+v*C)/x,_=(-S*v+b*C)/x,R=k-g,I=E-y,D=M-g,P=_-y;return R*R+I*I>D*D+P*P&&(k=M,E=_),{cx:k,cy:E,x01:-u,y01:-d,x11:k*(i/w-1),y11:E*(i/w-1)}}function H8(){var e=z8,t=F8,n=M8(0),r=null,i=W8,o=$8,a=B8,s=null;function l(){var l,c,u=+e.apply(this,arguments),d=+t.apply(this,arguments),f=i.apply(this,arguments)-q8,h=o.apply(this,arguments)-q8,p=_8(h-f),m=h>f;if(s||(s=l=E8()),d<u&&(c=d,d=u,u=c),d>L8)if(p>N8-L8)s.moveTo(d*I8(f),d*A8(f)),s.arc(0,0,d,f,h,!m),u>L8&&(s.moveTo(u*I8(h),u*A8(h)),s.arc(0,0,u,h,f,m));else{var g,y,v=f,b=h,x=f,w=h,S=p,C=p,k=a.apply(this,arguments)/2,E=k>L8&&(r?+r.apply(this,arguments):O8(u*u+d*d)),M=P8(_8(d-u)/2,+n.apply(this,arguments)),_=M,R=M;if(E>L8){var I=j8(E/u*A8(k)),D=j8(E/d*A8(k));(S-=2*I)>L8?(x+=I*=m?1:-1,w-=I):(S=0,x=w=(f+h)/2),(C-=2*D)>L8?(v+=D*=m?1:-1,b-=D):(C=0,v=b=(f+h)/2)}var P=d*I8(v),A=d*A8(v),O=u*I8(w),L=u*A8(w);if(M>L8){var T,q=d*I8(b),N=d*A8(b),j=u*I8(x),z=u*A8(x);if(p<T8&&(T=function(e,t,n,r,i,o,a,s){var l=n-e,c=r-t,u=a-i,d=s-o,f=d*l-u*c;if(!(f*f<L8))return[e+(f=(u*(t-o)-d*(e-i))/f)*l,t+f*c]}(P,A,j,z,q,N,O,L))){var F=P-T[0],W=A-T[1],$=q-T[0],B=N-T[1],V=1/A8(function(e){return e>1?0:e<-1?T8:Math.acos(e)}((F*$+W*B)/(O8(F*F+W*W)*O8($*$+B*B)))/2),H=O8(T[0]*T[0]+T[1]*T[1]);_=P8(M,(u-H)/(V-1)),R=P8(M,(d-H)/(V+1))}}C>L8?R>L8?(g=V8(j,z,P,A,d,R,m),y=V8(q,N,O,L,d,R,m),s.moveTo(g.cx+g.x01,g.cy+g.y01),R<M?s.arc(g.cx,g.cy,R,R8(g.y01,g.x01),R8(y.y01,y.x01),!m):(s.arc(g.cx,g.cy,R,R8(g.y01,g.x01),R8(g.y11,g.x11),!m),s.arc(0,0,d,R8(g.cy+g.y11,g.cx+g.x11),R8(y.cy+y.y11,y.cx+y.x11),!m),s.arc(y.cx,y.cy,R,R8(y.y11,y.x11),R8(y.y01,y.x01),!m))):(s.moveTo(P,A),s.arc(0,0,d,v,b,!m)):s.moveTo(P,A),u>L8&&S>L8?_>L8?(g=V8(O,L,q,N,u,-_,m),y=V8(P,A,j,z,u,-_,m),s.lineTo(g.cx+g.x01,g.cy+g.y01),_<M?s.arc(g.cx,g.cy,_,R8(g.y01,g.x01),R8(y.y01,y.x01),!m):(s.arc(g.cx,g.cy,_,R8(g.y01,g.x01),R8(g.y11,g.x11),!m),s.arc(0,0,u,R8(g.cy+g.y11,g.cx+g.x11),R8(y.cy+y.y11,y.cx+y.x11),m),s.arc(y.cx,y.cy,_,R8(y.y11,y.x11),R8(y.y01,y.x01),!m))):s.arc(0,0,u,w,x,m):s.lineTo(O,L)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-T8/2;return[I8(r)*n,A8(r)*n]},l.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:M8(+t),l):e},l.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:M8(+e),l):t},l.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:M8(+e),l):n},l.padRadius=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:M8(+e),l):r},l.startAngle=function(e){return arguments.length?(i="function"==typeof e?e:M8(+e),l):i},l.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:M8(+e),l):o},l.padAngle=function(e){return arguments.length?(a="function"==typeof e?e:M8(+e),l):a},l.context=function(e){return arguments.length?(s=null==e?null:e,l):s},l}function U8(e){this._context=e}function G8(e){return new U8(e)}function Y8(e){return e[0]}function K8(e){return e[1]}function X8(){var e=Y8,t=null,n=M8(0),r=K8,i=M8(!0),o=null,a=G8,s=null;function l(l){var c,u,d,f,h,p=l.length,m=!1,g=new Array(p),y=new Array(p);for(null==o&&(s=a(h=E8())),c=0;c<=p;++c){if(!(c<p&&i(f=l[c],c,l))===m)if(m=!m)u=c,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=c-1;d>=u;--d)s.point(g[d],y[d]);s.lineEnd(),s.areaEnd()}m&&(g[c]=+e(f,c,l),y[c]=+n(f,c,l),s.point(t?+t(f,c,l):g[c],r?+r(f,c,l):y[c]))}if(h)return s=null,h+""||null}function c(){return function(){var e=Y8,t=K8,n=M8(!0),r=null,i=G8,o=null;function a(a){var s,l,c,u=a.length,d=!1;for(null==r&&(o=i(c=E8())),s=0;s<=u;++s)!(s<u&&n(l=a[s],s,a))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+e(l,s,a),+t(l,s,a));if(c)return o=null,c+""||null}return a.x=function(t){return arguments.length?(e="function"==typeof t?t:M8(+t),a):e},a.y=function(e){return arguments.length?(t="function"==typeof e?e:M8(+e),a):t},a.defined=function(e){return arguments.length?(n="function"==typeof e?e:M8(!!e),a):n},a.curve=function(e){return arguments.length?(i=e,null!=r&&(o=i(r)),a):i},a.context=function(e){return arguments.length?(null==e?r=o=null:o=i(r=e),a):r},a}().defined(i).curve(a).context(o)}return l.x=function(n){return arguments.length?(e="function"==typeof n?n:M8(+n),t=null,l):e},l.x0=function(t){return arguments.length?(e="function"==typeof t?t:M8(+t),l):e},l.x1=function(e){return arguments.length?(t=null==e?null:"function"==typeof e?e:M8(+e),l):t},l.y=function(e){return arguments.length?(n="function"==typeof e?e:M8(+e),r=null,l):n},l.y0=function(e){return arguments.length?(n="function"==typeof e?e:M8(+e),l):n},l.y1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:M8(+e),l):r},l.lineX0=l.lineY0=function(){return c().x(e).y(n)},l.lineY1=function(){return c().x(e).y(r)},l.lineX1=function(){return c().x(t).y(n)},l.defined=function(e){return arguments.length?(i="function"==typeof e?e:M8(!!e),l):i},l.curve=function(e){return arguments.length?(a=e,null!=o&&(s=a(o)),l):a},l.context=function(e){return arguments.length?(null==e?o=s=null:s=a(o=e),l):o},l}function J8(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function Q8(e){return e}U8.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var Z8=Array.prototype.slice;function e7(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function t7(e){this._context=e}function n7(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function r7(e,t){this._context=e,this._k=(1-t)/6}t7.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:e7(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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);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:e7(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},r7.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:n7(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:n7(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var i7=function e(t){function n(e){return new r7(e,t)}return n.tension=function(t){return e(+t)},n}(0);function o7(e,t){this._context=e,this._alpha=t}o7.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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;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(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:!function(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>L8){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>L8){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,o,a,e._x2,e._y2)}(this,e,t)}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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var a7=function e(t){function n(e){return t?new o7(e,t):new r7(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function s7(e){return e<0?-1:1}function l7(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(s7(o)+s7(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function c7(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function u7(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function d7(e){this._context=e}function f7(e){this._context=new h7(e)}function h7(e){this._context=e}function p7(e){this._context=e}function m7(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,o[r-1]=7,a[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/o[t-1],o[t]-=n,a[t]-=n*a[t-1];for(i[r-1]=a[r-1]/o[r-1],t=r-2;t>=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function g7(e,t){this._context=e,this._t=t}function y7(e,t){if((i=e.length)>1)for(var n,r,i,o=1,a=e[t[0]],s=a.length;o<i;++o)for(r=a,a=e[t[o]],n=0;n<s;++n)a[n][1]+=a[n][0]=isNaN(r[n][1])?r[n][0]:r[n][1]}function v7(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function b7(e,t){return e[t]}function x7(e){for(var t,n=-1,r=0,i=e.length,o=-1/0;++n<i;)(t=+e[n][1])>o&&(o=t,r=n);return r}function w7(e){for(var t,n=0,r=-1,i=e.length;++r<i;)(t=+e[r][1])&&(n+=t);return n}function S7(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unspecified",r=arguments.length>2?arguments[2]:void 0;const i={},o=e||{get:()=>{},has:()=>!1,default:()=>{}};function a(e,t){if(!e||"string"!=typeof e)throw new TypeError("Invalid argument: key must be a non-empty string");return!(e in i)&&(i[e]=t,!0)}function s(e){return i[e]||o.get(e)}function l(e,i){if(void 0!==i)return a(e,i);const o=s(e);return r&&void 0===o&&r.warn("".concat(e," does not exist in ").concat(n," registry")),o||s(t)}return t=o.default(),l.add=a,l.get=s,l.has=function(e){return!!i[e]||o.has(e)},l.remove=function(e){const t=i[e];return delete i[e],t},l.getKeys=function(){return Object.keys(i)},l.getValues=function(){return Object.keys(i).map((e=>i[e]))},l.default=function(e){return void 0!==e&&(t=e),t},l.register=a,l}function C7(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function k7(e){return(e=C7(Math.abs(e)))?e[1]:NaN}d7.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:u7(this,this._t0,c7(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,u7(this,c7(this,n=l7(this,e,t)),n);break;default:u7(this,this._t0,n=l7(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(f7.prototype=Object.create(d7.prototype)).point=function(e,t){d7.prototype.point.call(this,t,e)},h7.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}},p7.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var r=m7(e),i=m7(t),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[a],t[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},g7.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var E7,M7=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function _7(e){if(!(t=M7.exec(e)))throw new Error("invalid format: "+e);var t;return new R7({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function R7(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function I7(e,t){var n=C7(e,t);if(!n)return e+"";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")}_7.prototype=R7.prototype,R7.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};var D7={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>I7(100*e,t),r:I7,s:function(e,t){var n=C7(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(E7=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+C7(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function P7(e){return e}var A7,O7,L7,T7=Array.prototype.map,q7=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function N7(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?P7:(t=T7.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(e.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?P7:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(T7.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function d(e){var t=(e=_7(e)).fill,n=e.align,d=e.sign,f=e.symbol,h=e.zero,p=e.width,m=e.comma,g=e.precision,y=e.trim,v=e.type;"n"===v?(m=!0,v="g"):D7[v]||(void 0===g&&(g=12),y=!0,v="g"),(h||"0"===t&&"="===n)&&(h=!0,t="0",n="=");var b="$"===f?i:"#"===f&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===f?o:/[%p]/.test(v)?l:"",w=D7[v],S=/[defgprs%]/.test(v);function C(e){var i,o,l,f=b,C=x;if("c"===v)C=w(e)+C,e="";else{var k=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:w(Math.abs(e),g),y&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(!+e[r])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),k&&0==+e&&"+"!==d&&(k=!1),f=(k?"("===d?d:c:"-"===d||"("===d?"":d)+f,C=("s"===v?q7[8+E7/3]:"")+C+(k&&"("===d?")":""),S)for(i=-1,o=e.length;++i<o;)if(48>(l=e.charCodeAt(i))||l>57){C=(46===l?a+e.slice(i+1):e.slice(i))+C,e=e.slice(0,i);break}}m&&!h&&(e=r(e,1/0));var E=f.length+e.length+C.length,M=E<p?new Array(p-E+1).join(t):"";switch(m&&h&&(e=r(M+e,M.length?p-C.length:1/0),M=""),n){case"<":e=f+e+C+M;break;case"=":e=f+M+e+C;break;case"^":e=M.slice(0,E=M.length>>1)+f+e+C+M.slice(E);break;default:e=M+f+e+C}return s(e)}return g=void 0===g?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),C.toString=function(){return e+""},C}return{format:d,formatPrefix:function(e,t){var n=d(((e=_7(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(k7(t)/3))),i=Math.pow(10,-r),o=q7[8+r/3];return function(e){return n(i*e)+o}}}}!function(e){A7=N7(e),O7=A7.format,L7=A7.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const j7=new Date,z7=new Date;function F7(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{const t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),i.range=(n,r,o)=>{const a=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return a;let s;do{a.push(s=new Date(+n)),t(n,o),e(n)}while(s<n&&n<r);return a},i.filter=n=>F7((t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),((e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););})),n&&(i.count=(t,r)=>(j7.setTime(+t),z7.setTime(+r),e(j7),e(z7),Math.floor(n(j7,z7))),i.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?t=>r(t)%e==0:t=>i.count(0,t)%e==0):i:null)),i}const W7=6e4,$7=864e5,B7=6048e5,V7=F7((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*W7)/$7),(e=>e.getDate()-1));V7.range;const H7=F7((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/$7),(e=>e.getUTCDate()-1));H7.range;const U7=F7((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/$7),(e=>Math.floor(e/$7)));function G7(e){return F7((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*W7)/B7))}U7.range;const Y7=G7(0),K7=G7(1),X7=G7(2),J7=G7(3),Q7=G7(4),Z7=G7(5),e9=G7(6);function t9(e){return F7((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/B7))}Y7.range,K7.range,X7.range,J7.range,Q7.range,Z7.range,e9.range;const n9=t9(0),r9=t9(1),i9=t9(2),o9=t9(3),a9=t9(4),s9=t9(5),l9=t9(6);n9.range,r9.range,i9.range,o9.range,a9.range,s9.range,l9.range;const c9=F7((e=>{e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear()));c9.every=e=>isFinite(e=Math.floor(e))&&e>0?F7((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n*e)})):null,c9.range;const u9=F7((e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));function d9(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function f9(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function h9(e){let t,n,r;function i(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<0?i=t+1:o=t}while(i<o)}return i}return 2!==e.length?(t=d9,n=(t,n)=>d9(e(t),n),r=(t,n)=>e(t)-n):(t=e===d9||e===f9?e:p9,n=e,r=e),{left:i,center:function(e,t,n=0,o=e.length){const a=i(e,t,n,o-1);return a>n&&r(e[a-1],t)>-r(e[a],t)?a-1:a},right:function(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<=0?i=t+1:o=t}while(i<o)}return i}}}function p9(){return 0}u9.every=e=>isFinite(e=Math.floor(e))&&e>0?F7((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null,u9.range;const m9=h9(d9).right;h9((function(e){return null===e?NaN:+e})).center;var g9=m9;class y9 extends Map{constructor(e,t=b9){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,n]of e)this.set(t,n)}get(e){return super.get(v9(this,e))}has(e){return super.has(v9(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},n){const r=t(n);e.has(r)&&(n=e.get(r),e.delete(r));return n}(this,e))}}function v9({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function b9(e){return null!==e&&"object"==typeof e?e.valueOf():e}const x9=Math.sqrt(50),w9=Math.sqrt(10),S9=Math.sqrt(2);function C9(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=x9?10:o>=w9?5:o>=S9?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/a,s=Math.round(e*c),l=Math.round(t*c),s/c<e&&++s,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*a,s=Math.round(e/c),l=Math.round(t/c),s*c<e&&++s,l*c>t&&--l),l<s&&.5<=n&&n<2?C9(e,t,2*n):[s,l,c]}function k9(e,t,n){return C9(e=+e,t=+t,n=+n)[2]}function E9(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function M9(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function _9(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function R9(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,c=T9(i),u=q9(i),d=T9(o),f=q9(o),h=T9(a),p=q9(a),m=T9(s),g=q9(s),y=T9(l),v=q9(l),b={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:ree,e:ree,f:lee,g:bee,G:wee,H:iee,I:oee,j:aee,L:see,m:cee,M:uee,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Vee,s:Hee,S:dee,u:fee,U:hee,V:mee,w:gee,W:yee,x:null,X:null,y:vee,Y:xee,Z:See,"%":Bee},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:Cee,e:Cee,f:Ree,g:zee,G:Wee,H:kee,I:Eee,j:Mee,L:_ee,m:Iee,M:Dee,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Vee,s:Hee,S:Pee,u:Aee,U:Oee,V:Tee,w:qee,W:Nee,x:null,X:null,y:jee,Y:Fee,Z:$ee,"%":Bee},w={a:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return k(e,t,n,r)},d:G9,e:G9,f:Z9,g:B9,G:$9,H:K9,I:K9,j:Y9,L:Q9,m:U9,M:X9,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1},q:H9,Q:tee,s:nee,S:J9,u:j9,U:z9,V:F9,w:N9,W:W9,x:function(e,t,r){return k(e,n,t,r)},X:function(e,t,n){return k(e,r,t,n)},y:B9,Y:$9,Z:V9,"%":eee};function S(e,t){return function(n){var r,i,o,a=[],s=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++s<c;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(i=I9[r=e.charAt(++s)])?r=e.charAt(++s):i="e"===r?" ":"0",(o=t[r])&&(r=o(n,i)),a.push(r),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function C(e,t){return function(n){var r,i,o=_9(1900,void 0,1);if(k(o,e,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(t&&!("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=M9(_9(o.y,0,1))).getUTCDay(),r=i>4||0===i?r9.ceil(r):r9(r),r=H7.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=E9(_9(o.y,0,1))).getDay(),r=i>4||0===i?K7.ceil(r):K7(r),r=V7.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?M9(_9(o.y,0,1)).getUTCDay():E9(_9(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,M9(o)):E9(o)}}function k(e,t,n,r){for(var i,o,a=0,s=t.length,l=n.length;a<s;){if(r>=l)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=w[i in I9?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=S(n,b),b.X=S(r,b),b.c=S(t,b),x.x=S(n,x),x.X=S(r,x),x.c=S(t,x),{format:function(e){var t=S(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=C(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+="",!0);return t.toString=function(){return e},t}}}var I9={"-":"",_:" ",0:"0"},D9=/^\s*\d+/,P9=/^%/,A9=/[\\^$*+?|[\]().{}]/g;function O9(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function L9(e){return e.replace(A9,"\\$&")}function T9(e){return new RegExp("^(?:"+e.map(L9).join("|")+")","i")}function q9(e){return new Map(e.map(((e,t)=>[e.toLowerCase(),t])))}function N9(e,t,n){var r=D9.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function j9(e,t,n){var r=D9.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function z9(e,t,n){var r=D9.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function F9(e,t,n){var r=D9.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function W9(e,t,n){var r=D9.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function $9(e,t,n){var r=D9.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function B9(e,t,n){var r=D9.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function V9(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function H9(e,t,n){var r=D9.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function U9(e,t,n){var r=D9.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function G9(e,t,n){var r=D9.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Y9(e,t,n){var r=D9.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function K9(e,t,n){var r=D9.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function X9(e,t,n){var r=D9.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function J9(e,t,n){var r=D9.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Q9(e,t,n){var r=D9.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Z9(e,t,n){var r=D9.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function eee(e,t,n){var r=P9.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function tee(e,t,n){var r=D9.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function nee(e,t,n){var r=D9.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function ree(e,t){return O9(e.getDate(),t,2)}function iee(e,t){return O9(e.getHours(),t,2)}function oee(e,t){return O9(e.getHours()%12||12,t,2)}function aee(e,t){return O9(1+V7.count(c9(e),e),t,3)}function see(e,t){return O9(e.getMilliseconds(),t,3)}function lee(e,t){return see(e,t)+"000"}function cee(e,t){return O9(e.getMonth()+1,t,2)}function uee(e,t){return O9(e.getMinutes(),t,2)}function dee(e,t){return O9(e.getSeconds(),t,2)}function fee(e){var t=e.getDay();return 0===t?7:t}function hee(e,t){return O9(Y7.count(c9(e)-1,e),t,2)}function pee(e){var t=e.getDay();return t>=4||0===t?Q7(e):Q7.ceil(e)}function mee(e,t){return e=pee(e),O9(Q7.count(c9(e),e)+(4===c9(e).getDay()),t,2)}function gee(e){return e.getDay()}function yee(e,t){return O9(K7.count(c9(e)-1,e),t,2)}function vee(e,t){return O9(e.getFullYear()%100,t,2)}function bee(e,t){return O9((e=pee(e)).getFullYear()%100,t,2)}function xee(e,t){return O9(e.getFullYear()%1e4,t,4)}function wee(e,t){var n=e.getDay();return O9((e=n>=4||0===n?Q7(e):Q7.ceil(e)).getFullYear()%1e4,t,4)}function See(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+O9(t/60|0,"0",2)+O9(t%60,"0",2)}function Cee(e,t){return O9(e.getUTCDate(),t,2)}function kee(e,t){return O9(e.getUTCHours(),t,2)}function Eee(e,t){return O9(e.getUTCHours()%12||12,t,2)}function Mee(e,t){return O9(1+H7.count(u9(e),e),t,3)}function _ee(e,t){return O9(e.getUTCMilliseconds(),t,3)}function Ree(e,t){return _ee(e,t)+"000"}function Iee(e,t){return O9(e.getUTCMonth()+1,t,2)}function Dee(e,t){return O9(e.getUTCMinutes(),t,2)}function Pee(e,t){return O9(e.getUTCSeconds(),t,2)}function Aee(e){var t=e.getUTCDay();return 0===t?7:t}function Oee(e,t){return O9(n9.count(u9(e)-1,e),t,2)}function Lee(e){var t=e.getUTCDay();return t>=4||0===t?a9(e):a9.ceil(e)}function Tee(e,t){return e=Lee(e),O9(a9.count(u9(e),e)+(4===u9(e).getUTCDay()),t,2)}function qee(e){return e.getUTCDay()}function Nee(e,t){return O9(r9.count(u9(e)-1,e),t,2)}function jee(e,t){return O9(e.getUTCFullYear()%100,t,2)}function zee(e,t){return O9((e=Lee(e)).getUTCFullYear()%100,t,2)}function Fee(e,t){return O9(e.getUTCFullYear()%1e4,t,4)}function Wee(e,t){var n=e.getUTCDay();return O9((e=n>=4||0===n?a9(e):a9.ceil(e)).getUTCFullYear()%1e4,t,4)}function $ee(){return"+0000"}function Bee(){return"%"}function Vee(e){return+e}function Hee(e){return Math.floor(+e/1e3)}const Uee=S7();Uee("d3-number",(function(e,t,n){let r,i;function o(e){return i(e)}function a(){o.locale({decimal:n||".",thousands:t||",",grouping:[3],currency:["$",""]})}return o.locale=function(t){return r=N7(t),i=r.format(e),this},a(),o.format=function(e,i,o,s){return(o||s)&&(t=o,n=s,a()),r.format(e)(i)},o.pattern=function(t){return t&&(e=t,i=r.format(t)),e},o})),Uee("d3-time",(function(e){let t=R9({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"]}),n=t.format(e);function r(e){return n(e)}return r.format=function(e,n){return t.format(e)(n)},r.locale=function(){return t=R9(...arguments),n=t.format(e),this},r.parse=function(e,n){return t.parse(e)(n)},r.parsePattern=function(e){return t.parse(e)},r}));const Gee={id:e=>"".concat(e.source,"/").concat(e.key||e.title),key:e=>String(e.key||e.title),tags:e=>e.tags,min:e=>e.min,max:e=>e.max,type:e=>e.type,title:e=>String(e.title),values:e=>e.values,value:e=>e,label:e=>e,formatter:e=>(e=>{if("function"==typeof e.formatter)return e.formatter();const t=e.formatter||{};return Uee(t.type||"d3-number")(t.format||"")})(e)};function Yee(e){let{id:t=Gee.id,key:n=Gee.key,min:r=Gee.min,max:i=Gee.max,type:o=Gee.type,tags:a=Gee.tags,title:s=Gee.title,values:l=Gee.values,value:c=Gee.value,label:u=Gee.label,formatter:d=Gee.formatter}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{id:()=>t(e),key:()=>n(e),raw:()=>e,tags:()=>a(e),type:()=>o(e),min:()=>r(e),max:()=>i(e),title:()=>s(e),items:()=>l(e),formatter:()=>d(e),value:c,label:u}}const Kee=e=>e.filter((e=>"number"==typeof e&&!isNaN(e))),Xee=e=>e.reduce(((e,t)=>e+t),0),Jee={first:e=>e[0],last:e=>e[e.length-1],min:e=>{const t=Kee(e);return t.length?Math.min.apply(null,t):NaN},max:e=>{const t=Kee(e);return t.length?Math.max.apply(null,t):NaN},sum:e=>{const t=Kee(e);return t.length?t.reduce(((e,t)=>e+t),0):NaN},avg:e=>{const t=Kee(e),n=t.length;return n?Xee(t)/n:NaN}};function Qee(e,t,n,r){const i={},o=r.field||(void 0!==e.field?t.field(e.field):null);return Object.keys(n).forEach((a=>{const s=n[a],l=i[a]={};-1!==["number","string","boolean"].indexOf(typeof s)?(l.type="primitive",l.value=s):"function"==typeof s?(l.type="function",l.value=s,l.label=s,l.field=o):"object"==typeof s&&(s.fields?l.fields=s.fields.map((n=>Qee(e,t,{main:n},r).main)):void 0!==s.field?(l.type="field",l.field=t.field(s.field),l.value=l.field.value,l.label=l.field.label):o&&(l.value=o.value,l.label=o.label,l.field=o),"function"==typeof s.filter&&(l.filter=s.filter),void 0!==s.value&&(l.value=s.value),void 0!==s.label&&(l.label=s.label),"function"==typeof s.reduce?l.reduce=s.reduce:s.reduce?l.reduce=Jee[s.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?Jee[l.field.reduce]:l.field.reduce),"function"==typeof s.reduceLabel?l.reduceLabel=s.reduceLabel:s.reduceLabel?l.reduceLabel=Jee[s.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?Jee[l.field.reduceLabel]:l.field.reduceLabel))})),i}function Zee(e,t){const{main:n}=Qee(e,t,{main:{value:e.value,label:e.label,reduce:e.reduce,filter:e.filter}},{});return{props:Qee(e,t,e.props||{},n),main:n}}function ete(e,t,n,r){const i=Array(e.length),o=Array(e.length);let a;for(let t=0;t<e.length;t++)a=r?e[t][r]:e[t],i[t]=a.value,o[t]=a.label;const s=t.reduce,l=t.reduceLabel,c=s?s(i):i,u={value:c,label:l?l(o,c):n?n(c):String(c)};return r&&e[0][r].source?(u.source=e[0][r].source,u):!r&&e[0].source?(u.source=e[0].source,u):u}function tte(e,t){let{main:n,propsArr:r,props:i}=t,o=[];const a=n.field.formatter(),s={};return r.forEach((e=>{s[e]=i[e].field?i[e].field.formatter():e=>e})),o.push(...e.map((e=>{const t=ete(e.items,n,a);return r.forEach((n=>{t[n]=ete(e.items,i[n],s[n],n)})),t}))),o}function nte(e){let{cfg:t,itemData:n,obj:r,target:i,tracker:o,trackType:a}=e;const s="function"===a?t.trackBy(n):n[t.trackBy];let l=o[s];l||(l=o[s]={items:[],id:s},i.push(l)),l.items.push(r)}function rte(e){if(e.length<1e4)return Math.max(...e);let t=-1/0;const n=e.length;for(let r=0;r<n;r++)t<e[r]&&(t=e[r]);return t}function ite(e){if(e.length<1e4)return Math.min(...e);let t=1/0;const n=e.length;for(let r=0;r<n;r++)t>e[r]&&(t=e[r]);return t}const ote={diverging:function(e,t){if((s=e.length)>0)for(var n,r,i,o,a,s,l=0,c=e[t[0]].length;l<c;++l)for(o=a=0,n=0;n<s;++n)(i=(r=e[t[n]][l])[1]-r[0])>=0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=a,r[0]=a+=i):r[0]=o},none:y7,silhouette:function(e,t){if((n=e.length)>0){for(var n,r=0,i=e[t[0]],o=i.length;r<o;++r){for(var a=0,s=0;a<n;++a)s+=e[a][r][1]||0;i[r][1]+=i[r][0]=-s/2}y7(e,t)}},expand:function(e,t){if((r=e.length)>0){for(var n,r,i,o=0,a=e[0].length;o<a;++o){for(i=n=0;n<r;++n)i+=e[n][o][1]||0;if(i)for(n=0;n<r;++n)e[n][o][1]/=i}y7(e,t)}},wiggle:function(e,t){if((i=e.length)>0&&(r=(n=e[t[0]]).length)>0){for(var n,r,i,o=0,a=1;a<r;++a){for(var s=0,l=0,c=0;s<i;++s){for(var u=e[t[s]],d=u[a][1]||0,f=(d-(u[a-1][1]||0))/2,h=0;h<s;++h){var p=e[t[h]];f+=(p[a][1]||0)-(p[a-1][1]||0)}l+=d,c+=f*d}n[a-1][1]+=n[a-1][0]=o,l&&(o-=c/l)}n[a-1][1]+=n[a-1][0]=o,y7(e,t)}}},ate={ascending:function(e){var t=e.map(w7);return v7(e).sort((function(e,n){return t[e]-t[n]}))},insideout:function(e){var t,n,r=e.length,i=e.map(w7),o=function(e){var t=e.map(x7);return v7(e).sort((function(e,n){return t[e]-t[n]}))}(e),a=0,s=0,l=[],c=[];for(t=0;t<r;++t)n=o[t],a<s?(a+=i[n],l.push(n)):(s+=i[n],c.push(n));return c.reverse().concat(l)},none:v7,reverse:function(e){return v7(e).reverse()}};function ste(e,t,n,r){const i=r||e.items,o={},a=t.stackKey,s=t.value,l=t.startProp||"start",c=t.endProp||"end",u=t.offset||"none",d=t.order||"none",f=t.valueRef||"";let h=0,p={};for(let e=0;e<i.length;e++){let t=i[e],n=f?t[f]:null;if(n&&n.source){let e="".concat(n.source.key||"","/").concat(n.source.field);p[e]||(p[e]=n.source)}let r=a(t);o[r]=o[r]||{items:[]},o[r].items.push(t),h=Math.max(h,o[r].items.length)}const m=Array.apply(null,{length:h}).map(Number.call,Number),g=Object.keys(o).map((e=>o[e].items)),y=function(){var e=M8([]),t=v7,n=y7,r=b7;function i(i){var o,a,s=e.apply(this,arguments),l=i.length,c=s.length,u=new Array(c);for(o=0;o<c;++o){for(var d,f=s[o],h=u[o]=new Array(l),p=0;p<l;++p)h[p]=d=[0,+r(i[p],f,p,i)],d.data=i[p];h.key=f}for(o=0,a=t(u);o<c;++o)u[a[o]].index=o;return n(u,a),u}return i.keys=function(t){return arguments.length?(e="function"==typeof t?t:M8(Z8.call(t)),i):e},i.value=function(e){return arguments.length?(r="function"==typeof e?e:M8(+e),i):r},i.order=function(e){return arguments.length?(t=null==e?v7:"function"==typeof e?e:M8(Z8.call(e)),i):t},i.offset=function(e){return arguments.length?(n=null==e?y7:e,i):n},i}().keys(m).value(((e,t)=>e[t]?s(e[t]):0)).order(ate[d]).offset(ote[u]);let v=y(g),b=[];for(let e=0;e<v.length;e++){let t=v[e];for(let e=0;e<t.length;e++){let n=t[e],r=t[e].data[t.key];r&&(r[l]={value:n[0]},r[c]={value:n[1]},b.push(n[0],n[1]))}}let x=Object.keys(p).map((e=>{let t=n(p[e].key);return t?t.field(p[e].field):null})).filter((e=>!!e));const w=Yee({title:x.map((e=>e.title())).join(", "),min:ite(b),max:rte(b),type:"measure",formatter:x[0]?x[0].formatter:void 0});e.fields.push(w)}function lte(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};const r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).logger;if(Array.isArray(e))n.items=e.map((e=>({value:e,label:String(e)})));else if(e){if("collection"in e)n=c8({},t.collection(e.collection));else{const i=t.dataset?t.dataset(e.source):null;let o=e.value||(e=>e),a=e.label||(e=>e);if(e.groupBy||e.mapTo)r.warn('Deprecated "data" configuration',e),n.items=[];else if(e.hierarchy)n.root=i.hierarchy?i.hierarchy(e.hierarchy):null,n.fields=i.fields();else if(e.items)n.items=e.skipNormalize?e.items:e.items.map((e=>({value:o(e),label:String(a(e))})));else if(e.extract){const r=Array.isArray(e.extract)?e.extract:[e.extract];n.items=[];const o=[];r.forEach((e=>{const r=e.source?t.dataset(e.source):i;r&&(n.items=[...n.items,...r.extract(e)],void 0!==e.field&&o.push(r.field(e.field)))})),o.length&&(n.fields=o),e.amend&&Array.isArray(e.amend)&&(n.items=[...n.items,...e.amend])}else if(void 0!==e.field&&i){const t=i.field(e.field);t&&(n.fields||(n.fields=[]),n.fields.push(t),"value"in e||(o=t.value||(e=>e),a=t.label||(e=>e),n.value=o),n.items=t.items().map((t=>({value:o(t),label:String(a(t)),source:{field:e.field}}))))}else e.fields&&e.fields.forEach((e=>{const r="object"==typeof e&&e.source?t.dataset(e.source):i;if(!r)return;let o;o="object"==typeof e&&void 0!==e.field?r.field(e.field):r.field(e),o&&(n.fields||(n.fields=[]),n.fields.push(o))}));n.items&&e.map&&(n.items=n.items.map(e.map))}e&&e.stack&&(Array.isArray(e.stack.stackByKey)?e.stack.stackByKey.forEach((r=>{const i=n.items.filter((e=>{var t;return(null===(t=e.key)||void 0===t?void 0:t.value)&&e.key.value===r}));ste(n,e.stack,t.dataset,i)})):ste(n,e.stack,t.dataset,n.items))}return e&&!Array.isArray(e)&&"function"==typeof e.filter&&n.items&&(n.items=n.items.filter(e.filter)),e&&!Array.isArray(e)&&"function"==typeof e.sort&&n.items&&(n.items=n.items.sort(e.sort)),n}function cte(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:lte;if(e.data){const r=i(e.data,t,n);if(r&&r.fields&&r.fields[0])return r.fields[0].formatter()}if(r=e.formatter?"".concat(e.formatter,"-").concat(e.type||"number"):e.type||"d3-number",n.formatter.has(r)){return n.formatter.get(r)(e.format||"")}throw new Error("Formatter of type '".concat(r,"' was not found"))}function ute(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}const dte=Symbol("implicit");function fte(){var e=new y9,t=[],n=[],r=dte;function i(i){let o=e.get(i);if(void 0===o){if(r!==dte)return r;e.set(i,o=t.push(i)-1)}return n[o%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new y9;for(const r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return fte(t,n).unknown(r)},ute.apply(i,arguments),i}function hte(){var e,t,n=fte().unknown(void 0),r=n.domain,i=n.range,o=0,a=1,s=!1,l=0,c=0,u=.5;function d(){var n=r().length,d=a<o,f=d?a:o,h=d?o:a;e=(h-f)/Math.max(1,n-l+2*c),s&&(e=Math.floor(e)),f+=(h-f-e*(n-l))*u,t=e*(1-l),s&&(f=Math.round(f),t=Math.round(t));var p=function(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++r<i;)o[r]=e+r*n;return o}(n).map((function(t){return f+e*t}));return i(d?p.reverse():p)}return delete n.unknown,n.domain=function(e){return arguments.length?(r(e),d()):r()},n.range=function(e){return arguments.length?([o,a]=e,o=+o,a=+a,d()):[o,a]},n.rangeRound=function(e){return[o,a]=e,o=+o,a=+a,s=!0,d()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(s=!!e,d()):s},n.padding=function(e){return arguments.length?(l=Math.min(1,c=+e),d()):l},n.paddingInner=function(e){return arguments.length?(l=Math.min(1,e),d()):l},n.paddingOuter=function(e){return arguments.length?(c=+e,d()):c},n.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},n.copy=function(){return hte(r(),[o,a]).round(s).paddingInner(l).paddingOuter(c).align(u)},ute.apply(d(),arguments)}function pte(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function mte(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function gte(){}var yte=.7,vte=1/yte,bte="\\s*([+-]?\\d+)\\s*",xte="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",wte="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ste=/^#([0-9a-f]{3,8})$/,Cte=new RegExp(`^rgb\\(${bte},${bte},${bte}\\)$`),kte=new RegExp(`^rgb\\(${wte},${wte},${wte}\\)$`),Ete=new RegExp(`^rgba\\(${bte},${bte},${bte},${xte}\\)$`),Mte=new RegExp(`^rgba\\(${wte},${wte},${wte},${xte}\\)$`),_te=new RegExp(`^hsl\\(${xte},${wte},${wte}\\)$`),Rte=new RegExp(`^hsla\\(${xte},${wte},${wte},${xte}\\)$`),Ite={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 Dte(){return this.rgb().formatHex()}function Pte(){return this.rgb().formatRgb()}function Ate(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ste.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Ote(t):3===n?new qte(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Lte(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Lte(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Cte.exec(e))?new qte(t[1],t[2],t[3],1):(t=kte.exec(e))?new qte(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Ete.exec(e))?Lte(t[1],t[2],t[3],t[4]):(t=Mte.exec(e))?Lte(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=_te.exec(e))?$te(t[1],t[2]/100,t[3]/100,1):(t=Rte.exec(e))?$te(t[1],t[2]/100,t[3]/100,t[4]):Ite.hasOwnProperty(e)?Ote(Ite[e]):"transparent"===e?new qte(NaN,NaN,NaN,0):null}function Ote(e){return new qte(e>>16&255,e>>8&255,255&e,1)}function Lte(e,t,n,r){return r<=0&&(e=t=n=NaN),new qte(e,t,n,r)}function Tte(e,t,n,r){return 1===arguments.length?function(e){return e instanceof gte||(e=Ate(e)),e?new qte((e=e.rgb()).r,e.g,e.b,e.opacity):new qte}(e):new qte(e,t,n,null==r?1:r)}function qte(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Nte(){return`#${Wte(this.r)}${Wte(this.g)}${Wte(this.b)}`}function jte(){const e=zte(this.opacity);return`${1===e?"rgb(":"rgba("}${Fte(this.r)}, ${Fte(this.g)}, ${Fte(this.b)}${1===e?")":`, ${e})`}`}function zte(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Fte(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Wte(e){return((e=Fte(e))<16?"0":"")+e.toString(16)}function $te(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Vte(e,t,n,r)}function Bte(e){if(e instanceof Vte)return new Vte(e.h,e.s,e.l,e.opacity);if(e instanceof gte||(e=Ate(e)),!e)return new Vte;if(e instanceof Vte)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Vte(a,s,l,e.opacity)}function Vte(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Hte(e){return(e=(e||0)%360)<0?e+360:e}function Ute(e){return Math.max(0,Math.min(1,e||0))}function Gte(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}pte(gte,Ate,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Dte,formatHex:Dte,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Bte(this).formatHsl()},formatRgb:Pte,toString:Pte}),pte(qte,Tte,mte(gte,{brighter(e){return e=null==e?vte:Math.pow(vte,e),new qte(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?yte:Math.pow(yte,e),new qte(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new qte(Fte(this.r),Fte(this.g),Fte(this.b),zte(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:Nte,formatHex:Nte,formatHex8:function(){return`#${Wte(this.r)}${Wte(this.g)}${Wte(this.b)}${Wte(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:jte,toString:jte})),pte(Vte,(function(e,t,n,r){return 1===arguments.length?Bte(e):new Vte(e,t,n,null==r?1:r)}),mte(gte,{brighter(e){return e=null==e?vte:Math.pow(vte,e),new Vte(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?yte:Math.pow(yte,e),new Vte(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new qte(Gte(e>=240?e-240:e+120,i,r),Gte(e,i,r),Gte(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Vte(Hte(this.h),Ute(this.s),Ute(this.l),zte(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 e=zte(this.opacity);return`${1===e?"hsl(":"hsla("}${Hte(this.h)}, ${100*Ute(this.s)}%, ${100*Ute(this.l)}%${1===e?")":`, ${e})`}`}}));var Yte=e=>()=>e;function Kte(e){return 1==(e=+e)?Xte:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):Yte(isNaN(t)?n:t)}}function Xte(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Yte(isNaN(e)?t:e)}var Jte=function e(t){var n=Kte(t);function r(e,t){var r=n((e=Tte(e)).r,(t=Tte(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Xte(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function Qte(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(o){for(n=0;n<r;++n)i[n]=e[n]*(1-o)+t[n]*o;return i}}function Zte(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=ane(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<i;++n)a[n]=o[n](e);return a}}function ene(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function tne(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function nne(e,t){var n,r={},i={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=ane(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var rne=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ine=new RegExp(rne.source,"g");function one(e,t){var n,r,i,o=rne.lastIndex=ine.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=rne.exec(e))&&(r=ine.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:tne(n,r)})),o=ine.lastIndex;return o<t.length&&(i=t.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}function ane(e,t){var n,r=typeof t;return null==t||"boolean"===r?Yte(t):("number"===r?tne:"string"===r?(n=Ate(t))?(t=n,Jte):one:t instanceof Ate?Jte:t instanceof Date?ene:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?Qte:Array.isArray(t)?Zte:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?nne:tne)(e,t)}function sne(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function lne(e){return+e}var cne=[0,1];function une(e){return e}function dne(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function fne(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=dne(i,r),o=n(a,o)):(r=dne(r,i),o=n(o,a)),function(e){return o(r(e))}}function hne(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=dne(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=g9(e,t,1,r)-1;return o[n](i[n](t))}}function pne(){var e,t,n,r,i,o,a=cne,s=cne,l=ane,c=une;function u(){var e=Math.min(a.length,s.length);return c!==une&&(c=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(a[0],a[e-1])),r=e>2?hne:fne,i=o=null,d}function d(t){return null==t||isNaN(t=+t)?n:(i||(i=r(a.map(e),s,l)))(e(c(t)))}return d.invert=function(n){return c(t((o||(o=r(s,a.map(e),tne)))(n)))},d.domain=function(e){return arguments.length?(a=Array.from(e,lne),u()):a.slice()},d.range=function(e){return arguments.length?(s=Array.from(e),u()):s.slice()},d.rangeRound=function(e){return s=Array.from(e),l=sne,u()},d.clamp=function(e){return arguments.length?(c=!!e||une,u()):c!==une},d.interpolate=function(e){return arguments.length?(l=e,u()):l},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,u()}}function mne(e,t,n,r){var i,o=function(e,t,n){n=+n;const r=(t=+t)<(e=+e),i=r?k9(t,e,n):k9(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}(e,t,n);switch((r=_7(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(k7(t)/3)))-k7(Math.abs(e)))}(o,a))||(r.precision=i),L7(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,k7(t)-k7(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-k7(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return O7(r)}function gne(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){if(!((n=+n)>0))return[];if((e=+e)==(t=+t))return[e];const r=t<e,[i,o,a]=r?C9(t,e,n):C9(e,t,n);if(!(o>=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let e=0;e<s;++e)l[e]=(o-e)/-a;else for(let e=0;e<s;++e)l[e]=(o-e)*a;else if(a<0)for(let e=0;e<s;++e)l[e]=(i+e)/-a;else for(let e=0;e<s;++e)l[e]=(i+e)*a;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return mne(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i,o=t(),a=0,s=o.length-1,l=o[a],c=o[s],u=10;for(c<l&&(i=l,l=c,c=i,i=a,a=s,s=i);u-- >0;){if((i=k9(l,c,n))===r)return o[a]=l,o[s]=c,t(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 e},e}function yne(){var e=pne()(une,une);return e.copy=function(){return function(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}(e,yne())},ute.apply(e,arguments),gne(e)}function vne(){var e,t=[.5],n=[0,1],r=1;function i(i){return null!=i&&i<=i?n[g9(t,i,0,r)]:e}return i.domain=function(e){return arguments.length?(t=Array.from(e),r=Math.min(t.length,n.length-1),i):t.slice()},i.range=function(e){return arguments.length?(n=Array.from(e),r=Math.min(t.length,n.length-1),i):n.slice()},i.invertExtent=function(e){var r=n.indexOf(e);return[t[r-1],t[r]]},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return vne().domain(t).range(n).unknown(e)},ute.apply(i,arguments)}function bne(e){return void 0===e?e=>e:t=>e(t)}function xne(e){return Math.max(0,Math.min(1,e))}function wne(e){return"object"==typeof e}function Sne(e,t,n){const r=Math.abs(t-n)/(e+1),i=[];for(let o=1;o<=e;o++){const e=o*r;i.push(t<n?t+e:t-e)}return i}function Cne(e,t,n){if(1===e.length)return e;const r=e.concat([]);for(let i=0;i<e.length;i++){let o=e[i],a=e[i+1];0===i&&o!==n.start()?(r.push(...Sne(t,o,a)),o-=a-o,a=e[i],r.push(...Sne(t,o,a))):i===e.length-1&&a!==n.end()?(a=o+(o-e[i-1]),r.push(...Sne(t,o,a))):r.push(...Sne(t,o,a))}return r.filter((e=>e>=n.min()&&e<=n.max()))}function kne(e){let{distance:t,scale:n,minorCount:r=0,unitDivider:i=100,formatter:o}=e;const a=f8(i)||f8(t)?2:Math.max(t/i,2),s=Math.min(1e3,Math.round(a));let l=n.ticks(s);l.length<=1&&(l=n.ticks(s+1));const c=r>0?Cne(l,r,n):l;c.sort(((e,t)=>e-t));const u=c.map(bne(o));return c.map(((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:u[t],value:e,isMinor:-1===l.indexOf(e)}}))}function Ene(e){let{distance:t,scale:n,minorCount:r=0,unitDivider:i=100,formatter:o}=e;const a=f8(i)||f8(t)?2:Math.max(t/i,2),s=Math.min(1e3,Math.round(a)),l=s>10?10:s;n.nice(l);const c=n.ticks(s),u=r>0?Cne(c,r,n):c;u.sort(((e,t)=>e-t));const d=u.map(bne(o));return u.map(((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:d[t],value:e,isMinor:-1===c.indexOf(e)}}))}function Mne(e){let t,{settings:n,scale:r,distance:i,formatter:o=e=>e}=e;const a=n.minorTicks&&!f8(n.minorTicks.count)?Math.min(100,n.minorTicks.count):0;if(Array.isArray(n.ticks.values)){const e=n.ticks.values.filter((e=>"object"==typeof e?!f8(e.value):!f8(e)));t=function(e){let{values:t,scale:n,formatter:r=e=>e}=e;return t.sort(((e,t)=>(wne(e)?e.value:e)-(wne(t)?t.value:t))).filter(((e,t,r)=>{const i=wne(e)?e.value:e;return i<=n.max()&&i>=n.min()&&r.indexOf(e)===t})).map((e=>{const t=wne(e),i=t?e.value:e,o=n(i);return{position:o,value:i,label:t&&void 0!==e.label?e.label:r(i),isMinor:!!t&&!!e.isMinor,start:t&&!isNaN(e.start)?xne(n(e.start)):o,end:t&&!isNaN(e.end)?xne(n(e.end)):o}}))}({values:e,scale:r.copy(),formatter:o})}else if(f8(n.ticks.count)){t=(n.ticks.tight?Ene:kne)({distance:i,minorCount:a,unitDivider:n.ticks.distance,scale:r,formatter:o}),n.ticks.forceBounds&&function(e,t,n){const r=e.map((e=>e.position)),i=t.range();-1===r.indexOf(i[0])?e.splice(0,0,{position:i[0],start:i[0],end:i[0],label:n(t.start()),isMinor:!1,value:t.start()}):e[0]&&e[0].isMinor&&(e[0].isMinor=!1);const o=e[e.length-1];-1===r.indexOf(i[1])?e.push({position:i[1],start:i[1],end:i[1],label:n(t.end()),isMinor:!1,value:t.end()}):o&&o.isMinor&&(o.isMinor=!1)}(t,r,o)}else{t=function(e){let{count:t,minorCount:n,scale:r,formatter:i}=e;return r.ticks((t-1)*n+t).map(((e,t)=>{const o=r(e);return{position:o,start:o,end:o,label:i(e),isMinor:t%(n+1)!=0,value:e}}))}({count:Math.min(1e3,n.ticks.count),minorCount:a,scale:r.copy(),formatter:o})}return t}function _ne(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r={};return Object.keys(t).forEach((i=>{const o=typeof e[i];r[i]="function"===o?e[i](n):"undefined"===o?t[i]:e[i]})),r}const Rne={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},Ine={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},Dne={count:NaN};function Pne(e,t){e.instance||(e.instance=t.copy(),e.instance.domain([t.start(),t.end()]),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}function Ane(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=yne(),i={instance:null,invert:!1},o={data:t,resources:n},a=_ne(e,Rne,o);let s;function l(e){return f8(e)?NaN:r(e)}a.ticks=_ne(e.ticks,Ine,o),a.minorTicks=_ne(e.minorTicks,Dne,o),l.data=()=>t,l.invert=function(e){return r.invert(e)},l.rangeRound=function(e){return r.rangeRound(e),l},l.clamp=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return r.clamp(e),l},l.cachedTicks=function(){return s},l.clearTicksCache=function(){return s=void 0,this},l.ticks=function(e){return null!==e&&"object"==typeof e?(e.settings=e.settings||{},e.settings=o8(!0,{},a,e.settings),e.scale=l,s=Mne(e),s):(s=r.ticks(e),s)},l.nice=function(e){return r.nice(e),l},l.tickFormat=function(e,t){return r.tickFormat(e,t)},l.interpolate=function(e){return r.interpolate(e),l},l.domain=function(e){return arguments.length?(r.domain(e),i.instance&&i.instance.domain([l.start(),l.end()]),l):r.domain()},l.range=function(e){return arguments.length?(r.range(e),l):r.range()},l.start=function(){return l.domain()[0]},l.end=function(){return l.domain()[this.domain().length-1]},l.min=function(){return Math.min(this.start(),this.end())},l.max=function(){return Math.max(this.start(),this.end())},l.classify=function(e){let t=(l.start()-l.end())/e,n=[l.end()],r=[],i=t/2;for(let o=0;o<e;o++){let e=n[n.length-1]||0,o=e+t,a=l(e+i);n.push(o,o),r.push(a,a)}return n.pop(),l.domain(n),l.range(r),l},l.copy=function(){const i=Ane(e,t,n);return i.domain(l.domain()),i.range(l.range()),i.clamp(r.clamp()),i},l.norm=function(e){return Pne(i,l),i.instance(e)},l.normInvert=function(e){return Pne(i,l),i.instance.invert(e)};const{mini:c,maxi:u}=function(e,t){const n=+e.min,r=+e.max;let i=0,o=1;if(t&&t[0]){const n=t.map((e=>e.min())).filter((e=>!isNaN(e))),r=t.map((e=>e.max())).filter((e=>!isNaN(e)));if(i=n.length?Math.min(...n):Number.NaN,o=r.length?Math.max(...r):Number.NaN,isNaN(i)||isNaN(o))i=-1,o=1;else if(i===o&&0===i)i=-1,o=1;else if(i===o&&i)i-=Math.abs(.1*i),o+=Math.abs(.1*o);else if(!isNaN(e.expand)){const t=o-i;i-=t*e.expand,o+=t*e.expand}if(Array.isArray(e.include)){const t=e.include.filter((e=>!isNaN(e)));i=Math.min(...t,i),o=Math.max(...t,o)}}return{mini:isNaN(n)?i:n,maxi:isNaN(r)?o:r}}(a,t?t.fields:[]);return l.domain([c,u]),l.range(a.invert?[1,0]:[0,1]),i.invert=a.invert,l}const One={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function Lne(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={data:t,resources:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}},r=_ne(e,One,n),i=t.items||[],o={},a=[],s=[];function l(e,n){e.data=()=>t,e.datum=e=>i[o[e]],e.start=function(){return e.domain()[0]},e.end=function(){return e.domain()[e.domain().length-1]},e.labels=()=>s,e.ticks=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.scale=e,function(e){let{scale:t}=e;const n=t.domain(),r=t.data().items,i=t.labels?t.labels():n,o=t.bandwidth();return n.map(((e,n)=>{const a=t(e);return{position:a+o/2,label:"".concat(i[n]),data:r?r[n]:void 0,start:a,end:a+o}}))}(t,n.trackBy)}}const c=hte();l(c,e),c.pxScale=function(t){const n=r.maxPxStep;if(isNaN(n))return c;const i=c.domain().length,o=Math.max(1,i-c.paddingInner()+2*c.paddingOuter());if(o*n>=t)return c;const a=c.copy();a.type=c.type,l(a,e);const s=o*n/t,u=(1-s)*c.align();return a.range(r.invert?[s+u,u]:[u,s+u]),a};const u="function"==typeof e.value?e.value:e=>e.datum.value,d="function"==typeof e.label?e.label:e=>e.datum.label;for(let e=0;e<i.length;e++){const t=o8({datum:i[e]},n),r=u(t,e);-1===a.indexOf(r)&&(a.push(r),s.push(d(t,e)),o[r]=e)}return c.domain(a),c.range(r.invert?r.range.slice().reverse():r.range),c.padding(isNaN(r.padding)?0:r.padding),isNaN(r.paddingInner)||c.paddingInner(r.paddingInner),isNaN(r.paddingOuter)||c.paddingOuter(r.paddingOuter),c.align(isNaN(r.align)?.5:r.align),c}const Tne={depth:0};function qne(e,t,n){return e.ancestors().map((e=>t(o8({datum:e.data},n)))).reverse().slice(1).toString()}const Nne=e=>e.min(),jne=e=>e.max();function zne(e,t){const n=e&&!isNaN(e.min),r=e&&!isNaN(e.max);let i=n?+e.min:0,o=r?+e.max:1;if(t&&t.length){if(!n){const e=t.map(Nne).filter(d8);i=e.length?Math.min(...e):i}if(!r){const e=t.map(jne).filter(d8);o=e.length?Math.max(...e):o}}return[i,o]}const Fne={domain:[],range:[],invert:!1,min:NaN,max:NaN};function Wne(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=Ane(e,t,n).clamp(!0).interpolate(Jte),i=_ne(e,Fne,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length,s=r;o8(!0,s,r);const[l,c]=zne(i,t?t.fields:[]),u=o?i.domain.length:-1,d=n.theme?n.theme.palette("sequential",u>0?u:2):[],f=a?i.range:d;return s.range(i.invert?f.slice().reverse():f.slice()),s.domain(o?i.domain:function(e,t,n){const r=e.length;if(2===r)return[t,n];const i=[],o=(n-t)/(r-1);i.push(t);for(let e=1;e<r-1;e++)i.push(t+o*e);return i.push(n),i}(s.range(),l,c)),s}const $ne={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function Bne(e){const t=[];for(let n=0;n<e.length-1;n++)t.push((e[n]+e[n+1])/2);return t}const Vne={domain:[],range:[]};const Hne={domain:[],range:[],unknown:void 0},Une={domain:[],range:[],override:!1};const Gne=S7();function Yne(e,t,n){let r=e.data;e.source&&(n.logger.warn("Deprecated: Scale data source configuration"),r={extract:[]},(Array.isArray(e.source)?e.source:[e.source]).forEach((e=>{r.extract.push({field:e})})));const i=lte(r,t,n);let o,a=e.type||function(e){return e.root?"h-band":e.fields&&e.fields[0]?function(e){const t=e.map((e=>"dimension"===e.type()?"band":"linear"));return-1!==t.indexOf("linear")?"linear":"band"}(e.fields):"linear"}(i);return"color"===a&&(a=i.fields&&i.fields[0]&&"dimension"===i.fields[0].type()?"categorical-color":"sequential-color"),n.scale.has(a)&&(o=n.scale.get(a),o=o(e,i,{theme:n.theme,logger:n.logger}),o.type=a),o}Gne("linear",Ane),Gne("band",Lne),Gne("h-band",(function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={data:n,resources:r},o=_ne(t,One,i);o.ticks=_ne(t.ticks,Tne,i),o.value="function"==typeof t.value?t.value:e=>e.datum.value,o.label="function"==typeof t.label?t.label:e=>e.datum.value;let a=Lne(o);const{values:s,labels:l,items:c,ticks:u}=function(e,t,n){const r=t.ticks.depth,i=t.value,o=t.label,a=[],s=[],l={},c=[];let u=0;if(!e)return{values:a,labels:s,items:l,ticks:c};e.eachAfter((e=>{if(e.depth>0){const t=qne(e,i,n),d=e.leaves()||[e],f=i(o8({datum:e.data},n)),h=o(o8({datum:e.data},n)),p=Array.isArray(e.children),m={key:t,count:d.length,value:f,label:h,leftEdge:qne(d[0],i,n),rightEdge:qne(d[Math.max(d.length-1,0)],i,n),node:e};p?(a.push("SPACER_".concat(u,"_SPACER")),u++):(a.push(t),s.push(h)),(r<=0&&!p||e.depth===r)&&c.push(m),l[t]=m}}));const d=e.height-1;return d>0&&a.splice(-d),{values:a,labels:s,items:l,ticks:c}}(n.root,o,i),d=function(e){const t=String(e),n=c[t];return a(n?o.invert?n.rightEdge:n.leftEdge:t)};o8(!0,d,a),d.bandwidth=function(e){const t=c[String(e)],n=a.bandwidth();if(t&&!t.isLeaf){const e=d(t.leftEdge),r=d(t.rightEdge);return Math.abs(e-r)+n}return n},d.step=function(e){const t=c[String(e)],n=t?t.count:1;let r=a.step();return r*=n,r},d.data=()=>n,d.datum=e=>{const t=c[String(e)];return t?t.node.data:null},d.copy=()=>e(t,n,r),d.labels=()=>l,d.ticks=()=>u.map((e=>{const t=d(e.key),n=d.bandwidth(e.key);return{position:t+n/2,label:e.label,data:e.node.data,start:t,end:t+n}}));const f=a.pxScale;return d.pxScale=function(e){return a=f(e),d},d.domain(s),d})),Gne("sequential-color",Wne),Gne("threshold-color",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=vne(),i=_ne(e,$ne,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length;function s(e){return f8(e)?NaN:r(e)}Object.keys(r).forEach((e=>s[e]=r[e]));const l=t.fields,[c,u]=zne(i,l),d=o?i.domain.length:-1,f=n.theme?n.theme.palette("sequential",d>0?d:2):[];let h=a?i.range:f,p=[];return p=o?i.domain:i.nice?function(e,t,n){const r=2===e.length?10:Math.max(1,e.length),i=yne().domain([t,n]).nice(r).ticks(r);if(!e||!e.length)return i;const o=Math.max(0,e.length-1);for(;i.length>o;)i[0]-t<=n-i[i.length-1]?i.shift():i.pop();return i}(h,c,u):[c+(u-c)/2],h.length>p.length+1?p=function(e,t,n){const r=e.length;if(2===r)return[t+(n-t)/2];const i=[],o=(n-t)/r;for(let e=1;e<r;e++)i.push(t+o*e);return i}(h,c,u):h.length<p.length+1&&(h=function(e,t,n,r){n=e[0],r=e&&e.length>=2?e[e.length-1]:r;const i=Wne().domain([n,r]).range(t);return[n,...Bne(e),r].map((e=>i(e)))}(p,h,c,u)),s.data=()=>t,s.range(i.invert?h.slice().reverse():h),s.domain(p),s})),Gne("categorical-color",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=fte(),i={data:t,resources:n},o=_ne(e,Vne,i),a="function"==typeof e.value?e.value:e=>e.datum.value,s="function"==typeof e.label?e.label:e=>e.datum.label,l=t.items||[],c={},u=[],d=[];for(let e=0;e<l.length;e++){const t=o8({datum:l[e]},i),n=a(t,e);-1===u.indexOf(n)&&(u.push(n),d.push(s(t,e)),c[n]=e)}return r.data=()=>t,r.labels=()=>d,r.label=e=>d[u.indexOf(e)],r.datum=e=>l[c[e]],r.range(o.range),Array.isArray(o.domain)&&o.domain.length?r.domain(o.domain):r.domain(u),r}(e,t,n),i=n.theme,o=_ne(e,Hne,{data:t,resources:n});let a;if(o.explicit=_ne(e.explicit,Une,{data:t,resources:n}),a=Array.isArray(o.range)&&0!==o.range.length?o.range.slice():i?i.palette("categorical",r.domain().length).slice():[],o.unknown)r.unknown(o.unknown);else if(i&&i.palette("unknown")){let e=i.palette("unknown");r.unknown(e[0])}if(Array.isArray(o.explicit.domain)&&o.explicit.domain.length){const e=r.domain().slice(),t=o.explicit.domain,n=Array.isArray(o.explicit.range)?o.explicit.range:[],i=Math.floor(e.length/a.length);for(let e=1;e<i+1;e*=2)a=a.concat(a);if(o.explicit.override)for(let r=0;r<t.length;r++){const i=e.indexOf(t[r]);i>-1&&(a[i]=n[r])}else{const r=t.map(((t,r)=>[e.indexOf(t),t,n[r]])).sort(((e,t)=>e[0]-t[0]));r.forEach((t=>{const n=e.indexOf(t[1]);-1!==n&&a.splice(n,0,t[2])}))}a.length=e.length}return r.range(a),r}));var Kne={};function Xne(){Xne.init.call(this)}Kne.isObject=function(e){return"object"==typeof e&&null!==e},Kne.isNumber=function(e){return"number"==typeof e},Kne.isUndefined=function(e){return void 0===e},Kne.isFunction=function(e){return"function"==typeof e};var Jne=Xne;Xne.EventEmitter=Xne,Xne.prototype._events=void 0,Xne.prototype._maxListeners=void 0,Xne.defaultMaxListeners=10,Xne.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},Xne.prototype.setMaxListeners=function(e){if(!Kne.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},Xne.prototype.emit=function(e){var t,n,r,i,o,a;if(this._events||(this._events={}),"error"===e&&!this._events.error)throw(t=arguments[1])instanceof Error?t:Error('Uncaught, unspecified "error" event.');if(n=this._events[e],Kne.isUndefined(n))return!1;if(Kne.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];n.apply(this,i)}else if(Kne.isObject(n)){for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];for(r=(a=n.slice()).length,o=0;o<r;o++)a[o].apply(this,i)}return!0},Xne.prototype.addListener=function(e,t){var n;if(!Kne.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,Kne.isFunction(t.listener)?t.listener:t),this._events[e]?Kne.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,Kne.isObject(this._events[e])&&!this._events[e].warned)&&((n=Kne.isUndefined(this._maxListeners)?Xne.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,Kne.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),Kne.isFunction(console.trace)&&console.trace()));return this},Xne.prototype.on=Xne.prototype.addListener,Xne.prototype.once=function(e,t){if(!Kne.isFunction(t))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}return r.listener=t,this.on(e,r),this},Xne.prototype.removeListener=function(e,t){var n,r,i,o;if(!Kne.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(n=this._events[e]).length,r=-1,n===t||Kne.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(Kne.isObject(n)){for(o=i;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){r=o;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},Xne.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],Kne.isFunction(n))this.removeListener(e,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},Xne.prototype.listeners=function(e){return this._events&&this._events[e]?Kne.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},Xne.listenerCount=function(e,t){return e._events&&e._events[t]?Kne.isFunction(e._events[t])?1:e._events[t].length:0};var Qne={mixin:e=>(Object.keys(Jne.prototype).forEach((t=>{e[t]=Jne.prototype[t]})),Jne.init(e),e)};function Zne(){let e=0,t=0,n=0,r=0;n=n||e;const i={move(e){this.moveTo(n+e)},moveTo(o){const a=Math.max(e,Math.min(t-r,o));n!==a&&(n=a,i.emit("update"))},update(o){let a=!1;({min:e=e,max:t=t}=o),void 0!==o.viewSize&&o.viewSize!==r&&(r=o.viewSize,a=!0);const s=Math.max(e,Math.min(t-r,n));n!==s&&(n=s,a=!0),a&&i.emit("update")},getState:()=>({min:e,max:t,start:n,viewSize:r})};return Qne.mixin(i),i}function ere(e,t){const n=e.min||0,r=e.max||0,i=e.viewSize||0,o=t||Zne();return o.update({min:n,max:r,viewSize:i}),o}function tre(e,t){return e<=t}function nre(e,t){return e<t}function rre(e,t,n){let r=0;for(;r<e.length&&t>e[r];)++r;return e[r]===t&&n&&++r,r}function ire(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=[];function i(){}return i.configure=function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{includeMax:r=!0,includeMin:i=!0}=n;e=r?tre:nre,t=i?tre:nre},i.add=e=>{let{min:t,max:n}=e;const i=rre(r,t),o=rre(r,n,!0),a=[i,o-i];i%2==0&&a.push(t),o%2==0&&a.push(n);const s=r.join(",");r.splice(...a);return s!==r.join(",")},i.remove=e=>{let{min:t,max:n}=e;const i=rre(r,t),o=rre(r,n,!0),a=[i,o-i];i%2==1&&a.push(t),o%2==1&&a.push(n);const s=r.join(",");r.splice(...a);return s!==r.join(",")},i.set=e=>{const t=r.join(",");r=[],Array.isArray(e)?e.forEach(i.add):i.add(e);return t!==r.join(",")},i.clear=()=>{const e=r.length>0;return r=[],e},i.containsValue=n=>function(e,t,n,r){const i=e.length;for(let o=1;o<i;o+=2)if(n(e[o-1],t)&&r(t,e[o]))return!0;return!1}(r,n,t,e),i.containsRange=e=>{let{min:t,max:n}=e;const i=rre(r,t,!0),o=rre(r,n);return i===o&&o%2==1},i.toggle=e=>i.containsRange(e)?i.remove(e):i.add(e),i.ranges=()=>{const e=[];for(let t=1;t<r.length;t+=2)e.push({min:r[t-1],max:r[t]});return e},i.configure(n),i}function ore(){let e=[];function t(){}return t.add=t=>-1===e.indexOf(t)&&(e.push(t),!0),t.remove=t=>{const n=e.indexOf(t);return-1!==n&&(e.splice(n,1),!0)},t.contains=t=>-1!==e.indexOf(t),t.values=()=>e.slice(),t.clear=()=>e=[],t.toString=()=>e.join(";"),t}const are={key:void 0,includeMin:!0,includeMax:!0};function sre(e){let{items:t,collection:n,vc:r}=e;const i={},o=[];let a,s;for(let e=0,o=t.length;e<o;e++){a=t[e].key,n[a]||(n[a]=r()),s=t[e].values||[t[e].value];for(let e=0;e<s.length;e++)n[a].add(s[e])&&(i[a]=i[a]||[],i[a].push(s[e]))}const l=Object.keys(i);for(let e=0,t=l.length;e<t;e++)a=l[e],o.push({id:a,values:i[a]});return o}function lre(e){let{items:t,collection:n}=e;const r={},i=[];let o,a;for(let e=0,i=t.length;e<i;e++)if(o=t[e].key,n[o]){a=t[e].values||[t[e].value];for(let e=0;e<a.length;e++)n[o].remove(a[e])&&(r[o]=r[o]||[],r[o].push(a[e]))}const s=Object.keys(r);for(let e=0,t=s.length;e<t;e++)o=s[e],i.push({id:o,values:r[o]});return i}function cre(e){const t={};let n,r;for(let i=0,o=e.length;i<o;i++){n=e[i].key,r=e[i].values||[e[i].value],t[n]||(t[n]=[]);for(let e=0;e<r.length;e++){-1===t[n].indexOf(r[e])&&t[n].push(r[e])}}return t}function ure(e){let{key:t,collection:n,obj:r,fn:i,value:o}=e;n[t]||(n[t]=i()),r[t]=r[t]||[],r[t].push(o),n[t].add(o)}function dre(e,t){const n=[],r=Object.keys(e);let i,o;const a=e=>-1===t[i].indexOf(e);for(let s=0,l=r.length;s<l;s++)i=r[s],t[i]?(o=e[i].filter(a),o.length&&n.push({id:i,values:o})):n.push({id:i,values:e[i]});return n}function fre(e,t,n){const r=function(e,t){if(!Object.keys(t).length)return e;const n=e.length,r=Array(n);for(let i=0;i<n;i++)r[i]=e[i].key in t?o8({},e[i],{key:t[e[i].key]}):e[i];return r}(t,n);return e&&e.length?e.reduce(((e,t)=>t(e)),r):r}function hre(e){return e.replace(/(-[a-z])/g,(e=>e.toUpperCase().replace("-","")))}function pre(e){return e.replace(/([A-Z])/g,(e=>"-".concat(e.toLowerCase())))}function mre(e,t,n){let{ranges:r,interceptors:i,rc:o,aliases:a,rangeConfig:s}=n;const l=fre(i["".concat(t,"Ranges")],e,a);let c=!1;return l.forEach((e=>{const n=e.key;if(r[n]||(r[n]=o(s.sources[n]||s.default)),"set"===t)c=r[n][t](e.ranges||e.range)||c;else{const i=e.ranges||[e.range];for(let e=0;e<i.length;e++)c=r[n][t](i[e])||c}})),c}function gre(){let{vc:e=ore,rc:t=ire}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=!1,r={},i={},o={},a={sources:{},default:o8({},are)};const s={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},l=()=>{const e={values:{},ranges:{}};return Object.keys(i).forEach((t=>{e.values[t]=i[t].values()})),Object.keys(r).forEach((t=>{e.ranges[t]=r[t].ranges()})),e},c={ls:[],clear(){this.ls.forEach((e=>e.clear()))},start(){this.ls.forEach((e=>e.start()))},end(){this.ls.forEach((e=>e.end()))},update(){const e=l();this.ls.forEach((t=>t._state(e)))},updateValues(){const e=l();this.ls.forEach((t=>t._state({values:e.values})))},updateRanges(){const e=l();this.ls.forEach((t=>t._state({ranges:e.ranges})))}},u={configure:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(e.ranges)&&e.ranges.length&&(a={sources:{},default:o8({},are)},e.ranges.forEach((e=>{const t={};Object.keys(are).filter((e=>"key"!==e)).forEach((n=>{t[n]=void 0!==e[n]?e[n]:are[n]})),void 0!==e.key?a.sources[e.key]=t:a.default=t})),Object.keys(r).forEach((e=>r[e].configure(a.sources[e]||a.default))),u.emit("update",[],[]))},link:e=>{if(u===e)throw new Error("Can't link to self");c.ls.push(e),e._state(l())},_state:e=>{if(!e)return l();if(e.values){const t=[];Object.keys(e.values).forEach((n=>{i[n]&&e.values[n].join(";")===i[n].toString()||t.push({key:n,values:e.values[n]})})),Object.keys(i).forEach((n=>{e.values[n]||t.push({key:n,values:[]})})),t.length&&u.setValues(t)}if(e.ranges){const t=[];Object.keys(e.ranges).forEach((n=>{r[n]&&e.ranges[n].join(";")===r[n].toString()||t.push({key:n,ranges:e.ranges[n]})})),Object.keys(r).forEach((n=>{e.ranges[n]||t.push({key:n,ranges:[]})})),t.length&&u.setRanges(t)}},start:function(){if(!n){n=!0;for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];u.emit("start",...t),c.start()}},end:function(){if(n){n=!1,r={},i={};for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];u.emit("end",...t),c.end()}},isActive:()=>n,clear:()=>{const e=u.brushes().filter((e=>"value"===e.type&&e.brush.values().length)).map((e=>({id:e.id,values:e.brush.values()}))),t=Object.keys(r).length>0||e.length;r={},i={},t&&(u.emit("update",[],e),c.clear())},brushes:()=>{let e=[];return e=e.concat(Object.keys(r).map((e=>({type:"range",id:e,brush:r[e]})))),e=e.concat(Object.keys(i).map((e=>({type:"value",id:e,brush:i[e]})))),e},addValue:(e,t)=>{u.addValues([{key:e,value:t}])},addValues:t=>{const r=fre(s.addValues,t,o),a=sre({vc:e,collection:i,items:r});u.emit("add-values",r),a.length&&(n||(n=!0,u.emit("start")),u.emit("update",a,[]),c.updateValues())}};return u.setValues=t=>{const r=fre(s.setValues,t,o),a=function(e){let{items:t,vCollection:n,vc:r}=e;const i={},o=cre(t);let a,s=[],l=[];const c={},u=Object.keys(n);for(let e=0,t=u.length;e<t;e++)a=u[e],c[a]=n[a].values().slice(),delete n[a];const d=e=>{n[a]&&n[a].contains(e)||ure({key:a,value:e,collection:n,obj:i,fn:r})},f=Object.keys(o);for(let e=0,t=f.length;e<t;e++)a=f[e],o[a].forEach(d);return l=dre(c,i),s=dre(i,c),[s,l]}({items:r,vCollection:i,vc:e});u.emit("set-values",r),(a[0].length>0||a[1].length>0)&&(n||(n=!0,u.emit("start")),u.emit("update",a[0],a[1]),c.updateValues())},u.removeValue=(e,t)=>{u.removeValues([{key:e,value:t}])},u.removeValues=e=>{const t=fre(s.removeValues,e,o),n=lre({collection:i,items:t});u.emit("remove-values",t),n.length&&(u.emit("update",[],n),c.updateValues())},u.addAndRemoveValues=(t,r)=>{const a=fre(s.addValues,t,o),l=fre(s.removeValues,r,o),d=sre({vc:e,collection:i,items:a}),f=lre({collection:i,items:l});u.emit("add-values",a),u.emit("remove-values",l),(d.length||f.length)&&(n||(n=!0,u.emit("start")),u.emit("update",d,f),c.updateValues())},u.toggleValue=(e,t)=>{u.toggleValues([{key:e,value:t}])},u.toggleValues=t=>{const r=fre(s.toggleValues,t,o),a=function(e){let{items:t,values:n,vc:r}=e;const i={},o={},a=[],s=[],l=cre(t);let c,u,d;const f=Object.keys(l);for(let e=0,t=f.length;e<t;e++){c=f[e],d=l[c];for(let e=0,t=d.length;e<t;e++)u=d[e],n[c]&&n[c].contains(u)?n[c]&&n[c].contains(u)&&(o[c]=o[c]||[],o[c].push(u),n[c].remove(u)):ure({key:c,value:u,collection:n,obj:i,fn:r})}const h=Object.keys(i);for(let e=0,t=h.length;e<t;e++)c=h[e],a.push({id:c,values:i[c]});const p=Object.keys(o);for(let e=0,t=p.length;e<t;e++)c=p[e],s.push({id:c,values:o[c]});return[a,s]}({items:r,values:i,vc:e});u.emit("toggle-values",r),(a[0].length>0||a[1].length>0)&&(n||(n=!0,u.emit("start")),u.emit("update",a[0],a[1]),c.updateValues())},u.containsValue=(e,t)=>{let n=o[e]||e;return!!i[n]&&i[n].contains(t)},u.addRange=(e,t)=>{u.addRanges([{key:e,range:t}])},u.addRanges=e=>{mre(e,"add",{ranges:r,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.removeRange=(e,t)=>{u.removeRanges([{key:e,range:t}])},u.removeRanges=e=>{mre(e,"remove",{ranges:r,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.setRange=(e,t)=>{u.setRanges([{key:e,range:t}])},u.setRanges=e=>{mre(e,"set",{ranges:r,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.toggleRange=(e,t)=>{u.toggleRanges([{key:e,range:t}])},u.toggleRanges=e=>{mre(e,"toggle",{ranges:r,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.containsRangeValue=(e,t)=>{let n=o[e]||e;return!!r[n]&&r[n].containsValue(t)},u.containsRange=(e,t)=>{let n=o[e]||e;return!!r[n]&&r[n].containsRange(t)},u.containsMappedData=(e,t,n)=>{let a=[];const s=Object.keys(e);let l,c,u,d;for(let t=0,n=s.length;t<n;t++){if(l=s[t],"value"===l)c=e,a[t]={key:"",i:t,bool:!1};else{if("source"===l)continue;c=e[l],a[t]={key:l,i:t,bool:!1}}u=c.source&&c.source.field,void 0!==u&&(void 0!==c.source.key&&(u="".concat(c.source.key,"/").concat(u)),u in o&&(u=o[u]),d=c.value,r[u]?a[t].bool=Array.isArray(d)?r[u].containsRange({min:d[0],max:d[1]}):r[u].containsValue(d):i[u]&&i[u].contains(d)&&(a[t].bool=!0))}return t?(a=a.filter((e=>-1!==t.indexOf(e.key))),"and"===n?!!a.length&&!a.some((e=>!1===e.bool)):"xor"===n?!!a.length&&a.some((e=>e.bool))&&a.some((e=>!1===e.bool)):a.some((e=>e.bool))):a.some((e=>e.bool))},u.intercept=(e,t)=>{const n=hre(e);s[n]&&s[n].push(t)},u.removeInterceptor=(e,t)=>{const n=hre(e);if(!s[n])return;const r=s[n].indexOf(t);-1!==r&&s[n].splice(r,1)},u.removeAllInterceptors=e=>{const t=[];if(e){const n=hre(e);s[n]&&s[n].length&&t.push({name:e,handlers:s[n]})}else Object.keys(s).forEach((e=>{s[e].length&&t.push({name:pre(e),handlers:s[e]})}));t.forEach((e=>{e.handlers.slice().forEach((t=>u.removeInterceptor(e.name,t)))}))},u.addKeyAlias=(e,t)=>{o[e]=t},u.removeKeyAlias=e=>{delete o[e]},Qne.mixin(u),u}function yre(e){return e*e*e}function vre(e){return--e*e*e+1}function bre(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}S7();const xre=["stroke","fill","color","backgroundColor","thumbColor"];function wre(e,t){const n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n);let a;for(a=0;a<r;++a)i[a]=Sre(e[a],t[a]);for(;a<n;++a)o[a]=t[a];return function(e){for(a=0;a<r;++a)o[a]=i[a](e);return o}}function Sre(e,t,n){const r=typeof t;let i;return null==t||"boolean"===r?function(e){return()=>e}(t):("number"===r?tne:"string"===r?(i=Ate(t))&&xre.includes(n)?(t=i,Jte):one:t instanceof Ate?Jte:t instanceof Date?ene:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?Qte:Array.isArray(t)?wre:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Cre:tne)(e,t)}function Cre(e,t){const n={},r={};let i;for(i in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)i in e?n[i]=Sre(e[i],t[i],i):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}function kre(e,t){return e.data?e.data.value:"text"===e.type?e.text:t}const Ere={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},Mre=/^\$/;function _re(e){const t=typeof e;return"object"!==t&&"function"!==t&&"undefined"!==t}function Rre(e,t,n){const r=e[t];r&&r.scale&&r.scale.pxScale?r.scale=r.scale.pxScale(n):r&&r.pxScale&&(e[t]=r.pxScale(n))}function Ire(e,t){return e.pxScale?e.pxScale(t):e}const Dre={normalizeSettings:function(e,t,n){const r=o8({},e),i=o8({},t);return Object.keys(r).forEach((e=>{i[e]={};const o=r[e],a=typeof o;if("function"==typeof o)i[e].fn=o;else if(_re(o)){let n=t[e];"string"==typeof n&&Mre.test(n)&&(n=Ere[n]);const r=typeof n;i[e]="undefined"===r||r===a?o:n}else o&&"object"==typeof o&&("function"==typeof o.fn&&(i[e].fn=o.fn),void 0!==o.scale&&(i[e].scale=n.scale(o.scale)),"string"==typeof o.ref&&(i[e].ref=o.ref))})),Object.keys(t).forEach((e=>{if(e in r)return;const n=t[e];"string"===typeof n&&Mre.test(n)?i[e]=Ere[n]:i[e]=n})),i},resolveForItem:function(e,t,n){const r={},i=Object.keys(t),o=i.length,a=e.datum,s=e.datum;for(let l=0;l<o;l++){const o=i[l],c=t[o],u="object"==typeof s&&void 0!==c,d=u&&"string"==typeof c.ref,f=u&&o in s,h=d?s[c.ref]:f?s[o]:a;_re(c)?r[o]=c:u&&c.fn?(c.scale&&(e.scale=c.scale),r[o]=c.fn.call(null,e,n)):u&&c.scale&&h?(r[o]=c.scale(h.value),c.scale.bandwidth&&(r[o]+=c.scale.bandwidth()/2)):d&&h?r[o]=h.value:c.fn?r[o]=c.fn.call(null,e,n):r[o]=c}return r},updateScaleSize:Rre};function Pre(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(((e,t)=>Array.isArray(t.children)?(e.push(...Pre(t.children)),e):(e.push(t),e)),[])}function Are(e,t){let{context:n,data:r,style:i,filter:o,mode:a}=t;const s=e.chart.brush(n),l=r,c=i.active||{},u=i.inactive||{},d=[];Object.keys(c).forEach((e=>{d.push(e)})),Object.keys(u).forEach((e=>{-1===d.indexOf(e)&&d.push(e)}));const f=[];let h=!1;const p=()=>{let t=Pre(e.nodes);return"function"==typeof o&&(t=t.filter(o)),t},m=()=>{const e=p(),t=e.length;let n,r=!1;const i="function"==typeof l?l({brush:s}):l;for(let r=0;r<t;r++){if(n=e[r].data,!n)continue;e[r].__style||(e[r].__style={},d.forEach((t=>{e[r].__style[t]=e[r][t]})));const t=s.containsMappedData(n,i,a),o=f.indexOf(e[r]);let l=!1;t&&-1===o?(f.push(e[r]),l=!0):t||-1===o||(f.splice(o,1),l=!0),e[r].needToUpdate=l||h,e[r].isActive=t}for(let i=0;i<t;i++)if(n=e[i].data,n){if(e[i].needToUpdate){const t=o8({},e[i],e[i].__style),n=e[i].isActive;d.forEach((r=>{e[i][r]=n&&r in c?"function"==typeof c[r]?c[r].call(null,t,f):c[r]:!n&&r in u?"function"==typeof u[r]?u[r].call(null,t,f):u[r]:e[i].__style[r]})),r=!0}delete e[i].needToUpdate}return h=!1,r},g=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,r=p(),i=r.length;for(let e=0;e<i;e++)r[e].data&&(r[e].__style=r[e].__style||{},d.forEach((t=>{r[e].__style[t]=r[e][t],t in u&&(r[e][t]="function"==typeof u[t]?u[t].call(null,r[e]):u[t])})));h=!0,f.length=0,n||e.renderer.render(e.nodes)},y=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,r=p(),i=r.length;for(let e=0;e<i;e++)r[e].__style&&(Object.keys(r[e].__style).forEach((t=>{r[e][t]=r[e].__style[t]})),r[e].__style=void 0);f.length=0,n||e.renderer.render(e.nodes)},v=()=>{if(m()){const t="function"==typeof e.config.sortNodes?e.config.sortNodes(e):e.nodes;"function"==typeof e.config.customRender?e.config.customRender({render:e.renderer.render,nodes:t}):e.renderer.render(t)}};return s.on("start",g),s.on("end",y),s.on("update",v),{isActive:()=>s.isActive(),update:()=>{f.length=0,h=!0,m()},cleanUp:function(){s.removeListener("start",g),s.removeListener("end",y),s.removeListener("update",v)}}}function Ore(e){let{nodes:t,action:n,chart:r,trigger:i}=e;const o=[];for(let e=0;e<t.length;e++){let n=t[e].data;null!==n&&o.push(n)}!function(e){let{dataPoints:t,action:n,chart:r,trigger:i}=e;if(!i)return;const o=i.data||[""];let a={items:[],actionFn:"toggleRanges"},s={items:[],actionFn:"toggleValues"};-1!==["add","remove","set","toggle"].indexOf(n)&&(a.actionFn="".concat(n,"Ranges"),s.actionFn="".concat(n,"Values"));for(let e=0;e<t.length;e++){const n=t[e];n&&o.forEach((e=>{let t=n&&!e?n:n[e];if(t){let e={key:t.source.field};void 0!==t.source.key&&(e.key="".concat(t.source.key,"/").concat(t.source.field)),Array.isArray(t.value)?(e.range={min:t.value[0],max:t.value[1]},a.items.push(e)):(e.value=t.value,s.items.push(e))}}))}i.contexts.forEach((e=>{a.items.length?r.brush(e)[a.actionFn](a.items):r.brush(e)[s.actionFn](s.items)}))}({dataPoints:o,action:n,chart:r,trigger:i})}function Lre(e){let{collisions:t,t:n,config:r,action:i}=e,o=[],a=!1;t.length>0&&(o=t,a=!0,"stop"===n.propagation&&(o=[t[t.length-1]]));const s=o.map((e=>e.node));return Ore({nodes:s,action:i,chart:r.chart,data:r.data,trigger:n}),a}function Tre(e,t,n){const r=n.element().getBoundingClientRect();let i=u8(e)?function(e,t){return 1!==e.changedTouches.length?null:{x:e.changedTouches[0].clientX-t.left,y:e.changedTouches[0].clientY-t.top}}(e,r):function(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}(e,r);return null===i||i.x<0||i.y<0||i.x>r.width||i.y>r.height?[]:(t.touchRadius>0&&u8(e)?i={cx:i.x,cy:i.y,r:t.touchRadius}:t.mouseRadius>0&&!u8(e)&&(i={cx:i.x,cy:i.y,r:t.mouseRadius}),n.itemsAt(i))}function qre(e,t,n){return e?"function"==typeof e?e(t):e:n}const Nre={fill:"fill",stroke:"stroke",opacity:"opacity",strokeWidth:"stroke-width",strokeLinejoin:"stroke-linejoin",fontFamily:"font-family",fontSize:"font-size",fontStyle:"font-style",textDecoration:"text-decoration",fontWeight:"font-weight",baseline:"dominant-baseline",dominantBaseline:"dominant-baseline",anchor:"text-anchor",textAnchor:"text-anchor",maxWidth:"maxWidth",transform:"transform",strokeDasharray:"stroke-dasharray",id:"id"};function jre(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="";for(let t=0;t<e.length;t++){const r=e[t];n+=0===t?"M".concat(r.x," ").concat(r.y):"L".concat(r.x," ").concat(r.y),n+=" "}return t&&(n+="Z"),n}function zre(e,t,n,r){const i=n/2,o=e-r/2,a=t-r/2,s=e-i,l=t-i;return[{x:o,y:a},{x:o,y:l},{x:o+r,y:l},{x:o+r,y:a},{x:s+n,y:a},{x:s+n,y:a+r},{x:o+r,y:a+r},{x:o+r,y:l+n},{x:o,y:l+n},{x:o,y:a+r},{x:s,y:a+r},{x:s,y:a}]}function Fre(e){return-e/180*Math.PI}function Wre(e){return function(e){let t=(.5*(Math.floor(e/Math.PI*2)+2)+.25)*Math.PI,n=Math.cos(Math.abs(t-e))*Math.sqrt(2),r=n*Math.cos(e),i=n*Math.sin(e);return{x1:r<0?1:0,y1:i<0?1:0,x2:r>=0?r:r+1,y2:i>=0?i:i+1}}(Fre(e))}function $re(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Bre(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Vre(e,t){return{x:e.x*t,y:e.y*t}}function Hre(e,t){return e.x-t.x}function Ure(e,t){return e.y-t.y}function Gre(e,t){return Hre(e,t)**2+Ure(e,t)**2}function Yre(e,t){return Math.sqrt(Gre(e,t))}function Kre(e,t){return e.x*t.x+e.y*t.y}function Xre(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};const r=Math.cos(t),i=Math.sin(t),o=Bre(e,n);return $re({x:r*o.x-i*o.y,y:i*o.x+r*o.y},n)}const Jre={up:0,down:180,left:90,right:-90};function Qre(e){let{x:t,y:n,size:r}=e;const i=r/2;return{type:"rect",x:t-i,y:n-i,width:r,height:r}}const Zre=S7();Zre.add("circle",(function(e){return{type:"circle",fill:"black",cx:e.x,cy:e.y,r:e.size/2}})),Zre.add("diamond",(function(e){const t=e.size,n=e.x-t/2,r=e.y-t/2;return{type:"path",fill:"black",d:jre([{x:n,y:r+t/2},{x:n+t/2,y:r},{x:n+t,y:r+t/2},{x:n+t/2,y:r+t},{x:n,y:r+t/2}])}})),Zre.add("saltire",(function(e){const t=Fre(45),n=e.size/2,r=isNaN(e.width)?n/2:e.width,i=Math.min(r,n);let o=e.size;const a=Math.sin(Math.asin(-t))*(i/2);o+=2*(n/Math.sin(-t)-n),o-=2*a;const s={x:e.x,y:e.y},l=zre(e.x,e.y,o,i).map((e=>Xre(e,t,s)));return{type:"path",fill:"black",d:jre(l)}})),Zre.add("square",(function(e){const t=e.size;return{type:"rect",fill:"black",x:e.x-t/2,y:e.y-t/2,width:t,height:t}})),Zre.add("triangle",(function(e){const t=e.size,n={x:e.x,y:e.y},r=Jre[e.direction]||0,i=t/2,o=e.x-i,a=e.y-i;let s=[{x:o,y:a+t},{x:o+i,y:a},{x:o+t,y:a+t},{x:o,y:a+t}];const l=Fre(r);return s=s.map((e=>Xre(e,l,n))),{type:"path",fill:"black",d:jre(s)}})),Zre.add("line",(function(e){const t="vertical"===e.direction,n=e.size/2,r=e.x,i=e.y;return{type:"line",stroke:"black",strokeWidth:1,x1:r-(t?0:n),y1:i-(t?n:0),x2:r+(t?0:n),y2:i+(t?n:0),collider:Qre(e)}})),Zre.add("star",(function(e){const t=e.size,n=[],r=t/2,i=e.points||5,o=Math.min(e.innerRadius||t/2,t)/2,a=isNaN(e.startAngle)?90:e.startAngle,s=360/i;for(let t=1;t<=i;t++){const i=s*t+a,l=Fre(i),c=Fre(i+s/2),u=Math.sin(l),d=Math.cos(l),f=Math.sin(c),h=Math.cos(c);n.push({x:e.x+d*r,y:e.y+u*r}),n.push({x:e.x+h*o,y:e.y+f*o})}return{type:"path",fill:"black",d:jre(n)}})),Zre.add("n-polygon",(function(e){const t=[],n=e.size/2,r=Math.max(isNaN(e.sides)?6:e.sides,3),i=360/r,o=isNaN(e.startAngle)?0:e.startAngle;for(let a=1;a<=r;a++){const r=Fre(i*a+o),s=Math.sin(r),l=Math.cos(r);t.push({x:e.x+l*n,y:e.y+s*n})}return{type:"path",fill:"black",d:jre(t)}})),Zre.add("cross",(function(e){const t=e.x,n=e.y,r=e.size/2,i=isNaN(e.width)?r/2:e.width,o=Math.min(i,r);return{type:"path",fill:"black",d:jre(zre(t,n,e.size,o))}})),Zre.add("bar",(function(e){const t={x:e.x,y:e.y},n="vertical"===e.direction,r=e.size/2,i=r/2/2;let o=[{x:t.x-r,y:t.y+i},{x:t.x-r,y:t.y-i},{x:t.x+r,y:t.y-i},{x:t.x+r,y:t.y+i}];if(n){const e=Fre(90);o=o.map((n=>Xre(n,e,t)))}const a=g8(o);return a.type="rect",a.fill="black",a})),Zre.add("rect",(function(e){const{x:t,y:n,size:r}=e,i=void 0===e.width?r:e.width,o=void 0===e.height?r:e.height;return{type:"rect",fill:"black",x:t-i/2,y:n-o/2,width:i,height:o}})),Zre.add("image",(function(e){const{x:t,y:n}=e,{width:r,height:i,imageSrc:o,position:a,symbol:s,imageScalingFactor:l}=e.imageSettings||{};return{type:"image",x:t,y:n,width:r,height:i,src:o,symbol:s,r:10,cx:0,cy:0,imageScalingFactor:l,imagePosition:a}}));const eie=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Zre;return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=e.get(t.type);if(n){const e=n(t);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(t).forEach((n=>{void 0!==Nre[n]&&"transform"!==n&&(e[n]=t[n])}))}(e,t),void 0!==t.data&&(e.data=t.data),e}return n}};function tie(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{dock:n="center",displayOrder:r=0,prioOrder:i=0,preferredSize:o=0,minimumLayoutMode:a,show:s=!0}=e;n=n||"center";return{computePreferredSize(e){let{inner:n,outer:r,children:i}=e;return"function"==typeof o?o({inner:n,outer:r,children:i,dock:this.dock()},t):o},dock(e){return void 0!==e?(n=e,this):"function"==typeof n?n(t):n},displayOrder(e){return void 0!==e?(r=e,this):"function"==typeof r?r(t):r},prioOrder(e){return void 0!==e?(i=e,this):"function"==typeof i?i(t):i},minimumLayoutMode(e){return void 0!==e?(a=e,this):"function"==typeof a?a(t):a},show(e){return void 0!==e?(s=e,this):"function"==typeof s?s(t):s}}}function nie(e,t,n){const{require:r=[]}=t,i=t.mediator||{},{settings:o,formatter:a,scale:s,data:l,renderer:c,chart:u,dockConfig:d,mediator:f,instance:h,rect:p,style:m,registries:g,resolver:y,update:v,_DO_NOT_USE_getInfo:b,symbol:x,isVisible:w}=n;e.emit=()=>{},w&&(e.isVisible=w),Object.defineProperty(e,"settings",{get:o}),Object.defineProperty(e,"data",{get:l}),Object.defineProperty(e,"formatter",{get:a}),Object.defineProperty(e,"scale",{get:s}),Object.defineProperty(e,"mediator",{get:f}),Object.defineProperty(e,"style",{get:m}),Object.defineProperty(e,"registries",{get:g}),p&&Object.defineProperty(e,"rect",{get:p}),b&&(e._DO_NOT_USE_getInfo=b),Object.keys(t).forEach((n=>{var r;r=n,["on","preferredSize","created","beforeMount","mounted","resize","beforeUpdate","updated","beforeRender","render","beforeUnmount","beforeDestroy","destroyed","defaultSettings","data","settings","formatter","scale","chart","dockConfig","mediator","style","resolver","registries","_DO_NOT_USE_getInfo","symbol","isVisible"].some((e=>e===r))||("function"==typeof t[n]?e[n]=t[n].bind(e):e[n]=t[n])})),r.forEach((t=>{"renderer"===t?Object.defineProperty(e,"renderer",{get:c}):"chart"===t?Object.defineProperty(e,"chart",{get:u}):"dockConfig"===t?Object.defineProperty(e,"dockConfig",{get:d}):"instance"===t?Object.defineProperty(e,"instance",{get:h}):"update"===t&&v?Object.defineProperty(e,"update",{get:v}):"resolver"===t?Object.defineProperty(e,"resolver",{get:y}):"symbol"===t&&Object.defineProperty(e,"symbol",{get:x})})),Object.keys(i).forEach((t=>{e.mediator.on(t,i[t].bind(e))}))}function rie(e,t,n){const r=t=>e[t]?(n.warn("Deprecation Warning the ".concat(t," property should be moved into layout: {} property")),e[t]):e.layout?e.layout[t]:void 0,i={};return i.displayOrder=r("displayOrder"),i.dock=r("dock"),i.prioOrder=r("prioOrder"),i.minimumLayoutMode=r("minimumLayoutMode"),e.layout=e.layout||{},e.layout.displayOrder=void 0!==i.displayOrder?i.displayOrder:e.layout.displayOrder,e.layout.prioOrder=void 0!==i.prioOrder?i.prioOrder:e.layout.prioOrder,e.layout.dock=i.dock||e.layout.dock,e.layout.minimumLayoutMode=i.minimumLayoutMode||e.layout.minimumLayoutMode,i.show=e.show,i.preferredSize=t,i}function iie(e,t,n){Object.keys(n.on||{}).forEach((r=>{e.eventListeners=e.eventListeners||[];const i=n.on[r].bind(e);e.eventListeners.push({event:r,listener:i}),t.on(r,i)})),e.emit=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 t.emit(e,...r)}}function oie(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{defaultSettings:n={},_DO_NOT_USE_getInfo:r=()=>({})}=e,{chart:i,container:o,mediator:a,registries:s,theme:l,renderer:c}=t,u=Qne.mixin({});let d,f,h,p,m,g=t.settings||{},y=o8(!0,{},n,g),v=[],b=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Dre,n={};return{resolve:function(r){let{data:i,settings:o,defaults:a={},scaled:s}=r;const l=n.norm=t.normalizeSettings(o,a,e.chart),c={scale:e.chart.scale,formatter:e.chart.formatter};s&&Object.keys(s).forEach((e=>{l[e]&&t.updateScaleSize(l,e,s[e])}));const u=[];if(!i||!Array.isArray(i.items)){const e={data:i,resources:c};let r=t.resolveForItem(e,n.norm,-1);return{settings:n.norm,item:r}}{let e;for(let r=0,o=i.items.length;r<o;r++){e={datum:i.items[r],data:i,resources:c};let o=t.resolveForItem(e,n.norm,r);o.data=i.items[r],u.push(o)}}return{settings:n.norm,items:u}}}}({chart:i}),x=!1;const w={nodes:[],chart:i,config:y.brush||{},renderer:null},S={tap:[],over:[]},C=[],k={},E=o8({},g);function M(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){const i=void 0!==e[t],o=void 0!==g[t];let a;for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];return i&&("function"==typeof e[t]?a=e[t].call(k,...l):r&&(a=e[t])),o&&("function"==typeof g[t]?a=g[t].call(E,...l):r&&(a=g[t])),i||o||(a=n.call(k,...l)),a}}const _=M("preferredSize",(()=>0),!0),R=M("resize",(e=>{let{inner:t}=e;return t})),I=M("created"),D=M("beforeMount"),P=M("mounted"),A=M("beforeUnmount"),O=M("beforeUpdate"),L=M("updated"),T=M("beforeRender"),q=M("beforeDestroy"),N=M("destroyed"),j=e.render,z=()=>{y.brush&&(y.brush.consume||[]).forEach((e=>{e.context&&e.style&&C.push(Are(w,e))}))},F=()=>{y.brush&&(y.brush.trigger||[]).forEach((e=>{"over"===e.on?S.over.push(e):S.tap.push(e)}))};Object.defineProperty(w,"data",{get:()=>v});const W=y.renderer||e.renderer,$=W?c||s.renderer(W)():c||s.renderer()();"function"==typeof $.settings&&$.settings(y.rendererSettings),w.renderer=$;const B={resources:i.logger?{logger:i.logger()}:{}};let V=tie(rie(y,_,i.logger()),B);const H=e=>{e.key=y.key,e.element=$.element()},U=()=>{};U.dockConfig=()=>V,U.set=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.settings&&(g=e.settings,y=o8(!0,{},n,e.settings),V=tie(rie(y,_,i.logger()),B),w.config=y.brush||{}),y.scale&&(d=i.scale(y.scale)),y.data){const{rendererSettings:e}=y,t="function"==typeof(null==e?void 0:e.progressive)&&e.progressive(),n=lte(y.data,{dataset:i.dataset,collection:i.dataCollection},{logger:i.logger()},i.dataCollection);t?t.isFirst?(v=n,v.items&&(v.items=[...n.items])):v.items&&(v.items=[...v.items,...n.items||[]]):v=n}else v=d?d.data():[];"string"==typeof y.formatter||"object"==typeof y.formatter?f=i.formatter(y.formatter):d&&d.data().fields&&(f=d.data().fields[0].formatter()),m=l.style(y.style||{})},U.resize=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=R({inner:e,outer:t});p=n?$.size(n):$.size(e),E.rect=o8(!0,{computedPhysical:p.computedPhysical,computedOuter:t.computed||t,computedInner:e.computed||e},e),p=o8(!0,{computedOuter:t.computed||t,computedInner:e.computed||e},p)},U.getRect=()=>E.rect;const G=()=>{const e=$.renderArgs?$.renderArgs.slice(0):[],{rendererSettings:t}=y;let n=v;const r="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();return v.items&&r&&(n=c8(c8({},v),{},{items:v.items.slice(r.start,r.end)})),e.push({data:n}),e};let Y,K,X;function J(e){const{rendererSettings:t}=y,n="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();n?n.isFirst?w.nodes=[...e||[]]:w.nodes&&(w.nodes=[...w.nodes,...e||[]]):w.nodes=e}U.beforeMount=D,U.beforeRender=()=>{T({size:p})},U.render=()=>{const e=j.call(k,...G());J(e),$.render(e),Y=e,K=E.rect.computed},U.hide=()=>{U.unmount(),$.size({x:0,y:0,width:0,height:0}),$.clear()},U.beforeUpdate=()=>{O({settings:y,data:v})},U.update=()=>{X&&X.stop();const{rendererSettings:e,brush:t,animations:n}=y;if("function"==typeof(null==e?void 0:e.transform)&&e.transform())return $.render(),void(Y=null);const r=j.call(k,...G());J(r),C.forEach((e=>e.cleanUp())),C.length=0,S.tap=[],S.over=[],t&&(z(),F()),C.forEach((e=>{e.isActive()&&e.update()})),Y&&n&&("function"==typeof n.enabled?n.enabled():n.enabled)?(n.compensateForLayoutChanges&&n.compensateForLayoutChanges({currentNodes:Y,currentRect:E.rect.computed,previousRect:K}),X=function(e,t,n,r){let i,{old:o,current:a}=e,{renderer:s}=t,l=[],c={nodes:[],ips:[]},u={nodes:[],ips:[]},d={nodes:[],ips:[]},f=[],h=null;const p=n.trackBy||kre,m={start(){let e={};if(o.forEach(((t,n)=>{let r=p(t,n);e[r]=t})),a.forEach(((t,n)=>{let r=p(t,n);if(e[r]){if("path"===t.type&&t.points&&t.points.length>0&&"trend"!==t.data.source.key){const n=function(e,t){const n=e.points.filter((e=>!e.dummy)),r=t.points.filter((e=>!e.dummy)),i=r.map((e=>e.data.major.value)),o=n.filter((e=>i.includes(e.data.major.value))).map((e=>e.data.major.value)),a=n.filter((e=>o.includes(e.data.major.value))),s=r.filter((e=>o.includes(e.data.major.value)));return{old:a,current:s}}(e[r],t);d.ips.push(Cre(o8({},e[r],{points:n.old}),o8({},t,{points:n.current}))),l.push(o8({},e[r],{commonPoints:n.old}))}else d.ips.push(Cre(e[r],t)),l.push(e[r]);d.nodes.push(t),e[r]=!1}else c.nodes.push(t),c.ips.push(Cre(o8({},t,{r:.001,opacity:0}),t))})),Object.keys(e).forEach((t=>{e[t]&&(u.nodes.push(e[t]),u.ips.push(Cre(e[t],o8({},e[t],{r:1e-4,opacity:0}))))})),f.push({name:"exiting",easing:yre,duration:200,tweens:u.ips,nodes:[...l]}),f.push({name:"updating",easing:bre,duration:400,tweens:d.ips,nodes:[]}),f.push({name:"entering",easing:vre,duration:200,tweens:c.ips,nodes:[...d.nodes]}),n.isMainComponent){var t;const e=null===(t=n.isMainComponent)||void 0===t?void 0:t.filterFn,i=e?l.filter(e).length:l.length,{isInit:o,shouldBeRemoved:a}=r.getValue("animations.updatingStageMeta");!1===o?(r.setValue("animations.updatingStageMeta.shouldBeRemoved",0===i),r.setValue("animations.updatingStageMeta.isInit",!0)):r.setValue("animations.updatingStageMeta.shouldBeRemoved",a&&0===i)}f.length&&(h=s.getScene(a),f[0].started=Date.now(),"undefined"!=typeof window&&(i=window.requestAnimationFrame(m.tick)))},tick(){let e=f[0];e||m.stop(),e.started||(e.started=Date.now());let t=(Date.now()-e.started)/e.duration,o=[],a=e.tweens.map((n=>n(e.easing(Math.min(1,t)))));const{adjustTweenedNodes:l}=n;if(l&&l(a),o.push(...a),o.push(...e.nodes),s.render(o),t>=1){f.shift();const{isInit:e,shouldBeRemoved:t}=r.getValue("animations.updatingStageMeta");f.length?"updating"===f[0].name&&t&&f.shift():(!0===e&&r.setValue("animations.updatingStageMeta.isInit",!1),m.stop())}i&&(i=window.requestAnimationFrame(m.tick))},stop(){i&&(window.cancelAnimationFrame(i),i=!1)},inProgress:()=>!!i,get targetScene(){return h}};return m}({old:Y,current:r},{renderer:$},n,i.storage),X.start()):$.render(r),Y=r,K=E.rect.computed,$.setKey&&"string"==typeof g.key&&$.setKey(g.key)},U.updated=L,U.destroy=()=>{U.unmount(),q(h),$.destroy(),N(),h=null};const Q=e=>{w.nodes=e,C.forEach((e=>{e.isActive()&&e.update()})),$.render(e)};return nie(k,e,{settings:()=>y,data:()=>v,scale:()=>d,formatter:()=>f,renderer:()=>$,chart:()=>i,dockConfig:()=>V,mediator:()=>a,instance:()=>E,rect:()=>E.rect,style:()=>m,update:()=>Q,registries:()=>s,resolver:()=>b,symbol:()=>eie(s.symbol)}),nie(E,g,{settings:()=>y,data:()=>v,scale:()=>d,formatter:()=>f,renderer:()=>$,chart:()=>i,dockConfig:()=>V,mediator:()=>a,style:()=>m,_DO_NOT_USE_getInfo:r.bind(k),isVisible:()=>x}),U.getBrushedShapes=function(e,t,n){const r=[];if(y.brush&&y.brush.consume){const o=i.brush(e),a=$.findShapes("*");y.brush.consume.filter((t=>t.context===e)).forEach((e=>{for(let i=0;i<a.length;i++){const s=a[i];s.data&&o.containsMappedData(s.data,n||e.data,t)&&(H(s),r.push(s),a.splice(i,1),i--)}}))}return r},U.findShapes=e=>{var t;const n=(null!==(t=X)&&void 0!==t&&t.inProgress()?X.targetScene:$).findShapes(e);for(let e=0,t=n.length;e<t;e++)H(n[e]);return n},U.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=$.itemsAt(e);let r;r=t&&"stop"===t.propagation&&n.length>0?[n.pop().node]:n.map((e=>e.node));for(let e=0,t=r.length;e<t;e++)H(r[e]);return r},U.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.contexts=Array.isArray(t.contexts)?t.contexts:[];Ore({nodes:e,action:t.action||"toggle",trigger:t,chart:i,data:w.data})},U.mount=()=>{h=$.element&&$.element()?h:$.appendTo(o),$.setKey&&"string"==typeof g.key&&$.setKey(g.key),y.brush&&(z(),F()),iie(E,u,g),iie(k,u,e),x=!0},U.mounted=()=>P(h),U.unmount=()=>{[E,k].forEach((e=>{!function(e,t){e.eventListeners&&(e.eventListeners.forEach((e=>{let{event:n,listener:r}=e;t.removeListener(n,r)})),e.eventListeners.length=0),e.emit=()=>{}}(e,u)})),S.tap=[],S.over=[],C.forEach((e=>{e.cleanUp()})),C.length=0,A(),x=!1},U.onBrushTap=e=>{S.tap.forEach((t=>{(function(e){let{e:t,t:n,config:r}=e;return Lre({collisions:Tre(t,n,r.renderer),t:n,config:r,action:qre(n.action,t,"toggle")})})({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&i.toggleBrushing(!0)}))},U.onBrushOver=e=>{S.over.forEach((t=>{(function(e){let{e:t,t:n,config:r}=e;return Lre({collisions:Tre(t,n,r.renderer),t:n,config:r,action:qre(n.action,t,"set")})})({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&i.toggleBrushing(!0)}))},U.def=k,U.ctx=E,U.renderer=()=>$,U.set({settings:g}),I(),U}function aie(e){const t=o8(!0,{},e),n={getAll:()=>t,getValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return n;const r=t.split(".");let i=e;for(let e=0;e<r.length;++e){const t=r[e];if(void 0===i[t])return n;i=i[t]}return i}(t,e,n),setValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return;const r=t.split("."),i=r[r.length-1];let o=e;for(let e=0;e<r.length-1;++e){const t=r[e];void 0===o[t]&&(o[t]=Number.isNaN(+r[e+1])?{}:[]),o=o[t]}void 0!==n?o[i]=n:delete o[i]}(t,e,n)};return n}function sie(e,t,n){const r=$re(function(e,t){const n=Kre(e,t)/Kre(t,t)||1;return{x:t.x*n,y:t.y*n}}(Bre(n,e),Bre(t,e)),e);return r}function lie(e,t,n){return Yre(e,n)+Yre(t,n)-Yre(e,t)<1e-12}function cie(e,t){return e.x>=t.x&&e.x+e.width<=t.x+t.width&&e.y>=t.y&&e.y+e.height<=t.y+t.height}function uie(e){return e.x1===e.x2&&e.y1===e.y2}function die(e){return e.width<=0||e.height<=0}function fie(e){return e.r<=0}function hie(e){return e.edges.length<=2}function pie(e,t){let n=!1;for(let r=0,i=t.edges.length;r<i;r++)if(n=wie(e,y8(t.edges[r])),!0===n)return!0;return!1}function mie(e,t){let n=!1;const{numPolygons:r,polygons:i}=t;for(let t=0;t<r;t++){if(n=Die(e,i[t]),!0===n)return!0}return!1}function gie(e,t){if(fie(e))return!1;return Gre({x:e.cx,y:e.cy},t)<=e.r**2}function yie(e,t){if(die(t)||fie(e))return!1;const n=t.width/2,r=t.height/2,i=t.x+n,o=t.y+r,a=e.r,s=e.cx,l=e.cy,c=Math.abs(s-i),u=Math.abs(l-o);if(c>n+a||u>r+a)return!1;if(c<=n||u<=r)return!0;return(c-n)**2+(u-r)**2<=a**2}function vie(e,t){if(fie(e)||uie(t))return!1;const[n,r]=p8(t);if(gie(e,n)||gie(e,r))return!0;const i={x:e.cx,y:e.cy},o=sie(n,r,i);return Gre(o,i)<=e.r**2&&lie(n,r,o)}function bie(e,t){if(hie(t)||fie(e))return!1;if(xie(t,{x:e.cx,y:e.cy}))return!0;const n=t.edges.length;for(let r=0;r<n;r++){if(vie(e,y8(t.edges[r])))return!0}return!1}function xie(e,t){if(hie(e)||!Eie(e.boundingRect(),t))return!1;const{x:n,y:r}=t,i=e.vertices;let o,a,s,l,c;for(o=!1,l=-1,a=i.length,s=a-1;++l<a;s=l){if(i[l].x===n&&i[l].y===r)return!0;if(i[l].y===i[s].y&&i[l].y===r&&(n-i[l].x)*(n-i[s].x)<=0)return!0;if(i[l].y<r&&r<=i[s].y||i[s].y<r&&r<=i[l].y){if(c=(i[s].x-i[l].x)*(r-i[l].y)/(i[s].y-i[l].y)+i[l].x,n===c)return!0;n<c&&(o=!o)}}return o}function wie(e,t){if(hie(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if(_ie(t,y8(e.edges[n])))return!0}const[n,r]=p8(t);return xie(e,n)||xie(e,r)}function Sie(e,t){if(hie(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if(Mie(t,y8(e.edges[n])))return!0}const[n,r,i,o]=m8(t);return xie(e,n)||xie(e,r)||xie(e,i)||xie(e,o)}function Cie(e,t){return!die(e)&&!die(t)&&(e.x<=t.x+t.width&&t.x<=e.x+e.width&&e.y<=t.y+t.height&&t.y<=e.y+e.height)}function kie(e,t){if(die(e)||die(t))return!1;return[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}].every((t=>Eie(e,t)))}function Eie(e,t){return!die(e)&&(t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height)}function Mie(e,t){if(uie(t)||die(e))return!1;const[n,r]=p8(t);if(Eie(e,n)||Eie(e,r))return!0;const i=m8(e);let o=i.length;for(let e=0;e<o;e++){if(_ie(y8([i[e],i[3!==e?e+1:0]]),t))return!0}return!1}function _ie(e,t){const[n,r]=p8(e),[i,o]=p8(t),a=Hre(r,n),s=Ure(r,n),l=Hre(o,i),c=Ure(o,i),u=Hre(n,i),d=Ure(n,i);let f=c*a-l*s;const h=l*d-c*u,p=a*d-s*u;let m,g;if(0===a&&0===s)return!1;if(0===l&&0===c)return!1;if(0===f){if(0===h&&0===p){if(0===a){if(0===s)return n.x===r.x&&n.y===r.y;m=Ure(i,n)/s,g=Ure(o,n)/s}else m=(i.x-n.x)/a,g=(o.x-n.x)/a;return!(m<0&&g<0||m>1&&g>1)}return!1}const y=h/f;return f=p/f,y>=0&&y<=1&&f>=0&&f<=1}function Rie(e,t){if(uie(e))return!1;const[n,r]=p8(e);return lie(n,r,t)}function Iie(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!Cie(n,r)&&(kie(n,r)?pie(e,t):pie(t,e))}function Die(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!Cie(n,r)&&(kie(r,n)?function(e,t){let n=!1;const{numPolygons:r,polygons:i}=e;for(let e=0;e<r;e++)if(n=Iie(t,i[e]),!0===n)return!0;return!1}(e,t):function(e,t){let n=!1;for(let r=0,i=t.edges.length;r<i;r++)if(n=Oie(e,y8(t.edges[r])),!0===n)return!0;return!1}(e,t))}function Pie(e,t){if(fie(e))return!1;if(Aie(t,{x:e.cx,y:e.cy}))return!0;const{numPolygons:n,polygons:r}=t;for(let t=0;t<n;t++){const n=r[t],i=n.edges.length;for(let t=0;t<i;t++){if(vie(e,y8(n.edges[t])))return!0}}return!1}function Aie(e,t){if(!Eie(e.boundingRect(),t))return!1;const{x:n,y:r}=t,i=e.numPolygons;let o,a,s,l,c,u,d=!1;for(a=0;a<i;a++)for(o=e.vertices[a],c=-1,s=o.length,l=s-1;++c<s;l=c){if(o[c].x===n&&o[c].y===r)return!0;if(o[c].y===o[l].y&&o[c].y===r&&(n-o[c].x)*(n-o[l].x)<=0)return!0;if(o[c].y<r&&r<=o[l].y||o[l].y<r&&r<=o[c].y){if(u=(o[l].x-o[c].x)*(r-o[c].y)/(o[l].y-o[c].y)+o[c].x,n===u)return!0;n<u&&(d=!d)}}return d}function Oie(e,t){const[n,r]=p8(t);if(Aie(e,n)||Aie(e,r))return!0;const{numPolygons:i,polygons:o}=e;for(let e=0;e<i;e++){const n=o[e];for(let e=0,r=n.edges.length;e<r;e++){if(_ie(t,y8(n.edges[e])))return!0}}return!1}function Lie(e,t){const[n,r,i,o]=m8(t);if(Aie(e,n)||Aie(e,r)||Aie(e,i)||Aie(e,o))return!0;const{numPolygons:a,polygons:s}=e;for(let e=0;e<a;e++){const n=s[e];for(let e=0,r=n.edges.length;e<r;e++){if(Mie(t,y8(n.edges[e])))return!0}}return!1}const Tie=/^\$/,qie="@extend";function Nie(e){throw new Error('Cyclical reference for "'.concat(e,'"'))}function jie(e,t,n){if("string"==typeof e){let r=t[e];return-1!==n.indexOf(e)&&Nie(e),Tie.test(r)?(n.push(e),jie(r,t,n)):r}let r=e;const i=o8(!0,{},t,e),o={};if(e[qie]){const o=e[qie];-1!==n.indexOf(o)&&Nie(o);let a=n.slice();a.push(o),r=o8(!0,{},jie(i[o],t,a),e)}return Object.keys(r).forEach((e=>{let t=n.slice();if(e===qie||Tie.test(e))return;o[e]=r[e];let a=o[e];Tie.test(a)&&a in i?(-1!==n.indexOf(a)&&Nie(a),t.push(a),a=i[a],"object"==typeof a||Tie.test(a)&&a in i?o[e]=jie(a,i,t):o[e]=a):"object"==typeof a&&(o[e]=jie(a,i,t))})),o}function zie(e,t){return jie(e,t,[])}function Fie(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=e;const r=e=>{e.forEach((e=>{const n=Array.isArray(e.colors[0])?e.colors:[e.colors];t[e.key]={colors:n,sizes:n.map((e=>e?e.length:0))}}))},i={palette:(e,n)=>((e,n)=>{const r=t[e];if(!r)return[];const i=r.sizes;for(let e=0;e<i.length;e++)if(n<=i[e])return r.colors[e];return r.colors[i.length-1]})(e,n),setPalettes:r,style:e=>zie(e,n),setStyle:t=>{n=o8({},e,t)}};return r(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]),i}function Wie(e){e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.floor(e.width),e.height=Math.floor(e.height)}function $ie(e){const t={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return o8(!0,t,e),t.center.minWidthRatio=Math.min(Math.max(t.center.minWidthRatio,0),1),t.center.minHeightRatio=Math.min(Math.max(t.center.minHeightRatio,0),1),t.center.minWidth=Math.max(t.center.minWidth,0),t.center.minHeight=Math.max(t.center.minHeight,0),t}function Bie(e,t,n,r,i){return{x:isNaN(e)?0:e,y:isNaN(e)?0:t,width:isNaN(e)?0:n,height:isNaN(e)?0:r,margin:isNaN(i)?0:i}}function Vie(e,t,n){if(void 0===e.cachedSize){const r=e.config.dock();let i,o=e.comp.preferredSize({inner:t,outer:n,dock:r});isNaN(o)?o&&!isNaN(o.size)&&(o.width=o.size,o.height=o.size):o={width:o,height:o},i="top"===r||"bottom"===r?o.height:"right"===r||"left"===r?o.width:Math.max(o.width,o.height),e.cachedSize=Math.ceil(i),e.edgeBleed=o.edgeBleed||0}return e.cachedSize}function Hie(e,t){switch(t.config.dock()){case"top":e.y+=t.cachedSize,e.height-=t.cachedSize;break;case"bottom":e.height-=t.cachedSize;break;case"left":e.x+=t.cachedSize,e.width-=t.cachedSize;break;case"right":e.width-=t.cachedSize}}function Uie(e,t){const n=t.edgeBleed;n&&(e.left=Math.max(e.left,n.left||0),e.right=Math.max(e.right,n.right||0),e.top=Math.max(e.top,n.top||0),e.bottom=Math.max(e.bottom,n.bottom||0))}function Gie(e,t,n){t.x<n.left&&(t.width-=n.left-t.x,t.x=n.left);const r=e.width-(t.x+t.width);r<n.right&&(t.width-=n.right-r),t.y<n.top&&(t.height-=n.top-t.y,t.y=n.top);const i=e.height-(t.y+t.height);i<n.bottom&&(t.height-=n.bottom-i)}function Yie(e,t,n,r,i){const o=o8({},t),a=o8({},n);Hie(o,r),Uie(a,r),Gie(e,o,a);const s=function(e,t,n){const r=Math.min(n.center.minWidth,e.width)||Math.max(e.width*n.center.minWidthRatio,1),i=Math.min(n.center.minHeight,e.height)||Math.max(e.height*n.center.minHeightRatio,1);return t.width>=r&&t.height>=i}(e,o,i);return!!s&&(Hie(t,r),Uie(n,r),!0)}function Kie(e){return{x:e.margin.left+e.x*e.scaleRatio.x,y:e.margin.top+e.y*e.scaleRatio.y,width:e.width*e.scaleRatio.x,height:e.height*e.scaleRatio.y}}function Xie(e){return g8([].concat(...e.map(m8)))}function Jie(e){let{visible:t,layoutRect:n,reducedRect:r,containerRect:i,translation:o}=e;const a=Bie(r.x,r.y,r.width,r.height),s=Bie(r.x,r.y,r.width,r.height),l={},c=t.slice(),u=c.slice().sort(((e,t)=>e.config.displayOrder()-t.config.displayOrder()));return t.sort(((e,t)=>{if(e.referencedDocks.length>0&&t.referencedDocks.length>0)return 0;if(t.referencedDocks.length>0)return-1;if(e.referencedDocks.length>0)return 1;const n=e.config.displayOrder()-t.config.displayOrder();return 0===n?c.indexOf(e)-c.indexOf(t):n})).forEach((e=>{let t={},c={};switch(e.config.dock()){case"top":t.height=c.height=e.cachedSize,t.width=n.width,c.width=a.width,t.x=n.x,c.x=a.x,t.y=c.y=a.y-e.cachedSize,a.y-=e.cachedSize,a.height+=e.cachedSize;break;case"bottom":t.x=n.x,c.x=a.x,t.y=c.y=a.y+a.height,t.width=n.width,c.width=a.width,t.height=c.height=e.cachedSize,a.height+=e.cachedSize;break;case"left":t.x=c.x=s.x-e.cachedSize,t.y=n.y,c.y=s.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=s.height,s.x-=e.cachedSize,s.width+=e.cachedSize;break;case"right":t.x=c.x=s.x+s.width,t.y=n.y,c.y=s.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=s.height,s.width+=e.cachedSize;break;case"center":t.x=c.x=r.x,t.y=c.y=r.y,t.width=c.width=r.width,t.height=c.height=r.height;break;default:if(e.referencedDocks.length>0){const n=e.referencedDocks.map((e=>l[e])).filter((e=>!!e));n.length>0&&(t=Xie(n.map((e=>e.outerRect))),c=Xie(n.map((e=>e.r))))}}e.key&&(l[e.key]={r:c,outerRect:t}),function(e,t,n,r){const i={x:r.width/n.width,y:r.height/n.height},o={left:0,top:0};if(n.preserveAspectRatio){const e=i.x<i.y,t=Math.min(i.x,i.y);i.x=t,i.y=t;const a=e?"height":"width",s=(r[a]-n[a]*i.x)*n.align;o.left=e?0:s,o.top=e?s:0}e.scaleRatio=i,e.margin=o,t.scaleRatio=i,t.margin=o,n.scaleRatio=i,n.margin=o}(c,t,n,i),c.edgeBleed=e.edgeBleed,c.computed=Kie(c),t.edgeBleed=e.edgeBleed,t.computed=Kie(t),c.x+=o.x,c.y+=o.y,t.x+=o.x,t.y+=o.y,e.comp.resize(c,t),e.cachedSize=void 0,e.edgeBleed=void 0})),u}function Qie(e,t,n){const r=e.layoutModes||{},i=t.minimumLayoutMode();let o=t.show();return o&&"object"==typeof i?o=r[i.width]&&r[i.height]&&n.width>=r[i.width].width&&n.height>=r[i.height].height:o&&void 0!==i&&(o=r[i]&&n.width>=r[i].width&&n.height>=r[i].height),o}function Zie(e){if(!e.resize||"function"!=typeof e.resize)throw new Error("Component is missing resize function");if(!e.dockConfig&&!e.preferredSize)throw new Error("Component is missing preferredSize function")}function eoe(e){let t=$ie(e);const n={};return n.layout=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e||isNaN(e.x)||isNaN(e.y)||isNaN(e.width)||isNaN(e.height))throw new Error("Invalid rect");if(!n.length)return{visible:[],hidden:[],ordered:[]};const{logicalContainerRect:r,containerRect:i}=function(e,t){const n={x:0,y:0,width:0,height:0},r={x:0,y:0,width:0,height:0};return n.width=e.width||0,n.height=e.height||0,void 0!==t.size&&(n.width=isNaN(t.size.width)?n.width:t.size.width,n.height=isNaN(t.size.height)?n.height:t.size.height),void 0!==t.logicalSize?(r.width=isNaN(t.logicalSize.width)?n.width:t.logicalSize.width,r.height=isNaN(t.logicalSize.height)?n.height:t.logicalSize.height,r.align=isNaN(t.logicalSize.align)?.5:Math.min(Math.max(t.logicalSize.align,0),1),r.preserveAspectRatio=t.logicalSize.preserveAspectRatio):(r.width=n.width,r.height=n.height,r.preserveAspectRatio=!1),Wie(r),Wie(n),{logicalContainerRect:r,containerRect:n}}(e,t),[o,a]=function(e,t,n){const r=[],i=[];for(let o=0;o<e.length;++o){const a=e[o];Zie(a);let s=a.dockConfig;const l=a.key,c=s.dock(),u=/@/.test(c)?c.split(",").map((e=>e.replace(/^\s*@/,""))):[];Qie(t,s,n)?r.push({comp:a,key:l,config:s,referencedDocks:u}):i.push({comp:a,key:l,config:s,referencedDocks:u})}return[r,i]}(n,t,r),s=function(e){let{layoutRect:t,visible:n,hidden:r,settings:i}=e;const o=Bie(t.x,t.y,t.width,t.height),a={left:0,right:0,top:0,bottom:0},s=n.slice();s.sort(((e,t)=>e.config.prioOrder()-t.config.prioOrder()));for(let e=0;e<s.length;++e){const n=s[e];Vie(n,o,t),Yie(t,o,a,n,i)||(r.push(s.splice(e,1)[0]),--e)}!function(e,t){if(0!==t.length)for(let n=0;n<e.length;++n){let r=e[n];if(r.referencedDocks.length){const i=r.referencedDocks.every((e=>t.some((t=>t.key===e))));i&&t.push(e.splice(n,1)[0])}}}(n,r);const l=n.filter((e=>-1!==s.indexOf(e)));return n.length=0,n.push(...l),Gie(t,o,a),o}({layoutRect:r,visible:o,hidden:a,settings:t}),l=Jie({visible:o,layoutRect:r,reducedRect:s,containerRect:i,translation:{x:e.x,y:e.y}});return a.forEach((e=>{e.comp.visible=!1;const t=Bie();e.comp.resize(t,t)})),{visible:o.map((e=>e.comp)),hidden:a.map((e=>e.comp)),ordered:l.map((e=>e.comp))}},n.settings=function(e){t=$ie(e)},n}const toe=(e,t)=>{for(let n=0;n<e.length;n++){const r=e[n];if(r.hasKey&&r.key===t)return e[n]}return null},noe=e=>null==e?void 0:e.map((e=>{const t=e.instance.dockConfig();return{preferredSize:n=>t.computePreferredSize(c8(c8({},n),{},{children:noe(e.children)}))}})),roe=(e,t)=>({visible:[],hidden:t,ordered:[]}),ioe=e=>(t,n)=>{var r;const i=n.map(((e,t)=>{const n=e.instance.dockConfig();return{index:t,key:e.key,dockConfig:n,resize:e.instance.resize,preferredSize:t=>n.computePreferredSize(c8(c8({},t),{},{children:noe(e.children)}))}})),o=e=>n[e.index],{visible:a=i,hidden:s=[],ordered:l=a}=null!==(r=e(t,i))&&void 0!==r?r:{};return{visible:a.map(o),hidden:s.map(o),ordered:l.map(o)}},ooe=e=>"function"==typeof e?ioe(e):(e=>{const t=eoe(e);return ioe(((e,n)=>t.layout(e,n)))})(e);function aoe(e,t,n){const r=t.left-n.left,i=t.top-n.top,o=v8(e),a=o8(!0,{},e);switch(o){case"circle":a.cx+=r,a.cy+=i;break;case"polygon":for(let e=0,t=a.vertices.length;e<t;e++){const t=a.vertices[e];t.x+=r,t.y+=i}break;case"geopolygon":for(let e=0;e<a.vertices.length;e++){const t=a.vertices[e];for(let e=0,n=t.length;e<n;e++){const n=t[e];n.x+=r,n.y+=i}}break;case"line":a.x1+=r,a.y1+=i,a.x2+=r,a.y2+=i;break;case"point":case"rect":a.x+=r,a.y+=i}return a}function soe(e,t){const n=[];let r=0;t.forEach((e=>{n.push(r),r++;const t=e.instance.def.additionalElements&&e.instance.def.additionalElements();t&&(r+=t.length)})),t.forEach(((t,r)=>((e,t,n)=>{const r=t.instance.renderer().element();if(isNaN(n)||!r||!e||!e.children)return;const i=e.children[Math.max(0,n)];if(r===i)return;const o=t.instance.def.additionalElements&&t.instance.def.additionalElements().filter(Boolean);e.insertBefore&&void 0!==i?(e.insertBefore(r,i),o&&o.forEach((t=>{e.insertBefore(t,r)}))):(o&&o.forEach((t=>{e.appendChild(t,r)})),e.appendChild(r))})(e,t,n[r])))}function loe(e,t){let{element:n,data:r=[],settings:i={},on:o={}}=e;const a=t.registries,s=t.logger,l=Fie(t.style,t.palettes),c=[],u=o8({},e),d=function(){const e={};return Qne.mixin(e),e}();let f=[],h=null,p=null,m=null,g=[],y=()=>{},v=()=>{};const b={};let x=!1;const w=function(e){let{createComponent:t}=e;const n={};let r=[],i=[];const o=e=>{const n=t(e);return n&&(r.push(n),e.components&&(n.children=e.components.map((e=>o(e))).filter((e=>!!e)))),n},a=e=>{const t=r.indexOf(e);-1!==t&&r.splice(t,1)},s=(e,t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n],i=t.find((e=>r.hasKey&&r.key===e.key));i?r.children&&i.components&&s(r.children,i.components):(e.splice(n,1),a(r),r.children&&s(r.children,[]),r.instance.destroy())}},l=e=>{let{compList:t,data:n,excludeFromUpdate:r,formatters:i,scales:a,settingsList:s}=e;return s.map((e=>{const s=toe(t,e.key);return r.indexOf(e.key)>-1?(delete s.updateWith,s):s?(e.rendererSettings&&"function"==typeof s.instance.renderer().settings&&s.instance.renderer().settings(e.rendererSettings),e.rendererSettings&&"function"==typeof e.rendererSettings.transform&&e.rendererSettings.transform()?(s.applyTransform=!0,s):(s.updateWith={formatters:i,scales:a,data:n,settings:e},e.components&&(s.children=l({compList:s.children||[],data:n,excludeFromUpdate:r,formatters:i,scales:a,settingsList:e.components})),s)):o(e)})).filter((e=>!!e))},c=e=>{let{components:t,hidden:n,layoutFn:r,ordered:i,rect:o,visible:a}=e;const{visible:s,hidden:l,ordered:u}=r(o,t);a.push(...s),n.push(...l),i.push(...u),s.forEach((e=>{if(e.children){var t,r;const o=ooe(null!==(t=null===(r=e.settings)||void 0===r?void 0:r.strategy)&&void 0!==t?t:{});c({components:e.children,hidden:n,layoutFn:o,ordered:i,rect:e.instance.getRect(),visible:a})}})),l.forEach((e=>{e.children&&c({components:e.children,hidden:n,layoutFn:roe,ordered:i,rect:null,visible:a})}))};return n.destroy=()=>{r.forEach((e=>e.instance.destroy())),r=[],i=[]},n.findComponentByKey=e=>toe(r,e),n.forEach=e=>{r.forEach(e)},n.layout=e=>{let{layoutSettings:t,rect:n}=e;const r=[],o=[],a=[],s=ooe(t);return c({components:i,hidden:o,layoutFn:s,ordered:a,rect:n,visible:r}),{visible:r,hidden:o,ordered:a}},n.set=e=>{let{components:t}=e;i=t.map((e=>o(e))).filter((e=>!!e))},n.update=e=>{let{components:t,data:n,excludeFromUpdate:r,formatters:o,scales:a}=e;s(i,t),i=l({compList:i,data:n,excludeFromUpdate:r,formatters:o,scales:a,settingsList:t})},n}({createComponent:e=>{if(!a.component.has(e.type))return s.warn("Unknown component: ".concat(e.type)),!1;return{instance:oie(a.component(e.type),{settings:e,chart:u,mediator:d,registries:a,theme:l,container:n}),settings:o8(!0,{},e),key:e.key,hasKey:void 0!==e.key}}});function S(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return function(){const r="function"==typeof e[t];let i;for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return i=r?e[t].call(u,...a):n.call(u,...a),i}}const C=()=>{let e;i.dockLayout?(s.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),e=i.dockLayout):e=i.strategy;const t=function(e){if("function"==typeof e.getBoundingClientRect){const{width:t,height:n}=e.getBoundingClientRect();return{x:0,y:0,width:t,height:n}}return{x:0,y:0,width:0,height:0}}(n);return w.layout({layoutSettings:e,rect:t})},k=S("created"),E=S("beforeMount"),M=S("mounted"),_=S("beforeUpdate"),R=S("updated"),I=S("beforeRender"),D=S("beforeDestroy"),P=S("destroyed"),A=function(e,t){let{partialData:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{formatters:r={},scales:i={},scroll:o={}}=t;y=function(e,t){let{types:n,logger:r}=t;const i={},o=[];return Array.isArray(e)?o.push(...e):(r.warn('Deprecated: "data-source" configuration"'),o.push(e)),o.forEach(((e,t)=>{let o=n(e.type);if(o){let n=e.key;void 0===e.key&&(r.warn("Missing key for dataset. Using index '".concat(t,"' as key.")),n=t);let a=o({key:n,data:e.data,config:e.config});i[n]=a}})),e=>e?i[e]:i[Object.keys(i)[0]]}(e,{logger:s,types:a.data}),n||Object.keys(b).forEach((e=>b[e].clear())),t.palettes&&l.setPalettes(t.palettes),t.style&&l.setStyle(t.style),v=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:lte;const i={};return(e||[]).forEach((e=>{if(!e.key)throw new Error('Data collection is missing "key" property');if("object"==typeof e.data&&"collection"in e.data)throw new Error("Data config for collections may not reference other collections");i[e.key]=()=>r(e.data,t,n)})),e=>{let t,n;if("string"==typeof e?t=e:"object"==typeof e&&(t=e.key,n=e),!(t in i))throw new Error("Unknown data collection: ".concat(t));"function"==typeof i[t]&&(i[t]=i[t]());let r=i[t];if(n&&n.fields&&n.fields.filter){let e=r.fields.filter(n.fields.filter);r.fields.length!==e.length&&(r=o8(r,{fields:e}))}return r}}(t.collections,{dataset:y},{logger:s});const c={theme:l,logger:s};h=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Yne;const i={};return{get(o){let a;return"string"==typeof o&&e[o]?a=o:"object"==typeof o&&"scale"in o&&e[o.scale]&&(a=o.scale),a?(i[a]=i[a]||r(e[a],t,n),i[a]):r(o,t,n)},all(){return Object.keys(e).forEach(this.get),i}}}(i,{dataset:y,collection:v},c8(c8({},c),{},{scale:a.scale})),p=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:cte;const i={};return{get(o){let a;return"string"==typeof o&&e[o]?a=o:"object"==typeof o&&"formatter"in o&&e[o.formatter]?a=o.formatter:"object"==typeof o&&"type"in o&&e[o.type]&&(a=o.type),a?(i[a]=i[a]||r(e[a],t,n),i[a]):r(o||{},t,n)},all(){return Object.keys(e).forEach(this.get),i}}}(r,{dataset:y,collection:v},c8(c8({},c),{},{formatter:a.formatter})),m=function(e,t){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=ere(e[r],t?t[r]:null));return n}(o,m)};function O(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},r=e.filter((e=>!!e.key)).map((e=>e.key));g.forEach((e=>{e.key&&-1!==r.indexOf(e.key)?t[e.key]=e:e.destroy()})),g=e.map((e=>{const r=e.key&&t[e.key]?t[e.key]:a.interaction(e.type)(u,d,n);return r.set(e),r}))}const L=e=>{const t=n.getBoundingClientRect(),r="clientX"in e?e.clientX:e.x,i="clientY"in e?e.clientY:e.y,o={x:r-t.left,y:i-t.top},a=[];return f.forEach((e=>{const t=e.instance.getRect();Eie(t.computedPhysical?t.computedPhysical:{x:t.margin.left+t.x*t.scaleRatio.x,y:t.margin.top+t.y*t.scaleRatio.y,width:t.width*t.scaleRatio.x,height:t.height*t.scaleRatio.y},o)&&a.push(e)})),a},T=()=>{if(c.length||!n)return;Object.keys(o).forEach((e=>{const t=o[e].bind(u);n.addEventListener(e,t),c.push({key:e,listener:t})}));const e={},t=t=>{t.touches?(e.x=t.touches[0].clientX,e.y=t.touches[0].clientY,e.multiTouch=t.touches.length>1):(e.x=t.clientX,e.y=t.clientY,e.multiTouch=!1),e.time=Date.now(),e.comps=L(e)},r=t=>{const n=e.comps||L(t);if(!n.every((e=>e.instance.def.disableTriggers))&&("touchend"===t.type&&t.preventDefault(),function(e,t){const n=u8(e),r=n?e.changedTouches[0]:e,i=Date.now()-t.time,o=isNaN(t.x)?0:Math.abs(r.clientX-t.x),a=isNaN(t.y)?0:Math.abs(r.clientY-t.y);return(0===e.button||n)&&!t.multiTouch&&o<=12&&a<=12&&i<=300}(t,e)))for(let e=n.length-1;e>=0;e--){if(n[e].instance.onBrushTap(t),x){x=!1;break}}},i=[];i.push({key:"mousedown",listener:t}),i.push({key:"mouseup",listener:r}),function(e){return"ontouchstart"in e&&"ontouchend"in e||navigator.maxTouchPoints>1}(n)&&(i.push({key:"touchstart",listener:t}),i.push({key:"touchend",listener:r})),i.push({key:"mousemove",listener:e=>{const t=L(e);for(let n=t.length-1;n>=0;n--){if(t[n].instance.onBrushOver(e),x){x=!1;break}}}}),i.forEach((e=>{n.addEventListener(e.key,e.listener),c.push(e)}))},q=()=>{c.forEach((e=>{let{key:t,listener:r}=e;return n.removeEventListener(t,r)})),c.length=0},N=()=>{n.innerHTML="",(()=>{const{components:e=[]}=i;I(),A(r,i),w.set({components:e});const{visible:t,hidden:o,ordered:a}=C();f=t,o.forEach((e=>{e.instance.hide(),e.visible=!1})),t.forEach((e=>e.instance.beforeMount())),t.forEach((e=>e.instance.mount())),t.forEach((e=>e.instance.beforeRender())),t.forEach((e=>e.instance.render())),t.forEach((e=>e.instance.mounted())),t.forEach((e=>{e.visible=!0})),soe(n,a)})(),T(),O(i.interactions)};return u.layoutComponents=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{excludeFromUpdate:t=[]}=e;e.data&&(r=e.data),e.settings&&(i=e.settings,O(e.settings.interactions)),_(),A(r,i);const{formatters:n,scales:o,components:a=[]}=i;w.update({components:a,data:r,excludeFromUpdate:t,formatters:n,scales:o}),w.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),w.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()})),C()},u.update=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{partialData:t,excludeFromUpdate:o=[]}=e;let a;e.data&&(r=e.data),e.settings&&(i=e.settings,O(e.settings.interactions)),_(),A(r,i,{partialData:t});const{formatters:s,scales:l,components:c=[]}=i;w.update({components:c,data:r,excludeFromUpdate:o,formatters:s,scales:l}),w.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),w.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()}));const u=[],d=[];let h;if(t)w.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible&&u.push(e)})),h=u;else{const{visible:e,hidden:t,ordered:n}=C();f=e,h=e,a=n,e.forEach((e=>{e.updateWith&&e.visible?u.push(e):d.push(e)})),t.forEach((e=>{e.instance.hide(),e.visible=!1,delete e.updateWith,e.applyTransform=!1}))}d.forEach((e=>e.instance.beforeMount())),d.forEach((e=>e.instance.mount())),h.forEach((e=>e.instance.beforeRender())),h.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible?e.instance.update():e.instance.render()})),t||soe(n,a),d.forEach((e=>e.instance.mounted())),u.forEach((e=>e.instance.updated())),f.forEach((e=>{delete e.updateWith,e.visible=!0,e.applyTransform=!1})),R()},u.destroy=()=>{D(),w.destroy(),q(),O(),delete u.update,delete u.destroy,P()},u.getAffectedShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"and",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=[];return f.filter((e=>null==r||e.key===r)).forEach((r=>{const o=r.instance.getBrushedShapes(e,t,n);i=[...i,...o]})),i},u.findShapes=e=>{let t=[];return f.forEach((n=>{const r=n.instance.findShapes(e);t=[...t,...r]})),t},u.componentsFromPoint=e=>L(e).map((e=>e.instance.ctx)),u.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[];const i=n.getBoundingClientRect();let o=f;if(Array.isArray(t.components)&&t.components.length>0){const e=t.components.map((e=>e.key));o=f.filter((t=>-1!==e.indexOf(t.key))).map((n=>({instance:n.instance,opts:t.components[e.indexOf(n.key)]})))}for(let n=o.length-1;n>=0;n--){const a=o[n],s=aoe(e,i,a.instance.renderer().element().getBoundingClientRect()),l=a.instance.shapesAt(s,a.opts),c=l.length>0&&"stop"===t.propagation;if(r=[...r,...l],r.length>0&&c)return r}return r},u.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{components:[]};for(let n=0;n<t.components.length;n++){const r=t.components[n].key;f.filter((e=>r===e.key)).forEach((r=>{let i=e.filter((e=>e.key===r.key));r.instance.brushFromShapes(i,t.components[n])}))}},u.scroll=function(){return function(e,t){return t[e]||(t[e]=Zne()),t[e]}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",m)},u.dataset=e=>y(e),u.dataCollection=e=>v(e),u.scales=function(){return h.all()},u.formatters=function(){return p.all()},u.brush=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return b[e]||(b[e]=gre()),b[e]},u.scale=function(e){return h.get(e)},u.formatter=function(e){return p.get(e)},u.toggleBrushing=function(e){x=void 0!==e?e:!x},u.component=e=>{const t=w.findComponentByKey(e);return null==t?void 0:t.instance.ctx},u.logger=()=>s,u.theme=()=>l,u.storage=aie({animations:{updatingStageMeta:{isInit:!1,shouldBeRemoved:!1}}}),Object.defineProperty(u,"interactions",{get:()=>({instances:g,on(){T(),g.forEach((e=>e.on()))},off(){q(),g.forEach((e=>e.off()))}})}),k(),n&&(E(),N(),M(n),u.element=n),u}const coe=e=>{let t=S7(e);return t.prio=e=>e?t.default(e[0]):[t.default()],t.types=()=>t.getKeys(),t};var uoe=S7();function doe(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}const foe=e=>e.filter((e=>"number"==typeof e&&!isNaN(e)));const hoe=e=>{let{key:t,data:n,cache:r,config:i}=e;if(!n)return;let o=n;"string"==typeof o&&(o=(e=>{let{data:t,config:n}=e;const r=t.split("\n"),i=r[0],o=r[1];let a=",";if(n&&n.parse&&n.parse.delimiter)a=n.parse.delimiter;else if(i){const e=[/,/,/\t/,/;/];for(let t=0;t<e.length;t++){const n=e[t];if(i&&o){if(n.test(i)&&n.test(o)&&i.split(n).length===o.split(n).length){a=n;break}}else n.test(i)&&(a=n)}}return r.map((e=>e.split(a)))})({data:n,config:i})),Array.isArray(o)&&function(e){let t,{source:n,data:r,cache:i,config:o}=e,a=r;const s=o&&o.parse;Array.isArray(r[0])?s&&!1===s.headers?t=r[0].map(((e,t)=>t)):(t=r[0],a=r.slice(1)):t=Object.keys(r[0]);const l=!!s&&"function"==typeof s.row&&s.row;let c,u=t;u=s&&"function"==typeof s.fields?s.fields(u.slice()):t.map((e=>({key:e,title:e}))),Array.isArray(r[0])?c=u.map((()=>[])):(c={},u.forEach((e=>{c[e.key]=[]})));for(let e=0;e<a.length;e++){const t=l?l(a[e],e,u):a[e];if(t)if(Array.isArray(t))for(let e=0;e<u.length;e++)c[e].push(t[e]);else for(let e=0;e<u.length;e++)c[u[e].key].push(t[u[e].key])}const d=Array.isArray(c)?e=>c[e]:e=>c[u[e].key];for(let e=0;e<u.length;e++){const t=d(e),r=foe(t),o=r.length>0,a=o?"measure":"dimension",s=o?Math.min(...r):NaN,l=o?Math.max(...r):NaN;i.fields.push(Yee(o8({source:n,key:e,title:u[e].title,values:t,min:s,max:l,type:a},u[e]),{value:u[e].value,label:u[e].label}))}}({data:o,cache:r,source:t,config:i})};function poe(){let{key:e,data:t,config:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={fields:[]},i={key:()=>e,raw:()=>t,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];for(let t=0;t<n.fields.length;t++)if(n.fields[t].key()===e)return n.fields[t];for(let t=0;t<n.fields.length;t++)if(n.fields[t].title()===e)return n.fields[t];return null}(e,{cache:r}),fields:()=>r.fields.slice(),extract:e=>function(e,t){const n=Array.isArray(e)?e:[e];let r=[];return n.forEach((e=>{if(void 0!==e.field){const n=t.field(e.field),i=t.key();if(!n)throw Error("Field '".concat(e.field,"' not found"));const{props:o,main:a}=Zee(e,t),s=Object.keys(o),l=!!e.trackBy,c=typeof e.trackBy,u={},d=[],f=n.items(),h=[];for(let t=0;t<f.length;t++){const n=f[t];if(a.filter&&!a.filter(n))continue;const r=doe(a,n,{key:i});s.forEach((e=>{const a=o[e];let s=a.field?a.field.items()[t]:n;r[e]=doe(a,s,{key:i})})),l&&nte({cfg:e,itemData:n,obj:r,target:d,tracker:u,trackType:c}),h.push(r)}r=l?[...r,...tte(d,{main:a,propsArr:s,props:o})]:[...r,...h]}})),r}(e,i),hierarchy:()=>null};return hoe({key:e,data:t,config:n,cache:r}),i}poe.util={normalizeConfig:Zee,collect:tte,track:nte};const moe=S7();moe.default("matrix"),moe("matrix",poe),moe("default",poe);const goe=S7();function yoe(e,t,n){return Math.max(e,Math.min(t,n))}function voe(e){let{item:t,value:n,boxCenter:r,rendWidth:i,rendHeight:o,flipXY:a,symbol:s}=e,l="x",c="y",u=i,d=o,f=n<.5?90:-90;return a&&(l="y",c="x",u=o,d=i,f=n<.5?180:0),s(o8({},t.oob,{[l]:r*u,[c]:Math.max(t.oob.size/2,Math.min(n*d,d-t.oob.size/2)),startAngle:f}))}function boe(e){let{item:t,boxWidth:n,boxPadding:r,rendWidth:i,rendHeight:o,flipXY:a}=e,s="x",l="y",c="width",u="height",d=i,f=o;a&&(s="y",l="x",c="height",u="width",d=o,f=i);const{actualDiff:h,actualLow:p}=function(e){let{start:t,end:n,minPx:r=.1,maxPx:i=1}=e;const o=Math.max(t,n),a=Math.min(t,n),s=yoe(-.1,1.2,o),l=yoe(-.1,1.2,a),c=s*i-l*i,u=Math.max(r,c),d=(u-c)/2;return{actualDiff:u,startModifier:d,actualLow:l*i-d}}({start:t.start,end:t.end,minPx:t.box.minHeightPx,maxPx:f});return o8({},t.box,{type:"rect",[s]:(r+t.major)*d,[l]:p,[u]:h,[c]:n*d,data:t.data||{},collider:{type:null}})}function xoe(e){let{item:t,from:n,to:r,boxCenter:i,rendWidth:o,rendHeight:a,flipXY:s}=e,l="x1",c="y1",u="x2",d="y2",f=o,h=a;return s&&(l="y1",c="x1",u="y2",d="x2",f=a,h=o),o8({},t.line,{type:"line",[d]:Math.floor(n*h),[l]:i*f,[c]:Math.floor(r*h),[u]:i*f,data:t.data||{},collider:{type:null}})}function woe(e){let{item:t,key:n,position:r,width:i,boxCenter:o,rendWidth:a,rendHeight:s,flipXY:l}=e,c="x1",u="y1",d="x2",f="y2",h=a,p=s;l&&(c="y1",u="x1",d="y2",f="x2",h=s,p=a);const m=i/2;return o8({type:"line"},t[n],{[u]:Math.floor(r*p),[c]:(o-m)*h,[f]:Math.floor(r*p),[d]:(o+m)*h,r:m*h,cx:o*h,cy:r*p,width:i*h,data:t.data||{},collider:{type:null}})}function Soe(e,t,n){const{width:r,maxWidthPx:i,minWidthPx:o}=t.box,a=e>=0?1:-1;let s=Math.min(a*e*r,isNaN(i)?n:i/n);return s=isNaN(o)?s:Math.max(o/n,s),s*a}goe("native",(function(e,t,n){let r,i,o={chart:e,mediator:t,element:n},a=[],s=!0;function l(){"function"==typeof r.enable&&(r.enable=r.enable.bind(o)()),r.enable&&Object.keys(r.events).forEach((e=>{const t=r.events[e].bind(o);n.addEventListener(e,t),a.push({key:e,listener:t})}))}function c(){a.forEach((e=>{let{key:t,listener:r}=e;n.removeEventListener(t,r)})),a=[]}return{get key(){return i},set(e){!function(e){i=e.key,r=e,r.events=r.events||[],void 0===r.enable&&(r.enable=!0)}(e),c(),s&&l()},off(){s=!1,c()},on(){s=!0,0===a.length&&l()},destroy(){c(),o=null,r=null}}}));const Coe={oob:{show:!0,type:"n-polygon",fill:"#999",stroke:"#000",strokeWidth:0,size:10,sides:3,startAngle:-90},box:{show:!0,fill:"#fff",stroke:"#000",strokeWidth:1,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1},line:{show:!0,stroke:"#000",strokeWidth:1},median:{show:!0,stroke:"#000",strokeWidth:1},whisker:{show:!0,stroke:"#000",strokeWidth:1,fill:"",type:"line",width:1}},koe=Object.keys(Coe),Eoe={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},style:{box:"$shape",line:"$shape-guide",whisker:"$shape-guide",median:"$shape-guide--inverted"}},created(){this.state={}},render(e){let{data:t}=e;const{width:n,height:r}=this.rect,i="horizontal"===this.settings.settings.orientation,{style:o,resolver:a,symbol:s}=this,l=koe.filter((e=>!this.settings.settings[e]||!1!==this.settings.settings[e].show)),c={};l.forEach((e=>c[e]=Coe[e]));const u=function(e){let{keys:t,data:n,defaultSettings:r,style:i,settings:o,width:a,height:s,resolver:l}=e;const c=o8(!0,{},r||{},i||{}),u={major:"horizontal"===o.orientation?s:a,minor:"horizontal"===o.orientation?a:s},d=o.major;let f;f="object"==typeof d&&"object"==typeof d.ref&&void 0!==d.ref.start&&void 0!==d.ref.end?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:o8(!0,{},{binStart:{scale:o.major.scale,ref:o.major.ref.start},binEnd:{scale:o.major.scale,ref:o.major.ref.end}})}):"object"==typeof d&&void 0!==d.binStart&&void 0!==d.binEnd?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:o8(!0,{},{binStart:{scale:o.major.scale,ref:"binStart"},binEnd:{scale:o.major.scale,ref:"binEnd"}},o.major)}):l.resolve({data:n,scaled:u,defaults:{major:.5},settings:{major:o.major}});const h=o.minor||{},p={};["start","end","min","max","med"].forEach((e=>{(h[e]||n.items&&n.items.length&&n.items[0][e])&&(p[e]={scale:h.scale,ref:e})}));let m,g={major:f,minor:l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:o8(!0,{},p,h)})};for(let e=0,r=t.length;e<r;e++)o[m]&&!1===o[m].show||(m=t[e],g[m]=l.resolve({data:n,defaults:c[m],settings:o[m],scaled:u}));return g}({keys:l,data:t,defaultSettings:c,style:o,settings:this.settings.settings,width:n,height:r,resolver:a}),{settings:d,items:f}=u,h=function(e){let{width:t,height:n,flipXY:r,resolved:i,keys:o,symbol:a}=e;const s=[],l=i.major.items;if(!l.length)return s;const c=t,u=n,d=r?n:t,f=i.major.settings,h=["start","end","min","max","med"].filter((e=>void 0!==i.minor.settings[e])),p=h.length,m=o.filter((e=>"oob"!==e));let g,y,v,b,x,w,S,C,k;const E=o?o.length:0,M=m?m.length:0,_={box:function(){v.box&&d8(v.start)&&d8(v.end)&&g.push(boe({item:v,boxWidth:b,boxPadding:x,rendWidth:c,rendHeight:u,flipXY:r}))},line:function(){d8(v.min)&&d8(v.start)&&g.push(xoe({item:v,from:v.min,to:v.start,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r})),d8(v.max)&&d8(v.end)&&g.push(xoe({item:v,from:v.max,to:v.end,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))},median:function(){v.median&&d8(v.med)&&g.push(woe({item:v,key:"median",position:v.med,width:b,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))},whisker:function(){if(v.whisker){const e=b*v.whisker.width;d8(v.min)&&g.push(woe({item:v,key:"whisker",position:v.min,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r})),d8(v.max)&&g.push(woe({item:v,key:"whisker",position:v.max,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))}}};function R(){let e,t=-Number.MAX_VALUE,n=Number.MAX_VALUE;for(let r=0;r<p;r++)e=v[h[r]],d8(e)&&(t<e&&(t=e),n>e&&(n=e));S=t<0&&t!==-Number.MAX_VALUE,C=n>1&&n!==Number.MAX_VALUE,k=S||C}for(let e=0,t=l.length;e<t;e++){g=[],y=null;const t=l[e],n=t.data;let h=null,p=null;void 0!==f.binStart?(h=t.binStart,p=t.binEnd,y=f.binStart.scale):(y=f.major.scale,h=y?t.major:0);let I=0;y?y.bandwidth?(I=y.bandwidth(),h-=I/2):I=p-h:I=1,v=o8({},{major:h,majorEnd:p},i.minor.items[e]);for(let t=0;t<E;t++)v[o[t]]=i[o[t]].items[e];if(b=Soe(I,v,d),x=(I-b)/2,w=x+v.major+b/2,R(),k)v.oob&&(S?g.push(voe({item:v,value:0,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r,symbol:a})):C&&g.push(voe({item:v,value:1,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r,symbol:a})));else for(let e=0;e<M;e++)v[m[e]]&&!1===v[m[e]].show||_[m[e]]();const D={type:"container",data:n,collider:{type:"bounds"},children:g};s.push(D)}return s}({width:n,height:r,flipXY:i,resolved:u,keys:l,symbol:s});return h}};const Moe={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},_oe=/px$/,Roe={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},Ioe={imageSrc:void 0,imageScalingFactor:void 0,position:"center-center",symbol:"rectangle",width:void 0,height:void 0},Doe={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function Poe(e,t){return e&&"function"==typeof e.bandwidth?{isBandwidth:!0,value:Math.max(1,e.bandwidth()*t)}:{isBandwidth:!1,value:Math.max(1,t)}}function Aoe(e,t,n,r){let{width:i,height:o}=t;return e.filter((e=>!1!==e.show&&!isNaN(e.x+e.y))).map((e=>{let t=e,a=_oe.test(e.size)?parseInt(e.size,10):n.min+t.size*(n.max-n.min);f8(a)&&(t=Moe,a=n.min+t.size*(n.max-n.min));const[s,l]=function(e){let t=Roe.shape,n={};return"object"==typeof e.shape&&"string"==typeof e.shape.type?(t=e.shape.type,n=e.shape):"string"==typeof e.shape&&(t=e.shape),[t,n]}(t),c=c8(c8({},l),{},{type:s,label:e.label,x:e.x*i,y:e.y*o,fill:t.fill,size:Math.min(n.maxGlobal,Math.max(n.minGlobal,a)),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeDasharray:t.strokeDasharray,opacity:t.opacity,imageSettings:t.imageSettings});t===e.errorShape&&(c.width=t.width);const u=r(c);return u.data=e.data,u}))}const Ooe={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},animations:{enabled:!1,trackBy:e=>e.data.value},style:{item:"$shape"}},render(e){let{data:t}=e;const n=this.resolver.resolve({data:t,defaults:o8({},Roe,this.style.item),settings:this.settings.settings,scaled:{x:this.rect.width,y:this.rect.height}}),{width:r,height:i}=this.rect,o=o8({},Doe,this.settings.settings.sizeLimits),a=n.items;a.length>0&&"image"===a[0].shape&&t.items.forEach(((e,t)=>{a[t].imageSettings=o8({},Ioe,this.settings.settings.imageSettings)}));const s=function(e,t,n,r,i){const o=Poe(e?e.scale:void 0,n),a=Poe(t?t.scale:void 0,r);let s=Math.min(o.value*i[o.isBandwidth?"maxRelDiscrete":"maxRelExtent"],a.value*i[a.isBandwidth?"maxRelDiscrete":"maxRelExtent"]),l=Math.min(o.value*i[o.isBandwidth?"minRelDiscrete":"minRelExtent"],a.value*i[a.isBandwidth?"minRelDiscrete":"minRelExtent"]);return{min:Math.max(1,Math.floor(l)),max:Math.max(1,Math.floor(s)),maxGlobal:i.maxPx,minGlobal:i.minPx}}(n.settings.x,n.settings.y,r,i,o);return Aoe(a,this.rect,s,this.settings.shapeFn||this.symbol)}};const Loe={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function Toe(e,t,n,r){let{x:i,y:o,width:a,height:s}=t;const l=H8(),c={x:i+a/2,y:o+s/2},u=Math.min(a,s)/2,d=Math.min(a,s)/2,f=d/100;return e.map(((e,t)=>{const i=n[t];i.type="path";const o=d*i.outerRadius,a=u*i.innerRadius,s=f*i.cornerRadius;l.innerRadius(a),l.outerRadius(o),l.cornerRadius(s),i.arcDatum=e;const h=l.centroid(e),p=i.offset?function(e,t,n,r){let[i,o]=e;const a=Math.sqrt(i*i+o*o);i/=a,o/=a;const s=n-r;return{x:i*t*s,y:o*t*s}}(h,i.offset,o,a):{x:0,y:0};return i.transform="translate(".concat(p.x,", ").concat(p.y,") translate(").concat(c.x,", ").concat(c.y,")"),i.desc={share:e.value/r,slice:{start:e.startAngle,end:e.endAngle,innerRadius:a,outerRadius:o,cornerRadius:s,offset:{x:c.x+p.x,y:c.y+p.y}}},i}))}function qoe(e,t){return e.slice&&"arc"in e.slice?t.arc:t.data.value}const Noe={require:["chart","resolver"],defaultSettings:{settings:{startAngle:0,endAngle:2*Math.PI,padAngle:0,slice:{}},style:{slice:"$shape"},data:{}},render(e){let{data:t}=e;const n=[],r=[],i=this.settings.settings,{items:o}=this.resolver.resolve({data:t,defaults:o8({},Loe,this.style.slice),settings:i.slice});let a=0;for(let e=0,t=o.length;e<t;e++){const t=qoe(i,o[e]);t>0&&o[e].outerRadius>=o[e].innerRadius&&(n.push(t),r.push(o[e]),a+=t)}const s=function(){var e=Q8,t=J8,n=null,r=M8(0),i=M8(N8),o=M8(0);function a(a){var s,l,c,u,d,f=a.length,h=0,p=new Array(f),m=new Array(f),g=+r.apply(this,arguments),y=Math.min(N8,Math.max(-N8,i.apply(this,arguments)-g)),v=Math.min(Math.abs(y)/f,o.apply(this,arguments)),b=v*(y<0?-1:1);for(s=0;s<f;++s)(d=m[p[s]=s]=+e(a[s],s,a))>0&&(h+=d);for(null!=t?p.sort((function(e,n){return t(m[e],m[n])})):null!=n&&p.sort((function(e,t){return n(a[e],a[t])})),s=0,c=h?(y-f*b)/h:0;s<f;++s,g=u)l=p[s],u=g+((d=m[l])>0?d*c:0)+b,m[l]={data:a[l],index:s,value:d,startAngle:g,endAngle:u,padAngle:v};return m}return a.value=function(t){return arguments.length?(e="function"==typeof t?t:M8(+t),a):e},a.sortValues=function(e){return arguments.length?(t=e,n=null,a):t},a.sort=function(e){return arguments.length?(n=e,t=null,a):n},a.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:M8(+e),a):r},a.endAngle=function(e){return arguments.length?(i="function"==typeof e?e:M8(+e),a):i},a.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:M8(+e),a):o},a}().sortValues(null);s.startAngle(i.startAngle),s.endAngle(i.endAngle),s.padAngle(i.padAngle);return Toe(s(n),o8({},this.rect,{x:0,y:0}),r,a)}};const joe=function(e){function t(t){if(e[t.type]&&e[t.type].condition(t)){const n=e[t.type],r=void 0===n.conditionAppend||n.conditionAppend(t);n.items.forEach((e=>{const n=Math.round(t[e.key]),i=t[e.key]-n;t[e.key]=n,r&&"append"===e.type&&(i>0?t[e.key]+=.5:t[e.key]-=.5)}))}}return void 0===e&&((e={}).line={append:["x1","x2","y1","y2"],round:[],condition:e=>e.x1===e.x2||e.y1===e.y2,conditionAppend:e=>e.strokeWidth%2!=0},e.rect={append:["x","y"],round:["width","height"],condition:()=>!0,conditionAppend:e=>e.strokeWidth%2!=0}),Object.keys(e).forEach((t=>{const n=e[t];n.items=[],n.append.forEach((e=>{n.items.push({key:e,type:"append"})})),n.round.forEach((e=>{n.items.push({key:e,type:"round"})}))})),t.multiple=e=>e.forEach((e=>t(e))),t}();class zoe{constructor(){this.reset(),this.push(...arguments)}static evaluateKey(e,t){if(t){const t=e.substring(0,1),n=e.substring(1);if("x"===t)return"y".concat(n);if("y"===t)return"x".concat(n);if("cx"===e)return"cy";if("cy"===e)return"cx";if("width"===e)return"height";if("height"===e)return"width"}return e}transposeCoordinate(e,t,n){if("number"==typeof t&&isFinite(t)){const r=e.substring(0,1);if("x"===r||"cx"===e)return t*this.width;if("width"===e)return t*this.width;if("r"===e)return t*(n?this.height:this.width);if("y"===r||"cy"===e)return t*this.height;if("height"===e)return t*this.height}return t}push(){return this.storage.push(...arguments),this}processItem(e){let t={};const n=void 0!==e.flipXY?e.flipXY:this.flipXY,r=void 0!==e.crisp?e.crisp:this.crisp;if(e.fn&&"function"==typeof e.fn){let r=n?this.height:this.width,i=n?this.width:this.height;e=e.fn({width:r,height:i,flipXY:n});const o=Object.keys(e);for(let r=0,i=o.length;r<i;r++){let i=o[r];t[zoe.evaluateKey(i,n)]=e[i]}}else{const r=Object.keys(e);for(let i=0,o=r.length;i<o;i++){let o=r[i];const a=zoe.evaluateKey(o,n),s=this.transposeCoordinate(a,e[o],n);t[a]=s}}return r&&joe(t),t}output(){let e=[];for(let t=0,n=this.storage.length;t<n;t++){let n=this.processItem(this.storage[t]);e.push(n)}return e}reset(){this.storage=[],this.flipXY=!1,this.crisp=!1,this.width=0,this.height=0}}function Foe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new zoe(...t)}function Woe(e,t){return e&&t?e.cachedTicks&&e.cachedTicks()||e.ticks({distance:t}):[]}const $oe={created(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender(){this.blueprint=Foe(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){if(this.x=this.settings.x?this.chart.scale(this.settings.x):null,this.y=this.settings.y?this.chart.scale(this.settings.y):null,Rre(this,"x",this.rect.width),Rre(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=o8({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=o8({show:!1},this.style.minorTicks,this.settings.minorTicks||{}),this.lines={x:[],y:[]},this.lines.x=Woe(this.x,this.rect.width),this.lines.y=Woe(this.y,this.rect.height),this.lines.y=this.lines.y.map((e=>o8(e,{flipXY:!0})));let e=e=>{let{dir:t,isMinor:n}=e,r=this.lines[t].filter((e=>!!e.isMinor===n)),i=n?this.settings.minorTicks:this.settings.ticks;this.resolver.resolve({settings:i,data:{items:r,dir:t}}).items.forEach((e=>{let n=e.data;var r,i;e.show&&this.blueprint.push({type:"line",x1:n.position,y1:0,x2:n.position,y2:1,stroke:e.stroke||"black",strokeWidth:void 0!==e.strokeWidth?e.strokeWidth:1,strokeDasharray:void 0!==e.strokeDasharray?e.strokeDasharray:void 0,flipXY:n.flipXY||!1,value:null!==(r=n.value)&&void 0!==r?r:null===(i=n.data)||void 0===i?void 0:i.value,dir:t})}))};return e({dir:"x",isMinor:!1}),e({dir:"x",isMinor:!0}),e({dir:"y",isMinor:!1}),e({dir:"y",isMinor:!0}),this.blueprint.output()}};function Boe(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.8,"left"===r||"right"===r){let i="right"===r;return"\n M ".concat(e," ").concat(t-n,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(i?0:1,", ").concat(e," ").concat(t+n,"\n L ").concat(i?e+n:e-n," ").concat(t," Z\n ")}let i="bottom"===r;return"\n M ".concat(e-n," ").concat(t,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(i?1:0,", ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(i?t+n:t-n," Z\n ")}function Voe(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.75,"left"===r||"right"===r){let i="right"===r;return"\n M ".concat(e+=i?1.5*n:-1.5*n," ").concat(t-n,"\n L ").concat(e," ").concat(t+n,"\n L ").concat(i?e+n:e-n," ").concat(t," Z\n ")}let i="bottom"===r;return t+=i?1.5*n:-1.5*n,"\n M ".concat(e-n," ").concat(t,"\n L ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(i?t+n:t-n," Z\n ")}function Hoe(e,t,n){return e<t||e>n}function Uoe(e,t){if("string"==typeof e.formatter)return t.formatter(e.formatter);if("object"==typeof e.formatter)return t.formatter(e.formatter);if(void 0!==e.scale&&e.scale.data){const t=e.scale.data()&&e.scale.data().fields;return t&&t[0]?t[0].formatter():null}return null}function Goe(e){if(void 0===e)return 0;if("number"==typeof e&&isFinite(e))return e;if("string"==typeof e)switch(e){case"center":case"middle":return.5;case"bottom":case"right":return 1;default:return 0}return 0}function Yoe(e){var t,n;let{chart:r,blueprint:i,renderer:o,p:a,settings:s,items:l,slopeLine:c}=e,u=!0,d=!1,f=!1,h=!1,p=!1,m=o8(!0,{},s.style.line,a.line||{}),g=o8(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},s.style.label||{},{fill:m.stroke});if(d=c?i.processItem({type:"line",x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,stroke:m.stroke||"black",strokeWidth:m.strokeWidth||1,strokeDasharray:m.strokeDasharray,flipXY:!1,value:a.valueInfo?a.valueInfo.id:a.value}):i.processItem({type:"line",x1:a.position,y1:0,x2:a.position,y2:1,stroke:m.stroke||"black",strokeWidth:m.strokeWidth||1,strokeDasharray:m.strokeDasharray,flipXY:a.flipXY||!1,value:a.valueInfo?a.valueInfo.id:a.value}),a.label&&!1!==a.label.show&&(null==c||!c.slope||0===c.slope)){const e=o8(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},s.style.label||{},{fill:m.stroke},a.label);let t,n={width:0,height:0},c="";t=Uoe(a,r),!1!==a.label.showValue&&(t?c=" (".concat(t(a.value),")"):a.scale&&(c=" (".concat(a.value,")"))),c&&(n=o.measureText({text:c,fontFamily:e.fontFamily,fontSize:e.fontSize}));let d=o.measureText({text:e.text||"",fontFamily:e.fontFamily,fontSize:e.fontSize}),g={width:d.width+n.width,height:Math.max(d.height,n.height)},y=e.padding,v=Goe(a.flipXY?e.vAlign:e.align),b=Goe(a.flipXY?e.align:e.vAlign),x=Math.min(1+g.width+2*y,e.maxWidth*i.width,e.maxWidthPx),w=g.height+2*y,S=a.flipXY?w:x,C=a.flipXY?x:w;if(f=i.processItem({fn:t=>{let{width:n,height:r}=t,o=a.position*n-(a.flipXY?w:x)*(1-v);o=a.flipXY?o:Math.max(o,0);return{type:"rect",x:o,y:Math.max(Math.abs(b*r-C*b),0),width:a.flipXY?S:Math.min(S,i.width-o),height:C,stroke:e.background.stroke,strokeWidth:e.background.strokeWidth,fill:e.background.fill,opacity:e.background.opacity}},flipXY:a.flipXY||!1}),f.x<-1||f.x+f.width>i.width+1||f.y<-1||f.y+f.height>i.height+1)f=void 0;else{h={type:"text",text:e.text||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:f.x+y,y:f.y+f.height/2+g.height/3,maxWidth:f.width-2*y-n.width,anchor:"start"},c&&(p={type:"text",text:c||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:h.x+3+(f.width-(n.width+2*y)),y:h.y});for(let e=0,t=l.length;e<t;e++){let t=l[e];"rect"===t.type?Cie(f,t)&&(u=!1):"line"===t.type&&a.flipXY===t.flipXY&&Mie(f,t)&&(u=!1)}}}if(d&&l.push(d),c&&0!==c.slope&&(!1!==(null===(t=c.label)||void 0===t?void 0:t.show)||!1!==(null===(n=c.label)||void 0===n?void 0:n.showValue))){var y,v,b;let e,t;const n=120;let s=!1!==(null===(y=c.label)||void 0===y?void 0:y.show)?null===(v=c.label)||void 0===v?void 0:v.text:"";if(!1!==(null===(b=c.label)||void 0===b?void 0:b.showValue)){var x;const t=Uoe(a,r),n=t?t(c.value):c.value;e="(".concat(c.slope,"x + ").concat(n,")"),s+=null!==(x=c.label)&&void 0!==x&&x.text?" ".concat(e):e}if(s.length>1){var w,S,C;const e=o.measureText({text:s,fontFamily:g.fontFamily,fontSize:g.fontSize});e.width=e.width>n?n:e.width;const a=function(e,t,n){const r=e.scale({scale:"x"}),i=e.scale({scale:"y"});if(t>0){if(r.max()*t+n>=i.max())return!0}else if(t<0&&r.min()*t+n>=i.max())return!0;return!1}(r,c.slope,c.value)?function(e,t,n){const r=e.scale({scale:"x"}),i=e.scale({scale:"y"});return r((i.max()-n)/t)}(r,c.slope,c.value):void 0,u=void 0===a||c.isRtl?g.padding:3*g.padding,f=void 0!==a||c.slope>0?3*g.padding:g.padding,h=function(e,t,n,r,i,o){let a=0;if(void 0!==n){if(n<.8)return a=e.slope<0||e.isRtl?3*o.padding:2*o.padding,e.isRtl,n*i.width+a;if(1===n)return e.isRtl?n*i.width-(r.width+3*o.padding):n*i.width-(r.width+6*o.padding);if(n>.8)return e.isRtl?n*i.width-(r.width+3*o.padding):n*i.width-(r.width+6*o.padding)}else if(e.slope>0)return t.x2-(r.width+2*o.padding);return e.isRtl?t.x1-(r.width+2*o.padding):t.x1}(c,d,a,e,i,g),p=Math.min(d.y1,d.y2);null!==(w=c.label)&&void 0!==w&&w.stroke&&(t={type:"rect",x:c.isRtl?Math.max(h,u)-2:Math.max(h,u)+2,y:Math.abs(Math.max(p,f)-e.height),rx:3,ry:3,width:e.width+g.padding,height:e.height-2,stroke:m.stroke,fill:m.stroke});const y={type:"text",text:s,fill:null!==(S=null===(C=c.label)||void 0===C?void 0:C.stroke)&&void 0!==S?S:m.stroke,opacity:g.opacity,fontFamily:g.fontFamily,fontSize:g.fontSize,x:t?t.x+2:Math.max(h,u)+2,y:t?t.y+e.height-g.padding:Math.abs(Math.max(p,f)-g.padding/2),anchor:"start",title:s,maxWidth:n,width:e.width};(function(e,t,n,r,i){for(let o=0,a=e.length;o<a;o++){const a=e[o];if("text"===(null==a?void 0:a.type)&&Math.abs(a.x-t.x)<Math.max(a.width+r,t.width+r)&&Math.abs(a.y-t.y)<n.height+i)return!0}return!1})(l,y,e,u,f)||(t&&l.push(t),l.push(y))}}u&&f&&h&&(l.push(f,h),p&&l.push(p))}function Koe(e){const t={value:e.value};return e.label&&(t.label=e.label.text),t}function Xoe(e){return void 0!==("function"==typeof e.value?e.value():e.value)}function Joe(e,t){const n=e.min();if(n===e.max()){const r=function(e){const t=e.range();return 2===(null==t?void 0:t.length)&&t[0]>t[1]}(e);if(t<n)return r?2:-1;if(t>n)return r?-1:2}return e(t)}function Qoe(e,t){return e&&t&&Math.abs(e.x-t.x)<1e-15&&Math.abs(e.y-t.y)<1e-15}const Zoe={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:0},style:{oob:{show:!0,width:10,fill:"#1A1A1A",stroke:"transparent",strokeWidth:0,opacity:1,text:{fontFamily:"Arial",stroke:"transparent",fill:"#fff",strokeWidth:0,opacity:1},triangle:{fill:"#4D4D4D",stroke:"transparent",strokeWidth:0,opacity:1},padding:{x:28,y:5}},line:{stroke:"#000"},label:{strokeWidth:0}}},preferredSize:()=>30,beforeRender(){this.blueprint=Foe(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){let e=this.settings;if(this.lines={x:[],y:[]},this.lines.x=e.lines&&e.lines.x||[],this.lines.y=e.lines&&e.lines.y||[],0===this.lines.x.length&&0===this.lines.y.length)return[];const t={x0:[],x1:[],y0:[],y1:[]};this.lines.x=this.lines.x.filter(Xoe).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=Joe(t,e.value);return o8(e,{scale:t,position:n})}return o8(e,{position:e.value})})),this.lines.y=this.lines.y.filter(Xoe).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=Joe(t,e.value);return o8(e,{scale:t,position:n,flipXY:!0})}return o8(e,{position:e.value,flipXY:!0})})),this.lines.x=this.lines.x.filter((e=>!(e.position<0||e.position>1)||(t["x".concat(e.position>1?1:0)].push(Koe(e)),!1))),this.lines.y=this.lines.y.filter((e=>!(!e.slope||0===e.slope)||(!(e.position<0||e.position>1)||(t["y".concat(e.position>1?1:0)].push(Koe(e)),!1))));let n=[];return[...this.lines.x,...this.lines.y].forEach((r=>{if(!0===r.show||void 0===r.show){let i;if(r.slope&&0!==r.slope){const e=this.chart.scale({scale:"x"}),n=this.chart.scale({scale:"y"}),o=e.min(),a=e.max(),s=n.min(),l=n.max();i=c8(c8({},r),{},{x1:void 0,y1:void 0,x2:void 0,y2:void 0});const c=o*r.slope+r.value,u=a*r.slope+r.value,d=(s-r.value)/r.slope,f=(l-r.value)/r.slope;let h=[];Hoe(c,s,l)||(h[0]={x:Joe(e,o),y:Joe(n,c)}),Hoe(d,o,a)||(h[1]={x:Joe(e,d),y:1}),Hoe(u,s,l)||(h[2]={x:Joe(e,a),y:Joe(n,u)}),Hoe(f,o,a)||(h[3]={x:Joe(e,f),y:0});const p=h.filter((e=>!!e)).length;if(p>2&&function(e){Qoe(e[0],e[1])&&(e[1]=void 0),Qoe(e[1],e[2])&&(e[2]=void 0),Qoe(e[2],e[3])&&(e[3]=void 0),Qoe(e[3],e[0])&&(e[3]=void 0)}(h),h=h.filter((e=>!!e)),h.length<2)return void t["y".concat(c>l?0:1)].push(Koe(r));i.x1=h[0].x,i.y1=h[0].y,i.x2=h[1].x,i.y2=h[1].y}else i=void 0;Yoe({chart:this.chart,blueprint:this.blueprint,renderer:this.renderer,p:r,settings:e,items:n,slopeLine:i})}})),e.style.oob.show&&function(e){let{blueprint:t,oob:n,settings:r,items:i}=e;const o=Object.keys(n);let a=r.style.oob||{};for(let e=0,r=o.length;e<r;e++){const r=o[e],s=n[r];if(s.length>0){let e=r.charAt(1),n="y"===r.charAt(0),o=a.padding.x+a.width,l=a.padding.y+a.width,c="bottom";c=n?"1"===e?"bottom":"top":"1"===e?"right":"left";let u=t.processItem({fn:t=>{let{width:r,height:i}=t,u=e*r+("1"===e?-o:o),d=n?l:i-l;return"arc"===a.type?{type:"path",d:Boe(n?d:u,n?u:d,a.width,c),x:u,y:d,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0}:{type:"circle",cx:u,cy:d,r:a.width,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0,opacity:a.opacity,data:s}},flipXY:n}),d=u.cx||u.x,f=u.cy||u.y;const h=s.map((e=>e.label?"".concat(e.label," (").concat(e.value,")"):"(".concat(e.value,")"))),p=h.reduce(((e,t,n)=>0===n?t:"".concat(e,"\n\n").concat(t)),"");let m={type:"text",text:s.length||"",title:p,x:d-.4*a.width,y:f+.4*a.width,fontFamily:a.text.fontFamily,fontSize:"".concat(1.3*a.width,"px"),stroke:a.text.stroke,fill:a.text.fill,strokeWidth:a.text.strokeWidth||0,opacity:a.text.opacity},g={type:"path",d:Voe(d,f,a.width,c),x:d,y:f,stroke:a.triangle.stroke,fill:a.triangle.fill,strokeWidth:a.triangle.strokeWidth||0,opacity:a.triangle.opacity};i.push(u,m,g)}}}({blueprint:this.blueprint,oob:t,settings:e,items:n}),n}};function eae(e){const t={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null}};return"top"===e.align||"bottom"===e.align?(t.x1=e.innerRect.x-e.outerRect.x,t.x2=t.x1+e.innerRect.width,t.y1=t.y2="top"===e.align?e.innerRect.height-e.padding:e.padding):(t.x1=t.x2="left"===e.align?e.innerRect.width-e.padding:e.padding,t.y1=e.innerRect.y-e.outerRect.y,t.y2=t.y1+e.innerRect.height),function(e,t){o8(e,t.style)}(t,e),t}function tae(e){return"string"==typeof e||"number"==typeof e?e:"-"}function nae(e,t,n){n.layered||!n.stepSize?function(e,t){t.collider={type:"polygon",vertices:[{x:t.boundingRect.x,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y+t.boundingRect.height},{x:t.boundingRect.x,y:t.boundingRect.y+t.boundingRect.height}]}}(0,t):n.tilted?function(e,t,n){const r=n.angle*(Math.PI/180),i=Math.max(n.stepSize/2,t.boundingRect.height/2),o="start"===t.anchor,a="end"===t.anchor&&r<0,s="start"===t.anchor&&r>=0,l=t.boundingRect.y+(s||a?t.boundingRect.height:0),c=[{x:t.x-i,y:l},{x:t.x+i,y:l}].map((e=>Xre(e,r,{x:t.x,y:t.y}))),u={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y+t.boundingRect.height},d={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y},f=r>=0?[u,d]:[d,u];c.push(...f),t.collider={type:"polygon",vertices:c}}(0,t,n):function(e,t,n){if("bottom"===n.align||"top"===n.align){const r=e.position*n.innerRect.width+(n.innerRect.x-n.outerRect.x-n.stepSize/2);t.collider={type:"rect",x:r,y:0,width:r<0?n.stepSize+r:n.stepSize,height:n.innerRect.height}}else{const r=e.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);t.collider={type:"rect",x:0,y:r,width:n.innerRect.width,height:r<0?n.stepSize+r:n.stepSize}}const r=t.collider;r.x=Math.max(r.x,0),r.y=Math.max(r.y,0);const i=r.x+r.width-(n.outerRect.x+n.outerRect.width);r.width=i>0?r.width-i:r.width;const o=r.y+r.height-(n.outerRect.y+n.outerRect.height);r.height=o>0?r.height-o:r.height}(e,t,n)}function rae(e,t){const n=isNaN(e.style.align)?.5:Math.min(Math.max(e.style.align,0),1);let r=0;if(e.tilted)r=e.stepSize*n;else{const i=t?e.textRect.height:e.textRect.width;r=Math.max(0,e.stepSize-i)*n}return r}function iae(e,t){var n,r;const i={type:"text",text:tae(e.label),x:0,y:0,maxWidth:t.maxWidth,maxHeight:t.maxHeight,tickValue:null!==(n=e.value)&&void 0!==n?n:null===(r=e.data)||void 0===r?void 0:r.value};return"top"===t.align||"bottom"===t.align?(i.x=e.start*t.innerRect.width+(t.innerRect.x-t.outerRect.x)+rae(t,!1),i.y="top"===t.align?t.innerRect.height:0,i.anchor=t.stepSize?"start":"middle",i.x+=isNaN(t.style.offset)?0:+t.style.offset):(i.y=e.start*t.innerRect.height+(t.innerRect.y-t.outerRect.y)+rae(t,!0),i.x="left"===t.align?t.innerRect.width:0,i.anchor="left"===t.align?"end":"start",i.baseline=t.stepSize?"text-before-edge":"central",i.y+=isNaN(t.style.offset)?0:+t.style.offset),function(e,t){["fill","fontSize","fontFamily"].forEach((n=>{e[n]=t.style[n]}))}(i,t),function(e,t){if(!t.tilted&&!t.stepSize)if("top"===t.align||"bottom"===t.align){const n=0,r=t.outerRect.width,i=Math.min(t.maxWidth/2,t.textRect.width/2),o=e.x-i,a=e.x+i;o<n?(e.anchor="start",e.x=t.innerRect.x-t.outerRect.x):a>r&&(e.anchor="end",e.x=t.innerRect.width+t.innerRect.x)}else{const n=0,r=t.outerRect.height,i=t.maxHeight/2,o=e.y-i,a=e.y+i;o<n?(e.y=t.innerRect.y-t.outerRect.y,e.baseline="text-before-edge"):a>r&&(e.y=t.innerRect.height+(t.innerRect.y-t.outerRect.y),e.baseline="text-after-edge")}}(i,t),function(e,t){"top"===t.align?e.y-=t.padding:"bottom"===t.align?e.y+=t.padding+t.maxHeight:"left"===t.align?e.x-=t.padding:"right"===t.align&&(e.x+=t.padding)}(i,t),function(e,t){if(t.tilted){const n=-t.angle,r=n*(Math.PI/180);"bottom"===t.align?(e.x-=t.maxHeight*Math.sin(r)/2,e.y-=t.maxHeight,e.y+=t.maxHeight*Math.cos(r)/2):e.x-=t.maxHeight*Math.sin(r)/3,e.transform="rotate(".concat(n,", ").concat(e.x,", ").concat(e.y,")"),e.anchor="bottom"===t.align==t.angle<0?"start":"end";const i=Math.cos(r)*t.maxWidth;if("bottom"===t.align==t.angle<0){const n=t.outerRect.width-t.paddingEnd;e.x+i>n&&(e.maxWidth=(n-e.x-10)/Math.cos(r))}else{const n=t.paddingEnd;e.x-i<n&&(e.maxWidth=(e.x-n-10)/Math.cos(r))}}}(i,t),function(e,t){e.boundingRect=t.textBounds(e)}(i,t),nae(e,i,t),i}function oae(e,t){const n={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null},tickValue:e.value};return"top"===t.align||"bottom"===t.align?(n.x1=n.x2=e.position*t.innerRect.width+(t.innerRect.x-t.outerRect.x),n.y1="top"===t.align?t.innerRect.height:0,n.y2="top"===t.align?n.y1-t.tickSize:n.y1+t.tickSize):(n.y1=n.y2=e.position*t.innerRect.height+(t.innerRect.y-t.outerRect.y),n.x1="left"===t.align?t.innerRect.width:0,n.x2="left"===t.align?n.x1-t.tickSize:n.x1+t.tickSize),function(e,t){o8(e,t.style)}(n,t),function(e,t){"top"===t.align?(e.y1-=t.padding,e.y2-=t.padding):"bottom"===t.align?(e.y1+=t.padding,e.y2+=t.padding):"left"===t.align?(e.x1-=t.padding,e.x2-=t.padding):"right"===t.align&&(e.x1+=t.padding,e.x2+=t.padding)}(n,t),function(e,t){const n=e.strokeWidth/2;e.x1===t.innerRect.width?(e.x1-=n,e.x2-=n):0===e.x1?(e.x1+=n,e.x2+=n):e.y1===t.innerRect.height?(e.y1-=n,e.y2-=n):0===e.y1&&(e.y1+=n,e.y2+=n)}(n,t),n}function aae(e){return!e.isMinor&&e.position>=0&&e.position<=1}function sae(e){let{rect:t,state:n,majorTicks:r,measure:i,horizontal:o}=e;return o?function(e){let{majorTicks:t,measureText:n,rect:r,state:i}=e;const o="layered"===i.labels.activeMode?2:1,a=r.width,s=t.map((e=>e.label)).map((e=>"".concat(e.slice(0,1)).concat(e.length>1?"…":""))).map(n).map((e=>e.width));for(let e=0;e<t.length;++e){const n=t[e];if(o*a*Math.abs(n.start-n.end)<s[e])return!0}return!1}({majorTicks:r,measureText:i,rect:t,state:n}):function(e){let{majorTicks:t,measureText:n,rect:r}=e;const i=r.height,o=n("M").height;return!(t.length<2)&&i*Math.abs(t[0].position-t[1].position)<o}({majorTicks:r,measureText:i,rect:t})}function lae(e){let{value:t,maxValue:n,minValue:r,range:i,modifier:o}=e;return isNaN(i)||isNaN(o)||(t=i*o),t>n&&(t=n),t<r&&(t=r),t}function cae(e){let{isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:a,state:s}=e,l=0;const c={left:0,top:0,right:0,bottom:0},{maxLengthPx:u,minLengthPx:d}=a.labels;if(a.labels.show){const e=a.align,f="top"===e||"bottom"===e,h=f?n.inner.width:n.inner.height,p=o.ticks({settings:a,distance:h,formatter:r}).filter(aae),m=e=>{const t=i({text:e,fontSize:a.labels.fontSize,fontFamily:a.labels.fontFamily});return t.width=lae({value:t.width,maxValue:u,minValue:d}),t};if(t&&f&&"auto"===a.labels.mode&&(!function(e){let{majorTicks:t,measure:n,rect:r,state:i,settings:o}=e;const a=o.labels.maxGlyphCount,s="layered"===i.labels.activeMode?2:1,l=o.labels.tiltThreshold?o.labels.tiltThreshold:.7,c=n("…").width,u=r.width;let d=0,f=0;if(isNaN(a))for(let e=0;e<t.length;e++){const r=t[e],i=r.label,o=n(i).width*(i.length>1?l:1);if(f=s*u*Math.abs(r.start-r.end),o+c>f)return!0}else{const e=t.reduce(((e,t)=>Math.min(Math.abs(t.start-t.end),e)),1/0);if(f=s*u*e,d=n("M").width*l*a,d+c>f)return!0}return!1}({majorTicks:p,measure:m,rect:n.inner,state:s,settings:a})?s.labels.activeMode="horizontal":s.labels.activeMode="tilted"),!a.labels.filterOverlapping&&"tilted"!==s.labels.activeMode&&sae({rect:n.inner,state:s,majorTicks:p,measure:m,horizontal:f})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}let g,y;if("tilted"===s.labels.activeMode){const e=Math.abs(a.labels.tiltAngle)*(Math.PI/180);g=t=>lae({value:t.width,maxValue:u,minValue:d})*Math.sin(e)+t.height*Math.cos(e)}else g=f?e=>e.height:e=>lae({value:e.width,maxValue:u,minValue:d});if(f&&"tilted"!==s.labels.activeMode)y=["M"];else if(isNaN(a.labels.maxGlyphCount))y=p.map((e=>e.label));else{let e="";for(let t=0;t<a.labels.maxGlyphCount;t++)e+="M";y=[e]}const v=y.map(m),b=v.map(g),x=Math.max(...b,0);if(l+=x,l+=a.labels.margin,"layered"===s.labels.activeMode&&(l*=2),"tilted"===s.labels.activeMode){const e="bottom"===a.align==a.labels.tiltAngle>=0,t=Math.abs(a.labels.tiltAngle)*(Math.PI/180),r=(x-m("M").height*Math.cos(t))/Math.sin(t),i=e=>Math.min(r,e.width)*Math.cos(t)+e.height,o=(t,r)=>{const i=p[r]?p[r].position:0;return e?t-i*n.inner.width:t-(1-i)*n.inner.width},s=Math.min(a.labels.maxEdgeBleed,Math.max(...v.map(i).map(o),0))+a.paddingEnd;if(c[e?"left":"right"]=s,!a.labels.filterOverlapping&&function(e){let{majorTicks:t,measureText:n,rect:r,bleedSize:i,angle:o}=e;if(t.length<2)return!1;if(0===o)return!0;const a=Math.abs(o),s=1/(Math.min(r.outer.width-i,r.inner.width)*Math.abs(t[0].position-t[1].position));return n("M").height>Math.sin(a*(Math.PI/180))/s}({majorTicks:p,measureText:m,rect:n,bleedSize:s,angle:a.labels.tiltAngle})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}}}return{size:l,edgeBleed:c}}const uae=(e,t,n)=>e.width*Math.abs(t.position-n.position);function dae(e){let{layered:t,major:n,innerRect:r,outerRect:i,tick:o,index:a}=e;const s=t?2:1,l=n[a-s],c=n[a+s],u=l?uae(r,o,l)/2-2:1/0,d=c?uae(r,o,c)/2-2:1/0;return n.length<2?r.width:l?c?2*Math.min(u,d):(e=>{let{innerRect:t,outerRect:n,tick:r,prevWidth:i}=e;const o=t.x-n.x,a=n.width-t.width-o,s=t.width-t.width*r.position+a,l=2*Math.min(i,s),c=1===r.position?t.width/2-2:0;return Math.max(i,l,c)})({innerRect:r,outerRect:i,tick:o,prevWidth:u}):(e=>{let{innerRect:t,outerRect:n,tick:r,nextWidth:i}=e;const o=t.x-n.x,a=t.width*r.position+o,s=2*Math.min(i,a),l=0===r.position?t.width/2-2:0;return Math.max(i,s,l)})({innerRect:r,outerRect:i,tick:o,nextWidth:d})}function fae(e){const t=e.innerRect,n={cx:t.width/2,cy:t.height/2},r=Math.min(t.height,t.width)/2*e.radius,i=r+e.style.strokeWidth,o={visible:!0,type:"path",arcDatum:{startAngle:e.startAngle,endAngle:e.endAngle},transform:"translate(0, 0) translate(".concat(n.cx,", ").concat(n.cy,")"),desc:{share:1,slice:{cornerRadius:0,innerRadius:r,outerRadius:i}},ticks:[]};return function(e,t){o8(e,t.style)}(o,e),o}function hae(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function pae(e,t){const n=t.innerRect,r={cx:n.width/2,cy:n.height/2},i=Math.min(n.height,n.width)/2*t.radius+t.padding,o=t.startAngle,a=t.endAngle,s=t.tickSize,l=a-o;let c=a-e.position*l;c-=Math.PI/2;const u=hae(r.cx,r.cy,i+s,c),d=hae(r.cx,r.cy,i,c),f={type:"line",x1:u.x,y1:u.y,x2:d.x,y2:d.y,value:e.value};return function(e,t){const n=c8({},t.style);o8(e,n)}(f,t),f}function mae(e){return"string"==typeof e||"number"==typeof e?e:"-"}function gae(e,t,n){let r;return r="left"===t?n.x:"right"===t?e.outerRect.width-n.x:Math.max(n.x,e.outerRect.width-n.x),r}function yae(e,t){const n=t.innerRect,r={cx:n.width/2,cy:n.height/2},i=Math.min(n.height,n.width)/2*t.radius+t.padding,o=t.startAngle,a=t.endAngle,s=t.tickSize,l=a-o,c=.2;let u,d;u="top"===t.align||"bottom"===t.align?a-e.position*l:o+e.position*l,d=u<-.2&&u>-Math.PI+c?"left":u>.2&&u<Math.PI-c?"right":"center",u-=Math.PI/2;const f=function(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}(r.cx,r.cy,i+s+6,u);let h;h="left"===d?"end":"right"===d?"start":"middle";const p={type:"text",text:mae(e.label),align:d,x:f.x,y:f.y,maxHeight:t.maxHeight,maxWidth:gae(t,d,f),anchor:h,baseline:"middle"};return function(e,t){["fill","fontSize","fontFamily"].forEach((n=>{e[n]=t.style[n]}))}(p,t),function(e,t){e.boundingRect=t.textBounds(e)}(p,t),function(e,t,n){let r,i;const o=parseFloat(n.fontSize)||0;r=t.y-o/2,i=e.innerRect.height-(t.y+o/2),(r<0||i<0)&&(n.text="")}(t,f,p),p}function vae(e){let t=0;return t+=e.paddingStart,t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function bae(e){let t=0;return t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function xae(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=vae(e)+e.labels.margin,t}function wae(e,t){return e.map((e=>oae(e,t)))}function Sae(e,t){return t?Math.abs(t.end-t.start):e.bandwidth()}function Cae(e){let{textMetrics:t,settings:n,innerRect:r,scale:i,tilted:o,layered:a,tick:s}=e;const l=t.height,c=Sae(i,s),u={width:0,height:l};if("left"===n.align||"right"===n.align)u.width=r.width-xae(n)-n.paddingEnd;else if(a)u.width=c*r.width*2;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);u.width=(r.height-xae(n)-n.paddingEnd-l*Math.cos(e))/Math.sin(e)}else u.width=c*r.width;return u.width=lae({value:u.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),u}function kae(e){let{textMetrics:t,settings:n,innerRect:r,outerRect:i,tilted:o,layered:a,tick:s,index:l,major:c}=e;const u=t.height,d={width:0,height:u};if("left"===n.align||"right"===n.align)d.width=r.width-xae(n)-n.paddingEnd;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);d.width=(r.height-xae(n)-n.paddingEnd-u*Math.cos(e))/Math.sin(e)}else d.width=dae({layered:a,major:c,innerRect:r,outerRect:i,tick:s,index:l});return d.width=lae({value:d.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),d}function Eae(e){let t;function n(){return t=kae,n}function r(){return t=Cae,r}function i(e){let{settings:n,scale:r,innerRect:i,outerRect:o,measureText:a,ticks:s,state:l,textBounds:c}=e;const u=[],d=function(e){return e.filter((e=>!e.isMinor))}(s),f=function(e){return e.filter((e=>e.isMinor))}(s),h={innerRect:i,align:n.align,outerRect:o},p="tilted"===l.labels.activeMode,m="layered"===l.labels.activeMode;let g;if(n.arc&&(h.startAngle=n.arc.startAngle,h.endAngle=n.arc.endAngle,h.radius=n.arc.radius),n.line.show&&(h.style=n.line,h.padding=n.paddingStart,n.arc?u.push(fae(h)):u.push(eae(h))),n.ticks.show&&(h.style=n.ticks,h.tickSize=n.ticks.tickSize,h.padding=vae(n),n.arc?(h.padding=bae(n),g=function(e,t){return e.map((e=>pae(e,t)))}(d,h)):g=wae(d,h)),n.labels.show){const e=xae(n);h.style=n.labels,h.padding=e,h.tilted=p,h.layered=m,h.angle=n.labels.tiltAngle,h.paddingEnd=n.paddingEnd,h.textBounds=c;const s=(e,s)=>{h.textRect=function(e){let{style:t,measureText:n,tick:r}=e;return n({text:r.label,fontSize:t.fontSize,fontFamily:t.fontFamily})}({tick:e,measureText:a,style:h.style});const l=t({textMetrics:h.textRect,settings:n,innerRect:i,outerRect:o,scale:r,tilted:p,layered:m,tick:e,major:d,index:s});h.maxWidth=l.width,h.maxHeight=l.height,h.stepSize=function(e){let{innerRect:t,scale:n,settings:r,tick:i}=e;return("top"===r.align||"bottom"===r.align?t.width:t.height)*Sae(n,i)}({innerRect:i,scale:r,settings:n,tick:e})};let l=[];n.arc?(h.padding=function(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=bae(e)+e.labels.margin,t}(n),l=function(e,t,n){return e.map(((e,r)=>{n(e,r);const i=yae(e,t);return i.data=e.data,i}))}(d,h,s)):l=!m||"top"!==n.align&&"bottom"!==n.align?function(e,t,n){return e.map(((e,r)=>{n(e,r);const i=iae(e,t);return i.data=e.data,i}))}(d,h,s):function(e,t,n,r){const i=t.padding,o=xae(n);return e.map(((e,a)=>{r(e,a);const s=o+t.maxHeight+n.labels.margin;t.layer=a%2,t.padding=a%2==0?i:s;const l=iae(e,t);return l.data=e.data,l}))}(d,h,n,s),n.labels.filterOverlapping&&function(e,t,n){let r=(t,n)=>Cie(b8(1,e[t].boundingRect),b8(1,e[n].boundingRect));if(n&&n.tilted){const t=Math.abs(n.angle);r=(n,r)=>{const i=1/Math.abs(e[n].x-e[r].x),o=Math.sin(t*(Math.PI/180))/i;return e[n].boundingRect.height>o}}for(let n=0;n<=e.length-1;n++)for(let i=n+1;i<=Math.min(n+5,n+(e.length-1));i++)e[n]&&e[i]&&r(n,i)&&(i===e.length-1?(e.splice(n,1),t&&t.splice(n,1)):(e.splice(i,1),t&&t.splice(i,1)),i--,n--)}(l,g,h),u.push(...l)}return n.minorTicks&&n.minorTicks.show&&f.length>0&&(h.style=n.minorTicks,h.tickSize=n.minorTicks.tickSize,h.padding=function(e){return e.line.strokeWidth+e.minorTicks.margin}(n),u.push(...wae(f,h))),g&&u.push(...g),u}return n.build=i,r.build=i,e?r():n()}const Mae={labels:{show:!0,tiltAngle:40,tiltThreshold:.7,maxEdgeBleed:1/0,margin:4,maxLengthPx:150,minLengthPx:0,mode:"auto",maxGlyphCount:NaN,align:.5,offset:0,filterOverlapping:!1},ticks:{show:!1,margin:0,tickSize:4},line:{show:!1},paddingStart:0,paddingEnd:10,align:"auto"},_ae={labels:{show:!0,margin:4,maxLengthPx:150,minLengthPx:0,align:.5,offset:0,filterOverlapping:!0},ticks:{show:!0,margin:0,tickSize:8},minorTicks:{show:!1,tickSize:3,margin:0},line:{show:!0},paddingStart:0,paddingEnd:10,align:"auto"};const Rae={require:["chart","renderer","dockConfig"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{},style:{labels:"$label",ticks:"$guide-line",minorTicks:"$guide-line--minor",line:"$guide-line"}},created(){this.state={isDiscrete:!!this.scale.bandwidth,isHorizontal:!1,labels:{activeMode:"horizontal"},ticks:[],innerRect:{width:0,height:0,x:0,y:0},outerRect:{width:0,height:0,x:0,y:0},defaultDock:void 0,concreteNodeBuilder:void 0,settings:void 0},this.state.isDiscrete?this.state.defaultDock="bottom":this.state.defaultDock="left",this.setState(this.settings)},setState(){this.state.isDiscrete=!!this.scale.bandwidth,this.state.settings=function(e){let{state:t,style:n,settings:r}=e;const i=o8(!0,{},t.isDiscrete?Mae:_ae,n),o=o8(!0,{},i,r.settings),a=r.layout.dock||t.defaultDock;o.dock=a,o.align=function(e,t){const n=["top","bottom"],r=["left","right"];return-1!==n.indexOf(e)&&-1===r.indexOf(t)||-1!==r.indexOf(e)&&-1===n.indexOf(t)?e:t}(r.settings.align,a),o.labels.tiltAngle=Math.max(-90,Math.min(o.labels.tiltAngle,90));const{paddingStart:s,paddingEnd:l}=o;return o.paddingStart="function"==typeof s?s.call(null):s,o.paddingEnd="function"==typeof l?l.call(null):l,o}(this),this.state.concreteNodeBuilder=Eae(this.state.isDiscrete),this.dockConfig.dock(this.state.settings.dock),this.state.isHorizontal="top"===this.state.settings.align||"bottom"===this.state.settings.align,this.state.labels.activeMode=function(e,t,n){const r=t.labels.mode;return n&&e.isHorizontal?"auto"===r?e.labels.activeMode:-1!==["layered","tilted"].indexOf(t.labels.mode)&&-1!==["top","bottom"].indexOf(t.dock)?r:"horizontal":"horizontal"}(this.state,this.state.settings,this.state.isDiscrete)},preferredSize(e){const{formatter:t,state:n,scale:r}=this,i=this.state.isHorizontal?e.inner.width:e.inner.height;this.state.pxScale=Ire(r,i);const o=function(e){let{isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:a,state:s}=e,l=0;const{size:c,edgeBleed:u,isToLarge:d}=cae({isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:a,state:s});if(l+=c,d)return{size:l};if(a.ticks.show&&(l+=a.ticks.margin,l+=a.ticks.tickSize),a.minorTicks&&a.minorTicks.show){const e=a.minorTicks.margin+a.minorTicks.tickSize;e>l&&(l=e)}if(a.line.show){const e=a.line.strokeWidth/2;l+=e,u[function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";default:return e}}(a.align)]=Math.ceil(e)}return l+=a.paddingStart,l+=a.paddingEnd,{size:l,edgeBleed:u}}({isDiscrete:this.state.isDiscrete,rect:{inner:e.inner,outer:e.outer},formatter:t,measureText:this.renderer.measureText,scale:this.state.pxScale,settings:this.state.settings,state:n});return o},beforeUpdate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{settings:t}=e;this.setState(t)},resize(e){const{inner:t,outer:n}=e,r=o8({},t,function(e){let{align:t,inner:n}=e;return"left"===t?{x:n.width+n.x}:"right"===t||"bottom"===t?n:{y:n.y+n.height}}({align:this.state.settings.align,inner:t})),i=n||r;return o8(this.state.innerRect,r),o8(this.state.outerRect,i),n},beforeRender(){const{scale:e,formatter:t}=this,n=this.state.isHorizontal?this.state.innerRect.width:this.state.innerRect.height;this.state.pxScale=Ire(e,n),this.state.ticks=this.state.pxScale.ticks({distance:n,formatter:t}).filter((e=>e.position>=0&&e.position<=1))},render(){const{state:e}=this,t=[];return t.push(...this.state.concreteNodeBuilder.build({settings:this.state.settings,scale:this.state.pxScale,innerRect:this.state.innerRect,outerRect:this.state.outerRect,measureText:this.renderer.measureText,textBounds:this.renderer.textBounds,ticks:this.state.ticks,state:e})),joe.multiple(t),t}};const Iae={render:()=>[]};function Dae(e,t,n){let r="";if("function"==typeof e)r=e();else if("string"==typeof e)r=e;else if(n){const e=(n.data().fields||[]).map((e=>e.title()));r=e.join(t)}return r}function Pae(e,t){let n="middle";return"left"===e?"top"===t?n="end":"bottom"===t&&(n="start"):"right"===e?"top"===t?n="start":"bottom"===t&&(n="end"):"left"===t?n="start":"right"===t&&(n="end"),n}const Aae={require:["renderer","chart"],defaultSettings:{layout:{dock:"bottom",displayOrder:0,prioOrder:0},settings:{paddingStart:5,paddingEnd:5,paddingLeft:0,paddingRight:0,anchor:"center",join:", ",maxLengthPx:NaN},style:{text:"$title"}},created(){this.definitionSettings=this.settings.settings;const e=this.settings.text,t=this.definitionSettings.join;this.title=Dae(e,t,this.scale)},preferredSize(){return this.renderer.measureText({text:this.title,fontSize:this.style.text.fontSize,fontFamily:this.style.text.fontFamily}).height+this.definitionSettings.paddingStart+this.definitionSettings.paddingEnd},render(){const{title:e,definitionSettings:t,rect:n}=this,r=[];return r.push(function(e){let{title:t,definitionSettings:n,dock:r,rect:i,measureText:o,style:a}=e;const s={type:"text",text:t,x:0,y:0,dx:0,dy:0,anchor:Pae(r,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};o8(s,a.text);const l=o(s);if("top"===r||"bottom"===r){let e=i.width/2;"left"===n.anchor?e=n.paddingLeft||0:"right"===n.anchor&&(e=i.width-(n.paddingRight||0)),s.x=e,s.y="top"===r?i.height-n.paddingStart:n.paddingStart+l.height,s.dy="top"===r?-l.height/6:-l.height/3,s.maxWidth=.8*i.width}else{let e=i.height/2;"top"===n.anchor?e=n.paddingStart:"bottom"===n.anchor&&(e=i.height-n.paddingStart),s.y=e,s.x="left"===r?i.width-n.paddingStart:n.paddingStart,s.dx="left"===r?-l.height/3:l.height/3;const t="left"===r?270:90;s.transform="rotate(".concat(t,", ").concat(s.x+s.dx,", ").concat(s.y+s.dy,")"),s.maxWidth=.8*i.height}return isNaN(n.maxLengthPx)||(s.maxWidth=Math.min(s.maxWidth,n.maxLengthPx)),s}({title:e,dock:this.settings.layout.dock,definitionSettings:t,rect:n,measureText:this.renderer.measureText,style:this.style})),r},beforeUpdate(e){e.settings&&(o8(this.settings,e.settings),this.definitionSettings=e.settings.settings);const t=this.settings.text,n=this.definitionSettings.join;this.title=Dae(t,n,this.scale)}};function Oae(e,t){const n=e.settings.layout.dock,r=e.settings.settings.invert,i="top"===n||"bottom"===n,o=i?"width":"height",a=e.rect[o],s=e.chart.scroll(e.settings.scroll);let l;{let e=t[i?"x":"y"];r&&(e=a-e);const n=s.getState();l={startOffset:e,startScroll:n.start,swipe:!1};const o=e/a*(n.max-n.min)+n.min;o<n.start?l.startScroll=o:o>n.start+n.viewSize&&(l.startScroll=o-n.viewSize)}return{update:e=>{let t=e[i?"x":"y"];if(r&&(t=a-t),!l.swipe){if(Math.abs(l.startOffset-t)<=1)return;l.swipe=!0}const n=s.getState(),o=(t-l.startOffset)/a*(n.max-n.min),c=l.startScroll+o;s.moveTo(c)},end:e=>{let t=e[i?"x":"y"];r&&(t=a-t);const n=s.getState();if(l.swipe){const e=(t-l.startOffset)/a*(n.max-n.min),r=l.startScroll+e;s.moveTo(r)}else{const e=t/a*(n.max-n.min)+n.min-n.viewSize/2;s.moveTo(e)}}}}function Lae(e,t){const n=t.element().getBoundingClientRect();return{x:e.center.x-n.left,y:e.center.y-n.top}}const Tae={require:["chart","renderer"],on:{panStart(e){const t=Lae(e,this.renderer),n={x:t.x-e.deltaX,y:t.y-e.deltaY};this.currentMove=Oae(this,n),this.currentMove.update(t)},panMove(e){if(!this.currentMove)return;const t=Lae(e,this.renderer);this.currentMove.update(t)},panEnd(e){if(!this.currentMove)return;const t=Lae(e,this.renderer);this.currentMove.end(t),this.currentMove=null},panCancel(){this.currentMove=null},tap(e){const t=Lae(e,this.renderer);Oae(this,t).end(t)}},defaultSettings:{settings:{backgroundColor:"#eee",thumbColor:"#ccc",width:16}},preferredSize:function(e){const t=this.chart.scroll(this.settings.scroll).getState();if(t.viewSize>=t.max-t.min){return Math.max(e.width,e.height)}return this.settings.settings.width},render:function(e){const t=this.settings.layout.dock,n=this.settings.settings.invert,r="top"===t||"bottom"===t,i=r?"width":"height",o=this.rect[i],a=this.chart.scroll(this.settings.scroll).getState();let s=o*(a.start-a.min)/(a.max-a.min);const l=o*a.viewSize/(a.max-a.min);return n&&(s=o-s-l),e("div",{style:{position:"relative",width:"100%",height:"100%",background:this.settings.settings.backgroundColor,pointerEvents:"auto"}},[].concat(e("div",{class:"scroller",style:{position:"absolute",[r?"left":"top"]:"".concat(s,"px"),[r?"top":"left"]:"25%",[r?"height":"width"]:"50%",[i]:"".concat(Math.max(1,l),"px"),background:this.settings.settings.thumbColor}})))},renderer:"dom"};function qae(e){let{h:t,isVertical:n,value:r,pos:i,align:o,borderHit:a,state:s,idx:l}=e;const c="end"!==o,u=c?{left:"0",top:"0"}:{right:"0",bottom:"0"};let d=0,f="100%",h="100%";return s.targetRect&&"start"===s.settings.bubbles.align?(f="".concat(s.targetRect.x+s.targetRect.width,"px"),h="".concat(s.targetRect.y+s.targetRect.height,"px")):s.targetRect&&"end"===s.settings.bubbles.align&&(d=n?s.targetRect.x:s.targetRect.y,f="".concat(s.rect.width-d,"px"),h="".concat(s.rect.height-d,"px")),c||(i-=a),t("div",{onmouseover(e){e.srcElement.children[0].style.backgroundColor="#000",e.srcElement.children[0].style[n?"height":"width"]="2px"},onmouseout(e){e.srcElement.children[0].style.backgroundColor=s.style.line.stroke,e.srcElement.children[0].style[n?"height":"width"]="1px"},"data-value":r,"data-key":[s.key,"edge",l].join("-"),style:{cursor:n?"ns-resize":"ew-resize",position:"absolute",left:"".concat(n?d:i,"px"),top:"".concat(n?i:d,"px"),height:n?"".concat(a,"px"):h,width:n?f:"".concat(a,"px"),pointerEvents:"auto"}},[t("div",{style:o8({backgroundColor:s.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},u)})])}function Nae(e){let{h:t,isVertical:n,label:r,otherValue:i,rangeIdx:o,idx:a,pos:s,align:l,state:c,value:u}=e;const d="end"!==l,f="outside"===c.settings.bubbles.placement;let h,p="none";n?(h=d?"left":"right",f&&(p=d?"translate(-100%, 0px)":"translate(100%, 0px)")):(h=d?"top":"bottom",f&&(p=d?"translate(0px, -100%)":"translate(0px, 100%)"));let m=c.edit&&c.edit.rangeIdx===o&&c.edit.bubbleIdx===a;const g={position:"relative",borderRadius:"".concat(c.style.bubble.borderRadius,"px"),border:"".concat(c.style.bubble.strokeWidth,"px solid ").concat(c.style.bubble.stroke),backgroundColor:c.style.bubble.fill,color:c.style.bubble.color,fontFamily:c.style.bubble.fontFamily,fontSize:c.style.bubble.fontSize,padding:"4px 8px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"150px",minWidth:"50px",minHeight:"1em",pointerEvents:"auto",transform:n?"translate(0,-50%)":"translate(-50%,0)",cursor:n?"ns-resize":"ew-resize"};let y=c.style.bubble.stroke;const v=m?t("input",{type:"text",value:u,style:c8(c8({},g),{},{textAlign:"start",textOverflow:"",fontSize:"13px"}),onkeyup(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();const t=parseFloat(e.target.value);isNaN(t)?(y="rgba(230, 78, 78, 0.6)",e.target.style.border="".concat(c.style.bubble.strokeWidth,"px solid ").concat(y)):c.onEditConfirmed(o,t,i)}else"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),c.onEditCanceled())}}):t("div",{"data-key":[c.key,"bubble",o,a].join("-"),"data-other-value":i,"data-idx":o,"data-bidx":a,style:g},[r]);return t("div",{style:{position:"absolute",[h]:"0",[n?"top":"left"]:"".concat(s,"px"),transform:p}},[v])}function jae(e){let{h:t,isVertical:n,top:r,height:i,color:o,on:a,opacity:s}=e;return t("div",o8({style:{backgroundColor:o,opacity:s,position:"absolute",left:n?0:"".concat(r,"px"),top:n?"".concat(r,"px"):0,height:n?"".concat(i,"px"):"100%",width:n?"100%":"".concat(i,"px"),pointerEvents:"auto"}},a),[])}function zae(e){let{borderHit:t,els:n,isVertical:r,state:i,vStart:o,vEnd:a,idx:s}=e,l=0;i.targetRect&&(l=r?i.targetRect.y:i.targetRect.x);const c=!!i.scale,u=c?i.scale.norm(o)*i.size:o,d=c?i.scale.norm(a)*i.size:a,f=Math.abs(u-d),h=Math.min(u,d)+l,p=h+f;if(i.targetRect){const e=i.targetFillRect||i.targetRect,t=r?e.height:e.width,s=c?i.scale.norm(o)*t:o,l=c?i.scale.norm(a)*t:a,u=Math.abs(s-l),d=Math.min(s,l),f={h:i.h,isVertical:r,top:d,height:u,color:i.style.target.fill,opacity:i.style.target.opacity};i.style.target.opacity<.8&&(f.on={onmouseover(e){e.srcElement.style.opacity=i.style.target.opacity+.1},onmouseout(e){e.srcElement.style.opacity=i.style.target.opacity}}),n.push(i.h("div",{style:{position:"absolute",left:"".concat(e.x,"px"),top:"".concat(e.y,"px"),height:"".concat(e.height,"px"),width:"".concat(e.width,"px")}},[jae(f)]))}const m=u<d?o:a,g=u<d?a:o,[y,v]=c?i.scale.domain():[Math.min(o,a),Math.max(o,a)],b=m+1e-5>=y&&m-1e-5<=v,x=g-1e-5<=v&&g+1e-5>=y;b&&n.push(qae({h:i.h,isVertical:r,borderHit:t,value:m,pos:h,align:"start",state:i,idx:s})),x&&n.push(qae({h:i.h,isVertical:r,borderHit:t,value:g,pos:p,align:"end",state:i,idx:s}));const w=i.settings.bubbles;if(w&&w.show){w.fontSize,w.fontFamily,w.fill;const e=[o,a];b&&n.push(Nae({h:i.h,isVertical:r,align:w.align,rangeIdx:s,idx:0,otherValue:g,value:m,label:"".concat(i.format(m,e)),pos:h,state:i})),x&&n.push(Nae({h:i.h,isVertical:r,align:w.align,rangeIdx:s,idx:1,otherValue:m,value:g,label:"".concat(i.format(g,e)),pos:p,state:i}))}}function Fae(e){const t=e.active.limitHigh-e.active.end,n=e.active.limitLow-e.active.start;let r=e.current-e.start;return r=r<0?Math.max(r,n):Math.min(r,t),r}function Wae(e){let t=[];const n=0===e.direction;if(Array.isArray(e.ranges)&&e.ranges.forEach(((r,i)=>{e.active&&i===e.active.idx||zae({borderHit:5,els:t,isVertical:n,state:e,vStart:Math.min(r.min,r.max),vEnd:Math.max(r.min,r.max),idx:i})})),e.active){let r=e.start,i=e.current;if(-1!==e.active.idx)if("foo"===e.active.mode)r=Math.min(e.active.start,e.active.end),i=Math.max(e.active.start,e.active.end);else if("modify"===e.active.mode)r=Math.min(e.start,e.current),i=Math.max(e.start,e.current);else{const t=Fae(e);r=e.active.start+t,i=e.active.end+t}zae({borderHit:5,els:t,isVertical:n,state:e,vStart:r,vEnd:i,idx:e.active.idx})}return t}function $ae(e){return{min:e.scale.min(),max:e.scale.max()}}function Bae(e){return{min:0,max:e.direction?e.rect.width:e.rect.height}}function Vae(e,t,n){let r,i,o=e.ranges,a=-1;for(r=0;r<o.length;r++){if(o[r].min<=t&&t<=o[r].max){a=r,n.min=r?o[r-1].max:n.min,n.max=r+1<o.length?o[r+1].min:n.max;break}if(t<o[r].min){n.max=o[r].min,n.min=r?o[r-1].max:n.min;break}}-1===a&&o.length&&r>=o.length&&(n.min=o[o.length-1].max),-1!==a&&(i={idx:a,start:o[a].min,end:o[a].max,limitLow:n.min,limitHigh:n.max,mode:"foo"}),e.active=i}function Hae(e){e.renderer.render(Wae(e))}function Uae(e,t){if(!t||!t.isActive())return[];const n=e.scale.data(),r=(n&&n.fields||[]).map((e=>e.id())),i=t.brushes().filter((e=>"range"===e.type&&-1!==r.indexOf(e.id)))[0];return i?i.brush.ranges():[]}function Gae(e,t){let n,r=1/0;const i=t.domain(),o=t.bandwidth()/2;for(let a=0;a<i.length;++a){const s=Math.abs(e-o-t(i[a]));s<r&&(r=s,n=i[a])}return n}function Yae(e,t){return Math.min(...e)<=Math.max(...t)&&Math.max(...e)>=Math.min(...t)}function Kae(e){const t=e.reduce(((e,t)=>(e.push(...m8(t.bounds)),e)),[]);return g8(t)}const Xae={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{rangeStart(e){this.start(e)},rangeMove(e){this.move(e)},rangeEnd(e){this.end(e)},rangeClear(e){this.clear(e)},bubbleStart(e){this.bubbleStart(e)}},created(){this.state={key:this.settings.key||"brush-range"}},beforeRender(e){this.state.rect=e.size.computedInner},renderRanges(){this.state.started||(this.state.ranges=Uae(this.state,this.state.brushInstance),this.state.active=null,Hae(this.state))},render(e){const t=this.settings.settings;this.state.direction="vertical"===t.direction?0:1;const n=this.renderer.element().getBoundingClientRect(),r=this.state.rect[0===this.state.direction?"height":"width"];let i=Ire(this.chart.scale(t.scale),r);const o=function(e){const t={targetRect:null,targetFillRect:null,scale:null,size:null},n=e.settings.settings,r=n.target&&(n.target.components||(n.target.component?[n.target.component]:[])).map((t=>e.chart.component(t))).filter((e=>!!e&&!!e.rect)),i=n.target&&n.target.selector?e.chart.findShapes(n.target.selector):[],o=n.target&&n.target.fillSelector?e.chart.findShapes(n.target.fillSelector):[];if(i.length>0){const r=Kae(i);if(t.size=r[0===e.state.direction?"height":"width"],t.scale=Ire(e.chart.scale(n.scale),t.size),t.targetRect=r,o.length>0){const e=Kae(o);t.targetFillRect=e}}else if(r&&r.length>0){const n=r.slice(1).reduce(((e,t)=>({x0:Math.min(e.x0,t.rect.computedInner.x),y0:Math.min(e.y0,t.rect.computedInner.y),x1:Math.max(e.x1,t.rect.computedInner.x+t.rect.computedInner.width),y1:Math.max(e.y1,t.rect.computedInner.y+t.rect.computedInner.height)})),{x0:r[0].rect.computedInner.x,y0:r[0].rect.computedInner.y,x1:r[0].rect.computedInner.x+r[0].rect.computedInner.width,y1:r[0].rect.computedInner.y+r[0].rect.computedInner.height});t.targetRect={x:n.x0-e.state.rect.x,y:n.y0-e.state.rect.y,width:n.x1-n.x0,height:n.y1-n.y0}}return t}(this);if(i=o.scale?o.scale:i,this.state.targetRect=o.targetRect,this.state.targetFillRect=o.targetFillRect,this.state.size=null===o.size?r:o.size,this.state.settings=t,this.state.style=this.style,this.state.offset=n,this.state.brush="object"==typeof t.brush?t.brush.context:t.brush,this.state.brushInstance=this.chart.brush(this.state.brush),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.onEditConfirmed=(e,t,n)=>{this.state.edit=null,function(e,t,n,r){let i=e.ranges.map((e=>({min:e.min,max:e.max})));const o=e.scale.min(),a=e.scale.max();i[t]={min:Math.max(o,Math.min(n,r)),max:Math.min(a,Math.max(n,r))},e.ranges[t]=c8({},i[t]);const s=e.scale.data();s&&s.fields&&s.fields.forEach((t=>{e.fauxBrushInstance||e.brushInstance.setRange(t.id(),i)}))}(this.state,e,t,n),this.emit("bubbleEnd"),Hae(this.state)},this.state.onEditCanceled=()=>{this.state.edit=null,Hae(this.state)},this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX"},this.state.format="function"==typeof t.bubbles.label&&((e,n)=>t.bubbles.label.call(void 0,{datum:e,data:n,scale:i,resources:{scale:this.chart.scale,formatter:this.chart.formatter}})),{}.hasOwnProperty.call(i,"norm")){this.state.editable=!0,this.state.observeBrush="object"==typeof t.brush&&t.brush.observe,this.state.fauxBrushInstance=null,this.state.findValues=null,this.state.scale=i;const e=this.state.scale.data();!this.state.format&&e&&e.fields&&e.fields[0]&&(this.state.format=e.fields[0].formatter())}else this.state.editable=!1,this.state.scale=Ane(),this.state.scale.data=i.data,this.state.format||(this.state.format=(e,t)=>Yae(i.range(),t)?function(e,t){const n=t.ticks(),r=t.domain().indexOf(Gae(e,t));return-1!==r?n[r].label:"-"}(e,i):"-"),this.state.fauxBrushInstance=gre(),this.state.findValues=e=>function(e,t){const n=t.domain(),r=t.range(),i=[];return e.forEach((e=>{if(!Yae(r,[e.min,e.max]))return;const o=n.indexOf(Gae(e.min,t)),a=n.indexOf(Gae(e.max,t));i.push.apply(i,n.slice(Math.min(o,a),Math.max(o,a)+1))})),i}(e,i);return this.state.ranges=Uae(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[Wae(this.state)]:[]},mounted(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.on("update",this.renderRanges)},beforeDestroy(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.removeListener("update",this.renderRanges)},start(e){!function(e){let{state:t,e:n,renderer:r,ranges:i,targetSize:o}=e;if(t.started)return;t.edit=null;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);r.element().contains(l)||(l=null);const c={started:!0};t.offset=o8({},r.element().getBoundingClientRect());const u=a-t.offset.left,d=s-t.offset.top;t.offset.left+=t.targetRect?t.targetRect.x:0,t.offset.top+=t.targetRect?t.targetRect.y:0,t.ranges=i(t,t.fauxBrushInstance||t.brushInstance);const f=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],h=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];c.current=t.scale.normInvert(h/t.size),c.start=t.scale.normInvert(f/t.size);let p=t.ranges;const m=$ae(t);let g,y,v=-1;if(l&&l.hasAttribute("data-idx"))v=parseInt(l.getAttribute("data-idx"),10),m.min=v>0?p[v-1].max:m.min,m.max=v+1<p.length?p[v+1].min:m.max;else{for(g=0;g<p.length;g++){if(p[g].min<=c.start&&c.start<=p[g].max){v=g,m.min=g?p[g-1].max:m.min,m.max=g+1<p.length?p[g+1].min:m.max;break}if(c.start<p[g].min){m.max=p[g].min,m.min=g?p[g-1].max:m.min;break}}-1===v&&p.length&&g>=p.length&&(m.min=p[p.length-1].max)}if(-1!==v||t.multi||(c.ranges=[],m.min=t.scale.min(),m.max=t.scale.max()),-1!==v)if(y={idx:v,start:p[v].min,end:p[v].max,limitLow:m.min,limitHigh:m.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),y.mode="modify";else{let e=t.scale.norm(y.start)*t.size,n=t.scale.norm(y.end)*t.size;Math.abs(f-e)<=o?(c.start=y.end,y.mode="modify"):Math.abs(f-n)<=o&&(c.start=y.start,y.mode="modify")}else y={idx:-1,start:c.start,end:c.current,limitLow:m.min,limitHigh:m.max,mode:"current"};c.active=y,"modify"!==y.mode&&t.targetRect&&!Eie(t.targetRect,{x:u,y:d})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:Uae,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e,e.fauxBrushInstance||e.brushInstance);const n=$ae(e);Vae(e,e.current,n)}(this.state,Uae),Hae(this.state),this.state.sourcedFromThisComponent=!0,this.state.active=null)},move(e){this.state.started&&(!function(e,t){const n=(t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset])/e.size,r=e.scale.normInvert(n);e.current=Math.max(Math.min(r,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){let t=e.ranges.map((e=>({min:e.min,max:e.max})));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=Fae(e);t[e.active.idx].min+=n,t[e.active.idx].max+=n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});const n=e.scale.data();n&&n.fields&&n.fields.forEach((n=>{if(e.fauxBrushInstance){let r=Uae(e,e.fauxBrushInstance),i=e.findValues(r),o=e.findValues(t),a=o.filter((e=>-1===i.indexOf(e))),s=i.filter((e=>-1===o.indexOf(e))),l=a.map((e=>({key:n.id(),value:e}))),c=s.map((e=>({key:n.id(),value:e})));e.brushInstance.addAndRemoveValues(l,c),e.fauxBrushInstance.setRange(n.id(),t)}else e.brushInstance.setRange(n.id(),t)}))}(this.state),Hae(this.state))},clear(){this.state.fauxBrushInstance&&this.state.fauxBrushInstance.clear(),this.state.renderer.render([]),this.state.started=!1,this.state.active=null,this.state.sourcedFromThisComponent=!1},bubbleStart(e){if(!this.state.editable)return;const t=e.srcEvent||e,n=t.target,r={rangeIdx:parseInt(n.getAttribute("data-idx"),10),bubbleIdx:parseInt(n.getAttribute("data-bidx"),10)};if(isNaN(r.rangeIdx)||JSON.stringify(r)===JSON.stringify(this.state.edit))return;this.state.edit=r,t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault();const i=n.parentNode;Hae(this.state);const o=i.querySelector("input");o.focus(),o.select()}};function Jae(e){e.renderer.render(Wae(e))}function Qae(e){return e.rc.ranges()}function Zae(e,t){const n={x:e.direction?t.min+e.rect.x:e.rect.x,y:e.direction?e.rect.y:t.min+e.rect.y,width:e.direction?t.max-t.min:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:t.max-t.min};return e.chart.shapesAt(n,e.settings.brush)}const ese={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaClear(e){this.clear(e)}},created(){this.state={key:this.settings.key||"brush-area-dir"}},render(e){this.state.rect=this.rect;const t=this.settings.settings,n="vertical"===t.direction?0:1,r=this.state.rect[0===n?"height":"width"],i=this.renderer.element().getBoundingClientRect(),o=(t.target?t.target.components||[t.target.component]:[]).map((e=>this.chart.component(e))).filter((e=>!!e&&!!e.rect)),a=o[0]?o.slice(1).reduce(((e,t)=>({x0:Math.min(e.x0,t.rect.x),y0:Math.min(e.y0,t.rect.y),x1:Math.max(e.x1,t.rect.x+t.rect.width),y1:Math.max(e.y1,t.rect.y+t.rect.height)})),{x0:o[0].rect.x,y0:o[0].rect.y,x1:o[0].rect.x+o[0].rect.width,y1:o[0].rect.y+o[0].rect.height}):null;return this.state.targetRect=a?{x:a.x0-this.rect.x,y:a.y0-this.rect.y,width:a.x1-a.x0,height:a.y1-a.y0}:null,this.state.style=this.style,this.state.chart=this.chart,this.state.direction=n,this.state.settings=t,this.state.offset=i,this.state.rc=ire(),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.size=r,this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX",area:0===this.state.direction?"height":"width"},this.state.format=function(e,t){return function(e,t,n){const r=Math.min(...n),i=Math.max(...n),o={x:e.direction?r+e.rect.x:e.rect.x,y:e.direction?e.rect.y:r+e.rect.y,width:e.direction?i-r:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:i-r},a=e.chart.shapesAt(o,e.settings.brush);if(0===a.length)return"-";const s=a.reduce(((n,i)=>{const o=n.bounds,a=i.bounds;return t===r?o[e.cssCoord.coord]<=a[e.cssCoord.coord]?n:i:o[e.cssCoord.coord]+o[e.cssCoord.area]>=a[e.cssCoord.coord]+a[e.cssCoord.area]?n:i})),l=e.settings.brush.components.reduce(((e,t)=>e.key===s.key?e:t));return"function"==typeof e.settings.bubbles.label?e.settings.bubbles.label(s.data):Array.isArray(l.data)&&l.data.length?s.data[l.data[0]].label:s.data&&s.data.label?s.data.label:"-"}(this,e,t)},[]},start(e){!function(e){let{state:t,e:n,renderer:r,ranges:i,targetSize:o}=e;if(t.started)return;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);r.element().contains(l)||(l=null);const c={started:!0};t.offset=r.element().getBoundingClientRect(),t.ranges=i(t);const u=a-t.offset.left,d=s-t.offset.top,f=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],h=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];let p=h,m=f;c.start=f,c.current=h;let g=t.ranges;const y=Bae(t);let v,b,x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),y.min=x>0?g[x-1].max:y.min,y.max=x+1<g.length?g[x+1].min:y.max;else{for(v=0;v<g.length;v++){if(g[v].min<=m&&m<=g[v].max){x=v,y.min=v?g[v-1].max:y.min,y.max=v+1<g.length?g[v+1].min:y.max;break}if(m<g[v].min){y.max=g[v].min,y.min=v?g[v-1].max:y.min;break}}-1===x&&g.length&&v>=g.length&&(y.min=g[g.length-1].max)}if(-1!==x||t.multi||(c.ranges=[],y.min=0,y.max=t.direction?t.rect.width:t.rect.height),-1!==x)if(b={idx:x,start:g[x].min,end:g[x].max,limitLow:y.min,limitHigh:y.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),b.mode="modify";else{let e=b.start,t=b.end;Math.abs(f-e)<=o?(c.start=b.end,b.mode="modify"):Math.abs(f-t)<=o&&(c.start=b.start,b.mode="modify")}else b={idx:-1,start:m,end:p,limitLow:y.min,limitHigh:y.max,mode:"current"};c.active=b,"modify"!==b.mode&&t.targetRect&&!Eie(t.targetRect,{x:u,y:d})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:Qae,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e);const n=Bae(e);Vae(e,e.current,n)}(this.state,Qae),Jae(this.state))},move(e){this.state.started&&(!function(e,t){const n=t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset];e.current=Math.max(Math.min(n,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){const t=e.ranges.map((e=>({min:e.min,max:e.max})));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=Fae(e);t[e.active.idx].min=e.active.start+n,t[e.active.idx].max=e.active.end+n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});e.rc.set(t);let n=[];t.forEach((t=>{n=[...n,...Zae(e,t)]})),function(e,t){e.chart.brushFromShapes(t,e.settings.brush)}(e,n)}(this.state),Jae(this.state))},clear(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function tse(e){const t="vertical"===e.direction,n=e.rect[t?"height":"width"],r=e.rect[t?"width":"height"];return function(e){const t=e.brush;if(!t||!t.isActive())return[];const n=e.scale.data(),r=(n&&n.fields||[]).map((e=>e.id())),i=t.brushes().filter((e=>"range"===e.type&&-1!==r.indexOf(e.id)))[0];return i?i.brush.ranges():[]}(e).map((i=>{const o=e.scale(i.min)*n,a=e.scale(i.max)*n,s=Math.min(o,a),l=Math.abs(o-a);return{type:"rect",fill:e.fill,opacity:e.opacity,x:t?0:s,width:t?r:l,y:t?s:0,height:t?l:r}}))}function nse(e,t,n,r){function i(){!function(e){e.renderer.render(tse(e))}(e)}function o(){!function(e){e.renderer.render(tse(e))}(e)}function a(){!function(e){e.renderer.render(tse(e))}(e)}e.brush=t,t&&(t.on("start",i),t.on("update",o),t.on("end",a),e.start=i,e.update=o,e.end=a,e.brush=t,e.scale=n,e.renderer=r)}function rse(e){e.brush&&(e.brush.removeListener("start",e.start),e.brush.removeListener("update",e.update),e.brush.removeListener("end",e.end)),e.start=void 0,e.update=void 0,e.end=void 0,e.brush=void 0,e.scale=void 0,e.renderer=void 0}const ise={require:["chart","settings","renderer"],defaultSettings:{settings:{}},preferredSize:()=>50,created(){this.state={}},render(){const e=this.settings.settings,t=this.chart.brush(e.brush),n=e.direction||"horizontal",r="horizontal"===n?this.rect.width:this.rect.height,i=Ire(this.chart.scale(e.scale),r);return rse(this.state),nse(this.state,t,i,this.renderer),this.state.rect=this.rect,this.state.fill=e.fill||"#ccc",this.state.opacity=void 0!==e.opacity?e.opacity:1,this.state.direction=n,tse(this.state)},beforeDestroy(){rse(this.state)}};function ose(e,t){const n=t.center.x,r=t.center.y;return{x:n-e.left,y:r-e.top}}function ase(e,t,n){return Gre(e,t.points[0])<n.settings.snapIndicator.threshold**2}function sse(e,t){null==e.path.d?e.path.d="M".concat(t.x," ").concat(t.y," "):e.path.d+="L".concat(t.x," ").concat(t.y," "),e.points.push(t)}function lse(e){let{state:t,start:n=null,end:r=null}=e;null!==n&&(t.snapIndicator.x1=n.x,t.snapIndicator.y1=n.y),null!==r&&(t.snapIndicator.x2=r.x,t.snapIndicator.y2=r.y)}function cse(e,t){e.snapIndicator.visible=t}const use={require:["chart","renderer","settings"],defaultSettings:{layout:{displayOrder:0},settings:{brush:{components:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.5},lasso:{fill:"transparent",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:"20, 10"},startPoint:{r:10,fill:"green",stroke:"black",strokeWidth:1,opacity:1}}},on:{lassoStart(e){this.start(e)},lassoEnd(e){this.end(e)},lassoMove(e){this.move(e)},lassoCancel(){this.cancel()}},created(){this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}}},start(e){var t;this.state.active=!0,this.state.path={visible:!0,type:"path",d:null,fill:(t=this.settings.settings.lasso).fill,stroke:t.stroke,strokeWidth:t.strokeWidth,opacity:t.opacity,strokeDasharray:t.strokeDasharray,collider:{type:null}},this.state.snapIndicator=function(e){return{visible:!1,type:"line",x1:0,y1:0,x2:0,y2:0,strokeDasharray:e.strokeDasharray,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,collider:{type:null}}}(this.settings.settings.snapIndicator),this.state.startPoint=function(e){return{visible:!0,type:"circle",cx:0,cy:0,r:e.r,fill:e.fill,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,collider:{type:null}}}(this.settings.settings.startPoint),this.state.rendererBounds=this.renderer.element().getBoundingClientRect(),this.state.componentDelta=function(e,t){const n=e.element.getBoundingClientRect();return{x:t.left-n.left,y:t.top-n.top}}(this.chart,this.state.rendererBounds),this.state.brushConfig=function(e){return e.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts||["lassoBrush"],data:e.data||[""],action:e.action||"add"})))}(this.settings);const n=ose(this.state.rendererBounds,e);sse(this.state,n),lse({state:this.state,start:n}),function(e,t){e.startPoint.cx=t.x,e.startPoint.cy=t.y}(this.state,n)},move(e){if(!this.state.active)return;const t=ose(this.state.rendererBounds,e);ase(t,this.state,this.settings)?cse(this.state,!0):cse(this.state,!1),sse(this.state,t),lse({state:this.state,end:t}),function(e,t){const n=[e.startPoint,e.path,e.snapIndicator].filter((e=>e.visible));t.render(n)}(this.state,this.renderer),function(e,t){if(e.active){const n=e.points[e.points.length-2],r=e.points[e.points.length-1];e.lineBrushShape.x1=n.x+e.componentDelta.x,e.lineBrushShape.y1=n.y+e.componentDelta.y,e.lineBrushShape.x2=r.x+e.componentDelta.x,e.lineBrushShape.y2=r.y+e.componentDelta.y;const i=t.shapesAt(e.lineBrushShape,{components:e.brushConfig});t.brushFromShapes(i,{components:e.brushConfig})}}(this.state,this.chart)},end(e){if(!this.state.active)return;cse(this.state,!1);ase(ose(this.state.rendererBounds,e),this.state,this.settings)&&function(e,t){if(e.active){const n=e.componentDelta.x,r=e.componentDelta.y,i=e.points.map((e=>({x:e.x+n,y:e.y+r}))),o=t.shapesAt({vertices:i},{components:e.brushConfig});t.brushFromShapes(o,{components:e.brushConfig})}}(this.state,this.chart),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([])},cancel(){var e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach((e=>{e.contexts.forEach((e=>{t.brush(e).end()}))})),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([]))},render(){}};function dse(e,t,n,r,i){let o,a=0,s=t.length-1;for(;a<s;){let l=Math.floor((a+s)/2);o=i(t[l]),o[n]+o[r]<e[n]?a=l+1:s=l}return a}function fse(e){let{orientation:t,targetNodes:n,labels:r,container:i}=e,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dse;const a=[],s="v"===t?"x":"y",l="v"===t?"width":"height",c=e=>e.textBounds,u=e=>e.node.localBounds;return(e,t)=>{const{textBounds:d,node:f}=r[t];if(d[s]<i[s]||d[s]+d[l]>i[s]+i[l])return!1;for(let e=o(d,a,s,l,c);e<a.length;e++)if(Cie(d,a[e].textBounds))return!1;const h=o(d,n,s,l,u),p=d[s]+d[l];for(let e=h;e<n.length;e++){const t=n[e].node;if(p<t.localBounds[s])break;if(Cie(d,t.localBounds)&&f!==t)return!1}return a.push(r[t]),!0}}const hse=4;function pse(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function mse(e){const t=typeof e;return("string"===t||"number"===t)&&""!==e}function gse(e){return c8(c8({type:"rect",rx:2,ry:2,fill:e.backgroundColor},e.backgroundBounds),{},{data:"".concat(e.data," ").concat(e.text),rotation:e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal"})}function yse(e,t,n){return n?e.width>=t.height:e.width>=t.width}function vse(e,t,n){return n?e.height>=t.width:e.height>=t.height}function bse(e,t,n,r,i){let o,a;return"v"===e?(o=r||i||yse(t,n,!0),a=vse(t,n,!r)):(o=yse(t,n),a=i||vse(t,n,!1)),o&&a}function xse(e,t,n,r){return e+.5*t+(r-.5)*(t-n)-.5*n}function wse(e,t,n){const r={type:"text",text:t,maxWidth:n.rotate?e.height:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:n.rotate?"end":"start",baseline:"central",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},i=n.textMetrics;if(!n.overflow&&!function(e,t,n){return yse(e,t,n.rotate)&&vse(e,t,n.rotate)}(e,i,n))return!1;const o=.5*i.height;return n.rotate?(r.x=xse(e.x,e.width,i.height,n.align)+o,r.y=xse(e.y,e.height,i.width,n.justify),"right"===n.dock?r.transform="rotate(90, ".concat(r.x+r.dx,", ").concat(r.y+r.dy,") translate(").concat(i.width,", 0)"):r.transform="rotate(-90, ".concat(r.x+r.dx,", ").concat(r.y+r.dy,")")):(r.x=xse(e.x,e.width,i.width,n.align),r.y=xse(e.y,e.height,i.height,n.justify)+o),r}function Sse(e){let{bar:t,view:n,direction:r,position:i,padding:o=hse,measured:a}=e;const s={};if(o8(s,t),i&&"inside"!==i)if("up"===r||"down"===r){const e=Math.max(0,Math.min(t.y,n.height)),o=Math.max(0,Math.min(t.y+t.height,n.height));"outside"===i&&"up"===r||"opposite"===i&&"down"===r?(s.y=0,s.height=e):("outside"===i&&"down"===r||"opposite"===i&&"up"===r)&&(s.y=o,s.height=n.height-o)}else{const e=Math.max(0,Math.min(t.x,n.width)),o=Math.max(0,Math.min(t.x+t.width,n.width));"outside"===i&&"left"===r||"opposite"===i&&"right"===r?(s.x=0,s.width=e):("outside"===i&&"right"===r||"opposite"===i&&"left"===r)&&(s.x=o,s.width=n.width-o)}else;return function(e,t){const n=Math.max(0,Math.min(e.y,t.height)),r=Math.max(0,Math.min(e.y+e.height,t.height)),i=Math.max(0,Math.min(e.x,t.width)),o=Math.max(0,Math.min(e.x+e.width,t.width));e.x=i,e.width=o-i,e.y=n,e.height=r-n}(s,n),function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{top:r=hse,bottom:i=hse,left:o=hse,right:a=hse}=n,s="function"==typeof o?o(t):o,l="function"==typeof a?a(t):a,c="function"==typeof r?r(t):r,u="function"==typeof i?i(t):i;e.x+=s,e.width-=s+l,e.y+=c,e.height-=c+u}(s,a,o),s}function Cse(e){let t,n,r,i,o,{direction:a,fitsHorizontally:s,measured:l,node:c,orientation:u,placementSettings:d,rect:f}=e,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Sse;const p=[],m="h"===u?"width":"height";for(o=0;o<d.length;o++)if(r=d[o],i=h({bar:c.localBounds,view:f,direction:a,position:r.position,padding:r.padding,measured:l}),p.push(i),t=!o||i[m]>t[m]?i:t,bse(u,i,l,s,r.overflow)){n=i;break}return n||(n=t,o=p.indexOf(n)),r=d[o],{bounds:n,placement:r}}function kse(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const{top:o=hse,bottom:a=hse,left:s=hse,right:l=hse}=i,c="function"==typeof s?s(t):s,u="function"==typeof l?l(t):l,d="function"==typeof o?o(t):o,f="function"==typeof a?a(t):a,h=e.x+e.dx,p=e.y+e.dy,m=n?Math.min(t.width,r.height):Math.min(t.height,r.width),g=n?Math.min(t.height,r.height):Math.min(t.width,r.width),y=.5*t.height,v=1e-9;return{x:(n?h-y:h)-c-v,y:(n?p:p-y)-d-v,width:g+(c+u)-v,height:m+(d+f)-v}}function Ese(e){let{chart:t,targetNodes:n,rect:r,fitsHorizontally:i,collectiveOrientation:o}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Cse,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:wse,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:fse;const c=[],u={container:r,targetNodes:n,labels:[],orientation:o};let d,f,h,p,m,g,y,v,b,x,w,S,C,k;for(let e=0,l=n.length;e<l;e++){g=null,f=n[e],h=f.node,C=pse(h,t),b=f.direction,k="left"===b||"right"===b?"h":"v";for(let t=0;t<f.texts.length;t++){if(p=f.texts[t],!mse(p))continue;x=f.labelSettings[t],v=f.measurements[t],S=x.placements;const n=a({direction:b,fitsHorizontally:i,lblStngs:x,measured:v,node:h,orientation:k,placements:S,placementSettings:f.placementSettings[t],rect:r});if(g=n.bounds,w=n.placement,g&&w){var E;m=w.justify;const t="function"==typeof x.linkData?x.linkData(C,e):void 0,n="function"==typeof w.overflow?w.overflow(C,e):w.overflow;"up"===b&&(m=1-m),"opposite"===w.position&&(m=1-m),"left"===b&&(m=1-m);const r=!("h"===o||i);if(d=s(g,p,{justify:"h"===k?w.align:m,align:"h"===k?m:w.align,fontSize:x.fontSize,fontFamily:x.fontFamily,textMetrics:v,rotate:r,overflow:!!n,dock:null!==(E=x.dock)&&void 0!==E?E:"left"}),d){const n=kse(d,v,r,g,w.padding);y="function"==typeof w.fill?w.fill(c8(c8({},C),{},{textBounds:n}),e):w.fill,d.fill=y,void 0!==t&&(d.data=t),"object"==typeof w.background&&(d.backgroundColor="function"==typeof w.background.fill?w.background.fill(c8(c8({},C),{},{textBounds:n}),e):w.background.fill,void 0!==d.backgroundColor&&(d.backgroundBounds=kse(d,v,r,g,w.background.padding))),c.push(d),u.labels.push({node:h,textBounds:n})}}}}const M=c.filter(l(u)),_=M.filter((e=>void 0!==e.backgroundBounds)).map(gse);return[..._,...M]}function Mse(e){const t=2*Math.PI;return(e%t+t)%t}function _se(e,t){e.x+=t,e.width-=2*t,e.y+=t,e.height-=2*t}function Rse(e){return{x:e.x,y:e.y-e.height/2,width:e.width,height:e.height}}function Ise(e,t,n){let{x:r,y:i}=t;if(r*r+i*i>e*e)return null;let o=Math.sin(n),a=Math.cos(n),s=r*a-i*o,l=e*e-s*s;if(l<0)return null;let c=Math.sqrt(l);return{x:s*a+o*c,y:-s*o+a*c}}function Dse(e){let t,n,{radius:r,size:i,angle:o}=e,{width:a,height:s}=i,l={x:a/2,y:s/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(t=Ise(r,l,o),!t)return null;t.y*=-1,n={x:-a,y:0};break;case 1:if(t=Ise(r,l,Math.PI-o),!t)return null;n={x:-a,y:-s};break;case 2:if(t=Ise(r,l,o-Math.PI),!t)return null;t.x*=-1,n={x:0,y:-s};break;case 3:if(t=Ise(r,l,2*Math.PI-o),!t)return null;t.x*=-1,t.y*=-1,n={x:0,y:0};break;default:throw new Error("invalid angle")}return{x:t.x+n.x,y:t.y+n.y,width:a,height:s}}function Pse(e){let{slice:t,measured:n,padding:r}=e,{start:i,end:o,innerRadius:a,outerRadius:s}=t,l=s-a-2*r,c=o-i;if(c<Math.PI){let e=(n.height/2+r)/Math.tan(c/2);e>a&&(l=s-e-2*r)}if(l<0||l<n.minReqWidth)return null;const u=Mse((i+o)/2);let d=s-r,f={x:Math.sin(u)*d,y:-Math.cos(u)*d,width:l,height:n.height};return u<Math.PI?(f.angle=u-Math.PI/2,f.anchor="end"):(f.angle=u+Math.PI/2,f.anchor="start"),f}function Ase(e){let{context:t,node:n,bounds:r}=e;let{start:i,end:o}=n.desc.slice;const a=Mse((i+o)/2);switch(Math.floor(a/(Math.PI/2))){case 0:t.q1maxY=r.y-2,void 0===t.q2minY&&(t.q2minY=r.y+r.height+2);break;case 1:t.q2minY=r.y+r.height+2;break;case 2:t.q3minY=r.y+r.height+2;break;case 3:t.q4maxY=r.y-2,void 0===t.q3minY&&(t.q3minY=r.y+r.height+2)}}function Ose(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Lse(e,t,n){const r={type:"text",text:t,maxWidth:e.width,x:e.x,y:e.y+("top"===e.baseline?e.height/2:0),fill:n.fill,anchor:e.anchor||"start",baseline:"middle",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily};if(!isNaN(e.angle)){let t=e.angle*(360/(2*Math.PI));r.transform="rotate(".concat(t,", ").concat(r.x,", ").concat(r.y,")")}return r}function Tse(e){let t,n,{slice:r,direction:i,position:o,padding:a,measured:s,view:l,context:c,store:u}=e,{start:d,end:f,innerRadius:h,offset:p}=r;switch(o){case"into":t="rotate"===i?Pse({slice:r,measured:s,padding:a}):function(e){let{slice:t,padding:n,measured:r}=e,{start:i,end:o,innerRadius:a,outerRadius:s}=t;const l=Mse((i+o)/2);let c=Dse({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",Mie(c,{x1:0,y1:0,x2:Math.sin(i)*s,y2:-Math.cos(i)*s})||Mie(c,{x1:0,y1:0,x2:Math.sin(o)*s,y2:-Math.cos(o)*s})||yie({cx:0,cy:0,r:a},c)?null:(_se(c,n),c)):null}({slice:r,measured:s,padding:a});break;case"inside":n={start:d,end:f,innerRadius:0,outerRadius:h},t="rotate"===i?Pse({slice:n,measured:s,padding:a}):function(e){let{slice:t,padding:n,measured:r,store:i}=e;const{start:o,end:a,outerRadius:s}=t,l=Mse((o+a)/2);let c=Dse({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",_se(c,n),i.insideLabelBounds.some((e=>Cie(e,c)))?null:(i.insideLabelBounds.push({x:c.x-4,y:c.y,width:c.width+8,height:c.height}),c)):null}({slice:n,measured:s,padding:a,store:u});break;case"outside":t="rotate"===i?function(e){let{slice:t,measured:n,padding:r,view:i}=e,{start:o,end:a,outerRadius:s,offset:l}=t,c=s+r,u=a-o;if(u<Math.PI&&(n.height/2+r)/Math.tan(u/2)>c)return null;const d=Mse((o+a)/2);let f=Math.sin(d)*c,h=-Math.cos(d)*c,p=n.width+1,m=d%Math.PI;if(m>Math.PI/2&&(m=Math.PI-m),Math.cos(m)>.001){let e=h<0?i.y:i.y+i.height,t=Math.abs(e-l.y)/Math.cos(m)-Math.tan(m)*(n.height/2)-2*r-s;t<p&&(p=t)}if(Math.sin(m)>.001){let e=f<0?i.x:i.x+i.width,t=Math.abs(e-l.x)/Math.sin(m)-n.height/2/Math.tan(m)-2*r-s;t<p&&(p=t)}if(p<=0||p<n.minReqWidth)return null;let g={x:f,y:h,width:p,height:n.height};return d<Math.PI?(g.angle=d-Math.PI/2,g.anchor="start"):(g.angle=d+Math.PI/2,g.anchor="end"),g}({slice:r,measured:s,padding:a,view:l}):function(e){let{slice:t,measured:n,padding:r,view:i,context:o}=e,{start:a,end:s,outerRadius:l,offset:c}=t;const u=Mse((a+s)/2);if(function(e,t,n){switch(t){case 0:return e.q1maxY<0;case 1:return e.q2minY>n.height;case 2:return e.q3minY>n.height;case 3:return e.q4maxY<0;default:return!0}}(o,Math.floor(u/(Math.PI/2)),i))return null;let d=l+r+n.height/2,f=Math.sin(u)*d,h=-Math.cos(u)*d,p=n.width+1;if(u<Math.PI){let e=Math.abs(i.x+i.width-(f+c.x));e<p&&(p=e)}else{let e=Math.abs(i.x-(f+c.x));e<p&&(p=e)}if(p<n.minReqWidth)return null;let m={x:f,y:h,width:p,height:n.height};return u<Math.PI?m.anchor="start":m.anchor="end",m}({slice:r,measured:s,padding:a,view:l,context:c});break;default:throw new Error("not implemented")}return t&&(t.x+=p.x,t.y+=p.y,"outside"===o&&"rotate"!==i&&function(e,t,n){const{start:r,end:i,offset:o,outerRadius:a}=n,s=Mse((r+i)/2);switch(Math.floor(s/(Math.PI/2))){case 0:if(void 0!==t.q1maxY){let n=Math.min(e.y,t.q1maxY-e.height),r=e.y-n;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x-2,y1:e.y+2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 1:if(void 0!==t.q2minY){let n=Math.max(e.y,t.q2minY),r=n-e.y;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x-2,y1:e.y-2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 2:if(void 0!==t.q3minY){let n=Math.max(e.y,t.q3minY),r=n-e.y;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x+2,y1:e.y-2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 3:if(void 0!==t.q4maxY){let n=Math.min(e.y,t.q4maxY-e.height),r=e.y-n;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x+2,y1:e.y+2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}}}(t,c,r)),t}function qse(e){let{context:t,direction:n,measured:r,node:i,placementSettings:o,rect:a,store:s}=e,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Tse;for(let e=0;e<o.length;e++){let c=o[e],u=l({context:t,slice:i.desc.slice,view:a,direction:n,position:c.position,measured:r,padding:c.padding,store:s});if(u)return{bounds:u,placement:c}}return{bounds:null,placement:null}}function Nse(e,t,n){const r=t.fontFamily,i="".concat(t.fontSize,"px"),o=n.measureText({text:e,fontFamily:r,fontSize:i});return o.minReqWidth=Math.min(o.width,n.measureText({text:"".concat(e[0],"…"),fontFamily:r,fontSize:i}).width),o}const jse=/\n+|\r+|\r\n/,zse=/\s/,Fse=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function Wse(e){return"string"==typeof e?-1!==e.search(jse):-1!==String(e).search(jse)}function $se(e){return-1!==e.search(zse)}function Bse(e){return-1!==e.search(Fse)}function Vse(e,t,n){return Math.max(t,Math.min(n,e))}function Hse(){let{string:e,separator:t="",reverse:n=!1,measureText:r=e=>({width:e.length,height:1}),mandatoryBreakIdentifiers:i=[Wse],noBreakAllowedIdentifiers:o=[],suppressIdentifier:a=[$se,Wse,e=>""===e],hyphenationIdentifiers:s=[Bse]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const l=String(e).split(t);!function(e){""===e[0]&&e.shift(),""===e[e.length-1]&&e.pop()}(l);const c=l.length,u=n?e=>e>=0:e=>e<c;let d=n?c:-1;function f(e){const t=Vse(e,0,c-1),n=l[t],u=r(n),d=function(e,t,n,r,i){return r.some((r=>r(e,t,n)))?1:i.some((r=>r(e,t,n)))?0:2}(n,t,l,i,o);return{index:t,value:n,breakOpportunity:d,suppress:a.some((e=>e(n,t,l))),hyphenation:s.some((e=>e(n,t,l))),width:u.width,height:u.height,done:!1}}return{next:function(e){return isNaN(e)?n?d--:d++:d=Vse(e,0,c-1),u(d)?f(d):{done:!0}},peek:f,length:c}}const Use="…",Gse=/^\s*\d+(\.\d+)?px\s*$/i;function Yse(e){return"string"===typeof e&&Gse.test(e)}function Kse(e){const t=e["font-size"]||e.fontSize;return Yse(t)?parseFloat(t)*Math.max(isNaN(e.lineHeight)?1.2:e.lineHeight,0):19.2}function Xse(e){const t=e.maxHeight,n=Math.max(e.maxLines,1)||1/0;if(isNaN(t))return n;const r=Kse(e);return Math.max(1,Math.min(Math.floor(t/r),n))}function Jse(e,t){return{lines:[],line:"",width:0,maxLines:Xse(e),maxWidth:e.maxWidth,hyphens:{enabled:"auto"===e.hyphens,char:"‐",metrics:t("‐")}}}function Qse(e){e.lines.push(e.line),e.line="",e.width=0}function Zse(e,t){e.line+=t.value,e.width+=t.width}function ele(e,t,n){if(t.width>e.maxWidth)return t;const r=t.index;for(let i=1;i<5;i++){const o=n.peek(t.index-1);if(!t.hyphenation||!o.hyphenation||0===t.index)return t;if(e.width+e.hyphens.metrics.width<=e.maxWidth)return e.line+=e.hyphens.char,t;if(1===e.line.length)return t;t=n.next(r-i),e.line=e.line.slice(0,-1),e.width-=t.width}return t}function tle(e,t,n){const r=Hse({string:t.value,measureText:n});for(;e.lines.length<e.maxLines;){let t=r.next();if(t.done)break;e.width+t.width>e.maxWidth&&2===t.breakOpportunity&&e.line.length>0?(t=e.hyphens.enabled?ele(e,t,r):t,Qse(e),Zse(e,t)):Zse(e,t)}}function nle(e,t){const n=Hse({string:e.text,separator:"",measureText:t,noBreakAllowedIdentifiers:[(e,t)=>0===t]}),r=Jse(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){Qse(r),i=!1;break}1===e.breakOpportunity?Qse(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?r.width+=e.width:(e=r.hyphens.enabled?ele(r,e,n):e,Qse(r),Zse(r,e)):Zse(r,e)}return{lines:r.lines,reduced:i}}function rle(e,t){const n=Hse({string:e.text,separator:/(\s|-|\u2010)/,measureText:t}),r=Jse(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){Qse(r),i=!1;break}1===e.breakOpportunity?Qse(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?Qse(r):e.width>r.maxWidth?tle(r,e,t):(Qse(r),Zse(r,e)):Zse(r,e)}return{lines:r.lines,reduced:i}}function ile(e){return{"break-all":nle,"break-word":rle}[e.wordBreak]}function ole(e){return t=>{const n=t.node;if(function(e){return"text"===e.type&&!e._lineBreak}(n)){const r=ile(n);if(!r)return;const i=e(n);if(i.width>n.maxWidth||Wse(n.text)){const o=(Kse(n)-i.height)/2,a=r(n,function(e,t){return n=>t({text:n,fontSize:e.fontSize,fontFamily:e.fontFamily})}(n,e));t.node=function(e,t,n,r){const i={type:"container",children:[]};void 0!==t.id&&(i.id=t.id);let o=0;return e.lines.forEach(((a,s)=>{const l=o8({},t);l.text=a,l._lineBreak=!0,o+=n,e.reduced&&s===e.lines.length-1?l.text+=Use:delete l.maxWidth,l.dy=isNaN(l.dy)?o:l.dy+o,o+=r,o+=n,i.children.push(l)})),i}(a,n,o,i.height)}}}}function ale(e,t){const n=e["font-family"]||e.fontFamily,r=e["font-size"]||e.fontSize,i="string"==typeof e.text?e.text:"".concat(e.text),{maxWidth:o}=e;if(void 0===o)return i;let a=t({text:i,fontSize:r,fontFamily:n}).width;if(a<=o)return i;let s=0,l=i.length-1;for(;s<=l;){let e=Math.floor((s+l)/2);a=t({text:i.substr(0,e)+Use,fontSize:r,fontFamily:n}).width,a<=o?s=e+1:l=e-1}return i.substr(0,l)+Use}function sle(e){const t=e.baseline||e["dominant-baseline"];let n=0;const r=parseInt(e.fontSize||e["font-size"],10)||0;switch(t){case"hanging":n=.75*r;break;case"text-before-edge":n=.85*r;break;case"middle":n=.25*r;break;case"central":n=.35*r;break;case"mathemetical":n=r/2;break;case"text-after-edge":case"ideographic":n=.2*-r;break;default:n=0}return n}const lle={},cle={},ule={fontSize:void 0,fontFamily:void 0};let dle;function fle(e,t){return!e&&!t||e===t}function hle(e){let{text:t,fontWeight:n,fontSize:r,fontFamily:i}=e;const o="".concat(t," ").concat(n," ").concat(r," ").concat(i);return"number"!=typeof cle[o]&&(dle=dle||document.createElement("canvas").getContext("2d"),function(e){let{fontWeight:t,fontSize:n,fontFamily:r}=e;fle(ule.fontWeight,t)&&fle(ule.fontSize,n)&&fle(ule.fontFamily,r)||(dle.font=[t,n,r].filter((e=>!!e)).join(" "),ule.fontWeight=t,ule.fontSize=n,ule.fontFamily=r)}({fontWeight:n,fontSize:r,fontFamily:i}),cle[o]=dle.measureText(t).width),cle[o]}function ple(e){return"number"!=typeof lle[e]&&(lle[e]=function(e){if(Yse(e)){const t=parseFloat(e);return t+4*Math.ceil((t+1e-12)/24)}return 16}(e)),lle[e]}function mle(e){let{text:t,fontWeight:n,fontSize:r,fontFamily:i}=e;return{width:hle({text:t,fontWeight:n,fontSize:r,fontFamily:i}),height:ple(r)}}function gle(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:mle;const n=e["font-size"]||e.fontSize,r=e["font-family"]||e.fontFamily,i=t({text:e.text,fontFamily:r,fontSize:n}),o=Math.min(e.maxWidth||i.width,i.width),a=e.x||0,s=e.y||0,l=e.dx||0,c={x:0,y:s+((e.dy||0)+sle(e))-.75*i.height,width:o,height:i.height},u=e["text-anchor"]||e.anchor;return c.x="middle"===u?a+l-o/2:"end"===u?a+l-o:a+l,c}function yle(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:mle;const n=ile(e),r=e["font-size"]||e.fontSize,i=e["font-family"]||e.fontFamily,o=t({text:e.text,fontFamily:i,fontSize:r});if(n&&(o.width>e.maxWidth||Wse(e.text))){const o=n(e,(e=>t({text:e,fontFamily:i,fontSize:r}))),a=o8({},e);let s=0,l="";for(let e=0,n=o.lines.length;e<n;e++){let a=o.lines[e];a+=e===n-1&&o.reduced?Use:"";const c=t({text:a,fontSize:r,fontFamily:i}).width;c>=s&&(s=c,l=a)}a.text=l;const c=gle(a,t);return c.height=Kse(e)*o.lines.length,c}return gle(e,t)}function vle(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function ble(e,t,n){const r={type:"text",text:t,maxWidth:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:"start",baseline:"alphabetical",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},i=n.textMetrics;if(e.width<n.fontSize)return!1;const o=Math.max(0,e.width-i.width);return r.x=e.x+n.align*o,r.y=e.y+i.height/1.2,r}function xle(e){let{cx:t,cy:n,r:r}=e;return{type:"circle",bounds:{cx:t,cy:n,r:r}}}function wle(e){return e.desc&&e.desc.slice?function(e){let{start:t,end:n,innerRadius:r,outerRadius:i,offset:o}=e;if(Math.abs(t+2*Math.PI-n)>1e-12)return{type:null,bounds:null};let a=0!==r?r:i;return xle({cx:o.x,cy:o.y,r:a})}(e.desc.slice):"circle"===e.type?xle(e.attrs):"rect"===e.type?{type:"rect",bounds:e.bounds}:{type:null,bounds:null}}var Sle={bar:function(e){let{settings:t,chart:n,nodes:r,rect:i,renderer:o,style:a}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ese;const l=o8({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},a.label);l.fontSize=parseInt(l.fontSize,10);const c=t.labels.map((e=>o8({},l,t,e))),u=t.labels.map((e=>e.placements.map((n=>o8({},l,t,e,n))))),{fitsHorizontally:d,hasHorizontalDirection:f,targetNodes:h}=function(e){let{nodes:t,rect:n,chart:r,labelSettings:i,placementSettings:o,settings:a,renderer:s}=e;const l={},c=[];let u,d,f,h,p,m,g,y=!0,v=!1;for(let e=0;e<t.length;e++){if(d=t[e],h=d.localBounds,!Cie(h,n))continue;let b=pse(d,r);u={node:d,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(let t=0;t<i.length;t++)m=i[t],f="function"==typeof m.label?m.label(b,e):void 0,mse(f)&&(g="function"==typeof a.direction?a.direction(b,e):a.direction||"up",v=v||"left"===g||"right"===g,l.fontFamily=m.fontFamily,l.fontSize="".concat(m.fontSize,"px"),l.text=f,p=s.measureText(l),u.measurements.push(p),u.texts.push(f),u.labelSettings.push(m),u.placementSettings.push(o[t]),u.direction=g,y=y&&p.width<=h.width-2*hse);c.push(u)}return{targetNodes:c,fitsHorizontally:y,hasHorizontalDirection:v}}({nodes:r,chart:n,renderer:o,settings:t,rect:i,labelSettings:c,placementSettings:u}),p=function(e){let{orientation:t="auto",defaultOrientation:n="h"}=e;switch(t.toLocaleLowerCase()){case"vertical":return"v";case"horizontal":return"h";default:return n}}({orientation:t.orientation,defaultOrientation:f?"h":"v"}),m="h"===p?"y":"x",g="h"===p?"height":"width";return h.sort(((e,t)=>e.node.localBounds[m]+e.node.localBounds[g]-(t.node.localBounds[m]+t.node.localBounds[g]))),s({chart:n,targetNodes:h,stngs:t,rect:i,fitsHorizontally:d,collectiveOrientation:p})},slice:function(e){let{settings:t,chart:n,nodes:r,rect:i,renderer:o,style:a}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qse,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Lse;const c=o8({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},a.label);c.fontSize=parseInt(c.fontSize,10);const u=t.labels.map((e=>o8({},c,t,e))),d=t.labels.map((e=>e.placements.map((n=>o8({},c,t,e,n))))),f=[],h={insideLabelBounds:[]};r=function(e){const t=[],n=[],r=[],i=[];for(let o=0;o<e.length;++o){const{start:a,end:s}=e[o].desc.slice,l=Mse((a+s)/2);switch(Math.floor(l/(Math.PI/2))){case 0:t.push(e[o]);break;case 1:n.push(e[o]);break;case 2:r.push(e[o]);break;case 3:i.push(e[o])}}const o=(e,t)=>Mse((e.desc.slice.start+e.desc.slice.end)/2)-Mse((t.desc.slice.start+t.desc.slice.end)/2),a=(e,t)=>o(t,e);return t.sort(a),n.sort(o),r.sort(a),i.sort(o),t.concat(n,i,r)}(r);const p={};for(let e=0,t=r.length;e<t;e++){const t=r[e],a=Ose(t,n);for(let n=0;n<u.length;n++){const r=u[n],c="function"==typeof r.label?r.label(a,e):"";if(!c)continue;const m="function"==typeof r.direction?r.direction(a,e):r.direction||"horizontal",g="function"==typeof r.linkData?r.linkData(a,e):void 0,y=Nse(c,r,o),v=s({context:p,direction:m,lblStngs:r,measured:y,node:t,placementSettings:d[n],rect:i,store:h}),b=v.bounds,x=v.placement;if(b&&x){if("outside"===x.position&&"rotate"!==m){Ase({context:p,node:t,bounds:b});if(!cie(Rse(b),i))continue}const n="function"==typeof x.fill?x.fill(a,e):x.fill,o=l(b,c,{fill:n,fontSize:r.fontSize,fontFamily:r.fontFamily,textMetrics:y});o&&(void 0!==g&&(o.data=g),f.push(o),b.line&&(b.line.stroke=n,f.push(b.line)))}}}return f},rows:function(e){let{settings:t,chart:n,nodes:r,renderer:i,style:o}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ble;const s=o8({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);s.fontSize=parseInt(s.fontSize,10);const l=o8({},s,t),c=t.labels.map((e=>o8({},l,e))),u={},d=[];for(let e=0,t=r.length;e<t;e++){let t=r[e],o=vle(t,n),{type:s,bounds:f}=wle(t);if(!f)continue;let h,p=0,m=[],g=[],y="circle"===s?2*f.r*.9:f.height;for(p+=l.padding,h=0;h<c.length;h++){let t=c[h],n="function"==typeof t.label?t.label(o,e):"";u.fontFamily=t.fontFamily,u.fontSize="".concat(t.fontSize,"px"),u.text=n;let r=i.measureText(u);if(p+=r.height+t.padding,p>y)break;g.push(n),m.push(r)}const v=h,b=Math.max(0,y-p);let x;for(x="circle"===s?f.cy-.9*f.r:f.y,x+=l.justify*b+l.padding,h=0;h<v;h++){let t,n=c[h];if("circle"===s){let e=Math.max(Math.abs(x-f.cy),Math.abs(x+m[h].height-f.cy)),n=Math.sqrt(f.r*f.r-e*e);t={x:f.cx-n+l.padding,y:x,width:2*n-2*l.padding,height:m[h].height}}else t={x:f.x+l.padding,y:x,width:f.width-2*l.padding,height:m[h].height};x+=m[h].height+l.padding;let r="function"==typeof n.fill?n.fill(o,e):n.fill;const u="function"==typeof n.linkData?n.linkData(o,e):void 0;let p=a(t,g[h],{fill:r,align:n.align,fontSize:n.fontSize,fontFamily:n.fontFamily,textMetrics:m[h]});if(p){if(p.text&&p.text!==Use){const e=ale(p,i.measureText);if(Use===e)continue;p.ellipsed=e}void 0!==u&&(p.data=u),d.push(p)}}}return d}};const Cle={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render(){const e=this.settings.settings,t=[];return(e.sources||[]).forEach((e=>{e.strategy&&Sle[e.strategy.type]&&e.component&&t.push(...function(e,t){let{chart:n,source:r,rect:i,renderer:o,style:a}=e;if(!n.component(r.component))return[];const s=n.findShapes(r.selector).filter((e=>e.key===r.component));return t({chart:n,settings:r.strategy.settings,nodes:s,rect:{x:0,y:0,width:i.width,height:i.height},renderer:o,style:a})}({chart:this.chart,rect:this.rect,renderer:this.renderer,source:e,style:this.style},Sle[e.strategy.type]))})),t}};const kle={layout:{size:1,direction:"ltr",scrollOffset:0},item:{show:!0,label:{fontSize:"12px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:136,lineHeight:1.2},shape:{type:"square",size:12}},title:{show:!0,text:void 0,anchor:"start",fontSize:"16px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:156,lineHeight:1.25}};function Ele(e){let{x:t=0,y:n,item:r,globalMetrics:i,createSymbol:o,direction:a="ltr"}=e,s=r.label.displayObject,l=r.label.bounds,c=r.symbol.meta;const u="rtl"===a;let d={x:u?t+i.maxLabelBounds.width:t+i.maxSymbolSize+i.spacing,y:n,width:i.maxLabelBounds.width,height:Math.max(i.maxSymbolSize,i.maxLabelBounds.height)},f=function(e,t,n){const r=Math.max(0,e.width-t),i=Math.max(0,e.height-t);return{x:e.x+t/2+n.align*r,y:e.y+t/2+n.justify*i}}({x:u?t+i.maxLabelBounds.width+i.spacing:t,y:n,width:i.maxSymbolSize,height:d.height},c.size,{align:void 0===c.align?.5:c.align,justify:void 0===c.justify?.5:c.justify});const h=o(o8({},c,f));return delete h.collider,s.anchor=u?"end":"start",function(e,t,n){const r=n.textMetrics;if(e.height<r.height)return!1;const i=Math.max(0,e.width-r.width);t.baseline="text-before-edge";const o=Math.max(0,e.height-r.height);t.x=e.x+n.align*i,t.y=e.y+n.justify*o+.175*parseInt(t.fontSize,10)}(d,s,{textMetrics:l,fontSize:parseInt(s.fontSize,10),align:0,justify:.5}),{item:{type:"container",data:r.label.displayObject.data,children:[h,s],collider:{type:"rect",x:t,y:n,width:i.maxItemBounds.width,height:i.maxItemBounds.height}},metrics:d}}function Mle(e,t){const n=e.items.length,r=Math.ceil(n/t),i="horizontal"===e.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[i]*r+(r-1)*e.layout.margin[o]}function _le(e,t){let n,r,i,o,{onScroll:a=()=>{}}=t,s=null,l=0;const c={itemize:t=>{n=function(e,t){let n,r,{resolved:i,dock:o}=e,a=[],s=i.items.items,l=i.symbols.items,c=i.labels.items,u=0,d=0,f=0;for(let e=0;e<s.length;e++){if(!1===s[e].show)continue;const i=void 0!==c[e].text?c[e].text:c[e].data.label||"";n=o8({},c[e],{type:"text",fontSize:"".concat(parseInt(c[e].fontSize,10),"px"),text:i,title:i}),r={symbol:{meta:l[e]},label:{displayObject:n,bounds:t.textBounds(n)}},a.push(r),u=Math.max(l[e].size,u),d=Math.max(r.label.bounds.width,d),f=Math.max(r.label.bounds.height,f)}return{items:a,globalMetrics:{spacing:8,maxSymbolSize:u,maxItemBounds:{height:Math.max(u,f),width:u+8+d},maxLabelBounds:{width:d,height:f}},layout:{margin:{vertical:void 0!==i.layout.item.vertical?i.layout.item.vertical:4,horizontal:void 0!==i.layout.item.horizontal?i.layout.item.horizontal:4},mode:i.layout.item.mode,size:i.layout.item.size,orientation:"top"===o||"bottom"===o?"horizontal":"vertical",direction:i.layout.item.direction,scrollOffset:i.layout.item.scrollOffset}}}(t,e.renderer),s=isNaN(n.layout.scrollOffset)?s:n.layout.scrollOffset},getItemsToRender:t=>{i=t.viewRect,l=c.getContentOverflow(i);const a=c.extent();s=Math.max(0,Math.min(s,l)),o=o8({},i);const u="horizontal"===c.orientation()?"x":"y";return o[u]-=s,o["x"===u?"width":"height"]=a,function(e,t,n){let{viewRect:r}=e,{itemized:i,create:o=Ele,parallels:a,createSymbol:s}=n;const l=i.layout.direction,c=i.globalMetrics,u=i.items,d="horizontal"===i.layout.orientation;let f=0;const h=[],p=c.maxItemBounds.height,m=c.maxItemBounds.width,g=i.layout.margin.vertical+p,y=i.layout.margin.horizontal+m;let v=t.x,b=t.y,x=r.x-t.x;for(let e=0;e<u.length;e++){let n=o({y:b,x:"rtl"===l?r.x+x+r.width-m-(v-t.x):v,item:u[e],globalMetrics:c,direction:l,createSymbol:s});if((d&&v>=r.x-m||!d&&b>=r.y-p)&&h.push(n.item),f++,f>=a?(f=0,d?(v+=y,b=t.y):(b+=g,v=t.x)):d?b+=g:v+=y,!d&&b>r.y+r.height)break;if(d&&v>r.x+r.width)break}return h}(t,o,{itemized:n,parallels:r,createSymbol:e.symbol})},parallelize:(e,t)=>(r=function(e,t,n){const r=n.items.length,i="horizontal"===n.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical",a=n.globalMetrics.maxItemBounds[i]*r+(r-1)*n.layout.margin[o];let s=Math.ceil(a/e);if(null!=t){const e="horizontal"===n.layout.orientation?"height":"width",r="width"===e?"horizontal":"vertical",i=n.layout.margin[r]||4,o=Math.floor((t+i)/(i+n.globalMetrics.maxItemBounds[e]));s=Math.min(s,o)}const l=isNaN(n.layout.size)?1:n.layout.size;return Math.max(1,Math.min(s,l))}(e,t,n),r),hasContentOverflow:()=>{const e="horizontal"===n.layout.orientation?"width":"height";return Mle(n,r)>i[e]},getContentOverflow:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;const t="horizontal"===n.layout.orientation?"width":"height";return Math.max(0,Mle(n,r)-e[t])},getNextSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},getPrevSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},hasNext:()=>"horizontal"===c.orientation()?i.x+i.width<o.x+o.width:i.y+i.height<o.y+o.height,hasPrev:()=>"horizontal"===c.orientation()?o.x<i.x:o.y<i.y,next:()=>{c.scroll(-c.getNextSize())},prev:()=>{c.scroll(c.getPrevSize())},scroll:e=>{const t=Math.max(0,Math.min(l,s-e));t!==s&&(s=t,a())},offset:()=>s,orientation:()=>n.layout.orientation,direction:()=>n.layout.direction,extent:()=>Mle(n,r),spread:()=>function(e,t){const n=t,r="horizontal"===e.layout.orientation?"height":"width",i="width"===r?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[r]*n+(n-1)*e.layout.margin[i]}(n,r)};return c}function Rle(e){return Object.keys(e).filter((t=>e[t])).join(" ")}const Ile={up:"▲",right:"▶",down:"▼",left:"◀"};function Dle(e,t){let{size:n,isActive:r,direction:i,nav:o,attrs:a}=t,s={},l="";const c=a;o&&o.button&&("function"==typeof o.button.class?s=o.button.class({direction:i}):o.button.class&&(s=o.button.class),"function"==typeof o.button.content&&(l=o.button.content(e,{direction:i})),void 0!==o.button.tabIndex&&(c.tabindex=o.button.tabIndex));const u={width:"".concat(n,"px"),minWidth:"".concat(n,"px"),height:"".concat(n,"px")};return Object.keys(s).length||(u.border="0",u.background="none"),(!r||o&&o.disabled)&&(c.disabled="disabled"),e("button",o8({class:Rle(s),style:u},c),[l||e("span",{style:{pointerEvents:"none"}},[Ile[i]])])}function Ple(e){let t;const n={itemize:e=>{t=function(e){let{dock:t,navigation:n}=e;return{layout:{orientation:"top"===t||"bottom"===t?"vertical":"horizontal"},navigation:n}}(e)},render:r=>function(e,t,n,r){let{rect:i,itemRenderer:o}=t;if(!e||!e.renderArgs)return;e.size(i);const a=e.renderArgs[0],s="vertical"===n.layout.orientation,l="rtl"===o.direction(),c=o.hasNext(),u=o.hasPrev();if(!u&&!c)return void e.render([]);const d=s?["right","left"]:["down","up"];l&&s&&d.reverse();const f=[a("div",{style:{position:"relative",display:"flex","flex-direction":s?"column":"row","justify-content":"center",height:"100%",pointerEvents:"auto"},dir:l&&!s?"rtl":"ltr"},[Dle(a,{size:32,isActive:c,direction:d[0],attrs:{"data-action":"next","data-component-key":r.settings.key},nav:n.navigation}),Dle(a,{size:32,isActive:u,direction:d[1],attrs:{"data-action":"prev","data-component-key":r.settings.key},nav:n.navigation})])];e.render(f)}(n.renderer,r,t,e),extent:()=>32,spread:()=>64};return n}function Ale(e){let t;const n={itemize:n=>{t=function(e,t){let{resolved:n}=e;if(!1===n.title.item.show)return null;const r=o8({},n.title.item,{type:"text"});if("rtl"===n.layout.item.direction&&(r.anchor&&"start"!==r.anchor?"end"===r.anchor&&(r.anchor="start"):r.anchor="end"),void 0===n.title.settings.text){const e=t.scale.data().fields;r.text=e&&e[0]?e[0].title():""}return{displayObject:r,bounds:t.renderer.textBounds(r)}}(n,e)},render:e=>{!function(e,t,n){let{rect:r}=e;if(!t)return;const i=[];if(t.size(r),n){const e={start:0,end:r.width,middle:r.width/2};i.push(o8({},n.displayObject,{x:e[n.displayObject.anchor]||0,y:0,baseline:"text-before-edge",title:n.displayObject.text}))}t.render(i)}(e,n.renderer,t)},spread:()=>t?t.bounds.height:0,extent:()=>t?t.bounds.width:0};return n}function Ole(e,t,n,r){let i,o,a,{itemRenderer:s,navigationRenderer:l,titleRenderer:c,isPreliminary:u=!1}=r,d=0;const f={x:t.spacing,y:t.spacing,width:e.width-2*t.spacing,height:e.height-2*t.spacing};if(i={x:f.x,y:f.y,width:f.width,height:c.spread()},"horizontal"===n){i={x:f.x,y:f.y,width:c.extent(),height:c.spread()};const e=f.width-i.width-(i.width?t.spacing:0),n=f.height;s.parallelize(e,u?void 0:n);const r=s.extent()>e?l.extent():0,h=s.spread(),p=r?l.spread():0;o={x:i.x+i.width+(i.width?t.spacing:0),y:f.y+Math.max(0,(p-h)/2),width:f.width-r-i.width-(r?t.spacing:0)-(i.width?t.spacing:0),height:n},a={x:o.x+o.width+(r?t.spacing:0),y:f.y,width:r,height:f.height},i.y=o.y;"rtl"===s.direction()&&(a.x=f.x,o.x=a.x+a.width+(a.width?t.spacing:0),i.x=o.x+o.width+(i.width?t.spacing:0)),d=Math.max(i.height,p,s.spread())}else{const e=f.height-i.height-(i.height?t.spacing:0),n=f.width;s.parallelize(e,u?void 0:n);const r=s.extent()>e?l.extent():0;a={x:f.x,y:f.y+f.height-r,width:f.width,height:r},o={x:f.x,y:i.y+i.height+(i.height?t.spacing:0),width:f.width,height:f.height-i.height-(i.height?t.spacing:0)-a.height-(a.height?t.spacing:0)},d=Math.max(c.extent(),r?l.spread():0,s.spread())}return o=o8({},e,{x:e.x+o.x,y:e.y+o.y,width:o.width,height:o.height}),a.x+=e.x,a.y+=e.y,i.x+=e.x,i.y+=e.y,{title:o8({},e,i),content:o8({},e,o),navigation:o8({},e,a),orientation:n,preferredSize:d}}function Lle(e){e.state.resolved=function(e){const t=e.scale.domain();let n={items:[]};const r=e.settings.layout.dock;if("threshold-color"===e.scale.type){const i=e.scale.data().fields[0];let o=e=>String(e);e.settings.formatter?o=e.chart.formatter(e.settings.formatter):i&&(o=i.formatter());for(let e=0;e<t.length-1;e++){const r={value:t[e],label:"".concat(o(t[e])," - < ").concat(o(t[e+1]))};i&&(r.source={field:i.id()}),n.items.push(r)}"vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")&&n.items.reverse()}else{const r=e.scale.labels?e.scale.labels():null;n.items=t.map(((t,n)=>{const i=e.scale.datum?o8({},e.scale.datum(t)):{value:t};return i.value=t,e.scale.label?i.label=e.scale.label(t):r&&(i.label=r[n]),i}))}const i=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:o8(!0,{},kle.title,e.style.title),settings:e.settings.settings.title}),o=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:kle.layout,settings:e.settings.settings.layout}),a=e.resolver.resolve({data:n,defaults:o8(!0,{},kle.item.label,e.style.item.label),settings:(e.settings.settings.item||{}).label}),s=o8(!0,{},(e.settings.settings.item||{}).shape);void 0===s.fill&&e.settings.scale&&(s.fill={scale:e.settings.scale});const l=e.resolver.resolve({data:n,defaults:o8(!0,{},kle.item.shape,e.style.item.shape),settings:s}),c=e.resolver.resolve({data:n,defaults:o8(!0,{},{show:kle.item.show}),settings:{show:(e.settings.settings.item||{}).show}});function u(e,n){let r=e.data.value,i=t[n+1];e.data.value=[r,i]}"threshold-color"===e.scale.type&&("vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")?(c.items.reverse().forEach(u),c.items.reverse()):c.items.forEach(u));return{title:i,labels:a,symbols:l,items:c,layout:o}}(e),e.titleRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.itemRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.navigationRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center",navigation:e.settings.settings.navigation}),e.state.display={spacing:8}}function Tle(e){const{rect:t,settings:n,state:r,itemRenderer:i,navigationRenderer:o,titleRenderer:a}=e,s=n.layout.dock,l="top"===s||"bottom"===s?"horizontal":"vertical",c=Ole(t,r.display,l,{itemRenderer:i,navigationRenderer:o,titleRenderer:a});e.renderer.size(c.content);let u=i.getItemsToRender({viewRect:o8({},c.content,{x:0,y:0})});return o.render({rect:c.navigation,itemRenderer:i}),a.render({rect:c.title}),e.state.views={layout:c},u}const qle={require:["chart","settings","renderer","update","resolver","registries","symbol"],defaultSettings:{settings:{},style:{item:{label:"$label",shape:"$shape"},title:"$title"}},mounted(e){e&&e.parentNode&&(this.navigationRenderer.renderer.appendTo(e.parentNode),this.titleRenderer.renderer.appendTo(e.parentNode),e.parentNode.insertBefore(this.navigationRenderer.renderer.element(),e),e.parentNode.insertBefore(this.titleRenderer.renderer.element(),e)),this.navigationRenderer.render({rect:this.state.views.layout.navigation,itemRenderer:this.itemRenderer}),this.titleRenderer.render({rect:this.state.views.layout.title})},beforeUnmount(){this.navigationRenderer.renderer.clear(),this.titleRenderer.renderer.clear()},on:{panstart(){if(this.state.interaction.started)return;this.itemRenderer.getContentOverflow()&&(this.state.interaction.started=!0,this.state.interaction.delta=0)},panmove(e){if(!this.state.interaction.started)return;const t="horizontal"===this.itemRenderer.orientation()?("rtl"===this.itemRenderer.direction()?-1:1)*e.deltaX:e.deltaY;this.itemRenderer.scroll(t-this.state.interaction.delta),this.state.interaction.delta=t},panend(){this.state.interaction.started=!1},scroll(e){this.itemRenderer.scroll(-e)},next(){this.itemRenderer.next()},prev(){this.itemRenderer.prev()}},created(){this.state={interaction:{}},this.onScroll=()=>{const e=Tle(this);this.update(e)},this.itemRenderer=_le(this,{onScroll:this.onScroll}),this.navigationRenderer=Ple(this),this.titleRenderer=Ale(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),Lle(this)},preferredSize(e){return function(e,t){let n=0;const r=e.settings.layout.dock||"center",i="top"===r||"bottom"===r?"horizontal":"vertical",o=e.state.display,a=Ole(t.inner,o,i,{itemRenderer:e.itemRenderer,navigationRenderer:e.navigationRenderer,titleRenderer:e.titleRenderer,isPreliminary:!0});return n+=o.spacing,n+=a.preferredSize,n+=o.spacing,n}(this,e)},beforeUpdate(){Lle(this)},render(){return Tle(this)},beforeDestroy(){this.navigationRenderer.renderer.destroy(),this.titleRenderer.renderer.destroy()},additionalElements(){return[this.titleRenderer.renderer.element(),this.navigationRenderer.renderer.element()]},_DO_NOT_USE_getInfo(){return{offset:this.itemRenderer.offset()}}};function Nle(e,t){let n=0;const r=e.state.isVertical?"justify":"align",i=e.state.isVertical?"y":"x",o=e.state.isVertical?"height":"width",a=e.state.isVertical?"requiredHeight":"requiredWidth";n=e.state.rect[o]-e.state.legend.length()-e.state.title[a](),n*=Math.min(1,Math.max(e.stgns[r],0)),t[i]+=n}function jle(e,t,n){const r=n[e];return"object"==typeof r?-1!==r.valid.indexOf(t)?t:r.default:n.default}function zle(e){return jle(e.layout.dock,e.settings.title.anchor,{left:{valid:["top"],default:"top"},right:{valid:["top"],default:"top"},top:{valid:["left","right"],default:"left"},bottom:{valid:["left","right"],default:"left"},default:"top"})}function Fle(e,t){const n={x:0,y:0,width:0,height:0},r=e.stgns.padding;return n.x=r.left,n.y=r.top,n.width=t.width-r.left-r.right,n.height=t.height-r.top-r.bottom,n}function Wle(e){const t="top"!==e.settings.layout.dock&&"bottom"!==e.settings.layout.dock,n=e.stgns.title,r=e.chart.scale(e.stgns.fill),i=e.chart.scale(e.stgns.major),o=function(e,t){const n=t.domain();let r=n,i=e.stgns.tick.label;!i&&e.formatter?i=e.formatter:!i&&t.data().fields&&(i=t.data().fields[0].formatter()),"function"==typeof i&&(r=n.map(i).map(String));const o=n.map(((n,i)=>{const o=r[i];return{value:n,label:o,pos:t.norm(parseFloat(n,10)),textMetrics:e.renderer.measureText({text:o,fontSize:e.stgns.tick.fontSize,fontFamily:e.stgns.tick.fontFamily})}}));return o}(e,i),a=function(e){return jle(e.layout.dock,e.settings.tick.anchor,{left:{valid:["left","right"],default:"left"},right:{valid:["left","right"],default:"right"},top:{valid:["top","bottom"],default:"top"},bottom:{valid:["top","bottom"],default:"bottom"},default:"right"})}(e.settings);if(void 0===n.text){const e=i.data().fields;n.text=e&&e[0]?e[0].title():""}const s=e.renderer.measureText({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily}),l=e.renderer.textBounds({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily,maxLines:n.maxLines,maxWidth:n.maxLengthPx,wordBreak:n.wordBreak,hyphens:n.hyphens,lineHeight:n.lineHeight}),c={isVertical:t,nodes:[],title:{anchor:zle(e.settings),textMetrics:s,textBounds:l,requiredWidth:()=>{if(!n.show)return 0;let e=l.width,r=n.maxLengthPx;return t||(e+=n.padding,r+=n.padding),Math.min(e,r,c.rect.width)},requiredHeight:()=>{if(!n.show)return 0;let e=l.height;return t&&(e+=n.padding),Math.min(e,c.rect.height)}},ticks:{values:o,anchor:a,length:Math.min(Math.max(...o.map((e=>e.textMetrics.width))),e.stgns.tick.maxLengthPx),requiredHeight:()=>"top"===a?Math.max(...c.ticks.values.map((e=>e.textMetrics.height)))+e.stgns.tick.padding:0,height:Math.max(...o.map((e=>e.textMetrics.height)))},legend:{fillScale:r,majorScale:i,length:()=>{const n=t?"height":"width",r=t?"requiredHeight":"requiredWidth",i=Math.min(c.rect[n],c.rect[n]*e.stgns.length)-c.title[r]();return Math.max(0,Math.min(i,e.stgns.maxLengthPx))}}};return c}const $le={require:["chart","settings","renderer"],defaultSettings:{layout:{displayOrder:0,dock:"right"},settings:{size:15,length:.5,maxLengthPx:250,align:.5,justify:0,padding:{left:5,right:5,top:5,bottom:5},tick:{label:null,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,anchor:null,padding:5},title:{show:!0,text:void 0,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,padding:5,maxLines:2,wordBreak:"none",lineHeight:1.2,hyphens:"auto",anchor:null}}},preferredSize(e){const t=this.state;t.rect=Fle(this,e.inner);let n=this.stgns.size;const r=t.isVertical?this.stgns.padding.left+this.stgns.padding.right:this.stgns.padding.top+this.stgns.padding.bottom;n+=r;const i=Math.max(e.inner.width,e.inner.height);if("left"===t.ticks.anchor||"right"===t.ticks.anchor){const e=t.ticks.values.reduce(((e,t)=>e+t.textMetrics.height),0);if(e>this.state.legend.length())return i;n+=t.ticks.length}else{if(t.ticks.length>this.state.legend.length())return i;n+=Math.max(...t.ticks.values.map((e=>e.textMetrics.height)))}return n+=this.stgns.tick.padding,this.stgns.title.show&&(n="left"===t.title.anchor||"right"===t.title.anchor?Math.max(t.title.textBounds.height+r,n):Math.max(n,t.title.requiredWidth()+r)),this.state.preferredSize=n,n},created(){this.stgns=this.settings.settings,this.state=Wle(this)},beforeUpdate(e){this.stgns=e.settings.settings,this.state=Wle(this)},beforeRender(e){if(this.state.nodes=[],this.state.rect=Fle(this,e.size),this.stgns.title.show){const e=function(e){const t=e.state,n=e.stgns,r="left"===t.ticks.anchor,i="top"===t.ticks.anchor;let o=t.rect.x,a=t.rect.y,s="start";"left"===t.title.anchor?(o+=t.title.requiredWidth()-n.title.padding,a+=t.title.textMetrics.height,a+=i?t.rect.height-t.title.textBounds.height:0,s="end"):"right"===t.title.anchor?(o+=t.legend.length(),o+=n.title.padding,a+=t.title.textMetrics.height,a+=i?t.rect.height-t.title.textBounds.height:0):"top"===t.title.anchor&&(o+=r?t.rect.width:0,a+=t.title.textMetrics.height,s=r?"end":"start");const l={tag:"legend-title",type:"text",x:o,y:Math.min(a,t.rect.y+t.rect.height),text:n.title.text,fill:n.title.fill,fontSize:n.title.fontSize,fontFamily:n.title.fontFamily,maxWidth:n.title.maxLengthPx,maxLines:n.title.maxLines,wordBreak:n.title.wordBreak,hyphens:n.title.hyphens,lineHeight:n.title.lineHeight,anchor:s,title:n.title.text};return Nle(e,l),l}(this);this.state.nodes.push(e)}const t=function(e){const t=e.state.legend.fillScale,n=e.state.legend.majorScale,r=t.domain().map((e=>({type:"stop",color:t(e),offset:Math.min(1,Math.max(0,n.norm(e)))})));return r.sort(((e,t)=>e.offset-t.offset))}(this),n=function(e,t){const n=e.state,r=e.stgns,i=n.rect;let o=i.x,a=i.y,s=n.isVertical?r.size:n.legend.length(),l=n.isVertical?n.legend.length():r.size;"left"===n.ticks.anchor?o+=n.rect.width-r.size:"top"===n.ticks.anchor&&(a+=n.rect.height-r.size),"top"===n.title.anchor?a+=n.title.requiredHeight():"left"===n.title.anchor&&(o+=n.title.requiredWidth());const c={type:"rect",x:o,y:a,width:s,height:l,fill:{type:"gradient",stops:t,degree:n.isVertical?90:180}};return Nle(e,c),c}(this,t),r=function(e,t){const n=e.state,r=e.stgns;let i="start";const o={type:"rect",x:t.x,y:t.y,width:n.isVertical?0:t.width,height:n.isVertical?t.height:0,fill:"transparent"},a=n.ticks.values.map((a=>{let s=0,l=0,c=0,u="alphabetical";return n.isVertical?(l=t.y+t.height*a.pos,u=0===a.pos?"text-before-edge":"text-after-edge"):s=t.x+t.width*a.pos,"right"===n.ticks.anchor?(s=t.x+r.size+r.tick.padding,o.x=t.x+t.width):"left"===n.ticks.anchor?(s=t.x-r.tick.padding,i="end"):"top"===n.ticks.anchor?(l=t.y-r.tick.padding,c-=.25*a.textMetrics.height,i=0===a.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=t.y+t.height+r.tick.padding,c=.8*a.textMetrics.height,i=0===a.pos?"start":"end",o.y=t.y+t.height),{type:"text",x:s,y:l,dx:0,dy:c,text:a.label,fontSize:r.tick.fontSize,fontFamily:r.tick.fontFamily,fill:r.tick.fill,maxWidth:n.isVertical?r.tick.maxLengthPx:Math.min(r.tick.maxLengthPx,n.legend.length()/2),anchor:i,textBoundsFn:e.renderer.textBounds,title:a.label,baseline:u}}));return{type:"container",id:"legend-seq-ticks",children:[...a,o]}}(this,n),i={id:"legend-seq-target",type:"container",children:[n,r]};this.state.nodes.push(i)},render(){return this.state.nodes}};const Ble={coordinates:{minor:.5,major:.5,layerId:0,defined:!0},layers:{curve:"linear",show:!0,line:{stroke:"#ccc",strokeWidth:1,strokeLinejoin:"miter",strokeDasharray:void 0,opacity:1,show:!0,showMinor0:!0},area:{fill:"#ccc",opacity:.8,show:!0}}};function Vle(e,t){let{generatorType:n,item:r,data:i,major:o,minor:a,layerObj:s,stngs:l}=t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const u={type:"path",points:e,generatorType:n,major:o,minor:a,layerObj:s,stngs:l,opacity:r.opacity,stroke:r.stroke,strokeWidth:r.strokeWidth,strokeLinejoin:r.strokeLinejoin,fill:c||r.fill,data:i};return r.strokeDasharray&&(u.strokeDasharray=r.strokeDasharray),u}function Hle(e){const{metaLayers:t,coordinates:n,layers:r,lines:i,areas:o}=function(e){let{data:t,stngs:n,rect:r,resolver:i,style:o,domain:a}=e;const{width:s,height:l}=r,c=i.resolve({data:t,defaults:Ble.coordinates,settings:n.coordinates||{},scaled:{major:"vertical"===n.orientation?l:s,minor:"vertical"===n.orientation?s:l}}),u=!n.connect&&a.length>2&&("function"==typeof n.coordinates.layerId||"object"==typeof n.coordinates.layerId),d={};let f=0;for(let e=0;e<c.items.length;e++){let t=c.items[e],n=t.layerId;if(u){const e=d[n]?d[n].items[d[n].items.length-1]:null,r=e?a.indexOf(e.data.major?e.data.major.value:e.data.value):null;e&&a.indexOf(t.data.major?t.data.major.value:t.data.value)-1!==r&&d[n].items.push({dummy:!0})}d[n]=d[n]||{order:f++,id:n,items:[],dataItems:[],consumableData:{}},d[n].dataItems.push(t.data),d[n].items.push(t)}const h=Object.keys(d).map((e=>(d[e].consumableData=c8({points:d[e].dataItems},d[e].dataItems[0]),d[e]))),p={items:h.map((e=>e.consumableData))},m=n.layers||{};return{coordinates:c,metaLayers:h,layers:i.resolve({data:p,defaults:{curve:Ble.layers.curve,show:Ble.layers.show},settings:{curve:m.curve,show:m.show}}),lines:i.resolve({data:p,defaults:o8({},Ble.layers.line,o.line),settings:m.line}),areas:i.resolve({data:p,defaults:o8({},Ble.layers.area,o.area),settings:m.area})}}(e),a=[];return t.forEach(((t,s)=>{const l=r.items[s];if(!1===l.show)return;l.datum=l.data,l.data=[],l.id=t.id;const c=[],u=[];let d,f;for(let r=0;r<t.items.length;r++){if(d=t.items[r],f=d.data,!d.dummy){if(isNaN(d.major))continue;e.missingMinor0&&(d.minor0=n.settings.minor.scale?n.settings.minor.scale(f.minor0?f.minor0.value:0):0),isNaN(d.minor)||c.push(d.minor),l.data.push(d.data)}u.push(d)}const h=c.sort(((e,t)=>e-t))[Math.floor((c.length-1)/2)];a.push({layerObj:l,lineObj:i.items[s],areaObj:o.items[s],median:h,points:u,consumableData:t.consumableData})})),a}const Ule={require:["chart","resolver"],defaultSettings:{style:{area:"$shape",line:"$shape-outline"}},created(){},render(e){let{data:t}=e;const{width:n,height:r}=this.rect;this.stngs=this.settings.settings||{};const i=!this.stngs.coordinates||void 0===this.stngs.coordinates.minor0,o=Hle({data:t,stngs:this.stngs,rect:this.rect,resolver:this.resolver,style:this.style,missingMinor0:i,domain:this.stngs.coordinates&&this.stngs.coordinates.major&&this.stngs.coordinates.major.scale?this.chart.scale(this.stngs.coordinates.major.scale).domain():[]});if(this.stngs.layers&&this.stngs.layers.sort){const e=o.map((e=>({id:e.layerObj.id,data:e.layerObj.data}))).sort(this.stngs.layers.sort).map((e=>e.id));o.sort(((t,n)=>e.indexOf(t.layerObj.id)-e.indexOf(n.layerObj.id)))}else o.sort(((e,t)=>e.median-t.median));return function(e,t){let{width:n,height:r,missingMinor0:i,stngs:o}=t;const a=[],s=o.layers||{};return e.forEach((e=>{const{lineObj:t,layerObj:l,areaObj:c,points:u}=e;let d={size:r,p:"y"},f={size:n,p:"x"};if("vertical"===o.orientation){const e=o8(!0,{},f);f=o8(!0,{},d),d=o8(!0,{},e)}s.area&&!1!==c.show&&a.push(Vle(u,{data:e.consumableData,item:c,generatorType:"area",major:f,minor:d,layerObj:l,stngs:o})),t&&!1!==t.show&&(a.push(Vle(u,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"1"),major:f,minor:d,layerObj:l,stngs:o},"none")),!i&&s.area&&!1!==c.show&&!1!==t.showMinor0&&a.push(Vle(u,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"0"),major:f,minor:d,layerObj:l,stngs:o},"none")))})),a}(o,{width:n,height:r,missingMinor0:i,stngs:this.stngs})}};function Gle(e,t){let n,r,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"object"==typeof t.center?(n=t.center.x,r=t.center.y):(n=t.clientX,r=t.clientY);const o=n-e.state.boundingRect.left,a=r-e.state.boundingRect.top;return{x:i?Math.max(0,Math.min(o,e.rect.width)):o,y:i?Math.max(0,Math.min(a,e.rect.height)):a}}function Yle(e,t){return{x:t.x+e.rect.x,y:t.y+e.rect.y}}function Kle(e,t){const n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(e.x,t.x)-n,height:Math.max(e.y,t.y)-r}}const Xle={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:99},settings:{brush:{components:[]}},style:{area:"$selection-area-target"}},on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaCancel(){this.cancel()}},created(){this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1}},preferredSize:()=>0,render(){},start(e){this.state.boundingRect=this.renderer.element().getBoundingClientRect();const t=Gle(this,e,!1);Eie({x:0,y:0,width:this.rect.width,height:this.rect.height},t)&&(this.state.brushConfig=function(e){return e.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts,data:e.data,action:e.action||"set"})))}(this.settings),this.state.start=Gle(this,e),this.state.active=!0)},move(e){var t;this.state.active&&(this.state.end=Gle(this,e),function(e){if(e.state.active){const t=Yle(e,e.state.start),n=Yle(e,e.state.end),r=e.chart.shapesAt(Kle(t,n),{components:e.state.brushConfig});e.chart.brushFromShapes(r,{components:e.state.brushConfig})}}(this),(t=this).renderer.render([o8({type:"rect"},Kle(t.state.start,t.state.end),t.style.area)]))},end(){this.state.active&&(this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))},cancel(){var e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach((e=>{Array.isArray(e.contexts)&&e.contexts.forEach((e=>{t.brush(e).end()}))})),this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))}};function Jle(e,t,n){let{renderer:r,style:i,props:o,h:a}=n;const s=function(e,t){return{tooltip:"function"==typeof e.tooltipClass?e.tooltipClass({dock:t.dock}):e.tooltipClass,content:"function"==typeof e.contentClass?e.contentClass({dock:t.dock}):e.contentClass,arrow:"function"==typeof e.arrowClass?e.arrowClass({dock:t.dock}):e.arrowClass}}(o,t),l=function(e,t,n,r){return r.content({h:e,style:n,data:t})}(a,e,i,o),c=a("div",{dir:o.direction,class:Rle(o8({"pic-tooltip":!0},s.tooltip)),style:o8({position:"relative",display:"inline-block"},t.computedTooltipStyle)},a("div",{style:i.content,class:Rle(o8({"pic-tooltip-content":!0},s.content))},l),a("div",{class:Rle(o8({"pic-tooltip-arrow":!0},s.arrow)),style:o8({},i.arrow,i["arrow-".concat(t.dock)],t.computedArrowStyle)}));return r.render(c),r.element().children[0]}function Qle(e){let{defaultDuration:t,defaultDelay:n}=e,r=null,i=null,o=!1;const a=function(){const e=function(){},t={pending:[],debounced:[],active:[],cancelled:[],rejected:[],fulfilled:[]};let n;return e.set=e=>{n=e,t[n].forEach((t=>t(e)))},e.on=(e,n)=>{Array.isArray(e)?e.forEach((e=>t[e].push(n))):t[e].push(n)},e.destroy=()=>{Object.keys(t).forEach((e=>{t[e].length=0}))},e}(),s=function(){},l=()=>{r=null,i=null,o=!1,a.set("fulfilled")};return s.invoke=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;r&&(clearTimeout(r),a.set("debounced")),a.set("pending"),r=setTimeout((()=>{e(),o=!0,r=null,a.set("active")}),c),s>0&&(i&&clearTimeout(i),i=setTimeout(l,s+Math.max(c,0)))},s.clear=()=>{o?a.set("cancelled"):r&&(clearTimeout(r),a.set("rejected")),i&&clearTimeout(i),r=null,i=null,o=!1},s.on=(e,t)=>{a.on(e,t)},s.destroy=()=>{s.clear(),a.destroy()},s}function Zle(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{left:"translate(-100%,-50%) translateX(".concat(-e,"px)"),right:"translate(".concat(e,"px, -50%)"),top:"translate(-50%, -100%) translateY(".concat(-e,"px)"),bottom:"translate(-50%, ".concat(e,"px)"),inside:"translate(-50%, -50%)"}}function ece(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{left:{x:-e-n,y:-t/2},right:{x:n,y:-t/2},top:{x:-e/2,y:-t-n},bottom:{x:-e/2,y:n},inside:{x:-e/2,y:-t/2}}}function tce(e,t){const n=e>0?"-":"+";return e=Math.abs(e),void 0===t&&(t=e),{left:{left:"100%",top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},right:{left:"".concat(2*-e,"px"),top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},top:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"100%",borderWidth:"".concat(t,"px")},bottom:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"".concat(2*-e,"px"),borderWidth:"".concat(t,"px")},inside:{left:"0px",top:"0px",borderWidth:"0px"}}}function nce(e,t,n,r,i,o){const a=t+o.x,s=n+o.y,l=i;return!(a<0||s<0)&&!(a+r>e.width||s+l>e.height)}function rce(e){let{area:t,vx:n,vy:r,width:i,height:o,offset:a}=e;const s=n+a.x,l=r+a.y,c=i,u=o;let d=s<0?-s:0,f=l<0?-l:0;return d+=s+c>t.width?-(s+c-t.width):0,f+=l+u>t.height?-(l+u-t.height):0,{x:d,y:f}}function ice(e){let{options:t,pointer:n,width:r,height:i,dockOrder:o,x:a,y:s}=e;const{targetBounds:l}=n,c=Zle(t.offset),u=c[t.dock];if(u)return{computedTooltipStyle:{left:"".concat(a,"px"),top:"".concat(s,"px"),transform:u},computedArrowStyle:tce(t.offset)[t.dock],dock:t.dock};const d={width:"target"===t.area?l.width:window.innerWidth,height:"target"===t.area?l.height:window.innerHeight},f=ece(r,i,t.offset),h=[],p="target"===t.area?a:l.left+a,m="target"===t.area?s:l.top+s;for(let e=0;e<o.length;e+=1){const n=o[e],l=rce({area:d,vx:p,vy:m,width:r,height:i,offset:f[n]}),u={left:"".concat(a,"px"),top:"".concat(s,"px"),transform:c[n]},g=tce(t.offset)[n];0!==l.x&&(u.width="".concat(r-20-Math.abs(l.x),"px"),"top"!==n&&"bottom"!==n||(u.left="".concat(a+l.x,"px"),g.left="calc(50% ".concat(l.x>0?"-":"+"," ").concat(Math.abs(l.x),"px)")));const y={computedTooltipStyle:u,computedArrowStyle:g,dock:n,rect:{width:r,height:i}};if(0===l.x&&0===l.y)return y;y.offset=l,h.push(y)}return h.sort(((e,t)=>Math.abs(e.offset.x)-Math.abs(t.offset.x))),h[0]}function oce(e,t,n){const r=e.key?n.component(e.key):n.componentsFromPoint({x:t.clientX,y:t.clientY})[0];if(!r)return{x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1}};const i=r.rect;return o8({scaleRatio:i.scaleRatio},i.computedInner)}const ace={bounds:function(e){let{resources:t,nodes:n,pointer:r,width:i,height:o,options:a}=e;const{targetBounds:s}=r,{x:l,y:c,width:u,height:d}=t.getNodeBoundsRelativeToTarget(n[0]),f={left:{x:l,y:c+d/2},right:{x:l+u,y:c+d/2},top:{x:l+u/2,y:c},bottom:{x:l+u/2,y:c+d},inside:{x:l+u/2,y:c+d/2}},h=Zle(a.offset),p=h[a.dock];if(p)return{computedTooltipStyle:{left:"".concat(f[a.dock].x,"px"),top:"".concat(f[a.dock].y,"px"),transform:p},computedArrowStyle:tce(a.offset)[a.dock],dock:a.dock};const m={width:"target"===a.area?s.width:window.innerWidth,height:"target"===a.area?s.height:window.innerHeight},g=ece(i,o,a.offset),y=["top","left","right","bottom","inside"];for(let e=0;e<y.length;e+=1){const t=y[e];if(nce(m,"target"===a.area?f[t].x:s.left+f[t].x,"target"===a.area?f[t].y:s.top+f[t].y,i,o,g[t]))return{computedTooltipStyle:{left:"".concat(f[t].x,"px"),top:"".concat(f[t].y,"px"),transform:h[t]},computedArrowStyle:tce(a.offset)[t],dock:t}}const v=function(e){let{options:t,docks:n,dockOffsets:r,targetBounds:i,area:o,width:a}=e;const s="top",l="target"===t.area?n[s].x:i.left+n[s].x,c=("target"===t.area?n[s].y:(i.top,n[s].y),r[s]),u=l+c.x,d=(c.y,a);let f=n.top.x;return u<0&&u+d>o.width||(u<0?f-=u:u+d>o.width&&(f-=u+d-o.width)),f}({options:a,docks:f,dockOffsets:g,targetBounds:s,area:m,width:i});return{computedTooltipStyle:{left:"".concat(v,"px"),top:"".concat(f.top.y,"px"),transform:h.top},computedArrowStyle:tce(a.offset+v-f.top.x,a.offset).top,dock:"top"}},pointer:function(e){let{options:t,pointer:n,width:r,height:i}=e;const{x:o,y:a}=n;return ice({x:o,y:a,pointer:n,width:r,height:i,options:t,dockOrder:["top","left","right","bottom"]})},slice:function(e){let{options:t,pointer:n,width:r,height:i,nodes:o,resources:a}=e;const s=o[0],{dx:l,dy:c}=n,u=a.getComponentBoundsFromNode(s),d=l+u.x+u.width/2,f=c+u.y+u.height/2,{start:h,end:p,outerRadius:m}=s.desc.slice,g=(h+p)/2-Math.PI/2,y=2*Math.PI,v=(g%y+y)%y;let b=["top","left","right","bottom"];return"auto"===t.dock&&(b=v<=Math.PI/4||v>=7*Math.PI/4?["right","top","bottom","left"]:v<=3*Math.PI/4?["bottom","left","right","top"]:v<=5*Math.PI/4?["left","top","bottom","right"]:["top","left","right","bottom"]),ice({x:d+m*u.scaleRatio.x*Math.cos(v),y:f+m*u.scaleRatio.y*Math.sin(v),pointer:n,width:r,height:i,options:t,dockOrder:b})}};function sce(e,t){let{width:n,height:r}=e,{chart:i,state:o,props:a}=t;const s={resources:{formatter:i.formatter,scale:i.scale,component:i.component,getComponentBoundsFromNode:e=>oce(e,o.pointer,i),getNodeBoundsRelativeToTarget:e=>function(e,t,n){const r=oce(e,t,n),i=e.bounds;return{x:r.x+t.dx+i.x,y:r.y+t.dy+i.y,width:i.width,height:i.height}}(e,o.pointer,i)},nodes:o.activeNodes,pointer:o.pointer,width:n,height:r},l=typeof a.placement;if("object"===l&&"function"==typeof a.placement.fn)return a.placement.fn(s);let c={type:"pointer",offset:8,dock:"auto",area:"viewport"};"function"===l&&(c=o8(c,a.placement(s))),"object"===l&&ace[a.placement.type]?c=o8(c,a.placement):"string"===l&&ace[a.placement]&&(c=o8(c,{type:a.placement})),s.options=c;const u=ace[c.type](s);let{x:d,y:f,width:h,height:p}=s.resources.getComponentBoundsFromNode(s.nodes[0]);return d+=s.pointer.dx,h+=d,f+=s.pointer.dy,p+=f,u.computedTooltipStyle.left="".concat(Math.min(Math.max(0,d,parseFloat(u.computedTooltipStyle.left)),h),"px"),u.computedTooltipStyle.top="".concat(Math.min(Math.max(0,f,parseFloat(u.computedTooltipStyle.top)),p),"px"),u}let lce;function cce(){lce=null}const uce={duration:8e3,delay:500,filter:e=>e.filter((e=>e.data&&void 0!==e.data.value)),extract:e=>e.node.data.value,content:e=>{let{h:t,data:n}=e;return n.map((e=>t("div",{},e)))},isEqual:(e,t)=>e.length&&e.length===t.length&&e.every(((e,n)=>t[n]&&JSON.stringify(e.data)===JSON.stringify(t[n].data))),placement:{type:"pointer",dock:"auto",offset:8,area:"viewport"},tooltipClass:{},contentClass:{},arrowClass:{},direction:"ltr",appendTo:void 0,beforeShow:void 0,afterShow:void 0,beforeHide:void 0,onHide:void 0,afterHide:void 0};const dce={require:["chart","renderer"],defaultSettings:{settings:uce,style:{tooltip:{},content:{backgroundColor:"$gray-25",color:"$font-color--inverted",fontFamily:"$font-family",fontSize:"$font-size",lineHeight:"$line-height",borderRadius:"4px",padding:"8px",opacity:.9},arrow:{position:"absolute",width:"0px",height:"0px",borderStyle:"solid",color:"$gray-25",opacity:.9},"arrow-bottom":{borderTopColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-top":{borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-right":{borderTopColor:"transparent",borderLeftColor:"transparent",borderBottomColor:"transparent"},"arrow-left":{borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent"}}},renderer:"dom",on:{hide(){this.hide()},show(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.show(e,t)},prevent(e){this.prevent(e)}},hide(){this.dispatcher.clear(),this.state.activeNodes=[],this.state.pointer={}},show(e){let t,{nodes:n,duration:r,delay:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!this.state.prevent&&this.state.targetElement&&(this.state.pointer=function(e,t){let{chart:n,state:r}=t,i=0,o=0;e.center?(i+=e.center.x,o+=e.center.y):(i+=e.clientX,o+=e.clientY);const a=n.element.getBoundingClientRect(),s=r.targetElement.getBoundingClientRect(),l=i,c=o,u=a.left-s.left,d=a.top-s.top,f=i-a.left,h=o-a.top;return i-=s.left,o-=s.top,{x:i,y:o,dx:u,dy:d,cx:f,cy:h,clientX:l,clientY:c,targetBounds:s,chartBounds:a}}(e,this),t=Array.isArray(n)?this.props.filter(n):this.props.filter(this.chart.shapesAt({x:this.state.pointer.cx,y:this.state.pointer.cy})),this.props.isEqual(this.state.activeNodes,t)||(this.dispatcher.clear(),this.state.activeNodes=t,this.state.activeNodes.length&&this.dispatcher.invoke((()=>this.invokeRenderer(this.state.activeNodes)),r,i)))},prevent(e){this.state.prevent=!!e},init(e){this.state={activeNodes:[],pointer:{},targetElement:null,prevent:!1},this.props=e.settings,this.dispatcher=Qle({defaultDuration:this.props.duration,defaultDelay:this.props.delay});const t=this.dispatcher.clear;this.dispatcher.on("pending",(()=>{!function(e){lce&&lce!==e&&lce()}(t),lce=t,"function"==typeof this.props.beforeShow&&this.props.beforeShow.call(void 0,{resources:{formatter:this.chart.formatter,scale:this.chart.scale}})})),this.dispatcher.on(["cancelled","fulfilled"],(()=>{const e={resources:{formatter:this.chart.formatter,scale:this.chart.scale}};"function"==typeof this.props.beforeHide&&this.props.beforeHide.call(void 0,o8({element:this.state.tooltipElm},e)),"function"==typeof this.props.onHide?this.props.onHide.call(void 0,o8({element:this.state.tooltipElm},e)):this.renderer.clear([]),"function"==typeof this.props.afterHide&&this.props.afterHide.call(void 0,e),lce===t&&(lce=null),this.state.tooltipElm=void 0})),this.dispatcher.on("active",(()=>{"function"==typeof this.props.afterShow&&this.props.afterShow.call(void 0,{element:this.state.tooltipElm,resources:{formatter:this.chart.formatter,scale:this.chart.scale}})}))},created(){this.init(this.settings)},beforeUpdate(e){let{settings:t}=e;this.dispatcher&&(this.dispatcher.destroy(),cce()),this.init(t)},render(e){return this.h=e,[]},beforeDestroy(){this.dispatcher.destroy(),cce()},appendTo(){if(this.props.appendTo){this.state.targetElement="function"==typeof this.props.appendTo?this.props.appendTo({resources:{formatter:this.chart.formatter,scale:this.chart.scale}}):this.props.appendTo;const{width:e,height:t}=this.state.targetElement.getBoundingClientRect();this.renderer.destroy(),this.renderer.size({width:e,height:t}),this.renderer.appendTo(this.state.targetElement)}else this.state.targetElement=this.renderer.element()},mounted(){this.appendTo()},updated(){this.appendTo()},invokeRenderer(e){const t=function(e,t){let{chart:n,scale:r,props:i,h:o}=t;const a={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:r,h:o},s=[];return e.forEach((e=>{if("function"==typeof i.extract){const t=o8({node:e},a);s.push(i.extract(t))}})),s}(e,this),n=sce(Jle(t,{},this).getBoundingClientRect(),this);this.state.tooltipElm=Jle(t,n,this)}};const fce={require:["renderer","chart"],defaultSettings:{settings:{target:"",selector:"*",fill:"rgba(0, 255, 0, 0.1)",stroke:"lime",opacity:1,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes(this.props.selector).filter((e=>e.key===this.props.target)),t=e.filter((e=>e.collider)).map((e=>e.collider));t.forEach((e=>{e.fill=this.props.fill,e.stroke=this.props.stroke,e.opacity=this.props.opacity,e.collider={type:null}})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var hce={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},pce=/([astvzqmhlc])([^astvzqmhlc]*)/gi,mce=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function gce(e){const t=[],n=String(e).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(pce,((e,n,r)=>{const i=function(e){const t=e.match(mce);return t?t.map(Number):[]}(r);let o=n.toLowerCase(),a=n;if("m"===o&&i.length>2&&(t.push([a,...i.splice(0,2)]),o="l",a="m"===a?"l":"L"),i.length<hce[o])return"";for(t.push([a,...i.splice(0,hce[o])]);i.length>=hce[o]&&i.length&&hce[o];)t.push([a,...i.splice(0,hce[o])]);return""})),t}const yce=2*Math.PI;function vce(e,t){return{x:.5*(e.x+t.x),y:.5*(e.y+t.y)}}function bce(e,t,n,r,i){const o=1-e;return o**3*t+3*o**2*e*n+3*o*e**2*r+e**3*i}function xce(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8;if(o<1||function(e,t,n,r){return Math.abs(e.x+n.x-(t.x+t.x))+Math.abs(e.y+n.y-(t.y+t.y))+Math.abs(t.x+r.x-(n.x+n.x))+Math.abs(t.y+r.y-(n.y+n.y))}(e,t,n,r)<=10)return i[i.length-1]!==e&&i.push(e),i.push(r),i;const a=vce(e,t),s=vce(t,n),l=vce(n,r),c={x:bce(.5,e.x,t.x,n.x,r.x),y:bce(.5,e.y,t.y,n.y,r.y)},u=vce(a,s),d=vce(s,l);return xce(e,a,u,c,i,o-1),xce(c,d,l,r,i,o-1),i}function wce(e,t,n){const{cp1:r,cp2:i}=function(e,t,n){return{cp1:{x:e.x+2/3*(t.x-e.x),y:e.y+2/3*(t.y-e.y)},cp2:{x:n.x+2/3*(t.x-n.x),y:n.y+2/3*(t.y-n.y)}}}(e,t,n);return xce(e,r,i,n)}function Sce(e,t,n){const r=[],i=!!e[4],o=!!e[5],a=e[3];let s,l,c,u,d=e[6],f=e[7],h=e[1],p=e[2];if("a"===e[0]&&(d+=t,f+=n),t===f&&n===f)return r;if(!h||!p)return r.push({x:d,y:f}),r;({cx:s,cy:l,rx:h,ry:p,sweepAngle:c,startAngle:u}=function(e,t,n,r,i,o,a,s,l){let c,u,d,f,h,p;const m=Fre(n%360),g=Math.cos(m),y=Math.sin(m),v=(s-o)/2,b=(l-a)/2,x=g*v+y*b,w=g*b-y*v;p=x**2/(e=Math.abs(e))**2+w**2/(t=Math.abs(t))**2,p>1&&(p=Math.sqrt(p),e*=p,t*=p);const S=e*w,C=t*x,k=S**2+C**2,E=(e*t)**2-k;let M=Math.sqrt(Math.max(E/k,0));r===i&&(M=-M);const _=M*(S/t),R=M*(-C/e);f=g*_-y*R+(s+o)/2,h=y*_+g*R+(l+a)/2;const I=(x-_)/e,D=(w-R)/t,P=(-x-_)/e,A=(-w-R)/t;return c=Math.atan2(D,I),c+=c<0?yce:0,u=Math.atan2(A,P),u+=u<0?yce:0,d=u-c,!i&&c<u?d-=yce:i&&u<c&&(d+=yce),d%=yce,{startAngle:c,sweepAngle:d,cx:f,cy:h,rx:e,ry:t}}(h,p,a,i,o,d,f,t,n));const m=Math.abs(c*Math.sqrt((h**2+p**2)/2)),g=Math.ceil(m/10),y=c/g;for(let e=1;e<=g;e++){const t=(u+y*e)%yce,n=Math.cos(t),i=Math.sin(t);r.push({x:s+n*h+-i*n,y:l+i*p+n*i})}return r}function Cce(e){const t=gce(e),n=[],r=[];let i=0,o=0,a=null,s=null,l=null,c=null;for(let e=0;e<t.length;++e){const u=t[e],d=u[0];switch("S"!==d&&"s"!==d&&"C"!==d&&"c"!==d&&(a=null,s=null),"T"!==d&&"t"!==d&&"Q"!==d&&"q"!==d&&(l=null,c=null),d){case"m":r.length&&n.push(r.splice(0));case"l":i+=u[1],o+=u[2],r.push({x:i,y:o});break;case"M":r.length&&n.push(r.splice(0));case"L":i=u[1],o=u[2],r.push({x:i,y:o});break;case"H":i=u[1],r.push({x:i,y:o});break;case"h":i+=u[1],r.push({x:i,y:o});break;case"V":o=u[1],r.push({x:i,y:o});break;case"v":o+=u[1],r.push({x:i,y:o});break;case"a":r.push(...Sce(u,i,o)),i+=u[6],o+=u[7];break;case"A":r.push(...Sce(u,i,o)),i=u[6],o=u[7];break;case"c":r.push(...xce({x:i,y:o},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o},{x:u[5]+i,y:u[6]+o})),a=u[3]+i,s=u[4]+o,i+=u[5],o+=u[6];break;case"C":r.push(...xce({x:i,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]},{x:u[5],y:u[6]})),a=u[3],s=u[4],i=u[5],o=u[6];break;case"s":null!==a&&null!==a||(a=i,s=o),r.push(...xce({x:i,y:o},{x:2*i-a,y:2*o-s},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o})),a=u[1]+i,s=u[2]+o,i+=u[3],o+=u[4];break;case"S":null!==a&&null!==a||(a=i,s=o),r.push(...xce({x:i,y:o},{x:2*i-a,y:2*o-s},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),a=u[1],s=u[2],i=u[3],o=u[4];break;case"Q":r.push(...wce({x:i,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),l=u[1],c=u[2],i=u[3],o=u[4];break;case"q":r.push(...wce({x:i,y:o},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o})),l=u[1]+i,c=u[2]+o,i+=u[3],o+=u[4];break;case"T":null!==l&&null!==l||(l=i,c=o),l=2*i-l,c=2*o-c,r.push(...wce({x:i,y:o},{x:l,y:c},{x:u[1],y:u[2]})),i=u[1],o=u[2];break;case"t":null!==l&&null!==l||(l=i,c=o),l=2*i-l,c=2*o-c,r.push(...wce({x:i,y:o},{x:l,y:c},{x:u[1]+i,y:u[2]+o})),i+=u[1],o+=u[2];break;case"z":case"Z":r.length&&r.push({x:r[0].x,y:r[0].y})}}return function(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];Math.abs(n.x-r.x)<1e-12&&Math.abs(n.y-r.y)<1e-12&&(e.splice(t,1),t--)}}(r),n.push(r.splice(0)),n}const kce={require:["renderer","chart"],defaultSettings:{settings:{target:"",fill:"transparent",stroke:"lime",opacity:1,radius:2,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes("path").filter((e=>e.key===this.props.target)),t=[];e.forEach((e=>{Cce(e.attrs.d).forEach((e=>{e.forEach((e=>{t.push({type:"circle",cx:e.x,cy:e.y,r:this.props.radius,fill:this.props.fill,stroke:this.props.stroke,opacity:this.props.opacity,collider:{type:null}})}))}))})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var Ece=[function(e){e.component("box",Eoe),e.component("box-marker",Eoe)},function(e){e.component("point",Ooe),e.component("point-marker",Ooe)},function(e){e.component("pie",Noe)},function(e){e.component("grid-line",$oe)},function(e){e.component("ref-line",Zoe)},function(e){e.component("axis",Rae)},function(e){e.component("container",Iae)},function(e){e.component("text",Aae)},function(e){e.component("scrollbar",Tae)},function(e){e.component("brush-range",Xae),e.component("brush-area-dir",ese)},function(e){e.component("range",ise)},function(e){e.component("brush-lasso",use)},function(e){e.component("labels",Cle)},function(e){e.component("legend-cat",qle)},function(e){e.component("legend-seq",$le)},function(e){e.component("line",Ule)},function(e){e.component("brush-area",Xle)},function(e){e.component("tooltip",dce)},function(e){e.component("debug-collider",fce)},function(e){e.component("debug-path-to-points",kce)}];let Mce=class{constructor(e){this._parent=null,this._children=[],this._ancestors=null,this.type=e,this.data=null}detach(){return this._parent&&this._parent.removeChild(this),this}get parent(){return this._parent}get isBranch(){return this._children&&this._children.length}get children(){return this._children}get ancestors(){return this._ancestors||(this._ancestors=[],this.parent&&this._ancestors.push(this.parent,...this.parent.ancestors)),this._ancestors}get descendants(){let e=[];const t=this.children.length;let n,r;for(n=0;n<t;n++)r=this.children[n],e.push(r),r.children.length&&(e=[...e,...r.descendants]);return e}equals(e){const t=this.children,n=e.children;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(!t[e].equals(n[e]))return!1;return!0}toJSON(){return{type:this.type,children:this.children.map((e=>e.toJSON()))}}};class _ce{constructor(){let{x:e=0,y:t=0,width:n=0,height:r=0,minWidth:i=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x:e,y:t,width:n,height:r,minWidth:i,minHeight:o})}set(){let{x:e=0,y:t=0,width:n=0,height:r=0,minWidth:i=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="rect",n>=0?(this.x=e,this.width=Math.max(n,i)):(this.x=e+Math.min(n,-i),this.width=-Math.min(n,-i)),r>=0?(this.y=t,this.height=Math.max(r,o)):(this.y=t+Math.min(r,-o),this.height=-Math.min(r,-o))}containsPoint(e){return Eie(this,e)}intersectsLine(e){return Mie(this,y8(e))}intersectsRect(e){return Cie(this,g8(e))}intersectsCircle(e){return yie(e,this)}intersectsPolygon(e){return Sie(e,this)}intersectsGeoPolygon(e){return Lie(e,this)}points(){return[{x:this.x,y:this.y},{x:this.x+this.width,y:this.y},{x:this.x+this.width,y:this.y+this.height},{x:this.x,y:this.y+this.height}]}}class Rce{constructor(){let{cx:e=0,cy:t=0,r:n=0,minRadius:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({cx:e,cy:t,r:n,minRadius:r})}set(){let{cx:e=0,cy:t=0,r:n=0,minRadius:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="circle",this.cx=e,this.cy=t,this.r=Math.max(n,r),this.vector={x:this.cx,y:this.cy}}containsPoint(e){return gie(this,e)}intersectsLine(e){return vie(this,y8(e))}intersectsRect(e){return yie(this,g8(e))}intersectsCircle(e){return n=e,!fie(t=this)&&!fie(n)&&(t.cx-n.cx)**2+(t.cy-n.cy)**2<=(t.r+n.r)**2;var t,n}intersectsPolygon(e){return bie(this,e)}intersectsGeoPolygon(e){return Pie(this,e)}points(){return[{x:this.cx,y:this.cy}]}}class Ice{constructor(){let{x1:e=0,y1:t=0,x2:n=0,y2:r=0,tolerance:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x1:e,y1:t,x2:n,y2:r,tolerance:i})}set(){let{x1:e=0,y1:t=0,x2:n=0,y2:r=0,tolerance:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="line",this.x1=e,this.y1=t,this.x2=n,this.y2=r,this.tolerance=Math.max(0,Math.round(i)),this.vectors=this.points(),this.zeroSize=e===n&&t===r}containsPoint(e){if(this.tolerance>0){return vie({cx:e.x,cy:e.y,r:this.tolerance},this)}return Rie(this,e)}intersectsLine(e){return _ie(this,y8(e))}intersectsRect(e){return Mie(g8(e),this)}intersectsCircle(e){return vie(e,this)}intersectsPolygon(e){return wie(e,this)}intersectsGeoPolygon(e){return Oie(e,this)}points(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}class Dce{constructor(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polygon",this.vertices=e.slice(),this.edges=[],function(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}(this.vertices),!(this.vertices.length<=2)){!function(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}(this.vertices),this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.vertices.length;e++)e<this.vertices.length-1&&this.edges.push([this.vertices[e],this.vertices[e+1]]),this.xMin=isNaN(this.xMin)?this.vertices[e].x:Math.min(this.xMin,this.vertices[e].x),this.xMax=isNaN(this.xMax)?this.vertices[e].x:Math.max(this.xMax,this.vertices[e].x),this.yMin=isNaN(this.yMin)?this.vertices[e].y:Math.min(this.yMin,this.vertices[e].y),this.yMax=isNaN(this.yMax)?this.vertices[e].y:Math.max(this.yMax,this.vertices[e].y);this._bounds=null,this._boundingRect=null}}containsPoint(e){return xie(this,e)}intersectsCircle(e){return bie(e,this)}intersectsLine(e){return wie(this,y8(e))}intersectsRect(e){return Sie(this,g8(e))}intersectsPolygon(e){return Iie(this,e)}intersectsGeoPolygon(e){return Die(e,this)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function Pce(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Dce(...t)}function Ace(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function Oce(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}class Lce{constructor(){let{vertices:e=[[]]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="geopolygon",this.vertices=e.slice(),this.numPolygons=this.vertices.length,this.polygons=[],this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.numPolygons;e++)Oce(this.vertices[e]),this.vertices[e].length>2&&Ace(this.vertices[e]),this.polygons[e]=Pce({vertices:this.vertices[e]}),this.xMin=isNaN(this.xMin)?this.polygons[e].xMin:Math.min(this.xMin,this.polygons[e].xMin),this.xMax=isNaN(this.xMax)?this.polygons[e].xMax:Math.max(this.xMax,this.polygons[e].xMax),this.yMin=isNaN(this.yMin)?this.polygons[e].yMin:Math.min(this.yMin,this.polygons[e].yMin),this.yMax=isNaN(this.yMax)?this.polygons[e].yMax:Math.max(this.yMax,this.polygons[e].yMax);this._bounds=null,this._boundingRect=null}containsPoint(e){return Aie(this,e)}intersectsCircle(e){return Pie(e,this)}intersectsLine(e){return Oie(this,y8(e))}intersectsRect(e){return Lie(this,g8(e))}intersectsPolygon(e){return Die(this,e)}intersectsGeoPolygon(e){return function(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!Cie(n,r)&&(kie(r,n)?mie(t,e):mie(e,t))}(this,e)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function Tce(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Lce(...t)}class qce{constructor(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({points:e})}set(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polyline",this.segments=[],this._points=e.slice(),this._points.length>1)for(let e=0,r=this._points.length-1;e<r;e++)t=this._points[e],n=this._points[e+1],(t.x!==n.x||t.y!==n.y)&&this.segments.push({x1:this._points[e].x,y1:this._points[e].y,x2:this._points[e+1].x,y2:this._points[e+1].y});var t,n}containsPoint(e){return this.segments.some((t=>Rie(t,e)))}intersectsCircle(e){return this.segments.some((t=>vie(e,t)))}intersectsLine(e){const t=y8(e);return this.segments.some((e=>_ie(e,t)))}intersectsRect(e){const t=g8(e);return this.segments.some((e=>Mie(t,e)))}intersectsPolygon(e){return this.segments.some((t=>wie(e,t)))}intersectsGeoPolygon(e){return this.segments.some((t=>Oie(e,t)))}points(){return this._points}}const Nce=S7();function jce(e,t){return Nce.get(e)(t)}Nce.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new _ce(...t)})),Nce.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Rce(...t)})),Nce.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Ice(...t)})),Nce.add("polygon",Pce),Nce.add("geopolygon",Tce),Nce.add("polyline",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new qce(...t)}));class zce{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.geometries=[],e.forEach((e=>{const t=jce(e.type,e);t&&this.geometries.push(t)}))}containsPoint(e){return this.geometries.some((t=>t.containsPoint(e)))}intersectsLine(e){return this.geometries.some((t=>t.intersectsLine(e)))}intersectsRect(e){return this.geometries.some((t=>t.intersectsRect(e)))}intersectsCircle(e){return this.geometries.some((t=>t.intersectsCircle(e)))}intersectsPolygon(e){return this.geometries.some((t=>t.intersectsPolygon(e)))}intersectsGeoPolygon(e){return this.geometries.some((t=>t.intersectsGeoPolygon(e)))}}class Fce{constructor(){this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}clone(){return(new Fce).multiply(this)}set(e){return this._elements=e,this}save(){return this._stack.push(this.elements),this}restore(){return this._stack.length&&(this._elements=this._stack.pop()),this}add(e){let t,n;for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]+=e;return this}translate(e,t){return this.multiply([[1,0,e],[0,1,t],[0,0,1]]),this}rotate(e){let t=Math.cos(-e),n=Math.sin(-e);return this.multiply([[t,n,0],[-n,t,0],[0,0,1]]),this}multiply(e){let t,n,r,i;if(e instanceof Fce&&(e=e._elements),Array.isArray(e)){for(r=[[0,0,0],[0,0,0],[0,0,0]],t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)for(i=0;i<3;i++)r[t][n]+=this._elements[t][i]*e[i][n];this._elements=r}else for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]*=e;return this}scale(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.multiply([[e,0,0],[0,t,0],[0,0,1]]),this}transform(e,t,n,r,i,o){return this.multiply([[e,n,i],[t,r,o],[0,0,1]]),this}determinant(){let e=this._elements[0][0],t=this._elements[0][1],n=this._elements[0][2],r=this._elements[1][0],i=this._elements[1][1],o=this._elements[1][2],a=this._elements[2][0],s=this._elements[2][1],l=this._elements[2][2],c=0;return c=e*i*l+t*o*a+n*r*s-n*i*a-t*r*l-e*o*s,c}invert(){let e=this.determinant(),t=this._elements[0][0],n=this._elements[0][1],r=this._elements[0][2],i=this._elements[1][0],o=this._elements[1][1],a=this._elements[1][2],s=this._elements[2][0],l=this._elements[2][1],c=this._elements[2][2];return this._elements=[[o*c-a*l,r*l-n*c,n*a-r*o],[a*s-i*c,t*c-r*s,r*i-t*a],[i*l-o*s,s*n-t*l,t*o-n*i]],this.multiply(1/e),this}transpose(){const e=Object.create(this._elements);return this._elements=[[e[0][0],e[1][0],e[2][0]],[e[0][1],e[1][1],e[2][1]],[e[0][2],e[1][2],e[2][2]]],this}identity(){return this._elements=[[1,0,0],[0,1,0],[0,0,1]],this}toString(){return"".concat(this._elements.map((e=>e.join("\t"))).join("\n"))}isIdentity(){const e=this._elements;return 1===e[0][0]&&0===e[0][1]&&0===e[0][2]&&0===e[1][0]&&1===e[1][1]&&0===e[1][2]&&0===e[2][0]&&0===e[2][1]&&1===e[2][2]}transformPoint(e){let t,n,r=[e.x,e.y,1],i=this._elements,o=[0,0,0];for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)o[t]+=r[n]*i[t][n];return{x:o[0],y:o[1]}}transformPoints(e){let t,n,r,i,o,a=this._elements,s=[];for(i=0;i<e.length;i++){for(t=[e[i].x,e[i].y,1],o=[0,0,0],n=0;n<this._elements.length;n++)for(r=0;r<this._elements[n].length;r++)o[n]+=t[r]*a[n][r];s.push({x:o[0],y:o[1]})}return s}get elements(){const e=this._elements;return[[e[0][0],e[0][1],e[0][2]],[e[1][0],e[1][1],e[1][2]],[e[2][0],e[2][1],e[2][2]]]}}const Wce=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function $ce(e,t){const n=t.args[0]*(Math.PI/180);if(t.args.length>2){const r=t.args[1],i=t.args[2];e.translate(r,i),e.rotate(n),e.translate(-r,-i)}else 1===t.args.length&&e.rotate(n)}function Bce(e,t){const n=t.args[0],r=isNaN(t.args[1])?t.args[0]:t.args[1];e.scale(n,r)}function Vce(e,t){const n=t.args[0],r=isNaN(t.args[1])?0:t.args[1];e.translate(n,r)}function Hce(e,t){t.args.length>=6&&e.transform(...t.args)}function Uce(e,t){const n=function(e){let t,n=[];for(;null!==(t=Wce.exec(e));){const e=t[2].trim(),r=-1===e.indexOf(",")?e.split(" "):e.split(",");n.push({cmd:t[1],args:r.filter((e=>e.trim().length>0)).map((e=>Number(e)))})}return n}(e);let r;for(let e=0,i=n.length;e<i;e++)r=n[e],"rotate"===r.cmd?$ce(t,r):"scale"===r.cmd?Bce(t,r):"matrix"===r.cmd?Hce(t,r):"translate"===r.cmd&&Vce(t,r)}const Gce={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},Yce={type:(e,t)=>t.filter((t=>{const n=t.type;return!!n&&n.toLowerCase()===e.toLowerCase()})),attr:(e,t,n,r)=>r.filter((r=>{const i=r.attrs[e];if(!t)return void 0!==i;if(void 0===i)return!1;switch(t){case"=":return n===String(i);case"!=":return n!==String(i);default:return!1}})),universal:e=>e,tag:(e,t)=>t.filter((t=>{const n=t.tag;return!!n&&-1!==n.trim().split(/\s+/).indexOf(e.replace(".",""))}))};function Kce(e,t){if(!t||!t.length||!e||"function"!=typeof Yce[e.type])return[];switch(e.type){case"type":case"tag":return Yce[e.type](e.value,t);case"attr":return Yce[e.type](e.attribute,e.operator,e.attributeValue,t);case"universal":return Yce[e.type](t);default:return[]}}var Xce={find:function(e,t){const n=[],r=[];let i,o;if(t.isBranch){let a;i=function(e){const t=[];let n,r,i,o;return e.split(/\s*,\s*/).forEach((e=>{e=e.trim(),n=[];const a=t=>{i=e.match(Gce[t]),i&&(o=!0,e=e.slice(i[0].length),r={type:t,value:i[0]},"attr"===t&&(i=i[0].match(/\[(\w[\w\._-]+)?(?:([!]?=)['\"]([\w\s#_-]*)['\"])?\]/),r.attribute=i[1],r.operator=i[2],r.attributeValue=i[3]),n.push(r))};for(;e&&(o=!1,i=e.match(/^\s*([>+~]|\s)\s*/),i&&(o=!0,n.push({type:" ",value:i[0]}),e=e.slice(i[0].length)),Object.keys(Gce).forEach(a),n&&n.length&&t.indexOf(n)<0&&t.push(n),o););})),t}(e),o=t.descendants;for(let e=0,t=i.length;e<t;e++){a=i[e];const t=[];let n=o.slice(),s=!1;a.reverse().forEach((e=>{if(" "===e.type)return t.push(n),n=o.slice(),void(s=!1);n=Kce(e,n),s=!0})),s&&t.push(n);const l=t[0].filter((e=>{let n,r=e.parent;for(let e=1;e<t.length;e++){for(n=t[e].indexOf(r);r&&n<0;)r=r.parent,n=t[e].indexOf(r);if(n<0)return!1}return!0}));r.push(l)}for(let e=0,t=r.length;e<t;e++)for(let t=0,i=r[e].length;t<i;t++)n.indexOf(r[e][t])<0&&n.push(r[e][t])}return n||[]}};function Jce(e,t,n){const r=e.type;let i=e.points();n&&(i=i.every((e=>Array.isArray(e)))?i.map((e=>n.transformPoints(e))):n.transformPoints(i)),function(e,t){for(let n=0,r=e.length;n<r;n++)e[n].x/=t,e[n].y/=t}(i,t);let o=null;if("rect"===r||"bounds"===r)o=g8(i),o.type=r;else if("circle"===r)o=function(e,t){return{cx:e[0].x,cy:e[0].y,r:t}}(i,e.r),o.type=r;else if("line"===r)o=y8(i),o.type=r;else if("polygon"===r||"polyline"===r){o={type:"path",d:jre(i,"polygon"===r)}}else if("geopolygon"===r){let e="";for(let t=0;t<i.length;t++)e+=jre(i[t],!0);o={type:"path",d:e}}return o}class Qce{constructor(e){this._bounds=function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const{x:n,y:r,width:i,height:o}=e.boundingRect?e.boundingRect(t):{x:0,y:0,width:0,height:0};return{x:n,y:r,width:i,height:o}},this._attrs=e.attrs,this._type=e.type,this._data=e.data,this._dpi=e.stage?e.stage.dpi:1,this._collider=()=>function(e,t){if(e.collider){const n=e.modelViewMatrix;return"collection"===e.colliderType?{type:"container",children:e.collider.geometries.map((e=>Jce(e,t,n)))}:Jce(e.collider,t,n)}return null}(e,this._dpi),this._desc=e.desc,this._tag=e.tag,this._children=()=>e.children.map((e=>new Qce(e))),this._parent=()=>e.parent?new Qce(e.parent):null,this._cache={elementBoundingRect:null},this._getElementBoundingRect=()=>(!this._cache.elementBoundingRect&&this.element&&(this._cache.elementBoundingRect=this.element.getBoundingClientRect()),this._cache.elementBoundingRect||{left:0,top:0})}get children(){return this._children()}get parent(){return this._parent()}get type(){return this._type}get data(){return this._data}get attrs(){return this._attrs}set element(e){this._cache.elementBoundingRect=null,this._element=e}get element(){return this._element}set key(e){this._key=e}get key(){return this._key}get bounds(){const e=this._bounds();return e.x/=this._dpi,e.y/=this._dpi,e.width/=this._dpi,e.height/=this._dpi,e}get localBounds(){return this._bounds(!1)}boundsRelativeTo(e){const t=typeof e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.bounds:this.localBounds,r=this._getElementBoundingRect();let i=r.left,o=r.top;if("object"===t&&null!==e&&"function"==typeof e.getBoundingClientRect){const{left:t=0,top:n=0}=e.getBoundingClientRect();i-=t,o-=n}return n.x+=i,n.y+=o,n}get collider(){return this._collider()}get desc(){return this._desc}get tag(){return this._tag}}function Zce(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Qce(...t)}class eue{constructor(e){this._node=Zce(e),this._parent=null,this._input=null}get node(){return this._node}set parent(e){this._parent=e}get parent(){return this._parent}set input(e){this._input=e}get input(){return this._input}}function tue(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new eue(...t)}function nue(e,t){const n=e.parent;if(n&&"stage"!==n.type){t.parent=tue(n);const e=n.parent;e&&"stage"!==e.type&&nue(e,t.parent)}}function rue(e,t,n){if(null===e.colliderType)return null;const r=function(e,t){let n={};if(e.modelViewMatrix)if(Array.isArray(t))n=e.inverseModelViewMatrix.transformPoints(t);else if(isNaN(t.r))Array.isArray(t.vertices)?n.vertices=e.inverseModelViewMatrix.transformPoints(t.vertices):n=e.inverseModelViewMatrix.transformPoint(t);else{const r={x:t.cx,y:t.cy};({x:n.cx,y:n.cy}=e.inverseModelViewMatrix.transformPoint(r)),n.r=t.r}else n=t;return Array.isArray(n.vertices)&&(n=n.vertices.every((e=>Array.isArray(e)))?Tce(n):Pce(n)),n}(e,n);return"frontChild"===e.colliderType?function(e,t,n){for(let r=e.descendants.length-1;r>=0;r--){const i=e.descendants[r];if(null!==i.collider&&i.collider[t](n)){const e=tue(i);return nue(i,e),e}}return null}(e,t,r):function(e,t,n){if(e.collider[t](n)){const t=tue(e);return nue(e,t),t}return null}(e,t,r)}function iue(e,t,n,r){const i=e.length;for(let o=0;o<i;o++){const i=e[o],a=rue(i,t,r);a&&n.push(a),!i.children||a||i.collider||iue(i.children,t,n,r)}}function oue(e,t,n){const r=e.length;for(let i=0;i<r;i++){const r=e[i];if(null!==rue(r,t,n))return!0;if(r.children&&!r.collider)return oue(r.children,t,n)}return!1}function aue(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;let n={};switch(v8(e)){case"circle":return n.cx=e.cx*t,n.cy=e.cy*t,n.r=e.r,["intersectsCircle",n];case"rect":return n=m8(e).map((e=>Vre(e,t))),["intersectsRect",n];case"line":return n=p8(e).map((e=>Vre(e,t))),["intersectsLine",n];case"point":return n=Vre(e,t),["containsPoint",n];case"polygon":return n.vertices=e.vertices.map((e=>Vre(e,t))),["intersectsPolygon",n];case"geopolygon":return n.vertices=e.vertices.map((e=>e.map((e=>Vre(e,t))))),["intersectsGeoPolygon",n];default:return[]}}function sue(e,t){const[n,r]=aue(t,e.dpi),i=[];return n&&(iue([e],n,i,r),function(e,t){for(let n=0,r=t.length;n<r;n++)t[n].input=e}(t,i)),i}function lue(e,t){const[n,r]=aue(t,e.dpi);return oue([e],n,r)}class cue extends Mce{constructor(e){super(e),this._stage=null,this._collider={type:null,definition:null,fn:null},this._attrs={},this._node=null}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.node=e;const{data:t,desc:n,tag:r,strokeReference:i,fillReference:o}=e;!function(e,t){Object.keys(Nre).forEach((n=>{const r=t[n];void 0!==r&&(e[Nre[n]]=r)}))}(this.attrs,e),void 0!==t&&(this.data=t),"object"==typeof n&&(this.desc=o8(!0,{},n)),"string"==typeof r&&(this.tag=r),"string"==typeof i&&(this.strokeReference=i),"string"==typeof o&&(this.fillReference=o)}findShapes(e){return Xce.find(e,this).map((e=>Zce(e)))}getItemsFrom(e){return sue(this,e)}containsPoint(e){return lue(this,e)}intersectsLine(e){return lue(this,e)}intersectsRect(e){return lue(this,e)}intersectsCircle(e){return lue(this,e)}intersectsPolygon(e){return lue(this,e)}intersectsGeoPolygon(e){return lue(this,e)}resolveLocalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Fce;void 0!==this.attrs.transform&&Uce(this.attrs.transform,e),this.modelViewMatrix=e.clone()}resolveGlobalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Fce;const t=this.ancestors;if(t.length>0)for(let n=t.length-1;n>=0;n--)t[n].resolveLocalTransform(e),e=t[n].modelViewMatrix;this.resolveLocalTransform(e)}attr(e){return this.attrs[e]}equals(e){const t=this.attrs,n=Object.keys(t),r=e.attrs,i=Object.keys(r);if(n.length!==i.length)return!1;for(let e=0;e<n.length;e++){const i=n[e];if(!Object.hasOwnProperty.call(r,i))return!1;if(t[i]!==r[i])return!1}return super.equals(e)}toJSON(){const e=super.toJSON();return e.attrs=this.attrs,e}get attrs(){return this._attrs}get stage(){return this._parent&&!this._stage?this._stage=this._parent.stage:this._parent||this._stage===this||(this._stage=null),this._stage}set modelViewMatrix(e){this._mvm=e,this._imvm=null}get modelViewMatrix(){return this._mvm}get inverseModelViewMatrix(){return this._imvm=this._imvm?this._imvm:this._mvm.clone().invert(),this._imvm}set node(e){this._node=e}get node(){return this._node}set collider(e){const t=Array.isArray(e)?"collection":e&&e.type;return"string"!=typeof t?(this._collider.type=null,this._collider.definition=null,void(this._collider.fn=null)):null!==this._collider&&this._collider.type===t&&null!==this._collider.fn?(this._collider.fn.set(e),void(this._collider.definition=e)):(this._collider.type=t,void(this._collider.definition=e))}get collider(){if(null!==this._collider.fn)return this._collider.fn;switch(this._collider.type){case"collection":this._collider.fn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new zce(...t)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=jce("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=jce(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn}get colliderType(){return this._collider.type}}class uue extends Mce{addChild(e){if(!(e&&e instanceof Mce))throw new TypeError("Expecting a Node as argument, but got ".concat(e));if(e===this)throw new Error("Can not add itself as child!");if(e._children&&e._children.length&&this.ancestors.indexOf(e)>=0)throw new Error("Can not add an ancestor as child!");return e._parent&&e._parent!==this&&e._parent.removeChild(e),this._children.push(e),e._parent=this,e._ancestors=null,this}addChildren(e){let t,n=e?e.length:0;for(t=0;t<n;t++)this.addChild(e[t]);return this}removeChild(e){const t=this._children.indexOf(e);return t>=0&&(this._children.splice(t,1),e._parent=null,e._ancestors=null),this}removeChildren(e){let t,n;if(!this._children)return this;if(e)for(n=e.length,t=0;t<n;t++)this.removeChild(e[t]);else for(;this._children.length;)this.removeChild(this._children[0]);return this}}const due=uue.prototype;class fue extends cue{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const{collider:t}=e,n=o8({type:null},t);this.collider=n,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}appendChildRect(e,t){if(void 0!==e.bounds){const n=this.__boundingRect[t]||{},[r,,i]=e.bounds(t),{x:o,y:a}=r,{x:s,y:l}=i,c=isNaN(n.width)?s:Math.max(s,n.width+n.x),u=isNaN(n.height)?l:Math.max(l,n.height+n.y);n.x=isNaN(n.x)?o:Math.min(o,n.x),n.y=isNaN(n.y)?a:Math.min(a,n.y),n.width=c-n.x,n.height=u-n.y,this.__boundingRect[t]=n}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.children.length;for(let n=0;n<t;n++)this.appendChildRect(this.children[n],e);return this.__boundingRect[e]=o8({x:0,y:0,width:0,height:0},this.__boundingRect[e]),this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}addChild(e){const t=due.addChild.call(this,e);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(e,!0);const t=o8({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}addChildren(e){const t=due.addChildren.call(this,e),n=e.length;if(this._collider&&"bounds"===this._collider.type&&n>0){for(let t=0;t<n;t++)this.appendChildRect(e[t],!0);const t=o8({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;if(due.removeChild.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=o8(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}removeChildren(e){if(due.removeChildren.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=o8(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}}function hue(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new fue(...t)}class pue extends fue{constructor(e){super("stage"),this._stage=this,this._dpiRatio=e||1}get dpi(){return this._dpiRatio}}const mue=uue.prototype,gue=["x1","x2","y1","y2","id","offset","style"];class yue extends cue{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let r=0,i=gue.length;r!==i;r++)n=gue[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return mue.addChild.call(this,e)}addChildren(e){return mue.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return mue.removeChild.call(this,e),this}removeChildren(e){return mue.removeChildren.call(this,e),this}}function vue(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new yue(...t)}const bue=uue.prototype,xue=["patternUnits","x","y","width","height","id"];class wue extends cue{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let r=0,i=xue.length;r!==i;r++)n=xue[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return bue.addChild.call(this,e)}addChildren(e){return bue.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return bue.removeChild.call(this,e),this}removeChildren(e){return bue.removeChildren.call(this,e),this}}class Sue extends cue{constructor(){super("rect"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,width:r=0,height:i=0,rx:o=0,ry:a=0,collider:s}=e,l=o8({type:"rect",x:t,y:n,width:r,height:i},s);super.set(e),r>=0?(this.attrs.x=t,this.attrs.width=r):(this.attrs.x=t+r,this.attrs.width=-r),i>=0?(this.attrs.y=n,this.attrs.height=i):(this.attrs.y=n+i,this.attrs.height=-i),o>0&&(this.attrs.rx=o),a>0&&(this.attrs.ry=a),this.collider=l,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=m8(this.attrs),n=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t,[r,i,o,a]=h8(n);return this.__boundingRect[e]={x:r,y:i,width:o-r,height:a-i},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}class Cue extends cue{constructor(){super("circle"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{cx:t=0,cy:n=0,r:r=0,collider:i}=e,o=o8({type:"circle",cx:t,cy:n,r:r},i);super.set(e),this.attrs.cx=t,this.attrs.cy=n,this.attrs.r=r,this.collider=o,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.bounds(e);return this.__boundingRect[e]={x:t[0].x,y:t[0].y,width:t[2].x-t[0].x,height:t[2].y-t[0].y},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const{cx:t,cy:n,r:r,r:i}=this.attrs,o=t-r,a=n-i;let s=2*r,l=2*i,c=[{x:o,y:a},{x:o+s,y:a},{x:o+s,y:a+l},{x:o,y:a+l}];if(e&&this.modelViewMatrix){c=this.modelViewMatrix.transformPoints(c);const[t,n,r,i]=h8(c);s=r-t,l=i-n,this.__bounds[e]=[{x:t,y:n},{x:t+s,y:n},{x:t+s,y:n+l},{x:t,y:n+l}]}else this.__bounds[e]=c;return this.__bounds[e]}}class kue extends cue{constructor(){super("line"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x1:t=0,y1:n=0,x2:r=0,y2:i=0,collider:o}=e;super.set(e),this.attrs.x1=t,this.attrs.y1=n,this.attrs.x2=r,this.attrs.y2=i;const a={type:"line",x1:t,y1:n,x2:r,y2:i};this.collider=o8(a,o),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];let t=p8(this.attrs);e&&this.modelViewMatrix&&(t=this.modelViewMatrix.transformPoints(t));const[n,r,i,o]=h8(t),a=n!==i||r!==o;return this.__boundingRect[e]={x:n,y:r,width:a?Math.max(1,i-n):0,height:a?Math.max(1,o-r):0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}const Eue=Math.PI/2;function Mue(e,t){const n=Math.atan2(t.y-e.y,t.x-e.x);return n<0?n+2*Math.PI:n}function _ue(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}const Rue={step:function(e){return new g7(e,.5)},stepAfter:function(e){return new g7(e,1)},stepBefore:function(e){return new g7(e,0)},linear:G8,basis:function(e){return new t7(e)},cardinal:i7.tension(0),catmullRom:a7,monotonex:function(e){return new d7(e)},monotoney:function(e){return new f7(e)},natural:function(e){return new p7(e)}};function Iue(e){if(e.length<2)return!1;const t=e[0],n=e[e.length-1];return Math.abs(t.x-n.x)<1e-12&&Math.abs(t.y-n.y)<1e-12}class Due extends cue{constructor(){super("path"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(super.set(e),this.segments=[],this.points=[],e.arcDatum){const t=H8();t.innerRadius(e.desc.slice.innerRadius),t.outerRadius(e.desc.slice.outerRadius),t.cornerRadius(e.desc.slice.cornerRadius);const n=t(e.arcDatum);this.attrs.d=n}else if(e.points){const{major:t,minor:n,layerObj:r,points:i,stngs:o,generatorType:a}=e,s=X8(),l=o.coordinates?o.coordinates.defined:null;s[t.p]((e=>e.major*t.size))["".concat(n.p,"1")]((e=>e.minor*n.size))["".concat(n.p,"0")]((e=>e.minor0*n.size)).curve(Rue["monotone"===r.curve?"monotone".concat(t.p):r.curve]),l?s.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)&&e.defined)):s.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)));const c=o.connect?i.filter(s.defined()):i,u=("area"===a?s:s[a]())(c);this.attrs.d=u}else e.d&&(this.attrs.d=e.d);if(this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},Array.isArray(e.collider)||"object"==typeof e.collider&&void 0!==e.collider.type)this.collider=e.collider;else if(this.attrs.d){if(this.segments=Cce(this.attrs.d),this.segments.length>1&&this.segments.every((e=>Iue(e))))return void(this.collider=o8({type:"geopolygon",vertices:this.segments},e.collider));this.segments.forEach((t=>{if(t.length<=1);else if(Iue(t))this.collider=o8({type:"polygon",vertices:t},e.collider);else if("object"==typeof e.collider&&e.collider.visual){const n=this.attrs["stroke-width"]/2;this.collider=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=[],i=[];if("h"===n.forceOrientation){const t=e[0].x<e[1].x?-1:1,n=e[e.length-1].x>e[e.length-2].x?1:-1;e.unshift({x:e[0].x+t,y:e[0].y}),e.push({x:e[e.length-1].x+n,y:e[e.length-1].y})}else if("v"===n.forceOrientation){const t=e[0].y<e[1].y?-1:1,n=e[e.length-1].y>e[e.length-2].y?1:-1;e.unshift({x:e[0].x,y:e[0].y+t}),e.push({x:e[e.length-1].x,y:e[e.length-1].y+n})}const o=e.length-1;for(let n=1;n<o;n++){const a=e[n-1],s=e[n],l=e[n+1],c=Mue(s,a),u=Mue(s,l),d=(c+u)/2,f=d+Math.PI,h=Math.max(d,f),p=Math.min(d,f),m=c>u;if(1===n){const e=Mue(a,s);r.push(_ue(a,e-Eue,t)),i.unshift(_ue(a,e+Eue,t))}const g=m?h:p,y=m?p:h;if(r.push(_ue(s,g,t)),i.unshift(_ue(s,y,t)),n===o-1){const e=Mue(l,s);r.push(_ue(l,e+Eue,t)),i.unshift(_ue(l,e-Eue,t))}}return{type:"polygon",vertices:[...r,...i]}}(t,n,e.collider)}else this.collider=o8({type:"polyline",points:t},e.collider)}))}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];this.points.length||(this.segments=this.segments.length?this.segments:Cce(this.attrs.d),this.points=function(e){const t=[];let n,r=e.length;for(let i=0;i<r;i++){n=e[i];for(let e=0;e<n.length;e++)t.push(n[e])}return t}(this.segments));const t=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(this.points):this.points,[n,r,i,o]=h8(t);return this.__boundingRect[e]={x:n||0,y:r||0,width:i-n||0,height:o-r||0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}function Pue(e){let{data:t,_boundingRect:n,_textBoundsFn:r}=e;return null!=t&&(n||r)}let Aue=class extends cue{constructor(){super("text"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,dx:r=0,dy:i=0,textBoundsFn:o,text:a,title:s,collider:l,boundingRect:c,ellipsed:u}=e;super.set(e),this.attrs.x=t,this.attrs.y=n,this.attrs.dx=r,this.attrs.dy=i,this.attrs.text=a,void 0!==s&&(this.attrs.title=String(s)),"object"==typeof c?this._textBoundsFn=()=>c:"function"==typeof o&&(this._textBoundsFn=o),"string"==typeof u&&(this.ellipsed=u),this.collider=o8({type:Pue(this)?"bounds":null},l),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];if("function"!=typeof this._textBoundsFn)return{x:0,y:0,width:0,height:0};e=this._textBoundsFn(this.attrs);const n=m8(e),r=t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(n):n,[i,o,a,s]=h8(r);return this.__boundingRect[t]={x:i,y:o,width:a-i,height:s-o},this.__boundingRect[t]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}};class Oue extends cue{constructor(){super("image"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,width:r=0,height:i=0,rx:o=0,ry:a=0,src:s,collider:l,cx:c=0,cy:u=0,r:d=0,opacity:f,imageScalingFactor:h,imagePosition:p,symbol:m}=e;let g;g="circle"===e.symbol?o8({type:"circle",cx:c,cy:u,r:d},l):o8({type:"bounds",x:t,y:n,width:r,height:i},l),super.set(e),r>=0?(this.attrs.x=t,this.attrs.width=r):(this.attrs.x=t+r,this.attrs.width=-r),i>=0?(this.attrs.y=n,this.attrs.height=i):(this.attrs.y=n+i,this.attrs.height=-i),o>0&&(this.attrs.rx=o),a>0&&(this.attrs.ry=a),s&&(this.attrs.src=s),this.attrs.r=d,this.attrs.cx=c,this.attrs.cy=u,this.attrs.opacity=void 0!==f?f:1,this.attrs.imageScalingFactor=void 0!==h?h:1,this.attrs.imagePosition=p||"center-center",this.attrs.symbol=m||"rectangle",this.collider=g,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},e.collider||(this.attrs.updateCollider=this.updateCollider.bind(this))}updateCollider(e){let t;t="circle"===e.symbol?o8(this.collider,{type:"circle",cx:e.cx,cy:e.cy,r:e.r}):o8(this.collider,{type:"bounds",x:e.x,y:e.y,width:e.width,height:e.height}),this.collider=t}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=m8(this.attrs),n=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t,[r,i,o,a]=h8(n);return this.__boundingRect[e]={x:r,y:i,width:o-r,height:a-i},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];if("circle"===this._node.symbol){const t=this.boundingRect(e),n=Math.min(t.width,t.height)/2,r=t.x-n,i=t.y-n;let o=2*n,a=2*n,s=[{x:r,y:i},{x:r+o,y:i},{x:r+o,y:i+a},{x:r,y:i+a}];if(e&&this.modelViewMatrix){s=this.modelViewMatrix.transformPoints(s);const[t,n,r,i]=h8(s);o=r-t,a=i-n,this.__bounds[e]=[{x:t,y:n},{x:t+o,y:n},{x:t+o,y:n+a},{x:t,y:n+a}]}else this.__bounds[e]=s;return this.__bounds[e]}const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}const Lue=S7();function Tue(e,t){return Lue.get(e)(t)}Lue.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Sue(...t)})),Lue.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Cue(...t)})),Lue.add("text",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Aue(...t)})),Lue.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new kue(...t)})),Lue.add("path",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Due(...t)})),Lue.add("stage",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new pue(...t)})),Lue.add("container",hue),Lue.add("defs",hue),Lue.add("linearGradient",vue),Lue.add("radialGradient",vue),Lue.add("conicGradient",vue),Lue.add("stop",vue),Lue.add("pattern",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new wue(...t)})),Lue.add("image",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Oue(...t)}));const que=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=[{}];function n(){return t[t.length-1]}return n.save=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i=n(),o={};let a="";for(let t=0;t<e.length;t++)a=e[t],void 0!==i[a]&&(o[a]=i[a]);return o8(o,r),t.push(o),n()},n.restore=function(){t.splice(t.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function Nue(e,t){if(Array.isArray(t))for(let n=0,r=t.length;n<r;n++)t[n](e)}function jue(e,t,n){e.node=n[t],e.index=t}function zue(e,t,n,r){let i=!1;const o={siblings:e,node:null,index:0};for(let a=0,s=e.length;a<s;a++){if(jue(o,a,e),Nue(o,r.create),i="function"==typeof o.node.disabled?o.node.disabled():o.node.disabled,i)continue;o.node=que.save(o.node);const s=Tue(o.node.type,o.node);s&&(o.node.transform&&(n.save(),Uce(o.node.transform,n)),n.isIdentity()||(s.modelViewMatrix=n.clone()),t.addChild(s),o.node.children&&zue(o.node.children,s,n,r),o.node.transform&&n.restore()),que.restore()}}function Fue(e){let{items:t,stage:n,dpi:r,on:i={}}=e;return n||(n=Tue("stage",r)),zue(t,n,new Fce,i),n}function Wue(e,t,n){const{orientation:r,degree:i,stops:o=[]}=n;let a=null;if("radial"===r){const n=t.boundingRect();a=e.createRadialGradient(n.x+n.width/2,n.y+n.height/2,1e-5,n.x+n.width/2,n.y+n.height/2,Math.max(n.width,n.height)/2)}else if("conic"===r){const t=n.startAngle||0,r=n.x||0,i=n.y||0;a=e.createConicGradient(t,r,i)}else{const r=Wre(i);["x1","x2","y1","y2"].forEach((e=>{e in n&&(r[e]=n[e])}));const o=t.boundingRect();a=e.createLinearGradient(o.x+r.x1*o.width,o.y+r.y1*o.height,o.x+r.x2*o.width,o.y+r.y2*o.height)}for(let e=0,t=o.length;e<t;e++){let t=o[e];a.addColorStop(t.offset,t.color)}return a}function $ue(e,t,n){return t.width=e.width,t.height=e.height,n.save(),n.fillStyle=e.fill,e.shapes.forEach((e=>{if("rect"===e.type)n.rect(e.x,e.y,e.width,e.height)})),n.fill(),n.restore(),n.createPattern(t,"repeat")}function Bue(){let{x:e,y:t,width:n,height:r,scaleRatio:i,margin:o,edgeBleed:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const s={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0},edgeBleed:{left:0,right:0,top:0,bottom:0,bool:!1}};return s.x=isNaN(e)?s.x:e,s.y=isNaN(t)?s.y:t,s.width=isNaN(n)?s.width:n,s.height=isNaN(r)?s.height:r,void 0!==i&&(s.scaleRatio.x=isNaN(i.x)?s.scaleRatio.x:i.x,s.scaleRatio.y=isNaN(i.y)?s.scaleRatio.y:i.y),void 0!==o&&(s.margin.left=isNaN(o.left)?0:o.left,s.margin.top=isNaN(o.top)?0:o.top),"object"==typeof a&&["left","right","top","bottom"].forEach((e=>{!isNaN(a[e])&&a[e]>0&&(s.edgeBleed[e]=a[e],s.edgeBleed.bool=!0)})),s.computedPhysical={x:Math.round(s.margin.left+(s.x-s.edgeBleed.left)*s.scaleRatio.x),y:Math.round(s.margin.top+(s.y-s.edgeBleed.top)*s.scaleRatio.y),width:Math.round((s.width+s.edgeBleed.left+s.edgeBleed.right)*s.scaleRatio.x),height:Math.round((s.height+s.edgeBleed.top+s.edgeBleed.bottom)*s.scaleRatio.y)},s}function Vue(){const e={element:()=>{},root:()=>{},settings:()=>{},appendTo:()=>{},getScene:()=>[],render:()=>!1,itemsAt:()=>[],findShapes:()=>[],clear:()=>{},destory:()=>{},size:()=>{},measureText:mle,textBounds:yle,setKey:t=>{e.element().setAttribute("data-key",t)}};return e}function Hue(e){return t=>{let{node:n}=t;"text"!==n.type||null==n.data||n.textBoundsFn||(n.textBoundsFn=e.textBounds)}}const Uue=200,Gue=200;class Yue{constructor(e){this.targetCanvas=e,this.bufferCanvas=e.cloneNode()}updateSize(e){let t,{rect:n,dpiRatio:r,canvasBufferSize:i}=e;t=i?"function"==typeof i?i(n):i:{width:n.computedPhysical.width+2*Uue,height:n.computedPhysical.height+2*Gue},this.bufferCanvas.style.width="".concat(t.width,"px"),this.bufferCanvas.style.height="".concat(t.height,"px"),this.bufferCanvas.width=Math.round(t.width*r),this.bufferCanvas.height=Math.round(t.height*r)}apply(){this.targetCanvas.getContext("2d").drawImage(this.bufferCanvas,0,0)}clear(){this.bufferCanvas.width=this.bufferCanvas.width}getContext(){return this.bufferCanvas.getContext("2d")}}const Kue=S7();function Xue(e){return Array.isArray(e)?e:"string"==typeof e?-1!==e.indexOf(",")?e.split(","):e.split(" "):[]}function Jue(e){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}function Que(e,t){t.setTransform(e[0][0],e[1][0],e[0][1],e[1][1],e[0][2],e[1][2])}function Zue(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=Object.keys(r);for(let i=0,o=n.length;i<o;i++){let o=n[i];const a=o[0],s=o[1],l=o[2];if(a in t.attrs&&!(s in r)&&e[s]!==t.attrs[a]){const n=l?l(t.attrs[a]):t.attrs[a];"function"==typeof e[s]?e[s](n):e[s]=n}}for(let t=0,n=i.length;t<n;t++){const n=i[t];e[n]=r[n]}}function ede(e,t,n,r){for(let i=0,o=e.length;i<o;i++){let o=e[i],a={};t.save(),o.attrs&&(o.attrs.fill||o.attrs.stroke)&&(o.attrs.fill&&"object"==typeof o.attrs.fill&&"gradient"===o.attrs.fill.type?a.fillStyle=Wue(t,o,o.attrs.fill):o.attrs.fill&&"object"==typeof o.attrs.fill&&"pattern"===o.attrs.fill.type&&(a.fillStyle=r.patterns.create(o.attrs.fill)),o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"gradient"===o.attrs.stroke.type?a.strokeStyle=Wue(t,o,o.attrs.stroke):o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"pattern"===o.attrs.stroke.type&&(a.strokeStyle=r.patterns.create(o.attrs.stroke))),Zue(t,o,n,a),o.modelViewMatrix&&Que(o.modelViewMatrix.elements,t),Kue.has(o.type)&&Kue.get(o.type)(o.attrs,{g:t,doFill:"fill"in o.attrs&&"none"!==o.attrs.fill,doStroke:"stroke"in o.attrs&&0!==o.attrs["stroke-width"],ellipsed:o.ellipsed}),o.children&&ede(o.children,t,n,r),t.restore()}}function tde(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Fue;const r={transform:void 0,canvasBufferSize:void 0,progressive:void 0};let i,o=!1,a=Bue();const s=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",Xue]];let l;const c=Vue();return c.element=()=>e,c.root=()=>e,c.settings=e=>(e&&Object.keys(r).forEach((t=>{void 0!==e[t]&&(r[t]=e[t])})),r),c.appendTo=n=>(e||(e=n.ownerDocument.createElement("canvas"),e.style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none"),"function"!=typeof r.transform||t||(t=new Yue(e)),n.appendChild(e),e),c.getScene=r=>{const i=Jue(t&&t.getContext()||e.getContext("2d")),o=a.scaleRatio.x,s=a.scaleRatio.y,l={type:"container",children:r,transform:a.edgeBleed.bool?"translate(".concat(a.edgeBleed.left*i*o,", ").concat(a.edgeBleed.top*i*s,")"):""};return 1===i&&1===o&&1===s||(l.transform+="scale(".concat(i*o,", ").concat(i*s,")")),n({items:[l],dpi:i,on:{create:[ole(c.measureText),Hue(c)]}})},c.render=n=>{if(!e)return!1;l||(l=function(e){const t=e.createElement("canvas"),n=t.getContext("2d");let r={};return{create(e){const i=e.key;return i?(r[i]=r[i]||$ue(e,t,n),r[i]):$ue(e,t,n)},clear(){r={}}}}(e.ownerDocument));const u=t&&t.getContext()||e.getContext("2d"),d=Jue(u),f=t&&r.transform();if(f)return e.width=e.width,function(e){let{el:t,dpiRatio:n,transform:r}=e;if("object"==typeof r){const e=[r.horizontalScaling,r.horizontalSkewing,r.verticalSkewing,r.verticalScaling,r.horizontalMoving*n,r.verticalMoving*n];t.getContext("2d").setTransform(...e)}}({el:e,dpiRatio:d,transform:f}),t.apply(),!0;o&&(e.style.left="".concat(a.computedPhysical.x,"px"),e.style.top="".concat(a.computedPhysical.y,"px"),e.style.width="".concat(a.computedPhysical.width,"px"),e.style.height="".concat(a.computedPhysical.height,"px"),e.width=Math.round(a.computedPhysical.width*d),e.height=Math.round(a.computedPhysical.height*d),t&&t.updateSize({rect:a,dpiRatio:d,canvasBufferSize:r.canvasBufferSize}));const h=c.getScene(n),p=!i||!h.equals(i);l.clear();const m=o||p,g="function"==typeof r.progressive&&r.progressive();return m&&(g&&!g.isFirst||c.clear(),ede(h.children,u,s,{patterns:l})),t&&(e.width=e.width,t.apply()),o=!1,g&&!g.isFirst&&h.children.unshift(...i.children),i=h,m},c.itemsAt=e=>i?i.getItemsFrom(e):[],c.findShapes=e=>i?i.findShapes(e):[],c.clear=()=>(e&&(e.width=e.width),t&&t.clear(),i=null,c),c.size=e=>{if(e){const t=Bue(e);JSON.stringify(a)!==JSON.stringify(t)&&(o=!0,a=t)}return a},c.destroy=()=>{e&&(e.parentElement&&e.parentElement.removeChild(e),e=null),t&&(t=null),i=null},c}function nde(e,t){Kue.add(e,t)}function rde(e,t){return Math.max(0,Math.min(e,t))}const ide=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),ode=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),ade=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function sde(e){return ide.test(e)}function lde(e){return ode.test(e)||ade.test(e)}function cde(e){let t,n,r=e?e.length:0;for(t=0;t<r;t++){if(n=e[t],sde(n))return"ltr";if(lde(n))return"rtl"}return"ltr"}const ude={start:"end",end:"start",center:"center",middle:"middle"};function dde(e,t){return"rtl"===t?ude[e]:e}function fde(e,t){if(fde.cache[e])return void t(fde.cache[e]);const n=new Image;n.src=e,n.onload=()=>{fde.cache[e]=n,t(n)},n.onerror=e=>{console.error("Image load error",e)}}function hde(e,t){const n=[];let r;const i=[],o=[],a=[];let s,l;const c=e=>e.id,u=(e,t)=>{let n;return n="object"==typeof e?"id"in e?e.id:t:e,{content:e,id:"".concat(n,"__").concat(e.type||"")}};e.isTree||(e=e.map(u)),t=t.map(u),s=e.map(c),l=t.map(c);for(let e=0,r=t.length;e<r;e++){-1===s.indexOf(t[e].id)?n.push(t[e]):o.push(t[e])}for(let t=0,n=e.length;t<n;t++){-1===l.indexOf(e[t].id)?i.push(e[t]):a.push(e[t])}for(let e=0,t=n.length;e<t;e++)n[e].content.children&&(n[e].diff=hde([],n[e].content.children),n[e].children=n[e].diff.updatedNew.concat(n[e].diff.added),n[e].children.isTree=!0);for(let e=0,t=o.length;e<t;e++)o[e].diff=hde(a[e].children||[],o[e].content.children||[]),o[e].object=a[e].object,o[e].children=o[e].diff.items;return r=o.concat(n),n.isTree=!0,i.isTree=!0,o.isTree=!0,a.isTree=!0,r.isTree=!0,{added:n,updatedNew:o,updatedOld:a,removed:i,items:r}}function pde(e,t,n){for(let r=0,i=e.length;r<i;r++)e[r].object=n(e[r].content.type,t)}function mde(e,t){for(let n=0,r=e.length;n<r;n++)null!==e[n].object&&void 0!==e[n].object&&(t(e[n].object),e[n].object=null)}function gde(e,t,n,r){let i;for(let o=0,a=e.length;o<a;o++)i=e[o],null!==i.object&&void 0!==i.object&&(n(i.object,i.content),i.diff&&(pde(i.diff.added,i.object,t),mde(i.diff.removed,r),gde(i.diff.items,t,n,r)))}function yde(e,t,n,r,i,o){const a=hde(e,t);return pde(a.added,n,r),mde(a.removed,o),gde(a.items,r,i,o),a.items}fde.cache={},nde("rect",(function(e,t){let{g:n,doFill:r,doStroke:i}=t;n.beginPath(),e.rx>0||e.ry>0?function(e,t,n,r,i,o,a){o=rde(r/2,o>0?o:a),a=rde(i/2,a>0?a:o),e.moveTo(t,n+a),e.lineTo(t,n+i-a),e.quadraticCurveTo(t,n+i,t+o,n+i),e.lineTo(t+r-o,n+i),e.quadraticCurveTo(t+r,n+i,t+r,n+i-a),e.lineTo(t+r,n+a),e.quadraticCurveTo(t+r,n,t+r-o,n),e.lineTo(t+o,n),e.quadraticCurveTo(t,n,t,n+a)}(n,e.x,e.y,e.width,e.height,e.rx,e.ry):n.rect(e.x,e.y,e.width,e.height),r&&n.fill(),i&&n.stroke()})),nde("circle",(function(e,t){let{g:n,doFill:r,doStroke:i}=t;n.beginPath(),n.moveTo(e.cx+e.r,e.cy),n.arc(e.cx,e.cy,e.r,0,2*Math.PI,!1),r&&n.fill(),i&&n.stroke()})),nde("line",(function(e,t){let{g:n,doStroke:r}=t;n.beginPath(),n.moveTo(e.x1,e.y1),n.lineTo(e.x2,e.y2),r&&n.stroke()})),nde("path",(function(e,t){let{g:n,doStroke:r,doFill:i}=t;const o=new Path2D(e.d);i&&n.fill(o),r&&n.stroke(o)})),nde("text",(function(e,t){let{g:n,ellipsed:r,doStroke:i}=t;const o=r||ale(e,mle);n.font=[e["font-style"],e["font-weight"],e["font-size"],e["font-family"]].filter((e=>!!e)).join(" ");const a=cde(e.text);n.canvas.dir!==a&&(n.canvas.dir=a);const s=dde("middle"===e["text-anchor"]?"center":e["text-anchor"],n.canvas.dir);s&&n.textAlign!==s&&(n.textAlign=s);const l=sle(e);n.fillText(o,e.x+e.dx,e.y+e.dy+l),i&&n.strokeText(o,e.x+e.dx,e.y+e.dy+l)})),nde("image",(function(e,t){let{g:n}=t;const r=n.canvas,i=n.getTransform(),o=window.devicePixelRatio||1,a=r.clientWidth*o,s=r.clientHeight*o;r.width===a&&r.height===s||(r.width=a,r.height=s),fde(e.src,(t=>{if(n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,r.width,r.height),n.setTransform(i),n.globalAlpha=e.opacity,e.width||e.height||(e.width=t.naturalWidth*e.imageScalingFactor,e.height=t.naturalHeight*e.imageScalingFactor),function(e){const t=e.imagePosition||"center-center";let n=e.width,r=e.height;if("circle"===e.symbol){const t=Math.min(e.width,e.height)/2;n=2*t,r=2*t}switch(t){case"top-center":e.y-=r/2;break;case"center-left":e.x-=n/2;break;case"center-right":e.x+=n/2;break;case"top-left":e.x-=n/2,e.y-=r/2;break;case"top-right":e.x+=n/2,e.y-=r/2;break;case"bottom-left":e.x-=n/2,e.y+=r/2;break;case"bottom-right":e.x+=n/2,e.y+=r/2;break;case"bottom-center":e.y+=r/2}}(e),"circle"===e.symbol){const r=e.x,i=e.y;e.r=Math.min(e.width,e.height)/2;const o=r-e.width/2,a=i-e.height/2;n.save(),n.beginPath(),n.arc(r,i,e.r,0,2*Math.PI),n.clip(),n.drawImage(t,o,a,e.width,e.height),n.restore()}else e.x-=e.width/2,e.y-=e.height/2,n.drawImage(t,e.x,e.y,e.width,e.height);n.globalAlpha=1,e.updateCollider&&e.updateCollider(e)}))}));const vde="http://www.w3.org/2000/svg",bde=(e,t)=>{if(!e||"string"!=typeof e)throw new Error("Invalid type: ".concat(e));const n=t.ownerDocument.createElementNS(vde,"container"===e?"g":e);return t.appendChild(n),n},xde=e=>{e.parentNode&&e.parentNode.removeChild(e)};function wde(e){let{element:t,attrs:n}=e;return function(){const{width:e,height:r,imagePosition:i,imageScalingFactor:o,symbol:a}=n;let{x:s=0,y:l=0}=n,c=e>0?e:this.naturalWidth,u=r>0?r:this.naturalHeight;switch(o&&(c*=o,u*=o),i){case"top-center":l-=u/2;break;case"center-left":s-=c/2;break;case"center-right":s+=c/2;break;case"top-left":s-=c/2,l-=u/2;break;case"top-right":s+=c/2,l-=u/2;break;case"bottom-left":s-=c/2,l+=u/2;break;case"bottom-right":s+=c/2,l+=u/2;break;case"bottom-center":l+=u/2}if(t.setAttribute("width",c),t.setAttribute("height",u),t.setAttribute("x",s-c/2),t.setAttribute("y",l-u/2),t.setAttribute("preserveAspectRatio","none"),"circle"===a){const e=t.ownerSVGElement;if(!e)return;const n="clip-".concat(Math.random().toString(36).substr(2,9));if(!e.querySelector("#".concat(n))){const t=e.querySelector("defs")||e.insertBefore(document.createElementNS(vde,"defs"),e.firstChild),r=document.createElementNS(vde,"clipPath");r.setAttribute("id",n);const i=document.createElementNS(vde,"circle");i.setAttribute("cx",s),i.setAttribute("cy",l),i.setAttribute("r",Math.min(c,u)/2),r.appendChild(i),t.appendChild(r)}t.setAttribute("clip-path","url(#".concat(n,")"))}}}const Sde=(e,t)=>{if((e=>{switch(e.type){case"circle":return!isNaN(e.attrs.cx)&&!isNaN(e.attrs.cy)&&!isNaN(e.attrs.r);case"line":return!(isNaN(e.attrs.x1)||isNaN(e.attrs.y1)||isNaN(e.attrs.x2)||isNaN(e.attrs.y2));case"rect":return!(isNaN(e.attrs.x)||isNaN(e.attrs.y)||isNaN(e.attrs.width)||isNaN(e.attrs.height));case"text":case"image":return!isNaN(e.attrs.x)&&!isNaN(e.attrs.y);default:return!0}})(t)){for(const n in t.attrs)if("stroke"===n&&t.strokeReference)e.setAttribute("stroke",t.strokeReference);else if("fill"===n&&t.fillReference)e.setAttribute("fill",t.fillReference);else if("text"===n){e.setAttribute("style","white-space: pre"),e.textContent=t.ellipsed||ale(t.attrs,mle);const n=cde(t.attrs.text);"rtl"===n&&(e.setAttribute("direction","rtl"),e.setAttribute("dir","rtl"),e.setAttribute("text-anchor",dde(e.getAttribute("text-anchor"),n)))}else if("text"!==t.type||"dy"!==n&&"dominant-baseline"!==n)if("text"===t.type&&"title"===n&&t.attrs.title){const n=e.ownerDocument.createElementNS(vde,"title");n.textContent=t.attrs.title,e.appendChild(n)}else if("image"===t.type&&"src"===n){e.setAttributeNS("http://www.w3.org/1999/xlink","href",t.attrs.src);let n=new Image;n.src=t.attrs.src,n.onload=wde({element:e,attrs:t.attrs})}else e.setAttribute(n,t.attrs[n]);else{const r=+e.getAttribute(n)||0;let i=0;i="dominant-baseline"===n?sle(t.attrs):t.attrs[n],e.setAttribute("dy",i+r)}if("string"==typeof t.data||"number"==typeof t.data||"boolean"==typeof t.data)e.setAttribute("data",t.data);else if("object"==typeof t.data&&null!==t.data)for(const n in t.data)"string"!=typeof t.data[n]&&"number"!=typeof t.data[n]&&"boolean"!=typeof t.data[n]||e.setAttribute("data-".concat(n),t.data[n])}};class Cde{constructor(e,t,n,r){this.create=e,this.nodeCreator=t,this.nodeMaintainer=n,this.nodeDestroyer=r}render(e,t){return this.create([],e,t,this.nodeCreator,this.nodeMaintainer,this.nodeDestroyer)}}function kde(){return new Cde(yde,bde,Sde,xde)}function Ede(e){let t,n,r,i=0;if(0===(e=JSON.stringify(e)).length)return i;for(t=0,r=e.length;t<r;t++)n=e.charCodeAt(t),i=(i<<5)-i+n,i&=i;return i}function Mde(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:vde,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Fue;const n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:kde)();let r,i,o,a=!1,s=Bue();const l={transform:void 0,disableScreenReader:!1},c=Vue(),u={type:"defs",children:[]},d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ede,n={},r=Date.now();const i={onCreate(i){let o={};i.node&&"object"==typeof i.node.fill&&"pattern"===i.node.fill.type&&i.node.fill.shapes&&(o.fill=i.node.fill),i.node&&"object"==typeof i.node.stroke&&"pattern"===i.node.stroke.type&&i.node.stroke.shapes&&(o.stroke=i.node.stroke),Object.keys(o).forEach((a=>{let s="";const l=o[a],c=t(l),u="picasso-pattern-".concat(r,"-").concat(c);if("undefined"!=typeof window&&(s=window.location.href.split("#")[0]),!n[c]){const t={patternUnits:"userSpaceOnUse",x:0,y:0,width:l.width,height:l.height,type:"pattern",id:u,children:[],fill:l.fill};l.shapes.forEach((e=>{t.children.push(e)})),e.push(t),n[c]=!0}i.node["".concat(a,"Reference")]="url('".concat(s,"#").concat(u,"')")}))},clear(){n={}}};return i}(u.children),f=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ede,n={},r=Date.now();const i={getOrCreateGradient(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fill",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=t(i[o]),l="picasso-gradient-".concat(r,"-").concat(s);if(!n[s]){let{orientation:t,degree:r,stops:a=[]}=i[o],c={};void 0===r&&(r=90),"radial"===t?c.type="radialGradient":(c=Wre(r),["x1","x2","y1","y2"].forEach((e=>{e in i[o]&&(c[e]=i[o][e])})),c.type="linearGradient"),c.id=l,c.children=a.map((e=>{let{offset:t,color:n,opacity:r}=e;return{type:"stop",offset:"".concat(100*t,"%"),style:"stop-color:".concat(n,";stop-opacity:").concat(void 0!==r?r:1)}})),e.push(c),n[s]=l}return"url('".concat(a,"#").concat(l,"')")},onCreate(e){let t="";"undefined"!=typeof window&&(t=window.location.href.split("#")[0]);const n=e.node;n.fill&&"object"==typeof n.fill&&"gradient"===n.fill.type&&(n.fillReference=i.getOrCreateGradient(n,"fill",t)),n.stroke&&"object"==typeof n.stroke&&"gradient"===n.stroke.type&&(n.strokeReference=i.getOrCreateGradient(n,"stroke",t))},clear(){n={}}};return i}(u.children);return c.element=()=>r,c.root=()=>i,c.settings=e=>(e&&Object.keys(l).forEach((t=>{void 0!==e[t]&&(l[t]=e[t])})),l),c.appendTo=t=>(r||(r=t.ownerDocument.createElementNS(e,"svg"),r.style.position="absolute",r.style["-webkit-font-smoothing"]="antialiased",r.style["-moz-osx-font-smoothing"]="antialiased",r.style.pointerEvents="none",r.setAttribute("xmlns",e),i=t.ownerDocument.createElementNS(e,"g"),i.style.pointerEvents="auto",r.appendChild(i)),t.appendChild(r),r),c.getScene=e=>{const n=s.scaleRatio.x,r=s.scaleRatio.y,i={type:"container",children:Array.isArray(e)?[...e,u]:e,transform:s.edgeBleed.bool?"translate(".concat(s.edgeBleed.left*n,", ").concat(s.edgeBleed.top*r,")"):""};return 1===n&&1===r||(i.transform+="scale(".concat(n,", ").concat(r,")")),t({items:[i],on:{create:[e=>{e.node.fillReference=void 0,e.node.strokeReference=void 0},f.onCreate,d.onCreate,ole(c.measureText),Hue(c)]}})},c.render=e=>{if(!r)return!1;const t="function"==typeof l.transform&&l.transform();if(t){const{horizontalScaling:e,horizontalSkewing:n,verticalSkewing:r,verticalScaling:o,horizontalMoving:a,verticalMoving:s}=t;return i.style.transform="matrix(".concat(e,", ").concat(n,", ").concat(r,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}i.style.transform="";l.disableScreenReader&&r.setAttribute("aria-hidden",!0),a&&(r.style.left="".concat(s.computedPhysical.x,"px"),r.style.top="".concat(s.computedPhysical.y,"px"),r.setAttribute("width",s.computedPhysical.width),r.setAttribute("height",s.computedPhysical.height)),f.clear(),d.clear(),u.children.length=0;const h=c.getScene(e),p=!o||!h.equals(o),m=a||p;return m&&(c.clear(),n.render(h.children,i)),a=!1,o=h,m},c.itemsAt=e=>o?o.getItemsFrom(e):[],c.findShapes=e=>o?o.findShapes(e):[],c.clear=()=>{if(!i)return c;o=null;const e=i.cloneNode(!1);return r.replaceChild(e,i),i=e,c},c.destroy=()=>{r&&r.parentNode&&r.parentNode.removeChild(r),r=null,i=null},c.size=e=>{if(e){const t=Bue(e);JSON.stringify(s)!==JSON.stringify(t)&&(a=!0,s=t)}return s},c}var _de,Rde,Ide,Dde,Pde,Ade,Ode,Lde={},Tde=[],qde=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function Nde(e,t){for(var n in t)e[n]=t[n];return e}function jde(e){var t=e.parentNode;t&&t.removeChild(e)}function zde(e,t,n){var r,i,o,a={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?_de.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return Fde(e,a,r,i,null)}function Fde(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++Ide:i};return null==i&&null!=Rde.vnode&&Rde.vnode(o),o}function Wde(e){return e.children}function $de(e,t){this.props=e,this.context=t}function Bde(e,t){if(null==t)return e.__?Bde(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Bde(e):null}function Vde(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return Vde(e)}}function Hde(e){(!e.__d&&(e.__d=!0)&&Dde.push(e)&&!Ude.__r++||Pde!==Rde.debounceRendering)&&((Pde=Rde.debounceRendering)||Ade)(Ude)}function Ude(){var e,t,n,r,i,o,a,s;for(Dde.sort(Ode);e=Dde.shift();)e.__d&&(t=Dde.length,r=void 0,i=void 0,a=(o=(n=e).__v).__e,(s=n.__P)&&(r=[],(i=Nde({},o)).__v=o.__v+1,tfe(s,o,i,n.__n,void 0!==s.ownerSVGElement,null!=o.__h?[a]:null,r,null==a?Bde(o):a,o.__h),nfe(r,o),o.__e!=a&&Vde(o)),Dde.length>t&&Dde.sort(Ode));Ude.__r=0}function Gde(e,t,n,r,i,o,a,s,l,c){var u,d,f,h,p,m,g,y=r&&r.__k||Tde,v=y.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(h=n.__k[u]=null==(h=t[u])||"boolean"==typeof h||"function"==typeof h?null:"string"==typeof h||"number"==typeof h||"bigint"==typeof h?Fde(null,h,null,null,h):Array.isArray(h)?Fde(Wde,{children:h},null,null,null):h.__b>0?Fde(h.type,h.props,h.key,h.ref?h.ref:null,h.__v):h)){if(h.__=n,h.__b=n.__b+1,null===(f=y[u])||f&&h.key==f.key&&h.type===f.type)y[u]=void 0;else for(d=0;d<v;d++){if((f=y[d])&&h.key==f.key&&h.type===f.type){y[d]=void 0;break}f=null}tfe(e,h,f=f||Lde,i,o,a,s,l,c),p=h.__e,(d=h.ref)&&f.ref!=d&&(g||(g=[]),f.ref&&g.push(f.ref,null,h),g.push(d,h.__c||p,h)),null!=p?(null==m&&(m=p),"function"==typeof h.type&&h.__k===f.__k?h.__d=l=Yde(h,l,e):l=Kde(e,h,f,y,p,l),"function"==typeof n.type&&(n.__d=l)):l&&f.__e==l&&l.parentNode!=e&&(l=Bde(f))}for(n.__e=m,u=v;u--;)null!=y[u]&&("function"==typeof n.type&&null!=y[u].__e&&y[u].__e==n.__d&&(n.__d=Xde(r).nextSibling),ofe(y[u],y[u]));if(g)for(u=0;u<g.length;u++)ife(g[u],g[++u],g[++u])}function Yde(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t="function"==typeof r.type?Yde(r,t,n):Kde(n,r,r,i,r.__e,t));return t}function Kde(e,t,n,r,i,o){var a,s,l;if(void 0!==t.__d)a=t.__d,t.__d=void 0;else if(null==n||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),a=null;else{for(s=o,l=0;(s=s.nextSibling)&&l<r.length;l+=1)if(s==i)break e;e.insertBefore(i,o),a=o}return void 0!==a?a:i.nextSibling}function Xde(e){var t,n,r;if(null==e.type||"string"==typeof e.type)return e.__e;if(e.__k)for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(r=Xde(n)))return r;return null}function Jde(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||qde.test(t)?n:n+"px"}function Qde(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Jde(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Jde(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?efe:Zde,o):e.removeEventListener(t,o?efe:Zde,o);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function Zde(e){return this.l[e.type+!1](Rde.event?Rde.event(e):e)}function efe(e){return this.l[e.type+!0](Rde.event?Rde.event(e):e)}function tfe(e,t,n,r,i,o,a,s,l){var c,u,d,f,h,p,m,g,y,v,b,x,w,S,C,k=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,s=t.__e=n.__e,t.__h=null,o=[s]),(c=Rde.__b)&&c(t);try{e:if("function"==typeof k){if(g=t.props,y=(c=k.contextType)&&r[c.__c],v=c?y?y.props.value:c.__:r,n.__c?m=(u=t.__c=n.__c).__=u.__E:("prototype"in k&&k.prototype.render?t.__c=u=new k(g,v):(t.__c=u=new $de(g,v),u.constructor=k,u.render=afe),y&&y.sub(u),u.props=g,u.state||(u.state={}),u.context=v,u.__n=r,d=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=k.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=Nde({},u.__s)),Nde(u.__s,k.getDerivedStateFromProps(g,u.__s))),f=u.props,h=u.state,u.__v=t,d)null==k.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==k.getDerivedStateFromProps&&g!==f&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(g,v),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(g,u.__s,v)||t.__v===n.__v){for(t.__v!==n.__v&&(u.props=g,u.state=u.__s,u.__d=!1),u.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<u._sb.length;b++)u.__h.push(u._sb[b]);u._sb=[],u.__h.length&&a.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(g,u.__s,v),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(f,h,p)}))}if(u.context=v,u.props=g,u.__P=e,x=Rde.__r,w=0,"prototype"in k&&k.prototype.render){for(u.state=u.__s,u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),S=0;S<u._sb.length;S++)u.__h.push(u._sb[S]);u._sb=[]}else do{u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++w<25);u.state=u.__s,null!=u.getChildContext&&(r=Nde(Nde({},r),u.getChildContext())),d||null==u.getSnapshotBeforeUpdate||(p=u.getSnapshotBeforeUpdate(f,h)),C=null!=c&&c.type===Wde&&null==c.key?c.props.children:c,Gde(e,Array.isArray(C)?C:[C],t,n,r,i,o,a,s,l),u.base=t.__e,t.__h=null,u.__h.length&&a.push(u),m&&(u.__E=u.__=null),u.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=rfe(n.__e,t,n,r,i,o,a,l);(c=Rde.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=s,t.__h=!!l,o[o.indexOf(s)]=null),Rde.__e(e,t,n)}}function nfe(e,t){Rde.__c&&Rde.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Rde.__e(e,t.__v)}}))}function rfe(e,t,n,r,i,o,a,s){var l,c,u,d=n.props,f=t.props,h=t.type,p=0;if("svg"===h&&(i=!0),null!=o)for(;p<o.length;p++)if((l=o[p])&&"setAttribute"in l==!!h&&(h?l.localName===h:3===l.nodeType)){e=l,o[p]=null;break}if(null==e){if(null===h)return document.createTextNode(f);e=i?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h,f.is&&f),o=null,s=!1}if(null===h)d===f||s&&e.data===f||(e.data=f);else{if(o=o&&_de.call(e.childNodes),c=(d=n.props||Lde).dangerouslySetInnerHTML,u=f.dangerouslySetInnerHTML,!s){if(null!=o)for(d={},p=0;p<e.attributes.length;p++)d[e.attributes[p].name]=e.attributes[p].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||Qde(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||Qde(e,o,t[o],n[o],r)}(e,f,d,i,s),u)t.__k=[];else if(p=t.props.children,Gde(e,Array.isArray(p)?p:[p],t,n,r,i&&"foreignObject"!==h,o,a,o?o[0]:n.__k&&Bde(n,0),s),null!=o)for(p=o.length;p--;)null!=o[p]&&jde(o[p]);s||("value"in f&&void 0!==(p=f.value)&&(p!==e.value||"progress"===h&&!p||"option"===h&&p!==d.value)&&Qde(e,"value",p,d.value,!1),"checked"in f&&void 0!==(p=f.checked)&&p!==e.checked&&Qde(e,"checked",p,d.checked,!1))}return e}function ife(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Rde.__e(e,n)}}function ofe(e,t,n){var r,i;if(Rde.unmount&&Rde.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||ife(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Rde.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&ofe(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||jde(e.__e),e.__=e.__e=e.__d=void 0}function afe(e,t,n){return this.constructor(e,n)}function sfe(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{createElement:t=document.createElement.bind(document)}=e;let n,r,i=Bue();const o={transform:void 0,disableScreenReader:!1},a=Vue();return a.element=()=>n,a.root=()=>n,a.settings=e=>(e&&Object.keys(o).forEach((t=>{void 0!==e[t]&&(o[t]=e[t])})),o),a.appendTo=e=>(n||(n=t("div"),n.style.position="absolute",n.style["-webkit-font-smoothing"]="antialiased",n.style["-moz-osx-font-smoothing"]="antialiased",n.style.pointerEvents="none"),e.appendChild(n),n),a.render=e=>{if(!n)return!1;const t="function"==typeof o.transform&&o.transform();if(t){const{horizontalScaling:e,horizontalSkewing:r,verticalSkewing:i,verticalScaling:o,horizontalMoving:a,verticalMoving:s}=t;return n.style.transform="matrix(".concat(e,", ").concat(r,", ").concat(i,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}n.style.transform="";let a;return o.disableScreenReader&&n.setAttribute("aria-hidden",!0),n.style.left="".concat(i.computedPhysical.x,"px"),n.style.top="".concat(i.computedPhysical.y,"px"),n.style.width="".concat(i.computedPhysical.width,"px"),n.style.height="".concat(i.computedPhysical.height,"px"),a=Array.isArray(e)?zde("div",null,e):e,r=function(e,t,n){var r,i,o;Rde.__&&Rde.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],tfe(t,e=(!r&&n||t).__k=zde(Wde,null,[e]),i||Lde,Lde,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?_de.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),nfe(o,e)}(a,n,r),!0},a.renderArgs=[zde],a.clear=()=>{if(n){let e=n.firstChild;for(;e;)n.removeChild(e),e=n.firstChild;r=null}return a},a.destroy=()=>{n&&n.parentElement&&n.parentElement.removeChild(n),n=null,r=null},a.size=e=>(e&&(i=Bue(e)),i),a}_de=Tde.slice,Rde={__e:function(e,t,n,r){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),a=i.__d),a)return i.__E=i}catch(t){e=t}throw e}},Ide=0,$de.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Nde({},this.state),"function"==typeof e&&(e=e(Nde({},n),this.props)),e&&Nde(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Hde(this))},$de.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Hde(this))},$de.prototype.render=Wde,Dde=[],Ade="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ode=function(e,t){return e.__v.__b-t.__v.__b},Ude.__r=0;var lfe=[function(e){e.renderer("svg",Mde)},function(e){e.renderer("canvas",tde)},function(e){e.renderer("dom",sfe)}];const cfe={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4};const ufe=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=function(){let{level:e=cfe.OFF,pipe:t=console}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e;const r={[cfe.OFF]:()=>{},[cfe.ERROR]:function(){return t.error(...arguments)},[cfe.WARN]:function(){return t.warn(...arguments)},[cfe.INFO]:function(){return t.info(...arguments)},[cfe.DEBUG]:function(){return t.log(...arguments)}},i=function(e){if(e&&!(n<e)){for(var t=arguments.length,i=new Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];(r[e]||r[cfe.DEBUG])(...i)}};return{log:i,error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(cfe.ERROR,...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(cfe.WARN,...t)},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(cfe.INFO,...t)},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(cfe.DEBUG,...t)},level:e=>("number"==typeof e&&(n=e),n),LOG_LEVEL:cfe}}(t.logger),i={component:S7(n.component,"component",r),data:S7(n.data,"data",r),formatter:S7(n.formatter,"formatter",r),interaction:S7(n.interaction,"interaction",r),renderer:coe(n.renderer),scale:S7(n.scale,"scale",r),symbol:S7(n.symbol,"symbol",r),logger:r};function o(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e({palettes:t.palettes.concat(n.palettes||[]),style:o8({},t.style,n.style),logger:n.logger||t.logger,renderer:n.renderer||t.renderer},i)}return t.renderer&&t.renderer.prio&&i.renderer.default(t.renderer.prio[0]),o.use=function(e){return function(e){e(arguments.length>2?arguments[2]:void 0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i)},o.chart=e=>loe(e,{registries:i,logger:r,style:t.style,palettes:t.palettes}),o.config=()=>t,Object.keys(i).forEach((e=>{o[e]=i[e]})),o.version=a8,o}({renderer:{prio:["svg","canvas"]},logger:{level:0},style:{"$font-family":"'Source Sans Pro', Arial, sans-serif","$font-size":"12px","$line-height":"16px","$font-size--l":"16px","$font-weight":"normal","$gray-100":"#ffffff","$gray-98":"#f9f9f9","$gray-95":"#f2f2f2","$gray-90":"#e6e6e6","$gray-35":"#595959","$gray-30":"#4d4d4d","$gray-25":"#404040","$gray-20":"#333333","$border-95":"rgba(255, 255, 255, 0.05)","$border-90":"rgba(255, 255, 255, 0.1)","$border-80":"rgba(255, 255, 255, 0.2)","$border-20":"rgba(0, 0, 0, 0.2)","$border-10":"rgba(0, 0, 0, 0.1)","$border-5":"rgba(0, 0, 0, 0.05)","$primary-blue":"#3F8AB3","$primary-green":"#6CB33F","$primary-red":"#DC423F","$primary-orange":"#EF960F","$spacing--s":4,$spacing:8,"$spacing--l":12,"$font-color":"$gray-35","$font-color--inverted":"$gray-90","$guide-color":"$gray-90","$guide-color--inverted":"$gray-35",$border:"$border-80","$border--inverted":"$border-10",$shape:{fill:"$primary-blue",strokeWidth:1,stroke:"$border"},"$shape-outline":{stroke:"$primary-blue",strokeWidth:2},"$shape-guide":{stroke:"$guide-color",strokeWidth:1},"$shape-guide--inverted":{"@extend":"$shape-guide",stroke:"$guide-color--inverted"},$label:{fontSize:"$font-size",fontFamily:"$font-family",fill:"$font-color"},"$label--inverted":{$extend:"$label",fill:"$font-color--inverted"},"$label-overlay":{fontSize:"$font-size--l",fontFamily:"$font-family",fill:"$gray-100",color:"$font-color",stroke:"$guide-color--inverted",strokeWidth:1,borderRadius:4},$title:{"@extend":"$label",fontSize:"$font-size--l",fontWeight:"$font-weight",stroke:"$guide-color--inverted",strokeWidth:0},"$guide-line":{strokeWidth:1,stroke:"$guide-color"},"$guide-line--minor":{strokeWidth:1,stroke:"$gray-95"},"$padding--s":{left:"$spacing--s",right:"$spacing--s",top:"$spacing--s",bottom:"$spacing--s"},$padding:{left:"$spacing",right:"$spacing",top:"$spacing",bottom:"$spacing"},"$selection-area-target":{fill:"$primary-green",strokeWidth:0,opacity:.2}},palettes:[{key:"categorical",colors:[["#a54343","#d76c6c","#ec983d","#ecc43d","#f9ec86","#cbe989","#70ba6e","#578b60","#79d69f","#26a0a7","#138185","#65d3da"]]},{key:"diverging",colors:[["#3d52a1","#3a89c9","#77b7e5","#b4ddf7","#e6f5fe","#ffe3aa","#f9bd7e","#ed875e","#d24d3e","#ae1c3e"]]},{key:"sequential",colors:[["rgb(180,221,212)","rgb(34, 83, 90)"]]}]},{component:uoe,data:moe,formatter:Uee,interaction:goe,renderer:coe(),scale:Gne,symbol:Zre});Ece.forEach(ufe.use),lfe.forEach(ufe.use),[].forEach(ufe.use);const dfe=ufe();dfe.use(X6),dfe.renderer.prio(["canvas"]);const ffe=(e,t)=>e&&"center"!==e&&"rtl"===t?b5(e):e,hfe=({cell:e,representation:t,textStyle:n,imageContainerHorizontalAlignment:r})=>{const{imageBox:i}=t,{styleService:{grid:{lineClamp:o}}}=EZ(),{direction:a}=bZ();return Yi.jsxs("div",{style:{display:"grid",gridTemplateColumns:`${i?.width??24}px 1fr`,maxHeight:"fit-content",alignItems:"center",justifyContent:"flex-start",boxSizing:"border-box"},children:[Yi.jsx("div",{"data-key":"image-container--partial-image",style:{display:"flex",flexDirection:"column",justifyContent:T5(e),alignItems:ffe(r,a),overflow:"hidden",boxSizing:"border-box",border:"4px solid transparent",width:i?.width??24,height:"100%"},children:Yi.jsx(t3,{representation:t,textStyle:n})}),Yi.jsx(O3,{padding:4/(o<=2?2:1),alignSelf:T5(e,!0),children:!!t.labelStructure&&Z5(t.labelStructure)})]})},pfe=({suffix:e,delimeter:t})=>` ${e?t:""} ${e}`,mfe=({href:e,text:t,labelStructure:n,interactions:r,color:i})=>Yi.jsxs("span",{children:[Yi.jsx(gS,{...l4({href:e,text:t,interactions:r,color:i}),children:n?.maskedValue?n.maskedValue:n?.originalValue}),!!n&&pfe(n)]}),gfe=({children:e,textStyle:t,shouldEnableStickyText:n})=>Yi.jsx("span",{style:{...t,border:"4px solid transparent",boxSizing:"border-box",...n&&{alignSelf:"flex-start",position:"sticky",top:0}},children:e}),yfe=({isLeftColumn:e,styleService:t,cell:n,isIndentModeEnabled:r})=>e?r?t.grid.lineClamp:Math.max(t.grid.lineClamp,n.leafCount*t.grid.lineClamp):t.grid.columnLineClamp,vfe=({cell:e,isCellSelected:t,isLeftColumn:n})=>{const{direction:r}=bZ(),{isActive:i}=A5(),{layoutService:o,styleService:a}=EZ(),{interactions:s}=SZ(),l=n&&o.isIndentModeEnabled;let c=n&&!e.isNull?(e=>{const{representation:{text:t,labelStructure:n}}=e;if(!n||!n.originalValue)return t;const{originalValue:r,maskedValue:i,suffix:o,delimeter:a}=n;return`${0!==i.length?i:r} ${o?a:""} ${o}`.trim()})(e):e.representation.text;if(e.isEmpty)return null;const u=(({cell:e,styleService:t,isCellSelected:n,isLeftColumn:r,isIndentModeEnabled:i})=>({...KX,...XX(yfe({cell:e,isLeftColumn:r,styleService:t,isIndentModeEnabled:i})),color:F5({cell:e,styleService:t,isCellSelected:n}),fontWeight:W5({cell:e,styleService:t}),fontStyle:$5({cell:e,styleService:t}),textDecoration:B5({cell:e,styleService:t}),fontFamily:t.dimensionValues.fontFamily,fontSize:t.dimensionValues.fontSize}))({cell:e,styleService:a,isCellSelected:t,isLeftColumn:n,isIndentModeEnabled:o.isIndentModeEnabled});if(e.representation.type===iX.Image&&!e.isTotal&&!e.isNull){const{labelStructure:t}=e.representation,i=n&&t&&t.suffix?hfe:n3;return Yi.jsx(i,{cell:e,representation:e.representation,leafCount:e.leafCount,textStyle:u,isLeftColumn:n,canExpandOrCollapse:e.ref.qCanCollapse||e.ref.qCanExpand,imageContainerHorizontalAlignment:k5(e,o,n,r)})}if(e.representation.type===iX.Link&&!i&&!e.isTotal){const t=n&&e.representation.labelStructure?mfe:c4;c=Yi.jsx(t,{text:e.representation.text,labelStructure:e.representation.labelStructure,href:e.representation.url,interactions:s,color:e.expressionColor.color})}return Yi.jsx(gfe,{shouldEnableStickyText:l,textStyle:{...u,...e.representation.type===iX.Image&&e.isNull?{alignSelf:T5(e)}:{}},children:c})},bfe=({index:e,style:t,data:n})=>{const{styleService:r,layoutService:i}=EZ(),{isSelected:o}=A5(),{isLeftColumn:a=!1,showLastBorder:s,itemCount:l,isLast:c,totalDividerIndex:u}=n,{isAdjustingWidth:d,setIsAdjustingWidth:f}=x3([n]),h=i4(e,n),p=a?e===l-1:c,m=a?c:e===l-1,g=M2(h,u,i.isIndentModeEnabled);if(void 0===h){const{background:n}=r.dimensionValues;return Yi.jsx(_2,{style:{...t,background:n},index:e,isLastRow:p,isLastColumn:m,showLastBorder:s,isLeftColumn:a,showTotalCellDivider:g})}const y=o(h);return Yi.jsxs(a4,{reactWindowStyle:t,isLeftColumn:a,isLastRow:p,isLastColumn:m,isCellSelected:y,showTotalCellDivider:g,cell:h,data:n,isAdjustingWidth:d,index:e,children:[Yi.jsxs(R2,{verticalAlign:T5(h),width:I2(h.representation),right:h.isLeftColumn?void 0:4,isLeftColumn:a,children:[Yi.jsx(G5,{isLeftColumn:a,isCellSelected:y,cell:h}),Yi.jsx(vfe,{isLeftColumn:a,isCellSelected:y,cell:h})]}),Yi.jsx(C3,{cellInfo:{...h,columnWidthLocation:h.isPseudoDimension?dX.Measures:dX.Dimension},columnWidth:t.width,isLastColumn:m,setIsAdjustingWidth:f})]})};var xfe=Re.memo(bfe,d2);const wfe=({list:e,listValues:t,isLastRow:n,getRightGridColumnWidth:r})=>i=>{const o=n?e[i]:t.at(i);return o&&0===i&&o.x>0?(o.leafCount+o.x+o.distanceToNextCell)*r():!n&&o?(o.leafCount+o.distanceToNextCell)*r():r(o?.x??i)},Sfe=(e,t,n,r)=>{const i=Object.values(e);let o,a=i.length;return r&&(a=n,o=t/a),{itemCount:a,estimatedItemSize:o,listValues:i}},Cfe=(e,t)=>n=>{e.current&&(e.current[t]=n)},kfe={display:"flex",height:"fit-content",borderWidth:"1px 0px 0px 0px",...GX},Efe={overflow:"hidden",willChange:"auto",flexShrink:0},Mfe=({leftGridRef:e,width:t,height:n,columnWidths:r,showLastBorder:i})=>{const{pageInfo:o,direction:a}=bZ(),{layoutService:s,styleService:{contentCellHeight:l,grid:{divider:c}}}=EZ(),{qSize:u}=s.layout.qHyperCube,{gridSectionsData:{leftDimensionData:d},visibleDimensionsInfo:{visibleLeftDimensionInfo:f}}=Y0();r4(e,d),n4(e,t,n,l);const h=o.rowsOnCurrentPage*l,p={...kfe,borderColor:c,width:r.reduce(((e,t)=>e+t),0)};return Yi.jsx("div",{style:p,"data-section-id":"LEFT_GRID",children:d.grid.map(((t,c)=>{const p=c===d.columnCount-1,m=PZ(f[c]),{itemCount:g,estimatedItemSize:y,listValues:v}=Sfe(t,h,o.rowsOnCurrentPage,p),b=s.isIndentModeEnabled?()=>l:((e,t,n,r,i)=>o=>{const a=r?e[o]:t.at(o);if(a&&0===o&&a.pageY>0)return(a.leafCount+a.pageY+a.distanceToNextCell)*n;if(a&&a.leafCount>0){const e=a.y===i-a.leafCount;return(a.leafCount-(e?a.ref.qUp:0)+a.distanceToNextCell)*n}return n})(t,v,l,p,u.qcy);return Yi.jsx(s2,{ref:Cfe(e,c),style:{...Efe,flexGrow:p?1:0,direction:a},height:n,width:r[c],itemCount:g,itemSize:b,layout:"vertical",itemData:{list:t,isLeftColumn:!0,isLast:p,itemCount:g,showLastBorder:i,listValues:v,totalDividerIndex:d.totalDividerIndex},itemKey:h3,estimatedItemSize:y,children:xfe},m)}))})};var _fe=_e.memo(Mfe);const Rfe={overflow:"hidden",willChange:"auto"},Ife=e=>({...GX,borderWidth:"rtl"===e?"0px 1px 0px 0px":"0px 0px 0px 1px"}),Dfe=({topGridRef:e,rowHightCallback:t,width:n,height:r,showLastBorder:i,getRightGridColumnWidth:o})=>{const{direction:a}=bZ(),{layoutService:s,styleService:{grid:{divider:l},headerCellHeight:c}}=EZ(),{gridSectionsData:{headersData:u,topDimensionData:d}}=Y0(),f={...Ife(a),borderColor:l,height:r};r4(e,d),n4(e,n,r,c);const h=s.size.x*o();return 0===d.rowCount?Yi.jsx("div",{style:{width:n,height:r,...Ife(a)}}):Yi.jsx("div",{style:f,"data-section-id":"TOP_GRID",children:d.grid.map(((r,l)=>{const c=l===d.rowCount-1,{itemCount:f,estimatedItemSize:p,listValues:m}=Sfe(r,h,s.size.x,c),g=(({layoutService:e,headersData:t,topRowIndex:n})=>{const r=t.data.at(n);if(void 0===r)return;const i=t.size.x-1,o=Q3({layoutService:e,headersData:t,topRowIndex:n})?0:i,a=r.at(o),s=Array.isArray(a)?a.at(i):a;return s?e.getDimensionInfo(s.dimensionInfoIndex):void 0})({layoutService:s,headersData:u,topRowIndex:l}),y=g?PZ(g):`empty ${l}`;return Yi.jsx(s2,{ref:Cfe(e,l),style:Rfe,height:t(),width:n,itemCount:f,itemSize:wfe({list:r,listValues:m,isLastRow:c,getRightGridColumnWidth:o}),layout:"horizontal",itemData:{list:r,isLast:c,itemCount:f,showLastBorder:i,listValues:m,totalDividerIndex:d.totalDividerIndex},itemKey:h3,estimatedItemSize:p,direction:a,children:xfe},y)}))})};var Pfe=_e.memo(Dfe);const Afe=()=>{const{styleService:{headerCellHeight:e,contentCellHeight:t}}=EZ(),n=w1(),r=(()=>{const{model:e}=SZ(),t=_e.useCallback((async(t,n)=>{if(!e)throw new Error("No Model provided!");const{qReverseSort:r,dimensionInfoIndex:i,sortDirection:o}=t,a=[];if(n===o)return!1;a.push({qPath:`/qHyperCubeDef/qDimensions/${i}/qDef/qReverseSort`,qOp:"Replace",qValue:(!r).toString()});try{return await e.applyPatches(a,!0),!0}catch(e){return console.error("Error while applying patch: ",e),!1}}),[e]);return t})(),{gridSectionsWrapperRefs:{headerGridWrapperRef:i,topGridWrapperRef:o,leftGridWrapperRef:a,dataGridWrapperRef:s},gridRefs:{topGridRef:l,leftGridRef:c,dataGridRef:u},scrollDirectionRefs:{verticalScrollDirection:d,horizontalScrollDirection:f},scrollbarsDimensions:{verticalScrollbarWidth:h,horizontalScrollbarHeight:p,resetHorizontalScrollbarHeight:m}}=x1(),{leftGridWidth:g,leftGridFullWidth:y,leftGridColumnWidths:v,rightGridFullWidth:b,showLastRightBorder:x,getRightGridColumnWidth:w,getHeaderCellsIconsVisibilityStatus:S,overrideLeftGridWidth:C}=function({tableWidth:e,verticalScrollbarWidth:t,resetHorizontalScrollbarHeight:n}){const{layoutService:r,styleService:i}=EZ(),{gridSectionsData:{headersData:o}}=Y0(),{measureText:a}=SJ(i.header,{allowLineBreaks:!1}),s=f1({tableWidth:e}),l=h1({tableWidth:e,verticalScrollbarWidth:t,leftGridWidth:s.leftGridWidth}),c=s.leftGridWidth+l.rightGridFullWidth+1<e,u=_e.useCallback(((e,t,n="")=>{let i=e;r.isIndentModeEnabled&&(i=1,1===o.size.x&&(i=0));const l=s.leftGridColumnWidths[i];let c=!1,u=!1,d=a(n)+J0;return t&&d+X0<=l&&(u=!0,d+=X0),d+X0<=l&&(c=!0),{shouldShowMenuIcon:c,shouldShowLockIcon:u}}),[s.leftGridColumnWidths,a,r.isIndentModeEnabled,o.size.x]);return _e.useEffect((()=>{const e=s.leftGridWidth===s.leftGridFullWidth,t=l.rightGridWidth===l.rightGridFullWidth;e&&t&&n()}),[n,s.leftGridWidth,s.leftGridFullWidth,l.rightGridWidth,l.rightGridFullWidth]),{...s,...l,showLastRightBorder:c,getHeaderCellsIconsVisibilityStatus:u}}({tableWidth:n.width,verticalScrollbarWidth:h,resetHorizontalScrollbarHeight:m}),{gridScaffoldDimensions:k,headerGridDims:E,topGridDims:M,leftGridDims:_,dataGridDims:R,metadata:{everyThingFitsInTableRectHeight:I,scrollbarsVisibilityStatus:D}}=(({cellHeights:{headerCellHeight:e,contentCellHeight:t},horizontalWidths:{leftGridWidth:n,leftGridOriginalWidth:r,rightGridOriginalWidth:i},scrollBarsDimensions:{verticalScrollbarWidth:o,horizontalScrollbarHeight:a}})=>{const s=w1(),{pageInfo:l}=bZ(),{gridSectionsData:{headersData:c,topDimensionData:u}}=Y0(),d=Math.min(s.height*Q0,Math.max(s.height*Q0-25,s.height-t-a)),f=s.width*Q0,h=l.rowsOnCurrentPage*t,p=Math.max(c.size.y,u.rowCount,1),m=e*p,g=e*p,y=Math.min(f,n),v=s.width-f,b=Math.max(v,s.width-y),x=Math.min(d,m,g),{availableHeight:w,everyThingFitsInTableRectHeight:S,everyThingFitsInTableRectWidth:C}=((e,t,n)=>{const r=t+1+n+o<=s.width,i=e+1+h+a,l=i-s.height<a||i<=s.height;return{availableHeight:l?i:s.height,everyThingFitsInTableRectHeight:l,everyThingFitsInTableRectWidth:r}})(x,y,b),k=w-d,E=Math.max(k,w-x),M=Math.min(E,h),_=Math.min(E,h),R=m+1+h,{visibilityStatus:I,metadata:{hasLeftGridOverflowX:D,hasDataGridOverflowX:P}}=(e=>{const{gridScaffold:{X_AXIS:{leftSectionWidth:t,rightSectionWidth:n},Y_AXIS:{topSectionHeight:r,bottomSectionHeight:i}},gridOriginalWidth:{X_AXIS:{leftSectionFullWidth:o,rightSectionFullWidth:a},Y_AXIS:{topSectionFullHeight:s,bottomSectionFullHeight:l}}}=e,c=s>r,u=o>t,d=a>n,f=l>i;return{visibilityStatus:{topGrid:{overflowX:"hidden",overflowY:c?"scroll":"hidden"},leftGrid:{overflowX:u?"scroll":"hidden",overflowY:"hidden"},dataGrid:{overflowX:d?"scroll":"hidden",overflowY:f?"scroll":"hidden"}},metadata:{hasTopGridOverflowY:c,hasLeftGridOverflowX:u,hasDataGridOverflowX:d,hasDataGridOverflowY:f}}})({gridScaffold:{X_AXIS:{leftSectionWidth:y,rightSectionWidth:b},Y_AXIS:{topSectionHeight:x,bottomSectionHeight:E}},gridOriginalWidth:{X_AXIS:{leftSectionFullWidth:r,rightSectionFullWidth:i},Y_AXIS:{topSectionFullHeight:g,bottomSectionFullHeight:R-g}}});return{gridScaffoldDimensions:{width:s.width,height:s.height,gridTemplateColumns:`${y}px ${b}px`,gridTemplateRows:`${x}px ${E}px`},headerGridDims:{width:-1,height:x},topGridDims:{fullSizeWrapper:{width:i-o+(P?o:0),height:g},stickyWrapper:{width:b-1-o,height:-1},self:{width:Math.min(i,b)-(C?1:0)-o,height:g}},leftGridDims:{fullSizeWrapper:{width:y,height:R-g+(!D&&P?a:0)},stickyWrapper:{width:y,height:E-1-a},self:{width:y,height:Math.max(t,M-(S?0:a-1))}},dataGridDims:{fullSizeWrapper:{width:i-o+(P?o:0),height:R-g+(!P&&D?a:0)},stickyWrapper:{width:b-1-o,height:E-1-a},self:{width:Math.min(i,b)-(C?1:0)-o,height:Math.max(t,_-(S?0:a-1))}},metadata:{everyThingFitsInTableRectHeight:S,scrollbarsVisibilityStatus:I}}})({cellHeights:{headerCellHeight:e,contentCellHeight:t},horizontalWidths:{leftGridWidth:g,leftGridOriginalWidth:y,rightGridOriginalWidth:b},scrollBarsDimensions:{verticalScrollbarWidth:h,horizontalScrollbarHeight:p}}),P=_e.useCallback((()=>e),[e]),A=_e.useCallback((()=>t),[t]);return(()=>{const{downloadService:e}=EZ();_e.useEffect((()=>{e.notifyIsDoneRendering()}))})(),Yi.jsxs(C1,{style:k,children:[Yi.jsx("div",{style:{overflow:"hidden"},ref:i,children:Yi.jsx(t4,{tableWidth:n.width,leftGridWidth:g,columnWidths:v,getHeaderCellsIconsVisibilityStatus:S,rowHight:e,height:E.height,changeSortOrder:r,overrideLeftGridWidth:C})}),Yi.jsx(M1,{style:D.topGrid,origin:hX.TopGrid,ref:o,children:Yi.jsx(S1,{style:M.fullSizeWrapper,children:Yi.jsx(_1,{style:M.stickyWrapper,children:Yi.jsx(Pfe,{topGridRef:l,rowHightCallback:P,...M.self,showLastBorder:{right:x,bottom:!1},getRightGridColumnWidth:w})})})}),Yi.jsx(M1,{style:D.leftGrid,origin:hX.LeftGrid,ref:a,children:Yi.jsx(S1,{style:_.fullSizeWrapper,children:Yi.jsx(_1,{style:_.stickyWrapper,children:Yi.jsx(_fe,{leftGridRef:c,..._.self,columnWidths:v,showLastBorder:{right:!1,bottom:I}})})})}),Yi.jsx(M1,{style:D.dataGrid,origin:hX.DataGrid,ref:s,children:Yi.jsx(S1,{style:R.fullSizeWrapper,children:Yi.jsx(_1,{style:R.stickyWrapper,children:Yi.jsx(y3,{dataGridRef:u,rowHightCallback:A,...R.self,showLastBorder:{right:x,bottom:I},getRightGridColumnWidth:w,verticalScrollDirection:d,horizontalScrollDirection:f})})})})]})},Ofe=()=>{const{keyboard:e,theme:t,interactions:n,translator:r}=SZ(),{pageInfo:i,updatePageInfo:o,rect:a}=bZ(),{layoutService:s}=EZ(),{layout:l,hasData:c}=s;return Yi.jsxs(Yi.Fragment,{children:[c?Yi.jsx(Afe,{}):null,Yi.jsx(_Z,{}),Yi.jsx(gZ,{paginationNeeded:i.shouldShowPagination,handleChangePage:e=>{o({page:e})},pageInfo:i,totalRowCount:i.totalRowCount,totalColumnCount:0,totalPages:i.totalPages,keyboard:e,translator:r,theme:t,interactions:n,rect:a,layout:l})]})};const Lfe=(e,{selections:t,baseObjects:n,coreServices:r,nebulaObjects:i})=>{const o=function(e){const t=DA();return t?.components?.MuiTable?.styleOverrides&&(t.components.MuiTable.styleOverrides.root={}),ws({...t,direction:e})}(n.direction);e.render(Yi.jsx(Re.StrictMode,{children:Yi.jsx(al,{theme:o,children:Yi.jsx(CZ,{...i,children:Yi.jsx(xZ,{...n,children:Yi.jsx(O5,{selections:t,children:Yi.jsx(MZ,{...r,children:Yi.jsx(K0,{children:Yi.jsx(Ofe,{})})})})})})})}))};var Tfe=function(e){return e.FontSize="fontSize",e.FontFamily="fontFamily",e.FontColor="fontColor",e.FontStyle="fontStyle",e.Background="background",e.LineClamp="lineClamp",e.ColumnLineClamp="columnLineClamp",e.Border="border",e.Divider="divider",e}(Tfe||{}),qfe=function(e){return e.Dimension="object.pivotTableV2.dimension",e.Measure="object.pivotTableV2.measure",e.Total="object.pivotTableV2.total",e.Null="object.pivotTableV2.null",e.Grid="object.pivotTableV2",e}(qfe||{}),Nfe=function(e){return e.Grid="grid",e.Divider="grid.divider",e.LabelName="label.name",e.LabelValue="label.value",e}(Nfe||{}),jfe=function(e){return e.FontSize="fontSize",e.FontFamily="fontFamily",e.FontColor="color",e.BackgroundColor="backgroundColor",e.LineClamp="lineClamp",e.ColumnLineClamp="columnLineClamp",e.BorderColor="borderColor",e}(jfe||{});const zfe=e=>e?`${parseInt(e,10)}px`:void 0,Ffe=(e,t)=>{if(t){const n=e.getColorPickerColor(t);return"none"===n?VX.Transparent:n}},Wfe=(e,t)=>+(parseInt(e,10)*BX*t+8).toFixed(2),$fe=(e,t)=>void 0===e?t:e.some((e=>"bold"===e))?WX:"normal",Bfe=e=>e?.some((e=>"italic"===e))?"italic":"normal",Vfe=e=>e?.some((e=>"underline"===e))?"underline":"none",Hfe=document.createElement("textarea");function Ufe(e){Hfe.value=e,document.body.appendChild(Hfe),Hfe.select(),Hfe.setSelectionRange(0,Hfe.value.length),document.execCommand("copy"),document.body.removeChild(Hfe)}Hfe.style.position="absolute",Hfe.style.left="-9999px",Hfe.setAttribute("readonly","");function Gfe(t){e.onContextMenu?.(((e,n)=>{const r=n.target,i=r?.closest(`.${GG}`);i?.title&&e.addItem({translation:"contextMenu.copyCellValue",icon:"lui-icon lui-icon--copy",tid:"copy-cell-context-item",id:"copy-cell-context-item",select:async()=>{(e=>{const t=e.title;t&&(navigator.clipboard?.writeText?navigator.clipboard.writeText(t).catch((()=>{Ufe(t)})):Ufe(t))})(i)}}),t?.forEach((t=>{t(e,n,i)}))}))}const Yfe=({model:e,layoutService:t,effectivePropertiesService:n,translator:r})=>uJ(((i,o,a)=>{if(!e||n.qAlwaysFullyExpanded)return;const s=e,l=i.addItem({translation:"Object.PivotTable.ContextMenu.ExpandCollapse",tid:"expand-collapse-group",id:"expand-collapse-group"}),{qEffectiveDimensionName:c,label:u}=((e,t)=>{const n=((e,t)=>{const n=e?.getAttribute("data-dimension-info-index");if("string"==typeof n)return t.getDimensionInfo(+n)})(e,t);return"object"==typeof n?{qEffectiveDimensionName:n.qEffectiveDimensionName,label:n.qFallbackTitle}:{qEffectiveDimensionName:void 0,label:void 0}})(a,t);l.addItem((e=>({icon:"lui-icon lui-icon--plus",translation:"Object.PivotTable.ContextMenu.ExpandAll",tid:"expand-all",select:async()=>{try{await e.expandTop(RZ,0,0,!0),await e.expandLeft(RZ,0,0,!0)}catch(e){console.error("Failed to expand all",e)}}}))(s)),"string"==typeof c&&l.addItem((({model:e,effectivePropertiesService:t,qEffectiveDimensionName:n,label:r,translator:i})=>({icon:"lui-icon lui-icon--plus",translation:i.get("SNPivotTable.ContextMenu.ExpandDimension",[r??""]),tid:"expand-dimension",id:"expand-dimension",select:N3({model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:n,action:L3.Expand})}))({model:s,effectivePropertiesService:n,qEffectiveDimensionName:c,label:u,translator:r})),l.addItem((e=>({icon:"lui-icon lui-icon--minus",translation:"Object.PivotTable.ContextMenu.CollapseAll",tid:"collapse-all",select:async()=>{try{await e.collapseTop(RZ,0,0,!0),await e.collapseLeft(RZ,0,0,!0)}catch(e){console.error("Failed to collapse all",e)}}}))(s)),"string"==typeof c&&l.addItem((({model:e,effectivePropertiesService:t,qEffectiveDimensionName:n,label:r,translator:i})=>({icon:"lui-icon lui-icon--minus",translation:i.get("SNPivotTable.ContextMenu.CollapseDimension",[r??""]),tid:"collapse-dimension",id:"collapse-dimension",select:N3({model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:n,action:L3.Collapse})}))({model:s,effectivePropertiesService:n,qEffectiveDimensionName:c,label:u,translator:r}))}),[e,t,n]),Kfe=(t,n)=>e.useMemo((()=>(({layout:e})=>{const{qHyperCube:t,nullValueRepresentation:n,snapshotData:r}=e,{qNoOfLeftDims:i,qEffectiveInterColumnSortOrder:o,qMeasureInfo:a,qDimensionInfo:s}=t,l=!!r,c=r?.content?.rowsPerPage??15e3,u={x:Math.min(e.qHyperCube.qSize.qcx,$X),y:Math.min(e.qHyperCube.qSize.qcy,c)},d=o.slice(0,i),f=e=>d.some((t=>t===e)),h=f(IZ),p=new Map(o.map((e=>[s[e]??IZ,e]))),m=a.filter((e=>7005!==e.qError?.qErrorCode));return{layout:e,getNullValueText:()=>n?.text??"-",getMeasureInfoIndexFromCellIndex:(e,t=!1)=>{if(h)return 0;const n=e%m.length;return t?n:a.findIndex((e=>e===m[n]))},getDimensionInfo:e=>e===IZ?void 0:s.at(e),getDimensionInfoIndex:e=>p.get(e)??-1,size:u,isSnapshot:l,hasLimitedData:!l&&u.x<e.qHyperCube.qSize.qcx,hasData:u.x>0&&u.y>0,hasLeftDimensions:0!==e.qHyperCube.qNoOfLeftDims,hasPseudoDimOnLeft:h,leftDimensionInfoIndexes:d,isLeftDimension:f,triggerdByExpandOrCollapse:!!e.qHyperCube.qLastExpandedPos,visibleMeasureInfo:m,isIndentModeEnabled:Boolean(e.qHyperCube.qIndentMode),indentModeColumnWidth:e.qHyperCube.indentModeColumnWidth??{type:JG.Auto,pixels:XG.PixelsDefault,percentage:XG.PercentageDefault},searchSortFromDimension:"inherit"===e.search?.sorting}})({layout:t})),[t,n]),Xfe=({model:e,layoutService:t,viewService:n,pageInfo:r,rect:i})=>{const{layout:o,isSnapshot:a,triggerdByExpandOrCollapse:s}=t,l=(e=>{const t=fJ(e);return t.current=e,t})($0(i));return vJ((async()=>{const{qHyperCube:t}=o,{maxNumberOfVisibleRows:i,maxNumberOfVisibleColumns:c}=l.current;if(a)return o.snapshotData?.content?.qPivotDataPages??[];if(void 0!==e&&"getHyperCubePivotData"in e&&(((e,t,n,r)=>!!e&&(t.gridColumnStartIndex+t.gridWidth>=r||t.gridRowStartIndex+t.gridHeight>=n))(s,n,i,c)||((e,t,n,r)=>{const{qHyperCube:{qPivotDataPages:i,qSize:o}}=e,{qTop:a,qWidth:s,qHeight:l}=i[0]?.qArea??{qTop:0,qWidth:0,qHeight:0};return a<t.page*t.rowsPerPage||s<Math.min(r,o.qcx)||l<Math.min(n,o.qcy)})(o,r,i,c))){const t=((e,t,n,r,i,o)=>{const a=r.page*r.rowsPerPage,s=Math.min(a+r.rowsPerPage,n.qcy),l=Math.min($X,n.qcx);if(n.qcy<a)return null;let c=0,u=a;if(e){c=t.gridColumnStartIndex,u=a+t.gridRowStartIndex;const e=u+t.gridHeight,n=t.gridColumnStartIndex+t.gridWidth;e>s&&(u=Math.max(0,s-i)),n>l&&(c=Math.max(0,l-o))}return{qLeft:c,qTop:u,qWidth:Math.min(l-c,o),qHeight:Math.min(s-u,i)}})(s,n,o.qHyperCube.qSize,r,i,c);return t?e.getHyperCubePivotData(RZ,B0(t)):[]}return t.qPivotDataPages}),[o,a,e,n,r.page,r.rowsPerPage,l,s])},Jfe=({rowsPerPage:e,totalRowCount:t,page:n})=>Math.min(e,t-n*e),Qfe=(e,t,n=15e3)=>({rowsPerPage:n,totalPages:Math.max(1,Math.ceil(e/n)),totalRowCount:e,rowsOnCurrentPage:Jfe({rowsPerPage:n,totalRowCount:e,page:t})}),Zfe=15,ehe=({layoutService:t,viewService:n,rect:r,model:i,pageInfo:o})=>{const{freeResize:a}=e.useOptions();return e.onTakeSnapshot((async e=>{const t=e;if(!t.snapshotData||!i||t.snapshotData.content)return t;if("getHyperCubePivotData"in i){const{scrollTop:e,scrollLeft:a,leftGridScrollLeft:s,topGridScrollTop:l}=n,c=((e,t,n)=>{const{gridColumnStartIndex:r,gridRowStartIndex:i,gridWidth:o,gridHeight:a}=e,s=t.page*t.rowsPerPage,l=Math.max(r-Zfe,0),c=Math.max(s+i-Zfe,s,0),u=$X-l,d=s+t.rowsOnCurrentPage-c;if((e=>0===e.gridWidth&&0===e.gridHeight)(e)){const{maxNumberOfVisibleColumns:e,maxNumberOfVisibleRows:t}=$0(n);return{qLeft:l,qTop:c,qWidth:Math.min(u,e+30),qHeight:Math.min(d,t+30)}}return{qLeft:l,qTop:c,qWidth:Math.min(u,o+30),qHeight:Math.min(d,a+30)}})(n,o,r),u=B0(c),d={qLeft:0,qTop:o.page*o.rowsPerPage,qWidth:1,qHeight:1};t.snapshotData.content={qPivotDataPages:await i.getHyperCubePivotData(RZ,[d,...u]),scrollTop:e,scrollLeft:a,leftGridScrollLeft:s,topGridScrollTop:l,page:o.page,rowsPerPage:o.rowsPerPage},t.snapshotData.object.size.w=r.width,t.snapshotData.object.size.h=r.height}return t})),e.useImperativeHandle((()=>({getViewState:()=>((e,t)=>({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,leftGridScrollLeft:e.leftGridScrollLeft,topGridScrollTop:e.topGridScrollTop,renderPage:t.page}))(n,o)})),[n]),t.layout.snapshotData?.content&&!a?{left:r.left,top:r.top,width:t.layout.snapshotData.object.size.w,height:t.layout.snapshotData.object.size.h}:r};var the={SNPivotTable_ContextMenu_CollapseDimension:{id:"SNPivotTable.ContextMenu.CollapseDimension",locale:{"de-DE":"{0} reduzieren","en-US":"Collapse {0}","es-ES":"Contraer {0}","fr-FR":"Réduire {0}","it-IT":"Comprimi {0}","ja-JP":"{0} を折りたたむ","ko-KR":"{0} 축소","nl-NL":"{0} samenvouwen","pl-PL":"Zwiń {0}","pt-BR":"Recolher {0}","ru-RU":"Свернуть {0}","sv-SE":"Dölj {0}","tr-TR":"{0} öğelerini daralt","zh-CN":"折叠 {0}","zh-TW":"收合 {0}"}},SNPivotTable_ContextMenu_ExpandDimension:{id:"SNPivotTable.ContextMenu.ExpandDimension",locale:{"de-DE":"{0} erweitern","en-US":"Expand {0}","es-ES":"Expandir {0}","fr-FR":"Développer {0}","it-IT":"Espandi {0}","ja-JP":"{0} を展開","ko-KR":"{0} 확장","nl-NL":"{0} uitvouwen","pl-PL":"Rozwiń {0}","pt-BR":"Expandir {0}","ru-RU":"Развернуть {0}","sv-SE":"Visa {0}","tr-TR":"{0} öğelerini genişlet","zh-CN":"展开 {0}","zh-TW":"展開 {0}"}},SNPivotTable_IndentMode_Rows:{id:"SNPivotTable.IndentMode.Rows",locale:{"de-DE":"Zeilen","en-US":"Rows","es-ES":"Filas","fr-FR":"Lignes","it-IT":"Righe","ja-JP":"行","ko-KR":"행","nl-NL":"Rijen","pl-PL":"Wiersze","pt-BR":"Linhas","ru-RU":"Строки","sv-SE":"Rader","tr-TR":"Satırlar","zh-CN":"行","zh-TW":"列"}},SNPivotTable_LimitedData:{id:"SNPivotTable.LimitedData",locale:{"de-DE":"* Derzeit wird eine begrenzte Anzahl Spalten angezeigt","en-US":"* Currently showing a limited number of columns","es-ES":"* Actualmente mostrando un número limitado de columnas","fr-FR":"*Affichage actuel d'un nombre limité de colonnes","it-IT":"* Attualmente visualizzato un numero limitato di colonne","ja-JP":"* 現在、限られた列の数を表示","ko-KR":"* 현재 제한된 수의 열만 표시","nl-NL":"* Op dit moment wordt slechts een beperkt aantal kolommen getoond","pl-PL":"* Obecnie wyświetlana jest ograniczona liczba kolumn","pt-BR":"* Atualmente mostrando um número limitado de colunas","ru-RU":"* В настоящее время отображается ограниченное количество столбцов","sv-SE":"* Visar för närvarande ett begränsat antal kolumner","tr-TR":"*Şu anda sınırlı sayıda sütun gösteriliyor","zh-CN":"* 当前显示的列数有限","zh-TW":"* 目前顯示有限欄數"}},SNPivotTable_NoData:{id:"SNPivotTable.NoData",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, weil es keine Werte enthält.","en-US":"The chart is not displayed because it contains no values.","es-ES":"El gráfico no se muestra porque no contiene valores.","fr-FR":"Le graphique n'est pas affiché, car il ne contient aucune valeur.","it-IT":"Il grafico non è visualizzato poiché non contiene alcun valore.","ja-JP":"チャートには値が含まれていないため、チャートは表示されません。","ko-KR":"차트에 값이 없으므로 차트가 표시되지 않습니다.","nl-NL":"Het diagram wordt niet weergegeven omdat deze geen waarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ nie zawiera wartości.","pt-BR":"O gráfico não foi exibido porque não contém valores.","ru-RU":"Диаграмма не отображается, так как не содержит значений.","sv-SE":"Diagrammet visas inte eftersom det inte innehåller några värden.","tr-TR":"Değer içermemesi nedeniyle grafik görüntülenmiyor.","zh-CN":"图表未显示,因为它不包含任何值。","zh-TW":"系統不會顯示圖表,因為這沒有包含任何值。"}}};const nhe=()=>{const t=e.useTranslator(),n=t.language();return e.useMemo((()=>{!function(e){const t="SNPivotTable_LimitedData";e.get(t)===t&&Object.keys(the).forEach((t=>{e.add(the[t])}))}(t)}),[t]),{translator:t,language:n}},rhe=t=>{const{flags:n}=t,r=e.useElement(),i=(t=>{const n=e.useMemo((()=>CJ(t)),[t]);return e.useEffect((()=>()=>{n.unmount()}),[n]),n})(r),o=e.useStaleLayout(),a=e.useModel(),s=e.useApp(),l=e.useEmbed(),c=e.useKeyboard(),u=(()=>{const{viewState:t}=e.useOptions(),n=fJ(new Set),r=void 0!==window.qlikprinting,{promise:i,resolve:o}=e.useMemo((()=>cJ()),[]),a=uJ((e=>{n.current.add(e)}),[n]),s=uJ(mT((async()=>{await Promise.all(n.current),n.current.clear(),o()}),1e3),[o,n]);return e.usePromise((async()=>{await i}),[i]),e.useMemo((()=>({viewState:t,isDownloadedAsPDForImage:r,notifyIsDoneRendering:s,waitForPromise:a})),[s,r,t,a])})(),d=((t,n)=>{const[r]=vJ((async()=>{if(void 0!==t&&!n.snapshotData&&"getEffectiveProperties"in t)return{...await t.getEffectiveProperties()}}),[t,n]),i=e.useMemo((()=>{const e=void 0!==r?.qHyperCubeDef.qSortbyYValue&&1===Math.abs(r.qHyperCubeDef.qSortbyYValue),t=r?.qHyperCubeDef.qDimensions.map((e=>e.qDef?.qSortCriterias))??[];return{qAlwaysFullyExpanded:r?.qHyperCubeDef.qAlwaysFullyExpanded??!1,qExpansionState:r?.qHyperCubeDef.qExpansionState,isSortedByFirstMeasure:e,getSortCriteriaForDimension:e=>t[e]}}),[r]);return i})(a,o),f=Kfe(o,n),h=(t=>{const n=e.useInteractionState();return{...n,select:!!n.active&&!!n.select&&!t,active:!!n.active&&!t,scroll:!!n.active}})(f.isSnapshot),p=e.useSelections(),m=yJ(o,r),{translator:g,language:y}=nhe(),{pageInfo:v,updatePageInfo:b}=((t,n)=>{const{size:r,layout:{qHyperCube:{qSize:i}}}=t,o=n.isDownloadedAsPDForImage||t.isSnapshot,a=(e=>e.layout.snapshotData?.content?.rowsPerPage)(t),[s,l]=e.useState((()=>{const e=((e,t)=>t.isDownloadedAsPDForImage?t.viewState?.renderPage??0:e.isSnapshot?e.layout.snapshotData?.content?.page??0:0)(t,n);return{page:e,shouldShowPagination:i.qcy>r.y&&!o,...Qfe(i.qcy,e,a)}})),c=t.layout.qHyperCube.qSize.qcy;return e.useEffect((()=>{l((e=>({...e,...Qfe(c,e.page,a),shouldShowPagination:c>t.size.y&&!o})))}),[c,t.size.y,l,o,a]),e.useEffect((()=>{const{page:e,totalPages:t}=s;if(e+1>t){const e=t-1,n=Jfe({...s,page:e});l({...s,page:e,rowsOnCurrentPage:n})}}),[s]),{pageInfo:s,updatePageInfo:e=>{l({...s,...e,rowsOnCurrentPage:Jfe({...s,...e})})}}})(f,u),x=((t,n,r)=>e.useMemo((()=>((e,t)=>{if(e.isDownloadedAsPDForImage){const{viewState:t}=e;return{gridColumnStartIndex:0,gridRowStartIndex:0,gridWidth:0,gridHeight:0,scrollTop:t?.scrollTop??0,scrollLeft:t?.scrollLeft??0,leftGridScrollLeft:t?.leftGridScrollLeft??0,topGridScrollTop:t?.topGridScrollTop??0}}return{gridColumnStartIndex:0,gridRowStartIndex:0,gridWidth:0,gridHeight:0,scrollTop:t?.content?.scrollTop??0,scrollLeft:t?.content?.scrollLeft??0,leftGridScrollLeft:t?.content?.leftGridScrollLeft??0,topGridScrollTop:t?.content?.topGridScrollTop??0}})(r,n.snapshotData)),[r,t.page,n.snapshotData]))(v,o,u),w=ehe({rect:e.useRect(),layoutService:f,viewService:x,model:a,pageInfo:v}),[S,C]=Xfe({model:a,layoutService:f,viewService:x,pageInfo:v,rect:w}),k=e.useMemo((()=>((e,t)=>{const n=t.layout.components?.find((e=>"theme"===e.key)),r=n?.header,i=n?.dimensionValues,o=n?.measureValues,a=n?.measureLabels,s=n?.totalValues,l=n?.nullValues,c=n?.grid,u=(t,n,r)=>e.getStyle(t,n,r),d=+(c?.[Tfe.LineClamp]??u(qfe.Grid,Nfe.Grid,jfe.LineClamp)??1),f=+(c?.[Tfe.ColumnLineClamp]??u(qfe.Grid,Nfe.Grid,jfe.ColumnLineClamp)??1),h=Ffe(e,r?.[Tfe.Background])??u(qfe.Dimension,Nfe.LabelName,jfe.BackgroundColor)??VX.Transparent,p={header:{fontSize:zfe(r?.[Tfe.FontSize])??u(qfe.Dimension,Nfe.LabelName,jfe.FontSize)??zX,fontFamily:r?.[Tfe.FontFamily]??u(qfe.Dimension,Nfe.LabelName,jfe.FontFamily)??FX,fontWeight:$fe(r?.[Tfe.FontStyle],WX),fontStyle:Bfe(r?.[Tfe.FontStyle]),textDecoration:Vfe(r?.[Tfe.FontStyle]),color:Ffe(e,r?.[Tfe.FontColor])??u(qfe.Dimension,Nfe.LabelName,jfe.FontColor)??EX.TEXT,background:h,hoverBackground:RX(h,QG),activeBackground:RX(h,ZG)},dimensionValues:{fontSize:zfe(i?.[Tfe.FontSize])??u(qfe.Dimension,Nfe.LabelValue,jfe.FontSize)??zX,fontFamily:i?.[Tfe.FontFamily]??u(qfe.Dimension,Nfe.LabelValue,jfe.FontFamily)??FX,fontWeight:$fe(i?.[Tfe.FontStyle],void 0),fontStyle:Bfe(i?.[Tfe.FontStyle]),textDecoration:Vfe(i?.[Tfe.FontStyle]),color:Ffe(e,i?.[Tfe.FontColor])??u(qfe.Dimension,Nfe.LabelValue,jfe.FontColor)??EX.TEXT,background:Ffe(e,i?.[Tfe.Background])??u(qfe.Dimension,Nfe.LabelValue,jfe.BackgroundColor)??VX.Transparent},measureValues:{fontSize:zfe(o?.[Tfe.FontSize])??u(qfe.Measure,Nfe.LabelValue,jfe.FontSize)??zX,fontFamily:o?.[Tfe.FontFamily]??u(qfe.Measure,Nfe.LabelValue,jfe.FontFamily)??FX,fontWeight:$fe(o?.[Tfe.FontStyle],"normal"),fontStyle:Bfe(o?.[Tfe.FontStyle]),textDecoration:Vfe(o?.[Tfe.FontStyle]),color:Ffe(e,o?.[Tfe.FontColor])??u(qfe.Measure,Nfe.LabelValue,jfe.FontColor)??VX.FontSecondary,background:Ffe(e,o?.[Tfe.Background])??u(qfe.Measure,Nfe.LabelValue,jfe.BackgroundColor)??VX.Transparent},measureLabels:{fontWeight:$fe(a?.[Tfe.FontStyle],"normal"),fontStyle:Bfe(a?.[Tfe.FontStyle]),textDecoration:Vfe(a?.[Tfe.FontStyle]),color:Ffe(e,a?.[Tfe.FontColor])??u(qfe.Measure,Nfe.LabelName,jfe.FontColor)??VX.FontSecondary,background:Ffe(e,a?.[Tfe.Background])??u(qfe.Measure,Nfe.LabelName,jfe.BackgroundColor)??VX.Transparent},totalValues:{fontWeight:$fe(s?.[Tfe.FontStyle],WX),fontStyle:Bfe(s?.[Tfe.FontStyle]),textDecoration:Vfe(s?.[Tfe.FontStyle]),color:Ffe(e,s?.[Tfe.FontColor])??u(qfe.Total,Nfe.LabelValue,jfe.FontColor)??EX.TEXT,background:Ffe(e,s?.[Tfe.Background])??u(qfe.Total,Nfe.LabelValue,jfe.BackgroundColor)??VX.Transparent},nullValues:{fontWeight:$fe(l?.[Tfe.FontStyle],"normal"),fontStyle:Bfe(l?.[Tfe.FontStyle]),textDecoration:Vfe(l?.[Tfe.FontStyle]),color:Ffe(e,l?.[Tfe.FontColor])??u(qfe.Null,Nfe.LabelValue,jfe.FontColor)??EX.TEXT,background:Ffe(e,l?.[Tfe.Background])??u(qfe.Null,Nfe.LabelValue,jfe.BackgroundColor)??VX.NullValueBackground},grid:{columnLineClamp:f,lineClamp:d,border:Ffe(e,c?.[Tfe.Border])??u(qfe.Grid,Nfe.Grid,jfe.BorderColor)??VX.DividerLight,divider:Ffe(e,c?.[Tfe.Divider])??u(qfe.Grid,Nfe.Divider,jfe.BorderColor)??VX.DividerDark,background:Ffe(e,c?.[Tfe.Background])??u(qfe.Grid,Nfe.Grid,jfe.BackgroundColor)??VX.Transparent},selectedColors:_X(e)};return p.headerCellHeight=Math.max(Wfe(p.header.fontSize,f),Wfe(p.dimensionValues.fontSize,f),32),p.contentCellHeight=Math.max(Wfe(p.measureValues.fontSize,d),Wfe(p.dimensionValues.fontSize,d),24),p.dimensionValueTextHeight=Wfe(p.dimensionValues.fontSize,1),p})(m,f)),[m,f]),E=((e,t,n)=>{const[,r,i]=vJ((async()=>{const t=fL(n.flags),r=e.getStyle("","","fontFamily"),i=e.getStyle("object","label.name","fontFamily"),o=e.getStyle("object","label.value","fontFamily"),a=e.getStyle("","","fontFamilies")??[];return Promise.all([...t,...a,r,i,o,EJ].filter((e=>void 0!==e)).map((async e=>{await document.fonts.load(`600 12px ${e}`),await document.fonts.load(`12px ${e}`)})))}),[t,e,n]);return i?(console.warn("Failed to load fonts:",i),!0):!r})(m,o,t),{direction:M}=e.useOptions();Gfe([Yfe({model:a,layoutService:f,effectivePropertiesService:d,translator:g})]),e.useEffect((()=>{!C&&a&&!!S&&E&&Lfe(i,{selections:p,baseObjects:{rect:w,pageInfo:v,qPivotDataPages:S,updatePageInfo:b,direction:M},nebulaObjects:{env:t,app:s,model:a,embed:l,theme:m,keyboard:c,translator:g,interactions:h},coreServices:{styleService:k,viewService:x,layoutService:f,downloadService:u,effectivePropertiesService:d}})}),[a,s,w,h,p,x,f,u,C,S,k,i,E,g,y,v,b,d,l,c,m,t,M])},ihe={version:"7.9.0",qHyperCubeDef:{qAlwaysFullyExpanded:!1,qDimensions:[],qMeasures:[],qMode:"P",qSuppressMissing:!0,qSuppressZero:!1,qShowTotalsAbove:!0,qInitialDataFetch:[{qTop:0,qLeft:0,qWidth:50,qHeight:50}],qIndentMode:!1},showTitles:!0,title:"",subtitle:"",footnote:"",nullValueRepresentation:{text:"-"},components:[]};return function(e){return{qae:{properties:{initial:{...ihe,qHyperCubeDef:{...ihe.qHyperCubeDef,qIndentMode:!1}}},data:YK(e)},ext:lJ(e),component(){rhe(e)}}}}));
|