From 387d00ba641c9c8c86206fc31de788d3b538dcd1 Mon Sep 17 00:00:00 2001 From: "Rost G." Date: Sat, 29 Jun 2024 00:18:08 +0300 Subject: [PATCH] change label dividends --- .../{index-BwHG_Qp3.js => index-DNaHZsM3.js} | 26 +++++++++---------- docs/index.html | 2 +- src/App.tsx | 12 +++++---- src/components/TonusdChart/TonusdChart.tsx | 9 ++++--- 4 files changed, 26 insertions(+), 23 deletions(-) rename docs/assets/{index-BwHG_Qp3.js => index-DNaHZsM3.js} (94%) diff --git a/docs/assets/index-BwHG_Qp3.js b/docs/assets/index-DNaHZsM3.js similarity index 94% rename from docs/assets/index-BwHG_Qp3.js rename to docs/assets/index-DNaHZsM3.js index 405be98..68c47a1 100644 --- a/docs/assets/index-BwHG_Qp3.js +++ b/docs/assets/index-DNaHZsM3.js @@ -6,7 +6,7 @@ var qx=Object.defineProperty;var Gx=(e,t,n)=>t in e?qx(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var $c=Symbol.for("react.element"),Qx=Symbol.for("react.portal"),Jx=Symbol.for("react.fragment"),Xx=Symbol.for("react.strict_mode"),e8=Symbol.for("react.profiler"),t8=Symbol.for("react.provider"),n8=Symbol.for("react.context"),r8=Symbol.for("react.forward_ref"),i8=Symbol.for("react.suspense"),o8=Symbol.for("react.memo"),s8=Symbol.for("react.lazy"),vm=Symbol.iterator;function a8(e){return e===null||typeof e!="object"?null:(e=vm&&e[vm]||e["@@iterator"],typeof e=="function"?e:null)}var aw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},lw=Object.assign,cw={};function Ha(e,t,n){this.props=e,this.context=t,this.refs=cw,this.updater=n||aw}Ha.prototype.isReactComponent={};Ha.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ha.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function uw(){}uw.prototype=Ha.prototype;function ap(e,t,n){this.props=e,this.context=t,this.refs=cw,this.updater=n||aw}var lp=ap.prototype=new uw;lp.constructor=ap;lw(lp,Ha.prototype);lp.isPureReactComponent=!0;var ym=Array.isArray,fw=Object.prototype.hasOwnProperty,cp={current:null},dw={key:!0,ref:!0,__self:!0,__source:!0};function hw(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)fw.call(t,r)&&!dw.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1t in e?qx(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var d8=nn,h8=Symbol.for("react.element"),p8=Symbol.for("react.fragment"),g8=Object.prototype.hasOwnProperty,m8=d8.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,v8={key:!0,ref:!0,__self:!0,__source:!0};function gw(e,t,n){var r,i={},o=null,s=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)g8.call(t,r)&&!v8.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:h8,type:e,key:o,ref:s,props:i,_owner:m8.current}}Td.Fragment=p8;Td.jsx=gw;Td.jsxs=gw;ow.exports=Td;var hn=ow.exports,A1={},mw={exports:{}},Rr={},vw={exports:{}},yw={};/** + */var d8=rn,h8=Symbol.for("react.element"),p8=Symbol.for("react.fragment"),g8=Object.prototype.hasOwnProperty,m8=d8.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,v8={key:!0,ref:!0,__self:!0,__source:!0};function gw(e,t,n){var r,i={},o=null,s=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)g8.call(t,r)&&!v8.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:h8,type:e,key:o,ref:s,props:i,_owner:m8.current}}Td.Fragment=p8;Td.jsx=gw;Td.jsxs=gw;ow.exports=Td;var tn=ow.exports,A1={},mw={exports:{}},Rr={},vw={exports:{}},yw={};/** * @license React * scheduler.production.min.js * @@ -30,14 +30,14 @@ var qx=Object.defineProperty;var Gx=(e,t,n)=>t in e?qx(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var w8=nn,Lr=y8;function ae(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),L1=Object.prototype.hasOwnProperty,x8=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,xm={},bm={};function b8(e){return L1.call(bm,e)?!0:L1.call(xm,e)?!1:x8.test(e)?bm[e]=!0:(xm[e]=!0,!1)}function _8(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function C8(e,t,n,r){if(t===null||typeof t>"u"||_8(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function fr(e,t,n,r,i,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var Vn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Vn[e]=new fr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Vn[t]=new fr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Vn[e]=new fr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Vn[e]=new fr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Vn[e]=new fr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Vn[e]=new fr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Vn[e]=new fr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Vn[e]=new fr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Vn[e]=new fr(e,5,!1,e.toLowerCase(),null,!1,!1)});var fp=/[\-:]([a-z])/g;function dp(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(fp,dp);Vn[t]=new fr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(fp,dp);Vn[t]=new fr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(fp,dp);Vn[t]=new fr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Vn[e]=new fr(e,1,!1,e.toLowerCase(),null,!1,!1)});Vn.xlinkHref=new fr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Vn[e]=new fr(e,1,!1,e.toLowerCase(),null,!0,!0)});function hp(e,t,n,r){var i=Vn.hasOwnProperty(t)?Vn[t]:null;(i!==null?i.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),L1=Object.prototype.hasOwnProperty,x8=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,xm={},bm={};function b8(e){return L1.call(bm,e)?!0:L1.call(xm,e)?!1:x8.test(e)?bm[e]=!0:(xm[e]=!0,!1)}function _8(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function C8(e,t,n,r){if(t===null||typeof t>"u"||_8(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function fr(e,t,n,r,i,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var Vn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Vn[e]=new fr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Vn[t]=new fr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Vn[e]=new fr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Vn[e]=new fr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Vn[e]=new fr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Vn[e]=new fr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Vn[e]=new fr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Vn[e]=new fr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Vn[e]=new fr(e,5,!1,e.toLowerCase(),null,!1,!1)});var fp=/[\-:]([a-z])/g;function dp(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(fp,dp);Vn[t]=new fr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(fp,dp);Vn[t]=new fr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(fp,dp);Vn[t]=new fr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Vn[e]=new fr(e,1,!1,e.toLowerCase(),null,!1,!1)});Vn.xlinkHref=new fr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Vn[e]=new fr(e,1,!1,e.toLowerCase(),null,!0,!0)});function hp(e,t,n,r){var i=Vn.hasOwnProperty(t)?Vn[t]:null;(i!==null?i.type!==0:r||!(2a||i[s]!==o[a]){var l=` -`+i[s].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Ph=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?yl(e):""}function S8(e){switch(e.tag){case 5:return yl(e.type);case 16:return yl("Lazy");case 13:return yl("Suspense");case 19:return yl("SuspenseList");case 0:case 2:case 15:return e=Ah(e.type,!1),e;case 11:return e=Ah(e.type.render,!1),e;case 1:return e=Ah(e.type,!0),e;default:return""}}function I1(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ta:return"Fragment";case ea:return"Portal";case O1:return"Profiler";case pp:return"StrictMode";case R1:return"Suspense";case D1:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case bw:return(e.displayName||"Context")+".Consumer";case xw:return(e._context.displayName||"Context")+".Provider";case gp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case mp:return t=e.displayName||null,t!==null?t:I1(e.type)||"Memo";case xo:t=e._payload,e=e._init;try{return I1(e(t))}catch{}}return null}function k8(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return I1(t);case 8:return t===pp?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Yo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Cw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function E8(e){var t=Cw(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function uu(e){e._valueTracker||(e._valueTracker=E8(e))}function Sw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Cw(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function bf(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function N1(e,t){var n=t.checked;return sn({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Cm(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Yo(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function kw(e,t){t=t.checked,t!=null&&hp(e,"checked",t,!1)}function W1(e,t){kw(e,t);var n=Yo(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?$1(e,t.type,n):t.hasOwnProperty("defaultValue")&&$1(e,t.type,Yo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Sm(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function $1(e,t,n){(t!=="number"||bf(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var wl=Array.isArray;function ya(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=fu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function nc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ll={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},M8=["Webkit","ms","Moz","O"];Object.keys(Ll).forEach(function(e){M8.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ll[t]=Ll[e]})});function Pw(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ll.hasOwnProperty(e)&&Ll[e]?(""+t).trim():t+"px"}function Aw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Pw(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var T8=sn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function B1(e,t){if(t){if(T8[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ae(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ae(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ae(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ae(62))}}function j1(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var H1=null;function vp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var z1=null,wa=null,xa=null;function Mm(e){if(e=Bc(e)){if(typeof z1!="function")throw Error(ae(280));var t=e.stateNode;t&&(t=Dd(t),z1(e.stateNode,e.type,t))}}function Lw(e){wa?xa?xa.push(e):xa=[e]:wa=e}function Ow(){if(wa){var e=wa,t=xa;if(xa=wa=null,Mm(e),t)for(e=0;e>>=0,e===0?32:31-(U8(e)/F8|0)|0}var du=64,hu=4194304;function xl(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function kf(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=xl(a):(o&=s,o!==0&&(r=xl(o)))}else s=n&~i,s!==0?r=xl(s):o!==0&&(r=xl(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Uc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ii(t),e[t]=n}function z8(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Rl),Nm=" ",Wm=!1;function Jw(e,t){switch(e){case"keyup":return yb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xw(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var na=!1;function xb(e,t){switch(e){case"compositionend":return Xw(t);case"keypress":return t.which!==32?null:(Wm=!0,Nm);case"textInput":return e=t.data,e===Nm&&Wm?null:e;default:return null}}function bb(e,t){if(na)return e==="compositionend"||!kp&&Jw(e,t)?(e=Zw(),Xu=_p=Eo=null,na=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Bm(n)}}function r5(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?r5(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function i5(){for(var e=window,t=bf();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=bf(e.document)}return t}function Ep(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Ab(e){var t=i5(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&r5(n.ownerDocument.documentElement,n)){if(r!==null&&Ep(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=jm(n,o);var s=jm(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,ra=null,Z1=null,Il=null,Q1=!1;function Hm(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Q1||ra==null||ra!==bf(r)||(r=ra,"selectionStart"in r&&Ep(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Il&&lc(Il,r)||(Il=r,r=Tf(Z1,"onSelect"),0sa||(e.current=r0[sa],r0[sa]=null,sa--)}function Ht(e,t){sa++,r0[sa]=e.current,e.current=t}var Ko={},nr=ts(Ko),wr=ts(!1),Ls=Ko;function Pa(e,t){var n=e.type.contextTypes;if(!n)return Ko;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function xr(e){return e=e.childContextTypes,e!=null}function Af(){Yt(wr),Yt(nr)}function Zm(e,t,n){if(nr.current!==Ko)throw Error(ae(168));Ht(nr,t),Ht(wr,n)}function h5(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(ae(108,k8(e)||"Unknown",i));return sn({},n,r)}function Lf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ko,Ls=nr.current,Ht(nr,e),Ht(wr,wr.current),!0}function Qm(e,t,n){var r=e.stateNode;if(!r)throw Error(ae(169));n?(e=h5(e,t,Ls),r.__reactInternalMemoizedMergedChildContext=e,Yt(wr),Yt(nr),Ht(nr,e)):Yt(wr),Ht(wr,n)}var Bi=null,Id=!1,zh=!1;function p5(e){Bi===null?Bi=[e]:Bi.push(e)}function jb(e){Id=!0,p5(e)}function ns(){if(!zh&&Bi!==null){zh=!0;var e=0,t=$t;try{var n=Bi;for($t=1;e>=s,i-=s,Vi=1<<32-ii(t)+i|n<P?(L=T,T=null):L=T.sibling;var W=h(C,T,w[P],M);if(W===null){T===null&&(T=L);break}e&&T&&W.alternate===null&&t(C,T),v=o(W,v,P),O===null?E=W:O.sibling=W,O=W,T=L}if(P===w.length)return n(C,T),Qt&&fs(C,P),E;if(T===null){for(;PP?(L=T,T=null):L=T.sibling;var I=h(C,T,W.value,M);if(I===null){T===null&&(T=L);break}e&&T&&I.alternate===null&&t(C,T),v=o(I,v,P),O===null?E=I:O.sibling=I,O=I,T=L}if(W.done)return n(C,T),Qt&&fs(C,P),E;if(T===null){for(;!W.done;P++,W=w.next())W=d(C,W.value,M),W!==null&&(v=o(W,v,P),O===null?E=W:O.sibling=W,O=W);return Qt&&fs(C,P),E}for(T=r(C,T);!W.done;P++,W=w.next())W=g(T,C,P,W.value,M),W!==null&&(e&&W.alternate!==null&&T.delete(W.key===null?P:W.key),v=o(W,v,P),O===null?E=W:O.sibling=W,O=W);return e&&T.forEach(function(R){return t(C,R)}),Qt&&fs(C,P),E}function k(C,v,w,M){if(typeof w=="object"&&w!==null&&w.type===ta&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case cu:e:{for(var E=w.key,O=v;O!==null;){if(O.key===E){if(E=w.type,E===ta){if(O.tag===7){n(C,O.sibling),v=i(O,w.props.children),v.return=C,C=v;break e}}else if(O.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===xo&&e2(E)===O.type){n(C,O.sibling),v=i(O,w.props),v.ref=sl(C,O,w),v.return=C,C=v;break e}n(C,O);break}else t(C,O);O=O.sibling}w.type===ta?(v=Cs(w.props.children,C.mode,M,w.key),v.return=C,C=v):(M=lf(w.type,w.key,w.props,null,C.mode,M),M.ref=sl(C,v,w),M.return=C,C=M)}return s(C);case ea:e:{for(O=w.key;v!==null;){if(v.key===O)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){n(C,v.sibling),v=i(v,w.children||[]),v.return=C,C=v;break e}else{n(C,v);break}else t(C,v);v=v.sibling}v=Jh(w,C.mode,M),v.return=C,C=v}return s(C);case xo:return O=w._init,k(C,v,O(w._payload),M)}if(wl(w))return m(C,v,w,M);if(tl(w))return y(C,v,w,M);xu(C,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(n(C,v.sibling),v=i(v,w),v.return=C,C=v):(n(C,v),v=Qh(w,C.mode,M),v.return=C,C=v),s(C)):n(C,v)}return k}var La=y5(!0),w5=y5(!1),Df=ts(null),If=null,ca=null,Ap=null;function Lp(){Ap=ca=If=null}function Op(e){var t=Df.current;Yt(Df),e._currentValue=t}function s0(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function _a(e,t){If=e,Ap=ca=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(yr=!0),e.firstContext=null)}function Yr(e){var t=e._currentValue;if(Ap!==e)if(e={context:e,memoizedValue:t,next:null},ca===null){if(If===null)throw Error(ae(308));ca=e,If.dependencies={lanes:0,firstContext:e}}else ca=ca.next=e;return t}var vs=null;function Rp(e){vs===null?vs=[e]:vs.push(e)}function x5(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Rp(t)):(n.next=i.next,i.next=n),t.interleaved=n,io(e,r)}function io(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var bo=!1;function Dp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function b5(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Qi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Uo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Tt&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,io(e,n)}return i=r.interleaved,i===null?(t.next=t,Rp(r)):(t.next=i.next,i.next=t),r.interleaved=t,io(e,n)}function tf(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,wp(e,n)}}function t2(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Nf(e,t,n,r){var i=e.updateQueue;bo=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?o=c:s.next=c,s=l;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==s&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(o!==null){var d=i.baseState;s=0,u=c=l=null,a=o;do{var h=a.lane,g=a.eventTime;if((r&h)===h){u!==null&&(u=u.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,y=a;switch(h=t,g=n,y.tag){case 1:if(m=y.payload,typeof m=="function"){d=m.call(g,d,h);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=y.payload,h=typeof m=="function"?m.call(g,d,h):m,h==null)break e;d=sn({},d,h);break e;case 2:bo=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[a]:h.push(a))}else g={eventTime:g,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=g,l=d):u=u.next=g,s|=h;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;h=a,a=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(u===null&&(l=d),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);Ds|=s,e.lanes=s,e.memoizedState=d}}function n2(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Yh.transition;Yh.transition={};try{e(!1),t()}finally{$t=n,Yh.transition=r}}function $5(){return Kr().memoizedState}function Yb(e,t,n){var r=Bo(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},U5(e))F5(t,n);else if(n=x5(e,t,n,r),n!==null){var i=ar();oi(n,e,r,i),B5(n,t,r)}}function Kb(e,t,n){var r=Bo(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(U5(e))F5(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,li(a,s)){var l=t.interleaved;l===null?(i.next=i,Rp(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=x5(e,t,i,r),n!==null&&(i=ar(),oi(n,e,r,i),B5(n,t,r))}}function U5(e){var t=e.alternate;return e===on||t!==null&&t===on}function F5(e,t){Nl=$f=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function B5(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,wp(e,n)}}var Uf={readContext:Yr,useCallback:Gn,useContext:Gn,useEffect:Gn,useImperativeHandle:Gn,useInsertionEffect:Gn,useLayoutEffect:Gn,useMemo:Gn,useReducer:Gn,useRef:Gn,useState:Gn,useDebugValue:Gn,useDeferredValue:Gn,useTransition:Gn,useMutableSource:Gn,useSyncExternalStore:Gn,useId:Gn,unstable_isNewReconciler:!1},qb={readContext:Yr,useCallback:function(e,t){return gi().memoizedState=[e,t===void 0?null:t],e},useContext:Yr,useEffect:i2,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,rf(4194308,4,R5.bind(null,t,e),n)},useLayoutEffect:function(e,t){return rf(4194308,4,e,t)},useInsertionEffect:function(e,t){return rf(4,2,e,t)},useMemo:function(e,t){var n=gi();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=gi();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Yb.bind(null,on,e),[r.memoizedState,e]},useRef:function(e){var t=gi();return e={current:e},t.memoizedState=e},useState:r2,useDebugValue:jp,useDeferredValue:function(e){return gi().memoizedState=e},useTransition:function(){var e=r2(!1),t=e[0];return e=Vb.bind(null,e[1]),gi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=on,i=gi();if(Qt){if(n===void 0)throw Error(ae(407));n=n()}else{if(n=t(),Wn===null)throw Error(ae(349));Rs&30||k5(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,i2(M5.bind(null,r,o,e),[e]),r.flags|=2048,mc(9,E5.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=gi(),t=Wn.identifierPrefix;if(Qt){var n=Yi,r=Vi;n=(r&~(1<<32-ii(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=pc++,0")&&(l=l.replace("",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Ph=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?yl(e):""}function S8(e){switch(e.tag){case 5:return yl(e.type);case 16:return yl("Lazy");case 13:return yl("Suspense");case 19:return yl("SuspenseList");case 0:case 2:case 15:return e=Ah(e.type,!1),e;case 11:return e=Ah(e.type.render,!1),e;case 1:return e=Ah(e.type,!0),e;default:return""}}function I1(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ta:return"Fragment";case ea:return"Portal";case O1:return"Profiler";case pp:return"StrictMode";case R1:return"Suspense";case D1:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case bw:return(e.displayName||"Context")+".Consumer";case xw:return(e._context.displayName||"Context")+".Provider";case gp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case mp:return t=e.displayName||null,t!==null?t:I1(e.type)||"Memo";case xo:t=e._payload,e=e._init;try{return I1(e(t))}catch{}}return null}function k8(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return I1(t);case 8:return t===pp?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Yo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Cw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function E8(e){var t=Cw(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function uu(e){e._valueTracker||(e._valueTracker=E8(e))}function Sw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Cw(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function bf(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function N1(e,t){var n=t.checked;return an({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Cm(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Yo(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function kw(e,t){t=t.checked,t!=null&&hp(e,"checked",t,!1)}function W1(e,t){kw(e,t);var n=Yo(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?$1(e,t.type,n):t.hasOwnProperty("defaultValue")&&$1(e,t.type,Yo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Sm(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function $1(e,t,n){(t!=="number"||bf(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var wl=Array.isArray;function ya(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=fu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function nc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ll={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},M8=["Webkit","ms","Moz","O"];Object.keys(Ll).forEach(function(e){M8.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ll[t]=Ll[e]})});function Pw(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ll.hasOwnProperty(e)&&Ll[e]?(""+t).trim():t+"px"}function Aw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Pw(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var T8=an({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function B1(e,t){if(t){if(T8[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ae(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ae(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ae(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ae(62))}}function j1(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var H1=null;function vp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var z1=null,wa=null,xa=null;function Mm(e){if(e=Bc(e)){if(typeof z1!="function")throw Error(ae(280));var t=e.stateNode;t&&(t=Dd(t),z1(e.stateNode,e.type,t))}}function Lw(e){wa?xa?xa.push(e):xa=[e]:wa=e}function Ow(){if(wa){var e=wa,t=xa;if(xa=wa=null,Mm(e),t)for(e=0;e>>=0,e===0?32:31-(U8(e)/F8|0)|0}var du=64,hu=4194304;function xl(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function kf(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=xl(a):(o&=s,o!==0&&(r=xl(o)))}else s=n&~i,s!==0?r=xl(s):o!==0&&(r=xl(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Uc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ii(t),e[t]=n}function z8(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Rl),Nm=" ",Wm=!1;function Jw(e,t){switch(e){case"keyup":return yb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xw(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var na=!1;function xb(e,t){switch(e){case"compositionend":return Xw(t);case"keypress":return t.which!==32?null:(Wm=!0,Nm);case"textInput":return e=t.data,e===Nm&&Wm?null:e;default:return null}}function bb(e,t){if(na)return e==="compositionend"||!kp&&Jw(e,t)?(e=Zw(),Xu=_p=Eo=null,na=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Bm(n)}}function r5(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?r5(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function i5(){for(var e=window,t=bf();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=bf(e.document)}return t}function Ep(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Ab(e){var t=i5(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&r5(n.ownerDocument.documentElement,n)){if(r!==null&&Ep(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=jm(n,o);var s=jm(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,ra=null,Z1=null,Il=null,Q1=!1;function Hm(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Q1||ra==null||ra!==bf(r)||(r=ra,"selectionStart"in r&&Ep(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Il&&lc(Il,r)||(Il=r,r=Tf(Z1,"onSelect"),0sa||(e.current=r0[sa],r0[sa]=null,sa--)}function Ht(e,t){sa++,r0[sa]=e.current,e.current=t}var Ko={},nr=ts(Ko),wr=ts(!1),Ls=Ko;function Pa(e,t){var n=e.type.contextTypes;if(!n)return Ko;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function xr(e){return e=e.childContextTypes,e!=null}function Af(){Yt(wr),Yt(nr)}function Zm(e,t,n){if(nr.current!==Ko)throw Error(ae(168));Ht(nr,t),Ht(wr,n)}function h5(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(ae(108,k8(e)||"Unknown",i));return an({},n,r)}function Lf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ko,Ls=nr.current,Ht(nr,e),Ht(wr,wr.current),!0}function Qm(e,t,n){var r=e.stateNode;if(!r)throw Error(ae(169));n?(e=h5(e,t,Ls),r.__reactInternalMemoizedMergedChildContext=e,Yt(wr),Yt(nr),Ht(nr,e)):Yt(wr),Ht(wr,n)}var Bi=null,Id=!1,zh=!1;function p5(e){Bi===null?Bi=[e]:Bi.push(e)}function jb(e){Id=!0,p5(e)}function ns(){if(!zh&&Bi!==null){zh=!0;var e=0,t=$t;try{var n=Bi;for($t=1;e>=s,i-=s,Vi=1<<32-ii(t)+i|n<P?(L=T,T=null):L=T.sibling;var W=h(C,T,w[P],M);if(W===null){T===null&&(T=L);break}e&&T&&W.alternate===null&&t(C,T),v=o(W,v,P),O===null?E=W:O.sibling=W,O=W,T=L}if(P===w.length)return n(C,T),Qt&&fs(C,P),E;if(T===null){for(;PP?(L=T,T=null):L=T.sibling;var I=h(C,T,W.value,M);if(I===null){T===null&&(T=L);break}e&&T&&I.alternate===null&&t(C,T),v=o(I,v,P),O===null?E=I:O.sibling=I,O=I,T=L}if(W.done)return n(C,T),Qt&&fs(C,P),E;if(T===null){for(;!W.done;P++,W=w.next())W=d(C,W.value,M),W!==null&&(v=o(W,v,P),O===null?E=W:O.sibling=W,O=W);return Qt&&fs(C,P),E}for(T=r(C,T);!W.done;P++,W=w.next())W=g(T,C,P,W.value,M),W!==null&&(e&&W.alternate!==null&&T.delete(W.key===null?P:W.key),v=o(W,v,P),O===null?E=W:O.sibling=W,O=W);return e&&T.forEach(function(R){return t(C,R)}),Qt&&fs(C,P),E}function k(C,v,w,M){if(typeof w=="object"&&w!==null&&w.type===ta&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case cu:e:{for(var E=w.key,O=v;O!==null;){if(O.key===E){if(E=w.type,E===ta){if(O.tag===7){n(C,O.sibling),v=i(O,w.props.children),v.return=C,C=v;break e}}else if(O.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===xo&&e2(E)===O.type){n(C,O.sibling),v=i(O,w.props),v.ref=sl(C,O,w),v.return=C,C=v;break e}n(C,O);break}else t(C,O);O=O.sibling}w.type===ta?(v=Cs(w.props.children,C.mode,M,w.key),v.return=C,C=v):(M=lf(w.type,w.key,w.props,null,C.mode,M),M.ref=sl(C,v,w),M.return=C,C=M)}return s(C);case ea:e:{for(O=w.key;v!==null;){if(v.key===O)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){n(C,v.sibling),v=i(v,w.children||[]),v.return=C,C=v;break e}else{n(C,v);break}else t(C,v);v=v.sibling}v=Jh(w,C.mode,M),v.return=C,C=v}return s(C);case xo:return O=w._init,k(C,v,O(w._payload),M)}if(wl(w))return m(C,v,w,M);if(tl(w))return y(C,v,w,M);xu(C,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(n(C,v.sibling),v=i(v,w),v.return=C,C=v):(n(C,v),v=Qh(w,C.mode,M),v.return=C,C=v),s(C)):n(C,v)}return k}var La=y5(!0),w5=y5(!1),Df=ts(null),If=null,ca=null,Ap=null;function Lp(){Ap=ca=If=null}function Op(e){var t=Df.current;Yt(Df),e._currentValue=t}function s0(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function _a(e,t){If=e,Ap=ca=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(yr=!0),e.firstContext=null)}function Yr(e){var t=e._currentValue;if(Ap!==e)if(e={context:e,memoizedValue:t,next:null},ca===null){if(If===null)throw Error(ae(308));ca=e,If.dependencies={lanes:0,firstContext:e}}else ca=ca.next=e;return t}var vs=null;function Rp(e){vs===null?vs=[e]:vs.push(e)}function x5(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Rp(t)):(n.next=i.next,i.next=n),t.interleaved=n,io(e,r)}function io(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var bo=!1;function Dp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function b5(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Qi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Uo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Tt&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,io(e,n)}return i=r.interleaved,i===null?(t.next=t,Rp(r)):(t.next=i.next,i.next=t),r.interleaved=t,io(e,n)}function tf(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,wp(e,n)}}function t2(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Nf(e,t,n,r){var i=e.updateQueue;bo=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?o=c:s.next=c,s=l;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==s&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(o!==null){var d=i.baseState;s=0,u=c=l=null,a=o;do{var h=a.lane,g=a.eventTime;if((r&h)===h){u!==null&&(u=u.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,y=a;switch(h=t,g=n,y.tag){case 1:if(m=y.payload,typeof m=="function"){d=m.call(g,d,h);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=y.payload,h=typeof m=="function"?m.call(g,d,h):m,h==null)break e;d=an({},d,h);break e;case 2:bo=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[a]:h.push(a))}else g={eventTime:g,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=g,l=d):u=u.next=g,s|=h;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;h=a,a=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(u===null&&(l=d),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);Ds|=s,e.lanes=s,e.memoizedState=d}}function n2(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Yh.transition;Yh.transition={};try{e(!1),t()}finally{$t=n,Yh.transition=r}}function $5(){return Kr().memoizedState}function Yb(e,t,n){var r=Bo(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},U5(e))F5(t,n);else if(n=x5(e,t,n,r),n!==null){var i=ar();oi(n,e,r,i),B5(n,t,r)}}function Kb(e,t,n){var r=Bo(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(U5(e))F5(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,li(a,s)){var l=t.interleaved;l===null?(i.next=i,Rp(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=x5(e,t,i,r),n!==null&&(i=ar(),oi(n,e,r,i),B5(n,t,r))}}function U5(e){var t=e.alternate;return e===sn||t!==null&&t===sn}function F5(e,t){Nl=$f=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function B5(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,wp(e,n)}}var Uf={readContext:Yr,useCallback:Gn,useContext:Gn,useEffect:Gn,useImperativeHandle:Gn,useInsertionEffect:Gn,useLayoutEffect:Gn,useMemo:Gn,useReducer:Gn,useRef:Gn,useState:Gn,useDebugValue:Gn,useDeferredValue:Gn,useTransition:Gn,useMutableSource:Gn,useSyncExternalStore:Gn,useId:Gn,unstable_isNewReconciler:!1},qb={readContext:Yr,useCallback:function(e,t){return gi().memoizedState=[e,t===void 0?null:t],e},useContext:Yr,useEffect:i2,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,rf(4194308,4,R5.bind(null,t,e),n)},useLayoutEffect:function(e,t){return rf(4194308,4,e,t)},useInsertionEffect:function(e,t){return rf(4,2,e,t)},useMemo:function(e,t){var n=gi();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=gi();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Yb.bind(null,sn,e),[r.memoizedState,e]},useRef:function(e){var t=gi();return e={current:e},t.memoizedState=e},useState:r2,useDebugValue:jp,useDeferredValue:function(e){return gi().memoizedState=e},useTransition:function(){var e=r2(!1),t=e[0];return e=Vb.bind(null,e[1]),gi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=sn,i=gi();if(Qt){if(n===void 0)throw Error(ae(407));n=n()}else{if(n=t(),Wn===null)throw Error(ae(349));Rs&30||k5(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,i2(M5.bind(null,r,o,e),[e]),r.flags|=2048,mc(9,E5.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=gi(),t=Wn.identifierPrefix;if(Qt){var n=Yi,r=Vi;n=(r&~(1<<32-ii(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=pc++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[vi]=t,e[fc]=r,Q5(e,t,!1,!1),t.stateNode=e;e:{switch(s=j1(n,r),n){case"dialog":zt("cancel",e),zt("close",e),i=r;break;case"iframe":case"object":case"embed":zt("load",e),i=r;break;case"video":case"audio":for(i=0;iDa&&(t.flags|=128,r=!0,al(o,!1),t.lanes=4194304)}else{if(!r)if(e=Wf(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),al(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!Qt)return Zn(t),null}else 2*yn()-o.renderingStartTime>Da&&n!==1073741824&&(t.flags|=128,r=!0,al(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=yn(),t.sibling=null,n=rn.current,Ht(rn,r?n&1|2:n&1),t):(Zn(t),null);case 22:case 23:return qp(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Er&1073741824&&(Zn(t),t.subtreeFlags&6&&(t.flags|=8192)):Zn(t),null;case 24:return null;case 25:return null}throw Error(ae(156,t.tag))}function n_(e,t){switch(Tp(t),t.tag){case 1:return xr(t.type)&&Af(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Oa(),Yt(wr),Yt(nr),Wp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Np(t),null;case 13:if(Yt(rn),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ae(340));Aa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Yt(rn),null;case 4:return Oa(),null;case 10:return Op(t.type._context),null;case 22:case 23:return qp(),null;case 24:return null;default:return null}}var _u=!1,Jn=!1,r_=typeof WeakSet=="function"?WeakSet:Set,_e=null;function ua(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){pn(e,t,r)}else n.current=null}function g0(e,t,n){try{n()}catch(r){pn(e,t,r)}}var g2=!1;function i_(e,t){if(J1=Ef,e=i5(),Ep(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,d=e,h=null;t:for(;;){for(var g;d!==n||i!==0&&d.nodeType!==3||(a=s+i),d!==o||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(g=d.firstChild)!==null;)h=d,d=g;for(;;){if(d===e)break t;if(h===n&&++c===i&&(a=s),h===o&&++u===r&&(l=s),(g=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=g}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(X1={focusedElem:e,selectionRange:n},Ef=!1,_e=t;_e!==null;)if(t=_e,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,_e=e;else for(;_e!==null;){t=_e;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var y=m.memoizedProps,k=m.memoizedState,C=t.stateNode,v=C.getSnapshotBeforeUpdate(t.elementType===t.type?y:Jr(t.type,y),k);C.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ae(163))}}catch(M){pn(t,t.return,M)}if(e=t.sibling,e!==null){e.return=t.return,_e=e;break}_e=t.return}return m=g2,g2=!1,m}function Wl(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&g0(t,n,o)}i=i.next}while(i!==r)}}function $d(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function m0(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function e3(e){var t=e.alternate;t!==null&&(e.alternate=null,e3(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[vi],delete t[fc],delete t[n0],delete t[Fb],delete t[Bb])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function t3(e){return e.tag===5||e.tag===3||e.tag===4}function m2(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||t3(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function v0(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Pf));else if(r!==4&&(e=e.child,e!==null))for(v0(e,t,n),e=e.sibling;e!==null;)v0(e,t,n),e=e.sibling}function y0(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(y0(e,t,n),e=e.sibling;e!==null;)y0(e,t,n),e=e.sibling}var Bn=null,Xr=!1;function vo(e,t,n){for(n=n.child;n!==null;)n3(e,t,n),n=n.sibling}function n3(e,t,n){if(Ci&&typeof Ci.onCommitFiberUnmount=="function")try{Ci.onCommitFiberUnmount(Ad,n)}catch{}switch(n.tag){case 5:Jn||ua(n,t);case 6:var r=Bn,i=Xr;Bn=null,vo(e,t,n),Bn=r,Xr=i,Bn!==null&&(Xr?(e=Bn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Bn.removeChild(n.stateNode));break;case 18:Bn!==null&&(Xr?(e=Bn,n=n.stateNode,e.nodeType===8?Hh(e.parentNode,n):e.nodeType===1&&Hh(e,n),sc(e)):Hh(Bn,n.stateNode));break;case 4:r=Bn,i=Xr,Bn=n.stateNode.containerInfo,Xr=!0,vo(e,t,n),Bn=r,Xr=i;break;case 0:case 11:case 14:case 15:if(!Jn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&g0(n,t,s),i=i.next}while(i!==r)}vo(e,t,n);break;case 1:if(!Jn&&(ua(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){pn(n,t,a)}vo(e,t,n);break;case 21:vo(e,t,n);break;case 22:n.mode&1?(Jn=(r=Jn)||n.memoizedState!==null,vo(e,t,n),Jn=r):vo(e,t,n);break;default:vo(e,t,n)}}function v2(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new r_),t.forEach(function(r){var i=h_.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Qr(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=yn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*s_(r/1960))-r,10e?16:e,Mo===null)var r=!1;else{if(e=Mo,Mo=null,jf=0,Tt&6)throw Error(ae(331));var i=Tt;for(Tt|=4,_e=e.current;_e!==null;){var o=_e,s=o.child;if(_e.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lyn()-Yp?_s(e,0):Vp|=n),br(e,t)}function u3(e,t){t===0&&(e.mode&1?(t=hu,hu<<=1,!(hu&130023424)&&(hu=4194304)):t=1);var n=ar();e=io(e,t),e!==null&&(Uc(e,t,n),br(e,n))}function d_(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),u3(e,n)}function h_(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ae(314))}r!==null&&r.delete(t),u3(e,n)}var f3;f3=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||wr.current)yr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return yr=!1,e_(e,t,n);yr=!!(e.flags&131072)}else yr=!1,Qt&&t.flags&1048576&&g5(t,Rf,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;of(e,t),e=t.pendingProps;var i=Pa(t,nr.current);_a(t,n),i=Up(null,t,r,e,i,n);var o=Fp();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,xr(r)?(o=!0,Lf(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Dp(t),i.updater=Wd,t.stateNode=i,i._reactInternals=t,l0(t,r,e,n),t=f0(null,t,r,!0,o,n)):(t.tag=0,Qt&&o&&Mp(t),sr(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(of(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=g_(r),e=Jr(r,e),i){case 0:t=u0(null,t,r,e,n);break e;case 1:t=d2(null,t,r,e,n);break e;case 11:t=u2(null,t,r,e,n);break e;case 14:t=f2(null,t,r,Jr(r.type,e),n);break e}throw Error(ae(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Jr(r,i),u0(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Jr(r,i),d2(e,t,r,i,n);case 3:e:{if(q5(t),e===null)throw Error(ae(387));r=t.pendingProps,o=t.memoizedState,i=o.element,b5(e,t),Nf(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=Ra(Error(ae(423)),t),t=h2(e,t,r,n,i);break e}else if(r!==i){i=Ra(Error(ae(424)),t),t=h2(e,t,r,n,i);break e}else for(Mr=$o(t.stateNode.containerInfo.firstChild),Ar=t,Qt=!0,ti=null,n=w5(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Aa(),r===i){t=oo(e,t,n);break e}sr(e,t,r,n)}t=t.child}return t;case 5:return _5(t),e===null&&o0(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,e0(r,i)?s=null:o!==null&&e0(r,o)&&(t.flags|=32),K5(e,t),sr(e,t,s,n),t.child;case 6:return e===null&&o0(t),null;case 13:return G5(e,t,n);case 4:return Ip(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=La(t,null,r,n):sr(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Jr(r,i),u2(e,t,r,i,n);case 7:return sr(e,t,t.pendingProps,n),t.child;case 8:return sr(e,t,t.pendingProps.children,n),t.child;case 12:return sr(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,Ht(Df,r._currentValue),r._currentValue=s,o!==null)if(li(o.value,s)){if(o.children===i.children&&!wr.current){t=oo(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Qi(-1,n&-n),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),s0(o.return,n,t),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(ae(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),s0(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}sr(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,_a(t,n),i=Yr(i),r=r(i),t.flags|=1,sr(e,t,r,n),t.child;case 14:return r=t.type,i=Jr(r,t.pendingProps),i=Jr(r.type,i),f2(e,t,r,i,n);case 15:return V5(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Jr(r,i),of(e,t),t.tag=1,xr(r)?(e=!0,Lf(t)):e=!1,_a(t,n),j5(t,r,i),l0(t,r,i,n),f0(null,t,r,!0,e,n);case 19:return Z5(e,t,n);case 22:return Y5(e,t,n)}throw Error(ae(156,t.tag))};function d3(e,t){return Uw(e,t)}function p_(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jr(e,t,n,r){return new p_(e,t,n,r)}function Zp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function g_(e){if(typeof e=="function")return Zp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===gp)return 11;if(e===mp)return 14}return 2}function jo(e,t){var n=e.alternate;return n===null?(n=jr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function lf(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")Zp(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case ta:return Cs(n.children,i,o,t);case pp:s=8,i|=8;break;case O1:return e=jr(12,n,t,i|2),e.elementType=O1,e.lanes=o,e;case R1:return e=jr(13,n,t,i),e.elementType=R1,e.lanes=o,e;case D1:return e=jr(19,n,t,i),e.elementType=D1,e.lanes=o,e;case _w:return Fd(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case xw:s=10;break e;case bw:s=9;break e;case gp:s=11;break e;case mp:s=14;break e;case xo:s=16,r=null;break e}throw Error(ae(130,e==null?e:typeof e,""))}return t=jr(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Cs(e,t,n,r){return e=jr(7,e,r,t),e.lanes=n,e}function Fd(e,t,n,r){return e=jr(22,e,r,t),e.elementType=_w,e.lanes=n,e.stateNode={isHidden:!1},e}function Qh(e,t,n){return e=jr(6,e,null,t),e.lanes=n,e}function Jh(e,t,n){return t=jr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function m_(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Oh(0),this.expirationTimes=Oh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Oh(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Qp(e,t,n,r,i,o,s,a,l){return e=new m_(e,t,n,a,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=jr(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Dp(o),e}function v_(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(m3)}catch(e){console.error(e)}}m3(),mw.exports=Rr;var __=mw.exports,k2=__;A1.createRoot=k2.createRoot,A1.hydrateRoot=k2.hydrateRoot;var v3={exports:{}};(function(e){(function(t,n){e.exports?e.exports=n():(t.nacl||(t.nacl={}),t.nacl.util=n())})(iw,function(){var t={};function n(r){if(!/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(r))throw new TypeError("invalid encoding")}return t.decodeUTF8=function(r){if(typeof r!="string")throw new TypeError("expected string");var i,o=unescape(encodeURIComponent(r)),s=new Uint8Array(o.length);for(i=0;i"u"?typeof Buffer.from<"u"?(t.encodeBase64=function(r){return Buffer.from(r).toString("base64")},t.decodeBase64=function(r){return n(r),new Uint8Array(Array.prototype.slice.call(Buffer.from(r,"base64"),0))}):(t.encodeBase64=function(r){return new Buffer(r).toString("base64")},t.decodeBase64=function(r){return n(r),new Uint8Array(Array.prototype.slice.call(new Buffer(r,"base64"),0))}):(t.encodeBase64=function(r){var i,o=[],s=r.length;for(i=0;i>24&255,p[x+1]=b>>16&255,p[x+2]=b>>8&255,p[x+3]=b&255,p[x+4]=f>>24&255,p[x+5]=f>>16&255,p[x+6]=f>>8&255,p[x+7]=f&255}function y(p,x,b,f,S){var $,U=0;for($=0;$>>8)-1}function k(p,x,b,f){return y(p,x,b,f,16)}function C(p,x,b,f){return y(p,x,b,f,32)}function v(p,x,b,f){for(var S=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,$=b[0]&255|(b[1]&255)<<8|(b[2]&255)<<16|(b[3]&255)<<24,U=b[4]&255|(b[5]&255)<<8|(b[6]&255)<<16|(b[7]&255)<<24,X=b[8]&255|(b[9]&255)<<8|(b[10]&255)<<16|(b[11]&255)<<24,ce=b[12]&255|(b[13]&255)<<8|(b[14]&255)<<16|(b[15]&255)<<24,Me=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,he=x[0]&255|(x[1]&255)<<8|(x[2]&255)<<16|(x[3]&255)<<24,kt=x[4]&255|(x[5]&255)<<8|(x[6]&255)<<16|(x[7]&255)<<24,we=x[8]&255|(x[9]&255)<<8|(x[10]&255)<<16|(x[11]&255)<<24,Ve=x[12]&255|(x[13]&255)<<8|(x[14]&255)<<16|(x[15]&255)<<24,Ke=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,nt=b[16]&255|(b[17]&255)<<8|(b[18]&255)<<16|(b[19]&255)<<24,et=b[20]&255|(b[21]&255)<<8|(b[22]&255)<<16|(b[23]&255)<<24,qe=b[24]&255|(b[25]&255)<<8|(b[26]&255)<<16|(b[27]&255)<<24,Qe=b[28]&255|(b[29]&255)<<8|(b[30]&255)<<16|(b[31]&255)<<24,Ge=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,Se=S,Le=$,me=U,ke=X,Ee=ce,de=Me,j=he,H=kt,re=we,J=Ve,ee=Ke,se=nt,Fe=et,rt=qe,lt=Qe,it=Ge,A,pt=0;pt<20;pt+=2)A=Se+Fe|0,Ee^=A<<7|A>>>25,A=Ee+Se|0,re^=A<<9|A>>>23,A=re+Ee|0,Fe^=A<<13|A>>>19,A=Fe+re|0,Se^=A<<18|A>>>14,A=de+Le|0,J^=A<<7|A>>>25,A=J+de|0,rt^=A<<9|A>>>23,A=rt+J|0,Le^=A<<13|A>>>19,A=Le+rt|0,de^=A<<18|A>>>14,A=ee+j|0,lt^=A<<7|A>>>25,A=lt+ee|0,me^=A<<9|A>>>23,A=me+lt|0,j^=A<<13|A>>>19,A=j+me|0,ee^=A<<18|A>>>14,A=it+se|0,ke^=A<<7|A>>>25,A=ke+it|0,H^=A<<9|A>>>23,A=H+ke|0,se^=A<<13|A>>>19,A=se+H|0,it^=A<<18|A>>>14,A=Se+ke|0,Le^=A<<7|A>>>25,A=Le+Se|0,me^=A<<9|A>>>23,A=me+Le|0,ke^=A<<13|A>>>19,A=ke+me|0,Se^=A<<18|A>>>14,A=de+Ee|0,j^=A<<7|A>>>25,A=j+de|0,H^=A<<9|A>>>23,A=H+j|0,Ee^=A<<13|A>>>19,A=Ee+H|0,de^=A<<18|A>>>14,A=ee+J|0,se^=A<<7|A>>>25,A=se+ee|0,re^=A<<9|A>>>23,A=re+se|0,J^=A<<13|A>>>19,A=J+re|0,ee^=A<<18|A>>>14,A=it+lt|0,Fe^=A<<7|A>>>25,A=Fe+it|0,rt^=A<<9|A>>>23,A=rt+Fe|0,lt^=A<<13|A>>>19,A=lt+rt|0,it^=A<<18|A>>>14;Se=Se+S|0,Le=Le+$|0,me=me+U|0,ke=ke+X|0,Ee=Ee+ce|0,de=de+Me|0,j=j+he|0,H=H+kt|0,re=re+we|0,J=J+Ve|0,ee=ee+Ke|0,se=se+nt|0,Fe=Fe+et|0,rt=rt+qe|0,lt=lt+Qe|0,it=it+Ge|0,p[0]=Se>>>0&255,p[1]=Se>>>8&255,p[2]=Se>>>16&255,p[3]=Se>>>24&255,p[4]=Le>>>0&255,p[5]=Le>>>8&255,p[6]=Le>>>16&255,p[7]=Le>>>24&255,p[8]=me>>>0&255,p[9]=me>>>8&255,p[10]=me>>>16&255,p[11]=me>>>24&255,p[12]=ke>>>0&255,p[13]=ke>>>8&255,p[14]=ke>>>16&255,p[15]=ke>>>24&255,p[16]=Ee>>>0&255,p[17]=Ee>>>8&255,p[18]=Ee>>>16&255,p[19]=Ee>>>24&255,p[20]=de>>>0&255,p[21]=de>>>8&255,p[22]=de>>>16&255,p[23]=de>>>24&255,p[24]=j>>>0&255,p[25]=j>>>8&255,p[26]=j>>>16&255,p[27]=j>>>24&255,p[28]=H>>>0&255,p[29]=H>>>8&255,p[30]=H>>>16&255,p[31]=H>>>24&255,p[32]=re>>>0&255,p[33]=re>>>8&255,p[34]=re>>>16&255,p[35]=re>>>24&255,p[36]=J>>>0&255,p[37]=J>>>8&255,p[38]=J>>>16&255,p[39]=J>>>24&255,p[40]=ee>>>0&255,p[41]=ee>>>8&255,p[42]=ee>>>16&255,p[43]=ee>>>24&255,p[44]=se>>>0&255,p[45]=se>>>8&255,p[46]=se>>>16&255,p[47]=se>>>24&255,p[48]=Fe>>>0&255,p[49]=Fe>>>8&255,p[50]=Fe>>>16&255,p[51]=Fe>>>24&255,p[52]=rt>>>0&255,p[53]=rt>>>8&255,p[54]=rt>>>16&255,p[55]=rt>>>24&255,p[56]=lt>>>0&255,p[57]=lt>>>8&255,p[58]=lt>>>16&255,p[59]=lt>>>24&255,p[60]=it>>>0&255,p[61]=it>>>8&255,p[62]=it>>>16&255,p[63]=it>>>24&255}function w(p,x,b,f){for(var S=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,$=b[0]&255|(b[1]&255)<<8|(b[2]&255)<<16|(b[3]&255)<<24,U=b[4]&255|(b[5]&255)<<8|(b[6]&255)<<16|(b[7]&255)<<24,X=b[8]&255|(b[9]&255)<<8|(b[10]&255)<<16|(b[11]&255)<<24,ce=b[12]&255|(b[13]&255)<<8|(b[14]&255)<<16|(b[15]&255)<<24,Me=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,he=x[0]&255|(x[1]&255)<<8|(x[2]&255)<<16|(x[3]&255)<<24,kt=x[4]&255|(x[5]&255)<<8|(x[6]&255)<<16|(x[7]&255)<<24,we=x[8]&255|(x[9]&255)<<8|(x[10]&255)<<16|(x[11]&255)<<24,Ve=x[12]&255|(x[13]&255)<<8|(x[14]&255)<<16|(x[15]&255)<<24,Ke=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,nt=b[16]&255|(b[17]&255)<<8|(b[18]&255)<<16|(b[19]&255)<<24,et=b[20]&255|(b[21]&255)<<8|(b[22]&255)<<16|(b[23]&255)<<24,qe=b[24]&255|(b[25]&255)<<8|(b[26]&255)<<16|(b[27]&255)<<24,Qe=b[28]&255|(b[29]&255)<<8|(b[30]&255)<<16|(b[31]&255)<<24,Ge=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,Se=S,Le=$,me=U,ke=X,Ee=ce,de=Me,j=he,H=kt,re=we,J=Ve,ee=Ke,se=nt,Fe=et,rt=qe,lt=Qe,it=Ge,A,pt=0;pt<20;pt+=2)A=Se+Fe|0,Ee^=A<<7|A>>>25,A=Ee+Se|0,re^=A<<9|A>>>23,A=re+Ee|0,Fe^=A<<13|A>>>19,A=Fe+re|0,Se^=A<<18|A>>>14,A=de+Le|0,J^=A<<7|A>>>25,A=J+de|0,rt^=A<<9|A>>>23,A=rt+J|0,Le^=A<<13|A>>>19,A=Le+rt|0,de^=A<<18|A>>>14,A=ee+j|0,lt^=A<<7|A>>>25,A=lt+ee|0,me^=A<<9|A>>>23,A=me+lt|0,j^=A<<13|A>>>19,A=j+me|0,ee^=A<<18|A>>>14,A=it+se|0,ke^=A<<7|A>>>25,A=ke+it|0,H^=A<<9|A>>>23,A=H+ke|0,se^=A<<13|A>>>19,A=se+H|0,it^=A<<18|A>>>14,A=Se+ke|0,Le^=A<<7|A>>>25,A=Le+Se|0,me^=A<<9|A>>>23,A=me+Le|0,ke^=A<<13|A>>>19,A=ke+me|0,Se^=A<<18|A>>>14,A=de+Ee|0,j^=A<<7|A>>>25,A=j+de|0,H^=A<<9|A>>>23,A=H+j|0,Ee^=A<<13|A>>>19,A=Ee+H|0,de^=A<<18|A>>>14,A=ee+J|0,se^=A<<7|A>>>25,A=se+ee|0,re^=A<<9|A>>>23,A=re+se|0,J^=A<<13|A>>>19,A=J+re|0,ee^=A<<18|A>>>14,A=it+lt|0,Fe^=A<<7|A>>>25,A=Fe+it|0,rt^=A<<9|A>>>23,A=rt+Fe|0,lt^=A<<13|A>>>19,A=lt+rt|0,it^=A<<18|A>>>14;p[0]=Se>>>0&255,p[1]=Se>>>8&255,p[2]=Se>>>16&255,p[3]=Se>>>24&255,p[4]=de>>>0&255,p[5]=de>>>8&255,p[6]=de>>>16&255,p[7]=de>>>24&255,p[8]=ee>>>0&255,p[9]=ee>>>8&255,p[10]=ee>>>16&255,p[11]=ee>>>24&255,p[12]=it>>>0&255,p[13]=it>>>8&255,p[14]=it>>>16&255,p[15]=it>>>24&255,p[16]=j>>>0&255,p[17]=j>>>8&255,p[18]=j>>>16&255,p[19]=j>>>24&255,p[20]=H>>>0&255,p[21]=H>>>8&255,p[22]=H>>>16&255,p[23]=H>>>24&255,p[24]=re>>>0&255,p[25]=re>>>8&255,p[26]=re>>>16&255,p[27]=re>>>24&255,p[28]=J>>>0&255,p[29]=J>>>8&255,p[30]=J>>>16&255,p[31]=J>>>24&255}function M(p,x,b,f){v(p,x,b,f)}function E(p,x,b,f){w(p,x,b,f)}var O=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function T(p,x,b,f,S,$,U){var X=new Uint8Array(16),ce=new Uint8Array(64),Me,he;for(he=0;he<16;he++)X[he]=0;for(he=0;he<8;he++)X[he]=$[he];for(;S>=64;){for(M(ce,X,U,O),he=0;he<64;he++)p[x+he]=b[f+he]^ce[he];for(Me=1,he=8;he<16;he++)Me=Me+(X[he]&255)|0,X[he]=Me&255,Me>>>=8;S-=64,x+=64,f+=64}if(S>0)for(M(ce,X,U,O),he=0;he=64;){for(M(U,$,S,O),ce=0;ce<64;ce++)p[x+ce]=U[ce];for(X=1,ce=8;ce<16;ce++)X=X+($[ce]&255)|0,$[ce]=X&255,X>>>=8;b-=64,x+=64}if(b>0)for(M(U,$,S,O),ce=0;ce>>13|b<<3)&8191,f=p[4]&255|(p[5]&255)<<8,this.r[2]=(b>>>10|f<<6)&7939,S=p[6]&255|(p[7]&255)<<8,this.r[3]=(f>>>7|S<<9)&8191,$=p[8]&255|(p[9]&255)<<8,this.r[4]=(S>>>4|$<<12)&255,this.r[5]=$>>>1&8190,U=p[10]&255|(p[11]&255)<<8,this.r[6]=($>>>14|U<<2)&8191,X=p[12]&255|(p[13]&255)<<8,this.r[7]=(U>>>11|X<<5)&8065,ce=p[14]&255|(p[15]&255)<<8,this.r[8]=(X>>>8|ce<<8)&8191,this.r[9]=ce>>>5&127,this.pad[0]=p[16]&255|(p[17]&255)<<8,this.pad[1]=p[18]&255|(p[19]&255)<<8,this.pad[2]=p[20]&255|(p[21]&255)<<8,this.pad[3]=p[22]&255|(p[23]&255)<<8,this.pad[4]=p[24]&255|(p[25]&255)<<8,this.pad[5]=p[26]&255|(p[27]&255)<<8,this.pad[6]=p[28]&255|(p[29]&255)<<8,this.pad[7]=p[30]&255|(p[31]&255)<<8};I.prototype.blocks=function(p,x,b){for(var f=this.fin?0:2048,S,$,U,X,ce,Me,he,kt,we,Ve,Ke,nt,et,qe,Qe,Ge,Se,Le,me,ke=this.h[0],Ee=this.h[1],de=this.h[2],j=this.h[3],H=this.h[4],re=this.h[5],J=this.h[6],ee=this.h[7],se=this.h[8],Fe=this.h[9],rt=this.r[0],lt=this.r[1],it=this.r[2],A=this.r[3],pt=this.r[4],Et=this.r[5],Mt=this.r[6],dt=this.r[7],bt=this.r[8],_t=this.r[9];b>=16;)S=p[x+0]&255|(p[x+1]&255)<<8,ke+=S&8191,$=p[x+2]&255|(p[x+3]&255)<<8,Ee+=(S>>>13|$<<3)&8191,U=p[x+4]&255|(p[x+5]&255)<<8,de+=($>>>10|U<<6)&8191,X=p[x+6]&255|(p[x+7]&255)<<8,j+=(U>>>7|X<<9)&8191,ce=p[x+8]&255|(p[x+9]&255)<<8,H+=(X>>>4|ce<<12)&8191,re+=ce>>>1&8191,Me=p[x+10]&255|(p[x+11]&255)<<8,J+=(ce>>>14|Me<<2)&8191,he=p[x+12]&255|(p[x+13]&255)<<8,ee+=(Me>>>11|he<<5)&8191,kt=p[x+14]&255|(p[x+15]&255)<<8,se+=(he>>>8|kt<<8)&8191,Fe+=kt>>>5|f,we=0,Ve=we,Ve+=ke*rt,Ve+=Ee*(5*_t),Ve+=de*(5*bt),Ve+=j*(5*dt),Ve+=H*(5*Mt),we=Ve>>>13,Ve&=8191,Ve+=re*(5*Et),Ve+=J*(5*pt),Ve+=ee*(5*A),Ve+=se*(5*it),Ve+=Fe*(5*lt),we+=Ve>>>13,Ve&=8191,Ke=we,Ke+=ke*lt,Ke+=Ee*rt,Ke+=de*(5*_t),Ke+=j*(5*bt),Ke+=H*(5*dt),we=Ke>>>13,Ke&=8191,Ke+=re*(5*Mt),Ke+=J*(5*Et),Ke+=ee*(5*pt),Ke+=se*(5*A),Ke+=Fe*(5*it),we+=Ke>>>13,Ke&=8191,nt=we,nt+=ke*it,nt+=Ee*lt,nt+=de*rt,nt+=j*(5*_t),nt+=H*(5*bt),we=nt>>>13,nt&=8191,nt+=re*(5*dt),nt+=J*(5*Mt),nt+=ee*(5*Et),nt+=se*(5*pt),nt+=Fe*(5*A),we+=nt>>>13,nt&=8191,et=we,et+=ke*A,et+=Ee*it,et+=de*lt,et+=j*rt,et+=H*(5*_t),we=et>>>13,et&=8191,et+=re*(5*bt),et+=J*(5*dt),et+=ee*(5*Mt),et+=se*(5*Et),et+=Fe*(5*pt),we+=et>>>13,et&=8191,qe=we,qe+=ke*pt,qe+=Ee*A,qe+=de*it,qe+=j*lt,qe+=H*rt,we=qe>>>13,qe&=8191,qe+=re*(5*_t),qe+=J*(5*bt),qe+=ee*(5*dt),qe+=se*(5*Mt),qe+=Fe*(5*Et),we+=qe>>>13,qe&=8191,Qe=we,Qe+=ke*Et,Qe+=Ee*pt,Qe+=de*A,Qe+=j*it,Qe+=H*lt,we=Qe>>>13,Qe&=8191,Qe+=re*rt,Qe+=J*(5*_t),Qe+=ee*(5*bt),Qe+=se*(5*dt),Qe+=Fe*(5*Mt),we+=Qe>>>13,Qe&=8191,Ge=we,Ge+=ke*Mt,Ge+=Ee*Et,Ge+=de*pt,Ge+=j*A,Ge+=H*it,we=Ge>>>13,Ge&=8191,Ge+=re*lt,Ge+=J*rt,Ge+=ee*(5*_t),Ge+=se*(5*bt),Ge+=Fe*(5*dt),we+=Ge>>>13,Ge&=8191,Se=we,Se+=ke*dt,Se+=Ee*Mt,Se+=de*Et,Se+=j*pt,Se+=H*A,we=Se>>>13,Se&=8191,Se+=re*it,Se+=J*lt,Se+=ee*rt,Se+=se*(5*_t),Se+=Fe*(5*bt),we+=Se>>>13,Se&=8191,Le=we,Le+=ke*bt,Le+=Ee*dt,Le+=de*Mt,Le+=j*Et,Le+=H*pt,we=Le>>>13,Le&=8191,Le+=re*A,Le+=J*it,Le+=ee*lt,Le+=se*rt,Le+=Fe*(5*_t),we+=Le>>>13,Le&=8191,me=we,me+=ke*_t,me+=Ee*bt,me+=de*dt,me+=j*Mt,me+=H*Et,we=me>>>13,me&=8191,me+=re*pt,me+=J*A,me+=ee*it,me+=se*lt,me+=Fe*rt,we+=me>>>13,me&=8191,we=(we<<2)+we|0,we=we+Ve|0,Ve=we&8191,we=we>>>13,Ke+=we,ke=Ve,Ee=Ke,de=nt,j=et,H=qe,re=Qe,J=Ge,ee=Se,se=Le,Fe=me,x+=16,b-=16;this.h[0]=ke,this.h[1]=Ee,this.h[2]=de,this.h[3]=j,this.h[4]=H,this.h[5]=re,this.h[6]=J,this.h[7]=ee,this.h[8]=se,this.h[9]=Fe},I.prototype.finish=function(p,x){var b=new Uint16Array(10),f,S,$,U;if(this.leftover){for(U=this.leftover,this.buffer[U++]=1;U<16;U++)this.buffer[U]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(f=this.h[1]>>>13,this.h[1]&=8191,U=2;U<10;U++)this.h[U]+=f,f=this.h[U]>>>13,this.h[U]&=8191;for(this.h[0]+=f*5,f=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=f,f=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=f,b[0]=this.h[0]+5,f=b[0]>>>13,b[0]&=8191,U=1;U<10;U++)b[U]=this.h[U]+f,f=b[U]>>>13,b[U]&=8191;for(b[9]-=8192,S=(f^1)-1,U=0;U<10;U++)b[U]&=S;for(S=~S,U=0;U<10;U++)this.h[U]=this.h[U]&S|b[U];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,$=this.h[0]+this.pad[0],this.h[0]=$&65535,U=1;U<8;U++)$=(this.h[U]+this.pad[U]|0)+($>>>16)|0,this.h[U]=$&65535;p[x+0]=this.h[0]>>>0&255,p[x+1]=this.h[0]>>>8&255,p[x+2]=this.h[1]>>>0&255,p[x+3]=this.h[1]>>>8&255,p[x+4]=this.h[2]>>>0&255,p[x+5]=this.h[2]>>>8&255,p[x+6]=this.h[3]>>>0&255,p[x+7]=this.h[3]>>>8&255,p[x+8]=this.h[4]>>>0&255,p[x+9]=this.h[4]>>>8&255,p[x+10]=this.h[5]>>>0&255,p[x+11]=this.h[5]>>>8&255,p[x+12]=this.h[6]>>>0&255,p[x+13]=this.h[6]>>>8&255,p[x+14]=this.h[7]>>>0&255,p[x+15]=this.h[7]>>>8&255},I.prototype.update=function(p,x,b){var f,S;if(this.leftover){for(S=16-this.leftover,S>b&&(S=b),f=0;f=16&&(S=b-b%16,this.blocks(p,x,S),x+=S,b-=S),b){for(f=0;f>16&1),$[b-1]&=65535;$[15]=U[15]-32767-($[14]>>16&1),S=$[15]>>16&1,$[14]&=65535,Q(U,$,1-S)}for(b=0;b<16;b++)p[2*b]=U[b]&255,p[2*b+1]=U[b]>>8}function ge(p,x){var b=new Uint8Array(32),f=new Uint8Array(32);return ue(b,p),ue(f,x),C(b,0,f,0)}function Ze(p){var x=new Uint8Array(32);return ue(x,p),x[0]&1}function je(p,x){var b;for(b=0;b<16;b++)p[b]=x[2*b]+(x[2*b+1]<<8);p[15]&=32767}function st(p,x,b){for(var f=0;f<16;f++)p[f]=x[f]+b[f]}function ft(p,x,b){for(var f=0;f<16;f++)p[f]=x[f]-b[f]}function Pe(p,x,b){var f,S,$=0,U=0,X=0,ce=0,Me=0,he=0,kt=0,we=0,Ve=0,Ke=0,nt=0,et=0,qe=0,Qe=0,Ge=0,Se=0,Le=0,me=0,ke=0,Ee=0,de=0,j=0,H=0,re=0,J=0,ee=0,se=0,Fe=0,rt=0,lt=0,it=0,A=b[0],pt=b[1],Et=b[2],Mt=b[3],dt=b[4],bt=b[5],_t=b[6],gn=b[7],Wt=b[8],cn=b[9],un=b[10],fn=b[11],Mn=b[12],Yn=b[13],Kn=b[14],qn=b[15];f=x[0],$+=f*A,U+=f*pt,X+=f*Et,ce+=f*Mt,Me+=f*dt,he+=f*bt,kt+=f*_t,we+=f*gn,Ve+=f*Wt,Ke+=f*cn,nt+=f*un,et+=f*fn,qe+=f*Mn,Qe+=f*Yn,Ge+=f*Kn,Se+=f*qn,f=x[1],U+=f*A,X+=f*pt,ce+=f*Et,Me+=f*Mt,he+=f*dt,kt+=f*bt,we+=f*_t,Ve+=f*gn,Ke+=f*Wt,nt+=f*cn,et+=f*un,qe+=f*fn,Qe+=f*Mn,Ge+=f*Yn,Se+=f*Kn,Le+=f*qn,f=x[2],X+=f*A,ce+=f*pt,Me+=f*Et,he+=f*Mt,kt+=f*dt,we+=f*bt,Ve+=f*_t,Ke+=f*gn,nt+=f*Wt,et+=f*cn,qe+=f*un,Qe+=f*fn,Ge+=f*Mn,Se+=f*Yn,Le+=f*Kn,me+=f*qn,f=x[3],ce+=f*A,Me+=f*pt,he+=f*Et,kt+=f*Mt,we+=f*dt,Ve+=f*bt,Ke+=f*_t,nt+=f*gn,et+=f*Wt,qe+=f*cn,Qe+=f*un,Ge+=f*fn,Se+=f*Mn,Le+=f*Yn,me+=f*Kn,ke+=f*qn,f=x[4],Me+=f*A,he+=f*pt,kt+=f*Et,we+=f*Mt,Ve+=f*dt,Ke+=f*bt,nt+=f*_t,et+=f*gn,qe+=f*Wt,Qe+=f*cn,Ge+=f*un,Se+=f*fn,Le+=f*Mn,me+=f*Yn,ke+=f*Kn,Ee+=f*qn,f=x[5],he+=f*A,kt+=f*pt,we+=f*Et,Ve+=f*Mt,Ke+=f*dt,nt+=f*bt,et+=f*_t,qe+=f*gn,Qe+=f*Wt,Ge+=f*cn,Se+=f*un,Le+=f*fn,me+=f*Mn,ke+=f*Yn,Ee+=f*Kn,de+=f*qn,f=x[6],kt+=f*A,we+=f*pt,Ve+=f*Et,Ke+=f*Mt,nt+=f*dt,et+=f*bt,qe+=f*_t,Qe+=f*gn,Ge+=f*Wt,Se+=f*cn,Le+=f*un,me+=f*fn,ke+=f*Mn,Ee+=f*Yn,de+=f*Kn,j+=f*qn,f=x[7],we+=f*A,Ve+=f*pt,Ke+=f*Et,nt+=f*Mt,et+=f*dt,qe+=f*bt,Qe+=f*_t,Ge+=f*gn,Se+=f*Wt,Le+=f*cn,me+=f*un,ke+=f*fn,Ee+=f*Mn,de+=f*Yn,j+=f*Kn,H+=f*qn,f=x[8],Ve+=f*A,Ke+=f*pt,nt+=f*Et,et+=f*Mt,qe+=f*dt,Qe+=f*bt,Ge+=f*_t,Se+=f*gn,Le+=f*Wt,me+=f*cn,ke+=f*un,Ee+=f*fn,de+=f*Mn,j+=f*Yn,H+=f*Kn,re+=f*qn,f=x[9],Ke+=f*A,nt+=f*pt,et+=f*Et,qe+=f*Mt,Qe+=f*dt,Ge+=f*bt,Se+=f*_t,Le+=f*gn,me+=f*Wt,ke+=f*cn,Ee+=f*un,de+=f*fn,j+=f*Mn,H+=f*Yn,re+=f*Kn,J+=f*qn,f=x[10],nt+=f*A,et+=f*pt,qe+=f*Et,Qe+=f*Mt,Ge+=f*dt,Se+=f*bt,Le+=f*_t,me+=f*gn,ke+=f*Wt,Ee+=f*cn,de+=f*un,j+=f*fn,H+=f*Mn,re+=f*Yn,J+=f*Kn,ee+=f*qn,f=x[11],et+=f*A,qe+=f*pt,Qe+=f*Et,Ge+=f*Mt,Se+=f*dt,Le+=f*bt,me+=f*_t,ke+=f*gn,Ee+=f*Wt,de+=f*cn,j+=f*un,H+=f*fn,re+=f*Mn,J+=f*Yn,ee+=f*Kn,se+=f*qn,f=x[12],qe+=f*A,Qe+=f*pt,Ge+=f*Et,Se+=f*Mt,Le+=f*dt,me+=f*bt,ke+=f*_t,Ee+=f*gn,de+=f*Wt,j+=f*cn,H+=f*un,re+=f*fn,J+=f*Mn,ee+=f*Yn,se+=f*Kn,Fe+=f*qn,f=x[13],Qe+=f*A,Ge+=f*pt,Se+=f*Et,Le+=f*Mt,me+=f*dt,ke+=f*bt,Ee+=f*_t,de+=f*gn,j+=f*Wt,H+=f*cn,re+=f*un,J+=f*fn,ee+=f*Mn,se+=f*Yn,Fe+=f*Kn,rt+=f*qn,f=x[14],Ge+=f*A,Se+=f*pt,Le+=f*Et,me+=f*Mt,ke+=f*dt,Ee+=f*bt,de+=f*_t,j+=f*gn,H+=f*Wt,re+=f*cn,J+=f*un,ee+=f*fn,se+=f*Mn,Fe+=f*Yn,rt+=f*Kn,lt+=f*qn,f=x[15],Se+=f*A,Le+=f*pt,me+=f*Et,ke+=f*Mt,Ee+=f*dt,de+=f*bt,j+=f*_t,H+=f*gn,re+=f*Wt,J+=f*cn,ee+=f*un,se+=f*fn,Fe+=f*Mn,rt+=f*Yn,lt+=f*Kn,it+=f*qn,$+=38*Le,U+=38*me,X+=38*ke,ce+=38*Ee,Me+=38*de,he+=38*j,kt+=38*H,we+=38*re,Ve+=38*J,Ke+=38*ee,nt+=38*se,et+=38*Fe,qe+=38*rt,Qe+=38*lt,Ge+=38*it,S=1,f=$+S+65535,S=Math.floor(f/65536),$=f-S*65536,f=U+S+65535,S=Math.floor(f/65536),U=f-S*65536,f=X+S+65535,S=Math.floor(f/65536),X=f-S*65536,f=ce+S+65535,S=Math.floor(f/65536),ce=f-S*65536,f=Me+S+65535,S=Math.floor(f/65536),Me=f-S*65536,f=he+S+65535,S=Math.floor(f/65536),he=f-S*65536,f=kt+S+65535,S=Math.floor(f/65536),kt=f-S*65536,f=we+S+65535,S=Math.floor(f/65536),we=f-S*65536,f=Ve+S+65535,S=Math.floor(f/65536),Ve=f-S*65536,f=Ke+S+65535,S=Math.floor(f/65536),Ke=f-S*65536,f=nt+S+65535,S=Math.floor(f/65536),nt=f-S*65536,f=et+S+65535,S=Math.floor(f/65536),et=f-S*65536,f=qe+S+65535,S=Math.floor(f/65536),qe=f-S*65536,f=Qe+S+65535,S=Math.floor(f/65536),Qe=f-S*65536,f=Ge+S+65535,S=Math.floor(f/65536),Ge=f-S*65536,f=Se+S+65535,S=Math.floor(f/65536),Se=f-S*65536,$+=S-1+37*(S-1),S=1,f=$+S+65535,S=Math.floor(f/65536),$=f-S*65536,f=U+S+65535,S=Math.floor(f/65536),U=f-S*65536,f=X+S+65535,S=Math.floor(f/65536),X=f-S*65536,f=ce+S+65535,S=Math.floor(f/65536),ce=f-S*65536,f=Me+S+65535,S=Math.floor(f/65536),Me=f-S*65536,f=he+S+65535,S=Math.floor(f/65536),he=f-S*65536,f=kt+S+65535,S=Math.floor(f/65536),kt=f-S*65536,f=we+S+65535,S=Math.floor(f/65536),we=f-S*65536,f=Ve+S+65535,S=Math.floor(f/65536),Ve=f-S*65536,f=Ke+S+65535,S=Math.floor(f/65536),Ke=f-S*65536,f=nt+S+65535,S=Math.floor(f/65536),nt=f-S*65536,f=et+S+65535,S=Math.floor(f/65536),et=f-S*65536,f=qe+S+65535,S=Math.floor(f/65536),qe=f-S*65536,f=Qe+S+65535,S=Math.floor(f/65536),Qe=f-S*65536,f=Ge+S+65535,S=Math.floor(f/65536),Ge=f-S*65536,f=Se+S+65535,S=Math.floor(f/65536),Se=f-S*65536,$+=S-1+37*(S-1),p[0]=$,p[1]=U,p[2]=X,p[3]=ce,p[4]=Me,p[5]=he,p[6]=kt,p[7]=we,p[8]=Ve,p[9]=Ke,p[10]=nt,p[11]=et,p[12]=qe,p[13]=Qe,p[14]=Ge,p[15]=Se}function tt(p,x){Pe(p,x,x)}function rr(p,x){var b=n(),f;for(f=0;f<16;f++)b[f]=x[f];for(f=253;f>=0;f--)tt(b,b),f!==2&&f!==4&&Pe(b,b,x);for(f=0;f<16;f++)p[f]=b[f]}function K(p,x){var b=n(),f;for(f=0;f<16;f++)b[f]=x[f];for(f=250;f>=0;f--)tt(b,b),f!==1&&Pe(b,b,x);for(f=0;f<16;f++)p[f]=b[f]}function q(p,x,b){var f=new Uint8Array(32),S=new Float64Array(80),$,U,X=n(),ce=n(),Me=n(),he=n(),kt=n(),we=n();for(U=0;U<31;U++)f[U]=x[U];for(f[31]=x[31]&127|64,f[0]&=248,je(S,b),U=0;U<16;U++)ce[U]=S[U],he[U]=X[U]=Me[U]=0;for(X[0]=he[0]=1,U=254;U>=0;--U)$=f[U>>>3]>>>(U&7)&1,Q(X,ce,$),Q(Me,he,$),st(kt,X,Me),ft(X,X,Me),st(Me,ce,he),ft(ce,ce,he),tt(he,kt),tt(we,X),Pe(X,Me,X),Pe(Me,ce,kt),st(kt,X,Me),ft(X,X,Me),tt(ce,X),ft(Me,he,we),Pe(X,Me,l),st(X,X,he),Pe(Me,Me,X),Pe(X,he,we),Pe(he,ce,S),tt(ce,kt),Q(X,ce,$),Q(Me,he,$);for(U=0;U<16;U++)S[U+16]=X[U],S[U+32]=Me[U],S[U+48]=ce[U],S[U+64]=he[U];var Ve=S.subarray(32),Ke=S.subarray(16);return rr(Ve,Ve),Pe(Ke,Ke,Ve),ue(p,Ke),0}function B(p,x){return q(p,x,o)}function te(p,x){return r(x,32),B(p,x)}function ne(p,x,b){var f=new Uint8Array(32);return q(f,b,x),E(p,i,f,O)}var ie=Z,Te=Y;function Ae(p,x,b,f,S,$){var U=new Uint8Array(32);return ne(U,S,$),ie(p,x,b,f,U)}function Xe(p,x,b,f,S,$){var U=new Uint8Array(32);return ne(U,S,$),Te(p,x,b,f,U)}var Dt=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function We(p,x,b,f){for(var S=new Int32Array(16),$=new Int32Array(16),U,X,ce,Me,he,kt,we,Ve,Ke,nt,et,qe,Qe,Ge,Se,Le,me,ke,Ee,de,j,H,re,J,ee,se,Fe=p[0],rt=p[1],lt=p[2],it=p[3],A=p[4],pt=p[5],Et=p[6],Mt=p[7],dt=x[0],bt=x[1],_t=x[2],gn=x[3],Wt=x[4],cn=x[5],un=x[6],fn=x[7],Mn=0;f>=128;){for(Ee=0;Ee<16;Ee++)de=8*Ee+Mn,S[Ee]=b[de+0]<<24|b[de+1]<<16|b[de+2]<<8|b[de+3],$[Ee]=b[de+4]<<24|b[de+5]<<16|b[de+6]<<8|b[de+7];for(Ee=0;Ee<80;Ee++)if(U=Fe,X=rt,ce=lt,Me=it,he=A,kt=pt,we=Et,Ve=Mt,Ke=dt,nt=bt,et=_t,qe=gn,Qe=Wt,Ge=cn,Se=un,Le=fn,j=Mt,H=fn,re=H&65535,J=H>>>16,ee=j&65535,se=j>>>16,j=(A>>>14|Wt<<18)^(A>>>18|Wt<<14)^(Wt>>>9|A<<23),H=(Wt>>>14|A<<18)^(Wt>>>18|A<<14)^(A>>>9|Wt<<23),re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,j=A&pt^~A&Et,H=Wt&cn^~Wt&un,re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,j=Dt[Ee*2],H=Dt[Ee*2+1],re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,j=S[Ee%16],H=$[Ee%16],re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,J+=re>>>16,ee+=J>>>16,se+=ee>>>16,me=ee&65535|se<<16,ke=re&65535|J<<16,j=me,H=ke,re=H&65535,J=H>>>16,ee=j&65535,se=j>>>16,j=(Fe>>>28|dt<<4)^(dt>>>2|Fe<<30)^(dt>>>7|Fe<<25),H=(dt>>>28|Fe<<4)^(Fe>>>2|dt<<30)^(Fe>>>7|dt<<25),re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,j=Fe&rt^Fe<^rt<,H=dt&bt^dt&_t^bt&_t,re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,J+=re>>>16,ee+=J>>>16,se+=ee>>>16,Ve=ee&65535|se<<16,Le=re&65535|J<<16,j=Me,H=qe,re=H&65535,J=H>>>16,ee=j&65535,se=j>>>16,j=me,H=ke,re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,J+=re>>>16,ee+=J>>>16,se+=ee>>>16,Me=ee&65535|se<<16,qe=re&65535|J<<16,rt=U,lt=X,it=ce,A=Me,pt=he,Et=kt,Mt=we,Fe=Ve,bt=Ke,_t=nt,gn=et,Wt=qe,cn=Qe,un=Ge,fn=Se,dt=Le,Ee%16===15)for(de=0;de<16;de++)j=S[de],H=$[de],re=H&65535,J=H>>>16,ee=j&65535,se=j>>>16,j=S[(de+9)%16],H=$[(de+9)%16],re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,me=S[(de+1)%16],ke=$[(de+1)%16],j=(me>>>1|ke<<31)^(me>>>8|ke<<24)^me>>>7,H=(ke>>>1|me<<31)^(ke>>>8|me<<24)^(ke>>>7|me<<25),re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,me=S[(de+14)%16],ke=$[(de+14)%16],j=(me>>>19|ke<<13)^(ke>>>29|me<<3)^me>>>6,H=(ke>>>19|me<<13)^(me>>>29|ke<<3)^(ke>>>6|me<<26),re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,J+=re>>>16,ee+=J>>>16,se+=ee>>>16,S[de]=ee&65535|se<<16,$[de]=re&65535|J<<16;j=Fe,H=dt,re=H&65535,J=H>>>16,ee=j&65535,se=j>>>16,j=p[0],H=x[0],re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,J+=re>>>16,ee+=J>>>16,se+=ee>>>16,p[0]=Fe=ee&65535|se<<16,x[0]=dt=re&65535|J<<16,j=rt,H=bt,re=H&65535,J=H>>>16,ee=j&65535,se=j>>>16,j=p[1],H=x[1],re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,J+=re>>>16,ee+=J>>>16,se+=ee>>>16,p[1]=rt=ee&65535|se<<16,x[1]=bt=re&65535|J<<16,j=lt,H=_t,re=H&65535,J=H>>>16,ee=j&65535,se=j>>>16,j=p[2],H=x[2],re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,J+=re>>>16,ee+=J>>>16,se+=ee>>>16,p[2]=lt=ee&65535|se<<16,x[2]=_t=re&65535|J<<16,j=it,H=gn,re=H&65535,J=H>>>16,ee=j&65535,se=j>>>16,j=p[3],H=x[3],re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,J+=re>>>16,ee+=J>>>16,se+=ee>>>16,p[3]=it=ee&65535|se<<16,x[3]=gn=re&65535|J<<16,j=A,H=Wt,re=H&65535,J=H>>>16,ee=j&65535,se=j>>>16,j=p[4],H=x[4],re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,J+=re>>>16,ee+=J>>>16,se+=ee>>>16,p[4]=A=ee&65535|se<<16,x[4]=Wt=re&65535|J<<16,j=pt,H=cn,re=H&65535,J=H>>>16,ee=j&65535,se=j>>>16,j=p[5],H=x[5],re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,J+=re>>>16,ee+=J>>>16,se+=ee>>>16,p[5]=pt=ee&65535|se<<16,x[5]=cn=re&65535|J<<16,j=Et,H=un,re=H&65535,J=H>>>16,ee=j&65535,se=j>>>16,j=p[6],H=x[6],re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,J+=re>>>16,ee+=J>>>16,se+=ee>>>16,p[6]=Et=ee&65535|se<<16,x[6]=un=re&65535|J<<16,j=Mt,H=fn,re=H&65535,J=H>>>16,ee=j&65535,se=j>>>16,j=p[7],H=x[7],re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,J+=re>>>16,ee+=J>>>16,se+=ee>>>16,p[7]=Mt=ee&65535|se<<16,x[7]=fn=re&65535|J<<16,Mn+=128,f-=128}return f}function Gt(p,x,b){var f=new Int32Array(8),S=new Int32Array(8),$=new Uint8Array(256),U,X=b;for(f[0]=1779033703,f[1]=3144134277,f[2]=1013904242,f[3]=2773480762,f[4]=1359893119,f[5]=2600822924,f[6]=528734635,f[7]=1541459225,S[0]=4089235720,S[1]=2227873595,S[2]=4271175723,S[3]=1595750129,S[4]=2917565137,S[5]=725511199,S[6]=4215389547,S[7]=327033209,We(f,S,x,b),b%=128,U=0;U=0;--S)f=b[S/8|0]>>(S&7)&1,dr(p,x,f),an(x,p),an(p,p),dr(p,x,f)}function ir(p,x){var b=[n(),n(),n(),n()];fe(b[0],d),fe(b[1],h),fe(b[2],a),Pe(b[3],d,h),En(p,b,x)}function Ue(p,x,b){var f=new Uint8Array(64),S=[n(),n(),n(),n()],$;for(b||r(x,32),Gt(f,x,32),f[0]&=248,f[31]&=127,f[31]|=64,ir(S,f),_n(p,S),$=0;$<32;$++)x[$+32]=p[$];return 0}var yt=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function He(p,x){var b,f,S,$;for(f=63;f>=32;--f){for(b=0,S=f-32,$=f-12;S<$;++S)x[S]+=b-16*x[f]*yt[S-(f-32)],b=Math.floor((x[S]+128)/256),x[S]-=b*256;x[S]+=b,x[f]=0}for(b=0,S=0;S<32;S++)x[S]+=b-(x[31]>>4)*yt[S],b=x[S]>>8,x[S]&=255;for(S=0;S<32;S++)x[S]-=b*yt[S];for(f=0;f<32;f++)x[f+1]+=x[f]>>8,p[f]=x[f]&255}function Pt(p){var x=new Float64Array(64),b;for(b=0;b<64;b++)x[b]=p[b];for(b=0;b<64;b++)p[b]=0;He(p,x)}function Rn(p,x,b,f){var S=new Uint8Array(64),$=new Uint8Array(64),U=new Uint8Array(64),X,ce,Me=new Float64Array(64),he=[n(),n(),n(),n()];Gt(S,f,32),S[0]&=248,S[31]&=127,S[31]|=64;var kt=b+64;for(X=0;X>7&&ft(p[0],s,p[0]),Pe(p[3],p[0],p[1]),0)}function wt(p,x,b,f){var S,$=new Uint8Array(32),U=new Uint8Array(64),X=[n(),n(),n(),n()],ce=[n(),n(),n(),n()];if(b<64||hr(ce,f))return-1;for(S=0;S=0},t.sign.keyPair=function(){var p=new Uint8Array(ze),x=new Uint8Array(jt);return Ue(p,x),{publicKey:p,secretKey:x}},t.sign.keyPair.fromSecretKey=function(p){if(or(p),p.length!==jt)throw new Error("bad secret key size");for(var x=new Uint8Array(ze),b=0;b=e.length)throw new Error("Index is out of buffer");const n=e.slice(0,t),r=e.slice(t);return[n,r]}function Xh(e){let t="";return e.forEach(n=>{t+=("0"+(n&255).toString(16)).slice(-2)}),t}function Yf(e){if(e.length%2!==0)throw new Error(`Cannot convert ${e} to bytesArray`);const t=new Uint8Array(e.length/2);for(let n=0;n<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[vi]=t,e[fc]=r,Q5(e,t,!1,!1),t.stateNode=e;e:{switch(s=j1(n,r),n){case"dialog":zt("cancel",e),zt("close",e),i=r;break;case"iframe":case"object":case"embed":zt("load",e),i=r;break;case"video":case"audio":for(i=0;iDa&&(t.flags|=128,r=!0,al(o,!1),t.lanes=4194304)}else{if(!r)if(e=Wf(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),al(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!Qt)return Zn(t),null}else 2*yn()-o.renderingStartTime>Da&&n!==1073741824&&(t.flags|=128,r=!0,al(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=yn(),t.sibling=null,n=on.current,Ht(on,r?n&1|2:n&1),t):(Zn(t),null);case 22:case 23:return qp(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Er&1073741824&&(Zn(t),t.subtreeFlags&6&&(t.flags|=8192)):Zn(t),null;case 24:return null;case 25:return null}throw Error(ae(156,t.tag))}function n_(e,t){switch(Tp(t),t.tag){case 1:return xr(t.type)&&Af(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Oa(),Yt(wr),Yt(nr),Wp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Np(t),null;case 13:if(Yt(on),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ae(340));Aa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Yt(on),null;case 4:return Oa(),null;case 10:return Op(t.type._context),null;case 22:case 23:return qp(),null;case 24:return null;default:return null}}var _u=!1,Jn=!1,r_=typeof WeakSet=="function"?WeakSet:Set,_e=null;function ua(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){pn(e,t,r)}else n.current=null}function g0(e,t,n){try{n()}catch(r){pn(e,t,r)}}var g2=!1;function i_(e,t){if(J1=Ef,e=i5(),Ep(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,d=e,h=null;t:for(;;){for(var g;d!==n||i!==0&&d.nodeType!==3||(a=s+i),d!==o||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(g=d.firstChild)!==null;)h=d,d=g;for(;;){if(d===e)break t;if(h===n&&++c===i&&(a=s),h===o&&++u===r&&(l=s),(g=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=g}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(X1={focusedElem:e,selectionRange:n},Ef=!1,_e=t;_e!==null;)if(t=_e,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,_e=e;else for(;_e!==null;){t=_e;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var y=m.memoizedProps,k=m.memoizedState,C=t.stateNode,v=C.getSnapshotBeforeUpdate(t.elementType===t.type?y:Jr(t.type,y),k);C.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ae(163))}}catch(M){pn(t,t.return,M)}if(e=t.sibling,e!==null){e.return=t.return,_e=e;break}_e=t.return}return m=g2,g2=!1,m}function Wl(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&g0(t,n,o)}i=i.next}while(i!==r)}}function $d(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function m0(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function e3(e){var t=e.alternate;t!==null&&(e.alternate=null,e3(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[vi],delete t[fc],delete t[n0],delete t[Fb],delete t[Bb])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function t3(e){return e.tag===5||e.tag===3||e.tag===4}function m2(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||t3(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function v0(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Pf));else if(r!==4&&(e=e.child,e!==null))for(v0(e,t,n),e=e.sibling;e!==null;)v0(e,t,n),e=e.sibling}function y0(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(y0(e,t,n),e=e.sibling;e!==null;)y0(e,t,n),e=e.sibling}var Bn=null,Xr=!1;function vo(e,t,n){for(n=n.child;n!==null;)n3(e,t,n),n=n.sibling}function n3(e,t,n){if(Ci&&typeof Ci.onCommitFiberUnmount=="function")try{Ci.onCommitFiberUnmount(Ad,n)}catch{}switch(n.tag){case 5:Jn||ua(n,t);case 6:var r=Bn,i=Xr;Bn=null,vo(e,t,n),Bn=r,Xr=i,Bn!==null&&(Xr?(e=Bn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Bn.removeChild(n.stateNode));break;case 18:Bn!==null&&(Xr?(e=Bn,n=n.stateNode,e.nodeType===8?Hh(e.parentNode,n):e.nodeType===1&&Hh(e,n),sc(e)):Hh(Bn,n.stateNode));break;case 4:r=Bn,i=Xr,Bn=n.stateNode.containerInfo,Xr=!0,vo(e,t,n),Bn=r,Xr=i;break;case 0:case 11:case 14:case 15:if(!Jn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&g0(n,t,s),i=i.next}while(i!==r)}vo(e,t,n);break;case 1:if(!Jn&&(ua(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){pn(n,t,a)}vo(e,t,n);break;case 21:vo(e,t,n);break;case 22:n.mode&1?(Jn=(r=Jn)||n.memoizedState!==null,vo(e,t,n),Jn=r):vo(e,t,n);break;default:vo(e,t,n)}}function v2(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new r_),t.forEach(function(r){var i=h_.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Qr(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=yn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*s_(r/1960))-r,10e?16:e,Mo===null)var r=!1;else{if(e=Mo,Mo=null,jf=0,Tt&6)throw Error(ae(331));var i=Tt;for(Tt|=4,_e=e.current;_e!==null;){var o=_e,s=o.child;if(_e.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lyn()-Yp?_s(e,0):Vp|=n),br(e,t)}function u3(e,t){t===0&&(e.mode&1?(t=hu,hu<<=1,!(hu&130023424)&&(hu=4194304)):t=1);var n=ar();e=io(e,t),e!==null&&(Uc(e,t,n),br(e,n))}function d_(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),u3(e,n)}function h_(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ae(314))}r!==null&&r.delete(t),u3(e,n)}var f3;f3=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||wr.current)yr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return yr=!1,e_(e,t,n);yr=!!(e.flags&131072)}else yr=!1,Qt&&t.flags&1048576&&g5(t,Rf,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;of(e,t),e=t.pendingProps;var i=Pa(t,nr.current);_a(t,n),i=Up(null,t,r,e,i,n);var o=Fp();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,xr(r)?(o=!0,Lf(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Dp(t),i.updater=Wd,t.stateNode=i,i._reactInternals=t,l0(t,r,e,n),t=f0(null,t,r,!0,o,n)):(t.tag=0,Qt&&o&&Mp(t),sr(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(of(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=g_(r),e=Jr(r,e),i){case 0:t=u0(null,t,r,e,n);break e;case 1:t=d2(null,t,r,e,n);break e;case 11:t=u2(null,t,r,e,n);break e;case 14:t=f2(null,t,r,Jr(r.type,e),n);break e}throw Error(ae(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Jr(r,i),u0(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Jr(r,i),d2(e,t,r,i,n);case 3:e:{if(q5(t),e===null)throw Error(ae(387));r=t.pendingProps,o=t.memoizedState,i=o.element,b5(e,t),Nf(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=Ra(Error(ae(423)),t),t=h2(e,t,r,n,i);break e}else if(r!==i){i=Ra(Error(ae(424)),t),t=h2(e,t,r,n,i);break e}else for(Mr=$o(t.stateNode.containerInfo.firstChild),Ar=t,Qt=!0,ti=null,n=w5(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Aa(),r===i){t=oo(e,t,n);break e}sr(e,t,r,n)}t=t.child}return t;case 5:return _5(t),e===null&&o0(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,e0(r,i)?s=null:o!==null&&e0(r,o)&&(t.flags|=32),K5(e,t),sr(e,t,s,n),t.child;case 6:return e===null&&o0(t),null;case 13:return G5(e,t,n);case 4:return Ip(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=La(t,null,r,n):sr(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Jr(r,i),u2(e,t,r,i,n);case 7:return sr(e,t,t.pendingProps,n),t.child;case 8:return sr(e,t,t.pendingProps.children,n),t.child;case 12:return sr(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,Ht(Df,r._currentValue),r._currentValue=s,o!==null)if(li(o.value,s)){if(o.children===i.children&&!wr.current){t=oo(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Qi(-1,n&-n),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),s0(o.return,n,t),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(ae(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),s0(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}sr(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,_a(t,n),i=Yr(i),r=r(i),t.flags|=1,sr(e,t,r,n),t.child;case 14:return r=t.type,i=Jr(r,t.pendingProps),i=Jr(r.type,i),f2(e,t,r,i,n);case 15:return V5(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Jr(r,i),of(e,t),t.tag=1,xr(r)?(e=!0,Lf(t)):e=!1,_a(t,n),j5(t,r,i),l0(t,r,i,n),f0(null,t,r,!0,e,n);case 19:return Z5(e,t,n);case 22:return Y5(e,t,n)}throw Error(ae(156,t.tag))};function d3(e,t){return Uw(e,t)}function p_(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jr(e,t,n,r){return new p_(e,t,n,r)}function Zp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function g_(e){if(typeof e=="function")return Zp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===gp)return 11;if(e===mp)return 14}return 2}function jo(e,t){var n=e.alternate;return n===null?(n=jr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function lf(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")Zp(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case ta:return Cs(n.children,i,o,t);case pp:s=8,i|=8;break;case O1:return e=jr(12,n,t,i|2),e.elementType=O1,e.lanes=o,e;case R1:return e=jr(13,n,t,i),e.elementType=R1,e.lanes=o,e;case D1:return e=jr(19,n,t,i),e.elementType=D1,e.lanes=o,e;case _w:return Fd(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case xw:s=10;break e;case bw:s=9;break e;case gp:s=11;break e;case mp:s=14;break e;case xo:s=16,r=null;break e}throw Error(ae(130,e==null?e:typeof e,""))}return t=jr(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Cs(e,t,n,r){return e=jr(7,e,r,t),e.lanes=n,e}function Fd(e,t,n,r){return e=jr(22,e,r,t),e.elementType=_w,e.lanes=n,e.stateNode={isHidden:!1},e}function Qh(e,t,n){return e=jr(6,e,null,t),e.lanes=n,e}function Jh(e,t,n){return t=jr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function m_(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Oh(0),this.expirationTimes=Oh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Oh(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Qp(e,t,n,r,i,o,s,a,l){return e=new m_(e,t,n,a,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=jr(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Dp(o),e}function v_(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(m3)}catch(e){console.error(e)}}m3(),mw.exports=Rr;var __=mw.exports,k2=__;A1.createRoot=k2.createRoot,A1.hydrateRoot=k2.hydrateRoot;var v3={exports:{}};(function(e){(function(t,n){e.exports?e.exports=n():(t.nacl||(t.nacl={}),t.nacl.util=n())})(iw,function(){var t={};function n(r){if(!/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(r))throw new TypeError("invalid encoding")}return t.decodeUTF8=function(r){if(typeof r!="string")throw new TypeError("expected string");var i,o=unescape(encodeURIComponent(r)),s=new Uint8Array(o.length);for(i=0;i"u"?typeof Buffer.from<"u"?(t.encodeBase64=function(r){return Buffer.from(r).toString("base64")},t.decodeBase64=function(r){return n(r),new Uint8Array(Array.prototype.slice.call(Buffer.from(r,"base64"),0))}):(t.encodeBase64=function(r){return new Buffer(r).toString("base64")},t.decodeBase64=function(r){return n(r),new Uint8Array(Array.prototype.slice.call(new Buffer(r,"base64"),0))}):(t.encodeBase64=function(r){var i,o=[],s=r.length;for(i=0;i>24&255,p[x+1]=b>>16&255,p[x+2]=b>>8&255,p[x+3]=b&255,p[x+4]=f>>24&255,p[x+5]=f>>16&255,p[x+6]=f>>8&255,p[x+7]=f&255}function y(p,x,b,f,S){var $,U=0;for($=0;$>>8)-1}function k(p,x,b,f){return y(p,x,b,f,16)}function C(p,x,b,f){return y(p,x,b,f,32)}function v(p,x,b,f){for(var S=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,$=b[0]&255|(b[1]&255)<<8|(b[2]&255)<<16|(b[3]&255)<<24,U=b[4]&255|(b[5]&255)<<8|(b[6]&255)<<16|(b[7]&255)<<24,X=b[8]&255|(b[9]&255)<<8|(b[10]&255)<<16|(b[11]&255)<<24,ce=b[12]&255|(b[13]&255)<<8|(b[14]&255)<<16|(b[15]&255)<<24,Me=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,he=x[0]&255|(x[1]&255)<<8|(x[2]&255)<<16|(x[3]&255)<<24,kt=x[4]&255|(x[5]&255)<<8|(x[6]&255)<<16|(x[7]&255)<<24,we=x[8]&255|(x[9]&255)<<8|(x[10]&255)<<16|(x[11]&255)<<24,Ve=x[12]&255|(x[13]&255)<<8|(x[14]&255)<<16|(x[15]&255)<<24,Ke=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,nt=b[16]&255|(b[17]&255)<<8|(b[18]&255)<<16|(b[19]&255)<<24,et=b[20]&255|(b[21]&255)<<8|(b[22]&255)<<16|(b[23]&255)<<24,qe=b[24]&255|(b[25]&255)<<8|(b[26]&255)<<16|(b[27]&255)<<24,Qe=b[28]&255|(b[29]&255)<<8|(b[30]&255)<<16|(b[31]&255)<<24,Ge=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,Se=S,Le=$,me=U,ke=X,Ee=ce,de=Me,j=he,H=kt,re=we,J=Ve,ee=Ke,se=nt,Fe=et,rt=qe,lt=Qe,it=Ge,A,pt=0;pt<20;pt+=2)A=Se+Fe|0,Ee^=A<<7|A>>>25,A=Ee+Se|0,re^=A<<9|A>>>23,A=re+Ee|0,Fe^=A<<13|A>>>19,A=Fe+re|0,Se^=A<<18|A>>>14,A=de+Le|0,J^=A<<7|A>>>25,A=J+de|0,rt^=A<<9|A>>>23,A=rt+J|0,Le^=A<<13|A>>>19,A=Le+rt|0,de^=A<<18|A>>>14,A=ee+j|0,lt^=A<<7|A>>>25,A=lt+ee|0,me^=A<<9|A>>>23,A=me+lt|0,j^=A<<13|A>>>19,A=j+me|0,ee^=A<<18|A>>>14,A=it+se|0,ke^=A<<7|A>>>25,A=ke+it|0,H^=A<<9|A>>>23,A=H+ke|0,se^=A<<13|A>>>19,A=se+H|0,it^=A<<18|A>>>14,A=Se+ke|0,Le^=A<<7|A>>>25,A=Le+Se|0,me^=A<<9|A>>>23,A=me+Le|0,ke^=A<<13|A>>>19,A=ke+me|0,Se^=A<<18|A>>>14,A=de+Ee|0,j^=A<<7|A>>>25,A=j+de|0,H^=A<<9|A>>>23,A=H+j|0,Ee^=A<<13|A>>>19,A=Ee+H|0,de^=A<<18|A>>>14,A=ee+J|0,se^=A<<7|A>>>25,A=se+ee|0,re^=A<<9|A>>>23,A=re+se|0,J^=A<<13|A>>>19,A=J+re|0,ee^=A<<18|A>>>14,A=it+lt|0,Fe^=A<<7|A>>>25,A=Fe+it|0,rt^=A<<9|A>>>23,A=rt+Fe|0,lt^=A<<13|A>>>19,A=lt+rt|0,it^=A<<18|A>>>14;Se=Se+S|0,Le=Le+$|0,me=me+U|0,ke=ke+X|0,Ee=Ee+ce|0,de=de+Me|0,j=j+he|0,H=H+kt|0,re=re+we|0,J=J+Ve|0,ee=ee+Ke|0,se=se+nt|0,Fe=Fe+et|0,rt=rt+qe|0,lt=lt+Qe|0,it=it+Ge|0,p[0]=Se>>>0&255,p[1]=Se>>>8&255,p[2]=Se>>>16&255,p[3]=Se>>>24&255,p[4]=Le>>>0&255,p[5]=Le>>>8&255,p[6]=Le>>>16&255,p[7]=Le>>>24&255,p[8]=me>>>0&255,p[9]=me>>>8&255,p[10]=me>>>16&255,p[11]=me>>>24&255,p[12]=ke>>>0&255,p[13]=ke>>>8&255,p[14]=ke>>>16&255,p[15]=ke>>>24&255,p[16]=Ee>>>0&255,p[17]=Ee>>>8&255,p[18]=Ee>>>16&255,p[19]=Ee>>>24&255,p[20]=de>>>0&255,p[21]=de>>>8&255,p[22]=de>>>16&255,p[23]=de>>>24&255,p[24]=j>>>0&255,p[25]=j>>>8&255,p[26]=j>>>16&255,p[27]=j>>>24&255,p[28]=H>>>0&255,p[29]=H>>>8&255,p[30]=H>>>16&255,p[31]=H>>>24&255,p[32]=re>>>0&255,p[33]=re>>>8&255,p[34]=re>>>16&255,p[35]=re>>>24&255,p[36]=J>>>0&255,p[37]=J>>>8&255,p[38]=J>>>16&255,p[39]=J>>>24&255,p[40]=ee>>>0&255,p[41]=ee>>>8&255,p[42]=ee>>>16&255,p[43]=ee>>>24&255,p[44]=se>>>0&255,p[45]=se>>>8&255,p[46]=se>>>16&255,p[47]=se>>>24&255,p[48]=Fe>>>0&255,p[49]=Fe>>>8&255,p[50]=Fe>>>16&255,p[51]=Fe>>>24&255,p[52]=rt>>>0&255,p[53]=rt>>>8&255,p[54]=rt>>>16&255,p[55]=rt>>>24&255,p[56]=lt>>>0&255,p[57]=lt>>>8&255,p[58]=lt>>>16&255,p[59]=lt>>>24&255,p[60]=it>>>0&255,p[61]=it>>>8&255,p[62]=it>>>16&255,p[63]=it>>>24&255}function w(p,x,b,f){for(var S=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,$=b[0]&255|(b[1]&255)<<8|(b[2]&255)<<16|(b[3]&255)<<24,U=b[4]&255|(b[5]&255)<<8|(b[6]&255)<<16|(b[7]&255)<<24,X=b[8]&255|(b[9]&255)<<8|(b[10]&255)<<16|(b[11]&255)<<24,ce=b[12]&255|(b[13]&255)<<8|(b[14]&255)<<16|(b[15]&255)<<24,Me=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,he=x[0]&255|(x[1]&255)<<8|(x[2]&255)<<16|(x[3]&255)<<24,kt=x[4]&255|(x[5]&255)<<8|(x[6]&255)<<16|(x[7]&255)<<24,we=x[8]&255|(x[9]&255)<<8|(x[10]&255)<<16|(x[11]&255)<<24,Ve=x[12]&255|(x[13]&255)<<8|(x[14]&255)<<16|(x[15]&255)<<24,Ke=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,nt=b[16]&255|(b[17]&255)<<8|(b[18]&255)<<16|(b[19]&255)<<24,et=b[20]&255|(b[21]&255)<<8|(b[22]&255)<<16|(b[23]&255)<<24,qe=b[24]&255|(b[25]&255)<<8|(b[26]&255)<<16|(b[27]&255)<<24,Qe=b[28]&255|(b[29]&255)<<8|(b[30]&255)<<16|(b[31]&255)<<24,Ge=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,Se=S,Le=$,me=U,ke=X,Ee=ce,de=Me,j=he,H=kt,re=we,J=Ve,ee=Ke,se=nt,Fe=et,rt=qe,lt=Qe,it=Ge,A,pt=0;pt<20;pt+=2)A=Se+Fe|0,Ee^=A<<7|A>>>25,A=Ee+Se|0,re^=A<<9|A>>>23,A=re+Ee|0,Fe^=A<<13|A>>>19,A=Fe+re|0,Se^=A<<18|A>>>14,A=de+Le|0,J^=A<<7|A>>>25,A=J+de|0,rt^=A<<9|A>>>23,A=rt+J|0,Le^=A<<13|A>>>19,A=Le+rt|0,de^=A<<18|A>>>14,A=ee+j|0,lt^=A<<7|A>>>25,A=lt+ee|0,me^=A<<9|A>>>23,A=me+lt|0,j^=A<<13|A>>>19,A=j+me|0,ee^=A<<18|A>>>14,A=it+se|0,ke^=A<<7|A>>>25,A=ke+it|0,H^=A<<9|A>>>23,A=H+ke|0,se^=A<<13|A>>>19,A=se+H|0,it^=A<<18|A>>>14,A=Se+ke|0,Le^=A<<7|A>>>25,A=Le+Se|0,me^=A<<9|A>>>23,A=me+Le|0,ke^=A<<13|A>>>19,A=ke+me|0,Se^=A<<18|A>>>14,A=de+Ee|0,j^=A<<7|A>>>25,A=j+de|0,H^=A<<9|A>>>23,A=H+j|0,Ee^=A<<13|A>>>19,A=Ee+H|0,de^=A<<18|A>>>14,A=ee+J|0,se^=A<<7|A>>>25,A=se+ee|0,re^=A<<9|A>>>23,A=re+se|0,J^=A<<13|A>>>19,A=J+re|0,ee^=A<<18|A>>>14,A=it+lt|0,Fe^=A<<7|A>>>25,A=Fe+it|0,rt^=A<<9|A>>>23,A=rt+Fe|0,lt^=A<<13|A>>>19,A=lt+rt|0,it^=A<<18|A>>>14;p[0]=Se>>>0&255,p[1]=Se>>>8&255,p[2]=Se>>>16&255,p[3]=Se>>>24&255,p[4]=de>>>0&255,p[5]=de>>>8&255,p[6]=de>>>16&255,p[7]=de>>>24&255,p[8]=ee>>>0&255,p[9]=ee>>>8&255,p[10]=ee>>>16&255,p[11]=ee>>>24&255,p[12]=it>>>0&255,p[13]=it>>>8&255,p[14]=it>>>16&255,p[15]=it>>>24&255,p[16]=j>>>0&255,p[17]=j>>>8&255,p[18]=j>>>16&255,p[19]=j>>>24&255,p[20]=H>>>0&255,p[21]=H>>>8&255,p[22]=H>>>16&255,p[23]=H>>>24&255,p[24]=re>>>0&255,p[25]=re>>>8&255,p[26]=re>>>16&255,p[27]=re>>>24&255,p[28]=J>>>0&255,p[29]=J>>>8&255,p[30]=J>>>16&255,p[31]=J>>>24&255}function M(p,x,b,f){v(p,x,b,f)}function E(p,x,b,f){w(p,x,b,f)}var O=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function T(p,x,b,f,S,$,U){var X=new Uint8Array(16),ce=new Uint8Array(64),Me,he;for(he=0;he<16;he++)X[he]=0;for(he=0;he<8;he++)X[he]=$[he];for(;S>=64;){for(M(ce,X,U,O),he=0;he<64;he++)p[x+he]=b[f+he]^ce[he];for(Me=1,he=8;he<16;he++)Me=Me+(X[he]&255)|0,X[he]=Me&255,Me>>>=8;S-=64,x+=64,f+=64}if(S>0)for(M(ce,X,U,O),he=0;he=64;){for(M(U,$,S,O),ce=0;ce<64;ce++)p[x+ce]=U[ce];for(X=1,ce=8;ce<16;ce++)X=X+($[ce]&255)|0,$[ce]=X&255,X>>>=8;b-=64,x+=64}if(b>0)for(M(U,$,S,O),ce=0;ce>>13|b<<3)&8191,f=p[4]&255|(p[5]&255)<<8,this.r[2]=(b>>>10|f<<6)&7939,S=p[6]&255|(p[7]&255)<<8,this.r[3]=(f>>>7|S<<9)&8191,$=p[8]&255|(p[9]&255)<<8,this.r[4]=(S>>>4|$<<12)&255,this.r[5]=$>>>1&8190,U=p[10]&255|(p[11]&255)<<8,this.r[6]=($>>>14|U<<2)&8191,X=p[12]&255|(p[13]&255)<<8,this.r[7]=(U>>>11|X<<5)&8065,ce=p[14]&255|(p[15]&255)<<8,this.r[8]=(X>>>8|ce<<8)&8191,this.r[9]=ce>>>5&127,this.pad[0]=p[16]&255|(p[17]&255)<<8,this.pad[1]=p[18]&255|(p[19]&255)<<8,this.pad[2]=p[20]&255|(p[21]&255)<<8,this.pad[3]=p[22]&255|(p[23]&255)<<8,this.pad[4]=p[24]&255|(p[25]&255)<<8,this.pad[5]=p[26]&255|(p[27]&255)<<8,this.pad[6]=p[28]&255|(p[29]&255)<<8,this.pad[7]=p[30]&255|(p[31]&255)<<8};I.prototype.blocks=function(p,x,b){for(var f=this.fin?0:2048,S,$,U,X,ce,Me,he,kt,we,Ve,Ke,nt,et,qe,Qe,Ge,Se,Le,me,ke=this.h[0],Ee=this.h[1],de=this.h[2],j=this.h[3],H=this.h[4],re=this.h[5],J=this.h[6],ee=this.h[7],se=this.h[8],Fe=this.h[9],rt=this.r[0],lt=this.r[1],it=this.r[2],A=this.r[3],pt=this.r[4],Et=this.r[5],Mt=this.r[6],dt=this.r[7],bt=this.r[8],_t=this.r[9];b>=16;)S=p[x+0]&255|(p[x+1]&255)<<8,ke+=S&8191,$=p[x+2]&255|(p[x+3]&255)<<8,Ee+=(S>>>13|$<<3)&8191,U=p[x+4]&255|(p[x+5]&255)<<8,de+=($>>>10|U<<6)&8191,X=p[x+6]&255|(p[x+7]&255)<<8,j+=(U>>>7|X<<9)&8191,ce=p[x+8]&255|(p[x+9]&255)<<8,H+=(X>>>4|ce<<12)&8191,re+=ce>>>1&8191,Me=p[x+10]&255|(p[x+11]&255)<<8,J+=(ce>>>14|Me<<2)&8191,he=p[x+12]&255|(p[x+13]&255)<<8,ee+=(Me>>>11|he<<5)&8191,kt=p[x+14]&255|(p[x+15]&255)<<8,se+=(he>>>8|kt<<8)&8191,Fe+=kt>>>5|f,we=0,Ve=we,Ve+=ke*rt,Ve+=Ee*(5*_t),Ve+=de*(5*bt),Ve+=j*(5*dt),Ve+=H*(5*Mt),we=Ve>>>13,Ve&=8191,Ve+=re*(5*Et),Ve+=J*(5*pt),Ve+=ee*(5*A),Ve+=se*(5*it),Ve+=Fe*(5*lt),we+=Ve>>>13,Ve&=8191,Ke=we,Ke+=ke*lt,Ke+=Ee*rt,Ke+=de*(5*_t),Ke+=j*(5*bt),Ke+=H*(5*dt),we=Ke>>>13,Ke&=8191,Ke+=re*(5*Mt),Ke+=J*(5*Et),Ke+=ee*(5*pt),Ke+=se*(5*A),Ke+=Fe*(5*it),we+=Ke>>>13,Ke&=8191,nt=we,nt+=ke*it,nt+=Ee*lt,nt+=de*rt,nt+=j*(5*_t),nt+=H*(5*bt),we=nt>>>13,nt&=8191,nt+=re*(5*dt),nt+=J*(5*Mt),nt+=ee*(5*Et),nt+=se*(5*pt),nt+=Fe*(5*A),we+=nt>>>13,nt&=8191,et=we,et+=ke*A,et+=Ee*it,et+=de*lt,et+=j*rt,et+=H*(5*_t),we=et>>>13,et&=8191,et+=re*(5*bt),et+=J*(5*dt),et+=ee*(5*Mt),et+=se*(5*Et),et+=Fe*(5*pt),we+=et>>>13,et&=8191,qe=we,qe+=ke*pt,qe+=Ee*A,qe+=de*it,qe+=j*lt,qe+=H*rt,we=qe>>>13,qe&=8191,qe+=re*(5*_t),qe+=J*(5*bt),qe+=ee*(5*dt),qe+=se*(5*Mt),qe+=Fe*(5*Et),we+=qe>>>13,qe&=8191,Qe=we,Qe+=ke*Et,Qe+=Ee*pt,Qe+=de*A,Qe+=j*it,Qe+=H*lt,we=Qe>>>13,Qe&=8191,Qe+=re*rt,Qe+=J*(5*_t),Qe+=ee*(5*bt),Qe+=se*(5*dt),Qe+=Fe*(5*Mt),we+=Qe>>>13,Qe&=8191,Ge=we,Ge+=ke*Mt,Ge+=Ee*Et,Ge+=de*pt,Ge+=j*A,Ge+=H*it,we=Ge>>>13,Ge&=8191,Ge+=re*lt,Ge+=J*rt,Ge+=ee*(5*_t),Ge+=se*(5*bt),Ge+=Fe*(5*dt),we+=Ge>>>13,Ge&=8191,Se=we,Se+=ke*dt,Se+=Ee*Mt,Se+=de*Et,Se+=j*pt,Se+=H*A,we=Se>>>13,Se&=8191,Se+=re*it,Se+=J*lt,Se+=ee*rt,Se+=se*(5*_t),Se+=Fe*(5*bt),we+=Se>>>13,Se&=8191,Le=we,Le+=ke*bt,Le+=Ee*dt,Le+=de*Mt,Le+=j*Et,Le+=H*pt,we=Le>>>13,Le&=8191,Le+=re*A,Le+=J*it,Le+=ee*lt,Le+=se*rt,Le+=Fe*(5*_t),we+=Le>>>13,Le&=8191,me=we,me+=ke*_t,me+=Ee*bt,me+=de*dt,me+=j*Mt,me+=H*Et,we=me>>>13,me&=8191,me+=re*pt,me+=J*A,me+=ee*it,me+=se*lt,me+=Fe*rt,we+=me>>>13,me&=8191,we=(we<<2)+we|0,we=we+Ve|0,Ve=we&8191,we=we>>>13,Ke+=we,ke=Ve,Ee=Ke,de=nt,j=et,H=qe,re=Qe,J=Ge,ee=Se,se=Le,Fe=me,x+=16,b-=16;this.h[0]=ke,this.h[1]=Ee,this.h[2]=de,this.h[3]=j,this.h[4]=H,this.h[5]=re,this.h[6]=J,this.h[7]=ee,this.h[8]=se,this.h[9]=Fe},I.prototype.finish=function(p,x){var b=new Uint16Array(10),f,S,$,U;if(this.leftover){for(U=this.leftover,this.buffer[U++]=1;U<16;U++)this.buffer[U]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(f=this.h[1]>>>13,this.h[1]&=8191,U=2;U<10;U++)this.h[U]+=f,f=this.h[U]>>>13,this.h[U]&=8191;for(this.h[0]+=f*5,f=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=f,f=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=f,b[0]=this.h[0]+5,f=b[0]>>>13,b[0]&=8191,U=1;U<10;U++)b[U]=this.h[U]+f,f=b[U]>>>13,b[U]&=8191;for(b[9]-=8192,S=(f^1)-1,U=0;U<10;U++)b[U]&=S;for(S=~S,U=0;U<10;U++)this.h[U]=this.h[U]&S|b[U];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,$=this.h[0]+this.pad[0],this.h[0]=$&65535,U=1;U<8;U++)$=(this.h[U]+this.pad[U]|0)+($>>>16)|0,this.h[U]=$&65535;p[x+0]=this.h[0]>>>0&255,p[x+1]=this.h[0]>>>8&255,p[x+2]=this.h[1]>>>0&255,p[x+3]=this.h[1]>>>8&255,p[x+4]=this.h[2]>>>0&255,p[x+5]=this.h[2]>>>8&255,p[x+6]=this.h[3]>>>0&255,p[x+7]=this.h[3]>>>8&255,p[x+8]=this.h[4]>>>0&255,p[x+9]=this.h[4]>>>8&255,p[x+10]=this.h[5]>>>0&255,p[x+11]=this.h[5]>>>8&255,p[x+12]=this.h[6]>>>0&255,p[x+13]=this.h[6]>>>8&255,p[x+14]=this.h[7]>>>0&255,p[x+15]=this.h[7]>>>8&255},I.prototype.update=function(p,x,b){var f,S;if(this.leftover){for(S=16-this.leftover,S>b&&(S=b),f=0;f=16&&(S=b-b%16,this.blocks(p,x,S),x+=S,b-=S),b){for(f=0;f>16&1),$[b-1]&=65535;$[15]=U[15]-32767-($[14]>>16&1),S=$[15]>>16&1,$[14]&=65535,Q(U,$,1-S)}for(b=0;b<16;b++)p[2*b]=U[b]&255,p[2*b+1]=U[b]>>8}function ge(p,x){var b=new Uint8Array(32),f=new Uint8Array(32);return ue(b,p),ue(f,x),C(b,0,f,0)}function Ze(p){var x=new Uint8Array(32);return ue(x,p),x[0]&1}function je(p,x){var b;for(b=0;b<16;b++)p[b]=x[2*b]+(x[2*b+1]<<8);p[15]&=32767}function st(p,x,b){for(var f=0;f<16;f++)p[f]=x[f]+b[f]}function ft(p,x,b){for(var f=0;f<16;f++)p[f]=x[f]-b[f]}function Pe(p,x,b){var f,S,$=0,U=0,X=0,ce=0,Me=0,he=0,kt=0,we=0,Ve=0,Ke=0,nt=0,et=0,qe=0,Qe=0,Ge=0,Se=0,Le=0,me=0,ke=0,Ee=0,de=0,j=0,H=0,re=0,J=0,ee=0,se=0,Fe=0,rt=0,lt=0,it=0,A=b[0],pt=b[1],Et=b[2],Mt=b[3],dt=b[4],bt=b[5],_t=b[6],gn=b[7],Wt=b[8],un=b[9],fn=b[10],dn=b[11],Mn=b[12],Yn=b[13],Kn=b[14],qn=b[15];f=x[0],$+=f*A,U+=f*pt,X+=f*Et,ce+=f*Mt,Me+=f*dt,he+=f*bt,kt+=f*_t,we+=f*gn,Ve+=f*Wt,Ke+=f*un,nt+=f*fn,et+=f*dn,qe+=f*Mn,Qe+=f*Yn,Ge+=f*Kn,Se+=f*qn,f=x[1],U+=f*A,X+=f*pt,ce+=f*Et,Me+=f*Mt,he+=f*dt,kt+=f*bt,we+=f*_t,Ve+=f*gn,Ke+=f*Wt,nt+=f*un,et+=f*fn,qe+=f*dn,Qe+=f*Mn,Ge+=f*Yn,Se+=f*Kn,Le+=f*qn,f=x[2],X+=f*A,ce+=f*pt,Me+=f*Et,he+=f*Mt,kt+=f*dt,we+=f*bt,Ve+=f*_t,Ke+=f*gn,nt+=f*Wt,et+=f*un,qe+=f*fn,Qe+=f*dn,Ge+=f*Mn,Se+=f*Yn,Le+=f*Kn,me+=f*qn,f=x[3],ce+=f*A,Me+=f*pt,he+=f*Et,kt+=f*Mt,we+=f*dt,Ve+=f*bt,Ke+=f*_t,nt+=f*gn,et+=f*Wt,qe+=f*un,Qe+=f*fn,Ge+=f*dn,Se+=f*Mn,Le+=f*Yn,me+=f*Kn,ke+=f*qn,f=x[4],Me+=f*A,he+=f*pt,kt+=f*Et,we+=f*Mt,Ve+=f*dt,Ke+=f*bt,nt+=f*_t,et+=f*gn,qe+=f*Wt,Qe+=f*un,Ge+=f*fn,Se+=f*dn,Le+=f*Mn,me+=f*Yn,ke+=f*Kn,Ee+=f*qn,f=x[5],he+=f*A,kt+=f*pt,we+=f*Et,Ve+=f*Mt,Ke+=f*dt,nt+=f*bt,et+=f*_t,qe+=f*gn,Qe+=f*Wt,Ge+=f*un,Se+=f*fn,Le+=f*dn,me+=f*Mn,ke+=f*Yn,Ee+=f*Kn,de+=f*qn,f=x[6],kt+=f*A,we+=f*pt,Ve+=f*Et,Ke+=f*Mt,nt+=f*dt,et+=f*bt,qe+=f*_t,Qe+=f*gn,Ge+=f*Wt,Se+=f*un,Le+=f*fn,me+=f*dn,ke+=f*Mn,Ee+=f*Yn,de+=f*Kn,j+=f*qn,f=x[7],we+=f*A,Ve+=f*pt,Ke+=f*Et,nt+=f*Mt,et+=f*dt,qe+=f*bt,Qe+=f*_t,Ge+=f*gn,Se+=f*Wt,Le+=f*un,me+=f*fn,ke+=f*dn,Ee+=f*Mn,de+=f*Yn,j+=f*Kn,H+=f*qn,f=x[8],Ve+=f*A,Ke+=f*pt,nt+=f*Et,et+=f*Mt,qe+=f*dt,Qe+=f*bt,Ge+=f*_t,Se+=f*gn,Le+=f*Wt,me+=f*un,ke+=f*fn,Ee+=f*dn,de+=f*Mn,j+=f*Yn,H+=f*Kn,re+=f*qn,f=x[9],Ke+=f*A,nt+=f*pt,et+=f*Et,qe+=f*Mt,Qe+=f*dt,Ge+=f*bt,Se+=f*_t,Le+=f*gn,me+=f*Wt,ke+=f*un,Ee+=f*fn,de+=f*dn,j+=f*Mn,H+=f*Yn,re+=f*Kn,J+=f*qn,f=x[10],nt+=f*A,et+=f*pt,qe+=f*Et,Qe+=f*Mt,Ge+=f*dt,Se+=f*bt,Le+=f*_t,me+=f*gn,ke+=f*Wt,Ee+=f*un,de+=f*fn,j+=f*dn,H+=f*Mn,re+=f*Yn,J+=f*Kn,ee+=f*qn,f=x[11],et+=f*A,qe+=f*pt,Qe+=f*Et,Ge+=f*Mt,Se+=f*dt,Le+=f*bt,me+=f*_t,ke+=f*gn,Ee+=f*Wt,de+=f*un,j+=f*fn,H+=f*dn,re+=f*Mn,J+=f*Yn,ee+=f*Kn,se+=f*qn,f=x[12],qe+=f*A,Qe+=f*pt,Ge+=f*Et,Se+=f*Mt,Le+=f*dt,me+=f*bt,ke+=f*_t,Ee+=f*gn,de+=f*Wt,j+=f*un,H+=f*fn,re+=f*dn,J+=f*Mn,ee+=f*Yn,se+=f*Kn,Fe+=f*qn,f=x[13],Qe+=f*A,Ge+=f*pt,Se+=f*Et,Le+=f*Mt,me+=f*dt,ke+=f*bt,Ee+=f*_t,de+=f*gn,j+=f*Wt,H+=f*un,re+=f*fn,J+=f*dn,ee+=f*Mn,se+=f*Yn,Fe+=f*Kn,rt+=f*qn,f=x[14],Ge+=f*A,Se+=f*pt,Le+=f*Et,me+=f*Mt,ke+=f*dt,Ee+=f*bt,de+=f*_t,j+=f*gn,H+=f*Wt,re+=f*un,J+=f*fn,ee+=f*dn,se+=f*Mn,Fe+=f*Yn,rt+=f*Kn,lt+=f*qn,f=x[15],Se+=f*A,Le+=f*pt,me+=f*Et,ke+=f*Mt,Ee+=f*dt,de+=f*bt,j+=f*_t,H+=f*gn,re+=f*Wt,J+=f*un,ee+=f*fn,se+=f*dn,Fe+=f*Mn,rt+=f*Yn,lt+=f*Kn,it+=f*qn,$+=38*Le,U+=38*me,X+=38*ke,ce+=38*Ee,Me+=38*de,he+=38*j,kt+=38*H,we+=38*re,Ve+=38*J,Ke+=38*ee,nt+=38*se,et+=38*Fe,qe+=38*rt,Qe+=38*lt,Ge+=38*it,S=1,f=$+S+65535,S=Math.floor(f/65536),$=f-S*65536,f=U+S+65535,S=Math.floor(f/65536),U=f-S*65536,f=X+S+65535,S=Math.floor(f/65536),X=f-S*65536,f=ce+S+65535,S=Math.floor(f/65536),ce=f-S*65536,f=Me+S+65535,S=Math.floor(f/65536),Me=f-S*65536,f=he+S+65535,S=Math.floor(f/65536),he=f-S*65536,f=kt+S+65535,S=Math.floor(f/65536),kt=f-S*65536,f=we+S+65535,S=Math.floor(f/65536),we=f-S*65536,f=Ve+S+65535,S=Math.floor(f/65536),Ve=f-S*65536,f=Ke+S+65535,S=Math.floor(f/65536),Ke=f-S*65536,f=nt+S+65535,S=Math.floor(f/65536),nt=f-S*65536,f=et+S+65535,S=Math.floor(f/65536),et=f-S*65536,f=qe+S+65535,S=Math.floor(f/65536),qe=f-S*65536,f=Qe+S+65535,S=Math.floor(f/65536),Qe=f-S*65536,f=Ge+S+65535,S=Math.floor(f/65536),Ge=f-S*65536,f=Se+S+65535,S=Math.floor(f/65536),Se=f-S*65536,$+=S-1+37*(S-1),S=1,f=$+S+65535,S=Math.floor(f/65536),$=f-S*65536,f=U+S+65535,S=Math.floor(f/65536),U=f-S*65536,f=X+S+65535,S=Math.floor(f/65536),X=f-S*65536,f=ce+S+65535,S=Math.floor(f/65536),ce=f-S*65536,f=Me+S+65535,S=Math.floor(f/65536),Me=f-S*65536,f=he+S+65535,S=Math.floor(f/65536),he=f-S*65536,f=kt+S+65535,S=Math.floor(f/65536),kt=f-S*65536,f=we+S+65535,S=Math.floor(f/65536),we=f-S*65536,f=Ve+S+65535,S=Math.floor(f/65536),Ve=f-S*65536,f=Ke+S+65535,S=Math.floor(f/65536),Ke=f-S*65536,f=nt+S+65535,S=Math.floor(f/65536),nt=f-S*65536,f=et+S+65535,S=Math.floor(f/65536),et=f-S*65536,f=qe+S+65535,S=Math.floor(f/65536),qe=f-S*65536,f=Qe+S+65535,S=Math.floor(f/65536),Qe=f-S*65536,f=Ge+S+65535,S=Math.floor(f/65536),Ge=f-S*65536,f=Se+S+65535,S=Math.floor(f/65536),Se=f-S*65536,$+=S-1+37*(S-1),p[0]=$,p[1]=U,p[2]=X,p[3]=ce,p[4]=Me,p[5]=he,p[6]=kt,p[7]=we,p[8]=Ve,p[9]=Ke,p[10]=nt,p[11]=et,p[12]=qe,p[13]=Qe,p[14]=Ge,p[15]=Se}function tt(p,x){Pe(p,x,x)}function rr(p,x){var b=n(),f;for(f=0;f<16;f++)b[f]=x[f];for(f=253;f>=0;f--)tt(b,b),f!==2&&f!==4&&Pe(b,b,x);for(f=0;f<16;f++)p[f]=b[f]}function K(p,x){var b=n(),f;for(f=0;f<16;f++)b[f]=x[f];for(f=250;f>=0;f--)tt(b,b),f!==1&&Pe(b,b,x);for(f=0;f<16;f++)p[f]=b[f]}function q(p,x,b){var f=new Uint8Array(32),S=new Float64Array(80),$,U,X=n(),ce=n(),Me=n(),he=n(),kt=n(),we=n();for(U=0;U<31;U++)f[U]=x[U];for(f[31]=x[31]&127|64,f[0]&=248,je(S,b),U=0;U<16;U++)ce[U]=S[U],he[U]=X[U]=Me[U]=0;for(X[0]=he[0]=1,U=254;U>=0;--U)$=f[U>>>3]>>>(U&7)&1,Q(X,ce,$),Q(Me,he,$),st(kt,X,Me),ft(X,X,Me),st(Me,ce,he),ft(ce,ce,he),tt(he,kt),tt(we,X),Pe(X,Me,X),Pe(Me,ce,kt),st(kt,X,Me),ft(X,X,Me),tt(ce,X),ft(Me,he,we),Pe(X,Me,l),st(X,X,he),Pe(Me,Me,X),Pe(X,he,we),Pe(he,ce,S),tt(ce,kt),Q(X,ce,$),Q(Me,he,$);for(U=0;U<16;U++)S[U+16]=X[U],S[U+32]=Me[U],S[U+48]=ce[U],S[U+64]=he[U];var Ve=S.subarray(32),Ke=S.subarray(16);return rr(Ve,Ve),Pe(Ke,Ke,Ve),ue(p,Ke),0}function B(p,x){return q(p,x,o)}function te(p,x){return r(x,32),B(p,x)}function ne(p,x,b){var f=new Uint8Array(32);return q(f,b,x),E(p,i,f,O)}var ie=Z,Te=Y;function Ae(p,x,b,f,S,$){var U=new Uint8Array(32);return ne(U,S,$),ie(p,x,b,f,U)}function Xe(p,x,b,f,S,$){var U=new Uint8Array(32);return ne(U,S,$),Te(p,x,b,f,U)}var Dt=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function We(p,x,b,f){for(var S=new Int32Array(16),$=new Int32Array(16),U,X,ce,Me,he,kt,we,Ve,Ke,nt,et,qe,Qe,Ge,Se,Le,me,ke,Ee,de,j,H,re,J,ee,se,Fe=p[0],rt=p[1],lt=p[2],it=p[3],A=p[4],pt=p[5],Et=p[6],Mt=p[7],dt=x[0],bt=x[1],_t=x[2],gn=x[3],Wt=x[4],un=x[5],fn=x[6],dn=x[7],Mn=0;f>=128;){for(Ee=0;Ee<16;Ee++)de=8*Ee+Mn,S[Ee]=b[de+0]<<24|b[de+1]<<16|b[de+2]<<8|b[de+3],$[Ee]=b[de+4]<<24|b[de+5]<<16|b[de+6]<<8|b[de+7];for(Ee=0;Ee<80;Ee++)if(U=Fe,X=rt,ce=lt,Me=it,he=A,kt=pt,we=Et,Ve=Mt,Ke=dt,nt=bt,et=_t,qe=gn,Qe=Wt,Ge=un,Se=fn,Le=dn,j=Mt,H=dn,re=H&65535,J=H>>>16,ee=j&65535,se=j>>>16,j=(A>>>14|Wt<<18)^(A>>>18|Wt<<14)^(Wt>>>9|A<<23),H=(Wt>>>14|A<<18)^(Wt>>>18|A<<14)^(A>>>9|Wt<<23),re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,j=A&pt^~A&Et,H=Wt&un^~Wt&fn,re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,j=Dt[Ee*2],H=Dt[Ee*2+1],re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,j=S[Ee%16],H=$[Ee%16],re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,J+=re>>>16,ee+=J>>>16,se+=ee>>>16,me=ee&65535|se<<16,ke=re&65535|J<<16,j=me,H=ke,re=H&65535,J=H>>>16,ee=j&65535,se=j>>>16,j=(Fe>>>28|dt<<4)^(dt>>>2|Fe<<30)^(dt>>>7|Fe<<25),H=(dt>>>28|Fe<<4)^(Fe>>>2|dt<<30)^(Fe>>>7|dt<<25),re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,j=Fe&rt^Fe<^rt<,H=dt&bt^dt&_t^bt&_t,re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,J+=re>>>16,ee+=J>>>16,se+=ee>>>16,Ve=ee&65535|se<<16,Le=re&65535|J<<16,j=Me,H=qe,re=H&65535,J=H>>>16,ee=j&65535,se=j>>>16,j=me,H=ke,re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,J+=re>>>16,ee+=J>>>16,se+=ee>>>16,Me=ee&65535|se<<16,qe=re&65535|J<<16,rt=U,lt=X,it=ce,A=Me,pt=he,Et=kt,Mt=we,Fe=Ve,bt=Ke,_t=nt,gn=et,Wt=qe,un=Qe,fn=Ge,dn=Se,dt=Le,Ee%16===15)for(de=0;de<16;de++)j=S[de],H=$[de],re=H&65535,J=H>>>16,ee=j&65535,se=j>>>16,j=S[(de+9)%16],H=$[(de+9)%16],re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,me=S[(de+1)%16],ke=$[(de+1)%16],j=(me>>>1|ke<<31)^(me>>>8|ke<<24)^me>>>7,H=(ke>>>1|me<<31)^(ke>>>8|me<<24)^(ke>>>7|me<<25),re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,me=S[(de+14)%16],ke=$[(de+14)%16],j=(me>>>19|ke<<13)^(ke>>>29|me<<3)^me>>>6,H=(ke>>>19|me<<13)^(me>>>29|ke<<3)^(ke>>>6|me<<26),re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,J+=re>>>16,ee+=J>>>16,se+=ee>>>16,S[de]=ee&65535|se<<16,$[de]=re&65535|J<<16;j=Fe,H=dt,re=H&65535,J=H>>>16,ee=j&65535,se=j>>>16,j=p[0],H=x[0],re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,J+=re>>>16,ee+=J>>>16,se+=ee>>>16,p[0]=Fe=ee&65535|se<<16,x[0]=dt=re&65535|J<<16,j=rt,H=bt,re=H&65535,J=H>>>16,ee=j&65535,se=j>>>16,j=p[1],H=x[1],re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,J+=re>>>16,ee+=J>>>16,se+=ee>>>16,p[1]=rt=ee&65535|se<<16,x[1]=bt=re&65535|J<<16,j=lt,H=_t,re=H&65535,J=H>>>16,ee=j&65535,se=j>>>16,j=p[2],H=x[2],re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,J+=re>>>16,ee+=J>>>16,se+=ee>>>16,p[2]=lt=ee&65535|se<<16,x[2]=_t=re&65535|J<<16,j=it,H=gn,re=H&65535,J=H>>>16,ee=j&65535,se=j>>>16,j=p[3],H=x[3],re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,J+=re>>>16,ee+=J>>>16,se+=ee>>>16,p[3]=it=ee&65535|se<<16,x[3]=gn=re&65535|J<<16,j=A,H=Wt,re=H&65535,J=H>>>16,ee=j&65535,se=j>>>16,j=p[4],H=x[4],re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,J+=re>>>16,ee+=J>>>16,se+=ee>>>16,p[4]=A=ee&65535|se<<16,x[4]=Wt=re&65535|J<<16,j=pt,H=un,re=H&65535,J=H>>>16,ee=j&65535,se=j>>>16,j=p[5],H=x[5],re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,J+=re>>>16,ee+=J>>>16,se+=ee>>>16,p[5]=pt=ee&65535|se<<16,x[5]=un=re&65535|J<<16,j=Et,H=fn,re=H&65535,J=H>>>16,ee=j&65535,se=j>>>16,j=p[6],H=x[6],re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,J+=re>>>16,ee+=J>>>16,se+=ee>>>16,p[6]=Et=ee&65535|se<<16,x[6]=fn=re&65535|J<<16,j=Mt,H=dn,re=H&65535,J=H>>>16,ee=j&65535,se=j>>>16,j=p[7],H=x[7],re+=H&65535,J+=H>>>16,ee+=j&65535,se+=j>>>16,J+=re>>>16,ee+=J>>>16,se+=ee>>>16,p[7]=Mt=ee&65535|se<<16,x[7]=dn=re&65535|J<<16,Mn+=128,f-=128}return f}function Gt(p,x,b){var f=new Int32Array(8),S=new Int32Array(8),$=new Uint8Array(256),U,X=b;for(f[0]=1779033703,f[1]=3144134277,f[2]=1013904242,f[3]=2773480762,f[4]=1359893119,f[5]=2600822924,f[6]=528734635,f[7]=1541459225,S[0]=4089235720,S[1]=2227873595,S[2]=4271175723,S[3]=1595750129,S[4]=2917565137,S[5]=725511199,S[6]=4215389547,S[7]=327033209,We(f,S,x,b),b%=128,U=0;U=0;--S)f=b[S/8|0]>>(S&7)&1,dr(p,x,f),ln(x,p),ln(p,p),dr(p,x,f)}function ir(p,x){var b=[n(),n(),n(),n()];fe(b[0],d),fe(b[1],h),fe(b[2],a),Pe(b[3],d,h),En(p,b,x)}function Ue(p,x,b){var f=new Uint8Array(64),S=[n(),n(),n(),n()],$;for(b||r(x,32),Gt(f,x,32),f[0]&=248,f[31]&=127,f[31]|=64,ir(S,f),_n(p,S),$=0;$<32;$++)x[$+32]=p[$];return 0}var yt=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function He(p,x){var b,f,S,$;for(f=63;f>=32;--f){for(b=0,S=f-32,$=f-12;S<$;++S)x[S]+=b-16*x[f]*yt[S-(f-32)],b=Math.floor((x[S]+128)/256),x[S]-=b*256;x[S]+=b,x[f]=0}for(b=0,S=0;S<32;S++)x[S]+=b-(x[31]>>4)*yt[S],b=x[S]>>8,x[S]&=255;for(S=0;S<32;S++)x[S]-=b*yt[S];for(f=0;f<32;f++)x[f+1]+=x[f]>>8,p[f]=x[f]&255}function Pt(p){var x=new Float64Array(64),b;for(b=0;b<64;b++)x[b]=p[b];for(b=0;b<64;b++)p[b]=0;He(p,x)}function Rn(p,x,b,f){var S=new Uint8Array(64),$=new Uint8Array(64),U=new Uint8Array(64),X,ce,Me=new Float64Array(64),he=[n(),n(),n(),n()];Gt(S,f,32),S[0]&=248,S[31]&=127,S[31]|=64;var kt=b+64;for(X=0;X>7&&ft(p[0],s,p[0]),Pe(p[3],p[0],p[1]),0)}function wt(p,x,b,f){var S,$=new Uint8Array(32),U=new Uint8Array(64),X=[n(),n(),n(),n()],ce=[n(),n(),n(),n()];if(b<64||hr(ce,f))return-1;for(S=0;S=0},t.sign.keyPair=function(){var p=new Uint8Array(ze),x=new Uint8Array(jt);return Ue(p,x),{publicKey:p,secretKey:x}},t.sign.keyPair.fromSecretKey=function(p){if(or(p),p.length!==jt)throw new Error("bad secret key size");for(var x=new Uint8Array(ze),b=0;b=e.length)throw new Error("Index is out of buffer");const n=e.slice(0,t),r=e.slice(t);return[n,r]}function Xh(e){let t="";return e.forEach(n=>{t+=("0"+(n&255).toString(16)).slice(-2)}),t}function Yf(e){if(e.length%2!==0)throw new Error(`Cannot convert ${e} to bytesArray`);const t=new Uint8Array(e.length/2);for(let n=0;n{var i,o;if(!((i=void 0)===null||i===void 0)&&i.aborted){r(new Ie("Delay aborted"));return}const s=setTimeout(()=>n(),e);(o=void 0)===null||o===void 0||o.addEventListener("abort",()=>{clearTimeout(s),r(new Ie("Delay aborted"))})})})}function ni(e){const t=new AbortController;return e!=null&&e.aborted?t.abort():e==null||e.addEventListener("abort",()=>t.abort(),{once:!0}),t}function Fl(e,t){var n,r;return xe(this,void 0,void 0,function*(){const i=(n=t==null?void 0:t.attempts)!==null&&n!==void 0?n:10,o=(r=t==null?void 0:t.delayMs)!==null&&r!==void 0?r:200,s=ni(t==null?void 0:t.signal);if(typeof e!="function")throw new Ie(`Expected a function, got ${typeof e}`);let a=0,l;for(;axe(this,void 0,void 0,function*(){if(o=d??null,s==null||s.abort(),s=ni(d),s.signal.aborted)throw new Ie("Resource creation was aborted");r=h??null;const g=e(s.signal,...h);i=g;const m=yield g;if(i!==g&&m!==n)throw yield t(m),new Ie("Resource creation was aborted by a new resource creation");return n=m,n});return{create:a,current:()=>n??null,dispose:()=>xe(this,void 0,void 0,function*(){try{const d=n;n=null;const h=i;i=null;try{s==null||s.abort()}catch{}yield Promise.allSettled([d?t(d):Promise.resolve(),h?t(yield h):Promise.resolve()])}catch{}}),recreate:d=>xe(this,void 0,void 0,function*(){const h=n,g=i,m=r,y=o;if(yield b3(d),h===n&&g===i&&m===r&&y===o)return yield a(o,...m??[]);throw new Ie("Resource recreation was aborted by a new resource creation")})}}function V_(e,t){const n=t==null?void 0:t.timeout,r=t==null?void 0:t.signal,i=ni(r);return new Promise((o,s)=>{if(i.signal.aborted){s(new Ie("Operation aborted"));return}let a;typeof n<"u"&&(a=setTimeout(()=>{i.abort(),s(new Ie(`Timeout after ${n}ms`))},n)),i.signal.addEventListener("abort",()=>{clearTimeout(a),s(new Ie("Operation aborted"))},{once:!0});const l={timeout:n,abort:i.signal};e(o,s,l).finally(()=>clearTimeout(a))})}class e1{constructor(t,n,r,i,o){this.bridgeUrl=n,this.sessionId=r,this.listener=i,this.errorsListener=o,this.ssePath="events",this.postPath="message",this.heartbeatMessage="heartbeat",this.defaultTtl=300,this.defaultReconnectDelay=5e3,this.eventSource=z_((s,a)=>xe(this,void 0,void 0,function*(){const l={bridgeUrl:this.bridgeUrl,ssePath:this.ssePath,sessionId:this.sessionId,bridgeGatewayStorage:this.bridgeGatewayStorage,errorHandler:this.errorsHandler.bind(this),messageHandler:this.messagesHandler.bind(this),signal:s,openingDeadlineMS:a};return yield Y_(l)}),s=>xe(this,void 0,void 0,function*(){s.close()})),this.bridgeGatewayStorage=new B_(t,n)}get isReady(){const t=this.eventSource.current();return(t==null?void 0:t.readyState)===EventSource.OPEN}get isClosed(){const t=this.eventSource.current();return(t==null?void 0:t.readyState)!==EventSource.OPEN}get isConnecting(){const t=this.eventSource.current();return(t==null?void 0:t.readyState)===EventSource.CONNECTING}registerSession(t){return xe(this,void 0,void 0,function*(){yield this.eventSource.create(t==null?void 0:t.signal,t==null?void 0:t.openingDeadlineMS)})}send(t,n,r,i){var o;return xe(this,void 0,void 0,function*(){const s={};typeof i=="number"?s.ttl=i:(s.ttl=i==null?void 0:i.ttl,s.signal=i==null?void 0:i.signal,s.attempts=i==null?void 0:i.attempts);const a=new URL(w3(this.bridgeUrl,this.postPath));a.searchParams.append("client_id",this.sessionId),a.searchParams.append("to",n),a.searchParams.append("ttl",((s==null?void 0:s.ttl)||this.defaultTtl).toString()),a.searchParams.append("topic",r);const l=tg.encode(t);yield Fl(c=>xe(this,void 0,void 0,function*(){const u=yield this.post(a,l,c.signal);if(!u.ok)throw new Ie(`Bridge send failed, status ${u.status}`)}),{attempts:(o=s==null?void 0:s.attempts)!==null&&o!==void 0?o:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:s==null?void 0:s.signal})})}pause(){this.eventSource.dispose().catch(t=>ki(`Bridge pause failed, ${t}`))}unPause(){return xe(this,void 0,void 0,function*(){yield this.eventSource.recreate(0)})}close(){return xe(this,void 0,void 0,function*(){yield this.eventSource.dispose().catch(t=>ki(`Bridge close failed, ${t}`))})}setListener(t){this.listener=t}setErrorsListener(t){this.errorsListener=t}post(t,n,r){return xe(this,void 0,void 0,function*(){const i=yield fetch(t,{method:"post",body:n,signal:r});if(!i.ok)throw new Ie(`Bridge send failed, status ${i.status}`);return i})}errorsHandler(t,n){return xe(this,void 0,void 0,function*(){if(this.isConnecting){ki("Bridge error",JSON.stringify(n));return}if(this.isReady){try{this.errorsListener(n)}catch{}return}if(this.isClosed)return t.close(),Tn(`Bridge reconnecting, ${this.defaultReconnectDelay}ms delay`),yield this.eventSource.recreate(this.defaultReconnectDelay);throw new Ie("Bridge error, unknown state")})}messagesHandler(t){return xe(this,void 0,void 0,function*(){if(t.data===this.heartbeatMessage||(yield this.bridgeGatewayStorage.storeLastEventId(t.lastEventId),this.isClosed))return;let n;try{n=JSON.parse(t.data)}catch(r){throw new Ie(`Bridge message parse failed, message ${r.data}`)}this.listener(n)})}}function Y_(e){return xe(this,void 0,void 0,function*(){return yield V_((t,n,r)=>xe(this,void 0,void 0,function*(){var i;const s=ni(r.signal).signal;if(s.aborted){n(new Ie("Bridge connection aborted"));return}const a=new URL(w3(e.bridgeUrl,e.ssePath));a.searchParams.append("client_id",e.sessionId);const l=yield e.bridgeGatewayStorage.getLastEventId();if(l&&a.searchParams.append("last_event_id",l),s.aborted){n(new Ie("Bridge connection aborted"));return}const c=new EventSource(a.toString());c.onerror=u=>xe(this,void 0,void 0,function*(){if(s.aborted){c.close(),n(new Ie("Bridge connection aborted"));return}try{const d=yield e.errorHandler(c,u);d!==c&&c.close(),d&&d!==c&&t(d)}catch(d){c.close(),n(d)}}),c.onopen=()=>{if(s.aborted){c.close(),n(new Ie("Bridge connection aborted"));return}t(c)},c.onmessage=u=>{if(s.aborted){c.close(),n(new Ie("Bridge connection aborted"));return}e.messageHandler(u)},(i=e.signal)===null||i===void 0||i.addEventListener("abort",()=>{c.close(),n(new Ie("Bridge connection aborted"))})}),{timeout:e.openingDeadlineMS,signal:e.signal})})}function Bl(e){return!("connectEvent"in e)}class wc{constructor(t){this.storage=t,this.storeKey="ton-connect-storage_bridge-connection"}storeConnection(t){return xe(this,void 0,void 0,function*(){if(t.type==="injected")return this.storage.setItem(this.storeKey,JSON.stringify(t));if(!Bl(t)){const r={sessionKeyPair:t.session.sessionCrypto.stringifyKeypair(),walletPublicKey:t.session.walletPublicKey,bridgeUrl:t.session.bridgeUrl},i={type:"http",connectEvent:t.connectEvent,session:r,lastWalletEventId:t.lastWalletEventId,nextRpcRequestId:t.nextRpcRequestId};return this.storage.setItem(this.storeKey,JSON.stringify(i))}const n={type:"http",connectionSource:t.connectionSource,sessionCrypto:t.sessionCrypto.stringifyKeypair()};return this.storage.setItem(this.storeKey,JSON.stringify(n))})}removeConnection(){return xe(this,void 0,void 0,function*(){return this.storage.removeItem(this.storeKey)})}getConnection(){return xe(this,void 0,void 0,function*(){const t=yield this.storage.getItem(this.storeKey);if(!t)return null;const n=JSON.parse(t);if(n.type==="injected")return n;if("connectEvent"in n){const r=new C0(n.session.sessionKeyPair);return{type:"http",connectEvent:n.connectEvent,lastWalletEventId:n.lastWalletEventId,nextRpcRequestId:n.nextRpcRequestId,session:{sessionCrypto:r,bridgeUrl:n.session.bridgeUrl,walletPublicKey:n.session.walletPublicKey}}}return{type:"http",sessionCrypto:new C0(n.sessionCrypto),connectionSource:n.connectionSource}})}getHttpConnection(){return xe(this,void 0,void 0,function*(){const t=yield this.getConnection();if(!t)throw new Ie("Trying to read HTTP connection source while nothing is stored");if(t.type==="injected")throw new Ie("Trying to read HTTP connection source while injected connection is stored");return t})}getHttpPendingConnection(){return xe(this,void 0,void 0,function*(){const t=yield this.getConnection();if(!t)throw new Ie("Trying to read HTTP connection source while nothing is stored");if(t.type==="injected")throw new Ie("Trying to read HTTP connection source while injected connection is stored");if(!Bl(t))throw new Ie("Trying to read HTTP-pending connection while http connection is stored");return t})}getInjectedConnection(){return xe(this,void 0,void 0,function*(){const t=yield this.getConnection();if(!t)throw new Ie("Trying to read Injected bridge connection source while nothing is stored");if((t==null?void 0:t.type)==="http")throw new Ie("Trying to read Injected bridge connection source while HTTP connection is stored");return t})}storedConnectionType(){return xe(this,void 0,void 0,function*(){const t=yield this.storage.getItem(this.storeKey);return t?JSON.parse(t).type:null})}storeLastWalletEventId(t){return xe(this,void 0,void 0,function*(){const n=yield this.getConnection();if(n&&n.type==="http"&&!Bl(n))return n.lastWalletEventId=t,this.storeConnection(n)})}getLastWalletEventId(){return xe(this,void 0,void 0,function*(){const t=yield this.getConnection();if(t&&"lastWalletEventId"in t)return t.lastWalletEventId})}increaseNextRpcRequestId(){return xe(this,void 0,void 0,function*(){const t=yield this.getConnection();if(t&&"nextRpcRequestId"in t){const n=t.nextRpcRequestId||0;return t.nextRpcRequestId=n+1,this.storeConnection(t)}})}getNextRpcRequestId(){return xe(this,void 0,void 0,function*(){const t=yield this.getConnection();return t&&"nextRpcRequestId"in t&&t.nextRpcRequestId||0})}}const _3=2;class xc{constructor(t,n){this.storage=t,this.walletConnectionSource=n,this.type="http",this.standardUniversalLink="tc://",this.pendingRequests=new Map,this.session=null,this.gateway=null,this.pendingGateways=[],this.listeners=[],this.defaultOpeningDeadlineMS=5e3,this.connectionStorage=new wc(t)}static fromStorage(t){return xe(this,void 0,void 0,function*(){const r=yield new wc(t).getHttpConnection();return Bl(r)?new xc(t,r.connectionSource):new xc(t,{bridgeUrl:r.session.bridgeUrl})})}connect(t,n){var r;const i=ni(n==null?void 0:n.signal);(r=this.abortController)===null||r===void 0||r.abort(),this.abortController=i,this.closeGateways();const o=new C0;this.session={sessionCrypto:o,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},this.connectionStorage.storeConnection({type:"http",connectionSource:this.walletConnectionSource,sessionCrypto:o}).then(()=>xe(this,void 0,void 0,function*(){i.signal.aborted||(yield Fl(a=>this.openGateways(o,{openingDeadlineMS:n==null?void 0:n.openingDeadlineMS,signal:a==null?void 0:a.signal}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:i.signal}))}));const s="universalLink"in this.walletConnectionSource&&this.walletConnectionSource.universalLink?this.walletConnectionSource.universalLink:this.standardUniversalLink;return this.generateUniversalLink(s,t)}restoreConnection(t){var n,r;return xe(this,void 0,void 0,function*(){const i=ni(t==null?void 0:t.signal);if((n=this.abortController)===null||n===void 0||n.abort(),this.abortController=i,i.signal.aborted)return;this.closeGateways();const o=yield this.connectionStorage.getHttpConnection();if(!o||i.signal.aborted)return;const s=(r=t==null?void 0:t.openingDeadlineMS)!==null&&r!==void 0?r:this.defaultOpeningDeadlineMS;if(Bl(o))return this.session={sessionCrypto:o.sessionCrypto,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},yield this.openGateways(o.sessionCrypto,{openingDeadlineMS:s,signal:i==null?void 0:i.signal});if(Array.isArray(this.walletConnectionSource))throw new Ie("Internal error. Connection source is array while WalletConnectionSourceHTTP was expected.");if(this.session=o.session,this.gateway&&(Tn("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new e1(this.storage,this.walletConnectionSource.bridgeUrl,o.session.sessionCrypto.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),!i.signal.aborted){this.listeners.forEach(a=>a(o.connectEvent));try{yield Fl(a=>this.gateway.registerSession({openingDeadlineMS:s,signal:a.signal}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:i.signal})}catch{yield this.disconnect({signal:i.signal});return}}})}sendRequest(t,n){const r={};return typeof n=="function"?r.onRequestSent=n:(r.onRequestSent=n==null?void 0:n.onRequestSent,r.signal=n==null?void 0:n.signal,r.attempts=n==null?void 0:n.attempts),new Promise((i,o)=>xe(this,void 0,void 0,function*(){var s;if(!this.gateway||!this.session||!("walletPublicKey"in this.session))throw new Ie("Trying to send bridge request without session");const a=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),Tn("Send http-bridge request:",Object.assign(Object.assign({},t),{id:a}));const l=this.session.sessionCrypto.encrypt(JSON.stringify(Object.assign(Object.assign({},t),{id:a})),Yf(this.session.walletPublicKey));try{yield this.gateway.send(l,this.session.walletPublicKey,t.method,{attempts:r==null?void 0:r.attempts,signal:r==null?void 0:r.signal}),(s=r==null?void 0:r.onRequestSent)===null||s===void 0||s.call(r),this.pendingRequests.set(a.toString(),i)}catch(c){o(c)}}))}closeConnection(){this.closeGateways(),this.listeners=[],this.session=null,this.gateway=null}disconnect(t){return xe(this,void 0,void 0,function*(){return new Promise(n=>xe(this,void 0,void 0,function*(){let r=!1,i=null;const o=()=>{r||(r=!0,this.removeBridgeAndSession().then(n))};try{this.closeGateways();const s=ni(t==null?void 0:t.signal);i=setTimeout(()=>{s.abort()},this.defaultOpeningDeadlineMS),yield this.sendRequest({method:"disconnect",params:[]},{onRequestSent:o,signal:s.signal,attempts:1})}catch(s){Tn("Disconnect error:",s),r||this.removeBridgeAndSession().then(n)}finally{i&&clearTimeout(i),o()}}))})}listen(t){return this.listeners.push(t),()=>this.listeners=this.listeners.filter(n=>n!==t)}pause(){var t;(t=this.gateway)===null||t===void 0||t.pause(),this.pendingGateways.forEach(n=>n.pause())}unPause(){return xe(this,void 0,void 0,function*(){const t=this.pendingGateways.map(n=>n.unPause());this.gateway&&t.push(this.gateway.unPause()),yield Promise.all(t)})}pendingGatewaysListener(t,n,r){return xe(this,void 0,void 0,function*(){if(!this.pendingGateways.includes(t)){yield t.close();return}return this.closeGateways({except:t}),this.gateway&&(Tn("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.session.bridgeUrl=n,this.gateway=t,this.gateway.setErrorsListener(this.gatewayErrorsListener.bind(this)),this.gateway.setListener(this.gatewayListener.bind(this)),this.gatewayListener(r)})}gatewayListener(t){return xe(this,void 0,void 0,function*(){const n=JSON.parse(this.session.sessionCrypto.decrypt(tg.decode(t.message).toUint8Array(),Yf(t.from)));if(Tn("Wallet message received:",n),!("event"in n)){const i=n.id.toString(),o=this.pendingRequests.get(i);if(!o){Tn(`Response id ${i} doesn't match any request's id`);return}o(n),this.pendingRequests.delete(i);return}if(n.id!==void 0){const i=yield this.connectionStorage.getLastWalletEventId();if(i!==void 0&&n.id<=i){ki(`Received event id (=${n.id}) must be greater than stored last wallet event id (=${i}) `);return}n.event!=="connect"&&(yield this.connectionStorage.storeLastWalletEventId(n.id))}const r=this.listeners;n.event==="connect"&&(yield this.updateSession(n,t.from)),n.event==="disconnect"&&(Tn("Removing bridge and session: received disconnect event"),yield this.removeBridgeAndSession()),r.forEach(i=>i(n))})}gatewayErrorsListener(t){return xe(this,void 0,void 0,function*(){throw new Ie(`Bridge error ${JSON.stringify(t)}`)})}updateSession(t,n){return xe(this,void 0,void 0,function*(){this.session=Object.assign(Object.assign({},this.session),{walletPublicKey:n});const r=t.payload.items.find(o=>o.name==="ton_addr"),i=Object.assign(Object.assign({},t),{payload:Object.assign(Object.assign({},t.payload),{items:[r]})});yield this.connectionStorage.storeConnection({type:"http",session:this.session,lastWalletEventId:t.id,connectEvent:i,nextRpcRequestId:0})})}removeBridgeAndSession(){return xe(this,void 0,void 0,function*(){this.closeConnection(),yield this.connectionStorage.removeConnection()})}generateUniversalLink(t,n){return Ss(t)?this.generateTGUniversalLink(t,n):this.generateRegularUniversalLink(t,n)}generateRegularUniversalLink(t,n){const r=new URL(t);return r.searchParams.append("v",_3.toString()),r.searchParams.append("id",this.session.sessionCrypto.sessionId),r.searchParams.append("r",JSON.stringify(n)),r.toString()}generateTGUniversalLink(t,n){const i=this.generateRegularUniversalLink("about:blank",n).split("?")[1],o="tonconnect-"+x3(i),s=this.convertToDirectLink(t),a=new URL(s);return a.searchParams.append("startapp",o),a.toString()}convertToDirectLink(t){const n=new URL(t);return n.searchParams.has("attach")&&(n.searchParams.delete("attach"),n.pathname+="/start"),n.toString()}openGateways(t,n){return xe(this,void 0,void 0,function*(){if(Array.isArray(this.walletConnectionSource)){this.pendingGateways.map(r=>r.close().catch()),this.pendingGateways=this.walletConnectionSource.map(r=>{const i=new e1(this.storage,r.bridgeUrl,t.sessionId,()=>{},()=>{});return i.setListener(o=>this.pendingGatewaysListener(i,r.bridgeUrl,o)),i}),yield Promise.allSettled(this.pendingGateways.map(r=>Fl(i=>this.pendingGateways.some(o=>o===r)?r.registerSession({openingDeadlineMS:n==null?void 0:n.openingDeadlineMS,signal:i.signal}):r.close(),{attempts:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:n==null?void 0:n.signal})));return}else return this.gateway&&(Tn("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new e1(this.storage,this.walletConnectionSource.bridgeUrl,t.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),yield this.gateway.registerSession({openingDeadlineMS:n==null?void 0:n.openingDeadlineMS,signal:n==null?void 0:n.signal})})}closeGateways(t){var n;(n=this.gateway)===null||n===void 0||n.close(),this.pendingGateways.filter(r=>r!==(t==null?void 0:t.except)).forEach(r=>r.close()),this.pendingGateways=[]}}function L2(e,t){return C3(e,[t])}function C3(e,t){return!e||typeof e!="object"?!1:t.every(n=>n in e)}function K_(e){try{return!L2(e,"tonconnect")||!L2(e.tonconnect,"walletInfo")?!1:C3(e.tonconnect.walletInfo,["name","app_name","image","about_url","platforms"])}catch{return!1}}let q_=class _l{constructor(){this.storage={}}static getInstance(){return _l.instance||(_l.instance=new _l),_l.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(t){var n;return(n=this.storage[t])!==null&&n!==void 0?n:null}key(t){var n;const r=Object.keys(this.storage);return t<0||t>=r.length?null:(n=r[t])!==null&&n!==void 0?n:null}removeItem(t){delete this.storage[t]}setItem(t,n){this.storage[t]=n}};function Zd(){if(!(typeof window>"u"))return window}function G_(){const e=Zd();if(!e)return[];try{return Object.keys(e)}catch{return[]}}function Z_(){if(!(typeof document>"u"))return document}function Q_(){var e;const t=(e=Zd())===null||e===void 0?void 0:e.location.origin;return t?t+"/tonconnect-manifest.json":""}function J_(){if(X_())return localStorage;if(e9())throw new Ie("`localStorage` is unavailable, but it is required for TonConnect. For more details, see https://github.com/ton-connect/sdk/tree/main/packages/sdk#init-connector");return q_.getInstance()}function X_(){try{return typeof localStorage<"u"}catch{return!1}}function e9(){return typeof process<"u"&&process.versions!=null&&process.versions.node!=null}class mr{constructor(t,n){this.injectedWalletKey=n,this.type="injected",this.unsubscribeCallback=null,this.listenSubscriptions=!1,this.listeners=[];const r=mr.window;if(!mr.isWindowContainsWallet(r,n))throw new ig;this.connectionStorage=new wc(t),this.injectedWallet=r[n].tonconnect}static fromStorage(t){return xe(this,void 0,void 0,function*(){const r=yield new wc(t).getInjectedConnection();return new mr(t,r.jsBridgeKey)})}static isWalletInjected(t){return mr.isWindowContainsWallet(this.window,t)}static isInsideWalletBrowser(t){return mr.isWindowContainsWallet(this.window,t)?this.window[t].tonconnect.isWalletBrowser:!1}static getCurrentlyInjectedWallets(){return this.window?G_().filter(([r,i])=>K_(i)).map(([r,i])=>({name:i.tonconnect.walletInfo.name,appName:i.tonconnect.walletInfo.app_name,aboutUrl:i.tonconnect.walletInfo.about_url,imageUrl:i.tonconnect.walletInfo.image,tondns:i.tonconnect.walletInfo.tondns,jsBridgeKey:r,injected:!0,embedded:i.tonconnect.isWalletBrowser,platforms:i.tonconnect.walletInfo.platforms})):[]}static isWindowContainsWallet(t,n){return!!t&&n in t&&typeof t[n]=="object"&&"tonconnect"in t[n]}connect(t){this._connect(_3,t)}restoreConnection(){return xe(this,void 0,void 0,function*(){try{Tn("Injected Provider restoring connection...");const t=yield this.injectedWallet.restoreConnection();Tn("Injected Provider restoring connection response",t),t.event==="connect"?(this.makeSubscriptions(),this.listeners.forEach(n=>n(t))):yield this.connectionStorage.removeConnection()}catch(t){yield this.connectionStorage.removeConnection(),console.error(t)}})}closeConnection(){this.listenSubscriptions&&this.injectedWallet.disconnect(),this.closeAllListeners()}disconnect(){return xe(this,void 0,void 0,function*(){return new Promise(t=>{const n=()=>{this.closeAllListeners(),this.connectionStorage.removeConnection().then(t)};try{this.injectedWallet.disconnect(),n()}catch(r){Tn(r),this.sendRequest({method:"disconnect",params:[]},n)}})})}closeAllListeners(){var t;this.listenSubscriptions=!1,this.listeners=[],(t=this.unsubscribeCallback)===null||t===void 0||t.call(this)}listen(t){return this.listeners.push(t),()=>this.listeners=this.listeners.filter(n=>n!==t)}sendRequest(t,n){var r;return xe(this,void 0,void 0,function*(){const i={};typeof n=="function"?i.onRequestSent=n:(i.onRequestSent=n==null?void 0:n.onRequestSent,i.signal=n==null?void 0:n.signal);const o=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),Tn("Send injected-bridge request:",Object.assign(Object.assign({},t),{id:o}));const s=this.injectedWallet.send(Object.assign(Object.assign({},t),{id:o}));return s.then(a=>Tn("Wallet message received:",a)),(r=i==null?void 0:i.onRequestSent)===null||r===void 0||r.call(i),s})}_connect(t,n){return xe(this,void 0,void 0,function*(){try{Tn(`Injected Provider connect request: protocolVersion: ${t}, message:`,n);const r=yield this.injectedWallet.connect(t,n);Tn("Injected Provider connect response:",r),r.event==="connect"&&(yield this.updateSession(),this.makeSubscriptions()),this.listeners.forEach(i=>i(r))}catch(r){Tn("Injected Provider connect error:",r);const i={event:"connect_error",payload:{code:0,message:r==null?void 0:r.toString()}};this.listeners.forEach(o=>o(i))}})}makeSubscriptions(){this.listenSubscriptions=!0,this.unsubscribeCallback=this.injectedWallet.listen(t=>{Tn("Wallet message received:",t),this.listenSubscriptions&&this.listeners.forEach(n=>n(t)),t.event==="disconnect"&&this.disconnect()})}updateSession(){return this.connectionStorage.storeConnection({type:"injected",jsBridgeKey:this.injectedWalletKey,nextRpcRequestId:0})}}mr.window=Zd();class t9{constructor(){this.localStorage=J_()}getItem(t){return xe(this,void 0,void 0,function*(){return this.localStorage.getItem(t)})}removeItem(t){return xe(this,void 0,void 0,function*(){this.localStorage.removeItem(t)})}setItem(t,n){return xe(this,void 0,void 0,function*(){this.localStorage.setItem(t,n)})}}function ks(e){return n9(e)&&e.injected}function Qd(e){return ks(e)&&e.embedded}function n9(e){return"jsBridgeKey"in e}function sg(e){return"bridgeUrl"in e}const r9=[{app_name:"telegram-wallet",name:"Wallet",image:"https://wallet.tg/images/logo-288.png",about_url:"https://wallet.tg/",universal_url:"https://t.me/wallet?attach=wallet",bridge:[{type:"sse",url:"https://bridge.tonapi.io/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"tonkeeper",name:"Tonkeeper",image:"https://tonkeeper.com/assets/tonconnect-icon.png",tondns:"tonkeeper.ton",about_url:"https://tonkeeper.com",universal_url:"https://app.tonkeeper.com/ton-connect",deepLink:"tonkeeper-tc://",bridge:[{type:"sse",url:"https://bridge.tonapi.io/bridge"},{type:"js",key:"tonkeeper"}],platforms:["ios","android","chrome","firefox","macos"]},{app_name:"mytonwallet",name:"MyTonWallet",image:"https://mytonwallet.io/icon-256.png",about_url:"https://mytonwallet.io",universal_url:"https://connect.mytonwallet.org",bridge:[{type:"js",key:"mytonwallet"},{type:"sse",url:"https://tonconnectbridge.mytonwallet.org/bridge/"}],platforms:["chrome","windows","macos","linux","ios","android","firefox"]},{app_name:"openmask",name:"OpenMask",image:"https://raw.githubusercontent.com/OpenProduct/openmask-extension/main/public/openmask-logo-288.png",about_url:"https://www.openmask.app/",bridge:[{type:"js",key:"openmask"}],platforms:["chrome"]},{app_name:"tonhub",name:"Tonhub",image:"https://tonhub.com/tonconnect_logo.png",about_url:"https://tonhub.com",universal_url:"https://tonhub.com/ton-connect",bridge:[{type:"js",key:"tonhub"},{type:"sse",url:"https://connect.tonhubapi.com/tonconnect"}],platforms:["ios","android"]},{app_name:"dewallet",name:"DeWallet",image:"https://app.delabwallet.com/logo_black.png",about_url:"https://delabwallet.com",bridge:[{type:"js",key:"dewallet"}],platforms:["chrome"]},{app_name:"xtonwallet",name:"XTONWallet",image:"https://xtonwallet.com/assets/img/icon-256-back.png",about_url:"https://xtonwallet.com",bridge:[{type:"js",key:"xtonwallet"}],platforms:["chrome","firefox"]},{app_name:"tonwallet",name:"TON Wallet",image:"https://wallet.ton.org/assets/ui/qr-logo.png",about_url:"https://chrome.google.com/webstore/detail/ton-wallet/nphplpgoakhhjchkkhmiggakijnkhfnd",bridge:[{type:"js",key:"tonwallet"}],platforms:["chrome"]}];class S0{constructor(t){this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null,this.walletsListSource="https://raw.githubusercontent.com/ton-blockchain/wallets-list/main/wallets-v2.json",t!=null&&t.walletsListSource&&(this.walletsListSource=t.walletsListSource),t!=null&&t.cacheTTLMs&&(this.cacheTTLMs=t.cacheTTLMs)}getWallets(){return xe(this,void 0,void 0,function*(){return this.cacheTTLMs&&this.walletsListCacheCreationTimestamp&&Date.now()>this.walletsListCacheCreationTimestamp+this.cacheTTLMs&&(this.walletsListCache=null),this.walletsListCache||(this.walletsListCache=this.fetchWalletsList(),this.walletsListCache.then(()=>{this.walletsListCacheCreationTimestamp=Date.now()}).catch(()=>{this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null})),this.walletsListCache})}getEmbeddedWallet(){return xe(this,void 0,void 0,function*(){const n=(yield this.getWallets()).filter(Qd);return n.length!==1?null:n[0]})}fetchWalletsList(){return xe(this,void 0,void 0,function*(){let t=[];try{if(t=yield(yield fetch(this.walletsListSource)).json(),!Array.isArray(t))throw new og("Wrong wallets list format, wallets list must be an array.");const i=t.filter(o=>!this.isCorrectWalletConfigDTO(o));i.length&&(ki(`Wallet(s) ${i.map(o=>o.name).join(", ")} config format is wrong. They were removed from the wallets list.`),t=t.filter(o=>this.isCorrectWalletConfigDTO(o)))}catch(r){ki(r),t=r9}let n=[];try{n=mr.getCurrentlyInjectedWallets()}catch(r){ki(r)}return this.mergeWalletsLists(this.walletConfigDTOListToWalletConfigList(t),n)})}walletConfigDTOListToWalletConfigList(t){return t.map(n=>{const i={name:n.name,appName:n.app_name,imageUrl:n.image,aboutUrl:n.about_url,tondns:n.tondns,platforms:n.platforms};return n.bridge.forEach(o=>{if(o.type==="sse"&&(i.bridgeUrl=o.url,i.universalLink=n.universal_url,i.deepLink=n.deepLink),o.type==="js"){const s=o.key;i.jsBridgeKey=s,i.injected=mr.isWalletInjected(s),i.embedded=mr.isInsideWalletBrowser(s)}}),i})}mergeWalletsLists(t,n){return[...new Set(t.concat(n).map(i=>i.name)).values()].map(i=>{const o=t.find(a=>a.name===i),s=n.find(a=>a.name===i);return Object.assign(Object.assign({},o&&Object.assign({},o)),s&&Object.assign({},s))})}isCorrectWalletConfigDTO(t){if(!t||typeof t!="object")return!1;const n="name"in t,r="app_name"in t,i="image"in t,o="about_url"in t,s="platforms"in t;if(!n||!i||!o||!s||!r||!t.platforms||!Array.isArray(t.platforms)||!t.platforms.length||!("bridge"in t)||!Array.isArray(t.bridge)||!t.bridge.length)return!1;const a=t.bridge;if(a.some(u=>!u||typeof u!="object"||!("type"in u)))return!1;const l=a.find(u=>u.type==="sse");if(l&&(!("url"in l)||!l.url||!t.universal_url))return!1;const c=a.find(u=>u.type==="js");return!(c&&(!("key"in c)||!c.key))}}class Gf extends Ie{get info(){return"Wallet doesn't support requested feature method."}constructor(...t){super(...t),Object.setPrototypeOf(this,Gf.prototype)}}function i9(e,t){const n=e.includes("SendTransaction"),r=e.find(i=>i&&typeof i=="object"&&i.name==="SendTransaction");if(!n&&!r)throw new Gf("Wallet doesn't support SendTransaction feature.");if(r&&r.maxMessages!==void 0){if(r.maxMessages{var a,l;return{address:(a=s.address)!==null&&a!==void 0?a:null,amount:(l=s.amount)!==null&&l!==void 0?l:null}})}}function O3(e,t,n){return Object.assign(Object.assign({type:"transaction-sent-for-signature"},Ya(e,t)),ag(t,n))}function R3(e,t,n,r){return Object.assign(Object.assign({type:"transaction-signed",is_success:!0,signed_transaction:r.boc},Ya(e,t)),ag(t,n))}function D3(e,t,n,r,i){return Object.assign(Object.assign({type:"transaction-signing-failed",is_success:!1,error_message:r,error_code:i??null},Ya(e,t)),ag(t,n))}function I3(e,t,n){return Object.assign({type:"disconnection",scope:n},Ya(e,t))}class N3{constructor(){this.window=Zd()}dispatchEvent(t,n){var r;return xe(this,void 0,void 0,function*(){const i=new CustomEvent(t,{detail:n});(r=this.window)===null||r===void 0||r.dispatchEvent(i)})}addEventListener(t,n,r){var i;return xe(this,void 0,void 0,function*(){return(i=this.window)===null||i===void 0||i.addEventListener(t,n,r),()=>{var o;return(o=this.window)===null||o===void 0?void 0:o.removeEventListener(t,n)}})}}class o9{constructor(t){var n;this.eventPrefix="ton-connect-",this.tonConnectUiVersion=null,this.eventDispatcher=(n=t==null?void 0:t.eventDispatcher)!==null&&n!==void 0?n:new N3,this.tonConnectSdkVersion=t.tonConnectSdkVersion,this.init().catch()}get version(){return js({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return xe(this,void 0,void 0,function*(){try{yield this.setRequestVersionHandler(),this.tonConnectUiVersion=yield this.requestTonConnectUiVersion()}catch{}})}setRequestVersionHandler(){return xe(this,void 0,void 0,function*(){yield this.eventDispatcher.addEventListener("ton-connect-request-version",()=>xe(this,void 0,void 0,function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-response-version",k3(this.tonConnectSdkVersion))}))})}requestTonConnectUiVersion(){return xe(this,void 0,void 0,function*(){return new Promise((t,n)=>xe(this,void 0,void 0,function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-ui-response-version",r=>{t(r.detail.version)},{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-ui-request-version",S3())}catch(r){n(r)}}))})}dispatchUserActionEvent(t){try{this.eventDispatcher.dispatchEvent(`${this.eventPrefix}${t.type}`,t).catch()}catch{}}trackConnectionStarted(...t){try{const n=E3(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionCompleted(...t){try{const n=M3(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionError(...t){try{const n=T3(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionRestoringStarted(...t){try{const n=P3(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionRestoringCompleted(...t){try{const n=A3(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionRestoringError(...t){try{const n=L3(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackDisconnection(...t){try{const n=I3(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackTransactionSentForSignature(...t){try{const n=O3(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackTransactionSigned(...t){try{const n=R3(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackTransactionSigningFailed(...t){try{const n=D3(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}}const s9="3.0.3";class Ns{constructor(t){if(this.walletsList=new S0,this._wallet=null,this.provider=null,this.statusChangeSubscriptions=[],this.statusChangeErrorSubscriptions=[],this.dappSettings={manifestUrl:(t==null?void 0:t.manifestUrl)||Q_(),storage:(t==null?void 0:t.storage)||new t9},this.walletsList=new S0({walletsListSource:t==null?void 0:t.walletsListSource,cacheTTLMs:t==null?void 0:t.walletsListCacheTTLMs}),this.tracker=new o9({eventDispatcher:t==null?void 0:t.eventDispatcher,tonConnectSdkVersion:s9}),!this.dappSettings.manifestUrl)throw new ng("Dapp tonconnect-manifest.json must be specified if window.location.origin is undefined. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest");this.bridgeConnectionStorage=new wc(this.dappSettings.storage),t!=null&&t.disableAutoPauseConnection||this.addWindowFocusAndBlurSubscriptions()}static getWallets(){return this.walletsList.getWallets()}get connected(){return this._wallet!==null}get account(){var t;return((t=this._wallet)===null||t===void 0?void 0:t.account)||null}get wallet(){return this._wallet}set wallet(t){this._wallet=t,this.statusChangeSubscriptions.forEach(n=>n(this._wallet))}getWallets(){return this.walletsList.getWallets()}onStatusChange(t,n){return this.statusChangeSubscriptions.push(t),n&&this.statusChangeErrorSubscriptions.push(n),()=>{this.statusChangeSubscriptions=this.statusChangeSubscriptions.filter(r=>r!==t),n&&(this.statusChangeErrorSubscriptions=this.statusChangeErrorSubscriptions.filter(r=>r!==n))}}connect(t,n){var r,i;const o={};if(typeof n=="object"&&"tonProof"in n&&(o.request=n),typeof n=="object"&&("openingDeadlineMS"in n||"signal"in n||"request"in n)&&(o.request=n==null?void 0:n.request,o.openingDeadlineMS=n==null?void 0:n.openingDeadlineMS,o.signal=n==null?void 0:n.signal),this.connected)throw new rg;const s=ni(o==null?void 0:o.signal);if((r=this.abortController)===null||r===void 0||r.abort(),this.abortController=s,s.signal.aborted)throw new Ie("Connection was aborted");return(i=this.provider)===null||i===void 0||i.closeConnection(),this.provider=this.createProvider(t),s.signal.addEventListener("abort",()=>{var a;(a=this.provider)===null||a===void 0||a.closeConnection(),this.provider=null}),this.tracker.trackConnectionStarted(),this.provider.connect(this.createConnectRequest(o==null?void 0:o.request),{openingDeadlineMS:o==null?void 0:o.openingDeadlineMS,signal:s.signal})}restoreConnection(t){var n,r;return xe(this,void 0,void 0,function*(){this.tracker.trackConnectionRestoringStarted();const i=ni(t==null?void 0:t.signal);if((n=this.abortController)===null||n===void 0||n.abort(),this.abortController=i,i.signal.aborted){this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}const[o,s]=yield Promise.all([this.bridgeConnectionStorage.storedConnectionType(),this.walletsList.getEmbeddedWallet()]);if(i.signal.aborted){this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}let a=null;try{switch(o){case"http":a=yield xc.fromStorage(this.dappSettings.storage);break;case"injected":a=yield mr.fromStorage(this.dappSettings.storage);break;default:if(s)a=this.createProvider(s);else return}}catch{this.tracker.trackConnectionRestoringError("Provider is not restored"),yield this.bridgeConnectionStorage.removeConnection(),a==null||a.closeConnection(),a=null;return}if(i.signal.aborted){a==null||a.closeConnection(),this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}if(!a){ki("Provider is not restored"),this.tracker.trackConnectionRestoringError("Provider is not restored");return}(r=this.provider)===null||r===void 0||r.closeConnection(),this.provider=a,a.listen(this.walletEventsListener.bind(this));const l=()=>{this.tracker.trackConnectionRestoringError("Connection restoring was aborted"),a==null||a.closeConnection(),a=null};return i.signal.addEventListener("abort",l),yield Fl(c=>xe(this,void 0,void 0,function*(){yield a==null?void 0:a.restoreConnection({openingDeadlineMS:t==null?void 0:t.openingDeadlineMS,signal:c.signal}),i.signal.removeEventListener("abort",l),this.connected?this.tracker.trackConnectionRestoringCompleted(this.wallet):this.tracker.trackConnectionRestoringError("Connection restoring failed")}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:t==null?void 0:t.signal})})}sendTransaction(t,n){return xe(this,void 0,void 0,function*(){const r={};typeof n=="function"?r.onRequestSent=n:(r.onRequestSent=n==null?void 0:n.onRequestSent,r.signal=n==null?void 0:n.signal);const i=ni(r==null?void 0:r.signal);if(i.signal.aborted)throw new Ie("Transaction sending was aborted");this.checkConnection(),i9(this.wallet.device.features,{requiredMessagesNumber:t.messages.length}),this.tracker.trackTransactionSentForSignature(this.wallet,t);const{validUntil:o}=t,s=I_(t,["validUntil"]),a=t.from||this.account.address,l=t.network||this.account.chain,c=yield this.provider.sendRequest(Eu.convertToRpcRequest(Object.assign(Object.assign({},s),{valid_until:o,from:a,network:l})),{onRequestSent:r.onRequestSent,signal:i.signal});if(Eu.isError(c))return this.tracker.trackTransactionSigningFailed(this.wallet,t,c.error.message,c.error.code),Eu.parseAndThrowError(c);const u=Eu.convertFromRpcResponse(c);return this.tracker.trackTransactionSigned(this.wallet,t,u),u})}disconnect(t){var n;return xe(this,void 0,void 0,function*(){if(!this.connected)throw new Kf;const r=ni(t==null?void 0:t.signal),i=this.abortController;if(this.abortController=r,r.signal.aborted)throw new Ie("Disconnect was aborted");this.onWalletDisconnected("dapp"),yield(n=this.provider)===null||n===void 0?void 0:n.disconnect({signal:r.signal}),i==null||i.abort()})}pauseConnection(){var t;((t=this.provider)===null||t===void 0?void 0:t.type)==="http"&&this.provider.pause()}unPauseConnection(){var t;return((t=this.provider)===null||t===void 0?void 0:t.type)!=="http"?Promise.resolve():this.provider.unPause()}addWindowFocusAndBlurSubscriptions(){const t=Z_();if(t)try{t.addEventListener("visibilitychange",()=>{t.hidden?this.pauseConnection():this.unPauseConnection().catch()})}catch(n){ki("Cannot subscribe to the document.visibilitychange: ",n)}}createProvider(t){let n;return!Array.isArray(t)&&N_(t)?n=new mr(this.dappSettings.storage,t.jsBridgeKey):n=new xc(this.dappSettings.storage,t),n.listen(this.walletEventsListener.bind(this)),n}walletEventsListener(t){switch(t.event){case"connect":this.onWalletConnected(t.payload);break;case"connect_error":this.onWalletConnectError(t.payload);break;case"disconnect":this.onWalletDisconnected("wallet")}}onWalletConnected(t){const n=t.items.find(o=>o.name==="ton_addr"),r=t.items.find(o=>o.name==="ton_proof");if(!n)throw new Ie("ton_addr connection item was not found");const i={device:t.device,provider:this.provider.type,account:{address:n.address,chain:n.network,walletStateInit:n.walletStateInit,publicKey:n.publicKey}};r&&(i.connectItems={tonProof:r}),this.wallet=i,this.tracker.trackConnectionCompleted(i)}onWalletConnectError(t){const n=$_.parseError(t);if(this.statusChangeErrorSubscriptions.forEach(r=>r(n)),Tn(n),this.tracker.trackConnectionError(t.message,t.code),n instanceof Yd||n instanceof Vd)throw ki(n),n}onWalletDisconnected(t){this.tracker.trackDisconnection(this.wallet,t),this.wallet=null}checkConnection(){if(!this.connected)throw new Kf}createConnectRequest(t){const n=[{name:"ton_addr"}];return t!=null&&t.tonProof&&n.push({name:"ton_proof",payload:t.tonProof}),{manifestUrl:this.dappSettings.manifestUrl,items:n}}}Ns.walletsList=new S0;Ns.isWalletInjected=e=>mr.isWalletInjected(e);Ns.isInsideWalletBrowser=e=>mr.isInsideWalletBrowser(e);const a9=81,l9=128;function W3(e,t=!1){const{wc:n,hex:r}=c9(e);let i=a9;t&&(i|=l9);const o=new Int8Array(34);o[0]=i,o[1]=n,o.set(r,2);const s=new Uint8Array(36);return s.set(o),s.set(u9(o),34),tg.encode(s).replace(/\+/g,"-").replace(/\//g,"_")}function c9(e){if(!e.includes(":"))throw new ha(`Wrong address ${e}. Address must include ":".`);const t=e.split(":");if(t.length!==2)throw new ha(`Wrong address ${e}. Address must include ":" only once.`);const n=parseInt(t[0]);if(n!==0&&n!==-1)throw new ha(`Wrong address ${e}. WC must be eq 0 or -1, but ${n} received.`);const r=t[1];if((r==null?void 0:r.length)!==64)throw new ha(`Wrong address ${e}. Hex part must be 64bytes length, but ${r==null?void 0:r.length} received.`);return{wc:n,hex:f9(r)}}function u9(e){let n=0;const r=new Uint8Array(e.length+2);r.set(e);for(let i of r){let o=128;for(;o>0;)n<<=1,i&o&&(n+=1),o>>=1,n>65535&&(n&=65535,n^=4129)}return new Uint8Array([Math.floor(n/256),n%256])}const k0={};for(let e=0;e<=255;e++){let t=e.toString(16);t.length<2&&(t="0"+t),k0[t]=e}function f9(e){e=e.toLowerCase();const t=e.length;if(t%2!==0)throw new qf("Hex string must have length a multiple of 2: "+e);const n=t/2,r=new Uint8Array(n);for(let i=0;i0?wt.length===2?typeof wt[1]==a?this[wt[0]]=wt[1].call(this,Fn):this[wt[0]]=wt[1]:wt.length===3?typeof wt[1]===a&&!(wt[1].exec&&wt[1].test)?this[wt[0]]=Fn?wt[1].call(this,Fn,wt[2]):r:this[wt[0]]=Fn?Fn.replace(wt[1],wt[2]):r:wt.length===4&&(this[wt[0]]=Fn?wt[3].call(this,Fn.replace(wt[1],wt[2])):r):this[wt]=Fn||r;He+=2}},We=function(Ue,yt){for(var He in yt)if(typeof yt[He]===c&&yt[He].length>0){for(var Pt=0;Pt2&&(Re[h]="iPad",Re[m]=M),Re},this.getEngine=function(){var Re={};return Re[g]=r,Re[k]=r,Dt.call(Re,Pt,hr.engine),Re},this.getOS=function(){var Re={};return Re[g]=r,Re[k]=r,Dt.call(Re,Pt,hr.os),wt&&!Re[g]&&Rn&&Rn.platform&&Rn.platform!="Unknown"&&(Re[g]=Rn.platform.replace(/chrome os/i,q).replace(/macos/i,B)),Re},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Pt},this.setUA=function(Re){return Pt=typeof Re===u&&Re.length>P?Xe(Re,P):Re,this},this.setUA(Pt),this};_n.VERSION=i,_n.BROWSER=ne([g,k,d]),_n.CPU=ne([C]),_n.DEVICE=ne([h,y,m,v,w,E,M,O,T]),_n.ENGINE=_n.OS=ne([g,k]),e.exports&&(t=e.exports=_n),t.UAParser=_n;var En=typeof n!==l&&(n.jQuery||n.Zepto);if(En&&!En.ua){var ir=new _n;En.ua=ir.getResult(),En.ua.get=function(){return ir.getUA()},En.ua.set=function(Ue){ir.setUA(Ue);var yt=ir.getResult();for(var He in yt)En.ua[He]=yt[He]}}})(typeof window=="object"?window:iw)})(E0,E0.exports);var d9=E0.exports;const h9=ja(d9);var p9=function(t){return g9(t)&&!m9(t)};function g9(e){return!!e&&typeof e=="object"}function m9(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||w9(e)}var v9=typeof Symbol=="function"&&Symbol.for,y9=v9?Symbol.for("react.element"):60103;function w9(e){return e.$$typeof===y9}function x9(e){return Array.isArray(e)?[]:{}}function bc(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Ia(x9(e),e,t):e}function b9(e,t,n){return e.concat(t).map(function(r){return bc(r,n)})}function _9(e,t){if(!t.customMerge)return Ia;var n=t.customMerge(e);return typeof n=="function"?n:Ia}function C9(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function O2(e){return Object.keys(e).concat(C9(e))}function $3(e,t){try{return t in e}catch{return!1}}function S9(e,t){return $3(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function k9(e,t,n){var r={};return n.isMergeableObject(e)&&O2(e).forEach(function(i){r[i]=bc(e[i],n)}),O2(t).forEach(function(i){S9(e,i)||($3(e,i)&&n.isMergeableObject(t[i])?r[i]=_9(i,n)(e[i],t[i],n):r[i]=bc(t[i],n))}),r}function Ia(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||b9,n.isMergeableObject=n.isMergeableObject||p9,n.cloneUnlessOtherwiseSpecified=bc;var r=Array.isArray(t),i=Array.isArray(e),o=r===i;return o?r?n.arrayMerge(e,t,n):k9(e,t,n):bc(t,n)}Ia.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return Ia(r,i,n)},{})};var E9=Ia,M9=E9;const T9=ja(M9);var U3={exports:{}};/*! +`+t:""}`,Object.setPrototypeOf(this,Ie.prototype)}get info(){return""}}Ie.prefix="[TON_CONNECT_SDK_ERROR]";class ng extends Ie{get info(){return"Passed DappMetadata is in incorrect format."}constructor(...t){super(...t),Object.setPrototypeOf(this,ng.prototype)}}class Vd extends Ie{get info(){return"Passed `tonconnect-manifest.json` contains errors. Check format of your manifest. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest"}constructor(...t){super(...t),Object.setPrototypeOf(this,Vd.prototype)}}class Yd extends Ie{get info(){return"Manifest not found. Make sure you added `tonconnect-manifest.json` to the root of your app or passed correct manifestUrl. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest"}constructor(...t){super(...t),Object.setPrototypeOf(this,Yd.prototype)}}class rg extends Ie{get info(){return"Wallet connection called but wallet already connected. To avoid the error, disconnect the wallet before doing a new connection."}constructor(...t){super(...t),Object.setPrototypeOf(this,rg.prototype)}}class Kf extends Ie{get info(){return"Send transaction or other protocol methods called while wallet is not connected."}constructor(...t){super(...t),Object.setPrototypeOf(this,Kf.prototype)}}function N_(e){return"jsBridgeKey"in e}class Kd extends Ie{get info(){return"User rejects the action in the wallet."}constructor(...t){super(...t),Object.setPrototypeOf(this,Kd.prototype)}}class qd extends Ie{get info(){return"Request to the wallet contains errors."}constructor(...t){super(...t),Object.setPrototypeOf(this,qd.prototype)}}class Gd extends Ie{get info(){return"App tries to send rpc request to the injected wallet while not connected."}constructor(...t){super(...t),Object.setPrototypeOf(this,Gd.prototype)}}class ig extends Ie{get info(){return"There is an attempt to connect to the injected wallet while it is not exists in the webpage."}constructor(...t){super(...t),Object.setPrototypeOf(this,ig.prototype)}}class og extends Ie{get info(){return"An error occurred while fetching the wallets list."}constructor(...t){super(...t),Object.setPrototypeOf(this,og.prototype)}}class ha extends Ie{get info(){return"Passed address is in incorrect format."}constructor(...t){super(...t),Object.setPrototypeOf(this,ha.prototype)}}class qf extends Ie{get info(){return"Passed hex is in incorrect format."}constructor(...t){super(...t),Object.setPrototypeOf(this,qf.prototype)}}class qo extends Ie{constructor(...t){super(...t),Object.setPrototypeOf(this,qo.prototype)}}const P2={[_o.UNKNOWN_ERROR]:qo,[_o.USER_REJECTS_ERROR]:Kd,[_o.BAD_REQUEST_ERROR]:qd,[_o.UNKNOWN_APP_ERROR]:Gd,[_o.MANIFEST_NOT_FOUND_ERROR]:Yd,[_o.MANIFEST_CONTENT_ERROR]:Vd};class W_{parseError(t){let n=qo;return t.code in P2&&(n=P2[t.code]||qo),new n(t.message)}}const $_=new W_;class U_{isError(t){return"error"in t}}const A2={[da.UNKNOWN_ERROR]:qo,[da.USER_REJECTS_ERROR]:Kd,[da.BAD_REQUEST_ERROR]:qd,[da.UNKNOWN_APP_ERROR]:Gd};class F_ extends U_{convertToRpcRequest(t){return{method:"sendTransaction",params:[JSON.stringify(t)]}}parseAndThrowError(t){let n=qo;throw t.error.code in A2&&(n=A2[t.error.code]||qo),new n(t.error.message)}convertFromRpcResponse(t){return{boc:t.result}}}const Eu=new F_;class B_{constructor(t,n){this.storage=t,this.storeKey="ton-connect-storage_http-bridge-gateway::"+n}storeLastEventId(t){return xe(this,void 0,void 0,function*(){return this.storage.setItem(this.storeKey,t)})}removeLastEventId(){return xe(this,void 0,void 0,function*(){return this.storage.removeItem(this.storeKey)})}getLastEventId(){return xe(this,void 0,void 0,function*(){const t=yield this.storage.getItem(this.storeKey);return t||null})}}function j_(e){return e.slice(-1)==="/"?e.slice(0,-1):e}function w3(e,t){return j_(e)+"/"+t}function Ss(e){if(!e)return!1;const t=new URL(e);return t.protocol==="tg:"||t.hostname==="t.me"}function x3(e){return e.replaceAll(".","%2E").replaceAll("-","%2D").replaceAll("_","%5F").replaceAll("&","-").replaceAll("=","__").replaceAll("%","--")}function b3(e,t){return xe(this,void 0,void 0,function*(){return new Promise((n,r)=>{var i,o;if(!((i=void 0)===null||i===void 0)&&i.aborted){r(new Ie("Delay aborted"));return}const s=setTimeout(()=>n(),e);(o=void 0)===null||o===void 0||o.addEventListener("abort",()=>{clearTimeout(s),r(new Ie("Delay aborted"))})})})}function ni(e){const t=new AbortController;return e!=null&&e.aborted?t.abort():e==null||e.addEventListener("abort",()=>t.abort(),{once:!0}),t}function Fl(e,t){var n,r;return xe(this,void 0,void 0,function*(){const i=(n=t==null?void 0:t.attempts)!==null&&n!==void 0?n:10,o=(r=t==null?void 0:t.delayMs)!==null&&r!==void 0?r:200,s=ni(t==null?void 0:t.signal);if(typeof e!="function")throw new Ie(`Expected a function, got ${typeof e}`);let a=0,l;for(;axe(this,void 0,void 0,function*(){if(o=d??null,s==null||s.abort(),s=ni(d),s.signal.aborted)throw new Ie("Resource creation was aborted");r=h??null;const g=e(s.signal,...h);i=g;const m=yield g;if(i!==g&&m!==n)throw yield t(m),new Ie("Resource creation was aborted by a new resource creation");return n=m,n});return{create:a,current:()=>n??null,dispose:()=>xe(this,void 0,void 0,function*(){try{const d=n;n=null;const h=i;i=null;try{s==null||s.abort()}catch{}yield Promise.allSettled([d?t(d):Promise.resolve(),h?t(yield h):Promise.resolve()])}catch{}}),recreate:d=>xe(this,void 0,void 0,function*(){const h=n,g=i,m=r,y=o;if(yield b3(d),h===n&&g===i&&m===r&&y===o)return yield a(o,...m??[]);throw new Ie("Resource recreation was aborted by a new resource creation")})}}function V_(e,t){const n=t==null?void 0:t.timeout,r=t==null?void 0:t.signal,i=ni(r);return new Promise((o,s)=>{if(i.signal.aborted){s(new Ie("Operation aborted"));return}let a;typeof n<"u"&&(a=setTimeout(()=>{i.abort(),s(new Ie(`Timeout after ${n}ms`))},n)),i.signal.addEventListener("abort",()=>{clearTimeout(a),s(new Ie("Operation aborted"))},{once:!0});const l={timeout:n,abort:i.signal};e(o,s,l).finally(()=>clearTimeout(a))})}class e1{constructor(t,n,r,i,o){this.bridgeUrl=n,this.sessionId=r,this.listener=i,this.errorsListener=o,this.ssePath="events",this.postPath="message",this.heartbeatMessage="heartbeat",this.defaultTtl=300,this.defaultReconnectDelay=5e3,this.eventSource=z_((s,a)=>xe(this,void 0,void 0,function*(){const l={bridgeUrl:this.bridgeUrl,ssePath:this.ssePath,sessionId:this.sessionId,bridgeGatewayStorage:this.bridgeGatewayStorage,errorHandler:this.errorsHandler.bind(this),messageHandler:this.messagesHandler.bind(this),signal:s,openingDeadlineMS:a};return yield Y_(l)}),s=>xe(this,void 0,void 0,function*(){s.close()})),this.bridgeGatewayStorage=new B_(t,n)}get isReady(){const t=this.eventSource.current();return(t==null?void 0:t.readyState)===EventSource.OPEN}get isClosed(){const t=this.eventSource.current();return(t==null?void 0:t.readyState)!==EventSource.OPEN}get isConnecting(){const t=this.eventSource.current();return(t==null?void 0:t.readyState)===EventSource.CONNECTING}registerSession(t){return xe(this,void 0,void 0,function*(){yield this.eventSource.create(t==null?void 0:t.signal,t==null?void 0:t.openingDeadlineMS)})}send(t,n,r,i){var o;return xe(this,void 0,void 0,function*(){const s={};typeof i=="number"?s.ttl=i:(s.ttl=i==null?void 0:i.ttl,s.signal=i==null?void 0:i.signal,s.attempts=i==null?void 0:i.attempts);const a=new URL(w3(this.bridgeUrl,this.postPath));a.searchParams.append("client_id",this.sessionId),a.searchParams.append("to",n),a.searchParams.append("ttl",((s==null?void 0:s.ttl)||this.defaultTtl).toString()),a.searchParams.append("topic",r);const l=tg.encode(t);yield Fl(c=>xe(this,void 0,void 0,function*(){const u=yield this.post(a,l,c.signal);if(!u.ok)throw new Ie(`Bridge send failed, status ${u.status}`)}),{attempts:(o=s==null?void 0:s.attempts)!==null&&o!==void 0?o:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:s==null?void 0:s.signal})})}pause(){this.eventSource.dispose().catch(t=>ki(`Bridge pause failed, ${t}`))}unPause(){return xe(this,void 0,void 0,function*(){yield this.eventSource.recreate(0)})}close(){return xe(this,void 0,void 0,function*(){yield this.eventSource.dispose().catch(t=>ki(`Bridge close failed, ${t}`))})}setListener(t){this.listener=t}setErrorsListener(t){this.errorsListener=t}post(t,n,r){return xe(this,void 0,void 0,function*(){const i=yield fetch(t,{method:"post",body:n,signal:r});if(!i.ok)throw new Ie(`Bridge send failed, status ${i.status}`);return i})}errorsHandler(t,n){return xe(this,void 0,void 0,function*(){if(this.isConnecting){ki("Bridge error",JSON.stringify(n));return}if(this.isReady){try{this.errorsListener(n)}catch{}return}if(this.isClosed)return t.close(),Tn(`Bridge reconnecting, ${this.defaultReconnectDelay}ms delay`),yield this.eventSource.recreate(this.defaultReconnectDelay);throw new Ie("Bridge error, unknown state")})}messagesHandler(t){return xe(this,void 0,void 0,function*(){if(t.data===this.heartbeatMessage||(yield this.bridgeGatewayStorage.storeLastEventId(t.lastEventId),this.isClosed))return;let n;try{n=JSON.parse(t.data)}catch(r){throw new Ie(`Bridge message parse failed, message ${r.data}`)}this.listener(n)})}}function Y_(e){return xe(this,void 0,void 0,function*(){return yield V_((t,n,r)=>xe(this,void 0,void 0,function*(){var i;const s=ni(r.signal).signal;if(s.aborted){n(new Ie("Bridge connection aborted"));return}const a=new URL(w3(e.bridgeUrl,e.ssePath));a.searchParams.append("client_id",e.sessionId);const l=yield e.bridgeGatewayStorage.getLastEventId();if(l&&a.searchParams.append("last_event_id",l),s.aborted){n(new Ie("Bridge connection aborted"));return}const c=new EventSource(a.toString());c.onerror=u=>xe(this,void 0,void 0,function*(){if(s.aborted){c.close(),n(new Ie("Bridge connection aborted"));return}try{const d=yield e.errorHandler(c,u);d!==c&&c.close(),d&&d!==c&&t(d)}catch(d){c.close(),n(d)}}),c.onopen=()=>{if(s.aborted){c.close(),n(new Ie("Bridge connection aborted"));return}t(c)},c.onmessage=u=>{if(s.aborted){c.close(),n(new Ie("Bridge connection aborted"));return}e.messageHandler(u)},(i=e.signal)===null||i===void 0||i.addEventListener("abort",()=>{c.close(),n(new Ie("Bridge connection aborted"))})}),{timeout:e.openingDeadlineMS,signal:e.signal})})}function Bl(e){return!("connectEvent"in e)}class wc{constructor(t){this.storage=t,this.storeKey="ton-connect-storage_bridge-connection"}storeConnection(t){return xe(this,void 0,void 0,function*(){if(t.type==="injected")return this.storage.setItem(this.storeKey,JSON.stringify(t));if(!Bl(t)){const r={sessionKeyPair:t.session.sessionCrypto.stringifyKeypair(),walletPublicKey:t.session.walletPublicKey,bridgeUrl:t.session.bridgeUrl},i={type:"http",connectEvent:t.connectEvent,session:r,lastWalletEventId:t.lastWalletEventId,nextRpcRequestId:t.nextRpcRequestId};return this.storage.setItem(this.storeKey,JSON.stringify(i))}const n={type:"http",connectionSource:t.connectionSource,sessionCrypto:t.sessionCrypto.stringifyKeypair()};return this.storage.setItem(this.storeKey,JSON.stringify(n))})}removeConnection(){return xe(this,void 0,void 0,function*(){return this.storage.removeItem(this.storeKey)})}getConnection(){return xe(this,void 0,void 0,function*(){const t=yield this.storage.getItem(this.storeKey);if(!t)return null;const n=JSON.parse(t);if(n.type==="injected")return n;if("connectEvent"in n){const r=new C0(n.session.sessionKeyPair);return{type:"http",connectEvent:n.connectEvent,lastWalletEventId:n.lastWalletEventId,nextRpcRequestId:n.nextRpcRequestId,session:{sessionCrypto:r,bridgeUrl:n.session.bridgeUrl,walletPublicKey:n.session.walletPublicKey}}}return{type:"http",sessionCrypto:new C0(n.sessionCrypto),connectionSource:n.connectionSource}})}getHttpConnection(){return xe(this,void 0,void 0,function*(){const t=yield this.getConnection();if(!t)throw new Ie("Trying to read HTTP connection source while nothing is stored");if(t.type==="injected")throw new Ie("Trying to read HTTP connection source while injected connection is stored");return t})}getHttpPendingConnection(){return xe(this,void 0,void 0,function*(){const t=yield this.getConnection();if(!t)throw new Ie("Trying to read HTTP connection source while nothing is stored");if(t.type==="injected")throw new Ie("Trying to read HTTP connection source while injected connection is stored");if(!Bl(t))throw new Ie("Trying to read HTTP-pending connection while http connection is stored");return t})}getInjectedConnection(){return xe(this,void 0,void 0,function*(){const t=yield this.getConnection();if(!t)throw new Ie("Trying to read Injected bridge connection source while nothing is stored");if((t==null?void 0:t.type)==="http")throw new Ie("Trying to read Injected bridge connection source while HTTP connection is stored");return t})}storedConnectionType(){return xe(this,void 0,void 0,function*(){const t=yield this.storage.getItem(this.storeKey);return t?JSON.parse(t).type:null})}storeLastWalletEventId(t){return xe(this,void 0,void 0,function*(){const n=yield this.getConnection();if(n&&n.type==="http"&&!Bl(n))return n.lastWalletEventId=t,this.storeConnection(n)})}getLastWalletEventId(){return xe(this,void 0,void 0,function*(){const t=yield this.getConnection();if(t&&"lastWalletEventId"in t)return t.lastWalletEventId})}increaseNextRpcRequestId(){return xe(this,void 0,void 0,function*(){const t=yield this.getConnection();if(t&&"nextRpcRequestId"in t){const n=t.nextRpcRequestId||0;return t.nextRpcRequestId=n+1,this.storeConnection(t)}})}getNextRpcRequestId(){return xe(this,void 0,void 0,function*(){const t=yield this.getConnection();return t&&"nextRpcRequestId"in t&&t.nextRpcRequestId||0})}}const _3=2;class xc{constructor(t,n){this.storage=t,this.walletConnectionSource=n,this.type="http",this.standardUniversalLink="tc://",this.pendingRequests=new Map,this.session=null,this.gateway=null,this.pendingGateways=[],this.listeners=[],this.defaultOpeningDeadlineMS=5e3,this.connectionStorage=new wc(t)}static fromStorage(t){return xe(this,void 0,void 0,function*(){const r=yield new wc(t).getHttpConnection();return Bl(r)?new xc(t,r.connectionSource):new xc(t,{bridgeUrl:r.session.bridgeUrl})})}connect(t,n){var r;const i=ni(n==null?void 0:n.signal);(r=this.abortController)===null||r===void 0||r.abort(),this.abortController=i,this.closeGateways();const o=new C0;this.session={sessionCrypto:o,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},this.connectionStorage.storeConnection({type:"http",connectionSource:this.walletConnectionSource,sessionCrypto:o}).then(()=>xe(this,void 0,void 0,function*(){i.signal.aborted||(yield Fl(a=>this.openGateways(o,{openingDeadlineMS:n==null?void 0:n.openingDeadlineMS,signal:a==null?void 0:a.signal}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:i.signal}))}));const s="universalLink"in this.walletConnectionSource&&this.walletConnectionSource.universalLink?this.walletConnectionSource.universalLink:this.standardUniversalLink;return this.generateUniversalLink(s,t)}restoreConnection(t){var n,r;return xe(this,void 0,void 0,function*(){const i=ni(t==null?void 0:t.signal);if((n=this.abortController)===null||n===void 0||n.abort(),this.abortController=i,i.signal.aborted)return;this.closeGateways();const o=yield this.connectionStorage.getHttpConnection();if(!o||i.signal.aborted)return;const s=(r=t==null?void 0:t.openingDeadlineMS)!==null&&r!==void 0?r:this.defaultOpeningDeadlineMS;if(Bl(o))return this.session={sessionCrypto:o.sessionCrypto,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},yield this.openGateways(o.sessionCrypto,{openingDeadlineMS:s,signal:i==null?void 0:i.signal});if(Array.isArray(this.walletConnectionSource))throw new Ie("Internal error. Connection source is array while WalletConnectionSourceHTTP was expected.");if(this.session=o.session,this.gateway&&(Tn("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new e1(this.storage,this.walletConnectionSource.bridgeUrl,o.session.sessionCrypto.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),!i.signal.aborted){this.listeners.forEach(a=>a(o.connectEvent));try{yield Fl(a=>this.gateway.registerSession({openingDeadlineMS:s,signal:a.signal}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:i.signal})}catch{yield this.disconnect({signal:i.signal});return}}})}sendRequest(t,n){const r={};return typeof n=="function"?r.onRequestSent=n:(r.onRequestSent=n==null?void 0:n.onRequestSent,r.signal=n==null?void 0:n.signal,r.attempts=n==null?void 0:n.attempts),new Promise((i,o)=>xe(this,void 0,void 0,function*(){var s;if(!this.gateway||!this.session||!("walletPublicKey"in this.session))throw new Ie("Trying to send bridge request without session");const a=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),Tn("Send http-bridge request:",Object.assign(Object.assign({},t),{id:a}));const l=this.session.sessionCrypto.encrypt(JSON.stringify(Object.assign(Object.assign({},t),{id:a})),Yf(this.session.walletPublicKey));try{yield this.gateway.send(l,this.session.walletPublicKey,t.method,{attempts:r==null?void 0:r.attempts,signal:r==null?void 0:r.signal}),(s=r==null?void 0:r.onRequestSent)===null||s===void 0||s.call(r),this.pendingRequests.set(a.toString(),i)}catch(c){o(c)}}))}closeConnection(){this.closeGateways(),this.listeners=[],this.session=null,this.gateway=null}disconnect(t){return xe(this,void 0,void 0,function*(){return new Promise(n=>xe(this,void 0,void 0,function*(){let r=!1,i=null;const o=()=>{r||(r=!0,this.removeBridgeAndSession().then(n))};try{this.closeGateways();const s=ni(t==null?void 0:t.signal);i=setTimeout(()=>{s.abort()},this.defaultOpeningDeadlineMS),yield this.sendRequest({method:"disconnect",params:[]},{onRequestSent:o,signal:s.signal,attempts:1})}catch(s){Tn("Disconnect error:",s),r||this.removeBridgeAndSession().then(n)}finally{i&&clearTimeout(i),o()}}))})}listen(t){return this.listeners.push(t),()=>this.listeners=this.listeners.filter(n=>n!==t)}pause(){var t;(t=this.gateway)===null||t===void 0||t.pause(),this.pendingGateways.forEach(n=>n.pause())}unPause(){return xe(this,void 0,void 0,function*(){const t=this.pendingGateways.map(n=>n.unPause());this.gateway&&t.push(this.gateway.unPause()),yield Promise.all(t)})}pendingGatewaysListener(t,n,r){return xe(this,void 0,void 0,function*(){if(!this.pendingGateways.includes(t)){yield t.close();return}return this.closeGateways({except:t}),this.gateway&&(Tn("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.session.bridgeUrl=n,this.gateway=t,this.gateway.setErrorsListener(this.gatewayErrorsListener.bind(this)),this.gateway.setListener(this.gatewayListener.bind(this)),this.gatewayListener(r)})}gatewayListener(t){return xe(this,void 0,void 0,function*(){const n=JSON.parse(this.session.sessionCrypto.decrypt(tg.decode(t.message).toUint8Array(),Yf(t.from)));if(Tn("Wallet message received:",n),!("event"in n)){const i=n.id.toString(),o=this.pendingRequests.get(i);if(!o){Tn(`Response id ${i} doesn't match any request's id`);return}o(n),this.pendingRequests.delete(i);return}if(n.id!==void 0){const i=yield this.connectionStorage.getLastWalletEventId();if(i!==void 0&&n.id<=i){ki(`Received event id (=${n.id}) must be greater than stored last wallet event id (=${i}) `);return}n.event!=="connect"&&(yield this.connectionStorage.storeLastWalletEventId(n.id))}const r=this.listeners;n.event==="connect"&&(yield this.updateSession(n,t.from)),n.event==="disconnect"&&(Tn("Removing bridge and session: received disconnect event"),yield this.removeBridgeAndSession()),r.forEach(i=>i(n))})}gatewayErrorsListener(t){return xe(this,void 0,void 0,function*(){throw new Ie(`Bridge error ${JSON.stringify(t)}`)})}updateSession(t,n){return xe(this,void 0,void 0,function*(){this.session=Object.assign(Object.assign({},this.session),{walletPublicKey:n});const r=t.payload.items.find(o=>o.name==="ton_addr"),i=Object.assign(Object.assign({},t),{payload:Object.assign(Object.assign({},t.payload),{items:[r]})});yield this.connectionStorage.storeConnection({type:"http",session:this.session,lastWalletEventId:t.id,connectEvent:i,nextRpcRequestId:0})})}removeBridgeAndSession(){return xe(this,void 0,void 0,function*(){this.closeConnection(),yield this.connectionStorage.removeConnection()})}generateUniversalLink(t,n){return Ss(t)?this.generateTGUniversalLink(t,n):this.generateRegularUniversalLink(t,n)}generateRegularUniversalLink(t,n){const r=new URL(t);return r.searchParams.append("v",_3.toString()),r.searchParams.append("id",this.session.sessionCrypto.sessionId),r.searchParams.append("r",JSON.stringify(n)),r.toString()}generateTGUniversalLink(t,n){const i=this.generateRegularUniversalLink("about:blank",n).split("?")[1],o="tonconnect-"+x3(i),s=this.convertToDirectLink(t),a=new URL(s);return a.searchParams.append("startapp",o),a.toString()}convertToDirectLink(t){const n=new URL(t);return n.searchParams.has("attach")&&(n.searchParams.delete("attach"),n.pathname+="/start"),n.toString()}openGateways(t,n){return xe(this,void 0,void 0,function*(){if(Array.isArray(this.walletConnectionSource)){this.pendingGateways.map(r=>r.close().catch()),this.pendingGateways=this.walletConnectionSource.map(r=>{const i=new e1(this.storage,r.bridgeUrl,t.sessionId,()=>{},()=>{});return i.setListener(o=>this.pendingGatewaysListener(i,r.bridgeUrl,o)),i}),yield Promise.allSettled(this.pendingGateways.map(r=>Fl(i=>this.pendingGateways.some(o=>o===r)?r.registerSession({openingDeadlineMS:n==null?void 0:n.openingDeadlineMS,signal:i.signal}):r.close(),{attempts:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:n==null?void 0:n.signal})));return}else return this.gateway&&(Tn("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new e1(this.storage,this.walletConnectionSource.bridgeUrl,t.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),yield this.gateway.registerSession({openingDeadlineMS:n==null?void 0:n.openingDeadlineMS,signal:n==null?void 0:n.signal})})}closeGateways(t){var n;(n=this.gateway)===null||n===void 0||n.close(),this.pendingGateways.filter(r=>r!==(t==null?void 0:t.except)).forEach(r=>r.close()),this.pendingGateways=[]}}function L2(e,t){return C3(e,[t])}function C3(e,t){return!e||typeof e!="object"?!1:t.every(n=>n in e)}function K_(e){try{return!L2(e,"tonconnect")||!L2(e.tonconnect,"walletInfo")?!1:C3(e.tonconnect.walletInfo,["name","app_name","image","about_url","platforms"])}catch{return!1}}let q_=class _l{constructor(){this.storage={}}static getInstance(){return _l.instance||(_l.instance=new _l),_l.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(t){var n;return(n=this.storage[t])!==null&&n!==void 0?n:null}key(t){var n;const r=Object.keys(this.storage);return t<0||t>=r.length?null:(n=r[t])!==null&&n!==void 0?n:null}removeItem(t){delete this.storage[t]}setItem(t,n){this.storage[t]=n}};function Zd(){if(!(typeof window>"u"))return window}function G_(){const e=Zd();if(!e)return[];try{return Object.keys(e)}catch{return[]}}function Z_(){if(!(typeof document>"u"))return document}function Q_(){var e;const t=(e=Zd())===null||e===void 0?void 0:e.location.origin;return t?t+"/tonconnect-manifest.json":""}function J_(){if(X_())return localStorage;if(e9())throw new Ie("`localStorage` is unavailable, but it is required for TonConnect. For more details, see https://github.com/ton-connect/sdk/tree/main/packages/sdk#init-connector");return q_.getInstance()}function X_(){try{return typeof localStorage<"u"}catch{return!1}}function e9(){return typeof process<"u"&&process.versions!=null&&process.versions.node!=null}class mr{constructor(t,n){this.injectedWalletKey=n,this.type="injected",this.unsubscribeCallback=null,this.listenSubscriptions=!1,this.listeners=[];const r=mr.window;if(!mr.isWindowContainsWallet(r,n))throw new ig;this.connectionStorage=new wc(t),this.injectedWallet=r[n].tonconnect}static fromStorage(t){return xe(this,void 0,void 0,function*(){const r=yield new wc(t).getInjectedConnection();return new mr(t,r.jsBridgeKey)})}static isWalletInjected(t){return mr.isWindowContainsWallet(this.window,t)}static isInsideWalletBrowser(t){return mr.isWindowContainsWallet(this.window,t)?this.window[t].tonconnect.isWalletBrowser:!1}static getCurrentlyInjectedWallets(){return this.window?G_().filter(([r,i])=>K_(i)).map(([r,i])=>({name:i.tonconnect.walletInfo.name,appName:i.tonconnect.walletInfo.app_name,aboutUrl:i.tonconnect.walletInfo.about_url,imageUrl:i.tonconnect.walletInfo.image,tondns:i.tonconnect.walletInfo.tondns,jsBridgeKey:r,injected:!0,embedded:i.tonconnect.isWalletBrowser,platforms:i.tonconnect.walletInfo.platforms})):[]}static isWindowContainsWallet(t,n){return!!t&&n in t&&typeof t[n]=="object"&&"tonconnect"in t[n]}connect(t){this._connect(_3,t)}restoreConnection(){return xe(this,void 0,void 0,function*(){try{Tn("Injected Provider restoring connection...");const t=yield this.injectedWallet.restoreConnection();Tn("Injected Provider restoring connection response",t),t.event==="connect"?(this.makeSubscriptions(),this.listeners.forEach(n=>n(t))):yield this.connectionStorage.removeConnection()}catch(t){yield this.connectionStorage.removeConnection(),console.error(t)}})}closeConnection(){this.listenSubscriptions&&this.injectedWallet.disconnect(),this.closeAllListeners()}disconnect(){return xe(this,void 0,void 0,function*(){return new Promise(t=>{const n=()=>{this.closeAllListeners(),this.connectionStorage.removeConnection().then(t)};try{this.injectedWallet.disconnect(),n()}catch(r){Tn(r),this.sendRequest({method:"disconnect",params:[]},n)}})})}closeAllListeners(){var t;this.listenSubscriptions=!1,this.listeners=[],(t=this.unsubscribeCallback)===null||t===void 0||t.call(this)}listen(t){return this.listeners.push(t),()=>this.listeners=this.listeners.filter(n=>n!==t)}sendRequest(t,n){var r;return xe(this,void 0,void 0,function*(){const i={};typeof n=="function"?i.onRequestSent=n:(i.onRequestSent=n==null?void 0:n.onRequestSent,i.signal=n==null?void 0:n.signal);const o=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),Tn("Send injected-bridge request:",Object.assign(Object.assign({},t),{id:o}));const s=this.injectedWallet.send(Object.assign(Object.assign({},t),{id:o}));return s.then(a=>Tn("Wallet message received:",a)),(r=i==null?void 0:i.onRequestSent)===null||r===void 0||r.call(i),s})}_connect(t,n){return xe(this,void 0,void 0,function*(){try{Tn(`Injected Provider connect request: protocolVersion: ${t}, message:`,n);const r=yield this.injectedWallet.connect(t,n);Tn("Injected Provider connect response:",r),r.event==="connect"&&(yield this.updateSession(),this.makeSubscriptions()),this.listeners.forEach(i=>i(r))}catch(r){Tn("Injected Provider connect error:",r);const i={event:"connect_error",payload:{code:0,message:r==null?void 0:r.toString()}};this.listeners.forEach(o=>o(i))}})}makeSubscriptions(){this.listenSubscriptions=!0,this.unsubscribeCallback=this.injectedWallet.listen(t=>{Tn("Wallet message received:",t),this.listenSubscriptions&&this.listeners.forEach(n=>n(t)),t.event==="disconnect"&&this.disconnect()})}updateSession(){return this.connectionStorage.storeConnection({type:"injected",jsBridgeKey:this.injectedWalletKey,nextRpcRequestId:0})}}mr.window=Zd();class t9{constructor(){this.localStorage=J_()}getItem(t){return xe(this,void 0,void 0,function*(){return this.localStorage.getItem(t)})}removeItem(t){return xe(this,void 0,void 0,function*(){this.localStorage.removeItem(t)})}setItem(t,n){return xe(this,void 0,void 0,function*(){this.localStorage.setItem(t,n)})}}function ks(e){return n9(e)&&e.injected}function Qd(e){return ks(e)&&e.embedded}function n9(e){return"jsBridgeKey"in e}function sg(e){return"bridgeUrl"in e}const r9=[{app_name:"telegram-wallet",name:"Wallet",image:"https://wallet.tg/images/logo-288.png",about_url:"https://wallet.tg/",universal_url:"https://t.me/wallet?attach=wallet",bridge:[{type:"sse",url:"https://bridge.tonapi.io/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"tonkeeper",name:"Tonkeeper",image:"https://tonkeeper.com/assets/tonconnect-icon.png",tondns:"tonkeeper.ton",about_url:"https://tonkeeper.com",universal_url:"https://app.tonkeeper.com/ton-connect",deepLink:"tonkeeper-tc://",bridge:[{type:"sse",url:"https://bridge.tonapi.io/bridge"},{type:"js",key:"tonkeeper"}],platforms:["ios","android","chrome","firefox","macos"]},{app_name:"mytonwallet",name:"MyTonWallet",image:"https://mytonwallet.io/icon-256.png",about_url:"https://mytonwallet.io",universal_url:"https://connect.mytonwallet.org",bridge:[{type:"js",key:"mytonwallet"},{type:"sse",url:"https://tonconnectbridge.mytonwallet.org/bridge/"}],platforms:["chrome","windows","macos","linux","ios","android","firefox"]},{app_name:"openmask",name:"OpenMask",image:"https://raw.githubusercontent.com/OpenProduct/openmask-extension/main/public/openmask-logo-288.png",about_url:"https://www.openmask.app/",bridge:[{type:"js",key:"openmask"}],platforms:["chrome"]},{app_name:"tonhub",name:"Tonhub",image:"https://tonhub.com/tonconnect_logo.png",about_url:"https://tonhub.com",universal_url:"https://tonhub.com/ton-connect",bridge:[{type:"js",key:"tonhub"},{type:"sse",url:"https://connect.tonhubapi.com/tonconnect"}],platforms:["ios","android"]},{app_name:"dewallet",name:"DeWallet",image:"https://app.delabwallet.com/logo_black.png",about_url:"https://delabwallet.com",bridge:[{type:"js",key:"dewallet"}],platforms:["chrome"]},{app_name:"xtonwallet",name:"XTONWallet",image:"https://xtonwallet.com/assets/img/icon-256-back.png",about_url:"https://xtonwallet.com",bridge:[{type:"js",key:"xtonwallet"}],platforms:["chrome","firefox"]},{app_name:"tonwallet",name:"TON Wallet",image:"https://wallet.ton.org/assets/ui/qr-logo.png",about_url:"https://chrome.google.com/webstore/detail/ton-wallet/nphplpgoakhhjchkkhmiggakijnkhfnd",bridge:[{type:"js",key:"tonwallet"}],platforms:["chrome"]}];class S0{constructor(t){this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null,this.walletsListSource="https://raw.githubusercontent.com/ton-blockchain/wallets-list/main/wallets-v2.json",t!=null&&t.walletsListSource&&(this.walletsListSource=t.walletsListSource),t!=null&&t.cacheTTLMs&&(this.cacheTTLMs=t.cacheTTLMs)}getWallets(){return xe(this,void 0,void 0,function*(){return this.cacheTTLMs&&this.walletsListCacheCreationTimestamp&&Date.now()>this.walletsListCacheCreationTimestamp+this.cacheTTLMs&&(this.walletsListCache=null),this.walletsListCache||(this.walletsListCache=this.fetchWalletsList(),this.walletsListCache.then(()=>{this.walletsListCacheCreationTimestamp=Date.now()}).catch(()=>{this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null})),this.walletsListCache})}getEmbeddedWallet(){return xe(this,void 0,void 0,function*(){const n=(yield this.getWallets()).filter(Qd);return n.length!==1?null:n[0]})}fetchWalletsList(){return xe(this,void 0,void 0,function*(){let t=[];try{if(t=yield(yield fetch(this.walletsListSource)).json(),!Array.isArray(t))throw new og("Wrong wallets list format, wallets list must be an array.");const i=t.filter(o=>!this.isCorrectWalletConfigDTO(o));i.length&&(ki(`Wallet(s) ${i.map(o=>o.name).join(", ")} config format is wrong. They were removed from the wallets list.`),t=t.filter(o=>this.isCorrectWalletConfigDTO(o)))}catch(r){ki(r),t=r9}let n=[];try{n=mr.getCurrentlyInjectedWallets()}catch(r){ki(r)}return this.mergeWalletsLists(this.walletConfigDTOListToWalletConfigList(t),n)})}walletConfigDTOListToWalletConfigList(t){return t.map(n=>{const i={name:n.name,appName:n.app_name,imageUrl:n.image,aboutUrl:n.about_url,tondns:n.tondns,platforms:n.platforms};return n.bridge.forEach(o=>{if(o.type==="sse"&&(i.bridgeUrl=o.url,i.universalLink=n.universal_url,i.deepLink=n.deepLink),o.type==="js"){const s=o.key;i.jsBridgeKey=s,i.injected=mr.isWalletInjected(s),i.embedded=mr.isInsideWalletBrowser(s)}}),i})}mergeWalletsLists(t,n){return[...new Set(t.concat(n).map(i=>i.name)).values()].map(i=>{const o=t.find(a=>a.name===i),s=n.find(a=>a.name===i);return Object.assign(Object.assign({},o&&Object.assign({},o)),s&&Object.assign({},s))})}isCorrectWalletConfigDTO(t){if(!t||typeof t!="object")return!1;const n="name"in t,r="app_name"in t,i="image"in t,o="about_url"in t,s="platforms"in t;if(!n||!i||!o||!s||!r||!t.platforms||!Array.isArray(t.platforms)||!t.platforms.length||!("bridge"in t)||!Array.isArray(t.bridge)||!t.bridge.length)return!1;const a=t.bridge;if(a.some(u=>!u||typeof u!="object"||!("type"in u)))return!1;const l=a.find(u=>u.type==="sse");if(l&&(!("url"in l)||!l.url||!t.universal_url))return!1;const c=a.find(u=>u.type==="js");return!(c&&(!("key"in c)||!c.key))}}class Gf extends Ie{get info(){return"Wallet doesn't support requested feature method."}constructor(...t){super(...t),Object.setPrototypeOf(this,Gf.prototype)}}function i9(e,t){const n=e.includes("SendTransaction"),r=e.find(i=>i&&typeof i=="object"&&i.name==="SendTransaction");if(!n&&!r)throw new Gf("Wallet doesn't support SendTransaction feature.");if(r&&r.maxMessages!==void 0){if(r.maxMessages{var a,l;return{address:(a=s.address)!==null&&a!==void 0?a:null,amount:(l=s.amount)!==null&&l!==void 0?l:null}})}}function O3(e,t,n){return Object.assign(Object.assign({type:"transaction-sent-for-signature"},Ya(e,t)),ag(t,n))}function R3(e,t,n,r){return Object.assign(Object.assign({type:"transaction-signed",is_success:!0,signed_transaction:r.boc},Ya(e,t)),ag(t,n))}function D3(e,t,n,r,i){return Object.assign(Object.assign({type:"transaction-signing-failed",is_success:!1,error_message:r,error_code:i??null},Ya(e,t)),ag(t,n))}function I3(e,t,n){return Object.assign({type:"disconnection",scope:n},Ya(e,t))}class N3{constructor(){this.window=Zd()}dispatchEvent(t,n){var r;return xe(this,void 0,void 0,function*(){const i=new CustomEvent(t,{detail:n});(r=this.window)===null||r===void 0||r.dispatchEvent(i)})}addEventListener(t,n,r){var i;return xe(this,void 0,void 0,function*(){return(i=this.window)===null||i===void 0||i.addEventListener(t,n,r),()=>{var o;return(o=this.window)===null||o===void 0?void 0:o.removeEventListener(t,n)}})}}class o9{constructor(t){var n;this.eventPrefix="ton-connect-",this.tonConnectUiVersion=null,this.eventDispatcher=(n=t==null?void 0:t.eventDispatcher)!==null&&n!==void 0?n:new N3,this.tonConnectSdkVersion=t.tonConnectSdkVersion,this.init().catch()}get version(){return js({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return xe(this,void 0,void 0,function*(){try{yield this.setRequestVersionHandler(),this.tonConnectUiVersion=yield this.requestTonConnectUiVersion()}catch{}})}setRequestVersionHandler(){return xe(this,void 0,void 0,function*(){yield this.eventDispatcher.addEventListener("ton-connect-request-version",()=>xe(this,void 0,void 0,function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-response-version",k3(this.tonConnectSdkVersion))}))})}requestTonConnectUiVersion(){return xe(this,void 0,void 0,function*(){return new Promise((t,n)=>xe(this,void 0,void 0,function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-ui-response-version",r=>{t(r.detail.version)},{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-ui-request-version",S3())}catch(r){n(r)}}))})}dispatchUserActionEvent(t){try{this.eventDispatcher.dispatchEvent(`${this.eventPrefix}${t.type}`,t).catch()}catch{}}trackConnectionStarted(...t){try{const n=E3(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionCompleted(...t){try{const n=M3(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionError(...t){try{const n=T3(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionRestoringStarted(...t){try{const n=P3(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionRestoringCompleted(...t){try{const n=A3(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionRestoringError(...t){try{const n=L3(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackDisconnection(...t){try{const n=I3(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackTransactionSentForSignature(...t){try{const n=O3(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackTransactionSigned(...t){try{const n=R3(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackTransactionSigningFailed(...t){try{const n=D3(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}}const s9="3.0.3";class Ns{constructor(t){if(this.walletsList=new S0,this._wallet=null,this.provider=null,this.statusChangeSubscriptions=[],this.statusChangeErrorSubscriptions=[],this.dappSettings={manifestUrl:(t==null?void 0:t.manifestUrl)||Q_(),storage:(t==null?void 0:t.storage)||new t9},this.walletsList=new S0({walletsListSource:t==null?void 0:t.walletsListSource,cacheTTLMs:t==null?void 0:t.walletsListCacheTTLMs}),this.tracker=new o9({eventDispatcher:t==null?void 0:t.eventDispatcher,tonConnectSdkVersion:s9}),!this.dappSettings.manifestUrl)throw new ng("Dapp tonconnect-manifest.json must be specified if window.location.origin is undefined. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest");this.bridgeConnectionStorage=new wc(this.dappSettings.storage),t!=null&&t.disableAutoPauseConnection||this.addWindowFocusAndBlurSubscriptions()}static getWallets(){return this.walletsList.getWallets()}get connected(){return this._wallet!==null}get account(){var t;return((t=this._wallet)===null||t===void 0?void 0:t.account)||null}get wallet(){return this._wallet}set wallet(t){this._wallet=t,this.statusChangeSubscriptions.forEach(n=>n(this._wallet))}getWallets(){return this.walletsList.getWallets()}onStatusChange(t,n){return this.statusChangeSubscriptions.push(t),n&&this.statusChangeErrorSubscriptions.push(n),()=>{this.statusChangeSubscriptions=this.statusChangeSubscriptions.filter(r=>r!==t),n&&(this.statusChangeErrorSubscriptions=this.statusChangeErrorSubscriptions.filter(r=>r!==n))}}connect(t,n){var r,i;const o={};if(typeof n=="object"&&"tonProof"in n&&(o.request=n),typeof n=="object"&&("openingDeadlineMS"in n||"signal"in n||"request"in n)&&(o.request=n==null?void 0:n.request,o.openingDeadlineMS=n==null?void 0:n.openingDeadlineMS,o.signal=n==null?void 0:n.signal),this.connected)throw new rg;const s=ni(o==null?void 0:o.signal);if((r=this.abortController)===null||r===void 0||r.abort(),this.abortController=s,s.signal.aborted)throw new Ie("Connection was aborted");return(i=this.provider)===null||i===void 0||i.closeConnection(),this.provider=this.createProvider(t),s.signal.addEventListener("abort",()=>{var a;(a=this.provider)===null||a===void 0||a.closeConnection(),this.provider=null}),this.tracker.trackConnectionStarted(),this.provider.connect(this.createConnectRequest(o==null?void 0:o.request),{openingDeadlineMS:o==null?void 0:o.openingDeadlineMS,signal:s.signal})}restoreConnection(t){var n,r;return xe(this,void 0,void 0,function*(){this.tracker.trackConnectionRestoringStarted();const i=ni(t==null?void 0:t.signal);if((n=this.abortController)===null||n===void 0||n.abort(),this.abortController=i,i.signal.aborted){this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}const[o,s]=yield Promise.all([this.bridgeConnectionStorage.storedConnectionType(),this.walletsList.getEmbeddedWallet()]);if(i.signal.aborted){this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}let a=null;try{switch(o){case"http":a=yield xc.fromStorage(this.dappSettings.storage);break;case"injected":a=yield mr.fromStorage(this.dappSettings.storage);break;default:if(s)a=this.createProvider(s);else return}}catch{this.tracker.trackConnectionRestoringError("Provider is not restored"),yield this.bridgeConnectionStorage.removeConnection(),a==null||a.closeConnection(),a=null;return}if(i.signal.aborted){a==null||a.closeConnection(),this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}if(!a){ki("Provider is not restored"),this.tracker.trackConnectionRestoringError("Provider is not restored");return}(r=this.provider)===null||r===void 0||r.closeConnection(),this.provider=a,a.listen(this.walletEventsListener.bind(this));const l=()=>{this.tracker.trackConnectionRestoringError("Connection restoring was aborted"),a==null||a.closeConnection(),a=null};return i.signal.addEventListener("abort",l),yield Fl(c=>xe(this,void 0,void 0,function*(){yield a==null?void 0:a.restoreConnection({openingDeadlineMS:t==null?void 0:t.openingDeadlineMS,signal:c.signal}),i.signal.removeEventListener("abort",l),this.connected?this.tracker.trackConnectionRestoringCompleted(this.wallet):this.tracker.trackConnectionRestoringError("Connection restoring failed")}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:t==null?void 0:t.signal})})}sendTransaction(t,n){return xe(this,void 0,void 0,function*(){const r={};typeof n=="function"?r.onRequestSent=n:(r.onRequestSent=n==null?void 0:n.onRequestSent,r.signal=n==null?void 0:n.signal);const i=ni(r==null?void 0:r.signal);if(i.signal.aborted)throw new Ie("Transaction sending was aborted");this.checkConnection(),i9(this.wallet.device.features,{requiredMessagesNumber:t.messages.length}),this.tracker.trackTransactionSentForSignature(this.wallet,t);const{validUntil:o}=t,s=I_(t,["validUntil"]),a=t.from||this.account.address,l=t.network||this.account.chain,c=yield this.provider.sendRequest(Eu.convertToRpcRequest(Object.assign(Object.assign({},s),{valid_until:o,from:a,network:l})),{onRequestSent:r.onRequestSent,signal:i.signal});if(Eu.isError(c))return this.tracker.trackTransactionSigningFailed(this.wallet,t,c.error.message,c.error.code),Eu.parseAndThrowError(c);const u=Eu.convertFromRpcResponse(c);return this.tracker.trackTransactionSigned(this.wallet,t,u),u})}disconnect(t){var n;return xe(this,void 0,void 0,function*(){if(!this.connected)throw new Kf;const r=ni(t==null?void 0:t.signal),i=this.abortController;if(this.abortController=r,r.signal.aborted)throw new Ie("Disconnect was aborted");this.onWalletDisconnected("dapp"),yield(n=this.provider)===null||n===void 0?void 0:n.disconnect({signal:r.signal}),i==null||i.abort()})}pauseConnection(){var t;((t=this.provider)===null||t===void 0?void 0:t.type)==="http"&&this.provider.pause()}unPauseConnection(){var t;return((t=this.provider)===null||t===void 0?void 0:t.type)!=="http"?Promise.resolve():this.provider.unPause()}addWindowFocusAndBlurSubscriptions(){const t=Z_();if(t)try{t.addEventListener("visibilitychange",()=>{t.hidden?this.pauseConnection():this.unPauseConnection().catch()})}catch(n){ki("Cannot subscribe to the document.visibilitychange: ",n)}}createProvider(t){let n;return!Array.isArray(t)&&N_(t)?n=new mr(this.dappSettings.storage,t.jsBridgeKey):n=new xc(this.dappSettings.storage,t),n.listen(this.walletEventsListener.bind(this)),n}walletEventsListener(t){switch(t.event){case"connect":this.onWalletConnected(t.payload);break;case"connect_error":this.onWalletConnectError(t.payload);break;case"disconnect":this.onWalletDisconnected("wallet")}}onWalletConnected(t){const n=t.items.find(o=>o.name==="ton_addr"),r=t.items.find(o=>o.name==="ton_proof");if(!n)throw new Ie("ton_addr connection item was not found");const i={device:t.device,provider:this.provider.type,account:{address:n.address,chain:n.network,walletStateInit:n.walletStateInit,publicKey:n.publicKey}};r&&(i.connectItems={tonProof:r}),this.wallet=i,this.tracker.trackConnectionCompleted(i)}onWalletConnectError(t){const n=$_.parseError(t);if(this.statusChangeErrorSubscriptions.forEach(r=>r(n)),Tn(n),this.tracker.trackConnectionError(t.message,t.code),n instanceof Yd||n instanceof Vd)throw ki(n),n}onWalletDisconnected(t){this.tracker.trackDisconnection(this.wallet,t),this.wallet=null}checkConnection(){if(!this.connected)throw new Kf}createConnectRequest(t){const n=[{name:"ton_addr"}];return t!=null&&t.tonProof&&n.push({name:"ton_proof",payload:t.tonProof}),{manifestUrl:this.dappSettings.manifestUrl,items:n}}}Ns.walletsList=new S0;Ns.isWalletInjected=e=>mr.isWalletInjected(e);Ns.isInsideWalletBrowser=e=>mr.isInsideWalletBrowser(e);const a9=81,l9=128;function W3(e,t=!1){const{wc:n,hex:r}=c9(e);let i=a9;t&&(i|=l9);const o=new Int8Array(34);o[0]=i,o[1]=n,o.set(r,2);const s=new Uint8Array(36);return s.set(o),s.set(u9(o),34),tg.encode(s).replace(/\+/g,"-").replace(/\//g,"_")}function c9(e){if(!e.includes(":"))throw new ha(`Wrong address ${e}. Address must include ":".`);const t=e.split(":");if(t.length!==2)throw new ha(`Wrong address ${e}. Address must include ":" only once.`);const n=parseInt(t[0]);if(n!==0&&n!==-1)throw new ha(`Wrong address ${e}. WC must be eq 0 or -1, but ${n} received.`);const r=t[1];if((r==null?void 0:r.length)!==64)throw new ha(`Wrong address ${e}. Hex part must be 64bytes length, but ${r==null?void 0:r.length} received.`);return{wc:n,hex:f9(r)}}function u9(e){let n=0;const r=new Uint8Array(e.length+2);r.set(e);for(let i of r){let o=128;for(;o>0;)n<<=1,i&o&&(n+=1),o>>=1,n>65535&&(n&=65535,n^=4129)}return new Uint8Array([Math.floor(n/256),n%256])}const k0={};for(let e=0;e<=255;e++){let t=e.toString(16);t.length<2&&(t="0"+t),k0[t]=e}function f9(e){e=e.toLowerCase();const t=e.length;if(t%2!==0)throw new qf("Hex string must have length a multiple of 2: "+e);const n=t/2,r=new Uint8Array(n);for(let i=0;i0?wt.length===2?typeof wt[1]==a?this[wt[0]]=wt[1].call(this,Fn):this[wt[0]]=wt[1]:wt.length===3?typeof wt[1]===a&&!(wt[1].exec&&wt[1].test)?this[wt[0]]=Fn?wt[1].call(this,Fn,wt[2]):r:this[wt[0]]=Fn?Fn.replace(wt[1],wt[2]):r:wt.length===4&&(this[wt[0]]=Fn?wt[3].call(this,Fn.replace(wt[1],wt[2])):r):this[wt]=Fn||r;He+=2}},We=function(Ue,yt){for(var He in yt)if(typeof yt[He]===c&&yt[He].length>0){for(var Pt=0;Pt2&&(Re[h]="iPad",Re[m]=M),Re},this.getEngine=function(){var Re={};return Re[g]=r,Re[k]=r,Dt.call(Re,Pt,hr.engine),Re},this.getOS=function(){var Re={};return Re[g]=r,Re[k]=r,Dt.call(Re,Pt,hr.os),wt&&!Re[g]&&Rn&&Rn.platform&&Rn.platform!="Unknown"&&(Re[g]=Rn.platform.replace(/chrome os/i,q).replace(/macos/i,B)),Re},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Pt},this.setUA=function(Re){return Pt=typeof Re===u&&Re.length>P?Xe(Re,P):Re,this},this.setUA(Pt),this};_n.VERSION=i,_n.BROWSER=ne([g,k,d]),_n.CPU=ne([C]),_n.DEVICE=ne([h,y,m,v,w,E,M,O,T]),_n.ENGINE=_n.OS=ne([g,k]),e.exports&&(t=e.exports=_n),t.UAParser=_n;var En=typeof n!==l&&(n.jQuery||n.Zepto);if(En&&!En.ua){var ir=new _n;En.ua=ir.getResult(),En.ua.get=function(){return ir.getUA()},En.ua.set=function(Ue){ir.setUA(Ue);var yt=ir.getResult();for(var He in yt)En.ua[He]=yt[He]}}})(typeof window=="object"?window:iw)})(E0,E0.exports);var d9=E0.exports;const h9=ja(d9);var p9=function(t){return g9(t)&&!m9(t)};function g9(e){return!!e&&typeof e=="object"}function m9(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||w9(e)}var v9=typeof Symbol=="function"&&Symbol.for,y9=v9?Symbol.for("react.element"):60103;function w9(e){return e.$$typeof===y9}function x9(e){return Array.isArray(e)?[]:{}}function bc(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Ia(x9(e),e,t):e}function b9(e,t,n){return e.concat(t).map(function(r){return bc(r,n)})}function _9(e,t){if(!t.customMerge)return Ia;var n=t.customMerge(e);return typeof n=="function"?n:Ia}function C9(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function O2(e){return Object.keys(e).concat(C9(e))}function $3(e,t){try{return t in e}catch{return!1}}function S9(e,t){return $3(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function k9(e,t,n){var r={};return n.isMergeableObject(e)&&O2(e).forEach(function(i){r[i]=bc(e[i],n)}),O2(t).forEach(function(i){S9(e,i)||($3(e,i)&&n.isMergeableObject(t[i])?r[i]=_9(i,n)(e[i],t[i],n):r[i]=bc(t[i],n))}),r}function Ia(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||b9,n.isMergeableObject=n.isMergeableObject||p9,n.cloneUnlessOtherwiseSpecified=bc;var r=Array.isArray(t),i=Array.isArray(e),o=r===i;return o?r?n.arrayMerge(e,t,n):k9(e,t,n):bc(t,n)}Ia.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return Ia(r,i,n)},{})};var E9=Ia,M9=E9;const T9=ja(M9);var U3={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o="",s=0;st in e?A9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rt=(e,t)=>{for(var n in t||(t={}))R9.call(t,n)&&M0(e,n,t[n]);if(R2)for(var n of R2(t))D9.call(t,n)&&M0(e,n,t[n]);return e},Tr=(e,t)=>L9(e,O9(t)),$e=(e,t,n)=>(M0(e,typeof t!="symbol"?t+"":t,n),n),At=(e,t,n)=>new Promise((r,i)=>{var o=l=>{try{a(n.next(l))}catch(c){i(c)}},s=l=>{try{a(n.throw(l))}catch(c){i(c)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(o,s);a((n=n.apply(e,t)).next())}),D2,I2,N2,W2,$2,U2,F2,B2;const Xt={};function I9(e){Xt.context=e}const N9=(e,t)=>e===t,ci=Symbol("solid-proxy"),T0=Symbol("solid-track"),Zf={equals:N9};let F3=Y3;const uo=1,Qf=2,B3={owned:null,cleanups:null,context:null,owner:null},t1={};var An=null;let Es=null,tn=null,er=null,Ji=null,lg=0;function jl(e,t){const n=tn,r=An,i=e.length===0,o=i?B3:{owned:null,cleanups:null,context:null,owner:t===void 0?r:t},s=i?e:()=>e(()=>Un(()=>th(o)));An=o,tn=null;try{return Go(s,!0)}finally{tn=n,An=r}}function Be(e,t){t=t?Object.assign({},Zf,t):Zf;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=i=>(typeof i=="function"&&(i=i(n.value)),V3(n,i));return[z3.bind(n),r]}function Jf(e,t,n){const r=eh(e,t,!0,uo);Ka(r)}function ht(e,t,n){const r=eh(e,t,!1,uo);Ka(r)}function $n(e,t,n){F3=z9;const r=eh(e,t,!1,uo);r.user=!0,Ji?Ji.push(r):Ka(r)}function ve(e,t,n){n=n?Object.assign({},Zf,n):Zf;const r=eh(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Ka(r),z3.bind(r)}function W9(e,t,n){let r,i,o;arguments.length===2&&typeof t=="object"||arguments.length===1?(r=!0,i=e,o={}):(r=e,i=t,o={});let s=null,a=t1,l=null,c=!1,u="initialValue"in o,d=typeof r=="function"&&ve(r);const h=new Set,[g,m]=(o.storage||Be)(o.initialValue),[y,k]=Be(void 0),[C,v]=Be(void 0,{equals:!1}),[w,M]=Be(u?"ready":"unresolved");if(Xt.context){l=`${Xt.context.id}${Xt.context.count++}`;let L;o.ssrLoadFrom==="initial"?a=o.initialValue:Xt.load&&(L=Xt.load(l))&&(a=L[0])}function E(L,W,I,R){return s===L&&(s=null,u=!0,(L===a||W===a)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated(R,{value:W})),a=t1,O(W,I)),W}function O(L,W){Go(()=>{W===void 0&&m(()=>L),M(W!==void 0?"errored":"ready"),k(W);for(const I of h.keys())I.decrement();h.clear()},!1)}function T(){const L=B9,W=g(),I=y();if(I!==void 0&&!s)throw I;return tn&&!tn.user&&L&&Jf(()=>{C(),s&&(L.resolved||h.has(L)||(L.increment(),h.add(L)))}),W}function P(L=!0){if(L!==!1&&c)return;c=!1;const W=d?d():r;if(W==null||W===!1){E(s,Un(g));return}const I=a!==t1?a:Un(()=>i(W,{value:g(),refetching:L}));return typeof I!="object"||!(I&&"then"in I)?(E(s,I,void 0,W),I):(s=I,c=!0,queueMicrotask(()=>c=!1),Go(()=>{M(u?"refreshing":"pending"),v()},!1),I.then(R=>E(I,R,void 0,W),R=>E(I,void 0,q3(R),W)))}return Object.defineProperties(T,{state:{get:()=>w()},error:{get:()=>y()},loading:{get(){const L=w();return L==="pending"||L==="refreshing"}},latest:{get(){if(!u)return T();const L=y();if(L&&!s)throw L;return g()}}}),d?Jf(()=>P(!1)):P(!1),[T,{refetch:P,mutate:m}]}function j3(e){return Go(e,!1)}function Un(e){if(tn===null)return e();const t=tn;tn=null;try{return e()}finally{tn=t}}function $9(e,t,n){const r=Array.isArray(e);let i;return o=>{let s;if(r){s=Array(e.length);for(let l=0;lt(s,i,o));return i=s,a}}function U9(e){$n(()=>Un(e))}function lr(e){return An===null||(An.cleanups===null?An.cleanups=[e]:An.cleanups.push(e)),e}function H3(){return tn}function F9(){return An}function Jd(e,t){const n=Symbol("context");return{id:n,Provider:V9(n),defaultValue:e}}function cr(e){let t;return(t=Z3(An,e.id))!==void 0?t:e.defaultValue}function Xd(e){const t=ve(e),n=ve(()=>P0(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let B9;function z3(){const e=Es;if(this.sources&&(this.state||e))if(this.state===uo||e)Ka(this);else{const t=er;er=null,Go(()=>ed(this),!1),er=t}if(tn){const t=this.observers?this.observers.length:0;tn.sources?(tn.sources.push(this),tn.sourceSlots.push(t)):(tn.sources=[this],tn.sourceSlots=[t]),this.observers?(this.observers.push(tn),this.observerSlots.push(tn.sources.length-1)):(this.observers=[tn],this.observerSlots=[tn.sources.length-1])}return this.value}function V3(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Go(()=>{for(let i=0;i1e6)throw er=[],new Error},!1)),t}function Ka(e){if(!e.fn)return;th(e);const t=An,n=tn,r=lg;tn=An=e,j9(e,e.value,r),tn=n,An=t}function j9(e,t,n){let r;try{r=e.fn(t)}catch(i){e.pure&&(e.state=uo,e.owned&&e.owned.forEach(th),e.owned=null),G3(i)}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?V3(e,r):e.value=r,e.updatedAt=n)}function eh(e,t,n,r=uo,i){const o={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:An,context:null,pure:n};return An===null||An!==B3&&(An.owned?An.owned.push(o):An.owned=[o]),o}function Xf(e){const t=Es;if(e.state===0||t)return;if(e.state===Qf||t)return ed(e);if(e.suspense&&Un(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;r--)if(e=n[r],e.state===uo||t)Ka(e);else if(e.state===Qf||t){const i=er;er=null,Go(()=>ed(e,n[0]),!1),er=i}}function Go(e,t){if(er)return e();let n=!1;t||(er=[]),Ji?n=!0:Ji=[],lg++;try{const r=e();return H9(n),r}catch(r){n||(Ji=null),er=null,G3(r)}}function H9(e){if(er&&(Y3(er),er=null),e)return;const t=Ji;Ji=null,t.length&&Go(()=>F3(t),!1)}function Y3(e){for(let t=0;ti=Un(()=>(An.context={[e]:r.value},Xd(()=>r.children))),void 0),i}}const Y9=Symbol("fallback");function j2(e){for(let t=0;t1?[]:null;return lr(()=>j2(o)),()=>{let l=e()||[],c,u;return l[T0],Un(()=>{let h=l.length,g,m,y,k,C,v,w,M,E;if(h===0)s!==0&&(j2(o),o=[],r=[],i=[],s=0,a&&(a=[])),n.fallback&&(r=[Y9],i[0]=jl(O=>(o[0]=O,n.fallback())),s=1);else if(s===0){for(i=new Array(h),u=0;u=v&&M>=v&&r[w]===l[M];w--,M--)y[M]=i[w],k[M]=o[w],a&&(C[M]=a[w]);for(g=new Map,m=new Array(M+1),u=M;u>=v;u--)E=l[u],c=g.get(E),m[u]=c===void 0?-1:c,g.set(E,u);for(c=v;c<=w;c++)E=r[c],u=g.get(E),u!==void 0&&u!==-1?(y[u]=i[c],k[u]=o[c],a&&(C[u]=a[c]),u=m[u],g.set(E,u)):o[c]();for(u=v;ue(t||{}))}function Mu(){return!0}const A0={get(e,t,n){return t===ci?n:e.get(t)},has(e,t){return t===ci?!0:e.has(t)},set:Mu,deleteProperty:Mu,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Mu,deleteProperty:Mu}},ownKeys(e){return e.keys()}};function n1(e){return(e=typeof e=="function"?e():e)?e:{}}function Ei(...e){let t=!1;for(let r=0;r=0;i--){const o=n1(e[i])[r];if(o!==void 0)return o}},has(r){for(let i=e.length-1;i>=0;i--)if(r in n1(e[i]))return!0;return!1},keys(){const r=[];for(let i=0;i=0;r--)if(e[r]){const i=Object.getOwnPropertyDescriptors(e[r]);for(const o in i)o in n||Object.defineProperty(n,o,{enumerable:!0,get(){for(let s=e.length-1;s>=0;s--){const a=(e[s]||{})[o];if(a!==void 0)return a}}})}return n}function cg(e,...t){const n=new Set(t.flat());if(ci in e){const i=t.map(o=>new Proxy({get(s){return o.includes(s)?e[s]:void 0},has(s){return o.includes(s)&&s in e},keys(){return o.filter(s=>s in e)}},A0));return i.push(new Proxy({get(o){return n.has(o)?void 0:e[o]},has(o){return n.has(o)?!1:o in e},keys(){return Object.keys(e).filter(o=>!n.has(o))}},A0)),i}const r=Object.getOwnPropertyDescriptors(e);return t.push(Object.keys(r).filter(i=>!n.has(i))),t.map(i=>{const o={};for(let s=0;se.fallback};return ve(K9(()=>e.each,e.children,t||void 0))}function Ye(e){let t=!1;const n=e.keyed,r=ve(()=>e.when,void 0,{equals:(i,o)=>t?i===o:!i==!o});return ve(()=>{const i=r();if(i){const o=e.children,s=typeof o=="function"&&o.length>0;return t=n||s,s?Un(()=>o(i)):o}return e.fallback},void 0,void 0)}function zc(e){let t=!1,n=!1;const r=(s,a)=>s[0]===a[0]&&(t?s[1]===a[1]:!s[1]==!a[1])&&s[2]===a[2],i=Xd(()=>e.children),o=ve(()=>{let s=i();Array.isArray(s)||(s=[s]);for(let a=0;a{const[s,a,l]=o();if(s<0)return e.fallback;const c=l.children,u=typeof c=="function"&&c.length>0;return t=n||u,u?Un(()=>c(a)):c},void 0,void 0)}function jn(e){return e}const q9=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],G9=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...q9]),Z9=new Set(["innerHTML","textContent","innerText","children"]),Q9=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),H2=Object.assign(Object.create(null),{class:"className",formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly"}),J9=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),X9=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),e7={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function t7(e,t,n){let r=n.length,i=t.length,o=r,s=0,a=0,l=t[i-1].nextSibling,c=null;for(;su-a){const m=t[s];for(;a{i=o,t===document?e():Xn(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=""}}function gt(e,t,n){if(typeof window>"u")return null;const r=document.createElement("template");r.innerHTML=e;let i=r.content.firstChild;return n&&(i=i.firstChild),i}function r7(e,t=window.document){const n=t[z2]||(t[z2]=new Set);for(let r=0,i=e.length;ri.call(e,n[1],o))}else e.addEventListener(t,n)}function s7(e,t,n={}){const r=Object.keys(t||{}),i=Object.keys(n);let o,s;for(o=0,s=i.length;oi.children=_c(e,t.children,i.children)),ht(()=>t.ref&&t.ref(e)),ht(()=>l7(e,t,n,!0,i,!0)),i}function Hl(e,t,n){return Un(()=>e(t,n))}function Xn(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return _c(e,t,r,n);ht(i=>_c(e,t(),i,n),r)}function l7(e,t,n,r,i={},o=!1){t||(t={});for(const s in i)if(!(s in t)){if(s==="children")continue;i[s]=Y2(e,s,null,i[s],n,o)}for(const s in t){if(s==="children")continue;const a=t[s];i[s]=Y2(e,s,a,i[s],n,o)}}function c7(e){let t,n;return!Xt.context||!(t=Xt.registry.get(n=d7()))?e.cloneNode(!0):(Xt.completed&&Xt.completed.add(t),Xt.registry.delete(n),t)}function u7(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function V2(e,t,n){const r=t.trim().split(/\s+/);for(let i=0,o=r.length;i-1&&e7[t.split(":")[0]];c?i7(e,c,t,n):Oe(e,Q9[t]||t,n)}return n}function f7(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),Xt.registry&&!Xt.done&&(Xt.done=!0,document.querySelectorAll("[id^=pl-]").forEach(r=>{for(;r&&r.nodeType!==8&&r.nodeValue!=="pl-"+e;){let i=r.nextSibling;r.remove(),r=i}r&&r.remove()}));n;){const r=n[t];if(r&&!n.disabled){const i=n[`${t}Data`];if(i!==void 0?r.call(n,i,e):r.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function _c(e,t,n,r,i){for(Xt.context&&!n&&(n=[...e.childNodes]);typeof n=="function";)n=n();if(t===n)return n;const o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o==="string"||o==="number"){if(Xt.context)return n;if(o==="number"&&(t=t.toString()),s){let a=n[0];a&&a.nodeType===3?a.data=t:a=document.createTextNode(t),n=Zs(e,n,r,a)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||o==="boolean"){if(Xt.context)return n;n=Zs(e,n,r)}else{if(o==="function")return ht(()=>{let a=t();for(;typeof a=="function";)a=a();n=_c(e,a,n,r)}),()=>n;if(Array.isArray(t)){const a=[],l=n&&Array.isArray(n);if(L0(a,t,n,i))return ht(()=>n=_c(e,a,n,r,!0)),()=>n;if(Xt.context){if(!a.length)return n;for(let c=0;c=0;s--){const a=t[s];if(i!==a){const l=a.parentNode===e;!o&&!s?l?e.replaceChild(i,a):e.insertBefore(i,n):l&&a.remove()}else o=!0}}else e.insertBefore(i,n);return[i]}function d7(){const e=Xt.context;return`${e.id}${e.count++}`}const h7="http://www.w3.org/2000/svg";function J3(e,t=!1){return t?document.createElementNS(h7,e):document.createElement(e)}function X3(e){const{useShadow:t}=e,n=document.createTextNode(""),r=e.mount||document.body;function i(){if(Xt.context){const[o,s]=Be(!1);return queueMicrotask(()=>s(!0)),()=>o()&&e.children}else return()=>e.children}if(r instanceof HTMLHeadElement){const[o,s]=Be(!1),a=()=>s(!0);jl(l=>Xn(r,()=>o()?l():i()(),null)),lr(()=>{Xt.context?queueMicrotask(a):a()})}else{const o=J3(e.isSVG?"g":"div",e.isSVG),s=t&&o.attachShadow?o.attachShadow({mode:"open"}):o;Object.defineProperty(o,"_$host",{get(){return n.parentNode},configurable:!0}),Xn(s,i()),r.appendChild(o),e.ref&&e.ref(o),lr(()=>r.removeChild(o))}return n}function Na(e){const[t,n]=cg(e,["component"]),r=ve(()=>t.component);return ve(()=>{const i=r();switch(typeof i){case"function":return Un(()=>i(n));case"string":const o=X9.has(i),s=Xt.context?c7():J3(i,o);return Q3(s,n,o),s}})}var Jt=(e=>(e.DARK="DARK",e.LIGHT="LIGHT",e))(Jt||{});let p7={data:""},g7=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||p7,m7=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,v7=/\/\*[^]*?\*\/| +/g,q2=/\n+/g,gs=(e,t)=>{let n="",r="",i="";for(let o in e){let s=e[o];o[0]=="@"?o[1]=="i"?n=o+" "+s+";":r+=o[1]=="f"?gs(s,o):o+"{"+gs(s,o[1]=="k"?"":t)+"}":typeof s=="object"?r+=gs(s,t?t.replace(/([^,])+/g,a=>o.replace(/(^:.*)|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,a):a?a+" "+l:l)):o):s!=null&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=gs.p?gs.p(o,s):o+":"+s+";")}return n+(t&&i?t+"{"+i+"}":i)+r},Ni={},e4=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+e4(e[n]);return t}return e},y7=(e,t,n,r,i)=>{let o=e4(e),s=Ni[o]||(Ni[o]=(l=>{let c=0,u=11;for(;c>>0;return"go"+u})(o));if(!Ni[s]){let l=o!==e?e:(c=>{let u,d,h=[{}];for(;u=m7.exec(c.replace(v7,""));)u[4]?h.shift():u[3]?(d=u[3].replace(q2," ").trim(),h.unshift(h[0][d]=h[0][d]||{})):h[0][u[1]]=u[2].replace(q2," ").trim();return h[0]})(e);Ni[s]=gs(i?{["@keyframes "+s]:l}:l,n?"":"."+s)}let a=n&&Ni.g?Ni.g:null;return n&&(Ni.g=Ni[s]),((l,c,u,d)=>{d?c.data=c.data.replace(d,l):c.data.indexOf(l)===-1&&(c.data=u?l+c.data:c.data+l)})(Ni[s],t,r,a),s},w7=(e,t,n)=>e.reduce((r,i,o)=>{let s=t[o];if(s&&s.call){let a=s(n),l=a&&a.props&&a.props.className||/^go/.test(a)&&a;s=l?"."+l:a&&typeof a=="object"?a.props?"":gs(a,""):a===!1?"":a}return r+i+(s??"")},"");function so(e){let t=this||{},n=e.call?e(t.p):e;return y7(n.unshift?n.raw?w7(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,g7(t.target),t.g,t.o,t.k)}so.bind({g:1});let x7=so.bind({k:1});const fg=Jd();function b7(e){return _(fg.Provider,{value:e.theme,get children(){return e.children}})}function Ft(){return cr(fg)}function t4(e){let t=this||{};return(...n)=>{const r=i=>{const o=cr(fg),s=Ei(i,{theme:o}),a=Ei(s,{get class(){const g=s.class,m="class"in s&&/^go[0-9]+/.test(g);let y=so.apply({target:t.target,o:m,p:s,g:t.g},n);return[g,y].filter(Boolean).join(" ")}}),[l,c]=cg(a,["as","theme"]),u=c,d=l.as||e;let h;return typeof d=="function"?h=d(u):t.g==1?(h=document.createElement(d),Q3(h,u)):h=Na(Ei({component:d},u)),h};return r.class=i=>Un(()=>so.apply({target:t.target,p:i,g:t.g},n)),r}}const V=new Proxy(t4,{get(e,t){return e(t)}});function _7(){const e=t4.call({g:1},"div").apply(null,arguments);return function(n){return e(n),null}}const ji="tc-root",dg="tc-disable-scroll",r1="tc-using-mouse",C7=()=>{document.body.addEventListener("mousedown",()=>document.body.classList.add(r1)),document.body.addEventListener("keydown",t=>{t.key==="Tab"&&document.body.classList.remove(r1)});const e=_7` +*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o="",s=0;st in e?A9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rt=(e,t)=>{for(var n in t||(t={}))R9.call(t,n)&&M0(e,n,t[n]);if(R2)for(var n of R2(t))D9.call(t,n)&&M0(e,n,t[n]);return e},Tr=(e,t)=>L9(e,O9(t)),$e=(e,t,n)=>(M0(e,typeof t!="symbol"?t+"":t,n),n),At=(e,t,n)=>new Promise((r,i)=>{var o=l=>{try{a(n.next(l))}catch(c){i(c)}},s=l=>{try{a(n.throw(l))}catch(c){i(c)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(o,s);a((n=n.apply(e,t)).next())}),D2,I2,N2,W2,$2,U2,F2,B2;const Xt={};function I9(e){Xt.context=e}const N9=(e,t)=>e===t,ci=Symbol("solid-proxy"),T0=Symbol("solid-track"),Zf={equals:N9};let F3=Y3;const uo=1,Qf=2,B3={owned:null,cleanups:null,context:null,owner:null},t1={};var An=null;let Es=null,nn=null,er=null,Ji=null,lg=0;function jl(e,t){const n=nn,r=An,i=e.length===0,o=i?B3:{owned:null,cleanups:null,context:null,owner:t===void 0?r:t},s=i?e:()=>e(()=>Un(()=>th(o)));An=o,nn=null;try{return Go(s,!0)}finally{nn=n,An=r}}function Be(e,t){t=t?Object.assign({},Zf,t):Zf;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=i=>(typeof i=="function"&&(i=i(n.value)),V3(n,i));return[z3.bind(n),r]}function Jf(e,t,n){const r=eh(e,t,!0,uo);Ka(r)}function ht(e,t,n){const r=eh(e,t,!1,uo);Ka(r)}function $n(e,t,n){F3=z9;const r=eh(e,t,!1,uo);r.user=!0,Ji?Ji.push(r):Ka(r)}function ve(e,t,n){n=n?Object.assign({},Zf,n):Zf;const r=eh(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Ka(r),z3.bind(r)}function W9(e,t,n){let r,i,o;arguments.length===2&&typeof t=="object"||arguments.length===1?(r=!0,i=e,o={}):(r=e,i=t,o={});let s=null,a=t1,l=null,c=!1,u="initialValue"in o,d=typeof r=="function"&&ve(r);const h=new Set,[g,m]=(o.storage||Be)(o.initialValue),[y,k]=Be(void 0),[C,v]=Be(void 0,{equals:!1}),[w,M]=Be(u?"ready":"unresolved");if(Xt.context){l=`${Xt.context.id}${Xt.context.count++}`;let L;o.ssrLoadFrom==="initial"?a=o.initialValue:Xt.load&&(L=Xt.load(l))&&(a=L[0])}function E(L,W,I,R){return s===L&&(s=null,u=!0,(L===a||W===a)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated(R,{value:W})),a=t1,O(W,I)),W}function O(L,W){Go(()=>{W===void 0&&m(()=>L),M(W!==void 0?"errored":"ready"),k(W);for(const I of h.keys())I.decrement();h.clear()},!1)}function T(){const L=B9,W=g(),I=y();if(I!==void 0&&!s)throw I;return nn&&!nn.user&&L&&Jf(()=>{C(),s&&(L.resolved||h.has(L)||(L.increment(),h.add(L)))}),W}function P(L=!0){if(L!==!1&&c)return;c=!1;const W=d?d():r;if(W==null||W===!1){E(s,Un(g));return}const I=a!==t1?a:Un(()=>i(W,{value:g(),refetching:L}));return typeof I!="object"||!(I&&"then"in I)?(E(s,I,void 0,W),I):(s=I,c=!0,queueMicrotask(()=>c=!1),Go(()=>{M(u?"refreshing":"pending"),v()},!1),I.then(R=>E(I,R,void 0,W),R=>E(I,void 0,q3(R),W)))}return Object.defineProperties(T,{state:{get:()=>w()},error:{get:()=>y()},loading:{get(){const L=w();return L==="pending"||L==="refreshing"}},latest:{get(){if(!u)return T();const L=y();if(L&&!s)throw L;return g()}}}),d?Jf(()=>P(!1)):P(!1),[T,{refetch:P,mutate:m}]}function j3(e){return Go(e,!1)}function Un(e){if(nn===null)return e();const t=nn;nn=null;try{return e()}finally{nn=t}}function $9(e,t,n){const r=Array.isArray(e);let i;return o=>{let s;if(r){s=Array(e.length);for(let l=0;lt(s,i,o));return i=s,a}}function U9(e){$n(()=>Un(e))}function lr(e){return An===null||(An.cleanups===null?An.cleanups=[e]:An.cleanups.push(e)),e}function H3(){return nn}function F9(){return An}function Jd(e,t){const n=Symbol("context");return{id:n,Provider:V9(n),defaultValue:e}}function cr(e){let t;return(t=Z3(An,e.id))!==void 0?t:e.defaultValue}function Xd(e){const t=ve(e),n=ve(()=>P0(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let B9;function z3(){const e=Es;if(this.sources&&(this.state||e))if(this.state===uo||e)Ka(this);else{const t=er;er=null,Go(()=>ed(this),!1),er=t}if(nn){const t=this.observers?this.observers.length:0;nn.sources?(nn.sources.push(this),nn.sourceSlots.push(t)):(nn.sources=[this],nn.sourceSlots=[t]),this.observers?(this.observers.push(nn),this.observerSlots.push(nn.sources.length-1)):(this.observers=[nn],this.observerSlots=[nn.sources.length-1])}return this.value}function V3(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Go(()=>{for(let i=0;i1e6)throw er=[],new Error},!1)),t}function Ka(e){if(!e.fn)return;th(e);const t=An,n=nn,r=lg;nn=An=e,j9(e,e.value,r),nn=n,An=t}function j9(e,t,n){let r;try{r=e.fn(t)}catch(i){e.pure&&(e.state=uo,e.owned&&e.owned.forEach(th),e.owned=null),G3(i)}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?V3(e,r):e.value=r,e.updatedAt=n)}function eh(e,t,n,r=uo,i){const o={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:An,context:null,pure:n};return An===null||An!==B3&&(An.owned?An.owned.push(o):An.owned=[o]),o}function Xf(e){const t=Es;if(e.state===0||t)return;if(e.state===Qf||t)return ed(e);if(e.suspense&&Un(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;r--)if(e=n[r],e.state===uo||t)Ka(e);else if(e.state===Qf||t){const i=er;er=null,Go(()=>ed(e,n[0]),!1),er=i}}function Go(e,t){if(er)return e();let n=!1;t||(er=[]),Ji?n=!0:Ji=[],lg++;try{const r=e();return H9(n),r}catch(r){n||(Ji=null),er=null,G3(r)}}function H9(e){if(er&&(Y3(er),er=null),e)return;const t=Ji;Ji=null,t.length&&Go(()=>F3(t),!1)}function Y3(e){for(let t=0;ti=Un(()=>(An.context={[e]:r.value},Xd(()=>r.children))),void 0),i}}const Y9=Symbol("fallback");function j2(e){for(let t=0;t1?[]:null;return lr(()=>j2(o)),()=>{let l=e()||[],c,u;return l[T0],Un(()=>{let h=l.length,g,m,y,k,C,v,w,M,E;if(h===0)s!==0&&(j2(o),o=[],r=[],i=[],s=0,a&&(a=[])),n.fallback&&(r=[Y9],i[0]=jl(O=>(o[0]=O,n.fallback())),s=1);else if(s===0){for(i=new Array(h),u=0;u=v&&M>=v&&r[w]===l[M];w--,M--)y[M]=i[w],k[M]=o[w],a&&(C[M]=a[w]);for(g=new Map,m=new Array(M+1),u=M;u>=v;u--)E=l[u],c=g.get(E),m[u]=c===void 0?-1:c,g.set(E,u);for(c=v;c<=w;c++)E=r[c],u=g.get(E),u!==void 0&&u!==-1?(y[u]=i[c],k[u]=o[c],a&&(C[u]=a[c]),u=m[u],g.set(E,u)):o[c]();for(u=v;ue(t||{}))}function Mu(){return!0}const A0={get(e,t,n){return t===ci?n:e.get(t)},has(e,t){return t===ci?!0:e.has(t)},set:Mu,deleteProperty:Mu,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Mu,deleteProperty:Mu}},ownKeys(e){return e.keys()}};function n1(e){return(e=typeof e=="function"?e():e)?e:{}}function Ei(...e){let t=!1;for(let r=0;r=0;i--){const o=n1(e[i])[r];if(o!==void 0)return o}},has(r){for(let i=e.length-1;i>=0;i--)if(r in n1(e[i]))return!0;return!1},keys(){const r=[];for(let i=0;i=0;r--)if(e[r]){const i=Object.getOwnPropertyDescriptors(e[r]);for(const o in i)o in n||Object.defineProperty(n,o,{enumerable:!0,get(){for(let s=e.length-1;s>=0;s--){const a=(e[s]||{})[o];if(a!==void 0)return a}}})}return n}function cg(e,...t){const n=new Set(t.flat());if(ci in e){const i=t.map(o=>new Proxy({get(s){return o.includes(s)?e[s]:void 0},has(s){return o.includes(s)&&s in e},keys(){return o.filter(s=>s in e)}},A0));return i.push(new Proxy({get(o){return n.has(o)?void 0:e[o]},has(o){return n.has(o)?!1:o in e},keys(){return Object.keys(e).filter(o=>!n.has(o))}},A0)),i}const r=Object.getOwnPropertyDescriptors(e);return t.push(Object.keys(r).filter(i=>!n.has(i))),t.map(i=>{const o={};for(let s=0;se.fallback};return ve(K9(()=>e.each,e.children,t||void 0))}function Ye(e){let t=!1;const n=e.keyed,r=ve(()=>e.when,void 0,{equals:(i,o)=>t?i===o:!i==!o});return ve(()=>{const i=r();if(i){const o=e.children,s=typeof o=="function"&&o.length>0;return t=n||s,s?Un(()=>o(i)):o}return e.fallback},void 0,void 0)}function zc(e){let t=!1,n=!1;const r=(s,a)=>s[0]===a[0]&&(t?s[1]===a[1]:!s[1]==!a[1])&&s[2]===a[2],i=Xd(()=>e.children),o=ve(()=>{let s=i();Array.isArray(s)||(s=[s]);for(let a=0;a{const[s,a,l]=o();if(s<0)return e.fallback;const c=l.children,u=typeof c=="function"&&c.length>0;return t=n||u,u?Un(()=>c(a)):c},void 0,void 0)}function jn(e){return e}const q9=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],G9=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...q9]),Z9=new Set(["innerHTML","textContent","innerText","children"]),Q9=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),H2=Object.assign(Object.create(null),{class:"className",formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly"}),J9=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),X9=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),e7={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function t7(e,t,n){let r=n.length,i=t.length,o=r,s=0,a=0,l=t[i-1].nextSibling,c=null;for(;su-a){const m=t[s];for(;a{i=o,t===document?e():Xn(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=""}}function gt(e,t,n){if(typeof window>"u")return null;const r=document.createElement("template");r.innerHTML=e;let i=r.content.firstChild;return n&&(i=i.firstChild),i}function r7(e,t=window.document){const n=t[z2]||(t[z2]=new Set);for(let r=0,i=e.length;ri.call(e,n[1],o))}else e.addEventListener(t,n)}function s7(e,t,n={}){const r=Object.keys(t||{}),i=Object.keys(n);let o,s;for(o=0,s=i.length;oi.children=_c(e,t.children,i.children)),ht(()=>t.ref&&t.ref(e)),ht(()=>l7(e,t,n,!0,i,!0)),i}function Hl(e,t,n){return Un(()=>e(t,n))}function Xn(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return _c(e,t,r,n);ht(i=>_c(e,t(),i,n),r)}function l7(e,t,n,r,i={},o=!1){t||(t={});for(const s in i)if(!(s in t)){if(s==="children")continue;i[s]=Y2(e,s,null,i[s],n,o)}for(const s in t){if(s==="children")continue;const a=t[s];i[s]=Y2(e,s,a,i[s],n,o)}}function c7(e){let t,n;return!Xt.context||!(t=Xt.registry.get(n=d7()))?e.cloneNode(!0):(Xt.completed&&Xt.completed.add(t),Xt.registry.delete(n),t)}function u7(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function V2(e,t,n){const r=t.trim().split(/\s+/);for(let i=0,o=r.length;i-1&&e7[t.split(":")[0]];c?i7(e,c,t,n):Oe(e,Q9[t]||t,n)}return n}function f7(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),Xt.registry&&!Xt.done&&(Xt.done=!0,document.querySelectorAll("[id^=pl-]").forEach(r=>{for(;r&&r.nodeType!==8&&r.nodeValue!=="pl-"+e;){let i=r.nextSibling;r.remove(),r=i}r&&r.remove()}));n;){const r=n[t];if(r&&!n.disabled){const i=n[`${t}Data`];if(i!==void 0?r.call(n,i,e):r.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function _c(e,t,n,r,i){for(Xt.context&&!n&&(n=[...e.childNodes]);typeof n=="function";)n=n();if(t===n)return n;const o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o==="string"||o==="number"){if(Xt.context)return n;if(o==="number"&&(t=t.toString()),s){let a=n[0];a&&a.nodeType===3?a.data=t:a=document.createTextNode(t),n=Zs(e,n,r,a)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||o==="boolean"){if(Xt.context)return n;n=Zs(e,n,r)}else{if(o==="function")return ht(()=>{let a=t();for(;typeof a=="function";)a=a();n=_c(e,a,n,r)}),()=>n;if(Array.isArray(t)){const a=[],l=n&&Array.isArray(n);if(L0(a,t,n,i))return ht(()=>n=_c(e,a,n,r,!0)),()=>n;if(Xt.context){if(!a.length)return n;for(let c=0;c=0;s--){const a=t[s];if(i!==a){const l=a.parentNode===e;!o&&!s?l?e.replaceChild(i,a):e.insertBefore(i,n):l&&a.remove()}else o=!0}}else e.insertBefore(i,n);return[i]}function d7(){const e=Xt.context;return`${e.id}${e.count++}`}const h7="http://www.w3.org/2000/svg";function J3(e,t=!1){return t?document.createElementNS(h7,e):document.createElement(e)}function X3(e){const{useShadow:t}=e,n=document.createTextNode(""),r=e.mount||document.body;function i(){if(Xt.context){const[o,s]=Be(!1);return queueMicrotask(()=>s(!0)),()=>o()&&e.children}else return()=>e.children}if(r instanceof HTMLHeadElement){const[o,s]=Be(!1),a=()=>s(!0);jl(l=>Xn(r,()=>o()?l():i()(),null)),lr(()=>{Xt.context?queueMicrotask(a):a()})}else{const o=J3(e.isSVG?"g":"div",e.isSVG),s=t&&o.attachShadow?o.attachShadow({mode:"open"}):o;Object.defineProperty(o,"_$host",{get(){return n.parentNode},configurable:!0}),Xn(s,i()),r.appendChild(o),e.ref&&e.ref(o),lr(()=>r.removeChild(o))}return n}function Na(e){const[t,n]=cg(e,["component"]),r=ve(()=>t.component);return ve(()=>{const i=r();switch(typeof i){case"function":return Un(()=>i(n));case"string":const o=X9.has(i),s=Xt.context?c7():J3(i,o);return Q3(s,n,o),s}})}var Jt=(e=>(e.DARK="DARK",e.LIGHT="LIGHT",e))(Jt||{});let p7={data:""},g7=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||p7,m7=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,v7=/\/\*[^]*?\*\/| +/g,q2=/\n+/g,gs=(e,t)=>{let n="",r="",i="";for(let o in e){let s=e[o];o[0]=="@"?o[1]=="i"?n=o+" "+s+";":r+=o[1]=="f"?gs(s,o):o+"{"+gs(s,o[1]=="k"?"":t)+"}":typeof s=="object"?r+=gs(s,t?t.replace(/([^,])+/g,a=>o.replace(/(^:.*)|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,a):a?a+" "+l:l)):o):s!=null&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=gs.p?gs.p(o,s):o+":"+s+";")}return n+(t&&i?t+"{"+i+"}":i)+r},Ni={},e4=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+e4(e[n]);return t}return e},y7=(e,t,n,r,i)=>{let o=e4(e),s=Ni[o]||(Ni[o]=(l=>{let c=0,u=11;for(;c>>0;return"go"+u})(o));if(!Ni[s]){let l=o!==e?e:(c=>{let u,d,h=[{}];for(;u=m7.exec(c.replace(v7,""));)u[4]?h.shift():u[3]?(d=u[3].replace(q2," ").trim(),h.unshift(h[0][d]=h[0][d]||{})):h[0][u[1]]=u[2].replace(q2," ").trim();return h[0]})(e);Ni[s]=gs(i?{["@keyframes "+s]:l}:l,n?"":"."+s)}let a=n&&Ni.g?Ni.g:null;return n&&(Ni.g=Ni[s]),((l,c,u,d)=>{d?c.data=c.data.replace(d,l):c.data.indexOf(l)===-1&&(c.data=u?l+c.data:c.data+l)})(Ni[s],t,r,a),s},w7=(e,t,n)=>e.reduce((r,i,o)=>{let s=t[o];if(s&&s.call){let a=s(n),l=a&&a.props&&a.props.className||/^go/.test(a)&&a;s=l?"."+l:a&&typeof a=="object"?a.props?"":gs(a,""):a===!1?"":a}return r+i+(s??"")},"");function so(e){let t=this||{},n=e.call?e(t.p):e;return y7(n.unshift?n.raw?w7(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,g7(t.target),t.g,t.o,t.k)}so.bind({g:1});let x7=so.bind({k:1});const fg=Jd();function b7(e){return _(fg.Provider,{value:e.theme,get children(){return e.children}})}function Ft(){return cr(fg)}function t4(e){let t=this||{};return(...n)=>{const r=i=>{const o=cr(fg),s=Ei(i,{theme:o}),a=Ei(s,{get class(){const g=s.class,m="class"in s&&/^go[0-9]+/.test(g);let y=so.apply({target:t.target,o:m,p:s,g:t.g},n);return[g,y].filter(Boolean).join(" ")}}),[l,c]=cg(a,["as","theme"]),u=c,d=l.as||e;let h;return typeof d=="function"?h=d(u):t.g==1?(h=document.createElement(d),Q3(h,u)):h=Na(Ei({component:d},u)),h};return r.class=i=>Un(()=>so.apply({target:t.target,p:i,g:t.g},n)),r}}const V=new Proxy(t4,{get(e,t){return e(t)}});function _7(){const e=t4.call({g:1},"div").apply(null,arguments);return function(n){return e(n),null}}const ji="tc-root",dg="tc-disable-scroll",r1="tc-using-mouse",C7=()=>{document.body.addEventListener("mousedown",()=>document.body.classList.add(r1)),document.body.addEventListener("keydown",t=>{t.key==="Tab"&&document.body.classList.remove(r1)});const e=_7` ${ji} * { margin: 0; padding: 0; @@ -371,8 +371,8 @@ PERFORMANCE OF THIS SOFTWARE. filter: drop-shadow(0px 2px 8px rgba(0, 0, 0, 0.08)); background-color: ${e=>e.theme.colors.background.segment}; -`;var w4={exports:{}};(function(e,t){var n=function(){var r=function(E,O){var T=236,P=17,L=E,W=o[O],I=null,R=0,G=null,Z=[],Y={},fe=function(K,q){R=L*4+17,I=function(B){for(var te=new Array(B),ne=0;ne=7&&Ze(K),G==null&&(G=Pe(L,W,Z)),st(G,q)},Ce=function(K,q){for(var B=-1;B<=7;B+=1)if(!(K+B<=-1||R<=K+B))for(var te=-1;te<=7;te+=1)q+te<=-1||R<=q+te||(0<=B&&B<=6&&(te==0||te==6)||0<=te&&te<=6&&(B==0||B==6)||2<=B&&B<=4&&2<=te&&te<=4?I[K+B][q+te]=!0:I[K+B][q+te]=!1)},Q=function(){for(var K=0,q=0,B=0;B<8;B+=1){fe(!0,B);var te=a.getLostPoint(Y);(B==0||K>te)&&(K=te,q=B)}return q},ue=function(){for(var K=8;K>B&1)==1;I[Math.floor(B/3)][B%3+R-8-3]=te}for(var B=0;B<18;B+=1){var te=!K&&(q>>B&1)==1;I[B%3+R-8-3][Math.floor(B/3)]=te}},je=function(K,q){for(var B=W<<3|q,te=a.getBCHTypeInfo(B),ne=0;ne<15;ne+=1){var ie=!K&&(te>>ne&1)==1;ne<6?I[ne][8]=ie:ne<8?I[ne+1][8]=ie:I[R-15+ne][8]=ie}for(var ne=0;ne<15;ne+=1){var ie=!K&&(te>>ne&1)==1;ne<8?I[8][R-ne-1]=ie:ne<9?I[8][15-ne-1+1]=ie:I[8][15-ne-1]=ie}I[R-8][8]=!K},st=function(K,q){for(var B=-1,te=R-1,ne=7,ie=0,Te=a.getMaskFunction(q),Ae=R-1;Ae>0;Ae-=2)for(Ae==6&&(Ae-=1);;){for(var Xe=0;Xe<2;Xe+=1)if(I[te][Ae-Xe]==null){var Dt=!1;ie>>ne&1)==1);var We=Te(te,Ae-Xe);We&&(Dt=!Dt),I[te][Ae-Xe]=Dt,ne-=1,ne==-1&&(ie+=1,ne=7)}if(te+=B,te<0||R<=te){te-=B,B=-B;break}}},ft=function(K,q){for(var B=0,te=0,ne=0,ie=new Array(q.length),Te=new Array(q.length),Ae=0;Ae=0?dr.getAt(_n):0}}for(var En=0,We=0;WeAe*8)throw"code length overflow. ("+ne.getLengthInBits()+">"+Ae*8+")";for(ne.getLengthInBits()+4<=Ae*8&&ne.put(0,4);ne.getLengthInBits()%8!=0;)ne.putBit(!1);for(;!(ne.getLengthInBits()>=Ae*8||(ne.put(T,8),ne.getLengthInBits()>=Ae*8));)ne.put(P,8);return ft(ne,te)};Y.addData=function(K,q){q=q||"Byte";var B=null;switch(q){case"Numeric":B=h(K);break;case"Alphanumeric":B=g(K);break;case"Byte":B=m(K);break;case"Kanji":B=y(K);break;default:throw"mode:"+q}Z.push(B),G=null},Y.isDark=function(K,q){if(K<0||R<=K||q<0||R<=q)throw K+","+q;return I[K][q]},Y.getModuleCount=function(){return R},Y.make=function(){if(L<1){for(var K=1;K<40;K++){for(var q=u.getRSBlocks(K,W),B=d(),te=0;te"u"?K*4:q;var B="";B+='";for(var ne=0;ne';B+=""}return B+="",B+="
",B},Y.createSvgTag=function(K,q,B,te){var ne={};typeof arguments[0]=="object"&&(ne=arguments[0],K=ne.cellSize,q=ne.margin,B=ne.alt,te=ne.title),K=K||2,q=typeof q>"u"?K*4:q,B=typeof B=="string"?{text:B}:B||{},B.text=B.text||null,B.id=B.text?B.id||"qrcode-description":null,te=typeof te=="string"?{text:te}:te||{},te.text=te.text||null,te.id=te.text?te.id||"qrcode-title":null;var ie=Y.getModuleCount()*K+q*2,Te,Ae,Xe,Dt,We="",Gt;for(Gt="l"+K+",0 0,"+K+" -"+K+",0 0,-"+K+"z ",We+=''+tt(te.text)+"":"",We+=B.text?''+tt(B.text)+"":"",We+='',We+='"u"?K*4:q;var B=Y.getModuleCount()*K+q*2,te=q,ne=B-q;return M(B,B,function(ie,Te){if(te<=ie&&ie"u"?K*4:q;var te=Y.getModuleCount()*K+q*2,ne="";return ne+="",ne};var tt=function(K){for(var q="",B=0;B":q+=">";break;case"&":q+="&";break;case'"':q+=""";break;default:q+=te;break}}return q},rr=function(K){var q=1;K=typeof K>"u"?q*2:K;var B=Y.getModuleCount()*q+K*2,te=K,ne=B-K,ie,Te,Ae,Xe,Dt,We={"██":"█","█ ":"▀"," █":"▄"," ":" "},Gt={"██":"▀","█ ":"▀"," █":" "," ":" "},an="";for(ie=0;ie=ne?Gt[Dt]:We[Dt];an+=` -`}return B%2&&K>0?an.substring(0,an.length-B-1)+Array(B+1).join("▀"):an.substring(0,an.length-1)};return Y.createASCII=function(K,q){if(K=K||1,K<2)return rr(q);K-=1,q=typeof q>"u"?K*2:q;var B=Y.getModuleCount()*K+q*2,te=q,ne=B-q,ie,Te,Ae,Xe,Dt=Array(K+1).join("██"),We=Array(K+1).join(" "),Gt="",an="";for(ie=0;ie=7&&Ze(K),G==null&&(G=Pe(L,W,Z)),st(G,q)},Ce=function(K,q){for(var B=-1;B<=7;B+=1)if(!(K+B<=-1||R<=K+B))for(var te=-1;te<=7;te+=1)q+te<=-1||R<=q+te||(0<=B&&B<=6&&(te==0||te==6)||0<=te&&te<=6&&(B==0||B==6)||2<=B&&B<=4&&2<=te&&te<=4?I[K+B][q+te]=!0:I[K+B][q+te]=!1)},Q=function(){for(var K=0,q=0,B=0;B<8;B+=1){fe(!0,B);var te=a.getLostPoint(Y);(B==0||K>te)&&(K=te,q=B)}return q},ue=function(){for(var K=8;K>B&1)==1;I[Math.floor(B/3)][B%3+R-8-3]=te}for(var B=0;B<18;B+=1){var te=!K&&(q>>B&1)==1;I[B%3+R-8-3][Math.floor(B/3)]=te}},je=function(K,q){for(var B=W<<3|q,te=a.getBCHTypeInfo(B),ne=0;ne<15;ne+=1){var ie=!K&&(te>>ne&1)==1;ne<6?I[ne][8]=ie:ne<8?I[ne+1][8]=ie:I[R-15+ne][8]=ie}for(var ne=0;ne<15;ne+=1){var ie=!K&&(te>>ne&1)==1;ne<8?I[8][R-ne-1]=ie:ne<9?I[8][15-ne-1+1]=ie:I[8][15-ne-1]=ie}I[R-8][8]=!K},st=function(K,q){for(var B=-1,te=R-1,ne=7,ie=0,Te=a.getMaskFunction(q),Ae=R-1;Ae>0;Ae-=2)for(Ae==6&&(Ae-=1);;){for(var Xe=0;Xe<2;Xe+=1)if(I[te][Ae-Xe]==null){var Dt=!1;ie>>ne&1)==1);var We=Te(te,Ae-Xe);We&&(Dt=!Dt),I[te][Ae-Xe]=Dt,ne-=1,ne==-1&&(ie+=1,ne=7)}if(te+=B,te<0||R<=te){te-=B,B=-B;break}}},ft=function(K,q){for(var B=0,te=0,ne=0,ie=new Array(q.length),Te=new Array(q.length),Ae=0;Ae=0?dr.getAt(_n):0}}for(var En=0,We=0;WeAe*8)throw"code length overflow. ("+ne.getLengthInBits()+">"+Ae*8+")";for(ne.getLengthInBits()+4<=Ae*8&&ne.put(0,4);ne.getLengthInBits()%8!=0;)ne.putBit(!1);for(;!(ne.getLengthInBits()>=Ae*8||(ne.put(T,8),ne.getLengthInBits()>=Ae*8));)ne.put(P,8);return ft(ne,te)};Y.addData=function(K,q){q=q||"Byte";var B=null;switch(q){case"Numeric":B=h(K);break;case"Alphanumeric":B=g(K);break;case"Byte":B=m(K);break;case"Kanji":B=y(K);break;default:throw"mode:"+q}Z.push(B),G=null},Y.isDark=function(K,q){if(K<0||R<=K||q<0||R<=q)throw K+","+q;return I[K][q]},Y.getModuleCount=function(){return R},Y.make=function(){if(L<1){for(var K=1;K<40;K++){for(var q=u.getRSBlocks(K,W),B=d(),te=0;te"u"?K*4:q;var B="";B+='";for(var ne=0;ne';B+=""}return B+="",B+="
",B},Y.createSvgTag=function(K,q,B,te){var ne={};typeof arguments[0]=="object"&&(ne=arguments[0],K=ne.cellSize,q=ne.margin,B=ne.alt,te=ne.title),K=K||2,q=typeof q>"u"?K*4:q,B=typeof B=="string"?{text:B}:B||{},B.text=B.text||null,B.id=B.text?B.id||"qrcode-description":null,te=typeof te=="string"?{text:te}:te||{},te.text=te.text||null,te.id=te.text?te.id||"qrcode-title":null;var ie=Y.getModuleCount()*K+q*2,Te,Ae,Xe,Dt,We="",Gt;for(Gt="l"+K+",0 0,"+K+" -"+K+",0 0,-"+K+"z ",We+=''+tt(te.text)+"":"",We+=B.text?''+tt(B.text)+"":"",We+='',We+='"u"?K*4:q;var B=Y.getModuleCount()*K+q*2,te=q,ne=B-q;return M(B,B,function(ie,Te){if(te<=ie&&ie"u"?K*4:q;var te=Y.getModuleCount()*K+q*2,ne="";return ne+="",ne};var tt=function(K){for(var q="",B=0;B":q+=">";break;case"&":q+="&";break;case'"':q+=""";break;default:q+=te;break}}return q},rr=function(K){var q=1;K=typeof K>"u"?q*2:K;var B=Y.getModuleCount()*q+K*2,te=K,ne=B-K,ie,Te,Ae,Xe,Dt,We={"██":"█","█ ":"▀"," █":"▄"," ":" "},Gt={"██":"▀","█ ":"▀"," █":" "," ":" "},ln="";for(ie=0;ie=ne?Gt[Dt]:We[Dt];ln+=` +`}return B%2&&K>0?ln.substring(0,ln.length-B-1)+Array(B+1).join("▀"):ln.substring(0,ln.length-1)};return Y.createASCII=function(K,q){if(K=K||1,K<2)return rr(q);K-=1,q=typeof q>"u"?K*2:q;var B=Y.getModuleCount()*K+q*2,te=q,ne=B-q,ie,Te,Ae,Xe,Dt=Array(K+1).join("██"),We=Array(K+1).join(" "),Gt="",ln="";for(ie=0;ie>>8),W.push(G&255)):W.push(P)}}return W}};var i={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},o={L:1,M:0,Q:3,H:2},s={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},a=function(){var E=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],O=1335,T=7973,P=21522,L={},W=function(I){for(var R=0;I!=0;)R+=1,I>>>=1;return R};return L.getBCHTypeInfo=function(I){for(var R=I<<10;W(R)-W(O)>=0;)R^=O<=0;)R^=T<5&&(G+=3+fe-5)}for(var Z=0;Z=256;)L-=255;return E[L]},P}();function c(E,O){if(typeof E.length>"u")throw E.length+"/"+O;var T=function(){for(var L=0;L"u")throw"bad rs block @ typeNumber:"+L+"/errorCorrectionLevel:"+W;for(var R=I.length/3,G=[],Z=0;Z>>7-P%8&1)==1},T.put=function(P,L){for(var W=0;W>>L-W-1&1)==1)},T.getLengthInBits=function(){return O},T.putBit=function(P){var L=Math.floor(O/8);E.length<=L&&E.push(0),P&&(E[L]|=128>>>O%8),O+=1},T},h=function(E){var O=i.MODE_NUMBER,T=E,P={};P.getMode=function(){return O},P.getLength=function(I){return T.length},P.write=function(I){for(var R=T,G=0;G+2>>8&255)*192+(G&255),W.put(G,13),R+=2}if(R>>8)},O.writeBytes=function(T,P,L){P=P||0,L=L||T.length;for(var W=0;W0&&(T+=","),T+=E[P];return T+="]",T},O},C=function(){var E=0,O=0,T=0,P="",L={},W=function(R){P+=String.fromCharCode(I(R&63))},I=function(R){if(!(R<0)){if(R<26)return 65+R;if(R<52)return 97+(R-26);if(R<62)return 48+(R-52);if(R==62)return 43;if(R==63)return 47}throw"n:"+R};return L.writeByte=function(R){for(E=E<<8|R&255,O+=8,T+=1;O>=6;)W(E>>>O-6),O-=6},L.flush=function(){if(O>0&&(W(E<<6-O),E=0,O=0),T%3!=0)for(var R=3-T%3,G=0;G=O.length){if(L==0)return-1;throw"unexpected end of file./"+L}var R=O.charAt(T);if(T+=1,R=="=")return L=0,-1;if(R.match(/^\s$/))continue;P=P<<6|I(R.charCodeAt(0)),L+=6}var G=P>>>L-8&255;return L-=8,G};var I=function(R){if(65<=R&&R<=90)return R-65;if(97<=R&&R<=122)return R-97+26;if(48<=R&&R<=57)return R-48+52;if(R==43)return 62;if(R==47)return 63;throw"c:"+R};return W},w=function(E,O){var T=E,P=O,L=new Array(E*O),W={};W.setPixel=function(Z,Y,fe){L[Y*T+Z]=fe},W.write=function(Z){Z.writeString("GIF87a"),Z.writeShort(T),Z.writeShort(P),Z.writeByte(128),Z.writeByte(0),Z.writeByte(0),Z.writeByte(0),Z.writeByte(0),Z.writeByte(0),Z.writeByte(255),Z.writeByte(255),Z.writeByte(255),Z.writeString(","),Z.writeShort(0),Z.writeShort(0),Z.writeShort(T),Z.writeShort(P),Z.writeByte(0);var Y=2,fe=R(Y);Z.writeByte(Y);for(var Ce=0;fe.length-Ce>255;)Z.writeByte(255),Z.writeBytes(fe,Ce,255),Ce+=255;Z.writeByte(fe.length-Ce),Z.writeBytes(fe,Ce,fe.length-Ce),Z.writeByte(0),Z.writeString(";")};var I=function(Z){var Y=Z,fe=0,Ce=0,Q={};return Q.write=function(ue,ge){if(ue>>>ge)throw"length over";for(;fe+ge>=8;)Y.writeByte(255&(ue<>>=8-fe,Ce=0,fe=0;Ce=ue<0&&Y.writeByte(Ce)},Q},R=function(Z){for(var Y=1<>6,128|l&63):l<55296||l>=57344?s.push(224|l>>12,128|l>>6&63,128|l&63):(a++,l=65536+((l&1023)<<10|o.charCodeAt(a)&1023),s.push(240|l>>18,128|l>>12&63,128|l>>6&63,128|l&63))}return s}return i(r)}})(),function(r){e.exports=r()}(function(){return n})})(w4);const JC=w4.exports;function xg(e){return At(this,null,function*(){try{if(!(navigator!=null&&navigator.clipboard))throw new vn("Clipboard API not available");return yield navigator.clipboard.writeText(e)}catch{}XC(e)})}function XC(e){const t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")}finally{document.body.removeChild(t)}}const eS=gt("
"),nh=e=>{let t,n,r;const[i,o]=Be(!1),[s,a]=Be(rv);$n(()=>{const h=JC(0,"L");h.addData(e.sourceUrl),h.make(),t.innerHTML=h.createSvgTag(4,0);const g=t.firstElementChild.clientWidth,m=Math.round(y4/g*1e5)/1e5;if(r){const y=Math.ceil(I0/(m*4))*4,k=Mi(Math.ceil((g-y)/(2*4))*4);r.style.top=k,r.style.left=k,r.style.height=Mi(y),r.style.width=Mi(y),a(Math.round(rv/m))}n.style.transform=`scale(${m})`});let l=null;return _(KC,{get class(){return e.class},onClick:()=>{o(!0),xg(e.sourceUrl),l!=null&&clearTimeout(l),l=setTimeout(()=>o(!1),1500)},get children(){return[_(qC,{ref(u){const d=n;typeof d=="function"?d(u):n=u},get children(){return[(()=>{const u=eS.cloneNode(!0),d=t;return typeof d=="function"?Hl(d,u):t=u,u})(),_(Ye,{get when(){return e.imageUrl},get children(){return _(GC,{ref(u){const d=r;typeof d=="function"?d(u):r=u},get children(){return _(ZC,{get src(){return e.imageUrl},alt:"",get size(){return s()}})}})}})]}}),_(wg,{onBeforeEnter:u=>{bi(u,[{opacity:0,transform:"translate(-50%, 44px)"},{opacity:1,transform:"translate(-50%, 0)"}],{duration:150,easing:"ease-out"})},onExit:(u,d)=>{bi(u,[{opacity:1,transform:"translate(-50%, 0)"},{opacity:0,transform:"translate(-50%, 44px)"}],{duration:150,easing:"ease-out"}).finished.then(()=>{d()})},get children(){return _(Ye,{get when(){return i()&&!e.disableCopy},get children(){return _(QC,{get children(){return[_(_g,{size:"xs"}),_(Or,{translationKey:"common.linkCopied",children:"Link Copied"})]}})}})}}),_(Ye,{get when(){return!e.disableCopy},get children(){return _(ff,{get children(){return _(_4,{})}})}})]}})};var N0=(e,t,n)=>{const r=t.trim().split(".").reduce((i,o)=>i?i[o]:void 0,e);return r!==void 0?r:n},tS=(e,t,n=/{{(.*?)}}/g)=>e.replace(n,(r,i)=>N0(t,i,"")),nS=(e={},t=navigator.language in e?navigator.language:Object.keys(e)[0])=>{const[n,r]=Be(t),[i,o]=mg(e);return[(l,c,u)=>{const d=N0(i[n()],l,u||"");return typeof d=="function"?d(c):typeof d=="string"?tS(d,c||{}):d},{add(l,c){o(l,u=>Object.assign(u||{},c))},locale:l=>l?r(l):n(),dict:l=>N0(i,l)}]},x4=Jd({}),Oi=()=>cr(x4);const rS=V.div` font-style: normal; font-weight: ${e=>e.fontWeight}; @@ -1096,7 +1096,7 @@ PERFORMANCE OF THIS SOFTWARE. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Mv;function $M(){if(Mv)return cl;Mv=1;var e=Pd,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var u,d={},h=null,g=null;c!==void 0&&(h=""+c),l.key!==void 0&&(h=""+l.key),l.ref!==void 0&&(g=l.ref);for(u in l)r.call(l,u)&&!o.hasOwnProperty(u)&&(d[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)d[u]===void 0&&(d[u]=l[u]);return{$$typeof:t,type:a,key:h,ref:g,props:d,_owner:i.current}}return cl.Fragment=n,cl.jsx=s,cl.jsxs=s,cl}(function(e){e.exports=$M()})(V4);const Y4=V4.exports.jsx;function K4(){return typeof window<"u"}function UM(){return!K4()}const q4=nn.createContext(null);let h1=null;const FM=e=>{var t=e,{children:n}=t,r=WM(t,["children"]);return K4()&&!h1&&(h1=new DM(r)),Y4(q4.Provider,{value:h1,children:n})},BM=nn.memo(FM);class Tg extends vn{constructor(...t){super(...t),Object.setPrototypeOf(this,Tg.prototype)}}class Pg extends Tg{constructor(...t){super(...t),Object.setPrototypeOf(this,Pg.prototype)}}function jM(e){if(!e)throw new Pg("You should add on the top of the app to use TonConnect");return!0}function G4(){const e=nn.useContext(q4),t=nn.useCallback(n=>{e&&(e.uiOptions=n)},[e]);return UM()?[null,()=>{}]:(jM(e),[e,t])}const Tv="ton-connect-button",HM=({className:e,style:t})=>{const[n,r]=G4();return nn.useEffect(()=>(r({buttonRootId:Tv}),()=>r({buttonRootId:null})),[r]),Y4("div",{id:Tv,className:e,style:NM({width:"fit-content"},t)})},zM=nn.memo(HM),VM=()=>{const[e,t]=G4();return t({uiPreferences:{borderRadius:"m"}}),hn.jsx("footer",{className:"footer"})},YM=()=>{const[e,t]=nn.useState(null);return nn.useEffect(()=>{let n;if(window.Telegram)n=window.Telegram.WebApp;else{console.error("Telegram WebApp is not available");return}n.ready();const r=n.initDataUnsafe.user;t(r||null),console.log("Telegram WebApp object:",n),console.log("User Info:",r),console.log("User Picture: ",r==null?void 0:r.photo_url)},[]),e?hn.jsx("header",{children:hn.jsxs("div",{id:"header-row",children:[hn.jsx("div",{id:"user-name",children:hn.jsxs("div",{children:[e.first_name," ",e.last_name||"Guest"]})}),hn.jsx("div",{id:"wallet-connect-button-wrapper",children:hn.jsx(zM,{})})]})}):hn.jsx("div",{children:"Loading user information..."})},KM=""+new URL("coobot_23-C3PiL-Kj.jpg",import.meta.url).href;function Z4(e,t){return function(){return e.apply(t,arguments)}}const{toString:qM}=Object.prototype,{getPrototypeOf:Ag}=Object,sh=(e=>t=>{const n=qM.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),di=e=>(e=e.toLowerCase(),t=>sh(t)===e),ah=e=>t=>typeof t===e,{isArray:Ga}=Array,Mc=ah("undefined");function GM(e){return e!==null&&!Mc(e)&&e.constructor!==null&&!Mc(e.constructor)&&Vr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Q4=di("ArrayBuffer");function ZM(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Q4(e.buffer),t}const QM=ah("string"),Vr=ah("function"),J4=ah("number"),lh=e=>e!==null&&typeof e=="object",JM=e=>e===!0||e===!1,df=e=>{if(sh(e)!=="object")return!1;const t=Ag(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},XM=di("Date"),eT=di("File"),tT=di("Blob"),nT=di("FileList"),rT=e=>lh(e)&&Vr(e.pipe),iT=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Vr(e.append)&&((t=sh(e))==="formdata"||t==="object"&&Vr(e.toString)&&e.toString()==="[object FormData]"))},oT=di("URLSearchParams"),[sT,aT,lT,cT]=["ReadableStream","Request","Response","Headers"].map(di),uT=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Jc(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),Ga(e))for(r=0,i=e.length;r0;)if(i=n[r],t===i.toLowerCase())return i;return null}const e6=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,t6=e=>!Mc(e)&&e!==e6;function U0(){const{caseless:e}=t6(this)&&this||{},t={},n=(r,i)=>{const o=e&&X4(t,i)||i;df(t[o])&&df(r)?t[o]=U0(t[o],r):df(r)?t[o]=U0({},r):Ga(r)?t[o]=r.slice():t[o]=r};for(let r=0,i=arguments.length;r(Jc(t,(i,o)=>{n&&Vr(i)?e[o]=Z4(i,n):e[o]=i},{allOwnKeys:r}),e),dT=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),hT=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},pT=(e,t,n,r)=>{let i,o,s;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],(!r||r(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=n!==!1&&Ag(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},gT=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},mT=e=>{if(!e)return null;if(Ga(e))return e;let t=e.length;if(!J4(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},vT=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ag(Uint8Array)),yT=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},wT=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},xT=di("HTMLFormElement"),bT=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Pv=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),_T=di("RegExp"),n6=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Jc(n,(i,o)=>{let s;(s=t(i,o,e))!==!1&&(r[o]=s||i)}),Object.defineProperties(e,r)},CT=e=>{n6(e,(t,n)=>{if(Vr(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Vr(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},ST=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return Ga(e)?r(e):r(String(e).split(t)),n},kT=()=>{},ET=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,p1="abcdefghijklmnopqrstuvwxyz",Av="0123456789",r6={DIGIT:Av,ALPHA:p1,ALPHA_DIGIT:p1+p1.toUpperCase()+Av},MT=(e=16,t=r6.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function TT(e){return!!(e&&Vr(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const PT=e=>{const t=new Array(10),n=(r,i)=>{if(lh(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const o=Ga(r)?[]:{};return Jc(r,(s,a)=>{const l=n(s,i+1);!Mc(l)&&(o[a]=l)}),t[i]=void 0,o}}return r};return n(e,0)},AT=di("AsyncFunction"),LT=e=>e&&(lh(e)||Vr(e))&&Vr(e.then)&&Vr(e.catch),z={isArray:Ga,isArrayBuffer:Q4,isBuffer:GM,isFormData:iT,isArrayBufferView:ZM,isString:QM,isNumber:J4,isBoolean:JM,isObject:lh,isPlainObject:df,isReadableStream:sT,isRequest:aT,isResponse:lT,isHeaders:cT,isUndefined:Mc,isDate:XM,isFile:eT,isBlob:tT,isRegExp:_T,isFunction:Vr,isStream:rT,isURLSearchParams:oT,isTypedArray:vT,isFileList:nT,forEach:Jc,merge:U0,extend:fT,trim:uT,stripBOM:dT,inherits:hT,toFlatObject:pT,kindOf:sh,kindOfTest:di,endsWith:gT,toArray:mT,forEachEntry:yT,matchAll:wT,isHTMLForm:xT,hasOwnProperty:Pv,hasOwnProp:Pv,reduceDescriptors:n6,freezeMethods:CT,toObjectSet:ST,toCamelCase:bT,noop:kT,toFiniteNumber:ET,findKey:X4,global:e6,isContextDefined:t6,ALPHABET:r6,generateString:MT,isSpecCompliantForm:TT,toJSONObject:PT,isAsyncFn:AT,isThenable:LT};function ot(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}z.inherits(ot,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:z.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const i6=ot.prototype,o6={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{o6[e]={value:e}});Object.defineProperties(ot,o6);Object.defineProperty(i6,"isAxiosError",{value:!0});ot.from=(e,t,n,r,i,o)=>{const s=Object.create(i6);return z.toFlatObject(e,s,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),ot.call(s,e.message,t,n,r,i),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};const OT=null;function F0(e){return z.isPlainObject(e)||z.isArray(e)}function s6(e){return z.endsWith(e,"[]")?e.slice(0,-2):e}function Lv(e,t,n){return e?e.concat(t).map(function(i,o){return i=s6(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function RT(e){return z.isArray(e)&&!e.some(F0)}const DT=z.toFlatObject(z,{},null,function(t){return/^is[A-Z]/.test(t)});function ch(e,t,n){if(!z.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=z.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,k){return!z.isUndefined(k[y])});const r=n.metaTokens,i=n.visitor||u,o=n.dots,s=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&z.isSpecCompliantForm(t);if(!z.isFunction(i))throw new TypeError("visitor must be a function");function c(m){if(m===null)return"";if(z.isDate(m))return m.toISOString();if(!l&&z.isBlob(m))throw new ot("Blob is not supported. Use a Buffer instead.");return z.isArrayBuffer(m)||z.isTypedArray(m)?l&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function u(m,y,k){let C=m;if(m&&!k&&typeof m=="object"){if(z.endsWith(y,"{}"))y=r?y:y.slice(0,-2),m=JSON.stringify(m);else if(z.isArray(m)&&RT(m)||(z.isFileList(m)||z.endsWith(y,"[]"))&&(C=z.toArray(m)))return y=s6(y),C.forEach(function(w,M){!(z.isUndefined(w)||w===null)&&t.append(s===!0?Lv([y],M,o):s===null?y:y+"[]",c(w))}),!1}return F0(m)?!0:(t.append(Lv(k,y,o),c(m)),!1)}const d=[],h=Object.assign(DT,{defaultVisitor:u,convertValue:c,isVisitable:F0});function g(m,y){if(!z.isUndefined(m)){if(d.indexOf(m)!==-1)throw Error("Circular reference detected in "+y.join("."));d.push(m),z.forEach(m,function(C,v){(!(z.isUndefined(C)||C===null)&&i.call(t,C,z.isString(v)?v.trim():v,y,h))===!0&&g(C,y?y.concat(v):[v])}),d.pop()}}if(!z.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Ov(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Lg(e,t){this._pairs=[],e&&ch(e,this,t)}const a6=Lg.prototype;a6.append=function(t,n){this._pairs.push([t,n])};a6.toString=function(t){const n=t?function(r){return t.call(this,r,Ov)}:Ov;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function IT(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function l6(e,t,n){if(!t)return e;const r=n&&n.encode||IT,i=n&&n.serialize;let o;if(i?o=i(t,n):o=z.isURLSearchParams(t)?t.toString():new Lg(t,n).toString(r),o){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Rv{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){z.forEach(this.handlers,function(r){r!==null&&t(r)})}}const c6={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},NT=typeof URLSearchParams<"u"?URLSearchParams:Lg,WT=typeof FormData<"u"?FormData:null,$T=typeof Blob<"u"?Blob:null,UT={isBrowser:!0,classes:{URLSearchParams:NT,FormData:WT,Blob:$T},protocols:["http","https","file","blob","url","data"]},Og=typeof window<"u"&&typeof document<"u",FT=(e=>Og&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),BT=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",jT=Og&&window.location.href||"http://localhost",HT=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Og,hasStandardBrowserEnv:FT,hasStandardBrowserWebWorkerEnv:BT,origin:jT},Symbol.toStringTag,{value:"Module"})),si={...HT,...UT};function zT(e,t){return ch(e,new si.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return si.isNode&&z.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function VT(e){return z.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function YT(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r=n.length;return s=!s&&z.isArray(i)?i.length:s,l?(z.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!a):((!i[s]||!z.isObject(i[s]))&&(i[s]=[]),t(n,r,i[s],o)&&z.isArray(i[s])&&(i[s]=YT(i[s])),!a)}if(z.isFormData(e)&&z.isFunction(e.entries)){const n={};return z.forEachEntry(e,(r,i)=>{t(VT(r),i,n,0)}),n}return null}function KT(e,t,n){if(z.isString(e))try{return(t||JSON.parse)(e),z.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Xc={transitional:c6,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=z.isObject(t);if(o&&z.isHTMLForm(t)&&(t=new FormData(t)),z.isFormData(t))return i?JSON.stringify(u6(t)):t;if(z.isArrayBuffer(t)||z.isBuffer(t)||z.isStream(t)||z.isFile(t)||z.isBlob(t)||z.isReadableStream(t))return t;if(z.isArrayBufferView(t))return t.buffer;if(z.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return zT(t,this.formSerializer).toString();if((a=z.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return ch(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),KT(t)):t}],transformResponse:[function(t){const n=this.transitional||Xc.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(z.isResponse(t)||z.isReadableStream(t))return t;if(t&&z.isString(t)&&(r&&!this.responseType||i)){const s=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?ot.from(a,ot.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:si.classes.FormData,Blob:si.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};z.forEach(["delete","get","head","post","put","patch"],e=>{Xc.headers[e]={}});const qT=z.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),GT=e=>{const t={};let n,r,i;return e&&e.split(` + */var Mv;function $M(){if(Mv)return cl;Mv=1;var e=Pd,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var u,d={},h=null,g=null;c!==void 0&&(h=""+c),l.key!==void 0&&(h=""+l.key),l.ref!==void 0&&(g=l.ref);for(u in l)r.call(l,u)&&!o.hasOwnProperty(u)&&(d[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)d[u]===void 0&&(d[u]=l[u]);return{$$typeof:t,type:a,key:h,ref:g,props:d,_owner:i.current}}return cl.Fragment=n,cl.jsx=s,cl.jsxs=s,cl}(function(e){e.exports=$M()})(V4);const Y4=V4.exports.jsx;function K4(){return typeof window<"u"}function UM(){return!K4()}const q4=rn.createContext(null);let h1=null;const FM=e=>{var t=e,{children:n}=t,r=WM(t,["children"]);return K4()&&!h1&&(h1=new DM(r)),Y4(q4.Provider,{value:h1,children:n})},BM=rn.memo(FM);class Tg extends vn{constructor(...t){super(...t),Object.setPrototypeOf(this,Tg.prototype)}}class Pg extends Tg{constructor(...t){super(...t),Object.setPrototypeOf(this,Pg.prototype)}}function jM(e){if(!e)throw new Pg("You should add on the top of the app to use TonConnect");return!0}function G4(){const e=rn.useContext(q4),t=rn.useCallback(n=>{e&&(e.uiOptions=n)},[e]);return UM()?[null,()=>{}]:(jM(e),[e,t])}const Tv="ton-connect-button",HM=({className:e,style:t})=>{const[n,r]=G4();return rn.useEffect(()=>(r({buttonRootId:Tv}),()=>r({buttonRootId:null})),[r]),Y4("div",{id:Tv,className:e,style:NM({width:"fit-content"},t)})},zM=rn.memo(HM),VM=()=>{const[e,t]=G4();return t({uiPreferences:{borderRadius:"m"}}),tn.jsx("footer",{className:"footer"})},YM=()=>{const[e,t]=rn.useState(null);return rn.useEffect(()=>{let n;if(window.Telegram)n=window.Telegram.WebApp;else{console.error("Telegram WebApp is not available");return}n.ready();const r=n.initDataUnsafe.user;t(r||null),console.log("Telegram WebApp object:",n),console.log("User Info:",r),console.log("User Picture: ",r==null?void 0:r.photo_url)},[]),e?tn.jsx("header",{children:tn.jsxs("div",{id:"header-row",children:[tn.jsx("div",{id:"user-name",children:tn.jsxs("div",{children:[e.first_name," ",e.last_name||"Guest"]})}),tn.jsx("div",{id:"wallet-connect-button-wrapper",children:tn.jsx(zM,{})})]})}):tn.jsx("div",{children:"Loading user information..."})},KM=""+new URL("coobot_23-C3PiL-Kj.jpg",import.meta.url).href;function Z4(e,t){return function(){return e.apply(t,arguments)}}const{toString:qM}=Object.prototype,{getPrototypeOf:Ag}=Object,sh=(e=>t=>{const n=qM.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),di=e=>(e=e.toLowerCase(),t=>sh(t)===e),ah=e=>t=>typeof t===e,{isArray:Ga}=Array,Mc=ah("undefined");function GM(e){return e!==null&&!Mc(e)&&e.constructor!==null&&!Mc(e.constructor)&&Vr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Q4=di("ArrayBuffer");function ZM(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Q4(e.buffer),t}const QM=ah("string"),Vr=ah("function"),J4=ah("number"),lh=e=>e!==null&&typeof e=="object",JM=e=>e===!0||e===!1,df=e=>{if(sh(e)!=="object")return!1;const t=Ag(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},XM=di("Date"),eT=di("File"),tT=di("Blob"),nT=di("FileList"),rT=e=>lh(e)&&Vr(e.pipe),iT=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Vr(e.append)&&((t=sh(e))==="formdata"||t==="object"&&Vr(e.toString)&&e.toString()==="[object FormData]"))},oT=di("URLSearchParams"),[sT,aT,lT,cT]=["ReadableStream","Request","Response","Headers"].map(di),uT=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Jc(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),Ga(e))for(r=0,i=e.length;r0;)if(i=n[r],t===i.toLowerCase())return i;return null}const e6=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,t6=e=>!Mc(e)&&e!==e6;function U0(){const{caseless:e}=t6(this)&&this||{},t={},n=(r,i)=>{const o=e&&X4(t,i)||i;df(t[o])&&df(r)?t[o]=U0(t[o],r):df(r)?t[o]=U0({},r):Ga(r)?t[o]=r.slice():t[o]=r};for(let r=0,i=arguments.length;r(Jc(t,(i,o)=>{n&&Vr(i)?e[o]=Z4(i,n):e[o]=i},{allOwnKeys:r}),e),dT=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),hT=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},pT=(e,t,n,r)=>{let i,o,s;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],(!r||r(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=n!==!1&&Ag(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},gT=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},mT=e=>{if(!e)return null;if(Ga(e))return e;let t=e.length;if(!J4(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},vT=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ag(Uint8Array)),yT=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},wT=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},xT=di("HTMLFormElement"),bT=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Pv=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),_T=di("RegExp"),n6=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Jc(n,(i,o)=>{let s;(s=t(i,o,e))!==!1&&(r[o]=s||i)}),Object.defineProperties(e,r)},CT=e=>{n6(e,(t,n)=>{if(Vr(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Vr(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},ST=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return Ga(e)?r(e):r(String(e).split(t)),n},kT=()=>{},ET=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,p1="abcdefghijklmnopqrstuvwxyz",Av="0123456789",r6={DIGIT:Av,ALPHA:p1,ALPHA_DIGIT:p1+p1.toUpperCase()+Av},MT=(e=16,t=r6.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function TT(e){return!!(e&&Vr(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const PT=e=>{const t=new Array(10),n=(r,i)=>{if(lh(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const o=Ga(r)?[]:{};return Jc(r,(s,a)=>{const l=n(s,i+1);!Mc(l)&&(o[a]=l)}),t[i]=void 0,o}}return r};return n(e,0)},AT=di("AsyncFunction"),LT=e=>e&&(lh(e)||Vr(e))&&Vr(e.then)&&Vr(e.catch),z={isArray:Ga,isArrayBuffer:Q4,isBuffer:GM,isFormData:iT,isArrayBufferView:ZM,isString:QM,isNumber:J4,isBoolean:JM,isObject:lh,isPlainObject:df,isReadableStream:sT,isRequest:aT,isResponse:lT,isHeaders:cT,isUndefined:Mc,isDate:XM,isFile:eT,isBlob:tT,isRegExp:_T,isFunction:Vr,isStream:rT,isURLSearchParams:oT,isTypedArray:vT,isFileList:nT,forEach:Jc,merge:U0,extend:fT,trim:uT,stripBOM:dT,inherits:hT,toFlatObject:pT,kindOf:sh,kindOfTest:di,endsWith:gT,toArray:mT,forEachEntry:yT,matchAll:wT,isHTMLForm:xT,hasOwnProperty:Pv,hasOwnProp:Pv,reduceDescriptors:n6,freezeMethods:CT,toObjectSet:ST,toCamelCase:bT,noop:kT,toFiniteNumber:ET,findKey:X4,global:e6,isContextDefined:t6,ALPHABET:r6,generateString:MT,isSpecCompliantForm:TT,toJSONObject:PT,isAsyncFn:AT,isThenable:LT};function ot(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}z.inherits(ot,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:z.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const i6=ot.prototype,o6={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{o6[e]={value:e}});Object.defineProperties(ot,o6);Object.defineProperty(i6,"isAxiosError",{value:!0});ot.from=(e,t,n,r,i,o)=>{const s=Object.create(i6);return z.toFlatObject(e,s,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),ot.call(s,e.message,t,n,r,i),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};const OT=null;function F0(e){return z.isPlainObject(e)||z.isArray(e)}function s6(e){return z.endsWith(e,"[]")?e.slice(0,-2):e}function Lv(e,t,n){return e?e.concat(t).map(function(i,o){return i=s6(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function RT(e){return z.isArray(e)&&!e.some(F0)}const DT=z.toFlatObject(z,{},null,function(t){return/^is[A-Z]/.test(t)});function ch(e,t,n){if(!z.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=z.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,k){return!z.isUndefined(k[y])});const r=n.metaTokens,i=n.visitor||u,o=n.dots,s=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&z.isSpecCompliantForm(t);if(!z.isFunction(i))throw new TypeError("visitor must be a function");function c(m){if(m===null)return"";if(z.isDate(m))return m.toISOString();if(!l&&z.isBlob(m))throw new ot("Blob is not supported. Use a Buffer instead.");return z.isArrayBuffer(m)||z.isTypedArray(m)?l&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function u(m,y,k){let C=m;if(m&&!k&&typeof m=="object"){if(z.endsWith(y,"{}"))y=r?y:y.slice(0,-2),m=JSON.stringify(m);else if(z.isArray(m)&&RT(m)||(z.isFileList(m)||z.endsWith(y,"[]"))&&(C=z.toArray(m)))return y=s6(y),C.forEach(function(w,M){!(z.isUndefined(w)||w===null)&&t.append(s===!0?Lv([y],M,o):s===null?y:y+"[]",c(w))}),!1}return F0(m)?!0:(t.append(Lv(k,y,o),c(m)),!1)}const d=[],h=Object.assign(DT,{defaultVisitor:u,convertValue:c,isVisitable:F0});function g(m,y){if(!z.isUndefined(m)){if(d.indexOf(m)!==-1)throw Error("Circular reference detected in "+y.join("."));d.push(m),z.forEach(m,function(C,v){(!(z.isUndefined(C)||C===null)&&i.call(t,C,z.isString(v)?v.trim():v,y,h))===!0&&g(C,y?y.concat(v):[v])}),d.pop()}}if(!z.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Ov(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Lg(e,t){this._pairs=[],e&&ch(e,this,t)}const a6=Lg.prototype;a6.append=function(t,n){this._pairs.push([t,n])};a6.toString=function(t){const n=t?function(r){return t.call(this,r,Ov)}:Ov;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function IT(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function l6(e,t,n){if(!t)return e;const r=n&&n.encode||IT,i=n&&n.serialize;let o;if(i?o=i(t,n):o=z.isURLSearchParams(t)?t.toString():new Lg(t,n).toString(r),o){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Rv{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){z.forEach(this.handlers,function(r){r!==null&&t(r)})}}const c6={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},NT=typeof URLSearchParams<"u"?URLSearchParams:Lg,WT=typeof FormData<"u"?FormData:null,$T=typeof Blob<"u"?Blob:null,UT={isBrowser:!0,classes:{URLSearchParams:NT,FormData:WT,Blob:$T},protocols:["http","https","file","blob","url","data"]},Og=typeof window<"u"&&typeof document<"u",FT=(e=>Og&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),BT=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",jT=Og&&window.location.href||"http://localhost",HT=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Og,hasStandardBrowserEnv:FT,hasStandardBrowserWebWorkerEnv:BT,origin:jT},Symbol.toStringTag,{value:"Module"})),si={...HT,...UT};function zT(e,t){return ch(e,new si.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return si.isNode&&z.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function VT(e){return z.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function YT(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r=n.length;return s=!s&&z.isArray(i)?i.length:s,l?(z.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!a):((!i[s]||!z.isObject(i[s]))&&(i[s]=[]),t(n,r,i[s],o)&&z.isArray(i[s])&&(i[s]=YT(i[s])),!a)}if(z.isFormData(e)&&z.isFunction(e.entries)){const n={};return z.forEachEntry(e,(r,i)=>{t(VT(r),i,n,0)}),n}return null}function KT(e,t,n){if(z.isString(e))try{return(t||JSON.parse)(e),z.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Xc={transitional:c6,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=z.isObject(t);if(o&&z.isHTMLForm(t)&&(t=new FormData(t)),z.isFormData(t))return i?JSON.stringify(u6(t)):t;if(z.isArrayBuffer(t)||z.isBuffer(t)||z.isStream(t)||z.isFile(t)||z.isBlob(t)||z.isReadableStream(t))return t;if(z.isArrayBufferView(t))return t.buffer;if(z.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return zT(t,this.formSerializer).toString();if((a=z.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return ch(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),KT(t)):t}],transformResponse:[function(t){const n=this.transitional||Xc.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(z.isResponse(t)||z.isReadableStream(t))return t;if(t&&z.isString(t)&&(r&&!this.responseType||i)){const s=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?ot.from(a,ot.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:si.classes.FormData,Blob:si.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};z.forEach(["delete","get","head","post","put","patch"],e=>{Xc.headers[e]={}});const qT=z.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),GT=e=>{const t={};let n,r,i;return e&&e.split(` `).forEach(function(s){i=s.indexOf(":"),n=s.substring(0,i).trim().toLowerCase(),r=s.substring(i+1).trim(),!(!n||t[n]&&qT[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Dv=Symbol("internals");function ul(e){return e&&String(e).trim().toLowerCase()}function hf(e){return e===!1||e==null?e:z.isArray(e)?e.map(hf):String(e)}function ZT(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const QT=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function g1(e,t,n,r,i){if(z.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!z.isString(t)){if(z.isString(r))return t.indexOf(r)!==-1;if(z.isRegExp(r))return r.test(t)}}function JT(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function XT(e,t){const n=z.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,o,s){return this[r].call(this,t,i,o,s)},configurable:!0})})}class _r{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function o(a,l,c){const u=ul(l);if(!u)throw new Error("header name must be a non-empty string");const d=z.findKey(i,u);(!d||i[d]===void 0||c===!0||c===void 0&&i[d]!==!1)&&(i[d||l]=hf(a))}const s=(a,l)=>z.forEach(a,(c,u)=>o(c,u,l));if(z.isPlainObject(t)||t instanceof this.constructor)s(t,n);else if(z.isString(t)&&(t=t.trim())&&!QT(t))s(GT(t),n);else if(z.isHeaders(t))for(const[a,l]of t.entries())o(l,a,r);else t!=null&&o(n,t,r);return this}get(t,n){if(t=ul(t),t){const r=z.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return ZT(i);if(z.isFunction(n))return n.call(this,i,r);if(z.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=ul(t),t){const r=z.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||g1(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function o(s){if(s=ul(s),s){const a=z.findKey(r,s);a&&(!n||g1(r,r[a],a,n))&&(delete r[a],i=!0)}}return z.isArray(t)?t.forEach(o):o(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!t||g1(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,r={};return z.forEach(this,(i,o)=>{const s=z.findKey(r,o);if(s){n[s]=hf(i),delete n[o];return}const a=t?JT(o):String(o).trim();a!==o&&delete n[o],n[a]=hf(i),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return z.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&z.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[Dv]=this[Dv]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=ul(s);r[a]||(XT(i,s),r[a]=!0)}return z.isArray(t)?t.forEach(o):o(t),this}}_r.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);z.reduceDescriptors(_r.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});z.freezeMethods(_r);function m1(e,t){const n=this||Xc,r=t||n,i=_r.from(r.headers);let o=r.data;return z.forEach(e,function(a){o=a.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function f6(e){return!!(e&&e.__CANCEL__)}function Za(e,t,n){ot.call(this,e??"canceled",ot.ERR_CANCELED,t,n),this.name="CanceledError"}z.inherits(Za,ot,{__CANCEL__:!0});function d6(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ot("Request failed with status code "+n.status,[ot.ERR_BAD_REQUEST,ot.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function eP(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function tP(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,s;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=r[o];s||(s=c),n[i]=l,r[i]=c;let d=o,h=0;for(;d!==i;)h+=n[d++],d=d%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),c-sr)return i&&(clearTimeout(i),i=null),n=a,e.apply(null,arguments);i||(i=setTimeout(()=>(i=null,n=Date.now(),e.apply(null,arguments)),r-(a-n)))}}const dd=(e,t,n=3)=>{let r=0;const i=tP(50,250);return nP(o=>{const s=o.loaded,a=o.lengthComputable?o.total:void 0,l=s-r,c=i(l),u=s<=a;r=s;const d={loaded:s,total:a,progress:a?s/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-s)/c:void 0,event:o,lengthComputable:a!=null};d[t?"download":"upload"]=!0,e(d)},n)},rP=si.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(o){let s=o;return t&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(s){const a=z.isString(s)?i(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}(),iP=si.hasStandardBrowserEnv?{write(e,t,n,r,i,o){const s=[e+"="+encodeURIComponent(t)];z.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),z.isString(r)&&s.push("path="+r),z.isString(i)&&s.push("domain="+i),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function oP(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function sP(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function h6(e,t){return e&&!oP(t)?sP(e,t):t}const Iv=e=>e instanceof _r?{...e}:e;function Ws(e,t){t=t||{};const n={};function r(c,u,d){return z.isPlainObject(c)&&z.isPlainObject(u)?z.merge.call({caseless:d},c,u):z.isPlainObject(u)?z.merge({},u):z.isArray(u)?u.slice():u}function i(c,u,d){if(z.isUndefined(u)){if(!z.isUndefined(c))return r(void 0,c,d)}else return r(c,u,d)}function o(c,u){if(!z.isUndefined(u))return r(void 0,u)}function s(c,u){if(z.isUndefined(u)){if(!z.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,d){if(d in t)return r(c,u);if(d in e)return r(void 0,c)}const l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(c,u)=>i(Iv(c),Iv(u),!0)};return z.forEach(Object.keys(Object.assign({},e,t)),function(u){const d=l[u]||i,h=d(e[u],t[u],u);z.isUndefined(h)&&d!==a||(n[u]=h)}),n}const p6=e=>{const t=Ws({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:a}=t;t.headers=s=_r.from(s),t.url=l6(h6(t.baseURL,t.url),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(z.isFormData(n)){if(si.hasStandardBrowserEnv||si.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((l=s.getContentType())!==!1){const[c,...u]=l?l.split(";").map(d=>d.trim()).filter(Boolean):[];s.setContentType([c||"multipart/form-data",...u].join("; "))}}if(si.hasStandardBrowserEnv&&(r&&z.isFunction(r)&&(r=r(t)),r||r!==!1&&rP(t.url))){const c=i&&o&&iP.read(o);c&&s.set(i,c)}return t},aP=typeof XMLHttpRequest<"u",lP=aP&&function(e){return new Promise(function(n,r){const i=p6(e);let o=i.data;const s=_r.from(i.headers).normalize();let{responseType:a}=i,l;function c(){i.cancelToken&&i.cancelToken.unsubscribe(l),i.signal&&i.signal.removeEventListener("abort",l)}let u=new XMLHttpRequest;u.open(i.method.toUpperCase(),i.url,!0),u.timeout=i.timeout;function d(){if(!u)return;const g=_r.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders()),y={data:!a||a==="text"||a==="json"?u.responseText:u.response,status:u.status,statusText:u.statusText,headers:g,config:e,request:u};d6(function(C){n(C),c()},function(C){r(C),c()},y),u=null}"onloadend"in u?u.onloadend=d:u.onreadystatechange=function(){!u||u.readyState!==4||u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)||setTimeout(d)},u.onabort=function(){u&&(r(new ot("Request aborted",ot.ECONNABORTED,i,u)),u=null)},u.onerror=function(){r(new ot("Network Error",ot.ERR_NETWORK,i,u)),u=null},u.ontimeout=function(){let m=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const y=i.transitional||c6;i.timeoutErrorMessage&&(m=i.timeoutErrorMessage),r(new ot(m,y.clarifyTimeoutError?ot.ETIMEDOUT:ot.ECONNABORTED,i,u)),u=null},o===void 0&&s.setContentType(null),"setRequestHeader"in u&&z.forEach(s.toJSON(),function(m,y){u.setRequestHeader(y,m)}),z.isUndefined(i.withCredentials)||(u.withCredentials=!!i.withCredentials),a&&a!=="json"&&(u.responseType=i.responseType),typeof i.onDownloadProgress=="function"&&u.addEventListener("progress",dd(i.onDownloadProgress,!0)),typeof i.onUploadProgress=="function"&&u.upload&&u.upload.addEventListener("progress",dd(i.onUploadProgress)),(i.cancelToken||i.signal)&&(l=g=>{u&&(r(!g||g.type?new Za(null,e,u):g),u.abort(),u=null)},i.cancelToken&&i.cancelToken.subscribe(l),i.signal&&(i.signal.aborted?l():i.signal.addEventListener("abort",l)));const h=eP(i.url);if(h&&si.protocols.indexOf(h)===-1){r(new ot("Unsupported protocol "+h+":",ot.ERR_BAD_REQUEST,e));return}u.send(o||null)})},cP=(e,t)=>{let n=new AbortController,r;const i=function(l){if(!r){r=!0,s();const c=l instanceof Error?l:this.reason;n.abort(c instanceof ot?c:new Za(c instanceof Error?c.message:c))}};let o=t&&setTimeout(()=>{i(new ot(`timeout ${t} of ms exceeded`,ot.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(l=>{l&&(l.removeEventListener?l.removeEventListener("abort",i):l.unsubscribe(i))}),e=null)};e.forEach(l=>l&&l.addEventListener&&l.addEventListener("abort",i));const{signal:a}=n;return a.unsubscribe=s,[a,()=>{o&&clearTimeout(o),o=null}]},uP=function*(e,t){let n=e.byteLength;if(!t||n{const o=fP(e,t,i);let s=0;return new ReadableStream({type:"bytes",async pull(a){const{done:l,value:c}=await o.next();if(l){a.close(),r();return}let u=c.byteLength;n&&n(s+=u),a.enqueue(new Uint8Array(c))},cancel(a){return r(a),o.return()}},{highWaterMark:2})},Wv=(e,t)=>{const n=e!=null;return r=>setTimeout(()=>t({lengthComputable:n,total:e,loaded:r}))},uh=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",g6=uh&&typeof ReadableStream=="function",B0=uh&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),dP=g6&&(()=>{let e=!1;const t=new Request(si.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})(),$v=64*1024,j0=g6&&!!(()=>{try{return z.isReadableStream(new Response("").body)}catch{}})(),hd={stream:j0&&(e=>e.body)};uh&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!hd[t]&&(hd[t]=z.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new ot(`Response type '${t}' is not supported`,ot.ERR_NOT_SUPPORT,r)})})})(new Response);const hP=async e=>{if(e==null)return 0;if(z.isBlob(e))return e.size;if(z.isSpecCompliantForm(e))return(await new Request(e).arrayBuffer()).byteLength;if(z.isArrayBufferView(e))return e.byteLength;if(z.isURLSearchParams(e)&&(e=e+""),z.isString(e))return(await B0(e)).byteLength},pP=async(e,t)=>{const n=z.toFiniteNumber(e.getContentLength());return n??hP(t)},gP=uh&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:o,timeout:s,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:h}=p6(e);c=c?(c+"").toLowerCase():"text";let[g,m]=i||o||s?cP([i,o],s):[],y,k;const C=()=>{!y&&setTimeout(()=>{g&&g.unsubscribe()}),y=!0};let v;try{if(l&&dP&&n!=="get"&&n!=="head"&&(v=await pP(u,r))!==0){let O=new Request(t,{method:"POST",body:r,duplex:"half"}),T;z.isFormData(r)&&(T=O.headers.get("content-type"))&&u.setContentType(T),O.body&&(r=Nv(O.body,$v,Wv(v,dd(l)),null,B0))}z.isString(d)||(d=d?"cors":"omit"),k=new Request(t,{...h,signal:g,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",withCredentials:d});let w=await fetch(k);const M=j0&&(c==="stream"||c==="response");if(j0&&(a||M)){const O={};["status","statusText","headers"].forEach(P=>{O[P]=w[P]});const T=z.toFiniteNumber(w.headers.get("content-length"));w=new Response(Nv(w.body,$v,a&&Wv(T,dd(a,!0)),M&&C,B0),O)}c=c||"text";let E=await hd[z.findKey(hd,c)||"text"](w,e);return!M&&C(),m&&m(),await new Promise((O,T)=>{d6(O,T,{data:E,headers:_r.from(w.headers),status:w.status,statusText:w.statusText,config:e,request:k})})}catch(w){throw C(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new ot("Network Error",ot.ERR_NETWORK,e,k),{cause:w.cause||w}):ot.from(w,w&&w.code,e,k)}}),H0={http:OT,xhr:lP,fetch:gP};z.forEach(H0,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Uv=e=>`- ${e}`,mP=e=>z.isFunction(e)||e===null||e===!1,m6={getAdapter:e=>{e=z.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let o=0;o`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let s=t?o.length>1?`since : `+o.map(Uv).join(` @@ -1120,9 +1120,9 @@ pe.version="2.30.1";xP(Kt);pe.fn=le;pe.min=lL;pe.max=cL;pe.now=uL;pe.utc=Di;pe.u * https://www.chartjs.org * (c) 2024 Chart.js Contributors * Released under the MIT License - */const jR=(()=>{let e=0;return()=>e++})();function en(e){return e===null||typeof e>"u"}function xn(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Nt(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function Nn(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Sr(e,t){return Nn(e)?e:t}function Ut(e,t){return typeof e>"u"?t:e}const HR=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function dn(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Qn(e,t,n,r){let i,o,s;if(xn(e))for(o=e.length,i=0;ie,x:e=>e.x,y:e=>e.y};function YR(e){const t=e.split("."),n=[];let r="";for(const i of t)r+=i,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function KR(e){const t=YR(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function xd(e,t){return(Xv[t]||(Xv[t]=KR(t)))(e)}function sm(e){return e.charAt(0).toUpperCase()+e.slice(1)}const bd=e=>typeof e<"u",Jo=e=>typeof e=="function",ey=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function qR(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Sn=Math.PI,ai=2*Sn,GR=ai+Sn,_d=Number.POSITIVE_INFINITY,ZR=Sn/180,Pr=Sn/2,as=Sn/4,ty=Sn*2/3,Oo=Math.log10,Ua=Math.sign;function Zl(e,t,n){return Math.abs(e-t)i-o).pop(),t}function Dc(e){return!isNaN(parseFloat(e))&&isFinite(e)}function JR(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function px(e,t,n){let r,i,o;for(r=0,i=e.length;rl&&c=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function lm(e,t,n){n=n||(s=>e[s]1;)o=i+r>>1,n(o)?i=o:r=o;return{lo:i,hi:r}}const bs=(e,t,n,r)=>lm(e,n,r?i=>{const o=e[i][t];return oe[i][t]lm(e,n,r=>e[r][t]>=n);function iD(e,t,n){let r=0,i=e.length;for(;rr&&e[i-1]>n;)i--;return r>0||i{const r="_onData"+sm(n),i=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const s=i.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...o)}),s}})})}function oy(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(mx.forEach(o=>{delete e[o]}),delete e._chartjs)}function sD(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const vx=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function yx(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,vx.call(window,()=>{r=!1,e.apply(t,n)}))}}function aD(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const wx=e=>e==="start"?"left":e==="end"?"right":"center",Ql=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2;function lD(e,t,n){const r=t.length;let i=0,o=r;if(e._sorted){const{iScale:s,_parsed:a}=e,l=s.axis,{min:c,max:u,minDefined:d,maxDefined:h}=s.getUserBounds();d&&(i=_i(Math.min(bs(a,l,c).lo,n?r:bs(t,l,s.getPixelForValue(c)).lo),0,r-1)),h?o=_i(Math.max(bs(a,s.axis,u,!0).hi+1,n?0:bs(t,l,s.getPixelForValue(u),!0).hi+1),i,r)-i:o=r-i}return{start:i,count:o}}function cD(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;const o=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),o}const Uu=e=>e===0||e===1,sy=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*ai/n)),ay=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*ai/n)+1,Jl={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*Pr)+1,easeOutSine:e=>Math.sin(e*Pr),easeInOutSine:e=>-.5*(Math.cos(Sn*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Uu(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Uu(e)?e:sy(e,.075,.3),easeOutElastic:e=>Uu(e)?e:ay(e,.075,.3),easeInOutElastic(e){return Uu(e)?e:e<.5?.5*sy(e*2,.1125,.45):.5+.5*ay(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Jl.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Jl.easeInBounce(e*2)*.5:Jl.easeOutBounce(e*2-1)*.5+.5};function cm(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function ly(e){return cm(e)?e:new Oc(e)}function C1(e){return cm(e)?e:new Oc(e).saturate(.5).darken(.1).hexString()}const uD=["x","y","borderWidth","radius","tension"],fD=["color","borderColor","backgroundColor"];function dD(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:fD},numbers:{type:"number",properties:uD}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function hD(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const cy=new Map;function pD(e,t){t=t||{};const n=e+JSON.stringify(t);let r=cy.get(n);return r||(r=new Intl.NumberFormat(e,t),cy.set(n,r)),r}function um(e,t,n){return pD(t,n).format(e)}const xx={values(e){return xn(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let i,o=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(i="scientific"),o=gD(e,n)}const s=Oo(Math.abs(o)),a=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),um(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(Oo(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?xx.numeric.call(this,e,t,n):""}};function gD(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var _h={formatters:xx};function mD(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:_h.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const $s=Object.create(null),ep=Object.create(null);function Xl(e,t){if(!t)return e;const n=t.split(".");for(let r=0,i=n.length;rr.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,i)=>C1(i.backgroundColor),this.hoverBorderColor=(r,i)=>C1(i.borderColor),this.hoverColor=(r,i)=>C1(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return S1(this,t,n)}get(t){return Xl(this,t)}describe(t,n){return S1(ep,t,n)}override(t,n){return S1($s,t,n)}route(t,n,r,i){const o=Xl(this,t),s=Xl(this,r),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=s[i];return Nt(l)?Object.assign({},c,l):Ut(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var bn=new vD({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[dD,hD,mD]);function yD(e){return!e||en(e.size)||en(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Cd(e,t,n,r,i){let o=t[i];return o||(o=t[i]=e.measureText(i).width,n.push(i)),o>r&&(r=o),r}function wD(e,t,n,r){r=r||{};let i=r.data=r.data||{},o=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},o=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let s=0;const a=n.length;let l,c,u,d,h;for(l=0;ln.length){for(l=0;l0&&e.stroke()}}function Zi(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&o.strokeColor!=="";let l,c;for(e.save(),e.font=i.string,SD(e,o),l=0;l+e||0;function Cx(e,t){const n={},r=Nt(t),i=r?Object.keys(t):t,o=Nt(e)?r?s=>Ut(e[s],e[t[s]]):s=>e[s]:()=>e;for(const s of i)n[s]=LD(o(s));return n}function OD(e){return Cx(e,{top:"y",right:"x",bottom:"y",left:"x"})}function RD(e){return Cx(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Li(e){const t=OD(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Xo(e,t){e=e||{},t=t||bn.font;let n=Ut(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=Ut(e.style,t.style);r&&!(""+r).match(PD)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:Ut(e.family,t.family),lineHeight:AD(Ut(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:Ut(e.weight,t.weight),string:""};return i.string=yD(i),i}function Fu(e,t,n,r){let i,o,s;for(i=0,o=e.length;in&&a===0?0:a+l;return{min:s(r,-Math.abs(o)),max:s(i,o)}}function Ys(e,t){return Object.assign(Object.create(e),t)}function fm(e,t=[""],n,r,i=()=>e[0]){const o=n||e;typeof r>"u"&&(r=Mx("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:r,_getTarget:i,override:a=>fm([a,...e],t,o,r)};return new Proxy(s,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return kx(a,l,()=>jD(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return dy(a).includes(l)},ownKeys(a){return dy(a)},set(a,l,c){const u=a._storage||(a._storage=i());return a[l]=u[l]=c,delete a._keys,!0}})}function Fa(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Sx(e,r),setContext:o=>Fa(e,o,n,r),override:o=>Fa(e.override(o),t,n,r)};return new Proxy(i,{deleteProperty(o,s){return delete o[s],delete e[s],!0},get(o,s,a){return kx(o,s,()=>ND(o,s,a))},getOwnPropertyDescriptor(o,s){return o._descriptors.allKeys?Reflect.has(e,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,s)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,s){return Reflect.has(e,s)},ownKeys(){return Reflect.ownKeys(e)},set(o,s,a){return e[s]=a,delete o[s],!0}})}function Sx(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:Jo(n)?n:()=>n,isIndexable:Jo(r)?r:()=>r}}const ID=(e,t)=>e?e+sm(t):t,dm=(e,t)=>Nt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function kx(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function ND(e,t,n){const{_proxy:r,_context:i,_subProxy:o,_descriptors:s}=e;let a=r[t];return Jo(a)&&s.isScriptable(t)&&(a=WD(t,a,e,n)),xn(a)&&a.length&&(a=$D(t,a,e,s.isIndexable)),dm(t,a)&&(a=Fa(a,i,o&&o[t],s)),a}function WD(e,t,n,r){const{_proxy:i,_context:o,_subProxy:s,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(o,s||r);return a.delete(e),dm(e,l)&&(l=hm(i._scopes,i,e,l)),l}function $D(e,t,n,r){const{_proxy:i,_context:o,_subProxy:s,_descriptors:a}=n;if(typeof o.index<"u"&&r(e))return t[o.index%t.length];if(Nt(t[0])){const l=t,c=i._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=hm(c,i,e,u);t.push(Fa(d,o,s&&s[e],a))}}return t}function Ex(e,t,n){return Jo(e)?e(t,n):e}const UD=(e,t)=>e===!0?t:typeof e=="string"?xd(t,e):void 0;function FD(e,t,n,r,i){for(const o of t){const s=UD(n,o);if(s){e.add(s);const a=Ex(s._fallback,n,i);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(s===!1&&typeof r<"u"&&n!==r)return null}return!1}function hm(e,t,n,r){const i=t._rootScopes,o=Ex(t._fallback,n,r),s=[...e,...i],a=new Set;a.add(r);let l=fy(a,s,n,o||n,r);return l===null||typeof o<"u"&&o!==n&&(l=fy(a,s,o,l,r),l===null)?!1:fm(Array.from(a),[""],i,o,()=>BD(t,n,r))}function fy(e,t,n,r,i){for(;n;)n=FD(e,t,n,r,i);return n}function BD(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return xn(i)&&Nt(n)?n:i||{}}function jD(e,t,n,r){let i;for(const o of t)if(i=Mx(ID(o,e),n),typeof i<"u")return dm(e,i)?hm(n,r,e,i):i}function Mx(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function dy(e){let t=e._keys;return t||(t=e._keys=HD(e._scopes)),t}function HD(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(i=>!i.startsWith("_")))t.add(r);return Array.from(t)}const zD=Number.EPSILON||1e-14,Ba=(e,t)=>te==="x"?"y":"x";function VD(e,t,n,r){const i=e.skip?t:e,o=t,s=n.skip?t:n,a=iy(o,i),l=iy(s,o);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=r*c,h=r*u;return{previous:{x:o.x-d*(s.x-i.x),y:o.y-d*(s.y-i.y)},next:{x:o.x+h*(s.x-i.x),y:o.y+h*(s.y-i.y)}}}function YD(e,t,n){const r=e.length;let i,o,s,a,l,c=Ba(e,0);for(let u=0;u!c.skip)),t.cubicInterpolationMode==="monotone")qD(e,i);else{let c=r?e[e.length-1]:e[0];for(o=0,s=e.length;oe.ownerDocument.defaultView.getComputedStyle(e,null);function QD(e,t){return Ch(e).getPropertyValue(t)}const JD=["top","right","bottom","left"];function As(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const o=JD[i];r[o]=parseFloat(e[t+"-"+o+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const XD=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function eI(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:o}=r;let s=!1,a,l;if(XD(i,o,e.target))a=i,l=o;else{const c=t.getBoundingClientRect();a=r.clientX-c.left,l=r.clientY-c.top,s=!0}return{x:a,y:l,box:s}}function hs(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=Ch(n),o=i.boxSizing==="border-box",s=As(i,"padding"),a=As(i,"border","width"),{x:l,y:c,box:u}=eI(e,n),d=s.left+(u&&a.left),h=s.top+(u&&a.top);let{width:g,height:m}=t;return o&&(g-=s.width+a.width,m-=s.height+a.height),{x:Math.round((l-d)/g*n.width/r),y:Math.round((c-h)/m*n.height/r)}}function tI(e,t,n){let r,i;if(t===void 0||n===void 0){const o=e&&gm(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const s=o.getBoundingClientRect(),a=Ch(o),l=As(a,"border","width"),c=As(a,"padding");t=s.width-c.width-l.width,n=s.height-c.height-l.height,r=Sd(a.maxWidth,o,"clientWidth"),i=Sd(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:r||_d,maxHeight:i||_d}}const ju=e=>Math.round(e*10)/10;function nI(e,t,n,r){const i=Ch(e),o=As(i,"margin"),s=Sd(i.maxWidth,e,"clientWidth")||_d,a=Sd(i.maxHeight,e,"clientHeight")||_d,l=tI(e,t,n);let{width:c,height:u}=l;if(i.boxSizing==="content-box"){const h=As(i,"border","width"),g=As(i,"padding");c-=g.width+h.width,u-=g.height+h.height}return c=Math.max(0,c-o.width),u=Math.max(0,r?c/r:u-o.height),c=ju(Math.min(c,s,l.maxWidth)),u=ju(Math.min(u,a,l.maxHeight)),c&&!u&&(u=ju(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=ju(Math.floor(u*r))),{width:c,height:u}}function hy(e,t,n){const r=t||1,i=Math.floor(e.height*r),o=Math.floor(e.width*r);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const s=e.canvas;return s.style&&(n||!s.style.height&&!s.style.width)&&(s.style.height=`${e.height}px`,s.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||s.height!==i||s.width!==o?(e.currentDevicePixelRatio=r,s.height=i,s.width=o,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const rI=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};pm()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function py(e,t){const n=QD(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function ps(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function iI(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r==="middle"?n<.5?e.y:t.y:r==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function oI(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},s=ps(e,i,n),a=ps(i,o,n),l=ps(o,t,n),c=ps(s,a,n),u=ps(a,l,n);return ps(c,u,n)}function Px(e){return e==="angle"?{between:gx,compare:eD,normalize:ei}:{between:nD,compare:(t,n)=>t-n,normalize:t=>t}}function gy({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function sI(e,t,n){const{property:r,start:i,end:o}=n,{between:s,normalize:a}=Px(r),l=t.length;let{start:c,end:u,loop:d}=e,h,g;if(d){for(c+=l,u+=l,h=0,g=l;hl(i,w,C)&&a(i,w)!==0,E=()=>a(o,C)===0||l(o,w,C),O=()=>y||M(),T=()=>!y||E();for(let P=u,L=u;P<=d;++P)v=t[P%s],!v.skip&&(C=c(v[r]),C!==w&&(y=l(C,i,o),k===null&&O()&&(k=a(C,i)===0?P:L),k!==null&&T()&&(m.push(gy({start:k,end:P,loop:h,count:s,style:g})),k=null),L=P,w=C));return k!==null&&m.push(gy({start:k,end:d,loop:h,count:s,style:g})),m}function lI(e,t){const n=[],r=e.segments;for(let i=0;ii&&e[o%t].skip;)o--;return o%=t,{start:i,end:o}}function uI(e,t,n,r){const i=e.length,o=[];let s=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%i];c.skip||c.stop?a.skip||(r=!1,o.push({start:t%i,end:(l-1)%i,loop:r}),t=s=c.stop?l:null):(s=l,a.skip&&(t=l)),a=c}return s!==null&&o.push({start:t%i,end:s%i,loop:r}),o}function fI(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const o=!!e._loop,{start:s,end:a}=cI(n,i,o,r);if(r===!0)return my(e,[{start:s,end:a,loop:o}],n,t);const l=a{let e=0;return()=>e++})();function en(e){return e===null||typeof e>"u"}function xn(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Nt(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function Nn(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Sr(e,t){return Nn(e)?e:t}function Ut(e,t){return typeof e>"u"?t:e}const HR=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function hn(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Qn(e,t,n,r){let i,o,s;if(xn(e))for(o=e.length,i=0;ie,x:e=>e.x,y:e=>e.y};function YR(e){const t=e.split("."),n=[];let r="";for(const i of t)r+=i,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function KR(e){const t=YR(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function xd(e,t){return(Xv[t]||(Xv[t]=KR(t)))(e)}function sm(e){return e.charAt(0).toUpperCase()+e.slice(1)}const bd=e=>typeof e<"u",Jo=e=>typeof e=="function",ey=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function qR(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Sn=Math.PI,ai=2*Sn,GR=ai+Sn,_d=Number.POSITIVE_INFINITY,ZR=Sn/180,Pr=Sn/2,as=Sn/4,ty=Sn*2/3,Oo=Math.log10,Ua=Math.sign;function Zl(e,t,n){return Math.abs(e-t)i-o).pop(),t}function Dc(e){return!isNaN(parseFloat(e))&&isFinite(e)}function JR(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function px(e,t,n){let r,i,o;for(r=0,i=e.length;rl&&c=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function lm(e,t,n){n=n||(s=>e[s]1;)o=i+r>>1,n(o)?i=o:r=o;return{lo:i,hi:r}}const bs=(e,t,n,r)=>lm(e,n,r?i=>{const o=e[i][t];return oe[i][t]lm(e,n,r=>e[r][t]>=n);function iD(e,t,n){let r=0,i=e.length;for(;rr&&e[i-1]>n;)i--;return r>0||i{const r="_onData"+sm(n),i=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const s=i.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...o)}),s}})})}function oy(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(mx.forEach(o=>{delete e[o]}),delete e._chartjs)}function sD(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const vx=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function yx(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,vx.call(window,()=>{r=!1,e.apply(t,n)}))}}function aD(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const wx=e=>e==="start"?"left":e==="end"?"right":"center",Ql=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2;function lD(e,t,n){const r=t.length;let i=0,o=r;if(e._sorted){const{iScale:s,_parsed:a}=e,l=s.axis,{min:c,max:u,minDefined:d,maxDefined:h}=s.getUserBounds();d&&(i=_i(Math.min(bs(a,l,c).lo,n?r:bs(t,l,s.getPixelForValue(c)).lo),0,r-1)),h?o=_i(Math.max(bs(a,s.axis,u,!0).hi+1,n?0:bs(t,l,s.getPixelForValue(u),!0).hi+1),i,r)-i:o=r-i}return{start:i,count:o}}function cD(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;const o=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),o}const Uu=e=>e===0||e===1,sy=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*ai/n)),ay=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*ai/n)+1,Jl={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*Pr)+1,easeOutSine:e=>Math.sin(e*Pr),easeInOutSine:e=>-.5*(Math.cos(Sn*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Uu(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Uu(e)?e:sy(e,.075,.3),easeOutElastic:e=>Uu(e)?e:ay(e,.075,.3),easeInOutElastic(e){return Uu(e)?e:e<.5?.5*sy(e*2,.1125,.45):.5+.5*ay(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Jl.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Jl.easeInBounce(e*2)*.5:Jl.easeOutBounce(e*2-1)*.5+.5};function cm(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function ly(e){return cm(e)?e:new Oc(e)}function C1(e){return cm(e)?e:new Oc(e).saturate(.5).darken(.1).hexString()}const uD=["x","y","borderWidth","radius","tension"],fD=["color","borderColor","backgroundColor"];function dD(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:fD},numbers:{type:"number",properties:uD}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function hD(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const cy=new Map;function pD(e,t){t=t||{};const n=e+JSON.stringify(t);let r=cy.get(n);return r||(r=new Intl.NumberFormat(e,t),cy.set(n,r)),r}function um(e,t,n){return pD(t,n).format(e)}const xx={values(e){return xn(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let i,o=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(i="scientific"),o=gD(e,n)}const s=Oo(Math.abs(o)),a=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),um(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(Oo(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?xx.numeric.call(this,e,t,n):""}};function gD(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var _h={formatters:xx};function mD(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:_h.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const $s=Object.create(null),ep=Object.create(null);function Xl(e,t){if(!t)return e;const n=t.split(".");for(let r=0,i=n.length;rr.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,i)=>C1(i.backgroundColor),this.hoverBorderColor=(r,i)=>C1(i.borderColor),this.hoverColor=(r,i)=>C1(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return S1(this,t,n)}get(t){return Xl(this,t)}describe(t,n){return S1(ep,t,n)}override(t,n){return S1($s,t,n)}route(t,n,r,i){const o=Xl(this,t),s=Xl(this,r),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=s[i];return Nt(l)?Object.assign({},c,l):Ut(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var bn=new vD({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[dD,hD,mD]);function yD(e){return!e||en(e.size)||en(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Cd(e,t,n,r,i){let o=t[i];return o||(o=t[i]=e.measureText(i).width,n.push(i)),o>r&&(r=o),r}function wD(e,t,n,r){r=r||{};let i=r.data=r.data||{},o=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},o=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let s=0;const a=n.length;let l,c,u,d,h;for(l=0;ln.length){for(l=0;l0&&e.stroke()}}function Zi(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&o.strokeColor!=="";let l,c;for(e.save(),e.font=i.string,SD(e,o),l=0;l+e||0;function Cx(e,t){const n={},r=Nt(t),i=r?Object.keys(t):t,o=Nt(e)?r?s=>Ut(e[s],e[t[s]]):s=>e[s]:()=>e;for(const s of i)n[s]=LD(o(s));return n}function OD(e){return Cx(e,{top:"y",right:"x",bottom:"y",left:"x"})}function RD(e){return Cx(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Li(e){const t=OD(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Xo(e,t){e=e||{},t=t||bn.font;let n=Ut(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=Ut(e.style,t.style);r&&!(""+r).match(PD)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:Ut(e.family,t.family),lineHeight:AD(Ut(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:Ut(e.weight,t.weight),string:""};return i.string=yD(i),i}function Fu(e,t,n,r){let i,o,s;for(i=0,o=e.length;in&&a===0?0:a+l;return{min:s(r,-Math.abs(o)),max:s(i,o)}}function Ys(e,t){return Object.assign(Object.create(e),t)}function fm(e,t=[""],n,r,i=()=>e[0]){const o=n||e;typeof r>"u"&&(r=Mx("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:r,_getTarget:i,override:a=>fm([a,...e],t,o,r)};return new Proxy(s,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return kx(a,l,()=>jD(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return dy(a).includes(l)},ownKeys(a){return dy(a)},set(a,l,c){const u=a._storage||(a._storage=i());return a[l]=u[l]=c,delete a._keys,!0}})}function Fa(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Sx(e,r),setContext:o=>Fa(e,o,n,r),override:o=>Fa(e.override(o),t,n,r)};return new Proxy(i,{deleteProperty(o,s){return delete o[s],delete e[s],!0},get(o,s,a){return kx(o,s,()=>ND(o,s,a))},getOwnPropertyDescriptor(o,s){return o._descriptors.allKeys?Reflect.has(e,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,s)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,s){return Reflect.has(e,s)},ownKeys(){return Reflect.ownKeys(e)},set(o,s,a){return e[s]=a,delete o[s],!0}})}function Sx(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:Jo(n)?n:()=>n,isIndexable:Jo(r)?r:()=>r}}const ID=(e,t)=>e?e+sm(t):t,dm=(e,t)=>Nt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function kx(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function ND(e,t,n){const{_proxy:r,_context:i,_subProxy:o,_descriptors:s}=e;let a=r[t];return Jo(a)&&s.isScriptable(t)&&(a=WD(t,a,e,n)),xn(a)&&a.length&&(a=$D(t,a,e,s.isIndexable)),dm(t,a)&&(a=Fa(a,i,o&&o[t],s)),a}function WD(e,t,n,r){const{_proxy:i,_context:o,_subProxy:s,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(o,s||r);return a.delete(e),dm(e,l)&&(l=hm(i._scopes,i,e,l)),l}function $D(e,t,n,r){const{_proxy:i,_context:o,_subProxy:s,_descriptors:a}=n;if(typeof o.index<"u"&&r(e))return t[o.index%t.length];if(Nt(t[0])){const l=t,c=i._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=hm(c,i,e,u);t.push(Fa(d,o,s&&s[e],a))}}return t}function Ex(e,t,n){return Jo(e)?e(t,n):e}const UD=(e,t)=>e===!0?t:typeof e=="string"?xd(t,e):void 0;function FD(e,t,n,r,i){for(const o of t){const s=UD(n,o);if(s){e.add(s);const a=Ex(s._fallback,n,i);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(s===!1&&typeof r<"u"&&n!==r)return null}return!1}function hm(e,t,n,r){const i=t._rootScopes,o=Ex(t._fallback,n,r),s=[...e,...i],a=new Set;a.add(r);let l=fy(a,s,n,o||n,r);return l===null||typeof o<"u"&&o!==n&&(l=fy(a,s,o,l,r),l===null)?!1:fm(Array.from(a),[""],i,o,()=>BD(t,n,r))}function fy(e,t,n,r,i){for(;n;)n=FD(e,t,n,r,i);return n}function BD(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return xn(i)&&Nt(n)?n:i||{}}function jD(e,t,n,r){let i;for(const o of t)if(i=Mx(ID(o,e),n),typeof i<"u")return dm(e,i)?hm(n,r,e,i):i}function Mx(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function dy(e){let t=e._keys;return t||(t=e._keys=HD(e._scopes)),t}function HD(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(i=>!i.startsWith("_")))t.add(r);return Array.from(t)}const zD=Number.EPSILON||1e-14,Ba=(e,t)=>te==="x"?"y":"x";function VD(e,t,n,r){const i=e.skip?t:e,o=t,s=n.skip?t:n,a=iy(o,i),l=iy(s,o);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=r*c,h=r*u;return{previous:{x:o.x-d*(s.x-i.x),y:o.y-d*(s.y-i.y)},next:{x:o.x+h*(s.x-i.x),y:o.y+h*(s.y-i.y)}}}function YD(e,t,n){const r=e.length;let i,o,s,a,l,c=Ba(e,0);for(let u=0;u!c.skip)),t.cubicInterpolationMode==="monotone")qD(e,i);else{let c=r?e[e.length-1]:e[0];for(o=0,s=e.length;oe.ownerDocument.defaultView.getComputedStyle(e,null);function QD(e,t){return Ch(e).getPropertyValue(t)}const JD=["top","right","bottom","left"];function As(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const o=JD[i];r[o]=parseFloat(e[t+"-"+o+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const XD=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function eI(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:o}=r;let s=!1,a,l;if(XD(i,o,e.target))a=i,l=o;else{const c=t.getBoundingClientRect();a=r.clientX-c.left,l=r.clientY-c.top,s=!0}return{x:a,y:l,box:s}}function hs(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=Ch(n),o=i.boxSizing==="border-box",s=As(i,"padding"),a=As(i,"border","width"),{x:l,y:c,box:u}=eI(e,n),d=s.left+(u&&a.left),h=s.top+(u&&a.top);let{width:g,height:m}=t;return o&&(g-=s.width+a.width,m-=s.height+a.height),{x:Math.round((l-d)/g*n.width/r),y:Math.round((c-h)/m*n.height/r)}}function tI(e,t,n){let r,i;if(t===void 0||n===void 0){const o=e&&gm(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const s=o.getBoundingClientRect(),a=Ch(o),l=As(a,"border","width"),c=As(a,"padding");t=s.width-c.width-l.width,n=s.height-c.height-l.height,r=Sd(a.maxWidth,o,"clientWidth"),i=Sd(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:r||_d,maxHeight:i||_d}}const ju=e=>Math.round(e*10)/10;function nI(e,t,n,r){const i=Ch(e),o=As(i,"margin"),s=Sd(i.maxWidth,e,"clientWidth")||_d,a=Sd(i.maxHeight,e,"clientHeight")||_d,l=tI(e,t,n);let{width:c,height:u}=l;if(i.boxSizing==="content-box"){const h=As(i,"border","width"),g=As(i,"padding");c-=g.width+h.width,u-=g.height+h.height}return c=Math.max(0,c-o.width),u=Math.max(0,r?c/r:u-o.height),c=ju(Math.min(c,s,l.maxWidth)),u=ju(Math.min(u,a,l.maxHeight)),c&&!u&&(u=ju(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=ju(Math.floor(u*r))),{width:c,height:u}}function hy(e,t,n){const r=t||1,i=Math.floor(e.height*r),o=Math.floor(e.width*r);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const s=e.canvas;return s.style&&(n||!s.style.height&&!s.style.width)&&(s.style.height=`${e.height}px`,s.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||s.height!==i||s.width!==o?(e.currentDevicePixelRatio=r,s.height=i,s.width=o,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const rI=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};pm()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function py(e,t){const n=QD(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function ps(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function iI(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r==="middle"?n<.5?e.y:t.y:r==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function oI(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},s=ps(e,i,n),a=ps(i,o,n),l=ps(o,t,n),c=ps(s,a,n),u=ps(a,l,n);return ps(c,u,n)}function Px(e){return e==="angle"?{between:gx,compare:eD,normalize:ei}:{between:nD,compare:(t,n)=>t-n,normalize:t=>t}}function gy({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function sI(e,t,n){const{property:r,start:i,end:o}=n,{between:s,normalize:a}=Px(r),l=t.length;let{start:c,end:u,loop:d}=e,h,g;if(d){for(c+=l,u+=l,h=0,g=l;hl(i,w,C)&&a(i,w)!==0,E=()=>a(o,C)===0||l(o,w,C),O=()=>y||M(),T=()=>!y||E();for(let P=u,L=u;P<=d;++P)v=t[P%s],!v.skip&&(C=c(v[r]),C!==w&&(y=l(C,i,o),k===null&&O()&&(k=a(C,i)===0?P:L),k!==null&&T()&&(m.push(gy({start:k,end:P,loop:h,count:s,style:g})),k=null),L=P,w=C));return k!==null&&m.push(gy({start:k,end:d,loop:h,count:s,style:g})),m}function lI(e,t){const n=[],r=e.segments;for(let i=0;ii&&e[o%t].skip;)o--;return o%=t,{start:i,end:o}}function uI(e,t,n,r){const i=e.length,o=[];let s=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%i];c.skip||c.stop?a.skip||(r=!1,o.push({start:t%i,end:(l-1)%i,loop:r}),t=s=c.stop?l:null):(s=l,a.skip&&(t=l)),a=c}return s!==null&&o.push({start:t%i,end:s%i,loop:r}),o}function fI(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const o=!!e._loop,{start:s,end:a}=cI(n,i,o,r);if(r===!0)return my(e,[{start:s,end:a,loop:o}],n,t);const l=aa({chart:t,initial:n.initial,numSteps:s,currentStep:Math.min(r-n.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=vx.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const o=r.items;let s=o.length-1,a=!1,l;for(;s>=0;--s)l=o[s],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(o[s]=o[o.length-1],o.pop());a&&(i.draw(),this._notify(i,r,t,"progress")),o.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=o.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,i)=>Math.max(r,i._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 i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var $i=new pI;const yy="transparent",gI={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=ly(e||yy),i=r.valid&&ly(t||yy);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class mI{constructor(t,n,r,i){const o=n[r];i=Fu([t.to,i,o,t.from]);const s=Fu([t.from,o,i]);this._active=!0,this._fn=t.fn||gI[t.type||typeof s],this._easing=Jl[t.easing]||Jl.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=s,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],o=r-this._start,s=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Fu([t.to,n,i,t.from]),this._from=Fu([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,o=this._from,s=this._loop,a=this._to;let l;if(this._active=o!==a&&(s||n1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(o,a,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 i=0;i{const o=t[i];if(!Nt(o))return;const s={};for(const a of n)s[a]=o[a];(xn(o.properties)&&o.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,s)})})}_animateOptions(t,n){const r=n.options,i=wI(t,r);if(!i)return[];const o=this._createAnimations(i,r);return r.$shared&&yI(t.options.$animations,r).then(()=>{t.options=r},()=>{}),o}_createAnimations(t,n){const r=this._properties,i=[],o=t.$animations||(t.$animations={}),s=Object.keys(n),a=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,n));continue}const u=n[c];let d=o[c];const h=r.get(c);if(d)if(h&&d.active()){d.update(h,u,a);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}o[c]=d=new mI(h,t,c,u),i.push(d)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return $i.add(this._chart,r),!0}}function yI(e,t){const n=[],r=Object.keys(t);for(let i=0;i0||!n&&o<0)return i.index}return null}function Cy(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:o,vScale:s,index:a}=r,l=o.axis,c=s.axis,u=CI(o,s,r),d=t.length;let h;for(let g=0;gn[r].axis===t).shift()}function EI(e,t){return Ys(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function MI(e,t,n){return Ys(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function hl(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const o=i._stacks;if(!o||o[r]===void 0||o[r][n]===void 0)return;delete o[r][n],o[r]._visualValues!==void 0&&o[r]._visualValues[n]!==void 0&&delete o[r]._visualValues[n]}}}const E1=e=>e==="reset"||e==="none",Sy=(e,t)=>t?e:Object.assign({},e),TI=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Ax(n,!0),values:null};class ec{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=by(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&&hl(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(d,h,g,m)=>d==="x"?h:d==="r"?m:g,o=n.xAxisID=Ut(r.xAxisID,k1(t,"x")),s=n.yAxisID=Ut(r.yAxisID,k1(t,"y")),a=n.rAxisID=Ut(r.rAxisID,k1(t,"r")),l=n.indexAxis,c=n.iAxisID=i(l,o,s,a),u=n.vAxisID=i(l,s,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(s),n.rScale=this.getScaleForId(a),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&&oy(this._data,this),t._stacked&&hl(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Nt(n)){const i=this._cachedMeta;this._data=_I(n,i)}else if(r!==n){if(r){oy(r,this);const i=this._cachedMeta;hl(i),i._parsed=[]}n&&Object.isExtensible(n)&&oD(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 i=!1;this._dataCheck();const o=n._stacked;n._stacked=by(n.vScale,n),n.stack!==r.stack&&(i=!0,hl(n),n.stack=r.stack),this._resyncElements(t),(i||o!==n._stacked)&&Cy(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:i}=this,{iScale:o,_stacked:s}=r,a=o.axis;let l=t===0&&n===i.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,h;if(this._parsing===!1)r._parsed=i,r._sorted=!0,h=i;else{xn(i[t])?h=this.parseArrayData(r,i,t,n):Nt(i[t])?h=this.parseObjectData(r,i,t,n):h=this.parsePrimitiveData(r,i,t,n);const g=()=>d[a]===null||c&&d[a]y||d=0;--h)if(!m()){this.updateRangeFromParsed(c,t,g,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,o,s;for(i=0,o=n.length;i=0&&tthis.getContext(r,i,n),y=c.resolveNamedOptions(h,g,m,d);return y.$shared&&(y.$shared=l,o[s]=Object.freeze(Sy(y,l))),y}_resolveAnimations(t,n,r){const i=this.chart,o=this._cachedDataOpts,s=`animation-${n}`,a=o[s];if(a)return a;let l;if(i.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 vI(i,l&&l.animations);return l&&l._cacheable&&(o[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||E1(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,o=this.getSharedOptions(r),s=this.includeOptions(n,o)||o!==i;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:s}}updateElement(t,n,r,i){E1(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!E1(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const o=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(o)||o})}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[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const i=r.length,o=n.length,s=Math.min(o,i);s&&this.parse(0,s),o>i?this._insertElements(i,o-i,t):o{for(c.length+=n,a=c.length-1;a>=s;a--)c[a]=c[a-n]};for(l(o),a=t;a0&&this.getParsed(n-1);for(let E=0;E=v){T.skip=!0;continue}const P=this.getParsed(E),L=en(P[g]),W=T[h]=s.getPixelForValue(P[h],E),I=T[g]=o||L?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,P,l):P[g],E);T.skip=isNaN(W)||isNaN(I)||L,T.stop=E>0&&Math.abs(P[h]-M[h])>k,y&&(T.parsed=P,T.raw=c.data[E]),d&&(T.options=u||this.resolveDataElementOptions(E,O.active?"active":i)),C||this.updateElement(O,E,T,i),M=P}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const o=i[0].size(this.resolveDataElementOptions(0)),s=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,o,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Je(vf,"id","line"),Je(vf,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Je(vf,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function cs(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class mm{constructor(t){Je(this,"options");this.options=t||{}}static override(t){Object.assign(mm.prototype,t)}init(){}formats(){return cs()}parse(){return cs()}format(){return cs()}add(){return cs()}diff(){return cs()}startOf(){return cs()}endOf(){return cs()}}var PI={_date:mm};function AI(e,t,n,r){const{controller:i,data:o,_sorted:s}=e,a=i._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&s&&o.length){const l=a._reversePixels?rD:bs;if(r){if(i._sharedOptions){const c=o[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(o,t,n-u),h=l(o,t,n+u);return{lo:d.lo,hi:h.hi}}}}else return l(o,t,n)}return{lo:0,hi:o.length-1}}function ou(e,t,n,r,i){const o=e.getSortedVisibleDatasetMetas(),s=n[t];for(let a=0,l=o.length;a{l[s](t[n],i)&&(o.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,i))}),r&&!a?[]:o}var DI={evaluateInteractionItems:ou,modes:{index(e,t,n,r){const i=hs(t,e),o=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?M1(e,i,o,r,s):T1(e,i,o,!1,r,s),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[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 i=hs(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?M1(e,i,o,r,s):T1(e,i,o,!1,r,s);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;un.pos===t)}function Ey(e,t){return e.filter(n=>Lx.indexOf(n.pos)===-1&&n.box.axis===t)}function gl(e,t){return e.sort((n,r)=>{const i=t?r:n,o=t?n:r;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function II(e){const t=[];let n,r,i,o,s,a;for(n=0,r=(e||[]).length;nc.box.fullSize),!0),r=gl(pl(t,"left"),!0),i=gl(pl(t,"right")),o=gl(pl(t,"top"),!0),s=gl(pl(t,"bottom")),a=Ey(t,"x"),l=Ey(t,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:i.concat(l).concat(s).concat(a),chartArea:pl(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:o.concat(s).concat(a)}}function My(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Ox(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 UI(e,t,n,r){const{pos:i,box:o}=n,s=e.maxPadding;if(!Nt(i)){n.size&&(e[i]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?o.height:o.width),n.size=d.size/d.count,e[i]+=n.size}o.getPadding&&Ox(s,o.getPadding());const a=Math.max(0,t.outerWidth-My(s,e,"left","right")),l=Math.max(0,t.outerHeight-My(s,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function FI(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function BI(e,t){const n=t.maxPadding;function r(i){const o={left:0,top:0,right:0,bottom:0};return i.forEach(s=>{o[s]=Math.max(t[s],n[s])}),o}return r(e?["left","right"]:["top","bottom"])}function Pl(e,t,n,r){const i=[];let o,s,a,l,c,u;for(o=0,s=e.length,c=0;o{typeof y.beforeLayout=="function"&&y.beforeLayout()});const u=l.reduce((y,k)=>k.box.options&&k.box.options.display===!1?y:y+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:o,availableHeight:s,vBoxMaxWidth:o/2/u,hBoxMaxHeight:s/2}),h=Object.assign({},i);Ox(h,Li(r));const g=Object.assign({maxPadding:h,w:o,h:s,x:i.left,y:i.top},i),m=WI(l.concat(c),d);Pl(a.fullSize,g,d,m),Pl(l,g,d,m),Pl(c,g,d,m)&&Pl(l,g,d,m),FI(g),Ty(a.leftAndTop,g,d,m),g.x+=g.w,g.y+=g.h,Ty(a.rightAndBottom,g,d,m),e.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},Qn(a.chartArea,y=>{const k=y.box;Object.assign(k,e.chartArea),k.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class Rx{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class jI extends Rx{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const yf="$chartjs",HI={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Py=e=>e===null||e==="";function zI(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[yf]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Py(i)){const o=py(e,"width");o!==void 0&&(e.width=o)}if(Py(r))if(e.style.height==="")e.height=e.width/(t||2);else{const o=py(e,"height");o!==void 0&&(e.height=o)}return e}const Dx=rI?{passive:!0}:!1;function VI(e,t,n){e&&e.addEventListener(t,n,Dx)}function YI(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Dx)}function KI(e,t){const n=HI[e.type]||e.type,{x:r,y:i}=hs(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function kd(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function qI(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||kd(a.addedNodes,r),s=s&&!kd(a.removedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function GI(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||kd(a.removedNodes,r),s=s&&!kd(a.addedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const Nc=new Map;let Ay=0;function Ix(){const e=window.devicePixelRatio;e!==Ay&&(Ay=e,Nc.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function ZI(e,t){Nc.size||window.addEventListener("resize",Ix),Nc.set(e,t)}function QI(e){Nc.delete(e),Nc.size||window.removeEventListener("resize",Ix)}function JI(e,t,n){const r=e.canvas,i=r&&gm(r);if(!i)return;const o=yx((a,l)=>{const c=i.clientWidth;n(a,l),c{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return s.observe(i),ZI(e,o),s}function P1(e,t,n){n&&n.disconnect(),t==="resize"&&QI(e)}function XI(e,t,n){const r=e.canvas,i=yx(o=>{e.ctx!==null&&n(KI(o,e))},e);return VI(r,t,i),i}class eN extends Rx{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(zI(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[yf])return!1;const r=n[yf].initial;["height","width"].forEach(o=>{const s=r[o];en(s)?n.removeAttribute(o):n.setAttribute(o,s)});const i=r.style||{};return Object.keys(i).forEach(o=>{n.style[o]=i[o]}),n.width=n.width,delete n[yf],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),s={attach:qI,detach:GI,resize:JI}[n]||XI;i[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:P1,detach:P1,resize:P1}[n]||YI)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return nI(t,n,r,i)}isAttached(t){const n=t&&gm(t);return!!(n&&n.isConnected)}}function tN(e){return!pm()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?jI:eN}class Us{constructor(){Je(this,"x");Je(this,"y");Je(this,"active",!1);Je(this,"options");Je(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return Dc(this.x)&&Dc(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(o=>{i[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),i}}Je(Us,"defaults",{}),Je(Us,"defaultRoutes");function nN(e,t){const n=e.options.ticks,r=rN(e),i=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?oN(t):[],s=o.length,a=o[0],l=o[s-1],c=[];if(s>i)return sN(t,c,o,s/i),c;const u=iN(o,t,i);if(s>0){let d,h;const g=s>1?Math.round((l-a)/(s-1)):null;for(zu(t,c,u,en(g)?0:a-g,a),d=0,h=s-1;di)return l}return Math.max(i,1)}function oN(e){const t=[];let n,r;for(n=0,r=e.length;ne==="left"?"right":e==="right"?"left":e,Ly=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Oy=(e,t)=>Math.min(t||e,e);function Ry(e,t){const n=[],r=e.length/t,i=e.length;let o=0;for(;os+a)))return l}function uN(e,t){Qn(e,n=>{const r=n.gc,i=r.length/2;let o;if(i>t){for(o=0;or?r:n,r=i&&n>r?n:r,{min:Sr(n,Sr(r,n)),max:Sr(r,Sr(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(){dn(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:o,ticks:s}=this.options,a=s.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=DD(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=o||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,g=_i(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/r:g/(r-1),d+6>a&&(a=g/(r-(t.offset?.5:1)),l=this.maxHeight-ml(t.grid)-n.padding-Dy(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),s=am(Math.min(Math.asin(_i((u.highest.height+6)/a,-1,1)),Math.asin(_i(l/c,-1,1))-Math.asin(_i(h/c,-1,1)))),s=Math.max(i,Math.min(o,s))),this.labelRotation=s}afterCalculateLabelRotation(){dn(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){dn(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:o}}=this,s=this._isVisible(),a=this.isHorizontal();if(s){const l=Dy(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=ml(o)+l):(t.height=this.maxHeight,t.width=ml(o)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),g=r.padding*2,m=Ro(this.labelRotation),y=Math.cos(m),k=Math.sin(m);if(a){const C=r.mirror?0:k*d.width+y*h.height;t.height=Math.min(this.maxHeight,t.height+C+g)}else{const C=r.mirror?0:y*d.width+k*h.height;t.width=Math.min(this.maxWidth,t.width+C+g)}this._calculatePadding(c,u,k,y)}}this._handleMargins(),a?(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,i){const{ticks:{align:o,padding:s},position:a}=this.options,l=this.labelRotation!==0,c=a!=="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,g=0;l?c?(h=i*t.width,g=r*n.height):(h=r*t.height,g=i*n.width):o==="start"?g=n.width:o==="end"?h=t.width:o!=="inner"&&(h=t.width/2,g=n.width/2),this.paddingLeft=Math.max((h-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((g-d+s)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;o==="start"?(u=0,d=t.height):o==="end"&&(u=n.height,d=0),this.paddingTop=u+s,this.paddingBottom=d+s}}_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(){dn(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({width:s[L]||0,height:a[L]||0});return{first:P(0),last:P(n-1),widest:P(O),highest:P(T),widths:s,heights:a}}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 tD(this._alignToPixels?ls(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&&ta*i?a/r:l/i:l*i0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:o,position:s,border:a}=i,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=ml(o),g=[],m=a.setContext(this.getContext()),y=m.display?m.width:0,k=y/2,C=function(fe){return ls(r,fe,y)};let v,w,M,E,O,T,P,L,W,I,R,G;if(s==="top")v=C(this.bottom),T=this.bottom-h,L=v-k,I=C(t.top)+k,G=t.bottom;else if(s==="bottom")v=C(this.top),I=t.top,G=C(t.bottom)-k,T=v+k,L=this.top+h;else if(s==="left")v=C(this.right),O=this.right-h,P=v-k,W=C(t.left)+k,R=t.right;else if(s==="right")v=C(this.left),W=t.left,R=C(t.right)-k,O=v+k,P=this.left+h;else if(n==="x"){if(s==="center")v=C((t.top+t.bottom)/2+.5);else if(Nt(s)){const fe=Object.keys(s)[0],Ce=s[fe];v=C(this.chart.scales[fe].getPixelForValue(Ce))}I=t.top,G=t.bottom,T=v+k,L=T+h}else if(n==="y"){if(s==="center")v=C((t.left+t.right)/2);else if(Nt(s)){const fe=Object.keys(s)[0],Ce=s[fe];v=C(this.chart.scales[fe].getPixelForValue(Ce))}O=v-k,P=O-h,W=t.left,R=t.right}const Z=Ut(i.ticks.maxTicksLimit,d),Y=Math.max(1,Math.ceil(d/Z));for(w=0;w0&&(tt-=ft/2);break}Ze={left:tt,top:Pe,width:ft+je.width,height:st+je.height,color:Y.backdropColor}}k.push({label:M,font:L,textOffset:R,options:{rotation:y,color:Ce,strokeColor:Q,strokeWidth:ue,textAlign:ge,textBaseline:G,translation:[E,O],backdrop:Ze}})}return k}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Ro(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:o}}=this.options,s=this._getLabelSizes(),a=t+o,l=s.widest.width;let c,u;return n==="left"?i?(u=this.right+o,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?i?(u=this.left+o,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,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:i,width:o,height:s}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,o,s),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(o=>o.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,s;const a=(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(o=0,s=i.length;o{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let o,s;for(o=0,s=n.length;o{const r=n.split("."),i=r.pop(),o=[e].concat(r).join("."),s=t[n].split("."),a=s.pop(),l=s.join(".");bn.route(o,i,l,a)})}function vN(e){return"id"in e&&"defaults"in e}class yN{constructor(){this.controllers=new Vu(ec,"datasets",!0),this.elements=new Vu(Us,"elements"),this.plugins=new Vu(Object,"plugins"),this.scales=new Vu(Ks,"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(i=>{const o=r||this._getRegistryForType(i);r||o.isForType(i)||o===this.plugins&&i.id?this._exec(t,o,i):Qn(i,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const i=sm(t);dn(r["before"+i],[],r),n[t](r),dn(r["after"+i],[],r)}_getRegistryForType(t){for(let n=0;no.filter(a=>!s.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function xN(e){const t={},n=[],r=Object.keys(mi.plugins.items);for(let o=0;o1&&Iy(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Ny(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function MN(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 Ny(e,"x",n[0])||Ny(e,"y",n[0])}return{}}function TN(e,t){const n=$s[e.type]||{scales:{}},r=t.scales||{},i=tp(e.type,t),o=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!Nt(a))return console.error(`Invalid scale configuration for scale: ${s}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=np(s,a,MN(s,e),bn.scales[a.type]),c=kN(l,i),u=n.scales||{};o[s]=Gl(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||tp(a,t),u=($s[a]||{}).scales||{};Object.keys(u).forEach(d=>{const h=SN(d,l),g=s[h+"AxisID"]||h;o[g]=o[g]||Object.create(null),Gl(o[g],[{axis:h},r[g],u[d]])})}),Object.keys(o).forEach(s=>{const a=o[s];Gl(a,[bn.scales[a.type],bn.scale])}),o}function Nx(e){const t=e.options||(e.options={});t.plugins=Ut(t.plugins,{}),t.scales=TN(e,t)}function Wx(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function PN(e){return e=e||{},e.data=Wx(e.data),Nx(e),e}const Wy=new Map,$x=new Set;function Yu(e,t){let n=Wy.get(e);return n||(n=t(),Wy.set(e,n),$x.add(n)),n}const vl=(e,t,n)=>{const r=xd(t,n);r!==void 0&&e.add(r)};class AN{constructor(t){this._config=PN(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=Wx(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(),Nx(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Yu(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Yu(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Yu(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return Yu(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:o}=this,s=this._cachedScopes(t,r),a=s.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>vl(l,t,d))),u.forEach(d=>vl(l,i,d)),u.forEach(d=>vl(l,$s[o]||{},d)),u.forEach(d=>vl(l,bn,d)),u.forEach(d=>vl(l,ep,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),$x.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,$s[n]||{},bn.datasets[n]||{},{type:n},bn,ep]}resolveNamedOptions(t,n,r,i=[""]){const o={$shared:!0},{resolver:s,subPrefixes:a}=$y(this._resolverCache,t,i);let l=s;if(ON(s,n)){o.$shared=!1,r=Jo(r)?r():r;const c=this.createResolver(t,r,a);l=Fa(s,r,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,r=[""],i){const{resolver:o}=$y(this._resolverCache,t,r);return Nt(n)?Fa(o,n,void 0,i):o}}function $y(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let o=r.get(i);return o||(o={resolver:fm(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,o)),o}const LN=e=>Nt(e)&&Object.getOwnPropertyNames(e).some(t=>Jo(e[t]));function ON(e,t){const{isScriptable:n,isIndexable:r}=Sx(e);for(const i of t){const o=n(i),s=r(i),a=(s||o)&&e[i];if(o&&(Jo(a)||LN(a))||s&&xn(a))return!0}return!1}var RN="4.4.3";const DN=["top","bottom","left","right","chartArea"];function Uy(e,t){return e==="top"||e==="bottom"||DN.indexOf(e)===-1&&t==="x"}function Fy(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function By(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),dn(n&&n.onComplete,[e],t)}function IN(e){const t=e.chart,n=t.options.animation;dn(n&&n.onProgress,[e],t)}function Ux(e){return pm()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const wf={},jy=e=>{const t=Ux(e);return Object.values(wf).filter(n=>n.canvas===t).pop()};function NN(e,t,n){const r=Object.keys(e);for(const i of r){const o=+i;if(o>=t){const s=e[i];delete e[i],(n>0||o>t)&&(e[o+n]=s)}}}function WN(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function Ku(e,t,n){return e.options.clip?e[n]:t[n]}function $N(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:Ku(n,t,"left"),right:Ku(n,t,"right"),top:Ku(r,t,"top"),bottom:Ku(r,t,"bottom")}:t}var wo;let Sh=(wo=class{static register(...t){mi.add(...t),Hy()}static unregister(...t){mi.remove(...t),Hy()}constructor(t,n){const r=this.config=new AN(n),i=Ux(t),o=jy(i);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||tN(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,s.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=jR(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=s,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 wN,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=aD(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],wf[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}$i.listen(this,"complete",By),$i.listen(this,"progress",IN),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:o}=this;return en(t)?n&&o?o:i?r/i: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 mi}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():hy(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return uy(this.canvas,this.ctx),this}stop(){return $i.stop(this),this}resize(t,n){$i.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(i,t,n,o),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,hy(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),dn(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Qn(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((s,a)=>(s[a]=!1,s),{});let o=[];n&&(o=o.concat(Object.keys(n).map(s=>{const a=n[s],l=np(s,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Qn(o,s=>{const a=s.options,l=a.id,c=np(l,a),u=Ut(a.type,s.dtype);(a.position===void 0||Uy(a.position,c)!==Uy(s.dposition))&&(a.position=s.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const h=mi.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),Qn(i,(s,a)=>{s||delete r[a]}),Qn(r,s=>{Do.configure(this,s,s.options),Do.addBox(this,s)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,o)=>i.index-o.index),r>n){for(let i=n;in.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r{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()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,u=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Fy("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Qn(this.scales,t=>{Do.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!ey(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:o}of n){const s=r==="_removeElements"?-o:o;NN(t,i,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=o=>new Set(t.filter(s=>s[0]===o).map((s,a)=>a+","+s.splice(1).join(","))),i=r(0);for(let o=1;oo.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Do.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Qn(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,o)=>{i._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r=t._clip,i=!r.disabled,o=$N(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(i&&bx(n,{left:r.left===!1?0:o.left-r.left,right:r.right===!1?this.width:o.right+r.right,top:r.top===!1?0:o.top-r.top,bottom:r.bottom===!1?this.height:o.bottom+r.bottom}),t.controller.draw(),i&&_x(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Zi(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const o=DI.modes[n];return typeof o=="function"?o(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(o=>o&&o._dataset===n).pop();return i||(i={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(i)),i}getContext(){return this.$context||(this.$context=Ys(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 i=r?"show":"hide",o=this.getDatasetMeta(t),s=o.controller._resolveAnimations(void 0,i);bd(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(o,{visible:r}),this.update(a=>a.datasetIndex===t?i: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(),$i.remove(this),t=0,n=this.data.datasets.length;t{n.addEventListener(this,o,s),t[o]=s},i=(o,s,a)=>{o.offsetX=s,o.offsetY=a,this._eventHandler(o)};Qn(this.options.events,o=>r(o,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",o),r("detach",s)};s=()=>{this.attached=!1,i("resize",o),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():s()}unbindEvents(){Qn(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Qn(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let o,s,a,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[s],index:s}});!Jv(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 i=this.options.hover,o=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),s=o(n,t),a=r?t:o(t,n);s.length&&this.updateHoverStyle(s,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const o=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(o||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:o}=this,s=n,a=this._getActiveElements(t,i,r,s),l=qR(t),c=WN(t,this._lastEvent,r,l);r&&(this._lastEvent=null,dn(o.onHover,[t,a,this],this),l&&dn(o.onClick,[t,a,this],this));const u=!Jv(a,i);return(u||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,i)}},Je(wo,"defaults",bn),Je(wo,"instances",wf),Je(wo,"overrides",$s),Je(wo,"registry",mi),Je(wo,"version",RN),Je(wo,"getChart",jy),wo);function Hy(){return Qn(Sh.instances,e=>e._plugins.invalidate())}function Fx(e,t,n=t){e.lineCap=Ut(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Ut(n.borderDash,t.borderDash)),e.lineDashOffset=Ut(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Ut(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Ut(n.borderWidth,t.borderWidth),e.strokeStyle=Ut(n.borderColor,t.borderColor)}function UN(e,t,n){e.lineTo(n.x,n.y)}function FN(e){return e.stepped?_D:e.tension||e.cubicInterpolationMode==="monotone"?CD:UN}function Bx(e,t,n={}){const r=e.length,{start:i=0,end:o=r-1}=n,{start:s,end:a}=t,l=Math.max(i,s),c=Math.min(o,a),u=ia&&o>a;return{count:r,start:l,loop:t.loop,ilen:c(s+(c?a-M:M))%o,w=()=>{y!==k&&(e.lineTo(u,k),e.lineTo(u,y),e.lineTo(u,C))};for(l&&(g=i[v(0)],e.moveTo(g.x,g.y)),h=0;h<=a;++h){if(g=i[v(h)],g.skip)continue;const M=g.x,E=g.y,O=M|0;O===m?(Ek&&(k=E),u=(d*u+M)/++d):(w(),e.lineTo(M,E),m=O,d=0,y=k=E),C=E}w()}function rp(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?jN:BN}function HN(e){return e.stepped?iI:e.tension||e.cubicInterpolationMode==="monotone"?oI:ps}function zN(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Fx(e,t.options),e.stroke(i)}function VN(e,t,n,r){const{segments:i,options:o}=t,s=rp(t);for(const a of i)Fx(e,o,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const YN=typeof Path2D=="function";function KN(e,t,n,r){YN&&!t.options.segment?zN(e,t,n,r):VN(e,t,n,r)}class Al extends Us{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 i=r.spanGaps?this._loop:this._fullLoop;ZD(this._points,r,t,i,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=fI(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,i=t[n],o=this.points,s=lI(this,{property:n,start:i,end:i});if(!s.length)return;const a=[],l=HN(r);let c,u;for(c=0,u=s.length;ct!=="borderDash"&&t!=="fill"});function zy(e,t,n,r){const i=e.options,{[n]:o}=e.getProps([n],r);return Math.abs(t-o)(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function QN(e,t,n,r){const i=e.indexOf(t);if(i===-1)return ZN(e,t,n,r);const o=e.lastIndexOf(t);return i!==o?n:i}const JN=(e,t)=>e===null?null:_i(Math.round(e),0,t);function Vy(e){const t=this.getLabels();return e>=0&&en.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}Je(ip,"id","category"),Je(ip,"defaults",{ticks:{callback:Vy}});function XN(e,t){const n=[],{bounds:i,step:o,min:s,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=e,g=o||1,m=u-1,{min:y,max:k}=t,C=!en(s),v=!en(a),w=!en(c),M=(k-y)/(d+1);let E=ny((k-y)/m/g)*g,O,T,P,L;if(E<1e-14&&!C&&!v)return[{value:y},{value:k}];L=Math.ceil(k/E)-Math.floor(y/E),L>m&&(E=ny(L*E/m/g)*g),en(l)||(O=Math.pow(10,l),E=Math.ceil(E*O)/O),i==="ticks"?(T=Math.floor(y/E)*E,P=Math.ceil(k/E)*E):(T=y,P=k),C&&v&&o&&JR((a-s)/o,E/1e3)?(L=Math.round(Math.min((a-s)/E,u)),E=(a-s)/L,T=s,P=a):w?(T=C?s:T,P=v?a:P,L=c-1,E=(P-T)/L):(L=(P-T)/E,Zl(L,Math.round(L),E/1e3)?L=Math.round(L):L=Math.ceil(L));const W=Math.max(ry(E),ry(T));O=Math.pow(10,en(l)?W:l),T=Math.round(T*O)/O,P=Math.round(P*O)/O;let I=0;for(C&&(h&&T!==s?(n.push({value:s}),Ta)break;n.push({value:R})}return v&&h&&P!==a?n.length&&Zl(n[n.length-1].value,a,Yy(a,M,e))?n[n.length-1].value=a:n.push({value:a}):(!v||P===a)&&n.push({value:P}),n}function Yy(e,t,{horizontal:n,minRotation:r}){const i=Ro(r),o=(n?Math.sin(i):Math.cos(i))||.001,s=.75*t*(""+e).length;return Math.min(t/o,s)}class Ed extends Ks{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 en(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:i,max:o}=this;const s=l=>i=n?i:l,a=l=>o=r?o:l;if(t){const l=Ua(i),c=Ua(o);l<0&&c<0?a(0):l>0&&c>0&&s(0)}if(i===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||s(i-l)}this.min=i,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={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},o=this._range||this,s=XN(i,o);return t.bounds==="ticks"&&px(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return um(t,this.chart.options.locale,this.options.ticks.format)}}class op extends Ed{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Nn(t)?t:0,this.max=Nn(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Ro(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Je(op,"id","linear"),Je(op,"defaults",{ticks:{callback:_h.formatters.numeric}});const Wc=e=>Math.floor(Oo(e)),us=(e,t)=>Math.pow(10,Wc(e)+t);function Ky(e){return e/Math.pow(10,Wc(e))===1}function qy(e,t,n){const r=Math.pow(10,n),i=Math.floor(e/r);return Math.ceil(t/r)-i}function eW(e,t){const n=t-e;let r=Wc(n);for(;qy(e,t,r)>10;)r++;for(;qy(e,t,r)<10;)r--;return Math.min(r,Wc(e))}function tW(e,{min:t,max:n}){t=Sr(e.min,t);const r=[],i=Wc(t);let o=eW(t,n),s=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=i>o?Math.pow(10,i):0,c=Math.round((t-l)*s)/s,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,o)),h=Sr(e.min,Math.round((l+u+d*Math.pow(10,o))*s)/s);for(;h=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,s=o>=0?1:s),h=Math.round((l+u+d*Math.pow(10,o))*s)/s;const g=Sr(e.max,h);return r.push({value:g,major:Ky(g),significand:d}),r}class Gy extends Ks{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=Ed.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return Nn(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Nn(t)?Math.max(0,t):null,this.max=Nn(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Nn(this._userMin)&&(this.min=t===us(this.min,0)?us(this.min,-1):us(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,i=this.max;const o=a=>r=t?r:a,s=a=>i=n?i:a;r===i&&(r<=0?(o(1),s(10)):(o(us(r,-1)),s(us(i,1)))),r<=0&&o(us(i,-1)),i<=0&&s(us(r,1)),this.min=r,this.max=i}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=tW(n,this);return t.bounds==="ticks"&&px(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":um(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Oo(t),this._valueRange=Oo(this.max)-Oo(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Oo(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}Je(Gy,"id","logarithmic"),Je(Gy,"defaults",{ticks:{callback:_h.formatters.logarithmic,major:{enabled:!0}}});function sp(e){const t=e.ticks;if(t.display&&e.display){const n=Li(t.backdropPadding);return Ut(t.font&&t.font.size,bn.font.size)+n.height}return 0}function nW(e,t,n){return n=xn(n)?n:[n],{w:wD(e,t.string,n),h:n.length*t.lineHeight}}function Zy(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:ei?{start:t-n,end:t}:{start:t,end:t+n}}function rW(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=[],i=[],o=e._pointLabels.length,s=e.options.pointLabels,a=s.centerPointLabels?Sn/o:0;for(let l=0;lt.r&&(a=(r.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),i.startt.b&&(l=(i.end-t.b)/s,e.b=Math.max(e.b,t.b+l))}function oW(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:o,padding:s,size:a}=n,l=e.getPointPosition(t,r+i+s,o),c=Math.round(am(ei(l.angle+Pr))),u=uW(l.y,a.h,c),d=lW(c),h=cW(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+a.w,bottom:u+a.h}}function sW(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:o}=e;return!(Zi({x:n,y:r},t)||Zi({x:n,y:o},t)||Zi({x:i,y:r},t)||Zi({x:i,y:o},t))}function aW(e,t,n){const r=[],i=e._pointLabels.length,o=e.options,{centerPointLabels:s,display:a}=o.pointLabels,l={extra:sp(o)/2,additionalAngle:s?Sn/i:0};let c;for(let u=0;u270||n<90)&&(e-=t),e}function fW(e,t,n){const{left:r,top:i,right:o,bottom:s}=n,{backdropColor:a}=t;if(!en(a)){const l=RD(t.borderRadius),c=Li(t.backdropPadding);e.fillStyle=a;const u=r-c.left,d=i-c.top,h=o-r+c.width,g=s-i+c.height;Object.values(l).some(m=>m!==0)?(e.beginPath(),MD(e,{x:u,y:d,w:h,h:g,radius:l}),e.fill()):e.fillRect(u,d,h,g)}}function dW(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const o=e._pointLabelItems[i];if(!o.visible)continue;const s=r.setContext(e.getPointLabelContext(i));fW(n,s,o);const a=Xo(s.font),{x:l,y:c,textAlign:u}=o;Ic(n,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:s.color,textAlign:u,textBaseline:"middle"})}}function Hx(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,ai);else{let o=e.getPointPosition(0,t);i.moveTo(o.x,o.y);for(let s=1;s{const i=dn(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?rW(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,i))}getIndexAngle(t){const n=ai/(this._pointLabels.length||1),r=this.options.startAngle||0;return ei(t*n+Ro(r))}getDistanceFromCenterForValue(t){if(en(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(en(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{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),g=i.setContext(h),m=o.setContext(h);hW(this,g,l,s,m)}}),r.display){for(t.save(),a=s-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{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(a,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 i=this.getIndexAngle(0);let o,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=Xo(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,s=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Li(c.backdropPadding);t.fillRect(-s/2-d.left,-o-u.size/2-d.top,s+d.width,u.size+d.height)}Ic(t,a.label,0,-o,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}Je(qu,"id","radialLinear"),Je(qu,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:_h.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Je(qu,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Je(qu,"descriptors",{angleLines:{_fallback:"grid"}});const kh={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}},vr=Object.keys(kh);function Qy(e,t){return e-t}function Jy(e,t){if(en(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:o}=e._parseOpts;let s=t;return typeof r=="function"&&(s=r(s)),Nn(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(i&&(s=i==="week"&&(Dc(o)||o===!0)?n.startOf(s,"isoWeek",o):n.startOf(s,i)),+s)}function Xy(e,t,n,r){const i=vr.length;for(let o=vr.indexOf(e);o=vr.indexOf(n);o--){const s=vr[o];if(kh[s].common&&e._adapter.diff(i,r,s)>=t-1)return s}return vr[n?vr.indexOf(n):0]}function mW(e){for(let t=vr.indexOf(e)+1,n=vr.length;t=t?n[r]:n[i];e[o]=!0}}function vW(e,t,n,r){const i=e._adapter,o=+i.startOf(t[0].value,r),s=t[t.length-1].value;let a,l;for(a=o;a<=s;a=+i.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function tw(e,t,n){const r=[],i={},o=t.length;let s,a;for(s=0;s+t.value))}initOffsets(t=[]){let n=0,r=0,i,o;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=_i(n,0,s),r=_i(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,o=i.time,s=o.unit||Xy(o.minUnit,n,r,this._getLabelCapacity(n)),a=Ut(i.ticks.stepSize,1),l=s==="week"?o.isoWeekday:!1,c=Dc(l)||l===!0,u={};let d=n,h,g;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":s),t.diff(r,n,s)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+s);const m=i.ticks.source==="data"&&this.getDataTimestamps();for(h=d,g=0;h+y)}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 i=this.options.time.displayFormats,o=this._unit,s=n||i[o];return this._adapter.format(t,s)}_tickFormatFunction(t,n,r,i){const o=this.options,s=o.ticks.callback;if(s)return dn(s,[t,n,r],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],h=r[n],g=c&&d&&h&&h.major;return this._adapter.format(t,i||(g?d:u))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=bs(e,"pos",t)),{pos:o,time:a}=e[r],{pos:s,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=bs(e,"time",t)),{time:o,pos:a}=e[r],{time:s,pos:l}=e[i]);const c=s-o;return c?a+(l-a)*(t-o)/c:a}class nw extends Md{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=Gu(n,this.min),this._tableRange=Gu(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],o=[];let s,a,l,c,u;for(s=0,a=t.length;s=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,a=i.length;si-o)}_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(Gu(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Gu(this._table,r*this._tableRange+this._minPos,!0)}}Je(nw,"id","timeseries"),Je(nw,"defaults",Md.defaults);const zx="label";function rw(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function yW(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function Vx(e,t){e.labels=t}function Yx(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:zx;const r=[];e.datasets=t.map(i=>{const o=e.datasets.find(s=>s[n]===i[n]);return!o||!i.data||r.includes(o)?{...i}:(r.push(o),Object.assign(o,i),o)})}function wW(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:zx;const n={labels:[],datasets:[]};return Vx(n,e.labels),Yx(n,e.datasets,t),n}function xW(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:o,type:s,data:a,options:l,plugins:c=[],fallbackContent:u,updateMode:d,...h}=e,g=nn.useRef(null),m=nn.useRef(),y=()=>{g.current&&(m.current=new Sh(g.current,{type:s,data:wW(a,o),options:l&&{...l},plugins:c}),rw(t,m.current))},k=()=>{rw(t,null),m.current&&(m.current.destroy(),m.current=null)};return nn.useEffect(()=>{!i&&m.current&&l&&yW(m.current,l)},[i,l]),nn.useEffect(()=>{!i&&m.current&&Vx(m.current.config.data,a.labels)},[i,a.labels]),nn.useEffect(()=>{!i&&m.current&&a.datasets&&Yx(m.current.config.data,a.datasets,o)},[i,a.datasets]),nn.useEffect(()=>{m.current&&(i?(k(),setTimeout(y)):m.current.update(d))},[i,l,a.labels,a.datasets,d]),nn.useEffect(()=>{m.current&&(k(),setTimeout(y))},[s]),nn.useEffect(()=>(y(),()=>k()),[]),Pd.createElement("canvas",Object.assign({ref:g,role:"img",height:n,width:r},h),u)}const bW=nn.forwardRef(xW);function _W(e,t){return Sh.register(t),nn.forwardRef((n,r)=>Pd.createElement(bW,Object.assign({},n,{ref:r,type:e})))}const CW=_W("line",vf);Sh.register(ip,op,xf,Al,GN);const SW=()=>{const[e,t]=nn.useState({labels:[],datasets:[{label:"TON/USD",data:[],borderColor:"rgb(102,170,238)",tension:.1}]});nn.useEffect(()=>{(async()=>{const o=(await kn("https://api.coingecko.com/api/v3/coins/the-open-network/market_chart?vs_currency=usd&days=120")).data.prices,s=o.map(l=>pe(l[0]).format("DD/MM/YYYY")),a=o.map(l=>l[1]);t({labels:s,datasets:[{...e.datasets[0],data:a}]})})()},[e.datasets]);const n={responsive:!0,plugins:{legend:{},title:{display:!0,text:"TON/USD Exchange Rate (Last 120 Days)"}}};return hn.jsx(CW,{options:n,data:e})};function kW(){return hn.jsx(BM,{manifestUrl:"https://rosticom.github.io/coobot-merkaba-tma/tonconnect-manifest.json",uiPreferences:{theme:Jt.DARK},walletsListConfiguration:{includeWallets:[{appName:"safepalwallet",name:"SafePal",imageUrl:"https://s.pvcliping.com/web/public_image/SafePal_x288.png",tondns:"",aboutUrl:"https://www.safepal.com",universalLink:"https://link.safepal.io/ton-connect",deepLink:"safepal-tc://",jsBridgeKey:"safepalwallet",bridgeUrl:"https://ton-bridge.safepal.com/tonbridge/v1/bridge",platforms:["ios","android","chrome","firefox"]},{appName:"bitgetTonWallet",name:"Bitget Wallet",imageUrl:"https://raw.githubusercontent.com/bitkeepwallet/download/main/logo/png/bitget%20wallet_logo_iOS.png",aboutUrl:"https://web3.bitget.com",deepLink:"bitkeep://",jsBridgeKey:"bitgetTonWallet",bridgeUrl:"https://bridge.tonapi.io/bridge",platforms:["ios","android","chrome"],universalLink:"https://bkcode.vip/ton-connect"},{appName:"tonwallet",name:"TON Wallet",imageUrl:"https://wallet.ton.org/assets/ui/qr-logo.png",aboutUrl:"https://chrome.google.com/webstore/detail/ton-wallet/nphplpgoakhhjchkkhmiggakijnkhfnd",universalLink:"https://wallet.ton.org/ton-connect",jsBridgeKey:"tonwallet",bridgeUrl:"https://bridge.tonapi.io/bridge",platforms:["chrome","android"]}]},actionsConfiguration:{twaReturnUrl:"https://rosticom.github.io/coobot-merkaba-tma/"},children:hn.jsxs("div",{className:"app",children:[hn.jsx(YM,{}),hn.jsx("div",{children:hn.jsx("a",{href:"https://t.me/+JuO8mZMYOnRmN2Ux",children:hn.jsx("img",{src:KM,className:"logo",alt:"Coobot chat"})})}),hn.jsx("div",{className:"card",children:hn.jsx("p",{children:hn.jsx("a",{href:"https://t.me/gasPump_bot/app?startapp=eyJyZWZfdXNlcl9pZCI6NTY1ODY0MzE4LCJ0b2tlbl9hZGRyZXNzIjoiRVFEZGlyd3l5YXNST2tvUnc5bUJCekJkUUhjYUFjOUV5OFpoak1TdXRkdHJmU2M1In0",children:"Please, buy some $COO to be rich"})})}),hn.jsx(SW,{}),hn.jsx(VM,{})]})})}var Kx={},Eh={};(function(){var e={},t="";try{t=location.hash.toString()}catch{}var n=l(t),r=C("initParams");if(r)for(var i in r)typeof n[i]>"u"&&(n[i]=r[i]);k("initParams",n);var o=!1,s;try{if(o=window.parent!=null&&window!=window.parent,o){window.addEventListener("message",function(v){if(v.source===window.parent){try{var w=JSON.parse(v.data)}catch{return}if(!(!w||!w.eventType))if(w.eventType=="set_custom_style")v.origin==="https://web.telegram.org"&&(s.innerHTML=w.eventData);else if(w.eventType=="reload_iframe"){try{window.parent.postMessage(JSON.stringify({eventType:"iframe_will_reload"}),"*")}catch{}location.reload()}else h(w.eventType,w.eventData)}}),s=document.createElement("style"),document.head.appendChild(s);try{window.parent.postMessage(JSON.stringify({eventType:"iframe_ready",eventData:{reload_supported:!0}}),"*")}catch{}}}catch{}function a(v){try{return v=v.replace(/\+/g,"%20"),decodeURIComponent(v)}catch{return v}}function l(v){v=v.replace(/^#/,"");var w={};if(!v.length)return w;if(v.indexOf("=")<0&&v.indexOf("?")<0)return w._path=a(v),w;var M=v.indexOf("?");if(M>=0){var E=v.substr(0,M);w._path=a(E),v=v.substr(M+1)}var O=c(v);for(var T in O)w[T]=O[T];return w}function c(v){var w={};if(!v.length)return w;var M=v.split("&"),E,O,T,P;for(E=0;E=0?v+"&"+w:E.length>0?v+"?"+w:v+w}function d(v,w,M){if(w||(w=function(){}),M===void 0&&(M=""),console.log("[Telegram.WebView] > postEvent",v,M),window.TelegramWebviewProxy!==void 0)TelegramWebviewProxy.postEvent(v,JSON.stringify(M)),w();else if(window.external&&"notify"in window.external)window.external.notify(JSON.stringify({eventType:v,eventData:M})),w();else if(o)try{var E="https://web.telegram.org";E="*",window.parent.postMessage(JSON.stringify({eventType:v,eventData:M}),E),w()}catch(O){w(O)}else w({notAvailable:!0})}function h(v,w){console.log("[Telegram.WebView] < receiveEvent",v,w),g(v,function(M){M(v,w)})}function g(v,w){var M=e[v];if(!(M===void 0||!M.length))for(var E=0;Emt?1:-1;return 0}function ie(D){return ne(c,D)>=0}function Te(D){if(window.Blob)try{return new Blob([D]).size}catch{}for(var N=D.length,F=D.length-1;F>=0;F--){var oe=D.charCodeAt(F);oe>127&&oe<=2047?N++:oe>2047&&oe<=65535&&(N+=2),oe>=56320&&oe<=57343&&F--}return N}var Ae=function(){var D=!1,N={};Object.defineProperty(N,"isVisible",{set:function(ze){at({is_visible:ze})},get:function(){return D},enumerable:!0});var F=null;t.onEvent("back_button_pressed",oe);function oe(){E("backButtonClicked")}function ye(){return{is_visible:D}}function mt(ze){return typeof ze>"u"&&(ze=ye()),JSON.stringify(ze)}function De(){return ie("6.1")?!0:(console.warn("[Telegram.WebApp] BackButton is not supported in version "+c),!1)}function ln(){var ze=ye(),jt=mt(ze);F!==jt&&(F=jt,t.postEvent("web_app_setup_back_button",!1,ze))}function at(ze){return De()&&(typeof ze.is_visible<"u"&&(D=!!ze.is_visible),ln()),N}return N.onClick=function(ze){return De()&&O("backButtonClicked",ze),N},N.offClick=function(ze){return De()&&T("backButtonClicked",ze),N},N.show=function(){return at({is_visible:!0})},N.hide=function(){return at({is_visible:!1})},N}(),Xe=0,Dt=function(){var D=!1,N=!0,F=!1,oe="CONTINUE",ye=!1,mt=!1,De={};Object.defineProperty(De,"text",{set:function(p){De.setParams({text:p})},get:function(){return oe},enumerable:!0}),Object.defineProperty(De,"color",{set:function(p){De.setParams({color:p})},get:function(){return ye||a.button_color||"#2481cc"},enumerable:!0}),Object.defineProperty(De,"textColor",{set:function(p){De.setParams({text_color:p})},get:function(){return mt||a.button_text_color||"#ffffff"},enumerable:!0}),Object.defineProperty(De,"isVisible",{set:function(p){De.setParams({is_visible:p})},get:function(){return D},enumerable:!0}),Object.defineProperty(De,"isProgressVisible",{get:function(){return F},enumerable:!0}),Object.defineProperty(De,"isActive",{set:function(p){De.setParams({is_active:p})},get:function(){return N},enumerable:!0});var ln=null;t.onEvent("main_button_pressed",Wr);var at=null,ze={};if(n.tgWebAppDebug){at=document.createElement("tg-main-button"),ze={font:"600 14px/18px sans-serif",display:"none",width:"100%",height:"48px",borderRadius:"0",background:"no-repeat right center",position:"fixed",left:"0",right:"0",bottom:"0",margin:"0",padding:"15px 20px",textAlign:"center",boxSizing:"border-box",zIndex:"10000"};for(var jt in ze)at.style[jt]=ze[jt];document.addEventListener("DOMContentLoaded",function p(x){document.removeEventListener("DOMContentLoaded",p),document.body.appendChild(at),at.addEventListener("click",Wr,!1)})}function Wr(){N&&E("mainButtonClicked")}function qs(){var p=De.color,x=De.textColor;return D?{is_visible:!0,is_active:N,is_progress_visible:F,text:oe,color:p,text_color:x}:{is_visible:!1}}function su(p){return typeof p>"u"&&(p=qs()),JSON.stringify(p)}function el(){var p=qs(),x=su(p);ln!==x&&(ln=x,t.postEvent("web_app_setup_main_button",!1,p),n.tgWebAppDebug&&or(p))}function or(p){p.is_visible?(at.style.display="block",Xe=48,at.style.opacity=p.is_active?"1":"0.8",at.style.cursor=p.is_active?"pointer":"auto",at.disabled=!p.is_active,at.innerText=p.text,at.style.backgroundImage=p.is_progress_visible?"url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20viewport%3D%220%200%2048%2048%22%20width%3D%2248px%22%20height%3D%2248px%22%3E%3Ccircle%20cx%3D%2250%25%22%20cy%3D%2250%25%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222.25%22%20stroke-linecap%3D%22round%22%20fill%3D%22none%22%20stroke-dashoffset%3D%22106%22%20r%3D%229%22%20stroke-dasharray%3D%2256.52%22%20rotate%3D%22-90%22%3E%3Canimate%20attributeName%3D%22stroke-dashoffset%22%20attributeType%3D%22XML%22%20dur%3D%22360s%22%20from%3D%220%22%20to%3D%2212500%22%20repeatCount%3D%22indefinite%22%3E%3C%2Fanimate%3E%3CanimateTransform%20attributeName%3D%22transform%22%20attributeType%3D%22XML%22%20type%3D%22rotate%22%20dur%3D%221s%22%20from%3D%22-90%2024%2024%22%20to%3D%22630%2024%2024%22%20repeatCount%3D%22indefinite%22%3E%3C%2FanimateTransform%3E%3C%2Fcircle%3E%3C%2Fsvg%3E')":"none",at.style.backgroundColor=p.color,at.style.color=p.text_color):(at.style.display="none",Xe=0),document.documentElement&&(document.documentElement.style.boxSizing="border-box",document.documentElement.style.paddingBottom=Xe+"px"),Y()}function au(p){if(typeof p.text<"u"){var x=M(p.text);if(!x.length)throw console.error("[Telegram.WebApp] Main button text is required",p.text),Error("WebAppMainButtonParamInvalid");if(x.length>64)throw console.error("[Telegram.WebApp] Main button text is too long",x),Error("WebAppMainButtonParamInvalid");oe=x}if(typeof p.color<"u")if(p.color===!1||p.color===null)ye=!1;else{var b=B(p.color);if(!b)throw console.error("[Telegram.WebApp] Main button color format is invalid",p.color),Error("WebAppMainButtonParamInvalid");ye=b}if(typeof p.text_color<"u")if(p.text_color===!1||p.text_color===null)mt=!1;else{var f=B(p.text_color);if(!f)throw console.error("[Telegram.WebApp] Main button text color format is invalid",p.text_color),Error("WebAppMainButtonParamInvalid");mt=f}if(typeof p.is_visible<"u"){if(p.is_visible&&!De.text.length)throw console.error("[Telegram.WebApp] Main button text is required"),Error("WebAppMainButtonParamInvalid");D=!!p.is_visible}return typeof p.is_active<"u"&&(N=!!p.is_active),el(),De}return De.setText=function(p){return De.setParams({text:p})},De.onClick=function(p){return O("mainButtonClicked",p),De},De.offClick=function(p){return T("mainButtonClicked",p),De},De.show=function(){return De.setParams({is_visible:!0})},De.hide=function(){return De.setParams({is_visible:!1})},De.enable=function(){return De.setParams({is_active:!0})},De.disable=function(){return De.setParams({is_active:!1})},De.showProgress=function(p){return N=!!p,F=!0,el(),De},De.hideProgress=function(){return De.isActive||(N=!0),F=!1,el(),De},De.setParams=au,De}(),We=function(){var D=!1,N={};Object.defineProperty(N,"isVisible",{set:function(ze){at({is_visible:ze})},get:function(){return D},enumerable:!0});var F=null;t.onEvent("settings_button_pressed",oe);function oe(){E("settingsButtonClicked")}function ye(){return{is_visible:D}}function mt(ze){return typeof ze>"u"&&(ze=ye()),JSON.stringify(ze)}function De(){return ie("6.10")?!0:(console.warn("[Telegram.WebApp] SettingsButton is not supported in version "+c),!1)}function ln(){var ze=ye(),jt=mt(ze);F!==jt&&(F=jt,t.postEvent("web_app_setup_settings_button",!1,ze))}function at(ze){return De()&&(typeof ze.is_visible<"u"&&(D=!!ze.is_visible),ln()),N}return N.onClick=function(ze){return De()&&O("settingsButtonClicked",ze),N},N.offClick=function(ze){return De()&&T("settingsButtonClicked",ze),N},N.show=function(){return at({is_visible:!0})},N.hide=function(){return at({is_visible:!1})},N}(),Gt=function(){var D={};function N(F){if(!ie("6.1"))return console.warn("[Telegram.WebApp] HapticFeedback is not supported in version "+c),D;if(F.type=="impact"){if(F.impact_style!="light"&&F.impact_style!="medium"&&F.impact_style!="heavy"&&F.impact_style!="rigid"&&F.impact_style!="soft")throw console.error("[Telegram.WebApp] Haptic impact style is invalid",F.impact_style),Error("WebAppHapticImpactStyleInvalid")}else if(F.type=="notification"){if(F.notification_type!="error"&&F.notification_type!="success"&&F.notification_type!="warning")throw console.error("[Telegram.WebApp] Haptic notification type is invalid",F.notification_type),Error("WebAppHapticNotificationTypeInvalid")}else if(F.type!="selection_change")throw console.error("[Telegram.WebApp] Haptic feedback type is invalid",F.type),Error("WebAppHapticFeedbackTypeInvalid");return t.postEvent("web_app_trigger_haptic_feedback",!1,F),D}return D.impactOccurred=function(F){return N({type:"impact",impact_style:F})},D.notificationOccurred=function(F){return N({type:"notification",notification_type:F})},D.selectionChanged=function(){return N({type:"selection_change"})},D}(),an=function(){var D={};function N(F,oe,ye){if(!ie("6.9"))throw console.error("[Telegram.WebApp] CloudStorage is not supported in version "+c),Error("WebAppMethodUnsupported");return Cr(F,oe,ye),D}return D.setItem=function(F,oe,ye){return N("saveStorageValue",{key:F,value:oe},ye)},D.getItem=function(F,oe){return D.getItems([F],oe?function(ye,mt){ye?oe(ye):oe(null,mt[F])}:null)},D.getItems=function(F,oe){return N("getStorageValues",{keys:F},oe)},D.removeItem=function(F,oe){return D.removeItems([F],oe)},D.removeItems=function(F,oe){return N("deleteStorageValues",{keys:F},oe)},D.getKeys=function(F){return N("getStorageKeys",{},F)},D}(),dr={};function _n(D,N){if(N.slug&&dr[N.slug]){var F=dr[N.slug];delete dr[N.slug],F.callback&&F.callback(N.status),E("invoiceClosed",{url:F.url,status:N.status})}}var En=!1;function ir(D,N){if(En){var F=En;En=!1;var oe=null;typeof N.button_id<"u"&&(oe=N.button_id),F.callback&&F.callback(oe),E("popupClosed",{button_id:oe})}}var Ue=!1;function yt(D,N){if(Ue){var F=Ue,oe=null;typeof N.data<"u"&&(oe=N.data),F.callback&&F.callback(oe)&&(Ue=!1,t.postEvent("web_app_close_scan_qr_popup",!1)),E("qrTextReceived",{data:oe})}}function He(D,N){Ue=!1}function Pt(D,N){if(N.req_id&&W[N.req_id]){var F=W[N.req_id];delete W[N.req_id];var oe=null;typeof N.data<"u"&&(oe=N.data),F.callback&&F.callback(oe),E("clipboardTextReceived",{data:oe})}}var Rn=!1;function hr(D,N){if(Rn){var F=Rn;Rn=!1,F.callback&&F.callback(N.status=="allowed"),E("writeAccessRequested",{status:N.status})}}function wt(D,N){var F,oe,ye=0,mt=function(){Cr("getRequestedContact",{},function(ln,at){at&&at.length?(clearTimeout(oe),D(at)):(ye+=50,F=setTimeout(mt,ye))})},De=function(){clearTimeout(F),D("")};oe=setTimeout(De,N),mt()}var Re=!1;function Fn(D,N){if(Re){var F=Re;Re=!1;var oe=N.status=="sent",ye={status:N.status};oe?wt(function(mt){if(mt&&mt.length){ye.response=mt,ye.responseUnsafe=e.urlParseQueryString(mt);for(var De in ye.responseUnsafe){var ln=ye.responseUnsafe[De];try{(ln.substr(0,1)=="{"&&ln.substr(-1)=="}"||ln.substr(0,1)=="["&&ln.substr(-1)=="]")&&(ye.responseUnsafe[De]=JSON.parse(ln))}catch{}}}F.callback&&F.callback(oe,ye),E("contactRequested",ye)},3e3):(F.callback&&F.callback(oe,ye),E("contactRequested",ye))}}function Zr(D,N){if(N.req_id&&W[N.req_id]){var F=W[N.req_id];delete W[N.req_id];var oe=null,ye=null;typeof N.result<"u"&&(oe=N.result),typeof N.error<"u"&&(ye=N.error),F.callback&&F.callback(ye,oe)}}function Cr(D,N,F){if(!ie("6.9"))throw console.error("[Telegram.WebApp] Method invokeCustomMethod is not supported in version "+c),Error("WebAppMethodUnsupported");var oe=I(16),ye={req_id:oe,method:D,params:N||{}};W[oe]={callback:F},t.postEvent("web_app_invoke_custom_method",!1,ye)}window.Telegram||(window.Telegram={}),Object.defineProperty(i,"initData",{get:function(){return o},enumerable:!0}),Object.defineProperty(i,"initDataUnsafe",{get:function(){return s},enumerable:!0}),Object.defineProperty(i,"version",{get:function(){return c},enumerable:!0}),Object.defineProperty(i,"platform",{get:function(){return u},enumerable:!0}),Object.defineProperty(i,"colorScheme",{get:function(){return l},enumerable:!0}),Object.defineProperty(i,"themeParams",{get:function(){return a},enumerable:!0}),Object.defineProperty(i,"isExpanded",{get:function(){return Z},enumerable:!0}),Object.defineProperty(i,"viewportHeight",{get:function(){return(R===!1?window.innerHeight:R)-Xe},enumerable:!0}),Object.defineProperty(i,"viewportStableHeight",{get:function(){return(G===!1?window.innerHeight:G)-Xe},enumerable:!0}),Object.defineProperty(i,"isClosingConfirmationEnabled",{set:function(D){Ce(D)},get:function(){return fe},enumerable:!0}),Object.defineProperty(i,"headerColor",{set:function(D){Ze(D)},get:function(){return ge()},enumerable:!0}),Object.defineProperty(i,"backgroundColor",{set:function(D){rr(D)},get:function(){return tt()},enumerable:!0}),Object.defineProperty(i,"BackButton",{value:Ae,enumerable:!0}),Object.defineProperty(i,"MainButton",{value:Dt,enumerable:!0}),Object.defineProperty(i,"SettingsButton",{value:We,enumerable:!0}),Object.defineProperty(i,"HapticFeedback",{value:Gt,enumerable:!0}),Object.defineProperty(i,"CloudStorage",{value:an,enumerable:!0}),i.setHeaderColor=function(D){i.headerColor=D},i.setBackgroundColor=function(D){i.backgroundColor=D},i.enableClosingConfirmation=function(){i.isClosingConfirmationEnabled=!0},i.disableClosingConfirmation=function(){i.isClosingConfirmationEnabled=!1},i.isVersionAtLeast=function(D){return ie(D)},i.onEvent=function(D,N){O(D,N)},i.offEvent=function(D,N){T(D,N)},i.sendData=function(D){if(!D||!D.length)throw console.error("[Telegram.WebApp] Data is required",D),Error("WebAppDataInvalid");if(Te(D)>4096)throw console.error("[Telegram.WebApp] Data is too long",D),Error("WebAppDataInvalid");t.postEvent("web_app_data_send",!1,{data:D})},i.switchInlineQuery=function(D,N){if(!ie("6.6"))throw console.error("[Telegram.WebApp] Method switchInlineQuery is not supported in version "+c),Error("WebAppMethodUnsupported");if(!n.tgWebAppBotInline)throw console.error("[Telegram.WebApp] Inline mode is disabled for this bot. Read more about inline mode: https://core.telegram.org/bots/inline"),Error("WebAppInlineModeDisabled");if(D=D||"",D.length>256)throw console.error("[Telegram.WebApp] Inline query is too long",D),Error("WebAppInlineQueryInvalid");var F=[];if(N){if(!Array.isArray(N))throw console.error("[Telegram.WebApp] Choose chat types should be an array",N),Error("WebAppInlineChooseChatTypesInvalid");for(var oe={users:1,bots:1,groups:1,channels:1},ye=0;ye64)throw console.error("[Telegram.WebApp] Popup title is too long",F),Error("WebAppPopupParamInvalid");F.length>0&&(mt.title=F)}if(typeof D.message<"u"&&(oe=M(D.message)),!oe.length)throw console.error("[Telegram.WebApp] Popup message is required",D.message),Error("WebAppPopupParamInvalid");if(oe.length>256)throw console.error("[Telegram.WebApp] Popup message is too long",oe),Error("WebAppPopupParamInvalid");if(mt.message=oe,typeof D.buttons<"u"){if(!Array.isArray(D.buttons))throw console.error("[Telegram.WebApp] Popup buttons should be an array",D.buttons),Error("WebAppPopupParamInvalid");for(var De=0;De64))throw console.error("[Telegram.WebApp] Popup button id is too long",ze),Error("WebAppPopupParamInvalid");at.id=ze;var jt=ln.type;if(typeof jt>"u"&&(jt="default"),at.type=jt,!(jt=="ok"||jt=="close"||jt=="cancel"))if(jt=="default"||jt=="destructive"){var Wr="";if(typeof ln.text<"u"&&(Wr=M(ln.text)),!Wr.length)throw console.error("[Telegram.WebApp] Popup button text is required for type "+jt,ln.text),Error("WebAppPopupParamInvalid");if(Wr.length>64)throw console.error("[Telegram.WebApp] Popup button text is too long",Wr),Error("WebAppPopupParamInvalid");at.text=Wr}else throw console.error("[Telegram.WebApp] Popup button type is invalid",jt),Error("WebAppPopupParamInvalid");ye.push(at)}}else ye.push({id:"",type:"close"});if(ye.length<1)throw console.error("[Telegram.WebApp] Popup should have at least one button"),Error("WebAppPopupParamInvalid");if(ye.length>3)throw console.error("[Telegram.WebApp] Popup should not have more than 3 buttons"),Error("WebAppPopupParamInvalid");mt.buttons=ye,En={callback:N},t.postEvent("web_app_open_popup",!1,mt)},i.showAlert=function(D,N){i.showPopup({message:D},N?function(){N()}:null)},i.showConfirm=function(D,N){i.showPopup({message:D,buttons:[{type:"ok",id:"ok"},{type:"cancel"}]},N?function(F){N(F=="ok")}:null)},i.showScanQrPopup=function(D,N){if(!ie("6.4"))throw console.error("[Telegram.WebApp] Method showScanQrPopup is not supported in version "+c),Error("WebAppMethodUnsupported");if(Ue)throw console.error("[Telegram.WebApp] Popup is already opened"),Error("WebAppScanQrPopupOpened");var F="",oe={};if(typeof D.text<"u"){if(F=M(D.text),F.length>64)throw console.error("[Telegram.WebApp] Scan QR popup text is too long",F),Error("WebAppScanQrPopupParamInvalid");F.length>0&&(oe.text=F)}Ue={callback:N},t.postEvent("web_app_open_scan_qr_popup",!1,oe)},i.closeScanQrPopup=function(){if(!ie("6.4"))throw console.error("[Telegram.WebApp] Method closeScanQrPopup is not supported in version "+c),Error("WebAppMethodUnsupported");Ue=!1,t.postEvent("web_app_close_scan_qr_popup",!1)},i.readTextFromClipboard=function(D){if(!ie("6.4"))throw console.error("[Telegram.WebApp] Method readTextFromClipboard is not supported in version "+c),Error("WebAppMethodUnsupported");var N=I(16),F={req_id:N};W[N]={callback:D},t.postEvent("web_app_read_text_from_clipboard",!1,F)},i.requestWriteAccess=function(D){if(!ie("6.9"))throw console.error("[Telegram.WebApp] Method requestWriteAccess is not supported in version "+c),Error("WebAppMethodUnsupported");if(Rn)throw console.error("[Telegram.WebApp] Write access is already requested"),Error("WebAppWriteAccessRequested");Rn={callback:D},t.postEvent("web_app_request_write_access")},i.requestContact=function(D){if(!ie("6.9"))throw console.error("[Telegram.WebApp] Method requestContact is not supported in version "+c),Error("WebAppMethodUnsupported");if(Re)throw console.error("[Telegram.WebApp] Contact is already requested"),Error("WebAppContactRequested");Re={callback:D},t.postEvent("web_app_request_phone")},i.invokeCustomMethod=function(D,N,F){Cr(D,N,F)},i.ready=function(){t.postEvent("web_app_ready")},i.expand=function(){t.postEvent("web_app_expand")},i.close=function(){t.postEvent("web_app_close")},window.Telegram.WebApp=i,ft(),q(),Y(),n.tgWebAppShowSettings&&We.show(),window.addEventListener("resize",v),r&&document.addEventListener("click",w),t.onEvent("theme_changed",y),t.onEvent("viewport_changed",C),t.onEvent("invoice_closed",_n),t.onEvent("popup_closed",ir),t.onEvent("qr_text_received",yt),t.onEvent("scan_qr_popup_closed",He),t.onEvent("clipboard_text_received",Pt),t.onEvent("write_access_requested",hr),t.onEvent("phone_requested",Fn),t.onEvent("custom_method_invoked",Zr),t.postEvent("web_app_request_theme"),t.postEvent("web_app_request_viewport")})();Object.defineProperty(Eh,"__esModule",{value:!0});Eh.WebApp=void 0;var EW=window;Eh.WebApp=EW.Telegram.WebApp;Object.defineProperty(Kx,"__esModule",{value:!0});var MW=Eh,TW=Kx.default=MW.WebApp;TW.ready();A1.createRoot(document.getElementById("root")).render(hn.jsx(Pd.StrictMode,{children:hn.jsx(kW,{})})); + */class pI{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const o=n.listeners[i],s=n.duration;o.forEach(a=>a({chart:t,initial:n.initial,numSteps:s,currentStep:Math.min(r-n.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=vx.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const o=r.items;let s=o.length-1,a=!1,l;for(;s>=0;--s)l=o[s],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(o[s]=o[o.length-1],o.pop());a&&(i.draw(),this._notify(i,r,t,"progress")),o.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=o.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,i)=>Math.max(r,i._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 i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var $i=new pI;const yy="transparent",gI={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=ly(e||yy),i=r.valid&&ly(t||yy);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class mI{constructor(t,n,r,i){const o=n[r];i=Fu([t.to,i,o,t.from]);const s=Fu([t.from,o,i]);this._active=!0,this._fn=t.fn||gI[t.type||typeof s],this._easing=Jl[t.easing]||Jl.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=s,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],o=r-this._start,s=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Fu([t.to,n,i,t.from]),this._from=Fu([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,o=this._from,s=this._loop,a=this._to;let l;if(this._active=o!==a&&(s||n1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(o,a,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 i=0;i{const o=t[i];if(!Nt(o))return;const s={};for(const a of n)s[a]=o[a];(xn(o.properties)&&o.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,s)})})}_animateOptions(t,n){const r=n.options,i=wI(t,r);if(!i)return[];const o=this._createAnimations(i,r);return r.$shared&&yI(t.options.$animations,r).then(()=>{t.options=r},()=>{}),o}_createAnimations(t,n){const r=this._properties,i=[],o=t.$animations||(t.$animations={}),s=Object.keys(n),a=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,n));continue}const u=n[c];let d=o[c];const h=r.get(c);if(d)if(h&&d.active()){d.update(h,u,a);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}o[c]=d=new mI(h,t,c,u),i.push(d)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return $i.add(this._chart,r),!0}}function yI(e,t){const n=[],r=Object.keys(t);for(let i=0;i0||!n&&o<0)return i.index}return null}function Cy(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:o,vScale:s,index:a}=r,l=o.axis,c=s.axis,u=CI(o,s,r),d=t.length;let h;for(let g=0;gn[r].axis===t).shift()}function EI(e,t){return Ys(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function MI(e,t,n){return Ys(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function hl(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const o=i._stacks;if(!o||o[r]===void 0||o[r][n]===void 0)return;delete o[r][n],o[r]._visualValues!==void 0&&o[r]._visualValues[n]!==void 0&&delete o[r]._visualValues[n]}}}const E1=e=>e==="reset"||e==="none",Sy=(e,t)=>t?e:Object.assign({},e),TI=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Ax(n,!0),values:null};class ec{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=by(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&&hl(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(d,h,g,m)=>d==="x"?h:d==="r"?m:g,o=n.xAxisID=Ut(r.xAxisID,k1(t,"x")),s=n.yAxisID=Ut(r.yAxisID,k1(t,"y")),a=n.rAxisID=Ut(r.rAxisID,k1(t,"r")),l=n.indexAxis,c=n.iAxisID=i(l,o,s,a),u=n.vAxisID=i(l,s,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(s),n.rScale=this.getScaleForId(a),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&&oy(this._data,this),t._stacked&&hl(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Nt(n)){const i=this._cachedMeta;this._data=_I(n,i)}else if(r!==n){if(r){oy(r,this);const i=this._cachedMeta;hl(i),i._parsed=[]}n&&Object.isExtensible(n)&&oD(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 i=!1;this._dataCheck();const o=n._stacked;n._stacked=by(n.vScale,n),n.stack!==r.stack&&(i=!0,hl(n),n.stack=r.stack),this._resyncElements(t),(i||o!==n._stacked)&&Cy(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:i}=this,{iScale:o,_stacked:s}=r,a=o.axis;let l=t===0&&n===i.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,h;if(this._parsing===!1)r._parsed=i,r._sorted=!0,h=i;else{xn(i[t])?h=this.parseArrayData(r,i,t,n):Nt(i[t])?h=this.parseObjectData(r,i,t,n):h=this.parsePrimitiveData(r,i,t,n);const g=()=>d[a]===null||c&&d[a]y||d=0;--h)if(!m()){this.updateRangeFromParsed(c,t,g,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,o,s;for(i=0,o=n.length;i=0&&tthis.getContext(r,i,n),y=c.resolveNamedOptions(h,g,m,d);return y.$shared&&(y.$shared=l,o[s]=Object.freeze(Sy(y,l))),y}_resolveAnimations(t,n,r){const i=this.chart,o=this._cachedDataOpts,s=`animation-${n}`,a=o[s];if(a)return a;let l;if(i.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 vI(i,l&&l.animations);return l&&l._cacheable&&(o[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||E1(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,o=this.getSharedOptions(r),s=this.includeOptions(n,o)||o!==i;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:s}}updateElement(t,n,r,i){E1(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!E1(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const o=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(o)||o})}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[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const i=r.length,o=n.length,s=Math.min(o,i);s&&this.parse(0,s),o>i?this._insertElements(i,o-i,t):o{for(c.length+=n,a=c.length-1;a>=s;a--)c[a]=c[a-n]};for(l(o),a=t;a0&&this.getParsed(n-1);for(let E=0;E=v){T.skip=!0;continue}const P=this.getParsed(E),L=en(P[g]),W=T[h]=s.getPixelForValue(P[h],E),I=T[g]=o||L?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,P,l):P[g],E);T.skip=isNaN(W)||isNaN(I)||L,T.stop=E>0&&Math.abs(P[h]-M[h])>k,y&&(T.parsed=P,T.raw=c.data[E]),d&&(T.options=u||this.resolveDataElementOptions(E,O.active?"active":i)),C||this.updateElement(O,E,T,i),M=P}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const o=i[0].size(this.resolveDataElementOptions(0)),s=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,o,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Je(vf,"id","line"),Je(vf,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Je(vf,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function cs(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class mm{constructor(t){Je(this,"options");this.options=t||{}}static override(t){Object.assign(mm.prototype,t)}init(){}formats(){return cs()}parse(){return cs()}format(){return cs()}add(){return cs()}diff(){return cs()}startOf(){return cs()}endOf(){return cs()}}var PI={_date:mm};function AI(e,t,n,r){const{controller:i,data:o,_sorted:s}=e,a=i._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&s&&o.length){const l=a._reversePixels?rD:bs;if(r){if(i._sharedOptions){const c=o[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(o,t,n-u),h=l(o,t,n+u);return{lo:d.lo,hi:h.hi}}}}else return l(o,t,n)}return{lo:0,hi:o.length-1}}function ou(e,t,n,r,i){const o=e.getSortedVisibleDatasetMetas(),s=n[t];for(let a=0,l=o.length;a{l[s](t[n],i)&&(o.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,i))}),r&&!a?[]:o}var DI={evaluateInteractionItems:ou,modes:{index(e,t,n,r){const i=hs(t,e),o=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?M1(e,i,o,r,s):T1(e,i,o,!1,r,s),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[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 i=hs(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?M1(e,i,o,r,s):T1(e,i,o,!1,r,s);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;un.pos===t)}function Ey(e,t){return e.filter(n=>Lx.indexOf(n.pos)===-1&&n.box.axis===t)}function gl(e,t){return e.sort((n,r)=>{const i=t?r:n,o=t?n:r;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function II(e){const t=[];let n,r,i,o,s,a;for(n=0,r=(e||[]).length;nc.box.fullSize),!0),r=gl(pl(t,"left"),!0),i=gl(pl(t,"right")),o=gl(pl(t,"top"),!0),s=gl(pl(t,"bottom")),a=Ey(t,"x"),l=Ey(t,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:i.concat(l).concat(s).concat(a),chartArea:pl(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:o.concat(s).concat(a)}}function My(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Ox(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 UI(e,t,n,r){const{pos:i,box:o}=n,s=e.maxPadding;if(!Nt(i)){n.size&&(e[i]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?o.height:o.width),n.size=d.size/d.count,e[i]+=n.size}o.getPadding&&Ox(s,o.getPadding());const a=Math.max(0,t.outerWidth-My(s,e,"left","right")),l=Math.max(0,t.outerHeight-My(s,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function FI(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function BI(e,t){const n=t.maxPadding;function r(i){const o={left:0,top:0,right:0,bottom:0};return i.forEach(s=>{o[s]=Math.max(t[s],n[s])}),o}return r(e?["left","right"]:["top","bottom"])}function Pl(e,t,n,r){const i=[];let o,s,a,l,c,u;for(o=0,s=e.length,c=0;o{typeof y.beforeLayout=="function"&&y.beforeLayout()});const u=l.reduce((y,k)=>k.box.options&&k.box.options.display===!1?y:y+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:o,availableHeight:s,vBoxMaxWidth:o/2/u,hBoxMaxHeight:s/2}),h=Object.assign({},i);Ox(h,Li(r));const g=Object.assign({maxPadding:h,w:o,h:s,x:i.left,y:i.top},i),m=WI(l.concat(c),d);Pl(a.fullSize,g,d,m),Pl(l,g,d,m),Pl(c,g,d,m)&&Pl(l,g,d,m),FI(g),Ty(a.leftAndTop,g,d,m),g.x+=g.w,g.y+=g.h,Ty(a.rightAndBottom,g,d,m),e.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},Qn(a.chartArea,y=>{const k=y.box;Object.assign(k,e.chartArea),k.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class Rx{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class jI extends Rx{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const yf="$chartjs",HI={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Py=e=>e===null||e==="";function zI(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[yf]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Py(i)){const o=py(e,"width");o!==void 0&&(e.width=o)}if(Py(r))if(e.style.height==="")e.height=e.width/(t||2);else{const o=py(e,"height");o!==void 0&&(e.height=o)}return e}const Dx=rI?{passive:!0}:!1;function VI(e,t,n){e&&e.addEventListener(t,n,Dx)}function YI(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Dx)}function KI(e,t){const n=HI[e.type]||e.type,{x:r,y:i}=hs(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function kd(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function qI(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||kd(a.addedNodes,r),s=s&&!kd(a.removedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function GI(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||kd(a.removedNodes,r),s=s&&!kd(a.addedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const Nc=new Map;let Ay=0;function Ix(){const e=window.devicePixelRatio;e!==Ay&&(Ay=e,Nc.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function ZI(e,t){Nc.size||window.addEventListener("resize",Ix),Nc.set(e,t)}function QI(e){Nc.delete(e),Nc.size||window.removeEventListener("resize",Ix)}function JI(e,t,n){const r=e.canvas,i=r&&gm(r);if(!i)return;const o=yx((a,l)=>{const c=i.clientWidth;n(a,l),c{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return s.observe(i),ZI(e,o),s}function P1(e,t,n){n&&n.disconnect(),t==="resize"&&QI(e)}function XI(e,t,n){const r=e.canvas,i=yx(o=>{e.ctx!==null&&n(KI(o,e))},e);return VI(r,t,i),i}class eN extends Rx{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(zI(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[yf])return!1;const r=n[yf].initial;["height","width"].forEach(o=>{const s=r[o];en(s)?n.removeAttribute(o):n.setAttribute(o,s)});const i=r.style||{};return Object.keys(i).forEach(o=>{n.style[o]=i[o]}),n.width=n.width,delete n[yf],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),s={attach:qI,detach:GI,resize:JI}[n]||XI;i[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:P1,detach:P1,resize:P1}[n]||YI)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return nI(t,n,r,i)}isAttached(t){const n=t&&gm(t);return!!(n&&n.isConnected)}}function tN(e){return!pm()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?jI:eN}class Us{constructor(){Je(this,"x");Je(this,"y");Je(this,"active",!1);Je(this,"options");Je(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return Dc(this.x)&&Dc(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(o=>{i[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),i}}Je(Us,"defaults",{}),Je(Us,"defaultRoutes");function nN(e,t){const n=e.options.ticks,r=rN(e),i=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?oN(t):[],s=o.length,a=o[0],l=o[s-1],c=[];if(s>i)return sN(t,c,o,s/i),c;const u=iN(o,t,i);if(s>0){let d,h;const g=s>1?Math.round((l-a)/(s-1)):null;for(zu(t,c,u,en(g)?0:a-g,a),d=0,h=s-1;di)return l}return Math.max(i,1)}function oN(e){const t=[];let n,r;for(n=0,r=e.length;ne==="left"?"right":e==="right"?"left":e,Ly=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Oy=(e,t)=>Math.min(t||e,e);function Ry(e,t){const n=[],r=e.length/t,i=e.length;let o=0;for(;os+a)))return l}function uN(e,t){Qn(e,n=>{const r=n.gc,i=r.length/2;let o;if(i>t){for(o=0;or?r:n,r=i&&n>r?n:r,{min:Sr(n,Sr(r,n)),max:Sr(r,Sr(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(){hn(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:o,ticks:s}=this.options,a=s.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=DD(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=o||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,g=_i(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/r:g/(r-1),d+6>a&&(a=g/(r-(t.offset?.5:1)),l=this.maxHeight-ml(t.grid)-n.padding-Dy(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),s=am(Math.min(Math.asin(_i((u.highest.height+6)/a,-1,1)),Math.asin(_i(l/c,-1,1))-Math.asin(_i(h/c,-1,1)))),s=Math.max(i,Math.min(o,s))),this.labelRotation=s}afterCalculateLabelRotation(){hn(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){hn(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:o}}=this,s=this._isVisible(),a=this.isHorizontal();if(s){const l=Dy(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=ml(o)+l):(t.height=this.maxHeight,t.width=ml(o)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),g=r.padding*2,m=Ro(this.labelRotation),y=Math.cos(m),k=Math.sin(m);if(a){const C=r.mirror?0:k*d.width+y*h.height;t.height=Math.min(this.maxHeight,t.height+C+g)}else{const C=r.mirror?0:y*d.width+k*h.height;t.width=Math.min(this.maxWidth,t.width+C+g)}this._calculatePadding(c,u,k,y)}}this._handleMargins(),a?(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,i){const{ticks:{align:o,padding:s},position:a}=this.options,l=this.labelRotation!==0,c=a!=="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,g=0;l?c?(h=i*t.width,g=r*n.height):(h=r*t.height,g=i*n.width):o==="start"?g=n.width:o==="end"?h=t.width:o!=="inner"&&(h=t.width/2,g=n.width/2),this.paddingLeft=Math.max((h-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((g-d+s)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;o==="start"?(u=0,d=t.height):o==="end"&&(u=n.height,d=0),this.paddingTop=u+s,this.paddingBottom=d+s}}_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(){hn(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({width:s[L]||0,height:a[L]||0});return{first:P(0),last:P(n-1),widest:P(O),highest:P(T),widths:s,heights:a}}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 tD(this._alignToPixels?ls(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&&ta*i?a/r:l/i:l*i0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:o,position:s,border:a}=i,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=ml(o),g=[],m=a.setContext(this.getContext()),y=m.display?m.width:0,k=y/2,C=function(fe){return ls(r,fe,y)};let v,w,M,E,O,T,P,L,W,I,R,G;if(s==="top")v=C(this.bottom),T=this.bottom-h,L=v-k,I=C(t.top)+k,G=t.bottom;else if(s==="bottom")v=C(this.top),I=t.top,G=C(t.bottom)-k,T=v+k,L=this.top+h;else if(s==="left")v=C(this.right),O=this.right-h,P=v-k,W=C(t.left)+k,R=t.right;else if(s==="right")v=C(this.left),W=t.left,R=C(t.right)-k,O=v+k,P=this.left+h;else if(n==="x"){if(s==="center")v=C((t.top+t.bottom)/2+.5);else if(Nt(s)){const fe=Object.keys(s)[0],Ce=s[fe];v=C(this.chart.scales[fe].getPixelForValue(Ce))}I=t.top,G=t.bottom,T=v+k,L=T+h}else if(n==="y"){if(s==="center")v=C((t.left+t.right)/2);else if(Nt(s)){const fe=Object.keys(s)[0],Ce=s[fe];v=C(this.chart.scales[fe].getPixelForValue(Ce))}O=v-k,P=O-h,W=t.left,R=t.right}const Z=Ut(i.ticks.maxTicksLimit,d),Y=Math.max(1,Math.ceil(d/Z));for(w=0;w0&&(tt-=ft/2);break}Ze={left:tt,top:Pe,width:ft+je.width,height:st+je.height,color:Y.backdropColor}}k.push({label:M,font:L,textOffset:R,options:{rotation:y,color:Ce,strokeColor:Q,strokeWidth:ue,textAlign:ge,textBaseline:G,translation:[E,O],backdrop:Ze}})}return k}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Ro(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:o}}=this.options,s=this._getLabelSizes(),a=t+o,l=s.widest.width;let c,u;return n==="left"?i?(u=this.right+o,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?i?(u=this.left+o,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,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:i,width:o,height:s}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,o,s),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(o=>o.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,s;const a=(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(o=0,s=i.length;o{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let o,s;for(o=0,s=n.length;o{const r=n.split("."),i=r.pop(),o=[e].concat(r).join("."),s=t[n].split("."),a=s.pop(),l=s.join(".");bn.route(o,i,l,a)})}function vN(e){return"id"in e&&"defaults"in e}class yN{constructor(){this.controllers=new Vu(ec,"datasets",!0),this.elements=new Vu(Us,"elements"),this.plugins=new Vu(Object,"plugins"),this.scales=new Vu(Ks,"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(i=>{const o=r||this._getRegistryForType(i);r||o.isForType(i)||o===this.plugins&&i.id?this._exec(t,o,i):Qn(i,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const i=sm(t);hn(r["before"+i],[],r),n[t](r),hn(r["after"+i],[],r)}_getRegistryForType(t){for(let n=0;no.filter(a=>!s.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function xN(e){const t={},n=[],r=Object.keys(mi.plugins.items);for(let o=0;o1&&Iy(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Ny(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function MN(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 Ny(e,"x",n[0])||Ny(e,"y",n[0])}return{}}function TN(e,t){const n=$s[e.type]||{scales:{}},r=t.scales||{},i=tp(e.type,t),o=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!Nt(a))return console.error(`Invalid scale configuration for scale: ${s}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=np(s,a,MN(s,e),bn.scales[a.type]),c=kN(l,i),u=n.scales||{};o[s]=Gl(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||tp(a,t),u=($s[a]||{}).scales||{};Object.keys(u).forEach(d=>{const h=SN(d,l),g=s[h+"AxisID"]||h;o[g]=o[g]||Object.create(null),Gl(o[g],[{axis:h},r[g],u[d]])})}),Object.keys(o).forEach(s=>{const a=o[s];Gl(a,[bn.scales[a.type],bn.scale])}),o}function Nx(e){const t=e.options||(e.options={});t.plugins=Ut(t.plugins,{}),t.scales=TN(e,t)}function Wx(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function PN(e){return e=e||{},e.data=Wx(e.data),Nx(e),e}const Wy=new Map,$x=new Set;function Yu(e,t){let n=Wy.get(e);return n||(n=t(),Wy.set(e,n),$x.add(n)),n}const vl=(e,t,n)=>{const r=xd(t,n);r!==void 0&&e.add(r)};class AN{constructor(t){this._config=PN(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=Wx(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(),Nx(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Yu(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Yu(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Yu(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return Yu(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:o}=this,s=this._cachedScopes(t,r),a=s.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>vl(l,t,d))),u.forEach(d=>vl(l,i,d)),u.forEach(d=>vl(l,$s[o]||{},d)),u.forEach(d=>vl(l,bn,d)),u.forEach(d=>vl(l,ep,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),$x.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,$s[n]||{},bn.datasets[n]||{},{type:n},bn,ep]}resolveNamedOptions(t,n,r,i=[""]){const o={$shared:!0},{resolver:s,subPrefixes:a}=$y(this._resolverCache,t,i);let l=s;if(ON(s,n)){o.$shared=!1,r=Jo(r)?r():r;const c=this.createResolver(t,r,a);l=Fa(s,r,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,r=[""],i){const{resolver:o}=$y(this._resolverCache,t,r);return Nt(n)?Fa(o,n,void 0,i):o}}function $y(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let o=r.get(i);return o||(o={resolver:fm(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,o)),o}const LN=e=>Nt(e)&&Object.getOwnPropertyNames(e).some(t=>Jo(e[t]));function ON(e,t){const{isScriptable:n,isIndexable:r}=Sx(e);for(const i of t){const o=n(i),s=r(i),a=(s||o)&&e[i];if(o&&(Jo(a)||LN(a))||s&&xn(a))return!0}return!1}var RN="4.4.3";const DN=["top","bottom","left","right","chartArea"];function Uy(e,t){return e==="top"||e==="bottom"||DN.indexOf(e)===-1&&t==="x"}function Fy(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function By(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),hn(n&&n.onComplete,[e],t)}function IN(e){const t=e.chart,n=t.options.animation;hn(n&&n.onProgress,[e],t)}function Ux(e){return pm()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const wf={},jy=e=>{const t=Ux(e);return Object.values(wf).filter(n=>n.canvas===t).pop()};function NN(e,t,n){const r=Object.keys(e);for(const i of r){const o=+i;if(o>=t){const s=e[i];delete e[i],(n>0||o>t)&&(e[o+n]=s)}}}function WN(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function Ku(e,t,n){return e.options.clip?e[n]:t[n]}function $N(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:Ku(n,t,"left"),right:Ku(n,t,"right"),top:Ku(r,t,"top"),bottom:Ku(r,t,"bottom")}:t}var wo;let Sh=(wo=class{static register(...t){mi.add(...t),Hy()}static unregister(...t){mi.remove(...t),Hy()}constructor(t,n){const r=this.config=new AN(n),i=Ux(t),o=jy(i);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||tN(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,s.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=jR(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=s,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 wN,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=aD(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],wf[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}$i.listen(this,"complete",By),$i.listen(this,"progress",IN),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:o}=this;return en(t)?n&&o?o:i?r/i: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 mi}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():hy(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return uy(this.canvas,this.ctx),this}stop(){return $i.stop(this),this}resize(t,n){$i.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(i,t,n,o),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,hy(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),hn(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Qn(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((s,a)=>(s[a]=!1,s),{});let o=[];n&&(o=o.concat(Object.keys(n).map(s=>{const a=n[s],l=np(s,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Qn(o,s=>{const a=s.options,l=a.id,c=np(l,a),u=Ut(a.type,s.dtype);(a.position===void 0||Uy(a.position,c)!==Uy(s.dposition))&&(a.position=s.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const h=mi.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),Qn(i,(s,a)=>{s||delete r[a]}),Qn(r,s=>{Do.configure(this,s,s.options),Do.addBox(this,s)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,o)=>i.index-o.index),r>n){for(let i=n;in.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r{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()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,u=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Fy("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Qn(this.scales,t=>{Do.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!ey(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:o}of n){const s=r==="_removeElements"?-o:o;NN(t,i,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=o=>new Set(t.filter(s=>s[0]===o).map((s,a)=>a+","+s.splice(1).join(","))),i=r(0);for(let o=1;oo.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Do.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Qn(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,o)=>{i._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r=t._clip,i=!r.disabled,o=$N(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(i&&bx(n,{left:r.left===!1?0:o.left-r.left,right:r.right===!1?this.width:o.right+r.right,top:r.top===!1?0:o.top-r.top,bottom:r.bottom===!1?this.height:o.bottom+r.bottom}),t.controller.draw(),i&&_x(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Zi(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const o=DI.modes[n];return typeof o=="function"?o(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(o=>o&&o._dataset===n).pop();return i||(i={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(i)),i}getContext(){return this.$context||(this.$context=Ys(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 i=r?"show":"hide",o=this.getDatasetMeta(t),s=o.controller._resolveAnimations(void 0,i);bd(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(o,{visible:r}),this.update(a=>a.datasetIndex===t?i: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(),$i.remove(this),t=0,n=this.data.datasets.length;t{n.addEventListener(this,o,s),t[o]=s},i=(o,s,a)=>{o.offsetX=s,o.offsetY=a,this._eventHandler(o)};Qn(this.options.events,o=>r(o,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",o),r("detach",s)};s=()=>{this.attached=!1,i("resize",o),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():s()}unbindEvents(){Qn(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Qn(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let o,s,a,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[s],index:s}});!Jv(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 i=this.options.hover,o=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),s=o(n,t),a=r?t:o(t,n);s.length&&this.updateHoverStyle(s,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const o=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(o||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:o}=this,s=n,a=this._getActiveElements(t,i,r,s),l=qR(t),c=WN(t,this._lastEvent,r,l);r&&(this._lastEvent=null,hn(o.onHover,[t,a,this],this),l&&hn(o.onClick,[t,a,this],this));const u=!Jv(a,i);return(u||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,i)}},Je(wo,"defaults",bn),Je(wo,"instances",wf),Je(wo,"overrides",$s),Je(wo,"registry",mi),Je(wo,"version",RN),Je(wo,"getChart",jy),wo);function Hy(){return Qn(Sh.instances,e=>e._plugins.invalidate())}function Fx(e,t,n=t){e.lineCap=Ut(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Ut(n.borderDash,t.borderDash)),e.lineDashOffset=Ut(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Ut(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Ut(n.borderWidth,t.borderWidth),e.strokeStyle=Ut(n.borderColor,t.borderColor)}function UN(e,t,n){e.lineTo(n.x,n.y)}function FN(e){return e.stepped?_D:e.tension||e.cubicInterpolationMode==="monotone"?CD:UN}function Bx(e,t,n={}){const r=e.length,{start:i=0,end:o=r-1}=n,{start:s,end:a}=t,l=Math.max(i,s),c=Math.min(o,a),u=ia&&o>a;return{count:r,start:l,loop:t.loop,ilen:c(s+(c?a-M:M))%o,w=()=>{y!==k&&(e.lineTo(u,k),e.lineTo(u,y),e.lineTo(u,C))};for(l&&(g=i[v(0)],e.moveTo(g.x,g.y)),h=0;h<=a;++h){if(g=i[v(h)],g.skip)continue;const M=g.x,E=g.y,O=M|0;O===m?(Ek&&(k=E),u=(d*u+M)/++d):(w(),e.lineTo(M,E),m=O,d=0,y=k=E),C=E}w()}function rp(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?jN:BN}function HN(e){return e.stepped?iI:e.tension||e.cubicInterpolationMode==="monotone"?oI:ps}function zN(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Fx(e,t.options),e.stroke(i)}function VN(e,t,n,r){const{segments:i,options:o}=t,s=rp(t);for(const a of i)Fx(e,o,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const YN=typeof Path2D=="function";function KN(e,t,n,r){YN&&!t.options.segment?zN(e,t,n,r):VN(e,t,n,r)}class Al extends Us{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 i=r.spanGaps?this._loop:this._fullLoop;ZD(this._points,r,t,i,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=fI(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,i=t[n],o=this.points,s=lI(this,{property:n,start:i,end:i});if(!s.length)return;const a=[],l=HN(r);let c,u;for(c=0,u=s.length;ct!=="borderDash"&&t!=="fill"});function zy(e,t,n,r){const i=e.options,{[n]:o}=e.getProps([n],r);return Math.abs(t-o)(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function QN(e,t,n,r){const i=e.indexOf(t);if(i===-1)return ZN(e,t,n,r);const o=e.lastIndexOf(t);return i!==o?n:i}const JN=(e,t)=>e===null?null:_i(Math.round(e),0,t);function Vy(e){const t=this.getLabels();return e>=0&&en.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}Je(ip,"id","category"),Je(ip,"defaults",{ticks:{callback:Vy}});function XN(e,t){const n=[],{bounds:i,step:o,min:s,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=e,g=o||1,m=u-1,{min:y,max:k}=t,C=!en(s),v=!en(a),w=!en(c),M=(k-y)/(d+1);let E=ny((k-y)/m/g)*g,O,T,P,L;if(E<1e-14&&!C&&!v)return[{value:y},{value:k}];L=Math.ceil(k/E)-Math.floor(y/E),L>m&&(E=ny(L*E/m/g)*g),en(l)||(O=Math.pow(10,l),E=Math.ceil(E*O)/O),i==="ticks"?(T=Math.floor(y/E)*E,P=Math.ceil(k/E)*E):(T=y,P=k),C&&v&&o&&JR((a-s)/o,E/1e3)?(L=Math.round(Math.min((a-s)/E,u)),E=(a-s)/L,T=s,P=a):w?(T=C?s:T,P=v?a:P,L=c-1,E=(P-T)/L):(L=(P-T)/E,Zl(L,Math.round(L),E/1e3)?L=Math.round(L):L=Math.ceil(L));const W=Math.max(ry(E),ry(T));O=Math.pow(10,en(l)?W:l),T=Math.round(T*O)/O,P=Math.round(P*O)/O;let I=0;for(C&&(h&&T!==s?(n.push({value:s}),Ta)break;n.push({value:R})}return v&&h&&P!==a?n.length&&Zl(n[n.length-1].value,a,Yy(a,M,e))?n[n.length-1].value=a:n.push({value:a}):(!v||P===a)&&n.push({value:P}),n}function Yy(e,t,{horizontal:n,minRotation:r}){const i=Ro(r),o=(n?Math.sin(i):Math.cos(i))||.001,s=.75*t*(""+e).length;return Math.min(t/o,s)}class Ed extends Ks{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 en(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:i,max:o}=this;const s=l=>i=n?i:l,a=l=>o=r?o:l;if(t){const l=Ua(i),c=Ua(o);l<0&&c<0?a(0):l>0&&c>0&&s(0)}if(i===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||s(i-l)}this.min=i,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={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},o=this._range||this,s=XN(i,o);return t.bounds==="ticks"&&px(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return um(t,this.chart.options.locale,this.options.ticks.format)}}class op extends Ed{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Nn(t)?t:0,this.max=Nn(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Ro(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Je(op,"id","linear"),Je(op,"defaults",{ticks:{callback:_h.formatters.numeric}});const Wc=e=>Math.floor(Oo(e)),us=(e,t)=>Math.pow(10,Wc(e)+t);function Ky(e){return e/Math.pow(10,Wc(e))===1}function qy(e,t,n){const r=Math.pow(10,n),i=Math.floor(e/r);return Math.ceil(t/r)-i}function eW(e,t){const n=t-e;let r=Wc(n);for(;qy(e,t,r)>10;)r++;for(;qy(e,t,r)<10;)r--;return Math.min(r,Wc(e))}function tW(e,{min:t,max:n}){t=Sr(e.min,t);const r=[],i=Wc(t);let o=eW(t,n),s=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=i>o?Math.pow(10,i):0,c=Math.round((t-l)*s)/s,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,o)),h=Sr(e.min,Math.round((l+u+d*Math.pow(10,o))*s)/s);for(;h=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,s=o>=0?1:s),h=Math.round((l+u+d*Math.pow(10,o))*s)/s;const g=Sr(e.max,h);return r.push({value:g,major:Ky(g),significand:d}),r}class Gy extends Ks{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=Ed.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return Nn(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Nn(t)?Math.max(0,t):null,this.max=Nn(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Nn(this._userMin)&&(this.min=t===us(this.min,0)?us(this.min,-1):us(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,i=this.max;const o=a=>r=t?r:a,s=a=>i=n?i:a;r===i&&(r<=0?(o(1),s(10)):(o(us(r,-1)),s(us(i,1)))),r<=0&&o(us(i,-1)),i<=0&&s(us(r,1)),this.min=r,this.max=i}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=tW(n,this);return t.bounds==="ticks"&&px(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":um(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Oo(t),this._valueRange=Oo(this.max)-Oo(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Oo(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}Je(Gy,"id","logarithmic"),Je(Gy,"defaults",{ticks:{callback:_h.formatters.logarithmic,major:{enabled:!0}}});function sp(e){const t=e.ticks;if(t.display&&e.display){const n=Li(t.backdropPadding);return Ut(t.font&&t.font.size,bn.font.size)+n.height}return 0}function nW(e,t,n){return n=xn(n)?n:[n],{w:wD(e,t.string,n),h:n.length*t.lineHeight}}function Zy(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:ei?{start:t-n,end:t}:{start:t,end:t+n}}function rW(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=[],i=[],o=e._pointLabels.length,s=e.options.pointLabels,a=s.centerPointLabels?Sn/o:0;for(let l=0;lt.r&&(a=(r.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),i.startt.b&&(l=(i.end-t.b)/s,e.b=Math.max(e.b,t.b+l))}function oW(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:o,padding:s,size:a}=n,l=e.getPointPosition(t,r+i+s,o),c=Math.round(am(ei(l.angle+Pr))),u=uW(l.y,a.h,c),d=lW(c),h=cW(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+a.w,bottom:u+a.h}}function sW(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:o}=e;return!(Zi({x:n,y:r},t)||Zi({x:n,y:o},t)||Zi({x:i,y:r},t)||Zi({x:i,y:o},t))}function aW(e,t,n){const r=[],i=e._pointLabels.length,o=e.options,{centerPointLabels:s,display:a}=o.pointLabels,l={extra:sp(o)/2,additionalAngle:s?Sn/i:0};let c;for(let u=0;u270||n<90)&&(e-=t),e}function fW(e,t,n){const{left:r,top:i,right:o,bottom:s}=n,{backdropColor:a}=t;if(!en(a)){const l=RD(t.borderRadius),c=Li(t.backdropPadding);e.fillStyle=a;const u=r-c.left,d=i-c.top,h=o-r+c.width,g=s-i+c.height;Object.values(l).some(m=>m!==0)?(e.beginPath(),MD(e,{x:u,y:d,w:h,h:g,radius:l}),e.fill()):e.fillRect(u,d,h,g)}}function dW(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const o=e._pointLabelItems[i];if(!o.visible)continue;const s=r.setContext(e.getPointLabelContext(i));fW(n,s,o);const a=Xo(s.font),{x:l,y:c,textAlign:u}=o;Ic(n,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:s.color,textAlign:u,textBaseline:"middle"})}}function Hx(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,ai);else{let o=e.getPointPosition(0,t);i.moveTo(o.x,o.y);for(let s=1;s{const i=hn(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?rW(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,i))}getIndexAngle(t){const n=ai/(this._pointLabels.length||1),r=this.options.startAngle||0;return ei(t*n+Ro(r))}getDistanceFromCenterForValue(t){if(en(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(en(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{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),g=i.setContext(h),m=o.setContext(h);hW(this,g,l,s,m)}}),r.display){for(t.save(),a=s-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{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(a,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 i=this.getIndexAngle(0);let o,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=Xo(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,s=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Li(c.backdropPadding);t.fillRect(-s/2-d.left,-o-u.size/2-d.top,s+d.width,u.size+d.height)}Ic(t,a.label,0,-o,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}Je(qu,"id","radialLinear"),Je(qu,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:_h.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Je(qu,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Je(qu,"descriptors",{angleLines:{_fallback:"grid"}});const kh={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}},vr=Object.keys(kh);function Qy(e,t){return e-t}function Jy(e,t){if(en(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:o}=e._parseOpts;let s=t;return typeof r=="function"&&(s=r(s)),Nn(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(i&&(s=i==="week"&&(Dc(o)||o===!0)?n.startOf(s,"isoWeek",o):n.startOf(s,i)),+s)}function Xy(e,t,n,r){const i=vr.length;for(let o=vr.indexOf(e);o=vr.indexOf(n);o--){const s=vr[o];if(kh[s].common&&e._adapter.diff(i,r,s)>=t-1)return s}return vr[n?vr.indexOf(n):0]}function mW(e){for(let t=vr.indexOf(e)+1,n=vr.length;t=t?n[r]:n[i];e[o]=!0}}function vW(e,t,n,r){const i=e._adapter,o=+i.startOf(t[0].value,r),s=t[t.length-1].value;let a,l;for(a=o;a<=s;a=+i.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function tw(e,t,n){const r=[],i={},o=t.length;let s,a;for(s=0;s+t.value))}initOffsets(t=[]){let n=0,r=0,i,o;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=_i(n,0,s),r=_i(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,o=i.time,s=o.unit||Xy(o.minUnit,n,r,this._getLabelCapacity(n)),a=Ut(i.ticks.stepSize,1),l=s==="week"?o.isoWeekday:!1,c=Dc(l)||l===!0,u={};let d=n,h,g;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":s),t.diff(r,n,s)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+s);const m=i.ticks.source==="data"&&this.getDataTimestamps();for(h=d,g=0;h+y)}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 i=this.options.time.displayFormats,o=this._unit,s=n||i[o];return this._adapter.format(t,s)}_tickFormatFunction(t,n,r,i){const o=this.options,s=o.ticks.callback;if(s)return hn(s,[t,n,r],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],h=r[n],g=c&&d&&h&&h.major;return this._adapter.format(t,i||(g?d:u))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=bs(e,"pos",t)),{pos:o,time:a}=e[r],{pos:s,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=bs(e,"time",t)),{time:o,pos:a}=e[r],{time:s,pos:l}=e[i]);const c=s-o;return c?a+(l-a)*(t-o)/c:a}class nw extends Md{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=Gu(n,this.min),this._tableRange=Gu(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],o=[];let s,a,l,c,u;for(s=0,a=t.length;s=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,a=i.length;si-o)}_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(Gu(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Gu(this._table,r*this._tableRange+this._minPos,!0)}}Je(nw,"id","timeseries"),Je(nw,"defaults",Md.defaults);const zx="label";function rw(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function yW(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function Vx(e,t){e.labels=t}function Yx(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:zx;const r=[];e.datasets=t.map(i=>{const o=e.datasets.find(s=>s[n]===i[n]);return!o||!i.data||r.includes(o)?{...i}:(r.push(o),Object.assign(o,i),o)})}function wW(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:zx;const n={labels:[],datasets:[]};return Vx(n,e.labels),Yx(n,e.datasets,t),n}function xW(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:o,type:s,data:a,options:l,plugins:c=[],fallbackContent:u,updateMode:d,...h}=e,g=rn.useRef(null),m=rn.useRef(),y=()=>{g.current&&(m.current=new Sh(g.current,{type:s,data:wW(a,o),options:l&&{...l},plugins:c}),rw(t,m.current))},k=()=>{rw(t,null),m.current&&(m.current.destroy(),m.current=null)};return rn.useEffect(()=>{!i&&m.current&&l&&yW(m.current,l)},[i,l]),rn.useEffect(()=>{!i&&m.current&&Vx(m.current.config.data,a.labels)},[i,a.labels]),rn.useEffect(()=>{!i&&m.current&&a.datasets&&Yx(m.current.config.data,a.datasets,o)},[i,a.datasets]),rn.useEffect(()=>{m.current&&(i?(k(),setTimeout(y)):m.current.update(d))},[i,l,a.labels,a.datasets,d]),rn.useEffect(()=>{m.current&&(k(),setTimeout(y))},[s]),rn.useEffect(()=>(y(),()=>k()),[]),Pd.createElement("canvas",Object.assign({ref:g,role:"img",height:n,width:r},h),u)}const bW=rn.forwardRef(xW);function _W(e,t){return Sh.register(t),rn.forwardRef((n,r)=>Pd.createElement(bW,Object.assign({},n,{ref:r,type:e})))}const CW=_W("line",vf);Sh.register(ip,op,xf,Al,GN);const SW=()=>{const[e,t]=rn.useState({labels:[],datasets:[{label:"TON/USD",data:[],borderColor:"rgb(83, 91, 242)",tension:.1}]});rn.useEffect(()=>{(async()=>{const o=(await kn("https://api.coingecko.com/api/v3/coins/the-open-network/market_chart?vs_currency=usd&days=120")).data.prices,s=o.map(l=>pe(l[0]).format("DD/MM/YYYY")),a=o.map(l=>l[1]);t({labels:s,datasets:[{...e.datasets[0],data:a}]})})()},[e.datasets]);const n={responsive:!0,plugins:{legend:{},title:{display:!0,text:"TON/USD Exchange Rate (Last 120 Days)"}}};return tn.jsx(CW,{options:n,data:e})};function kW(){return tn.jsx(BM,{manifestUrl:"https://rosticom.github.io/coobot-merkaba-tma/tonconnect-manifest.json",uiPreferences:{theme:Jt.DARK},walletsListConfiguration:{includeWallets:[{appName:"safepalwallet",name:"SafePal",imageUrl:"https://s.pvcliping.com/web/public_image/SafePal_x288.png",tondns:"",aboutUrl:"https://www.safepal.com",universalLink:"https://link.safepal.io/ton-connect",deepLink:"safepal-tc://",jsBridgeKey:"safepalwallet",bridgeUrl:"https://ton-bridge.safepal.com/tonbridge/v1/bridge",platforms:["ios","android","chrome","firefox"]},{appName:"bitgetTonWallet",name:"Bitget Wallet",imageUrl:"https://raw.githubusercontent.com/bitkeepwallet/download/main/logo/png/bitget%20wallet_logo_iOS.png",aboutUrl:"https://web3.bitget.com",deepLink:"bitkeep://",jsBridgeKey:"bitgetTonWallet",bridgeUrl:"https://bridge.tonapi.io/bridge",platforms:["ios","android","chrome"],universalLink:"https://bkcode.vip/ton-connect"},{appName:"tonwallet",name:"TON Wallet",imageUrl:"https://wallet.ton.org/assets/ui/qr-logo.png",aboutUrl:"https://chrome.google.com/webstore/detail/ton-wallet/nphplpgoakhhjchkkhmiggakijnkhfnd",universalLink:"https://wallet.ton.org/ton-connect",jsBridgeKey:"tonwallet",bridgeUrl:"https://bridge.tonapi.io/bridge",platforms:["chrome","android"]}]},actionsConfiguration:{twaReturnUrl:"https://rosticom.github.io/coobot-merkaba-tma/"},children:tn.jsxs("div",{className:"app",children:[tn.jsx(YM,{}),tn.jsx("div",{children:tn.jsx("a",{href:"https://t.me/+JuO8mZMYOnRmN2Ux",children:tn.jsx("img",{src:KM,className:"logo",alt:"Coobot chat"})})}),tn.jsx("div",{className:"card",children:tn.jsx("p",{children:tn.jsx("a",{href:"https://t.me/gasPump_bot/app?startapp=eyJyZWZfdXNlcl9pZCI6NTY1ODY0MzE4LCJ0b2tlbl9hZGRyZXNzIjoiRVFEZGlyd3l5YXNST2tvUnc5bUJCekJkUUhjYUFjOUV5OFpoak1TdXRkdHJmU2M1In0",children:"Buy $COO and chill out. Dividend payout August 1st, 2024."})})}),tn.jsx("p",{className:"read-the-docs"}),tn.jsx(SW,{}),tn.jsx(VM,{})]})})}var Kx={},Eh={};(function(){var e={},t="";try{t=location.hash.toString()}catch{}var n=l(t),r=C("initParams");if(r)for(var i in r)typeof n[i]>"u"&&(n[i]=r[i]);k("initParams",n);var o=!1,s;try{if(o=window.parent!=null&&window!=window.parent,o){window.addEventListener("message",function(v){if(v.source===window.parent){try{var w=JSON.parse(v.data)}catch{return}if(!(!w||!w.eventType))if(w.eventType=="set_custom_style")v.origin==="https://web.telegram.org"&&(s.innerHTML=w.eventData);else if(w.eventType=="reload_iframe"){try{window.parent.postMessage(JSON.stringify({eventType:"iframe_will_reload"}),"*")}catch{}location.reload()}else h(w.eventType,w.eventData)}}),s=document.createElement("style"),document.head.appendChild(s);try{window.parent.postMessage(JSON.stringify({eventType:"iframe_ready",eventData:{reload_supported:!0}}),"*")}catch{}}}catch{}function a(v){try{return v=v.replace(/\+/g,"%20"),decodeURIComponent(v)}catch{return v}}function l(v){v=v.replace(/^#/,"");var w={};if(!v.length)return w;if(v.indexOf("=")<0&&v.indexOf("?")<0)return w._path=a(v),w;var M=v.indexOf("?");if(M>=0){var E=v.substr(0,M);w._path=a(E),v=v.substr(M+1)}var O=c(v);for(var T in O)w[T]=O[T];return w}function c(v){var w={};if(!v.length)return w;var M=v.split("&"),E,O,T,P;for(E=0;E=0?v+"&"+w:E.length>0?v+"?"+w:v+w}function d(v,w,M){if(w||(w=function(){}),M===void 0&&(M=""),console.log("[Telegram.WebView] > postEvent",v,M),window.TelegramWebviewProxy!==void 0)TelegramWebviewProxy.postEvent(v,JSON.stringify(M)),w();else if(window.external&&"notify"in window.external)window.external.notify(JSON.stringify({eventType:v,eventData:M})),w();else if(o)try{var E="https://web.telegram.org";E="*",window.parent.postMessage(JSON.stringify({eventType:v,eventData:M}),E),w()}catch(O){w(O)}else w({notAvailable:!0})}function h(v,w){console.log("[Telegram.WebView] < receiveEvent",v,w),g(v,function(M){M(v,w)})}function g(v,w){var M=e[v];if(!(M===void 0||!M.length))for(var E=0;Emt?1:-1;return 0}function ie(D){return ne(c,D)>=0}function Te(D){if(window.Blob)try{return new Blob([D]).size}catch{}for(var N=D.length,F=D.length-1;F>=0;F--){var oe=D.charCodeAt(F);oe>127&&oe<=2047?N++:oe>2047&&oe<=65535&&(N+=2),oe>=56320&&oe<=57343&&F--}return N}var Ae=function(){var D=!1,N={};Object.defineProperty(N,"isVisible",{set:function(ze){at({is_visible:ze})},get:function(){return D},enumerable:!0});var F=null;t.onEvent("back_button_pressed",oe);function oe(){E("backButtonClicked")}function ye(){return{is_visible:D}}function mt(ze){return typeof ze>"u"&&(ze=ye()),JSON.stringify(ze)}function De(){return ie("6.1")?!0:(console.warn("[Telegram.WebApp] BackButton is not supported in version "+c),!1)}function cn(){var ze=ye(),jt=mt(ze);F!==jt&&(F=jt,t.postEvent("web_app_setup_back_button",!1,ze))}function at(ze){return De()&&(typeof ze.is_visible<"u"&&(D=!!ze.is_visible),cn()),N}return N.onClick=function(ze){return De()&&O("backButtonClicked",ze),N},N.offClick=function(ze){return De()&&T("backButtonClicked",ze),N},N.show=function(){return at({is_visible:!0})},N.hide=function(){return at({is_visible:!1})},N}(),Xe=0,Dt=function(){var D=!1,N=!0,F=!1,oe="CONTINUE",ye=!1,mt=!1,De={};Object.defineProperty(De,"text",{set:function(p){De.setParams({text:p})},get:function(){return oe},enumerable:!0}),Object.defineProperty(De,"color",{set:function(p){De.setParams({color:p})},get:function(){return ye||a.button_color||"#2481cc"},enumerable:!0}),Object.defineProperty(De,"textColor",{set:function(p){De.setParams({text_color:p})},get:function(){return mt||a.button_text_color||"#ffffff"},enumerable:!0}),Object.defineProperty(De,"isVisible",{set:function(p){De.setParams({is_visible:p})},get:function(){return D},enumerable:!0}),Object.defineProperty(De,"isProgressVisible",{get:function(){return F},enumerable:!0}),Object.defineProperty(De,"isActive",{set:function(p){De.setParams({is_active:p})},get:function(){return N},enumerable:!0});var cn=null;t.onEvent("main_button_pressed",Wr);var at=null,ze={};if(n.tgWebAppDebug){at=document.createElement("tg-main-button"),ze={font:"600 14px/18px sans-serif",display:"none",width:"100%",height:"48px",borderRadius:"0",background:"no-repeat right center",position:"fixed",left:"0",right:"0",bottom:"0",margin:"0",padding:"15px 20px",textAlign:"center",boxSizing:"border-box",zIndex:"10000"};for(var jt in ze)at.style[jt]=ze[jt];document.addEventListener("DOMContentLoaded",function p(x){document.removeEventListener("DOMContentLoaded",p),document.body.appendChild(at),at.addEventListener("click",Wr,!1)})}function Wr(){N&&E("mainButtonClicked")}function qs(){var p=De.color,x=De.textColor;return D?{is_visible:!0,is_active:N,is_progress_visible:F,text:oe,color:p,text_color:x}:{is_visible:!1}}function su(p){return typeof p>"u"&&(p=qs()),JSON.stringify(p)}function el(){var p=qs(),x=su(p);cn!==x&&(cn=x,t.postEvent("web_app_setup_main_button",!1,p),n.tgWebAppDebug&&or(p))}function or(p){p.is_visible?(at.style.display="block",Xe=48,at.style.opacity=p.is_active?"1":"0.8",at.style.cursor=p.is_active?"pointer":"auto",at.disabled=!p.is_active,at.innerText=p.text,at.style.backgroundImage=p.is_progress_visible?"url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20viewport%3D%220%200%2048%2048%22%20width%3D%2248px%22%20height%3D%2248px%22%3E%3Ccircle%20cx%3D%2250%25%22%20cy%3D%2250%25%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222.25%22%20stroke-linecap%3D%22round%22%20fill%3D%22none%22%20stroke-dashoffset%3D%22106%22%20r%3D%229%22%20stroke-dasharray%3D%2256.52%22%20rotate%3D%22-90%22%3E%3Canimate%20attributeName%3D%22stroke-dashoffset%22%20attributeType%3D%22XML%22%20dur%3D%22360s%22%20from%3D%220%22%20to%3D%2212500%22%20repeatCount%3D%22indefinite%22%3E%3C%2Fanimate%3E%3CanimateTransform%20attributeName%3D%22transform%22%20attributeType%3D%22XML%22%20type%3D%22rotate%22%20dur%3D%221s%22%20from%3D%22-90%2024%2024%22%20to%3D%22630%2024%2024%22%20repeatCount%3D%22indefinite%22%3E%3C%2FanimateTransform%3E%3C%2Fcircle%3E%3C%2Fsvg%3E')":"none",at.style.backgroundColor=p.color,at.style.color=p.text_color):(at.style.display="none",Xe=0),document.documentElement&&(document.documentElement.style.boxSizing="border-box",document.documentElement.style.paddingBottom=Xe+"px"),Y()}function au(p){if(typeof p.text<"u"){var x=M(p.text);if(!x.length)throw console.error("[Telegram.WebApp] Main button text is required",p.text),Error("WebAppMainButtonParamInvalid");if(x.length>64)throw console.error("[Telegram.WebApp] Main button text is too long",x),Error("WebAppMainButtonParamInvalid");oe=x}if(typeof p.color<"u")if(p.color===!1||p.color===null)ye=!1;else{var b=B(p.color);if(!b)throw console.error("[Telegram.WebApp] Main button color format is invalid",p.color),Error("WebAppMainButtonParamInvalid");ye=b}if(typeof p.text_color<"u")if(p.text_color===!1||p.text_color===null)mt=!1;else{var f=B(p.text_color);if(!f)throw console.error("[Telegram.WebApp] Main button text color format is invalid",p.text_color),Error("WebAppMainButtonParamInvalid");mt=f}if(typeof p.is_visible<"u"){if(p.is_visible&&!De.text.length)throw console.error("[Telegram.WebApp] Main button text is required"),Error("WebAppMainButtonParamInvalid");D=!!p.is_visible}return typeof p.is_active<"u"&&(N=!!p.is_active),el(),De}return De.setText=function(p){return De.setParams({text:p})},De.onClick=function(p){return O("mainButtonClicked",p),De},De.offClick=function(p){return T("mainButtonClicked",p),De},De.show=function(){return De.setParams({is_visible:!0})},De.hide=function(){return De.setParams({is_visible:!1})},De.enable=function(){return De.setParams({is_active:!0})},De.disable=function(){return De.setParams({is_active:!1})},De.showProgress=function(p){return N=!!p,F=!0,el(),De},De.hideProgress=function(){return De.isActive||(N=!0),F=!1,el(),De},De.setParams=au,De}(),We=function(){var D=!1,N={};Object.defineProperty(N,"isVisible",{set:function(ze){at({is_visible:ze})},get:function(){return D},enumerable:!0});var F=null;t.onEvent("settings_button_pressed",oe);function oe(){E("settingsButtonClicked")}function ye(){return{is_visible:D}}function mt(ze){return typeof ze>"u"&&(ze=ye()),JSON.stringify(ze)}function De(){return ie("6.10")?!0:(console.warn("[Telegram.WebApp] SettingsButton is not supported in version "+c),!1)}function cn(){var ze=ye(),jt=mt(ze);F!==jt&&(F=jt,t.postEvent("web_app_setup_settings_button",!1,ze))}function at(ze){return De()&&(typeof ze.is_visible<"u"&&(D=!!ze.is_visible),cn()),N}return N.onClick=function(ze){return De()&&O("settingsButtonClicked",ze),N},N.offClick=function(ze){return De()&&T("settingsButtonClicked",ze),N},N.show=function(){return at({is_visible:!0})},N.hide=function(){return at({is_visible:!1})},N}(),Gt=function(){var D={};function N(F){if(!ie("6.1"))return console.warn("[Telegram.WebApp] HapticFeedback is not supported in version "+c),D;if(F.type=="impact"){if(F.impact_style!="light"&&F.impact_style!="medium"&&F.impact_style!="heavy"&&F.impact_style!="rigid"&&F.impact_style!="soft")throw console.error("[Telegram.WebApp] Haptic impact style is invalid",F.impact_style),Error("WebAppHapticImpactStyleInvalid")}else if(F.type=="notification"){if(F.notification_type!="error"&&F.notification_type!="success"&&F.notification_type!="warning")throw console.error("[Telegram.WebApp] Haptic notification type is invalid",F.notification_type),Error("WebAppHapticNotificationTypeInvalid")}else if(F.type!="selection_change")throw console.error("[Telegram.WebApp] Haptic feedback type is invalid",F.type),Error("WebAppHapticFeedbackTypeInvalid");return t.postEvent("web_app_trigger_haptic_feedback",!1,F),D}return D.impactOccurred=function(F){return N({type:"impact",impact_style:F})},D.notificationOccurred=function(F){return N({type:"notification",notification_type:F})},D.selectionChanged=function(){return N({type:"selection_change"})},D}(),ln=function(){var D={};function N(F,oe,ye){if(!ie("6.9"))throw console.error("[Telegram.WebApp] CloudStorage is not supported in version "+c),Error("WebAppMethodUnsupported");return Cr(F,oe,ye),D}return D.setItem=function(F,oe,ye){return N("saveStorageValue",{key:F,value:oe},ye)},D.getItem=function(F,oe){return D.getItems([F],oe?function(ye,mt){ye?oe(ye):oe(null,mt[F])}:null)},D.getItems=function(F,oe){return N("getStorageValues",{keys:F},oe)},D.removeItem=function(F,oe){return D.removeItems([F],oe)},D.removeItems=function(F,oe){return N("deleteStorageValues",{keys:F},oe)},D.getKeys=function(F){return N("getStorageKeys",{},F)},D}(),dr={};function _n(D,N){if(N.slug&&dr[N.slug]){var F=dr[N.slug];delete dr[N.slug],F.callback&&F.callback(N.status),E("invoiceClosed",{url:F.url,status:N.status})}}var En=!1;function ir(D,N){if(En){var F=En;En=!1;var oe=null;typeof N.button_id<"u"&&(oe=N.button_id),F.callback&&F.callback(oe),E("popupClosed",{button_id:oe})}}var Ue=!1;function yt(D,N){if(Ue){var F=Ue,oe=null;typeof N.data<"u"&&(oe=N.data),F.callback&&F.callback(oe)&&(Ue=!1,t.postEvent("web_app_close_scan_qr_popup",!1)),E("qrTextReceived",{data:oe})}}function He(D,N){Ue=!1}function Pt(D,N){if(N.req_id&&W[N.req_id]){var F=W[N.req_id];delete W[N.req_id];var oe=null;typeof N.data<"u"&&(oe=N.data),F.callback&&F.callback(oe),E("clipboardTextReceived",{data:oe})}}var Rn=!1;function hr(D,N){if(Rn){var F=Rn;Rn=!1,F.callback&&F.callback(N.status=="allowed"),E("writeAccessRequested",{status:N.status})}}function wt(D,N){var F,oe,ye=0,mt=function(){Cr("getRequestedContact",{},function(cn,at){at&&at.length?(clearTimeout(oe),D(at)):(ye+=50,F=setTimeout(mt,ye))})},De=function(){clearTimeout(F),D("")};oe=setTimeout(De,N),mt()}var Re=!1;function Fn(D,N){if(Re){var F=Re;Re=!1;var oe=N.status=="sent",ye={status:N.status};oe?wt(function(mt){if(mt&&mt.length){ye.response=mt,ye.responseUnsafe=e.urlParseQueryString(mt);for(var De in ye.responseUnsafe){var cn=ye.responseUnsafe[De];try{(cn.substr(0,1)=="{"&&cn.substr(-1)=="}"||cn.substr(0,1)=="["&&cn.substr(-1)=="]")&&(ye.responseUnsafe[De]=JSON.parse(cn))}catch{}}}F.callback&&F.callback(oe,ye),E("contactRequested",ye)},3e3):(F.callback&&F.callback(oe,ye),E("contactRequested",ye))}}function Zr(D,N){if(N.req_id&&W[N.req_id]){var F=W[N.req_id];delete W[N.req_id];var oe=null,ye=null;typeof N.result<"u"&&(oe=N.result),typeof N.error<"u"&&(ye=N.error),F.callback&&F.callback(ye,oe)}}function Cr(D,N,F){if(!ie("6.9"))throw console.error("[Telegram.WebApp] Method invokeCustomMethod is not supported in version "+c),Error("WebAppMethodUnsupported");var oe=I(16),ye={req_id:oe,method:D,params:N||{}};W[oe]={callback:F},t.postEvent("web_app_invoke_custom_method",!1,ye)}window.Telegram||(window.Telegram={}),Object.defineProperty(i,"initData",{get:function(){return o},enumerable:!0}),Object.defineProperty(i,"initDataUnsafe",{get:function(){return s},enumerable:!0}),Object.defineProperty(i,"version",{get:function(){return c},enumerable:!0}),Object.defineProperty(i,"platform",{get:function(){return u},enumerable:!0}),Object.defineProperty(i,"colorScheme",{get:function(){return l},enumerable:!0}),Object.defineProperty(i,"themeParams",{get:function(){return a},enumerable:!0}),Object.defineProperty(i,"isExpanded",{get:function(){return Z},enumerable:!0}),Object.defineProperty(i,"viewportHeight",{get:function(){return(R===!1?window.innerHeight:R)-Xe},enumerable:!0}),Object.defineProperty(i,"viewportStableHeight",{get:function(){return(G===!1?window.innerHeight:G)-Xe},enumerable:!0}),Object.defineProperty(i,"isClosingConfirmationEnabled",{set:function(D){Ce(D)},get:function(){return fe},enumerable:!0}),Object.defineProperty(i,"headerColor",{set:function(D){Ze(D)},get:function(){return ge()},enumerable:!0}),Object.defineProperty(i,"backgroundColor",{set:function(D){rr(D)},get:function(){return tt()},enumerable:!0}),Object.defineProperty(i,"BackButton",{value:Ae,enumerable:!0}),Object.defineProperty(i,"MainButton",{value:Dt,enumerable:!0}),Object.defineProperty(i,"SettingsButton",{value:We,enumerable:!0}),Object.defineProperty(i,"HapticFeedback",{value:Gt,enumerable:!0}),Object.defineProperty(i,"CloudStorage",{value:ln,enumerable:!0}),i.setHeaderColor=function(D){i.headerColor=D},i.setBackgroundColor=function(D){i.backgroundColor=D},i.enableClosingConfirmation=function(){i.isClosingConfirmationEnabled=!0},i.disableClosingConfirmation=function(){i.isClosingConfirmationEnabled=!1},i.isVersionAtLeast=function(D){return ie(D)},i.onEvent=function(D,N){O(D,N)},i.offEvent=function(D,N){T(D,N)},i.sendData=function(D){if(!D||!D.length)throw console.error("[Telegram.WebApp] Data is required",D),Error("WebAppDataInvalid");if(Te(D)>4096)throw console.error("[Telegram.WebApp] Data is too long",D),Error("WebAppDataInvalid");t.postEvent("web_app_data_send",!1,{data:D})},i.switchInlineQuery=function(D,N){if(!ie("6.6"))throw console.error("[Telegram.WebApp] Method switchInlineQuery is not supported in version "+c),Error("WebAppMethodUnsupported");if(!n.tgWebAppBotInline)throw console.error("[Telegram.WebApp] Inline mode is disabled for this bot. Read more about inline mode: https://core.telegram.org/bots/inline"),Error("WebAppInlineModeDisabled");if(D=D||"",D.length>256)throw console.error("[Telegram.WebApp] Inline query is too long",D),Error("WebAppInlineQueryInvalid");var F=[];if(N){if(!Array.isArray(N))throw console.error("[Telegram.WebApp] Choose chat types should be an array",N),Error("WebAppInlineChooseChatTypesInvalid");for(var oe={users:1,bots:1,groups:1,channels:1},ye=0;ye64)throw console.error("[Telegram.WebApp] Popup title is too long",F),Error("WebAppPopupParamInvalid");F.length>0&&(mt.title=F)}if(typeof D.message<"u"&&(oe=M(D.message)),!oe.length)throw console.error("[Telegram.WebApp] Popup message is required",D.message),Error("WebAppPopupParamInvalid");if(oe.length>256)throw console.error("[Telegram.WebApp] Popup message is too long",oe),Error("WebAppPopupParamInvalid");if(mt.message=oe,typeof D.buttons<"u"){if(!Array.isArray(D.buttons))throw console.error("[Telegram.WebApp] Popup buttons should be an array",D.buttons),Error("WebAppPopupParamInvalid");for(var De=0;De64))throw console.error("[Telegram.WebApp] Popup button id is too long",ze),Error("WebAppPopupParamInvalid");at.id=ze;var jt=cn.type;if(typeof jt>"u"&&(jt="default"),at.type=jt,!(jt=="ok"||jt=="close"||jt=="cancel"))if(jt=="default"||jt=="destructive"){var Wr="";if(typeof cn.text<"u"&&(Wr=M(cn.text)),!Wr.length)throw console.error("[Telegram.WebApp] Popup button text is required for type "+jt,cn.text),Error("WebAppPopupParamInvalid");if(Wr.length>64)throw console.error("[Telegram.WebApp] Popup button text is too long",Wr),Error("WebAppPopupParamInvalid");at.text=Wr}else throw console.error("[Telegram.WebApp] Popup button type is invalid",jt),Error("WebAppPopupParamInvalid");ye.push(at)}}else ye.push({id:"",type:"close"});if(ye.length<1)throw console.error("[Telegram.WebApp] Popup should have at least one button"),Error("WebAppPopupParamInvalid");if(ye.length>3)throw console.error("[Telegram.WebApp] Popup should not have more than 3 buttons"),Error("WebAppPopupParamInvalid");mt.buttons=ye,En={callback:N},t.postEvent("web_app_open_popup",!1,mt)},i.showAlert=function(D,N){i.showPopup({message:D},N?function(){N()}:null)},i.showConfirm=function(D,N){i.showPopup({message:D,buttons:[{type:"ok",id:"ok"},{type:"cancel"}]},N?function(F){N(F=="ok")}:null)},i.showScanQrPopup=function(D,N){if(!ie("6.4"))throw console.error("[Telegram.WebApp] Method showScanQrPopup is not supported in version "+c),Error("WebAppMethodUnsupported");if(Ue)throw console.error("[Telegram.WebApp] Popup is already opened"),Error("WebAppScanQrPopupOpened");var F="",oe={};if(typeof D.text<"u"){if(F=M(D.text),F.length>64)throw console.error("[Telegram.WebApp] Scan QR popup text is too long",F),Error("WebAppScanQrPopupParamInvalid");F.length>0&&(oe.text=F)}Ue={callback:N},t.postEvent("web_app_open_scan_qr_popup",!1,oe)},i.closeScanQrPopup=function(){if(!ie("6.4"))throw console.error("[Telegram.WebApp] Method closeScanQrPopup is not supported in version "+c),Error("WebAppMethodUnsupported");Ue=!1,t.postEvent("web_app_close_scan_qr_popup",!1)},i.readTextFromClipboard=function(D){if(!ie("6.4"))throw console.error("[Telegram.WebApp] Method readTextFromClipboard is not supported in version "+c),Error("WebAppMethodUnsupported");var N=I(16),F={req_id:N};W[N]={callback:D},t.postEvent("web_app_read_text_from_clipboard",!1,F)},i.requestWriteAccess=function(D){if(!ie("6.9"))throw console.error("[Telegram.WebApp] Method requestWriteAccess is not supported in version "+c),Error("WebAppMethodUnsupported");if(Rn)throw console.error("[Telegram.WebApp] Write access is already requested"),Error("WebAppWriteAccessRequested");Rn={callback:D},t.postEvent("web_app_request_write_access")},i.requestContact=function(D){if(!ie("6.9"))throw console.error("[Telegram.WebApp] Method requestContact is not supported in version "+c),Error("WebAppMethodUnsupported");if(Re)throw console.error("[Telegram.WebApp] Contact is already requested"),Error("WebAppContactRequested");Re={callback:D},t.postEvent("web_app_request_phone")},i.invokeCustomMethod=function(D,N,F){Cr(D,N,F)},i.ready=function(){t.postEvent("web_app_ready")},i.expand=function(){t.postEvent("web_app_expand")},i.close=function(){t.postEvent("web_app_close")},window.Telegram.WebApp=i,ft(),q(),Y(),n.tgWebAppShowSettings&&We.show(),window.addEventListener("resize",v),r&&document.addEventListener("click",w),t.onEvent("theme_changed",y),t.onEvent("viewport_changed",C),t.onEvent("invoice_closed",_n),t.onEvent("popup_closed",ir),t.onEvent("qr_text_received",yt),t.onEvent("scan_qr_popup_closed",He),t.onEvent("clipboard_text_received",Pt),t.onEvent("write_access_requested",hr),t.onEvent("phone_requested",Fn),t.onEvent("custom_method_invoked",Zr),t.postEvent("web_app_request_theme"),t.postEvent("web_app_request_viewport")})();Object.defineProperty(Eh,"__esModule",{value:!0});Eh.WebApp=void 0;var EW=window;Eh.WebApp=EW.Telegram.WebApp;Object.defineProperty(Kx,"__esModule",{value:!0});var MW=Eh,TW=Kx.default=MW.WebApp;TW.ready();A1.createRoot(document.getElementById("root")).render(tn.jsx(Pd.StrictMode,{children:tn.jsx(kW,{})})); diff --git a/docs/index.html b/docs/index.html index 8726fa2..acdf4f4 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,7 +6,7 @@ Coobot - + diff --git a/src/App.tsx b/src/App.tsx index c61277e..ce71c41 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -60,7 +60,7 @@ function App() { }} > - {/*

- buying or selling on the crypto market? doesn't matter with quantum technology! -

*/} +

+ {/* dividend payout August 1st, 2024 */} + {/* buying or selling on the crypto market? doesn't matter with quantum technology! */} +