react-semaphor 0.0.296 → 0.0.298

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.
@@ -106,7 +106,7 @@ object-assign
106
106
  */var a1,XP;function rK(){if(XP)return a1;XP=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var a={},s=0;s<10;s++)a["_"+String.fromCharCode(s)]=s;var l=Object.getOwnPropertyNames(a).map(function(u){return a[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return a1=o()?Object.assign:function(i,a){for(var s,l=r(i),c,u=1;u<arguments.length;u++){s=Object(arguments[u]);for(var d in s)t.call(s,d)&&(l[d]=s[d]);if(e){c=e(s);for(var h=0;h<c.length;h++)n.call(s,c[h])&&(l[c[h]]=s[c[h]])}}return l},a1}var s1,QP;function Nk(){return QP||(QP=1,s1=Function.call.bind(Object.prototype.hasOwnProperty)),s1}var l1,JP;function oK(){if(JP)return l1;JP=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=tC(),n={},r=Nk();e=function(i){var a="Warning: "+i;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function o(i,a,s,l,c){if(process.env.NODE_ENV!=="production"){for(var u in i)if(r(i,u)){var d;try{if(typeof i[u]!="function"){var h=Error((l||"React class")+": "+s+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}d=i[u](a,u,l,s,null,t)}catch(v){d=v}if(d&&!(d instanceof Error)&&e((l||"React class")+": type specification of "+s+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var p=c?c():"";e("Failed "+s+" type: "+d.message+(p??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},l1=o,l1}var c1,ZP;function iK(){if(ZP)return c1;ZP=1;var e=Ik(),t=rK(),n=tC(),r=Nk(),o=oK(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(s){var l="Warning: "+s;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function a(){return null}return c1=function(s,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(O){var H=O&&(c&&O[c]||O[u]);if(typeof H=="function")return H}var h="<<anonymous>>",p={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:_(),arrayOf:S,element:C(),elementType:E(),instanceOf:$,node:L(),objectOf:D,oneOf:T,oneOfType:M,shape:z,exact:X};function v(O,H){return O===H?O!==0||1/O===1/H:O!==O&&H!==H}function b(O,H){this.message=O,this.data=H&&typeof H=="object"?H:{},this.stack=""}b.prototype=Error.prototype;function x(O){if(process.env.NODE_ENV!=="production")var H={},Y=0;function I(ce,de,he,ie,re,le,xe){if(ie=ie||h,le=le||he,xe!==n){if(l){var Z=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw Z.name="Invariant Violation",Z}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ve=ie+":"+he;!H[ve]&&Y<3&&(i("You are manually calling a React.PropTypes validation function for the `"+le+"` prop on `"+ie+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),H[ve]=!0,Y++)}}return de[he]==null?ce?de[he]===null?new b("The "+re+" `"+le+"` is marked as required "+("in `"+ie+"`, but its value is `null`.")):new b("The "+re+" `"+le+"` is marked as required in "+("`"+ie+"`, but its value is `undefined`.")):null:O(de,he,ie,re,le)}var te=I.bind(null,!1);return te.isRequired=I.bind(null,!0),te}function y(O){function H(Y,I,te,ce,de,he){var ie=Y[I],re=U(ie);if(re!==O){var le=V(ie);return new b("Invalid "+ce+" `"+de+"` of type "+("`"+le+"` supplied to `"+te+"`, expected ")+("`"+O+"`."),{expectedType:O})}return null}return x(H)}function _(){return x(a)}function S(O){function H(Y,I,te,ce,de){if(typeof O!="function")return new b("Property `"+de+"` of component `"+te+"` has invalid PropType notation inside arrayOf.");var he=Y[I];if(!Array.isArray(he)){var ie=U(he);return new b("Invalid "+ce+" `"+de+"` of type "+("`"+ie+"` supplied to `"+te+"`, expected an array."))}for(var re=0;re<he.length;re++){var le=O(he,re,te,ce,de+"["+re+"]",n);if(le instanceof Error)return le}return null}return x(H)}function C(){function O(H,Y,I,te,ce){var de=H[Y];if(!s(de)){var he=U(de);return new b("Invalid "+te+" `"+ce+"` of type "+("`"+he+"` supplied to `"+I+"`, expected a single ReactElement."))}return null}return x(O)}function E(){function O(H,Y,I,te,ce){var de=H[Y];if(!e.isValidElementType(de)){var he=U(de);return new b("Invalid "+te+" `"+ce+"` of type "+("`"+he+"` supplied to `"+I+"`, expected a single ReactElement type."))}return null}return x(O)}function $(O){function H(Y,I,te,ce,de){if(!(Y[I]instanceof O)){var he=O.name||h,ie=q(Y[I]);return new b("Invalid "+ce+" `"+de+"` of type "+("`"+ie+"` supplied to `"+te+"`, expected ")+("instance of `"+he+"`."))}return null}return x(H)}function T(O){if(!Array.isArray(O))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),a;function H(Y,I,te,ce,de){for(var he=Y[I],ie=0;ie<O.length;ie++)if(v(he,O[ie]))return null;var re=JSON.stringify(O,function(xe,Z){var ve=V(Z);return ve==="symbol"?String(Z):Z});return new b("Invalid "+ce+" `"+de+"` of value `"+String(he)+"` "+("supplied to `"+te+"`, expected one of "+re+"."))}return x(H)}function D(O){function H(Y,I,te,ce,de){if(typeof O!="function")return new b("Property `"+de+"` of component `"+te+"` has invalid PropType notation inside objectOf.");var he=Y[I],ie=U(he);if(ie!=="object")return new b("Invalid "+ce+" `"+de+"` of type "+("`"+ie+"` supplied to `"+te+"`, expected an object."));for(var re in he)if(r(he,re)){var le=O(he,re,te,ce,de+"."+re,n);if(le instanceof Error)return le}return null}return x(H)}function M(O){if(!Array.isArray(O))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var H=0;H<O.length;H++){var Y=O[H];if(typeof Y!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+K(Y)+" at index "+H+"."),a}function I(te,ce,de,he,ie){for(var re=[],le=0;le<O.length;le++){var xe=O[le],Z=xe(te,ce,de,he,ie,n);if(Z==null)return null;Z.data&&r(Z.data,"expectedType")&&re.push(Z.data.expectedType)}var ve=re.length>0?", expected one of type ["+re.join(", ")+"]":"";return new b("Invalid "+he+" `"+ie+"` supplied to "+("`"+de+"`"+ve+"."))}return x(I)}function L(){function O(H,Y,I,te,ce){return G(H[Y])?null:new b("Invalid "+te+" `"+ce+"` supplied to "+("`"+I+"`, expected a ReactNode."))}return x(O)}function F(O,H,Y,I,te){return new b((O||"React class")+": "+H+" type `"+Y+"."+I+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+te+"`.")}function z(O){function H(Y,I,te,ce,de){var he=Y[I],ie=U(he);if(ie!=="object")return new b("Invalid "+ce+" `"+de+"` of type `"+ie+"` "+("supplied to `"+te+"`, expected `object`."));for(var re in O){var le=O[re];if(typeof le!="function")return F(te,ce,de,re,V(le));var xe=le(he,re,te,ce,de+"."+re,n);if(xe)return xe}return null}return x(H)}function X(O){function H(Y,I,te,ce,de){var he=Y[I],ie=U(he);if(ie!=="object")return new b("Invalid "+ce+" `"+de+"` of type `"+ie+"` "+("supplied to `"+te+"`, expected `object`."));var re=t({},Y[I],O);for(var le in re){var xe=O[le];if(r(O,le)&&typeof xe!="function")return F(te,ce,de,le,V(xe));if(!xe)return new b("Invalid "+ce+" `"+de+"` key `"+le+"` supplied to `"+te+"`.\nBad object: "+JSON.stringify(Y[I],null," ")+`
107
107
  Valid keys: `+JSON.stringify(Object.keys(O),null," "));var Z=xe(he,le,te,ce,de+"."+le,n);if(Z)return Z}return null}return x(H)}function G(O){switch(typeof O){case"number":case"string":case"undefined":return!0;case"boolean":return!O;case"object":if(Array.isArray(O))return O.every(G);if(O===null||s(O))return!0;var H=d(O);if(H){var Y=H.call(O),I;if(H!==O.entries){for(;!(I=Y.next()).done;)if(!G(I.value))return!1}else for(;!(I=Y.next()).done;){var te=I.value;if(te&&!G(te[1]))return!1}}else return!1;return!0;default:return!1}}function A(O,H){return O==="symbol"?!0:H?H["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&H instanceof Symbol:!1}function U(O){var H=typeof O;return Array.isArray(O)?"array":O instanceof RegExp?"object":A(H,O)?"symbol":H}function V(O){if(typeof O>"u"||O===null)return""+O;var H=U(O);if(H==="object"){if(O instanceof Date)return"date";if(O instanceof RegExp)return"regexp"}return H}function K(O){var H=V(O);switch(H){case"array":case"object":return"an "+H;case"boolean":case"date":case"regexp":return"a "+H;default:return H}}function q(O){return!O.constructor||!O.constructor.name?h:O.constructor.name}return p.checkPropTypes=o,p.resetWarningCache=o.resetWarningCache,p.PropTypes=p,p},c1}if(process.env.NODE_ENV!=="production"){var aK=Ik(),sK=!0;Dw.exports=iK()(aK.isElement,sK)}else Dw.exports=eK()();var Ks=Dw.exports,$b={exports:{}},Lk={};function Fk(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Fk(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function e$(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Fk(e))&&(r&&(r+=" "),r+=t);return r}const lK=Object.freeze(Object.defineProperty({__proto__:null,clsx:e$,default:e$},Symbol.toStringTag,{value:"Module"})),cK=SS(lK);var Fn={},ta={};Object.defineProperty(ta,"__esModule",{value:!0});ta.dontSetMe=pK;ta.findInArray=uK;ta.int=hK;ta.isFunction=dK;ta.isNum=fK;function uK(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function dK(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function fK(e){return typeof e=="number"&&!isNaN(e)}function hK(e){return parseInt(e,10)}function pK(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))}var yc={};Object.defineProperty(yc,"__esModule",{value:!0});yc.browserPrefixToKey=zk;yc.browserPrefixToStyle=gK;yc.default=void 0;yc.getPrefix=jk;const u1=["Moz","Webkit","O","ms"];function jk(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;r<u1.length;r++)if(zk(t,u1[r])in n)return u1[r];return""}function zk(e,t){return t?"".concat(t).concat(mK(e)):e}function gK(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function mK(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]==="-"?n=!0:t+=e[r];return t}yc.default=jk();Object.defineProperty(Fn,"__esModule",{value:!0});Fn.addClassName=Hk;Fn.addEvent=yK;Fn.addUserSelectStyles=TK;Fn.createCSSTransform=RK;Fn.createSVGTransform=PK;Fn.getTouch=$K;Fn.getTouchIdentifier=OK;Fn.getTranslation=nC;Fn.innerHeight=SK;Fn.innerWidth=CK;Fn.matchesSelector=Vk;Fn.matchesSelectorAndParentsTo=vK;Fn.offsetXYFromParent=EK;Fn.outerHeight=wK;Fn.outerWidth=_K;Fn.removeClassName=Wk;Fn.removeEvent=xK;Fn.removeUserSelectStyles=DK;var Eo=ta,t$=bK(yc);function Bk(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Bk=function(r){return r?n:t})(e)}function bK(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Bk(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}let Dg="";function Vk(e,t){return Dg||(Dg=(0,Eo.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,Eo.isFunction)(e[n])})),(0,Eo.isFunction)(e[Dg])?e[Dg](t):!1}function vK(e,t,n){let r=e;do{if(Vk(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function yK(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function xK(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function wK(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Eo.int)(n.borderTopWidth),t+=(0,Eo.int)(n.borderBottomWidth),t}function _K(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Eo.int)(n.borderLeftWidth),t+=(0,Eo.int)(n.borderRightWidth),t}function SK(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Eo.int)(n.paddingTop),t-=(0,Eo.int)(n.paddingBottom),t}function CK(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Eo.int)(n.paddingLeft),t-=(0,Eo.int)(n.paddingRight),t}function EK(e,t,n){const o=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),i=(e.clientX+t.scrollLeft-o.left)/n,a=(e.clientY+t.scrollTop-o.top)/n;return{x:i,y:a}}function RK(e,t){const n=nC(e,t,"px");return{[(0,t$.browserPrefixToKey)("transform",t$.default)]:n}}function PK(e,t){return nC(e,t,"")}function nC(e,t,n){let{x:r,y:o}=e,i="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(t){const a="".concat(typeof t.x=="string"?t.x:t.x+n),s="".concat(typeof t.y=="string"?t.y:t.y+n);i="translate(".concat(a,", ").concat(s,")")+i}return i}function $K(e,t){return e.targetTouches&&(0,Eo.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,Eo.findInArray)(e.changedTouches,n=>t===n.identifier)}function OK(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function TK(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
108
108
  `,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
109
- `,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&Hk(e.body,"react-draggable-transparent-selection")}function DK(e){if(e)try{if(e.body&&Wk(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function Hk(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function Wk(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var na={};Object.defineProperty(na,"__esModule",{value:!0});na.canDragX=kK;na.canDragY=IK;na.createCoreData=LK;na.createDraggableData=FK;na.getBoundPosition=AK;na.getControlPosition=NK;na.snapToGrid=MK;var ho=ta,du=Fn;function AK(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:jK(r);const o=rC(e);if(typeof r=="string"){const{ownerDocument:i}=o,a=i.defaultView;let s;if(r==="parent"?s=o.parentNode:s=i.querySelector(r),!(s instanceof a.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=s,c=a.getComputedStyle(o),u=a.getComputedStyle(l);r={left:-o.offsetLeft+(0,ho.int)(u.paddingLeft)+(0,ho.int)(c.marginLeft),top:-o.offsetTop+(0,ho.int)(u.paddingTop)+(0,ho.int)(c.marginTop),right:(0,du.innerWidth)(l)-(0,du.outerWidth)(o)-o.offsetLeft+(0,ho.int)(u.paddingRight)-(0,ho.int)(c.marginRight),bottom:(0,du.innerHeight)(l)-(0,du.outerHeight)(o)-o.offsetTop+(0,ho.int)(u.paddingBottom)-(0,ho.int)(c.marginBottom)}}return(0,ho.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,ho.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,ho.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,ho.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function MK(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function kK(e){return e.props.axis==="both"||e.props.axis==="x"}function IK(e){return e.props.axis==="both"||e.props.axis==="y"}function NK(e,t,n){const r=typeof t=="number"?(0,du.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=rC(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,du.offsetXYFromParent)(r||e,i,n.props.scale)}function LK(e,t,n){const r=!(0,ho.isNum)(e.lastX),o=rC(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function FK(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function jK(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function rC(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var Ob={},Tb={};Object.defineProperty(Tb,"__esModule",{value:!0});Tb.default=zK;function zK(){}Object.defineProperty(Ob,"__esModule",{value:!0});Ob.default=void 0;var d1=VK(m),qr=oC(Ks),BK=oC(Er),vr=Fn,cs=na,f1=ta,Xd=oC(Tb);function oC(e){return e&&e.__esModule?e:{default:e}}function Uk(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Uk=function(r){return r?n:t})(e)}function VK(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Uk(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Dr(e,t,n){return t=HK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HK(e){var t=WK(e,"string");return typeof t=="symbol"?t:String(t)}function WK(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const ci={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let us=ci.mouse,Db=class extends d1.Component{constructor(){super(...arguments),Dr(this,"dragging",!1),Dr(this,"lastX",NaN),Dr(this,"lastY",NaN),Dr(this,"touchIdentifier",null),Dr(this,"mounted",!1),Dr(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,vr.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,vr.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,vr.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,cs.getControlPosition)(t,o,this);if(i==null)return;const{x:a,y:s}=i,l=(0,cs.createCoreData)(this,a,s);(0,Xd.default)("DraggableCore: handleDragStart: %j",l),(0,Xd.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,vr.addUserSelectStyles)(r),this.dragging=!0,this.lastX=a,this.lastY=s,(0,vr.addEvent)(r,us.move,this.handleDrag),(0,vr.addEvent)(r,us.stop,this.handleDragStop))}),Dr(this,"handleDrag",t=>{const n=(0,cs.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let s=r-this.lastX,l=o-this.lastY;if([s,l]=(0,cs.snapToGrid)(this.props.grid,s,l),!s&&!l)return;r=this.lastX+s,o=this.lastY+l}const i=(0,cs.createCoreData)(this,r,o);if((0,Xd.default)("DraggableCore: handleDrag: %j",i),this.props.onDrag(t,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=o}),Dr(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,cs.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=o-this.lastY||0;[l,c]=(0,cs.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,o=this.lastY+c}const i=(0,cs.createCoreData)(this,r,o);if(this.props.onStop(t,i)===!1||this.mounted===!1)return!1;const s=this.findDOMNode();s&&this.props.enableUserSelectHack&&(0,vr.removeUserSelectStyles)(s.ownerDocument),(0,Xd.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&((0,Xd.default)("DraggableCore: Removing handlers"),(0,vr.removeEvent)(s.ownerDocument,us.move,this.handleDrag),(0,vr.removeEvent)(s.ownerDocument,us.stop,this.handleDragStop))}),Dr(this,"onMouseDown",t=>(us=ci.mouse,this.handleDragStart(t))),Dr(this,"onMouseUp",t=>(us=ci.mouse,this.handleDragStop(t))),Dr(this,"onTouchStart",t=>(us=ci.touch,this.handleDragStart(t))),Dr(this,"onTouchEnd",t=>(us=ci.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,vr.addEvent)(t,ci.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,vr.removeEvent)(n,ci.mouse.move,this.handleDrag),(0,vr.removeEvent)(n,ci.touch.move,this.handleDrag),(0,vr.removeEvent)(n,ci.mouse.stop,this.handleDragStop),(0,vr.removeEvent)(n,ci.touch.stop,this.handleDragStop),(0,vr.removeEvent)(t,ci.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,vr.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:BK.default.findDOMNode(this)}render(){return d1.cloneElement(d1.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Ob.default=Db;Dr(Db,"displayName","DraggableCore");Dr(Db,"propTypes",{allowAnyClick:qr.default.bool,children:qr.default.node.isRequired,disabled:qr.default.bool,enableUserSelectHack:qr.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:qr.default.arrayOf(qr.default.number),handle:qr.default.string,cancel:qr.default.string,nodeRef:qr.default.object,onStart:qr.default.func,onDrag:qr.default.func,onStop:qr.default.func,onMouseDown:qr.default.func,scale:qr.default.number,className:f1.dontSetMe,style:f1.dontSetMe,transform:f1.dontSetMe});Dr(Db,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=h(m),n=u(Ks),r=u(Er),o=u(cK),i=Fn,a=na,s=ta,l=u(Ob),c=u(Tb);function u(_){return _&&_.__esModule?_:{default:_}}function d(_){if(typeof WeakMap!="function")return null;var S=new WeakMap,C=new WeakMap;return(d=function(E){return E?C:S})(_)}function h(_,S){if(!S&&_&&_.__esModule)return _;if(_===null||typeof _!="object"&&typeof _!="function")return{default:_};var C=d(S);if(C&&C.has(_))return C.get(_);var E={},$=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var T in _)if(T!=="default"&&Object.prototype.hasOwnProperty.call(_,T)){var D=$?Object.getOwnPropertyDescriptor(_,T):null;D&&(D.get||D.set)?Object.defineProperty(E,T,D):E[T]=_[T]}return E.default=_,C&&C.set(_,E),E}function p(){return p=Object.assign?Object.assign.bind():function(_){for(var S=1;S<arguments.length;S++){var C=arguments[S];for(var E in C)Object.prototype.hasOwnProperty.call(C,E)&&(_[E]=C[E])}return _},p.apply(this,arguments)}function v(_,S,C){return S=b(S),S in _?Object.defineProperty(_,S,{value:C,enumerable:!0,configurable:!0,writable:!0}):_[S]=C,_}function b(_){var S=x(_,"string");return typeof S=="symbol"?S:String(S)}function x(_,S){if(typeof _!="object"||_===null)return _;var C=_[Symbol.toPrimitive];if(C!==void 0){var E=C.call(_,S||"default");if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(_)}class y extends t.Component{static getDerivedStateFromProps(S,C){let{position:E}=S,{prevPropsPosition:$}=C;return E&&(!$||E.x!==$.x||E.y!==$.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:E,prevPropsPosition:$}),{x:E.x,y:E.y,prevPropsPosition:{...E}}):null}constructor(S){super(S),v(this,"onDragStart",(C,E)=>{if((0,c.default)("Draggable: onDragStart: %j",E),this.props.onStart(C,(0,a.createDraggableData)(this,E))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),v(this,"onDrag",(C,E)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",E);const $=(0,a.createDraggableData)(this,E),T={x:$.x,y:$.y,slackX:0,slackY:0};if(this.props.bounds){const{x:M,y:L}=T;T.x+=this.state.slackX,T.y+=this.state.slackY;const[F,z]=(0,a.getBoundPosition)(this,T.x,T.y);T.x=F,T.y=z,T.slackX=this.state.slackX+(M-T.x),T.slackY=this.state.slackY+(L-T.y),$.x=T.x,$.y=T.y,$.deltaX=T.x-this.state.x,$.deltaY=T.y-this.state.y}if(this.props.onDrag(C,$)===!1)return!1;this.setState(T)}),v(this,"onDragStop",(C,E)=>{if(!this.state.dragging||this.props.onStop(C,(0,a.createDraggableData)(this,E))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",E);const T={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:M,y:L}=this.props.position;T.x=M,T.y=L}this.setState(T)}),this.state={dragging:!1,dragged:!1,x:S.position?S.position.x:S.defaultPosition.x,y:S.position?S.position.y:S.defaultPosition.y,prevPropsPosition:{...S.position},slackX:0,slackY:0,isElementSVG:!1},S.position&&!(S.onDrag||S.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var S,C;return(S=(C=this.props)===null||C===void 0||(C=C.nodeRef)===null||C===void 0?void 0:C.current)!==null&&S!==void 0?S:r.default.findDOMNode(this)}render(){const{axis:S,bounds:C,children:E,defaultPosition:$,defaultClassName:T,defaultClassNameDragging:D,defaultClassNameDragged:M,position:L,positionOffset:F,scale:z,...X}=this.props;let G={},A=null;const V=!!!L||this.state.dragging,K=L||$,q={x:(0,a.canDragX)(this)&&V?this.state.x:K.x,y:(0,a.canDragY)(this)&&V?this.state.y:K.y};this.state.isElementSVG?A=(0,i.createSVGTransform)(q,F):G=(0,i.createCSSTransform)(q,F);const O=(0,o.default)(E.props.className||"",T,{[D]:this.state.dragging,[M]:this.state.dragged});return t.createElement(l.default,p({},X,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(E),{className:O,style:{...E.props.style,...G},transform:A}))}}e.default=y,v(y,"displayName","Draggable"),v(y,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),v(y,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(Lk);const{default:qk,DraggableCore:UK}=Lk;$b.exports=qk;$b.exports.default=qk;$b.exports.DraggableCore=UK;var Gk=$b.exports,Ab={exports:{}},lp={},iC={};iC.__esModule=!0;iC.cloneElement=QK;var qK=GK(m);function GK(e){return e&&e.__esModule?e:{default:e}}function n$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function r$(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?n$(Object(n),!0).forEach(function(r){YK(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):n$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YK(e,t,n){return t=KK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KK(e){var t=XK(e,"string");return typeof t=="symbol"?t:String(t)}function XK(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function QK(e,t){return t.style&&e.props.style&&(t.style=r$(r$({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),qK.default.cloneElement(e,t)}var cp={};cp.__esModule=!0;cp.resizableProps=void 0;var yt=JK(Ks);function JK(e){return e&&e.__esModule?e:{default:e}}var ZK={axis:yt.default.oneOf(["both","x","y","none"]),className:yt.default.string,children:yt.default.element.isRequired,draggableOpts:yt.default.shape({allowAnyClick:yt.default.bool,cancel:yt.default.string,children:yt.default.node,disabled:yt.default.bool,enableUserSelectHack:yt.default.bool,offsetParent:yt.default.node,grid:yt.default.arrayOf(yt.default.number),handle:yt.default.string,nodeRef:yt.default.object,onStart:yt.default.func,onDrag:yt.default.func,onStop:yt.default.func,onMouseDown:yt.default.func,scale:yt.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="y"){var i;return(i=yt.default.number).isRequired.apply(i,n)}return yt.default.number.apply(yt.default,n)},handle:yt.default.oneOfType([yt.default.node,yt.default.func]),handleSize:yt.default.arrayOf(yt.default.number),lockAspectRatio:yt.default.bool,maxConstraints:yt.default.arrayOf(yt.default.number),minConstraints:yt.default.arrayOf(yt.default.number),onResizeStop:yt.default.func,onResizeStart:yt.default.func,onResize:yt.default.func,resizeHandles:yt.default.arrayOf(yt.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:yt.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="x"){var i;return(i=yt.default.number).isRequired.apply(i,n)}return yt.default.number.apply(yt.default,n)}};cp.resizableProps=ZK;lp.__esModule=!0;lp.default=void 0;var Qd=oX(m),eX=Gk,tX=iC,nX=cp,rX=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function Yk(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Yk=function(o){return o?n:t})(e)}function oX(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Yk(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Aw(){return Aw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Aw.apply(this,arguments)}function iX(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function o$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function h1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?o$(Object(n),!0).forEach(function(r){aX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aX(e,t,n){return t=sX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sX(e){var t=lX(e,"string");return typeof t=="symbol"?t:String(t)}function lX(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cX(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Mw(e,t)}function Mw(e,t){return Mw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Mw(e,t)}var aC=function(e){cX(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=e.call.apply(e,[this].concat(i))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(o,i){var a=this.props,s=a.minConstraints,l=a.maxConstraints,c=a.lockAspectRatio;if(!s&&!l&&!c)return[o,i];if(c){var u=this.props.width/this.props.height,d=o-this.props.width,h=i-this.props.height;Math.abs(d)>Math.abs(h*u)?i=o/u:o=i*u}var p=o,v=i,b=this.slack||[0,0],x=b[0],y=b[1];return o+=x,i+=y,s&&(o=Math.max(s[0],o),i=Math.max(s[1],i)),l&&(o=Math.min(l[0],o),i=Math.min(l[1],i)),this.slack=[x+(p-o),y+(v-i)],[o,i]},n.resizeHandler=function(o,i){var a=this;return function(s,l){var c=l.node,u=l.deltaX,d=l.deltaY;o==="onResizeStart"&&a.resetData();var h=(a.props.axis==="both"||a.props.axis==="x")&&i!=="n"&&i!=="s",p=(a.props.axis==="both"||a.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!h&&!p)){var v=i[0],b=i[i.length-1],x=c.getBoundingClientRect();if(a.lastHandleRect!=null){if(b==="w"){var y=x.left-a.lastHandleRect.left;u+=y}if(v==="n"){var _=x.top-a.lastHandleRect.top;d+=_}}a.lastHandleRect=x,b==="w"&&(u=-u),v==="n"&&(d=-d);var S=a.props.width+(h?u/a.props.transformScale:0),C=a.props.height+(p?d/a.props.transformScale:0),E=a.runConstraints(S,C);S=E[0],C=E[1];var $=S!==a.props.width||C!==a.props.height,T=typeof a.props[o]=="function"?a.props[o]:null,D=o==="onResize"&&!$;T&&!D&&(s.persist==null||s.persist(),T(s,{node:c,size:{width:S,height:C},handle:i})),o==="onResizeStop"&&a.resetData()}}},n.renderResizeHandle=function(o,i){var a=this.props.handle;if(!a)return Qd.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+o,ref:i});if(typeof a=="function")return a(o,i);var s=typeof a.type=="string",l=h1({ref:i},s?{}:{handleAxis:o});return Qd.cloneElement(a,l)},n.render=function(){var o=this,i=this.props,a=i.children,s=i.className,l=i.draggableOpts;i.width,i.height,i.handle,i.handleSize,i.lockAspectRatio,i.axis,i.minConstraints,i.maxConstraints,i.onResize,i.onResizeStop,i.onResizeStart;var c=i.resizeHandles;i.transformScale;var u=iX(i,rX);return(0,tX.cloneElement)(a,h1(h1({},u),{},{className:(s?s+" ":"")+"react-resizable",children:[].concat(a.props.children,c.map(function(d){var h,p=(h=o.handleRefs[d])!=null?h:o.handleRefs[d]=Qd.createRef();return Qd.createElement(eX.DraggableCore,Aw({},l,{nodeRef:p,key:"resizableHandle-"+d,onStop:o.resizeHandler("onResizeStop",d),onStart:o.resizeHandler("onResizeStart",d),onDrag:o.resizeHandler("onResize",d)}),o.renderResizeHandle(d,p))}))}))},t}(Qd.Component);lp.default=aC;aC.propTypes=nX.resizableProps;aC.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var Mb={};Mb.__esModule=!0;Mb.default=void 0;var p1=pX(m),uX=Kk(Ks),dX=Kk(lp),fX=cp,hX=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function Kk(e){return e&&e.__esModule?e:{default:e}}function Xk(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Xk=function(o){return o?n:t})(e)}function pX(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Xk(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function kw(){return kw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kw.apply(this,arguments)}function i$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function h0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?i$(Object(n),!0).forEach(function(r){gX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gX(e,t,n){return t=mX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mX(e){var t=bX(e,"string");return typeof t=="symbol"?t:String(t)}function bX(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vX(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function yX(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Iw(e,t)}function Iw(e,t){return Iw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Iw(e,t)}var Qk=function(e){yX(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=e.call.apply(e,[this].concat(i))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(s,l){var c=l.size;r.props.onResize?(s.persist==null||s.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(s,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(o,i){return i.propsWidth!==o.width||i.propsHeight!==o.height?{width:o.width,height:o.height,propsWidth:o.width,propsHeight:o.height}:null};var n=t.prototype;return n.render=function(){var o=this.props,i=o.handle,a=o.handleSize;o.onResize;var s=o.onResizeStart,l=o.onResizeStop,c=o.draggableOpts,u=o.minConstraints,d=o.maxConstraints,h=o.lockAspectRatio,p=o.axis;o.width,o.height;var v=o.resizeHandles,b=o.style,x=o.transformScale,y=vX(o,hX);return p1.createElement(dX.default,{axis:p,draggableOpts:c,handle:i,handleSize:a,height:this.state.height,lockAspectRatio:h,maxConstraints:d,minConstraints:u,onResizeStart:s,onResize:this.onResize,onResizeStop:l,resizeHandles:v,transformScale:x,width:this.state.width},p1.createElement("div",kw({},y,{style:h0(h0({},b),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(p1.Component);Mb.default=Qk;Qk.propTypes=h0(h0({},fX.resizableProps),{},{children:uX.default.element});Ab.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};Ab.exports.Resizable=lp.default;Ab.exports.ResizableBox=Mb.default;var xX=Ab.exports,Ia={};Object.defineProperty(Ia,"__esModule",{value:!0});Ia.resizeHandleType=Ia.resizeHandleAxesType=Ia.default=void 0;var Et=Jk(Ks),wX=Jk(m);function Jk(e){return e&&e.__esModule?e:{default:e}}const Zk=Et.default.arrayOf(Et.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));Ia.resizeHandleAxesType=Zk;const e6=Et.default.oneOfType([Et.default.node,Et.default.func]);Ia.resizeHandleType=e6;var _X={className:Et.default.string,style:Et.default.object,width:Et.default.number,autoSize:Et.default.bool,cols:Et.default.number,draggableCancel:Et.default.string,draggableHandle:Et.default.string,verticalCompact:function(e){e.verticalCompact===!1&&process.env.NODE_ENV!=="production"&&console.warn('`verticalCompact` on <ReactGridLayout> is deprecated and will be removed soon. Use `compactType`: "horizontal" | "vertical" | null.')},compactType:Et.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&Dt.validateLayout(t,"layout")},margin:Et.default.arrayOf(Et.default.number),containerPadding:Et.default.arrayOf(Et.default.number),rowHeight:Et.default.number,maxRows:Et.default.number,isBounded:Et.default.bool,isDraggable:Et.default.bool,isResizable:Et.default.bool,allowOverlap:Et.default.bool,preventCollision:Et.default.bool,useCSSTransforms:Et.default.bool,transformScale:Et.default.number,isDroppable:Et.default.bool,resizeHandles:Zk,resizeHandle:e6,onLayoutChange:Et.default.func,onDragStart:Et.default.func,onDrag:Et.default.func,onDragStop:Et.default.func,onResizeStart:Et.default.func,onResize:Et.default.func,onResizeStop:Et.default.func,onDrop:Et.default.func,droppingItem:Et.default.shape({i:Et.default.string.isRequired,w:Et.default.number.isRequired,h:Et.default.number.isRequired}),children:function(e,t){const n=e[t],r={};wX.default.Children.forEach(n,function(o){if((o==null?void 0:o.key)!=null){if(r[o.key])throw new Error('Duplicate child key "'+o.key+'" found! This will cause problems in ReactGridLayout.');r[o.key]=!0}})},innerRef:Et.default.any};Ia.default=_X;Object.defineProperty(Pb,"__esModule",{value:!0});Pb.default=void 0;var Uc=sC(m),Gt=sC(Ks),SX=Gk,CX=xX,qc=Dt,sr=ea,a$=Ia,EX=sC(US);function sC(e){return e&&e.__esModule?e:{default:e}}function Di(e,t,n){return t=RX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RX(e){var t=PX(e,"string");return typeof t=="symbol"?t:String(t)}function PX(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class lC extends Uc.default.Component{constructor(){super(...arguments),Di(this,"state",{resizing:null,dragging:null,className:""}),Di(this,"elementRef",Uc.default.createRef()),Di(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:o,transformScale:i}=this.props;if(!o)return;const a={top:0,left:0},{offsetParent:s}=r;if(!s)return;const l=s.getBoundingClientRect(),c=r.getBoundingClientRect(),u=c.left/i,d=l.left/i,h=c.top/i,p=l.top/i;a.left=u-d+s.scrollLeft,a.top=h-p+s.scrollTop,this.setState({dragging:a});const{x:v,y:b}=(0,sr.calcXY)(this.getPositionParams(),a.top,a.left,this.props.w,this.props.h);return o.call(this,this.props.i,v,b,{e:t,node:r,newPosition:a})}),Di(this,"onDrag",(t,n)=>{let{node:r,deltaX:o,deltaY:i}=n;const{onDrag:a}=this.props;if(!a)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let s=this.state.dragging.top+i,l=this.state.dragging.left+o;const{isBounded:c,i:u,w:d,h,containerWidth:p}=this.props,v=this.getPositionParams();if(c){const{offsetParent:_}=r;if(_){const{margin:S,rowHeight:C}=this.props,E=_.clientHeight-(0,sr.calcGridItemWHPx)(h,C,S[1]);s=(0,sr.clamp)(s,0,E);const $=(0,sr.calcGridColWidth)(v),T=p-(0,sr.calcGridItemWHPx)(d,$,S[0]);l=(0,sr.clamp)(l,0,T)}}const b={top:s,left:l};this.setState({dragging:b});const{x,y}=(0,sr.calcXY)(v,s,l,d,h);return a.call(this,u,x,y,{e:t,node:r,newPosition:b})}),Di(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:o}=this.props;if(!o)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:i,h:a,i:s}=this.props,{left:l,top:c}=this.state.dragging,u={top:c,left:l};this.setState({dragging:null});const{x:d,y:h}=(0,sr.calcXY)(this.getPositionParams(),c,l,i,a);return o.call(this,s,d,h,{e:t,node:r,newPosition:u})}),Di(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),Di(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),Di(this,"onResize",(t,n,r)=>this.onResizeHandler(t,n,r,"onResize"))}shouldComponentUpdate(t,n){if(this.props.children!==t.children||this.props.droppingPosition!==t.droppingPosition)return!0;const r=(0,sr.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,sr.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,qc.fastPositionEqual)(r,o)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const o=t.droppingPosition||{left:0,top:0},{dragging:i}=this.state,a=i&&n.left!==o.left||n.top!==o.top;if(!i)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(a){const s=n.left-i.left,l=n.top-i.top;this.onDrag(n.e,{node:r,deltaX:s,deltaY:l})}}getPositionParams(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}createStyle(t){const{usePercentages:n,containerWidth:r,useCSSTransforms:o}=this.props;let i;return o?i=(0,qc.setTransform)(t):(i=(0,qc.setTopLeft)(t),n&&(i.left=(0,qc.perc)(t.left/r),i.width=(0,qc.perc)(t.width/r))),i}mixinDraggable(t,n){return Uc.default.createElement(SX.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,n){return(r,o)=>n(r,o,t)}mixinResizable(t,n,r){const{cols:o,minW:i,minH:a,maxW:s,maxH:l,transformScale:c,resizeHandles:u,resizeHandle:d}=this.props,h=this.getPositionParams(),p=(0,sr.calcGridItemPosition)(h,0,0,o,0).width,v=(0,sr.calcGridItemPosition)(h,0,0,i,a),b=(0,sr.calcGridItemPosition)(h,0,0,s,l),x=[v.width,v.height],y=[Math.min(b.width,p),Math.min(b.height,1/0)];return Uc.default.createElement(CX.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:x,maxConstraints:y,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:u,handle:d},t)}onResizeHandler(t,n,r,o){let{node:i,size:a,handle:s}=n;const l=this.props[o];if(!l)return;const{x:c,y:u,i:d,maxH:h,minH:p,containerWidth:v}=this.props,{minW:b,maxW:x}=this.props;let y=a;i&&(y=(0,qc.resizeItemInDirection)(s,r,a,v),this.setState({resizing:o==="onResizeStop"?null:y}));let{w:_,h:S}=(0,sr.calcWH)(this.getPositionParams(),y.width,y.height,c,u,s);_=(0,sr.clamp)(_,Math.max(b,1),x),S=(0,sr.clamp)(S,p,h),l.call(this,d,_,S,{e:t,node:i,size:y,handle:s})}render(){const{x:t,y:n,w:r,h:o,isDraggable:i,isResizable:a,droppingPosition:s,useCSSTransforms:l}=this.props,c=(0,sr.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),u=Uc.default.Children.only(this.props.children);let d=Uc.default.cloneElement(u,{ref:this.elementRef,className:(0,EX.default)("react-grid-item",u.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":i,"react-draggable-dragging":!!this.state.dragging,dropping:!!s,cssTransforms:l}),style:{...this.props.style,...u.props.style,...this.createStyle(c)}});return d=this.mixinResizable(d,c,a),d=this.mixinDraggable(d,i),d}}Pb.default=lC;Di(lC,"propTypes",{children:Gt.default.element,cols:Gt.default.number.isRequired,containerWidth:Gt.default.number.isRequired,rowHeight:Gt.default.number.isRequired,margin:Gt.default.array.isRequired,maxRows:Gt.default.number.isRequired,containerPadding:Gt.default.array.isRequired,x:Gt.default.number.isRequired,y:Gt.default.number.isRequired,w:Gt.default.number.isRequired,h:Gt.default.number.isRequired,minW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minWidth not Number");if(n>e.w||n>e.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxWidth not Number");if(n<e.w||n<e.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minHeight not Number");if(n>e.h||n>e.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxHeight not Number");if(n<e.h||n<e.minH)return new Error("maxHeight smaller than item height/minHeight")},i:Gt.default.string.isRequired,resizeHandles:a$.resizeHandleAxesType,resizeHandle:a$.resizeHandleType,onDragStop:Gt.default.func,onDragStart:Gt.default.func,onDrag:Gt.default.func,onResizeStop:Gt.default.func,onResizeStart:Gt.default.func,onResize:Gt.default.func,isDraggable:Gt.default.bool.isRequired,isResizable:Gt.default.bool.isRequired,isBounded:Gt.default.bool.isRequired,static:Gt.default.bool,useCSSTransforms:Gt.default.bool.isRequired,transformScale:Gt.default.number,className:Gt.default.string,handle:Gt.default.string,cancel:Gt.default.string,droppingPosition:Gt.default.shape({e:Gt.default.object.isRequired,left:Gt.default.number.isRequired,top:Gt.default.number.isRequired})});Di(lC,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty(sp,"__esModule",{value:!0});sp.default=void 0;var ul=DX(m),g1=WS,$X=cC(US),at=Dt,OX=ea,s$=cC(Pb),TX=cC(Ia);function cC(e){return e&&e.__esModule?e:{default:e}}function t6(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(t6=function(r){return r?n:t})(e)}function DX(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=t6(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function yr(e,t,n){return t=AX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AX(e){var t=MX(e,"string");return typeof t=="symbol"?t:String(t)}function MX(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const l$="react-grid-layout";let n6=!1;try{n6=/firefox/i.test(navigator.userAgent)}catch{}class kb extends ul.Component{constructor(){super(...arguments),yr(this,"state",{activeDrag:null,layout:(0,at.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,at.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),yr(this,"dragEnterCounter",0),yr(this,"onDragStart",(t,n,r,o)=>{let{e:i,node:a}=o;const{layout:s}=this.state,l=(0,at.getLayoutItem)(s,t);if(l)return this.setState({oldDragItem:(0,at.cloneLayoutItem)(l),oldLayout:s}),this.props.onDragStart(s,l,l,null,i,a)}),yr(this,"onDrag",(t,n,r,o)=>{let{e:i,node:a}=o;const{oldDragItem:s}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:u,preventCollision:d}=this.props,h=(0,at.getLayoutItem)(l,t);if(!h)return;const p={w:h.w,h:h.h,x:h.x,y:h.y,placeholder:!0,i:t},v=!0;l=(0,at.moveElement)(l,h,n,r,v,d,(0,at.compactType)(this.props),c,u),this.props.onDrag(l,s,h,p,i,a),this.setState({layout:u?l:(0,at.compact)(l,(0,at.compactType)(this.props),c),activeDrag:p})}),yr(this,"onDragStop",(t,n,r,o)=>{let{e:i,node:a}=o;if(!this.state.activeDrag)return;const{oldDragItem:s}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:u,allowOverlap:d}=this.props,h=(0,at.getLayoutItem)(l,t);if(!h)return;const p=!0;l=(0,at.moveElement)(l,h,n,r,p,u,(0,at.compactType)(this.props),c,d);const v=d?l:(0,at.compact)(l,(0,at.compactType)(this.props),c);this.props.onDragStop(v,s,h,null,i,a);const{oldLayout:b}=this.state;this.setState({activeDrag:null,layout:v,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(v,b)}),yr(this,"onResizeStart",(t,n,r,o)=>{let{e:i,node:a}=o;const{layout:s}=this.state,l=(0,at.getLayoutItem)(s,t);l&&(this.setState({oldResizeItem:(0,at.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(s,l,l,null,i,a))}),yr(this,"onResize",(t,n,r,o)=>{let{e:i,node:a,size:s,handle:l}=o;const{oldResizeItem:c}=this.state;let{layout:u}=this.state;const{cols:d,preventCollision:h,allowOverlap:p}=this.props;let v=!1,b,x,y;const[_,S]=(0,at.withLayoutItem)(u,t,E=>{let $;return x=E.x,y=E.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(x=E.x+(E.w-n),n=E.x!==x&&x<0?E.w:n,x=x<0?0:x),["ne","n","nw"].indexOf(l)!==-1&&(y=E.y+(E.h-r),r=E.y!==y&&y<0?E.h:r,y=y<0?0:y),v=!0),h&&!p&&($=(0,at.getAllCollisions)(u,{...E,w:n,h:r,x,y}).filter(D=>D.i!==E.i).length>0,$&&(y=E.y,r=E.h,x=E.x,n=E.w,v=!1)),E.w=n,E.h=r,E});if(!S)return;b=_,v&&(b=(0,at.moveElement)(_,S,x,y,!0,this.props.preventCollision,(0,at.compactType)(this.props),d,p));const C={w:S.w,h:S.h,x:S.x,y:S.y,static:!0,i:t};this.props.onResize(b,c,S,C,i,a),this.setState({layout:p?b:(0,at.compact)(b,(0,at.compactType)(this.props),d),activeDrag:C})}),yr(this,"onResizeStop",(t,n,r,o)=>{let{e:i,node:a}=o;const{layout:s,oldResizeItem:l}=this.state,{cols:c,allowOverlap:u}=this.props,d=(0,at.getLayoutItem)(s,t),h=u?s:(0,at.compact)(s,(0,at.compactType)(this.props),c);this.props.onResizeStop(h,l,d,null,i,a);const{oldLayout:p}=this.state;this.setState({activeDrag:null,layout:h,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(h,p)}),yr(this,"onDragOver",t=>{var n;if(t.preventDefault(),t.stopPropagation(),n6&&!((n=t.nativeEvent.target)!==null&&n!==void 0&&n.classList.contains(l$)))return!1;const{droppingItem:r,onDropDragOver:o,margin:i,cols:a,rowHeight:s,maxRows:l,width:c,containerPadding:u,transformScale:d}=this.props,h=o==null?void 0:o(t);if(h===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const p={...r,...h},{layout:v}=this.state,{layerX:b,layerY:x}=t.nativeEvent,y={left:b/d,top:x/d,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:_,top:S}=this.state.droppingPosition;(_!=b||S!=x)&&this.setState({droppingPosition:y})}}else{const _={cols:a,margin:i,maxRows:l,rowHeight:s,containerWidth:c,containerPadding:u||i},S=(0,OX.calcXY)(_,x,b,p.w,p.h);this.setState({droppingDOMNode:ul.createElement("div",{key:p.i}),droppingPosition:y,layout:[...v,{...p,x:S.x,y:S.y,static:!1,isDraggable:!0}]})}}),yr(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,o=(0,at.compact)(r.filter(i=>i.i!==t.i),(0,at.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),yr(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),yr(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),yr(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,o=r.find(i=>i.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,o,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,g1.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,at.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,at.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,at.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,at.fastRGLPropsEqual)(this.props,t,g1.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,o=n.layout;this.onLayoutMaybeChanged(r,o)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,at.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(t,n){n||(n=this.state.layout),(0,g1.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:o,containerPadding:i,rowHeight:a,maxRows:s,useCSSTransforms:l,transformScale:c}=this.props;return ul.createElement(s$.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:"react-grid-placeholder ".concat(this.state.resizing?"placeholder-resizing":""),containerWidth:n,cols:r,margin:o,containerPadding:i||o,maxRows:s,rowHeight:a,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},ul.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,at.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:o,cols:i,margin:a,containerPadding:s,rowHeight:l,maxRows:c,isDraggable:u,isResizable:d,isBounded:h,useCSSTransforms:p,transformScale:v,draggableCancel:b,draggableHandle:x,resizeHandles:y,resizeHandle:_}=this.props,{mounted:S,droppingPosition:C}=this.state,E=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&u,$=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&d,T=r.resizeHandles||y,D=E&&h&&r.isBounded!==!1;return ul.createElement(s$.default,{containerWidth:o,cols:i,margin:a,containerPadding:s||a,maxRows:c,rowHeight:l,cancel:b,handle:x,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:E,isResizable:$,isBounded:D,useCSSTransforms:p&&S,usePercentages:!S,transformScale:v,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?C:void 0,resizeHandles:T,resizeHandle:_},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,$X.default)(l$,t),a={height:this.containerHeight(),...n};return ul.createElement("div",{ref:o,className:i,style:a,onDrop:r?this.onDrop:at.noop,onDragLeave:r?this.onDragLeave:at.noop,onDragEnter:r?this.onDragEnter:at.noop,onDragOver:r?this.onDragOver:at.noop},ul.Children.map(this.props.children,s=>this.processGridItem(s)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}sp.default=kb;yr(kb,"displayName","ReactGridLayout");yr(kb,"propTypes",TX.default);yr(kb,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:at.noop,onDragStart:at.noop,onDrag:at.noop,onDragStop:at.noop,onResizeStart:at.noop,onResize:at.noop,onResizeStop:at.noop,onDrop:at.noop,onDropDragOver:at.noop});var Ib={},xc={};Object.defineProperty(xc,"__esModule",{value:!0});xc.findOrGenerateResponsiveLayout=NX;xc.getBreakpointFromWidth=kX;xc.getColsFromBreakpoint=IX;xc.sortBreakpoints=uC;var Ag=Dt;function kX(e,t){const n=uC(e);let r=n[0];for(let o=1,i=n.length;o<i;o++){const a=n[o];t>e[a]&&(r=a)}return r}function IX(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function NX(e,t,n,r,o,i){if(e[n])return(0,Ag.cloneLayout)(e[n]);let a=e[r];const s=uC(t),l=s.slice(s.indexOf(n));for(let c=0,u=l.length;c<u;c++){const d=l[c];if(e[d]){a=e[d];break}}return a=(0,Ag.cloneLayout)(a||[]),(0,Ag.compact)((0,Ag.correctBounds)(a,{cols:o}),i,o)}function uC(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(Ib,"__esModule",{value:!0});Ib.default=void 0;var c$=FX(m),Gr=r6(Ks),m1=WS,xu=Dt,dl=xc,LX=r6(sp);function r6(e){return e&&e.__esModule?e:{default:e}}function o6(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(o6=function(r){return r?n:t})(e)}function FX(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=o6(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Nw(){return Nw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nw.apply(this,arguments)}function p0(e,t,n){return t=jX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jX(e){var t=zX(e,"string");return typeof t=="symbol"?t:String(t)}function zX(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const u$=e=>Object.prototype.toString.call(e);function Mg(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class dC extends c$.Component{constructor(){super(...arguments),p0(this,"state",this.generateInitialState()),p0(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:o}=this.props,i=(0,dl.getBreakpointFromWidth)(n,t),a=(0,dl.getColsFromBreakpoint)(i,o),s=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,dl.findOrGenerateResponsiveLayout)(r,n,i,i,a,s),breakpoint:i,cols:a}}static getDerivedStateFromProps(t,n){if(!(0,m1.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,dl.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,o,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,m1.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,m1.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:o,compactType:i}=this.props,a=this.props.breakpoint||(0,dl.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),s=this.state.breakpoint,l=(0,dl.getColsFromBreakpoint)(a,r),c={...o};if(s!==a||t.breakpoints!==n||t.cols!==r){s in c||(c[s]=(0,xu.cloneLayout)(this.state.layout));let h=(0,dl.findOrGenerateResponsiveLayout)(c,n,a,s,l,i);h=(0,xu.synchronizeLayoutWithChildren)(h,this.props.children,l,i,this.props.allowOverlap),c[a]=h,this.props.onLayoutChange(h,c),this.props.onBreakpointChange(a,l),this.setState({breakpoint:a,layout:h,cols:l})}const u=Mg(this.props.margin,a),d=Mg(this.props.containerPadding,a);this.props.onWidthChange(this.props.width,u,l,d)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:o,margin:i,containerPadding:a,onBreakpointChange:s,onLayoutChange:l,onWidthChange:c,...u}=this.props;return c$.createElement(LX.default,Nw({},u,{margin:Mg(i,this.state.breakpoint),containerPadding:Mg(a,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Ib.default=dC;p0(dC,"propTypes",{breakpoint:Gr.default.string,breakpoints:Gr.default.object,allowOverlap:Gr.default.bool,cols:Gr.default.object,margin:Gr.default.oneOfType([Gr.default.array,Gr.default.object]),containerPadding:Gr.default.oneOfType([Gr.default.array,Gr.default.object]),layouts(e,t){if(u$(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+u$(e[t]));Object.keys(e[t]).forEach(n=>{if(!(n in e.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,xu.validateLayout)(e.layouts[n],"layouts."+n)})},width:Gr.default.number.isRequired,onBreakpointChange:Gr.default.func,onLayoutChange:Gr.default.func,onWidthChange:Gr.default.func});p0(dC,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:xu.noop,onLayoutChange:xu.noop,onWidthChange:xu.noop});var fC={},i6=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,i){return o[0]===n?(r=i,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,i=this.__entries__;o<i.length;o++){var a=i[o];n.call(r,a[1],a[0])}},t}()}(),Lw=typeof window<"u"&&typeof document<"u"&&window.document===document,g0=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),BX=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(g0):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),VX=2;function HX(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&s()}function a(){BX(i)}function s(){var l=Date.now();if(n){if(l-o<VX)return;r=!0}else n=!0,r=!1,setTimeout(a,t);o=l}return s}var WX=20,UX=["top","right","bottom","left","width","height","size","weight"],qX=typeof MutationObserver<"u",GX=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=HX(this.refresh.bind(this),WX)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!Lw||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),qX?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Lw||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=UX.some(function(i){return!!~r.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),a6=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},Gu=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||g0},s6=Nb(0,0,0,0);function m0(e){return parseFloat(e)||0}function d$(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,o){var i=e["border-"+o+"-width"];return r+m0(i)},0)}function YX(e){for(var t=["top","right","bottom","left"],n={},r=0,o=t;r<o.length;r++){var i=o[r],a=e["padding-"+i];n[i]=m0(a)}return n}function KX(e){var t=e.getBBox();return Nb(0,0,t.width,t.height)}function XX(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return s6;var r=Gu(e).getComputedStyle(e),o=YX(r),i=o.left+o.right,a=o.top+o.bottom,s=m0(r.width),l=m0(r.height);if(r.boxSizing==="border-box"&&(Math.round(s+i)!==t&&(s-=d$(r,"left","right")+i),Math.round(l+a)!==n&&(l-=d$(r,"top","bottom")+a)),!JX(e)){var c=Math.round(s+i)-t,u=Math.round(l+a)-n;Math.abs(c)!==1&&(s-=c),Math.abs(u)!==1&&(l-=u)}return Nb(o.left,o.top,s,l)}var QX=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof Gu(e).SVGGraphicsElement}:function(e){return e instanceof Gu(e).SVGElement&&typeof e.getBBox=="function"}}();function JX(e){return e===Gu(e).document.documentElement}function ZX(e){return Lw?QX(e)?KX(e):XX(e):s6}function eQ(e){var t=e.x,n=e.y,r=e.width,o=e.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,a=Object.create(i.prototype);return a6(a,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),a}function Nb(e,t,n,r){return{x:e,y:t,width:n,height:r}}var tQ=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Nb(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=ZX(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),nQ=function(){function e(t,n){var r=eQ(n);a6(this,{target:t,contentRect:r})}return e}(),rQ=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new i6,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Gu(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new tQ(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Gu(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new nQ(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),l6=typeof WeakMap<"u"?new WeakMap:new i6,c6=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=GX.getInstance(),r=new rQ(t,n,this);l6.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){c6.prototype[e]=function(){var t;return(t=l6.get(this))[e].apply(t,arguments)}});var oQ=function(){return typeof g0.ResizeObserver<"u"?g0.ResizeObserver:c6}();const iQ=Object.freeze(Object.defineProperty({__proto__:null,default:oQ},Symbol.toStringTag,{value:"Module"})),aQ=SS(iQ);Object.defineProperty(fC,"__esModule",{value:!0});fC.default=pQ;var kg=uQ(m),sQ=hC(Ks),lQ=hC(aQ),cQ=hC(US);function hC(e){return e&&e.__esModule?e:{default:e}}function u6(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(u6=function(r){return r?n:t})(e)}function uQ(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=u6(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Fw(){return Fw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fw.apply(this,arguments)}function Gc(e,t,n){return t=dQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dQ(e){var t=fQ(e,"string");return typeof t=="symbol"?t:String(t)}function fQ(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const hQ="react-grid-layout";function pQ(e){var t;return t=class extends kg.Component{constructor(){super(...arguments),Gc(this,"state",{width:1280}),Gc(this,"elementRef",kg.createRef()),Gc(this,"mounted",!1),Gc(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new lQ.default(o=>{if(this.elementRef.current instanceof HTMLElement){const a=o[0].contentRect.width;this.setState({width:a})}});const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.observe(r)}componentWillUnmount(){this.mounted=!1;const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.unobserve(r),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:r,...o}=this.props;return r&&!this.mounted?kg.createElement("div",{className:(0,cQ.default)(this.props.className,hQ),style:this.props.style,ref:this.elementRef}):kg.createElement(e,Fw({innerRef:this.elementRef},o,this.state))}},Gc(t,"defaultProps",{measureBeforeMount:!1}),Gc(t,"propTypes",{measureBeforeMount:sQ.default.bool}),t}(function(e){e.exports=sp.default,e.exports.utils=Dt,e.exports.calculateUtils=ea,e.exports.Responsive=Ib.default,e.exports.Responsive.utils=xc,e.exports.WidthProvider=fC.default})(_k);var f$=_k.exports;function Br(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var gQ=["color"],mQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,gQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),bQ=["color"],d6=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,bQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),vQ=["color"],yQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,vQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),xQ=["color"],wQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,xQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M5 2V1H10V2H5ZM4.75 0C4.33579 0 4 0.335786 4 0.75V1H3.5C2.67157 1 2 1.67157 2 2.5V12.5C2 13.3284 2.67157 14 3.5 14H7V13H3.5C3.22386 13 3 12.7761 3 12.5V2.5C3 2.22386 3.22386 2 3.5 2H4V2.25C4 2.66421 4.33579 3 4.75 3H10.25C10.6642 3 11 2.66421 11 2.25V2H11.5C11.7761 2 12 2.22386 12 2.5V7H13V2.5C13 1.67157 12.3284 1 11.5 1H11V0.75C11 0.335786 10.6642 0 10.25 0H4.75ZM9 8.5C9 8.77614 8.77614 9 8.5 9C8.22386 9 8 8.77614 8 8.5C8 8.22386 8.22386 8 8.5 8C8.77614 8 9 8.22386 9 8.5ZM10.5 9C10.7761 9 11 8.77614 11 8.5C11 8.22386 10.7761 8 10.5 8C10.2239 8 10 8.22386 10 8.5C10 8.77614 10.2239 9 10.5 9ZM13 8.5C13 8.77614 12.7761 9 12.5 9C12.2239 9 12 8.77614 12 8.5C12 8.22386 12.2239 8 12.5 8C12.7761 8 13 8.22386 13 8.5ZM14.5 9C14.7761 9 15 8.77614 15 8.5C15 8.22386 14.7761 8 14.5 8C14.2239 8 14 8.22386 14 8.5C14 8.77614 14.2239 9 14.5 9ZM15 10.5C15 10.7761 14.7761 11 14.5 11C14.2239 11 14 10.7761 14 10.5C14 10.2239 14.2239 10 14.5 10C14.7761 10 15 10.2239 15 10.5ZM14.5 13C14.7761 13 15 12.7761 15 12.5C15 12.2239 14.7761 12 14.5 12C14.2239 12 14 12.2239 14 12.5C14 12.7761 14.2239 13 14.5 13ZM14.5 15C14.7761 15 15 14.7761 15 14.5C15 14.2239 14.7761 14 14.5 14C14.2239 14 14 14.2239 14 14.5C14 14.7761 14.2239 15 14.5 15ZM8.5 11C8.77614 11 9 10.7761 9 10.5C9 10.2239 8.77614 10 8.5 10C8.22386 10 8 10.2239 8 10.5C8 10.7761 8.22386 11 8.5 11ZM9 12.5C9 12.7761 8.77614 13 8.5 13C8.22386 13 8 12.7761 8 12.5C8 12.2239 8.22386 12 8.5 12C8.77614 12 9 12.2239 9 12.5ZM8.5 15C8.77614 15 9 14.7761 9 14.5C9 14.2239 8.77614 14 8.5 14C8.22386 14 8 14.2239 8 14.5C8 14.7761 8.22386 15 8.5 15ZM11 14.5C11 14.7761 10.7761 15 10.5 15C10.2239 15 10 14.7761 10 14.5C10 14.2239 10.2239 14 10.5 14C10.7761 14 11 14.2239 11 14.5ZM12.5 15C12.7761 15 13 14.7761 13 14.5C13 14.2239 12.7761 14 12.5 14C12.2239 14 12 14.2239 12 14.5C12 14.7761 12.2239 15 12.5 15Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),_Q=["color"],f6=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,_Q);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),SQ=["color"],CQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,SQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z",fill:r}))}),EQ=["color"],RQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,EQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M14.7649 6.07596C14.9991 6.22231 15.0703 6.53079 14.9239 6.76495C14.4849 7.46743 13.9632 8.10645 13.3702 8.66305L14.5712 9.86406C14.7664 10.0593 14.7664 10.3759 14.5712 10.5712C14.3759 10.7664 14.0593 10.7664 13.8641 10.5712L12.6011 9.30817C11.805 9.90283 10.9089 10.3621 9.93375 10.651L10.383 12.3277C10.4544 12.5944 10.2961 12.8685 10.0294 12.94C9.76267 13.0115 9.4885 12.8532 9.41704 12.5865L8.95917 10.8775C8.48743 10.958 8.00036 10.9999 7.50001 10.9999C6.99965 10.9999 6.51257 10.958 6.04082 10.8775L5.58299 12.5864C5.51153 12.8532 5.23737 13.0115 4.97064 12.94C4.7039 12.8686 4.5456 12.5944 4.61706 12.3277L5.06625 10.651C4.09111 10.3621 3.19503 9.90282 2.3989 9.30815L1.1359 10.5712C0.940638 10.7664 0.624058 10.7664 0.428798 10.5712C0.233537 10.3759 0.233537 10.0593 0.428798 9.86405L1.62982 8.66303C1.03682 8.10643 0.515113 7.46742 0.0760677 6.76495C-0.0702867 6.53079 0.000898544 6.22231 0.235065 6.07596C0.469231 5.9296 0.777703 6.00079 0.924058 6.23496C1.40354 7.00213 1.989 7.68057 2.66233 8.2427C2.67315 8.25096 2.6837 8.25972 2.69397 8.26898C4.00897 9.35527 5.65537 9.99991 7.50001 9.99991C10.3078 9.99991 12.6564 8.5063 14.076 6.23495C14.2223 6.00079 14.5308 5.9296 14.7649 6.07596Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),PQ=["color"],$Q=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,PQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),OQ=["color"],TQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,OQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),DQ=["color"],h6=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,DQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),AQ=["color"],MQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,AQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M3.24182 2.32181C3.3919 2.23132 3.5784 2.22601 3.73338 2.30781L12.7334 7.05781C12.8974 7.14436 13 7.31457 13 7.5C13 7.68543 12.8974 7.85564 12.7334 7.94219L3.73338 12.6922C3.5784 12.774 3.3919 12.7687 3.24182 12.6782C3.09175 12.5877 3 12.4252 3 12.25V2.75C3 2.57476 3.09175 2.4123 3.24182 2.32181ZM4 3.57925V11.4207L11.4288 7.5L4 3.57925Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),kQ=["color"],IQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,kQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M10.3004 7.49991C10.3004 8.4943 9.49426 9.30041 8.49988 9.30041C7.50549 9.30041 6.69938 8.4943 6.69938 7.49991C6.69938 6.50553 7.50549 5.69942 8.49988 5.69942C9.49426 5.69942 10.3004 6.50553 10.3004 7.49991ZM11.205 8C10.9699 9.28029 9.84816 10.2504 8.49988 10.2504C7.1516 10.2504 6.0299 9.28029 5.79473 8H0.5C0.223858 8 0 7.77614 0 7.5C0 7.22386 0.223858 7 0.5 7H5.7947C6.0298 5.71962 7.15154 4.74942 8.49988 4.74942C9.84822 4.74942 10.97 5.71962 11.2051 7H14.5C14.7761 7 15 7.22386 15 7.5C15 7.77614 14.7761 8 14.5 8H11.205Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),NQ=["color"],LQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,NQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M2 3C2 2.44772 2.44772 2 3 2H12C12.5523 2 13 2.44772 13 3V12C13 12.5523 12.5523 13 12 13H3C2.44772 13 2 12.5523 2 12V3ZM12 3H3V12H12V3Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),FQ=["color"],p6=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,FQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:r}))}),jQ=["color"],g6=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,jQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:r}))});let Ig;const zQ=new Uint8Array(16);function BQ(){if(!Ig&&(Ig=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ig))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ig(zQ)}const lr=[];for(let e=0;e<256;++e)lr.push((e+256).toString(16).slice(1));function VQ(e,t=0){return lr[e[t+0]]+lr[e[t+1]]+lr[e[t+2]]+lr[e[t+3]]+"-"+lr[e[t+4]]+lr[e[t+5]]+"-"+lr[e[t+6]]+lr[e[t+7]]+"-"+lr[e[t+8]]+lr[e[t+9]]+"-"+lr[e[t+10]]+lr[e[t+11]]+lr[e[t+12]]+lr[e[t+13]]+lr[e[t+14]]+lr[e[t+15]]}const HQ=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),h$={randomUUID:HQ};function Fs(e,t,n){if(h$.randomUUID&&!t&&!e)return h$.randomUUID();e=e||{};const r=e.random||(e.rng||BQ)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let o=0;o<16;++o)t[n+o]=r[o];return t}return VQ(r)}const Ir=DM()(FM((e,t)=>({isShowingVisual:!0,runSql:!1,sqlGen:{},sql:"",isSqlRunning:!1,queryResultColumns:[],showFilters:!1,applyFilters:!1,filterValues:[{filterId:"sample-filter-id",valueType:"string",name:"",operation:"in",values:[""]}],card:{id:Fs(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:Fs(),cards:[],activeCardId:""},actions:{setCustomCardPreferences:n=>{e(r=>{r.card.customCardPreferences=n})},setChartOrientation:n=>{e(r=>{var a,s,l,c,u,d;const o=r.card.preferences;let i={};((a=o==null?void 0:o.chartOptions)==null?void 0:a.indexAxis)!==n&&(i={x:(l=(s=o==null?void 0:o.chartOptions)==null?void 0:s.scales)==null?void 0:l.y,y:(u=(c=o==null?void 0:o.chartOptions)==null?void 0:c.scales)==null?void 0:u.x}),r.card.preferences={...o,chartOptions:{...o==null?void 0:o.chartOptions,scales:{...(d=o==null?void 0:o.chartOptions)==null?void 0:d.scales,...i},indexAxis:n}}})},setSortChart:n=>{e(r=>{r.card.preferences={...r.card.preferences,sortChart:n}})},setCustomVisualCode:n=>{e(r=>{r.card.preferences={...r.card.preferences,customVisualCode:n}})},setNumberFormat:(n,r,o,i)=>{e(a=>{var s,l,c;a.card.preferences={...(s=a.card)==null?void 0:s.preferences,formatNumber:{...(c=(l=a.card)==null?void 0:l.preferences)==null?void 0:c.formatNumber,decimalPlaces:n,currency:r,locale:o,suffix:i,enabled:!0}}})},setColorRanges:n=>{e(r=>{var o,i;r.card.preferences={...r.card.preferences,formatNumber:{...(i=(o=r.card)==null?void 0:o.preferences)==null?void 0:i.formatNumber,colorRanges:n}}})},setQueryError:n=>{e(r=>{r.queryError=n})},setQueryResultColumns:n=>{e(r=>{r.queryResultColumns=n})},setCardPreferences:n=>{e(r=>{r.card.preferences=n})},setFilterOnClickColumnIndex:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClickColumnIndex:n}})},setFilterOnClickField:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClick:!0,filterOnClickField:n}})},setCardRefreshInterval:n=>{e(r=>{r.card.refreshInterval=n})},setIsShowingVisual:n=>{e({isShowingVisual:n})},setRunSql:n=>{e({runSql:n})},setIsSqlRunning:n=>{e({isSqlRunning:n})},updateCardInFrame:n=>{e(r=>{r.frame.cards=r.frame.cards.map(o=>o.id===n.id?n:o)})},setFrame:n=>{e({frame:n})},setCard:n=>{e({card:n})},setCardType:n=>{e(r=>{var o;r.card.type=n,n==="range"&&(r.card.preferences={...r.card.preferences,chartOptions:{...(o=r.card.preferences)==null?void 0:o.chartOptions,indexAxis:"y"}})})},setCardSql:n=>{e(r=>{r.card.sql=n})},setCardPython:n=>{e(r=>{r.card.python=n})},setPythonStdOut:n=>{e(r=>{r.pythonStdOut=n})},setCardCustomCfg:n=>{e(r=>{r.card.customCfg=n})},setCardCfg:n=>{e(r=>{r.card.cfg=n})},setShowFilters:n=>{e(r=>{r.showFilters=n})},setApplyFilters:n=>{e(r=>{r.applyFilters=n})},setFilterValues:n=>{e(r=>{r.filterValues=n})},setSqlGen:n=>{e(r=>{r.sqlGen=n})},setSqlGenMeasure:(n,r)=>{e(o=>{o.sqlGen.measures=[...o.sqlGen.measures||[],{name:n,calc:r}]})},setSqlGenDimension:n=>{e(r=>{r.sqlGen.dimensions=[...r.sqlGen.dimensions||[],n]})},setSelectedDatamodelId:n=>{var r,o;e(i=>{i.selectedDatamodelId=n,i.card.datamodelId=n}),(o=(r=t()).onDatamodelChange)==null||o.call(r,n)},setSelectedConnectionId:n=>{var r,o;e(i=>{i.selectedConnectionId=n,i.card.connectionId=n}),(o=(r=t()).onConnectionChange)==null||o.call(r,n)},setSelectedDatabaseName:n=>{var r,o;e(i=>{i.selectedDatabaseName=n,i.card.lastSelectedDatabase=n}),(o=(r=t()).onDatabaseChange)==null||o.call(r,n)},setSelectedSchemaName:n=>{var r,o;e(i=>{i.selectedSchemaName=n,i.card.lastSelectedSchema=n}),(o=(r=t()).onSchemaChange)==null||o.call(r,n)},setSelectedTableName:n=>{var r,o;e(i=>{i.selectedTableName=n,i.card.lastSelectedTable=n}),(o=(r=t()).onTableChange)==null||o.call(r,n)},setCurrentColumns:n=>{e(r=>{r.currentColumns=n})},setOnConnectionChange:n=>{e({onConnectionChange:n})},setOnDatabaseChange:n=>{e({onDatabaseChange:n})},setOnSchemaChange:n=>{e({onSchemaChange:n})},setOnTableChange:n=>{e({onTableChange:n})},setOnSave:n=>{e({onSave:n})},setOnClose:n=>{e({onClose:n})}}}))),Lb=()=>Ir(e=>e.actions);function WQ(e,t,n){var l,c,u,d;const r=n==null?void 0:n.datasetOptions,o=we.getState().themeStyle,i=(c=(l=o==null?void 0:o.chart)==null?void 0:l.dataset)==null?void 0:c.backgroundColor,a=(d=(u=o==null?void 0:o.chart)==null?void 0:u.dataset)==null?void 0:d.borderColor;return e.map((h,p)=>{var S;const v=r==null?void 0:r.find(C=>C.idx===p),b=i==null?void 0:i[p%i.length],x=a==null?void 0:a[p%a.length],y=a==null?void 0:a[p%a.length];return{label:h.charAt(0).toUpperCase()+h.slice(1),data:t.map(C=>C[h]),...v,datalabels:{...v==null?void 0:v.datalabels,color:UQ((S=v==null?void 0:v.datalabels)==null?void 0:S.align,b)},backgroundColor:b,pointBackgroundColor:x,borderColor:y}})}function UQ(e,t){return qu(e==="end"||e==="start"?oh():t)}function qQ(e){var s,l,c,u;const{metricKeys:t,dimensionKeys:n}=tr(e);let r=[];const o=we.getState().themeStyle,i=(l=(s=o==null?void 0:o.chart)==null?void 0:s.dataset)==null?void 0:l.backgroundColor,a=(u=(c=o==null?void 0:o.chart)==null?void 0:c.dataset)==null?void 0:u.borderColor;if((n==null?void 0:n.length)===1){const d=e.map(h=>({x:h[t[0]],y:h[t[1]],r:h[t[2]],label:h[n==null?void 0:n[0]]}));r=[{label:n==null?void 0:n[0],data:d}]}return(n==null?void 0:n.length)>1&&(r=[...new Set(e.map(h=>h[n==null?void 0:n[1]]))].map((h,p)=>{const v=e.filter(b=>b[n==null?void 0:n[1]]===h);return{label:h,data:v.map(b=>({x:b[t[0]],y:b[t[1]],r:b[t[2]],label:b[n==null?void 0:n[0]]})),backgroundColor:i==null?void 0:i[p%i.length],borderColor:a==null?void 0:a[p%a.length]}})),r}function GQ(e){var c,u,d,h;const{dimensionKeys:t,metricKeys:n}=tr(e),r=we.getState().themeStyle,o=(u=(c=r==null?void 0:r.chart)==null?void 0:c.dataset)==null?void 0:u.backgroundColor,i=(h=(d=r==null?void 0:r.chart)==null?void 0:d.dataset)==null?void 0:h.borderColor,a=t==null?void 0:t[1];return[...new Set(e.map(p=>p==null?void 0:p[a]))].map((p,v)=>({label:p,data:e.filter(b=>(b==null?void 0:b[a])===p).map(b=>[b==null?void 0:b[n[0]],b==null?void 0:b[n[1]],b==null?void 0:b[n[2]]]),backgroundColor:o==null?void 0:o[v%o.length],borderColor:i==null?void 0:i[v%i.length],borderSkipped:!1}))}function YQ(e,t){var a,s,l,c;const n=we.getState().themeStyle,r=(s=(a=n==null?void 0:n.chart)==null?void 0:a.dataset)==null?void 0:s.backgroundColor,o=(c=(l=n==null?void 0:n.chart)==null?void 0:l.dataset)==null?void 0:c.borderColor;return e.map(u=>({label:u.charAt(0).toUpperCase()+u.slice(1),data:t.map(d=>d[u]),backgroundColor:t.map((d,h)=>r==null?void 0:r[h%r.length]),borderColor:t.map((d,h)=>o==null?void 0:o[h%o.length])}))}function KQ(e){let t=-1,n=0;return e.forEach((r,o)=>{const i=Object.keys(r).length;i>n&&(t=o,n=i)}),t}function tr(e){if(e.length===0)return{keys:[],dimensionKeys:[],metricKeys:[]};const t=KQ(e),n=Object.keys(e[t]),r=n.filter(i=>{var a,s,l,c,u,d,h,p;return!!(typeof((a=e==null?void 0:e[t])==null?void 0:a[i])&&typeof((s=e==null?void 0:e[t])==null?void 0:s[i])=="string"||typeof((l=e==null?void 0:e[0])==null?void 0:l[i])&&typeof((c=e==null?void 0:e[0])==null?void 0:c[i])=="string"||typeof((u=e==null?void 0:e[1])==null?void 0:u[i])&&typeof((d=e==null?void 0:e[1])==null?void 0:d[i])=="string"||typeof((h=e==null?void 0:e[2])==null?void 0:h[i])&&typeof((p=e==null?void 0:e[2])==null?void 0:p[i])=="string")});r.length===0&&r.push(n[0]);const o=n.filter(i=>{var a,s;return((a=e==null?void 0:e[t])==null?void 0:a[i])===+((s=e==null?void 0:e[t])==null?void 0:s[i])});return{keys:n,dimensionKeys:r,metricKeys:o}}function Cf(e,t){var r;const n=(r=t==null?void 0:t.data)==null?void 0:r.datasets;return n&&n.length>0?e.map((i,a)=>({...i,...n[a],data:i.data,label:i.label})):e}function XQ(e,t="asc"){function n(r){return Object.entries(r).slice(1).reduce((a,[s,l])=>{const c=typeof l=="number"?l:parseFloat(l);return a+(isNaN(c)?0:c)},0)}return e.sort((r,o)=>{const i=n(r),a=n(o);return t==="asc"?i-a:a-i})}function b0({dataArray:e,groupKey:t,pivotKey:n,valueKey:r,sortChart:o}){const i=e.reduce((s,l)=>{const c=l[t],u=l[n],d=l[r];return s[c]||(s[c]={[t]:c}),s[c][u]=d,s},{});let a=Object.values(i);return o!=="none"&&o!==void 0&&(a=XQ(a,o)),a}function qo(e,t){var a;const n=we.getState().themeStyle,r=(a=n==null?void 0:n.chart)==null?void 0:a.options,o=Vl.cloneDeep(r);return Vl.merge(o,e,t)}function jw(e,t){return e.map(n=>n[t]?n[t]:"BLANK")}/**
109
+ `,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&Hk(e.body,"react-draggable-transparent-selection")}function DK(e){if(e)try{if(e.body&&Wk(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function Hk(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function Wk(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var na={};Object.defineProperty(na,"__esModule",{value:!0});na.canDragX=kK;na.canDragY=IK;na.createCoreData=LK;na.createDraggableData=FK;na.getBoundPosition=AK;na.getControlPosition=NK;na.snapToGrid=MK;var ho=ta,du=Fn;function AK(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:jK(r);const o=rC(e);if(typeof r=="string"){const{ownerDocument:i}=o,a=i.defaultView;let s;if(r==="parent"?s=o.parentNode:s=i.querySelector(r),!(s instanceof a.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=s,c=a.getComputedStyle(o),u=a.getComputedStyle(l);r={left:-o.offsetLeft+(0,ho.int)(u.paddingLeft)+(0,ho.int)(c.marginLeft),top:-o.offsetTop+(0,ho.int)(u.paddingTop)+(0,ho.int)(c.marginTop),right:(0,du.innerWidth)(l)-(0,du.outerWidth)(o)-o.offsetLeft+(0,ho.int)(u.paddingRight)-(0,ho.int)(c.marginRight),bottom:(0,du.innerHeight)(l)-(0,du.outerHeight)(o)-o.offsetTop+(0,ho.int)(u.paddingBottom)-(0,ho.int)(c.marginBottom)}}return(0,ho.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,ho.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,ho.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,ho.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function MK(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function kK(e){return e.props.axis==="both"||e.props.axis==="x"}function IK(e){return e.props.axis==="both"||e.props.axis==="y"}function NK(e,t,n){const r=typeof t=="number"?(0,du.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=rC(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,du.offsetXYFromParent)(r||e,i,n.props.scale)}function LK(e,t,n){const r=!(0,ho.isNum)(e.lastX),o=rC(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function FK(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function jK(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function rC(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var Ob={},Tb={};Object.defineProperty(Tb,"__esModule",{value:!0});Tb.default=zK;function zK(){}Object.defineProperty(Ob,"__esModule",{value:!0});Ob.default=void 0;var d1=VK(m),qr=oC(Ks),BK=oC(Er),vr=Fn,cs=na,f1=ta,Xd=oC(Tb);function oC(e){return e&&e.__esModule?e:{default:e}}function Uk(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Uk=function(r){return r?n:t})(e)}function VK(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Uk(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Dr(e,t,n){return t=HK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HK(e){var t=WK(e,"string");return typeof t=="symbol"?t:String(t)}function WK(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const ci={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let us=ci.mouse,Db=class extends d1.Component{constructor(){super(...arguments),Dr(this,"dragging",!1),Dr(this,"lastX",NaN),Dr(this,"lastY",NaN),Dr(this,"touchIdentifier",null),Dr(this,"mounted",!1),Dr(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,vr.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,vr.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,vr.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,cs.getControlPosition)(t,o,this);if(i==null)return;const{x:a,y:s}=i,l=(0,cs.createCoreData)(this,a,s);(0,Xd.default)("DraggableCore: handleDragStart: %j",l),(0,Xd.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,vr.addUserSelectStyles)(r),this.dragging=!0,this.lastX=a,this.lastY=s,(0,vr.addEvent)(r,us.move,this.handleDrag),(0,vr.addEvent)(r,us.stop,this.handleDragStop))}),Dr(this,"handleDrag",t=>{const n=(0,cs.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let s=r-this.lastX,l=o-this.lastY;if([s,l]=(0,cs.snapToGrid)(this.props.grid,s,l),!s&&!l)return;r=this.lastX+s,o=this.lastY+l}const i=(0,cs.createCoreData)(this,r,o);if((0,Xd.default)("DraggableCore: handleDrag: %j",i),this.props.onDrag(t,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=o}),Dr(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,cs.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=o-this.lastY||0;[l,c]=(0,cs.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,o=this.lastY+c}const i=(0,cs.createCoreData)(this,r,o);if(this.props.onStop(t,i)===!1||this.mounted===!1)return!1;const s=this.findDOMNode();s&&this.props.enableUserSelectHack&&(0,vr.removeUserSelectStyles)(s.ownerDocument),(0,Xd.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&((0,Xd.default)("DraggableCore: Removing handlers"),(0,vr.removeEvent)(s.ownerDocument,us.move,this.handleDrag),(0,vr.removeEvent)(s.ownerDocument,us.stop,this.handleDragStop))}),Dr(this,"onMouseDown",t=>(us=ci.mouse,this.handleDragStart(t))),Dr(this,"onMouseUp",t=>(us=ci.mouse,this.handleDragStop(t))),Dr(this,"onTouchStart",t=>(us=ci.touch,this.handleDragStart(t))),Dr(this,"onTouchEnd",t=>(us=ci.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,vr.addEvent)(t,ci.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,vr.removeEvent)(n,ci.mouse.move,this.handleDrag),(0,vr.removeEvent)(n,ci.touch.move,this.handleDrag),(0,vr.removeEvent)(n,ci.mouse.stop,this.handleDragStop),(0,vr.removeEvent)(n,ci.touch.stop,this.handleDragStop),(0,vr.removeEvent)(t,ci.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,vr.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:BK.default.findDOMNode(this)}render(){return d1.cloneElement(d1.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Ob.default=Db;Dr(Db,"displayName","DraggableCore");Dr(Db,"propTypes",{allowAnyClick:qr.default.bool,children:qr.default.node.isRequired,disabled:qr.default.bool,enableUserSelectHack:qr.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:qr.default.arrayOf(qr.default.number),handle:qr.default.string,cancel:qr.default.string,nodeRef:qr.default.object,onStart:qr.default.func,onDrag:qr.default.func,onStop:qr.default.func,onMouseDown:qr.default.func,scale:qr.default.number,className:f1.dontSetMe,style:f1.dontSetMe,transform:f1.dontSetMe});Dr(Db,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=h(m),n=u(Ks),r=u(Er),o=u(cK),i=Fn,a=na,s=ta,l=u(Ob),c=u(Tb);function u(_){return _&&_.__esModule?_:{default:_}}function d(_){if(typeof WeakMap!="function")return null;var S=new WeakMap,C=new WeakMap;return(d=function(E){return E?C:S})(_)}function h(_,S){if(!S&&_&&_.__esModule)return _;if(_===null||typeof _!="object"&&typeof _!="function")return{default:_};var C=d(S);if(C&&C.has(_))return C.get(_);var E={},$=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var T in _)if(T!=="default"&&Object.prototype.hasOwnProperty.call(_,T)){var D=$?Object.getOwnPropertyDescriptor(_,T):null;D&&(D.get||D.set)?Object.defineProperty(E,T,D):E[T]=_[T]}return E.default=_,C&&C.set(_,E),E}function p(){return p=Object.assign?Object.assign.bind():function(_){for(var S=1;S<arguments.length;S++){var C=arguments[S];for(var E in C)Object.prototype.hasOwnProperty.call(C,E)&&(_[E]=C[E])}return _},p.apply(this,arguments)}function v(_,S,C){return S=b(S),S in _?Object.defineProperty(_,S,{value:C,enumerable:!0,configurable:!0,writable:!0}):_[S]=C,_}function b(_){var S=x(_,"string");return typeof S=="symbol"?S:String(S)}function x(_,S){if(typeof _!="object"||_===null)return _;var C=_[Symbol.toPrimitive];if(C!==void 0){var E=C.call(_,S||"default");if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(_)}class y extends t.Component{static getDerivedStateFromProps(S,C){let{position:E}=S,{prevPropsPosition:$}=C;return E&&(!$||E.x!==$.x||E.y!==$.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:E,prevPropsPosition:$}),{x:E.x,y:E.y,prevPropsPosition:{...E}}):null}constructor(S){super(S),v(this,"onDragStart",(C,E)=>{if((0,c.default)("Draggable: onDragStart: %j",E),this.props.onStart(C,(0,a.createDraggableData)(this,E))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),v(this,"onDrag",(C,E)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",E);const $=(0,a.createDraggableData)(this,E),T={x:$.x,y:$.y,slackX:0,slackY:0};if(this.props.bounds){const{x:M,y:L}=T;T.x+=this.state.slackX,T.y+=this.state.slackY;const[F,z]=(0,a.getBoundPosition)(this,T.x,T.y);T.x=F,T.y=z,T.slackX=this.state.slackX+(M-T.x),T.slackY=this.state.slackY+(L-T.y),$.x=T.x,$.y=T.y,$.deltaX=T.x-this.state.x,$.deltaY=T.y-this.state.y}if(this.props.onDrag(C,$)===!1)return!1;this.setState(T)}),v(this,"onDragStop",(C,E)=>{if(!this.state.dragging||this.props.onStop(C,(0,a.createDraggableData)(this,E))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",E);const T={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:M,y:L}=this.props.position;T.x=M,T.y=L}this.setState(T)}),this.state={dragging:!1,dragged:!1,x:S.position?S.position.x:S.defaultPosition.x,y:S.position?S.position.y:S.defaultPosition.y,prevPropsPosition:{...S.position},slackX:0,slackY:0,isElementSVG:!1},S.position&&!(S.onDrag||S.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var S,C;return(S=(C=this.props)===null||C===void 0||(C=C.nodeRef)===null||C===void 0?void 0:C.current)!==null&&S!==void 0?S:r.default.findDOMNode(this)}render(){const{axis:S,bounds:C,children:E,defaultPosition:$,defaultClassName:T,defaultClassNameDragging:D,defaultClassNameDragged:M,position:L,positionOffset:F,scale:z,...X}=this.props;let G={},A=null;const V=!!!L||this.state.dragging,K=L||$,q={x:(0,a.canDragX)(this)&&V?this.state.x:K.x,y:(0,a.canDragY)(this)&&V?this.state.y:K.y};this.state.isElementSVG?A=(0,i.createSVGTransform)(q,F):G=(0,i.createCSSTransform)(q,F);const O=(0,o.default)(E.props.className||"",T,{[D]:this.state.dragging,[M]:this.state.dragged});return t.createElement(l.default,p({},X,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(E),{className:O,style:{...E.props.style,...G},transform:A}))}}e.default=y,v(y,"displayName","Draggable"),v(y,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),v(y,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(Lk);const{default:qk,DraggableCore:UK}=Lk;$b.exports=qk;$b.exports.default=qk;$b.exports.DraggableCore=UK;var Gk=$b.exports,Ab={exports:{}},lp={},iC={};iC.__esModule=!0;iC.cloneElement=QK;var qK=GK(m);function GK(e){return e&&e.__esModule?e:{default:e}}function n$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function r$(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?n$(Object(n),!0).forEach(function(r){YK(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):n$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YK(e,t,n){return t=KK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KK(e){var t=XK(e,"string");return typeof t=="symbol"?t:String(t)}function XK(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function QK(e,t){return t.style&&e.props.style&&(t.style=r$(r$({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),qK.default.cloneElement(e,t)}var cp={};cp.__esModule=!0;cp.resizableProps=void 0;var yt=JK(Ks);function JK(e){return e&&e.__esModule?e:{default:e}}var ZK={axis:yt.default.oneOf(["both","x","y","none"]),className:yt.default.string,children:yt.default.element.isRequired,draggableOpts:yt.default.shape({allowAnyClick:yt.default.bool,cancel:yt.default.string,children:yt.default.node,disabled:yt.default.bool,enableUserSelectHack:yt.default.bool,offsetParent:yt.default.node,grid:yt.default.arrayOf(yt.default.number),handle:yt.default.string,nodeRef:yt.default.object,onStart:yt.default.func,onDrag:yt.default.func,onStop:yt.default.func,onMouseDown:yt.default.func,scale:yt.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="y"){var i;return(i=yt.default.number).isRequired.apply(i,n)}return yt.default.number.apply(yt.default,n)},handle:yt.default.oneOfType([yt.default.node,yt.default.func]),handleSize:yt.default.arrayOf(yt.default.number),lockAspectRatio:yt.default.bool,maxConstraints:yt.default.arrayOf(yt.default.number),minConstraints:yt.default.arrayOf(yt.default.number),onResizeStop:yt.default.func,onResizeStart:yt.default.func,onResize:yt.default.func,resizeHandles:yt.default.arrayOf(yt.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:yt.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="x"){var i;return(i=yt.default.number).isRequired.apply(i,n)}return yt.default.number.apply(yt.default,n)}};cp.resizableProps=ZK;lp.__esModule=!0;lp.default=void 0;var Qd=oX(m),eX=Gk,tX=iC,nX=cp,rX=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function Yk(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Yk=function(o){return o?n:t})(e)}function oX(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Yk(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Aw(){return Aw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Aw.apply(this,arguments)}function iX(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function o$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function h1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?o$(Object(n),!0).forEach(function(r){aX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aX(e,t,n){return t=sX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sX(e){var t=lX(e,"string");return typeof t=="symbol"?t:String(t)}function lX(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cX(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Mw(e,t)}function Mw(e,t){return Mw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Mw(e,t)}var aC=function(e){cX(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=e.call.apply(e,[this].concat(i))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(o,i){var a=this.props,s=a.minConstraints,l=a.maxConstraints,c=a.lockAspectRatio;if(!s&&!l&&!c)return[o,i];if(c){var u=this.props.width/this.props.height,d=o-this.props.width,h=i-this.props.height;Math.abs(d)>Math.abs(h*u)?i=o/u:o=i*u}var p=o,v=i,b=this.slack||[0,0],x=b[0],y=b[1];return o+=x,i+=y,s&&(o=Math.max(s[0],o),i=Math.max(s[1],i)),l&&(o=Math.min(l[0],o),i=Math.min(l[1],i)),this.slack=[x+(p-o),y+(v-i)],[o,i]},n.resizeHandler=function(o,i){var a=this;return function(s,l){var c=l.node,u=l.deltaX,d=l.deltaY;o==="onResizeStart"&&a.resetData();var h=(a.props.axis==="both"||a.props.axis==="x")&&i!=="n"&&i!=="s",p=(a.props.axis==="both"||a.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!h&&!p)){var v=i[0],b=i[i.length-1],x=c.getBoundingClientRect();if(a.lastHandleRect!=null){if(b==="w"){var y=x.left-a.lastHandleRect.left;u+=y}if(v==="n"){var _=x.top-a.lastHandleRect.top;d+=_}}a.lastHandleRect=x,b==="w"&&(u=-u),v==="n"&&(d=-d);var S=a.props.width+(h?u/a.props.transformScale:0),C=a.props.height+(p?d/a.props.transformScale:0),E=a.runConstraints(S,C);S=E[0],C=E[1];var $=S!==a.props.width||C!==a.props.height,T=typeof a.props[o]=="function"?a.props[o]:null,D=o==="onResize"&&!$;T&&!D&&(s.persist==null||s.persist(),T(s,{node:c,size:{width:S,height:C},handle:i})),o==="onResizeStop"&&a.resetData()}}},n.renderResizeHandle=function(o,i){var a=this.props.handle;if(!a)return Qd.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+o,ref:i});if(typeof a=="function")return a(o,i);var s=typeof a.type=="string",l=h1({ref:i},s?{}:{handleAxis:o});return Qd.cloneElement(a,l)},n.render=function(){var o=this,i=this.props,a=i.children,s=i.className,l=i.draggableOpts;i.width,i.height,i.handle,i.handleSize,i.lockAspectRatio,i.axis,i.minConstraints,i.maxConstraints,i.onResize,i.onResizeStop,i.onResizeStart;var c=i.resizeHandles;i.transformScale;var u=iX(i,rX);return(0,tX.cloneElement)(a,h1(h1({},u),{},{className:(s?s+" ":"")+"react-resizable",children:[].concat(a.props.children,c.map(function(d){var h,p=(h=o.handleRefs[d])!=null?h:o.handleRefs[d]=Qd.createRef();return Qd.createElement(eX.DraggableCore,Aw({},l,{nodeRef:p,key:"resizableHandle-"+d,onStop:o.resizeHandler("onResizeStop",d),onStart:o.resizeHandler("onResizeStart",d),onDrag:o.resizeHandler("onResize",d)}),o.renderResizeHandle(d,p))}))}))},t}(Qd.Component);lp.default=aC;aC.propTypes=nX.resizableProps;aC.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var Mb={};Mb.__esModule=!0;Mb.default=void 0;var p1=pX(m),uX=Kk(Ks),dX=Kk(lp),fX=cp,hX=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function Kk(e){return e&&e.__esModule?e:{default:e}}function Xk(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Xk=function(o){return o?n:t})(e)}function pX(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Xk(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function kw(){return kw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kw.apply(this,arguments)}function i$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function h0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?i$(Object(n),!0).forEach(function(r){gX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gX(e,t,n){return t=mX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mX(e){var t=bX(e,"string");return typeof t=="symbol"?t:String(t)}function bX(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vX(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function yX(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Iw(e,t)}function Iw(e,t){return Iw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Iw(e,t)}var Qk=function(e){yX(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=e.call.apply(e,[this].concat(i))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(s,l){var c=l.size;r.props.onResize?(s.persist==null||s.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(s,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(o,i){return i.propsWidth!==o.width||i.propsHeight!==o.height?{width:o.width,height:o.height,propsWidth:o.width,propsHeight:o.height}:null};var n=t.prototype;return n.render=function(){var o=this.props,i=o.handle,a=o.handleSize;o.onResize;var s=o.onResizeStart,l=o.onResizeStop,c=o.draggableOpts,u=o.minConstraints,d=o.maxConstraints,h=o.lockAspectRatio,p=o.axis;o.width,o.height;var v=o.resizeHandles,b=o.style,x=o.transformScale,y=vX(o,hX);return p1.createElement(dX.default,{axis:p,draggableOpts:c,handle:i,handleSize:a,height:this.state.height,lockAspectRatio:h,maxConstraints:d,minConstraints:u,onResizeStart:s,onResize:this.onResize,onResizeStop:l,resizeHandles:v,transformScale:x,width:this.state.width},p1.createElement("div",kw({},y,{style:h0(h0({},b),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(p1.Component);Mb.default=Qk;Qk.propTypes=h0(h0({},fX.resizableProps),{},{children:uX.default.element});Ab.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};Ab.exports.Resizable=lp.default;Ab.exports.ResizableBox=Mb.default;var xX=Ab.exports,Ia={};Object.defineProperty(Ia,"__esModule",{value:!0});Ia.resizeHandleType=Ia.resizeHandleAxesType=Ia.default=void 0;var Et=Jk(Ks),wX=Jk(m);function Jk(e){return e&&e.__esModule?e:{default:e}}const Zk=Et.default.arrayOf(Et.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));Ia.resizeHandleAxesType=Zk;const e6=Et.default.oneOfType([Et.default.node,Et.default.func]);Ia.resizeHandleType=e6;var _X={className:Et.default.string,style:Et.default.object,width:Et.default.number,autoSize:Et.default.bool,cols:Et.default.number,draggableCancel:Et.default.string,draggableHandle:Et.default.string,verticalCompact:function(e){e.verticalCompact===!1&&process.env.NODE_ENV!=="production"&&console.warn('`verticalCompact` on <ReactGridLayout> is deprecated and will be removed soon. Use `compactType`: "horizontal" | "vertical" | null.')},compactType:Et.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&Dt.validateLayout(t,"layout")},margin:Et.default.arrayOf(Et.default.number),containerPadding:Et.default.arrayOf(Et.default.number),rowHeight:Et.default.number,maxRows:Et.default.number,isBounded:Et.default.bool,isDraggable:Et.default.bool,isResizable:Et.default.bool,allowOverlap:Et.default.bool,preventCollision:Et.default.bool,useCSSTransforms:Et.default.bool,transformScale:Et.default.number,isDroppable:Et.default.bool,resizeHandles:Zk,resizeHandle:e6,onLayoutChange:Et.default.func,onDragStart:Et.default.func,onDrag:Et.default.func,onDragStop:Et.default.func,onResizeStart:Et.default.func,onResize:Et.default.func,onResizeStop:Et.default.func,onDrop:Et.default.func,droppingItem:Et.default.shape({i:Et.default.string.isRequired,w:Et.default.number.isRequired,h:Et.default.number.isRequired}),children:function(e,t){const n=e[t],r={};wX.default.Children.forEach(n,function(o){if((o==null?void 0:o.key)!=null){if(r[o.key])throw new Error('Duplicate child key "'+o.key+'" found! This will cause problems in ReactGridLayout.');r[o.key]=!0}})},innerRef:Et.default.any};Ia.default=_X;Object.defineProperty(Pb,"__esModule",{value:!0});Pb.default=void 0;var Uc=sC(m),Gt=sC(Ks),SX=Gk,CX=xX,qc=Dt,sr=ea,a$=Ia,EX=sC(US);function sC(e){return e&&e.__esModule?e:{default:e}}function Di(e,t,n){return t=RX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RX(e){var t=PX(e,"string");return typeof t=="symbol"?t:String(t)}function PX(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class lC extends Uc.default.Component{constructor(){super(...arguments),Di(this,"state",{resizing:null,dragging:null,className:""}),Di(this,"elementRef",Uc.default.createRef()),Di(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:o,transformScale:i}=this.props;if(!o)return;const a={top:0,left:0},{offsetParent:s}=r;if(!s)return;const l=s.getBoundingClientRect(),c=r.getBoundingClientRect(),u=c.left/i,d=l.left/i,h=c.top/i,p=l.top/i;a.left=u-d+s.scrollLeft,a.top=h-p+s.scrollTop,this.setState({dragging:a});const{x:v,y:b}=(0,sr.calcXY)(this.getPositionParams(),a.top,a.left,this.props.w,this.props.h);return o.call(this,this.props.i,v,b,{e:t,node:r,newPosition:a})}),Di(this,"onDrag",(t,n)=>{let{node:r,deltaX:o,deltaY:i}=n;const{onDrag:a}=this.props;if(!a)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let s=this.state.dragging.top+i,l=this.state.dragging.left+o;const{isBounded:c,i:u,w:d,h,containerWidth:p}=this.props,v=this.getPositionParams();if(c){const{offsetParent:_}=r;if(_){const{margin:S,rowHeight:C}=this.props,E=_.clientHeight-(0,sr.calcGridItemWHPx)(h,C,S[1]);s=(0,sr.clamp)(s,0,E);const $=(0,sr.calcGridColWidth)(v),T=p-(0,sr.calcGridItemWHPx)(d,$,S[0]);l=(0,sr.clamp)(l,0,T)}}const b={top:s,left:l};this.setState({dragging:b});const{x,y}=(0,sr.calcXY)(v,s,l,d,h);return a.call(this,u,x,y,{e:t,node:r,newPosition:b})}),Di(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:o}=this.props;if(!o)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:i,h:a,i:s}=this.props,{left:l,top:c}=this.state.dragging,u={top:c,left:l};this.setState({dragging:null});const{x:d,y:h}=(0,sr.calcXY)(this.getPositionParams(),c,l,i,a);return o.call(this,s,d,h,{e:t,node:r,newPosition:u})}),Di(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),Di(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),Di(this,"onResize",(t,n,r)=>this.onResizeHandler(t,n,r,"onResize"))}shouldComponentUpdate(t,n){if(this.props.children!==t.children||this.props.droppingPosition!==t.droppingPosition)return!0;const r=(0,sr.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,sr.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,qc.fastPositionEqual)(r,o)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const o=t.droppingPosition||{left:0,top:0},{dragging:i}=this.state,a=i&&n.left!==o.left||n.top!==o.top;if(!i)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(a){const s=n.left-i.left,l=n.top-i.top;this.onDrag(n.e,{node:r,deltaX:s,deltaY:l})}}getPositionParams(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}createStyle(t){const{usePercentages:n,containerWidth:r,useCSSTransforms:o}=this.props;let i;return o?i=(0,qc.setTransform)(t):(i=(0,qc.setTopLeft)(t),n&&(i.left=(0,qc.perc)(t.left/r),i.width=(0,qc.perc)(t.width/r))),i}mixinDraggable(t,n){return Uc.default.createElement(SX.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,n){return(r,o)=>n(r,o,t)}mixinResizable(t,n,r){const{cols:o,minW:i,minH:a,maxW:s,maxH:l,transformScale:c,resizeHandles:u,resizeHandle:d}=this.props,h=this.getPositionParams(),p=(0,sr.calcGridItemPosition)(h,0,0,o,0).width,v=(0,sr.calcGridItemPosition)(h,0,0,i,a),b=(0,sr.calcGridItemPosition)(h,0,0,s,l),x=[v.width,v.height],y=[Math.min(b.width,p),Math.min(b.height,1/0)];return Uc.default.createElement(CX.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:x,maxConstraints:y,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:u,handle:d},t)}onResizeHandler(t,n,r,o){let{node:i,size:a,handle:s}=n;const l=this.props[o];if(!l)return;const{x:c,y:u,i:d,maxH:h,minH:p,containerWidth:v}=this.props,{minW:b,maxW:x}=this.props;let y=a;i&&(y=(0,qc.resizeItemInDirection)(s,r,a,v),this.setState({resizing:o==="onResizeStop"?null:y}));let{w:_,h:S}=(0,sr.calcWH)(this.getPositionParams(),y.width,y.height,c,u,s);_=(0,sr.clamp)(_,Math.max(b,1),x),S=(0,sr.clamp)(S,p,h),l.call(this,d,_,S,{e:t,node:i,size:y,handle:s})}render(){const{x:t,y:n,w:r,h:o,isDraggable:i,isResizable:a,droppingPosition:s,useCSSTransforms:l}=this.props,c=(0,sr.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),u=Uc.default.Children.only(this.props.children);let d=Uc.default.cloneElement(u,{ref:this.elementRef,className:(0,EX.default)("react-grid-item",u.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":i,"react-draggable-dragging":!!this.state.dragging,dropping:!!s,cssTransforms:l}),style:{...this.props.style,...u.props.style,...this.createStyle(c)}});return d=this.mixinResizable(d,c,a),d=this.mixinDraggable(d,i),d}}Pb.default=lC;Di(lC,"propTypes",{children:Gt.default.element,cols:Gt.default.number.isRequired,containerWidth:Gt.default.number.isRequired,rowHeight:Gt.default.number.isRequired,margin:Gt.default.array.isRequired,maxRows:Gt.default.number.isRequired,containerPadding:Gt.default.array.isRequired,x:Gt.default.number.isRequired,y:Gt.default.number.isRequired,w:Gt.default.number.isRequired,h:Gt.default.number.isRequired,minW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minWidth not Number");if(n>e.w||n>e.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxWidth not Number");if(n<e.w||n<e.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minHeight not Number");if(n>e.h||n>e.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxHeight not Number");if(n<e.h||n<e.minH)return new Error("maxHeight smaller than item height/minHeight")},i:Gt.default.string.isRequired,resizeHandles:a$.resizeHandleAxesType,resizeHandle:a$.resizeHandleType,onDragStop:Gt.default.func,onDragStart:Gt.default.func,onDrag:Gt.default.func,onResizeStop:Gt.default.func,onResizeStart:Gt.default.func,onResize:Gt.default.func,isDraggable:Gt.default.bool.isRequired,isResizable:Gt.default.bool.isRequired,isBounded:Gt.default.bool.isRequired,static:Gt.default.bool,useCSSTransforms:Gt.default.bool.isRequired,transformScale:Gt.default.number,className:Gt.default.string,handle:Gt.default.string,cancel:Gt.default.string,droppingPosition:Gt.default.shape({e:Gt.default.object.isRequired,left:Gt.default.number.isRequired,top:Gt.default.number.isRequired})});Di(lC,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty(sp,"__esModule",{value:!0});sp.default=void 0;var ul=DX(m),g1=WS,$X=cC(US),at=Dt,OX=ea,s$=cC(Pb),TX=cC(Ia);function cC(e){return e&&e.__esModule?e:{default:e}}function t6(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(t6=function(r){return r?n:t})(e)}function DX(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=t6(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function yr(e,t,n){return t=AX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AX(e){var t=MX(e,"string");return typeof t=="symbol"?t:String(t)}function MX(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const l$="react-grid-layout";let n6=!1;try{n6=/firefox/i.test(navigator.userAgent)}catch{}class kb extends ul.Component{constructor(){super(...arguments),yr(this,"state",{activeDrag:null,layout:(0,at.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,at.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),yr(this,"dragEnterCounter",0),yr(this,"onDragStart",(t,n,r,o)=>{let{e:i,node:a}=o;const{layout:s}=this.state,l=(0,at.getLayoutItem)(s,t);if(l)return this.setState({oldDragItem:(0,at.cloneLayoutItem)(l),oldLayout:s}),this.props.onDragStart(s,l,l,null,i,a)}),yr(this,"onDrag",(t,n,r,o)=>{let{e:i,node:a}=o;const{oldDragItem:s}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:u,preventCollision:d}=this.props,h=(0,at.getLayoutItem)(l,t);if(!h)return;const p={w:h.w,h:h.h,x:h.x,y:h.y,placeholder:!0,i:t},v=!0;l=(0,at.moveElement)(l,h,n,r,v,d,(0,at.compactType)(this.props),c,u),this.props.onDrag(l,s,h,p,i,a),this.setState({layout:u?l:(0,at.compact)(l,(0,at.compactType)(this.props),c),activeDrag:p})}),yr(this,"onDragStop",(t,n,r,o)=>{let{e:i,node:a}=o;if(!this.state.activeDrag)return;const{oldDragItem:s}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:u,allowOverlap:d}=this.props,h=(0,at.getLayoutItem)(l,t);if(!h)return;const p=!0;l=(0,at.moveElement)(l,h,n,r,p,u,(0,at.compactType)(this.props),c,d);const v=d?l:(0,at.compact)(l,(0,at.compactType)(this.props),c);this.props.onDragStop(v,s,h,null,i,a);const{oldLayout:b}=this.state;this.setState({activeDrag:null,layout:v,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(v,b)}),yr(this,"onResizeStart",(t,n,r,o)=>{let{e:i,node:a}=o;const{layout:s}=this.state,l=(0,at.getLayoutItem)(s,t);l&&(this.setState({oldResizeItem:(0,at.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(s,l,l,null,i,a))}),yr(this,"onResize",(t,n,r,o)=>{let{e:i,node:a,size:s,handle:l}=o;const{oldResizeItem:c}=this.state;let{layout:u}=this.state;const{cols:d,preventCollision:h,allowOverlap:p}=this.props;let v=!1,b,x,y;const[_,S]=(0,at.withLayoutItem)(u,t,E=>{let $;return x=E.x,y=E.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(x=E.x+(E.w-n),n=E.x!==x&&x<0?E.w:n,x=x<0?0:x),["ne","n","nw"].indexOf(l)!==-1&&(y=E.y+(E.h-r),r=E.y!==y&&y<0?E.h:r,y=y<0?0:y),v=!0),h&&!p&&($=(0,at.getAllCollisions)(u,{...E,w:n,h:r,x,y}).filter(D=>D.i!==E.i).length>0,$&&(y=E.y,r=E.h,x=E.x,n=E.w,v=!1)),E.w=n,E.h=r,E});if(!S)return;b=_,v&&(b=(0,at.moveElement)(_,S,x,y,!0,this.props.preventCollision,(0,at.compactType)(this.props),d,p));const C={w:S.w,h:S.h,x:S.x,y:S.y,static:!0,i:t};this.props.onResize(b,c,S,C,i,a),this.setState({layout:p?b:(0,at.compact)(b,(0,at.compactType)(this.props),d),activeDrag:C})}),yr(this,"onResizeStop",(t,n,r,o)=>{let{e:i,node:a}=o;const{layout:s,oldResizeItem:l}=this.state,{cols:c,allowOverlap:u}=this.props,d=(0,at.getLayoutItem)(s,t),h=u?s:(0,at.compact)(s,(0,at.compactType)(this.props),c);this.props.onResizeStop(h,l,d,null,i,a);const{oldLayout:p}=this.state;this.setState({activeDrag:null,layout:h,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(h,p)}),yr(this,"onDragOver",t=>{var n;if(t.preventDefault(),t.stopPropagation(),n6&&!((n=t.nativeEvent.target)!==null&&n!==void 0&&n.classList.contains(l$)))return!1;const{droppingItem:r,onDropDragOver:o,margin:i,cols:a,rowHeight:s,maxRows:l,width:c,containerPadding:u,transformScale:d}=this.props,h=o==null?void 0:o(t);if(h===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const p={...r,...h},{layout:v}=this.state,{layerX:b,layerY:x}=t.nativeEvent,y={left:b/d,top:x/d,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:_,top:S}=this.state.droppingPosition;(_!=b||S!=x)&&this.setState({droppingPosition:y})}}else{const _={cols:a,margin:i,maxRows:l,rowHeight:s,containerWidth:c,containerPadding:u||i},S=(0,OX.calcXY)(_,x,b,p.w,p.h);this.setState({droppingDOMNode:ul.createElement("div",{key:p.i}),droppingPosition:y,layout:[...v,{...p,x:S.x,y:S.y,static:!1,isDraggable:!0}]})}}),yr(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,o=(0,at.compact)(r.filter(i=>i.i!==t.i),(0,at.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),yr(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),yr(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),yr(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,o=r.find(i=>i.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,o,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,g1.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,at.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,at.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,at.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,at.fastRGLPropsEqual)(this.props,t,g1.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,o=n.layout;this.onLayoutMaybeChanged(r,o)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,at.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(t,n){n||(n=this.state.layout),(0,g1.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:o,containerPadding:i,rowHeight:a,maxRows:s,useCSSTransforms:l,transformScale:c}=this.props;return ul.createElement(s$.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:"react-grid-placeholder ".concat(this.state.resizing?"placeholder-resizing":""),containerWidth:n,cols:r,margin:o,containerPadding:i||o,maxRows:s,rowHeight:a,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},ul.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,at.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:o,cols:i,margin:a,containerPadding:s,rowHeight:l,maxRows:c,isDraggable:u,isResizable:d,isBounded:h,useCSSTransforms:p,transformScale:v,draggableCancel:b,draggableHandle:x,resizeHandles:y,resizeHandle:_}=this.props,{mounted:S,droppingPosition:C}=this.state,E=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&u,$=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&d,T=r.resizeHandles||y,D=E&&h&&r.isBounded!==!1;return ul.createElement(s$.default,{containerWidth:o,cols:i,margin:a,containerPadding:s||a,maxRows:c,rowHeight:l,cancel:b,handle:x,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:E,isResizable:$,isBounded:D,useCSSTransforms:p&&S,usePercentages:!S,transformScale:v,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?C:void 0,resizeHandles:T,resizeHandle:_},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,$X.default)(l$,t),a={height:this.containerHeight(),...n};return ul.createElement("div",{ref:o,className:i,style:a,onDrop:r?this.onDrop:at.noop,onDragLeave:r?this.onDragLeave:at.noop,onDragEnter:r?this.onDragEnter:at.noop,onDragOver:r?this.onDragOver:at.noop},ul.Children.map(this.props.children,s=>this.processGridItem(s)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}sp.default=kb;yr(kb,"displayName","ReactGridLayout");yr(kb,"propTypes",TX.default);yr(kb,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:at.noop,onDragStart:at.noop,onDrag:at.noop,onDragStop:at.noop,onResizeStart:at.noop,onResize:at.noop,onResizeStop:at.noop,onDrop:at.noop,onDropDragOver:at.noop});var Ib={},xc={};Object.defineProperty(xc,"__esModule",{value:!0});xc.findOrGenerateResponsiveLayout=NX;xc.getBreakpointFromWidth=kX;xc.getColsFromBreakpoint=IX;xc.sortBreakpoints=uC;var Ag=Dt;function kX(e,t){const n=uC(e);let r=n[0];for(let o=1,i=n.length;o<i;o++){const a=n[o];t>e[a]&&(r=a)}return r}function IX(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function NX(e,t,n,r,o,i){if(e[n])return(0,Ag.cloneLayout)(e[n]);let a=e[r];const s=uC(t),l=s.slice(s.indexOf(n));for(let c=0,u=l.length;c<u;c++){const d=l[c];if(e[d]){a=e[d];break}}return a=(0,Ag.cloneLayout)(a||[]),(0,Ag.compact)((0,Ag.correctBounds)(a,{cols:o}),i,o)}function uC(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(Ib,"__esModule",{value:!0});Ib.default=void 0;var c$=FX(m),Gr=r6(Ks),m1=WS,xu=Dt,dl=xc,LX=r6(sp);function r6(e){return e&&e.__esModule?e:{default:e}}function o6(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(o6=function(r){return r?n:t})(e)}function FX(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=o6(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Nw(){return Nw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nw.apply(this,arguments)}function p0(e,t,n){return t=jX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jX(e){var t=zX(e,"string");return typeof t=="symbol"?t:String(t)}function zX(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const u$=e=>Object.prototype.toString.call(e);function Mg(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class dC extends c$.Component{constructor(){super(...arguments),p0(this,"state",this.generateInitialState()),p0(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:o}=this.props,i=(0,dl.getBreakpointFromWidth)(n,t),a=(0,dl.getColsFromBreakpoint)(i,o),s=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,dl.findOrGenerateResponsiveLayout)(r,n,i,i,a,s),breakpoint:i,cols:a}}static getDerivedStateFromProps(t,n){if(!(0,m1.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,dl.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,o,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,m1.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,m1.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:o,compactType:i}=this.props,a=this.props.breakpoint||(0,dl.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),s=this.state.breakpoint,l=(0,dl.getColsFromBreakpoint)(a,r),c={...o};if(s!==a||t.breakpoints!==n||t.cols!==r){s in c||(c[s]=(0,xu.cloneLayout)(this.state.layout));let h=(0,dl.findOrGenerateResponsiveLayout)(c,n,a,s,l,i);h=(0,xu.synchronizeLayoutWithChildren)(h,this.props.children,l,i,this.props.allowOverlap),c[a]=h,this.props.onLayoutChange(h,c),this.props.onBreakpointChange(a,l),this.setState({breakpoint:a,layout:h,cols:l})}const u=Mg(this.props.margin,a),d=Mg(this.props.containerPadding,a);this.props.onWidthChange(this.props.width,u,l,d)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:o,margin:i,containerPadding:a,onBreakpointChange:s,onLayoutChange:l,onWidthChange:c,...u}=this.props;return c$.createElement(LX.default,Nw({},u,{margin:Mg(i,this.state.breakpoint),containerPadding:Mg(a,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Ib.default=dC;p0(dC,"propTypes",{breakpoint:Gr.default.string,breakpoints:Gr.default.object,allowOverlap:Gr.default.bool,cols:Gr.default.object,margin:Gr.default.oneOfType([Gr.default.array,Gr.default.object]),containerPadding:Gr.default.oneOfType([Gr.default.array,Gr.default.object]),layouts(e,t){if(u$(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+u$(e[t]));Object.keys(e[t]).forEach(n=>{if(!(n in e.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,xu.validateLayout)(e.layouts[n],"layouts."+n)})},width:Gr.default.number.isRequired,onBreakpointChange:Gr.default.func,onLayoutChange:Gr.default.func,onWidthChange:Gr.default.func});p0(dC,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:xu.noop,onLayoutChange:xu.noop,onWidthChange:xu.noop});var fC={},i6=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,i){return o[0]===n?(r=i,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,i=this.__entries__;o<i.length;o++){var a=i[o];n.call(r,a[1],a[0])}},t}()}(),Lw=typeof window<"u"&&typeof document<"u"&&window.document===document,g0=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),BX=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(g0):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),VX=2;function HX(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&s()}function a(){BX(i)}function s(){var l=Date.now();if(n){if(l-o<VX)return;r=!0}else n=!0,r=!1,setTimeout(a,t);o=l}return s}var WX=20,UX=["top","right","bottom","left","width","height","size","weight"],qX=typeof MutationObserver<"u",GX=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=HX(this.refresh.bind(this),WX)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!Lw||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),qX?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Lw||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=UX.some(function(i){return!!~r.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),a6=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},Gu=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||g0},s6=Nb(0,0,0,0);function m0(e){return parseFloat(e)||0}function d$(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,o){var i=e["border-"+o+"-width"];return r+m0(i)},0)}function YX(e){for(var t=["top","right","bottom","left"],n={},r=0,o=t;r<o.length;r++){var i=o[r],a=e["padding-"+i];n[i]=m0(a)}return n}function KX(e){var t=e.getBBox();return Nb(0,0,t.width,t.height)}function XX(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return s6;var r=Gu(e).getComputedStyle(e),o=YX(r),i=o.left+o.right,a=o.top+o.bottom,s=m0(r.width),l=m0(r.height);if(r.boxSizing==="border-box"&&(Math.round(s+i)!==t&&(s-=d$(r,"left","right")+i),Math.round(l+a)!==n&&(l-=d$(r,"top","bottom")+a)),!JX(e)){var c=Math.round(s+i)-t,u=Math.round(l+a)-n;Math.abs(c)!==1&&(s-=c),Math.abs(u)!==1&&(l-=u)}return Nb(o.left,o.top,s,l)}var QX=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof Gu(e).SVGGraphicsElement}:function(e){return e instanceof Gu(e).SVGElement&&typeof e.getBBox=="function"}}();function JX(e){return e===Gu(e).document.documentElement}function ZX(e){return Lw?QX(e)?KX(e):XX(e):s6}function eQ(e){var t=e.x,n=e.y,r=e.width,o=e.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,a=Object.create(i.prototype);return a6(a,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),a}function Nb(e,t,n,r){return{x:e,y:t,width:n,height:r}}var tQ=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Nb(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=ZX(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),nQ=function(){function e(t,n){var r=eQ(n);a6(this,{target:t,contentRect:r})}return e}(),rQ=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new i6,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Gu(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new tQ(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Gu(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new nQ(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),l6=typeof WeakMap<"u"?new WeakMap:new i6,c6=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=GX.getInstance(),r=new rQ(t,n,this);l6.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){c6.prototype[e]=function(){var t;return(t=l6.get(this))[e].apply(t,arguments)}});var oQ=function(){return typeof g0.ResizeObserver<"u"?g0.ResizeObserver:c6}();const iQ=Object.freeze(Object.defineProperty({__proto__:null,default:oQ},Symbol.toStringTag,{value:"Module"})),aQ=SS(iQ);Object.defineProperty(fC,"__esModule",{value:!0});fC.default=pQ;var kg=uQ(m),sQ=hC(Ks),lQ=hC(aQ),cQ=hC(US);function hC(e){return e&&e.__esModule?e:{default:e}}function u6(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(u6=function(r){return r?n:t})(e)}function uQ(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=u6(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Fw(){return Fw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fw.apply(this,arguments)}function Gc(e,t,n){return t=dQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dQ(e){var t=fQ(e,"string");return typeof t=="symbol"?t:String(t)}function fQ(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const hQ="react-grid-layout";function pQ(e){var t;return t=class extends kg.Component{constructor(){super(...arguments),Gc(this,"state",{width:1280}),Gc(this,"elementRef",kg.createRef()),Gc(this,"mounted",!1),Gc(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new lQ.default(o=>{if(this.elementRef.current instanceof HTMLElement){const a=o[0].contentRect.width;this.setState({width:a})}});const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.observe(r)}componentWillUnmount(){this.mounted=!1;const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.unobserve(r),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:r,...o}=this.props;return r&&!this.mounted?kg.createElement("div",{className:(0,cQ.default)(this.props.className,hQ),style:this.props.style,ref:this.elementRef}):kg.createElement(e,Fw({innerRef:this.elementRef},o,this.state))}},Gc(t,"defaultProps",{measureBeforeMount:!1}),Gc(t,"propTypes",{measureBeforeMount:sQ.default.bool}),t}(function(e){e.exports=sp.default,e.exports.utils=Dt,e.exports.calculateUtils=ea,e.exports.Responsive=Ib.default,e.exports.Responsive.utils=xc,e.exports.WidthProvider=fC.default})(_k);var f$=_k.exports;function Br(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var gQ=["color"],mQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,gQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),bQ=["color"],d6=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,bQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),vQ=["color"],yQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,vQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),xQ=["color"],wQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,xQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M5 2V1H10V2H5ZM4.75 0C4.33579 0 4 0.335786 4 0.75V1H3.5C2.67157 1 2 1.67157 2 2.5V12.5C2 13.3284 2.67157 14 3.5 14H7V13H3.5C3.22386 13 3 12.7761 3 12.5V2.5C3 2.22386 3.22386 2 3.5 2H4V2.25C4 2.66421 4.33579 3 4.75 3H10.25C10.6642 3 11 2.66421 11 2.25V2H11.5C11.7761 2 12 2.22386 12 2.5V7H13V2.5C13 1.67157 12.3284 1 11.5 1H11V0.75C11 0.335786 10.6642 0 10.25 0H4.75ZM9 8.5C9 8.77614 8.77614 9 8.5 9C8.22386 9 8 8.77614 8 8.5C8 8.22386 8.22386 8 8.5 8C8.77614 8 9 8.22386 9 8.5ZM10.5 9C10.7761 9 11 8.77614 11 8.5C11 8.22386 10.7761 8 10.5 8C10.2239 8 10 8.22386 10 8.5C10 8.77614 10.2239 9 10.5 9ZM13 8.5C13 8.77614 12.7761 9 12.5 9C12.2239 9 12 8.77614 12 8.5C12 8.22386 12.2239 8 12.5 8C12.7761 8 13 8.22386 13 8.5ZM14.5 9C14.7761 9 15 8.77614 15 8.5C15 8.22386 14.7761 8 14.5 8C14.2239 8 14 8.22386 14 8.5C14 8.77614 14.2239 9 14.5 9ZM15 10.5C15 10.7761 14.7761 11 14.5 11C14.2239 11 14 10.7761 14 10.5C14 10.2239 14.2239 10 14.5 10C14.7761 10 15 10.2239 15 10.5ZM14.5 13C14.7761 13 15 12.7761 15 12.5C15 12.2239 14.7761 12 14.5 12C14.2239 12 14 12.2239 14 12.5C14 12.7761 14.2239 13 14.5 13ZM14.5 15C14.7761 15 15 14.7761 15 14.5C15 14.2239 14.7761 14 14.5 14C14.2239 14 14 14.2239 14 14.5C14 14.7761 14.2239 15 14.5 15ZM8.5 11C8.77614 11 9 10.7761 9 10.5C9 10.2239 8.77614 10 8.5 10C8.22386 10 8 10.2239 8 10.5C8 10.7761 8.22386 11 8.5 11ZM9 12.5C9 12.7761 8.77614 13 8.5 13C8.22386 13 8 12.7761 8 12.5C8 12.2239 8.22386 12 8.5 12C8.77614 12 9 12.2239 9 12.5ZM8.5 15C8.77614 15 9 14.7761 9 14.5C9 14.2239 8.77614 14 8.5 14C8.22386 14 8 14.2239 8 14.5C8 14.7761 8.22386 15 8.5 15ZM11 14.5C11 14.7761 10.7761 15 10.5 15C10.2239 15 10 14.7761 10 14.5C10 14.2239 10.2239 14 10.5 14C10.7761 14 11 14.2239 11 14.5ZM12.5 15C12.7761 15 13 14.7761 13 14.5C13 14.2239 12.7761 14 12.5 14C12.2239 14 12 14.2239 12 14.5C12 14.7761 12.2239 15 12.5 15Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),_Q=["color"],f6=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,_Q);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),SQ=["color"],CQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,SQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z",fill:r}))}),EQ=["color"],RQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,EQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M14.7649 6.07596C14.9991 6.22231 15.0703 6.53079 14.9239 6.76495C14.4849 7.46743 13.9632 8.10645 13.3702 8.66305L14.5712 9.86406C14.7664 10.0593 14.7664 10.3759 14.5712 10.5712C14.3759 10.7664 14.0593 10.7664 13.8641 10.5712L12.6011 9.30817C11.805 9.90283 10.9089 10.3621 9.93375 10.651L10.383 12.3277C10.4544 12.5944 10.2961 12.8685 10.0294 12.94C9.76267 13.0115 9.4885 12.8532 9.41704 12.5865L8.95917 10.8775C8.48743 10.958 8.00036 10.9999 7.50001 10.9999C6.99965 10.9999 6.51257 10.958 6.04082 10.8775L5.58299 12.5864C5.51153 12.8532 5.23737 13.0115 4.97064 12.94C4.7039 12.8686 4.5456 12.5944 4.61706 12.3277L5.06625 10.651C4.09111 10.3621 3.19503 9.90282 2.3989 9.30815L1.1359 10.5712C0.940638 10.7664 0.624058 10.7664 0.428798 10.5712C0.233537 10.3759 0.233537 10.0593 0.428798 9.86405L1.62982 8.66303C1.03682 8.10643 0.515113 7.46742 0.0760677 6.76495C-0.0702867 6.53079 0.000898544 6.22231 0.235065 6.07596C0.469231 5.9296 0.777703 6.00079 0.924058 6.23496C1.40354 7.00213 1.989 7.68057 2.66233 8.2427C2.67315 8.25096 2.6837 8.25972 2.69397 8.26898C4.00897 9.35527 5.65537 9.99991 7.50001 9.99991C10.3078 9.99991 12.6564 8.5063 14.076 6.23495C14.2223 6.00079 14.5308 5.9296 14.7649 6.07596Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),PQ=["color"],$Q=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,PQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),OQ=["color"],TQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,OQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),DQ=["color"],h6=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,DQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),AQ=["color"],MQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,AQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M3.24182 2.32181C3.3919 2.23132 3.5784 2.22601 3.73338 2.30781L12.7334 7.05781C12.8974 7.14436 13 7.31457 13 7.5C13 7.68543 12.8974 7.85564 12.7334 7.94219L3.73338 12.6922C3.5784 12.774 3.3919 12.7687 3.24182 12.6782C3.09175 12.5877 3 12.4252 3 12.25V2.75C3 2.57476 3.09175 2.4123 3.24182 2.32181ZM4 3.57925V11.4207L11.4288 7.5L4 3.57925Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),kQ=["color"],IQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,kQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M10.3004 7.49991C10.3004 8.4943 9.49426 9.30041 8.49988 9.30041C7.50549 9.30041 6.69938 8.4943 6.69938 7.49991C6.69938 6.50553 7.50549 5.69942 8.49988 5.69942C9.49426 5.69942 10.3004 6.50553 10.3004 7.49991ZM11.205 8C10.9699 9.28029 9.84816 10.2504 8.49988 10.2504C7.1516 10.2504 6.0299 9.28029 5.79473 8H0.5C0.223858 8 0 7.77614 0 7.5C0 7.22386 0.223858 7 0.5 7H5.7947C6.0298 5.71962 7.15154 4.74942 8.49988 4.74942C9.84822 4.74942 10.97 5.71962 11.2051 7H14.5C14.7761 7 15 7.22386 15 7.5C15 7.77614 14.7761 8 14.5 8H11.205Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),NQ=["color"],LQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,NQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M2 3C2 2.44772 2.44772 2 3 2H12C12.5523 2 13 2.44772 13 3V12C13 12.5523 12.5523 13 12 13H3C2.44772 13 2 12.5523 2 12V3ZM12 3H3V12H12V3Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),FQ=["color"],p6=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,FQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:r}))}),jQ=["color"],g6=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,jQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:r}))});let Ig;const zQ=new Uint8Array(16);function BQ(){if(!Ig&&(Ig=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ig))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ig(zQ)}const lr=[];for(let e=0;e<256;++e)lr.push((e+256).toString(16).slice(1));function VQ(e,t=0){return lr[e[t+0]]+lr[e[t+1]]+lr[e[t+2]]+lr[e[t+3]]+"-"+lr[e[t+4]]+lr[e[t+5]]+"-"+lr[e[t+6]]+lr[e[t+7]]+"-"+lr[e[t+8]]+lr[e[t+9]]+"-"+lr[e[t+10]]+lr[e[t+11]]+lr[e[t+12]]+lr[e[t+13]]+lr[e[t+14]]+lr[e[t+15]]}const HQ=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),h$={randomUUID:HQ};function Fs(e,t,n){if(h$.randomUUID&&!t&&!e)return h$.randomUUID();e=e||{};const r=e.random||(e.rng||BQ)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let o=0;o<16;++o)t[n+o]=r[o];return t}return VQ(r)}const Ir=DM()(FM((e,t)=>({isShowingVisual:!0,runSql:!1,sqlGen:{},sql:"",isSqlRunning:!1,queryResultColumns:[],showFilters:!1,applyFilters:!1,filterValues:[{filterId:"sample-filter-id",valueType:"string",name:"",operation:"in",values:[""]}],card:{id:Fs(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:Fs(),cards:[],activeCardId:""},actions:{setCustomCardPreferences:n=>{e(r=>{r.card.customCardPreferences=n})},setChartOrientation:n=>{e(r=>{var a,s,l,c,u,d;const o=r.card.preferences;let i={};((a=o==null?void 0:o.chartOptions)==null?void 0:a.indexAxis)!==n&&(i={x:(l=(s=o==null?void 0:o.chartOptions)==null?void 0:s.scales)==null?void 0:l.y,y:(u=(c=o==null?void 0:o.chartOptions)==null?void 0:c.scales)==null?void 0:u.x}),r.card.preferences={...o,chartOptions:{...o==null?void 0:o.chartOptions,scales:{...(d=o==null?void 0:o.chartOptions)==null?void 0:d.scales,...i},indexAxis:n}}})},setSortChart:n=>{e(r=>{r.card.preferences={...r.card.preferences,sortChart:n}})},setCustomVisualCode:n=>{e(r=>{r.card.preferences={...r.card.preferences,customVisualCode:n}})},setNumberFormat:(n,r,o,i)=>{e(a=>{var s,l,c;a.card.preferences={...(s=a.card)==null?void 0:s.preferences,formatNumber:{...(c=(l=a.card)==null?void 0:l.preferences)==null?void 0:c.formatNumber,decimalPlaces:n,currency:r,locale:o,suffix:i,enabled:!0}}})},setColorRanges:n=>{e(r=>{var o,i;r.card.preferences={...r.card.preferences,formatNumber:{...(i=(o=r.card)==null?void 0:o.preferences)==null?void 0:i.formatNumber,colorRanges:n}}})},setQueryError:n=>{e(r=>{r.queryError=n})},setQueryResultColumns:n=>{e(r=>{r.queryResultColumns=n})},setCardPreferences:n=>{e(r=>{r.card.preferences=n})},setFilterOnClickColumnIndex:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClickColumnIndex:n}})},setFilterOnClickField:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClick:!0,filterOnClickField:n}})},setCardRefreshInterval:n=>{e(r=>{r.card.refreshInterval=n})},setIsShowingVisual:n=>{e({isShowingVisual:n})},setRunSql:n=>{e({runSql:n})},setIsSqlRunning:n=>{e({isSqlRunning:n})},updateCardInFrame:n=>{e(r=>{r.frame.cards=r.frame.cards.map(o=>o.id===n.id?n:o)})},setFrame:n=>{e({frame:n})},setCard:n=>{e({card:n})},setCardType:n=>{e(r=>{var o;r.card.type=n,n==="range"&&(r.card.preferences={...r.card.preferences,chartOptions:{...(o=r.card.preferences)==null?void 0:o.chartOptions,indexAxis:"y"}})})},setCardSql:n=>{e(r=>{r.card.sql=n})},setCardPython:n=>{e(r=>{r.card.python=n})},setPythonStdOut:n=>{e(r=>{r.pythonStdOut=n})},setCardCustomCfg:n=>{e(r=>{r.card.customCfg=n})},setCardCfg:n=>{e(r=>{r.card.cfg=n})},setShowFilters:n=>{e(r=>{r.showFilters=n})},setApplyFilters:n=>{e(r=>{r.applyFilters=n})},setFilterValues:n=>{e(r=>{r.filterValues=n})},setSqlGen:n=>{e(r=>{r.sqlGen=n})},setSqlGenMeasure:(n,r)=>{e(o=>{o.sqlGen.measures=[...o.sqlGen.measures||[],{name:n,calc:r}]})},setSqlGenDimension:n=>{e(r=>{r.sqlGen.dimensions=[...r.sqlGen.dimensions||[],n]})},setSelectedDatamodelId:n=>{var r,o;e(i=>{i.selectedDatamodelId=n,i.card.datamodelId=n}),(o=(r=t()).onDatamodelChange)==null||o.call(r,n)},setSelectedConnectionId:n=>{var r,o;e(i=>{i.selectedConnectionId=n,i.card.connectionId=n}),(o=(r=t()).onConnectionChange)==null||o.call(r,n)},setSelectedDatabaseName:n=>{var r,o;e(i=>{i.selectedDatabaseName=n,i.card.lastSelectedDatabase=n}),(o=(r=t()).onDatabaseChange)==null||o.call(r,n)},setSelectedSchemaName:n=>{var r,o;e(i=>{i.selectedSchemaName=n,i.card.lastSelectedSchema=n}),(o=(r=t()).onSchemaChange)==null||o.call(r,n)},setSelectedTableName:n=>{var r,o;e(i=>{i.selectedTableName=n,i.card.lastSelectedTable=n}),(o=(r=t()).onTableChange)==null||o.call(r,n)},setCurrentColumns:n=>{e(r=>{r.currentColumns=n})},setOnConnectionChange:n=>{e({onConnectionChange:n})},setOnDatabaseChange:n=>{e({onDatabaseChange:n})},setOnSchemaChange:n=>{e({onSchemaChange:n})},setOnTableChange:n=>{e({onTableChange:n})},setOnSave:n=>{e({onSave:n})},setOnClose:n=>{e({onClose:n})}}}))),Lb=()=>Ir(e=>e.actions);function WQ(e,t,n){var l,c,u,d;const r=n==null?void 0:n.datasetOptions,o=we.getState().themeStyle,i=(c=(l=o==null?void 0:o.chart)==null?void 0:l.dataset)==null?void 0:c.backgroundColor,a=(d=(u=o==null?void 0:o.chart)==null?void 0:u.dataset)==null?void 0:d.borderColor;return e.map((h,p)=>{var S;const v=r==null?void 0:r.find(C=>C.idx===p),b=i==null?void 0:i[p%i.length],x=a==null?void 0:a[p%a.length],y=a==null?void 0:a[p%a.length];return{label:h.charAt(0).toUpperCase()+h.slice(1),data:t.map(C=>C[h]),...v,datalabels:{...v==null?void 0:v.datalabels,color:UQ((S=v==null?void 0:v.datalabels)==null?void 0:S.align,b)},backgroundColor:b,pointBackgroundColor:x,borderColor:y}})}function UQ(e,t){return qu(e==="end"||e==="start"?oh():t)}function qQ(e){var s,l,c,u;const{metricKeys:t,dimensionKeys:n}=tr(e);let r=[];const o=we.getState().themeStyle,i=(l=(s=o==null?void 0:o.chart)==null?void 0:s.dataset)==null?void 0:l.backgroundColor,a=(u=(c=o==null?void 0:o.chart)==null?void 0:c.dataset)==null?void 0:u.borderColor;if((n==null?void 0:n.length)===1){const d=e.map(h=>({x:h[t[0]],y:h[t[1]],r:h[t[2]],label:h[n==null?void 0:n[0]]}));r=[{label:n==null?void 0:n[0],data:d}]}return(n==null?void 0:n.length)>1&&(r=[...new Set(e.map(h=>h[n==null?void 0:n[1]]))].map((h,p)=>{const v=e.filter(b=>b[n==null?void 0:n[1]]===h);return{label:h,data:v.map(b=>({x:b[t[0]],y:b[t[1]],r:b[t[2]],label:b[n==null?void 0:n[0]]})),backgroundColor:i==null?void 0:i[p%i.length],borderColor:a==null?void 0:a[p%a.length]}})),r}function GQ(e){var c,u,d,h;const{dimensionKeys:t,metricKeys:n}=tr(e),r=we.getState().themeStyle,o=(u=(c=r==null?void 0:r.chart)==null?void 0:c.dataset)==null?void 0:u.backgroundColor,i=(h=(d=r==null?void 0:r.chart)==null?void 0:d.dataset)==null?void 0:h.borderColor,a=t==null?void 0:t[1];return[...new Set(e.map(p=>p==null?void 0:p[a]))].map((p,v)=>({label:p,data:e.filter(b=>(b==null?void 0:b[a])===p).map(b=>[b==null?void 0:b[n[0]],b==null?void 0:b[n[1]],b==null?void 0:b[n[2]]]),backgroundColor:o==null?void 0:o[v%o.length],borderColor:i==null?void 0:i[v%i.length],borderSkipped:!1}))}function YQ(e,t){var a,s,l,c;const n=we.getState().themeStyle,r=(s=(a=n==null?void 0:n.chart)==null?void 0:a.dataset)==null?void 0:s.backgroundColor,o=(c=(l=n==null?void 0:n.chart)==null?void 0:l.dataset)==null?void 0:c.borderColor;return e.map(u=>({label:u.charAt(0).toUpperCase()+u.slice(1),data:t.map(d=>d[u]),backgroundColor:t.map((d,h)=>(d==null?void 0:d._color)||(r==null?void 0:r[h%r.length])),borderColor:t.map((d,h)=>(d==null?void 0:d._color)||(o==null?void 0:o[h%o.length]))}))}function KQ(e){let t=-1,n=0;return e.forEach((r,o)=>{const i=Object.keys(r).length;i>n&&(t=o,n=i)}),t}function tr(e){if(!e||e.length===0)return{keys:[],dimensionKeys:[],metricKeys:[]};const t=KQ(e),n=Object.keys(e[t]),r=n.filter(i=>{var a,s,l,c,u,d,h,p;return!!(typeof((a=e==null?void 0:e[t])==null?void 0:a[i])&&typeof((s=e==null?void 0:e[t])==null?void 0:s[i])=="string"||typeof((l=e==null?void 0:e[0])==null?void 0:l[i])&&typeof((c=e==null?void 0:e[0])==null?void 0:c[i])=="string"||typeof((u=e==null?void 0:e[1])==null?void 0:u[i])&&typeof((d=e==null?void 0:e[1])==null?void 0:d[i])=="string"||typeof((h=e==null?void 0:e[2])==null?void 0:h[i])&&typeof((p=e==null?void 0:e[2])==null?void 0:p[i])=="string")});r.length===0&&r.push(n[0]);const o=n.filter(i=>{var a,s;return((a=e==null?void 0:e[t])==null?void 0:a[i])===+((s=e==null?void 0:e[t])==null?void 0:s[i])});return{keys:n,dimensionKeys:r,metricKeys:o}}function Cf(e,t){var r;const n=(r=t==null?void 0:t.data)==null?void 0:r.datasets;return n&&n.length>0?e.map((i,a)=>({...i,...n[a],data:i.data,label:i.label})):e}function XQ(e,t="asc"){function n(r){return Object.entries(r).slice(1).reduce((a,[s,l])=>{const c=typeof l=="number"?l:parseFloat(l);return a+(isNaN(c)?0:c)},0)}return e.sort((r,o)=>{const i=n(r),a=n(o);return t==="asc"?i-a:a-i})}function b0({dataArray:e,groupKey:t,pivotKey:n,valueKey:r,sortChart:o}){const i=e.reduce((s,l)=>{const c=l[t],u=l[n],d=l[r];return s[c]||(s[c]={[t]:c}),s[c][u]=d,s},{});let a=Object.values(i);return o!=="none"&&o!==void 0&&(a=XQ(a,o)),a}function qo(e,t){var a;const n=we.getState().themeStyle,r=(a=n==null?void 0:n.chart)==null?void 0:a.options,o=Vl.cloneDeep(r);return Vl.merge(o,e,t)}function jw(e,t){return e.map(n=>n[t]?n[t]:"BLANK")}/**
110
110
  * @license lucide-react v0.453.0 - ISC
111
111
  *
112
112
  * This source code is licensed under the ISC license.
@@ -232,7 +232,7 @@ Valid keys: `+JSON.stringify(Object.keys(O),null," "));var Z=xe(he,le,te,ce,de+
232
232
  * This source code is licensed under the ISC license.
233
233
  * See the LICENSE file in the root directory of this source tree.
234
234
  */const md=jn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ZQ=({data:e,filename:t="output.csv"})=>{const n=()=>{if(e.length===0)return;const r=[],o=Object.keys(e[0]);r.push(o.join(","));for(const c of e){const u=o.map(d=>`"${(""+c[d]).replace(/"/g,'""')}"`);r.push(u.join(","))}const i=r.join(`
235
- `),a=new Blob([i],{type:"text/csv"}),s=window.URL.createObjectURL(a),l=document.createElement("a");l.setAttribute("hidden",""),l.setAttribute("href",s),l.setAttribute("download",t),document.body.appendChild(l),l.click(),document.body.removeChild(l)};return R.jsx(x6,{onClick:n,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})};function O6({frame:e}){var S;const t=we(C=>C.isDashboardEditing),n=we(C=>C.filterValues),r=we(C=>C.isVisualEditing),o=we(C=>C.selectedSheetId);we(C=>C.currentBreakpoint);const{removeFrame:i}=we(C=>C.actions),a=we(C=>C.actions.setIsVisualEditing),s=Ir(C=>C.actions.setFilterValues),l=Ir(C=>C.actions.setApplyFilters),{setCard:c,setFrame:u,setQueryResultColumns:d}=Ir(C=>C.actions),h=Ir(C=>C.actions.setSelectedConnectionId),p=Ir(C=>C.actions.setSelectedDatamodelId),v=Ir(C=>C.actions.setSelectedDatabaseName),b=Ir(C=>C.actions.setSelectedSchemaName),x=Ir(C=>C.actions.setSelectedTableName),y=e.cards.find(C=>C.id===e.activeCardId);function _(){a(!r),c(y);const{dimensionKeys:C}=tr((y==null?void 0:y.data)||[]);d(C),u(e),y!=null&&y.connectionId&&h(y==null?void 0:y.connectionId),y!=null&&y.datamodelId&&y.datamodelId!=="none"&&(p(y==null?void 0:y.datamodelId),v("")),y!=null&&y.lastSelectedDatabase&&y.lastSelectedDatabase!=="none"&&(v(y==null?void 0:y.lastSelectedDatabase),p("")),y!=null&&y.lastSelectedSchema&&b(y==null?void 0:y.lastSelectedSchema),y!=null&&y.lastSelectedTable&&x(y==null?void 0:y.lastSelectedTable),n&&(s(n),l(!0))}return R.jsx("section",{className:"absolute right-2 top-2 z-10",children:R.jsxs("div",{className:"flex items-center gap-2",children:[t&&(r?R.jsx(RQ,{onClick:()=>{a(!r)},className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"}):R.jsx($Q,{role:"edit-visual",onClick:_,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})),t&&R.jsx(f6,{onClick:()=>i(o,e.id),className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"}),((S=y.preferences)==null?void 0:S.allowDownload)===!0&&R.jsx(ZQ,{data:(y==null?void 0:y.data)||[],filename:y.title})]})})}function eJ(e,t){we(a=>a.selectedSheetId);const n=we(a=>a.selectedFrameId),r=we(a=>a.isDashboardEditing),o=we(a=>a.isVisualEditing);we(a=>a.actions),m.useEffect(()=>{n===e.id&&r&&!o&&i()},[n,e.id,r,o]);function i(){const a=t==null?void 0:t.current;a==null||a.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}const tJ=m.createContext(null),b1={didCatch:!1,error:null};class zb extends m.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=b1}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:i,reason:"imperative-api"}),this.setState(b1)}}componentDidCatch(t,n){var r,o;(r=(o=this.props).onError)===null||r===void 0||r.call(o,t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:o}=this.props;if(r&&n.error!==null&&nJ(t.resetKeys,o)){var i,a;(i=(a=this.props).onReset)===null||i===void 0||i.call(a,{next:o,prev:t.resetKeys,reason:"keys"}),this.setState(b1)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:i,error:a}=this.state;let s=t;if(i){const l={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")s=n(l);else if(r)s=m.createElement(r,l);else if(o!==void 0)s=o;else throw a}return m.createElement(tJ.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},s)}}function nJ(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}function yC({error:e}){return R.jsx("div",{className:"flex flex-col items-center justify-center",role:"alert",style:{height:"100%"},children:R.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md bg-muted p-10",children:[R.jsx("p",{className:"text-lg font-semibold",children:"Oops! Looks like we tripped on a loose wire!"}),R.jsx("p",{className:"text-sm",children:"Something went wrong:"}),R.jsx("pre",{className:"text-xs",children:e.message})]})})}function rJ({error:e,frame:t}){return R.jsxs("div",{className:"flex h-full flex-col items-center justify-center border",role:"alert",children:[R.jsx(O6,{frame:t}),R.jsx("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10"}),R.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10",children:[R.jsx("p",{className:"text-lg font-semibold",children:"Oops! Looks like we tripped on a loose wire!"}),R.jsx("p",{className:"text-sm",children:"Something went wrong:"}),R.jsx("pre",{className:"text-xs",children:e.message})]})]})}function oJ({error:e}){return R.jsxs("div",{className:"flex h-full flex-col items-center justify-center",role:"alert",children:[R.jsx("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10"}),R.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10",children:[R.jsx("p",{className:"text-lg font-semibold",children:"Oops! Something went wrong!"}),R.jsx("p",{className:"text-sm",children:"Something went wrong:"}),R.jsx("pre",{className:"text-xs",children:e.message})]})]})}var Yu=1e3,Ku=Yu*60,Xu=Ku*60,ic=Xu*24,iJ=ic*7,aJ=ic*365.25,sJ=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return lJ(e);if(n==="number"&&isFinite(e))return t.long?uJ(e):cJ(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function lJ(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*aJ;case"weeks":case"week":case"w":return n*iJ;case"days":case"day":case"d":return n*ic;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Xu;case"minutes":case"minute":case"mins":case"min":case"m":return n*Ku;case"seconds":case"second":case"secs":case"sec":case"s":return n*Yu;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function cJ(e){var t=Math.abs(e);return t>=ic?Math.round(e/ic)+"d":t>=Xu?Math.round(e/Xu)+"h":t>=Ku?Math.round(e/Ku)+"m":t>=Yu?Math.round(e/Yu)+"s":e+"ms"}function uJ(e){var t=Math.abs(e);return t>=ic?Ng(e,t,ic,"day"):t>=Xu?Ng(e,t,Xu,"hour"):t>=Ku?Ng(e,t,Ku,"minute"):t>=Yu?Ng(e,t,Yu,"second"):e+" ms"}function Ng(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}const dJ=mc(sJ);function fJ(e){const t=we(u=>u.selectedSheetId),n=we(u=>u.selectedLensId),r=we(u=>u.dashboard.baseQueries),o=we(u=>u.dashboard.filters),i=we(u=>u.filterValues),a=o==null?void 0:o.filter(u=>u.sheetId===t||!u.sheetId),s=i==null?void 0:i.filter(u=>(a==null?void 0:a.some(d=>d.id===u.filterId))||u.filterId.endsWith(t)),l=Eq(e.sql,r);return{queryKey:["query",e.id,l,n||"",JSON.stringify(s)],sql:l,sheetFilterValues:s}}function Bb(e,t){const{authToken:n}=_i(),r=we(d=>d.isVisualEditing),o=we(d=>d.authToken),i=dJ((e==null?void 0:e.refreshInterval)||"0"),{queryKey:a,sql:s,sheetFilterValues:l}=fJ(e);return{...ap({queryKey:a,queryFn:()=>fb("https://semaphor.cloud/api/v1/query",(n==null?void 0:n.accessToken)||(o==null?void 0:o.accessToken)||"",{connection_id:e.connectionId,sql:s,python:e.python===VM?"":e.python,active_filters:l,cache_config:AS()}),refetchInterval:i,placeholderData:pG,enabled:!!e.connectionId&&!!e.sql&&!t&&!r}),queryKey:a}}function Na({number:e,decimalPlaces:t=0,useSuffix:n=!1,customSuffix:r="",currency:o="",locale:i="en-US"}){let a=1,s=r,l=i;const c=t;n&&!r&&(e>=1e9?(a=1e9,s="B"):e>=1e7&&i==="en-IN"?(a=1e7,s="Cr"):e>=1e5&&i==="en-IN"?(a=1e5,s="L"):e>=1e6?(a=1e6,s="M"):e>=1e3&&(a=1e3,s="K"));const u=e/a,d={maximumFractionDigits:c,minimumFractionDigits:c};if(o){d.style="currency",d.currency=o;try{new Intl.NumberFormat(i,d).format(0)}catch{d.currency="USD"}}try{new Intl.NumberFormat(i,d).format(0)}catch{l="en-US"}let p=new Intl.NumberFormat(l,d).format(u);return n&&(p+=s),p}function xC(e,t){if(!t)return"";const n=t.find(r=>e>=r.start&&e<=r.end);return(n==null?void 0:n.color)||""}function T6(e){try{const n=new Function("getDatalabelColor",e)(lw);return{options:n==null?void 0:n.options,plugins:(n==null?void 0:n.plugins)||[]}}catch(t){return console.error("Error processing custom visual code",t),{options:{},plugins:[]}}}function D6(e){const t=getComputedStyle(document.documentElement).getPropertyValue(e);return hJ(t)}function hJ(e){const[t,n,r]=e.split(" "),o=parseFloat(t),i=parseFloat(n),a=parseFloat(r),s=i/100,l=a/100,c=(1-Math.abs(2*l-1))*s,u=c*(1-Math.abs(o/60%2-1)),d=l-c/2;let h=0,p=0,v=0;0<=o&&o<60?(h=c,p=u,v=0):60<=o&&o<120?(h=u,p=c,v=0):120<=o&&o<180?(h=0,p=c,v=u):180<=o&&o<240?(h=0,p=u,v=c):240<=o&&o<300?(h=u,p=0,v=c):300<=o&&o<360&&(h=c,p=0,v=u),h=Math.round((h+d)*255),p=Math.round((p+d)*255),v=Math.round((v+d)*255);const b=x=>{const y=x.toString(16);return y.length==1?"0"+y:y};return`#${b(h)}${b(p)}${b(v)}`}function fl({data:e,cfg:t,customCfg:n,preferences:r}){we.getState().themeStyle;const{dimensionKeys:o,metricKeys:i}=tr(e),a=WQ(i,e,r),s=Cf(a,n),l=o[0],c=jw(e,l);wC(r,t),A6(r);const{options:u,plugins:d}=k6({cfg:t,preferences:r,customCfg:n});return{type:(n==null?void 0:n.type)||(t==null?void 0:t.type)||"bar",data:{labels:c,datasets:s},options:u,plugins:d}}function wC(e,t){var o,i,a;const n=((o=t==null?void 0:t.options)==null?void 0:o.indexAxis)==="y"?"x":"y";return(i=e==null?void 0:e.chartOptions)!=null&&i.indexAxis?((a=e==null?void 0:e.chartOptions)==null?void 0:a.indexAxis)==="x"?"y":"x":n}function A6(e){var n,r;return(n=e==null?void 0:e.chartOptions)!=null&&n.indexAxis?((r=e==null?void 0:e.chartOptions)==null?void 0:r.indexAxis)==="x"?"x":"y":"x"}function M6(e,t){var i,a,s,l,c,u,d,h,p,v,b,x;const n=wC(t,e),r=A6(t);return{...e==null?void 0:e.options,scales:{...(i=e==null?void 0:e.options)==null?void 0:i.scales,[n]:{...(s=(a=e==null?void 0:e.options)==null?void 0:a.scales)==null?void 0:s[n],ticks:{...(u=(c=(l=e==null?void 0:e.options)==null?void 0:l.scales)==null?void 0:c[n])==null?void 0:u.ticks,callback:y=>{var _,S,C,E;return Na({number:Number(y),decimalPlaces:((_=t==null?void 0:t.numberAxisFormat)==null?void 0:_.decimalPlaces)||0,useSuffix:!!((S=t==null?void 0:t.numberAxisFormat)!=null&&S.suffix),customSuffix:"",locale:((C=t==null?void 0:t.numberAxisFormat)==null?void 0:C.locale)||"",currency:((E=t==null?void 0:t.numberAxisFormat)==null?void 0:E.currency)||""})}}},[r]:{...(p=(h=(d=e==null?void 0:e.options)==null?void 0:d.scales)==null?void 0:h[r])==null?void 0:p.ticks,callback:null}},plugins:{...(v=e==null?void 0:e.options)==null?void 0:v.plugins,datalabels:{...(x=(b=e==null?void 0:e.options)==null?void 0:b.plugins)==null?void 0:x.datalabels,formatter:function(y){var _,S,C,E;return Na({number:Number(y),decimalPlaces:((_=t==null?void 0:t.numberAxisFormat)==null?void 0:_.decimalPlaces)||0,useSuffix:!!((S=t==null?void 0:t.numberAxisFormat)!=null&&S.suffix),customSuffix:"",locale:((C=t==null?void 0:t.numberAxisFormat)==null?void 0:C.locale)||"",currency:((E=t==null?void 0:t.numberAxisFormat)==null?void 0:E.currency)||""})}}}}}function k6({cfg:e,preferences:t,customCfg:n}){var h,p,v,b,x,y,_,S,C,E,$,T,D,M,L,F,z,X,G,A,U,V,K,q,O,H,Y,I,te;const r=we.getState().themeStyle,o=M6(e,t),i=qo((e==null?void 0:e.options)||{},t==null?void 0:t.chartOptions),a=qo(o,i),s=qo(a,(n==null?void 0:n.options)||{}),l={...s,scales:{...s==null?void 0:s.scales,x:{...(h=s==null?void 0:s.scales)==null?void 0:h.x,grid:{...(v=(p=s==null?void 0:s.scales)==null?void 0:p.x)==null?void 0:v.grid,color:(S=(_=(y=(x=(b=r==null?void 0:r.chart)==null?void 0:b.options)==null?void 0:x.scales)==null?void 0:y.x)==null?void 0:_.grid)==null?void 0:S.color}},y:{...(C=s==null?void 0:s.scales)==null?void 0:C.y,grid:{...($=(E=s==null?void 0:s.scales)==null?void 0:E.y)==null?void 0:$.grid,color:(F=(L=(M=(D=(T=r==null?void 0:r.chart)==null?void 0:T.options)==null?void 0:D.scales)==null?void 0:M.y)==null?void 0:L.grid)==null?void 0:F.color}}},plugins:{...s==null?void 0:s.plugins,tooltip:{...(z=s==null?void 0:s.plugins)==null?void 0:z.tooltip,backgroundColor:(U=(A=(G=(X=r==null?void 0:r.chart)==null?void 0:X.options)==null?void 0:G.plugins)==null?void 0:A.tooltip)==null?void 0:U.backgroundColor,bodyColor:(O=(q=(K=(V=r==null?void 0:r.chart)==null?void 0:V.options)==null?void 0:K.plugins)==null?void 0:q.tooltip)==null?void 0:O.bodyColor,titleColor:(te=(I=(Y=(H=r==null?void 0:r.chart)==null?void 0:H.options)==null?void 0:Y.plugins)==null?void 0:I.tooltip)==null?void 0:te.titleColor}}},{plugins:c,options:u}=T6((t==null?void 0:t.customVisualCode)||"");return{options:qo(l,u),plugins:c}}/*!
235
+ `),a=new Blob([i],{type:"text/csv"}),s=window.URL.createObjectURL(a),l=document.createElement("a");l.setAttribute("hidden",""),l.setAttribute("href",s),l.setAttribute("download",t),document.body.appendChild(l),l.click(),document.body.removeChild(l)};return R.jsx(x6,{onClick:n,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})};function O6({frame:e}){var S;const t=we(C=>C.isDashboardEditing),n=we(C=>C.filterValues),r=we(C=>C.isVisualEditing),o=we(C=>C.selectedSheetId);we(C=>C.currentBreakpoint);const{removeFrame:i}=we(C=>C.actions),a=we(C=>C.actions.setIsVisualEditing),s=Ir(C=>C.actions.setFilterValues),l=Ir(C=>C.actions.setApplyFilters),{setCard:c,setFrame:u,setQueryResultColumns:d}=Ir(C=>C.actions),h=Ir(C=>C.actions.setSelectedConnectionId),p=Ir(C=>C.actions.setSelectedDatamodelId),v=Ir(C=>C.actions.setSelectedDatabaseName),b=Ir(C=>C.actions.setSelectedSchemaName),x=Ir(C=>C.actions.setSelectedTableName),y=e.cards.find(C=>C.id===e.activeCardId);function _(){a(!r),c(y);const{dimensionKeys:C}=tr((y==null?void 0:y.data)||[]);d(C),u(e),y!=null&&y.connectionId&&h(y==null?void 0:y.connectionId),y!=null&&y.datamodelId&&y.datamodelId!=="none"&&(p(y==null?void 0:y.datamodelId),v("")),y!=null&&y.lastSelectedDatabase&&y.lastSelectedDatabase!=="none"&&(v(y==null?void 0:y.lastSelectedDatabase),p("")),y!=null&&y.lastSelectedSchema&&b(y==null?void 0:y.lastSelectedSchema),y!=null&&y.lastSelectedTable&&x(y==null?void 0:y.lastSelectedTable),n&&(s(n),l(!0))}return R.jsx("section",{className:"absolute right-2 top-2 z-10",children:R.jsxs("div",{className:"flex items-center gap-2",children:[t&&(r?R.jsx(RQ,{onClick:()=>{a(!r)},className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"}):R.jsx($Q,{role:"edit-visual",onClick:_,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})),t&&R.jsx(f6,{onClick:()=>i(o,e.id),className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"}),((S=y.preferences)==null?void 0:S.allowDownload)===!0&&R.jsx(ZQ,{data:(y==null?void 0:y.data)||[],filename:y.title})]})})}function eJ(e,t){we(a=>a.selectedSheetId);const n=we(a=>a.selectedFrameId),r=we(a=>a.isDashboardEditing),o=we(a=>a.isVisualEditing);we(a=>a.actions),m.useEffect(()=>{n===e.id&&r&&!o&&i()},[n,e.id,r,o]);function i(){const a=t==null?void 0:t.current;a==null||a.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}const tJ=m.createContext(null),b1={didCatch:!1,error:null};class zb extends m.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=b1}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:i,reason:"imperative-api"}),this.setState(b1)}}componentDidCatch(t,n){var r,o;(r=(o=this.props).onError)===null||r===void 0||r.call(o,t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:o}=this.props;if(r&&n.error!==null&&nJ(t.resetKeys,o)){var i,a;(i=(a=this.props).onReset)===null||i===void 0||i.call(a,{next:o,prev:t.resetKeys,reason:"keys"}),this.setState(b1)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:i,error:a}=this.state;let s=t;if(i){const l={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")s=n(l);else if(r)s=m.createElement(r,l);else if(o!==void 0)s=o;else throw a}return m.createElement(tJ.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},s)}}function nJ(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}function yC({error:e}){return R.jsx("div",{className:"flex flex-col items-center justify-center",role:"alert",style:{height:"100%"},children:R.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md bg-muted p-10",children:[R.jsx("p",{className:"text-lg font-semibold",children:"Oops! Looks like we tripped on a loose wire!"}),R.jsx("p",{className:"text-sm",children:"Something went wrong:"}),R.jsx("pre",{className:"text-xs",children:e.message})]})})}function rJ({error:e,frame:t}){return R.jsxs("div",{className:"flex h-full flex-col items-center justify-center border",role:"alert",children:[R.jsx(O6,{frame:t}),R.jsx("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10"}),R.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10",children:[R.jsx("p",{className:"text-lg font-semibold",children:"Oops! Looks like we tripped on a loose wire!"}),R.jsx("p",{className:"text-sm",children:"Something went wrong:"}),R.jsx("pre",{className:"text-xs",children:e.message})]})]})}function oJ({error:e}){return R.jsxs("div",{className:"flex h-full flex-col items-center justify-center",role:"alert",children:[R.jsx("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10"}),R.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10",children:[R.jsx("p",{className:"text-lg font-semibold",children:"Oops! Something went wrong!"}),R.jsx("p",{className:"text-sm",children:"Something went wrong:"}),R.jsx("pre",{className:"text-xs",children:e.message})]})]})}var Yu=1e3,Ku=Yu*60,Xu=Ku*60,ic=Xu*24,iJ=ic*7,aJ=ic*365.25,sJ=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return lJ(e);if(n==="number"&&isFinite(e))return t.long?uJ(e):cJ(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function lJ(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*aJ;case"weeks":case"week":case"w":return n*iJ;case"days":case"day":case"d":return n*ic;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Xu;case"minutes":case"minute":case"mins":case"min":case"m":return n*Ku;case"seconds":case"second":case"secs":case"sec":case"s":return n*Yu;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function cJ(e){var t=Math.abs(e);return t>=ic?Math.round(e/ic)+"d":t>=Xu?Math.round(e/Xu)+"h":t>=Ku?Math.round(e/Ku)+"m":t>=Yu?Math.round(e/Yu)+"s":e+"ms"}function uJ(e){var t=Math.abs(e);return t>=ic?Ng(e,t,ic,"day"):t>=Xu?Ng(e,t,Xu,"hour"):t>=Ku?Ng(e,t,Ku,"minute"):t>=Yu?Ng(e,t,Yu,"second"):e+" ms"}function Ng(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}const dJ=mc(sJ);function fJ(e){const t=we(u=>u.selectedSheetId),n=we(u=>u.selectedLensId),r=we(u=>u.dashboard.baseQueries),o=we(u=>u.dashboard.filters),i=we(u=>u.filterValues),a=o==null?void 0:o.filter(u=>u.sheetId===t||!u.sheetId),s=i==null?void 0:i.filter(u=>(a==null?void 0:a.some(d=>d.id===u.filterId))||u.filterId.endsWith(t)),l=Eq(e.sql,r);return{queryKey:["query",e.id,l,n||"",JSON.stringify(s)],sql:l,sheetFilterValues:s}}function Bb(e,t){const{authToken:n}=_i(),r=we(d=>d.isVisualEditing),o=we(d=>d.authToken),i=dJ((e==null?void 0:e.refreshInterval)||"0"),{queryKey:a,sql:s,sheetFilterValues:l}=fJ(e);return{...ap({queryKey:a,queryFn:()=>fb("https://semaphor.cloud/api/v1/query",(n==null?void 0:n.accessToken)||(o==null?void 0:o.accessToken)||"",{connection_id:e.connectionId,sql:s,python:e.python===VM?"":e.python,active_filters:l,cache_config:AS()}),refetchInterval:i,placeholderData:pG,enabled:!!e.connectionId&&!!e.sql&&!t&&!r}),queryKey:a}}function Na({number:e,decimalPlaces:t=0,useSuffix:n=!1,customSuffix:r="",currency:o="",locale:i="en-US"}){let a=1,s=r,l=i;const c=t;n&&!r&&(e>=1e9?(a=1e9,s="B"):e>=1e7&&i==="en-IN"?(a=1e7,s="Cr"):e>=1e5&&i==="en-IN"?(a=1e5,s="L"):e>=1e6?(a=1e6,s="M"):e>=1e3&&(a=1e3,s="K"));const u=e/a,d={maximumFractionDigits:c,minimumFractionDigits:c};if(o){d.style="currency",d.currency=o;try{new Intl.NumberFormat(i,d).format(0)}catch{}}try{new Intl.NumberFormat(i,d).format(0)}catch{l="en-US"}let p=new Intl.NumberFormat(l,d).format(u);return n&&(p+=s),p}function xC(e,t){if(!t)return"";const n=t.find(r=>e>=r.start&&e<=r.end);return(n==null?void 0:n.color)||""}function T6(e){try{const n=new Function("getDatalabelColor",e)(lw);return{options:n==null?void 0:n.options,plugins:(n==null?void 0:n.plugins)||[]}}catch(t){return console.error("Error processing custom visual code",t),{options:{},plugins:[]}}}function D6(e){const t=getComputedStyle(document.documentElement).getPropertyValue(e);return hJ(t)}function hJ(e){const[t,n,r]=e.split(" "),o=parseFloat(t),i=parseFloat(n),a=parseFloat(r),s=i/100,l=a/100,c=(1-Math.abs(2*l-1))*s,u=c*(1-Math.abs(o/60%2-1)),d=l-c/2;let h=0,p=0,v=0;0<=o&&o<60?(h=c,p=u,v=0):60<=o&&o<120?(h=u,p=c,v=0):120<=o&&o<180?(h=0,p=c,v=u):180<=o&&o<240?(h=0,p=u,v=c):240<=o&&o<300?(h=u,p=0,v=c):300<=o&&o<360&&(h=c,p=0,v=u),h=Math.round((h+d)*255),p=Math.round((p+d)*255),v=Math.round((v+d)*255);const b=x=>{const y=x.toString(16);return y.length==1?"0"+y:y};return`#${b(h)}${b(p)}${b(v)}`}function fl({data:e,cfg:t,customCfg:n,preferences:r}){we.getState().themeStyle;const{dimensionKeys:o,metricKeys:i}=tr(e),a=WQ(i,e,r),s=Cf(a,n),l=o[0],c=jw(e,l);wC(r,t),A6(r);const{options:u,plugins:d}=k6({cfg:t,preferences:r,customCfg:n});return{type:(n==null?void 0:n.type)||(t==null?void 0:t.type)||"bar",data:{labels:c,datasets:s},options:u,plugins:d}}function wC(e,t){var o,i,a;const n=((o=t==null?void 0:t.options)==null?void 0:o.indexAxis)==="y"?"x":"y";return(i=e==null?void 0:e.chartOptions)!=null&&i.indexAxis?((a=e==null?void 0:e.chartOptions)==null?void 0:a.indexAxis)==="x"?"y":"x":n}function A6(e){var n,r;return(n=e==null?void 0:e.chartOptions)!=null&&n.indexAxis?((r=e==null?void 0:e.chartOptions)==null?void 0:r.indexAxis)==="x"?"x":"y":"x"}function M6(e,t){var i,a,s,l,c,u,d,h,p,v,b,x;const n=wC(t,e),r=A6(t);return{...e==null?void 0:e.options,scales:{...(i=e==null?void 0:e.options)==null?void 0:i.scales,[n]:{...(s=(a=e==null?void 0:e.options)==null?void 0:a.scales)==null?void 0:s[n],ticks:{...(u=(c=(l=e==null?void 0:e.options)==null?void 0:l.scales)==null?void 0:c[n])==null?void 0:u.ticks,callback:y=>{var _,S,C,E;return Na({number:Number(y),decimalPlaces:((_=t==null?void 0:t.numberAxisFormat)==null?void 0:_.decimalPlaces)||0,useSuffix:!!((S=t==null?void 0:t.numberAxisFormat)!=null&&S.suffix),customSuffix:"",locale:((C=t==null?void 0:t.numberAxisFormat)==null?void 0:C.locale)||"",currency:((E=t==null?void 0:t.numberAxisFormat)==null?void 0:E.currency)||""})}}},[r]:{...(p=(h=(d=e==null?void 0:e.options)==null?void 0:d.scales)==null?void 0:h[r])==null?void 0:p.ticks,callback:null}},plugins:{...(v=e==null?void 0:e.options)==null?void 0:v.plugins,datalabels:{...(x=(b=e==null?void 0:e.options)==null?void 0:b.plugins)==null?void 0:x.datalabels,formatter:function(y){var _,S,C,E;return Na({number:Number(y),decimalPlaces:((_=t==null?void 0:t.numberAxisFormat)==null?void 0:_.decimalPlaces)||0,useSuffix:!!((S=t==null?void 0:t.numberAxisFormat)!=null&&S.suffix),customSuffix:"",locale:((C=t==null?void 0:t.numberAxisFormat)==null?void 0:C.locale)||"",currency:((E=t==null?void 0:t.numberAxisFormat)==null?void 0:E.currency)||""})}}}}}function k6({cfg:e,preferences:t,customCfg:n}){var h,p,v,b,x,y,_,S,C,E,$,T,D,M,L,F,z,X,G,A,U,V,K,q,O,H,Y,I,te;const r=we.getState().themeStyle,o=M6(e,t),i=qo((e==null?void 0:e.options)||{},t==null?void 0:t.chartOptions),a=qo(o,i),s=qo(a,(n==null?void 0:n.options)||{}),l={...s,scales:{...s==null?void 0:s.scales,x:{...(h=s==null?void 0:s.scales)==null?void 0:h.x,grid:{...(v=(p=s==null?void 0:s.scales)==null?void 0:p.x)==null?void 0:v.grid,color:(S=(_=(y=(x=(b=r==null?void 0:r.chart)==null?void 0:b.options)==null?void 0:x.scales)==null?void 0:y.x)==null?void 0:_.grid)==null?void 0:S.color}},y:{...(C=s==null?void 0:s.scales)==null?void 0:C.y,grid:{...($=(E=s==null?void 0:s.scales)==null?void 0:E.y)==null?void 0:$.grid,color:(F=(L=(M=(D=(T=r==null?void 0:r.chart)==null?void 0:T.options)==null?void 0:D.scales)==null?void 0:M.y)==null?void 0:L.grid)==null?void 0:F.color}}},plugins:{...s==null?void 0:s.plugins,tooltip:{...(z=s==null?void 0:s.plugins)==null?void 0:z.tooltip,backgroundColor:(U=(A=(G=(X=r==null?void 0:r.chart)==null?void 0:X.options)==null?void 0:G.plugins)==null?void 0:A.tooltip)==null?void 0:U.backgroundColor,bodyColor:(O=(q=(K=(V=r==null?void 0:r.chart)==null?void 0:V.options)==null?void 0:K.plugins)==null?void 0:q.tooltip)==null?void 0:O.bodyColor,titleColor:(te=(I=(Y=(H=r==null?void 0:r.chart)==null?void 0:H.options)==null?void 0:Y.plugins)==null?void 0:I.tooltip)==null?void 0:te.titleColor}}},{plugins:c,options:u}=T6((t==null?void 0:t.customVisualCode)||"");return{options:qo(l,u),plugins:c}}/*!
236
236
  * @kurkle/color v0.3.2
237
237
  * https://github.com/kurkle/color#readme
238
238
  * (c) 2023 Jukka Kurkela
@@ -249,7 +249,7 @@ Valid keys: `+JSON.stringify(Object.keys(O),null," "));var Z=xe(he,le,te,ce,de+
249
249
  * Released under the MIT License
250
250
  */class ZZ{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,o){const i=n.listeners[o],a=n.duration;i.forEach(s=>s({chart:t,initial:n.initial,numSteps:a,currentStep:Math.min(r-n.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=U6.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,o)=>{if(!r.running||!r.items.length)return;const i=r.items;let a=i.length-1,s=!1,l;for(;a>=0;--a)l=i[a],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),s=!0):(i[a]=i[i.length-1],i.pop());s&&(o.draw(),this._notify(o,r,t,"progress")),i.length||(r.running=!1,this._notify(o,r,t,"complete"),r.initial=!1),n+=i.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,o)=>Math.max(r,o._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let o=r.length-1;for(;o>=0;--o)r[o].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var _a=new ZZ;const N$="transparent",eee={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=R$(e||N$),o=r.valid&&R$(t||N$);return o&&o.valid?o.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class tee{constructor(t,n,r,o){const i=n[r];o=wn([t.to,o,i,t.from]);const a=wn([t.from,i,o]);this._active=!0,this._fn=t.fn||eee[t.type||typeof a],this._easing=zf[t.easing]||zf.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=a,this._to=o,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const o=this._target[this._prop],i=r-this._start,a=this._duration-i;this._start=r,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=i,this._loop=!!t.loop,this._to=wn([t.to,n,o,t.from]),this._from=wn([t.from,o,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,o=this._prop,i=this._from,a=this._loop,s=this._to;let l;if(this._active=i!==s&&(a||n<r),!this._active){this._target[o]=s,this._notify(!0);return}if(n<0){this._target[o]=i;return}l=n/r%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[o]=this._fn(i,s,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let o=0;o<r.length;o++)r[o][n]()}}class c3{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!kt(t))return;const n=Object.keys(An.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(o=>{const i=t[o];if(!kt(i))return;const a={};for(const s of n)a[s]=i[s];(_n(i.properties)&&i.properties||[o]).forEach(s=>{(s===o||!r.has(s))&&r.set(s,a)})})}_animateOptions(t,n){const r=n.options,o=ree(t,r);if(!o)return[];const i=this._createAnimations(o,r);return r.$shared&&nee(t.options.$animations,r).then(()=>{t.options=r},()=>{}),i}_createAnimations(t,n){const r=this._properties,o=[],i=t.$animations||(t.$animations={}),a=Object.keys(n),s=Date.now();let l;for(l=a.length-1;l>=0;--l){const c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){o.push(...this._animateOptions(t,n));continue}const u=n[c];let d=i[c];const h=r.get(c);if(d)if(h&&d.active()){d.update(h,u,s);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}i[c]=d=new tee(h,t,c,u),o.push(d)}return o}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return _a.add(this._chart,r),!0}}function nee(e,t){const n=[],r=Object.keys(t);for(let o=0;o<r.length;o++){const i=e[r[o]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}function ree(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function L$(e,t){const n=e&&e.options||{},r=n.reverse,o=n.min===void 0?t:0,i=n.max===void 0?t:0;return{start:r?i:o,end:r?o:i}}function oee(e,t,n){if(n===!1)return!1;const r=L$(e,n),o=L$(t,n);return{top:o.end,right:r.end,bottom:o.start,left:r.start}}function iee(e){let t,n,r,o;return kt(e)?(t=e.top,n=e.right,r=e.bottom,o=e.left):t=n=r=o=e,{top:t,right:n,bottom:r,left:o,disabled:e===!1}}function u3(e,t){const n=[],r=e._getSortedDatasetMetas(t);let o,i;for(o=0,i=r.length;o<i;++o)n.push(r[o].index);return n}function F$(e,t,n,r={}){const o=e.keys,i=r.mode==="single";let a,s,l,c;if(t!==null){for(a=0,s=o.length;a<s;++a){if(l=+o[a],l===n){if(r.all)continue;break}c=e.values[l],Ln(c)&&(i||t===0||Wi(t)===Wi(c))&&(t+=c)}return t}}function aee(e){const t=Object.keys(e),n=new Array(t.length);let r,o,i;for(r=0,o=t.length;r<o;++r)i=t[r],n[r]={x:i,y:e[i]};return n}function j$(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function see(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function lee(e){const{min:t,max:n,minDefined:r,maxDefined:o}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:o?n:Number.POSITIVE_INFINITY}}function cee(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function z$(e,t,n,r){for(const o of t.getMatchingVisibleMetas(r).reverse()){const i=e[o.index];if(n&&i>0||!n&&i<0)return o.index}return null}function B$(e,t){const{chart:n,_cachedMeta:r}=e,o=n._stacks||(n._stacks={}),{iScale:i,vScale:a,index:s}=r,l=i.axis,c=a.axis,u=see(i,a,r),d=t.length;let h;for(let p=0;p<d;++p){const v=t[p],{[l]:b,[c]:x}=v,y=v._stacks||(v._stacks={});h=y[c]=cee(o,u,b),h[s]=x,h._top=z$(h,a,!0,r.type),h._bottom=z$(h,a,!1,r.type);const _=h._visualValues||(h._visualValues={});_[s]=x}}function w1(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function uee(e,t){return Xs(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function dee(e,t,n){return Xs(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Jd(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const o of t){const i=o._stacks;if(!i||i[r]===void 0||i[r][n]===void 0)return;delete i[r][n],i[r]._visualValues!==void 0&&i[r]._visualValues[n]!==void 0&&delete i[r]._visualValues[n]}}}const _1=e=>e==="reset"||e==="none",V$=(e,t)=>t?e:Object.assign({},e),fee=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:u3(n,!0),values:null};class Xo{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=j$(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Jd(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),o=(d,h,p,v)=>d==="x"?h:d==="r"?v:p,i=n.xAxisID=st(r.xAxisID,w1(t,"x")),a=n.yAxisID=st(r.yAxisID,w1(t,"y")),s=n.rAxisID=st(r.rAxisID,w1(t,"r")),l=n.indexAxis,c=n.iAxisID=o(l,i,a,s),u=n.vAxisID=o(l,a,i,s);n.xScale=this.getScaleForId(i),n.yScale=this.getScaleForId(a),n.rScale=this.getScaleForId(s),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&S$(this._data,this),t._stacked&&Jd(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(kt(n))this._data=aee(n);else if(r!==n){if(r){S$(r,this);const o=this._cachedMeta;Jd(o),o._parsed=[]}n&&Object.isExtensible(n)&&QJ(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let o=!1;this._dataCheck();const i=n._stacked;n._stacked=j$(n.vScale,n),n.stack!==r.stack&&(o=!0,Jd(n),n.stack=r.stack),this._resyncElements(t),(o||i!==n._stacked)&&B$(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:o}=this,{iScale:i,_stacked:a}=r,s=i.axis;let l=t===0&&n===o.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,h;if(this._parsing===!1)r._parsed=o,r._sorted=!0,h=o;else{_n(o[t])?h=this.parseArrayData(r,o,t,n):kt(o[t])?h=this.parseObjectData(r,o,t,n):h=this.parsePrimitiveData(r,o,t,n);const p=()=>d[s]===null||c&&d[s]<c[s];for(u=0;u<n;++u)r._parsed[u+t]=d=h[u],l&&(p()&&(l=!1),c=d);r._sorted=l}a&&B$(this,h)}parsePrimitiveData(t,n,r,o){const{iScale:i,vScale:a}=t,s=i.axis,l=a.axis,c=i.getLabels(),u=i===a,d=new Array(o);let h,p,v;for(h=0,p=o;h<p;++h)v=h+r,d[h]={[s]:u||i.parse(c[v],v),[l]:a.parse(n[v],v)};return d}parseArrayData(t,n,r,o){const{xScale:i,yScale:a}=t,s=new Array(o);let l,c,u,d;for(l=0,c=o;l<c;++l)u=l+r,d=n[u],s[l]={x:i.parse(d[0],u),y:a.parse(d[1],u)};return s}parseObjectData(t,n,r,o){const{xScale:i,yScale:a}=t,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,c=new Array(o);let u,d,h,p;for(u=0,d=o;u<d;++u)h=u+r,p=n[h],c[u]={x:i.parse(js(p,s),h),y:a.parse(js(p,l),h)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const o=this.chart,i=this._cachedMeta,a=n[t.axis],s={keys:u3(o,!0),values:n._stacks[t.axis]._visualValues};return F$(s,a,i.index,{mode:r})}updateRangeFromParsed(t,n,r,o){const i=r[n.axis];let a=i===null?NaN:i;const s=o&&r._stacks[n.axis];o&&s&&(o.values=s,a=F$(o,i,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,n){const r=this._cachedMeta,o=r._parsed,i=r._sorted&&t===r.iScale,a=o.length,s=this._getOtherScale(t),l=fee(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=lee(s);let h,p;function v(){p=o[h];const b=p[s.axis];return!Ln(p[t.axis])||u>b||d<b}for(h=0;h<a&&!(!v()&&(this.updateRangeFromParsed(c,t,p,l),i));++h);if(i){for(h=a-1;h>=0;--h)if(!v()){this.updateRangeFromParsed(c,t,p,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let o,i,a;for(o=0,i=n.length;o<i;++o)a=n[o][t.axis],Ln(a)&&r.push(a);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,o=n.vScale,i=this.getParsed(t);return{label:r?""+r.getLabelForValue(i[r.axis]):"",value:o?""+o.getLabelForValue(i[o.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=iee(st(this.options.clip,oee(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,o=r.data||[],i=n.chartArea,a=[],s=this._drawStart||0,l=this._drawCount||o.length-s,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,i,s,l),u=s;u<s+l;++u){const d=o[u];d.hidden||(d.active&&c?a.push(d):d.draw(t,i))}for(u=0;u<a.length;++u)a[u].draw(t,i)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const o=this.getDataset();let i;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];i=a.$context||(a.$context=dee(this.getContext(),t,a)),i.parsed=this.getParsed(t),i.raw=o.data[t],i.index=i.dataIndex=t}else i=this.$context||(this.$context=uee(this.chart.getContext(),this.index)),i.dataset=o,i.index=i.datasetIndex=this.index;return i.active=!!n,i.mode=r,i}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const o=n==="active",i=this._cachedDataOpts,a=t+"-"+n,s=i[a],l=this.enableOptionSharing&&sh(r);if(s)return V$(s,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=o?[`${t}Hover`,"hover",t,""]:[t,""],h=c.getOptionScopes(this.getDataset(),u),p=Object.keys(An.elements[t]),v=()=>this.getContext(r,o,n),b=c.resolveNamedOptions(h,p,v,d);return b.$shared&&(b.$shared=l,i[a]=Object.freeze(V$(b,l))),b}_resolveAnimations(t,n,r){const o=this.chart,i=this._cachedDataOpts,a=`animation-${n}`,s=i[a];if(s)return s;let l;if(o.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(t,r,n))}const c=new c3(o,l&&l.animations);return l&&l._cacheable&&(i[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||_1(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),o=this._sharedOptions,i=this.getSharedOptions(r),a=this.includeOptions(n,i)||i!==o;return this.updateSharedOptions(i,n,r),{sharedOptions:i,includeOptions:a}}updateElement(t,n,r,o){_1(o)?Object.assign(t,r):this._resolveAnimations(n,o).update(t,r)}updateSharedOptions(t,n,r){t&&!_1(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,o){t.active=o;const i=this.getStyle(n,o);this._resolveAnimations(n,r,o).update(t,{options:!o&&this.getSharedOptions(i)||i})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[s,l,c]of this._syncList)this[s](l,c);this._syncList=[];const o=r.length,i=n.length,a=Math.min(i,o);a&&this.parse(0,a),i>o?this._insertElements(o,i-o,t):i<o&&this._removeElements(i,o-i)}_insertElements(t,n,r=!0){const o=this._cachedMeta,i=o.data,a=t+n;let s;const l=c=>{for(c.length+=n,s=c.length-1;s>=a;s--)c[s]=c[s-n]};for(l(i),s=t;s<a;++s)i[s]=new this.dataElementType;this._parsing&&l(o._parsed),this.parse(t,n),r&&this.updateElements(i,t,n,"reset")}updateElements(t,n,r,o){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const o=r._parsed.splice(t,n);r._stacked&&Jd(r,o)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,o]=t;this[n](r,o)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}Ne(Xo,"defaults",{}),Ne(Xo,"datasetElementType",null),Ne(Xo,"dataElementType",null);function hee(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let o=0,i=n.length;o<i;o++)r=r.concat(n[o].controller.getAllParsedValues(e));e._cache.$bar=W6(r.sort((o,i)=>o-i))}return e._cache.$bar}function pee(e){const t=e.iScale,n=hee(t,e.type);let r=t._length,o,i,a,s;const l=()=>{a===32767||a===-32768||(sh(s)&&(r=Math.min(r,Math.abs(a-s)||r)),s=a)};for(o=0,i=n.length;o<i;++o)a=t.getPixelForValue(n[o]),l();for(s=void 0,o=0,i=t.ticks.length;o<i;++o)a=t.getPixelForTick(o),l();return r}function gee(e,t,n,r){const o=n.barThickness;let i,a;return Tt(o)?(i=t.min*n.categoryPercentage,a=n.barPercentage):(i=o*r,a=1),{chunk:i/r,ratio:a,start:t.pixels[e]-i/2}}function mee(e,t,n,r){const o=t.pixels,i=o[e];let a=e>0?o[e-1]:null,s=e<o.length-1?o[e+1]:null;const l=n.categoryPercentage;a===null&&(a=i-(s===null?t.end-t.start:s-i)),s===null&&(s=i+i-a);const c=i-(i-Math.min(a,s))/2*l;return{chunk:Math.abs(s-a)/2*l/r,ratio:n.barPercentage,start:c}}function bee(e,t,n,r){const o=n.parse(e[0],r),i=n.parse(e[1],r),a=Math.min(o,i),s=Math.max(o,i);let l=a,c=s;Math.abs(a)>Math.abs(s)&&(l=s,c=a),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:o,end:i,min:a,max:s}}function d3(e,t,n,r){return _n(e)?bee(e,t,n,r):t[n.axis]=n.parse(e,r),t}function H$(e,t,n,r){const o=e.iScale,i=e.vScale,a=o.getLabels(),s=o===i,l=[];let c,u,d,h;for(c=n,u=n+r;c<u;++c)h=t[c],d={},d[o.axis]=s||o.parse(a[c],c),l.push(d3(h,d,i,c));return l}function S1(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function vee(e,t,n){return e!==0?Wi(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function yee(e){let t,n,r,o,i;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(o="end",i="start"):(o="start",i="end"),{start:n,end:r,reverse:t,top:o,bottom:i}}function xee(e,t,n,r){let o=t.borderSkipped;const i={};if(!o){e.borderSkipped=i;return}if(o===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:s,reverse:l,top:c,bottom:u}=yee(e);o==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?o=c:(n._bottom||0)===r?o=u:(i[W$(u,a,s,l)]=!0,o=c)),i[W$(o,a,s,l)]=!0,e.borderSkipped=i}function W$(e,t,n,r){return r?(e=wee(e,t,n),e=U$(e,n,t)):e=U$(e,t,n),e}function wee(e,t,n){return e===t?n:e===n?t:e}function U$(e,t,n){return e==="start"?t:e==="end"?n:e}function _ee(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Um extends Xo{parsePrimitiveData(t,n,r,o){return H$(t,n,r,o)}parseArrayData(t,n,r,o){return H$(t,n,r,o)}parseObjectData(t,n,r,o){const{iScale:i,vScale:a}=t,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,c=i.axis==="x"?s:l,u=a.axis==="x"?s:l,d=[];let h,p,v,b;for(h=r,p=r+o;h<p;++h)b=n[h],v={},v[i.axis]=i.parse(js(b,c),h),d.push(d3(js(b,u),v,a,h));return d}updateRangeFromParsed(t,n,r,o){super.updateRangeFromParsed(t,n,r,o);const i=r._custom;i&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,i.min),t.max=Math.max(t.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:o}=n,i=this.getParsed(t),a=i._custom,s=S1(a)?"["+a.start+", "+a.end+"]":""+o.getLabelForValue(i[o.axis]);return{label:""+r.getLabelForValue(i[r.axis]),value:s}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,o){const i=o==="reset",{index:a,_cachedMeta:{vScale:s}}=this,l=s.getBasePixel(),c=s.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:h}=this._getSharedOptions(n,o);for(let p=n;p<n+r;p++){const v=this.getParsed(p),b=i||Tt(v[s.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),x=this._calculateBarIndexPixels(p,u),y=(v._stacks||{})[s.axis],_={horizontal:c,base:b.base,enableBorderRadius:!y||S1(v._custom)||a===y._top||a===y._bottom,x:c?b.head:x.center,y:c?x.center:b.head,height:c?x.size:Math.abs(b.size),width:c?Math.abs(b.size):x.size};h&&(_.options=d||this.resolveDataElementOptions(p,t[p].active?"active":o));const S=_.options||t[p].options;xee(_,S,y,a),_ee(_,S,u.ratio),this.updateElement(t[p],p,_,o)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,o=r.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),i=r.options.stacked,a=[],s=l=>{const c=l.controller.getParsed(n),u=c&&c[l.vScale.axis];if(Tt(u)||isNaN(u))return!0};for(const l of o)if(!(n!==void 0&&s(l))&&((i===!1||a.indexOf(l.stack)===-1||i===void 0&&l.stack===void 0)&&a.push(l.stack),l.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,r){const o=this._getStacks(t,r),i=n!==void 0?o.indexOf(n):-1;return i===-1?o.length-1:i}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,o=[];let i,a;for(i=0,a=n.data.length;i<a;++i)o.push(r.getPixelForValue(this.getParsed(i)[r.axis],i));const s=t.barThickness;return{min:s||pee(n),pixels:o,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:s?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:o},options:{base:i,minBarLength:a}}=this,s=i||0,l=this.getParsed(t),c=l._custom,u=S1(c);let d=l[n.axis],h=0,p=r?this.applyStack(n,l,r):d,v,b;p!==d&&(h=p-d,p=d),u&&(d=c.barStart,p=c.barEnd-c.barStart,d!==0&&Wi(d)!==Wi(c.barEnd)&&(h=0),h+=d);const x=!Tt(i)&&!u?i:h;let y=n.getPixelForValue(x);if(this.chart.getDataVisibility(t)?v=n.getPixelForValue(h+p):v=y,b=v-y,Math.abs(b)<a){b=vee(b,n,s)*a,d===s&&(y-=b/2);const _=n.getPixelForDecimal(0),S=n.getPixelForDecimal(1),C=Math.min(_,S),E=Math.max(_,S);y=Math.max(Math.min(y,E),C),v=y+b,r&&!u&&(l._stacks[n.axis]._visualValues[o]=n.getValueForPixel(v)-n.getValueForPixel(y))}if(y===n.getPixelForValue(s)){const _=Wi(b)*n.getLineWidthForValue(s)/2;y+=_,b-=_}return{size:b,base:y,head:v,center:v+b/2}}_calculateBarIndexPixels(t,n){const r=n.scale,o=this.options,i=o.skipNull,a=st(o.maxBarThickness,1/0);let s,l;if(n.grouped){const c=i?this._getStackCount(t):n.stackCount,u=o.barThickness==="flex"?mee(t,n,o,c):gee(t,n,o,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,i?t:void 0);s=u.start+u.chunk*d+u.chunk/2,l=Math.min(a,u.chunk*u.ratio)}else s=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(a,n.min*n.ratio);return{base:s-l/2,head:s+l/2,center:s,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,o=r.length;let i=0;for(;i<o;++i)this.getParsed(i)[n.axis]!==null&&r[i].draw(this._ctx)}}Ne(Um,"id","bar"),Ne(Um,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Ne(Um,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class qm extends Xo{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,o){const i=super.parsePrimitiveData(t,n,r,o);for(let a=0;a<i.length;a++)i[a]._custom=this.resolveDataElementOptions(a+r).radius;return i}parseArrayData(t,n,r,o){const i=super.parseArrayData(t,n,r,o);for(let a=0;a<i.length;a++){const s=n[r+a];i[a]._custom=st(s[2],this.resolveDataElementOptions(a+r).radius)}return i}parseObjectData(t,n,r,o){const i=super.parseObjectData(t,n,r,o);for(let a=0;a<i.length;a++){const s=n[r+a];i[a]._custom=st(s&&s.r&&+s.r,this.resolveDataElementOptions(a+r).radius)}return i}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:o,yScale:i}=n,a=this.getParsed(t),s=o.getLabelForValue(a.x),l=i.getLabelForValue(a.y),c=a._custom;return{label:r[t]||"",value:"("+s+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,o){const i=o==="reset",{iScale:a,vScale:s}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,o),u=a.axis,d=s.axis;for(let h=n;h<n+r;h++){const p=t[h],v=!i&&this.getParsed(h),b={},x=b[u]=i?a.getPixelForDecimal(.5):a.getPixelForValue(v[u]),y=b[d]=i?s.getBasePixel():s.getPixelForValue(v[d]);b.skip=isNaN(x)||isNaN(y),c&&(b.options=l||this.resolveDataElementOptions(h,p.active?"active":o),i&&(b.options.radius=0)),this.updateElement(p,h,b,o)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let o=super.resolveDataElementOptions(t,n);o.$shared&&(o=Object.assign({},o,{$shared:!1}));const i=o.radius;return n!=="active"&&(o.radius=0),o.radius+=st(r&&r._custom,i),o}}Ne(qm,"id","bubble"),Ne(qm,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),Ne(qm,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function See(e,t,n){let r=1,o=1,i=0,a=0;if(t<Sn){const s=e,l=s+t,c=Math.cos(s),u=Math.sin(s),d=Math.cos(l),h=Math.sin(l),p=(S,C,E)=>lh(S,s,l,!0)?1:Math.max(C,C*n,E,E*n),v=(S,C,E)=>lh(S,s,l,!0)?-1:Math.min(C,C*n,E,E*n),b=p(0,c,d),x=p(Wn,u,h),y=v(Cn,c,d),_=v(Cn+Wn,u,h);r=(b-y)/2,o=(x-_)/2,i=-(b+y)/2,a=-(x+_)/2}return{ratioX:r,ratioY:o,offsetX:i,offsetY:a}}class Dl extends Xo{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,o=this._cachedMeta;if(this._parsing===!1)o._parsed=r;else{let i=l=>+r[l];if(kt(r[t])){const{key:l="value"}=this._parsing;i=c=>+js(r[c],l)}let a,s;for(a=t,s=t+n;a<s;++a)o._parsed[a]=i(a)}}_getRotation(){return mi(this.options.rotation-90)}_getCircumference(){return mi(this.options.circumference)}_getRotationExtents(){let t=Sn,n=-Sn;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const o=this.chart.getDatasetMeta(r).controller,i=o._getRotation(),a=o._getCircumference();t=Math.min(t,i),n=Math.max(n,i+a)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,o=this._cachedMeta,i=o.data,a=this.getMaxBorderWidth()+this.getMaxOffset(i)+this.options.spacing,s=Math.max((Math.min(r.width,r.height)-a)/2,0),l=Math.min(LJ(this.options.cutout,s),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:h,ratioY:p,offsetX:v,offsetY:b}=See(d,u,l),x=(r.width-a)/h,y=(r.height-a)/p,_=Math.max(Math.min(x,y)/2,0),S=j6(this.options.radius,_),C=Math.max(S*l,0),E=(S-C)/this._getVisibleDatasetWeightTotal();this.offsetX=v*S,this.offsetY=b*S,o.total=this.calculateTotal(),this.outerRadius=S-E*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-E*c,0),this.updateElements(i,0,i.length,t)}_circumference(t,n){const r=this.options,o=this._cachedMeta,i=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||o._parsed[t]===null||o.data[t].hidden?0:this.calculateCircumference(o._parsed[t]*i/Sn)}updateElements(t,n,r,o){const i=o==="reset",a=this.chart,s=a.chartArea,c=a.options.animation,u=(s.left+s.right)/2,d=(s.top+s.bottom)/2,h=i&&c.animateScale,p=h?0:this.innerRadius,v=h?0:this.outerRadius,{sharedOptions:b,includeOptions:x}=this._getSharedOptions(n,o);let y=this._getRotation(),_;for(_=0;_<n;++_)y+=this._circumference(_,i);for(_=n;_<n+r;++_){const S=this._circumference(_,i),C=t[_],E={x:u+this.offsetX,y:d+this.offsetY,startAngle:y,endAngle:y+S,circumference:S,outerRadius:v,innerRadius:p};x&&(E.options=b||this.resolveDataElementOptions(_,C.active?"active":o)),y+=S,this.updateElement(C,_,E,o)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,o;for(o=0;o<n.length;o++){const i=t._parsed[o];i!==null&&!isNaN(i)&&this.chart.getDataVisibility(o)&&!n[o].hidden&&(r+=Math.abs(i))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Sn*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,o=r.data.labels||[],i=fp(n._parsed[t],r.options.locale);return{label:o[t]||"",value:i}}getMaxBorderWidth(t){let n=0;const r=this.chart;let o,i,a,s,l;if(!t){for(o=0,i=r.data.datasets.length;o<i;++o)if(r.isDatasetVisible(o)){a=r.getDatasetMeta(o),t=a.data,s=a.controller;break}}if(!t)return 0;for(o=0,i=t.length;o<i;++o)l=s.resolveDataElementOptions(o),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,o=t.length;r<o;++r){const i=this.resolveDataElementOptions(r);n=Math.max(n,i.offset||0,i.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(st(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Ne(Dl,"id","doughnut"),Ne(Dl,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),Ne(Dl,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),Ne(Dl,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:o}}=t.legend.options;return n.labels.map((i,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:i,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:o,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});class Gm extends Xo{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:o=[],_dataset:i}=n,a=this.chart._animationsDisabled;let{start:s,count:l}=G6(n,o,a);this._drawStart=s,this._drawCount=l,Y6(n)&&(s=0,l=o.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!i._decimated,r.points=o;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!a,options:c},t),this.updateElements(o,s,l,t)}updateElements(t,n,r,o){const i=o==="reset",{iScale:a,vScale:s,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,o),h=a.axis,p=s.axis,{spanGaps:v,segment:b}=this.options,x=Qu(v)?v:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||i||o==="none",_=n+r,S=t.length;let C=n>0&&this.getParsed(n-1);for(let E=0;E<S;++E){const $=t[E],T=y?$:{};if(E<n||E>=_){T.skip=!0;continue}const D=this.getParsed(E),M=Tt(D[p]),L=T[h]=a.getPixelForValue(D[h],E),F=T[p]=i||M?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,D,l):D[p],E);T.skip=isNaN(L)||isNaN(F)||M,T.stop=E>0&&Math.abs(D[h]-C[h])>x,b&&(T.parsed=D,T.raw=c.data[E]),d&&(T.options=u||this.resolveDataElementOptions(E,$.active?"active":o)),y||this.updateElement($,E,T,o),C=D}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,o=t.data||[];if(!o.length)return r;const i=o[0].size(this.resolveDataElementOptions(0)),a=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(r,i,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Ne(Gm,"id","line"),Ne(Gm,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Ne(Gm,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Vf extends Xo{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,o=r.data.labels||[],i=fp(n._parsed[t].r,r.options.locale);return{label:o[t]||"",value:i}}parseObjectData(t,n,r,o){return n3.bind(this)(t,n,r,o)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,o)=>{const i=this.getParsed(o).r;!isNaN(i)&&this.chart.getDataVisibility(o)&&(i<n.min&&(n.min=i),i>n.max&&(n.max=i))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,o=Math.min(n.right-n.left,n.bottom-n.top),i=Math.max(o/2,0),a=Math.max(r.cutoutPercentage?i/100*r.cutoutPercentage:1,0),s=(i-a)/t.getVisibleDatasetCount();this.outerRadius=i-s*this.index,this.innerRadius=this.outerRadius-s}updateElements(t,n,r,o){const i=o==="reset",a=this.chart,l=a.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,h=c.getIndexAngle(0)-.5*Cn;let p=h,v;const b=360/this.countVisibleElements();for(v=0;v<n;++v)p+=this._computeAngle(v,o,b);for(v=n;v<n+r;v++){const x=t[v];let y=p,_=p+this._computeAngle(v,o,b),S=a.getDataVisibility(v)?c.getDistanceFromCenterForValue(this.getParsed(v).r):0;p=_,i&&(l.animateScale&&(S=0),l.animateRotate&&(y=_=h));const C={x:u,y:d,innerRadius:0,outerRadius:S,startAngle:y,endAngle:_,options:this.resolveDataElementOptions(v,x.active?"active":o)};this.updateElement(x,v,C,o)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,o)=>{!isNaN(this.getParsed(o).r)&&this.chart.getDataVisibility(o)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?mi(this.resolveDataElementOptions(t,n).angle||r):0}}Ne(Vf,"id","polarArea"),Ne(Vf,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),Ne(Vf,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:o}}=t.legend.options;return n.labels.map((i,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:i,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:o,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Uw extends Dl{}Ne(Uw,"id","pie"),Ne(Uw,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Ym extends Xo{getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,o){return n3.bind(this)(t,n,r,o)}update(t){const n=this._cachedMeta,r=n.dataset,o=n.data||[],i=n.iScale.getLabels();if(r.points=o,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const s={_loop:!0,_fullLoop:i.length===o.length,options:a};this.updateElement(r,void 0,s,t)}this.updateElements(o,0,o.length,t)}updateElements(t,n,r,o){const i=this._cachedMeta.rScale,a=o==="reset";for(let s=n;s<n+r;s++){const l=t[s],c=this.resolveDataElementOptions(s,l.active?"active":o),u=i.getPointPositionForValue(s,this.getParsed(s).r),d=a?i.xCenter:u.x,h=a?i.yCenter:u.y,p={x:d,y:h,angle:u.angle,skip:isNaN(d)||isNaN(h),options:c};this.updateElement(l,s,p,o)}}}Ne(Ym,"id","radar"),Ne(Ym,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),Ne(Ym,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Km extends Xo{getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:o,yScale:i}=n,a=this.getParsed(t),s=o.getLabelForValue(a.x),l=i.getLabelForValue(a.y);return{label:r[t]||"",value:"("+s+", "+l+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,o=this.chart._animationsDisabled;let{start:i,count:a}=G6(n,r,o);if(this._drawStart=i,this._drawCount=a,Y6(n)&&(i=0,a=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:s,_dataset:l}=n;s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!l._decimated,s.points=r;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(s,void 0,{animated:!o,options:c},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(r,i,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,o){const i=o==="reset",{iScale:a,vScale:s,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,o),d=this.getSharedOptions(u),h=this.includeOptions(o,d),p=a.axis,v=s.axis,{spanGaps:b,segment:x}=this.options,y=Qu(b)?b:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||i||o==="none";let S=n>0&&this.getParsed(n-1);for(let C=n;C<n+r;++C){const E=t[C],$=this.getParsed(C),T=_?E:{},D=Tt($[v]),M=T[p]=a.getPixelForValue($[p],C),L=T[v]=i||D?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,$,l):$[v],C);T.skip=isNaN(M)||isNaN(L)||D,T.stop=C>0&&Math.abs($[p]-S[p])>y,x&&(T.parsed=$,T.raw=c.data[C]),h&&(T.options=d||this.resolveDataElementOptions(C,E.active?"active":o)),_||this.updateElement(E,C,T,o),S=$}this.updateSharedOptions(d,o,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let s=0;for(let l=n.length-1;l>=0;--l)s=Math.max(s,n[l].size(this.resolveDataElementOptions(l))/2);return s>0&&s}const r=t.dataset,o=r.options&&r.options.borderWidth||0;if(!n.length)return o;const i=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(o,i,a)/2}}Ne(Km,"id","scatter"),Ne(Km,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),Ne(Km,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Cee=Object.freeze({__proto__:null,BarController:Um,BubbleController:qm,DoughnutController:Dl,LineController:Gm,PieController:Uw,PolarAreaController:Vf,RadarController:Ym,ScatterController:Km});function gl(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class NC{constructor(t){Ne(this,"options");this.options=t||{}}static override(t){Object.assign(NC.prototype,t)}init(){}formats(){return gl()}parse(){return gl()}format(){return gl()}add(){return gl()}diff(){return gl()}startOf(){return gl()}endOf(){return gl()}}var Eee={_date:NC};function Ree(e,t,n,r){const{controller:o,data:i,_sorted:a}=e,s=o._cachedMeta.iScale;if(s&&t===s.axis&&t!=="r"&&a&&i.length){const l=s._reversePixels?KJ:Aa;if(r){if(o._sharedOptions){const c=i[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(i,t,n-u),h=l(i,t,n+u);return{lo:d.lo,hi:h.hi}}}}else return l(i,t,n)}return{lo:0,hi:i.length-1}}function hp(e,t,n,r,o){const i=e.getSortedVisibleDatasetMetas(),a=n[t];for(let s=0,l=i.length;s<l;++s){const{index:c,data:u}=i[s],{lo:d,hi:h}=Ree(i[s],t,a,o);for(let p=d;p<=h;++p){const v=u[p];v.skip||r(v,c,p)}}}function Pee(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,o){const i=t?Math.abs(r.x-o.x):0,a=n?Math.abs(r.y-o.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(a,2))}}function C1(e,t,n,r,o){const i=[];return!o&&!e.isPointInArea(t)||hp(e,n,t,function(s,l,c){!o&&!Ma(s,e.chartArea,0)||s.inRange(t.x,t.y,r)&&i.push({element:s,datasetIndex:l,index:c})},!0),i}function $ee(e,t,n,r){let o=[];function i(a,s,l){const{startAngle:c,endAngle:u}=a.getProps(["startAngle","endAngle"],r),{angle:d}=V6(a,{x:t.x,y:t.y});lh(d,c,u)&&o.push({element:a,datasetIndex:s,index:l})}return hp(e,n,t,i),o}function Oee(e,t,n,r,o,i){let a=[];const s=Pee(n);let l=Number.POSITIVE_INFINITY;function c(u,d,h){const p=u.inRange(t.x,t.y,o);if(r&&!p)return;const v=u.getCenterPoint(o);if(!(!!i||e.isPointInArea(v))&&!p)return;const x=s(t,v);x<l?(a=[{element:u,datasetIndex:d,index:h}],l=x):x===l&&a.push({element:u,datasetIndex:d,index:h})}return hp(e,n,t,c),a}function E1(e,t,n,r,o,i){return!i&&!e.isPointInArea(t)?[]:n==="r"&&!r?$ee(e,t,n,o):Oee(e,t,n,r,o,i)}function q$(e,t,n,r,o){const i=[],a=n==="x"?"inXRange":"inYRange";let s=!1;return hp(e,n,t,(l,c,u)=>{l[a](t[n],o)&&(i.push({element:l,datasetIndex:c,index:u}),s=s||l.inRange(t.x,t.y,o))}),r&&!s?[]:i}var Tee={evaluateInteractionItems:hp,modes:{index(e,t,n,r){const o=yl(t,e),i=n.axis||"x",a=n.includeInvisible||!1,s=n.intersect?C1(e,o,i,r,a):E1(e,o,i,!1,r,a),l=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=s[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const o=yl(t,e),i=n.axis||"xy",a=n.includeInvisible||!1;let s=n.intersect?C1(e,o,i,r,a):E1(e,o,i,!1,r,a);if(s.length>0){const l=s[0].datasetIndex,c=e.getDatasetMeta(l).data;s=[];for(let u=0;u<c.length;++u)s.push({element:c[u],datasetIndex:l,index:u})}return s},point(e,t,n,r){const o=yl(t,e),i=n.axis||"xy",a=n.includeInvisible||!1;return C1(e,o,i,r,a)},nearest(e,t,n,r){const o=yl(t,e),i=n.axis||"xy",a=n.includeInvisible||!1;return E1(e,o,i,n.intersect,r,a)},x(e,t,n,r){const o=yl(t,e);return q$(e,o,"x",n.intersect,r)},y(e,t,n,r){const o=yl(t,e);return q$(e,o,"y",n.intersect,r)}}};const f3=["left","top","right","bottom"];function Zd(e,t){return e.filter(n=>n.pos===t)}function G$(e,t){return e.filter(n=>f3.indexOf(n.pos)===-1&&n.box.axis===t)}function ef(e,t){return e.sort((n,r)=>{const o=t?r:n,i=t?n:r;return o.weight===i.weight?o.index-i.index:o.weight-i.weight})}function Dee(e){const t=[];let n,r,o,i,a,s;for(n=0,r=(e||[]).length;n<r;++n)o=e[n],{position:i,options:{stack:a,stackWeight:s=1}}=o,t.push({index:n,box:o,pos:i,horizontal:o.isHorizontal(),weight:o.weight,stack:a&&i+a,stackWeight:s});return t}function Aee(e){const t={};for(const n of e){const{stack:r,pos:o,stackWeight:i}=n;if(!r||!f3.includes(o))continue;const a=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=i}return t}function Mee(e,t){const n=Aee(e),{vBoxMaxWidth:r,hBoxMaxHeight:o}=t;let i,a,s;for(i=0,a=e.length;i<a;++i){s=e[i];const{fullSize:l}=s.box,c=n[s.stack],u=c&&s.stackWeight/c.weight;s.horizontal?(s.width=u?u*r:l&&t.availableWidth,s.height=o):(s.width=r,s.height=u?u*o:l&&t.availableHeight)}return n}function kee(e){const t=Dee(e),n=ef(t.filter(c=>c.box.fullSize),!0),r=ef(Zd(t,"left"),!0),o=ef(Zd(t,"right")),i=ef(Zd(t,"top"),!0),a=ef(Zd(t,"bottom")),s=G$(t,"x"),l=G$(t,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:o.concat(l).concat(a).concat(s),chartArea:Zd(t,"chartArea"),vertical:r.concat(o).concat(l),horizontal:i.concat(a).concat(s)}}function Y$(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function h3(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Iee(e,t,n,r){const{pos:o,box:i}=n,a=e.maxPadding;if(!kt(o)){n.size&&(e[o]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?i.height:i.width),n.size=d.size/d.count,e[o]+=n.size}i.getPadding&&h3(a,i.getPadding());const s=Math.max(0,t.outerWidth-Y$(a,e,"left","right")),l=Math.max(0,t.outerHeight-Y$(a,e,"top","bottom")),c=s!==e.w,u=l!==e.h;return e.w=s,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function Nee(e){const t=e.maxPadding;function n(r){const o=Math.max(t[r]-e[r],0);return e[r]+=o,o}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function Lee(e,t){const n=t.maxPadding;function r(o){const i={left:0,top:0,right:0,bottom:0};return o.forEach(a=>{i[a]=Math.max(t[a],n[a])}),i}return r(e?["left","right"]:["top","bottom"])}function Rf(e,t,n,r){const o=[];let i,a,s,l,c,u;for(i=0,a=e.length,c=0;i<a;++i){s=e[i],l=s.box,l.update(s.width||t.w,s.height||t.h,Lee(s.horizontal,t));const{same:d,other:h}=Iee(t,n,s,r);c|=d&&o.length,u=u||h,l.fullSize||o.push(s)}return c&&Rf(o,t,n,r)||u}function Hg(e,t,n,r,o){e.top=n,e.left=t,e.right=t+r,e.bottom=n+o,e.width=r,e.height=o}function K$(e,t,n,r){const o=n.padding;let{x:i,y:a}=t;for(const s of e){const l=s.box,c=r[s.stack]||{count:1,placed:0,weight:1},u=s.stackWeight/c.weight||1;if(s.horizontal){const d=t.w*u,h=c.size||l.height;sh(c.start)&&(a=c.start),l.fullSize?Hg(l,o.left,a,n.outerWidth-o.right-o.left,h):Hg(l,t.left+c.placed,a,d,h),c.start=a,c.placed+=d,a=l.bottom}else{const d=t.h*u,h=c.size||l.width;sh(c.start)&&(i=c.start),l.fullSize?Hg(l,i,o.top,h,n.outerHeight-o.bottom-o.top):Hg(l,i,t.top+c.placed,h,d),c.start=i,c.placed+=d,i=l.right}}t.x=i,t.y=a}var _r={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const o=fr(e.options.layout.padding),i=Math.max(t-o.width,0),a=Math.max(n-o.height,0),s=kee(e.boxes),l=s.vertical,c=s.horizontal;nn(e.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const u=l.reduce((b,x)=>x.box.options&&x.box.options.display===!1?b:b+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:o,availableWidth:i,availableHeight:a,vBoxMaxWidth:i/2/u,hBoxMaxHeight:a/2}),h=Object.assign({},o);h3(h,fr(r));const p=Object.assign({maxPadding:h,w:i,h:a,x:o.left,y:o.top},o),v=Mee(l.concat(c),d);Rf(s.fullSize,p,d,v),Rf(l,p,d,v),Rf(c,p,d,v)&&Rf(l,p,d,v),Nee(p),K$(s.leftAndTop,p,d,v),p.x+=p.w,p.y+=p.h,K$(s.rightAndBottom,p,d,v),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},nn(s.chartArea,b=>{const x=b.box;Object.assign(x,e.chartArea),x.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class p3{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,o){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,o?Math.floor(n/o):r)}}isAttached(t){return!0}updateConfig(t){}}class Fee extends p3{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Xm="$chartjs",jee={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},X$=e=>e===null||e==="";function zee(e,t){const n=e.style,r=e.getAttribute("height"),o=e.getAttribute("width");if(e[Xm]={initial:{height:r,width:o,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",X$(o)){const i=A$(e,"width");i!==void 0&&(e.width=i)}if(X$(r))if(e.style.height==="")e.height=e.width/(t||2);else{const i=A$(e,"height");i!==void 0&&(e.height=i)}return e}const g3=VZ?{passive:!0}:!1;function Bee(e,t,n){e.addEventListener(t,n,g3)}function Vee(e,t,n){e.canvas.removeEventListener(t,n,g3)}function Hee(e,t){const n=jee[e.type]||e.type,{x:r,y:o}=yl(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:o!==void 0?o:null}}function C0(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function Wee(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let a=!1;for(const s of i)a=a||C0(s.addedNodes,r),a=a&&!C0(s.removedNodes,r);a&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}function Uee(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let a=!1;for(const s of i)a=a||C0(s.removedNodes,r),a=a&&!C0(s.addedNodes,r);a&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}const uh=new Map;let Q$=0;function m3(){const e=window.devicePixelRatio;e!==Q$&&(Q$=e,uh.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function qee(e,t){uh.size||window.addEventListener("resize",m3),uh.set(e,t)}function Gee(e){uh.delete(e),uh.size||window.removeEventListener("resize",m3)}function Yee(e,t,n){const r=e.canvas,o=r&&IC(r);if(!o)return;const i=q6((s,l)=>{const c=o.clientWidth;n(s,l),c<o.clientWidth&&n()},window),a=new ResizeObserver(s=>{const l=s[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||i(c,u)});return a.observe(o),qee(e,i),a}function R1(e,t,n){n&&n.disconnect(),t==="resize"&&Gee(e)}function Kee(e,t,n){const r=e.canvas,o=q6(i=>{e.ctx!==null&&n(Hee(i,e))},e);return Bee(r,t,o),o}class Xee extends p3{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(zee(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Xm])return!1;const r=n[Xm].initial;["height","width"].forEach(i=>{const a=r[i];Tt(a)?n.removeAttribute(i):n.setAttribute(i,a)});const o=r.style||{};return Object.keys(o).forEach(i=>{n.style[i]=o[i]}),n.width=n.width,delete n[Xm],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const o=t.$proxies||(t.$proxies={}),a={attach:Wee,detach:Uee,resize:Yee}[n]||Kee;o[n]=a(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),o=r[n];if(!o)return;({attach:R1,detach:R1,resize:R1}[n]||Vee)(t,n,o),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,o){return BZ(t,n,r,o)}isAttached(t){const n=IC(t);return!!(n&&n.isConnected)}}function Qee(e){return!kC()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Fee:Xee}var Wm;let ra=(Wm=class{constructor(){Ne(this,"x");Ne(this,"y");Ne(this,"active",!1);Ne(this,"options");Ne(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return Qu(this.x)&&Qu(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const o={};return t.forEach(i=>{o[i]=r[i]&&r[i].active()?r[i]._to:this[i]}),o}},Ne(Wm,"defaults",{}),Ne(Wm,"defaultRoutes"),Wm);function Jee(e,t){const n=e.options.ticks,r=Zee(e),o=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?tte(t):[],a=i.length,s=i[0],l=i[a-1],c=[];if(a>o)return nte(t,c,i,a/o),c;const u=ete(i,t,o);if(a>0){let d,h;const p=a>1?Math.round((l-s)/(a-1)):null;for(Wg(t,c,u,Tt(p)?0:s-p,s),d=0,h=a-1;d<h;d++)Wg(t,c,u,i[d],i[d+1]);return Wg(t,c,u,l,Tt(p)?t.length:l+p),c}return Wg(t,c,u),c}function Zee(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),o=e._maxLength/n;return Math.floor(Math.min(r,o))}function ete(e,t,n){const r=rte(e),o=t.length/n;if(!r)return Math.max(o,1);const i=UJ(r);for(let a=0,s=i.length-1;a<s;a++){const l=i[a];if(l>o)return l}return Math.max(o,1)}function tte(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function nte(e,t,n,r){let o=0,i=n[0],a;for(r=Math.ceil(r),a=0;a<e.length;a++)a===i&&(t.push(e[a]),o++,i=n[o*r])}function Wg(e,t,n,r,o){const i=st(r,0),a=Math.min(st(o,e.length),e.length);let s=0,l,c,u;for(n=Math.ceil(n),o&&(l=o-r,n=l/Math.floor(l/n)),u=i;u<0;)s++,u=Math.round(i+s*n);for(c=Math.max(i,0);c<a;c++)c===u&&(t.push(e[c]),s++,u=Math.round(i+s*n))}function rte(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const ote=e=>e==="left"?"right":e==="right"?"left":e,J$=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Z$=(e,t)=>Math.min(t||e,e);function eO(e,t){const n=[],r=e.length/t,o=e.length;let i=0;for(;i<o;i+=r)n.push(e[Math.floor(i)]);return n}function ite(e,t,n){const r=e.ticks.length,o=Math.min(t,r-1),i=e._startPixel,a=e._endPixel,s=1e-6;let l=e.getPixelForTick(o),c;if(!(n&&(r===1?c=Math.max(l-i,a-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(o-1))/2,l+=o<t?c:-c,l<i-s||l>a+s)))return l}function ate(e,t){nn(e,n=>{const r=n.gc,o=r.length/2;let i;if(o>t){for(i=0;i<o;++i)delete n.data[r[i]];r.splice(0,o)}})}function tf(e){return e.drawTicks?e.tickLength:0}function tO(e,t){if(!e.display)return 0;const n=qn(e.font,t),r=fr(e.padding);return(_n(e.text)?e.text.length:1)*n.lineHeight+r.height}function ste(e,t){return Xs(e,{scale:t,type:"scale"})}function lte(e,t,n){return Xs(e,{tick:n,index:t,type:"tick"})}function cte(e,t,n){let r=$C(e);return(n&&t!=="right"||!n&&t==="right")&&(r=ote(r)),r}function ute(e,t,n,r){const{top:o,left:i,bottom:a,right:s,chart:l}=e,{chartArea:c,scales:u}=l;let d=0,h,p,v;const b=a-o,x=s-i;if(e.isHorizontal()){if(p=wr(r,i,s),kt(n)){const y=Object.keys(n)[0],_=n[y];v=u[y].getPixelForValue(_)+b-t}else n==="center"?v=(c.bottom+c.top)/2+b-t:v=J$(e,n,t);h=s-i}else{if(kt(n)){const y=Object.keys(n)[0],_=n[y];p=u[y].getPixelForValue(_)-x+t}else n==="center"?p=(c.left+c.right)/2-x+t:p=J$(e,n,t);v=wr(r,a,o),d=n==="left"?-Wn:Wn}return{titleX:p,titleY:v,maxWidth:h,rotation:d}}class Qs extends ra{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:o}=this;return t=mo(t,Number.POSITIVE_INFINITY),n=mo(n,Number.NEGATIVE_INFINITY),r=mo(r,Number.POSITIVE_INFINITY),o=mo(o,Number.NEGATIVE_INFINITY),{min:mo(t,r),max:mo(n,o),minDefined:Ln(t),maxDefined:Ln(n)}}getMinMax(t){let{min:n,max:r,minDefined:o,maxDefined:i}=this.getUserBounds(),a;if(o&&i)return{min:n,max:r};const s=this.getMatchingVisibleMetas();for(let l=0,c=s.length;l<c;++l)a=s[l].controller.getMinMax(this,t),o||(n=Math.min(n,a.min)),i||(r=Math.max(r,a.max));return n=i&&n>r?r:n,r=o&&n>r?n:r,{min:mo(n,mo(r,n)),max:mo(r,mo(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){cn(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:o,grace:i,ticks:a}=this.options,s=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=yZ(this,i,o),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=s<this.ticks.length;this._convertTicksToLabels(l?eO(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Jee(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){cn(this.options.afterUpdate,[this])}beforeSetDimensions(){cn(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){cn(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),cn(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){cn(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,o,i;for(r=0,o=t.length;r<o;r++)i=t[r],i.label=cn(n.callback,[i.value,r,t],this)}afterTickToLabelConversion(){cn(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){cn(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=Z$(this.ticks.length,t.ticks.maxTicksLimit),o=n.minRotation||0,i=n.maxRotation;let a=o,s,l,c;if(!this._isVisible()||!n.display||o>=i||r<=1||!this.isHorizontal()){this.labelRotation=o;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,p=rr(this.chart.width-d,0,this.maxWidth);s=t.offset?this.maxWidth/r:p/(r-1),d+6>s&&(s=p/(r-(t.offset?.5:1)),l=this.maxHeight-tf(t.grid)-n.padding-tO(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),a=RC(Math.min(Math.asin(rr((u.highest.height+6)/s,-1,1)),Math.asin(rr(l/c,-1,1))-Math.asin(rr(h/c,-1,1)))),a=Math.max(o,Math.min(i,a))),this.labelRotation=a}afterCalculateLabelRotation(){cn(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){cn(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:o,grid:i}}=this,a=this._isVisible(),s=this.isHorizontal();if(a){const l=tO(o,n.options.font);if(s?(t.width=this.maxWidth,t.height=tf(i)+l):(t.height=this.maxHeight,t.width=tf(i)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),p=r.padding*2,v=mi(this.labelRotation),b=Math.cos(v),x=Math.sin(v);if(s){const y=r.mirror?0:x*d.width+b*h.height;t.height=Math.min(this.maxHeight,t.height+y+p)}else{const y=r.mirror?0:b*d.width+x*h.height;t.width=Math.min(this.maxWidth,t.width+y+p)}this._calculatePadding(c,u,x,b)}}this._handleMargins(),s?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,o){const{ticks:{align:i,padding:a},position:s}=this.options,l=this.labelRotation!==0,c=s!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,p=0;l?c?(h=o*t.width,p=r*n.height):(h=r*t.height,p=o*n.width):i==="start"?p=n.width:i==="end"?h=t.width:i!=="inner"&&(h=t.width/2,p=n.width/2),this.paddingLeft=Math.max((h-u+a)*this.width/(this.width-u),0),this.paddingRight=Math.max((p-d+a)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;i==="start"?(u=0,d=t.height):i==="end"&&(u=n.height,d=0),this.paddingTop=u+a,this.paddingBottom=d+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){cn(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)Tt(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=eO(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:o,_longestTextCache:i}=this,a=[],s=[],l=Math.floor(n/Z$(n,r));let c=0,u=0,d,h,p,v,b,x,y,_,S,C,E;for(d=0;d<n;d+=l){if(v=t[d].label,b=this._resolveTickFontOptions(d),o.font=x=b.string,y=i[x]=i[x]||{data:{},gc:[]},_=b.lineHeight,S=C=0,!Tt(v)&&!_n(v))S=w0(o,y.data,y.gc,S,v),C=_;else if(_n(v))for(h=0,p=v.length;h<p;++h)E=v[h],!Tt(E)&&!_n(E)&&(S=w0(o,y.data,y.gc,S,E),C+=_);a.push(S),s.push(C),c=Math.max(S,c),u=Math.max(C,u)}ate(i,n);const $=a.indexOf(c),T=s.indexOf(u),D=M=>({width:a[M]||0,height:s[M]||0});return{first:D(0),last:D(n-1),widest:D($),highest:D(T),widths:a,heights:s}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return YJ(this._alignToPixels?pl(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=lte(this.getContext(),t,r))}return this.$context||(this.$context=ste(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=mi(this.labelRotation),r=Math.abs(Math.cos(n)),o=Math.abs(Math.sin(n)),i=this._getLabelSizes(),a=t.autoSkipPadding||0,s=i?i.widest.width+a:0,l=i?i.highest.height+a:0;return this.isHorizontal()?l*r>s*o?s/r:l/o:l*o<s*r?l/r:s/o}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,o=this.options,{grid:i,position:a,border:s}=o,l=i.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=tf(i),p=[],v=s.setContext(this.getContext()),b=v.display?v.width:0,x=b/2,y=function(U){return pl(r,U,b)};let _,S,C,E,$,T,D,M,L,F,z,X;if(a==="top")_=y(this.bottom),T=this.bottom-h,M=_-x,F=y(t.top)+x,X=t.bottom;else if(a==="bottom")_=y(this.top),F=t.top,X=y(t.bottom)-x,T=_+x,M=this.top+h;else if(a==="left")_=y(this.right),$=this.right-h,D=_-x,L=y(t.left)+x,z=t.right;else if(a==="right")_=y(this.left),L=t.left,z=y(t.right)-x,$=_+x,D=this.left+h;else if(n==="x"){if(a==="center")_=y((t.top+t.bottom)/2+.5);else if(kt(a)){const U=Object.keys(a)[0],V=a[U];_=y(this.chart.scales[U].getPixelForValue(V))}F=t.top,X=t.bottom,T=_+x,M=T+h}else if(n==="y"){if(a==="center")_=y((t.left+t.right)/2);else if(kt(a)){const U=Object.keys(a)[0],V=a[U];_=y(this.chart.scales[U].getPixelForValue(V))}$=_-x,D=$-h,L=t.left,z=t.right}const G=st(o.ticks.maxTicksLimit,d),A=Math.max(1,Math.ceil(d/G));for(S=0;S<d;S+=A){const U=this.getContext(S),V=i.setContext(U),K=s.setContext(U),q=V.lineWidth,O=V.color,H=K.dash||[],Y=K.dashOffset,I=V.tickWidth,te=V.tickColor,ce=V.tickBorderDash||[],de=V.tickBorderDashOffset;C=ite(this,S,l),C!==void 0&&(E=pl(r,C,q),c?$=D=L=z=E:T=M=F=X=E,p.push({tx1:$,ty1:T,tx2:D,ty2:M,x1:L,y1:F,x2:z,y2:X,width:q,color:O,borderDash:H,borderDashOffset:Y,tickWidth:I,tickColor:te,tickBorderDash:ce,tickBorderDashOffset:de}))}return this._ticksLength=d,this._borderValue=_,p}_computeLabelItems(t){const n=this.axis,r=this.options,{position:o,ticks:i}=r,a=this.isHorizontal(),s=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=i,h=tf(r.grid),p=h+u,v=d?-u:p,b=-mi(this.labelRotation),x=[];let y,_,S,C,E,$,T,D,M,L,F,z,X="middle";if(o==="top")$=this.bottom-v,T=this._getXAxisLabelAlignment();else if(o==="bottom")$=this.top+v,T=this._getXAxisLabelAlignment();else if(o==="left"){const A=this._getYAxisLabelAlignment(h);T=A.textAlign,E=A.x}else if(o==="right"){const A=this._getYAxisLabelAlignment(h);T=A.textAlign,E=A.x}else if(n==="x"){if(o==="center")$=(t.top+t.bottom)/2+p;else if(kt(o)){const A=Object.keys(o)[0],U=o[A];$=this.chart.scales[A].getPixelForValue(U)+p}T=this._getXAxisLabelAlignment()}else if(n==="y"){if(o==="center")E=(t.left+t.right)/2-p;else if(kt(o)){const A=Object.keys(o)[0],U=o[A];E=this.chart.scales[A].getPixelForValue(U)}T=this._getYAxisLabelAlignment(h).textAlign}n==="y"&&(l==="start"?X="top":l==="end"&&(X="bottom"));const G=this._getLabelSizes();for(y=0,_=s.length;y<_;++y){S=s[y],C=S.label;const A=i.setContext(this.getContext(y));D=this.getPixelForTick(y)+i.labelOffset,M=this._resolveTickFontOptions(y),L=M.lineHeight,F=_n(C)?C.length:1;const U=F/2,V=A.color,K=A.textStrokeColor,q=A.textStrokeWidth;let O=T;a?(E=D,T==="inner"&&(y===_-1?O=this.options.reverse?"left":"right":y===0?O=this.options.reverse?"right":"left":O="center"),o==="top"?c==="near"||b!==0?z=-F*L+L/2:c==="center"?z=-G.highest.height/2-U*L+L:z=-G.highest.height+L/2:c==="near"||b!==0?z=L/2:c==="center"?z=G.highest.height/2-U*L:z=G.highest.height-F*L,d&&(z*=-1),b!==0&&!A.showLabelBackdrop&&(E+=L/2*Math.sin(b))):($=D,z=(1-F)*L/2);let H;if(A.showLabelBackdrop){const Y=fr(A.backdropPadding),I=G.heights[y],te=G.widths[y];let ce=z-Y.top,de=0-Y.left;switch(X){case"middle":ce-=I/2;break;case"bottom":ce-=I;break}switch(T){case"center":de-=te/2;break;case"right":de-=te;break;case"inner":y===_-1?de-=te:y>0&&(de-=te/2);break}H={left:de,top:ce,width:te+Y.width,height:I+Y.height,color:A.backdropColor}}x.push({label:C,font:M,textOffset:z,options:{rotation:b,color:V,strokeColor:K,strokeWidth:q,textAlign:O,textBaseline:X,translation:[E,$],backdrop:H}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-mi(this.labelRotation))return t==="top"?"left":"right";let o="center";return n.align==="start"?o="left":n.align==="end"?o="right":n.align==="inner"&&(o="inner"),o}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:o,padding:i}}=this.options,a=this._getLabelSizes(),s=t+i,l=a.widest.width;let c,u;return n==="left"?o?(u=this.right+i,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-s,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?o?(u=this.left+i,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+s,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:o,width:i,height:a}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,o,i,a),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const o=this.ticks.findIndex(i=>i.value===t);return o>=0?n.setContext(this.getContext(o)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,o=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let i,a;const s=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(i=0,a=o.length;i<a;++i){const l=o[i];n.drawOnChartArea&&s({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&s({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:o}}=this,i=r.setContext(this.getContext()),a=r.display?i.width:0;if(!a)return;const s=o.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,h;this.isHorizontal()?(c=pl(t,this.left,a)-a/2,u=pl(t,this.right,s)+s/2,d=h=l):(d=pl(t,this.top,a)-a/2,h=pl(t,this.bottom,s)+s/2,c=u=l),n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,h),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,o=this._computeLabelArea();o&&Wl(r,o);const i=this.getLabelItems(t);for(const a of i){const s=a.options,l=a.font,c=a.label,u=a.textOffset;sc(r,c,0,u,l,s)}o&&Ul(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:o}}=this;if(!r.display)return;const i=qn(r.font),a=fr(r.padding),s=r.align;let l=i.lineHeight/2;n==="bottom"||n==="center"||kt(n)?(l+=a.bottom,_n(r.text)&&(l+=i.lineHeight*(r.text.length-1))):l+=a.top;const{titleX:c,titleY:u,maxWidth:d,rotation:h}=ute(this,l,n,s);sc(t,r.text,0,0,i,{color:r.color,maxWidth:d,rotation:h,textAlign:cte(s,n,o),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=st(t.grid&&t.grid.z,-1),o=st(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Qs.prototype.draw?[{z:n,draw:i=>{this.draw(i)}}]:[{z:r,draw:i=>{this.drawBackground(),this.drawGrid(i),this.drawTitle()}},{z:o,draw:()=>{this.drawBorder()}},{z:n,draw:i=>{this.drawLabels(i)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",o=[];let i,a;for(i=0,a=n.length;i<a;++i){const s=n[i];s[r]===this.id&&(!t||s.type===t)&&o.push(s)}return o}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return qn(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ug{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;hte(n)&&(r=this.register(n));const o=this.items,i=t.id,a=this.scope+"."+i;if(!i)throw new Error("class does not have id: "+t);return i in o||(o[i]=t,dte(t,a,r),this.override&&An.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,o=this.scope;r in n&&delete n[r],o&&r in An[o]&&(delete An[o][r],this.override&&delete ac[r])}}function dte(e,t,n){const r=or(Object.create(null),[n?An.get(n):{},An.get(t),e.defaults]);An.set(t,r),e.defaultRoutes&&fte(t,e.defaultRoutes),e.descriptors&&An.describe(t,e.descriptors)}function fte(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),o=r.pop(),i=[e].concat(r).join("."),a=t[n].split("."),s=a.pop(),l=a.join(".");An.route(i,o,l,s)})}function hte(e){return"id"in e&&"defaults"in e}class pte{constructor(){this.controllers=new Ug(Xo,"datasets",!0),this.elements=new Ug(ra,"elements"),this.plugins=new Ug(Object,"plugins"),this.scales=new Ug(Qs,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(o=>{const i=r||this._getRegistryForType(o);r||i.isForType(o)||i===this.plugins&&o.id?this._exec(t,i,o):nn(o,a=>{const s=r||this._getRegistryForType(a);this._exec(t,s,a)})})}_exec(t,n,r){const o=EC(t);cn(r["before"+o],[],r),n[t](r),cn(r["after"+o],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const o=n.get(t);if(o===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return o}}var Nr=new pte;class gte{constructor(){this._init=[]}notify(t,n,r,o){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const i=o?this._descriptors(t).filter(o):this._descriptors(t),a=this._notify(i,t,n,r);return n==="afterDestroy"&&(this._notify(i,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,n,r,o){o=o||{};for(const i of t){const a=i.plugin,s=a[r],l=[n,o,i.options];if(cn(s,l,a)===!1&&o.cancelable)return!1}return!0}invalidate(){Tt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,o=st(r.options&&r.options.plugins,{}),i=mte(r);return o===!1&&!n?[]:vte(t,i,o,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,o=(i,a)=>i.filter(s=>!a.some(l=>s.plugin.id===l.plugin.id));this._notify(o(n,r),t,"stop"),this._notify(o(r,n),t,"start")}}function mte(e){const t={},n=[],r=Object.keys(Nr.plugins.items);for(let i=0;i<r.length;i++)n.push(Nr.getPlugin(r[i]));const o=e.plugins||[];for(let i=0;i<o.length;i++){const a=o[i];n.indexOf(a)===-1&&(n.push(a),t[a.id]=!0)}return{plugins:n,localIds:t}}function bte(e,t){return!t&&e===!1?null:e===!0?{}:e}function vte(e,{plugins:t,localIds:n},r,o){const i=[],a=e.getContext();for(const s of t){const l=s.id,c=bte(r[l],o);c!==null&&i.push({plugin:s,options:yte(e.config,{plugin:s,local:n[l]},c,a)})}return i}function yte(e,{plugin:t,local:n},r,o){const i=e.pluginScopeKeys(t),a=e.getOptionScopes(r,i);return n&&t.defaults&&a.push(t.defaults),e.createResolver(a,o,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function qw(e,t){const n=An.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function xte(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function wte(e,t){return e===t?"_index_":"_value_"}function nO(e){if(e==="x"||e==="y"||e==="r")return e}function _te(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Gw(e,...t){if(nO(e))return e;for(const n of t){const r=n.axis||_te(n.position)||e.length>1&&nO(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function rO(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Ste(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return rO(e,"x",n[0])||rO(e,"y",n[0])}return{}}function Cte(e,t){const n=ac[e.type]||{scales:{}},r=t.scales||{},o=qw(e.type,t),i=Object.create(null);return Object.keys(r).forEach(a=>{const s=r[a];if(!kt(s))return console.error(`Invalid scale configuration for scale: ${a}`);if(s._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=Gw(a,s,Ste(a,e),An.scales[s.type]),c=wte(l,o),u=n.scales||{};i[a]=Ff(Object.create(null),[{axis:l},s,u[l],u[c]])}),e.data.datasets.forEach(a=>{const s=a.type||e.type,l=a.indexAxis||qw(s,t),u=(ac[s]||{}).scales||{};Object.keys(u).forEach(d=>{const h=xte(d,l),p=a[h+"AxisID"]||h;i[p]=i[p]||Object.create(null),Ff(i[p],[{axis:h},r[p],u[d]])})}),Object.keys(i).forEach(a=>{const s=i[a];Ff(s,[An.scales[s.type],An.scale])}),i}function b3(e){const t=e.options||(e.options={});t.plugins=st(t.plugins,{}),t.scales=Cte(e,t)}function v3(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Ete(e){return e=e||{},e.data=v3(e.data),b3(e),e}const oO=new Map,y3=new Set;function qg(e,t){let n=oO.get(e);return n||(n=t(),oO.set(e,n),y3.add(n)),n}const nf=(e,t,n)=>{const r=js(t,n);r!==void 0&&e.add(r)};class Rte{constructor(t){this._config=Ete(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=v3(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),b3(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return qg(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return qg(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return qg(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return qg(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let o=r.get(t);return(!o||n)&&(o=new Map,r.set(t,o)),o}getOptionScopes(t,n,r){const{options:o,type:i}=this,a=this._cachedScopes(t,r),s=a.get(n);if(s)return s;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>nf(l,t,d))),u.forEach(d=>nf(l,o,d)),u.forEach(d=>nf(l,ac[i]||{},d)),u.forEach(d=>nf(l,An,d)),u.forEach(d=>nf(l,Ww,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),y3.has(n)&&a.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,ac[n]||{},An.datasets[n]||{},{type:n},An,Ww]}resolveNamedOptions(t,n,r,o=[""]){const i={$shared:!0},{resolver:a,subPrefixes:s}=iO(this._resolverCache,t,o);let l=a;if($te(a,n)){i.$shared=!1,r=zs(r)?r():r;const c=this.createResolver(t,r,s);l=Ju(a,r,c)}for(const c of n)i[c]=l[c];return i}createResolver(t,n,r=[""],o){const{resolver:i}=iO(this._resolverCache,t,r);return kt(n)?Ju(i,n,void 0,o):i}}function iO(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const o=n.join();let i=r.get(o);return i||(i={resolver:DC(t,n),subPrefixes:n.filter(s=>!s.toLowerCase().includes("hover"))},r.set(o,i)),i}const Pte=e=>kt(e)&&Object.getOwnPropertyNames(e).some(t=>zs(e[t]));function $te(e,t){const{isScriptable:n,isIndexable:r}=J6(e);for(const o of t){const i=n(o),a=r(o),s=(a||i)&&e[o];if(i&&(zs(s)||Pte(s))||a&&_n(s))return!0}return!1}var Ote="4.4.1";const Tte=["top","bottom","left","right","chartArea"];function aO(e,t){return e==="top"||e==="bottom"||Tte.indexOf(e)===-1&&t==="x"}function sO(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function lO(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),cn(n&&n.onComplete,[e],t)}function Dte(e){const t=e.chart,n=t.options.animation;cn(n&&n.onProgress,[e],t)}function x3(e){return kC()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Qm={},cO=e=>{const t=x3(e);return Object.values(Qm).filter(n=>n.canvas===t).pop()};function Ate(e,t,n){const r=Object.keys(e);for(const o of r){const i=+o;if(i>=t){const a=e[o];delete e[o],(n>0||i>t)&&(e[i+n]=a)}}}function Mte(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function Gg(e,t,n){return e.options.clip?e[n]:t[n]}function kte(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:Gg(n,t,"left"),right:Gg(n,t,"right"),top:Gg(r,t,"top"),bottom:Gg(r,t,"bottom")}:t}class Dn{static register(...t){Nr.add(...t),uO()}static unregister(...t){Nr.remove(...t),uO()}constructor(t,n){const r=this.config=new Rte(n),o=x3(t),i=cO(o);if(i)throw new Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas with ID '"+i.canvas.id+"' can be reused.");const a=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||Qee(o)),this.platform.updateConfig(r);const s=this.platform.acquireContext(o,a.aspectRatio),l=s&&s.canvas,c=l&&l.height,u=l&&l.width;if(this.id=NJ(),this.ctx=s,this.canvas=l,this.width=u,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new gte,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=JJ(d=>this.update(d),a.resizeDelay||0),this._dataChanges=[],Qm[this.id]=this,!s||!l){console.error("Failed to create chart: can't acquire context from the given item");return}_a.listen(this,"complete",lO),_a.listen(this,"progress",Dte),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:o,_aspectRatio:i}=this;return Tt(t)?n&&i?i:o?r/o:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Nr}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():D$(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return $$(this.canvas,this.ctx),this}stop(){return _a.stop(this),this}resize(t,n){_a.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,o=this.canvas,i=r.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(o,t,n,i),s=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,D$(this,s,!0)&&(this.notifyPlugins("resize",{size:a}),cn(r.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};nn(n,(r,o)=>{r.id=o})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,o=Object.keys(r).reduce((a,s)=>(a[s]=!1,a),{});let i=[];n&&(i=i.concat(Object.keys(n).map(a=>{const s=n[a],l=Gw(a,s),c=l==="r",u=l==="x";return{options:s,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),nn(i,a=>{const s=a.options,l=s.id,c=Gw(l,s),u=st(s.type,a.dtype);(s.position===void 0||aO(s.position,c)!==aO(a.dposition))&&(s.position=a.dposition),o[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const h=Nr.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(s,t)}),nn(o,(a,s)=>{a||delete r[s]}),nn(r,a=>{_r.configure(this,a,a.options),_r.addBox(this,a)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((o,i)=>o.index-i.index),r>n){for(let o=n;o<r;++o)this._destroyDatasetMeta(o);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(sO("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,o)=>{n.filter(i=>i===r._dataset).length===0&&this._destroyDatasetMeta(o)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,o;for(this._removeUnreferencedMetasets(),r=0,o=n.length;r<o;r++){const i=n[r];let a=this.getDatasetMeta(r);const s=i.type||this.config.type;if(a.type&&a.type!==s&&(this._destroyDatasetMeta(r),a=this.getDatasetMeta(r)),a.type=s,a.indexAxis=i.indexAxis||qw(s,this.options),a.order=i.order||0,a.index=r,a.label=""+i.label,a.visible=this.isDatasetVisible(r),a.controller)a.controller.updateIndex(r),a.controller.linkScales();else{const l=Nr.getController(s),{datasetElementType:c,dataElementType:u}=An.datasets[s];Object.assign(l,{dataElementType:Nr.getElement(u),datasetElementType:c&&Nr.getElement(c)}),a.controller=new l(this,r),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){nn(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),o=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const i=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),h=!o&&i.indexOf(d)===-1;d.buildOrUpdateElements(h),a=Math.max(+d.getMaxOverflow(),a)}a=this._minPadding=r.layout.autoPadding?a:0,this._updateLayout(a),o||nn(i,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(sO("z","_idx"));const{_active:s,_lastEvent:l}=this;l?this._eventHandler(l,!0):s.length&&this._updateHoverStyles(s,s,!0),this.render()}_updateScales(){nn(this.scales,t=>{_r.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!y$(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:o,count:i}of n){const a=r==="_removeElements"?-i:i;Ate(t,o,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=i=>new Set(t.filter(a=>a[0]===i).map((a,s)=>s+","+a.splice(1).join(","))),o=r(0);for(let i=1;i<n;i++)if(!y$(o,r(i)))return;return Array.from(o).map(i=>i.split(",")).map(i=>({method:i[1],start:+i[2],count:+i[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;_r.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],nn(this.boxes,o=>{r&&o.position==="chartArea"||(o.configure&&o.configure(),this._layers.push(...o._layers()))},this),this._layers.forEach((o,i)=>{o._idx=i}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,zs(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),o={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",o)!==!1&&(r.controller._update(n),o.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",o))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(_a.has(this)?this.attached&&!_a.running(this)&&_a.start(this):(this.draw(),lO({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:o}=this._resizeBeforeDraw;this._resize(r,o),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let o,i;for(o=0,i=n.length;o<i;++o){const a=n[o];(!t||a.visible)&&r.push(a)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r=t._clip,o=!r.disabled,i=kte(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(o&&Wl(n,{left:r.left===!1?0:i.left-r.left,right:r.right===!1?this.width:i.right+r.right,top:r.top===!1?0:i.top-r.top,bottom:r.bottom===!1?this.height:i.bottom+r.bottom}),t.controller.draw(),o&&Ul(n),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return Ma(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,o){const i=Tee.modes[n];return typeof i=="function"?i(this,t,r,o):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let o=r.filter(i=>i&&i._dataset===n).pop();return o||(o={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(o)),o}getContext(){return this.$context||(this.$context=Xs(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const o=r?"show":"hide",i=this.getDatasetMeta(t),a=i.controller._resolveAnimations(void 0,o);sh(n)?(i.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),a.update(i,{visible:r}),this.update(s=>s.datasetIndex===t?o:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),_a.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),$$(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Qm[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(i,a)=>{n.addEventListener(this,i,a),t[i]=a},o=(i,a,s)=>{i.offsetX=a,i.offsetY=s,this._eventHandler(i)};nn(this.options.events,i=>r(i,o))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},o=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},i=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const s=()=>{o("attach",s),this.attached=!0,this.resize(),r("resize",i),r("detach",a)};a=()=>{this.attached=!1,o("resize",i),this._stop(),this._resize(0,0),r("attach",s)},n.isAttached(this.canvas)?s():a()}unbindEvents(){nn(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},nn(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const o=r?"set":"remove";let i,a,s,l;for(n==="dataset"&&(i=this.getDatasetMeta(t[0].datasetIndex),i.controller["_"+o+"DatasetHoverStyle"]()),s=0,l=t.length;s<l;++s){a=t[s];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[o+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:i,index:a})=>{const s=this.getDatasetMeta(i);if(!s)throw new Error("No dataset found at index "+i);return{datasetIndex:i,element:s.data[a],index:a}});!v0(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const o=this.options.hover,i=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),a=i(n,t),s=r?t:i(t,n);a.length&&this.updateHoverStyle(a,o.mode,!1),s.length&&o.mode&&this.updateHoverStyle(s,o.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},o=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,o)===!1)return;const i=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,o),(i||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:o=[],options:i}=this,a=n,s=this._getActiveElements(t,o,r,a),l=VJ(t),c=Mte(t,this._lastEvent,r,l);r&&(this._lastEvent=null,cn(i.onHover,[t,s,this],this),l&&cn(i.onClick,[t,s,this],this));const u=!v0(s,o);return(u||n)&&(this._active=s,this._updateHoverStyles(s,o,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,o){if(t.type==="mouseout")return[];if(!r)return n;const i=this.options.hover;return this.getElementsAtEventForMode(t,i.mode,i,o)}}Ne(Dn,"defaults",An),Ne(Dn,"instances",Qm),Ne(Dn,"overrides",ac),Ne(Dn,"registry",Nr),Ne(Dn,"version",Ote),Ne(Dn,"getChart",cO);function uO(){return nn(Dn.instances,e=>e._plugins.invalidate())}function Ite(e,t,n){const{startAngle:r,pixelMargin:o,x:i,y:a,outerRadius:s,innerRadius:l}=t;let c=o/s;e.beginPath(),e.arc(i,a,s,r-c,n+c),l>o?(c=o/l,e.arc(i,a,l,n+c,r-c,!0)):e.arc(i,a,o,n+Wn,r-Wn),e.closePath(),e.clip()}function Nte(e){return TC(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Lte(e,t,n,r){const o=Nte(e.options.borderRadius),i=(n-t)/2,a=Math.min(i,r*t/2),s=l=>{const c=(n-Math.min(i,l))*r/2;return rr(l,0,Math.min(i,c))};return{outerStart:s(o.outerStart),outerEnd:s(o.outerEnd),innerStart:rr(o.innerStart,0,a),innerEnd:rr(o.innerEnd,0,a)}}function Kc(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function E0(e,t,n,r,o,i){const{x:a,y:s,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-c,0),h=u>0?u+r+n+c:0;let p=0;const v=o-l;if(r){const A=u>0?u-r:0,U=d>0?d-r:0,V=(A+U)/2,K=V!==0?v*V/(V+r):v;p=(v-K)/2}const b=Math.max(.001,v*d-n/Cn)/d,x=(v-b)/2,y=l+x+p,_=o-x-p,{outerStart:S,outerEnd:C,innerStart:E,innerEnd:$}=Lte(t,h,d,_-y),T=d-S,D=d-C,M=y+S/T,L=_-C/D,F=h+E,z=h+$,X=y+E/F,G=_-$/z;if(e.beginPath(),i){const A=(M+L)/2;if(e.arc(a,s,d,M,A),e.arc(a,s,d,A,L),C>0){const q=Kc(D,L,a,s);e.arc(q.x,q.y,C,L,_+Wn)}const U=Kc(z,_,a,s);if(e.lineTo(U.x,U.y),$>0){const q=Kc(z,G,a,s);e.arc(q.x,q.y,$,_+Wn,G+Math.PI)}const V=(_-$/h+(y+E/h))/2;if(e.arc(a,s,h,_-$/h,V,!0),e.arc(a,s,h,V,y+E/h,!0),E>0){const q=Kc(F,X,a,s);e.arc(q.x,q.y,E,X+Math.PI,y-Wn)}const K=Kc(T,y,a,s);if(e.lineTo(K.x,K.y),S>0){const q=Kc(T,M,a,s);e.arc(q.x,q.y,S,y-Wn,M)}}else{e.moveTo(a,s);const A=Math.cos(M)*d+a,U=Math.sin(M)*d+s;e.lineTo(A,U);const V=Math.cos(L)*d+a,K=Math.sin(L)*d+s;e.lineTo(V,K)}e.closePath()}function Fte(e,t,n,r,o){const{fullCircles:i,startAngle:a,circumference:s}=t;let l=t.endAngle;if(i){E0(e,t,n,r,l,o);for(let c=0;c<i;++c)e.fill();isNaN(s)||(l=a+(s%Sn||Sn))}return E0(e,t,n,r,l,o),e.fill(),l}function jte(e,t,n,r,o){const{fullCircles:i,startAngle:a,circumference:s,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:h}=l,p=l.borderAlign==="inner";if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=h,p?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let v=t.endAngle;if(i){E0(e,t,n,r,v,o);for(let b=0;b<i;++b)e.stroke();isNaN(s)||(v=a+(s%Sn||Sn))}p&&Ite(e,t,v),i||(E0(e,t,n,r,v,o),e.stroke())}class fu extends ra{constructor(n){super();Ne(this,"circumference");Ne(this,"endAngle");Ne(this,"fullCircles");Ne(this,"innerRadius");Ne(this,"outerRadius");Ne(this,"pixelMargin");Ne(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,r,o){const i=this.getProps(["x","y"],o),{angle:a,distance:s}=V6(i,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],o),p=(this.options.spacing+this.options.borderWidth)/2,b=st(h,c-l)>=Sn||lh(a,l,c),x=Da(s,u+p,d+p);return b&&x}getCenterPoint(n){const{x:r,y:o,startAngle:i,endAngle:a,innerRadius:s,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,d=(i+a)/2,h=(s+l+u+c)/2;return{x:r+Math.cos(d)*h,y:o+Math.sin(d)*h}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:o}=this,i=(r.offset||0)/4,a=(r.spacing||0)/2,s=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=o>Sn?Math.floor(o/Sn):0,o===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*i,Math.sin(l)*i);const c=1-Math.sin(Math.min(Cn,o||0)),u=i*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,Fte(n,this,u,a,s),jte(n,this,u,a,s),n.restore()}}Ne(fu,"id","arc"),Ne(fu,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),Ne(fu,"defaultRoutes",{backgroundColor:"backgroundColor"}),Ne(fu,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function w3(e,t,n=t){e.lineCap=st(n.borderCapStyle,t.borderCapStyle),e.setLineDash(st(n.borderDash,t.borderDash)),e.lineDashOffset=st(n.borderDashOffset,t.borderDashOffset),e.lineJoin=st(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=st(n.borderWidth,t.borderWidth),e.strokeStyle=st(n.borderColor,t.borderColor)}function zte(e,t,n){e.lineTo(n.x,n.y)}function Bte(e){return e.stepped?uZ:e.tension||e.cubicInterpolationMode==="monotone"?dZ:zte}function _3(e,t,n={}){const r=e.length,{start:o=0,end:i=r-1}=n,{start:a,end:s}=t,l=Math.max(o,a),c=Math.min(i,s),u=o<a&&i<a||o>s&&i>s;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function Vte(e,t,n,r){const{points:o,options:i}=t,{count:a,start:s,loop:l,ilen:c}=_3(o,n,r),u=Bte(i);let{move:d=!0,reverse:h}=r||{},p,v,b;for(p=0;p<=c;++p)v=o[(s+(h?c-p:p))%a],!v.skip&&(d?(e.moveTo(v.x,v.y),d=!1):u(e,b,v,h,i.stepped),b=v);return l&&(v=o[(s+(h?c:0))%a],u(e,b,v,h,i.stepped)),!!l}function Hte(e,t,n,r){const o=t.points,{count:i,start:a,ilen:s}=_3(o,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,h,p,v,b,x,y;const _=C=>(a+(c?s-C:C))%i,S=()=>{b!==x&&(e.lineTo(u,x),e.lineTo(u,b),e.lineTo(u,y))};for(l&&(p=o[_(0)],e.moveTo(p.x,p.y)),h=0;h<=s;++h){if(p=o[_(h)],p.skip)continue;const C=p.x,E=p.y,$=C|0;$===v?(E<b?b=E:E>x&&(x=E),u=(d*u+C)/++d):(S(),e.lineTo(C,E),v=$,d=0,b=x=E),y=E}S()}function Yw(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Hte:Vte}function Wte(e){return e.stepped?HZ:e.tension||e.cubicInterpolationMode==="monotone"?WZ:xl}function Ute(e,t,n,r){let o=t._path;o||(o=t._path=new Path2D,t.path(o,n,r)&&o.closePath()),w3(e,t.options),e.stroke(o)}function qte(e,t,n,r){const{segments:o,options:i}=t,a=Yw(t);for(const s of o)w3(e,i,s.style),e.beginPath(),a(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const Gte=typeof Path2D=="function";function Yte(e,t,n,r){Gte&&!t.options.segment?Ute(e,t,n,r):qte(e,t,n,r)}class Ts extends ra{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const o=r.spanGaps?this._loop:this._fullLoop;IZ(this._points,r,t,o,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=XZ(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,o=t[n],i=this.points,a=l3(this,{property:n,start:o,end:o});if(!a.length)return;const s=[],l=Wte(r);let c,u;for(c=0,u=a.length;c<u;++c){const{start:d,end:h}=a[c],p=i[d],v=i[h];if(p===v){s.push(p);continue}const b=Math.abs((o-p[n])/(v[n]-p[n])),x=l(p,v,b,r.stepped);x[n]=t[n],s.push(x)}return s.length===1?s[0]:s}pathSegment(t,n,r){return Yw(this)(t,this,n,r)}path(t,n,r){const o=this.segments,i=Yw(this);let a=this._loop;n=n||0,r=r||this.points.length-n;for(const s of o)a&=i(t,this,s,{start:n,end:n+r-1});return!!a}draw(t,n,r,o){const i=this.options||{};(this.points||[]).length&&i.borderWidth&&(t.save(),Yte(t,this,r,o),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Ne(Ts,"id","line"),Ne(Ts,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Ne(Ts,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Ne(Ts,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function dO(e,t,n,r){const o=e.options,{[n]:i}=e.getProps([n],r);return Math.abs(t-i)<o.radius+o.hitRadius}class Yl extends ra{constructor(n){super();Ne(this,"parsed");Ne(this,"skip");Ne(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,o){const i=this.options,{x:a,y:s}=this.getProps(["x","y"],o);return Math.pow(n-a,2)+Math.pow(r-s,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(n,r){return dO(this,n,"x",r)}inYRange(n,r){return dO(this,n,"y",r)}getCenterPoint(n){const{x:r,y:o}=this.getProps(["x","y"],n);return{x:r,y:o}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const o=r&&n.borderWidth||0;return(r+o)*2}draw(n,r){const o=this.options;this.skip||o.radius<.1||!Ma(this,r,this.size(o)/2)||(n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.fillStyle=o.backgroundColor,_0(n,o,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}Ne(Yl,"id","point"),Ne(Yl,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Ne(Yl,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function S3(e,t){const{x:n,y:r,base:o,width:i,height:a}=e.getProps(["x","y","base","width","height"],t);let s,l,c,u,d;return e.horizontal?(d=a/2,s=Math.min(n,o),l=Math.max(n,o),c=r-d,u=r+d):(d=i/2,s=n-d,l=n+d,c=Math.min(r,o),u=Math.max(r,o)),{left:s,top:c,right:l,bottom:u}}function Ds(e,t,n,r){return e?0:rr(t,n,r)}function Kte(e,t,n){const r=e.options.borderWidth,o=e.borderSkipped,i=Q6(r);return{t:Ds(o.top,i.top,0,n),r:Ds(o.right,i.right,0,t),b:Ds(o.bottom,i.bottom,0,n),l:Ds(o.left,i.left,0,t)}}function Xte(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),o=e.options.borderRadius,i=ql(o),a=Math.min(t,n),s=e.borderSkipped,l=r||kt(o);return{topLeft:Ds(!l||s.top||s.left,i.topLeft,0,a),topRight:Ds(!l||s.top||s.right,i.topRight,0,a),bottomLeft:Ds(!l||s.bottom||s.left,i.bottomLeft,0,a),bottomRight:Ds(!l||s.bottom||s.right,i.bottomRight,0,a)}}function Qte(e){const t=S3(e),n=t.right-t.left,r=t.bottom-t.top,o=Kte(e,n/2,r/2),i=Xte(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:i},inner:{x:t.left+o.l,y:t.top+o.t,w:n-o.l-o.r,h:r-o.t-o.b,radius:{topLeft:Math.max(0,i.topLeft-Math.max(o.t,o.l)),topRight:Math.max(0,i.topRight-Math.max(o.t,o.r)),bottomLeft:Math.max(0,i.bottomLeft-Math.max(o.b,o.l)),bottomRight:Math.max(0,i.bottomRight-Math.max(o.b,o.r))}}}}function P1(e,t,n,r){const o=t===null,i=n===null,s=e&&!(o&&i)&&S3(e,r);return s&&(o||Da(t,s.left,s.right))&&(i||Da(n,s.top,s.bottom))}function Jte(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function Zte(e,t){e.rect(t.x,t.y,t.w,t.h)}function $1(e,t,n={}){const r=e.x!==n.x?-t:0,o=e.y!==n.y?-t:0,i=(e.x+e.w!==n.x+n.w?t:0)-r,a=(e.y+e.h!==n.y+n.h?t:0)-o;return{x:e.x+r,y:e.y+o,w:e.w+i,h:e.h+a,radius:e.radius}}class Kl extends ra{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:o}}=this,{inner:i,outer:a}=Qte(this),s=Jte(a.radius)?ch:Zte;t.save(),(a.w!==i.w||a.h!==i.h)&&(t.beginPath(),s(t,$1(a,n,i)),t.clip(),s(t,$1(i,-n,a)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),s(t,$1(i,n)),t.fillStyle=o,t.fill(),t.restore()}inRange(t,n,r){return P1(this,t,n,r)}inXRange(t,n){return P1(this,t,null,n)}inYRange(t,n){return P1(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:o,horizontal:i}=this.getProps(["x","y","base","horizontal"],t);return{x:i?(n+o)/2:n,y:i?r:(r+o)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}Ne(Kl,"id","bar"),Ne(Kl,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Ne(Kl,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var ene=Object.freeze({__proto__:null,ArcElement:fu,BarElement:Kl,LineElement:Ts,PointElement:Yl});const Kw=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],fO=Kw.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function C3(e){return Kw[e%Kw.length]}function E3(e){return fO[e%fO.length]}function tne(e,t){return e.borderColor=C3(t),e.backgroundColor=E3(t),++t}function nne(e,t){return e.backgroundColor=e.data.map(()=>C3(t++)),t}function rne(e,t){return e.backgroundColor=e.data.map(()=>E3(t++)),t}function one(e){let t=0;return(n,r)=>{const o=e.getDatasetMeta(r).controller;o instanceof Dl?t=nne(n,t):o instanceof Vf?t=rne(n,t):o&&(t=tne(n,t))}}function hO(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function ine(e){return e&&(e.borderColor||e.backgroundColor)}var ane={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:o}=e.config,{elements:i}=o;if(!n.forceOverride&&(hO(r)||ine(o)||i&&hO(i)))return;const a=one(e);r.forEach(a)}};function sne(e,t,n,r,o){const i=o.samples||r;if(i>=n)return e.slice(t,t+n);const a=[],s=(n-2)/(i-2);let l=0;const c=t+n-1;let u=t,d,h,p,v,b;for(a[l++]=e[u],d=0;d<i-2;d++){let x=0,y=0,_;const S=Math.floor((d+1)*s)+1+t,C=Math.min(Math.floor((d+2)*s)+1,n)+t,E=C-S;for(_=S;_<C;_++)x+=e[_].x,y+=e[_].y;x/=E,y/=E;const $=Math.floor(d*s)+1+t,T=Math.min(Math.floor((d+1)*s)+1,n)+t,{x:D,y:M}=e[u];for(p=v=-1,_=$;_<T;_++)v=.5*Math.abs((D-x)*(e[_].y-M)-(D-e[_].x)*(y-M)),v>p&&(p=v,h=e[_],b=_);a[l++]=h,u=b}return a[l++]=e[c],a}function lne(e,t,n,r){let o=0,i=0,a,s,l,c,u,d,h,p,v,b;const x=[],y=t+n-1,_=e[t].x,C=e[y].x-_;for(a=t;a<t+n;++a){s=e[a],l=(s.x-_)/C*r,c=s.y;const E=l|0;if(E===u)c<v?(v=c,d=a):c>b&&(b=c,h=a),o=(i*o+s.x)/++i;else{const $=a-1;if(!Tt(d)&&!Tt(h)){const T=Math.min(d,h),D=Math.max(d,h);T!==p&&T!==$&&x.push({...e[T],x:o}),D!==p&&D!==$&&x.push({...e[D],x:o})}a>0&&$!==p&&x.push(e[$]),x.push(s),u=E,i=0,v=b=c,d=h=p=a}}return x}function R3(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function pO(e){e.data.datasets.forEach(t=>{R3(t)})}function cne(e,t){const n=t.length;let r=0,o;const{iScale:i}=e,{min:a,max:s,minDefined:l,maxDefined:c}=i.getUserBounds();return l&&(r=rr(Aa(t,i.axis,a).lo,0,n-1)),c?o=rr(Aa(t,i.axis,s).hi+1,r,n)-r:o=n-r,{start:r,count:o}}var une={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){pO(e);return}const r=e.width;e.data.datasets.forEach((o,i)=>{const{_data:a,indexAxis:s}=o,l=e.getDatasetMeta(i),c=a||o.data;if(wn([s,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:h}=cne(l,c);const p=n.threshold||4*r;if(h<=p){R3(o);return}Tt(a)&&(o._data=c,delete o.data,Object.defineProperty(o,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(b){this._data=b}}));let v;switch(n.algorithm){case"lttb":v=sne(c,d,h,r,n);break;case"min-max":v=lne(c,d,h,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}o._decimated=v})},destroy(e){pO(e)}};function dne(e,t,n){const r=e.segments,o=e.points,i=t.points,a=[];for(const s of r){let{start:l,end:c}=s;c=LC(l,c,o);const u=Xw(n,o[l],o[c],s.loop);if(!t.segments){a.push({source:s,target:u,start:o[l],end:o[c]});continue}const d=l3(t,u);for(const h of d){const p=Xw(n,i[h.start],i[h.end],h.loop),v=s3(s,o,p);for(const b of v)a.push({source:b,target:h,start:{[n]:gO(u,p,"start",Math.max)},end:{[n]:gO(u,p,"end",Math.min)}})}}return a}function Xw(e,t,n,r){if(r)return;let o=t[e],i=n[e];return e==="angle"&&(o=xo(o),i=xo(i)),{property:e,start:o,end:i}}function fne(e,t){const{x:n=null,y:r=null}=e||{},o=t.points,i=[];return t.segments.forEach(({start:a,end:s})=>{s=LC(a,s,o);const l=o[a],c=o[s];r!==null?(i.push({x:l.x,y:r}),i.push({x:c.x,y:r})):n!==null&&(i.push({x:n,y:l.y}),i.push({x:n,y:c.y}))}),i}function LC(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function gO(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function P3(e,t){let n=[],r=!1;return _n(e)?(r=!0,n=e):n=fne(e,t),n.length?new Ts({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function mO(e){return e&&e.fill!==!1}function hne(e,t,n){let o=e[t].fill;const i=[t];let a;if(!n)return o;for(;o!==!1&&i.indexOf(o)===-1;){if(!Ln(o))return o;if(a=e[o],!a)return!1;if(a.visible)return o;i.push(o),o=a.fill}return!1}function pne(e,t,n){const r=vne(e);if(kt(r))return isNaN(r.value)?!1:r;let o=parseFloat(r);return Ln(o)&&Math.floor(o)===o?gne(r[0],t,o,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function gne(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function mne(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:kt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function bne(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:kt(e)?r=e.value:r=t.getBaseValue(),r}function vne(e){const t=e.options,n=t.fill;let r=st(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function yne(e){const{scale:t,index:n,line:r}=e,o=[],i=r.segments,a=r.points,s=xne(t,n);s.push(P3({x:null,y:t.bottom},r));for(let l=0;l<i.length;l++){const c=i[l];for(let u=c.start;u<=c.end;u++)wne(o,a[u],s)}return new Ts({points:o,options:{}})}function xne(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let o=0;o<r.length;o++){const i=r[o];if(i.index===t)break;i.hidden||n.unshift(i.dataset)}return n}function wne(e,t,n){const r=[];for(let o=0;o<n.length;o++){const i=n[o],{first:a,last:s,point:l}=_ne(i,t,"x");if(!(!l||a&&s)){if(a)r.unshift(l);else if(e.push(l),!s)break}}e.push(...r)}function _ne(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const o=r[n],i=e.segments,a=e.points;let s=!1,l=!1;for(let c=0;c<i.length;c++){const u=i[c],d=a[u.start][n],h=a[u.end][n];if(Da(o,d,h)){s=o===d,l=o===h;break}}return{first:s,last:l,point:r}}class $3{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:o,y:i,radius:a}=this;return n=n||{start:0,end:Sn},t.arc(o,i,a,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:o}=this,i=t.angle;return{x:n+Math.cos(i)*o,y:r+Math.sin(i)*o,angle:i}}}function Sne(e){const{chart:t,fill:n,line:r}=e;if(Ln(n))return Cne(t,n);if(n==="stack")return yne(e);if(n==="shape")return!0;const o=Ene(e);return o instanceof $3?o:P3(o,r)}function Cne(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function Ene(e){return(e.scale||{}).getPointPositionForValue?Pne(e):Rne(e)}function Rne(e){const{scale:t={},fill:n}=e,r=mne(n,t);if(Ln(r)){const o=t.isHorizontal();return{x:o?r:null,y:o?null:r}}return null}function Pne(e){const{scale:t,fill:n}=e,r=t.options,o=t.getLabels().length,i=r.reverse?t.max:t.min,a=bne(n,t,i),s=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,i);return new $3({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(a)})}for(let l=0;l<o;++l)s.push(t.getPointPositionForValue(l,a));return s}function O1(e,t,n){const r=Sne(t),{line:o,scale:i,axis:a}=t,s=o.options,l=s.fill,c=s.backgroundColor,{above:u=c,below:d=c}=l||{};r&&o.points.length&&(Wl(e,n),$ne(e,{line:o,target:r,above:u,below:d,area:n,scale:i,axis:a}),Ul(e))}function $ne(e,t){const{line:n,target:r,above:o,below:i,area:a,scale:s}=t,l=n._loop?"angle":t.axis;e.save(),l==="x"&&i!==o&&(bO(e,r,a.top),vO(e,{line:n,target:r,color:o,scale:s,property:l}),e.restore(),e.save(),bO(e,r,a.bottom)),vO(e,{line:n,target:r,color:i,scale:s,property:l}),e.restore()}function bO(e,t,n){const{segments:r,points:o}=t;let i=!0,a=!1;e.beginPath();for(const s of r){const{start:l,end:c}=s,u=o[l],d=o[LC(l,c,o)];i?(e.moveTo(u.x,u.y),i=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),a=!!t.pathSegment(e,s,{move:a}),a?e.closePath():e.lineTo(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function vO(e,t){const{line:n,target:r,property:o,color:i,scale:a}=t,s=dne(n,r,o);for(const{source:l,target:c,start:u,end:d}of s){const{style:{backgroundColor:h=i}={}}=l,p=r!==!0;e.save(),e.fillStyle=h,One(e,a,p&&Xw(o,u,d)),e.beginPath();const v=!!n.pathSegment(e,l);let b;if(p){v?e.closePath():yO(e,r,d,o);const x=!!r.pathSegment(e,c,{move:v,reverse:!0});b=v&&x,b||yO(e,r,u,o)}e.closePath(),e.fill(b?"evenodd":"nonzero"),e.restore()}}function One(e,t,n){const{top:r,bottom:o}=t.chart.chartArea,{property:i,start:a,end:s}=n||{};i==="x"&&(e.beginPath(),e.rect(a,r,s-a,o-r),e.clip())}function yO(e,t,n,r){const o=t.interpolate(n,r);o&&e.lineTo(o.x,o.y)}var Tne={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,o=[];let i,a,s,l;for(a=0;a<r;++a)i=e.getDatasetMeta(a),s=i.dataset,l=null,s&&s.options&&s instanceof Ts&&(l={visible:e.isDatasetVisible(a),index:a,fill:pne(s,a,r),chart:e,axis:i.controller.options.indexAxis,scale:i.vScale,line:s}),i.$filler=l,o.push(l);for(a=0;a<r;++a)l=o[a],!(!l||l.fill===!1)&&(l.fill=hne(o,a,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",o=e.getSortedVisibleDatasetMetas(),i=e.chartArea;for(let a=o.length-1;a>=0;--a){const s=o[a].$filler;s&&(s.line.updateControlPoints(i,s.axis),r&&s.fill&&O1(e.ctx,s,i))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let o=r.length-1;o>=0;--o){const i=r[o].$filler;mO(i)&&O1(e.ctx,i,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!mO(r)||n.drawTime!=="beforeDatasetDraw"||O1(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const xO=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},Dne=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class wO extends ra{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=cn(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,o)=>t.sort(r,o,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,o=qn(r.font),i=o.size,a=this._computeTitleHeight(),{boxWidth:s,itemHeight:l}=xO(r,i);let c,u;n.font=o.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(a,i,s,l)+10):(u=this.maxHeight,c=this._fitCols(a,o,s,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,o){const{ctx:i,maxWidth:a,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=o+s;let d=t;i.textAlign="left",i.textBaseline="middle";let h=-1,p=-u;return this.legendItems.forEach((v,b)=>{const x=r+n/2+i.measureText(v.text).width;(b===0||c[c.length-1]+x+2*s>a)&&(d+=u,c[c.length-(b>0?0:1)]=0,p+=u,h++),l[b]={left:0,top:p,row:h,width:x,height:o},c[c.length-1]+=x+s}),d}_fitCols(t,n,r,o){const{ctx:i,maxHeight:a,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=a-t;let d=s,h=0,p=0,v=0,b=0;return this.legendItems.forEach((x,y)=>{const{itemWidth:_,itemHeight:S}=Ane(r,n,i,x,o);y>0&&p+S+2*s>u&&(d+=h+s,c.push({width:h,height:p}),v+=h+s,b++,h=p=0),l[y]={left:v,top:p,col:b,width:_,height:S},h=Math.max(h,_),p+=S+s}),d+=h,c.push({width:h,height:p}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:o},rtl:i}}=this,a=wu(i,this.left,this.width);if(this.isHorizontal()){let s=0,l=wr(r,this.left+o,this.right-this.lineWidths[s]);for(const c of n)s!==c.row&&(s=c.row,l=wr(r,this.left+o,this.right-this.lineWidths[s])),c.top+=this.top+t+o,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+o}else{let s=0,l=wr(r,this.top+t+o,this.bottom-this.columnSizes[s].height);for(const c of n)c.col!==s&&(s=c.col,l=wr(r,this.top+t+o,this.bottom-this.columnSizes[s].height)),c.top=l,c.left+=this.left+o,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+o}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Wl(t,this),this._draw(),Ul(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:o}=this,{align:i,labels:a}=t,s=An.color,l=wu(t.rtl,this.left,this.width),c=qn(a.font),{padding:u}=a,d=c.size,h=d/2;let p;this.drawTitle(),o.textAlign=l.textAlign("left"),o.textBaseline="middle",o.lineWidth=.5,o.font=c.string;const{boxWidth:v,boxHeight:b,itemHeight:x}=xO(a,d),y=function($,T,D){if(isNaN(v)||v<=0||isNaN(b)||b<0)return;o.save();const M=st(D.lineWidth,1);if(o.fillStyle=st(D.fillStyle,s),o.lineCap=st(D.lineCap,"butt"),o.lineDashOffset=st(D.lineDashOffset,0),o.lineJoin=st(D.lineJoin,"miter"),o.lineWidth=M,o.strokeStyle=st(D.strokeStyle,s),o.setLineDash(st(D.lineDash,[])),a.usePointStyle){const L={radius:b*Math.SQRT2/2,pointStyle:D.pointStyle,rotation:D.rotation,borderWidth:M},F=l.xPlus($,v/2),z=T+h;X6(o,L,F,z,a.pointStyleWidth&&v)}else{const L=T+Math.max((d-b)/2,0),F=l.leftForLtr($,v),z=ql(D.borderRadius);o.beginPath(),Object.values(z).some(X=>X!==0)?ch(o,{x:F,y:L,w:v,h:b,radius:z}):o.rect(F,L,v,b),o.fill(),M!==0&&o.stroke()}o.restore()},_=function($,T,D){sc(o,D.text,$,T+x/2,c,{strikethrough:D.hidden,textAlign:l.textAlign(D.textAlign)})},S=this.isHorizontal(),C=this._computeTitleHeight();S?p={x:wr(i,this.left+u,this.right-r[0]),y:this.top+u+C,line:0}:p={x:this.left+u,y:wr(i,this.top+C+u,this.bottom-n[0].height),line:0},o3(this.ctx,t.textDirection);const E=x+u;this.legendItems.forEach(($,T)=>{o.strokeStyle=$.fontColor,o.fillStyle=$.fontColor;const D=o.measureText($.text).width,M=l.textAlign($.textAlign||($.textAlign=a.textAlign)),L=v+h+D;let F=p.x,z=p.y;l.setWidth(this.width),S?T>0&&F+L+u>this.right&&(z=p.y+=E,p.line++,F=p.x=wr(i,this.left+u,this.right-r[p.line])):T>0&&z+E>this.bottom&&(F=p.x=F+n[p.line].width+u,p.line++,z=p.y=wr(i,this.top+C+u,this.bottom-n[p.line].height));const X=l.x(F);if(y(X,z,$),F=ZJ(M,F+v+h,S?F+L:this.right,t.rtl),_(l.x(F),z,$),S)p.x+=L+u;else if(typeof $.text!="string"){const G=c.lineHeight;p.y+=O3($,G)+u}else p.y+=E}),i3(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=qn(n.font),o=fr(n.padding);if(!n.display)return;const i=wu(t.rtl,this.left,this.width),a=this.ctx,s=n.position,l=r.size/2,c=o.top+l;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=wr(t.align,d,this.right-h);else{const v=this.columnSizes.reduce((b,x)=>Math.max(b,x.height),0);u=c+wr(t.align,this.top,this.bottom-v-t.labels.padding-this._computeTitleHeight())}const p=wr(s,d,d+h);a.textAlign=i.textAlign($C(s)),a.textBaseline="middle",a.strokeStyle=n.color,a.fillStyle=n.color,a.font=r.string,sc(a,n.text,p,u,r)}_computeTitleHeight(){const t=this.options.title,n=qn(t.font),r=fr(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,o,i;if(Da(t,this.left,this.right)&&Da(n,this.top,this.bottom)){for(i=this.legendHitBoxes,r=0;r<i.length;++r)if(o=i[r],Da(t,o.left,o.left+o.width)&&Da(n,o.top,o.top+o.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!Ine(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const o=this._hoveredItem,i=Dne(o,r);o&&!i&&cn(n.onLeave,[t,o,this],this),this._hoveredItem=r,r&&!i&&cn(n.onHover,[t,r,this],this)}else r&&cn(n.onClick,[t,r,this],this)}}function Ane(e,t,n,r,o){const i=Mne(r,e,t,n),a=kne(o,r,t.lineHeight);return{itemWidth:i,itemHeight:a}}function Mne(e,t,n,r){let o=e.text;return o&&typeof o!="string"&&(o=o.reduce((i,a)=>i.length>a.length?i:a)),t+n.size/2+r.measureText(o).width}function kne(e,t,n){let r=e;return typeof t.text!="string"&&(r=O3(t,n)),r}function O3(e,t){const n=e.text?e.text.length:0;return t*n}function Ine(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var Nne={id:"legend",_element:wO,start(e,t,n){const r=e.legend=new wO({ctx:e.ctx,options:n,chart:e});_r.configure(e,r,n),_r.addBox(e,r)},stop(e){_r.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;_r.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,o=n.chart;o.isDatasetVisible(r)?(o.hide(r),t.hidden=!0):(o.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:o,color:i,useBorderRadius:a,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=fr(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:i,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:o||c.textAlign,borderRadius:a&&(s||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};let FC=class extends ra{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const o=_n(r.text)?r.text.length:1;this._padding=fr(r.padding);const i=o*qn(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:o,right:i,options:a}=this,s=a.align;let l=0,c,u,d;return this.isHorizontal()?(u=wr(s,r,i),d=n+t,c=i-r):(a.position==="left"?(u=r+t,d=wr(s,o,n),l=Cn*-.5):(u=i-t,d=wr(s,n,o),l=Cn*.5),c=o-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=qn(n.font),i=r.lineHeight/2+this._padding.top,{titleX:a,titleY:s,maxWidth:l,rotation:c}=this._drawArgs(i);sc(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:$C(n.align),textBaseline:"middle",translation:[a,s]})}};function Lne(e,t){const n=new FC({ctx:e.ctx,options:t,chart:e});_r.configure(e,n,t),_r.addBox(e,n),e.titleBlock=n}var Fne={id:"title",_element:FC,start(e,t,n){Lne(e,n)},stop(e){const t=e.titleBlock;_r.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;_r.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Yg=new WeakMap;var jne={id:"subtitle",start(e,t,n){const r=new FC({ctx:e.ctx,options:n,chart:e});_r.configure(e,r,n),_r.addBox(e,r),Yg.set(e,r)},stop(e){_r.removeBox(e,Yg.get(e)),Yg.delete(e)},beforeUpdate(e,t,n){const r=Yg.get(e);_r.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Pf={average(e){if(!e.length)return!1;let t,n,r=0,o=0,i=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const s=a.tooltipPosition();r+=s.x,o+=s.y,++i}}return{x:r/i,y:o/i}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,o=Number.POSITIVE_INFINITY,i,a,s;for(i=0,a=e.length;i<a;++i){const l=e[i].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=Hw(t,c);u<o&&(o=u,s=l)}}if(s){const l=s.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Ti(e,t){return t&&(_n(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Sa(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
251
251
  `)>-1?e.split(`
252
- `):e}function zne(e,t){const{element:n,datasetIndex:r,index:o}=t,i=e.getDatasetMeta(r).controller,{label:a,value:s}=i.getLabelAndValue(o);return{chart:e,label:a,parsed:i.getParsed(o),raw:e.data.datasets[r].data[o],formattedValue:s,dataset:i.getDataset(),dataIndex:o,datasetIndex:r,element:n}}function _O(e,t){const n=e.chart.ctx,{body:r,footer:o,title:i}=e,{boxWidth:a,boxHeight:s}=t,l=qn(t.bodyFont),c=qn(t.titleFont),u=qn(t.footerFont),d=i.length,h=o.length,p=r.length,v=fr(t.padding);let b=v.height,x=0,y=r.reduce((C,E)=>C+E.before.length+E.lines.length+E.after.length,0);if(y+=e.beforeBody.length+e.afterBody.length,d&&(b+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),y){const C=t.displayColors?Math.max(s,l.lineHeight):l.lineHeight;b+=p*C+(y-p)*l.lineHeight+(y-1)*t.bodySpacing}h&&(b+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let _=0;const S=function(C){x=Math.max(x,n.measureText(C).width+_)};return n.save(),n.font=c.string,nn(e.title,S),n.font=l.string,nn(e.beforeBody.concat(e.afterBody),S),_=t.displayColors?a+2+t.boxPadding:0,nn(r,C=>{nn(C.before,S),nn(C.lines,S),nn(C.after,S)}),_=0,n.font=u.string,nn(e.footer,S),n.restore(),x+=v.width,{width:x,height:b}}function Bne(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function Vne(e,t,n,r){const{x:o,width:i}=r,a=n.caretSize+n.caretPadding;if(e==="left"&&o+i+a>t.width||e==="right"&&o-i-a<0)return!0}function Hne(e,t,n,r){const{x:o,width:i}=n,{width:a,chartArea:{left:s,right:l}}=e;let c="center";return r==="center"?c=o<=(s+l)/2?"left":"right":o<=i/2?c="left":o>=a-i/2&&(c="right"),Vne(c,e,t,n)&&(c="center"),c}function SO(e,t,n){const r=n.yAlign||t.yAlign||Bne(e,n);return{xAlign:n.xAlign||t.xAlign||Hne(e,t,n,r),yAlign:r}}function Wne(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function Une(e,t,n){let{y:r,height:o}=e;return t==="top"?r+=n:t==="bottom"?r-=o+n:r-=o/2,r}function CO(e,t,n,r){const{caretSize:o,caretPadding:i,cornerRadius:a}=e,{xAlign:s,yAlign:l}=n,c=o+i,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:p}=ql(a);let v=Wne(t,s);const b=Une(t,l,c);return l==="center"?s==="left"?v+=c:s==="right"&&(v-=c):s==="left"?v-=Math.max(u,h)+o:s==="right"&&(v+=Math.max(d,p)+o),{x:rr(v,0,r.width-t.width),y:rr(b,0,r.height-t.height)}}function Kg(e,t,n){const r=fr(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function EO(e){return Ti([],Sa(e))}function qne(e,t,n){return Xs(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function RO(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const T3={beforeTitle:va,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:va,beforeBody:va,beforeLabel:va,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return Tt(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:va,afterBody:va,beforeFooter:va,footer:va,afterFooter:va};function Yr(e,t,n,r){const o=e[t].call(n,r);return typeof o>"u"?T3[t].call(n,r):o}var Xx;let PO=(Xx=class extends ra{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),o=r.enabled&&n.options.animation&&r.animations,i=new c3(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=qne(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,o=Yr(r,"beforeTitle",this,t),i=Yr(r,"title",this,t),a=Yr(r,"afterTitle",this,t);let s=[];return s=Ti(s,Sa(o)),s=Ti(s,Sa(i)),s=Ti(s,Sa(a)),s}getBeforeBody(t,n){return EO(Yr(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,o=[];return nn(t,i=>{const a={before:[],lines:[],after:[]},s=RO(r,i);Ti(a.before,Sa(Yr(s,"beforeLabel",this,i))),Ti(a.lines,Yr(s,"label",this,i)),Ti(a.after,Sa(Yr(s,"afterLabel",this,i))),o.push(a)}),o}getAfterBody(t,n){return EO(Yr(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,o=Yr(r,"beforeFooter",this,t),i=Yr(r,"footer",this,t),a=Yr(r,"afterFooter",this,t);let s=[];return s=Ti(s,Sa(o)),s=Ti(s,Sa(i)),s=Ti(s,Sa(a)),s}_createItems(t){const n=this._active,r=this.chart.data,o=[],i=[],a=[];let s=[],l,c;for(l=0,c=n.length;l<c;++l)s.push(zne(this.chart,n[l]));return t.filter&&(s=s.filter((u,d,h)=>t.filter(u,d,h,r))),t.itemSort&&(s=s.sort((u,d)=>t.itemSort(u,d,r))),nn(s,u=>{const d=RO(t.callbacks,u);o.push(Yr(d,"labelColor",this,u)),i.push(Yr(d,"labelPointStyle",this,u)),a.push(Yr(d,"labelTextColor",this,u))}),this.labelColors=o,this.labelPointStyles=i,this.labelTextColors=a,this.dataPoints=s,s}update(t,n){const r=this.options.setContext(this.getContext()),o=this._active;let i,a=[];if(!o.length)this.opacity!==0&&(i={opacity:0});else{const s=Pf[r.position].call(this,o,this._eventPosition);a=this._createItems(r),this.title=this.getTitle(a,r),this.beforeBody=this.getBeforeBody(a,r),this.body=this.getBody(a,r),this.afterBody=this.getAfterBody(a,r),this.footer=this.getFooter(a,r);const l=this._size=_O(this,r),c=Object.assign({},s,l),u=SO(this.chart,r,c),d=CO(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,i={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:s.x,caretY:s.y}}this._tooltipItems=a,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,o){const i=this.getCaretPosition(t,r,o);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)}getCaretPosition(t,n,r){const{xAlign:o,yAlign:i}=this,{caretSize:a,cornerRadius:s}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=ql(s),{x:h,y:p}=t,{width:v,height:b}=n;let x,y,_,S,C,E;return i==="center"?(C=p+b/2,o==="left"?(x=h,y=x-a,S=C+a,E=C-a):(x=h+v,y=x+a,S=C-a,E=C+a),_=x):(o==="left"?y=h+Math.max(l,u)+a:o==="right"?y=h+v-Math.max(c,d)-a:y=this.caretX,i==="top"?(S=p,C=S-a,x=y-a,_=y+a):(S=p+b,C=S+a,x=y+a,_=y-a),E=S),{x1:x,x2:y,x3:_,y1:S,y2:C,y3:E}}drawTitle(t,n,r){const o=this.title,i=o.length;let a,s,l;if(i){const c=wu(r.rtl,this.x,this.width);for(t.x=Kg(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",a=qn(r.titleFont),s=r.titleSpacing,n.fillStyle=r.titleColor,n.font=a.string,l=0;l<i;++l)n.fillText(o[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s,l+1===i&&(t.y+=r.titleMarginBottom-s)}}_drawColorBox(t,n,r,o,i){const a=this.labelColors[r],s=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=i,u=qn(i.bodyFont),d=Kg(this,"left",i),h=o.x(d),p=l<u.lineHeight?(u.lineHeight-l)/2:0,v=n.y+p;if(i.usePointStyle){const b={radius:Math.min(c,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},x=o.leftForLtr(h,c)+c/2,y=v+l/2;t.strokeStyle=i.multiKeyBackground,t.fillStyle=i.multiKeyBackground,_0(t,b,x,y),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,_0(t,b,x,y)}else{t.lineWidth=kt(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const b=o.leftForLtr(h,c),x=o.leftForLtr(o.xPlus(h,1),c-2),y=ql(a.borderRadius);Object.values(y).some(_=>_!==0)?(t.beginPath(),t.fillStyle=i.multiKeyBackground,ch(t,{x:b,y:v,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),ch(t,{x,y:v+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=i.multiKeyBackground,t.fillRect(b,v,c,l),t.strokeRect(b,v,c,l),t.fillStyle=a.backgroundColor,t.fillRect(x,v+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:o}=this,{bodySpacing:i,bodyAlign:a,displayColors:s,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=qn(r.bodyFont);let h=d.lineHeight,p=0;const v=wu(r.rtl,this.x,this.width),b=function(D){n.fillText(D,v.x(t.x+p),t.y+h/2),t.y+=h+i},x=v.textAlign(a);let y,_,S,C,E,$,T;for(n.textAlign=a,n.textBaseline="middle",n.font=d.string,t.x=Kg(this,x,r),n.fillStyle=r.bodyColor,nn(this.beforeBody,b),p=s&&x!=="right"?a==="center"?c/2+u:c+2+u:0,C=0,$=o.length;C<$;++C){for(y=o[C],_=this.labelTextColors[C],n.fillStyle=_,nn(y.before,b),S=y.lines,s&&S.length&&(this._drawColorBox(n,t,C,v,r),h=Math.max(d.lineHeight,l)),E=0,T=S.length;E<T;++E)b(S[E]),h=d.lineHeight;nn(y.after,b)}p=0,h=d.lineHeight,nn(this.afterBody,b),t.y-=i}drawFooter(t,n,r){const o=this.footer,i=o.length;let a,s;if(i){const l=wu(r.rtl,this.x,this.width);for(t.x=Kg(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",a=qn(r.footerFont),n.fillStyle=r.footerColor,n.font=a.string,s=0;s<i;++s)n.fillText(o[s],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r.footerSpacing}}drawBackground(t,n,r,o){const{xAlign:i,yAlign:a}=this,{x:s,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:h,bottomLeft:p,bottomRight:v}=ql(o.cornerRadius);n.fillStyle=o.backgroundColor,n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.beginPath(),n.moveTo(s+d,l),a==="top"&&this.drawCaret(t,n,r,o),n.lineTo(s+c-h,l),n.quadraticCurveTo(s+c,l,s+c,l+h),a==="center"&&i==="right"&&this.drawCaret(t,n,r,o),n.lineTo(s+c,l+u-v),n.quadraticCurveTo(s+c,l+u,s+c-v,l+u),a==="bottom"&&this.drawCaret(t,n,r,o),n.lineTo(s+p,l+u),n.quadraticCurveTo(s,l+u,s,l+u-p),a==="center"&&i==="left"&&this.drawCaret(t,n,r,o),n.lineTo(s,l+d),n.quadraticCurveTo(s,l,s+d,l),n.closePath(),n.fill(),o.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,o=r&&r.x,i=r&&r.y;if(o||i){const a=Pf[t.position].call(this,this._active,this._eventPosition);if(!a)return;const s=this._size=_O(this,t),l=Object.assign({},a,this._size),c=SO(n,t,l),u=CO(t,l,c,n);(o._to!==u.x||i._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=s.width,this.height=s.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const o={width:this.width,height:this.height},i={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const a=fr(n.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&s&&(t.save(),t.globalAlpha=r,this.drawBackground(i,t,o,n),o3(t,n.textDirection),i.y+=a.top,this.drawTitle(i,t,n),this.drawBody(i,t,n),this.drawFooter(i,t,n),i3(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,o=t.map(({datasetIndex:s,index:l})=>{const c=this.chart.getDatasetMeta(s);if(!c)throw new Error("Cannot find a dataset at index "+s);return{datasetIndex:s,element:c.data[l],index:l}}),i=!v0(r,o),a=this._positionChanged(o,n);(i||a)&&(this._active=o,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const o=this.options,i=this._active||[],a=this._getActiveElements(t,i,n,r),s=this._positionChanged(a,t),l=n||!v0(a,i)||s;return l&&(this._active=a,(o.enabled||o.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,o){const i=this.options;if(t.type==="mouseout")return[];if(!o)return n.filter(s=>this.chart.data.datasets[s.datasetIndex]&&this.chart.getDatasetMeta(s.datasetIndex).controller.getParsed(s.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,i.mode,i,r);return i.reverse&&a.reverse(),a}_positionChanged(t,n){const{caretX:r,caretY:o,options:i}=this,a=Pf[i.position].call(this,t,n);return a!==!1&&(r!==a.x||o!==a.y)}},Ne(Xx,"positioners",Pf),Xx);var D3={id:"tooltip",_element:PO,positioners:Pf,afterInit(e,t,n){n&&(e.tooltip=new PO({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:T3},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Gne=Object.freeze({__proto__:null,Colors:ane,Decimation:une,Filler:Tne,Legend:Nne,SubTitle:jne,Title:Fne,Tooltip:D3});const Yne=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Kne(e,t,n,r){const o=e.indexOf(t);if(o===-1)return Yne(e,t,n,r);const i=e.lastIndexOf(t);return o!==i?n:o}const Xne=(e,t)=>e===null?null:rr(Math.round(e),0,t);function $O(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class R0 extends Qs{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:o,label:i}of n)r[o]===i&&r.splice(o,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(Tt(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:Kne(r,t,st(n,t),this._addedLabels),Xne(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:o}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(o=this.getLabels().length-1)),this.min=r,this.max=o}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,o=[];let i=this.getLabels();i=t===0&&n===i.length-1?i:i.slice(t,n+1),this._valueRange=Math.max(i.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let a=t;a<=n;a++)o.push({value:a});return o}getLabelForValue(t){return $O.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}Ne(R0,"id","category"),Ne(R0,"defaults",{ticks:{callback:$O}});function Qne(e,t){const n=[],{bounds:o,step:i,min:a,max:s,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=e,p=i||1,v=u-1,{min:b,max:x}=t,y=!Tt(a),_=!Tt(s),S=!Tt(c),C=(x-b)/(d+1);let E=w$((x-b)/v/p)*p,$,T,D,M;if(E<1e-14&&!y&&!_)return[{value:b},{value:x}];M=Math.ceil(x/E)-Math.floor(b/E),M>v&&(E=w$(M*E/v/p)*p),Tt(l)||($=Math.pow(10,l),E=Math.ceil(E*$)/$),o==="ticks"?(T=Math.floor(b/E)*E,D=Math.ceil(x/E)*E):(T=b,D=x),y&&_&&i&&qJ((s-a)/i,E/1e3)?(M=Math.round(Math.min((s-a)/E,u)),E=(s-a)/M,T=a,D=s):S?(T=y?a:T,D=_?s:D,M=c-1,E=(D-T)/M):(M=(D-T)/E,jf(M,Math.round(M),E/1e3)?M=Math.round(M):M=Math.ceil(M));const L=Math.max(_$(E),_$(T));$=Math.pow(10,Tt(l)?L:l),T=Math.round(T*$)/$,D=Math.round(D*$)/$;let F=0;for(y&&(h&&T!==a?(n.push({value:a}),T<a&&F++,jf(Math.round((T+F*E)*$)/$,a,OO(a,C,e))&&F++):T<a&&F++);F<M;++F){const z=Math.round((T+F*E)*$)/$;if(_&&z>s)break;n.push({value:z})}return _&&h&&D!==s?n.length&&jf(n[n.length-1].value,s,OO(s,C,e))?n[n.length-1].value=s:n.push({value:s}):(!_||D===s)&&n.push({value:D}),n}function OO(e,t,{horizontal:n,minRotation:r}){const o=mi(r),i=(n?Math.sin(o):Math.cos(o))||.001,a=.75*t*(""+e).length;return Math.min(t/i,a)}class P0 extends Qs{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return Tt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:o,max:i}=this;const a=l=>o=n?o:l,s=l=>i=r?i:l;if(t){const l=Wi(o),c=Wi(i);l<0&&c<0?s(0):l>0&&c>0&&a(0)}if(o===i){let l=i===0?1:Math.abs(i*.05);s(i+l),t||a(o-l)}this.min=o,this.max=i}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,o;return r?(o=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,o>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${o} ticks. Limiting to 1000.`),o=1e3)):(o=this.computeTickLimit(),n=n||11),n&&(o=Math.min(n,o)),o}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const o={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},i=this._range||this,a=Qne(o,i);return t.bounds==="ticks"&&B6(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const o=(r-n)/Math.max(t.length-1,1)/2;n-=o,r+=o}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return fp(t,this.chart.options.locale,this.options.ticks.format)}}class ed extends P0{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Ln(t)?t:0,this.max=Ln(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=mi(this.options.ticks.minRotation),o=(t?Math.sin(r):Math.cos(r))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,i.lineHeight/o))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Ne(ed,"id","linear"),Ne(ed,"defaults",{ticks:{callback:Vb.formatters.numeric}});const dh=e=>Math.floor(Os(e)),ml=(e,t)=>Math.pow(10,dh(e)+t);function TO(e){return e/Math.pow(10,dh(e))===1}function DO(e,t,n){const r=Math.pow(10,n),o=Math.floor(e/r);return Math.ceil(t/r)-o}function Jne(e,t){const n=t-e;let r=dh(n);for(;DO(e,t,r)>10;)r++;for(;DO(e,t,r)<10;)r--;return Math.min(r,dh(e))}function Zne(e,{min:t,max:n}){t=mo(e.min,t);const r=[],o=dh(t);let i=Jne(t,n),a=i<0?Math.pow(10,Math.abs(i)):1;const s=Math.pow(10,i),l=o>i?Math.pow(10,o):0,c=Math.round((t-l)*a)/a,u=Math.floor((t-l)/s/10)*s*10;let d=Math.floor((c-u)/Math.pow(10,i)),h=mo(e.min,Math.round((l+u+d*Math.pow(10,i))*a)/a);for(;h<n;)r.push({value:h,major:TO(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(i++,d=2,a=i>=0?1:a),h=Math.round((l+u+d*Math.pow(10,i))*a)/a;const p=mo(e.max,h);return r.push({value:p,major:TO(p),significand:d}),r}class td extends Qs{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=P0.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return Ln(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Ln(t)?Math.max(0,t):null,this.max=Ln(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Ln(this._userMin)&&(this.min=t===ml(this.min,0)?ml(this.min,-1):ml(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,o=this.max;const i=s=>r=t?r:s,a=s=>o=n?o:s;r===o&&(r<=0?(i(1),a(10)):(i(ml(r,-1)),a(ml(o,1)))),r<=0&&i(ml(o,-1)),o<=0&&a(ml(r,1)),this.min=r,this.max=o}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=Zne(n,this);return t.bounds==="ticks"&&B6(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":fp(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Os(t),this._valueRange=Os(this.max)-Os(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Os(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}Ne(td,"id","logarithmic"),Ne(td,"defaults",{ticks:{callback:Vb.formatters.logarithmic,major:{enabled:!0}}});function Qw(e){const t=e.ticks;if(t.display&&e.display){const n=fr(t.backdropPadding);return st(t.font&&t.font.size,An.font.size)+n.height}return 0}function ere(e,t,n){return n=_n(n)?n:[n],{w:cZ(e,t.string,n),h:n.length*t.lineHeight}}function AO(e,t,n,r,o){return e===r||e===o?{start:t-n/2,end:t+n/2}:e<r||e>o?{start:t-n,end:t}:{start:t,end:t+n}}function tre(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],o=[],i=e._pointLabels.length,a=e.options.pointLabels,s=a.centerPointLabels?Cn/i:0;for(let l=0;l<i;l++){const c=a.setContext(e.getPointLabelContext(l));o[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+o[l],s),d=qn(c.font),h=ere(e.ctx,d,e._pointLabels[l]);r[l]=h;const p=xo(e.getIndexAngle(l)+s),v=Math.round(RC(p)),b=AO(v,u.x,h.w,0,180),x=AO(v,u.y,h.h,90,270);nre(n,t,p,b,x)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=ire(e,r,o)}function nre(e,t,n,r,o){const i=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n));let s=0,l=0;r.start<t.l?(s=(t.l-r.start)/i,e.l=Math.min(e.l,t.l-s)):r.end>t.r&&(s=(r.end-t.r)/i,e.r=Math.max(e.r,t.r+s)),o.start<t.t?(l=(t.t-o.start)/a,e.t=Math.min(e.t,t.t-l)):o.end>t.b&&(l=(o.end-t.b)/a,e.b=Math.max(e.b,t.b+l))}function rre(e,t,n){const r=e.drawingArea,{extra:o,additionalAngle:i,padding:a,size:s}=n,l=e.getPointPosition(t,r+o+a,i),c=Math.round(RC(xo(l.angle+Wn))),u=lre(l.y,s.h,c),d=are(c),h=sre(l.x,s.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+s.w,bottom:u+s.h}}function ore(e,t){if(!t)return!0;const{left:n,top:r,right:o,bottom:i}=e;return!(Ma({x:n,y:r},t)||Ma({x:n,y:i},t)||Ma({x:o,y:r},t)||Ma({x:o,y:i},t))}function ire(e,t,n){const r=[],o=e._pointLabels.length,i=e.options,{centerPointLabels:a,display:s}=i.pointLabels,l={extra:Qw(i)/2,additionalAngle:a?Cn/o:0};let c;for(let u=0;u<o;u++){l.padding=n[u],l.size=t[u];const d=rre(e,u,l);r.push(d),s==="auto"&&(d.visible=ore(d,c),d.visible&&(c=d))}return r}function are(e){return e===0||e===180?"center":e<180?"left":"right"}function sre(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function lre(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function cre(e,t,n){const{left:r,top:o,right:i,bottom:a}=n,{backdropColor:s}=t;if(!Tt(s)){const l=ql(t.borderRadius),c=fr(t.backdropPadding);e.fillStyle=s;const u=r-c.left,d=o-c.top,h=i-r+c.width,p=a-o+c.height;Object.values(l).some(v=>v!==0)?(e.beginPath(),ch(e,{x:u,y:d,w:h,h:p,radius:l}),e.fill()):e.fillRect(u,d,h,p)}}function ure(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let o=t-1;o>=0;o--){const i=e._pointLabelItems[o];if(!i.visible)continue;const a=r.setContext(e.getPointLabelContext(o));cre(n,a,i);const s=qn(a.font),{x:l,y:c,textAlign:u}=i;sc(n,e._pointLabels[o],l,c+s.lineHeight/2,s,{color:a.color,textAlign:u,textBaseline:"middle"})}}function A3(e,t,n,r){const{ctx:o}=e;if(n)o.arc(e.xCenter,e.yCenter,t,0,Sn);else{let i=e.getPointPosition(0,t);o.moveTo(i.x,i.y);for(let a=1;a<r;a++)i=e.getPointPosition(a,t),o.lineTo(i.x,i.y)}}function dre(e,t,n,r,o){const i=e.ctx,a=t.circular,{color:s,lineWidth:l}=t;!a&&!r||!s||!l||n<0||(i.save(),i.strokeStyle=s,i.lineWidth=l,i.setLineDash(o.dash),i.lineDashOffset=o.dashOffset,i.beginPath(),A3(e,n,a,r),i.closePath(),i.stroke(),i.restore())}function fre(e,t,n){return Xs(e,{label:n,index:t,type:"pointLabel"})}class $f extends P0{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=fr(Qw(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=Ln(t)&&!isNaN(t)?t:0,this.max=Ln(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Qw(this.options))}generateTickLabels(t){P0.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const o=cn(this.options.pointLabels.callback,[n,r],this);return o||o===0?o:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?tre(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,o){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-o)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,o))}getIndexAngle(t){const n=Sn/(this._pointLabels.length||1),r=this.options.startAngle||0;return xo(t*n+mi(r))}getDistanceFromCenterForValue(t){if(Tt(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(Tt(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return fre(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const o=this.getIndexAngle(t)-Wn+r;return{x:Math.cos(o)*n+this.xCenter,y:Math.sin(o)*n+this.yCenter,angle:o}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:o,bottom:i}=this._pointLabelItems[t];return{left:n,top:r,right:o,bottom:i}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),A3(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:o,border:i}=n,a=this._pointLabels.length;let s,l,c;if(n.pointLabels.display&&ure(this,a),o.display&&this.ticks.forEach((u,d)=>{if(d!==0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),p=o.setContext(h),v=i.setContext(h);dre(this,p,l,a,v)}}),r.display){for(t.save(),s=a-1;s>=0;s--){const u=r.setContext(this.getPointLabelContext(s)),{color:d,lineWidth:h}=u;!h||!d||(t.lineWidth=h,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(s,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const o=this.getIndexAngle(0);let i,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(o),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((s,l)=>{if(l===0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=qn(c.font);if(i=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,a=t.measureText(s.label).width,t.fillStyle=c.backdropColor;const d=fr(c.backdropPadding);t.fillRect(-a/2-d.left,-i-u.size/2-d.top,a+d.width,u.size+d.height)}sc(t,s.label,0,-i,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}Ne($f,"id","radialLinear"),Ne($f,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Vb.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Ne($f,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Ne($f,"descriptors",{angleLines:{_fallback:"grid"}});const Wb={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},eo=Object.keys(Wb);function MO(e,t){return e-t}function kO(e,t){if(Tt(t))return null;const n=e._adapter,{parser:r,round:o,isoWeekday:i}=e._parseOpts;let a=t;return typeof r=="function"&&(a=r(a)),Ln(a)||(a=typeof r=="string"?n.parse(a,r):n.parse(a)),a===null?null:(o&&(a=o==="week"&&(Qu(i)||i===!0)?n.startOf(a,"isoWeek",i):n.startOf(a,o)),+a)}function IO(e,t,n,r){const o=eo.length;for(let i=eo.indexOf(e);i<o-1;++i){const a=Wb[eo[i]],s=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-t)/(s*a.size))<=r)return eo[i]}return eo[o-1]}function hre(e,t,n,r,o){for(let i=eo.length-1;i>=eo.indexOf(n);i--){const a=eo[i];if(Wb[a].common&&e._adapter.diff(o,r,a)>=t-1)return a}return eo[n?eo.indexOf(n):0]}function pre(e){for(let t=eo.indexOf(e)+1,n=eo.length;t<n;++t)if(Wb[eo[t]].common)return eo[t]}function NO(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:o}=PC(n,t),i=n[r]>=t?n[r]:n[o];e[i]=!0}}function gre(e,t,n,r){const o=e._adapter,i=+o.startOf(t[0].value,r),a=t[t.length-1].value;let s,l;for(s=i;s<=a;s=+o.add(s,1,r))l=n[s],l>=0&&(t[l].major=!0);return t}function LO(e,t,n){const r=[],o={},i=t.length;let a,s;for(a=0;a<i;++a)s=t[a],o[s]=a,r.push({value:s,major:!1});return i===0||!n?r:gre(e,r,o,n)}class fh extends Qs{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),o=this._adapter=new Eee._date(t.adapters.date);o.init(n),Ff(r.displayFormats,o.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:kO(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:o,max:i,minDefined:a,maxDefined:s}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(o=Math.min(o,c.min)),!s&&!isNaN(c.max)&&(i=Math.max(i,c.max))}(!a||!s)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),o=Ln(o)&&!isNaN(o)?o:+n.startOf(Date.now(),r),i=Ln(i)&&!isNaN(i)?i:+n.endOf(Date.now(),r)+1,this.min=Math.min(o,i-1),this.max=Math.max(o+1,i)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,o=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&o.length&&(this.min=this._userMin||o[0],this.max=this._userMax||o[o.length-1]);const i=this.min,a=this.max,s=XJ(o,i,a);return this._unit=n.unit||(r.autoSkip?IO(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):hre(this,s.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:pre(this._unit),this.initOffsets(o),t.reverse&&s.reverse(),LO(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,o,i;this.options.offset&&t.length&&(o=this.getDecimalForValue(t[0]),t.length===1?n=1-o:n=(this.getDecimalForValue(t[1])-o)/2,i=this.getDecimalForValue(t[t.length-1]),t.length===1?r=i:r=(i-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;n=rr(n,0,a),r=rr(r,0,a),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,o=this.options,i=o.time,a=i.unit||IO(i.minUnit,n,r,this._getLabelCapacity(n)),s=st(o.ticks.stepSize,1),l=a==="week"?i.isoWeekday:!1,c=Qu(l)||l===!0,u={};let d=n,h,p;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":a),t.diff(r,n,a)>1e5*s)throw new Error(n+" and "+r+" are too far apart with stepSize of "+s+" "+a);const v=o.ticks.source==="data"&&this.getDataTimestamps();for(h=d,p=0;h<r;h=+t.add(h,s,a),p++)NO(u,h,v);return(h===r||o.bounds==="ticks"||p===1)&&NO(u,h,v),Object.keys(u).sort(MO).map(b=>+b)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const o=this.options.time.displayFormats,i=this._unit,a=n||o[i];return this._adapter.format(t,a)}_tickFormatFunction(t,n,r,o){const i=this.options,a=i.ticks.callback;if(a)return cn(a,[t,n,r],this);const s=i.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&s[l],d=c&&s[c],h=r[n],p=c&&d&&h&&h.major;return this._adapter.format(t,o||(p?d:u))}generateTickLabels(t){let n,r,o;for(n=0,r=t.length;n<r;++n)o=t[n],o.label=this._tickFormatFunction(o.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,o=mi(this.isHorizontal()?n.maxRotation:n.minRotation),i=Math.cos(o),a=Math.sin(o),s=this._resolveTickFontOptions(0).size;return{w:r*i+s*a,h:r*a+s*i}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,o=r[n.unit]||r.millisecond,i=this._tickFormatFunction(t,0,LO(this,[t],this._majorUnit),o),a=this._getLabelSize(i),s=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return s>0?s:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const o=this.getMatchingVisibleMetas();if(this._normalized&&o.length)return this._cache.data=o[0].controller.getAllParsedValues(this);for(n=0,r=o.length;n<r;++n)t=t.concat(o[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const o=this.getLabels();for(n=0,r=o.length;n<r;++n)t.push(kO(this,o[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return W6(t.sort(MO))}}Ne(fh,"id","time"),Ne(fh,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Xg(e,t,n){let r=0,o=e.length-1,i,a,s,l;n?(t>=e[r].pos&&t<=e[o].pos&&({lo:r,hi:o}=Aa(e,"pos",t)),{pos:i,time:s}=e[r],{pos:a,time:l}=e[o]):(t>=e[r].time&&t<=e[o].time&&({lo:r,hi:o}=Aa(e,"time",t)),{time:i,pos:s}=e[r],{time:a,pos:l}=e[o]);const c=a-i;return c?s+(l-s)*(t-i)/c:s}class Jw extends fh{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Xg(n,this.min),this._tableRange=Xg(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,o=[],i=[];let a,s,l,c,u;for(a=0,s=t.length;a<s;++a)c=t[a],c>=n&&c<=r&&o.push(c);if(o.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(a=0,s=o.length;a<s;++a)u=o[a+1],l=o[a-1],c=o[a],Math.round((u+l)/2)!==c&&i.push({time:c,pos:a/(s-1)});return i}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((o,i)=>o-i)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(Xg(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Xg(this._table,r*this._tableRange+this._minPos,!0)}}Ne(Jw,"id","timeseries"),Ne(Jw,"defaults",fh.defaults);var mre=Object.freeze({__proto__:null,CategoryScale:R0,LinearScale:ed,LogarithmicScale:td,RadialLinearScale:$f,TimeScale:fh,TimeSeriesScale:Jw});const bre=[Cee,ene,Gne,mre];class Bs{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let o=0;o<this._n&&o<32;o++){const i=n[o],a=t+i,s=Math.abs(t)<Math.abs(i)?t-(a-i):i-(a-t);s&&(n[r++]=s),t=a}return n[r]=t,this._n=r+1,this}valueOf(){const t=this._partials;let n=this._n,r,o,i,a=0;if(n>0){for(a=t[--n];n>0&&(r=a,o=t[--n],a=r+o,i=o-(a-r),!i););n>0&&(i<0&&t[n-1]<0||i>0&&t[n-1]>0)&&(o=i*2,r=a+o,o==r-a&&(a=r))}return a}}function*vre(e){for(const t of e)yield*t}function M3(e){return Array.from(vre(e))}function hu(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var r=-1,o=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(o);++r<o;)i[r]=e+r*n;return i}var nt=1e-6,jC=1e-12,Ot=Math.PI,In=Ot/2,FO=Ot/4,Oo=Ot*2,kr=180/Ot,un=Ot/180,Vt=Math.abs,bd=Math.atan,Ki=Math.atan2,gt=Math.cos,Qg=Math.ceil,k3=Math.exp,$0=Math.log,T1=Math.pow,ut=Math.sin,Ko=Math.sign||function(e){return e>0?1:e<0?-1:0},jr=Math.sqrt,zC=Math.tan;function I3(e){return e>1?0:e<-1?Ot:Math.acos(e)}function Qo(e){return e>1?In:e<-1?-In:Math.asin(e)}function nr(){}function O0(e,t){e&&zO.hasOwnProperty(e.type)&&zO[e.type](e,t)}var jO={Feature:function(e,t){O0(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,o=n.length;++r<o;)O0(n[r].geometry,t)}},zO={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){Zw(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)Zw(n[r],t,0)},Polygon:function(e,t){BO(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)BO(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,o=n.length;++r<o;)O0(n[r],t)}};function Zw(e,t,n){var r=-1,o=e.length-n,i;for(t.lineStart();++r<o;)i=e[r],t.point(i[0],i[1],i[2]);t.lineEnd()}function BO(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)Zw(e[n],t,1);t.polygonEnd()}function Cl(e,t){e&&jO.hasOwnProperty(e.type)?jO[e.type](e,t):O0(e,t)}function e_(e){return[Ki(e[1],e[0]),Qo(e[2])]}function nd(e){var t=e[0],n=e[1],r=gt(n);return[r*gt(t),r*ut(t),ut(n)]}function Jg(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function T0(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function D1(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Zg(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function t_(e){var t=jr(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function n_(e,t){function n(r,o){return r=e(r,o),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,o){return r=t.invert(r,o),r&&e.invert(r[0],r[1])}),n}function r_(e,t){return Vt(e)>Ot&&(e-=Math.round(e/Oo)*Oo),[e,t]}r_.invert=r_;function N3(e,t,n){return(e%=Oo)?t||n?n_(HO(e),WO(t,n)):HO(e):t||n?WO(t,n):r_}function VO(e){return function(t,n){return t+=e,Vt(t)>Ot&&(t-=Math.round(t/Oo)*Oo),[t,n]}}function HO(e){var t=VO(e);return t.invert=VO(-e),t}function WO(e,t){var n=gt(e),r=ut(e),o=gt(t),i=ut(t);function a(s,l){var c=gt(l),u=gt(s)*c,d=ut(s)*c,h=ut(l),p=h*n+u*r;return[Ki(d*o-p*i,u*n-h*r),Qo(p*o+d*i)]}return a.invert=function(s,l){var c=gt(l),u=gt(s)*c,d=ut(s)*c,h=ut(l),p=h*o-d*i;return[Ki(d*o+h*i,u*n+p*r),Qo(p*n-u*r)]},a}function yre(e){e=N3(e[0]*un,e[1]*un,e.length>2?e[2]*un:0);function t(n){return n=e(n[0]*un,n[1]*un),n[0]*=kr,n[1]*=kr,n}return t.invert=function(n){return n=e.invert(n[0]*un,n[1]*un),n[0]*=kr,n[1]*=kr,n},t}function xre(e,t,n,r,o,i){if(n){var a=gt(t),s=ut(t),l=r*n;o==null?(o=t+r*Oo,i=t-l/2):(o=UO(a,o),i=UO(a,i),(r>0?o<i:o>i)&&(o+=r*Oo));for(var c,u=o;r>0?u>i:u<i;u-=l)c=e_([a,-s*gt(u),-s*ut(u)]),e.point(c[0],c[1])}}function UO(e,t){t=nd(t),t[0]-=e,t_(t);var n=I3(-t[1]);return((-t[2]<0?-n:n)+Oo-nt)%Oo}function L3(){var e=[],t;return{point:function(n,r,o){t.push([n,r,o])},lineStart:function(){e.push(t=[])},lineEnd:nr,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Jm(e,t){return Vt(e[0]-t[0])<nt&&Vt(e[1]-t[1])<nt}function em(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function F3(e,t,n,r,o){var i=[],a=[],s,l;if(e.forEach(function(v){if(!((b=v.length-1)<=0)){var b,x=v[0],y=v[b],_;if(Jm(x,y)){if(!x[2]&&!y[2]){for(o.lineStart(),s=0;s<b;++s)o.point((x=v[s])[0],x[1]);o.lineEnd();return}y[0]+=2*nt}i.push(_=new em(x,v,null,!0)),a.push(_.o=new em(x,null,_,!1)),i.push(_=new em(y,v,null,!1)),a.push(_.o=new em(y,null,_,!0))}}),!!i.length){for(a.sort(t),qO(i),qO(a),s=0,l=a.length;s<l;++s)a[s].e=n=!n;for(var c=i[0],u,d;;){for(var h=c,p=!0;h.v;)if((h=h.n)===c)return;u=h.z,o.lineStart();do{if(h.v=h.o.v=!0,h.e){if(p)for(s=0,l=u.length;s<l;++s)o.point((d=u[s])[0],d[1]);else r(h.x,h.n.x,1,o);h=h.n}else{if(p)for(u=h.p.z,s=u.length-1;s>=0;--s)o.point((d=u[s])[0],d[1]);else r(h.x,h.p.x,-1,o);h=h.p}h=h.o,u=h.z,p=!p}while(!h.v);o.lineEnd()}}}function qO(e){if(t=e.length){for(var t,n=0,r=e[0],o;++n<t;)r.n=o=e[n],o.p=r,r=o;r.n=o=e[0],o.p=r}}function A1(e){return Vt(e[0])<=Ot?e[0]:Ko(e[0])*((Vt(e[0])+Ot)%Oo-Ot)}function j3(e,t){var n=A1(t),r=t[1],o=ut(r),i=[ut(n),-gt(n),0],a=0,s=0,l=new Bs;o===1?r=In+nt:o===-1&&(r=-In-nt);for(var c=0,u=e.length;c<u;++c)if(h=(d=e[c]).length)for(var d,h,p=d[h-1],v=A1(p),b=p[1]/2+FO,x=ut(b),y=gt(b),_=0;_<h;++_,v=C,x=$,y=T,p=S){var S=d[_],C=A1(S),E=S[1]/2+FO,$=ut(E),T=gt(E),D=C-v,M=D>=0?1:-1,L=M*D,F=L>Ot,z=x*$;if(l.add(Ki(z*M*ut(L),y*T+z*gt(L))),a+=F?D+M*Oo:D,F^v>=n^C>=n){var X=T0(nd(p),nd(S));t_(X);var G=T0(i,X);t_(G);var A=(F^D>=0?-1:1)*Qo(G[2]);(r>A||r===A&&(X[0]||X[1]))&&(s+=F^D>=0?1:-1)}}return(a<-nt||a<nt&&l<-jC)^s&1}function z3(e,t,n,r){return function(o){var i=t(o),a=L3(),s=t(a),l=!1,c,u,d,h={point:p,lineStart:b,lineEnd:x,polygonStart:function(){h.point=y,h.lineStart=_,h.lineEnd=S,u=[],c=[]},polygonEnd:function(){h.point=p,h.lineStart=b,h.lineEnd=x,u=M3(u);var C=j3(c,r);u.length?(l||(o.polygonStart(),l=!0),F3(u,_re,C,n,o)):C&&(l||(o.polygonStart(),l=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),l&&(o.polygonEnd(),l=!1),u=c=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function p(C,E){e(C,E)&&o.point(C,E)}function v(C,E){i.point(C,E)}function b(){h.point=v,i.lineStart()}function x(){h.point=p,i.lineEnd()}function y(C,E){d.push([C,E]),s.point(C,E)}function _(){s.lineStart(),d=[]}function S(){y(d[0][0],d[0][1]),s.lineEnd();var C=s.clean(),E=a.result(),$,T=E.length,D,M,L;if(d.pop(),c.push(d),d=null,!!T){if(C&1){if(M=E[0],(D=M.length-1)>0){for(l||(o.polygonStart(),l=!0),o.lineStart(),$=0;$<D;++$)o.point((L=M[$])[0],L[1]);o.lineEnd()}return}T>1&&C&2&&E.push(E.pop().concat(E.shift())),u.push(E.filter(wre))}}return h}}function wre(e){return e.length>1}function _re(e,t){return((e=e.x)[0]<0?e[1]-In-nt:In-e[1])-((t=t.x)[0]<0?t[1]-In-nt:In-t[1])}const GO=z3(function(){return!0},Sre,Ere,[-Ot,-In]);function Sre(e){var t=NaN,n=NaN,r=NaN,o;return{lineStart:function(){e.lineStart(),o=1},point:function(i,a){var s=i>0?Ot:-Ot,l=Vt(i-t);Vt(l-Ot)<nt?(e.point(t,n=(n+a)/2>0?In:-In),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(s,n),e.point(i,n),o=0):r!==s&&l>=Ot&&(Vt(t-r)<nt&&(t-=r*nt),Vt(i-s)<nt&&(i-=s*nt),n=Cre(t,n,i,a),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(s,n),o=0),e.point(t=i,n=a),r=s},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-o}}}function Cre(e,t,n,r){var o,i,a=ut(e-n);return Vt(a)>nt?bd((ut(t)*(i=gt(r))*ut(n)-ut(r)*(o=gt(t))*ut(e))/(o*i*a)):(t+r)/2}function Ere(e,t,n,r){var o;if(e==null)o=n*In,r.point(-Ot,o),r.point(0,o),r.point(Ot,o),r.point(Ot,0),r.point(Ot,-o),r.point(0,-o),r.point(-Ot,-o),r.point(-Ot,0),r.point(-Ot,o);else if(Vt(e[0]-t[0])>nt){var i=e[0]<t[0]?Ot:-Ot;o=n*i/2,r.point(-i,o),r.point(0,o),r.point(i,o)}else r.point(t[0],t[1])}function Rre(e){var t=gt(e),n=2*un,r=t>0,o=Vt(t)>nt;function i(u,d,h,p){xre(p,e,n,h,u,d)}function a(u,d){return gt(u)*gt(d)>t}function s(u){var d,h,p,v,b;return{lineStart:function(){v=p=!1,b=1},point:function(x,y){var _=[x,y],S,C=a(x,y),E=r?C?0:c(x,y):C?c(x+(x<0?Ot:-Ot),y):0;if(!d&&(v=p=C)&&u.lineStart(),C!==p&&(S=l(d,_),(!S||Jm(d,S)||Jm(_,S))&&(_[2]=1)),C!==p)b=0,C?(u.lineStart(),S=l(_,d),u.point(S[0],S[1])):(S=l(d,_),u.point(S[0],S[1],2),u.lineEnd()),d=S;else if(o&&d&&r^C){var $;!(E&h)&&($=l(_,d,!0))&&(b=0,r?(u.lineStart(),u.point($[0][0],$[0][1]),u.point($[1][0],$[1][1]),u.lineEnd()):(u.point($[1][0],$[1][1]),u.lineEnd(),u.lineStart(),u.point($[0][0],$[0][1],3)))}C&&(!d||!Jm(d,_))&&u.point(_[0],_[1]),d=_,p=C,h=E},lineEnd:function(){p&&u.lineEnd(),d=null},clean:function(){return b|(v&&p)<<1}}}function l(u,d,h){var p=nd(u),v=nd(d),b=[1,0,0],x=T0(p,v),y=Jg(x,x),_=x[0],S=y-_*_;if(!S)return!h&&u;var C=t*y/S,E=-t*_/S,$=T0(b,x),T=Zg(b,C),D=Zg(x,E);D1(T,D);var M=$,L=Jg(T,M),F=Jg(M,M),z=L*L-F*(Jg(T,T)-1);if(!(z<0)){var X=jr(z),G=Zg(M,(-L-X)/F);if(D1(G,T),G=e_(G),!h)return G;var A=u[0],U=d[0],V=u[1],K=d[1],q;U<A&&(q=A,A=U,U=q);var O=U-A,H=Vt(O-Ot)<nt,Y=H||O<nt;if(!H&&K<V&&(q=V,V=K,K=q),Y?H?V+K>0^G[1]<(Vt(G[0]-A)<nt?V:K):V<=G[1]&&G[1]<=K:O>Ot^(A<=G[0]&&G[0]<=U)){var I=Zg(M,(-L+X)/F);return D1(I,T),[G,e_(I)]}}}function c(u,d){var h=r?e:Ot-e,p=0;return u<-h?p|=1:u>h&&(p|=2),d<-h?p|=4:d>h&&(p|=8),p}return z3(a,s,i,r?[0,-e]:[-Ot,e-Ot])}function Pre(e,t,n,r,o,i){var a=e[0],s=e[1],l=t[0],c=t[1],u=0,d=1,h=l-a,p=c-s,v;if(v=n-a,!(!h&&v>0)){if(v/=h,h<0){if(v<u)return;v<d&&(d=v)}else if(h>0){if(v>d)return;v>u&&(u=v)}if(v=o-a,!(!h&&v<0)){if(v/=h,h<0){if(v>d)return;v>u&&(u=v)}else if(h>0){if(v<u)return;v<d&&(d=v)}if(v=r-s,!(!p&&v>0)){if(v/=p,p<0){if(v<u)return;v<d&&(d=v)}else if(p>0){if(v>d)return;v>u&&(u=v)}if(v=i-s,!(!p&&v<0)){if(v/=p,p<0){if(v>d)return;v>u&&(u=v)}else if(p>0){if(v<u)return;v<d&&(d=v)}return u>0&&(e[0]=a+u*h,e[1]=s+u*p),d<1&&(t[0]=a+d*h,t[1]=s+d*p),!0}}}}}var Of=1e9,tm=-Of;function $re(e,t,n,r){function o(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function i(c,u,d,h){var p=0,v=0;if(c==null||(p=a(c,d))!==(v=a(u,d))||l(c,u)<0^d>0)do h.point(p===0||p===3?e:n,p>1?r:t);while((p=(p+d+4)%4)!==v);else h.point(u[0],u[1])}function a(c,u){return Vt(c[0]-e)<nt?u>0?0:3:Vt(c[0]-n)<nt?u>0?2:1:Vt(c[1]-t)<nt?u>0?1:0:u>0?3:2}function s(c,u){return l(c.x,u.x)}function l(c,u){var d=a(c,1),h=a(u,1);return d!==h?d-h:d===0?u[1]-c[1]:d===1?c[0]-u[0]:d===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,d=L3(),h,p,v,b,x,y,_,S,C,E,$,T={point:D,lineStart:z,lineEnd:X,polygonStart:L,polygonEnd:F};function D(A,U){o(A,U)&&u.point(A,U)}function M(){for(var A=0,U=0,V=p.length;U<V;++U)for(var K=p[U],q=1,O=K.length,H=K[0],Y,I,te=H[0],ce=H[1];q<O;++q)Y=te,I=ce,H=K[q],te=H[0],ce=H[1],I<=r?ce>r&&(te-Y)*(r-I)>(ce-I)*(e-Y)&&++A:ce<=r&&(te-Y)*(r-I)<(ce-I)*(e-Y)&&--A;return A}function L(){u=d,h=[],p=[],$=!0}function F(){var A=M(),U=$&&A,V=(h=M3(h)).length;(U||V)&&(c.polygonStart(),U&&(c.lineStart(),i(null,null,1,c),c.lineEnd()),V&&F3(h,s,A,i,c),c.polygonEnd()),u=c,h=p=v=null}function z(){T.point=G,p&&p.push(v=[]),E=!0,C=!1,_=S=NaN}function X(){h&&(G(b,x),y&&C&&d.rejoin(),h.push(d.result())),T.point=D,C&&u.lineEnd()}function G(A,U){var V=o(A,U);if(p&&v.push([A,U]),E)b=A,x=U,y=V,E=!1,V&&(u.lineStart(),u.point(A,U));else if(V&&C)u.point(A,U);else{var K=[_=Math.max(tm,Math.min(Of,_)),S=Math.max(tm,Math.min(Of,S))],q=[A=Math.max(tm,Math.min(Of,A)),U=Math.max(tm,Math.min(Of,U))];Pre(K,q,e,t,n,r)?(C||(u.lineStart(),u.point(K[0],K[1])),u.point(q[0],q[1]),V||u.lineEnd(),$=!1):V&&(u.lineStart(),u.point(A,U),$=!1)}_=A,S=U,C=V}return T}}var o_,i_,Zm,e0,rd={sphere:nr,point:nr,lineStart:Ore,lineEnd:nr,polygonStart:nr,polygonEnd:nr};function Ore(){rd.point=Dre,rd.lineEnd=Tre}function Tre(){rd.point=rd.lineEnd=nr}function Dre(e,t){e*=un,t*=un,i_=e,Zm=ut(t),e0=gt(t),rd.point=Are}function Are(e,t){e*=un,t*=un;var n=ut(t),r=gt(t),o=Vt(e-i_),i=gt(o),a=ut(o),s=r*a,l=e0*n-Zm*r*i,c=Zm*n+e0*r*i;o_.add(Ki(jr(s*s+l*l),c)),i_=e,Zm=n,e0=r}function Mre(e){return o_=new Bs,Cl(e,rd),+o_}var a_=[null,null],kre={type:"LineString",coordinates:a_};function s_(e,t){return a_[0]=e,a_[1]=t,Mre(kre)}var YO={Feature:function(e,t){return D0(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,o=n.length;++r<o;)if(D0(n[r].geometry,t))return!0;return!1}},KO={Sphere:function(){return!0},Point:function(e,t){return XO(e.coordinates,t)},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if(XO(n[r],t))return!0;return!1},LineString:function(e,t){return QO(e.coordinates,t)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if(QO(n[r],t))return!0;return!1},Polygon:function(e,t){return JO(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if(JO(n[r],t))return!0;return!1},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,o=n.length;++r<o;)if(D0(n[r],t))return!0;return!1}};function D0(e,t){return e&&KO.hasOwnProperty(e.type)?KO[e.type](e,t):!1}function XO(e,t){return s_(e,t)===0}function QO(e,t){for(var n,r,o,i=0,a=e.length;i<a;i++){if(r=s_(e[i],t),r===0||i>0&&(o=s_(e[i],e[i-1]),o>0&&n<=o&&r<=o&&(n+r-o)*(1-Math.pow((n-r)/o,2))<jC*o))return!0;n=r}return!1}function JO(e,t){return!!j3(e.map(Ire),B3(t))}function Ire(e){return e=e.map(B3),e.pop(),e}function B3(e){return[e[0]*un,e[1]*un]}function Nre(e,t){return(e&&YO.hasOwnProperty(e.type)?YO[e.type]:D0)(e,t)}function ZO(e,t,n){var r=hu(e,t-nt,n).concat(t);return function(o){return r.map(function(i){return[o,i]})}}function eT(e,t,n){var r=hu(e,t-nt,n).concat(t);return function(o){return r.map(function(i){return[i,o]})}}function V3(){var e,t,n,r,o,i,a,s,l=10,c=l,u=90,d=360,h,p,v,b,x=2.5;function y(){return{type:"MultiLineString",coordinates:_()}}function _(){return hu(Qg(r/u)*u,n,u).map(v).concat(hu(Qg(s/d)*d,a,d).map(b)).concat(hu(Qg(t/l)*l,e,l).filter(function(S){return Vt(S%u)>nt}).map(h)).concat(hu(Qg(i/c)*c,o,c).filter(function(S){return Vt(S%d)>nt}).map(p))}return y.lines=function(){return _().map(function(S){return{type:"LineString",coordinates:S}})},y.outline=function(){return{type:"Polygon",coordinates:[v(r).concat(b(a).slice(1),v(n).reverse().slice(1),b(s).reverse().slice(1))]}},y.extent=function(S){return arguments.length?y.extentMajor(S).extentMinor(S):y.extentMinor()},y.extentMajor=function(S){return arguments.length?(r=+S[0][0],n=+S[1][0],s=+S[0][1],a=+S[1][1],r>n&&(S=r,r=n,n=S),s>a&&(S=s,s=a,a=S),y.precision(x)):[[r,s],[n,a]]},y.extentMinor=function(S){return arguments.length?(t=+S[0][0],e=+S[1][0],i=+S[0][1],o=+S[1][1],t>e&&(S=t,t=e,e=S),i>o&&(S=i,i=o,o=S),y.precision(x)):[[t,i],[e,o]]},y.step=function(S){return arguments.length?y.stepMajor(S).stepMinor(S):y.stepMinor()},y.stepMajor=function(S){return arguments.length?(u=+S[0],d=+S[1],y):[u,d]},y.stepMinor=function(S){return arguments.length?(l=+S[0],c=+S[1],y):[l,c]},y.precision=function(S){return arguments.length?(x=+S,h=ZO(i,o,90),p=eT(t,e,x),v=ZO(s,a,90),b=eT(r,n,x),y):x},y.extentMajor([[-180,-90+nt],[180,90-nt]]).extentMinor([[-180,-80-nt],[180,80+nt]])}function Lre(){return V3()()}const l_=e=>e;var M1=new Bs,c_=new Bs,H3,W3,u_,d_,xs={point:nr,lineStart:nr,lineEnd:nr,polygonStart:function(){xs.lineStart=Fre,xs.lineEnd=zre},polygonEnd:function(){xs.lineStart=xs.lineEnd=xs.point=nr,M1.add(Vt(c_)),c_=new Bs},result:function(){var e=M1/2;return M1=new Bs,e}};function Fre(){xs.point=jre}function jre(e,t){xs.point=U3,H3=u_=e,W3=d_=t}function U3(e,t){c_.add(d_*e-u_*t),u_=e,d_=t}function zre(){U3(H3,W3)}const tT=xs;var od=1/0,A0=od,hh=-od,M0=hh,Bre={point:Vre,lineStart:nr,lineEnd:nr,polygonStart:nr,polygonEnd:nr,result:function(){var e=[[od,A0],[hh,M0]];return hh=M0=-(A0=od=1/0),e}};function Vre(e,t){e<od&&(od=e),e>hh&&(hh=e),t<A0&&(A0=t),t>M0&&(M0=t)}const k0=Bre;var f_=0,h_=0,Tf=0,I0=0,N0=0,pu=0,p_=0,g_=0,Df=0,q3,G3,ji,zi,pi={point:lc,lineStart:nT,lineEnd:rT,polygonStart:function(){pi.lineStart=Ure,pi.lineEnd=qre},polygonEnd:function(){pi.point=lc,pi.lineStart=nT,pi.lineEnd=rT},result:function(){var e=Df?[p_/Df,g_/Df]:pu?[I0/pu,N0/pu]:Tf?[f_/Tf,h_/Tf]:[NaN,NaN];return f_=h_=Tf=I0=N0=pu=p_=g_=Df=0,e}};function lc(e,t){f_+=e,h_+=t,++Tf}function nT(){pi.point=Hre}function Hre(e,t){pi.point=Wre,lc(ji=e,zi=t)}function Wre(e,t){var n=e-ji,r=t-zi,o=jr(n*n+r*r);I0+=o*(ji+e)/2,N0+=o*(zi+t)/2,pu+=o,lc(ji=e,zi=t)}function rT(){pi.point=lc}function Ure(){pi.point=Gre}function qre(){Y3(q3,G3)}function Gre(e,t){pi.point=Y3,lc(q3=ji=e,G3=zi=t)}function Y3(e,t){var n=e-ji,r=t-zi,o=jr(n*n+r*r);I0+=o*(ji+e)/2,N0+=o*(zi+t)/2,pu+=o,o=zi*e-ji*t,p_+=o*(ji+e),g_+=o*(zi+t),Df+=o*3,lc(ji=e,zi=t)}const oT=pi;function K3(e){this._context=e}K3.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Oo);break}}},result:nr};var m_=new Bs,k1,X3,Q3,Af,Mf,L0={point:nr,lineStart:function(){L0.point=Yre},lineEnd:function(){k1&&J3(X3,Q3),L0.point=nr},polygonStart:function(){k1=!0},polygonEnd:function(){k1=null},result:function(){var e=+m_;return m_=new Bs,e}};function Yre(e,t){L0.point=J3,X3=Af=e,Q3=Mf=t}function J3(e,t){Af-=e,Mf-=t,m_.add(jr(Af*Af+Mf*Mf)),Af=e,Mf=t}const iT=L0;let aT,F0,sT,lT;class cT{constructor(t){this._append=t==null?Z3:Kre(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==sT||this._append!==F0){const r=this._radius,o=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,sT=r,F0=this._append,lT=this._,this._=o}this._+=lT;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Z3(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Kre(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Z3;if(t!==aT){const n=10**t;aT=t,F0=function(o){let i=1;this._+=o[0];for(const a=o.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+o[i]}}return F0}function uT(e,t){let n=3,r=4.5,o,i;function a(s){return s&&(typeof r=="function"&&i.pointRadius(+r.apply(this,arguments)),Cl(s,o(i))),i.result()}return a.area=function(s){return Cl(s,o(tT)),tT.result()},a.measure=function(s){return Cl(s,o(iT)),iT.result()},a.bounds=function(s){return Cl(s,o(k0)),k0.result()},a.centroid=function(s){return Cl(s,o(oT)),oT.result()},a.projection=function(s){return arguments.length?(o=s==null?(e=null,l_):(e=s).stream,a):e},a.context=function(s){return arguments.length?(i=s==null?(t=null,new cT(n)):new K3(t=s),typeof r!="function"&&i.pointRadius(r),a):t},a.pointRadius=function(s){return arguments.length?(r=typeof s=="function"?s:(i.pointRadius(+s),+s),a):r},a.digits=function(s){if(!arguments.length)return n;if(s==null)n=null;else{const l=Math.floor(s);if(!(l>=0))throw new RangeError(`invalid digits: ${s}`);n=l}return t===null&&(i=new cT(n)),a},a.projection(e).digits(n).context(t)}function BC(e){return function(t){var n=new b_;for(var r in e)n[r]=e[r];return n.stream=t,n}}function b_(){}b_.prototype={constructor:b_,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function VC(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),Cl(n,e.stream(k0)),t(k0.result()),r!=null&&e.clipExtent(r),e}function HC(e,t,n){return VC(e,function(r){var o=t[1][0]-t[0][0],i=t[1][1]-t[0][1],a=Math.min(o/(r[1][0]-r[0][0]),i/(r[1][1]-r[0][1])),s=+t[0][0]+(o-a*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(i-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([s,l])},n)}function e7(e,t,n){return HC(e,[[0,0],t],n)}function t7(e,t,n){return VC(e,function(r){var o=+t,i=o/(r[1][0]-r[0][0]),a=(o-i*(r[1][0]+r[0][0]))/2,s=-i*r[0][1];e.scale(150*i).translate([a,s])},n)}function n7(e,t,n){return VC(e,function(r){var o=+t,i=o/(r[1][1]-r[0][1]),a=-i*r[0][0],s=(o-i*(r[1][1]+r[0][1]))/2;e.scale(150*i).translate([a,s])},n)}var dT=16,Xre=gt(30*un);function fT(e,t){return+t?Jre(e,t):Qre(e)}function Qre(e){return BC({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function Jre(e,t){function n(r,o,i,a,s,l,c,u,d,h,p,v,b,x){var y=c-r,_=u-o,S=y*y+_*_;if(S>4*t&&b--){var C=a+h,E=s+p,$=l+v,T=jr(C*C+E*E+$*$),D=Qo($/=T),M=Vt(Vt($)-1)<nt||Vt(i-d)<nt?(i+d)/2:Ki(E,C),L=e(M,D),F=L[0],z=L[1],X=F-r,G=z-o,A=_*X-y*G;(A*A/S>t||Vt((y*X+_*G)/S-.5)>.3||a*h+s*p+l*v<Xre)&&(n(r,o,i,a,s,l,F,z,M,C/=T,E/=T,$,b,x),x.point(F,z),n(F,z,M,C,E,$,c,u,d,h,p,v,b,x))}}return function(r){var o,i,a,s,l,c,u,d,h,p,v,b,x={point:y,lineStart:_,lineEnd:C,polygonStart:function(){r.polygonStart(),x.lineStart=E},polygonEnd:function(){r.polygonEnd(),x.lineStart=_}};function y(D,M){D=e(D,M),r.point(D[0],D[1])}function _(){d=NaN,x.point=S,r.lineStart()}function S(D,M){var L=nd([D,M]),F=e(D,M);n(d,h,u,p,v,b,d=F[0],h=F[1],u=D,p=L[0],v=L[1],b=L[2],dT,r),r.point(d,h)}function C(){x.point=y,r.lineEnd()}function E(){_(),x.point=$,x.lineEnd=T}function $(D,M){S(o=D,M),i=d,a=h,s=p,l=v,c=b,x.point=S}function T(){n(d,h,u,p,v,b,i,a,o,s,l,c,dT,r),x.lineEnd=C,C()}return x}}var Zre=BC({point:function(e,t){this.stream.point(e*un,t*un)}});function eoe(e){return BC({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function toe(e,t,n,r,o){function i(a,s){return a*=r,s*=o,[t+e*a,n-e*s]}return i.invert=function(a,s){return[(a-t)/e*r,(n-s)/e*o]},i}function hT(e,t,n,r,o,i){if(!i)return toe(e,t,n,r,o);var a=gt(i),s=ut(i),l=a*e,c=s*e,u=a/e,d=s/e,h=(s*n-a*t)/e,p=(s*t+a*n)/e;function v(b,x){return b*=r,x*=o,[l*b-c*x+t,n-c*b-l*x]}return v.invert=function(b,x){return[r*(u*b-d*x+h),o*(p-d*b-u*x)]},v}function Va(e){return r7(function(){return e})()}function r7(e){var t,n=150,r=480,o=250,i=0,a=0,s=0,l=0,c=0,u,d=0,h=1,p=1,v=null,b=GO,x=null,y,_,S,C=l_,E=.5,$,T,D,M,L;function F(A){return D(A[0]*un,A[1]*un)}function z(A){return A=D.invert(A[0],A[1]),A&&[A[0]*kr,A[1]*kr]}F.stream=function(A){return M&&L===A?M:M=Zre(eoe(u)(b($(C(L=A)))))},F.preclip=function(A){return arguments.length?(b=A,v=void 0,G()):b},F.postclip=function(A){return arguments.length?(C=A,x=y=_=S=null,G()):C},F.clipAngle=function(A){return arguments.length?(b=+A?Rre(v=A*un):(v=null,GO),G()):v*kr},F.clipExtent=function(A){return arguments.length?(C=A==null?(x=y=_=S=null,l_):$re(x=+A[0][0],y=+A[0][1],_=+A[1][0],S=+A[1][1]),G()):x==null?null:[[x,y],[_,S]]},F.scale=function(A){return arguments.length?(n=+A,X()):n},F.translate=function(A){return arguments.length?(r=+A[0],o=+A[1],X()):[r,o]},F.center=function(A){return arguments.length?(i=A[0]%360*un,a=A[1]%360*un,X()):[i*kr,a*kr]},F.rotate=function(A){return arguments.length?(s=A[0]%360*un,l=A[1]%360*un,c=A.length>2?A[2]%360*un:0,X()):[s*kr,l*kr,c*kr]},F.angle=function(A){return arguments.length?(d=A%360*un,X()):d*kr},F.reflectX=function(A){return arguments.length?(h=A?-1:1,X()):h<0},F.reflectY=function(A){return arguments.length?(p=A?-1:1,X()):p<0},F.precision=function(A){return arguments.length?($=fT(T,E=A*A),G()):jr(E)},F.fitExtent=function(A,U){return HC(F,A,U)},F.fitSize=function(A,U){return e7(F,A,U)},F.fitWidth=function(A,U){return t7(F,A,U)},F.fitHeight=function(A,U){return n7(F,A,U)};function X(){var A=hT(n,0,0,h,p,d).apply(null,t(i,a)),U=hT(n,r-A[0],o-A[1],h,p,d);return u=N3(s,l,c),T=n_(t,U),D=n_(u,T),$=fT(T,E),G()}function G(){return M=L=null,F}return function(){return t=e.apply(this,arguments),F.invert=t.invert&&z,X()}}function WC(e){var t=0,n=Ot/3,r=r7(e),o=r(t,n);return o.parallels=function(i){return arguments.length?r(t=i[0]*un,n=i[1]*un):[t*kr,n*kr]},o}function noe(e){var t=gt(e);function n(r,o){return[r*t,ut(o)/t]}return n.invert=function(r,o){return[r/t,Qo(o*t)]},n}function roe(e,t){var n=ut(e),r=(n+ut(t))/2;if(Vt(r)<nt)return noe(e);var o=1+n*(2*r-n),i=jr(o)/r;function a(s,l){var c=jr(o-2*r*ut(l))/r;return[c*ut(s*=r),i-c*gt(s)]}return a.invert=function(s,l){var c=i-l,u=Ki(s,Vt(c))*Ko(c);return c*r<0&&(u-=Ot*Ko(s)*Ko(c)),[u/r,Qo((o-(s*s+c*c)*r*r)/(2*r))]},a}function j0(){return WC(roe).scale(155.424).center([0,33.6442])}function o7(){return j0().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function ooe(e){var t=e.length;return{point:function(n,r){for(var o=-1;++o<t;)e[o].point(n,r)},sphere:function(){for(var n=-1;++n<t;)e[n].sphere()},lineStart:function(){for(var n=-1;++n<t;)e[n].lineStart()},lineEnd:function(){for(var n=-1;++n<t;)e[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<t;)e[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<t;)e[n].polygonEnd()}}}function ioe(){var e,t,n=o7(),r,o=j0().rotate([154,0]).center([-2,58.5]).parallels([55,65]),i,a=j0().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s,l,c={point:function(h,p){l=[h,p]}};function u(h){var p=h[0],v=h[1];return l=null,r.point(p,v),l||(i.point(p,v),l)||(s.point(p,v),l)}u.invert=function(h){var p=n.scale(),v=n.translate(),b=(h[0]-v[0])/p,x=(h[1]-v[1])/p;return(x>=.12&&x<.234&&b>=-.425&&b<-.214?o:x>=.166&&x<.234&&b>=-.214&&b<-.115?a:n).invert(h)},u.stream=function(h){return e&&t===h?e:e=ooe([n.stream(t=h),o.stream(h),a.stream(h)])},u.precision=function(h){return arguments.length?(n.precision(h),o.precision(h),a.precision(h),d()):n.precision()},u.scale=function(h){return arguments.length?(n.scale(h),o.scale(h*.35),a.scale(h),u.translate(n.translate())):n.scale()},u.translate=function(h){if(!arguments.length)return n.translate();var p=n.scale(),v=+h[0],b=+h[1];return r=n.translate(h).clipExtent([[v-.455*p,b-.238*p],[v+.455*p,b+.238*p]]).stream(c),i=o.translate([v-.307*p,b+.201*p]).clipExtent([[v-.425*p+nt,b+.12*p+nt],[v-.214*p-nt,b+.234*p-nt]]).stream(c),s=a.translate([v-.205*p,b+.212*p]).clipExtent([[v-.214*p+nt,b+.166*p+nt],[v-.115*p-nt,b+.234*p-nt]]).stream(c),d()},u.fitExtent=function(h,p){return HC(u,h,p)},u.fitSize=function(h,p){return e7(u,h,p)},u.fitWidth=function(h,p){return t7(u,h,p)},u.fitHeight=function(h,p){return n7(u,h,p)};function d(){return e=t=null,u}return u.scale(1070)}function i7(e){return function(t,n){var r=gt(t),o=gt(n),i=e(r*o);return i===1/0?[2,0]:[i*o*ut(t),i*ut(n)]}}function pp(e){return function(t,n){var r=jr(t*t+n*n),o=e(r),i=ut(o),a=gt(o);return[Ki(t*i,r*a),Qo(r&&n*i/r)]}}var a7=i7(function(e){return jr(2/(1+e))});a7.invert=pp(function(e){return 2*Qo(e/2)});function aoe(){return Va(a7).scale(124.75).clipAngle(180-.001)}var s7=i7(function(e){return(e=I3(e))&&e/ut(e)});s7.invert=pp(function(e){return e});function soe(){return Va(s7).scale(79.4188).clipAngle(180-.001)}function Ub(e,t){return[e,$0(zC((In+t)/2))]}Ub.invert=function(e,t){return[e,2*bd(k3(t))-In]};function loe(){return l7(Ub).scale(961/Oo)}function l7(e){var t=Va(e),n=t.center,r=t.scale,o=t.translate,i=t.clipExtent,a=null,s,l,c;t.scale=function(d){return arguments.length?(r(d),u()):r()},t.translate=function(d){return arguments.length?(o(d),u()):o()},t.center=function(d){return arguments.length?(n(d),u()):n()},t.clipExtent=function(d){return arguments.length?(d==null?a=s=l=c=null:(a=+d[0][0],s=+d[0][1],l=+d[1][0],c=+d[1][1]),u()):a==null?null:[[a,s],[l,c]]};function u(){var d=Ot*r(),h=t(yre(t.rotate()).invert([0,0]));return i(a==null?[[h[0]-d,h[1]-d],[h[0]+d,h[1]+d]]:e===Ub?[[Math.max(h[0]-d,a),s],[Math.min(h[0]+d,l),c]]:[[a,Math.max(h[1]-d,s)],[l,Math.min(h[1]+d,c)]])}return u()}function nm(e){return zC((In+e)/2)}function coe(e,t){var n=gt(e),r=e===t?ut(e):$0(n/gt(t))/$0(nm(t)/nm(e)),o=n*T1(nm(e),r)/r;if(!r)return Ub;function i(a,s){o>0?s<-In+nt&&(s=-In+nt):s>In-nt&&(s=In-nt);var l=o/T1(nm(s),r);return[l*ut(r*a),o-l*gt(r*a)]}return i.invert=function(a,s){var l=o-s,c=Ko(r)*jr(a*a+l*l),u=Ki(a,Vt(l))*Ko(l);return l*r<0&&(u-=Ot*Ko(a)*Ko(l)),[u/r,2*bd(T1(o/c,1/r))-In]},i}function uoe(){return WC(coe).scale(109.5).parallels([30,30])}function z0(e,t){return[e,t]}z0.invert=z0;function doe(){return Va(z0).scale(152.63)}function foe(e,t){var n=gt(e),r=e===t?ut(e):(n-gt(t))/(t-e),o=n/r+e;if(Vt(r)<nt)return z0;function i(a,s){var l=o-s,c=r*a;return[l*ut(c),o-l*gt(c)]}return i.invert=function(a,s){var l=o-s,c=Ki(a,Vt(l))*Ko(l);return l*r<0&&(c-=Ot*Ko(a)*Ko(l)),[c/r,o-Ko(r)*jr(a*a+l*l)]},i}function hoe(){return WC(foe).scale(131.154).center([0,13.9389])}var Hf=1.340264,Wf=-.081106,Uf=893e-6,qf=.003796,B0=jr(3)/2,poe=12;function c7(e,t){var n=Qo(B0*ut(t)),r=n*n,o=r*r*r;return[e*gt(n)/(B0*(Hf+3*Wf*r+o*(7*Uf+9*qf*r))),n*(Hf+Wf*r+o*(Uf+qf*r))]}c7.invert=function(e,t){for(var n=t,r=n*n,o=r*r*r,i=0,a,s,l;i<poe&&(s=n*(Hf+Wf*r+o*(Uf+qf*r))-t,l=Hf+3*Wf*r+o*(7*Uf+9*qf*r),n-=a=s/l,r=n*n,o=r*r*r,!(Vt(a)<jC));++i);return[B0*e*(Hf+3*Wf*r+o*(7*Uf+9*qf*r))/gt(n),Qo(ut(n)/B0)]};function goe(){return Va(c7).scale(177.158)}function u7(e,t){var n=gt(t),r=gt(e)*n;return[n*ut(e)/r,ut(t)/r]}u7.invert=pp(bd);function moe(){return Va(u7).scale(144.049).clipAngle(60)}function d7(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),t*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}d7.invert=function(e,t){var n=t,r=25,o;do{var i=n*n,a=i*i;n-=o=(n*(1.007226+i*(.015085+a*(-.044475+.028874*i-.005916*a)))-t)/(1.007226+i*(.015085*3+a*(-.044475*7+.028874*9*i-.005916*11*a)))}while(Vt(o)>nt&&--r>0);return[e/(.8707+(i=n*n)*(-.131979+i*(-.013791+i*i*i*(.003971-.001529*i)))),n]};function boe(){return Va(d7).scale(175.295)}function f7(e,t){return[gt(t)*ut(e),ut(t)]}f7.invert=pp(Qo);function voe(){return Va(f7).scale(249.5).clipAngle(90+nt)}function h7(e,t){var n=gt(t),r=1+gt(e)*n;return[n*ut(e)/r,ut(t)/r]}h7.invert=pp(function(e){return 2*bd(e)});function yoe(){return Va(h7).scale(250).clipAngle(142)}function p7(e,t){return[$0(zC((In+t)/2)),-e]}p7.invert=function(e,t){return[-t,2*bd(k3(e))-In]};function xoe(){var e=l7(p7),t=e.center,n=e.rotate;return e.center=function(r){return arguments.length?t([-r[1],r[0]]):(r=t(),[r[1],-r[0]])},e.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}function Xt(e){for(var t=e.length/6|0,n=new Array(t),r=0;r<t;)n[r]="#"+e.slice(r*6,++r*6);return n}function qb(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function UC(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function vd(){}var cc=.7,id=1/cc,_u="\\s*([+-]?\\d+)\\s*",ph="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ui="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",woe=/^#([0-9a-f]{3,8})$/,_oe=new RegExp(`^rgb\\(${_u},${_u},${_u}\\)$`),Soe=new RegExp(`^rgb\\(${Ui},${Ui},${Ui}\\)$`),Coe=new RegExp(`^rgba\\(${_u},${_u},${_u},${ph}\\)$`),Eoe=new RegExp(`^rgba\\(${Ui},${Ui},${Ui},${ph}\\)$`),Roe=new RegExp(`^hsl\\(${ph},${Ui},${Ui}\\)$`),Poe=new RegExp(`^hsla\\(${ph},${Ui},${Ui},${ph}\\)$`),pT={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};qb(vd,qC,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:gT,formatHex:gT,formatHex8:$oe,formatHsl:Ooe,formatRgb:mT,toString:mT});function gT(){return this.rgb().formatHex()}function $oe(){return this.rgb().formatHex8()}function Ooe(){return m7(this).formatHsl()}function mT(){return this.rgb().formatRgb()}function qC(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=woe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?bT(t):n===3?new Sr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?rm(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?rm(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=_oe.exec(e))?new Sr(t[1],t[2],t[3],1):(t=Soe.exec(e))?new Sr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Coe.exec(e))?rm(t[1],t[2],t[3],t[4]):(t=Eoe.exec(e))?rm(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Roe.exec(e))?xT(t[1],t[2]/100,t[3]/100,1):(t=Poe.exec(e))?xT(t[1],t[2]/100,t[3]/100,t[4]):pT.hasOwnProperty(e)?bT(pT[e]):e==="transparent"?new Sr(NaN,NaN,NaN,0):null}function bT(e){return new Sr(e>>16&255,e>>8&255,e&255,1)}function rm(e,t,n,r){return r<=0&&(e=t=n=NaN),new Sr(e,t,n,r)}function g7(e){return e instanceof vd||(e=qC(e)),e?(e=e.rgb(),new Sr(e.r,e.g,e.b,e.opacity)):new Sr}function gh(e,t,n,r){return arguments.length===1?g7(e):new Sr(e,t,n,r??1)}function Sr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}qb(Sr,gh,UC(vd,{brighter(e){return e=e==null?id:Math.pow(id,e),new Sr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?cc:Math.pow(cc,e),new Sr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Sr(Xl(this.r),Xl(this.g),Xl(this.b),V0(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:vT,formatHex:vT,formatHex8:Toe,formatRgb:yT,toString:yT}));function vT(){return`#${Al(this.r)}${Al(this.g)}${Al(this.b)}`}function Toe(){return`#${Al(this.r)}${Al(this.g)}${Al(this.b)}${Al((isNaN(this.opacity)?1:this.opacity)*255)}`}function yT(){const e=V0(this.opacity);return`${e===1?"rgb(":"rgba("}${Xl(this.r)}, ${Xl(this.g)}, ${Xl(this.b)}${e===1?")":`, ${e})`}`}function V0(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Xl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Al(e){return e=Xl(e),(e<16?"0":"")+e.toString(16)}function xT(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new gi(e,t,n,r)}function m7(e){if(e instanceof gi)return new gi(e.h,e.s,e.l,e.opacity);if(e instanceof vd||(e=qC(e)),!e)return new gi;if(e instanceof gi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),a=NaN,s=i-o,l=(i+o)/2;return s?(t===i?a=(n-r)/s+(n<r)*6:n===i?a=(r-t)/s+2:a=(t-n)/s+4,s/=l<.5?i+o:2-i-o,a*=60):s=l>0&&l<1?0:a,new gi(a,s,l,e.opacity)}function Doe(e,t,n,r){return arguments.length===1?m7(e):new gi(e,t,n,r??1)}function gi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}qb(gi,Doe,UC(vd,{brighter(e){return e=e==null?id:Math.pow(id,e),new gi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?cc:Math.pow(cc,e),new gi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new Sr(I1(e>=240?e-240:e+120,o,r),I1(e,o,r),I1(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new gi(wT(this.h),om(this.s),om(this.l),V0(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=V0(this.opacity);return`${e===1?"hsl(":"hsla("}${wT(this.h)}, ${om(this.s)*100}%, ${om(this.l)*100}%${e===1?")":`, ${e})`}`}}));function wT(e){return e=(e||0)%360,e<0?e+360:e}function om(e){return Math.max(0,Math.min(1,e||0))}function I1(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Aoe=Math.PI/180,Moe=180/Math.PI;var b7=-.14861,GC=1.78277,YC=-.29227,Gb=-.90649,mh=1.97294,_T=mh*Gb,ST=mh*GC,CT=GC*YC-Gb*b7;function koe(e){if(e instanceof Ql)return new Ql(e.h,e.s,e.l,e.opacity);e instanceof Sr||(e=g7(e));var t=e.r/255,n=e.g/255,r=e.b/255,o=(CT*r+_T*t-ST*n)/(CT+_T-ST),i=r-o,a=(mh*(n-o)-YC*i)/Gb,s=Math.sqrt(a*a+i*i)/(mh*o*(1-o)),l=s?Math.atan2(a,i)*Moe-120:NaN;return new Ql(l<0?l+360:l,s,o,e.opacity)}function Xi(e,t,n,r){return arguments.length===1?koe(e):new Ql(e,t,n,r??1)}function Ql(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}qb(Ql,Xi,UC(vd,{brighter(e){return e=e==null?id:Math.pow(id,e),new Ql(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?cc:Math.pow(cc,e),new Ql(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Aoe,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),o=Math.sin(e);return new Sr(255*(t+n*(b7*r+GC*o)),255*(t+n*(YC*r+Gb*o)),255*(t+n*(mh*r)),this.opacity)}}));function Ioe(e,t,n,r,o){var i=e*e,a=i*e;return((1-3*e+3*i-a)*t+(4-6*i+3*a)*n+(1+3*e+3*i-3*a)*r+a*o)/6}function Noe(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),o=e[r],i=e[r+1],a=r>0?e[r-1]:2*o-i,s=r<t-1?e[r+2]:2*i-o;return Ioe((n-r/t)*t,a,o,i,s)}}const KC=e=>()=>e;function v7(e,t){return function(n){return e+n*t}}function Loe(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)}}function Foe(e,t){var n=t-e;return n?v7(e,n>180||n<-180?n-360*Math.round(n/360):n):KC(isNaN(e)?t:e)}function joe(e){return(e=+e)==1?Su:function(t,n){return n-t?Loe(t,n,e):KC(isNaN(t)?n:t)}}function Su(e,t){var n=t-e;return n?v7(e,n):KC(isNaN(e)?t:e)}(function e(t){var n=joe(t);function r(o,i){var a=n((o=gh(o)).r,(i=gh(i)).r),s=n(o.g,i.g),l=n(o.b,i.b),c=Su(o.opacity,i.opacity);return function(u){return o.r=a(u),o.g=s(u),o.b=l(u),o.opacity=c(u),o+""}}return r.gamma=e,r})(1);function zoe(e){return function(t){var n=t.length,r=new Array(n),o=new Array(n),i=new Array(n),a,s;for(a=0;a<n;++a)s=gh(t[a]),r[a]=s.r||0,o[a]=s.g||0,i[a]=s.b||0;return r=e(r),o=e(o),i=e(i),s.opacity=1,function(l){return s.r=r(l),s.g=o(l),s.b=i(l),s+""}}}var Boe=zoe(Noe);function y7(e){return function t(n){n=+n;function r(o,i){var a=e((o=Xi(o)).h,(i=Xi(i)).h),s=Su(o.s,i.s),l=Su(o.l,i.l),c=Su(o.opacity,i.opacity);return function(u){return o.h=a(u),o.s=s(u),o.l=l(Math.pow(u,n)),o.opacity=c(u),o+""}}return r.gamma=t,r}(1)}y7(Foe);var XC=y7(Su);const hn=e=>Boe(e[e.length-1]);var Voe=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Xt);const Hoe=hn(Voe);var Woe=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Xt);const Uoe=hn(Woe);var qoe=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Xt);const Goe=hn(qoe);var Yoe=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Xt);const Koe=hn(Yoe);var Xoe=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Xt);const Qoe=hn(Xoe);var Joe=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Xt);const Zoe=hn(Joe);var eie=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Xt);const tie=hn(eie);var nie=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Xt);const rie=hn(nie);var oie=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Xt);const iie=hn(oie);var aie=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Xt);const sie=hn(aie);var lie=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Xt);const cie=hn(lie);var uie=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Xt);const die=hn(uie);var fie=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Xt);const hie=hn(fie);var pie=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Xt);const gie=hn(pie);var mie=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Xt);const bie=hn(mie);var vie=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Xt);const yie=hn(vie);var xie=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Xt);const wie=hn(xie);var _ie=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Xt);const Sie=hn(_ie);var Cie=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Xt);const Eie=hn(Cie);var Rie=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Xt);const Pie=hn(Rie);var $ie=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Xt);const Oie=hn($ie);var Tie=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Xt);const Die=hn(Tie);var Aie=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Xt);const Mie=hn(Aie);var kie=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Xt);const Iie=hn(kie);var Nie=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Xt);const Lie=hn(Nie);var Fie=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Xt);const jie=hn(Fie);var zie=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Xt);const Bie=hn(zie);function Vie(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-e*(35.34-e*(2381.73-e*(6402.7-e*(7024.72-e*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+e*(170.73+e*(52.82-e*(131.46-e*(176.58-e*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+e*(442.36-e*(2482.43-e*(6167.24-e*(6614.94-e*2475.67)))))))+")"}const Hie=XC(Xi(300,.5,0),Xi(-240,.5,1));var Wie=XC(Xi(-100,.75,.35),Xi(80,1.5,.8)),Uie=XC(Xi(260,.75,.35),Xi(80,1.5,.8)),im=Xi();function qie(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return im.h=360*e-100,im.s=1.5-1.5*t,im.l=.8-.9*t,im+""}var am=gh(),Gie=Math.PI/3,Yie=Math.PI*2/3;function Kie(e){var t;return e=(.5-e)*Math.PI,am.r=255*(t=Math.sin(e))*t,am.g=255*(t=Math.sin(e+Gie))*t,am.b=255*(t=Math.sin(e+Yie))*t,am+""}function Xie(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+e*(1172.33-e*(10793.56-e*(33300.12-e*(38394.49-e*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+e*(557.33+e*(1225.33-e*(3574.96-e*(1073.77+e*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+e*(3211.1-e*(15327.97-e*(27814-e*(22569.18-e*6838.66)))))))+")"}function Yb(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}const Qie=Yb(Xt("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var Jie=Yb(Xt("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Zie=Yb(Xt("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),eae=Yb(Xt("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function tae(e){return e}function nae(e){if(e==null)return tae;var t,n,r=e.scale[0],o=e.scale[1],i=e.translate[0],a=e.translate[1];return function(s,l){l||(t=n=0);var c=2,u=s.length,d=new Array(u);for(d[0]=(t+=s[0])*r+i,d[1]=(n+=s[1])*o+a;c<u;)d[c]=s[c],++c;return d}}function rae(e,t){for(var n,r=e.length,o=r-t;o<--r;)n=e[o],e[o++]=e[r],e[r]=n}function oae(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return ET(e,n)})}:ET(e,t)}function ET(e,t){var n=t.id,r=t.bbox,o=t.properties==null?{}:t.properties,i=iae(e,t);return n==null&&r==null?{type:"Feature",properties:o,geometry:i}:r==null?{type:"Feature",id:n,properties:o,geometry:i}:{type:"Feature",id:n,bbox:r,properties:o,geometry:i}}function iae(e,t){var n=nae(e.transform),r=e.arcs;function o(u,d){d.length&&d.pop();for(var h=r[u<0?~u:u],p=0,v=h.length;p<v;++p)d.push(n(h[p],p));u<0&&rae(d,v)}function i(u){return n(u)}function a(u){for(var d=[],h=0,p=u.length;h<p;++h)o(u[h],d);return d.length<2&&d.push(d[0]),d}function s(u){for(var d=a(u);d.length<4;)d.push(d[0]);return d}function l(u){return u.map(s)}function c(u){var d=u.type,h;switch(d){case"GeometryCollection":return{type:d,geometries:u.geometries.map(c)};case"Point":h=i(u.coordinates);break;case"MultiPoint":h=u.coordinates.map(i);break;case"LineString":h=a(u.arcs);break;case"MultiLineString":h=u.arcs.map(a);break;case"Polygon":h=l(u.arcs);break;case"MultiPolygon":h=u.arcs.map(l);break;default:return null}return{type:d,coordinates:h}}return c(t)}const Gf={geoAzimuthalEqualArea:aoe,geoAzimuthalEquidistant:soe,geoGnomonic:moe,geoOrthographic:voe,geoStereographic:yoe,geoEqualEarth:goe,geoAlbers:o7,geoAlbersUsa:ioe,geoConicConformal:uoe,geoConicEqualArea:j0,geoConicEquidistant:hoe,geoEquirectangular:doe,geoMercator:loe,geoTransverseMercator:xoe,geoNaturalEarth1:boe};Object.keys(Gf).forEach(e=>{Gf[`${e.charAt(3).toLowerCase()}${e.slice(4)}`]=Gf[e]});class wc extends Qs{constructor(t){super(t),this.outlineBounds=null,this.oldChartBounds=null,this.geoPath=uT()}init(t){t.position="chartArea",super.init(t),typeof t.projection=="function"?this.projection=t.projection:this.projection=(Gf[t.projection]||Gf.albersUsa)(),this.geoPath.projection(this.projection),this.outlineBounds=null,this.oldChartBounds=null}computeBounds(t){const n=uT(this.projection.fitWidth(1e3,t)).bounds(t),r=Math.ceil(n[1][1]-n[0][1]),o=Math.ceil(n[1][0]-n[0][0]),i=this.projection.translate();this.outlineBounds={width:o,height:r,aspectRatio:o/r,refScale:this.projection.scale(),refX:i[0],refY:i[1]}}updateBounds(){const t=this.chart.chartArea,n=this.outlineBounds;if(!n)return!1;const r=this.options.padding,o=typeof r=="number"?r:r.top,i=typeof r=="number"?r:r.left,a=typeof r=="number"?r:r.bottom,s=typeof r=="number"?r:r.right,l=t.right-t.left-i-s,c=t.bottom-t.top-o-a,u=this.oldChartBounds;this.oldChartBounds={chartWidth:l,chartHeight:c};const d=Math.min(l/n.width,c/n.height),h=n.width*d,p=n.height*d,v=(l-h)*.5+t.left+i,b=(c-p)*.5+t.top+o,x=this.options;return this.projection.scale(n.refScale*d*x.projectionScale).translate([d*n.refX+v+x.projectionOffset[0],d*n.refY+b+x.projectionOffset[1]]),!u||u.chartWidth!==this.oldChartBounds.chartWidth||u.chartHeight!==this.oldChartBounds.chartHeight}}wc.id="projection";wc.defaults={projection:"albersUsa",projectionScale:1,projectionOffset:[0,0],padding:0};wc.descriptors={_scriptable:e=>e!=="projection",_indexable:e=>e!=="projectionOffset"};const Kb={position:"chartArea",property:"value",grid:{z:1,drawOnChartArea:!1},ticks:{z:1},legend:{align:"right",position:"bottom-right",length:100,width:50,margin:8,indicatorWidth:10}};function aae(e){const{indicatorWidth:t,align:n,margin:r}=e,o=(typeof r=="number"?r:r.left)+(n==="right"?t:0),i=(typeof r=="number"?r:r.top)+(n==="bottom"?t:0),a=(typeof r=="number"?r:r.right)+(n==="left"?t:0),s=(typeof r=="number"?r:r.bottom)+(n==="top"?t:0);return{left:o,top:i,right:a,bottom:s}}function sae(e,t,n,r,o){const{indicatorWidth:i,align:a,position:s}=t,l=a==="top"||a==="bottom",c=(a==="left"?o.w:n)+(l?i:0),u=(a==="top"?o.h:r)+(l?0:i),d=aae(t);if(typeof s=="string")switch(s){case"top-left":return[d.left,d.top];case"top":return[(e.right-c)/2,d.top];case"left":return[d.left,(e.bottom-u)/2];case"top-right":return[e.right-c-d.right,d.top];case"bottom-right":return[e.right-c-d.right,e.bottom-u-d.bottom];case"bottom":return[(e.right-c)/2,e.bottom-u-d.bottom];case"bottom-left":return[d.left,e.bottom-u-d.bottom];default:return[e.right-c-d.right,(e.bottom-u)/2]}return[s.x,s.y]}class gu extends ed{constructor(){super(...arguments),this.legendSize={w:0,h:0}}init(t){t.position="chartArea",super.init(t),this.axis="r"}parse(t,n){return t&&typeof t[this.options.property]=="number"?t[this.options.property]:super.parse(t,n)}isHorizontal(){return this.options.legend.align==="top"||this.options.legend.align==="bottom"}_getNormalizedValue(t){return t==null||Number.isNaN(t)?null:(t-this._startValue)/this._valueRange}update(t,n,r){const o=Math.min(n,this.bottom==null?Number.POSITIVE_INFINITY:this.bottom),i=Math.min(t,this.right==null?Number.POSITIVE_INFINITY:this.right),a=this.options.legend,s=this.isHorizontal(),l=(p,v)=>p<1?v*p:p,c=Math.min(i,l(s?a.length:a.width,i))-(s?0:a.indicatorWidth),u=Math.min(o,l(s?a.width:a.length,o))-(s?a.indicatorWidth:0);this.legendSize={w:c,h:u},this.bottom=u,this.height=u,this.right=c,this.width=c;const d=this.options.position;this.options.position=this.options.legend.align;const h=super.update(c,u,r);return this.options.position=d,this.height=Math.min(u,this.height),this.width=Math.min(c,this.width),h}_computeLabelArea(){}draw(t){if(!this._isVisible())return;const n=sae(t,this.options.legend,this.width,this.height,this.legendSize),{ctx:r}=this;r.save(),r.translate(n[0],n[1]);const o=this.options.position;this.options.position=this.options.legend.align,super.draw({...t,bottom:this.height+10,right:this.width}),this.options.position=o;const{indicatorWidth:i}=this.options.legend;switch(this.options.legend.align){case"left":r.translate(this.legendSize.w,0);break;case"top":r.translate(0,this.legendSize.h);break;case"bottom":r.translate(0,-i);break;default:r.translate(-i,0);break}this._drawIndicator(),r.restore()}_drawIndicator(){}}class x7 extends td{constructor(){super(...arguments),this.legendSize={w:0,h:0}}init(t){gu.prototype.init.call(this,t)}parse(t,n){return gu.prototype.parse.call(this,t,n)}isHorizontal(){return this.options.legend.align==="top"||this.options.legend.align==="bottom"}_getNormalizedValue(t){return t==null||Number.isNaN(t)?null:(Math.log10(t)-this._startValue)/this._valueRange}update(t,n,r){return gu.prototype.update.call(this,t,n,r)}_computeLabelArea(){}draw(t){return gu.prototype.draw.call(this,t)}_drawIndicator(){}}const Oa={interpolateBlues:Die,interpolateBrBG:Hoe,interpolateBuGn:sie,interpolateBuPu:cie,interpolateCividis:Vie,interpolateCool:Uie,interpolateCubehelixDefault:Hie,interpolateGnBu:die,interpolateGreens:Mie,interpolateGreys:Iie,interpolateInferno:Zie,interpolateMagma:Jie,interpolateOrRd:hie,interpolateOranges:Bie,interpolatePRGn:Uoe,interpolatePiYG:Goe,interpolatePlasma:eae,interpolatePuBu:bie,interpolatePuBuGn:gie,interpolatePuOr:Koe,interpolatePuRd:yie,interpolatePurples:Lie,interpolateRainbow:qie,interpolateRdBu:Qoe,interpolateRdGy:Zoe,interpolateRdPu:wie,interpolateRdYlBu:tie,interpolateRdYlGn:rie,interpolateReds:jie,interpolateSinebow:Kie,interpolateSpectral:iie,interpolateTurbo:Xie,interpolateViridis:Qie,interpolateWarm:Wie,interpolateYlGn:Eie,interpolateYlGnBu:Sie,interpolateYlOrBr:Pie,interpolateYlOrRd:Oie};Object.keys(Oa).forEach(e=>{Oa[`${e.charAt(11).toLowerCase()}${e.slice(12)}`]=Oa[e],Oa[e.slice(11)]=Oa[e]});function w7(e,t){const n=1/t;if(e<=n)return 0;if(e>=1-n)return 1;for(let r=0;r<1;r+=n)if(e<r)return r-n/2;return e}const _7={interpolate:"blues",missing:"transparent",quantize:0};class Vs extends gu{get interpolate(){const t=this.options;return t?typeof t.interpolate=="function"?t.interpolate:Oa[t.interpolate]||Oa.blues:n=>`rgb(${n},${n},${n})`}getColorForValue(t){const n=this._getNormalizedValue(t);return n==null||Number.isNaN(n)?this.options.missing:this.getColor(n)}getColor(t){let n=t;return this.options.quantize>0&&(n=w7(n,this.options.quantize)),this.interpolate(n)}_drawIndicator(){const{indicatorWidth:t}=this.options.legend,n=this._reversePixels;if(this.isHorizontal()){const r=this.width;if(this.options.quantize>0){const o=r/this.options.quantize,i=n?a=>r-o-a:a=>a;for(let a=0;a<r;a+=o){const s=(a+o/2)/r;this.ctx.fillStyle=this.getColor(s),this.ctx.fillRect(i(a),0,o,t)}}else{const o=n?i=>r-1-i:i=>i;for(let i=0;i<r;i+=1)this.ctx.fillStyle=this.getColor((i+.5)/r),this.ctx.fillRect(o(i),0,1,t)}}else{const r=this.height;if(this.options.quantize>0){const o=r/this.options.quantize,i=n?a=>r-o-a:a=>a;for(let a=0;a<r;a+=o){const s=(a+o/2)/r;this.ctx.fillStyle=this.getColor(s),this.ctx.fillRect(0,i(a),t,o)}}else{const o=n?i=>r-1-i:i=>i;for(let i=0;i<r;i+=1)this.ctx.fillStyle=this.getColor((i+.5)/r),this.ctx.fillRect(0,o(i),t,1)}}}}Vs.id="color";Vs.defaults=or({},[ed.defaults,Kb,_7]);Vs.descriptors={_scriptable:e=>e!=="interpolate",_indexable:!1};class QC extends x7{constructor(){super(...arguments),this.interpolate=t=>`rgb(${t},${t},${t})`}init(t){super.init(t),typeof t.interpolate=="function"?this.interpolate=t.interpolate:this.interpolate=Oa[t.interpolate]||Oa.blues}getColorForValue(t){return Vs.prototype.getColorForValue.call(this,t)}getColor(t){let n=t;return this.options.quantize>0&&(n=w7(n,this.options.quantize)),this.interpolate(n)}_drawIndicator(){return Vs.prototype._drawIndicator.call(this)}}QC.id="colorLogarithmic";QC.defaults=or({},[td.defaults,Kb,_7]);QC.descriptors={_scriptable:e=>e!=="interpolate",_indexable:!1};const S7={missing:1,mode:"area",range:[2,20],legend:{align:"bottom",length:90,width:70,indicatorWidth:42}};class Hs extends gu{constructor(){super(...arguments),this._model=null}getSizeForValue(t){const n=this._getNormalizedValue(t);return n==null||Number.isNaN(n)?this.options.missing:this.getSizeImpl(n)}getSizeImpl(t){const[n,r]=this.options.range;if(this.options.mode==="area"){const i=r*r*Math.PI,a=n*n*Math.PI,s=i-a,l=t*s+a;return Math.sqrt(l/Math.PI)}const o=r-n;return t*o+n}_drawIndicator(){const{ctx:t}=this,n=this.options.legend.indicatorWidth/2,r=this.isHorizontal(),o=this.ticks,i=this.getLabelItems(),a=i?i.map(s=>({[r?"x":"y"]:s.options.translation[r?0:1]})):o.map((s,l)=>({[r?"x":"y"]:this.getPixelForTick(l)}));if((this._gridLineItems||[]).forEach(s=>{if(t.save(),t.strokeStyle=s.color,t.lineWidth=s.width,t.setLineDash&&(t.setLineDash(s.borderDash),t.lineDashOffset=s.borderDashOffset),t.beginPath(),this.options.grid.drawTicks)switch(this.options.legend.align){case"left":t.moveTo(0,s.ty1),t.lineTo(n,s.ty2);break;case"top":t.moveTo(s.tx1,0),t.lineTo(s.tx2,n);break;case"bottom":t.moveTo(s.tx1,n),t.lineTo(s.tx2,n*2);break;default:t.moveTo(n,s.ty1),t.lineTo(n*2,s.ty2);break}t.stroke(),t.restore()}),this._model){const s=this._model;t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth||0,t.fillStyle=s.backgroundColor}else t.fillStyle="blue";o.forEach((s,l)=>{const c=a[l],u=this.getSizeForValue(s.value),d=r?c.x:n,h=r?n:c.y,p={pointStyle:"circle",borderWidth:0,...this._model||{},radius:u};_0(t,p,d,h)})}}Hs.id="size";Hs.defaults=or({},[ed.defaults,Kb,S7]);Hs.descriptors={_scriptable:!0,_indexable:e=>e!=="range"};class C7 extends x7{constructor(){super(...arguments),this._model=null}getSizeForValue(t){const n=this._getNormalizedValue(t);return n==null||Number.isNaN(n)?this.options.missing:this.getSizeImpl(n)}getSizeImpl(t){return Hs.prototype.getSizeImpl.call(this,t)}_drawIndicator(){Hs.prototype._drawIndicator.call(this)}}C7.id="sizeLogarithmic";C7.defaults=or({},[td.defaults,Kb,S7]);function lae(e,t){return[[e[0][0]-t,e[0][1]-t],[e[1][0]+t,e[1][1]+t]]}class La extends ra{constructor(){super(...arguments),this.cache=void 0}inRange(t,n){const r=this.getBounds(),o=(Number.isNaN(t)||t>=r.x&&t<=r.x2)&&(Number.isNaN(n)||n>=r.y&&n<=r.y2),i=this.projectionScale.geoPath.projection();if(o&&!Number.isNaN(t)&&!Number.isNaN(n)&&typeof i.invert=="function"){const a=i.invert([t,n]);return a!=null&&Nre(this.feature,a)}return o}inXRange(t){return this.inRange(t,Number.NaN)}inYRange(t){return this.inRange(Number.NaN,t)}getCenterPoint(){if(this.cache&&this.cache.center)return this.cache.center;let t;if(this.center){const n=this.projectionScale.projection([this.center.longitude,this.center.latitude]);t={x:n[0],y:n[1]}}else{const n=this.projectionScale.geoPath.centroid(this.feature);t={x:n[0],y:n[1]}}return this.cache={...this.cache||{},center:t},t}getBounds(){if(this.cache&&this.cache.bounds)return this.cache.bounds;const t=lae(this.projectionScale.geoPath.bounds(this.feature),this.options.borderWidth/2),n={x:t[0][0],x2:t[1][0],y:t[0][1],y2:t[1][1],width:t[1][0]-t[0][0],height:t[1][1]-t[0][1]};return this.cache={...this.cache||{},bounds:n},n}_drawInCache(t){const n=this.getBounds();if(!Number.isFinite(n.x))return;const r=this.cache&&this.cache.canvas?this.cache.canvas:t.createElement("canvas"),o=Math.floor(n.x),i=Math.floor(n.y),a=Math.ceil(n.x+n.width),s=Math.ceil(n.y+n.height),l=this.pixelRatio||1,c=Math.ceil(Math.max(a-o,1)*l),u=Math.ceil(Math.max(s-i,1)*l);if(c<=0||u<=0)return;r.width=c,r.height=u;const d=r.getContext("2d");d&&(d.clearRect(0,0,r.width,r.height),d.save(),d.scale(l,l),d.translate(-o,-i),this._drawImpl(d),d.restore(),this.cache={...this.cache||{},canvas:r,canvasKey:this._optionsToKey()})}_optionsToKey(){const{options:t}=this;return`${t.backgroundColor};${t.borderColor};${t.borderWidth};${this.pixelRatio}`}_drawImpl(t){const{feature:n}=this,{options:r}=this;t.beginPath(),this.projectionScale.geoPath.context(t)(n),r.backgroundColor&&(t.fillStyle=r.backgroundColor,t.fill()),r.borderColor&&(t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.stroke())}draw(t){const{feature:n}=this;if(!n)return;(!this.cache||this.cache.canvasKey!==this._optionsToKey())&&t.canvas.ownerDocument!=null&&this._drawInCache(t.canvas.ownerDocument);const r=this.getBounds();if(this.cache&&this.cache.canvas&&this.cache.canvas.width>0&&this.cache.canvas.height>0){const o=Math.floor(r.x),i=Math.floor(r.y),a=Math.ceil(r.x+r.width),s=Math.ceil(r.y+r.height),l=a-o,c=s-i;l>0&&c>0&&t.drawImage(this.cache.canvas,o,i,a-o,s-i)}else Number.isFinite(r.x)&&(t.save(),this._drawImpl(t),t.restore())}}La.id="geoFeature";La.defaults={...Kl.defaults,outlineBackgroundColor:null,outlineBorderWidth:0,graticuleBorderColor:"#CCCCCC",graticuleBorderWidth:0};La.defaultRoutes={outlineBorderColor:"borderColor",...Kl.defaultRoutes||{}};const E7={showOutline:!1,showGraticule:!1,clipMap:!0},R7={scales:{projection:{axis:"x",type:wc.id,position:"chartArea",display:!1}}};function RT(e){const t={...e};return Object.keys(e).forEach(n=>{let r=n;if(n.startsWith("outline")){const o=n.slice(7);r=o[0].toLowerCase()+o.slice(1)}else if(n.startsWith("hoverOutline"))r=`hover${n.slice(12)}`;else return;delete t[n],t[r]=e[n]}),t}class P7 extends Xo{getGeoDataset(){return super.getDataset()}getGeoOptions(){return this.chart.options}getProjectionScale(){return this.getScaleForId("projection")}linkScales(){const t=this.getGeoDataset(),n=this.getMeta();n.xAxisID="projection",t.xAxisID="projection",n.yAxisID="projection",t.yAxisID="projection",n.xScale=this.getScaleForId("projection"),n.yScale=this.getScaleForId("projection"),this.getProjectionScale().computeBounds(this.resolveOutline())}showOutline(){return st(this.getGeoDataset().showOutline,this.getGeoOptions().showOutline)}clipMap(){return st(this.getGeoDataset().clipMap,this.getGeoOptions().clipMap)}getGraticule(){return st(this.getGeoDataset().showGraticule,this.getGeoOptions().showGraticule)}update(t){super.update(t);const n=this.getMeta(),r=this.getProjectionScale(),o=r.updateBounds();if(this.showOutline()){const i=n.dataset;if(o&&delete i.cache,i.projectionScale=r,i.pixelRatio=this.chart.currentDevicePixelRatio,t!=="resize"){const a=RT(this.resolveDatasetElementOptions(t)),s={feature:this.resolveOutline(),options:a};this.updateElement(i,void 0,s,t),this.getGraticule()&&(n.graticule=a)}}else this.getGraticule()&&t!=="resize"&&(n.graticule=RT(this.resolveDatasetElementOptions(t)));this.updateElements(n.data,0,n.data.length,t),o&&n.data.forEach(i=>delete i.cache)}resolveOutline(){const n=this.getGeoDataset().outline||{type:"Sphere"};return Array.isArray(n)?{type:"FeatureCollection",features:n}:n}showGraticule(){const t=this.getGraticule(),n=this.getMeta().graticule;if(!t||!n)return;const{ctx:r}=this.chart,i=this.getProjectionScale().geoPath.context(r);if(r.save(),r.beginPath(),typeof t=="boolean")t&&i(Lre());else{const a=V3();t.stepMajor&&a.stepMajor(t.stepMajor),t.stepMinor&&a.stepMinor(t.stepMinor),i(a())}r.strokeStyle=n.graticuleBorderColor,r.lineWidth=n.graticuleBorderWidth,r.stroke(),r.restore()}draw(){const{chart:t}=this,n=this.clipMap();let r=!1;(n===!0||n==="outline"||n==="outline+graticule")&&(r=!0,Wl(t.ctx,t.chartArea)),this.showOutline()&&this.getMeta().dataset&&this.getMeta().dataset.draw.call(this.getMeta().dataset,t.ctx,t.chartArea),n===!0||n==="graticule"||n==="outline+graticule"?r||Wl(t.ctx,t.chartArea):r&&(r=!1,Ul(t.ctx)),this.showGraticule(),n===!0||n==="items"?r||Wl(t.ctx,t.chartArea):r&&(r=!1,Ul(t.ctx)),this.getMeta().data.forEach(o=>o.draw.call(o,t.ctx,t.chartArea)),r&&(r=!1,Ul(t.ctx))}}function $7(e,t,n,r=[],o=[]){Nr.addControllers(n),Array.isArray(r)?Nr.addElements(...r):Nr.addElements(r),Array.isArray(o)?Nr.addScales(...o):Nr.addScales(o);const i=t;return i.type=e,i}class yd extends P7{initialize(){super.initialize(),this.enableOptionSharing=!0}linkScales(){super.linkScales();const t=this.getGeoDataset(),n=this.getMeta();n.vAxisID="color",n.rAxisID="color",t.vAxisID="color",t.rAxisID="color",n.rScale=this.getScaleForId("color"),n.vScale=n.rScale,n.iScale=n.xScale,n.iAxisID=n.xAxisID,t.iAxisID=n.xAxisID}_getOtherScale(t){return t}parse(t,n){const r=this.getMeta().rScale,{data:o}=this.getDataset(),i=this._cachedMeta;for(let a=t;a<t+n;a+=1)i._parsed[a]={[r.axis]:r.parse(o[a],a)}}updateElements(t,n,r,o){const i=this.resolveDataElementOptions(n,o),a=this.getSharedOptions(i),s=this.includeOptions(o,a),l=this.getProjectionScale();this.updateSharedOptions(a,o,i);for(let c=n;c<n+r;c+=1){const u=t[c];u.projectionScale=l,u.feature=this._data[c].feature,u.center=this._data[c].center,u.pixelRatio=this.chart.currentDevicePixelRatio;const d=u.getCenterPoint(),h={x:d.x,y:d.y};s&&(h.options=a||this.resolveDataElementOptions(c,o)),this.updateElement(u,c,h,o)}}indexToColor(t){const n=this.getMeta().rScale;return n.getColorForValue(this.getParsed(t)[n.axis])}}yd.id="choropleth";yd.defaults=or({},[E7,{datasetElementType:La.id,dataElementType:La.id}]);yd.overrides=or({},[R7,{plugins:{tooltip:{callbacks:{title(){return""},label(e){var t,n,r,o;return e.formattedValue==null?(n=(t=e.chart.data)===null||t===void 0?void 0:t.labels)===null||n===void 0?void 0:n[e.dataIndex]:`${(o=(r=e.chart.data)===null||r===void 0?void 0:r.labels)===null||o===void 0?void 0:o[e.dataIndex]}: ${e.formattedValue}`}}},colors:{enabled:!1}},scales:{color:{type:Vs.id,axis:"x"}},elements:{geoFeature:{backgroundColor(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToColor(e.dataIndex)}}}}]);class cae extends Dn{constructor(t,n){super(t,$7("choropleth",n,yd,La,[Vs,wc]))}}cae.id=yd.id;class xd extends P7{initialize(){super.initialize(),this.enableOptionSharing=!0}linkScales(){super.linkScales();const t=this.getGeoDataset(),n=this.getMeta();n.vAxisID="size",n.rAxisID="size",t.vAxisID="size",t.rAxisID="size",n.rScale=this.getScaleForId("size"),n.vScale=n.rScale,n.iScale=n.xScale,n.iAxisID=n.xAxisID,t.iAxisID=n.xAxisID}_getOtherScale(t){return t}parse(t,n){const r=this.getMeta().rScale,o=this.getDataset().data,i=this._cachedMeta;for(let a=t;a<t+n;a+=1){const s=o[a];i._parsed[a]={x:s.longitude==null?s.x:s.longitude,y:s.latitude==null?s.y:s.latitude,[r.axis]:r.parse(s,a)}}}updateElements(t,n,r,o){const i=o==="reset",a=this.resolveDataElementOptions(n,o),s=this.getSharedOptions(a),l=this.includeOptions(o,s),c=this.getProjectionScale();this.getMeta().rScale._model=a,this.updateSharedOptions(s,o,a);for(let u=n;u<n+r;u+=1){const d=t[u],h=this.getParsed(u),p=c.projection([h.x,h.y]),v={x:p?p[0]:0,y:p?p[1]:0,skip:Number.isNaN(h.x)||Number.isNaN(h.y)};l&&(v.options=s||this.resolveDataElementOptions(u,o),i&&(v.options.radius=0)),this.updateElement(d,u,v,o)}}indexToRadius(t){const n=this.getMeta().rScale;return n.getSizeForValue(this.getParsed(t)[n.axis])}}xd.id="bubbleMap";xd.defaults=or({},[E7,{dataElementType:Yl.id,datasetElementType:La.id,showOutline:!0,clipMap:"outline+graticule"}]);xd.overrides=or({},[R7,{plugins:{tooltip:{callbacks:{title(){return""},label(e){var t,n,r,o;return e.formattedValue==null?(n=(t=e.chart.data)===null||t===void 0?void 0:t.labels)===null||n===void 0?void 0:n[e.dataIndex]:`${(o=(r=e.chart.data)===null||r===void 0?void 0:r.labels)===null||o===void 0?void 0:o[e.dataIndex]}: ${e.formattedValue}`}}}},scales:{size:{axis:"x",type:Hs.id}},elements:{point:{radius(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToRadius(e.dataIndex)},hoverRadius(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToRadius(e.dataIndex)+1}}}}]);class uae extends Dn{constructor(t,n){super(t,$7("bubbleMap",n,xd,La,[Hs,wc]))}}uae.id=xd.id;function dae(e){var n;return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0},y:{display:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function fae(e){var n;return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{beginAtZero:!0,stack:1,reverse:!0},y:{stacked:!0,beginAtZero:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function hae(e){var n;return{...e,type:"bar",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function pae(e,t=!1){var r;return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0,beginAtZero:!1},y:{display:!0,stacked:t}},plugins:{...(r=e==null?void 0:e.options)==null?void 0:r.plugins,legend:{position:"bottom",align:"center"}}}}}function gae(e,t){var r,o,i,a,s;return{...e,type:t==="stackedBar"?"bar":"line",options:{...e==null?void 0:e.options,scales:{x:{...(o=(r=e==null?void 0:e.options)==null?void 0:r.scales)==null?void 0:o.x,display:!0,stacked:!0},y:{...(a=(i=e==null?void 0:e.options)==null?void 0:i.scales)==null?void 0:a.y,display:!0,stacked:t==="stackedBar"}},plugins:{...(s=e==null?void 0:e.options)==null?void 0:s.plugins,legend:{position:"bottom",align:"center"}}}}}function mae(e){var n;return{...e,type:"line",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function bae(e,t){var r;return{...t,type:e,options:{...t==null?void 0:t.options,scales:{x:{display:!1},y:{display:!1}},plugins:{...(r=t==null?void 0:t.options)==null?void 0:r.plugins,legend:{position:"bottom",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},borderRadius:0}}}function vae(e){var n;return{...e,type:"radar",options:{...e==null?void 0:e.options,scales:{x:{display:!1},y:{display:!1}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function JC({data:e,cardType:t="bar",cfg:n,customCfg:r,provider:o="chartjs",userSettings:i,preferences:a,topoJson:s}){var l,c,u,d,h,p,v,b,x,y;if(t==="map"){if(!s)return null;const _=(l=a==null?void 0:a.mapVisualOptions)==null?void 0:l.objectKey;if(!_)return null;const S=oae(s,(c=s==null?void 0:s.objects)==null?void 0:c[_]).features;if(!S)return null;const C={plugins:{datalabels:{display:!1}},scales:{x:{display:!1,grid:{display:!1}},y:{display:!1,grid:{display:!1}},projection:{axis:"x",projection:((u=a==null?void 0:a.mapVisualOptions)==null?void 0:u.projection)||"mercator",projectionScale:((d=a==null?void 0:a.mapVisualOptions)==null?void 0:d.projectionScale)||1,projectionOffset:((h=a==null?void 0:a.mapVisualOptions)==null?void 0:h.projectionOffset)||[0,0]},color:{axis:"x",interpolate:((p=a==null?void 0:a.mapVisualOptions)==null?void 0:p.colorScale)||"blues",quantize:5,legend:{position:"bottom-right",align:"right"}}}},{keys:E}=tr(e),$=S.map(z=>{var U;const X=E==null?void 0:E[0],G=E==null?void 0:E[1],A=(U=e.find(V=>(V==null?void 0:V[X])===z.properties.NAME||(V==null?void 0:V[X])===z.properties.name))==null?void 0:U[G];return{feature:z,value:A}}),D=Cf([{label:_,data:$,borderColor:"lightgray"}],r),M={type:"choropleth",data:{labels:S.map(z=>z.properties.NAME||z.properties.name),datasets:D},options:C},{options:L}=k6({cfg:M,preferences:a,customCfg:r});return{...M,options:L}}if(t==="bar"){const _=hae(n);return fl({data:e,cfg:_,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:a})}if(t==="horizontalBar"){const _=dae(n);return fl({data:e,cfg:_,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:a})}if(t==="pyramid"){const _=fae(n),{dimensionKeys:S,metricKeys:C}=tr(e),E=b0({dataArray:e,groupKey:S[0],pivotKey:S[1],valueKey:C[0]}),$=fl({data:E,cfg:_,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:a}),T="x2";return{...$,data:{...$.data,datasets:$.data.datasets.map((M,L)=>L===1?{...M,xAxisID:T}:M)},options:{...$.options,scales:{...(v=$==null?void 0:$.options)==null?void 0:v.scales,[T]:{beginAtZero:!0,stack:1}}}}}if(t==="stackedBar"||t==="stackedLine"){const _=gae(n,t),{dimensionKeys:S,metricKeys:C}=tr(e),E=b0({dataArray:e,groupKey:S[0],pivotKey:S[1],valueKey:C[0],sortChart:a==null?void 0:a.sortChart});return fl({data:E,cfg:_,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:a})}if(t==="line"){const _=mae(n);return fl({data:e,cfg:_,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:a})}if(t==="range"){const _=pae(n),S=GQ(e),C=Cf(S,r),{plugins:E,options:$}=T6((a==null?void 0:a.customVisualCode)||""),T=qo((_==null?void 0:_.options)||{},(n==null?void 0:n.options)||{}),D=qo(T,(a==null?void 0:a.chartOptions)||{}),M=qo(D,(r==null?void 0:r.options)||{}),L=qo(M,$),F=M6(n,a),z=qo(L,F),X={...z,plugins:{...z==null?void 0:z.plugins,datalabels:{...(b=z==null?void 0:z.plugins)==null?void 0:b.datalabels,formatter:(K,q)=>K.map(H=>{var Y,I,te,ce;return Na({number:Number(H),decimalPlaces:((Y=a==null?void 0:a.numberAxisFormat)==null?void 0:Y.decimalPlaces)||0,useSuffix:!!((I=a==null?void 0:a.numberAxisFormat)!=null&&I.suffix),customSuffix:"",locale:((te=a==null?void 0:a.numberAxisFormat)==null?void 0:te.locale)||"",currency:((ce=a==null?void 0:a.numberAxisFormat)==null?void 0:ce.currency)||""})}).slice(0,2).join(" - ")}}},{dimensionKeys:G}=tr(e),A=G[0];return{type:"bar",data:{labels:[...new Set(jw(e,A))],datasets:C},options:X,plugins:[...E]}}if(t==="pie"||t==="doughnut"||t==="polarArea"){const _=bae(t,n),{dimensionKeys:S,metricKeys:C}=tr(e),E=YQ(C,e),$=Cf(E,r),T=S[0],D=jw(e,T),M=qo((_==null?void 0:_.options)||{},(r==null?void 0:r.options)||{}),L=qo(M,(a==null?void 0:a.chartOptions)||{}),F={...L,plugins:{...L.plugins,datalabels:{...(x=L.plugins)==null?void 0:x.datalabels,formatter:(G,A)=>{var U,V,K,q;return Na({number:Number(G),decimalPlaces:((U=a==null?void 0:a.numberAxisFormat)==null?void 0:U.decimalPlaces)||0,useSuffix:!!((V=a==null?void 0:a.numberAxisFormat)!=null&&V.suffix),customSuffix:"",locale:((K=a==null?void 0:a.numberAxisFormat)==null?void 0:K.locale)||"",currency:((q=a==null?void 0:a.numberAxisFormat)==null?void 0:q.currency)||""})}},tooltip:{...(y=L.plugins)==null?void 0:y.tooltip,callbacks:{label:function(G){let A=G.dataset.label||"";A&&(A+=": ");const V=G.dataset.data.reduce((O,H)=>O+H,0),q=(G.parsed/V*100).toFixed(2);return A+=q+"%",A+` (${G.formattedValue})`}}}}};return{type:t,data:{labels:D,datasets:$},options:F,plugins:[t==="doughnut"?{id:"doughnutLabel",beforeDatasetsDraw:function(G,A,U){var ce,de,he,ie;const{ctx:V,data:K}=G;V.save();const q=G.getDatasetMeta(0).data[0].x,O=G.getDatasetMeta(0).data[0].y,H=qu(oh()),Y=window.getComputedStyle(V.canvas).fontFamily;V.font=`1em ${Y}`,V.fontWeight="bolder",V.fillStyle=H,V.textAlign="center",V.textBaseline="middle";const I=K.datasets[0].data.reduce((re,le)=>re+le,0),te=Na({number:Number(I),decimalPlaces:((ce=a==null?void 0:a.numberAxisFormat)==null?void 0:ce.decimalPlaces)||0,useSuffix:!!((de=a==null?void 0:a.numberAxisFormat)!=null&&de.suffix),customSuffix:"",locale:((he=a==null?void 0:a.numberAxisFormat)==null?void 0:he.locale)||"",currency:((ie=a==null?void 0:a.numberAxisFormat)==null?void 0:ie.currency)||""});V.fillText(te,q,O)}}:""]}}if(t==="radar"){const _=vae(n);return fl({data:e,cfg:_,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:a})}if(t==="bubble"||t==="scatter"){const{metricKeys:_}=tr(e);if(_.length<3){console.log("Bubble charts require 3 numeric columns");return}const S=qQ(e),C=Cf(S,r),E={plugins:{datalabels:{display:!0}},scales:{x:{title:{display:!0,text:_[0]},beginAtZero:!0,ticks:{precision:0}},y:{title:{display:!0,text:_[1]},beginAtZero:!0,ticks:{precision:0}}}},$=qo(E,(r==null?void 0:r.options)||{});return{type:t,data:{datasets:C},options:$}}return fl({data:e,cfg:n,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:a})}function yae({chart:e,elementIndex:t,datasetIndex:n,cardType:r,cfg:o,apply:i}){const a=we.getState().theme;if(!o)return;const s=a==="dark"?"rgb(238,238,238,0.2)":"rgb(238,238,238,0.8)";["bar","line","horizontalBar","bubble","scatter"].includes(r)&&wae(e,t,o,i,s),["pie","doughnut","polarArea"].includes(r)&&_ae(e,t,o,i,s),["stackedBar","pyramid"].includes(r)&&xae({chart:e,elementIndex:t,datasetIndex:n,cfg:o,apply:i,blurColor:s})}function xae(e){var s,l,c,u;const{chart:t,elementIndex:n,datasetIndex:r,cfg:o,apply:i,blurColor:a}=e;i?(l=(s=t==null?void 0:t.data)==null?void 0:s.datasets)==null||l.forEach((d,h)=>{var p,v;typeof d.backgroundColor=="string"&&(d.backgroundColor=new Array(d.data.length).fill(d.backgroundColor),d.borderColor=new Array(d.data.length).fill(d.borderColor)),d.backgroundColor=(p=d==null?void 0:d.backgroundColor)==null?void 0:p.map((b,x)=>x===n&&h===r?b:a),d.borderColor=(v=d==null?void 0:d.borderColor)==null?void 0:v.map((b,x)=>x===n&&h===r?b:a)}):(u=(c=t==null?void 0:t.data)==null?void 0:c.datasets)==null||u.forEach((d,h)=>{var p,v,b,x,y,_;d.backgroundColor=new Array(d.data.length).fill((b=(v=(p=o==null?void 0:o.data)==null?void 0:p.datasets)==null?void 0:v[h])==null?void 0:b.backgroundColor),d.borderColor=new Array(d.data.length).fill((_=(y=(x=o==null?void 0:o.data)==null?void 0:x.datasets)==null?void 0:y[h])==null?void 0:_.borderColor)}),t==null||t.update()}function wae(e,t,n,r,o){var i,a,s,l;r?(a=(i=e==null?void 0:e.data)==null?void 0:i.datasets)==null||a.forEach(c=>{var u,d;typeof c.backgroundColor=="string"&&(c.backgroundColor=new Array(c.data.length).fill(c.backgroundColor),c.borderColor=new Array(c.data.length).fill(c.borderColor)),c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((h,p)=>p===t?h:o),c.borderColor=(d=c==null?void 0:c.borderColor)==null?void 0:d.map((h,p)=>p===t?h:o)}):(l=(s=e==null?void 0:e.data)==null?void 0:s.datasets)==null||l.forEach((c,u)=>{var d,h,p,v,b,x;c.backgroundColor=new Array(c.data.length).fill((p=(h=(d=n==null?void 0:n.data)==null?void 0:d.datasets)==null?void 0:h[u])==null?void 0:p.backgroundColor),c.borderColor=new Array(c.data.length).fill((x=(b=(v=n==null?void 0:n.data)==null?void 0:v.datasets)==null?void 0:b[u])==null?void 0:x.borderColor)}),e==null||e.update()}function _ae(e,t,n,r,o){var i,a,s,l;r?(a=(i=e==null?void 0:e.data)==null?void 0:i.datasets)==null||a.forEach(c=>{var u,d;c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((h,p)=>p===t?h:o),c.borderColor=(d=c==null?void 0:c.borderColor)==null?void 0:d.map((h,p)=>p===t?h:o)}):(l=(s=e==null?void 0:e.data)==null?void 0:s.datasets)==null||l.forEach((c,u)=>{var d,h,p,v,b,x,y,_;typeof c.backgroundColor=="string"&&(c.backgroundColor=(p=(h=(d=n==null?void 0:n.data)==null?void 0:d.datasets)==null?void 0:h[u])==null?void 0:p.backgroundColor,c.borderColor=(x=(b=(v=n==null?void 0:n.data)==null?void 0:v.datasets)==null?void 0:b[u])==null?void 0:x.borderColor),c.backgroundColor=(y=c==null?void 0:c.backgroundColor)==null?void 0:y.map((S,C)=>{var E;return(E=n.data.datasets[u].backgroundColor)==null?void 0:E[C]}),c.borderColor=(_=c==null?void 0:c.borderColor)==null?void 0:_.map((S,C)=>{var E;return(E=n.data.datasets[u].borderColor)==null?void 0:E[C]})}),e==null||e.update()}function Sae({card:e,data:t,datasetIndex:n,clickIndex:r,value:o}){var i,a,s,l,c,u;try{if(!t)return;const{keys:d,dimensionKeys:h,metricKeys:p}=tr(t);if(e.type==="map"){const v=d[0],b=((a=(i=o==null?void 0:o.feature)==null?void 0:i.properties)==null?void 0:a.name)||((l=(s=o==null?void 0:o.feature)==null?void 0:s.properties)==null?void 0:l.NAME);return[{columnName:v,columnValue:b}]}if(["bar","horizontalBar","line","pie","doughnut","radar","polarArea"].includes(e.type)){const v=h[0],b=(c=t[r])==null?void 0:c[v];return[{columnName:v,columnValue:b,metric:p[n],value:o}]}if(["stackedBar","pyramid"].includes(e.type)){const v=b0({dataArray:t,groupKey:h[0],pivotKey:h[1],valueKey:p[0]}),b=h[0],x=(u=v[r])==null?void 0:u[b],y=h[1],{metricKeys:_}=tr(v),S=_[n];return[{columnName:b,columnValue:x,metric:p[0],value:o},{columnName:y,columnValue:S,metric:p[0],value:o}]}if(e.type==="bubble"||e.type==="scatter"){const v=h[0],b=o.label;return[{columnName:v,columnValue:b,metric1:p[0],value1:o.x,metric2:p[1],value2:o.y,metric3:p==null?void 0:p[2],value3:o==null?void 0:o.r}]}}catch(d){console.error("Error in getAdhocFilter",d)}}function O7(e){var s,l,c,u,d,h;const t=(((l=(s=e.preferences)==null?void 0:s.mapVisualOptions)==null?void 0:l.topoJsonUrl)==="custom"?(u=(c=e.preferences)==null?void 0:c.mapVisualOptions)==null?void 0:u.customTopoJsonUrl:(h=(d=e.preferences)==null?void 0:d.mapVisualOptions)==null?void 0:h.topoJsonUrl)||"",n=!!t&&e.type==="map",{data:r,isLoading:o,isFetching:i,isError:a}=ap({queryKey:["topojson",t],queryFn:()=>fetch(t).then(p=>p.json()),enabled:n,staleTime:1/0});return{data:r,isLoading:o,isFetching:i,isError:a}}function Cae(e){var a,s;const[t]=m.useState({id:"",title:"",type:"bar",data:[]}),{getCard:n}=dr(),r=n(e),o=ZC(r||t),i={...r,data:((a=o==null?void 0:o.data)==null?void 0:a.records)||[]};return{...o,data:((s=o==null?void 0:o.data)==null?void 0:s.records)||[],card:i}}function ZC(e){var X,G,A,U;const{onChartElementClicked:t}=_i(),[n,r]=m.useState(0);((X=e==null?void 0:e.preferences)==null?void 0:X.filterOnClickColumnIndex)===void 0||(G=e.preferences)==null||G.filterOnClickColumnIndex;const o=we(V=>V.isVisualEditing),i=we(V=>V.filteringCards),a=we(V=>V.selectedSheetId),s=we(V=>V.selectedLensId);we(V=>V.selectedCardId),we(V=>V.dashboard),we(V=>V.isDashboardEditing),we(V=>V.themeStyle);const l=we(V=>V.filterValues),c=m.useRef(l),u=(A=e==null?void 0:e.preferences)==null?void 0:A.onClickFilter,{addFilteringCard:d,getCardFrame:h,addOrUpdateFilterValues:p,removeFilterValue:v,removeFilteringCard:b}=dr(),{data:x,isLoading:y,isFetching:_,isError:S,queryKey:C}=Bb(e),{data:E}=O7(e),$=i==null?void 0:i.find(V=>V.id===e.id),T=h(e.id),D=(T==null?void 0:T.cards)||[],M=(D==null?void 0:D.length)==1;let L;x&&x.records&&((U=x.records)==null?void 0:U.length)>0&&e.type!=="custom"&&(L=JC({data:x==null?void 0:x.records,cardType:e.type,cfg:e.cfg,customCfg:e.customCfg,preferences:e.preferences,topoJson:E}));const F=m.useRef({filteringCards:i});m.useEffect(()=>{!(x!=null&&x.records)||y||_||$&&M||o||r(V=>V+1)},[x==null?void 0:x.records,y,_,$,M,o]),m.useEffect(()=>{e.connectionId&&!$&&(c.current=l)},[l,s,e.connectionId,$]),m.useEffect(()=>{var K;$&&(F.current.filteringCards=[...i||[]]),!$&&((K=F.current.filteringCards)==null?void 0:K.find(q=>q.id===e.id))&&M&&r(q=>q+1)},[$,M,e.id,i]);function z(V,K,q,O){var I;let H=!1;if(!(x!=null&&x.records))return;const Y=Sae({card:e,data:x==null?void 0:x.records,datasetIndex:K,clickIndex:q,value:O});if(console.log("fieldValues",Y),t==null||t(e,Y),!!(((I=e==null?void 0:e.preferences)==null?void 0:I.onClickFilter)??[]).length){if($){const te=e.id;v(te),b(e)}else{if(H=!0,!Y)return;const te=[];Y.forEach((ce,de)=>{const he=u==null?void 0:u.find(re=>re.columnIndex===de);if(!he)return;const ie={filterId:e.id+"-"+ce.columnName+"-"+a,connectionId:e==null?void 0:e.connectionId,tableName:e.lastSelectedTable,name:ce.columnName,expression:he.expression,valueType:vb(Y[he.columnIndex].columnValue),operation:"=",values:[Y[he.columnIndex].columnValue]};te.push(ie)}),p(te),d(e)}yae({chart:V,elementIndex:q,datasetIndex:K,cardType:e.type,cfg:L,apply:H})}}return{isError:S,isLoading:y,isFetching:_,data:x,visualKey:n,handleDatapointClick:z,cfg:L}}function qi({children:e,containerClassName:t,className:n,text:r,onSave:o,type:i="input"}){const[a,s]=m.useState(!1),[l,c]=m.useState(r),u=we(p=>p.isDashboardEditing),d=p=>{p.stopPropagation(),u&&s(!0)};function h(){return i==="textarea"?R.jsx("textarea",{className:ye("grow rounded-sm bg-background px-2 py-1 text-sm outline-dashed outline-[0.5px] outline-primary/50",n),onChange:p=>c(p.target.value),value:l,autoFocus:!0,onBlur:()=>s(!1),onKeyDown:p=>{p.stopPropagation(),!(p.key==="Enter"&&p.shiftKey)&&(p.key==="Enter"||p.key==="Tab")&&(s(!1),o(l))}}):R.jsx("input",{onMouseDown:p=>p.stopPropagation(),type:"text",className:ye("rounded-sm bg-background px-2 py-1 text-sm outline-dashed outline-[0.5px] outline-primary/50",n),onChange:p=>c(p.target.value),value:l,autoFocus:!0,onBlur:()=>s(!1),onKeyDown:p=>{p.stopPropagation(),(p.key==="Enter"||p.key==="Tab")&&(s(!1),o(l))}})}return R.jsx("div",{className:ye("flex",t),role:"editable",onDoubleClick:d,children:a?h():e})}function T7({card:e,data:t}){var x,y,_,S,C,E,$,T,D,M,L,F,z,X,G,A,U,V,K,q,O,H,Y,I;const n=we(te=>te.actions.setCardTitle),r=we(te=>te.actions.setCardDescription),o=we(te=>te.isVisualEditing),i=Ir(te=>te.card),a=Ir(te=>te.actions.setCard);Ir(te=>te.actions.setNumberFormat);const s=we(te=>te.selectedSheetId),l=(y=(x=e.preferences)==null?void 0:x.formatNumber)==null?void 0:y.colorRanges,{metricKeys:c}=tr(t),u=(_=t==null?void 0:t[0])==null?void 0:_[c==null?void 0:c[0]],d=(S=t==null?void 0:t[0])==null?void 0:S[c==null?void 0:c[1]],h=t.length>0;function p(te){o?a({...i,title:te}):n(s,e.id,te)}function v(te){o?a({...i,description:te}):r(s,e.id,te)}const b=d&&d-u!==0?(u-d)/d:null;return R.jsxs("div",{className:"kpi-card flex grow flex-col overflow-auto",children:[R.jsxs(xb,{className:"grow pb-3",children:[R.jsx(qi,{text:o?i.title:e.title,onSave:p,children:R.jsx("div",{className:"flex items-center gap-2",children:R.jsx(pd,{className:"text-base font-medium text-muted-foreground",children:e.title})})}),h&&R.jsxs("div",{className:"flex flex-wrap items-end gap-3 text-foreground",children:[R.jsx("p",{style:{color:xC(u,l)},className:"text-3xl font-semibold",children:Na({number:u,decimalPlaces:((E=(C=e.preferences)==null?void 0:C.formatNumber)==null?void 0:E.decimalPlaces)||0,useSuffix:!!((T=($=e.preferences)==null?void 0:$.formatNumber)!=null&&T.suffix),customSuffix:((M=(D=e.preferences)==null?void 0:D.formatNumber)==null?void 0:M.suffix)||"",locale:((F=(L=e.preferences)==null?void 0:L.formatNumber)==null?void 0:F.locale)||"",currency:((X=(z=e.preferences)==null?void 0:z.formatNumber)==null?void 0:X.currency)||""})}),d&&R.jsxs("span",{className:"min-w-fit text-base font-normal text-muted-foreground",children:["from  ",Na({number:d,decimalPlaces:((A=(G=e.preferences)==null?void 0:G.formatNumber)==null?void 0:A.decimalPlaces)||0,useSuffix:!!((V=(U=e.preferences)==null?void 0:U.formatNumber)!=null&&V.suffix),customSuffix:((q=(K=e.preferences)==null?void 0:K.formatNumber)==null?void 0:q.suffix)||"",locale:((H=(O=e.preferences)==null?void 0:O.formatNumber)==null?void 0:H.locale)||"",currency:((I=(Y=e.preferences)==null?void 0:Y.formatNumber)==null?void 0:I.currency)||""})]})]})]}),b&&R.jsxs(wb,{className:"grow items-start gap-1 pb-4 text-sm",children:[R.jsx(D7,{children:b}),R.jsxs("div",{className:"flex gap-1 text-muted-foreground",children:[b>0?"up ":"down ",R.jsx(qi,{text:e.description||"",onSave:v,children:e.description})]})]})]})}function D7({children:e,className:t}){var i,a;const n=we(s=>s.themeStyle),r=e>0?R.jsx("span",{children:"+"}):R.jsx("span",{children:"-"}),o=`${Math.abs(e*100).toFixed(0)}%`;return R.jsxs("div",{style:{borderRadius:(a=(i=n==null?void 0:n.chart)==null?void 0:i.options)==null?void 0:a.borderRadius},className:ye("flex items-center px-1 text-sm font-semibold",{"bg-green-600/10 text-green-600":e>0,"bg-destructive/10 text-destructive":e<0},t),children:[r,R.jsx("span",{className:"ml-[1px]",children:o})]})}const Eae=["top","right","bottom","left"],Ws=Math.min,_o=Math.max,H0=Math.round,sm=Math.floor,Us=e=>({x:e,y:e}),Rae={left:"right",right:"left",bottom:"top",top:"bottom"},Pae={start:"end",end:"start"};function v_(e,t,n){return _o(e,Ws(t,n))}function Fa(e,t){return typeof e=="function"?e(t):e}function ja(e){return e.split("-")[0]}function wd(e){return e.split("-")[1]}function eE(e){return e==="x"?"y":"x"}function tE(e){return e==="y"?"height":"width"}function _d(e){return["top","bottom"].includes(ja(e))?"y":"x"}function nE(e){return eE(_d(e))}function $ae(e,t,n){n===void 0&&(n=!1);const r=wd(e),o=nE(e),i=tE(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=W0(a)),[a,W0(a)]}function Oae(e){const t=W0(e);return[y_(e),t,y_(t)]}function y_(e){return e.replace(/start|end/g,t=>Pae[t])}function Tae(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}function Dae(e,t,n,r){const o=wd(e);let i=Tae(ja(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(y_)))),i}function W0(e){return e.replace(/left|right|bottom|top/g,t=>Rae[t])}function Aae(e){return{top:0,right:0,bottom:0,left:0,...e}}function A7(e){return typeof e!="number"?Aae(e):{top:e,right:e,bottom:e,left:e}}function U0(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function PT(e,t,n){let{reference:r,floating:o}=e;const i=_d(t),a=nE(t),s=tE(a),l=ja(t),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[s]/2-o[s]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(wd(t)){case"start":p[a]-=h*(n&&c?-1:1);break;case"end":p[a]+=h*(n&&c?-1:1);break}return p}const Mae=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=PT(c,r,l),h=r,p={},v=0;for(let b=0;b<s.length;b++){const{name:x,fn:y}=s[b],{x:_,y:S,data:C,reset:E}=await y({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:p,rects:c,platform:a,elements:{reference:e,floating:t}});if(u=_??u,d=S??d,p={...p,[x]:{...p[x],...C}},E&&v<=50){v++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(c=E.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:u,y:d}=PT(c,h,l)),b=-1;continue}}return{x:u,y:d,placement:h,strategy:o,middlewareData:p}};async function bh(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=Fa(t,e),v=A7(p),x=s[h?d==="floating"?"reference":"floating":d],y=U0(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),_=d==="floating"?{...a.floating,x:r,y:o}:a.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),C=await(i.isElement==null?void 0:i.isElement(S))?await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1}:{x:1,y:1},E=U0(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:_,offsetParent:S,strategy:l}):_);return{top:(y.top-E.top+v.top)/C.y,bottom:(E.bottom-y.bottom+v.bottom)/C.y,left:(y.left-E.left+v.left)/C.x,right:(E.right-y.right+v.right)/C.x}}const $T=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Fa(e,t)||{};if(c==null)return{};const d=A7(u),h={x:n,y:r},p=nE(o),v=tE(p),b=await a.getDimensions(c),x=p==="y",y=x?"top":"left",_=x?"bottom":"right",S=x?"clientHeight":"clientWidth",C=i.reference[v]+i.reference[p]-h[p]-i.floating[v],E=h[p]-i.reference[p],$=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let T=$?$[S]:0;(!T||!await(a.isElement==null?void 0:a.isElement($)))&&(T=s.floating[S]||i.floating[v]);const D=C/2-E/2,M=T/2-b[v]/2-1,L=Ws(d[y],M),F=Ws(d[_],M),z=L,X=T-b[v]-F,G=T/2-b[v]/2+D,A=v_(z,G,X),U=!l.arrow&&wd(o)!=null&&G!=A&&i.reference[v]/2-(G<z?L:F)-b[v]/2<0,V=U?G<z?G-z:G-X:0;return{[p]:h[p]+V,data:{[p]:A,centerOffset:G-A-V,...U&&{alignmentOffset:V}},reset:U}}}),kae=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:b=!0,...x}=Fa(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=ja(o),_=ja(s)===s,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=h||(_||!b?[W0(s)]:Oae(s));!h&&v!=="none"&&C.push(...Dae(s,b,v,S));const E=[s,...C],$=await bh(t,x),T=[];let D=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&T.push($[y]),d){const z=$ae(o,a,S);T.push($[z[0]],$[z[1]])}if(D=[...D,{placement:o,overflows:T}],!T.every(z=>z<=0)){var M,L;const z=(((M=i.flip)==null?void 0:M.index)||0)+1,X=E[z];if(X)return{data:{index:z,overflows:D},reset:{placement:X}};let G=(L=D.filter(A=>A.overflows[0]<=0).sort((A,U)=>A.overflows[1]-U.overflows[1])[0])==null?void 0:L.placement;if(!G)switch(p){case"bestFit":{var F;const A=(F=D.map(U=>[U.placement,U.overflows.filter(V=>V>0).reduce((V,K)=>V+K,0)]).sort((U,V)=>U[1]-V[1])[0])==null?void 0:F[0];A&&(G=A);break}case"initialPlacement":G=s;break}if(o!==G)return{reset:{placement:G}}}return{}}}};function OT(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function TT(e){return Eae.some(t=>e[t]>=0)}const Iae=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Fa(e,t);switch(r){case"referenceHidden":{const i=await bh(t,{...o,elementContext:"reference"}),a=OT(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:TT(a)}}}case"escaped":{const i=await bh(t,{...o,altBoundary:!0}),a=OT(i,n.floating);return{data:{escapedOffsets:a,escaped:TT(a)}}}default:return{}}}}};async function Nae(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=ja(n),s=wd(n),l=_d(n)==="y",c=["left","top"].includes(a)?-1:1,u=i&&l?-1:1,d=Fa(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:v}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&typeof v=="number"&&(p=s==="end"?v*-1:v),l?{x:p*u,y:h*c}:{x:h*c,y:p*u}}const Lae=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await Nae(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},Fae=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:x=>{let{x:y,y:_}=x;return{x:y,y:_}}},...l}=Fa(e,t),c={x:n,y:r},u=await bh(t,l),d=_d(ja(o)),h=eE(d);let p=c[h],v=c[d];if(i){const x=h==="y"?"top":"left",y=h==="y"?"bottom":"right",_=p+u[x],S=p-u[y];p=v_(_,p,S)}if(a){const x=d==="y"?"top":"left",y=d==="y"?"bottom":"right",_=v+u[x],S=v-u[y];v=v_(_,v,S)}const b=s.fn({...t,[h]:p,[d]:v});return{...b,data:{x:b.x-n,y:b.y-r}}}}},jae=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Fa(e,t),u={x:n,y:r},d=_d(o),h=eE(d);let p=u[h],v=u[d];const b=Fa(s,t),x=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const S=h==="y"?"height":"width",C=i.reference[h]-i.floating[S]+x.mainAxis,E=i.reference[h]+i.reference[S]-x.mainAxis;p<C?p=C:p>E&&(p=E)}if(c){var y,_;const S=h==="y"?"width":"height",C=["top","left"].includes(ja(o)),E=i.reference[d]-i.floating[S]+(C&&((y=a.offset)==null?void 0:y[d])||0)+(C?0:x.crossAxis),$=i.reference[d]+i.reference[S]+(C?0:((_=a.offset)==null?void 0:_[d])||0)-(C?x.crossAxis:0);v<E?v=E:v>$&&(v=$)}return{[h]:p,[d]:v}}}},zae=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:a=()=>{},...s}=Fa(e,t),l=await bh(t,s),c=ja(n),u=wd(n),d=_d(n)==="y",{width:h,height:p}=r.floating;let v,b;c==="top"||c==="bottom"?(v=c,b=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(b=c,v=u==="end"?"top":"bottom");const x=p-l[v],y=h-l[b],_=!t.middlewareData.shift;let S=x,C=y;if(d){const $=h-l.left-l.right;C=u||_?Ws(y,$):$}else{const $=p-l.top-l.bottom;S=u||_?Ws(x,$):$}if(_&&!u){const $=_o(l.left,0),T=_o(l.right,0),D=_o(l.top,0),M=_o(l.bottom,0);d?C=h-2*($!==0||T!==0?$+T:_o(l.left,l.right)):S=p-2*(D!==0||M!==0?D+M:_o(l.top,l.bottom))}await a({...t,availableWidth:C,availableHeight:S});const E=await o.getDimensions(i.floating);return h!==E.width||p!==E.height?{reset:{rects:!0}}:{}}}};function qs(e){return M7(e)?(e.nodeName||"").toLowerCase():"#document"}function Ro(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ha(e){var t;return(t=(M7(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function M7(e){return e instanceof Node||e instanceof Ro(e).Node}function za(e){return e instanceof Element||e instanceof Ro(e).Element}function Qi(e){return e instanceof HTMLElement||e instanceof Ro(e).HTMLElement}function DT(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ro(e).ShadowRoot}function gp(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Jo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Bae(e){return["table","td","th"].includes(qs(e))}function rE(e){const t=oE(),n=Jo(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Vae(e){let t=ad(e);for(;Qi(t)&&!Xb(t);){if(rE(t))return t;t=ad(t)}return null}function oE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Xb(e){return["html","body","#document"].includes(qs(e))}function Jo(e){return Ro(e).getComputedStyle(e)}function Qb(e){return za(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ad(e){if(qs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||DT(e)&&e.host||Ha(e);return DT(t)?t.host:t}function k7(e){const t=ad(e);return Xb(t)?e.ownerDocument?e.ownerDocument.body:e.body:Qi(t)&&gp(t)?t:k7(t)}function vh(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=k7(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=Ro(o);return i?t.concat(a,a.visualViewport||[],gp(o)?o:[],a.frameElement&&n?vh(a.frameElement):[]):t.concat(o,vh(o,[],n))}function I7(e){const t=Jo(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Qi(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=H0(n)!==i||H0(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function iE(e){return za(e)?e:e.contextElement}function Cu(e){const t=iE(e);if(!Qi(t))return Us(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=I7(t);let a=(i?H0(n.width):n.width)/r,s=(i?H0(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Hae=Us(0);function N7(e){const t=Ro(e);return!oE()||!t.visualViewport?Hae:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Wae(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ro(e)?!1:t}function uc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=iE(e);let a=Us(1);t&&(r?za(r)&&(a=Cu(r)):a=Cu(e));const s=Wae(i,n,r)?N7(i):Us(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){const h=Ro(i),p=r&&za(r)?Ro(r):r;let v=h.frameElement;for(;v&&r&&p!==h;){const b=Cu(v),x=v.getBoundingClientRect(),y=Jo(v),_=x.left+(v.clientLeft+parseFloat(y.paddingLeft))*b.x,S=x.top+(v.clientTop+parseFloat(y.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,d*=b.y,l+=_,c+=S,v=Ro(v).frameElement}}return U0({width:u,height:d,x:l,y:c})}function Uae(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Qi(n),i=Ha(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0},s=Us(1);const l=Us(0);if((o||!o&&r!=="fixed")&&((qs(n)!=="body"||gp(i))&&(a=Qb(n)),Qi(n))){const c=uc(n);s=Cu(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-a.scrollLeft*s.x+l.x,y:t.y*s.y-a.scrollTop*s.y+l.y}}function qae(e){return Array.from(e.getClientRects())}function L7(e){return uc(Ha(e)).left+Qb(e).scrollLeft}function Gae(e){const t=Ha(e),n=Qb(e),r=e.ownerDocument.body,o=_o(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=_o(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+L7(e);const s=-n.scrollTop;return Jo(r).direction==="rtl"&&(a+=_o(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}function Yae(e,t){const n=Ro(e),r=Ha(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const c=oE();(!c||c&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}function Kae(e,t){const n=uc(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Qi(e)?Cu(e):Us(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:a,height:s,x:l,y:c}}function AT(e,t,n){let r;if(t==="viewport")r=Yae(e,n);else if(t==="document")r=Gae(Ha(e));else if(za(t))r=Kae(t,n);else{const o=N7(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return U0(r)}function F7(e,t){const n=ad(e);return n===t||!za(n)||Xb(n)?!1:Jo(n).position==="fixed"||F7(n,t)}function Xae(e,t){const n=t.get(e);if(n)return n;let r=vh(e,[],!1).filter(s=>za(s)&&qs(s)!=="body"),o=null;const i=Jo(e).position==="fixed";let a=i?ad(e):e;for(;za(a)&&!Xb(a);){const s=Jo(a),l=rE(a);!l&&s.position==="fixed"&&(o=null),(i?!l&&!o:!l&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||gp(a)&&!l&&F7(e,a))?r=r.filter(u=>u!==a):o=s,a=ad(a)}return t.set(e,r),r}function Qae(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?Xae(t,this._c):[].concat(n),r],s=a[0],l=a.reduce((c,u)=>{const d=AT(t,u,o);return c.top=_o(d.top,c.top),c.right=Ws(d.right,c.right),c.bottom=Ws(d.bottom,c.bottom),c.left=_o(d.left,c.left),c},AT(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Jae(e){return I7(e)}function Zae(e,t,n){const r=Qi(t),o=Ha(t),i=n==="fixed",a=uc(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=Us(0);if(r||!r&&!i)if((qs(t)!=="body"||gp(o))&&(s=Qb(t)),r){const c=uc(t,!0,i,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else o&&(l.x=L7(o));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function MT(e,t){return!Qi(e)||Jo(e).position==="fixed"?null:t?t(e):e.offsetParent}function j7(e,t){const n=Ro(e);if(!Qi(e))return n;let r=MT(e,t);for(;r&&Bae(r)&&Jo(r).position==="static";)r=MT(r,t);return r&&(qs(r)==="html"||qs(r)==="body"&&Jo(r).position==="static"&&!rE(r))?n:r||Vae(e)||n}const ese=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||j7,i=this.getDimensions;return{reference:Zae(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function tse(e){return Jo(e).direction==="rtl"}const nse={convertOffsetParentRelativeRectToViewportRelativeRect:Uae,getDocumentElement:Ha,getClippingRect:Qae,getOffsetParent:j7,getElementRects:ese,getClientRects:qae,getDimensions:Jae,getScale:Cu,isElement:za,isRTL:tse};function rse(e,t){let n=null,r;const o=Ha(e);function i(){clearTimeout(r),n&&n.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),i();const{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(s||t(),!d||!h)return;const p=sm(u),v=sm(o.clientWidth-(c+d)),b=sm(o.clientHeight-(u+h)),x=sm(c),_={rootMargin:-p+"px "+-v+"px "+-b+"px "+-x+"px",threshold:_o(0,Ws(1,l))||1};let S=!0;function C(E){const $=E[0].intersectionRatio;if($!==l){if(!S)return a();$?a(!1,$):r=setTimeout(()=>{a(!1,1e-7)},100)}S=!1}try{n=new IntersectionObserver(C,{..._,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,_)}n.observe(e)}return a(!0),i}function ose(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=iE(e),u=o||i?[...c?vh(c):[],...vh(t)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const d=c&&s?rse(c,n):null;let h=-1,p=null;a&&(p=new ResizeObserver(y=>{let[_]=y;_&&_.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{p&&p.observe(t)})),n()}),c&&!l&&p.observe(c),p.observe(t));let v,b=l?uc(e):null;l&&x();function x(){const y=uc(e);b&&(y.x!==b.x||y.y!==b.y||y.width!==b.width||y.height!==b.height)&&n(),b=y,v=requestAnimationFrame(x)}return n(),()=>{u.forEach(y=>{o&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),d&&d(),p&&p.disconnect(),p=null,l&&cancelAnimationFrame(v)}}const ise=(e,t,n)=>{const r=new Map,o={platform:nse,...n},i={...o.platform,_c:r};return Mae(e,t,{...o,platform:i})},ase=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?$T({element:r.current,padding:o}).fn(n):{}:r?$T({element:r,padding:o}).fn(n):{}}}};var t0=typeof document<"u"?m.useLayoutEffect:m.useEffect;function q0(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!q0(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!q0(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function z7(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function kT(e,t){const n=z7(e);return Math.round(t*n)/n}function IT(e){const t=j.useRef(e);return t0(()=>{t.current=e}),t}function sse(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[u,d]=j.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=j.useState(r);q0(h,r)||p(r);const[v,b]=j.useState(null),[x,y]=j.useState(null),_=j.useCallback(U=>{U!=$.current&&($.current=U,b(U))},[b]),S=j.useCallback(U=>{U!==T.current&&(T.current=U,y(U))},[y]),C=i||v,E=a||x,$=j.useRef(null),T=j.useRef(null),D=j.useRef(u),M=IT(l),L=IT(o),F=j.useCallback(()=>{if(!$.current||!T.current)return;const U={placement:t,strategy:n,middleware:h};L.current&&(U.platform=L.current),ise($.current,T.current,U).then(V=>{const K={...V,isPositioned:!0};z.current&&!q0(D.current,K)&&(D.current=K,_S.flushSync(()=>{d(K)}))})},[h,t,n,L]);t0(()=>{c===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,d(U=>({...U,isPositioned:!1})))},[c]);const z=j.useRef(!1);t0(()=>(z.current=!0,()=>{z.current=!1}),[]),t0(()=>{if(C&&($.current=C),E&&(T.current=E),C&&E){if(M.current)return M.current(C,E,F);F()}},[C,E,F,M]);const X=j.useMemo(()=>({reference:$,floating:T,setReference:_,setFloating:S}),[_,S]),G=j.useMemo(()=>({reference:C,floating:E}),[C,E]),A=j.useMemo(()=>{const U={position:n,left:0,top:0};if(!G.floating)return U;const V=kT(G.floating,u.x),K=kT(G.floating,u.y);return s?{...U,transform:"translate("+V+"px, "+K+"px)",...z7(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:K}},[n,s,G.floating,u.x,u.y]);return j.useMemo(()=>({...u,update:F,refs:X,elements:G,floatingStyles:A}),[u,F,X,G,A])}function Jb(e){const[t,n]=m.useState(void 0);return Cr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,s;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,s=c.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const B7="Popper",[V7,oa]=hr(B7),[lse,H7]=V7(B7),cse=e=>{const{__scopePopper:t,children:n}=e,[r,o]=m.useState(null);return m.createElement(lse,{scope:t,anchor:r,onAnchorChange:o},n)},use="PopperAnchor",dse=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=H7(use,n),a=m.useRef(null),s=Rt(t,a);return m.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:m.createElement(Qe.div,ue({},o,{ref:s}))}),W7="PopperContent",[fse,t5e]=V7(W7),hse=m.forwardRef((e,t)=>{var n,r,o,i,a,s,l,c;const{__scopePopper:u,side:d="bottom",sideOffset:h=0,align:p="center",alignOffset:v=0,arrowPadding:b=0,avoidCollisions:x=!0,collisionBoundary:y=[],collisionPadding:_=0,sticky:S="partial",hideWhenDetached:C=!1,updatePositionStrategy:E="optimized",onPlaced:$,...T}=e,D=H7(W7,u),[M,L]=m.useState(null),F=Rt(t,Oe=>L(Oe)),[z,X]=m.useState(null),G=Jb(z),A=(n=G==null?void 0:G.width)!==null&&n!==void 0?n:0,U=(r=G==null?void 0:G.height)!==null&&r!==void 0?r:0,V=d+(p!=="center"?"-"+p:""),K=typeof _=="number"?_:{top:0,right:0,bottom:0,left:0,..._},q=Array.isArray(y)?y:[y],O=q.length>0,H={padding:K,boundary:q.filter(pse),altBoundary:O},{refs:Y,floatingStyles:I,placement:te,isPositioned:ce,middlewareData:de}=sse({strategy:"fixed",placement:V,whileElementsMounted:(...Oe)=>ose(...Oe,{animationFrame:E==="always"}),elements:{reference:D.anchor},middleware:[Lae({mainAxis:h+U,alignmentAxis:v}),x&&Fae({mainAxis:!0,crossAxis:!1,limiter:S==="partial"?jae():void 0,...H}),x&&kae({...H}),zae({...H,apply:({elements:Oe,rects:Te,availableWidth:We,availableHeight:Be})=>{const{width:Ie,height:Ke}=Te.reference,dt=Oe.floating.style;dt.setProperty("--radix-popper-available-width",`${We}px`),dt.setProperty("--radix-popper-available-height",`${Be}px`),dt.setProperty("--radix-popper-anchor-width",`${Ie}px`),dt.setProperty("--radix-popper-anchor-height",`${Ke}px`)}}),z&&ase({element:z,padding:b}),gse({arrowWidth:A,arrowHeight:U}),C&&Iae({strategy:"referenceHidden",...H})]}),[he,ie]=U7(te),re=Xn($);Cr(()=>{ce&&(re==null||re())},[ce,re]);const le=(o=de.arrow)===null||o===void 0?void 0:o.x,xe=(i=de.arrow)===null||i===void 0?void 0:i.y,Z=((a=de.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[ve,Ce]=m.useState();return Cr(()=>{M&&Ce(window.getComputedStyle(M).zIndex)},[M]),m.createElement("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:ce?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[(s=de.transformOrigin)===null||s===void 0?void 0:s.x,(l=de.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},m.createElement(fse,{scope:u,placedSide:he,onArrowChange:X,arrowX:le,arrowY:xe,shouldHideArrow:Z},m.createElement(Qe.div,ue({"data-side":he,"data-align":ie},T,{ref:F,style:{...T.style,animation:ce?void 0:"none",opacity:(c=de.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function pse(e){return e!==null}const gse=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,a;const{placement:s,rects:l,middlewareData:c}=t,d=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,h=d?0:e.arrowWidth,p=d?0:e.arrowHeight,[v,b]=U7(s),x={start:"0%",center:"50%",end:"100%"}[b],y=((r=(o=c.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+h/2,_=((i=(a=c.arrow)===null||a===void 0?void 0:a.y)!==null&&i!==void 0?i:0)+p/2;let S="",C="";return v==="bottom"?(S=d?x:`${y}px`,C=`${-p}px`):v==="top"?(S=d?x:`${y}px`,C=`${l.floating.height+p}px`):v==="right"?(S=`${-p}px`,C=d?x:`${_}px`):v==="left"&&(S=`${l.floating.width+p}px`,C=d?x:`${_}px`),{data:{x:S,y:C}}}});function U7(e){const[t,n="center"]=e.split("-");return[t,n]}const mp=cse,bp=dse,vp=hse,aE=m.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?Er.createPortal(m.createElement(Qe.div,ue({},o,{ref:t})),r):null});function mse(e,t=globalThis==null?void 0:globalThis.document){const n=Xn(e);m.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const x_="dismissableLayer.update",bse="dismissableLayer.pointerDownOutside",vse="dismissableLayer.focusOutside";let NT;const yse=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),yp=m.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...c}=e,u=m.useContext(yse),[d,h]=m.useState(null),p=(n=d==null?void 0:d.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,v]=m.useState({}),b=Rt(t,D=>h(D)),x=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),_=x.indexOf(y),S=d?x.indexOf(d):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,E=S>=_,$=xse(D=>{const M=D.target,L=[...u.branches].some(F=>F.contains(M));!E||L||(i==null||i(D),s==null||s(D),D.defaultPrevented||l==null||l())},p),T=wse(D=>{const M=D.target;[...u.branches].some(F=>F.contains(M))||(a==null||a(D),s==null||s(D),D.defaultPrevented||l==null||l())},p);return mse(D=>{S===u.layers.size-1&&(o==null||o(D),!D.defaultPrevented&&l&&(D.preventDefault(),l()))},p),m.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(NT=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),LT(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=NT)}},[d,p,r,u]),m.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),LT())},[d,u]),m.useEffect(()=>{const D=()=>v({});return document.addEventListener(x_,D),()=>document.removeEventListener(x_,D)},[]),m.createElement(Qe.div,ue({},c,{ref:b,style:{pointerEvents:C?E?"auto":"none":void 0,...e.style},onFocusCapture:ke(e.onFocusCapture,T.onFocusCapture),onBlurCapture:ke(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:ke(e.onPointerDownCapture,$.onPointerDownCapture)}))});function xse(e,t=globalThis==null?void 0:globalThis.document){const n=Xn(e),r=m.useRef(!1),o=m.useRef(()=>{});return m.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let c=function(){q7(bse,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function wse(e,t=globalThis==null?void 0:globalThis.document){const n=Xn(e),r=m.useRef(!1);return m.useEffect(()=>{const o=i=>{i.target&&!r.current&&q7(vse,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function LT(){const e=new CustomEvent(x_);document.dispatchEvent(e)}function q7(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?fk(o,i):o.dispatchEvent(i)}let N1;const G7="HoverCard",[Y7,n5e]=hr(G7,[oa]),sE=oa(),[_se,lE]=Y7(G7),Sse=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:a=700,closeDelay:s=300}=e,l=sE(t),c=m.useRef(0),u=m.useRef(0),d=m.useRef(!1),h=m.useRef(!1),[p=!1,v]=Fr({prop:r,defaultProp:o,onChange:i}),b=m.useCallback(()=>{clearTimeout(u.current),c.current=window.setTimeout(()=>v(!0),a)},[a,v]),x=m.useCallback(()=>{clearTimeout(c.current),!d.current&&!h.current&&(u.current=window.setTimeout(()=>v(!1),s))},[s,v]),y=m.useCallback(()=>v(!1),[v]);return m.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(u.current)},[]),m.createElement(_se,{scope:t,open:p,onOpenChange:v,onOpen:b,onClose:x,onDismiss:y,hasSelectionRef:d,isPointerDownOnContentRef:h},m.createElement(mp,l,n))},Cse="HoverCardTrigger",Ese=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=lE(Cse,n),i=sE(n);return m.createElement(bp,ue({asChild:!0},i),m.createElement(Qe.a,ue({"data-state":o.open?"open":"closed"},r,{ref:t,onPointerEnter:ke(e.onPointerEnter,G0(o.onOpen)),onPointerLeave:ke(e.onPointerLeave,G0(o.onClose)),onFocus:ke(e.onFocus,o.onOpen),onBlur:ke(e.onBlur,o.onClose),onTouchStart:ke(e.onTouchStart,a=>a.preventDefault())})))}),Rse="HoverCardPortal",[r5e,Pse]=Y7(Rse,{forceMount:void 0}),w_="HoverCardContent",$se=m.forwardRef((e,t)=>{const n=Pse(w_,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,i=lE(w_,e.__scopeHoverCard);return m.createElement(pr,{present:r||i.open},m.createElement(Ose,ue({"data-state":i.open?"open":"closed"},o,{onPointerEnter:ke(e.onPointerEnter,G0(i.onOpen)),onPointerLeave:ke(e.onPointerLeave,G0(i.onClose)),ref:t})))}),Ose=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,...s}=e,l=lE(w_,n),c=sE(n),u=m.useRef(null),d=Rt(t,u),[h,p]=m.useState(!1);return m.useEffect(()=>{if(h){const v=document.body;return N1=v.style.userSelect||v.style.webkitUserSelect,v.style.userSelect="none",v.style.webkitUserSelect="none",()=>{v.style.userSelect=N1,v.style.webkitUserSelect=N1}}},[h]),m.useEffect(()=>{if(u.current){const v=()=>{p(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var b;((b=document.getSelection())===null||b===void 0?void 0:b.toString())!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",v),()=>{document.removeEventListener("pointerup",v),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),m.useEffect(()=>{u.current&&Tse(u.current).forEach(b=>b.setAttribute("tabindex","-1"))}),m.createElement(yp,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:a,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:ke(i,v=>{v.preventDefault()}),onDismiss:l.onDismiss},m.createElement(vp,ue({},c,s,{onPointerDown:ke(s.onPointerDown,v=>{v.currentTarget.contains(v.target)&&p(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:d,style:{...s.style,userSelect:h?"text":void 0,WebkitUserSelect:h?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})))});function G0(e){return t=>t.pointerType==="touch"?void 0:e()}function Tse(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}const Dse=Sse,Ase=Ese,K7=$se,Zb=Dse,ev=Ase,xp=j.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>R.jsx(K7,{ref:o,align:t,sideOffset:n,className:ye("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));xp.displayName=K7.displayName;function X7({card:e}){const{setCardInfo:t}=dr();return R.jsxs(Zb,{openDelay:0,children:[R.jsx(ev,{children:R.jsx(S6,{className:"size-4 text-muted-foreground/40"})}),R.jsx(xp,{align:"start",className:"w-[300px]",onMouseDown:n=>n.stopPropagation(),children:R.jsx(qi,{type:"textarea",text:e.info||"",onSave:n=>t(e.id,n),children:R.jsx("p",{className:"text-sm text-muted-foreground",children:e.info||"Double-click to add info"})})})]})}function Mse({card:e,renderFilterInfo:t}){var h,p,v,b,x,y,_,S,C,E,$,T,D,M,L,F,z,X,G,A,U,V,K,q;we(O=>O.themeStyle);const{data:n,isLoading:r}=Bb(e),o=(n==null?void 0:n.records)||[],i=we(O=>O.isDashboardEditing),a=(p=(h=e.preferences)==null?void 0:h.formatNumber)==null?void 0:p.colorRanges,{metricKeys:s}=tr(o||[]),l=(v=o==null?void 0:o[0])==null?void 0:v[s==null?void 0:s[0]],c=(b=o==null?void 0:o[0])==null?void 0:b[s==null?void 0:s[1]],u=(o==null?void 0:o.length)>0,d=c&&c-l!==0?(l-c)/c:null;return R.jsx("div",{className:"flex min-w-fit grow flex-col overflow-auto",children:R.jsxs("div",{className:"grow",children:[u?R.jsx("div",{className:"",children:R.jsxs("div",{className:ye("flex items-end gap-1.5",{"animate-pulse":r}),children:[R.jsx("p",{style:{color:xC(l,a)},className:"text-3xl font-semibold",children:Na({number:l,decimalPlaces:((y=(x=e.preferences)==null?void 0:x.formatNumber)==null?void 0:y.decimalPlaces)||0,useSuffix:!!((S=(_=e.preferences)==null?void 0:_.formatNumber)!=null&&S.suffix),customSuffix:((E=(C=e.preferences)==null?void 0:C.formatNumber)==null?void 0:E.suffix)||"",locale:((T=($=e.preferences)==null?void 0:$.formatNumber)==null?void 0:T.locale)||"",currency:((M=(D=e.preferences)==null?void 0:D.formatNumber)==null?void 0:M.currency)||""})}),d&&R.jsxs("div",{className:"flex items-end gap-1",children:[R.jsx(D7,{className:"",children:d}),c&&R.jsx("div",{className:"ml-0.5 mr-1 min-w-fit text-sm font-normal text-muted-foreground",children:`from ${Na({number:c,decimalPlaces:((F=(L=e.preferences)==null?void 0:L.formatNumber)==null?void 0:F.decimalPlaces)||0,useSuffix:!!((X=(z=e.preferences)==null?void 0:z.formatNumber)!=null&&X.suffix),customSuffix:((A=(G=e.preferences)==null?void 0:G.formatNumber)==null?void 0:A.suffix)||"",locale:((V=(U=e.preferences)==null?void 0:U.formatNumber)==null?void 0:V.locale)||"",currency:((q=(K=e.preferences)==null?void 0:K.formatNumber)==null?void 0:q.currency)||""})}`})]})]})}):R.jsx("div",{className:"flex h-9 items-center justify-center"}),R.jsxs("div",{className:"flex items-center gap-3",children:[R.jsxs(pd,{className:"flex items-center gap-2 text-base font-medium text-muted-foreground",children:[e.title,(i||e.info)&&R.jsx(X7,{card:e})]}),t==null?void 0:t()]})]})})}const kse=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(Ise);if(i){const a=i.props.children,s=o.map(l=>l===i?m.Children.count(a)>1?m.Children.only(null):m.isValidElement(a)?a.props.children:null:l);return m.createElement(__,ue({},r,{ref:t}),m.isValidElement(a)?m.cloneElement(a,void 0,s):null)}return m.createElement(__,ue({},r,{ref:t}),n)});kse.displayName="Slot";const __=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...Nse(r,n.props),ref:t?Ba(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});__.displayName="SlotClone";const Q7=({children:e})=>m.createElement(m.Fragment,null,e);function Ise(e){return m.isValidElement(e)&&e.type===Q7}function Nse(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const J7=m.forwardRef((e,t)=>m.createElement(Qe.span,ue({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),Lse=J7,[tv,o5e]=hr("Tooltip",[oa]),cE=oa(),Fse="TooltipProvider",jse=700,S_="tooltip.open",[zse,uE]=tv(Fse),Bse=e=>{const{__scopeTooltip:t,delayDuration:n=jse,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[a,s]=m.useState(!0),l=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),m.createElement(zse,{scope:t,isOpenDelayed:a,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),s(!1)},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>s(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(u=>{l.current=u},[]),disableHoverableContent:o},i)},dE="Tooltip",[Vse,nv]=tv(dE),Hse=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:a,delayDuration:s}=e,l=uE(dE,e.__scopeTooltip),c=cE(t),[u,d]=m.useState(null),h=yi(),p=m.useRef(0),v=a??l.disableHoverableContent,b=s??l.delayDuration,x=m.useRef(!1),[y=!1,_]=Fr({prop:r,defaultProp:o,onChange:T=>{T?(l.onOpen(),document.dispatchEvent(new CustomEvent(S_))):l.onClose(),i==null||i(T)}}),S=m.useMemo(()=>y?x.current?"delayed-open":"instant-open":"closed",[y]),C=m.useCallback(()=>{window.clearTimeout(p.current),x.current=!1,_(!0)},[_]),E=m.useCallback(()=>{window.clearTimeout(p.current),_(!1)},[_]),$=m.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{x.current=!0,_(!0)},b)},[b,_]);return m.useEffect(()=>()=>window.clearTimeout(p.current),[]),m.createElement(mp,c,m.createElement(Vse,{scope:t,contentId:h,open:y,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:m.useCallback(()=>{l.isOpenDelayed?$():C()},[l.isOpenDelayed,$,C]),onTriggerLeave:m.useCallback(()=>{v?E():window.clearTimeout(p.current)},[E,v]),onOpen:C,onClose:E,disableHoverableContent:v},n))},FT="TooltipTrigger",Z7=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=nv(FT,n),i=uE(FT,n),a=cE(n),s=m.useRef(null),l=Rt(t,s,o.onTriggerChange),c=m.useRef(!1),u=m.useRef(!1),d=m.useCallback(()=>c.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),m.createElement(bp,ue({asChild:!0},a),m.createElement(Qe.button,ue({"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute},r,{ref:l,onPointerMove:ke(e.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:ke(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:ke(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:ke(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:ke(e.onBlur,o.onClose),onClick:ke(e.onClick,o.onClose)})))}),Wse="TooltipPortal",[i5e,Use]=tv(Wse,{forceMount:void 0}),yh="TooltipContent",qse=m.forwardRef((e,t)=>{const n=Use(yh,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,a=nv(yh,e.__scopeTooltip);return m.createElement(pr,{present:r||a.open},a.disableHoverableContent?m.createElement(eI,ue({side:o},i,{ref:t})):m.createElement(Gse,ue({side:o},i,{ref:t})))}),Gse=m.forwardRef((e,t)=>{const n=nv(yh,e.__scopeTooltip),r=uE(yh,e.__scopeTooltip),o=m.useRef(null),i=Rt(t,o),[a,s]=m.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:d}=r,h=m.useCallback(()=>{s(null),d(!1)},[d]),p=m.useCallback((v,b)=>{const x=v.currentTarget,y={x:v.clientX,y:v.clientY},_=Kse(y,x.getBoundingClientRect()),S=Xse(y,_),C=Qse(b.getBoundingClientRect()),E=Zse([...S,...C]);s(E),d(!0)},[d]);return m.useEffect(()=>()=>h(),[h]),m.useEffect(()=>{if(l&&u){const v=x=>p(x,u),b=x=>p(x,l);return l.addEventListener("pointerleave",v),u.addEventListener("pointerleave",b),()=>{l.removeEventListener("pointerleave",v),u.removeEventListener("pointerleave",b)}}},[l,u,p,h]),m.useEffect(()=>{if(a){const v=b=>{const x=b.target,y={x:b.clientX,y:b.clientY},_=(l==null?void 0:l.contains(x))||(u==null?void 0:u.contains(x)),S=!Jse(y,a);_?h():S&&(h(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,u,a,c,h]),m.createElement(eI,ue({},e,{ref:i}))}),[Yse,a5e]=tv(dE,{isInside:!1}),eI=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:a,...s}=e,l=nv(yh,n),c=cE(n),{onClose:u}=l;return m.useEffect(()=>(document.addEventListener(S_,u),()=>document.removeEventListener(S_,u)),[u]),m.useEffect(()=>{if(l.trigger){const d=h=>{const p=h.target;p!=null&&p.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),m.createElement(yp,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:u},m.createElement(vp,ue({"data-state":l.stateAttribute},c,s,{ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),m.createElement(Q7,null,r),m.createElement(Yse,{scope:n,isInside:!0},m.createElement(Lse,{id:l.contentId,role:"tooltip"},o||r))))});function Kse(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Xse(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Qse(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Jse(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const s=t[i].x,l=t[i].y,c=t[a].x,u=t[a].y;l>r!=u>r&&n<(c-s)*(r-l)/(u-l)+s&&(o=!o)}return o}function Zse(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),ele(t)}function ele(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],a=t[t.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const tle=Bse,nle=Hse,rle=Z7,tI=qse,ole=tle,nI=nle,rI=rle,fE=j.forwardRef(({className:e,sideOffset:t=4,...n},r)=>R.jsx(tI,{ref:r,sideOffset:t,className:ye("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));fE.displayName=tI.displayName;/*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */const{entries:oI,setPrototypeOf:jT,isFrozen:ile,getPrototypeOf:ale,getOwnPropertyDescriptor:sle}=Object;let{freeze:zr,seal:Zo,create:iI}=Object,{apply:C_,construct:E_}=typeof Reflect<"u"&&Reflect;zr||(zr=function(t){return t});Zo||(Zo=function(t){return t});C_||(C_=function(t,n,r){return t.apply(n,r)});E_||(E_=function(t,n){return new t(...n)});const lm=To(Array.prototype.forEach),zT=To(Array.prototype.pop),rf=To(Array.prototype.push),n0=To(String.prototype.toLowerCase),L1=To(String.prototype.toString),BT=To(String.prototype.match),of=To(String.prototype.replace),lle=To(String.prototype.indexOf),cle=To(String.prototype.trim),ui=To(Object.prototype.hasOwnProperty),Tr=To(RegExp.prototype.test),af=ule(TypeError);function To(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return C_(e,t,r)}}function ule(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return E_(e,n)}}function Mt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:n0;jT&&jT(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const i=n(o);i!==o&&(ile(t)||(t[r]=i),o=i)}e[o]=!0}return e}function dle(e){for(let t=0;t<e.length;t++)ui(e,t)||(e[t]=null);return e}function wl(e){const t=iI(null);for(const[n,r]of oI(e))ui(e,n)&&(Array.isArray(r)?t[n]=dle(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=wl(r):t[n]=r);return t}function sf(e,t){for(;e!==null;){const r=sle(e,t);if(r){if(r.get)return To(r.get);if(typeof r.value=="function")return To(r.value)}e=ale(e)}function n(){return null}return n}const VT=zr(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),F1=zr(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),j1=zr(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),fle=zr(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),z1=zr(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),hle=zr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),HT=zr(["#text"]),WT=zr(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),B1=zr(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),UT=zr(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),cm=zr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ple=Zo(/\{\{[\w\W]*|[\w\W]*\}\}/gm),gle=Zo(/<%[\w\W]*|[\w\W]*%>/gm),mle=Zo(/\${[\w\W]*}/gm),ble=Zo(/^data-[\-\w.\u00B7-\uFFFF]/),vle=Zo(/^aria-[\-\w]+$/),aI=Zo(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),yle=Zo(/^(?:\w+script|data):/i),xle=Zo(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),sI=Zo(/^html$/i),wle=Zo(/^[a-z][.\w]*(-[.\w]+)+$/i);var qT=Object.freeze({__proto__:null,MUSTACHE_EXPR:ple,ERB_EXPR:gle,TMPLIT_EXPR:mle,DATA_ATTR:ble,ARIA_ATTR:vle,IS_ALLOWED_URI:aI,IS_SCRIPT_OR_DATA:yle,ATTR_WHITESPACE:xle,DOCTYPE_NAME:sI,CUSTOM_ELEMENT:wle});const lf={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},_le=function(){return typeof window>"u"?null:window},Sle=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(r=n.getAttribute(o));const i="dompurify"+(r?"#"+r:"");try{return t.createPolicy(i,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function lI(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_le();const t=Ae=>lI(Ae);if(t.version="3.1.6",t.removed=[],!e||!e.document||e.document.nodeType!==lf.document)return t.isSupported=!1,t;let{document:n}=e;const r=n,o=r.currentScript,{DocumentFragment:i,HTMLTemplateElement:a,Node:s,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:p}=e,v=l.prototype,b=sf(v,"cloneNode"),x=sf(v,"remove"),y=sf(v,"nextSibling"),_=sf(v,"childNodes"),S=sf(v,"parentNode");if(typeof a=="function"){const Ae=n.createElement("template");Ae.content&&Ae.content.ownerDocument&&(n=Ae.content.ownerDocument)}let C,E="";const{implementation:$,createNodeIterator:T,createDocumentFragment:D,getElementsByTagName:M}=n,{importNode:L}=r;let F={};t.isSupported=typeof oI=="function"&&typeof S=="function"&&$&&$.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:z,ERB_EXPR:X,TMPLIT_EXPR:G,DATA_ATTR:A,ARIA_ATTR:U,IS_SCRIPT_OR_DATA:V,ATTR_WHITESPACE:K,CUSTOM_ELEMENT:q}=qT;let{IS_ALLOWED_URI:O}=qT,H=null;const Y=Mt({},[...VT,...F1,...j1,...z1,...HT]);let I=null;const te=Mt({},[...WT,...B1,...UT,...cm]);let ce=Object.seal(iI(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),de=null,he=null,ie=!0,re=!0,le=!1,xe=!0,Z=!1,ve=!0,Ce=!1,Oe=!1,Te=!1,We=!1,Be=!1,Ie=!1,Ke=!0,dt=!1;const Bt="user-content-";let It=!0,Qt=!1,pe={},Re=null;const Le=Mt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ge=null;const Ze=Mt({},["audio","video","img","source","image","track"]);let Jt=null;const ln=Mt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),rn="http://www.w3.org/1998/Math/MathML",En="http://www.w3.org/2000/svg",vn="http://www.w3.org/1999/xhtml";let Wt=vn,dn=!1,$n=null;const rt=Mt({},[rn,En,vn],L1);let mt=null;const Nt=["application/xhtml+xml","text/html"],on="text/html";let _t=null,zn=null;const ni=n.createElement("form"),Ya=function(J){return J instanceof RegExp||J instanceof Function},ri=function(){let J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(zn&&zn===J)){if((!J||typeof J!="object")&&(J={}),J=wl(J),mt=Nt.indexOf(J.PARSER_MEDIA_TYPE)===-1?on:J.PARSER_MEDIA_TYPE,_t=mt==="application/xhtml+xml"?L1:n0,H=ui(J,"ALLOWED_TAGS")?Mt({},J.ALLOWED_TAGS,_t):Y,I=ui(J,"ALLOWED_ATTR")?Mt({},J.ALLOWED_ATTR,_t):te,$n=ui(J,"ALLOWED_NAMESPACES")?Mt({},J.ALLOWED_NAMESPACES,L1):rt,Jt=ui(J,"ADD_URI_SAFE_ATTR")?Mt(wl(ln),J.ADD_URI_SAFE_ATTR,_t):ln,Ge=ui(J,"ADD_DATA_URI_TAGS")?Mt(wl(Ze),J.ADD_DATA_URI_TAGS,_t):Ze,Re=ui(J,"FORBID_CONTENTS")?Mt({},J.FORBID_CONTENTS,_t):Le,de=ui(J,"FORBID_TAGS")?Mt({},J.FORBID_TAGS,_t):{},he=ui(J,"FORBID_ATTR")?Mt({},J.FORBID_ATTR,_t):{},pe=ui(J,"USE_PROFILES")?J.USE_PROFILES:!1,ie=J.ALLOW_ARIA_ATTR!==!1,re=J.ALLOW_DATA_ATTR!==!1,le=J.ALLOW_UNKNOWN_PROTOCOLS||!1,xe=J.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Z=J.SAFE_FOR_TEMPLATES||!1,ve=J.SAFE_FOR_XML!==!1,Ce=J.WHOLE_DOCUMENT||!1,We=J.RETURN_DOM||!1,Be=J.RETURN_DOM_FRAGMENT||!1,Ie=J.RETURN_TRUSTED_TYPE||!1,Te=J.FORCE_BODY||!1,Ke=J.SANITIZE_DOM!==!1,dt=J.SANITIZE_NAMED_PROPS||!1,It=J.KEEP_CONTENT!==!1,Qt=J.IN_PLACE||!1,O=J.ALLOWED_URI_REGEXP||aI,Wt=J.NAMESPACE||vn,ce=J.CUSTOM_ELEMENT_HANDLING||{},J.CUSTOM_ELEMENT_HANDLING&&Ya(J.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ce.tagNameCheck=J.CUSTOM_ELEMENT_HANDLING.tagNameCheck),J.CUSTOM_ELEMENT_HANDLING&&Ya(J.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ce.attributeNameCheck=J.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),J.CUSTOM_ELEMENT_HANDLING&&typeof J.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ce.allowCustomizedBuiltInElements=J.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Z&&(re=!1),Be&&(We=!0),pe&&(H=Mt({},HT),I=[],pe.html===!0&&(Mt(H,VT),Mt(I,WT)),pe.svg===!0&&(Mt(H,F1),Mt(I,B1),Mt(I,cm)),pe.svgFilters===!0&&(Mt(H,j1),Mt(I,B1),Mt(I,cm)),pe.mathMl===!0&&(Mt(H,z1),Mt(I,UT),Mt(I,cm))),J.ADD_TAGS&&(H===Y&&(H=wl(H)),Mt(H,J.ADD_TAGS,_t)),J.ADD_ATTR&&(I===te&&(I=wl(I)),Mt(I,J.ADD_ATTR,_t)),J.ADD_URI_SAFE_ATTR&&Mt(Jt,J.ADD_URI_SAFE_ATTR,_t),J.FORBID_CONTENTS&&(Re===Le&&(Re=wl(Re)),Mt(Re,J.FORBID_CONTENTS,_t)),It&&(H["#text"]=!0),Ce&&Mt(H,["html","head","body"]),H.table&&(Mt(H,["tbody"]),delete de.tbody),J.TRUSTED_TYPES_POLICY){if(typeof J.TRUSTED_TYPES_POLICY.createHTML!="function")throw af('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof J.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw af('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=J.TRUSTED_TYPES_POLICY,E=C.createHTML("")}else C===void 0&&(C=Sle(p,o)),C!==null&&typeof E=="string"&&(E=C.createHTML(""));zr&&zr(J),zn=J}},aa=Mt({},["mi","mo","mn","ms","mtext"]),Ci=Mt({},["foreignobject","annotation-xml"]),sa=Mt({},["title","style","font","a","script"]),Ka=Mt({},[...F1,...j1,...fle]),Ei=Mt({},[...z1,...hle]),la=function(J){let me=S(J);(!me||!me.tagName)&&(me={namespaceURI:Wt,tagName:"template"});const Me=n0(J.tagName),lt=n0(me.tagName);return $n[J.namespaceURI]?J.namespaceURI===En?me.namespaceURI===vn?Me==="svg":me.namespaceURI===rn?Me==="svg"&&(lt==="annotation-xml"||aa[lt]):!!Ka[Me]:J.namespaceURI===rn?me.namespaceURI===vn?Me==="math":me.namespaceURI===En?Me==="math"&&Ci[lt]:!!Ei[Me]:J.namespaceURI===vn?me.namespaceURI===En&&!Ci[lt]||me.namespaceURI===rn&&!aa[lt]?!1:!Ei[Me]&&(sa[Me]||!Ka[Me]):!!(mt==="application/xhtml+xml"&&$n[J.namespaceURI]):!1},Jn=function(J){rf(t.removed,{element:J});try{S(J).removeChild(J)}catch{x(J)}},Ri=function(J,me){try{rf(t.removed,{attribute:me.getAttributeNode(J),from:me})}catch{rf(t.removed,{attribute:null,from:me})}if(me.removeAttribute(J),J==="is"&&!I[J])if(We||Be)try{Jn(me)}catch{}else try{me.setAttribute(J,"")}catch{}},Xa=function(J){let me=null,Me=null;if(Te)J="<remove></remove>"+J;else{const pt=BT(J,/^[\r\n\t ]+/);Me=pt&&pt[0]}mt==="application/xhtml+xml"&&Wt===vn&&(J='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+J+"</body></html>");const lt=C?C.createHTML(J):J;if(Wt===vn)try{me=new h().parseFromString(lt,mt)}catch{}if(!me||!me.documentElement){me=$.createDocument(Wt,"template",null);try{me.documentElement.innerHTML=dn?E:lt}catch{}}const Rn=me.body||me.documentElement;return J&&Me&&Rn.insertBefore(n.createTextNode(Me),Rn.childNodes[0]||null),Wt===vn?M.call(me,Ce?"html":"body")[0]:Ce?me.documentElement:Rn},Qa=function(J){return T.call(J.ownerDocument||J,J,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},k=function(J){return J instanceof d&&(typeof J.nodeName!="string"||typeof J.textContent!="string"||typeof J.removeChild!="function"||!(J.attributes instanceof u)||typeof J.removeAttribute!="function"||typeof J.setAttribute!="function"||typeof J.namespaceURI!="string"||typeof J.insertBefore!="function"||typeof J.hasChildNodes!="function")},ne=function(J){return typeof s=="function"&&J instanceof s},fe=function(J,me,Me){F[J]&&lm(F[J],lt=>{lt.call(t,me,Me,zn)})},$e=function(J){let me=null;if(fe("beforeSanitizeElements",J,null),k(J))return Jn(J),!0;const Me=_t(J.nodeName);if(fe("uponSanitizeElement",J,{tagName:Me,allowedTags:H}),J.hasChildNodes()&&!ne(J.firstElementChild)&&Tr(/<[/\w]/g,J.innerHTML)&&Tr(/<[/\w]/g,J.textContent)||J.nodeType===lf.progressingInstruction||ve&&J.nodeType===lf.comment&&Tr(/<[/\w]/g,J.data))return Jn(J),!0;if(!H[Me]||de[Me]){if(!de[Me]&&qe(Me)&&(ce.tagNameCheck instanceof RegExp&&Tr(ce.tagNameCheck,Me)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(Me)))return!1;if(It&&!Re[Me]){const lt=S(J)||J.parentNode,Rn=_(J)||J.childNodes;if(Rn&&lt){const pt=Rn.length;for(let gr=pt-1;gr>=0;--gr){const ko=b(Rn[gr],!0);ko.__removalCount=(J.__removalCount||0)+1,lt.insertBefore(ko,y(J))}}}return Jn(J),!0}return J instanceof l&&!la(J)||(Me==="noscript"||Me==="noembed"||Me==="noframes")&&Tr(/<\/no(script|embed|frames)/i,J.innerHTML)?(Jn(J),!0):(Z&&J.nodeType===lf.text&&(me=J.textContent,lm([z,X,G],lt=>{me=of(me,lt," ")}),J.textContent!==me&&(rf(t.removed,{element:J.cloneNode()}),J.textContent=me)),fe("afterSanitizeElements",J,null),!1)},Ve=function(J,me,Me){if(Ke&&(me==="id"||me==="name")&&(Me in n||Me in ni))return!1;if(!(re&&!he[me]&&Tr(A,me))){if(!(ie&&Tr(U,me))){if(!I[me]||he[me]){if(!(qe(J)&&(ce.tagNameCheck instanceof RegExp&&Tr(ce.tagNameCheck,J)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(J))&&(ce.attributeNameCheck instanceof RegExp&&Tr(ce.attributeNameCheck,me)||ce.attributeNameCheck instanceof Function&&ce.attributeNameCheck(me))||me==="is"&&ce.allowCustomizedBuiltInElements&&(ce.tagNameCheck instanceof RegExp&&Tr(ce.tagNameCheck,Me)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(Me))))return!1}else if(!Jt[me]){if(!Tr(O,of(Me,K,""))){if(!((me==="src"||me==="xlink:href"||me==="href")&&J!=="script"&&lle(Me,"data:")===0&&Ge[J])){if(!(le&&!Tr(V,of(Me,K,"")))){if(Me)return!1}}}}}}return!0},qe=function(J){return J!=="annotation-xml"&&BT(J,q)},ze=function(J){fe("beforeSanitizeAttributes",J,null);const{attributes:me}=J;if(!me)return;const Me={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:I};let lt=me.length;for(;lt--;){const Rn=me[lt],{name:pt,namespaceURI:gr,value:ko}=Rn,el=_t(pt);let Zn=pt==="value"?ko:cle(ko);if(Me.attrName=el,Me.attrValue=Zn,Me.keepAttr=!0,Me.forceKeepAttr=void 0,fe("uponSanitizeAttribute",J,Me),Zn=Me.attrValue,ve&&Tr(/((--!?|])>)|<\/(style|title)/i,Zn)){Ri(pt,J);continue}if(Me.forceKeepAttr||(Ri(pt,J),!Me.keepAttr))continue;if(!xe&&Tr(/\/>/i,Zn)){Ri(pt,J);continue}Z&&lm([z,X,G],Td=>{Zn=of(Zn,Td," ")});const Od=_t(J.nodeName);if(Ve(Od,el,Zn)){if(dt&&(el==="id"||el==="name")&&(Ri(pt,J),Zn=Bt+Zn),C&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!gr)switch(p.getAttributeType(Od,el)){case"TrustedHTML":{Zn=C.createHTML(Zn);break}case"TrustedScriptURL":{Zn=C.createScriptURL(Zn);break}}try{gr?J.setAttributeNS(gr,pt,Zn):J.setAttribute(pt,Zn),k(J)?Jn(J):zT(t.removed)}catch{}}}fe("afterSanitizeAttributes",J,null)},Fe=function Ae(J){let me=null;const Me=Qa(J);for(fe("beforeSanitizeShadowDOM",J,null);me=Me.nextNode();)fe("uponSanitizeShadowNode",me,null),!$e(me)&&(me.content instanceof i&&Ae(me.content),ze(me));fe("afterSanitizeShadowDOM",J,null)};return t.sanitize=function(Ae){let J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},me=null,Me=null,lt=null,Rn=null;if(dn=!Ae,dn&&(Ae="<!-->"),typeof Ae!="string"&&!ne(Ae))if(typeof Ae.toString=="function"){if(Ae=Ae.toString(),typeof Ae!="string")throw af("dirty is not a string, aborting")}else throw af("toString is not a function");if(!t.isSupported)return Ae;if(Oe||ri(J),t.removed=[],typeof Ae=="string"&&(Qt=!1),Qt){if(Ae.nodeName){const ko=_t(Ae.nodeName);if(!H[ko]||de[ko])throw af("root node is forbidden and cannot be sanitized in-place")}}else if(Ae instanceof s)me=Xa("<!---->"),Me=me.ownerDocument.importNode(Ae,!0),Me.nodeType===lf.element&&Me.nodeName==="BODY"||Me.nodeName==="HTML"?me=Me:me.appendChild(Me);else{if(!We&&!Z&&!Ce&&Ae.indexOf("<")===-1)return C&&Ie?C.createHTML(Ae):Ae;if(me=Xa(Ae),!me)return We?null:Ie?E:""}me&&Te&&Jn(me.firstChild);const pt=Qa(Qt?Ae:me);for(;lt=pt.nextNode();)$e(lt)||(lt.content instanceof i&&Fe(lt.content),ze(lt));if(Qt)return Ae;if(We){if(Be)for(Rn=D.call(me.ownerDocument);me.firstChild;)Rn.appendChild(me.firstChild);else Rn=me;return(I.shadowroot||I.shadowrootmode)&&(Rn=L.call(r,Rn,!0)),Rn}let gr=Ce?me.outerHTML:me.innerHTML;return Ce&&H["!doctype"]&&me.ownerDocument&&me.ownerDocument.doctype&&me.ownerDocument.doctype.name&&Tr(sI,me.ownerDocument.doctype.name)&&(gr="<!DOCTYPE "+me.ownerDocument.doctype.name+`>
252
+ `):e}function zne(e,t){const{element:n,datasetIndex:r,index:o}=t,i=e.getDatasetMeta(r).controller,{label:a,value:s}=i.getLabelAndValue(o);return{chart:e,label:a,parsed:i.getParsed(o),raw:e.data.datasets[r].data[o],formattedValue:s,dataset:i.getDataset(),dataIndex:o,datasetIndex:r,element:n}}function _O(e,t){const n=e.chart.ctx,{body:r,footer:o,title:i}=e,{boxWidth:a,boxHeight:s}=t,l=qn(t.bodyFont),c=qn(t.titleFont),u=qn(t.footerFont),d=i.length,h=o.length,p=r.length,v=fr(t.padding);let b=v.height,x=0,y=r.reduce((C,E)=>C+E.before.length+E.lines.length+E.after.length,0);if(y+=e.beforeBody.length+e.afterBody.length,d&&(b+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),y){const C=t.displayColors?Math.max(s,l.lineHeight):l.lineHeight;b+=p*C+(y-p)*l.lineHeight+(y-1)*t.bodySpacing}h&&(b+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let _=0;const S=function(C){x=Math.max(x,n.measureText(C).width+_)};return n.save(),n.font=c.string,nn(e.title,S),n.font=l.string,nn(e.beforeBody.concat(e.afterBody),S),_=t.displayColors?a+2+t.boxPadding:0,nn(r,C=>{nn(C.before,S),nn(C.lines,S),nn(C.after,S)}),_=0,n.font=u.string,nn(e.footer,S),n.restore(),x+=v.width,{width:x,height:b}}function Bne(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function Vne(e,t,n,r){const{x:o,width:i}=r,a=n.caretSize+n.caretPadding;if(e==="left"&&o+i+a>t.width||e==="right"&&o-i-a<0)return!0}function Hne(e,t,n,r){const{x:o,width:i}=n,{width:a,chartArea:{left:s,right:l}}=e;let c="center";return r==="center"?c=o<=(s+l)/2?"left":"right":o<=i/2?c="left":o>=a-i/2&&(c="right"),Vne(c,e,t,n)&&(c="center"),c}function SO(e,t,n){const r=n.yAlign||t.yAlign||Bne(e,n);return{xAlign:n.xAlign||t.xAlign||Hne(e,t,n,r),yAlign:r}}function Wne(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function Une(e,t,n){let{y:r,height:o}=e;return t==="top"?r+=n:t==="bottom"?r-=o+n:r-=o/2,r}function CO(e,t,n,r){const{caretSize:o,caretPadding:i,cornerRadius:a}=e,{xAlign:s,yAlign:l}=n,c=o+i,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:p}=ql(a);let v=Wne(t,s);const b=Une(t,l,c);return l==="center"?s==="left"?v+=c:s==="right"&&(v-=c):s==="left"?v-=Math.max(u,h)+o:s==="right"&&(v+=Math.max(d,p)+o),{x:rr(v,0,r.width-t.width),y:rr(b,0,r.height-t.height)}}function Kg(e,t,n){const r=fr(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function EO(e){return Ti([],Sa(e))}function qne(e,t,n){return Xs(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function RO(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const T3={beforeTitle:va,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:va,beforeBody:va,beforeLabel:va,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return Tt(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:va,afterBody:va,beforeFooter:va,footer:va,afterFooter:va};function Yr(e,t,n,r){const o=e[t].call(n,r);return typeof o>"u"?T3[t].call(n,r):o}var Xx;let PO=(Xx=class extends ra{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),o=r.enabled&&n.options.animation&&r.animations,i=new c3(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=qne(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,o=Yr(r,"beforeTitle",this,t),i=Yr(r,"title",this,t),a=Yr(r,"afterTitle",this,t);let s=[];return s=Ti(s,Sa(o)),s=Ti(s,Sa(i)),s=Ti(s,Sa(a)),s}getBeforeBody(t,n){return EO(Yr(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,o=[];return nn(t,i=>{const a={before:[],lines:[],after:[]},s=RO(r,i);Ti(a.before,Sa(Yr(s,"beforeLabel",this,i))),Ti(a.lines,Yr(s,"label",this,i)),Ti(a.after,Sa(Yr(s,"afterLabel",this,i))),o.push(a)}),o}getAfterBody(t,n){return EO(Yr(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,o=Yr(r,"beforeFooter",this,t),i=Yr(r,"footer",this,t),a=Yr(r,"afterFooter",this,t);let s=[];return s=Ti(s,Sa(o)),s=Ti(s,Sa(i)),s=Ti(s,Sa(a)),s}_createItems(t){const n=this._active,r=this.chart.data,o=[],i=[],a=[];let s=[],l,c;for(l=0,c=n.length;l<c;++l)s.push(zne(this.chart,n[l]));return t.filter&&(s=s.filter((u,d,h)=>t.filter(u,d,h,r))),t.itemSort&&(s=s.sort((u,d)=>t.itemSort(u,d,r))),nn(s,u=>{const d=RO(t.callbacks,u);o.push(Yr(d,"labelColor",this,u)),i.push(Yr(d,"labelPointStyle",this,u)),a.push(Yr(d,"labelTextColor",this,u))}),this.labelColors=o,this.labelPointStyles=i,this.labelTextColors=a,this.dataPoints=s,s}update(t,n){const r=this.options.setContext(this.getContext()),o=this._active;let i,a=[];if(!o.length)this.opacity!==0&&(i={opacity:0});else{const s=Pf[r.position].call(this,o,this._eventPosition);a=this._createItems(r),this.title=this.getTitle(a,r),this.beforeBody=this.getBeforeBody(a,r),this.body=this.getBody(a,r),this.afterBody=this.getAfterBody(a,r),this.footer=this.getFooter(a,r);const l=this._size=_O(this,r),c=Object.assign({},s,l),u=SO(this.chart,r,c),d=CO(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,i={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:s.x,caretY:s.y}}this._tooltipItems=a,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,o){const i=this.getCaretPosition(t,r,o);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)}getCaretPosition(t,n,r){const{xAlign:o,yAlign:i}=this,{caretSize:a,cornerRadius:s}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=ql(s),{x:h,y:p}=t,{width:v,height:b}=n;let x,y,_,S,C,E;return i==="center"?(C=p+b/2,o==="left"?(x=h,y=x-a,S=C+a,E=C-a):(x=h+v,y=x+a,S=C-a,E=C+a),_=x):(o==="left"?y=h+Math.max(l,u)+a:o==="right"?y=h+v-Math.max(c,d)-a:y=this.caretX,i==="top"?(S=p,C=S-a,x=y-a,_=y+a):(S=p+b,C=S+a,x=y+a,_=y-a),E=S),{x1:x,x2:y,x3:_,y1:S,y2:C,y3:E}}drawTitle(t,n,r){const o=this.title,i=o.length;let a,s,l;if(i){const c=wu(r.rtl,this.x,this.width);for(t.x=Kg(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",a=qn(r.titleFont),s=r.titleSpacing,n.fillStyle=r.titleColor,n.font=a.string,l=0;l<i;++l)n.fillText(o[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s,l+1===i&&(t.y+=r.titleMarginBottom-s)}}_drawColorBox(t,n,r,o,i){const a=this.labelColors[r],s=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=i,u=qn(i.bodyFont),d=Kg(this,"left",i),h=o.x(d),p=l<u.lineHeight?(u.lineHeight-l)/2:0,v=n.y+p;if(i.usePointStyle){const b={radius:Math.min(c,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},x=o.leftForLtr(h,c)+c/2,y=v+l/2;t.strokeStyle=i.multiKeyBackground,t.fillStyle=i.multiKeyBackground,_0(t,b,x,y),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,_0(t,b,x,y)}else{t.lineWidth=kt(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const b=o.leftForLtr(h,c),x=o.leftForLtr(o.xPlus(h,1),c-2),y=ql(a.borderRadius);Object.values(y).some(_=>_!==0)?(t.beginPath(),t.fillStyle=i.multiKeyBackground,ch(t,{x:b,y:v,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),ch(t,{x,y:v+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=i.multiKeyBackground,t.fillRect(b,v,c,l),t.strokeRect(b,v,c,l),t.fillStyle=a.backgroundColor,t.fillRect(x,v+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:o}=this,{bodySpacing:i,bodyAlign:a,displayColors:s,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=qn(r.bodyFont);let h=d.lineHeight,p=0;const v=wu(r.rtl,this.x,this.width),b=function(D){n.fillText(D,v.x(t.x+p),t.y+h/2),t.y+=h+i},x=v.textAlign(a);let y,_,S,C,E,$,T;for(n.textAlign=a,n.textBaseline="middle",n.font=d.string,t.x=Kg(this,x,r),n.fillStyle=r.bodyColor,nn(this.beforeBody,b),p=s&&x!=="right"?a==="center"?c/2+u:c+2+u:0,C=0,$=o.length;C<$;++C){for(y=o[C],_=this.labelTextColors[C],n.fillStyle=_,nn(y.before,b),S=y.lines,s&&S.length&&(this._drawColorBox(n,t,C,v,r),h=Math.max(d.lineHeight,l)),E=0,T=S.length;E<T;++E)b(S[E]),h=d.lineHeight;nn(y.after,b)}p=0,h=d.lineHeight,nn(this.afterBody,b),t.y-=i}drawFooter(t,n,r){const o=this.footer,i=o.length;let a,s;if(i){const l=wu(r.rtl,this.x,this.width);for(t.x=Kg(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",a=qn(r.footerFont),n.fillStyle=r.footerColor,n.font=a.string,s=0;s<i;++s)n.fillText(o[s],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r.footerSpacing}}drawBackground(t,n,r,o){const{xAlign:i,yAlign:a}=this,{x:s,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:h,bottomLeft:p,bottomRight:v}=ql(o.cornerRadius);n.fillStyle=o.backgroundColor,n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.beginPath(),n.moveTo(s+d,l),a==="top"&&this.drawCaret(t,n,r,o),n.lineTo(s+c-h,l),n.quadraticCurveTo(s+c,l,s+c,l+h),a==="center"&&i==="right"&&this.drawCaret(t,n,r,o),n.lineTo(s+c,l+u-v),n.quadraticCurveTo(s+c,l+u,s+c-v,l+u),a==="bottom"&&this.drawCaret(t,n,r,o),n.lineTo(s+p,l+u),n.quadraticCurveTo(s,l+u,s,l+u-p),a==="center"&&i==="left"&&this.drawCaret(t,n,r,o),n.lineTo(s,l+d),n.quadraticCurveTo(s,l,s+d,l),n.closePath(),n.fill(),o.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,o=r&&r.x,i=r&&r.y;if(o||i){const a=Pf[t.position].call(this,this._active,this._eventPosition);if(!a)return;const s=this._size=_O(this,t),l=Object.assign({},a,this._size),c=SO(n,t,l),u=CO(t,l,c,n);(o._to!==u.x||i._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=s.width,this.height=s.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const o={width:this.width,height:this.height},i={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const a=fr(n.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&s&&(t.save(),t.globalAlpha=r,this.drawBackground(i,t,o,n),o3(t,n.textDirection),i.y+=a.top,this.drawTitle(i,t,n),this.drawBody(i,t,n),this.drawFooter(i,t,n),i3(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,o=t.map(({datasetIndex:s,index:l})=>{const c=this.chart.getDatasetMeta(s);if(!c)throw new Error("Cannot find a dataset at index "+s);return{datasetIndex:s,element:c.data[l],index:l}}),i=!v0(r,o),a=this._positionChanged(o,n);(i||a)&&(this._active=o,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const o=this.options,i=this._active||[],a=this._getActiveElements(t,i,n,r),s=this._positionChanged(a,t),l=n||!v0(a,i)||s;return l&&(this._active=a,(o.enabled||o.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,o){const i=this.options;if(t.type==="mouseout")return[];if(!o)return n.filter(s=>this.chart.data.datasets[s.datasetIndex]&&this.chart.getDatasetMeta(s.datasetIndex).controller.getParsed(s.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,i.mode,i,r);return i.reverse&&a.reverse(),a}_positionChanged(t,n){const{caretX:r,caretY:o,options:i}=this,a=Pf[i.position].call(this,t,n);return a!==!1&&(r!==a.x||o!==a.y)}},Ne(Xx,"positioners",Pf),Xx);var D3={id:"tooltip",_element:PO,positioners:Pf,afterInit(e,t,n){n&&(e.tooltip=new PO({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:T3},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Gne=Object.freeze({__proto__:null,Colors:ane,Decimation:une,Filler:Tne,Legend:Nne,SubTitle:jne,Title:Fne,Tooltip:D3});const Yne=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Kne(e,t,n,r){const o=e.indexOf(t);if(o===-1)return Yne(e,t,n,r);const i=e.lastIndexOf(t);return o!==i?n:o}const Xne=(e,t)=>e===null?null:rr(Math.round(e),0,t);function $O(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class R0 extends Qs{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:o,label:i}of n)r[o]===i&&r.splice(o,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(Tt(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:Kne(r,t,st(n,t),this._addedLabels),Xne(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:o}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(o=this.getLabels().length-1)),this.min=r,this.max=o}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,o=[];let i=this.getLabels();i=t===0&&n===i.length-1?i:i.slice(t,n+1),this._valueRange=Math.max(i.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let a=t;a<=n;a++)o.push({value:a});return o}getLabelForValue(t){return $O.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}Ne(R0,"id","category"),Ne(R0,"defaults",{ticks:{callback:$O}});function Qne(e,t){const n=[],{bounds:o,step:i,min:a,max:s,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=e,p=i||1,v=u-1,{min:b,max:x}=t,y=!Tt(a),_=!Tt(s),S=!Tt(c),C=(x-b)/(d+1);let E=w$((x-b)/v/p)*p,$,T,D,M;if(E<1e-14&&!y&&!_)return[{value:b},{value:x}];M=Math.ceil(x/E)-Math.floor(b/E),M>v&&(E=w$(M*E/v/p)*p),Tt(l)||($=Math.pow(10,l),E=Math.ceil(E*$)/$),o==="ticks"?(T=Math.floor(b/E)*E,D=Math.ceil(x/E)*E):(T=b,D=x),y&&_&&i&&qJ((s-a)/i,E/1e3)?(M=Math.round(Math.min((s-a)/E,u)),E=(s-a)/M,T=a,D=s):S?(T=y?a:T,D=_?s:D,M=c-1,E=(D-T)/M):(M=(D-T)/E,jf(M,Math.round(M),E/1e3)?M=Math.round(M):M=Math.ceil(M));const L=Math.max(_$(E),_$(T));$=Math.pow(10,Tt(l)?L:l),T=Math.round(T*$)/$,D=Math.round(D*$)/$;let F=0;for(y&&(h&&T!==a?(n.push({value:a}),T<a&&F++,jf(Math.round((T+F*E)*$)/$,a,OO(a,C,e))&&F++):T<a&&F++);F<M;++F){const z=Math.round((T+F*E)*$)/$;if(_&&z>s)break;n.push({value:z})}return _&&h&&D!==s?n.length&&jf(n[n.length-1].value,s,OO(s,C,e))?n[n.length-1].value=s:n.push({value:s}):(!_||D===s)&&n.push({value:D}),n}function OO(e,t,{horizontal:n,minRotation:r}){const o=mi(r),i=(n?Math.sin(o):Math.cos(o))||.001,a=.75*t*(""+e).length;return Math.min(t/i,a)}class P0 extends Qs{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return Tt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:o,max:i}=this;const a=l=>o=n?o:l,s=l=>i=r?i:l;if(t){const l=Wi(o),c=Wi(i);l<0&&c<0?s(0):l>0&&c>0&&a(0)}if(o===i){let l=i===0?1:Math.abs(i*.05);s(i+l),t||a(o-l)}this.min=o,this.max=i}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,o;return r?(o=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,o>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${o} ticks. Limiting to 1000.`),o=1e3)):(o=this.computeTickLimit(),n=n||11),n&&(o=Math.min(n,o)),o}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const o={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},i=this._range||this,a=Qne(o,i);return t.bounds==="ticks"&&B6(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const o=(r-n)/Math.max(t.length-1,1)/2;n-=o,r+=o}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return fp(t,this.chart.options.locale,this.options.ticks.format)}}class ed extends P0{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Ln(t)?t:0,this.max=Ln(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=mi(this.options.ticks.minRotation),o=(t?Math.sin(r):Math.cos(r))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,i.lineHeight/o))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Ne(ed,"id","linear"),Ne(ed,"defaults",{ticks:{callback:Vb.formatters.numeric}});const dh=e=>Math.floor(Os(e)),ml=(e,t)=>Math.pow(10,dh(e)+t);function TO(e){return e/Math.pow(10,dh(e))===1}function DO(e,t,n){const r=Math.pow(10,n),o=Math.floor(e/r);return Math.ceil(t/r)-o}function Jne(e,t){const n=t-e;let r=dh(n);for(;DO(e,t,r)>10;)r++;for(;DO(e,t,r)<10;)r--;return Math.min(r,dh(e))}function Zne(e,{min:t,max:n}){t=mo(e.min,t);const r=[],o=dh(t);let i=Jne(t,n),a=i<0?Math.pow(10,Math.abs(i)):1;const s=Math.pow(10,i),l=o>i?Math.pow(10,o):0,c=Math.round((t-l)*a)/a,u=Math.floor((t-l)/s/10)*s*10;let d=Math.floor((c-u)/Math.pow(10,i)),h=mo(e.min,Math.round((l+u+d*Math.pow(10,i))*a)/a);for(;h<n;)r.push({value:h,major:TO(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(i++,d=2,a=i>=0?1:a),h=Math.round((l+u+d*Math.pow(10,i))*a)/a;const p=mo(e.max,h);return r.push({value:p,major:TO(p),significand:d}),r}class td extends Qs{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=P0.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return Ln(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Ln(t)?Math.max(0,t):null,this.max=Ln(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Ln(this._userMin)&&(this.min=t===ml(this.min,0)?ml(this.min,-1):ml(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,o=this.max;const i=s=>r=t?r:s,a=s=>o=n?o:s;r===o&&(r<=0?(i(1),a(10)):(i(ml(r,-1)),a(ml(o,1)))),r<=0&&i(ml(o,-1)),o<=0&&a(ml(r,1)),this.min=r,this.max=o}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=Zne(n,this);return t.bounds==="ticks"&&B6(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":fp(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Os(t),this._valueRange=Os(this.max)-Os(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Os(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}Ne(td,"id","logarithmic"),Ne(td,"defaults",{ticks:{callback:Vb.formatters.logarithmic,major:{enabled:!0}}});function Qw(e){const t=e.ticks;if(t.display&&e.display){const n=fr(t.backdropPadding);return st(t.font&&t.font.size,An.font.size)+n.height}return 0}function ere(e,t,n){return n=_n(n)?n:[n],{w:cZ(e,t.string,n),h:n.length*t.lineHeight}}function AO(e,t,n,r,o){return e===r||e===o?{start:t-n/2,end:t+n/2}:e<r||e>o?{start:t-n,end:t}:{start:t,end:t+n}}function tre(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],o=[],i=e._pointLabels.length,a=e.options.pointLabels,s=a.centerPointLabels?Cn/i:0;for(let l=0;l<i;l++){const c=a.setContext(e.getPointLabelContext(l));o[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+o[l],s),d=qn(c.font),h=ere(e.ctx,d,e._pointLabels[l]);r[l]=h;const p=xo(e.getIndexAngle(l)+s),v=Math.round(RC(p)),b=AO(v,u.x,h.w,0,180),x=AO(v,u.y,h.h,90,270);nre(n,t,p,b,x)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=ire(e,r,o)}function nre(e,t,n,r,o){const i=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n));let s=0,l=0;r.start<t.l?(s=(t.l-r.start)/i,e.l=Math.min(e.l,t.l-s)):r.end>t.r&&(s=(r.end-t.r)/i,e.r=Math.max(e.r,t.r+s)),o.start<t.t?(l=(t.t-o.start)/a,e.t=Math.min(e.t,t.t-l)):o.end>t.b&&(l=(o.end-t.b)/a,e.b=Math.max(e.b,t.b+l))}function rre(e,t,n){const r=e.drawingArea,{extra:o,additionalAngle:i,padding:a,size:s}=n,l=e.getPointPosition(t,r+o+a,i),c=Math.round(RC(xo(l.angle+Wn))),u=lre(l.y,s.h,c),d=are(c),h=sre(l.x,s.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+s.w,bottom:u+s.h}}function ore(e,t){if(!t)return!0;const{left:n,top:r,right:o,bottom:i}=e;return!(Ma({x:n,y:r},t)||Ma({x:n,y:i},t)||Ma({x:o,y:r},t)||Ma({x:o,y:i},t))}function ire(e,t,n){const r=[],o=e._pointLabels.length,i=e.options,{centerPointLabels:a,display:s}=i.pointLabels,l={extra:Qw(i)/2,additionalAngle:a?Cn/o:0};let c;for(let u=0;u<o;u++){l.padding=n[u],l.size=t[u];const d=rre(e,u,l);r.push(d),s==="auto"&&(d.visible=ore(d,c),d.visible&&(c=d))}return r}function are(e){return e===0||e===180?"center":e<180?"left":"right"}function sre(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function lre(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function cre(e,t,n){const{left:r,top:o,right:i,bottom:a}=n,{backdropColor:s}=t;if(!Tt(s)){const l=ql(t.borderRadius),c=fr(t.backdropPadding);e.fillStyle=s;const u=r-c.left,d=o-c.top,h=i-r+c.width,p=a-o+c.height;Object.values(l).some(v=>v!==0)?(e.beginPath(),ch(e,{x:u,y:d,w:h,h:p,radius:l}),e.fill()):e.fillRect(u,d,h,p)}}function ure(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let o=t-1;o>=0;o--){const i=e._pointLabelItems[o];if(!i.visible)continue;const a=r.setContext(e.getPointLabelContext(o));cre(n,a,i);const s=qn(a.font),{x:l,y:c,textAlign:u}=i;sc(n,e._pointLabels[o],l,c+s.lineHeight/2,s,{color:a.color,textAlign:u,textBaseline:"middle"})}}function A3(e,t,n,r){const{ctx:o}=e;if(n)o.arc(e.xCenter,e.yCenter,t,0,Sn);else{let i=e.getPointPosition(0,t);o.moveTo(i.x,i.y);for(let a=1;a<r;a++)i=e.getPointPosition(a,t),o.lineTo(i.x,i.y)}}function dre(e,t,n,r,o){const i=e.ctx,a=t.circular,{color:s,lineWidth:l}=t;!a&&!r||!s||!l||n<0||(i.save(),i.strokeStyle=s,i.lineWidth=l,i.setLineDash(o.dash),i.lineDashOffset=o.dashOffset,i.beginPath(),A3(e,n,a,r),i.closePath(),i.stroke(),i.restore())}function fre(e,t,n){return Xs(e,{label:n,index:t,type:"pointLabel"})}class $f extends P0{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=fr(Qw(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=Ln(t)&&!isNaN(t)?t:0,this.max=Ln(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Qw(this.options))}generateTickLabels(t){P0.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const o=cn(this.options.pointLabels.callback,[n,r],this);return o||o===0?o:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?tre(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,o){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-o)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,o))}getIndexAngle(t){const n=Sn/(this._pointLabels.length||1),r=this.options.startAngle||0;return xo(t*n+mi(r))}getDistanceFromCenterForValue(t){if(Tt(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(Tt(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return fre(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const o=this.getIndexAngle(t)-Wn+r;return{x:Math.cos(o)*n+this.xCenter,y:Math.sin(o)*n+this.yCenter,angle:o}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:o,bottom:i}=this._pointLabelItems[t];return{left:n,top:r,right:o,bottom:i}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),A3(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:o,border:i}=n,a=this._pointLabels.length;let s,l,c;if(n.pointLabels.display&&ure(this,a),o.display&&this.ticks.forEach((u,d)=>{if(d!==0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),p=o.setContext(h),v=i.setContext(h);dre(this,p,l,a,v)}}),r.display){for(t.save(),s=a-1;s>=0;s--){const u=r.setContext(this.getPointLabelContext(s)),{color:d,lineWidth:h}=u;!h||!d||(t.lineWidth=h,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(s,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const o=this.getIndexAngle(0);let i,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(o),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((s,l)=>{if(l===0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=qn(c.font);if(i=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,a=t.measureText(s.label).width,t.fillStyle=c.backdropColor;const d=fr(c.backdropPadding);t.fillRect(-a/2-d.left,-i-u.size/2-d.top,a+d.width,u.size+d.height)}sc(t,s.label,0,-i,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}Ne($f,"id","radialLinear"),Ne($f,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Vb.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Ne($f,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Ne($f,"descriptors",{angleLines:{_fallback:"grid"}});const Wb={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},eo=Object.keys(Wb);function MO(e,t){return e-t}function kO(e,t){if(Tt(t))return null;const n=e._adapter,{parser:r,round:o,isoWeekday:i}=e._parseOpts;let a=t;return typeof r=="function"&&(a=r(a)),Ln(a)||(a=typeof r=="string"?n.parse(a,r):n.parse(a)),a===null?null:(o&&(a=o==="week"&&(Qu(i)||i===!0)?n.startOf(a,"isoWeek",i):n.startOf(a,o)),+a)}function IO(e,t,n,r){const o=eo.length;for(let i=eo.indexOf(e);i<o-1;++i){const a=Wb[eo[i]],s=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-t)/(s*a.size))<=r)return eo[i]}return eo[o-1]}function hre(e,t,n,r,o){for(let i=eo.length-1;i>=eo.indexOf(n);i--){const a=eo[i];if(Wb[a].common&&e._adapter.diff(o,r,a)>=t-1)return a}return eo[n?eo.indexOf(n):0]}function pre(e){for(let t=eo.indexOf(e)+1,n=eo.length;t<n;++t)if(Wb[eo[t]].common)return eo[t]}function NO(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:o}=PC(n,t),i=n[r]>=t?n[r]:n[o];e[i]=!0}}function gre(e,t,n,r){const o=e._adapter,i=+o.startOf(t[0].value,r),a=t[t.length-1].value;let s,l;for(s=i;s<=a;s=+o.add(s,1,r))l=n[s],l>=0&&(t[l].major=!0);return t}function LO(e,t,n){const r=[],o={},i=t.length;let a,s;for(a=0;a<i;++a)s=t[a],o[s]=a,r.push({value:s,major:!1});return i===0||!n?r:gre(e,r,o,n)}class fh extends Qs{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),o=this._adapter=new Eee._date(t.adapters.date);o.init(n),Ff(r.displayFormats,o.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:kO(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:o,max:i,minDefined:a,maxDefined:s}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(o=Math.min(o,c.min)),!s&&!isNaN(c.max)&&(i=Math.max(i,c.max))}(!a||!s)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),o=Ln(o)&&!isNaN(o)?o:+n.startOf(Date.now(),r),i=Ln(i)&&!isNaN(i)?i:+n.endOf(Date.now(),r)+1,this.min=Math.min(o,i-1),this.max=Math.max(o+1,i)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,o=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&o.length&&(this.min=this._userMin||o[0],this.max=this._userMax||o[o.length-1]);const i=this.min,a=this.max,s=XJ(o,i,a);return this._unit=n.unit||(r.autoSkip?IO(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):hre(this,s.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:pre(this._unit),this.initOffsets(o),t.reverse&&s.reverse(),LO(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,o,i;this.options.offset&&t.length&&(o=this.getDecimalForValue(t[0]),t.length===1?n=1-o:n=(this.getDecimalForValue(t[1])-o)/2,i=this.getDecimalForValue(t[t.length-1]),t.length===1?r=i:r=(i-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;n=rr(n,0,a),r=rr(r,0,a),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,o=this.options,i=o.time,a=i.unit||IO(i.minUnit,n,r,this._getLabelCapacity(n)),s=st(o.ticks.stepSize,1),l=a==="week"?i.isoWeekday:!1,c=Qu(l)||l===!0,u={};let d=n,h,p;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":a),t.diff(r,n,a)>1e5*s)throw new Error(n+" and "+r+" are too far apart with stepSize of "+s+" "+a);const v=o.ticks.source==="data"&&this.getDataTimestamps();for(h=d,p=0;h<r;h=+t.add(h,s,a),p++)NO(u,h,v);return(h===r||o.bounds==="ticks"||p===1)&&NO(u,h,v),Object.keys(u).sort(MO).map(b=>+b)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const o=this.options.time.displayFormats,i=this._unit,a=n||o[i];return this._adapter.format(t,a)}_tickFormatFunction(t,n,r,o){const i=this.options,a=i.ticks.callback;if(a)return cn(a,[t,n,r],this);const s=i.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&s[l],d=c&&s[c],h=r[n],p=c&&d&&h&&h.major;return this._adapter.format(t,o||(p?d:u))}generateTickLabels(t){let n,r,o;for(n=0,r=t.length;n<r;++n)o=t[n],o.label=this._tickFormatFunction(o.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,o=mi(this.isHorizontal()?n.maxRotation:n.minRotation),i=Math.cos(o),a=Math.sin(o),s=this._resolveTickFontOptions(0).size;return{w:r*i+s*a,h:r*a+s*i}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,o=r[n.unit]||r.millisecond,i=this._tickFormatFunction(t,0,LO(this,[t],this._majorUnit),o),a=this._getLabelSize(i),s=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return s>0?s:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const o=this.getMatchingVisibleMetas();if(this._normalized&&o.length)return this._cache.data=o[0].controller.getAllParsedValues(this);for(n=0,r=o.length;n<r;++n)t=t.concat(o[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const o=this.getLabels();for(n=0,r=o.length;n<r;++n)t.push(kO(this,o[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return W6(t.sort(MO))}}Ne(fh,"id","time"),Ne(fh,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Xg(e,t,n){let r=0,o=e.length-1,i,a,s,l;n?(t>=e[r].pos&&t<=e[o].pos&&({lo:r,hi:o}=Aa(e,"pos",t)),{pos:i,time:s}=e[r],{pos:a,time:l}=e[o]):(t>=e[r].time&&t<=e[o].time&&({lo:r,hi:o}=Aa(e,"time",t)),{time:i,pos:s}=e[r],{time:a,pos:l}=e[o]);const c=a-i;return c?s+(l-s)*(t-i)/c:s}class Jw extends fh{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Xg(n,this.min),this._tableRange=Xg(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,o=[],i=[];let a,s,l,c,u;for(a=0,s=t.length;a<s;++a)c=t[a],c>=n&&c<=r&&o.push(c);if(o.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(a=0,s=o.length;a<s;++a)u=o[a+1],l=o[a-1],c=o[a],Math.round((u+l)/2)!==c&&i.push({time:c,pos:a/(s-1)});return i}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((o,i)=>o-i)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(Xg(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Xg(this._table,r*this._tableRange+this._minPos,!0)}}Ne(Jw,"id","timeseries"),Ne(Jw,"defaults",fh.defaults);var mre=Object.freeze({__proto__:null,CategoryScale:R0,LinearScale:ed,LogarithmicScale:td,RadialLinearScale:$f,TimeScale:fh,TimeSeriesScale:Jw});const bre=[Cee,ene,Gne,mre];class Bs{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let o=0;o<this._n&&o<32;o++){const i=n[o],a=t+i,s=Math.abs(t)<Math.abs(i)?t-(a-i):i-(a-t);s&&(n[r++]=s),t=a}return n[r]=t,this._n=r+1,this}valueOf(){const t=this._partials;let n=this._n,r,o,i,a=0;if(n>0){for(a=t[--n];n>0&&(r=a,o=t[--n],a=r+o,i=o-(a-r),!i););n>0&&(i<0&&t[n-1]<0||i>0&&t[n-1]>0)&&(o=i*2,r=a+o,o==r-a&&(a=r))}return a}}function*vre(e){for(const t of e)yield*t}function M3(e){return Array.from(vre(e))}function hu(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var r=-1,o=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(o);++r<o;)i[r]=e+r*n;return i}var nt=1e-6,jC=1e-12,Ot=Math.PI,In=Ot/2,FO=Ot/4,Oo=Ot*2,kr=180/Ot,un=Ot/180,Vt=Math.abs,bd=Math.atan,Ki=Math.atan2,gt=Math.cos,Qg=Math.ceil,k3=Math.exp,$0=Math.log,T1=Math.pow,ut=Math.sin,Ko=Math.sign||function(e){return e>0?1:e<0?-1:0},jr=Math.sqrt,zC=Math.tan;function I3(e){return e>1?0:e<-1?Ot:Math.acos(e)}function Qo(e){return e>1?In:e<-1?-In:Math.asin(e)}function nr(){}function O0(e,t){e&&zO.hasOwnProperty(e.type)&&zO[e.type](e,t)}var jO={Feature:function(e,t){O0(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,o=n.length;++r<o;)O0(n[r].geometry,t)}},zO={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){Zw(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)Zw(n[r],t,0)},Polygon:function(e,t){BO(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)BO(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,o=n.length;++r<o;)O0(n[r],t)}};function Zw(e,t,n){var r=-1,o=e.length-n,i;for(t.lineStart();++r<o;)i=e[r],t.point(i[0],i[1],i[2]);t.lineEnd()}function BO(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)Zw(e[n],t,1);t.polygonEnd()}function Cl(e,t){e&&jO.hasOwnProperty(e.type)?jO[e.type](e,t):O0(e,t)}function e_(e){return[Ki(e[1],e[0]),Qo(e[2])]}function nd(e){var t=e[0],n=e[1],r=gt(n);return[r*gt(t),r*ut(t),ut(n)]}function Jg(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function T0(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function D1(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Zg(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function t_(e){var t=jr(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function n_(e,t){function n(r,o){return r=e(r,o),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,o){return r=t.invert(r,o),r&&e.invert(r[0],r[1])}),n}function r_(e,t){return Vt(e)>Ot&&(e-=Math.round(e/Oo)*Oo),[e,t]}r_.invert=r_;function N3(e,t,n){return(e%=Oo)?t||n?n_(HO(e),WO(t,n)):HO(e):t||n?WO(t,n):r_}function VO(e){return function(t,n){return t+=e,Vt(t)>Ot&&(t-=Math.round(t/Oo)*Oo),[t,n]}}function HO(e){var t=VO(e);return t.invert=VO(-e),t}function WO(e,t){var n=gt(e),r=ut(e),o=gt(t),i=ut(t);function a(s,l){var c=gt(l),u=gt(s)*c,d=ut(s)*c,h=ut(l),p=h*n+u*r;return[Ki(d*o-p*i,u*n-h*r),Qo(p*o+d*i)]}return a.invert=function(s,l){var c=gt(l),u=gt(s)*c,d=ut(s)*c,h=ut(l),p=h*o-d*i;return[Ki(d*o+h*i,u*n+p*r),Qo(p*n-u*r)]},a}function yre(e){e=N3(e[0]*un,e[1]*un,e.length>2?e[2]*un:0);function t(n){return n=e(n[0]*un,n[1]*un),n[0]*=kr,n[1]*=kr,n}return t.invert=function(n){return n=e.invert(n[0]*un,n[1]*un),n[0]*=kr,n[1]*=kr,n},t}function xre(e,t,n,r,o,i){if(n){var a=gt(t),s=ut(t),l=r*n;o==null?(o=t+r*Oo,i=t-l/2):(o=UO(a,o),i=UO(a,i),(r>0?o<i:o>i)&&(o+=r*Oo));for(var c,u=o;r>0?u>i:u<i;u-=l)c=e_([a,-s*gt(u),-s*ut(u)]),e.point(c[0],c[1])}}function UO(e,t){t=nd(t),t[0]-=e,t_(t);var n=I3(-t[1]);return((-t[2]<0?-n:n)+Oo-nt)%Oo}function L3(){var e=[],t;return{point:function(n,r,o){t.push([n,r,o])},lineStart:function(){e.push(t=[])},lineEnd:nr,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Jm(e,t){return Vt(e[0]-t[0])<nt&&Vt(e[1]-t[1])<nt}function em(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function F3(e,t,n,r,o){var i=[],a=[],s,l;if(e.forEach(function(v){if(!((b=v.length-1)<=0)){var b,x=v[0],y=v[b],_;if(Jm(x,y)){if(!x[2]&&!y[2]){for(o.lineStart(),s=0;s<b;++s)o.point((x=v[s])[0],x[1]);o.lineEnd();return}y[0]+=2*nt}i.push(_=new em(x,v,null,!0)),a.push(_.o=new em(x,null,_,!1)),i.push(_=new em(y,v,null,!1)),a.push(_.o=new em(y,null,_,!0))}}),!!i.length){for(a.sort(t),qO(i),qO(a),s=0,l=a.length;s<l;++s)a[s].e=n=!n;for(var c=i[0],u,d;;){for(var h=c,p=!0;h.v;)if((h=h.n)===c)return;u=h.z,o.lineStart();do{if(h.v=h.o.v=!0,h.e){if(p)for(s=0,l=u.length;s<l;++s)o.point((d=u[s])[0],d[1]);else r(h.x,h.n.x,1,o);h=h.n}else{if(p)for(u=h.p.z,s=u.length-1;s>=0;--s)o.point((d=u[s])[0],d[1]);else r(h.x,h.p.x,-1,o);h=h.p}h=h.o,u=h.z,p=!p}while(!h.v);o.lineEnd()}}}function qO(e){if(t=e.length){for(var t,n=0,r=e[0],o;++n<t;)r.n=o=e[n],o.p=r,r=o;r.n=o=e[0],o.p=r}}function A1(e){return Vt(e[0])<=Ot?e[0]:Ko(e[0])*((Vt(e[0])+Ot)%Oo-Ot)}function j3(e,t){var n=A1(t),r=t[1],o=ut(r),i=[ut(n),-gt(n),0],a=0,s=0,l=new Bs;o===1?r=In+nt:o===-1&&(r=-In-nt);for(var c=0,u=e.length;c<u;++c)if(h=(d=e[c]).length)for(var d,h,p=d[h-1],v=A1(p),b=p[1]/2+FO,x=ut(b),y=gt(b),_=0;_<h;++_,v=C,x=$,y=T,p=S){var S=d[_],C=A1(S),E=S[1]/2+FO,$=ut(E),T=gt(E),D=C-v,M=D>=0?1:-1,L=M*D,F=L>Ot,z=x*$;if(l.add(Ki(z*M*ut(L),y*T+z*gt(L))),a+=F?D+M*Oo:D,F^v>=n^C>=n){var X=T0(nd(p),nd(S));t_(X);var G=T0(i,X);t_(G);var A=(F^D>=0?-1:1)*Qo(G[2]);(r>A||r===A&&(X[0]||X[1]))&&(s+=F^D>=0?1:-1)}}return(a<-nt||a<nt&&l<-jC)^s&1}function z3(e,t,n,r){return function(o){var i=t(o),a=L3(),s=t(a),l=!1,c,u,d,h={point:p,lineStart:b,lineEnd:x,polygonStart:function(){h.point=y,h.lineStart=_,h.lineEnd=S,u=[],c=[]},polygonEnd:function(){h.point=p,h.lineStart=b,h.lineEnd=x,u=M3(u);var C=j3(c,r);u.length?(l||(o.polygonStart(),l=!0),F3(u,_re,C,n,o)):C&&(l||(o.polygonStart(),l=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),l&&(o.polygonEnd(),l=!1),u=c=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function p(C,E){e(C,E)&&o.point(C,E)}function v(C,E){i.point(C,E)}function b(){h.point=v,i.lineStart()}function x(){h.point=p,i.lineEnd()}function y(C,E){d.push([C,E]),s.point(C,E)}function _(){s.lineStart(),d=[]}function S(){y(d[0][0],d[0][1]),s.lineEnd();var C=s.clean(),E=a.result(),$,T=E.length,D,M,L;if(d.pop(),c.push(d),d=null,!!T){if(C&1){if(M=E[0],(D=M.length-1)>0){for(l||(o.polygonStart(),l=!0),o.lineStart(),$=0;$<D;++$)o.point((L=M[$])[0],L[1]);o.lineEnd()}return}T>1&&C&2&&E.push(E.pop().concat(E.shift())),u.push(E.filter(wre))}}return h}}function wre(e){return e.length>1}function _re(e,t){return((e=e.x)[0]<0?e[1]-In-nt:In-e[1])-((t=t.x)[0]<0?t[1]-In-nt:In-t[1])}const GO=z3(function(){return!0},Sre,Ere,[-Ot,-In]);function Sre(e){var t=NaN,n=NaN,r=NaN,o;return{lineStart:function(){e.lineStart(),o=1},point:function(i,a){var s=i>0?Ot:-Ot,l=Vt(i-t);Vt(l-Ot)<nt?(e.point(t,n=(n+a)/2>0?In:-In),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(s,n),e.point(i,n),o=0):r!==s&&l>=Ot&&(Vt(t-r)<nt&&(t-=r*nt),Vt(i-s)<nt&&(i-=s*nt),n=Cre(t,n,i,a),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(s,n),o=0),e.point(t=i,n=a),r=s},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-o}}}function Cre(e,t,n,r){var o,i,a=ut(e-n);return Vt(a)>nt?bd((ut(t)*(i=gt(r))*ut(n)-ut(r)*(o=gt(t))*ut(e))/(o*i*a)):(t+r)/2}function Ere(e,t,n,r){var o;if(e==null)o=n*In,r.point(-Ot,o),r.point(0,o),r.point(Ot,o),r.point(Ot,0),r.point(Ot,-o),r.point(0,-o),r.point(-Ot,-o),r.point(-Ot,0),r.point(-Ot,o);else if(Vt(e[0]-t[0])>nt){var i=e[0]<t[0]?Ot:-Ot;o=n*i/2,r.point(-i,o),r.point(0,o),r.point(i,o)}else r.point(t[0],t[1])}function Rre(e){var t=gt(e),n=2*un,r=t>0,o=Vt(t)>nt;function i(u,d,h,p){xre(p,e,n,h,u,d)}function a(u,d){return gt(u)*gt(d)>t}function s(u){var d,h,p,v,b;return{lineStart:function(){v=p=!1,b=1},point:function(x,y){var _=[x,y],S,C=a(x,y),E=r?C?0:c(x,y):C?c(x+(x<0?Ot:-Ot),y):0;if(!d&&(v=p=C)&&u.lineStart(),C!==p&&(S=l(d,_),(!S||Jm(d,S)||Jm(_,S))&&(_[2]=1)),C!==p)b=0,C?(u.lineStart(),S=l(_,d),u.point(S[0],S[1])):(S=l(d,_),u.point(S[0],S[1],2),u.lineEnd()),d=S;else if(o&&d&&r^C){var $;!(E&h)&&($=l(_,d,!0))&&(b=0,r?(u.lineStart(),u.point($[0][0],$[0][1]),u.point($[1][0],$[1][1]),u.lineEnd()):(u.point($[1][0],$[1][1]),u.lineEnd(),u.lineStart(),u.point($[0][0],$[0][1],3)))}C&&(!d||!Jm(d,_))&&u.point(_[0],_[1]),d=_,p=C,h=E},lineEnd:function(){p&&u.lineEnd(),d=null},clean:function(){return b|(v&&p)<<1}}}function l(u,d,h){var p=nd(u),v=nd(d),b=[1,0,0],x=T0(p,v),y=Jg(x,x),_=x[0],S=y-_*_;if(!S)return!h&&u;var C=t*y/S,E=-t*_/S,$=T0(b,x),T=Zg(b,C),D=Zg(x,E);D1(T,D);var M=$,L=Jg(T,M),F=Jg(M,M),z=L*L-F*(Jg(T,T)-1);if(!(z<0)){var X=jr(z),G=Zg(M,(-L-X)/F);if(D1(G,T),G=e_(G),!h)return G;var A=u[0],U=d[0],V=u[1],K=d[1],q;U<A&&(q=A,A=U,U=q);var O=U-A,H=Vt(O-Ot)<nt,Y=H||O<nt;if(!H&&K<V&&(q=V,V=K,K=q),Y?H?V+K>0^G[1]<(Vt(G[0]-A)<nt?V:K):V<=G[1]&&G[1]<=K:O>Ot^(A<=G[0]&&G[0]<=U)){var I=Zg(M,(-L+X)/F);return D1(I,T),[G,e_(I)]}}}function c(u,d){var h=r?e:Ot-e,p=0;return u<-h?p|=1:u>h&&(p|=2),d<-h?p|=4:d>h&&(p|=8),p}return z3(a,s,i,r?[0,-e]:[-Ot,e-Ot])}function Pre(e,t,n,r,o,i){var a=e[0],s=e[1],l=t[0],c=t[1],u=0,d=1,h=l-a,p=c-s,v;if(v=n-a,!(!h&&v>0)){if(v/=h,h<0){if(v<u)return;v<d&&(d=v)}else if(h>0){if(v>d)return;v>u&&(u=v)}if(v=o-a,!(!h&&v<0)){if(v/=h,h<0){if(v>d)return;v>u&&(u=v)}else if(h>0){if(v<u)return;v<d&&(d=v)}if(v=r-s,!(!p&&v>0)){if(v/=p,p<0){if(v<u)return;v<d&&(d=v)}else if(p>0){if(v>d)return;v>u&&(u=v)}if(v=i-s,!(!p&&v<0)){if(v/=p,p<0){if(v>d)return;v>u&&(u=v)}else if(p>0){if(v<u)return;v<d&&(d=v)}return u>0&&(e[0]=a+u*h,e[1]=s+u*p),d<1&&(t[0]=a+d*h,t[1]=s+d*p),!0}}}}}var Of=1e9,tm=-Of;function $re(e,t,n,r){function o(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function i(c,u,d,h){var p=0,v=0;if(c==null||(p=a(c,d))!==(v=a(u,d))||l(c,u)<0^d>0)do h.point(p===0||p===3?e:n,p>1?r:t);while((p=(p+d+4)%4)!==v);else h.point(u[0],u[1])}function a(c,u){return Vt(c[0]-e)<nt?u>0?0:3:Vt(c[0]-n)<nt?u>0?2:1:Vt(c[1]-t)<nt?u>0?1:0:u>0?3:2}function s(c,u){return l(c.x,u.x)}function l(c,u){var d=a(c,1),h=a(u,1);return d!==h?d-h:d===0?u[1]-c[1]:d===1?c[0]-u[0]:d===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,d=L3(),h,p,v,b,x,y,_,S,C,E,$,T={point:D,lineStart:z,lineEnd:X,polygonStart:L,polygonEnd:F};function D(A,U){o(A,U)&&u.point(A,U)}function M(){for(var A=0,U=0,V=p.length;U<V;++U)for(var K=p[U],q=1,O=K.length,H=K[0],Y,I,te=H[0],ce=H[1];q<O;++q)Y=te,I=ce,H=K[q],te=H[0],ce=H[1],I<=r?ce>r&&(te-Y)*(r-I)>(ce-I)*(e-Y)&&++A:ce<=r&&(te-Y)*(r-I)<(ce-I)*(e-Y)&&--A;return A}function L(){u=d,h=[],p=[],$=!0}function F(){var A=M(),U=$&&A,V=(h=M3(h)).length;(U||V)&&(c.polygonStart(),U&&(c.lineStart(),i(null,null,1,c),c.lineEnd()),V&&F3(h,s,A,i,c),c.polygonEnd()),u=c,h=p=v=null}function z(){T.point=G,p&&p.push(v=[]),E=!0,C=!1,_=S=NaN}function X(){h&&(G(b,x),y&&C&&d.rejoin(),h.push(d.result())),T.point=D,C&&u.lineEnd()}function G(A,U){var V=o(A,U);if(p&&v.push([A,U]),E)b=A,x=U,y=V,E=!1,V&&(u.lineStart(),u.point(A,U));else if(V&&C)u.point(A,U);else{var K=[_=Math.max(tm,Math.min(Of,_)),S=Math.max(tm,Math.min(Of,S))],q=[A=Math.max(tm,Math.min(Of,A)),U=Math.max(tm,Math.min(Of,U))];Pre(K,q,e,t,n,r)?(C||(u.lineStart(),u.point(K[0],K[1])),u.point(q[0],q[1]),V||u.lineEnd(),$=!1):V&&(u.lineStart(),u.point(A,U),$=!1)}_=A,S=U,C=V}return T}}var o_,i_,Zm,e0,rd={sphere:nr,point:nr,lineStart:Ore,lineEnd:nr,polygonStart:nr,polygonEnd:nr};function Ore(){rd.point=Dre,rd.lineEnd=Tre}function Tre(){rd.point=rd.lineEnd=nr}function Dre(e,t){e*=un,t*=un,i_=e,Zm=ut(t),e0=gt(t),rd.point=Are}function Are(e,t){e*=un,t*=un;var n=ut(t),r=gt(t),o=Vt(e-i_),i=gt(o),a=ut(o),s=r*a,l=e0*n-Zm*r*i,c=Zm*n+e0*r*i;o_.add(Ki(jr(s*s+l*l),c)),i_=e,Zm=n,e0=r}function Mre(e){return o_=new Bs,Cl(e,rd),+o_}var a_=[null,null],kre={type:"LineString",coordinates:a_};function s_(e,t){return a_[0]=e,a_[1]=t,Mre(kre)}var YO={Feature:function(e,t){return D0(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,o=n.length;++r<o;)if(D0(n[r].geometry,t))return!0;return!1}},KO={Sphere:function(){return!0},Point:function(e,t){return XO(e.coordinates,t)},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if(XO(n[r],t))return!0;return!1},LineString:function(e,t){return QO(e.coordinates,t)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if(QO(n[r],t))return!0;return!1},Polygon:function(e,t){return JO(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if(JO(n[r],t))return!0;return!1},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,o=n.length;++r<o;)if(D0(n[r],t))return!0;return!1}};function D0(e,t){return e&&KO.hasOwnProperty(e.type)?KO[e.type](e,t):!1}function XO(e,t){return s_(e,t)===0}function QO(e,t){for(var n,r,o,i=0,a=e.length;i<a;i++){if(r=s_(e[i],t),r===0||i>0&&(o=s_(e[i],e[i-1]),o>0&&n<=o&&r<=o&&(n+r-o)*(1-Math.pow((n-r)/o,2))<jC*o))return!0;n=r}return!1}function JO(e,t){return!!j3(e.map(Ire),B3(t))}function Ire(e){return e=e.map(B3),e.pop(),e}function B3(e){return[e[0]*un,e[1]*un]}function Nre(e,t){return(e&&YO.hasOwnProperty(e.type)?YO[e.type]:D0)(e,t)}function ZO(e,t,n){var r=hu(e,t-nt,n).concat(t);return function(o){return r.map(function(i){return[o,i]})}}function eT(e,t,n){var r=hu(e,t-nt,n).concat(t);return function(o){return r.map(function(i){return[i,o]})}}function V3(){var e,t,n,r,o,i,a,s,l=10,c=l,u=90,d=360,h,p,v,b,x=2.5;function y(){return{type:"MultiLineString",coordinates:_()}}function _(){return hu(Qg(r/u)*u,n,u).map(v).concat(hu(Qg(s/d)*d,a,d).map(b)).concat(hu(Qg(t/l)*l,e,l).filter(function(S){return Vt(S%u)>nt}).map(h)).concat(hu(Qg(i/c)*c,o,c).filter(function(S){return Vt(S%d)>nt}).map(p))}return y.lines=function(){return _().map(function(S){return{type:"LineString",coordinates:S}})},y.outline=function(){return{type:"Polygon",coordinates:[v(r).concat(b(a).slice(1),v(n).reverse().slice(1),b(s).reverse().slice(1))]}},y.extent=function(S){return arguments.length?y.extentMajor(S).extentMinor(S):y.extentMinor()},y.extentMajor=function(S){return arguments.length?(r=+S[0][0],n=+S[1][0],s=+S[0][1],a=+S[1][1],r>n&&(S=r,r=n,n=S),s>a&&(S=s,s=a,a=S),y.precision(x)):[[r,s],[n,a]]},y.extentMinor=function(S){return arguments.length?(t=+S[0][0],e=+S[1][0],i=+S[0][1],o=+S[1][1],t>e&&(S=t,t=e,e=S),i>o&&(S=i,i=o,o=S),y.precision(x)):[[t,i],[e,o]]},y.step=function(S){return arguments.length?y.stepMajor(S).stepMinor(S):y.stepMinor()},y.stepMajor=function(S){return arguments.length?(u=+S[0],d=+S[1],y):[u,d]},y.stepMinor=function(S){return arguments.length?(l=+S[0],c=+S[1],y):[l,c]},y.precision=function(S){return arguments.length?(x=+S,h=ZO(i,o,90),p=eT(t,e,x),v=ZO(s,a,90),b=eT(r,n,x),y):x},y.extentMajor([[-180,-90+nt],[180,90-nt]]).extentMinor([[-180,-80-nt],[180,80+nt]])}function Lre(){return V3()()}const l_=e=>e;var M1=new Bs,c_=new Bs,H3,W3,u_,d_,xs={point:nr,lineStart:nr,lineEnd:nr,polygonStart:function(){xs.lineStart=Fre,xs.lineEnd=zre},polygonEnd:function(){xs.lineStart=xs.lineEnd=xs.point=nr,M1.add(Vt(c_)),c_=new Bs},result:function(){var e=M1/2;return M1=new Bs,e}};function Fre(){xs.point=jre}function jre(e,t){xs.point=U3,H3=u_=e,W3=d_=t}function U3(e,t){c_.add(d_*e-u_*t),u_=e,d_=t}function zre(){U3(H3,W3)}const tT=xs;var od=1/0,A0=od,hh=-od,M0=hh,Bre={point:Vre,lineStart:nr,lineEnd:nr,polygonStart:nr,polygonEnd:nr,result:function(){var e=[[od,A0],[hh,M0]];return hh=M0=-(A0=od=1/0),e}};function Vre(e,t){e<od&&(od=e),e>hh&&(hh=e),t<A0&&(A0=t),t>M0&&(M0=t)}const k0=Bre;var f_=0,h_=0,Tf=0,I0=0,N0=0,pu=0,p_=0,g_=0,Df=0,q3,G3,ji,zi,pi={point:lc,lineStart:nT,lineEnd:rT,polygonStart:function(){pi.lineStart=Ure,pi.lineEnd=qre},polygonEnd:function(){pi.point=lc,pi.lineStart=nT,pi.lineEnd=rT},result:function(){var e=Df?[p_/Df,g_/Df]:pu?[I0/pu,N0/pu]:Tf?[f_/Tf,h_/Tf]:[NaN,NaN];return f_=h_=Tf=I0=N0=pu=p_=g_=Df=0,e}};function lc(e,t){f_+=e,h_+=t,++Tf}function nT(){pi.point=Hre}function Hre(e,t){pi.point=Wre,lc(ji=e,zi=t)}function Wre(e,t){var n=e-ji,r=t-zi,o=jr(n*n+r*r);I0+=o*(ji+e)/2,N0+=o*(zi+t)/2,pu+=o,lc(ji=e,zi=t)}function rT(){pi.point=lc}function Ure(){pi.point=Gre}function qre(){Y3(q3,G3)}function Gre(e,t){pi.point=Y3,lc(q3=ji=e,G3=zi=t)}function Y3(e,t){var n=e-ji,r=t-zi,o=jr(n*n+r*r);I0+=o*(ji+e)/2,N0+=o*(zi+t)/2,pu+=o,o=zi*e-ji*t,p_+=o*(ji+e),g_+=o*(zi+t),Df+=o*3,lc(ji=e,zi=t)}const oT=pi;function K3(e){this._context=e}K3.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Oo);break}}},result:nr};var m_=new Bs,k1,X3,Q3,Af,Mf,L0={point:nr,lineStart:function(){L0.point=Yre},lineEnd:function(){k1&&J3(X3,Q3),L0.point=nr},polygonStart:function(){k1=!0},polygonEnd:function(){k1=null},result:function(){var e=+m_;return m_=new Bs,e}};function Yre(e,t){L0.point=J3,X3=Af=e,Q3=Mf=t}function J3(e,t){Af-=e,Mf-=t,m_.add(jr(Af*Af+Mf*Mf)),Af=e,Mf=t}const iT=L0;let aT,F0,sT,lT;class cT{constructor(t){this._append=t==null?Z3:Kre(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==sT||this._append!==F0){const r=this._radius,o=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,sT=r,F0=this._append,lT=this._,this._=o}this._+=lT;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Z3(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Kre(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Z3;if(t!==aT){const n=10**t;aT=t,F0=function(o){let i=1;this._+=o[0];for(const a=o.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+o[i]}}return F0}function uT(e,t){let n=3,r=4.5,o,i;function a(s){return s&&(typeof r=="function"&&i.pointRadius(+r.apply(this,arguments)),Cl(s,o(i))),i.result()}return a.area=function(s){return Cl(s,o(tT)),tT.result()},a.measure=function(s){return Cl(s,o(iT)),iT.result()},a.bounds=function(s){return Cl(s,o(k0)),k0.result()},a.centroid=function(s){return Cl(s,o(oT)),oT.result()},a.projection=function(s){return arguments.length?(o=s==null?(e=null,l_):(e=s).stream,a):e},a.context=function(s){return arguments.length?(i=s==null?(t=null,new cT(n)):new K3(t=s),typeof r!="function"&&i.pointRadius(r),a):t},a.pointRadius=function(s){return arguments.length?(r=typeof s=="function"?s:(i.pointRadius(+s),+s),a):r},a.digits=function(s){if(!arguments.length)return n;if(s==null)n=null;else{const l=Math.floor(s);if(!(l>=0))throw new RangeError(`invalid digits: ${s}`);n=l}return t===null&&(i=new cT(n)),a},a.projection(e).digits(n).context(t)}function BC(e){return function(t){var n=new b_;for(var r in e)n[r]=e[r];return n.stream=t,n}}function b_(){}b_.prototype={constructor:b_,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function VC(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),Cl(n,e.stream(k0)),t(k0.result()),r!=null&&e.clipExtent(r),e}function HC(e,t,n){return VC(e,function(r){var o=t[1][0]-t[0][0],i=t[1][1]-t[0][1],a=Math.min(o/(r[1][0]-r[0][0]),i/(r[1][1]-r[0][1])),s=+t[0][0]+(o-a*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(i-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([s,l])},n)}function e7(e,t,n){return HC(e,[[0,0],t],n)}function t7(e,t,n){return VC(e,function(r){var o=+t,i=o/(r[1][0]-r[0][0]),a=(o-i*(r[1][0]+r[0][0]))/2,s=-i*r[0][1];e.scale(150*i).translate([a,s])},n)}function n7(e,t,n){return VC(e,function(r){var o=+t,i=o/(r[1][1]-r[0][1]),a=-i*r[0][0],s=(o-i*(r[1][1]+r[0][1]))/2;e.scale(150*i).translate([a,s])},n)}var dT=16,Xre=gt(30*un);function fT(e,t){return+t?Jre(e,t):Qre(e)}function Qre(e){return BC({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function Jre(e,t){function n(r,o,i,a,s,l,c,u,d,h,p,v,b,x){var y=c-r,_=u-o,S=y*y+_*_;if(S>4*t&&b--){var C=a+h,E=s+p,$=l+v,T=jr(C*C+E*E+$*$),D=Qo($/=T),M=Vt(Vt($)-1)<nt||Vt(i-d)<nt?(i+d)/2:Ki(E,C),L=e(M,D),F=L[0],z=L[1],X=F-r,G=z-o,A=_*X-y*G;(A*A/S>t||Vt((y*X+_*G)/S-.5)>.3||a*h+s*p+l*v<Xre)&&(n(r,o,i,a,s,l,F,z,M,C/=T,E/=T,$,b,x),x.point(F,z),n(F,z,M,C,E,$,c,u,d,h,p,v,b,x))}}return function(r){var o,i,a,s,l,c,u,d,h,p,v,b,x={point:y,lineStart:_,lineEnd:C,polygonStart:function(){r.polygonStart(),x.lineStart=E},polygonEnd:function(){r.polygonEnd(),x.lineStart=_}};function y(D,M){D=e(D,M),r.point(D[0],D[1])}function _(){d=NaN,x.point=S,r.lineStart()}function S(D,M){var L=nd([D,M]),F=e(D,M);n(d,h,u,p,v,b,d=F[0],h=F[1],u=D,p=L[0],v=L[1],b=L[2],dT,r),r.point(d,h)}function C(){x.point=y,r.lineEnd()}function E(){_(),x.point=$,x.lineEnd=T}function $(D,M){S(o=D,M),i=d,a=h,s=p,l=v,c=b,x.point=S}function T(){n(d,h,u,p,v,b,i,a,o,s,l,c,dT,r),x.lineEnd=C,C()}return x}}var Zre=BC({point:function(e,t){this.stream.point(e*un,t*un)}});function eoe(e){return BC({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function toe(e,t,n,r,o){function i(a,s){return a*=r,s*=o,[t+e*a,n-e*s]}return i.invert=function(a,s){return[(a-t)/e*r,(n-s)/e*o]},i}function hT(e,t,n,r,o,i){if(!i)return toe(e,t,n,r,o);var a=gt(i),s=ut(i),l=a*e,c=s*e,u=a/e,d=s/e,h=(s*n-a*t)/e,p=(s*t+a*n)/e;function v(b,x){return b*=r,x*=o,[l*b-c*x+t,n-c*b-l*x]}return v.invert=function(b,x){return[r*(u*b-d*x+h),o*(p-d*b-u*x)]},v}function Va(e){return r7(function(){return e})()}function r7(e){var t,n=150,r=480,o=250,i=0,a=0,s=0,l=0,c=0,u,d=0,h=1,p=1,v=null,b=GO,x=null,y,_,S,C=l_,E=.5,$,T,D,M,L;function F(A){return D(A[0]*un,A[1]*un)}function z(A){return A=D.invert(A[0],A[1]),A&&[A[0]*kr,A[1]*kr]}F.stream=function(A){return M&&L===A?M:M=Zre(eoe(u)(b($(C(L=A)))))},F.preclip=function(A){return arguments.length?(b=A,v=void 0,G()):b},F.postclip=function(A){return arguments.length?(C=A,x=y=_=S=null,G()):C},F.clipAngle=function(A){return arguments.length?(b=+A?Rre(v=A*un):(v=null,GO),G()):v*kr},F.clipExtent=function(A){return arguments.length?(C=A==null?(x=y=_=S=null,l_):$re(x=+A[0][0],y=+A[0][1],_=+A[1][0],S=+A[1][1]),G()):x==null?null:[[x,y],[_,S]]},F.scale=function(A){return arguments.length?(n=+A,X()):n},F.translate=function(A){return arguments.length?(r=+A[0],o=+A[1],X()):[r,o]},F.center=function(A){return arguments.length?(i=A[0]%360*un,a=A[1]%360*un,X()):[i*kr,a*kr]},F.rotate=function(A){return arguments.length?(s=A[0]%360*un,l=A[1]%360*un,c=A.length>2?A[2]%360*un:0,X()):[s*kr,l*kr,c*kr]},F.angle=function(A){return arguments.length?(d=A%360*un,X()):d*kr},F.reflectX=function(A){return arguments.length?(h=A?-1:1,X()):h<0},F.reflectY=function(A){return arguments.length?(p=A?-1:1,X()):p<0},F.precision=function(A){return arguments.length?($=fT(T,E=A*A),G()):jr(E)},F.fitExtent=function(A,U){return HC(F,A,U)},F.fitSize=function(A,U){return e7(F,A,U)},F.fitWidth=function(A,U){return t7(F,A,U)},F.fitHeight=function(A,U){return n7(F,A,U)};function X(){var A=hT(n,0,0,h,p,d).apply(null,t(i,a)),U=hT(n,r-A[0],o-A[1],h,p,d);return u=N3(s,l,c),T=n_(t,U),D=n_(u,T),$=fT(T,E),G()}function G(){return M=L=null,F}return function(){return t=e.apply(this,arguments),F.invert=t.invert&&z,X()}}function WC(e){var t=0,n=Ot/3,r=r7(e),o=r(t,n);return o.parallels=function(i){return arguments.length?r(t=i[0]*un,n=i[1]*un):[t*kr,n*kr]},o}function noe(e){var t=gt(e);function n(r,o){return[r*t,ut(o)/t]}return n.invert=function(r,o){return[r/t,Qo(o*t)]},n}function roe(e,t){var n=ut(e),r=(n+ut(t))/2;if(Vt(r)<nt)return noe(e);var o=1+n*(2*r-n),i=jr(o)/r;function a(s,l){var c=jr(o-2*r*ut(l))/r;return[c*ut(s*=r),i-c*gt(s)]}return a.invert=function(s,l){var c=i-l,u=Ki(s,Vt(c))*Ko(c);return c*r<0&&(u-=Ot*Ko(s)*Ko(c)),[u/r,Qo((o-(s*s+c*c)*r*r)/(2*r))]},a}function j0(){return WC(roe).scale(155.424).center([0,33.6442])}function o7(){return j0().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function ooe(e){var t=e.length;return{point:function(n,r){for(var o=-1;++o<t;)e[o].point(n,r)},sphere:function(){for(var n=-1;++n<t;)e[n].sphere()},lineStart:function(){for(var n=-1;++n<t;)e[n].lineStart()},lineEnd:function(){for(var n=-1;++n<t;)e[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<t;)e[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<t;)e[n].polygonEnd()}}}function ioe(){var e,t,n=o7(),r,o=j0().rotate([154,0]).center([-2,58.5]).parallels([55,65]),i,a=j0().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s,l,c={point:function(h,p){l=[h,p]}};function u(h){var p=h[0],v=h[1];return l=null,r.point(p,v),l||(i.point(p,v),l)||(s.point(p,v),l)}u.invert=function(h){var p=n.scale(),v=n.translate(),b=(h[0]-v[0])/p,x=(h[1]-v[1])/p;return(x>=.12&&x<.234&&b>=-.425&&b<-.214?o:x>=.166&&x<.234&&b>=-.214&&b<-.115?a:n).invert(h)},u.stream=function(h){return e&&t===h?e:e=ooe([n.stream(t=h),o.stream(h),a.stream(h)])},u.precision=function(h){return arguments.length?(n.precision(h),o.precision(h),a.precision(h),d()):n.precision()},u.scale=function(h){return arguments.length?(n.scale(h),o.scale(h*.35),a.scale(h),u.translate(n.translate())):n.scale()},u.translate=function(h){if(!arguments.length)return n.translate();var p=n.scale(),v=+h[0],b=+h[1];return r=n.translate(h).clipExtent([[v-.455*p,b-.238*p],[v+.455*p,b+.238*p]]).stream(c),i=o.translate([v-.307*p,b+.201*p]).clipExtent([[v-.425*p+nt,b+.12*p+nt],[v-.214*p-nt,b+.234*p-nt]]).stream(c),s=a.translate([v-.205*p,b+.212*p]).clipExtent([[v-.214*p+nt,b+.166*p+nt],[v-.115*p-nt,b+.234*p-nt]]).stream(c),d()},u.fitExtent=function(h,p){return HC(u,h,p)},u.fitSize=function(h,p){return e7(u,h,p)},u.fitWidth=function(h,p){return t7(u,h,p)},u.fitHeight=function(h,p){return n7(u,h,p)};function d(){return e=t=null,u}return u.scale(1070)}function i7(e){return function(t,n){var r=gt(t),o=gt(n),i=e(r*o);return i===1/0?[2,0]:[i*o*ut(t),i*ut(n)]}}function pp(e){return function(t,n){var r=jr(t*t+n*n),o=e(r),i=ut(o),a=gt(o);return[Ki(t*i,r*a),Qo(r&&n*i/r)]}}var a7=i7(function(e){return jr(2/(1+e))});a7.invert=pp(function(e){return 2*Qo(e/2)});function aoe(){return Va(a7).scale(124.75).clipAngle(180-.001)}var s7=i7(function(e){return(e=I3(e))&&e/ut(e)});s7.invert=pp(function(e){return e});function soe(){return Va(s7).scale(79.4188).clipAngle(180-.001)}function Ub(e,t){return[e,$0(zC((In+t)/2))]}Ub.invert=function(e,t){return[e,2*bd(k3(t))-In]};function loe(){return l7(Ub).scale(961/Oo)}function l7(e){var t=Va(e),n=t.center,r=t.scale,o=t.translate,i=t.clipExtent,a=null,s,l,c;t.scale=function(d){return arguments.length?(r(d),u()):r()},t.translate=function(d){return arguments.length?(o(d),u()):o()},t.center=function(d){return arguments.length?(n(d),u()):n()},t.clipExtent=function(d){return arguments.length?(d==null?a=s=l=c=null:(a=+d[0][0],s=+d[0][1],l=+d[1][0],c=+d[1][1]),u()):a==null?null:[[a,s],[l,c]]};function u(){var d=Ot*r(),h=t(yre(t.rotate()).invert([0,0]));return i(a==null?[[h[0]-d,h[1]-d],[h[0]+d,h[1]+d]]:e===Ub?[[Math.max(h[0]-d,a),s],[Math.min(h[0]+d,l),c]]:[[a,Math.max(h[1]-d,s)],[l,Math.min(h[1]+d,c)]])}return u()}function nm(e){return zC((In+e)/2)}function coe(e,t){var n=gt(e),r=e===t?ut(e):$0(n/gt(t))/$0(nm(t)/nm(e)),o=n*T1(nm(e),r)/r;if(!r)return Ub;function i(a,s){o>0?s<-In+nt&&(s=-In+nt):s>In-nt&&(s=In-nt);var l=o/T1(nm(s),r);return[l*ut(r*a),o-l*gt(r*a)]}return i.invert=function(a,s){var l=o-s,c=Ko(r)*jr(a*a+l*l),u=Ki(a,Vt(l))*Ko(l);return l*r<0&&(u-=Ot*Ko(a)*Ko(l)),[u/r,2*bd(T1(o/c,1/r))-In]},i}function uoe(){return WC(coe).scale(109.5).parallels([30,30])}function z0(e,t){return[e,t]}z0.invert=z0;function doe(){return Va(z0).scale(152.63)}function foe(e,t){var n=gt(e),r=e===t?ut(e):(n-gt(t))/(t-e),o=n/r+e;if(Vt(r)<nt)return z0;function i(a,s){var l=o-s,c=r*a;return[l*ut(c),o-l*gt(c)]}return i.invert=function(a,s){var l=o-s,c=Ki(a,Vt(l))*Ko(l);return l*r<0&&(c-=Ot*Ko(a)*Ko(l)),[c/r,o-Ko(r)*jr(a*a+l*l)]},i}function hoe(){return WC(foe).scale(131.154).center([0,13.9389])}var Hf=1.340264,Wf=-.081106,Uf=893e-6,qf=.003796,B0=jr(3)/2,poe=12;function c7(e,t){var n=Qo(B0*ut(t)),r=n*n,o=r*r*r;return[e*gt(n)/(B0*(Hf+3*Wf*r+o*(7*Uf+9*qf*r))),n*(Hf+Wf*r+o*(Uf+qf*r))]}c7.invert=function(e,t){for(var n=t,r=n*n,o=r*r*r,i=0,a,s,l;i<poe&&(s=n*(Hf+Wf*r+o*(Uf+qf*r))-t,l=Hf+3*Wf*r+o*(7*Uf+9*qf*r),n-=a=s/l,r=n*n,o=r*r*r,!(Vt(a)<jC));++i);return[B0*e*(Hf+3*Wf*r+o*(7*Uf+9*qf*r))/gt(n),Qo(ut(n)/B0)]};function goe(){return Va(c7).scale(177.158)}function u7(e,t){var n=gt(t),r=gt(e)*n;return[n*ut(e)/r,ut(t)/r]}u7.invert=pp(bd);function moe(){return Va(u7).scale(144.049).clipAngle(60)}function d7(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),t*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}d7.invert=function(e,t){var n=t,r=25,o;do{var i=n*n,a=i*i;n-=o=(n*(1.007226+i*(.015085+a*(-.044475+.028874*i-.005916*a)))-t)/(1.007226+i*(.015085*3+a*(-.044475*7+.028874*9*i-.005916*11*a)))}while(Vt(o)>nt&&--r>0);return[e/(.8707+(i=n*n)*(-.131979+i*(-.013791+i*i*i*(.003971-.001529*i)))),n]};function boe(){return Va(d7).scale(175.295)}function f7(e,t){return[gt(t)*ut(e),ut(t)]}f7.invert=pp(Qo);function voe(){return Va(f7).scale(249.5).clipAngle(90+nt)}function h7(e,t){var n=gt(t),r=1+gt(e)*n;return[n*ut(e)/r,ut(t)/r]}h7.invert=pp(function(e){return 2*bd(e)});function yoe(){return Va(h7).scale(250).clipAngle(142)}function p7(e,t){return[$0(zC((In+t)/2)),-e]}p7.invert=function(e,t){return[-t,2*bd(k3(e))-In]};function xoe(){var e=l7(p7),t=e.center,n=e.rotate;return e.center=function(r){return arguments.length?t([-r[1],r[0]]):(r=t(),[r[1],-r[0]])},e.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}function Xt(e){for(var t=e.length/6|0,n=new Array(t),r=0;r<t;)n[r]="#"+e.slice(r*6,++r*6);return n}function qb(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function UC(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function vd(){}var cc=.7,id=1/cc,_u="\\s*([+-]?\\d+)\\s*",ph="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ui="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",woe=/^#([0-9a-f]{3,8})$/,_oe=new RegExp(`^rgb\\(${_u},${_u},${_u}\\)$`),Soe=new RegExp(`^rgb\\(${Ui},${Ui},${Ui}\\)$`),Coe=new RegExp(`^rgba\\(${_u},${_u},${_u},${ph}\\)$`),Eoe=new RegExp(`^rgba\\(${Ui},${Ui},${Ui},${ph}\\)$`),Roe=new RegExp(`^hsl\\(${ph},${Ui},${Ui}\\)$`),Poe=new RegExp(`^hsla\\(${ph},${Ui},${Ui},${ph}\\)$`),pT={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};qb(vd,qC,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:gT,formatHex:gT,formatHex8:$oe,formatHsl:Ooe,formatRgb:mT,toString:mT});function gT(){return this.rgb().formatHex()}function $oe(){return this.rgb().formatHex8()}function Ooe(){return m7(this).formatHsl()}function mT(){return this.rgb().formatRgb()}function qC(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=woe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?bT(t):n===3?new Sr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?rm(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?rm(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=_oe.exec(e))?new Sr(t[1],t[2],t[3],1):(t=Soe.exec(e))?new Sr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Coe.exec(e))?rm(t[1],t[2],t[3],t[4]):(t=Eoe.exec(e))?rm(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Roe.exec(e))?xT(t[1],t[2]/100,t[3]/100,1):(t=Poe.exec(e))?xT(t[1],t[2]/100,t[3]/100,t[4]):pT.hasOwnProperty(e)?bT(pT[e]):e==="transparent"?new Sr(NaN,NaN,NaN,0):null}function bT(e){return new Sr(e>>16&255,e>>8&255,e&255,1)}function rm(e,t,n,r){return r<=0&&(e=t=n=NaN),new Sr(e,t,n,r)}function g7(e){return e instanceof vd||(e=qC(e)),e?(e=e.rgb(),new Sr(e.r,e.g,e.b,e.opacity)):new Sr}function gh(e,t,n,r){return arguments.length===1?g7(e):new Sr(e,t,n,r??1)}function Sr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}qb(Sr,gh,UC(vd,{brighter(e){return e=e==null?id:Math.pow(id,e),new Sr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?cc:Math.pow(cc,e),new Sr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Sr(Xl(this.r),Xl(this.g),Xl(this.b),V0(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:vT,formatHex:vT,formatHex8:Toe,formatRgb:yT,toString:yT}));function vT(){return`#${Al(this.r)}${Al(this.g)}${Al(this.b)}`}function Toe(){return`#${Al(this.r)}${Al(this.g)}${Al(this.b)}${Al((isNaN(this.opacity)?1:this.opacity)*255)}`}function yT(){const e=V0(this.opacity);return`${e===1?"rgb(":"rgba("}${Xl(this.r)}, ${Xl(this.g)}, ${Xl(this.b)}${e===1?")":`, ${e})`}`}function V0(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Xl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Al(e){return e=Xl(e),(e<16?"0":"")+e.toString(16)}function xT(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new gi(e,t,n,r)}function m7(e){if(e instanceof gi)return new gi(e.h,e.s,e.l,e.opacity);if(e instanceof vd||(e=qC(e)),!e)return new gi;if(e instanceof gi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),a=NaN,s=i-o,l=(i+o)/2;return s?(t===i?a=(n-r)/s+(n<r)*6:n===i?a=(r-t)/s+2:a=(t-n)/s+4,s/=l<.5?i+o:2-i-o,a*=60):s=l>0&&l<1?0:a,new gi(a,s,l,e.opacity)}function Doe(e,t,n,r){return arguments.length===1?m7(e):new gi(e,t,n,r??1)}function gi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}qb(gi,Doe,UC(vd,{brighter(e){return e=e==null?id:Math.pow(id,e),new gi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?cc:Math.pow(cc,e),new gi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new Sr(I1(e>=240?e-240:e+120,o,r),I1(e,o,r),I1(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new gi(wT(this.h),om(this.s),om(this.l),V0(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=V0(this.opacity);return`${e===1?"hsl(":"hsla("}${wT(this.h)}, ${om(this.s)*100}%, ${om(this.l)*100}%${e===1?")":`, ${e})`}`}}));function wT(e){return e=(e||0)%360,e<0?e+360:e}function om(e){return Math.max(0,Math.min(1,e||0))}function I1(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Aoe=Math.PI/180,Moe=180/Math.PI;var b7=-.14861,GC=1.78277,YC=-.29227,Gb=-.90649,mh=1.97294,_T=mh*Gb,ST=mh*GC,CT=GC*YC-Gb*b7;function koe(e){if(e instanceof Ql)return new Ql(e.h,e.s,e.l,e.opacity);e instanceof Sr||(e=g7(e));var t=e.r/255,n=e.g/255,r=e.b/255,o=(CT*r+_T*t-ST*n)/(CT+_T-ST),i=r-o,a=(mh*(n-o)-YC*i)/Gb,s=Math.sqrt(a*a+i*i)/(mh*o*(1-o)),l=s?Math.atan2(a,i)*Moe-120:NaN;return new Ql(l<0?l+360:l,s,o,e.opacity)}function Xi(e,t,n,r){return arguments.length===1?koe(e):new Ql(e,t,n,r??1)}function Ql(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}qb(Ql,Xi,UC(vd,{brighter(e){return e=e==null?id:Math.pow(id,e),new Ql(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?cc:Math.pow(cc,e),new Ql(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Aoe,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),o=Math.sin(e);return new Sr(255*(t+n*(b7*r+GC*o)),255*(t+n*(YC*r+Gb*o)),255*(t+n*(mh*r)),this.opacity)}}));function Ioe(e,t,n,r,o){var i=e*e,a=i*e;return((1-3*e+3*i-a)*t+(4-6*i+3*a)*n+(1+3*e+3*i-3*a)*r+a*o)/6}function Noe(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),o=e[r],i=e[r+1],a=r>0?e[r-1]:2*o-i,s=r<t-1?e[r+2]:2*i-o;return Ioe((n-r/t)*t,a,o,i,s)}}const KC=e=>()=>e;function v7(e,t){return function(n){return e+n*t}}function Loe(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)}}function Foe(e,t){var n=t-e;return n?v7(e,n>180||n<-180?n-360*Math.round(n/360):n):KC(isNaN(e)?t:e)}function joe(e){return(e=+e)==1?Su:function(t,n){return n-t?Loe(t,n,e):KC(isNaN(t)?n:t)}}function Su(e,t){var n=t-e;return n?v7(e,n):KC(isNaN(e)?t:e)}(function e(t){var n=joe(t);function r(o,i){var a=n((o=gh(o)).r,(i=gh(i)).r),s=n(o.g,i.g),l=n(o.b,i.b),c=Su(o.opacity,i.opacity);return function(u){return o.r=a(u),o.g=s(u),o.b=l(u),o.opacity=c(u),o+""}}return r.gamma=e,r})(1);function zoe(e){return function(t){var n=t.length,r=new Array(n),o=new Array(n),i=new Array(n),a,s;for(a=0;a<n;++a)s=gh(t[a]),r[a]=s.r||0,o[a]=s.g||0,i[a]=s.b||0;return r=e(r),o=e(o),i=e(i),s.opacity=1,function(l){return s.r=r(l),s.g=o(l),s.b=i(l),s+""}}}var Boe=zoe(Noe);function y7(e){return function t(n){n=+n;function r(o,i){var a=e((o=Xi(o)).h,(i=Xi(i)).h),s=Su(o.s,i.s),l=Su(o.l,i.l),c=Su(o.opacity,i.opacity);return function(u){return o.h=a(u),o.s=s(u),o.l=l(Math.pow(u,n)),o.opacity=c(u),o+""}}return r.gamma=t,r}(1)}y7(Foe);var XC=y7(Su);const hn=e=>Boe(e[e.length-1]);var Voe=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Xt);const Hoe=hn(Voe);var Woe=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Xt);const Uoe=hn(Woe);var qoe=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Xt);const Goe=hn(qoe);var Yoe=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Xt);const Koe=hn(Yoe);var Xoe=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Xt);const Qoe=hn(Xoe);var Joe=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Xt);const Zoe=hn(Joe);var eie=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Xt);const tie=hn(eie);var nie=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Xt);const rie=hn(nie);var oie=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Xt);const iie=hn(oie);var aie=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Xt);const sie=hn(aie);var lie=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Xt);const cie=hn(lie);var uie=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Xt);const die=hn(uie);var fie=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Xt);const hie=hn(fie);var pie=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Xt);const gie=hn(pie);var mie=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Xt);const bie=hn(mie);var vie=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Xt);const yie=hn(vie);var xie=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Xt);const wie=hn(xie);var _ie=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Xt);const Sie=hn(_ie);var Cie=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Xt);const Eie=hn(Cie);var Rie=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Xt);const Pie=hn(Rie);var $ie=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Xt);const Oie=hn($ie);var Tie=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Xt);const Die=hn(Tie);var Aie=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Xt);const Mie=hn(Aie);var kie=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Xt);const Iie=hn(kie);var Nie=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Xt);const Lie=hn(Nie);var Fie=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Xt);const jie=hn(Fie);var zie=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Xt);const Bie=hn(zie);function Vie(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-e*(35.34-e*(2381.73-e*(6402.7-e*(7024.72-e*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+e*(170.73+e*(52.82-e*(131.46-e*(176.58-e*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+e*(442.36-e*(2482.43-e*(6167.24-e*(6614.94-e*2475.67)))))))+")"}const Hie=XC(Xi(300,.5,0),Xi(-240,.5,1));var Wie=XC(Xi(-100,.75,.35),Xi(80,1.5,.8)),Uie=XC(Xi(260,.75,.35),Xi(80,1.5,.8)),im=Xi();function qie(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return im.h=360*e-100,im.s=1.5-1.5*t,im.l=.8-.9*t,im+""}var am=gh(),Gie=Math.PI/3,Yie=Math.PI*2/3;function Kie(e){var t;return e=(.5-e)*Math.PI,am.r=255*(t=Math.sin(e))*t,am.g=255*(t=Math.sin(e+Gie))*t,am.b=255*(t=Math.sin(e+Yie))*t,am+""}function Xie(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+e*(1172.33-e*(10793.56-e*(33300.12-e*(38394.49-e*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+e*(557.33+e*(1225.33-e*(3574.96-e*(1073.77+e*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+e*(3211.1-e*(15327.97-e*(27814-e*(22569.18-e*6838.66)))))))+")"}function Yb(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}const Qie=Yb(Xt("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var Jie=Yb(Xt("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Zie=Yb(Xt("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),eae=Yb(Xt("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function tae(e){return e}function nae(e){if(e==null)return tae;var t,n,r=e.scale[0],o=e.scale[1],i=e.translate[0],a=e.translate[1];return function(s,l){l||(t=n=0);var c=2,u=s.length,d=new Array(u);for(d[0]=(t+=s[0])*r+i,d[1]=(n+=s[1])*o+a;c<u;)d[c]=s[c],++c;return d}}function rae(e,t){for(var n,r=e.length,o=r-t;o<--r;)n=e[o],e[o++]=e[r],e[r]=n}function oae(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return ET(e,n)})}:ET(e,t)}function ET(e,t){var n=t.id,r=t.bbox,o=t.properties==null?{}:t.properties,i=iae(e,t);return n==null&&r==null?{type:"Feature",properties:o,geometry:i}:r==null?{type:"Feature",id:n,properties:o,geometry:i}:{type:"Feature",id:n,bbox:r,properties:o,geometry:i}}function iae(e,t){var n=nae(e.transform),r=e.arcs;function o(u,d){d.length&&d.pop();for(var h=r[u<0?~u:u],p=0,v=h.length;p<v;++p)d.push(n(h[p],p));u<0&&rae(d,v)}function i(u){return n(u)}function a(u){for(var d=[],h=0,p=u.length;h<p;++h)o(u[h],d);return d.length<2&&d.push(d[0]),d}function s(u){for(var d=a(u);d.length<4;)d.push(d[0]);return d}function l(u){return u.map(s)}function c(u){var d=u.type,h;switch(d){case"GeometryCollection":return{type:d,geometries:u.geometries.map(c)};case"Point":h=i(u.coordinates);break;case"MultiPoint":h=u.coordinates.map(i);break;case"LineString":h=a(u.arcs);break;case"MultiLineString":h=u.arcs.map(a);break;case"Polygon":h=l(u.arcs);break;case"MultiPolygon":h=u.arcs.map(l);break;default:return null}return{type:d,coordinates:h}}return c(t)}const Gf={geoAzimuthalEqualArea:aoe,geoAzimuthalEquidistant:soe,geoGnomonic:moe,geoOrthographic:voe,geoStereographic:yoe,geoEqualEarth:goe,geoAlbers:o7,geoAlbersUsa:ioe,geoConicConformal:uoe,geoConicEqualArea:j0,geoConicEquidistant:hoe,geoEquirectangular:doe,geoMercator:loe,geoTransverseMercator:xoe,geoNaturalEarth1:boe};Object.keys(Gf).forEach(e=>{Gf[`${e.charAt(3).toLowerCase()}${e.slice(4)}`]=Gf[e]});class wc extends Qs{constructor(t){super(t),this.outlineBounds=null,this.oldChartBounds=null,this.geoPath=uT()}init(t){t.position="chartArea",super.init(t),typeof t.projection=="function"?this.projection=t.projection:this.projection=(Gf[t.projection]||Gf.albersUsa)(),this.geoPath.projection(this.projection),this.outlineBounds=null,this.oldChartBounds=null}computeBounds(t){const n=uT(this.projection.fitWidth(1e3,t)).bounds(t),r=Math.ceil(n[1][1]-n[0][1]),o=Math.ceil(n[1][0]-n[0][0]),i=this.projection.translate();this.outlineBounds={width:o,height:r,aspectRatio:o/r,refScale:this.projection.scale(),refX:i[0],refY:i[1]}}updateBounds(){const t=this.chart.chartArea,n=this.outlineBounds;if(!n)return!1;const r=this.options.padding,o=typeof r=="number"?r:r.top,i=typeof r=="number"?r:r.left,a=typeof r=="number"?r:r.bottom,s=typeof r=="number"?r:r.right,l=t.right-t.left-i-s,c=t.bottom-t.top-o-a,u=this.oldChartBounds;this.oldChartBounds={chartWidth:l,chartHeight:c};const d=Math.min(l/n.width,c/n.height),h=n.width*d,p=n.height*d,v=(l-h)*.5+t.left+i,b=(c-p)*.5+t.top+o,x=this.options;return this.projection.scale(n.refScale*d*x.projectionScale).translate([d*n.refX+v+x.projectionOffset[0],d*n.refY+b+x.projectionOffset[1]]),!u||u.chartWidth!==this.oldChartBounds.chartWidth||u.chartHeight!==this.oldChartBounds.chartHeight}}wc.id="projection";wc.defaults={projection:"albersUsa",projectionScale:1,projectionOffset:[0,0],padding:0};wc.descriptors={_scriptable:e=>e!=="projection",_indexable:e=>e!=="projectionOffset"};const Kb={position:"chartArea",property:"value",grid:{z:1,drawOnChartArea:!1},ticks:{z:1},legend:{align:"right",position:"bottom-right",length:100,width:50,margin:8,indicatorWidth:10}};function aae(e){const{indicatorWidth:t,align:n,margin:r}=e,o=(typeof r=="number"?r:r.left)+(n==="right"?t:0),i=(typeof r=="number"?r:r.top)+(n==="bottom"?t:0),a=(typeof r=="number"?r:r.right)+(n==="left"?t:0),s=(typeof r=="number"?r:r.bottom)+(n==="top"?t:0);return{left:o,top:i,right:a,bottom:s}}function sae(e,t,n,r,o){const{indicatorWidth:i,align:a,position:s}=t,l=a==="top"||a==="bottom",c=(a==="left"?o.w:n)+(l?i:0),u=(a==="top"?o.h:r)+(l?0:i),d=aae(t);if(typeof s=="string")switch(s){case"top-left":return[d.left,d.top];case"top":return[(e.right-c)/2,d.top];case"left":return[d.left,(e.bottom-u)/2];case"top-right":return[e.right-c-d.right,d.top];case"bottom-right":return[e.right-c-d.right,e.bottom-u-d.bottom];case"bottom":return[(e.right-c)/2,e.bottom-u-d.bottom];case"bottom-left":return[d.left,e.bottom-u-d.bottom];default:return[e.right-c-d.right,(e.bottom-u)/2]}return[s.x,s.y]}class gu extends ed{constructor(){super(...arguments),this.legendSize={w:0,h:0}}init(t){t.position="chartArea",super.init(t),this.axis="r"}parse(t,n){return t&&typeof t[this.options.property]=="number"?t[this.options.property]:super.parse(t,n)}isHorizontal(){return this.options.legend.align==="top"||this.options.legend.align==="bottom"}_getNormalizedValue(t){return t==null||Number.isNaN(t)?null:(t-this._startValue)/this._valueRange}update(t,n,r){const o=Math.min(n,this.bottom==null?Number.POSITIVE_INFINITY:this.bottom),i=Math.min(t,this.right==null?Number.POSITIVE_INFINITY:this.right),a=this.options.legend,s=this.isHorizontal(),l=(p,v)=>p<1?v*p:p,c=Math.min(i,l(s?a.length:a.width,i))-(s?0:a.indicatorWidth),u=Math.min(o,l(s?a.width:a.length,o))-(s?a.indicatorWidth:0);this.legendSize={w:c,h:u},this.bottom=u,this.height=u,this.right=c,this.width=c;const d=this.options.position;this.options.position=this.options.legend.align;const h=super.update(c,u,r);return this.options.position=d,this.height=Math.min(u,this.height),this.width=Math.min(c,this.width),h}_computeLabelArea(){}draw(t){if(!this._isVisible())return;const n=sae(t,this.options.legend,this.width,this.height,this.legendSize),{ctx:r}=this;r.save(),r.translate(n[0],n[1]);const o=this.options.position;this.options.position=this.options.legend.align,super.draw({...t,bottom:this.height+10,right:this.width}),this.options.position=o;const{indicatorWidth:i}=this.options.legend;switch(this.options.legend.align){case"left":r.translate(this.legendSize.w,0);break;case"top":r.translate(0,this.legendSize.h);break;case"bottom":r.translate(0,-i);break;default:r.translate(-i,0);break}this._drawIndicator(),r.restore()}_drawIndicator(){}}class x7 extends td{constructor(){super(...arguments),this.legendSize={w:0,h:0}}init(t){gu.prototype.init.call(this,t)}parse(t,n){return gu.prototype.parse.call(this,t,n)}isHorizontal(){return this.options.legend.align==="top"||this.options.legend.align==="bottom"}_getNormalizedValue(t){return t==null||Number.isNaN(t)?null:(Math.log10(t)-this._startValue)/this._valueRange}update(t,n,r){return gu.prototype.update.call(this,t,n,r)}_computeLabelArea(){}draw(t){return gu.prototype.draw.call(this,t)}_drawIndicator(){}}const Oa={interpolateBlues:Die,interpolateBrBG:Hoe,interpolateBuGn:sie,interpolateBuPu:cie,interpolateCividis:Vie,interpolateCool:Uie,interpolateCubehelixDefault:Hie,interpolateGnBu:die,interpolateGreens:Mie,interpolateGreys:Iie,interpolateInferno:Zie,interpolateMagma:Jie,interpolateOrRd:hie,interpolateOranges:Bie,interpolatePRGn:Uoe,interpolatePiYG:Goe,interpolatePlasma:eae,interpolatePuBu:bie,interpolatePuBuGn:gie,interpolatePuOr:Koe,interpolatePuRd:yie,interpolatePurples:Lie,interpolateRainbow:qie,interpolateRdBu:Qoe,interpolateRdGy:Zoe,interpolateRdPu:wie,interpolateRdYlBu:tie,interpolateRdYlGn:rie,interpolateReds:jie,interpolateSinebow:Kie,interpolateSpectral:iie,interpolateTurbo:Xie,interpolateViridis:Qie,interpolateWarm:Wie,interpolateYlGn:Eie,interpolateYlGnBu:Sie,interpolateYlOrBr:Pie,interpolateYlOrRd:Oie};Object.keys(Oa).forEach(e=>{Oa[`${e.charAt(11).toLowerCase()}${e.slice(12)}`]=Oa[e],Oa[e.slice(11)]=Oa[e]});function w7(e,t){const n=1/t;if(e<=n)return 0;if(e>=1-n)return 1;for(let r=0;r<1;r+=n)if(e<r)return r-n/2;return e}const _7={interpolate:"blues",missing:"transparent",quantize:0};class Vs extends gu{get interpolate(){const t=this.options;return t?typeof t.interpolate=="function"?t.interpolate:Oa[t.interpolate]||Oa.blues:n=>`rgb(${n},${n},${n})`}getColorForValue(t){const n=this._getNormalizedValue(t);return n==null||Number.isNaN(n)?this.options.missing:this.getColor(n)}getColor(t){let n=t;return this.options.quantize>0&&(n=w7(n,this.options.quantize)),this.interpolate(n)}_drawIndicator(){const{indicatorWidth:t}=this.options.legend,n=this._reversePixels;if(this.isHorizontal()){const r=this.width;if(this.options.quantize>0){const o=r/this.options.quantize,i=n?a=>r-o-a:a=>a;for(let a=0;a<r;a+=o){const s=(a+o/2)/r;this.ctx.fillStyle=this.getColor(s),this.ctx.fillRect(i(a),0,o,t)}}else{const o=n?i=>r-1-i:i=>i;for(let i=0;i<r;i+=1)this.ctx.fillStyle=this.getColor((i+.5)/r),this.ctx.fillRect(o(i),0,1,t)}}else{const r=this.height;if(this.options.quantize>0){const o=r/this.options.quantize,i=n?a=>r-o-a:a=>a;for(let a=0;a<r;a+=o){const s=(a+o/2)/r;this.ctx.fillStyle=this.getColor(s),this.ctx.fillRect(0,i(a),t,o)}}else{const o=n?i=>r-1-i:i=>i;for(let i=0;i<r;i+=1)this.ctx.fillStyle=this.getColor((i+.5)/r),this.ctx.fillRect(0,o(i),t,1)}}}}Vs.id="color";Vs.defaults=or({},[ed.defaults,Kb,_7]);Vs.descriptors={_scriptable:e=>e!=="interpolate",_indexable:!1};class QC extends x7{constructor(){super(...arguments),this.interpolate=t=>`rgb(${t},${t},${t})`}init(t){super.init(t),typeof t.interpolate=="function"?this.interpolate=t.interpolate:this.interpolate=Oa[t.interpolate]||Oa.blues}getColorForValue(t){return Vs.prototype.getColorForValue.call(this,t)}getColor(t){let n=t;return this.options.quantize>0&&(n=w7(n,this.options.quantize)),this.interpolate(n)}_drawIndicator(){return Vs.prototype._drawIndicator.call(this)}}QC.id="colorLogarithmic";QC.defaults=or({},[td.defaults,Kb,_7]);QC.descriptors={_scriptable:e=>e!=="interpolate",_indexable:!1};const S7={missing:1,mode:"area",range:[2,20],legend:{align:"bottom",length:90,width:70,indicatorWidth:42}};class Hs extends gu{constructor(){super(...arguments),this._model=null}getSizeForValue(t){const n=this._getNormalizedValue(t);return n==null||Number.isNaN(n)?this.options.missing:this.getSizeImpl(n)}getSizeImpl(t){const[n,r]=this.options.range;if(this.options.mode==="area"){const i=r*r*Math.PI,a=n*n*Math.PI,s=i-a,l=t*s+a;return Math.sqrt(l/Math.PI)}const o=r-n;return t*o+n}_drawIndicator(){const{ctx:t}=this,n=this.options.legend.indicatorWidth/2,r=this.isHorizontal(),o=this.ticks,i=this.getLabelItems(),a=i?i.map(s=>({[r?"x":"y"]:s.options.translation[r?0:1]})):o.map((s,l)=>({[r?"x":"y"]:this.getPixelForTick(l)}));if((this._gridLineItems||[]).forEach(s=>{if(t.save(),t.strokeStyle=s.color,t.lineWidth=s.width,t.setLineDash&&(t.setLineDash(s.borderDash),t.lineDashOffset=s.borderDashOffset),t.beginPath(),this.options.grid.drawTicks)switch(this.options.legend.align){case"left":t.moveTo(0,s.ty1),t.lineTo(n,s.ty2);break;case"top":t.moveTo(s.tx1,0),t.lineTo(s.tx2,n);break;case"bottom":t.moveTo(s.tx1,n),t.lineTo(s.tx2,n*2);break;default:t.moveTo(n,s.ty1),t.lineTo(n*2,s.ty2);break}t.stroke(),t.restore()}),this._model){const s=this._model;t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth||0,t.fillStyle=s.backgroundColor}else t.fillStyle="blue";o.forEach((s,l)=>{const c=a[l],u=this.getSizeForValue(s.value),d=r?c.x:n,h=r?n:c.y,p={pointStyle:"circle",borderWidth:0,...this._model||{},radius:u};_0(t,p,d,h)})}}Hs.id="size";Hs.defaults=or({},[ed.defaults,Kb,S7]);Hs.descriptors={_scriptable:!0,_indexable:e=>e!=="range"};class C7 extends x7{constructor(){super(...arguments),this._model=null}getSizeForValue(t){const n=this._getNormalizedValue(t);return n==null||Number.isNaN(n)?this.options.missing:this.getSizeImpl(n)}getSizeImpl(t){return Hs.prototype.getSizeImpl.call(this,t)}_drawIndicator(){Hs.prototype._drawIndicator.call(this)}}C7.id="sizeLogarithmic";C7.defaults=or({},[td.defaults,Kb,S7]);function lae(e,t){return[[e[0][0]-t,e[0][1]-t],[e[1][0]+t,e[1][1]+t]]}class La extends ra{constructor(){super(...arguments),this.cache=void 0}inRange(t,n){const r=this.getBounds(),o=(Number.isNaN(t)||t>=r.x&&t<=r.x2)&&(Number.isNaN(n)||n>=r.y&&n<=r.y2),i=this.projectionScale.geoPath.projection();if(o&&!Number.isNaN(t)&&!Number.isNaN(n)&&typeof i.invert=="function"){const a=i.invert([t,n]);return a!=null&&Nre(this.feature,a)}return o}inXRange(t){return this.inRange(t,Number.NaN)}inYRange(t){return this.inRange(Number.NaN,t)}getCenterPoint(){if(this.cache&&this.cache.center)return this.cache.center;let t;if(this.center){const n=this.projectionScale.projection([this.center.longitude,this.center.latitude]);t={x:n[0],y:n[1]}}else{const n=this.projectionScale.geoPath.centroid(this.feature);t={x:n[0],y:n[1]}}return this.cache={...this.cache||{},center:t},t}getBounds(){if(this.cache&&this.cache.bounds)return this.cache.bounds;const t=lae(this.projectionScale.geoPath.bounds(this.feature),this.options.borderWidth/2),n={x:t[0][0],x2:t[1][0],y:t[0][1],y2:t[1][1],width:t[1][0]-t[0][0],height:t[1][1]-t[0][1]};return this.cache={...this.cache||{},bounds:n},n}_drawInCache(t){const n=this.getBounds();if(!Number.isFinite(n.x))return;const r=this.cache&&this.cache.canvas?this.cache.canvas:t.createElement("canvas"),o=Math.floor(n.x),i=Math.floor(n.y),a=Math.ceil(n.x+n.width),s=Math.ceil(n.y+n.height),l=this.pixelRatio||1,c=Math.ceil(Math.max(a-o,1)*l),u=Math.ceil(Math.max(s-i,1)*l);if(c<=0||u<=0)return;r.width=c,r.height=u;const d=r.getContext("2d");d&&(d.clearRect(0,0,r.width,r.height),d.save(),d.scale(l,l),d.translate(-o,-i),this._drawImpl(d),d.restore(),this.cache={...this.cache||{},canvas:r,canvasKey:this._optionsToKey()})}_optionsToKey(){const{options:t}=this;return`${t.backgroundColor};${t.borderColor};${t.borderWidth};${this.pixelRatio}`}_drawImpl(t){const{feature:n}=this,{options:r}=this;t.beginPath(),this.projectionScale.geoPath.context(t)(n),r.backgroundColor&&(t.fillStyle=r.backgroundColor,t.fill()),r.borderColor&&(t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.stroke())}draw(t){const{feature:n}=this;if(!n)return;(!this.cache||this.cache.canvasKey!==this._optionsToKey())&&t.canvas.ownerDocument!=null&&this._drawInCache(t.canvas.ownerDocument);const r=this.getBounds();if(this.cache&&this.cache.canvas&&this.cache.canvas.width>0&&this.cache.canvas.height>0){const o=Math.floor(r.x),i=Math.floor(r.y),a=Math.ceil(r.x+r.width),s=Math.ceil(r.y+r.height),l=a-o,c=s-i;l>0&&c>0&&t.drawImage(this.cache.canvas,o,i,a-o,s-i)}else Number.isFinite(r.x)&&(t.save(),this._drawImpl(t),t.restore())}}La.id="geoFeature";La.defaults={...Kl.defaults,outlineBackgroundColor:null,outlineBorderWidth:0,graticuleBorderColor:"#CCCCCC",graticuleBorderWidth:0};La.defaultRoutes={outlineBorderColor:"borderColor",...Kl.defaultRoutes||{}};const E7={showOutline:!1,showGraticule:!1,clipMap:!0},R7={scales:{projection:{axis:"x",type:wc.id,position:"chartArea",display:!1}}};function RT(e){const t={...e};return Object.keys(e).forEach(n=>{let r=n;if(n.startsWith("outline")){const o=n.slice(7);r=o[0].toLowerCase()+o.slice(1)}else if(n.startsWith("hoverOutline"))r=`hover${n.slice(12)}`;else return;delete t[n],t[r]=e[n]}),t}class P7 extends Xo{getGeoDataset(){return super.getDataset()}getGeoOptions(){return this.chart.options}getProjectionScale(){return this.getScaleForId("projection")}linkScales(){const t=this.getGeoDataset(),n=this.getMeta();n.xAxisID="projection",t.xAxisID="projection",n.yAxisID="projection",t.yAxisID="projection",n.xScale=this.getScaleForId("projection"),n.yScale=this.getScaleForId("projection"),this.getProjectionScale().computeBounds(this.resolveOutline())}showOutline(){return st(this.getGeoDataset().showOutline,this.getGeoOptions().showOutline)}clipMap(){return st(this.getGeoDataset().clipMap,this.getGeoOptions().clipMap)}getGraticule(){return st(this.getGeoDataset().showGraticule,this.getGeoOptions().showGraticule)}update(t){super.update(t);const n=this.getMeta(),r=this.getProjectionScale(),o=r.updateBounds();if(this.showOutline()){const i=n.dataset;if(o&&delete i.cache,i.projectionScale=r,i.pixelRatio=this.chart.currentDevicePixelRatio,t!=="resize"){const a=RT(this.resolveDatasetElementOptions(t)),s={feature:this.resolveOutline(),options:a};this.updateElement(i,void 0,s,t),this.getGraticule()&&(n.graticule=a)}}else this.getGraticule()&&t!=="resize"&&(n.graticule=RT(this.resolveDatasetElementOptions(t)));this.updateElements(n.data,0,n.data.length,t),o&&n.data.forEach(i=>delete i.cache)}resolveOutline(){const n=this.getGeoDataset().outline||{type:"Sphere"};return Array.isArray(n)?{type:"FeatureCollection",features:n}:n}showGraticule(){const t=this.getGraticule(),n=this.getMeta().graticule;if(!t||!n)return;const{ctx:r}=this.chart,i=this.getProjectionScale().geoPath.context(r);if(r.save(),r.beginPath(),typeof t=="boolean")t&&i(Lre());else{const a=V3();t.stepMajor&&a.stepMajor(t.stepMajor),t.stepMinor&&a.stepMinor(t.stepMinor),i(a())}r.strokeStyle=n.graticuleBorderColor,r.lineWidth=n.graticuleBorderWidth,r.stroke(),r.restore()}draw(){const{chart:t}=this,n=this.clipMap();let r=!1;(n===!0||n==="outline"||n==="outline+graticule")&&(r=!0,Wl(t.ctx,t.chartArea)),this.showOutline()&&this.getMeta().dataset&&this.getMeta().dataset.draw.call(this.getMeta().dataset,t.ctx,t.chartArea),n===!0||n==="graticule"||n==="outline+graticule"?r||Wl(t.ctx,t.chartArea):r&&(r=!1,Ul(t.ctx)),this.showGraticule(),n===!0||n==="items"?r||Wl(t.ctx,t.chartArea):r&&(r=!1,Ul(t.ctx)),this.getMeta().data.forEach(o=>o.draw.call(o,t.ctx,t.chartArea)),r&&(r=!1,Ul(t.ctx))}}function $7(e,t,n,r=[],o=[]){Nr.addControllers(n),Array.isArray(r)?Nr.addElements(...r):Nr.addElements(r),Array.isArray(o)?Nr.addScales(...o):Nr.addScales(o);const i=t;return i.type=e,i}class yd extends P7{initialize(){super.initialize(),this.enableOptionSharing=!0}linkScales(){super.linkScales();const t=this.getGeoDataset(),n=this.getMeta();n.vAxisID="color",n.rAxisID="color",t.vAxisID="color",t.rAxisID="color",n.rScale=this.getScaleForId("color"),n.vScale=n.rScale,n.iScale=n.xScale,n.iAxisID=n.xAxisID,t.iAxisID=n.xAxisID}_getOtherScale(t){return t}parse(t,n){const r=this.getMeta().rScale,{data:o}=this.getDataset(),i=this._cachedMeta;for(let a=t;a<t+n;a+=1)i._parsed[a]={[r.axis]:r.parse(o[a],a)}}updateElements(t,n,r,o){const i=this.resolveDataElementOptions(n,o),a=this.getSharedOptions(i),s=this.includeOptions(o,a),l=this.getProjectionScale();this.updateSharedOptions(a,o,i);for(let c=n;c<n+r;c+=1){const u=t[c];u.projectionScale=l,u.feature=this._data[c].feature,u.center=this._data[c].center,u.pixelRatio=this.chart.currentDevicePixelRatio;const d=u.getCenterPoint(),h={x:d.x,y:d.y};s&&(h.options=a||this.resolveDataElementOptions(c,o)),this.updateElement(u,c,h,o)}}indexToColor(t){const n=this.getMeta().rScale;return n.getColorForValue(this.getParsed(t)[n.axis])}}yd.id="choropleth";yd.defaults=or({},[E7,{datasetElementType:La.id,dataElementType:La.id}]);yd.overrides=or({},[R7,{plugins:{tooltip:{callbacks:{title(){return""},label(e){var t,n,r,o;return e.formattedValue==null?(n=(t=e.chart.data)===null||t===void 0?void 0:t.labels)===null||n===void 0?void 0:n[e.dataIndex]:`${(o=(r=e.chart.data)===null||r===void 0?void 0:r.labels)===null||o===void 0?void 0:o[e.dataIndex]}: ${e.formattedValue}`}}},colors:{enabled:!1}},scales:{color:{type:Vs.id,axis:"x"}},elements:{geoFeature:{backgroundColor(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToColor(e.dataIndex)}}}}]);class cae extends Dn{constructor(t,n){super(t,$7("choropleth",n,yd,La,[Vs,wc]))}}cae.id=yd.id;class xd extends P7{initialize(){super.initialize(),this.enableOptionSharing=!0}linkScales(){super.linkScales();const t=this.getGeoDataset(),n=this.getMeta();n.vAxisID="size",n.rAxisID="size",t.vAxisID="size",t.rAxisID="size",n.rScale=this.getScaleForId("size"),n.vScale=n.rScale,n.iScale=n.xScale,n.iAxisID=n.xAxisID,t.iAxisID=n.xAxisID}_getOtherScale(t){return t}parse(t,n){const r=this.getMeta().rScale,o=this.getDataset().data,i=this._cachedMeta;for(let a=t;a<t+n;a+=1){const s=o[a];i._parsed[a]={x:s.longitude==null?s.x:s.longitude,y:s.latitude==null?s.y:s.latitude,[r.axis]:r.parse(s,a)}}}updateElements(t,n,r,o){const i=o==="reset",a=this.resolveDataElementOptions(n,o),s=this.getSharedOptions(a),l=this.includeOptions(o,s),c=this.getProjectionScale();this.getMeta().rScale._model=a,this.updateSharedOptions(s,o,a);for(let u=n;u<n+r;u+=1){const d=t[u],h=this.getParsed(u),p=c.projection([h.x,h.y]),v={x:p?p[0]:0,y:p?p[1]:0,skip:Number.isNaN(h.x)||Number.isNaN(h.y)};l&&(v.options=s||this.resolveDataElementOptions(u,o),i&&(v.options.radius=0)),this.updateElement(d,u,v,o)}}indexToRadius(t){const n=this.getMeta().rScale;return n.getSizeForValue(this.getParsed(t)[n.axis])}}xd.id="bubbleMap";xd.defaults=or({},[E7,{dataElementType:Yl.id,datasetElementType:La.id,showOutline:!0,clipMap:"outline+graticule"}]);xd.overrides=or({},[R7,{plugins:{tooltip:{callbacks:{title(){return""},label(e){var t,n,r,o;return e.formattedValue==null?(n=(t=e.chart.data)===null||t===void 0?void 0:t.labels)===null||n===void 0?void 0:n[e.dataIndex]:`${(o=(r=e.chart.data)===null||r===void 0?void 0:r.labels)===null||o===void 0?void 0:o[e.dataIndex]}: ${e.formattedValue}`}}}},scales:{size:{axis:"x",type:Hs.id}},elements:{point:{radius(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToRadius(e.dataIndex)},hoverRadius(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToRadius(e.dataIndex)+1}}}}]);class uae extends Dn{constructor(t,n){super(t,$7("bubbleMap",n,xd,La,[Hs,wc]))}}uae.id=xd.id;function dae(e){var n;return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0},y:{display:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function fae(e){var n;return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{beginAtZero:!0,stack:1,reverse:!0},y:{stacked:!0,beginAtZero:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function hae(e){var n;return{...e,type:"bar",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function pae(e,t=!1){var r;return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0,beginAtZero:!1},y:{display:!0,stacked:t}},plugins:{...(r=e==null?void 0:e.options)==null?void 0:r.plugins,legend:{position:"bottom",align:"center"}}}}}function gae(e,t){var r,o,i,a,s;return{...e,type:t==="stackedBar"?"bar":"line",options:{...e==null?void 0:e.options,scales:{x:{...(o=(r=e==null?void 0:e.options)==null?void 0:r.scales)==null?void 0:o.x,display:!0,stacked:!0},y:{...(a=(i=e==null?void 0:e.options)==null?void 0:i.scales)==null?void 0:a.y,display:!0,stacked:t==="stackedBar"}},plugins:{...(s=e==null?void 0:e.options)==null?void 0:s.plugins,legend:{position:"bottom",align:"center"}}}}}function mae(e){var n;return{...e,type:"line",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function bae(e,t){var r;return{...t,type:e,options:{...t==null?void 0:t.options,scales:{x:{display:!1},y:{display:!1}},plugins:{...(r=t==null?void 0:t.options)==null?void 0:r.plugins,legend:{position:"bottom",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},borderRadius:0}}}function vae(e){var n;return{...e,type:"radar",options:{...e==null?void 0:e.options,scales:{x:{display:!1},y:{display:!1}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function JC({data:e,cardType:t="bar",cfg:n,customCfg:r,provider:o="chartjs",userSettings:i,preferences:a,topoJson:s}){var l,c,u,d,h,p,v,b,x,y;if(t==="map"){if(!s)return null;const _=(l=a==null?void 0:a.mapVisualOptions)==null?void 0:l.objectKey;if(!_)return null;const S=oae(s,(c=s==null?void 0:s.objects)==null?void 0:c[_]).features;if(!S)return null;const C={plugins:{datalabels:{display:!1}},scales:{x:{display:!1,grid:{display:!1}},y:{display:!1,grid:{display:!1}},projection:{axis:"x",projection:((u=a==null?void 0:a.mapVisualOptions)==null?void 0:u.projection)||"mercator",projectionScale:((d=a==null?void 0:a.mapVisualOptions)==null?void 0:d.projectionScale)||1,projectionOffset:((h=a==null?void 0:a.mapVisualOptions)==null?void 0:h.projectionOffset)||[0,0]},color:{axis:"x",interpolate:((p=a==null?void 0:a.mapVisualOptions)==null?void 0:p.colorScale)||"blues",quantize:5,legend:{position:"bottom-right",align:"right"}}}},{keys:E}=tr(e),$=S.map(z=>{var U;const X=E==null?void 0:E[0],G=E==null?void 0:E[1],A=(U=e.find(V=>(V==null?void 0:V[X])===z.properties.NAME||(V==null?void 0:V[X])===z.properties.name))==null?void 0:U[G];return{feature:z,value:A}}),D=Cf([{label:_,data:$,borderColor:"lightgray"}],r),M={type:"choropleth",data:{labels:S.map(z=>z.properties.NAME||z.properties.name),datasets:D},options:C},{options:L}=k6({cfg:M,preferences:a,customCfg:r});return{...M,options:L}}if(t==="bar"){const _=hae(n);return fl({data:e,cfg:_,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:a})}if(t==="horizontalBar"){const _=dae(n);return fl({data:e,cfg:_,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:a})}if(t==="pyramid"){const _=fae(n),{dimensionKeys:S,metricKeys:C}=tr(e),E=b0({dataArray:e,groupKey:S[0],pivotKey:S[1],valueKey:C[0]}),$=fl({data:E,cfg:_,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:a}),T="x2";return{...$,data:{...$.data,datasets:$.data.datasets.map((M,L)=>L===1?{...M,xAxisID:T}:M)},options:{...$.options,scales:{...(v=$==null?void 0:$.options)==null?void 0:v.scales,[T]:{beginAtZero:!0,stack:1}}}}}if(t==="stackedBar"||t==="stackedLine"){const _=gae(n,t),{dimensionKeys:S,metricKeys:C}=tr(e),E=b0({dataArray:e,groupKey:S[0],pivotKey:S[1],valueKey:C[0],sortChart:a==null?void 0:a.sortChart});return fl({data:E,cfg:_,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:a})}if(t==="line"){const _=mae(n);return fl({data:e,cfg:_,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:a})}if(t==="range"){const _=pae(n),S=GQ(e),C=Cf(S,r),{plugins:E,options:$}=T6((a==null?void 0:a.customVisualCode)||""),T=qo((_==null?void 0:_.options)||{},(n==null?void 0:n.options)||{}),D=qo(T,(a==null?void 0:a.chartOptions)||{}),M=qo(D,(r==null?void 0:r.options)||{}),L=qo(M,$),F=M6(n,a),z=qo(L,F),X={...z,plugins:{...z==null?void 0:z.plugins,datalabels:{...(b=z==null?void 0:z.plugins)==null?void 0:b.datalabels,formatter:(K,q)=>K.map(H=>{var Y,I,te,ce;return Na({number:Number(H),decimalPlaces:((Y=a==null?void 0:a.numberAxisFormat)==null?void 0:Y.decimalPlaces)||0,useSuffix:!!((I=a==null?void 0:a.numberAxisFormat)!=null&&I.suffix),customSuffix:"",locale:((te=a==null?void 0:a.numberAxisFormat)==null?void 0:te.locale)||"",currency:((ce=a==null?void 0:a.numberAxisFormat)==null?void 0:ce.currency)||""})}).slice(0,2).join(" - ")}}},{dimensionKeys:G}=tr(e),A=G[0];return{type:"bar",data:{labels:[...new Set(jw(e,A))],datasets:C},options:X,plugins:[...E]}}if(t==="pie"||t==="doughnut"||t==="polarArea"){const _=bae(t,n),{dimensionKeys:S,metricKeys:C}=tr(e),E=YQ(C,e),$=Cf(E,r),T=S[0],D=jw(e,T),M=qo((_==null?void 0:_.options)||{},(r==null?void 0:r.options)||{}),L=qo(M,(a==null?void 0:a.chartOptions)||{}),F={...L,plugins:{...L.plugins,datalabels:{...(x=L.plugins)==null?void 0:x.datalabels,formatter:(G,A)=>{var U,V,K,q;return Na({number:Number(G),decimalPlaces:((U=a==null?void 0:a.numberAxisFormat)==null?void 0:U.decimalPlaces)||0,useSuffix:!!((V=a==null?void 0:a.numberAxisFormat)!=null&&V.suffix),customSuffix:"",locale:((K=a==null?void 0:a.numberAxisFormat)==null?void 0:K.locale)||"",currency:((q=a==null?void 0:a.numberAxisFormat)==null?void 0:q.currency)||""})}},tooltip:{...(y=L.plugins)==null?void 0:y.tooltip,callbacks:{label:function(G){let A=G.dataset.label||"";A&&(A+=": ");const V=G.dataset.data.reduce((O,H)=>O+H,0),q=(G.parsed/V*100).toFixed(2);return A+=q+"%",A+` (${G.formattedValue})`}}}}};return{type:t,data:{labels:D,datasets:$},options:F,plugins:[t==="doughnut"?{id:"doughnutLabel",beforeDatasetsDraw:function(G,A,U){var ce,de,he,ie;const{ctx:V,data:K}=G;V.save();const q=G.getDatasetMeta(0).data[0].x,O=G.getDatasetMeta(0).data[0].y,H=qu(oh()),Y=window.getComputedStyle(V.canvas).fontFamily;V.font=`1em ${Y}`,V.fontWeight="bolder",V.fillStyle=H,V.textAlign="center",V.textBaseline="middle";const I=K.datasets[0].data.reduce((re,le)=>re+le,0),te=Na({number:Number(I),decimalPlaces:((ce=a==null?void 0:a.numberAxisFormat)==null?void 0:ce.decimalPlaces)||0,useSuffix:!!((de=a==null?void 0:a.numberAxisFormat)!=null&&de.suffix),customSuffix:"",locale:((he=a==null?void 0:a.numberAxisFormat)==null?void 0:he.locale)||"",currency:((ie=a==null?void 0:a.numberAxisFormat)==null?void 0:ie.currency)||""});V.fillText(te,q,O)}}:""]}}if(t==="radar"){const _=vae(n);return fl({data:e,cfg:_,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:a})}if(t==="bubble"||t==="scatter"){const{metricKeys:_}=tr(e);if(_.length<3){console.log("Bubble charts require 3 numeric columns");return}const S=qQ(e),C=Cf(S,r),E={plugins:{datalabels:{display:!0}},scales:{x:{title:{display:!0,text:_[0]},beginAtZero:!0,ticks:{precision:0}},y:{title:{display:!0,text:_[1]},beginAtZero:!0,ticks:{precision:0}}}},$=qo(E,(r==null?void 0:r.options)||{});return{type:t,data:{datasets:C},options:$}}return fl({data:e,cfg:n,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:a})}function yae({chart:e,elementIndex:t,datasetIndex:n,cardType:r,cfg:o,apply:i}){const a=we.getState().theme;if(!o)return;const s=a==="dark"?"rgb(238,238,238,0.2)":"rgb(238,238,238,0.8)";["bar","line","horizontalBar","bubble","scatter"].includes(r)&&wae(e,t,o,i,s),["pie","doughnut","polarArea"].includes(r)&&_ae(e,t,o,i,s),["stackedBar","pyramid"].includes(r)&&xae({chart:e,elementIndex:t,datasetIndex:n,cfg:o,apply:i,blurColor:s})}function xae(e){var s,l,c,u;const{chart:t,elementIndex:n,datasetIndex:r,cfg:o,apply:i,blurColor:a}=e;i?(l=(s=t==null?void 0:t.data)==null?void 0:s.datasets)==null||l.forEach((d,h)=>{var p,v;typeof d.backgroundColor=="string"&&(d.backgroundColor=new Array(d.data.length).fill(d.backgroundColor),d.borderColor=new Array(d.data.length).fill(d.borderColor)),d.backgroundColor=(p=d==null?void 0:d.backgroundColor)==null?void 0:p.map((b,x)=>x===n&&h===r?b:a),d.borderColor=(v=d==null?void 0:d.borderColor)==null?void 0:v.map((b,x)=>x===n&&h===r?b:a)}):(u=(c=t==null?void 0:t.data)==null?void 0:c.datasets)==null||u.forEach((d,h)=>{var p,v,b,x,y,_;d.backgroundColor=new Array(d.data.length).fill((b=(v=(p=o==null?void 0:o.data)==null?void 0:p.datasets)==null?void 0:v[h])==null?void 0:b.backgroundColor),d.borderColor=new Array(d.data.length).fill((_=(y=(x=o==null?void 0:o.data)==null?void 0:x.datasets)==null?void 0:y[h])==null?void 0:_.borderColor)}),t==null||t.update()}function wae(e,t,n,r,o){var i,a,s,l;r?(a=(i=e==null?void 0:e.data)==null?void 0:i.datasets)==null||a.forEach(c=>{var u,d;typeof c.backgroundColor=="string"&&(c.backgroundColor=new Array(c.data.length).fill(c.backgroundColor),c.borderColor=new Array(c.data.length).fill(c.borderColor)),c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((h,p)=>p===t?h:o),c.borderColor=(d=c==null?void 0:c.borderColor)==null?void 0:d.map((h,p)=>p===t?h:o)}):(l=(s=e==null?void 0:e.data)==null?void 0:s.datasets)==null||l.forEach((c,u)=>{var d,h,p,v,b,x;c.backgroundColor=new Array(c.data.length).fill((p=(h=(d=n==null?void 0:n.data)==null?void 0:d.datasets)==null?void 0:h[u])==null?void 0:p.backgroundColor),c.borderColor=new Array(c.data.length).fill((x=(b=(v=n==null?void 0:n.data)==null?void 0:v.datasets)==null?void 0:b[u])==null?void 0:x.borderColor)}),e==null||e.update()}function _ae(e,t,n,r,o){var i,a,s,l;r?(a=(i=e==null?void 0:e.data)==null?void 0:i.datasets)==null||a.forEach(c=>{var u,d;c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((h,p)=>p===t?h:o),c.borderColor=(d=c==null?void 0:c.borderColor)==null?void 0:d.map((h,p)=>p===t?h:o)}):(l=(s=e==null?void 0:e.data)==null?void 0:s.datasets)==null||l.forEach((c,u)=>{var d,h,p,v,b,x,y,_;typeof c.backgroundColor=="string"&&(c.backgroundColor=(p=(h=(d=n==null?void 0:n.data)==null?void 0:d.datasets)==null?void 0:h[u])==null?void 0:p.backgroundColor,c.borderColor=(x=(b=(v=n==null?void 0:n.data)==null?void 0:v.datasets)==null?void 0:b[u])==null?void 0:x.borderColor),c.backgroundColor=(y=c==null?void 0:c.backgroundColor)==null?void 0:y.map((S,C)=>{var E;return(E=n.data.datasets[u].backgroundColor)==null?void 0:E[C]}),c.borderColor=(_=c==null?void 0:c.borderColor)==null?void 0:_.map((S,C)=>{var E;return(E=n.data.datasets[u].borderColor)==null?void 0:E[C]})}),e==null||e.update()}function Sae({card:e,data:t,datasetIndex:n,clickIndex:r,value:o}){var i,a,s,l,c,u;try{if(!t)return;const{keys:d,dimensionKeys:h,metricKeys:p}=tr(t);if(e.type==="map"){const v=d[0],b=((a=(i=o==null?void 0:o.feature)==null?void 0:i.properties)==null?void 0:a.name)||((l=(s=o==null?void 0:o.feature)==null?void 0:s.properties)==null?void 0:l.NAME);return[{columnName:v,columnValue:b}]}if(["bar","horizontalBar","line","pie","doughnut","radar","polarArea"].includes(e.type)){const v=h[0],b=(c=t[r])==null?void 0:c[v];return[{columnName:v,columnValue:b,metric:p[n],value:o}]}if(["stackedBar","pyramid"].includes(e.type)){const v=b0({dataArray:t,groupKey:h[0],pivotKey:h[1],valueKey:p[0]}),b=h[0],x=(u=v[r])==null?void 0:u[b],y=h[1],{metricKeys:_}=tr(v),S=_[n];return[{columnName:b,columnValue:x,metric:p[0],value:o},{columnName:y,columnValue:S,metric:p[0],value:o}]}if(e.type==="bubble"||e.type==="scatter"){const v=h[0],b=o.label;return[{columnName:v,columnValue:b,metric1:p[0],value1:o.x,metric2:p[1],value2:o.y,metric3:p==null?void 0:p[2],value3:o==null?void 0:o.r}]}}catch(d){console.error("Error in getAdhocFilter",d)}}function O7(e){var s,l,c,u,d,h;const t=(((l=(s=e.preferences)==null?void 0:s.mapVisualOptions)==null?void 0:l.topoJsonUrl)==="custom"?(u=(c=e.preferences)==null?void 0:c.mapVisualOptions)==null?void 0:u.customTopoJsonUrl:(h=(d=e.preferences)==null?void 0:d.mapVisualOptions)==null?void 0:h.topoJsonUrl)||"",n=!!t&&e.type==="map",{data:r,isLoading:o,isFetching:i,isError:a}=ap({queryKey:["topojson",t],queryFn:()=>fetch(t).then(p=>p.json()),enabled:n,staleTime:1/0});return{data:r,isLoading:o,isFetching:i,isError:a}}function Cae(e){var a,s;const[t]=m.useState({id:"",title:"",type:"bar",data:[]}),{getCard:n}=dr(),r=n(e),o=ZC(r||t),i={...r,data:((a=o==null?void 0:o.data)==null?void 0:a.records)||[]};return{...o,data:((s=o==null?void 0:o.data)==null?void 0:s.records)||[],card:i}}function ZC(e){var X,G,A,U;const{onChartElementClicked:t}=_i(),[n,r]=m.useState(0);((X=e==null?void 0:e.preferences)==null?void 0:X.filterOnClickColumnIndex)===void 0||(G=e.preferences)==null||G.filterOnClickColumnIndex;const o=we(V=>V.isVisualEditing),i=we(V=>V.filteringCards),a=we(V=>V.selectedSheetId),s=we(V=>V.selectedLensId);we(V=>V.selectedCardId),we(V=>V.dashboard),we(V=>V.isDashboardEditing),we(V=>V.themeStyle);const l=we(V=>V.filterValues),c=m.useRef(l),u=(A=e==null?void 0:e.preferences)==null?void 0:A.onClickFilter,{addFilteringCard:d,getCardFrame:h,addOrUpdateFilterValues:p,removeFilterValue:v,removeFilteringCard:b}=dr(),{data:x,isLoading:y,isFetching:_,isError:S,queryKey:C}=Bb(e),{data:E}=O7(e),$=i==null?void 0:i.find(V=>V.id===e.id),T=h(e.id),D=(T==null?void 0:T.cards)||[],M=(D==null?void 0:D.length)==1;let L;x&&x.records&&((U=x.records)==null?void 0:U.length)>0&&e.type!=="custom"&&(L=JC({data:x==null?void 0:x.records,cardType:e.type,cfg:e.cfg,customCfg:e.customCfg,preferences:e.preferences,topoJson:E}));const F=m.useRef({filteringCards:i});m.useEffect(()=>{!(x!=null&&x.records)||y||_||$&&M||o||r(V=>V+1)},[x==null?void 0:x.records,y,_,$,M,o]),m.useEffect(()=>{e.connectionId&&!$&&(c.current=l)},[l,s,e.connectionId,$]),m.useEffect(()=>{var K;$&&(F.current.filteringCards=[...i||[]]),!$&&((K=F.current.filteringCards)==null?void 0:K.find(q=>q.id===e.id))&&M&&r(q=>q+1)},[$,M,e.id,i]);function z(V,K,q,O){var I;let H=!1;if(!(x!=null&&x.records))return;const Y=Sae({card:e,data:x==null?void 0:x.records,datasetIndex:K,clickIndex:q,value:O});if(console.log("fieldValues",Y),t==null||t(e,Y),!!(((I=e==null?void 0:e.preferences)==null?void 0:I.onClickFilter)??[]).length){if($){const te=e.id;v(te),b(e)}else{if(H=!0,!Y)return;const te=[];Y.forEach((ce,de)=>{const he=u==null?void 0:u.find(re=>re.columnIndex===de);if(!he)return;const ie={filterId:e.id+"-"+ce.columnName+"-"+a,connectionId:e==null?void 0:e.connectionId,tableName:e.lastSelectedTable,name:ce.columnName,expression:he.expression,valueType:vb(Y[he.columnIndex].columnValue),operation:"=",values:[Y[he.columnIndex].columnValue]};te.push(ie)}),p(te),d(e)}yae({chart:V,elementIndex:q,datasetIndex:K,cardType:e.type,cfg:L,apply:H})}}return{isError:S,isLoading:y,isFetching:_,data:x,visualKey:n,handleDatapointClick:z,cfg:L}}function qi({children:e,containerClassName:t,className:n,text:r,onSave:o,type:i="input"}){const[a,s]=m.useState(!1),[l,c]=m.useState(r),u=we(p=>p.isDashboardEditing),d=p=>{p.stopPropagation(),u&&s(!0)};function h(){return i==="textarea"?R.jsx("textarea",{className:ye("grow rounded-sm bg-background px-2 py-1 text-sm outline-dashed outline-[0.5px] outline-primary/50",n),onChange:p=>c(p.target.value),value:l,autoFocus:!0,onBlur:()=>s(!1),onKeyDown:p=>{p.stopPropagation(),!(p.key==="Enter"&&p.shiftKey)&&(p.key==="Enter"||p.key==="Tab")&&(s(!1),o(l))}}):R.jsx("input",{onMouseDown:p=>p.stopPropagation(),type:"text",className:ye("rounded-sm bg-background px-2 py-1 text-sm outline-dashed outline-[0.5px] outline-primary/50",n),onChange:p=>c(p.target.value),value:l,autoFocus:!0,onBlur:()=>s(!1),onKeyDown:p=>{p.stopPropagation(),(p.key==="Enter"||p.key==="Tab")&&(s(!1),o(l))}})}return R.jsx("div",{className:ye("flex",t),role:"editable",onDoubleClick:d,children:a?h():e})}function T7({card:e,data:t}){var x,y,_,S,C,E,$,T,D,M,L,F,z,X,G,A,U,V,K,q,O,H,Y,I;const n=we(te=>te.actions.setCardTitle),r=we(te=>te.actions.setCardDescription),o=we(te=>te.isVisualEditing),i=Ir(te=>te.card),a=Ir(te=>te.actions.setCard);Ir(te=>te.actions.setNumberFormat);const s=we(te=>te.selectedSheetId),l=(y=(x=e.preferences)==null?void 0:x.formatNumber)==null?void 0:y.colorRanges,{metricKeys:c}=tr(t),u=(_=t==null?void 0:t[0])==null?void 0:_[c==null?void 0:c[0]],d=(S=t==null?void 0:t[0])==null?void 0:S[c==null?void 0:c[1]],h=t&&t.length>0;function p(te){o?a({...i,title:te}):n(s,e.id,te)}function v(te){o?a({...i,description:te}):r(s,e.id,te)}const b=d&&d-u!==0?(u-d)/d:null;return R.jsxs("div",{className:"kpi-card flex grow flex-col overflow-auto",children:[R.jsxs(xb,{className:"grow pb-3",children:[R.jsx(qi,{text:o?i.title:e.title,onSave:p,children:R.jsx("div",{className:"flex items-center gap-2",children:R.jsx(pd,{className:"text-base font-medium text-muted-foreground",children:e.title})})}),h&&R.jsxs("div",{className:"flex flex-wrap items-end gap-3 text-foreground",children:[R.jsx("p",{style:{color:xC(u,l)},className:"text-3xl font-semibold",children:Na({number:u,decimalPlaces:((E=(C=e.preferences)==null?void 0:C.formatNumber)==null?void 0:E.decimalPlaces)||0,useSuffix:!!((T=($=e.preferences)==null?void 0:$.formatNumber)!=null&&T.suffix),customSuffix:((M=(D=e.preferences)==null?void 0:D.formatNumber)==null?void 0:M.suffix)||"",locale:((F=(L=e.preferences)==null?void 0:L.formatNumber)==null?void 0:F.locale)||"",currency:((X=(z=e.preferences)==null?void 0:z.formatNumber)==null?void 0:X.currency)||""})}),d&&R.jsxs("span",{className:"min-w-fit text-base font-normal text-muted-foreground",children:["from  ",Na({number:d,decimalPlaces:((A=(G=e.preferences)==null?void 0:G.formatNumber)==null?void 0:A.decimalPlaces)||0,useSuffix:!!((V=(U=e.preferences)==null?void 0:U.formatNumber)!=null&&V.suffix),customSuffix:((q=(K=e.preferences)==null?void 0:K.formatNumber)==null?void 0:q.suffix)||"",locale:((H=(O=e.preferences)==null?void 0:O.formatNumber)==null?void 0:H.locale)||"",currency:((I=(Y=e.preferences)==null?void 0:Y.formatNumber)==null?void 0:I.currency)||""})]})]})]}),b&&R.jsxs(wb,{className:"grow items-start gap-1 pb-4 text-sm",children:[R.jsx(D7,{children:b}),R.jsxs("div",{className:"flex gap-1 text-muted-foreground",children:[b>0?"up ":"down ",R.jsx(qi,{text:e.description||"",onSave:v,children:e.description})]})]})]})}function D7({children:e,className:t}){var i,a;const n=we(s=>s.themeStyle),r=e>0?R.jsx("span",{children:"+"}):R.jsx("span",{children:"-"}),o=`${Math.abs(e*100).toFixed(0)}%`;return R.jsxs("div",{style:{borderRadius:(a=(i=n==null?void 0:n.chart)==null?void 0:i.options)==null?void 0:a.borderRadius},className:ye("flex items-center px-1 text-sm font-semibold",{"bg-green-600/10 text-green-600":e>0,"bg-destructive/10 text-destructive":e<0},t),children:[r,R.jsx("span",{className:"ml-[1px]",children:o})]})}const Eae=["top","right","bottom","left"],Ws=Math.min,_o=Math.max,H0=Math.round,sm=Math.floor,Us=e=>({x:e,y:e}),Rae={left:"right",right:"left",bottom:"top",top:"bottom"},Pae={start:"end",end:"start"};function v_(e,t,n){return _o(e,Ws(t,n))}function Fa(e,t){return typeof e=="function"?e(t):e}function ja(e){return e.split("-")[0]}function wd(e){return e.split("-")[1]}function eE(e){return e==="x"?"y":"x"}function tE(e){return e==="y"?"height":"width"}function _d(e){return["top","bottom"].includes(ja(e))?"y":"x"}function nE(e){return eE(_d(e))}function $ae(e,t,n){n===void 0&&(n=!1);const r=wd(e),o=nE(e),i=tE(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=W0(a)),[a,W0(a)]}function Oae(e){const t=W0(e);return[y_(e),t,y_(t)]}function y_(e){return e.replace(/start|end/g,t=>Pae[t])}function Tae(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}function Dae(e,t,n,r){const o=wd(e);let i=Tae(ja(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(y_)))),i}function W0(e){return e.replace(/left|right|bottom|top/g,t=>Rae[t])}function Aae(e){return{top:0,right:0,bottom:0,left:0,...e}}function A7(e){return typeof e!="number"?Aae(e):{top:e,right:e,bottom:e,left:e}}function U0(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function PT(e,t,n){let{reference:r,floating:o}=e;const i=_d(t),a=nE(t),s=tE(a),l=ja(t),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[s]/2-o[s]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(wd(t)){case"start":p[a]-=h*(n&&c?-1:1);break;case"end":p[a]+=h*(n&&c?-1:1);break}return p}const Mae=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=PT(c,r,l),h=r,p={},v=0;for(let b=0;b<s.length;b++){const{name:x,fn:y}=s[b],{x:_,y:S,data:C,reset:E}=await y({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:p,rects:c,platform:a,elements:{reference:e,floating:t}});if(u=_??u,d=S??d,p={...p,[x]:{...p[x],...C}},E&&v<=50){v++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(c=E.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:u,y:d}=PT(c,h,l)),b=-1;continue}}return{x:u,y:d,placement:h,strategy:o,middlewareData:p}};async function bh(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=Fa(t,e),v=A7(p),x=s[h?d==="floating"?"reference":"floating":d],y=U0(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),_=d==="floating"?{...a.floating,x:r,y:o}:a.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),C=await(i.isElement==null?void 0:i.isElement(S))?await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1}:{x:1,y:1},E=U0(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:_,offsetParent:S,strategy:l}):_);return{top:(y.top-E.top+v.top)/C.y,bottom:(E.bottom-y.bottom+v.bottom)/C.y,left:(y.left-E.left+v.left)/C.x,right:(E.right-y.right+v.right)/C.x}}const $T=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Fa(e,t)||{};if(c==null)return{};const d=A7(u),h={x:n,y:r},p=nE(o),v=tE(p),b=await a.getDimensions(c),x=p==="y",y=x?"top":"left",_=x?"bottom":"right",S=x?"clientHeight":"clientWidth",C=i.reference[v]+i.reference[p]-h[p]-i.floating[v],E=h[p]-i.reference[p],$=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let T=$?$[S]:0;(!T||!await(a.isElement==null?void 0:a.isElement($)))&&(T=s.floating[S]||i.floating[v]);const D=C/2-E/2,M=T/2-b[v]/2-1,L=Ws(d[y],M),F=Ws(d[_],M),z=L,X=T-b[v]-F,G=T/2-b[v]/2+D,A=v_(z,G,X),U=!l.arrow&&wd(o)!=null&&G!=A&&i.reference[v]/2-(G<z?L:F)-b[v]/2<0,V=U?G<z?G-z:G-X:0;return{[p]:h[p]+V,data:{[p]:A,centerOffset:G-A-V,...U&&{alignmentOffset:V}},reset:U}}}),kae=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:b=!0,...x}=Fa(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=ja(o),_=ja(s)===s,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=h||(_||!b?[W0(s)]:Oae(s));!h&&v!=="none"&&C.push(...Dae(s,b,v,S));const E=[s,...C],$=await bh(t,x),T=[];let D=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&T.push($[y]),d){const z=$ae(o,a,S);T.push($[z[0]],$[z[1]])}if(D=[...D,{placement:o,overflows:T}],!T.every(z=>z<=0)){var M,L;const z=(((M=i.flip)==null?void 0:M.index)||0)+1,X=E[z];if(X)return{data:{index:z,overflows:D},reset:{placement:X}};let G=(L=D.filter(A=>A.overflows[0]<=0).sort((A,U)=>A.overflows[1]-U.overflows[1])[0])==null?void 0:L.placement;if(!G)switch(p){case"bestFit":{var F;const A=(F=D.map(U=>[U.placement,U.overflows.filter(V=>V>0).reduce((V,K)=>V+K,0)]).sort((U,V)=>U[1]-V[1])[0])==null?void 0:F[0];A&&(G=A);break}case"initialPlacement":G=s;break}if(o!==G)return{reset:{placement:G}}}return{}}}};function OT(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function TT(e){return Eae.some(t=>e[t]>=0)}const Iae=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Fa(e,t);switch(r){case"referenceHidden":{const i=await bh(t,{...o,elementContext:"reference"}),a=OT(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:TT(a)}}}case"escaped":{const i=await bh(t,{...o,altBoundary:!0}),a=OT(i,n.floating);return{data:{escapedOffsets:a,escaped:TT(a)}}}default:return{}}}}};async function Nae(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=ja(n),s=wd(n),l=_d(n)==="y",c=["left","top"].includes(a)?-1:1,u=i&&l?-1:1,d=Fa(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:v}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&typeof v=="number"&&(p=s==="end"?v*-1:v),l?{x:p*u,y:h*c}:{x:h*c,y:p*u}}const Lae=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await Nae(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},Fae=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:x=>{let{x:y,y:_}=x;return{x:y,y:_}}},...l}=Fa(e,t),c={x:n,y:r},u=await bh(t,l),d=_d(ja(o)),h=eE(d);let p=c[h],v=c[d];if(i){const x=h==="y"?"top":"left",y=h==="y"?"bottom":"right",_=p+u[x],S=p-u[y];p=v_(_,p,S)}if(a){const x=d==="y"?"top":"left",y=d==="y"?"bottom":"right",_=v+u[x],S=v-u[y];v=v_(_,v,S)}const b=s.fn({...t,[h]:p,[d]:v});return{...b,data:{x:b.x-n,y:b.y-r}}}}},jae=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Fa(e,t),u={x:n,y:r},d=_d(o),h=eE(d);let p=u[h],v=u[d];const b=Fa(s,t),x=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const S=h==="y"?"height":"width",C=i.reference[h]-i.floating[S]+x.mainAxis,E=i.reference[h]+i.reference[S]-x.mainAxis;p<C?p=C:p>E&&(p=E)}if(c){var y,_;const S=h==="y"?"width":"height",C=["top","left"].includes(ja(o)),E=i.reference[d]-i.floating[S]+(C&&((y=a.offset)==null?void 0:y[d])||0)+(C?0:x.crossAxis),$=i.reference[d]+i.reference[S]+(C?0:((_=a.offset)==null?void 0:_[d])||0)-(C?x.crossAxis:0);v<E?v=E:v>$&&(v=$)}return{[h]:p,[d]:v}}}},zae=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:a=()=>{},...s}=Fa(e,t),l=await bh(t,s),c=ja(n),u=wd(n),d=_d(n)==="y",{width:h,height:p}=r.floating;let v,b;c==="top"||c==="bottom"?(v=c,b=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(b=c,v=u==="end"?"top":"bottom");const x=p-l[v],y=h-l[b],_=!t.middlewareData.shift;let S=x,C=y;if(d){const $=h-l.left-l.right;C=u||_?Ws(y,$):$}else{const $=p-l.top-l.bottom;S=u||_?Ws(x,$):$}if(_&&!u){const $=_o(l.left,0),T=_o(l.right,0),D=_o(l.top,0),M=_o(l.bottom,0);d?C=h-2*($!==0||T!==0?$+T:_o(l.left,l.right)):S=p-2*(D!==0||M!==0?D+M:_o(l.top,l.bottom))}await a({...t,availableWidth:C,availableHeight:S});const E=await o.getDimensions(i.floating);return h!==E.width||p!==E.height?{reset:{rects:!0}}:{}}}};function qs(e){return M7(e)?(e.nodeName||"").toLowerCase():"#document"}function Ro(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ha(e){var t;return(t=(M7(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function M7(e){return e instanceof Node||e instanceof Ro(e).Node}function za(e){return e instanceof Element||e instanceof Ro(e).Element}function Qi(e){return e instanceof HTMLElement||e instanceof Ro(e).HTMLElement}function DT(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ro(e).ShadowRoot}function gp(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Jo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Bae(e){return["table","td","th"].includes(qs(e))}function rE(e){const t=oE(),n=Jo(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Vae(e){let t=ad(e);for(;Qi(t)&&!Xb(t);){if(rE(t))return t;t=ad(t)}return null}function oE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Xb(e){return["html","body","#document"].includes(qs(e))}function Jo(e){return Ro(e).getComputedStyle(e)}function Qb(e){return za(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ad(e){if(qs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||DT(e)&&e.host||Ha(e);return DT(t)?t.host:t}function k7(e){const t=ad(e);return Xb(t)?e.ownerDocument?e.ownerDocument.body:e.body:Qi(t)&&gp(t)?t:k7(t)}function vh(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=k7(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=Ro(o);return i?t.concat(a,a.visualViewport||[],gp(o)?o:[],a.frameElement&&n?vh(a.frameElement):[]):t.concat(o,vh(o,[],n))}function I7(e){const t=Jo(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Qi(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=H0(n)!==i||H0(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function iE(e){return za(e)?e:e.contextElement}function Cu(e){const t=iE(e);if(!Qi(t))return Us(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=I7(t);let a=(i?H0(n.width):n.width)/r,s=(i?H0(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Hae=Us(0);function N7(e){const t=Ro(e);return!oE()||!t.visualViewport?Hae:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Wae(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ro(e)?!1:t}function uc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=iE(e);let a=Us(1);t&&(r?za(r)&&(a=Cu(r)):a=Cu(e));const s=Wae(i,n,r)?N7(i):Us(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){const h=Ro(i),p=r&&za(r)?Ro(r):r;let v=h.frameElement;for(;v&&r&&p!==h;){const b=Cu(v),x=v.getBoundingClientRect(),y=Jo(v),_=x.left+(v.clientLeft+parseFloat(y.paddingLeft))*b.x,S=x.top+(v.clientTop+parseFloat(y.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,d*=b.y,l+=_,c+=S,v=Ro(v).frameElement}}return U0({width:u,height:d,x:l,y:c})}function Uae(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Qi(n),i=Ha(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0},s=Us(1);const l=Us(0);if((o||!o&&r!=="fixed")&&((qs(n)!=="body"||gp(i))&&(a=Qb(n)),Qi(n))){const c=uc(n);s=Cu(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-a.scrollLeft*s.x+l.x,y:t.y*s.y-a.scrollTop*s.y+l.y}}function qae(e){return Array.from(e.getClientRects())}function L7(e){return uc(Ha(e)).left+Qb(e).scrollLeft}function Gae(e){const t=Ha(e),n=Qb(e),r=e.ownerDocument.body,o=_o(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=_o(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+L7(e);const s=-n.scrollTop;return Jo(r).direction==="rtl"&&(a+=_o(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}function Yae(e,t){const n=Ro(e),r=Ha(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const c=oE();(!c||c&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}function Kae(e,t){const n=uc(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Qi(e)?Cu(e):Us(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:a,height:s,x:l,y:c}}function AT(e,t,n){let r;if(t==="viewport")r=Yae(e,n);else if(t==="document")r=Gae(Ha(e));else if(za(t))r=Kae(t,n);else{const o=N7(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return U0(r)}function F7(e,t){const n=ad(e);return n===t||!za(n)||Xb(n)?!1:Jo(n).position==="fixed"||F7(n,t)}function Xae(e,t){const n=t.get(e);if(n)return n;let r=vh(e,[],!1).filter(s=>za(s)&&qs(s)!=="body"),o=null;const i=Jo(e).position==="fixed";let a=i?ad(e):e;for(;za(a)&&!Xb(a);){const s=Jo(a),l=rE(a);!l&&s.position==="fixed"&&(o=null),(i?!l&&!o:!l&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||gp(a)&&!l&&F7(e,a))?r=r.filter(u=>u!==a):o=s,a=ad(a)}return t.set(e,r),r}function Qae(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?Xae(t,this._c):[].concat(n),r],s=a[0],l=a.reduce((c,u)=>{const d=AT(t,u,o);return c.top=_o(d.top,c.top),c.right=Ws(d.right,c.right),c.bottom=Ws(d.bottom,c.bottom),c.left=_o(d.left,c.left),c},AT(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Jae(e){return I7(e)}function Zae(e,t,n){const r=Qi(t),o=Ha(t),i=n==="fixed",a=uc(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=Us(0);if(r||!r&&!i)if((qs(t)!=="body"||gp(o))&&(s=Qb(t)),r){const c=uc(t,!0,i,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else o&&(l.x=L7(o));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function MT(e,t){return!Qi(e)||Jo(e).position==="fixed"?null:t?t(e):e.offsetParent}function j7(e,t){const n=Ro(e);if(!Qi(e))return n;let r=MT(e,t);for(;r&&Bae(r)&&Jo(r).position==="static";)r=MT(r,t);return r&&(qs(r)==="html"||qs(r)==="body"&&Jo(r).position==="static"&&!rE(r))?n:r||Vae(e)||n}const ese=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||j7,i=this.getDimensions;return{reference:Zae(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function tse(e){return Jo(e).direction==="rtl"}const nse={convertOffsetParentRelativeRectToViewportRelativeRect:Uae,getDocumentElement:Ha,getClippingRect:Qae,getOffsetParent:j7,getElementRects:ese,getClientRects:qae,getDimensions:Jae,getScale:Cu,isElement:za,isRTL:tse};function rse(e,t){let n=null,r;const o=Ha(e);function i(){clearTimeout(r),n&&n.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),i();const{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(s||t(),!d||!h)return;const p=sm(u),v=sm(o.clientWidth-(c+d)),b=sm(o.clientHeight-(u+h)),x=sm(c),_={rootMargin:-p+"px "+-v+"px "+-b+"px "+-x+"px",threshold:_o(0,Ws(1,l))||1};let S=!0;function C(E){const $=E[0].intersectionRatio;if($!==l){if(!S)return a();$?a(!1,$):r=setTimeout(()=>{a(!1,1e-7)},100)}S=!1}try{n=new IntersectionObserver(C,{..._,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,_)}n.observe(e)}return a(!0),i}function ose(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=iE(e),u=o||i?[...c?vh(c):[],...vh(t)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const d=c&&s?rse(c,n):null;let h=-1,p=null;a&&(p=new ResizeObserver(y=>{let[_]=y;_&&_.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{p&&p.observe(t)})),n()}),c&&!l&&p.observe(c),p.observe(t));let v,b=l?uc(e):null;l&&x();function x(){const y=uc(e);b&&(y.x!==b.x||y.y!==b.y||y.width!==b.width||y.height!==b.height)&&n(),b=y,v=requestAnimationFrame(x)}return n(),()=>{u.forEach(y=>{o&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),d&&d(),p&&p.disconnect(),p=null,l&&cancelAnimationFrame(v)}}const ise=(e,t,n)=>{const r=new Map,o={platform:nse,...n},i={...o.platform,_c:r};return Mae(e,t,{...o,platform:i})},ase=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?$T({element:r.current,padding:o}).fn(n):{}:r?$T({element:r,padding:o}).fn(n):{}}}};var t0=typeof document<"u"?m.useLayoutEffect:m.useEffect;function q0(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!q0(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!q0(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function z7(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function kT(e,t){const n=z7(e);return Math.round(t*n)/n}function IT(e){const t=j.useRef(e);return t0(()=>{t.current=e}),t}function sse(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[u,d]=j.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=j.useState(r);q0(h,r)||p(r);const[v,b]=j.useState(null),[x,y]=j.useState(null),_=j.useCallback(U=>{U!=$.current&&($.current=U,b(U))},[b]),S=j.useCallback(U=>{U!==T.current&&(T.current=U,y(U))},[y]),C=i||v,E=a||x,$=j.useRef(null),T=j.useRef(null),D=j.useRef(u),M=IT(l),L=IT(o),F=j.useCallback(()=>{if(!$.current||!T.current)return;const U={placement:t,strategy:n,middleware:h};L.current&&(U.platform=L.current),ise($.current,T.current,U).then(V=>{const K={...V,isPositioned:!0};z.current&&!q0(D.current,K)&&(D.current=K,_S.flushSync(()=>{d(K)}))})},[h,t,n,L]);t0(()=>{c===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,d(U=>({...U,isPositioned:!1})))},[c]);const z=j.useRef(!1);t0(()=>(z.current=!0,()=>{z.current=!1}),[]),t0(()=>{if(C&&($.current=C),E&&(T.current=E),C&&E){if(M.current)return M.current(C,E,F);F()}},[C,E,F,M]);const X=j.useMemo(()=>({reference:$,floating:T,setReference:_,setFloating:S}),[_,S]),G=j.useMemo(()=>({reference:C,floating:E}),[C,E]),A=j.useMemo(()=>{const U={position:n,left:0,top:0};if(!G.floating)return U;const V=kT(G.floating,u.x),K=kT(G.floating,u.y);return s?{...U,transform:"translate("+V+"px, "+K+"px)",...z7(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:K}},[n,s,G.floating,u.x,u.y]);return j.useMemo(()=>({...u,update:F,refs:X,elements:G,floatingStyles:A}),[u,F,X,G,A])}function Jb(e){const[t,n]=m.useState(void 0);return Cr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,s;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,s=c.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const B7="Popper",[V7,oa]=hr(B7),[lse,H7]=V7(B7),cse=e=>{const{__scopePopper:t,children:n}=e,[r,o]=m.useState(null);return m.createElement(lse,{scope:t,anchor:r,onAnchorChange:o},n)},use="PopperAnchor",dse=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=H7(use,n),a=m.useRef(null),s=Rt(t,a);return m.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:m.createElement(Qe.div,ue({},o,{ref:s}))}),W7="PopperContent",[fse,t5e]=V7(W7),hse=m.forwardRef((e,t)=>{var n,r,o,i,a,s,l,c;const{__scopePopper:u,side:d="bottom",sideOffset:h=0,align:p="center",alignOffset:v=0,arrowPadding:b=0,avoidCollisions:x=!0,collisionBoundary:y=[],collisionPadding:_=0,sticky:S="partial",hideWhenDetached:C=!1,updatePositionStrategy:E="optimized",onPlaced:$,...T}=e,D=H7(W7,u),[M,L]=m.useState(null),F=Rt(t,Oe=>L(Oe)),[z,X]=m.useState(null),G=Jb(z),A=(n=G==null?void 0:G.width)!==null&&n!==void 0?n:0,U=(r=G==null?void 0:G.height)!==null&&r!==void 0?r:0,V=d+(p!=="center"?"-"+p:""),K=typeof _=="number"?_:{top:0,right:0,bottom:0,left:0,..._},q=Array.isArray(y)?y:[y],O=q.length>0,H={padding:K,boundary:q.filter(pse),altBoundary:O},{refs:Y,floatingStyles:I,placement:te,isPositioned:ce,middlewareData:de}=sse({strategy:"fixed",placement:V,whileElementsMounted:(...Oe)=>ose(...Oe,{animationFrame:E==="always"}),elements:{reference:D.anchor},middleware:[Lae({mainAxis:h+U,alignmentAxis:v}),x&&Fae({mainAxis:!0,crossAxis:!1,limiter:S==="partial"?jae():void 0,...H}),x&&kae({...H}),zae({...H,apply:({elements:Oe,rects:Te,availableWidth:We,availableHeight:Be})=>{const{width:Ie,height:Ke}=Te.reference,dt=Oe.floating.style;dt.setProperty("--radix-popper-available-width",`${We}px`),dt.setProperty("--radix-popper-available-height",`${Be}px`),dt.setProperty("--radix-popper-anchor-width",`${Ie}px`),dt.setProperty("--radix-popper-anchor-height",`${Ke}px`)}}),z&&ase({element:z,padding:b}),gse({arrowWidth:A,arrowHeight:U}),C&&Iae({strategy:"referenceHidden",...H})]}),[he,ie]=U7(te),re=Xn($);Cr(()=>{ce&&(re==null||re())},[ce,re]);const le=(o=de.arrow)===null||o===void 0?void 0:o.x,xe=(i=de.arrow)===null||i===void 0?void 0:i.y,Z=((a=de.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[ve,Ce]=m.useState();return Cr(()=>{M&&Ce(window.getComputedStyle(M).zIndex)},[M]),m.createElement("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:ce?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[(s=de.transformOrigin)===null||s===void 0?void 0:s.x,(l=de.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},m.createElement(fse,{scope:u,placedSide:he,onArrowChange:X,arrowX:le,arrowY:xe,shouldHideArrow:Z},m.createElement(Qe.div,ue({"data-side":he,"data-align":ie},T,{ref:F,style:{...T.style,animation:ce?void 0:"none",opacity:(c=de.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function pse(e){return e!==null}const gse=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,a;const{placement:s,rects:l,middlewareData:c}=t,d=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,h=d?0:e.arrowWidth,p=d?0:e.arrowHeight,[v,b]=U7(s),x={start:"0%",center:"50%",end:"100%"}[b],y=((r=(o=c.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+h/2,_=((i=(a=c.arrow)===null||a===void 0?void 0:a.y)!==null&&i!==void 0?i:0)+p/2;let S="",C="";return v==="bottom"?(S=d?x:`${y}px`,C=`${-p}px`):v==="top"?(S=d?x:`${y}px`,C=`${l.floating.height+p}px`):v==="right"?(S=`${-p}px`,C=d?x:`${_}px`):v==="left"&&(S=`${l.floating.width+p}px`,C=d?x:`${_}px`),{data:{x:S,y:C}}}});function U7(e){const[t,n="center"]=e.split("-");return[t,n]}const mp=cse,bp=dse,vp=hse,aE=m.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?Er.createPortal(m.createElement(Qe.div,ue({},o,{ref:t})),r):null});function mse(e,t=globalThis==null?void 0:globalThis.document){const n=Xn(e);m.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const x_="dismissableLayer.update",bse="dismissableLayer.pointerDownOutside",vse="dismissableLayer.focusOutside";let NT;const yse=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),yp=m.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...c}=e,u=m.useContext(yse),[d,h]=m.useState(null),p=(n=d==null?void 0:d.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,v]=m.useState({}),b=Rt(t,D=>h(D)),x=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),_=x.indexOf(y),S=d?x.indexOf(d):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,E=S>=_,$=xse(D=>{const M=D.target,L=[...u.branches].some(F=>F.contains(M));!E||L||(i==null||i(D),s==null||s(D),D.defaultPrevented||l==null||l())},p),T=wse(D=>{const M=D.target;[...u.branches].some(F=>F.contains(M))||(a==null||a(D),s==null||s(D),D.defaultPrevented||l==null||l())},p);return mse(D=>{S===u.layers.size-1&&(o==null||o(D),!D.defaultPrevented&&l&&(D.preventDefault(),l()))},p),m.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(NT=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),LT(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=NT)}},[d,p,r,u]),m.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),LT())},[d,u]),m.useEffect(()=>{const D=()=>v({});return document.addEventListener(x_,D),()=>document.removeEventListener(x_,D)},[]),m.createElement(Qe.div,ue({},c,{ref:b,style:{pointerEvents:C?E?"auto":"none":void 0,...e.style},onFocusCapture:ke(e.onFocusCapture,T.onFocusCapture),onBlurCapture:ke(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:ke(e.onPointerDownCapture,$.onPointerDownCapture)}))});function xse(e,t=globalThis==null?void 0:globalThis.document){const n=Xn(e),r=m.useRef(!1),o=m.useRef(()=>{});return m.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let c=function(){q7(bse,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function wse(e,t=globalThis==null?void 0:globalThis.document){const n=Xn(e),r=m.useRef(!1);return m.useEffect(()=>{const o=i=>{i.target&&!r.current&&q7(vse,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function LT(){const e=new CustomEvent(x_);document.dispatchEvent(e)}function q7(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?fk(o,i):o.dispatchEvent(i)}let N1;const G7="HoverCard",[Y7,n5e]=hr(G7,[oa]),sE=oa(),[_se,lE]=Y7(G7),Sse=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:a=700,closeDelay:s=300}=e,l=sE(t),c=m.useRef(0),u=m.useRef(0),d=m.useRef(!1),h=m.useRef(!1),[p=!1,v]=Fr({prop:r,defaultProp:o,onChange:i}),b=m.useCallback(()=>{clearTimeout(u.current),c.current=window.setTimeout(()=>v(!0),a)},[a,v]),x=m.useCallback(()=>{clearTimeout(c.current),!d.current&&!h.current&&(u.current=window.setTimeout(()=>v(!1),s))},[s,v]),y=m.useCallback(()=>v(!1),[v]);return m.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(u.current)},[]),m.createElement(_se,{scope:t,open:p,onOpenChange:v,onOpen:b,onClose:x,onDismiss:y,hasSelectionRef:d,isPointerDownOnContentRef:h},m.createElement(mp,l,n))},Cse="HoverCardTrigger",Ese=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=lE(Cse,n),i=sE(n);return m.createElement(bp,ue({asChild:!0},i),m.createElement(Qe.a,ue({"data-state":o.open?"open":"closed"},r,{ref:t,onPointerEnter:ke(e.onPointerEnter,G0(o.onOpen)),onPointerLeave:ke(e.onPointerLeave,G0(o.onClose)),onFocus:ke(e.onFocus,o.onOpen),onBlur:ke(e.onBlur,o.onClose),onTouchStart:ke(e.onTouchStart,a=>a.preventDefault())})))}),Rse="HoverCardPortal",[r5e,Pse]=Y7(Rse,{forceMount:void 0}),w_="HoverCardContent",$se=m.forwardRef((e,t)=>{const n=Pse(w_,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,i=lE(w_,e.__scopeHoverCard);return m.createElement(pr,{present:r||i.open},m.createElement(Ose,ue({"data-state":i.open?"open":"closed"},o,{onPointerEnter:ke(e.onPointerEnter,G0(i.onOpen)),onPointerLeave:ke(e.onPointerLeave,G0(i.onClose)),ref:t})))}),Ose=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,...s}=e,l=lE(w_,n),c=sE(n),u=m.useRef(null),d=Rt(t,u),[h,p]=m.useState(!1);return m.useEffect(()=>{if(h){const v=document.body;return N1=v.style.userSelect||v.style.webkitUserSelect,v.style.userSelect="none",v.style.webkitUserSelect="none",()=>{v.style.userSelect=N1,v.style.webkitUserSelect=N1}}},[h]),m.useEffect(()=>{if(u.current){const v=()=>{p(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var b;((b=document.getSelection())===null||b===void 0?void 0:b.toString())!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",v),()=>{document.removeEventListener("pointerup",v),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),m.useEffect(()=>{u.current&&Tse(u.current).forEach(b=>b.setAttribute("tabindex","-1"))}),m.createElement(yp,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:a,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:ke(i,v=>{v.preventDefault()}),onDismiss:l.onDismiss},m.createElement(vp,ue({},c,s,{onPointerDown:ke(s.onPointerDown,v=>{v.currentTarget.contains(v.target)&&p(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:d,style:{...s.style,userSelect:h?"text":void 0,WebkitUserSelect:h?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})))});function G0(e){return t=>t.pointerType==="touch"?void 0:e()}function Tse(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}const Dse=Sse,Ase=Ese,K7=$se,Zb=Dse,ev=Ase,xp=j.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>R.jsx(K7,{ref:o,align:t,sideOffset:n,className:ye("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));xp.displayName=K7.displayName;function X7({card:e}){const{setCardInfo:t}=dr();return R.jsxs(Zb,{openDelay:0,children:[R.jsx(ev,{children:R.jsx(S6,{className:"size-4 text-muted-foreground/40"})}),R.jsx(xp,{align:"start",className:"w-[300px]",onMouseDown:n=>n.stopPropagation(),children:R.jsx(qi,{type:"textarea",text:e.info||"",onSave:n=>t(e.id,n),children:R.jsx("p",{className:"text-sm text-muted-foreground",children:e.info||"Double-click to add info"})})})]})}function Mse({card:e,renderFilterInfo:t}){var h,p,v,b,x,y,_,S,C,E,$,T,D,M,L,F,z,X,G,A,U,V,K,q;we(O=>O.themeStyle);const{data:n,isLoading:r}=Bb(e),o=(n==null?void 0:n.records)||[],i=we(O=>O.isDashboardEditing),a=(p=(h=e.preferences)==null?void 0:h.formatNumber)==null?void 0:p.colorRanges,{metricKeys:s}=tr(o||[]),l=(v=o==null?void 0:o[0])==null?void 0:v[s==null?void 0:s[0]],c=(b=o==null?void 0:o[0])==null?void 0:b[s==null?void 0:s[1]],u=(o==null?void 0:o.length)>0,d=c&&c-l!==0?(l-c)/c:null;return R.jsx("div",{className:"flex min-w-fit grow flex-col overflow-auto",children:R.jsxs("div",{className:"grow",children:[u?R.jsx("div",{className:"",children:R.jsxs("div",{className:ye("flex items-end gap-1.5",{"animate-pulse":r}),children:[R.jsx("p",{style:{color:xC(l,a)},className:"text-3xl font-semibold",children:Na({number:l,decimalPlaces:((y=(x=e.preferences)==null?void 0:x.formatNumber)==null?void 0:y.decimalPlaces)||0,useSuffix:!!((S=(_=e.preferences)==null?void 0:_.formatNumber)!=null&&S.suffix),customSuffix:((E=(C=e.preferences)==null?void 0:C.formatNumber)==null?void 0:E.suffix)||"",locale:((T=($=e.preferences)==null?void 0:$.formatNumber)==null?void 0:T.locale)||"",currency:((M=(D=e.preferences)==null?void 0:D.formatNumber)==null?void 0:M.currency)||""})}),d&&R.jsxs("div",{className:"flex items-end gap-1",children:[R.jsx(D7,{className:"",children:d}),c&&R.jsx("div",{className:"ml-0.5 mr-1 min-w-fit text-sm font-normal text-muted-foreground",children:`from ${Na({number:c,decimalPlaces:((F=(L=e.preferences)==null?void 0:L.formatNumber)==null?void 0:F.decimalPlaces)||0,useSuffix:!!((X=(z=e.preferences)==null?void 0:z.formatNumber)!=null&&X.suffix),customSuffix:((A=(G=e.preferences)==null?void 0:G.formatNumber)==null?void 0:A.suffix)||"",locale:((V=(U=e.preferences)==null?void 0:U.formatNumber)==null?void 0:V.locale)||"",currency:((q=(K=e.preferences)==null?void 0:K.formatNumber)==null?void 0:q.currency)||""})}`})]})]})}):R.jsx("div",{className:"flex h-9 items-center justify-center"}),R.jsxs("div",{className:"flex items-center gap-3",children:[R.jsxs(pd,{className:"flex items-center gap-2 text-base font-medium text-muted-foreground",children:[e.title,(i||e.info)&&R.jsx(X7,{card:e})]}),t==null?void 0:t()]})]})})}const kse=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(Ise);if(i){const a=i.props.children,s=o.map(l=>l===i?m.Children.count(a)>1?m.Children.only(null):m.isValidElement(a)?a.props.children:null:l);return m.createElement(__,ue({},r,{ref:t}),m.isValidElement(a)?m.cloneElement(a,void 0,s):null)}return m.createElement(__,ue({},r,{ref:t}),n)});kse.displayName="Slot";const __=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...Nse(r,n.props),ref:t?Ba(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});__.displayName="SlotClone";const Q7=({children:e})=>m.createElement(m.Fragment,null,e);function Ise(e){return m.isValidElement(e)&&e.type===Q7}function Nse(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const J7=m.forwardRef((e,t)=>m.createElement(Qe.span,ue({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),Lse=J7,[tv,o5e]=hr("Tooltip",[oa]),cE=oa(),Fse="TooltipProvider",jse=700,S_="tooltip.open",[zse,uE]=tv(Fse),Bse=e=>{const{__scopeTooltip:t,delayDuration:n=jse,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[a,s]=m.useState(!0),l=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),m.createElement(zse,{scope:t,isOpenDelayed:a,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),s(!1)},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>s(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(u=>{l.current=u},[]),disableHoverableContent:o},i)},dE="Tooltip",[Vse,nv]=tv(dE),Hse=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:a,delayDuration:s}=e,l=uE(dE,e.__scopeTooltip),c=cE(t),[u,d]=m.useState(null),h=yi(),p=m.useRef(0),v=a??l.disableHoverableContent,b=s??l.delayDuration,x=m.useRef(!1),[y=!1,_]=Fr({prop:r,defaultProp:o,onChange:T=>{T?(l.onOpen(),document.dispatchEvent(new CustomEvent(S_))):l.onClose(),i==null||i(T)}}),S=m.useMemo(()=>y?x.current?"delayed-open":"instant-open":"closed",[y]),C=m.useCallback(()=>{window.clearTimeout(p.current),x.current=!1,_(!0)},[_]),E=m.useCallback(()=>{window.clearTimeout(p.current),_(!1)},[_]),$=m.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{x.current=!0,_(!0)},b)},[b,_]);return m.useEffect(()=>()=>window.clearTimeout(p.current),[]),m.createElement(mp,c,m.createElement(Vse,{scope:t,contentId:h,open:y,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:m.useCallback(()=>{l.isOpenDelayed?$():C()},[l.isOpenDelayed,$,C]),onTriggerLeave:m.useCallback(()=>{v?E():window.clearTimeout(p.current)},[E,v]),onOpen:C,onClose:E,disableHoverableContent:v},n))},FT="TooltipTrigger",Z7=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=nv(FT,n),i=uE(FT,n),a=cE(n),s=m.useRef(null),l=Rt(t,s,o.onTriggerChange),c=m.useRef(!1),u=m.useRef(!1),d=m.useCallback(()=>c.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),m.createElement(bp,ue({asChild:!0},a),m.createElement(Qe.button,ue({"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute},r,{ref:l,onPointerMove:ke(e.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:ke(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:ke(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:ke(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:ke(e.onBlur,o.onClose),onClick:ke(e.onClick,o.onClose)})))}),Wse="TooltipPortal",[i5e,Use]=tv(Wse,{forceMount:void 0}),yh="TooltipContent",qse=m.forwardRef((e,t)=>{const n=Use(yh,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,a=nv(yh,e.__scopeTooltip);return m.createElement(pr,{present:r||a.open},a.disableHoverableContent?m.createElement(eI,ue({side:o},i,{ref:t})):m.createElement(Gse,ue({side:o},i,{ref:t})))}),Gse=m.forwardRef((e,t)=>{const n=nv(yh,e.__scopeTooltip),r=uE(yh,e.__scopeTooltip),o=m.useRef(null),i=Rt(t,o),[a,s]=m.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:d}=r,h=m.useCallback(()=>{s(null),d(!1)},[d]),p=m.useCallback((v,b)=>{const x=v.currentTarget,y={x:v.clientX,y:v.clientY},_=Kse(y,x.getBoundingClientRect()),S=Xse(y,_),C=Qse(b.getBoundingClientRect()),E=Zse([...S,...C]);s(E),d(!0)},[d]);return m.useEffect(()=>()=>h(),[h]),m.useEffect(()=>{if(l&&u){const v=x=>p(x,u),b=x=>p(x,l);return l.addEventListener("pointerleave",v),u.addEventListener("pointerleave",b),()=>{l.removeEventListener("pointerleave",v),u.removeEventListener("pointerleave",b)}}},[l,u,p,h]),m.useEffect(()=>{if(a){const v=b=>{const x=b.target,y={x:b.clientX,y:b.clientY},_=(l==null?void 0:l.contains(x))||(u==null?void 0:u.contains(x)),S=!Jse(y,a);_?h():S&&(h(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,u,a,c,h]),m.createElement(eI,ue({},e,{ref:i}))}),[Yse,a5e]=tv(dE,{isInside:!1}),eI=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:a,...s}=e,l=nv(yh,n),c=cE(n),{onClose:u}=l;return m.useEffect(()=>(document.addEventListener(S_,u),()=>document.removeEventListener(S_,u)),[u]),m.useEffect(()=>{if(l.trigger){const d=h=>{const p=h.target;p!=null&&p.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),m.createElement(yp,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:u},m.createElement(vp,ue({"data-state":l.stateAttribute},c,s,{ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),m.createElement(Q7,null,r),m.createElement(Yse,{scope:n,isInside:!0},m.createElement(Lse,{id:l.contentId,role:"tooltip"},o||r))))});function Kse(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Xse(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Qse(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Jse(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const s=t[i].x,l=t[i].y,c=t[a].x,u=t[a].y;l>r!=u>r&&n<(c-s)*(r-l)/(u-l)+s&&(o=!o)}return o}function Zse(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),ele(t)}function ele(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],a=t[t.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const tle=Bse,nle=Hse,rle=Z7,tI=qse,ole=tle,nI=nle,rI=rle,fE=j.forwardRef(({className:e,sideOffset:t=4,...n},r)=>R.jsx(tI,{ref:r,sideOffset:t,className:ye("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));fE.displayName=tI.displayName;/*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */const{entries:oI,setPrototypeOf:jT,isFrozen:ile,getPrototypeOf:ale,getOwnPropertyDescriptor:sle}=Object;let{freeze:zr,seal:Zo,create:iI}=Object,{apply:C_,construct:E_}=typeof Reflect<"u"&&Reflect;zr||(zr=function(t){return t});Zo||(Zo=function(t){return t});C_||(C_=function(t,n,r){return t.apply(n,r)});E_||(E_=function(t,n){return new t(...n)});const lm=To(Array.prototype.forEach),zT=To(Array.prototype.pop),rf=To(Array.prototype.push),n0=To(String.prototype.toLowerCase),L1=To(String.prototype.toString),BT=To(String.prototype.match),of=To(String.prototype.replace),lle=To(String.prototype.indexOf),cle=To(String.prototype.trim),ui=To(Object.prototype.hasOwnProperty),Tr=To(RegExp.prototype.test),af=ule(TypeError);function To(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return C_(e,t,r)}}function ule(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return E_(e,n)}}function Mt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:n0;jT&&jT(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const i=n(o);i!==o&&(ile(t)||(t[r]=i),o=i)}e[o]=!0}return e}function dle(e){for(let t=0;t<e.length;t++)ui(e,t)||(e[t]=null);return e}function wl(e){const t=iI(null);for(const[n,r]of oI(e))ui(e,n)&&(Array.isArray(r)?t[n]=dle(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=wl(r):t[n]=r);return t}function sf(e,t){for(;e!==null;){const r=sle(e,t);if(r){if(r.get)return To(r.get);if(typeof r.value=="function")return To(r.value)}e=ale(e)}function n(){return null}return n}const VT=zr(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),F1=zr(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),j1=zr(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),fle=zr(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),z1=zr(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),hle=zr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),HT=zr(["#text"]),WT=zr(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),B1=zr(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),UT=zr(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),cm=zr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ple=Zo(/\{\{[\w\W]*|[\w\W]*\}\}/gm),gle=Zo(/<%[\w\W]*|[\w\W]*%>/gm),mle=Zo(/\${[\w\W]*}/gm),ble=Zo(/^data-[\-\w.\u00B7-\uFFFF]/),vle=Zo(/^aria-[\-\w]+$/),aI=Zo(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),yle=Zo(/^(?:\w+script|data):/i),xle=Zo(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),sI=Zo(/^html$/i),wle=Zo(/^[a-z][.\w]*(-[.\w]+)+$/i);var qT=Object.freeze({__proto__:null,MUSTACHE_EXPR:ple,ERB_EXPR:gle,TMPLIT_EXPR:mle,DATA_ATTR:ble,ARIA_ATTR:vle,IS_ALLOWED_URI:aI,IS_SCRIPT_OR_DATA:yle,ATTR_WHITESPACE:xle,DOCTYPE_NAME:sI,CUSTOM_ELEMENT:wle});const lf={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},_le=function(){return typeof window>"u"?null:window},Sle=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(r=n.getAttribute(o));const i="dompurify"+(r?"#"+r:"");try{return t.createPolicy(i,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function lI(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_le();const t=Ae=>lI(Ae);if(t.version="3.1.6",t.removed=[],!e||!e.document||e.document.nodeType!==lf.document)return t.isSupported=!1,t;let{document:n}=e;const r=n,o=r.currentScript,{DocumentFragment:i,HTMLTemplateElement:a,Node:s,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:p}=e,v=l.prototype,b=sf(v,"cloneNode"),x=sf(v,"remove"),y=sf(v,"nextSibling"),_=sf(v,"childNodes"),S=sf(v,"parentNode");if(typeof a=="function"){const Ae=n.createElement("template");Ae.content&&Ae.content.ownerDocument&&(n=Ae.content.ownerDocument)}let C,E="";const{implementation:$,createNodeIterator:T,createDocumentFragment:D,getElementsByTagName:M}=n,{importNode:L}=r;let F={};t.isSupported=typeof oI=="function"&&typeof S=="function"&&$&&$.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:z,ERB_EXPR:X,TMPLIT_EXPR:G,DATA_ATTR:A,ARIA_ATTR:U,IS_SCRIPT_OR_DATA:V,ATTR_WHITESPACE:K,CUSTOM_ELEMENT:q}=qT;let{IS_ALLOWED_URI:O}=qT,H=null;const Y=Mt({},[...VT,...F1,...j1,...z1,...HT]);let I=null;const te=Mt({},[...WT,...B1,...UT,...cm]);let ce=Object.seal(iI(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),de=null,he=null,ie=!0,re=!0,le=!1,xe=!0,Z=!1,ve=!0,Ce=!1,Oe=!1,Te=!1,We=!1,Be=!1,Ie=!1,Ke=!0,dt=!1;const Bt="user-content-";let It=!0,Qt=!1,pe={},Re=null;const Le=Mt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ge=null;const Ze=Mt({},["audio","video","img","source","image","track"]);let Jt=null;const ln=Mt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),rn="http://www.w3.org/1998/Math/MathML",En="http://www.w3.org/2000/svg",vn="http://www.w3.org/1999/xhtml";let Wt=vn,dn=!1,$n=null;const rt=Mt({},[rn,En,vn],L1);let mt=null;const Nt=["application/xhtml+xml","text/html"],on="text/html";let _t=null,zn=null;const ni=n.createElement("form"),Ya=function(J){return J instanceof RegExp||J instanceof Function},ri=function(){let J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(zn&&zn===J)){if((!J||typeof J!="object")&&(J={}),J=wl(J),mt=Nt.indexOf(J.PARSER_MEDIA_TYPE)===-1?on:J.PARSER_MEDIA_TYPE,_t=mt==="application/xhtml+xml"?L1:n0,H=ui(J,"ALLOWED_TAGS")?Mt({},J.ALLOWED_TAGS,_t):Y,I=ui(J,"ALLOWED_ATTR")?Mt({},J.ALLOWED_ATTR,_t):te,$n=ui(J,"ALLOWED_NAMESPACES")?Mt({},J.ALLOWED_NAMESPACES,L1):rt,Jt=ui(J,"ADD_URI_SAFE_ATTR")?Mt(wl(ln),J.ADD_URI_SAFE_ATTR,_t):ln,Ge=ui(J,"ADD_DATA_URI_TAGS")?Mt(wl(Ze),J.ADD_DATA_URI_TAGS,_t):Ze,Re=ui(J,"FORBID_CONTENTS")?Mt({},J.FORBID_CONTENTS,_t):Le,de=ui(J,"FORBID_TAGS")?Mt({},J.FORBID_TAGS,_t):{},he=ui(J,"FORBID_ATTR")?Mt({},J.FORBID_ATTR,_t):{},pe=ui(J,"USE_PROFILES")?J.USE_PROFILES:!1,ie=J.ALLOW_ARIA_ATTR!==!1,re=J.ALLOW_DATA_ATTR!==!1,le=J.ALLOW_UNKNOWN_PROTOCOLS||!1,xe=J.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Z=J.SAFE_FOR_TEMPLATES||!1,ve=J.SAFE_FOR_XML!==!1,Ce=J.WHOLE_DOCUMENT||!1,We=J.RETURN_DOM||!1,Be=J.RETURN_DOM_FRAGMENT||!1,Ie=J.RETURN_TRUSTED_TYPE||!1,Te=J.FORCE_BODY||!1,Ke=J.SANITIZE_DOM!==!1,dt=J.SANITIZE_NAMED_PROPS||!1,It=J.KEEP_CONTENT!==!1,Qt=J.IN_PLACE||!1,O=J.ALLOWED_URI_REGEXP||aI,Wt=J.NAMESPACE||vn,ce=J.CUSTOM_ELEMENT_HANDLING||{},J.CUSTOM_ELEMENT_HANDLING&&Ya(J.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ce.tagNameCheck=J.CUSTOM_ELEMENT_HANDLING.tagNameCheck),J.CUSTOM_ELEMENT_HANDLING&&Ya(J.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ce.attributeNameCheck=J.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),J.CUSTOM_ELEMENT_HANDLING&&typeof J.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ce.allowCustomizedBuiltInElements=J.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Z&&(re=!1),Be&&(We=!0),pe&&(H=Mt({},HT),I=[],pe.html===!0&&(Mt(H,VT),Mt(I,WT)),pe.svg===!0&&(Mt(H,F1),Mt(I,B1),Mt(I,cm)),pe.svgFilters===!0&&(Mt(H,j1),Mt(I,B1),Mt(I,cm)),pe.mathMl===!0&&(Mt(H,z1),Mt(I,UT),Mt(I,cm))),J.ADD_TAGS&&(H===Y&&(H=wl(H)),Mt(H,J.ADD_TAGS,_t)),J.ADD_ATTR&&(I===te&&(I=wl(I)),Mt(I,J.ADD_ATTR,_t)),J.ADD_URI_SAFE_ATTR&&Mt(Jt,J.ADD_URI_SAFE_ATTR,_t),J.FORBID_CONTENTS&&(Re===Le&&(Re=wl(Re)),Mt(Re,J.FORBID_CONTENTS,_t)),It&&(H["#text"]=!0),Ce&&Mt(H,["html","head","body"]),H.table&&(Mt(H,["tbody"]),delete de.tbody),J.TRUSTED_TYPES_POLICY){if(typeof J.TRUSTED_TYPES_POLICY.createHTML!="function")throw af('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof J.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw af('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=J.TRUSTED_TYPES_POLICY,E=C.createHTML("")}else C===void 0&&(C=Sle(p,o)),C!==null&&typeof E=="string"&&(E=C.createHTML(""));zr&&zr(J),zn=J}},aa=Mt({},["mi","mo","mn","ms","mtext"]),Ci=Mt({},["foreignobject","annotation-xml"]),sa=Mt({},["title","style","font","a","script"]),Ka=Mt({},[...F1,...j1,...fle]),Ei=Mt({},[...z1,...hle]),la=function(J){let me=S(J);(!me||!me.tagName)&&(me={namespaceURI:Wt,tagName:"template"});const Me=n0(J.tagName),lt=n0(me.tagName);return $n[J.namespaceURI]?J.namespaceURI===En?me.namespaceURI===vn?Me==="svg":me.namespaceURI===rn?Me==="svg"&&(lt==="annotation-xml"||aa[lt]):!!Ka[Me]:J.namespaceURI===rn?me.namespaceURI===vn?Me==="math":me.namespaceURI===En?Me==="math"&&Ci[lt]:!!Ei[Me]:J.namespaceURI===vn?me.namespaceURI===En&&!Ci[lt]||me.namespaceURI===rn&&!aa[lt]?!1:!Ei[Me]&&(sa[Me]||!Ka[Me]):!!(mt==="application/xhtml+xml"&&$n[J.namespaceURI]):!1},Jn=function(J){rf(t.removed,{element:J});try{S(J).removeChild(J)}catch{x(J)}},Ri=function(J,me){try{rf(t.removed,{attribute:me.getAttributeNode(J),from:me})}catch{rf(t.removed,{attribute:null,from:me})}if(me.removeAttribute(J),J==="is"&&!I[J])if(We||Be)try{Jn(me)}catch{}else try{me.setAttribute(J,"")}catch{}},Xa=function(J){let me=null,Me=null;if(Te)J="<remove></remove>"+J;else{const pt=BT(J,/^[\r\n\t ]+/);Me=pt&&pt[0]}mt==="application/xhtml+xml"&&Wt===vn&&(J='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+J+"</body></html>");const lt=C?C.createHTML(J):J;if(Wt===vn)try{me=new h().parseFromString(lt,mt)}catch{}if(!me||!me.documentElement){me=$.createDocument(Wt,"template",null);try{me.documentElement.innerHTML=dn?E:lt}catch{}}const Rn=me.body||me.documentElement;return J&&Me&&Rn.insertBefore(n.createTextNode(Me),Rn.childNodes[0]||null),Wt===vn?M.call(me,Ce?"html":"body")[0]:Ce?me.documentElement:Rn},Qa=function(J){return T.call(J.ownerDocument||J,J,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},k=function(J){return J instanceof d&&(typeof J.nodeName!="string"||typeof J.textContent!="string"||typeof J.removeChild!="function"||!(J.attributes instanceof u)||typeof J.removeAttribute!="function"||typeof J.setAttribute!="function"||typeof J.namespaceURI!="string"||typeof J.insertBefore!="function"||typeof J.hasChildNodes!="function")},ne=function(J){return typeof s=="function"&&J instanceof s},fe=function(J,me,Me){F[J]&&lm(F[J],lt=>{lt.call(t,me,Me,zn)})},$e=function(J){let me=null;if(fe("beforeSanitizeElements",J,null),k(J))return Jn(J),!0;const Me=_t(J.nodeName);if(fe("uponSanitizeElement",J,{tagName:Me,allowedTags:H}),J.hasChildNodes()&&!ne(J.firstElementChild)&&Tr(/<[/\w]/g,J.innerHTML)&&Tr(/<[/\w]/g,J.textContent)||J.nodeType===lf.progressingInstruction||ve&&J.nodeType===lf.comment&&Tr(/<[/\w]/g,J.data))return Jn(J),!0;if(!H[Me]||de[Me]){if(!de[Me]&&qe(Me)&&(ce.tagNameCheck instanceof RegExp&&Tr(ce.tagNameCheck,Me)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(Me)))return!1;if(It&&!Re[Me]){const lt=S(J)||J.parentNode,Rn=_(J)||J.childNodes;if(Rn&&lt){const pt=Rn.length;for(let gr=pt-1;gr>=0;--gr){const ko=b(Rn[gr],!0);ko.__removalCount=(J.__removalCount||0)+1,lt.insertBefore(ko,y(J))}}}return Jn(J),!0}return J instanceof l&&!la(J)||(Me==="noscript"||Me==="noembed"||Me==="noframes")&&Tr(/<\/no(script|embed|frames)/i,J.innerHTML)?(Jn(J),!0):(Z&&J.nodeType===lf.text&&(me=J.textContent,lm([z,X,G],lt=>{me=of(me,lt," ")}),J.textContent!==me&&(rf(t.removed,{element:J.cloneNode()}),J.textContent=me)),fe("afterSanitizeElements",J,null),!1)},Ve=function(J,me,Me){if(Ke&&(me==="id"||me==="name")&&(Me in n||Me in ni))return!1;if(!(re&&!he[me]&&Tr(A,me))){if(!(ie&&Tr(U,me))){if(!I[me]||he[me]){if(!(qe(J)&&(ce.tagNameCheck instanceof RegExp&&Tr(ce.tagNameCheck,J)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(J))&&(ce.attributeNameCheck instanceof RegExp&&Tr(ce.attributeNameCheck,me)||ce.attributeNameCheck instanceof Function&&ce.attributeNameCheck(me))||me==="is"&&ce.allowCustomizedBuiltInElements&&(ce.tagNameCheck instanceof RegExp&&Tr(ce.tagNameCheck,Me)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(Me))))return!1}else if(!Jt[me]){if(!Tr(O,of(Me,K,""))){if(!((me==="src"||me==="xlink:href"||me==="href")&&J!=="script"&&lle(Me,"data:")===0&&Ge[J])){if(!(le&&!Tr(V,of(Me,K,"")))){if(Me)return!1}}}}}}return!0},qe=function(J){return J!=="annotation-xml"&&BT(J,q)},ze=function(J){fe("beforeSanitizeAttributes",J,null);const{attributes:me}=J;if(!me)return;const Me={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:I};let lt=me.length;for(;lt--;){const Rn=me[lt],{name:pt,namespaceURI:gr,value:ko}=Rn,el=_t(pt);let Zn=pt==="value"?ko:cle(ko);if(Me.attrName=el,Me.attrValue=Zn,Me.keepAttr=!0,Me.forceKeepAttr=void 0,fe("uponSanitizeAttribute",J,Me),Zn=Me.attrValue,ve&&Tr(/((--!?|])>)|<\/(style|title)/i,Zn)){Ri(pt,J);continue}if(Me.forceKeepAttr||(Ri(pt,J),!Me.keepAttr))continue;if(!xe&&Tr(/\/>/i,Zn)){Ri(pt,J);continue}Z&&lm([z,X,G],Td=>{Zn=of(Zn,Td," ")});const Od=_t(J.nodeName);if(Ve(Od,el,Zn)){if(dt&&(el==="id"||el==="name")&&(Ri(pt,J),Zn=Bt+Zn),C&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!gr)switch(p.getAttributeType(Od,el)){case"TrustedHTML":{Zn=C.createHTML(Zn);break}case"TrustedScriptURL":{Zn=C.createScriptURL(Zn);break}}try{gr?J.setAttributeNS(gr,pt,Zn):J.setAttribute(pt,Zn),k(J)?Jn(J):zT(t.removed)}catch{}}}fe("afterSanitizeAttributes",J,null)},Fe=function Ae(J){let me=null;const Me=Qa(J);for(fe("beforeSanitizeShadowDOM",J,null);me=Me.nextNode();)fe("uponSanitizeShadowNode",me,null),!$e(me)&&(me.content instanceof i&&Ae(me.content),ze(me));fe("afterSanitizeShadowDOM",J,null)};return t.sanitize=function(Ae){let J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},me=null,Me=null,lt=null,Rn=null;if(dn=!Ae,dn&&(Ae="<!-->"),typeof Ae!="string"&&!ne(Ae))if(typeof Ae.toString=="function"){if(Ae=Ae.toString(),typeof Ae!="string")throw af("dirty is not a string, aborting")}else throw af("toString is not a function");if(!t.isSupported)return Ae;if(Oe||ri(J),t.removed=[],typeof Ae=="string"&&(Qt=!1),Qt){if(Ae.nodeName){const ko=_t(Ae.nodeName);if(!H[ko]||de[ko])throw af("root node is forbidden and cannot be sanitized in-place")}}else if(Ae instanceof s)me=Xa("<!---->"),Me=me.ownerDocument.importNode(Ae,!0),Me.nodeType===lf.element&&Me.nodeName==="BODY"||Me.nodeName==="HTML"?me=Me:me.appendChild(Me);else{if(!We&&!Z&&!Ce&&Ae.indexOf("<")===-1)return C&&Ie?C.createHTML(Ae):Ae;if(me=Xa(Ae),!me)return We?null:Ie?E:""}me&&Te&&Jn(me.firstChild);const pt=Qa(Qt?Ae:me);for(;lt=pt.nextNode();)$e(lt)||(lt.content instanceof i&&Fe(lt.content),ze(lt));if(Qt)return Ae;if(We){if(Be)for(Rn=D.call(me.ownerDocument);me.firstChild;)Rn.appendChild(me.firstChild);else Rn=me;return(I.shadowroot||I.shadowrootmode)&&(Rn=L.call(r,Rn,!0)),Rn}let gr=Ce?me.outerHTML:me.innerHTML;return Ce&&H["!doctype"]&&me.ownerDocument&&me.ownerDocument.doctype&&me.ownerDocument.doctype.name&&Tr(sI,me.ownerDocument.doctype.name)&&(gr="<!DOCTYPE "+me.ownerDocument.doctype.name+`>
253
253
  `+gr),Z&&lm([z,X,G],ko=>{gr=of(gr,ko," ")}),C&&Ie?C.createHTML(gr):gr},t.setConfig=function(){let Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ri(Ae),Oe=!0},t.clearConfig=function(){zn=null,Oe=!1},t.isValidAttribute=function(Ae,J,me){zn||ri({});const Me=_t(Ae),lt=_t(J);return Ve(Me,lt,me)},t.addHook=function(Ae,J){typeof J=="function"&&(F[Ae]=F[Ae]||[],rf(F[Ae],J))},t.removeHook=function(Ae){if(F[Ae])return zT(F[Ae])},t.removeHooks=function(Ae){F[Ae]&&(F[Ae]=[])},t.removeAllHooks=function(){F={}},t}var GT=lI();function R_(e,[t,n]){return Math.min(n,Math.max(t,e))}function Cle(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const cI="ScrollArea",[uI,s5e]=hr(cI),[Ele,ei]=uI(cI),dI=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...a}=e,[s,l]=m.useState(null),[c,u]=m.useState(null),[d,h]=m.useState(null),[p,v]=m.useState(null),[b,x]=m.useState(null),[y,_]=m.useState(0),[S,C]=m.useState(0),[E,$]=m.useState(!1),[T,D]=m.useState(!1),M=Rt(t,F=>l(F)),L=vc(o);return m.createElement(Ele,{scope:n,type:r,dir:L,scrollHideDelay:i,scrollArea:s,viewport:c,onViewportChange:u,content:d,onContentChange:h,scrollbarX:p,onScrollbarXChange:v,scrollbarXEnabled:E,onScrollbarXEnabledChange:$,scrollbarY:b,onScrollbarYChange:x,scrollbarYEnabled:T,onScrollbarYEnabledChange:D,onCornerWidthChange:_,onCornerHeightChange:C},m.createElement(Qe.div,ue({dir:L},a,{ref:M,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":S+"px",...e.style}})))}),Rle="ScrollAreaViewport",Ple=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,i=ei(Rle,n),a=m.useRef(null),s=Rt(t,a,i.onViewportChange);return m.createElement(m.Fragment,null,m.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),m.createElement(Qe.div,ue({"data-radix-scroll-area-viewport":""},o,{ref:s,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style}}),m.createElement("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),Wa="ScrollAreaScrollbar",fI=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ei(Wa,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=o,s=e.orientation==="horizontal";return m.useEffect(()=>(s?i(!0):a(!0),()=>{s?i(!1):a(!1)}),[s,i,a]),o.type==="hover"?m.createElement($le,ue({},r,{ref:t,forceMount:n})):o.type==="scroll"?m.createElement(Ole,ue({},r,{ref:t,forceMount:n})):o.type==="auto"?m.createElement(hI,ue({},r,{ref:t,forceMount:n})):o.type==="always"?m.createElement(hE,ue({},r,{ref:t})):null}),$le=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ei(Wa,e.__scopeScrollArea),[i,a]=m.useState(!1);return m.useEffect(()=>{const s=o.scrollArea;let l=0;if(s){const c=()=>{window.clearTimeout(l),a(!0)},u=()=>{l=window.setTimeout(()=>a(!1),o.scrollHideDelay)};return s.addEventListener("pointerenter",c),s.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),s.removeEventListener("pointerenter",c),s.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),m.createElement(pr,{present:n||i},m.createElement(hI,ue({"data-state":i?"visible":"hidden"},r,{ref:t})))}),Ole=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ei(Wa,e.__scopeScrollArea),i=e.orientation==="horizontal",a=ov(()=>l("SCROLL_END"),100),[s,l]=Cle("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return m.useEffect(()=>{if(s==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[s,o.scrollHideDelay,l]),m.useEffect(()=>{const c=o.viewport,u=i?"scrollLeft":"scrollTop";if(c){let d=c[u];const h=()=>{const p=c[u];d!==p&&(l("SCROLL"),a()),d=p};return c.addEventListener("scroll",h),()=>c.removeEventListener("scroll",h)}},[o.viewport,i,l,a]),m.createElement(pr,{present:n||s!=="hidden"},m.createElement(hE,ue({"data-state":s==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:ke(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:ke(e.onPointerLeave,()=>l("POINTER_LEAVE"))})))}),hI=m.forwardRef((e,t)=>{const n=ei(Wa,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,a]=m.useState(!1),s=e.orientation==="horizontal",l=ov(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;a(s?c:u)}},10);return sd(n.viewport,l),sd(n.content,l),m.createElement(pr,{present:r||i},m.createElement(hE,ue({"data-state":i?"visible":"hidden"},o,{ref:t})))}),hE=m.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=ei(Wa,e.__scopeScrollArea),i=m.useRef(null),a=m.useRef(0),[s,l]=m.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=bI(s.viewport,s.content),u={...r,sizes:s,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:h=>i.current=h,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:h=>a.current=h};function d(h,p){return Lle(h,a.current,s,p)}return n==="horizontal"?m.createElement(Tle,ue({},u,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const h=o.viewport.scrollLeft,p=YT(h,s,o.dir);i.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollLeft=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollLeft=d(h,o.dir))}})):n==="vertical"?m.createElement(Dle,ue({},u,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const h=o.viewport.scrollTop,p=YT(h,s);i.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollTop=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollTop=d(h))}})):null}),Tle=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=ei(Wa,e.__scopeScrollArea),[a,s]=m.useState(),l=m.useRef(null),c=Rt(t,l,i.onScrollbarXChange);return m.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),m.createElement(gI,ue({"data-orientation":"horizontal"},o,{ref:c,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":rv(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(i.viewport){const h=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(h),yI(h,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&a&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Y0(a.paddingLeft),paddingEnd:Y0(a.paddingRight)}})}}))}),Dle=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=ei(Wa,e.__scopeScrollArea),[a,s]=m.useState(),l=m.useRef(null),c=Rt(t,l,i.onScrollbarYChange);return m.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),m.createElement(gI,ue({"data-orientation":"vertical"},o,{ref:c,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":rv(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(i.viewport){const h=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(h),yI(h,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&a&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Y0(a.paddingTop),paddingEnd:Y0(a.paddingBottom)}})}}))}),[Ale,pI]=uI(Wa),gI=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:a,onThumbPointerDown:s,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...h}=e,p=ei(Wa,n),[v,b]=m.useState(null),x=Rt(t,M=>b(M)),y=m.useRef(null),_=m.useRef(""),S=p.viewport,C=r.content-r.viewport,E=Xn(u),$=Xn(l),T=ov(d,10);function D(M){if(y.current){const L=M.clientX-y.current.left,F=M.clientY-y.current.top;c({x:L,y:F})}}return m.useEffect(()=>{const M=L=>{const F=L.target;(v==null?void 0:v.contains(F))&&E(L,C)};return document.addEventListener("wheel",M,{passive:!1}),()=>document.removeEventListener("wheel",M,{passive:!1})},[S,v,C,E]),m.useEffect($,[r,$]),sd(v,T),sd(p.content,T),m.createElement(Ale,{scope:n,scrollbar:v,hasThumb:o,onThumbChange:Xn(i),onThumbPointerUp:Xn(a),onThumbPositionChange:$,onThumbPointerDown:Xn(s)},m.createElement(Qe.div,ue({},h,{ref:x,style:{position:"absolute",...h.style},onPointerDown:ke(e.onPointerDown,M=>{M.button===0&&(M.target.setPointerCapture(M.pointerId),y.current=v.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),D(M))}),onPointerMove:ke(e.onPointerMove,D),onPointerUp:ke(e.onPointerUp,M=>{const L=M.target;L.hasPointerCapture(M.pointerId)&&L.releasePointerCapture(M.pointerId),document.body.style.webkitUserSelect=_.current,p.viewport&&(p.viewport.style.scrollBehavior=""),y.current=null})})))}),P_="ScrollAreaThumb",Mle=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=pI(P_,e.__scopeScrollArea);return m.createElement(pr,{present:n||o.hasThumb},m.createElement(kle,ue({ref:t},r)))}),kle=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=ei(P_,n),a=pI(P_,n),{onThumbPositionChange:s}=a,l=Rt(t,d=>a.onThumbChange(d)),c=m.useRef(),u=ov(()=>{c.current&&(c.current(),c.current=void 0)},100);return m.useEffect(()=>{const d=i.viewport;if(d){const h=()=>{if(u(),!c.current){const p=Fle(d,s);c.current=p,s()}};return s(),d.addEventListener("scroll",h),()=>d.removeEventListener("scroll",h)}},[i.viewport,u,s]),m.createElement(Qe.div,ue({"data-state":a.hasThumb?"visible":"hidden"},o,{ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:ke(e.onPointerDownCapture,d=>{const p=d.target.getBoundingClientRect(),v=d.clientX-p.left,b=d.clientY-p.top;a.onThumbPointerDown({x:v,y:b})}),onPointerUp:ke(e.onPointerUp,a.onThumbPointerUp)}))}),mI="ScrollAreaCorner",Ile=m.forwardRef((e,t)=>{const n=ei(mI,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?m.createElement(Nle,ue({},e,{ref:t})):null}),Nle=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=ei(mI,n),[i,a]=m.useState(0),[s,l]=m.useState(0),c=!!(i&&s);return sd(o.scrollbarX,()=>{var u;const d=((u=o.scrollbarX)===null||u===void 0?void 0:u.offsetHeight)||0;o.onCornerHeightChange(d),l(d)}),sd(o.scrollbarY,()=>{var u;const d=((u=o.scrollbarY)===null||u===void 0?void 0:u.offsetWidth)||0;o.onCornerWidthChange(d),a(d)}),c?m.createElement(Qe.div,ue({},r,{ref:t,style:{width:i,height:s,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function Y0(e){return e?parseInt(e,10):0}function bI(e,t){const n=e/t;return isNaN(n)?0:n}function rv(e){const t=bI(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Lle(e,t,n,r="ltr"){const o=rv(n),i=o/2,a=t||i,s=o-a,l=n.scrollbar.paddingStart+a,c=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r==="ltr"?[0,u]:[u*-1,0];return vI([l,c],d)(e)}function YT(e,t,n="ltr"){const r=rv(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,a=t.content-t.viewport,s=i-r,l=n==="ltr"?[0,a]:[a*-1,0],c=R_(e,l);return vI([0,a],[0,s])(c)}function vI(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function yI(e,t){return e>0&&e<t}const Fle=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},a=n.left!==i.left,s=n.top!==i.top;(a||s)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function ov(e,t){const n=Xn(e),r=m.useRef(0);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),m.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function sd(e,t){const n=Xn(t);Cr(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}const xI=dI,jle=Ple,zle=Ile,iv=j.forwardRef(({className:e,children:t,...n},r)=>R.jsxs(xI,{ref:r,className:ye("relative overflow-hidden",e),...n,children:[R.jsx(jle,{className:"h-full w-full rounded-[inherit]",children:t}),R.jsx(av,{}),R.jsx(zle,{})]}));iv.displayName=xI.displayName;const av=j.forwardRef(({className:e,orientation:t="vertical",...n},r)=>R.jsx(fI,{ref:r,orientation:t,className:ye("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:R.jsx(Mle,{className:"relative flex-1 rounded-full bg-border"})}));av.displayName=fI.displayName;function wI({card:e,isLoading:t,data:n}){var h,p;const r=n||[],{keys:o}=tr(r),i=we(v=>v.selectedSheetId),a=we(v=>v.isVisualEditing),s=(p=(h=e==null?void 0:e.preferences)==null?void 0:h.textVisualOptions)==null?void 0:p.isDynamicText,{setCardDescription:l}=dr(),{setCard:c}=Lb();function u(){var y;if(t)return R.jsx(yb,{className:"h-7 animate-pulse bg-muted"});const v=(y=r==null?void 0:r[0])==null?void 0:y[o[0]],b=GT.sanitize(v),x=R.jsx("div",{dangerouslySetInnerHTML:{__html:b}});return R.jsx("div",{className:"hover:cursor-text",onMouseDown:_=>_.stopPropagation(),children:x})}function d(){return R.jsx("div",{onMouseDown:v=>v.stopPropagation(),children:R.jsx(qi,{type:"textarea",className:"w-full",text:(e==null?void 0:e.description)||"Double click to add description",onSave:v=>{a===!1&&l(i,e.id,v),a===!0&&c({...e,description:v})},children:R.jsx("div",{dangerouslySetInnerHTML:{__html:GT.sanitize((e==null?void 0:e.description)||"")}})})})}return R.jsxs(iv,{className:"mx-3 my-6 overflow-y-auto break-words px-3",children:[!s&&d(),s===!0&&u()]})}function Ble(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Vle(...e){return t=>e.forEach(n=>Ble(n,t))}var sv=j.forwardRef((e,t)=>{const{children:n,...r}=e,o=j.Children.toArray(n),i=o.find(Hle);if(i){const a=i.props.children,s=o.map(l=>l===i?j.Children.count(a)>1?j.Children.only(null):j.isValidElement(a)?a.props.children:null:l);return R.jsx($_,{...r,ref:t,children:j.isValidElement(a)?j.cloneElement(a,void 0,s):null})}return R.jsx($_,{...r,ref:t,children:n})});sv.displayName="Slot";var $_=j.forwardRef((e,t)=>{const{children:n,...r}=e;if(j.isValidElement(n)){const o=Ule(n);return j.cloneElement(n,{...Wle(r,n.props),ref:t?Vle(t,o):o})}return j.Children.count(n)>1?j.Children.only(null):null});$_.displayName="SlotClone";var _I=({children:e})=>R.jsx(R.Fragment,{children:e});function Hle(e){return j.isValidElement(e)&&e.type===_I}function Wle(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Ule(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const KT=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,XT=a0,pE=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return XT(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,a=Object.keys(o).map(c=>{const u=n==null?void 0:n[c],d=i==null?void 0:i[c];if(u===null)return null;const h=KT(u)||KT(d);return o[c][h]}),s=n&&Object.entries(n).reduce((c,u)=>{let[d,h]=u;return h===void 0||(c[d]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:h,...p}=u;return Object.entries(p).every(v=>{let[b,x]=v;return Array.isArray(x)?x.includes({...i,...s}[b]):{...i,...s}[b]===x})?[...c,d,h]:c},[]);return XT(e,a,l,n==null?void 0:n.class,n==null?void 0:n.className)},xh=pE("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),no=j.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const a=r?sv:"button";return R.jsx(a,{className:ye(xh({variant:t,size:n,className:e})),ref:i,...o})});no.displayName="Button";const O_="horizontal",qle=["horizontal","vertical"],SI=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=O_,...o}=e,i=CI(r)?r:O_,s=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return m.createElement(Qe.div,ue({"data-orientation":i},s,o,{ref:t}))});SI.propTypes={orientation(e,t,n){const r=e[t],o=String(r);return r&&!CI(r)?new Error(Gle(o,n)):null}};function Gle(e,t){return`Invalid prop \`orientation\` of value \`${e}\` supplied to \`${t}\`, expected one of:
254
254
  - horizontal
255
255
  - vertical