zframes 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +31 -0
  3. package/README.md +55 -0
  4. package/dist/index.js +1707 -0
  5. package/package.json +53 -0
  6. package/runtime/apple-touch-icon.png +0 -0
  7. package/runtime/assets/index-6CnH3oHt.js +719 -0
  8. package/runtime/assets/index-A5M9erCx.js +35727 -0
  9. package/runtime/assets/index-CgpsbUVX.css +1 -0
  10. package/runtime/favicon-16.png +0 -0
  11. package/runtime/favicon-32.png +0 -0
  12. package/runtime/favicon.svg +12 -0
  13. package/runtime/index.html +17 -0
  14. package/runtime/unicornStudio.legacy.umd.mjs +5745 -0
  15. package/runtime/unicornStudio.umd.mjs +6721 -0
  16. package/runtime/widget-icons/allocation.png +0 -0
  17. package/runtime/widget-icons/bitcoin-dominance.png +0 -0
  18. package/runtime/widget-icons/clock.png +0 -0
  19. package/runtime/widget-icons/daily-analysis.png +0 -0
  20. package/runtime/widget-icons/dino-game.png +0 -0
  21. package/runtime/widget-icons/fear-greed.png +0 -0
  22. package/runtime/widget-icons/funding-heatmap.png +0 -0
  23. package/runtime/widget-icons/funding-rate-chart.png +0 -0
  24. package/runtime/widget-icons/heading.png +0 -0
  25. package/runtime/widget-icons/image.png +0 -0
  26. package/runtime/widget-icons/inflation-pulse.png +0 -0
  27. package/runtime/widget-icons/market-hours.png +0 -0
  28. package/runtime/widget-icons/note.png +0 -0
  29. package/runtime/widget-icons/price-chart.png +0 -0
  30. package/runtime/widget-icons/price-compare.png +0 -0
  31. package/runtime/widget-icons/price-liveline.png +0 -0
  32. package/runtime/widget-icons/price-ticker.png +0 -0
  33. package/runtime/widget-icons/rates-board.png +0 -0
  34. package/runtime/widget-icons/top-movers.png +0 -0
  35. package/runtime/widget-icons/tvl-treemap.png +0 -0
  36. package/runtime/widget-icons/widget-icons-master.png +0 -0
@@ -0,0 +1,719 @@
1
+ var HS=Object.defineProperty;var BS=(e,t,i)=>t in e?HS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var st=(e,t,i)=>BS(e,typeof t!="symbol"?t+"":t,i);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function i(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(s){if(s.ep)return;s.ep=!0;const l=i(s);fetch(s.href,l)}})();function $S(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var th={exports:{}},nl={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Yv;function GS(){if(Yv)return nl;Yv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function i(r,s,l){var c=null;if(l!==void 0&&(c=""+l),s.key!==void 0&&(c=""+s.key),"key"in s){l={};for(var f in s)f!=="key"&&(l[f]=s[f])}else l=s;return s=l.ref,{$$typeof:e,type:r,key:c,ref:s!==void 0?s:null,props:l}}return nl.Fragment=t,nl.jsx=i,nl.jsxs=i,nl}var Fv;function YS(){return Fv||(Fv=1,th.exports=GS()),th.exports}var b=YS(),nh={exports:{}},Fe={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Pv;function FS(){if(Pv)return Fe;Pv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),y=Symbol.iterator;function x(R){return R===null||typeof R!="object"?null:(R=y&&R[y]||R["@@iterator"],typeof R=="function"?R:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,T={};function E(R,X,ae){this.props=R,this.context=X,this.refs=T,this.updater=ae||S}E.prototype.isReactComponent={},E.prototype.setState=function(R,X){if(typeof R!="object"&&typeof R!="function"&&R!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,R,X,"setState")},E.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function C(){}C.prototype=E.prototype;function k(R,X,ae){this.props=R,this.context=X,this.refs=T,this.updater=ae||S}var B=k.prototype=new C;B.constructor=k,_(B,E.prototype),B.isPureReactComponent=!0;var P=Array.isArray;function N(){}var U={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function $(R,X,ae){var he=ae.ref;return{$$typeof:e,type:R,key:X,ref:he!==void 0?he:null,props:ae}}function I(R,X){return $(R.type,X,R.props)}function Y(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function O(R){var X={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(ae){return X[ae]})}var j=/\/+/g;function L(R,X){return typeof R=="object"&&R!==null&&R.key!=null?O(""+R.key):X.toString(36)}function K(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(N,N):(R.status="pending",R.then(function(X){R.status==="pending"&&(R.status="fulfilled",R.value=X)},function(X){R.status==="pending"&&(R.status="rejected",R.reason=X)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function D(R,X,ae,he,de){var ve=typeof R;(ve==="undefined"||ve==="boolean")&&(R=null);var be=!1;if(R===null)be=!0;else switch(ve){case"bigint":case"string":case"number":be=!0;break;case"object":switch(R.$$typeof){case e:case t:be=!0;break;case g:return be=R._init,D(be(R._payload),X,ae,he,de)}}if(be)return de=de(R),be=he===""?"."+L(R,0):he,P(de)?(ae="",be!=null&&(ae=be.replace(j,"$&/")+"/"),D(de,X,ae,"",function(Ee){return Ee})):de!=null&&(Y(de)&&(de=I(de,ae+(de.key==null||R&&R.key===de.key?"":(""+de.key).replace(j,"$&/")+"/")+be)),X.push(de)),1;be=0;var je=he===""?".":he+":";if(P(R))for(var se=0;se<R.length;se++)he=R[se],ve=je+L(he,se),be+=D(he,X,ae,ve,de);else if(se=x(R),typeof se=="function")for(R=se.call(R),se=0;!(he=R.next()).done;)he=he.value,ve=je+L(he,se++),be+=D(he,X,ae,ve,de);else if(ve==="object"){if(typeof R.then=="function")return D(K(R),X,ae,he,de);throw X=String(R),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return be}function V(R,X,ae){if(R==null)return R;var he=[],de=0;return D(R,he,"","",function(ve){return X.call(ae,ve,de++)}),he}function ie(R){if(R._status===-1){var X=R._result;X=X(),X.then(function(ae){(R._status===0||R._status===-1)&&(R._status=1,R._result=ae)},function(ae){(R._status===0||R._status===-1)&&(R._status=2,R._result=ae)}),R._status===-1&&(R._status=0,R._result=X)}if(R._status===1)return R._result.default;throw R._result}var ue=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},J={map:V,forEach:function(R,X,ae){V(R,function(){X.apply(this,arguments)},ae)},count:function(R){var X=0;return V(R,function(){X++}),X},toArray:function(R){return V(R,function(X){return X})||[]},only:function(R){if(!Y(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return Fe.Activity=v,Fe.Children=J,Fe.Component=E,Fe.Fragment=i,Fe.Profiler=s,Fe.PureComponent=k,Fe.StrictMode=r,Fe.Suspense=h,Fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=U,Fe.__COMPILER_RUNTIME={__proto__:null,c:function(R){return U.H.useMemoCache(R)}},Fe.cache=function(R){return function(){return R.apply(null,arguments)}},Fe.cacheSignal=function(){return null},Fe.cloneElement=function(R,X,ae){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var he=_({},R.props),de=R.key;if(X!=null)for(ve in X.key!==void 0&&(de=""+X.key),X)!A.call(X,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&X.ref===void 0||(he[ve]=X[ve]);var ve=arguments.length-2;if(ve===1)he.children=ae;else if(1<ve){for(var be=Array(ve),je=0;je<ve;je++)be[je]=arguments[je+2];he.children=be}return $(R.type,de,he)},Fe.createContext=function(R){return R={$$typeof:c,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:l,_context:R},R},Fe.createElement=function(R,X,ae){var he,de={},ve=null;if(X!=null)for(he in X.key!==void 0&&(ve=""+X.key),X)A.call(X,he)&&he!=="key"&&he!=="__self"&&he!=="__source"&&(de[he]=X[he]);var be=arguments.length-2;if(be===1)de.children=ae;else if(1<be){for(var je=Array(be),se=0;se<be;se++)je[se]=arguments[se+2];de.children=je}if(R&&R.defaultProps)for(he in be=R.defaultProps,be)de[he]===void 0&&(de[he]=be[he]);return $(R,ve,de)},Fe.createRef=function(){return{current:null}},Fe.forwardRef=function(R){return{$$typeof:f,render:R}},Fe.isValidElement=Y,Fe.lazy=function(R){return{$$typeof:g,_payload:{_status:-1,_result:R},_init:ie}},Fe.memo=function(R,X){return{$$typeof:d,type:R,compare:X===void 0?null:X}},Fe.startTransition=function(R){var X=U.T,ae={};U.T=ae;try{var he=R(),de=U.S;de!==null&&de(ae,he),typeof he=="object"&&he!==null&&typeof he.then=="function"&&he.then(N,ue)}catch(ve){ue(ve)}finally{X!==null&&ae.types!==null&&(X.types=ae.types),U.T=X}},Fe.unstable_useCacheRefresh=function(){return U.H.useCacheRefresh()},Fe.use=function(R){return U.H.use(R)},Fe.useActionState=function(R,X,ae){return U.H.useActionState(R,X,ae)},Fe.useCallback=function(R,X){return U.H.useCallback(R,X)},Fe.useContext=function(R){return U.H.useContext(R)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(R,X){return U.H.useDeferredValue(R,X)},Fe.useEffect=function(R,X){return U.H.useEffect(R,X)},Fe.useEffectEvent=function(R){return U.H.useEffectEvent(R)},Fe.useId=function(){return U.H.useId()},Fe.useImperativeHandle=function(R,X,ae){return U.H.useImperativeHandle(R,X,ae)},Fe.useInsertionEffect=function(R,X){return U.H.useInsertionEffect(R,X)},Fe.useLayoutEffect=function(R,X){return U.H.useLayoutEffect(R,X)},Fe.useMemo=function(R,X){return U.H.useMemo(R,X)},Fe.useOptimistic=function(R,X){return U.H.useOptimistic(R,X)},Fe.useReducer=function(R,X,ae){return U.H.useReducer(R,X,ae)},Fe.useRef=function(R){return U.H.useRef(R)},Fe.useState=function(R){return U.H.useState(R)},Fe.useSyncExternalStore=function(R,X,ae){return U.H.useSyncExternalStore(R,X,ae)},Fe.useTransition=function(){return U.H.useTransition()},Fe.version="19.2.7",Fe}var Vv;function gm(){return Vv||(Vv=1,nh.exports=FS()),nh.exports}var M=gm();const PS=$S(M);var ih={exports:{}},il={},rh={exports:{}},ah={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var Zv;function VS(){return Zv||(Zv=1,(function(e){function t(D,V){var ie=D.length;D.push(V);e:for(;0<ie;){var ue=ie-1>>>1,J=D[ue];if(0<s(J,V))D[ue]=V,D[ie]=J,ie=ue;else break e}}function i(D){return D.length===0?null:D[0]}function r(D){if(D.length===0)return null;var V=D[0],ie=D.pop();if(ie!==V){D[0]=ie;e:for(var ue=0,J=D.length,R=J>>>1;ue<R;){var X=2*(ue+1)-1,ae=D[X],he=X+1,de=D[he];if(0>s(ae,ie))he<J&&0>s(de,ae)?(D[ue]=de,D[he]=ie,ue=he):(D[ue]=ae,D[X]=ie,ue=X);else if(he<J&&0>s(de,ie))D[ue]=de,D[he]=ie,ue=he;else break e}}return V}function s(D,V){var ie=D.sortIndex-V.sortIndex;return ie!==0?ie:D.id-V.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var h=[],d=[],g=1,v=null,y=3,x=!1,S=!1,_=!1,T=!1,E=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function B(D){for(var V=i(d);V!==null;){if(V.callback===null)r(d);else if(V.startTime<=D)r(d),V.sortIndex=V.expirationTime,t(h,V);else break;V=i(d)}}function P(D){if(_=!1,B(D),!S)if(i(h)!==null)S=!0,N||(N=!0,O());else{var V=i(d);V!==null&&K(P,V.startTime-D)}}var N=!1,U=-1,A=5,$=-1;function I(){return T?!0:!(e.unstable_now()-$<A)}function Y(){if(T=!1,N){var D=e.unstable_now();$=D;var V=!0;try{e:{S=!1,_&&(_=!1,C(U),U=-1),x=!0;var ie=y;try{t:{for(B(D),v=i(h);v!==null&&!(v.expirationTime>D&&I());){var ue=v.callback;if(typeof ue=="function"){v.callback=null,y=v.priorityLevel;var J=ue(v.expirationTime<=D);if(D=e.unstable_now(),typeof J=="function"){v.callback=J,B(D),V=!0;break t}v===i(h)&&r(h),B(D)}else r(h);v=i(h)}if(v!==null)V=!0;else{var R=i(d);R!==null&&K(P,R.startTime-D),V=!1}}break e}finally{v=null,y=ie,x=!1}V=void 0}}finally{V?O():N=!1}}}var O;if(typeof k=="function")O=function(){k(Y)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,L=j.port2;j.port1.onmessage=Y,O=function(){L.postMessage(null)}}else O=function(){E(Y,0)};function K(D,V){U=E(function(){D(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(D){switch(y){case 1:case 2:case 3:var V=3;break;default:V=y}var ie=y;y=V;try{return D()}finally{y=ie}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(D,V){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var ie=y;y=D;try{return V()}finally{y=ie}},e.unstable_scheduleCallback=function(D,V,ie){var ue=e.unstable_now();switch(typeof ie=="object"&&ie!==null?(ie=ie.delay,ie=typeof ie=="number"&&0<ie?ue+ie:ue):ie=ue,D){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=ie+J,D={id:g++,callback:V,priorityLevel:D,startTime:ie,expirationTime:J,sortIndex:-1},ie>ue?(D.sortIndex=ie,t(d,D),i(h)===null&&D===i(d)&&(_?(C(U),U=-1):_=!0,K(P,ie-ue))):(D.sortIndex=J,t(h,D),S||x||(S=!0,N||(N=!0,O()))),D},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(D){var V=y;return function(){var ie=y;y=V;try{return D.apply(this,arguments)}finally{y=ie}}}})(ah)),ah}var Iv;function ZS(){return Iv||(Iv=1,rh.exports=VS()),rh.exports}var sh={exports:{}},Xn={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Xv;function IS(){if(Xv)return Xn;Xv=1;var e=gm();function t(h){var d="https://react.dev/errors/"+h;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)d+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+h+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var r={d:{f:i,r:function(){throw Error(t(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},s=Symbol.for("react.portal");function l(h,d,g){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:v==null?null:""+v,children:h,containerInfo:d,implementation:g}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,d){if(h==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Xn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Xn.createPortal=function(h,d){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return l(h,d,null,g)},Xn.flushSync=function(h){var d=c.T,g=r.p;try{if(c.T=null,r.p=2,h)return h()}finally{c.T=d,r.p=g,r.d.f()}},Xn.preconnect=function(h,d){typeof h=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(h,d))},Xn.prefetchDNS=function(h){typeof h=="string"&&r.d.D(h)},Xn.preinit=function(h,d){if(typeof h=="string"&&d&&typeof d.as=="string"){var g=d.as,v=f(g,d.crossOrigin),y=typeof d.integrity=="string"?d.integrity:void 0,x=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;g==="style"?r.d.S(h,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:v,integrity:y,fetchPriority:x}):g==="script"&&r.d.X(h,{crossOrigin:v,integrity:y,fetchPriority:x,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Xn.preinitModule=function(h,d){if(typeof h=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var g=f(d.as,d.crossOrigin);r.d.M(h,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(h)},Xn.preload=function(h,d){if(typeof h=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var g=d.as,v=f(g,d.crossOrigin);r.d.L(h,g,{crossOrigin:v,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Xn.preloadModule=function(h,d){if(typeof h=="string")if(d){var g=f(d.as,d.crossOrigin);r.d.m(h,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(h)},Xn.requestFormReset=function(h){r.d.r(h)},Xn.unstable_batchedUpdates=function(h,d){return h(d)},Xn.useFormState=function(h,d,g){return c.H.useFormState(h,d,g)},Xn.useFormStatus=function(){return c.H.useHostTransitionStatus()},Xn.version="19.2.7",Xn}var qv;function zb(){if(qv)return sh.exports;qv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),sh.exports=IS(),sh.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var Wv;function XS(){if(Wv)return il;Wv=1;var e=ZS(),t=gm(),i=zb();function r(n){var a="https://react.dev/errors/"+n;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)a+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+n+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function l(n){var a=n,o=n;if(n.alternate)for(;a.return;)a=a.return;else{n=a;do a=n,(a.flags&4098)!==0&&(o=a.return),n=a.return;while(n)}return a.tag===3?o:null}function c(n){if(n.tag===13){var a=n.memoizedState;if(a===null&&(n=n.alternate,n!==null&&(a=n.memoizedState)),a!==null)return a.dehydrated}return null}function f(n){if(n.tag===31){var a=n.memoizedState;if(a===null&&(n=n.alternate,n!==null&&(a=n.memoizedState)),a!==null)return a.dehydrated}return null}function h(n){if(l(n)!==n)throw Error(r(188))}function d(n){var a=n.alternate;if(!a){if(a=l(n),a===null)throw Error(r(188));return a!==n?null:n}for(var o=n,u=a;;){var m=o.return;if(m===null)break;var p=m.alternate;if(p===null){if(u=m.return,u!==null){o=u;continue}break}if(m.child===p.child){for(p=m.child;p;){if(p===o)return h(m),n;if(p===u)return h(m),a;p=p.sibling}throw Error(r(188))}if(o.return!==u.return)o=m,u=p;else{for(var w=!1,z=m.child;z;){if(z===o){w=!0,o=m,u=p;break}if(z===u){w=!0,u=m,o=p;break}z=z.sibling}if(!w){for(z=p.child;z;){if(z===o){w=!0,o=p,u=m;break}if(z===u){w=!0,u=p,o=m;break}z=z.sibling}if(!w)throw Error(r(189))}}if(o.alternate!==u)throw Error(r(190))}if(o.tag!==3)throw Error(r(188));return o.stateNode.current===o?n:a}function g(n){var a=n.tag;if(a===5||a===26||a===27||a===6)return n;for(n=n.child;n!==null;){if(a=g(n),a!==null)return a;n=n.sibling}return null}var v=Object.assign,y=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),k=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),Y=Symbol.iterator;function O(n){return n===null||typeof n!="object"?null:(n=Y&&n[Y]||n["@@iterator"],typeof n=="function"?n:null)}var j=Symbol.for("react.client.reference");function L(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===j?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case _:return"Fragment";case E:return"Profiler";case T:return"StrictMode";case P:return"Suspense";case N:return"SuspenseList";case $:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case S:return"Portal";case k:return n.displayName||"Context";case C:return(n._context.displayName||"Context")+".Consumer";case B:var a=n.render;return n=n.displayName,n||(n=a.displayName||a.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case U:return a=n.displayName||null,a!==null?a:L(n.type)||"Memo";case A:a=n._payload,n=n._init;try{return L(n(a))}catch{}}return null}var K=Array.isArray,D=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie={pending:!1,data:null,method:null,action:null},ue=[],J=-1;function R(n){return{current:n}}function X(n){0>J||(n.current=ue[J],ue[J]=null,J--)}function ae(n,a){J++,ue[J]=n.current,n.current=a}var he=R(null),de=R(null),ve=R(null),be=R(null);function je(n,a){switch(ae(ve,a),ae(de,n),ae(he,null),a.nodeType){case 9:case 11:n=(n=a.documentElement)&&(n=n.namespaceURI)?fv(n):0;break;default:if(n=a.tagName,a=a.namespaceURI)a=fv(a),n=dv(a,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}X(he),ae(he,n)}function se(){X(he),X(de),X(ve)}function Ee(n){n.memoizedState!==null&&ae(be,n);var a=he.current,o=dv(a,n.type);a!==o&&(ae(de,n),ae(he,o))}function ze(n){de.current===n&&(X(he),X(de)),be.current===n&&(X(be),Qo._currentValue=ie)}var fe,dt;function Ue(n){if(fe===void 0)try{throw Error()}catch(o){var a=o.stack.trim().match(/\n( *(at )?)/);fe=a&&a[1]||"",dt=-1<o.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+fe+n+dt}var ht=!1;function ut(n,a){if(!n||ht)return"";ht=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(a){var ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(ne){var Q=ne}Reflect.construct(n,[],ce)}else{try{ce.call()}catch(ne){Q=ne}n.call(ce.prototype)}}else{try{throw Error()}catch(ne){Q=ne}(ce=n())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(ne){if(ne&&Q&&typeof ne.stack=="string")return[ne.stack,Q.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=u.DetermineComponentFrameRoot(),w=p[0],z=p[1];if(w&&z){var H=w.split(`
44
+ `),W=z.split(`
45
+ `);for(m=u=0;u<H.length&&!H[u].includes("DetermineComponentFrameRoot");)u++;for(;m<W.length&&!W[m].includes("DetermineComponentFrameRoot");)m++;if(u===H.length||m===W.length)for(u=H.length-1,m=W.length-1;1<=u&&0<=m&&H[u]!==W[m];)m--;for(;1<=u&&0<=m;u--,m--)if(H[u]!==W[m]){if(u!==1||m!==1)do if(u--,m--,0>m||H[u]!==W[m]){var re=`
46
+ `+H[u].replace(" at new "," at ");return n.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",n.displayName)),re}while(1<=u&&0<=m);break}}}finally{ht=!1,Error.prepareStackTrace=o}return(o=n?n.displayName||n.name:"")?Ue(o):""}function qt(n,a){switch(n.tag){case 26:case 27:case 5:return Ue(n.type);case 16:return Ue("Lazy");case 13:return n.child!==a&&a!==null?Ue("Suspense Fallback"):Ue("Suspense");case 19:return Ue("SuspenseList");case 0:case 15:return ut(n.type,!1);case 11:return ut(n.type.render,!1);case 1:return ut(n.type,!0);case 31:return Ue("Activity");default:return""}}function yi(n){try{var a="",o=null;do a+=qt(n,o),o=n,n=n.return;while(n);return a}catch(u){return`
47
+ Error generating stack: `+u.message+`
48
+ `+u.stack}}var Tn=Object.prototype.hasOwnProperty,vn=e.unstable_scheduleCallback,Di=e.unstable_cancelCallback,bi=e.unstable_shouldYield,or=e.unstable_requestPaint,Zt=e.unstable_now,ta=e.unstable_getCurrentPriorityLevel,En=e.unstable_ImmediatePriority,Kn=e.unstable_UserBlockingPriority,on=e.unstable_NormalPriority,De=e.unstable_LowPriority,ee=e.unstable_IdlePriority,ge=e.log,F=e.unstable_setDisableYieldValue,pe=null,me=null;function ye(n){if(typeof ge=="function"&&F(n),me&&typeof me.setStrictMode=="function")try{me.setStrictMode(pe,n)}catch{}}var We=Math.clz32?Math.clz32:zn,yn=Math.log,Ge=Math.LN2;function zn(n){return n>>>=0,n===0?32:31-(yn(n)/Ge|0)|0}var Ut=256,xi=262144,Ie=4194304;function Oi(n){var a=n&42;if(a!==0)return a;switch(n&-n){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Dt(n,a,o){var u=n.pendingLanes;if(u===0)return 0;var m=0,p=n.suspendedLanes,w=n.pingedLanes;n=n.warmLanes;var z=u&134217727;return z!==0?(u=z&~p,u!==0?m=Oi(u):(w&=z,w!==0?m=Oi(w):o||(o=z&~n,o!==0&&(m=Oi(o))))):(z=u&~p,z!==0?m=Oi(z):w!==0?m=Oi(w):o||(o=u&~n,o!==0&&(m=Oi(o)))),m===0?0:a!==0&&a!==m&&(a&p)===0&&(p=m&-m,o=a&-a,p>=o||p===32&&(o&4194048)!==0)?a:m}function Le(n,a){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&a)===0}function oi(n,a){switch(n){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32: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 a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function He(){var n=Ie;return Ie<<=1,(Ie&62914560)===0&&(Ie=4194304),n}function mt(n){for(var a=[],o=0;31>o;o++)a.push(n);return a}function Ve(n,a){n.pendingLanes|=a,a!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function ji(n,a,o,u,m,p){var w=n.pendingLanes;n.pendingLanes=o,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=o,n.entangledLanes&=o,n.errorRecoveryDisabledLanes&=o,n.shellSuspendCounter=0;var z=n.entanglements,H=n.expirationTimes,W=n.hiddenUpdates;for(o=w&~o;0<o;){var re=31-We(o),ce=1<<re;z[re]=0,H[re]=-1;var Q=W[re];if(Q!==null)for(W[re]=null,re=0;re<Q.length;re++){var ne=Q[re];ne!==null&&(ne.lane&=-536870913)}o&=~ce}u!==0&&gs(n,u,0),p!==0&&m===0&&n.tag!==0&&(n.suspendedLanes|=p&~(w&~a))}function gs(n,a,o){n.pendingLanes|=a,n.suspendedLanes&=~a;var u=31-We(a);n.entangledLanes|=a,n.entanglements[u]=n.entanglements[u]|1073741824|o&261930}function Qn(n,a){var o=n.entangledLanes|=a;for(n=n.entanglements;o;){var u=31-We(o),m=1<<u;m&a|n[u]&a&&(n[u]|=a),o&=~m}}function lr(n,a){var o=a&-a;return o=(o&42)!==0?1:Mn(o),(o&(n.suspendedLanes|a))!==0?0:o}function Mn(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function Pn(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function Xi(){var n=V.p;return n!==0?n:(n=window.event,n===void 0?32:jv(n.type))}function po(n,a){var o=V.p;try{return V.p=n,a()}finally{V.p=o}}var qi=Math.random().toString(36).slice(2),ln="__reactFiber$"+qi,On="__reactProps$"+qi,wr="__reactContainer$"+qi,ps="__reactEvents$"+qi,jl="__reactListeners$"+qi,Ll="__reactHandles$"+qi,vo="__reactResources$"+qi,na="__reactMarker$"+qi;function vs(n){delete n[ln],delete n[On],delete n[ps],delete n[jl],delete n[Ll]}function _r(n){var a=n[ln];if(a)return a;for(var o=n.parentNode;o;){if(a=o[wr]||o[ln]){if(o=a.alternate,a.child!==null||o!==null&&o.child!==null)for(n=bv(n);n!==null;){if(o=n[ln])return o;n=bv(n)}return a}n=o,o=n.parentNode}return null}function Sr(n){if(n=n[ln]||n[wr]){var a=n.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return n}return null}function ia(n){var a=n.tag;if(a===5||a===26||a===27||a===6)return n.stateNode;throw Error(r(33))}function Tr(n){var a=n[vo];return a||(a=n[vo]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function tn(n){n[na]=!0}var Be=new Set,Ot={};function $e(n,a){gt(n,a),gt(n+"Capture",a)}function gt(n,a){for(Ot[n]=a,n=0;n<a.length;n++)Be.add(a[n])}var Cn=RegExp("^[: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]*$"),jn={},Pe={};function cn(n){return Tn.call(Pe,n)?!0:Tn.call(jn,n)?!1:Cn.test(n)?Pe[n]=!0:(jn[n]=!0,!1)}function Ht(n,a,o){if(cn(a))if(o===null)n.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":n.removeAttribute(a);return;case"boolean":var u=a.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){n.removeAttribute(a);return}}n.setAttribute(a,""+o)}}function It(n,a,o){if(o===null)n.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(a);return}n.setAttribute(a,""+o)}}function wt(n,a,o,u){if(u===null)n.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(o);return}n.setAttributeNS(a,o,""+u)}}function nn(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Vn(n){var a=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function Ln(n,a,o){var u=Object.getOwnPropertyDescriptor(n.constructor.prototype,a);if(!n.hasOwnProperty(a)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var m=u.get,p=u.set;return Object.defineProperty(n,a,{configurable:!0,get:function(){return m.call(this)},set:function(w){o=""+w,p.call(this,w)}}),Object.defineProperty(n,a,{enumerable:u.enumerable}),{getValue:function(){return o},setValue:function(w){o=""+w},stopTracking:function(){n._valueTracker=null,delete n[a]}}}}function Wi(n){if(!n._valueTracker){var a=Vn(n)?"checked":"value";n._valueTracker=Ln(n,a,""+n[a])}}function Bt(n){if(!n)return!1;var a=n._valueTracker;if(!a)return!0;var o=a.getValue(),u="";return n&&(u=Vn(n)?n.checked?"true":"false":n.value),n=u,n!==o?(a.setValue(n),!0):!1}function Zn(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var ra=/[\n"\\]/g;function Nt(n){return n.replace(ra,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function un(n,a,o,u,m,p,w,z){n.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?n.type=w:n.removeAttribute("type"),a!=null?w==="number"?(a===0&&n.value===""||n.value!=a)&&(n.value=""+nn(a)):n.value!==""+nn(a)&&(n.value=""+nn(a)):w!=="submit"&&w!=="reset"||n.removeAttribute("value"),a!=null?An(n,w,nn(a)):o!=null?An(n,w,nn(o)):u!=null&&n.removeAttribute("value"),m==null&&p!=null&&(n.defaultChecked=!!p),m!=null&&(n.checked=m&&typeof m!="function"&&typeof m!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?n.name=""+nn(z):n.removeAttribute("name")}function fn(n,a,o,u,m,p,w,z){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(n.type=p),a!=null||o!=null){if(!(p!=="submit"&&p!=="reset"||a!=null)){Wi(n);return}o=o!=null?""+nn(o):"",a=a!=null?""+nn(a):o,z||a===n.value||(n.value=a),n.defaultValue=a}u=u??m,u=typeof u!="function"&&typeof u!="symbol"&&!!u,n.checked=z?n.checked:!!u,n.defaultChecked=!!u,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(n.name=w),Wi(n)}function An(n,a,o){a==="number"&&Zn(n.ownerDocument)===n||n.defaultValue===""+o||(n.defaultValue=""+o)}function Un(n,a,o,u){if(n=n.options,a){a={};for(var m=0;m<o.length;m++)a["$"+o[m]]=!0;for(o=0;o<n.length;o++)m=a.hasOwnProperty("$"+n[o].value),n[o].selected!==m&&(n[o].selected=m),m&&u&&(n[o].defaultSelected=!0)}else{for(o=""+nn(o),a=null,m=0;m<n.length;m++){if(n[m].value===o){n[m].selected=!0,u&&(n[m].defaultSelected=!0);return}a!==null||n[m].disabled||(a=n[m])}a!==null&&(a.selected=!0)}}function Hn(n,a,o){if(a!=null&&(a=""+nn(a),a!==n.value&&(n.value=a),o==null)){n.defaultValue!==a&&(n.defaultValue=a);return}n.defaultValue=o!=null?""+nn(o):""}function Jn(n,a,o,u){if(a==null){if(u!=null){if(o!=null)throw Error(r(92));if(K(u)){if(1<u.length)throw Error(r(93));u=u[0]}o=u}o==null&&(o=""),a=o}o=nn(a),n.defaultValue=o,u=n.textContent,u===o&&u!==""&&u!==null&&(n.value=u),Wi(n)}function ei(n,a){if(a){var o=n.firstChild;if(o&&o===n.lastChild&&o.nodeType===3){o.nodeValue=a;return}}n.textContent=a}var cr=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function ur(n,a,o){var u=a.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?u?n.setProperty(a,""):a==="float"?n.cssFloat="":n[a]="":u?n.setProperty(a,o):typeof o!="number"||o===0||cr.has(a)?a==="float"?n.cssFloat=o:n[a]=(""+o).trim():n[a]=o+"px"}function Yt(n,a,o){if(a!=null&&typeof a!="object")throw Error(r(62));if(n=n.style,o!=null){for(var u in o)!o.hasOwnProperty(u)||a!=null&&a.hasOwnProperty(u)||(u.indexOf("--")===0?n.setProperty(u,""):u==="float"?n.cssFloat="":n[u]="");for(var m in a)u=a[m],a.hasOwnProperty(m)&&o[m]!==u&&ur(n,m,u)}else for(var p in a)a.hasOwnProperty(p)&&ur(n,p,a[p])}function Li(n){if(n.indexOf("-")===-1)return!1;switch(n){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 Er=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Ki=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Rt(n){return Ki.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function jt(){}var pt=null;function Ae(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Ye=null,yt=null;function Wt(n){var a=Sr(n);if(a&&(n=a.stateNode)){var o=n[On]||null;e:switch(n=a.stateNode,a.type){case"input":if(un(n,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),a=o.name,o.type==="radio"&&a!=null){for(o=n;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Nt(""+a)+'"][type="radio"]'),a=0;a<o.length;a++){var u=o[a];if(u!==n&&u.form===n.form){var m=u[On]||null;if(!m)throw Error(r(90));un(u,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(a=0;a<o.length;a++)u=o[a],u.form===n.form&&Bt(u)}break e;case"textarea":Hn(n,o.value,o.defaultValue);break e;case"select":a=o.value,a!=null&&Un(n,!!o.multiple,a,!1)}}}var bn=!1;function wi(n,a,o){if(bn)return n(a,o);bn=!0;try{var u=n(a);return u}finally{if(bn=!1,(Ye!==null||yt!==null)&&(bc(),Ye&&(a=Ye,n=yt,yt=Ye=null,Wt(a),n)))for(a=0;a<n.length;a++)Wt(n[a])}}function vt(n,a){var o=n.stateNode;if(o===null)return null;var u=o[On]||null;if(u===null)return null;o=u[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(n=n.type,u=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!u;break e;default:n=!1}if(n)return null;if(o&&typeof o!="function")throw Error(r(231,a,typeof o));return o}var Nn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_t=!1;if(Nn)try{var In={};Object.defineProperty(In,"passive",{get:function(){_t=!0}}),window.addEventListener("test",In,In),window.removeEventListener("test",In,In)}catch{_t=!1}var _i=null,Se=null,Ne=null;function dn(){if(Ne)return Ne;var n,a=Se,o=a.length,u,m="value"in _i?_i.value:_i.textContent,p=m.length;for(n=0;n<o&&a[n]===m[n];n++);var w=o-n;for(u=1;u<=w&&a[o-u]===m[p-u];u++);return Ne=m.slice(n,1<u?1-u:void 0)}function Ke(n){var a=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&a===13&&(n=13)):n=a,n===10&&(n=13),32<=n||n===13?n:0}function rn(){return!0}function aa(){return!1}function xn(n){function a(o,u,m,p,w){this._reactName=o,this._targetInst=m,this.type=u,this.nativeEvent=p,this.target=w,this.currentTarget=null;for(var z in n)n.hasOwnProperty(z)&&(o=n[z],this[z]=o?o(p):p[z]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?rn:aa,this.isPropagationStopped=aa,this}return v(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=rn)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=rn)},persist:function(){},isPersistent:rn}),a}var fr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},La=xn(fr),Ua=v({},fr,{view:0,detail:0}),Lw=xn(Ua),nf,rf,yo,Ul=v({},Ua,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:sf,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==yo&&(yo&&n.type==="mousemove"?(nf=n.screenX-yo.screenX,rf=n.screenY-yo.screenY):rf=nf=0,yo=n),nf)},movementY:function(n){return"movementY"in n?n.movementY:rf}}),m0=xn(Ul),Uw=v({},Ul,{dataTransfer:0}),Hw=xn(Uw),Bw=v({},Ua,{relatedTarget:0}),af=xn(Bw),$w=v({},fr,{animationName:0,elapsedTime:0,pseudoElement:0}),Gw=xn($w),Yw=v({},fr,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),Fw=xn(Yw),Pw=v({},fr,{data:0}),g0=xn(Pw),Vw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Zw={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Iw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Xw(n){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(n):(n=Iw[n])?!!a[n]:!1}function sf(){return Xw}var qw=v({},Ua,{key:function(n){if(n.key){var a=Vw[n.key]||n.key;if(a!=="Unidentified")return a}return n.type==="keypress"?(n=Ke(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?Zw[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:sf,charCode:function(n){return n.type==="keypress"?Ke(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Ke(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),Ww=xn(qw),Kw=v({},Ul,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),p0=xn(Kw),Qw=v({},Ua,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:sf}),Jw=xn(Qw),e_=v({},fr,{propertyName:0,elapsedTime:0,pseudoElement:0}),t_=xn(e_),n_=v({},Ul,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),i_=xn(n_),r_=v({},fr,{newState:0,oldState:0}),a_=xn(r_),s_=[9,13,27,32],of=Nn&&"CompositionEvent"in window,bo=null;Nn&&"documentMode"in document&&(bo=document.documentMode);var o_=Nn&&"TextEvent"in window&&!bo,v0=Nn&&(!of||bo&&8<bo&&11>=bo),y0=" ",b0=!1;function x0(n,a){switch(n){case"keyup":return s_.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function w0(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var ys=!1;function l_(n,a){switch(n){case"compositionend":return w0(a);case"keypress":return a.which!==32?null:(b0=!0,y0);case"textInput":return n=a.data,n===y0&&b0?null:n;default:return null}}function c_(n,a){if(ys)return n==="compositionend"||!of&&x0(n,a)?(n=dn(),Ne=Se=_i=null,ys=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return v0&&a.locale!=="ko"?null:a.data;default:return null}}var u_={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function _0(n){var a=n&&n.nodeName&&n.nodeName.toLowerCase();return a==="input"?!!u_[n.type]:a==="textarea"}function S0(n,a,o,u){Ye?yt?yt.push(u):yt=[u]:Ye=u,a=zc(a,"onChange"),0<a.length&&(o=new La("onChange","change",null,o,u),n.push({event:o,listeners:a}))}var xo=null,wo=null;function f_(n){av(n,0)}function Hl(n){var a=ia(n);if(Bt(a))return n}function T0(n,a){if(n==="change")return a}var E0=!1;if(Nn){var lf;if(Nn){var cf="oninput"in document;if(!cf){var z0=document.createElement("div");z0.setAttribute("oninput","return;"),cf=typeof z0.oninput=="function"}lf=cf}else lf=!1;E0=lf&&(!document.documentMode||9<document.documentMode)}function M0(){xo&&(xo.detachEvent("onpropertychange",C0),wo=xo=null)}function C0(n){if(n.propertyName==="value"&&Hl(wo)){var a=[];S0(a,wo,n,Ae(n)),wi(f_,a)}}function d_(n,a,o){n==="focusin"?(M0(),xo=a,wo=o,xo.attachEvent("onpropertychange",C0)):n==="focusout"&&M0()}function h_(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Hl(wo)}function m_(n,a){if(n==="click")return Hl(a)}function g_(n,a){if(n==="input"||n==="change")return Hl(a)}function p_(n,a){return n===a&&(n!==0||1/n===1/a)||n!==n&&a!==a}var Si=typeof Object.is=="function"?Object.is:p_;function _o(n,a){if(Si(n,a))return!0;if(typeof n!="object"||n===null||typeof a!="object"||a===null)return!1;var o=Object.keys(n),u=Object.keys(a);if(o.length!==u.length)return!1;for(u=0;u<o.length;u++){var m=o[u];if(!Tn.call(a,m)||!Si(n[m],a[m]))return!1}return!0}function A0(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function N0(n,a){var o=A0(n);n=0;for(var u;o;){if(o.nodeType===3){if(u=n+o.textContent.length,n<=a&&u>=a)return{node:o,offset:a-n};n=u}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=A0(o)}}function R0(n,a){return n&&a?n===a?!0:n&&n.nodeType===3?!1:a&&a.nodeType===3?R0(n,a.parentNode):"contains"in n?n.contains(a):n.compareDocumentPosition?!!(n.compareDocumentPosition(a)&16):!1:!1}function k0(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var a=Zn(n.document);a instanceof n.HTMLIFrameElement;){try{var o=typeof a.contentWindow.location.href=="string"}catch{o=!1}if(o)n=a.contentWindow;else break;a=Zn(n.document)}return a}function uf(n){var a=n&&n.nodeName&&n.nodeName.toLowerCase();return a&&(a==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||a==="textarea"||n.contentEditable==="true")}var v_=Nn&&"documentMode"in document&&11>=document.documentMode,bs=null,ff=null,So=null,df=!1;function D0(n,a,o){var u=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;df||bs==null||bs!==Zn(u)||(u=bs,"selectionStart"in u&&uf(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),So&&_o(So,u)||(So=u,u=zc(ff,"onSelect"),0<u.length&&(a=new La("onSelect","select",null,a,o),n.push({event:a,listeners:u}),a.target=bs)))}function Ha(n,a){var o={};return o[n.toLowerCase()]=a.toLowerCase(),o["Webkit"+n]="webkit"+a,o["Moz"+n]="moz"+a,o}var xs={animationend:Ha("Animation","AnimationEnd"),animationiteration:Ha("Animation","AnimationIteration"),animationstart:Ha("Animation","AnimationStart"),transitionrun:Ha("Transition","TransitionRun"),transitionstart:Ha("Transition","TransitionStart"),transitioncancel:Ha("Transition","TransitionCancel"),transitionend:Ha("Transition","TransitionEnd")},hf={},O0={};Nn&&(O0=document.createElement("div").style,"AnimationEvent"in window||(delete xs.animationend.animation,delete xs.animationiteration.animation,delete xs.animationstart.animation),"TransitionEvent"in window||delete xs.transitionend.transition);function Ba(n){if(hf[n])return hf[n];if(!xs[n])return n;var a=xs[n],o;for(o in a)if(a.hasOwnProperty(o)&&o in O0)return hf[n]=a[o];return n}var j0=Ba("animationend"),L0=Ba("animationiteration"),U0=Ba("animationstart"),y_=Ba("transitionrun"),b_=Ba("transitionstart"),x_=Ba("transitioncancel"),H0=Ba("transitionend"),B0=new Map,mf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");mf.push("scrollEnd");function Qi(n,a){B0.set(n,a),$e(a,[n])}var Bl=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Ui=[],ws=0,gf=0;function $l(){for(var n=ws,a=gf=ws=0;a<n;){var o=Ui[a];Ui[a++]=null;var u=Ui[a];Ui[a++]=null;var m=Ui[a];Ui[a++]=null;var p=Ui[a];if(Ui[a++]=null,u!==null&&m!==null){var w=u.pending;w===null?m.next=m:(m.next=w.next,w.next=m),u.pending=m}p!==0&&$0(o,m,p)}}function Gl(n,a,o,u){Ui[ws++]=n,Ui[ws++]=a,Ui[ws++]=o,Ui[ws++]=u,gf|=u,n.lanes|=u,n=n.alternate,n!==null&&(n.lanes|=u)}function pf(n,a,o,u){return Gl(n,a,o,u),Yl(n)}function $a(n,a){return Gl(n,null,null,a),Yl(n)}function $0(n,a,o){n.lanes|=o;var u=n.alternate;u!==null&&(u.lanes|=o);for(var m=!1,p=n.return;p!==null;)p.childLanes|=o,u=p.alternate,u!==null&&(u.childLanes|=o),p.tag===22&&(n=p.stateNode,n===null||n._visibility&1||(m=!0)),n=p,p=p.return;return n.tag===3?(p=n.stateNode,m&&a!==null&&(m=31-We(o),n=p.hiddenUpdates,u=n[m],u===null?n[m]=[a]:u.push(a),a.lane=o|536870912),p):null}function Yl(n){if(50<Vo)throw Vo=0,Ed=null,Error(r(185));for(var a=n.return;a!==null;)n=a,a=n.return;return n.tag===3?n.stateNode:null}var _s={};function w_(n,a,o,u){this.tag=n,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ti(n,a,o,u){return new w_(n,a,o,u)}function vf(n){return n=n.prototype,!(!n||!n.isReactComponent)}function zr(n,a){var o=n.alternate;return o===null?(o=Ti(n.tag,a,n.key,n.mode),o.elementType=n.elementType,o.type=n.type,o.stateNode=n.stateNode,o.alternate=n,n.alternate=o):(o.pendingProps=a,o.type=n.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=n.flags&65011712,o.childLanes=n.childLanes,o.lanes=n.lanes,o.child=n.child,o.memoizedProps=n.memoizedProps,o.memoizedState=n.memoizedState,o.updateQueue=n.updateQueue,a=n.dependencies,o.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},o.sibling=n.sibling,o.index=n.index,o.ref=n.ref,o.refCleanup=n.refCleanup,o}function G0(n,a){n.flags&=65011714;var o=n.alternate;return o===null?(n.childLanes=0,n.lanes=a,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=o.childLanes,n.lanes=o.lanes,n.child=o.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=o.memoizedProps,n.memoizedState=o.memoizedState,n.updateQueue=o.updateQueue,n.type=o.type,a=o.dependencies,n.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),n}function Fl(n,a,o,u,m,p){var w=0;if(u=n,typeof n=="function")vf(n)&&(w=1);else if(typeof n=="string")w=zS(n,o,he.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case $:return n=Ti(31,o,a,m),n.elementType=$,n.lanes=p,n;case _:return Ga(o.children,m,p,a);case T:w=8,m|=24;break;case E:return n=Ti(12,o,a,m|2),n.elementType=E,n.lanes=p,n;case P:return n=Ti(13,o,a,m),n.elementType=P,n.lanes=p,n;case N:return n=Ti(19,o,a,m),n.elementType=N,n.lanes=p,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case k:w=10;break e;case C:w=9;break e;case B:w=11;break e;case U:w=14;break e;case A:w=16,u=null;break e}w=29,o=Error(r(130,n===null?"null":typeof n,"")),u=null}return a=Ti(w,o,a,m),a.elementType=n,a.type=u,a.lanes=p,a}function Ga(n,a,o,u){return n=Ti(7,n,u,a),n.lanes=o,n}function yf(n,a,o){return n=Ti(6,n,null,a),n.lanes=o,n}function Y0(n){var a=Ti(18,null,null,0);return a.stateNode=n,a}function bf(n,a,o){return a=Ti(4,n.children!==null?n.children:[],n.key,a),a.lanes=o,a.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},a}var F0=new WeakMap;function Hi(n,a){if(typeof n=="object"&&n!==null){var o=F0.get(n);return o!==void 0?o:(a={value:n,source:a,stack:yi(a)},F0.set(n,a),a)}return{value:n,source:a,stack:yi(a)}}var Ss=[],Ts=0,Pl=null,To=0,Bi=[],$i=0,sa=null,dr=1,hr="";function Mr(n,a){Ss[Ts++]=To,Ss[Ts++]=Pl,Pl=n,To=a}function P0(n,a,o){Bi[$i++]=dr,Bi[$i++]=hr,Bi[$i++]=sa,sa=n;var u=dr;n=hr;var m=32-We(u)-1;u&=~(1<<m),o+=1;var p=32-We(a)+m;if(30<p){var w=m-m%5;p=(u&(1<<w)-1).toString(32),u>>=w,m-=w,dr=1<<32-We(a)+m|o<<m|u,hr=p+n}else dr=1<<p|o<<m|u,hr=n}function xf(n){n.return!==null&&(Mr(n,1),P0(n,1,0))}function wf(n){for(;n===Pl;)Pl=Ss[--Ts],Ss[Ts]=null,To=Ss[--Ts],Ss[Ts]=null;for(;n===sa;)sa=Bi[--$i],Bi[$i]=null,hr=Bi[--$i],Bi[$i]=null,dr=Bi[--$i],Bi[$i]=null}function V0(n,a){Bi[$i++]=dr,Bi[$i++]=hr,Bi[$i++]=sa,dr=a.id,hr=a.overflow,sa=n}var Bn=null,$t=null,nt=!1,oa=null,Gi=!1,_f=Error(r(519));function la(n){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Eo(Hi(a,n)),_f}function Z0(n){var a=n.stateNode,o=n.type,u=n.memoizedProps;switch(a[ln]=n,a[On]=u,o){case"dialog":Je("cancel",a),Je("close",a);break;case"iframe":case"object":case"embed":Je("load",a);break;case"video":case"audio":for(o=0;o<Io.length;o++)Je(Io[o],a);break;case"source":Je("error",a);break;case"img":case"image":case"link":Je("error",a),Je("load",a);break;case"details":Je("toggle",a);break;case"input":Je("invalid",a),fn(a,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Je("invalid",a);break;case"textarea":Je("invalid",a),Jn(a,u.value,u.defaultValue,u.children)}o=u.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||a.textContent===""+o||u.suppressHydrationWarning===!0||cv(a.textContent,o)?(u.popover!=null&&(Je("beforetoggle",a),Je("toggle",a)),u.onScroll!=null&&Je("scroll",a),u.onScrollEnd!=null&&Je("scrollend",a),u.onClick!=null&&(a.onclick=jt),a=!0):a=!1,a||la(n,!0)}function I0(n){for(Bn=n.return;Bn;)switch(Bn.tag){case 5:case 31:case 13:Gi=!1;return;case 27:case 3:Gi=!0;return;default:Bn=Bn.return}}function Es(n){if(n!==Bn)return!1;if(!nt)return I0(n),nt=!0,!1;var a=n.tag,o;if((o=a!==3&&a!==27)&&((o=a===5)&&(o=n.type,o=!(o!=="form"&&o!=="button")||$d(n.type,n.memoizedProps)),o=!o),o&&$t&&la(n),I0(n),a===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));$t=yv(n)}else if(a===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));$t=yv(n)}else a===27?(a=$t,_a(n.type)?(n=Vd,Vd=null,$t=n):$t=a):$t=Bn?Fi(n.stateNode.nextSibling):null;return!0}function Ya(){$t=Bn=null,nt=!1}function Sf(){var n=oa;return n!==null&&(fi===null?fi=n:fi.push.apply(fi,n),oa=null),n}function Eo(n){oa===null?oa=[n]:oa.push(n)}var Tf=R(null),Fa=null,Cr=null;function ca(n,a,o){ae(Tf,a._currentValue),a._currentValue=o}function Ar(n){n._currentValue=Tf.current,X(Tf)}function Ef(n,a,o){for(;n!==null;){var u=n.alternate;if((n.childLanes&a)!==a?(n.childLanes|=a,u!==null&&(u.childLanes|=a)):u!==null&&(u.childLanes&a)!==a&&(u.childLanes|=a),n===o)break;n=n.return}}function zf(n,a,o,u){var m=n.child;for(m!==null&&(m.return=n);m!==null;){var p=m.dependencies;if(p!==null){var w=m.child;p=p.firstContext;e:for(;p!==null;){var z=p;p=m;for(var H=0;H<a.length;H++)if(z.context===a[H]){p.lanes|=o,z=p.alternate,z!==null&&(z.lanes|=o),Ef(p.return,o,n),u||(w=null);break e}p=z.next}}else if(m.tag===18){if(w=m.return,w===null)throw Error(r(341));w.lanes|=o,p=w.alternate,p!==null&&(p.lanes|=o),Ef(w,o,n),w=null}else w=m.child;if(w!==null)w.return=m;else for(w=m;w!==null;){if(w===n){w=null;break}if(m=w.sibling,m!==null){m.return=w.return,w=m;break}w=w.return}m=w}}function zs(n,a,o,u){n=null;for(var m=a,p=!1;m!==null;){if(!p){if((m.flags&524288)!==0)p=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var w=m.alternate;if(w===null)throw Error(r(387));if(w=w.memoizedProps,w!==null){var z=m.type;Si(m.pendingProps.value,w.value)||(n!==null?n.push(z):n=[z])}}else if(m===be.current){if(w=m.alternate,w===null)throw Error(r(387));w.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(n!==null?n.push(Qo):n=[Qo])}m=m.return}n!==null&&zf(a,n,o,u),a.flags|=262144}function Vl(n){for(n=n.firstContext;n!==null;){if(!Si(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Pa(n){Fa=n,Cr=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function $n(n){return X0(Fa,n)}function Zl(n,a){return Fa===null&&Pa(n),X0(n,a)}function X0(n,a){var o=a._currentValue;if(a={context:a,memoizedValue:o,next:null},Cr===null){if(n===null)throw Error(r(308));Cr=a,n.dependencies={lanes:0,firstContext:a},n.flags|=524288}else Cr=Cr.next=a;return o}var __=typeof AbortController<"u"?AbortController:function(){var n=[],a=this.signal={aborted:!1,addEventListener:function(o,u){n.push(u)}};this.abort=function(){a.aborted=!0,n.forEach(function(o){return o()})}},S_=e.unstable_scheduleCallback,T_=e.unstable_NormalPriority,hn={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Mf(){return{controller:new __,data:new Map,refCount:0}}function zo(n){n.refCount--,n.refCount===0&&S_(T_,function(){n.controller.abort()})}var Mo=null,Cf=0,Ms=0,Cs=null;function E_(n,a){if(Mo===null){var o=Mo=[];Cf=0,Ms=Rd(),Cs={status:"pending",value:void 0,then:function(u){o.push(u)}}}return Cf++,a.then(q0,q0),a}function q0(){if(--Cf===0&&Mo!==null){Cs!==null&&(Cs.status="fulfilled");var n=Mo;Mo=null,Ms=0,Cs=null;for(var a=0;a<n.length;a++)(0,n[a])()}}function z_(n,a){var o=[],u={status:"pending",value:null,reason:null,then:function(m){o.push(m)}};return n.then(function(){u.status="fulfilled",u.value=a;for(var m=0;m<o.length;m++)(0,o[m])(a)},function(m){for(u.status="rejected",u.reason=m,m=0;m<o.length;m++)(0,o[m])(void 0)}),u}var W0=D.S;D.S=function(n,a){Dp=Zt(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&E_(n,a),W0!==null&&W0(n,a)};var Va=R(null);function Af(){var n=Va.current;return n!==null?n:kt.pooledCache}function Il(n,a){a===null?ae(Va,Va.current):ae(Va,a.pool)}function K0(){var n=Af();return n===null?null:{parent:hn._currentValue,pool:n}}var As=Error(r(460)),Nf=Error(r(474)),Xl=Error(r(542)),ql={then:function(){}};function Q0(n){return n=n.status,n==="fulfilled"||n==="rejected"}function J0(n,a,o){switch(o=n[o],o===void 0?n.push(a):o!==a&&(a.then(jt,jt),a=o),a.status){case"fulfilled":return a.value;case"rejected":throw n=a.reason,tg(n),n;default:if(typeof a.status=="string")a.then(jt,jt);else{if(n=kt,n!==null&&100<n.shellSuspendCounter)throw Error(r(482));n=a,n.status="pending",n.then(function(u){if(a.status==="pending"){var m=a;m.status="fulfilled",m.value=u}},function(u){if(a.status==="pending"){var m=a;m.status="rejected",m.reason=u}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw n=a.reason,tg(n),n}throw Ia=a,As}}function Za(n){try{var a=n._init;return a(n._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(Ia=o,As):o}}var Ia=null;function eg(){if(Ia===null)throw Error(r(459));var n=Ia;return Ia=null,n}function tg(n){if(n===As||n===Xl)throw Error(r(483))}var Ns=null,Co=0;function Wl(n){var a=Co;return Co+=1,Ns===null&&(Ns=[]),J0(Ns,n,a)}function Ao(n,a){a=a.props.ref,n.ref=a!==void 0?a:null}function Kl(n,a){throw a.$$typeof===y?Error(r(525)):(n=Object.prototype.toString.call(a),Error(r(31,n==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":n)))}function ng(n){function a(Z,G){if(n){var q=Z.deletions;q===null?(Z.deletions=[G],Z.flags|=16):q.push(G)}}function o(Z,G){if(!n)return null;for(;G!==null;)a(Z,G),G=G.sibling;return null}function u(Z){for(var G=new Map;Z!==null;)Z.key!==null?G.set(Z.key,Z):G.set(Z.index,Z),Z=Z.sibling;return G}function m(Z,G){return Z=zr(Z,G),Z.index=0,Z.sibling=null,Z}function p(Z,G,q){return Z.index=q,n?(q=Z.alternate,q!==null?(q=q.index,q<G?(Z.flags|=67108866,G):q):(Z.flags|=67108866,G)):(Z.flags|=1048576,G)}function w(Z){return n&&Z.alternate===null&&(Z.flags|=67108866),Z}function z(Z,G,q,oe){return G===null||G.tag!==6?(G=yf(q,Z.mode,oe),G.return=Z,G):(G=m(G,q),G.return=Z,G)}function H(Z,G,q,oe){var Re=q.type;return Re===_?re(Z,G,q.props.children,oe,q.key):G!==null&&(G.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===A&&Za(Re)===G.type)?(G=m(G,q.props),Ao(G,q),G.return=Z,G):(G=Fl(q.type,q.key,q.props,null,Z.mode,oe),Ao(G,q),G.return=Z,G)}function W(Z,G,q,oe){return G===null||G.tag!==4||G.stateNode.containerInfo!==q.containerInfo||G.stateNode.implementation!==q.implementation?(G=bf(q,Z.mode,oe),G.return=Z,G):(G=m(G,q.children||[]),G.return=Z,G)}function re(Z,G,q,oe,Re){return G===null||G.tag!==7?(G=Ga(q,Z.mode,oe,Re),G.return=Z,G):(G=m(G,q),G.return=Z,G)}function ce(Z,G,q){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=yf(""+G,Z.mode,q),G.return=Z,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case x:return q=Fl(G.type,G.key,G.props,null,Z.mode,q),Ao(q,G),q.return=Z,q;case S:return G=bf(G,Z.mode,q),G.return=Z,G;case A:return G=Za(G),ce(Z,G,q)}if(K(G)||O(G))return G=Ga(G,Z.mode,q,null),G.return=Z,G;if(typeof G.then=="function")return ce(Z,Wl(G),q);if(G.$$typeof===k)return ce(Z,Zl(Z,G),q);Kl(Z,G)}return null}function Q(Z,G,q,oe){var Re=G!==null?G.key:null;if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return Re!==null?null:z(Z,G,""+q,oe);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case x:return q.key===Re?H(Z,G,q,oe):null;case S:return q.key===Re?W(Z,G,q,oe):null;case A:return q=Za(q),Q(Z,G,q,oe)}if(K(q)||O(q))return Re!==null?null:re(Z,G,q,oe,null);if(typeof q.then=="function")return Q(Z,G,Wl(q),oe);if(q.$$typeof===k)return Q(Z,G,Zl(Z,q),oe);Kl(Z,q)}return null}function ne(Z,G,q,oe,Re){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return Z=Z.get(q)||null,z(G,Z,""+oe,Re);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case x:return Z=Z.get(oe.key===null?q:oe.key)||null,H(G,Z,oe,Re);case S:return Z=Z.get(oe.key===null?q:oe.key)||null,W(G,Z,oe,Re);case A:return oe=Za(oe),ne(Z,G,q,oe,Re)}if(K(oe)||O(oe))return Z=Z.get(q)||null,re(G,Z,oe,Re,null);if(typeof oe.then=="function")return ne(Z,G,q,Wl(oe),Re);if(oe.$$typeof===k)return ne(Z,G,q,Zl(G,oe),Re);Kl(G,oe)}return null}function _e(Z,G,q,oe){for(var Re=null,rt=null,Te=G,Xe=G=0,tt=null;Te!==null&&Xe<q.length;Xe++){Te.index>Xe?(tt=Te,Te=null):tt=Te.sibling;var at=Q(Z,Te,q[Xe],oe);if(at===null){Te===null&&(Te=tt);break}n&&Te&&at.alternate===null&&a(Z,Te),G=p(at,G,Xe),rt===null?Re=at:rt.sibling=at,rt=at,Te=tt}if(Xe===q.length)return o(Z,Te),nt&&Mr(Z,Xe),Re;if(Te===null){for(;Xe<q.length;Xe++)Te=ce(Z,q[Xe],oe),Te!==null&&(G=p(Te,G,Xe),rt===null?Re=Te:rt.sibling=Te,rt=Te);return nt&&Mr(Z,Xe),Re}for(Te=u(Te);Xe<q.length;Xe++)tt=ne(Te,Z,Xe,q[Xe],oe),tt!==null&&(n&&tt.alternate!==null&&Te.delete(tt.key===null?Xe:tt.key),G=p(tt,G,Xe),rt===null?Re=tt:rt.sibling=tt,rt=tt);return n&&Te.forEach(function(Ma){return a(Z,Ma)}),nt&&Mr(Z,Xe),Re}function Oe(Z,G,q,oe){if(q==null)throw Error(r(151));for(var Re=null,rt=null,Te=G,Xe=G=0,tt=null,at=q.next();Te!==null&&!at.done;Xe++,at=q.next()){Te.index>Xe?(tt=Te,Te=null):tt=Te.sibling;var Ma=Q(Z,Te,at.value,oe);if(Ma===null){Te===null&&(Te=tt);break}n&&Te&&Ma.alternate===null&&a(Z,Te),G=p(Ma,G,Xe),rt===null?Re=Ma:rt.sibling=Ma,rt=Ma,Te=tt}if(at.done)return o(Z,Te),nt&&Mr(Z,Xe),Re;if(Te===null){for(;!at.done;Xe++,at=q.next())at=ce(Z,at.value,oe),at!==null&&(G=p(at,G,Xe),rt===null?Re=at:rt.sibling=at,rt=at);return nt&&Mr(Z,Xe),Re}for(Te=u(Te);!at.done;Xe++,at=q.next())at=ne(Te,Z,Xe,at.value,oe),at!==null&&(n&&at.alternate!==null&&Te.delete(at.key===null?Xe:at.key),G=p(at,G,Xe),rt===null?Re=at:rt.sibling=at,rt=at);return n&&Te.forEach(function(US){return a(Z,US)}),nt&&Mr(Z,Xe),Re}function Et(Z,G,q,oe){if(typeof q=="object"&&q!==null&&q.type===_&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case x:e:{for(var Re=q.key;G!==null;){if(G.key===Re){if(Re=q.type,Re===_){if(G.tag===7){o(Z,G.sibling),oe=m(G,q.props.children),oe.return=Z,Z=oe;break e}}else if(G.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===A&&Za(Re)===G.type){o(Z,G.sibling),oe=m(G,q.props),Ao(oe,q),oe.return=Z,Z=oe;break e}o(Z,G);break}else a(Z,G);G=G.sibling}q.type===_?(oe=Ga(q.props.children,Z.mode,oe,q.key),oe.return=Z,Z=oe):(oe=Fl(q.type,q.key,q.props,null,Z.mode,oe),Ao(oe,q),oe.return=Z,Z=oe)}return w(Z);case S:e:{for(Re=q.key;G!==null;){if(G.key===Re)if(G.tag===4&&G.stateNode.containerInfo===q.containerInfo&&G.stateNode.implementation===q.implementation){o(Z,G.sibling),oe=m(G,q.children||[]),oe.return=Z,Z=oe;break e}else{o(Z,G);break}else a(Z,G);G=G.sibling}oe=bf(q,Z.mode,oe),oe.return=Z,Z=oe}return w(Z);case A:return q=Za(q),Et(Z,G,q,oe)}if(K(q))return _e(Z,G,q,oe);if(O(q)){if(Re=O(q),typeof Re!="function")throw Error(r(150));return q=Re.call(q),Oe(Z,G,q,oe)}if(typeof q.then=="function")return Et(Z,G,Wl(q),oe);if(q.$$typeof===k)return Et(Z,G,Zl(Z,q),oe);Kl(Z,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,G!==null&&G.tag===6?(o(Z,G.sibling),oe=m(G,q),oe.return=Z,Z=oe):(o(Z,G),oe=yf(q,Z.mode,oe),oe.return=Z,Z=oe),w(Z)):o(Z,G)}return function(Z,G,q,oe){try{Co=0;var Re=Et(Z,G,q,oe);return Ns=null,Re}catch(Te){if(Te===As||Te===Xl)throw Te;var rt=Ti(29,Te,null,Z.mode);return rt.lanes=oe,rt.return=Z,rt}finally{}}}var Xa=ng(!0),ig=ng(!1),ua=!1;function Rf(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function kf(n,a){n=n.updateQueue,a.updateQueue===n&&(a.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function fa(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function da(n,a,o){var u=n.updateQueue;if(u===null)return null;if(u=u.shared,(ft&2)!==0){var m=u.pending;return m===null?a.next=a:(a.next=m.next,m.next=a),u.pending=a,a=Yl(n),$0(n,null,o),a}return Gl(n,u,a,o),Yl(n)}function No(n,a,o){if(a=a.updateQueue,a!==null&&(a=a.shared,(o&4194048)!==0)){var u=a.lanes;u&=n.pendingLanes,o|=u,a.lanes=o,Qn(n,o)}}function Df(n,a){var o=n.updateQueue,u=n.alternate;if(u!==null&&(u=u.updateQueue,o===u)){var m=null,p=null;if(o=o.firstBaseUpdate,o!==null){do{var w={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};p===null?m=p=w:p=p.next=w,o=o.next}while(o!==null);p===null?m=p=a:p=p.next=a}else m=p=a;o={baseState:u.baseState,firstBaseUpdate:m,lastBaseUpdate:p,shared:u.shared,callbacks:u.callbacks},n.updateQueue=o;return}n=o.lastBaseUpdate,n===null?o.firstBaseUpdate=a:n.next=a,o.lastBaseUpdate=a}var Of=!1;function Ro(){if(Of){var n=Cs;if(n!==null)throw n}}function ko(n,a,o,u){Of=!1;var m=n.updateQueue;ua=!1;var p=m.firstBaseUpdate,w=m.lastBaseUpdate,z=m.shared.pending;if(z!==null){m.shared.pending=null;var H=z,W=H.next;H.next=null,w===null?p=W:w.next=W,w=H;var re=n.alternate;re!==null&&(re=re.updateQueue,z=re.lastBaseUpdate,z!==w&&(z===null?re.firstBaseUpdate=W:z.next=W,re.lastBaseUpdate=H))}if(p!==null){var ce=m.baseState;w=0,re=W=H=null,z=p;do{var Q=z.lane&-536870913,ne=Q!==z.lane;if(ne?(et&Q)===Q:(u&Q)===Q){Q!==0&&Q===Ms&&(Of=!0),re!==null&&(re=re.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var _e=n,Oe=z;Q=a;var Et=o;switch(Oe.tag){case 1:if(_e=Oe.payload,typeof _e=="function"){ce=_e.call(Et,ce,Q);break e}ce=_e;break e;case 3:_e.flags=_e.flags&-65537|128;case 0:if(_e=Oe.payload,Q=typeof _e=="function"?_e.call(Et,ce,Q):_e,Q==null)break e;ce=v({},ce,Q);break e;case 2:ua=!0}}Q=z.callback,Q!==null&&(n.flags|=64,ne&&(n.flags|=8192),ne=m.callbacks,ne===null?m.callbacks=[Q]:ne.push(Q))}else ne={lane:Q,tag:z.tag,payload:z.payload,callback:z.callback,next:null},re===null?(W=re=ne,H=ce):re=re.next=ne,w|=Q;if(z=z.next,z===null){if(z=m.shared.pending,z===null)break;ne=z,z=ne.next,ne.next=null,m.lastBaseUpdate=ne,m.shared.pending=null}}while(!0);re===null&&(H=ce),m.baseState=H,m.firstBaseUpdate=W,m.lastBaseUpdate=re,p===null&&(m.shared.lanes=0),va|=w,n.lanes=w,n.memoizedState=ce}}function rg(n,a){if(typeof n!="function")throw Error(r(191,n));n.call(a)}function ag(n,a){var o=n.callbacks;if(o!==null)for(n.callbacks=null,n=0;n<o.length;n++)rg(o[n],a)}var Rs=R(null),Ql=R(0);function sg(n,a){n=Hr,ae(Ql,n),ae(Rs,a),Hr=n|a.baseLanes}function jf(){ae(Ql,Hr),ae(Rs,Rs.current)}function Lf(){Hr=Ql.current,X(Rs),X(Ql)}var Ei=R(null),Yi=null;function ha(n){var a=n.alternate;ae(an,an.current&1),ae(Ei,n),Yi===null&&(a===null||Rs.current!==null||a.memoizedState!==null)&&(Yi=n)}function Uf(n){ae(an,an.current),ae(Ei,n),Yi===null&&(Yi=n)}function og(n){n.tag===22?(ae(an,an.current),ae(Ei,n),Yi===null&&(Yi=n)):ma()}function ma(){ae(an,an.current),ae(Ei,Ei.current)}function zi(n){X(Ei),Yi===n&&(Yi=null),X(an)}var an=R(0);function Jl(n){for(var a=n;a!==null;){if(a.tag===13){var o=a.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||Fd(o)||Pd(o)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===n)break;for(;a.sibling===null;){if(a.return===null||a.return===n)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Nr=0,Ze=null,St=null,mn=null,ec=!1,ks=!1,qa=!1,tc=0,Do=0,Ds=null,M_=0;function Kt(){throw Error(r(321))}function Hf(n,a){if(a===null)return!1;for(var o=0;o<a.length&&o<n.length;o++)if(!Si(n[o],a[o]))return!1;return!0}function Bf(n,a,o,u,m,p){return Nr=p,Ze=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,D.H=n===null||n.memoizedState===null?Pg:ed,qa=!1,p=o(u,m),qa=!1,ks&&(p=cg(a,o,u,m)),lg(n),p}function lg(n){D.H=Lo;var a=St!==null&&St.next!==null;if(Nr=0,mn=St=Ze=null,ec=!1,Do=0,Ds=null,a)throw Error(r(300));n===null||gn||(n=n.dependencies,n!==null&&Vl(n)&&(gn=!0))}function cg(n,a,o,u){Ze=n;var m=0;do{if(ks&&(Ds=null),Do=0,ks=!1,25<=m)throw Error(r(301));if(m+=1,mn=St=null,n.updateQueue!=null){var p=n.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}D.H=Vg,p=a(o,u)}while(ks);return p}function C_(){var n=D.H,a=n.useState()[0];return a=typeof a.then=="function"?Oo(a):a,n=n.useState()[0],(St!==null?St.memoizedState:null)!==n&&(Ze.flags|=1024),a}function $f(){var n=tc!==0;return tc=0,n}function Gf(n,a,o){a.updateQueue=n.updateQueue,a.flags&=-2053,n.lanes&=~o}function Yf(n){if(ec){for(n=n.memoizedState;n!==null;){var a=n.queue;a!==null&&(a.pending=null),n=n.next}ec=!1}Nr=0,mn=St=Ze=null,ks=!1,Do=tc=0,Ds=null}function ti(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mn===null?Ze.memoizedState=mn=n:mn=mn.next=n,mn}function sn(){if(St===null){var n=Ze.alternate;n=n!==null?n.memoizedState:null}else n=St.next;var a=mn===null?Ze.memoizedState:mn.next;if(a!==null)mn=a,St=n;else{if(n===null)throw Ze.alternate===null?Error(r(467)):Error(r(310));St=n,n={memoizedState:St.memoizedState,baseState:St.baseState,baseQueue:St.baseQueue,queue:St.queue,next:null},mn===null?Ze.memoizedState=mn=n:mn=mn.next=n}return mn}function nc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Oo(n){var a=Do;return Do+=1,Ds===null&&(Ds=[]),n=J0(Ds,n,a),a=Ze,(mn===null?a.memoizedState:mn.next)===null&&(a=a.alternate,D.H=a===null||a.memoizedState===null?Pg:ed),n}function ic(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return Oo(n);if(n.$$typeof===k)return $n(n)}throw Error(r(438,String(n)))}function Ff(n){var a=null,o=Ze.updateQueue;if(o!==null&&(a=o.memoCache),a==null){var u=Ze.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(a={data:u.data.map(function(m){return m.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),o===null&&(o=nc(),Ze.updateQueue=o),o.memoCache=a,o=a.data[a.index],o===void 0)for(o=a.data[a.index]=Array(n),u=0;u<n;u++)o[u]=I;return a.index++,o}function Rr(n,a){return typeof a=="function"?a(n):a}function rc(n){var a=sn();return Pf(a,St,n)}function Pf(n,a,o){var u=n.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=o;var m=n.baseQueue,p=u.pending;if(p!==null){if(m!==null){var w=m.next;m.next=p.next,p.next=w}a.baseQueue=m=p,u.pending=null}if(p=n.baseState,m===null)n.memoizedState=p;else{a=m.next;var z=w=null,H=null,W=a,re=!1;do{var ce=W.lane&-536870913;if(ce!==W.lane?(et&ce)===ce:(Nr&ce)===ce){var Q=W.revertLane;if(Q===0)H!==null&&(H=H.next={lane:0,revertLane:0,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),ce===Ms&&(re=!0);else if((Nr&Q)===Q){W=W.next,Q===Ms&&(re=!0);continue}else ce={lane:0,revertLane:W.revertLane,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},H===null?(z=H=ce,w=p):H=H.next=ce,Ze.lanes|=Q,va|=Q;ce=W.action,qa&&o(p,ce),p=W.hasEagerState?W.eagerState:o(p,ce)}else Q={lane:ce,revertLane:W.revertLane,gesture:W.gesture,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},H===null?(z=H=Q,w=p):H=H.next=Q,Ze.lanes|=ce,va|=ce;W=W.next}while(W!==null&&W!==a);if(H===null?w=p:H.next=z,!Si(p,n.memoizedState)&&(gn=!0,re&&(o=Cs,o!==null)))throw o;n.memoizedState=p,n.baseState=w,n.baseQueue=H,u.lastRenderedState=p}return m===null&&(u.lanes=0),[n.memoizedState,u.dispatch]}function Vf(n){var a=sn(),o=a.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=n;var u=o.dispatch,m=o.pending,p=a.memoizedState;if(m!==null){o.pending=null;var w=m=m.next;do p=n(p,w.action),w=w.next;while(w!==m);Si(p,a.memoizedState)||(gn=!0),a.memoizedState=p,a.baseQueue===null&&(a.baseState=p),o.lastRenderedState=p}return[p,u]}function ug(n,a,o){var u=Ze,m=sn(),p=nt;if(p){if(o===void 0)throw Error(r(407));o=o()}else o=a();var w=!Si((St||m).memoizedState,o);if(w&&(m.memoizedState=o,gn=!0),m=m.queue,Xf(hg.bind(null,u,m,n),[n]),m.getSnapshot!==a||w||mn!==null&&mn.memoizedState.tag&1){if(u.flags|=2048,Os(9,{destroy:void 0},dg.bind(null,u,m,o,a),null),kt===null)throw Error(r(349));p||(Nr&127)!==0||fg(u,a,o)}return o}function fg(n,a,o){n.flags|=16384,n={getSnapshot:a,value:o},a=Ze.updateQueue,a===null?(a=nc(),Ze.updateQueue=a,a.stores=[n]):(o=a.stores,o===null?a.stores=[n]:o.push(n))}function dg(n,a,o,u){a.value=o,a.getSnapshot=u,mg(a)&&gg(n)}function hg(n,a,o){return o(function(){mg(a)&&gg(n)})}function mg(n){var a=n.getSnapshot;n=n.value;try{var o=a();return!Si(n,o)}catch{return!0}}function gg(n){var a=$a(n,2);a!==null&&di(a,n,2)}function Zf(n){var a=ti();if(typeof n=="function"){var o=n;if(n=o(),qa){ye(!0);try{o()}finally{ye(!1)}}}return a.memoizedState=a.baseState=n,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rr,lastRenderedState:n},a}function pg(n,a,o,u){return n.baseState=o,Pf(n,St,typeof u=="function"?u:Rr)}function A_(n,a,o,u,m){if(oc(n))throw Error(r(485));if(n=a.action,n!==null){var p={payload:m,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){p.listeners.push(w)}};D.T!==null?o(!0):p.isTransition=!1,u(p),o=a.pending,o===null?(p.next=a.pending=p,vg(a,p)):(p.next=o.next,a.pending=o.next=p)}}function vg(n,a){var o=a.action,u=a.payload,m=n.state;if(a.isTransition){var p=D.T,w={};D.T=w;try{var z=o(m,u),H=D.S;H!==null&&H(w,z),yg(n,a,z)}catch(W){If(n,a,W)}finally{p!==null&&w.types!==null&&(p.types=w.types),D.T=p}}else try{p=o(m,u),yg(n,a,p)}catch(W){If(n,a,W)}}function yg(n,a,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(u){bg(n,a,u)},function(u){return If(n,a,u)}):bg(n,a,o)}function bg(n,a,o){a.status="fulfilled",a.value=o,xg(a),n.state=o,a=n.pending,a!==null&&(o=a.next,o===a?n.pending=null:(o=o.next,a.next=o,vg(n,o)))}function If(n,a,o){var u=n.pending;if(n.pending=null,u!==null){u=u.next;do a.status="rejected",a.reason=o,xg(a),a=a.next;while(a!==u)}n.action=null}function xg(n){n=n.listeners;for(var a=0;a<n.length;a++)(0,n[a])()}function wg(n,a){return a}function _g(n,a){if(nt){var o=kt.formState;if(o!==null){e:{var u=Ze;if(nt){if($t){t:{for(var m=$t,p=Gi;m.nodeType!==8;){if(!p){m=null;break t}if(m=Fi(m.nextSibling),m===null){m=null;break t}}p=m.data,m=p==="F!"||p==="F"?m:null}if(m){$t=Fi(m.nextSibling),u=m.data==="F!";break e}}la(u)}u=!1}u&&(a=o[0])}}return o=ti(),o.memoizedState=o.baseState=a,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wg,lastRenderedState:a},o.queue=u,o=Gg.bind(null,Ze,u),u.dispatch=o,u=Zf(!1),p=Jf.bind(null,Ze,!1,u.queue),u=ti(),m={state:a,dispatch:null,action:n,pending:null},u.queue=m,o=A_.bind(null,Ze,m,p,o),m.dispatch=o,u.memoizedState=n,[a,o,!1]}function Sg(n){var a=sn();return Tg(a,St,n)}function Tg(n,a,o){if(a=Pf(n,a,wg)[0],n=rc(Rr)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var u=Oo(a)}catch(w){throw w===As?Xl:w}else u=a;a=sn();var m=a.queue,p=m.dispatch;return o!==a.memoizedState&&(Ze.flags|=2048,Os(9,{destroy:void 0},N_.bind(null,m,o),null)),[u,p,n]}function N_(n,a){n.action=a}function Eg(n){var a=sn(),o=St;if(o!==null)return Tg(a,o,n);sn(),a=a.memoizedState,o=sn();var u=o.queue.dispatch;return o.memoizedState=n,[a,u,!1]}function Os(n,a,o,u){return n={tag:n,create:o,deps:u,inst:a,next:null},a=Ze.updateQueue,a===null&&(a=nc(),Ze.updateQueue=a),o=a.lastEffect,o===null?a.lastEffect=n.next=n:(u=o.next,o.next=n,n.next=u,a.lastEffect=n),n}function zg(){return sn().memoizedState}function ac(n,a,o,u){var m=ti();Ze.flags|=n,m.memoizedState=Os(1|a,{destroy:void 0},o,u===void 0?null:u)}function sc(n,a,o,u){var m=sn();u=u===void 0?null:u;var p=m.memoizedState.inst;St!==null&&u!==null&&Hf(u,St.memoizedState.deps)?m.memoizedState=Os(a,p,o,u):(Ze.flags|=n,m.memoizedState=Os(1|a,p,o,u))}function Mg(n,a){ac(8390656,8,n,a)}function Xf(n,a){sc(2048,8,n,a)}function R_(n){Ze.flags|=4;var a=Ze.updateQueue;if(a===null)a=nc(),Ze.updateQueue=a,a.events=[n];else{var o=a.events;o===null?a.events=[n]:o.push(n)}}function Cg(n){var a=sn().memoizedState;return R_({ref:a,nextImpl:n}),function(){if((ft&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function Ag(n,a){return sc(4,2,n,a)}function Ng(n,a){return sc(4,4,n,a)}function Rg(n,a){if(typeof a=="function"){n=n();var o=a(n);return function(){typeof o=="function"?o():a(null)}}if(a!=null)return n=n(),a.current=n,function(){a.current=null}}function kg(n,a,o){o=o!=null?o.concat([n]):null,sc(4,4,Rg.bind(null,a,n),o)}function qf(){}function Dg(n,a){var o=sn();a=a===void 0?null:a;var u=o.memoizedState;return a!==null&&Hf(a,u[1])?u[0]:(o.memoizedState=[n,a],n)}function Og(n,a){var o=sn();a=a===void 0?null:a;var u=o.memoizedState;if(a!==null&&Hf(a,u[1]))return u[0];if(u=n(),qa){ye(!0);try{n()}finally{ye(!1)}}return o.memoizedState=[u,a],u}function Wf(n,a,o){return o===void 0||(Nr&1073741824)!==0&&(et&261930)===0?n.memoizedState=a:(n.memoizedState=o,n=jp(),Ze.lanes|=n,va|=n,o)}function jg(n,a,o,u){return Si(o,a)?o:Rs.current!==null?(n=Wf(n,o,u),Si(n,a)||(gn=!0),n):(Nr&42)===0||(Nr&1073741824)!==0&&(et&261930)===0?(gn=!0,n.memoizedState=o):(n=jp(),Ze.lanes|=n,va|=n,a)}function Lg(n,a,o,u,m){var p=V.p;V.p=p!==0&&8>p?p:8;var w=D.T,z={};D.T=z,Jf(n,!1,a,o);try{var H=m(),W=D.S;if(W!==null&&W(z,H),H!==null&&typeof H=="object"&&typeof H.then=="function"){var re=z_(H,u);jo(n,a,re,Ai(n))}else jo(n,a,u,Ai(n))}catch(ce){jo(n,a,{then:function(){},status:"rejected",reason:ce},Ai())}finally{V.p=p,w!==null&&z.types!==null&&(w.types=z.types),D.T=w}}function k_(){}function Kf(n,a,o,u){if(n.tag!==5)throw Error(r(476));var m=Ug(n).queue;Lg(n,m,a,ie,o===null?k_:function(){return Hg(n),o(u)})}function Ug(n){var a=n.memoizedState;if(a!==null)return a;a={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rr,lastRenderedState:ie},next:null};var o={};return a.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rr,lastRenderedState:o},next:null},n.memoizedState=a,n=n.alternate,n!==null&&(n.memoizedState=a),a}function Hg(n){var a=Ug(n);a.next===null&&(a=n.alternate.memoizedState),jo(n,a.next.queue,{},Ai())}function Qf(){return $n(Qo)}function Bg(){return sn().memoizedState}function $g(){return sn().memoizedState}function D_(n){for(var a=n.return;a!==null;){switch(a.tag){case 24:case 3:var o=Ai();n=fa(o);var u=da(a,n,o);u!==null&&(di(u,a,o),No(u,a,o)),a={cache:Mf()},n.payload=a;return}a=a.return}}function O_(n,a,o){var u=Ai();o={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},oc(n)?Yg(a,o):(o=pf(n,a,o,u),o!==null&&(di(o,n,u),Fg(o,a,u)))}function Gg(n,a,o){var u=Ai();jo(n,a,o,u)}function jo(n,a,o,u){var m={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(oc(n))Yg(a,m);else{var p=n.alternate;if(n.lanes===0&&(p===null||p.lanes===0)&&(p=a.lastRenderedReducer,p!==null))try{var w=a.lastRenderedState,z=p(w,o);if(m.hasEagerState=!0,m.eagerState=z,Si(z,w))return Gl(n,a,m,0),kt===null&&$l(),!1}catch{}finally{}if(o=pf(n,a,m,u),o!==null)return di(o,n,u),Fg(o,a,u),!0}return!1}function Jf(n,a,o,u){if(u={lane:2,revertLane:Rd(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},oc(n)){if(a)throw Error(r(479))}else a=pf(n,o,u,2),a!==null&&di(a,n,2)}function oc(n){var a=n.alternate;return n===Ze||a!==null&&a===Ze}function Yg(n,a){ks=ec=!0;var o=n.pending;o===null?a.next=a:(a.next=o.next,o.next=a),n.pending=a}function Fg(n,a,o){if((o&4194048)!==0){var u=a.lanes;u&=n.pendingLanes,o|=u,a.lanes=o,Qn(n,o)}}var Lo={readContext:$n,use:ic,useCallback:Kt,useContext:Kt,useEffect:Kt,useImperativeHandle:Kt,useLayoutEffect:Kt,useInsertionEffect:Kt,useMemo:Kt,useReducer:Kt,useRef:Kt,useState:Kt,useDebugValue:Kt,useDeferredValue:Kt,useTransition:Kt,useSyncExternalStore:Kt,useId:Kt,useHostTransitionStatus:Kt,useFormState:Kt,useActionState:Kt,useOptimistic:Kt,useMemoCache:Kt,useCacheRefresh:Kt};Lo.useEffectEvent=Kt;var Pg={readContext:$n,use:ic,useCallback:function(n,a){return ti().memoizedState=[n,a===void 0?null:a],n},useContext:$n,useEffect:Mg,useImperativeHandle:function(n,a,o){o=o!=null?o.concat([n]):null,ac(4194308,4,Rg.bind(null,a,n),o)},useLayoutEffect:function(n,a){return ac(4194308,4,n,a)},useInsertionEffect:function(n,a){ac(4,2,n,a)},useMemo:function(n,a){var o=ti();a=a===void 0?null:a;var u=n();if(qa){ye(!0);try{n()}finally{ye(!1)}}return o.memoizedState=[u,a],u},useReducer:function(n,a,o){var u=ti();if(o!==void 0){var m=o(a);if(qa){ye(!0);try{o(a)}finally{ye(!1)}}}else m=a;return u.memoizedState=u.baseState=m,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:m},u.queue=n,n=n.dispatch=O_.bind(null,Ze,n),[u.memoizedState,n]},useRef:function(n){var a=ti();return n={current:n},a.memoizedState=n},useState:function(n){n=Zf(n);var a=n.queue,o=Gg.bind(null,Ze,a);return a.dispatch=o,[n.memoizedState,o]},useDebugValue:qf,useDeferredValue:function(n,a){var o=ti();return Wf(o,n,a)},useTransition:function(){var n=Zf(!1);return n=Lg.bind(null,Ze,n.queue,!0,!1),ti().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,a,o){var u=Ze,m=ti();if(nt){if(o===void 0)throw Error(r(407));o=o()}else{if(o=a(),kt===null)throw Error(r(349));(et&127)!==0||fg(u,a,o)}m.memoizedState=o;var p={value:o,getSnapshot:a};return m.queue=p,Mg(hg.bind(null,u,p,n),[n]),u.flags|=2048,Os(9,{destroy:void 0},dg.bind(null,u,p,o,a),null),o},useId:function(){var n=ti(),a=kt.identifierPrefix;if(nt){var o=hr,u=dr;o=(u&~(1<<32-We(u)-1)).toString(32)+o,a="_"+a+"R_"+o,o=tc++,0<o&&(a+="H"+o.toString(32)),a+="_"}else o=M_++,a="_"+a+"r_"+o.toString(32)+"_";return n.memoizedState=a},useHostTransitionStatus:Qf,useFormState:_g,useActionState:_g,useOptimistic:function(n){var a=ti();a.memoizedState=a.baseState=n;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=o,a=Jf.bind(null,Ze,!0,o),o.dispatch=a,[n,a]},useMemoCache:Ff,useCacheRefresh:function(){return ti().memoizedState=D_.bind(null,Ze)},useEffectEvent:function(n){var a=ti(),o={impl:n};return a.memoizedState=o,function(){if((ft&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}},ed={readContext:$n,use:ic,useCallback:Dg,useContext:$n,useEffect:Xf,useImperativeHandle:kg,useInsertionEffect:Ag,useLayoutEffect:Ng,useMemo:Og,useReducer:rc,useRef:zg,useState:function(){return rc(Rr)},useDebugValue:qf,useDeferredValue:function(n,a){var o=sn();return jg(o,St.memoizedState,n,a)},useTransition:function(){var n=rc(Rr)[0],a=sn().memoizedState;return[typeof n=="boolean"?n:Oo(n),a]},useSyncExternalStore:ug,useId:Bg,useHostTransitionStatus:Qf,useFormState:Sg,useActionState:Sg,useOptimistic:function(n,a){var o=sn();return pg(o,St,n,a)},useMemoCache:Ff,useCacheRefresh:$g};ed.useEffectEvent=Cg;var Vg={readContext:$n,use:ic,useCallback:Dg,useContext:$n,useEffect:Xf,useImperativeHandle:kg,useInsertionEffect:Ag,useLayoutEffect:Ng,useMemo:Og,useReducer:Vf,useRef:zg,useState:function(){return Vf(Rr)},useDebugValue:qf,useDeferredValue:function(n,a){var o=sn();return St===null?Wf(o,n,a):jg(o,St.memoizedState,n,a)},useTransition:function(){var n=Vf(Rr)[0],a=sn().memoizedState;return[typeof n=="boolean"?n:Oo(n),a]},useSyncExternalStore:ug,useId:Bg,useHostTransitionStatus:Qf,useFormState:Eg,useActionState:Eg,useOptimistic:function(n,a){var o=sn();return St!==null?pg(o,St,n,a):(o.baseState=n,[n,o.queue.dispatch])},useMemoCache:Ff,useCacheRefresh:$g};Vg.useEffectEvent=Cg;function td(n,a,o,u){a=n.memoizedState,o=o(u,a),o=o==null?a:v({},a,o),n.memoizedState=o,n.lanes===0&&(n.updateQueue.baseState=o)}var nd={enqueueSetState:function(n,a,o){n=n._reactInternals;var u=Ai(),m=fa(u);m.payload=a,o!=null&&(m.callback=o),a=da(n,m,u),a!==null&&(di(a,n,u),No(a,n,u))},enqueueReplaceState:function(n,a,o){n=n._reactInternals;var u=Ai(),m=fa(u);m.tag=1,m.payload=a,o!=null&&(m.callback=o),a=da(n,m,u),a!==null&&(di(a,n,u),No(a,n,u))},enqueueForceUpdate:function(n,a){n=n._reactInternals;var o=Ai(),u=fa(o);u.tag=2,a!=null&&(u.callback=a),a=da(n,u,o),a!==null&&(di(a,n,o),No(a,n,o))}};function Zg(n,a,o,u,m,p,w){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(u,p,w):a.prototype&&a.prototype.isPureReactComponent?!_o(o,u)||!_o(m,p):!0}function Ig(n,a,o,u){n=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(o,u),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(o,u),a.state!==n&&nd.enqueueReplaceState(a,a.state,null)}function Wa(n,a){var o=a;if("ref"in a){o={};for(var u in a)u!=="ref"&&(o[u]=a[u])}if(n=n.defaultProps){o===a&&(o=v({},o));for(var m in n)o[m]===void 0&&(o[m]=n[m])}return o}function Xg(n){Bl(n)}function qg(n){console.error(n)}function Wg(n){Bl(n)}function lc(n,a){try{var o=n.onUncaughtError;o(a.value,{componentStack:a.stack})}catch(u){setTimeout(function(){throw u})}}function Kg(n,a,o){try{var u=n.onCaughtError;u(o.value,{componentStack:o.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function id(n,a,o){return o=fa(o),o.tag=3,o.payload={element:null},o.callback=function(){lc(n,a)},o}function Qg(n){return n=fa(n),n.tag=3,n}function Jg(n,a,o,u){var m=o.type.getDerivedStateFromError;if(typeof m=="function"){var p=u.value;n.payload=function(){return m(p)},n.callback=function(){Kg(a,o,u)}}var w=o.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(n.callback=function(){Kg(a,o,u),typeof m!="function"&&(ya===null?ya=new Set([this]):ya.add(this));var z=u.stack;this.componentDidCatch(u.value,{componentStack:z!==null?z:""})})}function j_(n,a,o,u,m){if(o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(a=o.alternate,a!==null&&zs(a,o,m,!0),o=Ei.current,o!==null){switch(o.tag){case 31:case 13:return Yi===null?xc():o.alternate===null&&Qt===0&&(Qt=3),o.flags&=-257,o.flags|=65536,o.lanes=m,u===ql?o.flags|=16384:(a=o.updateQueue,a===null?o.updateQueue=new Set([u]):a.add(u),Cd(n,u,m)),!1;case 22:return o.flags|=65536,u===ql?o.flags|=16384:(a=o.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([u])},o.updateQueue=a):(o=a.retryQueue,o===null?a.retryQueue=new Set([u]):o.add(u)),Cd(n,u,m)),!1}throw Error(r(435,o.tag))}return Cd(n,u,m),xc(),!1}if(nt)return a=Ei.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=m,u!==_f&&(n=Error(r(422),{cause:u}),Eo(Hi(n,o)))):(u!==_f&&(a=Error(r(423),{cause:u}),Eo(Hi(a,o))),n=n.current.alternate,n.flags|=65536,m&=-m,n.lanes|=m,u=Hi(u,o),m=id(n.stateNode,u,m),Df(n,m),Qt!==4&&(Qt=2)),!1;var p=Error(r(520),{cause:u});if(p=Hi(p,o),Po===null?Po=[p]:Po.push(p),Qt!==4&&(Qt=2),a===null)return!0;u=Hi(u,o),o=a;do{switch(o.tag){case 3:return o.flags|=65536,n=m&-m,o.lanes|=n,n=id(o.stateNode,u,n),Df(o,n),!1;case 1:if(a=o.type,p=o.stateNode,(o.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(ya===null||!ya.has(p))))return o.flags|=65536,m&=-m,o.lanes|=m,m=Qg(m),Jg(m,n,o,u),Df(o,m),!1}o=o.return}while(o!==null);return!1}var rd=Error(r(461)),gn=!1;function Gn(n,a,o,u){a.child=n===null?ig(a,null,o,u):Xa(a,n.child,o,u)}function ep(n,a,o,u,m){o=o.render;var p=a.ref;if("ref"in u){var w={};for(var z in u)z!=="ref"&&(w[z]=u[z])}else w=u;return Pa(a),u=Bf(n,a,o,w,p,m),z=$f(),n!==null&&!gn?(Gf(n,a,m),kr(n,a,m)):(nt&&z&&xf(a),a.flags|=1,Gn(n,a,u,m),a.child)}function tp(n,a,o,u,m){if(n===null){var p=o.type;return typeof p=="function"&&!vf(p)&&p.defaultProps===void 0&&o.compare===null?(a.tag=15,a.type=p,np(n,a,p,u,m)):(n=Fl(o.type,null,u,a,a.mode,m),n.ref=a.ref,n.return=a,a.child=n)}if(p=n.child,!dd(n,m)){var w=p.memoizedProps;if(o=o.compare,o=o!==null?o:_o,o(w,u)&&n.ref===a.ref)return kr(n,a,m)}return a.flags|=1,n=zr(p,u),n.ref=a.ref,n.return=a,a.child=n}function np(n,a,o,u,m){if(n!==null){var p=n.memoizedProps;if(_o(p,u)&&n.ref===a.ref)if(gn=!1,a.pendingProps=u=p,dd(n,m))(n.flags&131072)!==0&&(gn=!0);else return a.lanes=n.lanes,kr(n,a,m)}return ad(n,a,o,u,m)}function ip(n,a,o,u){var m=u.children,p=n!==null?n.memoizedState:null;if(n===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((a.flags&128)!==0){if(p=p!==null?p.baseLanes|o:o,n!==null){for(u=a.child=n.child,m=0;u!==null;)m=m|u.lanes|u.childLanes,u=u.sibling;u=m&~p}else u=0,a.child=null;return rp(n,a,p,o,u)}if((o&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},n!==null&&Il(a,p!==null?p.cachePool:null),p!==null?sg(a,p):jf(),og(a);else return u=a.lanes=536870912,rp(n,a,p!==null?p.baseLanes|o:o,o,u)}else p!==null?(Il(a,p.cachePool),sg(a,p),ma(),a.memoizedState=null):(n!==null&&Il(a,null),jf(),ma());return Gn(n,a,m,o),a.child}function Uo(n,a){return n!==null&&n.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function rp(n,a,o,u,m){var p=Af();return p=p===null?null:{parent:hn._currentValue,pool:p},a.memoizedState={baseLanes:o,cachePool:p},n!==null&&Il(a,null),jf(),og(a),n!==null&&zs(n,a,u,!0),a.childLanes=m,null}function cc(n,a){return a=fc({mode:a.mode,children:a.children},n.mode),a.ref=n.ref,n.child=a,a.return=n,a}function ap(n,a,o){return Xa(a,n.child,null,o),n=cc(a,a.pendingProps),n.flags|=2,zi(a),a.memoizedState=null,n}function L_(n,a,o){var u=a.pendingProps,m=(a.flags&128)!==0;if(a.flags&=-129,n===null){if(nt){if(u.mode==="hidden")return n=cc(a,u),a.lanes=536870912,Uo(null,n);if(Uf(a),(n=$t)?(n=vv(n,Gi),n=n!==null&&n.data==="&"?n:null,n!==null&&(a.memoizedState={dehydrated:n,treeContext:sa!==null?{id:dr,overflow:hr}:null,retryLane:536870912,hydrationErrors:null},o=Y0(n),o.return=a,a.child=o,Bn=a,$t=null)):n=null,n===null)throw la(a);return a.lanes=536870912,null}return cc(a,u)}var p=n.memoizedState;if(p!==null){var w=p.dehydrated;if(Uf(a),m)if(a.flags&256)a.flags&=-257,a=ap(n,a,o);else if(a.memoizedState!==null)a.child=n.child,a.flags|=128,a=null;else throw Error(r(558));else if(gn||zs(n,a,o,!1),m=(o&n.childLanes)!==0,gn||m){if(u=kt,u!==null&&(w=lr(u,o),w!==0&&w!==p.retryLane))throw p.retryLane=w,$a(n,w),di(u,n,w),rd;xc(),a=ap(n,a,o)}else n=p.treeContext,$t=Fi(w.nextSibling),Bn=a,nt=!0,oa=null,Gi=!1,n!==null&&V0(a,n),a=cc(a,u),a.flags|=4096;return a}return n=zr(n.child,{mode:u.mode,children:u.children}),n.ref=a.ref,a.child=n,n.return=a,n}function uc(n,a){var o=a.ref;if(o===null)n!==null&&n.ref!==null&&(a.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(r(284));(n===null||n.ref!==o)&&(a.flags|=4194816)}}function ad(n,a,o,u,m){return Pa(a),o=Bf(n,a,o,u,void 0,m),u=$f(),n!==null&&!gn?(Gf(n,a,m),kr(n,a,m)):(nt&&u&&xf(a),a.flags|=1,Gn(n,a,o,m),a.child)}function sp(n,a,o,u,m,p){return Pa(a),a.updateQueue=null,o=cg(a,u,o,m),lg(n),u=$f(),n!==null&&!gn?(Gf(n,a,p),kr(n,a,p)):(nt&&u&&xf(a),a.flags|=1,Gn(n,a,o,p),a.child)}function op(n,a,o,u,m){if(Pa(a),a.stateNode===null){var p=_s,w=o.contextType;typeof w=="object"&&w!==null&&(p=$n(w)),p=new o(u,p),a.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=nd,a.stateNode=p,p._reactInternals=a,p=a.stateNode,p.props=u,p.state=a.memoizedState,p.refs={},Rf(a),w=o.contextType,p.context=typeof w=="object"&&w!==null?$n(w):_s,p.state=a.memoizedState,w=o.getDerivedStateFromProps,typeof w=="function"&&(td(a,o,w,u),p.state=a.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(w=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),w!==p.state&&nd.enqueueReplaceState(p,p.state,null),ko(a,u,p,m),Ro(),p.state=a.memoizedState),typeof p.componentDidMount=="function"&&(a.flags|=4194308),u=!0}else if(n===null){p=a.stateNode;var z=a.memoizedProps,H=Wa(o,z);p.props=H;var W=p.context,re=o.contextType;w=_s,typeof re=="object"&&re!==null&&(w=$n(re));var ce=o.getDerivedStateFromProps;re=typeof ce=="function"||typeof p.getSnapshotBeforeUpdate=="function",z=a.pendingProps!==z,re||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(z||W!==w)&&Ig(a,p,u,w),ua=!1;var Q=a.memoizedState;p.state=Q,ko(a,u,p,m),Ro(),W=a.memoizedState,z||Q!==W||ua?(typeof ce=="function"&&(td(a,o,ce,u),W=a.memoizedState),(H=ua||Zg(a,o,H,u,Q,W,w))?(re||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(a.flags|=4194308)):(typeof p.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=u,a.memoizedState=W),p.props=u,p.state=W,p.context=w,u=H):(typeof p.componentDidMount=="function"&&(a.flags|=4194308),u=!1)}else{p=a.stateNode,kf(n,a),w=a.memoizedProps,re=Wa(o,w),p.props=re,ce=a.pendingProps,Q=p.context,W=o.contextType,H=_s,typeof W=="object"&&W!==null&&(H=$n(W)),z=o.getDerivedStateFromProps,(W=typeof z=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(w!==ce||Q!==H)&&Ig(a,p,u,H),ua=!1,Q=a.memoizedState,p.state=Q,ko(a,u,p,m),Ro();var ne=a.memoizedState;w!==ce||Q!==ne||ua||n!==null&&n.dependencies!==null&&Vl(n.dependencies)?(typeof z=="function"&&(td(a,o,z,u),ne=a.memoizedState),(re=ua||Zg(a,o,re,u,Q,ne,H)||n!==null&&n.dependencies!==null&&Vl(n.dependencies))?(W||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(u,ne,H),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(u,ne,H)),typeof p.componentDidUpdate=="function"&&(a.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof p.componentDidUpdate!="function"||w===n.memoizedProps&&Q===n.memoizedState||(a.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||w===n.memoizedProps&&Q===n.memoizedState||(a.flags|=1024),a.memoizedProps=u,a.memoizedState=ne),p.props=u,p.state=ne,p.context=H,u=re):(typeof p.componentDidUpdate!="function"||w===n.memoizedProps&&Q===n.memoizedState||(a.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||w===n.memoizedProps&&Q===n.memoizedState||(a.flags|=1024),u=!1)}return p=u,uc(n,a),u=(a.flags&128)!==0,p||u?(p=a.stateNode,o=u&&typeof o.getDerivedStateFromError!="function"?null:p.render(),a.flags|=1,n!==null&&u?(a.child=Xa(a,n.child,null,m),a.child=Xa(a,null,o,m)):Gn(n,a,o,m),a.memoizedState=p.state,n=a.child):n=kr(n,a,m),n}function lp(n,a,o,u){return Ya(),a.flags|=256,Gn(n,a,o,u),a.child}var sd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function od(n){return{baseLanes:n,cachePool:K0()}}function ld(n,a,o){return n=n!==null?n.childLanes&~o:0,a&&(n|=Ci),n}function cp(n,a,o){var u=a.pendingProps,m=!1,p=(a.flags&128)!==0,w;if((w=p)||(w=n!==null&&n.memoizedState===null?!1:(an.current&2)!==0),w&&(m=!0,a.flags&=-129),w=(a.flags&32)!==0,a.flags&=-33,n===null){if(nt){if(m?ha(a):ma(),(n=$t)?(n=vv(n,Gi),n=n!==null&&n.data!=="&"?n:null,n!==null&&(a.memoizedState={dehydrated:n,treeContext:sa!==null?{id:dr,overflow:hr}:null,retryLane:536870912,hydrationErrors:null},o=Y0(n),o.return=a,a.child=o,Bn=a,$t=null)):n=null,n===null)throw la(a);return Pd(n)?a.lanes=32:a.lanes=536870912,null}var z=u.children;return u=u.fallback,m?(ma(),m=a.mode,z=fc({mode:"hidden",children:z},m),u=Ga(u,m,o,null),z.return=a,u.return=a,z.sibling=u,a.child=z,u=a.child,u.memoizedState=od(o),u.childLanes=ld(n,w,o),a.memoizedState=sd,Uo(null,u)):(ha(a),cd(a,z))}var H=n.memoizedState;if(H!==null&&(z=H.dehydrated,z!==null)){if(p)a.flags&256?(ha(a),a.flags&=-257,a=ud(n,a,o)):a.memoizedState!==null?(ma(),a.child=n.child,a.flags|=128,a=null):(ma(),z=u.fallback,m=a.mode,u=fc({mode:"visible",children:u.children},m),z=Ga(z,m,o,null),z.flags|=2,u.return=a,z.return=a,u.sibling=z,a.child=u,Xa(a,n.child,null,o),u=a.child,u.memoizedState=od(o),u.childLanes=ld(n,w,o),a.memoizedState=sd,a=Uo(null,u));else if(ha(a),Pd(z)){if(w=z.nextSibling&&z.nextSibling.dataset,w)var W=w.dgst;w=W,u=Error(r(419)),u.stack="",u.digest=w,Eo({value:u,source:null,stack:null}),a=ud(n,a,o)}else if(gn||zs(n,a,o,!1),w=(o&n.childLanes)!==0,gn||w){if(w=kt,w!==null&&(u=lr(w,o),u!==0&&u!==H.retryLane))throw H.retryLane=u,$a(n,u),di(w,n,u),rd;Fd(z)||xc(),a=ud(n,a,o)}else Fd(z)?(a.flags|=192,a.child=n.child,a=null):(n=H.treeContext,$t=Fi(z.nextSibling),Bn=a,nt=!0,oa=null,Gi=!1,n!==null&&V0(a,n),a=cd(a,u.children),a.flags|=4096);return a}return m?(ma(),z=u.fallback,m=a.mode,H=n.child,W=H.sibling,u=zr(H,{mode:"hidden",children:u.children}),u.subtreeFlags=H.subtreeFlags&65011712,W!==null?z=zr(W,z):(z=Ga(z,m,o,null),z.flags|=2),z.return=a,u.return=a,u.sibling=z,a.child=u,Uo(null,u),u=a.child,z=n.child.memoizedState,z===null?z=od(o):(m=z.cachePool,m!==null?(H=hn._currentValue,m=m.parent!==H?{parent:H,pool:H}:m):m=K0(),z={baseLanes:z.baseLanes|o,cachePool:m}),u.memoizedState=z,u.childLanes=ld(n,w,o),a.memoizedState=sd,Uo(n.child,u)):(ha(a),o=n.child,n=o.sibling,o=zr(o,{mode:"visible",children:u.children}),o.return=a,o.sibling=null,n!==null&&(w=a.deletions,w===null?(a.deletions=[n],a.flags|=16):w.push(n)),a.child=o,a.memoizedState=null,o)}function cd(n,a){return a=fc({mode:"visible",children:a},n.mode),a.return=n,n.child=a}function fc(n,a){return n=Ti(22,n,null,a),n.lanes=0,n}function ud(n,a,o){return Xa(a,n.child,null,o),n=cd(a,a.pendingProps.children),n.flags|=2,a.memoizedState=null,n}function up(n,a,o){n.lanes|=a;var u=n.alternate;u!==null&&(u.lanes|=a),Ef(n.return,a,o)}function fd(n,a,o,u,m,p){var w=n.memoizedState;w===null?n.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:u,tail:o,tailMode:m,treeForkCount:p}:(w.isBackwards=a,w.rendering=null,w.renderingStartTime=0,w.last=u,w.tail=o,w.tailMode=m,w.treeForkCount=p)}function fp(n,a,o){var u=a.pendingProps,m=u.revealOrder,p=u.tail;u=u.children;var w=an.current,z=(w&2)!==0;if(z?(w=w&1|2,a.flags|=128):w&=1,ae(an,w),Gn(n,a,u,o),u=nt?To:0,!z&&n!==null&&(n.flags&128)!==0)e:for(n=a.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&up(n,o,a);else if(n.tag===19)up(n,o,a);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===a)break e;for(;n.sibling===null;){if(n.return===null||n.return===a)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(m){case"forwards":for(o=a.child,m=null;o!==null;)n=o.alternate,n!==null&&Jl(n)===null&&(m=o),o=o.sibling;o=m,o===null?(m=a.child,a.child=null):(m=o.sibling,o.sibling=null),fd(a,!1,m,o,p,u);break;case"backwards":case"unstable_legacy-backwards":for(o=null,m=a.child,a.child=null;m!==null;){if(n=m.alternate,n!==null&&Jl(n)===null){a.child=m;break}n=m.sibling,m.sibling=o,o=m,m=n}fd(a,!0,o,null,p,u);break;case"together":fd(a,!1,null,null,void 0,u);break;default:a.memoizedState=null}return a.child}function kr(n,a,o){if(n!==null&&(a.dependencies=n.dependencies),va|=a.lanes,(o&a.childLanes)===0)if(n!==null){if(zs(n,a,o,!1),(o&a.childLanes)===0)return null}else return null;if(n!==null&&a.child!==n.child)throw Error(r(153));if(a.child!==null){for(n=a.child,o=zr(n,n.pendingProps),a.child=o,o.return=a;n.sibling!==null;)n=n.sibling,o=o.sibling=zr(n,n.pendingProps),o.return=a;o.sibling=null}return a.child}function dd(n,a){return(n.lanes&a)!==0?!0:(n=n.dependencies,!!(n!==null&&Vl(n)))}function U_(n,a,o){switch(a.tag){case 3:je(a,a.stateNode.containerInfo),ca(a,hn,n.memoizedState.cache),Ya();break;case 27:case 5:Ee(a);break;case 4:je(a,a.stateNode.containerInfo);break;case 10:ca(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,Uf(a),null;break;case 13:var u=a.memoizedState;if(u!==null)return u.dehydrated!==null?(ha(a),a.flags|=128,null):(o&a.child.childLanes)!==0?cp(n,a,o):(ha(a),n=kr(n,a,o),n!==null?n.sibling:null);ha(a);break;case 19:var m=(n.flags&128)!==0;if(u=(o&a.childLanes)!==0,u||(zs(n,a,o,!1),u=(o&a.childLanes)!==0),m){if(u)return fp(n,a,o);a.flags|=128}if(m=a.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),ae(an,an.current),u)break;return null;case 22:return a.lanes=0,ip(n,a,o,a.pendingProps);case 24:ca(a,hn,n.memoizedState.cache)}return kr(n,a,o)}function dp(n,a,o){if(n!==null)if(n.memoizedProps!==a.pendingProps)gn=!0;else{if(!dd(n,o)&&(a.flags&128)===0)return gn=!1,U_(n,a,o);gn=(n.flags&131072)!==0}else gn=!1,nt&&(a.flags&1048576)!==0&&P0(a,To,a.index);switch(a.lanes=0,a.tag){case 16:e:{var u=a.pendingProps;if(n=Za(a.elementType),a.type=n,typeof n=="function")vf(n)?(u=Wa(n,u),a.tag=1,a=op(null,a,n,u,o)):(a.tag=0,a=ad(null,a,n,u,o));else{if(n!=null){var m=n.$$typeof;if(m===B){a.tag=11,a=ep(null,a,n,u,o);break e}else if(m===U){a.tag=14,a=tp(null,a,n,u,o);break e}}throw a=L(n)||n,Error(r(306,a,""))}}return a;case 0:return ad(n,a,a.type,a.pendingProps,o);case 1:return u=a.type,m=Wa(u,a.pendingProps),op(n,a,u,m,o);case 3:e:{if(je(a,a.stateNode.containerInfo),n===null)throw Error(r(387));u=a.pendingProps;var p=a.memoizedState;m=p.element,kf(n,a),ko(a,u,null,o);var w=a.memoizedState;if(u=w.cache,ca(a,hn,u),u!==p.cache&&zf(a,[hn],o,!0),Ro(),u=w.element,p.isDehydrated)if(p={element:u,isDehydrated:!1,cache:w.cache},a.updateQueue.baseState=p,a.memoizedState=p,a.flags&256){a=lp(n,a,u,o);break e}else if(u!==m){m=Hi(Error(r(424)),a),Eo(m),a=lp(n,a,u,o);break e}else{switch(n=a.stateNode.containerInfo,n.nodeType){case 9:n=n.body;break;default:n=n.nodeName==="HTML"?n.ownerDocument.body:n}for($t=Fi(n.firstChild),Bn=a,nt=!0,oa=null,Gi=!0,o=ig(a,null,u,o),a.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(Ya(),u===m){a=kr(n,a,o);break e}Gn(n,a,u,o)}a=a.child}return a;case 26:return uc(n,a),n===null?(o=Sv(a.type,null,a.pendingProps,null))?a.memoizedState=o:nt||(o=a.type,n=a.pendingProps,u=Mc(ve.current).createElement(o),u[ln]=a,u[On]=n,Yn(u,o,n),tn(u),a.stateNode=u):a.memoizedState=Sv(a.type,n.memoizedProps,a.pendingProps,n.memoizedState),null;case 27:return Ee(a),n===null&&nt&&(u=a.stateNode=xv(a.type,a.pendingProps,ve.current),Bn=a,Gi=!0,m=$t,_a(a.type)?(Vd=m,$t=Fi(u.firstChild)):$t=m),Gn(n,a,a.pendingProps.children,o),uc(n,a),n===null&&(a.flags|=4194304),a.child;case 5:return n===null&&nt&&((m=u=$t)&&(u=hS(u,a.type,a.pendingProps,Gi),u!==null?(a.stateNode=u,Bn=a,$t=Fi(u.firstChild),Gi=!1,m=!0):m=!1),m||la(a)),Ee(a),m=a.type,p=a.pendingProps,w=n!==null?n.memoizedProps:null,u=p.children,$d(m,p)?u=null:w!==null&&$d(m,w)&&(a.flags|=32),a.memoizedState!==null&&(m=Bf(n,a,C_,null,null,o),Qo._currentValue=m),uc(n,a),Gn(n,a,u,o),a.child;case 6:return n===null&&nt&&((n=o=$t)&&(o=mS(o,a.pendingProps,Gi),o!==null?(a.stateNode=o,Bn=a,$t=null,n=!0):n=!1),n||la(a)),null;case 13:return cp(n,a,o);case 4:return je(a,a.stateNode.containerInfo),u=a.pendingProps,n===null?a.child=Xa(a,null,u,o):Gn(n,a,u,o),a.child;case 11:return ep(n,a,a.type,a.pendingProps,o);case 7:return Gn(n,a,a.pendingProps,o),a.child;case 8:return Gn(n,a,a.pendingProps.children,o),a.child;case 12:return Gn(n,a,a.pendingProps.children,o),a.child;case 10:return u=a.pendingProps,ca(a,a.type,u.value),Gn(n,a,u.children,o),a.child;case 9:return m=a.type._context,u=a.pendingProps.children,Pa(a),m=$n(m),u=u(m),a.flags|=1,Gn(n,a,u,o),a.child;case 14:return tp(n,a,a.type,a.pendingProps,o);case 15:return np(n,a,a.type,a.pendingProps,o);case 19:return fp(n,a,o);case 31:return L_(n,a,o);case 22:return ip(n,a,o,a.pendingProps);case 24:return Pa(a),u=$n(hn),n===null?(m=Af(),m===null&&(m=kt,p=Mf(),m.pooledCache=p,p.refCount++,p!==null&&(m.pooledCacheLanes|=o),m=p),a.memoizedState={parent:u,cache:m},Rf(a),ca(a,hn,m)):((n.lanes&o)!==0&&(kf(n,a),ko(a,null,null,o),Ro()),m=n.memoizedState,p=a.memoizedState,m.parent!==u?(m={parent:u,cache:u},a.memoizedState=m,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=m),ca(a,hn,u)):(u=p.cache,ca(a,hn,u),u!==m.cache&&zf(a,[hn],o,!0))),Gn(n,a,a.pendingProps.children,o),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function Dr(n){n.flags|=4}function hd(n,a,o,u,m){if((a=(n.mode&32)!==0)&&(a=!1),a){if(n.flags|=16777216,(m&335544128)===m)if(n.stateNode.complete)n.flags|=8192;else if(Bp())n.flags|=8192;else throw Ia=ql,Nf}else n.flags&=-16777217}function hp(n,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!Cv(a))if(Bp())n.flags|=8192;else throw Ia=ql,Nf}function dc(n,a){a!==null&&(n.flags|=4),n.flags&16384&&(a=n.tag!==22?He():536870912,n.lanes|=a,Hs|=a)}function Ho(n,a){if(!nt)switch(n.tailMode){case"hidden":a=n.tail;for(var o=null;a!==null;)a.alternate!==null&&(o=a),a=a.sibling;o===null?n.tail=null:o.sibling=null;break;case"collapsed":o=n.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?a||n.tail===null?n.tail=null:n.tail.sibling=null:u.sibling=null}}function Gt(n){var a=n.alternate!==null&&n.alternate.child===n.child,o=0,u=0;if(a)for(var m=n.child;m!==null;)o|=m.lanes|m.childLanes,u|=m.subtreeFlags&65011712,u|=m.flags&65011712,m.return=n,m=m.sibling;else for(m=n.child;m!==null;)o|=m.lanes|m.childLanes,u|=m.subtreeFlags,u|=m.flags,m.return=n,m=m.sibling;return n.subtreeFlags|=u,n.childLanes=o,a}function H_(n,a,o){var u=a.pendingProps;switch(wf(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gt(a),null;case 1:return Gt(a),null;case 3:return o=a.stateNode,u=null,n!==null&&(u=n.memoizedState.cache),a.memoizedState.cache!==u&&(a.flags|=2048),Ar(hn),se(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(n===null||n.child===null)&&(Es(a)?Dr(a):n===null||n.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Sf())),Gt(a),null;case 26:var m=a.type,p=a.memoizedState;return n===null?(Dr(a),p!==null?(Gt(a),hp(a,p)):(Gt(a),hd(a,m,null,u,o))):p?p!==n.memoizedState?(Dr(a),Gt(a),hp(a,p)):(Gt(a),a.flags&=-16777217):(n=n.memoizedProps,n!==u&&Dr(a),Gt(a),hd(a,m,n,u,o)),null;case 27:if(ze(a),o=ve.current,m=a.type,n!==null&&a.stateNode!=null)n.memoizedProps!==u&&Dr(a);else{if(!u){if(a.stateNode===null)throw Error(r(166));return Gt(a),null}n=he.current,Es(a)?Z0(a):(n=xv(m,u,o),a.stateNode=n,Dr(a))}return Gt(a),null;case 5:if(ze(a),m=a.type,n!==null&&a.stateNode!=null)n.memoizedProps!==u&&Dr(a);else{if(!u){if(a.stateNode===null)throw Error(r(166));return Gt(a),null}if(p=he.current,Es(a))Z0(a);else{var w=Mc(ve.current);switch(p){case 1:p=w.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:p=w.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":p=w.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":p=w.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":p=w.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof u.is=="string"?w.createElement("select",{is:u.is}):w.createElement("select"),u.multiple?p.multiple=!0:u.size&&(p.size=u.size);break;default:p=typeof u.is=="string"?w.createElement(m,{is:u.is}):w.createElement(m)}}p[ln]=a,p[On]=u;e:for(w=a.child;w!==null;){if(w.tag===5||w.tag===6)p.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===a)break e;for(;w.sibling===null;){if(w.return===null||w.return===a)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}a.stateNode=p;e:switch(Yn(p,m,u),m){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&Dr(a)}}return Gt(a),hd(a,a.type,n===null?null:n.memoizedProps,a.pendingProps,o),null;case 6:if(n&&a.stateNode!=null)n.memoizedProps!==u&&Dr(a);else{if(typeof u!="string"&&a.stateNode===null)throw Error(r(166));if(n=ve.current,Es(a)){if(n=a.stateNode,o=a.memoizedProps,u=null,m=Bn,m!==null)switch(m.tag){case 27:case 5:u=m.memoizedProps}n[ln]=a,n=!!(n.nodeValue===o||u!==null&&u.suppressHydrationWarning===!0||cv(n.nodeValue,o)),n||la(a,!0)}else n=Mc(n).createTextNode(u),n[ln]=a,a.stateNode=n}return Gt(a),null;case 31:if(o=a.memoizedState,n===null||n.memoizedState!==null){if(u=Es(a),o!==null){if(n===null){if(!u)throw Error(r(318));if(n=a.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(557));n[ln]=a}else Ya(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Gt(a),n=!1}else o=Sf(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=o),n=!0;if(!n)return a.flags&256?(zi(a),a):(zi(a),null);if((a.flags&128)!==0)throw Error(r(558))}return Gt(a),null;case 13:if(u=a.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(m=Es(a),u!==null&&u.dehydrated!==null){if(n===null){if(!m)throw Error(r(318));if(m=a.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(r(317));m[ln]=a}else Ya(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Gt(a),m=!1}else m=Sf(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=m),m=!0;if(!m)return a.flags&256?(zi(a),a):(zi(a),null)}return zi(a),(a.flags&128)!==0?(a.lanes=o,a):(o=u!==null,n=n!==null&&n.memoizedState!==null,o&&(u=a.child,m=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(m=u.alternate.memoizedState.cachePool.pool),p=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(p=u.memoizedState.cachePool.pool),p!==m&&(u.flags|=2048)),o!==n&&o&&(a.child.flags|=8192),dc(a,a.updateQueue),Gt(a),null);case 4:return se(),n===null&&jd(a.stateNode.containerInfo),Gt(a),null;case 10:return Ar(a.type),Gt(a),null;case 19:if(X(an),u=a.memoizedState,u===null)return Gt(a),null;if(m=(a.flags&128)!==0,p=u.rendering,p===null)if(m)Ho(u,!1);else{if(Qt!==0||n!==null&&(n.flags&128)!==0)for(n=a.child;n!==null;){if(p=Jl(n),p!==null){for(a.flags|=128,Ho(u,!1),n=p.updateQueue,a.updateQueue=n,dc(a,n),a.subtreeFlags=0,n=o,o=a.child;o!==null;)G0(o,n),o=o.sibling;return ae(an,an.current&1|2),nt&&Mr(a,u.treeForkCount),a.child}n=n.sibling}u.tail!==null&&Zt()>vc&&(a.flags|=128,m=!0,Ho(u,!1),a.lanes=4194304)}else{if(!m)if(n=Jl(p),n!==null){if(a.flags|=128,m=!0,n=n.updateQueue,a.updateQueue=n,dc(a,n),Ho(u,!0),u.tail===null&&u.tailMode==="hidden"&&!p.alternate&&!nt)return Gt(a),null}else 2*Zt()-u.renderingStartTime>vc&&o!==536870912&&(a.flags|=128,m=!0,Ho(u,!1),a.lanes=4194304);u.isBackwards?(p.sibling=a.child,a.child=p):(n=u.last,n!==null?n.sibling=p:a.child=p,u.last=p)}return u.tail!==null?(n=u.tail,u.rendering=n,u.tail=n.sibling,u.renderingStartTime=Zt(),n.sibling=null,o=an.current,ae(an,m?o&1|2:o&1),nt&&Mr(a,u.treeForkCount),n):(Gt(a),null);case 22:case 23:return zi(a),Lf(),u=a.memoizedState!==null,n!==null?n.memoizedState!==null!==u&&(a.flags|=8192):u&&(a.flags|=8192),u?(o&536870912)!==0&&(a.flags&128)===0&&(Gt(a),a.subtreeFlags&6&&(a.flags|=8192)):Gt(a),o=a.updateQueue,o!==null&&dc(a,o.retryQueue),o=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==o&&(a.flags|=2048),n!==null&&X(Va),null;case 24:return o=null,n!==null&&(o=n.memoizedState.cache),a.memoizedState.cache!==o&&(a.flags|=2048),Ar(hn),Gt(a),null;case 25:return null;case 30:return null}throw Error(r(156,a.tag))}function B_(n,a){switch(wf(a),a.tag){case 1:return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 3:return Ar(hn),se(),n=a.flags,(n&65536)!==0&&(n&128)===0?(a.flags=n&-65537|128,a):null;case 26:case 27:case 5:return ze(a),null;case 31:if(a.memoizedState!==null){if(zi(a),a.alternate===null)throw Error(r(340));Ya()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 13:if(zi(a),n=a.memoizedState,n!==null&&n.dehydrated!==null){if(a.alternate===null)throw Error(r(340));Ya()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 19:return X(an),null;case 4:return se(),null;case 10:return Ar(a.type),null;case 22:case 23:return zi(a),Lf(),n!==null&&X(Va),n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 24:return Ar(hn),null;case 25:return null;default:return null}}function mp(n,a){switch(wf(a),a.tag){case 3:Ar(hn),se();break;case 26:case 27:case 5:ze(a);break;case 4:se();break;case 31:a.memoizedState!==null&&zi(a);break;case 13:zi(a);break;case 19:X(an);break;case 10:Ar(a.type);break;case 22:case 23:zi(a),Lf(),n!==null&&X(Va);break;case 24:Ar(hn)}}function Bo(n,a){try{var o=a.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var m=u.next;o=m;do{if((o.tag&n)===n){u=void 0;var p=o.create,w=o.inst;u=p(),w.destroy=u}o=o.next}while(o!==m)}}catch(z){xt(a,a.return,z)}}function ga(n,a,o){try{var u=a.updateQueue,m=u!==null?u.lastEffect:null;if(m!==null){var p=m.next;u=p;do{if((u.tag&n)===n){var w=u.inst,z=w.destroy;if(z!==void 0){w.destroy=void 0,m=a;var H=o,W=z;try{W()}catch(re){xt(m,H,re)}}}u=u.next}while(u!==p)}}catch(re){xt(a,a.return,re)}}function gp(n){var a=n.updateQueue;if(a!==null){var o=n.stateNode;try{ag(a,o)}catch(u){xt(n,n.return,u)}}}function pp(n,a,o){o.props=Wa(n.type,n.memoizedProps),o.state=n.memoizedState;try{o.componentWillUnmount()}catch(u){xt(n,a,u)}}function $o(n,a){try{var o=n.ref;if(o!==null){switch(n.tag){case 26:case 27:case 5:var u=n.stateNode;break;case 30:u=n.stateNode;break;default:u=n.stateNode}typeof o=="function"?n.refCleanup=o(u):o.current=u}}catch(m){xt(n,a,m)}}function mr(n,a){var o=n.ref,u=n.refCleanup;if(o!==null)if(typeof u=="function")try{u()}catch(m){xt(n,a,m)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(m){xt(n,a,m)}else o.current=null}function vp(n){var a=n.type,o=n.memoizedProps,u=n.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":o.autoFocus&&u.focus();break e;case"img":o.src?u.src=o.src:o.srcSet&&(u.srcset=o.srcSet)}}catch(m){xt(n,n.return,m)}}function md(n,a,o){try{var u=n.stateNode;oS(u,n.type,o,a),u[On]=a}catch(m){xt(n,n.return,m)}}function yp(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&_a(n.type)||n.tag===4}function gd(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||yp(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&_a(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function pd(n,a,o){var u=n.tag;if(u===5||u===6)n=n.stateNode,a?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(n,a):(a=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,a.appendChild(n),o=o._reactRootContainer,o!=null||a.onclick!==null||(a.onclick=jt));else if(u!==4&&(u===27&&_a(n.type)&&(o=n.stateNode,a=null),n=n.child,n!==null))for(pd(n,a,o),n=n.sibling;n!==null;)pd(n,a,o),n=n.sibling}function hc(n,a,o){var u=n.tag;if(u===5||u===6)n=n.stateNode,a?o.insertBefore(n,a):o.appendChild(n);else if(u!==4&&(u===27&&_a(n.type)&&(o=n.stateNode),n=n.child,n!==null))for(hc(n,a,o),n=n.sibling;n!==null;)hc(n,a,o),n=n.sibling}function bp(n){var a=n.stateNode,o=n.memoizedProps;try{for(var u=n.type,m=a.attributes;m.length;)a.removeAttributeNode(m[0]);Yn(a,u,o),a[ln]=n,a[On]=o}catch(p){xt(n,n.return,p)}}var Or=!1,pn=!1,vd=!1,xp=typeof WeakSet=="function"?WeakSet:Set,Rn=null;function $_(n,a){if(n=n.containerInfo,Hd=Oc,n=k0(n),uf(n)){if("selectionStart"in n)var o={start:n.selectionStart,end:n.selectionEnd};else e:{o=(o=n.ownerDocument)&&o.defaultView||window;var u=o.getSelection&&o.getSelection();if(u&&u.rangeCount!==0){o=u.anchorNode;var m=u.anchorOffset,p=u.focusNode;u=u.focusOffset;try{o.nodeType,p.nodeType}catch{o=null;break e}var w=0,z=-1,H=-1,W=0,re=0,ce=n,Q=null;t:for(;;){for(var ne;ce!==o||m!==0&&ce.nodeType!==3||(z=w+m),ce!==p||u!==0&&ce.nodeType!==3||(H=w+u),ce.nodeType===3&&(w+=ce.nodeValue.length),(ne=ce.firstChild)!==null;)Q=ce,ce=ne;for(;;){if(ce===n)break t;if(Q===o&&++W===m&&(z=w),Q===p&&++re===u&&(H=w),(ne=ce.nextSibling)!==null)break;ce=Q,Q=ce.parentNode}ce=ne}o=z===-1||H===-1?null:{start:z,end:H}}else o=null}o=o||{start:0,end:0}}else o=null;for(Bd={focusedElem:n,selectionRange:o},Oc=!1,Rn=a;Rn!==null;)if(a=Rn,n=a.child,(a.subtreeFlags&1028)!==0&&n!==null)n.return=a,Rn=n;else for(;Rn!==null;){switch(a=Rn,p=a.alternate,n=a.flags,a.tag){case 0:if((n&4)!==0&&(n=a.updateQueue,n=n!==null?n.events:null,n!==null))for(o=0;o<n.length;o++)m=n[o],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&p!==null){n=void 0,o=a,m=p.memoizedProps,p=p.memoizedState,u=o.stateNode;try{var _e=Wa(o.type,m);n=u.getSnapshotBeforeUpdate(_e,p),u.__reactInternalSnapshotBeforeUpdate=n}catch(Oe){xt(o,o.return,Oe)}}break;case 3:if((n&1024)!==0){if(n=a.stateNode.containerInfo,o=n.nodeType,o===9)Yd(n);else if(o===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":Yd(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(r(163))}if(n=a.sibling,n!==null){n.return=a.return,Rn=n;break}Rn=a.return}}function wp(n,a,o){var u=o.flags;switch(o.tag){case 0:case 11:case 15:Lr(n,o),u&4&&Bo(5,o);break;case 1:if(Lr(n,o),u&4)if(n=o.stateNode,a===null)try{n.componentDidMount()}catch(w){xt(o,o.return,w)}else{var m=Wa(o.type,a.memoizedProps);a=a.memoizedState;try{n.componentDidUpdate(m,a,n.__reactInternalSnapshotBeforeUpdate)}catch(w){xt(o,o.return,w)}}u&64&&gp(o),u&512&&$o(o,o.return);break;case 3:if(Lr(n,o),u&64&&(n=o.updateQueue,n!==null)){if(a=null,o.child!==null)switch(o.child.tag){case 27:case 5:a=o.child.stateNode;break;case 1:a=o.child.stateNode}try{ag(n,a)}catch(w){xt(o,o.return,w)}}break;case 27:a===null&&u&4&&bp(o);case 26:case 5:Lr(n,o),a===null&&u&4&&vp(o),u&512&&$o(o,o.return);break;case 12:Lr(n,o);break;case 31:Lr(n,o),u&4&&Tp(n,o);break;case 13:Lr(n,o),u&4&&Ep(n,o),u&64&&(n=o.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(o=q_.bind(null,o),gS(n,o))));break;case 22:if(u=o.memoizedState!==null||Or,!u){a=a!==null&&a.memoizedState!==null||pn,m=Or;var p=pn;Or=u,(pn=a)&&!p?Ur(n,o,(o.subtreeFlags&8772)!==0):Lr(n,o),Or=m,pn=p}break;case 30:break;default:Lr(n,o)}}function _p(n){var a=n.alternate;a!==null&&(n.alternate=null,_p(a)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(a=n.stateNode,a!==null&&vs(a)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var Ft=null,li=!1;function jr(n,a,o){for(o=o.child;o!==null;)Sp(n,a,o),o=o.sibling}function Sp(n,a,o){if(me&&typeof me.onCommitFiberUnmount=="function")try{me.onCommitFiberUnmount(pe,o)}catch{}switch(o.tag){case 26:pn||mr(o,a),jr(n,a,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:pn||mr(o,a);var u=Ft,m=li;_a(o.type)&&(Ft=o.stateNode,li=!1),jr(n,a,o),qo(o.stateNode),Ft=u,li=m;break;case 5:pn||mr(o,a);case 6:if(u=Ft,m=li,Ft=null,jr(n,a,o),Ft=u,li=m,Ft!==null)if(li)try{(Ft.nodeType===9?Ft.body:Ft.nodeName==="HTML"?Ft.ownerDocument.body:Ft).removeChild(o.stateNode)}catch(p){xt(o,a,p)}else try{Ft.removeChild(o.stateNode)}catch(p){xt(o,a,p)}break;case 18:Ft!==null&&(li?(n=Ft,gv(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,o.stateNode),Zs(n)):gv(Ft,o.stateNode));break;case 4:u=Ft,m=li,Ft=o.stateNode.containerInfo,li=!0,jr(n,a,o),Ft=u,li=m;break;case 0:case 11:case 14:case 15:ga(2,o,a),pn||ga(4,o,a),jr(n,a,o);break;case 1:pn||(mr(o,a),u=o.stateNode,typeof u.componentWillUnmount=="function"&&pp(o,a,u)),jr(n,a,o);break;case 21:jr(n,a,o);break;case 22:pn=(u=pn)||o.memoizedState!==null,jr(n,a,o),pn=u;break;default:jr(n,a,o)}}function Tp(n,a){if(a.memoizedState===null&&(n=a.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{Zs(n)}catch(o){xt(a,a.return,o)}}}function Ep(n,a){if(a.memoizedState===null&&(n=a.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{Zs(n)}catch(o){xt(a,a.return,o)}}function G_(n){switch(n.tag){case 31:case 13:case 19:var a=n.stateNode;return a===null&&(a=n.stateNode=new xp),a;case 22:return n=n.stateNode,a=n._retryCache,a===null&&(a=n._retryCache=new xp),a;default:throw Error(r(435,n.tag))}}function mc(n,a){var o=G_(n);a.forEach(function(u){if(!o.has(u)){o.add(u);var m=W_.bind(null,n,u);u.then(m,m)}})}function ci(n,a){var o=a.deletions;if(o!==null)for(var u=0;u<o.length;u++){var m=o[u],p=n,w=a,z=w;e:for(;z!==null;){switch(z.tag){case 27:if(_a(z.type)){Ft=z.stateNode,li=!1;break e}break;case 5:Ft=z.stateNode,li=!1;break e;case 3:case 4:Ft=z.stateNode.containerInfo,li=!0;break e}z=z.return}if(Ft===null)throw Error(r(160));Sp(p,w,m),Ft=null,li=!1,p=m.alternate,p!==null&&(p.return=null),m.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)zp(a,n),a=a.sibling}var Ji=null;function zp(n,a){var o=n.alternate,u=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:ci(a,n),ui(n),u&4&&(ga(3,n,n.return),Bo(3,n),ga(5,n,n.return));break;case 1:ci(a,n),ui(n),u&512&&(pn||o===null||mr(o,o.return)),u&64&&Or&&(n=n.updateQueue,n!==null&&(u=n.callbacks,u!==null&&(o=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=o===null?u:o.concat(u))));break;case 26:var m=Ji;if(ci(a,n),ui(n),u&512&&(pn||o===null||mr(o,o.return)),u&4){var p=o!==null?o.memoizedState:null;if(u=n.memoizedState,o===null)if(u===null)if(n.stateNode===null){e:{u=n.type,o=n.memoizedProps,m=m.ownerDocument||m;t:switch(u){case"title":p=m.getElementsByTagName("title")[0],(!p||p[na]||p[ln]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=m.createElement(u),m.head.insertBefore(p,m.querySelector("head > title"))),Yn(p,u,o),p[ln]=n,tn(p),u=p;break e;case"link":var w=zv("link","href",m).get(u+(o.href||""));if(w){for(var z=0;z<w.length;z++)if(p=w[z],p.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&p.getAttribute("rel")===(o.rel==null?null:o.rel)&&p.getAttribute("title")===(o.title==null?null:o.title)&&p.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){w.splice(z,1);break t}}p=m.createElement(u),Yn(p,u,o),m.head.appendChild(p);break;case"meta":if(w=zv("meta","content",m).get(u+(o.content||""))){for(z=0;z<w.length;z++)if(p=w[z],p.getAttribute("content")===(o.content==null?null:""+o.content)&&p.getAttribute("name")===(o.name==null?null:o.name)&&p.getAttribute("property")===(o.property==null?null:o.property)&&p.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&p.getAttribute("charset")===(o.charSet==null?null:o.charSet)){w.splice(z,1);break t}}p=m.createElement(u),Yn(p,u,o),m.head.appendChild(p);break;default:throw Error(r(468,u))}p[ln]=n,tn(p),u=p}n.stateNode=u}else Mv(m,n.type,n.stateNode);else n.stateNode=Ev(m,u,n.memoizedProps);else p!==u?(p===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):p.count--,u===null?Mv(m,n.type,n.stateNode):Ev(m,u,n.memoizedProps)):u===null&&n.stateNode!==null&&md(n,n.memoizedProps,o.memoizedProps)}break;case 27:ci(a,n),ui(n),u&512&&(pn||o===null||mr(o,o.return)),o!==null&&u&4&&md(n,n.memoizedProps,o.memoizedProps);break;case 5:if(ci(a,n),ui(n),u&512&&(pn||o===null||mr(o,o.return)),n.flags&32){m=n.stateNode;try{ei(m,"")}catch(_e){xt(n,n.return,_e)}}u&4&&n.stateNode!=null&&(m=n.memoizedProps,md(n,m,o!==null?o.memoizedProps:m)),u&1024&&(vd=!0);break;case 6:if(ci(a,n),ui(n),u&4){if(n.stateNode===null)throw Error(r(162));u=n.memoizedProps,o=n.stateNode;try{o.nodeValue=u}catch(_e){xt(n,n.return,_e)}}break;case 3:if(Nc=null,m=Ji,Ji=Cc(a.containerInfo),ci(a,n),Ji=m,ui(n),u&4&&o!==null&&o.memoizedState.isDehydrated)try{Zs(a.containerInfo)}catch(_e){xt(n,n.return,_e)}vd&&(vd=!1,Mp(n));break;case 4:u=Ji,Ji=Cc(n.stateNode.containerInfo),ci(a,n),ui(n),Ji=u;break;case 12:ci(a,n),ui(n);break;case 31:ci(a,n),ui(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,mc(n,u)));break;case 13:ci(a,n),ui(n),n.child.flags&8192&&n.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(pc=Zt()),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,mc(n,u)));break;case 22:m=n.memoizedState!==null;var H=o!==null&&o.memoizedState!==null,W=Or,re=pn;if(Or=W||m,pn=re||H,ci(a,n),pn=re,Or=W,ui(n),u&8192)e:for(a=n.stateNode,a._visibility=m?a._visibility&-2:a._visibility|1,m&&(o===null||H||Or||pn||Ka(n)),o=null,a=n;;){if(a.tag===5||a.tag===26){if(o===null){H=o=a;try{if(p=H.stateNode,m)w=p.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{z=H.stateNode;var ce=H.memoizedProps.style,Q=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;z.style.display=Q==null||typeof Q=="boolean"?"":(""+Q).trim()}}catch(_e){xt(H,H.return,_e)}}}else if(a.tag===6){if(o===null){H=a;try{H.stateNode.nodeValue=m?"":H.memoizedProps}catch(_e){xt(H,H.return,_e)}}}else if(a.tag===18){if(o===null){H=a;try{var ne=H.stateNode;m?pv(ne,!0):pv(H.stateNode,!1)}catch(_e){xt(H,H.return,_e)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===n)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===n)break e;for(;a.sibling===null;){if(a.return===null||a.return===n)break e;o===a&&(o=null),a=a.return}o===a&&(o=null),a.sibling.return=a.return,a=a.sibling}u&4&&(u=n.updateQueue,u!==null&&(o=u.retryQueue,o!==null&&(u.retryQueue=null,mc(n,o))));break;case 19:ci(a,n),ui(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,mc(n,u)));break;case 30:break;case 21:break;default:ci(a,n),ui(n)}}function ui(n){var a=n.flags;if(a&2){try{for(var o,u=n.return;u!==null;){if(yp(u)){o=u;break}u=u.return}if(o==null)throw Error(r(160));switch(o.tag){case 27:var m=o.stateNode,p=gd(n);hc(n,p,m);break;case 5:var w=o.stateNode;o.flags&32&&(ei(w,""),o.flags&=-33);var z=gd(n);hc(n,z,w);break;case 3:case 4:var H=o.stateNode.containerInfo,W=gd(n);pd(n,W,H);break;default:throw Error(r(161))}}catch(re){xt(n,n.return,re)}n.flags&=-3}a&4096&&(n.flags&=-4097)}function Mp(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var a=n;Mp(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),n=n.sibling}}function Lr(n,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)wp(n,a.alternate,a),a=a.sibling}function Ka(n){for(n=n.child;n!==null;){var a=n;switch(a.tag){case 0:case 11:case 14:case 15:ga(4,a,a.return),Ka(a);break;case 1:mr(a,a.return);var o=a.stateNode;typeof o.componentWillUnmount=="function"&&pp(a,a.return,o),Ka(a);break;case 27:qo(a.stateNode);case 26:case 5:mr(a,a.return),Ka(a);break;case 22:a.memoizedState===null&&Ka(a);break;case 30:Ka(a);break;default:Ka(a)}n=n.sibling}}function Ur(n,a,o){for(o=o&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var u=a.alternate,m=n,p=a,w=p.flags;switch(p.tag){case 0:case 11:case 15:Ur(m,p,o),Bo(4,p);break;case 1:if(Ur(m,p,o),u=p,m=u.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(W){xt(u,u.return,W)}if(u=p,m=u.updateQueue,m!==null){var z=u.stateNode;try{var H=m.shared.hiddenCallbacks;if(H!==null)for(m.shared.hiddenCallbacks=null,m=0;m<H.length;m++)rg(H[m],z)}catch(W){xt(u,u.return,W)}}o&&w&64&&gp(p),$o(p,p.return);break;case 27:bp(p);case 26:case 5:Ur(m,p,o),o&&u===null&&w&4&&vp(p),$o(p,p.return);break;case 12:Ur(m,p,o);break;case 31:Ur(m,p,o),o&&w&4&&Tp(m,p);break;case 13:Ur(m,p,o),o&&w&4&&Ep(m,p);break;case 22:p.memoizedState===null&&Ur(m,p,o),$o(p,p.return);break;case 30:break;default:Ur(m,p,o)}a=a.sibling}}function yd(n,a){var o=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),n=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(n=a.memoizedState.cachePool.pool),n!==o&&(n!=null&&n.refCount++,o!=null&&zo(o))}function bd(n,a){n=null,a.alternate!==null&&(n=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==n&&(a.refCount++,n!=null&&zo(n))}function er(n,a,o,u){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Cp(n,a,o,u),a=a.sibling}function Cp(n,a,o,u){var m=a.flags;switch(a.tag){case 0:case 11:case 15:er(n,a,o,u),m&2048&&Bo(9,a);break;case 1:er(n,a,o,u);break;case 3:er(n,a,o,u),m&2048&&(n=null,a.alternate!==null&&(n=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==n&&(a.refCount++,n!=null&&zo(n)));break;case 12:if(m&2048){er(n,a,o,u),n=a.stateNode;try{var p=a.memoizedProps,w=p.id,z=p.onPostCommit;typeof z=="function"&&z(w,a.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(H){xt(a,a.return,H)}}else er(n,a,o,u);break;case 31:er(n,a,o,u);break;case 13:er(n,a,o,u);break;case 23:break;case 22:p=a.stateNode,w=a.alternate,a.memoizedState!==null?p._visibility&2?er(n,a,o,u):Go(n,a):p._visibility&2?er(n,a,o,u):(p._visibility|=2,js(n,a,o,u,(a.subtreeFlags&10256)!==0||!1)),m&2048&&yd(w,a);break;case 24:er(n,a,o,u),m&2048&&bd(a.alternate,a);break;default:er(n,a,o,u)}}function js(n,a,o,u,m){for(m=m&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var p=n,w=a,z=o,H=u,W=w.flags;switch(w.tag){case 0:case 11:case 15:js(p,w,z,H,m),Bo(8,w);break;case 23:break;case 22:var re=w.stateNode;w.memoizedState!==null?re._visibility&2?js(p,w,z,H,m):Go(p,w):(re._visibility|=2,js(p,w,z,H,m)),m&&W&2048&&yd(w.alternate,w);break;case 24:js(p,w,z,H,m),m&&W&2048&&bd(w.alternate,w);break;default:js(p,w,z,H,m)}a=a.sibling}}function Go(n,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var o=n,u=a,m=u.flags;switch(u.tag){case 22:Go(o,u),m&2048&&yd(u.alternate,u);break;case 24:Go(o,u),m&2048&&bd(u.alternate,u);break;default:Go(o,u)}a=a.sibling}}var Yo=8192;function Ls(n,a,o){if(n.subtreeFlags&Yo)for(n=n.child;n!==null;)Ap(n,a,o),n=n.sibling}function Ap(n,a,o){switch(n.tag){case 26:Ls(n,a,o),n.flags&Yo&&n.memoizedState!==null&&MS(o,Ji,n.memoizedState,n.memoizedProps);break;case 5:Ls(n,a,o);break;case 3:case 4:var u=Ji;Ji=Cc(n.stateNode.containerInfo),Ls(n,a,o),Ji=u;break;case 22:n.memoizedState===null&&(u=n.alternate,u!==null&&u.memoizedState!==null?(u=Yo,Yo=16777216,Ls(n,a,o),Yo=u):Ls(n,a,o));break;default:Ls(n,a,o)}}function Np(n){var a=n.alternate;if(a!==null&&(n=a.child,n!==null)){a.child=null;do a=n.sibling,n.sibling=null,n=a;while(n!==null)}}function Fo(n){var a=n.deletions;if((n.flags&16)!==0){if(a!==null)for(var o=0;o<a.length;o++){var u=a[o];Rn=u,kp(u,n)}Np(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Rp(n),n=n.sibling}function Rp(n){switch(n.tag){case 0:case 11:case 15:Fo(n),n.flags&2048&&ga(9,n,n.return);break;case 3:Fo(n);break;case 12:Fo(n);break;case 22:var a=n.stateNode;n.memoizedState!==null&&a._visibility&2&&(n.return===null||n.return.tag!==13)?(a._visibility&=-3,gc(n)):Fo(n);break;default:Fo(n)}}function gc(n){var a=n.deletions;if((n.flags&16)!==0){if(a!==null)for(var o=0;o<a.length;o++){var u=a[o];Rn=u,kp(u,n)}Np(n)}for(n=n.child;n!==null;){switch(a=n,a.tag){case 0:case 11:case 15:ga(8,a,a.return),gc(a);break;case 22:o=a.stateNode,o._visibility&2&&(o._visibility&=-3,gc(a));break;default:gc(a)}n=n.sibling}}function kp(n,a){for(;Rn!==null;){var o=Rn;switch(o.tag){case 0:case 11:case 15:ga(8,o,a);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var u=o.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:zo(o.memoizedState.cache)}if(u=o.child,u!==null)u.return=o,Rn=u;else e:for(o=n;Rn!==null;){u=Rn;var m=u.sibling,p=u.return;if(_p(u),u===o){Rn=null;break e}if(m!==null){m.return=p,Rn=m;break e}Rn=p}}}var Y_={getCacheForType:function(n){var a=$n(hn),o=a.data.get(n);return o===void 0&&(o=n(),a.data.set(n,o)),o},cacheSignal:function(){return $n(hn).controller.signal}},F_=typeof WeakMap=="function"?WeakMap:Map,ft=0,kt=null,Qe=null,et=0,bt=0,Mi=null,pa=!1,Us=!1,xd=!1,Hr=0,Qt=0,va=0,Qa=0,wd=0,Ci=0,Hs=0,Po=null,fi=null,_d=!1,pc=0,Dp=0,vc=1/0,yc=null,ya=null,wn=0,ba=null,Bs=null,Br=0,Sd=0,Td=null,Op=null,Vo=0,Ed=null;function Ai(){return(ft&2)!==0&&et!==0?et&-et:D.T!==null?Rd():Xi()}function jp(){if(Ci===0)if((et&536870912)===0||nt){var n=xi;xi<<=1,(xi&3932160)===0&&(xi=262144),Ci=n}else Ci=536870912;return n=Ei.current,n!==null&&(n.flags|=32),Ci}function di(n,a,o){(n===kt&&(bt===2||bt===9)||n.cancelPendingCommit!==null)&&($s(n,0),xa(n,et,Ci,!1)),Ve(n,o),((ft&2)===0||n!==kt)&&(n===kt&&((ft&2)===0&&(Qa|=o),Qt===4&&xa(n,et,Ci,!1)),gr(n))}function Lp(n,a,o){if((ft&6)!==0)throw Error(r(327));var u=!o&&(a&127)===0&&(a&n.expiredLanes)===0||Le(n,a),m=u?Z_(n,a):Md(n,a,!0),p=u;do{if(m===0){Us&&!u&&xa(n,a,0,!1);break}else{if(o=n.current.alternate,p&&!P_(o)){m=Md(n,a,!1),p=!1;continue}if(m===2){if(p=a,n.errorRecoveryDisabledLanes&p)var w=0;else w=n.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){a=w;e:{var z=n;m=Po;var H=z.current.memoizedState.isDehydrated;if(H&&($s(z,w).flags|=256),w=Md(z,w,!1),w!==2){if(xd&&!H){z.errorRecoveryDisabledLanes|=p,Qa|=p,m=4;break e}p=fi,fi=m,p!==null&&(fi===null?fi=p:fi.push.apply(fi,p))}m=w}if(p=!1,m!==2)continue}}if(m===1){$s(n,0),xa(n,a,0,!0);break}e:{switch(u=n,p=m,p){case 0:case 1:throw Error(r(345));case 4:if((a&4194048)!==a)break;case 6:xa(u,a,Ci,!pa);break e;case 2:fi=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(m=pc+300-Zt(),10<m)){if(xa(u,a,Ci,!pa),Dt(u,0,!0)!==0)break e;Br=a,u.timeoutHandle=hv(Up.bind(null,u,o,fi,yc,_d,a,Ci,Qa,Hs,pa,p,"Throttled",-0,0),m);break e}Up(u,o,fi,yc,_d,a,Ci,Qa,Hs,pa,p,null,-0,0)}}break}while(!0);gr(n)}function Up(n,a,o,u,m,p,w,z,H,W,re,ce,Q,ne){if(n.timeoutHandle=-1,ce=a.subtreeFlags,ce&8192||(ce&16785408)===16785408){ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:jt},Ap(a,p,ce);var _e=(p&62914560)===p?pc-Zt():(p&4194048)===p?Dp-Zt():0;if(_e=CS(ce,_e),_e!==null){Br=p,n.cancelPendingCommit=_e(Vp.bind(null,n,a,p,o,u,m,w,z,H,re,ce,null,Q,ne)),xa(n,p,w,!W);return}}Vp(n,a,p,o,u,m,w,z,H)}function P_(n){for(var a=n;;){var o=a.tag;if((o===0||o===11||o===15)&&a.flags&16384&&(o=a.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var u=0;u<o.length;u++){var m=o[u],p=m.getSnapshot;m=m.value;try{if(!Si(p(),m))return!1}catch{return!1}}if(o=a.child,a.subtreeFlags&16384&&o!==null)o.return=a,a=o;else{if(a===n)break;for(;a.sibling===null;){if(a.return===null||a.return===n)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function xa(n,a,o,u){a&=~wd,a&=~Qa,n.suspendedLanes|=a,n.pingedLanes&=~a,u&&(n.warmLanes|=a),u=n.expirationTimes;for(var m=a;0<m;){var p=31-We(m),w=1<<p;u[p]=-1,m&=~w}o!==0&&gs(n,o,a)}function bc(){return(ft&6)===0?(Zo(0),!1):!0}function zd(){if(Qe!==null){if(bt===0)var n=Qe.return;else n=Qe,Cr=Fa=null,Yf(n),Ns=null,Co=0,n=Qe;for(;n!==null;)mp(n.alternate,n),n=n.return;Qe=null}}function $s(n,a){var o=n.timeoutHandle;o!==-1&&(n.timeoutHandle=-1,uS(o)),o=n.cancelPendingCommit,o!==null&&(n.cancelPendingCommit=null,o()),Br=0,zd(),kt=n,Qe=o=zr(n.current,null),et=a,bt=0,Mi=null,pa=!1,Us=Le(n,a),xd=!1,Hs=Ci=wd=Qa=va=Qt=0,fi=Po=null,_d=!1,(a&8)!==0&&(a|=a&32);var u=n.entangledLanes;if(u!==0)for(n=n.entanglements,u&=a;0<u;){var m=31-We(u),p=1<<m;a|=n[m],u&=~p}return Hr=a,$l(),o}function Hp(n,a){Ze=null,D.H=Lo,a===As||a===Xl?(a=eg(),bt=3):a===Nf?(a=eg(),bt=4):bt=a===rd?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,Mi=a,Qe===null&&(Qt=1,lc(n,Hi(a,n.current)))}function Bp(){var n=Ei.current;return n===null?!0:(et&4194048)===et?Yi===null:(et&62914560)===et||(et&536870912)!==0?n===Yi:!1}function $p(){var n=D.H;return D.H=Lo,n===null?Lo:n}function Gp(){var n=D.A;return D.A=Y_,n}function xc(){Qt=4,pa||(et&4194048)!==et&&Ei.current!==null||(Us=!0),(va&134217727)===0&&(Qa&134217727)===0||kt===null||xa(kt,et,Ci,!1)}function Md(n,a,o){var u=ft;ft|=2;var m=$p(),p=Gp();(kt!==n||et!==a)&&(yc=null,$s(n,a)),a=!1;var w=Qt;e:do try{if(bt!==0&&Qe!==null){var z=Qe,H=Mi;switch(bt){case 8:zd(),w=6;break e;case 3:case 2:case 9:case 6:Ei.current===null&&(a=!0);var W=bt;if(bt=0,Mi=null,Gs(n,z,H,W),o&&Us){w=0;break e}break;default:W=bt,bt=0,Mi=null,Gs(n,z,H,W)}}V_(),w=Qt;break}catch(re){Hp(n,re)}while(!0);return a&&n.shellSuspendCounter++,Cr=Fa=null,ft=u,D.H=m,D.A=p,Qe===null&&(kt=null,et=0,$l()),w}function V_(){for(;Qe!==null;)Yp(Qe)}function Z_(n,a){var o=ft;ft|=2;var u=$p(),m=Gp();kt!==n||et!==a?(yc=null,vc=Zt()+500,$s(n,a)):Us=Le(n,a);e:do try{if(bt!==0&&Qe!==null){a=Qe;var p=Mi;t:switch(bt){case 1:bt=0,Mi=null,Gs(n,a,p,1);break;case 2:case 9:if(Q0(p)){bt=0,Mi=null,Fp(a);break}a=function(){bt!==2&&bt!==9||kt!==n||(bt=7),gr(n)},p.then(a,a);break e;case 3:bt=7;break e;case 4:bt=5;break e;case 7:Q0(p)?(bt=0,Mi=null,Fp(a)):(bt=0,Mi=null,Gs(n,a,p,7));break;case 5:var w=null;switch(Qe.tag){case 26:w=Qe.memoizedState;case 5:case 27:var z=Qe;if(w?Cv(w):z.stateNode.complete){bt=0,Mi=null;var H=z.sibling;if(H!==null)Qe=H;else{var W=z.return;W!==null?(Qe=W,wc(W)):Qe=null}break t}}bt=0,Mi=null,Gs(n,a,p,5);break;case 6:bt=0,Mi=null,Gs(n,a,p,6);break;case 8:zd(),Qt=6;break e;default:throw Error(r(462))}}I_();break}catch(re){Hp(n,re)}while(!0);return Cr=Fa=null,D.H=u,D.A=m,ft=o,Qe!==null?0:(kt=null,et=0,$l(),Qt)}function I_(){for(;Qe!==null&&!bi();)Yp(Qe)}function Yp(n){var a=dp(n.alternate,n,Hr);n.memoizedProps=n.pendingProps,a===null?wc(n):Qe=a}function Fp(n){var a=n,o=a.alternate;switch(a.tag){case 15:case 0:a=sp(o,a,a.pendingProps,a.type,void 0,et);break;case 11:a=sp(o,a,a.pendingProps,a.type.render,a.ref,et);break;case 5:Yf(a);default:mp(o,a),a=Qe=G0(a,Hr),a=dp(o,a,Hr)}n.memoizedProps=n.pendingProps,a===null?wc(n):Qe=a}function Gs(n,a,o,u){Cr=Fa=null,Yf(a),Ns=null,Co=0;var m=a.return;try{if(j_(n,m,a,o,et)){Qt=1,lc(n,Hi(o,n.current)),Qe=null;return}}catch(p){if(m!==null)throw Qe=m,p;Qt=1,lc(n,Hi(o,n.current)),Qe=null;return}a.flags&32768?(nt||u===1?n=!0:Us||(et&536870912)!==0?n=!1:(pa=n=!0,(u===2||u===9||u===3||u===6)&&(u=Ei.current,u!==null&&u.tag===13&&(u.flags|=16384))),Pp(a,n)):wc(a)}function wc(n){var a=n;do{if((a.flags&32768)!==0){Pp(a,pa);return}n=a.return;var o=H_(a.alternate,a,Hr);if(o!==null){Qe=o;return}if(a=a.sibling,a!==null){Qe=a;return}Qe=a=n}while(a!==null);Qt===0&&(Qt=5)}function Pp(n,a){do{var o=B_(n.alternate,n);if(o!==null){o.flags&=32767,Qe=o;return}if(o=n.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!a&&(n=n.sibling,n!==null)){Qe=n;return}Qe=n=o}while(n!==null);Qt=6,Qe=null}function Vp(n,a,o,u,m,p,w,z,H){n.cancelPendingCommit=null;do _c();while(wn!==0);if((ft&6)!==0)throw Error(r(327));if(a!==null){if(a===n.current)throw Error(r(177));if(p=a.lanes|a.childLanes,p|=gf,ji(n,o,p,w,z,H),n===kt&&(Qe=kt=null,et=0),Bs=a,ba=n,Br=o,Sd=p,Td=m,Op=u,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,K_(on,function(){return Wp(),null})):(n.callbackNode=null,n.callbackPriority=0),u=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||u){u=D.T,D.T=null,m=V.p,V.p=2,w=ft,ft|=4;try{$_(n,a,o)}finally{ft=w,V.p=m,D.T=u}}wn=1,Zp(),Ip(),Xp()}}function Zp(){if(wn===1){wn=0;var n=ba,a=Bs,o=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||o){o=D.T,D.T=null;var u=V.p;V.p=2;var m=ft;ft|=4;try{zp(a,n);var p=Bd,w=k0(n.containerInfo),z=p.focusedElem,H=p.selectionRange;if(w!==z&&z&&z.ownerDocument&&R0(z.ownerDocument.documentElement,z)){if(H!==null&&uf(z)){var W=H.start,re=H.end;if(re===void 0&&(re=W),"selectionStart"in z)z.selectionStart=W,z.selectionEnd=Math.min(re,z.value.length);else{var ce=z.ownerDocument||document,Q=ce&&ce.defaultView||window;if(Q.getSelection){var ne=Q.getSelection(),_e=z.textContent.length,Oe=Math.min(H.start,_e),Et=H.end===void 0?Oe:Math.min(H.end,_e);!ne.extend&&Oe>Et&&(w=Et,Et=Oe,Oe=w);var Z=N0(z,Oe),G=N0(z,Et);if(Z&&G&&(ne.rangeCount!==1||ne.anchorNode!==Z.node||ne.anchorOffset!==Z.offset||ne.focusNode!==G.node||ne.focusOffset!==G.offset)){var q=ce.createRange();q.setStart(Z.node,Z.offset),ne.removeAllRanges(),Oe>Et?(ne.addRange(q),ne.extend(G.node,G.offset)):(q.setEnd(G.node,G.offset),ne.addRange(q))}}}}for(ce=[],ne=z;ne=ne.parentNode;)ne.nodeType===1&&ce.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;z<ce.length;z++){var oe=ce[z];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}Oc=!!Hd,Bd=Hd=null}finally{ft=m,V.p=u,D.T=o}}n.current=a,wn=2}}function Ip(){if(wn===2){wn=0;var n=ba,a=Bs,o=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||o){o=D.T,D.T=null;var u=V.p;V.p=2;var m=ft;ft|=4;try{wp(n,a.alternate,a)}finally{ft=m,V.p=u,D.T=o}}wn=3}}function Xp(){if(wn===4||wn===3){wn=0,or();var n=ba,a=Bs,o=Br,u=Op;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?wn=5:(wn=0,Bs=ba=null,qp(n,n.pendingLanes));var m=n.pendingLanes;if(m===0&&(ya=null),Pn(o),a=a.stateNode,me&&typeof me.onCommitFiberRoot=="function")try{me.onCommitFiberRoot(pe,a,void 0,(a.current.flags&128)===128)}catch{}if(u!==null){a=D.T,m=V.p,V.p=2,D.T=null;try{for(var p=n.onRecoverableError,w=0;w<u.length;w++){var z=u[w];p(z.value,{componentStack:z.stack})}}finally{D.T=a,V.p=m}}(Br&3)!==0&&_c(),gr(n),m=n.pendingLanes,(o&261930)!==0&&(m&42)!==0?n===Ed?Vo++:(Vo=0,Ed=n):Vo=0,Zo(0)}}function qp(n,a){(n.pooledCacheLanes&=a)===0&&(a=n.pooledCache,a!=null&&(n.pooledCache=null,zo(a)))}function _c(){return Zp(),Ip(),Xp(),Wp()}function Wp(){if(wn!==5)return!1;var n=ba,a=Sd;Sd=0;var o=Pn(Br),u=D.T,m=V.p;try{V.p=32>o?32:o,D.T=null,o=Td,Td=null;var p=ba,w=Br;if(wn=0,Bs=ba=null,Br=0,(ft&6)!==0)throw Error(r(331));var z=ft;if(ft|=4,Rp(p.current),Cp(p,p.current,w,o),ft=z,Zo(0,!1),me&&typeof me.onPostCommitFiberRoot=="function")try{me.onPostCommitFiberRoot(pe,p)}catch{}return!0}finally{V.p=m,D.T=u,qp(n,a)}}function Kp(n,a,o){a=Hi(o,a),a=id(n.stateNode,a,2),n=da(n,a,2),n!==null&&(Ve(n,2),gr(n))}function xt(n,a,o){if(n.tag===3)Kp(n,n,o);else for(;a!==null;){if(a.tag===3){Kp(a,n,o);break}else if(a.tag===1){var u=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(ya===null||!ya.has(u))){n=Hi(o,n),o=Qg(2),u=da(a,o,2),u!==null&&(Jg(o,u,a,n),Ve(u,2),gr(u));break}}a=a.return}}function Cd(n,a,o){var u=n.pingCache;if(u===null){u=n.pingCache=new F_;var m=new Set;u.set(a,m)}else m=u.get(a),m===void 0&&(m=new Set,u.set(a,m));m.has(o)||(xd=!0,m.add(o),n=X_.bind(null,n,a,o),a.then(n,n))}function X_(n,a,o){var u=n.pingCache;u!==null&&u.delete(a),n.pingedLanes|=n.suspendedLanes&o,n.warmLanes&=~o,kt===n&&(et&o)===o&&(Qt===4||Qt===3&&(et&62914560)===et&&300>Zt()-pc?(ft&2)===0&&$s(n,0):wd|=o,Hs===et&&(Hs=0)),gr(n)}function Qp(n,a){a===0&&(a=He()),n=$a(n,a),n!==null&&(Ve(n,a),gr(n))}function q_(n){var a=n.memoizedState,o=0;a!==null&&(o=a.retryLane),Qp(n,o)}function W_(n,a){var o=0;switch(n.tag){case 31:case 13:var u=n.stateNode,m=n.memoizedState;m!==null&&(o=m.retryLane);break;case 19:u=n.stateNode;break;case 22:u=n.stateNode._retryCache;break;default:throw Error(r(314))}u!==null&&u.delete(a),Qp(n,o)}function K_(n,a){return vn(n,a)}var Sc=null,Ys=null,Ad=!1,Tc=!1,Nd=!1,wa=0;function gr(n){n!==Ys&&n.next===null&&(Ys===null?Sc=Ys=n:Ys=Ys.next=n),Tc=!0,Ad||(Ad=!0,J_())}function Zo(n,a){if(!Nd&&Tc){Nd=!0;do for(var o=!1,u=Sc;u!==null;){if(n!==0){var m=u.pendingLanes;if(m===0)var p=0;else{var w=u.suspendedLanes,z=u.pingedLanes;p=(1<<31-We(42|n)+1)-1,p&=m&~(w&~z),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(o=!0,nv(u,p))}else p=et,p=Dt(u,u===kt?p:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(p&3)===0||Le(u,p)||(o=!0,nv(u,p));u=u.next}while(o);Nd=!1}}function Q_(){Jp()}function Jp(){Tc=Ad=!1;var n=0;wa!==0&&cS()&&(n=wa);for(var a=Zt(),o=null,u=Sc;u!==null;){var m=u.next,p=ev(u,a);p===0?(u.next=null,o===null?Sc=m:o.next=m,m===null&&(Ys=o)):(o=u,(n!==0||(p&3)!==0)&&(Tc=!0)),u=m}wn!==0&&wn!==5||Zo(n),wa!==0&&(wa=0)}function ev(n,a){for(var o=n.suspendedLanes,u=n.pingedLanes,m=n.expirationTimes,p=n.pendingLanes&-62914561;0<p;){var w=31-We(p),z=1<<w,H=m[w];H===-1?((z&o)===0||(z&u)!==0)&&(m[w]=oi(z,a)):H<=a&&(n.expiredLanes|=z),p&=~z}if(a=kt,o=et,o=Dt(n,n===a?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u=n.callbackNode,o===0||n===a&&(bt===2||bt===9)||n.cancelPendingCommit!==null)return u!==null&&u!==null&&Di(u),n.callbackNode=null,n.callbackPriority=0;if((o&3)===0||Le(n,o)){if(a=o&-o,a===n.callbackPriority)return a;switch(u!==null&&Di(u),Pn(o)){case 2:case 8:o=Kn;break;case 32:o=on;break;case 268435456:o=ee;break;default:o=on}return u=tv.bind(null,n),o=vn(o,u),n.callbackPriority=a,n.callbackNode=o,a}return u!==null&&u!==null&&Di(u),n.callbackPriority=2,n.callbackNode=null,2}function tv(n,a){if(wn!==0&&wn!==5)return n.callbackNode=null,n.callbackPriority=0,null;var o=n.callbackNode;if(_c()&&n.callbackNode!==o)return null;var u=et;return u=Dt(n,n===kt?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u===0?null:(Lp(n,u,a),ev(n,Zt()),n.callbackNode!=null&&n.callbackNode===o?tv.bind(null,n):null)}function nv(n,a){if(_c())return null;Lp(n,a,!0)}function J_(){fS(function(){(ft&6)!==0?vn(En,Q_):Jp()})}function Rd(){if(wa===0){var n=Ms;n===0&&(n=Ut,Ut<<=1,(Ut&261888)===0&&(Ut=256)),wa=n}return wa}function iv(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Rt(""+n)}function rv(n,a){var o=a.ownerDocument.createElement("input");return o.name=a.name,o.value=a.value,n.id&&o.setAttribute("form",n.id),a.parentNode.insertBefore(o,a),n=new FormData(n),o.parentNode.removeChild(o),n}function eS(n,a,o,u,m){if(a==="submit"&&o&&o.stateNode===m){var p=iv((m[On]||null).action),w=u.submitter;w&&(a=(a=w[On]||null)?iv(a.formAction):w.getAttribute("formAction"),a!==null&&(p=a,w=null));var z=new La("action","action",null,u,m);n.push({event:z,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(wa!==0){var H=w?rv(m,w):new FormData(m);Kf(o,{pending:!0,data:H,method:m.method,action:p},null,H)}}else typeof p=="function"&&(z.preventDefault(),H=w?rv(m,w):new FormData(m),Kf(o,{pending:!0,data:H,method:m.method,action:p},p,H))},currentTarget:m}]})}}for(var kd=0;kd<mf.length;kd++){var Dd=mf[kd],tS=Dd.toLowerCase(),nS=Dd[0].toUpperCase()+Dd.slice(1);Qi(tS,"on"+nS)}Qi(j0,"onAnimationEnd"),Qi(L0,"onAnimationIteration"),Qi(U0,"onAnimationStart"),Qi("dblclick","onDoubleClick"),Qi("focusin","onFocus"),Qi("focusout","onBlur"),Qi(y_,"onTransitionRun"),Qi(b_,"onTransitionStart"),Qi(x_,"onTransitionCancel"),Qi(H0,"onTransitionEnd"),gt("onMouseEnter",["mouseout","mouseover"]),gt("onMouseLeave",["mouseout","mouseover"]),gt("onPointerEnter",["pointerout","pointerover"]),gt("onPointerLeave",["pointerout","pointerover"]),$e("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),$e("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),$e("onBeforeInput",["compositionend","keypress","textInput","paste"]),$e("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),$e("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),$e("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Io="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),iS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Io));function av(n,a){a=(a&4)!==0;for(var o=0;o<n.length;o++){var u=n[o],m=u.event;u=u.listeners;e:{var p=void 0;if(a)for(var w=u.length-1;0<=w;w--){var z=u[w],H=z.instance,W=z.currentTarget;if(z=z.listener,H!==p&&m.isPropagationStopped())break e;p=z,m.currentTarget=W;try{p(m)}catch(re){Bl(re)}m.currentTarget=null,p=H}else for(w=0;w<u.length;w++){if(z=u[w],H=z.instance,W=z.currentTarget,z=z.listener,H!==p&&m.isPropagationStopped())break e;p=z,m.currentTarget=W;try{p(m)}catch(re){Bl(re)}m.currentTarget=null,p=H}}}}function Je(n,a){var o=a[ps];o===void 0&&(o=a[ps]=new Set);var u=n+"__bubble";o.has(u)||(sv(a,n,2,!1),o.add(u))}function Od(n,a,o){var u=0;a&&(u|=4),sv(o,n,u,a)}var Ec="_reactListening"+Math.random().toString(36).slice(2);function jd(n){if(!n[Ec]){n[Ec]=!0,Be.forEach(function(o){o!=="selectionchange"&&(iS.has(o)||Od(o,!1,n),Od(o,!0,n))});var a=n.nodeType===9?n:n.ownerDocument;a===null||a[Ec]||(a[Ec]=!0,Od("selectionchange",!1,a))}}function sv(n,a,o,u){switch(jv(a)){case 2:var m=RS;break;case 8:m=kS;break;default:m=Wd}o=m.bind(null,a,o,n),m=void 0,!_t||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(m=!0),u?m!==void 0?n.addEventListener(a,o,{capture:!0,passive:m}):n.addEventListener(a,o,!0):m!==void 0?n.addEventListener(a,o,{passive:m}):n.addEventListener(a,o,!1)}function Ld(n,a,o,u,m){var p=u;if((a&1)===0&&(a&2)===0&&u!==null)e:for(;;){if(u===null)return;var w=u.tag;if(w===3||w===4){var z=u.stateNode.containerInfo;if(z===m)break;if(w===4)for(w=u.return;w!==null;){var H=w.tag;if((H===3||H===4)&&w.stateNode.containerInfo===m)return;w=w.return}for(;z!==null;){if(w=_r(z),w===null)return;if(H=w.tag,H===5||H===6||H===26||H===27){u=p=w;continue e}z=z.parentNode}}u=u.return}wi(function(){var W=p,re=Ae(o),ce=[];e:{var Q=B0.get(n);if(Q!==void 0){var ne=La,_e=n;switch(n){case"keypress":if(Ke(o)===0)break e;case"keydown":case"keyup":ne=Ww;break;case"focusin":_e="focus",ne=af;break;case"focusout":_e="blur",ne=af;break;case"beforeblur":case"afterblur":ne=af;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ne=m0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=Hw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=Jw;break;case j0:case L0:case U0:ne=Gw;break;case H0:ne=t_;break;case"scroll":case"scrollend":ne=Lw;break;case"wheel":ne=i_;break;case"copy":case"cut":case"paste":ne=Fw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=p0;break;case"toggle":case"beforetoggle":ne=a_}var Oe=(a&4)!==0,Et=!Oe&&(n==="scroll"||n==="scrollend"),Z=Oe?Q!==null?Q+"Capture":null:Q;Oe=[];for(var G=W,q;G!==null;){var oe=G;if(q=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||q===null||Z===null||(oe=vt(G,Z),oe!=null&&Oe.push(Xo(G,oe,q))),Et)break;G=G.return}0<Oe.length&&(Q=new ne(Q,_e,null,o,re),ce.push({event:Q,listeners:Oe}))}}if((a&7)===0){e:{if(Q=n==="mouseover"||n==="pointerover",ne=n==="mouseout"||n==="pointerout",Q&&o!==pt&&(_e=o.relatedTarget||o.fromElement)&&(_r(_e)||_e[wr]))break e;if((ne||Q)&&(Q=re.window===re?re:(Q=re.ownerDocument)?Q.defaultView||Q.parentWindow:window,ne?(_e=o.relatedTarget||o.toElement,ne=W,_e=_e?_r(_e):null,_e!==null&&(Et=l(_e),Oe=_e.tag,_e!==Et||Oe!==5&&Oe!==27&&Oe!==6)&&(_e=null)):(ne=null,_e=W),ne!==_e)){if(Oe=m0,oe="onMouseLeave",Z="onMouseEnter",G="mouse",(n==="pointerout"||n==="pointerover")&&(Oe=p0,oe="onPointerLeave",Z="onPointerEnter",G="pointer"),Et=ne==null?Q:ia(ne),q=_e==null?Q:ia(_e),Q=new Oe(oe,G+"leave",ne,o,re),Q.target=Et,Q.relatedTarget=q,oe=null,_r(re)===W&&(Oe=new Oe(Z,G+"enter",_e,o,re),Oe.target=q,Oe.relatedTarget=Et,oe=Oe),Et=oe,ne&&_e)t:{for(Oe=rS,Z=ne,G=_e,q=0,oe=Z;oe;oe=Oe(oe))q++;oe=0;for(var Re=G;Re;Re=Oe(Re))oe++;for(;0<q-oe;)Z=Oe(Z),q--;for(;0<oe-q;)G=Oe(G),oe--;for(;q--;){if(Z===G||G!==null&&Z===G.alternate){Oe=Z;break t}Z=Oe(Z),G=Oe(G)}Oe=null}else Oe=null;ne!==null&&ov(ce,Q,ne,Oe,!1),_e!==null&&Et!==null&&ov(ce,Et,_e,Oe,!0)}}e:{if(Q=W?ia(W):window,ne=Q.nodeName&&Q.nodeName.toLowerCase(),ne==="select"||ne==="input"&&Q.type==="file")var rt=T0;else if(_0(Q))if(E0)rt=g_;else{rt=h_;var Te=d_}else ne=Q.nodeName,!ne||ne.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?W&&Li(W.elementType)&&(rt=T0):rt=m_;if(rt&&(rt=rt(n,W))){S0(ce,rt,o,re);break e}Te&&Te(n,Q,W),n==="focusout"&&W&&Q.type==="number"&&W.memoizedProps.value!=null&&An(Q,"number",Q.value)}switch(Te=W?ia(W):window,n){case"focusin":(_0(Te)||Te.contentEditable==="true")&&(bs=Te,ff=W,So=null);break;case"focusout":So=ff=bs=null;break;case"mousedown":df=!0;break;case"contextmenu":case"mouseup":case"dragend":df=!1,D0(ce,o,re);break;case"selectionchange":if(v_)break;case"keydown":case"keyup":D0(ce,o,re)}var Xe;if(of)e:{switch(n){case"compositionstart":var tt="onCompositionStart";break e;case"compositionend":tt="onCompositionEnd";break e;case"compositionupdate":tt="onCompositionUpdate";break e}tt=void 0}else ys?x0(n,o)&&(tt="onCompositionEnd"):n==="keydown"&&o.keyCode===229&&(tt="onCompositionStart");tt&&(v0&&o.locale!=="ko"&&(ys||tt!=="onCompositionStart"?tt==="onCompositionEnd"&&ys&&(Xe=dn()):(_i=re,Se="value"in _i?_i.value:_i.textContent,ys=!0)),Te=zc(W,tt),0<Te.length&&(tt=new g0(tt,n,null,o,re),ce.push({event:tt,listeners:Te}),Xe?tt.data=Xe:(Xe=w0(o),Xe!==null&&(tt.data=Xe)))),(Xe=o_?l_(n,o):c_(n,o))&&(tt=zc(W,"onBeforeInput"),0<tt.length&&(Te=new g0("onBeforeInput","beforeinput",null,o,re),ce.push({event:Te,listeners:tt}),Te.data=Xe)),eS(ce,n,W,o,re)}av(ce,a)})}function Xo(n,a,o){return{instance:n,listener:a,currentTarget:o}}function zc(n,a){for(var o=a+"Capture",u=[];n!==null;){var m=n,p=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||p===null||(m=vt(n,o),m!=null&&u.unshift(Xo(n,m,p)),m=vt(n,a),m!=null&&u.push(Xo(n,m,p))),n.tag===3)return u;n=n.return}return[]}function rS(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function ov(n,a,o,u,m){for(var p=a._reactName,w=[];o!==null&&o!==u;){var z=o,H=z.alternate,W=z.stateNode;if(z=z.tag,H!==null&&H===u)break;z!==5&&z!==26&&z!==27||W===null||(H=W,m?(W=vt(o,p),W!=null&&w.unshift(Xo(o,W,H))):m||(W=vt(o,p),W!=null&&w.push(Xo(o,W,H)))),o=o.return}w.length!==0&&n.push({event:a,listeners:w})}var aS=/\r\n?/g,sS=/\u0000|\uFFFD/g;function lv(n){return(typeof n=="string"?n:""+n).replace(aS,`
49
+ `).replace(sS,"")}function cv(n,a){return a=lv(a),lv(n)===a}function Tt(n,a,o,u,m,p){switch(o){case"children":typeof u=="string"?a==="body"||a==="textarea"&&u===""||ei(n,u):(typeof u=="number"||typeof u=="bigint")&&a!=="body"&&ei(n,""+u);break;case"className":It(n,"class",u);break;case"tabIndex":It(n,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":It(n,o,u);break;case"style":Yt(n,u,p);break;case"data":if(a!=="object"){It(n,"data",u);break}case"src":case"href":if(u===""&&(a!=="a"||o!=="href")){n.removeAttribute(o);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(o);break}u=Rt(""+u),n.setAttribute(o,u);break;case"action":case"formAction":if(typeof u=="function"){n.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof p=="function"&&(o==="formAction"?(a!=="input"&&Tt(n,a,"name",m.name,m,null),Tt(n,a,"formEncType",m.formEncType,m,null),Tt(n,a,"formMethod",m.formMethod,m,null),Tt(n,a,"formTarget",m.formTarget,m,null)):(Tt(n,a,"encType",m.encType,m,null),Tt(n,a,"method",m.method,m,null),Tt(n,a,"target",m.target,m,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(o);break}u=Rt(""+u),n.setAttribute(o,u);break;case"onClick":u!=null&&(n.onclick=jt);break;case"onScroll":u!=null&&Je("scroll",n);break;case"onScrollEnd":u!=null&&Je("scrollend",n);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(o=u.__html,o!=null){if(m.children!=null)throw Error(r(60));n.innerHTML=o}}break;case"multiple":n.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":n.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){n.removeAttribute("xlink:href");break}o=Rt(""+u),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(o,""+u):n.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(o,""):n.removeAttribute(o);break;case"capture":case"download":u===!0?n.setAttribute(o,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(o,u):n.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?n.setAttribute(o,u):n.removeAttribute(o);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?n.removeAttribute(o):n.setAttribute(o,u);break;case"popover":Je("beforetoggle",n),Je("toggle",n),Ht(n,"popover",u);break;case"xlinkActuate":wt(n,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":wt(n,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":wt(n,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":wt(n,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":wt(n,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":wt(n,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":wt(n,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":wt(n,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":wt(n,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":Ht(n,"is",u);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=Er.get(o)||o,Ht(n,o,u))}}function Ud(n,a,o,u,m,p){switch(o){case"style":Yt(n,u,p);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(o=u.__html,o!=null){if(m.children!=null)throw Error(r(60));n.innerHTML=o}}break;case"children":typeof u=="string"?ei(n,u):(typeof u=="number"||typeof u=="bigint")&&ei(n,""+u);break;case"onScroll":u!=null&&Je("scroll",n);break;case"onScrollEnd":u!=null&&Je("scrollend",n);break;case"onClick":u!=null&&(n.onclick=jt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ot.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(m=o.endsWith("Capture"),a=o.slice(2,m?o.length-7:void 0),p=n[On]||null,p=p!=null?p[o]:null,typeof p=="function"&&n.removeEventListener(a,p,m),typeof u=="function")){typeof p!="function"&&p!==null&&(o in n?n[o]=null:n.hasAttribute(o)&&n.removeAttribute(o)),n.addEventListener(a,u,m);break e}o in n?n[o]=u:u===!0?n.setAttribute(o,""):Ht(n,o,u)}}}function Yn(n,a,o){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Je("error",n),Je("load",n);var u=!1,m=!1,p;for(p in o)if(o.hasOwnProperty(p)){var w=o[p];if(w!=null)switch(p){case"src":u=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Tt(n,a,p,w,o,null)}}m&&Tt(n,a,"srcSet",o.srcSet,o,null),u&&Tt(n,a,"src",o.src,o,null);return;case"input":Je("invalid",n);var z=p=w=m=null,H=null,W=null;for(u in o)if(o.hasOwnProperty(u)){var re=o[u];if(re!=null)switch(u){case"name":m=re;break;case"type":w=re;break;case"checked":H=re;break;case"defaultChecked":W=re;break;case"value":p=re;break;case"defaultValue":z=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(r(137,a));break;default:Tt(n,a,u,re,o,null)}}fn(n,p,z,H,W,w,m,!1);return;case"select":Je("invalid",n),u=w=p=null;for(m in o)if(o.hasOwnProperty(m)&&(z=o[m],z!=null))switch(m){case"value":p=z;break;case"defaultValue":w=z;break;case"multiple":u=z;default:Tt(n,a,m,z,o,null)}a=p,o=w,n.multiple=!!u,a!=null?Un(n,!!u,a,!1):o!=null&&Un(n,!!u,o,!0);return;case"textarea":Je("invalid",n),p=m=u=null;for(w in o)if(o.hasOwnProperty(w)&&(z=o[w],z!=null))switch(w){case"value":u=z;break;case"defaultValue":m=z;break;case"children":p=z;break;case"dangerouslySetInnerHTML":if(z!=null)throw Error(r(91));break;default:Tt(n,a,w,z,o,null)}Jn(n,u,m,p);return;case"option":for(H in o)if(o.hasOwnProperty(H)&&(u=o[H],u!=null))switch(H){case"selected":n.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:Tt(n,a,H,u,o,null)}return;case"dialog":Je("beforetoggle",n),Je("toggle",n),Je("cancel",n),Je("close",n);break;case"iframe":case"object":Je("load",n);break;case"video":case"audio":for(u=0;u<Io.length;u++)Je(Io[u],n);break;case"image":Je("error",n),Je("load",n);break;case"details":Je("toggle",n);break;case"embed":case"source":case"link":Je("error",n),Je("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(W in o)if(o.hasOwnProperty(W)&&(u=o[W],u!=null))switch(W){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Tt(n,a,W,u,o,null)}return;default:if(Li(a)){for(re in o)o.hasOwnProperty(re)&&(u=o[re],u!==void 0&&Ud(n,a,re,u,o,void 0));return}}for(z in o)o.hasOwnProperty(z)&&(u=o[z],u!=null&&Tt(n,a,z,u,o,null))}function oS(n,a,o,u){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,p=null,w=null,z=null,H=null,W=null,re=null;for(ne in o){var ce=o[ne];if(o.hasOwnProperty(ne)&&ce!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":H=ce;default:u.hasOwnProperty(ne)||Tt(n,a,ne,null,u,ce)}}for(var Q in u){var ne=u[Q];if(ce=o[Q],u.hasOwnProperty(Q)&&(ne!=null||ce!=null))switch(Q){case"type":p=ne;break;case"name":m=ne;break;case"checked":W=ne;break;case"defaultChecked":re=ne;break;case"value":w=ne;break;case"defaultValue":z=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(r(137,a));break;default:ne!==ce&&Tt(n,a,Q,ne,u,ce)}}un(n,w,z,H,W,re,p,m);return;case"select":ne=w=z=Q=null;for(p in o)if(H=o[p],o.hasOwnProperty(p)&&H!=null)switch(p){case"value":break;case"multiple":ne=H;default:u.hasOwnProperty(p)||Tt(n,a,p,null,u,H)}for(m in u)if(p=u[m],H=o[m],u.hasOwnProperty(m)&&(p!=null||H!=null))switch(m){case"value":Q=p;break;case"defaultValue":z=p;break;case"multiple":w=p;default:p!==H&&Tt(n,a,m,p,u,H)}a=z,o=w,u=ne,Q!=null?Un(n,!!o,Q,!1):!!u!=!!o&&(a!=null?Un(n,!!o,a,!0):Un(n,!!o,o?[]:"",!1));return;case"textarea":ne=Q=null;for(z in o)if(m=o[z],o.hasOwnProperty(z)&&m!=null&&!u.hasOwnProperty(z))switch(z){case"value":break;case"children":break;default:Tt(n,a,z,null,u,m)}for(w in u)if(m=u[w],p=o[w],u.hasOwnProperty(w)&&(m!=null||p!=null))switch(w){case"value":Q=m;break;case"defaultValue":ne=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(r(91));break;default:m!==p&&Tt(n,a,w,m,u,p)}Hn(n,Q,ne);return;case"option":for(var _e in o)if(Q=o[_e],o.hasOwnProperty(_e)&&Q!=null&&!u.hasOwnProperty(_e))switch(_e){case"selected":n.selected=!1;break;default:Tt(n,a,_e,null,u,Q)}for(H in u)if(Q=u[H],ne=o[H],u.hasOwnProperty(H)&&Q!==ne&&(Q!=null||ne!=null))switch(H){case"selected":n.selected=Q&&typeof Q!="function"&&typeof Q!="symbol";break;default:Tt(n,a,H,Q,u,ne)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Oe in o)Q=o[Oe],o.hasOwnProperty(Oe)&&Q!=null&&!u.hasOwnProperty(Oe)&&Tt(n,a,Oe,null,u,Q);for(W in u)if(Q=u[W],ne=o[W],u.hasOwnProperty(W)&&Q!==ne&&(Q!=null||ne!=null))switch(W){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(r(137,a));break;default:Tt(n,a,W,Q,u,ne)}return;default:if(Li(a)){for(var Et in o)Q=o[Et],o.hasOwnProperty(Et)&&Q!==void 0&&!u.hasOwnProperty(Et)&&Ud(n,a,Et,void 0,u,Q);for(re in u)Q=u[re],ne=o[re],!u.hasOwnProperty(re)||Q===ne||Q===void 0&&ne===void 0||Ud(n,a,re,Q,u,ne);return}}for(var Z in o)Q=o[Z],o.hasOwnProperty(Z)&&Q!=null&&!u.hasOwnProperty(Z)&&Tt(n,a,Z,null,u,Q);for(ce in u)Q=u[ce],ne=o[ce],!u.hasOwnProperty(ce)||Q===ne||Q==null&&ne==null||Tt(n,a,ce,Q,u,ne)}function uv(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function lS(){if(typeof performance.getEntriesByType=="function"){for(var n=0,a=0,o=performance.getEntriesByType("resource"),u=0;u<o.length;u++){var m=o[u],p=m.transferSize,w=m.initiatorType,z=m.duration;if(p&&z&&uv(w)){for(w=0,z=m.responseEnd,u+=1;u<o.length;u++){var H=o[u],W=H.startTime;if(W>z)break;var re=H.transferSize,ce=H.initiatorType;re&&uv(ce)&&(H=H.responseEnd,w+=re*(H<z?1:(z-W)/(H-W)))}if(--u,a+=8*(p+w)/(m.duration/1e3),n++,10<n)break}}if(0<n)return a/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var Hd=null,Bd=null;function Mc(n){return n.nodeType===9?n:n.ownerDocument}function fv(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function dv(n,a){if(n===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&a==="foreignObject"?0:n}function $d(n,a){return n==="textarea"||n==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var Gd=null;function cS(){var n=window.event;return n&&n.type==="popstate"?n===Gd?!1:(Gd=n,!0):(Gd=null,!1)}var hv=typeof setTimeout=="function"?setTimeout:void 0,uS=typeof clearTimeout=="function"?clearTimeout:void 0,mv=typeof Promise=="function"?Promise:void 0,fS=typeof queueMicrotask=="function"?queueMicrotask:typeof mv<"u"?function(n){return mv.resolve(null).then(n).catch(dS)}:hv;function dS(n){setTimeout(function(){throw n})}function _a(n){return n==="head"}function gv(n,a){var o=a,u=0;do{var m=o.nextSibling;if(n.removeChild(o),m&&m.nodeType===8)if(o=m.data,o==="/$"||o==="/&"){if(u===0){n.removeChild(m),Zs(a);return}u--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")u++;else if(o==="html")qo(n.ownerDocument.documentElement);else if(o==="head"){o=n.ownerDocument.head,qo(o);for(var p=o.firstChild;p;){var w=p.nextSibling,z=p.nodeName;p[na]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&p.rel.toLowerCase()==="stylesheet"||o.removeChild(p),p=w}}else o==="body"&&qo(n.ownerDocument.body);o=m}while(o);Zs(a)}function pv(n,a){var o=n;n=0;do{var u=o.nextSibling;if(o.nodeType===1?a?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(a?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),u&&u.nodeType===8)if(o=u.data,o==="/$"){if(n===0)break;n--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||n++;o=u}while(o)}function Yd(n){var a=n.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var o=a;switch(a=a.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":Yd(o),vs(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}n.removeChild(o)}}function hS(n,a,o,u){for(;n.nodeType===1;){var m=o;if(n.nodeName.toLowerCase()!==a.toLowerCase()){if(!u&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(u){if(!n[na])switch(a){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(p=n.getAttribute("rel"),p==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(p!==m.rel||n.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||n.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||n.getAttribute("title")!==(m.title==null?null:m.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(p=n.getAttribute("src"),(p!==(m.src==null?null:m.src)||n.getAttribute("type")!==(m.type==null?null:m.type)||n.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&p&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(a==="input"&&n.type==="hidden"){var p=m.name==null?null:""+m.name;if(m.type==="hidden"&&n.getAttribute("name")===p)return n}else return n;if(n=Fi(n.nextSibling),n===null)break}return null}function mS(n,a,o){if(a==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!o||(n=Fi(n.nextSibling),n===null))return null;return n}function vv(n,a){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!a||(n=Fi(n.nextSibling),n===null))return null;return n}function Fd(n){return n.data==="$?"||n.data==="$~"}function Pd(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function gS(n,a){var o=n.ownerDocument;if(n.data==="$~")n._reactRetry=a;else if(n.data!=="$?"||o.readyState!=="loading")a();else{var u=function(){a(),o.removeEventListener("DOMContentLoaded",u)};o.addEventListener("DOMContentLoaded",u),n._reactRetry=u}}function Fi(n){for(;n!=null;n=n.nextSibling){var a=n.nodeType;if(a===1||a===3)break;if(a===8){if(a=n.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return n}var Vd=null;function yv(n){n=n.nextSibling;for(var a=0;n;){if(n.nodeType===8){var o=n.data;if(o==="/$"||o==="/&"){if(a===0)return Fi(n.nextSibling);a--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||a++}n=n.nextSibling}return null}function bv(n){n=n.previousSibling;for(var a=0;n;){if(n.nodeType===8){var o=n.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(a===0)return n;a--}else o!=="/$"&&o!=="/&"||a++}n=n.previousSibling}return null}function xv(n,a,o){switch(a=Mc(o),n){case"html":if(n=a.documentElement,!n)throw Error(r(452));return n;case"head":if(n=a.head,!n)throw Error(r(453));return n;case"body":if(n=a.body,!n)throw Error(r(454));return n;default:throw Error(r(451))}}function qo(n){for(var a=n.attributes;a.length;)n.removeAttributeNode(a[0]);vs(n)}var Pi=new Map,wv=new Set;function Cc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var $r=V.d;V.d={f:pS,r:vS,D:yS,C:bS,L:xS,m:wS,X:SS,S:_S,M:TS};function pS(){var n=$r.f(),a=bc();return n||a}function vS(n){var a=Sr(n);a!==null&&a.tag===5&&a.type==="form"?Hg(a):$r.r(n)}var Fs=typeof document>"u"?null:document;function _v(n,a,o){var u=Fs;if(u&&typeof a=="string"&&a){var m=Nt(a);m='link[rel="'+n+'"][href="'+m+'"]',typeof o=="string"&&(m+='[crossorigin="'+o+'"]'),wv.has(m)||(wv.add(m),n={rel:n,crossOrigin:o,href:a},u.querySelector(m)===null&&(a=u.createElement("link"),Yn(a,"link",n),tn(a),u.head.appendChild(a)))}}function yS(n){$r.D(n),_v("dns-prefetch",n,null)}function bS(n,a){$r.C(n,a),_v("preconnect",n,a)}function xS(n,a,o){$r.L(n,a,o);var u=Fs;if(u&&n&&a){var m='link[rel="preload"][as="'+Nt(a)+'"]';a==="image"&&o&&o.imageSrcSet?(m+='[imagesrcset="'+Nt(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(m+='[imagesizes="'+Nt(o.imageSizes)+'"]')):m+='[href="'+Nt(n)+'"]';var p=m;switch(a){case"style":p=Ps(n);break;case"script":p=Vs(n)}Pi.has(p)||(n=v({rel:"preload",href:a==="image"&&o&&o.imageSrcSet?void 0:n,as:a},o),Pi.set(p,n),u.querySelector(m)!==null||a==="style"&&u.querySelector(Wo(p))||a==="script"&&u.querySelector(Ko(p))||(a=u.createElement("link"),Yn(a,"link",n),tn(a),u.head.appendChild(a)))}}function wS(n,a){$r.m(n,a);var o=Fs;if(o&&n){var u=a&&typeof a.as=="string"?a.as:"script",m='link[rel="modulepreload"][as="'+Nt(u)+'"][href="'+Nt(n)+'"]',p=m;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=Vs(n)}if(!Pi.has(p)&&(n=v({rel:"modulepreload",href:n},a),Pi.set(p,n),o.querySelector(m)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Ko(p)))return}u=o.createElement("link"),Yn(u,"link",n),tn(u),o.head.appendChild(u)}}}function _S(n,a,o){$r.S(n,a,o);var u=Fs;if(u&&n){var m=Tr(u).hoistableStyles,p=Ps(n);a=a||"default";var w=m.get(p);if(!w){var z={loading:0,preload:null};if(w=u.querySelector(Wo(p)))z.loading=5;else{n=v({rel:"stylesheet",href:n,"data-precedence":a},o),(o=Pi.get(p))&&Zd(n,o);var H=w=u.createElement("link");tn(H),Yn(H,"link",n),H._p=new Promise(function(W,re){H.onload=W,H.onerror=re}),H.addEventListener("load",function(){z.loading|=1}),H.addEventListener("error",function(){z.loading|=2}),z.loading|=4,Ac(w,a,u)}w={type:"stylesheet",instance:w,count:1,state:z},m.set(p,w)}}}function SS(n,a){$r.X(n,a);var o=Fs;if(o&&n){var u=Tr(o).hoistableScripts,m=Vs(n),p=u.get(m);p||(p=o.querySelector(Ko(m)),p||(n=v({src:n,async:!0},a),(a=Pi.get(m))&&Id(n,a),p=o.createElement("script"),tn(p),Yn(p,"link",n),o.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},u.set(m,p))}}function TS(n,a){$r.M(n,a);var o=Fs;if(o&&n){var u=Tr(o).hoistableScripts,m=Vs(n),p=u.get(m);p||(p=o.querySelector(Ko(m)),p||(n=v({src:n,async:!0,type:"module"},a),(a=Pi.get(m))&&Id(n,a),p=o.createElement("script"),tn(p),Yn(p,"link",n),o.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},u.set(m,p))}}function Sv(n,a,o,u){var m=(m=ve.current)?Cc(m):null;if(!m)throw Error(r(446));switch(n){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(a=Ps(o.href),o=Tr(m).hoistableStyles,u=o.get(a),u||(u={type:"style",instance:null,count:0,state:null},o.set(a,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){n=Ps(o.href);var p=Tr(m).hoistableStyles,w=p.get(n);if(w||(m=m.ownerDocument||m,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(n,w),(p=m.querySelector(Wo(n)))&&!p._p&&(w.instance=p,w.state.loading=5),Pi.has(n)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Pi.set(n,o),p||ES(m,n,o,w.state))),a&&u===null)throw Error(r(528,""));return w}if(a&&u!==null)throw Error(r(529,""));return null;case"script":return a=o.async,o=o.src,typeof o=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=Vs(o),o=Tr(m).hoistableScripts,u=o.get(a),u||(u={type:"script",instance:null,count:0,state:null},o.set(a,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,n))}}function Ps(n){return'href="'+Nt(n)+'"'}function Wo(n){return'link[rel="stylesheet"]['+n+"]"}function Tv(n){return v({},n,{"data-precedence":n.precedence,precedence:null})}function ES(n,a,o,u){n.querySelector('link[rel="preload"][as="style"]['+a+"]")?u.loading=1:(a=n.createElement("link"),u.preload=a,a.addEventListener("load",function(){return u.loading|=1}),a.addEventListener("error",function(){return u.loading|=2}),Yn(a,"link",o),tn(a),n.head.appendChild(a))}function Vs(n){return'[src="'+Nt(n)+'"]'}function Ko(n){return"script[async]"+n}function Ev(n,a,o){if(a.count++,a.instance===null)switch(a.type){case"style":var u=n.querySelector('style[data-href~="'+Nt(o.href)+'"]');if(u)return a.instance=u,tn(u),u;var m=v({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return u=(n.ownerDocument||n).createElement("style"),tn(u),Yn(u,"style",m),Ac(u,o.precedence,n),a.instance=u;case"stylesheet":m=Ps(o.href);var p=n.querySelector(Wo(m));if(p)return a.state.loading|=4,a.instance=p,tn(p),p;u=Tv(o),(m=Pi.get(m))&&Zd(u,m),p=(n.ownerDocument||n).createElement("link"),tn(p);var w=p;return w._p=new Promise(function(z,H){w.onload=z,w.onerror=H}),Yn(p,"link",u),a.state.loading|=4,Ac(p,o.precedence,n),a.instance=p;case"script":return p=Vs(o.src),(m=n.querySelector(Ko(p)))?(a.instance=m,tn(m),m):(u=o,(m=Pi.get(p))&&(u=v({},o),Id(u,m)),n=n.ownerDocument||n,m=n.createElement("script"),tn(m),Yn(m,"link",u),n.head.appendChild(m),a.instance=m);case"void":return null;default:throw Error(r(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(u=a.instance,a.state.loading|=4,Ac(u,o.precedence,n));return a.instance}function Ac(n,a,o){for(var u=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=u.length?u[u.length-1]:null,p=m,w=0;w<u.length;w++){var z=u[w];if(z.dataset.precedence===a)p=z;else if(p!==m)break}p?p.parentNode.insertBefore(n,p.nextSibling):(a=o.nodeType===9?o.head:o,a.insertBefore(n,a.firstChild))}function Zd(n,a){n.crossOrigin==null&&(n.crossOrigin=a.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=a.referrerPolicy),n.title==null&&(n.title=a.title)}function Id(n,a){n.crossOrigin==null&&(n.crossOrigin=a.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=a.referrerPolicy),n.integrity==null&&(n.integrity=a.integrity)}var Nc=null;function zv(n,a,o){if(Nc===null){var u=new Map,m=Nc=new Map;m.set(o,u)}else m=Nc,u=m.get(o),u||(u=new Map,m.set(o,u));if(u.has(n))return u;for(u.set(n,null),o=o.getElementsByTagName(n),m=0;m<o.length;m++){var p=o[m];if(!(p[na]||p[ln]||n==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var w=p.getAttribute(a)||"";w=n+w;var z=u.get(w);z?z.push(p):u.set(w,[p])}}return u}function Mv(n,a,o){n=n.ownerDocument||n,n.head.insertBefore(o,a==="title"?n.querySelector("head > title"):null)}function zS(n,a,o){if(o===1||a.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return n=a.disabled,typeof a.precedence=="string"&&n==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function Cv(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function MS(n,a,o,u){if(o.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var m=Ps(u.href),p=a.querySelector(Wo(m));if(p){a=p._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(n.count++,n=Rc.bind(n),a.then(n,n)),o.state.loading|=4,o.instance=p,tn(p);return}p=a.ownerDocument||a,u=Tv(u),(m=Pi.get(m))&&Zd(u,m),p=p.createElement("link"),tn(p);var w=p;w._p=new Promise(function(z,H){w.onload=z,w.onerror=H}),Yn(p,"link",u),o.instance=p}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(o,a),(a=o.state.preload)&&(o.state.loading&3)===0&&(n.count++,o=Rc.bind(n),a.addEventListener("load",o),a.addEventListener("error",o))}}var Xd=0;function CS(n,a){return n.stylesheets&&n.count===0&&Dc(n,n.stylesheets),0<n.count||0<n.imgCount?function(o){var u=setTimeout(function(){if(n.stylesheets&&Dc(n,n.stylesheets),n.unsuspend){var p=n.unsuspend;n.unsuspend=null,p()}},6e4+a);0<n.imgBytes&&Xd===0&&(Xd=62500*lS());var m=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Dc(n,n.stylesheets),n.unsuspend)){var p=n.unsuspend;n.unsuspend=null,p()}},(n.imgBytes>Xd?50:800)+a);return n.unsuspend=o,function(){n.unsuspend=null,clearTimeout(u),clearTimeout(m)}}:null}function Rc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Dc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var kc=null;function Dc(n,a){n.stylesheets=null,n.unsuspend!==null&&(n.count++,kc=new Map,a.forEach(AS,n),kc=null,Rc.call(n))}function AS(n,a){if(!(a.state.loading&4)){var o=kc.get(n);if(o)var u=o.get(null);else{o=new Map,kc.set(n,o);for(var m=n.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<m.length;p++){var w=m[p];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(o.set(w.dataset.precedence,w),u=w)}u&&o.set(null,u)}m=a.instance,w=m.getAttribute("data-precedence"),p=o.get(w)||u,p===u&&o.set(null,m),o.set(w,m),this.count++,u=Rc.bind(this),m.addEventListener("load",u),m.addEventListener("error",u),p?p.parentNode.insertBefore(m,p.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(m,n.firstChild)),a.state.loading|=4}}var Qo={$$typeof:k,Provider:null,Consumer:null,_currentValue:ie,_currentValue2:ie,_threadCount:0};function NS(n,a,o,u,m,p,w,z,H){this.tag=1,this.containerInfo=n,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=mt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mt(0),this.hiddenUpdates=mt(null),this.identifierPrefix=u,this.onUncaughtError=m,this.onCaughtError=p,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=H,this.incompleteTransitions=new Map}function Av(n,a,o,u,m,p,w,z,H,W,re,ce){return n=new NS(n,a,o,w,H,W,re,ce,z),a=1,p===!0&&(a|=24),p=Ti(3,null,null,a),n.current=p,p.stateNode=n,a=Mf(),a.refCount++,n.pooledCache=a,a.refCount++,p.memoizedState={element:u,isDehydrated:o,cache:a},Rf(p),n}function Nv(n){return n?(n=_s,n):_s}function Rv(n,a,o,u,m,p){m=Nv(m),u.context===null?u.context=m:u.pendingContext=m,u=fa(a),u.payload={element:o},p=p===void 0?null:p,p!==null&&(u.callback=p),o=da(n,u,a),o!==null&&(di(o,n,a),No(o,n,a))}function kv(n,a){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var o=n.retryLane;n.retryLane=o!==0&&o<a?o:a}}function qd(n,a){kv(n,a),(n=n.alternate)&&kv(n,a)}function Dv(n){if(n.tag===13||n.tag===31){var a=$a(n,67108864);a!==null&&di(a,n,67108864),qd(n,67108864)}}function Ov(n){if(n.tag===13||n.tag===31){var a=Ai();a=Mn(a);var o=$a(n,a);o!==null&&di(o,n,a),qd(n,a)}}var Oc=!0;function RS(n,a,o,u){var m=D.T;D.T=null;var p=V.p;try{V.p=2,Wd(n,a,o,u)}finally{V.p=p,D.T=m}}function kS(n,a,o,u){var m=D.T;D.T=null;var p=V.p;try{V.p=8,Wd(n,a,o,u)}finally{V.p=p,D.T=m}}function Wd(n,a,o,u){if(Oc){var m=Kd(u);if(m===null)Ld(n,a,u,jc,o),Lv(n,u);else if(OS(m,n,a,o,u))u.stopPropagation();else if(Lv(n,u),a&4&&-1<DS.indexOf(n)){for(;m!==null;){var p=Sr(m);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var w=Oi(p.pendingLanes);if(w!==0){var z=p;for(z.pendingLanes|=2,z.entangledLanes|=2;w;){var H=1<<31-We(w);z.entanglements[1]|=H,w&=~H}gr(p),(ft&6)===0&&(vc=Zt()+500,Zo(0))}}break;case 31:case 13:z=$a(p,2),z!==null&&di(z,p,2),bc(),qd(p,2)}if(p=Kd(u),p===null&&Ld(n,a,u,jc,o),p===m)break;m=p}m!==null&&u.stopPropagation()}else Ld(n,a,u,null,o)}}function Kd(n){return n=Ae(n),Qd(n)}var jc=null;function Qd(n){if(jc=null,n=_r(n),n!==null){var a=l(n);if(a===null)n=null;else{var o=a.tag;if(o===13){if(n=c(a),n!==null)return n;n=null}else if(o===31){if(n=f(a),n!==null)return n;n=null}else if(o===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;n=null}else a!==n&&(n=null)}}return jc=n,null}function jv(n){switch(n){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ta()){case En:return 2;case Kn:return 8;case on:case De:return 32;case ee:return 268435456;default:return 32}default:return 32}}var Jd=!1,Sa=null,Ta=null,Ea=null,Jo=new Map,el=new Map,za=[],DS="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Lv(n,a){switch(n){case"focusin":case"focusout":Sa=null;break;case"dragenter":case"dragleave":Ta=null;break;case"mouseover":case"mouseout":Ea=null;break;case"pointerover":case"pointerout":Jo.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":el.delete(a.pointerId)}}function tl(n,a,o,u,m,p){return n===null||n.nativeEvent!==p?(n={blockedOn:a,domEventName:o,eventSystemFlags:u,nativeEvent:p,targetContainers:[m]},a!==null&&(a=Sr(a),a!==null&&Dv(a)),n):(n.eventSystemFlags|=u,a=n.targetContainers,m!==null&&a.indexOf(m)===-1&&a.push(m),n)}function OS(n,a,o,u,m){switch(a){case"focusin":return Sa=tl(Sa,n,a,o,u,m),!0;case"dragenter":return Ta=tl(Ta,n,a,o,u,m),!0;case"mouseover":return Ea=tl(Ea,n,a,o,u,m),!0;case"pointerover":var p=m.pointerId;return Jo.set(p,tl(Jo.get(p)||null,n,a,o,u,m)),!0;case"gotpointercapture":return p=m.pointerId,el.set(p,tl(el.get(p)||null,n,a,o,u,m)),!0}return!1}function Uv(n){var a=_r(n.target);if(a!==null){var o=l(a);if(o!==null){if(a=o.tag,a===13){if(a=c(o),a!==null){n.blockedOn=a,po(n.priority,function(){Ov(o)});return}}else if(a===31){if(a=f(o),a!==null){n.blockedOn=a,po(n.priority,function(){Ov(o)});return}}else if(a===3&&o.stateNode.current.memoizedState.isDehydrated){n.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Lc(n){if(n.blockedOn!==null)return!1;for(var a=n.targetContainers;0<a.length;){var o=Kd(n.nativeEvent);if(o===null){o=n.nativeEvent;var u=new o.constructor(o.type,o);pt=u,o.target.dispatchEvent(u),pt=null}else return a=Sr(o),a!==null&&Dv(a),n.blockedOn=o,!1;a.shift()}return!0}function Hv(n,a,o){Lc(n)&&o.delete(a)}function jS(){Jd=!1,Sa!==null&&Lc(Sa)&&(Sa=null),Ta!==null&&Lc(Ta)&&(Ta=null),Ea!==null&&Lc(Ea)&&(Ea=null),Jo.forEach(Hv),el.forEach(Hv)}function Uc(n,a){n.blockedOn===a&&(n.blockedOn=null,Jd||(Jd=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,jS)))}var Hc=null;function Bv(n){Hc!==n&&(Hc=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Hc===n&&(Hc=null);for(var a=0;a<n.length;a+=3){var o=n[a],u=n[a+1],m=n[a+2];if(typeof u!="function"){if(Qd(u||o)===null)continue;break}var p=Sr(o);p!==null&&(n.splice(a,3),a-=3,Kf(p,{pending:!0,data:m,method:o.method,action:u},u,m))}}))}function Zs(n){function a(H){return Uc(H,n)}Sa!==null&&Uc(Sa,n),Ta!==null&&Uc(Ta,n),Ea!==null&&Uc(Ea,n),Jo.forEach(a),el.forEach(a);for(var o=0;o<za.length;o++){var u=za[o];u.blockedOn===n&&(u.blockedOn=null)}for(;0<za.length&&(o=za[0],o.blockedOn===null);)Uv(o),o.blockedOn===null&&za.shift();if(o=(n.ownerDocument||n).$$reactFormReplay,o!=null)for(u=0;u<o.length;u+=3){var m=o[u],p=o[u+1],w=m[On]||null;if(typeof p=="function")w||Bv(o);else if(w){var z=null;if(p&&p.hasAttribute("formAction")){if(m=p,w=p[On]||null)z=w.formAction;else if(Qd(m)!==null)continue}else z=w.action;typeof z=="function"?o[u+1]=z:(o.splice(u,3),u-=3),Bv(o)}}}function $v(){function n(p){p.canIntercept&&p.info==="react-transition"&&p.intercept({handler:function(){return new Promise(function(w){return m=w})},focusReset:"manual",scroll:"manual"})}function a(){m!==null&&(m(),m=null),u||setTimeout(o,20)}function o(){if(!u&&!navigation.transition){var p=navigation.currentEntry;p&&p.url!=null&&navigation.navigate(p.url,{state:p.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,m=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(o,100),function(){u=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),m!==null&&(m(),m=null)}}}function eh(n){this._internalRoot=n}Bc.prototype.render=eh.prototype.render=function(n){var a=this._internalRoot;if(a===null)throw Error(r(409));var o=a.current,u=Ai();Rv(o,u,n,a,null,null)},Bc.prototype.unmount=eh.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var a=n.containerInfo;Rv(n.current,2,null,n,null,null),bc(),a[wr]=null}};function Bc(n){this._internalRoot=n}Bc.prototype.unstable_scheduleHydration=function(n){if(n){var a=Xi();n={blockedOn:null,target:n,priority:a};for(var o=0;o<za.length&&a!==0&&a<za[o].priority;o++);za.splice(o,0,n),o===0&&Uv(n)}};var Gv=t.version;if(Gv!=="19.2.7")throw Error(r(527,Gv,"19.2.7"));V.findDOMNode=function(n){var a=n._reactInternals;if(a===void 0)throw typeof n.render=="function"?Error(r(188)):(n=Object.keys(n).join(","),Error(r(268,n)));return n=d(a),n=n!==null?g(n):null,n=n===null?null:n.stateNode,n};var LS={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $c=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$c.isDisabled&&$c.supportsFiber)try{pe=$c.inject(LS),me=$c}catch{}}return il.createRoot=function(n,a){if(!s(n))throw Error(r(299));var o=!1,u="",m=Xg,p=qg,w=Wg;return a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(u=a.identifierPrefix),a.onUncaughtError!==void 0&&(m=a.onUncaughtError),a.onCaughtError!==void 0&&(p=a.onCaughtError),a.onRecoverableError!==void 0&&(w=a.onRecoverableError)),a=Av(n,1,!1,null,null,o,u,null,m,p,w,$v),n[wr]=a.current,jd(n),new eh(a)},il.hydrateRoot=function(n,a,o){if(!s(n))throw Error(r(299));var u=!1,m="",p=Xg,w=qg,z=Wg,H=null;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(m=o.identifierPrefix),o.onUncaughtError!==void 0&&(p=o.onUncaughtError),o.onCaughtError!==void 0&&(w=o.onCaughtError),o.onRecoverableError!==void 0&&(z=o.onRecoverableError),o.formState!==void 0&&(H=o.formState)),a=Av(n,1,!0,a,o??null,u,m,H,p,w,z,$v),a.context=Nv(null),o=a.current,u=Ai(),u=Mn(u),m=fa(u),m.callback=null,da(o,m,u),o=u,a.current.lanes=o,Ve(a,o),gr(a),n[wr]=a.current,jd(n),new Bc(a)},il.version="19.2.7",il}var Kv;function qS(){if(Kv)return ih.exports;Kv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ih.exports=XS(),ih.exports}var Mb=qS();function WS(e){return new Map(e.map(t=>[t.name,t]))}var Qv;function le(e,t,i){function r(f,h){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:h,constr:c,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,h);const d=c.prototype,g=Object.keys(d);for(let v=0;v<g.length;v++){const y=g[v];y in f||(f[y]=d[y].bind(f))}}const s=(i==null?void 0:i.Parent)??Object;class l extends s{}Object.defineProperty(l,"name",{value:e});function c(f){var h;const d=i!=null&&i.Parent?new l:this;r(d,f),(h=d._zod).deferred??(h.deferred=[]);for(const g of d._zod.deferred)g();return d}return Object.defineProperty(c,"init",{value:r}),Object.defineProperty(c,Symbol.hasInstance,{value:f=>{var h,d;return i!=null&&i.Parent&&f instanceof i.Parent?!0:(d=(h=f==null?void 0:f._zod)==null?void 0:h.traits)==null?void 0:d.has(e)}}),Object.defineProperty(c,"name",{value:e}),c}class ro extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Cb extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(Qv=globalThis).__zod_globalConfig??(Qv.__zod_globalConfig={});const pm=globalThis.__zod_globalConfig;function qr(e){return pm}function Ab(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,s])=>t.indexOf(+r)===-1).map(([r,s])=>s)}function jh(e,t){return typeof t=="bigint"?t.toString():t}function vm(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ym(e){return e==null}function bm(e){const t=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(t,i)}function KS(e,t){const i=e/t,r=Math.round(i),s=Number.EPSILON*Math.max(Math.abs(i),1);return Math.abs(i-r)<s?0:i-r}const Jv=Symbol("evaluating");function Ct(e,t,i){let r;Object.defineProperty(e,t,{get(){if(r!==Jv)return r===void 0&&(r=Jv,r=i()),r},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function us(e,t,i){Object.defineProperty(e,t,{value:i,writable:!0,enumerable:!0,configurable:!0})}function Da(...e){const t={};for(const i of e){const r=Object.getOwnPropertyDescriptors(i);Object.assign(t,r)}return Object.defineProperties({},t)}function e1(e){return JSON.stringify(e)}function QS(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Nb="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function du(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const JS=vm(()=>{var e;if(pm.jitless||typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function so(e){if(du(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const i=t.prototype;return!(du(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function Rb(e){return so(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const e3=new Set(["string","number","symbol"]);function Fu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Oa(e,t,i){const r=new e._zod.constr(t??e._zod.def);return(!t||i!=null&&i.parent)&&(r._zod.parent=e),r}function Ce(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function t3(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const n3={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function i3(e,t){const i=e._zod.def,r=i.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const l=Da(e._zod.def,{get shape(){const c={};for(const f in t){if(!(f in i.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(c[f]=i.shape[f])}return us(this,"shape",c),c},checks:[]});return Oa(e,l)}function r3(e,t){const i=e._zod.def,r=i.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const l=Da(e._zod.def,{get shape(){const c={...e._zod.def.shape};for(const f in t){if(!(f in i.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete c[f]}return us(this,"shape",c),c},checks:[]});return Oa(e,l)}function a3(e,t){if(!so(t))throw new Error("Invalid input to extend: expected a plain object");const i=e._zod.def.checks;if(i&&i.length>0){const l=e._zod.def.shape;for(const c in t)if(Object.getOwnPropertyDescriptor(l,c)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Da(e._zod.def,{get shape(){const l={...e._zod.def.shape,...t};return us(this,"shape",l),l}});return Oa(e,s)}function s3(e,t){if(!so(t))throw new Error("Invalid input to safeExtend: expected a plain object");const i=Da(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return us(this,"shape",r),r}});return Oa(e,i)}function o3(e,t){var r;if((r=e._zod.def.checks)!=null&&r.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const i=Da(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t._zod.def.shape};return us(this,"shape",s),s},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Oa(e,i)}function l3(e,t,i){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const c=Da(t._zod.def,{get shape(){const f=t._zod.def.shape,h={...f};if(i)for(const d in i){if(!(d in f))throw new Error(`Unrecognized key: "${d}"`);i[d]&&(h[d]=e?new e({type:"optional",innerType:f[d]}):f[d])}else for(const d in f)h[d]=e?new e({type:"optional",innerType:f[d]}):f[d];return us(this,"shape",h),h},checks:[]});return Oa(t,c)}function c3(e,t,i){const r=Da(t._zod.def,{get shape(){const s=t._zod.def.shape,l={...s};if(i)for(const c in i){if(!(c in l))throw new Error(`Unrecognized key: "${c}"`);i[c]&&(l[c]=new e({type:"nonoptional",innerType:s[c]}))}else for(const c in s)l[c]=new e({type:"nonoptional",innerType:s[c]});return us(this,"shape",l),l}});return Oa(t,r)}function Ks(e,t=0){var i;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((i=e.issues[r])==null?void 0:i.continue)!==!0)return!0;return!1}function u3(e,t=0){var i;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((i=e.issues[r])==null?void 0:i.continue)===!1)return!0;return!1}function Qs(e,t){return t.map(i=>{var r;return(r=i).path??(r.path=[]),i.path.unshift(e),i})}function Gc(e){return typeof e=="string"?e:e==null?void 0:e.message}function Wr(e,t,i){var h,d,g,v,y,x;const r=e.message?e.message:Gc((g=(d=(h=e.inst)==null?void 0:h._zod.def)==null?void 0:d.error)==null?void 0:g.call(d,e))??Gc((v=t==null?void 0:t.error)==null?void 0:v.call(t,e))??Gc((y=i.customError)==null?void 0:y.call(i,e))??Gc((x=i.localeError)==null?void 0:x.call(i,e))??"Invalid input",{inst:s,continue:l,input:c,...f}=e;return f.path??(f.path=[]),f.message=r,t!=null&&t.reportInput&&(f.input=c),f}function xm(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function _l(...e){const[t,i,r]=e;return typeof t=="string"?{message:t,code:"custom",input:i,inst:r}:{...t}}const kb=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,jh,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Db=le("$ZodError",kb),Ob=le("$ZodError",kb,{Parent:Error});function f3(e,t=i=>i.message){const i={},r=[];for(const s of e.issues)s.path.length>0?(i[s.path[0]]=i[s.path[0]]||[],i[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:i}}function d3(e,t=i=>i.message){const i={_errors:[]},r=(s,l=[])=>{for(const c of s.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(f=>r({issues:f},[...l,...c.path]));else if(c.code==="invalid_key")r({issues:c.issues},[...l,...c.path]);else if(c.code==="invalid_element")r({issues:c.issues},[...l,...c.path]);else{const f=[...l,...c.path];if(f.length===0)i._errors.push(t(c));else{let h=i,d=0;for(;d<f.length;){const g=f[d];d===f.length-1?(h[g]=h[g]||{_errors:[]},h[g]._errors.push(t(c))):h[g]=h[g]||{_errors:[]},h=h[g],d++}}}};return r(e),i}const wm=e=>(t,i,r,s)=>{const l=r?{...r,async:!1}:{async:!1},c=t._zod.run({value:i,issues:[]},l);if(c instanceof Promise)throw new ro;if(c.issues.length){const f=new((s==null?void 0:s.Err)??e)(c.issues.map(h=>Wr(h,l,qr())));throw Nb(f,s==null?void 0:s.callee),f}return c.value},_m=e=>async(t,i,r,s)=>{const l=r?{...r,async:!0}:{async:!0};let c=t._zod.run({value:i,issues:[]},l);if(c instanceof Promise&&(c=await c),c.issues.length){const f=new((s==null?void 0:s.Err)??e)(c.issues.map(h=>Wr(h,l,qr())));throw Nb(f,s==null?void 0:s.callee),f}return c.value},Pu=e=>(t,i,r)=>{const s=r?{...r,async:!1}:{async:!1},l=t._zod.run({value:i,issues:[]},s);if(l instanceof Promise)throw new ro;return l.issues.length?{success:!1,error:new(e??Db)(l.issues.map(c=>Wr(c,s,qr())))}:{success:!0,data:l.value}},h3=Pu(Ob),Vu=e=>async(t,i,r)=>{const s=r?{...r,async:!0}:{async:!0};let l=t._zod.run({value:i,issues:[]},s);return l instanceof Promise&&(l=await l),l.issues.length?{success:!1,error:new e(l.issues.map(c=>Wr(c,s,qr())))}:{success:!0,data:l.value}},m3=Vu(Ob),g3=e=>(t,i,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return wm(e)(t,i,s)},p3=e=>(t,i,r)=>wm(e)(t,i,r),v3=e=>async(t,i,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return _m(e)(t,i,s)},y3=e=>async(t,i,r)=>_m(e)(t,i,r),b3=e=>(t,i,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return Pu(e)(t,i,s)},x3=e=>(t,i,r)=>Pu(e)(t,i,r),w3=e=>async(t,i,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return Vu(e)(t,i,s)},_3=e=>async(t,i,r)=>Vu(e)(t,i,r),S3=/^[cC][0-9a-z]{6,}$/,T3=/^[0-9a-z]+$/,E3=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,z3=/^[0-9a-vA-V]{20}$/,M3=/^[A-Za-z0-9]{27}$/,C3=/^[a-zA-Z0-9_-]{21}$/,A3=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,N3=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,t1=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,R3=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,k3="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function D3(){return new RegExp(k3,"u")}const O3=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,j3=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,L3=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,U3=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,H3=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,jb=/^[A-Za-z0-9_-]*$/,B3=/^https?$/,$3=/^\+[1-9]\d{6,14}$/,Lb="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",G3=new RegExp(`^${Lb}$`);function Ub(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Y3(e){return new RegExp(`^${Ub(e)}$`)}function F3(e){const t=Ub({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${i.join("|")})`;return new RegExp(`^${Lb}T(?:${r})$`)}const P3=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},V3=/^-?\d+$/,Hb=/^-?\d+(?:\.\d+)?$/,Z3=/^(?:true|false)$/i,I3=/^[^A-Z]*$/,X3=/^[^a-z]*$/,pi=le("$ZodCheck",(e,t)=>{var i;e._zod??(e._zod={}),e._zod.def=t,(i=e._zod).onattach??(i.onattach=[])}),Bb={number:"number",bigint:"bigint",object:"date"},$b=le("$ZodCheckLessThan",(e,t)=>{pi.init(e,t);const i=Bb[typeof t.value];e._zod.onattach.push(r=>{const s=r._zod.bag,l=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<l&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:i,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Gb=le("$ZodCheckGreaterThan",(e,t)=>{pi.init(e,t);const i=Bb[typeof t.value];e._zod.onattach.push(r=>{const s=r._zod.bag,l=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>l&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:i,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),q3=le("$ZodCheckMultipleOf",(e,t)=>{pi.init(e,t),e._zod.onattach.push(i=>{var r;(r=i._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=i=>{if(typeof i.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof i.value=="bigint"?i.value%t.value===BigInt(0):KS(i.value,t.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:t.value,input:i.value,inst:e,continue:!t.abort})}}),W3=le("$ZodCheckNumberFormat",(e,t)=>{var c;pi.init(e,t),t.format=t.format||"float64";const i=(c=t.format)==null?void 0:c.includes("int"),r=i?"int":"number",[s,l]=n3[t.format];e._zod.onattach.push(f=>{const h=f._zod.bag;h.format=t.format,h.minimum=s,h.maximum=l,i&&(h.pattern=V3)}),e._zod.check=f=>{const h=f.value;if(i){if(!Number.isInteger(h)){f.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:h,inst:e});return}if(!Number.isSafeInteger(h)){h>0?f.issues.push({input:h,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):f.issues.push({input:h,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}h<s&&f.issues.push({origin:"number",input:h,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),h>l&&f.issues.push({origin:"number",input:h,code:"too_big",maximum:l,inclusive:!0,inst:e,continue:!t.abort})}}),K3=le("$ZodCheckMaxLength",(e,t)=>{var i;pi.init(e,t),(i=e._zod.def).when??(i.when=r=>{const s=r.value;return!ym(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const s=r.value;if(s.length<=t.maximum)return;const c=xm(s);r.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Q3=le("$ZodCheckMinLength",(e,t)=>{var i;pi.init(e,t),(i=e._zod.def).when??(i.when=r=>{const s=r.value;return!ym(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const s=r.value;if(s.length>=t.minimum)return;const c=xm(s);r.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),J3=le("$ZodCheckLengthEquals",(e,t)=>{var i;pi.init(e,t),(i=e._zod.def).when??(i.when=r=>{const s=r.value;return!ym(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=r=>{const s=r.value,l=s.length;if(l===t.length)return;const c=xm(s),f=l>t.length;r.issues.push({origin:c,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Zu=le("$ZodCheckStringFormat",(e,t)=>{var i,r;pi.init(e,t),e._zod.onattach.push(s=>{const l=s._zod.bag;l.format=t.format,t.pattern&&(l.patterns??(l.patterns=new Set),l.patterns.add(t.pattern))}),t.pattern?(i=e._zod).check??(i.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),e5=le("$ZodCheckRegex",(e,t)=>{Zu.init(e,t),e._zod.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),t5=le("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=I3),Zu.init(e,t)}),n5=le("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=X3),Zu.init(e,t)}),i5=le("$ZodCheckIncludes",(e,t)=>{pi.init(e,t);const i=Fu(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${i}`:i);t.pattern=r,e._zod.onattach.push(s=>{const l=s._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(r)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),r5=le("$ZodCheckStartsWith",(e,t)=>{pi.init(e,t);const i=new RegExp(`^${Fu(t.prefix)}.*`);t.pattern??(t.pattern=i),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),a5=le("$ZodCheckEndsWith",(e,t)=>{pi.init(e,t);const i=new RegExp(`.*${Fu(t.suffix)}$`);t.pattern??(t.pattern=i),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),s5=le("$ZodCheckOverwrite",(e,t)=>{pi.init(e,t),e._zod.check=i=>{i.value=t.tx(i.value)}});class o5{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
50
+ `).filter(c=>c),s=Math.min(...r.map(c=>c.length-c.trimStart().length)),l=r.map(c=>c.slice(s)).map(c=>" ".repeat(this.indent*2)+c);for(const c of l)this.content.push(c)}compile(){const t=Function,i=this==null?void 0:this.args,s=[...((this==null?void 0:this.content)??[""]).map(l=>` ${l}`)];return new t(...i,s.join(`
51
+ `))}}const l5={major:4,minor:4,patch:3},Jt=le("$ZodType",(e,t)=>{var s;var i;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=l5;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const l of r)for(const c of l._zod.onattach)c(e);if(r.length===0)(i=e._zod).deferred??(i.deferred=[]),(s=e._zod.deferred)==null||s.push(()=>{e._zod.run=e._zod.parse});else{const l=(f,h,d)=>{let g=Ks(f),v;for(const y of h){if(y._zod.def.when){if(u3(f)||!y._zod.def.when(f))continue}else if(g)continue;const x=f.issues.length,S=y._zod.check(f);if(S instanceof Promise&&(d==null?void 0:d.async)===!1)throw new ro;if(v||S instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await S,f.issues.length!==x&&(g||(g=Ks(f,x)))});else{if(f.issues.length===x)continue;g||(g=Ks(f,x))}}return v?v.then(()=>f):f},c=(f,h,d)=>{if(Ks(f))return f.aborted=!0,f;const g=l(h,r,d);if(g instanceof Promise){if(d.async===!1)throw new ro;return g.then(v=>e._zod.parse(v,d))}return e._zod.parse(g,d)};e._zod.run=(f,h)=>{if(h.skipChecks)return e._zod.parse(f,h);if(h.direction==="backward"){const g=e._zod.parse({value:f.value,issues:[]},{...h,skipChecks:!0});return g instanceof Promise?g.then(v=>c(v,f,h)):c(g,f,h)}const d=e._zod.parse(f,h);if(d instanceof Promise){if(h.async===!1)throw new ro;return d.then(g=>l(g,r,h))}return l(d,r,h)}}Ct(e,"~standard",()=>({validate:l=>{var c;try{const f=h3(e,l);return f.success?{value:f.data}:{issues:(c=f.error)==null?void 0:c.issues}}catch{return m3(e,l).then(h=>{var d;return h.success?{value:h.data}:{issues:(d=h.error)==null?void 0:d.issues}})}},vendor:"zod",version:1}))}),Sm=le("$ZodString",(e,t)=>{var i;Jt.init(e,t),e._zod.pattern=[...((i=e==null?void 0:e._zod.bag)==null?void 0:i.patterns)??[]].pop()??P3(e._zod.bag),e._zod.parse=(r,s)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Pt=le("$ZodStringFormat",(e,t)=>{Zu.init(e,t),Sm.init(e,t)}),c5=le("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=N3),Pt.init(e,t)}),u5=le("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=t1(r))}else t.pattern??(t.pattern=t1());Pt.init(e,t)}),f5=le("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=R3),Pt.init(e,t)}),d5=le("$ZodURL",(e,t)=>{Pt.init(e,t),e._zod.check=i=>{var r;try{const s=i.value.trim();if(!t.normalize&&((r=t.protocol)==null?void 0:r.source)===B3.source&&!/^https?:\/\//i.test(s)){i.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:i.value,inst:e,continue:!t.abort});return}const l=new URL(s);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(l.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:i.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(l.protocol.endsWith(":")?l.protocol.slice(0,-1):l.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:i.value,inst:e,continue:!t.abort})),t.normalize?i.value=l.href:i.value=s;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!t.abort})}}}),h5=le("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=D3()),Pt.init(e,t)}),m5=le("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=C3),Pt.init(e,t)}),g5=le("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=S3),Pt.init(e,t)}),p5=le("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=T3),Pt.init(e,t)}),v5=le("$ZodULID",(e,t)=>{t.pattern??(t.pattern=E3),Pt.init(e,t)}),y5=le("$ZodXID",(e,t)=>{t.pattern??(t.pattern=z3),Pt.init(e,t)}),b5=le("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=M3),Pt.init(e,t)}),x5=le("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=F3(t)),Pt.init(e,t)}),w5=le("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=G3),Pt.init(e,t)}),_5=le("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Y3(t)),Pt.init(e,t)}),S5=le("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=A3),Pt.init(e,t)}),T5=le("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=O3),Pt.init(e,t),e._zod.bag.format="ipv4"}),E5=le("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=j3),Pt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:e,continue:!t.abort})}}}),z5=le("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=L3),Pt.init(e,t)}),M5=le("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=U3),Pt.init(e,t),e._zod.check=i=>{const r=i.value.split("/");try{if(r.length!==2)throw new Error;const[s,l]=r;if(!l)throw new Error;const c=Number(l);if(`${c}`!==l)throw new Error;if(c<0||c>128)throw new Error;new URL(`http://[${s}]`)}catch{i.issues.push({code:"invalid_format",format:"cidrv6",input:i.value,inst:e,continue:!t.abort})}}});function Yb(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const C5=le("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=H3),Pt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=i=>{Yb(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:e,continue:!t.abort})}});function A5(e){if(!jb.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),i=t.padEnd(Math.ceil(t.length/4)*4,"=");return Yb(i)}const N5=le("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=jb),Pt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=i=>{A5(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:e,continue:!t.abort})}}),R5=le("$ZodE164",(e,t)=>{t.pattern??(t.pattern=$3),Pt.init(e,t)});function k5(e,t=null){try{const i=e.split(".");if(i.length!==3)return!1;const[r]=i;if(!r)return!1;const s=JSON.parse(atob(r));return!("typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const D5=le("$ZodJWT",(e,t)=>{Pt.init(e,t),e._zod.check=i=>{k5(i.value,t.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:e,continue:!t.abort})}}),Fb=le("$ZodNumber",(e,t)=>{Jt.init(e,t),e._zod.pattern=e._zod.bag.pattern??Hb,e._zod.parse=(i,r)=>{if(t.coerce)try{i.value=Number(i.value)}catch{}const s=i.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return i;const l=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...l?{received:l}:{}}),i}}),O5=le("$ZodNumberFormat",(e,t)=>{W3.init(e,t),Fb.init(e,t)}),j5=le("$ZodBoolean",(e,t)=>{Jt.init(e,t),e._zod.pattern=Z3,e._zod.parse=(i,r)=>{if(t.coerce)try{i.value=!!i.value}catch{}const s=i.value;return typeof s=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),i}}),L5=le("$ZodUnknown",(e,t)=>{Jt.init(e,t),e._zod.parse=i=>i}),U5=le("$ZodNever",(e,t)=>{Jt.init(e,t),e._zod.parse=(i,r)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:e}),i)});function n1(e,t,i){e.issues.length&&t.issues.push(...Qs(i,e.issues)),t.value[i]=e.value}const H5=le("$ZodArray",(e,t)=>{Jt.init(e,t),e._zod.parse=(i,r)=>{const s=i.value;if(!Array.isArray(s))return i.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),i;i.value=Array(s.length);const l=[];for(let c=0;c<s.length;c++){const f=s[c],h=t.element._zod.run({value:f,issues:[]},r);h instanceof Promise?l.push(h.then(d=>n1(d,i,c))):n1(h,i,c)}return l.length?Promise.all(l).then(()=>i):i}});function hu(e,t,i,r,s,l){const c=i in r;if(e.issues.length){if(s&&l&&!c)return;t.issues.push(...Qs(i,e.issues))}if(!c&&!s){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[i]});return}e.value===void 0?c&&(t.value[i]=void 0):t.value[i]=e.value}function Pb(e){var r,s,l,c;const t=Object.keys(e.shape);for(const f of t)if(!((c=(l=(s=(r=e.shape)==null?void 0:r[f])==null?void 0:s._zod)==null?void 0:l.traits)!=null&&c.has("$ZodType")))throw new Error(`Invalid element at key "${f}": expected a Zod schema`);const i=t3(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function Vb(e,t,i,r,s,l){const c=[],f=s.keySet,h=s.catchall._zod,d=h.def.type,g=h.optin==="optional",v=h.optout==="optional";for(const y in t){if(y==="__proto__"||f.has(y))continue;if(d==="never"){c.push(y);continue}const x=h.run({value:t[y],issues:[]},r);x instanceof Promise?e.push(x.then(S=>hu(S,i,y,t,g,v))):hu(x,i,y,t,g,v)}return c.length&&i.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:l}),e.length?Promise.all(e).then(()=>i):i}const B5=le("$ZodObject",(e,t)=>{Jt.init(e,t);const i=Object.getOwnPropertyDescriptor(t,"shape");if(!(i!=null&&i.get)){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const h={...f};return Object.defineProperty(t,"shape",{value:h}),h}})}const r=vm(()=>Pb(t));Ct(e._zod,"propValues",()=>{const f=t.shape,h={};for(const d in f){const g=f[d]._zod;if(g.values){h[d]??(h[d]=new Set);for(const v of g.values)h[d].add(v)}}return h});const s=du,l=t.catchall;let c;e._zod.parse=(f,h)=>{c??(c=r.value);const d=f.value;if(!s(d))return f.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),f;f.value={};const g=[],v=c.shape;for(const y of c.keys){const x=v[y],S=x._zod.optin==="optional",_=x._zod.optout==="optional",T=x._zod.run({value:d[y],issues:[]},h);T instanceof Promise?g.push(T.then(E=>hu(E,f,y,d,S,_))):hu(T,f,y,d,S,_)}return l?Vb(g,d,f,h,r.value,e):g.length?Promise.all(g).then(()=>f):f}}),$5=le("$ZodObjectJIT",(e,t)=>{B5.init(e,t);const i=e._zod.parse,r=vm(()=>Pb(t)),s=y=>{var k,B;const x=new o5(["shape","payload","ctx"]),S=r.value,_=P=>{const N=e1(P);return`shape[${N}]._zod.run({ value: input[${N}], issues: [] }, ctx)`};x.write("const input = payload.value;");const T=Object.create(null);let E=0;for(const P of S.keys)T[P]=`key_${E++}`;x.write("const newResult = {};");for(const P of S.keys){const N=T[P],U=e1(P),A=y[P],$=((k=A==null?void 0:A._zod)==null?void 0:k.optin)==="optional",I=((B=A==null?void 0:A._zod)==null?void 0:B.optout)==="optional";x.write(`const ${N} = ${_(P)};`),$&&I?x.write(`
52
+ if (${N}.issues.length) {
53
+ if (${U} in input) {
54
+ payload.issues = payload.issues.concat(${N}.issues.map(iss => ({
55
+ ...iss,
56
+ path: iss.path ? [${U}, ...iss.path] : [${U}]
57
+ })));
58
+ }
59
+ }
60
+
61
+ if (${N}.value === undefined) {
62
+ if (${U} in input) {
63
+ newResult[${U}] = undefined;
64
+ }
65
+ } else {
66
+ newResult[${U}] = ${N}.value;
67
+ }
68
+
69
+ `):$?x.write(`
70
+ if (${N}.issues.length) {
71
+ payload.issues = payload.issues.concat(${N}.issues.map(iss => ({
72
+ ...iss,
73
+ path: iss.path ? [${U}, ...iss.path] : [${U}]
74
+ })));
75
+ }
76
+
77
+ if (${N}.value === undefined) {
78
+ if (${U} in input) {
79
+ newResult[${U}] = undefined;
80
+ }
81
+ } else {
82
+ newResult[${U}] = ${N}.value;
83
+ }
84
+
85
+ `):x.write(`
86
+ const ${N}_present = ${U} in input;
87
+ if (${N}.issues.length) {
88
+ payload.issues = payload.issues.concat(${N}.issues.map(iss => ({
89
+ ...iss,
90
+ path: iss.path ? [${U}, ...iss.path] : [${U}]
91
+ })));
92
+ }
93
+ if (!${N}_present && !${N}.issues.length) {
94
+ payload.issues.push({
95
+ code: "invalid_type",
96
+ expected: "nonoptional",
97
+ input: undefined,
98
+ path: [${U}]
99
+ });
100
+ }
101
+
102
+ if (${N}_present) {
103
+ if (${N}.value === undefined) {
104
+ newResult[${U}] = undefined;
105
+ } else {
106
+ newResult[${U}] = ${N}.value;
107
+ }
108
+ }
109
+
110
+ `)}x.write("payload.value = newResult;"),x.write("return payload;");const C=x.compile();return(P,N)=>C(y,P,N)};let l;const c=du,f=!pm.jitless,d=f&&JS.value,g=t.catchall;let v;e._zod.parse=(y,x)=>{v??(v=r.value);const S=y.value;return c(S)?f&&d&&(x==null?void 0:x.async)===!1&&x.jitless!==!0?(l||(l=s(t.shape)),y=l(y,x),g?Vb([],S,y,x,v,e):y):i(y,x):(y.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),y)}});function i1(e,t,i,r){for(const l of e)if(l.issues.length===0)return t.value=l.value,t;const s=e.filter(l=>!Ks(l));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:i,errors:e.map(l=>l.issues.map(c=>Wr(c,r,qr())))}),t)}const G5=le("$ZodUnion",(e,t)=>{Jt.init(e,t),Ct(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),Ct(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Ct(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),Ct(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${r.map(s=>bm(s.source)).join("|")})$`)}});const i=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,s)=>{if(i)return i(r,s);let l=!1;const c=[];for(const f of t.options){const h=f._zod.run({value:r.value,issues:[]},s);if(h instanceof Promise)c.push(h),l=!0;else{if(h.issues.length===0)return h;c.push(h)}}return l?Promise.all(c).then(f=>i1(f,r,e,s)):i1(c,r,e,s)}}),Y5=le("$ZodIntersection",(e,t)=>{Jt.init(e,t),e._zod.parse=(i,r)=>{const s=i.value,l=t.left._zod.run({value:s,issues:[]},r),c=t.right._zod.run({value:s,issues:[]},r);return l instanceof Promise||c instanceof Promise?Promise.all([l,c]).then(([h,d])=>r1(i,h,d)):r1(i,l,c)}});function Lh(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(so(e)&&so(t)){const i=Object.keys(t),r=Object.keys(e).filter(l=>i.indexOf(l)!==-1),s={...e,...t};for(const l of r){const c=Lh(e[l],t[l]);if(!c.valid)return{valid:!1,mergeErrorPath:[l,...c.mergeErrorPath]};s[l]=c.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let r=0;r<e.length;r++){const s=e[r],l=t[r],c=Lh(s,l);if(!c.valid)return{valid:!1,mergeErrorPath:[r,...c.mergeErrorPath]};i.push(c.data)}return{valid:!0,data:i}}return{valid:!1,mergeErrorPath:[]}}function r1(e,t,i){const r=new Map;let s;for(const f of t.issues)if(f.code==="unrecognized_keys"){s??(s=f);for(const h of f.keys)r.has(h)||r.set(h,{}),r.get(h).l=!0}else e.issues.push(f);for(const f of i.issues)if(f.code==="unrecognized_keys")for(const h of f.keys)r.has(h)||r.set(h,{}),r.get(h).r=!0;else e.issues.push(f);const l=[...r].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(l.length&&s&&e.issues.push({...s,keys:l}),Ks(e))return e;const c=Lh(t.value,i.value);if(!c.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`);return e.value=c.data,e}const F5=le("$ZodRecord",(e,t)=>{Jt.init(e,t),e._zod.parse=(i,r)=>{const s=i.value;if(!so(s))return i.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),i;const l=[],c=t.keyType._zod.values;if(c){i.value={};const f=new Set;for(const d of c)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){f.add(typeof d=="number"?d.toString():d);const g=t.keyType._zod.run({value:d,issues:[]},r);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(g.issues.length){i.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map(x=>Wr(x,r,qr())),input:d,path:[d],inst:e});continue}const v=g.value,y=t.valueType._zod.run({value:s[d],issues:[]},r);y instanceof Promise?l.push(y.then(x=>{x.issues.length&&i.issues.push(...Qs(d,x.issues)),i.value[v]=x.value})):(y.issues.length&&i.issues.push(...Qs(d,y.issues)),i.value[v]=y.value)}let h;for(const d in s)f.has(d)||(h=h??[],h.push(d));h&&h.length>0&&i.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:h})}else{i.value={};for(const f of Reflect.ownKeys(s)){if(f==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,f))continue;let h=t.keyType._zod.run({value:f,issues:[]},r);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&Hb.test(f)&&h.issues.length){const v=t.keyType._zod.run({value:Number(f),issues:[]},r);if(v instanceof Promise)throw new Error("Async schemas not supported in object keys currently");v.issues.length===0&&(h=v)}if(h.issues.length){t.mode==="loose"?i.value[f]=s[f]:i.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(v=>Wr(v,r,qr())),input:f,path:[f],inst:e});continue}const g=t.valueType._zod.run({value:s[f],issues:[]},r);g instanceof Promise?l.push(g.then(v=>{v.issues.length&&i.issues.push(...Qs(f,v.issues)),i.value[h.value]=v.value})):(g.issues.length&&i.issues.push(...Qs(f,g.issues)),i.value[h.value]=g.value)}}return l.length?Promise.all(l).then(()=>i):i}}),P5=le("$ZodEnum",(e,t)=>{Jt.init(e,t);const i=Ab(t.entries),r=new Set(i);e._zod.values=r,e._zod.pattern=new RegExp(`^(${i.filter(s=>e3.has(typeof s)).map(s=>typeof s=="string"?Fu(s):s.toString()).join("|")})$`),e._zod.parse=(s,l)=>{const c=s.value;return r.has(c)||s.issues.push({code:"invalid_value",values:i,input:c,inst:e}),s}}),V5=le("$ZodTransform",(e,t)=>{Jt.init(e,t),e._zod.optin="optional",e._zod.parse=(i,r)=>{if(r.direction==="backward")throw new Cb(e.constructor.name);const s=t.transform(i.value,i);if(r.async)return(s instanceof Promise?s:Promise.resolve(s)).then(c=>(i.value=c,i.fallback=!0,i));if(s instanceof Promise)throw new ro;return i.value=s,i.fallback=!0,i}});function a1(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Zb=le("$ZodOptional",(e,t)=>{Jt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ct(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ct(e._zod,"pattern",()=>{const i=t.innerType._zod.pattern;return i?new RegExp(`^(${bm(i.source)})?$`):void 0}),e._zod.parse=(i,r)=>{if(t.innerType._zod.optin==="optional"){const s=i.value,l=t.innerType._zod.run(i,r);return l instanceof Promise?l.then(c=>a1(c,s)):a1(l,s)}return i.value===void 0?i:t.innerType._zod.run(i,r)}}),Z5=le("$ZodExactOptional",(e,t)=>{Zb.init(e,t),Ct(e._zod,"values",()=>t.innerType._zod.values),Ct(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(i,r)=>t.innerType._zod.run(i,r)}),I5=le("$ZodNullable",(e,t)=>{Jt.init(e,t),Ct(e._zod,"optin",()=>t.innerType._zod.optin),Ct(e._zod,"optout",()=>t.innerType._zod.optout),Ct(e._zod,"pattern",()=>{const i=t.innerType._zod.pattern;return i?new RegExp(`^(${bm(i.source)}|null)$`):void 0}),Ct(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(i,r)=>i.value===null?i:t.innerType._zod.run(i,r)}),X5=le("$ZodDefault",(e,t)=>{Jt.init(e,t),e._zod.optin="optional",Ct(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,r)=>{if(r.direction==="backward")return t.innerType._zod.run(i,r);if(i.value===void 0)return i.value=t.defaultValue,i;const s=t.innerType._zod.run(i,r);return s instanceof Promise?s.then(l=>s1(l,t)):s1(s,t)}});function s1(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const q5=le("$ZodPrefault",(e,t)=>{Jt.init(e,t),e._zod.optin="optional",Ct(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,r)=>(r.direction==="backward"||i.value===void 0&&(i.value=t.defaultValue),t.innerType._zod.run(i,r))}),W5=le("$ZodNonOptional",(e,t)=>{Jt.init(e,t),Ct(e._zod,"values",()=>{const i=t.innerType._zod.values;return i?new Set([...i].filter(r=>r!==void 0)):void 0}),e._zod.parse=(i,r)=>{const s=t.innerType._zod.run(i,r);return s instanceof Promise?s.then(l=>o1(l,e)):o1(s,e)}});function o1(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const K5=le("$ZodCatch",(e,t)=>{Jt.init(e,t),e._zod.optin="optional",Ct(e._zod,"optout",()=>t.innerType._zod.optout),Ct(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,r)=>{if(r.direction==="backward")return t.innerType._zod.run(i,r);const s=t.innerType._zod.run(i,r);return s instanceof Promise?s.then(l=>(i.value=l.value,l.issues.length&&(i.value=t.catchValue({...i,error:{issues:l.issues.map(c=>Wr(c,r,qr()))},input:i.value}),i.issues=[],i.fallback=!0),i)):(i.value=s.value,s.issues.length&&(i.value=t.catchValue({...i,error:{issues:s.issues.map(l=>Wr(l,r,qr()))},input:i.value}),i.issues=[],i.fallback=!0),i)}}),Ib=le("$ZodPipe",(e,t)=>{Jt.init(e,t),Ct(e._zod,"values",()=>t.in._zod.values),Ct(e._zod,"optin",()=>t.in._zod.optin),Ct(e._zod,"optout",()=>t.out._zod.optout),Ct(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(i,r)=>{if(r.direction==="backward"){const l=t.out._zod.run(i,r);return l instanceof Promise?l.then(c=>Yc(c,t.in,r)):Yc(l,t.in,r)}const s=t.in._zod.run(i,r);return s instanceof Promise?s.then(l=>Yc(l,t.out,r)):Yc(s,t.out,r)}});function Yc(e,t,i){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},i)}const Q5=le("$ZodPreprocess",(e,t)=>{Ib.init(e,t)}),J5=le("$ZodReadonly",(e,t)=>{Jt.init(e,t),Ct(e._zod,"propValues",()=>t.innerType._zod.propValues),Ct(e._zod,"values",()=>t.innerType._zod.values),Ct(e._zod,"optin",()=>{var i,r;return(r=(i=t.innerType)==null?void 0:i._zod)==null?void 0:r.optin}),Ct(e._zod,"optout",()=>{var i,r;return(r=(i=t.innerType)==null?void 0:i._zod)==null?void 0:r.optout}),e._zod.parse=(i,r)=>{if(r.direction==="backward")return t.innerType._zod.run(i,r);const s=t.innerType._zod.run(i,r);return s instanceof Promise?s.then(l1):l1(s)}});function l1(e){return e.value=Object.freeze(e.value),e}const eT=le("$ZodCustom",(e,t)=>{pi.init(e,t),Jt.init(e,t),e._zod.parse=(i,r)=>i,e._zod.check=i=>{const r=i.value,s=t.fn(r);if(s instanceof Promise)return s.then(l=>c1(l,i,r,e));c1(s,i,r,e)}});function c1(e,t,i,r){if(!e){const s={code:"custom",input:i,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(s.params=r._zod.def.params),t.issues.push(_l(s))}}var u1;class tT{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...i){const r=i[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const i=this._map.get(t);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(t),this}get(t){const i=t._zod.parent;if(i){const r={...this.get(i)??{}};delete r.id;const s={...r,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function nT(){return new tT}(u1=globalThis).__zod_globalRegistry??(u1.__zod_globalRegistry=nT());const ml=globalThis.__zod_globalRegistry;function iT(e,t){return new e({type:"string",...Ce(t)})}function rT(e,t){return new e({type:"string",coerce:!0,...Ce(t)})}function aT(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ce(t)})}function f1(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ce(t)})}function sT(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ce(t)})}function oT(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ce(t)})}function lT(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ce(t)})}function cT(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ce(t)})}function uT(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ce(t)})}function fT(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ce(t)})}function dT(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ce(t)})}function hT(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ce(t)})}function mT(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ce(t)})}function gT(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ce(t)})}function pT(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ce(t)})}function vT(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ce(t)})}function yT(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ce(t)})}function bT(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ce(t)})}function xT(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ce(t)})}function wT(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ce(t)})}function _T(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ce(t)})}function ST(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ce(t)})}function TT(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ce(t)})}function ET(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ce(t)})}function zT(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ce(t)})}function MT(e,t){return new e({type:"string",format:"date",check:"string_format",...Ce(t)})}function CT(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ce(t)})}function AT(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ce(t)})}function NT(e,t){return new e({type:"number",checks:[],...Ce(t)})}function RT(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ce(t)})}function kT(e,t){return new e({type:"boolean",...Ce(t)})}function DT(e){return new e({type:"unknown"})}function OT(e,t){return new e({type:"never",...Ce(t)})}function d1(e,t){return new $b({check:"less_than",...Ce(t),value:e,inclusive:!1})}function oh(e,t){return new $b({check:"less_than",...Ce(t),value:e,inclusive:!0})}function h1(e,t){return new Gb({check:"greater_than",...Ce(t),value:e,inclusive:!1})}function lh(e,t){return new Gb({check:"greater_than",...Ce(t),value:e,inclusive:!0})}function m1(e,t){return new q3({check:"multiple_of",...Ce(t),value:e})}function Xb(e,t){return new K3({check:"max_length",...Ce(t),maximum:e})}function mu(e,t){return new Q3({check:"min_length",...Ce(t),minimum:e})}function qb(e,t){return new J3({check:"length_equals",...Ce(t),length:e})}function jT(e,t){return new e5({check:"string_format",format:"regex",...Ce(t),pattern:e})}function LT(e){return new t5({check:"string_format",format:"lowercase",...Ce(e)})}function UT(e){return new n5({check:"string_format",format:"uppercase",...Ce(e)})}function HT(e,t){return new i5({check:"string_format",format:"includes",...Ce(t),includes:e})}function BT(e,t){return new r5({check:"string_format",format:"starts_with",...Ce(t),prefix:e})}function $T(e,t){return new a5({check:"string_format",format:"ends_with",...Ce(t),suffix:e})}function mo(e){return new s5({check:"overwrite",tx:e})}function GT(e){return mo(t=>t.normalize(e))}function YT(){return mo(e=>e.trim())}function FT(){return mo(e=>e.toLowerCase())}function PT(){return mo(e=>e.toUpperCase())}function VT(){return mo(e=>QS(e))}function ZT(e,t,i){return new e({type:"array",element:t,...Ce(i)})}function IT(e,t,i){return new e({type:"custom",check:"custom",fn:t,...Ce(i)})}function XT(e,t){const i=qT(r=>(r.addIssue=s=>{if(typeof s=="string")r.issues.push(_l(s,r.value,i._zod.def));else{const l=s;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=r.value),l.inst??(l.inst=i),l.continue??(l.continue=!i._zod.def.abort),r.issues.push(_l(l))}},e(r.value,r)),t);return i}function qT(e,t){const i=new pi({check:"custom",...Ce(t)});return i._zod.check=e,i}function gu(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??ml,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function Lt(e,t,i={path:[],schemaPath:[]}){var g,v;var r;const s=e._zod.def,l=t.seen.get(e);if(l)return l.count++,i.schemaPath.includes(e)&&(l.cycle=i.path),l.schema;const c={schema:{},count:1,cycle:void 0,path:i.path};t.seen.set(e,c);const f=(v=(g=e._zod).toJSONSchema)==null?void 0:v.call(g);if(f)c.schema=f;else{const y={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,c.schema,y);else{const S=c.schema,_=t.processors[s.type];if(!_)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);_(e,t,S,y)}const x=e._zod.parent;x&&(c.ref||(c.ref=x),Lt(x,t,y),t.seen.get(x).isParent=!0)}const h=t.metadataRegistry.get(e);return h&&Object.assign(c.schema,h),t.io==="input"&&ii(e)&&(delete c.schema.examples,delete c.schema.default),t.io==="input"&&"_prefault"in c.schema&&((r=c.schema).default??(r.default=c.schema._prefault)),delete c.schema._prefault,t.seen.get(e).schema}function pu(e,t){var c,f,h,d;const i=e.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const g of e.seen.entries()){const v=(c=e.metadataRegistry.get(g[0]))==null?void 0:c.id;if(v){const y=r.get(v);if(y&&y!==g[0])throw new Error(`Duplicate schema id "${v}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(v,g[0])}}const s=g=>{var _;const v=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const T=(_=e.external.registry.get(g[0]))==null?void 0:_.id,E=e.external.uri??(k=>k);if(T)return{ref:E(T)};const C=g[1].defId??g[1].schema.id??`schema${e.counter++}`;return g[1].defId=C,{defId:C,ref:`${E("__shared")}#/${v}/${C}`}}if(g[1]===i)return{ref:"#"};const x=`#/${v}/`,S=g[1].schema.id??`__schema${e.counter++}`;return{defId:S,ref:x+S}},l=g=>{if(g[1].schema.$ref)return;const v=g[1],{ref:y,defId:x}=s(g);v.def={...v.schema},x&&(v.defId=x);const S=v.schema;for(const _ in S)delete S[_];S.$ref=y};if(e.cycles==="throw")for(const g of e.seen.entries()){const v=g[1];if(v.cycle)throw new Error(`Cycle detected: #/${(f=v.cycle)==null?void 0:f.join("/")}/<root>
111
+
112
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const g of e.seen.entries()){const v=g[1];if(t===g[0]){l(g);continue}if(e.external){const x=(h=e.external.registry.get(g[0]))==null?void 0:h.id;if(t!==g[0]&&x){l(g);continue}}if((d=e.metadataRegistry.get(g[0]))==null?void 0:d.id){l(g);continue}if(v.cycle){l(g);continue}if(v.count>1&&e.reused==="ref"){l(g);continue}}}function vu(e,t){var f,h,d,g;const i=e.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=v=>{const y=e.seen.get(v);if(y.ref===null)return;const x=y.def??y.schema,S={...x},_=y.ref;if(y.ref=null,_){r(_);const E=e.seen.get(_),C=E.schema;if(C.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(x.allOf=x.allOf??[],x.allOf.push(C)):Object.assign(x,C),Object.assign(x,S),v._zod.parent===_)for(const B in x)B==="$ref"||B==="allOf"||B in S||delete x[B];if(C.$ref&&E.def)for(const B in x)B==="$ref"||B==="allOf"||B in E.def&&JSON.stringify(x[B])===JSON.stringify(E.def[B])&&delete x[B]}const T=v._zod.parent;if(T&&T!==_){r(T);const E=e.seen.get(T);if(E!=null&&E.schema.$ref&&(x.$ref=E.schema.$ref,E.def))for(const C in x)C==="$ref"||C==="allOf"||C in E.def&&JSON.stringify(x[C])===JSON.stringify(E.def[C])&&delete x[C]}e.override({zodSchema:v,jsonSchema:x,path:y.path??[]})};for(const v of[...e.seen.entries()].reverse())r(v[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,(f=e.external)!=null&&f.uri){const v=(h=e.external.registry.get(t))==null?void 0:h.id;if(!v)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(v)}Object.assign(s,i.def??i.schema);const l=(d=e.metadataRegistry.get(t))==null?void 0:d.id;l!==void 0&&s.id===l&&delete s.id;const c=((g=e.external)==null?void 0:g.defs)??{};for(const v of e.seen.entries()){const y=v[1];y.def&&y.defId&&(y.def.id===y.defId&&delete y.def.id,c[y.defId]=y.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?s.$defs=c:s.definitions=c);try{const v=JSON.parse(JSON.stringify(s));return Object.defineProperty(v,"~standard",{value:{...t["~standard"],jsonSchema:{input:yu(t,"input",e.processors),output:yu(t,"output",e.processors)}},enumerable:!1,writable:!1}),v}catch{throw new Error("Error converting schema to JSON.")}}function ii(e,t){const i=t??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return ii(r.element,i);if(r.type==="set")return ii(r.valueType,i);if(r.type==="lazy")return ii(r.getter(),i);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return ii(r.innerType,i);if(r.type==="intersection")return ii(r.left,i)||ii(r.right,i);if(r.type==="record"||r.type==="map")return ii(r.keyType,i)||ii(r.valueType,i);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:ii(r.in,i)||ii(r.out,i);if(r.type==="object"){for(const s in r.shape)if(ii(r.shape[s],i))return!0;return!1}if(r.type==="union"){for(const s of r.options)if(ii(s,i))return!0;return!1}if(r.type==="tuple"){for(const s of r.items)if(ii(s,i))return!0;return!!(r.rest&&ii(r.rest,i))}return!1}const WT=(e,t={})=>i=>{const r=gu({...i,processors:t});return Lt(e,r),pu(r,e),vu(r,e)},yu=(e,t,i={})=>r=>{const{libraryOptions:s,target:l}=r??{},c=gu({...s??{},target:l,io:t,processors:i});return Lt(e,c),pu(c,e),vu(c,e)},KT={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Wb=(e,t,i,r)=>{const s=i;s.type="string";const{minimum:l,maximum:c,format:f,patterns:h,contentEncoding:d}=e._zod.bag;if(typeof l=="number"&&(s.minLength=l),typeof c=="number"&&(s.maxLength=c),f&&(s.format=KT[f]??f,s.format===""&&delete s.format,f==="time"&&delete s.format),d&&(s.contentEncoding=d),h&&h.size>0){const g=[...h];g.length===1?s.pattern=g[0].source:g.length>1&&(s.allOf=[...g.map(v=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:v.source}))])}},Kb=(e,t,i,r)=>{const s=i,{minimum:l,maximum:c,format:f,multipleOf:h,exclusiveMaximum:d,exclusiveMinimum:g}=e._zod.bag;typeof f=="string"&&f.includes("int")?s.type="integer":s.type="number";const v=typeof g=="number"&&g>=(l??Number.NEGATIVE_INFINITY),y=typeof d=="number"&&d<=(c??Number.POSITIVE_INFINITY),x=t.target==="draft-04"||t.target==="openapi-3.0";v?x?(s.minimum=g,s.exclusiveMinimum=!0):s.exclusiveMinimum=g:typeof l=="number"&&(s.minimum=l),y?x?(s.maximum=d,s.exclusiveMaximum=!0):s.exclusiveMaximum=d:typeof c=="number"&&(s.maximum=c),typeof h=="number"&&(s.multipleOf=h)},Qb=(e,t,i,r)=>{i.type="boolean"},QT=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},JT=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},eE=(e,t,i,r)=>{t.target==="openapi-3.0"?(i.type="string",i.nullable=!0,i.enum=[null]):i.type="null"},tE=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},nE=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Jb=(e,t,i,r)=>{i.not={}},iE=(e,t,i,r)=>{},e2=(e,t,i,r)=>{},rE=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},t2=(e,t,i,r)=>{const s=e._zod.def,l=Ab(s.entries);l.every(c=>typeof c=="number")&&(i.type="number"),l.every(c=>typeof c=="string")&&(i.type="string"),i.enum=l},aE=(e,t,i,r)=>{const s=e._zod.def,l=[];for(const c of s.values)if(c===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof c=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");l.push(Number(c))}else l.push(c);if(l.length!==0)if(l.length===1){const c=l[0];i.type=c===null?"null":typeof c,t.target==="draft-04"||t.target==="openapi-3.0"?i.enum=[c]:i.const=c}else l.every(c=>typeof c=="number")&&(i.type="number"),l.every(c=>typeof c=="string")&&(i.type="string"),l.every(c=>typeof c=="boolean")&&(i.type="boolean"),l.every(c=>c===null)&&(i.type="null"),i.enum=l},sE=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},oE=(e,t,i,r)=>{const s=i,l=e._zod.pattern;if(!l)throw new Error("Pattern not found in template literal");s.type="string",s.pattern=l.source},lE=(e,t,i,r)=>{const s=i,l={type:"string",format:"binary",contentEncoding:"binary"},{minimum:c,maximum:f,mime:h}=e._zod.bag;c!==void 0&&(l.minLength=c),f!==void 0&&(l.maxLength=f),h?h.length===1?(l.contentMediaType=h[0],Object.assign(s,l)):(Object.assign(s,l),s.anyOf=h.map(d=>({contentMediaType:d}))):Object.assign(s,l)},cE=(e,t,i,r)=>{i.type="boolean"},n2=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},uE=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},i2=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},fE=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},dE=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},r2=(e,t,i,r)=>{const s=i,l=e._zod.def,{minimum:c,maximum:f}=e._zod.bag;typeof c=="number"&&(s.minItems=c),typeof f=="number"&&(s.maxItems=f),s.type="array",s.items=Lt(l.element,t,{...r,path:[...r.path,"items"]})},a2=(e,t,i,r)=>{var d;const s=i,l=e._zod.def;s.type="object",s.properties={};const c=l.shape;for(const g in c)s.properties[g]=Lt(c[g],t,{...r,path:[...r.path,"properties",g]});const f=new Set(Object.keys(c)),h=new Set([...f].filter(g=>{const v=l.shape[g]._zod;return t.io==="input"?v.optin===void 0:v.optout===void 0}));h.size>0&&(s.required=Array.from(h)),((d=l.catchall)==null?void 0:d._zod.def.type)==="never"?s.additionalProperties=!1:l.catchall?l.catchall&&(s.additionalProperties=Lt(l.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},s2=(e,t,i,r)=>{const s=e._zod.def,l=s.inclusive===!1,c=s.options.map((f,h)=>Lt(f,t,{...r,path:[...r.path,l?"oneOf":"anyOf",h]}));l?i.oneOf=c:i.anyOf=c},o2=(e,t,i,r)=>{const s=e._zod.def,l=Lt(s.left,t,{...r,path:[...r.path,"allOf",0]}),c=Lt(s.right,t,{...r,path:[...r.path,"allOf",1]}),f=d=>"allOf"in d&&Object.keys(d).length===1,h=[...f(l)?l.allOf:[l],...f(c)?c.allOf:[c]];i.allOf=h},hE=(e,t,i,r)=>{const s=i,l=e._zod.def;s.type="array";const c=t.target==="draft-2020-12"?"prefixItems":"items",f=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",h=l.items.map((y,x)=>Lt(y,t,{...r,path:[...r.path,c,x]})),d=l.rest?Lt(l.rest,t,{...r,path:[...r.path,f,...t.target==="openapi-3.0"?[l.items.length]:[]]}):null;t.target==="draft-2020-12"?(s.prefixItems=h,d&&(s.items=d)):t.target==="openapi-3.0"?(s.items={anyOf:h},d&&s.items.anyOf.push(d),s.minItems=h.length,d||(s.maxItems=h.length)):(s.items=h,d&&(s.additionalItems=d));const{minimum:g,maximum:v}=e._zod.bag;typeof g=="number"&&(s.minItems=g),typeof v=="number"&&(s.maxItems=v)},l2=(e,t,i,r)=>{const s=i,l=e._zod.def;s.type="object";const c=l.keyType,f=c._zod.bag,h=f==null?void 0:f.patterns;if(l.mode==="loose"&&h&&h.size>0){const g=Lt(l.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});s.patternProperties={};for(const v of h)s.patternProperties[v.source]=g}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=Lt(l.keyType,t,{...r,path:[...r.path,"propertyNames"]})),s.additionalProperties=Lt(l.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const d=c._zod.values;if(d){const g=[...d].filter(v=>typeof v=="string"||typeof v=="number");g.length>0&&(s.required=g)}},c2=(e,t,i,r)=>{const s=e._zod.def,l=Lt(s.innerType,t,r),c=t.seen.get(e);t.target==="openapi-3.0"?(c.ref=s.innerType,i.nullable=!0):i.anyOf=[l,{type:"null"}]},u2=(e,t,i,r)=>{const s=e._zod.def;Lt(s.innerType,t,r);const l=t.seen.get(e);l.ref=s.innerType},f2=(e,t,i,r)=>{const s=e._zod.def;Lt(s.innerType,t,r);const l=t.seen.get(e);l.ref=s.innerType,i.default=JSON.parse(JSON.stringify(s.defaultValue))},d2=(e,t,i,r)=>{const s=e._zod.def;Lt(s.innerType,t,r);const l=t.seen.get(e);l.ref=s.innerType,t.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},h2=(e,t,i,r)=>{const s=e._zod.def;Lt(s.innerType,t,r);const l=t.seen.get(e);l.ref=s.innerType;let c;try{c=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=c},m2=(e,t,i,r)=>{const s=e._zod.def,l=s.in._zod.traits.has("$ZodTransform"),c=t.io==="input"?l?s.out:s.in:s.out;Lt(c,t,r);const f=t.seen.get(e);f.ref=c},g2=(e,t,i,r)=>{const s=e._zod.def;Lt(s.innerType,t,r);const l=t.seen.get(e);l.ref=s.innerType,i.readOnly=!0},mE=(e,t,i,r)=>{const s=e._zod.def;Lt(s.innerType,t,r);const l=t.seen.get(e);l.ref=s.innerType},Tm=(e,t,i,r)=>{const s=e._zod.def;Lt(s.innerType,t,r);const l=t.seen.get(e);l.ref=s.innerType},gE=(e,t,i,r)=>{const s=e._zod.innerType;Lt(s,t,r);const l=t.seen.get(e);l.ref=s},g1={string:Wb,number:Kb,boolean:Qb,bigint:QT,symbol:JT,null:eE,undefined:tE,void:nE,never:Jb,any:iE,unknown:e2,date:rE,enum:t2,literal:aE,nan:sE,template_literal:oE,file:lE,success:cE,custom:n2,function:uE,transform:i2,map:fE,set:dE,array:r2,object:a2,union:s2,intersection:o2,tuple:hE,record:l2,nullable:c2,nonoptional:u2,default:f2,prefault:d2,catch:h2,pipe:m2,readonly:g2,promise:mE,optional:Tm,lazy:gE};function Em(e,t){if("_idmap"in e){const r=e,s=gu({...t,processors:g1}),l={};for(const h of r._idmap.entries()){const[d,g]=h;Lt(g,s)}const c={},f={registry:r,uri:t==null?void 0:t.uri,defs:l};s.external=f;for(const h of r._idmap.entries()){const[d,g]=h;pu(s,g),c[d]=vu(s,g)}if(Object.keys(l).length>0){const h=s.target==="draft-2020-12"?"$defs":"definitions";c.__shared={[h]:l}}return{schemas:c}}const i=gu({...t,processors:g1});return Lt(e,i),pu(i,e),vu(i,e)}const pE=le("ZodISODateTime",(e,t)=>{x5.init(e,t),Xt.init(e,t)});function vE(e){return zT(pE,e)}const yE=le("ZodISODate",(e,t)=>{w5.init(e,t),Xt.init(e,t)});function bE(e){return MT(yE,e)}const xE=le("ZodISOTime",(e,t)=>{_5.init(e,t),Xt.init(e,t)});function wE(e){return CT(xE,e)}const _E=le("ZodISODuration",(e,t)=>{S5.init(e,t),Xt.init(e,t)});function SE(e){return AT(_E,e)}const TE=(e,t)=>{Db.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>d3(e,i)},flatten:{value:i=>f3(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,jh,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,jh,2)}},isEmpty:{get(){return e.issues.length===0}}})},Ii=le("ZodError",TE,{Parent:Error}),EE=wm(Ii),zE=_m(Ii),ME=Pu(Ii),CE=Vu(Ii),AE=g3(Ii),NE=p3(Ii),RE=v3(Ii),kE=y3(Ii),DE=b3(Ii),OE=x3(Ii),jE=w3(Ii),LE=_3(Ii),p1=new WeakMap;function Nl(e,t,i){const r=Object.getPrototypeOf(e);let s=p1.get(r);if(s||(s=new Set,p1.set(r,s)),!s.has(t)){s.add(t);for(const l in i){const c=i[l];Object.defineProperty(r,l,{configurable:!0,enumerable:!1,get(){const f=c.bind(this);return Object.defineProperty(this,l,{configurable:!0,writable:!0,enumerable:!0,value:f}),f},set(f){Object.defineProperty(this,l,{configurable:!0,writable:!0,enumerable:!0,value:f})}})}}}const en=le("ZodType",(e,t)=>(Jt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:yu(e,"input"),output:yu(e,"output")}}),e.toJSONSchema=WT(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(i,r)=>EE(e,i,r,{callee:e.parse}),e.safeParse=(i,r)=>ME(e,i,r),e.parseAsync=async(i,r)=>zE(e,i,r,{callee:e.parseAsync}),e.safeParseAsync=async(i,r)=>CE(e,i,r),e.spa=e.safeParseAsync,e.encode=(i,r)=>AE(e,i,r),e.decode=(i,r)=>NE(e,i,r),e.encodeAsync=async(i,r)=>RE(e,i,r),e.decodeAsync=async(i,r)=>kE(e,i,r),e.safeEncode=(i,r)=>DE(e,i,r),e.safeDecode=(i,r)=>OE(e,i,r),e.safeEncodeAsync=async(i,r)=>jE(e,i,r),e.safeDecodeAsync=async(i,r)=>LE(e,i,r),Nl(e,"ZodType",{check(...i){const r=this.def;return this.clone(Da(r,{checks:[...r.checks??[],...i.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0})},with(...i){return this.check(...i)},clone(i,r){return Oa(this,i,r)},brand(){return this},register(i,r){return i.add(this,r),this},refine(i,r){return this.check(Mz(i,r))},superRefine(i,r){return this.check(Cz(i,r))},overwrite(i){return this.check(mo(i))},optional(){return x1(this)},exactOptional(){return mz(this)},nullable(){return w1(this)},nullish(){return x1(w1(this))},nonoptional(i){return xz(this,i)},array(){return ar(this)},or(i){return lz([this,i])},and(i){return uz(this,i)},transform(i){return _1(this,b2(i))},default(i){return vz(this,i)},prefault(i){return bz(this,i)},catch(i){return _z(this,i)},pipe(i){return _1(this,i)},readonly(){return Ez(this)},describe(i){const r=this.clone();return ml.add(r,{description:i}),r},meta(...i){if(i.length===0)return ml.get(this);const r=this.clone();return ml.add(r,i[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(i){return i(this)}}),Object.defineProperty(e,"description",{get(){var i;return(i=ml.get(e))==null?void 0:i.description},configurable:!0}),e)),p2=le("_ZodString",(e,t)=>{Sm.init(e,t),en.init(e,t),e._zod.processJSONSchema=(r,s,l)=>Wb(e,r,s);const i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,Nl(e,"_ZodString",{regex(...r){return this.check(jT(...r))},includes(...r){return this.check(HT(...r))},startsWith(...r){return this.check(BT(...r))},endsWith(...r){return this.check($T(...r))},min(...r){return this.check(mu(...r))},max(...r){return this.check(Xb(...r))},length(...r){return this.check(qb(...r))},nonempty(...r){return this.check(mu(1,...r))},lowercase(r){return this.check(LT(r))},uppercase(r){return this.check(UT(r))},trim(){return this.check(YT())},normalize(...r){return this.check(GT(...r))},toLowerCase(){return this.check(FT())},toUpperCase(){return this.check(PT())},slugify(){return this.check(VT())}})}),v2=le("ZodString",(e,t)=>{Sm.init(e,t),p2.init(e,t),e.email=i=>e.check(aT(UE,i)),e.url=i=>e.check(uT(HE,i)),e.jwt=i=>e.check(ET(JE,i)),e.emoji=i=>e.check(fT(BE,i)),e.guid=i=>e.check(f1(v1,i)),e.uuid=i=>e.check(sT(Fc,i)),e.uuidv4=i=>e.check(oT(Fc,i)),e.uuidv6=i=>e.check(lT(Fc,i)),e.uuidv7=i=>e.check(cT(Fc,i)),e.nanoid=i=>e.check(dT($E,i)),e.guid=i=>e.check(f1(v1,i)),e.cuid=i=>e.check(hT(GE,i)),e.cuid2=i=>e.check(mT(YE,i)),e.ulid=i=>e.check(gT(FE,i)),e.base64=i=>e.check(_T(WE,i)),e.base64url=i=>e.check(ST(KE,i)),e.xid=i=>e.check(pT(PE,i)),e.ksuid=i=>e.check(vT(VE,i)),e.ipv4=i=>e.check(yT(ZE,i)),e.ipv6=i=>e.check(bT(IE,i)),e.cidrv4=i=>e.check(xT(XE,i)),e.cidrv6=i=>e.check(wT(qE,i)),e.e164=i=>e.check(TT(QE,i)),e.datetime=i=>e.check(vE(i)),e.date=i=>e.check(bE(i)),e.time=i=>e.check(wE(i)),e.duration=i=>e.check(SE(i))});function At(e){return iT(v2,e)}const Xt=le("ZodStringFormat",(e,t)=>{Pt.init(e,t),p2.init(e,t)}),UE=le("ZodEmail",(e,t)=>{f5.init(e,t),Xt.init(e,t)}),v1=le("ZodGUID",(e,t)=>{c5.init(e,t),Xt.init(e,t)}),Fc=le("ZodUUID",(e,t)=>{u5.init(e,t),Xt.init(e,t)}),HE=le("ZodURL",(e,t)=>{d5.init(e,t),Xt.init(e,t)}),BE=le("ZodEmoji",(e,t)=>{h5.init(e,t),Xt.init(e,t)}),$E=le("ZodNanoID",(e,t)=>{m5.init(e,t),Xt.init(e,t)}),GE=le("ZodCUID",(e,t)=>{g5.init(e,t),Xt.init(e,t)}),YE=le("ZodCUID2",(e,t)=>{p5.init(e,t),Xt.init(e,t)}),FE=le("ZodULID",(e,t)=>{v5.init(e,t),Xt.init(e,t)}),PE=le("ZodXID",(e,t)=>{y5.init(e,t),Xt.init(e,t)}),VE=le("ZodKSUID",(e,t)=>{b5.init(e,t),Xt.init(e,t)}),ZE=le("ZodIPv4",(e,t)=>{T5.init(e,t),Xt.init(e,t)}),IE=le("ZodIPv6",(e,t)=>{E5.init(e,t),Xt.init(e,t)}),XE=le("ZodCIDRv4",(e,t)=>{z5.init(e,t),Xt.init(e,t)}),qE=le("ZodCIDRv6",(e,t)=>{M5.init(e,t),Xt.init(e,t)}),WE=le("ZodBase64",(e,t)=>{C5.init(e,t),Xt.init(e,t)}),KE=le("ZodBase64URL",(e,t)=>{N5.init(e,t),Xt.init(e,t)}),QE=le("ZodE164",(e,t)=>{R5.init(e,t),Xt.init(e,t)}),JE=le("ZodJWT",(e,t)=>{D5.init(e,t),Xt.init(e,t)}),y2=le("ZodNumber",(e,t)=>{Fb.init(e,t),en.init(e,t),e._zod.processJSONSchema=(r,s,l)=>Kb(e,r,s),Nl(e,"ZodNumber",{gt(r,s){return this.check(h1(r,s))},gte(r,s){return this.check(lh(r,s))},min(r,s){return this.check(lh(r,s))},lt(r,s){return this.check(d1(r,s))},lte(r,s){return this.check(oh(r,s))},max(r,s){return this.check(oh(r,s))},int(r){return this.check(y1(r))},safe(r){return this.check(y1(r))},positive(r){return this.check(h1(0,r))},nonnegative(r){return this.check(lh(0,r))},negative(r){return this.check(d1(0,r))},nonpositive(r){return this.check(oh(0,r))},multipleOf(r,s){return this.check(m1(r,s))},step(r,s){return this.check(m1(r,s))},finite(){return this}});const i=e._zod.bag;e.minValue=Math.max(i.minimum??Number.NEGATIVE_INFINITY,i.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(i.maximum??Number.POSITIVE_INFINITY,i.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(i.format??"").includes("int")||Number.isSafeInteger(i.multipleOf??.5),e.isFinite=!0,e.format=i.format??null});function Mt(e){return NT(y2,e)}const ez=le("ZodNumberFormat",(e,t)=>{O5.init(e,t),y2.init(e,t)});function y1(e){return RT(ez,e)}const tz=le("ZodBoolean",(e,t)=>{j5.init(e,t),en.init(e,t),e._zod.processJSONSchema=(i,r,s)=>Qb(e,i,r)});function Aa(e){return kT(tz,e)}const nz=le("ZodUnknown",(e,t)=>{L5.init(e,t),en.init(e,t),e._zod.processJSONSchema=(i,r,s)=>e2()});function Uh(){return DT(nz)}const iz=le("ZodNever",(e,t)=>{U5.init(e,t),en.init(e,t),e._zod.processJSONSchema=(i,r,s)=>Jb(e,i,r)});function rz(e){return OT(iz,e)}const az=le("ZodArray",(e,t)=>{H5.init(e,t),en.init(e,t),e._zod.processJSONSchema=(i,r,s)=>r2(e,i,r,s),e.element=t.element,Nl(e,"ZodArray",{min(i,r){return this.check(mu(i,r))},nonempty(i){return this.check(mu(1,i))},max(i,r){return this.check(Xb(i,r))},length(i,r){return this.check(qb(i,r))},unwrap(){return this.element}})});function ar(e,t){return ZT(az,e,t)}const sz=le("ZodObject",(e,t)=>{$5.init(e,t),en.init(e,t),e._zod.processJSONSchema=(i,r,s)=>a2(e,i,r,s),Ct(e,"shape",()=>t.shape),Nl(e,"ZodObject",{keyof(){return Zi(Object.keys(this._zod.def.shape))},catchall(i){return this.clone({...this._zod.def,catchall:i})},passthrough(){return this.clone({...this._zod.def,catchall:Uh()})},loose(){return this.clone({...this._zod.def,catchall:Uh()})},strict(){return this.clone({...this._zod.def,catchall:rz()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(i){return a3(this,i)},safeExtend(i){return s3(this,i)},merge(i){return o3(this,i)},pick(i){return i3(this,i)},omit(i){return r3(this,i)},partial(...i){return l3(x2,this,i[0])},required(...i){return c3(w2,this,i[0])}})});function ot(e,t){const i={type:"object",shape:e??{},...Ce(t)};return new sz(i)}const oz=le("ZodUnion",(e,t)=>{G5.init(e,t),en.init(e,t),e._zod.processJSONSchema=(i,r,s)=>s2(e,i,r,s),e.options=t.options});function lz(e,t){return new oz({type:"union",options:e,...Ce(t)})}const cz=le("ZodIntersection",(e,t)=>{Y5.init(e,t),en.init(e,t),e._zod.processJSONSchema=(i,r,s)=>o2(e,i,r,s)});function uz(e,t){return new cz({type:"intersection",left:e,right:t})}const b1=le("ZodRecord",(e,t)=>{F5.init(e,t),en.init(e,t),e._zod.processJSONSchema=(i,r,s)=>l2(e,i,r,s),e.keyType=t.keyType,e.valueType=t.valueType});function fz(e,t,i){return!t||!t._zod?new b1({type:"record",keyType:At(),valueType:e,...Ce(t)}):new b1({type:"record",keyType:e,valueType:t,...Ce(i)})}const Hh=le("ZodEnum",(e,t)=>{P5.init(e,t),en.init(e,t),e._zod.processJSONSchema=(r,s,l)=>t2(e,r,s),e.enum=t.entries,e.options=Object.values(t.entries);const i=new Set(Object.keys(t.entries));e.extract=(r,s)=>{const l={};for(const c of r)if(i.has(c))l[c]=t.entries[c];else throw new Error(`Key ${c} not found in enum`);return new Hh({...t,checks:[],...Ce(s),entries:l})},e.exclude=(r,s)=>{const l={...t.entries};for(const c of r)if(i.has(c))delete l[c];else throw new Error(`Key ${c} not found in enum`);return new Hh({...t,checks:[],...Ce(s),entries:l})}});function Zi(e,t){const i=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Hh({type:"enum",entries:i,...Ce(t)})}const dz=le("ZodTransform",(e,t)=>{V5.init(e,t),en.init(e,t),e._zod.processJSONSchema=(i,r,s)=>i2(e,i),e._zod.parse=(i,r)=>{if(r.direction==="backward")throw new Cb(e.constructor.name);i.addIssue=l=>{if(typeof l=="string")i.issues.push(_l(l,i.value,t));else{const c=l;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=i.value),c.inst??(c.inst=e),i.issues.push(_l(c))}};const s=t.transform(i.value,i);return s instanceof Promise?s.then(l=>(i.value=l,i.fallback=!0,i)):(i.value=s,i.fallback=!0,i)}});function b2(e){return new dz({type:"transform",transform:e})}const x2=le("ZodOptional",(e,t)=>{Zb.init(e,t),en.init(e,t),e._zod.processJSONSchema=(i,r,s)=>Tm(e,i,r,s),e.unwrap=()=>e._zod.def.innerType});function x1(e){return new x2({type:"optional",innerType:e})}const hz=le("ZodExactOptional",(e,t)=>{Z5.init(e,t),en.init(e,t),e._zod.processJSONSchema=(i,r,s)=>Tm(e,i,r,s),e.unwrap=()=>e._zod.def.innerType});function mz(e){return new hz({type:"optional",innerType:e})}const gz=le("ZodNullable",(e,t)=>{I5.init(e,t),en.init(e,t),e._zod.processJSONSchema=(i,r,s)=>c2(e,i,r,s),e.unwrap=()=>e._zod.def.innerType});function w1(e){return new gz({type:"nullable",innerType:e})}const pz=le("ZodDefault",(e,t)=>{X5.init(e,t),en.init(e,t),e._zod.processJSONSchema=(i,r,s)=>f2(e,i,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function vz(e,t){return new pz({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Rb(t)}})}const yz=le("ZodPrefault",(e,t)=>{q5.init(e,t),en.init(e,t),e._zod.processJSONSchema=(i,r,s)=>d2(e,i,r,s),e.unwrap=()=>e._zod.def.innerType});function bz(e,t){return new yz({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Rb(t)}})}const w2=le("ZodNonOptional",(e,t)=>{W5.init(e,t),en.init(e,t),e._zod.processJSONSchema=(i,r,s)=>u2(e,i,r,s),e.unwrap=()=>e._zod.def.innerType});function xz(e,t){return new w2({type:"nonoptional",innerType:e,...Ce(t)})}const wz=le("ZodCatch",(e,t)=>{K5.init(e,t),en.init(e,t),e._zod.processJSONSchema=(i,r,s)=>h2(e,i,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function _z(e,t){return new wz({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const _2=le("ZodPipe",(e,t)=>{Ib.init(e,t),en.init(e,t),e._zod.processJSONSchema=(i,r,s)=>m2(e,i,r,s),e.in=t.in,e.out=t.out});function _1(e,t){return new _2({type:"pipe",in:e,out:t})}const Sz=le("ZodPreprocess",(e,t)=>{_2.init(e,t),Q5.init(e,t)}),Tz=le("ZodReadonly",(e,t)=>{J5.init(e,t),en.init(e,t),e._zod.processJSONSchema=(i,r,s)=>g2(e,i,r,s),e.unwrap=()=>e._zod.def.innerType});function Ez(e){return new Tz({type:"readonly",innerType:e})}const zz=le("ZodCustom",(e,t)=>{eT.init(e,t),en.init(e,t),e._zod.processJSONSchema=(i,r,s)=>n2(e,i)});function Mz(e,t={}){return IT(zz,e,t)}function Cz(e,t){return XT(e,t)}function Az(e,t){return new Sz({type:"pipe",in:b2(e),out:t})}function Nz(e){return rT(v2,e)}const Rz=ot({x:Mt().int().min(0).describe("Column offset, 0-based"),y:Mt().int().min(0).describe("Row offset, 0-based"),w:Mt().int().min(1).describe("Width in grid columns"),h:Mt().int().min(1).describe("Height in grid rows")}),kz=ot({id:At().describe("Unique instance id within the dashboard"),frame:At().describe("Name of a registered frame"),title:At().optional().describe(`Card title shown in the frame's chrome. Overrides the default (the frame type name) — set a meaningful per-instance label, e.g. the ticker on a price-chart ("TSLA"). Ignored by chrome-less frames like heading.`),position:Rz,config:fz(At(),Uh()).default({}).describe("Frame config; validated against the frame's own schema at render time")}),Dz=ot({type:Zi(["none","gradient","unicorn"]).default("gradient").describe("Background style: 'gradient' (built-in dark glow), 'unicorn' (animated Unicorn Studio scene), or 'none'."),projectId:At().optional().describe("Unicorn Studio public project id — required when type is 'unicorn'."),scale:Mt().min(.1).max(2).default(1).describe("Unicorn scene render scale."),dpi:Mt().min(.5).max(3).default(1.5).describe("Unicorn scene device-pixel-ratio cap (perf vs sharpness)."),opacity:Mt().min(0).max(1).default(.16).describe("Opacity of the unicorn scene (0–1). Keep moderate (~0.15) so the animation reads as a living backdrop in the gutters without competing with the (opaque) dashboard cards.")}).describe("Visual background rendered behind the whole dashboard."),Oz=ot({accentHue:Mt().int().min(0).max(360).default(242).describe("Brand accent hue in degrees on the HSL color wheel (0–360). Rotates the dashboard's accent — card rims, title dots, chart highlights, loading states — across the spectrum. 242 is the default zframes indigo; rough anchors: 0 red, 35 orange, 50 amber, 150 green, 190 teal, 210 blue, 280 violet, 330 pink. Semantic up/down green/red, asset logos, and per-frame chart colors stay fixed."),accentSat:Mt().min(0).max(100).default(90).describe("Accent saturation as an HSL percentage (0–100). 90 is the default vivid zframes accent; lower it for muted/pastel rims and dots, 0 for a near-grayscale monochrome accent. Pairs with accentHue — hue picks the color, saturation picks how vivid it is.")}).describe("Dashboard-wide color identity (accent hue + saturation)."),jz=ot({radius:Mt().min(0).default(18).describe("Frame corner radius in pixels, applied to every card via --zf-frame-radius. 0 squares the corners; the editor's Appearance rail exposes this as a slider."),borderStrength:Mt().min(0).max(1).default(.22).describe("Opacity of each card's accent rim (0–1) via --zf-border-alpha. 0 = borderless flat cards, 1 = a solid outlined rim; 0.22 is the default soft edge. Hover lifts it a notch automatically."),surfaceOpacity:Mt().min(.3).max(1).default(1).describe("Opacity of the card surface (0.3–1) via --zf-surface-opacity. 1 = opaque cards (default); lower it toward 0.5 for frosted/glassy cards that let the dashboard background show through. Kept ≥0.3 so card content stays legible."),density:Mt().min(.6).max(1.4).default(1).describe("Card padding scale (0.6–1.4) via --zf-density. 1 = the comfortable default; <1 tightens padding for information-dense dashboards, >1 gives roomier breathing space."),elevation:Mt().min(0).max(2).default(1).describe("Card shadow depth (0–2) via --zf-elevation. 0 = flat (no drop shadow), 1 = the default resting shadow, 2 = a heavier floating lift. Scales the card's drop shadow only.")}).describe("Card surface treatment — corners, border, opacity, padding density, and shadow depth. Distinct from `grid` (geometry) and `theme` (accent color)."),Lz=Az(e=>{if(!e||typeof e!="object")return e;const t=e,i=t.grid;if(i&&typeof i=="object"&&"radius"in i){const{radius:r,...s}=i;return{...t,grid:s,appearance:{radius:r,...t.appearance??{}}}}return e},ot({version:Nz().default("1.0.0").describe('Spec version, a semver-style string like package.json\'s ("1.0.0"). A legacy numeric `1` from an older spec is coerced to "1".'),title:At().describe("Dashboard name, like package.json's name."),author:At().optional().describe(`Who made this dashboard — a free-form credit, like package.json's author ("Micky" or "Micky <pichaya@zentry.com>"). Optional.`),grid:ot({columns:Mt().int().min(1).default(12),rowHeight:Mt().min(8).default(96),gap:Mt().min(0).default(12).describe("Pixels of space between frames (the grid gutter). 0 makes the cards flush; the editor's Layout rail exposes this as a slider.")}).default({columns:12,rowHeight:96,gap:12}),background:Dz.default({type:"gradient",scale:1,dpi:1.5,opacity:.16}),theme:Oz.default({accentHue:242,accentSat:90}),appearance:jz.default({radius:18,borderStrength:.22,surfaceOpacity:1,density:1,elevation:1}),frames:ar(kz)})),S2=M.createContext([]);function T2({providers:e,children:t}){const i=Array.isArray(e)?e:[e];return b.jsx(S2.Provider,{value:i,children:t})}function zm(){return M.useContext(S2)}function si(e){return zm().find(i=>i.capabilities.includes(e))??null}function vi(e,t,i,r){const[s,l]=M.useState(t),[c,f]=M.useState(!0);return M.useEffect(()=>{if(!e){f(!1);return}let h=!1;l(t),f(!0);const d=()=>{e().then(y=>{h||(l(y),f(!1))}).catch(()=>{h||f(!1)})};d();let g;const v=()=>{g=setTimeout(()=>{d(),v()},r*(.85+Math.random()*.3))};return v(),()=>{h=!0,clearTimeout(g)}},i),{data:s,isLoading:c}}function Mm(e){const t=si("quote-stream"),[i,r]=M.useState({}),[s,l]=M.useState(!0),c=e.join(",");return M.useEffect(()=>{const f=c.split(",").filter(Boolean);if(r({}),!(t!=null&&t.subscribeMids)||f.length===0){l(!1);return}let h=!1,d=!1;l(!0);const g=setTimeout(()=>{!h&&!d&&l(!1)},8e3),v=t.subscribeMids(y=>{h||(d=!0,clearTimeout(g),l(!1),r(x=>{let S=!1;const _={};for(const T of f){const E=y[T];E!==void 0&&(_[T]=E,E!==x[T]&&(S=!0))}return Object.keys(x).length!==Object.keys(_).length&&(S=!0),S?_:x}))},f);return()=>{h=!0,clearTimeout(g),v()}},[t,c]),{mids:i,isLoading:s}}function Cm(e){return Mm(e).mids}function Am(e,t=3e4){const i=si("day-stats"),r=e?e.join(","):"*",s=r==="*"?void 0:r.split(",").filter(Boolean),{data:l,isLoading:c}=vi(i!=null&&i.getDayStats?()=>i.getDayStats(s):null,{},[i,r,t],t);return{stats:l,isLoading:c}}function Bh(e,t=3e4){return Am(e,t).stats}function E2(e,t,i=5*6e4){const r=si("funding-history"),s=e.join(","),l=s.split(",").filter(Boolean),{data:c,isLoading:f}=vi(r!=null&&r.getFundingHistory&&l.length>0?()=>r.getFundingHistory(l,t):null,{},[r,s,t,i],i);return{history:c,isLoading:f}}function Uz(e,t,i,r=6e4){const s=si("ohlcv"),{data:l,isLoading:c}=vi(s!=null&&s.getCandles&&e?()=>s.getCandles(e,t,i):null,[],[s,e,t,i,r],r);return{candles:l,isLoading:c}}function Hz(e,t,i,r=6e4){const s=si("ohlcv"),l=e.join(","),c=l.split(",").filter(Boolean),{data:f,isLoading:h}=vi(s!=null&&s.getCandles&&c.length>0?async()=>{const d=await Promise.all(c.map(g=>s.getCandles(g,t,i).then(v=>[g,v]).catch(()=>[g,[]])));return Object.fromEntries(d)}:null,{},[s,l,t,i,r],r);return{candles:f,isLoading:h}}function Bz(e=10*6e4){const t=si("tvl"),{data:i,isLoading:r}=vi(t!=null&&t.getTvlByChain?()=>t.getTvlByChain():null,[],[t,e],e);return{entries:i,isLoading:r}}function $z(e=15*6e4){const t=si("global-market"),{data:i,isLoading:r}=vi(t!=null&&t.getGlobalMarket?()=>t.getGlobalMarket():null,null,[t,e],e);return{market:i,isLoading:r}}function Gz(e=30,t=60*6e4){const i=si("sentiment"),{data:r,isLoading:s}=vi(i!=null&&i.getFearGreed?()=>i.getFearGreed(e):null,[],[i,e,t],t);return{points:r,isLoading:s}}function Yz(e=15*6e4){const t=si("reference-rates"),{data:i,isLoading:r}=vi(t!=null&&t.getReferenceRates?()=>t.getReferenceRates():null,[],[t,e],e);return{rates:i,isLoading:r}}function Fz(e=360*6e4){const t=si("treasury-rates"),{data:i,isLoading:r}=vi(t!=null&&t.getTreasuryAverageRates?()=>t.getTreasuryAverageRates():null,[],[t,e],e);return{rates:i,isLoading:r}}function Pz(e=360*6e4){const t=si("yield-curve"),{data:i,isLoading:r}=vi(t!=null&&t.getYieldCurve?()=>t.getYieldCurve():null,null,[t,e],e);return{curve:i,isLoading:r}}function Vz(e,t,i,r=720*6e4){const s=si("macro-series"),{data:l,isLoading:c}=vi(s!=null&&s.getMacroSeries&&e?()=>s.getMacroSeries(e,t,i):null,null,[s,e,t,i,r],r);return{series:l,isLoading:c}}function Zz(e,t=30*6e4){const i=si("filings"),{data:r,isLoading:s}=vi(i!=null&&i.getCompanyFilings&&e?()=>i.getCompanyFilings(e):null,null,[i,e,t],t);return{data:r,isLoading:s}}function Iz(e,t=720*6e4){const i=si("fundamentals"),{data:r,isLoading:s}=vi(i!=null&&i.getCompanyFacts&&e?()=>i.getCompanyFacts(e):null,null,[i,e,t],t);return{data:r,isLoading:s}}function Xz(e,t=360*6e4){const i=si("short-volume"),r=e.join(","),s=r.split(",").filter(Boolean),{data:l,isLoading:c}=vi(i!=null&&i.getShortVolume&&s.length>0?()=>i.getShortVolume(s):null,{},[i,r,t],t);return{data:l,isLoading:c}}const z2=`
113
+ .zf-grid {
114
+ display: grid;
115
+ gap: var(--zf-gap, 12px);
116
+ grid-template-columns: repeat(var(--zf-cols, 12), minmax(0, 1fr));
117
+ grid-auto-rows: var(--zf-row-h, 96px);
118
+ }
119
+ .zf-frame {
120
+ grid-column: var(--zf-col-start, auto) / span var(--zf-col-span, 1);
121
+ grid-row: var(--zf-row-start, auto) / span var(--zf-row-span, 1);
122
+ position: relative;
123
+ display: flex;
124
+ flex-direction: column;
125
+ min-height: 0;
126
+ overflow: hidden;
127
+ padding: calc(16px * var(--zf-density, 1)) calc(18px * var(--zf-density, 1));
128
+ background: var(--zf-frame-bg, linear-gradient(165deg, rgba(26, 27, 38, calc(0.82 * var(--zf-surface-opacity, 1))) 0%, rgba(14, 15, 22, calc(0.86 * var(--zf-surface-opacity, 1))) 60%, rgba(10, 11, 17, calc(0.9 * var(--zf-surface-opacity, 1))) 100%));
129
+ border: 1px solid var(--zf-frame-border, hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76% / var(--zf-border-alpha, 0.22)));
130
+ border-radius: var(--zf-frame-radius, 18px);
131
+ box-shadow: var(--zf-frame-shadow, inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1px 2px rgba(0, 0, 0, 0.4), 0 calc(18px * var(--zf-elevation, 1)) calc(44px * var(--zf-elevation, 1)) -26px rgba(0, 0, 0, 0.9));
132
+ transition:
133
+ border-color 0.25s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
134
+ background 0.25s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
135
+ box-shadow 0.25s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
136
+ transform 0.25s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
137
+ /* Frames arrive in a soft top-down cascade on first paint. The translate
138
+ property (not transform) carries the motion, so the hover lift stays
139
+ independent; the backwards fill holds the hidden state through the stagger
140
+ delay, then hands transform back to :hover once the entrance settles. */
141
+ animation: zf-enter 0.45s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)) backwards;
142
+ animation-delay: min(calc((var(--zf-enter-i, 0) + 1) * 35ms), 350ms);
143
+ }
144
+ /* Hover lift is pointer-only — on touch it would stick after a tap. */
145
+ @media (hover: hover) {
146
+ .zf-frame:hover {
147
+ border-color: var(--zf-frame-border-hover, hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76% / calc(var(--zf-border-alpha, 0.22) + 0.2)));
148
+ background: var(--zf-frame-bg-hover, linear-gradient(165deg, rgba(34, 35, 50, calc(0.88 * var(--zf-surface-opacity, 1))) 0%, rgba(18, 19, 28, calc(0.9 * var(--zf-surface-opacity, 1))) 60%, rgba(12, 13, 20, calc(0.92 * var(--zf-surface-opacity, 1))) 100%));
149
+ box-shadow: var(--zf-frame-shadow-hover, inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 1px 2px rgba(0, 0, 0, 0.4), 0 calc(26px * var(--zf-elevation, 1)) calc(56px * var(--zf-elevation, 1)) -26px rgba(0, 0, 0, 0.92), 0 0 0 1px hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76% / 0.12), 0 calc(20px * var(--zf-elevation, 1)) calc(60px * var(--zf-elevation, 1)) -28px hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76% / 0.4)));
150
+ transform: translateY(-2px);
151
+ }
152
+ }
153
+ /* Top edge sheen — inset past the corner radius so the bright line never
154
+ pokes outside the rounded border (which read as a clipped corner). */
155
+ .zf-frame::before {
156
+ content: '';
157
+ position: absolute;
158
+ top: 0;
159
+ left: 18px;
160
+ right: 18px;
161
+ height: 1px;
162
+ background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
163
+ pointer-events: none;
164
+ z-index: 2;
165
+ }
166
+ .zf-frame-title {
167
+ position: relative;
168
+ z-index: 1;
169
+ display: flex;
170
+ align-items: center;
171
+ gap: 7px;
172
+ margin-bottom: 12px;
173
+ font-family: var(--font-dmsans, inherit);
174
+ font-size: 10px;
175
+ font-weight: 700;
176
+ letter-spacing: 0.14em;
177
+ text-transform: uppercase;
178
+ color: var(--zf-frame-title, rgba(255, 255, 255, 0.5));
179
+ flex: none;
180
+ }
181
+ .zf-frame-title::before {
182
+ content: '';
183
+ width: 5px;
184
+ height: 5px;
185
+ border-radius: 9999px;
186
+ background: var(--zf-frame-title-dot, hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76%));
187
+ box-shadow: 0 0 8px var(--zf-frame-title-dot-glow, hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76% / 0.9));
188
+ }
189
+ /* A title with a leading icon (e.g. an asset logo) drops the status dot — the
190
+ logo is the card's identity marker. */
191
+ .zf-frame-title--icon::before { display: none; }
192
+ /* The title label takes the remaining width and truncates so a long title
193
+ never shoves the source credit off the card. */
194
+ .zf-frame-title-text {
195
+ min-width: 0;
196
+ overflow: hidden;
197
+ text-overflow: ellipsis;
198
+ white-space: nowrap;
199
+ }
200
+ /* Data-source credit — a clickable provider link pinned to the right of the
201
+ title row. Brand casing is preserved (text-transform reset) so DeFiLlama /
202
+ alternative.me read correctly against the uppercase title. */
203
+ .zf-frame-source {
204
+ margin-left: auto;
205
+ padding-left: 10px;
206
+ display: inline-flex;
207
+ align-items: center;
208
+ gap: 5px;
209
+ flex: none;
210
+ text-transform: none;
211
+ letter-spacing: 0;
212
+ font-weight: 600;
213
+ }
214
+ .zf-frame-source a {
215
+ color: var(--zf-frame-source, rgba(255, 255, 255, 0.42));
216
+ text-decoration: none;
217
+ transition: color 0.2s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
218
+ white-space: nowrap;
219
+ }
220
+ @media (hover: hover) {
221
+ .zf-frame-source a:hover {
222
+ color: var(--zf-frame-source-hover, hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 80%));
223
+ text-decoration: underline;
224
+ }
225
+ }
226
+ .zf-frame-source-sep { color: rgba(255, 255, 255, 0.22); }
227
+ .zf-frame-body {
228
+ position: relative;
229
+ z-index: 1;
230
+ flex: 1;
231
+ min-height: 0;
232
+ display: flex;
233
+ flex-direction: column;
234
+ }
235
+ .zf-frame-body > * {
236
+ flex: 1;
237
+ min-height: 0;
238
+ }
239
+ /* ── Error cards ────────────────────────────────────────────────────────────
240
+ Unknown frame / missing capability / invalid config / runtime crash all share
241
+ one centered empty-state: an alert glyph, a headline naming what's wrong, the
242
+ frame's name, then the specific detail. Centered (not top-left) so the card
243
+ reads as a deliberate state instead of a raw debug dump floating in a void —
244
+ and a faint red top-bloom signals "error" across the whole surface, not just
245
+ the 1px border. This is also the generating agent's feedback surface, so the
246
+ detail stays precise (field paths, the exact missing capability/provider). */
247
+ .zf-frame--error {
248
+ border-color: var(--zf-frame-error-border, rgba(242, 21, 83, 0.42));
249
+ background: var(
250
+ --zf-frame-error-bg,
251
+ radial-gradient(125% 80% at 50% -12%, rgba(242, 21, 83, 0.13), transparent 60%),
252
+ linear-gradient(165deg, rgba(26, 27, 38, 0.82) 0%, rgba(14, 15, 22, 0.86) 60%, rgba(10, 11, 17, 0.9) 100%)
253
+ );
254
+ }
255
+ @media (hover: hover) {
256
+ .zf-frame--error:hover {
257
+ border-color: var(--zf-frame-error-border-hover, rgba(242, 21, 83, 0.6));
258
+ background: var(
259
+ --zf-frame-error-bg,
260
+ radial-gradient(125% 80% at 50% -12%, rgba(242, 21, 83, 0.13), transparent 60%),
261
+ linear-gradient(165deg, rgba(26, 27, 38, 0.82) 0%, rgba(14, 15, 22, 0.86) 60%, rgba(10, 11, 17, 0.9) 100%)
262
+ );
263
+ box-shadow: var(--zf-frame-shadow, inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 44px -26px rgba(0, 0, 0, 0.9)), 0 0 0 1px rgba(242, 21, 83, 0.14), 0 20px 56px -30px rgba(242, 21, 83, 0.4);
264
+ }
265
+ }
266
+ /* The centered stack. flex:1 lets it claim the whole card; the inner content
267
+ stays its natural height and is centered around the card's middle, so a 2×1
268
+ card and a 6×4 card both read as composed rather than top-anchored. */
269
+ .zf-error {
270
+ flex: 1;
271
+ min-height: 0;
272
+ display: flex;
273
+ flex-direction: column;
274
+ align-items: center;
275
+ justify-content: center;
276
+ gap: 8px;
277
+ padding: 4px 2px;
278
+ text-align: center;
279
+ overflow: auto;
280
+ }
281
+ .zf-error-icon {
282
+ flex: none;
283
+ width: 38px;
284
+ height: 38px;
285
+ display: grid;
286
+ place-items: center;
287
+ border-radius: 12px;
288
+ color: var(--zf-frame-error-text, #ff8b9d);
289
+ background: rgba(242, 21, 83, 0.12);
290
+ box-shadow: inset 0 0 0 1px rgba(242, 21, 83, 0.32),
291
+ 0 0 24px -8px rgba(242, 21, 83, 0.6);
292
+ }
293
+ .zf-error-icon svg {
294
+ display: block;
295
+ width: 20px;
296
+ height: 20px;
297
+ }
298
+ .zf-error-headline {
299
+ font-family: var(--font-dmsans, inherit);
300
+ font-size: 13px;
301
+ font-weight: 700;
302
+ letter-spacing: 0.01em;
303
+ color: var(--zf-frame-error-headline, rgba(255, 255, 255, 0.92));
304
+ }
305
+ .zf-error-frame {
306
+ margin-top: -3px;
307
+ font-size: 10px;
308
+ font-weight: 700;
309
+ letter-spacing: 0.14em;
310
+ text-transform: uppercase;
311
+ color: var(--zf-frame-error-text, #ff8b9d);
312
+ }
313
+ .zf-error-detail {
314
+ margin: 2px 0 0;
315
+ max-width: 44ch;
316
+ font-size: 12px;
317
+ line-height: 1.5;
318
+ color: var(--zf-frame-error-detail, rgba(255, 255, 255, 0.6));
319
+ }
320
+ .zf-error-detail code {
321
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
322
+ font-size: 0.92em;
323
+ }
324
+ /* Per-issue rows for invalid config: the field path as a code chip, the Zod
325
+ message beside it. Block-centered but left-aligned inside, so a one-field
326
+ error sits dead-centre and a multi-field one reads as a tidy list. */
327
+ .zf-error-issues {
328
+ list-style: none;
329
+ margin: 2px 0 0;
330
+ padding: 0;
331
+ max-width: 100%;
332
+ display: flex;
333
+ flex-direction: column;
334
+ gap: 6px;
335
+ text-align: left;
336
+ }
337
+ .zf-error-issue {
338
+ display: flex;
339
+ flex-wrap: wrap;
340
+ align-items: baseline;
341
+ gap: 7px;
342
+ padding: 6px 10px;
343
+ border-radius: 9px;
344
+ background: rgba(0, 0, 0, 0.22);
345
+ border: 1px solid rgba(242, 21, 83, 0.18);
346
+ }
347
+ .zf-error-field {
348
+ flex: none;
349
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
350
+ font-size: 11px;
351
+ font-weight: 700;
352
+ color: var(--zf-frame-error-text, #ff8b9d);
353
+ background: rgba(242, 21, 83, 0.14);
354
+ padding: 1px 6px;
355
+ border-radius: 5px;
356
+ }
357
+ .zf-error-msg {
358
+ min-width: 0;
359
+ font-size: 12px;
360
+ line-height: 1.4;
361
+ color: var(--zf-frame-error-detail, rgba(255, 255, 255, 0.68));
362
+ }
363
+ /* Registered-frame list under an "unknown frame" card — quiet, it's reference. */
364
+ .zf-error-list {
365
+ margin-top: 4px;
366
+ font-size: 11px;
367
+ line-height: 1.5;
368
+ color: rgba(255, 255, 255, 0.4);
369
+ }
370
+ /* Bare frames (headings) divide a dashboard into zones — positioned slot,
371
+ no card chrome, no auto-title. */
372
+ .zf-bare {
373
+ grid-column: var(--zf-col-start, auto) / span var(--zf-col-span, 1);
374
+ grid-row: var(--zf-row-start, auto) / span var(--zf-row-span, 1);
375
+ display: flex;
376
+ align-items: flex-end;
377
+ min-height: 0;
378
+ overflow: hidden;
379
+ animation: zf-enter 0.45s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)) backwards;
380
+ animation-delay: min(calc((var(--zf-enter-i, 0) + 1) * 35ms), 350ms);
381
+ }
382
+ /* Phones: the absolute x/y/w grid can't shrink below ~30px columns, so collapse
383
+ to a single full-width column. Frames flow in spec order and keep their row
384
+ span (height), but ignore horizontal placement. */
385
+ @media (max-width: 640px) {
386
+ .zf-grid {
387
+ grid-template-columns: 1fr;
388
+ }
389
+ .zf-frame,
390
+ .zf-bare {
391
+ grid-column: 1 / -1;
392
+ grid-row: auto / span var(--zf-row-span, 1);
393
+ }
394
+ .zf-frame {
395
+ padding: calc(12px * var(--zf-density, 1)) calc(14px * var(--zf-density, 1));
396
+ }
397
+ }
398
+ @keyframes zf-enter {
399
+ from { opacity: 0; translate: 0 10px; }
400
+ to { opacity: 1; translate: 0 0; }
401
+ }
402
+ /* Reduced-motion entrance: same timing + stagger, but a plain fade with no
403
+ positional movement (motion is what triggers vestibular discomfort). */
404
+ @keyframes zf-fade {
405
+ from { opacity: 0; }
406
+ to { opacity: 1; }
407
+ }
408
+ @media (prefers-reduced-motion: reduce) {
409
+ .zf-frame,
410
+ .zf-bare {
411
+ animation-name: zf-fade;
412
+ }
413
+ .zf-frame:hover {
414
+ transform: none;
415
+ }
416
+ }
417
+ `,M2=()=>b.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[b.jsx("path",{d:"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z"}),b.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),b.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]});function ch({outerClassName:e,style:t,headline:i,frame:r,children:s}){return b.jsx("div",{className:e,style:t,children:b.jsxs("div",{className:"zf-error",children:[b.jsx("span",{className:"zf-error-icon",children:b.jsx(M2,{})}),b.jsx("div",{className:"zf-error-headline",children:i}),b.jsx("div",{className:"zf-error-frame",children:r}),s]})})}function qz({sources:e}){return e.length===0?null:b.jsx("span",{className:"zf-frame-source",children:e.map((t,i)=>b.jsxs(M.Fragment,{children:[i>0&&b.jsx("span",{className:"zf-frame-source-sep",children:"·"}),b.jsx("a",{href:t.url,target:"_blank",rel:"noreferrer noopener",title:`Data source: ${t.name}`,onMouseDown:r=>r.stopPropagation(),onPointerDown:r=>r.stopPropagation(),children:t.name})]},t.url))})}class S1 extends M.Component{constructor(){super(...arguments);st(this,"state",{error:null})}static getDerivedStateFromError(i){return{error:i}}render(){return this.state.error?b.jsxs("div",{className:"zf-error",children:[b.jsx("span",{className:"zf-error-icon",children:b.jsx(M2,{})}),b.jsx("div",{className:"zf-error-headline",children:"Frame crashed"}),b.jsx("p",{className:"zf-error-detail",children:this.state.error.message})]}):this.props.children}}function C2({instance:e,registry:t,style:i,className:r=""}){const s=zm(),l=t.get(e.frame),c=(...x)=>x.filter(Boolean).join(" ");if(!l)return b.jsxs(ch,{outerClassName:c("zf-frame","zf-frame--error",r),style:i,headline:"Unknown frame",frame:e.frame,children:[b.jsxs("p",{className:"zf-error-detail",children:[b.jsx("code",{children:e.frame})," isn’t a registered frame."]}),b.jsxs("p",{className:"zf-error-list",children:["Available: ",[...t.keys()].join(", ")]})]});const f=new Set(s.flatMap(x=>[...x.capabilities])),h=l.capabilities.filter(x=>!f.has(x));if(h.length>0)return b.jsx(ch,{outerClassName:c("zf-frame","zf-frame--error",r),style:i,headline:"No data source",frame:e.frame,children:b.jsxs("p",{className:"zf-error-detail",children:["No registered provider supplies"," ",h.map((x,S)=>b.jsxs(M.Fragment,{children:[S>0&&", ",b.jsx("code",{children:x})]},x)),"."]})});const d=l.schema.safeParse(e.config);if(!d.success)return b.jsx(ch,{outerClassName:c("zf-frame","zf-frame--error",r),style:i,headline:"Invalid configuration",frame:e.frame,children:b.jsx("ul",{className:"zf-error-issues",children:d.error.issues.map((x,S)=>b.jsxs("li",{className:"zf-error-issue",children:[b.jsx("code",{className:"zf-error-field",children:x.path.join(".")||"(root)"}),b.jsx("span",{className:"zf-error-msg",children:x.message.replace(/^Invalid input:\s*/i,"")})]},S))})});const g=l.component,v=l.titleIcon,y=l.source?Array.isArray(l.source)?l.source:[l.source]:[];return l.chrome==="bare"?b.jsx("div",{className:c("zf-bare",r),style:i,children:b.jsx(S1,{children:b.jsx(g,{config:d.data})})}):b.jsxs("div",{className:c("zf-frame",r),style:i,children:[b.jsxs("div",{className:c("zf-frame-title",v?"zf-frame-title--icon":""),children:[v?b.jsx(v,{config:d.data}):null,b.jsx("span",{className:"zf-frame-title-text",children:e.title??e.frame.replace(/-/g," ")}),b.jsx(qz,{sources:y})]}),b.jsx("div",{className:"zf-frame-body",children:b.jsx(S1,{children:b.jsx(g,{config:d.data})})})]})}function Wz(e,t){const{x:i,y:r,w:s,h:l}=e.position;return{"--zf-col-start":i+1,"--zf-col-span":s,"--zf-row-start":r+1,"--zf-row-span":l,"--zf-enter-i":t}}function Kz({spec:e,registry:t}){return b.jsxs(b.Fragment,{children:[b.jsx("style",{children:z2}),b.jsx("div",{className:"zf-grid",style:{"--zf-cols":e.grid.columns,"--zf-row-h":`${e.grid.rowHeight}px`,"--zf-gap":`${e.grid.gap}px`,"--zf-accent-hue":e.theme.accentHue,"--zf-accent-sat":`${e.theme.accentSat}%`,"--zf-frame-radius":`${e.appearance.radius}px`,"--zf-border-alpha":e.appearance.borderStrength,"--zf-surface-opacity":e.appearance.surfaceOpacity,"--zf-density":e.appearance.density,"--zf-elevation":e.appearance.elevation},children:e.frames.map((i,r)=>b.jsx(C2,{instance:i,registry:t,style:Wz(i,r)},i.id))})]})}class te{static getElements(t,i=document){if(typeof t=="string"){const r="getElementById"in i?i:void 0;if(r&&!isNaN(+t[0])){const l=r.getElementById(t);return l?[l]:[]}let s=i.querySelectorAll(t);if(!s.length&&t[0]!=="."&&t[0]!=="#"&&(s=i.querySelectorAll("."+t),s.length||(s=i.querySelectorAll("#"+t)),!s.length)){const l=i.querySelector(`[gs-id="${t}"]`);return l?[l]:[]}return Array.from(s)}return[t]}static getElement(t,i=document){if(typeof t=="string"){const r="getElementById"in i?i:void 0;if(!t.length)return null;if(r&&t[0]==="#")return r.getElementById(t.substring(1));if(t[0]==="#"||t[0]==="."||t[0]==="[")return i.querySelector(t);if(r&&!isNaN(+t[0]))return r.getElementById(t);let s=i.querySelector(t);return r&&!s&&(s=r.getElementById(t)),s||(s=i.querySelector("."+t)),s}return t}static lazyLoad(t){var i,r;return t.lazyLoad||((r=(i=t.grid)==null?void 0:i.opts)==null?void 0:r.lazyLoad)&&t.lazyLoad!==!1}static createDiv(t,i){const r=document.createElement("div");return t.forEach(s=>{s&&r.classList.add(s)}),i==null||i.appendChild(r),r}static shouldSizeToContent(t,i=!1){return(t==null?void 0:t.grid)&&(i?t.sizeToContent===!0||t.grid.opts.sizeToContent===!0&&t.sizeToContent===void 0:!!t.sizeToContent||t.grid.opts.sizeToContent&&t.sizeToContent!==!1)}static isIntercepted(t,i){return!(t.y>=i.y+i.h||t.y+t.h<=i.y||t.x+t.w<=i.x||t.x>=i.x+i.w)}static isTouching(t,i){return te.isIntercepted(t,{x:i.x-.5,y:i.y-.5,w:i.w+1,h:i.h+1})}static areaIntercept(t,i){const r=t.x>i.x?t.x:i.x,s=t.x+t.w<i.x+i.w?t.x+t.w:i.x+i.w;if(s<=r)return 0;const l=t.y>i.y?t.y:i.y,c=t.y+t.h<i.y+i.h?t.y+t.h:i.y+i.h;return c<=l?0:(s-r)*(c-l)}static area(t){return t.w*t.h}static sort(t,i=1){return t.sort((s,l)=>{const c=i*((s.y??1e4)-(l.y??1e4));return c===0?i*((s.x??1e4)-(l.x??1e4)):c})}static find(t,i){return i?t.find(r=>r.id===i):void 0}static toBool(t){return typeof t=="boolean"?t:typeof t=="string"?(t=t.toLowerCase(),!(t===""||t==="no"||t==="false"||t==="0")):!!t}static toNumber(t){return t===null||t.length===0?void 0:Number(t)}static parseHeight(t){let i,r="px";if(typeof t=="string")if(t==="auto"||t==="")i=0;else{const s=t.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!s)throw new Error(`Invalid height val = ${t}`);r=s[2]||"px",i=parseFloat(s[1])}else i=t;return{h:i,unit:r}}static defaults(t,...i){return i.forEach(r=>{for(const s in r){if(!r.hasOwnProperty(s))return;t[s]===null||t[s]===void 0?t[s]=r[s]:typeof r[s]=="object"&&typeof t[s]=="object"&&te.defaults(t[s],r[s])}}),t}static same(t,i){if(typeof t!="object")return t==i;if(typeof t!=typeof i||Object.keys(t).length!==Object.keys(i).length)return!1;for(const r in t)if(t[r]!==i[r])return!1;return!0}static copyPos(t,i,r=!1){return i.x!==void 0&&(t.x=i.x),i.y!==void 0&&(t.y=i.y),i.w!==void 0&&(t.w=i.w),i.h!==void 0&&(t.h=i.h),r&&(i.minW&&(t.minW=i.minW),i.minH&&(t.minH=i.minH),i.maxW&&(t.maxW=i.maxW),i.maxH&&(t.maxH=i.maxH)),t}static samePos(t,i){return t&&i&&t.x===i.x&&t.y===i.y&&(t.w||1)===(i.w||1)&&(t.h||1)===(i.h||1)}static sanitizeMinMax(t){t.minW||delete t.minW,t.minH||delete t.minH,t.maxW||delete t.maxW,t.maxH||delete t.maxH}static removeInternalAndSame(t,i){if(!(typeof t!="object"||typeof i!="object")&&!(Array.isArray(t)||Array.isArray(i)))for(let r in t){const s=t[r],l=i[r];r[0]==="_"||s===l?delete t[r]:s&&typeof s=="object"&&l!==void 0&&(te.removeInternalAndSame(s,l),Object.keys(s).length||delete t[r])}}static removeInternalForSave(t,i=!0){for(let r in t)(r[0]==="_"||t[r]===null||t[r]===void 0)&&delete t[r];delete t.grid,i&&delete t.el,t.autoPosition||delete t.autoPosition,t.noResize||delete t.noResize,t.noMove||delete t.noMove,t.locked||delete t.locked,(t.w===1||t.w===t.minW)&&delete t.w,(t.h===1||t.h===t.minH)&&delete t.h}static throttle(t,i){let r=!1;return(...s)=>{r||(r=!0,setTimeout(()=>{t(...s),r=!1},i))}}static removePositioningStyles(t){const i=t.style;i.position&&i.removeProperty("position"),i.left&&i.removeProperty("left"),i.top&&i.removeProperty("top"),i.width&&i.removeProperty("width"),i.height&&i.removeProperty("height")}static getScrollElement(t){if(!t)return document.scrollingElement||document.documentElement;const i=getComputedStyle(t).overflowY;return(i==="auto"||i==="scroll")&&t.scrollHeight>t.clientHeight?t:te.getScrollElement(t.parentElement)}static updateScrollResize(t,i,r){const s=te.getScrollElement(i),l=s.clientHeight,c=s===te.getScrollElement()?0:s.getBoundingClientRect().top,f=t.clientY-c,h=f<r,d=f>l-r;h?s.scrollBy({behavior:"smooth",top:f-r}):d&&s.scrollBy({behavior:"smooth",top:r-(l-f)})}static clone(t){return t==null||typeof t!="object"?t:t instanceof Array?[...t]:{...t}}static cloneDeep(t){const i=["parentGrid","el","grid","subGrid","engine"],r=te.clone(t);for(const s in r)r.hasOwnProperty(s)&&typeof r[s]=="object"&&s.substring(0,2)!=="__"&&!i.find(l=>l===s)&&(r[s]=te.cloneDeep(t[s]));return r}static cloneNode(t){const i=t.cloneNode(!0);return i.removeAttribute("id"),i}static appendTo(t,i){let r;typeof i=="string"?r=te.getElement(i):r=i,r&&r.appendChild(t)}static addElStyles(t,i){if(i instanceof Object)for(const r in i)i.hasOwnProperty(r)&&(Array.isArray(i[r])?i[r].forEach(s=>{t.style[r]=s}):t.style[r]=i[r])}static initEvent(t,i){const r={type:i.type},s={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:i.target?i.target:t.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(l=>r[l]=t[l]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(l=>r[l]=t[l]),{...r,...s}}static simulateMouseEvent(t,i,r){const s=t,l=new MouseEvent(i,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY,ctrlKey:s.ctrlKey??!1,altKey:s.altKey??!1,shiftKey:s.shiftKey??!1,metaKey:s.metaKey??!1,button:0,relatedTarget:t.target});(r||t.target).dispatchEvent(l)}static getValuesFromTransformedElement(t){const i=document.createElement("div");te.addElStyles(i,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),t.appendChild(i);const r=i.getBoundingClientRect();return t.removeChild(i),i.remove(),{xScale:1/r.width,yScale:1/r.height,xOffset:r.left,yOffset:r.top}}static swap(t,i,r){if(!t)return;const s=t[i];t[i]=t[r],t[r]=s}static canBeRotated(t){var i;return!(!t||t.w===t.h||t.locked||t.noResize||(i=t.grid)!=null&&i.opts.disableResize||t.minW&&t.minW===t.maxW||t.minH&&t.minH===t.maxH)}}class Pr{constructor(t={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=t.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=t.maxRow,this._float=t.float,this.nodes=t.nodes||[],this.onChange=t.onChange}batchUpdate(t=!0,i=!0){return!!this.batchMode===t?this:(this.batchMode=t,t?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,i&&this._packNodes(),this._notify()),this)}_useEntireRowArea(t,i){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!t._moving||t._skipDown||i.y<=t.y)}_fixCollisions(t,i=t,r,s={}){if(this.sortNodes(-1),r=r||this.collide(t,i),!r)return!1;if(t._moving&&!s.nested&&!this.float&&this.swap(t,r))return!0;let l=i;!this._loading&&this._useEntireRowArea(t,i)&&(l={x:0,w:this.column,y:i.y,h:i.h},r=this.collide(t,l,s.skip));let c=!1;const f={nested:!0,pack:!1};let h=0;for(;r=r||this.collide(t,l,s.skip);){if(h++>this.nodes.length*2)throw new Error("Infinite collide check");let d;if(r.locked||this._loading||t._moving&&!t._skipDown&&i.y>t.y&&!this.float&&(!this.collide(r,{...r,y:t.y},t)||!this.collide(r,{...r,y:i.y-r.h},t))){t._skipDown=t._skipDown||i.y>t.y;const g={...i,y:r.y+r.h,...f};d=this._loading&&te.samePos(t,g)?!0:this.moveNode(t,g),(r.locked||this._loading)&&d?te.copyPos(i,t):!r.locked&&d&&s.pack&&(this._packNodes(),i.y=r.y+r.h,te.copyPos(t,i)),c=c||d}else d=this.moveNode(r,{...r,y:i.y+i.h,skip:t,...f});if(!d)return c;r=void 0}return c}collide(t,i=t,r){const s=t._id,l=r==null?void 0:r._id;return this.nodes.find(c=>c._id!==s&&c._id!==l&&te.isIntercepted(c,i))}collideAll(t,i=t,r){const s=t._id,l=r==null?void 0:r._id;return this.nodes.filter(c=>c._id!==s&&c._id!==l&&te.isIntercepted(c,i))}directionCollideCoverage(t,i,r){if(!i.rect||!t._rect)return;const s=t._rect,l={...i.rect};l.y>s.y?(l.h+=l.y-s.y,l.y=s.y):l.h+=s.y-l.y,l.x>s.x?(l.w+=l.x-s.x,l.x=s.x):l.w+=s.x-l.x;let c,f=.5;for(let h of r){if(h.locked||!h._rect)break;const d=h._rect;let g=Number.MAX_VALUE,v=Number.MAX_VALUE;s.y<d.y?g=(l.y+l.h-d.y)/d.h:s.y+s.h>d.y+d.h&&(g=(d.y+d.h-l.y)/d.h),s.x<d.x?v=(l.x+l.w-d.x)/d.w:s.x+s.w>d.x+d.w&&(v=(d.x+d.w-l.x)/d.w);const y=Math.min(v,g);y>f&&(f=y,c=h)}return i.collide=c,c}cacheRects(t,i,r,s,l,c){return this.nodes.forEach(f=>f._rect={y:f.y*i+r,x:f.x*t+c,w:f.w*t-c-s,h:f.h*i-r-l}),this}swap(t,i){if(!i||i.locked||!t||t.locked)return!1;function r(){const l=i.x,c=i.y;return i.x=t.x,i.y=t.y,t.h!=i.h?(t.x=l,t.y=i.y+i.h):t.w!=i.w?(t.x=i.x+i.w,t.y=c):(t.x=l,t.y=c),t._dirty=i._dirty=!0,!0}let s;if(t.w===i.w&&t.h===i.h&&(t.x===i.x||t.y===i.y)&&(s=te.isTouching(t,i)))return r();if(s!==!1){if(t.w===i.w&&t.x===i.x&&(s||(s=te.isTouching(t,i)))){if(i.y<t.y){const l=t;t=i,i=l}return r()}if(s!==!1){if(t.h===i.h&&t.y===i.y&&(s||(s=te.isTouching(t,i)))){if(i.x<t.x){const l=t;t=i,i=l}return r()}return!1}}}isAreaEmpty(t,i,r,s){const l={x:t||0,y:i||0,w:r||1,h:s||1};return!this.collide(l)}compact(t="compact",i=!0){if(this.nodes.length===0)return this;i&&this.sortNodes();const r=this.batchMode;r||this.batchUpdate();const s=this._inColumnResize;s||(this._inColumnResize=!0);const l=this.nodes;return this.nodes=[],l.forEach((c,f,h)=>{let d;c.locked||(c.autoPosition=!0,t==="list"&&f&&(d=h[f-1])),this.addNode(c,!1,d)}),s||delete this._inColumnResize,r||this.batchUpdate(!1),this}set float(t){this._float!==t&&(this._float=t||!1,t||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(t=1){return this.nodes=te.sort(this.nodes,t),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(t=>{if(t._updating||t._orig===void 0||t.y===t._orig.y)return;let i=t.y;for(;i>t._orig.y;)--i,this.collide(t,{x:t.x,y:i,w:t.w,h:t.h})||(t._dirty=!0,t.y=i)}):this.nodes.forEach((t,i)=>{if(!t.locked)for(;t.y>0;){const r=i===0?0:t.y-1;if(!(i===0||!this.collide(t,{x:t.x,y:r,w:t.w,h:t.h})))break;t._dirty=t.y!==r,t.y=r}}),this)}prepareNode(t,i){t._id=t._id??Pr._idSeq++;const r=t.id;if(r){let l=1;for(;this.nodes.find(c=>c.id===t.id&&c!==t);)t.id=r+"_"+l++}(t.x===void 0||t.y===void 0||t.x===null||t.y===null)&&(t.autoPosition=!0);const s={x:0,y:0,w:1,h:1};return te.defaults(t,s),t.autoPosition||delete t.autoPosition,t.noResize||delete t.noResize,t.noMove||delete t.noMove,te.sanitizeMinMax(t),typeof t.x=="string"&&(t.x=Number(t.x)),typeof t.y=="string"&&(t.y=Number(t.y)),typeof t.w=="string"&&(t.w=Number(t.w)),typeof t.h=="string"&&(t.h=Number(t.h)),isNaN(t.x)&&(t.x=s.x,t.autoPosition=!0),isNaN(t.y)&&(t.y=s.y,t.autoPosition=!0),isNaN(t.w)&&(t.w=s.w),isNaN(t.h)&&(t.h=s.h),this.nodeBoundFix(t,i),t}nodeBoundFix(t,i){const r=t._orig||te.copyPos({},t);if(t.maxW&&(t.w=Math.min(t.w||1,t.maxW)),t.maxH&&(t.h=Math.min(t.h||1,t.maxH)),t.minW&&(t.w=Math.max(t.w||1,t.minW)),t.minH&&(t.h=Math.max(t.h||1,t.minH)),(t.x||0)+(t.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&t._id!=null&&this.findCacheLayout(t,this.defaultColumn)===-1){const l={...t};l.autoPosition||l.x===void 0?(delete l.x,delete l.y):l.x=Math.min(this.defaultColumn-1,l.x),l.w=Math.min(this.defaultColumn,l.w||1),this.cacheOneLayout(l,this.defaultColumn)}return t.w>this.column?t.w=this.column:t.w<1&&(t.w=1),this.maxRow&&t.h>this.maxRow?t.h=this.maxRow:t.h<1&&(t.h=1),t.x<0&&(t.x=0),t.y<0&&(t.y=0),t.x+t.w>this.column&&(i?t.w=this.column-t.x:t.x=this.column-t.w),this.maxRow&&t.y+t.h>this.maxRow&&(i?t.h=this.maxRow-t.y:t.y=this.maxRow-t.h),te.samePos(t,r)||(t._dirty=!0),this}getDirtyNodes(t){return t?this.nodes.filter(i=>i._dirty&&!te.samePos(i,i._orig)):this.nodes.filter(i=>i._dirty)}_notify(t){if(this.batchMode||!this.onChange)return this;const i=(t||[]).concat(this.getDirtyNodes());return this.onChange(i),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(t=>{delete t._dirty,delete t._lastTried}),this)}saveInitial(){return this.nodes.forEach(t=>{t._orig=te.copyPos({},t),delete t._dirty}),this._hasLocked=this.nodes.some(t=>t.locked),this}restoreInitial(){return this.nodes.forEach(t=>{!t._orig||te.samePos(t,t._orig)||(te.copyPos(t,t._orig),t._dirty=!0)}),this._notify(),this}findEmptyPosition(t,i=this.nodes,r=this.column,s){const l=s?s.y*r+(s.x+s.w):0;let c=!1;for(let f=l;!c;++f){const h=f%r,d=Math.floor(f/r);if(h+t.w>r)continue;const g={x:h,y:d,w:t.w,h:t.h};i.find(v=>te.isIntercepted(g,v))||((t.x!==h||t.y!==d)&&(t._dirty=!0),t.x=h,t.y=d,delete t.autoPosition,c=!0)}return c}addNode(t,i=!1,r){const s=this.nodes.find(c=>c._id===t._id);if(s)return s;this._inColumnResize?this.nodeBoundFix(t):this.prepareNode(t),delete t._temporaryRemoved,delete t._removeDOM;let l;return t.autoPosition&&this.findEmptyPosition(t,this.nodes,this.column,r)&&(delete t.autoPosition,l=!0),this.nodes.push(t),i&&this.addedNodes.push(t),l||this._fixCollisions(t),this.batchMode||this._packNodes()._notify(),t}removeNode(t,i=!0,r=!1){return this.nodes.find(s=>s._id===t._id)?(r&&this.removedNodes.push(t),i&&(t._removeDOM=!0),this.nodes=this.nodes.filter(s=>s._id!==t._id),t._isAboutToRemove||this._packNodes(),this._notify([t]),this):this}removeAll(t=!0,i=!0){if(delete this._layouts,!this.nodes.length)return this;t&&this.nodes.forEach(s=>s._removeDOM=!0);const r=this.nodes;return this.removedNodes=i?r:[],this.nodes=[],this._notify(r)}moveNodeCheck(t,i){if(!this.changedPosConstrain(t,i))return!1;if(i.pack=!0,!this.maxRow)return this.moveNode(t,i);let r;const s=new Pr({column:this.column,float:this.float,nodes:this.nodes.map(c=>c._id===t._id?(r={...c},r):{...c})});if(!r)return!1;const l=s.moveNode(r,i)&&s.getRow()<=Math.max(this.getRow(),this.maxRow);if(!l&&!i.resizing&&i.collide){const c=i.collide.el.gridstackNode;if(this.swap(t,c))return this._notify(),!0}return l?(s.nodes.filter(c=>c._dirty).forEach(c=>{const f=this.nodes.find(h=>h._id===c._id);f&&(te.copyPos(f,c),f._dirty=!0)}),this._notify(),!0):!1}willItFit(t){if(delete t._willFitPos,!this.maxRow)return!0;const i=new Pr({column:this.column,float:this.float,nodes:this.nodes.map(s=>({...s}))}),r={...t};return this.cleanupNode(r),delete r.el,delete r._id,delete r.content,delete r.grid,i.addNode(r),i.getRow()<=this.maxRow?(t._willFitPos=te.copyPos({},r),!0):!1}changedPosConstrain(t,i){return i.w=i.w||t.w,i.h=i.h||t.h,t.x!==i.x||t.y!==i.y?!0:(t.maxW&&(i.w=Math.min(i.w,t.maxW)),t.maxH&&(i.h=Math.min(i.h,t.maxH)),t.minW&&(i.w=Math.max(i.w,t.minW)),t.minH&&(i.h=Math.max(i.h,t.minH)),t.w!==i.w||t.h!==i.h)}moveNode(t,i){var d,g;if(!t||!i)return!1;let r;i.pack===void 0&&!this.batchMode&&(r=i.pack=!0),typeof i.x!="number"&&(i.x=t.x),typeof i.y!="number"&&(i.y=t.y),typeof i.w!="number"&&(i.w=t.w),typeof i.h!="number"&&(i.h=t.h);const s=t.w!==i.w||t.h!==i.h,l=te.copyPos({},t,!0);if(te.copyPos(l,i),this.nodeBoundFix(l,s),te.copyPos(i,l),!i.forceCollide&&te.samePos(t,i))return!1;const c=te.copyPos({},t),f=this.collideAll(t,l,i.skip);let h=!0;if(f.length){const v=t._moving&&!i.nested;let y=v?this.directionCollideCoverage(t,i,f):f[0];if(v&&y&&((g=(d=t.grid)==null?void 0:d.opts)!=null&&g.subGridDynamic)&&!t.grid._isTemp){const x=te.areaIntercept(i.rect,y._rect),S=te.area(i.rect),_=te.area(y._rect);x/(S<_?S:_)>.8&&(y.grid.makeSubGrid(y.el,void 0,t),y=void 0)}y?h=!this._fixCollisions(t,l,y,i):(h=!1,r&&delete i.pack)}return h&&!te.samePos(t,l)&&(t._dirty=!0,te.copyPos(t,l)),i.pack&&this._packNodes()._notify(),!te.samePos(t,c)}getRow(){return this.nodes.reduce((t,i)=>Math.max(t,i.y+i.h),0)}beginUpdate(t){return t._updating||(t._updating=!0,delete t._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){const t=this.nodes.find(i=>i._updating);return t&&(delete t._updating,delete t._skipDown),this}save(t=!0,i,r){var f;const s=((f=this._layouts)==null?void 0:f.length)||0;let l;s&&(r?r!==this.column&&(l=this._layouts[r]):this.column!==s-1&&(l=this._layouts[s-1]));const c=[];return this.sortNodes(),this.nodes.forEach(h=>{const d=l==null?void 0:l.find(v=>v._id===h._id),g={...h,...d||{}};te.removeInternalForSave(g,!t),i&&i(h,g),c.push(g)}),c}layoutsNodesChange(t){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((i,r)=>{if(!i||r===this.column)return this;if(r<this.column)this._layouts[r]=void 0;else{const s=r/this.column;t.forEach(l=>{if(!l._orig)return;const c=i.find(f=>f._id===l._id);c&&(c.y>=0&&l.y!==l._orig.y&&(c.y+=l.y-l._orig.y,c.y<0&&(c.y=0)),l.x!==l._orig.x&&(c.x=Math.round(l.x*s),c.x<0&&(c.x=0)),l.w!==l._orig.w&&(c.w=Math.round(l.w*s),c.w<1&&(c.w=1)))})}}),this)}columnChanged(t,i,r="moveScale"){var f;if(!this.nodes.length||!i||t===i)return this;const s=r==="compact"||r==="list";s&&this.sortNodes(1),i<t&&this.cacheLayout(this.nodes,t),this.batchUpdate();let l=[],c=s?this.nodes:te.sort(this.nodes,-1);if(i>t&&this._layouts){const h=this._layouts[i]||[],d=this._layouts.length-1;!h.length&&t!==d&&((f=this._layouts[d])!=null&&f.length)&&(t=d,this._layouts[d].forEach(g=>{const v=c.find(y=>y._id===g._id);v&&(!s&&!g.autoPosition&&(v.x=g.x??v.x,v.y=g.y??v.y),v.w=g.w??v.w,(g.x==null||g.y===void 0)&&(v.autoPosition=!0))})),h.forEach(g=>{const v=c.findIndex(y=>y._id===g._id);if(v!==-1){const y=c[v];if(s){y.w=g.w;return}(g.autoPosition||isNaN(g.x)||isNaN(g.y))&&this.findEmptyPosition(g,l),g.autoPosition||(y.x=g.x??y.x,y.y=g.y??y.y,y.w=g.w??y.w,l.push(y)),c.splice(v,1)}})}if(s)this.compact(r,!1);else{if(c.length)if(typeof r=="function")r(i,t,l,c);else{const h=s||r==="none"?1:i/t,d=r==="move"||r==="moveScale",g=r==="scale"||r==="moveScale";c.forEach(v=>{v.x=i===1?0:d?Math.round(v.x*h):Math.min(v.x,i-1),v.w=i===1||t===1?1:g?Math.round(v.w*h)||1:Math.min(v.w,i),l.push(v)}),c=[]}l=te.sort(l,-1),this._inColumnResize=!0,this.nodes=[],l.forEach(h=>{this.addNode(h,!1),delete h._orig})}return this.nodes.forEach(h=>delete h._orig),this.batchUpdate(!1,!s),delete this._inColumnResize,this}cacheLayout(t,i,r=!1){const s=[];return t.forEach((l,c)=>{if(l._id===void 0){const f=l.id?this.nodes.find(h=>h.id===l.id):void 0;l._id=(f==null?void 0:f._id)??Pr._idSeq++}s[c]={x:l.x,y:l.y,w:l.w,_id:l._id}}),this._layouts=r?[]:this._layouts||[],this._layouts[i]=s,this}cacheOneLayout(t,i){t._id=t._id??Pr._idSeq++;const r={x:t.x,y:t.y,w:t.w,_id:t._id};(t.autoPosition||t.x===void 0)&&(delete r.x,delete r.y,t.autoPosition&&(r.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[i]=this._layouts[i]||[];const s=this.findCacheLayout(t,i);return s===-1?this._layouts[i].push(r):this._layouts[i][s]=r,this}findCacheLayout(t,i){var r,s;return((s=(r=this._layouts)==null?void 0:r[i])==null?void 0:s.findIndex(l=>l._id===t._id))??-1}removeNodeFromLayoutCache(t){if(this._layouts)for(let i=0;i<this._layouts.length;i++){const r=this.findCacheLayout(t,i);r!==-1&&this._layouts[i].splice(r,1)}}cleanupNode(t){for(const i in t)i[0]==="_"&&i!=="_id"&&delete t[i];return this}}Pr._idSeq=0;const Ni={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:"grid-stack-item",decline:"grid-stack-non-removable"},resizable:{handles:"se"},rtl:"auto"};class ke{}const ir=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0);class Ri{}function bu(e,t){e.touches.length>1||(e.cancelable&&e.preventDefault(),te.simulateMouseEvent(e.changedTouches[0],t))}function A2(e,t){e.cancelable&&e.preventDefault(),te.simulateMouseEvent(e,t)}function xu(e){Ri.touchHandled||(Ri.touchHandled=!0,bu(e,"mousedown"))}function wu(e){Ri.touchHandled&&bu(e,"mousemove")}function _u(e){if(!Ri.touchHandled)return;Ri.pointerLeaveTimeout&&(window.clearTimeout(Ri.pointerLeaveTimeout),delete Ri.pointerLeaveTimeout);const t=!!ke.dragElement;bu(e,"mouseup"),t||bu(e,"click"),Ri.touchHandled=!1}function Su(e){e.pointerType!=="mouse"&&e.target.releasePointerCapture(e.pointerId)}function T1(e){ke.dragElement&&e.pointerType!=="mouse"&&A2(e,"mouseenter")}function E1(e){ke.dragElement&&e.pointerType!=="mouse"&&(Ri.pointerLeaveTimeout=window.setTimeout(()=>{delete Ri.pointerLeaveTimeout,A2(e,"mouseleave")},10))}class Iu{constructor(t,i,r){this.host=t,this.dir=i,this.option=r,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){if(this.option.element)try{this.el=this.option.element instanceof HTMLElement?this.option.element:this.host.querySelector(this.option.element)}catch(t){this.option.element=void 0,console.error("Query for resizeable handle failed, falling back",t)}return this.el||(this.el=document.createElement("div"),this.host.appendChild(this.el)),this.el.classList.add("ui-resizable-handle"),this.el.classList.add(`${Iu.prefix}${this.dir}`),this.el.style.zIndex="100",this.el.style.userSelect="none",this.el.addEventListener("mousedown",this._mouseDown),ir&&(this.el.addEventListener("touchstart",xu),this.el.addEventListener("pointerdown",Su)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),ir&&(this.el.removeEventListener("touchstart",xu),this.el.removeEventListener("pointerdown",Su)),this.option.element||this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(t){this.mouseDownEvent=t,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),ir&&(this.el.addEventListener("touchmove",wu),this.el.addEventListener("touchend",_u)),t.stopPropagation(),t.preventDefault()}_mouseMove(t){const i=this.mouseDownEvent;this.moving?this._triggerEvent("move",t):Math.abs(t.x-i.x)+Math.abs(t.y-i.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",t),document.addEventListener("keydown",this._keyEvent)),t.stopPropagation()}_mouseUp(t){this.moving&&(this._triggerEvent("stop",t),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),ir&&(this.el.removeEventListener("touchmove",wu),this.el.removeEventListener("touchend",_u)),delete this.moving,delete this.mouseDownEvent,t.stopPropagation(),t.preventDefault()}_keyEvent(t){var i,r;t.key==="Escape"&&((r=(i=this.host.gridstackNode)==null?void 0:i.grid)==null||r.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(t,i){return this.option[t]&&this.option[t](i),this}}Iu.prefix="ui-resizable-";class Nm{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(t,i){this._eventRegister[t]=i}off(t){delete this._eventRegister[t]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(t,i){if(!this.disabled&&this._eventRegister&&this._eventRegister[t])return this._eventRegister[t](i)}}class Sl extends Nm{constructor(t,i={}){super(),this.el=t,this.option=i,this.rectScale={x:1,y:1},this._ui=()=>{const s=this.el.parentElement.getBoundingClientRect(),l={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,right:this.originalRect.right,top:this.originalRect.top-this.scrolled},c=this.temporalRect||l;return{position:{left:this.option.rtl?(s.right-c.right)*this.rectScale.x:(c.left-s.left)*this.rectScale.x,top:(c.top-s.top)*this.rectScale.y},size:{width:c.width*this.rectScale.x,height:c.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(t,i){super.on(t,i)}off(t){super.off(t)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(t){const i=t.handles&&t.handles!==this.option.handles,r=t.autoHide&&t.autoHide!==this.option.autoHide;return Object.keys(t).forEach(s=>this.option[s]=t[s]),i&&(this._removeHandlers(),this._setupHandlers()),r&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(t){return t?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),ke.overResizeElement===this&&delete ke.overResizeElement),this}_mouseOver(t){ke.overResizeElement||ke.dragElement||(ke.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(t){ke.overResizeElement===this&&(delete ke.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(t=>t.trim()).map(t=>new Iu(this.el,t,{element:this.option.element,start:i=>this._resizeStart(i),stop:i=>this._resizeStop(i),move:i=>this._resizing(i,t)})),this}_resizeStart(t){this.sizeToContent=te.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=te.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=t,this._setupHelper(),this._applyChange();const i=te.initEvent(t,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(i,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",i),this}_resizing(t,i){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(t,i),this._applyChange();const r=te.initEvent(t,{type:"resize",target:this.el});return r.resizeDir=i,r.hasMovedX=this.option.rtl?i.includes("e"):i.includes("w"),r.hasMovedY=i.includes("n"),this.option.resize&&this.option.resize(r,this._ui()),this.triggerEvent("resize",r),this}_resizeStop(t){const i=te.initEvent(t,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(i),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",i),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=Sl._originStyleProp.map(r=>this.el.style[r]),this.parentOriginStylePosition=this.el.parentElement.style.position;const t=this.el.parentElement,i=te.getValuesFromTransformedElement(t);return this.rectScale={x:i.xScale,y:i.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return Sl._originStyleProp.forEach((t,i)=>{this.el.style[t]=this.elOriginStyleVal[i]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(t,i){const r=this.startEvent,s={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,right:this.originalRect.right,top:this.originalRect.top-this.scrolled},l=t.clientX-r.clientX,c=this.sizeToContent?0:t.clientY-r.clientY;let f,h;const d=this.option.rtl;!d&&i.indexOf("e")>-1?s.width+=l:d&&i.indexOf("w")>-1?s.width-=l:!d&&i.indexOf("w")>-1?(s.width-=l,s.left+=l,f=!0):d&&i.indexOf("e")>-1&&(s.width+=l,s.right+=l,f=!0),i.indexOf("s")>-1?s.height+=c:i.indexOf("n")>-1&&(s.height-=c,s.top+=c,h=!0);const g=this._constrainSize(s.width,s.height,f,h);return Math.round(s.width)!==Math.round(g.width)&&(!d&&i.indexOf("w")>-1?s.left+=s.width-g.width:d&&i.indexOf("e")>-1&&(s.right-=s.width-g.width),s.width=g.width),Math.round(s.height)!==Math.round(g.height)&&(i.indexOf("n")>-1&&(s.top+=s.height-g.height),s.height=g.height),s}_constrainSize(t,i,r,s){const l=this.option,c=(r?l.maxWidthMoveLeft:l.maxWidth)||Number.MAX_SAFE_INTEGER,f=l.minWidth/this.rectScale.x||t,h=(s?l.maxHeightMoveUp:l.maxHeight)||Number.MAX_SAFE_INTEGER,d=l.minHeight/this.rectScale.y||i,g=Math.min(c,Math.max(f,t)),v=Math.min(h,Math.max(d,i));return{width:g,height:v}}_applyChange(){let t={left:0,right:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){const i=this.el.parentElement,{left:r,right:s,top:l}=i.getBoundingClientRect();t={left:r,right:s,top:l,width:0,height:0}}return this.temporalRect?(Object.entries(this.temporalRect).forEach(([i,r])=>{if(this.option.rtl?i==="left":i==="right")return;const s=i==="width"||i==="left"||i==="right"?this.rectScale.x:i==="height"||i==="top"?this.rectScale.y:1;let l;i==="right"?l=(t.right-r)*this.rectScale.x+"px":l=(r-t[i])*s+"px",this.el.style[i]=l}),this):this}_removeHandlers(){return this.handlers.forEach(t=>t.destroy()),delete this.handlers,this}}Sl._originStyleProp=["width","height","position","left","right","top","opacity","zIndex"];const Qz='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';class Tl extends Nm{constructor(t,i={}){var l;super(),this.el=t,this.option=i,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},this._autoScrollTick=()=>{const c=this.helper,f=this._autoScrollContainer;if(!c||!f){this._stopScrolling();return}const h=this._getClipping(c,f);if(h===0){this._stopScrolling();return}if(!this._autoScrollMaxSpeed){const x=window.innerHeight||document.documentElement.clientHeight;this._autoScrollMaxSpeed=Math.max(x/150,4)}const d=Math.abs(h),g=Math.min(d*.5,this._autoScrollMaxSpeed),v=h>0?g:-g,y=f.scrollTop;if(f.scrollTop+=v,f.scrollTop===y){this._stopScrolling();return}this.dragging&&this.lastDrag&&(this._dragFollow(this.lastDrag),this._callDrag(this.lastDrag)),this._autoScrollAnimId=requestAnimationFrame(this._autoScrollTick)};const r=(l=i==null?void 0:i.handle)==null?void 0:l.substring(1),s=t.gridstackNode;this.dragEls=!r||t.classList.contains(r)?[t]:s!=null&&s.subGrid?[t.querySelector(i.handle)||t]:this.getAllHandles(),this.dragEls.length===0&&(this.dragEls=[t]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}getAllHandles(){return Array.from(this.el.querySelectorAll(this.option.handle)).filter(t=>{if(!(t instanceof HTMLElement))return!1;const i=t.closest(".grid-stack-item");return i===this.el||!i})}on(t,i){super.on(t,i)}off(t){super.off(t)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(t=>{t.addEventListener("mousedown",this._mouseDown),ir&&(t.addEventListener("touchstart",xu),t.addEventListener("pointerdown",Su))}),this.el.classList.remove("ui-draggable-disabled"))}disable(t=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(i=>{i.removeEventListener("mousedown",this._mouseDown),ir&&(i.removeEventListener("touchstart",xu),i.removeEventListener("pointerdown",Su))}),t||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(t){return Object.keys(t).forEach(i=>this.option[i]=t[i]),this}_mouseDown(t){if(Ri.touchHandled&&t.isTrusted&&(Ri.touchHandled=!1),!ke.mouseHandled)return t.button!==0||!this.dragEls.find(i=>i===t.target)&&t.target.closest(Qz)||this.option.cancel&&t.target.closest(this.option.cancel)||(this.mouseDownEvent=t,delete this.dragging,delete ke.dragElement,delete ke.dropElement,delete this._autoScrollMaxSpeed,delete this._autoScrollContainer,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),ir&&(t.currentTarget.addEventListener("touchmove",wu),t.currentTarget.addEventListener("touchend",_u)),t.preventDefault(),document.activeElement&&document.activeElement.blur(),ke.mouseHandled=!0),!0}_callDrag(t){if(!this.dragging)return;const i=te.initEvent(t,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(i,this.ui()),this.triggerEvent("drag",i)}_mouseMove(t){var r;const i=this.mouseDownEvent;if(this.lastDrag=t,this.dragging)if(this._dragFollow(t),ke.pauseDrag){const s=Number.isInteger(ke.pauseDrag)?ke.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(t),s)}else this._callDrag(t);else if(Math.abs(t.x-i.x)+Math.abs(t.y-i.y)>3){this.dragging=!0,ke.dragElement=this;const s=(r=this.el.gridstackNode)==null?void 0:r.grid;s?ke.dropElement=s.el.ddElement.ddDroppable:delete ke.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=te.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(t,this.el,this.helperContainment),this._setupHelperStyle(t);const l=te.initEvent(t,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(l,this.ui()),this.triggerEvent("dragstart",l),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(t){var i,r;if(this._stopScrolling(),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),ir&&t.currentTarget&&(t.currentTarget.removeEventListener("touchmove",wu,!0),t.currentTarget.removeEventListener("touchend",_u,!0)),this.dragging){delete this.dragging,(i=this.el.gridstackNode)==null||delete i._origRotate,document.removeEventListener("keydown",this._keyEvent),((r=ke.dropElement)==null?void 0:r.el)===this.el.parentElement&&delete ke.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();const s=te.initEvent(t,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(s),this.triggerEvent("dragstop",s),ke.dropElement&&ke.dropElement.drop(t)}delete this.helper,delete this.mouseDownEvent,delete ke.dragElement,delete ke.dropElement,delete ke.mouseHandled,t.preventDefault()}_keyEvent(t){var s,l;const i=this.el.gridstackNode,r=(i==null?void 0:i.grid)||((l=(s=ke.dropElement)==null?void 0:s.el)==null?void 0:l.gridstack);if(t.key==="Escape")i&&i._origRotate&&(i._orig=i._origRotate,delete i._origRotate),r==null||r.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(i&&r&&(t.key==="r"||t.key==="R")){if(!te.canBeRotated(i))return;i._origRotate=i._origRotate||{...i._orig},delete i._moving,r.setAnimation(!1).rotate(i.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetX}).setAnimation(),i._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,i.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",te.swap(i._orig,"w","h"),delete i._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let t=this.el;return typeof this.option.helper=="function"?t=this.option.helper(this.el):this.option.helper==="clone"&&(t=te.cloneNode(this.el)),t.parentElement||te.appendTo(t,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=Tl.originStyleProp.map(i=>this.el.style[i]),t}_setupHelperStyle(t){var r,s;this.helper.classList.add("ui-draggable-dragging"),(s=(r=this.el.gridstackNode)==null?void 0:r.grid)==null||s.el.classList.add("grid-stack-dragging");const i=this.helper.style;return i.pointerEvents="none",i.width=this.dragOffset.width+"px",i.height=this.dragOffset.height+"px",i.willChange="left, right, top",i.position="fixed",this._dragFollow(t),i.transition="none",setTimeout(()=>{this.helper&&(i.transition=null)},0),this}_removeHelperStyle(){var i,r,s;this.helper.classList.remove("ui-draggable-dragging"),(r=(i=this.el.gridstackNode)==null?void 0:i.grid)==null||r.el.classList.remove("grid-stack-dragging");const t=(s=this.helper)==null?void 0:s.gridstackNode;if(!(t!=null&&t._isAboutToRemove)&&this.dragElementOriginStyle){const l=this.helper,c=this.dragElementOriginStyle.transition||null;l.style.transition=this.dragElementOriginStyle.transition="none",Tl.originStyleProp.forEach(f=>l.style[f]=this.dragElementOriginStyle[f]||null),setTimeout(()=>l.style.transition=c,50)}return delete this.dragElementOriginStyle,this}_dragFollow(t){const i=this.helper.style,r=this.dragOffset;this.option.rtl?(i.right=(window.innerWidth-t.clientX+r.offsetX)*this.dragTransform.xScale+"px",i.left&&(i.left="")):(i.left=(t.clientX+r.offsetX)*this.dragTransform.xScale+"px",i.right&&(i.right="")),i.top=(t.clientY+r.offsetTop)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(t,i,r){let s=0,l=0;r&&(s=this.dragTransform.xOffset,l=this.dragTransform.yOffset);const c=i.getBoundingClientRect();let f=this.option.rtl?c.right:c.left,h=this.option.rtl?t.clientX-c.right+s:-t.clientX+c.left-s;return{x:f,top:c.top,offsetX:h,offsetTop:-t.clientY+c.top-l,width:c.width*this.dragTransform.xScale,height:c.height*this.dragTransform.yScale}}updateScrollPosition(t){this._autoScrollContainer=te.getScrollElement(t),this._getClipping(this.helper,this._autoScrollContainer)===0?this._stopScrolling():this._autoScrollAnimId||(this._autoScrollAnimId=requestAnimationFrame(this._autoScrollTick))}_getClipping(t,i){const r=t.getBoundingClientRect(),s=i.getBoundingClientRect(),l=window.innerHeight||document.documentElement.clientHeight;if(r.bottom<s.top||r.top>s.bottom)return 0;const c=r.bottom-Math.min(s.bottom,l),f=r.top-Math.max(s.top,0);return f<0?f:c>0?c:0}_stopScrolling(){this._autoScrollAnimId&&(cancelAnimationFrame(this._autoScrollAnimId),delete this._autoScrollAnimId)}ui(){const i=this.el.parentElement.getBoundingClientRect(),r=this.helper.getBoundingClientRect(),s=this.option.rtl?(i.right-r.right)*this.dragTransform.xScale:(r.left-i.left)*this.dragTransform.xScale;return{position:{top:(r.top-i.top)*this.dragTransform.yScale,left:s}}}}Tl.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","right","top","minWidth","willChange"];class Jz extends Nm{constructor(t,i={}){super(),this.el=t,this.option=i,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(t,i){super.on(t,i)}off(t){super.off(t)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),ir&&(this.el.addEventListener("pointerenter",T1),this.el.addEventListener("pointerleave",E1)))}disable(t=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),t||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),ir&&(this.el.removeEventListener("pointerenter",T1),this.el.removeEventListener("pointerleave",E1)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(t){return Object.keys(t).forEach(i=>this.option[i]=t[i]),this._setupAccept(),this}_mouseEnter(t){if(!ke.dragElement||Ri.touchHandled&&t.isTrusted||!this._canDrop(ke.dragElement.el))return;t.preventDefault(),t.stopPropagation(),ke.dragElement._stopScrolling(),ke.dropElement&&ke.dropElement!==this&&ke.dropElement._mouseLeave(t,!0),ke.dropElement=this;const i=te.initEvent(t,{target:this.el,type:"dropover"});this.option.over&&this.option.over(i,this._ui(ke.dragElement)),this.triggerEvent("dropover",i),this.el.classList.add("ui-droppable-over")}_mouseLeave(t,i=!1){var s;if(!ke.dragElement||ke.dropElement!==this)return;t.preventDefault(),t.stopPropagation(),i&&ke.dragElement._stopScrolling();const r=te.initEvent(t,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(r,this._ui(ke.dragElement)),this.triggerEvent("dropout",r),ke.dropElement===this&&(delete ke.dropElement,!i)){let l,c=this.el.parentElement;for(;!l&&c;)l=(s=c.ddElement)==null?void 0:s.ddDroppable,c=c.parentElement;l&&l._mouseEnter(t)}}drop(t){t.preventDefault();const i=te.initEvent(t,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(i,this._ui(ke.dragElement)),this.triggerEvent("drop",i)}_canDrop(t){return t&&(!this.accept||this.accept(t))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=t=>t.classList.contains(this.option.accept)||t.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(t){return{draggable:t.el,...t.ui()}}}class Rm{static init(t){return t.ddElement||(t.ddElement=new Rm(t)),t.ddElement}constructor(t){this.el=t}on(t,i){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(t)>-1?this.ddDraggable.on(t,i):this.ddDroppable&&["drop","dropover","dropout"].indexOf(t)>-1?this.ddDroppable.on(t,i):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(t)>-1&&this.ddResizable.on(t,i),this}off(t){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(t)>-1?this.ddDraggable.off(t):this.ddDroppable&&["drop","dropover","dropout"].indexOf(t)>-1?this.ddDroppable.off(t):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(t)>-1&&this.ddResizable.off(t),this}setupDraggable(t){return this.ddDraggable?this.ddDraggable.updateOption(t):this.ddDraggable=new Tl(this.el,t),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(t){return this.ddResizable?this.ddResizable.updateOption(t):this.ddResizable=new Sl(this.el,t),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(t){return this.ddDroppable?this.ddDroppable.updateOption(t):this.ddDroppable=new Jz(this.el,t),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}}class eM{resizable(t,i,r,s){return this._getDDElements(t,i).forEach(l=>{if(i==="disable"||i==="enable")l.ddResizable&&l.ddResizable[i]();else if(i==="destroy")l.ddResizable&&l.cleanResizable();else if(i==="option")l.setupResizable({[r]:s});else{const f=l.el.gridstackNode.grid;let h=l.el.getAttribute("gs-resize-handles")||f.opts.resizable.handles||"e,s,se";h==="all"&&(h="n,e,s,w,se,sw,ne,nw");const d=!f.opts.alwaysShowResizeHandle;l.setupResizable({...f.opts.resizable,handles:h,autoHide:d,start:i.start,stop:i.stop,resize:i.resize,rtl:i.rtl})}}),this}draggable(t,i,r,s){return this._getDDElements(t,i).forEach(l=>{if(i==="disable"||i==="enable")l.ddDraggable&&l.ddDraggable[i]();else if(i==="destroy")l.ddDraggable&&l.cleanDraggable();else if(i==="option")l.setupDraggable({[r]:s});else{const c=l.el.gridstackNode.grid;l.setupDraggable({...c.opts.draggable,start:i.start,stop:i.stop,drag:i.drag,rtl:i.rtl})}}),this}dragIn(t,i){return this._getDDElements(t).forEach(r=>r.setupDraggable(i)),this}droppable(t,i,r,s){return typeof i.accept=="function"&&!i._accept&&(i._accept=i.accept,i.accept=l=>i._accept(l)),this._getDDElements(t,i).forEach(l=>{i==="disable"||i==="enable"?l.ddDroppable&&l.ddDroppable[i]():i==="destroy"?l.ddDroppable&&l.cleanDroppable():i==="option"?l.setupDroppable({[r]:s}):l.setupDroppable(i)}),this}isDroppable(t){var i;return!!((i=t==null?void 0:t.ddElement)!=null&&i.ddDroppable&&!t.ddElement.ddDroppable.disabled)}isDraggable(t){var i;return!!((i=t==null?void 0:t.ddElement)!=null&&i.ddDraggable&&!t.ddElement.ddDraggable.disabled)}isResizable(t){var i;return!!((i=t==null?void 0:t.ddElement)!=null&&i.ddResizable&&!t.ddElement.ddResizable.disabled)}on(t,i,r){return this._getDDElements(t).forEach(s=>s.on(i,l=>{r(l,ke.dragElement?ke.dragElement.el:l.target,ke.dragElement?ke.dragElement.helper:null)})),this}off(t,i){return this._getDDElements(t).forEach(r=>r.off(i)),this}_getDDElements(t,i){const r=t.gridstack||i!=="destroy"&&i!=="disable",s=te.getElements(t);return s.length?s.map(c=>c.ddElement||(r?Rm.init(c):null)).filter(c=>c):[]}}/*!
418
+ * GridStack 12.6.0
419
+ * https://gridstackjs.com/
420
+ *
421
+ * Copyright (c) 2021-2025 Alain Dumesny
422
+ * see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
423
+ */const ni=new eM;class Me{static init(t={},i=".grid-stack"){if(typeof document>"u")return null;const r=Me.getGridElement(i);return r?(r.gridstack||(r.gridstack=new Me(r,te.cloneDeep(t))),r.gridstack):(console.error(typeof i=="string"?'GridStack.initAll() no grid was found with selector "'+i+`" - element missing or wrong selector ?
424
+ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`:"GridStack.init() no grid element was passed."),null)}static initAll(t={},i=".grid-stack"){const r=[];return typeof document>"u"||(Me.getGridElements(i).forEach(s=>{s.gridstack||(s.gridstack=new Me(s,te.cloneDeep(t))),r.push(s.gridstack)}),r.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+i+`" - element missing or wrong selector ?
425
+ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),r}static addGrid(t,i={}){if(!t)return null;let r=t;if(r.gridstack){const c=r.gridstack;return i&&(c.opts={...c.opts,...i}),i.children!==void 0&&c.load(i.children),c}return(!t.classList.contains("grid-stack")||Me.addRemoveCB)&&(Me.addRemoveCB?r=Me.addRemoveCB(t,i,!0,!0):r=te.createDiv(["grid-stack",i.class],t)),Me.init(i,r)}static registerEngine(t){Me.engineClass=t}get placeholder(){if(!this._placeholder){this._placeholder=te.createDiv([this.opts.placeholderClass,Ni.itemClass,this.opts.itemClass]);const t=te.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(t.textContent=this.opts.placeholderText)}return this._placeholder}constructor(t,i={}){var d;this.el=t,this.opts=i,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},t.gridstack=this,this.opts=i=i||{},t.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),i.row&&(i.minRow=i.maxRow=i.row,delete i.row);const r=te.toNumber(t.getAttribute("gs-row"));i.column==="auto"&&delete i.column,i.alwaysShowResizeHandle!==void 0&&(i._alwaysShowResizeHandle=i.alwaysShowResizeHandle);const s=i.columnOpts;if(s){const g=s.breakpoints;!s.columnWidth&&!(g!=null&&g.length)?delete i.columnOpts:(s.columnMax=s.columnMax||12,(g==null?void 0:g.length)>1&&g.sort((v,y)=>(y.w||0)-(v.w||0)))}const l={...te.cloneDeep(Ni),column:te.toNumber(t.getAttribute("gs-column"))||Ni.column,minRow:r||te.toNumber(t.getAttribute("gs-min-row"))||Ni.minRow,maxRow:r||te.toNumber(t.getAttribute("gs-max-row"))||Ni.maxRow,staticGrid:te.toBool(t.getAttribute("gs-static"))||Ni.staticGrid,sizeToContent:te.toBool(t.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(i.handleClass?"."+i.handleClass:i.handle?i.handle:"")||Ni.draggable.handle},removableOptions:{accept:i.itemClass||Ni.removableOptions.accept,decline:Ni.removableOptions.decline}};t.getAttribute("gs-animate")&&(l.animate=te.toBool(t.getAttribute("gs-animate"))),i=te.defaults(i,l),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(i),i.rtl==="auto"&&(i.rtl=t.style.direction==="rtl"),i.rtl&&this.el.classList.add("grid-stack-rtl");const c=this.el.closest("."+Ni.itemClass),f=c==null?void 0:c.gridstackNode;if(f&&(f.subGrid=this,this.parentGridNode=f,this.el.classList.add("grid-stack-nested"),f.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=i.cellHeight==="auto",this._isAutoCellHeight||i.cellHeight==="initial")this.cellHeight(void 0);else{typeof i.cellHeight=="number"&&i.cellHeightUnit&&i.cellHeightUnit!==Ni.cellHeightUnit&&(i.cellHeight=i.cellHeight+i.cellHeightUnit,delete i.cellHeightUnit);const g=i.cellHeight;delete i.cellHeight,this.cellHeight(g)}i.alwaysShowResizeHandle==="mobile"&&(i.alwaysShowResizeHandle=ir),this._setStaticClass();const h=i.engineClass||Me.engineClass||Pr;if(this.engine=new h({column:this.getColumn(),float:i.float,maxRow:i.maxRow,onChange:g=>{g.forEach(v=>{const y=v.el;y&&(v._removeDOM?(y&&y.remove(),delete v._removeDOM):this._writePosAttr(y,v))}),this._updateContainerHeight()}}),i.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(g=>this._prepareElement(g)),delete this.engine._loading,this.batchUpdate(!1)),i.children){const g=i.children;delete i.children,g.length&&this.load(g)}this.setAnimation(),i.subGridDynamic&&!ke.pauseDrag&&(ke.pauseDrag=!0),((d=i.draggable)==null?void 0:d.pause)!==void 0&&(ke.pauseDrag=i.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(t=this.opts){this.el.classList.add("gs-"+t.column),typeof t.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/t.column}%`)}addWidget(t){if(!t)return;if(typeof t=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(t.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(t);let i,r=t;if(r.grid=this,r.el?i=r.el:Me.addRemoveCB?i=Me.addRemoveCB(this.el,t,!0,!1):i=this.createWidgetDivs(r),!i)return;if(r=i.gridstackNode,r&&i.parentElement===this.el&&this.engine.nodes.find(l=>l._id===r._id))return i;const s=this._readAttr(i);return te.defaults(t,s),this.engine.prepareNode(t),this.el.appendChild(i),this.makeWidget(i,t),i}createWidgetDivs(t){const i=te.createDiv(["grid-stack-item",this.opts.itemClass]),r=te.createDiv(["grid-stack-item-content"],i);return te.lazyLoad(t)?t.visibleObservable||(t.visibleObservable=new IntersectionObserver(([s])=>{var l,c;s.isIntersecting&&((l=t.visibleObservable)==null||l.disconnect(),delete t.visibleObservable,Me.renderCB(r,t),(c=t.grid)==null||c.prepareDragDrop(t.el))}),window.setTimeout(()=>{var s;return(s=t.visibleObservable)==null?void 0:s.observe(i)})):Me.renderCB(r,t),i}makeSubGrid(t,i,r,s=!0){var x,S,_;let l=t.gridstackNode;if(l||(l=this.makeWidget(t).gridstackNode),(x=l.subGrid)!=null&&x.el)return l.subGrid;let c,f=this;for(;f&&!c;)c=(S=f.opts)==null?void 0:S.subGridOpts,f=(_=f.parentGridNode)==null?void 0:_.grid;i=te.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...c||{},...i||l.subGridOpts||{}}),l.subGridOpts=i;let h;i.column==="auto"&&(h=!0,i.column=Math.max(l.w||1,(r==null?void 0:r.w)||1),delete i.columnOpts);let d=l.el.querySelector(".grid-stack-item-content"),g,v;if(s&&(this._removeDD(l.el),v={...l,x:0,y:0},te.removeInternalForSave(v),delete v.subGridOpts,l.content&&(v.content=l.content,delete l.content),Me.addRemoveCB?g=Me.addRemoveCB(this.el,v,!0,!1):(g=te.createDiv(["grid-stack-item"]),g.appendChild(d),d=te.createDiv(["grid-stack-item-content"],l.el)),this.prepareDragDrop(l.el)),r){const T=h?i.column:l.w,E=l.h+r.h,C=l.el.style;C.transition="none",this.update(l.el,{w:T,h:E}),setTimeout(()=>C.transition=null)}const y=l.subGrid=Me.addGrid(d,i);return r!=null&&r._moving&&(y._isTemp=!0),h&&(y._autoColumn=!0),s&&y.makeWidget(g,v),r&&(r._moving?window.setTimeout(()=>te.simulateMouseEvent(r._event,"mouseenter",y.el),0):y.makeWidget(l.el,l)),this.resizeToContentCheck(!1,l),y}removeAsSubGrid(t){var r;const i=(r=this.parentGridNode)==null?void 0:r.grid;i&&(i.batchUpdate(),i.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(s=>{s.x+=this.parentGridNode.x,s.y+=this.parentGridNode.y,i.makeWidget(s.el,s)}),i.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,t&&window.setTimeout(()=>te.simulateMouseEvent(t._event,"mouseenter",i.el),0))}save(t=!0,i=!1,r=Me.saveCB,s){const l=this.engine.save(t,r,s);if(l.forEach(c=>{var f;if(t&&c.el&&!c.subGrid&&!r){const h=c.el.querySelector(".grid-stack-item-content");c.content=h==null?void 0:h.innerHTML,c.content||delete c.content}else if(!t&&!r&&delete c.content,(f=c.subGrid)!=null&&f.el){const h=c.w||c.subGrid.getColumn(),d=c.subGrid.save(t,i,r,h);c.subGridOpts=i?d:{children:d},delete c.subGrid}delete c.el}),i){const c=te.cloneDeep(this.opts);c.marginBottom===c.marginTop&&c.marginRight===c.marginLeft&&c.marginTop===c.marginRight&&(c.margin=c.marginTop,delete c.marginTop,delete c.marginRight,delete c.marginBottom,delete c.marginLeft),c.rtl===(this.el.style.direction==="rtl")&&(c.rtl="auto"),this._isAutoCellHeight&&(c.cellHeight="auto"),this._autoColumn&&(c.column="auto");const f=c._alwaysShowResizeHandle;return delete c._alwaysShowResizeHandle,f!==void 0?c.alwaysShowResizeHandle=f:delete c.alwaysShowResizeHandle,te.removeInternalAndSame(c,Ni),c.children=l,c}return l}load(t,i=Me.addRemoveCB||!0){t.forEach(g=>{g.w=g.w||g.minW||1,g.h=g.h||g.minH||1}),t=te.sort(t),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let r=0;t.forEach(g=>{r=Math.max(r,(g.x||0)+g.w)}),r>this.engine.defaultColumn&&(this.engine.defaultColumn=r);const s=this.getColumn();r>s&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=t,this.engine.columnChanged(r,s,this.responseLayout),t=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(t,r,!0));const l=Me.addRemoveCB;typeof i=="function"&&(Me.addRemoveCB=i);const c=[];this.batchUpdate();const f=!this.engine.nodes.length,h=f&&this.opts.animate;h&&this.setAnimation(!1),!f&&i&&[...this.engine.nodes].forEach(v=>{if(!v.id)return;te.find(t,v.id)||(Me.addRemoveCB&&Me.addRemoveCB(this.el,v,!1,!1),c.push(v),this.removeWidget(v.el,!0,!1))}),this.engine._loading=!0;const d=[];return this.engine.nodes=this.engine.nodes.filter(g=>te.find(t,g.id)?(d.push(g),!1):!0),t.forEach(g=>{var y;const v=te.find(d,g.id);if(v){if(te.shouldSizeToContent(v)&&(g.h=v.h),this.engine.nodeBoundFix(g),(g.autoPosition||g.x===void 0||g.y===void 0)&&(g.w=g.w||v.w,g.h=g.h||v.h,this.engine.findEmptyPosition(g)),this.engine.nodes.push(v),te.samePos(v,g)&&this.engine.nodes.length>1&&(this.moveNode(v,{...g,forceCollide:!0}),te.copyPos(g,v)),this.update(v.el,g),(y=g.subGridOpts)!=null&&y.children){const x=v.el.querySelector(".grid-stack");x&&x.gridstack&&x.gridstack.load(g.subGridOpts.children)}}else i&&this.addWidget(g)}),delete this.engine._loading,this.engine.removedNodes=c,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,l?Me.addRemoveCB=l:delete Me.addRemoveCB,h&&this.setAnimation(!0,!0),this}batchUpdate(t=!0){return this.engine.batchUpdate(t),t||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(t=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!t||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;if(this.opts.cellHeightUnit==="rem")return this.opts.cellHeight*parseFloat(getComputedStyle(document.documentElement).fontSize);if(this.opts.cellHeightUnit==="em")return this.opts.cellHeight*parseFloat(getComputedStyle(this.el).fontSize);if(this.opts.cellHeightUnit==="cm")return this.opts.cellHeight*(96/2.54);if(this.opts.cellHeightUnit==="mm")return this.opts.cellHeight*(96/2.54)/10;const i=this.el.querySelector("."+this.opts.itemClass);if(i){const s=te.toNumber(i.getAttribute("gs-h"))||1;return Math.round(i.offsetHeight/s)}const r=parseInt(this.el.getAttribute("gs-current-row"));return r?Math.round(this.el.getBoundingClientRect().height/r):this.opts.cellHeight}cellHeight(t){if(t!==void 0&&this._isAutoCellHeight!==(t==="auto")&&(this._isAutoCellHeight=t==="auto",this._updateResizeEvent()),(t==="initial"||t==="auto")&&(t=void 0),t===void 0){const r=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;t=this.cellWidth()+r}const i=te.parseHeight(t);return this.opts.cellHeightUnit===i.unit&&this.opts.cellHeight===i.h?this:(this.opts.cellHeightUnit=i.unit,this.opts.cellHeight=i.h,this.el.style.setProperty("--gs-cell-height",`${this.opts.cellHeight}${this.opts.cellHeightUnit}`),this._updateContainerHeight(),this.resizeToContentCheck(),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(t=!1){var i;return t&&((i=this.opts.columnOpts)!=null&&i.breakpointForWindow)?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){var l,c;const t=this.opts.columnOpts;if(!t||!t.columnWidth&&!((l=t.breakpoints)!=null&&l.length))return!1;const i=this.getColumn();let r=i;const s=this._widthOrContainer(!0);if(t.columnWidth)r=Math.min(Math.round(s/t.columnWidth)||1,t.columnMax);else{r=t.columnMax;let f=0;for(;f<t.breakpoints.length&&s<=t.breakpoints[f].w;)r=t.breakpoints[f++].c||i}if(r!==i){const f=(c=t.breakpoints)==null?void 0:c.find(h=>h.c===r);return this.column(r,(f==null?void 0:f.layout)||t.layout),!0}return!1}compact(t="compact",i=!0){return this.engine.compact(t,i),this._triggerChangeEvent(),this}column(t,i="moveScale"){if(!t||t<1||this.opts.column===t)return this;const r=this.getColumn();return this.opts.column=t,this.engine?(this.engine.column=t,this.el.classList.remove("gs-"+r),this._updateColumnVar(),this.engine.columnChanged(r,t,i),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=i,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(t=>t.matches("."+this.opts.itemClass)&&!t.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(t=!0){var i;if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),t?this.el.parentNode.removeChild(this.el):(this.removeAll(t),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,(i=this._placeholder)==null||delete i.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(t){return this.opts.float!==t&&(this.opts.float=this.engine.float=t,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(t,i=!1){const r=this.el.getBoundingClientRect();let s;i?s={top:r.top+document.documentElement.scrollTop,left:r.left}:s={top:this.el.offsetTop,left:this.el.offsetLeft};const l=t.left-s.left,c=t.top-s.top,f=r.width/this.getColumn(),h=r.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(l/f),y:Math.floor(c/h)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(t,i,r,s){return this.engine.isAreaEmpty(t,i,r,s)}makeWidget(t,i){const r=Me.getElement(t);if(!r||r.gridstackNode)return r;r.parentElement||this.el.appendChild(r),this._prepareElement(r,!0,i);const s=r.gridstackNode;this._updateContainerHeight(),s.subGridOpts&&this.makeSubGrid(r,s.subGridOpts,void 0,!1);let l;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(l=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),l&&delete this._ignoreLayoutsNodeChange,r}on(t,i){return t.indexOf(" ")!==-1?(t.split(" ").forEach(s=>this.on(s,i)),this):(t==="change"||t==="added"||t==="removed"||t==="enable"||t==="disable"?(t==="enable"||t==="disable"?this._gsEventHandler[t]=s=>i(s):this._gsEventHandler[t]=s=>{s.detail&&i(s,s.detail)},this.el.addEventListener(t,this._gsEventHandler[t])):t==="drag"||t==="dragstart"||t==="dragstop"||t==="resizestart"||t==="resize"||t==="resizestop"||t==="dropped"||t==="resizecontent"?this._gsEventHandler[t]=i:console.error("GridStack.on("+t+") event not supported"),this)}off(t){return t.indexOf(" ")!==-1?(t.split(" ").forEach(r=>this.off(r)),this):((t==="change"||t==="added"||t==="removed"||t==="enable"||t==="disable")&&this._gsEventHandler[t]&&this.el.removeEventListener(t,this._gsEventHandler[t]),delete this._gsEventHandler[t],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(t=>this.off(t)),this}removeWidget(t,i=!0,r=!0){return t?(Me.getElements(t).forEach(s=>{if(s.parentElement&&s.parentElement!==this.el)return;let l=s.gridstackNode;l||(l=this.engine.nodes.find(c=>s===c.el)),l&&(i&&Me.addRemoveCB&&Me.addRemoveCB(this.el,l,!1,!1),delete s.gridstackNode,this._removeDD(s),this.engine.removeNode(l,i,r),i&&s.parentElement&&s.remove())}),r&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(t=!0,i=!0){return this.engine.nodes.forEach(r=>{t&&Me.addRemoveCB&&Me.addRemoveCB(this.el,r,!1,!1),delete r.el.gridstackNode,this.opts.staticGrid||this._removeDD(r.el)}),this.engine.removeAll(t,i),i&&this._triggerRemoveEvent(),this}setAnimation(t=this.opts.animate,i){return i?setTimeout(()=>{this.opts&&this.setAnimation(t)}):t?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=t,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(t,i=!0,r=!0){return!!this.opts.staticGrid===t?this:(t?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(s=>{this.prepareDragDrop(s.el),s.subGrid&&r&&s.subGrid.setStatic(t,i,r)}),i&&this._setStaticClass(),this)}updateOptions(t){var r;const i=this.opts;if(t===i)return this;if(t.acceptWidgets!==void 0&&(i.acceptWidgets=t.acceptWidgets,this._setupAcceptWidget()),t.animate!==void 0&&this.setAnimation(t.animate),t.cellHeight&&this.cellHeight(t.cellHeight),t.class!==void 0&&t.class!==i.class&&(i.class&&this.el.classList.remove(i.class),t.class&&this.el.classList.add(t.class)),t.columnOpts){const s=!!this.opts.columnOpts;this.opts.columnOpts=t.columnOpts,s!==!!this.opts.columnOpts&&this._updateResizeEvent(),this.checkDynamicColumn()}else t.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof t.column=="number"&&this.column(t.column);return t.margin!==void 0&&this.margin(t.margin),t.staticGrid!==void 0&&this.setStatic(t.staticGrid),t.disableDrag!==void 0&&!t.staticGrid&&this.enableMove(!t.disableDrag),t.disableResize!==void 0&&!t.staticGrid&&this.enableResize(!t.disableResize),t.float!==void 0&&this.float(t.float),t.row!==void 0?(i.minRow=i.maxRow=i.row=t.row,this._updateContainerHeight()):(t.minRow!==void 0&&(i.minRow=t.minRow,this._updateContainerHeight()),t.maxRow!==void 0&&(i.maxRow=this.engine.maxRow=t.maxRow)),t.lazyLoad!==void 0&&(i.lazyLoad=t.lazyLoad),(r=t.children)!=null&&r.length&&this.load(t.children),this}update(t,i){return Me.getElements(t).forEach(r=>{var g;const s=r==null?void 0:r.gridstackNode;if(!s)return;const l={...te.copyPos({},s),...te.cloneDeep(i)};this.engine.nodeBoundFix(l),delete l.autoPosition;const c=["x","y","w","h"];let f;if(c.some(v=>l[v]!==void 0&&l[v]!==s[v])&&(f={},c.forEach(v=>{f[v]=l[v]!==void 0?l[v]:s[v],delete l[v]})),!f&&(l.minW||l.minH||l.maxW||l.maxH)&&(f={}),l.content!==void 0){const v=r.querySelector(".grid-stack-item-content");v&&v.textContent!==l.content&&(s.content=l.content,Me.renderCB(v,l),(g=s.subGrid)!=null&&g.el&&(v.appendChild(s.subGrid.el),s.subGrid._updateContainerHeight())),delete l.content}let h=!1,d=!1;for(const v in l)v[0]!=="_"&&s[v]!==l[v]&&(s[v]=l[v],h=!0,d=d||!this.opts.staticGrid&&(v==="noResize"||v==="noMove"||v==="locked"));if(te.sanitizeMinMax(s),f){const v=f.w!==void 0&&f.w!==s.w;this.moveNode(s,f),v&&s.subGrid?s.subGrid.onResize(this.hasAnimationCSS()?s.w:void 0):this.resizeToContentCheck(v,s),delete s._orig}(f||h)&&this._writeAttr(r,s),d&&this.prepareDragDrop(s.el),Me.updateCB&&Me.updateCB(s)}),this}moveNode(t,i){const r=t._updating;r||this.engine.cleanNodes().beginUpdate(t),this.engine.moveNode(t,i),this._updateContainerHeight(),r||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(t){var y,x;if(!t||(t.classList.remove("size-to-content-max"),!t.clientHeight))return;const i=t.gridstackNode;if(!i)return;const r=i.grid;if(!r||t.parentElement!==r.el)return;const s=r.getCellHeight(!0);if(!s)return;let l=i.h?i.h*s:t.clientHeight,c;if(i.resizeToContentParent&&(c=t.querySelector(i.resizeToContentParent)),c||(c=t.querySelector(Me.resizeToContentParent)),!c)return;const f=t.clientHeight-c.clientHeight,h=i.h?i.h*s-f:c.clientHeight;let d;if(i.subGrid){d=i.subGrid.getRow()*i.subGrid.getCellHeight(!0);const S=i.subGrid.el.getBoundingClientRect(),_=t.getBoundingClientRect();d+=S.top-_.top}else{if((x=(y=i.subGridOpts)==null?void 0:y.children)!=null&&x.length)return;{const S=c.firstElementChild;if(!S){console.error(`Error: GridStack.resizeToContent() widget id:${i.id} '${Me.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}d=S.getBoundingClientRect().height||h}}if(h===d)return;l+=d-h;let g=Math.ceil(l/s);const v=Number.isInteger(i.sizeToContent)?i.sizeToContent:0;v&&g>v&&(g=v,t.classList.add("size-to-content-max")),i.minH&&g<i.minH?g=i.minH:i.maxH&&g>i.maxH&&(g=i.maxH),g!==i.h&&(r._ignoreLayoutsNodeChange=!0,r.moveNode(i,{h:g}),delete r._ignoreLayoutsNodeChange)}resizeToContentCBCheck(t){Me.resizeToContentCB?Me.resizeToContentCB(t):this.resizeToContent(t)}rotate(t,i){return Me.getElements(t).forEach(r=>{const s=r.gridstackNode;if(!te.canBeRotated(s))return;const l={w:s.h,h:s.w,minH:s.minW,minW:s.minH,maxH:s.maxW,maxW:s.maxH};if(i){const f=i.left>0?Math.floor(i.left/this.cellWidth()):0,h=i.top>0?Math.floor(i.top/this.opts.cellHeight):0;l.x=s.x+f-(s.h-(h+1)),l.y=s.y+h-f}Object.keys(l).forEach(f=>{l[f]===void 0&&delete l[f]});const c=s._orig;this.update(r,l),s._orig=c}),this}margin(t){if(!(typeof t=="string"&&t.split(" ").length>1)){const r=te.parseHeight(t);if(this.opts.marginUnit===r.unit&&this.opts.margin===r.h)return}return this.opts.margin=t,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(t){return this.engine.willItFit(t)}_triggerChangeEvent(){if(this.engine.batchMode)return this;const t=this.engine.getDirtyNodes(!0);return t&&t.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(t),this._triggerEvent("change",t)),this.engine.saveInitial(),this}_triggerAddEvent(){var t;if(this.engine.batchMode)return this;if((t=this.engine.addedNodes)!=null&&t.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(r=>{delete r._dirty});const i=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",i)}return this}_triggerRemoveEvent(){var t;if(this.engine.batchMode)return this;if((t=this.engine.removedNodes)!=null&&t.length){const i=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",i)}return this}_triggerEvent(t,i){const r=i?new CustomEvent(t,{bubbles:!1,detail:i}):new Event(t);let s=this;for(;s.parentGridNode;)s=s.parentGridNode.grid;return s.el.dispatchEvent(r),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const t=this.parentGridNode;let i=this.getRow()+this._extraDragRow;const r=this.opts.cellHeight,s=this.opts.cellHeightUnit;if(!r)return this;if(!t&&!this.opts.minRow){const l=te.parseHeight(getComputedStyle(this.el).minHeight);if(l.h>0&&l.unit===s){const c=Math.floor(l.h/r);i<c&&(i=c)}}return this.el.setAttribute("gs-current-row",String(i)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),i&&(this.el.style[t?"minHeight":"height"]=i*r+s),t&&te.shouldSizeToContent(t)&&t.grid.resizeToContentCBCheck(t.el),this}_prepareElement(t,i=!1,r){r=r||this._readAttr(t),t.gridstackNode=r,r.el=t,r.grid=this,r=this.engine.addNode(r,i),this._writeAttr(t,r),t.classList.add(Ni.itemClass,this.opts.itemClass);const s=te.shouldSizeToContent(r);return s?t.classList.add("size-to-content"):t.classList.remove("size-to-content"),s&&this.resizeToContentCheck(!1,r),te.lazyLoad(r)||this.prepareDragDrop(r.el),this}_writePosAttr(t,i){if(!i._moving&&!i._resizing||this._placeholder===t){const r=this.opts.rtl?"right":"left";t.style.top=i.y?i.y===1?"var(--gs-cell-height)":`calc(${i.y} * var(--gs-cell-height))`:null,t.style[r]=i.x?i.x===1?"var(--gs-column-width)":`calc(${i.x} * var(--gs-column-width))`:null,t.style.width=i.w>1?`calc(${i.w} * var(--gs-column-width))`:null,t.style.height=i.h>1?`calc(${i.h} * var(--gs-cell-height))`:null}return t.setAttribute("gs-x",String(i.x)),t.setAttribute("gs-y",String(i.y)),i.w>1?t.setAttribute("gs-w",String(i.w)):t.removeAttribute("gs-w"),i.h>1?t.setAttribute("gs-h",String(i.h)):t.removeAttribute("gs-h"),this}_writeAttr(t,i){if(!i)return this;this._writePosAttr(t,i);const r={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const s in r)i[s]?t.setAttribute(r[s],String(i[s])):t.removeAttribute(r[s]);return this}_readAttr(t,i=!0){const r={};r.x=te.toNumber(t.getAttribute("gs-x")),r.y=te.toNumber(t.getAttribute("gs-y")),r.w=te.toNumber(t.getAttribute("gs-w")),r.h=te.toNumber(t.getAttribute("gs-h")),r.autoPosition=te.toBool(t.getAttribute("gs-auto-position")),r.noResize=te.toBool(t.getAttribute("gs-no-resize")),r.noMove=te.toBool(t.getAttribute("gs-no-move")),r.locked=te.toBool(t.getAttribute("gs-locked"));const s=t.getAttribute("gs-size-to-content");s&&(s==="true"||s==="false"?r.sizeToContent=te.toBool(s):r.sizeToContent=parseInt(s,10)),r.id=t.getAttribute("gs-id"),r.maxW=te.toNumber(t.getAttribute("gs-max-w")),r.minW=te.toNumber(t.getAttribute("gs-min-w")),r.maxH=te.toNumber(t.getAttribute("gs-max-h")),r.minH=te.toNumber(t.getAttribute("gs-min-h")),i&&(r.w===1&&t.removeAttribute("gs-w"),r.h===1&&t.removeAttribute("gs-h"),r.maxW&&t.removeAttribute("gs-max-w"),r.minW&&t.removeAttribute("gs-min-w"),r.maxH&&t.removeAttribute("gs-max-h"),r.minH&&t.removeAttribute("gs-min-h"));for(const l in r){if(!r.hasOwnProperty(l))return;!r[l]&&r[l]!==0&&l!=="sizeToContent"&&delete r[l]}return r}_setStaticClass(){const t=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...t),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...t),this.el.removeAttribute("gs-static")),this}onResize(t=(i=>(i=this.el)==null?void 0:i.clientWidth)()){if(!t||this.prevWidth===t)return;this.prevWidth=t,this.batchUpdate();let r=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),r=!0):r=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(s=>{s.subGrid&&s.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(r),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(t=!1,i=void 0){if(this.engine){if(t&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,i),this.animationDelay);if(i)te.shouldSizeToContent(i)&&this.resizeToContentCBCheck(i.el);else if(this.engine.nodes.some(r=>te.shouldSizeToContent(r))){const r=[...this.engine.nodes];this.batchUpdate(),r.forEach(s=>{te.shouldSizeToContent(s)&&this.resizeToContentCBCheck(s.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,i?[i]:this.engine.nodes)}}_updateResizeEvent(t=!1){const i=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(r=>r.sizeToContent));return!t&&i&&!this.resizeObserver?(this._sizeThrottle=te.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(t||!i)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(t=".grid-stack-item"){return te.getElement(t)}static getElements(t=".grid-stack-item"){return te.getElements(t)}static getGridElement(t){return Me.getElement(t)}static getGridElements(t){return te.getElements(t)}_initMargin(){let t,i=0,r=[];typeof this.opts.margin=="string"&&(r=this.opts.margin.split(" ")),r.length===2?(this.opts.marginTop=this.opts.marginBottom=r[0],this.opts.marginLeft=this.opts.marginRight=r[1]):r.length===4?(this.opts.marginTop=r[0],this.opts.marginRight=r[1],this.opts.marginBottom=r[2],this.opts.marginLeft=r[3]):(t=te.parseHeight(this.opts.margin),this.opts.marginUnit=t.unit,i=this.opts.margin=t.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(c=>{this.opts[c]===void 0?this.opts[c]=i:(t=te.parseHeight(this.opts[c]),this.opts[c]=t.h,delete this.opts.margin)}),this.opts.marginUnit=t.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop);const l=this.el.style;return l.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),l.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),l.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),l.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return ni}static setupDragIn(t,i,r,s=document){(i==null?void 0:i.pause)!==void 0&&(ke.pauseDrag=i.pause),i={appendTo:"body",helper:"clone",...i||{}},(typeof t=="string"?te.getElements(t,s):t).forEach((c,f)=>{ni.isDraggable(c)||ni.dragIn(c,i),r!=null&&r[f]&&(c.gridstackNode=r[f])})}movable(t,i){return this.opts.staticGrid?this:(Me.getElements(t).forEach(r=>{const s=r.gridstackNode;s&&(i?delete s.noMove:s.noMove=!0,this.prepareDragDrop(s.el))}),this)}resizable(t,i){return this.opts.staticGrid?this:(Me.getElements(t).forEach(r=>{const s=r.gridstackNode;s&&(i?delete s.noResize:s.noResize=!0,this.prepareDragDrop(s.el))}),this)}disable(t=!0){if(!this.opts.staticGrid)return this.enableMove(!1,t),this.enableResize(!1,t),this._triggerEvent("disable"),this}enable(t=!0){if(!this.opts.staticGrid)return this.enableMove(!0,t),this.enableResize(!0,t),this._triggerEvent("enable"),this}enableMove(t,i=!0){return this.opts.staticGrid?this:(t?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(r=>{this.prepareDragDrop(r.el),r.subGrid&&i&&r.subGrid.enableMove(t,i)}),this)}enableResize(t,i=!0){return this.opts.staticGrid?this:(t?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(r=>{this.prepareDragDrop(r.el),r.subGrid&&i&&r.subGrid.enableResize(t,i)}),this)}cancelDrag(){var i;const t=(i=this._placeholder)==null?void 0:i.gridstackNode;t&&(t._isExternal?(t._isAboutToRemove=!0,this.engine.removeNode(t)):t._isAboutToRemove&&Me._itemRemoving(t.el,!1),this.engine.restoreInitial())}_removeDD(t){return ni.draggable(t,"destroy").resizable(t,"destroy"),t.gridstackNode&&delete t.gridstackNode._initDD,delete t.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return ni.droppable(this.el,"destroy"),this;let t,i;const r=(s,l,c)=>{var y;c=c||l;const f=c.gridstackNode;if(!f)return;if(!((y=f.grid)!=null&&y.el)){c.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const x=c.getBoundingClientRect();c.style.left=x.x+(this.dragTransform.xScale-1)*(s.clientX-x.x)/this.dragTransform.xScale+"px",c.style.top=x.y+(this.dragTransform.yScale-1)*(s.clientY-x.y)/this.dragTransform.yScale+"px",c.style.transformOrigin="0px 0px"}let{top:h,left:d}=c.getBoundingClientRect();const g=this.el.getBoundingClientRect();d-=g.left,h-=g.top;const v={position:{top:h*this.dragTransform.xScale,left:d*this.dragTransform.yScale}};if(f._temporaryRemoved){if(f.x=Math.max(0,Math.round(d/i)),f.y=Math.max(0,Math.round(h/t)),delete f.autoPosition,this.engine.nodeBoundFix(f),!this.engine.willItFit(f)){if(f.autoPosition=!0,!this.engine.willItFit(f)){ni.off(l,"drag");return}f._willFitPos&&(te.copyPos(f,f._willFitPos),delete f._willFitPos)}this._onStartMoving(c,s,v,f,i,t)}else this._dragOrResize(c,s,v,f,i,t)};return ni.droppable(this.el,{accept:s=>{const l=s.gridstackNode||this._readAttr(s,!1);if((l==null?void 0:l.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let c=!0;if(typeof this.opts.acceptWidgets=="function")c=this.opts.acceptWidgets(s);else{const f=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;c=s.matches(f)}if(c&&l&&this.opts.maxRow){const f={w:l.w,h:l.h,minW:l.minW,minH:l.minH};c=this.engine.willItFit(f)}return c}}).on(this.el,"dropover",(s,l,c)=>{let f=(c==null?void 0:c.gridstackNode)||l.gridstackNode;if((f==null?void 0:f.grid)===this&&!f._temporaryRemoved)return!1;if(f!=null&&f._sidebarOrig&&(f.w=f._sidebarOrig.w,f.h=f._sidebarOrig.h),f!=null&&f.grid&&f.grid!==this&&!f._temporaryRemoved&&f.grid._leave(l,c),c=c||l,i=this.cellWidth(),t=this.getCellHeight(!0),!f){const g=c.getAttribute("data-gs-widget")||c.getAttribute("gridstacknode");if(g){try{f=JSON.parse(g)}catch{console.error("Gridstack dropover: Bad JSON format: ",g)}c.removeAttribute("data-gs-widget"),c.removeAttribute("gridstacknode")}f||(f=this._readAttr(c)),f._sidebarOrig={w:f.w,h:f.h}}f.grid||(f.el||(f={...f}),f._isExternal=!0,c.gridstackNode=f);const h=f.w||Math.round(c.offsetWidth/i)||1,d=f.h||Math.round(c.offsetHeight/t)||1;return f.grid&&f.grid!==this?(l._gridstackNodeOrig||(l._gridstackNodeOrig=f),l.gridstackNode=f={...f,w:h,h:d,grid:this},delete f.x,delete f.y,this.engine.cleanupNode(f).nodeBoundFix(f),f._initDD=f._isExternal=f._temporaryRemoved=!0):(f.w=h,f.h=d,f._temporaryRemoved=!0),Me._itemRemoving(f.el,!1),ni.on(l,"drag",r),r(s,l,c),!1}).on(this.el,"dropout",(s,l,c)=>{const f=(c==null?void 0:c.gridstackNode)||l.gridstackNode;return f&&(!f.grid||f.grid===this)&&(this._leave(l,c),this._isTemp&&this.removeAsSubGrid(f)),!1}).on(this.el,"drop",(s,l,c)=>{var y,x,S;const f=(c==null?void 0:c.gridstackNode)||l.gridstackNode;if((f==null?void 0:f.grid)===this&&!f._isExternal)return!1;const h=!!this.placeholder.parentElement,d=l!==c;this.placeholder.remove(),delete this.placeholder.gridstackNode,h&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const g=l._gridstackNodeOrig;if(delete l._gridstackNodeOrig,h&&(g!=null&&g.grid)&&g.grid!==this){const _=g.grid;_.engine.removeNodeFromLayoutCache(g),_.engine.removedNodes.push(g),_._triggerRemoveEvent()._triggerChangeEvent(),_.parentGridNode&&!_.engine.nodes.length&&_.opts.subGridDynamic&&_.removeAsSubGrid()}if(!f||(h&&(this.engine.cleanupNode(f),f.grid=this),(y=f.grid)==null||delete y._isTemp,ni.off(l,"drag"),c!==l?(c.remove(),l=c):l.remove(),this._removeDD(l),!h))return!1;const v=(S=(x=f.subGrid)==null?void 0:x.el)==null?void 0:S.gridstack;return te.copyPos(f,this._readAttr(this.placeholder)),te.removePositioningStyles(l),d&&(f.content||f.subGridOpts||Me.addRemoveCB)?(delete f.el,l=this.addWidget(f)):(this._prepareElement(l,!0,f),this.el.appendChild(l),this.resizeToContentCheck(!1,f),v&&(v.parentGridNode=f),this._updateContainerHeight()),this.engine.addedNodes.push(f),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...s,type:"dropped"},g&&g.grid?g:void 0,f),!1}),this}static _itemRemoving(t,i){if(!t)return;const r=t?t.gridstackNode:void 0;!(r!=null&&r.grid)||t.classList.contains(r.grid.opts.removableOptions.decline)||(i?r._isAboutToRemove=!0:delete r._isAboutToRemove,i?t.classList.add("grid-stack-item-removing"):t.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;const t=document.querySelector(this.opts.removable);return t?(!this.opts.staticGrid&&!ni.isDroppable(t)&&ni.droppable(t,this.opts.removableOptions).on(t,"dropover",(i,r)=>Me._itemRemoving(r,!0)).on(t,"dropout",(i,r)=>Me._itemRemoving(r,!1)),this):this}prepareDragDrop(t,i=!1){const r=t==null?void 0:t.gridstackNode;if(!r)return;const s=r.noMove||this.opts.disableDrag,l=r.noResize||this.opts.disableResize,c=this.opts.staticGrid||s&&l;if((i||c)&&(r._initDD&&(this._removeDD(t),delete r._initDD),c))return t.classList.add("ui-draggable-disabled","ui-resizable-disabled"),this;if(!r._initDD){let f,h;const d=(y,x)=>{this.triggerEvent(y,y.target),f=this.cellWidth(),h=this.getCellHeight(!0),this._onStartMoving(t,y,x,r,f,h)},g=(y,x)=>{this._dragOrResize(t,y,x,r,f,h)},v=y=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete r._moving,delete r._resizing,delete r._event,delete r._lastTried;const x=r.w!==r._orig.w,S=y.target;if(!(!S.gridstackNode||S.gridstackNode.grid!==this)){if(r.el=S,r._isAboutToRemove){const _=t.gridstackNode.grid;_._gsEventHandler[y.type]&&_._gsEventHandler[y.type](y,S),_.engine.nodes.push(r),_.removeWidget(t,!0,!0)}else te.removePositioningStyles(S),r._temporaryRemoved?(this._writePosAttr(S,r),this.engine.addNode(r)):this._writePosAttr(S,r),this.triggerEvent(y,S);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),y.type==="resizestop"&&(Number.isInteger(r.sizeToContent)&&(r.sizeToContent=r.h),this.resizeToContentCheck(x,r))}};ni.draggable(t,{start:d,stop:v,drag:g,rtl:this.opts.rtl}).resizable(t,{start:d,stop:v,resize:g,rtl:this.opts.rtl}),r._initDD=!0}return ni.draggable(t,s?"disable":"enable").resizable(t,l?"disable":"enable"),this}_onStartMoving(t,i,r,s,l,c){var f;if(this.engine.cleanNodes().beginUpdate(s),this._writePosAttr(this.placeholder,s),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=s,(f=s.grid)!=null&&f.el)this.dragTransform=te.getValuesFromTransformedElement(t);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const h=this.placeholder.closest(".grid-stack");this.dragTransform=te.getValuesFromTransformedElement(h)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(s.el=this.placeholder,s._lastUiPosition=r.position,s._prevYPix=r.position.top,s._moving=i.type==="dragstart",s._resizing=i.type==="resizestart",delete s._lastTried,i.type==="dropover"&&s._temporaryRemoved&&(this.engine.addNode(s),s._moving=!0),this.engine.cacheRects(l,c,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),i.type==="resizestart"){const h=this.getColumn()-s.x,d=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-s.y;ni.resizable(t,"option","minWidth",l*Math.min(s.minW||1,h)).resizable(t,"option","minHeight",c*Math.min(s.minH||1,d)).resizable(t,"option","maxWidth",l*Math.min(s.maxW||Number.MAX_SAFE_INTEGER,h)).resizable(t,"option","maxWidthMoveLeft",l*Math.min(s.maxW||Number.MAX_SAFE_INTEGER,s.x+s.w)).resizable(t,"option","maxHeight",c*Math.min(s.maxH||Number.MAX_SAFE_INTEGER,d)).resizable(t,"option","maxHeightMoveUp",c*Math.min(s.maxH||Number.MAX_SAFE_INTEGER,s.y+s.h))}}_dragOrResize(t,i,r,s,l,c){var T;const f={...s._orig};let h,d=this.opts.marginLeft,g=this.opts.marginRight,v=this.opts.marginTop,y=this.opts.marginBottom;const x=Math.round(c*.1),S=Math.round(l*.1);if(d=Math.min(d,S),g=Math.min(g,S),v=Math.min(v,x),y=Math.min(y,x),i.type==="drag"){if(s._temporaryRemoved)return;s._prevYPix=r.position.top,this.opts.draggable.scroll!==!1&&((T=ke.dragElement)==null||T.updateScrollPosition(this.el));const E=r.position.left+(r.position.left>s._lastUiPosition.left?-g:d),C=r.position.top+(r.position.top>s._lastUiPosition.top?-y:v);f.x=Math.round(E/l),f.y=Math.round(C/c);const k=this._extraDragRow;if(this.engine.collide(s,f)){const B=this.getRow();let P=Math.max(0,f.y+s.h-B);this.opts.maxRow&&B+P>this.opts.maxRow&&(P=Math.max(0,this.opts.maxRow-B)),this._extraDragRow=P}else this._extraDragRow=0;if(this._extraDragRow!==k&&this._updateContainerHeight(),s.x===f.x&&s.y===f.y)return}else if(i.type==="resize"){if(f.x<0||(te.updateScrollResize(i,t,c),f.w=Math.round((r.size.width-d)/l),f.h=Math.round((r.size.height-v)/c),s.w===f.w&&s.h===f.h)||s._lastTried&&s._lastTried.w===f.w&&s._lastTried.h===f.h)return;if(i.hasMovedX){const E=r.position.left+d;f.x=Math.round(E/l)}if(i.hasMovedY){const E=r.position.top+v;f.y=Math.round(E/c)}h=!0}s._event=i,s._lastTried=f;const _={x:r.position.left+d,y:r.position.top+v,w:(r.size?r.size.width:s.w*l)-d-g,h:(r.size?r.size.height:s.h*c)-v-y};if(this.engine.moveNodeCheck(s,{...f,cellWidth:l,cellHeight:c,rect:_,resizing:h})){s._lastUiPosition=r.position,this.engine.cacheRects(l,c,v,g,y,d),delete s._skipDown,h&&s.subGrid&&s.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const E=i.target;s._sidebarOrig||this._writePosAttr(E,s),this.triggerEvent(i,E)}}triggerEvent(t,i){let r=this;for(;r.parentGridNode;)r=r.parentGridNode.grid;r._gsEventHandler[t.type]&&r._gsEventHandler[t.type](t,i)}_leave(t,i){i=i||t;const r=i.gridstackNode;if(!r||(i.style.transform=i.style.transformOrigin=null,ni.off(t,"drag"),r._temporaryRemoved))return;r._temporaryRemoved=!0,this.engine.removeNode(r),r.el=r._isExternal&&i?i:t;const s=r._sidebarOrig;r._isExternal&&this.engine.cleanupNode(r),r._sidebarOrig=s,this.opts.removable===!0&&Me._itemRemoving(t,!0),t._gridstackNodeOrig?(t.gridstackNode=t._gridstackNodeOrig,delete t._gridstackNodeOrig):r._isExternal&&this.engine.restoreInitial()}}Me.renderCB=(e,t)=>{e&&(t!=null&&t.content)&&(e.textContent=t.content)};Me.resizeToContentParent=".grid-stack-item-content";Me.Utils=te;Me.Engine=Pr;Me.GDRev="12.6.0";/**
426
+ * @license lucide-react v1.21.0 - ISC
427
+ *
428
+ * This source code is licensed under the ISC license.
429
+ * See the LICENSE file in the root directory of this source tree.
430
+ */const N2=(...e)=>e.filter((t,i,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===i).join(" ").trim();/**
431
+ * @license lucide-react v1.21.0 - ISC
432
+ *
433
+ * This source code is licensed under the ISC license.
434
+ * See the LICENSE file in the root directory of this source tree.
435
+ */const tM=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
436
+ * @license lucide-react v1.21.0 - ISC
437
+ *
438
+ * This source code is licensed under the ISC license.
439
+ * See the LICENSE file in the root directory of this source tree.
440
+ */const nM=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,i,r)=>r?r.toUpperCase():i.toLowerCase());/**
441
+ * @license lucide-react v1.21.0 - ISC
442
+ *
443
+ * This source code is licensed under the ISC license.
444
+ * See the LICENSE file in the root directory of this source tree.
445
+ */const z1=e=>{const t=nM(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
446
+ * @license lucide-react v1.21.0 - ISC
447
+ *
448
+ * This source code is licensed under the ISC license.
449
+ * See the LICENSE file in the root directory of this source tree.
450
+ */var uh={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
451
+ * @license lucide-react v1.21.0 - ISC
452
+ *
453
+ * This source code is licensed under the ISC license.
454
+ * See the LICENSE file in the root directory of this source tree.
455
+ */const iM=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},rM=M.createContext({}),aM=()=>M.useContext(rM),sM=M.forwardRef(({color:e,size:t,strokeWidth:i,absoluteStrokeWidth:r,className:s="",children:l,iconNode:c,...f},h)=>{const{size:d=24,strokeWidth:g=2,absoluteStrokeWidth:v=!1,color:y="currentColor",className:x=""}=aM()??{},S=r??v?Number(i??g)*24/Number(t??d):i??g;return M.createElement("svg",{ref:h,...uh,width:t??d??uh.width,height:t??d??uh.height,stroke:e??y,strokeWidth:S,className:N2("lucide",x,s),...!l&&!iM(f)&&{"aria-hidden":"true"},...f},[...c.map(([_,T])=>M.createElement(_,T)),...Array.isArray(l)?l:[l]])});/**
456
+ * @license lucide-react v1.21.0 - ISC
457
+ *
458
+ * This source code is licensed under the ISC license.
459
+ * See the LICENSE file in the root directory of this source tree.
460
+ */const go=(e,t)=>{const i=M.forwardRef(({className:r,...s},l)=>M.createElement(sM,{ref:l,iconNode:t,className:N2(`lucide-${tM(z1(e))}`,`lucide-${e}`,r),...s}));return i.displayName=z1(e),i};/**
461
+ * @license lucide-react v1.21.0 - ISC
462
+ *
463
+ * This source code is licensed under the ISC license.
464
+ * See the LICENSE file in the root directory of this source tree.
465
+ */const oM=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],lM=go("check",oM);/**
466
+ * @license lucide-react v1.21.0 - ISC
467
+ *
468
+ * This source code is licensed under the ISC license.
469
+ * See the LICENSE file in the root directory of this source tree.
470
+ */const cM=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],uM=go("chevron-down",cM);/**
471
+ * @license lucide-react v1.21.0 - ISC
472
+ *
473
+ * This source code is licensed under the ISC license.
474
+ * See the LICENSE file in the root directory of this source tree.
475
+ */const fM=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],dM=go("plus",fM);/**
476
+ * @license lucide-react v1.21.0 - ISC
477
+ *
478
+ * This source code is licensed under the ISC license.
479
+ * See the LICENSE file in the root directory of this source tree.
480
+ */const hM=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],mM=go("search",hM);/**
481
+ * @license lucide-react v1.21.0 - ISC
482
+ *
483
+ * This source code is licensed under the ISC license.
484
+ * See the LICENSE file in the root directory of this source tree.
485
+ */const gM=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],pM=go("sliders-horizontal",gM);/**
486
+ * @license lucide-react v1.21.0 - ISC
487
+ *
488
+ * This source code is licensed under the ISC license.
489
+ * See the LICENSE file in the root directory of this source tree.
490
+ */const vM=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Xu=go("x",vM);var M1=zb();const R2=["xyz:TSLA","xyz:NVDA","xyz:AAPL","xyz:MSFT","xyz:GOOGL","xyz:AMD","xyz:META","xyz:AMZN","xyz:NFLX","xyz:AVGO","xyz:MSTR","xyz:COIN","xyz:HOOD","xyz:PLTR","BTC","ETH","SOL","HYPE","BNB","XRP","DOGE","LINK","AVAX","SUI"],k2=new Map(R2.map((e,t)=>[e,t]));function Rl(e){const t=e.indexOf(":");return(t===-1?e:e.slice(t+1)).toUpperCase()}function km(e){return e.includes(":")?"Stock":"Crypto"}function yM(e){const t=e.indexOf(":");if(t!==-1){const i=e.slice(t+1);return`https://assets.parqet.com/logos/symbol/${encodeURIComponent(i)}?format=png`}return`https://assets.coincap.io/assets/icons/${e.toLowerCase()}@2x.png`}function bM(e){const t=e.trim().replace(/\s+/g,"");if(!t)return"";const i=t.indexOf(":");return i===-1?t.toUpperCase():`${t.slice(0,i).toLowerCase()}:${t.slice(i+1).toUpperCase()}`}function $h(e,t,i=k2.get(e)??1e4){return{symbol:e,ticker:Rl(e),kind:km(e),markPx:t==null?void 0:t.markPx,changePct:t==null?void 0:t.changePct,rank:i}}function D2(e){if(!Number.isFinite(e))return"";const t=e;return t>=1e3?`$${t.toLocaleString(void 0,{maximumFractionDigits:0})}`:t>=100?`$${t.toFixed(2)}`:t>=1?`$${t.toFixed(3)}`:`$${t.toPrecision(3)}`}function xM(e){if(!Number.isFinite(e))return"";const t=e;return`${t>=0?"+":""}${t.toFixed(2)}%`}function O2(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function ri(e,t){return e!=null&&e.type?Array.isArray(e.type)?e.type.includes(t):e.type===t:!1}function j2(e){const t=e==null?void 0:e.items;return!!t&&ri(e,"array")&&ri(t,"string")}function wM(e){var t,i,r;try{const l=Em(e.schema,{io:"input"}).properties??{};if(ri(l.symbol,"string"))return{kind:"single"};if(j2(l.symbols))return{kind:"symbols",minItems:(t=l.symbols)==null?void 0:t.minItems,maxItems:(i=l.symbols)==null?void 0:i.maxItems};const c=l.holdings,f=((r=c==null?void 0:c.items)==null?void 0:r.properties)??{};if(ri(c,"array")&&ri(f.symbol,"string"))return{kind:"holdings",minItems:c==null?void 0:c.minItems,maxItems:c==null?void 0:c.maxItems}}catch{}return e.name==="price-chart"?{kind:"single"}:["price-liveline","price-ticker","funding-rate-chart","funding-heatmap","price-compare"].includes(e.name)?{kind:"symbols"}:e.name==="allocation"?{kind:"holdings"}:null}function _M(e,t){return e.kind==="single"?typeof t.symbol=="string"&&t.symbol?[t.symbol]:[]:e.kind==="symbols"?Array.isArray(t.symbols)?t.symbols.filter(i=>typeof i=="string"):[]:Array.isArray(t.holdings)?t.holdings.map(i=>O2(i)&&typeof i.symbol=="string"?i.symbol:"").filter(Boolean):[]}const SM=new Set(["symbol","symbols","holdings"]);function Dm(e){const t=e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return t?t.charAt(0).toUpperCase()+t.slice(1):e}function TM(e){let t;try{t=Em(e.schema,{io:"input"})}catch{return[]}return Object.entries(t.properties??{}).filter(([i])=>!SM.has(i)).map(([i,r])=>({key:i,label:Dm(i),shape:r}))}const C1=["xyz:TSLA","xyz:NVDA","xyz:AAPL","xyz:MSFT","xyz:META","xyz:AMD","xyz:GOOGL","xyz:AMZN"];function EM(e,t){return e==="symbol"?C1[t%C1.length]:e==="url"?"https://":e==="text"?"New note":e==="title"?"Heading":Dm(e)||"value"}function Gh(e,t,i=0){var r;if(e.default!==void 0)return e.default;if(Array.isArray(e.enum)&&e.enum.length)return e.enum[0];if(ri(e,"string"))return EM(t,i);if(ri(e,"number")||ri(e,"integer"))return e.exclusiveMinimum!==void 0?e.exclusiveMinimum+1:e.minimum??0;if(ri(e,"boolean"))return!1;if(ri(e,"array")){const s=e.items??{},l=t==="symbols"?"symbol":t;return Array.from({length:e.minItems??0},(c,f)=>Gh(s,l,f))}if(ri(e,"object")){const s={};for(const l of e.required??[]){const c=(r=e.properties)==null?void 0:r[l];c&&(s[l]=Gh(c,l,i))}return s}return null}function zM(e){const t=e.schema.safeParse({});if(t.success)return t.data;let i;try{i=Em(e.schema,{io:"input"})}catch{return{}}const r={},s=new Set(i.required??[]);for(const[c,f]of Object.entries(i.properties??{}))s.has(c)&&(r[c]=Gh(f,c));const l=e.schema.safeParse(r);return l.success?l.data:r}const MM='<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>';function CM(e,t){const i=M.useMemo(()=>e.find(h=>h.capabilities.includes("day-stats")),[e]),[r,s]=M.useState({}),[l,c]=M.useState(!1);return M.useEffect(()=>{if(!t||!(i!=null&&i.getDayStats)){c(!1);return}let h=!1;return c(!0),Promise.allSettled([i.getDayStats(),i.getDayStats(["xyz:*"])]).then(d=>{if(h)return;const g={};for(const v of d)v.status==="fulfilled"&&Object.assign(g,v.value);s(g)}).finally(()=>{h||c(!1)}),()=>{h=!0}},[t,i]),{options:M.useMemo(()=>{const h=new Map;return R2.forEach((d,g)=>{h.set(d,$h(d,r[d],g))}),Object.entries(r).forEach(([d,g])=>{h.set(d,$h(d,g,k2.get(d)??1e4))}),[...h.values()].sort((d,g)=>d.rank!==g.rank?d.rank-g.rank:d.kind!==g.kind?d.kind==="Stock"?-1:1:d.ticker.localeCompare(g.ticker))},[r]),loading:l}}function AM({spec:e,registry:t,onSave:i,customiseButtonTarget:r,onAccentHueChange:s}){const l=zm(),c=M.useRef(null),f=M.useRef(null),h=M.useRef(!1),d=M.useRef(new Map),g=M.useRef(new Map),v=M.useRef(new Map),y=M.useRef([]),x=M.useRef(e.theme.accentHue),S=M.useRef(e.theme.accentSat),_=M.useRef(e.grid.gap),T=M.useRef(e.appearance.radius),E=M.useRef(e.appearance.borderStrength),C=M.useRef(e.appearance.surfaceOpacity),k=M.useRef(e.appearance.density),B=M.useRef(e.appearance.elevation),P=M.useRef(0),[N,U]=M.useState(!1),A=CM(l,N),[$,I]=M.useState(e.frames.length),[Y,O]=M.useState(e.theme.accentHue),[j,L]=M.useState(e.theme.accentSat),[K,D]=M.useState(e.grid.gap),[V,ie]=M.useState(e.appearance.radius),[ue,J]=M.useState(e.appearance.borderStrength),[R,X]=M.useState(e.appearance.surfaceOpacity),[ae,he]=M.useState(e.appearance.density),[de,ve]=M.useState(e.appearance.elevation),[be,je]=M.useState(null),se=M.useRef(null);se.current=be,M.useEffect(()=>{s==null||s(Y)},[Y,s]),M.useEffect(()=>{var ee;(ee=f.current)==null||ee.margin(K/2)},[K]);const Ee=M.useRef(l);Ee.current=l;const ze=M.useRef(t);ze.current=t;const fe=M.useMemo(()=>[...t.values()].sort((ee,ge)=>ee.name.localeCompare(ge.name)),[t]),dt=M.useCallback(ee=>ee?zM(ee):{},[]),Ue=M.useCallback(ee=>{let ge=`${ee}-${++P.current}`;for(;d.current.has(ge);)ge=`${ee}-${++P.current}`;return ge},[]),ht=M.useCallback(ee=>{const ge=v.current.get(ee),F=d.current.get(ee);if(!ge||!F)return;let pe=g.current.get(ee);pe||(ge.innerHTML="",pe=Mb.createRoot(ge),g.current.set(ee,pe)),pe.render(b.jsx(T2,{providers:Ee.current,children:b.jsx(C2,{instance:F,registry:ze.current,className:"zf-fill"})}))},[]),ut=M.useCallback(ee=>{var pe;const ge=f.current;if(!ge)return;const F=ee.getAttribute("gs-id");F&&((pe=g.current.get(F))==null||pe.unmount(),g.current.delete(F),v.current.delete(F),d.current.delete(F),se.current===F&&je(null)),ge.removeWidget(ee,!0),I(ge.getGridItems().length)},[]),qt=M.useCallback(ee=>{if(!ee.querySelector(".zf-cfg-btn")){const ge=document.createElement("button");ge.className="zf-cfg-btn",ge.type="button",ge.title="Edit frame",ge.setAttribute("aria-label","Edit frame"),ge.innerHTML=MM,ge.addEventListener("click",F=>{F.stopPropagation();const pe=ee.getAttribute("gs-id");pe&&je(pe)}),ee.appendChild(ge)}if(!ee.querySelector(".zf-del-btn")){const ge=document.createElement("button");ge.className="zf-del-btn",ge.type="button",ge.title="Remove frame",ge.innerHTML="&times;",ge.addEventListener("click",F=>{F.stopPropagation(),ut(ee)}),ee.appendChild(ge)}},[ut]),yi=M.useCallback(ee=>{var ge,F;(ge=ee.querySelector(".zf-cfg-btn"))==null||ge.remove(),(F=ee.querySelector(".zf-del-btn"))==null||F.remove()},[]),Tn=M.useCallback((ee,ge=!1)=>{const F=ze.current.get(ee.frame),pe=F==null?void 0:F.layout,me=document.createElement("div");me.className="grid-stack-item",me.setAttribute("gs-id",ee.id),me.setAttribute("data-frame",ee.frame),ge?me.setAttribute("gs-auto-position","true"):(me.setAttribute("gs-x",String(ee.position.x)),me.setAttribute("gs-y",String(ee.position.y))),me.setAttribute("gs-w",String(ee.position.w)),me.setAttribute("gs-h",String(ee.position.h)),pe!=null&&pe.minW&&me.setAttribute("gs-min-w",String(pe.minW)),pe!=null&&pe.minH&&me.setAttribute("gs-min-h",String(pe.minH)),pe!=null&&pe.maxW&&me.setAttribute("gs-max-w",String(pe.maxW)),pe!=null&&pe.maxH&&me.setAttribute("gs-max-h",String(pe.maxH));const ye=document.createElement("div");return ye.className="grid-stack-item-content",me.appendChild(ye),v.current.set(ee.id,ye),me},[]),vn=M.useCallback(ee=>{const ge=f.current;if(ge){g.current.forEach(F=>F.unmount()),g.current.clear(),v.current.clear(),d.current=new Map(ee.map(F=>[F.id,F])),ge.removeAll(!0),ge.el.querySelectorAll(".grid-stack-item").forEach(F=>F.remove()),ge.batchUpdate();for(const F of ee){const pe=Tn(F);ge.el.appendChild(pe),ge.makeWidget(pe),ht(F.id)}ge.batchUpdate(!1),I(ee.length)}},[Tn,ht]),Di=M.useCallback(ee=>{var We,yn;const ge=f.current;if(!ge)return;const F=ze.current.get(ee),pe=Ue(ee),me={id:pe,frame:ee,position:{x:0,y:0,w:((We=F==null?void 0:F.layout)==null?void 0:We.w)??4,h:((yn=F==null?void 0:F.layout)==null?void 0:yn.h)??3},config:dt(F)};d.current.set(pe,me);const ye=Tn(me,!0);ge.el.appendChild(ye),ge.makeWidget(ye),ht(pe),qt(ye),I(ge.getGridItems().length),je(pe)},[Tn,qt,dt,ht,Ue]);M.useEffect(()=>{if(!c.current||h.current)return;h.current=!0;const ee=Me.init({column:e.grid.columns,cellHeight:e.grid.rowHeight,margin:e.grid.gap/2,float:!1,animate:!0,acceptWidgets:!0,disableDrag:!0,disableResize:!0},c.current);return f.current=ee,vn(e.frames),ee.on("dropped",(ge,F,pe)=>{var Ut,xi;const me=pe==null?void 0:pe.el;if(!me)return;const ye=me.querySelector(".grid-stack-item-content"),We=me.getAttribute("data-frame");if(!ye||!We)return;const yn=me.getAttribute("gs-id")||Ue(We);me.setAttribute("gs-id",yn);const Ge=ze.current.get(We),zn={id:yn,frame:We,position:{x:(pe==null?void 0:pe.x)??0,y:(pe==null?void 0:pe.y)??0,w:(pe==null?void 0:pe.w)??((Ut=Ge==null?void 0:Ge.layout)==null?void 0:Ut.w)??4,h:(pe==null?void 0:pe.h)??((xi=Ge==null?void 0:Ge.layout)==null?void 0:xi.h)??3},config:dt(Ge)};d.current.set(yn,zn),v.current.set(yn,ye),ht(yn),qt(me),I(ee.getGridItems().length),je(yn)}),ee.on("removed",()=>I(ee.getGridItems().length)),()=>{ee.off("dropped"),ee.off("removed"),g.current.forEach(ge=>ge.unmount()),g.current.clear(),v.current.clear(),ee.destroy(!1),f.current=null,h.current=!1}},[]),M.useEffect(()=>{const ee=f.current;ee&&(ee.enableMove(N),ee.enableResize(N),N?ee.getGridItems().forEach(qt):ee.getGridItems().forEach(yi))},[N,qt,yi]),M.useEffect(()=>{!N||!f.current||Me.setupDragIn(".zf-newwidget",{appendTo:"body",helper:ee=>{const F=(ee.closest(".zf-newwidget")??ee).dataset.frame??"",pe=ze.current.get(F),me=pe==null?void 0:pe.layout,ye=document.createElement("div");return ye.className="grid-stack-item",ye.setAttribute("data-frame",F),ye.setAttribute("gs-w",String((me==null?void 0:me.w)??4)),ye.setAttribute("gs-h",String((me==null?void 0:me.h)??3)),me!=null&&me.minW&&ye.setAttribute("gs-min-w",String(me.minW)),me!=null&&me.minH&&ye.setAttribute("gs-min-h",String(me.minH)),me!=null&&me.maxW&&ye.setAttribute("gs-max-w",String(me.maxW)),me!=null&&me.maxH&&ye.setAttribute("gs-max-h",String(me.maxH)),ye.innerHTML=`<div class="grid-stack-item-content" data-frame="${F}"></div>`,ye}})},[N,fe]);const bi=M.useCallback(()=>{const ee=f.current,ge=[];if(ee)for(const F of ee.getGridItems()){const pe=F.getAttribute("gs-id");if(!pe)continue;const me=d.current.get(pe);if(!me)continue;const ye=F.gridstackNode;ge.push({...me,position:{x:(ye==null?void 0:ye.x)??me.position.x,y:(ye==null?void 0:ye.y)??me.position.y,w:(ye==null?void 0:ye.w)??me.position.w,h:(ye==null?void 0:ye.h)??me.position.h}})}return ge.sort((F,pe)=>F.position.y-pe.position.y||F.position.x-pe.position.x),{...e,grid:{...e.grid,gap:K},theme:{...e.theme,accentHue:Y,accentSat:j},appearance:{...e.appearance,radius:V,borderStrength:ue,surfaceOpacity:R,density:ae,elevation:de},frames:ge}},[e,Y,j,K,V,ue,R,ae,de]),or=M.useCallback(ee=>{const ge=new Blob([`${JSON.stringify(ee,null,2)}
491
+ `],{type:"application/json"}),F=URL.createObjectURL(ge),pe=document.createElement("a");pe.href=F,pe.download="dashboard.json",pe.click(),setTimeout(()=>URL.revokeObjectURL(F),0)},[]),Zt=M.useCallback(()=>{y.current=bi().frames,x.current=Y,S.current=j,_.current=K,T.current=V,E.current=ue,C.current=R,k.current=ae,B.current=de,U(!0)},[bi,Y,j,K,V,ue,R,ae,de]),ta=M.useCallback(()=>{vn(y.current),O(x.current),L(S.current),D(_.current),ie(T.current),J(E.current),X(C.current),he(k.current),ve(B.current),je(null),U(!1)},[vn]),En=M.useCallback(()=>{window.confirm("Remove all frames from the dashboard?")&&(vn([]),je(null))},[vn]),Kn=M.useCallback(async()=>{const ee=bi();U(!1),je(null),i?await i(ee):or(ee)},[bi,i,or]),on=()=>b.jsx("button",{type:"button",className:"zf-btn zf-btn--icon",onClick:Zt,"aria-label":"Customise",title:"Customise",children:b.jsx(pM,{size:18,"aria-hidden":"true"})}),De=N&&be?d.current.get(be):void 0;return b.jsxs(b.Fragment,{children:[b.jsx("style",{children:z2}),r&&!N?M1.createPortal(on(),r):null,b.jsxs("div",{className:N?"zf-editor zf-customise":"zf-editor",style:{"--zf-accent-hue":Y,"--zf-accent-sat":`${j}%`,"--zf-frame-radius":`${V}px`,"--zf-border-alpha":ue,"--zf-surface-opacity":R,"--zf-density":ae,"--zf-elevation":de},children:[(N||!r)&&b.jsxs("div",{className:"zf-editor-bar",children:[N&&b.jsx("span",{className:"zf-editor-hint",children:"drag to move · drag a corner to resize · hover to delete"}),b.jsx("div",{className:"zf-editor-bar-spacer"}),N?b.jsxs(b.Fragment,{children:[b.jsx("button",{type:"button",className:"zf-btn zf-btn--danger",onClick:En,children:"Clear"}),b.jsx("button",{type:"button",className:"zf-btn zf-btn--ghost",onClick:ta,children:"Cancel"}),b.jsx("button",{type:"button",className:"zf-btn zf-btn--primary",onClick:Kn,children:"Save"})]}):on()]}),b.jsxs("div",{className:"zf-editor-main",children:[b.jsx("div",{className:"zf-editor-grid",children:b.jsx("div",{ref:c,className:"grid-stack"})}),b.jsx("aside",{className:"zf-rail","aria-hidden":!N,inert:!N,children:b.jsxs("div",{className:"zf-rail-inner",children:[b.jsxs("section",{className:"zf-theme",children:[b.jsx("h3",{className:"zf-rail-title",style:{margin:0},children:"Accent"}),b.jsxs("div",{className:"zf-theme-row",style:{margin:"10px 0 0"},children:[b.jsxs("span",{className:"zf-theme-val",children:[b.jsx("span",{className:"zf-theme-swatch"}),"Hue ",Y,"°"]}),Y!==242&&b.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>O(242),children:"Reset"})]}),b.jsx("input",{type:"range",className:"zf-hue-slider",min:0,max:360,value:Y,"aria-label":"Accent hue",onChange:ee=>O(Number(ee.target.value))}),b.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[b.jsx("span",{className:"zf-theme-val",children:"Saturation"}),b.jsxs("span",{className:"zf-theme-knob-end",children:[j!==90&&b.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>L(90),children:"Reset"}),b.jsxs("span",{className:"zf-theme-val",children:[j,"%"]})]})]}),b.jsx("input",{type:"range",className:"zf-range",min:0,max:100,value:j,"aria-label":"Accent saturation",onChange:ee=>L(Number(ee.target.value))})]}),b.jsxs("section",{className:"zf-theme",children:[b.jsx("h3",{className:"zf-rail-title",children:"Layout"}),b.jsxs("div",{className:"zf-theme-row",children:[b.jsx("span",{className:"zf-theme-val",children:"Frame gap"}),b.jsxs("span",{className:"zf-theme-knob-end",children:[K!==12&&b.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>D(12),children:"Reset"}),b.jsxs("span",{className:"zf-theme-val",children:[K,"px"]})]})]}),b.jsx("input",{type:"range",className:"zf-range",min:0,max:12,value:K,"aria-label":"Frame gap",onChange:ee=>D(Number(ee.target.value))})]}),b.jsxs("section",{className:"zf-theme",children:[b.jsx("h3",{className:"zf-rail-title",children:"Appearance"}),b.jsxs("div",{className:"zf-theme-row",children:[b.jsx("span",{className:"zf-theme-val",children:"Corner radius"}),b.jsxs("span",{className:"zf-theme-knob-end",children:[V!==18&&b.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>ie(18),children:"Reset"}),b.jsxs("span",{className:"zf-theme-val",children:[V,"px"]})]})]}),b.jsx("input",{type:"range",className:"zf-range",min:0,max:32,value:V,"aria-label":"Corner radius",onChange:ee=>ie(Number(ee.target.value))}),b.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[b.jsx("span",{className:"zf-theme-val",children:"Border"}),b.jsxs("span",{className:"zf-theme-knob-end",children:[ue!==.22&&b.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>J(.22),children:"Reset"}),b.jsxs("span",{className:"zf-theme-val",children:[Math.round(ue*100),"%"]})]})]}),b.jsx("input",{type:"range",className:"zf-range",min:0,max:1,step:.01,value:ue,"aria-label":"Border strength",onChange:ee=>J(Math.round(Number(ee.target.value)*100)/100)}),b.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[b.jsx("span",{className:"zf-theme-val",children:"Card opacity"}),b.jsxs("span",{className:"zf-theme-knob-end",children:[R!==1&&b.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>X(1),children:"Reset"}),b.jsxs("span",{className:"zf-theme-val",children:[Math.round(R*100),"%"]})]})]}),b.jsx("input",{type:"range",className:"zf-range",min:.3,max:1,step:.05,value:R,"aria-label":"Card opacity",onChange:ee=>X(Math.round(Number(ee.target.value)*100)/100)}),b.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[b.jsx("span",{className:"zf-theme-val",children:"Density"}),b.jsxs("span",{className:"zf-theme-knob-end",children:[ae!==1&&b.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>he(1),children:"Reset"}),b.jsxs("span",{className:"zf-theme-val",children:[Math.round(ae*100),"%"]})]})]}),b.jsx("input",{type:"range",className:"zf-range",min:.6,max:1.4,step:.05,value:ae,"aria-label":"Card density",onChange:ee=>he(Math.round(Number(ee.target.value)*100)/100)}),b.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[b.jsx("span",{className:"zf-theme-val",children:"Elevation"}),b.jsxs("span",{className:"zf-theme-knob-end",children:[de!==1&&b.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>ve(1),children:"Reset"}),b.jsxs("span",{className:"zf-theme-val",children:[de.toFixed(1),"×"]})]})]}),b.jsx("input",{type:"range",className:"zf-range",min:0,max:2,step:.1,value:de,"aria-label":"Card elevation",onChange:ee=>ve(Math.round(Number(ee.target.value)*10)/10)})]}),b.jsxs("section",{children:[b.jsx("h3",{className:"zf-rail-title",children:"Add a frame"}),b.jsx("p",{className:"zf-palette-hint",children:"Click to add, or drag onto the grid."}),b.jsx("div",{className:"zf-palette",children:fe.map(ee=>b.jsxs("div",{className:"zf-newwidget","data-frame":ee.name,role:"button",tabIndex:0,title:`Add ${ee.name.replace(/-/g," ")}`,onClick:()=>Di(ee.name),onKeyDown:ge=>{(ge.key==="Enter"||ge.key===" ")&&(ge.preventDefault(),Di(ee.name))},children:[ee.iconUrl&&b.jsx("img",{className:"zf-newwidget-icon",src:ee.iconUrl,alt:"",loading:"lazy",draggable:!1}),b.jsxs("div",{className:"zf-newwidget-copy",children:[b.jsx("div",{className:"zf-newwidget-name",children:ee.name.replace(/-/g," ")}),b.jsx("div",{className:"zf-newwidget-desc",children:ee.description})]})]},ee.name))})]})]})})]})]}),De?M1.createPortal(b.jsx(NM,{instance:De,registry:t,instancesRef:d,symbolUniverse:A,accentHue:Y,onApply:ee=>ht(ee),onClose:()=>je(null)},De.id),document.body):null]})}function NM({instance:e,registry:t,instancesRef:i,symbolUniverse:r,accentHue:s,onApply:l,onClose:c}){const f=t.get(e.frame),h=M.useMemo(()=>f?wM(f):null,[f]),d=M.useMemo(()=>f?TM(f):[],[f]),[g,v]=M.useState(()=>({...e.config??{}})),[y,x]=M.useState(null),S=e.id,_=M.useCallback(C=>{if(v(C),f){const B=f.schema.safeParse(C);if(!B.success){x(B.error.issues.map(P=>`${P.path.join(".")||"(root)"}: ${P.message}`).join(`
492
+ `));return}}x(null);const k=i.current.get(S);k&&(i.current.set(S,{...k,config:C}),l(S))},[f,S,i,l]);M.useEffect(()=>{const C=k=>{k.key==="Escape"&&c()};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[c]);const T=(C,k)=>_({...g,[C]:k}),E=e.frame.replace(/-/g," ");return b.jsx("div",{className:"zf-dialog-backdrop",style:{"--zf-accent-hue":s},onMouseDown:C=>{C.target===C.currentTarget&&c()},children:b.jsxs("div",{className:"zf-dialog",role:"dialog","aria-modal":"true","aria-label":`Configure ${E}`,children:[b.jsxs("header",{className:"zf-dialog-head",children:[b.jsxs("h3",{className:"zf-dialog-title",children:["Configure · ",E]}),b.jsx("button",{type:"button",className:"zf-dialog-close",onClick:c,"aria-label":"Close",title:"Close",children:b.jsx(Xu,{size:16,"aria-hidden":"true"})})]}),b.jsxs("div",{className:"zf-dialog-body",children:[h&&b.jsx(jM,{control:h,config:g,loading:r.loading,options:r.options,onChangeSymbol:C=>_({...g,symbol:C}),onChangeSymbols:C=>_({...g,symbols:C}),onChangeHoldings:C=>_({...g,holdings:C})}),d.map(C=>b.jsx(RM,{field:C,value:g[C.key],onChange:k=>T(C.key,k)},C.key)),!h&&d.length===0&&b.jsx("p",{className:"zf-rail-empty",children:"This frame has no settings."}),y&&b.jsx("div",{className:"zf-config-error",children:y})]}),b.jsx("footer",{className:"zf-dialog-foot",children:b.jsx("button",{type:"button",className:"zf-btn zf-btn--primary",onClick:c,children:"Done"})})]})})}function RM({field:e,value:t,onChange:i}){const{key:r,label:s,shape:l}=e,c=`zf-cfg-${r}`,f=l.description;if(ri(l,"boolean")){const d=typeof t=="boolean"?t:!!l.default;return b.jsxs("label",{className:"zf-checkbox",title:f,children:[b.jsx("input",{type:"checkbox",checked:d,onChange:g=>i(g.target.checked)}),s]})}const h=Array.isArray(l.enum)&&l.enum.every(d=>typeof d=="string")?l.enum:null;if(h&&h.length>0){const d=typeof l.default=="string"?l.default:h[0],g=typeof t=="string"&&h.includes(t)?t:d;return b.jsxs("div",{className:"zf-field",children:[b.jsx("label",{htmlFor:c,title:f,children:s}),b.jsx("select",{id:c,className:"zf-select",value:g,onChange:v=>i(v.target.value),children:h.map(v=>b.jsx("option",{value:v,children:Dm(v)},v))})]})}return ri(l,"integer")||ri(l,"number")?b.jsx(kM,{id:c,field:e,value:t,onChange:i}):j2(l)?b.jsx(OM,{id:c,field:e,value:t,onChange:i}):b.jsx(DM,{id:c,field:e,value:t,onChange:i})}function kM({id:e,field:t,value:i,onChange:r}){const{label:s,shape:l}=t,c=l.description,f=typeof l.minimum=="number"?l.minimum:void 0,h=typeof l.maximum=="number"?l.maximum:void 0,d=ri(l,"integer"),g=d?1:"any",v=typeof l.default=="number"?l.default:f??0,y=typeof i=="number"&&Number.isFinite(i)?i:void 0;if(f!==void 0&&h!==void 0){const x=y??v;return b.jsxs("div",{className:"zf-field",children:[b.jsxs("div",{className:"zf-field-row",children:[b.jsx("label",{htmlFor:e,title:c,children:s}),b.jsx("span",{className:"zf-field-num",children:x})]}),b.jsx("input",{id:e,type:"range",className:"zf-range",min:f,max:h,step:g,value:x,onChange:S=>r(d?Math.round(Number(S.target.value)):Number(S.target.value))})]})}return b.jsxs("div",{className:"zf-field",children:[b.jsx("label",{htmlFor:e,title:c,children:s}),b.jsx("input",{id:e,type:"number",className:"zf-input",min:f,max:h,step:g,value:i==null?"":String(i),onChange:x=>r(x.target.value===""?"":Number(x.target.value))})]})}function DM({id:e,field:t,value:i,onChange:r}){const{key:s,label:l,shape:c}=t,f=c.description,h=typeof i=="string"?i:"",d=typeof c.default=="string"?c.default:"",g=typeof c.default=="string"&&/^#[0-9a-f]{6}$/i.test(c.default)?c.default:null;if(s==="color"||g){const v=/^#[0-9a-f]{6}$/i.test(h)?h:g??"#8b8df9";return b.jsxs("div",{className:"zf-field",children:[b.jsx("label",{htmlFor:e,title:f,children:l}),b.jsxs("div",{className:"zf-color-row",children:[b.jsx("input",{type:"color",className:"zf-color",value:v,"aria-label":`${l} swatch`,onChange:y=>r(y.target.value)}),b.jsx("input",{id:e,className:"zf-input",value:h,placeholder:d,spellCheck:!1,onChange:y=>r(y.target.value)})]})]})}return s==="text"?b.jsxs("div",{className:"zf-field",children:[b.jsx("label",{htmlFor:e,title:f,children:l}),b.jsx("textarea",{id:e,className:"zf-textarea zf-textarea--prose",value:h,placeholder:d,onChange:v=>r(v.target.value)})]}):b.jsxs("div",{className:"zf-field",children:[b.jsx("label",{htmlFor:e,title:f,children:l}),b.jsx("input",{id:e,className:"zf-input",value:h,placeholder:d,spellCheck:!1,onChange:v=>r(v.target.value)})]})}function OM({id:e,field:t,value:i,onChange:r}){const{label:s,shape:l}=t,c=l.description,f=Array.isArray(i)?i.filter(x=>typeof x=="string"):[],[h,d]=M.useState(""),g=typeof l.maxItems=="number"?l.maxItems:void 0,v=g!==void 0&&f.length>=g,y=x=>{const S=x.trim().toUpperCase();d(""),!(!S||f.includes(S)||v)&&r([...f,S])};return b.jsxs("div",{className:"zf-field",children:[b.jsx("label",{htmlFor:e,title:c,children:s}),f.length>0&&b.jsx("div",{className:"zf-taglist",children:f.map(x=>b.jsxs("span",{className:"zf-tag",children:[x,b.jsx("button",{type:"button",className:"zf-symbol-remove","aria-label":`Remove ${x}`,onClick:()=>r(f.filter(S=>S!==x)),children:b.jsx(Xu,{size:12,"aria-hidden":"true"})})]},x))}),b.jsx("input",{id:e,className:"zf-input",value:h,disabled:v,spellCheck:!1,placeholder:v?"Maximum reached":"Type a code, Enter to add",onChange:x=>d(x.target.value),onBlur:()=>y(h),onKeyDown:x=>{x.key==="Enter"||x.key===","?(x.preventDefault(),y(h)):x.key==="Backspace"&&h===""&&f.length>0&&r(f.slice(0,-1))}})]})}function jM({control:e,config:t,loading:i,options:r,onChangeSymbol:s,onChangeSymbols:l,onChangeHoldings:c}){const f=_M(e,t);if(e.kind==="single"){const g=f[0]??"";return b.jsxs("div",{className:"zf-symbol-editor",children:[b.jsx(fh,{title:"Ticker",detail:g?Rl(g):"None",loading:i}),g?b.jsx(Fh,{symbol:g,option:Yh(g,r)}):null,b.jsx(dh,{loading:i,options:r,selectedSymbols:g?[g]:[],placeholder:"Search TSLA, BTC...",onSelect:s})]})}if(e.kind==="symbols"){const g=typeof e.maxItems=="number"&&f.length>=e.maxItems;return b.jsxs("div",{className:"zf-symbol-editor",children:[b.jsx(fh,{title:"Tickers",detail:A1(f.length,e),loading:i}),b.jsx(LM,{symbols:f,options:r,onRemove:v=>l(f.filter(y=>y!==v))}),b.jsx(dh,{disabled:g,loading:i,options:r,selectedSymbols:f,placeholder:g?"Maximum tickers added":"Add ticker",keepOpenOnSelect:!0,onSelect:v=>{f.includes(v)||g||l([...f,v])}})]})}const h=Array.isArray(t.holdings)?t.holdings.filter(O2):[],d=typeof e.maxItems=="number"&&h.length>=e.maxItems;return b.jsxs("div",{className:"zf-symbol-editor",children:[b.jsx(fh,{title:"Holding tickers",detail:A1(h.length,e),loading:i}),b.jsx("div",{className:"zf-holding-list",children:h.map((g,v)=>{const y=typeof g.symbol=="string"?g.symbol:"";return b.jsxs("div",{className:"zf-holding-row",children:[b.jsxs("div",{className:"zf-holding-main",children:[y?b.jsx(Fh,{symbol:y,option:Yh(y,r),compact:!0}):b.jsx("span",{className:"zf-symbol-empty",children:"No ticker"}),typeof g.amount=="number"&&b.jsxs("span",{className:"zf-holding-amount",children:["x ",g.amount]})]}),b.jsx("button",{type:"button",className:"zf-symbol-remove","aria-label":`Remove ${y||"holding"}`,onClick:()=>{c(h.filter((x,S)=>S!==v))},children:b.jsx(Xu,{size:13,"aria-hidden":"true"})})]},`${y}-${v}`)})}),b.jsx(dh,{disabled:d,loading:i,options:r,selectedSymbols:f,placeholder:d?"Maximum holdings added":"Add holding",keepOpenOnSelect:!0,onSelect:g=>{d||c([...h,{symbol:g,amount:1}])}})]})}function fh({title:e,detail:t,loading:i}){return b.jsxs("div",{className:"zf-symbol-head",children:[b.jsxs("div",{children:[b.jsx("div",{className:"zf-symbol-label",children:e}),b.jsx("div",{className:"zf-symbol-detail",children:t})]}),b.jsx("span",{className:i?"zf-symbol-source is-loading":"zf-symbol-source",children:i?"Loading":"Live list"})]})}function A1(e,t){return typeof t.maxItems=="number"?`${e}/${t.maxItems}`:typeof t.minItems=="number"&&e<t.minItems?`${e}/${t.minItems}+`:String(e)}function Yh(e,t){return t.find(i=>i.symbol===e)??$h(e)}function LM({symbols:e,options:t,onRemove:i}){return e.length===0?b.jsx("div",{className:"zf-symbol-empty",children:"No tickers selected"}):b.jsx("div",{className:"zf-symbol-chips",children:e.map(r=>b.jsxs("span",{className:"zf-symbol-chip",children:[b.jsx(Fh,{symbol:r,option:Yh(r,t),compact:!0}),b.jsx("button",{type:"button",className:"zf-symbol-remove","aria-label":`Remove ${r}`,onClick:()=>i(r),children:b.jsx(Xu,{size:13,"aria-hidden":"true"})})]},r))})}function Fh({symbol:e,option:t,compact:i=!1}){return b.jsxs("span",{className:i?"zf-selected-symbol is-compact":"zf-selected-symbol",children:[b.jsx(L2,{symbol:e}),b.jsxs("span",{className:"zf-selected-symbol-text",children:[b.jsx("strong",{children:Rl(e)}),!i&&b.jsx("em",{children:e})]}),!i&&t.markPx!==void 0&&b.jsx("span",{className:"zf-selected-symbol-price",children:D2(t.markPx)})]})}function dh({disabled:e=!1,loading:t,options:i,selectedSymbols:r,placeholder:s,keepOpenOnSelect:l=!1,onSelect:c}){const[f,h]=M.useState(""),[d,g]=M.useState(!1),v=M.useMemo(()=>new Set(r),[r]),y=M.useMemo(()=>new Set(i.map(E=>E.symbol)),[i]),x=bM(f),S=M.useMemo(()=>{const E=f.trim().toLowerCase();return(E?i.filter(k=>k.ticker.toLowerCase().includes(E)||k.symbol.toLowerCase().includes(E)):i.slice(0,28)).slice().sort((k,B)=>N1(k,E)-N1(B,E)).slice(0,36)},[i,f]),_=M.useMemo(()=>{if(!x)return[];const E=x.includes(":")?[x]:[`xyz:${x}`,x];return E.filter((C,k)=>E.indexOf(C)===k&&!y.has(C)&&!v.has(C))},[y,x,v]),T=E=>{!E||l&&v.has(E)||(c(E),h(""),g(l))};return b.jsxs("div",{className:"zf-symbol-combo",onBlur:E=>{E.currentTarget.contains(E.relatedTarget)||g(!1)},children:[b.jsxs("div",{className:e?"zf-symbol-search is-disabled":"zf-symbol-search",children:[b.jsx(mM,{size:14,"aria-hidden":"true"}),b.jsx("input",{value:f,disabled:e,placeholder:s,"aria-label":s,role:"combobox","aria-expanded":d,onFocus:()=>g(!0),onChange:E=>{h(E.target.value),g(!0)},onKeyDown:E=>{var C;E.key==="Enter"&&(E.preventDefault(),T(((C=S[0])==null?void 0:C.symbol)??_[0]??x))}}),b.jsx(uM,{size:14,"aria-hidden":"true"})]}),d&&!e&&b.jsxs("div",{className:"zf-symbol-menu",role:"listbox",children:[t&&b.jsx("div",{className:"zf-symbol-menu-status",children:"Loading live universe..."}),S.map(E=>{const C=v.has(E.symbol);return b.jsxs("button",{type:"button",className:C?"zf-symbol-option is-selected":"zf-symbol-option",disabled:l&&C,role:"option","aria-selected":C,onMouseDown:k=>{k.preventDefault(),T(E.symbol)},onClick:k=>{k.detail===0&&T(E.symbol)},children:[b.jsx(L2,{symbol:E.symbol}),b.jsxs("span",{className:"zf-symbol-option-main",children:[b.jsx("strong",{children:E.ticker}),b.jsx("em",{children:E.symbol})]}),b.jsxs("span",{className:"zf-symbol-option-meta",children:[b.jsx("span",{children:D2(E.markPx)||E.kind}),E.changePct!==void 0&&b.jsx("span",{className:E.changePct>=0?"zf-symbol-change is-up":"zf-symbol-change is-down",children:xM(E.changePct)})]}),C&&b.jsx(lM,{size:14,"aria-hidden":"true"})]},E.symbol)}),_.map(E=>b.jsxs("button",{type:"button",className:"zf-symbol-option zf-symbol-option--custom",onMouseDown:C=>{C.preventDefault(),T(E)},onClick:C=>{C.detail===0&&T(E)},children:[b.jsx("span",{className:"zf-symbol-custom-icon",children:b.jsx(dM,{size:13,"aria-hidden":"true"})}),b.jsxs("span",{className:"zf-symbol-option-main",children:[b.jsx("strong",{children:Rl(E)}),b.jsx("em",{children:E})]}),b.jsx("span",{className:"zf-symbol-option-meta",children:b.jsx("span",{children:km(E)})})]},E)),!t&&S.length===0&&_.length===0&&b.jsx("div",{className:"zf-symbol-menu-status",children:"No matches"})]})]})}function N1(e,t){if(!t)return e.rank;const i=e.ticker.toLowerCase(),r=e.symbol.toLowerCase();return i===t||r===t?-40+e.rank/1e4:i.startsWith(t)?-20+e.rank/1e4:r.startsWith(t)?-10+e.rank/1e4:e.rank}function L2({symbol:e}){const t=km(e).toLowerCase(),[i,r]=M.useState(!1);return M.useEffect(()=>r(!1),[e]),i?b.jsx("span",{className:`zf-symbol-avatar zf-symbol-avatar--${t}`,children:Rl(e).slice(0,2)}):b.jsx("img",{className:`zf-symbol-avatar zf-symbol-avatar--logo zf-symbol-avatar--${t}`,src:yM(e),alt:"","aria-hidden":"true",draggable:!1,loading:"lazy",onError:()=>r(!0)})}function Xr(e){const t=e.indexOf(":");return t===-1?e:e.slice(t+1)}function U2(e){return e.includes(":")}function H2(e){const t=Xr(e);return U2(e)?`https://assets.parqet.com/logos/symbol/${encodeURIComponent(t)}?format=png`:`https://assets.coincap.io/assets/icons/${t.toLowerCase()}@2x.png`}const R1=["#5b6cff","#9b59ff","#e0608f","#e08a3c","#3fb6a8","#4f93e8","#7a8c52","#c0556b"];function UM(e){let t=0;for(let i=0;i<e.length;i++)t=t*31+e.charCodeAt(i)|0;return R1[Math.abs(t)%R1.length]}function fs({symbol:e,size:t=18,className:i=""}){const r=Xr(e),s=U2(e),[l,c]=M.useState(!1);M.useEffect(()=>c(!1),[e]);const f=s?"rounded-[5px]":"rounded-full",h={width:t,height:t};return l?b.jsx("span",{"aria-hidden":!0,className:`inline-flex shrink-0 items-center justify-center font-bold leading-none text-white ${f} ${i}`,style:{...h,background:UM(r),fontSize:Math.round(t*.42)},children:r.slice(0,2).toUpperCase()}):b.jsx("img",{src:H2(e),width:t,height:t,alt:"","aria-hidden":!0,draggable:!1,loading:"lazy",onError:()=>c(!0),className:`shrink-0 object-contain ${f} ${s?"bg-white p-px":""} ${i}`,style:h})}function HM(e){var t=0,i=e.children,r=i&&i.length;if(!r)t=1;else for(;--r>=0;)t+=i[r].value;e.value=t}function BM(){return this.eachAfter(HM)}function $M(e,t){let i=-1;for(const r of this)e.call(t,r,++i,this);return this}function GM(e,t){for(var i=this,r=[i],s,l,c=-1;i=r.pop();)if(e.call(t,i,++c,this),s=i.children)for(l=s.length-1;l>=0;--l)r.push(s[l]);return this}function YM(e,t){for(var i=this,r=[i],s=[],l,c,f,h=-1;i=r.pop();)if(s.push(i),l=i.children)for(c=0,f=l.length;c<f;++c)r.push(l[c]);for(;i=s.pop();)e.call(t,i,++h,this);return this}function FM(e,t){let i=-1;for(const r of this)if(e.call(t,r,++i,this))return r}function PM(e){return this.eachAfter(function(t){for(var i=+e(t.data)||0,r=t.children,s=r&&r.length;--s>=0;)i+=r[s].value;t.value=i})}function VM(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function ZM(e){for(var t=this,i=IM(t,e),r=[t];t!==i;)t=t.parent,r.push(t);for(var s=r.length;e!==i;)r.splice(s,0,e),e=e.parent;return r}function IM(e,t){if(e===t)return e;var i=e.ancestors(),r=t.ancestors(),s=null;for(e=i.pop(),t=r.pop();e===t;)s=e,e=i.pop(),t=r.pop();return s}function XM(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function qM(){return Array.from(this)}function WM(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function KM(){var e=this,t=[];return e.each(function(i){i!==e&&t.push({source:i.parent,target:i})}),t}function*QM(){var e=this,t,i=[e],r,s,l;do for(t=i.reverse(),i=[];e=t.pop();)if(yield e,r=e.children)for(s=0,l=r.length;s<l;++s)i.push(r[s]);while(i.length)}function Om(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=t4)):t===void 0&&(t=e4);for(var i=new Tu(e),r,s=[i],l,c,f,h;r=s.pop();)if((c=t(r.data))&&(h=(c=Array.from(c)).length))for(r.children=c,f=h-1;f>=0;--f)s.push(l=c[f]=new Tu(c[f])),l.parent=r,l.depth=r.depth+1;return i.eachBefore(i4)}function JM(){return Om(this).eachBefore(n4)}function e4(e){return e.children}function t4(e){return Array.isArray(e)?e[1]:null}function n4(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function i4(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Tu(e){this.data=e,this.depth=this.height=0,this.parent=null}Tu.prototype=Om.prototype={constructor:Tu,count:BM,each:$M,eachAfter:YM,eachBefore:GM,find:FM,sum:PM,sort:VM,path:ZM,ancestors:XM,descendants:qM,leaves:WM,links:KM,copy:JM,[Symbol.iterator]:QM};function r4(e){if(typeof e!="function")throw new Error;return e}function rl(){return 0}function al(e){return function(){return e}}function a4(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function s4(e,t,i,r,s){for(var l=e.children,c,f=-1,h=l.length,d=e.value&&(r-t)/e.value;++f<h;)c=l[f],c.y0=i,c.y1=s,c.x0=t,c.x1=t+=c.value*d}function o4(e,t,i,r,s){for(var l=e.children,c,f=-1,h=l.length,d=e.value&&(s-i)/e.value;++f<h;)c=l[f],c.x0=t,c.x1=r,c.y0=i,c.y1=i+=c.value*d}var l4=(1+Math.sqrt(5))/2;function c4(e,t,i,r,s,l){for(var c=[],f=t.children,h,d,g=0,v=0,y=f.length,x,S,_=t.value,T,E,C,k,B,P,N;g<y;){x=s-i,S=l-r;do T=f[v++].value;while(!T&&v<y);for(E=C=T,P=Math.max(S/x,x/S)/(_*e),N=T*T*P,B=Math.max(C/N,N/E);v<y;++v){if(T+=d=f[v].value,d<E&&(E=d),d>C&&(C=d),N=T*T*P,k=Math.max(C/N,N/E),k>B){T-=d;break}B=k}c.push(h={value:T,dice:x<S,children:f.slice(g,v)}),h.dice?s4(h,i,r,s,_?r+=S*T/_:l):o4(h,i,r,_?i+=x*T/_:s,l),_-=T,g=v}return c}const B2=(function e(t){function i(r,s,l,c,f){c4(t,r,s,l,c,f)}return i.ratio=function(r){return e((r=+r)>1?r:1)},i})(l4);function u4(){var e=B2,t=!1,i=1,r=1,s=[0],l=rl,c=rl,f=rl,h=rl,d=rl;function g(y){return y.x0=y.y0=0,y.x1=i,y.y1=r,y.eachBefore(v),s=[0],t&&y.eachBefore(a4),y}function v(y){var x=s[y.depth],S=y.x0+x,_=y.y0+x,T=y.x1-x,E=y.y1-x;T<S&&(S=T=(S+T)/2),E<_&&(_=E=(_+E)/2),y.x0=S,y.y0=_,y.x1=T,y.y1=E,y.children&&(x=s[y.depth+1]=l(y)/2,S+=d(y)-x,_+=c(y)-x,T-=f(y)-x,E-=h(y)-x,T<S&&(S=T=(S+T)/2),E<_&&(_=E=(_+E)/2),e(y,S,_,T,E))}return g.round=function(y){return arguments.length?(t=!!y,g):t},g.size=function(y){return arguments.length?(i=+y[0],r=+y[1],g):[i,r]},g.tile=function(y){return arguments.length?(e=r4(y),g):e},g.padding=function(y){return arguments.length?g.paddingInner(y).paddingOuter(y):g.paddingInner()},g.paddingInner=function(y){return arguments.length?(l=typeof y=="function"?y:al(+y),g):l},g.paddingOuter=function(y){return arguments.length?g.paddingTop(y).paddingRight(y).paddingBottom(y).paddingLeft(y):g.paddingTop()},g.paddingTop=function(y){return arguments.length?(c=typeof y=="function"?y:al(+y),g):c},g.paddingRight=function(y){return arguments.length?(f=typeof y=="function"?y:al(+y),g):f},g.paddingBottom=function(y){return arguments.length?(h=typeof y=="function"?y:al(+y),g):h},g.paddingLeft=function(y){return arguments.length?(d=typeof y=="function"?y:al(+y),g):d},g}function $2(e){var t,i,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(i=$2(e[t]))&&(r&&(r+=" "),r+=i)}else for(i in e)e[i]&&(r&&(r+=" "),r+=i);return r}function f4(){for(var e,t,i=0,r="",s=arguments.length;i<s;i++)(e=arguments[i])&&(t=$2(e))&&(r&&(r+=" "),r+=t);return r}const d4=(e,t)=>{const i=new Array(e.length+t.length);for(let r=0;r<e.length;r++)i[r]=e[r];for(let r=0;r<t.length;r++)i[e.length+r]=t[r];return i},h4=(e,t)=>({classGroupId:e,validator:t}),G2=(e=new Map,t=null,i)=>({nextPart:e,validators:t,classGroupId:i}),Eu="-",k1=[],m4="arbitrary..",g4=e=>{const t=v4(e),{conflictingClassGroups:i,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return p4(c);const f=c.split(Eu),h=f[0]===""&&f.length>1?1:0;return Y2(f,h,t)},getConflictingClassGroupIds:(c,f)=>{if(f){const h=r[c],d=i[c];return h?d?d4(d,h):h:d||k1}return i[c]||k1}}},Y2=(e,t,i)=>{if(e.length-t===0)return i.classGroupId;const s=e[t],l=i.nextPart.get(s);if(l){const d=Y2(e,t+1,l);if(d)return d}const c=i.validators;if(c===null)return;const f=t===0?e.join(Eu):e.slice(t).join(Eu),h=c.length;for(let d=0;d<h;d++){const g=c[d];if(g.validator(f))return g.classGroupId}},p4=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),i=t.indexOf(":"),r=t.slice(0,i);return r?m4+r:void 0})(),v4=e=>{const{theme:t,classGroups:i}=e;return y4(i,t)},y4=(e,t)=>{const i=G2();for(const r in e){const s=e[r];jm(s,i,r,t)}return i},jm=(e,t,i,r)=>{const s=e.length;for(let l=0;l<s;l++){const c=e[l];b4(c,t,i,r)}},b4=(e,t,i,r)=>{if(typeof e=="string"){x4(e,t,i);return}if(typeof e=="function"){w4(e,t,i,r);return}_4(e,t,i,r)},x4=(e,t,i)=>{const r=e===""?t:F2(t,e);r.classGroupId=i},w4=(e,t,i,r)=>{if(S4(e)){jm(e(r),t,i,r);return}t.validators===null&&(t.validators=[]),t.validators.push(h4(i,e))},_4=(e,t,i,r)=>{const s=Object.entries(e),l=s.length;for(let c=0;c<l;c++){const[f,h]=s[c];jm(h,F2(t,f),i,r)}},F2=(e,t)=>{let i=e;const r=t.split(Eu),s=r.length;for(let l=0;l<s;l++){const c=r[l];let f=i.nextPart.get(c);f||(f=G2(),i.nextPart.set(c,f)),i=f}return i},S4=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,T4=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,i=Object.create(null),r=Object.create(null);const s=(l,c)=>{i[l]=c,t++,t>e&&(t=0,r=i,i=Object.create(null))};return{get(l){let c=i[l];if(c!==void 0)return c;if((c=r[l])!==void 0)return s(l,c),c},set(l,c){l in i?i[l]=c:s(l,c)}}},Ph="!",D1=":",E4=[],O1=(e,t,i,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:i,maybePostfixModifierPosition:r,isExternal:s}),z4=e=>{const{prefix:t,experimentalParseClassName:i}=e;let r=s=>{const l=[];let c=0,f=0,h=0,d;const g=s.length;for(let _=0;_<g;_++){const T=s[_];if(c===0&&f===0){if(T===D1){l.push(s.slice(h,_)),h=_+1;continue}if(T==="/"){d=_;continue}}T==="["?c++:T==="]"?c--:T==="("?f++:T===")"&&f--}const v=l.length===0?s:s.slice(h);let y=v,x=!1;v.endsWith(Ph)?(y=v.slice(0,-1),x=!0):v.startsWith(Ph)&&(y=v.slice(1),x=!0);const S=d&&d>h?d-h:void 0;return O1(l,x,y,S)};if(t){const s=t+D1,l=r;r=c=>c.startsWith(s)?l(c.slice(s.length)):O1(E4,!1,c,void 0,!0)}if(i){const s=r;r=l=>i({className:l,parseClassName:s})}return r},M4=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((i,r)=>{t.set(i,1e6+r)}),i=>{const r=[];let s=[];for(let l=0;l<i.length;l++){const c=i[l],f=c[0]==="[",h=t.has(c);f||h?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(c)):s.push(c)}return s.length>0&&(s.sort(),r.push(...s)),r}},C4=e=>({cache:T4(e.cacheSize),parseClassName:z4(e),sortModifiers:M4(e),postfixLookupClassGroupIds:A4(e),...g4(e)}),A4=e=>{const t=Object.create(null),i=e.postfixLookupClassGroups;if(i)for(let r=0;r<i.length;r++)t[i[r]]=!0;return t},N4=/\s+/,R4=(e,t)=>{const{parseClassName:i,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:l,postfixLookupClassGroupIds:c}=t,f=[],h=e.trim().split(N4);let d="";for(let g=h.length-1;g>=0;g-=1){const v=h[g],{isExternal:y,modifiers:x,hasImportantModifier:S,baseClassName:_,maybePostfixModifierPosition:T}=i(v);if(y){d=v+(d.length>0?" "+d:d);continue}let E=!!T,C;if(E){const U=_.substring(0,T);C=r(U);const A=C&&c[C]?r(_):void 0;A&&A!==C&&(C=A,E=!1)}else C=r(_);if(!C){if(!E){d=v+(d.length>0?" "+d:d);continue}if(C=r(_),!C){d=v+(d.length>0?" "+d:d);continue}E=!1}const k=x.length===0?"":x.length===1?x[0]:l(x).join(":"),B=S?k+Ph:k,P=B+C;if(f.indexOf(P)>-1)continue;f.push(P);const N=s(C,E);for(let U=0;U<N.length;++U){const A=N[U];f.push(B+A)}d=v+(d.length>0?" "+d:d)}return d},k4=(...e)=>{let t=0,i,r,s="";for(;t<e.length;)(i=e[t++])&&(r=P2(i))&&(s&&(s+=" "),s+=r);return s},P2=e=>{if(typeof e=="string")return e;let t,i="";for(let r=0;r<e.length;r++)e[r]&&(t=P2(e[r]))&&(i&&(i+=" "),i+=t);return i},D4=(e,...t)=>{let i,r,s,l;const c=h=>{const d=t.reduce((g,v)=>v(g),e());return i=C4(d),r=i.cache.get,s=i.cache.set,l=f,f(h)},f=h=>{const d=r(h);if(d)return d;const g=R4(h,i);return s(h,g),g};return l=c,(...h)=>l(k4(...h))},O4=[],_n=e=>{const t=i=>i[e]||O4;return t.isThemeGetter=!0,t},V2=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Z2=/^\((?:(\w[\w-]*):)?(.+)\)$/i,j4=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,L4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,U4=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,H4=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,B4=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ca=e=>j4.test(e),qe=e=>!!e&&!Number.isNaN(Number(e)),pr=e=>!!e&&Number.isInteger(Number(e)),hh=e=>e.endsWith("%")&&qe(e.slice(0,-1)),Gr=e=>L4.test(e),I2=()=>!0,G4=e=>U4.test(e)&&!H4.test(e),Lm=()=>!1,Y4=e=>B4.test(e),F4=e=>$4.test(e),P4=e=>!xe(e)&&!we(e),V4=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),Z4=e=>ja(e,W2,Lm),xe=e=>V2.test(e),Ja=e=>ja(e,K2,G4),j1=e=>ja(e,eC,qe),I4=e=>ja(e,J2,I2),X4=e=>ja(e,Q2,Lm),L1=e=>ja(e,X2,Lm),q4=e=>ja(e,q2,F4),Pc=e=>ja(e,ex,Y4),we=e=>Z2.test(e),sl=e=>ds(e,K2),W4=e=>ds(e,Q2),U1=e=>ds(e,X2),K4=e=>ds(e,W2),Q4=e=>ds(e,q2),Vc=e=>ds(e,ex,!0),J4=e=>ds(e,J2,!0),ja=(e,t,i)=>{const r=V2.exec(e);return r?r[1]?t(r[1]):i(r[2]):!1},ds=(e,t,i=!1)=>{const r=Z2.exec(e);return r?r[1]?t(r[1]):i:!1},X2=e=>e==="position"||e==="percentage",q2=e=>e==="image"||e==="url",W2=e=>e==="length"||e==="size"||e==="bg-size",K2=e=>e==="length",eC=e=>e==="number",Q2=e=>e==="family-name",J2=e=>e==="number"||e==="weight",ex=e=>e==="shadow",tC=()=>{const e=_n("color"),t=_n("font"),i=_n("text"),r=_n("font-weight"),s=_n("tracking"),l=_n("leading"),c=_n("breakpoint"),f=_n("container"),h=_n("spacing"),d=_n("radius"),g=_n("shadow"),v=_n("inset-shadow"),y=_n("text-shadow"),x=_n("drop-shadow"),S=_n("blur"),_=_n("perspective"),T=_n("aspect"),E=_n("ease"),C=_n("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],P=()=>[...B(),we,xe],N=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto","contain","none"],A=()=>[we,xe,h],$=()=>[Ca,"full","auto",...A()],I=()=>[pr,"none","subgrid",we,xe],Y=()=>["auto",{span:["full",pr,we,xe]},pr,we,xe],O=()=>[pr,"auto",we,xe],j=()=>["auto","min","max","fr",we,xe],L=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...A()],V=()=>[Ca,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],ie=()=>[Ca,"screen","full","dvw","lvw","svw","min","max","fit",...A()],ue=()=>[Ca,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],J=()=>[e,we,xe],R=()=>[...B(),U1,L1,{position:[we,xe]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ae=()=>["auto","cover","contain",K4,Z4,{size:[we,xe]}],he=()=>[hh,sl,Ja],de=()=>["","none","full",d,we,xe],ve=()=>["",qe,sl,Ja],be=()=>["solid","dashed","dotted","double"],je=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[qe,hh,U1,L1],Ee=()=>["","none",S,we,xe],ze=()=>["none",qe,we,xe],fe=()=>["none",qe,we,xe],dt=()=>[qe,we,xe],Ue=()=>[Ca,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Gr],breakpoint:[Gr],color:[I2],container:[Gr],"drop-shadow":[Gr],ease:["in","out","in-out"],font:[P4],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Gr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Gr],shadow:[Gr],spacing:["px",qe],text:[Gr],"text-shadow":[Gr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ca,xe,we,T]}],container:["container"],"container-type":[{"@container":["","normal","size",we,xe]}],"container-named":[V4],columns:[{columns:[qe,xe,we,f]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:P()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:U()}],"overscroll-x":[{"overscroll-x":U()}],"overscroll-y":[{"overscroll-y":U()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{"inset-s":$(),start:$()}],end:[{"inset-e":$(),end:$()}],"inset-bs":[{"inset-bs":$()}],"inset-be":[{"inset-be":$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[pr,"auto",we,xe]}],basis:[{basis:[Ca,"full","auto",f,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qe,Ca,"auto","initial","none",xe]}],grow:[{grow:["",qe,we,xe]}],shrink:[{shrink:["",qe,we,xe]}],order:[{order:[pr,"first","last","none",we,xe]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:Y()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:Y()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":j()}],"auto-rows":[{"auto-rows":j()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...L(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...L()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":L()}],"place-items":[{"place-items":[...K(),"baseline"]}],"place-self":[{"place-self":["auto",...K()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mbs:[{mbs:D()}],mbe:[{mbe:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],"inline-size":[{inline:["auto",...ie()]}],"min-inline-size":[{"min-inline":["auto",...ie()]}],"max-inline-size":[{"max-inline":["none",...ie()]}],"block-size":[{block:["auto",...ue()]}],"min-block-size":[{"min-block":["auto",...ue()]}],"max-block-size":[{"max-block":["none",...ue()]}],w:[{w:[f,"screen",...V()]}],"min-w":[{"min-w":[f,"screen","none",...V()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[c]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",i,sl,Ja]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,J4,I4]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",hh,xe]}],"font-family":[{font:[W4,X4,t]}],"font-features":[{"font-features":[xe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,we,xe]}],"line-clamp":[{"line-clamp":[qe,"none",we,j1]}],leading:[{leading:[l,...A()]}],"list-image":[{"list-image":["none",we,xe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",we,xe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:J()}],"text-color":[{text:J()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...be(),"wavy"]}],"text-decoration-thickness":[{decoration:[qe,"from-font","auto",we,Ja]}],"text-decoration-color":[{decoration:J()}],"underline-offset":[{"underline-offset":[qe,"auto",we,xe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"tab-size":[{tab:[pr,we,xe]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",we,xe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",we,xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:R()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:ae()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},pr,we,xe],radial:["",we,xe],conic:[pr,we,xe]},Q4,q4]}],"bg-color":[{bg:J()}],"gradient-from-pos":[{from:he()}],"gradient-via-pos":[{via:he()}],"gradient-to-pos":[{to:he()}],"gradient-from":[{from:J()}],"gradient-via":[{via:J()}],"gradient-to":[{to:J()}],rounded:[{rounded:de()}],"rounded-s":[{"rounded-s":de()}],"rounded-e":[{"rounded-e":de()}],"rounded-t":[{"rounded-t":de()}],"rounded-r":[{"rounded-r":de()}],"rounded-b":[{"rounded-b":de()}],"rounded-l":[{"rounded-l":de()}],"rounded-ss":[{"rounded-ss":de()}],"rounded-se":[{"rounded-se":de()}],"rounded-ee":[{"rounded-ee":de()}],"rounded-es":[{"rounded-es":de()}],"rounded-tl":[{"rounded-tl":de()}],"rounded-tr":[{"rounded-tr":de()}],"rounded-br":[{"rounded-br":de()}],"rounded-bl":[{"rounded-bl":de()}],"border-w":[{border:ve()}],"border-w-x":[{"border-x":ve()}],"border-w-y":[{"border-y":ve()}],"border-w-s":[{"border-s":ve()}],"border-w-e":[{"border-e":ve()}],"border-w-bs":[{"border-bs":ve()}],"border-w-be":[{"border-be":ve()}],"border-w-t":[{"border-t":ve()}],"border-w-r":[{"border-r":ve()}],"border-w-b":[{"border-b":ve()}],"border-w-l":[{"border-l":ve()}],"divide-x":[{"divide-x":ve()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ve()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...be(),"hidden","none"]}],"divide-style":[{divide:[...be(),"hidden","none"]}],"border-color":[{border:J()}],"border-color-x":[{"border-x":J()}],"border-color-y":[{"border-y":J()}],"border-color-s":[{"border-s":J()}],"border-color-e":[{"border-e":J()}],"border-color-bs":[{"border-bs":J()}],"border-color-be":[{"border-be":J()}],"border-color-t":[{"border-t":J()}],"border-color-r":[{"border-r":J()}],"border-color-b":[{"border-b":J()}],"border-color-l":[{"border-l":J()}],"divide-color":[{divide:J()}],"outline-style":[{outline:[...be(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qe,we,xe]}],"outline-w":[{outline:["",qe,sl,Ja]}],"outline-color":[{outline:J()}],shadow:[{shadow:["","none",g,Vc,Pc]}],"shadow-color":[{shadow:J()}],"inset-shadow":[{"inset-shadow":["none",v,Vc,Pc]}],"inset-shadow-color":[{"inset-shadow":J()}],"ring-w":[{ring:ve()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:J()}],"ring-offset-w":[{"ring-offset":[qe,Ja]}],"ring-offset-color":[{"ring-offset":J()}],"inset-ring-w":[{"inset-ring":ve()}],"inset-ring-color":[{"inset-ring":J()}],"text-shadow":[{"text-shadow":["none",y,Vc,Pc]}],"text-shadow-color":[{"text-shadow":J()}],opacity:[{opacity:[qe,we,xe]}],"mix-blend":[{"mix-blend":[...je(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":je()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":J()}],"mask-image-linear-to-color":[{"mask-linear-to":J()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":J()}],"mask-image-t-to-color":[{"mask-t-to":J()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":J()}],"mask-image-r-to-color":[{"mask-r-to":J()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":J()}],"mask-image-b-to-color":[{"mask-b-to":J()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":J()}],"mask-image-l-to-color":[{"mask-l-to":J()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":J()}],"mask-image-x-to-color":[{"mask-x-to":J()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":J()}],"mask-image-y-to-color":[{"mask-y-to":J()}],"mask-image-radial":[{"mask-radial":[we,xe]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":J()}],"mask-image-radial-to-color":[{"mask-radial-to":J()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":B()}],"mask-image-conic-pos":[{"mask-conic":[qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":J()}],"mask-image-conic-to-color":[{"mask-conic-to":J()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:R()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:ae()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",we,xe]}],filter:[{filter:["","none",we,xe]}],blur:[{blur:Ee()}],brightness:[{brightness:[qe,we,xe]}],contrast:[{contrast:[qe,we,xe]}],"drop-shadow":[{"drop-shadow":["","none",x,Vc,Pc]}],"drop-shadow-color":[{"drop-shadow":J()}],grayscale:[{grayscale:["",qe,we,xe]}],"hue-rotate":[{"hue-rotate":[qe,we,xe]}],invert:[{invert:["",qe,we,xe]}],saturate:[{saturate:[qe,we,xe]}],sepia:[{sepia:["",qe,we,xe]}],"backdrop-filter":[{"backdrop-filter":["","none",we,xe]}],"backdrop-blur":[{"backdrop-blur":Ee()}],"backdrop-brightness":[{"backdrop-brightness":[qe,we,xe]}],"backdrop-contrast":[{"backdrop-contrast":[qe,we,xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qe,we,xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qe,we,xe]}],"backdrop-invert":[{"backdrop-invert":["",qe,we,xe]}],"backdrop-opacity":[{"backdrop-opacity":[qe,we,xe]}],"backdrop-saturate":[{"backdrop-saturate":[qe,we,xe]}],"backdrop-sepia":[{"backdrop-sepia":["",qe,we,xe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",we,xe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qe,"initial",we,xe]}],ease:[{ease:["linear","initial",E,we,xe]}],delay:[{delay:[qe,we,xe]}],animate:[{animate:["none",C,we,xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,we,xe]}],"perspective-origin":[{"perspective-origin":P()}],rotate:[{rotate:ze()}],"rotate-x":[{"rotate-x":ze()}],"rotate-y":[{"rotate-y":ze()}],"rotate-z":[{"rotate-z":ze()}],scale:[{scale:fe()}],"scale-x":[{"scale-x":fe()}],"scale-y":[{"scale-y":fe()}],"scale-z":[{"scale-z":fe()}],"scale-3d":["scale-3d"],skew:[{skew:dt()}],"skew-x":[{"skew-x":dt()}],"skew-y":[{"skew-y":dt()}],transform:[{transform:[we,xe,"","none","gpu","cpu"]}],"transform-origin":[{origin:P()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ue()}],"translate-x":[{"translate-x":Ue()}],"translate-y":[{"translate-y":Ue()}],"translate-z":[{"translate-z":Ue()}],"translate-none":["translate-none"],zoom:[{zoom:[pr,we,xe]}],accent:[{accent:J()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:J()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",we,xe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":J()}],"scrollbar-track-color":[{"scrollbar-track":J()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",we,xe]}],fill:[{fill:["none",...J()]}],"stroke-w":[{stroke:[qe,sl,Ja,j1]}],stroke:[{stroke:["none",...J()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},nC=D4(tC);function ai(...e){return nC(f4(e))}const ol="4px",Zc="4px",iC=2.5,rC=(e,t,i,r,s)=>{const l=e.children;if(!l||l.length===0)return;const c=(_,T,E,C,k)=>{if(C===0)return 1/0;const B=T/C*k;if(B===0)return 1/0;let P=0;for(const N of _){const A=(N.value||0)/T*E,$=B/A,I=Math.abs($-iC);P=Math.max(P,I)}return P},f=(_,T,E,C,k,B,P)=>{const N=T/E*k;let U=P;for(const A of _){const I=(A.value||0)/T*C;A.x0=B,A.y0=U,A.x1=B+N,A.y1=U+I,U+=I}return N},h=r-t,d=s-i,g=l.reduce((_,T)=>_+(T.value||0),0);if(g===0)return;let v=[...l],y=t,x=h,S=g;for(;v.length>0;){let _=[],T=0;for(let C=0;C<v.length;C++){const k=v[C],B=k.value||0,P=[..._,k],N=T+B;if(_.length===0)_=P,T=N;else{const U=c(_,T,d,S,x);if(c(P,N,d,S,x)<=U)_=P,T=N;else break}}const E=f(_,T,S,d,x,y,i);v=v.slice(_.length),y+=E,x-=E,S-=T}};function aC({data:e,className:t,LeafComponent:i,getColorValue:r,tileMode:s="squarify"}){const l=M.useRef(null),c=M.useRef(null),f=M.useRef(null),h=M.useRef(null),d=M.useRef(null),g=M.useRef(null),[,v]=M.useTransition(),[y,x]=M.useState({width:0,height:0});M.useEffect(()=>{const E=l.current;if(E){const C=new ResizeObserver(({})=>{v(()=>{x({width:E.offsetWidth,height:E.offsetHeight})})});return C.observe(E),()=>{C.disconnect()}}},[]),M.useEffect(()=>{const E=c.current;if(E){const C=E.children;let k=C[0],B=C[0],P=C[0],N=C[0];for(let U=0;U<C.length;U++){const A=C[U],{x:$,y:I}=A.getBoundingClientRect(),Y=k.getBoundingClientRect(),O=B.getBoundingClientRect(),j=P.getBoundingClientRect(),L=N.getBoundingClientRect();$<=Y.x&&I<=Y.y&&(k=A),$<=O.x&&I>=O.y&&(B=A),$>=j.x&&I<=j.y&&(P=A),$>=L.x&&I>=L.y&&(N=A)}f.current&&(f.current.style.borderTopLeftRadius=ol),f.current=k,f.current.style.borderTopLeftRadius=Zc,h.current&&(h.current.style.borderBottomLeftRadius=ol),h.current=B,h.current.style.borderBottomLeftRadius=Zc,d.current&&(d.current.style.borderTopRightRadius=ol),d.current=P,d.current.style.borderTopRightRadius=Zc,g.current&&(g.current.style.borderBottomRightRadius=ol),g.current=N,g.current.style.borderBottomRightRadius=Zc}},[y]);const S=M.useMemo(()=>{switch(s){case"vertical-rectangle":return rC;case"squarify":default:return B2}},[s]),_=M.useMemo(()=>u4().size([y.width,y.height]).tile(S).paddingInner(4)(Om({id:"root",value:0,children:e}).sum(E=>E.value).sort((E,C)=>C.data.value-E.data.value)),[e,y.width,y.height,S]),T=M.useMemo(()=>{const E=_.leaves(),C=E.map(L=>r?r(L.data):L.data.value),k=C.filter(L=>L>=0),B=C.filter(L=>L<0),P=k.length>0?Math.min(...k):0,N=k.length>0?Math.max(...k):0,U=B.length>0?Math.min(...B):0,A=B.length>0?Math.max(...B):0,$=L=>L<0?A===U?1:(L-A)/(U-A):N===P?1:(L-P)/(N-P),I=(L,K,D)=>{const V=be=>{var je;return((je=be.match(/[A-F0-9]{2}/gi))==null?void 0:je.map(se=>parseInt(se,16)))||[0,0,0]},[ie,ue,J]=V(L),[R,X,ae]=V(K),he=Math.round(R*D+ie*(1-D)),de=Math.round(X*D+ue*(1-D)),ve=Math.round(ae*D+J*(1-D));return`#${[he,de,ve].map(be=>be.toString(16).padStart(2,"0")).join("")}`},Y=(L,K)=>{if(K<0){const D=1-L;return D>=.75?.6:D>=.5?.4:D>=.25?.3:.2}else return L>=.75?.1:L>=.6?.2:L>=.5?.3:L>=.25?.4:L>=.1?.45:.5},O=[...new Set(E.map(L=>L.x0))].sort((L,K)=>L-K),j=new Map(O.map((L,K)=>[L,K]));return E.map(L=>{const K=L.x1-L.x0,D=L.y1-L.y0,V=r?r(L.data):L.data.value,ie=$(V),ue=Y(ie,V),J=j.get(L.x0)??0,R=V>=0?I("#25A78D","#000000",ue):I("#F21553","#000000",ue);return b.jsx("div",{className:"group absolute cursor-pointer rounded-sm border border-transparent hover:bg-[radial-gradient(146.13%_118.42%_at_50%_-15.5%,rgba(255,255,255,0.1)_0%,rgba(255,255,255,0)_99.59%)] hover:bg-gradient-to-t",style:{left:L.x0,top:L.y0,width:K,height:D,borderRadius:ol,backgroundColor:R},children:b.jsx(i,{width:K,height:D,data:L.data,columnIndex:J})},`${L.data.id}-box`)})},[_,i,r]);return b.jsx("div",{className:ai("h-full w-full",t),ref:l,children:b.jsx("div",{className:"relative overflow-hidden rounded-lg",style:{height:y.height,width:y.width},ref:c,children:T})})}const sC=aC;function ru(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function oC(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function qu(e){let t,i,r;e.length!==2?(t=ru,i=(f,h)=>ru(e(f),h),r=(f,h)=>e(f)-h):(t=e===ru||e===oC?e:lC,i=e,r=e);function s(f,h,d=0,g=f.length){if(d<g){if(t(h,h)!==0)return g;do{const v=d+g>>>1;i(f[v],h)<0?d=v+1:g=v}while(d<g)}return d}function l(f,h,d=0,g=f.length){if(d<g){if(t(h,h)!==0)return g;do{const v=d+g>>>1;i(f[v],h)<=0?d=v+1:g=v}while(d<g)}return d}function c(f,h,d=0,g=f.length){const v=s(f,h,d,g-1);return v>d&&r(f[v-1],h)>-r(f[v],h)?v-1:v}return{left:s,center:c,right:l}}function lC(){return 0}function cC(e){return e===null?NaN:+e}const uC=qu(ru),fC=uC.right;qu(cC).center;function Vh(e,t){let i,r;if(t===void 0)for(const s of e)s!=null&&(i===void 0?s>=s&&(i=r=s):(i>s&&(i=s),r<s&&(r=s)));else{let s=-1;for(let l of e)(l=t(l,++s,e))!=null&&(i===void 0?l>=l&&(i=r=l):(i>l&&(i=l),r<l&&(r=l)))}return[i,r]}class H1 extends Map{constructor(t,i=mC){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:i}}),t!=null)for(const[r,s]of t)this.set(r,s)}get(t){return super.get(B1(this,t))}has(t){return super.has(B1(this,t))}set(t,i){return super.set(dC(this,t),i)}delete(t){return super.delete(hC(this,t))}}function B1({_intern:e,_key:t},i){const r=t(i);return e.has(r)?e.get(r):i}function dC({_intern:e,_key:t},i){const r=t(i);return e.has(r)?e.get(r):(e.set(r,i),i)}function hC({_intern:e,_key:t},i){const r=t(i);return e.has(r)&&(i=e.get(r),e.delete(r)),i}function mC(e){return e!==null&&typeof e=="object"?e.valueOf():e}const gC=Math.sqrt(50),pC=Math.sqrt(10),vC=Math.sqrt(2);function zu(e,t,i){const r=(t-e)/Math.max(0,i),s=Math.floor(Math.log10(r)),l=r/Math.pow(10,s),c=l>=gC?10:l>=pC?5:l>=vC?2:1;let f,h,d;return s<0?(d=Math.pow(10,-s)/c,f=Math.round(e*d),h=Math.round(t*d),f/d<e&&++f,h/d>t&&--h,d=-d):(d=Math.pow(10,s)*c,f=Math.round(e/d),h=Math.round(t/d),f*d<e&&++f,h*d>t&&--h),h<f&&.5<=i&&i<2?zu(e,t,i*2):[f,h,d]}function yC(e,t,i){if(t=+t,e=+e,i=+i,!(i>0))return[];if(e===t)return[e];const r=t<e,[s,l,c]=r?zu(t,e,i):zu(e,t,i);if(!(l>=s))return[];const f=l-s+1,h=new Array(f);if(r)if(c<0)for(let d=0;d<f;++d)h[d]=(l-d)/-c;else for(let d=0;d<f;++d)h[d]=(l-d)*c;else if(c<0)for(let d=0;d<f;++d)h[d]=(s+d)/-c;else for(let d=0;d<f;++d)h[d]=(s+d)*c;return h}function Zh(e,t,i){return t=+t,e=+e,i=+i,zu(e,t,i)[2]}function Ih(e,t,i){t=+t,e=+e,i=+i;const r=t<e,s=r?Zh(t,e,i):Zh(e,t,i);return(r?-1:1)*(s<0?1/-s:s)}function bC(e,t){let i;for(const r of e)r!=null&&(i<r||i===void 0&&r>=r)&&(i=r);return i}function xC(e,t){let i;for(const r of e)r!=null&&(i>r||i===void 0&&r>=r)&&(i=r);return i}function wC(e,t,i){e=+e,t=+t,i=(s=arguments.length)<2?(t=e,e=0,1):s<3?1:+i;for(var r=-1,s=Math.max(0,Math.ceil((t-e)/i))|0,l=new Array(s);++r<s;)l[r]=e+r*i;return l}function _C(e){return e}var mh=1,gh=2,Xh=3,gl=4,$1=1e-6;function SC(e){return"translate("+e+",0)"}function TC(e){return"translate(0,"+e+")"}function EC(e){return t=>+e(t)}function zC(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),i=>+e(i)+t}function MC(){return!this.__axis}function tx(e,t){var i=[],r=null,s=null,l=6,c=6,f=3,h=typeof window<"u"&&window.devicePixelRatio>1?0:.5,d=e===mh||e===gl?-1:1,g=e===gl||e===gh?"x":"y",v=e===mh||e===Xh?SC:TC;function y(x){var S=r??(t.ticks?t.ticks.apply(t,i):t.domain()),_=s??(t.tickFormat?t.tickFormat.apply(t,i):_C),T=Math.max(l,0)+f,E=t.range(),C=+E[0]+h,k=+E[E.length-1]+h,B=(t.bandwidth?zC:EC)(t.copy(),h),P=x.selection?x.selection():x,N=P.selectAll(".domain").data([null]),U=P.selectAll(".tick").data(S,t).order(),A=U.exit(),$=U.enter().append("g").attr("class","tick"),I=U.select("line"),Y=U.select("text");N=N.merge(N.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),U=U.merge($),I=I.merge($.append("line").attr("stroke","currentColor").attr(g+"2",d*l)),Y=Y.merge($.append("text").attr("fill","currentColor").attr(g,d*T).attr("dy",e===mh?"0em":e===Xh?"0.71em":"0.32em")),x!==P&&(N=N.transition(x),U=U.transition(x),I=I.transition(x),Y=Y.transition(x),A=A.transition(x).attr("opacity",$1).attr("transform",function(O){return isFinite(O=B(O))?v(O+h):this.getAttribute("transform")}),$.attr("opacity",$1).attr("transform",function(O){var j=this.parentNode.__axis;return v((j&&isFinite(j=j(O))?j:B(O))+h)})),A.remove(),N.attr("d",e===gl||e===gh?c?"M"+d*c+","+C+"H"+h+"V"+k+"H"+d*c:"M"+h+","+C+"V"+k:c?"M"+C+","+d*c+"V"+h+"H"+k+"V"+d*c:"M"+C+","+h+"H"+k),U.attr("opacity",1).attr("transform",function(O){return v(B(O)+h)}),I.attr(g+"2",d*l),Y.attr(g,d*T).text(_),P.filter(MC).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===gh?"start":e===gl?"end":"middle"),P.each(function(){this.__axis=B})}return y.scale=function(x){return arguments.length?(t=x,y):t},y.ticks=function(){return i=Array.from(arguments),y},y.tickArguments=function(x){return arguments.length?(i=x==null?[]:Array.from(x),y):i.slice()},y.tickValues=function(x){return arguments.length?(r=x==null?null:Array.from(x),y):r&&r.slice()},y.tickFormat=function(x){return arguments.length?(s=x,y):s},y.tickSize=function(x){return arguments.length?(l=c=+x,y):l},y.tickSizeInner=function(x){return arguments.length?(l=+x,y):l},y.tickSizeOuter=function(x){return arguments.length?(c=+x,y):c},y.tickPadding=function(x){return arguments.length?(f=+x,y):f},y.offset=function(x){return arguments.length?(h=+x,y):h},y}function G1(e){return tx(Xh,e)}function nx(e){return tx(gl,e)}var CC={value:()=>{}};function ix(){for(var e=0,t=arguments.length,i={},r;e<t;++e){if(!(r=arguments[e]+"")||r in i||/[\s.]/.test(r))throw new Error("illegal type: "+r);i[r]=[]}return new au(i)}function au(e){this._=e}function AC(e,t){return e.trim().split(/^|\s+/).map(function(i){var r="",s=i.indexOf(".");if(s>=0&&(r=i.slice(s+1),i=i.slice(0,s)),i&&!t.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:r}})}au.prototype=ix.prototype={constructor:au,on:function(e,t){var i=this._,r=AC(e+"",i),s,l=-1,c=r.length;if(arguments.length<2){for(;++l<c;)if((s=(e=r[l]).type)&&(s=NC(i[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<c;)if(s=(e=r[l]).type)i[s]=Y1(i[s],e.name,t);else if(t==null)for(s in i)i[s]=Y1(i[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var i in t)e[i]=t[i].slice();return new au(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var i=new Array(s),r=0,s,l;r<s;++r)i[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],r=0,s=l.length;r<s;++r)l[r].value.apply(t,i)},apply:function(e,t,i){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],s=0,l=r.length;s<l;++s)r[s].value.apply(t,i)}};function NC(e,t){for(var i=0,r=e.length,s;i<r;++i)if((s=e[i]).name===t)return s.value}function Y1(e,t,i){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=CC,e=e.slice(0,r).concat(e.slice(r+1));break}return i!=null&&e.push({name:t,value:i}),e}var qh="http://www.w3.org/1999/xhtml";const F1={svg:"http://www.w3.org/2000/svg",xhtml:qh,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Wu(e){var t=e+="",i=t.indexOf(":");return i>=0&&(t=e.slice(0,i))!=="xmlns"&&(e=e.slice(i+1)),F1.hasOwnProperty(t)?{space:F1[t],local:e}:e}function RC(e){return function(){var t=this.ownerDocument,i=this.namespaceURI;return i===qh&&t.documentElement.namespaceURI===qh?t.createElement(e):t.createElementNS(i,e)}}function kC(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function rx(e){var t=Wu(e);return(t.local?kC:RC)(t)}function DC(){}function Um(e){return e==null?DC:function(){return this.querySelector(e)}}function OC(e){typeof e!="function"&&(e=Um(e));for(var t=this._groups,i=t.length,r=new Array(i),s=0;s<i;++s)for(var l=t[s],c=l.length,f=r[s]=new Array(c),h,d,g=0;g<c;++g)(h=l[g])&&(d=e.call(h,h.__data__,g,l))&&("__data__"in h&&(d.__data__=h.__data__),f[g]=d);return new ki(r,this._parents)}function jC(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function LC(){return[]}function ax(e){return e==null?LC:function(){return this.querySelectorAll(e)}}function UC(e){return function(){return jC(e.apply(this,arguments))}}function HC(e){typeof e=="function"?e=UC(e):e=ax(e);for(var t=this._groups,i=t.length,r=[],s=[],l=0;l<i;++l)for(var c=t[l],f=c.length,h,d=0;d<f;++d)(h=c[d])&&(r.push(e.call(h,h.__data__,d,c)),s.push(h));return new ki(r,s)}function sx(e){return function(){return this.matches(e)}}function ox(e){return function(t){return t.matches(e)}}var BC=Array.prototype.find;function $C(e){return function(){return BC.call(this.children,e)}}function GC(){return this.firstElementChild}function YC(e){return this.select(e==null?GC:$C(typeof e=="function"?e:ox(e)))}var FC=Array.prototype.filter;function PC(){return Array.from(this.children)}function VC(e){return function(){return FC.call(this.children,e)}}function ZC(e){return this.selectAll(e==null?PC:VC(typeof e=="function"?e:ox(e)))}function IC(e){typeof e!="function"&&(e=sx(e));for(var t=this._groups,i=t.length,r=new Array(i),s=0;s<i;++s)for(var l=t[s],c=l.length,f=r[s]=[],h,d=0;d<c;++d)(h=l[d])&&e.call(h,h.__data__,d,l)&&f.push(h);return new ki(r,this._parents)}function lx(e){return new Array(e.length)}function XC(){return new ki(this._enter||this._groups.map(lx),this._parents)}function Mu(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Mu.prototype={constructor:Mu,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function qC(e){return function(){return e}}function WC(e,t,i,r,s,l){for(var c=0,f,h=t.length,d=l.length;c<d;++c)(f=t[c])?(f.__data__=l[c],r[c]=f):i[c]=new Mu(e,l[c]);for(;c<h;++c)(f=t[c])&&(s[c]=f)}function KC(e,t,i,r,s,l,c){var f,h,d=new Map,g=t.length,v=l.length,y=new Array(g),x;for(f=0;f<g;++f)(h=t[f])&&(y[f]=x=c.call(h,h.__data__,f,t)+"",d.has(x)?s[f]=h:d.set(x,h));for(f=0;f<v;++f)x=c.call(e,l[f],f,l)+"",(h=d.get(x))?(r[f]=h,h.__data__=l[f],d.delete(x)):i[f]=new Mu(e,l[f]);for(f=0;f<g;++f)(h=t[f])&&d.get(y[f])===h&&(s[f]=h)}function QC(e){return e.__data__}function JC(e,t){if(!arguments.length)return Array.from(this,QC);var i=t?KC:WC,r=this._parents,s=this._groups;typeof e!="function"&&(e=qC(e));for(var l=s.length,c=new Array(l),f=new Array(l),h=new Array(l),d=0;d<l;++d){var g=r[d],v=s[d],y=v.length,x=e6(e.call(g,g&&g.__data__,d,r)),S=x.length,_=f[d]=new Array(S),T=c[d]=new Array(S),E=h[d]=new Array(y);i(g,v,_,T,E,x,t);for(var C=0,k=0,B,P;C<S;++C)if(B=_[C]){for(C>=k&&(k=C+1);!(P=T[k])&&++k<S;);B._next=P||null}}return c=new ki(c,r),c._enter=f,c._exit=h,c}function e6(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function t6(){return new ki(this._exit||this._groups.map(lx),this._parents)}function n6(e,t,i){var r=this.enter(),s=this,l=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),i==null?l.remove():i(l),r&&s?r.merge(s).order():s}function i6(e){for(var t=e.selection?e.selection():e,i=this._groups,r=t._groups,s=i.length,l=r.length,c=Math.min(s,l),f=new Array(s),h=0;h<c;++h)for(var d=i[h],g=r[h],v=d.length,y=f[h]=new Array(v),x,S=0;S<v;++S)(x=d[S]||g[S])&&(y[S]=x);for(;h<s;++h)f[h]=i[h];return new ki(f,this._parents)}function r6(){for(var e=this._groups,t=-1,i=e.length;++t<i;)for(var r=e[t],s=r.length-1,l=r[s],c;--s>=0;)(c=r[s])&&(l&&c.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(c,l),l=c);return this}function a6(e){e||(e=s6);function t(v,y){return v&&y?e(v.__data__,y.__data__):!v-!y}for(var i=this._groups,r=i.length,s=new Array(r),l=0;l<r;++l){for(var c=i[l],f=c.length,h=s[l]=new Array(f),d,g=0;g<f;++g)(d=c[g])&&(h[g]=d);h.sort(t)}return new ki(s,this._parents).order()}function s6(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function o6(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function l6(){return Array.from(this)}function c6(){for(var e=this._groups,t=0,i=e.length;t<i;++t)for(var r=e[t],s=0,l=r.length;s<l;++s){var c=r[s];if(c)return c}return null}function u6(){let e=0;for(const t of this)++e;return e}function f6(){return!this.node()}function d6(e){for(var t=this._groups,i=0,r=t.length;i<r;++i)for(var s=t[i],l=0,c=s.length,f;l<c;++l)(f=s[l])&&e.call(f,f.__data__,l,s);return this}function h6(e){return function(){this.removeAttribute(e)}}function m6(e){return function(){this.removeAttributeNS(e.space,e.local)}}function g6(e,t){return function(){this.setAttribute(e,t)}}function p6(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function v6(e,t){return function(){var i=t.apply(this,arguments);i==null?this.removeAttribute(e):this.setAttribute(e,i)}}function y6(e,t){return function(){var i=t.apply(this,arguments);i==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,i)}}function b6(e,t){var i=Wu(e);if(arguments.length<2){var r=this.node();return i.local?r.getAttributeNS(i.space,i.local):r.getAttribute(i)}return this.each((t==null?i.local?m6:h6:typeof t=="function"?i.local?y6:v6:i.local?p6:g6)(i,t))}function cx(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function x6(e){return function(){this.style.removeProperty(e)}}function w6(e,t,i){return function(){this.style.setProperty(e,t,i)}}function _6(e,t,i){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,i)}}function S6(e,t,i){return arguments.length>1?this.each((t==null?x6:typeof t=="function"?_6:w6)(e,t,i??"")):oo(this.node(),e)}function oo(e,t){return e.style.getPropertyValue(t)||cx(e).getComputedStyle(e,null).getPropertyValue(t)}function T6(e){return function(){delete this[e]}}function E6(e,t){return function(){this[e]=t}}function z6(e,t){return function(){var i=t.apply(this,arguments);i==null?delete this[e]:this[e]=i}}function M6(e,t){return arguments.length>1?this.each((t==null?T6:typeof t=="function"?z6:E6)(e,t)):this.node()[e]}function ux(e){return e.trim().split(/^|\s+/)}function Hm(e){return e.classList||new fx(e)}function fx(e){this._node=e,this._names=ux(e.getAttribute("class")||"")}fx.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function dx(e,t){for(var i=Hm(e),r=-1,s=t.length;++r<s;)i.add(t[r])}function hx(e,t){for(var i=Hm(e),r=-1,s=t.length;++r<s;)i.remove(t[r])}function C6(e){return function(){dx(this,e)}}function A6(e){return function(){hx(this,e)}}function N6(e,t){return function(){(t.apply(this,arguments)?dx:hx)(this,e)}}function R6(e,t){var i=ux(e+"");if(arguments.length<2){for(var r=Hm(this.node()),s=-1,l=i.length;++s<l;)if(!r.contains(i[s]))return!1;return!0}return this.each((typeof t=="function"?N6:t?C6:A6)(i,t))}function k6(){this.textContent=""}function D6(e){return function(){this.textContent=e}}function O6(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function j6(e){return arguments.length?this.each(e==null?k6:(typeof e=="function"?O6:D6)(e)):this.node().textContent}function L6(){this.innerHTML=""}function U6(e){return function(){this.innerHTML=e}}function H6(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function B6(e){return arguments.length?this.each(e==null?L6:(typeof e=="function"?H6:U6)(e)):this.node().innerHTML}function $6(){this.nextSibling&&this.parentNode.appendChild(this)}function G6(){return this.each($6)}function Y6(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function F6(){return this.each(Y6)}function P6(e){var t=typeof e=="function"?e:rx(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function V6(){return null}function Z6(e,t){var i=typeof e=="function"?e:rx(e),r=t==null?V6:typeof t=="function"?t:Um(t);return this.select(function(){return this.insertBefore(i.apply(this,arguments),r.apply(this,arguments)||null)})}function I6(){var e=this.parentNode;e&&e.removeChild(this)}function X6(){return this.each(I6)}function q6(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function W6(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function K6(e){return this.select(e?W6:q6)}function Q6(e){return arguments.length?this.property("__data__",e):this.node().__data__}function J6(e){return function(t){e.call(this,t,this.__data__)}}function eA(e){return e.trim().split(/^|\s+/).map(function(t){var i="",r=t.indexOf(".");return r>=0&&(i=t.slice(r+1),t=t.slice(0,r)),{type:t,name:i}})}function tA(e){return function(){var t=this.__on;if(t){for(var i=0,r=-1,s=t.length,l;i<s;++i)l=t[i],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++r]=l;++r?t.length=r:delete this.__on}}}function nA(e,t,i){return function(){var r=this.__on,s,l=J6(t);if(r){for(var c=0,f=r.length;c<f;++c)if((s=r[c]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=l,s.options=i),s.value=t;return}}this.addEventListener(e.type,l,i),s={type:e.type,name:e.name,value:t,listener:l,options:i},r?r.push(s):this.__on=[s]}}function iA(e,t,i){var r=eA(e+""),s,l=r.length,c;if(arguments.length<2){var f=this.node().__on;if(f){for(var h=0,d=f.length,g;h<d;++h)for(s=0,g=f[h];s<l;++s)if((c=r[s]).type===g.type&&c.name===g.name)return g.value}return}for(f=t?nA:tA,s=0;s<l;++s)this.each(f(r[s],t,i));return this}function mx(e,t,i){var r=cx(e),s=r.CustomEvent;typeof s=="function"?s=new s(t,i):(s=r.document.createEvent("Event"),i?(s.initEvent(t,i.bubbles,i.cancelable),s.detail=i.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function rA(e,t){return function(){return mx(this,e,t)}}function aA(e,t){return function(){return mx(this,e,t.apply(this,arguments))}}function sA(e,t){return this.each((typeof t=="function"?aA:rA)(e,t))}function*oA(){for(var e=this._groups,t=0,i=e.length;t<i;++t)for(var r=e[t],s=0,l=r.length,c;s<l;++s)(c=r[s])&&(yield c)}var gx=[null];function ki(e,t){this._groups=e,this._parents=t}function kl(){return new ki([[document.documentElement]],gx)}function lA(){return this}ki.prototype=kl.prototype={constructor:ki,select:OC,selectAll:HC,selectChild:YC,selectChildren:ZC,filter:IC,data:JC,enter:XC,exit:t6,join:n6,merge:i6,selection:lA,order:r6,sort:a6,call:o6,nodes:l6,node:c6,size:u6,empty:f6,each:d6,attr:b6,style:S6,property:M6,classed:R6,text:j6,html:B6,raise:G6,lower:F6,append:P6,insert:Z6,remove:X6,clone:K6,datum:Q6,on:iA,dispatch:sA,[Symbol.iterator]:oA};function rr(e){return typeof e=="string"?new ki([[document.querySelector(e)]],[document.documentElement]):new ki([[e]],gx)}function cA(e){let t;for(;t=e.sourceEvent;)e=t;return e}function uA(e,t){if(e=cA(e),t===void 0&&(t=e.currentTarget),t){var i=t.ownerSVGElement||t;if(i.createSVGPoint){var r=i.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}}return[e.pageX,e.pageY]}function Bm(e,t,i){e.prototype=t.prototype=i,i.constructor=e}function px(e,t){var i=Object.create(e.prototype);for(var r in t)i[r]=t[r];return i}function Dl(){}var El=.7,Cu=1/El,ao="\\s*([+-]?\\d+)\\s*",zl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",br="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",fA=/^#([0-9a-f]{3,8})$/,dA=new RegExp(`^rgb\\(${ao},${ao},${ao}\\)$`),hA=new RegExp(`^rgb\\(${br},${br},${br}\\)$`),mA=new RegExp(`^rgba\\(${ao},${ao},${ao},${zl}\\)$`),gA=new RegExp(`^rgba\\(${br},${br},${br},${zl}\\)$`),pA=new RegExp(`^hsl\\(${zl},${br},${br}\\)$`),vA=new RegExp(`^hsla\\(${zl},${br},${br},${zl}\\)$`),P1={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Bm(Dl,as,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:V1,formatHex:V1,formatHex8:yA,formatHsl:bA,formatRgb:Z1,toString:Z1});function V1(){return this.rgb().formatHex()}function yA(){return this.rgb().formatHex8()}function bA(){return vx(this).formatHsl()}function Z1(){return this.rgb().formatRgb()}function as(e){var t,i;return e=(e+"").trim().toLowerCase(),(t=fA.exec(e))?(i=t[1].length,t=parseInt(t[1],16),i===6?I1(t):i===3?new gi(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):i===8?Ic(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):i===4?Ic(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=dA.exec(e))?new gi(t[1],t[2],t[3],1):(t=hA.exec(e))?new gi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=mA.exec(e))?Ic(t[1],t[2],t[3],t[4]):(t=gA.exec(e))?Ic(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=pA.exec(e))?W1(t[1],t[2]/100,t[3]/100,1):(t=vA.exec(e))?W1(t[1],t[2]/100,t[3]/100,t[4]):P1.hasOwnProperty(e)?I1(P1[e]):e==="transparent"?new gi(NaN,NaN,NaN,0):null}function I1(e){return new gi(e>>16&255,e>>8&255,e&255,1)}function Ic(e,t,i,r){return r<=0&&(e=t=i=NaN),new gi(e,t,i,r)}function xA(e){return e instanceof Dl||(e=as(e)),e?(e=e.rgb(),new gi(e.r,e.g,e.b,e.opacity)):new gi}function Wh(e,t,i,r){return arguments.length===1?xA(e):new gi(e,t,i,r??1)}function gi(e,t,i,r){this.r=+e,this.g=+t,this.b=+i,this.opacity=+r}Bm(gi,Wh,px(Dl,{brighter(e){return e=e==null?Cu:Math.pow(Cu,e),new gi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?El:Math.pow(El,e),new gi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new gi(rs(this.r),rs(this.g),rs(this.b),Au(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:X1,formatHex:X1,formatHex8:wA,formatRgb:q1,toString:q1}));function X1(){return`#${is(this.r)}${is(this.g)}${is(this.b)}`}function wA(){return`#${is(this.r)}${is(this.g)}${is(this.b)}${is((isNaN(this.opacity)?1:this.opacity)*255)}`}function q1(){const e=Au(this.opacity);return`${e===1?"rgb(":"rgba("}${rs(this.r)}, ${rs(this.g)}, ${rs(this.b)}${e===1?")":`, ${e})`}`}function Au(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function rs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function is(e){return e=rs(e),(e<16?"0":"")+e.toString(16)}function W1(e,t,i,r){return r<=0?e=t=i=NaN:i<=0||i>=1?e=t=NaN:t<=0&&(e=NaN),new nr(e,t,i,r)}function vx(e){if(e instanceof nr)return new nr(e.h,e.s,e.l,e.opacity);if(e instanceof Dl||(e=as(e)),!e)return new nr;if(e instanceof nr)return e;e=e.rgb();var t=e.r/255,i=e.g/255,r=e.b/255,s=Math.min(t,i,r),l=Math.max(t,i,r),c=NaN,f=l-s,h=(l+s)/2;return f?(t===l?c=(i-r)/f+(i<r)*6:i===l?c=(r-t)/f+2:c=(t-i)/f+4,f/=h<.5?l+s:2-l-s,c*=60):f=h>0&&h<1?0:c,new nr(c,f,h,e.opacity)}function _A(e,t,i,r){return arguments.length===1?vx(e):new nr(e,t,i,r??1)}function nr(e,t,i,r){this.h=+e,this.s=+t,this.l=+i,this.opacity=+r}Bm(nr,_A,px(Dl,{brighter(e){return e=e==null?Cu:Math.pow(Cu,e),new nr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?El:Math.pow(El,e),new nr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,i=this.l,r=i+(i<.5?i:1-i)*t,s=2*i-r;return new gi(ph(e>=240?e-240:e+120,s,r),ph(e,s,r),ph(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new nr(K1(this.h),Xc(this.s),Xc(this.l),Au(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Au(this.opacity);return`${e===1?"hsl(":"hsla("}${K1(this.h)}, ${Xc(this.s)*100}%, ${Xc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function K1(e){return e=(e||0)%360,e<0?e+360:e}function Xc(e){return Math.max(0,Math.min(1,e||0))}function ph(e,t,i){return(e<60?t+(i-t)*e/60:e<180?i:e<240?t+(i-t)*(240-e)/60:t)*255}const $m=e=>()=>e;function SA(e,t){return function(i){return e+i*t}}function TA(e,t,i){return e=Math.pow(e,i),t=Math.pow(t,i)-e,i=1/i,function(r){return Math.pow(e+r*t,i)}}function EA(e){return(e=+e)==1?yx:function(t,i){return i-t?TA(t,i,e):$m(isNaN(t)?i:t)}}function yx(e,t){var i=t-e;return i?SA(e,i):$m(isNaN(e)?t:e)}const Nu=(function e(t){var i=EA(t);function r(s,l){var c=i((s=Wh(s)).r,(l=Wh(l)).r),f=i(s.g,l.g),h=i(s.b,l.b),d=yx(s.opacity,l.opacity);return function(g){return s.r=c(g),s.g=f(g),s.b=h(g),s.opacity=d(g),s+""}}return r.gamma=e,r})(1);function zA(e,t){t||(t=[]);var i=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(l){for(s=0;s<i;++s)r[s]=e[s]*(1-l)+t[s]*l;return r}}function MA(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function CA(e,t){var i=t?t.length:0,r=e?Math.min(i,e.length):0,s=new Array(r),l=new Array(i),c;for(c=0;c<r;++c)s[c]=Gm(e[c],t[c]);for(;c<i;++c)l[c]=t[c];return function(f){for(c=0;c<r;++c)l[c]=s[c](f);return l}}function AA(e,t){var i=new Date;return e=+e,t=+t,function(r){return i.setTime(e*(1-r)+t*r),i}}function tr(e,t){return e=+e,t=+t,function(i){return e*(1-i)+t*i}}function NA(e,t){var i={},r={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?i[s]=Gm(e[s],t[s]):r[s]=t[s];return function(l){for(s in i)r[s]=i[s](l);return r}}var Kh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,vh=new RegExp(Kh.source,"g");function RA(e){return function(){return e}}function kA(e){return function(t){return e(t)+""}}function bx(e,t){var i=Kh.lastIndex=vh.lastIndex=0,r,s,l,c=-1,f=[],h=[];for(e=e+"",t=t+"";(r=Kh.exec(e))&&(s=vh.exec(t));)(l=s.index)>i&&(l=t.slice(i,l),f[c]?f[c]+=l:f[++c]=l),(r=r[0])===(s=s[0])?f[c]?f[c]+=s:f[++c]=s:(f[++c]=null,h.push({i:c,x:tr(r,s)})),i=vh.lastIndex;return i<t.length&&(l=t.slice(i),f[c]?f[c]+=l:f[++c]=l),f.length<2?h[0]?kA(h[0].x):RA(t):(t=h.length,function(d){for(var g=0,v;g<t;++g)f[(v=h[g]).i]=v.x(d);return f.join("")})}function Gm(e,t){var i=typeof t,r;return t==null||i==="boolean"?$m(t):(i==="number"?tr:i==="string"?(r=as(t))?(t=r,Nu):bx:t instanceof as?Nu:t instanceof Date?AA:MA(t)?zA:Array.isArray(t)?CA:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?NA:tr)(e,t)}function DA(e,t){return e=+e,t=+t,function(i){return Math.round(e*(1-i)+t*i)}}var Q1=180/Math.PI,Qh={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function xx(e,t,i,r,s,l){var c,f,h;return(c=Math.sqrt(e*e+t*t))&&(e/=c,t/=c),(h=e*i+t*r)&&(i-=e*h,r-=t*h),(f=Math.sqrt(i*i+r*r))&&(i/=f,r/=f,h/=f),e*r<t*i&&(e=-e,t=-t,h=-h,c=-c),{translateX:s,translateY:l,rotate:Math.atan2(t,e)*Q1,skewX:Math.atan(h)*Q1,scaleX:c,scaleY:f}}var qc;function OA(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Qh:xx(t.a,t.b,t.c,t.d,t.e,t.f)}function jA(e){return e==null||(qc||(qc=document.createElementNS("http://www.w3.org/2000/svg","g")),qc.setAttribute("transform",e),!(e=qc.transform.baseVal.consolidate()))?Qh:(e=e.matrix,xx(e.a,e.b,e.c,e.d,e.e,e.f))}function wx(e,t,i,r){function s(d){return d.length?d.pop()+" ":""}function l(d,g,v,y,x,S){if(d!==v||g!==y){var _=x.push("translate(",null,t,null,i);S.push({i:_-4,x:tr(d,v)},{i:_-2,x:tr(g,y)})}else(v||y)&&x.push("translate("+v+t+y+i)}function c(d,g,v,y){d!==g?(d-g>180?g+=360:g-d>180&&(d+=360),y.push({i:v.push(s(v)+"rotate(",null,r)-2,x:tr(d,g)})):g&&v.push(s(v)+"rotate("+g+r)}function f(d,g,v,y){d!==g?y.push({i:v.push(s(v)+"skewX(",null,r)-2,x:tr(d,g)}):g&&v.push(s(v)+"skewX("+g+r)}function h(d,g,v,y,x,S){if(d!==v||g!==y){var _=x.push(s(x)+"scale(",null,",",null,")");S.push({i:_-4,x:tr(d,v)},{i:_-2,x:tr(g,y)})}else(v!==1||y!==1)&&x.push(s(x)+"scale("+v+","+y+")")}return function(d,g){var v=[],y=[];return d=e(d),g=e(g),l(d.translateX,d.translateY,g.translateX,g.translateY,v,y),c(d.rotate,g.rotate,v,y),f(d.skewX,g.skewX,v,y),h(d.scaleX,d.scaleY,g.scaleX,g.scaleY,v,y),d=g=null,function(x){for(var S=-1,_=y.length,T;++S<_;)v[(T=y[S]).i]=T.x(x);return v.join("")}}}var LA=wx(OA,"px, ","px)","deg)"),UA=wx(jA,", ",")",")"),lo=0,pl=0,ll=0,_x=1e3,Ru,vl,ku=0,ss=0,Ku=0,Ml=typeof performance=="object"&&performance.now?performance:Date,Sx=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ym(){return ss||(Sx(HA),ss=Ml.now()+Ku)}function HA(){ss=0}function Du(){this._call=this._time=this._next=null}Du.prototype=Tx.prototype={constructor:Du,restart:function(e,t,i){if(typeof e!="function")throw new TypeError("callback is not a function");i=(i==null?Ym():+i)+(t==null?0:+t),!this._next&&vl!==this&&(vl?vl._next=this:Ru=this,vl=this),this._call=e,this._time=i,Jh()},stop:function(){this._call&&(this._call=null,this._time=1/0,Jh())}};function Tx(e,t,i){var r=new Du;return r.restart(e,t,i),r}function BA(){Ym(),++lo;for(var e=Ru,t;e;)(t=ss-e._time)>=0&&e._call.call(void 0,t),e=e._next;--lo}function J1(){ss=(ku=Ml.now())+Ku,lo=pl=0;try{BA()}finally{lo=0,GA(),ss=0}}function $A(){var e=Ml.now(),t=e-ku;t>_x&&(Ku-=t,ku=e)}function GA(){for(var e,t=Ru,i,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(i=t._next,t._next=null,t=e?e._next=i:Ru=i);vl=e,Jh(r)}function Jh(e){if(!lo){pl&&(pl=clearTimeout(pl));var t=e-ss;t>24?(e<1/0&&(pl=setTimeout(J1,e-Ml.now()-Ku)),ll&&(ll=clearInterval(ll))):(ll||(ku=Ml.now(),ll=setInterval($A,_x)),lo=1,Sx(J1))}}function ey(e,t,i){var r=new Du;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,i),r}var YA=ix("start","end","cancel","interrupt"),FA=[],Ex=0,ty=1,em=2,su=3,ny=4,tm=5,ou=6;function Qu(e,t,i,r,s,l){var c=e.__transition;if(!c)e.__transition={};else if(i in c)return;PA(e,i,{name:t,index:r,group:s,on:YA,tween:FA,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:Ex})}function Fm(e,t){var i=sr(e,t);if(i.state>Ex)throw new Error("too late; already scheduled");return i}function xr(e,t){var i=sr(e,t);if(i.state>su)throw new Error("too late; already running");return i}function sr(e,t){var i=e.__transition;if(!i||!(i=i[t]))throw new Error("transition not found");return i}function PA(e,t,i){var r=e.__transition,s;r[t]=i,i.timer=Tx(l,0,i.time);function l(d){i.state=ty,i.timer.restart(c,i.delay,i.time),i.delay<=d&&c(d-i.delay)}function c(d){var g,v,y,x;if(i.state!==ty)return h();for(g in r)if(x=r[g],x.name===i.name){if(x.state===su)return ey(c);x.state===ny?(x.state=ou,x.timer.stop(),x.on.call("interrupt",e,e.__data__,x.index,x.group),delete r[g]):+g<t&&(x.state=ou,x.timer.stop(),x.on.call("cancel",e,e.__data__,x.index,x.group),delete r[g])}if(ey(function(){i.state===su&&(i.state=ny,i.timer.restart(f,i.delay,i.time),f(d))}),i.state=em,i.on.call("start",e,e.__data__,i.index,i.group),i.state===em){for(i.state=su,s=new Array(y=i.tween.length),g=0,v=-1;g<y;++g)(x=i.tween[g].value.call(e,e.__data__,i.index,i.group))&&(s[++v]=x);s.length=v+1}}function f(d){for(var g=d<i.duration?i.ease.call(null,d/i.duration):(i.timer.restart(h),i.state=tm,1),v=-1,y=s.length;++v<y;)s[v].call(e,g);i.state===tm&&(i.on.call("end",e,e.__data__,i.index,i.group),h())}function h(){i.state=ou,i.timer.stop(),delete r[t];for(var d in r)return;delete e.__transition}}function VA(e,t){var i=e.__transition,r,s,l=!0,c;if(i){t=t==null?null:t+"";for(c in i){if((r=i[c]).name!==t){l=!1;continue}s=r.state>em&&r.state<tm,r.state=ou,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete i[c]}l&&delete e.__transition}}function ZA(e){return this.each(function(){VA(this,e)})}function IA(e,t){var i,r;return function(){var s=xr(this,e),l=s.tween;if(l!==i){r=i=l;for(var c=0,f=r.length;c<f;++c)if(r[c].name===t){r=r.slice(),r.splice(c,1);break}}s.tween=r}}function XA(e,t,i){var r,s;if(typeof i!="function")throw new Error;return function(){var l=xr(this,e),c=l.tween;if(c!==r){s=(r=c).slice();for(var f={name:t,value:i},h=0,d=s.length;h<d;++h)if(s[h].name===t){s[h]=f;break}h===d&&s.push(f)}l.tween=s}}function qA(e,t){var i=this._id;if(e+="",arguments.length<2){for(var r=sr(this.node(),i).tween,s=0,l=r.length,c;s<l;++s)if((c=r[s]).name===e)return c.value;return null}return this.each((t==null?IA:XA)(i,e,t))}function Pm(e,t,i){var r=e._id;return e.each(function(){var s=xr(this,r);(s.value||(s.value={}))[t]=i.apply(this,arguments)}),function(s){return sr(s,r).value[t]}}function zx(e,t){var i;return(typeof t=="number"?tr:t instanceof as?Nu:(i=as(t))?(t=i,Nu):bx)(e,t)}function WA(e){return function(){this.removeAttribute(e)}}function KA(e){return function(){this.removeAttributeNS(e.space,e.local)}}function QA(e,t,i){var r,s=i+"",l;return function(){var c=this.getAttribute(e);return c===s?null:c===r?l:l=t(r=c,i)}}function JA(e,t,i){var r,s=i+"",l;return function(){var c=this.getAttributeNS(e.space,e.local);return c===s?null:c===r?l:l=t(r=c,i)}}function eN(e,t,i){var r,s,l;return function(){var c,f=i(this),h;return f==null?void this.removeAttribute(e):(c=this.getAttribute(e),h=f+"",c===h?null:c===r&&h===s?l:(s=h,l=t(r=c,f)))}}function tN(e,t,i){var r,s,l;return function(){var c,f=i(this),h;return f==null?void this.removeAttributeNS(e.space,e.local):(c=this.getAttributeNS(e.space,e.local),h=f+"",c===h?null:c===r&&h===s?l:(s=h,l=t(r=c,f)))}}function nN(e,t){var i=Wu(e),r=i==="transform"?UA:zx;return this.attrTween(e,typeof t=="function"?(i.local?tN:eN)(i,r,Pm(this,"attr."+e,t)):t==null?(i.local?KA:WA)(i):(i.local?JA:QA)(i,r,t))}function iN(e,t){return function(i){this.setAttribute(e,t.call(this,i))}}function rN(e,t){return function(i){this.setAttributeNS(e.space,e.local,t.call(this,i))}}function aN(e,t){var i,r;function s(){var l=t.apply(this,arguments);return l!==r&&(i=(r=l)&&rN(e,l)),i}return s._value=t,s}function sN(e,t){var i,r;function s(){var l=t.apply(this,arguments);return l!==r&&(i=(r=l)&&iN(e,l)),i}return s._value=t,s}function oN(e,t){var i="attr."+e;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;var r=Wu(e);return this.tween(i,(r.local?aN:sN)(r,t))}function lN(e,t){return function(){Fm(this,e).delay=+t.apply(this,arguments)}}function cN(e,t){return t=+t,function(){Fm(this,e).delay=t}}function uN(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?lN:cN)(t,e)):sr(this.node(),t).delay}function fN(e,t){return function(){xr(this,e).duration=+t.apply(this,arguments)}}function dN(e,t){return t=+t,function(){xr(this,e).duration=t}}function hN(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?fN:dN)(t,e)):sr(this.node(),t).duration}function mN(e,t){if(typeof t!="function")throw new Error;return function(){xr(this,e).ease=t}}function gN(e){var t=this._id;return arguments.length?this.each(mN(t,e)):sr(this.node(),t).ease}function pN(e,t){return function(){var i=t.apply(this,arguments);if(typeof i!="function")throw new Error;xr(this,e).ease=i}}function vN(e){if(typeof e!="function")throw new Error;return this.each(pN(this._id,e))}function yN(e){typeof e!="function"&&(e=sx(e));for(var t=this._groups,i=t.length,r=new Array(i),s=0;s<i;++s)for(var l=t[s],c=l.length,f=r[s]=[],h,d=0;d<c;++d)(h=l[d])&&e.call(h,h.__data__,d,l)&&f.push(h);return new Kr(r,this._parents,this._name,this._id)}function bN(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,i=e._groups,r=t.length,s=i.length,l=Math.min(r,s),c=new Array(r),f=0;f<l;++f)for(var h=t[f],d=i[f],g=h.length,v=c[f]=new Array(g),y,x=0;x<g;++x)(y=h[x]||d[x])&&(v[x]=y);for(;f<r;++f)c[f]=t[f];return new Kr(c,this._parents,this._name,this._id)}function xN(e){return(e+"").trim().split(/^|\s+/).every(function(t){var i=t.indexOf(".");return i>=0&&(t=t.slice(0,i)),!t||t==="start"})}function wN(e,t,i){var r,s,l=xN(t)?Fm:xr;return function(){var c=l(this,e),f=c.on;f!==r&&(s=(r=f).copy()).on(t,i),c.on=s}}function _N(e,t){var i=this._id;return arguments.length<2?sr(this.node(),i).on.on(e):this.each(wN(i,e,t))}function SN(e){return function(){var t=this.parentNode;for(var i in this.__transition)if(+i!==e)return;t&&t.removeChild(this)}}function TN(){return this.on("end.remove",SN(this._id))}function EN(e){var t=this._name,i=this._id;typeof e!="function"&&(e=Um(e));for(var r=this._groups,s=r.length,l=new Array(s),c=0;c<s;++c)for(var f=r[c],h=f.length,d=l[c]=new Array(h),g,v,y=0;y<h;++y)(g=f[y])&&(v=e.call(g,g.__data__,y,f))&&("__data__"in g&&(v.__data__=g.__data__),d[y]=v,Qu(d[y],t,i,y,d,sr(g,i)));return new Kr(l,this._parents,t,i)}function zN(e){var t=this._name,i=this._id;typeof e!="function"&&(e=ax(e));for(var r=this._groups,s=r.length,l=[],c=[],f=0;f<s;++f)for(var h=r[f],d=h.length,g,v=0;v<d;++v)if(g=h[v]){for(var y=e.call(g,g.__data__,v,h),x,S=sr(g,i),_=0,T=y.length;_<T;++_)(x=y[_])&&Qu(x,t,i,_,y,S);l.push(y),c.push(g)}return new Kr(l,c,t,i)}var MN=kl.prototype.constructor;function CN(){return new MN(this._groups,this._parents)}function AN(e,t){var i,r,s;return function(){var l=oo(this,e),c=(this.style.removeProperty(e),oo(this,e));return l===c?null:l===i&&c===r?s:s=t(i=l,r=c)}}function Mx(e){return function(){this.style.removeProperty(e)}}function NN(e,t,i){var r,s=i+"",l;return function(){var c=oo(this,e);return c===s?null:c===r?l:l=t(r=c,i)}}function RN(e,t,i){var r,s,l;return function(){var c=oo(this,e),f=i(this),h=f+"";return f==null&&(h=f=(this.style.removeProperty(e),oo(this,e))),c===h?null:c===r&&h===s?l:(s=h,l=t(r=c,f))}}function kN(e,t){var i,r,s,l="style."+t,c="end."+l,f;return function(){var h=xr(this,e),d=h.on,g=h.value[l]==null?f||(f=Mx(t)):void 0;(d!==i||s!==g)&&(r=(i=d).copy()).on(c,s=g),h.on=r}}function DN(e,t,i){var r=(e+="")=="transform"?LA:zx;return t==null?this.styleTween(e,AN(e,r)).on("end.style."+e,Mx(e)):typeof t=="function"?this.styleTween(e,RN(e,r,Pm(this,"style."+e,t))).each(kN(this._id,e)):this.styleTween(e,NN(e,r,t),i).on("end.style."+e,null)}function ON(e,t,i){return function(r){this.style.setProperty(e,t.call(this,r),i)}}function jN(e,t,i){var r,s;function l(){var c=t.apply(this,arguments);return c!==s&&(r=(s=c)&&ON(e,c,i)),r}return l._value=t,l}function LN(e,t,i){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,jN(e,t,i??""))}function UN(e){return function(){this.textContent=e}}function HN(e){return function(){var t=e(this);this.textContent=t??""}}function BN(e){return this.tween("text",typeof e=="function"?HN(Pm(this,"text",e)):UN(e==null?"":e+""))}function $N(e){return function(t){this.textContent=e.call(this,t)}}function GN(e){var t,i;function r(){var s=e.apply(this,arguments);return s!==i&&(t=(i=s)&&$N(s)),t}return r._value=e,r}function YN(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,GN(e))}function FN(){for(var e=this._name,t=this._id,i=Cx(),r=this._groups,s=r.length,l=0;l<s;++l)for(var c=r[l],f=c.length,h,d=0;d<f;++d)if(h=c[d]){var g=sr(h,t);Qu(h,e,i,d,c,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new Kr(r,this._parents,e,i)}function PN(){var e,t,i=this,r=i._id,s=i.size();return new Promise(function(l,c){var f={value:c},h={value:function(){--s===0&&l()}};i.each(function(){var d=xr(this,r),g=d.on;g!==e&&(t=(e=g).copy(),t._.cancel.push(f),t._.interrupt.push(f),t._.end.push(h)),d.on=t}),s===0&&l()})}var VN=0;function Kr(e,t,i,r){this._groups=e,this._parents=t,this._name=i,this._id=r}function Cx(){return++VN}var Yr=kl.prototype;Kr.prototype={constructor:Kr,select:EN,selectAll:zN,selectChild:Yr.selectChild,selectChildren:Yr.selectChildren,filter:yN,merge:bN,selection:CN,transition:FN,call:Yr.call,nodes:Yr.nodes,node:Yr.node,size:Yr.size,empty:Yr.empty,each:Yr.each,on:_N,attr:nN,attrTween:oN,style:DN,styleTween:LN,text:BN,textTween:YN,remove:TN,tween:qA,delay:uN,duration:hN,ease:gN,easeVarying:vN,end:PN,[Symbol.iterator]:Yr[Symbol.iterator]};const iy=e=>+e;function nm(e){return--e*e*e+1}function Ax(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Vm=1.70158,ZN=(function e(t){t=+t;function i(r){return(r=+r)*r*(t*(r-1)+r)}return i.overshoot=e,i})(Vm),IN=(function e(t){t=+t;function i(r){return--r*r*((r+1)*t+r)+1}return i.overshoot=e,i})(Vm);(function e(t){t=+t;function i(r){return((r*=2)<1?r*r*((t+1)*r-t):(r-=2)*r*((t+1)*r+t)+2)/2}return i.overshoot=e,i})(Vm);var XN={time:null,delay:0,duration:250,ease:Ax};function qN(e,t){for(var i;!(i=e.__transition)||!(i=i[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return i}function WN(e){var t,i;e instanceof Kr?(t=e._id,e=e._name):(t=Cx(),(i=XN).time=Ym(),e=e==null?null:e+"");for(var r=this._groups,s=r.length,l=0;l<s;++l)for(var c=r[l],f=c.length,h,d=0;d<f;++d)(h=c[d])&&Qu(h,e,t,d,c,i||qN(h,t));return new Kr(r,this._parents,e,t)}kl.prototype.interrupt=ZA;kl.prototype.transition=WN;const im=Math.PI,rm=2*im,ns=1e-6,KN=rm-ns;function Nx(e){this._+=e[0];for(let t=1,i=e.length;t<i;++t)this._+=arguments[t]+e[t]}function QN(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Nx;const i=10**t;return function(r){this._+=r[0];for(let s=1,l=r.length;s<l;++s)this._+=Math.round(arguments[s]*i)/i+r[s]}}class JN{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Nx:QN(t)}moveTo(t,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+i}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,i){this._append`L${this._x1=+t},${this._y1=+i}`}quadraticCurveTo(t,i,r,s){this._append`Q${+t},${+i},${this._x1=+r},${this._y1=+s}`}bezierCurveTo(t,i,r,s,l,c){this._append`C${+t},${+i},${+r},${+s},${this._x1=+l},${this._y1=+c}`}arcTo(t,i,r,s,l){if(t=+t,i=+i,r=+r,s=+s,l=+l,l<0)throw new Error(`negative radius: ${l}`);let c=this._x1,f=this._y1,h=r-t,d=s-i,g=c-t,v=f-i,y=g*g+v*v;if(this._x1===null)this._append`M${this._x1=t},${this._y1=i}`;else if(y>ns)if(!(Math.abs(v*h-d*g)>ns)||!l)this._append`L${this._x1=t},${this._y1=i}`;else{let x=r-c,S=s-f,_=h*h+d*d,T=x*x+S*S,E=Math.sqrt(_),C=Math.sqrt(y),k=l*Math.tan((im-Math.acos((_+y-T)/(2*E*C)))/2),B=k/C,P=k/E;Math.abs(B-1)>ns&&this._append`L${t+B*g},${i+B*v}`,this._append`A${l},${l},0,0,${+(v*x>g*S)},${this._x1=t+P*h},${this._y1=i+P*d}`}}arc(t,i,r,s,l,c){if(t=+t,i=+i,r=+r,c=!!c,r<0)throw new Error(`negative radius: ${r}`);let f=r*Math.cos(s),h=r*Math.sin(s),d=t+f,g=i+h,v=1^c,y=c?s-l:l-s;this._x1===null?this._append`M${d},${g}`:(Math.abs(this._x1-d)>ns||Math.abs(this._y1-g)>ns)&&this._append`L${d},${g}`,r&&(y<0&&(y=y%rm+rm),y>KN?this._append`A${r},${r},0,1,${v},${t-f},${i-h}A${r},${r},0,1,${v},${this._x1=d},${this._y1=g}`:y>ns&&this._append`A${r},${r},0,${+(y>=im)},${v},${this._x1=t+r*Math.cos(l)},${this._y1=i+r*Math.sin(l)}`)}rect(t,i,r,s){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+i}h${r=+r}v${+s}h${-r}Z`}toString(){return this._}}function eR(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ou(e,t){if(!isFinite(e)||e===0)return null;var i=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,i);return[r.length>1?r[0]+r.slice(2):r,+e.slice(i+1)]}function co(e){return e=Ou(Math.abs(e)),e?e[1]:NaN}function tR(e,t){return function(i,r){for(var s=i.length,l=[],c=0,f=e[0],h=0;s>0&&f>0&&(h+f+1>r&&(f=Math.max(1,r-h)),l.push(i.substring(s-=f,s+f)),!((h+=f+1)>r));)f=e[c=(c+1)%e.length];return l.reverse().join(t)}}function nR(e){return function(t){return t.replace(/[0-9]/g,function(i){return e[+i]})}}var iR=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ju(e){if(!(t=iR.exec(e)))throw new Error("invalid format: "+e);var t;return new Zm({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}ju.prototype=Zm.prototype;function Zm(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Zm.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function rR(e){e:for(var t=e.length,i=1,r=-1,s;i<t;++i)switch(e[i]){case".":r=s=i;break;case"0":r===0&&(r=i),s=i;break;default:if(!+e[i])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(s+1):e}var Lu;function aR(e,t){var i=Ou(e,t);if(!i)return Lu=void 0,e.toPrecision(t);var r=i[0],s=i[1],l=s-(Lu=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,c=r.length;return l===c?r:l>c?r+new Array(l-c+1).join("0"):l>0?r.slice(0,l)+"."+r.slice(l):"0."+new Array(1-l).join("0")+Ou(e,Math.max(0,t+l-1))[0]}function ry(e,t){var i=Ou(e,t);if(!i)return e+"";var r=i[0],s=i[1];return s<0?"0."+new Array(-s).join("0")+r:r.length>s+1?r.slice(0,s+1)+"."+r.slice(s+1):r+new Array(s-r.length+2).join("0")}const ay={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:eR,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>ry(e*100,t),r:ry,s:aR,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function sy(e){return e}var oy=Array.prototype.map,ly=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function sR(e){var t=e.grouping===void 0||e.thousands===void 0?sy:tR(oy.call(e.grouping,Number),e.thousands+""),i=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",s=e.decimal===void 0?".":e.decimal+"",l=e.numerals===void 0?sy:nR(oy.call(e.numerals,String)),c=e.percent===void 0?"%":e.percent+"",f=e.minus===void 0?"−":e.minus+"",h=e.nan===void 0?"NaN":e.nan+"";function d(v,y){v=ju(v);var x=v.fill,S=v.align,_=v.sign,T=v.symbol,E=v.zero,C=v.width,k=v.comma,B=v.precision,P=v.trim,N=v.type;N==="n"?(k=!0,N="g"):ay[N]||(B===void 0&&(B=12),P=!0,N="g"),(E||x==="0"&&S==="=")&&(E=!0,x="0",S="=");var U=(y&&y.prefix!==void 0?y.prefix:"")+(T==="$"?i:T==="#"&&/[boxX]/.test(N)?"0"+N.toLowerCase():""),A=(T==="$"?r:/[%p]/.test(N)?c:"")+(y&&y.suffix!==void 0?y.suffix:""),$=ay[N],I=/[defgprs%]/.test(N);B=B===void 0?6:/[gprs]/.test(N)?Math.max(1,Math.min(21,B)):Math.max(0,Math.min(20,B));function Y(O){var j=U,L=A,K,D,V;if(N==="c")L=$(O)+L,O="";else{O=+O;var ie=O<0||1/O<0;if(O=isNaN(O)?h:$(Math.abs(O),B),P&&(O=rR(O)),ie&&+O==0&&_!=="+"&&(ie=!1),j=(ie?_==="("?_:f:_==="-"||_==="("?"":_)+j,L=(N==="s"&&!isNaN(O)&&Lu!==void 0?ly[8+Lu/3]:"")+L+(ie&&_==="("?")":""),I){for(K=-1,D=O.length;++K<D;)if(V=O.charCodeAt(K),48>V||V>57){L=(V===46?s+O.slice(K+1):O.slice(K))+L,O=O.slice(0,K);break}}}k&&!E&&(O=t(O,1/0));var ue=j.length+O.length+L.length,J=ue<C?new Array(C-ue+1).join(x):"";switch(k&&E&&(O=t(J+O,J.length?C-L.length:1/0),J=""),S){case"<":O=j+O+L+J;break;case"=":O=j+J+O+L;break;case"^":O=J.slice(0,ue=J.length>>1)+j+O+L+J.slice(ue);break;default:O=J+j+O+L;break}return l(O)}return Y.toString=function(){return v+""},Y}function g(v,y){var x=Math.max(-8,Math.min(8,Math.floor(co(y)/3)))*3,S=Math.pow(10,-x),_=d((v=ju(v),v.type="f",v),{suffix:ly[8+x/3]});return function(T){return _(S*T)}}return{format:d,formatPrefix:g}}var Wc,Rx,kx;oR({thousands:",",grouping:[3],currency:["$",""]});function oR(e){return Wc=sR(e),Rx=Wc.format,kx=Wc.formatPrefix,Wc}function lR(e){return Math.max(0,-co(Math.abs(e)))}function cR(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(co(t)/3)))*3-co(Math.abs(e)))}function uR(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,co(t)-co(e))+1}function Ju(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const cy=Symbol("implicit");function Im(){var e=new H1,t=[],i=[],r=cy;function s(l){let c=e.get(l);if(c===void 0){if(r!==cy)return r;e.set(l,c=t.push(l)-1)}return i[c%i.length]}return s.domain=function(l){if(!arguments.length)return t.slice();t=[],e=new H1;for(const c of l)e.has(c)||e.set(c,t.push(c)-1);return s},s.range=function(l){return arguments.length?(i=Array.from(l),s):i.slice()},s.unknown=function(l){return arguments.length?(r=l,s):r},s.copy=function(){return Im(t,i).unknown(r)},Ju.apply(s,arguments),s}function am(){var e=Im().unknown(void 0),t=e.domain,i=e.range,r=0,s=1,l,c,f=!1,h=0,d=0,g=.5;delete e.unknown;function v(){var y=t().length,x=s<r,S=x?s:r,_=x?r:s;l=(_-S)/Math.max(1,y-h+d*2),f&&(l=Math.floor(l)),S+=(_-S-l*(y-h))*g,c=l*(1-h),f&&(S=Math.round(S),c=Math.round(c));var T=wC(y).map(function(E){return S+l*E});return i(x?T.reverse():T)}return e.domain=function(y){return arguments.length?(t(y),v()):t()},e.range=function(y){return arguments.length?([r,s]=y,r=+r,s=+s,v()):[r,s]},e.rangeRound=function(y){return[r,s]=y,r=+r,s=+s,f=!0,v()},e.bandwidth=function(){return c},e.step=function(){return l},e.round=function(y){return arguments.length?(f=!!y,v()):f},e.padding=function(y){return arguments.length?(h=Math.min(1,d=+y),v()):h},e.paddingInner=function(y){return arguments.length?(h=Math.min(1,y),v()):h},e.paddingOuter=function(y){return arguments.length?(d=+y,v()):d},e.align=function(y){return arguments.length?(g=Math.max(0,Math.min(1,y)),v()):g},e.copy=function(){return am(t(),[r,s]).round(f).paddingInner(h).paddingOuter(d).align(g)},Ju.apply(v(),arguments)}function fR(e){return function(){return e}}function dR(e){return+e}var uy=[0,1];function Js(e){return e}function sm(e,t){return(t-=e=+e)?function(i){return(i-e)/t}:fR(isNaN(t)?NaN:.5)}function hR(e,t){var i;return e>t&&(i=e,e=t,t=i),function(r){return Math.max(e,Math.min(t,r))}}function mR(e,t,i){var r=e[0],s=e[1],l=t[0],c=t[1];return s<r?(r=sm(s,r),l=i(c,l)):(r=sm(r,s),l=i(l,c)),function(f){return l(r(f))}}function gR(e,t,i){var r=Math.min(e.length,t.length)-1,s=new Array(r),l=new Array(r),c=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++c<r;)s[c]=sm(e[c],e[c+1]),l[c]=i(t[c],t[c+1]);return function(f){var h=fC(e,f,1,r)-1;return l[h](s[h](f))}}function Dx(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function pR(){var e=uy,t=uy,i=Gm,r,s,l,c=Js,f,h,d;function g(){var y=Math.min(e.length,t.length);return c!==Js&&(c=hR(e[0],e[y-1])),f=y>2?gR:mR,h=d=null,v}function v(y){return y==null||isNaN(y=+y)?l:(h||(h=f(e.map(r),t,i)))(r(c(y)))}return v.invert=function(y){return c(s((d||(d=f(t,e.map(r),tr)))(y)))},v.domain=function(y){return arguments.length?(e=Array.from(y,dR),g()):e.slice()},v.range=function(y){return arguments.length?(t=Array.from(y),g()):t.slice()},v.rangeRound=function(y){return t=Array.from(y),i=DA,g()},v.clamp=function(y){return arguments.length?(c=y?!0:Js,g()):c!==Js},v.interpolate=function(y){return arguments.length?(i=y,g()):i},v.unknown=function(y){return arguments.length?(l=y,v):l},function(y,x){return r=y,s=x,g()}}function Ox(){return pR()(Js,Js)}function vR(e,t,i,r){var s=Ih(e,t,i),l;switch(r=ju(r??",f"),r.type){case"s":{var c=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(l=cR(s,c))&&(r.precision=l),kx(r,c)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(l=uR(s,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=l-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(l=lR(s))&&(r.precision=l-(r.type==="%")*2);break}}return Rx(r)}function yR(e){var t=e.domain;return e.ticks=function(i){var r=t();return yC(r[0],r[r.length-1],i??10)},e.tickFormat=function(i,r){var s=t();return vR(s[0],s[s.length-1],i??10,r)},e.nice=function(i){i==null&&(i=10);var r=t(),s=0,l=r.length-1,c=r[s],f=r[l],h,d,g=10;for(f<c&&(d=c,c=f,f=d,d=s,s=l,l=d);g-- >0;){if(d=Zh(c,f,i),d===h)return r[s]=c,r[l]=f,t(r);if(d>0)c=Math.floor(c/d)*d,f=Math.ceil(f/d)*d;else if(d<0)c=Math.ceil(c*d)/d,f=Math.floor(f*d)/d;else break;h=d}return e},e}function ef(){var e=Ox();return e.copy=function(){return Dx(e,ef())},Ju.apply(e,arguments),yR(e)}function bR(e,t){e=e.slice();var i=0,r=e.length-1,s=e[i],l=e[r],c;return l<s&&(c=i,i=r,r=c,c=s,s=l,l=c),e[i]=t.floor(s),e[r]=t.ceil(l),e}const yh=new Date,bh=new Date;function Sn(e,t,i,r){function s(l){return e(l=arguments.length===0?new Date:new Date(+l)),l}return s.floor=l=>(e(l=new Date(+l)),l),s.ceil=l=>(e(l=new Date(l-1)),t(l,1),e(l),l),s.round=l=>{const c=s(l),f=s.ceil(l);return l-c<f-l?c:f},s.offset=(l,c)=>(t(l=new Date(+l),c==null?1:Math.floor(c)),l),s.range=(l,c,f)=>{const h=[];if(l=s.ceil(l),f=f==null?1:Math.floor(f),!(l<c)||!(f>0))return h;let d;do h.push(d=new Date(+l)),t(l,f),e(l);while(d<l&&l<c);return h},s.filter=l=>Sn(c=>{if(c>=c)for(;e(c),!l(c);)c.setTime(c-1)},(c,f)=>{if(c>=c)if(f<0)for(;++f<=0;)for(;t(c,-1),!l(c););else for(;--f>=0;)for(;t(c,1),!l(c););}),i&&(s.count=(l,c)=>(yh.setTime(+l),bh.setTime(+c),e(yh),e(bh),Math.floor(i(yh,bh))),s.every=l=>(l=Math.floor(l),!isFinite(l)||!(l>0)?null:l>1?s.filter(r?c=>r(c)%l===0:c=>s.count(0,c)%l===0):s)),s}const Uu=Sn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Uu.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Sn(t=>{t.setTime(Math.floor(t/e)*e)},(t,i)=>{t.setTime(+t+i*e)},(t,i)=>(i-t)/e):Uu);Uu.range;const Vr=1e3,Vi=Vr*60,Zr=Vi*60,Qr=Zr*24,Xm=Qr*7,fy=Qr*30,xh=Qr*365,eo=Sn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Vr)},(e,t)=>(t-e)/Vr,e=>e.getUTCSeconds());eo.range;const qm=Sn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Vr)},(e,t)=>{e.setTime(+e+t*Vi)},(e,t)=>(t-e)/Vi,e=>e.getMinutes());qm.range;const xR=Sn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Vi)},(e,t)=>(t-e)/Vi,e=>e.getUTCMinutes());xR.range;const Wm=Sn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Vr-e.getMinutes()*Vi)},(e,t)=>{e.setTime(+e+t*Zr)},(e,t)=>(t-e)/Zr,e=>e.getHours());Wm.range;const wR=Sn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Zr)},(e,t)=>(t-e)/Zr,e=>e.getUTCHours());wR.range;const Ol=Sn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Vi)/Qr,e=>e.getDate()-1);Ol.range;const Km=Sn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Qr,e=>e.getUTCDate()-1);Km.range;const _R=Sn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Qr,e=>Math.floor(e/Qr));_R.range;function hs(e){return Sn(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,i)=>{t.setDate(t.getDate()+i*7)},(t,i)=>(i-t-(i.getTimezoneOffset()-t.getTimezoneOffset())*Vi)/Xm)}const tf=hs(0),Hu=hs(1),SR=hs(2),TR=hs(3),uo=hs(4),ER=hs(5),zR=hs(6);tf.range;Hu.range;SR.range;TR.range;uo.range;ER.range;zR.range;function ms(e){return Sn(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,i)=>{t.setUTCDate(t.getUTCDate()+i*7)},(t,i)=>(i-t)/Xm)}const jx=ms(0),Bu=ms(1),MR=ms(2),CR=ms(3),fo=ms(4),AR=ms(5),NR=ms(6);jx.range;Bu.range;MR.range;CR.range;fo.range;AR.range;NR.range;const Qm=Sn(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Qm.range;const RR=Sn(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());RR.range;const Jr=Sn(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Jr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Sn(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,i)=>{t.setFullYear(t.getFullYear()+i*e)});Jr.range;const os=Sn(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());os.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Sn(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,i)=>{t.setUTCFullYear(t.getUTCFullYear()+i*e)});os.range;function kR(e,t,i,r,s,l){const c=[[eo,1,Vr],[eo,5,5*Vr],[eo,15,15*Vr],[eo,30,30*Vr],[l,1,Vi],[l,5,5*Vi],[l,15,15*Vi],[l,30,30*Vi],[s,1,Zr],[s,3,3*Zr],[s,6,6*Zr],[s,12,12*Zr],[r,1,Qr],[r,2,2*Qr],[i,1,Xm],[t,1,fy],[t,3,3*fy],[e,1,xh]];function f(d,g,v){const y=g<d;y&&([d,g]=[g,d]);const x=v&&typeof v.range=="function"?v:h(d,g,v),S=x?x.range(d,+g+1):[];return y?S.reverse():S}function h(d,g,v){const y=Math.abs(g-d)/v,x=qu(([,,T])=>T).right(c,y);if(x===c.length)return e.every(Ih(d/xh,g/xh,v));if(x===0)return Uu.every(Math.max(Ih(d,g,v),1));const[S,_]=c[y/c[x-1][2]<c[x][2]/y?x-1:x];return S.every(_)}return[f,h]}const[DR,OR]=kR(Jr,Qm,tf,Ol,Wm,qm);function wh(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function _h(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function cl(e,t,i){return{y:e,m:t,d:i,H:0,M:0,S:0,L:0}}function jR(e){var t=e.dateTime,i=e.date,r=e.time,s=e.periods,l=e.days,c=e.shortDays,f=e.months,h=e.shortMonths,d=ul(s),g=fl(s),v=ul(l),y=fl(l),x=ul(c),S=fl(c),_=ul(f),T=fl(f),E=ul(h),C=fl(h),k={a:V,A:ie,b:ue,B:J,c:null,d:vy,e:vy,f:rk,g:mk,G:pk,H:tk,I:nk,j:ik,L:Lx,m:ak,M:sk,p:R,q:X,Q:xy,s:wy,S:ok,u:lk,U:ck,V:uk,w:fk,W:dk,x:null,X:null,y:hk,Y:gk,Z:vk,"%":by},B={a:ae,A:he,b:de,B:ve,c:null,d:yy,e:yy,f:wk,g:Rk,G:Dk,H:yk,I:bk,j:xk,L:Hx,m:_k,M:Sk,p:be,q:je,Q:xy,s:wy,S:Tk,u:Ek,U:zk,V:Mk,w:Ck,W:Ak,x:null,X:null,y:Nk,Y:kk,Z:Ok,"%":by},P={a:I,A:Y,b:O,B:j,c:L,d:gy,e:gy,f:KR,g:my,G:hy,H:py,I:py,j:IR,L:WR,m:ZR,M:XR,p:$,q:VR,Q:JR,s:ek,S:qR,u:$R,U:GR,V:YR,w:BR,W:FR,x:K,X:D,y:my,Y:hy,Z:PR,"%":QR};k.x=N(i,k),k.X=N(r,k),k.c=N(t,k),B.x=N(i,B),B.X=N(r,B),B.c=N(t,B);function N(se,Ee){return function(ze){var fe=[],dt=-1,Ue=0,ht=se.length,ut,qt,yi;for(ze instanceof Date||(ze=new Date(+ze));++dt<ht;)se.charCodeAt(dt)===37&&(fe.push(se.slice(Ue,dt)),(qt=dy[ut=se.charAt(++dt)])!=null?ut=se.charAt(++dt):qt=ut==="e"?" ":"0",(yi=Ee[ut])&&(ut=yi(ze,qt)),fe.push(ut),Ue=dt+1);return fe.push(se.slice(Ue,dt)),fe.join("")}}function U(se,Ee){return function(ze){var fe=cl(1900,void 0,1),dt=A(fe,se,ze+="",0),Ue,ht;if(dt!=ze.length)return null;if("Q"in fe)return new Date(fe.Q);if("s"in fe)return new Date(fe.s*1e3+("L"in fe?fe.L:0));if(Ee&&!("Z"in fe)&&(fe.Z=0),"p"in fe&&(fe.H=fe.H%12+fe.p*12),fe.m===void 0&&(fe.m="q"in fe?fe.q:0),"V"in fe){if(fe.V<1||fe.V>53)return null;"w"in fe||(fe.w=1),"Z"in fe?(Ue=_h(cl(fe.y,0,1)),ht=Ue.getUTCDay(),Ue=ht>4||ht===0?Bu.ceil(Ue):Bu(Ue),Ue=Km.offset(Ue,(fe.V-1)*7),fe.y=Ue.getUTCFullYear(),fe.m=Ue.getUTCMonth(),fe.d=Ue.getUTCDate()+(fe.w+6)%7):(Ue=wh(cl(fe.y,0,1)),ht=Ue.getDay(),Ue=ht>4||ht===0?Hu.ceil(Ue):Hu(Ue),Ue=Ol.offset(Ue,(fe.V-1)*7),fe.y=Ue.getFullYear(),fe.m=Ue.getMonth(),fe.d=Ue.getDate()+(fe.w+6)%7)}else("W"in fe||"U"in fe)&&("w"in fe||(fe.w="u"in fe?fe.u%7:"W"in fe?1:0),ht="Z"in fe?_h(cl(fe.y,0,1)).getUTCDay():wh(cl(fe.y,0,1)).getDay(),fe.m=0,fe.d="W"in fe?(fe.w+6)%7+fe.W*7-(ht+5)%7:fe.w+fe.U*7-(ht+6)%7);return"Z"in fe?(fe.H+=fe.Z/100|0,fe.M+=fe.Z%100,_h(fe)):wh(fe)}}function A(se,Ee,ze,fe){for(var dt=0,Ue=Ee.length,ht=ze.length,ut,qt;dt<Ue;){if(fe>=ht)return-1;if(ut=Ee.charCodeAt(dt++),ut===37){if(ut=Ee.charAt(dt++),qt=P[ut in dy?Ee.charAt(dt++):ut],!qt||(fe=qt(se,ze,fe))<0)return-1}else if(ut!=ze.charCodeAt(fe++))return-1}return fe}function $(se,Ee,ze){var fe=d.exec(Ee.slice(ze));return fe?(se.p=g.get(fe[0].toLowerCase()),ze+fe[0].length):-1}function I(se,Ee,ze){var fe=x.exec(Ee.slice(ze));return fe?(se.w=S.get(fe[0].toLowerCase()),ze+fe[0].length):-1}function Y(se,Ee,ze){var fe=v.exec(Ee.slice(ze));return fe?(se.w=y.get(fe[0].toLowerCase()),ze+fe[0].length):-1}function O(se,Ee,ze){var fe=E.exec(Ee.slice(ze));return fe?(se.m=C.get(fe[0].toLowerCase()),ze+fe[0].length):-1}function j(se,Ee,ze){var fe=_.exec(Ee.slice(ze));return fe?(se.m=T.get(fe[0].toLowerCase()),ze+fe[0].length):-1}function L(se,Ee,ze){return A(se,t,Ee,ze)}function K(se,Ee,ze){return A(se,i,Ee,ze)}function D(se,Ee,ze){return A(se,r,Ee,ze)}function V(se){return c[se.getDay()]}function ie(se){return l[se.getDay()]}function ue(se){return h[se.getMonth()]}function J(se){return f[se.getMonth()]}function R(se){return s[+(se.getHours()>=12)]}function X(se){return 1+~~(se.getMonth()/3)}function ae(se){return c[se.getUTCDay()]}function he(se){return l[se.getUTCDay()]}function de(se){return h[se.getUTCMonth()]}function ve(se){return f[se.getUTCMonth()]}function be(se){return s[+(se.getUTCHours()>=12)]}function je(se){return 1+~~(se.getUTCMonth()/3)}return{format:function(se){var Ee=N(se+="",k);return Ee.toString=function(){return se},Ee},parse:function(se){var Ee=U(se+="",!1);return Ee.toString=function(){return se},Ee},utcFormat:function(se){var Ee=N(se+="",B);return Ee.toString=function(){return se},Ee},utcParse:function(se){var Ee=U(se+="",!0);return Ee.toString=function(){return se},Ee}}}var dy={"-":"",_:" ",0:"0"},Dn=/^\s*\d+/,LR=/^%/,UR=/[\\^$*+?|[\]().{}]/g;function lt(e,t,i){var r=e<0?"-":"",s=(r?-e:e)+"",l=s.length;return r+(l<i?new Array(i-l+1).join(t)+s:s)}function HR(e){return e.replace(UR,"\\$&")}function ul(e){return new RegExp("^(?:"+e.map(HR).join("|")+")","i")}function fl(e){return new Map(e.map((t,i)=>[t.toLowerCase(),i]))}function BR(e,t,i){var r=Dn.exec(t.slice(i,i+1));return r?(e.w=+r[0],i+r[0].length):-1}function $R(e,t,i){var r=Dn.exec(t.slice(i,i+1));return r?(e.u=+r[0],i+r[0].length):-1}function GR(e,t,i){var r=Dn.exec(t.slice(i,i+2));return r?(e.U=+r[0],i+r[0].length):-1}function YR(e,t,i){var r=Dn.exec(t.slice(i,i+2));return r?(e.V=+r[0],i+r[0].length):-1}function FR(e,t,i){var r=Dn.exec(t.slice(i,i+2));return r?(e.W=+r[0],i+r[0].length):-1}function hy(e,t,i){var r=Dn.exec(t.slice(i,i+4));return r?(e.y=+r[0],i+r[0].length):-1}function my(e,t,i){var r=Dn.exec(t.slice(i,i+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),i+r[0].length):-1}function PR(e,t,i){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(i,i+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),i+r[0].length):-1}function VR(e,t,i){var r=Dn.exec(t.slice(i,i+1));return r?(e.q=r[0]*3-3,i+r[0].length):-1}function ZR(e,t,i){var r=Dn.exec(t.slice(i,i+2));return r?(e.m=r[0]-1,i+r[0].length):-1}function gy(e,t,i){var r=Dn.exec(t.slice(i,i+2));return r?(e.d=+r[0],i+r[0].length):-1}function IR(e,t,i){var r=Dn.exec(t.slice(i,i+3));return r?(e.m=0,e.d=+r[0],i+r[0].length):-1}function py(e,t,i){var r=Dn.exec(t.slice(i,i+2));return r?(e.H=+r[0],i+r[0].length):-1}function XR(e,t,i){var r=Dn.exec(t.slice(i,i+2));return r?(e.M=+r[0],i+r[0].length):-1}function qR(e,t,i){var r=Dn.exec(t.slice(i,i+2));return r?(e.S=+r[0],i+r[0].length):-1}function WR(e,t,i){var r=Dn.exec(t.slice(i,i+3));return r?(e.L=+r[0],i+r[0].length):-1}function KR(e,t,i){var r=Dn.exec(t.slice(i,i+6));return r?(e.L=Math.floor(r[0]/1e3),i+r[0].length):-1}function QR(e,t,i){var r=LR.exec(t.slice(i,i+1));return r?i+r[0].length:-1}function JR(e,t,i){var r=Dn.exec(t.slice(i));return r?(e.Q=+r[0],i+r[0].length):-1}function ek(e,t,i){var r=Dn.exec(t.slice(i));return r?(e.s=+r[0],i+r[0].length):-1}function vy(e,t){return lt(e.getDate(),t,2)}function tk(e,t){return lt(e.getHours(),t,2)}function nk(e,t){return lt(e.getHours()%12||12,t,2)}function ik(e,t){return lt(1+Ol.count(Jr(e),e),t,3)}function Lx(e,t){return lt(e.getMilliseconds(),t,3)}function rk(e,t){return Lx(e,t)+"000"}function ak(e,t){return lt(e.getMonth()+1,t,2)}function sk(e,t){return lt(e.getMinutes(),t,2)}function ok(e,t){return lt(e.getSeconds(),t,2)}function lk(e){var t=e.getDay();return t===0?7:t}function ck(e,t){return lt(tf.count(Jr(e)-1,e),t,2)}function Ux(e){var t=e.getDay();return t>=4||t===0?uo(e):uo.ceil(e)}function uk(e,t){return e=Ux(e),lt(uo.count(Jr(e),e)+(Jr(e).getDay()===4),t,2)}function fk(e){return e.getDay()}function dk(e,t){return lt(Hu.count(Jr(e)-1,e),t,2)}function hk(e,t){return lt(e.getFullYear()%100,t,2)}function mk(e,t){return e=Ux(e),lt(e.getFullYear()%100,t,2)}function gk(e,t){return lt(e.getFullYear()%1e4,t,4)}function pk(e,t){var i=e.getDay();return e=i>=4||i===0?uo(e):uo.ceil(e),lt(e.getFullYear()%1e4,t,4)}function vk(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+lt(t/60|0,"0",2)+lt(t%60,"0",2)}function yy(e,t){return lt(e.getUTCDate(),t,2)}function yk(e,t){return lt(e.getUTCHours(),t,2)}function bk(e,t){return lt(e.getUTCHours()%12||12,t,2)}function xk(e,t){return lt(1+Km.count(os(e),e),t,3)}function Hx(e,t){return lt(e.getUTCMilliseconds(),t,3)}function wk(e,t){return Hx(e,t)+"000"}function _k(e,t){return lt(e.getUTCMonth()+1,t,2)}function Sk(e,t){return lt(e.getUTCMinutes(),t,2)}function Tk(e,t){return lt(e.getUTCSeconds(),t,2)}function Ek(e){var t=e.getUTCDay();return t===0?7:t}function zk(e,t){return lt(jx.count(os(e)-1,e),t,2)}function Bx(e){var t=e.getUTCDay();return t>=4||t===0?fo(e):fo.ceil(e)}function Mk(e,t){return e=Bx(e),lt(fo.count(os(e),e)+(os(e).getUTCDay()===4),t,2)}function Ck(e){return e.getUTCDay()}function Ak(e,t){return lt(Bu.count(os(e)-1,e),t,2)}function Nk(e,t){return lt(e.getUTCFullYear()%100,t,2)}function Rk(e,t){return e=Bx(e),lt(e.getUTCFullYear()%100,t,2)}function kk(e,t){return lt(e.getUTCFullYear()%1e4,t,4)}function Dk(e,t){var i=e.getUTCDay();return e=i>=4||i===0?fo(e):fo.ceil(e),lt(e.getUTCFullYear()%1e4,t,4)}function Ok(){return"+0000"}function by(){return"%"}function xy(e){return+e}function wy(e){return Math.floor(+e/1e3)}var Is,Cl;jk({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function jk(e){return Is=jR(e),Cl=Is.format,Is.parse,Is.utcFormat,Is.utcParse,Is}function Lk(e){return new Date(e)}function Uk(e){return e instanceof Date?+e:+new Date(+e)}function $x(e,t,i,r,s,l,c,f,h,d){var g=Ox(),v=g.invert,y=g.domain,x=d(".%L"),S=d(":%S"),_=d("%I:%M"),T=d("%I %p"),E=d("%a %d"),C=d("%b %d"),k=d("%B"),B=d("%Y");function P(N){return(h(N)<N?x:f(N)<N?S:c(N)<N?_:l(N)<N?T:r(N)<N?s(N)<N?E:C:i(N)<N?k:B)(N)}return g.invert=function(N){return new Date(v(N))},g.domain=function(N){return arguments.length?y(Array.from(N,Uk)):y().map(Lk)},g.ticks=function(N){var U=y();return e(U[0],U[U.length-1],N??10)},g.tickFormat=function(N,U){return U==null?P:d(U)},g.nice=function(N){var U=y();return(!N||typeof N.range!="function")&&(N=t(U[0],U[U.length-1],N??10)),N?y(bR(U,N)):g},g.copy=function(){return Dx(g,$x(e,t,i,r,s,l,c,f,h,d))},g}function Gx(){return Ju.apply($x(DR,OR,Jr,Qm,tf,Ol,Wm,qm,eo,Cl).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function it(e){return function(){return e}}const _y=Math.abs,qn=Math.atan2,es=Math.cos,Hk=Math.max,Sh=Math.min,vr=Math.sin,to=Math.sqrt,mi=1e-12,Al=Math.PI,$u=Al/2,lu=2*Al;function Bk(e){return e>1?0:e<-1?Al:Math.acos(e)}function Sy(e){return e>=1?$u:e<=-1?-$u:Math.asin(e)}function Jm(e){let t=3;return e.digits=function(i){if(!arguments.length)return t;if(i==null)t=null;else{const r=Math.floor(i);if(!(r>=0))throw new RangeError(`invalid digits: ${i}`);t=r}return e},()=>new JN(t)}function $k(e){return e.innerRadius}function Gk(e){return e.outerRadius}function Yk(e){return e.startAngle}function Fk(e){return e.endAngle}function Pk(e){return e&&e.padAngle}function Vk(e,t,i,r,s,l,c,f){var h=i-e,d=r-t,g=c-s,v=f-l,y=v*h-g*d;if(!(y*y<mi))return y=(g*(t-l)-v*(e-s))/y,[e+y*h,t+y*d]}function Kc(e,t,i,r,s,l,c){var f=e-i,h=t-r,d=(c?l:-l)/to(f*f+h*h),g=d*h,v=-d*f,y=e+g,x=t+v,S=i+g,_=r+v,T=(y+S)/2,E=(x+_)/2,C=S-y,k=_-x,B=C*C+k*k,P=s-l,N=y*_-S*x,U=(k<0?-1:1)*to(Hk(0,P*P*B-N*N)),A=(N*k-C*U)/B,$=(-N*C-k*U)/B,I=(N*k+C*U)/B,Y=(-N*C+k*U)/B,O=A-T,j=$-E,L=I-T,K=Y-E;return O*O+j*j>L*L+K*K&&(A=I,$=Y),{cx:A,cy:$,x01:-g,y01:-v,x11:A*(s/P-1),y11:$*(s/P-1)}}function Ty(){var e=$k,t=Gk,i=it(0),r=null,s=Yk,l=Fk,c=Pk,f=null,h=Jm(d);function d(){var g,v,y=+e.apply(this,arguments),x=+t.apply(this,arguments),S=s.apply(this,arguments)-$u,_=l.apply(this,arguments)-$u,T=_y(_-S),E=_>S;if(f||(f=g=h()),x<y&&(v=x,x=y,y=v),!(x>mi))f.moveTo(0,0);else if(T>lu-mi)f.moveTo(x*es(S),x*vr(S)),f.arc(0,0,x,S,_,!E),y>mi&&(f.moveTo(y*es(_),y*vr(_)),f.arc(0,0,y,_,S,E));else{var C=S,k=_,B=S,P=_,N=T,U=T,A=c.apply(this,arguments)/2,$=A>mi&&(r?+r.apply(this,arguments):to(y*y+x*x)),I=Sh(_y(x-y)/2,+i.apply(this,arguments)),Y=I,O=I,j,L;if($>mi){var K=Sy($/y*vr(A)),D=Sy($/x*vr(A));(N-=K*2)>mi?(K*=E?1:-1,B+=K,P-=K):(N=0,B=P=(S+_)/2),(U-=D*2)>mi?(D*=E?1:-1,C+=D,k-=D):(U=0,C=k=(S+_)/2)}var V=x*es(C),ie=x*vr(C),ue=y*es(P),J=y*vr(P);if(I>mi){var R=x*es(k),X=x*vr(k),ae=y*es(B),he=y*vr(B),de;if(T<Al)if(de=Vk(V,ie,ae,he,R,X,ue,J)){var ve=V-de[0],be=ie-de[1],je=R-de[0],se=X-de[1],Ee=1/vr(Bk((ve*je+be*se)/(to(ve*ve+be*be)*to(je*je+se*se)))/2),ze=to(de[0]*de[0]+de[1]*de[1]);Y=Sh(I,(y-ze)/(Ee-1)),O=Sh(I,(x-ze)/(Ee+1))}else Y=O=0}U>mi?O>mi?(j=Kc(ae,he,V,ie,x,O,E),L=Kc(R,X,ue,J,x,O,E),f.moveTo(j.cx+j.x01,j.cy+j.y01),O<I?f.arc(j.cx,j.cy,O,qn(j.y01,j.x01),qn(L.y01,L.x01),!E):(f.arc(j.cx,j.cy,O,qn(j.y01,j.x01),qn(j.y11,j.x11),!E),f.arc(0,0,x,qn(j.cy+j.y11,j.cx+j.x11),qn(L.cy+L.y11,L.cx+L.x11),!E),f.arc(L.cx,L.cy,O,qn(L.y11,L.x11),qn(L.y01,L.x01),!E))):(f.moveTo(V,ie),f.arc(0,0,x,C,k,!E)):f.moveTo(V,ie),!(y>mi)||!(N>mi)?f.lineTo(ue,J):Y>mi?(j=Kc(ue,J,R,X,y,-Y,E),L=Kc(V,ie,ae,he,y,-Y,E),f.lineTo(j.cx+j.x01,j.cy+j.y01),Y<I?f.arc(j.cx,j.cy,Y,qn(j.y01,j.x01),qn(L.y01,L.x01),!E):(f.arc(j.cx,j.cy,Y,qn(j.y01,j.x01),qn(j.y11,j.x11),!E),f.arc(0,0,y,qn(j.cy+j.y11,j.cx+j.x11),qn(L.cy+L.y11,L.cx+L.x11),E),f.arc(L.cx,L.cy,Y,qn(L.y11,L.x11),qn(L.y01,L.x01),!E))):f.arc(0,0,y,P,B,E)}if(f.closePath(),g)return f=null,g+""||null}return d.centroid=function(){var g=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,v=(+s.apply(this,arguments)+ +l.apply(this,arguments))/2-Al/2;return[es(v)*g,vr(v)*g]},d.innerRadius=function(g){return arguments.length?(e=typeof g=="function"?g:it(+g),d):e},d.outerRadius=function(g){return arguments.length?(t=typeof g=="function"?g:it(+g),d):t},d.cornerRadius=function(g){return arguments.length?(i=typeof g=="function"?g:it(+g),d):i},d.padRadius=function(g){return arguments.length?(r=g==null?null:typeof g=="function"?g:it(+g),d):r},d.startAngle=function(g){return arguments.length?(s=typeof g=="function"?g:it(+g),d):s},d.endAngle=function(g){return arguments.length?(l=typeof g=="function"?g:it(+g),d):l},d.padAngle=function(g){return arguments.length?(c=typeof g=="function"?g:it(+g),d):c},d.context=function(g){return arguments.length?(f=g??null,d):f},d}function e0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Yx(e){this._context=e}Yx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Fx(e){return new Yx(e)}function Px(e){return e[0]}function Vx(e){return e[1]}function t0(e,t){var i=it(!0),r=null,s=Fx,l=null,c=Jm(f);e=typeof e=="function"?e:e===void 0?Px:it(e),t=typeof t=="function"?t:t===void 0?Vx:it(t);function f(h){var d,g=(h=e0(h)).length,v,y=!1,x;for(r==null&&(l=s(x=c())),d=0;d<=g;++d)!(d<g&&i(v=h[d],d,h))===y&&((y=!y)?l.lineStart():l.lineEnd()),y&&l.point(+e(v,d,h),+t(v,d,h));if(x)return l=null,x+""||null}return f.x=function(h){return arguments.length?(e=typeof h=="function"?h:it(+h),f):e},f.y=function(h){return arguments.length?(t=typeof h=="function"?h:it(+h),f):t},f.defined=function(h){return arguments.length?(i=typeof h=="function"?h:it(!!h),f):i},f.curve=function(h){return arguments.length?(s=h,r!=null&&(l=s(r)),f):s},f.context=function(h){return arguments.length?(h==null?r=l=null:l=s(r=h),f):r},f}function Zk(e,t,i){var r=null,s=it(!0),l=null,c=Fx,f=null,h=Jm(d);e=typeof e=="function"?e:e===void 0?Px:it(+e),t=typeof t=="function"?t:it(t===void 0?0:+t),i=typeof i=="function"?i:i===void 0?Vx:it(+i);function d(v){var y,x,S,_=(v=e0(v)).length,T,E=!1,C,k=new Array(_),B=new Array(_);for(l==null&&(f=c(C=h())),y=0;y<=_;++y){if(!(y<_&&s(T=v[y],y,v))===E)if(E=!E)x=y,f.areaStart(),f.lineStart();else{for(f.lineEnd(),f.lineStart(),S=y-1;S>=x;--S)f.point(k[S],B[S]);f.lineEnd(),f.areaEnd()}E&&(k[y]=+e(T,y,v),B[y]=+t(T,y,v),f.point(r?+r(T,y,v):k[y],i?+i(T,y,v):B[y]))}if(C)return f=null,C+""||null}function g(){return t0().defined(s).curve(c).context(l)}return d.x=function(v){return arguments.length?(e=typeof v=="function"?v:it(+v),r=null,d):e},d.x0=function(v){return arguments.length?(e=typeof v=="function"?v:it(+v),d):e},d.x1=function(v){return arguments.length?(r=v==null?null:typeof v=="function"?v:it(+v),d):r},d.y=function(v){return arguments.length?(t=typeof v=="function"?v:it(+v),i=null,d):t},d.y0=function(v){return arguments.length?(t=typeof v=="function"?v:it(+v),d):t},d.y1=function(v){return arguments.length?(i=v==null?null:typeof v=="function"?v:it(+v),d):i},d.lineX0=d.lineY0=function(){return g().x(e).y(t)},d.lineY1=function(){return g().x(e).y(i)},d.lineX1=function(){return g().x(r).y(t)},d.defined=function(v){return arguments.length?(s=typeof v=="function"?v:it(!!v),d):s},d.curve=function(v){return arguments.length?(c=v,l!=null&&(f=c(l)),d):c},d.context=function(v){return arguments.length?(v==null?l=f=null:f=c(l=v),d):l},d}function Ik(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function Xk(e){return e}function qk(){var e=Xk,t=Ik,i=null,r=it(0),s=it(lu),l=it(0);function c(f){var h,d=(f=e0(f)).length,g,v,y=0,x=new Array(d),S=new Array(d),_=+r.apply(this,arguments),T=Math.min(lu,Math.max(-lu,s.apply(this,arguments)-_)),E,C=Math.min(Math.abs(T)/d,l.apply(this,arguments)),k=C*(T<0?-1:1),B;for(h=0;h<d;++h)(B=S[x[h]=h]=+e(f[h],h,f))>0&&(y+=B);for(t!=null?x.sort(function(P,N){return t(S[P],S[N])}):i!=null&&x.sort(function(P,N){return i(f[P],f[N])}),h=0,v=y?(T-d*k)/y:0;h<d;++h,_=E)g=x[h],B=S[g],E=_+(B>0?B*v:0)+k,S[g]={data:f[g],index:h,value:B,startAngle:_,endAngle:E,padAngle:C};return S}return c.value=function(f){return arguments.length?(e=typeof f=="function"?f:it(+f),c):e},c.sortValues=function(f){return arguments.length?(t=f,i=null,c):t},c.sort=function(f){return arguments.length?(i=f,t=null,c):i},c.startAngle=function(f){return arguments.length?(r=typeof f=="function"?f:it(+f),c):r},c.endAngle=function(f){return arguments.length?(s=typeof f=="function"?f:it(+f),c):s},c.padAngle=function(f){return arguments.length?(l=typeof f=="function"?f:it(+f),c):l},c}function Ey(e){return e<0?-1:1}function zy(e,t,i){var r=e._x1-e._x0,s=t-e._x1,l=(e._y1-e._y0)/(r||s<0&&-0),c=(i-e._y1)/(s||r<0&&-0),f=(l*s+c*r)/(r+s);return(Ey(l)+Ey(c))*Math.min(Math.abs(l),Math.abs(c),.5*Math.abs(f))||0}function My(e,t){var i=e._x1-e._x0;return i?(3*(e._y1-e._y0)/i-t)/2:t}function Th(e,t,i){var r=e._x0,s=e._y0,l=e._x1,c=e._y1,f=(l-r)/3;e._context.bezierCurveTo(r+f,s+f*t,l-f,c-f*i,l,c)}function Gu(e){this._context=e}Gu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Th(this,this._t0,My(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var i=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Th(this,My(this,i=zy(this,e,t)),i);break;default:Th(this,this._t0,i=zy(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=i}}};Object.create(Gu.prototype).point=function(e,t){Gu.prototype.point.call(this,t,e)};function om(e){return new Gu(e)}function yl(e,t,i){this.k=e,this.x=t,this.y=i}yl.prototype={constructor:yl,scale:function(e){return e===1?this:new yl(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new yl(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};yl.prototype;const Wk="4px",Kk=6,Qk=80,Jk=24;function eD({data:e,className:t,CellComponent:i,getColorValue:r,gap:s=Kk,showLabels:l=!1,rowLabelWidth:c=Qk,columnLabelHeight:f=Jk}){const h=M.useRef(null),[,d]=M.useTransition(),[g,v]=M.useState({width:0,height:0});M.useEffect(()=>{const A=h.current;if(A){const $=new ResizeObserver(()=>{d(()=>{v({width:A.offsetWidth,height:A.offsetHeight})})});return $.observe(A),()=>{$.disconnect()}}},[]);const{uniqueRows:y,uniqueColumns:x,rowToIndex:S,columnToIndex:_}=M.useMemo(()=>{const A=new Set,$=new Set,I=[],Y=[];for(const L of e)A.has(L.row)||(A.add(L.row),I.push(L.row)),$.has(L.column)||($.add(L.column),Y.push(L.column));const O=new Map(I.map((L,K)=>[L,K])),j=new Map(Y.map((L,K)=>[L,K]));return{uniqueRows:I,uniqueColumns:Y,rowToIndex:O,columnToIndex:j}},[e]),T=M.useMemo(()=>{const A=l?c:0,$=l?f:0;return{x:A,y:$,width:Math.max(0,g.width-A),height:Math.max(0,g.height-$)}},[g,l,c,f]),E=M.useMemo(()=>{const A=x.length,$=y.length,I=A>1?s*(A-1)/(T.width-s*(A-1)+s*A):0,Y=$>1?s*($-1)/(T.height-s*($-1)+s*$):0,O=am().domain(x).range([0,T.width]).paddingInner(Math.min(I,.5)).paddingOuter(0),j=am().domain(y).range([0,T.height]).paddingInner(Math.min(Y,.5)).paddingOuter(0);return{xScale:O,yScale:j}},[y,x,T,s]),C=M.useMemo(()=>{const A=e.map(D=>r?r(D):D.value),$=A.filter(D=>D>=0),I=A.filter(D=>D<0),Y=$.length>0?Math.min(...$):0,O=$.length>0?Math.max(...$):0,j=I.length>0?Math.min(...I):0,L=I.length>0?Math.max(...I):0,K=D=>D<0?L===j?1:(D-L)/(j-L):O===Y?1:(D-Y)/(O-Y);return e.map(D=>{const V=r?r(D):D.value,ie=K(V),ue=V>=0;return{cell:D,colorValue:V,intensity:ie,isPositive:ue}})},[e,r]),k=(A,$,I)=>{const Y=R=>{var X;return((X=R.match(/[A-F0-9]{2}/gi))==null?void 0:X.map(ae=>parseInt(ae,16)))||[0,0,0]},[O,j,L]=Y(A),[K,D,V]=Y($),ie=Math.round(K*I+O*(1-I)),ue=Math.round(D*I+j*(1-I)),J=Math.round(V*I+L*(1-I));return`#${[ie,ue,J].map(R=>R.toString(16).padStart(2,"0")).join("")}`},B=(A,$)=>{if($)return A>=.75?.1:A>=.6?.2:A>=.5?.3:A>=.25?.4:A>=.1?.45:.5;{const I=1-A;return I>=.75?.6:I>=.5?.4:I>=.25?.3:.2}},P=M.useMemo(()=>{const{xScale:A,yScale:$}=E;return C.map(({cell:I,intensity:Y,isPositive:O})=>{const j=A(I.column),L=$(I.row),K=A.bandwidth(),D=$.bandwidth();if(j===void 0||L===void 0||K<=0||D<=0)return null;const V=S.get(I.row)??0,ie=_.get(I.column)??0,ue=B(Y,O),J=k(O?"#25A78D":"#F21553","#000000",ue);return b.jsx("div",{className:"group absolute cursor-pointer border border-transparent hover:bg-[radial-gradient(146.13%_118.42%_at_50%_-15.5%,rgba(255,255,255,0.1)_0%,rgba(255,255,255,0)_99.59%)] hover:bg-gradient-to-t",style:{left:T.x+j,top:T.y+L,width:K,height:D,borderRadius:Wk,backgroundColor:J},children:b.jsx(i,{width:K,height:D,data:I,rowIndex:V,columnIndex:ie,colorIntensity:Y,isPositive:O})},I.id)})},[C,E,T,S,_,i]),N=M.useMemo(()=>{if(!l)return null;const{yScale:A}=E;return y.map($=>{const I=A($),Y=A.bandwidth();return I===void 0?null:b.jsx("div",{className:"absolute flex items-center justify-end pr-2 text-xs text-white/60",style:{left:0,top:T.y+I,width:c,height:Y},children:b.jsx("span",{className:"truncate",children:$})},`row-${$}`)})},[l,y,E,T,c]),U=M.useMemo(()=>{if(!l)return null;const{xScale:A}=E;return x.map($=>{const I=A($),Y=A.bandwidth();return I===void 0?null:b.jsx("div",{className:"absolute flex items-end justify-center pb-1 text-xs text-white/60",style:{left:T.x+I,top:0,width:Y,height:f},children:b.jsx("span",{className:"truncate",children:$})},`col-${$}`)})},[l,x,E,T,f]);return b.jsx("div",{className:ai("h-full w-full",t),ref:h,children:b.jsxs("div",{className:"relative space-x-2 space-y-2 overflow-hidden",style:{height:g.height,width:g.width},children:[N,U,P]})})}const tD=eD,Na={top:20,right:110,bottom:40,left:50},n0={sm:640},Eh={height:400,yAxisPadding:15,fontSize:12},Cy={rectHeight:22,paddingX:4},nD={offsetX:80},Qc={ticks:6,opacity:.05,color:"#FFFFFF"},hi={xTicks:5,xSubTicks:36,yTicks:5,tickSize:10,subTickSize:6,tickColor:"#404146",domainColor:"#FFFFFF",domainOpacity:.05,textOpacity:.5},Ay=1e12,Ny=1e9,zh=1e6,ls=e=>e==null?"-":e===0?"0":e<.001?rD(e):e<1||e<10?parseFloat(e.toPrecision(4)).toString():e<zh?e.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:2}):e>Ay?`${(e/Ay).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}T`:e>Ny?`${(e/Ny).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}B`:e>zh?`${(e/zh).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}M`:e.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:0}),iD=e=>{const t=["₀","₁","₂","₃","₄","₅","₆","₇","₈","₉"];return e.toString().split("").map(i=>t[parseInt(i)]).join("")},rD=e=>{const t=e<0,r=Math.abs(e).toFixed(20).replace(/\.?0+$/,""),s=r.match(/^0\.0+/);if(s){const l=s[0].length-2,f=r.slice(s[0].length).slice(0,3).replace(/0+$/,""),h=`0.${iD(l)}${f}`;return t?`-${h}`:h}return Number.isInteger(e)?String(e):String(Math.round(e*100)/100)},aD=({width:e,height:t=Eh.height,yDomain:i,formatValue:r,containerRef:s,svgRef:l})=>{const[c,f]=M.useState(e);M.useLayoutEffect(()=>{const S=()=>{if(s.current){const _=s.current.getBoundingClientRect();f(_.width)}};return S(),window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[s]);const h=S=>{const _=rr(l.current);if(!_.node())return Na.left;const T=_.append("text").style("font-size",`${Eh.fontSize}px`).style("font-family","var(--font-dmsans)").style("font-weight","700").style("visibility","hidden"),[E,C]=S.domain(),k=[],B=5;for(let N=0;N<B;N++){const U=E+(C-E)/(B-1)*N;k.push(U)}let P=0;return k.forEach(N=>{var $;const U=r?r(N):ls(N);T.text(U);const A=(($=T.node())==null?void 0:$.getBBox().width)||0;P=Math.max(P,A)}),T.remove(),Math.ceil(P)+Eh.yAxisPadding};let d=c??null;if(!d&&s.current){const S=s.current.getBoundingClientRect();S.width>0&&(d=S.width)}d=d||e||null;const g=t-Na.top-Na.bottom,v=ef().domain(i).range([g,0]),y=d&&d>0?h(v):null,x=d&&d>0&&y&&y>0?d-y-(d>640?Na.right:20):null;return{width:d,height:t,innerWidth:x,innerHeight:g,dynamicLeftMargin:y}},sD=e=>{const t=M.useMemo(()=>{const c=new Set;return e.forEach(f=>{f.seriesGroup&&c.add(f.seriesGroup)}),Array.from(c)},[e]),[i,r]=M.useState(()=>new Set(t));M.useEffect(()=>{r(c=>{const f=new Set(c);return t.forEach(h=>{f.has(h)||f.add(h)}),f})},[t]);const s=M.useMemo(()=>e.filter(c=>c.seriesGroup?i.has(c.seriesGroup):!0),[e,i]);return{seriesGroups:t,visibleGroups:i,filteredSeries:s,toggleGroup:c=>{r(f=>{const h=new Set(f);return h.has(c)?h.delete(c):h.add(c),h})}}},oD=e=>({seriesColors:M.useMemo(()=>e.reduce((i,r)=>(i[r.id]=r.color,i),{}),[e]),isColorLoading:!1}),lD=({group:e,isVisible:t,onClick:i})=>b.jsxs("button",{onClick:i,className:ai("flex cursor-pointer items-center justify-center gap-2 text-xs font-semibold",t?"text-white":"text-white/30"),children:[b.jsx("div",{className:ai("h-3 w-3",t?"bg-white/80":"bg-white/30")}),e]}),cD=lD;var Ra=(e=>(e["30m"]="30m",e["24h"]="24h",e["3D"]="3D",e["7D"]="7D",e["1M"]="1M",e["3M"]="3M",e.YTD="YTD",e))(Ra||{});const uD=(e,t)=>{const i=new Date(e);return t===Ra["24h"]?Cl("%H:%M")(i):Cl("%b %d")(i)},fD=(e,t=.1)=>{const i=e.map(h=>h.value),r=xC(i)||0,s=bC(i)||0,l=s-r,c=s+l*t;let f=r-l*t;return r>=0&&f<0&&(f=0),[f,c]},yr=["#3B82F6","#10B981","#F59E0B","#EF4444","#8B5CF6","#06B6D4","#84CC16","#F97316"],dD=(e,t)=>uD(e,t),Ry=(e,t)=>{const i=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),s=parseInt(e.slice(5,7),16);return`rgba(${i}, ${r}, ${s}, ${t})`},hD=e=>{const t=e.flatMap(i=>i.data);return fD(t)},mD=e=>{const t=new Set;return e.forEach(i=>{i.data.forEach(r=>t.add(r.date))}),Array.from(t).sort()},gD=(e,t)=>e.map(i=>{const r={};return t.forEach(s=>{const l=s.data.find(c=>c.date===i);r[s.id]=l?l.value:0}),{date:new Date(i),values:r}}),pD=(e,t,i)=>{const r=t.invert(e),s=qu(h=>h.date).left,l=s(i,r,1),c=i[l-1],f=i[l];return!c||!f?null:r.getTime()-c.date.getTime()>f.date.getTime()-r.getTime()?f:c},lm=(e,t)=>{const i=t===e,r=t!==null&&t!==e;return i?1:r?.3:1},vD=({legendItems:e,containerWidth:t,hoveredSeriesId:i,onSeriesHover:r,onLabelClick:s,unitPrefix:l,unitSuffix:c,legendRef:f})=>t&&t>n0.sm?b.jsx("div",{className:ai("pointer-events-none absolute left-0 top-0 w-full flex-wrap items-center gap-2 max-sm:overflow-hidden"),children:e.map(d=>b.jsx("div",{className:ai("pointer-events-auto absolute flex h-[22px] w-fit cursor-pointer items-center justify-center gap-1 rounded-[11px] px-[5px] py-1 transition-opacity duration-200 ease-out"),style:{left:`${d.left}px`,top:`${d.top}px`,backgroundColor:Ry(d.color,.3),opacity:lm(d.id,i)},onClick:()=>s==null?void 0:s(d.id),onPointerEnter:g=>{g.preventDefault(),g.stopPropagation(),r(d.id)},onPointerLeave:g=>{g.preventDefault(),g.stopPropagation(),r(null)},children:b.jsxs("div",{className:"relative flex select-none items-center justify-center gap-1",children:[d.seriesData.iconImageUrl&&b.jsx("div",{className:"size-4 rounded-full",children:b.jsx("img",{src:d.seriesData.iconImageUrl,width:16,height:16,alt:d.seriesData.name,className:"size-4 rounded-full",draggable:!1})}),b.jsxs("div",{className:"text-normal relative flex items-center justify-center whitespace-nowrap text-[11px] font-semibold leading-4",children:[b.jsx("span",{className:ai("mr-1 max-w-12 truncate",d.seriesData.iconImageUrl?"max-w-10":"max-w-12"),children:d.displayText}),l&&b.jsx("span",{className:"mr-0.5 [&_svg]:!text-white/70",children:l}),b.jsx("span",{children:d.value}),c&&b.jsx("span",{children:c})]})]})},d.id))}):b.jsx("div",{className:ai("pointer-events-none left-0 top-0 flex w-full flex-wrap items-center gap-1 max-sm:overflow-hidden"),ref:f,children:e.map(d=>b.jsx("div",{className:ai("pointer-events-auto flex h-[22px] w-fit min-w-[112px] cursor-pointer items-center gap-1 rounded-[11px] px-[5px] py-1 transition-opacity duration-200 ease-out"),style:{backgroundColor:Ry(d.color,.3),opacity:lm(d.id,i)},onClick:()=>s==null?void 0:s(d.id),onPointerEnter:g=>{g.preventDefault(),g.stopPropagation(),r(d.id)},onPointerLeave:g=>{g.preventDefault(),g.stopPropagation(),r(null)},children:b.jsxs("div",{className:"relative flex select-none items-center gap-1",children:[d.seriesData.iconImageUrl&&b.jsx("div",{className:"size-4 rounded-full",children:b.jsx("img",{src:d.seriesData.iconImageUrl,width:16,height:16,alt:d.seriesData.name,className:"size-4 rounded-full",draggable:!1})}),b.jsxs("div",{className:"text-normal relative flex items-center whitespace-nowrap text-[11px] font-semibold leading-none",children:[b.jsx("span",{className:ai("mr-1 max-w-12 truncate",d.seriesData.iconImageUrl?"max-w-10":"max-w-12"),children:d.displayText}),b.jsx("span",{"data-legend-value":d.id,children:d.value}),c&&b.jsx("span",{children:c})]})]})},d.id))}),yD=vD,bD=({containerWidth:e,tooltipRef:t,series:i,seriesColors:r,unitPrefix:s,unitSuffix:l})=>e&&e>n0.sm?b.jsx("div",{ref:t,className:"pointer-events-none absolute left-0 top-0 z-50 rounded-md bg-slate-700 px-6 py-3 text-xs text-white opacity-0 transition-opacity duration-300",children:b.jsxs("div",{className:"flex flex-col gap-3",children:[b.jsx("div",{className:"body-md font-semibold text-white/50","data-tooltip-date":!0}),b.jsx("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5",children:i.map(f=>b.jsxs(PS.Fragment,{children:[b.jsxs("span",{className:"text-soft flex max-w-[126px] items-center gap-1",children:[b.jsx("div",{className:"h-full w-0.5 rounded-full",style:{backgroundColor:r[f.id]}}),f.iconImageUrl&&b.jsx("img",{src:f.iconImageUrl,width:20,height:20,alt:f.name,className:"rounded-full"}),b.jsx("span",{className:"text-normal body-sm font-bold capitalize",children:f.name})]}),b.jsxs("div",{className:"font-dmsans text-normal flex flex-row items-center font-bold",children:[b.jsx("div",{className:"mr-1",children:s}),b.jsx("span",{className:"text-normal text-right text-xs font-bold","data-tooltip-value":f.id}),l]})]},f.id))})]})}):b.jsx("div",{ref:t,className:"pointer-events-none absolute left-0 top-0 z-50 min-w-[130px] rounded-md bg-slate-700 px-2 py-1 text-xs text-white opacity-0 transition-opacity duration-300 ease-out",children:b.jsx("div",{className:"flex flex-col items-center justify-center gap-3",children:b.jsx("div",{className:"caption font-semibold text-white/50","data-tooltip-date":!0})})}),xD=bD,wD=(e,t,i,r)=>{const s=Gx().domain(Vh(e,c=>c.date)).range([0,i]),l=ef().domain(t).range([r,0]);return{xScale:s,yScale:l}},_D=(e,t,i)=>{const[r,s]=t.domain(),l=[];for(let c=0;c<Qc.ticks;c++){const f=r+(s-r)/(Qc.ticks-1)*c;l.push(f)}e.append("g").attr("class","grid").call(nx(t).tickValues(l).tickSize(-i).tickFormat(()=>"")).call(c=>c.select(".domain").remove()).selectAll("line").attr("stroke",Qc.color).attr("stroke-opacity",Qc.opacity)},SD=(e,t,i,r,s,l,c)=>{const f=c!==void 0?Math.max(2,Math.min(hi.xTicks,Math.floor(c/70))):hi.xTicks,h=e.append("g").attr("transform",`translate(0,${r})`).call(G1(t).ticks(f).tickSize(hi.tickSize).tickFormat(_=>_ instanceof Date?dD(_.toISOString(),s):String(_))).style("font-size","12px").style("font-weight","700").style("font-family","var(--font-manrope)");h.select(".domain").attr("stroke",hi.domainColor).attr("stroke-width",1).attr("stroke-opacity",hi.domainOpacity),h.selectAll(".tick line").attr("stroke",hi.tickColor).attr("transform","translate(0, 4)"),h.selectAll(".tick text").attr("dy","1.2em").style("fill",hi.domainColor).style("opacity",hi.textOpacity);const d=e.append("g").attr("transform",`translate(0,${r})`).call(G1(t).ticks(hi.xSubTicks).tickSize(hi.subTickSize).tickFormat(()=>""));d.select(".domain").remove(),d.selectAll(".tick line").attr("stroke",hi.tickColor).attr("transform","translate(0, 4)");const[g,v]=i.domain(),y=[],x=5;for(let _=0;_<x;_++){const T=g+(v-g)/(x-1)*_;y.push(T)}const S=e.append("g").call(nx(i).tickValues(y).tickSize(hi.yTicks).tickFormat(_=>l?l(_):ls(_))).style("font-size","12px").style("color",hi.domainColor).style("font-family","var(--font-dmsans)").style("opacity",hi.textOpacity).style("font-weight","700");S.select(".domain").attr("stroke","none"),S.selectAll(".tick line").attr("stroke","none")},TD=(e,t,i,r,s)=>{const l=t0().x(c=>r(c.date)).y(c=>s(c.value)).curve(om);t.forEach(c=>{const f=c.data.map(v=>({date:new Date(v.date),value:v.value})),h=i[c.id],d=e.append("path").datum(f).attr("fill","none").attr("stroke",h).attr("stroke-width",1.2).attr("opacity",1).attr("data-series-id",c.id).attr("d",l),g=d.node().getTotalLength();d.attr("stroke-dasharray",g+" "+g).attr("stroke-dashoffset",g),d.transition("draw").duration(1200).ease(Ax).attr("stroke-dashoffset",0).on("end",function(){rr(this).attr("stroke-dasharray",null)})})},ED=({g:e,containerWidth:t,innerWidth:i,innerHeight:r,xScale:s,yScale:l,combinedData:c,filteredSeries:f,tooltipRef:h,containerRef:d,legendRef:g,highestValue:v,formatValue:y})=>{var L;const x=e.append("line").attr("class","hover-line").attr("stroke","white").attr("stroke-width",1).attr("stroke-dasharray","4,4").attr("stroke-opacity",.6).attr("x1",0).attr("y1",0).attr("x2",0).attr("y2",r).attr("opacity",0),S=e.append("g").attr("class","hover-dots");let _=!0,T=((L=d.current)==null?void 0:L.getBoundingClientRect().width)||i,E=0,C=0;const k=K=>{_?(x.attr("x1",K-.75),x.attr("x2",K-.75),x.transition().duration(150).ease(nm).attr("opacity",1),_=!1):x.transition().duration(100).ease(iy).attr("x1",K-.75).attr("x2",K-.75).attr("opacity",1)},B=(K,D)=>{const ie=S.selectAll("g.hover-circle-group").data(f.filter(J=>K.values[J.id]!==void 0));ie.exit().remove();const ue=ie.enter().append("g").attr("class","hover-circle-group").style("opacity",0);ue.append("circle").attr("class","hover-dot-glow").attr("r",9).attr("fill","white").attr("fill-opacity",.18),ue.append("circle").attr("class","hover-dot-core").attr("r",4.5).attr("fill","white").attr("stroke","rgba(10, 12, 20, 0.55)").attr("stroke-width",1.5),ue.attr("transform",J=>{const R=K.values[J.id];return`translate(${D}, ${l(R)}) scale(0.5)`}).style("opacity",1).transition().duration(200).ease(IN).attr("transform",J=>{const R=K.values[J.id];return`translate(${D}, ${l(R)}) scale(1)`}),ie.transition().duration(100).ease(iy).attr("transform",J=>{const R=K.values[J.id];return`translate(${D}, ${l(R)})`})},P=(K,D)=>{h.current&&E===0&&C===0&&(E=h.current.getBoundingClientRect().height,C=h.current.getBoundingClientRect().width);let V=K+nD.offsetX;return V+C>T&&(V=K-C),V<0&&(V=0),{x:V,y:D-E/2+20}},N=K=>{let V=K-65+Na.left;const ie=l(v);return K+130/2>T-Na.left&&(V=T-130),V<0&&(V=0),{x:V,y:ie}},U=(K,D)=>{if(!h.current)return;const V=h.current.querySelector("[data-tooltip-date]");V&&V.textContent!==K&&(V.textContent=K),f.forEach(ie=>{var X;const ue=D[ie.id];if(ue===void 0)return;const J=(X=h.current)==null?void 0:X.querySelector(`[data-tooltip-value="${ie.id}"]`),R=y?y(ue):ls(ue);J&&J.textContent!==R&&(J.textContent=R)})},A=K=>{if(!h.current)return;const D=h.current.querySelector("[data-tooltip-date]");D&&D.textContent!==K&&(D.textContent=K)},$=K=>{g.current&&f.forEach(D=>{var ue;const V=K[D.id];if(V===void 0)return;const ie=(ue=g.current)==null?void 0:ue.querySelector(`[data-legend-value="${D.id}"]`);if(ie){const J=y?y(V):ls(V);ie.textContent=J}})},I=(K,D)=>{h.current&&(h.current.style.opacity="1",h.current.style.transform=`translate3d(${K}px, ${D}px, 0)`)},Y=K=>{const V=window.TouchEvent&&K instanceof TouchEvent?K.touches[0]:K,[ie,ue]=uA(V,e.node()),J=pD(ie,s,c);if(!J)return;const R=s(J.date),X=Cl("%b %d, %Y - %H:%M")(J.date);if(t>n0.sm){const ae=P(ie,ue);I(ae.x,ae.y),U(X,J.values)}else{const ae=N(ie);I(ae.x,ae.y),A(X),$(J.values)}k(R),B(J,R)},O=()=>{x.transition().duration(150).ease(nm).attr("opacity",0),_=!0,h.current&&(h.current.style.opacity="0"),S.selectAll("g").transition().duration(150).ease(ZN).style("opacity",0).attr("transform",(K,D,V)=>{const ue=rr(V[D]).attr("transform"),J=ue.match(/translate\(([^,]+),\s*([^)]+)\)/);if(J){const R=parseFloat(J[1]),X=parseFloat(J[2]);return`translate(${R}, ${X}) scale(0.3)`}return ue}).remove()},j=new ResizeObserver(()=>{d.current&&(T=d.current.getBoundingClientRect().width)});return d.current&&j.observe(d.current),{onMouseMove:Y,onMouseLeave:O,destroy:()=>j.disconnect()}},zD=(e,t,{xScale:i,yScale:r},s,l,c)=>{const f=Cy.rectHeight,h=Cy.paddingX,d=[];return e.forEach(v=>{const y=v.data.map(x=>({date:new Date(x.date),value:x.value}));if(y.length>0){const x=y[y.length-1],S=i(x.date)+8,_=r(x.value),T=S-h;let E=_-f/2;const C=d.findLast(k=>E+f>=k.top&&E<=k.bottom);C&&(E=C.top+f),d.push({top:E,bottom:E+f,id:v.id,left:T})}}),d.reverse().reduce((v,y)=>{const x=v.find(S=>y.top+f>=S.top&&y.top<=S.bottom&&S.id!==y.id);return x&&(y.top=x.top-f),[y,...v]},[]),d.map(v=>{var _,T;const y=e.find(E=>E.id===v.id);if(!y)return null;const x=t[v.id],S=c?c(((_=y.data.at(-1))==null?void 0:_.value)??0):ls(((T=y.data.at(-1))==null?void 0:T.value)??0);return{id:v.id,left:v.left+s,top:v.top+l,seriesData:y,color:x,value:S,displayText:y.name}}).filter(Boolean)},MD=({className:e})=>b.jsx("div",{className:ai("relative size-8",e),children:b.jsx("div",{className:"absolute left-1/2 top-1/2 flex size-12 -translate-x-1/2 -translate-y-1/2 items-center justify-center",children:b.jsxs("div",{className:"relative h-6 w-full",children:[Array.from({length:5}).map((t,i)=>b.jsx("div",{className:"absolute size-1.5 rounded-full will-change-transform",style:{left:`${i/6*100}%`,animation:`dnaStrand1Move 2s infinite ease-in-out ${-i*.2}s, dnaStrand1Scale 2s infinite ease-in-out ${-i*.2}s, dnaStrand1Color 2s infinite ease-in-out ${-i*.2}s`}},`strand1-${i}`)),Array.from({length:5}).map((t,i)=>b.jsx("div",{className:"absolute size-1.5 rounded-full",style:{left:`${i/6*100}%`,animation:`dnaStrand2Move 2s infinite ease-in-out ${-i*.2}s, dnaStrand2Scale 2s infinite ease-in-out ${-i*.2}s, dnaStrand2Color 2s infinite ease-in-out ${-i*.2}s`}},`strand2-${i}`))]})})}),CD=({series:e,width:t,height:i=400,timeframe:r,className:s,isLoading:l=!1,formatValue:c,unitPrefix:f,unitSuffix:h,onLabelClick:d})=>{const g=M.useRef(null),v=M.useRef(null),y=M.useRef(null),x=M.useRef(null),[S,_]=M.useState(null),T=M.useMemo(()=>[...e].sort((K,D)=>{const V=K.data.length>0?K.data[K.data.length-1].value:0;return(D.data.length>0?D.data[D.data.length-1].value:0)-V}),[e]),E=M.useCallback(K=>{_(K)},[]),{seriesGroups:C,visibleGroups:k,filteredSeries:B,toggleGroup:P}=sD(T),{seriesColors:N,isColorLoading:U}=oD(T),A=M.useMemo(()=>hD(T),[T]),$=aD({width:t,height:i,yDomain:A,formatValue:c,containerRef:v,svgRef:g}),I=M.useMemo(()=>mD(T),[T]),Y=M.useMemo(()=>gD(I,T),[I,T]),O=M.useMemo(()=>Math.max(...B.map(K=>K.data.map(D=>D.value)).flat().filter(K=>K!==void 0)),[B]),j=M.useMemo(()=>!$.innerWidth||!$.innerHeight?null:wD(Y,A,$.innerWidth,$.innerHeight),[Y,A,$.innerWidth,$.innerHeight]),L=M.useMemo(()=>!j||!$.dynamicLeftMargin?[]:zD(B,N,j,$.dynamicLeftMargin,Na.top,c),[j,$.dynamicLeftMargin,B,N,c]);return M.useEffect(()=>{if(!g.current||e.length===0||U||!j||$.width===null||$.innerWidth===null||$.dynamicLeftMargin===null)return;const K=rr(g.current),{innerWidth:D,innerHeight:V,dynamicLeftMargin:ie}=$;K.selectAll("*").remove();const{xScale:ue,yScale:J}=j,R=K.append("g").attr("transform",`translate(${ie},${Na.top})`);_D(R,J,D),SD(R,ue,J,V,r,c,D),TD(R,B,N,ue,J);const{onMouseMove:X,onMouseLeave:ae,destroy:he}=ED({g:R,containerWidth:$.width,innerWidth:D,innerHeight:$.innerHeight,xScale:ue,yScale:J,combinedData:Y,filteredSeries:B,tooltipRef:y,containerRef:v,legendRef:x,highestValue:O,formatValue:c}),de=R.append("rect").attr("class","overlay").attr("width",D).attr("height",V).attr("fill","transparent").style("cursor","crosshair").style("pointer-events","all");return de.on("mousemove",X).on("mouseleave",ae).on("touchstart",X).on("touchmove",X).on("touchend",ae),de.raise(),()=>{he(),de.on("mousemove",null).on("mouseleave",null).on("touchstart",null).on("touchmove",null).on("touchend",null),K.selectAll("*").interrupt(),K.selectAll("*").remove()}},[Y,A,e.length,B,j,$.innerWidth,$.innerHeight,$.dynamicLeftMargin,i,r,U,N,c]),M.useEffect(()=>{if(!g.current||e.length===0||U)return;rr(g.current).select("g").selectAll("path[data-series-id]").transition().duration(200).ease(nm).attr("opacity",function(){const V=rr(this).attr("data-series-id");return lm(V,S)})},[S,e,N,U]),!l&&e.length===0?b.jsx("div",{className:ai("relative w-full",s),children:b.jsx("div",{className:ai("mx-auto flex w-full items-center justify-center text-sm text-gray-400"),style:{height:i},children:"No data available"})}):b.jsx("div",{ref:v,className:ai("relative w-full",s),style:{width:t,minHeight:i},children:l?b.jsx(MD,{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2"}):b.jsxs(b.Fragment,{children:[C.length>0&&b.jsx("div",{className:"mb-3 flex flex-wrap items-center justify-center gap-2",children:C.map(K=>b.jsx(cD,{group:K,isVisible:k.has(K),onClick:()=>P(K)},K))}),$.width!==null&&b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"relative z-20",children:b.jsx(yD,{legendRef:x,legendItems:L,containerWidth:$.width,hoveredSeriesId:S,onSeriesHover:E,onLabelClick:d,unitPrefix:f,unitSuffix:h})}),b.jsxs("div",{className:"relative select-none",children:[b.jsx("svg",{ref:g,width:$.width,height:i,className:"relative z-0",style:{maxWidth:"100%",width:"100%",display:"block",overflow:"visible"}}),b.jsx("div",{className:"z-10",children:b.jsx(xD,{containerWidth:$.width,tooltipRef:y,series:B,seriesColors:N,unitPrefix:f,unitSuffix:h})})]})]})]})})},Zx=CD,AD=["#FF1F5F","#81FE90"],ND=({data:e,width:t=270,height:i=270,innerRadius:r=90,outerRadius:s=100,colors:l=AD,children:c})=>{const f=M.useRef(null);return M.useEffect(()=>{if(!f.current||!e.length)return;rr(f.current).selectAll("*").remove();const h=rr(f.current),d=t/2,g=i/2,v=h.append("defs");v.append("filter").attr("id","glow").append("feGaussianBlur").attr("stdDeviation","3").attr("result","coloredBlur"),v.select("#glow").append("feMerge").selectAll("feMergeNode").data(["coloredBlur","SourceGraphic"]).enter().append("feMergeNode").attr("in",C=>C),v.append("filter").attr("id","glow-layer").append("feGaussianBlur").attr("stdDeviation","6").attr("result","glowBlur"),v.select("#glow-layer").append("feColorMatrix").attr("type","matrix").attr("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.5 0").attr("result","glowColor");const y=qk().value(C=>C.value).padAngle(.02),x=Ty().innerRadius(r).outerRadius(s).cornerRadius(100),S=Ty().innerRadius(r).outerRadius(s).cornerRadius(100),_=Im().domain(e.map((C,k)=>k.toString())).range(l),E=h.append("g").attr("transform",`translate(${d}, ${g})`).selectAll("g").data(y(e)).enter().append("g");E.append("path").attr("class","glow-layer").attr("d",S).attr("fill",(C,k)=>_(k.toString())).attr("filter","url(#glow-layer)").style("opacity",0).style("pointer-events","none"),E.append("path").attr("class","main-slice").attr("d",x).attr("fill",(C,k)=>_(k.toString())).attr("stroke","none"),E.on("mouseenter",function(){rr(this).select(".glow-layer").transition().duration(300).style("opacity",1)}).on("mouseleave",function(){rr(this).select(".glow-layer").transition().duration(300).style("opacity",0)})},[e,t,i,r,s,l]),b.jsxs("div",{className:"relative flex flex-col items-center justify-center rounded-full",style:{background:"linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%)"},children:[b.jsx("svg",{ref:f,width:t,height:i,className:"relative z-10"}),b.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:c}),b.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-full",style:{background:"linear-gradient(0deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%)",maskImage:"radial-gradient(farthest-side, transparent calc(100% - 1px),#fff 0)",WebkitMaskComposite:"destination-out",maskComposite:"exclude"}}),b.jsx("div",{className:"pointer-events-none absolute inset-[10%] rounded-full",style:{background:"linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%)",maskImage:"radial-gradient(farthest-side, transparent calc(100% - 1px),#fff 0)",WebkitMaskComposite:"destination-out",maskComposite:"exclude"}})]})},Ix=({data:e,width:t=120,height:i=40,color:r,className:s,variant:l="default"})=>{const c=M.useRef(null),{strokeColor:f,isPositive:h,variantType:d,customColor:g}=M.useMemo(()=>{var y,x;if(r)return{strokeColor:r,isPositive:!0,variantType:"custom",customColor:r};if(l==="auto"&&e.length>0){const S=((y=e[0])==null?void 0:y.value)??0,T=(((x=e[e.length-1])==null?void 0:x.value)??0)>=S;return{strokeColor:T?"var(--color-green-500)":"var(--color-red-500)",isPositive:T,variantType:T?"green":"red",customColor:void 0}}switch(l){case"green":return{strokeColor:"var(--color-green-500)",isPositive:!0,variantType:"green",customColor:void 0};case"red":return{strokeColor:"var(--color-red-500)",isPositive:!1,variantType:"red",customColor:void 0};case"blue":return{strokeColor:"#75A3FF",isPositive:!0,variantType:"blue",customColor:void 0};default:return{strokeColor:"var(--color-blue-600)",isPositive:!0,variantType:"blue",customColor:void 0}}},[r,l,e]),v=M.useMemo(()=>{if(!e||e.length===0)return[];const y=e.map(T=>({...T,date:new Date(T.date)})),x=Math.max(30,Math.floor(t/4));if(y.length<=x)return y;const S=Math.floor(y.length/x),_=[];for(let T=0;T<y.length;T+=S)_.push(y[T]);return _[_.length-1]!==y[y.length-1]&&_.push(y[y.length-1]),_},[e,t]);return M.useEffect(()=>{if(!c.current||!v.length)return;const y=rr(c.current),x={top:2,right:0,bottom:2,left:0},S=t-x.left-x.right,_=i-x.top-x.bottom;y.selectAll("*").remove();const T=Gx().domain(Vh(v,O=>O.date)).range([0,S]),[E,C]=Vh(v,O=>O.value),k=(C-E)*.4,B=ef().domain([E-k,C]).range([_,0]),P=t0().x(O=>T(O.date)).y(O=>B(O.value)).curve(om),N=y.append("g").attr("transform",`translate(${x.left},${x.top})`),U=Zk().x(O=>T(O.date)).y0(_).y1(O=>B(O.value)).curve(om),A=`mini-chart-gradient-${Math.random().toString(36).slice(2,11)}`,I=y.append("defs").append("linearGradient").attr("id",A).attr("x1","0%").attr("y1","0%").attr("x2","0%").attr("y2","100%"),Y=(O,j)=>{if(O.startsWith("var("))return O.includes("blue")?`rgba(59, 130, 246, ${j})`:O.includes("green")?`rgba(37, 255, 205, ${j})`:O.includes("red")?`rgba(239, 68, 68, ${j})`:`rgba(59, 130, 246, ${j})`;if(O.startsWith("#")){const L=O.slice(1),K=L.length===3?parseInt(L[0]+L[0],16):parseInt(L.slice(0,2),16),D=L.length===3?parseInt(L[1]+L[1],16):parseInt(L.slice(2,4),16),V=L.length===3?parseInt(L[2]+L[2],16):parseInt(L.slice(4,6),16);return`rgba(${K}, ${D}, ${V}, ${j})`}if(O.startsWith("rgb")){const L=O.match(/\d+/g);if(L&&L.length>=3)return`rgba(${L[0]}, ${L[1]}, ${L[2]}, ${j})`}return`rgba(59, 130, 246, ${j})`};d==="custom"&&g?(I.append("stop").attr("offset","45.9%").attr("stop-color",Y(g,.16)),I.append("stop").attr("offset","96.67%").attr("stop-color",Y(g,0))):d==="blue"?(I.append("stop").attr("offset","45.9%").attr("stop-color","rgba(7, 77, 215, 0.3)"),I.append("stop").attr("offset","96.67%").attr("stop-color","rgba(7, 77, 215, 0.3)")):d==="green"||h&&d!=="red"?(I.append("stop").attr("offset","45.9%").attr("stop-color","rgba(63, 194, 167, 0.1)"),I.append("stop").attr("offset","96.67%").attr("stop-color","rgba(63, 194, 167, 0)")):(I.append("stop").attr("offset","0%").attr("stop-color","rgba(255, 93, 127, 0.1)"),I.append("stop").attr("offset","91.8%").attr("stop-color","rgba(255, 63, 105, 0)")),N.append("path").datum(v).attr("fill",`url(#${A})`).attr("d",U),N.append("path").datum(v).attr("fill","none").attr("stroke",f).attr("stroke-width",1).attr("stroke-linecap","round").attr("stroke-linejoin","round").attr("d",P)},[v,t,i,f,h,d,g]),!e||e.length===0?b.jsx(b.Fragment,{}):b.jsx("svg",{ref:c,width:t,height:i,viewBox:`0 0 ${t} ${i}`,className:ai("h-auto max-w-full",s),style:{width:t,height:"auto"}})},Vt=e=>`/widget-icons/${e}.png`,kn={hyperliquid:{name:"Hyperliquid",url:"https://hyperliquid.xyz"},defillama:{name:"DeFiLlama",url:"https://defillama.com"},coingecko:{name:"CoinGecko",url:"https://www.coingecko.com"},alternativeMe:{name:"alternative.me",url:"https://alternative.me/crypto/fear-and-greed-index/"},bls:{name:"BLS",url:"https://www.bls.gov"},nyFed:{name:"NY Fed",url:"https://www.newyorkfed.org/markets/reference-rates"},treasury:{name:"U.S. Treasury",url:"https://fiscaldata.treasury.gov"},secEdgar:{name:"SEC EDGAR",url:"https://www.sec.gov/edgar"},finra:{name:"FINRA",url:"https://www.finra.org/finra-data/browse-catalog/short-sale-volume-data"}},Xx={name:"clock",iconUrl:Vt("clock"),layout:{w:3,h:2,minW:2,minH:1},description:"Digital clock showing the current time, ticking every second. Configurable IANA timezone (defaults to the viewer's local zone), 12/24-hour format, optional seconds and date, and a caption label. Drop several with different timezones for a trading-desk world clock. Needs no data provider.",capabilities:[],schema:ot({timezone:At().default("").describe(`IANA timezone, e.g. "America/New_York", "Europe/London", "Asia/Tokyo", "UTC". Empty = the viewer's local timezone.`),label:At().default("").describe('Caption under the time, e.g. "New York" or "Local". Empty hides it.'),hour12:Aa().default(!1).describe("12-hour clock with AM/PM (true) or 24-hour (false)."),showSeconds:Aa().default(!0).describe("Show seconds (HH:MM:SS) instead of just HH:MM."),showMillis:Aa().default(!1).describe("Show milliseconds (HH:MM:SS.mmm), updated smoothly each animation frame. Implies seconds."),showDate:Aa().default(!1).describe("Show the weekday and date under the time.")})},qx={name:"market-hours",iconUrl:Vt("market-hours"),layout:{w:4,h:4,minW:3,minH:3},description:"Which world stock exchanges are open right now — each row shows an open / closed / holiday status dot and a live countdown to the next open or close. Computed entirely client-side from each exchange's timezone and regular trading hours (no API); a bundled 2026 holiday list keeps the major Western exchanges accurate on market holidays. Intraday lunch breaks and half-day early closes are not modelled. Needs no data provider.",capabilities:[],schema:ot({exchanges:ar(At()).default([]).describe('Exchange codes to show, e.g. ["NYSE","LSE","TSE","HKEX","SET"]. Empty = a global default set. Known codes: NYSE, NASDAQ, TSX, B3, LSE, XETRA, EURONEXT, SIX, TSE, HKEX, SSE, NSE, KRX, SGX, SET, ASX, JSE, TADAWUL.'),sort:Zi(["region","status","name"]).default("region").describe("Order rows by world region (Americas → Europe → Asia-Pacific → Middle East/Africa), by status (open first), or alphabetically by name.")})},Wx={name:"fear-greed",iconUrl:Vt("fear-greed"),layout:{w:3,h:3,minW:2,minH:2},description:"Crypto Fear & Greed index (0 = extreme fear, 100 = extreme greed) with a recent-history sparkline. A one-number market mood gauge from alternative.me.",capabilities:["sentiment"],source:kn.alternativeMe,schema:ot({sparklineDays:Mt().int().min(7).max(90).default(30).describe("How many days of index history to show in the sparkline.")})},Kx={name:"funding-rate-chart",iconUrl:Vt("funding-rate-chart"),layout:{w:6,h:3,minW:3,minH:2},description:"Multi-series line chart comparing hourly perp funding rates across symbols over a configurable lookback window. Positive funding = longs pay shorts. Useful for spotting crowded trades.",capabilities:["funding-history"],source:kn.hyperliquid,schema:ot({symbols:ar(At()).min(1).max(6).describe('Hyperliquid symbols to compare funding for, e.g. ["xyz:TSLA", "xyz:NVDA"]. Up to 6.'),lookback:Zi(["24h","7D","1M"]).default("7D").describe("History window for the funding chart.")})},Qx={name:"note",iconUrl:Vt("note"),layout:{w:4,h:3,minW:2,minH:2},description:"Free-form text note pinned to the dashboard — trading plans, reminders, watch levels. Needs no data provider.",capabilities:[],schema:ot({text:At().min(1).describe("The note's text content. Plain text; newlines are preserved."),align:Zi(["left","center"]).default("left").describe("Text alignment inside the card.")})},Jx={name:"price-chart",iconUrl:Vt("price-chart"),layout:{w:6,h:3,minW:3,minH:2},description:"Live animated price chart (candlestick or line) for one symbol — canvas-rendered at 60fps via liveline, streaming live off the Hyperliquid WebSocket. Works for HIP-3 stock perps (xyz:TSLA) and crypto (BTC). The centerpiece frame.",capabilities:["ohlcv","quote-stream"],source:kn.hyperliquid,schema:ot({symbol:At().min(1).describe('Hyperliquid symbol to chart. Stocks/HIP-3: "xyz:TSLA", "xyz:NVDA", "xyz:AAPL". Crypto: "BTC", "ETH".'),interval:Zi(["1m","5m","15m","1h","4h","1d"]).default("1h").describe("Candle interval."),mode:Zi(["candle","line"]).default("candle").describe("Candlestick or smooth line rendering."),color:At().default("#8b8df9").describe("Accent color (hex). The whole palette derives from it.")})},ew={name:"price-liveline",iconUrl:Vt("price-liveline"),layout:{w:6,h:3,minW:4,minH:2},description:"Multi-asset live price liveline — several Hyperliquid symbols streaming in one canvas chart. Defaults to normalized % movement so stocks and crypto can share one axis, while the legend still shows each asset's live raw price. Use when the dashboard needs one compact live race view instead of several single-symbol charts.",capabilities:["quote-stream","day-stats"],source:kn.hyperliquid,schema:ot({symbols:ar(At()).min(2).max(8).describe('Hyperliquid symbols to stream together, e.g. ["xyz:TSLA", "xyz:NVDA", "xyz:AAPL"] or ["BTC", "ETH", "SOL"]. 2 to 8.'),windowSec:Mt().int().min(10).max(300).default(30).describe("Rolling live window in seconds. 30 mirrors the zhive liveline view; use 60–300 for slower dashboards."),normalize:Aa().default(!0).describe("Show each asset as % movement from its first live tick (recommended when prices differ). Off = raw price overlay.")})},tw={name:"price-ticker",iconUrl:Vt("price-ticker"),layout:{w:3,h:3,minW:2,minH:2},description:"Live watchlist streaming mid prices over the Hyperliquid WebSocket with 24h change per symbol. The bread-and-butter frame for any dashboard.",capabilities:["quote-stream","day-stats"],source:kn.hyperliquid,schema:ot({symbols:ar(At()).min(1).describe('Hyperliquid symbols to track, e.g. ["xyz:TSLA", "xyz:NVDA", "xyz:AAPL"]. Crypto works too: "BTC", "ETH".')})},nw={name:"top-movers",iconUrl:Vt("top-movers"),layout:{w:5,h:3,minW:3,minH:3},description:"Today's biggest stock and commodity HIP-3 gainers and losers (no bare crypto), side by side with current price and 24h change.",capabilities:["day-stats"],source:kn.hyperliquid,schema:ot({count:Mt().int().min(3).max(10).default(5).describe("How many gainers and losers to list (each).")})},iw={name:"tvl-treemap",iconUrl:Vt("tvl-treemap"),layout:{w:6,h:4,minW:3,minH:3},description:"Treemap of total value locked (TVL) across the largest blockchain ecosystems, sized by TVL. Data from DeFiLlama. Good single-glance answer to 'where does on-chain capital live right now'.",capabilities:["tvl"],source:kn.defillama,schema:ot({topN:Mt().int().min(3).max(30).default(12).describe("How many of the largest chains to show in the treemap.")})},rw={name:"bitcoin-dominance",iconUrl:Vt("bitcoin-dominance"),layout:{w:4,h:2,minW:3,minH:2},description:"BTC / ETH / Others market-cap dominance as a segmented bar, with optional total marketcap line. Shifts in BTC dominance hint at where the market rotates next.",capabilities:["global-market"],source:kn.coingecko,schema:ot({showTotalMarketCap:Aa().default(!0).describe("Show total crypto marketcap and its 24h change below the bar.")})},aw={name:"rates-board",iconUrl:Vt("rates-board"),layout:{w:4,h:4,minW:3,minH:3},description:"Official US rates board from free public APIs: New York Fed reference rates (SOFR, effective fed funds, repo rates) plus Treasury average interest rates by security class. Daily/reference data, not a real-time stock quote feed.",capabilities:["reference-rates","treasury-rates"],source:[kn.nyFed,kn.treasury],schema:ot({maxReferenceRates:Mt().int().min(2).max(8).default(5).describe("How many New York Fed reference rates to show."),showTreasuryAverageRates:Aa().default(!0).describe("Also show Treasury average interest rates by security class from Fiscal Data."),maxTreasuryRates:Mt().int().min(1).max(8).default(4).describe("How many Treasury average-rate rows to show.")})},sw={name:"inflation-pulse",iconUrl:Vt("inflation-pulse"),layout:{w:4,h:3,minW:3,minH:2},description:"BLS CPI pulse from the public no-key API: latest CPI-U all-items index with month-over-month and year-over-year changes plus a small trend sparkline. Monthly macro context for stock dashboards; not a live price feed.",capabilities:["macro-series"],source:kn.bls,schema:ot({months:Mt().int().min(13).max(36).default(18).describe("How many monthly CPI observations to show in the trend.")})},ow={name:"filings-feed",iconUrl:Vt("filings-feed"),layout:{w:5,h:4,minW:3,minH:3},description:"Recent SEC EDGAR filings for one US-listed company — each row shows the form type (10-K, 10-Q, 8-K, Form 4…), a plain-English label, the filing date, and a click-through to the document on sec.gov, under a header with the company name, exchange, and filer category. Official data from SEC's free, CORS-safe submissions endpoint; event-driven (updates when the company files), not a price feed. Resolve by ticker (a bundled snapshot of the ~500 largest US issuers) or by raw SEC CIK for anything else.",capabilities:["filings"],source:kn.secEdgar,schema:ot({symbol:At().min(1).describe('Company to show filings for — a ticker ("AAPL", "NVDA"), a HIP-3 symbol ("xyz:TSLA"), or a raw SEC CIK ("320193"). Tickers outside the bundled top-500 map need a CIK.'),forms:Zi(["important","all","insider"]).default("important").describe('Which filings to surface: "important" = periodic & material reports (10-K, 10-Q, 8-K, S-1, proxies, 13D/G…); "insider" = ownership forms (3/4/5/144); "all" = unfiltered. Always newest first.'),count:Mt().int().min(3).max(25).default(8).describe("How many filings to list (newest first).")})},lw={name:"yield-curve",iconUrl:Vt("yield-curve"),layout:{w:4,h:3,minW:3,minH:3},description:"The U.S. Treasury daily par yield curve — a line from 1-month to 30-year yields, the headline 2s10s spread (10Y minus 2Y; negative = inverted, the classic recession signal), and a configurable row of key maturities. Keyless official data from the U.S. Treasury, updated each business day; not a live intraday feed.",capabilities:["yield-curve"],source:kn.treasury,schema:ot({maturities:ar(Zi(["1M","2M","3M","4M","6M","1Y","2Y","3Y","5Y","7Y","10Y","20Y","30Y"])).min(2).max(8).default(["3M","2Y","5Y","10Y","30Y"]).describe("Maturities to show as labelled cells under the curve (the full curve line always shows every maturity).")})},cw={name:"fundamentals",iconUrl:Vt("fundamentals"),layout:{w:4,h:3,minW:3,minH:3},description:"Headline financials for one US-listed company from SEC EDGAR XBRL company facts — revenue, net income, total assets, shareholders' equity, diluted EPS, and shares outstanding, each labelled with its fiscal period. Income-statement figures are the latest full fiscal year; balance-sheet figures are the latest reported quarter. Keyless official data that updates only when the company files (annual/quarterly), not a live feed. Requires the zframes runtime's data proxy (it ships with `zframes serve` / `vite dev`); resolve by ticker (bundled top-500 map) or raw SEC CIK.",capabilities:["fundamentals"],source:kn.secEdgar,schema:ot({symbol:At().min(1).describe('Company to show financials for — a ticker ("AAPL", "NVDA"), a HIP-3 symbol ("xyz:NVDA"), or a raw SEC CIK ("320193"). Tickers outside the bundled top-500 map need a CIK.')})},uw={name:"short-volume",iconUrl:Vt("short-volume"),layout:{w:5,h:4,minW:3,minH:3},description:"Daily reported short-sale volume for a watchlist of US-listed stocks, from FINRA's free consolidated file — each row shows the % of the day's reported volume that was sold short, with a bar and the raw short/total share counts. IMPORTANT: this is reported short volume (sell-side short flow, which includes market-maker hedging), NOT short interest (outstanding short positions), and is not a directional signal on its own. Daily data published the next business day; not a live feed. US equities only.",capabilities:["short-volume"],source:kn.finra,schema:ot({symbols:ar(At()).min(1).max(12).describe('US-listed stock tickers to show, e.g. ["TSLA","NVDA","AAPL"]. HIP-3 symbols ("xyz:TSLA") work too — the dex prefix is stripped. Crypto has no SEC/FINRA short-volume and is ignored.'),sort:Zi(["shortPct","volume","symbol"]).default("shortPct").describe("Order rows by short % of volume (highest first), by total volume (highest first), or alphabetically by symbol.")})},fw={name:"funding-heatmap",iconUrl:Vt("funding-heatmap"),layout:{w:6,h:3,minW:4,minH:3},description:"Heatmap of perp funding rates — symbols as rows, 4h time buckets over the last 3 days as columns, green positive / red negative. Spots persistent funding regimes at a glance.",capabilities:["funding-history"],source:kn.hyperliquid,schema:ot({symbols:ar(At()).min(1).max(8).describe('Hyperliquid symbols as heatmap rows, e.g. ["xyz:TSLA", "xyz:NVDA", "xyz:AAPL"].')})},RD={name:"dino-game",iconUrl:Vt("dino-game"),layout:{w:4,h:3,minW:3,minH:3},description:"Chrome-dino style runner game on canvas — jump cacti with SPACE or tap. High score persists locally. For when the market is boring. Needs no data provider.",capabilities:[],schema:ot({})},dw={name:"image",iconUrl:Vt("image"),layout:{w:3,h:3,minW:1,minH:1},description:"Displays an image from a URL — logos, memes, chart screenshots, banners. Needs no data provider.",capabilities:[],schema:ot({url:At().min(1).describe("Image URL (https)."),alt:At().default("").describe("Alt text for accessibility."),fit:Zi(["cover","contain"]).default("cover").describe("How the image fills the frame: cover crops, contain letterboxes.")})},hw={name:"heading",iconUrl:Vt("heading"),layout:{w:12,h:1,minW:2,minH:1,maxH:1},description:"Section divider that titles a region of the dashboard ('Markets', 'On-chain', 'Desk'). Renders as a label with a hairline rule — no card. Use to group frames into zones: place full-width (w: 12) and 1 row tall (h: 1) above each group. Needs no data provider.",capabilities:[],chrome:"bare",schema:ot({title:At().min(1).describe("The heading text."),subtitle:At().optional().describe("Smaller supporting line under the title.")})},mw={name:"daily-analysis",iconUrl:Vt("daily-analysis"),layout:{w:6,h:3,minW:3,minH:2},description:"Daily market brief written by the /zframes-brief loop — a dated analysis of the symbols on your dashboard, the calls it is making today, and how yesterday's calls scored (with a running hit-rate). Reads a local log file the loop appends to; needs no market data provider. Add one per dashboard.",capabilities:[],schema:ot({src:At().default("/daily-analysis.json").describe("URL of the analysis log the loop writes, served from the app's public/ dir. Leave as the default unless you renamed the file."),entries:Mt().int().min(1).max(5).default(1).describe("How many of the most recent daily entries to show (newest first)."),refreshSec:Mt().int().min(30).default(300).describe("How often (seconds) to re-fetch the log so a fresh brief appears without a manual reload.")})},gw={name:"price-compare",iconUrl:Vt("price-compare"),layout:{w:6,h:3,minW:3,minH:2},description:"Multi-series line chart overlaying the price history of several symbols over a lookback window — see how TSLA, NVDA and BTC moved against each other. Normalized by default to % change from the window start so symbols at very different price levels (BTC vs a $20 stock) stay comparable on one axis. Candles from Hyperliquid.",capabilities:["ohlcv"],source:kn.hyperliquid,schema:ot({symbols:ar(At()).min(2).max(6).describe('Hyperliquid symbols to overlay, e.g. ["xyz:TSLA", "xyz:NVDA", "BTC"]. 2 to 6.'),lookback:Zi(["24h","7D","1M"]).default("7D").describe("History window for the comparison."),normalize:Aa().default(!0).describe("Rebase each series to % change from the window start (recommended — lets symbols at different price levels share one axis). Off = raw price, only sensible when comparing similarly-priced symbols.")})},pw={name:"allocation",iconUrl:Vt("allocation"),layout:{w:4,h:4,minW:3,minH:3},description:"Donut of a portfolio's live allocation — list holdings (symbol + amount) and each slice is sized by current USD value off the Hyperliquid mid stream, with total portfolio value in the center. A live 'where is my money right now' view.",capabilities:["quote-stream"],source:kn.hyperliquid,schema:ot({holdings:ar(ot({symbol:At().min(1).describe('Hyperliquid symbol, e.g. "BTC", "ETH", "xyz:TSLA".'),amount:Mt().positive().describe("Units held (e.g. 0.5 BTC, 10 shares). Weights the slice by USD value = amount × live price.")})).min(2).max(8).describe("The holdings to chart. 2 to 8 positions.")})};function ct({loading:e=!1,children:t}){return e?b.jsx("div",{className:"flex h-full min-h-[72px] w-full items-center justify-center overflow-hidden rounded-md",role:"status","aria-live":"polite","aria-busy":"true",children:b.jsxs("div",{className:"flex w-full max-w-sm flex-col gap-3",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx("span",{className:"relative h-2.5 w-2.5 shrink-0 rounded-full",style:{background:"hsl(var(--zf-accent-hue, 242) 90% 76%)",boxShadow:"0 0 12px hsl(var(--zf-accent-hue, 242) 90% 76% / 0.72)"},children:b.jsx("span",{className:"absolute inset-0 animate-ping rounded-full opacity-60",style:{background:"hsl(var(--zf-accent-hue, 242) 90% 76%)"}})}),b.jsx("span",{className:"body-sm text-soft truncate",children:t})]}),b.jsxs("div",{className:"grid min-h-0 grid-cols-4 gap-2",children:[b.jsx("span",{className:"h-11 animate-pulse rounded bg-white/[0.07]"}),b.jsx("span",{className:"h-11 animate-pulse rounded bg-white/[0.05]"}),b.jsx("span",{className:"h-11 animate-pulse rounded bg-white/[0.08]"}),b.jsx("span",{className:"h-11 animate-pulse rounded bg-white/[0.04]"})]}),b.jsxs("div",{className:"flex flex-col gap-2",children:[b.jsx("span",{className:"h-2.5 w-11/12 animate-pulse rounded-full bg-white/[0.07]"}),b.jsx("span",{className:"h-2.5 w-7/12 animate-pulse rounded-full bg-white/[0.05]"})]})]})}):b.jsx("div",{className:"body-sm text-soft flex h-full min-h-0 items-center justify-center text-center",children:t})}pw.schema;function kD(e){return e>=1e9?`$${(e/1e9).toFixed(2)}B`:e>=1e6?`$${(e/1e6).toFixed(2)}M`:e>=1e3?`$${(e/1e3).toFixed(1)}K`:`$${e.toFixed(0)}`}function DD({config:e}){const t=M.useMemo(()=>e.holdings.map(c=>c.symbol),[e.holdings]),{mids:i,isLoading:r}=Mm(t),s=M.useMemo(()=>e.holdings.map((c,f)=>({name:c.symbol,value:(i[c.symbol]??0)*c.amount,color:yr[f%yr.length]})).filter(c=>c.value>0).sort((c,f)=>f.value-c.value),[e.holdings,i]),l=s.reduce((c,f)=>c+f.value,0);return r?b.jsx(ct,{loading:!0,children:"loading allocation..."}):s.length===0?b.jsx(ct,{children:"no live prices yet"}):b.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-4",children:[b.jsx(ND,{data:s,width:200,height:200,innerRadius:66,outerRadius:92,colors:s.map(c=>c.color),children:b.jsxs("div",{className:"flex flex-col items-center",children:[b.jsx("span",{className:"caption text-soft",children:"total"}),b.jsx("span",{className:"font-dmsans text-strong text-2xl font-bold tabular-nums",children:kD(l)})]})}),b.jsx("div",{className:"flex w-full max-w-xs flex-wrap justify-center gap-x-4 gap-y-1",children:s.map(c=>b.jsxs("div",{className:"flex items-center gap-1.5",children:[b.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:c.color}}),b.jsx("span",{className:"body-sm text-soft",children:c.name}),b.jsxs("span",{className:"body-sm text-normal font-bold tabular-nums",children:[(c.value/l*100).toFixed(1),"%"]})]},c.name))})]})}const OD={...pw,component:DD};function cs(e){return e>=1e3?`$${e.toLocaleString("en-US",{maximumFractionDigits:0})}`:e>=1?`$${e.toLocaleString("en-US",{maximumFractionDigits:2})}`:`$${e.toPrecision(4)}`}function ho(e){return`${e>=0?"+":""}${e.toFixed(2)}%`}function ka(e){return e>=0?"#3fd08f":"#ff6b81"}rw.schema;const ky={BTC:"linear-gradient(90deg, #FF810F 0%, #FF9E37 81.48%)",ETH:"#6366F1",Others:"#6B7280"};function jD({config:e}){const{market:t,isLoading:i}=$z(),r=M.useMemo(()=>{if(!t)return[];const l=t.dominance.btc??0,c=t.dominance.eth??0;return[{type:"BTC",value:l},{type:"ETH",value:c},{type:"Others",value:Math.max(0,100-l-c)}].sort((f,h)=>h.value-f.value)},[t]);if(i)return b.jsx(ct,{loading:!0,children:"loading dominance…"});if(!t)return b.jsx(ct,{children:"no market data"});const s=r[0];return b.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3",children:[b.jsxs("div",{className:"flex items-baseline gap-2",children:[b.jsxs("span",{className:"font-dmsans text-strong text-4xl font-bold tabular-nums",children:[s.value.toFixed(1),"%"]}),b.jsx("span",{className:"body-md text-soft",children:s.type})]}),b.jsx("div",{className:"flex h-2.5 w-full max-w-xs gap-0.5 overflow-hidden",children:r.map(l=>b.jsx("div",{className:"h-full rounded-[2px] first:rounded-l-[10px] last:rounded-r-[10px]",style:{width:`${l.value}%`,background:ky[l.type]}},l.type))}),b.jsx("div",{className:"flex w-full max-w-xs items-center justify-between",children:r.map(l=>b.jsxs("div",{className:"flex items-center gap-1.5",children:[b.jsx("div",{className:"h-[5px] w-[7px] rounded-full",style:{background:ky[l.type]}}),b.jsx("span",{className:"body-sm text-soft",children:l.type}),b.jsxs("span",{className:"body-sm text-normal font-bold tabular-nums",children:[l.value.toFixed(1),"%"]})]},l.type))}),e.showTotalMarketCap&&b.jsxs("div",{className:"caption text-soft",children:["total mcap $",(t.totalMarketCapUsd/1e12).toFixed(2),"T ·"," ",b.jsxs("span",{style:{color:ka(t.marketCapChangePct24h)},children:[ho(t.marketCapChangePct24h)," 24h"]})]})]})}const LD={...rw,component:jD};let vw=typeof window<"u"?window.scrollY:0,yw=typeof window<"u"?window.innerHeight:0,Jc;typeof window<"u"&&(window.addEventListener("scroll",()=>{Jc!=null&&(window.clearTimeout(Jc),Jc=void 0),Jc=window.setTimeout(()=>{vw=window.scrollY},200)},{passive:!0}),window.addEventListener("resize",()=>{yw=window.innerHeight},{passive:!0}));const cm={_callbacks:[],register(e){this._callbacks.push(e)},unregister(e){this._callbacks=this._callbacks.filter(t=>t!==e)},tick(){setInterval(()=>{this._callbacks.forEach(t=>t())},1e3/24)}};typeof window<"u"&&cm.tick();function dl({ref:e,getRemainingMs:t,format:i}){const r=M.useRef({getRemainingMs:t,format:i});r.current={getRemainingMs:t,format:i};const s=M.useRef(0);M.useLayoutEffect(()=>{const l=()=>{e.current&&(s.current=e.current.getBoundingClientRect().top+window.scrollY)};return l(),window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l)}},[e]),M.useEffect(()=>{const l=()=>{if(!e.current)return;const c=s.current-vw;if(c>yw||c<0)return;const f=r.current.getRemainingMs();e.current&&(e.current.textContent=r.current.format(f))};return cm.register(l),()=>{cm.unregister(l)}},[e])}Xx.schema;function hl(e){const t={hour:"",minute:"",second:"",fractional:"",period:""};for(const i of e.formatToParts(new Date))i.type==="hour"?t.hour=i.value:i.type==="minute"?t.minute=i.value:i.type==="second"?t.second=i.value:i.type==="fractionalSecond"?t.fractional=i.value:i.type==="dayPeriod"&&(t.period=i.value);return t}function UD({config:e}){const t=M.useRef(null),i=M.useRef(null),r=M.useRef(null),s=M.useRef(null),l=M.useRef(null),c=e.timezone.trim()||void 0,f=e.showSeconds||e.showMillis,h=M.useMemo(()=>{try{const y=new Intl.DateTimeFormat(void 0,{timeZone:c,hour:"2-digit",minute:"2-digit",second:f?"2-digit":void 0,fractionalSecondDigits:e.showMillis?3:void 0,hour12:e.hour12}),x=e.showDate?new Intl.DateTimeFormat(void 0,{timeZone:c,weekday:"short",month:"short",day:"numeric"}):null;return{time:y,date:x,error:null}}catch{return{time:null,date:null,error:c??"invalid timezone"}}},[c,f,e.showMillis,e.hour12,e.showDate]);if(dl({ref:t,getRemainingMs:()=>Date.now(),format:()=>{if(!h.time)return"";const y=hl(h.time);return`${y.hour}:${y.minute}`}}),dl({ref:i,getRemainingMs:()=>Date.now(),format:()=>h.time?`:${hl(h.time).second}`:""}),dl({ref:r,getRemainingMs:()=>Date.now(),format:()=>h.time?`.${hl(h.time).fractional}`:""}),dl({ref:s,getRemainingMs:()=>Date.now(),format:()=>h.time?hl(h.time).period:""}),dl({ref:l,getRemainingMs:()=>Date.now(),format:()=>h.date?h.date.format(new Date):""}),h.error)return b.jsxs(ct,{children:["unknown timezone: ",h.error]});const d=hl(h.time),g="hsl(var(--zf-accent-hue, 242) 96% 82%)",v="0 0 22px hsl(var(--zf-accent-hue, 242) 92% 70% / 0.45)";return b.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 text-center [container-type:size]",children:[b.jsxs("div",{className:"text-strong inline-flex max-w-full items-baseline justify-center whitespace-nowrap font-dmsans font-extrabold leading-none tracking-[-0.01em] tabular-nums",style:{fontSize:"clamp(1.6rem, 37cqmin, 5.5rem)"},children:[b.jsx("span",{ref:t,suppressHydrationWarning:!0,children:`${d.hour}:${d.minute}`}),f&&b.jsx("span",{ref:i,suppressHydrationWarning:!0,className:"font-bold",style:{fontSize:"0.46em",color:g,textShadow:v},children:`:${d.second}`}),e.showMillis&&b.jsx("span",{ref:r,suppressHydrationWarning:!0,className:"font-semibold",style:{fontSize:"0.3em",color:g,opacity:.65},children:`.${d.fractional}`}),e.hour12&&b.jsx("span",{ref:s,suppressHydrationWarning:!0,className:"text-soft ml-[0.3em] self-center font-semibold uppercase",style:{fontSize:"0.3em",letterSpacing:"0.08em"},children:d.period})]}),e.showDate&&h.date&&b.jsx("div",{ref:l,suppressHydrationWarning:!0,className:"caption text-soft tabular-nums",children:h.date.format(new Date)}),e.label&&b.jsxs("div",{className:"caption text-soft inline-flex items-center gap-1.5 uppercase tracking-[0.18em]",children:[b.jsx("span",{"aria-hidden":!0,className:"inline-block h-1 w-1 rounded-full",style:{background:g,boxShadow:v}}),e.label]})]})}const HD={...Xx,component:UD};mw.schema;const Mh={bullish:"#76d275",bearish:"#e6464f",neutral:"#9aa0aa"},BD={hit:"#76d275",miss:"#e6464f",partial:"#f4a259"};function $D(e){let t=0,i=0;for(const r of e)for(const s of r.grades??[])i++,s.verdict==="hit"?t+=1:s.verdict==="partial"&&(t+=.5);return{rate:i?t/i:0,n:i}}function GD({config:e}){const[t,i]=M.useState(null),[r,s]=M.useState(!1);if(M.useEffect(()=>{let d=!1;const g=()=>{fetch(e.src,{cache:"no-store"}).then(x=>{if(!x.ok)throw new Error(`HTTP ${x.status}`);return x.json()}).then(x=>{d||(i(x),s(!0))}).catch(()=>{d||s(!0)})};g();const v=()=>g();window.addEventListener("focus",v);const y=window.setInterval(g,e.refreshSec*1e3);return()=>{d=!0,window.removeEventListener("focus",v),window.clearInterval(y)}},[e.src,e.refreshSec]),!r)return b.jsx(ct,{loading:!0,children:"loading brief…"});const l=(t==null?void 0:t.entries)??[];if(l.length===0)return b.jsx(ct,{children:"no brief yet — run /zframes-brief"});const c=l.slice(-e.entries).reverse(),{rate:f,n:h}=$D(l);return b.jsxs("div",{className:"body-sm flex h-full flex-col gap-3 overflow-auto",children:[h>0&&b.jsxs("div",{className:"caption text-soft flex items-center justify-between",children:[b.jsx("span",{className:"uppercase tracking-wide",children:"track record"}),b.jsxs("span",{className:"font-bold tabular-nums text-white",children:[Math.round(f*100),"% · ",h," call",h===1?"":"s"]})]}),c.map((d,g)=>{var v,y,x,S,_,T;return b.jsxs("div",{className:"flex flex-col gap-1.5",children:[(d.date||((v=d.run)==null?void 0:v.model))&&b.jsxs("div",{className:"caption text-soft flex items-baseline justify-between gap-2",children:[b.jsx("span",{className:"uppercase tracking-wide",children:d.date}),((y=d.run)==null?void 0:y.model)&&b.jsxs("span",{className:"truncate opacity-70",title:d.run.timestamp??"",children:[d.run.model,d.run.effort?` · ${d.run.effort}`:""]})]}),d.summary&&b.jsx("div",{className:"text-normal whitespace-pre-wrap",children:d.summary}),(((x=d.calls)==null?void 0:x.length)??0)>0&&b.jsx("div",{className:"flex flex-col gap-1",children:(S=d.calls)==null?void 0:S.map((E,C)=>b.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)] items-baseline gap-2",children:[b.jsx("span",{className:"caption font-bold uppercase tracking-wide",style:{color:Mh[E.direction??"neutral"]??Mh.neutral},children:E.symbol??E.direction??"•"}),b.jsx("span",{className:"text-normal",children:E.claim})]},E.id??C))}),(((_=d.grades)==null?void 0:_.length)??0)>0&&b.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[b.jsx("span",{className:"caption text-soft uppercase tracking-wide",children:"graded"}),(T=d.grades)==null?void 0:T.map((E,C)=>b.jsx("span",{className:"caption rounded px-1.5 py-0.5 font-bold uppercase",style:{color:BD[E.verdict??""]??Mh.neutral,background:"rgba(255,255,255,0.06)"},title:E.note??"",children:E.verdict??"—"},E.callId??C))]})]},d.date??g)})]})}const YD={...mw,component:GD},FD=.6,PD=-12,cu=40,VD=40,bl=44,Dy=24,ZD=40,Oy=6,ID=.001,Wn={ground:"rgba(255, 255, 255, 0.1)",groundTexture:"rgba(255, 255, 255, 0.06)",dino:"rgba(255, 255, 255, 1)",eye:"rgba(0, 0, 0, 0.8)",cactus:"#25A78D",text:"rgba(255, 255, 255, 0.85)",textSoft:"rgba(255, 255, 255, 0.6)",score:"hsla(246, 100%, 70%, 1)",gameOver:"hsla(347, 100%, 62%, 1)"};function bw(e,t,i,r){e.fillStyle=Wn.dino,e.fillRect(t+10,i+10,25,24),e.fillRect(t+20,i,20,16),e.fillStyle=Wn.eye,e.fillRect(t+32,i+4,4,4),e.fillStyle=Wn.dino,e.fillRect(t,i+16,14,8),e.fillRect(t-4,i+12,8,8),r===null?(e.fillRect(t+12,i+34,6,10),e.fillRect(t+24,i+34,6,10)):(e.fillRect(t+12,i+34,6,r===0?10:6),e.fillRect(t+24,i+34,6,r===1?10:6)),e.fillRect(t+30,i+18,4,10)}function XD(e,t,i,r,s){const l=i-s;e.fillStyle=Wn.cactus,e.fillRect(t+r/2-4,l,8,s),e.fillRect(t,l+10,8,6),e.fillRect(t,l+10,4,14),e.fillRect(t+r-8,l+18,8,6),e.fillRect(t+r-4,l+18,4,12)}function jy(e,t,i,r,s){const l=e.height-cu;t.clearRect(0,0,e.width,e.height),t.fillStyle=Wn.ground,t.fillRect(0,l,e.width,2),bw(t,50,l-bl,null),t.textAlign="center",i==="idle"?(t.fillStyle=Wn.text,t.font='bold 14px "DM Sans", sans-serif',t.fillText("Press SPACE or tap to start",e.width/2,e.height/2-30)):(t.fillStyle=Wn.gameOver,t.font='bold 20px "DM Sans", sans-serif',t.fillText("GAME OVER",e.width/2,e.height/2-40),t.fillStyle=Wn.text,t.font='bold 14px "DM Sans", sans-serif',t.fillText(`Score: ${r}`,e.width/2,e.height/2-10),t.fillStyle=Wn.textSoft,t.fillText("Press SPACE or tap to restart",e.width/2,e.height/2+20)),t.textAlign="left",t.font='bold 12px "DM Sans", monospace',t.fillStyle=Wn.textSoft,t.fillText("HI",10,30),t.fillStyle=Wn.score,t.fillText(String(s).padStart(5,"0"),30,30)}function qD(){const e=M.useRef(null),[t,i]=M.useState("idle"),[r,s]=M.useState(0),[l,c]=M.useState(()=>{if(typeof window<"u"){const _=localStorage.getItem("zframes-dino-high-score");return _?parseInt(_,10):0}return 0}),[f,h]=M.useState(!1),d=M.useRef(0),g=M.useRef(l),v=M.useRef(t);M.useEffect(()=>{g.current=l,l>0&&localStorage.setItem("zframes-dino-high-score",String(l))},[l]),M.useEffect(()=>{v.current=t},[t]);const y=M.useRef({dinoY:0,dinoVelocity:0,isJumping:!1,obstacles:[],speed:Oy,frameCount:0,groundOffset:0}),x=M.useCallback(()=>{const _=e.current;_&&(y.current={dinoY:_.height-cu-bl,dinoVelocity:0,isJumping:!1,obstacles:[],speed:Oy,frameCount:0,groundOffset:0},d.current=0,s(0))},[]),S=M.useCallback(()=>{if(t!=="playing"){x(),i("playing");return}const _=y.current;_.isJumping||(_.dinoVelocity=PD,_.isJumping=!0)},[t,x]);return M.useEffect(()=>{const _=T=>{const E=T.target;E.tagName==="INPUT"||E.tagName==="TEXTAREA"||E.isContentEditable||(T.code==="Space"||T.code==="ArrowUp")&&(T.preventDefault(),S())};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[S]),M.useLayoutEffect(()=>{const _=e.current;if(!_)return;const T=()=>{const C=_.parentElement;if(C&&C.clientWidth>0&&C.clientHeight>0){_.width=C.clientWidth,_.height=C.clientHeight,y.current.dinoY=_.height-cu-bl;const k=_.getContext("2d");k&&v.current!=="playing"&&jy(_,k,v.current,d.current,g.current),h(B=>!B)}};T();const E=new ResizeObserver(T);return E.observe(_.parentElement),()=>E.disconnect()},[]),M.useEffect(()=>{if(t!=="playing")return;const _=e.current,T=_==null?void 0:_.getContext("2d");if(!_||!T)return;let E;const C=_.height-cu,k=()=>{T.fillStyle=Wn.ground,T.fillRect(0,C,_.width,2),T.fillStyle=Wn.groundTexture;const U=y.current.groundOffset%30;for(let A=-U;A<_.width;A+=30)T.beginPath(),T.arc(A,C+12,1.5,0,Math.PI*2),T.fill(),T.beginPath(),T.arc(A+15,C+20,1,0,Math.PI*2),T.fill()},B=()=>{T.font='bold 12px "DM Sans", monospace',T.textAlign="left",T.fillStyle=Wn.textSoft,T.fillText("HI",10,30),T.fillStyle=Wn.score,T.fillText(String(g.current).padStart(5,"0"),30,30),T.textAlign="right",T.fillStyle=Wn.text,T.fillText(String(d.current).padStart(5,"0"),_.width-10,30)},P=U=>{const $=y.current.dinoY;return 50+VD-5>U.x&&55<U.x+U.width&&$+bl>C-U.height&&$+5<C},N=()=>{const U=y.current;T.clearRect(0,0,_.width,_.height),U.dinoVelocity+=FD,U.dinoY+=U.dinoVelocity;const A=C-bl;U.dinoY>=A&&(U.dinoY=A,U.dinoVelocity=0,U.isJumping=!1),U.obstacles=U.obstacles.filter(Y=>Y.x>-Dy),U.obstacles.forEach(Y=>{Y.x-=U.speed});const $=U.obstacles[U.obstacles.length-1],I=300+Math.random()*200;(!$||$.x<_.width-I)&&Math.random()<.02&&U.obstacles.push({x:_.width,width:Dy,height:ZD});for(const Y of U.obstacles)if(P(Y)){d.current>g.current&&(g.current=d.current,c(d.current)),i("gameover");return}U.frameCount++,U.frameCount%6===0&&(d.current+=1,s(d.current)),U.speed+=ID,U.groundOffset+=U.speed,k(),bw(T,50,U.dinoY,U.isJumping?null:Math.floor(U.frameCount/5)%2),U.obstacles.forEach(Y=>XD(T,Y.x,C,Y.width,Y.height)),B(),E=requestAnimationFrame(N)};return E=requestAnimationFrame(N),()=>cancelAnimationFrame(E)},[t]),M.useEffect(()=>{if(t==="playing")return;const _=e.current,T=_==null?void 0:_.getContext("2d");!_||!T||jy(_,T,t,r,l)},[t,r,l,f]),b.jsx("div",{className:"relative h-full w-full cursor-pointer select-none overflow-hidden",onClick:S,onTouchStart:S,role:"application","aria-label":"Dino running game. Press space or tap to jump over obstacles.",children:b.jsx("canvas",{ref:e,className:"h-full w-full"})})}const WD={...RD,component:qD};Wx.schema;function KD(e){return e<=25?"#F21553":e<=45?"#F97316":e<=55?"#F59E0B":e<=75?"#84CC16":"#25A78D"}function QD({config:e}){const{points:t,isLoading:i}=Gz(e.sparklineDays),r=t[0],s=M.useMemo(()=>[...t].reverse().map(c=>({date:new Date(c.time).toISOString(),value:c.value})),[t]);if(i)return b.jsx(ct,{loading:!0,children:"loading index…"});if(!r)return b.jsx(ct,{children:"no sentiment data"});const l=KD(r.value);return b.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2.5",children:[b.jsx("div",{className:"font-dmsans text-5xl font-bold leading-none tracking-tight tabular-nums",style:{color:l,textShadow:`0 0 28px ${l}55`},children:r.value}),b.jsx("div",{className:"body-sm rounded-full px-2.5 py-0.5 font-semibold uppercase tracking-wide",style:{color:l,background:`${l}1f`,border:`1px solid ${l}33`},children:r.classification}),b.jsxs("div",{className:"relative w-full max-w-[180px] overflow-hidden rounded-xl",children:[b.jsx("div",{className:"h-[11px] w-full opacity-40",style:{background:"linear-gradient(90deg, #FF1F5F 4.89%, #464646 34.15%, #464646 69.98%, #81FE90 100%)"}}),b.jsx("div",{className:"absolute left-0 top-0 h-full w-full",style:{background:"repeating-linear-gradient(to right, #14181D, #14181D 2px, transparent 2px, transparent 3px)"}}),b.jsx("div",{className:"absolute top-1/2 h-3 w-[3px] -translate-x-1/2 -translate-y-1/2 rounded-xs",style:{left:`${r.value}%`,background:l}})]}),b.jsx(Ix,{data:s,width:150,height:30,color:l}),b.jsxs("div",{className:"caption text-soft",children:["crypto fear & greed · ",e.sparklineDays,"d"]})]})}const JD={...Wx,component:QD};ow.schema;const eu={"10-K":"Annual report","10-Q":"Quarterly report","8-K":"Material event","20-F":"Annual report (foreign)","40-F":"Annual report (foreign)","6-K":"Foreign interim report","S-1":"Registration","S-3":"Registration","S-4":"Registration (M&A)","DEF 14A":"Proxy statement",DEFA14A:"Proxy materials","SC 13D":"Activist stake","SC 13G":"Passive stake",SD:"Specialized disclosure",3:"Initial insider ownership",4:"Insider transaction",5:"Annual insider ownership",144:"Proposed insider sale","11-K":"Employee benefit plan"},e8=/^(10-K|10-Q|8-K|20-F|40-F|6-K|S-|F-|424|DEF |DEFA|DEFM|11-K|SC 13|25)/i,t8=/^(3|4|5|144)(\/A)?$/;function i0(e){return e.replace(/^SCHEDULE /i,"SC ").trim()}function n8(e,t){return t==="all"?!0:t==="insider"?t8.test(e):e8.test(e)}function i8(e){const t=i0(e.form);if(eu[t])return eu[t];const i=t.replace(/\/A$/,"");return i!==t&&eu[i]?`${eu[i]} (amended)`:e.description&&e.description.toUpperCase()!==e.form.toUpperCase()?e.description:t}function r8({filing:e}){return b.jsxs("a",{href:e.url,target:"_blank",rel:"noreferrer noopener",className:"group flex min-w-0 items-center gap-3 border-b border-white/[0.06] py-1.5 no-underline transition-colors last:border-b-0 hover:bg-white/[0.03]",children:[b.jsx("span",{title:e.form,className:"font-dmsans text-strong inline-flex w-16 shrink-0 justify-center truncate rounded bg-white/[0.06] px-1.5 py-1 text-[11px] font-bold",children:i0(e.form)}),b.jsxs("span",{className:"min-w-0 flex-1",children:[b.jsx("span",{className:"body-sm text-normal block truncate font-medium",children:i8(e)}),b.jsx("span",{className:"caption text-soft block truncate",children:e.reportDate?`period ${e.reportDate}`:e.items?`items ${e.items}`:e.accessionNumber})]}),b.jsx("span",{className:"caption text-soft shrink-0 tabular-nums",children:e.filingDate}),b.jsx("span",{className:"caption text-soft shrink-0 opacity-0 transition-opacity group-hover:opacity-100",children:"↗"})]})}function a8({config:e}){const{data:t,isLoading:i}=Zz(e.symbol),r=M.useMemo(()=>((t==null?void 0:t.filings)??[]).filter(f=>n8(i0(f.form),e.forms)).slice(0,e.count),[t==null?void 0:t.filings,e.forms,e.count]);if(i)return b.jsx(ct,{loading:!0,children:"loading SEC filings…"});if(!t)return b.jsxs(ct,{children:['no SEC data for "',e.symbol,'"']});const s=t.tickers[0],l=e.symbol.includes(":")?e.symbol:s?`xyz:${s}`:null,c=[t.exchanges[0],t.category].filter(Boolean).join(" · ");return b.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-3",children:[b.jsxs("div",{className:"flex items-start justify-between gap-3",children:[b.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[l&&b.jsx(fs,{symbol:l,size:22}),b.jsxs("div",{className:"min-w-0",children:[b.jsx("div",{className:"body-sm text-strong truncate font-semibold",children:t.name||s||e.symbol}),c&&b.jsx("div",{className:"caption text-soft truncate",children:c})]})]}),b.jsx("div",{className:"caption text-soft shrink-0 text-right",children:"filings"})]}),b.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:r.length>0?r.map(f=>b.jsx(r8,{filing:f},f.accessionNumber)):b.jsxs("div",{className:"body-sm text-soft flex h-full items-center justify-center text-center",children:["no ",e.forms==="all"?"":`${e.forms} `,"filings"]})})]})}const s8={...ow,component:a8};cw.schema;function o8(e){if(e.unit==="USD/shares")return`$${e.value.toFixed(2)}`;const t=Math.abs(e.value);if(e.unit==="shares")return t>=1e9?`${(e.value/1e9).toFixed(2)}B`:t>=1e6?`${(e.value/1e6).toFixed(1)}M`:e.value.toLocaleString("en-US");const i=e.value<0?"-":"";return t>=1e12?`${i}$${(t/1e12).toFixed(2)}T`:t>=1e9?`${i}$${(t/1e9).toFixed(2)}B`:t>=1e6?`${i}$${(t/1e6).toFixed(1)}M`:`${i}$${t.toLocaleString("en-US")}`}function l8({config:e}){const{data:t,isLoading:i}=Iz(e.symbol);return i?b.jsx(ct,{loading:!0,children:"loading SEC financials…"}):!t||t.metrics.length===0?b.jsxs(ct,{children:['no SEC financials for "',e.symbol,'"']}):b.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-3",children:[b.jsxs("div",{className:"flex items-start justify-between gap-3",children:[b.jsxs("div",{className:"min-w-0",children:[b.jsx("div",{className:"body-sm text-strong truncate font-semibold",children:t.entityName||e.symbol}),b.jsx("div",{className:"caption text-soft truncate",children:"SEC EDGAR · XBRL company facts"})]}),b.jsxs("div",{className:"caption text-soft shrink-0 text-right",children:["keyless",b.jsx("br",{}),"on filing"]})]}),b.jsx("div",{className:"grid min-h-0 flex-1 grid-cols-2 content-start gap-2 overflow-y-auto",children:t.metrics.map(r=>b.jsxs("div",{className:"rounded bg-white/[0.04] px-3 py-2",children:[b.jsx("div",{className:"caption text-soft truncate",children:r.label}),b.jsx("div",{className:"font-dmsans text-strong text-lg font-bold tabular-nums",children:o8(r)}),b.jsx("div",{className:"caption text-soft truncate",children:r.fiscalPeriod})]},r.label))})]})}const c8={...cw,component:l8};fw.schema;const Ly=14400*1e3,u8=4320*60*1e3;function f8({data:e,width:t}){return t<44?null:b.jsx("div",{className:"flex h-full w-full items-center justify-center",children:b.jsxs("span",{className:"text-[10px] font-medium text-white/90 tabular-nums",children:[(e.rate*100).toFixed(4),"%"]})})}function d8({config:e}){const t=M.useMemo(()=>Date.now()-u8,[]),{history:i,isLoading:r}=E2(e.symbols,t),s=M.useMemo(()=>{const l=[];for(const c of e.symbols){const f=i[c]??[],h=new Map;for(const d of f){const g=Math.floor(d.time/Ly)*Ly,v=h.get(g)??{sum:0,n:0};v.sum+=d.fundingRate,v.n+=1,h.set(g,v)}for(const[d,{sum:g,n:v}]of h){const y=g/v,x=new Date(d),S=`${x.toLocaleDateString("en-US",{weekday:"short"})} ${String(x.getHours()).padStart(2,"0")}h`;l.push({id:`${c}-${d}`,row:c,column:S,value:y*1e4,rate:y})}}return l},[i,e.symbols]);return r?b.jsx(ct,{loading:!0,children:"loading funding…"}):s.length===0?b.jsx(ct,{children:"no funding data"}):b.jsx(tD,{data:s,CellComponent:f8,gap:3,showLabels:!0,rowLabelWidth:48,columnLabelHeight:20})}const h8={...fw,component:d8},m8={"24h":{ms:1440*60*1e3,timeframe:Ra["24h"]},"7D":{ms:10080*60*1e3,timeframe:Ra["7D"]},"1M":{ms:720*60*60*1e3,timeframe:Ra["1M"]}};Kx.schema;function g8({config:e}){const{ms:t,timeframe:i}=m8[e.lookback],r=M.useMemo(()=>Date.now()-t,[t]),{history:s,isLoading:l}=E2(e.symbols,r),c=M.useMemo(()=>e.symbols.map((f,h)=>({id:f,name:f,color:yr[h%yr.length],data:(s[f]??[]).map(d=>({date:new Date(d.time).toISOString(),value:d.fundingRate*100}))})),[e.symbols,s]);return b.jsx(Zx,{series:c,timeframe:i,height:250,isLoading:l,formatValue:f=>`${f.toFixed(4)}%`})}const p8={...Kx,component:g8};hw.schema;function v8({config:e}){return b.jsxs("div",{className:"flex h-full w-full items-end gap-3 pb-2",children:[b.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx("span",{className:"h-[5px] w-[5px] shrink-0 rounded-full",style:{background:"var(--color-highlight)",boxShadow:"0 0 8px var(--color-highlight)"}}),b.jsx("h2",{className:"font-dmsans text-strong text-[0.8rem] font-extrabold uppercase leading-none tracking-[0.16em]",children:e.title})]}),e.subtitle&&b.jsx("p",{className:"caption text-soft pl-[13px] leading-none",children:e.subtitle})]}),b.jsx("span",{className:"mb-[5px] h-px flex-1",style:{background:"linear-gradient(90deg, rgba(255,255,255,0.16), rgba(255,255,255,0.02) 65%, transparent)"}})]})}const y8={...hw,component:v8};dw.schema;function b8({config:e}){const[t,i]=M.useState("loading");return M.useEffect(()=>i("loading"),[e.url]),t==="error"?b.jsx(ct,{children:"image unavailable"}):b.jsxs("div",{className:"relative flex h-full w-full items-center justify-center overflow-hidden rounded-md",children:[t==="loading"&&b.jsx("div",{className:"absolute inset-0 z-10",children:b.jsx(ct,{loading:!0,children:"loading image..."})}),b.jsx("img",{src:e.url,alt:e.alt,className:`h-full w-full transition-opacity duration-300 ${t==="loaded"?"opacity-100":"opacity-0"}`,style:{objectFit:e.fit},onLoad:()=>i("loaded"),onError:()=>i("error")})]})}const x8={...dw,component:b8};sw.schema;const w8="CUUR0000SA0";function Uy(e,t){return!t||t<=0?null:(e/t-1)*100}function _8({config:e}){const i=new Date().getUTCFullYear(),r=i-2,{series:s,isLoading:l}=Vz(w8,r,i),c=M.useMemo(()=>((s==null?void 0:s.points)??[]).slice(-e.months),[e.months,s==null?void 0:s.points]),f=c.at(-1),h=c.at(-2),d=f?c.find(_=>{const T=new Date(_.time),E=new Date(f.time);return T.getUTCFullYear()===E.getUTCFullYear()-1&&T.getUTCMonth()===E.getUTCMonth()}):void 0,g=M.useMemo(()=>c.map(_=>({date:new Date(_.time).toISOString(),value:_.value})),[c]);if(l)return b.jsx(ct,{loading:!0,children:"loading CPI…"});if(!s||!f)return b.jsx(ct,{children:"no CPI data"});const v=Uy(f.value,h==null?void 0:h.value),y=Uy(f.value,d==null?void 0:d.value),S=ka(y??v??0);return b.jsxs("div",{className:"flex h-full flex-col justify-center gap-3",children:[b.jsxs("div",{className:"flex items-start justify-between gap-3",children:[b.jsxs("div",{children:[b.jsx("div",{className:"caption text-soft uppercase",children:"BLS CPI-U"}),b.jsx("div",{className:"body-sm text-normal",children:f.date})]}),b.jsx("div",{className:"caption text-soft text-right",children:"monthly"})]}),b.jsxs("div",{className:"flex items-end justify-between gap-3",children:[b.jsxs("div",{children:[b.jsx("div",{className:"font-dmsans text-5xl font-bold leading-none tabular-nums",style:{color:S,textShadow:`0 0 24px ${S}44`},children:y!==null?ho(y):"--"}),b.jsx("div",{className:"caption text-soft mt-1",children:"year over year"})]}),b.jsxs("div",{className:"text-right",children:[b.jsx("div",{className:"caption text-soft",children:"index"}),b.jsx("div",{className:"body-md text-strong font-bold tabular-nums",children:f.value.toFixed(3)}),b.jsx("div",{className:"caption text-soft mt-2",children:"month over month"}),b.jsx("div",{className:"body-md font-bold tabular-nums",style:{color:ka(v??0)},children:v!==null?ho(v):"--"})]})]}),b.jsx(Ix,{data:g,width:210,height:46,color:S}),b.jsxs("div",{className:"caption text-soft",children:[s.label," · ",c.length," monthly observations"]})]})}const S8={...sw,component:_8},Fn=[1,2,3,4,5],T8=[0,1,2,3,4],E8={US:["2026-01-01","2026-01-19","2026-02-16","2026-04-03","2026-05-25","2026-06-19","2026-07-03","2026-09-07","2026-11-26","2026-12-25"],TSX:["2026-01-01","2026-02-16","2026-04-03","2026-05-18","2026-07-01","2026-08-03","2026-09-07","2026-10-12","2026-12-25","2026-12-28"],B3:["2026-01-01","2026-02-16","2026-02-17","2026-04-03","2026-04-21","2026-05-01","2026-06-04","2026-09-07","2026-10-12","2026-11-02","2026-11-20","2026-12-25"],LSE:["2026-01-01","2026-04-03","2026-04-06","2026-05-04","2026-05-25","2026-08-31","2026-12-25","2026-12-28"],XETRA:["2026-01-01","2026-04-03","2026-04-06","2026-05-01","2026-12-24","2026-12-25","2026-12-31"],EURONEXT:["2026-01-01","2026-04-03","2026-04-06","2026-05-01","2026-12-25"],SIX:["2026-01-01","2026-01-02","2026-04-03","2026-04-06","2026-05-01","2026-05-14","2026-05-25","2026-12-24","2026-12-25","2026-12-31"],TSE:["2026-01-01","2026-01-02","2026-01-12","2026-02-11","2026-02-23","2026-03-20","2026-04-29","2026-05-04","2026-05-05","2026-05-06","2026-07-20","2026-08-11","2026-09-21","2026-09-22","2026-09-23","2026-10-12","2026-11-03","2026-11-23","2026-12-31"],HKEX:["2026-01-01","2026-02-17","2026-02-18","2026-02-19","2026-04-03","2026-04-06","2026-05-01","2026-05-25","2026-06-19","2026-07-01","2026-10-01","2026-10-19","2026-12-25"],CN:["2026-01-01","2026-02-16","2026-02-17","2026-02-18","2026-02-19","2026-02-20","2026-02-23","2026-02-24","2026-04-06","2026-05-01","2026-05-04","2026-05-05","2026-06-19","2026-10-01","2026-10-02","2026-10-05","2026-10-06","2026-10-07","2026-10-08"],NSE:["2026-01-26","2026-04-03","2026-05-01","2026-08-15","2026-10-02","2026-12-25"],KRX:["2026-01-01","2026-03-01","2026-05-05","2026-06-06","2026-08-15","2026-10-03","2026-10-09","2026-12-25"],SGX:["2026-01-01","2026-05-01","2026-08-10","2026-12-25"],SET:["2026-01-01","2026-01-02","2026-03-03","2026-04-06","2026-04-13","2026-04-14","2026-04-15","2026-05-01","2026-05-04","2026-06-01","2026-06-03","2026-07-28","2026-07-29","2026-08-12","2026-10-13","2026-10-23","2026-12-07","2026-12-10","2026-12-31"],ASX:["2026-01-01","2026-01-26","2026-04-03","2026-04-06","2026-04-07","2026-04-25","2026-06-08","2026-12-25","2026-12-28"],JSE:["2026-01-01","2026-03-21","2026-04-03","2026-04-06","2026-04-27","2026-05-01","2026-06-16","2026-08-10","2026-09-24","2026-12-16","2026-12-25"],TADAWUL:["2026-09-23"]},z8={NYSE:{code:"NYSE",name:"New York Stock Exchange",city:"New York",country:"US",website:"https://www.nyse.com",mark:"NY",tz:"America/New_York",open:"09:30",close:"16:00",days:Fn,region:"Americas",holidayGroup:"US"},NASDAQ:{code:"NASDAQ",name:"Nasdaq",city:"New York",country:"US",website:"https://www.nasdaq.com",mark:"NQ",tz:"America/New_York",open:"09:30",close:"16:00",days:Fn,region:"Americas",holidayGroup:"US"},TSX:{code:"TSX",name:"Toronto Stock Exchange",city:"Toronto",country:"CA",website:"https://www.tsx.com",mark:"TX",tz:"America/Toronto",open:"09:30",close:"16:00",days:Fn,region:"Americas"},B3:{code:"B3",name:"B3",city:"São Paulo",country:"BR",website:"https://www.b3.com.br/en_us/",mark:"B3",tz:"America/Sao_Paulo",open:"10:00",close:"17:00",days:Fn,region:"Americas"},LSE:{code:"LSE",name:"London Stock Exchange",city:"London",country:"GB",website:"https://www.londonstockexchange.com",mark:"LS",tz:"Europe/London",open:"08:00",close:"16:30",days:Fn,region:"Europe"},XETRA:{code:"XETRA",name:"Deutsche Börse Xetra",city:"Frankfurt",country:"DE",website:"https://www.boerse-frankfurt.de/en",mark:"DX",tz:"Europe/Berlin",open:"09:00",close:"17:30",days:Fn,region:"Europe"},EURONEXT:{code:"EURONEXT",name:"Euronext Paris",city:"Paris",country:"FR",website:"https://www.euronext.com",mark:"EN",tz:"Europe/Paris",open:"09:00",close:"17:30",days:Fn,region:"Europe"},SIX:{code:"SIX",name:"SIX Swiss Exchange",city:"Zurich",country:"CH",website:"https://www.six-group.com/en/products-services/the-swiss-stock-exchange.html",mark:"SX",tz:"Europe/Zurich",open:"09:00",close:"17:30",days:Fn,region:"Europe"},TSE:{code:"TSE",name:"Tokyo Stock Exchange",city:"Tokyo",country:"JP",website:"https://www.jpx.co.jp/english/",mark:"JP",tz:"Asia/Tokyo",open:"09:00",close:"15:30",days:Fn,region:"Asia-Pacific"},HKEX:{code:"HKEX",name:"Hong Kong Exchange",city:"Hong Kong",country:"HK",website:"https://www.hkex.com.hk",mark:"HK",tz:"Asia/Hong_Kong",open:"09:30",close:"16:00",days:Fn,region:"Asia-Pacific"},SSE:{code:"SSE",name:"Shanghai Stock Exchange",city:"Shanghai",country:"CN",website:"https://english.sse.com.cn",mark:"SH",tz:"Asia/Shanghai",open:"09:30",close:"15:00",days:Fn,region:"Asia-Pacific",holidayGroup:"CN"},NSE:{code:"NSE",name:"National Stock Exchange",city:"Mumbai",country:"IN",website:"https://www.nseindia.com",mark:"NS",tz:"Asia/Kolkata",open:"09:15",close:"15:30",days:Fn,region:"Asia-Pacific"},KRX:{code:"KRX",name:"Korea Exchange",city:"Seoul",country:"KR",website:"https://global.krx.co.kr",mark:"KR",tz:"Asia/Seoul",open:"09:00",close:"15:30",days:Fn,region:"Asia-Pacific"},SGX:{code:"SGX",name:"Singapore Exchange",city:"Singapore",country:"SG",website:"https://www.sgx.com",mark:"SG",tz:"Asia/Singapore",open:"09:00",close:"17:00",days:Fn,region:"Asia-Pacific"},SET:{code:"SET",name:"Stock Exchange of Thailand",city:"Bangkok",country:"TH",website:"https://www.set.or.th/en/home",mark:"SET",tz:"Asia/Bangkok",open:"10:00",close:"16:30",days:Fn,region:"Asia-Pacific"},ASX:{code:"ASX",name:"Australian Securities Exchange",city:"Sydney",country:"AU",website:"https://www.asx.com.au",mark:"AS",tz:"Australia/Sydney",open:"10:00",close:"16:00",days:Fn,region:"Asia-Pacific"},JSE:{code:"JSE",name:"Johannesburg Stock Exchange",city:"Johannesburg",country:"ZA",website:"https://www.jse.co.za",mark:"JS",tz:"Africa/Johannesburg",open:"09:00",close:"17:00",days:Fn,region:"Middle East / Africa"},TADAWUL:{code:"TADAWUL",name:"Saudi Exchange",city:"Riyadh",country:"SA",website:"https://www.saudiexchange.sa",mark:"SA",tz:"Asia/Riyadh",open:"10:00",close:"15:00",days:T8,region:"Middle East / Africa"}},M8=["NYSE","NASDAQ","LSE","XETRA","EURONEXT","TSE","HKEX","SSE","NSE","SET","ASX"],C8={Sun:0,Mon:1,Tue:2,Wed:3,Thu:4,Fri:5,Sat:6};function Hy(e,t){const i=new Intl.DateTimeFormat("en-US",{timeZone:t,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short"}),r={};for(const s of i.formatToParts(e))s.type!=="literal"&&(r[s.type]=s.value);return{ymd:`${r.year}-${r.month}-${r.day}`,dow:C8[r.weekday]??0,minutes:Number(r.hour)*60+Number(r.minute)+Number(r.second)/60}}function By(e){const[t,i]=e.split(":").map(Number);return t*60+i}const A8=864e5,wl=1440;function N8(e,t){const i=E8[e.holidayGroup??e.code]??[],r=By(e.open),s=By(e.close),l=Hy(t,e.tz),c=(v,y)=>e.days.includes(v)&&!i.includes(y),f={code:e.code,name:e.name,city:e.city,country:e.country,website:e.website,mark:e.mark,tz:e.tz,open:e.open,close:e.close,region:e.region};if(c(l.dow,l.ymd)&&l.minutes>=r&&l.minutes<s)return{...f,status:"open",nextChangeMin:s-l.minutes};let d;if(c(l.dow,l.ymd)&&l.minutes<r)d=r-l.minutes;else{d=wl-l.minutes+r;let v=!1;for(let y=1;y<=10;y++){const x=Hy(new Date(t.getTime()+y*A8),e.tz);if(c(x.dow,x.ymd)){d=wl-l.minutes+(y-1)*wl+r,v=!0;break}}v||(d=-1)}const g=e.days.includes(l.dow)&&i.includes(l.ymd);return{...f,status:g?"holiday":"closed",nextChangeMin:d}}const $y=["Americas","Europe","Asia-Pacific","Middle East / Africa"],Gy={open:0,holiday:1,closed:2};function R8(e,t){const i=[...e];return t==="name"?i.sort((r,s)=>r.name.localeCompare(s.name)):t==="status"?i.sort((r,s)=>Gy[r.status]-Gy[s.status]||r.nextChangeMin-s.nextChangeMin):i.sort((r,s)=>$y.indexOf(r.region)-$y.indexOf(s.region)),i}function k8(e){if(e<0)return"—";if(e<1)return"<1m";const t=Math.floor(e),i=Math.floor(t/wl),r=Math.floor(t%wl/60),s=t%60;return i>0?`${i}d ${r}h`:r>0?`${r}h ${s}m`:`${s}m`}qx.schema;const xw={open:{color:"#34e2a3",chipBg:"rgba(52, 226, 163, 0.13)",label:"Open",verb:"closes",rail:"#34e2a3",railOpacity:1,wash:"linear-gradient(90deg, rgba(52, 226, 163, 0.08), transparent 40%)"},closed:{color:"#8b92a1",chipBg:"rgba(255, 255, 255, 0.045)",label:"Closed",verb:"opens",rail:"rgba(255, 255, 255, 0.22)",railOpacity:.55,wash:"none"},holiday:{color:"#f2b066",chipBg:"rgba(242, 176, 102, 0.13)",label:"Holiday",verb:"opens",rail:"#f2b066",railOpacity:1,wash:"linear-gradient(90deg, rgba(242, 176, 102, 0.07), transparent 40%)"}};function D8(){return b.jsxs("svg",{"aria-hidden":"true",className:"shrink-0",fill:"none",height:"15",viewBox:"0 0 20 20",width:"15",children:[b.jsx("circle",{cx:"10",cy:"10",r:"7.25",stroke:"currentColor",strokeOpacity:"0.75",strokeWidth:"1.5"}),b.jsx("path",{d:"M2.75 10h14.5M10 2.75c2 2 3 4.42 3 7.25s-1 5.25-3 7.25M10 2.75c-2 2-3 4.42-3 7.25s1 5.25 3 7.25",stroke:"currentColor",strokeLinecap:"round",strokeOpacity:"0.55",strokeWidth:"1.2"}),b.jsx("path",{d:"m5.25 12.75 2.6-2.3 2.1 1.55 3.95-4.8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.6"})]})}function O8(e,t){try{return new Intl.DateTimeFormat("en-US",{timeZone:t,hour:"2-digit",minute:"2-digit",hour12:!1,timeZoneName:"short"}).format(e)}catch{return t}}function j8(e){return/^[A-Z]{2}$/i.test(e)?[...e.toUpperCase()].map(t=>String.fromCodePoint(127462+t.charCodeAt(0)-65)).join(""):e}function L8(){return b.jsxs("svg",{"aria-hidden":"true",className:"opacity-50 transition group-hover:translate-x-0.5 group-hover:-translate-y-0.5 group-hover:opacity-95",fill:"none",height:"12",viewBox:"0 0 16 16",width:"12",children:[b.jsx("path",{d:"M6 4.5H4.5a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h5a2 2 0 0 0 2-2V10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5"}),b.jsx("path",{d:"M9 2.5h4.5V7M8.25 7.75l5-5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]})}function U8({state:e}){return b.jsx("span",{"aria-hidden":"true",className:"grid h-[30px] w-[30px] shrink-0 place-items-center overflow-hidden rounded-[9px] border border-white/10 shadow-[inset_0_1px_0_rgba(255,255,255,0.12),0_4px_10px_-7px_rgba(0,0,0,0.8)]",style:{background:"linear-gradient(150deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02) 48%, rgba(0,0,0,0.22))"},children:b.jsx("span",{className:"text-[1.15rem] leading-none drop-shadow-[0_1px_3px_rgba(0,0,0,0.5)]",children:j8(e.country)})})}function H8({state:e}){const t=xw[e.status],i=e.status==="closed";return b.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border px-2 py-[3px] font-dmsans text-[0.5rem] font-bold uppercase leading-none tracking-[0.09em]",style:{borderColor:i?"rgba(255,255,255,0.1)":`${t.color}33`,background:t.chipBg,color:i?"rgba(255,255,255,0.62)":t.color},children:[b.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{background:i?"rgba(255,255,255,0.45)":t.color,boxShadow:e.status==="open"?`0 0 6px ${t.color}`:void 0}}),t.label]})}function B8({now:e,state:t}){const i=xw[t.status],r=k8(t.nextChangeMin),s=O8(e,t.tz);return b.jsxs("a",{"aria-label":`${t.name} website`,className:"group relative grid min-h-[42px] grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 overflow-hidden rounded-xl border border-white/[0.06] bg-white/[0.022] py-1.5 pr-2.5 pl-3 text-white/90 transition duration-200 hover:-translate-y-px hover:border-white/[0.14] hover:bg-white/[0.05] hover:text-white focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white/50",href:t.website,rel:"noreferrer",style:{backgroundImage:i.wash},target:"_blank",title:`${t.name} · ${t.city} · ${t.open}-${t.close}`,children:[b.jsx("span",{"aria-hidden":"true",className:"absolute inset-y-[5px] left-0 w-[3px] rounded-r-full",style:{background:i.rail,opacity:i.railOpacity}}),b.jsx(U8,{state:t}),b.jsxs("span",{className:"relative min-w-0 pl-0.5",children:[b.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[b.jsx("span",{className:"truncate font-dmsans text-[0.78rem] font-bold leading-[1.05rem] text-white",children:t.name}),b.jsx(L8,{})]}),b.jsxs("span",{className:"text-soft flex min-w-0 items-center gap-1.5 font-dmsans text-[0.66rem] leading-[0.85rem] tabular-nums",children:[b.jsx("span",{className:"truncate",children:t.city}),b.jsx("span",{className:"h-[3px] w-[3px] shrink-0 rounded-full bg-white/25"}),b.jsx("span",{className:"shrink-0",children:s})]})]}),b.jsxs("span",{className:"relative flex min-w-[84px] flex-col items-end gap-1",children:[b.jsx(H8,{state:t}),b.jsxs("span",{className:"whitespace-nowrap text-right font-dmsans text-[0.66rem] leading-[0.8rem] tabular-nums",style:{color:t.status==="closed"?"rgba(255,255,255,0.55)":i.color},children:[i.verb," ",r]})]})]})}function $8({config:e}){const[t,i]=M.useState(()=>new Date);M.useEffect(()=>{const f=window.setInterval(()=>i(new Date),3e4);return()=>window.clearInterval(f)},[]);const r=e.exchanges.length?e.exchanges:M8,s=r.join(","),l=M.useMemo(()=>{const f=r.map(h=>z8[h.toUpperCase()]).filter(h=>!!h).map(h=>N8(h,t));return R8(f,e.sort)},[s,t,e.sort]);if(l.length===0)return b.jsx(ct,{children:"no known exchanges — check the codes"});const c=l.filter(f=>f.status==="open").length;return b.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:[b.jsxs("div",{className:"caption text-soft mb-2 flex items-center justify-between gap-3 uppercase tracking-wide",children:[b.jsx("span",{className:"truncate",children:"exchange sessions"}),b.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5 rounded-full border border-white/[0.08] bg-white/[0.045] px-2 py-0.5 tabular-nums",children:[c>0&&b.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{background:"#34e2a3",boxShadow:"0 0 6px #34e2a3"}}),b.jsx("span",{className:"font-bold text-white",children:c}),b.jsxs("span",{className:"text-soft",children:["/ ",l.length," open"]})]})]}),b.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-1 overflow-auto pr-0.5",children:l.map(f=>b.jsx(B8,{now:t,state:f},f.code))})]})}const G8={...qx,component:$8,titleIcon:D8};Qx.schema;function Y8({config:e}){return b.jsx("div",{className:`body-md text-normal h-full overflow-auto whitespace-pre-wrap ${e.align==="center"?"flex items-center justify-center text-center":""}`,children:e.text})}const F8={...Qx,component:Y8};function um(e){const t=e.match(/^#([0-9a-f]{3,8})$/i);if(t){let r=t[1];return r.length===3&&(r=r[0]+r[0]+r[1]+r[1]+r[2]+r[2]),[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16)]}const i=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return i?[+i[1],+i[2],+i[3]]:[128,128,128]}function tu(e,t,i,r){return`rgba(${e}, ${t}, ${i}, ${r})`}function fm(e,t){const[i,r,s]=um(e),l=t==="dark";return{line:e,lineWidth:2,fillTop:tu(i,r,s,l?.12:.08),fillBottom:tu(i,r,s,0),gridLine:l?"rgba(255, 255, 255, 0.06)":"rgba(0, 0, 0, 0.06)",gridLabel:l?"rgba(255, 255, 255, 0.4)":"rgba(0, 0, 0, 0.35)",dotUp:"#22c55e",dotDown:"#ef4444",dotFlat:e,glowUp:"rgba(34, 197, 94, 0.18)",glowDown:"rgba(239, 68, 68, 0.18)",glowFlat:tu(i,r,s,.12),badgeOuterBg:l?"rgba(40, 40, 40, 0.95)":"rgba(255, 255, 255, 0.95)",badgeOuterShadow:l?"rgba(0, 0, 0, 0.4)":"rgba(0, 0, 0, 0.15)",badgeBg:e,badgeText:"#ffffff",dashLine:tu(i,r,s,.4),refLine:l?"rgba(255, 255, 255, 0.15)":"rgba(0, 0, 0, 0.12)",refLabel:l?"rgba(255, 255, 255, 0.45)":"rgba(0, 0, 0, 0.4)",timeLabel:l?"rgba(255, 255, 255, 0.35)":"rgba(0, 0, 0, 0.3)",crosshairLine:l?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.12)",tooltipBg:l?"rgba(30, 30, 30, 0.95)":"rgba(255, 255, 255, 0.95)",tooltipText:l?"#e5e5e5":"#1a1a1a",tooltipBorder:l?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.08)",bgRgb:l?[10,10,10]:[255,255,255],labelFont:'11px "SF Mono", Menlo, Monaco, "Cascadia Code", monospace',valueFont:'600 11px "SF Mono", Menlo, monospace',badgeFont:'500 11px "SF Mono", Menlo, monospace'}}var no=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#06b6d4","#f97316"];function P8(e,t){const i=new Map;for(let r=0;r<e.length;r++){const s=e[r],l=s.color||no[r%no.length];i.set(s.id,fm(l,t))}return i}function zt(e,t,i,r=16.67){const s=1-Math.pow(1-i,r/16.67);return e+(t-e)*s}function uu(e,t,i,r){let s=1/0,l=-1/0;for(const d of e)d.value<s&&(s=d.value),d.value>l&&(l=d.value);t<s&&(s=t),t>l&&(l=t),i!==void 0&&(i<s&&(s=i),i>l&&(l=i));const c=l-s,f=r?.01:.12,h=c*(r?.02:.1)||(r?.04:.4);if(c<h){const d=(s+l)/2;s=d-h/2,l=d+h/2}else{const d=c*f;s-=d,l+=d}return{min:s,max:l}}function Yy(e,t=20){if(e.length<5)return"flat";const i=Math.max(0,e.length-t);let r=1/0,s=-1/0;for(let v=i;v<e.length;v++){const y=e[v].value;y<r&&(r=y),y>s&&(s=y)}const l=s-r;if(l===0)return"flat";const c=Math.max(i,e.length-5),f=e[c].value,d=e[e.length-1].value-f,g=l*.12;return d>g?"up":d<-g?"down":"flat"}function ww(e,t){if(e.length===0)return null;if(t<=e[0].time)return e[0].value;if(t>=e[e.length-1].time)return e[e.length-1].value;let i=0,r=e.length-1;for(;r-i>1;){const h=i+r>>1;e[h].time<=t?i=h:r=h}const s=e[i],l=e[r],c=l.time-s.time;if(c===0)return s.value;const f=(t-s.time)/c;return s.value+(l.value-s.value)*f}function V8(){return typeof window>"u"?1:Math.min(window.devicePixelRatio||1,3)}function Z8(e,t,i,r){e.setTransform(t,0,0,t,0,0)}function I8(e,t,i,r){if(r>0){const c=r*t;if(c>=i*.5&&c<=i*4)return r}const s=[[2,2.5,2],[2,2,2.5],[2.5,2,2]];let l=1/0;for(const c of s){let f=Math.pow(10,Math.ceil(Math.log10(e))),h=0;for(;f/c[h%3]*t>=i;)f/=c[h%3],h++;f<l&&(l=f)}return l===1/0?e/5:l}function X8(e,t){const i=e/t;return Math.abs(i-Math.round(i))<.01}var Fy=.18,q8=.12;function r0(e,t,i,r,s,l){const{w:c,h:f,pad:h,valRange:d,minVal:g,maxVal:v,toY:y}=t,x=f-h.top-h.bottom;if(x<=0||d<=0)return;const S=x/d,_=I8(d,S,36,s.interval);s.interval=_;const T=_/2,E=T*S,C=E<40?0:E>=60?1:(E-40)/20,k=32,B=A=>{const $=Math.min(A-h.top,f-h.bottom-A);return $>=k?1:$<=0?0:$/k},P=new Map,N=Math.ceil(g/T)*T;for(let A=N;A<=v;A+=T){const $=y(A);if($<h.top-2||$>f-h.bottom+2)continue;const Y=(X8(A,_)?1:C)*B($),O=Math.round(A*1e6);P.set(O,Y)}for(const[A,$]of s.labels){const I=P.get(A)??0,Y=I>=$?Fy:q8;let O=zt($,I,Y,l);Math.abs(O-I)<.02&&(O=I),O<.01&&I===0?s.labels.delete(A):s.labels.set(A,O)}for(const[A,$]of P)s.labels.has(A)||s.labels.set(A,$*Fy);const U=e.globalAlpha;e.setLineDash([1,3]),e.lineWidth=1,e.font=i.labelFont,e.textAlign="left";for(const[A,$]of s.labels){if($<.02)continue;const I=A/1e6,Y=y(I);Y<h.top-10||Y>f-h.bottom+10||(e.save(),e.globalAlpha=U*$,e.strokeStyle=i.gridLine,e.beginPath(),e.moveTo(h.left,Y),e.lineTo(c-h.right,Y),e.stroke(),e.fillStyle=i.gridLabel,e.fillText(r(I),c-h.right+8,Y+4),e.restore())}e.setLineDash([])}function Yu(e,t){if(t.length<2)return;if(t.length===2){e.lineTo(t[1][0],t[1][1]);return}const i=t.length,r=new Array(i-1),s=new Array(i-1);for(let c=0;c<i-1;c++)s[c]=t[c+1][0]-t[c][0],r[c]=s[c]===0?0:(t[c+1][1]-t[c][1])/s[c];const l=new Array(i);l[0]=r[0],l[i-1]=r[i-2];for(let c=1;c<i-1;c++)r[c-1]*r[c]<=0?l[c]=0:l[c]=(r[c-1]+r[c])/2;for(let c=0;c<i-1;c++)if(r[c]===0)l[c]=0,l[c+1]=0;else{const f=l[c]/r[c],h=l[c+1]/r[c],d=f*f+h*h;if(d>9){const g=3/Math.sqrt(d);l[c]=g*f*r[c],l[c+1]=g*h*r[c]}}for(let c=0;c<i-1;c++){const f=s[c];e.bezierCurveTo(t[c][0]+f/3,t[c][1]+l[c]*f/3,t[c+1][0]-f/3,t[c+1][1]-l[c+1]*f/3,t[c+1][0],t[c+1][1])}}var a0=.07,s0=.001;function o0(e,t,i,r){return t+i*(Math.sin(e*9.4+r)*.55+Math.sin(e*15.7+r*1.3)*.3+Math.sin(e*4.2+r*.7)*.15)}function l0(e){return .22+.08*Math.sin(e/1200*Math.PI)}function Py(e){const t=e.match(/^#([0-9a-f]{3,8})$/i);if(t){let s=t[1];return s.length===3&&(s=s[0]+s[0]+s[1]+s[1]+s[2]+s[2]),[parseInt(s.slice(0,2),16),parseInt(s.slice(2,4),16),parseInt(s.slice(4,6),16),1]}const i=e.match(/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)/);if(i)return[+i[1],+i[2],+i[3],+i[4]];const r=e.match(/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return r?[+r[1],+r[2],+r[3],1]:[128,128,128,1]}function W8(e,t,i){if(i<=0)return e;if(i>=1)return t;const[r,s,l,c]=Py(e),[f,h,d,g]=Py(t),v=Math.round(r+(f-r)*i),y=Math.round(s+(h-s)*i),x=Math.round(l+(d-l)*i),S=c+(g-c)*i;return S>=.995?`rgb(${v},${y},${x})`:`rgba(${v},${y},${x},${S.toFixed(3)})`}function Ch(e,t,i,r,s,l=1,c=1,f){const{h,pad:d}=t,g=e.globalAlpha;if(s&&c>.01){e.globalAlpha=g*c;const v=e.createLinearGradient(0,d.top,0,h-d.bottom);v.addColorStop(0,i.fillTop),v.addColorStop(1,i.fillBottom),e.beginPath(),e.moveTo(r[0][0],h-d.bottom),e.lineTo(r[0][0],r[0][1]),Yu(e,r),e.lineTo(r[r.length-1][0],h-d.bottom),e.closePath(),e.fillStyle=v,e.fill()}e.globalAlpha=g*l,e.beginPath(),e.moveTo(r[0][0],r[0][1]),Yu(e,r),e.strokeStyle=f??i.line,e.lineWidth=i.lineWidth,e.lineJoin="round",e.lineCap="round",e.stroke(),e.globalAlpha=g}function c0(e,t,i,r,s,l,c,f,h=0,d=1,g=0,v=1,y=!1,x=1){const{h:S,pad:_,toX:T,toY:E,chartW:C,chartH:k}=t,B=e.globalAlpha,P=_.top,N=S-_.bottom,U=X=>Math.max(P,Math.min(N,X)),A=_.top+k/2,$=k*a0,I=g*s0,Y=d<1?(X,ae)=>{const he=Math.max(0,Math.min(1,(ae-_.left)/C)),de=Math.abs(he-.5)*2,ve=Math.max(0,Math.min(1,(d-de*.4)/.6)),be=o0(he,A,$,I);return be+(X-be)*ve}:(X,ae)=>X,O=r.map((X,ae)=>{const he=T(X.time),de=ae===r.length-1?Y(U(E(s)),he):Y(U(E(X.value)),he);return[he,de]}),j=T(l),L=_.left+C,K=d<1?j+(L-j)*(1-d):j;if(O.push([K,Y(U(E(s)),K)]),O.length<2)return;let D=1,V=x;if(d<1){const X=l0(g);D=X+(1-X)*d,V=d*x}const ie=Math.min(1,d*3)*v,ue=d<1||v<1?W8(i.gridLabel,i.line,ie):void 0,J=f!==null;if(e.save(),e.beginPath(),e.rect(_.left-1,_.top,C+2,k),e.clip(),J?(e.save(),e.beginPath(),e.rect(0,0,f,S),e.clip(),Ch(e,t,i,O,c,D,V,ue),e.restore(),e.save(),e.beginPath(),e.rect(f,0,t.w-f,S),e.clip(),e.globalAlpha=B*(1-h*.6),Ch(e,t,i,O,c,D,V,ue),e.restore()):Ch(e,t,i,O,c,D,V,ue),e.restore(),!y){const X=Math.max(_.top,Math.min(S-_.bottom,E(s))),ae=d<1?A+(X-A)*d:X;e.setLineDash([4,4]),e.strokeStyle=i.dashLine,e.lineWidth=1;const he=J?1-h*.2:1;e.globalAlpha=B*(d<1?he*d:he),e.beginPath(),e.moveTo(_.left,ae),e.lineTo(t.w-_.right,ae),e.stroke(),e.setLineDash([])}e.globalAlpha=B;const R=O[O.length-1];return R[1]=Math.max(10,Math.min(S-10,R[1])),O}var _w=1500,Sw=900;function K8(e,t,i){const r=Math.round(e[0]+(t[0]-e[0])*i),s=Math.round(e[1]+(t[1]-e[1])*i),l=Math.round(e[2]+(t[2]-e[2])*i);return`rgb(${r},${s},${l})`}function Tw(e,t,i,r,s=!0,l=0,c=performance.now()){const f=e.globalAlpha,h=l*.7;if(s&&h<.3){const g=c%_w/Sw;if(g<1){const v=9+g*12,y=.35*(1-g)*(1-h*3);e.beginPath(),e.arc(t,i,v,0,Math.PI*2),e.strokeStyle=r.line,e.lineWidth=1.5,e.globalAlpha=f*y,e.stroke()}}const d=um(r.badgeOuterBg);if(e.save(),e.globalAlpha=f,e.shadowColor=r.badgeOuterShadow,e.shadowBlur=6*(1-h),e.shadowOffsetY=1,e.beginPath(),e.arc(t,i,6.5,0,Math.PI*2),e.fillStyle=r.badgeOuterBg,e.fill(),e.restore(),e.globalAlpha=f,e.beginPath(),e.arc(t,i,3.5,0,Math.PI*2),h>.01){const g=um(r.line);e.fillStyle=K8(g,d,h)}else e.fillStyle=r.line;e.fill()}function Q8(e,t,i,r,s=!0,l=performance.now(),c=3){const f=e.globalAlpha;if(s){const h=l%_w/Sw;if(h<1){const d=9+h*10,g=.3*(1-h);e.beginPath(),e.arc(t,i,d,0,Math.PI*2),e.strokeStyle=r,e.lineWidth=1.5,e.globalAlpha=f*g,e.stroke()}}e.globalAlpha=f,e.beginPath(),e.arc(t,i,c,0,Math.PI*2),e.fillStyle=r,e.fill()}function J8(e,t,i,r,s=3){e.beginPath(),e.arc(t,i,s,0,Math.PI*2),e.fillStyle=r,e.fill()}function e9(e,t,i,r,s,l,c,f=performance.now()){const h=e.globalAlpha,d=r==="up"?1:0,g=r==="down"?1:0,v=l.down<.02,y=l.up<.02;l.up=zt(l.up,v?d:0,d>l.up?.08:.04,c),l.down=zt(l.down,y?g:0,g>l.down?.08:.04,c),l.up<.01&&(l.up=0),l.down<.01&&(l.down=0),l.up>.99&&(l.up=1),l.down>.99&&(l.down=1);const x=f%1400/1400,S=(_,T)=>{if(T<.01)return;const E=t+19,C=i;e.save(),e.strokeStyle=s.gridLabel,e.lineWidth=2.5,e.lineCap="round",e.lineJoin="round";for(let k=0;k<2;k++){const B=k*.2,P=.35,N=x-B,A=.3+.7*(N>=0&&N<P?Math.sin(N/P*Math.PI):0);e.globalAlpha=h*T*A;const $=_===-1?-3:3,I=C+_*(k*8-4)+$;e.beginPath(),e.moveTo(E-5,I-_*3.5),e.lineTo(E,I),e.lineTo(E+5,I-_*3.5),e.stroke()}e.restore()};S(-1,l.up),S(1,l.down),e.globalAlpha=h}function t9(e,t,i,r,s,l,c,f,h,d,g,v){if(h<.01)return;const{h:y,pad:x,toY:S}=t,_=S(s);e.save(),e.globalAlpha=h*.5,e.strokeStyle=i.crosshairLine,e.lineWidth=1,e.beginPath(),e.moveTo(r,x.top),e.lineTo(r,y-x.bottom),e.stroke(),e.restore();const T=4*Math.min(h*3,1);if(T>.5&&(e.globalAlpha=1,e.beginPath(),e.arc(r,_,T,0,Math.PI*2),e.fillStyle=i.line,e.fill()),h<.1||t.w<300)return;const E=c(s),C=f(l),k=" · ";e.save(),e.globalAlpha=h,e.font='400 13px "SF Mono", Menlo, monospace';const B=e.measureText(E).width,P=e.measureText(k).width,N=e.measureText(C).width,U=B+P+N;let A=r-U/2;const $=x.left+4,Y=(g!=null?g+7:t.w-x.right)-U;A<$&&(A=$),A>Y&&(A=Y);const O=x.top+(d??14)+10;e.textAlign="left",v&&(e.strokeStyle=i.tooltipBg,e.lineWidth=3,e.lineJoin="round",e.strokeText(E,A,O),e.strokeText(k+C,A+B,O)),e.fillStyle=i.tooltipText,e.fillText(E,A,O),e.fillStyle=i.gridLabel,e.fillText(k+C,A+B,O),e.restore()}function n9(e,t,i,r,s,l,c,f,h,d,g,v){if(h<.01||l.length===0)return;const{h:y,pad:x,toY:S}=t;e.save(),e.globalAlpha=h*.5,e.strokeStyle=i.crosshairLine,e.lineWidth=1,e.beginPath(),e.moveTo(r,x.top),e.lineTo(r,y-x.bottom),e.stroke(),e.restore();const _=4*Math.min(h*3,1);if(_>.5){e.globalAlpha=1;for(const O of l){const j=S(O.value);e.beginPath(),e.arc(r,j,_,0,Math.PI*2),e.fillStyle=O.color,e.fill()}}if(h<.1||t.w<300)return;e.save(),e.globalAlpha=h,e.font='400 13px "SF Mono", Menlo, monospace',e.textAlign="left";const T=f(s),E=" · ",C=" ",k=[{text:T,color:i.gridLabel}];for(const O of l){k.push({text:E,color:i.gridLabel}),k.push({text:C,color:O.color,isDot:!0});const j=O.label?`${O.label} `:"";j&&k.push({text:j,color:i.gridLabel}),k.push({text:c(O.value),color:i.tooltipText})}let B=0;const P=[];for(const O of k){const j=O.isDot?12:e.measureText(O.text).width;P.push(j),B+=j}let N=r-B/2;const U=x.left+4,$=(v!=null?v+7:t.w-x.right)-B;N<U&&(N=U),N>$&&(N=$);const I=x.top+(d??14)+10;if(g!==!1){e.strokeStyle=i.tooltipBg,e.lineWidth=3,e.lineJoin="round";let O=N;for(let j=0;j<k.length;j++){const L=k[j];L.isDot||e.strokeText(L.text,O,I),O+=P[j]}}let Y=N;for(let O=0;O<k.length;O++){const j=k[O];j.isDot?(e.beginPath(),e.arc(Y+4,I-4,3.5,0,Math.PI*2),e.fillStyle=j.color,e.fill()):(e.fillStyle=j.color,e.fillText(j.text,Y,I)),Y+=P[O]}e.restore()}function Ew(e,t,i,r){const{w:s,h:l,pad:c,toY:f,chartW:h}=t,d=f(r.value);if(d<c.top-10||d>l-c.bottom+10)return;const g=r.label??"";if(g){e.font="500 11px system-ui, sans-serif";const v=e.measureText(g).width,y=c.left+h/2,x=8;e.strokeStyle=i.refLine,e.lineWidth=1,e.beginPath(),e.moveTo(c.left,d),e.lineTo(y-v/2-x,d),e.stroke(),e.beginPath(),e.moveTo(y+v/2+x,d),e.lineTo(s-c.right,d),e.stroke(),e.fillStyle=i.refLabel,e.textAlign="center",e.fillText(g,y,d+4)}else e.strokeStyle=i.refLine,e.lineWidth=1,e.setLineDash([4,4]),e.beginPath(),e.moveTo(c.left,d),e.lineTo(s-c.right,d),e.stroke(),e.setLineDash([])}function i9(e){return e<=15?2:e<=30?5:e<=60?10:e<=120?15:e<=300?30:e<=600?60:e<=1800?300:e<=3600?600:e<=14400?1800:e<=43200?3600:e<=86400?7200:e<=604800?86400:604800}var r9=.08;function u0(e,t,i,r,s,l,c,f){const{h,pad:d,leftEdge:g,rightEdge:v,toX:y}=t,x=d.left,S=t.w-d.right,_=S-x,T=50,E=O=>{const j=O-x,L=S-O,K=Math.min(j,L);return K>=T?1:K<=0?0:K/T};e.font=i.labelFont;const C=_/s;let k=i9(s);for(;k*C<60&&k<s;)k*=2;const B=k>=86400;let P;if(B){const O=new Date((g-k)*1e3);O.setHours(0,0,0,0),P=O.getTime()/1e3}else P=Math.ceil((g-k)/k)*k;const N=new Set;for(let O=P;O<=v+k&&N.size<30;O+=k)N.add(Math.round(O*100));for(const O of N){const j=l(O/100),L=c.labels.get(O);L?L.text=j:c.labels.set(O,{alpha:0,text:j})}for(const[O,j]of c.labels){const L=y(O/100),D=N.has(O)?E(L):0;let V=zt(j.alpha,D,r9,f);Math.abs(V-D)<.02&&(V=D),V<.01&&D===0?c.labels.delete(O):j.alpha=V}const U=e.globalAlpha,A=h-d.bottom,$=5;e.strokeStyle=i.gridLine,e.lineWidth=1,e.beginPath(),e.moveTo(x,A),e.lineTo(S,A),e.stroke(),e.textAlign="center";const I=[];for(const[O,j]of c.labels){if(j.alpha<.02)continue;const L=y(O/100);if(L<x-20||L>S)continue;const K=e.measureText(j.text).width;I.push({x:L,alpha:j.alpha,text:j.text,w:K})}I.sort((O,j)=>O.x-j.x);const Y=[];for(const O of I){const j=O.x-O.w/2;if(Y.length>0){const L=Y[Y.length-1],K=L.x+L.w/2;if(j<K+8){O.alpha>L.alpha&&(Y[Y.length-1]=O);continue}}Y.push(O)}for(const O of Y)e.save(),e.globalAlpha=U*O.alpha,e.strokeStyle=i.gridLine,e.lineWidth=1,e.beginPath(),e.moveTo(O.x,A),e.lineTo(O.x,A+$),e.stroke(),e.fillStyle=i.timeLabel,e.fillText(O.text,O.x,A+$+14),e.restore()}var a9=[34,197,94],s9=[239,68,68];function o9(){return{labels:[],spawnTimer:0,smoothSpeed:dm,prevBidTotal:0,prevAskTotal:0,churnRate:0}}var l9=50,Vy=6,Zy=40,c9=22,dm=60,u9=160;function f9(e,t,i){const r=Math.round(e[0]+(t[0]-e[0])*i),s=Math.round(e[1]+(t[1]-e[1])*i),l=Math.round(e[2]+(t[2]-e[2])*i);return`rgb(${r},${s},${l})`}function d9(e,t,i,r,s,l,c){const{pad:f,h,chartH:d}=t,g=s/1e3;if(r.bids.length===0&&r.asks.length===0)return;let v=0,y=0,x=0;for(const[,j]of r.bids)y+=j,j>v&&(v=j);for(const[,j]of r.asks)x+=j,j>v&&(v=j);if(v===0)return;const S=l.prevBidTotal+l.prevAskTotal;let _=0;if(S>0){const j=Math.abs(y-l.prevBidTotal)+Math.abs(x-l.prevAskTotal);_=Math.min(j/S,1)}l.prevBidTotal=y,l.prevAskTotal=x;const T=_>l.churnRate?.3:.05;l.churnRate+=(_-l.churnRate)*T;const E=Math.max(Math.min(c*5,1),l.churnRate),C=dm+E*(u9-dm),k=1-Math.pow(.95,s/16.67);l.smoothSpeed+=(C-l.smoothSpeed)*k;const B=l.smoothSpeed,P=f.left+8,N=h-f.bottom-6,U=f.top,A=i.bgRgb;for(l.spawnTimer+=s;l.spawnTimer>=Zy&&l.labels.length<l9;){l.spawnTimer-=Zy;let j=!1;for(let ue=0;ue<l.labels.length;ue++)if(Math.abs(l.labels[ue].y-N)<c9){j=!0;break}if(j)break;const L=[];for(const[,ue]of r.bids)L.push({size:ue,green:!0});for(const[,ue]of r.asks)L.push({size:ue,green:!1});let K=0;for(const ue of L)K+=ue.size;let D=Math.random()*K,V=L[0];for(const ue of L)if(D-=ue.size,D<=0){V=ue;break}const ie=V.size/v;l.labels.push({y:N,text:`+ ${h9(V.size)}`,green:V.green,life:Vy,maxLife:Vy,intensity:.5+ie*.5})}const $=N-U;let I=0;for(let j=0;j<l.labels.length;j++){const L=l.labels[j];if(L.life-=g,L.life<=0)continue;const K=$>0?(L.y-U)/$:1;L.y-=B*(.7+.3*K)*g,!(L.y<U-14)&&(l.labels[I++]=L)}l.labels.length=I;const Y=e.globalAlpha;e.save(),e.font='600 13px "SF Mono", Menlo, monospace',e.textAlign="left",e.textBaseline="middle",e.globalAlpha=Y;const O=`rgb(${A[0]},${A[1]},${A[2]})`;for(let j=0;j<l.labels.length;j++){const L=l.labels[j],K=L.life/L.maxLife,D=Math.min((1-K)*10,1),V=(L.y-U)/d,ie=V<.45?V/.45:1,ue=L.intensity*D*ie,J=L.green?a9:s9,R=f9(J,A,1-ue);e.strokeStyle=O,e.lineWidth=4,e.lineJoin="round",e.strokeText(L.text,P,L.y),e.fillStyle=R,e.fillText(L.text,P,L.y)}e.restore()}function h9(e){return e>=10?`$${Math.round(e)}`:e>=1?`$${e.toFixed(1)}`:`$${e.toFixed(2)}`}function m9(){return{particles:[],cooldown:0,burstCount:0}}var g9=80,p9=1,v9=400,y9=.08,b9=3;function x9(e,t,i,r,s,l,c,f){if(e.cooldown=Math.max(0,e.cooldown-c),t==="flat"||e.cooldown>0)return 0;if(s<y9)return e.burstCount=0,0;if(t==="down"&&(f==null?void 0:f.downMomentum)!==!0||e.burstCount>=b9)return 0;e.cooldown=v9;const h=(f==null?void 0:f.scale)??1,d=t==="up",g=Math.min(s*5,1),v=g>.6?1:[1,.6,.35][e.burstCount]??.35;e.burstCount++;const y=Math.round((12+g*20)*h*v),x=1+g*.8;for(let S=0;S<y&&e.particles.length<g9;S++){const _=d?-Math.PI/2:Math.PI/2,T=Math.PI*1.2,E=_+(Math.random()-.5)*T,C=(60+Math.random()*100)*x;e.particles.push({x:i+(Math.random()-.5)*24,y:r+(Math.random()-.5)*8,vx:Math.cos(E)*C,vy:Math.sin(E)*C,life:1,size:(1+Math.random()*1.2)*h*v,color:l})}return v}function w9(e,t,i){if(t.particles.length===0)return;const r=i/1e3;e.save();let s=0;for(let l=0;l<t.particles.length;l++){const c=t.particles[l];c.life-=r/p9,!(c.life<=0)&&(c.x+=c.vx*r,c.y+=c.vy*r,c.vx*=.95,c.vy*=.95,e.globalAlpha=c.life*.55,e.fillStyle=c.color,e.beginPath(),e.arc(c.x,c.y,c.size*(.5+c.life*.5),0,Math.PI*2),e.fill(),t.particles[s++]=c)}t.particles.length=s,e.restore()}var f0="#22c55e",d0="#ef4444",Ah=[34,197,94],Xs=[239,68,68];function zw(e){const t=Math.round(Xs[0]+(Ah[0]-Xs[0])*e),i=Math.round(Xs[1]+(Ah[1]-Xs[1])*e),r=Math.round(Xs[2]+(Ah[2]-Xs[2])*e);return`rgb(${t},${i},${r})`}function Iy(e){const t=e.match(/^#([0-9a-f]{6})$/i);if(t){const r=t[1];return[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16)]}const i=e.match(/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return i?[+i[1],+i[2],+i[3]]:[128,128,128]}function _9(e,t,i){if(i<=0)return e;if(i>=1)return t;const[r,s,l]=Iy(e),[c,f,h]=Iy(t),d=Math.round(r+(c-r)*i),g=Math.round(s+(f-s)*i),v=Math.round(l+(h-l)*i);return`rgb(${d},${g},${v})`}function S9(e,t){const i=e.chartW/(e.rightEdge-e.leftEdge),r=t*i,s=Math.max(1,r*.7),l=Math.max(.8,Math.min(2,s*.15)),c=s>6?1.5:0;return{bodyW:s,wickW:l,radius:c}}function Xy(e,t,i,r,s,l){if(l<=0||s<l*2){e.rect(t,i,r,s);return}e.moveTo(t+l,i),e.lineTo(t+r-l,i),e.arcTo(t+r,i,t+r,i+l,l),e.lineTo(t+r,i+s-l),e.arcTo(t+r,i+s,t+r-l,i+s,l),e.lineTo(t+l,i+s),e.arcTo(t,i+s,t,i+s-l,l),e.lineTo(t,i+l),e.arcTo(t,i,t+l,i,l),e.closePath()}function Nh(e,t,i,r,s,l,c,f,h=1,d=-1,g,v=0){if(i.length===0)return;const{toX:y,toY:x}=t,{bodyW:S,wickW:_,radius:T}=S9(t,r),E=S/2,C=t.pad.left,k=t.pad.left+t.chartW,B=.12+Math.sin(l*.004)*.08;for(const P of i){const N=y(P.time+r/2);if(N+E<C||N-E>k)continue;const U=P.close>=P.open,A=P.time===s;let $=A&&d>=0?zw(d):U?f0:d0;g&&v>.01&&($=_9($,g,v));let I=A?h:1;if(f>.01&&c>0){const V=N-c;if(V>0){const ie=S*1.5,ue=Math.min(V/ie,1);I*=1-f*.5*ue}}const Y=e.globalAlpha;e.globalAlpha=Y*I;const O=x(Math.max(P.open,P.close)),j=x(Math.min(P.open,P.close)),L=Math.max(1,j-O),K=x(P.high),D=x(P.low);e.lineCap="round",e.strokeStyle=$,O-K>.5&&(e.beginPath(),e.moveTo(N,O),e.lineTo(N,K),e.lineWidth=_,e.stroke()),D-j>.5&&(e.beginPath(),e.moveTo(N,j),e.lineTo(N,D),e.lineWidth=_,e.stroke()),e.fillStyle=$,e.beginPath(),Xy(e,N-E,O,S,L,T),e.fill(),A&&(e.save(),e.globalAlpha=Y*I*B,e.shadowColor=$,e.shadowBlur=8,e.fillStyle=$,e.beginPath(),Xy(e,N-E,O,S,L,T),e.fill(),e.restore()),e.globalAlpha=Y}}function T9(e,t,i,r,s,l=-1){const c=t.toY(r.close);if(c<t.pad.top||c>t.h-t.pad.bottom)return;const f=r.close>=r.open,h=l>=0?zw(l):f?f0:d0,d=e.globalAlpha;e.save(),e.setLineDash([4,4]),e.strokeStyle=h,e.lineWidth=1,e.globalAlpha=d*(1-s*.3)*.4,e.beginPath(),e.moveTo(t.pad.left,c),e.lineTo(t.w-t.pad.right,c),e.stroke(),e.setLineDash([]),e.restore()}function E9(e,t,i,r,s,l,c,f,h){if(h<.01)return;const{h:d,pad:g}=t;if(e.save(),e.globalAlpha=h*.5,e.strokeStyle=i.crosshairLine,e.lineWidth=1,e.beginPath(),e.moveTo(r,g.top),e.lineTo(r,d-g.bottom),e.stroke(),e.restore(),h<.1||t.w<200)return;const y=s.close>=s.open?f0:d0,x=c(s.close),S=f(l);e.save(),e.globalAlpha=h,e.font='400 13px "SF Mono", Menlo, monospace',e.textAlign="left";let _;if(t.w>=400){const U=c(s.open),A=c(s.high),$=c(s.low);_=[{text:"O ",color:i.gridLabel},{text:U,color:y},{text:" H ",color:i.gridLabel},{text:A,color:y},{text:" L ",color:i.gridLabel},{text:$,color:y},{text:" C ",color:i.gridLabel},{text:x,color:y},{text:" · ",color:i.gridLabel},{text:S,color:i.gridLabel}]}else _=[{text:"C ",color:i.gridLabel},{text:x,color:y},{text:" · ",color:i.gridLabel},{text:S,color:i.gridLabel}];let T=0;const E=[];for(const U of _){const A=e.measureText(U.text).width;E.push(A),T+=A}let C=r-T/2;const k=g.left+4,B=t.w-g.right-T;C<k&&(C=k),C>B&&(C=B);const P=g.top+24;e.strokeStyle=i.tooltipBg,e.lineWidth=3,e.lineJoin="round";let N=C;for(let U=0;U<_.length;U++)e.strokeText(_[U].text,N,P),N+=E[U];N=C;for(let U=0;U<_.length;U++)e.fillStyle=_[U].color,e.fillText(_[U].text,N,P),N+=E[U];e.restore()}function z9(e,t,i,r,s,l,c,f,h){if(h<.01)return;const{h:d,pad:g}=t,v=t.toY(s);if(e.save(),e.globalAlpha=h*.5,e.strokeStyle=i.crosshairLine,e.lineWidth=1,e.beginPath(),e.moveTo(r,g.top),e.lineTo(r,d-g.bottom),e.stroke(),e.globalAlpha=h*.3,e.beginPath(),e.moveTo(g.left,v),e.lineTo(t.w-g.right,v),e.stroke(),e.restore(),h<.1||t.w<200)return;const y=c(s),x=f(l);e.save(),e.globalAlpha=h,e.font='400 13px "SF Mono", Menlo, monospace',e.textAlign="left";const S=[{text:y,color:i.line},{text:" · ",color:i.gridLabel},{text:x,color:i.gridLabel}];let _=0;const T=[];for(const N of S){const U=e.measureText(N.text).width;T.push(U),_+=U}let E=r-_/2;const C=g.left+4,k=t.w-g.right-_;E<C&&(E=C),E>k&&(E=k);const B=g.top+24;e.strokeStyle=i.tooltipBg,e.lineWidth=3,e.lineJoin="round";let P=E;for(let N=0;N<S.length;N++)e.strokeText(S[N].text,P,B),P+=T[N];P=E;for(let N=0;N<S.length;N++)e.fillStyle=S[N].color,e.fillText(S[N].text,P,B),P+=T[N];e.restore()}function xl(e,t,i,r,s,l=1,c=0,f=!1,h){const d=t-r.left-r.right,g=i-r.top-r.bottom,v=r.top+g/2,y=r.left+d/2,x=h??"No data to display",S=g*a0;e.save(),e.font="400 12px system-ui, -apple-system, sans-serif";const T=e.measureText(x).width/2+20,E=30;if(!f){const N=c*s0,U=l0(c),A=32,$=[];for(let I=0;I<=A;I++){const Y=I/A,O=r.left+Y*d,j=o0(Y,v,S,N);$.push([O,j])}e.beginPath(),e.moveTo($[0][0],$[0][1]),Yu(e,$),e.strokeStyle=s.gridLabel,e.lineWidth=s.lineWidth,e.globalAlpha=U*l,e.lineCap="round",e.lineJoin="round",e.stroke()}e.save(),e.globalCompositeOperation="destination-out";const C=y-T-E,k=y+T+E,B=e.createLinearGradient(C,0,k,0);B.addColorStop(0,"rgba(0,0,0,0)"),B.addColorStop(E/(k-C),"rgba(0,0,0,1)"),B.addColorStop(1-E/(k-C),"rgba(0,0,0,1)"),B.addColorStop(1,"rgba(0,0,0,0)"),e.fillStyle=B,e.globalAlpha=l;const P=S*2+s.lineWidth+6;e.fillRect(C,v-P/2,k-C,P),e.restore(),e.textAlign="center",e.textBaseline="middle",e.globalAlpha=.35*l,e.fillStyle=s.gridLabel,e.fillText(x,y,v),e.restore()}var M9=.002,qy=.2,Ir=40,Fr=5;function C9(){return{amplitude:0}}function A9(e,t,i,r){const s=r.shakeState;let l=0,c=0;if(s&&s.amplitude>qy&&(l=(Math.random()-.5)*2*s.amplitude,c=(Math.random()-.5)*2*s.amplitude,e.save(),e.translate(l,c)),s){const S=Math.pow(M9,r.dt/1e3);s.amplitude*=S,s.amplitude<qy&&(s.amplitude=0)}const f=r.chartReveal,h=r.pauseProgress,d=(S,_)=>{const T=Math.max(0,Math.min(1,(f-S)/(_-S)));return T*T*(3-2*T)};if(r.referenceLine&&f>.01&&(e.save(),f<1&&(e.globalAlpha=f),Ew(e,t,i,r.referenceLine),e.restore()),r.showGrid){const S=f<1?d(.15,.7):1;S>.01&&(e.save(),S<1&&(e.globalAlpha=S),r0(e,t,i,r.formatValue,r.gridState,r.dt),e.restore())}r.orderbookData&&r.orderbookState&&f>.01&&(e.save(),f<1&&(e.globalAlpha=f),d9(e,t,i,r.orderbookData,r.dt,r.orderbookState,r.swingMagnitude),e.restore());const g=r.scrubAmount>.05?r.hoverX:null,v=c0(e,t,i,r.visible,r.smoothValue,r.now,r.showFill,g,r.scrubAmount,f,r.now_ms);{const S=f<1?d(.15,.7):1;S>.01&&(e.save(),S<1&&(e.globalAlpha=S),u0(e,t,i,r.windowSecs,r.targetWindowSecs,r.formatTime,r.timeAxisState,r.dt),e.restore())}if(v&&v.length>0){const S=v[v.length-1];let _=r.scrubAmount;if(r.hoverX!==null&&_>0){const C=S[0]-r.hoverX,k=Math.min(80,t.chartW*.3);_=C<Fr?0:C>=k?r.scrubAmount:(C-Fr)/(k-Fr)*r.scrubAmount}const T=f<.3?0:(f-.3)/.7,E=r.showPulse&&f>.6&&h<.5;if(T>.01&&(e.save(),T<1&&(e.globalAlpha=T),Tw(e,S[0],S[1],i,E,_,r.now_ms),e.restore()),r.showMomentum){const k=(f<1?d(.6,1):1)*(1-h);k>.01&&(e.save(),k<1&&(e.globalAlpha=k),e9(e,S[0],S[1],r.momentum,i,r.arrowState,r.dt,r.now_ms),e.restore())}if(r.particleState&&f>.9){const C=x9(r.particleState,r.momentum,S[0],S[1],r.swingMagnitude,i.line,r.dt,r.particleOptions);C>0&&s&&(s.amplitude=(3+r.swingMagnitude*4)*C),w9(e,r.particleState,r.dt)}}const y=Ir;e.save(),e.globalCompositeOperation="destination-out";const x=e.createLinearGradient(t.pad.left,0,t.pad.left+y,0);if(x.addColorStop(0,"rgba(0, 0, 0, 1)"),x.addColorStop(1,"rgba(0, 0, 0, 0)"),e.fillStyle=x,e.fillRect(0,0,t.pad.left+y,t.h),e.restore(),r.hoverX!==null&&r.hoverValue!==null&&r.hoverTime!==null&&v&&v.length>0){const S=v[v.length-1],_=S[0]-r.hoverX,T=Math.min(80,t.chartW*.3),E=_<Fr?0:_>=T?r.scrubAmount:(_-Fr)/(T-Fr)*r.scrubAmount;E>.01&&t9(e,t,i,r.hoverX,r.hoverValue,r.hoverTime,r.formatValue,r.formatTime,E,r.tooltipY,S[0],r.tooltipOutline)}s&&(l!==0||c!==0)&&e.restore()}function N9(e,t,i){const r=i.primaryPalette,s=i.chartReveal,l=(d,g)=>{const v=Math.max(0,Math.min(1,(s-d)/(g-d)));return v*v*(3-2*v)};if(i.referenceLine&&s>.01&&(e.save(),s<1&&(e.globalAlpha=s),Ew(e,t,r,i.referenceLine),e.restore()),i.showGrid){const d=s<1?l(.15,.7):1;d>.01&&(e.save(),d<1&&(e.globalAlpha=d),r0(e,t,r,i.formatValue,i.gridState,i.dt),e.restore())}const c=i.scrubAmount>.05?i.hoverX:null,f=[];for(let d=0;d<i.series.length;d++){const g=i.series[d],v=g.alpha??1,x=(d>0&&s<1?Math.min(1,s*2):1)*v;if(x<.01)continue;e.save(),x<1&&(e.globalAlpha=x);const S=c0(e,t,g.palette,g.visible,g.smoothValue,i.now,!1,c,i.scrubAmount,s,i.now_ms);e.restore(),S&&S.length>0&&f.push({pts:S,palette:g.palette,label:g.label,alpha:v})}{const d=s<1?l(.15,.7):1;d>.01&&(e.save(),d<1&&(e.globalAlpha=d),u0(e,t,r,i.windowSecs,i.targetWindowSecs,i.formatTime,i.timeAxisState,i.dt),e.restore())}if(s>.3&&f.length>0){const d=(s-.3)/.7,g=i.showPulse&&s>.6&&i.pauseProgress<.5;for(const v of f){if(v.alpha<.01)continue;const y=v.pts[v.pts.length-1];e.save(),e.globalAlpha=d*v.alpha,g&&v.alpha>.5?Q8(e,y[0],y[1],v.palette.line,!0,i.now_ms,3):J8(e,y[0],y[1],v.palette.line,3),v.label&&(e.font='600 10px -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif',e.textAlign="left",e.fillStyle=v.palette.line,e.fillText(v.label,y[0]+6,y[1]+3.5)),e.restore()}}e.save(),e.globalCompositeOperation="destination-out";const h=e.createLinearGradient(t.pad.left,0,t.pad.left+Ir,0);if(h.addColorStop(0,"rgba(0, 0, 0, 1)"),h.addColorStop(1,"rgba(0, 0, 0, 0)"),e.fillStyle=h,e.fillRect(0,0,t.pad.left+Ir,t.h),e.restore(),i.hoverX!==null&&i.hoverTime!==null&&i.hoverEntries.length>0&&f.length>0&&i.scrubAmount>.01){let d=0;for(const x of f){if(x.alpha<.01)continue;const S=x.pts[x.pts.length-1][0];S>d&&(d=S)}const g=d-i.hoverX,v=Math.min(80,t.chartW*.3),y=g<Fr?0:g>=v?i.scrubAmount:(g-Fr)/(v-Fr)*i.scrubAmount;y>.01&&n9(e,t,r,i.hoverX,i.hoverTime,i.hoverEntries,i.formatValue,i.formatTime,y,i.tooltipY,i.tooltipOutline,d)}}function R9(e,t,i,r){var N,U;const{w:s,h:l,pad:c,chartW:f,chartH:h}=t,d=r.chartReveal,g=r.lineModeProg>=.99,v=g?1-d:(1-d)*(1-d)*(1-d),y=Math.max(r.lineModeProg,v),x=y>.001?r.lineModeProg/y:1,S=(A,$)=>{const I=Math.max(0,Math.min(1,(d-A)/($-A)));return I*I*(3-2*I)},_=S(.25,.6);r.showGrid&&_>.01&&(e.save(),_<1&&(e.globalAlpha=_),r0(e,t,i,r.formatValue,r.gridState,r.dt),e.restore());let T;if(y>.01&&r.lineVisible.length>=2){const A=r.scrubAmount>.05?r.hoverX:null;e.save(),e.globalAlpha=y,T=c0(e,t,i,r.lineVisible,r.lineSmoothValue,r.now,r.lineModeProg>.01,A,r.scrubAmount,r.chartReveal,r.now_ms,x,!g,r.lineModeProg),e.restore()}const E=S(.4,.8),C=r.closePriceCandle??r.liveCandle;if(C&&E>.01&&(y<.99&&(e.save(),e.globalAlpha=E*(1-y),T9(e,t,i,C,r.scrubAmount,r.liveBullBlend),e.restore()),y>.01&&!g)){const A=t.toY(C.close);A>=c.top&&A<=l-c.bottom&&(e.save(),e.setLineDash([4,4]),e.strokeStyle=i.dashLine,e.lineWidth=1,e.globalAlpha=E*y*(1-r.scrubAmount*.2),e.beginPath(),e.moveTo(c.left,A),e.lineTo(s-c.right,A),e.stroke(),e.setLineDash([]),e.restore())}const k=r.chartReveal*(1-y);if(k>.01){const A=d*d*(3-2*d),$=j=>A>=.99?j:{time:j.time,open:j.close+(j.open-j.close)*A,high:j.close+(j.high-j.close)*A,low:j.close+(j.low-j.close)*A,close:j.close},I=A<.99?r.candles.map($):r.candles,Y=A<.99&&r.oldCandles.length>0?r.oldCandles.map($):r.oldCandles;e.save(),e.beginPath(),e.rect(c.left-1,c.top,f+2,h),e.clip();const O=y>.01?i.line:void 0;r.morphT>=0&&Y.length>0?(e.globalAlpha=(1-r.morphT)*k,Nh(e,t,Y,r.oldWidth,-1,r.now_ms,r.hoverX??0,r.scrubAmount,1,-1,O,y),e.globalAlpha=r.morphT*k,Nh(e,t,I,r.displayCandleWidth,((N=r.liveCandle)==null?void 0:N.time)??-1,r.now_ms,r.hoverX??0,r.scrubAmount,r.liveBirthAlpha,r.liveBullBlend,O,y),e.globalAlpha=1):(k<1&&(e.globalAlpha=k),Nh(e,t,I,r.displayCandleWidth,((U=r.liveCandle)==null?void 0:U.time)??-1,r.now_ms,r.hoverX??0,r.scrubAmount,r.liveBirthAlpha,r.liveBullBlend,O,y)),e.restore()}if(y>.5&&T&&T.length>0&&d>.3){const A=T[T.length-1],$=(y-.5)*2*((d-.3)/.7),I=y>.8&&d>.6;$>.01&&(e.save(),e.globalAlpha=$,Tw(e,A[0],A[1],i,I,r.scrubAmount,r.now_ms),e.restore())}const B=S(.25,.6);B>.01&&(e.save(),B<1&&(e.globalAlpha=B),u0(e,t,i,r.targetWindowSecs,r.targetWindowSecs,r.formatTime,r.timeAxisState,r.dt),e.restore()),e.save(),e.globalCompositeOperation="destination-out";const P=e.createLinearGradient(c.left,0,c.left+Ir,0);if(P.addColorStop(0,"rgba(0, 0, 0, 1)"),P.addColorStop(1,"rgba(0, 0, 0, 0)"),e.fillStyle=P,e.fillRect(0,0,c.left+Ir,l),e.restore(),r.showEmptyOverlay){const A=1-r.chartReveal;if(A>.01){const $=(1-r.loadingAlpha)*A;$>.01&&xl(e,s,l,c,i,$,r.now_ms,!0,r.emptyText)}}r.chartReveal>.7&&r.hoveredCandle&&r.hoverX!==null&&r.scrubAmount>.01&&(r.lineModeProg>.5?z9(e,t,i,r.hoverX,r.hoveredCandle.close,r.hoverTime??0,r.formatValue,r.formatTime,r.scrubAmount):E9(e,t,i,r.hoverX,r.hoveredCandle,r.hoverTime??0,r.formatValue,r.formatTime,r.scrubAmount))}function Wy(e,t,i,r,s,l,c=1,f){const h=t-r.left-r.right,d=i-r.top-r.bottom,g=r.top+d/2,v=r.left,y=d*a0,x=l*s0,S=l0(l),_=32,T=[];for(let E=0;E<=_;E++){const C=E/_,k=v+C*h,B=o0(C,g,y,x);T.push([k,B])}e.save(),e.beginPath(),e.moveTo(T[0][0],T[0][1]),Yu(e,T),e.strokeStyle=f??s.line,e.lineWidth=s.lineWidth,e.globalAlpha=S*c,e.lineCap="round",e.lineJoin="round",e.stroke(),e.restore()}function k9(e,t,i,r){const s=t/2;return[`M${i},0`,`L${i+e},0`,`L${i+e},${t}`,`L${i},${t}`,`L0,${s}`,"Z"].join(" ")}function D9(e,t){return["M0,0",`L${e},0`,`L${e},${t}`,`L0,${t}`,"Z"].join(" ")}var nu=10,Rh=3,Ky=5,Qy=16,Jy="http://www.w3.org/2000/svg",O9=50,Mw=.12,j9=.15,L9=.35,U9=.5,H9=.12,Cw=750,eb=.05,tb=.015,nb=.001,Aw=.2,kh=[34,197,94],qs=[239,68,68],B9=.14,$9=.09,G9=.12,Y9=.08,F9=.22,P9=.14,V9=.1,iu=.25,Z9=300,I9=500,X9=.25,q9=350,ib=.08,rb=.2,ab=.001,W9=.15,K9=.2,Q9=.015;function sb(e,t,i,r,s,l){const c=Math.abs(e-t),f=r-i||1,h=Math.min(c/f,1);return l?1:s+(1-h)*Aw}function ob(e,t,i,r,s,l,c,f,h,d,g){var x;if(t.to!==e.windowSecs){t.from=i,t.to=e.windowSecs,t.startMs=c,t.rangeFromMin=r,t.rangeFromMax=s;const S=f+e.windowSecs*g,_=S-e.windowSecs,T=[];for(const E of h)E.time>=_-2&&E.time<=S&&T.push(E);if(T.length>0){const E=uu(T,d,(x=e.referenceLine)==null?void 0:x.value,e.exaggerate);t.rangeToMin=E.min,t.rangeToMax=E.max}}let v=0,y;if(l||t.startMs===0)y=e.windowSecs;else{const S=c-t.startMs,T=Math.min(S/Cw,1),E=(1-Math.cos(T*Math.PI))/2;v=E;const C=Math.log(t.from),k=Math.log(t.to);y=Math.exp(C+(k-C)*E),T>=1&&(y=e.windowSecs,t.startMs=0,v=0)}return{windowSecs:y,windowTransProgress:v}}function lb(e,t,i,r,s,l,c,f,h,d,g,v){if(!t)return{minVal:e.min,maxVal:e.max,valRange:e.max-e.min||.001,targetMin:e.min,targetMax:e.max,displayMin:e.min,displayMax:e.max,rangeInited:!0};if(c)s=h.rangeFromMin+(h.rangeToMin-h.rangeFromMin)*f,l=h.rangeFromMax+(h.rangeToMax-h.rangeFromMax)*f,i=e.min,r=e.max;else{const y=l-s;i=e.min,r=e.max,s=zt(s,i,d,v),l=zt(l,r,d,v);const x=.5*y/g||.001;Math.abs(s-i)<x&&(s=i),Math.abs(l-r)<x&&(l=r)}return{minVal:s,maxVal:l,valRange:l-s||.001,targetMin:i,targetMax:r,displayMin:s,displayMax:l,rangeInited:!0}}function J9(e,t,i,r,s,l,c,f,h,d,g,v,y,x){var N;let S=null,_=null,T=null,E=!1;if(e!==null&&e>=t.left&&e<=i-t.right){const U=r.toX(s),A=Math.min(e,U),$=g+(A-t.left)/y*(v-g),I=ww(l,$);I!==null&&(S=I,_=$,T=A,E=!0,f={x:A,value:I,time:$},(N=h.onHover)==null||N.call(h,{time:$,value:I,x:A,y:r.toY(I)}))}const C=E?1:0;d?c=C:(c+=(C-c)*Mw,c<.01&&(c=0),c>.99&&(c=1));let k=T,B=S,P=_;return!E&&c>0&&f&&(k=f.x,B=f.value,P=f.time),{hoverX:k,hoverValue:B,hoverTime:P,scrubAmount:c,isActiveHover:E,lastHover:f}}function cb(e,t,i,r,s,l,c,f,h,d,g,v=1){if(!t.showBadge||v<.25)return e.container.style.display="none",l;e.container.style.display="";const y=v<.5?(v-.25)/.25:1;e.container.style.opacity=y<1?String(y):"";const{w:x,h:S,pad:_}=r,T=t.formatValue(i);e.text.textContent=T,e.text.style.font=t.palette.labelFont,e.text.style.lineHeight=`${Qy}px`;const E=t.badgeTail?Ky:0;e.text.style.padding=`${Rh}px ${nu}px ${Rh}px ${E+nu}px`,d.font=t.palette.labelFont;const C=T.replace(/[0-9]/g,"8"),k=d.measureText(C).width;e.targetW=k,e.displayW===0&&(e.displayW=k),e.displayW=zt(e.displayW,e.targetW,j9,g),Math.abs(e.displayW-e.targetW)<.3&&(e.displayW=e.targetW);const P=e.displayW+nu*2,N=Qy+Rh*2,U=E+P;e.svg.setAttribute("width",String(Math.ceil(U))),e.svg.setAttribute("height",String(N)),e.svg.setAttribute("viewBox",`0 0 ${U} ${N}`),e.path.setAttribute("d",t.badgeTail?k9(P,N,Ky):D9(P,N));const A=_.top+r.chartH/2,$=Math.max(_.top,Math.min(S-_.bottom,r.toY(i))),I=v<1?A+($-A)*v:$;l===null||h?l=I:l=zt(l,I,f?U9:L9,g);const Y=x-_.right-nu-E,O=l-N/2;if(e.container.style.transform=`translate3d(${Y}px, ${O}px, 0)`,t.badgeVariant==="minimal")e.path.setAttribute("fill",t.palette.badgeOuterBg),e.text.style.color=t.palette.tooltipText,e.container.style.filter=`drop-shadow(0 1px 4px ${t.palette.badgeOuterShadow})`;else{e.container.style.filter="",e.text.style.color="#fff";const j=c;let L;if(!t.showMomentum)L=t.palette.line;else{const K=s==="up"?1:s==="down"?0:j.green;j.green=h?K:zt(j.green,K,H9,g),j.green>.99&&(j.green=1),j.green<.01&&(j.green=0);const D=j.green,V=Math.round(qs[0]+(kh[0]-qs[0])*D),ie=Math.round(qs[1]+(kh[1]-qs[1])*D),ue=Math.round(qs[2]+(kh[2]-qs[2])*D);L=`rgb(${V},${ie},${ue})`}e.path.setAttribute("fill",L)}return l}function hm(e){let t=1/0,i=-1/0;for(const c of e)c.low<t&&(t=c.low),c.high>i&&(i=c.high);if(!isFinite(t)||!isFinite(i))return{min:99,max:101};const r=i-t,s=r*.12,l=r*.1||.4;if(r<l){const c=(t+i)/2;return{min:c-l/2,max:c+l/2}}return{min:t-s,max:i+s}}function ub(e,t,i,r){const s=r.leftEdge+(t-r.pad.left)/r.chartW*(r.rightEdge-r.leftEdge);let l=0,c=e.length-1;for(;l<=c;){const f=l+c>>1,h=e[f];if(s<h.time)c=f-1;else if(s>=h.time+i)l=f+1;else return h}return null}function eO(e,t,i,r,s,l,c,f,h){if(!t)return{minVal:e.min,maxVal:e.max,valRange:e.max-e.min||.001,displayMin:e.min,displayMax:e.max,rangeInited:!0};if(s)i=c.rangeFromMin+(c.rangeToMin-c.rangeFromMin)*l,r=c.rangeFromMax+(c.rangeToMax-c.rangeFromMax)*l;else{const d=r-i||1,g=Math.abs(i-e.min),v=Math.abs(r-e.max),y=Math.min((g+v)/d,1),x=W9+(1-y)*K9;i=zt(i,e.min,x,h),r=zt(r,e.max,x,h);const S=.5*d/f||.001;Math.abs(i-e.min)<S&&(i=e.min),Math.abs(r-e.max)<S&&(r=e.max)}return{minVal:i,maxVal:r,valRange:r-i||.001,displayMin:i,displayMax:r,rangeInited:!0}}function tO(e,t,i,r,s,l,c,f,h,d,g){if(t.to!==e){t.from=i,t.to=e,t.startMs=l,t.rangeFromMin=r,t.rangeFromMax=s;const x=c+e*g,S=x-e,_=[];for(const T of f)T.time+d>=S&&T.time<=x&&_.push(T);if(h&&h.time+d>=S&&h.time<=x&&_.push(h),_.length>0){const T=hm(_);t.rangeToMin=T.min,t.rangeToMax=T.max}}let v=0,y;if(t.startMs===0)y=e;else{const x=l-t.startMs,S=Math.min(x/Cw,1),_=(1-Math.cos(S*Math.PI))/2;v=_;const T=Math.log(t.from),E=Math.log(t.to);y=Math.exp(T+(E-T)*_),S>=1&&(y=e,t.startMs=0,v=0)}return{windowSecs:y,windowTransProgress:v}}function nO(e,t,i){const r=M.useRef(i);r.current=i;const s=M.useRef(i.value),l=M.useRef(new Map),c=M.useRef(new Map),f=M.useRef(0),h=M.useRef(0),d=M.useRef(0),g=M.useRef(0),v=M.useRef(!1),y=M.useRef(i.windowSecs),x=M.useRef({from:i.windowSecs,to:i.windowSecs,startMs:0,rangeFromMin:0,rangeFromMax:0,rangeToMin:0,rangeToMax:0}),S=M.useRef({up:0,down:0}),_=M.useRef({interval:0,labels:new Map}),T=M.useRef({labels:new Map}),E=M.useRef(o9()),C=M.useRef(m9()),k=M.useRef(C9()),B=M.useRef({green:1}),P=M.useRef(null),N=M.useRef(!1),U=M.useRef({w:0,h:0}),A=M.useRef(null),$=M.useRef(0),I=M.useRef(0),Y=M.useRef(null),O=M.useRef(null),j=M.useRef(0),L=M.useRef(null),K=M.useRef([]),D=M.useRef(0),V=M.useRef(0),ie=M.useRef(0),ue=M.useRef([]),J=M.useRef([]),R=M.useRef(0),X=M.useRef(null),ae=M.useRef(null),he=M.useRef(i.loading?1:0),de=M.useRef(null),ve=M.useRef(1),be=M.useRef(.5),je=M.useRef(0),se=M.useRef(!1),Ee=M.useRef(0),ze=M.useRef(!1),fe=M.useRef(0),dt=M.useRef({startMs:0,from:0,to:0}),Ue=M.useRef(0),ht=M.useRef({startMs:0,from:0,to:0}),ut=M.useRef(0),qt=M.useRef(!1),yi=M.useRef({fromWidth:i.candleWidth??1,toWidth:i.candleWidth??1,startMs:0,rangeFromMin:0,rangeFromMax:0,rangeToMin:0,rangeToMax:0,oldCandles:[],oldWidth:i.candleWidth??1}),Tn=M.useRef({candles:[],width:i.candleWidth??1}),vn=M.useRef(null),Di=M.useRef(null),bi=M.useRef(null),or=M.useRef(null),Zt=M.useRef([]),ta=M.useRef(null),En=M.useRef([]),Kn=M.useRef(void 0);M.useEffect(()=>{const De=t.current;if(!De)return;const ee=document.createElement("div");ee.style.cssText="position:absolute;top:0;left:0;pointer-events:none;will-change:transform;display:none;z-index:1;";const ge=document.createElementNS(Jy,"svg");ge.style.cssText="position:absolute;top:0;left:0;";const F=document.createElementNS(Jy,"path");ge.appendChild(F);const pe=document.createElement("span");return pe.style.cssText="position:relative;display:block;color:#fff;white-space:nowrap;",ee.appendChild(ge),ee.appendChild(pe),De.appendChild(ee),Y.current={container:ee,svg:ge,path:F,text:pe,displayW:0,targetW:0},()=>{De.removeChild(ee),Y.current=null}},[t]),M.useEffect(()=>{const De=t.current;if(!De)return;const ee=new ResizeObserver(F=>{const pe=F[0];if(!pe)return;const{width:me,height:ye}=pe.contentRect;U.current={w:me,h:ye}});ee.observe(De);const ge=De.getBoundingClientRect();return U.current={w:ge.width,h:ge.height},()=>ee.disconnect()},[t]),M.useEffect(()=>{const De=t.current;if(!De)return;const ee=ye=>{if(!r.current.scrub)return;const We=De.getBoundingClientRect();O.current=ye.clientX-We.left},ge=()=>{var ye,We;O.current=null,(We=(ye=r.current).onHover)==null||We.call(ye,null)},F=ye=>{if(!r.current.scrub||ye.touches.length!==1)return;const We=De.getBoundingClientRect();O.current=ye.touches[0].clientX-We.left},pe=ye=>{if(!r.current.scrub||ye.touches.length!==1)return;ye.preventDefault();const We=De.getBoundingClientRect();O.current=ye.touches[0].clientX-We.left},me=()=>{var ye,We;O.current=null,(We=(ye=r.current).onHover)==null||We.call(ye,null)};return De.addEventListener("mousemove",ee),De.addEventListener("mouseleave",ge),De.addEventListener("touchstart",F,{passive:!0}),De.addEventListener("touchmove",pe,{passive:!1}),De.addEventListener("touchend",me),De.addEventListener("touchcancel",me),()=>{De.removeEventListener("mousemove",ee),De.removeEventListener("mouseleave",ge),De.removeEventListener("touchstart",F),De.removeEventListener("touchmove",pe),De.removeEventListener("touchend",me),De.removeEventListener("touchcancel",me)}},[t]),M.useEffect(()=>{const De=window.matchMedia("(prefers-reduced-motion: reduce)");N.current=De.matches;const ee=ge=>{N.current=ge.matches};return De.addEventListener("change",ee),()=>De.removeEventListener("change",ee)},[]),M.useEffect(()=>{const De=()=>{!document.hidden&&!$.current&&($.current=requestAnimationFrame(on))};return document.addEventListener("visibilitychange",De),()=>document.removeEventListener("visibilitychange",De)},[]);const on=M.useCallback(()=>{var po,qi,ln,On,wr,ps,jl,Ll,vo,na,vs,_r,Sr,ia,Tr,tn;if(document.hidden){$.current=0;return}const De=e.current,{w:ee,h:ge}=U.current;if(!De||ee===0||ge===0){$.current=requestAnimationFrame(on);return}const F=r.current,pe=V8(),me=performance.now(),ye=I.current?Math.min(me-I.current,O9):16.67;I.current=me;const We=Math.round(ee*pe),yn=Math.round(ge*pe);(De.width!==We||De.height!==yn)&&(De.width=We,De.height=yn,De.style.width=`${ee}px`,De.style.height=`${ge}px`);let Ge=A.current;if((!Ge||Ge.canvas!==De)&&(Ge=De.getContext("2d"),A.current=Ge),!Ge){$.current=requestAnimationFrame(on);return}Z8(Ge,pe);const zn=N.current,Ut=F.mode==="candle";if(Ut)F.paused&&vn.current===null&&(((po=F.candles)==null?void 0:po.length)??0)>0&&(vn.current=F.candles.slice(),Di.current=F.liveCandle??null,bi.current=((qi=F.lineData)==null?void 0:qi.slice())??null,or.current=F.lineValue??null),F.paused||(vn.current=null,Di.current=null,bi.current=null,or.current=null);else if(F.isMultiSeries&&F.multiSeries){if(F.paused&&ae.current===null){const Be=new Map;for(const Ot of F.multiSeries)Ot.data.length>=2&&Be.set(Ot.id,{data:Ot.data.slice(),value:Ot.value});Be.size>0&&(ae.current=Be)}F.paused||(ae.current=null)}else F.paused&&X.current===null&&F.data.length>=2&&(X.current=F.data.slice()),F.paused||(X.current=null);const xi=Ut?[]:X.current??F.data,Ie=Ut?vn.current??F.candles??[]:[],Oi=F.isMultiSeries&&F.multiSeries?F.multiSeries.some(Be=>Be.data.length>=2):!1,Dt=Ut?Ie.length>=2:Oi||xi.length>=2,Le=F.padding,oi=ge-Le.top-Le.bottom,He=F.paused?1:0;V.current=zn?He:zt(V.current,He,G9,ye),V.current<.005&&(V.current=0),V.current>.995&&(V.current=1);const mt=V.current,Ve=ye*(1-mt),ji=ye/1e3;if(ie.current+=ji*mt,!F.paused&&ie.current>.001){const Be=ie.current>10?F9:Y9;ie.current=zt(ie.current,0,Be,ye),ie.current<.01&&(ie.current=0)}const gs=F.loading?1:0;he.current=zn?gs:zt(he.current,gs,P9,ye),he.current<.01&&(he.current=0),he.current>.99&&(he.current=1);const Qn=he.current,lr=!F.loading&&Dt?1:0;D.current=zn?lr:zt(D.current,lr,lr===1?$9:B9,ye),Math.abs(D.current-lr)<.005&&(D.current=lr);const Mn=D.current;Mn<.01&&(v.current=!1);let Pn,Xi=!1;if(Ut?Pn=!Dt&&Mn>.005&&Zt.current.length>0:(Xi=!Dt&&Mn>.005&&J.current.length>0,Oi&&F.multiSeries&&(J.current=F.multiSeries.map(Be=>({id:Be.id,data:Be.data.slice(),value:Be.value,palette:Be.palette,label:Be.label}))),Dt&&!F.isMultiSeries&&(J.current=[]),Pn=!Xi&&!Dt&&Mn>.005&&ue.current.length>=2,Dt&&!F.isMultiSeries&&(ue.current=xi)),Ut){const Be=dt.current,Ot=F.lineMode?1:0;if(Be.to!==Ot&&(Be.from=fe.current,Be.to=Ot,Be.startMs=me),Be.startMs>0){const $e=me-Be.startMs,gt=Math.min($e/I9,1);fe.current=Be.from+(Be.to-Be.from)*((1-Math.cos(gt*Math.PI))/2),gt>=1&&(fe.current=Be.to,Be.startMs=0)}else fe.current=Be.to}if(!Dt&&!Pn&&!Xi){Ge.clearRect(0,0,ee,ge);const Be=Ut||F.isMultiSeries||J.current.length>0?F.palette.gridLabel:void 0;Qn>.01&&Wy(Ge,ee,ge,Le,F.palette,me,Qn,Be),1-Qn>.01&&xl(Ge,ee,ge,Le,F.palette,1-Qn,me,!1,F.emptyText),Ge.save(),Ge.globalCompositeOperation="destination-out";const Ot=Ge.createLinearGradient(Le.left,0,Le.left+Ir,0);Ot.addColorStop(0,"rgba(0, 0, 0, 1)"),Ot.addColorStop(1,"rgba(0, 0, 0, 0)"),Ge.fillStyle=Ot,Ge.fillRect(0,0,Le.left+Ir,ge),Ge.restore(),Y.current&&(Y.current.container.style.display="none"),$.current=requestAnimationFrame(on);return}if(Ut){Ge.clearRect(0,0,ee,ge);const Be=Q9;Dt&&(R.current=Date.now()/1e3-ie.current);const Ot=Dt||Mn<.005?Date.now()/1e3-ie.current:R.current,$e=vn.current?Di.current??void 0:F.liveCandle;let gt=bi.current??F.lineData,Cn=or.current??F.lineValue;Dt&&gt&&gt.length>0&&(En.current=gt,Kn.current=Cn),Pn&&En.current.length>0&&(gt=En.current,Cn=Kn.current);const jn=F.candleWidth??1,Pe=yi.current;let cn=-1,Ht;if(Pe.startMs>0){const Se=me-Pe.startMs,Ne=Math.min(Se/Z9,1);cn=(1-Math.cos(Ne*Math.PI))/2,Ht=Math.exp(Math.log(Pe.fromWidth)+(Math.log(Pe.toWidth)-Math.log(Pe.fromWidth))*cn),Ne>=1&&(Ht=Pe.toWidth,Pe.startMs=0,cn=-1)}else Ht=Pe.toWidth;if(jn!==Pe.toWidth){Pe.oldCandles=Tn.current.candles,Pe.oldWidth=Tn.current.width,Pe.fromWidth=Ht,Pe.toWidth=jn,Pe.startMs=me,cn=0,Pe.rangeFromMin=f.current,Pe.rangeFromMax=h.current;const Se=y.current,Ne=Ot+Se*Be,dn=Ne-Se,Ke=[];for(const rn of Ie)rn.time+jn>=dn&&rn.time<=Ne&&Ke.push(rn);if($e&&Ke.push($e),Ke.length>0){const rn=hm(Ke);Pe.rangeToMin=rn.min,Pe.rangeToMax=rn.max}else Pe.rangeToMin=f.current,Pe.rangeToMax=h.current}Tn.current={candles:F.candles??[],width:jn};const It=fe.current,wt=ht.current,nn=gt&&gt.length>0,Vn=F.lineMode&&It>=.3&&nn?1:0;wt.to!==Vn&&(wt.from=Ue.current,wt.to=Vn,wt.startMs=me);let Ln;if(wt.startMs>0){const Se=me-wt.startMs,Ne=Math.min(Se/q9,1);Ln=wt.from+(wt.to-wt.from)*(1-(1-Ne)*(1-Ne)),Ne>=1&&(Ln=wt.to,wt.startMs=0)}else Ln=wt.to;Ue.current=Ln;const Wi=x.current,Bt=tO(F.windowSecs,Wi,y.current,f.current,h.current,me,Ot,Ie,$e,jn,Be);y.current=Bt.windowSecs;const Zn=Bt.windowSecs,ra=Bt.windowTransProgress,Nt=Wi.startMs>0,un=Ot+Zn*Be,fn=un-Zn;let An;if($e){const Se=de.current;if(!Se||Se.time!==$e.time)de.current={time:$e.time,open:$e.open,high:$e.open,low:$e.open,close:$e.open},ve.current=0;else{const Ke=de.current;Ke.open=zt(Ke.open,$e.open,iu,Ve),Ke.high=zt(Ke.high,$e.high,iu,Ve),Ke.low=zt(Ke.low,$e.low,iu,Ve),Ke.close=zt(Ke.close,$e.close,iu,Ve)}ve.current=zt(ve.current,1,.2,Ve),ve.current>.99&&(ve.current=1);const Ne=de.current,dn=Ne.close>=Ne.open?1:0;be.current=zt(be.current,dn,.12,Ve),be.current>.99&&(be.current=1),be.current<.01&&(be.current=0),An=Ne}else de.current=null,ve.current=1,be.current=.5;if($e)if(!ze.current)Ee.current=$e.close,ze.current=!0;else{Ee.current=zt(Ee.current,$e.close,X9,Ve);const Se=Math.abs(Ee.current-$e.close),Ne=h.current-f.current||1;Se<Ne*5e-4&&(Ee.current=$e.close)}else Pn||(ze.current=!1);if($e)if(!se.current)je.current=$e.close,se.current=!0;else{const Se=Math.abs($e.close-je.current),Ne=h.current-f.current||1,dn=Math.min(Se/Ne,1),Ke=ib+(1-dn)*rb;je.current=zt(je.current,$e.close,Ke,Ve),Se<Ne*ab&&(je.current=$e.close)}else Pn||(se.current=!1);if(Cn!==void 0&&nn)if(!qt.current)ut.current=Cn,qt.current=!0;else{const Se=Math.abs(Cn-ut.current),Ne=h.current-f.current||1,dn=Math.min(Se/Ne,1),Ke=ib+(1-dn)*rb;ut.current=zt(ut.current,Cn,Ke,Ve),Se<Ne*ab&&(ut.current=Cn)}else Pn||(qt.current=!1);const Un=[];for(const Se of Ie)Se.time+jn>=fn&&Se.time<=un&&Un.push(Se);An&&An.time+Ht>=fn&&An.time<=un&&Un.push(An);let Hn=[];if(cn>=0&&Pe.oldCandles.length>0)for(const Se of Pe.oldCandles)Se.time+Pe.oldWidth>=fn&&Se.time<=un&&Hn.push(Se);Dt&&(Zt.current=Un,ta.current=An??null);const Jn=Pn?Zt.current:Un,ei=Pn?ta.current??void 0:An,cr=ee-Le.left-Le.right,ur=Jn.length>0?hm(Jn):{min:f.current,max:h.current},Yt=eO(ur,v.current,f.current,h.current,Nt,ra,Wi,oi,Ve);cn>=0&&(Yt.displayMin=Pe.rangeFromMin+(Pe.rangeToMin-Pe.rangeFromMin)*cn,Yt.displayMax=Pe.rangeFromMax+(Pe.rangeToMax-Pe.rangeFromMax)*cn,Yt.minVal=Yt.displayMin,Yt.maxVal=Yt.displayMax,Yt.valRange=Yt.displayMax-Yt.displayMin||.001),v.current=Yt.rangeInited,f.current=Yt.displayMin,h.current=Yt.displayMax;const{minVal:Li,maxVal:Er,valRange:Ki}=Yt,Rt={w:ee,h:ge,pad:Le,chartW:cr,chartH:oi,leftEdge:fn,rightEdge:un,minVal:Li,maxVal:Er,valRange:Ki,toX:Se=>Le.left+(Se-fn)/(un-fn)*cr,toY:Se=>Le.top+(1-(Se-Li)/Ki)*oi},jt=O.current;let pt=null,Ae=!1;jt!==null&&jt>=Le.left&&jt<=ee-Le.right&&(pt=ub(Jn,jt,Ht,Rt),pt&&(Ae=!0));const Ye=Ae?1:0;j.current=zt(j.current,Ye,.12,ye),j.current<.01&&(j.current=0),j.current>.99&&(j.current=1);const yt=j.current;let Wt=jt,bn=0,wi=pt;!Ae&&yt>0&&L.current?(Wt=L.current.x,bn=L.current.time,wi=ub(Jn,L.current.x,Ht,Rt)):Ae&&jt!==null&&(bn=Rt.leftEdge+(jt-Le.left)/cr*(Rt.rightEdge-Rt.leftEdge),L.current={x:jt,value:(pt==null?void 0:pt.close)??0,time:bn});let vt=Jn,Nn=Hn,_t=ei;if(It>.01&&_t&&se.current){const Se=_t.close+(je.current-_t.close)*It;_t={..._t,close:Se};const Ne=vt.length-1;Ne>=0&&vt[Ne].time===_t.time&&(vt=vt.slice(),vt[Ne]={...vt[Ne],close:Se})}if(It>.01&&It<.99){const Se=Ne=>{const dn=1-It;return{time:Ne.time,open:Ne.close+(Ne.open-Ne.close)*dn,high:Ne.close+(Ne.high-Ne.close)*dn,low:Ne.close+(Ne.low-Ne.close)*dn,close:Ne.close}};vt=vt.map(Se),Nn.length>0&&(Nn=Nn.map(Se)),_t&&(_t=Se(_t))}let In,_i;if(gt&&gt.length>0&&(Ln>.01||It>.05)){const Se=[];for(const Ke of vt)Se.push({t:Ke.time+Ht/2,v:Ke.close});_t&&Se.push({t:Ot,v:_t.close}),In=[];let Ne=0;for(const Ke of gt){if(Ke.time<fn||Ke.time>un)continue;for(;Ne<Se.length-2&&Se[Ne+1].t<Ke.time;)Ne++;let rn;if(Se.length===0)rn=Ke.value;else if(Se.length===1||Ke.time<=Se[0].t)rn=Se[0].v;else if(Ne>=Se.length-1)rn=Se[Se.length-1].v;else{const xn=Se[Ne],fr=Se[Ne+1],La=fr.t-xn.t,Ua=La>0?Math.max(0,Math.min(1,(Ke.time-xn.t)/La)):0;rn=xn.v+(fr.v-xn.v)*Ua}const aa=rn+(Ke.value-rn)*Ln;In.push({time:Ke.time,value:aa})}const dn=qt.current?ut.current:Cn??gt[gt.length-1].value;_i=je.current+(dn-je.current)*Ln}else In=vt.map(Se=>({time:Se.time+Ht/2,value:Se.close})),_i=se.current?je.current:(_t==null?void 0:_t.close)??((ln=vt[vt.length-1])==null?void 0:ln.close)??0;if(Mn<1&&In.length>=2){const Se=In[0].time,Ne=un-fn;if(Se-fn>Ne*.05){const dn=In[0].value,Ke=Ne/32,rn=[];for(let aa=fn;aa<Se-Ke*.5;aa+=Ke)rn.push({time:aa,value:dn});In=[...rn,...In]}}if(R9(Ge,Rt,F.palette,{candles:vt,displayCandleWidth:Ht,oldCandles:Nn,oldWidth:Pe.oldWidth,morphT:cn,liveCandle:_t,closePriceCandle:ze.current&&$e?{...$e,close:Ee.current}:$e,liveTime:(ei==null?void 0:ei.time)??-1,liveBirthAlpha:ve.current,liveBullBlend:be.current,lineModeProg:It,chartReveal:Mn,now_ms:me,now:Ot,showGrid:F.showGrid,scrubAmount:yt,hoverX:Wt,hoverValue:(wi==null?void 0:wi.close)??null,hoverTime:bn,hoveredCandle:wi,formatValue:F.formatValue,formatTime:F.formatTime,gridState:_.current,timeAxisState:T.current,dt:Ve,targetWindowSecs:F.windowSecs,tooltipY:F.tooltipY,tooltipOutline:F.tooltipOutline,lineVisible:In,lineSmoothValue:_i,emptyText:F.emptyText,loadingAlpha:Qn,showEmptyOverlay:!(F.loading??!1)&&Qn<.01}),Y.current)if(It>.5&&F.showBadge){const Se=Yy(In);P.current=cb(Y.current,F,_i,Rt,Se,P.current,B.current,Nt,zn,Ge,Ve,Mn);const Ne=(It-.5)*2;if(Y.current.container.style.display!=="none"){const dn=Y.current.container.style.opacity?parseFloat(Y.current.container.style.opacity):1;Y.current.container.style.opacity=String(dn*Ne*(1-mt))}}else Y.current.container.style.display="none"}else if(F.isMultiSeries&&F.multiSeries&&F.multiSeries.length>0||Xi){Ge.clearRect(0,0,ee,ge);const Be=Xi?J.current:F.multiSeries;let Ot=0;if(Be.some(Ae=>Ae.label)){Ge.font='600 10px -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif';let Ae=0;for(const Ye of Be)if(Ye.label){const yt=Ge.measureText(Ye.label).width;yt>Ae&&(Ae=yt)}Ot=Math.max(0,Ae-2)*Mn}const $e=ee-Le.left-Le.right-Ot,gt=F.showBadge?eb:tb;if(!Xi){const Ae=new Set(Be.map(Ye=>Ye.id));for(const Ye of l.current.keys())Ae.has(Ye)||l.current.delete(Ye)}const Cn=Be[0],jn=x.current;Dt&&(R.current=Date.now()/1e3-ie.current);const Pe=Xi?R.current:Date.now()/1e3-ie.current,cn=new Map;for(const Ae of Be){let Ye=l.current.get(Ae.id);if(Ye===void 0&&(Ye=Ae.value),!Xi){const yt=sb(Ae.value,Ye,f.current,h.current,F.lerpSpeed,zn);Ye=zt(Ye,Ae.value,yt,Ve);const Wt=h.current-f.current||1;Math.abs(Ye-Ae.value)<Wt*nb&&(Ye=Ae.value),l.current.set(Ae.id,Ye)}cn.set(Ae.id,Ye)}const Ht=F.hiddenSeriesIds,It=c.current;for(const Ae of Be){let Ye=It.get(Ae.id)??1;const yt=Ht!=null&&Ht.has(Ae.id)?0:1;Ye=zn?yt:zt(Ye,yt,V9,Ve),Ye<.01&&(Ye=0),Ye>.99&&(Ye=1),It.set(Ae.id,Ye)}const wt=((wr=(On=ae.current)==null?void 0:On.get(Cn.id))==null?void 0:wr.data)??Cn.data,nn=ob(F,jn,y.current,f.current,h.current,zn,me,Pe,wt,cn.get(Cn.id)??Cn.value,gt);if(jn.startMs>0&&Be.length>1){const Ae=Pe+F.windowSecs*gt,Ye=Ae-F.windowSecs;let yt=1/0,Wt=-1/0;for(const bn of Be){const wi=((jl=(ps=ae.current)==null?void 0:ps.get(bn.id))==null?void 0:jl.data)??bn.data,vt=cn.get(bn.id)??bn.value,Nn=[];for(const _t of wi)_t.time>=Ye-2&&_t.time<=Ae&&Nn.push(_t);if(Nn.length>0){const _t=uu(Nn,vt,(Ll=F.referenceLine)==null?void 0:Ll.value,F.exaggerate);_t.min<yt&&(yt=_t.min),_t.max>Wt&&(Wt=_t.max)}}isFinite(yt)&&isFinite(Wt)&&(jn.rangeToMin=yt,jn.rangeToMax=Wt)}y.current=nn.windowSecs;const Vn=nn.windowSecs,Ln=nn.windowTransProgress,Wi=jn.startMs>0,Bt=Pe+Vn*gt,Zn=Bt-Vn,ra=Bt-(Bt-Pe)*mt,Nt=[];let un=1/0,fn=-1/0;for(const Ae of Be){const Ye=(vo=ae.current)==null?void 0:vo.get(Ae.id),yt=(Ye==null?void 0:Ye.data)??Ae.data,Wt=[];for(const vt of yt)vt.time>=Zn-2&&vt.time<=ra&&Wt.push(vt);const bn=cn.get(Ae.id)??Ae.value,wi=It.get(Ae.id)??1;if(Wt.length>=2){if(wi>.01){const vt=uu(Wt,bn,(na=F.referenceLine)==null?void 0:na.value,F.exaggerate);vt.min<un&&(un=vt.min),vt.max>fn&&(fn=vt.max)}Nt.push({visible:Wt,smoothValue:bn,palette:Ae.palette,label:Ae.label,alpha:wi})}}if(Nt.length===0){Qn>.01&&Wy(Ge,ee,ge,Le,F.palette,me,Qn,F.palette.gridLabel),1-Qn>.01&&xl(Ge,ee,ge,Le,F.palette,1-Qn,me,!1,F.emptyText),Ge.save(),Ge.globalCompositeOperation="destination-out";const Ae=Ge.createLinearGradient(Le.left,0,Le.left+Ir,0);Ae.addColorStop(0,"rgba(0, 0, 0, 1)"),Ae.addColorStop(1,"rgba(0, 0, 0, 0)"),Ge.fillStyle=Ae,Ge.fillRect(0,0,Le.left+Ir,ge),Ge.restore(),Y.current&&(Y.current.container.style.display="none"),$.current=requestAnimationFrame(on);return}const An={min:isFinite(un)?un:0,max:isFinite(fn)?fn:1},Un=F.lerpSpeed+Aw*.5,Hn=lb(An,v.current,d.current,g.current,f.current,h.current,Wi,Ln,jn,Un,oi,Ve);v.current=Hn.rangeInited,d.current=Hn.targetMin,g.current=Hn.targetMax,f.current=Hn.displayMin,h.current=Hn.displayMax;const{minVal:Jn,maxVal:ei,valRange:cr}=Hn,ur={w:ee,h:ge,pad:Le,chartW:$e,chartH:oi,leftEdge:Zn,rightEdge:Bt,minVal:Jn,maxVal:ei,valRange:cr,toX:Ae=>Le.left+(Ae-Zn)/(Bt-Zn)*$e,toY:Ae=>Le.top+(1-(Ae-Jn)/cr)*oi},Yt=O.current;let Li=null,Er=null,Ki=!1,Rt=[];if(Yt!==null&&Yt>=Le.left&&Yt<=ee-Le.right){const Ae=ur.toX(Pe),Ye=Math.min(Yt,Ae),yt=Zn+(Ye-Le.left)/$e*(Bt-Zn);Li=Ye,Er=yt,Ki=!0;for(const Wt of Nt){if((Wt.alpha??1)<.5)continue;const bn=ww(Wt.visible,yt);bn!==null&&Rt.push({color:Wt.palette.line,label:Wt.label??"",value:bn})}L.current={x:Ye,value:((vs=Rt[0])==null?void 0:vs.value)??0,time:yt},K.current=Rt,(ia=F.onHover)==null||ia.call(F,{time:yt,value:((_r=Rt[0])==null?void 0:_r.value)??0,x:Ye,y:ur.toY(((Sr=Rt[0])==null?void 0:Sr.value)??0)})}const jt=Ki?1:0;zn?j.current=jt:(j.current+=(jt-j.current)*Mw,j.current<.01&&(j.current=0),j.current>.99&&(j.current=1)),!Ki&&j.current>0&&L.current&&(Li=L.current.x,Er=L.current.time,Rt=K.current),N9(Ge,ur,{series:Nt,now:Pe,showGrid:F.showGrid,showPulse:F.showPulse,referenceLine:F.referenceLine,hoverX:Li,hoverTime:Er,hoverEntries:Rt,scrubAmount:j.current,windowSecs:Vn,formatValue:F.formatValue,formatTime:F.formatTime,gridState:_.current,timeAxisState:T.current,dt:ye,targetWindowSecs:F.windowSecs,tooltipY:F.tooltipY,tooltipOutline:F.tooltipOutline,chartReveal:Mn,pauseProgress:mt,now_ms:me,primaryPalette:F.palette});const pt=1-Mn;if(pt>.01&&lr===0&&!F.loading){const Ae=(1-Qn)*pt;Ae>.01&&xl(Ge,ee,ge,Le,F.palette,Ae,me,!0,F.emptyText)}Y.current&&(Y.current.container.style.display="none")}else{const Be=Pn?ue.current:xi,Ot=sb(F.value,s.current,f.current,h.current,F.lerpSpeed,zn);if(!Pn&&(s.current=zt(s.current,F.value,Ot,Ve),mt<.5)){const pt=h.current-f.current||1;Math.abs(s.current-F.value)<pt*nb&&(s.current=F.value)}const $e=s.current,gt=ee-Le.left-Le.right,Cn=F.showBadge?eb:tb,Pe=F.showMomentum&&F.showBadge?Math.max(Cn,52/Math.max(gt,1)):Cn,cn=x.current;Dt&&(R.current=Date.now()/1e3-ie.current);const Ht=Pn?R.current:Date.now()/1e3-ie.current,It=ob(F,cn,y.current,f.current,h.current,zn,me,Ht,Be,$e,Pe);y.current=It.windowSecs;const wt=It.windowSecs,nn=It.windowTransProgress,Vn=Ht+wt*Pe,Ln=Vn-wt,Wi=Vn-(Vn-Ht)*mt,Bt=[];for(const pt of Be)pt.time>=Ln-2&&pt.time<=Wi&&Bt.push(pt);if(Bt.length<2){Y.current&&(Y.current.container.style.display="none"),$.current=requestAnimationFrame(on);return}Ge.clearRect(0,0,ee,ge);const Zn=uu(Bt,$e,(Tr=F.referenceLine)==null?void 0:Tr.value,F.exaggerate),ra=cn.startMs>0,Nt=lb(Zn,v.current,d.current,g.current,f.current,h.current,ra,nn,cn,Ot,oi,Ve);v.current=Nt.rangeInited,d.current=Nt.targetMin,g.current=Nt.targetMax,f.current=Nt.displayMin,h.current=Nt.displayMax;const{minVal:un,maxVal:fn,valRange:An}=Nt,Un={w:ee,h:ge,pad:Le,chartW:gt,chartH:oi,leftEdge:Ln,rightEdge:Vn,minVal:un,maxVal:fn,valRange:An,toX:pt=>Le.left+(pt-Ln)/(Vn-Ln)*gt,toY:pt=>Le.top+(1-(pt-un)/An)*oi},Hn=F.momentumOverride??Yy(Bt),Jn=J9(O.current,Le,ee,Un,Ht,Bt,j.current,L.current,F,zn,Ln,Vn,gt);j.current=Jn.scrubAmount,L.current=Jn.lastHover;const{hoverX:ei,hoverValue:cr,hoverTime:ur}=Jn,Yt=Math.min(5,Bt.length-1),Li=Yt>0?Math.abs(Bt[Bt.length-1].value-Bt[Bt.length-1-Yt].value):0,Er=An>0?Math.min(Li/An,1):0;A9(Ge,Un,F.palette,{visible:Bt,smoothValue:$e,now:Ht,momentum:Hn,arrowState:S.current,showGrid:F.showGrid,showMomentum:F.showMomentum,showPulse:F.showPulse,showFill:F.showFill,referenceLine:F.referenceLine,hoverX:ei,hoverValue:cr,hoverTime:ur,scrubAmount:j.current,windowSecs:wt,formatValue:F.formatValue,formatTime:F.formatTime,gridState:_.current,timeAxisState:T.current,dt:ye,targetWindowSecs:F.windowSecs,tooltipY:F.tooltipY,tooltipOutline:F.tooltipOutline,orderbookData:F.orderbookData,orderbookState:F.orderbookData?E.current:void 0,particleState:F.degenOptions?C.current:void 0,particleOptions:F.degenOptions,swingMagnitude:Er,shakeState:F.degenOptions?k.current:void 0,chartReveal:Mn,pauseProgress:mt,now_ms:me});const Ki=1-Mn;if(Ki>.01&&lr===0&&!F.loading){const pt=(1-Qn)*Ki;pt>.01&&xl(Ge,ee,ge,Le,F.palette,pt,me,!0,F.emptyText)}const Rt=Y.current;if(Rt&&(P.current=cb(Rt,F,$e,Un,Hn,P.current,B.current,ra,zn,Ge,Ve,Mn),mt>.01&&Rt.container.style.display!=="none")){const pt=Rt.container.style.opacity?parseFloat(Rt.container.style.opacity):1;Rt.container.style.opacity=String(pt*(1-mt))}const jt=(tn=F.valueDisplayRef)==null?void 0:tn.current;if(jt){const pt=F.valueMomentumColor?Math.abs($e):$e;if(jt.textContent=F.formatValue(pt),F.valueMomentumColor){const Ae=Hn==="up"?"#22c55e":Hn==="down"?"#ef4444":"";Ae?jt.style.color=Ae:jt.style.removeProperty("color")}}}$.current=requestAnimationFrame(on)},[e]);M.useEffect(()=>($.current=requestAnimationFrame(on),()=>cancelAnimationFrame($.current)),[on])}var iO=e=>e.toFixed(2),rO=e=>{const t=new Date(e*1e3),i=t.getHours().toString().padStart(2,"0"),r=t.getMinutes().toString().padStart(2,"0"),s=t.getSeconds().toString().padStart(2,"0");return`${i}:${r}:${s}`};function Nw({data:e,value:t,series:i,theme:r="dark",color:s="#3b82f6",window:l=30,grid:c=!0,badge:f=!0,momentum:h=!0,fill:d=!0,scrub:g=!0,loading:v=!1,paused:y=!1,emptyText:x,exaggerate:S=!1,degen:_,badgeTail:T=!0,badgeVariant:E="default",showValue:C=!1,valueMomentumColor:k=!1,windows:B,onWindowChange:P,windowStyle:N,tooltipY:U=14,tooltipOutline:A=!0,orderbook:$,referenceLine:I,formatValue:Y=iO,formatTime:O=rO,lerpSpeed:j=.08,padding:L,onHover:K,cursor:D="crosshair",pulse:V=!0,mode:ie="line",candles:ue,candleWidth:J,liveCandle:R,lineMode:X,lineData:ae,lineValue:he,onModeChange:de,onSeriesToggle:ve,seriesToggleCompact:be=!1,lineWidth:je,className:se,style:Ee}){var oi;const ze=M.useRef(null),fe=M.useRef(null),dt=M.useRef(null),Ue=M.useRef(null),ht=M.useRef(new Map),[ut,qt]=M.useState(null),yi=M.useRef(null),Tn=M.useRef(new Map),[vn,Di]=M.useState(null),[bi,or]=M.useState(new Set),Zt=M.useRef(i);i&&i.length>0&&(Zt.current=i);const ta=M.useMemo(()=>{const He=fm(s,r);return je!=null&&(He.lineWidth=je),He},[s,r,je]),En=r==="dark",Kn=i!=null&&i.length>0,on=(((oi=Zt.current)==null?void 0:oi.length)??0)>1,De=M.useMemo(()=>!i||i.length===0?null:P8(i,r),[i,r]),ee=M.useMemo(()=>{if(!(!i||!De))return i.map((He,mt)=>({id:He.id,data:He.data,value:He.value,palette:De.get(He.id)??fm(He.color||no[mt%no.length],r),label:He.label}))},[i,De,r]),ge=h!==!1,F=typeof h=="string"?h:void 0,pe=f?80:c?54:12,me={top:(L==null?void 0:L.top)??12,right:(L==null?void 0:L.right)??pe,bottom:(L==null?void 0:L.bottom)??28,left:(L==null?void 0:L.left)??12},We=(_!=null?_!==!1:!1)?typeof _=="object"?_:{}:void 0,[yn,Ge]=M.useState(B&&B.length>0?B[0].secs:l),zn=B?yn:l;M.useLayoutEffect(()=>{if(!B||B.length===0)return;const He=ht.current.get(yn),mt=Ue.current;if(He&&mt){const Ve=mt.getBoundingClientRect(),ji=He.getBoundingClientRect();qt({left:ji.left-Ve.left,width:ji.width})}},[yn,B]);const Ut=X?"line":"candle";M.useLayoutEffect(()=>{if(!de)return;const He=Tn.current.get(Ut),mt=yi.current;if(He&&mt){const Ve=mt.getBoundingClientRect(),ji=He.getBoundingClientRect();Di({left:ji.left-Ve.left,width:ji.width})}},[Ut,de]);const xi=M.useCallback(He=>{or(mt=>{const Ve=new Set(mt);if(Ve.has(He))Ve.delete(He),ve==null||ve(He,!0);else{if(((i==null?void 0:i.length)??0)-Ve.size<=1)return mt;Ve.add(He),ve==null||ve(He,!1)}return Ve})},[i==null?void 0:i.length,ve]),Ie=N??"default";nO(ze,fe,{data:e,value:t,palette:ta,windowSecs:zn,lerpSpeed:j,showGrid:c,showBadge:Kn?!1:f,showMomentum:Kn?!1:ge,momentumOverride:F,showFill:Kn?!1:d,referenceLine:I,formatValue:Y,formatTime:O,padding:me,onHover:K,showPulse:V,scrub:g,exaggerate:S,degenOptions:Kn?void 0:We,badgeTail:T,badgeVariant:E,tooltipY:U,tooltipOutline:A,valueMomentumColor:k,valueDisplayRef:C?dt:void 0,orderbookData:$,loading:v,paused:y,emptyText:x,mode:ie,candles:ue,candleWidth:J,liveCandle:R,lineMode:X,lineData:ae,lineValue:he,multiSeries:ee,isMultiSeries:Kn,hiddenSeriesIds:bi});const Oi=g?D:"default",Dt=En?"rgba(255,255,255,0.7)":"rgba(0,0,0,0.55)",Le=En?"rgba(255,255,255,0.25)":"rgba(0,0,0,0.22)";return b.jsxs(b.Fragment,{children:[C&&b.jsx("span",{ref:dt,style:{display:"block",fontSize:20,fontWeight:500,fontFamily:'"SF Mono", Menlo, monospace',color:En?"rgba(255,255,255,0.85)":"#111",transition:"color 0.3s",letterSpacing:"-0.01em",marginBottom:8,paddingTop:4,paddingLeft:me.left}}),(B&&B.length>0||de||on)&&b.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:6,marginLeft:me.left},children:[B&&B.length>0&&b.jsxs("div",{ref:Ue,style:{position:"relative",display:"inline-flex",gap:Ie==="text"?4:2,background:Ie==="text"?"transparent":En?"rgba(255,255,255,0.03)":"rgba(0,0,0,0.02)",borderRadius:Ie==="rounded"?999:6,padding:Ie==="text"?0:Ie==="rounded"?3:2},children:[Ie!=="text"&&ut&&b.jsx("div",{style:{position:"absolute",top:Ie==="rounded"?3:2,left:ut.left,width:ut.width,height:Ie==="rounded"?"calc(100% - 6px)":"calc(100% - 4px)",background:En?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.035)",borderRadius:Ie==="rounded"?999:4,transition:"left 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s cubic-bezier(0.4, 0, 0.2, 1)",pointerEvents:"none"}}),B.map(He=>{const mt=He.secs===yn;return b.jsx("button",{ref:Ve=>{Ve?ht.current.set(He.secs,Ve):ht.current.delete(He.secs)},onClick:()=>{Ge(He.secs),P==null||P(He.secs)},style:{position:"relative",zIndex:1,fontSize:11,padding:Ie==="text"?"2px 6px":"3px 10px",borderRadius:Ie==="rounded"?999:4,border:"none",cursor:"pointer",fontFamily:"system-ui, -apple-system, sans-serif",fontWeight:mt?600:400,background:"transparent",color:mt?Dt:Le,transition:"color 0.2s, background 0.15s",lineHeight:"16px"},children:He.label},He.secs)})]}),de&&b.jsxs("div",{ref:yi,style:{position:"relative",display:"inline-flex",gap:Ie==="text"?4:2,background:Ie==="text"?"transparent":En?"rgba(255,255,255,0.03)":"rgba(0,0,0,0.02)",borderRadius:Ie==="rounded"?999:6,padding:Ie==="text"?0:Ie==="rounded"?3:2},children:[Ie!=="text"&&vn&&b.jsx("div",{style:{position:"absolute",top:Ie==="rounded"?3:2,left:vn.left,width:vn.width,height:Ie==="rounded"?"calc(100% - 6px)":"calc(100% - 4px)",background:En?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.035)",borderRadius:Ie==="rounded"?999:4,transition:"left 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s cubic-bezier(0.4, 0, 0.2, 1)",pointerEvents:"none"}}),b.jsx("button",{ref:He=>{He?Tn.current.set("line",He):Tn.current.delete("line")},onClick:()=>de("line"),style:{position:"relative",zIndex:1,padding:"5px 7px",borderRadius:Ie==="rounded"?999:4,border:"none",cursor:"pointer",background:"transparent",display:"flex",alignItems:"center"},children:b.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:b.jsx("path",{d:"M1 8.5C2.5 8.5 3 4 5.5 4S7.5 7 8.5 7C9.5 7 10 3.5 11 3.5",stroke:Ut==="line"?Dt:Le,strokeWidth:Ut==="line"?1.5:1.2,strokeLinecap:"round",fill:"none"})})}),b.jsx("button",{ref:He=>{He?Tn.current.set("candle",He):Tn.current.delete("candle")},onClick:()=>de("candle"),style:{position:"relative",zIndex:1,padding:"5px 7px",borderRadius:Ie==="rounded"?999:4,border:"none",cursor:"pointer",background:"transparent",display:"flex",alignItems:"center"},children:b.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[b.jsx("line",{x1:"3.5",y1:"1",x2:"3.5",y2:"11",stroke:Ut==="candle"?Dt:Le,strokeWidth:"1"}),b.jsx("rect",{x:"2",y:"3",width:"3",height:"5",rx:"0.5",fill:Ut==="candle"?Dt:Le}),b.jsx("line",{x1:"8.5",y1:"2",x2:"8.5",y2:"10",stroke:Ut==="candle"?Dt:Le,strokeWidth:"1"}),b.jsx("rect",{x:"7",y:"4",width:"3",height:"4",rx:"0.5",fill:Ut==="candle"?Dt:Le})]})})]}),on&&b.jsx("div",{style:{display:"inline-flex",gap:Ie==="text"?4:2,background:Ie==="text"?"transparent":En?"rgba(255,255,255,0.03)":"rgba(0,0,0,0.02)",borderRadius:Ie==="rounded"?999:6,padding:Ie==="text"?0:Ie==="rounded"?3:2,opacity:Kn?1:0,transition:"opacity 0.4s",pointerEvents:Kn?"auto":"none"},children:(Zt.current??[]).map((He,mt)=>{const Ve=bi.has(He.id),ji=He.color||no[mt%no.length];return b.jsxs("button",{onClick:()=>xi(He.id),style:{position:"relative",zIndex:1,fontSize:11,padding:be?Ie==="text"?"2px 4px":"5px 7px":Ie==="text"?"2px 6px":"3px 8px",borderRadius:Ie==="rounded"?999:4,border:"none",cursor:"pointer",fontFamily:"system-ui, -apple-system, sans-serif",fontWeight:500,background:Ve||Ie==="text"?"transparent":En?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.035)",color:Ve?Le:Dt,opacity:Ve?.4:1,transition:"opacity 0.2s, background 0.15s, color 0.2s",lineHeight:"16px",display:"flex",alignItems:"center",gap:be?0:4},children:[b.jsx("span",{style:{width:be?8:6,height:be?8:6,borderRadius:"50%",background:ji,flexShrink:0,opacity:Ve?.4:1,transition:"opacity 0.2s"}}),!be&&(He.label??He.id)]},He.id)})})]}),b.jsx("div",{ref:fe,className:se,style:{width:"100%",height:"100%",position:"relative",...Ee},children:b.jsx("canvas",{ref:ze,style:{display:"block",cursor:Oi}})})]})}const Dh={"1m":6e4,"5m":5*6e4,"15m":15*6e4,"1h":60*6e4,"4h":240*6e4,"1d":1440*6e4},fb=60,aO={top:12,right:56,bottom:28,left:12};Jx.schema;function sO({config:e}){const t=Dh[e.interval],i=M.useMemo(()=>Date.now()-t*fb,[t]),{candles:r,isLoading:s}=Uz(e.symbol,e.interval,i,Math.min(t,6e4)),c=Cm([e.symbol])[e.symbol],[f,h]=M.useState([]);M.useEffect(()=>{c!==void 0&&h(_=>{const T=[..._,{time:Date.now()/1e3,value:c}];return T.length>900?T.slice(-600):T})},[c]),M.useEffect(()=>h([]),[e.symbol]);const d=M.useMemo(()=>r.slice(0,-1).map(_=>({time:_.time/1e3,open:_.open,high:_.high,low:_.low,close:_.close})),[r]),g=r[r.length-1],v=M.useMemo(()=>{if(!g)return;const _=c??g.close;return{time:g.time/1e3,open:g.open,high:Math.max(g.high,_),low:Math.min(g.low,_),close:_}},[g,c]),y=c??(g==null?void 0:g.close)??0,x=M.useMemo(()=>t>=Dh["1d"]?_=>new Date(_*1e3).toLocaleDateString("en-US",{month:"short",day:"numeric"}):t>=Dh["1h"]?_=>{const T=new Date(_*1e3);return`${T.toLocaleDateString("en-US",{month:"short",day:"numeric"})} ${String(T.getHours()).padStart(2,"0")}h`}:_=>new Date(_*1e3).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit"}),[t]),S=M.useMemo(()=>{const _=r.map(E=>({time:E.time/1e3,value:E.close}));if(f.length===0)return _;const T=f[0].time;return[..._.filter(E=>E.time<T),...f]},[r,f]);return s&&r.length===0?b.jsx(ct,{loading:!0,children:"loading chart..."}):b.jsx("div",{className:"h-full min-h-0",children:b.jsx(Nw,{mode:e.mode,data:S,value:y,candles:d,candleWidth:t/1e3,liveCandle:v,window:t/1e3*fb,color:e.color,theme:"dark",loading:s,formatValue:_=>cs(_),formatTime:x,padding:aO,showValue:!0,fill:!0,pulse:!0})})}const oO={...Jx,component:sO,titleIcon:({config:e})=>b.jsx(fs,{symbol:e.symbol,size:14})},lO={"24h":{ms:1440*60*1e3,interval:"15m",timeframe:Ra["24h"]},"7D":{ms:10080*60*1e3,interval:"1h",timeframe:Ra["7D"]},"1M":{ms:720*60*60*1e3,interval:"4h",timeframe:Ra["1M"]}};gw.schema;function cO({config:e}){const{ms:t,interval:i,timeframe:r}=lO[e.lookback],s=M.useMemo(()=>Date.now()-t,[t]),{candles:l,isLoading:c}=Hz(e.symbols,i,s),f=M.useMemo(()=>e.symbols.map((h,d)=>{var y;const g=l[h]??[],v=(y=g[0])==null?void 0:y.close;return{id:h,name:Xr(h),iconImageUrl:H2(h),color:yr[d%yr.length],data:g.map(x=>({date:new Date(x.time).toISOString(),value:e.normalize&&v?(x.close/v-1)*100:x.close}))}}),[e.symbols,e.normalize,l]);return b.jsx(Zx,{series:f,timeframe:r,height:250,isLoading:c,formatValue:e.normalize?h=>`${h>=0?"+":""}${h.toFixed(1)}%`:h=>cs(h)})}const uO={...gw,component:cO},db=720,fO=1e3,Rw=3,dO={top:12,right:58,bottom:28,left:8};ew.schema;function kw(e){return e!==void 0&&Number.isFinite(e)}function hO(e,t,i,r){let s=!1;const l={...e};for(const c of t){const f=i[c];if(!kw(f))continue;const h=l[c]??[],d=h[h.length-1];if(d&&Math.abs(r-d.time)<.5&&d.value===f)continue;const g=h.length===0?[{time:r-Rw,value:f},{time:r,value:f}]:[...h,{time:r,value:f}];l[c]=g.length>db?g.slice(-db):g,s=!0}return s?l:e}function hb(e,t){return t===0?0:(e/t-1)*100}function mO(e){const t=Math.abs(e)>=10?1:2;return`${e>=0?"+":""}${e.toFixed(t)}%`}function gO({config:e}){const t=e.symbols,i=t.join("|"),r=Cm(t),s=Bh(t),[l,c]=M.useState({}),[f,h]=M.useState(()=>new Set),d=M.useMemo(()=>{var E;const T={};for(const C of t){const k=r[C]??((E=s[C])==null?void 0:E.markPx);kw(k)&&(T[C]=k)}return T},[r,s,t]),g=M.useRef(d);M.useEffect(()=>{g.current=d},[d]),M.useEffect(()=>{const T=new Set(t);c(E=>{let C=!1;const k={};for(const[B,P]of Object.entries(E)){if(!T.has(B)){C=!0;continue}k[B]=P}return C?k:E}),h(E=>{const C=new Set([...E].filter(k=>T.has(k)));return C.size===E.size?E:C})},[i,t]);const v=M.useCallback(T=>{h(E=>{const C=new Set(E);return C.has(T)?(C.delete(T),C):t.length-C.size<=1?E:(C.add(T),C)})},[t]),y=M.useCallback(()=>{const T=g.current;if(Object.keys(T).length===0)return;const E=Date.now()/1e3;c(C=>hO(C,t,T,E))},[i,t]);M.useEffect(()=>{y()},[y,d]),M.useEffect(()=>{const T=window.setInterval(y,fO);return()=>window.clearInterval(T)},[y]);const x=M.useMemo(()=>t.flatMap((T,E)=>{var P,N;if(f.has(T))return[];const C=l[T]??[],k=(P=C[0])==null?void 0:P.value;if(!k||C.length===0)return[];const B=e.normalize?C.map(U=>({time:U.time,value:hb(U.value,k)})):C;return[{id:T,label:Xr(T),color:yr[E%yr.length],data:B,value:((N=B[B.length-1])==null?void 0:N.value)??0}]}),[l,f,t,e.normalize]),S=M.useMemo(()=>{var k,B;let T=1/0,E=-1/0;for(const P of t){const N=l[P]??[];N.length!==0&&(T=Math.min(T,((k=N[0])==null?void 0:k.time)??1/0),E=Math.max(E,((B=N[N.length-1])==null?void 0:B.time)??-1/0))}const C=Number.isFinite(T)&&Number.isFinite(E)?E-T:0;return Math.min(e.windowSec,Math.max(Rw,Math.ceil(C)))},[l,t,e.windowSec]),_=x.some(T=>T.data.length>1);return b.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[b.jsx("div",{className:"grid flex-none grid-cols-1 gap-x-3 gap-y-1.5 border-b border-white/[0.06] pb-2 sm:grid-cols-2",children:t.map((T,E)=>{var U,A;const C=d[T],k=(A=(U=l[T])==null?void 0:U[0])==null?void 0:A.value,B=C!==void 0&&k?hb(C,k):void 0,P=yr[E%yr.length],N=f.has(T);return b.jsxs("button",{type:"button","aria-pressed":!N,title:`${N?"Show":"Hide"} ${Xr(T)}`,className:`grid min-w-0 grid-cols-[auto_auto_minmax(0,1fr)_auto] items-center gap-1.5 rounded-md px-1.5 py-0.5 text-left text-[10px] leading-4 transition ${N?"opacity-40 hover:opacity-70":"bg-white/[0.035] opacity-100 hover:bg-white/[0.06]"}`,onClick:$=>{$.stopPropagation(),v(T)},onPointerDown:$=>$.stopPropagation(),children:[b.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{backgroundColor:P}}),b.jsx(fs,{symbol:T,size:14}),b.jsx("span",{className:"truncate font-semibold text-white/75",children:Xr(T)}),b.jsxs("span",{className:"tabular-nums text-white/85",children:[C!==void 0?cs(C):"…",B!==void 0?b.jsx("span",{className:"ml-1 tabular-nums",style:{color:ka(B)},children:ho(B)}):null]})]},T)})}),b.jsx("div",{className:"min-h-0 flex-1 [&>div[style*='align-items']]:!hidden",children:b.jsx(Nw,{data:[],value:0,series:x,theme:"dark",window:S,grid:!0,loading:!_,scrub:!1,badge:!1,formatValue:e.normalize?mO:cs,padding:dO,seriesToggleCompact:t.length>4,style:{width:"100%",height:"100%"}})})]})}const pO={...ew,component:gO};tw.schema;function vO({config:e}){const{mids:t,isLoading:i}=Mm(e.symbols),{stats:r,isLoading:s}=Am(e.symbols),l=e.symbols.some(c=>{var f;return t[c]!==void 0||((f=r[c])==null?void 0:f.markPx)!==void 0});return(i||s)&&!l?b.jsx(ct,{loading:!0,children:"loading prices..."}):b.jsx("div",{className:"flex flex-col gap-1.5 overflow-auto",children:e.symbols.map(c=>{var d,g;const f=t[c]??((d=r[c])==null?void 0:d.markPx),h=(g=r[c])==null?void 0:g.changePct;return b.jsxs("div",{className:"body-sm grid grid-cols-[auto_minmax(0,1fr)_auto_auto] items-center gap-3",children:[b.jsx(fs,{symbol:c,size:18}),b.jsx("span",{className:"truncate font-semibold text-white",title:c,children:Xr(c)}),b.jsx("span",{className:"tabular-nums",children:f!==void 0?cs(f):"—"}),b.jsx("span",{className:"min-w-[64px] text-right tabular-nums",style:{color:h!==void 0?ka(h):void 0,opacity:h!==void 0?1:.4},children:h!==void 0?ho(h):"…"})]},c)})})}const yO={...tw,component:vO};aw.schema;function fu(e){return`${e.toFixed(2)}%`}function bO({label:e,value:t,meta:i}){return b.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-3 border-b border-white/[0.06] py-1.5 last:border-b-0",children:[b.jsxs("div",{className:"min-w-0",children:[b.jsx("div",{className:"body-sm text-normal truncate font-semibold",children:e}),b.jsx("div",{className:"caption text-soft truncate",children:i})]}),b.jsx("div",{className:"font-dmsans text-strong text-lg font-bold tabular-nums",children:fu(t)})]})}function xO({config:e}){var d,g;const{rates:t,isLoading:i}=Yz(),{rates:r,isLoading:s}=Fz();if(i&&s)return b.jsx(ct,{loading:!0,children:"loading official rates…"});if(!t.length&&!r.length)return b.jsx(ct,{children:"no rates data"});const l=t.slice(0,e.maxReferenceRates),c=r.slice(0,e.maxTreasuryRates),f=(d=l[0])==null?void 0:d.date,h=(g=c[0])==null?void 0:g.date;return b.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-3",children:[b.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[b.jsxs("div",{children:[b.jsx("div",{className:"caption text-soft uppercase",children:"official rates"}),b.jsx("div",{className:"body-sm text-normal",children:f?`as of ${f}`:"reference rates"})]}),b.jsx("div",{className:"caption text-soft text-right",children:"daily"})]}),b.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:l.map(v=>{const y=v.targetRateFrom!==void 0&&v.targetRateTo!==void 0?`target ${fu(v.targetRateFrom)}-${fu(v.targetRateTo)}`:v.volumeInBillions!==void 0?`$${v.volumeInBillions.toFixed(0)}B volume`:v.source;return b.jsx(bO,{label:v.label,value:v.rate,meta:y},v.code)})}),e.showTreasuryAverageRates&&c.length>0&&b.jsxs("div",{className:"border-t border-white/[0.08] pt-2",children:[b.jsxs("div",{className:"caption text-soft mb-1 flex justify-between",children:[b.jsx("span",{children:"Treasury average rates"}),b.jsx("span",{children:h})]}),b.jsx("div",{className:"grid grid-cols-2 gap-1.5",children:c.map(v=>b.jsxs("div",{className:"rounded bg-white/[0.04] px-2 py-1.5",children:[b.jsx("div",{className:"caption text-soft truncate",children:v.security}),b.jsx("div",{className:"body-sm text-strong font-bold tabular-nums",children:fu(v.rate)})]},`${v.date}-${v.security}`))})]})]})}const wO={...aw,component:xO};uw.schema;function mb(e){return e>=1e9?`${(e/1e9).toFixed(2)}B`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:`${Math.round(e)}`}const gb=(e=1)=>`hsl(var(--zf-accent-hue, 242) 85% 68% / ${e})`;function _O({symbol:e,entry:t}){const i=e.includes(":")?e:`xyz:${t.symbol}`,r=Math.max(0,Math.min(100,t.shortPct));return b.jsxs("div",{className:"flex min-w-0 items-center gap-3 border-b border-white/[0.06] py-2 last:border-b-0",children:[b.jsx(fs,{symbol:i,size:20}),b.jsxs("div",{className:"min-w-0 flex-1",children:[b.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[b.jsx("span",{className:"body-sm text-strong truncate font-semibold",children:t.symbol}),b.jsxs("span",{className:"font-dmsans text-strong text-sm font-bold tabular-nums",children:[r.toFixed(1),"%"]})]}),b.jsx("div",{className:"mt-1 h-1.5 w-full overflow-hidden rounded-full bg-white/[0.07]",children:b.jsx("div",{className:"h-full rounded-full",style:{width:`${r}%`,background:gb(.85),boxShadow:`0 0 8px ${gb(.5)}`}})}),b.jsxs("div",{className:"caption text-soft mt-1 tabular-nums",children:["short ",mb(t.shortVolume)," / ",mb(t.totalVolume)]})]})]})}function SO({config:e}){const{data:t,isLoading:i}=Xz(e.symbols),r=M.useMemo(()=>{const l=e.symbols.map(c=>({symbol:c,entry:t[c]})).filter(c=>!!c.entry);return l.sort((c,f)=>e.sort==="symbol"?c.entry.symbol.localeCompare(f.entry.symbol):e.sort==="volume"?f.entry.totalVolume-c.entry.totalVolume:f.entry.shortPct-c.entry.shortPct),l},[t,e.symbols,e.sort]);if(i)return b.jsx(ct,{loading:!0,children:"loading short volume…"});if(r.length===0)return b.jsx(ct,{children:"no FINRA short-volume data"});const s=r[0].entry.date;return b.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-3",children:[b.jsxs("div",{className:"flex items-start justify-between gap-3",children:[b.jsxs("div",{children:[b.jsx("div",{className:"caption text-soft uppercase",children:"short volume"}),b.jsx("div",{className:"body-sm text-normal",children:s?`FINRA · ${s}`:"FINRA"})]}),b.jsxs("div",{className:"caption text-soft text-right",children:["reported volume",b.jsx("br",{}),"not short interest"]})]}),b.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:r.map(({symbol:l,entry:c})=>b.jsx(_O,{symbol:l,entry:c},l))})]})}const TO={...uw,component:SO};nw.schema;const EO=["xyz:*","km:GOLD","km:SILVER","km:USOIL","km:USENERGY","km:US500","km:SMALL2000","km:USTECH","km:SEMI","km:GLDMINE"];function pb({symbol:e,markPx:t,changePct:i}){return b.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)_auto_auto] items-center gap-2",title:`${e} · ${cs(t)}`,children:[b.jsx(fs,{symbol:e,size:16}),b.jsx("span",{className:"body-sm truncate font-bold text-white",children:Xr(e)}),b.jsx("span",{className:"caption text-soft text-right tabular-nums",children:cs(t)}),b.jsx("span",{className:"caption text-right font-bold tabular-nums",style:{color:ka(i)},children:ho(i)})]})}function zO({config:e}){const{stats:t,isLoading:i}=Am(EO,6e4),{gainers:r,losers:s}=M.useMemo(()=>{const l=Object.entries(t).map(([c,f])=>({symbol:c,...f})).filter(c=>c.symbol.includes(":")&&c.markPx>0&&c.prevDayPx>0).sort((c,f)=>f.changePct-c.changePct);return{gainers:l.slice(0,e.count),losers:l.slice(-e.count).reverse()}},[t,e.count]);return i?b.jsx(ct,{loading:!0,children:"loading movers..."}):r.length===0?b.jsx(ct,{children:"no mover data yet"}):b.jsxs("div",{className:"grid h-full grid-cols-2 gap-x-4 overflow-hidden",children:[b.jsxs("div",{className:"flex flex-col gap-1.5",children:[b.jsx("div",{className:"caption text-soft uppercase tracking-wide",children:"gainers"}),r.map(l=>b.jsx(pb,{...l},l.symbol))]}),b.jsxs("div",{className:"flex flex-col gap-1.5",children:[b.jsx("div",{className:"caption text-soft uppercase tracking-wide",children:"losers"}),s.map(l=>b.jsx(pb,{...l},l.symbol))]})]})}const MO={...nw,component:zO};iw.schema;function CO({width:e,height:t,data:i}){if(e<48||t<30)return null;const r=e<70||t<44;return b.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center overflow-hidden p-1 text-center",title:`${i.id} · $${ls(i.tvl)}`,children:[b.jsx("span",{className:"body-sm truncate font-bold text-white",children:i.id}),!r&&b.jsxs("span",{className:"caption text-white/70",children:["$",ls(i.tvl)]})]})}function AO({config:e}){const{entries:t,isLoading:i}=Bz(),r=M.useMemo(()=>t.slice(0,e.topN).map(s=>({id:s.name,value:s.tvl,tvl:s.tvl})),[t,e.topN]);return i?b.jsx(ct,{loading:!0,children:"loading TVL…"}):r.length===0?b.jsx(ct,{children:"no TVL data"}):b.jsx(sC,{data:r,LeafComponent:CO,getColorValue:s=>s.tvl})}const NO={...iw,component:AO};lw.schema;const vb=(e=1)=>`hsl(var(--zf-accent-hue, 242) 85% 68% / ${e})`;function RO({rates:e}){const t=Math.min(...e),i=Math.max(...e),r=Math.max(.01,i-t),s=e.length,l=h=>100*h/(s-1),c=h=>4+32*(1-(h-t)/r),f=e.map((h,d)=>`${d?"L":"M"}${l(d).toFixed(2)},${c(h).toFixed(2)}`).join(" ");return b.jsxs("svg",{viewBox:"0 0 100 40",preserveAspectRatio:"none",className:"h-20 w-full","aria-hidden":!0,children:[b.jsx("path",{d:`${f} L100,40 L0,40 Z`,fill:vb(.14)}),b.jsx("path",{d:f,fill:"none",stroke:vb(.9),strokeWidth:1.5,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round"})]})}function kO({config:e}){const{curve:t,isLoading:i}=Pz();if(i)return b.jsx(ct,{loading:!0,children:"loading yield curve…"});if(!t||t.points.length<2)return b.jsx(ct,{children:"no yield-curve data"});const r=d=>{var g;return(g=t.points.find(v=>v.label===d))==null?void 0:g.rate},s=r("2Y"),l=r("10Y"),c=s!=null&&l!=null?Math.round((l-s)*100):null,f=c!=null&&c<0,h=e.maturities;return b.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-2",children:[b.jsxs("div",{className:"flex items-start justify-between gap-3",children:[b.jsxs("div",{children:[b.jsx("div",{className:"caption text-soft uppercase",children:"Treasury yield curve"}),b.jsxs("div",{className:"body-sm text-normal",children:["U.S. Treasury · ",t.date]})]}),b.jsx("div",{className:"caption text-soft text-right",children:"keyless · daily"})]}),c!=null&&b.jsxs("div",{className:"flex items-baseline gap-2",children:[b.jsxs("span",{className:"font-dmsans text-2xl font-bold leading-none tabular-nums",style:{color:ka(c),textShadow:`0 0 24px ${ka(c)}44`},children:[c>=0?"+":"",c," bps"]}),b.jsxs("span",{className:"caption text-soft",children:["2s10s · ",f?"inverted":"normal"]})]}),b.jsx(RO,{rates:t.points.map(d=>d.rate)}),b.jsx("div",{className:"grid gap-1",style:{gridTemplateColumns:`repeat(${h.length}, minmax(0, 1fr))`},children:h.map(d=>{const g=r(d);return b.jsxs("div",{className:"rounded bg-white/[0.04] px-1.5 py-1 text-center",children:[b.jsx("div",{className:"caption text-soft",children:d}),b.jsx("div",{className:"body-sm text-strong font-bold tabular-nums",children:g!=null?`${g.toFixed(2)}%`:"—"})]},d)})})]})}const DO={...lw,component:kO},OO=[OD,LD,HD,YD,WD,JD,s8,c8,h8,p8,y8,x8,S8,G8,F8,oO,uO,pO,yO,wO,TO,MO,NO,DO],jO=1e4,LO="zframes (+https://github.com/zentryhq/zframes)",UO="/__zframes/proxy";async function ea(e,t,{timeoutMs:i=jO,init:r,proxied:s}={}){const l=new Headers(r==null?void 0:r.headers);typeof document>"u"&&!l.has("User-Agent")&&l.set("User-Agent",LO);const c=s&&typeof document<"u"?`${UO}?url=${encodeURIComponent(e)}`:e,f=await fetch(c,{...r,headers:l,signal:(r==null?void 0:r.signal)??AbortSignal.timeout(i)});if(!f.ok)throw new Error(`${e} failed: ${f.status}`);const h=await f.json();return t?t.parse(h):h}const HO="https://api.alternative.me/fng/";class BO{constructor(){st(this,"name","alternative.me");st(this,"capabilities",["sentiment"])}async getFearGreed(t=30){const i=await ea(`${HO}?limit=${t}`);if(!Array.isArray(i==null?void 0:i.data))throw new Error("alternative.me fng: unexpected response shape");return i.data.map(r=>({value:Number(r.value),classification:r.value_classification??"",time:Number(r.timestamp)*1e3})).filter(r=>Number.isFinite(r.value)&&Number.isFinite(r.time))}}const $O="https://api.bls.gov/publicAPI/v2/timeseries/data/",GO={CUUR0000SA0:"CPI-U all items",LNS14000000:"Unemployment rate"};function YO(e){const t=Number(e);return Number.isFinite(t)?t:null}function FO(e,t){const i=/^M(0[1-9]|1[0-2])$/.exec(t??""),r=Number(e);if(!i||!Number.isFinite(r))return null;const s=Number(i[1]);return Date.UTC(r,s-1,1)}function PO(e){return new Intl.DateTimeFormat("en-US",{month:"short",year:"numeric",timeZone:"UTC"}).format(e)}const Dw="zframes:macro:",VO=360*6e4;function ZO(e){var t;try{if(typeof localStorage>"u")return null;const i=localStorage.getItem(Dw+e);if(!i)return null;const r=JSON.parse(i);return Array.isArray((t=r==null?void 0:r.series)==null?void 0:t.points)?r:null}catch{return null}}function IO(e,t){try{if(typeof localStorage>"u")return;localStorage.setItem(Dw+e,JSON.stringify({at:Date.now(),series:t}))}catch{}}class XO{constructor(){st(this,"name","bls");st(this,"capabilities",["macro-series"]);st(this,"macroInflight",new Map)}async getMacroSeries(t,i,r){const s=`${t}:${i}:${r}`,l=ZO(s);if(l&&Date.now()-l.at<VO)return l.series;const c=this.macroInflight.get(s);if(c)return c;const f=this.fetchMacroSeries(t,i,r).then(h=>(IO(s,h),h)).catch(h=>{if(l)return l.series;throw h}).finally(()=>{this.macroInflight.delete(s)});return this.macroInflight.set(s,f),f}async fetchMacroSeries(t,i,r){var h,d,g;const s=`${$O}${encodeURIComponent(t)}?startyear=${i}&endyear=${r}`,l=await ea(s);if(l.status!=="REQUEST_SUCCEEDED")throw new Error(`bls series ${t}: ${((h=l.message)==null?void 0:h.join(", "))||"request failed"}`);const c=(g=(d=l.Results)==null?void 0:d.series)==null?void 0:g[0];if(!(c!=null&&c.data))throw new Error("bls series: unexpected response shape");const f=c.data.map(v=>{const y=YO(v.value),x=FO(v.year,v.period);return y===null||x===null?null:{time:x,date:PO(x),value:y,period:`${v.year}-${v.period}`}}).filter(v=>v!==null).sort((v,y)=>v.time-y.time);return{seriesId:c.seriesID??t,label:GO[t]??t,source:"BLS",points:f}}}const qO="https://api.coingecko.com/api/v3/global",Ow="zframes:coingecko:global",WO=12*6e4;let io=null;function KO(){if(io)return io;try{if(typeof localStorage<"u"){const e=localStorage.getItem(Ow);if(e)return io=JSON.parse(e),io}}catch{}return null}function QO(e){io={at:Date.now(),value:e};try{typeof localStorage<"u"&&localStorage.setItem(Ow,JSON.stringify(io))}catch{}}class JO{constructor(){st(this,"name","coingecko");st(this,"capabilities",["global-market"])}async getGlobalMarket(){var i;const t=KO();if(t&&Date.now()-t.at<WO)return t.value;try{const r=await ea(qO);if(!((i=r==null?void 0:r.data)!=null&&i.total_market_cap)||!r.data.market_cap_percentage)throw new Error("coingecko global: unexpected response shape");const s=Number(r.data.market_cap_change_percentage_24h_usd),l={totalMarketCapUsd:r.data.total_market_cap.usd??0,marketCapChangePct24h:Number.isFinite(s)?s:0,dominance:r.data.market_cap_percentage};return QO(l),l}catch(r){if(t)return t.value;throw r}}}const ej="https://api.llama.fi/v2/chains";class tj{constructor(){st(this,"name","defillama");st(this,"capabilities",["tvl"])}async getTvlByChain(){const t=await ea(ej);if(!Array.isArray(t))throw new Error("defillama chains: unexpected response shape");return t.filter(i=>Number.isFinite(i.tvl)&&i.tvl>0).sort((i,r)=>r.tvl-i.tvl).map(i=>({name:i.name,tvl:i.tvl}))}}const nj=e=>`https://cdn.finra.org/equity/regsho/daily/CNMSshvol${e}.txt`,ij="zframes (+https://github.com/zentryhq/zframes)",rj=7,aj=60*6e4;function sj(e){const t=e.indexOf(":");return t===-1?e:e.slice(t+1)}function oj(e){return`${e.getUTCFullYear()}${String(e.getUTCMonth()+1).padStart(2,"0")}${String(e.getUTCDate()).padStart(2,"0")}`}async function lj(e,t=15e3){const i=new Headers;typeof document>"u"&&i.set("User-Agent",ij);const r=await fetch(e,{headers:i,signal:AbortSignal.timeout(t)});if(!r.ok)throw new Error(`${e} failed: ${r.status}`);return r.text()}function cj(e){const t=e.split(/\r?\n/),i=new Map;let r="";for(let s=1;s<t.length;s++){const l=t[s].split("|");if(l.length<5)continue;const[c,f,h,d,g]=l;if(!f)continue;const v=Number(h),y=Number(g);!Number.isFinite(v)||!Number.isFinite(y)||(!r&&/^\d{8}$/.test(c)&&(r=`${c.slice(0,4)}-${c.slice(4,6)}-${c.slice(6,8)}`),i.set(f.toUpperCase(),{date:r||c,symbol:f,shortVolume:v,shortExemptVolume:Number(d)||0,totalVolume:y,shortPct:y>0?v/y*100:0}))}if(i.size===0)throw new Error("finra: empty or unparseable short-volume file");return{date:r,bySymbol:i}}class uj{constructor(){st(this,"name","finra");st(this,"capabilities",["short-volume"]);st(this,"cache")}async getShortVolume(t){const i=await this.loadReport(),r={};for(const s of t){const l=i.bySymbol.get(sj(s).toUpperCase());l&&(r[s]=l)}return r}loadReport(){const t=Date.now();if(this.cache&&t-this.cache.at<aj)return this.cache.promise;const i=this.fetchLatest().catch(r=>{throw this.cache=void 0,r});return this.cache={at:t,promise:i},i}async fetchLatest(){const t=Date.now();for(let i=0;i<=rj;i++){const r=new Date(t-i*864e5);try{return cj(await lj(nj(oj(r))))}catch{}}throw new Error("finra: no recent short-volume file found")}}const fj="wss://api.hyperliquid.xyz/ws",dj="https://api.hyperliquid.xyz/info",yb=e=>e.includes(":")?e.split(":")[0]:"";async function Oh(e){return ea(dj,void 0,{init:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}})}class hj{constructor(){st(this,"name","hyperliquid");st(this,"capabilities",["quote-stream","day-stats","funding-history","ohlcv"]);st(this,"ws",null);st(this,"listeners",new Set);st(this,"reconnectTimer",null);st(this,"closedByUser",!1);st(this,"wantedDexes",new Set([""]));st(this,"subscribedDexes",new Set);st(this,"mergedMids",{})}subscribeMids(t,i){this.listeners.add(t);for(const r of i??[])this.wantedDexes.add(yb(r));return this.ensureSocket(),this.subscribeMissingDexes(),()=>{this.listeners.delete(t),this.listeners.size===0&&this.teardown()}}async getDayStats(t){const i=new Set,r=new Set;if(!t)i.add("");else for(const c of t)c.endsWith(":*")?i.add(c.slice(0,-2)):r.add(c);const s=new Set(i);for(const c of r)s.add(yb(c));const l={};return await Promise.all([...s].map(async c=>{const f={type:"metaAndAssetCtxs"};c&&(f.dex=c);const[h,d]=await Oh(f),g=i.has(c);h.universe.forEach((v,y)=>{if(!g&&!r.has(v.name))return;const x=d[y];if(!x)return;const S=Number(x.markPx),_=Number(x.prevDayPx);!Number.isFinite(S)||!Number.isFinite(_)||(l[v.name]={markPx:S,prevDayPx:_,changePct:_?(S-_)/_*100:0})})})),l}async getFundingHistory(t,i){const r=await Promise.all(t.map(async s=>{const c=(await Oh({type:"fundingHistory",coin:s,startTime:i})).map(f=>({time:f.time,fundingRate:Number(f.fundingRate)})).filter(f=>Number.isFinite(f.fundingRate)&&Number.isFinite(f.time));return[s,c]}));return Object.fromEntries(r)}async getCandles(t,i,r){return(await Oh({type:"candleSnapshot",req:{coin:t,interval:i,startTime:r}})).map(l=>({time:l.t,open:Number(l.o),high:Number(l.h),low:Number(l.l),close:Number(l.c),volume:Number(l.v)}))}ensureSocket(){if(this.ws)return;this.closedByUser=!1,this.subscribedDexes=new Set;const t=new WebSocket(fj);this.ws=t,t.onopen=()=>{this.subscribeMissingDexes()},t.onmessage=i=>{var s;let r;try{r=JSON.parse(String(i.data))}catch{return}if(!(r.channel!=="allMids"||!((s=r.data)!=null&&s.mids))){for(const[l,c]of Object.entries(r.data.mids))this.mergedMids[l]=Number(c);for(const l of this.listeners)l(this.mergedMids)}},t.onclose=()=>{this.ws=null,!this.closedByUser&&this.listeners.size>0&&(this.reconnectTimer=setTimeout(()=>this.ensureSocket(),2e3))}}subscribeMissingDexes(){const t=this.ws;if(!(!t||t.readyState!==WebSocket.OPEN))for(const i of this.wantedDexes){if(this.subscribedDexes.has(i))continue;const r={type:"allMids"};i&&(r.dex=i),t.send(JSON.stringify({method:"subscribe",subscription:r})),this.subscribedDexes.add(i)}}teardown(){var t;this.closedByUser=!0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),(t=this.ws)==null||t.close(),this.ws=null,this.subscribedDexes=new Set,this.mergedMids={}}}const mj="https://markets.newyorkfed.org/api/rates/all/latest.json",gj={SOFR:"SOFR",SOFRAI:"SOFR averages",EFFR:"Effective fed funds",OBFR:"Overnight bank funding",TGCR:"Tri-party repo",BGCR:"Broad general collateral"},bb=["EFFR","SOFR","TGCR","BGCR","OBFR","SOFRAI"];function ts(e){const t=Number(e);return Number.isFinite(t)?t:null}function pj(e,t){const i=bb.indexOf(e.code),r=bb.indexOf(t.code);return(i===-1?99:i)-(r===-1?99:r)}class vj{constructor(){st(this,"name","nyfed");st(this,"capabilities",["reference-rates"])}async getReferenceRates(){const t=await ea(mj);if(!Array.isArray(t==null?void 0:t.refRates))throw new Error("ny fed rates: unexpected response shape");return t.refRates.map(i=>{const r=String(i.type??""),s=ts(i.percentRate??i.average30day);if(!r||!i.effectiveDate||s===null)return null;const l={code:r,label:gj[r]??r,date:i.effectiveDate,rate:s,source:"New York Fed"},c=ts(i.volumeInBillions),f=ts(i.targetRateFrom),h=ts(i.targetRateTo),d=ts(i.average30day),g=ts(i.average90day),v=ts(i.average180day);return c!==null&&(l.volumeInBillions=c),f!==null&&(l.targetRateFrom=f),h!==null&&(l.targetRateTo=h),d!==null&&(l.average30Day=d),g!==null&&(l.average90Day=g),v!==null&&(l.average180Day=v),l}).filter(i=>i!==null).sort(pj)}}const yj={A:1090872,AAPL:320193,ABBV:1551152,ABEV:1565025,ABNB:1559720,ABT:1800,ACGL:947484,ACN:1467373,ADBE:796343,ADI:6281,ADM:7084,ADP:8670,ADSK:769397,AEE:1002910,AEM:2809,AEP:4904,AFL:4977,AIG:5272,AJG:354190,ALAB:1736297,ALC:1167379,ALL:899051,ALNY:1178670,AMAT:6951,AMD:2488,AME:1037868,AMGN:318154,AMP:820027,AMRZ:2035989,AMT:1053507,AMX:1129137,AMZN:1018724,ANET:1596532,AON:315293,APD:2969,APH:820313,APO:1858681,APP:1751008,ARES:1176948,ARGX:1697862,ARM:1973239,ASML:937966,ASTS:1780312,ASX:1122411,ATEYY:1158838,ATO:731802,AU:1973832,AVGO:1730168,AXON:1069183,AXP:4962,AZN:901832,AZO:866787,B:756894,BA:12927,BABA:1577552,BAC:70858,BAESY:895564,BAM:1937926,BBD:1160330,BBVA:842180,BCS:312069,BDX:10795,BE:1664703,BHP:811809,BIDU:1329099,BIIB:875045,BKNG:1075531,BKR:1701605,BLK:2012383,BMO:927971,BMWKY:1446250,BMY:14272,BN:1001085,BNS:9631,BNY:1390777,BP:313807,"BRK-A":1067983,"BRK-B":1067983,BSBR:1471055,BSX:885725,BTI:1303523,BUD:1668717,BX:1393818,C:831001,CAH:721371,CARR:1783180,CAT:18230,CB:896159,CBOE:1374310,CBRE:1138118,CBRS:2021728,CCEP:1650107,CCI:1051470,CCJ:1009001,CCL:815097,CDNS:813672,CEG:1868275,CHT:1132924,CI:1739940,CIEN:936395,CKHGF:1469059,CL:21665,CLS:1030894,CM:1045520,CMCSA:1166691,CME:1156375,CMG:1058090,CMI:26172,CNC:1071739,CNI:16868,CNQ:1017413,COF:927628,COHR:820318,COIN:1679788,COP:1163165,COR:1140859,COST:909832,CP:16875,CPRT:900075,CQP:1383650,CRDO:1807794,CRH:849395,CRM:1108524,CRWD:1535527,CRWV:1769628,CSCO:858877,CSLLY:1274152,CSX:277948,CTAS:723254,CTVA:1755672,CVE:1475260,CVNA:1690820,CVS:64803,CVX:93410,CYATY:2070829,D:715957,DAL:27904,DASH:1792789,DB:1159508,DDOG:1561550,DE:315189,DELL:1571996,DEO:835403,DHI:882184,DHR:313616,DIA:1041130,DIS:1744489,DLMAY:2073893,DLR:1297996,DOV:29905,DTE:936340,DTEGY:946770,DUK:1326160,DVN:1090012,E:1002242,EA:712515,EBAY:1065088,EC:1444406,ECL:31462,ED:1047862,EIX:827052,EL:1001250,ELV:1156039,EME:105634,EMR:32604,ENB:895728,EOG:821189,EONGY:1136808,EPD:1061219,EQIX:1101239,EQNR:1140625,EQT:33213,ERIC:717826,ESLT:1027664,ET:1276187,ETN:1551182,ETR:65984,EW:1099800,EXC:1109357,EXR:1289490,F:37996,FANG:1539838,FAST:815556,FCX:831259,FDX:1048911,FER:1468522,FERG:2011641,FISV:798354,FITB:35527,FIX:1035983,FLEX:866374,FMX:1061736,FNV:1456346,FOX:1754301,FOXA:1754301,FRFHF:915191,FSLR:1274494,FTNT:1262039,FTS:1666175,GALDY:2021390,GD:40533,GE:40545,GEHC:1932393,GEV:1996810,GFI:1172724,GFS:1709048,GILD:882095,GLD:1222333,GLW:24741,GM:1467858,GOOG:1652044,GOOGL:1652044,GRMN:1121788,GS:886982,GSK:1131399,GWLIF:850918,GWW:277135,HAL:45012,HBAN:49196,HCA:860730,HD:354950,HDB:1144967,HEI:46619,HIG:874766,HLN:1900304,HLT:1585689,HMC:715153,HON:773840,HOOD:1783879,HPE:1645590,HSBC:1089113,HSY:47111,HTHIY:47710,HUM:49071,HWM:4281,IBKR:1381197,IBM:51143,IBN:1103838,ICE:1571949,IDXX:874716,IFNNY:1107457,IMO:49938,INFY:1067491,ING:1039765,INTC:50863,INTU:896878,IQV:1478242,IR:1699150,IRM:1020569,ISRG:1035267,ITUB:1132597,ITW:49826,IX:1070304,JBL:898293,JCI:833444,JD:1549802,JHPCY:2071868,JNJ:200406,JPM:19617,KB:1445930,KBGGY:1535759,KDP:1418135,KEYS:1601046,KGC:701818,KKR:1404912,KLAC:319201,KMB:55785,KMI:1506307,KO:21344,KR:56873,KVUE:1944048,KXIAY:2053383,LHX:202058,LIN:1707925,LITE:1633978,LLY:59478,LMT:936468,LNG:3570,LOW:60667,LRCX:707549,LSEGY:1842726,LVS:1300514,LYG:1160106,LYV:1335258,MA:1141391,MAR:1048286,MCD:63908,MCHP:827054,MCK:927653,MCO:1059556,MDLN:2046386,MDLZ:1103982,MDT:1613103,MELI:1099590,MET:1099219,META:1326801,MFC:1086888,MFG:1335730,MGCLY:2039784,MLM:916076,MMM:66740,MNST:865752,MO:764180,MPC:1510295,MPLX:1552e3,MPWR:1280452,MRK:310158,MRSH:62709,MRVL:1835632,MS:895421,MSCI:1408198,MSFT:789019,MSI:68505,MSTR:1050446,MT:1243429,MTB:36270,MTZ:15615,MU:723125,MUFG:67088,NBIS:1513845,NDAQ:1120193,NEE:753308,NEM:1164727,NET:1477333,NFLX:1065280,NGG:1004315,NKE:320187,NOC:1133421,NOK:924613,NOW:1373715,NSC:702165,NTAP:1002047,NTES:1110646,NTR:1725964,NTRA:1604821,NTRS:73124,NU:1691493,NUE:73309,NVDA:1045810,NVO:353278,NVS:1114448,NWG:844150,NWS:1564708,NWSA:1564708,NXPI:1413447,O:726728,ODFL:878927,OKE:1039684,ON:1097864,ORCL:1341439,ORLY:898173,OXY:797468,PANW:1327567,PAYX:723531,PBA:1546066,PBR:1119639,PCAR:75362,PCG:1004980,PDD:1737806,PEG:788784,PEP:77476,PFE:78003,PG:80424,PGR:80661,PH:76334,PLD:1045609,PLTR:1321655,PM:1413329,PNC:713676,PRU:1137774,PSA:1393311,PSX:1534701,PUK:1116578,PWR:1050915,PYPL:1633917,Q:2058873,QCOM:804328,QQQ:1067839,QSR:1618756,RACE:1648416,RBLX:1315098,RCL:884887,RDDT:1713445,REGN:872589,RELX:929869,RIO:863064,RJF:720005,RKLB:1819994,RKT:1805284,RMD:943819,ROK:1024478,ROP:882835,ROST:745732,RPRX:1802768,RSG:1060391,RSHGY:1447391,RTNTF:887028,RTX:101829,RVMD:1628171,RY:1000275,RYAAY:1038683,SAN:891478,SAP:1000184,SATS:1415404,SBUX:829224,SCCO:1001838,SCHW:316709,SCMWY:1069336,SE:1703399,SHEL:1306965,SHG:1263043,SHOP:1594805,SHW:89800,SLB:87347,SLF:1097362,SLV:1330568,SMERY:1830056,SMFG:1022837,SNDK:2023554,SNHIY:2098326,SNOW:1640147,SNPS:883241,SNY:1121404,SO:92122,SONY:313838,SPG:1063761,SPGI:64040,SPOT:1639920,SPY:884394,SRE:1032208,STLD:1022671,STM:932787,STT:93751,STX:1137789,SU:311337,SUNB:2083785,SYK:310764,SYY:96021,T:732717,TAK:1395064,TCOM:1269238,TD:947263,TDG:1260221,TECK:886986,TEL:1385157,TER:97210,TEVA:818686,TFC:92230,TGT:27419,TJX:109198,TKO:1973266,TM:1094517,TMO:97745,TMUS:1283699,TPR:1116132,TRGP:1389170,TRI:1075124,TRMOY:2071881,TRP:1232384,TRV:86312,TS:1190723,TSLA:1318605,TT:1466258,TTE:879764,TTWO:946581,TWLO:1447669,TXN:97476,TYHOY:2018139,UA:1336917,UAA:1336917,UAL:100517,UBER:1543151,UBS:1610520,UI:1511737,UL:217410,UMC:1033767,UNH:731766,UNP:100885,UPS:1090727,URI:1067701,USB:36104,V:1403161,VALE:917851,VG:2007855,VICI:1705696,VIK:1745201,VLO:1035002,VMC:1396009,VOD:839923,VRT:1674101,VRTX:875320,VST:1692819,VTR:740260,VZ:732712,WAB:943452,WAT:1000697,WBD:1437107,WCN:1318220,WDAY:1327811,WDC:106040,WEC:783325,WELL:766704,WFC:72971,WM:823768,WMB:107263,WMT:104169,WPM:1323404,XEL:72903,XOM:34088,XYZ:1512673,YUM:1041061,ZM:1585521,ZTS:1555280};function mm(e){return String(e).replace(/\D/g,"").padStart(10,"0")}function xb(e){const t=e.trim(),i=/^cik[-\s]?(\d{1,10})$/i.exec(t)??/^(\d{1,10})$/.exec(t);if(i)return i[1].padStart(10,"0");const r=(t.includes(":")?t.slice(t.lastIndexOf(":")+1):t).toUpperCase().replace(/[^A-Z0-9.-]/g,""),s=yj[r];return s===void 0?null:mm(s)}const bj=e=>`https://data.sec.gov/submissions/CIK${e}.json`,xj=e=>`https://data.sec.gov/api/xbrl/companyfacts/CIK${e}.json`,wb=15*6e4;function wj(e,t,i){const r=String(Number(e)),s=t.replace(/-/g,""),l=`https://www.sec.gov/Archives/edgar/data/${r}/${s}`;return i?`${l}/${i}`:`${l}/`}const _j=[{label:"Revenue",unit:"USD",taxonomy:"us-gaap",kind:"flow",concepts:["RevenueFromContractWithCustomerExcludingAssessedTax","Revenues","SalesRevenueNet"]},{label:"Net income",unit:"USD",taxonomy:"us-gaap",kind:"flow",concepts:["NetIncomeLoss"]},{label:"Total assets",unit:"USD",taxonomy:"us-gaap",kind:"instant",concepts:["Assets"]},{label:"Shareholders' equity",unit:"USD",taxonomy:"us-gaap",kind:"instant",concepts:["StockholdersEquity"]},{label:"Diluted EPS",unit:"USD/shares",taxonomy:"us-gaap",kind:"flow",concepts:["EarningsPerShareDiluted","EarningsPerShareBasic"]},{label:"Shares outstanding",unit:"shares",taxonomy:"dei",kind:"instant",concepts:["EntityCommonStockSharesOutstanding"]}];function Sj(e){return e.fy?e.fp==="FY"?`FY${e.fy}`:`${e.fp??""} ${e.fy}`.trim():e.end??""}function Tj(e,t){const i=e.filter(s=>s.end&&s.form&&Number.isFinite(s.val));return(t==="flow"&&i.some(s=>s.fp==="FY")?i.filter(s=>s.fp==="FY"):i).reduce((s,l)=>!s||l.end>s.end?l:s,null)}function Ej(e){var i,r;if(!e)return[];const t=[];for(const s of _j){const l=e[s.taxonomy];if(!l)continue;let c=null;for(const f of s.concepts){const h=(r=(i=l[f])==null?void 0:i.units)==null?void 0:r[s.unit];if(!(h!=null&&h.length))continue;const d=Tj(h,s.kind);d&&(!c||d.end>c.end)&&(c=d)}c&&t.push({label:s.label,value:c.val,unit:s.unit,end:c.end,fiscalPeriod:Sj(c),form:c.form})}return t}class zj{constructor(t){st(this,"name","sec");st(this,"capabilities",["filings","fundamentals"]);st(this,"cache",new Map);st(this,"factsCache",new Map);this.contact=t}nodeInit(){return this.contact&&typeof document>"u"?{init:{headers:{"User-Agent":`zframes (${this.contact})`}}}:void 0}async getCompanyFacts(t){const i=xb(t);if(!i)throw new Error(`sec: unknown ticker "${t}" — not in the bundled map; pass a CIK (e.g. "320193") instead`);const r=Date.now(),s=this.factsCache.get(i);if(s&&r-s.at<wb)return s.promise;const l=this.fetchCompanyFacts(i).catch(c=>{throw this.factsCache.delete(i),c});return this.factsCache.set(i,{at:r,promise:l}),l}async fetchCompanyFacts(t){const i=await ea(xj(t),void 0,{proxied:!0,...this.nodeInit()}),r=Ej(i.facts);if(r.length===0)throw new Error("sec companyfacts: no headline metrics found");return{cik:mm(i.cik??t),entityName:i.entityName??"",metrics:r}}async getCompanyFilings(t){const i=xb(t);if(!i)throw new Error(`sec: unknown ticker "${t}" — not in the bundled map; pass a CIK (e.g. "320193") instead`);const r=Date.now(),s=this.cache.get(i);if(s&&r-s.at<wb)return s.promise;const l=this.fetchFilings(i).catch(c=>{throw this.cache.delete(i),c});return this.cache.set(i,{at:r,promise:l}),l}async fetchFilings(t){var c,f,h,d,g,v,y;const i=await ea(bj(t),void 0,this.nodeInit()),r=(c=i.filings)==null?void 0:c.recent;if(!r||!Array.isArray(r.accessionNumber))throw new Error("sec submissions: unexpected response shape");const s=r.accessionNumber.length,l=[];for(let x=0;x<s;x++){const S=r.accessionNumber[x],_=(f=r.form)==null?void 0:f[x],T=(h=r.filingDate)==null?void 0:h[x];if(!S||!_||!T)continue;const E=(d=r.reportDate)==null?void 0:d[x],C=(g=r.primaryDocDescription)==null?void 0:g[x],k=(v=r.items)==null?void 0:v[x];l.push({form:_,filingDate:T,accessionNumber:S,url:wj(t,S,(y=r.primaryDocument)==null?void 0:y[x]),...E?{reportDate:E}:{},...C?{description:C}:{},...k?{items:k}:{}})}return{cik:mm(i.cik??t),name:i.name??"",tickers:i.tickers??[],exchanges:i.exchanges??[],filings:l,...i.sic?{sic:i.sic}:{},...i.sicDescription?{sicDescription:i.sicDescription}:{},...i.category?{category:i.category}:{},...i.fiscalYearEnd?{fiscalYearEnd:i.fiscalYearEnd}:{}}}}const Mj="https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/avg_interest_rates?sort=-record_date&page%5Bsize%5D=20&format=json",Cj=e=>`https://home.treasury.gov/resource-center/data-chart-center/interest-rates/pages/xml?data=daily_treasury_yield_curve&field_tdr_date_value_month=${e}`,Aj="zframes (+https://github.com/zentryhq/zframes)",Nj=[["BC_1MONTH","1M",1],["BC_2MONTH","2M",2],["BC_3MONTH","3M",3],["BC_4MONTH","4M",4],["BC_6MONTH","6M",6],["BC_1YEAR","1Y",12],["BC_2YEAR","2Y",24],["BC_3YEAR","3Y",36],["BC_5YEAR","5Y",60],["BC_7YEAR","7Y",84],["BC_10YEAR","10Y",120],["BC_20YEAR","20Y",240],["BC_30YEAR","30Y",360]];function Rj(e){const t=Number(e);return Number.isFinite(t)?t:null}async function kj(e,t=15e3){const i=new Headers;typeof document>"u"&&i.set("User-Agent",Aj);const r=await fetch(e,{headers:i,signal:AbortSignal.timeout(t)});if(!r.ok)throw new Error(`${e} failed: ${r.status}`);return r.text()}function Dj(e){return`${e.getUTCFullYear()}${String(e.getUTCMonth()+1).padStart(2,"0")}`}function Oj(e){const t=e.match(/<m:properties>[\s\S]*?<\/m:properties>/g);if(!(t!=null&&t.length))return null;let i=null;for(const s of t){const l=/<d:NEW_DATE[^>]*>([^<]+)<\/d:NEW_DATE>/.exec(s);if(!l)continue;const c=l[1].slice(0,10);(!i||c>i.date)&&(i={date:c,raw:s})}if(!i)return null;const r=[];for(const[s,l,c]of Nj){const f=new RegExp(`<d:${s}[^>]*>([^<]*)</d:${s}>`).exec(i.raw),h=f?Number(f[1]):NaN;Number.isFinite(h)&&r.push({label:l,months:c,rate:h})}return r.length?{date:i.date,points:r}:null}class jj{constructor(){st(this,"name","treasury");st(this,"capabilities",["treasury-rates","yield-curve"])}async getYieldCurve(){const t=new Date;for(let i=0;i<=1;i++){const r=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()-i,1)),s=await kj(Cj(Dj(r))).catch(()=>""),l=Oj(s);if(l)return l}throw new Error("treasury yield curve: no recent data")}async getTreasuryAverageRates(){var r;const t=await ea(Mj);if(!Array.isArray(t==null?void 0:t.data))throw new Error("treasury average rates: unexpected response shape");const i=(r=t.data.find(s=>s.record_date))==null?void 0:r.record_date;return i?t.data.filter(s=>s.record_date===i).map(s=>{const l=Rj(s.avg_interest_rate_amt);return l===null||!s.security_type_desc||!s.security_desc?null:{date:i,securityType:s.security_type_desc,security:s.security_desc,rate:l}}).filter(s=>s!==null):[]}}const Lj="modulepreload",Uj=function(e){return"/"+e},_b={},Hj=function(t,i,r){let s=Promise.resolve();if(i&&i.length>0){let c=function(d){return Promise.all(d.map(g=>Promise.resolve(g).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),h=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));s=c(i.map(d=>{if(d=Uj(d),d in _b)return;_b[d]=!0;const g=d.endsWith(".css"),v=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${v}`))return;const y=document.createElement("link");if(y.rel=g?"stylesheet":Lj,g||(y.as="script"),y.crossOrigin="",y.href=d,h&&y.setAttribute("nonce",h),document.head.appendChild(y),g)return new Promise((x,S)=>{y.addEventListener("load",x),y.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${d}`)))})}))}function l(c){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=c,window.dispatchEvent(f),!f.defaultPrevented)throw c}return s.then(c=>{for(const f of c||[])f.status==="rejected"&&l(f.reason);return t().catch(l)})},Bj=M.lazy(()=>Hj(()=>import("./index-A5M9erCx.js"),[])),$j="/unicornStudio.umd.mjs";function Gj({background:e}){return e.type!=="unicorn"||!e.projectId?null:b.jsx("div",{"aria-hidden":!0,style:{position:"fixed",inset:0,zIndex:0,overflow:"hidden",pointerEvents:"none"},children:b.jsx("div",{style:{position:"absolute",inset:0,opacity:e.opacity},children:b.jsx(M.Suspense,{fallback:null,children:b.jsx(Bj,{projectId:e.projectId,width:"100vw",height:"100vh",scale:e.scale,dpi:e.dpi,sdkUrl:$j})})})})}const Yj=["xyz:*"],Fj=200,Pj="#3fd08f",Vj="#ff6b81";function Zj(e){return e>=1e3?`$${e.toLocaleString("en-US",{maximumFractionDigits:0})}`:e>=1?`$${e.toLocaleString("en-US",{maximumFractionDigits:2})}`:`$${e.toPrecision(4)}`}const Ij=`
493
+ .zf-tape {
494
+ position: fixed;
495
+ left: 0;
496
+ right: 0;
497
+ bottom: 0;
498
+ z-index: 30;
499
+ height: 36px;
500
+ display: flex;
501
+ align-items: center;
502
+ overflow: hidden;
503
+ background: rgba(10, 11, 17, 0.86);
504
+ backdrop-filter: blur(10px);
505
+ -webkit-backdrop-filter: blur(10px);
506
+ border-top: 1px solid rgba(255, 255, 255, 0.08);
507
+ font-family: var(--font-dmsans, system-ui, sans-serif);
508
+ -webkit-mask-image: linear-gradient(90deg, transparent, #000 2.5%, #000 97.5%, transparent);
509
+ mask-image: linear-gradient(90deg, transparent, #000 2.5%, #000 97.5%, transparent);
510
+ }
511
+ .zf-tape-track {
512
+ display: flex;
513
+ flex-shrink: 0;
514
+ align-items: center;
515
+ white-space: nowrap;
516
+ will-change: transform;
517
+ animation-name: zf-tape-scroll;
518
+ animation-timing-function: linear;
519
+ animation-iteration-count: infinite;
520
+ }
521
+ .zf-tape:hover .zf-tape-track { animation-play-state: paused; }
522
+ .zf-tape-item {
523
+ display: inline-flex;
524
+ align-items: center;
525
+ gap: 7px;
526
+ padding: 0 15px;
527
+ border-right: 1px solid rgba(255, 255, 255, 0.06);
528
+ font-size: 12px;
529
+ line-height: 1;
530
+ }
531
+ .zf-tape-sym { font-weight: 700; color: rgba(255, 255, 255, 0.92); letter-spacing: 0.02em; }
532
+ .zf-tape-px { color: rgba(255, 255, 255, 0.58); font-variant-numeric: tabular-nums; }
533
+ .zf-tape-chg { font-weight: 600; font-variant-numeric: tabular-nums; }
534
+ @keyframes zf-tape-scroll {
535
+ from { transform: translateX(0); }
536
+ to { transform: translateX(-50%); }
537
+ }
538
+ @media (prefers-reduced-motion: reduce) {
539
+ .zf-tape { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
540
+ .zf-tape-track { animation: none; }
541
+ }
542
+ `;function Xj(){const e=Bh(Yj,6e4),t=Bh(void 0,6e4),{symbols:i,stats:r}=M.useMemo(()=>{const f=d=>Object.entries(d).filter(([,g])=>g.markPx>0&&g.prevDayPx>0).map(([g])=>g).sort();return{symbols:[...f(e),...f(t)].slice(0,Fj),stats:{...t,...e}}},[e,t]),s=Cm(i);if(i.length===0)return null;const l=Math.max(40,i.length*2.2),c=f=>i.map(h=>{const d=r[h];if(!d)return null;const g=s[h]??d.markPx,v=d.changePct>=0?Pj:Vj,y=d.changePct>=0?"+":"";return b.jsxs("span",{className:"zf-tape-item",children:[b.jsx(fs,{symbol:h,size:15}),b.jsx("span",{className:"zf-tape-sym",children:Xr(h)}),b.jsx("span",{className:"zf-tape-px",children:Zj(g)}),b.jsxs("span",{className:"zf-tape-chg",style:{color:v},children:[y,d.changePct.toFixed(2),"%"]})]},`${f}-${h}`)});return b.jsxs(b.Fragment,{children:[b.jsx("style",{children:Ij}),b.jsx("div",{className:"zf-tape","aria-label":"live ticker tape",children:b.jsxs("div",{className:"zf-tape-track",style:{animationDuration:`${l}s`},children:[c("a"),b.jsx("span",{"aria-hidden":!0,style:{display:"contents"},children:c("b")})]})})]})}const Sb="(max-width: 640px)";function qj(){const[e,t]=M.useState(()=>window.matchMedia(Sb).matches);return M.useEffect(()=>{const i=window.matchMedia(Sb),r=()=>t(i.matches);return i.addEventListener("change",r),()=>i.removeEventListener("change",r)},[]),e}const Wj="/unicornStudio.legacy.umd.mjs";let Ws=null;function Kj(){return typeof window>"u"||typeof document>"u"?Promise.reject(new Error("UnicornStudio needs a browser")):Ws||(Ws=(async()=>{const t=`const module={exports:{}};const exports=module.exports;
543
+ `+await fetch(Wj).then(r=>{if(!r.ok)throw new Error(`failed to load UnicornStudio (${r.status})`);return r.text()})+`
544
+ export default module.exports;`,i=URL.createObjectURL(new Blob([t],{type:"text/javascript"}));try{const s=(await import(i)).default;if(!(s!=null&&s.addScene))throw new Error("UnicornStudio engine missing addScene");return s}finally{URL.revokeObjectURL(i)}})(),Ws.catch(()=>{Ws=null}),Ws)}class Qj{constructor(t){st(this,"_url");this._raw=t;const i=URL.createObjectURL(new Blob([JSON.stringify(this._raw)],{type:"application/json"}));this._url=i}get url(){return this._url}}const Tb=new Qj({history:[{breakpoints:[],visible:!0,aspectRatio:1,userDownsample:1,layerType:"effect",type:"gradient",usesPingPong:!1,speed:.25,trackMouse:0,mouseMomentum:0,texture:!1,animating:!1,isMask:0,compiledFragmentShaders:[`#version 300 es
545
+ precision highp float;in vec2 vTextureCoord;uniform vec2 uMousePos;vec3 getColor(int index) { switch(index) { case 0: return vec3(1, 1, 1); case 1: return vec3(0, 0, 0); case 2: return vec3(0, 0, 0); case 3: return vec3(0, 0, 0); case 4: return vec3(0, 0, 0); case 5: return vec3(0, 0, 0); case 6: return vec3(0, 0, 0); case 7: return vec3(0, 0, 0); case 8: return vec3(0, 0, 0); case 9: return vec3(0, 0, 0); case 10: return vec3(0, 0, 0); case 11: return vec3(0, 0, 0); case 12: return vec3(0, 0, 0); case 13: return vec3(0, 0, 0); case 14: return vec3(0, 0, 0); case 15: return vec3(0, 0, 0); default: return vec3(0.0); } }const float PI = 3.14159265;vec2 rotate(vec2 coord, float angle) { float s = sin(angle); float c = cos(angle); return vec2( coord.x * c - coord.y * s, coord.x * s + coord.y * c ); }out vec4 fragColor;vec3 getColor(vec2 uv) {return vec3(1, 1, 1); }void main() {vec2 uv = vTextureCoord; vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); uv -= pos; uv /= (0.5000*2.); uv = rotate(uv, (0.0000 - 0.5) * 2. * PI); vec4 color = vec4(getColor(uv), 1.); fragColor = color; }`],compiledVertexShaders:[`#version 300 es
546
+ precision mediump float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vTextureCoord = aTextureCoord; }`],data:{downSample:.5,depth:!1,uniforms:{},isBackground:!0},id:"effect"},{breakpoints:[],visible:!0,locked:!1,aspectRatio:1.0793650793650795,layerName:"",userDownsample:1,isElement:!0,opacity:1,effects:[],displace:0,trackMouse:0,anchorPoint:"center",mouseMomentum:0,blendMode:"NORMAL",bgDisplace:0,mask:0,maskBackground:{type:"Vec3",_x:0,_y:0,_z:0},maskAlpha:0,maskDepth:0,dispersion:0,axisTilt:0,states:{appear:[],scroll:[],hover:[]},layerType:"shape",width:.49660178547135064,widthMode:"relative",height:.4600869483043395,heightMode:"auto",left:.35409161821999585,leftMode:"relative",top:.6850280273460352,topMode:"relative",rotation:0,pos:{type:"Vec2",_x:.5,_y:.5},borderRadius:0,gradientAngle:0,strokeWidth:0,coords:[[0,0],[.49660178547135064,0],[.49660178547135064,.4600869483043395],[0,.4600869483043395]],fill:["#7001D7"],fitToCanvas:!1,gradientType:"linear",type:"circle",stroke:["#000000"],numSides:3,compiledFragmentShaders:[`#version 300 es
547
+ precision highp float; in vec2 vTextureCoord; in vec3 vVertexPosition;uniform sampler2D uBgTexture; uniform sampler2D uTexture; uniform vec2 uMousePos; uniform int uSampleBg;out vec4 fragColor;void main() { vec2 uv = vTextureCoord; vec2 pos = mix(vec2(0), (uMousePos - 0.5), 0.0000);uv = uv - pos;vec4 color = texture(uTexture, uv); vec4 background = vec4(0);if(uSampleBg == 1) { background = texture(uBgTexture, vTextureCoord); }color = mix(background, color / max(color.a, 0.0001), color.a * 1.0000);fragColor = color; }`],compiledVertexShaders:[`#version 300 es
548
+ precision highp float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform mat4 uTextureMatrix; uniform vec2 uMousePos;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { float angleX = uMousePos.y * 0.5 - 0.25; float angleY = (1.-uMousePos.x) * 0.5 - 0.25;mat4 rotateX = mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(angleX), -sin(angleX), 0.0, 0.0, sin(angleX), cos(angleX), 0.0, 0.0, 0.0, 0.0, 1.0); mat4 rotateY = mat4(cos(angleY), 0.0, sin(angleY), 0.0, 0.0, 1.0, 0.0, 0.0, -sin(angleY), 0.0, cos(angleY), 0.0, 0.0, 0.0, 0.0, 1.0);mat4 rotationMatrix = rotateX * rotateY; gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vVertexPosition = (rotationMatrix * vec4(aVertexPosition, 1.0)).xyz; vTextureCoord = (uTextureMatrix * vec4(aTextureCoord, 0.0, 1.0)).xy; }`],data:{uniforms:{}},id:"shape"},{breakpoints:[],visible:!0,locked:!1,aspectRatio:1.0158730158730158,layerName:"",userDownsample:1,isElement:!0,opacity:1,effects:[],displace:0,trackMouse:0,anchorPoint:"center",mouseMomentum:0,blendMode:"MULTIPLY",bgDisplace:0,mask:0,maskBackground:{type:"Vec3",_x:0,_y:0,_z:0},maskAlpha:0,maskDepth:0,dispersion:0,axisTilt:0,states:{appear:[],scroll:[],hover:[]},layerType:"shape",width:.46738991573774175,widthMode:"relative",height:.46008694830433955,heightMode:"auto",left:.7457263018329404,leftMode:"relative",top:.5757566919333954,topMode:"relative",rotation:0,pos:{type:"Vec2",_x:.5,_y:.5},borderRadius:0,gradientAngle:0,strokeWidth:0,coords:[[0,0],[.46738991573774175,0],[.46738991573774175,.46008694830433955],[0,.46008694830433955]],fill:["#4E21AC"],fitToCanvas:!1,gradientType:"linear",type:"circle",stroke:["#000000"],numSides:3,compiledFragmentShaders:[`#version 300 es
549
+ precision highp float; in vec2 vTextureCoord; in vec3 vVertexPosition;uniform vec2 uResolution; uniform vec2 uMousePos; uniform sampler2D uBgTexture; uniform sampler2D uPreviousLayerTexture; uniform sampler2D uTexture; uniform int uSampleBg;vec3 blend (int blendMode, vec3 src, vec3 dst) { return src * dst; }const float STEPS = 24.0; const float PI = 3.1415926;vec2 perspectiveUV(vec2 uv) { float aspectRatio = uResolution.x/uResolution.y; vec2 centeredUV = uv - 0.5; centeredUV.x *= aspectRatio; float strength = 1.0 + (vVertexPosition.z * 0.0000); vec2 perspectiveUV = centeredUV / strength; perspectiveUV.x /= aspectRatio; perspectiveUV += 0.5; return perspectiveUV; }out vec4 fragColor;void main() { vec2 uv = vTextureCoord; vec2 pos = mix(vec2(0), (uMousePos - 0.5), 0.0000); uv = perspectiveUV(uv) - pos; vec4 background = vec4(0);if(uSampleBg == 1) { background = texture(uBgTexture, vTextureCoord); } vec4 color = texture(uTexture, uv);if (0.0000 == 1.00) { if(0 == 2) { background *= (1. - color.a); color = background; } else { background *= color.a; color.rgb = background.rgb; color.rgb = 0.0000 > 0. ? mix(vec3(0, 0, 0), color.rgb, color.a) : color.rgb; color.a = min(1., color.a + 0.0000); if(0 == 1) { vec4 previousLayer = texture(uPreviousLayerTexture, vTextureCoord); color = mix(previousLayer, color/max(color.a, 0.0001), color.a * 1.0000); } } fragColor = color; return; }if (3 > 0) { vec3 unpremultColor = color.rgb / max(color.a, 0.0001); vec3 blendedColor = blend(3, unpremultColor, background.rgb); color = vec4(blendedColor, 1.0) * (color.a * 1.0000); color = color + background * (1.0 - color.a); } else { color = mix(background, color + background * (1.0 - color.a), 1.0000); }fragColor = color; }`],compiledVertexShaders:[`#version 300 es
550
+ precision highp float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform mat4 uTextureMatrix; uniform vec2 uMousePos;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { float angleX = uMousePos.y * 0.5 - 0.25; float angleY = (1.-uMousePos.x) * 0.5 - 0.25;mat4 rotateX = mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(angleX), -sin(angleX), 0.0, 0.0, sin(angleX), cos(angleX), 0.0, 0.0, 0.0, 0.0, 1.0); mat4 rotateY = mat4(cos(angleY), 0.0, sin(angleY), 0.0, 0.0, 1.0, 0.0, 0.0, -sin(angleY), 0.0, cos(angleY), 0.0, 0.0, 0.0, 0.0, 1.0);mat4 rotationMatrix = rotateX * rotateY; gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vVertexPosition = (rotationMatrix * vec4(aVertexPosition, 1.0)).xyz; vTextureCoord = (uTextureMatrix * vec4(aTextureCoord, 0.0, 1.0)).xy; }`],data:{uniforms:{}},id:"shape1"},{breakpoints:[],visible:!0,locked:!1,aspectRatio:.996031746031746,layerName:"",userDownsample:1,isElement:!0,opacity:1,effects:[],displace:0,trackMouse:0,anchorPoint:"center",mouseMomentum:0,blendMode:"MULTIPLY",bgDisplace:0,mask:0,maskBackground:{type:"Vec3",_x:0,_y:0,_z:0},maskAlpha:0,maskDepth:0,dispersion:0,axisTilt:0,states:{appear:[],scroll:[],hover:[]},layerType:"shape",width:.45826120644598894,widthMode:"relative",height:.4600869483043395,heightMode:"auto",left:.49185679854495884,leftMode:"relative",top:.35992750274551055,topMode:"relative",rotation:0,pos:{type:"Vec2",_x:.5,_y:.5},borderRadius:0,gradientAngle:0,strokeWidth:0,coords:[[0,0],[.45826120644598894,0],[.45826120644598894,.4600869483043395],[0,.4600869483043395]],fill:["#FFC7E6"],fitToCanvas:!1,gradientType:"linear",type:"rectangle",stroke:["#000000"],numSides:3,compiledFragmentShaders:[`#version 300 es
551
+ precision highp float; in vec2 vTextureCoord; in vec3 vVertexPosition;uniform vec2 uResolution; uniform vec2 uMousePos; uniform sampler2D uBgTexture; uniform sampler2D uPreviousLayerTexture; uniform sampler2D uTexture; uniform int uSampleBg;vec3 blend (int blendMode, vec3 src, vec3 dst) { return src * dst; }const float STEPS = 24.0; const float PI = 3.1415926;vec2 perspectiveUV(vec2 uv) { float aspectRatio = uResolution.x/uResolution.y; vec2 centeredUV = uv - 0.5; centeredUV.x *= aspectRatio; float strength = 1.0 + (vVertexPosition.z * 0.0000); vec2 perspectiveUV = centeredUV / strength; perspectiveUV.x /= aspectRatio; perspectiveUV += 0.5; return perspectiveUV; }out vec4 fragColor;void main() { vec2 uv = vTextureCoord; vec2 pos = mix(vec2(0), (uMousePos - 0.5), 0.0000); uv = perspectiveUV(uv) - pos; vec4 background = vec4(0);if(uSampleBg == 1) { background = texture(uBgTexture, vTextureCoord); } vec4 color = texture(uTexture, uv);if (0.0000 == 1.00) { if(0 == 2) { background *= (1. - color.a); color = background; } else { background *= color.a; color.rgb = background.rgb; color.rgb = 0.0000 > 0. ? mix(vec3(0, 0, 0), color.rgb, color.a) : color.rgb; color.a = min(1., color.a + 0.0000); if(0 == 1) { vec4 previousLayer = texture(uPreviousLayerTexture, vTextureCoord); color = mix(previousLayer, color/max(color.a, 0.0001), color.a * 1.0000); } } fragColor = color; return; }if (3 > 0) { vec3 unpremultColor = color.rgb / max(color.a, 0.0001); vec3 blendedColor = blend(3, unpremultColor, background.rgb); color = vec4(blendedColor, 1.0) * (color.a * 1.0000); color = color + background * (1.0 - color.a); } else { color = mix(background, color + background * (1.0 - color.a), 1.0000); }fragColor = color; }`],compiledVertexShaders:[`#version 300 es
552
+ precision highp float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform mat4 uTextureMatrix; uniform vec2 uMousePos;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { float angleX = uMousePos.y * 0.5 - 0.25; float angleY = (1.-uMousePos.x) * 0.5 - 0.25;mat4 rotateX = mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(angleX), -sin(angleX), 0.0, 0.0, sin(angleX), cos(angleX), 0.0, 0.0, 0.0, 0.0, 1.0); mat4 rotateY = mat4(cos(angleY), 0.0, sin(angleY), 0.0, 0.0, 1.0, 0.0, 0.0, -sin(angleY), 0.0, cos(angleY), 0.0, 0.0, 0.0, 0.0, 1.0);mat4 rotationMatrix = rotateX * rotateY; gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vVertexPosition = (rotationMatrix * vec4(aVertexPosition, 1.0)).xyz; vTextureCoord = (uTextureMatrix * vec4(aTextureCoord, 0.0, 1.0)).xy; }`],data:{uniforms:{}},id:"shape2"},{breakpoints:[],visible:!0,aspectRatio:1,userDownsample:1,layerType:"effect",type:"blur",usesPingPong:!1,trackMouse:0,mouseMomentum:0,texture:!1,animating:!1,isMask:0,compiledFragmentShaders:[`#version 300 es
553
+ precision highp float; precision highp int;in vec3 vVertexPosition; in vec2 vTextureCoord;uniform sampler2D uTexture; uniform vec2 uMousePos; uniform vec2 uResolution; float ease (int easingFunc, float t) { return t; }out vec4 fragColor;const int kernelSize = 36; float getGaussianWeight(int index) { switch(index) { case 0: return 0.00094768; case 1: return 0.00151965; case 2: return 0.00237008; case 3: return 0.00359517; case 4: return 0.0053041; case 5: return 0.00761097; case 6: return 0.01062197; case 7: return 0.01441804; case 8: return 0.01903459; case 9: return 0.0244409; case 10: return 0.03052299; case 11: return 0.03707432; case 12: return 0.04379813; case 13: return 0.05032389; case 14: return 0.05623791; case 15: return 0.06112521; case 16: return 0.06461716; case 17: return 0.06643724; case 18: return 0.06643724; case 19: return 0.06461716; case 20: return 0.06112521; case 21: return 0.05623791; case 22: return 0.05032389; case 23: return 0.04379813; case 24: return 0.03707432; case 25: return 0.03052299; case 26: return 0.0244409; case 27: return 0.01903459; case 28: return 0.01441804; case 29: return 0.01062197; case 30: return 0.00761097; case 31: return 0.0053041; case 32: return 0.00359517; case 33: return 0.00237008; case 34: return 0.00151965; case 35: return 0.00094768; default: return 0.0; } }vec4 GaussianBlur(sampler2D tex, vec2 uv, vec2 direction) { vec4 color = vec4(0.0); vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); float inner = distance(uv, pos); float outer = max(0., 1.-distance(uv, pos));float amt = 0 <= 1 ? 6. : 11.; float amount = (1.0000 * amt) * ease(0, mix(inner, outer, 0.1000)); color += texture(tex, uv) * getGaussianWeight(0); for (int i = 0; i < kernelSize; i++) { float x = float(i - kernelSize / 2) * amount; color += texture(tex, uv + vec2(x * 0.001) * direction * vec2(1.0000, 1. - 1.0000)) * getGaussianWeight(i); } return color; }vec4 blur(vec2 uv, vec2 direction) { return GaussianBlur(uTexture, uv, direction); }void main() { vec2 uv = vTextureCoord; vec4 color = vec4(0); int dir = 0 % 2; vec2 direction = dir == 1 ? vec2(0, uResolution.x/uResolution.y) : vec2(1, 0);color = blur(uv, direction); fragColor = color;}`,`#version 300 es
554
+ precision highp float; precision highp int;in vec3 vVertexPosition; in vec2 vTextureCoord;uniform sampler2D uTexture; uniform vec2 uMousePos; uniform vec2 uResolution; float ease (int easingFunc, float t) { return t; }out vec4 fragColor;const int kernelSize = 36; float getGaussianWeight(int index) { switch(index) { case 0: return 0.00094768; case 1: return 0.00151965; case 2: return 0.00237008; case 3: return 0.00359517; case 4: return 0.0053041; case 5: return 0.00761097; case 6: return 0.01062197; case 7: return 0.01441804; case 8: return 0.01903459; case 9: return 0.0244409; case 10: return 0.03052299; case 11: return 0.03707432; case 12: return 0.04379813; case 13: return 0.05032389; case 14: return 0.05623791; case 15: return 0.06112521; case 16: return 0.06461716; case 17: return 0.06643724; case 18: return 0.06643724; case 19: return 0.06461716; case 20: return 0.06112521; case 21: return 0.05623791; case 22: return 0.05032389; case 23: return 0.04379813; case 24: return 0.03707432; case 25: return 0.03052299; case 26: return 0.0244409; case 27: return 0.01903459; case 28: return 0.01441804; case 29: return 0.01062197; case 30: return 0.00761097; case 31: return 0.0053041; case 32: return 0.00359517; case 33: return 0.00237008; case 34: return 0.00151965; case 35: return 0.00094768; default: return 0.0; } }vec4 GaussianBlur(sampler2D tex, vec2 uv, vec2 direction) { vec4 color = vec4(0.0); vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); float inner = distance(uv, pos); float outer = max(0., 1.-distance(uv, pos));float amt = 1 <= 1 ? 6. : 11.; float amount = (1.0000 * amt) * ease(0, mix(inner, outer, 0.1000)); color += texture(tex, uv) * getGaussianWeight(0); for (int i = 0; i < kernelSize; i++) { float x = float(i - kernelSize / 2) * amount; color += texture(tex, uv + vec2(x * 0.001) * direction * vec2(1.0000, 1. - 1.0000)) * getGaussianWeight(i); } return color; }vec4 blur(vec2 uv, vec2 direction) { return GaussianBlur(uTexture, uv, direction); }void main() { vec2 uv = vTextureCoord; vec4 color = vec4(0); int dir = 1 % 2; vec2 direction = dir == 1 ? vec2(0, uResolution.x/uResolution.y) : vec2(1, 0);color = blur(uv, direction); fragColor = color;}`,`#version 300 es
555
+ precision highp float; precision highp int;in vec3 vVertexPosition; in vec2 vTextureCoord;uniform sampler2D uTexture; uniform vec2 uMousePos; uniform vec2 uResolution; float ease (int easingFunc, float t) { return t; }out vec4 fragColor;const int kernelSize = 36; float getGaussianWeight(int index) { switch(index) { case 0: return 0.00094768; case 1: return 0.00151965; case 2: return 0.00237008; case 3: return 0.00359517; case 4: return 0.0053041; case 5: return 0.00761097; case 6: return 0.01062197; case 7: return 0.01441804; case 8: return 0.01903459; case 9: return 0.0244409; case 10: return 0.03052299; case 11: return 0.03707432; case 12: return 0.04379813; case 13: return 0.05032389; case 14: return 0.05623791; case 15: return 0.06112521; case 16: return 0.06461716; case 17: return 0.06643724; case 18: return 0.06643724; case 19: return 0.06461716; case 20: return 0.06112521; case 21: return 0.05623791; case 22: return 0.05032389; case 23: return 0.04379813; case 24: return 0.03707432; case 25: return 0.03052299; case 26: return 0.0244409; case 27: return 0.01903459; case 28: return 0.01441804; case 29: return 0.01062197; case 30: return 0.00761097; case 31: return 0.0053041; case 32: return 0.00359517; case 33: return 0.00237008; case 34: return 0.00151965; case 35: return 0.00094768; default: return 0.0; } }vec4 GaussianBlur(sampler2D tex, vec2 uv, vec2 direction) { vec4 color = vec4(0.0); vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); float inner = distance(uv, pos); float outer = max(0., 1.-distance(uv, pos));float amt = 2 <= 1 ? 6. : 11.; float amount = (1.0000 * amt) * ease(0, mix(inner, outer, 0.1000)); color += texture(tex, uv) * getGaussianWeight(0); for (int i = 0; i < kernelSize; i++) { float x = float(i - kernelSize / 2) * amount; color += texture(tex, uv + vec2(x * 0.001) * direction * vec2(1.0000, 1. - 1.0000)) * getGaussianWeight(i); } return color; }vec4 blur(vec2 uv, vec2 direction) { return GaussianBlur(uTexture, uv, direction); }void main() { vec2 uv = vTextureCoord; vec4 color = vec4(0); int dir = 2 % 2; vec2 direction = dir == 1 ? vec2(0, uResolution.x/uResolution.y) : vec2(1, 0);color = blur(uv, direction); fragColor = color;}`,`#version 300 es
556
+ precision highp float; precision highp int;in vec3 vVertexPosition; in vec2 vTextureCoord;uniform sampler2D uTexture; uniform vec2 uMousePos; uniform vec2 uResolution; float ease (int easingFunc, float t) { return t; } uvec2 pcg2d(uvec2 v) { v = v * 1664525u + 1013904223u; v.x += v.y * v.y * 1664525u + 1013904223u; v.y += v.x * v.x * 1664525u + 1013904223u; v ^= v >> 16; v.x += v.y * v.y * 1664525u + 1013904223u; v.y += v.x * v.x * 1664525u + 1013904223u; return v; }float randFibo(vec2 p) { uvec2 v = floatBitsToUint(p); v = pcg2d(v); uint r = v.x ^ v.y; return float(r) / float(0xffffffffu); }out vec4 fragColor;const int kernelSize = 36; float getGaussianWeight(int index) { switch(index) { case 0: return 0.00094768; case 1: return 0.00151965; case 2: return 0.00237008; case 3: return 0.00359517; case 4: return 0.0053041; case 5: return 0.00761097; case 6: return 0.01062197; case 7: return 0.01441804; case 8: return 0.01903459; case 9: return 0.0244409; case 10: return 0.03052299; case 11: return 0.03707432; case 12: return 0.04379813; case 13: return 0.05032389; case 14: return 0.05623791; case 15: return 0.06112521; case 16: return 0.06461716; case 17: return 0.06643724; case 18: return 0.06643724; case 19: return 0.06461716; case 20: return 0.06112521; case 21: return 0.05623791; case 22: return 0.05032389; case 23: return 0.04379813; case 24: return 0.03707432; case 25: return 0.03052299; case 26: return 0.0244409; case 27: return 0.01903459; case 28: return 0.01441804; case 29: return 0.01062197; case 30: return 0.00761097; case 31: return 0.0053041; case 32: return 0.00359517; case 33: return 0.00237008; case 34: return 0.00151965; case 35: return 0.00094768; default: return 0.0; } }vec4 GaussianBlur(sampler2D tex, vec2 uv, vec2 direction) { vec4 color = vec4(0.0); vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); float inner = distance(uv, pos); float outer = max(0., 1.-distance(uv, pos));float amt = 3 <= 1 ? 6. : 11.; float amount = (1.0000 * amt) * ease(0, mix(inner, outer, 0.1000)); color += texture(tex, uv) * getGaussianWeight(0); for (int i = 0; i < kernelSize; i++) { float x = float(i - kernelSize / 2) * amount; color += texture(tex, uv + vec2(x * 0.001) * direction * vec2(1.0000, 1. - 1.0000)) * getGaussianWeight(i); } return color; }vec4 blur(vec2 uv, vec2 direction) { return GaussianBlur(uTexture, uv, direction); }void main() { vec2 uv = vTextureCoord; vec4 color = vec4(0); int dir = 3 % 2; vec2 direction = dir == 1 ? vec2(0, uResolution.x/uResolution.y) : vec2(1, 0);color = blur(uv, direction);float dither = (randFibo(gl_FragCoord.xy) - 0.5) / 255.0; color.rgb += dither; fragColor = color;}`],compiledVertexShaders:[`#version 300 es
557
+ precision mediump float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform mat4 uTextureMatrix;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vTextureCoord = (uTextureMatrix * vec4(aTextureCoord, 0.0, 1.0)).xy; }`],data:{downSample:.25,depth:!1,uniforms:{},isBackground:!1,passes:[{prop:"vertical",value:1,downSample:.25},{prop:"vertical",value:2,downSample:.5},{prop:"vertical",value:3,downSample:.5}]},id:"effect1"},{breakpoints:[],visible:!0,aspectRatio:1,userDownsample:1,layerType:"effect",type:"sdf_shape",usesPingPong:!1,texture:!1,speed:1,trackMouseMove:0,mouseMomentum:1,trackMouse:.15,animating:!0,isMask:0,compiledFragmentShaders:[`#version 300 es
558
+ precision highp float; precision highp int;in vec2 vTextureCoord; uniform sampler2D uTexture;uniform float uTime;uniform vec2 uMousePos; uniform vec2 uResolution;uvec2 pcg2d(uvec2 v) { v = v * 1664525u + 1013904223u; v.x += v.y * v.y * 1664525u + 1013904223u; v.y += v.x * v.x * 1664525u + 1013904223u; v ^= v >> 16; v.x += v.y * v.y * 1664525u + 1013904223u; v.y += v.x * v.x * 1664525u + 1013904223u; return v; }float randFibo(vec2 p) { uvec2 v = floatBitsToUint(p); v = pcg2d(v); uint r = v.x ^ v.y; return float(r) / float(0xffffffffu); }const float PI = 3.141592653; const float PI2 = 6.283185306; const int DISP_STEPS = 12; const vec3 viewDir = vec3(0,0, -4.25);ivec2 customTexSize; float customTexAspect;const mat3 ROT_Y_90 = mat3( 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, -1.0, 0.0, 0.0 );const mat3 ROT_Z_90 = mat3( 0.0, -1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 );const mat3 ROT_X_90 = mat3( 1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1.0, 0.0 );mat3 rotY(float ang) { float c = cos(ang), s = sin(ang); return mat3(c, 0.0, s, 0.0, 1.0, 0.0, -s, 0.0, c); }mat3 rotX(float ang) { float c = cos(ang), s = sin(ang); return mat3(1.0, 0.0, 0.0, 0.0, c, -s, 0.0, s, c); }mat3 rotZ(float ang) { float c = cos(ang), s = sin(ang); return mat3(c, -s, 0.0, s, c, 0.0, 0.0, 0.0, 1.0); }mat2 rot(float a) { float s = sin(a); float c = cos(a); return mat2(c, -s, s, c); }vec3 twistY(vec3 p, float amount) { float c = cos(amount * p.y); float s = sin(amount * p.y); mat2 m = mat2(c, -s, s, c); return vec3(m * p.xz, p.y); }vec3 twistX(vec3 p, float amount) { float c = cos(amount * p.x); float s = sin(amount * p.x); mat2 m = mat2(c, -s, s, c); return vec3(p.x, m * p.yz); }float smin(float a, float b, float k) { float h = max(k - abs(a - b), 0.0); return min(a, b) - h * h * 0.25 / k; }float sphere(vec3 p, float r) { return length(p) - r; }float sdfCylinder(vec3 p, float radius, float height) { vec2 d = abs(vec2(length(p.xz) - radius, p.y)) - vec2(radius, height * 0.5); return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)); }float sdStar5(vec2 p, float r, float rf) { const vec2 k1 = vec2(0.809016994375, -0.587785252292); const vec2 k2 = vec2(-k1.x,k1.y); p.x = abs(p.x); p -= 2.0*max(dot(k1,p),0.0)*k1; p -= 2.0*max(dot(k2,p),0.0)*k2; p.x = abs(p.x); p.y -= r; vec2 ba = rf*vec2(-k1.y,k1.x) - vec2(0,1); float h = clamp( dot(p,ba)/dot(ba,ba), 0.0, r ); return length(p-ba*h) * sign(p.y*ba.x-p.x*ba.y); }float mergedDiscs(vec3 p) { float result = sdfCylinder(p, 0.7, 0.01 + 0.0000 * 0.5);for(float i = 1.; i < 4.; i++) { float angle = (i * 45.)/360. * 2.0 * PI; mat2 rotZMat = rot(angle); vec3 rotatedP = vec3(rotZMat * p.xy, p.z);result = smin( result, sdfCylinder(rotatedP, 0.7, 0.01 + 0.0000 * 0.5), 0.2 ); }return max(result, sphere(p, 1.4)); }vec3 getRepeat(vec3 p) { float spacing = (0.5000 + 0.4800 * 0.38) * 8.; return p; }vec3 getThreeDRepeat(vec3 p) { float spacing = (0.5000 + 0.4800 * 0.38) * 8.; return p; }vec3 getAdjustedP(vec3 p) { float scale = max(0.2600, 0.000000001); float scaleFactor = 1.0/scale; vec3 adjustedP = p * scaleFactor;vec2 twist = vec2(0.7, 0.82);adjustedP.xy *= vec2(uResolution.x / uResolution.y, 1);adjustedP *= (1. + (0.4800 + 0.01));vec2 mousePos = mix(vec2(0), uMousePos - 0.5, 0.1500); vec2 axis = vec2(-1. * vec3(0.48503740648379057, 0.5187032418952618, 0.6966).y - 1. + mousePos.y/PI, vec3(0.48503740648379057, 0.5187032418952618, 0.6966).x + mousePos.x/PI) * 2.;adjustedP = getRepeat(adjustedP);float baseTime = uTime * 0.02; float timeX = vec3(0, 1.2, 0).x * baseTime; float timeY = vec3(0, 1.2, 0).y * baseTime; float timeZ = vec3(0, 1.2, 0).z * baseTime;mat3 rotYMat = rotY(axis.y * PI); mat3 rotXMat = rotX(axis.x * PI); mat3 rotZMat = rotZ(vec3(0.48503740648379057, 0.5187032418952618, 0.6966).z * 2.0 * PI);mat3 combinedRotation = rotZMat * rotYMat * rotXMat; mat3 combinedAnimation = rotZ(timeZ) * rotX(timeX) * rotY(timeY);adjustedP = combinedRotation * adjustedP; adjustedP = combinedAnimation * adjustedP; adjustedP = getThreeDRepeat(adjustedP); adjustedP = mix(adjustedP, twistY(adjustedP, -1.0 * twist.y), step(0.0, abs(twist.y))); adjustedP = mix(adjustedP, twistX(adjustedP, -1.0 * twist.x), step(0.0, abs(twist.x)));return adjustedP; }float getMergedSDF(vec3 p) { p = getAdjustedP(p); return mergedDiscs(p); }float fresnel(vec3 eyeVector, vec3 worldNormal, float power) { float NdotV = abs(dot(eyeVector, worldNormal)); float width = fwidth(dot(eyeVector, worldNormal)); float threshold = 0.2; float edgeDampFactor = smoothstep(threshold, -threshold, width); float fresnelFactor = 1.0 - NdotV; return pow(fresnelFactor, power) * mix(1., edgeDampFactor * 2., 0.5); }vec3 noFrostOrDispersion(vec3 rd, vec3 normal) { float ior = 1.0 / (1.0 + 0.7000 * 0.25); vec3 refractedRay = refract(rd, normal, ior); return texture(uTexture, vTextureCoord - refractedRay.xy).rgb; }vec3 frostOrDispersion(vec3 rd, vec3 normal) { vec3 refractionColor = vec3(0); float iorBase = 1. + 0.7000 * 0.25;vec3 dispCoefficients = vec3(0.03, 0.06, 0.1) * 0.2500 * 1.2;for (int i = 0; i < DISP_STEPS; ++i) { float step = float(i) / float(DISP_STEPS); vec3 disp = step * dispCoefficients; vec3 ior = 1.0 / (iorBase + disp);vec3 refractedRayR = refract(rd, normal, ior.r); vec3 refractedRayG = refract(rd, normal, ior.g); vec3 refractedRayB = refract(rd, normal, ior.b);refractionColor.r += texture(uTexture, vTextureCoord - refractedRayR.xy).r; refractionColor.g += texture(uTexture, vTextureCoord - refractedRayG.xy).g; refractionColor.b += texture(uTexture, vTextureCoord - refractedRayB.xy).b; }return clamp(refractionColor / float(DISP_STEPS), 0.0, 1.0); }vec3 calculateNormal(vec3 p, float eps) { vec2 e = vec2(1.0, -1.0) * eps * 0.5; return normalize( e.xyy * getMergedSDF(p + e.xyy) + e.yyx * getMergedSDF(p + e.yyx) + e.yxy * getMergedSDF(p + e.yxy) + e.xxx * getMergedSDF(p + e.xxx) ); }vec3 sampleTexture(vec3 rd, vec3 normal) {return frostOrDispersion(rd, normal); return noFrostOrDispersion(rd, normal); }float scene(vec3 p) { return max(0.0000000001, getMergedSDF(p) - (0.4800 + 0.005)) * max(0.2600, 0.000000001); }const int STEPS = 128; const float MAX_DISTANCE = 100.0;vec4 rayMarch(vec3 ro, vec3 rd) { float pixelSize = 0.0025; float traveled = 0.; vec3 entryPoint = vec3(0.0); vec3 entryNormal = vec3(0.0); float partialAlpha = 0.0; float lastDistance = 0.0; float smoothing = mix(1., 4., 1.0000);for (int i = 0; i < STEPS; ++i) { vec3 currentPos = ro + rd * traveled; float distance = scene(currentPos); float progress = float(i)/float(STEPS); float step = distance * mix(1., 1.5, progress);if (distance > MAX_DISTANCE) break;if (distance < pixelSize) { partialAlpha = 1.; entryPoint = currentPos; entryNormal = calculateNormal(entryPoint, pixelSize * smoothing); break; }lastDistance = distance;traveled += max(step, pixelSize); if (traveled > MAX_DISTANCE) break; }if (partialAlpha == 0.0) { return texture(uTexture, vTextureCoord); }vec3 samplePosition = mix(rd, entryPoint, 0.0000);vec3 refractionColor = vec3(0.0);refractionColor = sampleTexture(samplePosition, entryNormal); vec3 lightDir = vec3(((vec2(vec3(0.25, 0.25, -3).x, 1.-vec3(0.25, 0.25, -3).y) - 0.333) * 3.) - vec2(0.5, 0.5), vec3(0.25, 0.25, -3).z); vec3 normLightDir = normalize(lightDir);float lightAndShadow = dot(entryNormal, normLightDir); vec3 lightColor = mix(vec3(1), vec3(1, 1, 1), 1. - 0.0000); vec3 fresnelEffect = vec3(0.0);fresnelEffect = fresnel(rd, entryNormal, 8.0) * 0.3000 * vec3(1, 1, 1);vec3 specularEffect = vec3(0.0);vec3 halfwayDir = normalize(lightDir + rd); float specFactor = pow(max(dot(entryNormal, halfwayDir), 0.0), 64.0 * 0.3000 + 0.01); specularEffect = specFactor * 0.3000 * lightColor;vec3 combinedEffects = fresnelEffect + specularEffect; vec3 finalColor = mix(refractionColor, vec3(1, 1, 1) * lightAndShadow, 0.0000); finalColor += combinedEffects;vec4 outputColor = vec4(finalColor, 1.);return outputColor; }out vec4 fragColor;void main() { vec4 col = vec4(0); vec4 bg = texture(uTexture, vTextureCoord);if(0.2600 <= 0.0001 || 0.5000 <= 0.0001) { col = vec4(0); if(1 == 1) { col = bg; } fragColor = col; return; }vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); vec2 uv = vTextureCoord - pos; float fovFactor = tan(radians(20.) * 0.5); vec3 rd = vec3(uv * fovFactor, 0.5); col = rayMarch(viewDir, rd); float dither = (randFibo(vTextureCoord.xy) - 0.5) / 255.0; col += dither;col = mix(bg, col, 0.5000); fragColor = col;}`],compiledVertexShaders:[`#version 300 es
559
+ precision mediump float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform mat4 uTextureMatrix;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vTextureCoord = (uTextureMatrix * vec4(aTextureCoord, 0.0, 1.0)).xy; }`],data:{depth:!1,uniforms:{},isBackground:!1},id:"effect2"},{breakpoints:[],visible:!0,aspectRatio:1,userDownsample:1,layerType:"effect",type:"sphere",usesPingPong:!1,trackMouse:0,mouseMomentum:0,texture:!1,animating:!1,isMask:0,compiledFragmentShaders:[`#version 300 es
560
+ precision mediump float; in vec3 vVertexPosition; in vec2 vTextureCoord; uniform sampler2D uTexture; uniform vec2 uMousePos; uniform vec2 uResolution;const float STEPS = 16.0; const float PI = 3.1415926;vec3 chromaticAbberation(vec2 st, float angle, float amount, float blend) { float aspectRatio = uResolution.x/uResolution.y; float rotation = angle * 360.0 * PI / 180.0; vec2 aberrated = amount * vec2(0.1 * sin(rotation) * aspectRatio, 0.1 * cos(rotation)); aberrated *= distance(st, vec2(0.5)) * 2.0; vec4 red = vec4(0); vec4 blue = vec4(0); vec4 green = vec4(0); float invSteps = 1.0 / STEPS; float invStepsHalf = invSteps * 0.5; for(float i = 1.0; i <= STEPS; i++) { vec2 offset = aberrated * (i * invSteps); red += texture(uTexture, st - offset) * invSteps; blue += texture(uTexture, st + offset) * invSteps; }for (float i = 0.0; i <= STEPS; i++) { vec2 offset = aberrated * ((i * invSteps) - 0.5); green += texture(uTexture, st + offset) * invSteps; } return vec3(red.r, green.g, blue.b); }vec2 sphericalTransformation( float u, float v, float uCenter, float vCenter, float lensRadius, float tau) { float aspectRatio = uResolution.x/uResolution.y; u -= uCenter; v -= vCenter;float s = sqrt(u * u + v * v); if (s > lensRadius) return vec2(u + uCenter, v + vCenter);float z = sqrt(lensRadius * lensRadius - s * s);float uAlpha = (1.0 - (1.0 / tau)) * asin(u / lensRadius); float vAlpha = (1.0 - (1.0 / tau)) * asin(v / lensRadius);u = uCenter + z * sin(uAlpha); v = vCenter + z * sin(vAlpha);return vec2(u/aspectRatio, v); }float circularIn(float t) { return 1.0 - sqrt(1.0 - t * t); }vec2 fisheyeTransformation( float u, float v, float uCenter, float vCenter, float lensRadius, float distortionScale ) { float aspectRatio = uResolution.x / uResolution.y;vec2 dir = vec2(u - uCenter, v - vCenter);dir.x /= lensRadius; dir.y /= lensRadius;float dist = length(dir) * 0.15;if (dist < 1.0) { float theta = atan(dir.y, dir.x);float r = dist * 2.0 * PI; float z = sqrt(1.0 - r * r) + 0.25; float rDist = atan(r, z) / PI; float newDist = mix(dist, rDist, 5.);dir.x = newDist * cos(theta); dir.y = newDist * sin(theta); }dir.x *= lensRadius; dir.y *= lensRadius;return mix(vec2(u/aspectRatio, v), vec2(uCenter/aspectRatio, vCenter) + dir, 1.0000); }vec2 discTransformation( float u, float v, float uCenter, float vCenter, float lensRadius, float distortionScale) { float aspectRatio = uResolution.x/uResolution.y; u -= uCenter; v -= vCenter;float s = sqrt(u * u + v * v); if (s > lensRadius) return vec2(u + uCenter, v + vCenter); float r = sqrt(u * u + v * v) / lensRadius; if(r == 0.0) return vec2(uCenter, vCenter);r = pow(r, distortionScale); float theta = atan(r); float rad = theta / r;u = rad * u + uCenter; v = rad * v + vCenter;return vec2(u/aspectRatio, v); }out vec4 fragColor; void main() { vec2 uv = vTextureCoord; vec4 color = texture(uTexture, uv); float aspectRatio = uResolution.x/uResolution.y; uv.x = uv.x * aspectRatio; vec2 sphereCoords = uv; vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); pos.x *= aspectRatio;float radius = 0.5000 * uResolution.x/max(uResolution.x, uResolution.y);if(1 == 0) { sphereCoords = sphericalTransformation( mix(sphereCoords.x, 1.-sphereCoords.x, 0.0000), mix(sphereCoords.y, 1.-sphereCoords.y, 0.0000), mix(pos.x, 1.-pos.x, 0.0000), mix(pos.y, 1.-pos.y, 0.0000), radius/2., 1. + 1.0000 * 9. ); } else if(1 == 1) { sphereCoords = discTransformation( mix(sphereCoords.x, 1.-sphereCoords.x, 0.0000), mix(sphereCoords.y, 1.-sphereCoords.y, 0.0000), mix(pos.x, 1.-pos.x, 0.0000), mix(pos.y, 1.-pos.y, 0.0000), radius/2., 1. + 1.0000 * 9. ); } else if(1 == 2) { sphereCoords = fisheyeTransformation( mix(sphereCoords.x, 1.-sphereCoords.x, 0.0000), mix(sphereCoords.y, 1.-sphereCoords.y, 0.0000), mix(pos.x, 1.-pos.x, 0.0000), mix(pos.y, 1.-pos.y, 0.0000), radius/2., 1. + 1.0000 * 9. ); }vec2 scaledCoords = (sphereCoords - 0.5) + 0.5; vec4 sphere = texture(uTexture, clamp(scaledCoords, 0.0, 1.0)); float distFromPos = distance(uv, pos); float edgeSmooth = 0.001; float insideSphere = 1.0 - smoothstep(radius/2.0 - edgeSmooth, radius/2.0, distFromPos); float insideSphereAlpha = 1.0 - smoothstep(radius/2.0 + 0.002 - edgeSmooth, radius/2.0 + 0.002, distFromPos); sphere.rgb = chromaticAbberation(scaledCoords, atan(scaledCoords.y, scaledCoords.x), distFromPos * 1.0000, 1.0); color = mix(color, sphere, insideSphere); color.rgb += vec3((0.5000-0.5)*2.) * mix(0., circularIn(smoothstep(0., radius, distFromPos)), insideSphere); if(1 == 1) { color.a = insideSphereAlpha; color.rgb = mix(vec3(0), color.rgb, insideSphereAlpha); } fragColor = color;}`],compiledVertexShaders:[`#version 300 es
561
+ precision mediump float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform mat4 uTextureMatrix;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vTextureCoord = (uTextureMatrix * vec4(aTextureCoord, 0.0, 1.0)).xy; }`],data:{depth:!1,uniforms:{},isBackground:!1},id:"effect3"}],options:{name:"zAI Orb final",fps:60,dpi:1.5,scale:1,includeLogo:!1,isProduction:!1},version:"1.4.29",id:"l9tOlEGo3rE5cxAzUCHg"});function Jj({className:e,dpi:t=2,scale:i=1,fps:r=60,onScene:s,onError:l}){const c=M.useRef(null),f=M.useId();return M.useEffect(()=>{if(!c.current)return;let h=!1,d=null;return(async()=>{try{const g=await Kj();if(h||!c.current)return;c.current.setAttribute("data-us-project-src",Tb.url),d=g.addScene({filePath:Tb.url,elementId:f,dpi:t,scale:i,fps:r});const v=await d;if(h){v.destroy();return}s(v)}catch{h||l()}})(),()=>{h=!0,s(null),d==null||d.then(g=>g.destroy()).catch(()=>{})}},[f,t,i,r]),b.jsx("div",{ref:c,id:f,className:e,role:"img","aria-hidden":!0})}const e7=1,t7=5,n7="effect2",i7="/__zframes/agents",r7="/__zframes/ask",a7=`
562
+ .zai-dock {
563
+ position: fixed;
564
+ right: 18px;
565
+ bottom: 50px;
566
+ z-index: 40;
567
+ display: flex;
568
+ align-items: center;
569
+ gap: 10px;
570
+ font-family: var(--font-dmsans, system-ui, sans-serif);
571
+ }
572
+ .zai-panel {
573
+ display: flex;
574
+ align-items: center;
575
+ width: 0;
576
+ opacity: 0;
577
+ overflow: hidden;
578
+ transition:
579
+ width 0.34s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
580
+ opacity 0.22s ease;
581
+ }
582
+ .zai-dock[data-open="true"] .zai-panel {
583
+ width: 330px;
584
+ opacity: 1;
585
+ }
586
+ .zai-input-wrap {
587
+ display: flex;
588
+ align-items: center;
589
+ gap: 8px;
590
+ width: 330px;
591
+ padding: 9px 10px 9px 14px;
592
+ border-radius: 9999px;
593
+ background: rgba(12, 13, 20, 0.72);
594
+ backdrop-filter: blur(12px);
595
+ -webkit-backdrop-filter: blur(12px);
596
+ border: 1px solid hsla(263, 80%, 72%, 0.24);
597
+ box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
598
+ }
599
+ .zai-input {
600
+ flex: 1;
601
+ min-width: 0;
602
+ background: transparent;
603
+ border: 0;
604
+ outline: 0;
605
+ color: #e7e9f3;
606
+ font-size: 13px;
607
+ }
608
+ .zai-input::placeholder { color: rgba(255, 255, 255, 0.4); }
609
+ .zai-agent {
610
+ flex: none;
611
+ font-size: 10px;
612
+ font-weight: 700;
613
+ letter-spacing: 0.05em;
614
+ text-transform: uppercase;
615
+ color: hsla(263, 85%, 82%, 0.95);
616
+ background: hsla(263, 80%, 60%, 0.16);
617
+ border-radius: 7px;
618
+ padding: 4px 7px;
619
+ cursor: pointer;
620
+ user-select: none;
621
+ white-space: nowrap;
622
+ transition: background 0.15s ease;
623
+ }
624
+ .zai-agent:hover { background: hsla(263, 80%, 60%, 0.28); }
625
+
626
+ /* The WebGL orb scene IS the orb — clipped to a circle and faded in once ready.
627
+ The button is just a transparent container; nothing is drawn behind the orb. */
628
+ .zai-orb-canvas {
629
+ position: absolute;
630
+ inset: 0;
631
+ border-radius: 9999px;
632
+ overflow: hidden;
633
+ opacity: 0;
634
+ transition: opacity 0.45s ease;
635
+ pointer-events: none;
636
+ }
637
+ .zai-orb[data-webgl="true"] .zai-orb-canvas { opacity: 1; }
638
+ .zai-orb-canvas canvas {
639
+ width: 100% !important;
640
+ height: 100% !important;
641
+ display: block;
642
+ }
643
+
644
+ .zai-orb {
645
+ position: relative;
646
+ width: 60px;
647
+ height: 60px;
648
+ flex: none;
649
+ padding: 0;
650
+ border: 0;
651
+ border-radius: 9999px;
652
+ cursor: pointer;
653
+ background: transparent;
654
+ transition: transform 0.2s var(--zf-ease-out, ease);
655
+ }
656
+ .zai-orb:hover { transform: scale(1.06); }
657
+ .zai-orb:active { transform: scale(0.97); }
658
+ /* Minimal fallback gradient, shown only if the WebGL scene fails to load, so
659
+ the orb stays visible + clickable instead of being an invisible button. */
660
+ .zai-orb[data-fallback="true"] {
661
+ background:
662
+ radial-gradient(circle at 34% 28%, hsla(263, 95%, 86%, 0.95), transparent 45%),
663
+ radial-gradient(circle at 62% 70%, #7a17e0 0%, #4a0a92 55%, #2c0560 100%);
664
+ }
665
+
666
+ .zai-history {
667
+ position: absolute;
668
+ right: 70px;
669
+ bottom: 72px;
670
+ width: 344px;
671
+ display: flex;
672
+ flex-direction: column;
673
+ justify-content: flex-end;
674
+ gap: 8px;
675
+ max-height: 52vh;
676
+ overflow: hidden;
677
+ pointer-events: none;
678
+ -webkit-mask-image: linear-gradient(180deg, transparent, #000 16%);
679
+ mask-image: linear-gradient(180deg, transparent, #000 16%);
680
+ }
681
+ .zai-msg {
682
+ width: fit-content;
683
+ max-width: 100%;
684
+ padding: 8px 12px;
685
+ border-radius: 14px;
686
+ font-size: 13px;
687
+ line-height: 1.45;
688
+ white-space: pre-wrap;
689
+ word-break: break-word;
690
+ backdrop-filter: blur(10px);
691
+ -webkit-backdrop-filter: blur(10px);
692
+ animation: zai-rise 0.28s var(--zf-ease-out, ease) both;
693
+ }
694
+ .zai-msg-user {
695
+ align-self: flex-end;
696
+ background: hsla(263, 70%, 55%, 0.28);
697
+ border: 1px solid hsla(263, 80%, 75%, 0.3);
698
+ color: #f0ecff;
699
+ }
700
+ .zai-msg-zai {
701
+ align-self: flex-start;
702
+ background: rgba(12, 13, 20, 0.66);
703
+ border: 1px solid rgba(255, 255, 255, 0.08);
704
+ color: #dfe3ef;
705
+ }
706
+ .zai-msg-error {
707
+ color: #ffb4bd;
708
+ border-color: rgba(255, 107, 129, 0.4);
709
+ }
710
+ @keyframes zai-rise {
711
+ from { opacity: 0; transform: translateY(6px); }
712
+ to { opacity: 1; transform: translateY(0); }
713
+ }
714
+
715
+ @media (prefers-reduced-motion: reduce) {
716
+ .zai-msg { animation: none; }
717
+ .zai-panel { transition: none; }
718
+ }
719
+ `;function s7(){var I;const[e,t]=M.useState(null),[i,r]=M.useState(null),[s,l]=M.useState(!1),[c,f]=M.useState(""),[h,d]=M.useState(!1),[g,v]=M.useState([]),[y,x]=M.useState(!1),[S,_]=M.useState(!1),T=M.useRef(null),E=M.useRef(null),C=M.useCallback((Y,O)=>{var L;const j=(L=Y.layers)==null?void 0:L.find(K=>K.id===n7&&K.layerType==="effect");j&&j.layerType==="effect"&&(j.speed=O?t7:e7)},[]),k=M.useCallback(Y=>{E.current=Y,Y?(C(Y,!1),_(!1),x(!0)):x(!1)},[C]),B=M.useCallback(()=>{x(!1),_(!0)},[]);M.useEffect(()=>{E.current&&C(E.current,h)},[h,C]),M.useEffect(()=>{let Y=!1;return fetch(i7,{cache:"no-store"}).then(O=>O.ok?O.json():{agents:[]}).then(O=>{var L;if(Y)return;const j=O.agents??[];t(j),r(((L=j[0])==null?void 0:L.id)??null)}).catch(()=>{Y||t([])}),()=>{Y=!0}},[]),M.useEffect(()=>{var Y;s&&((Y=T.current)==null||Y.focus())},[s]);const P=Y=>v(O=>[...O,Y].slice(-8));async function N(){var O;const Y=c.trim();if(!(!Y||h)){P({role:"user",text:Y}),f(""),d(!0);try{const j=await fetch(r7,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({question:Y,agent:i})}),L=await j.json();j.ok&&L.ok&&L.answer?P({role:"zai",text:L.answer}):P({role:"zai",text:L.error??`request failed (HTTP ${j.status})`,error:!0})}catch(j){P({role:"zai",text:String(j),error:!0})}finally{d(!1),(O=T.current)==null||O.focus()}}}function U(Y){Y.key==="Enter"&&!Y.shiftKey?(Y.preventDefault(),N()):Y.key==="Escape"&&l(!1)}function A(){if(!e||e.length<2||!i)return;const Y=e.findIndex(O=>O.id===i);r(e[(Y+1)%e.length].id)}if(!e||e.length===0)return null;const $=((I=e.find(Y=>Y.id===i))==null?void 0:I.label)??e[0].label;return b.jsxs(b.Fragment,{children:[b.jsx("style",{children:a7}),b.jsxs("div",{className:"zai-dock","data-open":s,"data-busy":h,children:[s&&g.length>0&&b.jsx("div",{className:"zai-history","aria-live":"polite",children:g.map((Y,O)=>b.jsx("div",{className:Y.role==="user"?"zai-msg zai-msg-user":`zai-msg zai-msg-zai${Y.error?" zai-msg-error":""}`,children:Y.text},O))}),b.jsx("div",{className:"zai-panel",children:b.jsxs("div",{className:"zai-input-wrap",children:[b.jsx("input",{ref:T,className:"zai-input",value:c,onChange:Y=>f(Y.target.value),onKeyDown:U,placeholder:h?"thinking…":"what's going on?",disabled:h,"aria-label":"Ask zAI"}),b.jsx("span",{className:"zai-agent",onClick:A,title:e.length>1?"Click to switch agent":`Answered by ${$}`,children:$})]})}),b.jsx("button",{type:"button",className:"zai-orb","data-webgl":y,"data-fallback":S,onClick:()=>l(Y=>!Y),"aria-label":s?"Close zAI":"Ask zAI","aria-expanded":s,children:b.jsx(Jj,{className:"zai-orb-canvas",onScene:k,onError:B})})]})]})}const Eb=WS(OO),o7=[new hj,new tj,new BO,new JO,new vj,new jj,new XO,new zj,new uj],l7="/__zframes/dashboard.json";function h0({children:e}){return b.jsx("main",{className:"mx-auto max-w-2xl px-6 py-16",children:e})}function c7(){return b.jsx(h0,{children:b.jsx("p",{className:"body-sm text-soft",children:"loading dashboard…"})})}function u7({message:e}){return b.jsxs(h0,{children:[b.jsx("h1",{className:"font-dmsans text-strong mb-2 text-lg font-extrabold",children:"couldn’t load your dashboard"}),b.jsxs("p",{className:"body-sm text-soft mb-4",children:["The zframes runtime couldn’t read ",b.jsx("code",{children:"dashboard.json"}),". Make sure you’re running ",b.jsx("code",{children:"zframes serve"})," next to it."]}),b.jsx("p",{className:"caption text-soft",children:b.jsx("code",{children:e})})]})}function f7({issues:e}){return b.jsxs(h0,{children:[b.jsx("h1",{className:"font-dmsans text-strong mb-2 text-lg font-extrabold",children:"dashboard.json is not a valid spec"}),b.jsxs("p",{className:"body-sm text-soft mb-4",children:["Fix the issues below (or run ",b.jsx("code",{children:"zframes lint dashboard.json"}),"), then reload."]}),b.jsx("ul",{className:"body-sm text-normal list-disc space-y-1 pl-5",children:e.map((t,i)=>b.jsxs("li",{children:[b.jsx("code",{children:t.path.join(".")||"(root)"}),": ",t.message]},i))})]})}async function d7(e){try{const t=await fetch("/__zframes/dashboard",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(`HTTP ${t.status}`);window.location.reload()}catch(t){console.error("zframes: failed to save dashboard.json",t),window.alert("Couldn't save dashboard.json — is `zframes serve` still running? Your edits are still on screen; try Save again.")}}function h7(){const[e,t]=M.useState({status:"loading"}),[i,r]=M.useState(null),[s,l]=M.useState(null),c=qj(),f=s??(e.status==="ready"?e.spec.theme.accentHue:null);if(M.useEffect(()=>{f!=null&&document.documentElement.style.setProperty("--zf-accent-hue",String(f))},[f]),M.useEffect(()=>{let d=!1;return fetch(l7,{cache:"no-store"}).then(g=>{if(!g.ok)throw new Error(`HTTP ${g.status}`);return g.json()}).then(g=>{if(d)return;const v=Lz.safeParse(g);t(v.success?{status:"ready",spec:v.data}:{status:"invalid",issues:v.error.issues})}).catch(g=>{d||t({status:"error",message:String(g)})}),()=>{d=!0}},[]),e.status==="loading")return b.jsx(c7,{});if(e.status==="error")return b.jsx(u7,{message:e.message});if(e.status==="invalid")return b.jsx(f7,{issues:e.issues});const h=e.spec;return b.jsxs(T2,{providers:o7,children:[b.jsx(Gj,{background:h.background}),b.jsxs("main",{className:"relative z-10 mx-auto max-w-[1320px] px-4 pb-24 pt-5 sm:px-6",style:{"--zf-accent-hue":f??h.theme.accentHue,"--zf-accent-sat":`${h.theme.accentSat}%`},children:[b.jsxs("header",{className:"mb-5 flex flex-col gap-2 border-b border-white/[0.06] pb-4 sm:flex-row sm:items-center sm:justify-between",children:[b.jsxs("div",{className:"flex items-baseline gap-3",children:[b.jsxs("h1",{className:"font-dmsans text-strong text-lg font-extrabold tracking-tight",children:["/",b.jsx("span",{style:{color:"hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76%)"},children:"zframes"})]}),b.jsx("span",{className:"body-sm text-soft",children:h.title})]}),b.jsx("div",{ref:r,className:"flex min-h-9 items-center justify-end"})]}),c?b.jsx(Kz,{spec:h,registry:Eb}):b.jsx(AM,{spec:h,registry:Eb,onSave:d7,customiseButtonTarget:i,onAccentHueChange:l})]}),b.jsx(Xj,{}),b.jsx(s7,{})]})}const jw=document.getElementById("root");if(!jw)throw new Error("missing #root element");Mb.createRoot(jw).render(b.jsx(M.StrictMode,{children:b.jsx(h7,{})}));export{b as j,M as r};