@ainyc/canonry 1.40.1 → 1.44.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.
@@ -1,281 +0,0 @@
1
- function gB(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function qs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Z0={exports:{}},td={};var ck;function vB(){if(ck)return td;ck=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,s){var l=null;if(s!==void 0&&(l=""+s),i.key!==void 0&&(l=""+i.key),"key"in i){s={};for(var c in i)c!=="key"&&(s[c]=i[c])}else s=i;return i=s.ref,{$$typeof:e,type:r,key:l,ref:i!==void 0?i:null,props:s}}return td.Fragment=t,td.jsx=n,td.jsxs=n,td}var uk;function yB(){return uk||(uk=1,Z0.exports=vB()),Z0.exports}var u=yB(),Y0={exports:{}},Ue={};var dk;function bB(){if(dk)return Ue;dk=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),v=Symbol.iterator;function y(D){return D===null||typeof D!="object"?null:(D=v&&D[v]||D["@@iterator"],typeof D=="function"?D:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,N={};function C(D,G,oe){this.props=D,this.context=G,this.refs=N,this.updater=oe||w}C.prototype.isReactComponent={},C.prototype.setState=function(D,G){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,G,"setState")},C.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function E(){}E.prototype=C.prototype;function k(D,G,oe){this.props=D,this.context=G,this.refs=N,this.updater=oe||w}var O=k.prototype=new E;O.constructor=k,S(O,C.prototype),O.isPureReactComponent=!0;var T=Array.isArray;function P(){}var A={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function R(D,G,oe){var W=oe.ref;return{$$typeof:e,type:D,key:G,ref:W!==void 0?W:null,props:oe}}function q(D,G){return R(D.type,G,D.props)}function U(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function L(D){var G={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(oe){return G[oe]})}var ae=/\/+/g;function pe(D,G){return typeof D=="object"&&D!==null&&D.key!=null?L(""+D.key):G.toString(36)}function ge(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(P,P):(D.status="pending",D.then(function(G){D.status==="pending"&&(D.status="fulfilled",D.value=G)},function(G){D.status==="pending"&&(D.status="rejected",D.reason=G)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function V(D,G,oe,W,X){var Q=typeof D;(Q==="undefined"||Q==="boolean")&&(D=null);var de=!1;if(D===null)de=!0;else switch(Q){case"bigint":case"string":case"number":de=!0;break;case"object":switch(D.$$typeof){case e:case t:de=!0;break;case p:return de=D._init,V(de(D._payload),G,oe,W,X)}}if(de)return X=X(D),de=W===""?"."+pe(D,0):W,T(X)?(oe="",de!=null&&(oe=de.replace(ae,"$&/")+"/"),V(X,G,oe,"",function(le){return le})):X!=null&&(U(X)&&(X=q(X,oe+(X.key==null||D&&D.key===X.key?"":(""+X.key).replace(ae,"$&/")+"/")+de)),G.push(X)),1;de=0;var ye=W===""?".":W+":";if(T(D))for(var Z=0;Z<D.length;Z++)W=D[Z],Q=ye+pe(W,Z),de+=V(W,G,oe,Q,X);else if(Z=y(D),typeof Z=="function")for(D=Z.call(D),Z=0;!(W=D.next()).done;)W=W.value,Q=ye+pe(W,Z++),de+=V(W,G,oe,Q,X);else if(Q==="object"){if(typeof D.then=="function")return V(ge(D),G,oe,W,X);throw G=String(D),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return de}function re(D,G,oe){if(D==null)return D;var W=[],X=0;return V(D,W,"","",function(Q){return G.call(oe,Q,X++)}),W}function ve(D){if(D._status===-1){var G=D._result;G=G(),G.then(function(oe){(D._status===0||D._status===-1)&&(D._status=1,D._result=oe)},function(oe){(D._status===0||D._status===-1)&&(D._status=2,D._result=oe)}),D._status===-1&&(D._status=0,D._result=G)}if(D._status===1)return D._result.default;throw D._result}var we=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},B={map:re,forEach:function(D,G,oe){re(D,function(){G.apply(this,arguments)},oe)},count:function(D){var G=0;return re(D,function(){G++}),G},toArray:function(D){return re(D,function(G){return G})||[]},only:function(D){if(!U(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return Ue.Activity=g,Ue.Children=B,Ue.Component=C,Ue.Fragment=n,Ue.Profiler=i,Ue.PureComponent=k,Ue.StrictMode=r,Ue.Suspense=f,Ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,Ue.__COMPILER_RUNTIME={__proto__:null,c:function(D){return A.H.useMemoCache(D)}},Ue.cache=function(D){return function(){return D.apply(null,arguments)}},Ue.cacheSignal=function(){return null},Ue.cloneElement=function(D,G,oe){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var W=S({},D.props),X=D.key;if(G!=null)for(Q in G.key!==void 0&&(X=""+G.key),G)!z.call(G,Q)||Q==="key"||Q==="__self"||Q==="__source"||Q==="ref"&&G.ref===void 0||(W[Q]=G[Q]);var Q=arguments.length-2;if(Q===1)W.children=oe;else if(1<Q){for(var de=Array(Q),ye=0;ye<Q;ye++)de[ye]=arguments[ye+2];W.children=de}return R(D.type,X,W)},Ue.createContext=function(D){return D={$$typeof:l,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:s,_context:D},D},Ue.createElement=function(D,G,oe){var W,X={},Q=null;if(G!=null)for(W in G.key!==void 0&&(Q=""+G.key),G)z.call(G,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(X[W]=G[W]);var de=arguments.length-2;if(de===1)X.children=oe;else if(1<de){for(var ye=Array(de),Z=0;Z<de;Z++)ye[Z]=arguments[Z+2];X.children=ye}if(D&&D.defaultProps)for(W in de=D.defaultProps,de)X[W]===void 0&&(X[W]=de[W]);return R(D,Q,X)},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(D){return{$$typeof:c,render:D}},Ue.isValidElement=U,Ue.lazy=function(D){return{$$typeof:p,_payload:{_status:-1,_result:D},_init:ve}},Ue.memo=function(D,G){return{$$typeof:h,type:D,compare:G===void 0?null:G}},Ue.startTransition=function(D){var G=A.T,oe={};A.T=oe;try{var W=D(),X=A.S;X!==null&&X(oe,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(P,we)}catch(Q){we(Q)}finally{G!==null&&oe.types!==null&&(G.types=oe.types),A.T=G}},Ue.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},Ue.use=function(D){return A.H.use(D)},Ue.useActionState=function(D,G,oe){return A.H.useActionState(D,G,oe)},Ue.useCallback=function(D,G){return A.H.useCallback(D,G)},Ue.useContext=function(D){return A.H.useContext(D)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(D,G){return A.H.useDeferredValue(D,G)},Ue.useEffect=function(D,G){return A.H.useEffect(D,G)},Ue.useEffectEvent=function(D){return A.H.useEffectEvent(D)},Ue.useId=function(){return A.H.useId()},Ue.useImperativeHandle=function(D,G,oe){return A.H.useImperativeHandle(D,G,oe)},Ue.useInsertionEffect=function(D,G){return A.H.useInsertionEffect(D,G)},Ue.useLayoutEffect=function(D,G){return A.H.useLayoutEffect(D,G)},Ue.useMemo=function(D,G){return A.H.useMemo(D,G)},Ue.useOptimistic=function(D,G){return A.H.useOptimistic(D,G)},Ue.useReducer=function(D,G,oe){return A.H.useReducer(D,G,oe)},Ue.useRef=function(D){return A.H.useRef(D)},Ue.useState=function(D){return A.H.useState(D)},Ue.useSyncExternalStore=function(D,G,oe){return A.H.useSyncExternalStore(D,G,oe)},Ue.useTransition=function(){return A.H.useTransition()},Ue.version="19.2.4",Ue}var fk;function Gc(){return fk||(fk=1,Y0.exports=bB()),Y0.exports}var x=Gc();const bi=qs(x),bg=gB({__proto__:null,default:bi},[x]);var W0={exports:{}},nd={},Q0={exports:{}},X0={};var hk;function xB(){return hk||(hk=1,(function(e){function t(V,re){var ve=V.length;V.push(re);e:for(;0<ve;){var we=ve-1>>>1,B=V[we];if(0<i(B,re))V[we]=re,V[ve]=B,ve=we;else break e}}function n(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var re=V[0],ve=V.pop();if(ve!==re){V[0]=ve;e:for(var we=0,B=V.length,D=B>>>1;we<D;){var G=2*(we+1)-1,oe=V[G],W=G+1,X=V[W];if(0>i(oe,ve))W<B&&0>i(X,oe)?(V[we]=X,V[W]=ve,we=W):(V[we]=oe,V[G]=ve,we=G);else if(W<B&&0>i(X,ve))V[we]=X,V[W]=ve,we=W;else break e}}return re}function i(V,re){var ve=V.sortIndex-re.sortIndex;return ve!==0?ve:V.id-re.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var f=[],h=[],p=1,g=null,v=3,y=!1,w=!1,S=!1,N=!1,C=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function O(V){for(var re=n(h);re!==null;){if(re.callback===null)r(h);else if(re.startTime<=V)r(h),re.sortIndex=re.expirationTime,t(f,re);else break;re=n(h)}}function T(V){if(S=!1,O(V),!w)if(n(f)!==null)w=!0,P||(P=!0,L());else{var re=n(h);re!==null&&ge(T,re.startTime-V)}}var P=!1,A=-1,z=5,R=-1;function q(){return N?!0:!(e.unstable_now()-R<z)}function U(){if(N=!1,P){var V=e.unstable_now();R=V;var re=!0;try{e:{w=!1,S&&(S=!1,E(A),A=-1),y=!0;var ve=v;try{t:{for(O(V),g=n(f);g!==null&&!(g.expirationTime>V&&q());){var we=g.callback;if(typeof we=="function"){g.callback=null,v=g.priorityLevel;var B=we(g.expirationTime<=V);if(V=e.unstable_now(),typeof B=="function"){g.callback=B,O(V),re=!0;break t}g===n(f)&&r(f),O(V)}else r(f);g=n(f)}if(g!==null)re=!0;else{var D=n(h);D!==null&&ge(T,D.startTime-V),re=!1}}break e}finally{g=null,v=ve,y=!1}re=void 0}}finally{re?L():P=!1}}}var L;if(typeof k=="function")L=function(){k(U)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,pe=ae.port2;ae.port1.onmessage=U,L=function(){pe.postMessage(null)}}else L=function(){C(U,0)};function ge(V,re){A=C(function(){V(e.unstable_now())},re)}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(V){V.callback=null},e.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<V?Math.floor(1e3/V):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(V){switch(v){case 1:case 2:case 3:var re=3;break;default:re=v}var ve=v;v=re;try{return V()}finally{v=ve}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(V,re){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var ve=v;v=V;try{return re()}finally{v=ve}},e.unstable_scheduleCallback=function(V,re,ve){var we=e.unstable_now();switch(typeof ve=="object"&&ve!==null?(ve=ve.delay,ve=typeof ve=="number"&&0<ve?we+ve:we):ve=we,V){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=ve+B,V={id:p++,callback:re,priorityLevel:V,startTime:ve,expirationTime:B,sortIndex:-1},ve>we?(V.sortIndex=ve,t(h,V),n(f)===null&&V===n(h)&&(S?(E(A),A=-1):S=!0,ge(T,ve-we))):(V.sortIndex=B,t(f,V),w||y||(w=!0,P||(P=!0,L()))),V},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(V){var re=v;return function(){var ve=v;v=re;try{return V.apply(this,arguments)}finally{v=ve}}}})(X0)),X0}var pk;function wB(){return pk||(pk=1,Q0.exports=xB()),Q0.exports}var J0={exports:{}},qn={};var mk;function SB(){if(mk)return qn;mk=1;var e=Gc();function t(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)h+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+f+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function s(f,h,p){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:g==null?null:""+g,children:f,containerInfo:h,implementation:p}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return qn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,qn.createPortal=function(f,h){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return s(f,h,null,p)},qn.flushSync=function(f){var h=l.T,p=r.p;try{if(l.T=null,r.p=2,f)return f()}finally{l.T=h,r.p=p,r.d.f()}},qn.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(f,h))},qn.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},qn.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var p=h.as,g=c(p,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,y=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;p==="style"?r.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:y}):p==="script"&&r.d.X(f,{crossOrigin:g,integrity:v,fetchPriority:y,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},qn.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=c(h.as,h.crossOrigin);r.d.M(f,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(f)},qn.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,g=c(p,h.crossOrigin);r.d.L(f,p,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},qn.preloadModule=function(f,h){if(typeof f=="string")if(h){var p=c(h.as,h.crossOrigin);r.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(f)},qn.requestFormReset=function(f){r.d.r(f)},qn.unstable_batchedUpdates=function(f,h){return f(h)},qn.useFormState=function(f,h,p){return l.H.useFormState(f,h,p)},qn.useFormStatus=function(){return l.H.useHostTransitionStatus()},qn.version="19.2.4",qn}var gk;function oM(){if(gk)return J0.exports;gk=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(),J0.exports=SB(),J0.exports}var vk;function jB(){if(vk)return nd;vk=1;var e=wB(),t=Gc(),n=oM();function r(a){var o="https://react.dev/errors/"+a;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)o+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+a+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function s(a){var o=a,d=a;if(a.alternate)for(;o.return;)o=o.return;else{a=o;do o=a,(o.flags&4098)!==0&&(d=o.return),a=o.return;while(a)}return o.tag===3?d:null}function l(a){if(a.tag===13){var o=a.memoizedState;if(o===null&&(a=a.alternate,a!==null&&(o=a.memoizedState)),o!==null)return o.dehydrated}return null}function c(a){if(a.tag===31){var o=a.memoizedState;if(o===null&&(a=a.alternate,a!==null&&(o=a.memoizedState)),o!==null)return o.dehydrated}return null}function f(a){if(s(a)!==a)throw Error(r(188))}function h(a){var o=a.alternate;if(!o){if(o=s(a),o===null)throw Error(r(188));return o!==a?null:a}for(var d=a,m=o;;){var b=d.return;if(b===null)break;var j=b.alternate;if(j===null){if(m=b.return,m!==null){d=m;continue}break}if(b.child===j.child){for(j=b.child;j;){if(j===d)return f(b),a;if(j===m)return f(b),o;j=j.sibling}throw Error(r(188))}if(d.return!==m.return)d=b,m=j;else{for(var _=!1,M=b.child;M;){if(M===d){_=!0,d=b,m=j;break}if(M===m){_=!0,m=b,d=j;break}M=M.sibling}if(!_){for(M=j.child;M;){if(M===d){_=!0,d=j,m=b;break}if(M===m){_=!0,m=j,d=b;break}M=M.sibling}if(!_)throw Error(r(189))}}if(d.alternate!==m)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?a:o}function p(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a;for(a=a.child;a!==null;){if(o=p(a),o!==null)return o;a=a.sibling}return null}var g=Object.assign,v=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),k=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function L(a){return a===null||typeof a!="object"?null:(a=U&&a[U]||a["@@iterator"],typeof a=="function"?a:null)}var ae=Symbol.for("react.client.reference");function pe(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===ae?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case S:return"Fragment";case C:return"Profiler";case N:return"StrictMode";case T:return"Suspense";case P:return"SuspenseList";case R:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case w:return"Portal";case k:return a.displayName||"Context";case E:return(a._context.displayName||"Context")+".Consumer";case O:var o=a.render;return a=a.displayName,a||(a=o.displayName||o.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case A:return o=a.displayName||null,o!==null?o:pe(a.type)||"Memo";case z:o=a._payload,a=a._init;try{return pe(a(o))}catch{}}return null}var ge=Array.isArray,V=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ve={pending:!1,data:null,method:null,action:null},we=[],B=-1;function D(a){return{current:a}}function G(a){0>B||(a.current=we[B],we[B]=null,B--)}function oe(a,o){B++,we[B]=a.current,a.current=o}var W=D(null),X=D(null),Q=D(null),de=D(null);function ye(a,o){switch(oe(Q,o),oe(X,a),oe(W,null),o.nodeType){case 9:case 11:a=(a=o.documentElement)&&(a=a.namespaceURI)?P_(a):0;break;default:if(a=o.tagName,o=o.namespaceURI)o=P_(o),a=z_(o,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}G(W),oe(W,a)}function Z(){G(W),G(X),G(Q)}function le(a){a.memoizedState!==null&&oe(de,a);var o=W.current,d=z_(o,a.type);o!==d&&(oe(X,a),oe(W,d))}function Se(a){X.current===a&&(G(W),G(X)),de.current===a&&(G(de),Qu._currentValue=ve)}var F,Ae;function Oe(a){if(F===void 0)try{throw Error()}catch(d){var o=d.stack.trim().match(/\n( *(at )?)/);F=o&&o[1]||"",Ae=-1<d.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+F+a+Ae}var nt=!1;function Ve(a,o){if(!a||nt)return"";nt=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(o){var fe=function(){throw Error()};if(Object.defineProperty(fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(fe,[])}catch(ie){var te=ie}Reflect.construct(a,[],fe)}else{try{fe.call()}catch(ie){te=ie}a.call(fe.prototype)}}else{try{throw Error()}catch(ie){te=ie}(fe=a())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(ie){if(ie&&te&&typeof ie.stack=="string")return[ie.stack,te.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var j=m.DetermineComponentFrameRoot(),_=j[0],M=j[1];if(_&&M){var $=_.split(`
4
- `),ee=M.split(`
5
- `);for(b=m=0;m<$.length&&!$[m].includes("DetermineComponentFrameRoot");)m++;for(;b<ee.length&&!ee[b].includes("DetermineComponentFrameRoot");)b++;if(m===$.length||b===ee.length)for(m=$.length-1,b=ee.length-1;1<=m&&0<=b&&$[m]!==ee[b];)b--;for(;1<=m&&0<=b;m--,b--)if($[m]!==ee[b]){if(m!==1||b!==1)do if(m--,b--,0>b||$[m]!==ee[b]){var se=`
6
- `+$[m].replace(" at new "," at ");return a.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",a.displayName)),se}while(1<=m&&0<=b);break}}}finally{nt=!1,Error.prepareStackTrace=d}return(d=a?a.displayName||a.name:"")?Oe(d):""}function sn(a,o){switch(a.tag){case 26:case 27:case 5:return Oe(a.type);case 16:return Oe("Lazy");case 13:return a.child!==o&&o!==null?Oe("Suspense Fallback"):Oe("Suspense");case 19:return Oe("SuspenseList");case 0:case 15:return Ve(a.type,!1);case 11:return Ve(a.type.render,!1);case 1:return Ve(a.type,!0);case 31:return Oe("Activity");default:return""}}function pn(a){try{var o="",d=null;do o+=sn(a,d),d=a,a=a.return;while(a);return o}catch(m){return`
7
- Error generating stack: `+m.message+`
8
- `+m.stack}}var Gt=Object.prototype.hasOwnProperty,he=e.unstable_scheduleCallback,Fe=e.unstable_cancelCallback,St=e.unstable_shouldYield,lr=e.unstable_requestPaint,st=e.unstable_now,Xe=e.unstable_getCurrentPriorityLevel,at=e.unstable_ImmediatePriority,Pt=e.unstable_UserBlockingPriority,cr=e.unstable_NormalPriority,qa=e.unstable_LowPriority,Qs=e.unstable_IdlePriority,ut=e.log,gl=e.unstable_setDisableYieldValue,An=null,$e=null;function Rr(a){if(typeof ut=="function"&&gl(a),$e&&typeof $e.setStrictMode=="function")try{$e.setStrictMode(An,a)}catch{}}var be=Math.clz32?Math.clz32:Mf,Wn=Math.log,du=Math.LN2;function Mf(a){return a>>>=0,a===0?32:31-(Wn(a)/du|0)|0}var Fa=256,ia=262144,Xs=4194304;function Ti(a){var o=a&42;if(o!==0)return o;switch(a&-a){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 a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function vl(a,o,d){var m=a.pendingLanes;if(m===0)return 0;var b=0,j=a.suspendedLanes,_=a.pingedLanes;a=a.warmLanes;var M=m&134217727;return M!==0?(m=M&~j,m!==0?b=Ti(m):(_&=M,_!==0?b=Ti(_):d||(d=M&~a,d!==0&&(b=Ti(d))))):(M=m&~j,M!==0?b=Ti(M):_!==0?b=Ti(_):d||(d=m&~a,d!==0&&(b=Ti(d)))),b===0?0:o!==0&&o!==b&&(o&j)===0&&(j=b&-b,d=o&-o,j>=d||j===32&&(d&4194048)!==0)?o:b}function Pi(a,o){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&o)===0}function Rf(a,o){switch(a){case 1:case 2:case 4:case 8:case 64:return o+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 o+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 Df(){var a=Xs;return Xs<<=1,(Xs&62914560)===0&&(Xs=4194304),a}function yl(a){for(var o=[],d=0;31>d;d++)o.push(a);return o}function Js(a,o){a.pendingLanes|=o,o!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function $v(a,o,d,m,b,j){var _=a.pendingLanes;a.pendingLanes=d,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=d,a.entangledLanes&=d,a.errorRecoveryDisabledLanes&=d,a.shellSuspendCounter=0;var M=a.entanglements,$=a.expirationTimes,ee=a.hiddenUpdates;for(d=_&~d;0<d;){var se=31-be(d),fe=1<<se;M[se]=0,$[se]=-1;var te=ee[se];if(te!==null)for(ee[se]=null,se=0;se<te.length;se++){var ie=te[se];ie!==null&&(ie.lane&=-536870913)}d&=~fe}m!==0&&If(a,m,0),j!==0&&b===0&&a.tag!==0&&(a.suspendedLanes|=j&~(_&~o))}function If(a,o,d){a.pendingLanes|=o,a.suspendedLanes&=~o;var m=31-be(o);a.entangledLanes|=o,a.entanglements[m]=a.entanglements[m]|1073741824|d&261930}function Lf(a,o){var d=a.entangledLanes|=o;for(a=a.entanglements;d;){var m=31-be(d),b=1<<m;b&o|a[m]&o&&(a[m]|=o),d&=~b}}function fu(a,o){var d=o&-o;return d=(d&42)!==0?1:K(d),(d&(a.suspendedLanes|o))!==0?0:d}function K(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=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:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function xe(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function vt(){var a=re.p;return a!==0?a:(a=window.event,a===void 0?32:nk(a.type))}function Vt(a,o){var d=re.p;try{return re.p=a,o()}finally{re.p=d}}var Ut=Math.random().toString(36).slice(2),zt="__reactFiber$"+Ut,Zt="__reactProps$"+Ut,Sr="__reactContainer$"+Ut,Bn="__reactEvents$"+Ut,Uv="__reactListeners$"+Ut,Ka="__reactHandles$"+Ut,Ha="__reactResources$"+Ut,zi="__reactMarker$"+Ut;function bl(a){delete a[zt],delete a[Zt],delete a[Bn],delete a[Uv],delete a[Ka]}function Ga(a){var o=a[zt];if(o)return o;for(var d=a.parentNode;d;){if(o=d[Sr]||d[zt]){if(d=o.alternate,o.child!==null||d!==null&&d.child!==null)for(a=U_(a);a!==null;){if(d=a[zt])return d;a=U_(a)}return o}a=d,d=a.parentNode}return null}function fi(a){if(a=a[zt]||a[Sr]){var o=a.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return a}return null}function Mi(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a.stateNode;throw Error(r(33))}function Va(a){var o=a[Ha];return o||(o=a[Ha]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function on(a){a[zi]=!0}var Je=new Set,yt={};function mn(a,o){Qn(a,o),Qn(a+"Capture",o)}function Qn(a,o){for(yt[a]=o,a=0;a<o.length;a++)Je.add(o[a])}var xl=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]*$"),hu={},jN={};function lU(a){return Gt.call(jN,a)?!0:Gt.call(hu,a)?!1:xl.test(a)?jN[a]=!0:(hu[a]=!0,!1)}function $f(a,o,d){if(lU(o))if(d===null)a.removeAttribute(o);else{switch(typeof d){case"undefined":case"function":case"symbol":a.removeAttribute(o);return;case"boolean":var m=o.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){a.removeAttribute(o);return}}a.setAttribute(o,""+d)}}function Uf(a,o,d){if(d===null)a.removeAttribute(o);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(o);return}a.setAttribute(o,""+d)}}function aa(a,o,d,m){if(m===null)a.removeAttribute(d);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(d);return}a.setAttributeNS(o,d,""+m)}}function Dr(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function NN(a){var o=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function cU(a,o,d){var m=Object.getOwnPropertyDescriptor(a.constructor.prototype,o);if(!a.hasOwnProperty(o)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var b=m.get,j=m.set;return Object.defineProperty(a,o,{configurable:!0,get:function(){return b.call(this)},set:function(_){d=""+_,j.call(this,_)}}),Object.defineProperty(a,o,{enumerable:m.enumerable}),{getValue:function(){return d},setValue:function(_){d=""+_},stopTracking:function(){a._valueTracker=null,delete a[o]}}}}function Bv(a){if(!a._valueTracker){var o=NN(a)?"checked":"value";a._valueTracker=cU(a,o,""+a[o])}}function CN(a){if(!a)return!1;var o=a._valueTracker;if(!o)return!0;var d=o.getValue(),m="";return a&&(m=NN(a)?a.checked?"true":"false":a.value),a=m,a!==d?(o.setValue(a),!0):!1}function Bf(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var uU=/[\n"\\]/g;function Ir(a){return a.replace(uU,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function qv(a,o,d,m,b,j,_,M){a.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?a.type=_:a.removeAttribute("type"),o!=null?_==="number"?(o===0&&a.value===""||a.value!=o)&&(a.value=""+Dr(o)):a.value!==""+Dr(o)&&(a.value=""+Dr(o)):_!=="submit"&&_!=="reset"||a.removeAttribute("value"),o!=null?Fv(a,_,Dr(o)):d!=null?Fv(a,_,Dr(d)):m!=null&&a.removeAttribute("value"),b==null&&j!=null&&(a.defaultChecked=!!j),b!=null&&(a.checked=b&&typeof b!="function"&&typeof b!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?a.name=""+Dr(M):a.removeAttribute("name")}function ON(a,o,d,m,b,j,_,M){if(j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(a.type=j),o!=null||d!=null){if(!(j!=="submit"&&j!=="reset"||o!=null)){Bv(a);return}d=d!=null?""+Dr(d):"",o=o!=null?""+Dr(o):d,M||o===a.value||(a.value=o),a.defaultValue=o}m=m??b,m=typeof m!="function"&&typeof m!="symbol"&&!!m,a.checked=M?a.checked:!!m,a.defaultChecked=!!m,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(a.name=_),Bv(a)}function Fv(a,o,d){o==="number"&&Bf(a.ownerDocument)===a||a.defaultValue===""+d||(a.defaultValue=""+d)}function wl(a,o,d,m){if(a=a.options,o){o={};for(var b=0;b<d.length;b++)o["$"+d[b]]=!0;for(d=0;d<a.length;d++)b=o.hasOwnProperty("$"+a[d].value),a[d].selected!==b&&(a[d].selected=b),b&&m&&(a[d].defaultSelected=!0)}else{for(d=""+Dr(d),o=null,b=0;b<a.length;b++){if(a[b].value===d){a[b].selected=!0,m&&(a[b].defaultSelected=!0);return}o!==null||a[b].disabled||(o=a[b])}o!==null&&(o.selected=!0)}}function _N(a,o,d){if(o!=null&&(o=""+Dr(o),o!==a.value&&(a.value=o),d==null)){a.defaultValue!==o&&(a.defaultValue=o);return}a.defaultValue=d!=null?""+Dr(d):""}function kN(a,o,d,m){if(o==null){if(m!=null){if(d!=null)throw Error(r(92));if(ge(m)){if(1<m.length)throw Error(r(93));m=m[0]}d=m}d==null&&(d=""),o=d}d=Dr(o),a.defaultValue=d,m=a.textContent,m===d&&m!==""&&m!==null&&(a.value=m),Bv(a)}function Sl(a,o){if(o){var d=a.firstChild;if(d&&d===a.lastChild&&d.nodeType===3){d.nodeValue=o;return}}a.textContent=o}var dU=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 AN(a,o,d){var m=o.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?m?a.setProperty(o,""):o==="float"?a.cssFloat="":a[o]="":m?a.setProperty(o,d):typeof d!="number"||d===0||dU.has(o)?o==="float"?a.cssFloat=d:a[o]=(""+d).trim():a[o]=d+"px"}function EN(a,o,d){if(o!=null&&typeof o!="object")throw Error(r(62));if(a=a.style,d!=null){for(var m in d)!d.hasOwnProperty(m)||o!=null&&o.hasOwnProperty(m)||(m.indexOf("--")===0?a.setProperty(m,""):m==="float"?a.cssFloat="":a[m]="");for(var b in o)m=o[b],o.hasOwnProperty(b)&&d[b]!==m&&AN(a,b,m)}else for(var j in o)o.hasOwnProperty(j)&&AN(a,j,o[j])}function Kv(a){if(a.indexOf("-")===-1)return!1;switch(a){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 fU=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"]]),hU=/^[\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 qf(a){return hU.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function sa(){}var Hv=null;function Gv(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var jl=null,Nl=null;function TN(a){var o=fi(a);if(o&&(a=o.stateNode)){var d=a[Zt]||null;e:switch(a=o.stateNode,o.type){case"input":if(qv(a,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name),o=d.name,d.type==="radio"&&o!=null){for(d=a;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll('input[name="'+Ir(""+o)+'"][type="radio"]'),o=0;o<d.length;o++){var m=d[o];if(m!==a&&m.form===a.form){var b=m[Zt]||null;if(!b)throw Error(r(90));qv(m,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(o=0;o<d.length;o++)m=d[o],m.form===a.form&&CN(m)}break e;case"textarea":_N(a,d.value,d.defaultValue);break e;case"select":o=d.value,o!=null&&wl(a,!!d.multiple,o,!1)}}}var Vv=!1;function PN(a,o,d){if(Vv)return a(o,d);Vv=!0;try{var m=a(o);return m}finally{if(Vv=!1,(jl!==null||Nl!==null)&&(Ah(),jl&&(o=jl,a=Nl,Nl=jl=null,TN(o),a)))for(o=0;o<a.length;o++)TN(a[o])}}function pu(a,o){var d=a.stateNode;if(d===null)return null;var m=d[Zt]||null;if(m===null)return null;d=m[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(a=a.type,m=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!m;break e;default:a=!1}if(a)return null;if(d&&typeof d!="function")throw Error(r(231,o,typeof d));return d}var oa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Zv=!1;if(oa)try{var mu={};Object.defineProperty(mu,"passive",{get:function(){Zv=!0}}),window.addEventListener("test",mu,mu),window.removeEventListener("test",mu,mu)}catch{Zv=!1}var Za=null,Yv=null,Ff=null;function zN(){if(Ff)return Ff;var a,o=Yv,d=o.length,m,b="value"in Za?Za.value:Za.textContent,j=b.length;for(a=0;a<d&&o[a]===b[a];a++);var _=d-a;for(m=1;m<=_&&o[d-m]===b[j-m];m++);return Ff=b.slice(a,1<m?1-m:void 0)}function Kf(a){var o=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&o===13&&(a=13)):a=o,a===10&&(a=13),32<=a||a===13?a:0}function Hf(){return!0}function MN(){return!1}function ur(a){function o(d,m,b,j,_){this._reactName=d,this._targetInst=b,this.type=m,this.nativeEvent=j,this.target=_,this.currentTarget=null;for(var M in a)a.hasOwnProperty(M)&&(d=a[M],this[M]=d?d(j):j[M]);return this.isDefaultPrevented=(j.defaultPrevented!=null?j.defaultPrevented:j.returnValue===!1)?Hf:MN,this.isPropagationStopped=MN,this}return g(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=Hf)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=Hf)},persist:function(){},isPersistent:Hf}),o}var eo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Gf=ur(eo),gu=g({},eo,{view:0,detail:0}),pU=ur(gu),Wv,Qv,vu,Vf=g({},gu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Jv,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==vu&&(vu&&a.type==="mousemove"?(Wv=a.screenX-vu.screenX,Qv=a.screenY-vu.screenY):Qv=Wv=0,vu=a),Wv)},movementY:function(a){return"movementY"in a?a.movementY:Qv}}),RN=ur(Vf),mU=g({},Vf,{dataTransfer:0}),gU=ur(mU),vU=g({},gu,{relatedTarget:0}),Xv=ur(vU),yU=g({},eo,{animationName:0,elapsedTime:0,pseudoElement:0}),bU=ur(yU),xU=g({},eo,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),wU=ur(xU),SU=g({},eo,{data:0}),DN=ur(SU),jU={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},NU={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"},CU={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function OU(a){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(a):(a=CU[a])?!!o[a]:!1}function Jv(){return OU}var _U=g({},gu,{key:function(a){if(a.key){var o=jU[a.key]||a.key;if(o!=="Unidentified")return o}return a.type==="keypress"?(a=Kf(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?NU[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Jv,charCode:function(a){return a.type==="keypress"?Kf(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Kf(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),kU=ur(_U),AU=g({},Vf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),IN=ur(AU),EU=g({},gu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Jv}),TU=ur(EU),PU=g({},eo,{propertyName:0,elapsedTime:0,pseudoElement:0}),zU=ur(PU),MU=g({},Vf,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),RU=ur(MU),DU=g({},eo,{newState:0,oldState:0}),IU=ur(DU),LU=[9,13,27,32],ey=oa&&"CompositionEvent"in window,yu=null;oa&&"documentMode"in document&&(yu=document.documentMode);var $U=oa&&"TextEvent"in window&&!yu,LN=oa&&(!ey||yu&&8<yu&&11>=yu),$N=" ",UN=!1;function BN(a,o){switch(a){case"keyup":return LU.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qN(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Cl=!1;function UU(a,o){switch(a){case"compositionend":return qN(o);case"keypress":return o.which!==32?null:(UN=!0,$N);case"textInput":return a=o.data,a===$N&&UN?null:a;default:return null}}function BU(a,o){if(Cl)return a==="compositionend"||!ey&&BN(a,o)?(a=zN(),Ff=Yv=Za=null,Cl=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return LN&&o.locale!=="ko"?null:o.data;default:return null}}var qU={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 FN(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o==="input"?!!qU[a.type]:o==="textarea"}function KN(a,o,d,m){jl?Nl?Nl.push(m):Nl=[m]:jl=m,o=Dh(o,"onChange"),0<o.length&&(d=new Gf("onChange","change",null,d,m),a.push({event:d,listeners:o}))}var bu=null,xu=null;function FU(a){O_(a,0)}function Zf(a){var o=Mi(a);if(CN(o))return a}function HN(a,o){if(a==="change")return o}var GN=!1;if(oa){var ty;if(oa){var ny="oninput"in document;if(!ny){var VN=document.createElement("div");VN.setAttribute("oninput","return;"),ny=typeof VN.oninput=="function"}ty=ny}else ty=!1;GN=ty&&(!document.documentMode||9<document.documentMode)}function ZN(){bu&&(bu.detachEvent("onpropertychange",YN),xu=bu=null)}function YN(a){if(a.propertyName==="value"&&Zf(xu)){var o=[];KN(o,xu,a,Gv(a)),PN(FU,o)}}function KU(a,o,d){a==="focusin"?(ZN(),bu=o,xu=d,bu.attachEvent("onpropertychange",YN)):a==="focusout"&&ZN()}function HU(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Zf(xu)}function GU(a,o){if(a==="click")return Zf(o)}function VU(a,o){if(a==="input"||a==="change")return Zf(o)}function ZU(a,o){return a===o&&(a!==0||1/a===1/o)||a!==a&&o!==o}var jr=typeof Object.is=="function"?Object.is:ZU;function wu(a,o){if(jr(a,o))return!0;if(typeof a!="object"||a===null||typeof o!="object"||o===null)return!1;var d=Object.keys(a),m=Object.keys(o);if(d.length!==m.length)return!1;for(m=0;m<d.length;m++){var b=d[m];if(!Gt.call(o,b)||!jr(a[b],o[b]))return!1}return!0}function WN(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function QN(a,o){var d=WN(a);a=0;for(var m;d;){if(d.nodeType===3){if(m=a+d.textContent.length,a<=o&&m>=o)return{node:d,offset:o-a};a=m}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=WN(d)}}function XN(a,o){return a&&o?a===o?!0:a&&a.nodeType===3?!1:o&&o.nodeType===3?XN(a,o.parentNode):"contains"in a?a.contains(o):a.compareDocumentPosition?!!(a.compareDocumentPosition(o)&16):!1:!1}function JN(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var o=Bf(a.document);o instanceof a.HTMLIFrameElement;){try{var d=typeof o.contentWindow.location.href=="string"}catch{d=!1}if(d)a=o.contentWindow;else break;o=Bf(a.document)}return o}function ry(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o&&(o==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||o==="textarea"||a.contentEditable==="true")}var YU=oa&&"documentMode"in document&&11>=document.documentMode,Ol=null,iy=null,Su=null,ay=!1;function eC(a,o,d){var m=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;ay||Ol==null||Ol!==Bf(m)||(m=Ol,"selectionStart"in m&&ry(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Su&&wu(Su,m)||(Su=m,m=Dh(iy,"onSelect"),0<m.length&&(o=new Gf("onSelect","select",null,o,d),a.push({event:o,listeners:m}),o.target=Ol)))}function to(a,o){var d={};return d[a.toLowerCase()]=o.toLowerCase(),d["Webkit"+a]="webkit"+o,d["Moz"+a]="moz"+o,d}var _l={animationend:to("Animation","AnimationEnd"),animationiteration:to("Animation","AnimationIteration"),animationstart:to("Animation","AnimationStart"),transitionrun:to("Transition","TransitionRun"),transitionstart:to("Transition","TransitionStart"),transitioncancel:to("Transition","TransitionCancel"),transitionend:to("Transition","TransitionEnd")},sy={},tC={};oa&&(tC=document.createElement("div").style,"AnimationEvent"in window||(delete _l.animationend.animation,delete _l.animationiteration.animation,delete _l.animationstart.animation),"TransitionEvent"in window||delete _l.transitionend.transition);function no(a){if(sy[a])return sy[a];if(!_l[a])return a;var o=_l[a],d;for(d in o)if(o.hasOwnProperty(d)&&d in tC)return sy[a]=o[d];return a}var nC=no("animationend"),rC=no("animationiteration"),iC=no("animationstart"),WU=no("transitionrun"),QU=no("transitionstart"),XU=no("transitioncancel"),aC=no("transitionend"),sC=new Map,oy="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(" ");oy.push("scrollEnd");function hi(a,o){sC.set(a,o),mn(o,[a])}var Yf=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},Lr=[],kl=0,ly=0;function Wf(){for(var a=kl,o=ly=kl=0;o<a;){var d=Lr[o];Lr[o++]=null;var m=Lr[o];Lr[o++]=null;var b=Lr[o];Lr[o++]=null;var j=Lr[o];if(Lr[o++]=null,m!==null&&b!==null){var _=m.pending;_===null?b.next=b:(b.next=_.next,_.next=b),m.pending=b}j!==0&&oC(d,b,j)}}function Qf(a,o,d,m){Lr[kl++]=a,Lr[kl++]=o,Lr[kl++]=d,Lr[kl++]=m,ly|=m,a.lanes|=m,a=a.alternate,a!==null&&(a.lanes|=m)}function cy(a,o,d,m){return Qf(a,o,d,m),Xf(a)}function ro(a,o){return Qf(a,null,null,o),Xf(a)}function oC(a,o,d){a.lanes|=d;var m=a.alternate;m!==null&&(m.lanes|=d);for(var b=!1,j=a.return;j!==null;)j.childLanes|=d,m=j.alternate,m!==null&&(m.childLanes|=d),j.tag===22&&(a=j.stateNode,a===null||a._visibility&1||(b=!0)),a=j,j=j.return;return a.tag===3?(j=a.stateNode,b&&o!==null&&(b=31-be(d),a=j.hiddenUpdates,m=a[b],m===null?a[b]=[o]:m.push(o),o.lane=d|536870912),j):null}function Xf(a){if(50<Ku)throw Ku=0,y0=null,Error(r(185));for(var o=a.return;o!==null;)a=o,o=a.return;return a.tag===3?a.stateNode:null}var Al={};function JU(a,o,d,m){this.tag=a,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nr(a,o,d,m){return new JU(a,o,d,m)}function uy(a){return a=a.prototype,!(!a||!a.isReactComponent)}function la(a,o){var d=a.alternate;return d===null?(d=Nr(a.tag,o,a.key,a.mode),d.elementType=a.elementType,d.type=a.type,d.stateNode=a.stateNode,d.alternate=a,a.alternate=d):(d.pendingProps=o,d.type=a.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=a.flags&65011712,d.childLanes=a.childLanes,d.lanes=a.lanes,d.child=a.child,d.memoizedProps=a.memoizedProps,d.memoizedState=a.memoizedState,d.updateQueue=a.updateQueue,o=a.dependencies,d.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},d.sibling=a.sibling,d.index=a.index,d.ref=a.ref,d.refCleanup=a.refCleanup,d}function lC(a,o){a.flags&=65011714;var d=a.alternate;return d===null?(a.childLanes=0,a.lanes=o,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=d.childLanes,a.lanes=d.lanes,a.child=d.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=d.memoizedProps,a.memoizedState=d.memoizedState,a.updateQueue=d.updateQueue,a.type=d.type,o=d.dependencies,a.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),a}function Jf(a,o,d,m,b,j){var _=0;if(m=a,typeof a=="function")uy(a)&&(_=1);else if(typeof a=="string")_=iB(a,d,W.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case R:return a=Nr(31,d,o,b),a.elementType=R,a.lanes=j,a;case S:return io(d.children,b,j,o);case N:_=8,b|=24;break;case C:return a=Nr(12,d,o,b|2),a.elementType=C,a.lanes=j,a;case T:return a=Nr(13,d,o,b),a.elementType=T,a.lanes=j,a;case P:return a=Nr(19,d,o,b),a.elementType=P,a.lanes=j,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case k:_=10;break e;case E:_=9;break e;case O:_=11;break e;case A:_=14;break e;case z:_=16,m=null;break e}_=29,d=Error(r(130,a===null?"null":typeof a,"")),m=null}return o=Nr(_,d,o,b),o.elementType=a,o.type=m,o.lanes=j,o}function io(a,o,d,m){return a=Nr(7,a,m,o),a.lanes=d,a}function dy(a,o,d){return a=Nr(6,a,null,o),a.lanes=d,a}function cC(a){var o=Nr(18,null,null,0);return o.stateNode=a,o}function fy(a,o,d){return o=Nr(4,a.children!==null?a.children:[],a.key,o),o.lanes=d,o.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},o}var uC=new WeakMap;function $r(a,o){if(typeof a=="object"&&a!==null){var d=uC.get(a);return d!==void 0?d:(o={value:a,source:o,stack:pn(o)},uC.set(a,o),o)}return{value:a,source:o,stack:pn(o)}}var El=[],Tl=0,eh=null,ju=0,Ur=[],Br=0,Ya=null,Ri=1,Di="";function ca(a,o){El[Tl++]=ju,El[Tl++]=eh,eh=a,ju=o}function dC(a,o,d){Ur[Br++]=Ri,Ur[Br++]=Di,Ur[Br++]=Ya,Ya=a;var m=Ri;a=Di;var b=32-be(m)-1;m&=~(1<<b),d+=1;var j=32-be(o)+b;if(30<j){var _=b-b%5;j=(m&(1<<_)-1).toString(32),m>>=_,b-=_,Ri=1<<32-be(o)+b|d<<b|m,Di=j+a}else Ri=1<<j|d<<b|m,Di=a}function hy(a){a.return!==null&&(ca(a,1),dC(a,1,0))}function py(a){for(;a===eh;)eh=El[--Tl],El[Tl]=null,ju=El[--Tl],El[Tl]=null;for(;a===Ya;)Ya=Ur[--Br],Ur[Br]=null,Di=Ur[--Br],Ur[Br]=null,Ri=Ur[--Br],Ur[Br]=null}function fC(a,o){Ur[Br++]=Ri,Ur[Br++]=Di,Ur[Br++]=Ya,Ri=o.id,Di=o.overflow,Ya=a}var En=null,_t=null,rt=!1,Wa=null,qr=!1,my=Error(r(519));function Qa(a){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Nu($r(o,a)),my}function hC(a){var o=a.stateNode,d=a.type,m=a.memoizedProps;switch(o[zt]=a,o[Zt]=m,d){case"dialog":We("cancel",o),We("close",o);break;case"iframe":case"object":case"embed":We("load",o);break;case"video":case"audio":for(d=0;d<Gu.length;d++)We(Gu[d],o);break;case"source":We("error",o);break;case"img":case"image":case"link":We("error",o),We("load",o);break;case"details":We("toggle",o);break;case"input":We("invalid",o),ON(o,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":We("invalid",o);break;case"textarea":We("invalid",o),kN(o,m.value,m.defaultValue,m.children)}d=m.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||o.textContent===""+d||m.suppressHydrationWarning===!0||E_(o.textContent,d)?(m.popover!=null&&(We("beforetoggle",o),We("toggle",o)),m.onScroll!=null&&We("scroll",o),m.onScrollEnd!=null&&We("scrollend",o),m.onClick!=null&&(o.onclick=sa),o=!0):o=!1,o||Qa(a,!0)}function pC(a){for(En=a.return;En;)switch(En.tag){case 5:case 31:case 13:qr=!1;return;case 27:case 3:qr=!0;return;default:En=En.return}}function Pl(a){if(a!==En)return!1;if(!rt)return pC(a),rt=!0,!1;var o=a.tag,d;if((d=o!==3&&o!==27)&&((d=o===5)&&(d=a.type,d=!(d!=="form"&&d!=="button")||z0(a.type,a.memoizedProps)),d=!d),d&&_t&&Qa(a),pC(a),o===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));_t=$_(a)}else if(o===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));_t=$_(a)}else o===27?(o=_t,ds(a.type)?(a=L0,L0=null,_t=a):_t=o):_t=En?Kr(a.stateNode.nextSibling):null;return!0}function ao(){_t=En=null,rt=!1}function gy(){var a=Wa;return a!==null&&(pr===null?pr=a:pr.push.apply(pr,a),Wa=null),a}function Nu(a){Wa===null?Wa=[a]:Wa.push(a)}var vy=D(null),so=null,ua=null;function Xa(a,o,d){oe(vy,o._currentValue),o._currentValue=d}function da(a){a._currentValue=vy.current,G(vy)}function yy(a,o,d){for(;a!==null;){var m=a.alternate;if((a.childLanes&o)!==o?(a.childLanes|=o,m!==null&&(m.childLanes|=o)):m!==null&&(m.childLanes&o)!==o&&(m.childLanes|=o),a===d)break;a=a.return}}function by(a,o,d,m){var b=a.child;for(b!==null&&(b.return=a);b!==null;){var j=b.dependencies;if(j!==null){var _=b.child;j=j.firstContext;e:for(;j!==null;){var M=j;j=b;for(var $=0;$<o.length;$++)if(M.context===o[$]){j.lanes|=d,M=j.alternate,M!==null&&(M.lanes|=d),yy(j.return,d,a),m||(_=null);break e}j=M.next}}else if(b.tag===18){if(_=b.return,_===null)throw Error(r(341));_.lanes|=d,j=_.alternate,j!==null&&(j.lanes|=d),yy(_,d,a),_=null}else _=b.child;if(_!==null)_.return=b;else for(_=b;_!==null;){if(_===a){_=null;break}if(b=_.sibling,b!==null){b.return=_.return,_=b;break}_=_.return}b=_}}function zl(a,o,d,m){a=null;for(var b=o,j=!1;b!==null;){if(!j){if((b.flags&524288)!==0)j=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var _=b.alternate;if(_===null)throw Error(r(387));if(_=_.memoizedProps,_!==null){var M=b.type;jr(b.pendingProps.value,_.value)||(a!==null?a.push(M):a=[M])}}else if(b===de.current){if(_=b.alternate,_===null)throw Error(r(387));_.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(a!==null?a.push(Qu):a=[Qu])}b=b.return}a!==null&&by(o,a,d,m),o.flags|=262144}function th(a){for(a=a.firstContext;a!==null;){if(!jr(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function oo(a){so=a,ua=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function Tn(a){return mC(so,a)}function nh(a,o){return so===null&&oo(a),mC(a,o)}function mC(a,o){var d=o._currentValue;if(o={context:o,memoizedValue:d,next:null},ua===null){if(a===null)throw Error(r(308));ua=o,a.dependencies={lanes:0,firstContext:o},a.flags|=524288}else ua=ua.next=o;return d}var e6=typeof AbortController<"u"?AbortController:function(){var a=[],o=this.signal={aborted:!1,addEventListener:function(d,m){a.push(m)}};this.abort=function(){o.aborted=!0,a.forEach(function(d){return d()})}},t6=e.unstable_scheduleCallback,n6=e.unstable_NormalPriority,ln={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function xy(){return{controller:new e6,data:new Map,refCount:0}}function Cu(a){a.refCount--,a.refCount===0&&t6(n6,function(){a.controller.abort()})}var Ou=null,wy=0,Ml=0,Rl=null;function r6(a,o){if(Ou===null){var d=Ou=[];wy=0,Ml=N0(),Rl={status:"pending",value:void 0,then:function(m){d.push(m)}}}return wy++,o.then(gC,gC),o}function gC(){if(--wy===0&&Ou!==null){Rl!==null&&(Rl.status="fulfilled");var a=Ou;Ou=null,Ml=0,Rl=null;for(var o=0;o<a.length;o++)(0,a[o])()}}function i6(a,o){var d=[],m={status:"pending",value:null,reason:null,then:function(b){d.push(b)}};return a.then(function(){m.status="fulfilled",m.value=o;for(var b=0;b<d.length;b++)(0,d[b])(o)},function(b){for(m.status="rejected",m.reason=b,b=0;b<d.length;b++)(0,d[b])(void 0)}),m}var vC=V.S;V.S=function(a,o){e_=st(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&r6(a,o),vC!==null&&vC(a,o)};var lo=D(null);function Sy(){var a=lo.current;return a!==null?a:jt.pooledCache}function rh(a,o){o===null?oe(lo,lo.current):oe(lo,o.pool)}function yC(){var a=Sy();return a===null?null:{parent:ln._currentValue,pool:a}}var Dl=Error(r(460)),jy=Error(r(474)),ih=Error(r(542)),ah={then:function(){}};function bC(a){return a=a.status,a==="fulfilled"||a==="rejected"}function xC(a,o,d){switch(d=a[d],d===void 0?a.push(o):d!==o&&(o.then(sa,sa),o=d),o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,SC(a),a;default:if(typeof o.status=="string")o.then(sa,sa);else{if(a=jt,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=o,a.status="pending",a.then(function(m){if(o.status==="pending"){var b=o;b.status="fulfilled",b.value=m}},function(m){if(o.status==="pending"){var b=o;b.status="rejected",b.reason=m}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,SC(a),a}throw uo=o,Dl}}function co(a){try{var o=a._init;return o(a._payload)}catch(d){throw d!==null&&typeof d=="object"&&typeof d.then=="function"?(uo=d,Dl):d}}var uo=null;function wC(){if(uo===null)throw Error(r(459));var a=uo;return uo=null,a}function SC(a){if(a===Dl||a===ih)throw Error(r(483))}var Il=null,_u=0;function sh(a){var o=_u;return _u+=1,Il===null&&(Il=[]),xC(Il,a,o)}function ku(a,o){o=o.props.ref,a.ref=o!==void 0?o:null}function oh(a,o){throw o.$$typeof===v?Error(r(525)):(a=Object.prototype.toString.call(o),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":a)))}function jC(a){function o(Y,H){if(a){var J=Y.deletions;J===null?(Y.deletions=[H],Y.flags|=16):J.push(H)}}function d(Y,H){if(!a)return null;for(;H!==null;)o(Y,H),H=H.sibling;return null}function m(Y){for(var H=new Map;Y!==null;)Y.key!==null?H.set(Y.key,Y):H.set(Y.index,Y),Y=Y.sibling;return H}function b(Y,H){return Y=la(Y,H),Y.index=0,Y.sibling=null,Y}function j(Y,H,J){return Y.index=J,a?(J=Y.alternate,J!==null?(J=J.index,J<H?(Y.flags|=67108866,H):J):(Y.flags|=67108866,H)):(Y.flags|=1048576,H)}function _(Y){return a&&Y.alternate===null&&(Y.flags|=67108866),Y}function M(Y,H,J,ce){return H===null||H.tag!==6?(H=dy(J,Y.mode,ce),H.return=Y,H):(H=b(H,J),H.return=Y,H)}function $(Y,H,J,ce){var Ie=J.type;return Ie===S?se(Y,H,J.props.children,ce,J.key):H!==null&&(H.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===z&&co(Ie)===H.type)?(H=b(H,J.props),ku(H,J),H.return=Y,H):(H=Jf(J.type,J.key,J.props,null,Y.mode,ce),ku(H,J),H.return=Y,H)}function ee(Y,H,J,ce){return H===null||H.tag!==4||H.stateNode.containerInfo!==J.containerInfo||H.stateNode.implementation!==J.implementation?(H=fy(J,Y.mode,ce),H.return=Y,H):(H=b(H,J.children||[]),H.return=Y,H)}function se(Y,H,J,ce,Ie){return H===null||H.tag!==7?(H=io(J,Y.mode,ce,Ie),H.return=Y,H):(H=b(H,J),H.return=Y,H)}function fe(Y,H,J){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=dy(""+H,Y.mode,J),H.return=Y,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case y:return J=Jf(H.type,H.key,H.props,null,Y.mode,J),ku(J,H),J.return=Y,J;case w:return H=fy(H,Y.mode,J),H.return=Y,H;case z:return H=co(H),fe(Y,H,J)}if(ge(H)||L(H))return H=io(H,Y.mode,J,null),H.return=Y,H;if(typeof H.then=="function")return fe(Y,sh(H),J);if(H.$$typeof===k)return fe(Y,nh(Y,H),J);oh(Y,H)}return null}function te(Y,H,J,ce){var Ie=H!==null?H.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return Ie!==null?null:M(Y,H,""+J,ce);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case y:return J.key===Ie?$(Y,H,J,ce):null;case w:return J.key===Ie?ee(Y,H,J,ce):null;case z:return J=co(J),te(Y,H,J,ce)}if(ge(J)||L(J))return Ie!==null?null:se(Y,H,J,ce,null);if(typeof J.then=="function")return te(Y,H,sh(J),ce);if(J.$$typeof===k)return te(Y,H,nh(Y,J),ce);oh(Y,J)}return null}function ie(Y,H,J,ce,Ie){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return Y=Y.get(J)||null,M(H,Y,""+ce,Ie);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case y:return Y=Y.get(ce.key===null?J:ce.key)||null,$(H,Y,ce,Ie);case w:return Y=Y.get(ce.key===null?J:ce.key)||null,ee(H,Y,ce,Ie);case z:return ce=co(ce),ie(Y,H,J,ce,Ie)}if(ge(ce)||L(ce))return Y=Y.get(J)||null,se(H,Y,ce,Ie,null);if(typeof ce.then=="function")return ie(Y,H,J,sh(ce),Ie);if(ce.$$typeof===k)return ie(Y,H,J,nh(H,ce),Ie);oh(H,ce)}return null}function ke(Y,H,J,ce){for(var Ie=null,ot=null,ze=H,Ge=H=0,tt=null;ze!==null&&Ge<J.length;Ge++){ze.index>Ge?(tt=ze,ze=null):tt=ze.sibling;var lt=te(Y,ze,J[Ge],ce);if(lt===null){ze===null&&(ze=tt);break}a&&ze&&lt.alternate===null&&o(Y,ze),H=j(lt,H,Ge),ot===null?Ie=lt:ot.sibling=lt,ot=lt,ze=tt}if(Ge===J.length)return d(Y,ze),rt&&ca(Y,Ge),Ie;if(ze===null){for(;Ge<J.length;Ge++)ze=fe(Y,J[Ge],ce),ze!==null&&(H=j(ze,H,Ge),ot===null?Ie=ze:ot.sibling=ze,ot=ze);return rt&&ca(Y,Ge),Ie}for(ze=m(ze);Ge<J.length;Ge++)tt=ie(ze,Y,Ge,J[Ge],ce),tt!==null&&(a&&tt.alternate!==null&&ze.delete(tt.key===null?Ge:tt.key),H=j(tt,H,Ge),ot===null?Ie=tt:ot.sibling=tt,ot=tt);return a&&ze.forEach(function(gs){return o(Y,gs)}),rt&&ca(Y,Ge),Ie}function Le(Y,H,J,ce){if(J==null)throw Error(r(151));for(var Ie=null,ot=null,ze=H,Ge=H=0,tt=null,lt=J.next();ze!==null&&!lt.done;Ge++,lt=J.next()){ze.index>Ge?(tt=ze,ze=null):tt=ze.sibling;var gs=te(Y,ze,lt.value,ce);if(gs===null){ze===null&&(ze=tt);break}a&&ze&&gs.alternate===null&&o(Y,ze),H=j(gs,H,Ge),ot===null?Ie=gs:ot.sibling=gs,ot=gs,ze=tt}if(lt.done)return d(Y,ze),rt&&ca(Y,Ge),Ie;if(ze===null){for(;!lt.done;Ge++,lt=J.next())lt=fe(Y,lt.value,ce),lt!==null&&(H=j(lt,H,Ge),ot===null?Ie=lt:ot.sibling=lt,ot=lt);return rt&&ca(Y,Ge),Ie}for(ze=m(ze);!lt.done;Ge++,lt=J.next())lt=ie(ze,Y,Ge,lt.value,ce),lt!==null&&(a&&lt.alternate!==null&&ze.delete(lt.key===null?Ge:lt.key),H=j(lt,H,Ge),ot===null?Ie=lt:ot.sibling=lt,ot=lt);return a&&ze.forEach(function(mB){return o(Y,mB)}),rt&&ca(Y,Ge),Ie}function wt(Y,H,J,ce){if(typeof J=="object"&&J!==null&&J.type===S&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case y:e:{for(var Ie=J.key;H!==null;){if(H.key===Ie){if(Ie=J.type,Ie===S){if(H.tag===7){d(Y,H.sibling),ce=b(H,J.props.children),ce.return=Y,Y=ce;break e}}else if(H.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===z&&co(Ie)===H.type){d(Y,H.sibling),ce=b(H,J.props),ku(ce,J),ce.return=Y,Y=ce;break e}d(Y,H);break}else o(Y,H);H=H.sibling}J.type===S?(ce=io(J.props.children,Y.mode,ce,J.key),ce.return=Y,Y=ce):(ce=Jf(J.type,J.key,J.props,null,Y.mode,ce),ku(ce,J),ce.return=Y,Y=ce)}return _(Y);case w:e:{for(Ie=J.key;H!==null;){if(H.key===Ie)if(H.tag===4&&H.stateNode.containerInfo===J.containerInfo&&H.stateNode.implementation===J.implementation){d(Y,H.sibling),ce=b(H,J.children||[]),ce.return=Y,Y=ce;break e}else{d(Y,H);break}else o(Y,H);H=H.sibling}ce=fy(J,Y.mode,ce),ce.return=Y,Y=ce}return _(Y);case z:return J=co(J),wt(Y,H,J,ce)}if(ge(J))return ke(Y,H,J,ce);if(L(J)){if(Ie=L(J),typeof Ie!="function")throw Error(r(150));return J=Ie.call(J),Le(Y,H,J,ce)}if(typeof J.then=="function")return wt(Y,H,sh(J),ce);if(J.$$typeof===k)return wt(Y,H,nh(Y,J),ce);oh(Y,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,H!==null&&H.tag===6?(d(Y,H.sibling),ce=b(H,J),ce.return=Y,Y=ce):(d(Y,H),ce=dy(J,Y.mode,ce),ce.return=Y,Y=ce),_(Y)):d(Y,H)}return function(Y,H,J,ce){try{_u=0;var Ie=wt(Y,H,J,ce);return Il=null,Ie}catch(ze){if(ze===Dl||ze===ih)throw ze;var ot=Nr(29,ze,null,Y.mode);return ot.lanes=ce,ot.return=Y,ot}}}var fo=jC(!0),NC=jC(!1),Ja=!1;function Ny(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Cy(a,o){a=a.updateQueue,o.updateQueue===a&&(o.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function es(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function ts(a,o,d){var m=a.updateQueue;if(m===null)return null;if(m=m.shared,(dt&2)!==0){var b=m.pending;return b===null?o.next=o:(o.next=b.next,b.next=o),m.pending=o,o=Xf(a),oC(a,null,d),o}return Qf(a,m,o,d),Xf(a)}function Au(a,o,d){if(o=o.updateQueue,o!==null&&(o=o.shared,(d&4194048)!==0)){var m=o.lanes;m&=a.pendingLanes,d|=m,o.lanes=d,Lf(a,d)}}function Oy(a,o){var d=a.updateQueue,m=a.alternate;if(m!==null&&(m=m.updateQueue,d===m)){var b=null,j=null;if(d=d.firstBaseUpdate,d!==null){do{var _={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};j===null?b=j=_:j=j.next=_,d=d.next}while(d!==null);j===null?b=j=o:j=j.next=o}else b=j=o;d={baseState:m.baseState,firstBaseUpdate:b,lastBaseUpdate:j,shared:m.shared,callbacks:m.callbacks},a.updateQueue=d;return}a=d.lastBaseUpdate,a===null?d.firstBaseUpdate=o:a.next=o,d.lastBaseUpdate=o}var _y=!1;function Eu(){if(_y){var a=Rl;if(a!==null)throw a}}function Tu(a,o,d,m){_y=!1;var b=a.updateQueue;Ja=!1;var j=b.firstBaseUpdate,_=b.lastBaseUpdate,M=b.shared.pending;if(M!==null){b.shared.pending=null;var $=M,ee=$.next;$.next=null,_===null?j=ee:_.next=ee,_=$;var se=a.alternate;se!==null&&(se=se.updateQueue,M=se.lastBaseUpdate,M!==_&&(M===null?se.firstBaseUpdate=ee:M.next=ee,se.lastBaseUpdate=$))}if(j!==null){var fe=b.baseState;_=0,se=ee=$=null,M=j;do{var te=M.lane&-536870913,ie=te!==M.lane;if(ie?(et&te)===te:(m&te)===te){te!==0&&te===Ml&&(_y=!0),se!==null&&(se=se.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var ke=a,Le=M;te=o;var wt=d;switch(Le.tag){case 1:if(ke=Le.payload,typeof ke=="function"){fe=ke.call(wt,fe,te);break e}fe=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=Le.payload,te=typeof ke=="function"?ke.call(wt,fe,te):ke,te==null)break e;fe=g({},fe,te);break e;case 2:Ja=!0}}te=M.callback,te!==null&&(a.flags|=64,ie&&(a.flags|=8192),ie=b.callbacks,ie===null?b.callbacks=[te]:ie.push(te))}else ie={lane:te,tag:M.tag,payload:M.payload,callback:M.callback,next:null},se===null?(ee=se=ie,$=fe):se=se.next=ie,_|=te;if(M=M.next,M===null){if(M=b.shared.pending,M===null)break;ie=M,M=ie.next,ie.next=null,b.lastBaseUpdate=ie,b.shared.pending=null}}while(!0);se===null&&($=fe),b.baseState=$,b.firstBaseUpdate=ee,b.lastBaseUpdate=se,j===null&&(b.shared.lanes=0),ss|=_,a.lanes=_,a.memoizedState=fe}}function CC(a,o){if(typeof a!="function")throw Error(r(191,a));a.call(o)}function OC(a,o){var d=a.callbacks;if(d!==null)for(a.callbacks=null,a=0;a<d.length;a++)CC(d[a],o)}var Ll=D(null),lh=D(0);function _C(a,o){a=xa,oe(lh,a),oe(Ll,o),xa=a|o.baseLanes}function ky(){oe(lh,xa),oe(Ll,Ll.current)}function Ay(){xa=lh.current,G(Ll),G(lh)}var Cr=D(null),Fr=null;function ns(a){var o=a.alternate;oe(en,en.current&1),oe(Cr,a),Fr===null&&(o===null||Ll.current!==null||o.memoizedState!==null)&&(Fr=a)}function Ey(a){oe(en,en.current),oe(Cr,a),Fr===null&&(Fr=a)}function kC(a){a.tag===22?(oe(en,en.current),oe(Cr,a),Fr===null&&(Fr=a)):rs()}function rs(){oe(en,en.current),oe(Cr,Cr.current)}function Or(a){G(Cr),Fr===a&&(Fr=null),G(en)}var en=D(0);function ch(a){for(var o=a;o!==null;){if(o.tag===13){var d=o.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||D0(d)||I0(d)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var fa=0,Ke=null,bt=null,cn=null,uh=!1,$l=!1,ho=!1,dh=0,Pu=0,Ul=null,a6=0;function Yt(){throw Error(r(321))}function Ty(a,o){if(o===null)return!1;for(var d=0;d<o.length&&d<a.length;d++)if(!jr(a[d],o[d]))return!1;return!0}function Py(a,o,d,m,b,j){return fa=j,Ke=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,V.H=a===null||a.memoizedState===null?dO:Vy,ho=!1,j=d(m,b),ho=!1,$l&&(j=EC(o,d,m,b)),AC(a),j}function AC(a){V.H=Ru;var o=bt!==null&&bt.next!==null;if(fa=0,cn=bt=Ke=null,uh=!1,Pu=0,Ul=null,o)throw Error(r(300));a===null||un||(a=a.dependencies,a!==null&&th(a)&&(un=!0))}function EC(a,o,d,m){Ke=a;var b=0;do{if($l&&(Ul=null),Pu=0,$l=!1,25<=b)throw Error(r(301));if(b+=1,cn=bt=null,a.updateQueue!=null){var j=a.updateQueue;j.lastEffect=null,j.events=null,j.stores=null,j.memoCache!=null&&(j.memoCache.index=0)}V.H=fO,j=o(d,m)}while($l);return j}function s6(){var a=V.H,o=a.useState()[0];return o=typeof o.then=="function"?zu(o):o,a=a.useState()[0],(bt!==null?bt.memoizedState:null)!==a&&(Ke.flags|=1024),o}function zy(){var a=dh!==0;return dh=0,a}function My(a,o,d){o.updateQueue=a.updateQueue,o.flags&=-2053,a.lanes&=~d}function Ry(a){if(uh){for(a=a.memoizedState;a!==null;){var o=a.queue;o!==null&&(o.pending=null),a=a.next}uh=!1}fa=0,cn=bt=Ke=null,$l=!1,Pu=dh=0,Ul=null}function Xn(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return cn===null?Ke.memoizedState=cn=a:cn=cn.next=a,cn}function tn(){if(bt===null){var a=Ke.alternate;a=a!==null?a.memoizedState:null}else a=bt.next;var o=cn===null?Ke.memoizedState:cn.next;if(o!==null)cn=o,bt=a;else{if(a===null)throw Ke.alternate===null?Error(r(467)):Error(r(310));bt=a,a={memoizedState:bt.memoizedState,baseState:bt.baseState,baseQueue:bt.baseQueue,queue:bt.queue,next:null},cn===null?Ke.memoizedState=cn=a:cn=cn.next=a}return cn}function fh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function zu(a){var o=Pu;return Pu+=1,Ul===null&&(Ul=[]),a=xC(Ul,a,o),o=Ke,(cn===null?o.memoizedState:cn.next)===null&&(o=o.alternate,V.H=o===null||o.memoizedState===null?dO:Vy),a}function hh(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return zu(a);if(a.$$typeof===k)return Tn(a)}throw Error(r(438,String(a)))}function Dy(a){var o=null,d=Ke.updateQueue;if(d!==null&&(o=d.memoCache),o==null){var m=Ke.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(o={data:m.data.map(function(b){return b.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),d===null&&(d=fh(),Ke.updateQueue=d),d.memoCache=o,d=o.data[o.index],d===void 0)for(d=o.data[o.index]=Array(a),m=0;m<a;m++)d[m]=q;return o.index++,d}function ha(a,o){return typeof o=="function"?o(a):o}function ph(a){var o=tn();return Iy(o,bt,a)}function Iy(a,o,d){var m=a.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=d;var b=a.baseQueue,j=m.pending;if(j!==null){if(b!==null){var _=b.next;b.next=j.next,j.next=_}o.baseQueue=b=j,m.pending=null}if(j=a.baseState,b===null)a.memoizedState=j;else{o=b.next;var M=_=null,$=null,ee=o,se=!1;do{var fe=ee.lane&-536870913;if(fe!==ee.lane?(et&fe)===fe:(fa&fe)===fe){var te=ee.revertLane;if(te===0)$!==null&&($=$.next={lane:0,revertLane:0,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),fe===Ml&&(se=!0);else if((fa&te)===te){ee=ee.next,te===Ml&&(se=!0);continue}else fe={lane:0,revertLane:ee.revertLane,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},$===null?(M=$=fe,_=j):$=$.next=fe,Ke.lanes|=te,ss|=te;fe=ee.action,ho&&d(j,fe),j=ee.hasEagerState?ee.eagerState:d(j,fe)}else te={lane:fe,revertLane:ee.revertLane,gesture:ee.gesture,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},$===null?(M=$=te,_=j):$=$.next=te,Ke.lanes|=fe,ss|=fe;ee=ee.next}while(ee!==null&&ee!==o);if($===null?_=j:$.next=M,!jr(j,a.memoizedState)&&(un=!0,se&&(d=Rl,d!==null)))throw d;a.memoizedState=j,a.baseState=_,a.baseQueue=$,m.lastRenderedState=j}return b===null&&(m.lanes=0),[a.memoizedState,m.dispatch]}function Ly(a){var o=tn(),d=o.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=a;var m=d.dispatch,b=d.pending,j=o.memoizedState;if(b!==null){d.pending=null;var _=b=b.next;do j=a(j,_.action),_=_.next;while(_!==b);jr(j,o.memoizedState)||(un=!0),o.memoizedState=j,o.baseQueue===null&&(o.baseState=j),d.lastRenderedState=j}return[j,m]}function TC(a,o,d){var m=Ke,b=tn(),j=rt;if(j){if(d===void 0)throw Error(r(407));d=d()}else d=o();var _=!jr((bt||b).memoizedState,d);if(_&&(b.memoizedState=d,un=!0),b=b.queue,By(MC.bind(null,m,b,a),[a]),b.getSnapshot!==o||_||cn!==null&&cn.memoizedState.tag&1){if(m.flags|=2048,Bl(9,{destroy:void 0},zC.bind(null,m,b,d,o),null),jt===null)throw Error(r(349));j||(fa&127)!==0||PC(m,o,d)}return d}function PC(a,o,d){a.flags|=16384,a={getSnapshot:o,value:d},o=Ke.updateQueue,o===null?(o=fh(),Ke.updateQueue=o,o.stores=[a]):(d=o.stores,d===null?o.stores=[a]:d.push(a))}function zC(a,o,d,m){o.value=d,o.getSnapshot=m,RC(o)&&DC(a)}function MC(a,o,d){return d(function(){RC(o)&&DC(a)})}function RC(a){var o=a.getSnapshot;a=a.value;try{var d=o();return!jr(a,d)}catch{return!0}}function DC(a){var o=ro(a,2);o!==null&&mr(o,a,2)}function $y(a){var o=Xn();if(typeof a=="function"){var d=a;if(a=d(),ho){Rr(!0);try{d()}finally{Rr(!1)}}}return o.memoizedState=o.baseState=a,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ha,lastRenderedState:a},o}function IC(a,o,d,m){return a.baseState=d,Iy(a,bt,typeof m=="function"?m:ha)}function o6(a,o,d,m,b){if(vh(a))throw Error(r(485));if(a=o.action,a!==null){var j={payload:b,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){j.listeners.push(_)}};V.T!==null?d(!0):j.isTransition=!1,m(j),d=o.pending,d===null?(j.next=o.pending=j,LC(o,j)):(j.next=d.next,o.pending=d.next=j)}}function LC(a,o){var d=o.action,m=o.payload,b=a.state;if(o.isTransition){var j=V.T,_={};V.T=_;try{var M=d(b,m),$=V.S;$!==null&&$(_,M),$C(a,o,M)}catch(ee){Uy(a,o,ee)}finally{j!==null&&_.types!==null&&(j.types=_.types),V.T=j}}else try{j=d(b,m),$C(a,o,j)}catch(ee){Uy(a,o,ee)}}function $C(a,o,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(m){UC(a,o,m)},function(m){return Uy(a,o,m)}):UC(a,o,d)}function UC(a,o,d){o.status="fulfilled",o.value=d,BC(o),a.state=d,o=a.pending,o!==null&&(d=o.next,d===o?a.pending=null:(d=d.next,o.next=d,LC(a,d)))}function Uy(a,o,d){var m=a.pending;if(a.pending=null,m!==null){m=m.next;do o.status="rejected",o.reason=d,BC(o),o=o.next;while(o!==m)}a.action=null}function BC(a){a=a.listeners;for(var o=0;o<a.length;o++)(0,a[o])()}function qC(a,o){return o}function FC(a,o){if(rt){var d=jt.formState;if(d!==null){e:{var m=Ke;if(rt){if(_t){t:{for(var b=_t,j=qr;b.nodeType!==8;){if(!j){b=null;break t}if(b=Kr(b.nextSibling),b===null){b=null;break t}}j=b.data,b=j==="F!"||j==="F"?b:null}if(b){_t=Kr(b.nextSibling),m=b.data==="F!";break e}}Qa(m)}m=!1}m&&(o=d[0])}}return d=Xn(),d.memoizedState=d.baseState=o,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qC,lastRenderedState:o},d.queue=m,d=lO.bind(null,Ke,m),m.dispatch=d,m=$y(!1),j=Gy.bind(null,Ke,!1,m.queue),m=Xn(),b={state:o,dispatch:null,action:a,pending:null},m.queue=b,d=o6.bind(null,Ke,b,j,d),b.dispatch=d,m.memoizedState=a,[o,d,!1]}function KC(a){var o=tn();return HC(o,bt,a)}function HC(a,o,d){if(o=Iy(a,o,qC)[0],a=ph(ha)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var m=zu(o)}catch(_){throw _===Dl?ih:_}else m=o;o=tn();var b=o.queue,j=b.dispatch;return d!==o.memoizedState&&(Ke.flags|=2048,Bl(9,{destroy:void 0},l6.bind(null,b,d),null)),[m,j,a]}function l6(a,o){a.action=o}function GC(a){var o=tn(),d=bt;if(d!==null)return HC(o,d,a);tn(),o=o.memoizedState,d=tn();var m=d.queue.dispatch;return d.memoizedState=a,[o,m,!1]}function Bl(a,o,d,m){return a={tag:a,create:d,deps:m,inst:o,next:null},o=Ke.updateQueue,o===null&&(o=fh(),Ke.updateQueue=o),d=o.lastEffect,d===null?o.lastEffect=a.next=a:(m=d.next,d.next=a,a.next=m,o.lastEffect=a),a}function VC(){return tn().memoizedState}function mh(a,o,d,m){var b=Xn();Ke.flags|=a,b.memoizedState=Bl(1|o,{destroy:void 0},d,m===void 0?null:m)}function gh(a,o,d,m){var b=tn();m=m===void 0?null:m;var j=b.memoizedState.inst;bt!==null&&m!==null&&Ty(m,bt.memoizedState.deps)?b.memoizedState=Bl(o,j,d,m):(Ke.flags|=a,b.memoizedState=Bl(1|o,j,d,m))}function ZC(a,o){mh(8390656,8,a,o)}function By(a,o){gh(2048,8,a,o)}function c6(a){Ke.flags|=4;var o=Ke.updateQueue;if(o===null)o=fh(),Ke.updateQueue=o,o.events=[a];else{var d=o.events;d===null?o.events=[a]:d.push(a)}}function YC(a){var o=tn().memoizedState;return c6({ref:o,nextImpl:a}),function(){if((dt&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function WC(a,o){return gh(4,2,a,o)}function QC(a,o){return gh(4,4,a,o)}function XC(a,o){if(typeof o=="function"){a=a();var d=o(a);return function(){typeof d=="function"?d():o(null)}}if(o!=null)return a=a(),o.current=a,function(){o.current=null}}function JC(a,o,d){d=d!=null?d.concat([a]):null,gh(4,4,XC.bind(null,o,a),d)}function qy(){}function eO(a,o){var d=tn();o=o===void 0?null:o;var m=d.memoizedState;return o!==null&&Ty(o,m[1])?m[0]:(d.memoizedState=[a,o],a)}function tO(a,o){var d=tn();o=o===void 0?null:o;var m=d.memoizedState;if(o!==null&&Ty(o,m[1]))return m[0];if(m=a(),ho){Rr(!0);try{a()}finally{Rr(!1)}}return d.memoizedState=[m,o],m}function Fy(a,o,d){return d===void 0||(fa&1073741824)!==0&&(et&261930)===0?a.memoizedState=o:(a.memoizedState=d,a=n_(),Ke.lanes|=a,ss|=a,d)}function nO(a,o,d,m){return jr(d,o)?d:Ll.current!==null?(a=Fy(a,d,m),jr(a,o)||(un=!0),a):(fa&42)===0||(fa&1073741824)!==0&&(et&261930)===0?(un=!0,a.memoizedState=d):(a=n_(),Ke.lanes|=a,ss|=a,o)}function rO(a,o,d,m,b){var j=re.p;re.p=j!==0&&8>j?j:8;var _=V.T,M={};V.T=M,Gy(a,!1,o,d);try{var $=b(),ee=V.S;if(ee!==null&&ee(M,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var se=i6($,m);Mu(a,o,se,Ar(a))}else Mu(a,o,m,Ar(a))}catch(fe){Mu(a,o,{then:function(){},status:"rejected",reason:fe},Ar())}finally{re.p=j,_!==null&&M.types!==null&&(_.types=M.types),V.T=_}}function u6(){}function Ky(a,o,d,m){if(a.tag!==5)throw Error(r(476));var b=iO(a).queue;rO(a,b,o,ve,d===null?u6:function(){return aO(a),d(m)})}function iO(a){var o=a.memoizedState;if(o!==null)return o;o={memoizedState:ve,baseState:ve,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ha,lastRenderedState:ve},next:null};var d={};return o.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ha,lastRenderedState:d},next:null},a.memoizedState=o,a=a.alternate,a!==null&&(a.memoizedState=o),o}function aO(a){var o=iO(a);o.next===null&&(o=a.alternate.memoizedState),Mu(a,o.next.queue,{},Ar())}function Hy(){return Tn(Qu)}function sO(){return tn().memoizedState}function oO(){return tn().memoizedState}function d6(a){for(var o=a.return;o!==null;){switch(o.tag){case 24:case 3:var d=Ar();a=es(d);var m=ts(o,a,d);m!==null&&(mr(m,o,d),Au(m,o,d)),o={cache:xy()},a.payload=o;return}o=o.return}}function f6(a,o,d){var m=Ar();d={lane:m,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},vh(a)?cO(o,d):(d=cy(a,o,d,m),d!==null&&(mr(d,a,m),uO(d,o,m)))}function lO(a,o,d){var m=Ar();Mu(a,o,d,m)}function Mu(a,o,d,m){var b={lane:m,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null};if(vh(a))cO(o,b);else{var j=a.alternate;if(a.lanes===0&&(j===null||j.lanes===0)&&(j=o.lastRenderedReducer,j!==null))try{var _=o.lastRenderedState,M=j(_,d);if(b.hasEagerState=!0,b.eagerState=M,jr(M,_))return Qf(a,o,b,0),jt===null&&Wf(),!1}catch{}if(d=cy(a,o,b,m),d!==null)return mr(d,a,m),uO(d,o,m),!0}return!1}function Gy(a,o,d,m){if(m={lane:2,revertLane:N0(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},vh(a)){if(o)throw Error(r(479))}else o=cy(a,d,m,2),o!==null&&mr(o,a,2)}function vh(a){var o=a.alternate;return a===Ke||o!==null&&o===Ke}function cO(a,o){$l=uh=!0;var d=a.pending;d===null?o.next=o:(o.next=d.next,d.next=o),a.pending=o}function uO(a,o,d){if((d&4194048)!==0){var m=o.lanes;m&=a.pendingLanes,d|=m,o.lanes=d,Lf(a,d)}}var Ru={readContext:Tn,use:hh,useCallback:Yt,useContext:Yt,useEffect:Yt,useImperativeHandle:Yt,useLayoutEffect:Yt,useInsertionEffect:Yt,useMemo:Yt,useReducer:Yt,useRef:Yt,useState:Yt,useDebugValue:Yt,useDeferredValue:Yt,useTransition:Yt,useSyncExternalStore:Yt,useId:Yt,useHostTransitionStatus:Yt,useFormState:Yt,useActionState:Yt,useOptimistic:Yt,useMemoCache:Yt,useCacheRefresh:Yt};Ru.useEffectEvent=Yt;var dO={readContext:Tn,use:hh,useCallback:function(a,o){return Xn().memoizedState=[a,o===void 0?null:o],a},useContext:Tn,useEffect:ZC,useImperativeHandle:function(a,o,d){d=d!=null?d.concat([a]):null,mh(4194308,4,XC.bind(null,o,a),d)},useLayoutEffect:function(a,o){return mh(4194308,4,a,o)},useInsertionEffect:function(a,o){mh(4,2,a,o)},useMemo:function(a,o){var d=Xn();o=o===void 0?null:o;var m=a();if(ho){Rr(!0);try{a()}finally{Rr(!1)}}return d.memoizedState=[m,o],m},useReducer:function(a,o,d){var m=Xn();if(d!==void 0){var b=d(o);if(ho){Rr(!0);try{d(o)}finally{Rr(!1)}}}else b=o;return m.memoizedState=m.baseState=b,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b},m.queue=a,a=a.dispatch=f6.bind(null,Ke,a),[m.memoizedState,a]},useRef:function(a){var o=Xn();return a={current:a},o.memoizedState=a},useState:function(a){a=$y(a);var o=a.queue,d=lO.bind(null,Ke,o);return o.dispatch=d,[a.memoizedState,d]},useDebugValue:qy,useDeferredValue:function(a,o){var d=Xn();return Fy(d,a,o)},useTransition:function(){var a=$y(!1);return a=rO.bind(null,Ke,a.queue,!0,!1),Xn().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,o,d){var m=Ke,b=Xn();if(rt){if(d===void 0)throw Error(r(407));d=d()}else{if(d=o(),jt===null)throw Error(r(349));(et&127)!==0||PC(m,o,d)}b.memoizedState=d;var j={value:d,getSnapshot:o};return b.queue=j,ZC(MC.bind(null,m,j,a),[a]),m.flags|=2048,Bl(9,{destroy:void 0},zC.bind(null,m,j,d,o),null),d},useId:function(){var a=Xn(),o=jt.identifierPrefix;if(rt){var d=Di,m=Ri;d=(m&~(1<<32-be(m)-1)).toString(32)+d,o="_"+o+"R_"+d,d=dh++,0<d&&(o+="H"+d.toString(32)),o+="_"}else d=a6++,o="_"+o+"r_"+d.toString(32)+"_";return a.memoizedState=o},useHostTransitionStatus:Hy,useFormState:FC,useActionState:FC,useOptimistic:function(a){var o=Xn();o.memoizedState=o.baseState=a;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=d,o=Gy.bind(null,Ke,!0,d),d.dispatch=o,[a,o]},useMemoCache:Dy,useCacheRefresh:function(){return Xn().memoizedState=d6.bind(null,Ke)},useEffectEvent:function(a){var o=Xn(),d={impl:a};return o.memoizedState=d,function(){if((dt&2)!==0)throw Error(r(440));return d.impl.apply(void 0,arguments)}}},Vy={readContext:Tn,use:hh,useCallback:eO,useContext:Tn,useEffect:By,useImperativeHandle:JC,useInsertionEffect:WC,useLayoutEffect:QC,useMemo:tO,useReducer:ph,useRef:VC,useState:function(){return ph(ha)},useDebugValue:qy,useDeferredValue:function(a,o){var d=tn();return nO(d,bt.memoizedState,a,o)},useTransition:function(){var a=ph(ha)[0],o=tn().memoizedState;return[typeof a=="boolean"?a:zu(a),o]},useSyncExternalStore:TC,useId:sO,useHostTransitionStatus:Hy,useFormState:KC,useActionState:KC,useOptimistic:function(a,o){var d=tn();return IC(d,bt,a,o)},useMemoCache:Dy,useCacheRefresh:oO};Vy.useEffectEvent=YC;var fO={readContext:Tn,use:hh,useCallback:eO,useContext:Tn,useEffect:By,useImperativeHandle:JC,useInsertionEffect:WC,useLayoutEffect:QC,useMemo:tO,useReducer:Ly,useRef:VC,useState:function(){return Ly(ha)},useDebugValue:qy,useDeferredValue:function(a,o){var d=tn();return bt===null?Fy(d,a,o):nO(d,bt.memoizedState,a,o)},useTransition:function(){var a=Ly(ha)[0],o=tn().memoizedState;return[typeof a=="boolean"?a:zu(a),o]},useSyncExternalStore:TC,useId:sO,useHostTransitionStatus:Hy,useFormState:GC,useActionState:GC,useOptimistic:function(a,o){var d=tn();return bt!==null?IC(d,bt,a,o):(d.baseState=a,[a,d.queue.dispatch])},useMemoCache:Dy,useCacheRefresh:oO};fO.useEffectEvent=YC;function Zy(a,o,d,m){o=a.memoizedState,d=d(m,o),d=d==null?o:g({},o,d),a.memoizedState=d,a.lanes===0&&(a.updateQueue.baseState=d)}var Yy={enqueueSetState:function(a,o,d){a=a._reactInternals;var m=Ar(),b=es(m);b.payload=o,d!=null&&(b.callback=d),o=ts(a,b,m),o!==null&&(mr(o,a,m),Au(o,a,m))},enqueueReplaceState:function(a,o,d){a=a._reactInternals;var m=Ar(),b=es(m);b.tag=1,b.payload=o,d!=null&&(b.callback=d),o=ts(a,b,m),o!==null&&(mr(o,a,m),Au(o,a,m))},enqueueForceUpdate:function(a,o){a=a._reactInternals;var d=Ar(),m=es(d);m.tag=2,o!=null&&(m.callback=o),o=ts(a,m,d),o!==null&&(mr(o,a,d),Au(o,a,d))}};function hO(a,o,d,m,b,j,_){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(m,j,_):o.prototype&&o.prototype.isPureReactComponent?!wu(d,m)||!wu(b,j):!0}function pO(a,o,d,m){a=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(d,m),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(d,m),o.state!==a&&Yy.enqueueReplaceState(o,o.state,null)}function po(a,o){var d=o;if("ref"in o){d={};for(var m in o)m!=="ref"&&(d[m]=o[m])}if(a=a.defaultProps){d===o&&(d=g({},d));for(var b in a)d[b]===void 0&&(d[b]=a[b])}return d}function mO(a){Yf(a)}function gO(a){console.error(a)}function vO(a){Yf(a)}function yh(a,o){try{var d=a.onUncaughtError;d(o.value,{componentStack:o.stack})}catch(m){setTimeout(function(){throw m})}}function yO(a,o,d){try{var m=a.onCaughtError;m(d.value,{componentStack:d.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function Wy(a,o,d){return d=es(d),d.tag=3,d.payload={element:null},d.callback=function(){yh(a,o)},d}function bO(a){return a=es(a),a.tag=3,a}function xO(a,o,d,m){var b=d.type.getDerivedStateFromError;if(typeof b=="function"){var j=m.value;a.payload=function(){return b(j)},a.callback=function(){yO(o,d,m)}}var _=d.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(a.callback=function(){yO(o,d,m),typeof b!="function"&&(os===null?os=new Set([this]):os.add(this));var M=m.stack;this.componentDidCatch(m.value,{componentStack:M!==null?M:""})})}function h6(a,o,d,m,b){if(d.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(o=d.alternate,o!==null&&zl(o,d,b,!0),d=Cr.current,d!==null){switch(d.tag){case 31:case 13:return Fr===null?Eh():d.alternate===null&&Wt===0&&(Wt=3),d.flags&=-257,d.flags|=65536,d.lanes=b,m===ah?d.flags|=16384:(o=d.updateQueue,o===null?d.updateQueue=new Set([m]):o.add(m),w0(a,m,b)),!1;case 22:return d.flags|=65536,m===ah?d.flags|=16384:(o=d.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([m])},d.updateQueue=o):(d=o.retryQueue,d===null?o.retryQueue=new Set([m]):d.add(m)),w0(a,m,b)),!1}throw Error(r(435,d.tag))}return w0(a,m,b),Eh(),!1}if(rt)return o=Cr.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=b,m!==my&&(a=Error(r(422),{cause:m}),Nu($r(a,d)))):(m!==my&&(o=Error(r(423),{cause:m}),Nu($r(o,d))),a=a.current.alternate,a.flags|=65536,b&=-b,a.lanes|=b,m=$r(m,d),b=Wy(a.stateNode,m,b),Oy(a,b),Wt!==4&&(Wt=2)),!1;var j=Error(r(520),{cause:m});if(j=$r(j,d),Fu===null?Fu=[j]:Fu.push(j),Wt!==4&&(Wt=2),o===null)return!0;m=$r(m,d),d=o;do{switch(d.tag){case 3:return d.flags|=65536,a=b&-b,d.lanes|=a,a=Wy(d.stateNode,m,a),Oy(d,a),!1;case 1:if(o=d.type,j=d.stateNode,(d.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||j!==null&&typeof j.componentDidCatch=="function"&&(os===null||!os.has(j))))return d.flags|=65536,b&=-b,d.lanes|=b,b=bO(b),xO(b,a,d,m),Oy(d,b),!1}d=d.return}while(d!==null);return!1}var Qy=Error(r(461)),un=!1;function Pn(a,o,d,m){o.child=a===null?NC(o,null,d,m):fo(o,a.child,d,m)}function wO(a,o,d,m,b){d=d.render;var j=o.ref;if("ref"in m){var _={};for(var M in m)M!=="ref"&&(_[M]=m[M])}else _=m;return oo(o),m=Py(a,o,d,_,j,b),M=zy(),a!==null&&!un?(My(a,o,b),pa(a,o,b)):(rt&&M&&hy(o),o.flags|=1,Pn(a,o,m,b),o.child)}function SO(a,o,d,m,b){if(a===null){var j=d.type;return typeof j=="function"&&!uy(j)&&j.defaultProps===void 0&&d.compare===null?(o.tag=15,o.type=j,jO(a,o,j,m,b)):(a=Jf(d.type,null,m,o,o.mode,b),a.ref=o.ref,a.return=o,o.child=a)}if(j=a.child,!a0(a,b)){var _=j.memoizedProps;if(d=d.compare,d=d!==null?d:wu,d(_,m)&&a.ref===o.ref)return pa(a,o,b)}return o.flags|=1,a=la(j,m),a.ref=o.ref,a.return=o,o.child=a}function jO(a,o,d,m,b){if(a!==null){var j=a.memoizedProps;if(wu(j,m)&&a.ref===o.ref)if(un=!1,o.pendingProps=m=j,a0(a,b))(a.flags&131072)!==0&&(un=!0);else return o.lanes=a.lanes,pa(a,o,b)}return Xy(a,o,d,m,b)}function NO(a,o,d,m){var b=m.children,j=a!==null?a.memoizedState:null;if(a===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((o.flags&128)!==0){if(j=j!==null?j.baseLanes|d:d,a!==null){for(m=o.child=a.child,b=0;m!==null;)b=b|m.lanes|m.childLanes,m=m.sibling;m=b&~j}else m=0,o.child=null;return CO(a,o,j,d,m)}if((d&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},a!==null&&rh(o,j!==null?j.cachePool:null),j!==null?_C(o,j):ky(),kC(o);else return m=o.lanes=536870912,CO(a,o,j!==null?j.baseLanes|d:d,d,m)}else j!==null?(rh(o,j.cachePool),_C(o,j),rs(),o.memoizedState=null):(a!==null&&rh(o,null),ky(),rs());return Pn(a,o,b,d),o.child}function Du(a,o){return a!==null&&a.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function CO(a,o,d,m,b){var j=Sy();return j=j===null?null:{parent:ln._currentValue,pool:j},o.memoizedState={baseLanes:d,cachePool:j},a!==null&&rh(o,null),ky(),kC(o),a!==null&&zl(a,o,m,!0),o.childLanes=b,null}function bh(a,o){return o=wh({mode:o.mode,children:o.children},a.mode),o.ref=a.ref,a.child=o,o.return=a,o}function OO(a,o,d){return fo(o,a.child,null,d),a=bh(o,o.pendingProps),a.flags|=2,Or(o),o.memoizedState=null,a}function p6(a,o,d){var m=o.pendingProps,b=(o.flags&128)!==0;if(o.flags&=-129,a===null){if(rt){if(m.mode==="hidden")return a=bh(o,m),o.lanes=536870912,Du(null,a);if(Ey(o),(a=_t)?(a=L_(a,qr),a=a!==null&&a.data==="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:Ya!==null?{id:Ri,overflow:Di}:null,retryLane:536870912,hydrationErrors:null},d=cC(a),d.return=o,o.child=d,En=o,_t=null)):a=null,a===null)throw Qa(o);return o.lanes=536870912,null}return bh(o,m)}var j=a.memoizedState;if(j!==null){var _=j.dehydrated;if(Ey(o),b)if(o.flags&256)o.flags&=-257,o=OO(a,o,d);else if(o.memoizedState!==null)o.child=a.child,o.flags|=128,o=null;else throw Error(r(558));else if(un||zl(a,o,d,!1),b=(d&a.childLanes)!==0,un||b){if(m=jt,m!==null&&(_=fu(m,d),_!==0&&_!==j.retryLane))throw j.retryLane=_,ro(a,_),mr(m,a,_),Qy;Eh(),o=OO(a,o,d)}else a=j.treeContext,_t=Kr(_.nextSibling),En=o,rt=!0,Wa=null,qr=!1,a!==null&&fC(o,a),o=bh(o,m),o.flags|=4096;return o}return a=la(a.child,{mode:m.mode,children:m.children}),a.ref=o.ref,o.child=a,a.return=o,a}function xh(a,o){var d=o.ref;if(d===null)a!==null&&a.ref!==null&&(o.flags|=4194816);else{if(typeof d!="function"&&typeof d!="object")throw Error(r(284));(a===null||a.ref!==d)&&(o.flags|=4194816)}}function Xy(a,o,d,m,b){return oo(o),d=Py(a,o,d,m,void 0,b),m=zy(),a!==null&&!un?(My(a,o,b),pa(a,o,b)):(rt&&m&&hy(o),o.flags|=1,Pn(a,o,d,b),o.child)}function _O(a,o,d,m,b,j){return oo(o),o.updateQueue=null,d=EC(o,m,d,b),AC(a),m=zy(),a!==null&&!un?(My(a,o,j),pa(a,o,j)):(rt&&m&&hy(o),o.flags|=1,Pn(a,o,d,j),o.child)}function kO(a,o,d,m,b){if(oo(o),o.stateNode===null){var j=Al,_=d.contextType;typeof _=="object"&&_!==null&&(j=Tn(_)),j=new d(m,j),o.memoizedState=j.state!==null&&j.state!==void 0?j.state:null,j.updater=Yy,o.stateNode=j,j._reactInternals=o,j=o.stateNode,j.props=m,j.state=o.memoizedState,j.refs={},Ny(o),_=d.contextType,j.context=typeof _=="object"&&_!==null?Tn(_):Al,j.state=o.memoizedState,_=d.getDerivedStateFromProps,typeof _=="function"&&(Zy(o,d,_,m),j.state=o.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof j.getSnapshotBeforeUpdate=="function"||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(_=j.state,typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount(),_!==j.state&&Yy.enqueueReplaceState(j,j.state,null),Tu(o,m,j,b),Eu(),j.state=o.memoizedState),typeof j.componentDidMount=="function"&&(o.flags|=4194308),m=!0}else if(a===null){j=o.stateNode;var M=o.memoizedProps,$=po(d,M);j.props=$;var ee=j.context,se=d.contextType;_=Al,typeof se=="object"&&se!==null&&(_=Tn(se));var fe=d.getDerivedStateFromProps;se=typeof fe=="function"||typeof j.getSnapshotBeforeUpdate=="function",M=o.pendingProps!==M,se||typeof j.UNSAFE_componentWillReceiveProps!="function"&&typeof j.componentWillReceiveProps!="function"||(M||ee!==_)&&pO(o,j,m,_),Ja=!1;var te=o.memoizedState;j.state=te,Tu(o,m,j,b),Eu(),ee=o.memoizedState,M||te!==ee||Ja?(typeof fe=="function"&&(Zy(o,d,fe,m),ee=o.memoizedState),($=Ja||hO(o,d,$,m,te,ee,_))?(se||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount()),typeof j.componentDidMount=="function"&&(o.flags|=4194308)):(typeof j.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=m,o.memoizedState=ee),j.props=m,j.state=ee,j.context=_,m=$):(typeof j.componentDidMount=="function"&&(o.flags|=4194308),m=!1)}else{j=o.stateNode,Cy(a,o),_=o.memoizedProps,se=po(d,_),j.props=se,fe=o.pendingProps,te=j.context,ee=d.contextType,$=Al,typeof ee=="object"&&ee!==null&&($=Tn(ee)),M=d.getDerivedStateFromProps,(ee=typeof M=="function"||typeof j.getSnapshotBeforeUpdate=="function")||typeof j.UNSAFE_componentWillReceiveProps!="function"&&typeof j.componentWillReceiveProps!="function"||(_!==fe||te!==$)&&pO(o,j,m,$),Ja=!1,te=o.memoizedState,j.state=te,Tu(o,m,j,b),Eu();var ie=o.memoizedState;_!==fe||te!==ie||Ja||a!==null&&a.dependencies!==null&&th(a.dependencies)?(typeof M=="function"&&(Zy(o,d,M,m),ie=o.memoizedState),(se=Ja||hO(o,d,se,m,te,ie,$)||a!==null&&a.dependencies!==null&&th(a.dependencies))?(ee||typeof j.UNSAFE_componentWillUpdate!="function"&&typeof j.componentWillUpdate!="function"||(typeof j.componentWillUpdate=="function"&&j.componentWillUpdate(m,ie,$),typeof j.UNSAFE_componentWillUpdate=="function"&&j.UNSAFE_componentWillUpdate(m,ie,$)),typeof j.componentDidUpdate=="function"&&(o.flags|=4),typeof j.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof j.componentDidUpdate!="function"||_===a.memoizedProps&&te===a.memoizedState||(o.flags|=4),typeof j.getSnapshotBeforeUpdate!="function"||_===a.memoizedProps&&te===a.memoizedState||(o.flags|=1024),o.memoizedProps=m,o.memoizedState=ie),j.props=m,j.state=ie,j.context=$,m=se):(typeof j.componentDidUpdate!="function"||_===a.memoizedProps&&te===a.memoizedState||(o.flags|=4),typeof j.getSnapshotBeforeUpdate!="function"||_===a.memoizedProps&&te===a.memoizedState||(o.flags|=1024),m=!1)}return j=m,xh(a,o),m=(o.flags&128)!==0,j||m?(j=o.stateNode,d=m&&typeof d.getDerivedStateFromError!="function"?null:j.render(),o.flags|=1,a!==null&&m?(o.child=fo(o,a.child,null,b),o.child=fo(o,null,d,b)):Pn(a,o,d,b),o.memoizedState=j.state,a=o.child):a=pa(a,o,b),a}function AO(a,o,d,m){return ao(),o.flags|=256,Pn(a,o,d,m),o.child}var Jy={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function e0(a){return{baseLanes:a,cachePool:yC()}}function t0(a,o,d){return a=a!==null?a.childLanes&~d:0,o&&(a|=kr),a}function EO(a,o,d){var m=o.pendingProps,b=!1,j=(o.flags&128)!==0,_;if((_=j)||(_=a!==null&&a.memoizedState===null?!1:(en.current&2)!==0),_&&(b=!0,o.flags&=-129),_=(o.flags&32)!==0,o.flags&=-33,a===null){if(rt){if(b?ns(o):rs(),(a=_t)?(a=L_(a,qr),a=a!==null&&a.data!=="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:Ya!==null?{id:Ri,overflow:Di}:null,retryLane:536870912,hydrationErrors:null},d=cC(a),d.return=o,o.child=d,En=o,_t=null)):a=null,a===null)throw Qa(o);return I0(a)?o.lanes=32:o.lanes=536870912,null}var M=m.children;return m=m.fallback,b?(rs(),b=o.mode,M=wh({mode:"hidden",children:M},b),m=io(m,b,d,null),M.return=o,m.return=o,M.sibling=m,o.child=M,m=o.child,m.memoizedState=e0(d),m.childLanes=t0(a,_,d),o.memoizedState=Jy,Du(null,m)):(ns(o),n0(o,M))}var $=a.memoizedState;if($!==null&&(M=$.dehydrated,M!==null)){if(j)o.flags&256?(ns(o),o.flags&=-257,o=r0(a,o,d)):o.memoizedState!==null?(rs(),o.child=a.child,o.flags|=128,o=null):(rs(),M=m.fallback,b=o.mode,m=wh({mode:"visible",children:m.children},b),M=io(M,b,d,null),M.flags|=2,m.return=o,M.return=o,m.sibling=M,o.child=m,fo(o,a.child,null,d),m=o.child,m.memoizedState=e0(d),m.childLanes=t0(a,_,d),o.memoizedState=Jy,o=Du(null,m));else if(ns(o),I0(M)){if(_=M.nextSibling&&M.nextSibling.dataset,_)var ee=_.dgst;_=ee,m=Error(r(419)),m.stack="",m.digest=_,Nu({value:m,source:null,stack:null}),o=r0(a,o,d)}else if(un||zl(a,o,d,!1),_=(d&a.childLanes)!==0,un||_){if(_=jt,_!==null&&(m=fu(_,d),m!==0&&m!==$.retryLane))throw $.retryLane=m,ro(a,m),mr(_,a,m),Qy;D0(M)||Eh(),o=r0(a,o,d)}else D0(M)?(o.flags|=192,o.child=a.child,o=null):(a=$.treeContext,_t=Kr(M.nextSibling),En=o,rt=!0,Wa=null,qr=!1,a!==null&&fC(o,a),o=n0(o,m.children),o.flags|=4096);return o}return b?(rs(),M=m.fallback,b=o.mode,$=a.child,ee=$.sibling,m=la($,{mode:"hidden",children:m.children}),m.subtreeFlags=$.subtreeFlags&65011712,ee!==null?M=la(ee,M):(M=io(M,b,d,null),M.flags|=2),M.return=o,m.return=o,m.sibling=M,o.child=m,Du(null,m),m=o.child,M=a.child.memoizedState,M===null?M=e0(d):(b=M.cachePool,b!==null?($=ln._currentValue,b=b.parent!==$?{parent:$,pool:$}:b):b=yC(),M={baseLanes:M.baseLanes|d,cachePool:b}),m.memoizedState=M,m.childLanes=t0(a,_,d),o.memoizedState=Jy,Du(a.child,m)):(ns(o),d=a.child,a=d.sibling,d=la(d,{mode:"visible",children:m.children}),d.return=o,d.sibling=null,a!==null&&(_=o.deletions,_===null?(o.deletions=[a],o.flags|=16):_.push(a)),o.child=d,o.memoizedState=null,d)}function n0(a,o){return o=wh({mode:"visible",children:o},a.mode),o.return=a,a.child=o}function wh(a,o){return a=Nr(22,a,null,o),a.lanes=0,a}function r0(a,o,d){return fo(o,a.child,null,d),a=n0(o,o.pendingProps.children),a.flags|=2,o.memoizedState=null,a}function TO(a,o,d){a.lanes|=o;var m=a.alternate;m!==null&&(m.lanes|=o),yy(a.return,o,d)}function i0(a,o,d,m,b,j){var _=a.memoizedState;_===null?a.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:m,tail:d,tailMode:b,treeForkCount:j}:(_.isBackwards=o,_.rendering=null,_.renderingStartTime=0,_.last=m,_.tail=d,_.tailMode=b,_.treeForkCount=j)}function PO(a,o,d){var m=o.pendingProps,b=m.revealOrder,j=m.tail;m=m.children;var _=en.current,M=(_&2)!==0;if(M?(_=_&1|2,o.flags|=128):_&=1,oe(en,_),Pn(a,o,m,d),m=rt?ju:0,!M&&a!==null&&(a.flags&128)!==0)e:for(a=o.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&TO(a,d,o);else if(a.tag===19)TO(a,d,o);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break e;for(;a.sibling===null;){if(a.return===null||a.return===o)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(b){case"forwards":for(d=o.child,b=null;d!==null;)a=d.alternate,a!==null&&ch(a)===null&&(b=d),d=d.sibling;d=b,d===null?(b=o.child,o.child=null):(b=d.sibling,d.sibling=null),i0(o,!1,b,d,j,m);break;case"backwards":case"unstable_legacy-backwards":for(d=null,b=o.child,o.child=null;b!==null;){if(a=b.alternate,a!==null&&ch(a)===null){o.child=b;break}a=b.sibling,b.sibling=d,d=b,b=a}i0(o,!0,d,null,j,m);break;case"together":i0(o,!1,null,null,void 0,m);break;default:o.memoizedState=null}return o.child}function pa(a,o,d){if(a!==null&&(o.dependencies=a.dependencies),ss|=o.lanes,(d&o.childLanes)===0)if(a!==null){if(zl(a,o,d,!1),(d&o.childLanes)===0)return null}else return null;if(a!==null&&o.child!==a.child)throw Error(r(153));if(o.child!==null){for(a=o.child,d=la(a,a.pendingProps),o.child=d,d.return=o;a.sibling!==null;)a=a.sibling,d=d.sibling=la(a,a.pendingProps),d.return=o;d.sibling=null}return o.child}function a0(a,o){return(a.lanes&o)!==0?!0:(a=a.dependencies,!!(a!==null&&th(a)))}function m6(a,o,d){switch(o.tag){case 3:ye(o,o.stateNode.containerInfo),Xa(o,ln,a.memoizedState.cache),ao();break;case 27:case 5:le(o);break;case 4:ye(o,o.stateNode.containerInfo);break;case 10:Xa(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,Ey(o),null;break;case 13:var m=o.memoizedState;if(m!==null)return m.dehydrated!==null?(ns(o),o.flags|=128,null):(d&o.child.childLanes)!==0?EO(a,o,d):(ns(o),a=pa(a,o,d),a!==null?a.sibling:null);ns(o);break;case 19:var b=(a.flags&128)!==0;if(m=(d&o.childLanes)!==0,m||(zl(a,o,d,!1),m=(d&o.childLanes)!==0),b){if(m)return PO(a,o,d);o.flags|=128}if(b=o.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),oe(en,en.current),m)break;return null;case 22:return o.lanes=0,NO(a,o,d,o.pendingProps);case 24:Xa(o,ln,a.memoizedState.cache)}return pa(a,o,d)}function zO(a,o,d){if(a!==null)if(a.memoizedProps!==o.pendingProps)un=!0;else{if(!a0(a,d)&&(o.flags&128)===0)return un=!1,m6(a,o,d);un=(a.flags&131072)!==0}else un=!1,rt&&(o.flags&1048576)!==0&&dC(o,ju,o.index);switch(o.lanes=0,o.tag){case 16:e:{var m=o.pendingProps;if(a=co(o.elementType),o.type=a,typeof a=="function")uy(a)?(m=po(a,m),o.tag=1,o=kO(null,o,a,m,d)):(o.tag=0,o=Xy(null,o,a,m,d));else{if(a!=null){var b=a.$$typeof;if(b===O){o.tag=11,o=wO(null,o,a,m,d);break e}else if(b===A){o.tag=14,o=SO(null,o,a,m,d);break e}}throw o=pe(a)||a,Error(r(306,o,""))}}return o;case 0:return Xy(a,o,o.type,o.pendingProps,d);case 1:return m=o.type,b=po(m,o.pendingProps),kO(a,o,m,b,d);case 3:e:{if(ye(o,o.stateNode.containerInfo),a===null)throw Error(r(387));m=o.pendingProps;var j=o.memoizedState;b=j.element,Cy(a,o),Tu(o,m,null,d);var _=o.memoizedState;if(m=_.cache,Xa(o,ln,m),m!==j.cache&&by(o,[ln],d,!0),Eu(),m=_.element,j.isDehydrated)if(j={element:m,isDehydrated:!1,cache:_.cache},o.updateQueue.baseState=j,o.memoizedState=j,o.flags&256){o=AO(a,o,m,d);break e}else if(m!==b){b=$r(Error(r(424)),o),Nu(b),o=AO(a,o,m,d);break e}else for(a=o.stateNode.containerInfo,a.nodeType===9?a=a.body:a=a.nodeName==="HTML"?a.ownerDocument.body:a,_t=Kr(a.firstChild),En=o,rt=!0,Wa=null,qr=!0,d=NC(o,null,m,d),o.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(ao(),m===b){o=pa(a,o,d);break e}Pn(a,o,m,d)}o=o.child}return o;case 26:return xh(a,o),a===null?(d=K_(o.type,null,o.pendingProps,null))?o.memoizedState=d:rt||(d=o.type,a=o.pendingProps,m=Ih(Q.current).createElement(d),m[zt]=o,m[Zt]=a,zn(m,d,a),on(m),o.stateNode=m):o.memoizedState=K_(o.type,a.memoizedProps,o.pendingProps,a.memoizedState),null;case 27:return le(o),a===null&&rt&&(m=o.stateNode=B_(o.type,o.pendingProps,Q.current),En=o,qr=!0,b=_t,ds(o.type)?(L0=b,_t=Kr(m.firstChild)):_t=b),Pn(a,o,o.pendingProps.children,d),xh(a,o),a===null&&(o.flags|=4194304),o.child;case 5:return a===null&&rt&&((b=m=_t)&&(m=H6(m,o.type,o.pendingProps,qr),m!==null?(o.stateNode=m,En=o,_t=Kr(m.firstChild),qr=!1,b=!0):b=!1),b||Qa(o)),le(o),b=o.type,j=o.pendingProps,_=a!==null?a.memoizedProps:null,m=j.children,z0(b,j)?m=null:_!==null&&z0(b,_)&&(o.flags|=32),o.memoizedState!==null&&(b=Py(a,o,s6,null,null,d),Qu._currentValue=b),xh(a,o),Pn(a,o,m,d),o.child;case 6:return a===null&&rt&&((a=d=_t)&&(d=G6(d,o.pendingProps,qr),d!==null?(o.stateNode=d,En=o,_t=null,a=!0):a=!1),a||Qa(o)),null;case 13:return EO(a,o,d);case 4:return ye(o,o.stateNode.containerInfo),m=o.pendingProps,a===null?o.child=fo(o,null,m,d):Pn(a,o,m,d),o.child;case 11:return wO(a,o,o.type,o.pendingProps,d);case 7:return Pn(a,o,o.pendingProps,d),o.child;case 8:return Pn(a,o,o.pendingProps.children,d),o.child;case 12:return Pn(a,o,o.pendingProps.children,d),o.child;case 10:return m=o.pendingProps,Xa(o,o.type,m.value),Pn(a,o,m.children,d),o.child;case 9:return b=o.type._context,m=o.pendingProps.children,oo(o),b=Tn(b),m=m(b),o.flags|=1,Pn(a,o,m,d),o.child;case 14:return SO(a,o,o.type,o.pendingProps,d);case 15:return jO(a,o,o.type,o.pendingProps,d);case 19:return PO(a,o,d);case 31:return p6(a,o,d);case 22:return NO(a,o,d,o.pendingProps);case 24:return oo(o),m=Tn(ln),a===null?(b=Sy(),b===null&&(b=jt,j=xy(),b.pooledCache=j,j.refCount++,j!==null&&(b.pooledCacheLanes|=d),b=j),o.memoizedState={parent:m,cache:b},Ny(o),Xa(o,ln,b)):((a.lanes&d)!==0&&(Cy(a,o),Tu(o,null,null,d),Eu()),b=a.memoizedState,j=o.memoizedState,b.parent!==m?(b={parent:m,cache:m},o.memoizedState=b,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=b),Xa(o,ln,m)):(m=j.cache,Xa(o,ln,m),m!==b.cache&&by(o,[ln],d,!0))),Pn(a,o,o.pendingProps.children,d),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function ma(a){a.flags|=4}function s0(a,o,d,m,b){if((o=(a.mode&32)!==0)&&(o=!1),o){if(a.flags|=16777216,(b&335544128)===b)if(a.stateNode.complete)a.flags|=8192;else if(s_())a.flags|=8192;else throw uo=ah,jy}else a.flags&=-16777217}function MO(a,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!Y_(o))if(s_())a.flags|=8192;else throw uo=ah,jy}function Sh(a,o){o!==null&&(a.flags|=4),a.flags&16384&&(o=a.tag!==22?Df():536870912,a.lanes|=o,Hl|=o)}function Iu(a,o){if(!rt)switch(a.tailMode){case"hidden":o=a.tail;for(var d=null;o!==null;)o.alternate!==null&&(d=o),o=o.sibling;d===null?a.tail=null:d.sibling=null;break;case"collapsed":d=a.tail;for(var m=null;d!==null;)d.alternate!==null&&(m=d),d=d.sibling;m===null?o||a.tail===null?a.tail=null:a.tail.sibling=null:m.sibling=null}}function kt(a){var o=a.alternate!==null&&a.alternate.child===a.child,d=0,m=0;if(o)for(var b=a.child;b!==null;)d|=b.lanes|b.childLanes,m|=b.subtreeFlags&65011712,m|=b.flags&65011712,b.return=a,b=b.sibling;else for(b=a.child;b!==null;)d|=b.lanes|b.childLanes,m|=b.subtreeFlags,m|=b.flags,b.return=a,b=b.sibling;return a.subtreeFlags|=m,a.childLanes=d,o}function g6(a,o,d){var m=o.pendingProps;switch(py(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(o),null;case 1:return kt(o),null;case 3:return d=o.stateNode,m=null,a!==null&&(m=a.memoizedState.cache),o.memoizedState.cache!==m&&(o.flags|=2048),da(ln),Z(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(a===null||a.child===null)&&(Pl(o)?ma(o):a===null||a.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,gy())),kt(o),null;case 26:var b=o.type,j=o.memoizedState;return a===null?(ma(o),j!==null?(kt(o),MO(o,j)):(kt(o),s0(o,b,null,m,d))):j?j!==a.memoizedState?(ma(o),kt(o),MO(o,j)):(kt(o),o.flags&=-16777217):(a=a.memoizedProps,a!==m&&ma(o),kt(o),s0(o,b,a,m,d)),null;case 27:if(Se(o),d=Q.current,b=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==m&&ma(o);else{if(!m){if(o.stateNode===null)throw Error(r(166));return kt(o),null}a=W.current,Pl(o)?hC(o):(a=B_(b,m,d),o.stateNode=a,ma(o))}return kt(o),null;case 5:if(Se(o),b=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==m&&ma(o);else{if(!m){if(o.stateNode===null)throw Error(r(166));return kt(o),null}if(j=W.current,Pl(o))hC(o);else{var _=Ih(Q.current);switch(j){case 1:j=_.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:j=_.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":j=_.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":j=_.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":j=_.createElement("div"),j.innerHTML="<script><\/script>",j=j.removeChild(j.firstChild);break;case"select":j=typeof m.is=="string"?_.createElement("select",{is:m.is}):_.createElement("select"),m.multiple?j.multiple=!0:m.size&&(j.size=m.size);break;default:j=typeof m.is=="string"?_.createElement(b,{is:m.is}):_.createElement(b)}}j[zt]=o,j[Zt]=m;e:for(_=o.child;_!==null;){if(_.tag===5||_.tag===6)j.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===o)break e;for(;_.sibling===null;){if(_.return===null||_.return===o)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}o.stateNode=j;e:switch(zn(j,b,m),b){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&ma(o)}}return kt(o),s0(o,o.type,a===null?null:a.memoizedProps,o.pendingProps,d),null;case 6:if(a&&o.stateNode!=null)a.memoizedProps!==m&&ma(o);else{if(typeof m!="string"&&o.stateNode===null)throw Error(r(166));if(a=Q.current,Pl(o)){if(a=o.stateNode,d=o.memoizedProps,m=null,b=En,b!==null)switch(b.tag){case 27:case 5:m=b.memoizedProps}a[zt]=o,a=!!(a.nodeValue===d||m!==null&&m.suppressHydrationWarning===!0||E_(a.nodeValue,d)),a||Qa(o,!0)}else a=Ih(a).createTextNode(m),a[zt]=o,o.stateNode=a}return kt(o),null;case 31:if(d=o.memoizedState,a===null||a.memoizedState!==null){if(m=Pl(o),d!==null){if(a===null){if(!m)throw Error(r(318));if(a=o.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[zt]=o}else ao(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;kt(o),a=!1}else d=gy(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=d),a=!0;if(!a)return o.flags&256?(Or(o),o):(Or(o),null);if((o.flags&128)!==0)throw Error(r(558))}return kt(o),null;case 13:if(m=o.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(b=Pl(o),m!==null&&m.dehydrated!==null){if(a===null){if(!b)throw Error(r(318));if(b=o.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[zt]=o}else ao(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;kt(o),b=!1}else b=gy(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=b),b=!0;if(!b)return o.flags&256?(Or(o),o):(Or(o),null)}return Or(o),(o.flags&128)!==0?(o.lanes=d,o):(d=m!==null,a=a!==null&&a.memoizedState!==null,d&&(m=o.child,b=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(b=m.alternate.memoizedState.cachePool.pool),j=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(j=m.memoizedState.cachePool.pool),j!==b&&(m.flags|=2048)),d!==a&&d&&(o.child.flags|=8192),Sh(o,o.updateQueue),kt(o),null);case 4:return Z(),a===null&&k0(o.stateNode.containerInfo),kt(o),null;case 10:return da(o.type),kt(o),null;case 19:if(G(en),m=o.memoizedState,m===null)return kt(o),null;if(b=(o.flags&128)!==0,j=m.rendering,j===null)if(b)Iu(m,!1);else{if(Wt!==0||a!==null&&(a.flags&128)!==0)for(a=o.child;a!==null;){if(j=ch(a),j!==null){for(o.flags|=128,Iu(m,!1),a=j.updateQueue,o.updateQueue=a,Sh(o,a),o.subtreeFlags=0,a=d,d=o.child;d!==null;)lC(d,a),d=d.sibling;return oe(en,en.current&1|2),rt&&ca(o,m.treeForkCount),o.child}a=a.sibling}m.tail!==null&&st()>_h&&(o.flags|=128,b=!0,Iu(m,!1),o.lanes=4194304)}else{if(!b)if(a=ch(j),a!==null){if(o.flags|=128,b=!0,a=a.updateQueue,o.updateQueue=a,Sh(o,a),Iu(m,!0),m.tail===null&&m.tailMode==="hidden"&&!j.alternate&&!rt)return kt(o),null}else 2*st()-m.renderingStartTime>_h&&d!==536870912&&(o.flags|=128,b=!0,Iu(m,!1),o.lanes=4194304);m.isBackwards?(j.sibling=o.child,o.child=j):(a=m.last,a!==null?a.sibling=j:o.child=j,m.last=j)}return m.tail!==null?(a=m.tail,m.rendering=a,m.tail=a.sibling,m.renderingStartTime=st(),a.sibling=null,d=en.current,oe(en,b?d&1|2:d&1),rt&&ca(o,m.treeForkCount),a):(kt(o),null);case 22:case 23:return Or(o),Ay(),m=o.memoizedState!==null,a!==null?a.memoizedState!==null!==m&&(o.flags|=8192):m&&(o.flags|=8192),m?(d&536870912)!==0&&(o.flags&128)===0&&(kt(o),o.subtreeFlags&6&&(o.flags|=8192)):kt(o),d=o.updateQueue,d!==null&&Sh(o,d.retryQueue),d=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(d=a.memoizedState.cachePool.pool),m=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(m=o.memoizedState.cachePool.pool),m!==d&&(o.flags|=2048),a!==null&&G(lo),null;case 24:return d=null,a!==null&&(d=a.memoizedState.cache),o.memoizedState.cache!==d&&(o.flags|=2048),da(ln),kt(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function v6(a,o){switch(py(o),o.tag){case 1:return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 3:return da(ln),Z(),a=o.flags,(a&65536)!==0&&(a&128)===0?(o.flags=a&-65537|128,o):null;case 26:case 27:case 5:return Se(o),null;case 31:if(o.memoizedState!==null){if(Or(o),o.alternate===null)throw Error(r(340));ao()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 13:if(Or(o),a=o.memoizedState,a!==null&&a.dehydrated!==null){if(o.alternate===null)throw Error(r(340));ao()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 19:return G(en),null;case 4:return Z(),null;case 10:return da(o.type),null;case 22:case 23:return Or(o),Ay(),a!==null&&G(lo),a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 24:return da(ln),null;case 25:return null;default:return null}}function RO(a,o){switch(py(o),o.tag){case 3:da(ln),Z();break;case 26:case 27:case 5:Se(o);break;case 4:Z();break;case 31:o.memoizedState!==null&&Or(o);break;case 13:Or(o);break;case 19:G(en);break;case 10:da(o.type);break;case 22:case 23:Or(o),Ay(),a!==null&&G(lo);break;case 24:da(ln)}}function Lu(a,o){try{var d=o.updateQueue,m=d!==null?d.lastEffect:null;if(m!==null){var b=m.next;d=b;do{if((d.tag&a)===a){m=void 0;var j=d.create,_=d.inst;m=j(),_.destroy=m}d=d.next}while(d!==b)}}catch(M){pt(o,o.return,M)}}function is(a,o,d){try{var m=o.updateQueue,b=m!==null?m.lastEffect:null;if(b!==null){var j=b.next;m=j;do{if((m.tag&a)===a){var _=m.inst,M=_.destroy;if(M!==void 0){_.destroy=void 0,b=o;var $=d,ee=M;try{ee()}catch(se){pt(b,$,se)}}}m=m.next}while(m!==j)}}catch(se){pt(o,o.return,se)}}function DO(a){var o=a.updateQueue;if(o!==null){var d=a.stateNode;try{OC(o,d)}catch(m){pt(a,a.return,m)}}}function IO(a,o,d){d.props=po(a.type,a.memoizedProps),d.state=a.memoizedState;try{d.componentWillUnmount()}catch(m){pt(a,o,m)}}function $u(a,o){try{var d=a.ref;if(d!==null){switch(a.tag){case 26:case 27:case 5:var m=a.stateNode;break;case 30:m=a.stateNode;break;default:m=a.stateNode}typeof d=="function"?a.refCleanup=d(m):d.current=m}}catch(b){pt(a,o,b)}}function Ii(a,o){var d=a.ref,m=a.refCleanup;if(d!==null)if(typeof m=="function")try{m()}catch(b){pt(a,o,b)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(b){pt(a,o,b)}else d.current=null}function LO(a){var o=a.type,d=a.memoizedProps,m=a.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":d.autoFocus&&m.focus();break e;case"img":d.src?m.src=d.src:d.srcSet&&(m.srcset=d.srcSet)}}catch(b){pt(a,a.return,b)}}function o0(a,o,d){try{var m=a.stateNode;$6(m,a.type,d,o),m[Zt]=o}catch(b){pt(a,a.return,b)}}function $O(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&ds(a.type)||a.tag===4}function l0(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||$O(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&ds(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function c0(a,o,d){var m=a.tag;if(m===5||m===6)a=a.stateNode,o?(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d).insertBefore(a,o):(o=d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,o.appendChild(a),d=d._reactRootContainer,d!=null||o.onclick!==null||(o.onclick=sa));else if(m!==4&&(m===27&&ds(a.type)&&(d=a.stateNode,o=null),a=a.child,a!==null))for(c0(a,o,d),a=a.sibling;a!==null;)c0(a,o,d),a=a.sibling}function jh(a,o,d){var m=a.tag;if(m===5||m===6)a=a.stateNode,o?d.insertBefore(a,o):d.appendChild(a);else if(m!==4&&(m===27&&ds(a.type)&&(d=a.stateNode),a=a.child,a!==null))for(jh(a,o,d),a=a.sibling;a!==null;)jh(a,o,d),a=a.sibling}function UO(a){var o=a.stateNode,d=a.memoizedProps;try{for(var m=a.type,b=o.attributes;b.length;)o.removeAttributeNode(b[0]);zn(o,m,d),o[zt]=a,o[Zt]=d}catch(j){pt(a,a.return,j)}}var ga=!1,dn=!1,u0=!1,BO=typeof WeakSet=="function"?WeakSet:Set,jn=null;function y6(a,o){if(a=a.containerInfo,T0=Kh,a=JN(a),ry(a)){if("selectionStart"in a)var d={start:a.selectionStart,end:a.selectionEnd};else e:{d=(d=a.ownerDocument)&&d.defaultView||window;var m=d.getSelection&&d.getSelection();if(m&&m.rangeCount!==0){d=m.anchorNode;var b=m.anchorOffset,j=m.focusNode;m=m.focusOffset;try{d.nodeType,j.nodeType}catch{d=null;break e}var _=0,M=-1,$=-1,ee=0,se=0,fe=a,te=null;t:for(;;){for(var ie;fe!==d||b!==0&&fe.nodeType!==3||(M=_+b),fe!==j||m!==0&&fe.nodeType!==3||($=_+m),fe.nodeType===3&&(_+=fe.nodeValue.length),(ie=fe.firstChild)!==null;)te=fe,fe=ie;for(;;){if(fe===a)break t;if(te===d&&++ee===b&&(M=_),te===j&&++se===m&&($=_),(ie=fe.nextSibling)!==null)break;fe=te,te=fe.parentNode}fe=ie}d=M===-1||$===-1?null:{start:M,end:$}}else d=null}d=d||{start:0,end:0}}else d=null;for(P0={focusedElem:a,selectionRange:d},Kh=!1,jn=o;jn!==null;)if(o=jn,a=o.child,(o.subtreeFlags&1028)!==0&&a!==null)a.return=o,jn=a;else for(;jn!==null;){switch(o=jn,j=o.alternate,a=o.flags,o.tag){case 0:if((a&4)!==0&&(a=o.updateQueue,a=a!==null?a.events:null,a!==null))for(d=0;d<a.length;d++)b=a[d],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&j!==null){a=void 0,d=o,b=j.memoizedProps,j=j.memoizedState,m=d.stateNode;try{var ke=po(d.type,b);a=m.getSnapshotBeforeUpdate(ke,j),m.__reactInternalSnapshotBeforeUpdate=a}catch(Le){pt(d,d.return,Le)}}break;case 3:if((a&1024)!==0){if(a=o.stateNode.containerInfo,d=a.nodeType,d===9)R0(a);else if(d===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":R0(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=o.sibling,a!==null){a.return=o.return,jn=a;break}jn=o.return}}function qO(a,o,d){var m=d.flags;switch(d.tag){case 0:case 11:case 15:ya(a,d),m&4&&Lu(5,d);break;case 1:if(ya(a,d),m&4)if(a=d.stateNode,o===null)try{a.componentDidMount()}catch(_){pt(d,d.return,_)}else{var b=po(d.type,o.memoizedProps);o=o.memoizedState;try{a.componentDidUpdate(b,o,a.__reactInternalSnapshotBeforeUpdate)}catch(_){pt(d,d.return,_)}}m&64&&DO(d),m&512&&$u(d,d.return);break;case 3:if(ya(a,d),m&64&&(a=d.updateQueue,a!==null)){if(o=null,d.child!==null)switch(d.child.tag){case 27:case 5:o=d.child.stateNode;break;case 1:o=d.child.stateNode}try{OC(a,o)}catch(_){pt(d,d.return,_)}}break;case 27:o===null&&m&4&&UO(d);case 26:case 5:ya(a,d),o===null&&m&4&&LO(d),m&512&&$u(d,d.return);break;case 12:ya(a,d);break;case 31:ya(a,d),m&4&&HO(a,d);break;case 13:ya(a,d),m&4&&GO(a,d),m&64&&(a=d.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(d=_6.bind(null,d),V6(a,d))));break;case 22:if(m=d.memoizedState!==null||ga,!m){o=o!==null&&o.memoizedState!==null||dn,b=ga;var j=dn;ga=m,(dn=o)&&!j?ba(a,d,(d.subtreeFlags&8772)!==0):ya(a,d),ga=b,dn=j}break;case 30:break;default:ya(a,d)}}function FO(a){var o=a.alternate;o!==null&&(a.alternate=null,FO(o)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(o=a.stateNode,o!==null&&bl(o)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var Mt=null,dr=!1;function va(a,o,d){for(d=d.child;d!==null;)KO(a,o,d),d=d.sibling}function KO(a,o,d){if($e&&typeof $e.onCommitFiberUnmount=="function")try{$e.onCommitFiberUnmount(An,d)}catch{}switch(d.tag){case 26:dn||Ii(d,o),va(a,o,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:dn||Ii(d,o);var m=Mt,b=dr;ds(d.type)&&(Mt=d.stateNode,dr=!1),va(a,o,d),Zu(d.stateNode),Mt=m,dr=b;break;case 5:dn||Ii(d,o);case 6:if(m=Mt,b=dr,Mt=null,va(a,o,d),Mt=m,dr=b,Mt!==null)if(dr)try{(Mt.nodeType===9?Mt.body:Mt.nodeName==="HTML"?Mt.ownerDocument.body:Mt).removeChild(d.stateNode)}catch(j){pt(d,o,j)}else try{Mt.removeChild(d.stateNode)}catch(j){pt(d,o,j)}break;case 18:Mt!==null&&(dr?(a=Mt,D_(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,d.stateNode),Jl(a)):D_(Mt,d.stateNode));break;case 4:m=Mt,b=dr,Mt=d.stateNode.containerInfo,dr=!0,va(a,o,d),Mt=m,dr=b;break;case 0:case 11:case 14:case 15:is(2,d,o),dn||is(4,d,o),va(a,o,d);break;case 1:dn||(Ii(d,o),m=d.stateNode,typeof m.componentWillUnmount=="function"&&IO(d,o,m)),va(a,o,d);break;case 21:va(a,o,d);break;case 22:dn=(m=dn)||d.memoizedState!==null,va(a,o,d),dn=m;break;default:va(a,o,d)}}function HO(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Jl(a)}catch(d){pt(o,o.return,d)}}}function GO(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Jl(a)}catch(d){pt(o,o.return,d)}}function b6(a){switch(a.tag){case 31:case 13:case 19:var o=a.stateNode;return o===null&&(o=a.stateNode=new BO),o;case 22:return a=a.stateNode,o=a._retryCache,o===null&&(o=a._retryCache=new BO),o;default:throw Error(r(435,a.tag))}}function Nh(a,o){var d=b6(a);o.forEach(function(m){if(!d.has(m)){d.add(m);var b=k6.bind(null,a,m);m.then(b,b)}})}function fr(a,o){var d=o.deletions;if(d!==null)for(var m=0;m<d.length;m++){var b=d[m],j=a,_=o,M=_;e:for(;M!==null;){switch(M.tag){case 27:if(ds(M.type)){Mt=M.stateNode,dr=!1;break e}break;case 5:Mt=M.stateNode,dr=!1;break e;case 3:case 4:Mt=M.stateNode.containerInfo,dr=!0;break e}M=M.return}if(Mt===null)throw Error(r(160));KO(j,_,b),Mt=null,dr=!1,j=b.alternate,j!==null&&(j.return=null),b.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)VO(o,a),o=o.sibling}var pi=null;function VO(a,o){var d=a.alternate,m=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:fr(o,a),hr(a),m&4&&(is(3,a,a.return),Lu(3,a),is(5,a,a.return));break;case 1:fr(o,a),hr(a),m&512&&(dn||d===null||Ii(d,d.return)),m&64&&ga&&(a=a.updateQueue,a!==null&&(m=a.callbacks,m!==null&&(d=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=d===null?m:d.concat(m))));break;case 26:var b=pi;if(fr(o,a),hr(a),m&512&&(dn||d===null||Ii(d,d.return)),m&4){var j=d!==null?d.memoizedState:null;if(m=a.memoizedState,d===null)if(m===null)if(a.stateNode===null){e:{m=a.type,d=a.memoizedProps,b=b.ownerDocument||b;t:switch(m){case"title":j=b.getElementsByTagName("title")[0],(!j||j[zi]||j[zt]||j.namespaceURI==="http://www.w3.org/2000/svg"||j.hasAttribute("itemprop"))&&(j=b.createElement(m),b.head.insertBefore(j,b.querySelector("head > title"))),zn(j,m,d),j[zt]=a,on(j),m=j;break e;case"link":var _=V_("link","href",b).get(m+(d.href||""));if(_){for(var M=0;M<_.length;M++)if(j=_[M],j.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&j.getAttribute("rel")===(d.rel==null?null:d.rel)&&j.getAttribute("title")===(d.title==null?null:d.title)&&j.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){_.splice(M,1);break t}}j=b.createElement(m),zn(j,m,d),b.head.appendChild(j);break;case"meta":if(_=V_("meta","content",b).get(m+(d.content||""))){for(M=0;M<_.length;M++)if(j=_[M],j.getAttribute("content")===(d.content==null?null:""+d.content)&&j.getAttribute("name")===(d.name==null?null:d.name)&&j.getAttribute("property")===(d.property==null?null:d.property)&&j.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&j.getAttribute("charset")===(d.charSet==null?null:d.charSet)){_.splice(M,1);break t}}j=b.createElement(m),zn(j,m,d),b.head.appendChild(j);break;default:throw Error(r(468,m))}j[zt]=a,on(j),m=j}a.stateNode=m}else Z_(b,a.type,a.stateNode);else a.stateNode=G_(b,m,a.memoizedProps);else j!==m?(j===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):j.count--,m===null?Z_(b,a.type,a.stateNode):G_(b,m,a.memoizedProps)):m===null&&a.stateNode!==null&&o0(a,a.memoizedProps,d.memoizedProps)}break;case 27:fr(o,a),hr(a),m&512&&(dn||d===null||Ii(d,d.return)),d!==null&&m&4&&o0(a,a.memoizedProps,d.memoizedProps);break;case 5:if(fr(o,a),hr(a),m&512&&(dn||d===null||Ii(d,d.return)),a.flags&32){b=a.stateNode;try{Sl(b,"")}catch(ke){pt(a,a.return,ke)}}m&4&&a.stateNode!=null&&(b=a.memoizedProps,o0(a,b,d!==null?d.memoizedProps:b)),m&1024&&(u0=!0);break;case 6:if(fr(o,a),hr(a),m&4){if(a.stateNode===null)throw Error(r(162));m=a.memoizedProps,d=a.stateNode;try{d.nodeValue=m}catch(ke){pt(a,a.return,ke)}}break;case 3:if(Uh=null,b=pi,pi=Lh(o.containerInfo),fr(o,a),pi=b,hr(a),m&4&&d!==null&&d.memoizedState.isDehydrated)try{Jl(o.containerInfo)}catch(ke){pt(a,a.return,ke)}u0&&(u0=!1,ZO(a));break;case 4:m=pi,pi=Lh(a.stateNode.containerInfo),fr(o,a),hr(a),pi=m;break;case 12:fr(o,a),hr(a);break;case 31:fr(o,a),hr(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Nh(a,m)));break;case 13:fr(o,a),hr(a),a.child.flags&8192&&a.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(Oh=st()),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Nh(a,m)));break;case 22:b=a.memoizedState!==null;var $=d!==null&&d.memoizedState!==null,ee=ga,se=dn;if(ga=ee||b,dn=se||$,fr(o,a),dn=se,ga=ee,hr(a),m&8192)e:for(o=a.stateNode,o._visibility=b?o._visibility&-2:o._visibility|1,b&&(d===null||$||ga||dn||mo(a)),d=null,o=a;;){if(o.tag===5||o.tag===26){if(d===null){$=d=o;try{if(j=$.stateNode,b)_=j.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{M=$.stateNode;var fe=$.memoizedProps.style,te=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;M.style.display=te==null||typeof te=="boolean"?"":(""+te).trim()}}catch(ke){pt($,$.return,ke)}}}else if(o.tag===6){if(d===null){$=o;try{$.stateNode.nodeValue=b?"":$.memoizedProps}catch(ke){pt($,$.return,ke)}}}else if(o.tag===18){if(d===null){$=o;try{var ie=$.stateNode;b?I_(ie,!0):I_($.stateNode,!1)}catch(ke){pt($,$.return,ke)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===a)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break e;for(;o.sibling===null;){if(o.return===null||o.return===a)break e;d===o&&(d=null),o=o.return}d===o&&(d=null),o.sibling.return=o.return,o=o.sibling}m&4&&(m=a.updateQueue,m!==null&&(d=m.retryQueue,d!==null&&(m.retryQueue=null,Nh(a,d))));break;case 19:fr(o,a),hr(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Nh(a,m)));break;case 30:break;case 21:break;default:fr(o,a),hr(a)}}function hr(a){var o=a.flags;if(o&2){try{for(var d,m=a.return;m!==null;){if($O(m)){d=m;break}m=m.return}if(d==null)throw Error(r(160));switch(d.tag){case 27:var b=d.stateNode,j=l0(a);jh(a,j,b);break;case 5:var _=d.stateNode;d.flags&32&&(Sl(_,""),d.flags&=-33);var M=l0(a);jh(a,M,_);break;case 3:case 4:var $=d.stateNode.containerInfo,ee=l0(a);c0(a,ee,$);break;default:throw Error(r(161))}}catch(se){pt(a,a.return,se)}a.flags&=-3}o&4096&&(a.flags&=-4097)}function ZO(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var o=a;ZO(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),a=a.sibling}}function ya(a,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)qO(a,o.alternate,o),o=o.sibling}function mo(a){for(a=a.child;a!==null;){var o=a;switch(o.tag){case 0:case 11:case 14:case 15:is(4,o,o.return),mo(o);break;case 1:Ii(o,o.return);var d=o.stateNode;typeof d.componentWillUnmount=="function"&&IO(o,o.return,d),mo(o);break;case 27:Zu(o.stateNode);case 26:case 5:Ii(o,o.return),mo(o);break;case 22:o.memoizedState===null&&mo(o);break;case 30:mo(o);break;default:mo(o)}a=a.sibling}}function ba(a,o,d){for(d=d&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var m=o.alternate,b=a,j=o,_=j.flags;switch(j.tag){case 0:case 11:case 15:ba(b,j,d),Lu(4,j);break;case 1:if(ba(b,j,d),m=j,b=m.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(ee){pt(m,m.return,ee)}if(m=j,b=m.updateQueue,b!==null){var M=m.stateNode;try{var $=b.shared.hiddenCallbacks;if($!==null)for(b.shared.hiddenCallbacks=null,b=0;b<$.length;b++)CC($[b],M)}catch(ee){pt(m,m.return,ee)}}d&&_&64&&DO(j),$u(j,j.return);break;case 27:UO(j);case 26:case 5:ba(b,j,d),d&&m===null&&_&4&&LO(j),$u(j,j.return);break;case 12:ba(b,j,d);break;case 31:ba(b,j,d),d&&_&4&&HO(b,j);break;case 13:ba(b,j,d),d&&_&4&&GO(b,j);break;case 22:j.memoizedState===null&&ba(b,j,d),$u(j,j.return);break;case 30:break;default:ba(b,j,d)}o=o.sibling}}function d0(a,o){var d=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(d=a.memoizedState.cachePool.pool),a=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(a=o.memoizedState.cachePool.pool),a!==d&&(a!=null&&a.refCount++,d!=null&&Cu(d))}function f0(a,o){a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&Cu(a))}function mi(a,o,d,m){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)YO(a,o,d,m),o=o.sibling}function YO(a,o,d,m){var b=o.flags;switch(o.tag){case 0:case 11:case 15:mi(a,o,d,m),b&2048&&Lu(9,o);break;case 1:mi(a,o,d,m);break;case 3:mi(a,o,d,m),b&2048&&(a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&Cu(a)));break;case 12:if(b&2048){mi(a,o,d,m),a=o.stateNode;try{var j=o.memoizedProps,_=j.id,M=j.onPostCommit;typeof M=="function"&&M(_,o.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch($){pt(o,o.return,$)}}else mi(a,o,d,m);break;case 31:mi(a,o,d,m);break;case 13:mi(a,o,d,m);break;case 23:break;case 22:j=o.stateNode,_=o.alternate,o.memoizedState!==null?j._visibility&2?mi(a,o,d,m):Uu(a,o):j._visibility&2?mi(a,o,d,m):(j._visibility|=2,ql(a,o,d,m,(o.subtreeFlags&10256)!==0||!1)),b&2048&&d0(_,o);break;case 24:mi(a,o,d,m),b&2048&&f0(o.alternate,o);break;default:mi(a,o,d,m)}}function ql(a,o,d,m,b){for(b=b&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var j=a,_=o,M=d,$=m,ee=_.flags;switch(_.tag){case 0:case 11:case 15:ql(j,_,M,$,b),Lu(8,_);break;case 23:break;case 22:var se=_.stateNode;_.memoizedState!==null?se._visibility&2?ql(j,_,M,$,b):Uu(j,_):(se._visibility|=2,ql(j,_,M,$,b)),b&&ee&2048&&d0(_.alternate,_);break;case 24:ql(j,_,M,$,b),b&&ee&2048&&f0(_.alternate,_);break;default:ql(j,_,M,$,b)}o=o.sibling}}function Uu(a,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var d=a,m=o,b=m.flags;switch(m.tag){case 22:Uu(d,m),b&2048&&d0(m.alternate,m);break;case 24:Uu(d,m),b&2048&&f0(m.alternate,m);break;default:Uu(d,m)}o=o.sibling}}var Bu=8192;function Fl(a,o,d){if(a.subtreeFlags&Bu)for(a=a.child;a!==null;)WO(a,o,d),a=a.sibling}function WO(a,o,d){switch(a.tag){case 26:Fl(a,o,d),a.flags&Bu&&a.memoizedState!==null&&aB(d,pi,a.memoizedState,a.memoizedProps);break;case 5:Fl(a,o,d);break;case 3:case 4:var m=pi;pi=Lh(a.stateNode.containerInfo),Fl(a,o,d),pi=m;break;case 22:a.memoizedState===null&&(m=a.alternate,m!==null&&m.memoizedState!==null?(m=Bu,Bu=16777216,Fl(a,o,d),Bu=m):Fl(a,o,d));break;default:Fl(a,o,d)}}function QO(a){var o=a.alternate;if(o!==null&&(a=o.child,a!==null)){o.child=null;do o=a.sibling,a.sibling=null,a=o;while(a!==null)}}function qu(a){var o=a.deletions;if((a.flags&16)!==0){if(o!==null)for(var d=0;d<o.length;d++){var m=o[d];jn=m,JO(m,a)}QO(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)XO(a),a=a.sibling}function XO(a){switch(a.tag){case 0:case 11:case 15:qu(a),a.flags&2048&&is(9,a,a.return);break;case 3:qu(a);break;case 12:qu(a);break;case 22:var o=a.stateNode;a.memoizedState!==null&&o._visibility&2&&(a.return===null||a.return.tag!==13)?(o._visibility&=-3,Ch(a)):qu(a);break;default:qu(a)}}function Ch(a){var o=a.deletions;if((a.flags&16)!==0){if(o!==null)for(var d=0;d<o.length;d++){var m=o[d];jn=m,JO(m,a)}QO(a)}for(a=a.child;a!==null;){switch(o=a,o.tag){case 0:case 11:case 15:is(8,o,o.return),Ch(o);break;case 22:d=o.stateNode,d._visibility&2&&(d._visibility&=-3,Ch(o));break;default:Ch(o)}a=a.sibling}}function JO(a,o){for(;jn!==null;){var d=jn;switch(d.tag){case 0:case 11:case 15:is(8,d,o);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var m=d.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Cu(d.memoizedState.cache)}if(m=d.child,m!==null)m.return=d,jn=m;else e:for(d=a;jn!==null;){m=jn;var b=m.sibling,j=m.return;if(FO(m),m===d){jn=null;break e}if(b!==null){b.return=j,jn=b;break e}jn=j}}}var x6={getCacheForType:function(a){var o=Tn(ln),d=o.data.get(a);return d===void 0&&(d=a(),o.data.set(a,d)),d},cacheSignal:function(){return Tn(ln).controller.signal}},w6=typeof WeakMap=="function"?WeakMap:Map,dt=0,jt=null,Ye=null,et=0,ht=0,_r=null,as=!1,Kl=!1,h0=!1,xa=0,Wt=0,ss=0,go=0,p0=0,kr=0,Hl=0,Fu=null,pr=null,m0=!1,Oh=0,e_=0,_h=1/0,kh=null,os=null,gn=0,ls=null,Gl=null,wa=0,g0=0,v0=null,t_=null,Ku=0,y0=null;function Ar(){return(dt&2)!==0&&et!==0?et&-et:V.T!==null?N0():vt()}function n_(){if(kr===0)if((et&536870912)===0||rt){var a=ia;ia<<=1,(ia&3932160)===0&&(ia=262144),kr=a}else kr=536870912;return a=Cr.current,a!==null&&(a.flags|=32),kr}function mr(a,o,d){(a===jt&&(ht===2||ht===9)||a.cancelPendingCommit!==null)&&(Vl(a,0),cs(a,et,kr,!1)),Js(a,d),((dt&2)===0||a!==jt)&&(a===jt&&((dt&2)===0&&(go|=d),Wt===4&&cs(a,et,kr,!1)),Li(a))}function r_(a,o,d){if((dt&6)!==0)throw Error(r(327));var m=!d&&(o&127)===0&&(o&a.expiredLanes)===0||Pi(a,o),b=m?N6(a,o):x0(a,o,!0),j=m;do{if(b===0){Kl&&!m&&cs(a,o,0,!1);break}else{if(d=a.current.alternate,j&&!S6(d)){b=x0(a,o,!1),j=!1;continue}if(b===2){if(j=o,a.errorRecoveryDisabledLanes&j)var _=0;else _=a.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){o=_;e:{var M=a;b=Fu;var $=M.current.memoizedState.isDehydrated;if($&&(Vl(M,_).flags|=256),_=x0(M,_,!1),_!==2){if(h0&&!$){M.errorRecoveryDisabledLanes|=j,go|=j,b=4;break e}j=pr,pr=b,j!==null&&(pr===null?pr=j:pr.push.apply(pr,j))}b=_}if(j=!1,b!==2)continue}}if(b===1){Vl(a,0),cs(a,o,0,!0);break}e:{switch(m=a,j=b,j){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:cs(m,o,kr,!as);break e;case 2:pr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(b=Oh+300-st(),10<b)){if(cs(m,o,kr,!as),vl(m,0,!0)!==0)break e;wa=o,m.timeoutHandle=M_(i_.bind(null,m,d,pr,kh,m0,o,kr,go,Hl,as,j,"Throttled",-0,0),b);break e}i_(m,d,pr,kh,m0,o,kr,go,Hl,as,j,null,-0,0)}}break}while(!0);Li(a)}function i_(a,o,d,m,b,j,_,M,$,ee,se,fe,te,ie){if(a.timeoutHandle=-1,fe=o.subtreeFlags,fe&8192||(fe&16785408)===16785408){fe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:sa},WO(o,j,fe);var ke=(j&62914560)===j?Oh-st():(j&4194048)===j?e_-st():0;if(ke=sB(fe,ke),ke!==null){wa=j,a.cancelPendingCommit=ke(f_.bind(null,a,o,j,d,m,b,_,M,$,se,fe,null,te,ie)),cs(a,j,_,!ee);return}}f_(a,o,j,d,m,b,_,M,$)}function S6(a){for(var o=a;;){var d=o.tag;if((d===0||d===11||d===15)&&o.flags&16384&&(d=o.updateQueue,d!==null&&(d=d.stores,d!==null)))for(var m=0;m<d.length;m++){var b=d[m],j=b.getSnapshot;b=b.value;try{if(!jr(j(),b))return!1}catch{return!1}}if(d=o.child,o.subtreeFlags&16384&&d!==null)d.return=o,o=d;else{if(o===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function cs(a,o,d,m){o&=~p0,o&=~go,a.suspendedLanes|=o,a.pingedLanes&=~o,m&&(a.warmLanes|=o),m=a.expirationTimes;for(var b=o;0<b;){var j=31-be(b),_=1<<j;m[j]=-1,b&=~_}d!==0&&If(a,d,o)}function Ah(){return(dt&6)===0?(Hu(0),!1):!0}function b0(){if(Ye!==null){if(ht===0)var a=Ye.return;else a=Ye,ua=so=null,Ry(a),Il=null,_u=0,a=Ye;for(;a!==null;)RO(a.alternate,a),a=a.return;Ye=null}}function Vl(a,o){var d=a.timeoutHandle;d!==-1&&(a.timeoutHandle=-1,q6(d)),d=a.cancelPendingCommit,d!==null&&(a.cancelPendingCommit=null,d()),wa=0,b0(),jt=a,Ye=d=la(a.current,null),et=o,ht=0,_r=null,as=!1,Kl=Pi(a,o),h0=!1,Hl=kr=p0=go=ss=Wt=0,pr=Fu=null,m0=!1,(o&8)!==0&&(o|=o&32);var m=a.entangledLanes;if(m!==0)for(a=a.entanglements,m&=o;0<m;){var b=31-be(m),j=1<<b;o|=a[b],m&=~j}return xa=o,Wf(),d}function a_(a,o){Ke=null,V.H=Ru,o===Dl||o===ih?(o=wC(),ht=3):o===jy?(o=wC(),ht=4):ht=o===Qy?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,_r=o,Ye===null&&(Wt=1,yh(a,$r(o,a.current)))}function s_(){var a=Cr.current;return a===null?!0:(et&4194048)===et?Fr===null:(et&62914560)===et||(et&536870912)!==0?a===Fr:!1}function o_(){var a=V.H;return V.H=Ru,a===null?Ru:a}function l_(){var a=V.A;return V.A=x6,a}function Eh(){Wt=4,as||(et&4194048)!==et&&Cr.current!==null||(Kl=!0),(ss&134217727)===0&&(go&134217727)===0||jt===null||cs(jt,et,kr,!1)}function x0(a,o,d){var m=dt;dt|=2;var b=o_(),j=l_();(jt!==a||et!==o)&&(kh=null,Vl(a,o)),o=!1;var _=Wt;e:do try{if(ht!==0&&Ye!==null){var M=Ye,$=_r;switch(ht){case 8:b0(),_=6;break e;case 3:case 2:case 9:case 6:Cr.current===null&&(o=!0);var ee=ht;if(ht=0,_r=null,Zl(a,M,$,ee),d&&Kl){_=0;break e}break;default:ee=ht,ht=0,_r=null,Zl(a,M,$,ee)}}j6(),_=Wt;break}catch(se){a_(a,se)}while(!0);return o&&a.shellSuspendCounter++,ua=so=null,dt=m,V.H=b,V.A=j,Ye===null&&(jt=null,et=0,Wf()),_}function j6(){for(;Ye!==null;)c_(Ye)}function N6(a,o){var d=dt;dt|=2;var m=o_(),b=l_();jt!==a||et!==o?(kh=null,_h=st()+500,Vl(a,o)):Kl=Pi(a,o);e:do try{if(ht!==0&&Ye!==null){o=Ye;var j=_r;t:switch(ht){case 1:ht=0,_r=null,Zl(a,o,j,1);break;case 2:case 9:if(bC(j)){ht=0,_r=null,u_(o);break}o=function(){ht!==2&&ht!==9||jt!==a||(ht=7),Li(a)},j.then(o,o);break e;case 3:ht=7;break e;case 4:ht=5;break e;case 7:bC(j)?(ht=0,_r=null,u_(o)):(ht=0,_r=null,Zl(a,o,j,7));break;case 5:var _=null;switch(Ye.tag){case 26:_=Ye.memoizedState;case 5:case 27:var M=Ye;if(_?Y_(_):M.stateNode.complete){ht=0,_r=null;var $=M.sibling;if($!==null)Ye=$;else{var ee=M.return;ee!==null?(Ye=ee,Th(ee)):Ye=null}break t}}ht=0,_r=null,Zl(a,o,j,5);break;case 6:ht=0,_r=null,Zl(a,o,j,6);break;case 8:b0(),Wt=6;break e;default:throw Error(r(462))}}C6();break}catch(se){a_(a,se)}while(!0);return ua=so=null,V.H=m,V.A=b,dt=d,Ye!==null?0:(jt=null,et=0,Wf(),Wt)}function C6(){for(;Ye!==null&&!St();)c_(Ye)}function c_(a){var o=zO(a.alternate,a,xa);a.memoizedProps=a.pendingProps,o===null?Th(a):Ye=o}function u_(a){var o=a,d=o.alternate;switch(o.tag){case 15:case 0:o=_O(d,o,o.pendingProps,o.type,void 0,et);break;case 11:o=_O(d,o,o.pendingProps,o.type.render,o.ref,et);break;case 5:Ry(o);default:RO(d,o),o=Ye=lC(o,xa),o=zO(d,o,xa)}a.memoizedProps=a.pendingProps,o===null?Th(a):Ye=o}function Zl(a,o,d,m){ua=so=null,Ry(o),Il=null,_u=0;var b=o.return;try{if(h6(a,b,o,d,et)){Wt=1,yh(a,$r(d,a.current)),Ye=null;return}}catch(j){if(b!==null)throw Ye=b,j;Wt=1,yh(a,$r(d,a.current)),Ye=null;return}o.flags&32768?(rt||m===1?a=!0:Kl||(et&536870912)!==0?a=!1:(as=a=!0,(m===2||m===9||m===3||m===6)&&(m=Cr.current,m!==null&&m.tag===13&&(m.flags|=16384))),d_(o,a)):Th(o)}function Th(a){var o=a;do{if((o.flags&32768)!==0){d_(o,as);return}a=o.return;var d=g6(o.alternate,o,xa);if(d!==null){Ye=d;return}if(o=o.sibling,o!==null){Ye=o;return}Ye=o=a}while(o!==null);Wt===0&&(Wt=5)}function d_(a,o){do{var d=v6(a.alternate,a);if(d!==null){d.flags&=32767,Ye=d;return}if(d=a.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!o&&(a=a.sibling,a!==null)){Ye=a;return}Ye=a=d}while(a!==null);Wt=6,Ye=null}function f_(a,o,d,m,b,j,_,M,$){a.cancelPendingCommit=null;do Ph();while(gn!==0);if((dt&6)!==0)throw Error(r(327));if(o!==null){if(o===a.current)throw Error(r(177));if(j=o.lanes|o.childLanes,j|=ly,$v(a,d,j,_,M,$),a===jt&&(Ye=jt=null,et=0),Gl=o,ls=a,wa=d,g0=j,v0=b,t_=m,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,A6(cr,function(){return v_(),null})):(a.callbackNode=null,a.callbackPriority=0),m=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||m){m=V.T,V.T=null,b=re.p,re.p=2,_=dt,dt|=4;try{y6(a,o,d)}finally{dt=_,re.p=b,V.T=m}}gn=1,h_(),p_(),m_()}}function h_(){if(gn===1){gn=0;var a=ls,o=Gl,d=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||d){d=V.T,V.T=null;var m=re.p;re.p=2;var b=dt;dt|=4;try{VO(o,a);var j=P0,_=JN(a.containerInfo),M=j.focusedElem,$=j.selectionRange;if(_!==M&&M&&M.ownerDocument&&XN(M.ownerDocument.documentElement,M)){if($!==null&&ry(M)){var ee=$.start,se=$.end;if(se===void 0&&(se=ee),"selectionStart"in M)M.selectionStart=ee,M.selectionEnd=Math.min(se,M.value.length);else{var fe=M.ownerDocument||document,te=fe&&fe.defaultView||window;if(te.getSelection){var ie=te.getSelection(),ke=M.textContent.length,Le=Math.min($.start,ke),wt=$.end===void 0?Le:Math.min($.end,ke);!ie.extend&&Le>wt&&(_=wt,wt=Le,Le=_);var Y=QN(M,Le),H=QN(M,wt);if(Y&&H&&(ie.rangeCount!==1||ie.anchorNode!==Y.node||ie.anchorOffset!==Y.offset||ie.focusNode!==H.node||ie.focusOffset!==H.offset)){var J=fe.createRange();J.setStart(Y.node,Y.offset),ie.removeAllRanges(),Le>wt?(ie.addRange(J),ie.extend(H.node,H.offset)):(J.setEnd(H.node,H.offset),ie.addRange(J))}}}}for(fe=[],ie=M;ie=ie.parentNode;)ie.nodeType===1&&fe.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<fe.length;M++){var ce=fe[M];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}Kh=!!T0,P0=T0=null}finally{dt=b,re.p=m,V.T=d}}a.current=o,gn=2}}function p_(){if(gn===2){gn=0;var a=ls,o=Gl,d=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||d){d=V.T,V.T=null;var m=re.p;re.p=2;var b=dt;dt|=4;try{qO(a,o.alternate,o)}finally{dt=b,re.p=m,V.T=d}}gn=3}}function m_(){if(gn===4||gn===3){gn=0,lr();var a=ls,o=Gl,d=wa,m=t_;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?gn=5:(gn=0,Gl=ls=null,g_(a,a.pendingLanes));var b=a.pendingLanes;if(b===0&&(os=null),xe(d),o=o.stateNode,$e&&typeof $e.onCommitFiberRoot=="function")try{$e.onCommitFiberRoot(An,o,void 0,(o.current.flags&128)===128)}catch{}if(m!==null){o=V.T,b=re.p,re.p=2,V.T=null;try{for(var j=a.onRecoverableError,_=0;_<m.length;_++){var M=m[_];j(M.value,{componentStack:M.stack})}}finally{V.T=o,re.p=b}}(wa&3)!==0&&Ph(),Li(a),b=a.pendingLanes,(d&261930)!==0&&(b&42)!==0?a===y0?Ku++:(Ku=0,y0=a):Ku=0,Hu(0)}}function g_(a,o){(a.pooledCacheLanes&=o)===0&&(o=a.pooledCache,o!=null&&(a.pooledCache=null,Cu(o)))}function Ph(){return h_(),p_(),m_(),v_()}function v_(){if(gn!==5)return!1;var a=ls,o=g0;g0=0;var d=xe(wa),m=V.T,b=re.p;try{re.p=32>d?32:d,V.T=null,d=v0,v0=null;var j=ls,_=wa;if(gn=0,Gl=ls=null,wa=0,(dt&6)!==0)throw Error(r(331));var M=dt;if(dt|=4,XO(j.current),YO(j,j.current,_,d),dt=M,Hu(0,!1),$e&&typeof $e.onPostCommitFiberRoot=="function")try{$e.onPostCommitFiberRoot(An,j)}catch{}return!0}finally{re.p=b,V.T=m,g_(a,o)}}function y_(a,o,d){o=$r(d,o),o=Wy(a.stateNode,o,2),a=ts(a,o,2),a!==null&&(Js(a,2),Li(a))}function pt(a,o,d){if(a.tag===3)y_(a,a,d);else for(;o!==null;){if(o.tag===3){y_(o,a,d);break}else if(o.tag===1){var m=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(os===null||!os.has(m))){a=$r(d,a),d=bO(2),m=ts(o,d,2),m!==null&&(xO(d,m,o,a),Js(m,2),Li(m));break}}o=o.return}}function w0(a,o,d){var m=a.pingCache;if(m===null){m=a.pingCache=new w6;var b=new Set;m.set(o,b)}else b=m.get(o),b===void 0&&(b=new Set,m.set(o,b));b.has(d)||(h0=!0,b.add(d),a=O6.bind(null,a,o,d),o.then(a,a))}function O6(a,o,d){var m=a.pingCache;m!==null&&m.delete(o),a.pingedLanes|=a.suspendedLanes&d,a.warmLanes&=~d,jt===a&&(et&d)===d&&(Wt===4||Wt===3&&(et&62914560)===et&&300>st()-Oh?(dt&2)===0&&Vl(a,0):p0|=d,Hl===et&&(Hl=0)),Li(a)}function b_(a,o){o===0&&(o=Df()),a=ro(a,o),a!==null&&(Js(a,o),Li(a))}function _6(a){var o=a.memoizedState,d=0;o!==null&&(d=o.retryLane),b_(a,d)}function k6(a,o){var d=0;switch(a.tag){case 31:case 13:var m=a.stateNode,b=a.memoizedState;b!==null&&(d=b.retryLane);break;case 19:m=a.stateNode;break;case 22:m=a.stateNode._retryCache;break;default:throw Error(r(314))}m!==null&&m.delete(o),b_(a,d)}function A6(a,o){return he(a,o)}var zh=null,Yl=null,S0=!1,Mh=!1,j0=!1,us=0;function Li(a){a!==Yl&&a.next===null&&(Yl===null?zh=Yl=a:Yl=Yl.next=a),Mh=!0,S0||(S0=!0,T6())}function Hu(a,o){if(!j0&&Mh){j0=!0;do for(var d=!1,m=zh;m!==null;){if(a!==0){var b=m.pendingLanes;if(b===0)var j=0;else{var _=m.suspendedLanes,M=m.pingedLanes;j=(1<<31-be(42|a)+1)-1,j&=b&~(_&~M),j=j&201326741?j&201326741|1:j?j|2:0}j!==0&&(d=!0,j_(m,j))}else j=et,j=vl(m,m===jt?j:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(j&3)===0||Pi(m,j)||(d=!0,j_(m,j));m=m.next}while(d);j0=!1}}function E6(){x_()}function x_(){Mh=S0=!1;var a=0;us!==0&&B6()&&(a=us);for(var o=st(),d=null,m=zh;m!==null;){var b=m.next,j=w_(m,o);j===0?(m.next=null,d===null?zh=b:d.next=b,b===null&&(Yl=d)):(d=m,(a!==0||(j&3)!==0)&&(Mh=!0)),m=b}gn!==0&&gn!==5||Hu(a),us!==0&&(us=0)}function w_(a,o){for(var d=a.suspendedLanes,m=a.pingedLanes,b=a.expirationTimes,j=a.pendingLanes&-62914561;0<j;){var _=31-be(j),M=1<<_,$=b[_];$===-1?((M&d)===0||(M&m)!==0)&&(b[_]=Rf(M,o)):$<=o&&(a.expiredLanes|=M),j&=~M}if(o=jt,d=et,d=vl(a,a===o?d:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m=a.callbackNode,d===0||a===o&&(ht===2||ht===9)||a.cancelPendingCommit!==null)return m!==null&&m!==null&&Fe(m),a.callbackNode=null,a.callbackPriority=0;if((d&3)===0||Pi(a,d)){if(o=d&-d,o===a.callbackPriority)return o;switch(m!==null&&Fe(m),xe(d)){case 2:case 8:d=Pt;break;case 32:d=cr;break;case 268435456:d=Qs;break;default:d=cr}return m=S_.bind(null,a),d=he(d,m),a.callbackPriority=o,a.callbackNode=d,o}return m!==null&&m!==null&&Fe(m),a.callbackPriority=2,a.callbackNode=null,2}function S_(a,o){if(gn!==0&&gn!==5)return a.callbackNode=null,a.callbackPriority=0,null;var d=a.callbackNode;if(Ph()&&a.callbackNode!==d)return null;var m=et;return m=vl(a,a===jt?m:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m===0?null:(r_(a,m,o),w_(a,st()),a.callbackNode!=null&&a.callbackNode===d?S_.bind(null,a):null)}function j_(a,o){if(Ph())return null;r_(a,o,!0)}function T6(){F6(function(){(dt&6)!==0?he(at,E6):x_()})}function N0(){if(us===0){var a=Ml;a===0&&(a=Fa,Fa<<=1,(Fa&261888)===0&&(Fa=256)),us=a}return us}function N_(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:qf(""+a)}function C_(a,o){var d=o.ownerDocument.createElement("input");return d.name=o.name,d.value=o.value,a.id&&d.setAttribute("form",a.id),o.parentNode.insertBefore(d,o),a=new FormData(a),d.parentNode.removeChild(d),a}function P6(a,o,d,m,b){if(o==="submit"&&d&&d.stateNode===b){var j=N_((b[Zt]||null).action),_=m.submitter;_&&(o=(o=_[Zt]||null)?N_(o.formAction):_.getAttribute("formAction"),o!==null&&(j=o,_=null));var M=new Gf("action","action",null,m,b);a.push({event:M,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(us!==0){var $=_?C_(b,_):new FormData(b);Ky(d,{pending:!0,data:$,method:b.method,action:j},null,$)}}else typeof j=="function"&&(M.preventDefault(),$=_?C_(b,_):new FormData(b),Ky(d,{pending:!0,data:$,method:b.method,action:j},j,$))},currentTarget:b}]})}}for(var C0=0;C0<oy.length;C0++){var O0=oy[C0],z6=O0.toLowerCase(),M6=O0[0].toUpperCase()+O0.slice(1);hi(z6,"on"+M6)}hi(nC,"onAnimationEnd"),hi(rC,"onAnimationIteration"),hi(iC,"onAnimationStart"),hi("dblclick","onDoubleClick"),hi("focusin","onFocus"),hi("focusout","onBlur"),hi(WU,"onTransitionRun"),hi(QU,"onTransitionStart"),hi(XU,"onTransitionCancel"),hi(aC,"onTransitionEnd"),Qn("onMouseEnter",["mouseout","mouseover"]),Qn("onMouseLeave",["mouseout","mouseover"]),Qn("onPointerEnter",["pointerout","pointerover"]),Qn("onPointerLeave",["pointerout","pointerover"]),mn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),mn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),mn("onBeforeInput",["compositionend","keypress","textInput","paste"]),mn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),mn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),mn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Gu="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(" "),R6=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Gu));function O_(a,o){o=(o&4)!==0;for(var d=0;d<a.length;d++){var m=a[d],b=m.event;m=m.listeners;e:{var j=void 0;if(o)for(var _=m.length-1;0<=_;_--){var M=m[_],$=M.instance,ee=M.currentTarget;if(M=M.listener,$!==j&&b.isPropagationStopped())break e;j=M,b.currentTarget=ee;try{j(b)}catch(se){Yf(se)}b.currentTarget=null,j=$}else for(_=0;_<m.length;_++){if(M=m[_],$=M.instance,ee=M.currentTarget,M=M.listener,$!==j&&b.isPropagationStopped())break e;j=M,b.currentTarget=ee;try{j(b)}catch(se){Yf(se)}b.currentTarget=null,j=$}}}}function We(a,o){var d=o[Bn];d===void 0&&(d=o[Bn]=new Set);var m=a+"__bubble";d.has(m)||(__(o,a,2,!1),d.add(m))}function _0(a,o,d){var m=0;o&&(m|=4),__(d,a,m,o)}var Rh="_reactListening"+Math.random().toString(36).slice(2);function k0(a){if(!a[Rh]){a[Rh]=!0,Je.forEach(function(d){d!=="selectionchange"&&(R6.has(d)||_0(d,!1,a),_0(d,!0,a))});var o=a.nodeType===9?a:a.ownerDocument;o===null||o[Rh]||(o[Rh]=!0,_0("selectionchange",!1,o))}}function __(a,o,d,m){switch(nk(o)){case 2:var b=cB;break;case 8:b=uB;break;default:b=F0}d=b.bind(null,o,d,a),b=void 0,!Zv||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(b=!0),m?b!==void 0?a.addEventListener(o,d,{capture:!0,passive:b}):a.addEventListener(o,d,!0):b!==void 0?a.addEventListener(o,d,{passive:b}):a.addEventListener(o,d,!1)}function A0(a,o,d,m,b){var j=m;if((o&1)===0&&(o&2)===0&&m!==null)e:for(;;){if(m===null)return;var _=m.tag;if(_===3||_===4){var M=m.stateNode.containerInfo;if(M===b)break;if(_===4)for(_=m.return;_!==null;){var $=_.tag;if(($===3||$===4)&&_.stateNode.containerInfo===b)return;_=_.return}for(;M!==null;){if(_=Ga(M),_===null)return;if($=_.tag,$===5||$===6||$===26||$===27){m=j=_;continue e}M=M.parentNode}}m=m.return}PN(function(){var ee=j,se=Gv(d),fe=[];e:{var te=sC.get(a);if(te!==void 0){var ie=Gf,ke=a;switch(a){case"keypress":if(Kf(d)===0)break e;case"keydown":case"keyup":ie=kU;break;case"focusin":ke="focus",ie=Xv;break;case"focusout":ke="blur",ie=Xv;break;case"beforeblur":case"afterblur":ie=Xv;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=RN;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=gU;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=TU;break;case nC:case rC:case iC:ie=bU;break;case aC:ie=zU;break;case"scroll":case"scrollend":ie=pU;break;case"wheel":ie=RU;break;case"copy":case"cut":case"paste":ie=wU;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=IN;break;case"toggle":case"beforetoggle":ie=IU}var Le=(o&4)!==0,wt=!Le&&(a==="scroll"||a==="scrollend"),Y=Le?te!==null?te+"Capture":null:te;Le=[];for(var H=ee,J;H!==null;){var ce=H;if(J=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||J===null||Y===null||(ce=pu(H,Y),ce!=null&&Le.push(Vu(H,ce,J))),wt)break;H=H.return}0<Le.length&&(te=new ie(te,ke,null,d,se),fe.push({event:te,listeners:Le}))}}if((o&7)===0){e:{if(te=a==="mouseover"||a==="pointerover",ie=a==="mouseout"||a==="pointerout",te&&d!==Hv&&(ke=d.relatedTarget||d.fromElement)&&(Ga(ke)||ke[Sr]))break e;if((ie||te)&&(te=se.window===se?se:(te=se.ownerDocument)?te.defaultView||te.parentWindow:window,ie?(ke=d.relatedTarget||d.toElement,ie=ee,ke=ke?Ga(ke):null,ke!==null&&(wt=s(ke),Le=ke.tag,ke!==wt||Le!==5&&Le!==27&&Le!==6)&&(ke=null)):(ie=null,ke=ee),ie!==ke)){if(Le=RN,ce="onMouseLeave",Y="onMouseEnter",H="mouse",(a==="pointerout"||a==="pointerover")&&(Le=IN,ce="onPointerLeave",Y="onPointerEnter",H="pointer"),wt=ie==null?te:Mi(ie),J=ke==null?te:Mi(ke),te=new Le(ce,H+"leave",ie,d,se),te.target=wt,te.relatedTarget=J,ce=null,Ga(se)===ee&&(Le=new Le(Y,H+"enter",ke,d,se),Le.target=J,Le.relatedTarget=wt,ce=Le),wt=ce,ie&&ke)t:{for(Le=D6,Y=ie,H=ke,J=0,ce=Y;ce;ce=Le(ce))J++;ce=0;for(var Ie=H;Ie;Ie=Le(Ie))ce++;for(;0<J-ce;)Y=Le(Y),J--;for(;0<ce-J;)H=Le(H),ce--;for(;J--;){if(Y===H||H!==null&&Y===H.alternate){Le=Y;break t}Y=Le(Y),H=Le(H)}Le=null}else Le=null;ie!==null&&k_(fe,te,ie,Le,!1),ke!==null&&wt!==null&&k_(fe,wt,ke,Le,!0)}}e:{if(te=ee?Mi(ee):window,ie=te.nodeName&&te.nodeName.toLowerCase(),ie==="select"||ie==="input"&&te.type==="file")var ot=HN;else if(FN(te))if(GN)ot=VU;else{ot=HU;var ze=KU}else ie=te.nodeName,!ie||ie.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?ee&&Kv(ee.elementType)&&(ot=HN):ot=GU;if(ot&&(ot=ot(a,ee))){KN(fe,ot,d,se);break e}ze&&ze(a,te,ee),a==="focusout"&&ee&&te.type==="number"&&ee.memoizedProps.value!=null&&Fv(te,"number",te.value)}switch(ze=ee?Mi(ee):window,a){case"focusin":(FN(ze)||ze.contentEditable==="true")&&(Ol=ze,iy=ee,Su=null);break;case"focusout":Su=iy=Ol=null;break;case"mousedown":ay=!0;break;case"contextmenu":case"mouseup":case"dragend":ay=!1,eC(fe,d,se);break;case"selectionchange":if(YU)break;case"keydown":case"keyup":eC(fe,d,se)}var Ge;if(ey)e:{switch(a){case"compositionstart":var tt="onCompositionStart";break e;case"compositionend":tt="onCompositionEnd";break e;case"compositionupdate":tt="onCompositionUpdate";break e}tt=void 0}else Cl?BN(a,d)&&(tt="onCompositionEnd"):a==="keydown"&&d.keyCode===229&&(tt="onCompositionStart");tt&&(LN&&d.locale!=="ko"&&(Cl||tt!=="onCompositionStart"?tt==="onCompositionEnd"&&Cl&&(Ge=zN()):(Za=se,Yv="value"in Za?Za.value:Za.textContent,Cl=!0)),ze=Dh(ee,tt),0<ze.length&&(tt=new DN(tt,a,null,d,se),fe.push({event:tt,listeners:ze}),Ge?tt.data=Ge:(Ge=qN(d),Ge!==null&&(tt.data=Ge)))),(Ge=$U?UU(a,d):BU(a,d))&&(tt=Dh(ee,"onBeforeInput"),0<tt.length&&(ze=new DN("onBeforeInput","beforeinput",null,d,se),fe.push({event:ze,listeners:tt}),ze.data=Ge)),P6(fe,a,ee,d,se)}O_(fe,o)})}function Vu(a,o,d){return{instance:a,listener:o,currentTarget:d}}function Dh(a,o){for(var d=o+"Capture",m=[];a!==null;){var b=a,j=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||j===null||(b=pu(a,d),b!=null&&m.unshift(Vu(a,b,j)),b=pu(a,o),b!=null&&m.push(Vu(a,b,j))),a.tag===3)return m;a=a.return}return[]}function D6(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function k_(a,o,d,m,b){for(var j=o._reactName,_=[];d!==null&&d!==m;){var M=d,$=M.alternate,ee=M.stateNode;if(M=M.tag,$!==null&&$===m)break;M!==5&&M!==26&&M!==27||ee===null||($=ee,b?(ee=pu(d,j),ee!=null&&_.unshift(Vu(d,ee,$))):b||(ee=pu(d,j),ee!=null&&_.push(Vu(d,ee,$)))),d=d.return}_.length!==0&&a.push({event:o,listeners:_})}var I6=/\r\n?/g,L6=/\u0000|\uFFFD/g;function A_(a){return(typeof a=="string"?a:""+a).replace(I6,`
9
- `).replace(L6,"")}function E_(a,o){return o=A_(o),A_(a)===o}function xt(a,o,d,m,b,j){switch(d){case"children":typeof m=="string"?o==="body"||o==="textarea"&&m===""||Sl(a,m):(typeof m=="number"||typeof m=="bigint")&&o!=="body"&&Sl(a,""+m);break;case"className":Uf(a,"class",m);break;case"tabIndex":Uf(a,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Uf(a,d,m);break;case"style":EN(a,m,j);break;case"data":if(o!=="object"){Uf(a,"data",m);break}case"src":case"href":if(m===""&&(o!=="a"||d!=="href")){a.removeAttribute(d);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(d);break}m=qf(""+m),a.setAttribute(d,m);break;case"action":case"formAction":if(typeof m=="function"){a.setAttribute(d,"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 j=="function"&&(d==="formAction"?(o!=="input"&&xt(a,o,"name",b.name,b,null),xt(a,o,"formEncType",b.formEncType,b,null),xt(a,o,"formMethod",b.formMethod,b,null),xt(a,o,"formTarget",b.formTarget,b,null)):(xt(a,o,"encType",b.encType,b,null),xt(a,o,"method",b.method,b,null),xt(a,o,"target",b.target,b,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(d);break}m=qf(""+m),a.setAttribute(d,m);break;case"onClick":m!=null&&(a.onclick=sa);break;case"onScroll":m!=null&&We("scroll",a);break;case"onScrollEnd":m!=null&&We("scrollend",a);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(d=m.__html,d!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=d}}break;case"multiple":a.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":a.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){a.removeAttribute("xlink:href");break}d=qf(""+m),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(d,""+m):a.removeAttribute(d);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":m&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(d,""):a.removeAttribute(d);break;case"capture":case"download":m===!0?a.setAttribute(d,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(d,m):a.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?a.setAttribute(d,m):a.removeAttribute(d);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?a.removeAttribute(d):a.setAttribute(d,m);break;case"popover":We("beforetoggle",a),We("toggle",a),$f(a,"popover",m);break;case"xlinkActuate":aa(a,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":aa(a,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":aa(a,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":aa(a,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":aa(a,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":aa(a,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":aa(a,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":aa(a,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":aa(a,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":$f(a,"is",m);break;case"innerText":case"textContent":break;default:(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(d=fU.get(d)||d,$f(a,d,m))}}function E0(a,o,d,m,b,j){switch(d){case"style":EN(a,m,j);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(d=m.__html,d!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=d}}break;case"children":typeof m=="string"?Sl(a,m):(typeof m=="number"||typeof m=="bigint")&&Sl(a,""+m);break;case"onScroll":m!=null&&We("scroll",a);break;case"onScrollEnd":m!=null&&We("scrollend",a);break;case"onClick":m!=null&&(a.onclick=sa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!yt.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(b=d.endsWith("Capture"),o=d.slice(2,b?d.length-7:void 0),j=a[Zt]||null,j=j!=null?j[d]:null,typeof j=="function"&&a.removeEventListener(o,j,b),typeof m=="function")){typeof j!="function"&&j!==null&&(d in a?a[d]=null:a.hasAttribute(d)&&a.removeAttribute(d)),a.addEventListener(o,m,b);break e}d in a?a[d]=m:m===!0?a.setAttribute(d,""):$f(a,d,m)}}}function zn(a,o,d){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":We("error",a),We("load",a);var m=!1,b=!1,j;for(j in d)if(d.hasOwnProperty(j)){var _=d[j];if(_!=null)switch(j){case"src":m=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:xt(a,o,j,_,d,null)}}b&&xt(a,o,"srcSet",d.srcSet,d,null),m&&xt(a,o,"src",d.src,d,null);return;case"input":We("invalid",a);var M=j=_=b=null,$=null,ee=null;for(m in d)if(d.hasOwnProperty(m)){var se=d[m];if(se!=null)switch(m){case"name":b=se;break;case"type":_=se;break;case"checked":$=se;break;case"defaultChecked":ee=se;break;case"value":j=se;break;case"defaultValue":M=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(r(137,o));break;default:xt(a,o,m,se,d,null)}}ON(a,j,M,$,ee,_,b,!1);return;case"select":We("invalid",a),m=_=j=null;for(b in d)if(d.hasOwnProperty(b)&&(M=d[b],M!=null))switch(b){case"value":j=M;break;case"defaultValue":_=M;break;case"multiple":m=M;default:xt(a,o,b,M,d,null)}o=j,d=_,a.multiple=!!m,o!=null?wl(a,!!m,o,!1):d!=null&&wl(a,!!m,d,!0);return;case"textarea":We("invalid",a),j=b=m=null;for(_ in d)if(d.hasOwnProperty(_)&&(M=d[_],M!=null))switch(_){case"value":m=M;break;case"defaultValue":b=M;break;case"children":j=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(r(91));break;default:xt(a,o,_,M,d,null)}kN(a,m,b,j);return;case"option":for($ in d)d.hasOwnProperty($)&&(m=d[$],m!=null)&&($==="selected"?a.selected=m&&typeof m!="function"&&typeof m!="symbol":xt(a,o,$,m,d,null));return;case"dialog":We("beforetoggle",a),We("toggle",a),We("cancel",a),We("close",a);break;case"iframe":case"object":We("load",a);break;case"video":case"audio":for(m=0;m<Gu.length;m++)We(Gu[m],a);break;case"image":We("error",a),We("load",a);break;case"details":We("toggle",a);break;case"embed":case"source":case"link":We("error",a),We("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ee in d)if(d.hasOwnProperty(ee)&&(m=d[ee],m!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:xt(a,o,ee,m,d,null)}return;default:if(Kv(o)){for(se in d)d.hasOwnProperty(se)&&(m=d[se],m!==void 0&&E0(a,o,se,m,d,void 0));return}}for(M in d)d.hasOwnProperty(M)&&(m=d[M],m!=null&&xt(a,o,M,m,d,null))}function $6(a,o,d,m){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,j=null,_=null,M=null,$=null,ee=null,se=null;for(ie in d){var fe=d[ie];if(d.hasOwnProperty(ie)&&fe!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":$=fe;default:m.hasOwnProperty(ie)||xt(a,o,ie,null,m,fe)}}for(var te in m){var ie=m[te];if(fe=d[te],m.hasOwnProperty(te)&&(ie!=null||fe!=null))switch(te){case"type":j=ie;break;case"name":b=ie;break;case"checked":ee=ie;break;case"defaultChecked":se=ie;break;case"value":_=ie;break;case"defaultValue":M=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,o));break;default:ie!==fe&&xt(a,o,te,ie,m,fe)}}qv(a,_,M,$,ee,se,j,b);return;case"select":ie=_=M=te=null;for(j in d)if($=d[j],d.hasOwnProperty(j)&&$!=null)switch(j){case"value":break;case"multiple":ie=$;default:m.hasOwnProperty(j)||xt(a,o,j,null,m,$)}for(b in m)if(j=m[b],$=d[b],m.hasOwnProperty(b)&&(j!=null||$!=null))switch(b){case"value":te=j;break;case"defaultValue":M=j;break;case"multiple":_=j;default:j!==$&&xt(a,o,b,j,m,$)}o=M,d=_,m=ie,te!=null?wl(a,!!d,te,!1):!!m!=!!d&&(o!=null?wl(a,!!d,o,!0):wl(a,!!d,d?[]:"",!1));return;case"textarea":ie=te=null;for(M in d)if(b=d[M],d.hasOwnProperty(M)&&b!=null&&!m.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:xt(a,o,M,null,m,b)}for(_ in m)if(b=m[_],j=d[_],m.hasOwnProperty(_)&&(b!=null||j!=null))switch(_){case"value":te=b;break;case"defaultValue":ie=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==j&&xt(a,o,_,b,m,j)}_N(a,te,ie);return;case"option":for(var ke in d)te=d[ke],d.hasOwnProperty(ke)&&te!=null&&!m.hasOwnProperty(ke)&&(ke==="selected"?a.selected=!1:xt(a,o,ke,null,m,te));for($ in m)te=m[$],ie=d[$],m.hasOwnProperty($)&&te!==ie&&(te!=null||ie!=null)&&($==="selected"?a.selected=te&&typeof te!="function"&&typeof te!="symbol":xt(a,o,$,te,m,ie));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 Le in d)te=d[Le],d.hasOwnProperty(Le)&&te!=null&&!m.hasOwnProperty(Le)&&xt(a,o,Le,null,m,te);for(ee in m)if(te=m[ee],ie=d[ee],m.hasOwnProperty(ee)&&te!==ie&&(te!=null||ie!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(r(137,o));break;default:xt(a,o,ee,te,m,ie)}return;default:if(Kv(o)){for(var wt in d)te=d[wt],d.hasOwnProperty(wt)&&te!==void 0&&!m.hasOwnProperty(wt)&&E0(a,o,wt,void 0,m,te);for(se in m)te=m[se],ie=d[se],!m.hasOwnProperty(se)||te===ie||te===void 0&&ie===void 0||E0(a,o,se,te,m,ie);return}}for(var Y in d)te=d[Y],d.hasOwnProperty(Y)&&te!=null&&!m.hasOwnProperty(Y)&&xt(a,o,Y,null,m,te);for(fe in m)te=m[fe],ie=d[fe],!m.hasOwnProperty(fe)||te===ie||te==null&&ie==null||xt(a,o,fe,te,m,ie)}function T_(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function U6(){if(typeof performance.getEntriesByType=="function"){for(var a=0,o=0,d=performance.getEntriesByType("resource"),m=0;m<d.length;m++){var b=d[m],j=b.transferSize,_=b.initiatorType,M=b.duration;if(j&&M&&T_(_)){for(_=0,M=b.responseEnd,m+=1;m<d.length;m++){var $=d[m],ee=$.startTime;if(ee>M)break;var se=$.transferSize,fe=$.initiatorType;se&&T_(fe)&&($=$.responseEnd,_+=se*($<M?1:(M-ee)/($-ee)))}if(--m,o+=8*(j+_)/(b.duration/1e3),a++,10<a)break}}if(0<a)return o/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var T0=null,P0=null;function Ih(a){return a.nodeType===9?a:a.ownerDocument}function P_(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function z_(a,o){if(a===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&o==="foreignObject"?0:a}function z0(a,o){return a==="textarea"||a==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var M0=null;function B6(){var a=window.event;return a&&a.type==="popstate"?a===M0?!1:(M0=a,!0):(M0=null,!1)}var M_=typeof setTimeout=="function"?setTimeout:void 0,q6=typeof clearTimeout=="function"?clearTimeout:void 0,R_=typeof Promise=="function"?Promise:void 0,F6=typeof queueMicrotask=="function"?queueMicrotask:typeof R_<"u"?function(a){return R_.resolve(null).then(a).catch(K6)}:M_;function K6(a){setTimeout(function(){throw a})}function ds(a){return a==="head"}function D_(a,o){var d=o,m=0;do{var b=d.nextSibling;if(a.removeChild(d),b&&b.nodeType===8)if(d=b.data,d==="/$"||d==="/&"){if(m===0){a.removeChild(b),Jl(o);return}m--}else if(d==="$"||d==="$?"||d==="$~"||d==="$!"||d==="&")m++;else if(d==="html")Zu(a.ownerDocument.documentElement);else if(d==="head"){d=a.ownerDocument.head,Zu(d);for(var j=d.firstChild;j;){var _=j.nextSibling,M=j.nodeName;j[zi]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&j.rel.toLowerCase()==="stylesheet"||d.removeChild(j),j=_}}else d==="body"&&Zu(a.ownerDocument.body);d=b}while(d);Jl(o)}function I_(a,o){var d=a;a=0;do{var m=d.nextSibling;if(d.nodeType===1?o?(d._stashedDisplay=d.style.display,d.style.display="none"):(d.style.display=d._stashedDisplay||"",d.getAttribute("style")===""&&d.removeAttribute("style")):d.nodeType===3&&(o?(d._stashedText=d.nodeValue,d.nodeValue=""):d.nodeValue=d._stashedText||""),m&&m.nodeType===8)if(d=m.data,d==="/$"){if(a===0)break;a--}else d!=="$"&&d!=="$?"&&d!=="$~"&&d!=="$!"||a++;d=m}while(d)}function R0(a){var o=a.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var d=o;switch(o=o.nextSibling,d.nodeName){case"HTML":case"HEAD":case"BODY":R0(d),bl(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}a.removeChild(d)}}function H6(a,o,d,m){for(;a.nodeType===1;){var b=d;if(a.nodeName.toLowerCase()!==o.toLowerCase()){if(!m&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(m){if(!a[zi])switch(o){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(j=a.getAttribute("rel"),j==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(j!==b.rel||a.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||a.getAttribute("title")!==(b.title==null?null:b.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(j=a.getAttribute("src"),(j!==(b.src==null?null:b.src)||a.getAttribute("type")!==(b.type==null?null:b.type)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&j&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(o==="input"&&a.type==="hidden"){var j=b.name==null?null:""+b.name;if(b.type==="hidden"&&a.getAttribute("name")===j)return a}else return a;if(a=Kr(a.nextSibling),a===null)break}return null}function G6(a,o,d){if(o==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!d||(a=Kr(a.nextSibling),a===null))return null;return a}function L_(a,o){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!o||(a=Kr(a.nextSibling),a===null))return null;return a}function D0(a){return a.data==="$?"||a.data==="$~"}function I0(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function V6(a,o){var d=a.ownerDocument;if(a.data==="$~")a._reactRetry=o;else if(a.data!=="$?"||d.readyState!=="loading")o();else{var m=function(){o(),d.removeEventListener("DOMContentLoaded",m)};d.addEventListener("DOMContentLoaded",m),a._reactRetry=m}}function Kr(a){for(;a!=null;a=a.nextSibling){var o=a.nodeType;if(o===1||o===3)break;if(o===8){if(o=a.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return a}var L0=null;function $_(a){a=a.nextSibling;for(var o=0;a;){if(a.nodeType===8){var d=a.data;if(d==="/$"||d==="/&"){if(o===0)return Kr(a.nextSibling);o--}else d!=="$"&&d!=="$!"&&d!=="$?"&&d!=="$~"&&d!=="&"||o++}a=a.nextSibling}return null}function U_(a){a=a.previousSibling;for(var o=0;a;){if(a.nodeType===8){var d=a.data;if(d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"){if(o===0)return a;o--}else d!=="/$"&&d!=="/&"||o++}a=a.previousSibling}return null}function B_(a,o,d){switch(o=Ih(d),a){case"html":if(a=o.documentElement,!a)throw Error(r(452));return a;case"head":if(a=o.head,!a)throw Error(r(453));return a;case"body":if(a=o.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function Zu(a){for(var o=a.attributes;o.length;)a.removeAttributeNode(o[0]);bl(a)}var Hr=new Map,q_=new Set;function Lh(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Sa=re.d;re.d={f:Z6,r:Y6,D:W6,C:Q6,L:X6,m:J6,X:tB,S:eB,M:nB};function Z6(){var a=Sa.f(),o=Ah();return a||o}function Y6(a){var o=fi(a);o!==null&&o.tag===5&&o.type==="form"?aO(o):Sa.r(a)}var Wl=typeof document>"u"?null:document;function F_(a,o,d){var m=Wl;if(m&&typeof o=="string"&&o){var b=Ir(o);b='link[rel="'+a+'"][href="'+b+'"]',typeof d=="string"&&(b+='[crossorigin="'+d+'"]'),q_.has(b)||(q_.add(b),a={rel:a,crossOrigin:d,href:o},m.querySelector(b)===null&&(o=m.createElement("link"),zn(o,"link",a),on(o),m.head.appendChild(o)))}}function W6(a){Sa.D(a),F_("dns-prefetch",a,null)}function Q6(a,o){Sa.C(a,o),F_("preconnect",a,o)}function X6(a,o,d){Sa.L(a,o,d);var m=Wl;if(m&&a&&o){var b='link[rel="preload"][as="'+Ir(o)+'"]';o==="image"&&d&&d.imageSrcSet?(b+='[imagesrcset="'+Ir(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(b+='[imagesizes="'+Ir(d.imageSizes)+'"]')):b+='[href="'+Ir(a)+'"]';var j=b;switch(o){case"style":j=Ql(a);break;case"script":j=Xl(a)}Hr.has(j)||(a=g({rel:"preload",href:o==="image"&&d&&d.imageSrcSet?void 0:a,as:o},d),Hr.set(j,a),m.querySelector(b)!==null||o==="style"&&m.querySelector(Yu(j))||o==="script"&&m.querySelector(Wu(j))||(o=m.createElement("link"),zn(o,"link",a),on(o),m.head.appendChild(o)))}}function J6(a,o){Sa.m(a,o);var d=Wl;if(d&&a){var m=o&&typeof o.as=="string"?o.as:"script",b='link[rel="modulepreload"][as="'+Ir(m)+'"][href="'+Ir(a)+'"]',j=b;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":j=Xl(a)}if(!Hr.has(j)&&(a=g({rel:"modulepreload",href:a},o),Hr.set(j,a),d.querySelector(b)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(Wu(j)))return}m=d.createElement("link"),zn(m,"link",a),on(m),d.head.appendChild(m)}}}function eB(a,o,d){Sa.S(a,o,d);var m=Wl;if(m&&a){var b=Va(m).hoistableStyles,j=Ql(a);o=o||"default";var _=b.get(j);if(!_){var M={loading:0,preload:null};if(_=m.querySelector(Yu(j)))M.loading=5;else{a=g({rel:"stylesheet",href:a,"data-precedence":o},d),(d=Hr.get(j))&&$0(a,d);var $=_=m.createElement("link");on($),zn($,"link",a),$._p=new Promise(function(ee,se){$.onload=ee,$.onerror=se}),$.addEventListener("load",function(){M.loading|=1}),$.addEventListener("error",function(){M.loading|=2}),M.loading|=4,$h(_,o,m)}_={type:"stylesheet",instance:_,count:1,state:M},b.set(j,_)}}}function tB(a,o){Sa.X(a,o);var d=Wl;if(d&&a){var m=Va(d).hoistableScripts,b=Xl(a),j=m.get(b);j||(j=d.querySelector(Wu(b)),j||(a=g({src:a,async:!0},o),(o=Hr.get(b))&&U0(a,o),j=d.createElement("script"),on(j),zn(j,"link",a),d.head.appendChild(j)),j={type:"script",instance:j,count:1,state:null},m.set(b,j))}}function nB(a,o){Sa.M(a,o);var d=Wl;if(d&&a){var m=Va(d).hoistableScripts,b=Xl(a),j=m.get(b);j||(j=d.querySelector(Wu(b)),j||(a=g({src:a,async:!0,type:"module"},o),(o=Hr.get(b))&&U0(a,o),j=d.createElement("script"),on(j),zn(j,"link",a),d.head.appendChild(j)),j={type:"script",instance:j,count:1,state:null},m.set(b,j))}}function K_(a,o,d,m){var b=(b=Q.current)?Lh(b):null;if(!b)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(o=Ql(d.href),d=Va(b).hoistableStyles,m=d.get(o),m||(m={type:"style",instance:null,count:0,state:null},d.set(o,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){a=Ql(d.href);var j=Va(b).hoistableStyles,_=j.get(a);if(_||(b=b.ownerDocument||b,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},j.set(a,_),(j=b.querySelector(Yu(a)))&&!j._p&&(_.instance=j,_.state.loading=5),Hr.has(a)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},Hr.set(a,d),j||rB(b,a,d,_.state))),o&&m===null)throw Error(r(528,""));return _}if(o&&m!==null)throw Error(r(529,""));return null;case"script":return o=d.async,d=d.src,typeof d=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=Xl(d),d=Va(b).hoistableScripts,m=d.get(o),m||(m={type:"script",instance:null,count:0,state:null},d.set(o,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function Ql(a){return'href="'+Ir(a)+'"'}function Yu(a){return'link[rel="stylesheet"]['+a+"]"}function H_(a){return g({},a,{"data-precedence":a.precedence,precedence:null})}function rB(a,o,d,m){a.querySelector('link[rel="preload"][as="style"]['+o+"]")?m.loading=1:(o=a.createElement("link"),m.preload=o,o.addEventListener("load",function(){return m.loading|=1}),o.addEventListener("error",function(){return m.loading|=2}),zn(o,"link",d),on(o),a.head.appendChild(o))}function Xl(a){return'[src="'+Ir(a)+'"]'}function Wu(a){return"script[async]"+a}function G_(a,o,d){if(o.count++,o.instance===null)switch(o.type){case"style":var m=a.querySelector('style[data-href~="'+Ir(d.href)+'"]');if(m)return o.instance=m,on(m),m;var b=g({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return m=(a.ownerDocument||a).createElement("style"),on(m),zn(m,"style",b),$h(m,d.precedence,a),o.instance=m;case"stylesheet":b=Ql(d.href);var j=a.querySelector(Yu(b));if(j)return o.state.loading|=4,o.instance=j,on(j),j;m=H_(d),(b=Hr.get(b))&&$0(m,b),j=(a.ownerDocument||a).createElement("link"),on(j);var _=j;return _._p=new Promise(function(M,$){_.onload=M,_.onerror=$}),zn(j,"link",m),o.state.loading|=4,$h(j,d.precedence,a),o.instance=j;case"script":return j=Xl(d.src),(b=a.querySelector(Wu(j)))?(o.instance=b,on(b),b):(m=d,(b=Hr.get(j))&&(m=g({},d),U0(m,b)),a=a.ownerDocument||a,b=a.createElement("script"),on(b),zn(b,"link",m),a.head.appendChild(b),o.instance=b);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(m=o.instance,o.state.loading|=4,$h(m,d.precedence,a));return o.instance}function $h(a,o,d){for(var m=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=m.length?m[m.length-1]:null,j=b,_=0;_<m.length;_++){var M=m[_];if(M.dataset.precedence===o)j=M;else if(j!==b)break}j?j.parentNode.insertBefore(a,j.nextSibling):(o=d.nodeType===9?d.head:d,o.insertBefore(a,o.firstChild))}function $0(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.title==null&&(a.title=o.title)}function U0(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.integrity==null&&(a.integrity=o.integrity)}var Uh=null;function V_(a,o,d){if(Uh===null){var m=new Map,b=Uh=new Map;b.set(d,m)}else b=Uh,m=b.get(d),m||(m=new Map,b.set(d,m));if(m.has(a))return m;for(m.set(a,null),d=d.getElementsByTagName(a),b=0;b<d.length;b++){var j=d[b];if(!(j[zi]||j[zt]||a==="link"&&j.getAttribute("rel")==="stylesheet")&&j.namespaceURI!=="http://www.w3.org/2000/svg"){var _=j.getAttribute(o)||"";_=a+_;var M=m.get(_);M?M.push(j):m.set(_,[j])}}return m}function Z_(a,o,d){a=a.ownerDocument||a,a.head.insertBefore(d,o==="title"?a.querySelector("head > title"):null)}function iB(a,o,d){if(d===1||o.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;return o.rel==="stylesheet"?(a=o.disabled,typeof o.precedence=="string"&&a==null):!0;case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function Y_(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function aB(a,o,d,m){if(d.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(d.state.loading&4)===0){if(d.instance===null){var b=Ql(m.href),j=o.querySelector(Yu(b));if(j){o=j._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(a.count++,a=Bh.bind(a),o.then(a,a)),d.state.loading|=4,d.instance=j,on(j);return}j=o.ownerDocument||o,m=H_(m),(b=Hr.get(b))&&$0(m,b),j=j.createElement("link"),on(j);var _=j;_._p=new Promise(function(M,$){_.onload=M,_.onerror=$}),zn(j,"link",m),d.instance=j}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(d,o),(o=d.state.preload)&&(d.state.loading&3)===0&&(a.count++,d=Bh.bind(a),o.addEventListener("load",d),o.addEventListener("error",d))}}var B0=0;function sB(a,o){return a.stylesheets&&a.count===0&&Fh(a,a.stylesheets),0<a.count||0<a.imgCount?function(d){var m=setTimeout(function(){if(a.stylesheets&&Fh(a,a.stylesheets),a.unsuspend){var j=a.unsuspend;a.unsuspend=null,j()}},6e4+o);0<a.imgBytes&&B0===0&&(B0=62500*U6());var b=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&Fh(a,a.stylesheets),a.unsuspend)){var j=a.unsuspend;a.unsuspend=null,j()}},(a.imgBytes>B0?50:800)+o);return a.unsuspend=d,function(){a.unsuspend=null,clearTimeout(m),clearTimeout(b)}}:null}function Bh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Fh(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var qh=null;function Fh(a,o){a.stylesheets=null,a.unsuspend!==null&&(a.count++,qh=new Map,o.forEach(oB,a),qh=null,Bh.call(a))}function oB(a,o){if(!(o.state.loading&4)){var d=qh.get(a);if(d)var m=d.get(null);else{d=new Map,qh.set(a,d);for(var b=a.querySelectorAll("link[data-precedence],style[data-precedence]"),j=0;j<b.length;j++){var _=b[j];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(d.set(_.dataset.precedence,_),m=_)}m&&d.set(null,m)}b=o.instance,_=b.getAttribute("data-precedence"),j=d.get(_)||m,j===m&&d.set(null,b),d.set(_,b),this.count++,m=Bh.bind(this),b.addEventListener("load",m),b.addEventListener("error",m),j?j.parentNode.insertBefore(b,j.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(b,a.firstChild)),o.state.loading|=4}}var Qu={$$typeof:k,Provider:null,Consumer:null,_currentValue:ve,_currentValue2:ve,_threadCount:0};function lB(a,o,d,m,b,j,_,M,$){this.tag=1,this.containerInfo=a,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=yl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yl(0),this.hiddenUpdates=yl(null),this.identifierPrefix=m,this.onUncaughtError=b,this.onCaughtError=j,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=$,this.incompleteTransitions=new Map}function W_(a,o,d,m,b,j,_,M,$,ee,se,fe){return a=new lB(a,o,d,_,$,ee,se,fe,M),o=1,j===!0&&(o|=24),j=Nr(3,null,null,o),a.current=j,j.stateNode=a,o=xy(),o.refCount++,a.pooledCache=o,o.refCount++,j.memoizedState={element:m,isDehydrated:d,cache:o},Ny(j),a}function Q_(a){return a?(a=Al,a):Al}function X_(a,o,d,m,b,j){b=Q_(b),m.context===null?m.context=b:m.pendingContext=b,m=es(o),m.payload={element:d},j=j===void 0?null:j,j!==null&&(m.callback=j),d=ts(a,m,o),d!==null&&(mr(d,a,o),Au(d,a,o))}function J_(a,o){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var d=a.retryLane;a.retryLane=d!==0&&d<o?d:o}}function q0(a,o){J_(a,o),(a=a.alternate)&&J_(a,o)}function ek(a){if(a.tag===13||a.tag===31){var o=ro(a,67108864);o!==null&&mr(o,a,67108864),q0(a,67108864)}}function tk(a){if(a.tag===13||a.tag===31){var o=Ar();o=K(o);var d=ro(a,o);d!==null&&mr(d,a,o),q0(a,o)}}var Kh=!0;function cB(a,o,d,m){var b=V.T;V.T=null;var j=re.p;try{re.p=2,F0(a,o,d,m)}finally{re.p=j,V.T=b}}function uB(a,o,d,m){var b=V.T;V.T=null;var j=re.p;try{re.p=8,F0(a,o,d,m)}finally{re.p=j,V.T=b}}function F0(a,o,d,m){if(Kh){var b=K0(m);if(b===null)A0(a,o,m,Hh,d),rk(a,m);else if(fB(b,a,o,d,m))m.stopPropagation();else if(rk(a,m),o&4&&-1<dB.indexOf(a)){for(;b!==null;){var j=fi(b);if(j!==null)switch(j.tag){case 3:if(j=j.stateNode,j.current.memoizedState.isDehydrated){var _=Ti(j.pendingLanes);if(_!==0){var M=j;for(M.pendingLanes|=2,M.entangledLanes|=2;_;){var $=1<<31-be(_);M.entanglements[1]|=$,_&=~$}Li(j),(dt&6)===0&&(_h=st()+500,Hu(0))}}break;case 31:case 13:M=ro(j,2),M!==null&&mr(M,j,2),Ah(),q0(j,2)}if(j=K0(m),j===null&&A0(a,o,m,Hh,d),j===b)break;b=j}b!==null&&m.stopPropagation()}else A0(a,o,m,null,d)}}function K0(a){return a=Gv(a),H0(a)}var Hh=null;function H0(a){if(Hh=null,a=Ga(a),a!==null){var o=s(a);if(o===null)a=null;else{var d=o.tag;if(d===13){if(a=l(o),a!==null)return a;a=null}else if(d===31){if(a=c(o),a!==null)return a;a=null}else if(d===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;a=null}else o!==a&&(a=null)}}return Hh=a,null}function nk(a){switch(a){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(Xe()){case at:return 2;case Pt:return 8;case cr:case qa:return 32;case Qs:return 268435456;default:return 32}default:return 32}}var G0=!1,fs=null,hs=null,ps=null,Xu=new Map,Ju=new Map,ms=[],dB="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 rk(a,o){switch(a){case"focusin":case"focusout":fs=null;break;case"dragenter":case"dragleave":hs=null;break;case"mouseover":case"mouseout":ps=null;break;case"pointerover":case"pointerout":Xu.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ju.delete(o.pointerId)}}function ed(a,o,d,m,b,j){return a===null||a.nativeEvent!==j?(a={blockedOn:o,domEventName:d,eventSystemFlags:m,nativeEvent:j,targetContainers:[b]},o!==null&&(o=fi(o),o!==null&&ek(o)),a):(a.eventSystemFlags|=m,o=a.targetContainers,b!==null&&o.indexOf(b)===-1&&o.push(b),a)}function fB(a,o,d,m,b){switch(o){case"focusin":return fs=ed(fs,a,o,d,m,b),!0;case"dragenter":return hs=ed(hs,a,o,d,m,b),!0;case"mouseover":return ps=ed(ps,a,o,d,m,b),!0;case"pointerover":var j=b.pointerId;return Xu.set(j,ed(Xu.get(j)||null,a,o,d,m,b)),!0;case"gotpointercapture":return j=b.pointerId,Ju.set(j,ed(Ju.get(j)||null,a,o,d,m,b)),!0}return!1}function ik(a){var o=Ga(a.target);if(o!==null){var d=s(o);if(d!==null){if(o=d.tag,o===13){if(o=l(d),o!==null){a.blockedOn=o,Vt(a.priority,function(){tk(d)});return}}else if(o===31){if(o=c(d),o!==null){a.blockedOn=o,Vt(a.priority,function(){tk(d)});return}}else if(o===3&&d.stateNode.current.memoizedState.isDehydrated){a.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Gh(a){if(a.blockedOn!==null)return!1;for(var o=a.targetContainers;0<o.length;){var d=K0(a.nativeEvent);if(d===null){d=a.nativeEvent;var m=new d.constructor(d.type,d);Hv=m,d.target.dispatchEvent(m),Hv=null}else return o=fi(d),o!==null&&ek(o),a.blockedOn=d,!1;o.shift()}return!0}function ak(a,o,d){Gh(a)&&d.delete(o)}function hB(){G0=!1,fs!==null&&Gh(fs)&&(fs=null),hs!==null&&Gh(hs)&&(hs=null),ps!==null&&Gh(ps)&&(ps=null),Xu.forEach(ak),Ju.forEach(ak)}function Vh(a,o){a.blockedOn===o&&(a.blockedOn=null,G0||(G0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,hB)))}var Zh=null;function sk(a){Zh!==a&&(Zh=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Zh===a&&(Zh=null);for(var o=0;o<a.length;o+=3){var d=a[o],m=a[o+1],b=a[o+2];if(typeof m!="function"){if(H0(m||d)===null)continue;break}var j=fi(d);j!==null&&(a.splice(o,3),o-=3,Ky(j,{pending:!0,data:b,method:d.method,action:m},m,b))}}))}function Jl(a){function o($){return Vh($,a)}fs!==null&&Vh(fs,a),hs!==null&&Vh(hs,a),ps!==null&&Vh(ps,a),Xu.forEach(o),Ju.forEach(o);for(var d=0;d<ms.length;d++){var m=ms[d];m.blockedOn===a&&(m.blockedOn=null)}for(;0<ms.length&&(d=ms[0],d.blockedOn===null);)ik(d),d.blockedOn===null&&ms.shift();if(d=(a.ownerDocument||a).$$reactFormReplay,d!=null)for(m=0;m<d.length;m+=3){var b=d[m],j=d[m+1],_=b[Zt]||null;if(typeof j=="function")_||sk(d);else if(_){var M=null;if(j&&j.hasAttribute("formAction")){if(b=j,_=j[Zt]||null)M=_.formAction;else if(H0(b)!==null)continue}else M=_.action;typeof M=="function"?d[m+1]=M:(d.splice(m,3),m-=3),sk(d)}}}function ok(){function a(j){j.canIntercept&&j.info==="react-transition"&&j.intercept({handler:function(){return new Promise(function(_){return b=_})},focusReset:"manual",scroll:"manual"})}function o(){b!==null&&(b(),b=null),m||setTimeout(d,20)}function d(){if(!m&&!navigation.transition){var j=navigation.currentEntry;j&&j.url!=null&&navigation.navigate(j.url,{state:j.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,b=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(d,100),function(){m=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),b!==null&&(b(),b=null)}}}function V0(a){this._internalRoot=a}Yh.prototype.render=V0.prototype.render=function(a){var o=this._internalRoot;if(o===null)throw Error(r(409));var d=o.current,m=Ar();X_(d,m,a,o,null,null)},Yh.prototype.unmount=V0.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var o=a.containerInfo;X_(a.current,2,null,a,null,null),Ah(),o[Sr]=null}};function Yh(a){this._internalRoot=a}Yh.prototype.unstable_scheduleHydration=function(a){if(a){var o=vt();a={blockedOn:null,target:a,priority:o};for(var d=0;d<ms.length&&o!==0&&o<ms[d].priority;d++);ms.splice(d,0,a),d===0&&ik(a)}};var lk=t.version;if(lk!=="19.2.4")throw Error(r(527,lk,"19.2.4"));re.findDOMNode=function(a){var o=a._reactInternals;if(o===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=h(o),a=a!==null?p(a):null,a=a===null?null:a.stateNode,a};var pB={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Wh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wh.isDisabled&&Wh.supportsFiber)try{An=Wh.inject(pB),$e=Wh}catch{}}return nd.createRoot=function(a,o){if(!i(a))throw Error(r(299));var d=!1,m="",b=mO,j=gO,_=vO;return o!=null&&(o.unstable_strictMode===!0&&(d=!0),o.identifierPrefix!==void 0&&(m=o.identifierPrefix),o.onUncaughtError!==void 0&&(b=o.onUncaughtError),o.onCaughtError!==void 0&&(j=o.onCaughtError),o.onRecoverableError!==void 0&&(_=o.onRecoverableError)),o=W_(a,1,!1,null,null,d,m,null,b,j,_,ok),a[Sr]=o.current,k0(a),new V0(o)},nd.hydrateRoot=function(a,o,d){if(!i(a))throw Error(r(299));var m=!1,b="",j=mO,_=gO,M=vO,$=null;return d!=null&&(d.unstable_strictMode===!0&&(m=!0),d.identifierPrefix!==void 0&&(b=d.identifierPrefix),d.onUncaughtError!==void 0&&(j=d.onUncaughtError),d.onCaughtError!==void 0&&(_=d.onCaughtError),d.onRecoverableError!==void 0&&(M=d.onRecoverableError),d.formState!==void 0&&($=d.formState)),o=W_(a,1,!0,o,d??null,m,b,$,j,_,M,ok),o.context=Q_(null),d=o.current,m=Ar(),m=K(m),b=es(m),b.callback=null,ts(d,b,m),d=m,o.current.lanes=d,Js(o,d),Li(o),a[Sr]=o.current,k0(a),new Yh(o)},nd.version="19.2.4",nd}var yk;function NB(){if(yk)return W0.exports;yk=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(),W0.exports=jB(),W0.exports}var CB=NB(),sl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},OB={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},_B=class{#t=OB;#e=!1;setTimeoutProvider(e){this.#t=e}setTimeout(e,t){return this.#t.setTimeout(e,t)}clearTimeout(e){this.#t.clearTimeout(e)}setInterval(e,t){return this.#t.setInterval(e,t)}clearInterval(e){this.#t.clearInterval(e)}},ko=new _B;function kB(e){setTimeout(e,0)}var Vo=typeof window>"u"||"Deno"in globalThis;function Kn(){}function AB(e,t){return typeof e=="function"?e(t):e}function iw(e){return typeof e=="number"&&e>=0&&e!==1/0}function lM(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ts(e,t){return typeof e=="function"?e(t):e}function Wr(e,t){return typeof e=="function"?e(t):e}function bk(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:l,stale:c}=e;if(l){if(r){if(t.queryHash!==LS(l,t.options))return!1}else if(!Pd(t.queryKey,l))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||i&&i!==t.state.fetchStatus||s&&!s(t))}function xk(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Zo(t.options.mutationKey)!==Zo(s))return!1}else if(!Pd(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function LS(e,t){return(t?.queryKeyHashFn||Zo)(e)}function Zo(e){return JSON.stringify(e,(t,n)=>aw(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Pd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Pd(e[n],t[n])):!1}var EB=Object.prototype.hasOwnProperty;function $S(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=wk(e)&&wk(t);if(!r&&!(aw(e)&&aw(t)))return t;const s=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),c=l.length,f=r?new Array(c):{};let h=0;for(let p=0;p<c;p++){const g=r?p:l[p],v=e[g],y=t[g];if(v===y){f[g]=v,(r?p<s:EB.call(e,g))&&h++;continue}if(v===null||y===null||typeof v!="object"||typeof y!="object"){f[g]=y;continue}const w=$S(v,y,n+1);f[g]=w,w===v&&h++}return s===c&&h===s?e:f}function zd(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function wk(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function aw(e){if(!Sk(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Sk(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Sk(e){return Object.prototype.toString.call(e)==="[object Object]"}function TB(e){return new Promise(t=>{ko.setTimeout(t,e)})}function sw(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?$S(e,t):t}function PB(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function zB(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var US=Symbol();function cM(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===US?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function BS(e,t){return typeof e=="function"?e(...t):!!e}function MB(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var RB=class extends sl{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Vo&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},qS=new RB;function ow(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var DB=kB;function IB(){let e=[],t=0,n=c=>{c()},r=c=>{c()},i=DB;const s=c=>{t?e.push(c):i(()=>{n(c)})},l=()=>{const c=e;e=[],c.length&&i(()=>{r(()=>{c.forEach(f=>{n(f)})})})};return{batch:c=>{let f;t++;try{f=c()}finally{t--,t||l()}return f},batchCalls:c=>(...f)=>{s(()=>{c(...f)})},schedule:s,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{i=c}}}var Jt=IB(),LB=class extends sl{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Vo&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#t}},em=new LB;function $B(e){return Math.min(1e3*2**e,3e4)}function uM(e){return(e??"online")==="online"?em.isOnline():!0}var lw=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function dM(e){let t=!1,n=0,r;const i=ow(),s=()=>i.status!=="pending",l=S=>{if(!s()){const N=new lw(S);v(N),e.onCancel?.(N)}},c=()=>{t=!0},f=()=>{t=!1},h=()=>qS.isFocused()&&(e.networkMode==="always"||em.isOnline())&&e.canRun(),p=()=>uM(e.networkMode)&&e.canRun(),g=S=>{s()||(r?.(),i.resolve(S))},v=S=>{s()||(r?.(),i.reject(S))},y=()=>new Promise(S=>{r=N=>{(s()||h())&&S(N)},e.onPause?.()}).then(()=>{r=void 0,s()||e.onContinue?.()}),w=()=>{if(s())return;let S;const N=n===0?e.initialPromise:void 0;try{S=N??e.fn()}catch(C){S=Promise.reject(C)}Promise.resolve(S).then(g).catch(C=>{if(s())return;const E=e.retry??(Vo?0:3),k=e.retryDelay??$B,O=typeof k=="function"?k(n,C):k,T=E===!0||typeof E=="number"&&n<E||typeof E=="function"&&E(n,C);if(t||!T){v(C);return}n++,e.onFail?.(n,C),TB(O).then(()=>h()?void 0:y()).then(()=>{t?v(C):w()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:f,canStart:p,start:()=>(p()?w():y().then(w),i)}}var fM=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),iw(this.gcTime)&&(this.#t=ko.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Vo?1/0:300*1e3))}clearGcTimeout(){this.#t&&(ko.clearTimeout(this.#t),this.#t=void 0)}},UB=class extends fM{#t;#e;#n;#i;#r;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#n=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Nk(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=Nk(this.options);t.data!==void 0&&(this.setState(jk(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=sw(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Kn).catch(Kn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>Wr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===US||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ts(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!lM(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(f=>f.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,r=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{const c=cM(this.options,t),h=(()=>{const p={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(p),p})();return this.#o=!1,this.options.persister?this.options.persister(c,h,this):c(h)},l=(()=>{const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(c),c})();this.options.behavior?.onFetch(l,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#s({type:"fetch",meta:l.fetchOptions?.meta}),this.#r=dM({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:c=>{c instanceof lw&&c.revert&&this.setState({...this.#e,fetchStatus:"idle"}),n.abort()},onFail:(c,f)=>{this.#s({type:"failed",failureCount:c,error:f})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{const c=await this.#r.start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#n.config.onSuccess?.(c,this),this.#n.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof lw){if(c.silent)return this.#r.promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#s({type:"error",error:c}),this.#n.config.onError?.(c,this),this.#n.config.onSettled?.(this.state.data,c,this),c}finally{this.scheduleGc()}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...hM(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...jk(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=e.manual?r:void 0,r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Jt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function hM(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:uM(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function jk(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Nk(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var FS=class extends sl{constructor(e,t){super(),this.options=t,this.#t=e,this.#s=null,this.#o=ow(),this.bindMethods(),this.setOptions(t)}#t;#e=void 0;#n=void 0;#i=void 0;#r;#a;#o;#s;#p;#d;#f;#c;#u;#l;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),Ck(this.#e,this.options)?this.#m():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return cw(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return cw(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,n=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Wr(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#e.setOptions(this.options),t._defaulted&&!zd(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&Ok(this.#e,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#e!==n||Wr(this.options.enabled,this.#e)!==Wr(t.enabled,this.#e)||Ts(this.options.staleTime,this.#e)!==Ts(t.staleTime,this.#e))&&this.#g();const i=this.#v();r&&(this.#e!==n||Wr(this.options.enabled,this.#e)!==Wr(t.enabled,this.#e)||i!==this.#l)&&this.#y(i)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),n=this.createResult(t,e);return qB(this,n)&&(this.#i=n,this.#a=this.options,this.#r=this.#e.state),n}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#t.defaultQueryOptions(e),n=this.#t.getQueryCache().build(this.#t,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#m(e){this.#S();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Kn)),t}#g(){this.#x();const e=Ts(this.options.staleTime,this.#e);if(Vo||this.#i.isStale||!iw(e))return;const n=lM(this.#i.dataUpdatedAt,e)+1;this.#c=ko.setTimeout(()=>{this.#i.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#l=e,!(Vo||Wr(this.options.enabled,this.#e)===!1||!iw(this.#l)||this.#l===0)&&(this.#u=ko.setInterval(()=>{(this.options.refetchIntervalInBackground||qS.isFocused())&&this.#m()},this.#l))}#b(){this.#g(),this.#y(this.#v())}#x(){this.#c&&(ko.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(ko.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#e,r=this.options,i=this.#i,s=this.#r,l=this.#a,f=e!==n?e.state:this.#n,{state:h}=e;let p={...h},g=!1,v;if(t._optimisticResults){const z=this.hasListeners(),R=!z&&Ck(e,t),q=z&&Ok(e,n,t,r);(R||q)&&(p={...p,...hM(h.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:y,errorUpdatedAt:w,status:S}=p;v=p.data;let N=!1;if(t.placeholderData!==void 0&&v===void 0&&S==="pending"){let z;i?.isPlaceholderData&&t.placeholderData===l?.placeholderData?(z=i.data,N=!0):z=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,z!==void 0&&(S="success",v=sw(i?.data,z,t),g=!0)}if(t.select&&v!==void 0&&!N)if(i&&v===s?.data&&t.select===this.#p)v=this.#d;else try{this.#p=t.select,v=t.select(v),v=sw(i?.data,v,t),this.#d=v,this.#s=null}catch(z){this.#s=z}this.#s&&(y=this.#s,v=this.#d,w=Date.now(),S="error");const C=p.fetchStatus==="fetching",E=S==="pending",k=S==="error",O=E&&C,T=v!==void 0,A={status:S,fetchStatus:p.fetchStatus,isPending:E,isSuccess:S==="success",isError:k,isInitialLoading:O,isLoading:O,data:v,dataUpdatedAt:p.dataUpdatedAt,error:y,errorUpdatedAt:w,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>f.dataUpdateCount||p.errorUpdateCount>f.errorUpdateCount,isFetching:C,isRefetching:C&&!E,isLoadingError:k&&!T,isPaused:p.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:k&&T,isStale:KS(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Wr(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const z=A.data!==void 0,R=A.status==="error"&&!z,q=ae=>{R?ae.reject(A.error):z&&ae.resolve(A.data)},U=()=>{const ae=this.#o=A.promise=ow();q(ae)},L=this.#o;switch(L.status){case"pending":e.queryHash===n.queryHash&&q(L);break;case"fulfilled":(R||A.data!==L.value)&&U();break;case"rejected":(!R||A.error!==L.reason)&&U();break}}return A}updateResult(){const e=this.#i,t=this.createResult(this.#e,this.options);if(this.#r=this.#e.state,this.#a=this.options,this.#r.data!==void 0&&(this.#f=this.#e),zd(t,e))return;this.#i=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#h.size)return!0;const s=new Set(i??this.#h);return this.options.throwOnError&&s.add("error"),Object.keys(this.#i).some(l=>{const c=l;return this.#i[c]!==e[c]&&s.has(c)})};this.#j({listeners:n()})}#S(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#j(e){Jt.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function BB(e,t){return Wr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Ck(e,t){return BB(e,t)||e.state.data!==void 0&&cw(e,t,t.refetchOnMount)}function cw(e,t,n){if(Wr(t.enabled,e)!==!1&&Ts(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&KS(e,t)}return!1}function Ok(e,t,n,r){return(e!==t||Wr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&KS(e,n)}function KS(e,t){return Wr(t.enabled,e)!==!1&&e.isStaleByTime(Ts(t.staleTime,e))}function qB(e,t){return!zd(e.getCurrentResult(),t)}function _k(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],l=t.state.data?.pageParams||[];let c={pages:[],pageParams:[]},f=0;const h=async()=>{let p=!1;const g=w=>{MB(w,()=>t.signal,()=>p=!0)},v=cM(t.options,t.fetchOptions),y=async(w,S,N)=>{if(p)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const E=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:S,direction:N?"backward":"forward",meta:t.options.meta};return g(P),P})(),k=await v(E),{maxPages:O}=t.options,T=N?zB:PB;return{pages:T(w.pages,k,O),pageParams:T(w.pageParams,S,O)}};if(i&&s.length){const w=i==="backward",S=w?FB:kk,N={pages:s,pageParams:l},C=S(r,N);c=await y(N,C,w)}else{const w=e??s.length;do{const S=f===0?l[0]??r.initialPageParam:kk(r,c);if(f>0&&S==null)break;c=await y(c,S),f++}while(f<w)}return c};t.options.persister?t.fetchFn=()=>t.options.persister?.(h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=h}}}function kk(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function FB(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var KB=class extends fM{#t;#e;#n;#i;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#e=[],this.state=e.state||pM(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=dM({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(s,l)=>{this.#r({type:"failed",failureCount:s,error:l})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#i.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const l=await this.options.onMutate?.(e,n);l!==this.state.context&&this.#r({type:"pending",context:l,variables:e,isPaused:i})}const s=await this.#i.start();return await this.#n.config.onSuccess?.(s,e,this.state.context,this,n),await this.options.onSuccess?.(s,e,this.state.context,n),await this.#n.config.onSettled?.(s,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(s,null,e,this.state.context,n),this.#r({type:"success",data:s}),s}catch(s){try{await this.#n.config.onError?.(s,e,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onError?.(s,e,this.state.context,n)}catch(l){Promise.reject(l)}try{await this.#n.config.onSettled?.(void 0,s,this.state.variables,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onSettled?.(void 0,s,e,this.state.context,n)}catch(l){Promise.reject(l)}throw this.#r({type:"error",error:s}),s}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Jt.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function pM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var mM=class extends sl{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(e,t,n){const r=new KB({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#t.add(e);const t=Qh(e);if(typeof t=="string"){const n=this.#e.get(t);n?n.push(e):this.#e.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const t=Qh(e);if(typeof t=="string"){const n=this.#e.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#e.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Qh(e);if(typeof t=="string"){const r=this.#e.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Qh(e);return typeof t=="string"?this.#e.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Jt.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>xk(t,n))}findAll(e={}){return this.getAll().filter(t=>xk(e,t))}notify(e){Jt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Jt.batch(()=>Promise.all(e.map(t=>t.continue().catch(Kn))))}};function Qh(e){return e.options.scope?.id}var HB=class extends sl{#t;#e=void 0;#n;#i;constructor(t,n){super(),this.#t=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#t.defaultMutationOptions(t),zd(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Zo(n.mutationKey)!==Zo(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#a(t)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#a()}mutate(t,n){return this.#i=n,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(t)}#r(){const t=this.#n?.state??pM();this.#e={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#a(t){Jt.batch(()=>{if(this.#i&&this.hasListeners()){const n=this.#e.variables,r=this.#e.context,i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#i.onSuccess?.(t.data,n,r,i)}catch(s){Promise.reject(s)}try{this.#i.onSettled?.(t.data,null,n,r,i)}catch(s){Promise.reject(s)}}else if(t?.type==="error"){try{this.#i.onError?.(t.error,n,r,i)}catch(s){Promise.reject(s)}try{this.#i.onSettled?.(void 0,t.error,n,r,i)}catch(s){Promise.reject(s)}}}this.listeners.forEach(n=>{n(this.#e)})})}};function Ak(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function GB(e,t,n){const r=e.slice(0);return r[t]=n,r}var VB=class extends sl{#t;#e;#n;#i;#r;#a;#o;#s;#p;#d=[];constructor(e,t,n){super(),this.#t=e,this.#i=n,this.#n=[],this.#r=[],this.#e=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#r.forEach(e=>{e.subscribe(t=>{this.#l(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#r.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#i=t,Jt.batch(()=>{const n=this.#r,r=this.#u(this.#n);r.forEach(p=>p.observer.setOptions(p.defaultedQueryOptions));const i=r.map(p=>p.observer),s=i.map(p=>p.getCurrentResult()),l=n.length!==i.length,c=i.some((p,g)=>p!==n[g]),f=l||c,h=f?!0:s.some((p,g)=>{const v=this.#e[g];return!v||!zd(p,v)});!f&&!h||(f&&(this.#d=r,this.#r=i),this.#e=s,this.hasListeners()&&(f&&(Ak(n,i).forEach(p=>{p.destroy()}),Ak(i,n).forEach(p=>{p.subscribe(g=>{this.#l(p,g)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#r.map(e=>e.getCurrentQuery())}getObservers(){return this.#r}getOptimisticResult(e,t){const n=this.#u(e),r=n.map(s=>s.observer.getOptimisticResult(s.defaultedQueryOptions)),i=n.map(s=>s.defaultedQueryOptions.queryHash);return[r,s=>this.#c(s??r,t,i),()=>this.#f(r,n)]}#f(e,t){return t.map((n,r)=>{const i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,s=>{t.forEach(l=>{l.observer.trackProp(s)})})})}#c(e,t,n){if(t){const r=this.#p,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((s,l)=>s!==r[l]));return(!this.#a||this.#e!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#e,n!==void 0&&(this.#p=n),this.#a=$S(this.#a,t(e))),this.#a}return e}#u(e){const t=new Map;this.#r.forEach(r=>{const i=r.options.queryHash;if(!i)return;const s=t.get(i);s?s.push(r):t.set(i,[r])});const n=[];return e.forEach(r=>{const i=this.#t.defaultQueryOptions(r),l=t.get(i.queryHash)?.shift()??new FS(this.#t,i);n.push({defaultedQueryOptions:i,observer:l})}),n}#l(e,t){const n=this.#r.indexOf(e);n!==-1&&(this.#e=GB(this.#e,n,t),this.#h())}#h(){if(this.hasListeners()){const e=this.#a,t=this.#f(this.#e,this.#d),n=this.#c(t,this.#i?.combine);e!==n&&Jt.batch(()=>{this.listeners.forEach(r=>{r(this.#e)})})}}},ZB=class extends sl{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const r=t.queryKey,i=t.queryHash??LS(r,t);let s=this.get(i);return s||(s=new UB({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(s)),s}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#t.get(e.queryHash);t&&(e.destroy(),t===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Jt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>bk(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>bk(e,n)):t}notify(e){Jt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Jt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Jt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},YB=class{#t;#e;#n;#i;#r;#a;#o;#s;constructor(e={}){this.#t=e.queryCache||new ZB,this.#e=e.mutationCache||new mM,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=qS.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#s=em.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#t.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#e.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#t.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ts(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=this.#t.get(r.queryHash)?.state.data,l=AB(t,s);if(l!==void 0)return this.#t.build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Jt.batch(()=>this.#t.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state}removeQueries(e){const t=this.#t;Jt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return Jt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Jt.batch(()=>this.#t.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Kn).catch(Kn)}invalidateQueries(e,t={}){return Jt.batch(()=>(this.#t.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Jt.batch(()=>this.#t.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Kn)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Kn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime(Ts(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Kn).catch(Kn)}fetchInfiniteQuery(e){return e.behavior=_k(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Kn).catch(Kn)}ensureInfiniteQueryData(e){return e.behavior=_k(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return em.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#i.set(Zo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{Pd(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Zo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Pd(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=LS(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===US&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},gM=x.createContext(void 0),Fs=e=>{const t=x.useContext(gM);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},WB=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(gM.Provider,{value:e,children:t})),vM=x.createContext(!1),yM=()=>x.useContext(vM);vM.Provider;function QB(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var XB=x.createContext(QB()),bM=()=>x.useContext(XB),xM=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?BS(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},wM=e=>{x.useEffect(()=>{e.clearReset()},[e])},SM=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||BS(n,[e.error,r])),jM=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},JB=(e,t)=>e.isLoading&&e.isFetching&&!t,uw=(e,t)=>e?.suspense&&t.isPending,dw=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function e8({queries:e,...t},n){const r=Fs(),i=yM(),s=bM(),l=x.useMemo(()=>e.map(S=>{const N=r.defaultQueryOptions(S);return N._optimisticResults=i?"isRestoring":"optimistic",N}),[e,r,i]);l.forEach(S=>{jM(S);const N=r.getQueryCache().get(S.queryHash);xM(S,s,N)}),wM(s);const[c]=x.useState(()=>new VB(r,l,t)),[f,h,p]=c.getOptimisticResult(l,t.combine),g=!i&&t.subscribed!==!1;x.useSyncExternalStore(x.useCallback(S=>g?c.subscribe(Jt.batchCalls(S)):Kn,[c,g]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),x.useEffect(()=>{c.setQueries(l,t)},[l,t,c]);const y=f.some((S,N)=>uw(l[N],S))?f.flatMap((S,N)=>{const C=l[N];if(C&&uw(C,S)){const E=new FS(r,C);return dw(C,E,s)}return[]}):[];if(y.length>0)throw Promise.all(y);const w=f.find((S,N)=>{const C=l[N];return C&&SM({result:S,errorResetBoundary:s,throwOnError:C.throwOnError,query:r.getQueryCache().get(C.queryHash),suspense:C.suspense})});if(w?.error)throw w.error;return h(p())}function t8(e,t,n){const r=yM(),i=bM(),s=Fs(),l=s.defaultQueryOptions(e);s.getDefaultOptions().queries?._experimental_beforeQuery?.(l);const c=s.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",jM(l),xM(l,i,c),wM(i);const f=!s.getQueryCache().get(l.queryHash),[h]=x.useState(()=>new t(s,l)),p=h.getOptimisticResult(l),g=!r&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(v=>{const y=g?h.subscribe(Jt.batchCalls(v)):Kn;return h.updateResult(),y},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),x.useEffect(()=>{h.setOptions(l)},[l,h]),uw(l,p))throw dw(l,h,i);if(SM({result:p,errorResetBoundary:i,throwOnError:l.throwOnError,query:c,suspense:l.suspense}))throw p.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(l,p),l.experimental_prefetchInRender&&!Vo&&JB(p,r)&&(f?dw(l,h,i):c?.promise)?.catch(Kn).finally(()=>{h.updateResult()}),l.notifyOnChangeProps?p:h.trackResult(p)}function Lo(e,t){return t8(e,FS)}function of(e,t){const n=Fs(),[r]=x.useState(()=>new HB(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);const i=x.useSyncExternalStore(x.useCallback(l=>r.subscribe(Jt.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=x.useCallback((l,c)=>{r.mutate(l,c).catch(Kn)},[r]);if(i.error&&BS(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}var Xh=typeof window<"u"?x.useLayoutEffect:x.useEffect;function eb(e){const t=x.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function n8(e,t,n={},r={}){x.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([s])=>{t(s)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function r8(e){const t=x.useRef(null);return x.useImperativeHandle(e,()=>t.current,[]),t}var i8=!1;function Md(e){return e[e.length-1]}function a8(e){return typeof e=="function"}function _s(e,t){return a8(e)?e(t):e}var s8=Object.prototype.hasOwnProperty,Ek=Object.prototype.propertyIsEnumerable,o8=()=>Object.create(null),vo=(e,t)=>Ao(e,t,o8);function Ao(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const i=t,s=zk(e)&&zk(i);if(!s&&!(tm(e)&&tm(i)))return i;const l=s?e:Tk(e);if(!l)return i;const c=s?i:Tk(i);if(!c)return i;const f=l.length,h=c.length,p=s?new Array(h):n();let g=0;for(let v=0;v<h;v++){const y=s?v:c[v],w=e[y],S=i[y];if(w===S){p[y]=w,(s?v<f:s8.call(e,y))&&g++;continue}if(w===null||S===null||typeof w!="object"||typeof S!="object"){p[y]=S;continue}const N=Ao(w,S,n,r+1);p[y]=N,N===w&&g++}return f===h&&g===f?e:p}function Tk(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!Ek.call(e,i))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const i of n){if(!Ek.call(e,i))return!1;r.push(i)}return r}function tm(e){if(!Pk(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Pk(n)||!n.hasOwnProperty("isPrototypeOf"))}function Pk(e){return Object.prototype.toString.call(e)==="[object Object]"}function zk(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function $o(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!$o(e[r],t[r],n))return!1;return!0}if(tm(e)&&tm(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const l in t)if((!r||t[l]!==void 0)&&!$o(e[l],t[l],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(const l in e)e[l]!==void 0&&i++;let s=0;for(const l in t)if((!r||t[l]!==void 0)&&(s++,s>i||!$o(e[l],t[l],n)))return!1;return i===s}return!1}function Tc(e){let t,n;const r=new Promise((i,s)=>{t=i,n=s});return r.status="pending",r.resolve=i=>{r.status="resolved",r.value=i,t(i),e?.(i)},r.reject=i=>{r.status="rejected",n(i)},r}function Rd(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function l8(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Mk(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return l8(t)}var c8=["http:","https:","mailto:","tel:"];function nm(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function rd(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,r="",i;for(;(i=t.exec(e))!==null;)r+=Mk(e.slice(n,i.index))+i[0],n=t.lastIndex;r=r+Mk(n?e.slice(n):e);let s=!1;return r.startsWith("//")&&(s=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:s}}function u8(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function rm(e){const t=new Map;let n,r;const i=s=>{s.next&&(s.prev?(s.prev.next=s.next,s.next.prev=s.prev,s.next=void 0,r&&(r.next=s,s.prev=r)):(s.next.prev=void 0,n=s.next,s.next=void 0,r&&(s.prev=r,r.next=s)),r=s)};return{get(s){const l=t.get(s);if(l)return i(l),l.value},set(s,l){if(t.size>=e&&n){const f=n;t.delete(f.key),f.next&&(n=f.next,f.next.prev=void 0),f===r&&(r=void 0)}const c=t.get(s);if(c)c.value=l,i(c);else{const f={key:s,value:l,prev:r};r&&(r.next=f),r=f,n||(n=f),t.set(s,f)}},clear(){t.clear(),n=void 0,r=void 0}}}var d8="Invariant failed";function Ls(e,t){if(!e)throw new Error(d8)}var Eo=4,NM=5;function f8(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function HS(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),i=r===-1?e.length:r,s=e.substring(t,i);if(!s||!s.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(s==="$"){const c=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=c,n[4]=c,n[5]=c,n}if(s.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const l=f8(s);if(l){const[c,f]=l,h=s.charCodeAt(c+1);if(h===45){if(c+2<s.length&&s.charCodeAt(c+2)===36){const p=c+3,g=f;if(p<g)return n[0]=3,n[1]=t+c,n[2]=t+p,n[3]=t+g,n[4]=t+f+1,n[5]=i,n}}else if(h===36){const p=c+1,g=c+2;return g===f?(n[0]=2,n[1]=t+c,n[2]=t+p,n[3]=t+g,n[4]=t+f+1,n[5]=e.length,n):(n[0]=1,n[1]=t+c,n[2]=t+g,n[3]=t+f,n[4]=t+f+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function xg(e,t,n,r,i,s,l){l?.(n);let c=r;{const f=n.fullPath??n.from,h=f.length,p=n.options?.caseSensitive??e,g=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;c<h;){const y=HS(f,c,t);let w;const S=c,N=y[5];switch(c=N+1,s++,y[0]){case 0:{const C=f.substring(y[2],y[3]);if(p){const E=i.static?.get(C);if(E)w=E;else{i.static??=new Map;const k=To(n.fullPath??n.from);k.parent=i,k.depth=s,w=k,i.static.set(C,k)}}else{const E=C.toLowerCase(),k=i.staticInsensitive?.get(E);if(k)w=k;else{i.staticInsensitive??=new Map;const O=To(n.fullPath??n.from);O.parent=i,O.depth=s,w=O,i.staticInsensitive.set(E,O)}}break}case 1:{const C=f.substring(S,y[1]),E=f.substring(y[4],N),k=p&&!!(C||E),O=C?k?C:C.toLowerCase():void 0,T=E?k?E:E.toLowerCase():void 0,P=!g&&i.dynamic?.find(A=>!A.skipOnParamError&&A.caseSensitive===k&&A.prefix===O&&A.suffix===T);if(P)w=P;else{const A=nb(1,n.fullPath??n.from,k,O,T);w=A,A.depth=s,A.parent=i,i.dynamic??=[],i.dynamic.push(A)}break}case 3:{const C=f.substring(S,y[1]),E=f.substring(y[4],N),k=p&&!!(C||E),O=C?k?C:C.toLowerCase():void 0,T=E?k?E:E.toLowerCase():void 0,P=!g&&i.optional?.find(A=>!A.skipOnParamError&&A.caseSensitive===k&&A.prefix===O&&A.suffix===T);if(P)w=P;else{const A=nb(3,n.fullPath??n.from,k,O,T);w=A,A.parent=i,A.depth=s,i.optional??=[],i.optional.push(A)}break}case 2:{const C=f.substring(S,y[1]),E=f.substring(y[4],N),k=p&&!!(C||E),O=C?k?C:C.toLowerCase():void 0,T=E?k?E:E.toLowerCase():void 0,P=nb(2,n.fullPath??n.from,k,O,T);w=P,P.parent=i,P.depth=s,i.wildcard??=[],i.wildcard.push(P)}}i=w}if(g&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const y=To(n.fullPath??n.from);y.kind=NM,y.parent=i,s++,y.depth=s,i.pathless??=[],i.pathless.push(y),i=y}const v=(n.path||!n.children)&&!n.isRoot;if(v&&f.endsWith("/")){const y=To(n.fullPath??n.from);y.kind=Eo,y.parent=i,s++,y.depth=s,i.index=y,i=y}i.parse=n.options?.params?.parse??null,i.skipOnParamError=g,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,v&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const f of n.children)xg(e,t,f,c,i,s,l)}function tb(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Ss(e){if(e.pathless)for(const t of e.pathless)Ss(t);if(e.static)for(const t of e.static.values())Ss(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Ss(t);if(e.dynamic?.length){e.dynamic.sort(tb);for(const t of e.dynamic)Ss(t)}if(e.optional?.length){e.optional.sort(tb);for(const t of e.optional)Ss(t)}if(e.wildcard?.length){e.wildcard.sort(tb);for(const t of e.wildcard)Ss(t)}}function To(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function nb(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:i}}function h8(e,t){const n=To("/"),r=new Uint16Array(6);for(const i of e)xg(!1,r,i,1,n,0);Ss(n),t.masksTree=n,t.flatCache=rm(1e3)}function p8(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=GS(e,t.masksTree);return t.flatCache.set(e,r),r}function m8(e,t,n,r,i){e||="/",r||="/";const s=t?`case\0${e}`:e;let l=i.singleCache.get(s);return l||(l=To("/"),xg(t,new Uint16Array(6),{from:e},1,l,0),i.singleCache.set(s,l)),GS(r,l,n)}function g8(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||="/";let s;try{s=GS(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)s=null;else throw l}return s&&(s.branch=b8(s.route)),t.matchCache.set(r,s),s}function v8(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function y8(e,t=!1,n){const r=To(e.fullPath),i=new Uint16Array(6),s={},l={};let c=0;return xg(t,i,e,1,r,0,f=>{if(n?.(f,c),Ls(!(f.id in s),`Duplicate routes found with id: ${String(f.id)}`),s[f.id]=f,c!==0&&f.path){const h=v8(f.fullPath);(!l[h]||f.fullPath.endsWith("/"))&&(l[h]=f)}c++}),Ss(r),{processedTree:{segmentTree:r,singleCache:rm(1e3),matchCache:rm(1e3),flatCache:null,masksTree:null},routesById:s,routesByPath:l}}function GS(e,t,n=!1){const r=e.split("/"),i=w8(e,r,t,n);if(!i)return null;const[s]=CM(e,r,i);return{route:i.node.route,rawParams:s,parsedParams:i.parsedParams}}function CM(e,t,n){const r=x8(n.node);let i=null;const s=Object.create(null);let l=n.extract?.part??0,c=n.extract?.node??0,f=n.extract?.path??0,h=n.extract?.segment??0;for(;c<r.length;l++,c++,f++,h++){const p=r[c];if(p.kind===Eo)break;if(p.kind===NM){h--,l--,f--;continue}const g=t[l],v=f;if(g&&(f+=g.length),p.kind===1){i??=n.node.fullPath.split("/");const y=i[h],w=p.prefix?.length??0;if(y.charCodeAt(w)===123){const S=p.suffix?.length??0,N=y.substring(w+2,y.length-S-1),C=g.substring(w,g.length-S);s[N]=decodeURIComponent(C)}else{const S=y.substring(1);s[S]=decodeURIComponent(g)}}else if(p.kind===3){if(n.skipped&1<<c){l--,f=v-1;continue}i??=n.node.fullPath.split("/");const y=i[h],w=p.prefix?.length??0,S=p.suffix?.length??0,N=y.substring(w+3,y.length-S-1),C=p.suffix||p.prefix?g.substring(w,g.length-S):g;C&&(s[N]=decodeURIComponent(C))}else if(p.kind===2){const y=p,w=e.substring(v+(y.prefix?.length??0),e.length-(y.suffix?.length??0)),S=decodeURIComponent(w);s["*"]=S,s._splat=S;break}}return n.rawParams&&Object.assign(s,n.rawParams),[s,{part:l,node:c,path:f,segment:h}]}function b8(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function x8(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function w8(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!Md(t),s=i&&e!=="/",l=t.length-(i?1:0),c=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let f=null,h=null,p=null;for(;c.length;){const g=c.pop(),{node:v,index:y,skipped:w,depth:S,statics:N,dynamics:C,optionals:E}=g;let{extract:k,rawParams:O,parsedParams:T}=g;if(v.skipOnParamError){if(!rb(e,t,g))continue;O=g.rawParams,k=g.extract,T=g.parsedParams}r&&v.route&&v.kind!==Eo&&id(h,g)&&(h=g);const P=y===l;if(P&&(v.route&&!s&&id(p,g)&&(p=g),!v.optional&&!v.wildcard&&!v.index&&!v.pathless))continue;const A=P?void 0:t[y];let z;if(P&&v.index){const R={node:v.index,index:y,skipped:w,depth:S+1,statics:N,dynamics:C,optionals:E,extract:k,rawParams:O,parsedParams:T};let q=!0;if(v.index.skipOnParamError&&(rb(e,t,R)||(q=!1)),q){if(N===l&&!C&&!E&&!w)return R;id(p,R)&&(p=R)}}if(v.wildcard&&id(f,g))for(const R of v.wildcard){const{prefix:q,suffix:U}=R;if(q&&(P||!(R.caseSensitive?A:z??=A.toLowerCase()).startsWith(q)))continue;if(U){if(P)continue;const ae=t.slice(y).join("/").slice(-U.length);if((R.caseSensitive?ae:ae.toLowerCase())!==U)continue}const L={node:R,index:l,skipped:w,depth:S,statics:N,dynamics:C,optionals:E,extract:k,rawParams:O,parsedParams:T};if(!(R.skipOnParamError&&!rb(e,t,L))){f=L;break}}if(v.optional){const R=w|1<<S,q=S+1;for(let U=v.optional.length-1;U>=0;U--){const L=v.optional[U];c.push({node:L,index:y,skipped:R,depth:q,statics:N,dynamics:C,optionals:E,extract:k,rawParams:O,parsedParams:T})}if(!P)for(let U=v.optional.length-1;U>=0;U--){const L=v.optional[U],{prefix:ae,suffix:pe}=L;if(ae||pe){const ge=L.caseSensitive?A:z??=A.toLowerCase();if(ae&&!ge.startsWith(ae)||pe&&!ge.endsWith(pe))continue}c.push({node:L,index:y+1,skipped:w,depth:q,statics:N,dynamics:C,optionals:E+1,extract:k,rawParams:O,parsedParams:T})}}if(!P&&v.dynamic&&A)for(let R=v.dynamic.length-1;R>=0;R--){const q=v.dynamic[R],{prefix:U,suffix:L}=q;if(U||L){const ae=q.caseSensitive?A:z??=A.toLowerCase();if(U&&!ae.startsWith(U)||L&&!ae.endsWith(L))continue}c.push({node:q,index:y+1,skipped:w,depth:S+1,statics:N,dynamics:C+1,optionals:E,extract:k,rawParams:O,parsedParams:T})}if(!P&&v.staticInsensitive){const R=v.staticInsensitive.get(z??=A.toLowerCase());R&&c.push({node:R,index:y+1,skipped:w,depth:S+1,statics:N+1,dynamics:C,optionals:E,extract:k,rawParams:O,parsedParams:T})}if(!P&&v.static){const R=v.static.get(A);R&&c.push({node:R,index:y+1,skipped:w,depth:S+1,statics:N+1,dynamics:C,optionals:E,extract:k,rawParams:O,parsedParams:T})}if(v.pathless){const R=S+1;for(let q=v.pathless.length-1;q>=0;q--){const U=v.pathless[q];c.push({node:U,index:y,skipped:w,depth:R,statics:N,dynamics:C,optionals:E,extract:k,rawParams:O,parsedParams:T})}}}if(p&&f)return id(f,p)?p:f;if(p)return p;if(f)return f;if(r&&h){let g=h.index;for(let y=0;y<h.index;y++)g+=t[y].length;const v=g===e.length?"/":e.slice(g);return h.rawParams??=Object.create(null),h.rawParams["**"]=decodeURIComponent(v),h}return null}function rb(e,t,n){try{const[r,i]=CM(e,t,n);n.rawParams=r,n.extract=i;const s=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,s),!0}catch{return null}}function id(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Eo)>(e.node.kind===Eo)||t.node.kind===Eo==(e.node.kind===Eo)&&t.depth>e.depth))):!0}function Ip(e){return VS(e.filter(t=>t!==void 0).join("/"))}function VS(e){return e.replace(/\/{2,}/g,"/")}function OM(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Ps(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function _M(e){return Ps(OM(e))}function im(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function S8(e,t,n){return im(e,n)===im(t,n)}function j8({base:e,to:t,trailingSlash:n="never",cache:r}){const i=t.startsWith("/"),s=!i&&t===".";let l;if(r){l=i?t:s?e:e+"\0"+t;const g=r.get(l);if(g)return g}let c;if(s)c=e.split("/");else if(i)c=t.split("/");else{for(c=e.split("/");c.length>1&&Md(c)==="";)c.pop();const g=t.split("/");for(let v=0,y=g.length;v<y;v++){const w=g[v];w===""?v?v===y-1&&c.push(w):c=[w]:w===".."?c.pop():w==="."||c.push(w)}}c.length>1&&(Md(c)===""?n==="never"&&c.pop():n==="always"&&c.push(""));let f,h="";for(let g=0;g<c.length;g++){g>0&&(h+="/");const v=c[g];if(!v)continue;f=HS(v,0,f);const y=f[0];if(y===0){h+=v;continue}const w=f[5],S=v.substring(0,f[1]),N=v.substring(f[4],w),C=v.substring(f[2],f[3]);y===1?h+=S||N?`${S}{$${C}}${N}`:`$${C}`:y===2?h+=S||N?`${S}{$}${N}`:"$":h+=`${S}{-$${C}}${N}`}h=VS(h);const p=h||"/";return l&&r&&r.set(l,p),p}function N8(e){const t=new Map(e.map(i=>[encodeURIComponent(i),i])),n=Array.from(t.keys()).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return i=>i.replace(r,s=>t.get(s)??s)}function ib(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(i=>Dk(i,n)).join("/"):Dk(r,n)}function Rk({path:e,params:t,decoder:n,...r}){let i=!1;const s=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:s,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:s,isMissingParams:i};const l=e.length;let c=0,f,h="";for(;c<l;){const p=c;f=HS(e,p,f);const g=f[5];if(c=g+1,p===g)continue;const v=f[0];if(v===0){h+="/"+e.substring(p,g);continue}if(v===2){const y=t._splat;s._splat=y,s["*"]=y;const w=e.substring(p,f[1]),S=e.substring(f[4],g);if(!y){i=!0,(w||S)&&(h+="/"+w+S);continue}const N=ib("_splat",t,n);h+="/"+w+N+S;continue}if(v===1){const y=e.substring(f[2],f[3]);!i&&!(y in t)&&(i=!0),s[y]=t[y];const w=e.substring(p,f[1]),S=e.substring(f[4],g),N=ib(y,t,n)??"undefined";h+="/"+w+N+S;continue}if(v===3){const y=e.substring(f[2],f[3]),w=t[y];if(w==null)continue;s[y]=w;const S=e.substring(p,f[1]),N=e.substring(f[4],g),C=ib(y,t,n)??"";h+="/"+S+C+N;continue}}return e.endsWith("/")&&(h+="/"),{usedParams:s,interpolatedPath:h||"/",isMissingParams:i}}function Dk(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function nr(e){return!!e?.isNotFound}function C8(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var fw="tsr-scroll-restoration-v1_3",O8=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function _8(){const e=C8();if(!e)return null;const t=e.getItem(fw);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=_s(r,n)||n;try{e.setItem(fw,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var Jh=_8(),k8=e=>e.state.__TSR_key||e.href;function A8(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}var am=!1;function E8({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:s}){let l;try{l=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(h){console.error(h);return}const c=t||window.history.state?.__TSR_key,f=l[c];am=!0;e:{if(r&&f&&Object.keys(f).length>0){for(const g in f){const v=f[g];if(g==="window")window.scrollTo({top:v.scrollY,left:v.scrollX,behavior:n});else if(g){const y=document.querySelector(g);y&&(y.scrollLeft=v.scrollX,y.scrollTop=v.scrollY)}}break e}const h=(s??window.location).hash.split("#",2)[1];if(h){const g=window.history.state?.__hashScrollIntoViewOptions??!0;if(g){const v=document.getElementById(h);v&&v.scrollIntoView(g)}break e}const p={top:0,left:0,behavior:n};if(window.scrollTo(p),i)for(const g of i){if(g==="window")continue;const v=typeof g=="function"?g():document.querySelector(g);v&&v.scrollTo(p)}}am=!1}function T8(e,t){if(!Jh||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Jh))return;e.isScrollRestorationSetup=!0,am=!1;const n=e.options.getScrollRestorationKey||k8;window.history.scrollRestoration="manual";const r=i=>{if(am||!e.isScrollRestoring)return;let s="";if(i.target===document||i.target===window)s="window";else{const c=i.target.getAttribute("data-scroll-restoration-id");c?s=`[data-scroll-restoration-id="${c}"]`:s=A8(i.target)}const l=n(e.state.location);Jh.set(c=>{const f=c[l]||={},h=f[s]||={};if(s==="window")h.scrollX=window.scrollX||0,h.scrollY=window.scrollY||0;else if(s){const p=document.querySelector(s);p&&(h.scrollX=p.scrollLeft||0,h.scrollY=p.scrollTop||0)}return c})};typeof document<"u"&&document.addEventListener("scroll",O8(r,100),!0),e.subscribe("onRendered",i=>{const s=n(i.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(E8({storageKey:fw,key:s,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Jh.set(l=>(l[s]||={},l)))})}function P8(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function z8(e,t=String){const n=new URLSearchParams;for(const r in e){const i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function ab(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function M8(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[r,i]of t.entries()){const s=n[r];s==null?n[r]=ab(i):Array.isArray(s)?s.push(ab(i)):n[r]=[s,ab(i)]}return n}var R8=I8(JSON.parse),D8=L8(JSON.stringify,JSON.parse);function I8(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=M8(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function L8(e,t){const n=typeof t=="function";function r(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(n&&typeof i=="string")try{return t(i),e(i)}catch{}return i}return i=>{const s=z8(i,r);return s?`?${s}`:""}}var Uo="__root__";function ZS(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function gr(e){return e instanceof Response&&!!e.options}function $8(e){return{input:({url:t})=>{for(const n of e)t=hw(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=kM(e[n],t);return t}}}function U8(e){const t=_M(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),s=e.caseSensitive?r:r.toLowerCase();return{input:({url:l})=>{const c=e.caseSensitive?l.pathname:l.pathname.toLowerCase();return c===i?l.pathname="/":c.startsWith(s)&&(l.pathname=l.pathname.slice(n.length)),l},output:({url:l})=>(l.pathname=Ip(["/",t,l.pathname]),l)}}function hw(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function kM(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}var Dt=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(Dt||{});function AM({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:s,checkDirty:l,shallowPropagate:c};function r(h,p,g){const v=p.depsTail;if(v!==void 0&&v.dep===h)return;const y=v!==void 0?v.nextDep:p.deps;if(y!==void 0&&y.dep===h){y.version=g,p.depsTail=y;return}const w=h.subsTail;if(w!==void 0&&w.version===g&&w.sub===p)return;const S=p.depsTail=h.subsTail={version:g,dep:h,sub:p,prevDep:v,nextDep:y,prevSub:w,nextSub:void 0};y!==void 0&&(y.prevDep=S),v!==void 0?v.nextDep=S:p.deps=S,w!==void 0?w.nextSub=S:h.subs=S}function i(h,p=h.sub){const g=h.dep,v=h.prevDep,y=h.nextDep,w=h.nextSub,S=h.prevSub;return y!==void 0?y.prevDep=v:p.depsTail=v,v!==void 0?v.nextDep=y:p.deps=y,w!==void 0?w.prevSub=S:g.subsTail=S,S!==void 0?S.nextSub=w:(g.subs=w)===void 0&&n(g),y}function s(h){let p=h.nextSub,g;e:do{const v=h.sub;let y=v.flags;if(y&60?y&12?y&4?!(y&48)&&f(h,v)?(v.flags=y|40,y&=1):y=0:v.flags=y&-9|32:y=0:v.flags=y|32,y&2&&t(v),y&1){const w=v.subs;if(w!==void 0){const S=(h=w).nextSub;S!==void 0&&(g={value:p,prev:g},p=S);continue}}if((h=p)!==void 0){p=h.nextSub;continue}for(;g!==void 0;)if(h=g.value,g=g.prev,h!==void 0){p=h.nextSub;continue e}break}while(!0)}function l(h,p){let g,v=0,y=!1;e:do{const w=h.dep,S=w.flags;if(p.flags&16)y=!0;else if((S&17)===17){if(e(w)){const N=w.subs;N.nextSub!==void 0&&c(N),y=!0}}else if((S&33)===33){(h.nextSub!==void 0||h.prevSub!==void 0)&&(g={value:h,prev:g}),h=w.deps,p=w,++v;continue}if(!y){const N=h.nextDep;if(N!==void 0){h=N;continue}}for(;v--;){const N=p.subs,C=N.nextSub!==void 0;if(C?(h=g.value,g=g.prev):h=N,y){if(e(p)){C&&c(N),p=h.sub;continue}y=!1}else p.flags&=-33;p=h.sub;const E=h.nextDep;if(E!==void 0){h=E;continue e}}return y}while(!0)}function c(h){do{const p=h.sub,g=p.flags;(g&48)===32&&(p.flags=g|16,(g&6)===2&&t(p))}while((h=h.nextSub)!==void 0)}function f(h,p){let g=p.depsTail;for(;g!==void 0;){if(g===h)return!0;g=g.prevDep}return!1}}let YS=0,yo=0,Od=0;const Ca=[],{link:Cye,unlink:EM,propagate:Oye,checkDirty:B8,shallowPropagate:_ye}=AM({update(e){return e.depsTail!==void 0?H8(e):G8(e)},notify(e){let t=Od,n=t;do if(Ca[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(Od=t;n<--t;){const r=Ca[n];Ca[n++]=Ca[t],Ca[t]=r}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,wg(e)):Y8.call(e)}});function q8(){return YS}function F8(){++YS}function K8(){--YS||Z8()}function H8(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,wg(e)}}function G8(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function V8(e){const t=e.flags;if(t&16||t&32&&B8(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,wg(e)}}else e.flags=2}function Z8(){try{for(;yo<Od;){const e=Ca[yo];Ca[yo++]=void 0,V8(e)}}finally{for(;yo<Od;){const e=Ca[yo];Ca[yo++]=void 0,e.flags|=10}yo=0,Od=0}}function Y8(){this.depsTail=void 0,this.flags=0,wg(this);const e=this.subs;e!==void 0&&EM(e)}function wg(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=EM(n,e)}function WS(e,t,n){const r=typeof e=="object",i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}const pw=[];let Lp=0;const{link:Ik,unlink:W8,propagate:Q8,checkDirty:TM,shallowPropagate:Lk}=AM({update(e){return e._update()},notify(e){pw[mw++]=e,e.flags&=~Dt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Dt.Mutable|Dt.Dirty,sm(e))}});let ep=0,mw=0,qi;function sm(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=W8(n,e)}function PM(){if(!(q8()>0)){for(;ep<mw;){const e=pw[ep];pw[ep++]=void 0,e.notify()}ep=0,mw=0}}function zM(e,t){const n=typeof e=="function",r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?Dt.None:Dt.Mutable,get(){return qi!==void 0&&Ik(i,qi,Lp),i._snapshot},subscribe(s){const l=WS(s),c={current:!1},f=X8(()=>{i.get(),c.current?l.next?.(i._snapshot):c.current=!0});return{unsubscribe:()=>{f.stop()}}},_update(s){const l=qi,c=Object.is;if(n)qi=i,++Lp,i.depsTail=void 0;else if(s===void 0)return!1;n&&(i.flags=Dt.Mutable|Dt.RecursedCheck);try{const f=i._snapshot,h=typeof s=="function"?s(f):s===void 0&&n?r(f):s;return f===void 0||!c(f,h)?(i._snapshot=h,!0):!1}finally{qi=l,n&&(i.flags&=~Dt.RecursedCheck),sm(i)}}};return n?(i.flags=Dt.Mutable|Dt.Dirty,i.get=function(){const s=i.flags;if(s&Dt.Dirty||s&Dt.Pending&&TM(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&Lk(l)}}else s&Dt.Pending&&(i.flags=s&~Dt.Pending);return qi!==void 0&&Ik(i,qi,Lp),i._snapshot}):i.set=function(s){if(i._update(s)){const l=i.subs;l!==void 0&&(Q8(l),Lk(l),PM())}},i}function X8(e){const t=()=>{const r=qi;qi=n,++Lp,n.depsTail=void 0,n.flags=Dt.Watching|Dt.RecursedCheck;try{return e()}finally{qi=r,n.flags&=~Dt.RecursedCheck,sm(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Dt.Watching|Dt.RecursedCheck,notify(){const r=this.flags;r&Dt.Dirty||r&Dt.Pending&&TM(this.deps,this)?t():this.flags=Dt.Watching},stop(){this.flags=Dt.None,this.depsTail=void 0,sm(this)}};return t(),n}class J8{constructor(t){this.atom=zM(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(WS(t))}}class eq{constructor(t){this.atom=zM(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(WS(t))}}function tq(e){return typeof e=="function"?new eq(e):new J8(e)}function nq(e){try{F8(),e()}finally{K8(),PM()}}function _d(e){let t;return nq(()=>{t=e()}),t}var gw=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Sg=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),Bo=(e,t,n=!0)=>{const r={...e.router.options.context??{}},i=n?t:t-1;for(let s=0;s<=i;s++){const l=e.matches[s];if(!l)continue;const c=e.router.getMatch(l.id);c&&Object.assign(r,c.__routeContext,c.__beforeLoadContext)}return r},$k=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(l=>l.routeId===e.router.routeTree.id),i=r>=0?r:0;let s=n?e.matches.findIndex(l=>l.routeId===n):e.firstBadMatchIndex??e.matches.length-1;s<0&&(s=i);for(let l=s;l>=0;l--){const c=e.matches[l];if(e.router.looseRoutesById[c.routeId].options.notFoundComponent)return l}return n?s:i},ks=(e,t,n)=>{if(!(!gr(n)&&!nr(n)))throw gr(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:gr(n)?"redirected":r.status==="pending"?"success":r.status,context:Bo(e,t.index),isFetching:!1,error:n})),nr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),gr(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},MM=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Uk=(e,t,n)=>{const r=Bo(e,n);e.updateMatch(t,i=>({...i,context:r}))},ad=(e,t,n,r)=>{const{id:i,routeId:s}=e.matches[t],l=e.router.looseRoutesById[s];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,ks(e,e.router.getMatch(i),n);try{l.options.onError?.(n)}catch(c){n=c,ks(e,e.router.getMatch(i),n)}e.updateMatch(i,c=>(c._nonReactive.beforeLoadPromise?.resolve(),c._nonReactive.beforeLoadPromise=void 0,c._nonReactive.loadPromise?.resolve(),{...c,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!gr(n)&&!nr(n)&&(e.serialError??=n)},RM=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Sg(e,t)&&(n.options.loader||n.options.beforeLoad||IM(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const s=setTimeout(()=>{gw(e)},i);r._nonReactive.pendingTimeout=s}},rq=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;RM(e,t,n,r);const i=()=>{const s=e.router.getMatch(t);s.preload&&(s.status==="redirected"||s.status==="notFound")&&ks(e,s,s.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},iq=(e,t,n,r)=>{const i=e.router.getMatch(t);let s=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Tc(()=>{s?.resolve(),s=void 0});const{paramsError:l,searchError:c}=i;l&&ad(e,n,l,"PARSE_PARAMS"),c&&ad(e,n,c,"VALIDATE_SEARCH"),RM(e,t,r,i);const f=new AbortController;let h=!1;const p=()=>{h||(h=!0,e.updateMatch(t,O=>({...O,isFetching:"beforeLoad",fetchCount:O.fetchCount+1,abortController:f})))},g=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,O=>({...O,isFetching:!1}))};if(!r.options.beforeLoad){_d(()=>{p(),g()});return}i._nonReactive.beforeLoadPromise=Tc();const v={...Bo(e,n,!1),...i.__routeContext},{search:y,params:w,cause:S}=i,N=Sg(e,t),C={search:y,abortController:f,params:w,preload:N,context:v,location:e.location,navigate:O=>e.router.navigate({...O,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:N?"preload":S,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},E=O=>{if(O===void 0){_d(()=>{p(),g()});return}(gr(O)||nr(O))&&(p(),ad(e,n,O,"BEFORE_LOAD")),_d(()=>{p(),e.updateMatch(t,T=>({...T,__beforeLoadContext:O})),g()})};let k;try{if(k=r.options.beforeLoad(C),Rd(k))return p(),k.catch(O=>{ad(e,n,O,"BEFORE_LOAD")}).then(E)}catch(O){p(),ad(e,n,O,"BEFORE_LOAD")}E(k)},aq=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],s=()=>c(),l=()=>iq(e,n,t,i),c=()=>{if(MM(e,n))return;const f=rq(e,n,i);return Rd(f)?f.then(l):l()};return s()},sq=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([s,l,c])=>({meta:s?.meta,links:s?.links,headScripts:s?.scripts,headers:c,scripts:l,styles:s?.styles}))},DM=(e,t,n,r,i)=>{const s=t[r-1],{params:l,loaderDeps:c,abortController:f,cause:h}=e.router.getMatch(n),p=Bo(e,r),g=Sg(e,n);return{params:l,deps:c,preload:!!g,parentMatchPromise:s,abortController:f,context:p,location:e.location,navigate:v=>e.router.navigate({...v,_fromLocation:e.location}),cause:g?"preload":h,route:i,...e.router.options.additionalContext}},Bk=async(e,t,n,r,i)=>{try{const s=e.router.getMatch(n);try{(!(i8??e.router.isServer)||s.ssr===!0)&&Dd(i);const l=i.options.loader,c=typeof l=="function"?l:l?.handler,f=c?.(DM(e,t,n,r,i)),h=!!c&&Rd(f);if((h||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||s._nonReactive.minPendingPromise)&&e.updateMatch(n,g=>({...g,isFetching:"loader"})),c){const g=h?await f:f;ks(e,e.router.getMatch(n),g),g!==void 0&&e.updateMatch(n,v=>({...v,loaderData:g}))}i._lazyPromise&&await i._lazyPromise;const p=s._nonReactive.minPendingPromise;p&&await p,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,g=>({...g,error:void 0,context:Bo(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let c=l;if(c?.name==="AbortError"){if(s.abortController.signal.aborted){s._nonReactive.loaderPromise?.resolve(),s._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,h=>({...h,status:h.status==="pending"?"success":h.status,isFetching:!1,context:Bo(e,r)}));return}const f=s._nonReactive.minPendingPromise;f&&await f,nr(l)&&await i.options.notFoundComponent?.preload?.(),ks(e,e.router.getMatch(n),l);try{i.options.onError?.(l)}catch(h){c=h,ks(e,e.router.getMatch(n),h)}!gr(c)&&!nr(c)&&await Dd(i,["errorComponent"]),e.updateMatch(n,h=>({...h,error:c,context:Bo(e,r),status:"error",isFetching:!1}))}}catch(s){const l=e.router.getMatch(n);l&&(l._nonReactive.loaderPromise=void 0),ks(e,l,s)}},oq=async(e,t,n)=>{async function r(y,w,S,N,C){const E=Date.now()-w.updatedAt,k=y?C.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:C.options.staleTime??e.router.options.defaultStaleTime??0,O=C.options.shouldReload,T=typeof O=="function"?O(DM(e,t,i,n,C)):O,{status:P,invalid:A}=N,z=E>k&&(!!e.forceStaleReload||N.cause==="enter"||S!==void 0&&S!==N.id);l=P==="success"&&(A||(T??z)),y&&C.options.preload===!1||(l&&!e.sync&&p?(c=!0,(async()=>{try{await Bk(e,t,i,n,C);const R=e.router.getMatch(i);R._nonReactive.loaderPromise?.resolve(),R._nonReactive.loadPromise?.resolve(),R._nonReactive.loaderPromise=void 0,R._nonReactive.loadPromise=void 0}catch(R){gr(R)&&await e.router.navigate(R.options)}})()):P!=="success"||l?await Bk(e,t,i,n,C):Uk(e,i,n))}const{id:i,routeId:s}=e.matches[n];let l=!1,c=!1;const f=e.router.looseRoutesById[s],h=f.options.loader,p=((typeof h=="function"?void 0:h?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(MM(e,i)){if(!e.router.getMatch(i))return e.matches[n];Uk(e,i,n)}else{const y=e.router.getMatch(i),w=e.router.state.matches[n]?.routeId===s?e.router.state.matches[n].id:e.router.state.matches.find(N=>N.routeId===s)?.id,S=Sg(e,i);if(y._nonReactive.loaderPromise){if(y.status==="success"&&!e.sync&&!y.preload&&p)return y;await y._nonReactive.loaderPromise;const N=e.router.getMatch(i),C=N._nonReactive.error||N.error;C&&ks(e,N,C),N.status==="pending"&&await r(S,y,w,N,f)}else{const N=S&&!e.router.state.matches.some(E=>E.id===i),C=e.router.getMatch(i);C._nonReactive.loaderPromise=Tc(),N!==C.preload&&e.updateMatch(i,E=>({...E,preload:N})),await r(S,y,w,C,f)}}const g=e.router.getMatch(i);c||(g._nonReactive.loaderPromise?.resolve(),g._nonReactive.loadPromise?.resolve(),g._nonReactive.loadPromise=void 0),clearTimeout(g._nonReactive.pendingTimeout),g._nonReactive.pendingTimeout=void 0,c||(g._nonReactive.loaderPromise=void 0),g._nonReactive.dehydrated=void 0;const v=c?g.isFetching:!1;return v!==g.isFetching||g.invalid!==!1?(e.updateMatch(i,y=>({...y,isFetching:v,invalid:!1})),e.router.getMatch(i)):g};async function qk(e){const t=e,n=[];t.router.state.matches.some(v=>v._forcePending)&&gw(t);let r;for(let v=0;v<t.matches.length;v++){try{const y=aq(t,v);Rd(y)&&await y}catch(y){if(gr(y))throw y;if(nr(y))r=y;else if(!t.preload)throw y;break}if(t.serialError)break}const i=t.firstBadMatchIndex??t.matches.length,s=r&&!t.preload?$k(t,r):void 0,l=r&&t.preload?0:s!==void 0?Math.min(s+1,i):i;let c,f;for(let v=0;v<l;v++)n.push(oq(t,n,v));try{await Promise.all(n)}catch{const v=await Promise.allSettled(n);for(const y of v){if(y.status!=="rejected")continue;const w=y.reason;if(gr(w))throw w;nr(w)?c??=w:f??=w}if(f!==void 0)throw f}const h=c??(r&&!t.preload?r:void 0);let p=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!h&&r&&t.preload)return t.matches;if(h){const v=$k(t,h);Ls(v!==void 0);const y=t.matches[v],w=t.router.looseRoutesById[y.routeId],S=t.router.options?.defaultNotFoundComponent;!w.options.notFoundComponent&&S&&(w.options.notFoundComponent=S),h.routeId=y.routeId;const N=y.routeId===t.router.routeTree.id;t.updateMatch(y.id,C=>({...C,...N?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:h},isFetching:!1})),p=v,await Dd(w,["notFoundComponent"])}else if(!t.preload){const v=t.matches[0];v.globalNotFound||t.router.getMatch(v.id)?.globalNotFound&&t.updateMatch(v.id,y=>({...y,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const v=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Dd(v,["errorComponent"])}for(let v=0;v<=p;v++){const{id:y,routeId:w}=t.matches[v],S=t.router.looseRoutesById[w];try{const N=sq(t,y,S);if(N){const C=await N;t.updateMatch(y,E=>({...E,...C}))}}catch(N){console.error(`Error executing head for route ${w}:`,N)}}const g=gw(t);if(Rd(g)&&await g,h)throw h;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Fk(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Dd(e,t=$p){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:i,...s}=r.options;Object.assign(e.options,s),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===$p?(()=>{if(e._componentsPromise===void 0){const r=Fk(e,$p);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Fk(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function IM(e){for(const t of $p)if(e.options[t]?.preload)return!0;return!1}var $p=["component","errorComponent","pendingComponent","notFoundComponent"],zs="__TSR_index",Kk="popstate",Hk="beforeunload";function lq(e){let t=e.getLocation();const n=new Set,r=l=>{t=e.getLocation(),n.forEach(c=>c({location:t,action:l}))},i=l=>{e.notifyOnIndexChange??!0?r(l):t=e.getLocation()},s=async({task:l,navigateOpts:c,...f})=>{if(c?.ignoreBlocker??!1){l();return}const h=e.getBlockers?.()??[],p=f.type==="PUSH"||f.type==="REPLACE";if(typeof document<"u"&&h.length&&p)for(const g of h){const v=om(f.path,f.state);if(await g.blockerFn({currentLocation:t,nextLocation:v,action:f.type})){e.onBlocked?.();return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,c,f)=>{const h=t.state[zs];c=Gk(h+1,c),s({task:()=>{e.pushState(l,c),r({type:"PUSH"})},navigateOpts:f,type:"PUSH",path:l,state:c})},replace:(l,c,f)=>{const h=t.state[zs];c=Gk(h,c),s({task:()=>{e.replaceState(l,c),r({type:"REPLACE"})},navigateOpts:f,type:"REPLACE",path:l,state:c})},go:(l,c)=>{s({task:()=>{e.go(l),i({type:"GO",index:l})},navigateOpts:c,type:"GO"})},back:l=>{s({task:()=>{e.back(l?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{s({task:()=>{e.forward(l?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[zs]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const c=e.getBlockers?.()??[];return e.setBlockers([...c,l]),()=>{const f=e.getBlockers?.()??[];e.setBlockers?.(f.filter(h=>h!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Gk(e,t){t||(t={});const n=QS();return{...t,key:n,__TSR_key:n,[zs]:e}}function cq(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let i=[];const s=()=>i,l=z=>i=z,c=(z=>z),f=(()=>om(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const z=QS();t.history.replaceState({[zs]:0,key:z,__TSR_key:z},"")}let h=f(),p,g=!1,v=!1,y=!1,w=!1;const S=()=>h;let N,C;const E=()=>{N&&(A._ignoreSubscribers=!0,(N.isPush?t.history.pushState:t.history.replaceState)(N.state,"",N.href),A._ignoreSubscribers=!1,N=void 0,C=void 0,p=void 0)},k=(z,R,q)=>{const U=c(R);C||(p=h),h=om(R,q),N={href:U,state:q,isPush:N?.isPush||z==="push"},C||(C=Promise.resolve().then(()=>E()))},O=z=>{h=f(),A.notify({type:z})},T=async()=>{if(v){v=!1;return}const z=f(),R=z.state[zs]-h.state[zs],q=R===1,U=R===-1,L=!q&&!U||g;g=!1;const ae=L?"GO":U?"BACK":"FORWARD",pe=L?{type:"GO",index:R}:{type:U?"BACK":"FORWARD"};if(y)y=!1;else{const ge=s();if(typeof document<"u"&&ge.length){for(const V of ge)if(await V.blockerFn({currentLocation:h,nextLocation:z,action:ae})){v=!0,t.history.go(1),A.notify(pe);return}}}h=f(),A.notify(pe)},P=z=>{if(w){w=!1;return}let R=!1;const q=s();if(typeof document<"u"&&q.length)for(const U of q){const L=U.enableBeforeUnload??!0;if(L===!0){R=!0;break}if(typeof L=="function"&&L()===!0){R=!0;break}}if(R)return z.preventDefault(),z.returnValue=""},A=lq({getLocation:S,getLength:()=>t.history.length,pushState:(z,R)=>k("push",z,R),replaceState:(z,R)=>k("replace",z,R),back:z=>(z&&(y=!0),w=!0,t.history.back()),forward:z=>{z&&(y=!0),w=!0,t.history.forward()},go:z=>{g=!0,t.history.go(z)},createHref:z=>c(z),flush:E,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Hk,P,{capture:!0}),t.removeEventListener(Kk,T)},onBlocked:()=>{p&&h!==p&&(h=p)},getBlockers:s,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(Hk,P,{capture:!0}),t.addEventListener(Kk,T),t.history.pushState=function(...z){const R=n.apply(t.history,z);return A._ignoreSubscribers||O("PUSH"),R},t.history.replaceState=function(...z){const R=r.apply(t.history,z);return A._ignoreSubscribers||O("REPLACE"),R},A}function uq(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function om(e,t){const n=uq(e),r=n.indexOf("#"),i=n.indexOf("?"),s=QS();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):"",search:i>-1?n.slice(i,r===-1?void 0:r):"",state:t||{[zs]:0,key:s,__TSR_key:s}}}function QS(){return(Math.random()+1).toString(36).substring(7)}function qo(e){const t=e.resolvedLocation,n=e.location;return{fromLocation:t,toLocation:n,pathChanged:t?.pathname!==n.pathname,hrefChanged:t?.href!==n.href,hashChanged:t?.hash!==n.hash}}function dq(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}var fq=class{constructor(e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=t=>t(),this.update=t=>{const n=this.options,r=this.basepath??n?.basepath??"/",i=this.basepath===void 0,s=n?.rewrite;if(this.options={...n,...t},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=N8(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=cq()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let h;this.resolvePathCache=rm(1e3),h=this.buildRouteTree(),this.setRoutes(h)}!this.__store&&this.latestLocation&&(this.__store=tq(pq(this.latestLocation)),T8(this));let l=!1;const c=this.options.basepath??"/",f=this.options.rewrite;if(i||r!==c||s!==f){this.basepath=c;const h=[],p=_M(c);p&&p!=="/"&&h.push(U8({basepath:c})),f&&h.push(f),this.rewrite=h.length===0?void 0:h.length===1?h[0]:$8(h),this.history&&this.updateLatestLocation(),l=!0}l&&this.__store&&this.__store.setState(h=>({...h,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=y8(this.routeTree,this.options.caseSensitive,(n,r)=>{n.init({originalIndex:r})});return this.options.routeMasks&&h8(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,n)=>{const r={eventType:t,fn:n};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}},this.emit=t=>{this.subscribers.forEach(n=>{n.eventType===t.type&&n.fn(t)})},this.parseLocation=(t,n)=>{const r=({pathname:c,search:f,hash:h,href:p,state:g})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const N=this.options.parseSearch(f),C=this.options.stringifySearch(N);return{href:c+C+h,publicHref:p,pathname:rd(c).path,external:!1,searchStr:C,search:vo(n?.search,N),hash:rd(h.slice(1)).path,state:Ao(n?.state,g)}}const v=new URL(p,this.origin),y=hw(this.rewrite,v),w=this.options.parseSearch(y.search),S=this.options.stringifySearch(w);return y.search=S,{href:y.href.replace(y.origin,""),publicHref:p,pathname:rd(y.pathname).path,external:!!this.rewrite&&y.origin!==this.origin,searchStr:S,search:vo(n?.search,w),hash:rd(y.hash.slice(1)).path,state:Ao(n?.state,g)}},i=r(t),{__tempLocation:s,__tempKey:l}=i.state;if(s&&(!l||l===this.tempLocationKey)){const c=r(s);return c.state.key=i.state.key,c.state.__TSR_key=i.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:i}}return i},this.resolvePathWithBase=(t,n)=>j8({base:t,to:VS(n),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,n,r)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:n},r):this.matchRoutesInternal(t,n),this.getMatchedRoutes=t=>mq({pathname:t,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=t=>{const n=this.getMatch(t);n&&(n.abortController.abort(),clearTimeout(n._nonReactive.pendingTimeout),n._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const t=this.state.matches.filter(r=>r.status==="pending"),n=this.state.matches.filter(r=>r.isFetching==="loader");new Set([...this.state.pendingMatches??[],...t,...n]).forEach(r=>{this.cancelMatch(r.id)})},this.buildLocation=t=>{const n=(i={})=>{const s=i._fromLocation||this.pendingBuiltLocation||this.latestLocation,l=this.matchRoutesLightweight(s);i.from;const c=i.unsafeRelative==="path"?s.pathname:i.from??l.fullPath,f=this.resolvePathWithBase(c,"."),h=l.search,p=Object.assign(Object.create(null),l.params),g=i.to?this.resolvePathWithBase(f,`${i.to}`):this.resolvePathWithBase(f,"."),v=i.params===!1||i.params===null?Object.create(null):(i.params??!0)===!0?p:Object.assign(p,_s(i.params,p)),y=this.getMatchedRoutes(g);let w=y.matchedRoutes;if((!y.foundRoute||y.foundRoute.path!=="/"&&y.routeParams["**"])&&this.options.notFoundRoute&&(w=[...w,this.options.notFoundRoute]),Object.keys(v).length>0)for(const R of w){const q=R.options.params?.stringify??R.options.stringifyParams;if(q)try{Object.assign(v,q(v))}catch{}}const S=t.leaveParams?g:rd(Rk({path:g,params:v,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let N=h;if(t._includeValidateSearch&&this.options.search?.strict){const R={};w.forEach(q=>{if(q.options.validateSearch)try{Object.assign(R,Up(q.options.validateSearch,{...R,...N}))}catch{}}),N=R}N=gq({search:N,dest:i,destRoutes:w,_includeValidateSearch:t._includeValidateSearch}),N=vo(h,N);const C=this.options.stringifySearch(N),E=i.hash===!0?s.hash:i.hash?_s(i.hash,s.hash):void 0,k=E?`#${E}`:"";let O=i.state===!0?s.state:i.state?_s(i.state,s.state):{};O=Ao(s.state,O);const T=`${S}${C}${k}`;let P,A,z=!1;if(this.rewrite){const R=new URL(T,this.origin),q=kM(this.rewrite,R);P=R.href.replace(R.origin,""),q.origin!==this.origin?(A=q.href,z=!0):A=q.pathname+q.search+q.hash}else P=u8(T),A=P;return{publicHref:A,href:P,pathname:S,search:N,searchStr:C,state:O,hash:E??"",external:z,unmaskOnReload:i.unmaskOnReload}},r=(i={},s)=>{const l=n(i);let c=s?n(s):void 0;if(!c){const f=Object.create(null);if(this.options.routeMasks){const h=p8(l.pathname,this.processedTree);if(h){Object.assign(f,h.rawParams);const{from:p,params:g,...v}=h.route,y=g===!1||g===null?Object.create(null):(g??!0)===!0?f:Object.assign(f,_s(g,f));s={from:t.from,...v,params:y},c=n(s)}}}return c&&(l.maskedLocation=c),l};return t.mask?r(t,{from:t.from,...t.mask}):r(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:n,...r})=>{const i=()=>{const c=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];c.forEach(h=>{r.state[h]=this.latestLocation.state[h]});const f=$o(r.state,this.latestLocation.state);return c.forEach(h=>{delete r.state[h]}),f},s=Ps(this.latestLocation.href)===Ps(r.href);let l=this.commitLocationPromise;if(this.commitLocationPromise=Tc(()=>{l?.resolve(),l=void 0}),s&&i())this.load();else{let{maskedLocation:c,hashScrollIntoView:f,...h}=r;c&&(h={...c,state:{...c.state,__tempKey:void 0,__tempLocation:{...h,search:h.searchStr,state:{...h.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(h.unmaskOnReload??this.options.unmaskOnReload??!1)&&(h.state.__tempKey=this.tempLocationKey)),h.state.__hashScrollIntoViewOptions=f??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[r.replace?"replace":"push"](h.publicHref,h.state,{ignoreBlocker:n})}return this.resetNextScroll=r.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:n,hashScrollIntoView:r,viewTransition:i,ignoreBlocker:s,href:l,...c}={})=>{if(l){const p=this.history.location.state.__TSR_index,g=om(l,{__TSR_index:t?p:p+1}),v=new URL(g.pathname,this.origin);c.to=hw(this.rewrite,v).pathname,c.search=this.options.parseSearch(g.search),c.hash=g.hash.slice(1)}const f=this.buildLocation({...c,_includeValidateSearch:!0});this.pendingBuiltLocation=f;const h=this.commitLocation({...f,viewTransition:i,replace:t,resetScroll:n,hashScrollIntoView:r,ignoreBlocker:s});return Promise.resolve().then(()=>{this.pendingBuiltLocation===f&&(this.pendingBuiltLocation=void 0)}),h},this.navigate=async({to:t,reloadDocument:n,href:r,publicHref:i,...s})=>{let l=!1;if(r)try{new URL(`${r}`),l=!0}catch{}if(l&&!n&&(n=!0),n){if(t!==void 0||!r){const f=this.buildLocation({to:t,...s});r=r??f.publicHref,i=i??f.publicHref}const c=!l&&i?i:r;if(nm(c,this.protocolAllowlist))return Promise.resolve();if(!s.ignoreBlocker){const f=this.history.getBlockers?.()??[];for(const h of f)if(h?.blockerFn&&await h.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return s.replace?window.location.replace(c):window.location.href=c,Promise.resolve()}return this.buildAndCommitLocation({...s,href:r,to:t,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const t=this.matchRoutes(this.latestLocation);this.__store.setState(n=>({...n,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:t,cachedMatches:n.cachedMatches.filter(r=>!t.some(i=>i.id===r.id))}))},this.load=async t=>{let n,r,i;const s=this.state.resolvedLocation??this.state.location;for(i=new Promise(c=>{this.startTransition(async()=>{try{this.beforeLoad();const f=this.latestLocation,h=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...qo({resolvedLocation:h,location:f})}),this.emit({type:"onBeforeLoad",...qo({resolvedLocation:h,location:f})}),await qk({router:this,sync:t?.sync,forceStaleReload:s.href===f.href,matches:this.state.pendingMatches,location:f,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let p=[],g=[],v=[],y=[];_d(()=>{this.__store.setState(w=>{const S=w.matches,N=w.pendingMatches||w.matches;return p=S.filter(C=>!N.some(E=>E.id===C.id)),g=S.filter(C=>!N.some(E=>E.routeId===C.routeId)),v=N.filter(C=>!S.some(E=>E.routeId===C.routeId)),y=N.filter(C=>S.some(E=>E.routeId===C.routeId)),{...w,isLoading:!1,loadedAt:Date.now(),matches:N,pendingMatches:void 0,cachedMatches:[...w.cachedMatches,...p.filter(C=>C.status!=="error"&&C.status!=="notFound"&&C.status!=="redirected")]}}),this.clearExpiredCache()}),[[g,"onLeave"],[v,"onEnter"],[y,"onStay"]].forEach(([w,S])=>{w.forEach(N=>{this.looseRoutesById[N.routeId].options[S]?.(N)})})})})}})}catch(f){gr(f)?(n=f,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):nr(f)&&(r=f),this.__store.setState(h=>({...h,statusCode:n?n.status:r?404:h.matches.some(p=>p.status==="error")?500:200,redirect:n}))}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),c()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let l;this.hasNotFoundMatch()?l=404:this.__store.state.matches.some(c=>c.status==="error")&&(l=500),l!==void 0&&this.__store.setState(c=>({...c,statusCode:l}))},this.startViewTransition=t=>{const n=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,n&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let r;if(typeof n=="object"&&this.isViewTransitionTypesSupported){const i=this.latestLocation,s=this.state.resolvedLocation,l=typeof n.types=="function"?n.types(qo({resolvedLocation:s,location:i})):n.types;if(l===!1){t();return}r={update:t,types:l}}else r=t;document.startViewTransition(r)}else t()},this.updateMatch=(t,n)=>{this.startTransition(()=>{const r=this.state.pendingMatches?.some(i=>i.id===t)?"pendingMatches":this.state.matches.some(i=>i.id===t)?"matches":this.state.cachedMatches.some(i=>i.id===t)?"cachedMatches":"";r&&(r==="cachedMatches"?this.__store.setState(i=>({...i,cachedMatches:dq(i.cachedMatches.map(s=>s.id===t?n(s):s))})):this.__store.setState(i=>({...i,[r]:i[r]?.map(s=>s.id===t?n(s):s)})))})},this.getMatch=t=>{const n=r=>r.id===t;return this.state.cachedMatches.find(n)??this.state.pendingMatches?.find(n)??this.state.matches.find(n)},this.invalidate=t=>{const n=r=>t?.filter?.(r)??!0?{...r,invalid:!0,...t?.forcePending||r.status==="error"||r.status==="notFound"?{status:"pending",error:void 0}:void 0}:r;return this.__store.setState(r=>({...r,matches:r.matches.map(n),cachedMatches:r.cachedMatches.map(n),pendingMatches:r.pendingMatches?.map(n)})),this.shouldViewTransition=!1,this.load({sync:t?.sync})},this.getParsedLocationHref=t=>t.publicHref||"/",this.resolveRedirect=t=>{const n=t.headers.get("Location");if(!t.options.href||t.options._builtLocation){const r=t.options._builtLocation??this.buildLocation(t.options),i=this.getParsedLocationHref(r);t.options.href=i,t.headers.set("Location",i)}else if(n)try{const r=new URL(n);if(this.origin&&r.origin===this.origin){const i=r.pathname+r.search+r.hash;t.options.href=i,t.headers.set("Location",i)}}catch{}if(t.options.href&&!t.options._builtLocation&&nm(t.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{const n=t?.filter;n!==void 0?this.__store.setState(r=>({...r,cachedMatches:r.cachedMatches.filter(i=>!n(i))})):this.__store.setState(r=>({...r,cachedMatches:[]}))},this.clearExpiredCache=()=>{const t=n=>{const r=this.looseRoutesById[n.routeId];if(!r.options.loader)return!0;const i=(n.preload?r.options.preloadGcTime??this.options.defaultPreloadGcTime:r.options.gcTime??this.options.defaultGcTime)??300*1e3;return n.status==="error"?!0:Date.now()-n.updatedAt>=i};this.clearCache({filter:t})},this.loadRouteChunk=Dd,this.preloadRoute=async t=>{const n=t._builtLocation??this.buildLocation(t);let r=this.matchRoutes(n,{throwOnError:!0,preload:!0,dest:t});const i=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(l=>l.id)),s=new Set([...i,...this.state.cachedMatches.map(l=>l.id)]);_d(()=>{r.forEach(l=>{s.has(l.id)||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,l]}))})});try{return r=await qk({router:this,matches:r,location:n,preload:!0,updateMatch:(l,c)=>{i.has(l)?r=r.map(f=>f.id===l?c(f):f):this.updateMatch(l,c)}}),r}catch(l){if(gr(l))return l.options.reloadDocument?void 0:await this.preloadRoute({...l.options,_fromLocation:n});nr(l)||console.error(l);return}},this.matchRoute=(t,n)=>{const r={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},i=this.buildLocation(r);if(n?.pending&&this.state.status!=="pending")return!1;const s=(n?.pending===void 0?!this.state.isLoading:n.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,l=m8(i.pathname,n?.caseSensitive??!1,n?.fuzzy??!1,s.pathname,this.processedTree);return!l||t.params&&!$o(l.rawParams,t.params,{partial:!0})?!1:n?.includeSearch??!0?$o(s.search,i.search,{partial:!0})?l.rawParams:!1:l.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(t=>t.status==="notFound"||t.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??D8,parseSearch:e.parseSearch??R8,protocolAllowlist:e.protocolAllowlist??c8}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:s}=n;let{matchedRoutes:l}=n,c=!1;(r?r.path!=="/"&&i["**"]:Ps(e.pathname))&&(this.options.notFoundRoute?l=[...l,this.options.notFoundRoute]:c=!0);const f=c?yq(this.options.notFoundMode,l):void 0,h=new Array(l.length),p=new Map(this.state.matches.map(g=>[g.routeId,g]));for(let g=0;g<l.length;g++){const v=l[g],y=h[g-1];let w,S,N;{const ae=y?.search??e.search,pe=y?._strictSearch??void 0;try{const ge=Up(v.options.validateSearch,{...ae})??void 0;w={...ae,...ge},S={...pe,...ge},N=void 0}catch(ge){let V=ge;if(ge instanceof lm||(V=new lm(ge.message,{cause:ge})),t?.throwOnError)throw V;w=ae,S={},N=V}}const C=v.options.loaderDeps?.({search:w})??"",E=C?JSON.stringify(C):"",{interpolatedPath:k,usedParams:O}=Rk({path:v.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),T=v.id+k+E,P=this.getMatch(T),A=p.get(v.id),z=P?._strictParams??O;let R;if(!P)try{Vk(v,O,s,z)}catch(ae){if(nr(ae)||gr(ae)?R=ae:R=new hq(ae.message,{cause:ae}),t?.throwOnError)throw R}Object.assign(i,z);const q=A?"stay":"enter";let U;if(P)U={...P,cause:q,params:A?.params??i,_strictParams:z,search:vo(A?A.search:P.search,w),_strictSearch:S};else{const ae=v.options.loader||v.options.beforeLoad||v.lazyFn||IM(v)?"pending":"success";U={id:T,ssr:v.options.ssr,index:g,routeId:v.id,params:A?.params??i,_strictParams:z,pathname:k,updatedAt:Date.now(),search:A?vo(A.search,w):w,_strictSearch:S,searchError:void 0,status:ae,isFetching:!1,error:void 0,paramsError:R,__routeContext:void 0,_nonReactive:{loadPromise:Tc()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:q,loaderDeps:A?Ao(A.loaderDeps,C):C,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:v.options.staticData||{},fullPath:v.fullPath}}t?.preload||(U.globalNotFound=f===v.id),U.searchError=N;const L=this.getParentContext(y);U.context={...L,...U.__routeContext,...U.__beforeLoadContext},h[g]=U}for(let g=0;g<h.length;g++){const v=h[g],y=this.looseRoutesById[v.routeId],w=this.getMatch(v.id),S=p.get(v.routeId);if(v.params=S?vo(S.params,i):i,!w){const N=h[g-1],C=this.getParentContext(N);if(y.options.context){const E={deps:v.loaderDeps,params:v.params,context:C??{},location:e,navigate:k=>this.navigate({...k,_fromLocation:e}),buildLocation:this.buildLocation,cause:v.cause,abortController:v.abortController,preload:!!v.preload,matches:h,routeId:y.id};v.__routeContext=y.options.context(E)??void 0}v.context={...C,...v.__routeContext,...v.__beforeLoadContext}}}return h}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=Md(t),s={...e.search};for(const h of t)try{Object.assign(s,Up(h.options.validateSearch,s))}catch{}const l=Md(this.state.matches),c=l&&l.routeId===i.id&&e.pathname===this.state.location.pathname;let f;if(c)f=l.params;else{const h=Object.assign(Object.create(null),n);for(const p of t)try{Vk(p,n,r??{},h)}catch{}f=h}return{matchedRoutes:t,fullPath:i.fullPath,search:s,params:f}}},lm=class extends Error{},hq=class extends Error{};function pq(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Up(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new lm("Async validation not supported");if(n.issues)throw new lm(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function mq({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),i=Ps(e);let s,l;const c=g8(i,n,!0);return c&&(s=c.route,Object.assign(r,c.rawParams),l=Object.assign(Object.create(null),c.parsedParams)),{matchedRoutes:c?.branch||[t.__root__],routeParams:r,foundRoute:s,parsedParams:l}}function gq({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return vq(n)(e,t,r??!1)}function vq(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)i.options.search?.middlewares&&t.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const s=({search:l,next:c})=>{let f=l;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(f=i.options.preSearchFilters.reduce((p,g)=>g(p),l));const h=c(f);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((p,g)=>g(p),h):h};t.middlewares.push(s)}if(i.options.validateSearch){const s=({search:l,next:c})=>{const f=c(l);if(!t._includeValidateSearch)return f;try{return{...f,...Up(i.options.validateSearch,f)??void 0}}catch{return f}};t.middlewares.push(s)}}const n=({search:i})=>{const s=t.dest;return s.search?s.search===!0?i:_s(s.search,i):{}};t.middlewares.push(n);const r=(i,s,l)=>{if(i>=l.length)return s;const c=l[i];return c({search:s,next:h=>r(i+1,h,l)})};return function(s,l,c){return t.dest=l,t._includeValidateSearch=c,r(0,s,t.middlewares)}}function yq(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return Uo}function Vk(e,t,n,r){const i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(const s in t)s in n&&(r[s]=n[s]);else{const s=i(r);Object.assign(r,s)}}var bq="Error preloading route! ☝️",LM=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{this.originalIndex=t.originalIndex;const n=this.options,r=!n?.path&&!n?.id;this.parentRoute=this.options.getParentRoute?.(),r?this._path=Uo:this.parentRoute||Ls(!1);let i=r?Uo:n?.path;i&&i!=="/"&&(i=OM(i));const s=n?.id||i;let l=r?Uo:Ip([this.parentRoute.id==="__root__"?"":this.parentRoute.id,s]);i==="__root__"&&(i="/"),l!=="__root__"&&(l=Ip(["/",l]));const c=l==="__root__"?"/":Ip([this.parentRoute.fullPath,i]);this._path=i,this._id=l,this._fullPath=c,this._to=Ps(c)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>ZS({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},xq=class extends LM{constructor(e){super(e)}};function XS(e){const t=e.errorComponent??JS;return u.jsx(wq,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?x.createElement(t,{error:n,reset:r}):e.children})}var wq=class extends x.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}};function JS({error:e}){const[t,n]=x.useState(!1);return u.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[u.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[u.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),u.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),u.jsx("div",{style:{height:".25rem"}}),t?u.jsx("div",{children:u.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?u.jsx("code",{children:e.message}):null})}):null]})}function Sq({children:e,fallback:t=null}){return $M()?u.jsx(bi.Fragment,{children:e}):u.jsx(bi.Fragment,{children:t})}function $M(){return bi.useSyncExternalStore(jq,()=>!0,()=>!1)}function jq(){return()=>{}}var UM=x.createContext(null);function oi(e){const t=x.useContext(UM);return e?.warn,t}var sb={exports:{}},ob={},lb={exports:{}},cb={};var Zk;function Nq(){if(Zk)return cb;Zk=1;var e=Gc();function t(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,s=e.useLayoutEffect,l=e.useDebugValue;function c(g,v){var y=v(),w=r({inst:{value:y,getSnapshot:v}}),S=w[0].inst,N=w[1];return s(function(){S.value=y,S.getSnapshot=v,f(S)&&N({inst:S})},[g,y,v]),i(function(){return f(S)&&N({inst:S}),g(function(){f(S)&&N({inst:S})})},[g]),l(y),y}function f(g){var v=g.getSnapshot;g=g.value;try{var y=v();return!n(g,y)}catch{return!0}}function h(g,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:c;return cb.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,cb}var Yk;function Cq(){return Yk||(Yk=1,lb.exports=Nq()),lb.exports}var Wk;function Oq(){if(Wk)return ob;Wk=1;var e=Gc(),t=Cq();function n(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,s=e.useRef,l=e.useEffect,c=e.useMemo,f=e.useDebugValue;return ob.useSyncExternalStoreWithSelector=function(h,p,g,v,y){var w=s(null);if(w.current===null){var S={hasValue:!1,value:null};w.current=S}else S=w.current;w=c(function(){function C(P){if(!E){if(E=!0,k=P,P=v(P),y!==void 0&&S.hasValue){var A=S.value;if(y(A,P))return O=A}return O=P}if(A=O,r(k,P))return A;var z=v(P);return y!==void 0&&y(A,z)?(k=P,A):(k=P,O=z)}var E=!1,k,O,T=g===void 0?null:g;return[function(){return C(p())},T===null?void 0:function(){return C(T())}]},[p,g,v,y]);var N=i(h,w[0],w[1]);return l(function(){S.hasValue=!0,S.value=N},[N]),f(N),N},ob}var Qk;function _q(){return Qk||(Qk=1,sb.exports=Oq()),sb.exports}var BM=_q();function kq(e,t){return e===t}function Aq(e,t,n=kq){const r=x.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:c}=e.subscribe(l);return c},[e]),i=x.useCallback(()=>e?.get(),[e]);return BM.useSyncExternalStoreWithSelector(r,i,i,t,n)}function br(e){const t=oi({warn:e?.router===void 0}),n=e?.router||t,r=x.useRef(void 0);return Aq(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const s=Ao(r.current,e.select(i));return r.current=s,s}return e.select(i)}return i})}var jg=x.createContext(void 0),Eq=x.createContext(void 0);function Ks(e){const t=x.useContext(e.from?Eq:jg);return br({select:n=>{const r=n.matches.find(i=>e.from?e.from===i.routeId:i.id===t);if(Ls(!((e.shouldThrow??!0)&&!r),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),r!==void 0)return e.select?e.select(r):r},structuralSharing:e.structuralSharing})}function e1(e){return Ks({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function t1(e){const{select:t,...n}=e;return Ks({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Ng(e){return Ks({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Cg(e){return Ks({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Hs(e){const t=oi();return x.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function n1(e){return Ks({...e,select:t=>e.select?e.select(t.context):t.context})}var ol=oM();const Tq=qs(ol);function Pq(e,t){const n=oi(),r=r8(t),{activeProps:i,inactiveProps:s,activeOptions:l,to:c,preload:f,preloadDelay:h,hashScrollIntoView:p,replace:g,startTransition:v,resetScroll:y,viewTransition:w,children:S,target:N,disabled:C,style:E,className:k,onClick:O,onBlur:T,onFocus:P,onMouseEnter:A,onMouseLeave:z,onTouchStart:R,ignoreBlocker:q,params:U,search:L,hash:ae,state:pe,mask:ge,reloadDocument:V,unsafeRelative:re,from:ve,_fromLocation:we,...B}=e,D=$M(),G=br({select:Xe=>{const at=Xe.matches[Xe.matches.length-1];return{search:at?.search,hash:Xe.location.hash,path:at?.pathname}},structuralSharing:!0}),oe=e.from,W=x.useMemo(()=>({...e,from:oe}),[n,G,oe,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),X=x.useMemo(()=>n.buildLocation({...W}),[n,W]),Q=X.maskedLocation?X.maskedLocation.publicHref:X.publicHref,de=X.maskedLocation?X.maskedLocation.external:X.external,ye=x.useMemo(()=>Lq(Q,de,n.history,C),[C,de,Q,n.history]),Z=x.useMemo(()=>{if(ye?.external)return nm(ye.href,n.protocolAllowlist)?void 0:ye.href;if(!$q(c)&&!(typeof c!="string"||c.indexOf(":")===-1))try{return new URL(c),nm(c,n.protocolAllowlist)?void 0:c}catch{}},[c,ye,n.protocolAllowlist]),le=br({select:Xe=>{if(Z)return!1;if(l?.exact){if(!S8(Xe.location.pathname,X.pathname,n.basepath))return!1}else{const at=im(Xe.location.pathname,n.basepath),Pt=im(X.pathname,n.basepath);if(!(at.startsWith(Pt)&&(at.length===Pt.length||at[Pt.length]==="/")))return!1}return(l?.includeSearch??!0)&&!$o(Xe.location.search,X.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?D&&Xe.location.hash===X.hash:!0}}),Se=le?_s(i,{})??zq:ub,F=le?ub:_s(s,{})??ub,Ae=[k,Se.className,F.className].filter(Boolean).join(" "),Oe=(E||Se.style||F.style)&&{...E,...Se.style,...F.style},[nt,Ve]=x.useState(!1),sn=x.useRef(!1),pn=e.reloadDocument||Z?!1:f??n.options.defaultPreload,Gt=h??n.options.defaultPreloadDelay??0,he=x.useCallback(()=>{n.preloadRoute({...W,_builtLocation:X}).catch(Xe=>{console.warn(Xe),console.warn(bq)})},[n,W,X]);n8(r,x.useCallback(Xe=>{Xe?.isIntersecting&&he()},[he]),Iq,{disabled:!!C||pn!=="viewport"}),x.useEffect(()=>{sn.current||!C&&pn==="render"&&(he(),sn.current=!0)},[C,he,pn]);const Fe=Xe=>{const at=Xe.currentTarget.getAttribute("target"),Pt=N!==void 0?N:at;if(!C&&!Uq(Xe)&&!Xe.defaultPrevented&&(!Pt||Pt==="_self")&&Xe.button===0){Xe.preventDefault(),ol.flushSync(()=>{Ve(!0)});const cr=n.subscribe("onResolved",()=>{cr(),Ve(!1)});n.navigate({...W,replace:g,resetScroll:y,hashScrollIntoView:p,startTransition:v,viewTransition:w,ignoreBlocker:q})}};if(Z)return{...B,ref:r,href:Z,...S&&{children:S},...N&&{target:N},...C&&{disabled:C},...E&&{style:E},...k&&{className:k},...O&&{onClick:O},...T&&{onBlur:T},...P&&{onFocus:P},...A&&{onMouseEnter:A},...z&&{onMouseLeave:z},...R&&{onTouchStart:R}};const St=Xe=>{if(C||pn!=="intent")return;if(!Gt){he();return}const at=Xe.currentTarget;if(sd.has(at))return;const Pt=setTimeout(()=>{sd.delete(at),he()},Gt);sd.set(at,Pt)},lr=Xe=>{C||pn!=="intent"||he()},st=Xe=>{if(C||!pn||!Gt)return;const at=Xe.currentTarget,Pt=sd.get(at);Pt&&(clearTimeout(Pt),sd.delete(at))};return{...B,...Se,...F,href:ye?.href,ref:r,onClick:ec([O,Fe]),onBlur:ec([T,st]),onFocus:ec([P,St]),onMouseEnter:ec([A,St]),onMouseLeave:ec([z,st]),onTouchStart:ec([R,lr]),disabled:!!C,target:N,...Oe&&{style:Oe},...Ae&&{className:Ae},...C&&Mq,...le&&Rq,...D&&nt&&Dq}}var ub={},zq={className:"active"},Mq={role:"link","aria-disabled":!0},Rq={"data-status":"active","aria-current":"page"},Dq={"data-transitioning":"transitioning"},sd=new WeakMap,Iq={rootMargin:"100px"},ec=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Lq(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function $q(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Rt=x.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,...s}=Pq(r,t),l=typeof r.children=="function"?r.children({isActive:s["data-status"]==="active"}):r.children;if(!n){const{disabled:c,...f}=s;return x.createElement("a",f,l)}return x.createElement(n,s,l)});function Uq(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Bq=class extends LM{constructor(e){super(e),this.useMatch=t=>Ks({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>n1({...t,from:this.id}),this.useSearch=t=>Cg({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Ng({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>t1({...t,from:this.id}),this.useLoaderData=t=>e1({...t,from:this.id}),this.useNavigate=()=>Hs({from:this.fullPath}),this.Link=bi.forwardRef((t,n)=>u.jsx(Rt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function li(e){return new Bq(e)}function qq(){return e=>Kq(e)}var Fq=class extends xq{constructor(e){super(e),this.useMatch=t=>Ks({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>n1({...t,from:this.id}),this.useSearch=t=>Cg({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Ng({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>t1({...t,from:this.id}),this.useLoaderData=t=>e1({...t,from:this.id}),this.useNavigate=()=>Hs({from:this.fullPath}),this.Link=bi.forwardRef((t,n)=>u.jsx(Rt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function Kq(e){return new Fq(e)}function Xk(e){return typeof e=="object"?new Jk(e,{silent:!0}).createRoute(e):new Jk(e,{silent:!0}).createRoute}var Jk=class{constructor(e,t){this.path=e,this.createRoute=n=>{const r=li(n);return r.isRoot=!1,r},this.silent=t?.silent}},eA=class{constructor(e){this.useMatch=t=>Ks({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>n1({...t,from:this.options.id}),this.useSearch=t=>Cg({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>Ng({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>t1({...t,from:this.options.id}),this.useLoaderData=t=>e1({...t,from:this.options.id}),this.useNavigate=()=>Hs({from:oi().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function tA(e){return typeof e=="object"?new eA(e):t=>new eA({id:e,...t})}function Hq(e){const t=br({select:n=>`not-found-${n.location.pathname}-${n.status}`});return u.jsx(XS,{getResetKey:()=>t,onCatch:(n,r)=>{if(nr(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(nr(n))return e.fallback?.(n);throw n},children:e.children})}function Gq(){return u.jsx("p",{children:"Not Found"})}function pc(e){return u.jsx(u.Fragment,{children:e.children})}function qM(e,t,n){return t.options.notFoundComponent?u.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?u.jsx(e.options.defaultNotFoundComponent,{...n}):u.jsx(Gq,{})}function Vq(){return oi().isScrollRestoring,null}var FM=x.memo(function({matchId:t}){const n=oi(),r=br({select:w=>{const S=w.matches.findIndex(C=>C.id===t),N=w.matches[S];return Ls(N),{routeId:N.routeId,ssr:N.ssr,_displayPending:N._displayPending,resetKey:w.loadedAt,parentRouteId:w.matches[S-1]?.routeId}},structuralSharing:!0}),i=n.routesById[r.routeId],s=i.options.pendingComponent??n.options.defaultPendingComponent,l=s?u.jsx(s,{}):null,c=i.options.errorComponent??n.options.defaultErrorComponent,f=i.options.onCatch??n.options.defaultOnCatch,h=i.isRoot?i.options.notFoundComponent??n.options.notFoundRoute?.options.component:i.options.notFoundComponent,p=r.ssr===!1||r.ssr==="data-only",g=(!i.isRoot||i.options.wrapInSuspense||p)&&(i.options.wrapInSuspense??s??(i.options.errorComponent?.preload||p))?x.Suspense:pc,v=c?XS:pc,y=h?Hq:pc;return u.jsxs(i.isRoot?i.options.shellComponent??pc:pc,{children:[u.jsx(jg.Provider,{value:t,children:u.jsx(g,{fallback:l,children:u.jsx(v,{getResetKey:()=>r.resetKey,errorComponent:c||JS,onCatch:(w,S)=>{if(nr(w))throw w;f?.(w,S)},children:u.jsx(y,{fallback:w=>{if(!h||w.routeId&&w.routeId!==r.routeId||!w.routeId&&!i.isRoot)throw w;return x.createElement(h,w)},children:p||r._displayPending?u.jsx(Sq,{fallback:l,children:u.jsx(nA,{matchId:t})}):u.jsx(nA,{matchId:t})})})})}),r.parentRouteId===Uo&&n.options.scrollRestoration?u.jsxs(u.Fragment,{children:[u.jsx(Zq,{}),u.jsx(Vq,{})]}):null]})});function Zq(){const e=oi(),t=x.useRef(void 0);return u.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...qo(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var nA=x.memo(function({matchId:t}){const n=oi(),{match:r,key:i,routeId:s}=br({select:f=>{const h=f.matches.find(v=>v.id===t),p=h.routeId,g=(n.routesById[p].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:p,loaderDeps:h.loaderDeps,params:h._strictParams,search:h._strictSearch});return{key:g?JSON.stringify(g):void 0,routeId:p,match:{id:h.id,status:h.status,error:h.error,_forcePending:h._forcePending,_displayPending:h._displayPending}}},structuralSharing:!0}),l=n.routesById[s],c=x.useMemo(()=>{const f=l.options.component??n.options.defaultComponent;return f?u.jsx(f,{},i):u.jsx(r1,{})},[i,l.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const f=l.options.pendingMinMs??n.options.defaultPendingMinMs;if(f){const h=n.getMatch(r.id);if(h&&!h._nonReactive.minPendingPromise){const p=Tc();h._nonReactive.minPendingPromise=p,setTimeout(()=>{p.resolve(),h._nonReactive.minPendingPromise=void 0},f)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return Ls(nr(r.error)),qM(n,l,r.error);if(r.status==="redirected")throw Ls(gr(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return c}),r1=x.memo(function(){const t=oi(),n=x.useContext(jg),r=br({select:h=>h.matches.find(p=>p.id===n)?.routeId}),i=t.routesById[r],s=br({select:h=>{const p=h.matches.find(g=>g.id===n);return Ls(p),p.globalNotFound}}),l=br({select:h=>{const p=h.matches;return p[p.findIndex(g=>g.id===n)+1]?.id}}),c=t.options.defaultPendingComponent?u.jsx(t.options.defaultPendingComponent,{}):null;if(s)return qM(t,i,void 0);if(!l)return null;const f=u.jsx(FM,{matchId:l});return r===Uo?u.jsx(x.Suspense,{fallback:c,children:f}):f});function Yq(){const e=oi(),t=x.useRef({router:e,mounted:!1}),[n,r]=x.useState(!1),{hasPendingMatches:i,isLoading:s}=br({select:g=>({isLoading:g.isLoading,hasPendingMatches:g.matches.some(v=>v.status==="pending")}),structuralSharing:!0}),l=eb(s),c=s||n||i,f=eb(c),h=s||i,p=eb(h);return e.startTransition=g=>{r(!0),x.startTransition(()=>{g(),r(!1)})},x.useEffect(()=>{const g=e.history.subscribe(e.load),v=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ps(e.latestLocation.publicHref)!==Ps(v.publicHref)&&e.commitLocation({...v,replace:!0}),()=>{g()}},[e,e.history]),Xh(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(v){console.error(v)}})()},[e]),Xh(()=>{l&&!s&&e.emit({type:"onLoad",...qo(e.state)})},[l,e,s]),Xh(()=>{p&&!h&&e.emit({type:"onBeforeRouteMount",...qo(e.state)})},[h,p,e]),Xh(()=>{if(f&&!c){const g=qo(e.state);e.emit({type:"onResolved",...g}),e.__store.setState(v=>({...v,status:"idle",resolvedLocation:v.location})),g.hrefChanged&&P8(e)}},[c,f,e]),null}function Wq(){const e=oi(),t=e.routesById[Uo].options.pendingComponent??e.options.defaultPendingComponent,n=t?u.jsx(t,{}):null,r=u.jsxs(typeof document<"u"&&e.ssr?pc:x.Suspense,{fallback:n,children:[u.jsx(Yq,{}),u.jsx(Qq,{})]});return e.options.InnerWrap?u.jsx(e.options.InnerWrap,{children:r}):r}function Qq(){const e=oi(),t=br({select:i=>i.matches[0]?.id}),n=br({select:i=>i.loadedAt}),r=t?u.jsx(FM,{matchId:t}):null;return u.jsx(jg.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:u.jsx(XS,{getResetKey:()=>n,errorComponent:JS,onCatch:void 0,children:r})})}var Xq=e=>new Jq(e),Jq=class extends fq{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=Xk,globalThis.createLazyFileRoute=tA):typeof window<"u"&&(window.createFileRoute=Xk,window.createLazyFileRoute=tA);function e9({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=u.jsx(UM.Provider,{value:e,children:t});return e.options.Wrap?u.jsx(e.options.Wrap,{children:r}):r}function t9({router:e,...t}){return u.jsx(e9,{router:e,...t,children:u.jsx(Wq,{})})}function n9(e){return br({select:t=>t.location})}class cm extends Error{code;statusCode;constructor(t,n,r){super(t),this.name="ApiError",this.code=r??"UNKNOWN",this.statusCode=n}}function r9(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const i9=r9();function a9(){return""}function rA(){return!!a9()}async function je(e,t){const n=await fetch(`${i9}${e}`,{...t,credentials:t?.credentials??"same-origin",headers:{"Content-Type":"application/json",...t?.headers}});if(!n.ok){const r=await n.text();let i=`API ${n.status}: ${n.statusText}`,s;if(r)try{const l=JSON.parse(r);typeof l.error=="string"?i=l.error:l.error?.message?(i=l.error.message,s=l.error.code):l.message&&(i=l.message)}catch{i=r}throw new cm(i,n.status,s)}if(n.status!==204)return n.json()}function KM(){return je("/projects")}function HM(e){return je(`/projects/${encodeURIComponent(e)}`)}function GM(){return je("/runs")}function Pc(e){return je(`/runs/${encodeURIComponent(e)}`)}function s9(e){return je(`/projects/${encodeURIComponent(e)}/keywords`)}function VM(e){return je(`/projects/${encodeURIComponent(e)}/competitors`)}function ZM(e,t){const n=new URLSearchParams;t!==void 0&&n.set("location",t);const r=n.toString();return je(`/projects/${encodeURIComponent(e)}/timeline${r?`?${r}`:""}`)}function Og(e,t){return je(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function o9(e,t){return je(`/projects/${encodeURIComponent(e)}/keywords`,{method:"PUT",body:JSON.stringify({keywords:t})})}function l9(e,t){return je(`/projects/${encodeURIComponent(e)}/keywords`,{method:"POST",body:JSON.stringify({keywords:t})})}function YM(e,t){return je(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function iA(e,t){const n=await HM(e);return Og(e,{displayName:n.displayName,canonicalDomain:n.canonicalDomain,ownedDomains:t,country:n.country,language:n.language,tags:n.tags,labels:n.labels,providers:n.providers,locations:n.locations,defaultLocation:n.defaultLocation})}async function c9(e,t){const n=await HM(e);return Og(e,{displayName:t.displayName??n.displayName,canonicalDomain:t.canonicalDomain??n.canonicalDomain,ownedDomains:t.ownedDomains??n.ownedDomains,country:t.country??n.country,language:t.language??n.language,tags:n.tags,labels:n.labels,providers:n.providers,locations:t.locations??n.locations,defaultLocation:t.defaultLocation!==void 0?t.defaultLocation:n.defaultLocation})}function u9(e,t){const n={};return t?.location&&(n.location=t.location),t?.allLocations&&(n.allLocations=!0),t?.noLocation&&(n.noLocation=!0),je(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(n)})}function d9(e,t){return je(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function f9(e,t){await je(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function h9(e,t){return je(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function p9(e){await je(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function m9(e){return je(`/projects/${encodeURIComponent(e)}/export`)}function i1(){return je("/settings")}function g9(){return je("/session")}function v9(e){return je("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function y9(e){return je("/session",{method:"POST",body:JSON.stringify({password:e})})}function b9(e,t){return je(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function x9(e){return je("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function w9(e){try{return await je(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof Error&&t.message.includes("404"))return null;throw t}}function aA(e,t){return je(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function S9(e){await je(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function j9(e){return je(`/projects/${encodeURIComponent(e)}/notifications`)}function N9(e,t){return je(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function C9(e,t){await je(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function O9(e,t){return je(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function _9(e,t,n){return je(`/projects/${encodeURIComponent(e)}/keywords/generate`,{method:"POST",body:JSON.stringify({provider:t,count:n})})}function k9(e){return je("/apply",{method:"POST",body:JSON.stringify(e)})}function A9(e){return je("/runs",{method:"POST",body:JSON.stringify(e??{})})}function WM(e){return je(`/projects/${encodeURIComponent(e)}/google/connections`)}function E9(e,t){return je(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function T9(e,t){return je(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function P9(e){return je(`/projects/${encodeURIComponent(e)}/google/properties`)}function z9(e,t,n){return je(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:n})})}function M9(e,t,n){return je(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:n})})}function QM(e,t){return je(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function R9(e,t){const n=new URLSearchParams;t?.startDate&&n.set("startDate",t.startDate),t?.endDate&&n.set("endDate",t.endDate),t?.query&&n.set("query",t.query),t?.page&&n.set("page",t.page),t?.limit!==void 0&&n.set("limit",String(t.limit));const r=n.toString()?`?${n.toString()}`:"";return je(`/projects/${encodeURIComponent(e)}/google/gsc/performance${r}`)}function D9(e,t){return je(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function I9(e,t){const n=new URLSearchParams;t?.url&&n.set("url",t.url),n.set("limit",String(t.limit));const r=n.toString()?`?${n.toString()}`:"";return je(`/projects/${encodeURIComponent(e)}/google/gsc/inspections${r}`)}function L9(e){return je(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function a1(e){return je(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function $9(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return je(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${r}`)}function U9(e,t){return je(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function B9(e){return je(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function q9(e){return je(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function sA(){return je("/cdp/status")}function F9(e,t){return je("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function oA(e,t){return je(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function XM(e){return je(`/projects/${encodeURIComponent(e)}/bing/status`)}function K9(e,t){return je(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function H9(e){return je(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function G9(e){return je(`/projects/${encodeURIComponent(e)}/bing/sites`)}function V9(e,t){return je(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function s1(e){return je(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function JM(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return je(`/projects/${encodeURIComponent(e)}/bing/inspections${r}`)}function eR(e,t){return je(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function lA(e,t){return je(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function Z9(e){return je(`/projects/${encodeURIComponent(e)}/bing/performance`)}function Y9(e){return je("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function W9(e,t){const n=t?`?window=${t}`:"";return je(`/projects/${encodeURIComponent(e)}/analytics/metrics${n}`)}function Q9(e,t){const n=t?`?window=${t}`:"";return je(`/projects/${encodeURIComponent(e)}/analytics/gaps${n}`)}function X9(e,t){const n=t?`?window=${t}`:"";return je(`/projects/${encodeURIComponent(e)}/analytics/sources${n}`)}function cA(e){return je(`/projects/${encodeURIComponent(e)}/ga/status`)}function uA(e,t){return je(`/projects/${encodeURIComponent(e)}/ga/traffic`)}function tR(e,t){return je(`/projects/${encodeURIComponent(e)}/ga/sync`,{method:"POST",body:JSON.stringify({})})}function J9(e,t){return je(`/projects/${encodeURIComponent(e)}/ga/connect`,{method:"POST",body:JSON.stringify(t)})}function dA(e){return je(`/projects/${encodeURIComponent(e)}/ga/ai-referral-history`)}function fA(e){return je(`/projects/${encodeURIComponent(e)}/ga/session-history`)}function eF(e){return je(`/projects/${encodeURIComponent(e)}/ga/disconnect`,{method:"DELETE",body:"{}"})}function tF(e,t){const n=t?`?runId=${encodeURIComponent(t)}`:"";return je(`/projects/${encodeURIComponent(e)}/insights${n}`)}async function nF(e,t){try{const n=await fetch(e);if(!n.ok)return{label:t,state:"error",detail:`HTTP ${n.status}`};const r=await n.json(),i=typeof r.version=="string"?r.version:"unknown",s=typeof r.databaseUrlConfigured=="boolean"?r.databaseUrlConfigured:void 0,l=typeof r.lastHeartbeatAt=="string"?r.lastHeartbeatAt:void 0,c=[i,s===!1?"database not configured":"database configured",l?`heartbeat ${l}`:void 0].filter(Boolean).join(" · ");return{label:t,state:"ok",detail:c,version:i,databaseConfigured:s,lastHeartbeatAt:l}}catch(n){return{label:t,state:"error",detail:n instanceof Error?n.message:"unreachable"}}}const rF=6e3,iF=5,aF=180;let Hn=[],sF=0;const vw=new Set,yw=new Map,bw=new Map;function um(){const e=[...Hn];for(const t of vw)t(e)}function o1(e){const t=yw.get(e);t&&(clearTimeout(t),yw.delete(e));const n=bw.get(e);n&&(clearTimeout(n),bw.delete(e))}function nR(e){o1(e);const t=Hn.length;Hn=Hn.filter(n=>n.id!==e),Hn.length!==t&&um()}function hA(e){o1(e.id),yw.set(e.id,setTimeout(()=>{xw(e.id)},e.durationMs))}function oF(e,t,n){return typeof e=="string"?{title:e,tone:t,durationMs:n}:e}function Qe(e,t="negative",n=rF){const r=oF(e,t,n),i={id:String(++sF),title:r.title,detail:r.detail,tone:r.tone??t,durationMs:r.durationMs??n,dedupeKey:r.dedupeKey,cta:r.cta,state:"open"};if(r.dedupeKey){const s=Hn.find(l=>l.dedupeKey===r.dedupeKey);if(s){if((r.dedupeMode??"drop")==="drop")return s.id;const l={...s,title:i.title,detail:i.detail,tone:i.tone,durationMs:i.durationMs,cta:i.cta,state:"open"};return Hn=Hn.map(c=>c.id===s.id?l:c),um(),hA(l),s.id}}return Hn.length>=iF&&nR(Hn[0].id),Hn=[...Hn,i],um(),hA(i),i.id}function xw(e){const t=Hn.find(n=>n.id===e);!t||t.state==="closing"||(o1(e),Hn=Hn.map(n=>n.id===e?{...n,state:"closing"}:n),um(),bw.set(e,setTimeout(()=>{nR(e)},aF)))}function lF(e){return vw.add(e),()=>{vw.delete(e)}}function pA(){return Hn}function cF(){return new YB({defaultOptions:{queries:{staleTime:3e4,retry:1,refetchOnWindowFocus:!1}},mutationCache:new mM({onError:(e,t,n,r)=>{r.meta?.skipGlobalErrorToast||Qe({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const uF=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),dF=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),mA=e=>{const t=dF(e);return t.charAt(0).toUpperCase()+t.slice(1)},rR=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),fF=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var hF={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"};const pF=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:l,...c},f)=>x.createElement("svg",{ref:f,...hF,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:rR("lucide",i),...!s&&!fF(c)&&{"aria-hidden":"true"},...c},[...l.map(([h,p])=>x.createElement(h,p)),...Array.isArray(s)?s:[s]]));const $n=(e,t)=>{const n=x.forwardRef(({className:r,...i},s)=>x.createElement(pF,{ref:s,iconNode:t,className:rR(`lucide-${uF(mA(e))}`,`lucide-${e}`,r),...i}));return n.displayName=mA(e),n};const mF=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],_g=$n("chevron-right",mF);const gF=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],vF=$n("download",gF);const yF=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],bF=$n("github",yF);const xF=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],wF=$n("globe",xF);const SF=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],jF=$n("layout-dashboard",SF);const NF=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],CF=$n("menu",NF);const OF=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],_F=$n("play",OF);const kF=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],gA=$n("plus",kF);const AF=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],vA=$n("refresh-cw",AF);const EF=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],TF=$n("rocket",EF);const PF=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],zF=$n("rotate-ccw",PF);const MF=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],RF=$n("settings",MF);const DF=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],IF=$n("trash-2",DF);const LF=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],$F=$n("triangle-alert",LF);const UF=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],BF=$n("unplug",UF);const qF=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],FF=$n("upload",qF);const KF=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],kg=$n("x",KF);var As=(e=>(e.Clicks="clicks",e.Impressions="impressions",e.CTR="ctr",e.Position="position",e))(As||{});const HF={clicks:"Clicks",impressions:"Impressions",ctr:"CTR",position:"Position"},tp={clicks:"Clicks",impressions:"Impr",ctr:"CTR",position:"Pos"};function GF(e){const t=e.match(/^(\[.*?\])\s*(.+)/);if(t){const n=t[1],r=t[2],i=r.indexOf("{");if(i>=0){const s=r.slice(0,i).trim(),l=r.slice(i);try{const c=JSON.parse(l);return`${n} ${s}
10
-
11
- ${JSON.stringify(c,null,2)}`}catch{}}return`${n}
12
- ${r}`}try{const n=JSON.parse(e);return JSON.stringify(n,null,2)}catch{return e}}function Ag(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function yi(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function yA(e){return e===null?"Unknown":e?"Pass":"Fail"}function ww(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function VF(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function ZF(e,t){if(!e)return{freq:"custom",hour:6,customCron:t};if(e==="twice-daily")return{freq:"twice-daily",hour:6,customCron:""};const n=e.match(/^daily(?:@(\d+))?$/);if(n)return{freq:"daily",hour:n[1]?parseInt(n[1]):6,customCron:""};const r=e.match(/^(weekly@(?:mon|tue|wed|thu|fri|sat|sun))(?:@(\d+))?$/);return r?{freq:r[1],hour:r[2]?parseInt(r[2]):6,customCron:""}:{freq:"custom",hour:6,customCron:t}}function db(e,t,n){const r=n==="UTC"?"UTC":n.split("/").pop()?.replace(/_/g," ")??n;if(!e)return`Custom: ${t} · ${r}`;if(e==="twice-daily")return`Twice a day (6am & 6pm) · ${r}`;const i=e.match(/^daily(?:@(\d+))?$/);if(i){const l=i[1]?parseInt(i[1]):6;return`Every day at ${ww(l)} · ${r}`}const s=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(s){const l={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},c=s[2]?parseInt(s[2]):6;return`Every ${l[s[1]]} at ${ww(c)} · ${r}`}return`${e} · ${r}`}const iR="canonry.run-tracker",Sw=new Set;let bA=!1,YF=0,Eg={runs:{},batches:{}};function WF(){const e=Yo();for(const t of Sw)t(e)}function QF(e){if(!e)return{runs:{},batches:{}};try{const t=JSON.parse(e);return{runs:t.runs??{},batches:t.batches??{}}}catch{return{runs:{},batches:{}}}}function XF(){typeof window>"u"||window.sessionStorage.setItem(iR,JSON.stringify(Eg))}function aR(){bA||(bA=!0,!(typeof window>"u")&&(Eg=QF(window.sessionStorage.getItem(iR))))}function Tg(e){Eg=e,XF(),WF()}function Yo(){return aR(),Eg}function JF(e){return aR(),Sw.add(e),()=>{Sw.delete(e)}}function sR(e){const t=Yo();Tg({...t,runs:{...t.runs,[e.id]:{runId:e.id,projectId:e.projectId,projectLabel:e.projectLabel,kind:e.kind,sourceAction:e.sourceAction,lastAnnouncedStatus:e.lastAnnouncedStatus??"queued"}}})}function xA(e){const t=Yo();if(!t.runs[e])return;const{[e]:n,...r}=t.runs;Tg({...t,runs:r})}function eK(e){const t=Yo(),n=`batch_${Date.now()}_${++YF}`;return Tg({...t,batches:{...t.batches,[n]:{batchId:n,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),n}function tK(e){const t=Yo();if(!t.batches[e])return;const{[e]:n,...r}=t.batches;Tg({...t,batches:r})}function nK(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}function rK(e,t){let n=0,r=0,i=0,s=0,l=0;for(const c of e){const f=t[c]?.status;f==="completed"?n+=1:f==="partial"?r+=1:f==="failed"?i+=1:f==="cancelled"?s+=1:l+=1}return{completed:n,partial:r,failed:i,cancelled:s,pending:l,finished:l===0}}function wA(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function l1(...e){return t=>{let n=!1;const r=e.map(i=>{const s=wA(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():wA(e[i],null)}}}}function ll(...e){return x.useCallback(l1(...e),e)}var iK=Symbol.for("react.lazy"),dm=bg[" use ".trim().toString()];function aK(e){return typeof e=="object"&&e!==null&&"then"in e}function oR(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===iK&&"_payload"in e&&aK(e._payload)}function sK(e){const t=lK(e),n=x.forwardRef((r,i)=>{let{children:s,...l}=r;oR(s)&&typeof dm=="function"&&(s=dm(s._payload));const c=x.Children.toArray(s),f=c.find(uK);if(f){const h=f.props.children,p=c.map(g=>g===f?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:g);return u.jsx(t,{...l,ref:i,children:x.isValidElement(h)?x.cloneElement(h,void 0,p):null})}return u.jsx(t,{...l,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}var oK=sK("Slot");function lK(e){const t=x.forwardRef((n,r)=>{let{children:i,...s}=n;if(oR(i)&&typeof dm=="function"&&(i=dm(i._payload)),x.isValidElement(i)){const l=fK(i),c=dK(s,i.props);return i.type!==x.Fragment&&(c.ref=r?l1(r,l):l),x.cloneElement(i,c)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var cK=Symbol("radix.slottable");function uK(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cK}function dK(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...c)=>{const f=s(...c);return i(...c),f}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function fK(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function lR(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=lR(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ft(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=lR(e))&&(r&&(r+=" "),r+=t);return r}const SA=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,jA=ft,cR=(e,t)=>n=>{var r;if(t?.variants==null)return jA(e,n?.class,n?.className);const{variants:i,defaultVariants:s}=t,l=Object.keys(i).map(h=>{const p=n?.[h],g=s?.[h];if(p===null)return null;const v=SA(p)||SA(g);return i[h][v]}),c=n&&Object.entries(n).reduce((h,p)=>{let[g,v]=p;return v===void 0||(h[g]=v),h},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((h,p)=>{let{class:g,className:v,...y}=p;return Object.entries(y).every(w=>{let[S,N]=w;return Array.isArray(N)?N.includes({...s,...c}[S]):{...s,...c}[S]===N})?[...h,g,v]:h},[]);return jA(e,l,f,n?.class,n?.className)},hK=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},pK=(e,t)=>({classGroupId:e,validator:t}),uR=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),fm="-",NA=[],mK="arbitrary..",gK=e=>{const t=yK(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return vK(l);const c=l.split(fm),f=c[0]===""&&c.length>1?1:0;return dR(c,f,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const f=r[l],h=n[l];return f?h?hK(h,f):f:h||NA}return n[l]||NA}}},dR=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],s=n.nextPart.get(i);if(s){const h=dR(e,t+1,s);if(h)return h}const l=n.validators;if(l===null)return;const c=t===0?e.join(fm):e.slice(t).join(fm),f=l.length;for(let h=0;h<f;h++){const p=l[h];if(p.validator(c))return p.classGroupId}},vK=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?mK+r:void 0})(),yK=e=>{const{theme:t,classGroups:n}=e;return bK(n,t)},bK=(e,t)=>{const n=uR();for(const r in e){const i=e[r];c1(i,n,r,t)}return n},c1=(e,t,n,r)=>{const i=e.length;for(let s=0;s<i;s++){const l=e[s];xK(l,t,n,r)}},xK=(e,t,n,r)=>{if(typeof e=="string"){wK(e,t,n);return}if(typeof e=="function"){SK(e,t,n,r);return}jK(e,t,n,r)},wK=(e,t,n)=>{const r=e===""?t:fR(t,e);r.classGroupId=n},SK=(e,t,n,r)=>{if(NK(e)){c1(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(pK(n,e))},jK=(e,t,n,r)=>{const i=Object.entries(e),s=i.length;for(let l=0;l<s;l++){const[c,f]=i[l];c1(f,fR(t,c),n,r)}},fR=(e,t)=>{let n=e;const r=t.split(fm),i=r.length;for(let s=0;s<i;s++){const l=r[s];let c=n.nextPart.get(l);c||(c=uR(),n.nextPart.set(l,c)),n=c}return n},NK=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,CK=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(s,l)=>{n[s]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let l=n[s];if(l!==void 0)return l;if((l=r[s])!==void 0)return i(s,l),l},set(s,l){s in n?n[s]=l:i(s,l)}}},jw="!",CA=":",OK=[],OA=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),_K=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const s=[];let l=0,c=0,f=0,h;const p=i.length;for(let S=0;S<p;S++){const N=i[S];if(l===0&&c===0){if(N===CA){s.push(i.slice(f,S)),f=S+1;continue}if(N==="/"){h=S;continue}}N==="["?l++:N==="]"?l--:N==="("?c++:N===")"&&c--}const g=s.length===0?i:i.slice(f);let v=g,y=!1;g.endsWith(jw)?(v=g.slice(0,-1),y=!0):g.startsWith(jw)&&(v=g.slice(1),y=!0);const w=h&&h>f?h-f:void 0;return OA(s,y,v,w)};if(t){const i=t+CA,s=r;r=l=>l.startsWith(i)?s(l.slice(i.length)):OA(OK,!1,l,void 0,!0)}if(n){const i=r;r=s=>n({className:s,parseClassName:i})}return r},kK=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let s=0;s<n.length;s++){const l=n[s],c=l[0]==="[",f=t.has(l);c||f?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(l)):i.push(l)}return i.length>0&&(i.sort(),r.push(...i)),r}},AK=e=>({cache:CK(e.cacheSize),parseClassName:_K(e),sortModifiers:kK(e),...gK(e)}),EK=/\s+/,TK=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:s}=t,l=[],c=e.trim().split(EK);let f="";for(let h=c.length-1;h>=0;h-=1){const p=c[h],{isExternal:g,modifiers:v,hasImportantModifier:y,baseClassName:w,maybePostfixModifierPosition:S}=n(p);if(g){f=p+(f.length>0?" "+f:f);continue}let N=!!S,C=r(N?w.substring(0,S):w);if(!C){if(!N){f=p+(f.length>0?" "+f:f);continue}if(C=r(w),!C){f=p+(f.length>0?" "+f:f);continue}N=!1}const E=v.length===0?"":v.length===1?v[0]:s(v).join(":"),k=y?E+jw:E,O=k+C;if(l.indexOf(O)>-1)continue;l.push(O);const T=i(C,N);for(let P=0;P<T.length;++P){const A=T[P];l.push(k+A)}f=p+(f.length>0?" "+f:f)}return f},PK=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=hR(n))&&(i&&(i+=" "),i+=r);return i},hR=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=hR(e[r]))&&(n&&(n+=" "),n+=t);return n},zK=(e,...t)=>{let n,r,i,s;const l=f=>{const h=t.reduce((p,g)=>g(p),e());return n=AK(h),r=n.cache.get,i=n.cache.set,s=c,c(f)},c=f=>{const h=r(f);if(h)return h;const p=TK(f,n);return i(f,p),p};return s=l,(...f)=>s(PK(...f))},MK=[],vn=e=>{const t=n=>n[e]||MK;return t.isThemeGetter=!0,t},pR=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,mR=/^\((?:(\w[\w-]*):)?(.+)\)$/i,RK=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,DK=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,IK=/\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$/,LK=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$K=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,UK=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,vs=e=>RK.test(e),Ze=e=>!!e&&!Number.isNaN(Number(e)),ys=e=>!!e&&Number.isInteger(Number(e)),fb=e=>e.endsWith("%")&&Ze(e.slice(0,-1)),ja=e=>DK.test(e),gR=()=>!0,BK=e=>IK.test(e)&&!LK.test(e),u1=()=>!1,qK=e=>$K.test(e),FK=e=>UK.test(e),KK=e=>!Ee(e)&&!Te(e),HK=e=>Gs(e,bR,u1),Ee=e=>pR.test(e),bo=e=>Gs(e,xR,BK),_A=e=>Gs(e,JK,Ze),GK=e=>Gs(e,SR,gR),VK=e=>Gs(e,wR,u1),kA=e=>Gs(e,vR,u1),ZK=e=>Gs(e,yR,FK),np=e=>Gs(e,jR,qK),Te=e=>mR.test(e),od=e=>cl(e,xR),YK=e=>cl(e,wR),AA=e=>cl(e,vR),WK=e=>cl(e,bR),QK=e=>cl(e,yR),rp=e=>cl(e,jR,!0),XK=e=>cl(e,SR,!0),Gs=(e,t,n)=>{const r=pR.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},cl=(e,t,n=!1)=>{const r=mR.exec(e);return r?r[1]?t(r[1]):n:!1},vR=e=>e==="position"||e==="percentage",yR=e=>e==="image"||e==="url",bR=e=>e==="length"||e==="size"||e==="bg-size",xR=e=>e==="length",JK=e=>e==="number",wR=e=>e==="family-name",SR=e=>e==="number"||e==="weight",jR=e=>e==="shadow",eH=()=>{const e=vn("color"),t=vn("font"),n=vn("text"),r=vn("font-weight"),i=vn("tracking"),s=vn("leading"),l=vn("breakpoint"),c=vn("container"),f=vn("spacing"),h=vn("radius"),p=vn("shadow"),g=vn("inset-shadow"),v=vn("text-shadow"),y=vn("drop-shadow"),w=vn("blur"),S=vn("perspective"),N=vn("aspect"),C=vn("ease"),E=vn("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...O(),Te,Ee],P=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],z=()=>[Te,Ee,f],R=()=>[vs,"full","auto",...z()],q=()=>[ys,"none","subgrid",Te,Ee],U=()=>["auto",{span:["full",ys,Te,Ee]},ys,Te,Ee],L=()=>[ys,"auto",Te,Ee],ae=()=>["auto","min","max","fr",Te,Ee],pe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ge=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...z()],re=()=>[vs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...z()],ve=()=>[vs,"screen","full","dvw","lvw","svw","min","max","fit",...z()],we=()=>[vs,"screen","full","lh","dvh","lvh","svh","min","max","fit",...z()],B=()=>[e,Te,Ee],D=()=>[...O(),AA,kA,{position:[Te,Ee]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],oe=()=>["auto","cover","contain",WK,HK,{size:[Te,Ee]}],W=()=>[fb,od,bo],X=()=>["","none","full",h,Te,Ee],Q=()=>["",Ze,od,bo],de=()=>["solid","dashed","dotted","double"],ye=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>[Ze,fb,AA,kA],le=()=>["","none",w,Te,Ee],Se=()=>["none",Ze,Te,Ee],F=()=>["none",Ze,Te,Ee],Ae=()=>[Ze,Te,Ee],Oe=()=>[vs,"full",...z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ja],breakpoint:[ja],color:[gR],container:[ja],"drop-shadow":[ja],ease:["in","out","in-out"],font:[KK],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ja],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ja],shadow:[ja],spacing:["px",Ze],text:[ja],"text-shadow":[ja],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",vs,Ee,Te,N]}],container:["container"],columns:[{columns:[Ze,Ee,Te,c]}],"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:T()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{"inset-s":R(),start:R()}],end:[{"inset-e":R(),end:R()}],"inset-bs":[{"inset-bs":R()}],"inset-be":[{"inset-be":R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[ys,"auto",Te,Ee]}],basis:[{basis:[vs,"full","auto",c,...z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ze,vs,"auto","initial","none",Ee]}],grow:[{grow:["",Ze,Te,Ee]}],shrink:[{shrink:["",Ze,Te,Ee]}],order:[{order:[ys,"first","last","none",Te,Ee]}],"grid-cols":[{"grid-cols":q()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":q()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ae()}],"auto-rows":[{"auto-rows":ae()}],gap:[{gap:z()}],"gap-x":[{"gap-x":z()}],"gap-y":[{"gap-y":z()}],"justify-content":[{justify:[...pe(),"normal"]}],"justify-items":[{"justify-items":[...ge(),"normal"]}],"justify-self":[{"justify-self":["auto",...ge()]}],"align-content":[{content:["normal",...pe()]}],"align-items":[{items:[...ge(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ge(),{baseline:["","last"]}]}],"place-content":[{"place-content":pe()}],"place-items":[{"place-items":[...ge(),"baseline"]}],"place-self":[{"place-self":["auto",...ge()]}],p:[{p:z()}],px:[{px:z()}],py:[{py:z()}],ps:[{ps:z()}],pe:[{pe:z()}],pbs:[{pbs:z()}],pbe:[{pbe:z()}],pt:[{pt:z()}],pr:[{pr:z()}],pb:[{pb:z()}],pl:[{pl:z()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mbs:[{mbs:V()}],mbe:[{mbe:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":z()}],"space-y-reverse":["space-y-reverse"],size:[{size:re()}],"inline-size":[{inline:["auto",...ve()]}],"min-inline-size":[{"min-inline":["auto",...ve()]}],"max-inline-size":[{"max-inline":["none",...ve()]}],"block-size":[{block:["auto",...we()]}],"min-block-size":[{"min-block":["auto",...we()]}],"max-block-size":[{"max-block":["none",...we()]}],w:[{w:[c,"screen",...re()]}],"min-w":[{"min-w":[c,"screen","none",...re()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...re()]}],h:[{h:["screen","lh",...re()]}],"min-h":[{"min-h":["screen","lh","none",...re()]}],"max-h":[{"max-h":["screen","lh",...re()]}],"font-size":[{text:["base",n,od,bo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,XK,GK]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",fb,Ee]}],"font-family":[{font:[YK,VK,t]}],"font-features":[{"font-features":[Ee]}],"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:[i,Te,Ee]}],"line-clamp":[{"line-clamp":[Ze,"none",Te,_A]}],leading:[{leading:[s,...z()]}],"list-image":[{"list-image":["none",Te,Ee]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Te,Ee]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ze,"from-font","auto",Te,bo]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[Ze,"auto",Te,Ee]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Te,Ee]}],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",Te,Ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ys,Te,Ee],radial:["",Te,Ee],conic:[ys,Te,Ee]},QK,ZK]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:X()}],"rounded-s":[{"rounded-s":X()}],"rounded-e":[{"rounded-e":X()}],"rounded-t":[{"rounded-t":X()}],"rounded-r":[{"rounded-r":X()}],"rounded-b":[{"rounded-b":X()}],"rounded-l":[{"rounded-l":X()}],"rounded-ss":[{"rounded-ss":X()}],"rounded-se":[{"rounded-se":X()}],"rounded-ee":[{"rounded-ee":X()}],"rounded-es":[{"rounded-es":X()}],"rounded-tl":[{"rounded-tl":X()}],"rounded-tr":[{"rounded-tr":X()}],"rounded-br":[{"rounded-br":X()}],"rounded-bl":[{"rounded-bl":X()}],"border-w":[{border:Q()}],"border-w-x":[{"border-x":Q()}],"border-w-y":[{"border-y":Q()}],"border-w-s":[{"border-s":Q()}],"border-w-e":[{"border-e":Q()}],"border-w-bs":[{"border-bs":Q()}],"border-w-be":[{"border-be":Q()}],"border-w-t":[{"border-t":Q()}],"border-w-r":[{"border-r":Q()}],"border-w-b":[{"border-b":Q()}],"border-w-l":[{"border-l":Q()}],"divide-x":[{"divide-x":Q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-bs":[{"border-bs":B()}],"border-color-be":[{"border-be":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ze,Te,Ee]}],"outline-w":[{outline:["",Ze,od,bo]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",p,rp,np]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",g,rp,np]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[Ze,bo]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":Q()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",v,rp,np]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[Ze,Te,Ee]}],"mix-blend":[{"mix-blend":[...ye(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ye()}],"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":[Ze]}],"mask-image-linear-from-pos":[{"mask-linear-from":Z()}],"mask-image-linear-to-pos":[{"mask-linear-to":Z()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":Z()}],"mask-image-t-to-pos":[{"mask-t-to":Z()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":Z()}],"mask-image-r-to-pos":[{"mask-r-to":Z()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":Z()}],"mask-image-b-to-pos":[{"mask-b-to":Z()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":Z()}],"mask-image-l-to-pos":[{"mask-l-to":Z()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":Z()}],"mask-image-x-to-pos":[{"mask-x-to":Z()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":Z()}],"mask-image-y-to-pos":[{"mask-y-to":Z()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[Te,Ee]}],"mask-image-radial-from-pos":[{"mask-radial-from":Z()}],"mask-image-radial-to-pos":[{"mask-radial-to":Z()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"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":O()}],"mask-image-conic-pos":[{"mask-conic":[Ze]}],"mask-image-conic-from-pos":[{"mask-conic-from":Z()}],"mask-image-conic-to-pos":[{"mask-conic-to":Z()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Te,Ee]}],filter:[{filter:["","none",Te,Ee]}],blur:[{blur:le()}],brightness:[{brightness:[Ze,Te,Ee]}],contrast:[{contrast:[Ze,Te,Ee]}],"drop-shadow":[{"drop-shadow":["","none",y,rp,np]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",Ze,Te,Ee]}],"hue-rotate":[{"hue-rotate":[Ze,Te,Ee]}],invert:[{invert:["",Ze,Te,Ee]}],saturate:[{saturate:[Ze,Te,Ee]}],sepia:[{sepia:["",Ze,Te,Ee]}],"backdrop-filter":[{"backdrop-filter":["","none",Te,Ee]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[Ze,Te,Ee]}],"backdrop-contrast":[{"backdrop-contrast":[Ze,Te,Ee]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ze,Te,Ee]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ze,Te,Ee]}],"backdrop-invert":[{"backdrop-invert":["",Ze,Te,Ee]}],"backdrop-opacity":[{"backdrop-opacity":[Ze,Te,Ee]}],"backdrop-saturate":[{"backdrop-saturate":[Ze,Te,Ee]}],"backdrop-sepia":[{"backdrop-sepia":["",Ze,Te,Ee]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":z()}],"border-spacing-x":[{"border-spacing-x":z()}],"border-spacing-y":[{"border-spacing-y":z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Te,Ee]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ze,"initial",Te,Ee]}],ease:[{ease:["linear","initial",C,Te,Ee]}],delay:[{delay:[Ze,Te,Ee]}],animate:[{animate:["none",E,Te,Ee]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Te,Ee]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:Se()}],"rotate-x":[{"rotate-x":Se()}],"rotate-y":[{"rotate-y":Se()}],"rotate-z":[{"rotate-z":Se()}],scale:[{scale:F()}],"scale-x":[{"scale-x":F()}],"scale-y":[{"scale-y":F()}],"scale-z":[{"scale-z":F()}],"scale-3d":["scale-3d"],skew:[{skew:Ae()}],"skew-x":[{"skew-x":Ae()}],"skew-y":[{"skew-y":Ae()}],transform:[{transform:[Te,Ee,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Oe()}],"translate-x":[{"translate-x":Oe()}],"translate-y":[{"translate-y":Oe()}],"translate-z":[{"translate-z":Oe()}],"translate-none":["translate-none"],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"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",Te,Ee]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mbs":[{"scroll-mbs":z()}],"scroll-mbe":[{"scroll-mbe":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pbs":[{"scroll-pbs":z()}],"scroll-pbe":[{"scroll-pbe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"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",Te,Ee]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[Ze,od,bo,_A]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},tH=zK(eH);function ci(...e){return tH(ft(e))}const nH=cR("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 focus-visible:ring-offset-2 focus-visible:ring-offset-black disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-zinc-50 text-black hover:bg-zinc-200",secondary:"border border-zinc-800 bg-zinc-950 text-zinc-100 hover:bg-zinc-900",ghost:"text-zinc-400 hover:bg-zinc-900 hover:text-zinc-50",outline:"border border-zinc-800 bg-transparent text-zinc-100 hover:bg-zinc-900",destructive:"bg-rose-600 text-white hover:bg-rose-700"},size:{default:"h-9 px-4",sm:"h-8 px-3 text-xs",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),me=x.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},s)=>{const l=r?oK:"button";return u.jsx(l,{ref:s,className:ci(nH({variant:t,size:n,className:e})),...i})});me.displayName="Button";const rH=cR("inline-flex items-center rounded-md border px-2 py-0.5 text-[11px] font-medium tracking-wide",{variants:{variant:{neutral:"border-zinc-800 bg-zinc-950 text-zinc-300",success:"border-emerald-500/25 bg-emerald-500/10 text-emerald-300",warning:"border-amber-500/25 bg-amber-500/10 text-amber-300",destructive:"border-rose-500/25 bg-rose-500/10 text-rose-300"}},defaultVariants:{variant:"neutral"}});function NR({className:e,variant:t,...n}){return u.jsx("div",{className:ci(rH({variant:t}),e),...n})}function EA({compact:e=!1}){return u.jsxs(Rt,{to:"/",className:`brand-lockup ${e?"brand-lockup-compact":""}`,"aria-label":"Canonry home",children:[u.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"}),u.jsxs("span",{className:"brand-copy",children:[u.jsx("span",{className:"brand-mark",children:"Canonry"}),e?null:u.jsx("span",{className:"brand-subtitle",children:"AEO Monitor"})]})]})}function Id({provider:e}){const t={gemini:"border-blue-800/50 bg-blue-950/40 text-blue-300",openai:"border-green-800/50 bg-green-950/40 text-green-300",claude:"border-amber-800/50 bg-amber-950/40 text-amber-300",perplexity:"border-teal-800/50 bg-teal-950/40 text-teal-300",local:"border-purple-800/50 bg-purple-950/40 text-purple-300"};return u.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide ${t[e]??"border-zinc-700 bg-zinc-800 text-zinc-300"}`,children:e})}function hm(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function CR(e){switch(e){case"completed":return"positive";case"partial":return"caution";case"failed":return"negative";case"cancelled":return"caution";case"queued":case"running":return"neutral";default:return"neutral"}}function iH(e){switch(e){case"cited":return"positive";case"emerging":return"caution";case"not-cited":return"caution";case"lost":return"negative";case"pending":return"neutral";default:return"neutral"}}function aH(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function mt({tone:e,children:t}){const n=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return u.jsx(NR,{variant:n,children:t})}function Pg({status:e}){return u.jsx(mt,{tone:CR(e),children:Ag(e)})}function Ms(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function sH(e,t){const n=x.createContext(t),r=s=>{const{children:l,...c}=s,f=x.useMemo(()=>c,Object.values(c));return u.jsx(n.Provider,{value:f,children:l})};r.displayName=e+"Provider";function i(s){const l=x.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,i]}function oH(e,t=[]){let n=[];function r(s,l){const c=x.createContext(l),f=n.length;n=[...n,l];const h=g=>{const{scope:v,children:y,...w}=g,S=v?.[e]?.[f]||c,N=x.useMemo(()=>w,Object.values(w));return u.jsx(S.Provider,{value:N,children:y})};h.displayName=s+"Provider";function p(g,v){const y=v?.[e]?.[f]||c,w=x.useContext(y);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${g}\` must be used within \`${s}\``)}return[h,p]}const i=()=>{const s=n.map(l=>x.createContext(l));return function(c){const f=c?.[e]||s;return x.useMemo(()=>({[`__scope${e}`]:{...c,[e]:f}}),[c,f])}};return i.scopeName=e,[r,lH(i,...t)]}function lH(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const l=r.reduce((c,{useScope:f,scopeName:h})=>{const g=f(s)[`__scope${h}`];return{...c,...g}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var Ld=globalThis?.document?x.useLayoutEffect:()=>{},cH=bg[" useId ".trim().toString()]||(()=>{}),uH=0;function hb(e){const[t,n]=x.useState(cH());return Ld(()=>{n(r=>r??String(uH++))},[e]),e||(t?`radix-${t}`:"")}var dH=bg[" useInsertionEffect ".trim().toString()]||Ld;function fH({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,s,l]=hH({defaultProp:t,onChange:n}),c=e!==void 0,f=c?e:i;{const p=x.useRef(e!==void 0);x.useEffect(()=>{const g=p.current;g!==c&&console.warn(`${r} is changing from ${g?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=c},[c,r])}const h=x.useCallback(p=>{if(c){const g=pH(p)?p(e):p;g!==e&&l.current?.(g)}else s(p)},[c,e,s,l]);return[f,h]}function hH({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),i=x.useRef(n),s=x.useRef(t);return dH(()=>{s.current=t},[t]),x.useEffect(()=>{i.current!==n&&(s.current?.(n),i.current=n)},[n,i]),[n,r,s]}function pH(e){return typeof e=="function"}function OR(e){const t=mH(e),n=x.forwardRef((r,i)=>{const{children:s,...l}=r,c=x.Children.toArray(s),f=c.find(vH);if(f){const h=f.props.children,p=c.map(g=>g===f?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:g);return u.jsx(t,{...l,ref:i,children:x.isValidElement(h)?x.cloneElement(h,void 0,p):null})}return u.jsx(t,{...l,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}function mH(e){const t=x.forwardRef((n,r)=>{const{children:i,...s}=n;if(x.isValidElement(i)){const l=bH(i),c=yH(s,i.props);return i.type!==x.Fragment&&(c.ref=r?l1(r,l):l),x.cloneElement(i,c)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var gH=Symbol("radix.slottable");function vH(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===gH}function yH(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...c)=>{const f=s(...c);return i(...c),f}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function bH(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var xH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ia=xH.reduce((e,t)=>{const n=OR(`Primitive.${t}`),r=x.forwardRef((i,s)=>{const{asChild:l,...c}=i,f=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(f,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function wH(e,t){e&&ol.flushSync(()=>e.dispatchEvent(t))}function $d(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>t.current?.(...n),[])}function SH(e,t=globalThis?.document){const n=$d(e);x.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var jH="DismissableLayer",Nw="dismissableLayer.update",NH="dismissableLayer.pointerDownOutside",CH="dismissableLayer.focusOutside",TA,_R=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),kR=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...f}=e,h=x.useContext(_R),[p,g]=x.useState(null),v=p?.ownerDocument??globalThis?.document,[,y]=x.useState({}),w=ll(t,A=>g(A)),S=Array.from(h.layers),[N]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=S.indexOf(N),E=p?S.indexOf(p):-1,k=h.layersWithOutsidePointerEventsDisabled.size>0,O=E>=C,T=kH(A=>{const z=A.target,R=[...h.branches].some(q=>q.contains(z));!O||R||(i?.(A),l?.(A),A.defaultPrevented||c?.())},v),P=AH(A=>{const z=A.target;[...h.branches].some(q=>q.contains(z))||(s?.(A),l?.(A),A.defaultPrevented||c?.())},v);return SH(A=>{E===h.layers.size-1&&(r?.(A),!A.defaultPrevented&&c&&(A.preventDefault(),c()))},v),x.useEffect(()=>{if(p)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(TA=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(p)),h.layers.add(p),PA(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=TA)}},[p,v,n,h]),x.useEffect(()=>()=>{p&&(h.layers.delete(p),h.layersWithOutsidePointerEventsDisabled.delete(p),PA())},[p,h]),x.useEffect(()=>{const A=()=>y({});return document.addEventListener(Nw,A),()=>document.removeEventListener(Nw,A)},[]),u.jsx(Ia.div,{...f,ref:w,style:{pointerEvents:k?O?"auto":"none":void 0,...e.style},onFocusCapture:Ms(e.onFocusCapture,P.onFocusCapture),onBlurCapture:Ms(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:Ms(e.onPointerDownCapture,T.onPointerDownCapture)})});kR.displayName=jH;var OH="DismissableLayerBranch",_H=x.forwardRef((e,t)=>{const n=x.useContext(_R),r=x.useRef(null),i=ll(t,r);return x.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),u.jsx(Ia.div,{...e,ref:i})});_H.displayName=OH;function kH(e,t=globalThis?.document){const n=$d(e),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const s=c=>{if(c.target&&!r.current){let f=function(){AR(NH,n,h,{discrete:!0})};const h={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=f,t.addEventListener("click",i.current,{once:!0})):f()}else t.removeEventListener("click",i.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function AH(e,t=globalThis?.document){const n=$d(e),r=x.useRef(!1);return x.useEffect(()=>{const i=s=>{s.target&&!r.current&&AR(CH,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function PA(){const e=new CustomEvent(Nw);document.dispatchEvent(e)}function AR(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?wH(i,s):i.dispatchEvent(s)}var pb="focusScope.autoFocusOnMount",mb="focusScope.autoFocusOnUnmount",zA={bubbles:!1,cancelable:!0},EH="FocusScope",ER=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...l}=e,[c,f]=x.useState(null),h=$d(i),p=$d(s),g=x.useRef(null),v=ll(t,S=>f(S)),y=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let S=function(k){if(y.paused||!c)return;const O=k.target;c.contains(O)?g.current=O:ws(g.current,{select:!0})},N=function(k){if(y.paused||!c)return;const O=k.relatedTarget;O!==null&&(c.contains(O)||ws(g.current,{select:!0}))},C=function(k){if(document.activeElement===document.body)for(const T of k)T.removedNodes.length>0&&ws(c)};document.addEventListener("focusin",S),document.addEventListener("focusout",N);const E=new MutationObserver(C);return c&&E.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",N),E.disconnect()}}},[r,c,y.paused]),x.useEffect(()=>{if(c){RA.add(y);const S=document.activeElement;if(!c.contains(S)){const C=new CustomEvent(pb,zA);c.addEventListener(pb,h),c.dispatchEvent(C),C.defaultPrevented||(TH(DH(TR(c)),{select:!0}),document.activeElement===S&&ws(c))}return()=>{c.removeEventListener(pb,h),setTimeout(()=>{const C=new CustomEvent(mb,zA);c.addEventListener(mb,p),c.dispatchEvent(C),C.defaultPrevented||ws(S??document.body,{select:!0}),c.removeEventListener(mb,p),RA.remove(y)},0)}}},[c,h,p,y]);const w=x.useCallback(S=>{if(!n&&!r||y.paused)return;const N=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,C=document.activeElement;if(N&&C){const E=S.currentTarget,[k,O]=PH(E);k&&O?!S.shiftKey&&C===O?(S.preventDefault(),n&&ws(k,{select:!0})):S.shiftKey&&C===k&&(S.preventDefault(),n&&ws(O,{select:!0})):C===E&&S.preventDefault()}},[n,r,y.paused]);return u.jsx(Ia.div,{tabIndex:-1,...l,ref:v,onKeyDown:w})});ER.displayName=EH;function TH(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ws(r,{select:t}),document.activeElement!==n)return}function PH(e){const t=TR(e),n=MA(t,e),r=MA(t.reverse(),e);return[n,r]}function TR(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function MA(e,t){for(const n of e)if(!zH(n,{upTo:t}))return n}function zH(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function MH(e){return e instanceof HTMLInputElement&&"select"in e}function ws(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&MH(e)&&t&&e.select()}}var RA=RH();function RH(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=DA(e,t),e.unshift(t)},remove(t){e=DA(e,t),e[0]?.resume()}}}function DA(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function DH(e){return e.filter(t=>t.tagName!=="A")}var IH="Portal",PR=x.forwardRef((e,t)=>{const{container:n,...r}=e,[i,s]=x.useState(!1);Ld(()=>s(!0),[]);const l=n||i&&globalThis?.document?.body;return l?Tq.createPortal(u.jsx(Ia.div,{...r,ref:t}),l):null});PR.displayName=IH;function LH(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var zg=e=>{const{present:t,children:n}=e,r=$H(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),s=ll(r.ref,UH(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:s}):null};zg.displayName="Presence";function $H(e){const[t,n]=x.useState(),r=x.useRef(null),i=x.useRef(e),s=x.useRef("none"),l=e?"mounted":"unmounted",[c,f]=LH(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const h=ip(r.current);s.current=c==="mounted"?h:"none"},[c]),Ld(()=>{const h=r.current,p=i.current;if(p!==e){const v=s.current,y=ip(h);e?f("MOUNT"):y==="none"||h?.display==="none"?f("UNMOUNT"):f(p&&v!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,f]),Ld(()=>{if(t){let h;const p=t.ownerDocument.defaultView??window,g=y=>{const S=ip(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&S&&(f("ANIMATION_END"),!i.current)){const N=t.style.animationFillMode;t.style.animationFillMode="forwards",h=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=N)})}},v=y=>{y.target===t&&(s.current=ip(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{p.clearTimeout(h),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:x.useCallback(h=>{r.current=h?getComputedStyle(h):null,n(h)},[])}}function ip(e){return e?.animationName||"none"}function UH(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var gb=0;function BH(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??IA()),document.body.insertAdjacentElement("beforeend",e[1]??IA()),gb++,()=>{gb===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),gb--}},[])}function IA(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ki=function(){return Ki=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Ki.apply(this,arguments)};function zR(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function qH(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Bp="right-scroll-bar-position",qp="width-before-scroll-bar",FH="with-scroll-bars-hidden",KH="--removed-body-scroll-bar-size";function vb(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function HH(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var GH=typeof window<"u"?x.useLayoutEffect:x.useEffect,LA=new WeakMap;function VH(e,t){var n=HH(null,function(r){return e.forEach(function(i){return vb(i,r)})});return GH(function(){var r=LA.get(n);if(r){var i=new Set(r),s=new Set(e),l=n.current;i.forEach(function(c){s.has(c)||vb(c,null)}),s.forEach(function(c){i.has(c)||vb(c,l)})}LA.set(n,e)},[e]),n}function ZH(e){return e}function YH(e,t){t===void 0&&(t=ZH);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var l=t(s,r);return n.push(l),function(){n=n.filter(function(c){return c!==l})}},assignSyncMedium:function(s){for(r=!0;n.length;){var l=n;n=[],l.forEach(s)}n={push:function(c){return s(c)},filter:function(){return n}}},assignMedium:function(s){r=!0;var l=[];if(n.length){var c=n;n=[],c.forEach(s),l=n}var f=function(){var p=l;l=[],p.forEach(s)},h=function(){return Promise.resolve().then(f)};h(),n={push:function(p){l.push(p),h()},filter:function(p){return l=l.filter(p),n}}}};return i}function WH(e){e===void 0&&(e={});var t=YH(null);return t.options=Ki({async:!0,ssr:!1},e),t}var MR=function(e){var t=e.sideCar,n=zR(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return x.createElement(r,Ki({},n))};MR.isSideCarExport=!0;function QH(e,t){return e.useMedium(t),MR}var RR=WH(),yb=function(){},Mg=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:yb,onWheelCapture:yb,onTouchMoveCapture:yb}),i=r[0],s=r[1],l=e.forwardProps,c=e.children,f=e.className,h=e.removeScrollBar,p=e.enabled,g=e.shards,v=e.sideCar,y=e.noRelative,w=e.noIsolation,S=e.inert,N=e.allowPinchZoom,C=e.as,E=C===void 0?"div":C,k=e.gapMode,O=zR(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=v,P=VH([n,t]),A=Ki(Ki({},O),i);return x.createElement(x.Fragment,null,p&&x.createElement(T,{sideCar:RR,removeScrollBar:h,shards:g,noRelative:y,noIsolation:w,inert:S,setCallbacks:s,allowPinchZoom:!!N,lockRef:n,gapMode:k}),l?x.cloneElement(x.Children.only(c),Ki(Ki({},A),{ref:P})):x.createElement(E,Ki({},A,{className:f,ref:P}),c))});Mg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Mg.classNames={fullWidth:qp,zeroRight:Bp};var XH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function JH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=XH();return t&&e.setAttribute("nonce",t),e}function e7(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function t7(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var n7=function(){var e=0,t=null;return{add:function(n){e==0&&(t=JH())&&(e7(t,n),t7(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},r7=function(){var e=n7();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},DR=function(){var e=r7(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},i7={left:0,top:0,right:0,gap:0},bb=function(e){return parseInt(e||"",10)||0},a7=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[bb(n),bb(r),bb(i)]},s7=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return i7;var t=a7(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},o7=DR(),Nc="data-scroll-locked",l7=function(e,t,n,r){var i=e.left,s=e.top,l=e.right,c=e.gap;return n===void 0&&(n="margin"),`
13
- .`.concat(FH,` {
14
- overflow: hidden `).concat(r,`;
15
- padding-right: `).concat(c,"px ").concat(r,`;
16
- }
17
- body[`).concat(Nc,`] {
18
- overflow: hidden `).concat(r,`;
19
- overscroll-behavior: contain;
20
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
21
- padding-left: `.concat(i,`px;
22
- padding-top: `).concat(s,`px;
23
- padding-right: `).concat(l,`px;
24
- margin-left:0;
25
- margin-top:0;
26
- margin-right: `).concat(c,"px ").concat(r,`;
27
- `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
28
- }
29
-
30
- .`).concat(Bp,` {
31
- right: `).concat(c,"px ").concat(r,`;
32
- }
33
-
34
- .`).concat(qp,` {
35
- margin-right: `).concat(c,"px ").concat(r,`;
36
- }
37
-
38
- .`).concat(Bp," .").concat(Bp,` {
39
- right: 0 `).concat(r,`;
40
- }
41
-
42
- .`).concat(qp," .").concat(qp,` {
43
- margin-right: 0 `).concat(r,`;
44
- }
45
-
46
- body[`).concat(Nc,`] {
47
- `).concat(KH,": ").concat(c,`px;
48
- }
49
- `)},$A=function(){var e=parseInt(document.body.getAttribute(Nc)||"0",10);return isFinite(e)?e:0},c7=function(){x.useEffect(function(){return document.body.setAttribute(Nc,($A()+1).toString()),function(){var e=$A()-1;e<=0?document.body.removeAttribute(Nc):document.body.setAttribute(Nc,e.toString())}},[])},u7=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;c7();var s=x.useMemo(function(){return s7(i)},[i]);return x.createElement(o7,{styles:l7(s,!t,i,n?"":"!important")})},Cw=!1;if(typeof window<"u")try{var ap=Object.defineProperty({},"passive",{get:function(){return Cw=!0,!0}});window.addEventListener("test",ap,ap),window.removeEventListener("test",ap,ap)}catch{Cw=!1}var tc=Cw?{passive:!1}:!1,d7=function(e){return e.tagName==="TEXTAREA"},IR=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!d7(e)&&n[t]==="visible")},f7=function(e){return IR(e,"overflowY")},h7=function(e){return IR(e,"overflowX")},UA=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=LR(e,r);if(i){var s=$R(e,r),l=s[1],c=s[2];if(l>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},p7=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},m7=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},LR=function(e,t){return e==="v"?f7(t):h7(t)},$R=function(e,t){return e==="v"?p7(t):m7(t)},g7=function(e,t){return e==="h"&&t==="rtl"?-1:1},v7=function(e,t,n,r,i){var s=g7(e,window.getComputedStyle(t).direction),l=s*r,c=n.target,f=t.contains(c),h=!1,p=l>0,g=0,v=0;do{if(!c)break;var y=$R(e,c),w=y[0],S=y[1],N=y[2],C=S-N-s*w;(w||C)&&LR(e,c)&&(g+=C,v+=w);var E=c.parentNode;c=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!f&&c!==document.body||f&&(t.contains(c)||t===c));return(p&&Math.abs(g)<1||!p&&Math.abs(v)<1)&&(h=!0),h},sp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},BA=function(e){return[e.deltaX,e.deltaY]},qA=function(e){return e&&"current"in e?e.current:e},y7=function(e,t){return e[0]===t[0]&&e[1]===t[1]},b7=function(e){return`
50
- .block-interactivity-`.concat(e,` {pointer-events: none;}
51
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
52
- `)},x7=0,nc=[];function w7(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(x7++)[0],s=x.useState(DR)[0],l=x.useRef(e);x.useEffect(function(){l.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var S=qH([e.lockRef.current],(e.shards||[]).map(qA),!0).filter(Boolean);return S.forEach(function(N){return N.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),S.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var c=x.useCallback(function(S,N){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!l.current.allowPinchZoom;var C=sp(S),E=n.current,k="deltaX"in S?S.deltaX:E[0]-C[0],O="deltaY"in S?S.deltaY:E[1]-C[1],T,P=S.target,A=Math.abs(k)>Math.abs(O)?"h":"v";if("touches"in S&&A==="h"&&P.type==="range")return!1;var z=window.getSelection(),R=z&&z.anchorNode,q=R?R===P||R.contains(P):!1;if(q)return!1;var U=UA(A,P);if(!U)return!0;if(U?T=A:(T=A==="v"?"h":"v",U=UA(A,P)),!U)return!1;if(!r.current&&"changedTouches"in S&&(k||O)&&(r.current=T),!T)return!0;var L=r.current||T;return v7(L,N,S,L==="h"?k:O)},[]),f=x.useCallback(function(S){var N=S;if(!(!nc.length||nc[nc.length-1]!==s)){var C="deltaY"in N?BA(N):sp(N),E=t.current.filter(function(T){return T.name===N.type&&(T.target===N.target||N.target===T.shadowParent)&&y7(T.delta,C)})[0];if(E&&E.should){N.cancelable&&N.preventDefault();return}if(!E){var k=(l.current.shards||[]).map(qA).filter(Boolean).filter(function(T){return T.contains(N.target)}),O=k.length>0?c(N,k[0]):!l.current.noIsolation;O&&N.cancelable&&N.preventDefault()}}},[]),h=x.useCallback(function(S,N,C,E){var k={name:S,delta:N,target:C,should:E,shadowParent:S7(C)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(O){return O!==k})},1)},[]),p=x.useCallback(function(S){n.current=sp(S),r.current=void 0},[]),g=x.useCallback(function(S){h(S.type,BA(S),S.target,c(S,e.lockRef.current))},[]),v=x.useCallback(function(S){h(S.type,sp(S),S.target,c(S,e.lockRef.current))},[]);x.useEffect(function(){return nc.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:v}),document.addEventListener("wheel",f,tc),document.addEventListener("touchmove",f,tc),document.addEventListener("touchstart",p,tc),function(){nc=nc.filter(function(S){return S!==s}),document.removeEventListener("wheel",f,tc),document.removeEventListener("touchmove",f,tc),document.removeEventListener("touchstart",p,tc)}},[]);var y=e.removeScrollBar,w=e.inert;return x.createElement(x.Fragment,null,w?x.createElement(s,{styles:b7(i)}):null,y?x.createElement(u7,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function S7(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const j7=QH(RR,w7);var UR=x.forwardRef(function(e,t){return x.createElement(Mg,Ki({},e,{ref:t,sideCar:j7}))});UR.classNames=Mg.classNames;var N7=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},rc=new WeakMap,op=new WeakMap,lp={},xb=0,BR=function(e){return e&&(e.host||BR(e.parentNode))},C7=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=BR(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},O7=function(e,t,n,r){var i=C7(t,Array.isArray(e)?e:[e]);lp[n]||(lp[n]=new WeakMap);var s=lp[n],l=[],c=new Set,f=new Set(i),h=function(g){!g||c.has(g)||(c.add(g),h(g.parentNode))};i.forEach(h);var p=function(g){!g||f.has(g)||Array.prototype.forEach.call(g.children,function(v){if(c.has(v))p(v);else try{var y=v.getAttribute(r),w=y!==null&&y!=="false",S=(rc.get(v)||0)+1,N=(s.get(v)||0)+1;rc.set(v,S),s.set(v,N),l.push(v),S===1&&w&&op.set(v,!0),N===1&&v.setAttribute(n,"true"),w||v.setAttribute(r,"true")}catch(C){console.error("aria-hidden: cannot operate on ",v,C)}})};return p(t),c.clear(),xb++,function(){l.forEach(function(g){var v=rc.get(g)-1,y=s.get(g)-1;rc.set(g,v),s.set(g,y),v||(op.has(g)||g.removeAttribute(r),op.delete(g)),y||g.removeAttribute(n)}),xb--,xb||(rc=new WeakMap,rc=new WeakMap,op=new WeakMap,lp={})}},_7=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=N7(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),O7(r,i,n,"aria-hidden")):function(){return null}},Rg="Dialog",[qR]=oH(Rg),[k7,_i]=qR(Rg),FR=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:l=!0}=e,c=x.useRef(null),f=x.useRef(null),[h,p]=fH({prop:r,defaultProp:i??!1,onChange:s,caller:Rg});return u.jsx(k7,{scope:t,triggerRef:c,contentRef:f,contentId:hb(),titleId:hb(),descriptionId:hb(),open:h,onOpenChange:p,onOpenToggle:x.useCallback(()=>p(g=>!g),[p]),modal:l,children:n})};FR.displayName=Rg;var KR="DialogTrigger",A7=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=_i(KR,n),s=ll(t,i.triggerRef);return u.jsx(Ia.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":h1(i.open),...r,ref:s,onClick:Ms(e.onClick,i.onOpenToggle)})});A7.displayName=KR;var d1="DialogPortal",[E7,HR]=qR(d1,{forceMount:void 0}),GR=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,s=_i(d1,t);return u.jsx(E7,{scope:t,forceMount:n,children:x.Children.map(r,l=>u.jsx(zg,{present:n||s.open,children:u.jsx(PR,{asChild:!0,container:i,children:l})}))})};GR.displayName=d1;var pm="DialogOverlay",VR=x.forwardRef((e,t)=>{const n=HR(pm,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=_i(pm,e.__scopeDialog);return s.modal?u.jsx(zg,{present:r||s.open,children:u.jsx(P7,{...i,ref:t})}):null});VR.displayName=pm;var T7=OR("DialogOverlay.RemoveScroll"),P7=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=_i(pm,n);return u.jsx(UR,{as:T7,allowPinchZoom:!0,shards:[i.contentRef],children:u.jsx(Ia.div,{"data-state":h1(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Wo="DialogContent",ZR=x.forwardRef((e,t)=>{const n=HR(Wo,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=_i(Wo,e.__scopeDialog);return u.jsx(zg,{present:r||s.open,children:s.modal?u.jsx(z7,{...i,ref:t}):u.jsx(M7,{...i,ref:t})})});ZR.displayName=Wo;var z7=x.forwardRef((e,t)=>{const n=_i(Wo,e.__scopeDialog),r=x.useRef(null),i=ll(t,n.contentRef,r);return x.useEffect(()=>{const s=r.current;if(s)return _7(s)},[]),u.jsx(YR,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ms(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Ms(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&s.preventDefault()}),onFocusOutside:Ms(e.onFocusOutside,s=>s.preventDefault())})}),M7=x.forwardRef((e,t)=>{const n=_i(Wo,e.__scopeDialog),r=x.useRef(!1),i=x.useRef(!1);return u.jsx(YR,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=s.target;n.triggerRef.current?.contains(l)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),YR=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...l}=e,c=_i(Wo,n),f=x.useRef(null),h=ll(t,f);return BH(),u.jsxs(u.Fragment,{children:[u.jsx(ER,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:u.jsx(kR,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":h1(c.open),...l,ref:h,onDismiss:()=>c.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(R7,{titleId:c.titleId}),u.jsx(I7,{contentRef:f,descriptionId:c.descriptionId})]})]})}),f1="DialogTitle",WR=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=_i(f1,n);return u.jsx(Ia.h2,{id:i.titleId,...r,ref:t})});WR.displayName=f1;var QR="DialogDescription",XR=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=_i(QR,n);return u.jsx(Ia.p,{id:i.descriptionId,...r,ref:t})});XR.displayName=QR;var JR="DialogClose",eD=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=_i(JR,n);return u.jsx(Ia.button,{type:"button",...r,ref:t,onClick:Ms(e.onClick,()=>i.onOpenChange(!1))})});eD.displayName=JR;function h1(e){return e?"open":"closed"}var tD="DialogTitleWarning",[kye,nD]=sH(tD,{contentName:Wo,titleName:f1,docsSlug:"dialog"}),R7=({titleId:e})=>{const t=nD(tD),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
53
-
54
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
55
-
56
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},D7="DialogDescriptionWarning",I7=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${nD(D7).contentName}}.`;return x.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},rD=FR,iD=GR,p1=VR,m1=ZR,g1=WR,aD=XR,sD=eD;const L7=rD,$7=iD,oD=x.forwardRef(({className:e,...t},n)=>u.jsx(p1,{ref:n,className:ci("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));oD.displayName=p1.displayName;const U7=400,B7=1200,q7=720,lD=x.forwardRef(({className:e,children:t,...n},r)=>{const[i,s]=x.useState(q7),l=x.useRef(!1),c=x.useRef(0),f=x.useRef(0),h=x.useCallback(v=>{l.current=!0,c.current=v.clientX,f.current=i,v.target.setPointerCapture(v.pointerId),v.preventDefault()},[i]),p=x.useCallback(v=>{if(!l.current)return;const y=c.current-v.clientX,w=Math.min(B7,Math.max(U7,f.current+y));s(w)},[]),g=x.useCallback(()=>{l.current=!1},[]);return u.jsxs($7,{children:[u.jsx(oD,{}),u.jsxs(m1,{ref:r,className:ci("fixed z-50 flex flex-col bg-zinc-950 px-5 py-4 shadow-2xl overflow-hidden","max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:max-h-[88vh] max-md:rounded-t-2xl max-md:border-t","md:inset-y-0 md:right-0 md:h-full md:border-l","border-zinc-800",e),style:{width:`min(${i}px, 100vw)`},...n,children:[u.jsx("div",{className:"absolute inset-y-0 left-0 w-1.5 cursor-col-resize hover:bg-zinc-700/50 active:bg-zinc-600/50 transition-colors max-md:hidden",onPointerDown:h,onPointerMove:p,onPointerUp:g}),t,u.jsxs(sD,{className:"absolute right-4 top-4 inline-flex size-8 items-center justify-center rounded-md text-zinc-500 transition hover:bg-zinc-900 hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400",children:[u.jsx(kg,{className:"size-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});lD.displayName=m1.displayName;const F7=({className:e,...t})=>u.jsx("div",{className:ci("flex flex-col gap-1.5 pr-10",e),...t}),cD=x.forwardRef(({className:e,...t},n)=>u.jsx(g1,{ref:n,className:ci("text-lg font-medium text-zinc-50",e),...t}));cD.displayName=g1.displayName;const uD=x.forwardRef(({className:e,...t},n)=>u.jsx(aD,{ref:n,className:ci("text-sm text-zinc-500",e),...t}));uD.displayName=aD.displayName;function K7({title:e,subtitle:t,children:n,open:r,onClose:i}){return u.jsx(L7,{open:r,onOpenChange:s=>s?void 0:i(),children:u.jsxs(lD,{children:[u.jsxs(F7,{className:"drawer-head",children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),u.jsx(cD,{id:"drawer-title",children:e}),u.jsx(uD,{className:"sr-only",children:t})]}),u.jsx("div",{className:"drawer-body",children:n})]})})}function ue(e,t,n){function r(c,f){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:f,constr:l,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,f);const h=l.prototype,p=Object.keys(h);for(let g=0;g<p.length;g++){const v=p[g];v in c||(c[v]=h[v].bind(c))}}const i=n?.Parent??Object;class s extends i{}Object.defineProperty(s,"name",{value:e});function l(c){var f;const h=n?.Parent?new s:this;r(h,c),(f=h._zod).deferred??(f.deferred=[]);for(const p of h._zod.deferred)p();return h}return Object.defineProperty(l,"init",{value:r}),Object.defineProperty(l,Symbol.hasInstance,{value:c=>n?.Parent&&c instanceof n.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}class Cc extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class dD extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const fD={};function $s(e){return fD}function hD(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function Ow(e,t){return typeof t=="bigint"?t.toString():t}function v1(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function y1(e){return e==null}function b1(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function H7(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const f=r.match(/\d?e-(\d?)/);f?.[1]&&(i=Number.parseInt(f[1]))}const s=n>i?n:i,l=Number.parseInt(e.toFixed(s).replace(".","")),c=Number.parseInt(t.toFixed(s).replace(".",""));return l%c/10**s}const FA=Symbol("evaluating");function gt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==FA)return r===void 0&&(r=FA,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function ul(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Vs(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function KA(e){return JSON.stringify(e)}function G7(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const pD="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function mm(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const V7=v1(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function zc(e){if(mm(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(mm(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function mD(e){return zc(e)?{...e}:Array.isArray(e)?[...e]:e}const Z7=new Set(["string","number","symbol"]);function Mc(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Zs(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function De(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(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 Y7(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const W7={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 Q7(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=Vs(e._zod.def,{get shape(){const l={};for(const c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(l[c]=n.shape[c])}return ul(this,"shape",l),l},checks:[]});return Zs(e,s)}function X7(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=Vs(e._zod.def,{get shape(){const l={...e._zod.def.shape};for(const c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete l[c]}return ul(this,"shape",l),l},checks:[]});return Zs(e,s)}function J7(e,t){if(!zc(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const l in t)if(Object.getOwnPropertyDescriptor(s,l)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=Vs(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return ul(this,"shape",s),s}});return Zs(e,i)}function eG(e,t){if(!zc(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Vs(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return ul(this,"shape",r),r}});return Zs(e,n)}function tG(e,t){const n=Vs(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return ul(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Zs(e,n)}function nG(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const l=Vs(t._zod.def,{get shape(){const c=t._zod.def.shape,f={...c};if(n)for(const h in n){if(!(h in c))throw new Error(`Unrecognized key: "${h}"`);n[h]&&(f[h]=e?new e({type:"optional",innerType:c[h]}):c[h])}else for(const h in c)f[h]=e?new e({type:"optional",innerType:c[h]}):c[h];return ul(this,"shape",f),f},checks:[]});return Zs(t,l)}function rG(e,t,n){const r=Vs(t._zod.def,{get shape(){const i=t._zod.def.shape,s={...i};if(n)for(const l in n){if(!(l in s))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(s[l]=new e({type:"nonoptional",innerType:i[l]}))}else for(const l in i)s[l]=new e({type:"nonoptional",innerType:i[l]});return ul(this,"shape",s),s}});return Zs(t,r)}function gc(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function vc(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function cp(e){return typeof e=="string"?e:e?.message}function Us(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=cp(e.inst?._zod.def?.error?.(e))??cp(t?.error?.(e))??cp(n.customError?.(e))??cp(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function x1(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Ud(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const gD=(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,Ow,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},vD=ue("$ZodError",gD),yD=ue("$ZodError",gD,{Parent:Error});function iG(e,t=n=>n.message){const n={},r=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function aG(e,t=n=>n.message){const n={_errors:[]},r=i=>{for(const s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(l=>r({issues:l}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)n._errors.push(t(s));else{let l=n,c=0;for(;c<s.path.length;){const f=s.path[c];c===s.path.length-1?(l[f]=l[f]||{_errors:[]},l[f]._errors.push(t(s))):l[f]=l[f]||{_errors:[]},l=l[f],c++}}};return r(e),n}const w1=e=>(t,n,r,i)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},s);if(l instanceof Promise)throw new Cc;if(l.issues.length){const c=new(i?.Err??e)(l.issues.map(f=>Us(f,s,$s())));throw pD(c,i?.callee),c}return l.value},S1=e=>async(t,n,r,i)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},s);if(l instanceof Promise&&(l=await l),l.issues.length){const c=new(i?.Err??e)(l.issues.map(f=>Us(f,s,$s())));throw pD(c,i?.callee),c}return l.value},Dg=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new Cc;return s.issues.length?{success:!1,error:new(e??vD)(s.issues.map(l=>Us(l,i,$s())))}:{success:!0,data:s.value}},sG=Dg(yD),Ig=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(l=>Us(l,i,$s())))}:{success:!0,data:s.value}},oG=Ig(yD),lG=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return w1(e)(t,n,i)},cG=e=>(t,n,r)=>w1(e)(t,n,r),uG=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return S1(e)(t,n,i)},dG=e=>async(t,n,r)=>S1(e)(t,n,r),fG=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Dg(e)(t,n,i)},hG=e=>(t,n,r)=>Dg(e)(t,n,r),pG=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ig(e)(t,n,i)},mG=e=>async(t,n,r)=>Ig(e)(t,n,r),gG=/^[cC][^\s-]{8,}$/,vG=/^[0-9a-z]+$/,yG=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,bG=/^[0-9a-vA-V]{20}$/,xG=/^[A-Za-z0-9]{27}$/,wG=/^[a-zA-Z0-9_-]{21}$/,SG=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,jG=/^([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})$/,HA=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)$/,NG=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,CG="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function OG(){return new RegExp(CG,"u")}const _G=/^(?:(?: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])$/,kG=/^(([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}|:))$/,AG=/^((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])$/,EG=/^(([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])$/,TG=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,bD=/^[A-Za-z0-9_-]*$/,PG=/^\+[1-9]\d{6,14}$/,xD="(?:(?:\\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])))",zG=new RegExp(`^${xD}$`);function wD(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 MG(e){return new RegExp(`^${wD(e)}$`)}function RG(e){const t=wD({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${xD}T(?:${r})$`)}const DG=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},IG=/^-?\d+$/,SD=/^-?\d+(?:\.\d+)?$/,LG=/^(?:true|false)$/i,$G=/^[^A-Z]*$/,UG=/^[^a-z]*$/,wr=ue("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),jD={number:"number",bigint:"bigint",object:"date"},ND=ue("$ZodCheckLessThan",(e,t)=>{wr.init(e,t);const n=jD[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,s=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),CD=ue("$ZodCheckGreaterThan",(e,t)=>{wr.init(e,t);const n=jD[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,s=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),BG=ue("$ZodCheckMultipleOf",(e,t)=>{wr.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):H7(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),qG=ue("$ZodCheckNumberFormat",(e,t)=>{wr.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,s]=W7[t.format];e._zod.onattach.push(l=>{const c=l._zod.bag;c.format=t.format,c.minimum=i,c.maximum=s,n&&(c.pattern=IG)}),e._zod.check=l=>{const c=l.value;if(n){if(!Number.isInteger(c)){l.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?l.issues.push({input:c,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}):l.issues.push({input:c,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}}c<i&&l.issues.push({origin:"number",input:c,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),c>s&&l.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),FG=ue("$ZodCheckMaxLength",(e,t)=>{var n;wr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!y1(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const l=x1(i);r.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),KG=ue("$ZodCheckMinLength",(e,t)=>{var n;wr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!y1(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const l=x1(i);r.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),HG=ue("$ZodCheckLengthEquals",(e,t)=>{var n;wr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!y1(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,s=i.length;if(s===t.length)return;const l=x1(i),c=s>t.length;r.issues.push({origin:l,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Lg=ue("$ZodCheckStringFormat",(e,t)=>{var n,r;wr.init(e,t),e._zod.onattach.push(i=>{const s=i._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),GG=ue("$ZodCheckRegex",(e,t)=>{Lg.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),VG=ue("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=$G),Lg.init(e,t)}),ZG=ue("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=UG),Lg.init(e,t)}),YG=ue("$ZodCheckIncludes",(e,t)=>{wr.init(e,t);const n=Mc(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),WG=ue("$ZodCheckStartsWith",(e,t)=>{wr.init(e,t);const n=new RegExp(`^${Mc(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),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})}}),QG=ue("$ZodCheckEndsWith",(e,t)=>{wr.init(e,t);const n=new RegExp(`.*${Mc(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),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})}}),XG=ue("$ZodCheckOverwrite",(e,t)=>{wr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class JG{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(`
57
- `).filter(l=>l),i=Math.min(...r.map(l=>l.length-l.trimStart().length)),s=r.map(l=>l.slice(i)).map(l=>" ".repeat(this.indent*2)+l);for(const l of s)this.content.push(l)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...n,i.join(`
58
- `))}}const eV={major:4,minor:3,patch:6},qt=ue("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=eV;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const s of i._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(l,c,f)=>{let h=gc(l),p;for(const g of c){if(g._zod.def.when){if(!g._zod.def.when(l))continue}else if(h)continue;const v=l.issues.length,y=g._zod.check(l);if(y instanceof Promise&&f?.async===!1)throw new Cc;if(p||y instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await y,l.issues.length!==v&&(h||(h=gc(l,v)))});else{if(l.issues.length===v)continue;h||(h=gc(l,v))}}return p?p.then(()=>l):l},s=(l,c,f)=>{if(gc(l))return l.aborted=!0,l;const h=i(c,r,f);if(h instanceof Promise){if(f.async===!1)throw new Cc;return h.then(p=>e._zod.parse(p,f))}return e._zod.parse(h,f)};e._zod.run=(l,c)=>{if(c.skipChecks)return e._zod.parse(l,c);if(c.direction==="backward"){const h=e._zod.parse({value:l.value,issues:[]},{...c,skipChecks:!0});return h instanceof Promise?h.then(p=>s(p,l,c)):s(h,l,c)}const f=e._zod.parse(l,c);if(f instanceof Promise){if(c.async===!1)throw new Cc;return f.then(h=>i(h,r,c))}return i(f,r,c)}}gt(e,"~standard",()=>({validate:i=>{try{const s=sG(e,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return oG(e,i).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),j1=ue("$ZodString",(e,t)=>{qt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??DG(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Lt=ue("$ZodStringFormat",(e,t)=>{Lg.init(e,t),j1.init(e,t)}),tV=ue("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=jG),Lt.init(e,t)}),nV=ue("$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=HA(r))}else t.pattern??(t.pattern=HA());Lt.init(e,t)}),rV=ue("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=NG),Lt.init(e,t)}),iV=ue("$ZodURL",(e,t)=>{Lt.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),aV=ue("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=OG()),Lt.init(e,t)}),sV=ue("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=wG),Lt.init(e,t)}),oV=ue("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=gG),Lt.init(e,t)}),lV=ue("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=vG),Lt.init(e,t)}),cV=ue("$ZodULID",(e,t)=>{t.pattern??(t.pattern=yG),Lt.init(e,t)}),uV=ue("$ZodXID",(e,t)=>{t.pattern??(t.pattern=bG),Lt.init(e,t)}),dV=ue("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=xG),Lt.init(e,t)}),fV=ue("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=RG(t)),Lt.init(e,t)}),hV=ue("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=zG),Lt.init(e,t)}),pV=ue("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=MG(t)),Lt.init(e,t)}),mV=ue("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=SG),Lt.init(e,t)}),gV=ue("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=_G),Lt.init(e,t),e._zod.bag.format="ipv4"}),vV=ue("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=kG),Lt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),yV=ue("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=AG),Lt.init(e,t)}),bV=ue("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=EG),Lt.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[i,s]=r;if(!s)throw new Error;const l=Number(s);if(`${l}`!==s)throw new Error;if(l<0||l>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function OD(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const xV=ue("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=TG),Lt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{OD(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function wV(e){if(!bD.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return OD(n)}const SV=ue("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=bD),Lt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{wV(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),jV=ue("$ZodE164",(e,t)=>{t.pattern??(t.pattern=PG),Lt.init(e,t)});function NV(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const CV=ue("$ZodJWT",(e,t)=>{Lt.init(e,t),e._zod.check=n=>{NV(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),_D=ue("$ZodNumber",(e,t)=>{qt.init(e,t),e._zod.pattern=e._zod.bag.pattern??SD,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...s?{received:s}:{}}),n}}),OV=ue("$ZodNumberFormat",(e,t)=>{qG.init(e,t),_D.init(e,t)}),_V=ue("$ZodBoolean",(e,t)=>{qt.init(e,t),e._zod.pattern=LG,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),kV=ue("$ZodUnknown",(e,t)=>{qt.init(e,t),e._zod.parse=n=>n}),AV=ue("$ZodNever",(e,t)=>{qt.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function GA(e,t,n){e.issues.length&&t.issues.push(...vc(n,e.issues)),t.value[n]=e.value}const EV=ue("$ZodArray",(e,t)=>{qt.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const s=[];for(let l=0;l<i.length;l++){const c=i[l],f=t.element._zod.run({value:c,issues:[]},r);f instanceof Promise?s.push(f.then(h=>GA(h,n,l))):GA(f,n,l)}return s.length?Promise.all(s).then(()=>n):n}});function gm(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...vc(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function kD(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=Y7(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function AD(e,t,n,r,i,s){const l=[],c=i.keySet,f=i.catchall._zod,h=f.def.type,p=f.optout==="optional";for(const g in t){if(c.has(g))continue;if(h==="never"){l.push(g);continue}const v=f.run({value:t[g],issues:[]},r);v instanceof Promise?e.push(v.then(y=>gm(y,n,g,t,p))):gm(v,n,g,t,p)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const TV=ue("$ZodObject",(e,t)=>{if(qt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const c=t.shape;Object.defineProperty(t,"shape",{get:()=>{const f={...c};return Object.defineProperty(t,"shape",{value:f}),f}})}const r=v1(()=>kD(t));gt(e._zod,"propValues",()=>{const c=t.shape,f={};for(const h in c){const p=c[h]._zod;if(p.values){f[h]??(f[h]=new Set);for(const g of p.values)f[h].add(g)}}return f});const i=mm,s=t.catchall;let l;e._zod.parse=(c,f)=>{l??(l=r.value);const h=c.value;if(!i(h))return c.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),c;c.value={};const p=[],g=l.shape;for(const v of l.keys){const y=g[v],w=y._zod.optout==="optional",S=y._zod.run({value:h[v],issues:[]},f);S instanceof Promise?p.push(S.then(N=>gm(N,c,v,h,w))):gm(S,c,v,h,w)}return s?AD(p,h,c,f,r.value,e):p.length?Promise.all(p).then(()=>c):c}}),PV=ue("$ZodObjectJIT",(e,t)=>{TV.init(e,t);const n=e._zod.parse,r=v1(()=>kD(t)),i=v=>{const y=new JG(["shape","payload","ctx"]),w=r.value,S=k=>{const O=KA(k);return`shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`};y.write("const input = payload.value;");const N=Object.create(null);let C=0;for(const k of w.keys)N[k]=`key_${C++}`;y.write("const newResult = {};");for(const k of w.keys){const O=N[k],T=KA(k),A=v[k]?._zod?.optout==="optional";y.write(`const ${O} = ${S(k)};`),A?y.write(`
59
- if (${O}.issues.length) {
60
- if (${T} in input) {
61
- payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
62
- ...iss,
63
- path: iss.path ? [${T}, ...iss.path] : [${T}]
64
- })));
65
- }
66
- }
67
-
68
- if (${O}.value === undefined) {
69
- if (${T} in input) {
70
- newResult[${T}] = undefined;
71
- }
72
- } else {
73
- newResult[${T}] = ${O}.value;
74
- }
75
-
76
- `):y.write(`
77
- if (${O}.issues.length) {
78
- payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
79
- ...iss,
80
- path: iss.path ? [${T}, ...iss.path] : [${T}]
81
- })));
82
- }
83
-
84
- if (${O}.value === undefined) {
85
- if (${T} in input) {
86
- newResult[${T}] = undefined;
87
- }
88
- } else {
89
- newResult[${T}] = ${O}.value;
90
- }
91
-
92
- `)}y.write("payload.value = newResult;"),y.write("return payload;");const E=y.compile();return(k,O)=>E(v,k,O)};let s;const l=mm,c=!fD.jitless,h=c&&V7.value,p=t.catchall;let g;e._zod.parse=(v,y)=>{g??(g=r.value);const w=v.value;return l(w)?c&&h&&y?.async===!1&&y.jitless!==!0?(s||(s=i(t.shape)),v=s(v,y),p?AD([],w,v,y,g,e):v):n(v,y):(v.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),v)}});function VA(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const i=e.filter(s=>!gc(s));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(l=>Us(l,r,$s())))}),t)}const zV=ue("$ZodUnion",(e,t)=>{qt.init(e,t),gt(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),gt(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),gt(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),gt(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>b1(s.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,s)=>{if(n)return r(i,s);let l=!1;const c=[];for(const f of t.options){const h=f._zod.run({value:i.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=>VA(f,i,e,s)):VA(c,i,e,s)}}),MV=ue("$ZodIntersection",(e,t)=>{qt.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,s=t.left._zod.run({value:i,issues:[]},r),l=t.right._zod.run({value:i,issues:[]},r);return s instanceof Promise||l instanceof Promise?Promise.all([s,l]).then(([f,h])=>ZA(n,f,h)):ZA(n,s,l)}});function _w(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(zc(e)&&zc(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),i={...e,...t};for(const s of r){const l=_w(e[s],t[s]);if(!l.valid)return{valid:!1,mergeErrorPath:[s,...l.mergeErrorPath]};i[s]=l.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const i=e[r],s=t[r],l=_w(i,s);if(!l.valid)return{valid:!1,mergeErrorPath:[r,...l.mergeErrorPath]};n.push(l.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function ZA(e,t,n){const r=new Map;let i;for(const c of t.issues)if(c.code==="unrecognized_keys"){i??(i=c);for(const f of c.keys)r.has(f)||r.set(f,{}),r.get(f).l=!0}else e.issues.push(c);for(const c of n.issues)if(c.code==="unrecognized_keys")for(const f of c.keys)r.has(f)||r.set(f,{}),r.get(f).r=!0;else e.issues.push(c);const s=[...r].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(s.length&&i&&e.issues.push({...i,keys:s}),gc(e))return e;const l=_w(t.value,n.value);if(!l.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`);return e.value=l.data,e}const RV=ue("$ZodRecord",(e,t)=>{qt.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!zc(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const s=[],l=t.keyType._zod.values;if(l){n.value={};const c=new Set;for(const h of l)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){c.add(typeof h=="number"?h.toString():h);const p=t.valueType._zod.run({value:i[h],issues:[]},r);p instanceof Promise?s.push(p.then(g=>{g.issues.length&&n.issues.push(...vc(h,g.issues)),n.value[h]=g.value})):(p.issues.length&&n.issues.push(...vc(h,p.issues)),n.value[h]=p.value)}let f;for(const h in i)c.has(h)||(f=f??[],f.push(h));f&&f.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{n.value={};for(const c of Reflect.ownKeys(i)){if(c==="__proto__")continue;let f=t.keyType._zod.run({value:c,issues:[]},r);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&SD.test(c)&&f.issues.length){const g=t.keyType._zod.run({value:Number(c),issues:[]},r);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(f=g)}if(f.issues.length){t.mode==="loose"?n.value[c]=i[c]:n.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(g=>Us(g,r,$s())),input:c,path:[c],inst:e});continue}const p=t.valueType._zod.run({value:i[c],issues:[]},r);p instanceof Promise?s.push(p.then(g=>{g.issues.length&&n.issues.push(...vc(c,g.issues)),n.value[f.value]=g.value})):(p.issues.length&&n.issues.push(...vc(c,p.issues)),n.value[f.value]=p.value)}}return s.length?Promise.all(s).then(()=>n):n}}),DV=ue("$ZodEnum",(e,t)=>{qt.init(e,t);const n=hD(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>Z7.has(typeof i)).map(i=>typeof i=="string"?Mc(i):i.toString()).join("|")})$`),e._zod.parse=(i,s)=>{const l=i.value;return r.has(l)||i.issues.push({code:"invalid_value",values:n,input:l,inst:e}),i}}),IV=ue("$ZodLiteral",(e,t)=>{if(qt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Mc(r):r?Mc(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,i)=>{const s=r.value;return n.has(s)||r.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),r}}),LV=ue("$ZodTransform",(e,t)=>{qt.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new dD(e.constructor.name);const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(l=>(n.value=l,n));if(i instanceof Promise)throw new Cc;return n.value=i,n}});function YA(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const ED=ue("$ZodOptional",(e,t)=>{qt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",gt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),gt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${b1(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>YA(s,n.value)):YA(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),$V=ue("$ZodExactOptional",(e,t)=>{ED.init(e,t),gt(e._zod,"values",()=>t.innerType._zod.values),gt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),UV=ue("$ZodNullable",(e,t)=>{qt.init(e,t),gt(e._zod,"optin",()=>t.innerType._zod.optin),gt(e._zod,"optout",()=>t.innerType._zod.optout),gt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${b1(n.source)}|null)$`):void 0}),gt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),BV=ue("$ZodDefault",(e,t)=>{qt.init(e,t),e._zod.optin="optional",gt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>WA(s,t)):WA(i,t)}});function WA(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const qV=ue("$ZodPrefault",(e,t)=>{qt.init(e,t),e._zod.optin="optional",gt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),FV=ue("$ZodNonOptional",(e,t)=>{qt.init(e,t),gt(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>QA(s,e)):QA(i,e)}});function QA(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 KV=ue("$ZodCatch",(e,t)=>{qt.init(e,t),gt(e._zod,"optin",()=>t.innerType._zod.optin),gt(e._zod,"optout",()=>t.innerType._zod.optout),gt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(l=>Us(l,r,$s()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>Us(s,r,$s()))},input:n.value}),n.issues=[]),n)}}),HV=ue("$ZodPipe",(e,t)=>{qt.init(e,t),gt(e._zod,"values",()=>t.in._zod.values),gt(e._zod,"optin",()=>t.in._zod.optin),gt(e._zod,"optout",()=>t.out._zod.optout),gt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(l=>up(l,t.in,r)):up(s,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(s=>up(s,t.out,r)):up(i,t.out,r)}});function up(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const GV=ue("$ZodReadonly",(e,t)=>{qt.init(e,t),gt(e._zod,"propValues",()=>t.innerType._zod.propValues),gt(e._zod,"values",()=>t.innerType._zod.values),gt(e._zod,"optin",()=>t.innerType?._zod?.optin),gt(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(XA):XA(i)}});function XA(e){return e.value=Object.freeze(e.value),e}const VV=ue("$ZodCustom",(e,t)=>{wr.init(e,t),qt.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(s=>JA(s,n,r,e));JA(i,n,r,e)}});function JA(e,t,n,r){if(!e){const i={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),t.issues.push(Ud(i))}}var eE;class ZV{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[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 n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const i={...r,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function YV(){return new ZV}(eE=globalThis).__zod_globalRegistry??(eE.__zod_globalRegistry=YV());const xd=globalThis.__zod_globalRegistry;function WV(e,t){return new e({type:"string",...De(t)})}function QV(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...De(t)})}function tE(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...De(t)})}function XV(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...De(t)})}function JV(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...De(t)})}function eZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...De(t)})}function tZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...De(t)})}function nZ(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...De(t)})}function rZ(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...De(t)})}function iZ(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...De(t)})}function aZ(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...De(t)})}function sZ(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...De(t)})}function oZ(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...De(t)})}function lZ(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...De(t)})}function cZ(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...De(t)})}function uZ(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...De(t)})}function dZ(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...De(t)})}function fZ(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...De(t)})}function hZ(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...De(t)})}function pZ(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...De(t)})}function mZ(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...De(t)})}function gZ(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...De(t)})}function vZ(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...De(t)})}function yZ(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...De(t)})}function bZ(e,t){return new e({type:"string",format:"date",check:"string_format",...De(t)})}function xZ(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...De(t)})}function wZ(e,t){return new e({type:"string",format:"duration",check:"string_format",...De(t)})}function SZ(e,t){return new e({type:"number",checks:[],...De(t)})}function jZ(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...De(t)})}function NZ(e,t){return new e({type:"boolean",...De(t)})}function CZ(e){return new e({type:"unknown"})}function OZ(e,t){return new e({type:"never",...De(t)})}function nE(e,t){return new ND({check:"less_than",...De(t),value:e,inclusive:!1})}function wb(e,t){return new ND({check:"less_than",...De(t),value:e,inclusive:!0})}function rE(e,t){return new CD({check:"greater_than",...De(t),value:e,inclusive:!1})}function Sb(e,t){return new CD({check:"greater_than",...De(t),value:e,inclusive:!0})}function iE(e,t){return new BG({check:"multiple_of",...De(t),value:e})}function TD(e,t){return new FG({check:"max_length",...De(t),maximum:e})}function vm(e,t){return new KG({check:"min_length",...De(t),minimum:e})}function PD(e,t){return new HG({check:"length_equals",...De(t),length:e})}function _Z(e,t){return new GG({check:"string_format",format:"regex",...De(t),pattern:e})}function kZ(e){return new VG({check:"string_format",format:"lowercase",...De(e)})}function AZ(e){return new ZG({check:"string_format",format:"uppercase",...De(e)})}function EZ(e,t){return new YG({check:"string_format",format:"includes",...De(t),includes:e})}function TZ(e,t){return new WG({check:"string_format",format:"starts_with",...De(t),prefix:e})}function PZ(e,t){return new QG({check:"string_format",format:"ends_with",...De(t),suffix:e})}function Vc(e){return new XG({check:"overwrite",tx:e})}function zZ(e){return Vc(t=>t.normalize(e))}function MZ(){return Vc(e=>e.trim())}function RZ(){return Vc(e=>e.toLowerCase())}function DZ(){return Vc(e=>e.toUpperCase())}function IZ(){return Vc(e=>G7(e))}function LZ(e,t,n){return new e({type:"array",element:t,...De(n)})}function $Z(e,t,n){return new e({type:"custom",check:"custom",fn:t,...De(n)})}function UZ(e){const t=BZ(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Ud(r,n.value,t._zod.def));else{const i=r;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(Ud(i))}},e(n.value,n)));return t}function BZ(e,t){const n=new wr({check:"custom",...De(t)});return n._zod.check=e,n}function zD(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??xd,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function fn(e,t,n={path:[],schemaPath:[]}){var r;const i=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const l={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,l);const c=e._zod.toJSONSchema?.();if(c)l.schema=c;else{const p={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,p);else{const v=l.schema,y=t.processors[i.type];if(!y)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);y(e,t,v,p)}const g=e._zod.parent;g&&(l.ref||(l.ref=g),fn(g,t,p),t.seen.get(g).isParent=!0)}const f=t.metadataRegistry.get(e);return f&&Object.assign(l.schema,f),t.io==="input"&&Jn(e)&&(delete l.schema.examples,delete l.schema.default),t.io==="input"&&l.schema._prefault&&((r=l.schema).default??(r.default=l.schema._prefault)),delete l.schema._prefault,t.seen.get(e).schema}function MD(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const l of e.seen.entries()){const c=e.metadataRegistry.get(l[0])?.id;if(c){const f=r.get(c);if(f&&f!==l[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(c,l[0])}}const i=l=>{const c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const g=e.external.registry.get(l[0])?.id,v=e.external.uri??(w=>w);if(g)return{ref:v(g)};const y=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=y,{defId:y,ref:`${v("__shared")}#/${c}/${y}`}}if(l[1]===n)return{ref:"#"};const h=`#/${c}/`,p=l[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:h+p}},s=l=>{if(l[1].schema.$ref)return;const c=l[1],{ref:f,defId:h}=i(l);c.def={...c.schema},h&&(c.defId=h);const p=c.schema;for(const g in p)delete p[g];p.$ref=f};if(e.cycles==="throw")for(const l of e.seen.entries()){const c=l[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
93
-
94
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const c=l[1];if(t===l[0]){s(l);continue}if(e.external){const h=e.external.registry.get(l[0])?.id;if(t!==l[0]&&h){s(l);continue}}if(e.metadataRegistry.get(l[0])?.id){s(l);continue}if(c.cycle){s(l);continue}if(c.count>1&&e.reused==="ref"){s(l);continue}}}function RD(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=l=>{const c=e.seen.get(l);if(c.ref===null)return;const f=c.def??c.schema,h={...f},p=c.ref;if(c.ref=null,p){r(p);const v=e.seen.get(p),y=v.schema;if(y.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(f.allOf=f.allOf??[],f.allOf.push(y)):Object.assign(f,y),Object.assign(f,h),l._zod.parent===p)for(const S in f)S==="$ref"||S==="allOf"||S in h||delete f[S];if(y.$ref&&v.def)for(const S in f)S==="$ref"||S==="allOf"||S in v.def&&JSON.stringify(f[S])===JSON.stringify(v.def[S])&&delete f[S]}const g=l._zod.parent;if(g&&g!==p){r(g);const v=e.seen.get(g);if(v?.schema.$ref&&(f.$ref=v.schema.$ref,v.def))for(const y in f)y==="$ref"||y==="allOf"||y in v.def&&JSON.stringify(f[y])===JSON.stringify(v.def[y])&&delete f[y]}e.override({zodSchema:l,jsonSchema:f,path:c.path??[]})};for(const l of[...e.seen.entries()].reverse())r(l[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(l)}Object.assign(i,n.def??n.schema);const s=e.external?.defs??{};for(const l of e.seen.entries()){const c=l[1];c.def&&c.defId&&(s[c.defId]=c.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?i.$defs=s:i.definitions=s);try{const l=JSON.parse(JSON.stringify(i));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:ym(t,"input",e.processors),output:ym(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function Jn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Jn(r.element,n);if(r.type==="set")return Jn(r.valueType,n);if(r.type==="lazy")return Jn(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Jn(r.innerType,n);if(r.type==="intersection")return Jn(r.left,n)||Jn(r.right,n);if(r.type==="record"||r.type==="map")return Jn(r.keyType,n)||Jn(r.valueType,n);if(r.type==="pipe")return Jn(r.in,n)||Jn(r.out,n);if(r.type==="object"){for(const i in r.shape)if(Jn(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(Jn(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(Jn(i,n))return!0;return!!(r.rest&&Jn(r.rest,n))}return!1}const qZ=(e,t={})=>n=>{const r=zD({...n,processors:t});return fn(e,r),MD(r,e),RD(r,e)},ym=(e,t,n={})=>r=>{const{libraryOptions:i,target:s}=r??{},l=zD({...i??{},target:s,io:t,processors:n});return fn(e,l),MD(l,e),RD(l,e)},FZ={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},KZ=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:s,maximum:l,format:c,patterns:f,contentEncoding:h}=e._zod.bag;if(typeof s=="number"&&(i.minLength=s),typeof l=="number"&&(i.maxLength=l),c&&(i.format=FZ[c]??c,i.format===""&&delete i.format,c==="time"&&delete i.format),h&&(i.contentEncoding=h),f&&f.size>0){const p=[...f];p.length===1?i.pattern=p[0].source:p.length>1&&(i.allOf=[...p.map(g=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},HZ=(e,t,n,r)=>{const i=n,{minimum:s,maximum:l,format:c,multipleOf:f,exclusiveMaximum:h,exclusiveMinimum:p}=e._zod.bag;typeof c=="string"&&c.includes("int")?i.type="integer":i.type="number",typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=p,i.exclusiveMinimum=!0):i.exclusiveMinimum=p),typeof s=="number"&&(i.minimum=s,typeof p=="number"&&t.target!=="draft-04"&&(p>=s?delete i.minimum:delete i.exclusiveMinimum)),typeof h=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=h,i.exclusiveMaximum=!0):i.exclusiveMaximum=h),typeof l=="number"&&(i.maximum=l,typeof h=="number"&&t.target!=="draft-04"&&(h<=l?delete i.maximum:delete i.exclusiveMaximum)),typeof f=="number"&&(i.multipleOf=f)},GZ=(e,t,n,r)=>{n.type="boolean"},VZ=(e,t,n,r)=>{n.not={}},ZZ=(e,t,n,r)=>{},YZ=(e,t,n,r)=>{const i=e._zod.def,s=hD(i.entries);s.every(l=>typeof l=="number")&&(n.type="number"),s.every(l=>typeof l=="string")&&(n.type="string"),n.enum=s},WZ=(e,t,n,r)=>{const i=e._zod.def,s=[];for(const l of i.values)if(l===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof l=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(l))}else s.push(l);if(s.length!==0)if(s.length===1){const l=s[0];n.type=l===null?"null":typeof l,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[l]:n.const=l}else s.every(l=>typeof l=="number")&&(n.type="number"),s.every(l=>typeof l=="string")&&(n.type="string"),s.every(l=>typeof l=="boolean")&&(n.type="boolean"),s.every(l=>l===null)&&(n.type="null"),n.enum=s},QZ=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},XZ=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},JZ=(e,t,n,r)=>{const i=n,s=e._zod.def,{minimum:l,maximum:c}=e._zod.bag;typeof l=="number"&&(i.minItems=l),typeof c=="number"&&(i.maxItems=c),i.type="array",i.items=fn(s.element,t,{...r,path:[...r.path,"items"]})},eY=(e,t,n,r)=>{const i=n,s=e._zod.def;i.type="object",i.properties={};const l=s.shape;for(const h in l)i.properties[h]=fn(l[h],t,{...r,path:[...r.path,"properties",h]});const c=new Set(Object.keys(l)),f=new Set([...c].filter(h=>{const p=s.shape[h]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));f.size>0&&(i.required=Array.from(f)),s.catchall?._zod.def.type==="never"?i.additionalProperties=!1:s.catchall?s.catchall&&(i.additionalProperties=fn(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},tY=(e,t,n,r)=>{const i=e._zod.def,s=i.inclusive===!1,l=i.options.map((c,f)=>fn(c,t,{...r,path:[...r.path,s?"oneOf":"anyOf",f]}));s?n.oneOf=l:n.anyOf=l},nY=(e,t,n,r)=>{const i=e._zod.def,s=fn(i.left,t,{...r,path:[...r.path,"allOf",0]}),l=fn(i.right,t,{...r,path:[...r.path,"allOf",1]}),c=h=>"allOf"in h&&Object.keys(h).length===1,f=[...c(s)?s.allOf:[s],...c(l)?l.allOf:[l]];n.allOf=f},rY=(e,t,n,r)=>{const i=n,s=e._zod.def;i.type="object";const l=s.keyType,f=l._zod.bag?.patterns;if(s.mode==="loose"&&f&&f.size>0){const p=fn(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const g of f)i.patternProperties[g.source]=p}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=fn(s.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=fn(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const h=l._zod.values;if(h){const p=[...h].filter(g=>typeof g=="string"||typeof g=="number");p.length>0&&(i.required=p)}},iY=(e,t,n,r)=>{const i=e._zod.def,s=fn(i.innerType,t,r),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=i.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},aY=(e,t,n,r)=>{const i=e._zod.def;fn(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType},sY=(e,t,n,r)=>{const i=e._zod.def;fn(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},oY=(e,t,n,r)=>{const i=e._zod.def;fn(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},lY=(e,t,n,r)=>{const i=e._zod.def;fn(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType;let l;try{l=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},cY=(e,t,n,r)=>{const i=e._zod.def,s=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;fn(s,t,r);const l=t.seen.get(e);l.ref=s},uY=(e,t,n,r)=>{const i=e._zod.def;fn(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType,n.readOnly=!0},DD=(e,t,n,r)=>{const i=e._zod.def;fn(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType},dY=ue("ZodISODateTime",(e,t)=>{fV.init(e,t),Kt.init(e,t)});function fY(e){return yZ(dY,e)}const hY=ue("ZodISODate",(e,t)=>{hV.init(e,t),Kt.init(e,t)});function pY(e){return bZ(hY,e)}const mY=ue("ZodISOTime",(e,t)=>{pV.init(e,t),Kt.init(e,t)});function gY(e){return xZ(mY,e)}const vY=ue("ZodISODuration",(e,t)=>{mV.init(e,t),Kt.init(e,t)});function yY(e){return wZ(vY,e)}const bY=(e,t)=>{vD.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>aG(e,n)},flatten:{value:n=>iG(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Ow,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Ow,2)}},isEmpty:{get(){return e.issues.length===0}}})},ui=ue("ZodError",bY,{Parent:Error}),xY=w1(ui),wY=S1(ui),SY=Dg(ui),jY=Ig(ui),NY=lG(ui),CY=cG(ui),OY=uG(ui),_Y=dG(ui),kY=fG(ui),AY=hG(ui),EY=pG(ui),TY=mG(ui),Ft=ue("ZodType",(e,t)=>(qt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ym(e,"input"),output:ym(e,"output")}}),e.toJSONSchema=qZ(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Vs(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>Zs(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>xY(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>SY(e,n,r),e.parseAsync=async(n,r)=>wY(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>jY(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>NY(e,n,r),e.decode=(n,r)=>CY(e,n,r),e.encodeAsync=async(n,r)=>OY(e,n,r),e.decodeAsync=async(n,r)=>_Y(e,n,r),e.safeEncode=(n,r)=>kY(e,n,r),e.safeDecode=(n,r)=>AY(e,n,r),e.safeEncodeAsync=async(n,r)=>EY(e,n,r),e.safeDecodeAsync=async(n,r)=>TY(e,n,r),e.refine=(n,r)=>e.check(CW(n,r)),e.superRefine=n=>e.check(OW(n)),e.overwrite=n=>e.check(Vc(n)),e.optional=()=>oE(e),e.exactOptional=()=>fW(e),e.nullable=()=>lE(e),e.nullish=()=>oE(lE(e)),e.nonoptional=n=>yW(e,n),e.array=()=>Ce(e),e.or=n=>iW([e,n]),e.and=n=>sW(e,n),e.transform=n=>cE(e,uW(n)),e.default=n=>mW(e,n),e.prefault=n=>vW(e,n),e.catch=n=>xW(e,n),e.pipe=n=>cE(e,n),e.readonly=()=>jW(e),e.describe=n=>{const r=e.clone();return xd.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return xd.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return xd.get(e);const r=e.clone();return xd.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),ID=ue("_ZodString",(e,t)=>{j1.init(e,t),Ft.init(e,t),e._zod.processJSONSchema=(r,i,s)=>KZ(e,r,i);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(_Z(...r)),e.includes=(...r)=>e.check(EZ(...r)),e.startsWith=(...r)=>e.check(TZ(...r)),e.endsWith=(...r)=>e.check(PZ(...r)),e.min=(...r)=>e.check(vm(...r)),e.max=(...r)=>e.check(TD(...r)),e.length=(...r)=>e.check(PD(...r)),e.nonempty=(...r)=>e.check(vm(1,...r)),e.lowercase=r=>e.check(kZ(r)),e.uppercase=r=>e.check(AZ(r)),e.trim=()=>e.check(MZ()),e.normalize=(...r)=>e.check(zZ(...r)),e.toLowerCase=()=>e.check(RZ()),e.toUpperCase=()=>e.check(DZ()),e.slugify=()=>e.check(IZ())}),PY=ue("ZodString",(e,t)=>{j1.init(e,t),ID.init(e,t),e.email=n=>e.check(QV(zY,n)),e.url=n=>e.check(nZ(MY,n)),e.jwt=n=>e.check(vZ(YY,n)),e.emoji=n=>e.check(rZ(RY,n)),e.guid=n=>e.check(tE(aE,n)),e.uuid=n=>e.check(XV(dp,n)),e.uuidv4=n=>e.check(JV(dp,n)),e.uuidv6=n=>e.check(eZ(dp,n)),e.uuidv7=n=>e.check(tZ(dp,n)),e.nanoid=n=>e.check(iZ(DY,n)),e.guid=n=>e.check(tE(aE,n)),e.cuid=n=>e.check(aZ(IY,n)),e.cuid2=n=>e.check(sZ(LY,n)),e.ulid=n=>e.check(oZ($Y,n)),e.base64=n=>e.check(pZ(GY,n)),e.base64url=n=>e.check(mZ(VY,n)),e.xid=n=>e.check(lZ(UY,n)),e.ksuid=n=>e.check(cZ(BY,n)),e.ipv4=n=>e.check(uZ(qY,n)),e.ipv6=n=>e.check(dZ(FY,n)),e.cidrv4=n=>e.check(fZ(KY,n)),e.cidrv6=n=>e.check(hZ(HY,n)),e.e164=n=>e.check(gZ(ZY,n)),e.datetime=n=>e.check(fY(n)),e.date=n=>e.check(pY(n)),e.time=n=>e.check(gY(n)),e.duration=n=>e.check(yY(n))});function I(e){return WV(PY,e)}const Kt=ue("ZodStringFormat",(e,t)=>{Lt.init(e,t),ID.init(e,t)}),zY=ue("ZodEmail",(e,t)=>{rV.init(e,t),Kt.init(e,t)}),aE=ue("ZodGUID",(e,t)=>{tV.init(e,t),Kt.init(e,t)}),dp=ue("ZodUUID",(e,t)=>{nV.init(e,t),Kt.init(e,t)}),MY=ue("ZodURL",(e,t)=>{iV.init(e,t),Kt.init(e,t)}),RY=ue("ZodEmoji",(e,t)=>{aV.init(e,t),Kt.init(e,t)}),DY=ue("ZodNanoID",(e,t)=>{sV.init(e,t),Kt.init(e,t)}),IY=ue("ZodCUID",(e,t)=>{oV.init(e,t),Kt.init(e,t)}),LY=ue("ZodCUID2",(e,t)=>{lV.init(e,t),Kt.init(e,t)}),$Y=ue("ZodULID",(e,t)=>{cV.init(e,t),Kt.init(e,t)}),UY=ue("ZodXID",(e,t)=>{uV.init(e,t),Kt.init(e,t)}),BY=ue("ZodKSUID",(e,t)=>{dV.init(e,t),Kt.init(e,t)}),qY=ue("ZodIPv4",(e,t)=>{gV.init(e,t),Kt.init(e,t)}),FY=ue("ZodIPv6",(e,t)=>{vV.init(e,t),Kt.init(e,t)}),KY=ue("ZodCIDRv4",(e,t)=>{yV.init(e,t),Kt.init(e,t)}),HY=ue("ZodCIDRv6",(e,t)=>{bV.init(e,t),Kt.init(e,t)}),GY=ue("ZodBase64",(e,t)=>{xV.init(e,t),Kt.init(e,t)}),VY=ue("ZodBase64URL",(e,t)=>{SV.init(e,t),Kt.init(e,t)}),ZY=ue("ZodE164",(e,t)=>{jV.init(e,t),Kt.init(e,t)}),YY=ue("ZodJWT",(e,t)=>{CV.init(e,t),Kt.init(e,t)}),LD=ue("ZodNumber",(e,t)=>{_D.init(e,t),Ft.init(e,t),e._zod.processJSONSchema=(r,i,s)=>HZ(e,r,i),e.gt=(r,i)=>e.check(rE(r,i)),e.gte=(r,i)=>e.check(Sb(r,i)),e.min=(r,i)=>e.check(Sb(r,i)),e.lt=(r,i)=>e.check(nE(r,i)),e.lte=(r,i)=>e.check(wb(r,i)),e.max=(r,i)=>e.check(wb(r,i)),e.int=r=>e.check(sE(r)),e.safe=r=>e.check(sE(r)),e.positive=r=>e.check(rE(0,r)),e.nonnegative=r=>e.check(Sb(0,r)),e.negative=r=>e.check(nE(0,r)),e.nonpositive=r=>e.check(wb(0,r)),e.multipleOf=(r,i)=>e.check(iE(r,i)),e.step=(r,i)=>e.check(iE(r,i)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Me(e){return SZ(LD,e)}const WY=ue("ZodNumberFormat",(e,t)=>{OV.init(e,t),LD.init(e,t)});function sE(e){return jZ(WY,e)}const QY=ue("ZodBoolean",(e,t)=>{_V.init(e,t),Ft.init(e,t),e._zod.processJSONSchema=(n,r,i)=>GZ(e,n,r)});function Bt(e){return NZ(QY,e)}const XY=ue("ZodUnknown",(e,t)=>{kV.init(e,t),Ft.init(e,t),e._zod.processJSONSchema=(n,r,i)=>ZZ()});function bm(){return CZ(XY)}const JY=ue("ZodNever",(e,t)=>{AV.init(e,t),Ft.init(e,t),e._zod.processJSONSchema=(n,r,i)=>VZ(e,n,r)});function eW(e){return OZ(JY,e)}const tW=ue("ZodArray",(e,t)=>{EV.init(e,t),Ft.init(e,t),e._zod.processJSONSchema=(n,r,i)=>JZ(e,n,r,i),e.element=t.element,e.min=(n,r)=>e.check(vm(n,r)),e.nonempty=n=>e.check(vm(1,n)),e.max=(n,r)=>e.check(TD(n,r)),e.length=(n,r)=>e.check(PD(n,r)),e.unwrap=()=>e.element});function Ce(e,t){return LZ(tW,e,t)}const nW=ue("ZodObject",(e,t)=>{PV.init(e,t),Ft.init(e,t),e._zod.processJSONSchema=(n,r,i)=>eY(e,n,r,i),gt(e,"shape",()=>t.shape),e.keyof=()=>Tt(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:bm()}),e.loose=()=>e.clone({...e._zod.def,catchall:bm()}),e.strict=()=>e.clone({...e._zod.def,catchall:eW()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>J7(e,n),e.safeExtend=n=>eG(e,n),e.merge=n=>tG(e,n),e.pick=n=>Q7(e,n),e.omit=n=>X7(e,n),e.partial=(...n)=>nG($D,e,n[0]),e.required=(...n)=>rG(UD,e,n[0])});function Ne(e,t){const n={type:"object",shape:e??{},...De(t)};return new nW(n)}const rW=ue("ZodUnion",(e,t)=>{zV.init(e,t),Ft.init(e,t),e._zod.processJSONSchema=(n,r,i)=>tY(e,n,r,i),e.options=t.options});function iW(e,t){return new rW({type:"union",options:e,...De(t)})}const aW=ue("ZodIntersection",(e,t)=>{MV.init(e,t),Ft.init(e,t),e._zod.processJSONSchema=(n,r,i)=>nY(e,n,r,i)});function sW(e,t){return new aW({type:"intersection",left:e,right:t})}const oW=ue("ZodRecord",(e,t)=>{RV.init(e,t),Ft.init(e,t),e._zod.processJSONSchema=(n,r,i)=>rY(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function lf(e,t,n){return new oW({type:"record",keyType:e,valueType:t,...De(n)})}const kw=ue("ZodEnum",(e,t)=>{DV.init(e,t),Ft.init(e,t),e._zod.processJSONSchema=(r,i,s)=>YZ(e,r,i),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{const s={};for(const l of r)if(n.has(l))s[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new kw({...t,checks:[],...De(i),entries:s})},e.exclude=(r,i)=>{const s={...t.entries};for(const l of r)if(n.has(l))delete s[l];else throw new Error(`Key ${l} not found in enum`);return new kw({...t,checks:[],...De(i),entries:s})}});function Tt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new kw({type:"enum",entries:n,...De(t)})}const lW=ue("ZodLiteral",(e,t)=>{IV.init(e,t),Ft.init(e,t),e._zod.processJSONSchema=(n,r,i)=>WZ(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Bd(e,t){return new lW({type:"literal",values:Array.isArray(e)?e:[e],...De(t)})}const cW=ue("ZodTransform",(e,t)=>{LV.init(e,t),Ft.init(e,t),e._zod.processJSONSchema=(n,r,i)=>XZ(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new dD(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Ud(s,n.value,t));else{const l=s;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(Ud(l))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(s=>(n.value=s,n)):(n.value=i,n)}});function uW(e){return new cW({type:"transform",transform:e})}const $D=ue("ZodOptional",(e,t)=>{ED.init(e,t),Ft.init(e,t),e._zod.processJSONSchema=(n,r,i)=>DD(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function oE(e){return new $D({type:"optional",innerType:e})}const dW=ue("ZodExactOptional",(e,t)=>{$V.init(e,t),Ft.init(e,t),e._zod.processJSONSchema=(n,r,i)=>DD(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function fW(e){return new dW({type:"optional",innerType:e})}const hW=ue("ZodNullable",(e,t)=>{UV.init(e,t),Ft.init(e,t),e._zod.processJSONSchema=(n,r,i)=>iY(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function lE(e){return new hW({type:"nullable",innerType:e})}const pW=ue("ZodDefault",(e,t)=>{BV.init(e,t),Ft.init(e,t),e._zod.processJSONSchema=(n,r,i)=>sY(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function mW(e,t){return new pW({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():mD(t)}})}const gW=ue("ZodPrefault",(e,t)=>{qV.init(e,t),Ft.init(e,t),e._zod.processJSONSchema=(n,r,i)=>oY(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function vW(e,t){return new gW({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():mD(t)}})}const UD=ue("ZodNonOptional",(e,t)=>{FV.init(e,t),Ft.init(e,t),e._zod.processJSONSchema=(n,r,i)=>aY(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function yW(e,t){return new UD({type:"nonoptional",innerType:e,...De(t)})}const bW=ue("ZodCatch",(e,t)=>{KV.init(e,t),Ft.init(e,t),e._zod.processJSONSchema=(n,r,i)=>lY(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function xW(e,t){return new bW({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const wW=ue("ZodPipe",(e,t)=>{HV.init(e,t),Ft.init(e,t),e._zod.processJSONSchema=(n,r,i)=>cY(e,n,r,i),e.in=t.in,e.out=t.out});function cE(e,t){return new wW({type:"pipe",in:e,out:t})}const SW=ue("ZodReadonly",(e,t)=>{GV.init(e,t),Ft.init(e,t),e._zod.processJSONSchema=(n,r,i)=>uY(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function jW(e){return new SW({type:"readonly",innerType:e})}const NW=ue("ZodCustom",(e,t)=>{VV.init(e,t),Ft.init(e,t),e._zod.processJSONSchema=(n,r,i)=>QZ(e,n)});function CW(e,t={}){return $Z(NW,e,t)}function OW(e){return UZ(e)}Ne({maxConcurrency:Me().int().positive(),maxRequestsPerMinute:Me().int().positive(),maxRequestsPerDay:Me().int().positive()});const Zc=I().min(1);I().min(1);const N1=Ne({label:I().min(1),city:I().min(1),region:I().min(1),country:I().length(2),timezone:I().optional()}),BD=Tt(["citation.lost","citation.gained","run.completed","run.failed"]);Ne({id:I(),projectId:I(),channel:Bd("webhook"),url:I().url(),urlDisplay:I(),urlHost:I(),events:Ce(BD),enabled:Bt().default(!0),webhookSecret:I().optional(),createdAt:I(),updatedAt:I()});const qD=Tt(["cli","api","config-file"]);function _W(e){const t=new Set,n=new Set;for(const r of e){if(t.has(r.label)){n.add(r.label);continue}t.add(r.label)}return[...n]}function kW(e,t){return t?e.some(n=>n.label===t):!0}Ne({displayName:I().min(1),canonicalDomain:I().min(1),ownedDomains:Ce(I().min(1)).optional(),country:I().length(2),language:I().min(2),tags:Ce(I()).optional(),labels:lf(I(),I()).optional(),providers:Ce(Zc).optional(),locations:Ce(N1).optional(),defaultLocation:I().nullable().optional(),configSource:qD.optional()});Ne({id:I(),name:I(),displayName:I().optional(),canonicalDomain:I(),ownedDomains:Ce(I()).default([]),country:I().length(2),language:I().min(2),tags:Ce(I()).default([]),labels:lf(I(),I()).default({}),locations:Ce(N1).default([]),defaultLocation:I().nullable().optional(),configSource:qD.default("cli"),configRevision:Me().int().positive().default(1),createdAt:I().optional(),updatedAt:I().optional()});function Aw(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}function AW(e){const t=[e.canonicalDomain,...e.ownedDomains??[]],n=new Set,r=[];for(const i of t){const s=i.trim();if(!s)continue;const l=Aw(s);n.has(l)||(n.add(l),r.push(s))}return r}const EW=Ne({name:I().min(1).max(63).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/,{message:"Name must be a lowercase slug (letters, numbers, hyphens)"}),labels:lf(I(),I()).optional().default({})}),TW=Ne({preset:I().optional(),cron:I().optional(),timezone:I().optional().default("UTC"),providers:Ce(Zc).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),PW=Ne({channel:Bd("webhook"),url:I().url(),events:Ce(BD).min(1)}),zW=Ne({gsc:Ne({propertyUrl:I()}).optional(),syncSchedule:Ne({preset:I().optional(),cron:I().optional()}).optional()}).optional(),MW=Ne({displayName:I().min(1),canonicalDomain:I().min(1),ownedDomains:Ce(I().min(1)).optional().default([]),country:I().length(2),language:I().min(2),keywords:Ce(I().min(1)).optional().default([]),competitors:Ce(I().min(1)).optional().default([]),providers:Ce(Zc).optional().default([]),locations:Ce(N1).optional().default([]),defaultLocation:I().optional(),schedule:TW,notifications:Ce(PW).optional().default([]),google:zW}).superRefine((e,t)=>{const n=_W(e.locations);n.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${n.join(", ")}`,path:["locations"]}),kW(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});Ne({apiVersion:Bd("canonry/v1"),kind:Bd("Project"),metadata:EW,spec:MW});const RW=Tt(["gsc","ga4"]);Ne({id:I(),domain:I(),connectionType:RW,propertyId:I().nullable().optional(),sitemapUrl:I().nullable().optional(),scopes:Ce(I()).default([]),createdAt:I(),updatedAt:I()});Ne({date:I(),query:I(),page:I(),country:I().nullable().optional(),device:I().nullable().optional(),clicks:Me(),impressions:Me(),ctr:Me(),position:Me()});const Ew=Ne({id:I(),url:I(),indexingState:I().nullable().optional(),verdict:I().nullable().optional(),coverageState:I().nullable().optional(),pageFetchState:I().nullable().optional(),robotsTxtState:I().nullable().optional(),crawlTime:I().nullable().optional(),lastCrawlResult:I().nullable().optional(),isMobileFriendly:Bt().nullable().optional(),richResults:Ce(I()).default([]),inspectedAt:I()});Tt(["stable","reindexed","deindexed","still-missing","new"]);const DW=Ne({url:I(),previousState:I().nullable(),currentState:I().nullable(),transitionDate:I()}),IW=Ne({reason:I(),count:Me(),urls:Ce(Ew).default([])});Ne({summary:Ne({total:Me(),indexed:Me(),notIndexed:Me(),deindexed:Me(),percentage:Me()}),lastInspectedAt:I().nullable(),indexed:Ce(Ew).default([]),notIndexed:Ce(Ew).default([]),deindexed:Ce(DW).default([]),reasonGroups:Ce(IW).default([])});Ne({url:I(),type:Tt(["URL_UPDATED","URL_DELETED"]),notifiedAt:I()});Ne({url:I(),type:Tt(["URL_UPDATED","URL_DELETED"]),notifiedAt:I(),status:Tt(["success","error"]),error:I().optional()});Ne({date:I(),indexed:Me(),notIndexed:Me(),reasonBreakdown:lf(I(),Me()).default({})});Ne({id:I(),domain:I(),siteUrl:I().nullable().optional(),createdAt:I(),updatedAt:I()});const jb=Ne({id:I(),url:I(),httpCode:Me().nullable().optional(),inIndex:Bt().nullable().optional(),lastCrawledDate:I().nullable().optional(),inIndexDate:I().nullable().optional(),inspectedAt:I(),documentSize:Me().nullable().optional(),anchorCount:Me().nullable().optional(),discoveryDate:I().nullable().optional()});Ne({summary:Ne({total:Me(),indexed:Me(),notIndexed:Me(),unknown:Me().optional(),percentage:Me()}),lastInspectedAt:I().nullable(),indexed:Ce(jb).default([]),notIndexed:Ce(jb).default([]),unknown:Ce(jb).default([]).optional()});Ne({query:I(),impressions:Me(),clicks:Me(),ctr:Me(),averagePosition:Me()});Ne({url:I(),status:Tt(["success","error"]),submittedAt:I(),error:I().optional()});const Yc=Tt(["live","staging"]);Ne({projectName:I(),url:I(),stagingUrl:I().optional(),username:I(),defaultEnv:Yc,createdAt:I(),updatedAt:I()});const uE=Ne({url:I(),reachable:Bt(),pageCount:Me().nullable().optional(),version:I().nullable().optional(),error:I().nullable().optional(),plugins:Ce(I()).optional(),authenticatedUser:Ne({id:Me(),slug:I()}).nullable().optional()});Ne({connected:Bt(),projectName:I(),defaultEnv:Yc,live:uE.nullable(),staging:uE.nullable(),adminUrl:I().nullable().optional()});const LW=Ne({id:Me(),slug:I(),title:I(),status:I(),modifiedAt:I().nullable().optional(),link:I().nullable().optional()}),FD=Ne({title:I().nullable(),description:I().nullable(),noindex:Bt().nullable(),writable:Bt().default(!1),writeTargets:Ce(I()).default([])}),$W=Ne({type:I(),json:lf(I(),bm())}),UW=LW.extend({env:Yc,content:I(),seo:FD,schemaBlocks:Ce($W).default([])}),dE=UW.extend({contentHash:I(),contentSnippet:I()}),KD=Ne({manualRequired:Bd(!0),targetUrl:I(),adminUrl:I().nullable().optional(),content:I(),nextSteps:Ce(I()).default([])}),BW=Ne({slug:I(),severity:Tt(["high","medium","low"]),code:Tt(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:I()});Ne({slug:I(),title:I(),status:I(),wordCount:Me(),seo:FD,schemaPresent:Bt(),issues:Ce(BW).default([])});const qW=Ne({slug:I(),status:Tt(["applied","skipped","manual"]),error:I().optional(),manualAssist:KD.optional()});Ne({env:Yc,strategy:Tt(["plugin","manual"]),results:Ce(qW)});const FW=Ne({slug:I(),status:Tt(["deployed","stripped","skipped","failed"]),schemasInjected:Ce(I()).optional(),manualAssist:KD.optional(),error:I().optional()});Ne({env:Yc,results:Ce(FW)});const KW=Ne({slug:I(),title:I(),canonrySchemas:Ce(I()),thirdPartySchemas:Ce(I()),hasCanonrySchema:Bt()});Ne({env:Yc,pages:Ce(KW)});const HW=Ne({name:I(),status:Tt(["completed","skipped","failed"]),summary:I().optional(),error:I().optional()});Ne({projectName:I(),steps:Ce(HW)});Ne({slug:I(),live:dE,staging:dE,hasDifferences:Bt(),differences:Ne({title:Bt(),slug:Bt(),content:Bt(),seoTitle:Bt(),seoDescription:Bt(),noindex:Bt(),schema:Bt()})});const HD=Tt(["queued","running","completed","partial","failed","cancelled"]),Xt=HD.enum,GD=Tt(["answer-visibility","site-audit","gsc-sync","inspect-sitemap"]),Xr=GD.enum,VD=Tt(["manual","scheduled","config-apply"]),Fp=VD.enum,ZD=Tt(["cited","not-cited"]);ZD.enum;const YD=Tt(["visible","not-visible"]);YD.enum;const WD=Tt(["new","cited","lost","emerging","not-cited"]);WD.enum;Ne({id:I(),projectId:I(),kind:GD,status:HD,trigger:VD.default("manual"),location:I().nullable().optional(),startedAt:I().nullable().optional(),finishedAt:I().nullable().optional(),error:I().nullable().optional(),createdAt:I()});const QD=Ne({uri:I(),title:I()});Ne({id:I(),runId:I(),keywordId:I(),keyword:I().optional(),provider:Zc,citationState:ZD,answerMentioned:Bt().optional(),visibilityState:YD.optional(),transition:WD.optional(),answerText:I().nullable().optional(),citedDomains:Ce(I()).default([]),competitorOverlap:Ce(I()).default([]),recommendedCompetitors:Ce(I()).default([]),matchedTerms:Ce(I()).default([]),groundingSources:Ce(QD).default([]),searchQueries:Ce(I()).default([]),model:I().nullable().optional(),location:I().nullable().optional(),createdAt:I()});Ne({id:I(),projectId:I().nullable().optional(),actor:I(),action:I(),entityType:I(),entityId:I().nullable().optional(),diff:bm().optional(),createdAt:I()});const GW=Tt(["yes","no","unknown","not-mentioned"]);Ne({companyName:I().min(1),domain:I().min(1),phrases:Ce(I().min(1)).optional().default([]),competitors:Ce(I().min(1)).optional().default([])});const VW=Ne({name:I(),count:Me().int().nonnegative()}),ZW=Ne({id:I(),name:I(),weight:Me(),score:Me(),grade:I(),status:Tt(["pass","partial","fail"]),findings:Ce(Ne({type:I(),message:I()})).default([]),recommendations:Ce(I()).default([])}),YW=Ne({url:I(),finalUrl:I(),auditedAt:I(),overallScore:Me(),overallGrade:I(),summary:I(),factors:Ce(ZW).default([])}),WW=Ne({industry:I(),summary:I(),services:Ce(I()).default([]),categoryTerms:Ce(I()).default([])}),QW=Ne({provider:I(),displayName:I(),model:I().nullable().optional(),mentioned:Bt(),cited:Bt(),describedAccurately:GW,accuracyNotes:I().nullable().optional(),incorrectClaims:Ce(I()).default([]),recommendedCompetitors:Ce(I()).default([]),citedDomains:Ce(I()).default([]),groundingSources:Ce(QD).default([]),searchQueries:Ce(I()).default([]),answerText:I(),error:I().nullable().optional()}),XW=Ne({phrase:I(),providerResults:Ce(QW).default([])}),JW=Ne({totalQueries:Me().int().nonnegative(),totalProviders:Me().int().nonnegative(),totalComparisons:Me().int().nonnegative(),mentionCount:Me().int().nonnegative(),citationCount:Me().int().nonnegative(),topCompetitors:Ce(VW).default([]),visibilityGap:I(),whatThisMeans:Ce(I()).default([]),recommendedActions:Ce(I()).default([])});Ne({companyName:I(),domain:I(),homepageUrl:I(),generatedAt:I(),phrases:Ce(I()).default([]),competitors:Ce(I()).default([]),profile:WW,audit:YW,queryResults:Ce(XW).default([]),summary:JW});Ne({id:I(),projectId:I(),cronExpr:I(),preset:I().nullable().optional(),timezone:I().default("UTC"),enabled:Bt().default(!0),providers:Ce(Zc).default([]),lastRunAt:I().nullable().optional(),nextRunAt:I().nullable().optional(),createdAt:I(),updatedAt:I()});Ne({preset:I().optional(),cron:I().optional(),timezone:I().optional().default("UTC"),enabled:Bt().optional().default(!0),providers:Ce(Zc).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});Ne({id:I(),projectId:I(),propertyId:I(),clientEmail:I(),connected:Bt(),createdAt:I(),updatedAt:I()});Ne({date:I(),landingPage:I(),sessions:Me(),organicSessions:Me(),users:Me()});const XD=Tt(["session","first_user","manual_utm"]),eQ=Ne({source:I(),medium:I(),sessions:Me(),users:Me(),sourceDimension:XD});Ne({totalSessions:Me(),totalOrganicSessions:Me(),totalUsers:Me(),topPages:Ce(Ne({landingPage:I(),sessions:Me(),organicSessions:Me(),users:Me()})),aiReferrals:Ce(eQ),aiSessionsDeduped:Me(),aiUsersDeduped:Me(),lastSyncedAt:I().nullable()});Ne({date:I(),source:I(),medium:I(),sessions:Me(),users:Me(),sourceDimension:XD});Ne({date:I(),sessions:Me(),organicSessions:Me(),users:Me()});function fE(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}function Vn({text:e}){const[t,n]=x.useState(null),r=x.useRef(null),i=x.useCallback(()=>{if(!r.current)return;const l=r.current.getBoundingClientRect();n({top:l.top,left:l.left+l.width/2})},[]),s=x.useCallback(()=>n(null),[]);return u.jsxs("span",{className:"info-tooltip-wrapper",onMouseEnter:i,onMouseLeave:s,onFocus:i,onBlur:s,children:[u.jsxs("svg",{ref:r,className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[u.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),u.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),t!==null&&ol.createPortal(u.jsx("span",{role:"tooltip",style:{position:"fixed",top:t.top,left:t.left,transform:"translateX(-50%) translateY(calc(-100% - 8px))",zIndex:9999,pointerEvents:"none",width:"14rem",padding:"0.5rem 0.75rem",fontSize:"11px",fontWeight:400,textTransform:"none",letterSpacing:"normal",lineHeight:"1rem",color:"#d4d4d8",backgroundColor:"#18181b",border:"1px solid rgba(63, 63, 70, 0.6)",borderRadius:"0.5rem",boxShadow:"0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1)"},children:e}),document.body)]})}function hE(e,t){const n=tQ(t),r=e.split(/(\*\*[^*]+\*\*)/).filter(Boolean).map(h=>h.startsWith("**")&&h.endsWith("**")?{type:"bold",value:h.slice(2,-2)}:{type:"text",value:h}),i=n.flatMap(h=>h.terms).filter(h=>h.trim().length>1);if(i.length===0)return r.map((h,p)=>h.type==="bold"?bi.createElement("strong",{key:`b-${p}`,className:"text-zinc-200 font-semibold"},h.value):h.value).filter(Boolean);const l=[...i].sort((h,p)=>p.length-h.length).map(h=>h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),c=new RegExp(`(${l.join("|")})`,"gi"),f=new Map;for(const h of n)for(const p of h.terms){const g=p.toLowerCase();f.has(g)||f.set(g,h.className)}return r.flatMap((h,p)=>h.value.split(c).map((v,y)=>{if(!v)return null;if(y%2===1){const S=f.get(v.toLowerCase())??"answer-highlight";return h.type==="bold"?bi.createElement("mark",{key:`hl-${p}-${y}`,className:S},bi.createElement("strong",{className:"text-zinc-200 font-semibold"},v)):bi.createElement("mark",{key:`hl-${p}-${y}`,className:S},v)}return h.type==="bold"?bi.createElement("strong",{key:`b-${p}-${y}`,className:"text-zinc-200 font-semibold"},v):v})).filter(Boolean)}function tQ(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function Nb(e,t){switch(e){case"new":return"First observation";case"emerging":return"First visibility";case"lost":return"Lost since last run";default:return t==="visible"?"Visible in latest run":t==="pending"?"Awaiting first run":"Not visible in latest run"}}function nQ({evidence:e,project:t,onClose:n}){const[r,i]=x.useState(!1),[s,l]=x.useState("mentions"),[c,f]=x.useState(-1),[h,p]=x.useState(null),[g,v]=x.useState(!1),[y,w]=x.useState({}),S=AW(t.project),N=new Set(S.map(Aw)),C=e.runHistory,E=C.length>1,[k,O]=x.useState(null),T=x.useRef(!1);x.useEffect(()=>{if(T.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const W=C.at(-1);W&&(T.current=!0,Pc(W.runId).then(X=>{const Q=X.snapshots.find(de=>de.keyword===e.keyword&&de.provider===e.provider);Q&&O({citationState:Q.citationState,answerMentioned:Q.answerMentioned,visibilityState:Q.visibilityState,visibilityTransition:W.visibilityTransition,provider:Q.provider,model:Q.model??e.model,answerSnippet:Q.answerText??e.answerSnippet,citedDomains:Q.citedDomains??e.citedDomains,competitorDomains:Q.competitorOverlap??e.competitorDomains,recommendedCompetitors:Q.recommendedCompetitors??e.recommendedCompetitors??[],matchedTerms:Q.matchedTerms??e.matchedTerms??[],groundingSources:Q.groundingSources??e.groundingSources,evidenceUrls:[],changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,C]);const P=c>=0&&h!==null,A=P?h:k||{citationState:e.citationState,answerMentioned:e.answerMentioned,visibilityState:e.visibilityState,visibilityTransition:C.at(-1)?.visibilityTransition,provider:e.provider,model:e.model,answerSnippet:e.answerSnippet,citedDomains:e.citedDomains,competitorDomains:e.competitorDomains,recommendedCompetitors:e.recommendedCompetitors??[],matchedTerms:e.matchedTerms??[],groundingSources:e.groundingSources,evidenceUrls:e.evidenceUrls,changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary},z=A.visibilityState==="pending"||A.citationState==="pending",R=z?!1:A.visibilityState!=null?A.visibilityState==="visible":A.answerMentioned!=null?A.answerMentioned:A.citationState==="cited"||A.citationState==="emerging",q=A.answerMentioned!=null||A.visibilityState!=null||A.recommendedCompetitors.length>0,U=A.citedDomains.length>0||A.groundingSources.length>0||A.evidenceUrls.length>0,L=t.project.displayName||t.project.name,ae=[...S.map(Aw),L,L.split(" ").slice(0,2).join(" "),...A.matchedTerms].filter(W=>W.trim().length>2),pe=[...A.competitorDomains.flatMap(W=>{const X=W.split(".")[0];return X&&X.length>=4?[X]:[]}),...A.recommendedCompetitors].filter(W=>W.trim().length>2),ge=[{terms:ae,className:"answer-highlight-brand"},...pe.length>0?[{terms:pe,className:"answer-highlight-competitor"}]:[]],V=z?"pending":A.visibilityTransition==="lost"?"lost":R?"cited":"not-cited",re=x.useRef(0),ve=x.useCallback(async W=>{const X=++re.current;if(W===-1||W===C.length-1){f(-1),p(null),i(!1);return}f(W),i(!1);const Q=C[W],de=`${Q.runId}::${e.keyword}::${e.provider}`;if(y[de]){p(y[de]);return}v(!0);try{const ye=await Pc(Q.runId);if(X!==re.current)return;const Z=ye.snapshots.find(Se=>Se.keyword===e.keyword&&Se.provider===e.provider)??ye.snapshots.find(Se=>Se.keyword===e.keyword),le=Z?{citationState:Z.citationState,answerMentioned:Z.answerMentioned,visibilityState:Z.visibilityState,visibilityTransition:Q.visibilityTransition,provider:Z.provider,model:Z.model??null,answerSnippet:Z.answerText??"",citedDomains:Z.citedDomains,competitorDomains:Z.competitorOverlap,recommendedCompetitors:Z.recommendedCompetitors??[],matchedTerms:Z.matchedTerms??[],groundingSources:Z.groundingSources,evidenceUrls:[],changeLabel:Nb(Q.visibilityTransition,Q.visibilityState),summary:""}:{citationState:Q.citationState,answerMentioned:Q.answerMentioned,visibilityState:Q.visibilityState,visibilityTransition:Q.visibilityTransition,provider:e.provider,model:Q.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:Nb(Q.visibilityTransition,Q.visibilityState),summary:"Snapshot data not available for this run."};w(Se=>({...Se,[de]:le})),p(le)}catch{if(X!==re.current)return;p({citationState:Q.citationState,answerMentioned:Q.answerMentioned,visibilityState:Q.visibilityState,visibilityTransition:Q.visibilityTransition,provider:e.provider,model:Q.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:Nb(Q.visibilityTransition,Q.visibilityState),summary:"Failed to load historical run data."})}finally{X===re.current&&v(!1)}},[C,e.keyword,e.provider,y]),B=(P||e.historyScope!=="provider")&&A.model?`${A.provider} (${A.model}) · ${A.changeLabel.toLowerCase()}`:`${A.provider} · ${A.changeLabel.toLowerCase()}`,D=!P&&e.historyScope==="provider"?[e.model?`Current model: ${e.model}`:null,e.modelsSeen&&e.modelsSeen.length>1?`History spans ${e.modelsSeen.length} models`:null].filter(Boolean).join(" · "):"",G=R?{label:"Visible in answer",title:"Your brand or domain is mentioned in this answer",meta:B}:A.visibilityTransition==="lost"?{label:"Visibility lost",title:"Your brand no longer appears in this answer",meta:B}:z?{label:"Pending",title:"Awaiting first visibility run",meta:"No provider data yet"}:{label:"Not visible in answer",title:"Your brand or domain was not mentioned in this answer",meta:B},oe=()=>{if(!A.answerSnippet)return null;const W=A.answerSnippet.split(`
95
- `),X=[];let Q=[],de=0;const ye=()=>{if(Q.length===0)return;const Z=Q.join(" ").trim();Z&&X.push(u.jsx("p",{className:X.length>0?"mt-2.5":"",children:hE(Z,ge)},de++)),Q=[]};for(const Z of W){const le=Z.trim();if(/^[-\u2013\u2014]{3,}$/.test(le)){ye(),X.push(u.jsx("hr",{className:"border-zinc-800/60 my-3"},de++));continue}const Se=le.match(/^(#{1,3})\s+(.+)$/);if(Se){ye();const F=Se[1].length,Ae=Se[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||Se[2],Oe=F===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":F===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";X.push(u.jsx("p",{className:Oe,children:hE(Ae,ge)},de++));continue}if(le===""){ye();continue}Q.push(le)}return ye(),X};return u.jsx(rD,{open:!0,onOpenChange:W=>{W||n()},children:u.jsxs(iD,{children:[u.jsx(p1,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),u.jsxs(m1,{className:"evidence-modal","aria-describedby":void 0,children:[u.jsxs("div",{className:"evidence-modal-header",children:[u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("p",{className:"eyebrow eyebrow-soft",children:[t.project.name," ","·"," ",A.provider||"All providers"]}),u.jsx(g1,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.keyword})]}),u.jsxs(sD,{className:"inline-flex size-8 items-center justify-center rounded-md text-zinc-500 transition hover:bg-zinc-800 hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 shrink-0",children:[u.jsx(kg,{className:"size-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]}),E&&u.jsxs("div",{className:"evidence-modal-timeline",children:[u.jsx("p",{className:"drawer-section-label mb-1.5",children:"Run history"}),u.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:C.map((W,X)=>{const Q=c===-1&&X===C.length-1||c===X,de=W.visibilityState??(W.answerMentioned?"visible":"not-visible"),ye=W.visibilityTransition??de,Z=de==="visible"?"bg-emerald-400":ye==="emerging"?"bg-amber-400":ye==="lost"?"bg-rose-400":"bg-zinc-600",Se=new Date(W.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),F=!!(W.model&&X>0&&C[X-1]?.model&&C[X-1].model!==W.model);return u.jsxs("button",{type:"button",className:`evidence-run-dot ${Q?"evidence-run-dot--selected":""}`,onClick:()=>ve(X===C.length-1?-1:X),"aria-label":[`Run ${Se}: ${de}`,W.model?`model ${W.model}`:null,F?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":Q,children:[u.jsx("span",{className:`size-2 rounded-full ${Z} ${F?"ring-1 ring-amber-300/80 ring-offset-2 ring-offset-zinc-950":""}`,"aria-hidden":"true"}),u.jsx("span",{className:"text-[10px] text-zinc-500",children:Se})]},X)})}),c>=0&&c<C.length&&u.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(C[c].createdAt).toLocaleString()," ","—"," ",u.jsx("span",{className:"capitalize",children:C[c].visibilityState??(C[c].answerMentioned?"visible":"not-visible")}),u.jsxs("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>ve(-1),children:["←"," Back to latest"]})]}),!P&&(e.modelTransitions?.length??0)>0&&u.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(W=>u.jsx("span",{className:"inline-flex items-center rounded-full border border-amber-400/30 bg-amber-400/10 px-2 py-1 text-[10px] text-amber-100",children:`${W.fromModel??"unknown"} -> ${W.toModel??"unknown"} on ${new Date(W.createdAt).toLocaleDateString()}`},`${W.runId}:${W.toModel??"unknown"}`))})]}),u.jsxs("div",{className:"evidence-modal-body",children:[g&&u.jsxs("div",{className:"md:col-span-2 flex items-center justify-center py-12 text-zinc-500 text-sm",children:["Loading historical run data","…"]}),!g&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"evidence-modal-main",children:[u.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${V}`,children:[u.jsx("p",{className:`evidence-position-label evidence-position-label--${V}`,children:G.label}),u.jsx("p",{className:`evidence-position-title evidence-position-title--${V}`,children:G.title}),u.jsx("p",{className:"evidence-position-meta",children:G.meta}),D&&u.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:D})]}),A.answerSnippet&&u.jsxs("div",{children:[u.jsx("p",{className:"drawer-section-label",children:"What the AI said"}),u.jsx("div",{className:`answer-snippet-block ${r?"evidence-answer-expanded":"evidence-answer-collapsed"}`,children:oe()}),A.answerSnippet.length>280&&u.jsx("button",{type:"button",className:"mt-1.5 text-xs text-zinc-500 hover:text-zinc-300 transition-colors",onClick:()=>i(!r),children:r?"↑ Collapse":"↓ Show full answer"})]}),!A.answerSnippet&&!g&&u.jsx("div",{className:"rounded-lg border border-zinc-800/40 bg-zinc-900/20 px-4 py-8 text-center text-zinc-600 text-sm",children:"No answer text recorded for this run"}),!P&&e.relatedTechnicalSignals.length>0&&u.jsxs("div",{children:[u.jsx("p",{className:"drawer-section-label",children:R?"Why you're visible":"What to fix"}),u.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((W,X)=>u.jsxs("div",{className:"action-item",children:[u.jsx("svg",{className:`action-item-icon ${R?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:R?u.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):u.jsxs(u.Fragment,{children:[u.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),u.jsx("path",{d:"M8 5v3.5M8 10.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),u.jsx("span",{className:"action-item-text",children:W})]},X))})]}),A.summary&&u.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:A.summary})]}),u.jsxs("div",{className:"evidence-modal-sidebar",children:[(q||U)&&u.jsxs("div",{className:"sidebar-tabs",children:[u.jsx("button",{className:`sidebar-tab ${s==="mentions"?"sidebar-tab--active":""}`,onClick:()=>l("mentions"),type:"button",title:"Canonry's answer-level visibility assessment and any company names extracted from the answer text.",children:"Mentions"}),u.jsx("button",{className:`sidebar-tab ${s==="sources"?"sidebar-tab--active":""}`,onClick:()=>l("sources"),type:"button",title:"Grounding links the model used to build the answer. These are supporting sources, not the primary visibility signal.",children:"Sources"})]}),s==="mentions"&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{children:[u.jsxs("div",{className:"drawer-section-label flex items-center",children:[u.jsx("span",{children:"Answer visibility"}),u.jsx(Vn,{text:"Canonry scans the AI answer for your owned domains and project name. This is independent from grounding or citation sources."})]}),u.jsxs("div",{className:`mention-status mention-status--${R?"visible":"not-visible"}`,children:[u.jsx("span",{className:"mention-status-icon",children:z?"…":R?"✓":"—"}),u.jsx("span",{className:"mention-status-label",children:z?"Pending":R?"Visible":"Not visible"})]}),A.matchedTerms.length>0&&u.jsxs("div",{className:"mt-2",children:[u.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Matched in answer"}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:A.matchedTerms.map(W=>u.jsx("span",{className:"mention-chip mention-chip--brand",children:W},W))})]}),!z&&!R&&A.matchedTerms.length===0&&u.jsxs("div",{className:"mt-2",children:[u.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Searched for"}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:ae.map(W=>u.jsx("span",{className:"mention-chip mention-chip--muted",children:W},W))}),u.jsx("p",{className:"text-[11px] text-zinc-600 mt-1.5",children:"None of these appear in the answer text."})]})]}),(A.recommendedCompetitors.length>0||A.competitorDomains.length>0)&&u.jsxs("div",{children:[u.jsxs("div",{className:"drawer-section-label flex items-center",children:[u.jsx("span",{children:"Competitors in answer"}),u.jsx(Vn,{text:"Competitors detected in the answer text or cited source links. Includes both tracked competitors and names extracted by Canonry."})]}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:(()=>{const W=A.competitorDomains.map(de=>de.replace(/^www\./,"")),X=new Set(W.map(de=>fE(de.replace(/\.[^.]+$/,""))));return[...A.recommendedCompetitors.filter(de=>!X.has(fE(de))),...W].map(de=>u.jsx("span",{className:"mention-chip mention-chip--competitor",children:de},de))})()})]})]}),s==="sources"&&u.jsxs(u.Fragment,{children:[A.citedDomains.length>0&&u.jsxs("div",{children:[u.jsxs("div",{className:"drawer-section-label flex items-center",children:[u.jsx("span",{children:"Domains from source links"}),u.jsx(Vn,{text:"These domains were extracted from grounding or citation URLs. They are supporting-source metadata, not proof that the answer text mentioned them."})]}),u.jsx("div",{className:"citation-leaderboard",children:A.citedDomains.map((W,X)=>{const Q=W.toLowerCase().replace(/^www\./,""),de=N.has(Q),ye=!de&&A.competitorDomains.some(le=>le.toLowerCase().replace(/^www\./,"")===Q),Z=de?"you":ye?"competitor":"other";return u.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${Z}`,children:[u.jsxs("span",{className:"citation-leaderboard-rank",children:["#",X+1]}),u.jsx("span",{className:"citation-leaderboard-domain",children:W}),de&&u.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),ye&&u.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},W)})})]}),A.groundingSources.length>0&&u.jsxs("div",{children:[u.jsxs("div",{className:"drawer-section-label flex items-center",children:[u.jsxs("span",{children:["Grounding source links (",A.groundingSources.length,")"]}),u.jsx(Vn,{text:"Links the model used as grounding or supporting context while producing the answer. These are not the same thing as answer visibility."})]}),u.jsx("ul",{className:"grid gap-0.5",children:A.groundingSources.map((W,X)=>u.jsx("li",{className:"truncate text-sm",children:u.jsx("a",{href:W.uri,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:W.title||W.uri})},X))})]}),A.evidenceUrls.length>0&&u.jsxs("div",{children:[u.jsx("p",{className:"drawer-section-label",children:"Evidence URLs"}),u.jsx("ul",{className:"grid gap-1",children:A.evidenceUrls.map(W=>u.jsx("li",{className:"truncate text-sm",children:u.jsx("a",{href:W,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:W})},W))})]}),A.citedDomains.length===0&&A.groundingSources.length===0&&A.evidenceUrls.length===0&&u.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No source data ",P?"for this run":"yet"]})]}),!q&&!U&&u.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No answer visibility data ",P?"for this run":"yet"]})]})]})]})]})]})})}function vi(e){const t=new Date("2026-02-20");return e.map((n,r)=>({runId:`run_mock_${r+1}`,citationState:n,createdAt:new Date(t.getTime()+r*2*24*60*60*1e3).toISOString()}))}const Cb=[{id:"project_citypoint",name:"Citypoint Dental NYC",canonicalDomain:"citypointdental.com",ownedDomains:[],country:"US",language:"en",tags:["local intent","priority"],labels:{},locations:[],defaultLocation:null,configSource:"cli",configRevision:1},{id:"project_harbor",name:"Harbor Legal Group",canonicalDomain:"harborlegal.com",ownedDomains:[],country:"US",language:"en",tags:["lead gen"],labels:{},locations:[],defaultLocation:null,configSource:"cli",configRevision:1},{id:"project_northstar",name:"Northstar Orthopedics",canonicalDomain:"northstarortho.com",ownedDomains:[],country:"US",language:"en",tags:["multi-location"],labels:{},locations:[],defaultLocation:null,configSource:"cli",configRevision:1}];function $g(e){return{id:e.id,projectId:e.projectId,projectName:e.projectName,kind:e.kind,kindLabel:e.kindLabel,status:e.status,trigger:e.trigger??"manual",createdAt:e.createdAt,startedAt:e.startedAt,duration:e.duration,statusDetail:e.statusDetail,summary:e.summary,triggerLabel:e.triggerLabel}}const rQ=$g({id:"run_citypoint_visibility_20260308",projectId:"project_citypoint",projectName:"Citypoint Dental NYC",kind:"answer-visibility",kindLabel:"Answer visibility sweep",status:"completed",createdAt:"2026-03-08T12:15:00.000Z",startedAt:"Mar 8, 12:15 PM",duration:"6m 12s",statusDetail:"18 tracked queries checked; 3 citation losses detected on emergency-intent prompts.",summary:"Citation losses on emergency-intent prompts",triggerLabel:"Scheduled"}),iQ=$g({id:"run_citypoint_queued_20260309",projectId:"project_citypoint",projectName:"Citypoint Dental NYC",kind:"answer-visibility",kindLabel:"Answer visibility sweep",status:"queued",createdAt:"2026-03-09T08:05:00.000Z",startedAt:"Mar 9, 8:05 AM",duration:"Waiting for slot",statusDetail:"Ready to enqueue after the next provider rate window clears.",summary:"Queued follow-up after local ranking movement",triggerLabel:"Manual"}),aQ=$g({id:"run_harbor_visibility_20260308",projectId:"project_harbor",projectName:"Harbor Legal Group",kind:"answer-visibility",kindLabel:"Answer visibility sweep",status:"completed",createdAt:"2026-03-08T11:05:00.000Z",startedAt:"Mar 8, 11:05 AM",duration:"5m 07s",statusDetail:"12 tracked queries checked; local-intent visibility held steady across branded prompts.",summary:"Branded prompts remain stable",triggerLabel:"Scheduled"}),sQ=$g({id:"run_northstar_visibility_20260308",projectId:"project_northstar",projectName:"Northstar Orthopedics",kind:"answer-visibility",kindLabel:"Answer visibility sweep",status:"running",createdAt:"2026-03-08T13:40:00.000Z",startedAt:"Mar 8, 1:40 PM",duration:"3m 10s",statusDetail:"Provider responses still in flight for 9 multi-location prompts.",summary:"Mid-run on treatment-location prompts",triggerLabel:"Manual"}),oQ=[{id:"evidence_citypoint_emergency_gemini",keyword:"emergency dentist brooklyn",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"lost",changeLabel:"Lost since Mar 5",answerSnippet:"For urgent dental care in Brooklyn, Downtown Smiles and Harbor Dental are now cited first for emergency availability and same-day booking.",citedDomains:["downtownsmiles.com","harbordental.com"],evidenceUrls:["https://downtownsmiles.com/emergency-dentist-brooklyn","https://harbordental.com/same-day-emergency-care"],competitorDomains:["downtownsmiles.com","harbordental.com"],groundingSources:[],relatedTechnicalSignals:["FAQ schema missing on the emergency service page","llms.txt not found during latest site audit","Location pages link weakly into the emergency care hub"],summary:"AI answers now cite two competitors while your emergency page is no longer grounded.",runHistory:vi(["cited","cited","cited","cited","cited","cited","cited","not-cited","not-cited"])},{id:"evidence_citypoint_emergency_openai",keyword:"emergency dentist brooklyn",provider:"openai",model:"gpt-5.4",location:null,citationState:"cited",changeLabel:"Cited for 6 runs",answerSnippet:"Citypoint Dental is listed as a top emergency dentist in Brooklyn for same-day appointments and walk-in availability.",citedDomains:["citypointdental.com","downtownsmiles.com"],evidenceUrls:["https://citypointdental.com/emergency-dentist-brooklyn"],competitorDomains:["downtownsmiles.com"],groundingSources:[],relatedTechnicalSignals:["Emergency page indexed with structured data"],summary:"OpenAI cites your emergency page consistently alongside one competitor.",runHistory:vi(["not-cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_emergency_claude",keyword:"emergency dentist brooklyn",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"Based on the search results, top-rated emergency dental practices in Brooklyn include Downtown Smiles and Harbor Dental.",citedDomains:["downtownsmiles.com","harbordental.com"],evidenceUrls:[],competitorDomains:["downtownsmiles.com","harbordental.com"],groundingSources:[],relatedTechnicalSignals:["FAQ schema missing","llms.txt not found"],summary:"Claude does not cite your domain for this emergency query.",runHistory:vi(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_invisalign_openai",keyword:"best invisalign dentist downtown brooklyn",provider:"openai",model:"gpt-5.4",location:null,citationState:"emerging",changeLabel:"First citation in 7 days",answerSnippet:"Citypoint Dental appears as an emerging recommendation for Invisalign in Downtown Brooklyn, supported by recent before-and-after case pages.",citedDomains:["citypointdental.com","clearlineortho.com"],evidenceUrls:["https://citypointdental.com/invisalign-downtown-brooklyn","https://citypointdental.com/case-studies/invisalign-open-bite"],competitorDomains:["clearlineortho.com"],groundingSources:[],relatedTechnicalSignals:["Structured data now present on two case-study pages","Internal links from service pages to case studies improved crawl depth"],summary:"Fresh case-study content is starting to earn citations on Invisalign prompts.",runHistory:vi(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","cited"])},{id:"evidence_citypoint_invisalign_gemini",keyword:"best invisalign dentist downtown brooklyn",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"cited",changeLabel:"Cited for 8 runs",answerSnippet:"Citypoint Dental in Downtown Brooklyn is highlighted for its Invisalign expertise and patient outcomes.",citedDomains:["citypointdental.com"],evidenceUrls:["https://citypointdental.com/invisalign-downtown-brooklyn"],competitorDomains:[],groundingSources:[],relatedTechnicalSignals:["Case study pages well-indexed"],summary:"Gemini consistently cites your Invisalign page with no competitor overlap.",runHistory:vi(["cited","cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_invisalign_claude",keyword:"best invisalign dentist downtown brooklyn",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"For Invisalign in Downtown Brooklyn, Clear Line Ortho and Brooklyn Smiles are frequently recommended for their experienced orthodontists.",citedDomains:["clearlineortho.com","brooklynsmiles.com"],evidenceUrls:[],competitorDomains:["clearlineortho.com"],groundingSources:[],relatedTechnicalSignals:["No before/after schema on case study pages"],summary:"Claude does not surface your Invisalign content despite strong page quality.",runHistory:vi(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_claude",keyword:"pediatric dentist brooklyn heights",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 4 runs",answerSnippet:"Answers cite neighborhood-specific pediatric practices with stronger family-focused FAQ content and clearer insurance details.",citedDomains:["brightkidsdental.com","parkpediatricdental.com"],evidenceUrls:["https://brightkidsdental.com/pediatric-dentist-brooklyn-heights","https://parkpediatricdental.com/insurance"],competitorDomains:["brightkidsdental.com","parkpediatricdental.com"],groundingSources:[],relatedTechnicalSignals:["No dedicated pediatric service page exists for Brooklyn Heights","Insurance content is buried three clicks deep"],summary:"Coverage gap is content-driven, not purely technical.",runHistory:vi(["not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_gemini",keyword:"pediatric dentist brooklyn heights",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"For pediatric dentistry in Brooklyn Heights, Bright Kids Dental and Park Pediatric Dental are cited for family-friendly care.",citedDomains:["brightkidsdental.com","parkpediatricdental.com"],evidenceUrls:[],competitorDomains:["brightkidsdental.com","parkpediatricdental.com"],groundingSources:[],relatedTechnicalSignals:["No dedicated pediatric page for Brooklyn Heights"],summary:"Gemini does not surface your domain for pediatric queries in this area.",runHistory:vi(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_openai",keyword:"pediatric dentist brooklyn heights",provider:"openai",model:"gpt-5.4",location:null,citationState:"cited",changeLabel:"First citation this month",answerSnippet:"Citypoint Dental is mentioned as offering pediatric services in Brooklyn, though specialized pediatric-only practices are also highlighted.",citedDomains:["citypointdental.com","brightkidsdental.com"],evidenceUrls:["https://citypointdental.com/family-dentistry"],competitorDomains:["brightkidsdental.com"],groundingSources:[],relatedTechnicalSignals:["Family dentistry page recently updated"],summary:"OpenAI recently started citing your family dentistry page for this query.",runHistory:vi(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];Cb[0],Cb[1],vi(["cited","cited","cited","cited","cited"]),Cb[2],2/7,vi(["not-cited","not-cited","not-cited","cited"]);function lQ(e,t){return e.projects.find(n=>n.project.id===t)}function cQ(e,t){return e.runs.find(n=>n.id===t)}function uQ(e,t){for(const n of e.projects){const r=n.visibilityEvidence.find(i=>i.id===t);if(r)return{project:n,evidence:r}}}const dQ={regression:"negative",gain:"positive",opportunity:"caution"},fQ={regression:"lost",gain:"emerging",opportunity:"not-cited"},hQ={regression:"Regression",gain:"Gain",opportunity:"Opportunity"};function pQ(e){return{id:e.id,tone:dQ[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??"",actionLabel:e.recommendation?.action??hQ[e.type],affectedPhrases:[{keyword:e.keyword,evidenceId:"",provider:e.provider,citationState:fQ[e.type]}]}}function mQ(e){return e.filter(t=>!t.dismissed).map(pQ)}function JD(e){return{id:e.id,name:e.name,displayName:e.displayName,canonicalDomain:e.canonicalDomain,ownedDomains:e.ownedDomains??[],country:e.country,language:e.language,tags:e.tags,labels:e.labels,locations:e.locations??[],defaultLocation:e.defaultLocation??null,configSource:e.configSource,configRevision:e.configRevision,createdAt:e.createdAt,updatedAt:e.updatedAt}}function Tw(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function gQ(e,t){if(!e)return"Waiting";if(!t)return"Running";const n=new Date(t).getTime()-new Date(e).getTime();if(n<1e3)return"<1s";const r=Math.floor(n/1e3);if(r<60)return`${r}s`;const i=Math.floor(r/60),s=r%60;return`${i}m ${s}s`}function C1(e){switch(e){case Xr["answer-visibility"]:return"Answer visibility sweep";case Xr["gsc-sync"]:return"GSC sync";case Xr["inspect-sitemap"]:return"Sitemap inspection";case Xr["site-audit"]:return"Site audit"}}function vQ(e){return e===Fp.manual?"Manual":e===Fp.scheduled?"Scheduled":e===Fp["config-apply"]?"Config apply":e}function O1(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:C1(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?Tw(e.startedAt):Tw(e.createdAt),duration:gQ(e.startedAt,e.finishedAt),statusDetail:e.error?eI(e.error):yQ(e),summary:bQ(e),triggerLabel:vQ(e.trigger)}}function eI(e){try{const n=JSON.parse(e);if(typeof n=="object"&&n!==null){const r=n.message??n.error?.message??n[0]?.error?.message;if(typeof r=="string"&&r.length>0)return r.length>200?r.slice(0,200)+"…":r}}catch{}const t=e.match(/\[.*?\]\s*(.+)/);if(t){const n=t[1];return n.length>200?n.slice(0,200)+"…":n}return e.length>200?e.slice(0,200)+"…":e}function yQ(e){switch(e.status){case Xt.queued:return"Waiting for execution slot.";case Xt.running:return"Provider queries in progress.";case Xt.completed:return"All key phrases checked.";case Xt.partial:return"Run completed with some key phrases skipped.";case Xt.failed:return e.error?eI(e.error):"Run failed.";case Xt.cancelled:return"Run was cancelled.";default:return""}}function bQ(e){const t=C1(e.kind);switch(e.status){case Xt.queued:return`${t} queued`;case Xt.running:return`${t} in progress`;case Xt.completed:return`${t} completed`;case Xt.partial:return`${t} partially completed`;case Xt.failed:return`${t} failed`;case Xt.cancelled:return`${t} cancelled`;default:return e.status}}function tI(e){if(e.length===0)return{score:0,citedCount:0,totalCount:0};const t=new Map;for(const s of e){const l=s.keyword??s.id;t.has(l)||t.set(l,!1),s.citationState==="cited"&&t.set(l,!0)}const n=t.size,r=[...t.values()].filter(Boolean).length;return{score:n>0?Math.round(r/n*100):0,citedCount:r,totalCount:n}}function nI(e){return e>=70?"positive":e>=40?"caution":"negative"}function xQ(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function wQ(e,t){return e===0?"positive":(t>0?e/t:0)>=.3?"negative":"caution"}function SQ(e){if(e.length===0)return{label:"Gap Key Phrases",value:"No data",delta:"Run a sweep first",tone:"neutral",description:"Run a visibility sweep to identify key phrases where competitors are cited and your domain is not.",tooltip:"Tracked key phrases where a competitor is cited in the latest run but your domain is not.",trend:[]};const t=new Map;for(const s of e){const l=s.keywordId,c=t.get(l)??{cited:!1,competitorOverlap:new Set};s.citationState==="cited"&&(c.cited=!0);for(const f of s.competitorOverlap)c.competitorOverlap.add(f);t.set(l,c)}const n=t.size,r=[...t.values()].filter(s=>!s.cited&&s.competitorOverlap.size>0).length,i=r===1?"key phrase":"key phrases";return{label:"Gap Key Phrases",value:`${r}`,delta:`${r} of ${n} key phrases at risk`,tone:wQ(r,n),description:r>0?`${r} tracked ${i} currently cite competitors without citing your domain.`:"No competitive key phrase gaps detected in the latest visibility run.",tooltip:"Tracked key phrases where a competitor is cited in the latest run but your domain is not.",trend:[],progress:n>0?r/n:0}}function jQ(e,t){return e&&e.summary.total>0?{provider:"Google",...e.summary}:t&&t.summary.total>0?{provider:"Bing",...t.summary,deindexed:0}:e?{provider:"Google",...e.summary}:t?{provider:"Bing",...t.summary,deindexed:0}:null}function NQ(e){return e.provider==="Google"&&e.deindexed>0?"negative":e.percentage>=90?"positive":e.percentage>=70?"caution":"negative"}function CQ(e,t){const n=jQ(e,t);if(!n||n.total===0)return{label:"Index Coverage",value:"No data",delta:"Connect GSC or Bing",tone:"neutral",description:"Connect Google Search Console or Bing Webmaster Tools and inspect your sitemap to populate coverage.",tooltip:"Percentage of inspected URLs currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used.",trend:[]};const r=n.notIndexed===1?"URL is":"URLs are",i=n.deindexed===1?"URL":"URLs";return{label:"Index Coverage",value:`${Math.round(n.percentage)}`,delta:`${n.provider} · ${n.indexed} of ${n.total} indexed`,tone:NQ(n),description:n.provider==="Google"&&n.deindexed>0?`${n.deindexed} deindexed ${i} detected in the latest Google Search Console inspection.`:`${n.notIndexed} ${r} not indexed in ${n.provider==="Google"?"Google Search Console":"Bing Webmaster Tools"}.`,tooltip:"Percentage of inspected URLs currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used.",trend:[]}}function rI(e,t){if(e.length===0||t.length===0)return{label:"None",count:0};const n=new Set(t);let r=0;for(const s of e)s.competitorOverlap.some(l=>n.has(l))&&r++;const i=r/e.length;return i>=.5?{label:"High",count:r}:i>=.2?{label:"Moderate",count:r}:{label:"Low",count:r}}function OQ(e,t,n,r){const i=[];let s=0;const l=new Set;if(n){const c=new Map;for(const v of n.snapshots)if(v.keyword){const y=`${v.keyword}::${v.provider}`;c.set(y,v)}const f=new Set(n.snapshots.map(v=>v.provider)),h=new Set(t.flatMap(v=>Object.keys(v.providerRuns??{}))),p=[...new Set([...f,...h])].sort(),g=p.length>0?p:["gemini"];for(const v of t){if(v.runs.length===0)continue;l.add(v.keyword);const y=v.runs.at(-1),w=y?.transition??"not-cited";for(const S of g){const N=c.get(`${v.keyword}::${S}`),C=(v.providerRuns?.[S]?.length??0)>0;if(!N&&!C)continue;const E=N?.model??null,k=E?`${S}:${E}`:null,O=k?v.modelRuns?.[k]:void 0,T=v.providerRuns?.[S],P=(T?.length?T:null)??(O?.length?O:null),A=T?.length?"provider":O?.length?"model":"keyword",z=P?P.at(-1).transition:w,R=P?P.at(-1).visibilityTransition??(P.at(-1).visibilityState==="visible"?"visible":"not-visible"):y?.visibilityTransition??(y?.visibilityState==="visible"?"visible":"not-visible"),q=P?.at(-1)?.citationState,U=P?.at(-1)?.visibilityState,L=N?z==="lost"?"lost":z==="emerging"?"emerging":N.citationState==="cited"?"cited":"not-cited":q==="cited"?"cited":"not-cited",ae=N?.visibilityState??(U==="visible"?"visible":U==="pending"?"pending":"not-visible"),pe=Pw(P||v.runs),ge=pE(P||v.runs),V=_Q(v,S),re=(P??v.runs).map(D=>({runId:D.runId,citationState:D.citationState,createdAt:D.createdAt,model:V.get(D.runId)??null,answerMentioned:D.answerMentioned,visibilityState:D.visibilityState,visibilityTransition:D.visibilityTransition})),ve=kQ(re),we=A==="provider"&&ve.length<=1?"model":A,B=AQ(re);i.push({id:`evidence_${e}_${s++}`,keyword:v.keyword,provider:N?.provider??S,model:N?.model??null,location:N?.location??null,citationState:L,answerMentioned:N?.answerMentioned,visibilityState:ae,visibilityChangeLabel:mE(R,ge,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:mE(z,pe),answerSnippet:N?.answerText??"",citedDomains:N?.citedDomains??[],evidenceUrls:[],competitorDomains:N?.competitorOverlap??[],recommendedCompetitors:N?.recommendedCompetitors??[],matchedTerms:N?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:N?.groundingSources??[],summary:EQ(ae,R,v.keyword),runHistory:re,historyScope:we,modelsSeen:ve,modelTransitions:B})}}}for(const c of r)l.has(c.keyword)||i.push({id:`evidence_${e}_${s++}`,keyword:c.keyword,provider:"",model:null,location:null,citationState:"pending",visibilityState:"pending",visibilityChangeLabel:"Awaiting first run",changeLabel:"Awaiting first run",answerSnippet:"",citedDomains:[],evidenceUrls:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],relatedTechnicalSignals:[],groundingSources:[],summary:`"${c.keyword}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"keyword",modelsSeen:[],modelTransitions:[]});return i}function _Q(e,t){const n=new Map,r=`${t}:`;for(const[i,s]of Object.entries(e.modelRuns??{})){if(!i.startsWith(r))continue;const l=i.slice(r.length),c=l==="unknown"?null:l;for(const f of s)n.set(f.runId,c)}return n}function kQ(e){const t=new Set;for(const n of e)n.model&&t.add(n.model);return[...t]}function AQ(e){const t=[];let n=null;for(const r of e){const i=r.model??null;i!==n&&n!==null&&t.push({runId:r.runId,createdAt:r.createdAt,fromModel:n,toModel:i}),n=i}return t}function Pw(e){if(e.length===0)return 0;const t=e[e.length-1].citationState;let n=0;for(let r=e.length-1;r>=0&&e[r].citationState===t;r--)n++;return n}function pE(e){if(e.length===0)return 0;const t=e[e.length-1].visibilityState??"not-visible";let n=0;for(let r=e.length-1;r>=0&&(e[r].visibilityState??"not-visible")===t;r--)n++;return n}function mE(e,t,n){const r={positive:n?.positive??"cited",negative:n?.negative??"not cited",first:n?.first??"first citation"};switch(e){case"new":return"First observation";case"cited":case"visible":return t<=1?`${ld(r.positive)} in latest run`:`${ld(r.positive)} for ${t} runs`;case"lost":return"Lost since last run";case"emerging":return ld(r.first);case"not-cited":case"not-visible":return t<=1?`${ld(r.negative)} in latest run`:`${ld(r.negative)} across ${t} runs`;default:return e}}function ld(e){return e.charAt(0).toUpperCase()+e.slice(1)}function EQ(e,t,n){switch(t){case"lost":return`Visibility was lost for "${n}". Your brand no longer appeared in the latest answer.`;case"emerging":return`Your brand started appearing in AI answers for "${n}".`}switch(e){case"visible":return`Your brand or domain is visible in AI answers for "${n}".`;case"pending":return`"${n}" has been added but no visibility run has been triggered yet.`;default:return`Your brand or domain was not mentioned in AI answers for "${n}".`}}function gE(e,t){const n=new Set(t),r=new Map;for(const i of e)if(i.keyword)for(const s of i.competitorOverlap){if(!n.has(s))continue;const l=r.get(s)??new Set;l.add(i.keyword),r.set(s,l)}return r}const Ob=3;function TQ(e){const{evidence:t,timeline:n,latestSnapshots:r,previousSnapshots:i,trackedCompetitors:s}=e,l=[],c=[],f=new Set;for(const C of t)C.citationState==="lost"&&(f.has(C.keyword)||(f.add(C.keyword),c.push({keyword:C.keyword,evidenceId:C.id,provider:C.provider,citationState:"lost"})));c.length>0&&l.push({id:"insight_lost",tone:"negative",title:`Lost citation on ${c.length} key phrase${c.length>1?"s":""}`,detail:"Citations dropped since the last run.",actionLabel:"Lost",affectedPhrases:c});const h=gE(r,s),p=gE(i,s);for(const C of s){const E=h.get(C)??new Set,k=p.get(C)??new Set,O=[...E].filter(T=>!k.has(T));O.length>0&&l.push({id:`insight_comp_gained_${C}`,tone:"negative",title:`${C} appeared on ${O.length} key phrase${O.length>1?"s":""}`,detail:"A tracked competitor gained new citations.",actionLabel:"Competitor",affectedPhrases:O.map(T=>{const P=t.find(A=>A.keyword===T);return{keyword:T,evidenceId:P?.id??"",citationState:"cited"}})})}const g=new Map;for(const C of n){const E=C.runs.at(-1);E&&g.set(C.keyword,{transition:E.transition,citationState:E.citationState})}const v=[],y=[],w=new Set;for(const[C,{transition:E,citationState:k}]of g){if(!(E==="emerging"||E==="new"&&k==="cited"))continue;w.add(C);const T=t.find(P=>P.keyword===C&&(P.citationState==="emerging"||P.citationState==="cited"));v.push({keyword:C,evidenceId:T?.id??"",provider:T?.provider,citationState:"emerging"})}for(const C of t)C.citationState==="emerging"&&(w.has(C.keyword)||y.push({keyword:C.keyword,evidenceId:C.id,provider:C.provider,citationState:"emerging"}));if(y.length>0){const C=new Set(y.map(E=>E.keyword)).size;l.push({id:"insight_provider_pickup",tone:"positive",title:`Picked up by new provider on ${C} key phrase${C>1?"s":""}`,detail:"Your domain started appearing on additional providers.",actionLabel:"Pickup",affectedPhrases:y})}v.length>0&&l.push({id:"insight_first_citation",tone:"positive",title:`First citation on ${w.size} key phrase${w.size>1?"s":""}`,detail:"Your domain appeared in AI answers for the first time.",actionLabel:"New",affectedPhrases:v});const S=new Set(t.map(C=>C.keyword)),N=[];for(const C of n){if(!S.has(C.keyword)||C.runs.length<Ob||C.runs.at(-1)?.citationState!=="not-cited")continue;if(Pw(C.runs)>=Ob){const O=t.find(T=>T.keyword===C.keyword);N.push({keyword:C.keyword,evidenceId:O?.id??"",citationState:"not-cited"})}}N.length>0&&l.push({id:"insight_persistent_gap",tone:"caution",title:`${N.length} key phrase${N.length>1?"s":""} uncited for ${Ob}+ runs`,detail:"These key phrases have not been cited by any provider across multiple consecutive runs.",actionLabel:"Gap",affectedPhrases:N});for(const C of s){const E=h.get(C)??new Set,O=[...p.get(C)??new Set].filter(T=>!E.has(T));O.length>0&&l.push({id:`insight_comp_lost_${C}`,tone:"neutral",title:`${C} dropped from ${O.length} key phrase${O.length>1?"s":""}`,detail:"A tracked competitor lost citations.",actionLabel:"Competitor",affectedPhrases:O.map(T=>{const P=t.find(A=>A.keyword===T);return{keyword:T,evidenceId:P?.id??"",citationState:"not-cited"}})})}return l.length===0&&l.push({id:"insight_stable",tone:"neutral",title:"No significant changes",detail:"Citation state is stable across all tracked key phrases.",actionLabel:"Stable",affectedPhrases:[]}),l}function PQ(e,t){const n=e.filter(i=>i.id!=="insight_lost"&&i.id!=="insight_stable"),r=[...t,...n];return r.length===0?[{id:"insight_stable",tone:"neutral",title:"No significant changes",detail:"Citation state is stable across all tracked key phrases.",actionLabel:"Stable",affectedPhrases:[]}]:r}function zQ(e,t){if(t.length===0){const f=new Set(e.filter(h=>h.citationState==="cited").map(h=>h.keyword)).size;return{gained:f,lost:0,tone:f>0?"positive":"neutral",hasPreviousRun:!1}}const n=f=>{const h=new Set;for(const p of f)p.citationState==="cited"&&p.keyword&&h.add(p.keyword);return h},r=n(e),i=n(t);let s=0,l=0;for(const f of r)i.has(f)||s++;for(const f of i)r.has(f)||l++;const c=l>s?"negative":s>l?"positive":"neutral";return{gained:s,lost:l,tone:c,hasPreviousRun:!0}}function MQ(e){if(e.length===0)return{label:"Run Status",value:"None",delta:"No runs yet",tone:"neutral",description:"Trigger a visibility sweep to start tracking.",tooltip:"Current execution state of visibility sweeps. Shows the status of the most recent run and total run count.",trend:[]};const n=e.find(f=>f.kind===Xr["answer-visibility"])??e[0],r=n.status===Xt.completed?"Healthy":n.status===Xt.running?"Running":n.status===Xt.queued?"Queued":n.status===Xt.partial?"Partial":"Failed",i=n.status===Xt.completed?"positive":n.status===Xt.failed?"negative":n.status===Xt.partial?"caution":"neutral",s=e.filter(f=>f.kind===Xr["answer-visibility"]).length,l=e.length-s,c=l>0?`${s} ${s===1?"sweep":"sweeps"} · ${l} ${l===1?"sync":"syncs"}`:`${e.length} total runs`;return{label:"Run Status",value:r,delta:c,tone:i,description:`Latest: ${C1(n.kind)} — ${n.status}`,tooltip:"Current execution state of visibility sweeps. Shows the status of the most recent run and total run count.",trend:[]}}function RQ(e){const t=JD(e.project),n=OQ(t.name,e.timeline,e.latestRunDetail,e.keywords),r=e.runs.filter(A=>A.kind===Xr["answer-visibility"]).sort((A,z)=>z.createdAt.localeCompare(A.createdAt))[0],i=r&&e.latestRunDetail?.id===r.id?e.latestRunDetail.snapshots:[],s=tI(i),l=SQ(i),c=CQ(e.gscCoverage,e.bingCoverage),f=rI(i,e.competitors.map(A=>A.domain)),h=TQ({evidence:n,timeline:e.timeline,latestSnapshots:e.latestRunDetail?.snapshots??[],previousSnapshots:e.previousRunDetail?.snapshots??[],trackedCompetitors:e.competitors.map(A=>A.domain)}),p=e.dbInsights!=null?mQ(e.dbInsights):null,g=p!=null?PQ(h,p):h,v=[...e.runs].sort((A,z)=>z.createdAt.localeCompare(A.createdAt)),y=v.find(A=>A.kind===Xr["answer-visibility"]),w=v.find(A=>A.kind!==Xr["answer-visibility"]);if(y&&w){const A=new Date(w.createdAt).getTime()-new Date(y.createdAt).getTime(),z=1440*60*1e3;A>z&&g.push({id:"insight_stale_visibility",tone:"caution",title:"Stale visibility data",detail:`Last visibility sweep was ${Tw(y.createdAt)}, but integration syncs have run since. Run a new sweep for current metrics.`,actionLabel:"Stale",affectedPhrases:[]})}const S=v.map(A=>O1(A,e.project.displayName||e.project.name)),N=new Map;for(const A of i){const z=A.provider||"gemini",R=A.model??null,q=`${z}::${R??"unknown"}`,U=N.get(q)??{provider:z,model:R,cited:0,total:0};U.total++,A.citationState==="cited"&&U.cited++,N.set(q,U)}const C=[...N.values()].sort((A,z)=>A.provider.localeCompare(z.provider)||(A.model??"").localeCompare(z.model??"")).map(({provider:A,model:z,cited:R,total:q})=>({provider:A,model:z,score:q>0?Math.round(R/q*100):0,cited:R,total:q})),E=e.project.providers.filter(A=>!A.startsWith("cdp:")),k=new Set(i.map(A=>A.provider)),O=E.filter(A=>k.has(A)).length,T=i.length>0&&E.length>1&&O<E.length,P=T?`${O} of ${E.length} providers`:void 0;return{project:t,dateRangeLabel:"All time",contextLabel:`${t.country} / ${t.language.toUpperCase()}`,visibilitySummary:{label:"Answer Visibility",value:i.length>0?`${s.score}`:"No data",delta:i.length>0?`${s.citedCount} of ${s.totalCount} key phrases visible`:"Run a sweep first",tone:i.length>0?T?"caution":nI(s.score):"neutral",description:i.length>0?`${s.citedCount} of ${s.totalCount} tracked key phrases found your domain in at least one AI answer engine.`:"No visibility data yet. Trigger a run to start tracking.",tooltip:'Percentage of tracked key phrases where your domain is cited by at least one AI answer engine. A key phrase is "visible" if any configured provider includes your site in its response.',trend:[],providerCoverage:P},keywordCounts:{cited:s.citedCount,total:s.totalCount},gapKeyPhrases:l,indexCoverage:c,providerScores:C,competitorPressure:{label:"Competitor Pressure",value:f.label,delta:f.count>0?`${f.count} overlapping citations`:"No overlap detected",tone:xQ(f.label),description:e.competitors.length>0?`${e.competitors.length} competitor${e.competitors.length>1?"s":""} tracked.`:"No competitors configured.",tooltip:"How often competitor domains appear alongside yours in AI answers. High pressure means competitors are frequently cited for the same key phrases.",trend:[]},runStatus:MQ(v),movementSummary:zQ(e.latestRunDetail?.snapshots??[],e.previousRunDetail?.snapshots??[]),insights:g,visibilityEvidence:n,competitors:e.competitors.map((A,z)=>{const R=new Set;for(const pe of i)(pe.competitorOverlap.includes(A.domain)||pe.citedDomains.includes(A.domain))&&pe.keyword&&R.add(pe.keyword);const q=[...R],U=new Set(i.map(pe=>pe.keyword).filter(Boolean)),L=U.size>0?q.length/U.size:0,ae=L>=.5?"High":L>=.2?"Moderate":q.length>0?"Low":"None";return{id:A.id||`comp_${z}`,domain:A.domain,citationCount:q.length,totalKeywords:U.size,pressureLabel:ae,citedKeywords:q,movement:"",notes:""}}),recentRuns:S.slice(0,5)}}function DQ(e){const t=JD(e.project),n=e.runs.filter(w=>w.kind===Xr["answer-visibility"]).sort((w,S)=>S.createdAt.localeCompare(w.createdAt))[0],r=n&&e.latestRunDetail?.id===n.id?e.latestRunDetail.snapshots:[],i=tI(r),s=rI(r,e.competitors.map(w=>w.domain)),l=[...e.runs].sort((w,S)=>S.createdAt.localeCompare(w.createdAt)),c=l.find(w=>w.kind===Xr["answer-visibility"])??l[0],f=e.project.displayName||e.project.name,h=c?O1(c,f):{id:"none",projectId:e.project.id,projectName:f,kind:Xr["answer-visibility"],kindLabel:"No runs yet",status:Xt.queued,trigger:Fp.manual,createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""},p=e.project.providers.filter(w=>!w.startsWith("cdp:")),g=new Set(r.map(w=>w.provider)),v=p.filter(w=>g.has(w)).length,y=r.length>0&&p.length>1&&v<p.length;return{project:t,visibilityScore:i.score,visibilityDelta:r.length>0?`${i.citedCount} of ${i.totalCount} key phrases`:"No data",visibilityTone:r.length>0?y?"caution":nI(i.score):"neutral",providerCoverage:y?`${v} of ${p.length} providers`:void 0,lastRun:h,insight:r.length>0?`${i.citedCount} of ${i.totalCount} key phrases visible across ${new Set(r.map(w=>w.provider)).size} provider${new Set(r.map(w=>w.provider)).size>1?"s":""}.`:"No runs completed yet.",trend:[],competitorPressureLabel:s.label}}function IQ(e,t){const n=[],r=[],i=[];for(const l of e){r.push(RQ(l)),i.push(DQ(l));const c=[...l.runs].sort((f,h)=>h.createdAt.localeCompare(f.createdAt));for(const f of c)n.push(O1(f,l.project.displayName||l.project.name))}n.sort((l,c)=>c.createdAt.localeCompare(l.createdAt));const s=e.length>0;return{portfolioOverview:{projects:i,attentionItems:s?LQ(r):[{id:"attention_setup",tone:"neutral",title:"No projects yet",detail:"Create your first project using the setup wizard, CLI, or API.",actionLabel:"Open setup",href:"/setup"}],recentRuns:n.slice(0,5),systemHealth:[{id:"api",label:"API",tone:"positive",detail:"Connected",meta:"Real-time data"},{id:"provider",label:"Gemini",tone:"positive",detail:"Configured",meta:"Provider active"}],lastUpdatedAt:new Date().toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}),...s?{}:{emptyState:{title:"No projects yet",detail:"Canonry becomes useful after one project, a small key phrase set, and one competitor list are in place.",ctaLabel:"Launch setup",ctaHref:"/setup"}}},projects:r,runs:n,setup:{healthChecks:[{id:"api",label:"API reachable",detail:"API is responding.",state:"ready",guidance:"Required for project creation and run history."},{id:"provider",label:"Provider configured",detail:"Gemini key is configured.",state:"ready",guidance:"Required for answer-visibility sweeps."}],projectDraft:{name:"",canonicalDomain:"",country:"US",language:"en"},keywordImportState:{mode:"paste",keywordCount:0,preview:[]},competitorDraft:{domains:[],notes:"Use the CLI to add competitors."},launchState:{enabled:s,ctaLabel:s?"Trigger run":"Create a project first",summary:s?"Ready to run.":"Create a project first to launch a run."}},settings:{providerStatuses:(t?.providers??[]).map(l=>({name:l.name,displayName:l.displayName,keyUrl:l.keyUrl,modelHint:l.modelHint,model:l.model,state:l.configured?"ready":"needs-config",detail:l.configured?"Provider is configured.":"API key is missing.",quota:l.quota})),google:{state:t?.google?.configured?"ready":"needs-config",detail:t?.google?.configured?"Google OAuth app credentials are configured. Project-level GSC connections can be created from the dashboard.":"Google OAuth client ID and client secret are not configured yet."},bing:{state:t?.bing?.configured?"ready":"needs-config",detail:t?.bing?.configured?"Bing Webmaster Tools API key is configured. Project-level Bing connections can be created from the dashboard.":"Bing Webmaster Tools API key is not configured yet."},selfHostNotes:["Configuration is stored in ~/.canonry/config.yaml.","The local config file is the source of truth for authentication credentials.","Google OAuth app credentials and per-domain Google tokens are stored in local config, not the database.","Database is SQLite at ~/.canonry/data.db.","API key was auto-generated during canonry init."],bootstrapNote:"Use the UI, CLI, or ~/.canonry/config.yaml to manage settings. Authentication credentials persist to local config."}}}function LQ(e){const t=[];for(const n of e){const r=n.visibilityEvidence.filter(s=>s.citationState==="lost");r.length>0&&t.push({id:`attention_${n.project.id}_lost`,tone:"negative",title:`${n.project.displayName||n.project.name} lost citations`,detail:`${r.length} key phrase${r.length>1?"s":""} lost citation.`,actionLabel:"Open project",href:`/projects/${n.project.id}`});const i=n.recentRuns.filter(s=>s.status===Xt.running||s.status===Xt.queued);i.length>0&&t.push({id:`attention_${n.project.id}_active`,tone:"neutral",title:`${n.project.displayName||n.project.name} has active runs`,detail:`${i.length} run${i.length>1?"s":""} in progress.`,actionLabel:"View runs",href:"/runs"})}return t.length===0&&t.push({id:"attention_stable",tone:"positive",title:"All projects stable",detail:"No citation losses or active runs to flag.",actionLabel:"View portfolio",href:"/"}),t}const Jr={projects:{all:["projects"],detail:(e,t)=>["projects",e,t],keywords:e=>["projects",e,"keywords"],competitors:e=>["projects",e,"competitors"],timeline:(e,t)=>["projects",e,"timeline",t]},runs:{all:["runs"],detail:e=>["runs",e]},settings:["settings"],health:["health"]},iI=x.createContext(null);iI.Provider;function cf(){return x.useContext(iI)}function dl(e){const n=cf()?.dashboard??null,r=Lo({queryKey:Jr.projects.all,queryFn:KM,enabled:!n}),i=Lo({queryKey:Jr.runs.all,queryFn:GM,enabled:!n,refetchInterval:w=>w.state.data?.some(C=>C.status==="running"||C.status==="queued")?3e3:!1}),s=Lo({queryKey:Jr.settings,queryFn:()=>i1().catch(()=>null),enabled:!n}),l=r.data??[],c=i.data??[],f=e8({queries:l.map(w=>{const S=c.filter(C=>C.projectId===w.id),N=S.filter(C=>(C.status==="completed"||C.status==="partial")&&C.kind==="answer-visibility").sort((C,E)=>E.createdAt.localeCompare(C.createdAt));return{queryKey:Jr.projects.detail(w.id,N[0]?.id),queryFn:async()=>{const C=N[0]?.id,[E,k,O,T,P,A,z,R]=await Promise.all([s9(w.name).catch(()=>[]),VM(w.name).catch(()=>[]),ZM(w.name).catch(()=>[]),C?Pc(C).catch(()=>null):Promise.resolve(null),N[1]?Pc(N[1].id).catch(()=>null):Promise.resolve(null),a1(w.name).catch(()=>null),s1(w.name).catch(()=>null),C?tF(w.name,C).catch(()=>null):Promise.resolve(null)]);return{project:w,runs:S,keywords:E,competitors:k,timeline:O,latestRunDetail:T,previousRunDetail:P,gscCoverage:A,bingCoverage:z,dbInsights:R}},enabled:!n&&r.isSuccess&&i.isSuccess}})}),h=f.every(w=>w.isSuccess),p=x.useMemo(()=>{if(n)return n;if(!r.data||!i.data||l.length>0&&!h)return null;const w=f.map(S=>S.data).filter(S=>S!=null);return IQ(w,s.data??null)},[n,r.data,i.data,s.data,h,f,l.length]),g=!n&&(r.isError||i.isError),v=!n&&!p&&!g,y=x.useCallback(async()=>{await Promise.all([r.refetch(),i.refetch(),s.refetch()])},[r.refetch,i.refetch,s.refetch]);return{dashboard:p,isLoading:v,isError:g,refetch:y}}function $Q(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const vE=$Q(),zw=vE==="/"?"":vE.replace(/\/$/,"");async function UQ(){const e=zw?`${zw}/health`:"/health",t=await nF(e,"API"),n=t.state==="ok"?{label:"Runner",state:"ok",detail:"In-process job runner"}:{label:"Runner",state:t.state,detail:"Depends on API"};return{apiStatus:t,workerStatus:n}}function Ug(e,t){return Lo({queryKey:Jr.health,queryFn:UQ,enabled:e,refetchInterval:15e3,initialData:t})}function BQ(e){return Lo({queryKey:Jr.runs.detail(e??""),queryFn:()=>Pc(e),enabled:!!e,refetchInterval:t=>{const n=t.state.data?.status;return n==="running"||n==="queued"?3e3:!1}})}function Wc(){const e=Hs(),t=Cg({strict:!1}),n=br({select:f=>f.location.pathname}),r=t.runId??null,i=t.evidenceId??null;return{runId:r,evidenceId:i,openRun:f=>e({to:n,from:ji.to,search:h=>({...h,runId:f,evidenceId:void 0})}),openEvidence:f=>e({to:n,from:ji.to,search:h=>({...h,evidenceId:f,runId:void 0})}),closeDrawer:()=>e({to:n,from:ji.to,search:f=>({...f,runId:void 0,evidenceId:void 0})})}}const qQ={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function FQ(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function KQ(){const e=x.useSyncExternalStore(lF,pA,pA),t=Hs(),{openRun:n}=Wc(),r=x.useCallback(s=>{xw(s)},[]),i=x.useCallback(s=>{s.cta&&(s.cta.intent==="open-run-drawer"?n(s.cta.runId):t({to:"/runs"}),xw(s.id))},[t,n]);return e.length===0?null:u.jsx("div",{className:"toast-viewport","aria-label":"Notifications",children:e.map(s=>u.jsxs("section",{role:s.tone==="negative"?"alert":"status","aria-live":s.tone==="negative"?"assertive":"polite","data-state":s.state,className:`toast-card ${qQ[s.tone]}`,children:[u.jsxs("div",{className:"toast-copy",children:[u.jsx("p",{className:"toast-title",children:s.title}),s.detail?u.jsx("p",{className:"toast-detail",children:s.detail}):null,s.cta?u.jsx("button",{type:"button",className:"toast-action",onClick:()=>i(s),"aria-label":FQ(s),children:s.cta.label}):null]}),u.jsx("button",{type:"button",onClick:()=>r(s.id),className:"toast-dismiss","aria-label":"Dismiss",children:u.jsx(kg,{className:"size-3.5"})})]},s.id))})}const yE=[{label:"Architecture",href:"https://github.com/AINYC/canonry/blob/main/docs/architecture.md"},{label:"Testing Guide",href:"https://github.com/AINYC/canonry/blob/main/docs/testing.md"}],bE=e=>({label:e,state:"checking",detail:"Checking service health"}),HQ={apiStatus:bE("API"),workerStatus:bE("Worker")};function GQ(e){return e==="gsc-sync"?"GSC sync":e==="inspect-sitemap"?"Sitemap inspection":"Visibility sweep"}function VQ(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function ZQ(e){const t=GQ(e.kind);return e.status==="completed"?`${t} completed`:e.status==="partial"?`${t} completed with partial results`:e.status==="cancelled"?`${t} cancelled`:`${t} failed`}function YQ(e,t){return e.error?`${t}: ${e.error}`:e.location?`${t} · ${e.location}`:t}function WQ(e,t,n){if(t)return t;const r=n.find(i=>i.id===e);return r?.displayName||r?.name||e}function QQ(e,t){return[e.completed>0?`${e.completed} completed`:null,e.partial>0?`${e.partial} partial`:null,e.failed>0?`${e.failed} failed`:null,e.cancelled>0?`${e.cancelled} cancelled`:null,t>0?`${t} skipped at queue time`:null].filter(Boolean).join(", ")}function XQ(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function JQ(){const e=x.useSyncExternalStore(JF,Yo,Yo),t=Object.keys(e.runs).length>0||Object.keys(e.batches).length>0,n=Lo({queryKey:Jr.runs.all,queryFn:GM,enabled:t}),r=Lo({queryKey:Jr.projects.all,queryFn:KM,enabled:t}),i=x.useRef({}),s=x.useCallback(()=>{n.refetch()},[n.refetch]);return x.useEffect(()=>{t&&s()},[t,s]),x.useEffect(()=>{if(!t||typeof window>"u")return;const l=()=>{document.visibilityState==="visible"&&s()};return window.addEventListener("focus",s),document.addEventListener("visibilitychange",l),()=>{window.removeEventListener("focus",s),document.removeEventListener("visibilitychange",l)}},[t,s]),x.useEffect(()=>{const l=n.data??[],c=r.data??[],f=Object.fromEntries(l.map(p=>[p.id,p])),h=Object.fromEntries(l.map(p=>[p.id,p.status]));for(const p of Object.values(e.runs)){const g=f[p.runId];if(!g||!nK(g.status)||(i.current[g.id]??p.lastAnnouncedStatus)===g.status)continue;if(p.sourceAction==="run-all"){xA(g.id);continue}const y=WQ(g.projectId,p.projectLabel,c);Qe({title:ZQ(g),detail:YQ(g,y),tone:VQ(g.status),dedupeKey:`run:${g.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:g.id}}),xA(g.id)}for(const p of Object.values(e.batches)){const g=rK(p.runIds,f);g.finished&&(Qe({title:"Run-all batch finished",detail:QQ(g,p.skippedCount),tone:XQ(g),dedupeKey:`batch:${p.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),tK(p.batchId))}i.current=h},[r.data,n.data,e]),null}function eX(){const e=cf(),{dashboard:t,isLoading:n,refetch:r}=dl(),l=Ug(!e,e?.health).data??e?.health??HQ,c=n9(),{runId:f,evidenceId:h,closeDrawer:p}=Wc(),[g,v]=x.useState(!1),y=BQ(f),w=y.data??null,S=y.isLoading;x.useEffect(()=>{w&&w.status!=="running"&&w.status!=="queued"&&r()},[w?.status,r]),x.useEffect(()=>{v(!1)},[c.pathname]),x.useEffect(()=>{if(typeof window>"u"||!f&&!h)return;const O=T=>{T.key==="Escape"&&p()};return window.addEventListener("keydown",O),()=>{window.removeEventListener("keydown",O)}},[f,h,p]);const N=t??e?.dashboard??null,C=f&&N?cQ(N,f):void 0,E=h&&N?uQ(N,h):void 0,k=(()=>{const O=c.pathname;if(O==="/")return"Portfolio";if(O==="/projects")return"Projects";if(O==="/runs")return"Runs";if(O==="/settings")return"Settings";if(O==="/setup")return"Setup";if(O.startsWith("/projects/")){const P=O.split("/").filter(Boolean)[1];if(P&&N){const A=N.projects.find(z=>z.project.id===P);if(A)return A.project.name}return"Project"}return"Not found"})();return u.jsxs("div",{className:"app-shell",children:[u.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),u.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[u.jsx("div",{className:"sidebar-brand",children:u.jsx(EA,{})}),u.jsxs("nav",{className:"sidebar-nav",children:[u.jsxs(Rt,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[u.jsx(jF,{className:"sidebar-icon"}),u.jsx("span",{children:"Overview"})]}),u.jsxs(Rt,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[u.jsx(wF,{className:"sidebar-icon"}),u.jsx("span",{children:"Projects"})]}),u.jsxs(Rt,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[u.jsx(_F,{className:"sidebar-icon"}),u.jsx("span",{children:"Runs"})]}),u.jsxs(Rt,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[u.jsx(RF,{className:"sidebar-icon"}),u.jsx("span",{children:"Settings"})]}),n?u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"sidebar-section-title",children:"Projects"}),[1,2,3].map(O=>u.jsxs("div",{className:"sidebar-skeleton-item",children:[u.jsx("span",{className:"skeleton-circle size-2"}),u.jsx("span",{className:"skeleton-text flex-1",style:{width:`${50+O*15}%`}})]},O))]}):N&&N.projects.length>0?u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"sidebar-section-title",children:"Projects"}),N.projects.map(O=>{const T=O.visibilitySummary.tone;return u.jsxs(Rt,{to:"/projects/$projectId",params:{projectId:O.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[u.jsx("span",{className:`sidebar-dot sidebar-dot-${T}`}),u.jsx("span",{children:O.project.name})]},O.project.id)})]}):n?null:u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"sidebar-section-title",children:"Resources"}),u.jsxs(Rt,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[u.jsx(TF,{className:"sidebar-icon"}),u.jsx("span",{children:"Setup"})]})]})]}),u.jsx("div",{className:"sidebar-footer",children:yE.map(O=>u.jsx("a",{className:"sidebar-footer-link",href:O.href,target:"_blank",rel:"noopener noreferrer",children:O.label},O.href))})]}),u.jsxs("div",{className:"main-area",children:[u.jsxs("header",{className:"topbar",children:[u.jsxs("div",{className:"topbar-left",children:[u.jsx("div",{className:"topbar-brand-mobile",children:u.jsx(EA,{compact:!0})}),u.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[u.jsx(Rt,{to:"/",children:"Home"}),u.jsx(_g,{className:"breadcrumb-sep size-3"}),u.jsx("span",{className:"breadcrumb-current",children:k})]})]}),u.jsxs("div",{className:"topbar-actions",children:[u.jsxs("div",{className:"health-pill-row",children:[u.jsxs("span",{className:`health-pill health-pill-${l.apiStatus.state}`,children:["API ",l.apiStatus.state==="ok"?"ok":l.apiStatus.state]}),u.jsxs("span",{className:`health-pill health-pill-${l.workerStatus.state}`,children:["Worker ",l.workerStatus.state==="ok"?"ok":l.workerStatus.state]})]}),u.jsxs(me,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":g,"aria-controls":"mobile-nav",onClick:()=>v(O=>!O),children:[u.jsx(CF,{className:"size-4"}),u.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),u.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${g?"mobile-nav-open":""}`,children:[u.jsxs(me,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>v(!1),children:[u.jsx(kg,{className:"size-5"}),u.jsx("span",{className:"sr-only",children:"Close navigation"})]}),u.jsx(Rt,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),u.jsx(Rt,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),u.jsx(Rt,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),u.jsx(Rt,{to:"/settings",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Settings"}),N&&N.projects.length>0?u.jsxs("div",{className:"mobile-nav-section",children:[u.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),N.projects.map(O=>u.jsx(Rt,{to:"/projects/$projectId",params:{projectId:O.project.id},className:"mobile-nav-link",children:O.project.name},O.project.id))]}):null]}),u.jsx("main",{id:"content",className:"page-shell",children:n&&!e?u.jsxs("div",{className:"page-skeleton",children:[u.jsxs("div",{className:"page-skeleton-header",children:[u.jsx("div",{className:"skeleton-text h-6 w-40"}),u.jsx("div",{className:"skeleton-text-sm w-72"})]}),u.jsx("div",{className:"page-skeleton-grid",children:[1,2,3].map(O=>u.jsxs("div",{className:"page-skeleton-card",children:[u.jsx("div",{className:"skeleton-text w-24"}),u.jsx("div",{className:"skeleton-text w-full"}),u.jsx("div",{className:"skeleton-text-sm w-3/4"})]},O))}),u.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(O=>u.jsxs("div",{className:"page-skeleton-card",children:[u.jsx("div",{className:"skeleton-text w-20"}),u.jsx("div",{className:"space-y-2",children:[1,2,3].map(T=>u.jsx("div",{className:"skeleton-text-sm w-full"},T))})]},O))})]}):u.jsx(r1,{})}),u.jsxs("footer",{className:"footer",children:[u.jsxs("a",{href:"https://github.com/AINYC/canonry",target:"_blank",rel:"noopener noreferrer",className:"footer-brand",children:[u.jsx(bF,{className:"size-3.5"}),u.jsx("span",{children:"Canonry"})]}),u.jsx("div",{className:"footer-links",children:yE.map(O=>u.jsx("a",{href:O.href,target:"_blank",rel:"noopener noreferrer",children:O.label},O.href))})]})]}),C?u.jsxs(K7,{open:C!==void 0,title:C.summary,subtitle:`${C.projectName} · ${C.kindLabel}`,onClose:p,children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[u.jsx(Pg,{status:C.status}),u.jsx("span",{className:"text-zinc-400",children:C.startedAt}),u.jsx("span",{className:"text-zinc-500",children:C.duration}),u.jsx("span",{className:"text-zinc-600",children:C.triggerLabel})]}),C.status==="failed"&&C.statusDetail&&u.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:C.statusDetail}),u.jsxs("div",{className:"mt-4",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),S?u.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):w&&w.snapshots.length>0?u.jsxs("div",{className:"space-y-2",children:[w.snapshots.map(O=>u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-3",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[u.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:O.keyword??"Unknown key phrase"}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx(Id,{provider:O.provider}),u.jsx(NR,{variant:O.citationState==="cited"?"success":"neutral",children:O.citationState})]})]}),O.model&&u.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:O.model}),O.citedDomains.length>0&&u.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[u.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",O.citedDomains.join(", ")]}),O.competitorOverlap.length>0&&u.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",O.competitorOverlap.join(", ")]}),O.groundingSources&&O.groundingSources.length>0&&u.jsxs("details",{className:"mt-2",children:[u.jsxs("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:[O.groundingSources.length," grounding source",O.groundingSources.length!==1?"s":""]}),u.jsx("ul",{className:"mt-1 space-y-0.5",children:O.groundingSources.map((T,P)=>u.jsx("li",{className:"text-xs text-zinc-500 truncate",children:u.jsx("a",{href:T.uri,target:"_blank",rel:"noopener noreferrer",className:"hover:text-zinc-300",children:T.title||T.uri})},P))})]}),O.answerText&&u.jsxs("details",{className:"mt-1",children:[u.jsx("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:"Answer preview"}),u.jsx("p",{className:"mt-1 text-xs text-zinc-400 leading-relaxed whitespace-pre-wrap",children:O.answerText})]})]},O.id)),w.status==="running"&&u.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[u.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Querying remaining key phrases..."]})]}):w&&w.status==="running"?u.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[u.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Waiting for first key phrase result..."]}):w&&w.status==="queued"?u.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[u.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-zinc-500 animate-pulse"}),"Run queued, waiting for execution slot..."]}):w&&w.error?u.jsxs("div",{className:"rounded-lg border border-rose-800/40 bg-rose-950/20 p-3",children:[u.jsx("p",{className:"text-sm font-medium text-rose-300 mb-2",children:"Run failed"}),u.jsx("pre",{className:"text-xs text-rose-300/80 whitespace-pre-wrap break-words max-h-48 overflow-y-auto font-mono leading-5",children:GF(w.error)})]}):u.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,E?u.jsx(nQ,{evidence:E.evidence,project:E.project,onClose:p}):null,u.jsx(JQ,{}),u.jsx(KQ,{})]})}class tX extends x.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){console.error("[ErrorBoundary]",t,n.componentStack)}handleReset=()=>{this.setState({error:null})};render(){return this.state.error?u.jsx("div",{className:"page-container",children:u.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[u.jsx("div",{className:"rounded-full bg-rose-950/40 p-3",children:u.jsx($F,{className:"size-6 text-rose-400"})}),u.jsx("h2",{className:"text-lg font-semibold text-zinc-100",children:"Something went wrong"}),u.jsx("p",{className:"text-sm text-zinc-400 max-w-md",children:this.state.error.message||"An unexpected error occurred while rendering this page."}),u.jsxs("div",{className:"flex gap-3 mt-2",children:[u.jsxs(me,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[u.jsx(zF,{className:"size-3.5 mr-1.5"}),"Try again"]}),u.jsx(me,{variant:"secondary",size:"sm",onClick:()=>{window.location.href="/"},children:"Go home"})]})]})}):this.props.children}}const Be=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ci("rounded-xl border border-zinc-800 bg-zinc-950/75 shadow-[0_0_0_1px_rgba(255,255,255,0.01)] backdrop-blur",e),...t}));Be.displayName="Card";const Mw=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ci("flex flex-col gap-1.5 p-5",e),...t}));Mw.displayName="CardHeader";const Rw=x.forwardRef(({className:e,...t},n)=>u.jsx("h3",{ref:n,className:ci("font-medium tracking-tight text-zinc-50",e),...t}));Rw.displayName="CardTitle";const Dw=x.forwardRef(({className:e,...t},n)=>u.jsx("p",{ref:n,className:ci("text-sm text-zinc-500",e),...t}));Dw.displayName="CardDescription";const Kp=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ci("p-5 pt-0",e),...t}));Kp.displayName="CardContent";function nX({points:e,tone:t}){const n=x.useId();if(e.length===0)return null;const r=42,i=132,s=5,l=Math.min(...e),f=Math.max(...e)-l||1,h=i-s*2,p=r-s*2,g=e.map((v,y)=>{const w=s+y/Math.max(e.length-1,1)*h,S=s+(1-(v-l)/f)*p;return`${w},${S}`}).join(" ");return u.jsxs("svg",{className:`sparkline sparkline-${t}`,viewBox:`0 0 ${i} ${r}`,"aria-hidden":"true",children:[u.jsx("defs",{children:u.jsx("clipPath",{id:n,children:u.jsx("rect",{x:s,y:s,width:h,height:p,rx:"8"})})}),u.jsx("line",{className:"sparkline-guide",x1:s,x2:i-s,y1:r-s,y2:r-s}),u.jsx("polyline",{clipPath:`url(#${n})`,points:g,vectorEffect:"non-scaling-stroke"})]})}function rX(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function iX(e,t,n){return e.map(r=>{if(r.id==="api")return{...r,tone:hm(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(r.id==="worker")return{...r,tone:hm(t.workerStatus),detail:t.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:t.workerStatus.detail};const i=n.providerStatuses.filter(f=>f.state==="ready").length,s=n.providerStatuses.length,l=i>0,c=n.providerStatuses.filter(f=>f.state==="ready").map(f=>rX(f)).join(" · ");return{...r,label:"Providers",tone:l?"positive":"caution",detail:`${i} of ${s} configured`,meta:c||"None configured"}})}function aX(e,t){if(e.apiStatus.state!=="ok")return"Launch is blocked until the API responds cleanly.";if(e.apiStatus.databaseConfigured===!1)return"Launch is blocked until the API has a database connection configured.";if(e.workerStatus.state!=="ok")return"Launch is blocked until the worker is healthy and heartbeats are current.";if(!t.providerStatuses.some(n=>n.state==="ready"))return"Launch is blocked until at least one provider is configured."}function sX(e,t,n){const r=aX(t,n),i=structuredClone(e);return i.healthChecks=i.healthChecks.map(s=>{if(s.id==="api")return{...s,detail:t.apiStatus.detail,state:t.apiStatus.state==="ok"?"ready":"attention"};if(s.id==="worker")return{...s,detail:t.workerStatus.detail,state:t.workerStatus.state==="ok"?"ready":"attention"};const l=n.providerStatuses.some(c=>c.state==="ready");return{...s,detail:l?"At least one provider configured.":"No providers configured.",state:l?"ready":"attention"}}),i.launchState.enabled=r===void 0,i.launchState.blockedReason=r,i.launchState.summary=r??"Queue a visibility sweep first, then follow with a site audit to explain movement.",i}function oX({project:e}){return u.jsxs(Rt,{to:"/projects/$projectId",params:{projectId:e.project.id},className:"project-row cursor-pointer",children:[u.jsxs("div",{className:"project-row-primary",children:[u.jsxs("div",{children:[u.jsx("p",{className:"project-name",children:e.project.name}),u.jsx("p",{className:"project-domain",children:e.project.canonicalDomain})]}),u.jsx("p",{className:"project-insight",children:e.insight})]}),u.jsx("div",{className:"project-row-stat",children:u.jsxs("div",{className:"metric-inline-block",children:[u.jsx("p",{className:"metric-inline-label",children:"Answer Visibility"}),u.jsx("p",{className:`metric-inline-value ${e.visibilityTone==="caution"?"text-amber-400":""}`,children:e.visibilityScore}),u.jsx("p",{className:"metric-inline-delta",children:e.visibilityDelta}),e.providerCoverage&&u.jsx("p",{className:"text-[10px] font-medium text-amber-400/80",children:e.providerCoverage})]})}),u.jsx("div",{className:"project-row-stat",children:u.jsxs("div",{className:"metric-inline-block",children:[u.jsx("p",{className:"metric-inline-label",children:"Competitor Pressure"}),u.jsx("p",{className:"metric-inline-value",children:e.competitorPressureLabel}),u.jsxs("p",{className:"metric-inline-delta",children:[e.lastRun.kindLabel," · ",Ag(e.lastRun.status)]})]})}),u.jsx("div",{className:"project-row-chart",children:u.jsx(nX,{points:e.trend,tone:CR(e.lastRun.status)})}),u.jsx("span",{className:"project-row-link",children:u.jsx(_g,{className:"h-4 w-4 text-zinc-500"})})]})}function lX(){const e=cf(),{dashboard:t,isLoading:n}=dl(),r=t??e?.dashboard;if(!r||n)return u.jsxs("div",{className:"page-skeleton",children:[u.jsxs("div",{className:"page-skeleton-header",children:[u.jsx("div",{className:"skeleton-text h-6 w-32"}),u.jsx("div",{className:"skeleton-text-sm w-64"})]}),u.jsx("div",{className:"space-y-3",children:[1,2,3].map(p=>u.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4 flex items-center gap-4",children:[u.jsxs("div",{className:"flex-1 space-y-2",children:[u.jsx("div",{className:"skeleton-text w-36"}),u.jsx("div",{className:"skeleton-text-sm w-48"})]}),u.jsx("div",{className:"skeleton-text w-16"}),u.jsx("div",{className:"skeleton-text w-16"}),u.jsx("div",{className:"skeleton h-8 w-20 rounded"})]},p))})]});const i=r.portfolioOverview,c=Ug(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},f=iX(i.systemHealth,c,r.settings),{openRun:h}=Wc();return u.jsxs("div",{className:"page-container",children:[u.jsxs("div",{className:"page-header",children:[u.jsxs("div",{className:"page-header-left",children:[u.jsx("h1",{className:"page-title",children:"Portfolio"}),u.jsx("p",{className:"page-subtitle",children:"Visibility and execution state across all projects"})]}),u.jsx("div",{className:"page-header-right",children:u.jsx("p",{className:"text-[11px] text-zinc-600",children:i.lastUpdatedAt})})]}),i.projects.length>0?u.jsx("div",{className:"project-list project-list-scrollable",children:i.projects.map(p=>u.jsx(oX,{project:p},p.project.id))}):u.jsxs(Be,{className:"surface-card empty-card",children:[u.jsx("h3",{children:i.emptyState?.title??"No projects yet"}),u.jsx("p",{className:"supporting-copy",children:i.emptyState?.detail}),u.jsx(me,{size:"sm",asChild:!0,children:u.jsx(Rt,{to:i.emptyState?.ctaHref==="/setup"||!i.emptyState?.ctaHref?"/setup":"/",children:i.emptyState?.ctaLabel??"Launch setup"})})]}),u.jsxs("div",{className:"overview-secondary-grid",children:[i.attentionItems.length>0&&u.jsxs("section",{className:"overview-secondary-section",children:[u.jsx("div",{className:"section-head section-head-inline",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Needs attention"}),u.jsx("h2",{className:"section-title-sm",children:"What changed"})]})}),u.jsx("div",{className:"attention-list attention-list-scrollable",children:i.attentionItems.map(p=>u.jsxs(Rt,{to:p.href,className:`attention-item attention-item-${p.tone}`,children:[u.jsxs("div",{children:[u.jsx("p",{className:"attention-title",children:p.title}),u.jsx("p",{className:"attention-detail",children:p.detail})]}),u.jsx("span",{className:"attention-action",children:p.actionLabel})]},p.id))})]}),u.jsxs("section",{className:"overview-secondary-section",children:[u.jsx("div",{className:"section-head section-head-inline",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Recent runs"}),u.jsx("h2",{className:"section-title-sm",children:"Activity"})]})}),u.jsx("div",{className:"compact-stack compact-stack-scrollable",children:i.recentRuns.length>0?i.recentRuns.map(p=>u.jsxs("button",{className:"compact-run",type:"button",onClick:()=>h(p.id),children:[u.jsxs("div",{children:[u.jsx("p",{className:"compact-run-title",children:p.projectName}),u.jsx("p",{className:"compact-run-detail",children:p.summary})]}),u.jsx(Pg,{status:p.status})]},p.id)):u.jsx("p",{className:"supporting-copy",children:"Run history appears here after the first launch."})})]})]}),u.jsxs("section",{className:"page-section",children:[u.jsx("div",{className:"section-head section-head-inline",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"System health"}),u.jsx("h2",{className:"section-title-sm",children:"Infrastructure"})]})}),u.jsx("div",{className:"health-grid",children:f.map(p=>u.jsxs(Be,{className:"surface-card compact-card",children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:p.label}),u.jsx("h3",{children:p.detail})]}),u.jsx(mt,{tone:p.tone,children:p.label})]}),u.jsx("p",{className:"supporting-copy",children:p.meta})]},p.id))})]})]})}const _1=Symbol.for("yaml.alias"),Iw=Symbol.for("yaml.document"),Rs=Symbol.for("yaml.map"),aI=Symbol.for("yaml.pair"),Yi=Symbol.for("yaml.scalar"),Qc=Symbol.for("yaml.seq"),ii=Symbol.for("yaml.node.type"),fl=e=>!!e&&typeof e=="object"&&e[ii]===_1,Bg=e=>!!e&&typeof e=="object"&&e[ii]===Iw,uf=e=>!!e&&typeof e=="object"&&e[ii]===Rs,an=e=>!!e&&typeof e=="object"&&e[ii]===aI,Ot=e=>!!e&&typeof e=="object"&&e[ii]===Yi,df=e=>!!e&&typeof e=="object"&&e[ii]===Qc;function nn(e){if(e&&typeof e=="object")switch(e[ii]){case Rs:case Qc:return!0}return!1}function rn(e){if(e&&typeof e=="object")switch(e[ii]){case _1:case Rs:case Yi:case Qc:return!0}return!1}const sI=e=>(Ot(e)||nn(e))&&!!e.anchor,No=Symbol("break visit"),cX=Symbol("skip children"),kd=Symbol("remove node");function Xc(e,t){const n=uX(t);Bg(e)?yc(null,e.contents,n,Object.freeze([e]))===kd&&(e.contents=null):yc(null,e,n,Object.freeze([]))}Xc.BREAK=No;Xc.SKIP=cX;Xc.REMOVE=kd;function yc(e,t,n,r){const i=dX(e,t,n,r);if(rn(i)||an(i))return fX(e,r,i),yc(e,i,n,r);if(typeof i!="symbol"){if(nn(t)){r=Object.freeze(r.concat(t));for(let s=0;s<t.items.length;++s){const l=yc(s,t.items[s],n,r);if(typeof l=="number")s=l-1;else{if(l===No)return No;l===kd&&(t.items.splice(s,1),s-=1)}}}else if(an(t)){r=Object.freeze(r.concat(t));const s=yc("key",t.key,n,r);if(s===No)return No;s===kd&&(t.key=null);const l=yc("value",t.value,n,r);if(l===No)return No;l===kd&&(t.value=null)}}return i}function uX(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function dX(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(uf(t))return n.Map?.(e,t,r);if(df(t))return n.Seq?.(e,t,r);if(an(t))return n.Pair?.(e,t,r);if(Ot(t))return n.Scalar?.(e,t,r);if(fl(t))return n.Alias?.(e,t,r)}function fX(e,t,n){const r=t[t.length-1];if(nn(r))r.items[e]=n;else if(an(r))e==="key"?r.key=n:r.value=n;else if(Bg(r))r.contents=n;else{const i=fl(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const hX={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},pX=e=>e.replace(/[!,[\]{}]/g,t=>hX[t]);class er{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},er.defaultYaml,t),this.tags=Object.assign({},er.defaultTags,n)}clone(){const t=new er(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new er(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:er.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},er.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:er.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},er.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[s,l]=r;return this.tags[s]=l,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[s]=r;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const l=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,l),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const l=t.slice(2,-1);return l==="!"||l==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),l)}const[,r,i]=t.match(/^(.*!)([^!]*)$/s);i||n(`The ${t} tag has no suffix`);const s=this.tags[r];if(s)try{return s+decodeURIComponent(i)}catch(l){return n(String(l)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+pX(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let i;if(t&&r.length>0&&rn(t.contents)){const s={};Xc(t.contents,(l,c)=>{rn(c)&&c.tag&&(s[c.tag]=!0)}),i=Object.keys(s)}else i=[];for(const[s,l]of r)s==="!!"&&l==="tag:yaml.org,2002:"||(!t||i.some(c=>c.startsWith(l)))&&n.push(`%TAG ${s} ${l}`);return n.join(`
96
- `)}}er.defaultYaml={explicit:!1,version:"1.2"};er.defaultTags={"!!":"tag:yaml.org,2002:"};function oI(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function lI(e){const t=new Set;return Xc(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function cI(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function mX(e,t){const n=[],r=new Map;let i=null;return{onAnchor:s=>{n.push(s),i??(i=lI(e));const l=cI(t,i);return i.add(l),l},setAnchors:()=>{for(const s of n){const l=r.get(s);if(typeof l=="object"&&l.anchor&&(Ot(l.node)||nn(l.node)))l.node.anchor=l.anchor;else{const c=new Error("Failed to resolve repeated object (this should not happen)");throw c.source=s,c}}},sourceObjects:r}}function bc(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,s=r.length;i<s;++i){const l=r[i],c=bc(e,r,String(i),l);c===void 0?delete r[i]:c!==l&&(r[i]=c)}else if(r instanceof Map)for(const i of Array.from(r.keys())){const s=r.get(i),l=bc(e,r,i,s);l===void 0?r.delete(i):l!==s&&r.set(i,l)}else if(r instanceof Set)for(const i of Array.from(r)){const s=bc(e,r,i,i);s===void 0?r.delete(i):s!==i&&(r.delete(i),r.add(s))}else for(const[i,s]of Object.entries(r)){const l=bc(e,r,i,s);l===void 0?delete r[i]:l!==s&&(r[i]=l)}return e.call(t,n,r)}function ri(e,t,n){if(Array.isArray(e))return e.map((r,i)=>ri(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!sI(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=s=>{r.res=s,delete n.onCreate};const i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e=="bigint"&&!n?.keep?Number(e):e}class k1{constructor(t){Object.defineProperty(this,ii,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:s}={}){if(!Bg(t))throw new TypeError("A document argument is required");const l={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=ri(this,"",l);if(typeof i=="function")for(const{count:f,res:h}of l.anchors.values())i(h,f);return typeof s=="function"?bc(s,{"":c},"",c):c}}class A1 extends k1{constructor(t){super(_1),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){let r;n?.aliasResolveCache?r=n.aliasResolveCache:(r=[],Xc(t,{Node:(s,l)=>{(fl(l)||sI(l))&&r.push(l)}}),n&&(n.aliasResolveCache=r));let i;for(const s of r){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:i,maxAliasCount:s}=n,l=this.resolve(i,n);if(!l){const f=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(f)}let c=r.get(l);if(c||(ri(l,null,n),c=r.get(l)),c?.res===void 0){const f="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(f)}if(s>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=Hp(i,l,r)),c.count*c.aliasCount>s)){const f="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(f)}return c.res}toString(t,n,r){const i=`*${this.source}`;if(t){if(oI(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(t.implicitKey)return`${i} `}return i}}function Hp(e,t,n){if(fl(t)){const r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(nn(t)){let r=0;for(const i of t.items){const s=Hp(e,i,n);s>r&&(r=s)}return r}else if(an(t)){const r=Hp(e,t.key,n),i=Hp(e,t.value,n);return Math.max(r,i)}return 1}const uI=e=>!e||typeof e!="function"&&typeof e!="object";class qe extends k1{constructor(t){super(Yi),this.value=t}toJSON(t,n){return n?.keep?this.value:ri(this.value,t,n)}toString(){return String(this.value)}}qe.BLOCK_FOLDED="BLOCK_FOLDED";qe.BLOCK_LITERAL="BLOCK_LITERAL";qe.PLAIN="PLAIN";qe.QUOTE_DOUBLE="QUOTE_DOUBLE";qe.QUOTE_SINGLE="QUOTE_SINGLE";const gX="tag:yaml.org,2002:";function vX(e,t,n){if(t){const r=n.filter(s=>s.tag===t),i=r.find(s=>!s.format)??r[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(r=>r.identify?.(e)&&!r.format)}function qd(e,t,n){if(Bg(e)&&(e=e.contents),rn(e))return e;if(an(e)){const g=n.schema[Rs].createNode?.(n.schema,null,n);return g.items.push(e),g}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:s,schema:l,sourceObjects:c}=n;let f;if(r&&e&&typeof e=="object"){if(f=c.get(e),f)return f.anchor??(f.anchor=i(e)),new A1(f.anchor);f={anchor:null,node:null},c.set(e,f)}t?.startsWith("!!")&&(t=gX+t.slice(2));let h=vX(e,t,l.tags);if(!h){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const g=new qe(e);return f&&(f.node=g),g}h=e instanceof Map?l[Rs]:Symbol.iterator in Object(e)?l[Qc]:l[Rs]}s&&(s(h),delete n.onTagObj);const p=h?.createNode?h.createNode(n.schema,e,n):typeof h?.nodeClass?.from=="function"?h.nodeClass.from(n.schema,e,n):new qe(e);return t?p.tag=t:h.default||(p.tag=h.tag),f&&(f.node=p),p}function xm(e,t,n){let r=n;for(let i=t.length-1;i>=0;--i){const s=t[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){const l=[];l[s]=r,r=l}else r=new Map([[s,r]])}return qd(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const wd=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class dI extends k1{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>rn(r)||an(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(wd(t))this.add(n);else{const[r,...i]=t,s=this.get(r,!0);if(nn(s))s.addIn(i,n);else if(s===void 0&&this.schema)this.set(r,xm(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const i=this.get(n,!0);if(nn(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...i]=t,s=this.get(r,!0);return i.length===0?!n&&Ot(s)?s.value:s:nn(s)?s.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!an(n))return!1;const r=n.value;return r==null||t&&Ot(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const i=this.get(n,!0);return nn(i)?i.hasIn(r):!1}setIn(t,n){const[r,...i]=t;if(i.length===0)this.set(r,n);else{const s=this.get(r,!0);if(nn(s))s.setIn(i,n);else if(s===void 0&&this.schema)this.set(r,xm(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}}const yX=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function _a(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Po=(e,t,n)=>e.endsWith(`
97
- `)?_a(n,t):n.includes(`
98
- `)?`
99
- `+_a(n,t):(e.endsWith(" ")?"":" ")+n,fI="flow",Lw="block",Gp="quoted";function qg(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:s=20,onFold:l,onOverflow:c}={}){if(!i||i<0)return e;i<s&&(s=0);const f=Math.max(1+s,1+i-t.length);if(e.length<=f)return e;const h=[],p={};let g=i-t.length;typeof r=="number"&&(r>i-Math.max(2,s)?h.push(0):g=i-r);let v,y,w=!1,S=-1,N=-1,C=-1;n===Lw&&(S=xE(e,S,t.length),S!==-1&&(g=S+f));for(let k;k=e[S+=1];){if(n===Gp&&k==="\\"){switch(N=S,e[S+1]){case"x":S+=3;break;case"u":S+=5;break;case"U":S+=9;break;default:S+=1}C=S}if(k===`
100
- `)n===Lw&&(S=xE(e,S,t.length)),g=S+t.length+f,v=void 0;else{if(k===" "&&y&&y!==" "&&y!==`
101
- `&&y!==" "){const O=e[S+1];O&&O!==" "&&O!==`
102
- `&&O!==" "&&(v=S)}if(S>=g)if(v)h.push(v),g=v+f,v=void 0;else if(n===Gp){for(;y===" "||y===" ";)y=k,k=e[S+=1],w=!0;const O=S>C+1?S-2:N-1;if(p[O])return e;h.push(O),p[O]=!0,g=O+f,v=void 0}else w=!0}y=k}if(w&&c&&c(),h.length===0)return e;l&&l();let E=e.slice(0,h[0]);for(let k=0;k<h.length;++k){const O=h[k],T=h[k+1]||e.length;O===0?E=`
103
- ${t}${e.slice(0,T)}`:(n===Gp&&p[O]&&(E+=`${e[O]}\\`),E+=`
104
- ${t}${e.slice(O+1,T)}`)}return E}function xE(e,t,n){let r=t,i=t+1,s=e[i];for(;s===" "||s===" ";)if(t<i+n)s=e[++t];else{do s=e[++t];while(s&&s!==`
105
- `);r=t,i=t+1,s=e[i]}return r}const Fg=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Kg=e=>/^(%|---|\.\.\.)/m.test(e);function bX(e,t,n){if(!t||t<0)return!1;const r=t-n,i=e.length;if(i<=r)return!1;for(let s=0,l=0;s<i;++s)if(e[s]===`
106
- `){if(s-l>r)return!0;if(l=s+1,i-l<=r)return!1}return!0}function Ad(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,s=t.indent||(Kg(e)?" ":"");let l="",c=0;for(let f=0,h=n[f];h;h=n[++f])if(h===" "&&n[f+1]==="\\"&&n[f+2]==="n"&&(l+=n.slice(c,f)+"\\ ",f+=1,c=f,h="\\"),h==="\\")switch(n[f+1]){case"u":{l+=n.slice(c,f);const p=n.substr(f+2,4);switch(p){case"0000":l+="\\0";break;case"0007":l+="\\a";break;case"000b":l+="\\v";break;case"001b":l+="\\e";break;case"0085":l+="\\N";break;case"00a0":l+="\\_";break;case"2028":l+="\\L";break;case"2029":l+="\\P";break;default:p.substr(0,2)==="00"?l+="\\x"+p.substr(2):l+=n.substr(f,6)}f+=5,c=f+1}break;case"n":if(r||n[f+2]==='"'||n.length<i)f+=1;else{for(l+=n.slice(c,f)+`
107
-
108
- `;n[f+2]==="\\"&&n[f+3]==="n"&&n[f+4]!=='"';)l+=`
109
- `,f+=2;l+=s,n[f+2]===" "&&(l+="\\"),f+=1,c=f+1}break;default:f+=1}return l=c?l+n.slice(c):n,r?l:qg(l,s,Gp,Fg(t,!1))}function $w(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
110
- `)||/[ \t]\n|\n[ \t]/.test(e))return Ad(e,t);const n=t.indent||(Kg(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
111
- ${n}`)+"'";return t.implicitKey?r:qg(r,n,fI,Fg(t,!1))}function xc(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=Ad;else{const i=e.includes('"'),s=e.includes("'");i&&!s?r=$w:s&&!i?r=Ad:r=n?$w:Ad}return r(e,t)}let Uw;try{Uw=new RegExp(`(^|(?<!
112
- ))
113
- +(?!
114
- |$)`,"g")}catch{Uw=/\n+(?!\n|$)/g}function Vp({comment:e,type:t,value:n},r,i,s){const{blockQuote:l,commentString:c,lineWidth:f}=r.options;if(!l||/\n[\t ]+$/.test(n))return xc(n,r);const h=r.indent||(r.forceBlockIndent||Kg(n)?" ":""),p=l==="literal"?!0:l==="folded"||t===qe.BLOCK_FOLDED?!1:t===qe.BLOCK_LITERAL?!0:!bX(n,f,h.length);if(!n)return p?`|
115
- `:`>
116
- `;let g,v;for(v=n.length;v>0;--v){const T=n[v-1];if(T!==`
117
- `&&T!==" "&&T!==" ")break}let y=n.substring(v);const w=y.indexOf(`
118
- `);w===-1?g="-":n===y||w!==y.length-1?(g="+",s&&s()):g="",y&&(n=n.slice(0,-y.length),y[y.length-1]===`
119
- `&&(y=y.slice(0,-1)),y=y.replace(Uw,`$&${h}`));let S=!1,N,C=-1;for(N=0;N<n.length;++N){const T=n[N];if(T===" ")S=!0;else if(T===`
120
- `)C=N;else break}let E=n.substring(0,C<N?C+1:N);E&&(n=n.substring(E.length),E=E.replace(/\n+/g,`$&${h}`));let O=(S?h?"2":"1":"")+g;if(e&&(O+=" "+c(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!p){const T=n.replace(/\n+/g,`
121
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${h}`);let P=!1;const A=Fg(r,!0);l!=="folded"&&t!==qe.BLOCK_FOLDED&&(A.onOverflow=()=>{P=!0});const z=qg(`${E}${T}${y}`,h,Lw,A);if(!P)return`>${O}
122
- ${h}${z}`}return n=n.replace(/\n+/g,`$&${h}`),`|${O}
123
- ${h}${E}${n}${y}`}function xX(e,t,n,r){const{type:i,value:s}=e,{actualString:l,implicitKey:c,indent:f,indentStep:h,inFlow:p}=t;if(c&&s.includes(`
124
- `)||p&&/[[\]{},]/.test(s))return xc(s,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return c||p||!s.includes(`
125
- `)?xc(s,t):Vp(e,t,n,r);if(!c&&!p&&i!==qe.PLAIN&&s.includes(`
126
- `))return Vp(e,t,n,r);if(Kg(s)){if(f==="")return t.forceBlockIndent=!0,Vp(e,t,n,r);if(c&&f===h)return xc(s,t)}const g=s.replace(/\n+/g,`$&
127
- ${f}`);if(l){const v=S=>S.default&&S.tag!=="tag:yaml.org,2002:str"&&S.test?.test(g),{compat:y,tags:w}=t.doc.schema;if(w.some(v)||y?.some(v))return xc(s,t)}return c?g:qg(g,f,fI,Fg(t,!1))}function E1(e,t,n,r){const{implicitKey:i,inFlow:s}=t,l=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:c}=e;c!==qe.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(l.value)&&(c=qe.QUOTE_DOUBLE);const f=p=>{switch(p){case qe.BLOCK_FOLDED:case qe.BLOCK_LITERAL:return i||s?xc(l.value,t):Vp(l,t,n,r);case qe.QUOTE_DOUBLE:return Ad(l.value,t);case qe.QUOTE_SINGLE:return $w(l.value,t);case qe.PLAIN:return xX(l,t,n,r);default:return null}};let h=f(c);if(h===null){const{defaultKeyType:p,defaultStringType:g}=t.options,v=i&&p||g;if(h=f(v),h===null)throw new Error(`Unsupported default string type ${v}`)}return h}function hI(e,t){const n=Object.assign({blockQuote:!0,commentString:yX,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function wX(e,t){if(t.tag){const i=e.filter(s=>s.tag===t.tag);if(i.length>0)return i.find(s=>s.format===t.format)??i[0]}let n,r;if(Ot(t)){r=t.value;let i=e.filter(s=>s.identify?.(r));if(i.length>1){const s=i.filter(l=>l.test);s.length>0&&(i=s)}n=i.find(s=>s.format===t.format)??i.find(s=>!s.format)}else r=t,n=e.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){const i=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function SX(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],s=(Ot(e)||nn(e))&&e.anchor;s&&oI(s)&&(n.add(s),i.push(`&${s}`));const l=e.tag??(t.default?null:t.tag);return l&&i.push(r.directives.tagString(l)),i.join(" ")}function Rc(e,t,n,r){if(an(e))return e.toString(t,n,r);if(fl(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i;const s=rn(e)?e:t.doc.createNode(e,{onTagObj:f=>i=f});i??(i=wX(t.doc.schema.tags,s));const l=SX(s,i,t);l.length>0&&(t.indentAtStart=(t.indentAtStart??0)+l.length+1);const c=typeof i.stringify=="function"?i.stringify(s,t,n,r):Ot(s)?E1(s,t,n,r):s.toString(t,n,r);return l?Ot(s)||c[0]==="{"||c[0]==="["?`${l} ${c}`:`${l}
128
- ${t.indent}${c}`:c}function jX({key:e,value:t},n,r,i){const{allNullValues:s,doc:l,indent:c,indentStep:f,options:{commentString:h,indentSeq:p,simpleKeys:g}}=n;let v=rn(e)&&e.comment||null;if(g){if(v)throw new Error("With simple keys, key nodes cannot have comments");if(nn(e)||!rn(e)&&typeof e=="object"){const A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let y=!g&&(!e||v&&t==null&&!n.inFlow||nn(e)||(Ot(e)?e.type===qe.BLOCK_FOLDED||e.type===qe.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!y&&(g||!s),indent:c+f});let w=!1,S=!1,N=Rc(e,n,()=>w=!0,()=>S=!0);if(!y&&!n.inFlow&&N.length>1024){if(g)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");y=!0}if(n.inFlow){if(s||t==null)return w&&r&&r(),N===""?"?":y?`? ${N}`:N}else if(s&&!g||t==null&&y)return N=`? ${N}`,v&&!w?N+=Po(N,n.indent,h(v)):S&&i&&i(),N;w&&(v=null),y?(v&&(N+=Po(N,n.indent,h(v))),N=`? ${N}
129
- ${c}:`):(N=`${N}:`,v&&(N+=Po(N,n.indent,h(v))));let C,E,k;rn(t)?(C=!!t.spaceBefore,E=t.commentBefore,k=t.comment):(C=!1,E=null,k=null,t&&typeof t=="object"&&(t=l.createNode(t))),n.implicitKey=!1,!y&&!v&&Ot(t)&&(n.indentAtStart=N.length+1),S=!1,!p&&f.length>=2&&!n.inFlow&&!y&&df(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let O=!1;const T=Rc(t,n,()=>O=!0,()=>S=!0);let P=" ";if(v||C||E){if(P=C?`
130
- `:"",E){const A=h(E);P+=`
131
- ${_a(A,n.indent)}`}T===""&&!n.inFlow?P===`
132
- `&&k&&(P=`
133
-
134
- `):P+=`
135
- ${n.indent}`}else if(!y&&nn(t)){const A=T[0],z=T.indexOf(`
136
- `),R=z!==-1,q=n.inFlow??t.flow??t.items.length===0;if(R||!q){let U=!1;if(R&&(A==="&"||A==="!")){let L=T.indexOf(" ");A==="&"&&L!==-1&&L<z&&T[L+1]==="!"&&(L=T.indexOf(" ",L+1)),(L===-1||z<L)&&(U=!0)}U||(P=`
137
- ${n.indent}`)}}else(T===""||T[0]===`
138
- `)&&(P="");return N+=P+T,n.inFlow?O&&r&&r():k&&!O?N+=Po(N,n.indent,h(k)):S&&i&&i(),N}function NX(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const fp="<<",Ea={identify:e=>e===fp||typeof e=="symbol"&&e.description===fp,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new qe(Symbol(fp)),{addToJSMap:pI}),stringify:()=>fp},CX=(e,t)=>(Ea.identify(t)||Ot(t)&&(!t.type||t.type===qe.PLAIN)&&Ea.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===Ea.tag&&n.default);function pI(e,t,n){if(n=e&&fl(n)?n.resolve(e.doc):n,df(n))for(const r of n.items)_b(e,t,r);else if(Array.isArray(n))for(const r of n)_b(e,t,r);else _b(e,t,n)}function _b(e,t,n){const r=e&&fl(n)?n.resolve(e.doc):n;if(!uf(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,e,Map);for(const[s,l]of i)t instanceof Map?t.has(s)||t.set(s,l):t instanceof Set?t.add(s):Object.prototype.hasOwnProperty.call(t,s)||Object.defineProperty(t,s,{value:l,writable:!0,enumerable:!0,configurable:!0});return t}function mI(e,t,{key:n,value:r}){if(rn(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(CX(e,n))pI(e,t,r);else{const i=ri(n,"",e);if(t instanceof Map)t.set(i,ri(r,i,e));else if(t instanceof Set)t.add(i);else{const s=OX(n,i,e),l=ri(r,s,e);s in t?Object.defineProperty(t,s,{value:l,writable:!0,enumerable:!0,configurable:!0}):t[s]=l}}return t}function OX(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(rn(e)&&n?.doc){const r=hI(n.doc,{});r.anchors=new Set;for(const s of n.anchors.keys())r.anchors.add(s.anchor);r.inFlow=!0,r.inStringifyKey=!0;const i=e.toString(r);if(!n.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),NX(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(t)}function T1(e,t,n){const r=qd(e,void 0,n),i=qd(t,void 0,n);return new rr(r,i)}class rr{constructor(t,n=null){Object.defineProperty(this,ii,{value:aI}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return rn(n)&&(n=n.clone(t)),rn(r)&&(r=r.clone(t)),new rr(n,r)}toJSON(t,n){const r=n?.mapAsMap?new Map:{};return mI(n,r,this)}toString(t,n,r){return t?.doc?jX(this,t,n,r):JSON.stringify(this)}}function gI(e,t,n){return(t.inFlow??e.flow?kX:_X)(e,t,n)}function _X({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:s,onChompKeep:l,onComment:c}){const{indent:f,options:{commentString:h}}=n,p=Object.assign({},n,{indent:s,type:null});let g=!1;const v=[];for(let w=0;w<t.length;++w){const S=t[w];let N=null;if(rn(S))!g&&S.spaceBefore&&v.push(""),wm(n,v,S.commentBefore,g),S.comment&&(N=S.comment);else if(an(S)){const E=rn(S.key)?S.key:null;E&&(!g&&E.spaceBefore&&v.push(""),wm(n,v,E.commentBefore,g))}g=!1;let C=Rc(S,p,()=>N=null,()=>g=!0);N&&(C+=Po(C,s,h(N))),g&&N&&(g=!1),v.push(r+C)}let y;if(v.length===0)y=i.start+i.end;else{y=v[0];for(let w=1;w<v.length;++w){const S=v[w];y+=S?`
139
- ${f}${S}`:`
140
- `}}return e?(y+=`
141
- `+_a(h(e),f),c&&c()):g&&l&&l(),y}function kX({items:e},t,{flowChars:n,itemIndent:r}){const{indent:i,indentStep:s,flowCollectionPadding:l,options:{commentString:c}}=t;r+=s;const f=Object.assign({},t,{indent:r,inFlow:!0,type:null});let h=!1,p=0;const g=[];for(let w=0;w<e.length;++w){const S=e[w];let N=null;if(rn(S))S.spaceBefore&&g.push(""),wm(t,g,S.commentBefore,!1),S.comment&&(N=S.comment);else if(an(S)){const E=rn(S.key)?S.key:null;E&&(E.spaceBefore&&g.push(""),wm(t,g,E.commentBefore,!1),E.comment&&(h=!0));const k=rn(S.value)?S.value:null;k?(k.comment&&(N=k.comment),k.commentBefore&&(h=!0)):S.value==null&&E?.comment&&(N=E.comment)}N&&(h=!0);let C=Rc(S,f,()=>N=null);w<e.length-1&&(C+=","),N&&(C+=Po(C,r,c(N))),!h&&(g.length>p||C.includes(`
142
- `))&&(h=!0),g.push(C),p=g.length}const{start:v,end:y}=n;if(g.length===0)return v+y;if(!h){const w=g.reduce((S,N)=>S+N.length+2,2);h=t.options.lineWidth>0&&w>t.options.lineWidth}if(h){let w=v;for(const S of g)w+=S?`
143
- ${s}${i}${S}`:`
144
- `;return`${w}
145
- ${i}${y}`}else return`${v}${l}${g.join(" ")}${l}${y}`}function wm({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const s=_a(t(r),e);n.push(s.trimStart())}}function zo(e,t){const n=Ot(t)?t.value:t;for(const r of e)if(an(r)&&(r.key===t||r.key===n||Ot(r.key)&&r.key.value===n))return r}class Qr extends dI{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Rs,t),this.items=[]}static from(t,n,r){const{keepUndefined:i,replacer:s}=r,l=new this(t),c=(f,h)=>{if(typeof s=="function")h=s.call(n,f,h);else if(Array.isArray(s)&&!s.includes(f))return;(h!==void 0||i)&&l.items.push(T1(f,h,r))};if(n instanceof Map)for(const[f,h]of n)c(f,h);else if(n&&typeof n=="object")for(const f of Object.keys(n))c(f,n[f]);return typeof t.sortMapEntries=="function"&&l.items.sort(t.sortMapEntries),l}add(t,n){let r;an(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new rr(t,t?.value):r=new rr(t.key,t.value);const i=zo(this.items,r.key),s=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);Ot(i.value)&&uI(r.value)?i.value.value=r.value:i.value=r.value}else if(s){const l=this.items.findIndex(c=>s(r,c)<0);l===-1?this.items.push(r):this.items.splice(l,0,r)}else this.items.push(r)}delete(t){const n=zo(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=zo(this.items,t)?.value;return(!n&&Ot(i)?i.value:i)??void 0}has(t){return!!zo(this.items,t)}set(t,n){this.add(new rr(t,n),!0)}toJSON(t,n,r){const i=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(i);for(const s of this.items)mI(n,i,s);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(const i of this.items)if(!an(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),gI(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const Jc={collection:"map",default:!0,nodeClass:Qr,tag:"tag:yaml.org,2002:map",resolve(e,t){return uf(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Qr.from(e,t,n)};class Qo extends dI{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Qc,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=hp(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=hp(t);if(typeof r!="number")return;const i=this.items[r];return!n&&Ot(i)?i.value:i}has(t){const n=hp(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=hp(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const i=this.items[r];Ot(i)&&uI(n)?i.value=n:this.items[r]=n}toJSON(t,n){const r=[];n?.onCreate&&n.onCreate(r);let i=0;for(const s of this.items)r.push(ri(s,String(i++),n));return r}toString(t,n,r){return t?gI(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:i}=r,s=new this(t);if(n&&Symbol.iterator in Object(n)){let l=0;for(let c of n){if(typeof i=="function"){const f=n instanceof Set?c:String(l++);c=i.call(n,f,c)}s.items.push(qd(c,void 0,r))}}return s}}function hp(e){let t=Ot(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const eu={collection:"seq",default:!0,nodeClass:Qo,tag:"tag:yaml.org,2002:seq",resolve(e,t){return df(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Qo.from(e,t,n)},Hg={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),E1(e,t,n,r)}},Gg={identify:e=>e==null,createNode:()=>new qe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new qe(null),stringify:({source:e},t)=>typeof e=="string"&&Gg.test.test(e)?e:t.options.nullStr},P1={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new qe(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&P1.test.test(e)){const r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};function ki({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(s)){let l=s.indexOf(".");l<0&&(l=s.length,s+=".");let c=t-(s.length-l-1);for(;c-- >0;)s+="0"}return s}const vI={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ki},yI={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():ki(e)}},bI={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new qe(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:ki},Vg=e=>typeof e=="bigint"||Number.isInteger(e),z1=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function xI(e,t,n){const{value:r}=e;return Vg(r)&&r>=0?n+r.toString(t):ki(e)}const wI={identify:e=>Vg(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>z1(e,2,8,n),stringify:e=>xI(e,8,"0o")},SI={identify:Vg,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>z1(e,0,10,n),stringify:ki},jI={identify:e=>Vg(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>z1(e,2,16,n),stringify:e=>xI(e,16,"0x")},AX=[Jc,eu,Hg,Gg,P1,wI,SI,jI,vI,yI,bI];function wE(e){return typeof e=="bigint"||Number.isInteger(e)}const pp=({value:e})=>JSON.stringify(e),EX=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:pp},{identify:e=>e==null,createNode:()=>new qe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:pp},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:pp},{identify:wE,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>wE(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:pp}],TX={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},PX=[Jc,eu].concat(EX,TX),M1={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},r,i,s){if(!n)return"";const l=n;let c;if(typeof btoa=="function"){let f="";for(let h=0;h<l.length;++h)f+=String.fromCharCode(l[h]);c=btoa(f)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=qe.BLOCK_LITERAL),t!==qe.QUOTE_DOUBLE){const f=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),h=Math.ceil(c.length/f),p=new Array(h);for(let g=0,v=0;g<h;++g,v+=f)p[g]=c.substr(v,f);c=p.join(t===qe.BLOCK_LITERAL?`
146
- `:" ")}return E1({comment:e,type:t,value:c},r,i,s)}};function NI(e,t){if(df(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!an(r)){if(uf(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const i=r.items[0]||new rr(new qe(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
147
- ${i.key.commentBefore}`:r.commentBefore),r.comment){const s=i.value??i.key;s.comment=s.comment?`${r.comment}
148
- ${s.comment}`:r.comment}r=i}e.items[n]=an(r)?r:new rr(r)}}else t("Expected a sequence for this tag");return e}function CI(e,t,n){const{replacer:r}=n,i=new Qo(e);i.tag="tag:yaml.org,2002:pairs";let s=0;if(t&&Symbol.iterator in Object(t))for(let l of t){typeof r=="function"&&(l=r.call(t,String(s++),l));let c,f;if(Array.isArray(l))if(l.length===2)c=l[0],f=l[1];else throw new TypeError(`Expected [key, value] tuple: ${l}`);else if(l&&l instanceof Object){const h=Object.keys(l);if(h.length===1)c=h[0],f=l[c];else throw new TypeError(`Expected tuple with one key, not ${h.length} keys`)}else c=l;i.items.push(T1(c,f,n))}return i}const R1={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:NI,createNode:CI};class Oc extends Qo{constructor(){super(),this.add=Qr.prototype.add.bind(this),this.delete=Qr.prototype.delete.bind(this),this.get=Qr.prototype.get.bind(this),this.has=Qr.prototype.has.bind(this),this.set=Qr.prototype.set.bind(this),this.tag=Oc.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n?.onCreate&&n.onCreate(r);for(const i of this.items){let s,l;if(an(i)?(s=ri(i.key,"",n),l=ri(i.value,s,n)):s=ri(i,"",n),r.has(s))throw new Error("Ordered maps must not include duplicate keys");r.set(s,l)}return r}static from(t,n,r){const i=CI(t,n,r),s=new this;return s.items=i.items,s}}Oc.tag="tag:yaml.org,2002:omap";const D1={collection:"seq",identify:e=>e instanceof Map,nodeClass:Oc,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=NI(e,t),r=[];for(const{key:i}of n.items)Ot(i)&&(r.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new Oc,n)},createNode:(e,t,n)=>Oc.from(e,t,n)};function OI({value:e,source:t},n){return t&&(e?_I:kI).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const _I={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new qe(!0),stringify:OI},kI={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new qe(!1),stringify:OI},zX={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ki},MX={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():ki(e)}},RX={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new qe(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:ki},ff=e=>typeof e=="bigint"||Number.isInteger(e);function Zg(e,t,n,{intAsBigInt:r}){const i=e[0];if((i==="-"||i==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const l=BigInt(e);return i==="-"?BigInt(-1)*l:l}const s=parseInt(e,n);return i==="-"?-1*s:s}function I1(e,t,n){const{value:r}=e;if(ff(r)){const i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return ki(e)}const DX={identify:ff,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Zg(e,2,2,n),stringify:e=>I1(e,2,"0b")},IX={identify:ff,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Zg(e,1,8,n),stringify:e=>I1(e,8,"0")},LX={identify:ff,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Zg(e,0,10,n),stringify:ki},$X={identify:ff,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Zg(e,2,16,n),stringify:e=>I1(e,16,"0x")};class _c extends Qr{constructor(t){super(t),this.tag=_c.tag}add(t){let n;an(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new rr(t.key,null):n=new rr(t,null),zo(this.items,n.key)||this.items.push(n)}get(t,n){const r=zo(this.items,t);return!n&&an(r)?Ot(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=zo(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new rr(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:i}=r,s=new this(t);if(n&&Symbol.iterator in Object(n))for(let l of n)typeof i=="function"&&(l=i.call(n,l,l)),s.items.push(T1(l,null,r));return s}}_c.tag="tag:yaml.org,2002:set";const L1={collection:"map",identify:e=>e instanceof Set,nodeClass:_c,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>_c.from(e,t,n),resolve(e,t){if(uf(e)){if(e.hasAllNullValues(!0))return Object.assign(new _c,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function $1(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,i=l=>t?BigInt(l):Number(l),s=r.replace(/_/g,"").split(":").reduce((l,c)=>l*i(60)+i(c),i(0));return n==="-"?i(-1)*s:s}function AI(e){let{value:t}=e,n=l=>l;if(typeof t=="bigint")n=l=>BigInt(l);else if(isNaN(t)||!isFinite(t))return ki(e);let r="";t<0&&(r="-",t*=n(-1));const i=n(60),s=[t%i];return t<60?s.unshift(0):(t=(t-s[0])/i,s.unshift(t%i),t>=60&&(t=(t-s[0])/i,s.unshift(t))),r+s.map(l=>String(l).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const EI={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>$1(e,n),stringify:AI},TI={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>$1(e,!1),stringify:AI},Yg={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(Yg.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,s,l,c]=t.map(Number),f=t[7]?Number((t[7]+"00").substr(1,3)):0;let h=Date.UTC(n,r-1,i,s||0,l||0,c||0,f);const p=t[8];if(p&&p!=="Z"){let g=$1(p,!1);Math.abs(g)<30&&(g*=60),h-=6e4*g}return new Date(h)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},SE=[Jc,eu,Hg,Gg,_I,kI,DX,IX,LX,$X,zX,MX,RX,M1,Ea,D1,R1,L1,EI,TI,Yg],jE=new Map([["core",AX],["failsafe",[Jc,eu,Hg]],["json",PX],["yaml11",SE],["yaml-1.1",SE]]),NE={binary:M1,bool:P1,float:bI,floatExp:yI,floatNaN:vI,floatTime:TI,int:SI,intHex:jI,intOct:wI,intTime:EI,map:Jc,merge:Ea,null:Gg,omap:D1,pairs:R1,seq:eu,set:L1,timestamp:Yg},UX={"tag:yaml.org,2002:binary":M1,"tag:yaml.org,2002:merge":Ea,"tag:yaml.org,2002:omap":D1,"tag:yaml.org,2002:pairs":R1,"tag:yaml.org,2002:set":L1,"tag:yaml.org,2002:timestamp":Yg};function kb(e,t,n){const r=jE.get(t);if(r&&!e)return n&&!r.includes(Ea)?r.concat(Ea):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{const s=Array.from(jE.keys()).filter(l=>l!=="yaml11").map(l=>JSON.stringify(l)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${s} or define customTags array`)}if(Array.isArray(e))for(const s of e)i=i.concat(s);else typeof e=="function"&&(i=e(i.slice()));return n&&(i=i.concat(Ea)),i.reduce((s,l)=>{const c=typeof l=="string"?NE[l]:l;if(!c){const f=JSON.stringify(l),h=Object.keys(NE).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${h}`)}return s.includes(c)||s.push(c),s},[])}const BX=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class U1{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:s,sortMapEntries:l,toStringDefaults:c}){this.compat=Array.isArray(t)?kb(t,"compat"):t?kb(null,t):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?UX:{},this.tags=kb(n,this.name,r),this.toStringOptions=c??null,Object.defineProperty(this,Rs,{value:Jc}),Object.defineProperty(this,Yi,{value:Hg}),Object.defineProperty(this,Qc,{value:eu}),this.sortMapEntries=typeof l=="function"?l:l===!0?BX:null}clone(){const t=Object.create(U1.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function qX(e,t){const n=[];let r=t.directives===!0;if(t.directives!==!1&&e.directives){const f=e.directives.toString(e);f?(n.push(f),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const i=hI(e,t),{commentString:s}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const f=s(e.commentBefore);n.unshift(_a(f,""))}let l=!1,c=null;if(e.contents){if(rn(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const p=s(e.contents.commentBefore);n.push(_a(p,""))}i.forceBlockIndent=!!e.comment,c=e.contents.comment}const f=c?void 0:()=>l=!0;let h=Rc(e.contents,i,()=>c=null,f);c&&(h+=Po(h,"",s(c))),(h[0]==="|"||h[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${h}`:n.push(h)}else n.push(Rc(e.contents,i));if(e.directives?.docEnd)if(e.comment){const f=s(e.comment);f.includes(`
149
- `)?(n.push("..."),n.push(_a(f,""))):n.push(`... ${f}`)}else n.push("...");else{let f=e.comment;f&&l&&(f=f.replace(/^\n+/,"")),f&&((!l||c)&&n[n.length-1]!==""&&n.push(""),n.push(_a(s(f),"")))}return n.join(`
150
- `)+`
151
- `}class Wg{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,ii,{value:Iw});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);const s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=s;let{version:l}=s;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(l=this.directives.yaml.version)):this.directives=new er({version:l}),this.setSchema(l,r),this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){const t=Object.create(Wg.prototype,{[ii]:{value:Iw}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=rn(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){ic(this.contents)&&this.contents.add(t)}addIn(t,n){ic(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=lI(this);t.anchor=!n||r.has(n)?cI(n||"a",r):n}return new A1(t.anchor)}createNode(t,n,r){let i;if(typeof n=="function")t=n.call({"":t},"",t),i=n;else if(Array.isArray(n)){const N=E=>typeof E=="number"||E instanceof String||E instanceof Number,C=n.filter(N).map(String);C.length>0&&(n=n.concat(C)),i=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:s,anchorPrefix:l,flow:c,keepUndefined:f,onTagObj:h,tag:p}=r??{},{onAnchor:g,setAnchors:v,sourceObjects:y}=mX(this,l||"a"),w={aliasDuplicateObjects:s??!0,keepUndefined:f??!1,onAnchor:g,onTagObj:h,replacer:i,schema:this.schema,sourceObjects:y},S=qd(t,p,w);return c&&nn(S)&&(S.flow=!0),v(),S}createPair(t,n,r={}){const i=this.createNode(t,null,r),s=this.createNode(n,null,r);return new rr(i,s)}delete(t){return ic(this.contents)?this.contents.delete(t):!1}deleteIn(t){return wd(t)?this.contents==null?!1:(this.contents=null,!0):ic(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return nn(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return wd(t)?!n&&Ot(this.contents)?this.contents.value:this.contents:nn(this.contents)?this.contents.getIn(t,n):void 0}has(t){return nn(this.contents)?this.contents.has(t):!1}hasIn(t){return wd(t)?this.contents!==void 0:nn(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=xm(this.schema,[t],n):ic(this.contents)&&this.contents.set(t,n)}setIn(t,n){wd(t)?this.contents=n:this.contents==null?this.contents=xm(this.schema,Array.from(t),n):ic(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new er({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new er({version:t}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const i=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new U1(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:s,reviver:l}={}){const c={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},f=ri(this.contents,n??"",c);if(typeof s=="function")for(const{count:h,res:p}of c.anchors.values())s(p,h);return typeof l=="function"?bc(l,{"":f},"",f):f}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return qX(this,t)}}function ic(e){if(nn(e))return!0;throw new Error("Expected a YAML collection as document contents")}class PI extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}}class mp extends PI{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class FX extends PI{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const CE=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(c=>t.linePos(c));const{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let s=i-1,l=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(s>=60&&l.length>80){const c=Math.min(s-39,l.length-79);l="…"+l.substring(c),s-=c-1}if(l.length>80&&(l=l.substring(0,79)+"…"),r>1&&/^ *$/.test(l.substring(0,s))){let c=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);c.length>80&&(c=c.substring(0,79)+`…
152
- `),l=c+l}if(/[^ ]/.test(l)){let c=1;const f=n.linePos[1];f?.line===r&&f.col>i&&(c=Math.max(1,Math.min(f.col-i,80-s)));const h=" ".repeat(s)+"^".repeat(c);n.message+=`:
153
-
154
- ${l}
155
- ${h}
156
- `}};function Dc(e,{flow:t,indicator:n,next:r,offset:i,onError:s,parentIndent:l,startOnNewline:c}){let f=!1,h=c,p=c,g="",v="",y=!1,w=!1,S=null,N=null,C=null,E=null,k=null,O=null,T=null;for(const z of e)switch(w&&(z.type!=="space"&&z.type!=="newline"&&z.type!=="comma"&&s(z.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),S&&(h&&z.type!=="comment"&&z.type!=="newline"&&s(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),S=null),z.type){case"space":!t&&(n!=="doc-start"||r?.type!=="flow-collection")&&z.source.includes(" ")&&(S=z),p=!0;break;case"comment":{p||s(z,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const R=z.source.substring(1)||" ";g?g+=v+R:g=R,v="",h=!1;break}case"newline":h?g?g+=z.source:(!O||n!=="seq-item-ind")&&(f=!0):v+=z.source,h=!0,y=!0,(N||C)&&(E=z),p=!0;break;case"anchor":N&&s(z,"MULTIPLE_ANCHORS","A node can have at most one anchor"),z.source.endsWith(":")&&s(z.offset+z.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),N=z,T??(T=z.offset),h=!1,p=!1,w=!0;break;case"tag":{C&&s(z,"MULTIPLE_TAGS","A node can have at most one tag"),C=z,T??(T=z.offset),h=!1,p=!1,w=!0;break}case n:(N||C)&&s(z,"BAD_PROP_ORDER",`Anchors and tags must be after the ${z.source} indicator`),O&&s(z,"UNEXPECTED_TOKEN",`Unexpected ${z.source} in ${t??"collection"}`),O=z,h=n==="seq-item-ind"||n==="explicit-key-ind",p=!1;break;case"comma":if(t){k&&s(z,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),k=z,h=!1,p=!1;break}default:s(z,"UNEXPECTED_TOKEN",`Unexpected ${z.type} token`),h=!1,p=!1}const P=e[e.length-1],A=P?P.offset+P.source.length:i;return w&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&s(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),S&&(h&&S.indent<=l||r?.type==="block-map"||r?.type==="block-seq")&&s(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:O,spaceBefore:f,comment:g,hasNewline:y,anchor:N,tag:C,newlineAfterProp:E,end:A,start:T??A}}function Fd(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
157
- `))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(Fd(t.key)||Fd(t.value))return!0}return!1;default:return!0}}function Bw(e,t,n){if(t?.type==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Fd(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function zI(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const i=typeof r=="function"?r:(s,l)=>s===l||Ot(s)&&Ot(l)&&s.value===l.value;return t.some(s=>i(s.key,n))}const OE="All mapping items must start at the same column";function KX({composeNode:e,composeEmptyNode:t},n,r,i,s){const l=s?.nodeClass??Qr,c=new l(n.schema);n.atRoot&&(n.atRoot=!1);let f=r.offset,h=null;for(const p of r.items){const{start:g,key:v,sep:y,value:w}=p,S=Dc(g,{indicator:"explicit-key-ind",next:v??y?.[0],offset:f,onError:i,parentIndent:r.indent,startOnNewline:!0}),N=!S.found;if(N){if(v&&(v.type==="block-seq"?i(f,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in v&&v.indent!==r.indent&&i(f,"BAD_INDENT",OE)),!S.anchor&&!S.tag&&!y){h=S.end,S.comment&&(c.comment?c.comment+=`
158
- `+S.comment:c.comment=S.comment);continue}(S.newlineAfterProp||Fd(v))&&i(v??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else S.found?.indent!==r.indent&&i(f,"BAD_INDENT",OE);n.atKey=!0;const C=S.end,E=v?e(n,v,S,i):t(n,C,g,null,S,i);n.schema.compat&&Bw(r.indent,v,i),n.atKey=!1,zI(n,c.items,E)&&i(C,"DUPLICATE_KEY","Map keys must be unique");const k=Dc(y??[],{indicator:"map-value-ind",next:w,offset:E.range[2],onError:i,parentIndent:r.indent,startOnNewline:!v||v.type==="block-scalar"});if(f=k.end,k.found){N&&(w?.type==="block-map"&&!k.hasNewline&&i(f,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&S.start<k.found.offset-1024&&i(E.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const O=w?e(n,w,k,i):t(n,f,y,null,k,i);n.schema.compat&&Bw(r.indent,w,i),f=O.range[2];const T=new rr(E,O);n.options.keepSourceTokens&&(T.srcToken=p),c.items.push(T)}else{N&&i(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(E.comment?E.comment+=`
159
- `+k.comment:E.comment=k.comment);const O=new rr(E);n.options.keepSourceTokens&&(O.srcToken=p),c.items.push(O)}}return h&&h<f&&i(h,"IMPOSSIBLE","Map comment with trailing content"),c.range=[r.offset,f,h??f],c}function HX({composeNode:e,composeEmptyNode:t},n,r,i,s){const l=s?.nodeClass??Qo,c=new l(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=r.offset,h=null;for(const{start:p,value:g}of r.items){const v=Dc(p,{indicator:"seq-item-ind",next:g,offset:f,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!v.found)if(v.anchor||v.tag||g)g?.type==="block-seq"?i(v.end,"BAD_INDENT","All sequence items must start at the same column"):i(f,"MISSING_CHAR","Sequence item without - indicator");else{h=v.end,v.comment&&(c.comment=v.comment);continue}const y=g?e(n,g,v,i):t(n,v.end,p,null,v,i);n.schema.compat&&Bw(r.indent,g,i),f=y.range[2],c.items.push(y)}return c.range=[r.offset,f,h??f],c}function hf(e,t,n,r){let i="";if(e){let s=!1,l="";for(const c of e){const{source:f,type:h}=c;switch(h){case"space":s=!0;break;case"comment":{n&&!s&&r(c,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const p=f.substring(1)||" ";i?i+=l+p:i=p,l="";break}case"newline":i&&(l+=f),s=!0;break;default:r(c,"UNEXPECTED_TOKEN",`Unexpected ${h} at node end`)}t+=f.length}}return{comment:i,offset:t}}const Ab="Block collections are not allowed within flow collections",Eb=e=>e&&(e.type==="block-map"||e.type==="block-seq");function GX({composeNode:e,composeEmptyNode:t},n,r,i,s){const l=r.start.source==="{",c=l?"flow map":"flow sequence",f=s?.nodeClass??(l?Qr:Qo),h=new f(n.schema);h.flow=!0;const p=n.atRoot;p&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let g=r.offset+r.start.source.length;for(let N=0;N<r.items.length;++N){const C=r.items[N],{start:E,key:k,sep:O,value:T}=C,P=Dc(E,{flow:c,indicator:"explicit-key-ind",next:k??O?.[0],offset:g,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!P.found){if(!P.anchor&&!P.tag&&!O&&!T){N===0&&P.comma?i(P.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`):N<r.items.length-1&&i(P.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${c}`),P.comment&&(h.comment?h.comment+=`
160
- `+P.comment:h.comment=P.comment),g=P.end;continue}!l&&n.options.strict&&Fd(k)&&i(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(N===0)P.comma&&i(P.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`);else if(P.comma||i(P.start,"MISSING_CHAR",`Missing , between ${c} items`),P.comment){let A="";e:for(const z of E)switch(z.type){case"comma":case"space":break;case"comment":A=z.source.substring(1);break e;default:break e}if(A){let z=h.items[h.items.length-1];an(z)&&(z=z.value??z.key),z.comment?z.comment+=`
161
- `+A:z.comment=A,P.comment=P.comment.substring(A.length+1)}}if(!l&&!O&&!P.found){const A=T?e(n,T,P,i):t(n,P.end,O,null,P,i);h.items.push(A),g=A.range[2],Eb(T)&&i(A.range,"BLOCK_IN_FLOW",Ab)}else{n.atKey=!0;const A=P.end,z=k?e(n,k,P,i):t(n,A,E,null,P,i);Eb(k)&&i(z.range,"BLOCK_IN_FLOW",Ab),n.atKey=!1;const R=Dc(O??[],{flow:c,indicator:"map-value-ind",next:T,offset:z.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(R.found){if(!l&&!P.found&&n.options.strict){if(O)for(const L of O){if(L===R.found)break;if(L.type==="newline"){i(L,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}P.start<R.found.offset-1024&&i(R.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else T&&("source"in T&&T.source?.[0]===":"?i(T,"MISSING_CHAR",`Missing space after : in ${c}`):i(R.start,"MISSING_CHAR",`Missing , or : between ${c} items`));const q=T?e(n,T,R,i):R.found?t(n,R.end,O,null,R,i):null;q?Eb(T)&&i(q.range,"BLOCK_IN_FLOW",Ab):R.comment&&(z.comment?z.comment+=`
162
- `+R.comment:z.comment=R.comment);const U=new rr(z,q);if(n.options.keepSourceTokens&&(U.srcToken=C),l){const L=h;zI(n,L.items,z)&&i(A,"DUPLICATE_KEY","Map keys must be unique"),L.items.push(U)}else{const L=new Qr(n.schema);L.flow=!0,L.items.push(U);const ae=(q??z).range;L.range=[z.range[0],ae[1],ae[2]],h.items.push(L)}g=q?q.range[2]:R.end}}const v=l?"}":"]",[y,...w]=r.end;let S=g;if(y?.source===v)S=y.offset+y.source.length;else{const N=c[0].toUpperCase()+c.substring(1),C=p?`${N} must end with a ${v}`:`${N} in block collection must be sufficiently indented and end with a ${v}`;i(g,p?"MISSING_CHAR":"BAD_INDENT",C),y&&y.source.length!==1&&w.unshift(y)}if(w.length>0){const N=hf(w,S,n.options.strict,i);N.comment&&(h.comment?h.comment+=`
163
- `+N.comment:h.comment=N.comment),h.range=[r.offset,S,N.offset]}else h.range=[r.offset,S,S];return h}function Tb(e,t,n,r,i,s){const l=n.type==="block-map"?KX(e,t,n,r,s):n.type==="block-seq"?HX(e,t,n,r,s):GX(e,t,n,r,s),c=l.constructor;return i==="!"||i===c.tagName?(l.tag=c.tagName,l):(i&&(l.tag=i),l)}function VX(e,t,n,r,i){const s=r.tag,l=s?t.directives.tagName(s.source,v=>i(s,"TAG_RESOLVE_FAILED",v)):null;if(n.type==="block-seq"){const{anchor:v,newlineAfterProp:y}=r,w=v&&s?v.offset>s.offset?v:s:v??s;w&&(!y||y.offset<w.offset)&&i(w,"MISSING_CHAR","Missing newline after block sequence props")}const c=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!s||!l||l==="!"||l===Qr.tagName&&c==="map"||l===Qo.tagName&&c==="seq")return Tb(e,t,n,i,l);let f=t.schema.tags.find(v=>v.tag===l&&v.collection===c);if(!f){const v=t.schema.knownTags[l];if(v?.collection===c)t.schema.tags.push(Object.assign({},v,{default:!1})),f=v;else return v?i(s,"BAD_COLLECTION_TYPE",`${v.tag} used for ${c} collection, but expects ${v.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${l}`,!0),Tb(e,t,n,i,l)}const h=Tb(e,t,n,i,l,f),p=f.resolve?.(h,v=>i(s,"TAG_RESOLVE_FAILED",v),t.options)??h,g=rn(p)?p:new qe(p);return g.range=h.range,g.tag=l,f?.format&&(g.format=f.format),g}function ZX(e,t,n){const r=t.offset,i=YX(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};const s=i.mode===">"?qe.BLOCK_FOLDED:qe.BLOCK_LITERAL,l=t.source?WX(t.source):[];let c=l.length;for(let S=l.length-1;S>=0;--S){const N=l[S][1];if(N===""||N==="\r")c=S;else break}if(c===0){const S=i.chomp==="+"&&l.length>0?`
164
- `.repeat(Math.max(1,l.length-1)):"";let N=r+i.length;return t.source&&(N+=t.source.length),{value:S,type:s,comment:i.comment,range:[r,N,N]}}let f=t.indent+i.indent,h=t.offset+i.length,p=0;for(let S=0;S<c;++S){const[N,C]=l[S];if(C===""||C==="\r")i.indent===0&&N.length>f&&(f=N.length);else{N.length<f&&n(h+N.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(f=N.length),p=S,f===0&&!e.atRoot&&n(h,"BAD_INDENT","Block scalar values in collections must be indented");break}h+=N.length+C.length+1}for(let S=l.length-1;S>=c;--S)l[S][0].length>f&&(c=S+1);let g="",v="",y=!1;for(let S=0;S<p;++S)g+=l[S][0].slice(f)+`
165
- `;for(let S=p;S<c;++S){let[N,C]=l[S];h+=N.length+C.length+1;const E=C[C.length-1]==="\r";if(E&&(C=C.slice(0,-1)),C&&N.length<f){const O=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(h-C.length-(E?2:1),"BAD_INDENT",O),N=""}s===qe.BLOCK_LITERAL?(g+=v+N.slice(f)+C,v=`
166
- `):N.length>f||C[0]===" "?(v===" "?v=`
167
- `:!y&&v===`
168
- `&&(v=`
169
-
170
- `),g+=v+N.slice(f)+C,v=`
171
- `,y=!0):C===""?v===`
172
- `?g+=`
173
- `:v=`
174
- `:(g+=v+C,v=" ",y=!1)}switch(i.chomp){case"-":break;case"+":for(let S=c;S<l.length;++S)g+=`
175
- `+l[S][0].slice(f);g[g.length-1]!==`
176
- `&&(g+=`
177
- `);break;default:g+=`
178
- `}const w=r+i.length+t.source.length;return{value:g,type:s,comment:i.comment,range:[r,w,w]}}function YX({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=t[0],s=i[0];let l=0,c="",f=-1;for(let v=1;v<i.length;++v){const y=i[v];if(!c&&(y==="-"||y==="+"))c=y;else{const w=Number(y);!l&&w?l=w:f===-1&&(f=e+v)}}f!==-1&&r(f,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let h=!1,p="",g=i.length;for(let v=1;v<t.length;++v){const y=t[v];switch(y.type){case"space":h=!0;case"newline":g+=y.source.length;break;case"comment":n&&!h&&r(y,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),g+=y.source.length,p=y.source.substring(1);break;case"error":r(y,"UNEXPECTED_TOKEN",y.message),g+=y.source.length;break;default:{const w=`Unexpected token in block scalar header: ${y.type}`;r(y,"UNEXPECTED_TOKEN",w);const S=y.source;S&&typeof S=="string"&&(g+=S.length)}}}return{mode:s,indent:l,chomp:c,comment:p,length:g}}function WX(e){const t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),s=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let l=1;l<t.length;l+=2)s.push([t[l],t[l+1]]);return s}function QX(e,t,n){const{offset:r,type:i,source:s,end:l}=e;let c,f;const h=(v,y,w)=>n(r+v,y,w);switch(i){case"scalar":c=qe.PLAIN,f=XX(s,h);break;case"single-quoted-scalar":c=qe.QUOTE_SINGLE,f=JX(s,h);break;case"double-quoted-scalar":c=qe.QUOTE_DOUBLE,f=eJ(s,h);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+s.length,r+s.length]}}const p=r+s.length,g=hf(l,p,t,n);return{value:f,type:c,comment:g.comment,range:[r,p,g.offset]}}function XX(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),MI(e)}function JX(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),MI(e.slice(1,-1)).replace(/''/g,"'")}function MI(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
179
- `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
180
- `,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],s=" ",l=t.lastIndex;for(n.lastIndex=l;r=n.exec(e);)r[1]===""?s===`
181
- `?i+=s:s=`
182
- `:(i+=s+r[1],s=" "),l=n.lastIndex;const c=/[ \t]*(.*)/sy;return c.lastIndex=l,r=c.exec(e),i+s+(r?.[1]??"")}function eJ(e,t){let n="";for(let r=1;r<e.length-1;++r){const i=e[r];if(!(i==="\r"&&e[r+1]===`
183
- `))if(i===`
184
- `){const{fold:s,offset:l}=tJ(e,r);n+=s,r=l}else if(i==="\\"){let s=e[++r];const l=nJ[s];if(l)n+=l;else if(s===`
185
- `)for(s=e[r+1];s===" "||s===" ";)s=e[++r+1];else if(s==="\r"&&e[r+1]===`
186
- `)for(s=e[++r+1];s===" "||s===" ";)s=e[++r+1];else if(s==="x"||s==="u"||s==="U"){const c={x:2,u:4,U:8}[s];n+=rJ(e,r+1,c,t),r+=c}else{const c=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),n+=c}}else if(i===" "||i===" "){const s=r;let l=e[r+1];for(;l===" "||l===" ";)l=e[++r+1];l!==`
187
- `&&!(l==="\r"&&e[r+2]===`
188
- `)&&(n+=r>s?e.slice(s,r+1):i)}else n+=i}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function tJ(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===`
189
- `||r==="\r")&&!(r==="\r"&&e[t+2]!==`
190
- `);)r===`
191
- `&&(n+=`
192
- `),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const nJ={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
193
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function rJ(e,t,n,r){const i=e.substr(t,n),l=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(l)){const c=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),c}return String.fromCodePoint(l)}function RI(e,t,n,r){const{value:i,type:s,comment:l,range:c}=t.type==="block-scalar"?ZX(e,t,r):QX(t,e.options.strict,r),f=n?e.directives.tagName(n.source,g=>r(n,"TAG_RESOLVE_FAILED",g)):null;let h;e.options.stringKeys&&e.atKey?h=e.schema[Yi]:f?h=iJ(e.schema,i,f,n,r):t.type==="scalar"?h=aJ(e,i,t,r):h=e.schema[Yi];let p;try{const g=h.resolve(i,v=>r(n??t,"TAG_RESOLVE_FAILED",v),e.options);p=Ot(g)?g:new qe(g)}catch(g){const v=g instanceof Error?g.message:String(g);r(n??t,"TAG_RESOLVE_FAILED",v),p=new qe(i)}return p.range=c,p.source=i,s&&(p.type=s),f&&(p.tag=f),h.format&&(p.format=h.format),l&&(p.comment=l),p}function iJ(e,t,n,r,i){if(n==="!")return e[Yi];const s=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)s.push(c);else return c;for(const c of s)if(c.test?.test(t))return c;const l=e.knownTags[n];return l&&!l.collection?(e.tags.push(Object.assign({},l,{default:!1,test:void 0})),l):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Yi])}function aJ({atKey:e,directives:t,schema:n},r,i,s){const l=n.tags.find(c=>(c.default===!0||e&&c.default==="key")&&c.test?.test(r))||n[Yi];if(n.compat){const c=n.compat.find(f=>f.default&&f.test?.test(r))??n[Yi];if(l.tag!==c.tag){const f=t.tagString(l.tag),h=t.tagString(c.tag),p=`Value may be parsed as either ${f} or ${h}`;s(i,"TAG_RESOLVE_FAILED",p,!0)}}return l}function sJ(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let i=t[r];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}for(i=t[++r];i?.type==="space";)e+=i.source.length,i=t[++r];break}}return e}const oJ={composeNode:DI,composeEmptyNode:B1};function DI(e,t,n,r){const i=e.atKey,{spaceBefore:s,comment:l,anchor:c,tag:f}=n;let h,p=!0;switch(t.type){case"alias":h=lJ(e,t,r),(c||f)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":h=RI(e,t,f,r),c&&(h.anchor=c.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":h=VX(oJ,e,t,n,r),c&&(h.anchor=c.source.substring(1));break;default:{const g=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",g),h=B1(e,t.offset,void 0,null,n,r),p=!1}}return c&&h.anchor===""&&r(c,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!Ot(h)||typeof h.value!="string"||h.tag&&h.tag!=="tag:yaml.org,2002:str")&&r(f??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(h.spaceBefore=!0),l&&(t.type==="scalar"&&t.source===""?h.comment=l:h.commentBefore=l),e.options.keepSourceTokens&&p&&(h.srcToken=t),h}function B1(e,t,n,r,{spaceBefore:i,comment:s,anchor:l,tag:c,end:f},h){const p={type:"scalar",offset:sJ(t,n,r),indent:-1,source:""},g=RI(e,p,c,h);return l&&(g.anchor=l.source.substring(1),g.anchor===""&&h(l,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(g.spaceBefore=!0),s&&(g.comment=s,g.range[2]=f),g}function lJ({options:e},{offset:t,source:n,end:r},i){const s=new A1(n.substring(1));s.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const l=t+n.length,c=hf(r,l,e.strict,i);return s.range=[t,l,c.offset],c.comment&&(s.comment=c.comment),s}function cJ(e,t,{offset:n,start:r,value:i,end:s},l){const c=Object.assign({_directives:t},e),f=new Wg(void 0,c),h={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},p=Dc(r,{indicator:"doc-start",next:i??s?.[0],offset:n,onError:l,parentIndent:0,startOnNewline:!0});p.found&&(f.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!p.hasNewline&&l(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),f.contents=i?DI(h,i,p,l):B1(h,p.end,r,null,p,l);const g=f.contents.range[2],v=hf(s,g,!1,l);return v.comment&&(f.comment=v.comment),f.range=[n,g,v.offset],f}function cd(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function _E(e){let t="",n=!1,r=!1;for(let i=0;i<e.length;++i){const s=e[i];switch(s[0]){case"#":t+=(t===""?"":r?`
194
-
195
- `:`
196
- `)+(s.substring(1)||" "),n=!0,r=!1;break;case"%":e[i+1]?.[0]!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}class uJ{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,s)=>{const l=cd(n);s?this.warnings.push(new FX(l,r,i)):this.errors.push(new mp(l,r,i))},this.directives=new er({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:i}=_E(this.prelude);if(r){const s=t.contents;if(n)t.comment=t.comment?`${t.comment}
197
- ${r}`:r;else if(i||t.directives.docStart||!s)t.commentBefore=r;else if(nn(s)&&!s.flow&&s.items.length>0){let l=s.items[0];an(l)&&(l=l.key);const c=l.commentBefore;l.commentBefore=c?`${r}
198
- ${c}`:r}else{const l=s.commentBefore;s.commentBefore=l?`${r}
199
- ${l}`:r}}n?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:_E(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,r=-1){for(const i of t)yield*this.next(i);yield*this.end(n,r)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,r,i)=>{const s=cd(t);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=cJ(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,r=new mp(cd(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new mp(cd(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=hf(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const r=this.doc.comment;this.doc.comment=r?`${r}
200
- ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new mp(cd(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const r=Object.assign({_directives:this.directives},this.options),i=new Wg(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}}const II="\uFEFF",LI="",$I="",qw="";function dJ(e){switch(e){case II:return"byte-order-mark";case LI:return"doc-mode";case $I:return"flow-error-end";case qw:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
201
- `:case`\r
202
- `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function gi(e){switch(e){case void 0:case" ":case`
203
- `:case"\r":case" ":return!0;default:return!1}}const kE=new Set("0123456789ABCDEFabcdef"),fJ=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),gp=new Set(",[]{}"),hJ=new Set(` ,[]{}
204
- \r `),Pb=e=>!e||hJ.has(e);class pJ{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
205
- `?!0:n==="\r"?this.buffer[t+1]===`
206
- `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+t];if(n==="\r"){const i=this.buffer[r+t+1];if(i===`
207
- `||!i&&!this.atEnd)return t+r+1}return n===`
208
- `||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&gi(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
209
- `,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===II&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,r=t.indexOf("#");for(;r!==-1;){const s=t[r-1];if(s===" "||s===" "){n=r-1;break}else r=t.indexOf("#",r+1)}for(;;){const s=t[n-1];if(s===" "||s===" ")n-=1;else break}const i=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield LI,yield*this.parseLineStart()}*parseLineStart(){const t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const n=this.peek(3);if((n==="---"||n==="...")&&gi(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!gi(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&gi(n)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Pb),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,r=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&i[0]!=="#"||r===0&&(i.startsWith("---")||i.startsWith("..."))&&gi(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield $I,yield*this.parseLineStart();let s=0;for(;i[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),i[s]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Pb),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const l=this.charAt(1);if(this.flowKey||gi(l)||l===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let s=0;for(;this.buffer[n-1-s]==="\\";)s+=1;if(s%2===0)break;n=this.buffer.indexOf('"',n+1)}const r=this.buffer.substring(0,n);let i=r.indexOf(`
210
- `,this.pos);if(i!==-1){for(;i!==-1;){const s=this.continueScalar(i+1);if(s===-1)break;i=r.indexOf(`
211
- `,s)}i!==-1&&(n=i-(r[i-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>gi(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let s=this.pos;r=this.buffer[s];++s)switch(r){case" ":n+=1;break;case`
212
- `:t=s,n=0;break;case"\r":{const l=this.buffer[s+1];if(!l&&!this.atEnd)return this.setNext("block-scalar");if(l===`
213
- `)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const s=this.continueScalar(t+1);if(s===-1)break;t=this.buffer.indexOf(`
214
- `,s)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let i=t+1;for(r=this.buffer[i];r===" ";)r=this.buffer[++i];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
215
- `;)r=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep)do{let s=t-1,l=this.buffer[s];l==="\r"&&(l=this.buffer[--s]);const c=s;for(;l===" ";)l=this.buffer[--s];if(l===`
216
- `&&s>=this.pos&&s+1+n>c)t=s;else break}while(!0);return yield qw,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,i;for(;i=this.buffer[++r];)if(i===":"){const s=this.buffer[r+1];if(gi(s)||t&&gp.has(s))break;n=r}else if(gi(i)){let s=this.buffer[r+1];if(i==="\r"&&(s===`
217
- `?(r+=1,i=`
218
- `,s=this.buffer[r+1]):n=r),s==="#"||t&&gp.has(s))break;if(i===`
219
- `){const l=this.continueScalar(r+1);if(l===-1)break;r=Math.max(r,l-2)}}else{if(t&&gp.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield qw,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const r=this.buffer.slice(this.pos,t);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Pb))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(gi(n)||t&&gp.has(n))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!gi(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(fJ.has(n))n=this.buffer[++t];else if(n==="%"&&kE.has(this.buffer[t+1])&&kE.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
220
- `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
221
- `?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||t&&r===" ");const i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class mJ{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n<r;){const s=n+r>>1;this.lineStarts[s]<t?n=s+1:r=s}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const i=this.lineStarts[n-1];return{line:n,col:t-i+1}}}}function js(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function AE(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function UI(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function vp(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function ac(e){if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function EE(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!js(t.start,"explicit-key-ind")&&!js(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,UI(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}class gJ{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new pJ,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const r of this.lexer.lex(t,n))yield*this.next(r);n||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const n=dJ(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const r=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&t?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&EE(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{const i=r.items[r.items.length-1];if(i.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{const i=r.items[r.items.length-1];i.value?r.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{const i=r.items[r.items.length-1];!i||i.value?r.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&AE(i.start)===-1&&(n.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<n.indent))&&(r.type==="document"?r.end=i.start:r.items.push({start:i.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{AE(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}const n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){const n=vp(this.peek(2)),r=ac(n);let i;t.end?(i=t.end,i.push(this.sourceToken),delete t.end):i=[this.sourceToken];const s={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
222
- `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
223
- `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const r=!this.onKeyLine&&this.indent===t.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let s=[];if(i&&n.sep&&!n.value){const l=[];for(let c=0;c<n.sep.length;++c){const f=n.sep[c];switch(f.type){case"newline":l.push(c);break;case"space":break;case"comment":f.indent>t.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(s=n.sep.splice(l[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(s.push(this.sourceToken),t.items.push({start:s}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(s.push(this.sourceToken),t.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(js(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(UI(n.key)&&!js(n.sep,"newline")){const l=ac(n.start),c=n.key,f=n.sep;f.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:c,sep:f}]})}else s.length>0?n.sep=n.sep.concat(s,this.sourceToken):n.sep.push(this.sourceToken);else if(js(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=ac(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:s,key:null,sep:[this.sourceToken]}):js(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const l=this.flowScalar(this.type);i||n.value?(t.items.push({start:s,key:l,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(l):(Object.assign(n,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(t);if(l){if(l.type==="block-seq"){if(!n.explicitKey&&n.sep&&!js(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:s});this.stack.push(l);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||js(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const i=vp(r),s=ac(i);EE(t);const l=t.end.splice(1,t.end.length);l.push(this.sourceToken);const c={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:l}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
224
- `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
225
- `,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=vp(t),r=ac(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=vp(t),r=ac(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function vJ(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new mJ||null,prettyErrors:t}}function yJ(e,t={}){const{lineCounter:n,prettyErrors:r}=vJ(t),i=new gJ(n?.addNewLine),s=new uJ(t),l=Array.from(s.compose(i.parse(e)));if(r&&n)for(const c of l)c.errors.forEach(CE(e,n)),c.warnings.forEach(CE(e,n));return l.length>0?l:Object.assign([],{empty:!0},s.streamInfo())}function bJ({onApplied:e}){const[t,n]=x.useState(""),[r,i]=x.useState(!1),[s,l]=x.useState([]),[c,f]=x.useState([]),h=async()=>{if(!t.trim())return;i(!0),l([]),f([]);const p=yJ(t),g=[],v=[];for(let y=0;y<p.length;y++){const w=p[y];if(w.errors.length>0){g.push(`Document ${y+1}: ${w.errors[0]?.message}`);continue}const S=w.toJSON();if(!(!S||typeof S!="object"))try{const N=await k9(S);v.push(`Applied "${N.displayName||N.name}" (revision ${N.configRevision})`)}catch(N){g.push(`Document ${y+1}: ${N instanceof Error?N.message:String(N)}`)}}l(v),f(g),i(!1),v.length>0&&(Qe({title:"YAML applied",detail:`Applied ${v.length} document${v.length===1?"":"s"} successfully.`,tone:g.length>0?"caution":"positive",dedupeKey:"yaml:apply",dedupeMode:"replace"}),e())};return u.jsxs("section",{className:"mt-8",children:[u.jsx("div",{className:"page-section-divider"}),u.jsx("div",{className:"section-head mt-6",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Config as code"}),u.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Apply YAML"})]})}),u.jsxs("p",{className:"text-zinc-500 text-sm mb-3",children:["Paste a ",u.jsx("code",{className:"text-zinc-400",children:"canonry.yaml"})," config (multi-document YAML with ",u.jsx("code",{className:"text-zinc-400",children:"---"})," separators supported)."]}),u.jsx("textarea",{className:"setup-input w-full font-mono text-xs",rows:10,placeholder:`apiVersion: canonry/v1
226
- kind: Project
227
- metadata:
228
- name: my-project
229
- spec:
230
- canonicalDomain: example.com
231
- country: US
232
- language: en
233
- keywords: []`,value:t,onChange:p=>n(p.target.value)}),s.length>0&&u.jsx("ul",{className:"mt-2 space-y-1",children:s.map((p,g)=>u.jsx("li",{className:"text-emerald-400 text-sm",children:p},g))}),c.length>0&&u.jsx("ul",{className:"mt-2 space-y-1",children:c.map((p,g)=>u.jsx("li",{className:"text-rose-400 text-sm",children:p},g))}),u.jsx("div",{className:"mt-3",children:u.jsx(me,{type:"button",disabled:!t.trim()||r,onClick:h,children:r?"Applying...":"Apply"})})]})}function xJ(){const{dashboard:e,isLoading:t,refetch:n}=dl();if(!e||t)return u.jsxs("div",{className:"page-skeleton",children:[u.jsxs("div",{className:"page-skeleton-header",children:[u.jsx("div",{className:"skeleton-text h-6 w-28"}),u.jsx("div",{className:"skeleton-text-sm w-40"})]}),u.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:[u.jsx("div",{className:"p-3 border-b border-zinc-800/60 flex gap-8",children:["Name","Domain","Visibility","Last run","Country"].map(A=>u.jsx("div",{className:"skeleton-text-sm w-16"},A))}),[1,2,3].map(A=>u.jsxs("div",{className:"p-3 border-b border-zinc-800/40 flex gap-8 items-center",children:[u.jsxs("div",{className:"flex-1 space-y-1",children:[u.jsx("div",{className:"skeleton-text w-28"}),u.jsx("div",{className:"skeleton-text-sm w-16"})]}),u.jsx("div",{className:"skeleton-text w-24"}),u.jsx("div",{className:"skeleton h-5 w-14 rounded-full"}),u.jsx("div",{className:"skeleton h-5 w-16 rounded-full"}),u.jsx("div",{className:"skeleton-text-sm w-8"})]},A))]})]});const r=e.projects,i=Hs(),[s,l]=x.useState(!1),[c,f]=x.useState(""),[h,p]=x.useState(""),[g,v]=x.useState(""),[y,w]=x.useState("US"),[S,N]=x.useState("en"),[C,E]=x.useState(!1),[k,O]=x.useState(null),T=c.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),P=async()=>{if(!(!T||!g)){E(!0),O(null);try{const A=await Og(T,{displayName:h||c,canonicalDomain:g,country:y,language:S});Qe({title:"Project created",detail:`${A.displayName||A.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${A.name}`,dedupeMode:"drop"}),n(),f(""),p(""),v(""),w("US"),N("en"),l(!1),i({to:"/projects/$projectId",params:{projectId:A.id}})}catch(A){O(A instanceof Error?A.message:"Failed to create project")}finally{E(!1)}}};return u.jsxs("div",{className:"page-container",children:[u.jsxs("div",{className:"page-header",children:[u.jsxs("div",{className:"page-header-left",children:[u.jsx("h1",{className:"page-title",children:"Projects"}),u.jsxs("p",{className:"page-subtitle",children:[r.length," project",r.length!==1?"s":""," tracked"]})]}),u.jsx("div",{className:"page-header-right",children:u.jsxs(me,{type:"button",onClick:()=>l(A=>!A),children:[u.jsx(gA,{className:"size-4 mr-1.5"}),"Add project"]})})]}),s?u.jsxs(Be,{className:"surface-card mb-6",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"New project"}),u.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Create a new monitoring project"})]})}),u.jsxs("div",{className:"compact-stack mt-4",children:[u.jsxs("div",{className:"setup-field-row",children:[u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"new-project-name",children:"Project name"}),u.jsx("input",{id:"new-project-name",className:"setup-input",type:"text",placeholder:"my-project",value:c,onChange:A=>f(A.target.value)}),T&&T!==c?u.jsxs("p",{className:"supporting-copy",children:["Slug: ",T]}):null]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),u.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:h,onChange:A=>p(A.target.value)})]})]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),u.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:g,onChange:A=>v(A.target.value)})]}),u.jsxs("div",{className:"setup-field-row",children:[u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"new-country",children:"Country"}),u.jsx("input",{id:"new-country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:y,onChange:A=>w(A.target.value.toUpperCase())})]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"new-language",children:"Language"}),u.jsx("input",{id:"new-language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:S,onChange:A=>N(A.target.value.toLowerCase())})]})]})]}),k?u.jsx("p",{className:"text-rose-400 text-sm mt-3",children:k}):null,u.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[u.jsx(me,{type:"button",disabled:!T||!g||C,onClick:P,children:C?"Creating...":"Create project"}),u.jsx(me,{type:"button",variant:"ghost",onClick:()=>l(!1),children:"Cancel"})]})]}):null,r.length>0?u.jsx("div",{className:"data-table-wrapper",children:u.jsxs("table",{className:"data-table",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Name"}),u.jsx("th",{children:"Domain"}),u.jsx("th",{children:"Visibility"}),u.jsx("th",{children:"Last run"}),u.jsx("th",{className:"text-right",children:"Country"})]})}),u.jsx("tbody",{children:r.map(A=>{const z=A.recentRuns[0];return u.jsxs("tr",{className:"cursor-pointer",onClick:()=>i({to:"/projects/$projectId",params:{projectId:A.project.id}}),children:[u.jsxs("td",{children:[u.jsx(Rt,{to:"/projects/$projectId",params:{projectId:A.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:R=>R.stopPropagation(),children:A.project.displayName||A.project.name}),u.jsx("p",{className:"text-[11px] text-zinc-500",children:A.project.name})]}),u.jsx("td",{className:"text-zinc-400",children:A.project.canonicalDomain}),u.jsx("td",{children:u.jsx(mt,{tone:A.visibilitySummary.tone,children:A.visibilitySummary.value})}),u.jsx("td",{className:"text-zinc-500 text-sm",children:z?u.jsx(Pg,{status:z.status}):u.jsx("span",{className:"text-zinc-600",children:"No runs"})}),u.jsx("td",{className:"text-right text-zinc-500",children:A.project.country})]},A.project.id)})})]})}):s?null:u.jsxs(Be,{className:"surface-card empty-card",children:[u.jsx("h3",{children:"No projects yet"}),u.jsx("p",{className:"supporting-copy",children:"Create your first monitoring project to start tracking AI visibility."}),u.jsxs(me,{type:"button",onClick:()=>l(!0),children:[u.jsx(gA,{className:"size-4 mr-1.5"}),"Add project"]})]}),u.jsx(bJ,{onApplied:()=>{n()}})]})}function Fw({state:e}){return u.jsx(mt,{tone:iH(e),children:Ag(e)})}function BI({run:e}){const{openRun:t}=Wc();return u.jsxs("article",{className:"run-row",children:[u.jsxs("div",{className:"run-row-main",children:[u.jsxs("div",{className:"run-row-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"run-row-title",children:e.summary}),u.jsxs("p",{className:"run-row-subtitle",children:[e.projectName,e.location?` · ${e.location}`:""," · ",e.kindLabel]})]}),u.jsx(Pg,{status:e.status})]}),u.jsx("p",{className:"run-row-detail",children:e.statusDetail})]}),u.jsxs("dl",{className:"run-row-meta",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Started"}),u.jsx("dd",{children:e.startedAt})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Duration"}),u.jsx("dd",{children:e.duration})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Trigger"}),u.jsx("dd",{children:e.triggerLabel})]})]}),u.jsx(me,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function qI({value:e,label:t,delta:n,tone:r,description:i,tooltip:s,isNumeric:l=!0,progress:c,providerCoverage:f}){const g=2*Math.PI*48,v=Number.parseInt(e,10),y=typeof c=="number"&&Number.isFinite(c)?Math.min(Math.max(c,0),1):l&&!Number.isNaN(v)?Math.min(v/100,1):.5,w=g*(1-y);return u.jsxs("div",{className:"score-gauge",children:[u.jsxs("div",{className:"gauge-ring-wrapper",children:[u.jsxs("svg",{className:"gauge-ring",viewBox:"0 0 120 120","aria-hidden":"true",children:[u.jsx("circle",{className:"gauge-bg",cx:"60",cy:"60",r:48,strokeWidth:6}),u.jsx("circle",{className:`gauge-fill gauge-fill-${r}`,cx:"60",cy:"60",r:48,strokeWidth:6,strokeDasharray:g,strokeDashoffset:w,transform:"rotate(-90 60 60)"})]}),u.jsx("div",{className:"gauge-center",children:u.jsx("span",{className:l?"gauge-value":"gauge-value-text",children:e.split(" / ")[0]})})]}),u.jsxs("p",{className:"gauge-label",children:[t,s&&u.jsx(Vn,{text:s})]}),u.jsx("p",{className:"gauge-delta",children:n}),f&&u.jsx("p",{className:"gauge-provider-coverage",children:f}),u.jsx("p",{className:"gauge-description",children:i})]})}function TE({history:e,maxDots:t=12}){const n=e.slice(-t);if(n.length===0)return u.jsx("span",{className:"text-[11px] text-zinc-600",children:"No data"});const r={cited:"bg-emerald-400","not-cited":"bg-zinc-600",lost:"bg-rose-400",emerging:"bg-amber-400 ring-1 ring-amber-300/60"},i=new Date(n[0].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),s=new Date(n[n.length-1].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"});return u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:i}),u.jsx("div",{className:"flex items-center gap-[3px]",title:`${n.length} runs`,children:n.map((l,c)=>u.jsx("div",{className:`h-2.5 w-2.5 rounded-sm ${r[l.citationState]??"bg-zinc-700"} ${l.model&&c>0&&n[c-1]?.model&&n[c-1].model!==l.model?"ring-1 ring-amber-300/80 ring-offset-1 ring-offset-zinc-950":""}`,title:[l.citationState,new Date(l.createdAt).toLocaleDateString(),l.model?`model ${l.model}`:null,l.model&&c>0&&n[c-1]?.model&&n[c-1].model!==l.model?"model changed":null].filter(Boolean).join(" — ")},c))}),u.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:s})]})}function wJ(e){const t=new Map;for(const r of e)for(const i of r.runHistory){const s=t.get(i.createdAt);s?s.states.push(i.citationState):t.set(i.createdAt,{states:[i.citationState],runId:i.runId})}return[...t.entries()].sort(([r],[i])=>r.localeCompare(i)).map(([r,{states:i,runId:s}])=>({runId:s,createdAt:r,citationState:i.includes("cited")?"cited":i.includes("emerging")?"emerging":"not-cited"}))}function SJ({evidence:e}){const{openEvidence:t}=Wc(),[n,r]=x.useState(new Set),i=x.useMemo(()=>{const l=new Map;for(const c of e){const f=l.get(c.keyword)??[];l.set(c.keyword,[...f,c])}return[...l.entries()].map(([c,f])=>({phrase:c,items:f}))},[e]),s=l=>{r(c=>{const f=new Set(c);return f.has(l)?f.delete(l):f.add(l),f})};return u.jsx("div",{className:"evidence-table-wrap",children:u.jsxs("table",{className:"evidence-table",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{style:{width:"2rem"}}),u.jsx("th",{children:"Key Phrase"}),u.jsx("th",{children:"Status"}),u.jsx("th",{children:"Citation History"}),u.jsx("th",{children:"Change"}),u.jsx("th",{})]})}),u.jsx("tbody",{children:i.map(({phrase:l,items:c})=>{const f=n.has(l),h=c.map(w=>w.citationState),p=h.includes("cited")?"cited":h.includes("emerging")?"emerging":h.includes("lost")?"lost":h.every(w=>w==="pending")?"pending":"not-cited",g=wJ(c),v=c.filter(w=>w.citationState==="cited"||w.citationState==="emerging").length,y=(()=>{if(g.length===0)return"Awaiting first run";if(g.length===1)return"First observation";const w=g[g.length-1].citationState,S=g[g.length-2].citationState;if(S!=="cited"&&w==="cited")return"Newly cited";if(S==="cited"&&w!=="cited")return"Lost since last run";let N=0;for(let C=g.length-1;C>=0&&g[C].citationState===w;C--)N++;return w==="cited"?N<=1?"Cited in latest run":`Cited for ${N} runs`:N<=1?"Not cited in latest run":`Not cited across ${N} runs`})();return u.jsxs(x.Fragment,{children:[u.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>s(l),"aria-expanded":f,children:[u.jsx("td",{children:u.jsx(_g,{size:14,className:`transition-transform duration-150 text-zinc-500 ${f?"rotate-90":""}`})}),u.jsx("td",{className:"evidence-keyword-cell",children:u.jsxs("div",{children:[u.jsx("span",{className:"font-medium text-zinc-100",children:l}),u.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:c.map(w=>u.jsx(Id,{provider:w.provider},w.id))})]})}),u.jsx("td",{children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Fw,{state:p}),u.jsxs("span",{className:"text-[11px] text-zinc-500",children:[v,"/",c.length]})]})}),u.jsx("td",{children:u.jsx(TE,{history:g})}),u.jsx("td",{className:"evidence-change-cell",children:y}),u.jsx("td",{})]}),f&&c.map(w=>u.jsxs("tr",{className:"bg-zinc-900/30",children:[u.jsx("td",{}),u.jsx("td",{className:"evidence-keyword-cell pl-5",children:u.jsx(Id,{provider:w.provider})}),u.jsx("td",{children:u.jsx(Fw,{state:w.citationState})}),u.jsx("td",{children:u.jsx(TE,{history:w.runHistory})}),u.jsx("td",{className:"evidence-change-cell",children:w.changeLabel}),u.jsx("td",{children:u.jsx(me,{variant:"ghost",size:"sm",type:"button",onClick:S=>{S.stopPropagation(),t(w.id)},children:"View"})})]},w.id))]},l)})})]})})}function jJ({competitors:e}){return e.length===0?u.jsx("p",{className:"text-sm text-zinc-500",children:"No competitors configured. Add competitors to track overlap."}):u.jsx("div",{className:"competitor-table-wrap",children:u.jsxs("table",{className:"competitor-table",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Domain"}),u.jsx("th",{children:"Pressure"}),u.jsx("th",{children:"Citations"}),u.jsx("th",{children:"Key Phrases"})]})}),u.jsx("tbody",{children:e.map(t=>u.jsxs("tr",{children:[u.jsx("td",{className:"font-medium text-zinc-100",children:t.domain}),u.jsx("td",{children:u.jsx(mt,{tone:aH(t.pressureLabel),children:t.pressureLabel})}),u.jsx("td",{className:"text-zinc-300 tabular-nums",children:t.totalKeywords>0?`${t.citationCount} / ${t.totalKeywords}`:"—"}),u.jsx("td",{className:"text-zinc-500 text-xs",children:t.citedKeywords.length>0?t.citedKeywords.join(", "):"Not cited"})]},t.id))})]})})}function PE({eyebrow:e,title:t,status:n,tone:r,targetLabel:i,targetValue:s,coverageValue:l,note:c,updatedAt:f,active:h,onClick:p}){return u.jsxs("button",{type:"button",onClick:p,className:`surface-card w-full text-left transition-colors ${h?"border-zinc-200 bg-zinc-900/50":"hover:border-zinc-700 hover:bg-zinc-900/40"}`,children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:e}),u.jsx("h3",{children:t})]}),u.jsx(mt,{tone:r,children:n})]}),u.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:[u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:i}),u.jsx("p",{className:"mt-1 truncate text-sm text-zinc-200",children:s})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Coverage"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:l})]})]}),u.jsxs("div",{className:"mt-3 flex flex-col gap-1 text-xs text-zinc-500 sm:flex-row sm:items-center sm:justify-between",children:[u.jsx("span",{children:c}),u.jsx("span",{children:f?`Updated ${yi(f)}`:"No recent sync yet"})]})]})}function yp({label:e,value:t,tone:n}){const r=n==="positive"?"text-emerald-400":n==="negative"?"text-rose-400":"text-zinc-200";return u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:e}),u.jsx("p",{className:`mt-2 text-2xl font-semibold ${r}`,children:t})]})}var NJ=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function q1(e){if(typeof e!="string")return!1;var t=NJ;return t.includes(e)}var CJ=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],OJ=new Set(CJ);function FI(e){return typeof e!="string"?!1:OJ.has(e)}function KI(e){return typeof e=="string"&&e.startsWith("data-")}function Ni(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(FI(n)||KI(n))&&(t[n]=e[n]);return t}function Qg(e){if(e==null)return null;if(x.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Ni(t)}return typeof e=="object"&&!Array.isArray(e)?Ni(e):null}function xr(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(FI(n)||KI(n)||q1(n))&&(t[n]=e[n]);return t}function _J(e){return e==null?null:x.isValidElement(e)?xr(e.props):typeof e=="object"&&!Array.isArray(e)?xr(e):null}var kJ=["children","width","height","viewBox","className","style","title","desc"];function Kw(){return Kw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kw.apply(null,arguments)}function AJ(e,t){if(e==null)return{};var n,r,i=EJ(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function EJ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var F1=x.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:s,className:l,style:c,title:f,desc:h}=e,p=AJ(e,kJ),g=s||{width:r,height:i,x:0,y:0},v=ft("recharts-surface",l);return x.createElement("svg",Kw({},xr(p),{className:v,width:r,height:i,style:c,viewBox:"".concat(g.x," ").concat(g.y," ").concat(g.width," ").concat(g.height),ref:t}),x.createElement("title",null,f),x.createElement("desc",null,h),n)}),TJ=["children","className"];function Hw(){return Hw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hw.apply(null,arguments)}function PJ(e,t){if(e==null)return{};var n,r,i=zJ(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function zJ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Ci=x.forwardRef((e,t)=>{var{children:n,className:r}=e,i=PJ(e,TJ),s=ft("recharts-layer",r);return x.createElement("g",Hw({className:s},xr(i),{ref:t}),n)}),HI=x.createContext(null),MJ=()=>x.useContext(HI);function Ct(e){return function(){return e}}const GI=Math.cos,Sm=Math.sin,Ai=Math.sqrt,jm=Math.PI,Xg=2*jm,Gw=Math.PI,Vw=2*Gw,Co=1e-6,RJ=Vw-Co;function VI(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function DJ(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return VI;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class IJ{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?VI:DJ(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,s,l){this._append`C${+t},${+n},${+r},${+i},${this._x1=+s},${this._y1=+l}`}arcTo(t,n,r,i,s){if(t=+t,n=+n,r=+r,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let l=this._x1,c=this._y1,f=r-t,h=i-n,p=l-t,g=c-n,v=p*p+g*g;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(v>Co)if(!(Math.abs(g*f-h*p)>Co)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let y=r-l,w=i-c,S=f*f+h*h,N=y*y+w*w,C=Math.sqrt(S),E=Math.sqrt(v),k=s*Math.tan((Gw-Math.acos((S+v-N)/(2*C*E)))/2),O=k/E,T=k/C;Math.abs(O-1)>Co&&this._append`L${t+O*p},${n+O*g}`,this._append`A${s},${s},0,0,${+(g*y>p*w)},${this._x1=t+T*f},${this._y1=n+T*h}`}}arc(t,n,r,i,s,l){if(t=+t,n=+n,r=+r,l=!!l,r<0)throw new Error(`negative radius: ${r}`);let c=r*Math.cos(i),f=r*Math.sin(i),h=t+c,p=n+f,g=1^l,v=l?i-s:s-i;this._x1===null?this._append`M${h},${p}`:(Math.abs(this._x1-h)>Co||Math.abs(this._y1-p)>Co)&&this._append`L${h},${p}`,r&&(v<0&&(v=v%Vw+Vw),v>RJ?this._append`A${r},${r},0,1,${g},${t-c},${n-f}A${r},${r},0,1,${g},${this._x1=h},${this._y1=p}`:v>Co&&this._append`A${r},${r},0,${+(v>=Gw)},${g},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function K1(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new IJ(t)}function H1(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ZI(e){this._context=e}ZI.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 Jg(e){return new ZI(e)}function YI(e){return e[0]}function WI(e){return e[1]}function QI(e,t){var n=Ct(!0),r=null,i=Jg,s=null,l=K1(c);e=typeof e=="function"?e:e===void 0?YI:Ct(e),t=typeof t=="function"?t:t===void 0?WI:Ct(t);function c(f){var h,p=(f=H1(f)).length,g,v=!1,y;for(r==null&&(s=i(y=l())),h=0;h<=p;++h)!(h<p&&n(g=f[h],h,f))===v&&((v=!v)?s.lineStart():s.lineEnd()),v&&s.point(+e(g,h,f),+t(g,h,f));if(y)return s=null,y+""||null}return c.x=function(f){return arguments.length?(e=typeof f=="function"?f:Ct(+f),c):e},c.y=function(f){return arguments.length?(t=typeof f=="function"?f:Ct(+f),c):t},c.defined=function(f){return arguments.length?(n=typeof f=="function"?f:Ct(!!f),c):n},c.curve=function(f){return arguments.length?(i=f,r!=null&&(s=i(r)),c):i},c.context=function(f){return arguments.length?(f==null?r=s=null:s=i(r=f),c):r},c}function bp(e,t,n){var r=null,i=Ct(!0),s=null,l=Jg,c=null,f=K1(h);e=typeof e=="function"?e:e===void 0?YI:Ct(+e),t=typeof t=="function"?t:Ct(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?WI:Ct(+n);function h(g){var v,y,w,S=(g=H1(g)).length,N,C=!1,E,k=new Array(S),O=new Array(S);for(s==null&&(c=l(E=f())),v=0;v<=S;++v){if(!(v<S&&i(N=g[v],v,g))===C)if(C=!C)y=v,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),w=v-1;w>=y;--w)c.point(k[w],O[w]);c.lineEnd(),c.areaEnd()}C&&(k[v]=+e(N,v,g),O[v]=+t(N,v,g),c.point(r?+r(N,v,g):k[v],n?+n(N,v,g):O[v]))}if(E)return c=null,E+""||null}function p(){return QI().defined(i).curve(l).context(s)}return h.x=function(g){return arguments.length?(e=typeof g=="function"?g:Ct(+g),r=null,h):e},h.x0=function(g){return arguments.length?(e=typeof g=="function"?g:Ct(+g),h):e},h.x1=function(g){return arguments.length?(r=g==null?null:typeof g=="function"?g:Ct(+g),h):r},h.y=function(g){return arguments.length?(t=typeof g=="function"?g:Ct(+g),n=null,h):t},h.y0=function(g){return arguments.length?(t=typeof g=="function"?g:Ct(+g),h):t},h.y1=function(g){return arguments.length?(n=g==null?null:typeof g=="function"?g:Ct(+g),h):n},h.lineX0=h.lineY0=function(){return p().x(e).y(t)},h.lineY1=function(){return p().x(e).y(n)},h.lineX1=function(){return p().x(r).y(t)},h.defined=function(g){return arguments.length?(i=typeof g=="function"?g:Ct(!!g),h):i},h.curve=function(g){return arguments.length?(l=g,s!=null&&(c=l(s)),h):l},h.context=function(g){return arguments.length?(g==null?s=c=null:c=l(s=g),h):s},h}class XI{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function LJ(e){return new XI(e,!0)}function $J(e){return new XI(e,!1)}const G1={draw(e,t){const n=Ai(t/jm);e.moveTo(n,0),e.arc(0,0,n,0,Xg)}},UJ={draw(e,t){const n=Ai(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},JI=Ai(1/3),BJ=JI*2,qJ={draw(e,t){const n=Ai(t/BJ),r=n*JI;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},FJ={draw(e,t){const n=Ai(t),r=-n/2;e.rect(r,r,n,n)}},KJ=.8908130915292852,eL=Sm(jm/10)/Sm(7*jm/10),HJ=Sm(Xg/10)*eL,GJ=-GI(Xg/10)*eL,VJ={draw(e,t){const n=Ai(t*KJ),r=HJ*n,i=GJ*n;e.moveTo(0,-n),e.lineTo(r,i);for(let s=1;s<5;++s){const l=Xg*s/5,c=GI(l),f=Sm(l);e.lineTo(f*n,-c*n),e.lineTo(c*r-f*i,f*r+c*i)}e.closePath()}},zb=Ai(3),ZJ={draw(e,t){const n=-Ai(t/(zb*3));e.moveTo(0,n*2),e.lineTo(-zb*n,-n),e.lineTo(zb*n,-n),e.closePath()}},Gr=-.5,Vr=Ai(3)/2,Zw=1/Ai(12),YJ=(Zw/2+1)*3,WJ={draw(e,t){const n=Ai(t/YJ),r=n/2,i=n*Zw,s=r,l=n*Zw+n,c=-s,f=l;e.moveTo(r,i),e.lineTo(s,l),e.lineTo(c,f),e.lineTo(Gr*r-Vr*i,Vr*r+Gr*i),e.lineTo(Gr*s-Vr*l,Vr*s+Gr*l),e.lineTo(Gr*c-Vr*f,Vr*c+Gr*f),e.lineTo(Gr*r+Vr*i,Gr*i-Vr*r),e.lineTo(Gr*s+Vr*l,Gr*l-Vr*s),e.lineTo(Gr*c+Vr*f,Gr*f-Vr*c),e.closePath()}};function QJ(e,t){let n=null,r=K1(i);e=typeof e=="function"?e:Ct(e||G1),t=typeof t=="function"?t:Ct(t===void 0?64:+t);function i(){let s;if(n||(n=s=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),s)return n=null,s+""||null}return i.type=function(s){return arguments.length?(e=typeof s=="function"?s:Ct(s),i):e},i.size=function(s){return arguments.length?(t=typeof s=="function"?s:Ct(+s),i):t},i.context=function(s){return arguments.length?(n=s??null,i):n},i}function Nm(){}function Cm(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function tL(e){this._context=e}tL.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Cm(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(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;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Cm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function XJ(e){return new tL(e)}function nL(e){this._context=e}nL.prototype={areaStart:Nm,areaEnd:Nm,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Cm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function JJ(e){return new nL(e)}function rL(e){this._context=e}rL.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Cm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function eee(e){return new rL(e)}function iL(e){this._context=e}iL.prototype={areaStart:Nm,areaEnd:Nm,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function tee(e){return new iL(e)}function zE(e){return e<0?-1:1}function ME(e,t,n){var r=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(r||i<0&&-0),l=(n-e._y1)/(i||r<0&&-0),c=(s*i+l*r)/(r+i);return(zE(s)+zE(l))*Math.min(Math.abs(s),Math.abs(l),.5*Math.abs(c))||0}function RE(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Mb(e,t,n){var r=e._x0,i=e._y0,s=e._x1,l=e._y1,c=(s-r)/3;e._context.bezierCurveTo(r+c,i+c*t,s-c,l-c*n,s,l)}function Om(e){this._context=e}Om.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:Mb(this,this._t0,RE(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 n=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,Mb(this,RE(this,n=ME(this,e,t)),n);break;default:Mb(this,this._t0,n=ME(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function aL(e){this._context=new sL(e)}(aL.prototype=Object.create(Om.prototype)).point=function(e,t){Om.prototype.point.call(this,t,e)};function sL(e){this._context=e}sL.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,s){this._context.bezierCurveTo(t,e,r,n,s,i)}};function nee(e){return new Om(e)}function ree(e){return new aL(e)}function oL(e){this._context=e}oL.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=DE(e),i=DE(t),s=0,l=1;l<n;++s,++l)this._context.bezierCurveTo(r[0][s],i[0][s],r[1][s],i[1][s],e[l],t[l]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function DE(e){var t,n=e.length-1,r,i=new Array(n),s=new Array(n),l=new Array(n);for(i[0]=0,s[0]=2,l[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,s[t]=4,l[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,s[n-1]=7,l[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/s[t-1],s[t]-=r,l[t]-=r*l[t-1];for(i[n-1]=l[n-1]/s[n-1],t=n-2;t>=0;--t)i[t]=(l[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function iee(e){return new oL(e)}function ev(e,t){this._context=e,this._t=t}ev.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function aee(e){return new ev(e,.5)}function see(e){return new ev(e,0)}function oee(e){return new ev(e,1)}function Xo(e,t){if((l=e.length)>1)for(var n=1,r,i,s=e[t[0]],l,c=s.length;n<l;++n)for(i=s,s=e[t[n]],r=0;r<c;++r)s[r][1]+=s[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Yw(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function lee(e,t){return e[t]}function cee(e){const t=[];return t.key=e,t}function uee(){var e=Ct([]),t=Yw,n=Xo,r=lee;function i(s){var l=Array.from(e.apply(this,arguments),cee),c,f=l.length,h=-1,p;for(const g of s)for(c=0,++h;c<f;++c)(l[c][h]=[0,+r(g,l[c].key,h,s)]).data=g;for(c=0,p=H1(t(l));c<f;++c)l[p[c]].index=c;return n(l,p),l}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:Ct(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:Ct(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?Yw:typeof s=="function"?s:Ct(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??Xo,i):n},i}function dee(e,t){if((r=e.length)>0){for(var n,r,i=0,s=e[0].length,l;i<s;++i){for(l=n=0;n<r;++n)l+=e[n][i][1]||0;if(l)for(n=0;n<r;++n)e[n][i][1]/=l}Xo(e,t)}}function fee(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,s=r.length;n<s;++n){for(var l=0,c=0;l<i;++l)c+=e[l][n][1]||0;r[n][1]+=r[n][0]=-c/2}Xo(e,t)}}function hee(e,t){if(!(!((l=e.length)>0)||!((s=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,s,l;r<s;++r){for(var c=0,f=0,h=0;c<l;++c){for(var p=e[t[c]],g=p[r][1]||0,v=p[r-1][1]||0,y=(g-v)/2,w=0;w<c;++w){var S=e[t[w]],N=S[r][1]||0,C=S[r-1][1]||0;y+=N-C}f+=g,h+=y*g}i[r-1][1]+=i[r-1][0]=n,f&&(n-=h/f)}i[r-1][1]+=i[r-1][0]=n,Xo(e,t)}}var Rb={},Db={},IE;function pee(){return IE||(IE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(Db)),Db}var Ib={},LE;function lL(){return LE||(LE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){switch(typeof n){case"number":case"symbol":return!1;case"string":return n.includes(".")||n.includes("[")||n.includes("]")}}e.isDeepKey=t})(Ib)),Ib}var Lb={},$E;function V1(){return $E||($E=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="string"||typeof n=="symbol"?n:Object.is(n?.valueOf?.(),-0)?"-0":String(n)}e.toKey=t})(Lb)),Lb}var $b={},Ub={},UE;function mee(){return UE||(UE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){if(n==null)return"";if(typeof n=="string")return n;if(Array.isArray(n))return n.map(t).join(",");const r=String(n);return r==="0"&&Object.is(Number(n),-0)?"-0":r}e.toString=t})(Ub)),Ub}var BE;function Z1(){return BE||(BE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=mee(),n=V1();function r(i){if(Array.isArray(i))return i.map(n.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const s=[],l=i.length;if(l===0)return s;let c=0,f="",h="",p=!1;for(i.charCodeAt(0)===46&&(s.push(""),c++);c<l;){const g=i[c];h?g==="\\"&&c+1<l?(c++,f+=i[c]):g===h?h="":f+=g:p?g==='"'||g==="'"?h=g:g==="]"?(p=!1,s.push(f),f=""):f+=g:g==="["?(p=!0,f&&(s.push(f),f="")):g==="."?f&&(s.push(f),f=""):f+=g,c++}return f&&s.push(f),s}e.toPath=r})($b)),$b}var qE;function Y1(){return qE||(qE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=pee(),n=lL(),r=V1(),i=Z1();function s(c,f,h){if(c==null)return h;switch(typeof f){case"string":{if(t.isUnsafeProperty(f))return h;const p=c[f];return p===void 0?n.isDeepKey(f)?s(c,i.toPath(f),h):h:p}case"number":case"symbol":{typeof f=="number"&&(f=r.toKey(f));const p=c[f];return p===void 0?h:p}default:{if(Array.isArray(f))return l(c,f,h);if(Object.is(f?.valueOf(),-0)?f="-0":f=String(f),t.isUnsafeProperty(f))return h;const p=c[f];return p===void 0?h:p}}}function l(c,f,h){if(f.length===0)return h;let p=c;for(let g=0;g<f.length;g++){if(p==null||t.isUnsafeProperty(f[g]))return h;p=p[f[g]]}return p===void 0?h:p}e.get=s})(Rb)),Rb}var Bb,FE;function gee(){return FE||(FE=1,Bb=Y1().get),Bb}var vee=gee();const tv=qs(vee);var yee=4;function Es(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:yee,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Rn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.reduce((i,s,l)=>{var c=n[l-1];return typeof c=="string"?i+c+s:c!==void 0?i+Es(c)+s:i+s},"")}var ei=e=>e===0?0:e>0?1:-1,Wi=e=>typeof e=="number"&&e!=+e,Jo=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Pe=e=>(typeof e=="number"||e instanceof Number)&&!Wi(e),ai=e=>Pe(e)||typeof e=="string",bee=0,Kd=e=>{var t=++bee;return"".concat(e||"").concat(t)},Bs=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Pe(t)&&typeof t!="string")return r;var s;if(Jo(t)){if(n==null)return r;var l=t.indexOf("%");s=n*parseFloat(t.slice(0,l))/100}else s=+t;return Wi(s)&&(s=r),i&&n!=null&&s>n&&(s=n),s},cL=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function Fi(e,t,n){return Pe(e)&&Pe(t)?Es(e+n*(t-e)):t}function uL(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):tv(r,t))===n)}var Ln=e=>e===null||typeof e>"u",pf=e=>Ln(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function vr(e){return e!=null}function tu(){}var xee=["type","size","sizeType"];function Ww(){return Ww=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ww.apply(null,arguments)}function KE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function HE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KE(Object(n),!0).forEach(function(r){wee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wee(e,t,n){return(t=See(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function See(e){var t=jee(e,"string");return typeof t=="symbol"?t:t+""}function jee(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Nee(e,t){if(e==null)return{};var n,r,i=Cee(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Cee(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var dL={symbolCircle:G1,symbolCross:UJ,symbolDiamond:qJ,symbolSquare:FJ,symbolStar:VJ,symbolTriangle:ZJ,symbolWye:WJ},Oee=Math.PI/180,_ee=e=>{var t="symbol".concat(pf(e));return dL[t]||G1},kee=(e,t,n)=>{if(t==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var r=18*Oee;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},Aee=(e,t)=>{dL["symbol".concat(pf(e))]=t},fL=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=Nee(e,xee),s=HE(HE({},i),{},{type:t,size:n,sizeType:r}),l="circle";typeof t=="string"&&(l=t);var c=()=>{var v=_ee(l),y=QJ().type(v).size(kee(n,r,l)),w=y();if(w!==null)return w},{className:f,cx:h,cy:p}=s,g=xr(s);return Pe(h)&&Pe(p)&&Pe(n)?x.createElement("path",Ww({},g,{className:ft("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(p,")"),d:c()})):null};fL.registerSymbol=Aee;var hL=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,W1=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(x.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{q1(i)&&typeof n[i]=="function"&&(r[i]=(s=>n[i](n,s)))}),r},Eee=(e,t,n)=>r=>(e(t,n,r),null),pL=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var s=e[i];q1(i)&&typeof s=="function"&&(r||(r={}),r[i]=Eee(s,t,n))}),r};function GE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Tee(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GE(Object(n),!0).forEach(function(r){Pee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pee(e,t,n){return(t=zee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zee(e){var t=Mee(e,"string");return typeof t=="symbol"?t:t+""}function Mee(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ar(e,t){var n=Tee({},e),r=t,i=Object.keys(t),s=i.reduce((l,c)=>(l[c]===void 0&&r[c]!==void 0&&(l[c]=r[c]),l),n);return s}function _m(){return _m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_m.apply(null,arguments)}function VE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function mL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VE(Object(n),!0).forEach(function(r){Ree(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ree(e,t,n){return(t=Dee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dee(e){var t=Iee(e,"string");return typeof t=="symbol"?t:t+""}function Iee(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Yr=32,Lee={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function $ee(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function Uee(e){var{data:t,iconType:n,inactiveColor:r}=e,i=Yr/2,s=Yr/6,l=Yr/3,c=t.inactive?r:t.color,f=n??t.type;if(f==="none")return null;if(f==="plainline")return x.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:$ee(t.payload),x1:0,y1:i,x2:Yr,y2:i,className:"recharts-legend-icon"});if(f==="line")return x.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(i,"h").concat(l,`
234
- A`).concat(s,",").concat(s,",0,1,1,").concat(2*l,",").concat(i,`
235
- H`).concat(Yr,"M").concat(2*l,",").concat(i,`
236
- A`).concat(s,",").concat(s,",0,1,1,").concat(l,",").concat(i),className:"recharts-legend-icon"});if(f==="rect")return x.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(Yr/8,"h").concat(Yr,"v").concat(Yr*3/4,"h").concat(-Yr,"z"),className:"recharts-legend-icon"});if(x.isValidElement(t.legendIcon)){var h=mL({},t);return delete h.legendIcon,x.cloneElement(t.legendIcon,h)}return x.createElement(fL,{fill:c,cx:i,cy:i,size:Yr,sizeType:"diameter",type:f})}function Bee(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:s,iconType:l,labelStyle:c}=e,f={x:0,y:0,width:Yr,height:Yr},h={display:r==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((g,v)=>{var y=g.formatter||i,w=ft({"recharts-legend-item":!0,["legend-item-".concat(v)]:!0,inactive:g.inactive});if(g.type==="none")return null;var S=typeof c=="object"?mL({},c):{};S.color=g.inactive?s:S.color||g.color;var N=y?y(g.value,g,v):g.value;return x.createElement("li",_m({className:w,style:h,key:"legend-item-".concat(v)},pL(e,g,v)),x.createElement(F1,{width:n,height:n,viewBox:f,style:p,"aria-label":"".concat(g.value," legend icon")},x.createElement(Uee,{data:g,iconType:l,inactiveColor:s})),x.createElement("span",{className:"recharts-legend-item-text",style:S},N))})}var qee=e=>{var t=ar(e,Lee),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var s={padding:0,margin:0,textAlign:r==="horizontal"?i:"left"};return x.createElement("ul",{className:"recharts-default-legend",style:s},x.createElement(Bee,_m({},t,{payload:n})))},qb={},Fb={},ZE;function Fee(){return ZE||(ZE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){const i=new Map;for(let s=0;s<n.length;s++){const l=n[s],c=r(l,s,n);i.has(c)||i.set(c,l)}return Array.from(i.values())}e.uniqBy=t})(Fb)),Fb}var Kb={},YE;function Kee(){return YE||(YE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){return function(...i){return n.apply(this,i.slice(0,r))}}e.ary=t})(Kb)),Kb}var Hb={},WE;function gL(){return WE||(WE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(Hb)),Hb}var Gb={},Vb={},Zb={},QE;function Hee(){return QE||(QE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(Zb)),Zb}var XE;function vL(){return XE||(XE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Hee();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(Vb)),Vb}var Yb={},JE;function Gee(){return JE||(JE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(Yb)),Yb}var eT;function Vee(){return eT||(eT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=vL(),n=Gee();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(Gb)),Gb}var Wb={},Qb={},tT;function Zee(){return tT||(tT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Y1();function n(r){return function(i){return t.get(i,r)}}e.property=n})(Qb)),Qb}var Xb={},Jb={},ex={},tx={},nT;function yL(){return nT||(nT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n!==null&&(typeof n=="object"||typeof n=="function")}e.isObject=t})(tx)),tx}var nx={},rT;function bL(){return rT||(rT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null||typeof n!="object"&&typeof n!="function"}e.isPrimitive=t})(nx)),nx}var rx={},iT;function xL(){return iT||(iT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){return n===r||Number.isNaN(n)&&Number.isNaN(r)}e.isEqualsSameValueZero=t})(rx)),rx}var aT;function Yee(){return aT||(aT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=yL(),n=bL(),r=xL();function i(p,g,v){return typeof v!="function"?i(p,g,()=>{}):s(p,g,function y(w,S,N,C,E,k){const O=v(w,S,N,C,E,k);return O!==void 0?!!O:s(w,S,y,k)},new Map)}function s(p,g,v,y){if(g===p)return!0;switch(typeof g){case"object":return l(p,g,v,y);case"function":return Object.keys(g).length>0?s(p,{...g},v,y):r.isEqualsSameValueZero(p,g);default:return t.isObject(p)?typeof g=="string"?g==="":!0:r.isEqualsSameValueZero(p,g)}}function l(p,g,v,y){if(g==null)return!0;if(Array.isArray(g))return f(p,g,v,y);if(g instanceof Map)return c(p,g,v,y);if(g instanceof Set)return h(p,g,v,y);const w=Object.keys(g);if(p==null||n.isPrimitive(p))return w.length===0;if(w.length===0)return!0;if(y?.has(g))return y.get(g)===p;y?.set(g,p);try{for(let S=0;S<w.length;S++){const N=w[S];if(!n.isPrimitive(p)&&!(N in p)||g[N]===void 0&&p[N]!==void 0||g[N]===null&&p[N]!==null||!v(p[N],g[N],N,p,g,y))return!1}return!0}finally{y?.delete(g)}}function c(p,g,v,y){if(g.size===0)return!0;if(!(p instanceof Map))return!1;for(const[w,S]of g.entries()){const N=p.get(w);if(v(N,S,w,p,g,y)===!1)return!1}return!0}function f(p,g,v,y){if(g.length===0)return!0;if(!Array.isArray(p))return!1;const w=new Set;for(let S=0;S<g.length;S++){const N=g[S];let C=!1;for(let E=0;E<p.length;E++){if(w.has(E))continue;const k=p[E];let O=!1;if(v(k,N,S,p,g,y)&&(O=!0),O){w.add(E),C=!0;break}}if(!C)return!1}return!0}function h(p,g,v,y){return g.size===0?!0:p instanceof Set?f([...p],[...g],v,y):!1}e.isMatchWith=i,e.isSetMatch=h})(ex)),ex}var sT;function wL(){return sT||(sT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Yee();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(Jb)),Jb}var ix={},ax={},sx={},oT;function Wee(){return oT||(oT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Object.getOwnPropertySymbols(n).filter(r=>Object.prototype.propertyIsEnumerable.call(n,r))}e.getSymbols=t})(sx)),sx}var ox={},lT;function Q1(){return lT||(lT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}e.getTag=t})(ox)),ox}var lx={},cT;function SL(){return cT||(cT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",r="[object Number]",i="[object Boolean]",s="[object Arguments]",l="[object Symbol]",c="[object Date]",f="[object Map]",h="[object Set]",p="[object Array]",g="[object Function]",v="[object ArrayBuffer]",y="[object Object]",w="[object Error]",S="[object DataView]",N="[object Uint8Array]",C="[object Uint8ClampedArray]",E="[object Uint16Array]",k="[object Uint32Array]",O="[object BigUint64Array]",T="[object Int8Array]",P="[object Int16Array]",A="[object Int32Array]",z="[object BigInt64Array]",R="[object Float32Array]",q="[object Float64Array]";e.argumentsTag=s,e.arrayBufferTag=v,e.arrayTag=p,e.bigInt64ArrayTag=z,e.bigUint64ArrayTag=O,e.booleanTag=i,e.dataViewTag=S,e.dateTag=c,e.errorTag=w,e.float32ArrayTag=R,e.float64ArrayTag=q,e.functionTag=g,e.int16ArrayTag=P,e.int32ArrayTag=A,e.int8ArrayTag=T,e.mapTag=f,e.numberTag=r,e.objectTag=y,e.regexpTag=t,e.setTag=h,e.stringTag=n,e.symbolTag=l,e.uint16ArrayTag=E,e.uint32ArrayTag=k,e.uint8ArrayTag=N,e.uint8ClampedArrayTag=C})(lx)),lx}var cx={},uT;function Qee(){return uT||(uT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(cx)),cx}var dT;function jL(){return dT||(dT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Wee(),n=Q1(),r=SL(),i=bL(),s=Qee();function l(p,g){return c(p,void 0,p,new Map,g)}function c(p,g,v,y=new Map,w=void 0){const S=w?.(p,g,v,y);if(S!==void 0)return S;if(i.isPrimitive(p))return p;if(y.has(p))return y.get(p);if(Array.isArray(p)){const N=new Array(p.length);y.set(p,N);for(let C=0;C<p.length;C++)N[C]=c(p[C],C,v,y,w);return Object.hasOwn(p,"index")&&(N.index=p.index),Object.hasOwn(p,"input")&&(N.input=p.input),N}if(p instanceof Date)return new Date(p.getTime());if(p instanceof RegExp){const N=new RegExp(p.source,p.flags);return N.lastIndex=p.lastIndex,N}if(p instanceof Map){const N=new Map;y.set(p,N);for(const[C,E]of p)N.set(C,c(E,C,v,y,w));return N}if(p instanceof Set){const N=new Set;y.set(p,N);for(const C of p)N.add(c(C,void 0,v,y,w));return N}if(typeof Buffer<"u"&&Buffer.isBuffer(p))return p.subarray();if(s.isTypedArray(p)){const N=new(Object.getPrototypeOf(p)).constructor(p.length);y.set(p,N);for(let C=0;C<p.length;C++)N[C]=c(p[C],C,v,y,w);return N}if(p instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&p instanceof SharedArrayBuffer)return p.slice(0);if(p instanceof DataView){const N=new DataView(p.buffer.slice(0),p.byteOffset,p.byteLength);return y.set(p,N),f(N,p,v,y,w),N}if(typeof File<"u"&&p instanceof File){const N=new File([p],p.name,{type:p.type});return y.set(p,N),f(N,p,v,y,w),N}if(typeof Blob<"u"&&p instanceof Blob){const N=new Blob([p],{type:p.type});return y.set(p,N),f(N,p,v,y,w),N}if(p instanceof Error){const N=structuredClone(p);return y.set(p,N),N.message=p.message,N.name=p.name,N.stack=p.stack,N.cause=p.cause,N.constructor=p.constructor,f(N,p,v,y,w),N}if(p instanceof Boolean){const N=new Boolean(p.valueOf());return y.set(p,N),f(N,p,v,y,w),N}if(p instanceof Number){const N=new Number(p.valueOf());return y.set(p,N),f(N,p,v,y,w),N}if(p instanceof String){const N=new String(p.valueOf());return y.set(p,N),f(N,p,v,y,w),N}if(typeof p=="object"&&h(p)){const N=Object.create(Object.getPrototypeOf(p));return y.set(p,N),f(N,p,v,y,w),N}return p}function f(p,g,v=p,y,w){const S=[...Object.keys(g),...t.getSymbols(g)];for(let N=0;N<S.length;N++){const C=S[N],E=Object.getOwnPropertyDescriptor(p,C);(E==null||E.writable)&&(p[C]=c(g[C],C,v,y,w))}}function h(p){switch(n.getTag(p)){case r.argumentsTag:case r.arrayTag:case r.arrayBufferTag:case r.dataViewTag:case r.booleanTag:case r.dateTag:case r.float32ArrayTag:case r.float64ArrayTag:case r.int8ArrayTag:case r.int16ArrayTag:case r.int32ArrayTag:case r.mapTag:case r.numberTag:case r.objectTag:case r.regexpTag:case r.setTag:case r.stringTag:case r.symbolTag:case r.uint8ArrayTag:case r.uint8ClampedArrayTag:case r.uint16ArrayTag:case r.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=l,e.cloneDeepWithImpl=c,e.copyProperties=f})(ax)),ax}var fT;function Xee(){return fT||(fT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=jL();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(ix)),ix}var hT;function Jee(){return hT||(hT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wL(),n=Xee();function r(i){return i=n.cloneDeep(i),s=>t.isMatch(s,i)}e.matches=r})(Xb)),Xb}var ux={},dx={},fx={},pT;function ete(){return pT||(pT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=jL(),n=Q1(),r=SL();function i(s,l){return t.cloneDeepWith(s,(c,f,h,p)=>{const g=l?.(c,f,h,p);if(g!==void 0)return g;if(typeof s=="object"){if(n.getTag(s)===r.objectTag&&typeof s.constructor!="function"){const v={};return p.set(s,v),t.copyProperties(v,s,h,p),v}switch(Object.prototype.toString.call(s)){case r.numberTag:case r.stringTag:case r.booleanTag:{const v=new s.constructor(s?.valueOf());return t.copyProperties(v,s),v}case r.argumentsTag:{const v={};return t.copyProperties(v,s),v.length=s.length,v[Symbol.iterator]=s[Symbol.iterator],v}default:return}}})}e.cloneDeepWith=i})(fx)),fx}var mT;function tte(){return mT||(mT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ete();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(dx)),dx}var hx={},px={},gT;function NL(){return gT||(gT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function n(r,i=Number.MAX_SAFE_INTEGER){switch(typeof r){case"number":return Number.isInteger(r)&&r>=0&&r<i;case"symbol":return!1;case"string":return t.test(r)}}e.isIndex=n})(px)),px}var mx={},vT;function nte(){return vT||(vT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Q1();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(mx)),mx}var yT;function rte(){return yT||(yT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=lL(),n=NL(),r=nte(),i=Z1();function s(l,c){let f;if(Array.isArray(c)?f=c:typeof c=="string"&&t.isDeepKey(c)&&l?.[c]==null?f=i.toPath(c):f=[c],f.length===0)return!1;let h=l;for(let p=0;p<f.length;p++){const g=f[p];if((h==null||!Object.hasOwn(h,g))&&!((Array.isArray(h)||r.isArguments(h))&&n.isIndex(g)&&g<h.length))return!1;h=h[g]}return!0}e.has=s})(hx)),hx}var bT;function ite(){return bT||(bT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wL(),n=V1(),r=tte(),i=Y1(),s=rte();function l(c,f){switch(typeof c){case"object":{Object.is(c?.valueOf(),-0)&&(c="-0");break}case"number":{c=n.toKey(c);break}}return f=r.cloneDeep(f),function(h){const p=i.get(h,c);return p===void 0?s.has(h,c):f===void 0?p===void 0:t.isMatch(p,f)}}e.matchesProperty=l})(ux)),ux}var xT;function ate(){return xT||(xT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=gL(),n=Zee(),r=Jee(),i=ite();function s(l){if(l==null)return t.identity;switch(typeof l){case"function":return l;case"object":return Array.isArray(l)&&l.length===2?i.matchesProperty(l[0],l[1]):r.matches(l);case"string":case"symbol":case"number":return n.property(l)}}e.iteratee=s})(Wb)),Wb}var wT;function ste(){return wT||(wT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Fee(),n=Kee(),r=gL(),i=Vee(),s=ate();function l(c,f=r.identity){return i.isArrayLikeObject(c)?t.uniqBy(Array.from(c),n.ary(s.iteratee(f),1)):[]}e.uniqBy=l})(qb)),qb}var gx,ST;function ote(){return ST||(ST=1,gx=ste().uniqBy),gx}var lte=ote();const jT=qs(lte);function CL(e,t,n){return t===!0?jT(e,n):typeof t=="function"?jT(e,t):e}var X1=x.createContext(null),cte=e=>e,Ht=()=>{var e=x.useContext(X1);return e?e.store.dispatch:cte},Zp=()=>{},ute=()=>Zp,dte=(e,t)=>e===t;function Re(e){var t=x.useContext(X1),n=x.useMemo(()=>t?r=>{if(r!=null)return e(r)}:Zp,[t,e]);return BM.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:ute,t?t.store.getState:Zp,t?t.store.getState:Zp,n,dte)}function fte(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function hte(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function pte(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var NT=e=>Array.isArray(e)?e:[e];function mte(e){const t=Array.isArray(e[0])?e[0]:e;return pte(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function gte(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var vte=class{constructor(e){this.value=e}deref(){return this.value}},yte=typeof WeakRef<"u"?WeakRef:vte,bte=0,CT=1;function xp(){return{s:bte,v:void 0,o:null,p:null}}function OL(e,t={}){let n=xp();const{resultEqualityCheck:r}=t;let i,s=0;function l(){let c=n;const{length:f}=arguments;for(let g=0,v=f;g<v;g++){const y=arguments[g];if(typeof y=="function"||typeof y=="object"&&y!==null){let w=c.o;w===null&&(c.o=w=new WeakMap);const S=w.get(y);S===void 0?(c=xp(),w.set(y,c)):c=S}else{let w=c.p;w===null&&(c.p=w=new Map);const S=w.get(y);S===void 0?(c=xp(),w.set(y,c)):c=S}}const h=c;let p;if(c.s===CT)p=c.v;else if(p=e.apply(null,arguments),s++,r){const g=i?.deref?.()??i;g!=null&&r(g,p)&&(p=g,s!==0&&s--),i=typeof p=="object"&&p!==null||typeof p=="function"?new yte(p):p}return h.s=CT,h.v=p,p}return l.clearCache=()=>{n=xp(),l.resetResultsCount()},l.resultsCount=()=>s,l.resetResultsCount=()=>{s=0},l}function xte(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let s=0,l=0,c,f={},h=i.pop();typeof h=="object"&&(f=h,h=i.pop()),fte(h,`createSelector expects an output function after the inputs, but received: [${typeof h}]`);const p={...n,...f},{memoize:g,memoizeOptions:v=[],argsMemoize:y=OL,argsMemoizeOptions:w=[]}=p,S=NT(v),N=NT(w),C=mte(i),E=g(function(){return s++,h.apply(null,arguments)},...S),k=y(function(){l++;const T=gte(C,arguments);return c=E.apply(null,T),c},...N);return Object.assign(k,{resultFunc:h,memoizedResultFunc:E,dependencies:C,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>c,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:g,argsMemoize:y})};return Object.assign(r,{withTypes:()=>r}),r}var ne=xte(OL),wte=Object.assign((e,t=ne)=>{hte(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(s=>e[s]);return t(r,(...s)=>s.reduce((l,c,f)=>(l[n[f]]=c,l),{}))},{withTypes:()=>wte}),vx={},yx={},bx={},OT;function Ste(){return OT||(OT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"?1:r===null?2:r===void 0?3:r!==r?4:0}const n=(r,i,s)=>{if(r!==i){const l=t(r),c=t(i);if(l===c&&l===0){if(r<i)return s==="desc"?1:-1;if(r>i)return s==="desc"?-1:1}return s==="desc"?c-l:l-c}return 0};e.compareValues=n})(bx)),bx}var xx={},wx={},_T;function _L(){return _T||(_T=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(wx)),wx}var kT;function jte(){return kT||(kT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_L(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(s,l){return Array.isArray(s)?!1:typeof s=="number"||typeof s=="boolean"||s==null||t.isSymbol(s)?!0:typeof s=="string"&&(r.test(s)||!n.test(s))||l!=null&&Object.hasOwn(l,s)}e.isKey=i})(xx)),xx}var AT;function Nte(){return AT||(AT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ste(),n=jte(),r=Z1();function i(s,l,c,f){if(s==null)return[];c=f?void 0:c,Array.isArray(s)||(s=Object.values(s)),Array.isArray(l)||(l=l==null?[null]:[l]),l.length===0&&(l=[null]),Array.isArray(c)||(c=c==null?[]:[c]),c=c.map(y=>String(y));const h=(y,w)=>{let S=y;for(let N=0;N<w.length&&S!=null;++N)S=S[w[N]];return S},p=(y,w)=>w==null||y==null?w:typeof y=="object"&&"key"in y?Object.hasOwn(w,y.key)?w[y.key]:h(w,y.path):typeof y=="function"?y(w):Array.isArray(y)?h(w,y):typeof w=="object"?w[y]:w,g=l.map(y=>(Array.isArray(y)&&y.length===1&&(y=y[0]),y==null||typeof y=="function"||Array.isArray(y)||n.isKey(y)?y:{key:y,path:r.toPath(y)}));return s.map(y=>({original:y,criteria:g.map(w=>p(w,y))})).slice().sort((y,w)=>{for(let S=0;S<g.length;S++){const N=t.compareValues(y.criteria[S],w.criteria[S],c[S]);if(N!==0)return N}return 0}).map(y=>y.original)}e.orderBy=i})(yx)),yx}var Sx={},ET;function Cte(){return ET||(ET=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],s=Math.floor(r),l=(c,f)=>{for(let h=0;h<c.length;h++){const p=c[h];Array.isArray(p)&&f<s?l(p,f+1):i.push(p)}};return l(n,0),i}e.flatten=t})(Sx)),Sx}var jx={},TT;function kL(){return TT||(TT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=NL(),n=vL(),r=yL(),i=xL();function s(l,c,f){return r.isObject(f)&&(typeof c=="number"&&n.isArrayLike(f)&&t.isIndex(c)&&c<f.length||typeof c=="string"&&c in f)?i.isEqualsSameValueZero(f[c],l):!1}e.isIterateeCall=s})(jx)),jx}var PT;function Ote(){return PT||(PT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Nte(),n=Cte(),r=kL();function i(s,...l){const c=l.length;return c>1&&r.isIterateeCall(s,l[0],l[1])?l=[]:c>2&&r.isIterateeCall(l[0],l[1],l[2])&&(l=[l[0]]),t.orderBy(s,n.flatten(l),["asc"])}e.sortBy=i})(vx)),vx}var Nx,zT;function _te(){return zT||(zT=1,Nx=Ote().sortBy),Nx}var kte=_te();const nv=qs(kte);var AL=e=>e.legend.settings,Ate=e=>e.legend.size,Ete=e=>e.legend.payload,Tte=ne([Ete,AL],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?nv(r,n):r});function Pte(){return Re(Tte)}var wp=1;function EL(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=x.useState({height:0,left:0,top:0,width:0}),r=x.useCallback(i=>{if(i!=null){var s=i.getBoundingClientRect(),l={height:s.height,left:s.left,top:s.top,width:s.width};(Math.abs(l.height-t.height)>wp||Math.abs(l.left-t.left)>wp||Math.abs(l.top-t.top)>wp||Math.abs(l.width-t.width)>wp)&&n({height:l.height,left:l.left,top:l.top,width:l.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function Mn(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var zte=typeof Symbol=="function"&&Symbol.observable||"@@observable",MT=zte,Cx=()=>Math.random().toString(36).substring(7).split("").join("."),Mte={INIT:`@@redux/INIT${Cx()}`,REPLACE:`@@redux/REPLACE${Cx()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Cx()}`},km=Mte;function J1(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function TL(e,t,n){if(typeof e!="function")throw new Error(Mn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Mn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Mn(1));return n(TL)(e,t)}let r=e,i=t,s=new Map,l=s,c=0,f=!1;function h(){l===s&&(l=new Map,s.forEach((N,C)=>{l.set(C,N)}))}function p(){if(f)throw new Error(Mn(3));return i}function g(N){if(typeof N!="function")throw new Error(Mn(4));if(f)throw new Error(Mn(5));let C=!0;h();const E=c++;return l.set(E,N),function(){if(C){if(f)throw new Error(Mn(6));C=!1,h(),l.delete(E),s=null}}}function v(N){if(!J1(N))throw new Error(Mn(7));if(typeof N.type>"u")throw new Error(Mn(8));if(typeof N.type!="string")throw new Error(Mn(17));if(f)throw new Error(Mn(9));try{f=!0,i=r(i,N)}finally{f=!1}return(s=l).forEach(E=>{E()}),N}function y(N){if(typeof N!="function")throw new Error(Mn(10));r=N,v({type:km.REPLACE})}function w(){const N=g;return{subscribe(C){if(typeof C!="object"||C===null)throw new Error(Mn(11));function E(){const O=C;O.next&&O.next(p())}return E(),{unsubscribe:N(E)}},[MT](){return this}}}return v({type:km.INIT}),{dispatch:v,subscribe:g,getState:p,replaceReducer:y,[MT]:w}}function Rte(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:km.INIT})>"u")throw new Error(Mn(12));if(typeof n(void 0,{type:km.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Mn(13))})}function PL(e){const t=Object.keys(e),n={};for(let s=0;s<t.length;s++){const l=t[s];typeof e[l]=="function"&&(n[l]=e[l])}const r=Object.keys(n);let i;try{Rte(n)}catch(s){i=s}return function(l={},c){if(i)throw i;let f=!1;const h={};for(let p=0;p<r.length;p++){const g=r[p],v=n[g],y=l[g],w=v(y,c);if(typeof w>"u")throw c&&c.type,new Error(Mn(14));h[g]=w,f=f||w!==y}return f=f||r.length!==Object.keys(l).length,f?h:l}}function Am(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function Dte(...e){return t=>(n,r)=>{const i=t(n,r);let s=()=>{throw new Error(Mn(15))};const l={getState:i.getState,dispatch:(f,...h)=>s(f,...h)},c=e.map(f=>f(l));return s=Am(...c)(i.dispatch),{...i,dispatch:s}}}function zL(e){return J1(e)&&"type"in e&&typeof e.type=="string"}var ML=Symbol.for("immer-nothing"),RT=Symbol.for("immer-draftable"),ir=Symbol.for("immer-state");function xi(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Tr=Object,Ic=Tr.getPrototypeOf,Em="constructor",rv="prototype",Qw="configurable",Tm="enumerable",Yp="writable",Hd="value",za=e=>!!e&&!!e[ir];function Oi(e){return e?RL(e)||av(e)||!!e[RT]||!!e[Em]?.[RT]||sv(e)||ov(e):!1}var Ite=Tr[rv][Em].toString(),DT=new WeakMap;function RL(e){if(!e||!ej(e))return!1;const t=Ic(e);if(t===null||t===Tr[rv])return!0;const n=Tr.hasOwnProperty.call(t,Em)&&t[Em];if(n===Object)return!0;if(!mc(n))return!1;let r=DT.get(n);return r===void 0&&(r=Function.toString.call(n),DT.set(n,r)),r===Ite}function iv(e,t,n=!0){mf(e)===0?(n?Reflect.ownKeys(e):Tr.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function mf(e){const t=e[ir];return t?t.type_:av(e)?1:sv(e)?2:ov(e)?3:0}var IT=(e,t,n=mf(e))=>n===2?e.has(t):Tr[rv].hasOwnProperty.call(e,t),Xw=(e,t,n=mf(e))=>n===2?e.get(t):e[t],Pm=(e,t,n,r=mf(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Lte(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var av=Array.isArray,sv=e=>e instanceof Map,ov=e=>e instanceof Set,ej=e=>typeof e=="object",mc=e=>typeof e=="function",Ox=e=>typeof e=="boolean";function $te(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var Na=e=>e.copy_||e.base_,tj=e=>e.modified_?e.copy_:e.base_;function Jw(e,t){if(sv(e))return new Map(e);if(ov(e))return new Set(e);if(av(e))return Array[rv].slice.call(e);const n=RL(e);if(t===!0||t==="class_only"&&!n){const r=Tr.getOwnPropertyDescriptors(e);delete r[ir];let i=Reflect.ownKeys(r);for(let s=0;s<i.length;s++){const l=i[s],c=r[l];c[Yp]===!1&&(c[Yp]=!0,c[Qw]=!0),(c.get||c.set)&&(r[l]={[Qw]:!0,[Yp]:!0,[Tm]:c[Tm],[Hd]:e[l]})}return Tr.create(Ic(e),r)}else{const r=Ic(e);if(r!==null&&n)return{...e};const i=Tr.create(r);return Tr.assign(i,e)}}function nj(e,t=!1){return lv(e)||za(e)||!Oi(e)||(mf(e)>1&&Tr.defineProperties(e,{set:Sp,add:Sp,clear:Sp,delete:Sp}),Tr.freeze(e),t&&iv(e,(n,r)=>{nj(r,!0)},!1)),e}function Ute(){xi(2)}var Sp={[Hd]:Ute};function lv(e){return e===null||!ej(e)?!0:Tr.isFrozen(e)}var zm="MapSet",eS="Patches",LT="ArrayMethods",DL={};function el(e){const t=DL[e];return t||xi(0,e),t}var $T=e=>!!DL[e],Gd,IL=()=>Gd,Bte=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:$T(zm)?el(zm):void 0,arrayMethodsPlugin_:$T(LT)?el(LT):void 0});function UT(e,t){t&&(e.patchPlugin_=el(eS),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function tS(e){nS(e),e.drafts_.forEach(qte),e.drafts_=null}function nS(e){e===Gd&&(Gd=e.parent_)}var BT=e=>Gd=Bte(Gd,e);function qte(e){const t=e[ir];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function qT(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[ir].modified_&&(tS(t),xi(4)),Oi(e)&&(e=FT(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[ir].base_,e,t)}else e=FT(t,n);return Fte(t,e,!0),tS(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ML?e:void 0}function FT(e,t){if(lv(t))return t;const n=t[ir];if(!n)return Mm(t,e.handledSet_,e);if(!cv(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);UL(n,e)}return n.copy_}function Fte(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&nj(t,n)}function LL(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var cv=(e,t)=>e.scope_===t,Kte=[];function $L(e,t,n,r){const i=Na(e),s=e.type_;if(r!==void 0&&Xw(i,r,s)===t){Pm(i,r,n,s);return}if(!e.draftLocations_){const c=e.draftLocations_=new Map;iv(i,(f,h)=>{if(za(h)){const p=c.get(h)||[];p.push(f),c.set(h,p)}})}const l=e.draftLocations_.get(t)??Kte;for(const c of l)Pm(i,c,n,s)}function Hte(e,t,n){e.callbacks_.push(function(i){const s=t;if(!s||!cv(s,i))return;i.mapSetPlugin_?.fixSetContents(s);const l=tj(s);$L(e,s.draft_??s,l,n),UL(s,i)})}function UL(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:r}=t;if(r){const i=r.getPath(e);i&&r.generatePatches_(e,i,t)}LL(e)}}function Gte(e,t,n){const{scope_:r}=e;if(za(n)){const i=n[ir];cv(i,r)&&i.callbacks_.push(function(){Wp(e);const l=tj(i);$L(e,n,l,t)})}else Oi(n)&&e.callbacks_.push(function(){const s=Na(e);e.type_===3?s.has(n)&&Mm(n,r.handledSet_,r):Xw(s,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Mm(Xw(e.copy_,t,e.type_),r.handledSet_,r)})}function Mm(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||za(e)||t.has(e)||!Oi(e)||lv(e)||(t.add(e),iv(e,(r,i)=>{if(za(i)){const s=i[ir];if(cv(s,n)){const l=tj(s);Pm(e,r,l,e.type_),LL(s)}}else Oi(i)&&Mm(i,t,n)})),e}function Vte(e,t){const n=av(e),r={type_:n?1:0,scope_:t?t.scope_:IL(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,s=Rm;n&&(i=[r],s=Vd);const{revoke:l,proxy:c}=Proxy.revocable(i,s);return r.draft_=c,r.revoke_=l,[c,r]}var Rm={get(e,t){if(t===ir)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=Na(e);if(!IT(i,t,e.type_))return Zte(e,i,t);const s=i[t];if(e.finalized_||!Oi(s)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&$te(t))return s;if(s===_x(e.base_,t)){Wp(e);const l=e.type_===1?+t:t,c=iS(e.scope_,s,e,l);return e.copy_[l]=c}return s},has(e,t){return t in Na(e)},ownKeys(e){return Reflect.ownKeys(Na(e))},set(e,t,n){const r=BL(Na(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=_x(Na(e),t),s=i?.[ir];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(Lte(n,i)&&(n!==void 0||IT(e.base_,t,e.type_)))return!0;Wp(e),rS(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),Gte(e,t,n)),!0},deleteProperty(e,t){return Wp(e),_x(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),rS(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Na(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Yp]:!0,[Qw]:e.type_!==1||t!=="length",[Tm]:r[Tm],[Hd]:n[t]}},defineProperty(){xi(11)},getPrototypeOf(e){return Ic(e.base_)},setPrototypeOf(){xi(12)}},Vd={};for(let e in Rm){let t=Rm[e];Vd[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Vd.deleteProperty=function(e,t){return Vd.set.call(this,e,t,void 0)};Vd.set=function(e,t,n){return Rm.set.call(this,e[0],t,n,e[0])};function _x(e,t){const n=e[ir];return(n?Na(n):e)[t]}function Zte(e,t,n){const r=BL(t,n);return r?Hd in r?r[Hd]:r.get?.call(e.draft_):void 0}function BL(e,t){if(!(t in e))return;let n=Ic(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Ic(n)}}function rS(e){e.modified_||(e.modified_=!0,e.parent_&&rS(e.parent_))}function Wp(e){e.copy_||(e.assigned_=new Map,e.copy_=Jw(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Yte=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(mc(n)&&!mc(r)){const l=r;r=n;const c=this;return function(h=l,...p){return c.produce(h,g=>r.call(this,g,...p))}}mc(r)||xi(6),i!==void 0&&!mc(i)&&xi(7);let s;if(Oi(n)){const l=BT(this),c=iS(l,n,void 0);let f=!0;try{s=r(c),f=!1}finally{f?tS(l):nS(l)}return UT(l,i),qT(s,l)}else if(!n||!ej(n)){if(s=r(n),s===void 0&&(s=n),s===ML&&(s=void 0),this.autoFreeze_&&nj(s,!0),i){const l=[],c=[];el(eS).generateReplacementPatches_(n,s,{patches_:l,inversePatches_:c}),i(l,c)}return s}else xi(1,n)},this.produceWithPatches=(n,r)=>{if(mc(n))return(c,...f)=>this.produceWithPatches(c,h=>n(h,...f));let i,s;return[this.produce(n,r,(c,f)=>{i=c,s=f}),i,s]},Ox(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),Ox(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),Ox(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Oi(t)||xi(8),za(t)&&(t=ti(t));const n=BT(this),r=iS(n,t,void 0);return r[ir].isManual_=!0,nS(n),r}finishDraft(t,n){const r=t&&t[ir];(!r||!r.isManual_)&&xi(9);const{scope_:i}=r;return UT(i,n),qT(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,n){let r;for(r=n.length-1;r>=0;r--){const s=n[r];if(s.path.length===0&&s.op==="replace"){t=s.value;break}}r>-1&&(n=n.slice(r+1));const i=el(eS).applyPatches_;return za(t)?i(t,n):this.produce(t,s=>i(s,n))}};function iS(e,t,n,r){const[i,s]=sv(t)?el(zm).proxyMap_(t,n):ov(t)?el(zm).proxySet_(t,n):Vte(t,n);return(n?.scope_??IL()).drafts_.push(i),s.callbacks_=n?.callbacks_??[],s.key_=r,n&&r!==void 0?Hte(n,s,r):s.callbacks_.push(function(f){f.mapSetPlugin_?.fixSetContents(s);const{patchPlugin_:h}=f;s.modified_&&h&&h.generatePatches_(s,[],f)}),i}function ti(e){return za(e)||xi(10,e),qL(e)}function qL(e){if(!Oi(e)||lv(e))return e;const t=e[ir];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Jw(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Jw(e,!0);return iv(n,(i,s)=>{Pm(n,i,qL(s))},r),t&&(t.finalized_=!1),n}var Wte=new Yte,FL=Wte.produce;function KL(e){return({dispatch:n,getState:r})=>i=>s=>typeof s=="function"?s(n,r,e):i(s)}var Qte=KL(),Xte=KL,Jte=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Am:Am.apply(null,arguments)};function zr(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(Pr(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>zL(r)&&r.type===e,n}var HL=class Sd extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Sd.prototype)}static get[Symbol.species](){return Sd}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Sd(...t[0].concat(this)):new Sd(...t.concat(this))}};function KT(e){return Oi(e)?FL(e,()=>{}):e}function jp(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function ene(e){return typeof e=="boolean"}var tne=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:s=!0}=t??{};let l=new HL;return n&&(ene(n)?l.push(Qte):l.push(Xte(n.extraArgument))),l},GL="RTK_autoBatch",At=()=>e=>({payload:e,meta:{[GL]:!0}}),HT=e=>t=>{setTimeout(t,e)},VL=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,s=!1,l=!1;const c=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:HT(10):e.type==="callback"?e.queueNotification:HT(e.timeout),h=()=>{l=!1,s&&(s=!1,c.forEach(p=>p()))};return Object.assign({},r,{subscribe(p){const g=()=>i&&p(),v=r.subscribe(g);return c.add(p),()=>{v(),c.delete(p)}},dispatch(p){try{return i=!p?.meta?.[GL],s=!i,s&&(l||(l=!0,f(h))),r.dispatch(p)}finally{i=!0}}})},nne=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new HL(e);return r&&i.push(VL(typeof r=="object"?r:void 0)),i};function rne(e){const t=tne(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:s=void 0,enhancers:l=void 0}=e||{};let c;if(typeof n=="function")c=n;else if(J1(n))c=PL(n);else throw new Error(Pr(1));let f;typeof r=="function"?f=r(t):f=t();let h=Am;i&&(h=Jte({trace:!1,...typeof i=="object"&&i}));const p=Dte(...f),g=nne(p);let v=typeof l=="function"?l(g):g();const y=h(...v);return TL(c,s,y)}function ZL(e){const t={},n=[];let r;const i={addCase(s,l){const c=typeof s=="string"?s:s.type;if(!c)throw new Error(Pr(28));if(c in t)throw new Error(Pr(29));return t[c]=l,i},addAsyncThunk(s,l){return l.pending&&(t[s.pending.type]=l.pending),l.rejected&&(t[s.rejected.type]=l.rejected),l.fulfilled&&(t[s.fulfilled.type]=l.fulfilled),l.settled&&n.push({matcher:s.settled,reducer:l.settled}),i},addMatcher(s,l){return n.push({matcher:s,reducer:l}),i},addDefaultCase(s){return r=s,i}};return e(i),[t,n,r]}function ine(e){return typeof e=="function"}function ane(e,t){let[n,r,i]=ZL(t),s;if(ine(e))s=()=>KT(e());else{const c=KT(e);s=()=>c}function l(c=s(),f){let h=[n[f.type],...r.filter(({matcher:p})=>p(f)).map(({reducer:p})=>p)];return h.filter(p=>!!p).length===0&&(h=[i]),h.reduce((p,g)=>{if(g)if(za(p)){const y=g(p,f);return y===void 0?p:y}else{if(Oi(p))return FL(p,v=>g(v,f));{const v=g(p,f);if(v===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return v}}return p},c)}return l.getInitialState=s,l}var sne="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",one=(e=21)=>{let t="",n=e;for(;n--;)t+=sne[Math.random()*64|0];return t},lne=Symbol.for("rtk-slice-createasyncthunk");function cne(e,t){return`${e}/${t}`}function une({creators:e}={}){const t=e?.asyncThunk?.[lne];return function(r){const{name:i,reducerPath:s=i}=r;if(!i)throw new Error(Pr(11));const l=(typeof r.reducers=="function"?r.reducers(fne()):r.reducers)||{},c=Object.keys(l),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},h={addCase(k,O){const T=typeof k=="string"?k:k.type;if(!T)throw new Error(Pr(12));if(T in f.sliceCaseReducersByType)throw new Error(Pr(13));return f.sliceCaseReducersByType[T]=O,h},addMatcher(k,O){return f.sliceMatchers.push({matcher:k,reducer:O}),h},exposeAction(k,O){return f.actionCreators[k]=O,h},exposeCaseReducer(k,O){return f.sliceCaseReducersByName[k]=O,h}};c.forEach(k=>{const O=l[k],T={reducerName:k,type:cne(i,k),createNotation:typeof r.reducers=="function"};pne(O)?gne(T,O,h,t):hne(T,O,h)});function p(){const[k={},O=[],T=void 0]=typeof r.extraReducers=="function"?ZL(r.extraReducers):[r.extraReducers],P={...k,...f.sliceCaseReducersByType};return ane(r.initialState,A=>{for(let z in P)A.addCase(z,P[z]);for(let z of f.sliceMatchers)A.addMatcher(z.matcher,z.reducer);for(let z of O)A.addMatcher(z.matcher,z.reducer);T&&A.addDefaultCase(T)})}const g=k=>k,v=new Map,y=new WeakMap;let w;function S(k,O){return w||(w=p()),w(k,O)}function N(){return w||(w=p()),w.getInitialState()}function C(k,O=!1){function T(A){let z=A[k];return typeof z>"u"&&O&&(z=jp(y,T,N)),z}function P(A=g){const z=jp(v,O,()=>new WeakMap);return jp(z,A,()=>{const R={};for(const[q,U]of Object.entries(r.selectors??{}))R[q]=dne(U,A,()=>jp(y,A,N),O);return R})}return{reducerPath:k,getSelectors:P,get selectors(){return P(T)},selectSlice:T}}const E={name:i,reducer:S,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:N,...C(s),injectInto(k,{reducerPath:O,...T}={}){const P=O??s;return k.inject({reducerPath:P,reducer:S},T),{...E,...C(P,!0)}}};return E}}function dne(e,t,n,r){function i(s,...l){let c=t(s);return typeof c>"u"&&r&&(c=n()),e(c,...l)}return i.unwrapped=e,i}var Yn=une();function fne(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function hne({type:e,reducerName:t,createNotation:n},r,i){let s,l;if("reducer"in r){if(n&&!mne(r))throw new Error(Pr(17));s=r.reducer,l=r.prepare}else s=r;i.addCase(e,s).exposeCaseReducer(t,s).exposeAction(t,l?zr(e,l):zr(e))}function pne(e){return e._reducerDefinitionType==="asyncThunk"}function mne(e){return e._reducerDefinitionType==="reducerWithPrepare"}function gne({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Pr(18));const{payloadCreator:s,fulfilled:l,pending:c,rejected:f,settled:h,options:p}=n,g=i(e,s,p);r.exposeAction(t,g),l&&r.addCase(g.fulfilled,l),c&&r.addCase(g.pending,c),f&&r.addCase(g.rejected,f),h&&r.addMatcher(g.settled,h),r.exposeCaseReducer(t,{fulfilled:l||Np,pending:c||Np,rejected:f||Np,settled:h||Np})}function Np(){}var vne="task",YL="listener",WL="completed",rj="cancelled",yne=`task-${rj}`,bne=`task-${WL}`,aS=`${YL}-${rj}`,xne=`${YL}-${WL}`,uv=class{constructor(e){this.code=e,this.message=`${vne} ${rj} (reason: ${e})`}name="TaskAbortError";message},ij=(e,t)=>{if(typeof e!="function")throw new TypeError(Pr(32))},Dm=()=>{},QL=(e,t=Dm)=>(e.catch(t),e),XL=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Fo=e=>{if(e.aborted)throw new uv(e.reason)};function JL(e,t){let n=Dm;return new Promise((r,i)=>{const s=()=>i(new uv(e.reason));if(e.aborted){s();return}n=XL(e,s),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Dm})}var wne=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof uv?"cancelled":"rejected",error:n}}finally{t?.()}},Im=e=>t=>QL(JL(e,t).then(n=>(Fo(e),n))),e$=e=>{const t=Im(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:kc}=Object,GT={},dv="listenerMiddleware",Sne=(e,t)=>{const n=r=>XL(e,()=>r.abort(e.reason));return(r,i)=>{ij(r);const s=new AbortController;n(s);const l=wne(async()=>{Fo(e),Fo(s.signal);const c=await r({pause:Im(s.signal),delay:e$(s.signal),signal:s.signal});return Fo(s.signal),c},()=>s.abort(bne));return i?.autoJoin&&t.push(l.catch(Dm)),{result:Im(e)(l),cancel(){s.abort(yne)}}}},jne=(e,t)=>{const n=async(r,i)=>{Fo(t);let s=()=>{};const c=[new Promise((f,h)=>{let p=e({predicate:r,effect:(g,v)=>{v.unsubscribe(),f([g,v.getState(),v.getOriginalState()])}});s=()=>{p(),h()}})];i!=null&&c.push(new Promise(f=>setTimeout(f,i,null)));try{const f=await JL(t,Promise.race(c));return Fo(t),f}finally{s()}};return(r,i)=>QL(n(r,i))},t$=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:s}=e;if(t)i=zr(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Pr(21));return ij(s),{predicate:i,type:t,effect:s}},n$=kc(e=>{const{type:t,predicate:n,effect:r}=t$(e);return{id:one(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Pr(22))}}},{withTypes:()=>n$}),VT=(e,t)=>{const{type:n,effect:r,predicate:i}=t$(t);return Array.from(e.values()).find(s=>(typeof n=="string"?s.type===n:s.predicate===i)&&s.effect===r)},sS=e=>{e.pending.forEach(t=>{t.abort(aS)})},Nne=(e,t)=>()=>{for(const n of t.keys())sS(n);e.clear()},ZT=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},r$=kc(zr(`${dv}/add`),{withTypes:()=>r$}),Cne=zr(`${dv}/removeAll`),i$=kc(zr(`${dv}/remove`),{withTypes:()=>i$}),One=(...e)=>{console.error(`${dv}/error`,...e)},gf=(e={})=>{const t=new Map,n=new Map,r=y=>{const w=n.get(y)??0;n.set(y,w+1)},i=y=>{const w=n.get(y)??1;w===1?n.delete(y):n.set(y,w-1)},{extra:s,onError:l=One}=e;ij(l);const c=y=>(y.unsubscribe=()=>t.delete(y.id),t.set(y.id,y),w=>{y.unsubscribe(),w?.cancelActive&&sS(y)}),f=y=>{const w=VT(t,y)??n$(y);return c(w)};kc(f,{withTypes:()=>f});const h=y=>{const w=VT(t,y);return w&&(w.unsubscribe(),y.cancelActive&&sS(w)),!!w};kc(h,{withTypes:()=>h});const p=async(y,w,S,N)=>{const C=new AbortController,E=jne(f,C.signal),k=[];try{y.pending.add(C),r(y),await Promise.resolve(y.effect(w,kc({},S,{getOriginalState:N,condition:(O,T)=>E(O,T).then(Boolean),take:E,delay:e$(C.signal),pause:Im(C.signal),extra:s,signal:C.signal,fork:Sne(C.signal,k),unsubscribe:y.unsubscribe,subscribe:()=>{t.set(y.id,y)},cancelActiveListeners:()=>{y.pending.forEach((O,T,P)=>{O!==C&&(O.abort(aS),P.delete(O))})},cancel:()=>{C.abort(aS),y.pending.delete(C)},throwIfCancelled:()=>{Fo(C.signal)}})))}catch(O){O instanceof uv||ZT(l,O,{raisedBy:"effect"})}finally{await Promise.all(k),C.abort(xne),i(y),y.pending.delete(C)}},g=Nne(t,n);return{middleware:y=>w=>S=>{if(!zL(S))return w(S);if(r$.match(S))return f(S.payload);if(Cne.match(S)){g();return}if(i$.match(S))return h(S.payload);let N=y.getState();const C=()=>{if(N===GT)throw new Error(Pr(23));return N};let E;try{if(E=w(S),t.size>0){const k=y.getState(),O=Array.from(t.values());for(const T of O){let P=!1;try{P=T.predicate(S,k,N)}catch(A){P=!1,ZT(l,A,{raisedBy:"predicate"})}P&&p(T,S,y,C)}}}finally{N=GT}return E},startListening:f,stopListening:h,clearListeners:g}};function Pr(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var _ne={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},a$=Yn({name:"chartLayout",initialState:_ne,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var n,r,i,s;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(r=t.payload.right)!==null&&r!==void 0?r:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(s=t.payload.left)!==null&&s!==void 0?s:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:kne,setLayout:Ane,setChartSize:Ene,setScale:Tne}=a$.actions,Pne=a$.reducer;function s$(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function He(e){return Number.isFinite(e)}function Qi(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function YT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YT(Object(n),!0).forEach(function(r){zne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zne(e,t,n){return(t=Mne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mne(e){var t=Rne(e,"string");return typeof t=="symbol"?t:t+""}function Rne(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cn(e,t,n){return Ln(e)||Ln(t)?n:ai(t)?tv(e,t,n):typeof t=="function"?t(e):n}var Dne=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:s,verticalAlign:l,layout:c}=t;if((c==="vertical"||c==="horizontal"&&l==="middle")&&s!=="center"&&Pe(e[s]))return wc(wc({},e),{},{[s]:e[s]+(r||0)});if((c==="horizontal"||c==="vertical"&&s==="center")&&l!=="middle"&&Pe(e[l]))return wc(wc({},e),{},{[l]:e[l]+(i||0)})}return e},ea=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",o$=(e,t,n,r)=>{if(r)return e.map(c=>c.coordinate);var i,s,l=e.map(c=>(c.coordinate===t&&(i=!0),c.coordinate===n&&(s=!0),c.coordinate));return i||l.push(t),s||l.push(n),l},l$=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:s,scale:l,realScaleType:c,isCategorical:f,categoricalDomain:h,tickCount:p,ticks:g,niceTicks:v,axisType:y}=e;if(!l)return null;var w=c==="scaleBand"&&l.bandwidth?l.bandwidth()/2:2,S=i==="category"&&l.bandwidth?l.bandwidth()/w:0;if(S=y==="angleAxis"&&s&&s.length>=2?ei(s[0]-s[1])*2*S:S,g||v){var N=(g||v||[]).map((C,E)=>{var k=r?r.indexOf(C):C,O=l.map(k);return He(O)?{coordinate:O+S,value:C,offset:S,index:E}:null}).filter(vr);return N}return f&&h?h.map((C,E)=>{var k=l.map(C);return He(k)?{coordinate:k+S,value:C,index:E,offset:S}:null}).filter(vr):l.ticks&&p!=null?l.ticks(p).map((C,E)=>{var k=l.map(C);return He(k)?{coordinate:k+S,value:C,index:E,offset:S}:null}).filter(vr):l.domain().map((C,E)=>{var k=l.map(C);return He(k)?{coordinate:k+S,value:r?r[C]:C,index:E,offset:S}:null}).filter(vr)},Ine=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var s=0,l=0,c=0;c<n;++c){var f=e[c],h=f?.[i];if(h!=null){var p=h[1],g=h[0],v=Wi(p)?g:p;v>=0?(h[0]=s,s+=v,h[1]=s):(h[0]=l,l+=v,h[1]=l)}}}},Lne=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var s=0,l=0;l<n;++l){var c=e[l],f=c?.[i];if(f!=null){var h=Wi(f[1])?f[0]:f[1];h>=0?(f[0]=s,s+=h,f[1]=s):(f[0]=0,f[1]=0)}}}},$ne={sign:Ine,expand:dee,none:Xo,silhouette:fee,wiggle:hee,positive:Lne},Une=(e,t,n)=>{var r,i=(r=$ne[n])!==null&&r!==void 0?r:Xo,s=uee().keys(t).value((c,f)=>Number(Cn(c,f,0))).order(Yw).offset(i),l=s(e);return l.forEach((c,f)=>{c.forEach((h,p)=>{var g=Cn(e[p],t[f],0);Array.isArray(g)&&g.length===2&&Pe(g[0])&&Pe(g[1])&&(h[0]=g[0],h[1]=g[1])})}),l};function Bne(e){return e==null?void 0:String(e)}function WT(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:s,dataKey:l}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ln(i[t.dataKey])){var c=uL(n,"value",i[t.dataKey]);if(c)return c.coordinate+r/2}return n!=null&&n[s]?n[s].coordinate+r/2:null}var f=Cn(i,Ln(l)?t.dataKey:l),h=t.scale.map(f);return Pe(h)?h:null}var qne=e=>{var t=e.flat(2).filter(Pe);return[Math.min(...t),Math.max(...t)]},Fne=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],Kne=(e,t,n)=>{if(e!=null)return Fne(Object.keys(e).reduce((r,i)=>{var s=e[i];if(!s)return r;var{stackedData:l}=s,c=l.reduce((f,h)=>{var p=s$(h,t,n),g=qne(p);return!He(g[0])||!He(g[1])?f:[Math.min(f[0],g[0]),Math.max(f[1],g[1])]},[1/0,-1/0]);return[Math.min(c[0],r[0]),Math.max(c[1],r[1])]},[1/0,-1/0]))},QT=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,XT=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Lm=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=nv(t,p=>p.coordinate),s=1/0,l=1,c=i.length;l<c;l++){var f=i[l],h=i[l-1];s=Math.min((f?.coordinate||0)-(h?.coordinate||0),s)}return s===1/0?0:s}return n?void 0:0};function JT(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:s}=e;return wc(wc({},t),{},{dataKey:n,payload:r,value:i,name:s})}function c$(e,t){if(e)return String(e);if(typeof t=="string")return t}var Hne=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},Gne=(e,t)=>t==="centric"?e.angle:e.radius,La=e=>e.layout.width,$a=e=>e.layout.height,Vne=e=>e.layout.scale,u$=e=>e.layout.margin,fv=ne(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),hv=ne(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),Zne="data-recharts-item-index",Yne="data-recharts-item-id",vf=60;function e2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Cp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?e2(Object(n),!0).forEach(function(r){Wne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wne(e,t,n){return(t=Qne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qne(e){var t=Xne(e,"string");return typeof t=="symbol"?t:t+""}function Xne(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Jne=e=>e.brush.height;function ere(e){var t=hv(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:vf;return n+i}return n},0)}function tre(e){var t=hv(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:vf;return n+i}return n},0)}function nre(e){var t=fv(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function rre(e){var t=fv(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var Un=ne([La,$a,u$,Jne,ere,tre,nre,rre,AL,Ate],(e,t,n,r,i,s,l,c,f,h)=>{var p={left:(n.left||0)+i,right:(n.right||0)+s},g={top:(n.top||0)+l,bottom:(n.bottom||0)+c},v=Cp(Cp({},g),p),y=v.bottom;v.bottom+=r,v=Dne(v,f,h);var w=e-v.left-v.right,S=t-v.top-v.bottom;return Cp(Cp({brushBottom:y},v),{},{width:Math.max(w,0),height:Math.max(S,0)})}),ire=ne(Un,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),d$=ne(La,$a,(e,t)=>({x:0,y:0,width:e,height:t})),are=x.createContext(null),sr=()=>x.useContext(are)!=null,pv=e=>e.brush,mv=ne([pv,Un,u$],(e,t,n)=>({height:e.height,x:Pe(e.x)?e.x:t.left,y:Pe(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:Pe(e.width)?e.width:t.width})),kx={},Ax={},Ex={},t2;function sre(){return t2||(t2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:s}={}){let l,c=null;const f=s!=null&&s.includes("leading"),h=s==null||s.includes("trailing"),p=()=>{c!==null&&(n.apply(l,c),l=void 0,c=null)},g=()=>{h&&p(),S()};let v=null;const y=()=>{v!=null&&clearTimeout(v),v=setTimeout(()=>{v=null,g()},r)},w=()=>{v!==null&&(clearTimeout(v),v=null)},S=()=>{w(),l=void 0,c=null},N=()=>{p()},C=function(...E){if(i?.aborted)return;l=this,c=E;const k=v==null;y(),f&&k&&p()};return C.schedule=y,C.cancel=S,C.flush=N,i?.addEventListener("abort",S,{once:!0}),C}e.debounce=t})(Ex)),Ex}var n2;function ore(){return n2||(n2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=sre();function n(r,i=0,s={}){typeof s!="object"&&(s={});const{leading:l=!1,trailing:c=!0,maxWait:f}=s,h=Array(2);l&&(h[0]="leading"),c&&(h[1]="trailing");let p,g=null;const v=t.debounce(function(...S){p=r.apply(this,S),g=null},i,{edges:h}),y=function(...S){return f!=null&&(g===null&&(g=Date.now()),Date.now()-g>=f)?(p=r.apply(this,S),g=Date.now(),v.cancel(),v.schedule(),p):(v.apply(this,S),p)},w=()=>(v.flush(),p);return y.cancel=v.cancel,y.flush=w,y}e.debounce=n})(Ax)),Ax}var r2;function lre(){return r2||(r2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ore();function n(r,i=0,s={}){const{leading:l=!0,trailing:c=!0}=s;return t.debounce(r,i,{leading:l,maxWait:i,trailing:c})}e.throttle=n})(kx)),kx}var Tx,i2;function cre(){return i2||(i2=1,Tx=lre().throttle),Tx}var ure=cre();const dre=qs(ure);var $m=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];if(typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=0;console.warn(n.replace(/%s/g,()=>i[l++]))}},Hi={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},f$=(e,t,n)=>{var{width:r=Hi.width,height:i=Hi.height,aspect:s,maxHeight:l}=n,c=Jo(r)?e:Number(r),f=Jo(i)?t:Number(i);return s&&s>0&&(c?f=c/s:f&&(c=f*s),l&&f!=null&&f>l&&(f=l)),{calculatedWidth:c,calculatedHeight:f}},fre={width:0,height:0,overflow:"visible"},hre={width:0,overflowX:"visible"},pre={height:0,overflowY:"visible"},mre={},gre=e=>{var{width:t,height:n}=e,r=Jo(t),i=Jo(n);return r&&i?fre:r?hre:i?pre:mre};function vre(e){var{width:t,height:n,aspect:r}=e,i=t,s=n;return i===void 0&&s===void 0?(i=Hi.width,s=Hi.height):i===void 0?i=r&&r>0?void 0:Hi.width:s===void 0&&(s=r&&r>0?void 0:Hi.height),{width:i,height:s}}function oS(){return oS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oS.apply(null,arguments)}function a2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function s2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?a2(Object(n),!0).forEach(function(r){yre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yre(e,t,n){return(t=bre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bre(e){var t=xre(e,"string");return typeof t=="symbol"?t:t+""}function xre(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var h$=x.createContext(Hi.initialDimension);function wre(e){return Qi(e.width)&&Qi(e.height)}function p$(e){var{children:t,width:n,height:r}=e,i=x.useMemo(()=>({width:n,height:r}),[n,r]);return wre(i)?x.createElement(h$.Provider,{value:i},t):null}var aj=()=>x.useContext(h$),Sre=x.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=Hi.initialDimension,width:i,height:s,minWidth:l=Hi.minWidth,minHeight:c,maxHeight:f,children:h,debounce:p=Hi.debounce,id:g,className:v,onResize:y,style:w={}}=e,S=x.useRef(null),N=x.useRef();N.current=y,x.useImperativeHandle(t,()=>S.current);var[C,E]=x.useState({containerWidth:r.width,containerHeight:r.height}),k=x.useCallback((z,R)=>{E(q=>{var U=Math.round(z),L=Math.round(R);return q.containerWidth===U&&q.containerHeight===L?q:{containerWidth:U,containerHeight:L}})},[]);x.useEffect(()=>{if(S.current==null||typeof ResizeObserver>"u")return tu;var z=L=>{var ae,pe=L[0];if(pe!=null){var{width:ge,height:V}=pe.contentRect;k(ge,V),(ae=N.current)===null||ae===void 0||ae.call(N,ge,V)}};p>0&&(z=dre(z,p,{trailing:!0,leading:!1}));var R=new ResizeObserver(z),{width:q,height:U}=S.current.getBoundingClientRect();return k(q,U),R.observe(S.current),()=>{R.disconnect()}},[k,p]);var{containerWidth:O,containerHeight:T}=C;$m(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:P,calculatedHeight:A}=f$(O,T,{width:i,height:s,aspect:n,maxHeight:f});return $m(P!=null&&P>0||A!=null&&A>0,`The width(%s) and height(%s) of chart should be greater than 0,
237
- please check the style of container, or the props width(%s) and height(%s),
238
- or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
239
- height and width.`,P,A,i,s,l,c,n),x.createElement("div",{id:g?"".concat(g):void 0,className:ft("recharts-responsive-container",v),style:s2(s2({},w),{},{width:i,height:s,minWidth:l,minHeight:c,maxHeight:f}),ref:S},x.createElement("div",{style:gre({width:i,height:s})},x.createElement(p$,{width:P,height:A},h)))}),m$=x.forwardRef((e,t)=>{var n=aj();if(Qi(n.width)&&Qi(n.height))return e.children;var{width:r,height:i}=vre({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:s,calculatedHeight:l}=f$(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Pe(s)&&Pe(l)?x.createElement(p$,{width:s,height:l},e.children):x.createElement(Sre,oS({},e,{width:r,height:i,ref:t}))});function sj(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var yf=()=>{var e,t=sr(),n=Re(ire),r=Re(mv),i=(e=Re(pv))===null||e===void 0?void 0:e.padding;return!t||!r||!i?n:{width:r.width-i.left-i.right,height:r.height-i.top-i.bottom,x:i.left,y:i.top}},jre={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},g$=()=>{var e;return(e=Re(Un))!==null&&e!==void 0?e:jre},oj=()=>Re(La),lj=()=>Re($a),Nre=()=>Re(e=>e.layout.margin),$t=e=>e.layout.layoutType,nu=()=>Re($t),cj=()=>{var e=nu();if(e==="horizontal"||e==="vertical")return e},v$=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},Cre=()=>{var e=nu();return e!==void 0},bf=e=>{var t=Ht(),n=sr(),{width:r,height:i}=e,s=aj(),l=r,c=i;return s&&(l=s.width>0?s.width:r,c=s.height>0?s.height:i),x.useEffect(()=>{!n&&Qi(l)&&Qi(c)&&t(Ene({width:l,height:c}))},[t,n,l,c]),null},y$=Symbol.for("immer-nothing"),o2=Symbol.for("immer-draftable"),Mr=Symbol.for("immer-state");function wi(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Zd=Object.getPrototypeOf;function Lc(e){return!!e&&!!e[Mr]}function tl(e){return e?b$(e)||Array.isArray(e)||!!e[o2]||!!e.constructor?.[o2]||xf(e)||vv(e):!1}var Ore=Object.prototype.constructor.toString(),l2=new WeakMap;function b$(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if(typeof n!="function")return!1;let r=l2.get(n);return r===void 0&&(r=Function.toString.call(n),l2.set(n,r)),r===Ore}function Um(e,t,n=!0){gv(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function gv(e){const t=e[Mr];return t?t.type_:Array.isArray(e)?1:xf(e)?2:vv(e)?3:0}function lS(e,t){return gv(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function x$(e,t,n){const r=gv(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function _re(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function xf(e){return e instanceof Map}function vv(e){return e instanceof Set}function Oo(e){return e.copy_||e.base_}function cS(e,t){if(xf(e))return new Map(e);if(vv(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=b$(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Mr];let i=Reflect.ownKeys(r);for(let s=0;s<i.length;s++){const l=i[s],c=r[l];c.writable===!1&&(c.writable=!0,c.configurable=!0),(c.get||c.set)&&(r[l]={configurable:!0,writable:!0,enumerable:c.enumerable,value:e[l]})}return Object.create(Zd(e),r)}else{const r=Zd(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function uj(e,t=!1){return yv(e)||Lc(e)||!tl(e)||(gv(e)>1&&Object.defineProperties(e,{set:Op,add:Op,clear:Op,delete:Op}),Object.freeze(e),t&&Object.values(e).forEach(n=>uj(n,!0))),e}function kre(){wi(2)}var Op={value:kre};function yv(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Are={};function nl(e){const t=Are[e];return t||wi(0,e),t}var Yd;function w$(){return Yd}function Ere(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function c2(e,t){t&&(nl("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function uS(e){dS(e),e.drafts_.forEach(Tre),e.drafts_=null}function dS(e){e===Yd&&(Yd=e.parent_)}function u2(e){return Yd=Ere(Yd,e)}function Tre(e){const t=e[Mr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function d2(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Mr].modified_&&(uS(t),wi(4)),tl(e)&&(e=Bm(t,e),t.parent_||qm(t,e)),t.patches_&&nl("Patches").generateReplacementPatches_(n[Mr].base_,e,t.patches_,t.inversePatches_)):e=Bm(t,n,[]),uS(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==y$?e:void 0}function Bm(e,t,n){if(yv(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[Mr];if(!i)return Um(t,(s,l)=>f2(e,i,t,s,l,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return qm(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const s=i.copy_;let l=s,c=!1;i.type_===3&&(l=new Set(s),s.clear(),c=!0),Um(l,(f,h)=>f2(e,i,s,f,h,n,c),r),qm(e,s,!1),n&&e.patches_&&nl("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function f2(e,t,n,r,i,s,l){if(i==null||typeof i!="object"&&!l)return;const c=yv(i);if(!(c&&!l)){if(Lc(i)){const f=s&&t&&t.type_!==3&&!lS(t.assigned_,r)?s.concat(r):void 0,h=Bm(e,i,f);if(x$(n,r,h),Lc(h))e.canAutoFreeze_=!1;else return}else l&&n.add(i);if(tl(i)&&!c){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&c)return;Bm(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(xf(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&qm(e,i)}}}function qm(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&uj(t,n)}function Pre(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:w$(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,s=dj;n&&(i=[r],s=Wd);const{revoke:l,proxy:c}=Proxy.revocable(i,s);return r.draft_=c,r.revoke_=l,c}var dj={get(e,t){if(t===Mr)return e;const n=Oo(e);if(!lS(n,t))return zre(e,n,t);const r=n[t];return e.finalized_||!tl(r)?r:r===Px(e.base_,t)?(zx(e),e.copy_[t]=hS(r,e)):r},has(e,t){return t in Oo(e)},ownKeys(e){return Reflect.ownKeys(Oo(e))},set(e,t,n){const r=S$(Oo(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Px(Oo(e),t),s=i?.[Mr];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(_re(n,i)&&(n!==void 0||lS(e.base_,t)))return!0;zx(e),fS(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Px(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,zx(e),fS(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Oo(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){wi(11)},getPrototypeOf(e){return Zd(e.base_)},setPrototypeOf(){wi(12)}},Wd={};Um(dj,(e,t)=>{Wd[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Wd.deleteProperty=function(e,t){return Wd.set.call(this,e,t,void 0)};Wd.set=function(e,t,n){return dj.set.call(this,e[0],t,n,e[0])};function Px(e,t){const n=e[Mr];return(n?Oo(n):e)[t]}function zre(e,t,n){const r=S$(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function S$(e,t){if(!(t in e))return;let n=Zd(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Zd(n)}}function fS(e){e.modified_||(e.modified_=!0,e.parent_&&fS(e.parent_))}function zx(e){e.copy_||(e.copy_=cS(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Mre=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const s=n;n=t;const l=this;return function(f=s,...h){return l.produce(f,p=>n.call(this,p,...h))}}typeof n!="function"&&wi(6),r!==void 0&&typeof r!="function"&&wi(7);let i;if(tl(t)){const s=u2(this),l=hS(t,void 0);let c=!0;try{i=n(l),c=!1}finally{c?uS(s):dS(s)}return c2(s,r),d2(i,s)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===y$&&(i=void 0),this.autoFreeze_&&uj(i,!0),r){const s=[],l=[];nl("Patches").generateReplacementPatches_(t,i,s,l),r(s,l)}return i}else wi(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(l,...c)=>this.produceWithPatches(l,f=>t(f,...c));let r,i;return[this.produce(t,n,(l,c)=>{r=l,i=c}),r,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){tl(e)||wi(8),Lc(e)&&(e=Rre(e));const t=u2(this),n=hS(e,void 0);return n[Mr].isManual_=!0,dS(t),n}finishDraft(e,t){const n=e&&e[Mr];(!n||!n.isManual_)&&wi(9);const{scope_:r}=n;return c2(r,t),d2(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=nl("Patches").applyPatches_;return Lc(e)?r(e,t):this.produce(e,i=>r(i,t))}};function hS(e,t){const n=xf(e)?nl("MapSet").proxyMap_(e,t):vv(e)?nl("MapSet").proxySet_(e,t):Pre(e,t);return(t?t.scope_:w$()).drafts_.push(n),n}function Rre(e){return Lc(e)||wi(10,e),j$(e)}function j$(e){if(!tl(e)||yv(e))return e;const t=e[Mr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=cS(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=cS(e,!0);return Um(n,(i,s)=>{x$(n,i,j$(s))},r),t&&(t.finalized_=!1),n}var Dre=new Mre;Dre.produce;var Ire={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},N$=Yn({name:"legend",initialState:Ire,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(t.payload)},prepare:At()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ti(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:At()},removeLegendPayload:{reducer(e,t){var n=ti(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:At()}}}),{setLegendSize:h2,setLegendSettings:Lre,addLegendPayload:$re,replaceLegendPayload:Ure,removeLegendPayload:Bre}=N$.actions,qre=N$.reducer,Mx={exports:{}},Rx={};var p2;function Fre(){if(p2)return Rx;p2=1;var e=Gc();function t(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,s=e.useEffect,l=e.useMemo,c=e.useDebugValue;return Rx.useSyncExternalStoreWithSelector=function(f,h,p,g,v){var y=i(null);if(y.current===null){var w={hasValue:!1,value:null};y.current=w}else w=y.current;y=l(function(){function N(T){if(!C){if(C=!0,E=T,T=g(T),v!==void 0&&w.hasValue){var P=w.value;if(v(P,T))return k=P}return k=T}if(P=k,n(E,T))return P;var A=g(T);return v!==void 0&&v(P,A)?(E=T,P):(E=T,k=A)}var C=!1,E,k,O=p===void 0?null:p;return[function(){return N(h())},O===null?void 0:function(){return N(O())}]},[h,p,g,v]);var S=r(f,y[0],y[1]);return s(function(){w.hasValue=!0,w.value=S},[S]),c(S),S},Rx}var m2;function Kre(){return m2||(m2=1,Mx.exports=Fre()),Mx.exports}Kre();function Hre(e){e()}function Gre(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Hre(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var g2={notify(){},get:()=>[]};function Vre(e,t){let n,r=g2,i=0,s=!1;function l(S){p();const N=r.subscribe(S);let C=!1;return()=>{C||(C=!0,N(),g())}}function c(){r.notify()}function f(){w.onStateChange&&w.onStateChange()}function h(){return s}function p(){i++,n||(n=e.subscribe(f),r=Gre())}function g(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=g2)}function v(){s||(s=!0,p())}function y(){s&&(s=!1,g())}const w={addNestedSub:l,notifyNestedSubs:c,handleChangeWrapper:f,isSubscribed:h,trySubscribe:v,tryUnsubscribe:y,getListeners:()=>r};return w}var Zre=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Yre=Zre(),Wre=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Qre=Wre(),Xre=()=>Yre||Qre?x.useLayoutEffect:x.useEffect,Jre=Xre();function v2(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function eie(e,t){if(v2(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!v2(e[n[i]],t[n[i]]))return!1;return!0}var tie=Symbol.for("react-redux-context"),nie=typeof globalThis<"u"?globalThis:{};function rie(){if(!x.createContext)return{};const e=nie[tie]??=new Map;let t=e.get(x.createContext);return t||(t=x.createContext(null),e.set(x.createContext,t)),t}var iie=rie();function aie(e){const{children:t,context:n,serverState:r,store:i}=e,s=x.useMemo(()=>{const f=Vre(i);return{store:i,subscription:f,getServerState:r?()=>r:void 0}},[i,r]),l=x.useMemo(()=>i.getState(),[i]);Jre(()=>{const{subscription:f}=s;return f.onStateChange=f.notifyNestedSubs,f.trySubscribe(),l!==i.getState()&&f.notifyNestedSubs(),()=>{f.tryUnsubscribe(),f.onStateChange=void 0}},[s,l]);const c=n||iie;return x.createElement(c.Provider,{value:s},t)}var sie=aie,oie=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function lie(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function wf(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(oie.has(r)){if(e[r]==null&&t[r]==null)continue;if(!eie(e[r],t[r]))return!1}else if(!lie(e[r],t[r]))return!1;return!0}var cie=["contextPayload"];function pS(){return pS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pS.apply(null,arguments)}function y2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $c(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?y2(Object(n),!0).forEach(function(r){uie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uie(e,t,n){return(t=die(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function die(e){var t=fie(e,"string");return typeof t=="symbol"?t:t+""}function fie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hie(e,t){if(e==null)return{};var n,r,i=pie(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function pie(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function mie(e){return e.value}function gie(e){var{contextPayload:t}=e,n=hie(e,cie),r=CL(t,e.payloadUniqBy,mie),i=$c($c({},n),{},{payload:r});return x.isValidElement(e.content)?x.cloneElement(e.content,i):typeof e.content=="function"?x.createElement(e.content,i):x.createElement(qee,i)}function vie(e,t,n,r,i,s){var{layout:l,align:c,verticalAlign:f}=t,h,p;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(c==="center"&&l==="vertical"?h={left:((r||0)-s.width)/2}:h=c==="right"?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(f==="middle"?p={top:((i||0)-s.height)/2}:p=f==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),$c($c({},h),p)}function yie(e){var t=Ht();return x.useEffect(()=>{t(Lre(e))},[t,e]),null}function bie(e){var t=Ht();return x.useEffect(()=>(t(h2(e)),()=>{t(h2({width:0,height:0}))}),[t,e]),null}function xie(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var wie={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function Sie(e){var t=ar(e,wie),n=Pte(),r=MJ(),i=Nre(),{width:s,height:l,wrapperStyle:c,portal:f}=t,[h,p]=EL([n]),g=oj(),v=lj();if(g==null||v==null)return null;var y=g-(i?.left||0)-(i?.right||0),w=xie(t.layout,l,s,y),S=f?c:$c($c({position:"absolute",width:w?.width||s||"auto",height:w?.height||l||"auto"},vie(c,t,i,g,v,h)),c),N=f??r;if(N==null||n==null)return null;var C=x.createElement("div",{className:"recharts-legend-wrapper",style:S,ref:p},x.createElement(yie,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!f&&x.createElement(bie,{width:h.width,height:h.height}),x.createElement(gie,pS({},t,w,{margin:i,chartWidth:g,chartHeight:v,contextPayload:n})));return ol.createPortal(C,N)}var C$=x.memo(Sie,wf);C$.displayName="Legend";function mS(){return mS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mS.apply(null,arguments)}function b2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ud(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?b2(Object(n),!0).forEach(function(r){jie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jie(e,t,n){return(t=Nie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nie(e){var t=Cie(e,"string");return typeof t=="symbol"?t:t+""}function Cie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Oie(e){return Array.isArray(e)&&ai(e[0])&&ai(e[1])?e.join(" ~ "):e}var sc={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1};function _ie(e,t){return t==null?e:nv(e,t)}var kie=e=>{var{separator:t=sc.separator,contentStyle:n,itemStyle:r,labelStyle:i=sc.labelStyle,payload:s,formatter:l,itemSorter:c,wrapperClassName:f,labelClassName:h,label:p,labelFormatter:g,accessibilityLayer:v=sc.accessibilityLayer}=e,y=()=>{if(s&&s.length){var T={padding:0,margin:0},P=_ie(s,c),A=P.map((z,R)=>{if(!z||z.type==="none")return null;var q=z.formatter||l||Oie,{value:U,name:L}=z,ae=U,pe=L;if(q){var ge=q(U,L,z,R,s);if(Array.isArray(ge))[ae,pe]=ge;else if(ge!=null)ae=ge;else return null}var V=ud(ud({},sc.itemStyle),{},{color:z.color||sc.itemStyle.color},r);return x.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(R),style:V},ai(pe)?x.createElement("span",{className:"recharts-tooltip-item-name"},pe):null,ai(pe)?x.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,x.createElement("span",{className:"recharts-tooltip-item-value"},ae),x.createElement("span",{className:"recharts-tooltip-item-unit"},z.unit||""))});return x.createElement("ul",{className:"recharts-tooltip-item-list",style:T},A)}return null},w=ud(ud({},sc.contentStyle),n),S=ud({margin:0},i),N=!Ln(p),C=N?p:"",E=ft("recharts-default-tooltip",f),k=ft("recharts-tooltip-label",h);N&&g&&s!==void 0&&s!==null&&(C=g(p,s));var O=v?{role:"status","aria-live":"assertive"}:{};return x.createElement("div",mS({className:E,style:w},O),x.createElement("p",{className:k,style:S},x.isValidElement(C)?C:"".concat(C)),y())},dd="recharts-tooltip-wrapper",Aie={visibility:"hidden"};function Eie(e){var{coordinate:t,translateX:n,translateY:r}=e;return ft(dd,{["".concat(dd,"-right")]:Pe(n)&&t&&Pe(t.x)&&n>=t.x,["".concat(dd,"-left")]:Pe(n)&&t&&Pe(t.x)&&n<t.x,["".concat(dd,"-bottom")]:Pe(r)&&t&&Pe(t.y)&&r>=t.y,["".concat(dd,"-top")]:Pe(r)&&t&&Pe(t.y)&&r<t.y})}function x2(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:s,reverseDirection:l,tooltipDimension:c,viewBox:f,viewBoxDimension:h}=e;if(s&&Pe(s[r]))return s[r];var p=n[r]-c-(i>0?i:0),g=n[r]+i;if(t[r])return l[r]?p:g;var v=f[r];if(v==null)return 0;if(l[r]){var y=p,w=v;return y<w?Math.max(g,v):Math.max(p,v)}if(h==null)return 0;var S=g+c,N=v+h;return S>N?Math.max(p,v):Math.max(g,v)}function Tie(e){var{translateX:t,translateY:n,useTranslate3d:r}=e;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function Pie(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:s,reverseDirection:l,tooltipBox:c,useTranslate3d:f,viewBox:h}=e,p,g,v;return c.height>0&&c.width>0&&n?(g=x2({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:s,reverseDirection:l,tooltipDimension:c.width,viewBox:h,viewBoxDimension:h.width}),v=x2({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:s,reverseDirection:l,tooltipDimension:c.height,viewBox:h,viewBoxDimension:h.height}),p=Tie({translateX:g,translateY:v,useTranslate3d:f})):p=Aie,{cssProperties:p,cssClasses:Eie({translateX:g,translateY:v,coordinate:n})}}var zie=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Sf={isSsr:zie()};function O$(){var[e,t]=x.useState(()=>Sf.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return x.useEffect(()=>{if(window.matchMedia){var n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=()=>{t(n.matches)};return n.addEventListener("change",r),()=>{n.removeEventListener("change",r)}}},[]),e}function w2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function oc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?w2(Object(n),!0).forEach(function(r){Mie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mie(e,t,n){return(t=Rie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rie(e){var t=Die(e,"string");return typeof t=="symbol"?t:t+""}function Die(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Iie(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function Lie(e){var t,n,r,i,s,l,c=O$(),[f,h]=x.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));x.useEffect(()=>{var w=S=>{if(S.key==="Escape"){var N,C,E,k;h({dismissed:!0,dismissedAtCoordinate:{x:(N=(C=e.coordinate)===null||C===void 0?void 0:C.x)!==null&&N!==void 0?N:0,y:(E=(k=e.coordinate)===null||k===void 0?void 0:k.y)!==null&&E!==void 0?E:0}})}};return document.addEventListener("keydown",w),()=>{document.removeEventListener("keydown",w)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),f.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==f.dismissedAtCoordinate.x||((s=(l=e.coordinate)===null||l===void 0?void 0:l.y)!==null&&s!==void 0?s:0)!==f.dismissedAtCoordinate.y)&&h(oc(oc({},f),{},{dismissed:!1}));var{cssClasses:p,cssProperties:g}=Pie({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),v=e.hasPortalFromProps?{}:oc(oc({transition:Iie({prefersReducedMotion:c,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},g),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),y=oc(oc({},v),{},{visibility:!f.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return x.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:p,style:y,ref:e.innerRef},e.children)}var $ie=x.memo(Lie),_$=()=>{var e;return(e=Re(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function gS(){return gS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gS.apply(null,arguments)}function S2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function j2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?S2(Object(n),!0).forEach(function(r){Uie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Uie(e,t,n){return(t=Bie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bie(e){var t=qie(e,"string");return typeof t=="symbol"?t:t+""}function qie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var N2={curveBasisClosed:JJ,curveBasisOpen:eee,curveBasis:XJ,curveBumpX:LJ,curveBumpY:$J,curveLinearClosed:tee,curveLinear:Jg,curveMonotoneX:nee,curveMonotoneY:ree,curveNatural:iee,curveStep:aee,curveStepAfter:oee,curveStepBefore:see},Fm=e=>He(e.x)&&He(e.y),C2=e=>e.base!=null&&Fm(e.base)&&Fm(e),fd=e=>e.x,hd=e=>e.y,Fie=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(pf(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=N2["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return N2[n]||Jg},O2={connectNulls:!1,type:"linear"},Kie=e=>{var{type:t=O2.type,points:n=[],baseLine:r,layout:i,connectNulls:s=O2.connectNulls}=e,l=Fie(t,i),c=s?n.filter(Fm):n;if(Array.isArray(r)){var f,h=n.map((w,S)=>j2(j2({},w),{},{base:r[S]}));i==="vertical"?f=bp().y(hd).x1(fd).x0(w=>w.base.x):f=bp().x(fd).y1(hd).y0(w=>w.base.y);var p=f.defined(C2).curve(l),g=s?h.filter(C2):h;return p(g)}var v;i==="vertical"&&Pe(r)?v=bp().y(hd).x1(fd).x0(r):Pe(r)?v=bp().x(fd).y1(hd).y0(r):v=QI().x(fd).y(hd);var y=v.defined(Fm).curve(l);return y(c)},Qp=e=>{var{className:t,points:n,path:r,pathRef:i}=e,s=nu();if((!n||!n.length)&&!r)return null;var l={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||s,connectNulls:e.connectNulls},c=n&&n.length?Kie(l):r;return x.createElement("path",gS({},Ni(e),W1(e),{className:ft("recharts-curve",t),d:c===null?void 0:c,ref:i}))},Hie=["x","y","top","left","width","height","className"];function vS(){return vS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vS.apply(null,arguments)}function _2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Gie(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_2(Object(n),!0).forEach(function(r){Vie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vie(e,t,n){return(t=Zie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zie(e){var t=Yie(e,"string");return typeof t=="symbol"?t:t+""}function Yie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wie(e,t){if(e==null)return{};var n,r,i=Qie(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Qie(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Xie=(e,t,n,r,i,s)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(s,",").concat(t,"h").concat(n),Jie=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:s=0,height:l=0,className:c}=e,f=Wie(e,Hie),h=Gie({x:t,y:n,top:r,left:i,width:s,height:l},f);return!Pe(t)||!Pe(n)||!Pe(s)||!Pe(l)||!Pe(r)||!Pe(i)?null:x.createElement("path",vS({},xr(h),{className:ft("recharts-cross",c),d:Xie(t,n,s,l,r,i)}))};function eae(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function k2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function A2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?k2(Object(n),!0).forEach(function(r){tae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tae(e,t,n){return(t=nae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nae(e){var t=rae(e,"string");return typeof t=="symbol"?t:t+""}function rae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var iae=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),aae=(e,t,n)=>e.map(r=>"".concat(iae(r)," ").concat(t,"ms ").concat(n)).join(","),sae=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),Qd=(e,t)=>Object.keys(t).reduce((n,r)=>A2(A2({},n),{},{[r]:e(r,t[r])}),{});function E2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?E2(Object(n),!0).forEach(function(r){oae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oae(e,t,n){return(t=lae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lae(e){var t=cae(e,"string");return typeof t=="symbol"?t:t+""}function cae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Km=(e,t,n)=>e+(t-e)*n,yS=e=>{var{from:t,to:n}=e;return t!==n},k$=(e,t,n)=>{var r=Qd((i,s)=>{if(yS(s)){var[l,c]=e(s.from,s.to,s.velocity);return xn(xn({},s),{},{from:l,velocity:c})}return s},t);return n<1?Qd((i,s)=>yS(s)&&r[i]!=null?xn(xn({},s),{},{velocity:Km(s.velocity,r[i].velocity,n),from:Km(s.from,r[i].from,n)}):s,t):k$(e,r,n-1)};function uae(e,t,n,r,i,s){var l,c=r.reduce((v,y)=>xn(xn({},v),{},{[y]:{from:e[y],velocity:0,to:t[y]}}),{}),f=()=>Qd((v,y)=>y.from,c),h=()=>!Object.values(c).filter(yS).length,p=null,g=v=>{l||(l=v);var y=v-l,w=y/n.dt;c=k$(n,c,w),i(xn(xn(xn({},e),t),f())),l=v,h()||(p=s.setTimeout(g))};return()=>(p=s.setTimeout(g),()=>{var v;(v=p)===null||v===void 0||v()})}function dae(e,t,n,r,i,s,l){var c=null,f=i.reduce((g,v)=>{var y=e[v],w=t[v];return y==null||w==null?g:xn(xn({},g),{},{[v]:[y,w]})},{}),h,p=g=>{h||(h=g);var v=(g-h)/r,y=Qd((S,N)=>Km(...N,n(v)),f);if(s(xn(xn(xn({},e),t),y)),v<1)c=l.setTimeout(p);else{var w=Qd((S,N)=>Km(...N,n(1)),f);s(xn(xn(xn({},e),t),w))}};return()=>(c=l.setTimeout(p),()=>{var g;(g=c)===null||g===void 0||g()})}const fae=(e,t,n,r,i,s)=>{var l=sae(e,t);return n==null?()=>(i(xn(xn({},e),t)),()=>{}):n.isStepper===!0?uae(e,t,n,l,i,s):dae(e,t,n,r,l,i,s)};var Hm=1e-4,A$=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],E$=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),T2=(e,t)=>n=>{var r=A$(e,t);return E$(r,n)},hae=(e,t)=>n=>{var r=A$(e,t),i=[...r.map((s,l)=>s*l).slice(1),0];return E$(i,n)},pae=e=>{var t,n=e.split("(");if(n.length!==2||n[0]!=="cubic-bezier")return null;var r=(t=n[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(r==null||r.length!==4)return null;var i=r.map(s=>parseFloat(s));return[i[0],i[1],i[2],i[3]]},mae=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(n.length===1)switch(n[0]){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-out":return[.42,0,.58,1];case"ease-in-out":return[0,0,.58,1];default:{var i=pae(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},gae=(e,t,n,r)=>{var i=T2(e,n),s=T2(t,r),l=hae(e,n),c=h=>h>1?1:h<0?0:h,f=h=>{for(var p=h>1?1:h,g=p,v=0;v<8;++v){var y=i(g)-p,w=l(g);if(Math.abs(y-p)<Hm||w<Hm)return s(g);g=c(g-y/w)}return s(g)};return f.isStepper=!1,f},P2=function(){return gae(...mae(...arguments))},vae=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,s=(l,c,f)=>{var h=-(l-c)*n,p=f*r,g=f+(h-p)*i/1e3,v=f*i/1e3+l;return Math.abs(v-c)<Hm&&Math.abs(g)<Hm?[c,0]:[v,g]};return s.isStepper=!0,s.dt=i,s},yae=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return P2(e);case"spring":return vae();default:if(e.split("(")[0]==="cubic-bezier")return P2(e)}return typeof e=="function"?e:null};function bae(e){var t,n=()=>null,r=!1,i=null,s=l=>{if(!r){if(Array.isArray(l)){if(!l.length)return;var c=l,[f,...h]=c;if(typeof f=="number"){i=e.setTimeout(s.bind(null,h),f);return}s(f),i=e.setTimeout(s.bind(null,h));return}typeof l=="string"&&(t=l,n(t)),typeof l=="object"&&(t=l,n(t)),typeof l=="function"&&l()}};return{stop:()=>{r=!0},start:l=>{r=!1,i&&(i(),i=null),s(l)},subscribe:l=>(n=l,()=>{n=()=>null}),getTimeoutController:()=>e}}class xae{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,s=l=>{l-r>=n?t(l):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(s))};return i=requestAnimationFrame(s),()=>{i!=null&&cancelAnimationFrame(i)}}}function wae(){return bae(new xae)}var Sae=x.createContext(wae);function jae(e,t){var n=x.useContext(Sae);return x.useMemo(()=>t??n(e),[e,t,n])}var Nae={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},z2={t:0},Dx={t:1};function T$(e){var t=ar(e,Nae),{isActive:n,canBegin:r,duration:i,easing:s,begin:l,onAnimationEnd:c,onAnimationStart:f,children:h}=t,p=O$(),g=n==="auto"?!Sf.isSsr&&!p:n,v=jae(t.animationId,t.animationManager),[y,w]=x.useState(g?z2:Dx),S=x.useRef(null);return x.useEffect(()=>{g||w(Dx)},[g]),x.useEffect(()=>{if(!g||!r)return tu;var N=fae(z2,Dx,yae(s),i,w,v.getTimeoutController()),C=()=>{S.current=N()};return v.start([f,l,C,i,c]),()=>{v.stop(),S.current&&S.current(),c()}},[g,r,i,s,l,f,c,v]),h(y.t)}function P$(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=x.useRef(Kd(t)),r=x.useRef(e);return r.current!==e&&(n.current=Kd(t),r.current=e),n.current}var Cae=["radius"],Oae=["radius"],M2,R2,D2,I2,L2,$2,U2,B2,q2,F2;function K2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function H2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?K2(Object(n),!0).forEach(function(r){_ae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _ae(e,t,n){return(t=kae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kae(e){var t=Aae(e,"string");return typeof t=="symbol"?t:t+""}function Aae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gm(){return Gm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gm.apply(null,arguments)}function G2(e,t){if(e==null)return{};var n,r,i=Eae(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Eae(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function $i(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var V2=(e,t,n,r,i)=>{var s=Es(n),l=Es(r),c=Math.min(Math.abs(s)/2,Math.abs(l)/2),f=l>=0?1:-1,h=s>=0?1:-1,p=l>=0&&s>=0||l<0&&s<0?1:0,g;if(c>0&&Array.isArray(i)){for(var v=[0,0,0,0],y=0,w=4;y<w;y++){var S,N=(S=i[y])!==null&&S!==void 0?S:0;v[y]=N>c?c:N}g=Rn(M2||(M2=$i(["M",",",""])),e,t+f*v[0]),v[0]>0&&(g+=Rn(R2||(R2=$i(["A ",",",",0,0,",",",",",""])),v[0],v[0],p,e+h*v[0],t)),g+=Rn(D2||(D2=$i(["L ",",",""])),e+n-h*v[1],t),v[1]>0&&(g+=Rn(I2||(I2=$i(["A ",",",",0,0,",`,
240
- `,",",""])),v[1],v[1],p,e+n,t+f*v[1])),g+=Rn(L2||(L2=$i(["L ",",",""])),e+n,t+r-f*v[2]),v[2]>0&&(g+=Rn($2||($2=$i(["A ",",",",0,0,",`,
241
- `,",",""])),v[2],v[2],p,e+n-h*v[2],t+r)),g+=Rn(U2||(U2=$i(["L ",",",""])),e+h*v[3],t+r),v[3]>0&&(g+=Rn(B2||(B2=$i(["A ",",",",0,0,",`,
242
- `,",",""])),v[3],v[3],p,e,t+r-f*v[3])),g+="Z"}else if(c>0&&i===+i&&i>0){var C=Math.min(c,i);g=Rn(q2||(q2=$i(["M ",",",`
243
- A `,",",",0,0,",",",",",`
244
- L `,",",`
245
- A `,",",",0,0,",",",",",`
246
- L `,",",`
247
- A `,",",",0,0,",",",",",`
248
- L `,",",`
249
- A `,",",",0,0,",",",","," Z"])),e,t+f*C,C,C,p,e+h*C,t,e+n-h*C,t,C,C,p,e+n,t+f*C,e+n,t+r-f*C,C,C,p,e+n-h*C,t+r,e+h*C,t+r,C,C,p,e,t+r-f*C)}else g=Rn(F2||(F2=$i(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return g},Z2={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Tae=e=>{var t=ar(e,Z2),n=x.useRef(null),[r,i]=x.useState(-1);x.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var re=n.current.getTotalLength();re&&i(re)}catch{}},[]);var{x:s,y:l,width:c,height:f,radius:h,className:p}=t,{animationEasing:g,animationDuration:v,animationBegin:y,isAnimationActive:w,isUpdateAnimationActive:S}=t,N=x.useRef(c),C=x.useRef(f),E=x.useRef(s),k=x.useRef(l),O=x.useMemo(()=>({x:s,y:l,width:c,height:f,radius:h}),[s,l,c,f,h]),T=P$(O,"rectangle-");if(s!==+s||l!==+l||c!==+c||f!==+f||c===0||f===0)return null;var P=ft("recharts-rectangle",p);if(!S){var A=xr(t),{radius:z}=A,R=G2(A,Cae);return x.createElement("path",Gm({},R,{x:Es(s),y:Es(l),width:Es(c),height:Es(f),radius:typeof h=="number"?h:void 0,className:P,d:V2(s,l,c,f,h)}))}var q=N.current,U=C.current,L=E.current,ae=k.current,pe="0px ".concat(r===-1?1:r,"px"),ge="".concat(r,"px ").concat(r,"px"),V=aae(["strokeDasharray"],v,typeof g=="string"?g:Z2.animationEasing);return x.createElement(T$,{animationId:T,key:T,canBegin:r>0,duration:v,easing:g,isActive:S,begin:y},re=>{var ve=Fi(q,c,re),we=Fi(U,f,re),B=Fi(L,s,re),D=Fi(ae,l,re);n.current&&(N.current=ve,C.current=we,E.current=B,k.current=D);var G;w?re>0?G={transition:V,strokeDasharray:ge}:G={strokeDasharray:pe}:G={strokeDasharray:ge};var oe=xr(t),{radius:W}=oe,X=G2(oe,Oae);return x.createElement("path",Gm({},X,{radius:typeof h=="number"?h:void 0,className:P,d:V2(B,D,ve,we,h),ref:n,style:H2(H2({},G),t.style)}))})};function Y2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function W2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Y2(Object(n),!0).forEach(function(r){Pae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pae(e,t,n){return(t=zae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zae(e){var t=Mae(e,"string");return typeof t=="symbol"?t:t+""}function Mae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Vm=Math.PI/180,Rae=e=>e*180/Math.PI,In=(e,t,n,r)=>({x:e+Math.cos(-Vm*r)*n,y:t+Math.sin(-Vm*r)*n}),Dae=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},Iae=(e,t)=>{var{x:n,y:r}=e,{x:i,y:s}=t;return Math.sqrt((n-i)**2+(r-s)**2)},Lae=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:s}=t,l=Iae({x:n,y:r},{x:i,y:s});if(l<=0)return{radius:l,angle:0};var c=(n-i)/l,f=Math.acos(c);return r>s&&(f=2*Math.PI-f),{radius:l,angle:Rae(f),angleInRadian:f}},$ae=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),s=Math.min(r,i);return{startAngle:t-s*360,endAngle:n-s*360}},Uae=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),s=Math.floor(r/360),l=Math.min(i,s);return e+l*360},Bae=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:s}=Lae({x:n,y:r},t),{innerRadius:l,outerRadius:c}=t;if(i<l||i>c||i===0)return null;var{startAngle:f,endAngle:h}=$ae(t),p=s,g;if(f<=h){for(;p>h;)p-=360;for(;p<f;)p+=360;g=p>=f&&p<=h}else{for(;p>f;)p-=360;for(;p<h;)p+=360;g=p>=h&&p<=f}return g?W2(W2({},t),{},{radius:i,angle:Uae(p,t)}):null};function z$(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:s}=e,l=In(t,n,r,i),c=In(t,n,r,s);return{points:[l,c],cx:t,cy:n,radius:r,startAngle:i,endAngle:s}}var Q2,X2,J2,eP,tP,nP,rP;function bS(){return bS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bS.apply(null,arguments)}function Mo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var qae=(e,t)=>{var n=ei(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},_p=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:s,isExternal:l,cornerRadius:c,cornerIsExternal:f}=e,h=c*(l?1:-1)+r,p=Math.asin(c/h)/Vm,g=f?i:i+s*p,v=In(t,n,h,g),y=In(t,n,r,g),w=f?i-s*p:i,S=In(t,n,h*Math.cos(p*Vm),w);return{center:v,circleTangency:y,lineTangency:S,theta:p}},M$=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:s,endAngle:l}=e,c=qae(s,l),f=s+c,h=In(t,n,i,s),p=In(t,n,i,f),g=Rn(Q2||(Q2=Mo(["M ",",",`
250
- A `,",",`,0,
251
- `,",",`,
252
- `,",",`
253
- `])),h.x,h.y,i,i,+(Math.abs(c)>180),+(s>f),p.x,p.y);if(r>0){var v=In(t,n,r,s),y=In(t,n,r,f);g+=Rn(X2||(X2=Mo(["L ",",",`
254
- A `,",",`,0,
255
- `,",",`,
256
- `,","," Z"])),y.x,y.y,r,r,+(Math.abs(c)>180),+(s<=f),v.x,v.y)}else g+=Rn(J2||(J2=Mo(["L ",","," Z"])),t,n);return g},Fae=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:s,forceCornerRadius:l,cornerIsExternal:c,startAngle:f,endAngle:h}=e,p=ei(h-f),{circleTangency:g,lineTangency:v,theta:y}=_p({cx:t,cy:n,radius:i,angle:f,sign:p,cornerRadius:s,cornerIsExternal:c}),{circleTangency:w,lineTangency:S,theta:N}=_p({cx:t,cy:n,radius:i,angle:h,sign:-p,cornerRadius:s,cornerIsExternal:c}),C=c?Math.abs(f-h):Math.abs(f-h)-y-N;if(C<0)return l?Rn(eP||(eP=Mo(["M ",",",`
257
- a`,",",",0,0,1,",`,0
258
- a`,",",",0,0,1,",`,0
259
- `])),v.x,v.y,s,s,s*2,s,s,-s*2):M$({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:f,endAngle:h});var E=Rn(tP||(tP=Mo(["M ",",",`
260
- A`,",",",0,0,",",",",",`
261
- A`,",",",0,",",",",",",",`
262
- A`,",",",0,0,",",",",",`
263
- `])),v.x,v.y,s,s,+(p<0),g.x,g.y,i,i,+(C>180),+(p<0),w.x,w.y,s,s,+(p<0),S.x,S.y);if(r>0){var{circleTangency:k,lineTangency:O,theta:T}=_p({cx:t,cy:n,radius:r,angle:f,sign:p,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),{circleTangency:P,lineTangency:A,theta:z}=_p({cx:t,cy:n,radius:r,angle:h,sign:-p,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),R=c?Math.abs(f-h):Math.abs(f-h)-T-z;if(R<0&&s===0)return"".concat(E,"L").concat(t,",").concat(n,"Z");E+=Rn(nP||(nP=Mo(["L",",",`
264
- A`,",",",0,0,",",",",",`
265
- A`,",",",0,",",",",",",",`
266
- A`,",",",0,0,",",",",","Z"])),A.x,A.y,s,s,+(p<0),P.x,P.y,r,r,+(R>180),+(p>0),k.x,k.y,s,s,+(p<0),O.x,O.y)}else E+=Rn(rP||(rP=Mo(["L",",","Z"])),t,n);return E},Kae={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Hae=e=>{var t=ar(e,Kae),{cx:n,cy:r,innerRadius:i,outerRadius:s,cornerRadius:l,forceCornerRadius:c,cornerIsExternal:f,startAngle:h,endAngle:p,className:g}=t;if(s<i||h===p)return null;var v=ft("recharts-sector",g),y=s-i,w=Bs(l,y,0,!0),S;return w>0&&Math.abs(h-p)<360?S=Fae({cx:n,cy:r,innerRadius:i,outerRadius:s,cornerRadius:Math.min(w,y/2),forceCornerRadius:c,cornerIsExternal:f,startAngle:h,endAngle:p}):S=M$({cx:n,cy:r,innerRadius:i,outerRadius:s,startAngle:h,endAngle:p}),x.createElement("path",bS({},xr(t),{className:v,d:S}))};function Gae(e,t,n){if(e==="horizontal")return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e==="vertical")return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(hL(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:s,outerRadius:l,angle:c}=t,f=In(r,i,s,c),h=In(r,i,l,c);return[{x:f.x,y:f.y},{x:h.x,y:h.y}]}return z$(t)}}var Ix={},Lx={},$x={},iP;function Vae(){return iP||(iP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_L();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})($x)),$x}var aP;function Zae(){return aP||(aP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Vae();function n(r){return r?(r=t.toNumber(r),r===1/0||r===-1/0?(r<0?-1:1)*Number.MAX_VALUE:r===r?r:0):r===0?r:0}e.toFinite=n})(Lx)),Lx}var sP;function Yae(){return sP||(sP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kL(),n=Zae();function r(i,s,l){l&&typeof l!="number"&&t.isIterateeCall(i,s,l)&&(s=l=void 0),i=n.toFinite(i),s===void 0?(s=i,i=0):s=n.toFinite(s),l=l===void 0?i<s?1:-1:n.toFinite(l);const c=Math.max(Math.ceil((s-i)/(l||1)),0),f=new Array(c);for(let h=0;h<c;h++)f[h]=i,i+=l;return f}e.range=r})(Ix)),Ix}var Ux,oP;function Wae(){return oP||(oP=1,Ux=Yae().range),Ux}var Qae=Wae();const R$=qs(Qae);var Ei=e=>e.chartData,fj=ne([Ei],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),bv=(e,t,n,r)=>r?fj(e):Ei(e),Xae=(e,t,n)=>n?fj(e):Ei(e),Jae=ne([bv],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});ne([fj],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});var ese=ne([Ei],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});function Vi(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(He(t)&&He(n))return!0}return!1}function lP(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function D$(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,s;if(He(n))i=n;else if(typeof n=="function")return;if(He(r))s=r;else if(typeof r=="function")return;var l=[i,s];if(Vi(l))return l}}function tse(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(Vi(r))return lP(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,s]=e,l,c;if(i==="auto")t!=null&&(l=Math.min(...t));else if(Pe(i))l=i;else if(typeof i=="function")try{t!=null&&(l=i(t?.[0]))}catch{}else if(typeof i=="string"&&QT.test(i)){var f=QT.exec(i);if(f==null||f[1]==null||t==null)l=void 0;else{var h=+f[1];l=t[0]-h}}else l=t?.[0];if(s==="auto")t!=null&&(c=Math.max(...t));else if(Pe(s))c=s;else if(typeof s=="function")try{t!=null&&(c=s(t?.[1]))}catch{}else if(typeof s=="string"&&XT.test(s)){var p=XT.exec(s);if(p==null||p[1]==null||t==null)c=void 0;else{var g=+p[1];c=t[1]+g}}else c=t?.[1];var v=[l,c];if(Vi(v))return t==null?v:lP(v,t,n)}}}var ru=1e9,nse={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},pj,It=!0,si="[DecimalError] ",Ko=si+"Invalid argument: ",hj=si+"Exponent out of range: ",iu=Math.floor,_o=Math.pow,rse=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Er,Nn=1e7,Et=7,I$=9007199254740991,Zm=iu(I$/Et),_e={};_e.absoluteValue=_e.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};_e.comparedTo=_e.cmp=function(e){var t,n,r,i,s=this;if(e=new s.constructor(e),s.s!==e.s)return s.s||-e.s;if(s.e!==e.e)return s.e>e.e^s.s<0?1:-1;for(r=s.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(s.d[t]!==e.d[t])return s.d[t]>e.d[t]^s.s<0?1:-1;return r===i?0:r>i^s.s<0?1:-1};_e.decimalPlaces=_e.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Et;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};_e.dividedBy=_e.div=function(e){return Ta(this,new this.constructor(e))};_e.dividedToIntegerBy=_e.idiv=function(e){var t=this,n=t.constructor;return Nt(Ta(t,new n(e),0,1),n.precision)};_e.equals=_e.eq=function(e){return!this.cmp(e)};_e.exponent=function(){return hn(this)};_e.greaterThan=_e.gt=function(e){return this.cmp(e)>0};_e.greaterThanOrEqualTo=_e.gte=function(e){return this.cmp(e)>=0};_e.isInteger=_e.isint=function(){return this.e>this.d.length-2};_e.isNegative=_e.isneg=function(){return this.s<0};_e.isPositive=_e.ispos=function(){return this.s>0};_e.isZero=function(){return this.s===0};_e.lessThan=_e.lt=function(e){return this.cmp(e)<0};_e.lessThanOrEqualTo=_e.lte=function(e){return this.cmp(e)<1};_e.logarithm=_e.log=function(e){var t,n=this,r=n.constructor,i=r.precision,s=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Er))throw Error(si+"NaN");if(n.s<1)throw Error(si+(n.s?"NaN":"-Infinity"));return n.eq(Er)?new r(0):(It=!1,t=Ta(Xd(n,s),Xd(e,s),s),It=!0,Nt(t,i))};_e.minus=_e.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?U$(t,e):L$(t,(e.s=-e.s,e))};_e.modulo=_e.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(si+"NaN");return n.s?(It=!1,t=Ta(n,e,0,1).times(e),It=!0,n.minus(t)):Nt(new r(n),i)};_e.naturalExponential=_e.exp=function(){return $$(this)};_e.naturalLogarithm=_e.ln=function(){return Xd(this)};_e.negated=_e.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};_e.plus=_e.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?L$(t,e):U$(t,(e.s=-e.s,e))};_e.precision=_e.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ko+e);if(t=hn(i)+1,r=i.d.length-1,n=r*Et+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};_e.squareRoot=_e.sqrt=function(){var e,t,n,r,i,s,l,c=this,f=c.constructor;if(c.s<1){if(!c.s)return new f(0);throw Error(si+"NaN")}for(e=hn(c),It=!1,i=Math.sqrt(+c),i==0||i==1/0?(t=Gi(c.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=iu((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new f(t)):r=new f(i.toString()),n=f.precision,i=l=n+3;;)if(s=r,r=s.plus(Ta(c,s,l+2)).times(.5),Gi(s.d).slice(0,l)===(t=Gi(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),i==l&&t=="4999"){if(Nt(s,n+1,0),s.times(s).eq(c)){r=s;break}}else if(t!="9999")break;l+=4}return It=!0,Nt(r,n)};_e.times=_e.mul=function(e){var t,n,r,i,s,l,c,f,h,p=this,g=p.constructor,v=p.d,y=(e=new g(e)).d;if(!p.s||!e.s)return new g(0);for(e.s*=p.s,n=p.e+e.e,f=v.length,h=y.length,f<h&&(s=v,v=y,y=s,l=f,f=h,h=l),s=[],l=f+h,r=l;r--;)s.push(0);for(r=h;--r>=0;){for(t=0,i=f+r;i>r;)c=s[i]+y[r]*v[i-r-1]+t,s[i--]=c%Nn|0,t=c/Nn|0;s[i]=(s[i]+t)%Nn|0}for(;!s[--l];)s.pop();return t?++n:s.shift(),e.d=s,e.e=n,It?Nt(e,g.precision):e};_e.toDecimalPlaces=_e.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Xi(e,0,ru),t===void 0?t=r.rounding:Xi(t,0,8),Nt(n,e+hn(n)+1,t))};_e.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=rl(r,!0):(Xi(e,0,ru),t===void 0?t=i.rounding:Xi(t,0,8),r=Nt(new i(r),e+1,t),n=rl(r,!0,e+1)),n};_e.toFixed=function(e,t){var n,r,i=this,s=i.constructor;return e===void 0?rl(i):(Xi(e,0,ru),t===void 0?t=s.rounding:Xi(t,0,8),r=Nt(new s(i),e+hn(i)+1,t),n=rl(r.abs(),!1,e+hn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};_e.toInteger=_e.toint=function(){var e=this,t=e.constructor;return Nt(new t(e),hn(e)+1,t.rounding)};_e.toNumber=function(){return+this};_e.toPower=_e.pow=function(e){var t,n,r,i,s,l,c=this,f=c.constructor,h=12,p=+(e=new f(e));if(!e.s)return new f(Er);if(c=new f(c),!c.s){if(e.s<1)throw Error(si+"Infinity");return c}if(c.eq(Er))return c;if(r=f.precision,e.eq(Er))return Nt(c,r);if(t=e.e,n=e.d.length-1,l=t>=n,s=c.s,l){if((n=p<0?-p:p)<=I$){for(i=new f(Er),t=Math.ceil(r/Et+4),It=!1;n%2&&(i=i.times(c),uP(i.d,t)),n=iu(n/2),n!==0;)c=c.times(c),uP(c.d,t);return It=!0,e.s<0?new f(Er).div(i):Nt(i,r)}}else if(s<0)throw Error(si+"NaN");return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,It=!1,i=e.times(Xd(c,r+h)),It=!0,i=$$(i),i.s=s,i};_e.toPrecision=function(e,t){var n,r,i=this,s=i.constructor;return e===void 0?(n=hn(i),r=rl(i,n<=s.toExpNeg||n>=s.toExpPos)):(Xi(e,1,ru),t===void 0?t=s.rounding:Xi(t,0,8),i=Nt(new s(i),e,t),n=hn(i),r=rl(i,e<=n||n<=s.toExpNeg,e)),r};_e.toSignificantDigits=_e.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Xi(e,1,ru),t===void 0?t=r.rounding:Xi(t,0,8)),Nt(new r(n),e,t)};_e.toString=_e.valueOf=_e.val=_e.toJSON=_e[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=hn(e),n=e.constructor;return rl(e,t<=n.toExpNeg||t>=n.toExpPos)};function L$(e,t){var n,r,i,s,l,c,f,h,p=e.constructor,g=p.precision;if(!e.s||!t.s)return t.s||(t=new p(e)),It?Nt(t,g):t;if(f=e.d,h=t.d,l=e.e,i=t.e,f=f.slice(),s=l-i,s){for(s<0?(r=f,s=-s,c=h.length):(r=h,i=l,c=f.length),l=Math.ceil(g/Et),c=l>c?l+1:c+1,s>c&&(s=c,r.length=1),r.reverse();s--;)r.push(0);r.reverse()}for(c=f.length,s=h.length,c-s<0&&(s=c,r=h,h=f,f=r),n=0;s;)n=(f[--s]=f[s]+h[s]+n)/Nn|0,f[s]%=Nn;for(n&&(f.unshift(n),++i),c=f.length;f[--c]==0;)f.pop();return t.d=f,t.e=i,It?Nt(t,g):t}function Xi(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Ko+e)}function Gi(e){var t,n,r,i=e.length-1,s="",l=e[0];if(i>0){for(s+=l,t=1;t<i;t++)r=e[t]+"",n=Et-r.length,n&&(s+=Ns(n)),s+=r;l=e[t],r=l+"",n=Et-r.length,n&&(s+=Ns(n))}else if(l===0)return"0";for(;l%10===0;)l/=10;return s+l}var Ta=(function(){function e(r,i){var s,l=0,c=r.length;for(r=r.slice();c--;)s=r[c]*i+l,r[c]=s%Nn|0,l=s/Nn|0;return l&&r.unshift(l),r}function t(r,i,s,l){var c,f;if(s!=l)f=s>l?1:-1;else for(c=f=0;c<s;c++)if(r[c]!=i[c]){f=r[c]>i[c]?1:-1;break}return f}function n(r,i,s){for(var l=0;s--;)r[s]-=l,l=r[s]<i[s]?1:0,r[s]=l*Nn+r[s]-i[s];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,s,l){var c,f,h,p,g,v,y,w,S,N,C,E,k,O,T,P,A,z,R=r.constructor,q=r.s==i.s?1:-1,U=r.d,L=i.d;if(!r.s)return new R(r);if(!i.s)throw Error(si+"Division by zero");for(f=r.e-i.e,A=L.length,T=U.length,y=new R(q),w=y.d=[],h=0;L[h]==(U[h]||0);)++h;if(L[h]>(U[h]||0)&&--f,s==null?E=s=R.precision:l?E=s+(hn(r)-hn(i))+1:E=s,E<0)return new R(0);if(E=E/Et+2|0,h=0,A==1)for(p=0,L=L[0],E++;(h<T||p)&&E--;h++)k=p*Nn+(U[h]||0),w[h]=k/L|0,p=k%L|0;else{for(p=Nn/(L[0]+1)|0,p>1&&(L=e(L,p),U=e(U,p),A=L.length,T=U.length),O=A,S=U.slice(0,A),N=S.length;N<A;)S[N++]=0;z=L.slice(),z.unshift(0),P=L[0],L[1]>=Nn/2&&++P;do p=0,c=t(L,S,A,N),c<0?(C=S[0],A!=N&&(C=C*Nn+(S[1]||0)),p=C/P|0,p>1?(p>=Nn&&(p=Nn-1),g=e(L,p),v=g.length,N=S.length,c=t(g,S,v,N),c==1&&(p--,n(g,A<v?z:L,v))):(p==0&&(c=p=1),g=L.slice()),v=g.length,v<N&&g.unshift(0),n(S,g,N),c==-1&&(N=S.length,c=t(L,S,A,N),c<1&&(p++,n(S,A<N?z:L,N))),N=S.length):c===0&&(p++,S=[0]),w[h++]=p,c&&S[0]?S[N++]=U[O]||0:(S=[U[O]],N=1);while((O++<T||S[0]!==void 0)&&E--)}return w[0]||w.shift(),y.e=f,Nt(y,l?s+hn(y)+1:s)}})();function $$(e,t){var n,r,i,s,l,c,f=0,h=0,p=e.constructor,g=p.precision;if(hn(e)>16)throw Error(hj+hn(e));if(!e.s)return new p(Er);for(It=!1,c=g,l=new p(.03125);e.abs().gte(.1);)e=e.times(l),h+=5;for(r=Math.log(_o(2,h))/Math.LN10*2+5|0,c+=r,n=i=s=new p(Er),p.precision=c;;){if(i=Nt(i.times(e),c),n=n.times(++f),l=s.plus(Ta(i,n,c)),Gi(l.d).slice(0,c)===Gi(s.d).slice(0,c)){for(;h--;)s=Nt(s.times(s),c);return p.precision=g,t==null?(It=!0,Nt(s,g)):s}s=l}}function hn(e){for(var t=e.e*Et,n=e.d[0];n>=10;n/=10)t++;return t}function Bx(e,t,n){if(t>e.LN10.sd())throw It=!0,n&&(e.precision=n),Error(si+"LN10 precision limit exceeded");return Nt(new e(e.LN10),t)}function Ns(e){for(var t="";e--;)t+="0";return t}function Xd(e,t){var n,r,i,s,l,c,f,h,p,g=1,v=10,y=e,w=y.d,S=y.constructor,N=S.precision;if(y.s<1)throw Error(si+(y.s?"NaN":"-Infinity"));if(y.eq(Er))return new S(0);if(t==null?(It=!1,h=N):h=t,y.eq(10))return t==null&&(It=!0),Bx(S,h);if(h+=v,S.precision=h,n=Gi(w),r=n.charAt(0),s=hn(y),Math.abs(s)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)y=y.times(e),n=Gi(y.d),r=n.charAt(0),g++;s=hn(y),r>1?(y=new S("0."+n),s++):y=new S(r+"."+n.slice(1))}else return f=Bx(S,h+2,N).times(s+""),y=Xd(new S(r+"."+n.slice(1)),h-v).plus(f),S.precision=N,t==null?(It=!0,Nt(y,N)):y;for(c=l=y=Ta(y.minus(Er),y.plus(Er),h),p=Nt(y.times(y),h),i=3;;){if(l=Nt(l.times(p),h),f=c.plus(Ta(l,new S(i),h)),Gi(f.d).slice(0,h)===Gi(c.d).slice(0,h))return c=c.times(2),s!==0&&(c=c.plus(Bx(S,h+2,N).times(s+""))),c=Ta(c,new S(g),h),S.precision=N,t==null?(It=!0,Nt(c,N)):c;c=f,i+=2}}function cP(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=iu(n/Et),e.d=[],r=(n+1)%Et,n<0&&(r+=Et),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=Et;r<i;)e.d.push(+t.slice(r,r+=Et));t=t.slice(r),r=Et-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),It&&(e.e>Zm||e.e<-Zm))throw Error(hj+n)}else e.s=0,e.e=0,e.d=[0];return e}function Nt(e,t,n){var r,i,s,l,c,f,h,p,g=e.d;for(l=1,s=g[0];s>=10;s/=10)l++;if(r=t-l,r<0)r+=Et,i=t,h=g[p=0];else{if(p=Math.ceil((r+1)/Et),s=g.length,p>=s)return e;for(h=s=g[p],l=1;s>=10;s/=10)l++;r%=Et,i=r-Et+l}if(n!==void 0&&(s=_o(10,l-i-1),c=h/s%10|0,f=t<0||g[p+1]!==void 0||h%s,f=n<4?(c||f)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||f||n==6&&(r>0?i>0?h/_o(10,l-i):0:g[p-1])%10&1||n==(e.s<0?8:7))),t<1||!g[0])return f?(s=hn(e),g.length=1,t=t-s-1,g[0]=_o(10,(Et-t%Et)%Et),e.e=iu(-t/Et)||0):(g.length=1,g[0]=e.e=e.s=0),e;if(r==0?(g.length=p,s=1,p--):(g.length=p+1,s=_o(10,Et-r),g[p]=i>0?(h/_o(10,l-i)%_o(10,i)|0)*s:0),f)for(;;)if(p==0){(g[0]+=s)==Nn&&(g[0]=1,++e.e);break}else{if(g[p]+=s,g[p]!=Nn)break;g[p--]=0,s=1}for(r=g.length;g[--r]===0;)g.pop();if(It&&(e.e>Zm||e.e<-Zm))throw Error(hj+hn(e));return e}function U$(e,t){var n,r,i,s,l,c,f,h,p,g,v=e.constructor,y=v.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new v(e),It?Nt(t,y):t;if(f=e.d,g=t.d,r=t.e,h=e.e,f=f.slice(),l=h-r,l){for(p=l<0,p?(n=f,l=-l,c=g.length):(n=g,r=h,c=f.length),i=Math.max(Math.ceil(y/Et),c)+2,l>i&&(l=i,n.length=1),n.reverse(),i=l;i--;)n.push(0);n.reverse()}else{for(i=f.length,c=g.length,p=i<c,p&&(c=i),i=0;i<c;i++)if(f[i]!=g[i]){p=f[i]<g[i];break}l=0}for(p&&(n=f,f=g,g=n,t.s=-t.s),c=f.length,i=g.length-c;i>0;--i)f[c++]=0;for(i=g.length;i>l;){if(f[--i]<g[i]){for(s=i;s&&f[--s]===0;)f[s]=Nn-1;--f[s],f[i]+=Nn}f[i]-=g[i]}for(;f[--c]===0;)f.pop();for(;f[0]===0;f.shift())--r;return f[0]?(t.d=f,t.e=r,It?Nt(t,y):t):new v(0)}function rl(e,t,n){var r,i=hn(e),s=Gi(e.d),l=s.length;return t?(n&&(r=n-l)>0?s=s.charAt(0)+"."+s.slice(1)+Ns(r):l>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(i<0?"e":"e+")+i):i<0?(s="0."+Ns(-i-1)+s,n&&(r=n-l)>0&&(s+=Ns(r))):i>=l?(s+=Ns(i+1-l),n&&(r=n-i-1)>0&&(s=s+"."+Ns(r))):((r=i+1)<l&&(s=s.slice(0,r)+"."+s.slice(r)),n&&(r=n-l)>0&&(i+1===l&&(s+="."),s+=Ns(r))),e.s<0?"-"+s:s}function uP(e,t){if(e.length>t)return e.length=t,!0}function B$(e){var t,n,r;function i(s){var l=this;if(!(l instanceof i))return new i(s);if(l.constructor=i,s instanceof i){l.s=s.s,l.e=s.e,l.d=(s=s.d)?s.slice():s;return}if(typeof s=="number"){if(s*0!==0)throw Error(Ko+s);if(s>0)l.s=1;else if(s<0)s=-s,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(s===~~s&&s<1e7){l.e=0,l.d=[s];return}return cP(l,s.toString())}else if(typeof s!="string")throw Error(Ko+s);if(s.charCodeAt(0)===45?(s=s.slice(1),l.s=-1):l.s=1,rse.test(s))cP(l,s);else throw Error(Ko+s)}if(i.prototype=_e,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=B$,i.config=i.set=ise,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function ise(e){if(!e||typeof e!="object")throw Error(si+"Object expected");var t,n,r,i=["precision",1,ru,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(iu(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Ko+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Ko+n+": "+r);return this}var pj=B$(nse);Er=new pj(1);const it=pj;function q$(e){var t;return e===0?t=1:t=Math.floor(new it(e).abs().log(10).toNumber())+1,t}function F$(e,t,n){for(var r=new it(e),i=0,s=[];r.lt(t)&&i<1e5;)s.push(r.toNumber()),r=r.add(n),i++;return s}var K$=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},mj=(e,t,n)=>{if(e.lte(0))return new it(0);var r=q$(e.toNumber()),i=new it(10).pow(r),s=e.div(i),l=r!==1?.05:.1,c=new it(Math.ceil(s.div(l).toNumber())).add(n).mul(l),f=c.mul(i);return t?new it(f.toNumber()):new it(Math.ceil(f.toNumber()))},H$=(e,t,n)=>{var r;if(e.lte(0))return new it(0);var i=[1,2,2.5,5],s=e.toNumber(),l=Math.floor(new it(s).abs().log(10).toNumber()),c=new it(10).pow(l),f=e.div(c).toNumber(),h=i.findIndex(y=>y>=f-1e-10);if(h===-1&&(c=c.mul(10),h=0),h+=n,h>=i.length){var p=Math.floor(h/i.length);h%=i.length,c=c.mul(new it(10).pow(p))}var g=(r=i[h])!==null&&r!==void 0?r:1,v=new it(g).mul(c);return t?v:new it(Math.ceil(v.toNumber()))},ase=(e,t,n)=>{var r=new it(1),i=new it(e);if(!i.isint()&&n){var s=Math.abs(e);s<1?(r=new it(10).pow(q$(e)-1),i=new it(Math.floor(i.div(r).toNumber())).mul(r)):s>1&&(i=new it(Math.floor(e)))}else e===0?i=new it(Math.floor((t-1)/2)):n||(i=new it(Math.floor(e)));for(var l=Math.floor((t-1)/2),c=[],f=0;f<t;f++)c.push(i.add(new it(f-l).mul(r)).toNumber());return c},G$=function(t,n,r,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:mj;if(!Number.isFinite((n-t)/(r-1)))return{step:new it(0),tickMin:new it(0),tickMax:new it(0)};var c=l(new it(n).sub(t).div(r-1),i,s),f;t<=0&&n>=0?f=new it(0):(f=new it(t).add(n).div(2),f=f.sub(new it(f).mod(c)));var h=Math.ceil(f.sub(t).div(c).toNumber()),p=Math.ceil(new it(n).sub(f).div(c).toNumber()),g=h+p+1;return g>r?G$(t,n,r,i,s+1,l):(g<r&&(p=n>0?p+(r-g):p,h=n>0?h:h+(r-g)),{step:c,tickMin:f.sub(new it(h).mul(c)),tickMax:f.add(new it(p).mul(c))})},dP=function(t){var[n,r]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",c=Math.max(i,2),[f,h]=K$([n,r]);if(f===-1/0||h===1/0){var p=h===1/0?[f,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),h];return n>r?p.reverse():p}if(f===h)return ase(f,i,s);var g=l==="snap125"?H$:mj,{step:v,tickMin:y,tickMax:w}=G$(f,h,c,s,0,g),S=F$(y,w.add(new it(.1).mul(v)),v);return n>r?S.reverse():S},fP=function(t,n){var[r,i]=t,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[c,f]=K$([r,i]);if(c===-1/0||f===1/0)return[r,i];if(c===f)return[c];var h=l==="snap125"?H$:mj,p=Math.max(n,2),g=h(new it(f).sub(c).div(p-1),s,0),v=[...F$(new it(c),new it(f),g),f];return s===!1&&(v=v.map(y=>Math.round(y))),r>i?v.reverse():v},sse=e=>e.rootProps.barCategoryGap,xv=e=>e.rootProps.stackOffset,V$=e=>e.rootProps.reverseStackOrder,gj=e=>e.options.chartName,vj=e=>e.rootProps.syncId,Z$=e=>e.rootProps.syncMethod,yj=e=>e.options.eventEmitter,ose=e=>e.rootProps.baseValue,Zn={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},xo={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},Ui={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},wv=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Sv(e,t,n){if(n!=="auto")return n;if(e!=null)return ea(e,t)?"category":"number"}function hP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ym(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hP(Object(n),!0).forEach(function(r){lse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lse(e,t,n){return(t=cse(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cse(e){var t=use(e,"string");return typeof t=="symbol"?t:t+""}function use(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var pP={allowDataOverflow:xo.allowDataOverflow,allowDecimals:xo.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:xo.angleAxisId,includeHidden:!1,name:void 0,reversed:xo.reversed,scale:xo.scale,tick:xo.tick,tickCount:void 0,ticks:void 0,type:xo.type,unit:void 0,niceTicks:"auto"},mP={allowDataOverflow:Ui.allowDataOverflow,allowDecimals:Ui.allowDecimals,allowDuplicatedCategory:Ui.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:Ui.radiusAxisId,includeHidden:Ui.includeHidden,name:void 0,reversed:Ui.reversed,scale:Ui.scale,tick:Ui.tick,tickCount:Ui.tickCount,ticks:void 0,type:Ui.type,unit:void 0,niceTicks:"auto"},dse=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},bj=ne([dse,v$],(e,t)=>{var n;if(e!=null)return e;var r=(n=Sv(t,"angleAxis",pP.type))!==null&&n!==void 0?n:"category";return Ym(Ym({},pP),{},{type:r})}),fse=(e,t)=>e.polarAxis.radiusAxis[t],xj=ne([fse,v$],(e,t)=>{var n;if(e!=null)return e;var r=(n=Sv(t,"radiusAxis",mP.type))!==null&&n!==void 0?n:"category";return Ym(Ym({},mP),{},{type:r})}),jv=e=>e.polarOptions,wj=ne([La,$a,Un],Dae),Y$=ne([jv,wj],(e,t)=>{if(e!=null)return Bs(e.innerRadius,t,0)}),W$=ne([jv,wj],(e,t)=>{if(e!=null)return Bs(e.outerRadius,t,t*.8)}),hse=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},Q$=ne([jv],hse);ne([bj,Q$],wv);var X$=ne([wj,Y$,W$],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});ne([xj,X$],wv);var J$=ne([$t,jv,Y$,W$,La,$a],(e,t,n,r,i,s)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:l,cy:c,startAngle:f,endAngle:h}=t;return{cx:Bs(l,i,i/2),cy:Bs(c,s,s/2),innerRadius:n,outerRadius:r,startAngle:f,endAngle:h,clockWise:!1}}}),On=(e,t)=>t,Nv=(e,t,n)=>n;function Sj(e){return e?.id}function e5(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:s}=n,l=new Map;return e.forEach(c=>{var f,h=(f=c.data)!==null&&f!==void 0?f:r;if(!(h==null||h.length===0)){var p=Sj(c);h.forEach((g,v)=>{var y=s==null||i?v:String(Cn(g,s,null)),w=Cn(g,c.dataKey,0),S;l.has(y)?S=l.get(y):S={},Object.assign(S,{[p]:w}),l.set(y,S)})}}),Array.from(l.values())}function jj(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Cv=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Ov(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function pse(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}var _n=e=>{var t=$t(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},au=e=>e.tooltip.settings.axisId;function Nj(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:(function(s){function l(){return s.apply(this,arguments)}return l.toString=function(){return s.toString()},l})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(s){var l=i[0],c=i[1];return l<=c?s>=l&&s<=c:s>=c&&s<=l},bandwidth:n?()=>n.call(e):void 0,ticks:t?s=>t.call(e,s):void 0,map:(s,l)=>{var c=e(s);if(c!=null){if(e.bandwidth&&l!==null&&l!==void 0&&l.position){var f=e.bandwidth();switch(l.position){case"middle":c+=f/2;break;case"end":c+=f;break}}return c}}}}}var mse=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Vi(t)){for(var n,r,i=0;i<t.length;i++){var s=t[i];He(s)&&((n===void 0||s<n)&&(n=s),(r===void 0||s>r)&&(r=s))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};function Ds(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function gse(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Cj(e){let t,n,r;e.length!==2?(t=Ds,n=(c,f)=>Ds(e(c),f),r=(c,f)=>e(c)-f):(t=e===Ds||e===gse?e:vse,n=e,r=e);function i(c,f,h=0,p=c.length){if(h<p){if(t(f,f)!==0)return p;do{const g=h+p>>>1;n(c[g],f)<0?h=g+1:p=g}while(h<p)}return h}function s(c,f,h=0,p=c.length){if(h<p){if(t(f,f)!==0)return p;do{const g=h+p>>>1;n(c[g],f)<=0?h=g+1:p=g}while(h<p)}return h}function l(c,f,h=0,p=c.length){const g=i(c,f,h,p-1);return g>h&&r(c[g-1],f)>-r(c[g],f)?g-1:g}return{left:i,center:l,right:s}}function vse(){return 0}function t5(e){return e===null?NaN:+e}function*yse(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const bse=Cj(Ds),jf=bse.right;Cj(t5).center;class gP extends Map{constructor(t,n=Sse){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(vP(this,t))}has(t){return super.has(vP(this,t))}set(t,n){return super.set(xse(this,t),n)}delete(t){return super.delete(wse(this,t))}}function vP({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function xse({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function wse({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Sse(e){return e!==null&&typeof e=="object"?e.valueOf():e}function jse(e=Ds){if(e===Ds)return n5;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function n5(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Nse=Math.sqrt(50),Cse=Math.sqrt(10),Ose=Math.sqrt(2);function Wm(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),l=s>=Nse?10:s>=Cse?5:s>=Ose?2:1;let c,f,h;return i<0?(h=Math.pow(10,-i)/l,c=Math.round(e*h),f=Math.round(t*h),c/h<e&&++c,f/h>t&&--f,h=-h):(h=Math.pow(10,i)*l,c=Math.round(e/h),f=Math.round(t/h),c*h<e&&++c,f*h>t&&--f),f<c&&.5<=n&&n<2?Wm(e,t,n*2):[c,f,h]}function xS(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,s,l]=r?Wm(t,e,n):Wm(e,t,n);if(!(s>=i))return[];const c=s-i+1,f=new Array(c);if(r)if(l<0)for(let h=0;h<c;++h)f[h]=(s-h)/-l;else for(let h=0;h<c;++h)f[h]=(s-h)*l;else if(l<0)for(let h=0;h<c;++h)f[h]=(i+h)/-l;else for(let h=0;h<c;++h)f[h]=(i+h)*l;return f}function wS(e,t,n){return t=+t,e=+e,n=+n,Wm(e,t,n)[2]}function SS(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?wS(t,e,n):wS(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function yP(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function bP(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function r5(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?n5:jse(i);r>n;){if(r-n>600){const f=r-n+1,h=t-n+1,p=Math.log(f),g=.5*Math.exp(2*p/3),v=.5*Math.sqrt(p*g*(f-g)/f)*(h-f/2<0?-1:1),y=Math.max(n,Math.floor(t-h*g/f+v)),w=Math.min(r,Math.floor(t+(f-h)*g/f+v));r5(e,t,y,w,i)}const s=e[t];let l=n,c=r;for(pd(e,n,t),i(e[r],s)>0&&pd(e,n,r);l<c;){for(pd(e,l,c),++l,--c;i(e[l],s)<0;)++l;for(;i(e[c],s)>0;)--c}i(e[n],s)===0?pd(e,n,c):(++c,pd(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function pd(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function _se(e,t,n){if(e=Float64Array.from(yse(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return bP(e);if(t>=1)return yP(e);var r,i=(r-1)*t,s=Math.floor(i),l=yP(r5(e,s).subarray(0,s+1)),c=bP(e.subarray(s+1));return l+(c-l)*(i-s)}}function kse(e,t,n=t5){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,s=Math.floor(i),l=+n(e[s],s,e),c=+n(e[s+1],s+1,e);return l+(c-l)*(i-s)}}function Ase(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(i);++r<i;)s[r]=e+r*n;return s}function di(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ua(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const jS=Symbol("implicit");function Oj(){var e=new gP,t=[],n=[],r=jS;function i(s){let l=e.get(s);if(l===void 0){if(r!==jS)return r;e.set(s,l=t.push(s)-1)}return n[l%n.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new gP;for(const l of s)e.has(l)||e.set(l,t.push(l)-1);return i},i.range=function(s){return arguments.length?(n=Array.from(s),i):n.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return Oj(t,n).unknown(r)},di.apply(i,arguments),i}function _j(){var e=Oj().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,s,l,c=!1,f=0,h=0,p=.5;delete e.unknown;function g(){var v=t().length,y=i<r,w=y?i:r,S=y?r:i;s=(S-w)/Math.max(1,v-f+h*2),c&&(s=Math.floor(s)),w+=(S-w-s*(v-f))*p,l=s*(1-f),c&&(w=Math.round(w),l=Math.round(l));var N=Ase(v).map(function(C){return w+s*C});return n(y?N.reverse():N)}return e.domain=function(v){return arguments.length?(t(v),g()):t()},e.range=function(v){return arguments.length?([r,i]=v,r=+r,i=+i,g()):[r,i]},e.rangeRound=function(v){return[r,i]=v,r=+r,i=+i,c=!0,g()},e.bandwidth=function(){return l},e.step=function(){return s},e.round=function(v){return arguments.length?(c=!!v,g()):c},e.padding=function(v){return arguments.length?(f=Math.min(1,h=+v),g()):f},e.paddingInner=function(v){return arguments.length?(f=Math.min(1,v),g()):f},e.paddingOuter=function(v){return arguments.length?(h=+v,g()):h},e.align=function(v){return arguments.length?(p=Math.max(0,Math.min(1,v)),g()):p},e.copy=function(){return _j(t(),[r,i]).round(c).paddingInner(f).paddingOuter(h).align(p)},di.apply(g(),arguments)}function i5(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return i5(t())},e}function Ese(){return i5(_j.apply(null,arguments).paddingInner(1))}function kj(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function a5(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Nf(){}var Jd=.7,Qm=1/Jd,Ac="\\s*([+-]?\\d+)\\s*",ef="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Zi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Tse=/^#([0-9a-f]{3,8})$/,Pse=new RegExp(`^rgb\\(${Ac},${Ac},${Ac}\\)$`),zse=new RegExp(`^rgb\\(${Zi},${Zi},${Zi}\\)$`),Mse=new RegExp(`^rgba\\(${Ac},${Ac},${Ac},${ef}\\)$`),Rse=new RegExp(`^rgba\\(${Zi},${Zi},${Zi},${ef}\\)$`),Dse=new RegExp(`^hsl\\(${ef},${Zi},${Zi}\\)$`),Ise=new RegExp(`^hsla\\(${ef},${Zi},${Zi},${ef}\\)$`),xP={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};kj(Nf,tf,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:wP,formatHex:wP,formatHex8:Lse,formatHsl:$se,formatRgb:SP,toString:SP});function wP(){return this.rgb().formatHex()}function Lse(){return this.rgb().formatHex8()}function $se(){return s5(this).formatHsl()}function SP(){return this.rgb().formatRgb()}function tf(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Tse.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?jP(t):n===3?new yr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?kp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?kp(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=Pse.exec(e))?new yr(t[1],t[2],t[3],1):(t=zse.exec(e))?new yr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Mse.exec(e))?kp(t[1],t[2],t[3],t[4]):(t=Rse.exec(e))?kp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Dse.exec(e))?OP(t[1],t[2]/100,t[3]/100,1):(t=Ise.exec(e))?OP(t[1],t[2]/100,t[3]/100,t[4]):xP.hasOwnProperty(e)?jP(xP[e]):e==="transparent"?new yr(NaN,NaN,NaN,0):null}function jP(e){return new yr(e>>16&255,e>>8&255,e&255,1)}function kp(e,t,n,r){return r<=0&&(e=t=n=NaN),new yr(e,t,n,r)}function Use(e){return e instanceof Nf||(e=tf(e)),e?(e=e.rgb(),new yr(e.r,e.g,e.b,e.opacity)):new yr}function NS(e,t,n,r){return arguments.length===1?Use(e):new yr(e,t,n,r??1)}function yr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}kj(yr,NS,a5(Nf,{brighter(e){return e=e==null?Qm:Math.pow(Qm,e),new yr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Jd:Math.pow(Jd,e),new yr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new yr(Ho(this.r),Ho(this.g),Ho(this.b),Xm(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:NP,formatHex:NP,formatHex8:Bse,formatRgb:CP,toString:CP}));function NP(){return`#${Ro(this.r)}${Ro(this.g)}${Ro(this.b)}`}function Bse(){return`#${Ro(this.r)}${Ro(this.g)}${Ro(this.b)}${Ro((isNaN(this.opacity)?1:this.opacity)*255)}`}function CP(){const e=Xm(this.opacity);return`${e===1?"rgb(":"rgba("}${Ho(this.r)}, ${Ho(this.g)}, ${Ho(this.b)}${e===1?")":`, ${e})`}`}function Xm(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ho(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ro(e){return e=Ho(e),(e<16?"0":"")+e.toString(16)}function OP(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Si(e,t,n,r)}function s5(e){if(e instanceof Si)return new Si(e.h,e.s,e.l,e.opacity);if(e instanceof Nf||(e=tf(e)),!e)return new Si;if(e instanceof Si)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),l=NaN,c=s-i,f=(s+i)/2;return c?(t===s?l=(n-r)/c+(n<r)*6:n===s?l=(r-t)/c+2:l=(t-n)/c+4,c/=f<.5?s+i:2-s-i,l*=60):c=f>0&&f<1?0:l,new Si(l,c,f,e.opacity)}function qse(e,t,n,r){return arguments.length===1?s5(e):new Si(e,t,n,r??1)}function Si(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}kj(Si,qse,a5(Nf,{brighter(e){return e=e==null?Qm:Math.pow(Qm,e),new Si(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Jd:Math.pow(Jd,e),new Si(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new yr(qx(e>=240?e-240:e+120,i,r),qx(e,i,r),qx(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Si(_P(this.h),Ap(this.s),Ap(this.l),Xm(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=Xm(this.opacity);return`${e===1?"hsl(":"hsla("}${_P(this.h)}, ${Ap(this.s)*100}%, ${Ap(this.l)*100}%${e===1?")":`, ${e})`}`}}));function _P(e){return e=(e||0)%360,e<0?e+360:e}function Ap(e){return Math.max(0,Math.min(1,e||0))}function qx(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Aj=e=>()=>e;function Fse(e,t){return function(n){return e+n*t}}function Kse(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Hse(e){return(e=+e)==1?o5:function(t,n){return n-t?Kse(t,n,e):Aj(isNaN(t)?n:t)}}function o5(e,t){var n=t-e;return n?Fse(e,n):Aj(isNaN(e)?t:e)}const kP=(function e(t){var n=Hse(t);function r(i,s){var l=n((i=NS(i)).r,(s=NS(s)).r),c=n(i.g,s.g),f=n(i.b,s.b),h=o5(i.opacity,s.opacity);return function(p){return i.r=l(p),i.g=c(p),i.b=f(p),i.opacity=h(p),i+""}}return r.gamma=e,r})(1);function Gse(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=e[i]*(1-s)+t[i]*s;return r}}function Vse(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Zse(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),s=new Array(n),l;for(l=0;l<r;++l)i[l]=su(e[l],t[l]);for(;l<n;++l)s[l]=t[l];return function(c){for(l=0;l<r;++l)s[l]=i[l](c);return s}}function Yse(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Jm(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Wse(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=su(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var CS=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Fx=new RegExp(CS.source,"g");function Qse(e){return function(){return e}}function Xse(e){return function(t){return e(t)+""}}function Jse(e,t){var n=CS.lastIndex=Fx.lastIndex=0,r,i,s,l=-1,c=[],f=[];for(e=e+"",t=t+"";(r=CS.exec(e))&&(i=Fx.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),c[l]?c[l]+=s:c[++l]=s),(r=r[0])===(i=i[0])?c[l]?c[l]+=i:c[++l]=i:(c[++l]=null,f.push({i:l,x:Jm(r,i)})),n=Fx.lastIndex;return n<t.length&&(s=t.slice(n),c[l]?c[l]+=s:c[++l]=s),c.length<2?f[0]?Xse(f[0].x):Qse(t):(t=f.length,function(h){for(var p=0,g;p<t;++p)c[(g=f[p]).i]=g.x(h);return c.join("")})}function su(e,t){var n=typeof t,r;return t==null||n==="boolean"?Aj(t):(n==="number"?Jm:n==="string"?(r=tf(t))?(t=r,kP):Jse:t instanceof tf?kP:t instanceof Date?Yse:Vse(t)?Gse:Array.isArray(t)?Zse:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Wse:Jm)(e,t)}function Ej(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function eoe(e,t){t===void 0&&(t=e,e=su);for(var n=0,r=t.length-1,i=t[0],s=new Array(r<0?0:r);n<r;)s[n]=e(i,i=t[++n]);return function(l){var c=Math.max(0,Math.min(r-1,Math.floor(l*=r)));return s[c](l-c)}}function toe(e){return function(){return e}}function eg(e){return+e}var AP=[0,1];function tr(e){return e}function OS(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:toe(isNaN(t)?NaN:.5)}function noe(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function roe(e,t,n){var r=e[0],i=e[1],s=t[0],l=t[1];return i<r?(r=OS(i,r),s=n(l,s)):(r=OS(r,i),s=n(s,l)),function(c){return s(r(c))}}function ioe(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),s=new Array(r),l=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++l<r;)i[l]=OS(e[l],e[l+1]),s[l]=n(t[l],t[l+1]);return function(c){var f=jf(e,c,1,r)-1;return s[f](i[f](c))}}function Cf(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function _v(){var e=AP,t=AP,n=su,r,i,s,l=tr,c,f,h;function p(){var v=Math.min(e.length,t.length);return l!==tr&&(l=noe(e[0],e[v-1])),c=v>2?ioe:roe,f=h=null,g}function g(v){return v==null||isNaN(v=+v)?s:(f||(f=c(e.map(r),t,n)))(r(l(v)))}return g.invert=function(v){return l(i((h||(h=c(t,e.map(r),Jm)))(v)))},g.domain=function(v){return arguments.length?(e=Array.from(v,eg),p()):e.slice()},g.range=function(v){return arguments.length?(t=Array.from(v),p()):t.slice()},g.rangeRound=function(v){return t=Array.from(v),n=Ej,p()},g.clamp=function(v){return arguments.length?(l=v?!0:tr,p()):l!==tr},g.interpolate=function(v){return arguments.length?(n=v,p()):n},g.unknown=function(v){return arguments.length?(s=v,g):s},function(v,y){return r=v,i=y,p()}}function Tj(){return _v()(tr,tr)}function aoe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function tg(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Uc(e){return e=tg(Math.abs(e)),e?e[1]:NaN}function soe(e,t){return function(n,r){for(var i=n.length,s=[],l=0,c=e[0],f=0;i>0&&c>0&&(f+c+1>r&&(c=Math.max(1,r-f)),s.push(n.substring(i-=c,i+c)),!((f+=c+1)>r));)c=e[l=(l+1)%e.length];return s.reverse().join(t)}}function ooe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var loe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function nf(e){if(!(t=loe.exec(e)))throw new Error("invalid format: "+e);var t;return new Pj({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]})}nf.prototype=Pj.prototype;function Pj(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+""}Pj.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 coe(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var ng;function uoe(e,t){var n=tg(e,t);if(!n)return ng=void 0,e.toPrecision(t);var r=n[0],i=n[1],s=i-(ng=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,l=r.length;return s===l?r:s>l?r+new Array(s-l+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+tg(e,Math.max(0,t+s-1))[0]}function EP(e,t){var n=tg(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const TP={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:aoe,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)=>EP(e*100,t),r:EP,s:uoe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function PP(e){return e}var zP=Array.prototype.map,MP=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function doe(e){var t=e.grouping===void 0||e.thousands===void 0?PP:soe(zP.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?PP:ooe(zP.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",f=e.nan===void 0?"NaN":e.nan+"";function h(g,v){g=nf(g);var y=g.fill,w=g.align,S=g.sign,N=g.symbol,C=g.zero,E=g.width,k=g.comma,O=g.precision,T=g.trim,P=g.type;P==="n"?(k=!0,P="g"):TP[P]||(O===void 0&&(O=12),T=!0,P="g"),(C||y==="0"&&w==="=")&&(C=!0,y="0",w="=");var A=(v&&v.prefix!==void 0?v.prefix:"")+(N==="$"?n:N==="#"&&/[boxX]/.test(P)?"0"+P.toLowerCase():""),z=(N==="$"?r:/[%p]/.test(P)?l:"")+(v&&v.suffix!==void 0?v.suffix:""),R=TP[P],q=/[defgprs%]/.test(P);O=O===void 0?6:/[gprs]/.test(P)?Math.max(1,Math.min(21,O)):Math.max(0,Math.min(20,O));function U(L){var ae=A,pe=z,ge,V,re;if(P==="c")pe=R(L)+pe,L="";else{L=+L;var ve=L<0||1/L<0;if(L=isNaN(L)?f:R(Math.abs(L),O),T&&(L=coe(L)),ve&&+L==0&&S!=="+"&&(ve=!1),ae=(ve?S==="("?S:c:S==="-"||S==="("?"":S)+ae,pe=(P==="s"&&!isNaN(L)&&ng!==void 0?MP[8+ng/3]:"")+pe+(ve&&S==="("?")":""),q){for(ge=-1,V=L.length;++ge<V;)if(re=L.charCodeAt(ge),48>re||re>57){pe=(re===46?i+L.slice(ge+1):L.slice(ge))+pe,L=L.slice(0,ge);break}}}k&&!C&&(L=t(L,1/0));var we=ae.length+L.length+pe.length,B=we<E?new Array(E-we+1).join(y):"";switch(k&&C&&(L=t(B+L,B.length?E-pe.length:1/0),B=""),w){case"<":L=ae+L+pe+B;break;case"=":L=ae+B+L+pe;break;case"^":L=B.slice(0,we=B.length>>1)+ae+L+pe+B.slice(we);break;default:L=B+ae+L+pe;break}return s(L)}return U.toString=function(){return g+""},U}function p(g,v){var y=Math.max(-8,Math.min(8,Math.floor(Uc(v)/3)))*3,w=Math.pow(10,-y),S=h((g=nf(g),g.type="f",g),{suffix:MP[8+y/3]});return function(N){return S(w*N)}}return{format:h,formatPrefix:p}}var Ep,zj,l5;foe({thousands:",",grouping:[3],currency:["$",""]});function foe(e){return Ep=doe(e),zj=Ep.format,l5=Ep.formatPrefix,Ep}function hoe(e){return Math.max(0,-Uc(Math.abs(e)))}function poe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Uc(t)/3)))*3-Uc(Math.abs(e)))}function moe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Uc(t)-Uc(e))+1}function c5(e,t,n,r){var i=SS(e,t,n),s;switch(r=nf(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=poe(i,l))&&(r.precision=s),l5(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=moe(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=hoe(i))&&(r.precision=s-(r.type==="%")*2);break}}return zj(r)}function Ys(e){var t=e.domain;return e.ticks=function(n){var r=t();return xS(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return c5(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,l=r[i],c=r[s],f,h,p=10;for(c<l&&(h=l,l=c,c=h,h=i,i=s,s=h);p-- >0;){if(h=wS(l,c,n),h===f)return r[i]=l,r[s]=c,t(r);if(h>0)l=Math.floor(l/h)*h,c=Math.ceil(c/h)*h;else if(h<0)l=Math.ceil(l*h)/h,c=Math.floor(c*h)/h;else break;f=h}return e},e}function u5(){var e=Tj();return e.copy=function(){return Cf(e,u5())},di.apply(e,arguments),Ys(e)}function d5(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,eg),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return d5(e).unknown(t)},e=arguments.length?Array.from(e,eg):[0,1],Ys(n)}function f5(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],l;return s<i&&(l=n,n=r,r=l,l=i,i=s,s=l),e[n]=t.floor(i),e[r]=t.ceil(s),e}function RP(e){return Math.log(e)}function DP(e){return Math.exp(e)}function goe(e){return-Math.log(-e)}function voe(e){return-Math.exp(-e)}function yoe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function boe(e){return e===10?yoe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function xoe(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function IP(e){return(t,n)=>-e(-t,n)}function Mj(e){const t=e(RP,DP),n=t.domain;let r=10,i,s;function l(){return i=xoe(r),s=boe(r),n()[0]<0?(i=IP(i),s=IP(s),e(goe,voe)):e(RP,DP),t}return t.base=function(c){return arguments.length?(r=+c,l()):r},t.domain=function(c){return arguments.length?(n(c),l()):n()},t.ticks=c=>{const f=n();let h=f[0],p=f[f.length-1];const g=p<h;g&&([h,p]=[p,h]);let v=i(h),y=i(p),w,S;const N=c==null?10:+c;let C=[];if(!(r%1)&&y-v<N){if(v=Math.floor(v),y=Math.ceil(y),h>0){for(;v<=y;++v)for(w=1;w<r;++w)if(S=v<0?w/s(-v):w*s(v),!(S<h)){if(S>p)break;C.push(S)}}else for(;v<=y;++v)for(w=r-1;w>=1;--w)if(S=v>0?w/s(-v):w*s(v),!(S<h)){if(S>p)break;C.push(S)}C.length*2<N&&(C=xS(h,p,N))}else C=xS(v,y,Math.min(y-v,N)).map(s);return g?C.reverse():C},t.tickFormat=(c,f)=>{if(c==null&&(c=10),f==null&&(f=r===10?"s":","),typeof f!="function"&&(!(r%1)&&(f=nf(f)).precision==null&&(f.trim=!0),f=zj(f)),c===1/0)return f;const h=Math.max(1,r*c/t.ticks().length);return p=>{let g=p/s(Math.round(i(p)));return g*r<r-.5&&(g*=r),g<=h?f(p):""}},t.nice=()=>n(f5(n(),{floor:c=>s(Math.floor(i(c))),ceil:c=>s(Math.ceil(i(c)))})),t}function h5(){const e=Mj(_v()).domain([1,10]);return e.copy=()=>Cf(e,h5()).base(e.base()),di.apply(e,arguments),e}function LP(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function $P(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Rj(e){var t=1,n=e(LP(t),$P(t));return n.constant=function(r){return arguments.length?e(LP(t=+r),$P(t)):t},Ys(n)}function p5(){var e=Rj(_v());return e.copy=function(){return Cf(e,p5()).constant(e.constant())},di.apply(e,arguments)}function UP(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function woe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Soe(e){return e<0?-e*e:e*e}function Dj(e){var t=e(tr,tr),n=1;function r(){return n===1?e(tr,tr):n===.5?e(woe,Soe):e(UP(n),UP(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Ys(t)}function Ij(){var e=Dj(_v());return e.copy=function(){return Cf(e,Ij()).exponent(e.exponent())},di.apply(e,arguments),e}function joe(){return Ij.apply(null,arguments).exponent(.5)}function BP(e){return Math.sign(e)*e*e}function Noe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function m5(){var e=Tj(),t=[0,1],n=!1,r;function i(s){var l=Noe(e(s));return isNaN(l)?r:n?Math.round(l):l}return i.invert=function(s){return e.invert(BP(s))},i.domain=function(s){return arguments.length?(e.domain(s),i):e.domain()},i.range=function(s){return arguments.length?(e.range((t=Array.from(s,eg)).map(BP)),i):t.slice()},i.rangeRound=function(s){return i.range(s).round(!0)},i.round=function(s){return arguments.length?(n=!!s,i):n},i.clamp=function(s){return arguments.length?(e.clamp(s),i):e.clamp()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return m5(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},di.apply(i,arguments),Ys(i)}function g5(){var e=[],t=[],n=[],r;function i(){var l=0,c=Math.max(1,t.length);for(n=new Array(c-1);++l<c;)n[l-1]=kse(e,l/c);return s}function s(l){return l==null||isNaN(l=+l)?r:t[jf(n,l)]}return s.invertExtent=function(l){var c=t.indexOf(l);return c<0?[NaN,NaN]:[c>0?n[c-1]:e[0],c<n.length?n[c]:e[e.length-1]]},s.domain=function(l){if(!arguments.length)return e.slice();e=[];for(let c of l)c!=null&&!isNaN(c=+c)&&e.push(c);return e.sort(Ds),i()},s.range=function(l){return arguments.length?(t=Array.from(l),i()):t.slice()},s.unknown=function(l){return arguments.length?(r=l,s):r},s.quantiles=function(){return n.slice()},s.copy=function(){return g5().domain(e).range(t).unknown(r)},di.apply(s,arguments)}function v5(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function l(f){return f!=null&&f<=f?i[jf(r,f,0,n)]:s}function c(){var f=-1;for(r=new Array(n);++f<n;)r[f]=((f+1)*t-(f-n)*e)/(n+1);return l}return l.domain=function(f){return arguments.length?([e,t]=f,e=+e,t=+t,c()):[e,t]},l.range=function(f){return arguments.length?(n=(i=Array.from(f)).length-1,c()):i.slice()},l.invertExtent=function(f){var h=i.indexOf(f);return h<0?[NaN,NaN]:h<1?[e,r[0]]:h>=n?[r[n-1],t]:[r[h-1],r[h]]},l.unknown=function(f){return arguments.length&&(s=f),l},l.thresholds=function(){return r.slice()},l.copy=function(){return v5().domain([e,t]).range(i).unknown(s)},di.apply(Ys(l),arguments)}function y5(){var e=[.5],t=[0,1],n,r=1;function i(s){return s!=null&&s<=s?t[jf(e,s,0,r)]:n}return i.domain=function(s){return arguments.length?(e=Array.from(s),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(s){return arguments.length?(t=Array.from(s),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(s){var l=t.indexOf(s);return[e[l-1],e[l]]},i.unknown=function(s){return arguments.length?(n=s,i):n},i.copy=function(){return y5().domain(e).range(t).unknown(n)},di.apply(i,arguments)}const Kx=new Date,Hx=new Date;function wn(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const l=i(s),c=i.ceil(s);return s-l<c-s?l:c},i.offset=(s,l)=>(t(s=new Date(+s),l==null?1:Math.floor(l)),s),i.range=(s,l,c)=>{const f=[];if(s=i.ceil(s),c=c==null?1:Math.floor(c),!(s<l)||!(c>0))return f;let h;do f.push(h=new Date(+s)),t(s,c),e(s);while(h<s&&s<l);return f},i.filter=s=>wn(l=>{if(l>=l)for(;e(l),!s(l);)l.setTime(l-1)},(l,c)=>{if(l>=l)if(c<0)for(;++c<=0;)for(;t(l,-1),!s(l););else for(;--c>=0;)for(;t(l,1),!s(l););}),n&&(i.count=(s,l)=>(Kx.setTime(+s),Hx.setTime(+l),e(Kx),e(Hx),Math.floor(n(Kx,Hx))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?l=>r(l)%s===0:l=>i.count(0,l)%s===0):i)),i}const rg=wn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);rg.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?wn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):rg);rg.range;const ka=1e3,ni=ka*60,Aa=ni*60,Ma=Aa*24,Lj=Ma*7,qP=Ma*30,Gx=Ma*365,Do=wn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ka)},(e,t)=>(t-e)/ka,e=>e.getUTCSeconds());Do.range;const $j=wn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ka)},(e,t)=>{e.setTime(+e+t*ni)},(e,t)=>(t-e)/ni,e=>e.getMinutes());$j.range;const Uj=wn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ni)},(e,t)=>(t-e)/ni,e=>e.getUTCMinutes());Uj.range;const Bj=wn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ka-e.getMinutes()*ni)},(e,t)=>{e.setTime(+e+t*Aa)},(e,t)=>(t-e)/Aa,e=>e.getHours());Bj.range;const qj=wn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Aa)},(e,t)=>(t-e)/Aa,e=>e.getUTCHours());qj.range;const Of=wn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ni)/Ma,e=>e.getDate()-1);Of.range;const kv=wn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ma,e=>e.getUTCDate()-1);kv.range;const b5=wn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ma,e=>Math.floor(e/Ma));b5.range;function hl(e){return wn(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*ni)/Lj)}const Av=hl(0),ig=hl(1),Coe=hl(2),Ooe=hl(3),Bc=hl(4),_oe=hl(5),koe=hl(6);Av.range;ig.range;Coe.range;Ooe.range;Bc.range;_oe.range;koe.range;function pl(e){return wn(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/Lj)}const Ev=pl(0),ag=pl(1),Aoe=pl(2),Eoe=pl(3),qc=pl(4),Toe=pl(5),Poe=pl(6);Ev.range;ag.range;Aoe.range;Eoe.range;qc.range;Toe.range;Poe.range;const Fj=wn(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());Fj.range;const Kj=wn(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());Kj.range;const Ra=wn(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());Ra.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:wn(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Ra.range;const Da=wn(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());Da.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:wn(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Da.range;function x5(e,t,n,r,i,s){const l=[[Do,1,ka],[Do,5,5*ka],[Do,15,15*ka],[Do,30,30*ka],[s,1,ni],[s,5,5*ni],[s,15,15*ni],[s,30,30*ni],[i,1,Aa],[i,3,3*Aa],[i,6,6*Aa],[i,12,12*Aa],[r,1,Ma],[r,2,2*Ma],[n,1,Lj],[t,1,qP],[t,3,3*qP],[e,1,Gx]];function c(h,p,g){const v=p<h;v&&([h,p]=[p,h]);const y=g&&typeof g.range=="function"?g:f(h,p,g),w=y?y.range(h,+p+1):[];return v?w.reverse():w}function f(h,p,g){const v=Math.abs(p-h)/g,y=Cj(([,,N])=>N).right(l,v);if(y===l.length)return e.every(SS(h/Gx,p/Gx,g));if(y===0)return rg.every(Math.max(SS(h,p,g),1));const[w,S]=l[v/l[y-1][2]<l[y][2]/v?y-1:y];return w.every(S)}return[c,f]}const[zoe,Moe]=x5(Da,Kj,Ev,b5,qj,Uj),[Roe,Doe]=x5(Ra,Fj,Av,Of,Bj,$j);function Vx(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 Zx(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 md(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Ioe(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,s=e.days,l=e.shortDays,c=e.months,f=e.shortMonths,h=gd(i),p=vd(i),g=gd(s),v=vd(s),y=gd(l),w=vd(l),S=gd(c),N=vd(c),C=gd(f),E=vd(f),k={a:re,A:ve,b:we,B,c:null,d:ZP,e:ZP,f:sle,g:gle,G:yle,H:rle,I:ile,j:ale,L:w5,m:ole,M:lle,p:D,q:G,Q:QP,s:XP,S:cle,u:ule,U:dle,V:fle,w:hle,W:ple,x:null,X:null,y:mle,Y:vle,Z:ble,"%":WP},O={a:oe,A:W,b:X,B:Q,c:null,d:YP,e:YP,f:jle,g:zle,G:Rle,H:xle,I:wle,j:Sle,L:j5,m:Nle,M:Cle,p:de,q:ye,Q:QP,s:XP,S:Ole,u:_le,U:kle,V:Ale,w:Ele,W:Tle,x:null,X:null,y:Ple,Y:Mle,Z:Dle,"%":WP},T={a:q,A:U,b:L,B:ae,c:pe,d:GP,e:GP,f:Joe,g:HP,G:KP,H:VP,I:VP,j:Yoe,L:Xoe,m:Zoe,M:Woe,p:R,q:Voe,Q:tle,s:nle,S:Qoe,u:qoe,U:Foe,V:Koe,w:Boe,W:Hoe,x:ge,X:V,y:HP,Y:KP,Z:Goe,"%":ele};k.x=P(n,k),k.X=P(r,k),k.c=P(t,k),O.x=P(n,O),O.X=P(r,O),O.c=P(t,O);function P(Z,le){return function(Se){var F=[],Ae=-1,Oe=0,nt=Z.length,Ve,sn,pn;for(Se instanceof Date||(Se=new Date(+Se));++Ae<nt;)Z.charCodeAt(Ae)===37&&(F.push(Z.slice(Oe,Ae)),(sn=FP[Ve=Z.charAt(++Ae)])!=null?Ve=Z.charAt(++Ae):sn=Ve==="e"?" ":"0",(pn=le[Ve])&&(Ve=pn(Se,sn)),F.push(Ve),Oe=Ae+1);return F.push(Z.slice(Oe,Ae)),F.join("")}}function A(Z,le){return function(Se){var F=md(1900,void 0,1),Ae=z(F,Z,Se+="",0),Oe,nt;if(Ae!=Se.length)return null;if("Q"in F)return new Date(F.Q);if("s"in F)return new Date(F.s*1e3+("L"in F?F.L:0));if(le&&!("Z"in F)&&(F.Z=0),"p"in F&&(F.H=F.H%12+F.p*12),F.m===void 0&&(F.m="q"in F?F.q:0),"V"in F){if(F.V<1||F.V>53)return null;"w"in F||(F.w=1),"Z"in F?(Oe=Zx(md(F.y,0,1)),nt=Oe.getUTCDay(),Oe=nt>4||nt===0?ag.ceil(Oe):ag(Oe),Oe=kv.offset(Oe,(F.V-1)*7),F.y=Oe.getUTCFullYear(),F.m=Oe.getUTCMonth(),F.d=Oe.getUTCDate()+(F.w+6)%7):(Oe=Vx(md(F.y,0,1)),nt=Oe.getDay(),Oe=nt>4||nt===0?ig.ceil(Oe):ig(Oe),Oe=Of.offset(Oe,(F.V-1)*7),F.y=Oe.getFullYear(),F.m=Oe.getMonth(),F.d=Oe.getDate()+(F.w+6)%7)}else("W"in F||"U"in F)&&("w"in F||(F.w="u"in F?F.u%7:"W"in F?1:0),nt="Z"in F?Zx(md(F.y,0,1)).getUTCDay():Vx(md(F.y,0,1)).getDay(),F.m=0,F.d="W"in F?(F.w+6)%7+F.W*7-(nt+5)%7:F.w+F.U*7-(nt+6)%7);return"Z"in F?(F.H+=F.Z/100|0,F.M+=F.Z%100,Zx(F)):Vx(F)}}function z(Z,le,Se,F){for(var Ae=0,Oe=le.length,nt=Se.length,Ve,sn;Ae<Oe;){if(F>=nt)return-1;if(Ve=le.charCodeAt(Ae++),Ve===37){if(Ve=le.charAt(Ae++),sn=T[Ve in FP?le.charAt(Ae++):Ve],!sn||(F=sn(Z,Se,F))<0)return-1}else if(Ve!=Se.charCodeAt(F++))return-1}return F}function R(Z,le,Se){var F=h.exec(le.slice(Se));return F?(Z.p=p.get(F[0].toLowerCase()),Se+F[0].length):-1}function q(Z,le,Se){var F=y.exec(le.slice(Se));return F?(Z.w=w.get(F[0].toLowerCase()),Se+F[0].length):-1}function U(Z,le,Se){var F=g.exec(le.slice(Se));return F?(Z.w=v.get(F[0].toLowerCase()),Se+F[0].length):-1}function L(Z,le,Se){var F=C.exec(le.slice(Se));return F?(Z.m=E.get(F[0].toLowerCase()),Se+F[0].length):-1}function ae(Z,le,Se){var F=S.exec(le.slice(Se));return F?(Z.m=N.get(F[0].toLowerCase()),Se+F[0].length):-1}function pe(Z,le,Se){return z(Z,t,le,Se)}function ge(Z,le,Se){return z(Z,n,le,Se)}function V(Z,le,Se){return z(Z,r,le,Se)}function re(Z){return l[Z.getDay()]}function ve(Z){return s[Z.getDay()]}function we(Z){return f[Z.getMonth()]}function B(Z){return c[Z.getMonth()]}function D(Z){return i[+(Z.getHours()>=12)]}function G(Z){return 1+~~(Z.getMonth()/3)}function oe(Z){return l[Z.getUTCDay()]}function W(Z){return s[Z.getUTCDay()]}function X(Z){return f[Z.getUTCMonth()]}function Q(Z){return c[Z.getUTCMonth()]}function de(Z){return i[+(Z.getUTCHours()>=12)]}function ye(Z){return 1+~~(Z.getUTCMonth()/3)}return{format:function(Z){var le=P(Z+="",k);return le.toString=function(){return Z},le},parse:function(Z){var le=A(Z+="",!1);return le.toString=function(){return Z},le},utcFormat:function(Z){var le=P(Z+="",O);return le.toString=function(){return Z},le},utcParse:function(Z){var le=A(Z+="",!0);return le.toString=function(){return Z},le}}}var FP={"-":"",_:" ",0:"0"},kn=/^\s*\d+/,Loe=/^%/,$oe=/[\\^$*+?|[\]().{}]/g;function ct(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s<n?new Array(n-s+1).join(t)+i:i)}function Uoe(e){return e.replace($oe,"\\$&")}function gd(e){return new RegExp("^(?:"+e.map(Uoe).join("|")+")","i")}function vd(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Boe(e,t,n){var r=kn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function qoe(e,t,n){var r=kn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Foe(e,t,n){var r=kn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Koe(e,t,n){var r=kn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Hoe(e,t,n){var r=kn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function KP(e,t,n){var r=kn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function HP(e,t,n){var r=kn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Goe(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Voe(e,t,n){var r=kn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Zoe(e,t,n){var r=kn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function GP(e,t,n){var r=kn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Yoe(e,t,n){var r=kn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function VP(e,t,n){var r=kn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Woe(e,t,n){var r=kn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Qoe(e,t,n){var r=kn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Xoe(e,t,n){var r=kn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Joe(e,t,n){var r=kn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function ele(e,t,n){var r=Loe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function tle(e,t,n){var r=kn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function nle(e,t,n){var r=kn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function ZP(e,t){return ct(e.getDate(),t,2)}function rle(e,t){return ct(e.getHours(),t,2)}function ile(e,t){return ct(e.getHours()%12||12,t,2)}function ale(e,t){return ct(1+Of.count(Ra(e),e),t,3)}function w5(e,t){return ct(e.getMilliseconds(),t,3)}function sle(e,t){return w5(e,t)+"000"}function ole(e,t){return ct(e.getMonth()+1,t,2)}function lle(e,t){return ct(e.getMinutes(),t,2)}function cle(e,t){return ct(e.getSeconds(),t,2)}function ule(e){var t=e.getDay();return t===0?7:t}function dle(e,t){return ct(Av.count(Ra(e)-1,e),t,2)}function S5(e){var t=e.getDay();return t>=4||t===0?Bc(e):Bc.ceil(e)}function fle(e,t){return e=S5(e),ct(Bc.count(Ra(e),e)+(Ra(e).getDay()===4),t,2)}function hle(e){return e.getDay()}function ple(e,t){return ct(ig.count(Ra(e)-1,e),t,2)}function mle(e,t){return ct(e.getFullYear()%100,t,2)}function gle(e,t){return e=S5(e),ct(e.getFullYear()%100,t,2)}function vle(e,t){return ct(e.getFullYear()%1e4,t,4)}function yle(e,t){var n=e.getDay();return e=n>=4||n===0?Bc(e):Bc.ceil(e),ct(e.getFullYear()%1e4,t,4)}function ble(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ct(t/60|0,"0",2)+ct(t%60,"0",2)}function YP(e,t){return ct(e.getUTCDate(),t,2)}function xle(e,t){return ct(e.getUTCHours(),t,2)}function wle(e,t){return ct(e.getUTCHours()%12||12,t,2)}function Sle(e,t){return ct(1+kv.count(Da(e),e),t,3)}function j5(e,t){return ct(e.getUTCMilliseconds(),t,3)}function jle(e,t){return j5(e,t)+"000"}function Nle(e,t){return ct(e.getUTCMonth()+1,t,2)}function Cle(e,t){return ct(e.getUTCMinutes(),t,2)}function Ole(e,t){return ct(e.getUTCSeconds(),t,2)}function _le(e){var t=e.getUTCDay();return t===0?7:t}function kle(e,t){return ct(Ev.count(Da(e)-1,e),t,2)}function N5(e){var t=e.getUTCDay();return t>=4||t===0?qc(e):qc.ceil(e)}function Ale(e,t){return e=N5(e),ct(qc.count(Da(e),e)+(Da(e).getUTCDay()===4),t,2)}function Ele(e){return e.getUTCDay()}function Tle(e,t){return ct(ag.count(Da(e)-1,e),t,2)}function Ple(e,t){return ct(e.getUTCFullYear()%100,t,2)}function zle(e,t){return e=N5(e),ct(e.getUTCFullYear()%100,t,2)}function Mle(e,t){return ct(e.getUTCFullYear()%1e4,t,4)}function Rle(e,t){var n=e.getUTCDay();return e=n>=4||n===0?qc(e):qc.ceil(e),ct(e.getUTCFullYear()%1e4,t,4)}function Dle(){return"+0000"}function WP(){return"%"}function QP(e){return+e}function XP(e){return Math.floor(+e/1e3)}var lc,C5,O5;Ile({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 Ile(e){return lc=Ioe(e),C5=lc.format,lc.parse,O5=lc.utcFormat,lc.utcParse,lc}function Lle(e){return new Date(e)}function $le(e){return e instanceof Date?+e:+new Date(+e)}function Hj(e,t,n,r,i,s,l,c,f,h){var p=Tj(),g=p.invert,v=p.domain,y=h(".%L"),w=h(":%S"),S=h("%I:%M"),N=h("%I %p"),C=h("%a %d"),E=h("%b %d"),k=h("%B"),O=h("%Y");function T(P){return(f(P)<P?y:c(P)<P?w:l(P)<P?S:s(P)<P?N:r(P)<P?i(P)<P?C:E:n(P)<P?k:O)(P)}return p.invert=function(P){return new Date(g(P))},p.domain=function(P){return arguments.length?v(Array.from(P,$le)):v().map(Lle)},p.ticks=function(P){var A=v();return e(A[0],A[A.length-1],P??10)},p.tickFormat=function(P,A){return A==null?T:h(A)},p.nice=function(P){var A=v();return(!P||typeof P.range!="function")&&(P=t(A[0],A[A.length-1],P??10)),P?v(f5(A,P)):p},p.copy=function(){return Cf(p,Hj(e,t,n,r,i,s,l,c,f,h))},p}function Ule(){return di.apply(Hj(Roe,Doe,Ra,Fj,Av,Of,Bj,$j,Do,C5).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Ble(){return di.apply(Hj(zoe,Moe,Da,Kj,Ev,kv,qj,Uj,Do,O5).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Tv(){var e=0,t=1,n,r,i,s,l=tr,c=!1,f;function h(g){return g==null||isNaN(g=+g)?f:l(i===0?.5:(g=(s(g)-n)*i,c?Math.max(0,Math.min(1,g)):g))}h.domain=function(g){return arguments.length?([e,t]=g,n=s(e=+e),r=s(t=+t),i=n===r?0:1/(r-n),h):[e,t]},h.clamp=function(g){return arguments.length?(c=!!g,h):c},h.interpolator=function(g){return arguments.length?(l=g,h):l};function p(g){return function(v){var y,w;return arguments.length?([y,w]=v,l=g(y,w),h):[l(0),l(1)]}}return h.range=p(su),h.rangeRound=p(Ej),h.unknown=function(g){return arguments.length?(f=g,h):f},function(g){return s=g,n=g(e),r=g(t),i=n===r?0:1/(r-n),h}}function Ws(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function _5(){var e=Ys(Tv()(tr));return e.copy=function(){return Ws(e,_5())},Ua.apply(e,arguments)}function k5(){var e=Mj(Tv()).domain([1,10]);return e.copy=function(){return Ws(e,k5()).base(e.base())},Ua.apply(e,arguments)}function A5(){var e=Rj(Tv());return e.copy=function(){return Ws(e,A5()).constant(e.constant())},Ua.apply(e,arguments)}function Gj(){var e=Dj(Tv());return e.copy=function(){return Ws(e,Gj()).exponent(e.exponent())},Ua.apply(e,arguments)}function qle(){return Gj.apply(null,arguments).exponent(.5)}function E5(){var e=[],t=tr;function n(r){if(r!=null&&!isNaN(r=+r))return t((jf(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Ds),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,s)=>_se(e,s/r))},n.copy=function(){return E5(t).domain(e)},Ua.apply(n,arguments)}function Pv(){var e=0,t=.5,n=1,r=1,i,s,l,c,f,h=tr,p,g=!1,v;function y(S){return isNaN(S=+S)?v:(S=.5+((S=+p(S))-s)*(r*S<r*s?c:f),h(g?Math.max(0,Math.min(1,S)):S))}y.domain=function(S){return arguments.length?([e,t,n]=S,i=p(e=+e),s=p(t=+t),l=p(n=+n),c=i===s?0:.5/(s-i),f=s===l?0:.5/(l-s),r=s<i?-1:1,y):[e,t,n]},y.clamp=function(S){return arguments.length?(g=!!S,y):g},y.interpolator=function(S){return arguments.length?(h=S,y):h};function w(S){return function(N){var C,E,k;return arguments.length?([C,E,k]=N,h=eoe(S,[C,E,k]),y):[h(0),h(.5),h(1)]}}return y.range=w(su),y.rangeRound=w(Ej),y.unknown=function(S){return arguments.length?(v=S,y):v},function(S){return p=S,i=S(e),s=S(t),l=S(n),c=i===s?0:.5/(s-i),f=s===l?0:.5/(l-s),r=s<i?-1:1,y}}function T5(){var e=Ys(Pv()(tr));return e.copy=function(){return Ws(e,T5())},Ua.apply(e,arguments)}function P5(){var e=Mj(Pv()).domain([.1,1,10]);return e.copy=function(){return Ws(e,P5()).base(e.base())},Ua.apply(e,arguments)}function z5(){var e=Rj(Pv());return e.copy=function(){return Ws(e,z5()).constant(e.constant())},Ua.apply(e,arguments)}function Vj(){var e=Dj(Pv());return e.copy=function(){return Ws(e,Vj()).exponent(e.exponent())},Ua.apply(e,arguments)}function Fle(){return Vj.apply(null,arguments).exponent(.5)}const M5=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:_j,scaleDiverging:T5,scaleDivergingLog:P5,scaleDivergingPow:Vj,scaleDivergingSqrt:Fle,scaleDivergingSymlog:z5,scaleIdentity:d5,scaleImplicit:jS,scaleLinear:u5,scaleLog:h5,scaleOrdinal:Oj,scalePoint:Ese,scalePow:Ij,scaleQuantile:g5,scaleQuantize:v5,scaleRadial:m5,scaleSequential:_5,scaleSequentialLog:k5,scaleSequentialPow:Gj,scaleSequentialQuantile:E5,scaleSequentialSqrt:qle,scaleSequentialSymlog:A5,scaleSqrt:joe,scaleSymlog:p5,scaleThreshold:y5,scaleTime:Ule,scaleUtc:Ble,tickFormat:c5},Symbol.toStringTag,{value:"Module"}));function Kle(e){var t=M5;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(pf(e));if(n in t&&typeof t[n]=="function")return t[n]()}function JP(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=Kle(e);if(r!=null)return r.domain(t).range(n),r}}function Zj(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?JP(e.scale,n,r):JP(t,n,r)}function Hle(e){return"scale".concat(pf(e))}function Gle(e){return Hle(e)in M5}var R5=(e,t,n)=>{if(e!=null){var{scale:r,type:i}=e;if(r==="auto")return i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!t)?"point":i==="category"?"band":"linear";if(typeof r=="string")return Gle(r)?r:"point"}};function Vle(e,t){for(var n=0,r=e.length,i=e[0]<e[e.length-1];n<r;){var s=Math.floor((n+r)/2);(i?e[s]<t:e[s]>t)?n=s+1:r=s}return n}function D5(e,t){if(e){var n=t??e.domain(),r=n.map(s=>{var l;return(l=e(s))!==null&&l!==void 0?l:0}),i=e.range();if(!(n.length===0||i.length<2))return s=>{var l,c,f=Vle(r,s);if(f<=0)return n[0];if(f>=n.length)return n[n.length-1];var h=(l=r[f-1])!==null&&l!==void 0?l:0,p=(c=r[f])!==null&&c!==void 0?c:0;return Math.abs(s-h)<=Math.abs(s-p)?n[f-1]:n[f]}}}function Zle(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):D5(e,void 0)}function ez(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function sg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ez(Object(n),!0).forEach(function(r){Yle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ez(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yle(e,t,n){return(t=Wle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wle(e){var t=Qle(e,"string");return typeof t=="symbol"?t:t+""}function Qle(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _S=[0,"auto"],yn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0,niceTicks:"auto"},I5=(e,t)=>e.cartesianAxis.xAxis[t],ta=(e,t)=>{var n=I5(e,t);return n??yn},bn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:_S,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,niceTicks:"auto",width:vf},L5=(e,t)=>e.cartesianAxis.yAxis[t],na=(e,t)=>{var n=L5(e,t);return n??bn},Xle={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},Yj=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??Xle},or=(e,t,n)=>{switch(t){case"xAxis":return ta(e,n);case"yAxis":return na(e,n);case"zAxis":return Yj(e,n);case"angleAxis":return bj(e,n);case"radiusAxis":return xj(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Jle=(e,t,n)=>{switch(t){case"xAxis":return ta(e,n);case"yAxis":return na(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},_f=(e,t,n)=>{switch(t){case"xAxis":return ta(e,n);case"yAxis":return na(e,n);case"angleAxis":return bj(e,n);case"radiusAxis":return xj(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},$5=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function U5(e,t){return n=>{switch(e){case"xAxis":return"xAxisId"in n&&n.xAxisId===t;case"yAxis":return"yAxisId"in n&&n.yAxisId===t;case"zAxis":return"zAxisId"in n&&n.zAxisId===t;case"angleAxis":return"angleAxisId"in n&&n.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in n&&n.radiusAxisId===t;default:return!1}}}var B5=e=>e.graphicalItems.cartesianItems,ece=ne([On,Nv],U5),q5=(e,t,n)=>e.filter(n).filter(r=>t?.includeHidden===!0?!0:!r.hide),ou=ne([B5,or,ece],q5,{memoizeOptions:{resultEqualityCheck:Ov}}),F5=ne([ou],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(jj)),K5=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),tce=ne([ou],K5),H5=e=>e.map(t=>t.data).filter(Boolean).flat(1),nce=ne([ou],e=>e.some(t=>!t.data)),G5=ne([ou],H5,{memoizeOptions:{resultEqualityCheck:Ov}}),V5=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},Wj=ne([G5,bv],V5),rce=(e,t,n)=>t?.dataKey!=null?e.map(r=>({value:Cn(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:Cn(i,r)}))):e.map(r=>({value:r})),Z5=(e,t,n,r,i,s)=>{var{chartData:l=[],dataStartIndex:c,dataEndIndex:f}=r,h=rce(e,t,n);if(i&&t?.dataKey!=null&&s.length>0){var p=l.slice(c,f+1),g=p.map(v=>({value:Cn(v,t.dataKey)})).filter(v=>v.value!=null);return[...g,...h]}return h},kf=ne([Wj,or,ou,bv,nce,G5],Z5);function Ec(e){if(ai(e)||e instanceof Date){var t=Number(e);if(He(t))return t}}function tz(e){if(Array.isArray(e)){var t=[Ec(e[0]),Ec(e[1])];return Vi(t)?t:void 0}var n=Ec(e);if(n!=null)return[n,n]}function Ji(e){return e.map(Ec).filter(vr)}function ice(e,t){var n=Ec(e),r=Ec(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var ace=ne([kf],e=>e?.map(t=>t.value).sort(ice));function Y5(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function sce(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!Wi(t))r=t;else if(Array.isArray(t)){var i=Ji(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:Ji(n.flatMap(s=>{var l=Cn(e,s.dataKey),c,f;if(Array.isArray(l)?[c,f]=l:c=f=l,!(!He(c)||!He(f)))return[r-c,r+f]}))}var Sn=e=>{var t=_n(e),n=au(e);return _f(e,t,n)},Fc=ne([Sn],e=>e?.dataKey),oce=ne([F5,bv,Sn],e5),W5=(e,t,n,r)=>{var i={},s=t.reduce((l,c)=>{if(c.stackId==null)return l;var f=l[c.stackId];return f==null&&(f=[]),f.push(c),l[c.stackId]=f,l},i);return Object.fromEntries(Object.entries(s).map(l=>{var[c,f]=l,h=r?[...f].reverse():f,p=h.map(Sj);return[c,{stackedData:Une(e,p,n),graphicalItems:h}]}))},Q5=ne([oce,F5,xv,V$],W5),X5=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:s}=t;if(r==null&&n!=="zAxis"){var l=Kne(e,i,s);if(!(l!=null&&l[0]===0&&l[1]===0))return l}},lce=ne([or],e=>e.allowDataOverflow),Qj=e=>{var t;if(e==null||!("domain"in e))return _S;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Ji(e.ticks);return[Math.min(...n),Math.max(...n)]}if(e.type==="category")return e.ticks.map(String)}return(t=e?.domain)!==null&&t!==void 0?t:_S},J5=ne([or],Qj),e3=ne([J5,lce],D$),cce=ne([Q5,Ei,On,e3],X5,{memoizeOptions:{resultEqualityCheck:Cv}}),Xj=e=>e.errorBars,uce=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>Y5(n,r)),og=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.filter(Boolean);if(i.length!==0){var s=i.flat(),l=Math.min(...s),c=Math.max(...s);return[l,c]}},t3=function(t,n,r,i,s){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],c,f;if(r.length>0&&r.forEach(h=>{var p,g=h.data!=null?[...h.data]:l,v=(p=i[h.id])===null||p===void 0?void 0:p.filter(y=>Y5(s,y));g.forEach(y=>{var w,S=Cn(y,(w=n.dataKey)!==null&&w!==void 0?w:h.dataKey),N=sce(y,S,v);if(N.length>=2){var C=Math.min(...N),E=Math.max(...N);(c==null||C<c)&&(c=C),(f==null||E>f)&&(f=E)}var k=tz(S);k!=null&&(c=c==null?k[0]:Math.min(c,k[0]),f=f==null?k[1]:Math.max(f,k[1]))})}),n?.dataKey!=null&&r.length===0&&t.forEach(h=>{var p=tz(Cn(h,n.dataKey));p!=null&&(c=c==null?p[0]:Math.min(c,p[0]),f=f==null?p[1]:Math.max(f,p[1]))}),He(c)&&He(f))return[c,f]},dce=ne([Wj,or,tce,Xj,On,Jae],t3,{memoizeOptions:{resultEqualityCheck:Cv}});function fce(e){var{value:t}=e;if(ai(t)||t instanceof Date)return t}var hce=(e,t,n)=>{var r=e.map(fce).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&cL(r))?R$(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},n3=e=>e.referenceElements.dots,lu=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),pce=ne([n3,On,Nv],lu),r3=e=>e.referenceElements.areas,mce=ne([r3,On,Nv],lu),i3=e=>e.referenceElements.lines,gce=ne([i3,On,Nv],lu),a3=(e,t)=>{if(e!=null){var n=Ji(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},vce=ne(pce,On,a3),s3=(e,t)=>{if(e!=null){var n=Ji(e.flatMap(r=>[t==="xAxis"?r.x1:r.y1,t==="xAxis"?r.x2:r.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},yce=ne([mce,On],s3);function bce(e){var t;if(e.x!=null)return Ji([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:Ji(n)}function xce(e){var t;if(e.y!=null)return Ji([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:Ji(n)}var o3=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?bce(r):xce(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},wce=ne([gce,On],o3),Sce=ne(vce,wce,yce,(e,t,n)=>og(e,n,t)),l3=(e,t,n,r,i,s,l,c)=>{if(n!=null)return n;var f=l==="vertical"&&c==="xAxis"||l==="horizontal"&&c==="yAxis",h=f?og(r,s,i):og(s,i);return tse(t,h,e.allowDataOverflow)},jce=ne([or,J5,e3,cce,dce,Sce,$t,On],l3,{memoizeOptions:{resultEqualityCheck:Cv}}),Nce=[0,1],c3=(e,t,n,r,i,s,l)=>{if(!((e==null||n==null||n.length===0)&&l===void 0)){var{dataKey:c,type:f}=e,h=ea(t,s);if(h&&c==null){var p;return R$(0,(p=n?.length)!==null&&p!==void 0?p:0)}return f==="category"?hce(r,e,h):i==="expand"&&!h?Nce:l}},Jj=ne([or,$t,Wj,kf,xv,On,jce],c3),cu=ne([or,$5,gj],R5),u3=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=Qj(t),s=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&Vi(e)){if(s)return dP(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return fP(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(s&&Vi(e))return dP(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&Vi(e))return fP(e,t.tickCount,t.allowDecimals,"adaptive")}}},eN=ne([Jj,_f,cu],u3),d3=(e,t,n,r)=>{if(r!=="angleAxis"&&e?.type==="number"&&Vi(t)&&Array.isArray(n)&&n.length>0){var i,s,l=t[0],c=(i=n[0])!==null&&i!==void 0?i:0,f=t[1],h=(s=n[n.length-1])!==null&&s!==void 0?s:0;return[Math.min(l,c),Math.max(f,h)]}return t},Cce=ne([or,Jj,eN,On],d3),Oce=ne(kf,or,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Ji(e.map(g=>g.value))).sort((g,v)=>g-v),i=r[0],s=r[r.length-1];if(i==null||s==null)return 1/0;var l=s-i;if(l===0)return 1/0;for(var c=0;c<r.length-1;c++){var f=r[c],h=r[c+1];if(!(f==null||h==null)){var p=h-f;n=Math.min(n,p)}}return n/l}}),f3=ne(Oce,$t,sse,Un,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!He(e))return 0;var s=t==="vertical"?r.height:r.width;if(i==="gap")return e*s/2;if(i==="no-gap"){var l=Bs(n,e*s),c=e*s/2;return c-l-(c-l)/s*l}return 0}),_ce=(e,t,n)=>{var r=ta(e,t);return r==null||typeof r.padding!="string"?0:f3(e,"xAxis",t,n,r.padding)},kce=(e,t,n)=>{var r=na(e,t);return r==null||typeof r.padding!="string"?0:f3(e,"yAxis",t,n,r.padding)},Ace=ne(ta,_ce,(e,t)=>{var n,r;if(e==null)return{left:0,right:0};var{padding:i}=e;return typeof i=="string"?{left:t,right:t}:{left:((n=i.left)!==null&&n!==void 0?n:0)+t,right:((r=i.right)!==null&&r!==void 0?r:0)+t}}),Ece=ne(na,kce,(e,t)=>{var n,r;if(e==null)return{top:0,bottom:0};var{padding:i}=e;return typeof i=="string"?{top:t,bottom:t}:{top:((n=i.top)!==null&&n!==void 0?n:0)+t,bottom:((r=i.bottom)!==null&&r!==void 0?r:0)+t}}),Tce=ne([Un,Ace,mv,pv,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:s}=r;return i?[s.left,n.width-s.right]:[e.left+t.left,e.left+e.width-t.right]}),Pce=ne([Un,$t,Ece,mv,pv,(e,t,n)=>n],(e,t,n,r,i,s)=>{var{padding:l}=i;return s?[r.height-l.bottom,l.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),Af=(e,t,n,r)=>{var i;switch(t){case"xAxis":return Tce(e,n,r);case"yAxis":return Pce(e,n,r);case"zAxis":return(i=Yj(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return Q$(e);case"radiusAxis":return X$(e,n);default:return}},h3=ne([or,Af],wv),zce=ne([cu,Cce],mse),tN=ne([or,cu,zce,h3],Zj),p3=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:s}=n,l=ea(e,r);if(l&&(i==="number"||s!=="auto"))return t.map(c=>c.value)}},nN=ne([$t,kf,_f,On],p3),Kc=ne([tN],Nj);ne([tN],Zle);ne([tN,ace],D5);ne([ou,Xj,On],uce);function m3(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var zv=(e,t)=>t,Mv=(e,t,n)=>n,Mce=ne(fv,zv,Mv,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(m3)),Rce=ne(hv,zv,Mv,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(m3)),g3=(e,t)=>({width:e.width,height:t.height}),Dce=(e,t)=>{var n=typeof t.width=="number"?t.width:vf;return{width:n,height:e.height}},Ice=ne(Un,ta,g3),Lce=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},$ce=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},Uce=ne($a,Un,Mce,zv,Mv,(e,t,n,r,i)=>{var s={},l;return n.forEach(c=>{var f=g3(t,c);l==null&&(l=Lce(t,r,e));var h=r==="top"&&!i||r==="bottom"&&i;s[c.id]=l-Number(h)*f.height,l+=(h?-1:1)*f.height}),s}),Bce=ne(La,Un,Rce,zv,Mv,(e,t,n,r,i)=>{var s={},l;return n.forEach(c=>{var f=Dce(t,c);l==null&&(l=$ce(t,r,e));var h=r==="left"&&!i||r==="right"&&i;s[c.id]=l-Number(h)*f.width,l+=(h?-1:1)*f.width}),s}),qce=(e,t)=>{var n=ta(e,t);if(n!=null)return Uce(e,n.orientation,n.mirror)},Fce=ne([Un,ta,qce,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),Kce=(e,t)=>{var n=na(e,t);if(n!=null)return Bce(e,n.orientation,n.mirror)},Hce=ne([Un,na,Kce,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),Gce=ne(Un,na,(e,t)=>{var n=typeof t.width=="number"?t.width:vf;return{width:n,height:e.height}}),v3=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:s,dataKey:l}=n,c=ea(e,r),f=t.map(p=>p.value),h=f.filter(p=>p!=null);if(l&&c&&s==="category"&&i&&cL(h))return f}},rN=ne([$t,kf,or,On],v3),nz=ne([$t,Jle,cu,Kc,rN,nN,Af,eN,On],(e,t,n,r,i,s,l,c,f)=>{if(t!=null){var h=ea(e,f);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:f,categoricalDomain:s,duplicateDomain:i,isCategorical:h,niceTicks:c,range:l,realScaleType:n,scale:r}}}),Vce=(e,t,n,r,i,s,l,c,f)=>{if(!(t==null||r==null)){var h=ea(e,f),{type:p,ticks:g,tickCount:v}=t,y=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,w=p==="category"&&r.bandwidth?r.bandwidth()/y:0;w=f==="angleAxis"&&s!=null&&s.length>=2?ei(s[0]-s[1])*2*w:w;var S=g||i;return S?S.map((N,C)=>{var E=l?l.indexOf(N):N,k=r.map(E);return He(k)?{index:C,coordinate:k+w,value:N,offset:w}:null}).filter(vr):h&&c?c.map((N,C)=>{var E=r.map(N);return He(E)?{coordinate:E+w,value:N,index:C,offset:w}:null}).filter(vr):r.ticks?r.ticks(v).map((N,C)=>{var E=r.map(N);return He(E)?{coordinate:E+w,value:N,index:C,offset:w}:null}).filter(vr):r.domain().map((N,C)=>{var E=r.map(N);return He(E)?{coordinate:E+w,value:l?l[N]:N,index:C,offset:w}:null}).filter(vr)}},y3=ne([$t,_f,cu,Kc,eN,Af,rN,nN,On],Vce),Zce=(e,t,n,r,i,s,l)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var c=ea(e,l),{tickCount:f}=t,h=0;return h=l==="angleAxis"&&r?.length>=2?ei(r[0]-r[1])*2*h:h,c&&s?s.map((p,g)=>{var v=n.map(p);return He(v)?{coordinate:v+h,value:p,index:g,offset:h}:null}).filter(vr):n.ticks?n.ticks(f).map((p,g)=>{var v=n.map(p);return He(v)?{coordinate:v+h,value:p,index:g,offset:h}:null}).filter(vr):n.domain().map((p,g)=>{var v=n.map(p);return He(v)?{coordinate:v+h,value:i?i[p]:p,index:g,offset:h}:null}).filter(vr)}},b3=ne([$t,_f,Kc,Af,rN,nN,On],Zce),x3=ne(or,Kc,(e,t)=>{if(!(e==null||t==null))return sg(sg({},e),{},{scale:t})}),Yce=ne([or,cu,Jj,h3],Zj),Wce=ne([Yce],Nj);ne((e,t,n)=>Yj(e,n),Wce,(e,t)=>{if(!(e==null||t==null))return sg(sg({},e),{},{scale:t})});var Qce=ne([$t,fv,hv],(e,t,n)=>{switch(e){case"horizontal":return t.some(r=>r.reversed)?"right-to-left":"left-to-right";case"vertical":return n.some(r=>r.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),Xce=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};ne([Xce],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,i=e[0];for(var s of e){var l=Math.abs(s.coordinate-t);l<r&&(r=l,i=s)}return(n=i)===null||n===void 0?void 0:n.value}});var w3=e=>e.options.defaultTooltipEventType,S3=e=>e.options.validateTooltipEventTypes;function j3(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function Ef(e,t){var n=w3(e),r=S3(e);return j3(t,n,r)}function Jce(e){return Re(t=>Ef(t,e))}var N3=(e,t)=>{var n,r=Number(t);if(!(Wi(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},eue=e=>e.tooltip.settings,Os={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},tue={itemInteraction:{click:Os,hover:Os},axisInteraction:{click:Os,hover:Os},keyboardInteraction:Os,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},C3=Yn({name:"tooltip",initialState:tue,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:At()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ti(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:At()},removeTooltipEntrySettings:{reducer(e,t){var n=ti(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:At()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:nue,replaceTooltipEntrySettings:rue,removeTooltipEntrySettings:iue,setTooltipSettingsState:aue,setActiveMouseOverItemIndex:sue,mouseLeaveItem:Eye,mouseLeaveChart:O3,setActiveClickItemIndex:Tye,setMouseOverAxisIndex:_3,setMouseClickAxisIndex:oue,setSyncInteraction:jd,setKeyboardInteraction:lg}=C3.actions,lue=C3.reducer;function rz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Tp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rz(Object(n),!0).forEach(function(r){cue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cue(e,t,n){return(t=uue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uue(e){var t=due(e,"string");return typeof t=="symbol"?t:t+""}function due(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fue(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function hue(e){return e.index!=null}var k3=(e,t,n,r)=>{if(t==null)return Os;var i=fue(e,t,n);if(i==null)return Os;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var s=e.settings.active===!0;if(hue(i)){if(s)return Tp(Tp({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return Tp(Tp({},Os),{},{coordinate:i.coordinate})};function pue(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function mue(e,t){var n=pue(e),r=t[0],i=t[1];if(n===void 0)return!1;var s=Math.min(r,i),l=Math.max(r,i);return n>=s&&n<=l}function gue(e,t,n){if(n==null||t==null)return!0;var r=Cn(e,t);return r==null||!Vi(n)?!0:mue(r,n)}var Ed=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var s=Number(i);if(!He(s))return i;var l=0,c=1/0;t.length>0&&(c=t.length-1);var f=Math.max(l,Math.min(s,c)),h=t[f];return h==null||gue(h,n,r)?String(f):null},A3=(e,t,n,r,i,s,l)=>{if(s!=null){var c=l[0],f=c?.getPosition(s);if(f!=null)return f;var h=i?.[Number(s)];if(h)return n==="horizontal"?{x:h.coordinate,y:(r.top+t)/2}:{x:(r.left+e)/2,y:h.coordinate}}},E3=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(n==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var s=e.tooltipItemPayloads[0];return s!=null?[s]:[]}return e.tooltipItemPayloads.filter(l=>{var c;return((c=l.settings)===null||c===void 0?void 0:c.graphicalItemId)===i})},T3=e=>e.options.tooltipPayloadSearcher,uu=e=>e.tooltip;function iz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function az(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iz(Object(n),!0).forEach(function(r){vue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vue(e,t,n){return(t=yue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yue(e){var t=bue(e,"string");return typeof t=="symbol"?t:t+""}function bue(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xue(e){if(typeof e=="string"||typeof e=="number")return e}function wue(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function Sue(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function sz(e){if(typeof e=="string")return e}function jue(e){if(!(e==null||typeof e!="object")){var t="name"in e?xue(e.name):void 0,n="unit"in e?wue(e.unit):void 0,r="dataKey"in e?Sue(e.dataKey):void 0,i="payload"in e?e.payload:void 0,s="color"in e?sz(e.color):void 0,l="fill"in e?sz(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:s,fill:l}}}function Nue(e,t){return e??t}var P3=(e,t,n,r,i,s,l)=>{if(!(t==null||s==null)){var{chartData:c,computedData:f,dataStartIndex:h,dataEndIndex:p}=n,g=[];return e.reduce((v,y)=>{var w,{dataDefinedOnItem:S,settings:N}=y,C=Nue(S,c),E=Array.isArray(C)?s$(C,h,p):C,k=(w=N?.dataKey)!==null&&w!==void 0?w:r,O=N?.nameKey,T;if(r&&Array.isArray(E)&&!Array.isArray(E[0])&&l==="axis"?T=uL(E,r,i):T=s(E,t,f,O),Array.isArray(T))T.forEach(A=>{var z,R,q=jue(A),U=q?.name,L=q?.dataKey,ae=q?.payload,pe=az(az({},N),{},{name:U,unit:q?.unit,color:(z=q?.color)!==null&&z!==void 0?z:N?.color,fill:(R=q?.fill)!==null&&R!==void 0?R:N?.fill});v.push(JT({tooltipEntrySettings:pe,dataKey:L,payload:ae,value:Cn(ae,L),name:U==null?void 0:String(U)}))});else{var P;v.push(JT({tooltipEntrySettings:N,dataKey:k,payload:T,value:Cn(T,k),name:(P=Cn(T,O))!==null&&P!==void 0?P:N?.name}))}return v},g)}},iN=ne([Sn,$5,gj],R5),Cue=ne([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),Oue=ne([_n,au],U5),ml=ne([Cue,Sn,Oue],q5,{memoizeOptions:{resultEqualityCheck:Ov}}),_ue=ne([ml],e=>e.filter(jj)),z3=ne([ml],H5,{memoizeOptions:{resultEqualityCheck:Ov}}),kue=ne([ml],e=>e.some(t=>!t.data)),il=ne([z3,Ei],V5),Aue=ne([_ue,Ei,Sn],e5),aN=ne([il,Sn,ml,Ei,kue,z3],Z5),M3=ne([Sn],Qj),Eue=ne([Sn],e=>e.allowDataOverflow),R3=ne([M3,Eue],D$),Tue=ne([ml],e=>e.filter(jj)),Pue=ne([Aue,Tue,xv,V$],W5),zue=ne([Pue,Ei,_n,R3],X5),Mue=ne([ml],K5),Rue=ne([il,Sn,Mue,Xj,_n,ese],t3,{memoizeOptions:{resultEqualityCheck:Cv}}),Due=ne([n3,_n,au],lu),Iue=ne([Due,_n],a3),Lue=ne([r3,_n,au],lu),$ue=ne([Lue,_n],s3),Uue=ne([i3,_n,au],lu),Bue=ne([Uue,_n],o3),que=ne([Iue,Bue,$ue],og),Fue=ne([Sn,M3,R3,zue,Rue,que,$t,_n],l3),Hc=ne([Sn,$t,il,aN,xv,_n,Fue],c3),Kue=ne([Hc,Sn,iN],u3),Hue=ne([Sn,Hc,Kue,_n],d3),D3=e=>{var t=_n(e),n=au(e),r=!1;return Af(e,t,n,r)},I3=ne([Sn,D3],wv),Gue=ne([Sn,iN,Hue,I3],Zj),L3=ne([Gue],Nj),Vue=ne([$t,aN,Sn,_n],v3),Zue=ne([$t,aN,Sn,_n],p3),Yue=(e,t,n,r,i,s,l,c)=>{if(t){var{type:f}=t,h=ea(e,c);if(r){var p=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,g=f==="category"&&r.bandwidth?r.bandwidth()/p:0;return g=c==="angleAxis"&&i!=null&&i?.length>=2?ei(i[0]-i[1])*2*g:g,h&&l?l.map((v,y)=>{var w=r.map(v);return He(w)?{coordinate:w+g,value:v,index:y,offset:g}:null}).filter(vr):r.domain().map((v,y)=>{var w=r.map(v);return He(w)?{coordinate:w+g,value:s?s[v]:v,index:y,offset:g}:null}).filter(vr)}}},Ba=ne([$t,Sn,iN,L3,D3,Vue,Zue,_n],Yue),sN=ne([w3,S3,eue],(e,t,n)=>j3(n.shared,e,t)),$3=e=>e.tooltip.settings.trigger,oN=e=>e.tooltip.settings.defaultIndex,Tf=ne([uu,sN,$3,oN],k3),rf=ne([Tf,il,Fc,Hc],Ed),U3=ne([Ba,rf],N3),Wue=ne([Tf],e=>{if(e)return e.dataKey}),Que=ne([Tf],e=>{if(e)return e.graphicalItemId}),B3=ne([uu,sN,$3,oN],E3),Xue=ne([La,$a,$t,Un,Ba,oN,B3],A3),Jue=ne([Tf,Xue],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),ede=ne([Tf],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),tde=ne([B3,rf,Ei,Fc,U3,T3,sN],P3),nde=ne([tde],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function oz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function lz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oz(Object(n),!0).forEach(function(r){rde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rde(e,t,n){return(t=ide(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ide(e){var t=ade(e,"string");return typeof t=="symbol"?t:t+""}function ade(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var sde=()=>Re(Sn),ode=()=>{var e=sde(),t=Re(Ba),n=Re(L3);return Lm(!e||!n?void 0:lz(lz({},e),{},{scale:n}),t)};function cz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function cc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cz(Object(n),!0).forEach(function(r){lde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lde(e,t,n){return(t=cde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cde(e){var t=ude(e,"string");return typeof t=="symbol"?t:t+""}function ude(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var dde=(e,t,n,r)=>{var i=t.find(s=>s&&s.index===n);if(i){if(e==="horizontal")return{x:i.coordinate,y:r.relativeY};if(e==="vertical")return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},fde=(e,t,n,r)=>{var i=t.find(h=>h&&h.index===n);if(i){if(e==="centric"){var s=i.coordinate,{radius:l}=r;return cc(cc(cc({},r),In(r.cx,r.cy,l,s)),{},{angle:s,radius:l})}var c=i.coordinate,{angle:f}=r;return cc(cc(cc({},r),In(r.cx,r.cy,c,f)),{},{angle:f,radius:c})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function hde(e,t){var{relativeX:n,relativeY:r}=e;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var q3=(e,t,n,r,i)=>{var s,l=(s=t?.length)!==null&&s!==void 0?s:0;if(l<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var c=0;c<l;c++){var f,h,p,g,v,y=c>0?(f=n[c-1])===null||f===void 0?void 0:f.coordinate:(h=n[l-1])===null||h===void 0?void 0:h.coordinate,w=(p=n[c])===null||p===void 0?void 0:p.coordinate,S=c>=l-1?(g=n[0])===null||g===void 0?void 0:g.coordinate:(v=n[c+1])===null||v===void 0?void 0:v.coordinate,N=void 0;if(!(y==null||w==null||S==null))if(ei(w-y)!==ei(S-w)){var C=[];if(ei(S-w)===ei(i[1]-i[0])){N=S;var E=w+i[1]-i[0];C[0]=Math.min(E,(E+y)/2),C[1]=Math.max(E,(E+y)/2)}else{N=y;var k=S+i[1]-i[0];C[0]=Math.min(w,(k+w)/2),C[1]=Math.max(w,(k+w)/2)}var O=[Math.min(w,(N+w)/2),Math.max(w,(N+w)/2)];if(e>O[0]&&e<=O[1]||e>=C[0]&&e<=C[1]){var T;return(T=n[c])===null||T===void 0?void 0:T.index}}else{var P=Math.min(y,S),A=Math.max(y,S);if(e>(P+w)/2&&e<=(A+w)/2){var z;return(z=n[c])===null||z===void 0?void 0:z.index}}}else if(t)for(var R=0;R<l;R++){var q=t[R];if(q!=null){var U=t[R+1],L=t[R-1];if(R===0&&U!=null&&e<=(q.coordinate+U.coordinate)/2||R===l-1&&L!=null&&e>(q.coordinate+L.coordinate)/2||R>0&&R<l-1&&L!=null&&U!=null&&e>(q.coordinate+L.coordinate)/2&&e<=(q.coordinate+U.coordinate)/2)return q.index}}return-1},F3=()=>Re(gj),lN=(e,t)=>t,K3=(e,t,n)=>n,cN=(e,t,n,r)=>r,pde=ne(Ba,e=>nv(e,t=>t.coordinate)),uN=ne([uu,lN,K3,cN],k3),dN=ne([uN,il,Fc,Hc],Ed),mde=(e,t,n)=>{if(t!=null){var r=uu(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},H3=ne([uu,lN,K3,cN],E3),cg=ne([La,$a,$t,Un,Ba,cN,H3],A3),gde=ne([uN,cg],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),G3=ne([Ba,dN],N3),vde=ne([H3,dN,Ei,Fc,G3,T3,lN],P3),yde=ne([uN,dN],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),bde=(e,t,n,r,i,s,l)=>{if(!(!e||!n||!r||!i)&&hde(e,l)){var c=Hne(e,t),f=q3(c,s,i,n,r),h=dde(t,i,f,e);return{activeIndex:String(f),activeCoordinate:h}}},xde=(e,t,n,r,i,s,l)=>{if(!(!e||!r||!i||!s||!n)){var c=Bae(e,n);if(c){var f=Gne(c,t),h=q3(f,l,s,r,i),p=fde(t,s,h,c);return{activeIndex:String(h),activeCoordinate:p}}}},wde=(e,t,n,r,i,s,l,c)=>{if(!(!e||!t||!r||!i||!s))return t==="horizontal"||t==="vertical"?bde(e,t,r,i,s,l,c):xde(e,t,n,r,i,s,l)},Sde=ne(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),jde=ne(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(Zn)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:pse}});function uz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function dz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uz(Object(n),!0).forEach(function(r){Nde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nde(e,t,n){return(t=Cde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cde(e){var t=Ode(e,"string");return typeof t=="symbol"?t:t+""}function Ode(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _de={},kde={zIndexMap:Object.values(Zn).reduce((e,t)=>dz(dz({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),_de)},Ade=new Set(Object.values(Zn));function Ede(e){return Ade.has(e)}var V3=Yn({name:"zIndex",initialState:kde,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:At()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!Ede(n)&&delete e.zIndexMap[n])},prepare:At()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:r,isPanorama:i}=t.payload;e.zIndexMap[n]?i?e.zIndexMap[n].panoramaElement=r:e.zIndexMap[n].element=r:e.zIndexMap[n]={consumers:0,element:i?void 0:r,panoramaElement:i?r:void 0}},prepare:At()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:At()}}}),{registerZIndexPortal:Tde,unregisterZIndexPortal:Yx,registerZIndexPortalElement:Pde,unregisterZIndexPortalElement:zde}=V3.actions,Mde=V3.reducer;function ra(e){var{zIndex:t,children:n}=e,r=Cre(),i=r&&t!==void 0&&t!==0,s=sr(),l=x.useRef(void 0),c=x.useRef(new Set),f=Ht(),h=Re(g=>Sde(g,t,s));if(x.useLayoutEffect(()=>{if(!i){var g=c.current;g.forEach(y=>{f(Yx({zIndex:y}))}),g.clear(),l.current=void 0;return}if(c.current.has(t)||(f(Tde({zIndex:t})),c.current.add(t)),h){l.current=h;var v=c.current;v.forEach(y=>{y!==t&&(f(Yx({zIndex:y})),v.delete(y))})}},[f,t,i,h]),x.useLayoutEffect(()=>{var g=c.current;return()=>{g.forEach(v=>{f(Yx({zIndex:v}))}),g.clear()}},[f]),!i)return n;var p=h??l.current;return p?ol.createPortal(n,p):null}function kS(){return kS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kS.apply(null,arguments)}function fz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Pp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fz(Object(n),!0).forEach(function(r){Rde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rde(e,t,n){return(t=Dde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dde(e){var t=Ide(e,"string");return typeof t=="symbol"?t:t+""}function Ide(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Lde(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return x.isValidElement(t)?x.cloneElement(t,r):x.createElement(n,r)}function $de(e){var t,{coordinate:n,payload:r,index:i,offset:s,tooltipAxisBandSize:l,layout:c,cursor:f,tooltipEventType:h,chartName:p}=e,g=n,v=r,y=i;if(!f||!g||p!=="ScatterChart"&&h!=="axis")return null;var w,S,N;if(p==="ScatterChart")w=g,S=Jie,N=Zn.cursorLine;else if(p==="BarChart")w=eae(c,g,s,l),S=Tae,N=Zn.cursorRectangle;else if(c==="radial"&&hL(g)){var{cx:C,cy:E,radius:k,startAngle:O,endAngle:T}=z$(g);w={cx:C,cy:E,startAngle:O,endAngle:T,innerRadius:k,outerRadius:k},S=Hae,N=Zn.cursorLine}else w={points:Gae(c,g,s)},S=Qp,N=Zn.cursorLine;var P=typeof f=="object"&&"className"in f?f.className:void 0,A=Pp(Pp(Pp(Pp({stroke:"#ccc",pointerEvents:"none"},s),w),Qg(f)),{},{payload:v,payloadIndex:y,className:ft("recharts-tooltip-cursor",P)});return x.createElement(ra,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:N},x.createElement(Lde,{cursor:f,cursorComp:S,cursorProps:A}))}function Ude(e){var t=ode(),n=g$(),r=nu(),i=F3();return t==null||n==null||r==null||i==null?null:x.createElement($de,kS({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var Z3=x.createContext(null),Bde=()=>x.useContext(Z3),Wx={exports:{}},hz;function qde(){return hz||(hz=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(f,h,p){this.fn=f,this.context=h,this.once=p||!1}function s(f,h,p,g,v){if(typeof p!="function")throw new TypeError("The listener must be a function");var y=new i(p,g||f,v),w=n?n+h:h;return f._events[w]?f._events[w].fn?f._events[w]=[f._events[w],y]:f._events[w].push(y):(f._events[w]=y,f._eventsCount++),f}function l(f,h){--f._eventsCount===0?f._events=new r:delete f._events[h]}function c(){this._events=new r,this._eventsCount=0}c.prototype.eventNames=function(){var h=[],p,g;if(this._eventsCount===0)return h;for(g in p=this._events)t.call(p,g)&&h.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(p)):h},c.prototype.listeners=function(h){var p=n?n+h:h,g=this._events[p];if(!g)return[];if(g.fn)return[g.fn];for(var v=0,y=g.length,w=new Array(y);v<y;v++)w[v]=g[v].fn;return w},c.prototype.listenerCount=function(h){var p=n?n+h:h,g=this._events[p];return g?g.fn?1:g.length:0},c.prototype.emit=function(h,p,g,v,y,w){var S=n?n+h:h;if(!this._events[S])return!1;var N=this._events[S],C=arguments.length,E,k;if(N.fn){switch(N.once&&this.removeListener(h,N.fn,void 0,!0),C){case 1:return N.fn.call(N.context),!0;case 2:return N.fn.call(N.context,p),!0;case 3:return N.fn.call(N.context,p,g),!0;case 4:return N.fn.call(N.context,p,g,v),!0;case 5:return N.fn.call(N.context,p,g,v,y),!0;case 6:return N.fn.call(N.context,p,g,v,y,w),!0}for(k=1,E=new Array(C-1);k<C;k++)E[k-1]=arguments[k];N.fn.apply(N.context,E)}else{var O=N.length,T;for(k=0;k<O;k++)switch(N[k].once&&this.removeListener(h,N[k].fn,void 0,!0),C){case 1:N[k].fn.call(N[k].context);break;case 2:N[k].fn.call(N[k].context,p);break;case 3:N[k].fn.call(N[k].context,p,g);break;case 4:N[k].fn.call(N[k].context,p,g,v);break;default:if(!E)for(T=1,E=new Array(C-1);T<C;T++)E[T-1]=arguments[T];N[k].fn.apply(N[k].context,E)}}return!0},c.prototype.on=function(h,p,g){return s(this,h,p,g,!1)},c.prototype.once=function(h,p,g){return s(this,h,p,g,!0)},c.prototype.removeListener=function(h,p,g,v){var y=n?n+h:h;if(!this._events[y])return this;if(!p)return l(this,y),this;var w=this._events[y];if(w.fn)w.fn===p&&(!v||w.once)&&(!g||w.context===g)&&l(this,y);else{for(var S=0,N=[],C=w.length;S<C;S++)(w[S].fn!==p||v&&!w[S].once||g&&w[S].context!==g)&&N.push(w[S]);N.length?this._events[y]=N.length===1?N[0]:N:l(this,y)}return this},c.prototype.removeAllListeners=function(h){var p;return h?(p=n?n+h:h,this._events[p]&&l(this,p)):(this._events=new r,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c})(Wx)),Wx.exports}var Fde=qde();const Kde=qs(Fde);var af=new Kde,AS="recharts.syncEvent.tooltip",pz="recharts.syncEvent.brush",Hde=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!Wi(n))return e[n]}},Gde={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},Y3=Yn({name:"options",initialState:Gde,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),Vde=Y3.reducer,{createEventEmitter:Zde}=Y3.actions;function Yde(e){return e.tooltip.syncInteraction}var Wde={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},W3=Yn({name:"chartData",initialState:Wde,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:n,endIndex:r}=t.payload;n!=null&&(e.dataStartIndex=n),r!=null&&(e.dataEndIndex=r)}}}),{setChartData:mz,setDataStartEndIndexes:Qde,setComputedData:Pye}=W3.actions,Xde=W3.reducer,Jde=["x","y"];function gz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function uc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gz(Object(n),!0).forEach(function(r){efe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function efe(e,t,n){return(t=tfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tfe(e){var t=nfe(e,"string");return typeof t=="symbol"?t:t+""}function nfe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rfe(e,t){if(e==null)return{};var n,r,i=ife(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ife(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function afe(){var e=Re(vj),t=Re(yj),n=Ht(),r=Re(Z$),i=Re(Ba),s=nu(),l=yf(),c=Re(f=>f.rootProps.className);x.useEffect(()=>{if(e==null)return tu;var f=(h,p,g)=>{if(t!==g&&e===h){if(p.payload.active===!1){n(jd({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r==="index"){var v;if(l&&p!==null&&p!==void 0&&(v=p.payload)!==null&&v!==void 0&&v.coordinate&&p.payload.sourceViewBox){var y=p.payload.coordinate,{x:w,y:S}=y,N=rfe(y,Jde),{x:C,y:E,width:k,height:O}=p.payload.sourceViewBox,T=uc(uc({},N),{},{x:l.x+(k?(w-C)/k:0)*l.width,y:l.y+(O?(S-E)/O:0)*l.height});n(uc(uc({},p),{},{payload:uc(uc({},p.payload),{},{coordinate:T})}))}else n(p);return}if(i!=null){var P;if(typeof r=="function"){var A={activeTooltipIndex:p.payload.index==null?void 0:Number(p.payload.index),isTooltipActive:p.payload.active,activeIndex:p.payload.index==null?void 0:Number(p.payload.index),activeLabel:p.payload.label,activeDataKey:p.payload.dataKey,activeCoordinate:p.payload.coordinate},z=r(i,A);P=i[z]}else r==="value"&&(P=i.find(V=>String(V.value)===p.payload.label));var{coordinate:R}=p.payload;if(R==null||l==null){n(jd({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(P==null){n(jd({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:void 0}));return}var{x:q,y:U}=R,L=Math.min(q,l.x+l.width),ae=Math.min(U,l.y+l.height),pe={x:s==="horizontal"?P.coordinate:L,y:s==="horizontal"?ae:P.coordinate},ge=jd({active:p.payload.active,coordinate:pe,dataKey:p.payload.dataKey,index:String(P.index),label:p.payload.label,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:p.payload.graphicalItemId});n(ge)}}};return af.on(AS,f),()=>{af.off(AS,f)}},[c,n,t,e,r,i,s,l])}function sfe(){var e=Re(vj),t=Re(yj),n=Ht();x.useEffect(()=>{if(e==null)return tu;var r=(i,s,l)=>{t!==l&&e===i&&n(Qde(s))};return af.on(pz,r),()=>{af.off(pz,r)}},[n,t,e])}function ofe(){var e=Ht();x.useEffect(()=>{e(Zde())},[e]),afe(),sfe()}function lfe(e,t,n,r,i,s){var l=Re(w=>mde(w,e,t)),c=Re(Que),f=Re(yj),h=Re(vj),p=Re(Z$),g=Re(Yde),v=g?.sourceViewBox!=null,y=yf();x.useEffect(()=>{if(!v&&h!=null&&f!=null){var w=jd({active:s,coordinate:n,dataKey:l,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:y,graphicalItemId:c});af.emit(AS,h,w,f)}},[v,n,l,c,i,r,f,h,p,s,y])}function vz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vz(Object(n),!0).forEach(function(r){cfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cfe(e,t,n){return(t=ufe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ufe(e){var t=dfe(e,"string");return typeof t=="symbol"?t:t+""}function dfe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ffe(e){return e.dataKey}function hfe(e,t){return x.isValidElement(e)?x.cloneElement(e,t):typeof e=="function"?x.createElement(e,t):x.createElement(kie,t)}var bz=[],pfe={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function Q3(e){var t,n,r=ar(e,pfe),{active:i,allowEscapeViewBox:s,animationDuration:l,animationEasing:c,content:f,filterNull:h,isAnimationActive:p,offset:g,payloadUniqBy:v,position:y,reverseDirection:w,useTranslate3d:S,wrapperStyle:N,cursor:C,shared:E,trigger:k,defaultIndex:O,portal:T,axisId:P}=r,A=Ht(),z=typeof O=="number"?String(O):O;x.useEffect(()=>{A(aue({shared:E,trigger:k,axisId:P,active:i,defaultIndex:z}))},[A,E,k,P,i,z]);var R=yf(),q=_$(),U=Jce(E),{activeIndex:L,isActive:ae}=(t=Re(ye=>yde(ye,U,k,z)))!==null&&t!==void 0?t:{},pe=Re(ye=>vde(ye,U,k,z)),ge=Re(ye=>G3(ye,U,k,z)),V=Re(ye=>gde(ye,U,k,z)),re=pe,ve=Bde(),we=(n=i??ae)!==null&&n!==void 0?n:!1,[B,D]=EL([re,we]),G=U==="axis"?ge:void 0;lfe(U,k,V,G,L,we);var oe=T??ve;if(oe==null||R==null||U==null)return null;var W=re??bz;we||(W=bz),h&&W.length&&(W=CL(W.filter(ye=>ye.value!=null&&(ye.hide!==!0||r.includeHidden)),v,ffe));var X=W.length>0,Q=yz(yz({},r),{},{payload:W,label:G,active:we,activeIndex:L,coordinate:V,accessibilityLayer:q}),de=x.createElement($ie,{allowEscapeViewBox:s,animationDuration:l,animationEasing:c,isAnimationActive:p,active:we,coordinate:V,hasPayload:X,offset:g,position:y,reverseDirection:w,useTranslate3d:S,viewBox:R,wrapperStyle:N,lastBoundingBox:B,innerRef:D,hasPortalFromProps:!!T},hfe(f,Q));return x.createElement(x.Fragment,null,ol.createPortal(de,oe),we&&x.createElement(Ude,{cursor:C,tooltipEventType:U,coordinate:V,payload:W,index:L}))}function mfe(e,t,n){return(t=gfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gfe(e){var t=vfe(e,"string");return typeof t=="symbol"?t:t+""}function vfe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class yfe{constructor(t){mfe(this,"cache",new Map),this.maxSize=t}get(t){var n=this.cache.get(t);return n!==void 0&&(this.cache.delete(t),this.cache.set(t,n)),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var r=this.cache.keys().next().value;r!=null&&this.cache.delete(r)}this.cache.set(t,n)}clear(){this.cache.clear()}size(){return this.cache.size}}function xz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function bfe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xz(Object(n),!0).forEach(function(r){xfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xfe(e,t,n){return(t=wfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wfe(e){var t=Sfe(e,"string");return typeof t=="symbol"?t:t+""}function Sfe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jfe={cacheSize:2e3,enableCache:!0},X3=bfe({},jfe),wz=new yfe(X3.cacheSize),Nfe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},Sz="recharts_measurement_span";function Cfe(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",s=t.fontStyle||"",l=t.letterSpacing||"",c=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(s,"|").concat(l,"|").concat(c)}var jz=(e,t)=>{try{var n=document.getElementById(Sz);n||(n=document.createElement("span"),n.setAttribute("id",Sz),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,Nfe,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},Td=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Sf.isSsr)return{width:0,height:0};if(!X3.enableCache)return jz(t,n);var r=Cfe(t,n),i=wz.get(r);if(i)return i;var s=jz(t,n);return wz.set(r,s),s},J3;function Ofe(e,t,n){return(t=_fe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _fe(e){var t=kfe(e,"string");return typeof t=="symbol"?t:t+""}function kfe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Nz=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Cz=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Afe=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,Efe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Tfe={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Pfe=["cm","mm","pt","pc","in","Q","px"];function zfe(e){return Pfe.includes(e)}var Sc="NaN";function Mfe(e,t){return e*Tfe[t]}class Dn{static parse(t){var n,[,r,i]=(n=Efe.exec(t))!==null&&n!==void 0?n:[];return r==null?Dn.NaN:new Dn(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,Wi(t)&&(this.unit=""),n!==""&&!Afe.test(n)&&(this.num=NaN,this.unit=""),zfe(n)&&(this.num=Mfe(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Dn(NaN,""):new Dn(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Dn(NaN,""):new Dn(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Dn(NaN,""):new Dn(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Dn(NaN,""):new Dn(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Wi(this.num)}}J3=Dn;Ofe(Dn,"NaN",new J3(NaN,""));function e4(e){if(e==null||e.includes(Sc))return Sc;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,s]=(n=Nz.exec(t))!==null&&n!==void 0?n:[],l=Dn.parse(r??""),c=Dn.parse(s??""),f=i==="*"?l.multiply(c):l.divide(c);if(f.isNaN())return Sc;t=t.replace(Nz,f.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var h,[,p,g,v]=(h=Cz.exec(t))!==null&&h!==void 0?h:[],y=Dn.parse(p??""),w=Dn.parse(v??""),S=g==="+"?y.add(w):y.subtract(w);if(S.isNaN())return Sc;t=t.replace(Cz,S.toString())}return t}var Oz=/\(([^()]*)\)/;function Rfe(e){for(var t=e,n;(n=Oz.exec(t))!=null;){var[,r]=n;t=t.replace(Oz,e4(r))}return t}function Dfe(e){var t=e.replace(/\s+/g,"");return t=Rfe(t),t=e4(t),t}function Ife(e){try{return Dfe(e)}catch{return Sc}}function Qx(e){var t=Ife(e.slice(5,-1));return t===Sc?"":t}var Lfe=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],$fe=["dx","dy","angle","className","breakAll"];function ES(){return ES=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ES.apply(null,arguments)}function _z(e,t){if(e==null)return{};var n,r,i=Ufe(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ufe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var t4=/[ \f\n\r\t\v\u2028\u2029]+/,n4=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];Ln(t)||(n?i=t.toString().split(""):i=t.toString().split(t4));var s=i.map(c=>({word:c,width:Td(c,r).width})),l=n?0:Td(" ",r).width;return{wordsWithComputedWidth:s,spaceWidth:l}}catch{return null}};function r4(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function Bfe(e){return Ln(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var i4=(e,t,n,r)=>e.reduce((i,s)=>{var{word:l,width:c}=s,f=i[i.length-1];if(f&&c!=null&&(t==null||r||f.width+c+n<Number(t)))f.words.push(l),f.width+=c+n;else{var h={words:[l],width:c};i.push(h)}return i},[]),a4=e=>e.reduce((t,n)=>t.width>n.width?t:n),qfe="…",kz=(e,t,n,r,i,s,l,c)=>{var f=e.slice(0,t),h=n4({breakAll:n,style:r,children:f+qfe});if(!h)return[!1,[]];var p=i4(h.wordsWithComputedWidth,s,l,c),g=p.length>i||a4(p).width>Number(s);return[g,p]},Ffe=(e,t,n,r,i)=>{var{maxLines:s,children:l,style:c,breakAll:f}=e,h=Pe(s),p=String(l),g=i4(t,r,n,i);if(!h||i)return g;var v=g.length>s||a4(g).width>Number(r);if(!v)return g;for(var y=0,w=p.length-1,S=0,N;y<=w&&S<=p.length-1;){var C=Math.floor((y+w)/2),E=C-1,[k,O]=kz(p,E,f,c,s,r,n,i),[T]=kz(p,C,f,c,s,r,n,i);if(!k&&!T&&(y=C+1),k&&T&&(w=C-1),!k&&T){N=O;break}S++}return N||g},Az=e=>{var t=Ln(e)?[]:e.toString().split(t4);return[{words:t,width:void 0}]},Kfe=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:s,maxLines:l}=e;if((t||n)&&!Sf.isSsr){var c,f,h=n4({breakAll:s,children:r,style:i});if(h){var{wordsWithComputedWidth:p,spaceWidth:g}=h;c=p,f=g}else return Az(r);return Ffe({breakAll:s,children:r,maxLines:l,style:i},c,f,t,!!n)}return Az(r)},s4="#808080",Hfe={angle:0,breakAll:!1,capHeight:"0.71em",fill:s4,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},fN=x.forwardRef((e,t)=>{var n=ar(e,Hfe),{x:r,y:i,lineHeight:s,capHeight:l,fill:c,scaleToFit:f,textAnchor:h,verticalAnchor:p}=n,g=_z(n,Lfe),v=x.useMemo(()=>Kfe({breakAll:g.breakAll,children:g.children,maxLines:g.maxLines,scaleToFit:f,style:g.style,width:g.width}),[g.breakAll,g.children,g.maxLines,f,g.style,g.width]),{dx:y,dy:w,angle:S,className:N,breakAll:C}=g,E=_z(g,$fe);if(!ai(r)||!ai(i)||v.length===0)return null;var k=Number(r)+(Pe(y)?y:0),O=Number(i)+(Pe(w)?w:0);if(!He(k)||!He(O))return null;var T;switch(p){case"start":T=Qx("calc(".concat(l,")"));break;case"middle":T=Qx("calc(".concat((v.length-1)/2," * -").concat(s," + (").concat(l," / 2))"));break;default:T=Qx("calc(".concat(v.length-1," * -").concat(s,")"));break}var P=[],A=v[0];if(f&&A!=null){var z=A.width,{width:R}=g;P.push("scale(".concat(Pe(R)&&Pe(z)?R/z:1,")"))}return S&&P.push("rotate(".concat(S,", ").concat(k,", ").concat(O,")")),P.length&&(E.transform=P.join(" ")),x.createElement("text",ES({},xr(E),{ref:t,x:k,y:O,className:ft("recharts-text",N),textAnchor:h,fill:c.includes("url")?s4:c}),v.map((q,U)=>{var L=q.words.join(C?"":" ");return x.createElement("tspan",{x:k,dy:U===0?T:s,key:"".concat(L,"-").concat(U)},L)}))});fN.displayName="Text";function Ez(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Bi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ez(Object(n),!0).forEach(function(r){Gfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ez(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gfe(e,t,n){return(t=Vfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vfe(e){var t=Zfe(e,"string");return typeof t=="symbol"?t:t+""}function Zfe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Yfe=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:s,y:l,height:c,upperWidth:f,lowerWidth:h}=sj(t),p=s,g=s+(f-h)/2,v=(p+g)/2,y=(f+h)/2,w=p+f/2,S=c>=0?1:-1,N=S*r,C=S>0?"end":"start",E=S>0?"start":"end",k=f>=0?1:-1,O=k*r,T=k>0?"end":"start",P=k>0?"start":"end",A=i;if(n==="top"){var z={x:p+f/2,y:l-N,horizontalAnchor:"middle",verticalAnchor:C};return A&&(z.height=Math.max(l-A.y,0),z.width=f),z}if(n==="bottom"){var R={x:g+h/2,y:l+c+N,horizontalAnchor:"middle",verticalAnchor:E};return A&&(R.height=Math.max(A.y+A.height-(l+c),0),R.width=h),R}if(n==="left"){var q={x:v-O,y:l+c/2,horizontalAnchor:T,verticalAnchor:"middle"};return A&&(q.width=Math.max(q.x-A.x,0),q.height=c),q}if(n==="right"){var U={x:v+y+O,y:l+c/2,horizontalAnchor:P,verticalAnchor:"middle"};return A&&(U.width=Math.max(A.x+A.width-U.x,0),U.height=c),U}var L=A?{width:y,height:c}:{};return n==="insideLeft"?Bi({x:v+O,y:l+c/2,horizontalAnchor:P,verticalAnchor:"middle"},L):n==="insideRight"?Bi({x:v+y-O,y:l+c/2,horizontalAnchor:T,verticalAnchor:"middle"},L):n==="insideTop"?Bi({x:p+f/2,y:l+N,horizontalAnchor:"middle",verticalAnchor:E},L):n==="insideBottom"?Bi({x:g+h/2,y:l+c-N,horizontalAnchor:"middle",verticalAnchor:C},L):n==="insideTopLeft"?Bi({x:p+O,y:l+N,horizontalAnchor:P,verticalAnchor:E},L):n==="insideTopRight"?Bi({x:p+f-O,y:l+N,horizontalAnchor:T,verticalAnchor:E},L):n==="insideBottomLeft"?Bi({x:g+O,y:l+c-N,horizontalAnchor:P,verticalAnchor:C},L):n==="insideBottomRight"?Bi({x:g+h-O,y:l+c-N,horizontalAnchor:T,verticalAnchor:C},L):n&&typeof n=="object"&&(Pe(n.x)||Jo(n.x))&&(Pe(n.y)||Jo(n.y))?Bi({x:s+Bs(n.x,y),y:l+Bs(n.y,c),horizontalAnchor:"end",verticalAnchor:"end"},L):Bi({x:w,y:l+c/2,horizontalAnchor:"middle",verticalAnchor:"middle"},L)},Wfe=["labelRef"],Qfe=["content"];function Tz(e,t){if(e==null)return{};var n,r,i=Xfe(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Xfe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Pz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Nd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Pz(Object(n),!0).forEach(function(r){Jfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jfe(e,t,n){return(t=ehe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ehe(e){var t=the(e,"string");return typeof t=="symbol"?t:t+""}function the(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Oa(){return Oa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Oa.apply(null,arguments)}var o4=x.createContext(null),l4=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:s,height:l,children:c}=e,f=x.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:s,height:l}),[t,n,r,i,s,l]);return x.createElement(o4.Provider,{value:f},c)},c4=()=>{var e=x.useContext(o4),t=yf();return e||(t?sj(t):void 0)},nhe=x.createContext(null),rhe=()=>{var e=x.useContext(nhe),t=Re(J$);return e||t},ihe=e=>{var{value:t,formatter:n}=e,r=Ln(e.children)?t:e.children;return typeof n=="function"?n(r):r},hN=e=>e!=null&&typeof e=="function",ahe=(e,t)=>{var n=ei(t-e),r=Math.min(Math.abs(t-e),360);return n*r},she=(e,t,n,r,i)=>{var{offset:s,className:l}=e,{cx:c,cy:f,innerRadius:h,outerRadius:p,startAngle:g,endAngle:v,clockWise:y}=i,w=(h+p)/2,S=ahe(g,v),N=S>=0?1:-1,C,E;switch(t){case"insideStart":C=g+N*s,E=y;break;case"insideEnd":C=v-N*s,E=!y;break;case"end":C=v+N*s,E=y;break;default:throw new Error("Unsupported position ".concat(t))}E=S<=0?E:!E;var k=In(c,f,w,C),O=In(c,f,w,C+(E?1:-1)*359),T="M".concat(k.x,",").concat(k.y,`
267
- A`).concat(w,",").concat(w,",0,1,").concat(E?0:1,`,
268
- `).concat(O.x,",").concat(O.y),P=Ln(e.id)?Kd("recharts-radial-line-"):e.id;return x.createElement("text",Oa({},r,{dominantBaseline:"central",className:ft("recharts-radial-bar-label",l)}),x.createElement("defs",null,x.createElement("path",{id:P,d:T})),x.createElement("textPath",{xlinkHref:"#".concat(P)},n))},ohe=(e,t,n)=>{var{cx:r,cy:i,innerRadius:s,outerRadius:l,startAngle:c,endAngle:f}=e,h=(c+f)/2;if(n==="outside"){var{x:p,y:g}=In(r,i,l+t,h);return{x:p,y:g,textAnchor:p>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"end"};var v=(s+l)/2,{x:y,y:w}=In(r,i,v,h);return{x:y,y:w,textAnchor:"middle",verticalAnchor:"middle"}},Xp=e=>e!=null&&"cx"in e&&Pe(e.cx),lhe={angle:0,offset:5,zIndex:Zn.label,position:"middle",textBreakAll:!1};function che(e){if(!Xp(e))return e;var{cx:t,cy:n,outerRadius:r}=e,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function Cs(e){var t=ar(e,lhe),{viewBox:n,parentViewBox:r,position:i,value:s,children:l,content:c,className:f="",textBreakAll:h,labelRef:p}=t,g=rhe(),v=c4(),y=i==="center"?v:g??v,w,S,N;n==null?w=y:Xp(n)?w=n:w=sj(n);var C=che(w);if(!w||Ln(s)&&Ln(l)&&!x.isValidElement(c)&&typeof c!="function")return null;var E=Nd(Nd({},t),{},{viewBox:w});if(x.isValidElement(c)){var{labelRef:k}=E,O=Tz(E,Wfe);return x.cloneElement(c,O)}if(typeof c=="function"){var{content:T}=E,P=Tz(E,Qfe);if(S=x.createElement(c,P),x.isValidElement(S))return S}else S=ihe(t);var A=xr(t);if(Xp(w)){if(i==="insideStart"||i==="insideEnd"||i==="end")return she(t,i,S,A,w);N=ohe(w,t.offset,t.position)}else{if(!C)return null;var z=Yfe({viewBox:C,position:i,offset:t.offset,parentViewBox:Xp(r)?void 0:r});N=Nd(Nd({x:z.x,y:z.y,textAnchor:z.horizontalAnchor,verticalAnchor:z.verticalAnchor},z.width!==void 0?{width:z.width}:{}),z.height!==void 0?{height:z.height}:{})}return x.createElement(ra,{zIndex:t.zIndex},x.createElement(fN,Oa({ref:p,className:ft("recharts-label",f)},A,N,{textAnchor:r4(A.textAnchor)?A.textAnchor:N.textAnchor,breakAll:h}),S))}Cs.displayName="Label";var uhe=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?x.createElement(Cs,Oa({key:"label-implicit"},r)):ai(e)?x.createElement(Cs,Oa({key:"label-implicit",value:e},r)):x.isValidElement(e)?e.type===Cs?x.cloneElement(e,Nd({key:"label-implicit"},r)):x.createElement(Cs,Oa({key:"label-implicit",content:e},r)):hN(e)?x.createElement(Cs,Oa({key:"label-implicit",content:e},r)):e&&typeof e=="object"?x.createElement(Cs,Oa({},e,{key:"label-implicit"},r)):null};function u4(e){var{label:t,labelRef:n}=e,r=c4();return uhe(t,r,n)||null}var dhe=["valueAccessor"],fhe=["dataKey","clockWise","id","textBreakAll","zIndex"];function ug(){return ug=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ug.apply(null,arguments)}function zz(e,t){if(e==null)return{};var n,r,i=hhe(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function hhe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var phe=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(Bfe(t))return t},d4=x.createContext(void 0),mhe=d4.Provider,f4=x.createContext(void 0);f4.Provider;function ghe(){return x.useContext(d4)}function vhe(){return x.useContext(f4)}function Jp(e){var{valueAccessor:t=phe}=e,n=zz(e,dhe),{dataKey:r,clockWise:i,id:s,textBreakAll:l,zIndex:c}=n,f=zz(n,fhe),h=ghe(),p=vhe(),g=h||p;return!g||!g.length?null:x.createElement(ra,{zIndex:c??Zn.label},x.createElement(Ci,{className:"recharts-label-list"},g.map((v,y)=>{var w,S=Ln(r)?t(v,y):Cn(v.payload,r),N=Ln(s)?{}:{id:"".concat(s,"-").concat(y)};return x.createElement(Cs,ug({key:"label-".concat(y)},xr(v),f,N,{fill:(w=n.fill)!==null&&w!==void 0?w:v.fill,parentViewBox:v.parentViewBox,value:S,textBreakAll:l,viewBox:v.viewBox,index:y,zIndex:0}))})))}Jp.displayName="LabelList";function yhe(e){var{label:t}=e;return t?t===!0?x.createElement(Jp,{key:"labelList-implicit"}):x.isValidElement(t)||hN(t)?x.createElement(Jp,{key:"labelList-implicit",content:t}):typeof t=="object"?x.createElement(Jp,ug({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function TS(){return TS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},TS.apply(null,arguments)}var h4=e=>{var{cx:t,cy:n,r,className:i}=e,s=ft("recharts-dot",i);return Pe(t)&&Pe(n)&&Pe(r)?x.createElement("circle",TS({},Ni(e),W1(e),{className:s,cx:t,cy:n,r})):null},bhe={radiusAxis:{},angleAxis:{}},p4=Yn({name:"polarAxis",initialState:bhe,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:zye,removeRadiusAxis:Mye,addAngleAxis:Rye,removeAngleAxis:Dye}=p4.actions,xhe=p4.reducer;function whe(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var m4=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function She(e){var{tooltipEntrySettings:t}=e,n=Ht(),r=sr(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(nue(t)):i.current!==t&&n(rue({prev:i.current,next:t})),i.current=t)},[t,n,r]),x.useLayoutEffect(()=>()=>{i.current&&(n(iue(i.current)),i.current=null)},[n]),null}function jhe(e){var{legendPayload:t}=e,n=Ht(),r=sr(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n($re(t)):i.current!==t&&n(Ure({prev:i.current,next:t})),i.current=t)},[n,r,t]),x.useLayoutEffect(()=>()=>{i.current&&(n(Bre(i.current)),i.current=null)},[n]),null}var Xx,Nhe=()=>{var[e]=x.useState(()=>Kd("uid-"));return e},Che=(Xx=bg.useId)!==null&&Xx!==void 0?Xx:Nhe;function Ohe(e,t){var n=Che();return t||(e?"".concat(e,"-").concat(n):n)}var _he=x.createContext(void 0),khe=e=>{var{id:t,type:n,children:r}=e,i=Ohe("recharts-".concat(n),t);return x.createElement(_he.Provider,{value:i},r(i))},Ahe={cartesianItems:[],polarItems:[]},g4=Yn({name:"graphicalItems",initialState:Ahe,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:At()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ti(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:At()},removeCartesianGraphicalItem:{reducer(e,t){var n=ti(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:At()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:At()},removePolarGraphicalItem:{reducer(e,t){var n=ti(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:At()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ti(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:At()}}}),{addCartesianGraphicalItem:Ehe,replaceCartesianGraphicalItem:The,removeCartesianGraphicalItem:Phe,addPolarGraphicalItem:Iye,removePolarGraphicalItem:Lye,replacePolarGraphicalItem:$ye}=g4.actions,zhe=g4.reducer,Mhe=e=>{var t=Ht(),n=x.useRef(null);return x.useLayoutEffect(()=>{n.current===null?t(Ehe(e)):n.current!==e&&t(The({prev:n.current,next:e})),n.current=e},[t,e]),x.useLayoutEffect(()=>()=>{n.current&&(t(Phe(n.current)),n.current=null)},[t]),null},Rhe=x.memo(Mhe),Dhe=["points"];function Mz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Jx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Mz(Object(n),!0).forEach(function(r){Ihe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ihe(e,t,n){return(t=Lhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lhe(e){var t=$he(e,"string");return typeof t=="symbol"?t:t+""}function $he(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dg(){return dg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dg.apply(null,arguments)}function Uhe(e,t){if(e==null)return{};var n,r,i=Bhe(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Bhe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function qhe(e){var{option:t,dotProps:n,className:r}=e;if(x.isValidElement(t))return x.cloneElement(t,n);if(typeof t=="function")return t(n);var i=ft(r,typeof t!="boolean"?t.className:""),s=n??{},{points:l}=s,c=Uhe(s,Dhe);return x.createElement(h4,dg({},c,{className:i}))}function Fhe(e,t){return e==null?!1:t?!0:e.length===1}function Khe(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:s,baseProps:l,needClip:c,clipPathId:f,zIndex:h=Zn.scatter}=e;if(!Fhe(t,n))return null;var p=m4(n),g=_J(n),v=t.map((w,S)=>{var N,C,E=Jx(Jx(Jx({r:3},l),g),{},{index:S,cx:(N=w.x)!==null&&N!==void 0?N:void 0,cy:(C=w.y)!==null&&C!==void 0?C:void 0,dataKey:s,value:w.value,payload:w.payload,points:t});return x.createElement(qhe,{key:"dot-".concat(S),option:n,dotProps:E,className:i})}),y={};return c&&f!=null&&(y.clipPath="url(#clipPath-".concat(p?"":"dots-").concat(f,")")),x.createElement(ra,{zIndex:h},x.createElement(Ci,dg({className:r},y),v))}function Rz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Dz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Rz(Object(n),!0).forEach(function(r){Hhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hhe(e,t,n){return(t=Ghe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ghe(e){var t=Vhe(e,"string");return typeof t=="symbol"?t:t+""}function Vhe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var v4=0,Zhe={xAxis:{},yAxis:{},zAxis:{}},y4=Yn({name:"cartesianAxis",initialState:Zhe,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:At()},replaceXAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.xAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.xAxis[n.id],e.xAxis[r.id]=r)},prepare:At()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:At()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:At()},replaceYAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.yAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.yAxis[n.id],e.yAxis[r.id]=r)},prepare:At()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:At()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:At()},replaceZAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.zAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.zAxis[n.id],e.zAxis[r.id]=r)},prepare:At()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:At()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var s,l=i.widthHistory||[];if(l.length===3&&l[0]===l[2]&&r===l[1]&&r!==i.width&&Math.abs(r-((s=l[0])!==null&&s!==void 0?s:0))<=1)return;var c=[...l,r].slice(-3);e.yAxis[n]=Dz(Dz({},i),{},{width:r,widthHistory:c})}}}}),{addXAxis:Yhe,replaceXAxis:Whe,removeXAxis:Qhe,addYAxis:Xhe,replaceYAxis:Jhe,removeYAxis:epe,addZAxis:Uye,replaceZAxis:Bye,removeZAxis:qye,updateYAxisWidth:tpe}=y4.actions,npe=y4.reducer,rpe=ne([Un],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),ipe=ne([rpe,La,$a],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),pN=()=>Re(ipe),ape=()=>Re(nde);function Iz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ew(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Iz(Object(n),!0).forEach(function(r){spe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Iz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function spe(e,t,n){return(t=ope(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ope(e){var t=lpe(e,"string");return typeof t=="symbol"?t:t+""}function lpe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var cpe=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:s,clipPath:l}=e;if(i===!1||t.x==null||t.y==null)return null;var c={index:n,dataKey:s,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},f=ew(ew(ew({},c),Qg(i)),W1(i)),h;return x.isValidElement(i)?h=x.cloneElement(i,f):typeof i=="function"?h=i(f):h=x.createElement(h4,f),x.createElement(Ci,{className:"recharts-active-dot",clipPath:l},h)};function Lz(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:s,zIndex:l=Zn.activeDot}=e,c=Re(rf),f=ape();if(t==null||f==null)return null;var h=t.find(p=>f.includes(p.payload));return Ln(h)?null:x.createElement(ra,{zIndex:l},x.createElement(cpe,{point:h,childIndex:Number(c),mainColor:n,dataKey:i,activeDot:r,clipPath:s}))}var upe=e=>{var{chartData:t}=e,n=Ht(),r=sr();return x.useEffect(()=>r?()=>{}:(n(mz(t)),()=>{n(mz(void 0))}),[t,n,r]),null},$z={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},b4=Yn({name:"brush",initialState:$z,reducers:{setBrushSettings(e,t){return t.payload==null?$z:t.payload}}}),{setBrushSettings:Fye}=b4.actions,dpe=b4.reducer,fpe=(e,t)=>{var{x:n,y:r}=e,{x:i,y:s}=t;return{x:Math.min(n,i),y:Math.min(r,s),width:Math.abs(i-n),height:Math.abs(s-r)}},hpe=e=>{var{x1:t,y1:n,x2:r,y2:i}=e;return fpe({x:t,y:n},{x:r,y:i})};function ppe(e){return(e%180+180)%180}var mpe=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=ppe(i),l=s*Math.PI/180,c=Math.atan(r/n),f=l>c&&l<Math.PI-c?r/Math.sin(l):n/Math.cos(l);return Math.abs(f)},gpe={dots:[],areas:[],lines:[]},x4=Yn({name:"referenceElements",initialState:gpe,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=ti(e).dots.findIndex(r=>r===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=ti(e).areas.findIndex(r=>r===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var n=ti(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:Kye,removeDot:Hye,addArea:Gye,removeArea:Vye,addLine:vpe,removeLine:ype}=x4.actions,bpe=x4.reducer,w4=x.createContext(void 0),xpe=e=>{var{children:t}=e,[n]=x.useState("".concat(Kd("recharts"),"-clip")),r=pN();if(r==null)return null;var{x:i,y:s,width:l,height:c}=r;return x.createElement(w4.Provider,{value:n},x.createElement("defs",null,x.createElement("clipPath",{id:n},x.createElement("rect",{x:i,y:s,height:c,width:l}))),t)},wpe=()=>x.useContext(w4);class Spe{constructor(t){var{x:n,y:r}=t;this.xAxisScale=n,this.yAxisScale=r}map(t,n){var r,i,{position:s}=n;return{x:(r=this.xAxisScale.map(t.x,{position:s}))!==null&&r!==void 0?r:0,y:(i=this.yAxisScale.map(t.y,{position:s}))!==null&&i!==void 0?i:0}}mapWithFallback(t,n){var r,i,{position:s,fallback:l}=n,c,f;return l==="rangeMin"?c=this.yAxisScale.rangeMin():l==="rangeMax"?c=this.yAxisScale.rangeMax():c=0,l==="rangeMin"?f=this.xAxisScale.rangeMin():l==="rangeMax"?f=this.xAxisScale.rangeMax():f=0,{x:(r=this.xAxisScale.map(t.x,{position:s}))!==null&&r!==void 0?r:f,y:(i=this.yAxisScale.map(t.y,{position:s}))!==null&&i!==void 0?i:c}}isInRange(t){var{x:n,y:r}=t,i=n==null||this.xAxisScale.isInRange(n),s=r==null||this.yAxisScale.isInRange(r);return i&&s}}function Uz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Bz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Uz(Object(n),!0).forEach(function(r){jpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jpe(e,t,n){return(t=Npe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Npe(e){var t=Cpe(e,"string");return typeof t=="symbol"?t:t+""}function Cpe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fg(){return fg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fg.apply(null,arguments)}var Ope=(e,t)=>{var n;if(x.isValidElement(e))n=x.cloneElement(e,t);else if(typeof e=="function")n=e(t);else{if(!He(t.x1)||!He(t.y1)||!He(t.x2)||!He(t.y2))return null;n=x.createElement("line",fg({},t,{className:"recharts-reference-line-line"}))}return n},_pe=(e,t,n,r,i,s)=>{var{x:l,width:c}=s,f=i.map(e,{position:n});if(!He(f)||t==="discard"&&!i.isInRange(f))return null;var h=[{x:l+c,y:f},{x:l,y:f}];return r==="left"?h.reverse():h},kpe=(e,t,n,r,i,s)=>{var{y:l,height:c}=s,f=i.map(e,{position:n});if(!He(f)||t==="discard"&&!i.isInRange(f))return null;var h=[{x:f,y:l+c},{x:f,y:l}];return r==="top"?h.reverse():h},Ape=(e,t,n,r)=>{var i=[r.mapWithFallback(e[0],{position:n,fallback:"rangeMin"}),r.mapWithFallback(e[1],{position:n,fallback:"rangeMax"})];return t==="discard"&&i.some(s=>!r.isInRange(s))?null:i},Epe=(e,t,n,r,i,s,l)=>{var{x:c,y:f,segment:h,ifOverflow:p}=l,g=ai(c),v=ai(f);return v?_pe(f,p,r,s,t,n):g?kpe(c,p,r,i,e,n):h!=null&&h.length===2?Ape(h,p,r,new Spe({x:e,y:t})):null};function Tpe(e){var t=Ht();return x.useEffect(()=>(t(vpe(e)),()=>{t(ype(e))})),null}function Ppe(e){var{xAxisId:t,yAxisId:n,shape:r,className:i,ifOverflow:s}=e,l=sr(),c=wpe(),f=Re(A=>ta(A,t)),h=Re(A=>na(A,n)),p=Re(A=>Kc(A,"xAxis",t,l)),g=Re(A=>Kc(A,"yAxis",n,l)),v=yf();if(!c||!v||f==null||h==null||p==null||g==null)return null;var y=Epe(p,g,v,e.position,f.orientation,h.orientation,e);if(!y)return null;var w=y[0],S=y[1];if(w==null||S==null)return null;var{x:N,y:C}=w,{x:E,y:k}=S,O=s==="hidden"?"url(#".concat(c,")"):void 0,T=Bz(Bz({clipPath:O},xr(e)),{},{x1:N,y1:C,x2:E,y2:k}),P=hpe({x1:N,y1:C,x2:E,y2:k});return x.createElement(ra,{zIndex:e.zIndex},x.createElement(Ci,{className:ft("recharts-reference-line",i)},Ope(r,T),x.createElement(l4,fg({},P,{lowerWidth:P.width,upperWidth:P.width}),x.createElement(u4,{label:e.label}),e.children)))}var zpe={ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",label:!1,stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle",zIndex:Zn.line};function S4(e){var t=ar(e,zpe);return x.createElement(x.Fragment,null,x.createElement(Tpe,{yAxisId:t.yAxisId,xAxisId:t.xAxisId,ifOverflow:t.ifOverflow,x:t.x,y:t.y,segment:t.segment}),x.createElement(Ppe,t))}S4.displayName="ReferenceLine";function j4(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;r<e.length;r+=t){var i=e[r];i!==void 0&&n.push(i)}return n}function Mpe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return mpe(r,n)}function Rpe(e,t,n){var r=n==="width",{x:i,y:s,width:l,height:c}=e;return t===1?{start:r?i:s,end:r?i+l:s+c}:{start:r?i+l:s+c,end:r?i:s}}function sf(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var s=n();return e*(t-e*s/2-r)>=0&&e*(t+e*s/2-i)<=0}function Dpe(e,t){return j4(e,t+1)}function Ipe(e,t,n,r,i){for(var s=(r||[]).slice(),{start:l,end:c}=t,f=0,h=1,p=l,g=function(){var w=r?.[f];if(w===void 0)return{v:j4(r,h)};var S=f,N,C=()=>(N===void 0&&(N=n(w,S)),N),E=w.coordinate,k=f===0||sf(e,E,C,p,c);k||(f=0,p=l,h+=1),k&&(p=E+e*(C()/2+i),f+=h)},v;h<=s.length;)if(v=g(),v)return v.v;return[]}function Lpe(e,t,n,r,i){var s=(r||[]).slice(),l=s.length;if(l===0)return[];for(var{start:c,end:f}=t,h=1;h<=l;h++){for(var p=(l-1)%h,g=c,v=!0,y=function(){var O=r[S];if(O==null)return 0;var T=S,P,A=()=>(P===void 0&&(P=n(O,T)),P),z=O.coordinate,R=S===p||sf(e,z,A,g,f);if(!R)return v=!1,1;R&&(g=z+e*(A()/2+i))},w,S=p;S<l&&(w=y(),!(w!==0&&w===1));S+=h);if(v){for(var N=[],C=p;C<l;C+=h){var E=r[C];E!=null&&N.push(E)}return N}}return[]}function qz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Fn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qz(Object(n),!0).forEach(function(r){$pe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $pe(e,t,n){return(t=Upe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Upe(e){var t=Bpe(e,"string");return typeof t=="symbol"?t:t+""}function Bpe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qpe(e,t,n,r,i){for(var s=(r||[]).slice(),l=s.length,{start:c}=t,{end:f}=t,h=function(v){var y=s[v];if(y==null)return 1;var w=y,S,N=()=>(S===void 0&&(S=n(y,v)),S);if(v===l-1){var C=e*(w.coordinate+e*N()/2-f);s[v]=w=Fn(Fn({},w),{},{tickCoord:C>0?w.coordinate-C*e:w.coordinate})}else s[v]=w=Fn(Fn({},w),{},{tickCoord:w.coordinate});if(w.tickCoord!=null){var E=sf(e,w.tickCoord,N,c,f);E&&(f=w.tickCoord-e*(N()/2+i),s[v]=Fn(Fn({},w),{},{isShow:!0}))}},p=l-1;p>=0;p--)h(p);return s}function Fpe(e,t,n,r,i,s){var l=(r||[]).slice(),c=l.length,{start:f,end:h}=t;if(s){var p=r[c-1];if(p!=null){var g=n(p,c-1),v=e*(p.coordinate+e*g/2-h);if(l[c-1]=p=Fn(Fn({},p),{},{tickCoord:v>0?p.coordinate-v*e:p.coordinate}),p.tickCoord!=null){var y=sf(e,p.tickCoord,()=>g,f,h);y&&(h=p.tickCoord-e*(g/2+i),l[c-1]=Fn(Fn({},p),{},{isShow:!0}))}}}for(var w=s?c-1:c,S=function(E){var k=l[E];if(k==null)return 1;var O=k,T,P=()=>(T===void 0&&(T=n(k,E)),T);if(E===0){var A=e*(O.coordinate-e*P()/2-f);l[E]=O=Fn(Fn({},O),{},{tickCoord:A<0?O.coordinate-A*e:O.coordinate})}else l[E]=O=Fn(Fn({},O),{},{tickCoord:O.coordinate});if(O.tickCoord!=null){var z=sf(e,O.tickCoord,P,f,h);z&&(f=O.tickCoord+e*(P()/2+i),l[E]=Fn(Fn({},O),{},{isShow:!0}))}},N=0;N<w;N++)S(N);return l}function mN(e,t,n){var{tick:r,ticks:i,viewBox:s,minTickGap:l,orientation:c,interval:f,tickFormatter:h,unit:p,angle:g}=e;if(!i||!i.length||!r)return[];if(Pe(f)||Sf.isSsr){var v;return(v=Dpe(i,Pe(f)?f:0))!==null&&v!==void 0?v:[]}var y=[],w=c==="top"||c==="bottom"?"width":"height",S=p&&w==="width"?Td(p,{fontSize:t,letterSpacing:n}):{width:0,height:0},N=(T,P)=>{var A=typeof h=="function"?h(T.value,P):T.value;return w==="width"?Mpe(Td(A,{fontSize:t,letterSpacing:n}),S,g):Td(A,{fontSize:t,letterSpacing:n})[w]},C=i[0],E=i[1],k=i.length>=2&&C!=null&&E!=null?ei(E.coordinate-C.coordinate):1,O=Rpe(s,k,w);return f==="equidistantPreserveStart"?Ipe(k,O,N,i,l):f==="equidistantPreserveEnd"?Lpe(k,O,N,i,l):(f==="preserveStart"||f==="preserveStartEnd"?y=Fpe(k,O,N,i,l,f==="preserveStartEnd"):y=qpe(k,O,N,i,l),y.filter(T=>T.isShow))}var Kpe=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:s=0}=e,l=0;if(t){Array.from(t).forEach(p=>{if(p){var g=p.getBoundingClientRect();g.width>l&&(l=g.width)}});var c=n?n.getBoundingClientRect().width:0,f=i+s,h=l+f+c+(n?r:0);return Math.round(h)}return 0},Hpe={xAxis:{},yAxis:{}},N4=Yn({name:"renderedTicks",initialState:Hpe,reducers:{setRenderedTicks:(e,t)=>{var{axisType:n,axisId:r,ticks:i}=t.payload;e[n][r]=i},removeRenderedTicks:(e,t)=>{var{axisType:n,axisId:r}=t.payload;delete e[n][r]}}}),{setRenderedTicks:Gpe,removeRenderedTicks:Vpe}=N4.actions,Zpe=N4.reducer,Ype=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function Wpe(e,t){if(e==null)return{};var n,r,i=Qpe(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Qpe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function al(){return al=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},al.apply(null,arguments)}function Fz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Qt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Fz(Object(n),!0).forEach(function(r){Xpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xpe(e,t,n){return(t=Jpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jpe(e){var t=eme(e,"string");return typeof t=="symbol"?t:t+""}function eme(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Pa={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd",zIndex:Zn.axis};function tme(e){var{x:t,y:n,width:r,height:i,orientation:s,mirror:l,axisLine:c,otherSvgProps:f}=e;if(!c)return null;var h=Qt(Qt(Qt({},f),Ni(c)),{},{fill:"none"});if(s==="top"||s==="bottom"){var p=+(s==="top"&&!l||s==="bottom"&&l);h=Qt(Qt({},h),{},{x1:t,y1:n+p*i,x2:t+r,y2:n+p*i})}else{var g=+(s==="left"&&!l||s==="right"&&l);h=Qt(Qt({},h),{},{x1:t+g*r,y1:n,x2:t+g*r,y2:n+i})}return x.createElement("line",al({},h,{className:ft("recharts-cartesian-axis-line",tv(c,"className"))}))}function nme(e,t,n,r,i,s,l,c,f){var h,p,g,v,y,w,S=c?-1:1,N=e.tickSize||l,C=Pe(e.tickCoord)?e.tickCoord:e.coordinate;switch(s){case"top":h=p=e.coordinate,v=n+ +!c*i,g=v-S*N,w=g-S*f,y=C;break;case"left":g=v=e.coordinate,p=t+ +!c*r,h=p-S*N,y=h-S*f,w=C;break;case"right":g=v=e.coordinate,p=t+ +c*r,h=p+S*N,y=h+S*f,w=C;break;default:h=p=e.coordinate,v=n+ +c*i,g=v+S*N,w=g+S*f,y=C;break}return{line:{x1:h,y1:g,x2:p,y2:v},tick:{x:y,y:w}}}function rme(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function ime(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function ame(e){var{option:t,tickProps:n,value:r}=e,i,s=ft(n.className,"recharts-cartesian-axis-tick-value");if(x.isValidElement(t))i=x.cloneElement(t,Qt(Qt({},n),{},{className:s}));else if(typeof t=="function")i=t(Qt(Qt({},n),{},{className:s}));else{var l="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(l=ft(l,whe(t))),i=x.createElement(fN,al({},n,{className:l}),r)}return i}function sme(e){var{ticks:t,axisType:n,axisId:r}=e,i=Ht();return x.useEffect(()=>{if(r==null||n==null)return tu;var s=t.map(l=>({value:l.value,coordinate:l.coordinate,offset:l.offset,index:l.index}));return i(Gpe({ticks:s,axisId:r,axisType:n})),()=>{i(Vpe({axisId:r,axisType:n}))}},[i,t,r,n]),null}var ome=x.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:s,tickFormatter:l,unit:c,padding:f,tickTextProps:h,orientation:p,mirror:g,x:v,y,width:w,height:S,tickSize:N,tickMargin:C,fontSize:E,letterSpacing:k,getTicksConfig:O,events:T,axisType:P,axisId:A}=e,z=mN(Qt(Qt({},O),{},{ticks:n}),E,k),R=Ni(O),q=Qg(r),U=r4(R.textAnchor)?R.textAnchor:rme(p,g),L=ime(p,g),ae={};typeof i=="object"&&(ae=i);var pe=Qt(Qt({},R),{},{fill:"none"},ae),ge=z.map(ve=>Qt({entry:ve},nme(ve,v,y,w,S,p,N,g,C))),V=ge.map(ve=>{var{entry:we,line:B}=ve;return x.createElement(Ci,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(we.value,"-").concat(we.coordinate,"-").concat(we.tickCoord)},i&&x.createElement("line",al({},pe,B,{className:ft("recharts-cartesian-axis-tick-line",tv(i,"className"))})))}),re=ge.map((ve,we)=>{var B,D,{entry:G,tick:oe}=ve,W=Qt(Qt(Qt(Qt({verticalAnchor:L},R),{},{textAnchor:U,stroke:"none",fill:s},oe),{},{index:we,payload:G,visibleTicksCount:z.length,tickFormatter:l,padding:f},h),{},{angle:(B=(D=h?.angle)!==null&&D!==void 0?D:R.angle)!==null&&B!==void 0?B:0}),X=Qt(Qt({},W),q);return x.createElement(Ci,al({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(G.value,"-").concat(G.coordinate,"-").concat(G.tickCoord)},pL(T,G,we)),r&&x.createElement(ame,{option:r,tickProps:X,value:"".concat(typeof l=="function"?l(G.value,we):G.value).concat(c||"")}))});return x.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(P,"-ticks")},x.createElement(sme,{ticks:z,axisId:A,axisType:P}),re.length>0&&x.createElement(ra,{zIndex:Zn.label},x.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(P,"-tick-labels"),ref:t},re)),V.length>0&&x.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(P,"-tick-lines")},V))}),lme=x.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:s,hide:l,ticks:c,axisType:f,axisId:h}=e,p=Wpe(e,Ype),[g,v]=x.useState(""),[y,w]=x.useState(""),S=x.useRef(null);x.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var C;return Kpe({ticks:S.current,label:(C=e.labelRef)===null||C===void 0?void 0:C.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var N=x.useCallback(C=>{if(C){var E=C.getElementsByClassName("recharts-cartesian-axis-tick-value");S.current=E;var k=E[0];if(k){var O=window.getComputedStyle(k),T=O.fontSize,P=O.letterSpacing;(T!==g||P!==y)&&(v(T),w(P))}}},[g,y]);return l||r!=null&&r<=0||i!=null&&i<=0?null:x.createElement(ra,{zIndex:e.zIndex},x.createElement(Ci,{className:ft("recharts-cartesian-axis",s)},x.createElement(tme,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Ni(e)}),x.createElement(ome,{ref:N,axisType:f,events:p,fontSize:g,getTicksConfig:e,height:e.height,letterSpacing:y,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:c,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:h}),x.createElement(l4,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},x.createElement(u4,{label:e.label,labelRef:e.labelRef}),e.children)))}),gN=x.forwardRef((e,t)=>{var n=ar(e,Pa);return x.createElement(lme,al({},n,{ref:t}))});gN.displayName="CartesianAxis";var cme=["x1","y1","x2","y2","key"],ume=["offset"],dme=["xAxisId","yAxisId"],fme=["xAxisId","yAxisId"];function Kz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Gn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Kz(Object(n),!0).forEach(function(r){hme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hme(e,t,n){return(t=pme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pme(e){var t=mme(e,"string");return typeof t=="symbol"?t:t+""}function mme(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Io(){return Io=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Io.apply(null,arguments)}function hg(e,t){if(e==null)return{};var n,r,i=gme(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function gme(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var vme=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:i,width:s,height:l,ry:c}=e;return x.createElement("rect",{x:r,y:i,ry:c,width:s,height:l,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function C4(e){var{option:t,lineItemProps:n}=e,r;if(x.isValidElement(t))r=x.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var i,{x1:s,y1:l,x2:c,y2:f,key:h}=n,p=hg(n,cme),g=(i=Ni(p))!==null&&i!==void 0?i:{},{offset:v}=g,y=hg(g,ume);r=x.createElement("line",Io({},y,{x1:s,y1:l,x2:c,y2:f,fill:"none",key:h}))}return r}function yme(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:s,yAxisId:l}=e,c=hg(e,dme),f=i.map((h,p)=>{var g=Gn(Gn({},c),{},{x1:t,y1:h,x2:t+n,y2:h,key:"line-".concat(p),index:p});return x.createElement(C4,{key:"line-".concat(p),option:r,lineItemProps:g})});return x.createElement("g",{className:"recharts-cartesian-grid-horizontal"},f)}function bme(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:s,yAxisId:l}=e,c=hg(e,fme),f=i.map((h,p)=>{var g=Gn(Gn({},c),{},{x1:h,y1:t,x2:h,y2:t+n,key:"line-".concat(p),index:p});return x.createElement(C4,{option:r,lineItemProps:g,key:"line-".concat(p)})});return x.createElement("g",{className:"recharts-cartesian-grid-vertical"},f)}function xme(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:s,height:l,horizontalPoints:c,horizontal:f=!0}=e;if(!f||!t||!t.length||c==null)return null;var h=c.map(g=>Math.round(g+i-i)).sort((g,v)=>g-v);i!==h[0]&&h.unshift(0);var p=h.map((g,v)=>{var y=h[v+1],w=y==null,S=w?i+l-g:y-g;if(S<=0)return null;var N=v%t.length;return x.createElement("rect",{key:"react-".concat(v),y:g,x:r,height:S,width:s,stroke:"none",fill:t[N],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function wme(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:s,width:l,height:c,verticalPoints:f}=e;if(!t||!n||!n.length)return null;var h=f.map(g=>Math.round(g+i-i)).sort((g,v)=>g-v);i!==h[0]&&h.unshift(0);var p=h.map((g,v)=>{var y=h[v+1],w=y==null,S=w?i+l-g:y-g;if(S<=0)return null;var N=v%n.length;return x.createElement("rect",{key:"react-".concat(v),x:g,y:s,width:S,height:c,stroke:"none",fill:n[N],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var Sme=(e,t)=>{var{xAxis:n,width:r,height:i,offset:s}=e;return o$(mN(Gn(Gn(Gn({},Pa),n),{},{ticks:l$(n),viewBox:{x:0,y:0,width:r,height:i}})),s.left,s.left+s.width,t)},jme=(e,t)=>{var{yAxis:n,width:r,height:i,offset:s}=e;return o$(mN(Gn(Gn(Gn({},Pa),n),{},{ticks:l$(n),viewBox:{x:0,y:0,width:r,height:i}})),s.top,s.top+s.height,t)},Nme={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Zn.grid};function O4(e){var t=oj(),n=lj(),r=g$(),i=Gn(Gn({},ar(e,Nme)),{},{x:Pe(e.x)?e.x:r.left,y:Pe(e.y)?e.y:r.top,width:Pe(e.width)?e.width:r.width,height:Pe(e.height)?e.height:r.height}),{xAxisId:s,yAxisId:l,x:c,y:f,width:h,height:p,syncWithTicks:g,horizontalValues:v,verticalValues:y}=i,w=sr(),S=Re(R=>nz(R,"xAxis",s,w)),N=Re(R=>nz(R,"yAxis",l,w));if(!Qi(h)||!Qi(p)||!Pe(c)||!Pe(f))return null;var C=i.verticalCoordinatesGenerator||Sme,E=i.horizontalCoordinatesGenerator||jme,{horizontalPoints:k,verticalPoints:O}=i;if((!k||!k.length)&&typeof E=="function"){var T=v&&v.length,P=E({yAxis:N?Gn(Gn({},N),{},{ticks:T?v:N.ticks}):void 0,width:t??h,height:n??p,offset:r},T?!0:g);$m(Array.isArray(P),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof P,"]")),Array.isArray(P)&&(k=P)}if((!O||!O.length)&&typeof C=="function"){var A=y&&y.length,z=C({xAxis:S?Gn(Gn({},S),{},{ticks:A?y:S.ticks}):void 0,width:t??h,height:n??p,offset:r},A?!0:g);$m(Array.isArray(z),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof z,"]")),Array.isArray(z)&&(O=z)}return x.createElement(ra,{zIndex:i.zIndex},x.createElement("g",{className:"recharts-cartesian-grid"},x.createElement(vme,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),x.createElement(xme,Io({},i,{horizontalPoints:k})),x.createElement(wme,Io({},i,{verticalPoints:O})),x.createElement(yme,Io({},i,{offset:r,horizontalPoints:k,xAxis:S,yAxis:N})),x.createElement(bme,Io({},i,{offset:r,verticalPoints:O,xAxis:S,yAxis:N}))))}O4.displayName="CartesianGrid";var Cme={},_4=Yn({name:"errorBars",initialState:Cme,reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:i}=t.payload;e[n]&&(e[n]=e[n].map(s=>s.dataKey===r.dataKey&&s.direction===r.direction?i:s))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(i=>i.dataKey!==r.dataKey||i.direction!==r.direction))}}}),{addErrorBar:Zye,replaceErrorBar:Yye,removeErrorBar:Wye}=_4.actions,Ome=_4.reducer;function k4(e,t){var n,r,i=Re(h=>ta(h,e)),s=Re(h=>na(h,t)),l=(n=i?.allowDataOverflow)!==null&&n!==void 0?n:yn.allowDataOverflow,c=(r=s?.allowDataOverflow)!==null&&r!==void 0?r:bn.allowDataOverflow,f=l||c;return{needClip:f,needClipX:l,needClipY:c}}function _me(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=pN(),{needClipX:s,needClipY:l,needClip:c}=k4(t,n);if(!c||!i)return null;var{x:f,y:h,width:p,height:g}=i;return x.createElement("clipPath",{id:"clipPath-".concat(r)},x.createElement("rect",{x:s?f:f-p/2,y:l?h:h-g/2,width:s?p:p*2,height:l?g:g*2}))}function kme(e){var t=Qg(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:s}=t,l=Number(i),c=Number(s);return(Number.isNaN(l)||l<0)&&(l=n),(Number.isNaN(c)||c<0)&&(c=r),{r:l,strokeWidth:c}}return{r:n,strokeWidth:r}}function vN(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.xAxisId)!==null&&n!==void 0?n:v4}function yN(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.yAxisId)!==null&&n!==void 0?n:v4}var A4=(e,t,n)=>x3(e,"xAxis",vN(e,t),n),E4=(e,t,n)=>b3(e,"xAxis",vN(e,t),n),T4=(e,t,n)=>x3(e,"yAxis",yN(e,t),n),P4=(e,t,n)=>b3(e,"yAxis",yN(e,t),n),Ame=ne([$t,A4,T4,E4,P4],(e,t,n,r,i)=>ea(e,"xAxis")?Lm(t,r,!1):Lm(n,i,!1)),Eme=(e,t)=>t,z4=ne([B5,Eme],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),M4=e=>{var t=$t(e),n=ea(t,"xAxis");return n?"yAxis":"xAxis"},Tme=(e,t)=>{var n=M4(e);return n==="yAxis"?yN(e,t):vN(e,t)},Pme=(e,t,n)=>Q5(e,M4(e),Tme(e,t),n),zme=ne([z4,Pme],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=Sj(e);if(!(r==null||i==null)){var s=(n=t[r])===null||n===void 0?void 0:n.stackedData,l=s?.find(c=>c.key===i);if(l!=null)return l.map(c=>[c[0],c[1]])}}}),Mme=ne([$t,A4,T4,E4,P4,zme,Xae,Ame,z4,ose],(e,t,n,r,i,s,l,c,f,h)=>{var{chartData:p,dataStartIndex:g,dataEndIndex:v}=l;if(!(f==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||i==null||r.length===0||i.length===0||c==null)){var{data:y}=f,w;if(y&&y.length>0?w=y:w=p?.slice(g,v+1),w!=null)return ege({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:g,areaSettings:f,stackedData:s,displayedData:w,chartBaseValue:h,bandSize:c})}}),Rme=["id"],Dme=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function Go(){return Go=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Go.apply(null,arguments)}function R4(e,t){if(e==null)return{};var n,r,i=Ime(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ime(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Hz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Hz(Object(n),!0).forEach(function(r){Lme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lme(e,t,n){return(t=$me(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $me(e){var t=Ume(e,"string");return typeof t=="symbol"?t:t+""}function Ume(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pg(e,t){return e&&e!=="none"?e:t}var Bme=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:s,hide:l}=e;return[{inactive:l,dataKey:t,type:s,color:pg(r,i),value:c$(n,t),payload:e}]},qme=x.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:s,name:l,hide:c,unit:f,tooltipType:h,id:p}=e,g={dataDefinedOnItem:n,getPosition:tu,settings:{stroke:r,strokeWidth:i,fill:s,dataKey:t,nameKey:void 0,name:c$(l,t),hide:c,type:h,color:pg(r,s),unit:f,graphicalItemId:p}};return x.createElement(She,{tooltipEntrySettings:g})});function Fme(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:s,dataKey:l}=r,c=Ni(r);return x.createElement(Khe,{points:n,dot:s,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:l,baseProps:c,needClip:i,clipPathId:t})}function Kme(e){var{showLabels:t,children:n,points:r}=e,i=r.map(s=>{var l,c,f={x:(l=s.x)!==null&&l!==void 0?l:0,y:(c=s.y)!==null&&c!==void 0?c:0,width:0,lowerWidth:0,upperWidth:0,height:0};return jc(jc({},f),{},{value:s.value,payload:s.payload,parentViewBox:void 0,viewBox:f,fill:void 0})});return x.createElement(mhe,{value:t?i:void 0},n)}function Gz(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:s}=e,{layout:l,type:c,stroke:f,connectNulls:h,isRange:p}=s,{id:g}=s,v=R4(s,Rme),y=Ni(v),w=xr(v);return x.createElement(x.Fragment,null,t?.length>1&&x.createElement(Ci,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},x.createElement(Qp,Go({},w,{id:g,points:t,connectNulls:h,type:c,baseLine:n,layout:l,stroke:"none",className:"recharts-area-area"})),f!=="none"&&x.createElement(Qp,Go({},y,{className:"recharts-area-curve",layout:l,type:c,connectNulls:h,fill:"none",points:t})),f!=="none"&&p&&Array.isArray(n)&&x.createElement(Qp,Go({},y,{className:"recharts-area-curve",layout:l,type:c,connectNulls:h,fill:"none",points:n}))),x.createElement(Fme,{points:t,props:v,clipPathId:i}))}function Hme(e){var t,n,{alpha:r,baseLine:i,points:s,strokeWidth:l}=e,c=(t=s[0])===null||t===void 0?void 0:t.y,f=(n=s[s.length-1])===null||n===void 0?void 0:n.y;if(!He(c)||!He(f))return null;var h=r*Math.abs(c-f),p=Math.max(...s.map(g=>g.x||0));return Pe(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(g=>g.x||0),p)),Pe(p)?x.createElement("rect",{x:0,y:c<f?c:c-h,width:p+(l?parseInt("".concat(l),10):1),height:Math.floor(h)}):null}function Gme(e){var t,n,{alpha:r,baseLine:i,points:s,strokeWidth:l}=e,c=(t=s[0])===null||t===void 0?void 0:t.x,f=(n=s[s.length-1])===null||n===void 0?void 0:n.x;if(!He(c)||!He(f))return null;var h=r*Math.abs(c-f),p=Math.max(...s.map(g=>g.y||0));return Pe(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(g=>g.y||0),p)),Pe(p)?x.createElement("rect",{x:c<f?c:c-h,y:0,width:h,height:Math.floor(p+(l?parseInt("".concat(l),10):1))}):null}function Vme(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:s}=e;return n==="vertical"?x.createElement(Hme,{alpha:t,points:r,baseLine:i,strokeWidth:s}):x.createElement(Gme,{alpha:t,points:r,baseLine:i,strokeWidth:s})}function Zme(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:s}=e,{points:l,baseLine:c,isAnimationActive:f,animationBegin:h,animationDuration:p,animationEasing:g,onAnimationStart:v,onAnimationEnd:y}=r,w=x.useMemo(()=>({points:l,baseLine:c}),[l,c]),S=P$(w,"recharts-area-"),N=cj(),[C,E]=x.useState(!1),k=!C,O=x.useCallback(()=>{typeof y=="function"&&y(),E(!1)},[y]),T=x.useCallback(()=>{typeof v=="function"&&v(),E(!0)},[v]);if(N==null)return null;var P=i.current,A=s.current;return x.createElement(Kme,{showLabels:k,points:l},r.children,x.createElement(T$,{animationId:S,begin:h,duration:p,isActive:f,easing:g,onAnimationEnd:O,onAnimationStart:T,key:S},z=>{if(P){var R=P.length/l.length,q=z===1?l:l.map((L,ae)=>{var pe=Math.floor(ae*R);if(P[pe]){var ge=P[pe];return jc(jc({},L),{},{x:Fi(ge.x,L.x,z),y:Fi(ge.y,L.y,z)})}return L}),U;return Pe(c)?U=Fi(A,c,z):Ln(c)||Wi(c)?U=Fi(A,0,z):U=c.map((L,ae)=>{var pe=Math.floor(ae*R);if(Array.isArray(A)&&A[pe]){var ge=A[pe];return jc(jc({},L),{},{x:Fi(ge.x,L.x,z),y:Fi(ge.y,L.y,z)})}return L}),z>0&&(i.current=q,s.current=U),x.createElement(Gz,{points:q,baseLine:U,needClip:t,clipPathId:n,props:r})}return z>0&&(i.current=l,s.current=c),x.createElement(Ci,null,f&&x.createElement("defs",null,x.createElement("clipPath",{id:"animationClipPath-".concat(n)},x.createElement(Vme,{alpha:z,points:l,baseLine:c,layout:N,strokeWidth:r.strokeWidth}))),x.createElement(Ci,{clipPath:"url(#animationClipPath-".concat(n,")")},x.createElement(Gz,{points:l,baseLine:c,needClip:t,clipPathId:n,props:r})))}),x.createElement(yhe,{label:r.label}))}function Yme(e){var{needClip:t,clipPathId:n,props:r}=e,i=x.useRef(null),s=x.useRef();return x.createElement(Zme,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:s})}class Wme extends x.PureComponent{render(){var{hide:t,dot:n,points:r,className:i,top:s,left:l,needClip:c,xAxisId:f,yAxisId:h,width:p,height:g,id:v,baseLine:y,zIndex:w}=this.props;if(t)return null;var S=ft("recharts-area",i),N=v,{r:C,strokeWidth:E}=kme(n),k=m4(n),O=C*2+E,T=c?"url(#clipPath-".concat(k?"":"dots-").concat(N,")"):void 0;return x.createElement(ra,{zIndex:w},x.createElement(Ci,{className:S},c&&x.createElement("defs",null,x.createElement(_me,{clipPathId:N,xAxisId:f,yAxisId:h}),!k&&x.createElement("clipPath",{id:"clipPath-dots-".concat(N)},x.createElement("rect",{x:l-O/2,y:s-O/2,width:p+O,height:g+O}))),x.createElement(Yme,{needClip:c,clipPathId:N,props:this.props})),x.createElement(Lz,{points:r,mainColor:pg(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:T}),this.props.isRange&&Array.isArray(y)&&x.createElement(Lz,{points:y,mainColor:pg(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:T}))}}var Qme={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:Zn.area};function Xme(e){var t,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:s,connectNulls:l,dot:c,fill:f,fillOpacity:h,hide:p,isAnimationActive:g,legendType:v,stroke:y,xAxisId:w,yAxisId:S}=e,N=R4(e,Dme),C=nu(),E=F3(),{needClip:k}=k4(w,S),O=sr(),{points:T,isRange:P,baseLine:A}=(t=Re(ae=>Mme(ae,e.id,O)))!==null&&t!==void 0?t:{},z=pN();if(C!=="horizontal"&&C!=="vertical"||z==null||E!=="AreaChart"&&E!=="ComposedChart")return null;var{height:R,width:q,x:U,y:L}=z;return!T||!T.length?null:x.createElement(Wme,Go({},N,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:s,baseLine:A,connectNulls:l,dot:c,fill:f,fillOpacity:h,height:R,hide:p,layout:C,isAnimationActive:g,isRange:P,legendType:v,needClip:k,points:T,stroke:y,width:q,left:U,top:L,xAxisId:w,yAxisId:S}))}var Jme=(e,t,n,r,i)=>{var s=n??t;if(Pe(s))return s;var l=e==="horizontal"?i:r,c=l.scale.domain();if(l.type==="number"){var f=Math.max(c[0],c[1]),h=Math.min(c[0],c[1]);return s==="dataMin"?h:s==="dataMax"||f<0?f:Math.max(Math.min(c[0],c[1]),0)}return s==="dataMin"?c[0]:s==="dataMax"?c[1]:c[0]};function ege(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:s,chartBaseValue:l,xAxis:c,yAxis:f,displayedData:h,dataStartIndex:p,xAxisTicks:g,yAxisTicks:v,bandSize:y}=e,w=i&&i.length,S=Jme(s,l,n,c,f),N=s==="horizontal",C=!1,E=h.map((O,T)=>{var P,A,z,R;if(w)R=i[p+T];else{var q=Cn(O,r);Array.isArray(q)?(R=q,C=!0):R=[S,q]}var U=(P=(A=R)===null||A===void 0?void 0:A[1])!==null&&P!==void 0?P:null,L=U==null||w&&!t&&Cn(O,r)==null;if(N){var ae;return{x:WT({axis:c,ticks:g,bandSize:y,entry:O,index:T}),y:L?null:(ae=f.scale.map(U))!==null&&ae!==void 0?ae:null,value:R,payload:O}}return{x:L?null:(z=c.scale.map(U))!==null&&z!==void 0?z:null,y:WT({axis:f,ticks:v,bandSize:y,entry:O,index:T}),value:R,payload:O}}),k;return w||C?k=E.map(O=>{var T,P=Array.isArray(O.value)?O.value[0]:null;if(N){var A;return{x:O.x,y:P!=null&&O.y!=null&&(A=f.scale.map(P))!==null&&A!==void 0?A:null,payload:O.payload}}return{x:P!=null&&(T=c.scale.map(P))!==null&&T!==void 0?T:null,y:O.y,payload:O.payload}}):k=N?f.scale.map(S):c.scale.map(S),{points:E,baseLine:k??0,isRange:C}}function tge(e){var t=ar(e,Qme),n=sr();return x.createElement(khe,{id:t.id,type:"area"},r=>x.createElement(x.Fragment,null,x.createElement(jhe,{legendPayload:Bme(t)}),x.createElement(qme,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),x.createElement(Rhe,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:Bne(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),x.createElement(Xme,Go({},t,{id:r}))))}var mg=x.memo(tge,wf);mg.displayName="Area";var nge=["domain","range"],rge=["domain","range"];function Vz(e,t){if(e==null)return{};var n,r,i=ige(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ige(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Zz(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function D4(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=Vz(e,nge),{domain:s,range:l}=t,c=Vz(t,rge);return!Zz(n,s)||!Zz(r,l)?!1:wf(i,c)}var age=["type"],sge=["dangerouslySetInnerHTML","ticks","scale"],oge=["id","scale"];function PS(){return PS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},PS.apply(null,arguments)}function Yz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Wz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Yz(Object(n),!0).forEach(function(r){lge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lge(e,t,n){return(t=cge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cge(e){var t=uge(e,"string");return typeof t=="symbol"?t:t+""}function uge(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zS(e,t){if(e==null)return{};var n,r,i=dge(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function dge(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function fge(e){var t=Ht(),n=x.useRef(null),r=cj(),{type:i}=e,s=zS(e,age),l=Sv(r,"xAxis",i),c=x.useMemo(()=>{if(l!=null)return Wz(Wz({},s),{},{type:l})},[s,l]);return x.useLayoutEffect(()=>{c!=null&&(n.current===null?t(Yhe(c)):n.current!==c&&t(Whe({prev:n.current,next:c})),n.current=c)},[c,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(Qhe(n.current)),n.current=null)},[t]),null}var hge=e=>{var{xAxisId:t,className:n}=e,r=Re(d$),i=sr(),s="xAxis",l=Re(C=>y3(C,s,t,i)),c=Re(C=>Ice(C,t)),f=Re(C=>Fce(C,t)),h=Re(C=>I5(C,t));if(c==null||f==null||h==null)return null;var{dangerouslySetInnerHTML:p,ticks:g,scale:v}=e,y=zS(e,sge),{id:w,scale:S}=h,N=zS(h,oge);return x.createElement(gN,PS({},y,N,{x:f.x,y:f.y,width:c.width,height:c.height,className:ft("recharts-".concat(s," ").concat(s),n),viewBox:r,ticks:l,axisType:s,axisId:t}))},pge={allowDataOverflow:yn.allowDataOverflow,allowDecimals:yn.allowDecimals,allowDuplicatedCategory:yn.allowDuplicatedCategory,angle:yn.angle,axisLine:Pa.axisLine,height:yn.height,hide:!1,includeHidden:yn.includeHidden,interval:yn.interval,label:!1,minTickGap:yn.minTickGap,mirror:yn.mirror,orientation:yn.orientation,padding:yn.padding,reversed:yn.reversed,scale:yn.scale,tick:yn.tick,tickCount:yn.tickCount,tickLine:Pa.tickLine,tickSize:Pa.tickSize,type:yn.type,niceTicks:yn.niceTicks,xAxisId:0},mge=e=>{var t=ar(e,pge);return x.createElement(x.Fragment,null,x.createElement(fge,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),x.createElement(hge,t))},bN=x.memo(mge,D4);bN.displayName="XAxis";var gge=["type"],vge=["dangerouslySetInnerHTML","ticks","scale"],yge=["id","scale"];function MS(){return MS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},MS.apply(null,arguments)}function Qz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Xz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Qz(Object(n),!0).forEach(function(r){bge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bge(e,t,n){return(t=xge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xge(e){var t=wge(e,"string");return typeof t=="symbol"?t:t+""}function wge(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function RS(e,t){if(e==null)return{};var n,r,i=Sge(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Sge(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function jge(e){var t=Ht(),n=x.useRef(null),r=cj(),{type:i}=e,s=RS(e,gge),l=Sv(r,"yAxis",i),c=x.useMemo(()=>{if(l!=null)return Xz(Xz({},s),{},{type:l})},[l,s]);return x.useLayoutEffect(()=>{c!=null&&(n.current===null?t(Xhe(c)):n.current!==c&&t(Jhe({prev:n.current,next:c})),n.current=c)},[c,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(epe(n.current)),n.current=null)},[t]),null}function Nge(e){var{yAxisId:t,className:n,width:r,label:i}=e,s=x.useRef(null),l=x.useRef(null),c=Re(d$),f=sr(),h=Ht(),p="yAxis",g=Re(P=>Gce(P,t)),v=Re(P=>Hce(P,t)),y=Re(P=>y3(P,p,t,f)),w=Re(P=>L5(P,t));if(x.useLayoutEffect(()=>{if(!(r!=="auto"||!g||hN(i)||x.isValidElement(i)||w==null)){var P=s.current;if(P){var A=P.getCalculatedWidth();Math.round(g.width)!==Math.round(A)&&h(tpe({id:t,width:A}))}}},[y,g,h,i,t,r,w]),g==null||v==null||w==null)return null;var{dangerouslySetInnerHTML:S,ticks:N,scale:C}=e,E=RS(e,vge),{id:k,scale:O}=w,T=RS(w,yge);return x.createElement(gN,MS({},E,T,{ref:s,labelRef:l,x:v.x,y:v.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:g.width,height:g.height,className:ft("recharts-".concat(p," ").concat(p),n),viewBox:c,ticks:y,axisType:p,axisId:t}))}var Cge={allowDataOverflow:bn.allowDataOverflow,allowDecimals:bn.allowDecimals,allowDuplicatedCategory:bn.allowDuplicatedCategory,angle:bn.angle,axisLine:Pa.axisLine,hide:!1,includeHidden:bn.includeHidden,interval:bn.interval,label:!1,minTickGap:bn.minTickGap,mirror:bn.mirror,orientation:bn.orientation,padding:bn.padding,reversed:bn.reversed,scale:bn.scale,tick:bn.tick,tickCount:bn.tickCount,tickLine:Pa.tickLine,tickSize:Pa.tickSize,type:bn.type,niceTicks:bn.niceTicks,width:bn.width,yAxisId:0},Oge=e=>{var t=ar(e,Cge);return x.createElement(x.Fragment,null,x.createElement(jge,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),x.createElement(Nge,t))},xN=x.memo(Oge,D4);xN.displayName="YAxis";var _ge=(e,t)=>t,wN=ne([_ge,$t,J$,_n,I3,Ba,pde,Un],wde);function kge(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function SN(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(kge(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var s=e.currentTarget;n=s.offsetWidth>0?t.width/s.offsetWidth:1,r=s.offsetHeight>0?t.height/s.offsetHeight:1}var l=(c,f)=>({relativeX:Math.round((c-t.left)/n),relativeY:Math.round((f-t.top)/r)});return"touches"in e?Array.from(e.touches).map(c=>l(c.clientX,c.clientY)):l(e.clientX,e.clientY)}var I4=zr("mouseClick"),L4=gf();L4.startListening({actionCreator:I4,effect:(e,t)=>{var n=e.payload,r=wN(t.getState(),SN(n));r?.activeIndex!=null&&t.dispatch(oue({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var DS=zr("mouseMove"),$4=gf(),dc=null,wo=null,tw=null;$4.startListening({actionCreator:DS,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:s}=r.eventSettings,l=s==="all"||s?.includes("mousemove");dc!==null&&(cancelAnimationFrame(dc),dc=null),wo!==null&&(typeof i!="number"||!l)&&(clearTimeout(wo),wo=null),tw=SN(n);var c=()=>{var f=t.getState(),h=Ef(f,f.tooltip.settings.shared);if(!tw){dc=null,wo=null;return}if(h==="axis"){var p=wN(f,tw);p?.activeIndex!=null?t.dispatch(_3({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate})):t.dispatch(O3())}dc=null,wo=null};if(!l){c();return}i==="raf"?dc=requestAnimationFrame(c):typeof i=="number"&&wo===null&&(wo=setTimeout(c,i))}});function Age(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<<CHILDREN>>":t}var Jz={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},U4=Yn({name:"rootProps",initialState:Jz,reducers:{updateOptions:(e,t)=>{var n;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(n=t.payload.barGap)!==null&&n!==void 0?n:Jz.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),Ege=U4.reducer,{updateOptions:Tge}=U4.actions,Pge=null,zge={updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)},B4=Yn({name:"polarOptions",initialState:Pge,reducers:zge}),{updatePolarOptions:Qye}=B4.actions,Mge=B4.reducer,q4=zr("keyDown"),F4=zr("focus"),K4=zr("blur"),Rv=gf(),fc=null,So=null,zp=null;Rv.startListening({actionCreator:q4,effect:(e,t)=>{zp=e.payload,fc!==null&&(cancelAnimationFrame(fc),fc=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,s=i==="all"||i.includes("keydown");So!==null&&(typeof r!="number"||!s)&&(clearTimeout(So),So=null);var l=()=>{try{var c=t.getState(),f=c.rootProps.accessibilityLayer!==!1;if(!f)return;var{keyboardInteraction:h}=c.tooltip,p=zp;if(p!=="ArrowRight"&&p!=="ArrowLeft"&&p!=="Enter")return;var g=Ed(h,il(c),Fc(c),Hc(c)),v=g==null?-1:Number(g),y=!Number.isFinite(v)||v<0,w=Ba(c),S=il(c),N=Ef(c,c.tooltip.settings.shared);if(p==="Enter"){if(y)return;var C=cg(c,N,"hover",String(h.index));t.dispatch(lg({active:!h.active,activeIndex:h.index,activeCoordinate:C}));return}var E=Qce(c),k=E==="left-to-right"?1:-1,O=p==="ArrowRight"?1:-1,T;if(y){var P=Fc(c),A=Hc(c),z=O*k,R=pe=>({active:!1,index:String(pe),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(T=-1,z>0){for(var q=0;q<S.length;q++)if(Ed(R(q),S,P,A)!=null){T=q;break}}else for(var U=S.length-1;U>=0;U--)if(Ed(R(U),S,P,A)!=null){T=U;break}if(T<0)return}else{T=v+O*k;var L=w?.length||S.length;if(L===0||T>=L||T<0)return}var ae=cg(c,N,"hover",String(T));t.dispatch(lg({active:!0,activeIndex:T.toString(),activeCoordinate:ae}))}finally{fc=null,So=null}};if(!s){l();return}r==="raf"?fc=requestAnimationFrame(l):typeof r=="number"&&So===null&&(l(),zp=null,So=setTimeout(()=>{zp?l():(So=null,fc=null)},r))}});Rv.startListening({actionCreator:F4,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;if(!i.active&&i.index==null){var s="0",l=Ef(n,n.tooltip.settings.shared),c=cg(n,l,"hover",String(s));t.dispatch(lg({active:!0,activeIndex:s,activeCoordinate:c}))}}}});Rv.startListening({actionCreator:K4,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(lg({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function H4(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(n,r)=>{if(r==="currentTarget")return t;var i=Reflect.get(n,r);return typeof i=="function"?i.bind(n):i}})}var Zr=zr("externalEvent"),G4=gf(),Mp=new Map,yd=new Map,nw=new Map;G4.startListening({actionCreator:Zr,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,s=H4(r);nw.set(i,{handler:n,reactEvent:s});var l=Mp.get(i);l!==void 0&&(cancelAnimationFrame(l),Mp.delete(i));var c=t.getState(),{throttleDelay:f,throttledEvents:h}=c.eventSettings,p=h,g=p==="all"||p?.includes(i),v=yd.get(i);v!==void 0&&(typeof f!="number"||!g)&&(clearTimeout(v),yd.delete(i));var y=()=>{var N=nw.get(i);try{if(!N)return;var{handler:C,reactEvent:E}=N,k=t.getState(),O={activeCoordinate:Jue(k),activeDataKey:Wue(k),activeIndex:rf(k),activeLabel:U3(k),activeTooltipIndex:rf(k),isTooltipActive:ede(k)};C&&C(O,E)}finally{Mp.delete(i),yd.delete(i),nw.delete(i)}};if(!g){y();return}if(f==="raf"){var w=requestAnimationFrame(y);Mp.set(i,w)}else if(typeof f=="number"){if(!yd.has(i)){y();var S=setTimeout(y,f);yd.set(i,S)}}else y()}}});var Rge=ne([uu],e=>e.tooltipItemPayloads),Dge=ne([Rge,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(s=>s.settings.graphicalItemId===n);if(r!=null){var{getPosition:i}=r;if(i!=null)return i(t)}}}),V4=zr("touchMove"),Z4=gf(),jo=null,bs=null,eM=null,bd=null;Z4.startListening({actionCreator:V4,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){bd=H4(n);var r=t.getState(),{throttleDelay:i,throttledEvents:s}=r.eventSettings,l=s==="all"||s.includes("touchmove");jo!==null&&(cancelAnimationFrame(jo),jo=null),bs!==null&&(typeof i!="number"||!l)&&(clearTimeout(bs),bs=null),eM=Array.from(n.touches).map(f=>SN({clientX:f.clientX,clientY:f.clientY,currentTarget:n.currentTarget}));var c=()=>{if(bd!=null){var f=t.getState(),h=Ef(f,f.tooltip.settings.shared);if(h==="axis"){var p,g=(p=eM)===null||p===void 0?void 0:p[0];if(g==null){jo=null,bs=null;return}var v=wN(f,g);v?.activeIndex!=null&&t.dispatch(_3({activeIndex:v.activeIndex,activeDataKey:void 0,activeCoordinate:v.activeCoordinate}))}else if(h==="item"){var y,w=bd.touches[0];if(document.elementFromPoint==null||w==null)return;var S=document.elementFromPoint(w.clientX,w.clientY);if(!S||!S.getAttribute)return;var N=S.getAttribute(Zne),C=(y=S.getAttribute(Yne))!==null&&y!==void 0?y:void 0,E=ml(f).find(T=>T.id===C);if(N==null||E==null||C==null)return;var{dataKey:k}=E,O=Dge(f,N,C);t.dispatch(sue({activeDataKey:k,activeIndex:N,activeCoordinate:O,activeGraphicalItemId:C}))}jo=null,bs=null}};if(!l){c();return}i==="raf"?jo=requestAnimationFrame(c):typeof i=="number"&&bs===null&&(c(),bd=null,bs=setTimeout(()=>{bd?c():(bs=null,jo=null)},i))}}});var Y4={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},W4=Yn({name:"eventSettings",initialState:Y4,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:Ige}=W4.actions,Lge=W4.reducer,$ge=PL({brush:dpe,cartesianAxis:npe,chartData:Xde,errorBars:Ome,eventSettings:Lge,graphicalItems:zhe,layout:Pne,legend:qre,options:Vde,polarAxis:xhe,polarOptions:Mge,referenceElements:bpe,renderedTicks:Zpe,rootProps:Ege,tooltip:lue,zIndex:Mde}),Uge=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return rne({reducer:$ge,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([L4.middleware,$4.middleware,Rv.middleware,G4.middleware,Z4.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(VL({type:"raf"}))},devTools:{serialize:{replacer:Age},name:"recharts-".concat(n)}})};function Bge(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=sr(),s=x.useRef(null);if(i)return n;s.current==null&&(s.current=Uge(t,r));var l=X1;return x.createElement(sie,{context:l,store:s.current},n)}function qge(e){var{layout:t,margin:n}=e,r=Ht(),i=sr();return x.useEffect(()=>{i||(r(Ane(t)),r(kne(n)))},[r,i,t,n]),null}var Fge=x.memo(qge,wf);function Kge(e){var t=Ht();return x.useEffect(()=>{t(Tge(e))},[t,e]),null}var Hge=e=>{var t=Ht();return x.useEffect(()=>{t(Ige(e))},[t,e]),null},Gge=x.memo(Hge,wf);function tM(e){var{zIndex:t,isPanorama:n}=e,r=x.useRef(null),i=Ht();return x.useLayoutEffect(()=>(r.current&&i(Pde({zIndex:t,element:r.current,isPanorama:n})),()=>{i(zde({zIndex:t,isPanorama:n}))}),[i,t,n]),x.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function nM(e){var{children:t,isPanorama:n}=e,r=Re(jde);if(!r||r.length===0)return t;var i=r.filter(l=>l<0),s=r.filter(l=>l>0);return x.createElement(x.Fragment,null,i.map(l=>x.createElement(tM,{key:l,zIndex:l,isPanorama:n})),t,s.map(l=>x.createElement(tM,{key:l,zIndex:l,isPanorama:n})))}var Vge=["children"];function Zge(e,t){if(e==null)return{};var n,r,i=Yge(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Yge(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function gg(){return gg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gg.apply(null,arguments)}var Wge={width:"100%",height:"100%",display:"block"},Qge=x.forwardRef((e,t)=>{var n=oj(),r=lj(),i=_$();if(!Qi(n)||!Qi(r))return null;var{children:s,otherAttributes:l,title:c,desc:f}=e,h,p;return l!=null&&(typeof l.tabIndex=="number"?h=l.tabIndex:h=i?0:void 0,typeof l.role=="string"?p=l.role:p=i?"application":void 0),x.createElement(F1,gg({},l,{title:c,desc:f,role:p,tabIndex:h,width:n,height:r,style:Wge,ref:t}),s)}),Xge=e=>{var{children:t}=e,n=Re(mv);if(!n)return null;var{width:r,height:i,y:s,x:l}=n;return x.createElement(F1,{width:r,height:i,x:l,y:s},t)},rM=x.forwardRef((e,t)=>{var{children:n}=e,r=Zge(e,Vge),i=sr();return i?x.createElement(Xge,null,x.createElement(nM,{isPanorama:!0},n)):x.createElement(Qge,gg({ref:t},r),x.createElement(nM,{isPanorama:!1},n))});function Jge(){var e=Ht(),[t,n]=x.useState(null),r=Re(Vne);return x.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),s=i.width/t.offsetWidth;He(s)&&s!==r&&e(Tne(s))}},[t,e,r]),n}function iM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function eve(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iM(Object(n),!0).forEach(function(r){tve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tve(e,t,n){return(t=nve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nve(e){var t=rve(e,"string");return typeof t=="symbol"?t:t+""}function rve(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Is(){return Is=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Is.apply(null,arguments)}var ive=()=>(ofe(),null);function vg(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var ave=x.forwardRef((e,t)=>{var n,r,i=x.useRef(null),[s,l]=x.useState({containerWidth:vg((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:vg((r=e.style)===null||r===void 0?void 0:r.height)}),c=x.useCallback((h,p)=>{l(g=>{var v=Math.round(h),y=Math.round(p);return g.containerWidth===v&&g.containerHeight===y?g:{containerWidth:v,containerHeight:y}})},[]),f=x.useCallback(h=>{if(typeof t=="function"&&t(h),i.current!=null&&(i.current.disconnect(),i.current=null),h!=null&&typeof ResizeObserver<"u"){var{width:p,height:g}=h.getBoundingClientRect();c(p,g);var v=w=>{var S=w[0];if(S!=null){var{width:N,height:C}=S.contentRect;c(N,C)}},y=new ResizeObserver(v);y.observe(h),i.current=y}},[t,c]);return x.useEffect(()=>()=>{var h=i.current;h?.disconnect()},[c]),x.createElement(x.Fragment,null,x.createElement(bf,{width:s.containerWidth,height:s.containerHeight}),x.createElement("div",Is({ref:f},e)))}),sve=x.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,s]=x.useState({containerWidth:vg(n),containerHeight:vg(r)}),l=x.useCallback((f,h)=>{s(p=>{var g=Math.round(f),v=Math.round(h);return p.containerWidth===g&&p.containerHeight===v?p:{containerWidth:g,containerHeight:v}})},[]),c=x.useCallback(f=>{if(typeof t=="function"&&t(f),f!=null){var{width:h,height:p}=f.getBoundingClientRect();l(h,p)}},[t,l]);return x.createElement(x.Fragment,null,x.createElement(bf,{width:i.containerWidth,height:i.containerHeight}),x.createElement("div",Is({ref:c},e)))}),ove=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return x.createElement(x.Fragment,null,x.createElement(bf,{width:n,height:r}),x.createElement("div",Is({ref:t},e)))}),lve=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?x.createElement(sve,Is({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?x.createElement(ove,Is({},e,{width:n,height:r,ref:t})):x.createElement(x.Fragment,null,x.createElement(bf,{width:n,height:r}),x.createElement("div",Is({ref:t},e)))});function cve(e){return e?ave:lve}var uve=x.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:s,onContextMenu:l,onDoubleClick:c,onMouseDown:f,onMouseEnter:h,onMouseLeave:p,onMouseMove:g,onMouseUp:v,onTouchEnd:y,onTouchMove:w,onTouchStart:S,style:N,width:C,responsive:E,dispatchTouchEvents:k=!0}=e,O=x.useRef(null),T=Ht(),[P,A]=x.useState(null),[z,R]=x.useState(null),q=Jge(),U=aj(),L=U?.width>0?U.width:C,ae=U?.height>0?U.height:i,pe=x.useCallback(le=>{q(le),typeof t=="function"&&t(le),A(le),R(le),le!=null&&(O.current=le)},[q,t,A,R]),ge=x.useCallback(le=>{T(I4(le)),T(Zr({handler:s,reactEvent:le}))},[T,s]),V=x.useCallback(le=>{T(DS(le)),T(Zr({handler:h,reactEvent:le}))},[T,h]),re=x.useCallback(le=>{T(O3()),T(Zr({handler:p,reactEvent:le}))},[T,p]),ve=x.useCallback(le=>{T(DS(le)),T(Zr({handler:g,reactEvent:le}))},[T,g]),we=x.useCallback(()=>{T(F4())},[T]),B=x.useCallback(()=>{T(K4())},[T]),D=x.useCallback(le=>{T(q4(le.key))},[T]),G=x.useCallback(le=>{T(Zr({handler:l,reactEvent:le}))},[T,l]),oe=x.useCallback(le=>{T(Zr({handler:c,reactEvent:le}))},[T,c]),W=x.useCallback(le=>{T(Zr({handler:f,reactEvent:le}))},[T,f]),X=x.useCallback(le=>{T(Zr({handler:v,reactEvent:le}))},[T,v]),Q=x.useCallback(le=>{T(Zr({handler:S,reactEvent:le}))},[T,S]),de=x.useCallback(le=>{k&&T(V4(le)),T(Zr({handler:w,reactEvent:le}))},[T,k,w]),ye=x.useCallback(le=>{T(Zr({handler:y,reactEvent:le}))},[T,y]),Z=cve(E);return x.createElement(Z3.Provider,{value:P},x.createElement(HI.Provider,{value:z},x.createElement(Z,{width:L??N?.width,height:ae??N?.height,className:ft("recharts-wrapper",r),style:eve({position:"relative",cursor:"default",width:L,height:ae},N),onClick:ge,onContextMenu:G,onDoubleClick:oe,onFocus:we,onBlur:B,onKeyDown:D,onMouseDown:W,onMouseEnter:V,onMouseLeave:re,onMouseMove:ve,onMouseUp:X,onTouchEnd:ye,onTouchMove:de,onTouchStart:Q,ref:pe},x.createElement(ive,null),n)))}),dve=["width","height","responsive","children","className","style","compact","title","desc"];function fve(e,t){if(e==null)return{};var n,r,i=hve(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function hve(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var pve=x.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:s,className:l,style:c,compact:f,title:h,desc:p}=e,g=fve(e,dve),v=Ni(g);return f?x.createElement(x.Fragment,null,x.createElement(bf,{width:n,height:r}),x.createElement(rM,{otherAttributes:v,title:h,desc:p},s)):x.createElement(uve,{className:l,style:c,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},x.createElement(rM,{otherAttributes:v,title:h,desc:p,ref:t},x.createElement(xpe,null,s)))});function IS(){return IS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},IS.apply(null,arguments)}function aM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function mve(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aM(Object(n),!0).forEach(function(r){gve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gve(e,t,n){return(t=vve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vve(e){var t=yve(e,"string");return typeof t=="symbol"?t:t+""}function yve(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var bve={top:5,right:5,bottom:5,left:5},xve=mve({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:bve,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},Y4),wve=x.forwardRef(function(t,n){var r,i=ar(t.categoricalChartProps,xve),{chartName:s,defaultTooltipEventType:l,validateTooltipEventTypes:c,tooltipPayloadSearcher:f,categoricalChartProps:h}=t,p={chartName:s,defaultTooltipEventType:l,validateTooltipEventTypes:c,tooltipPayloadSearcher:f,eventEmitter:void 0};return x.createElement(Bge,{preloadedState:{options:p},reduxStoreName:(r=h.id)!==null&&r!==void 0?r:s},x.createElement(upe,{chartData:h.data}),x.createElement(Fge,{layout:i.layout,margin:i.margin}),x.createElement(Gge,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),x.createElement(Kge,{baseValue:i.baseValue,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),x.createElement(pve,IS({},i,{ref:n})))}),Sve=["axis"],Q4=x.forwardRef((e,t)=>x.createElement(wve,{chartName:"ComposedChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Sve,tooltipPayloadSearcher:Hde,categoricalChartProps:e,ref:t}));const X4={contentStyle:{backgroundColor:"#18181b",border:"1px solid #3f3f46",borderRadius:8,fontSize:12},labelStyle:{color:"#e4e4e7"},itemStyle:{color:"#a1a1aa"}},yg={fill:"#71717a",fontSize:11},jve="#27272a",J4="#27272a",Cd=["#34d399","#60a5fa","#f472b6","#facc15","#a78bfa","#fb923c","#22d3ee","#f87171"];function eU(e){const t=String(e);return t.includes("T")?new Date(t):new Date(t+"T00:00:00")}function tU(e){return eU(String(e)).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function nU(e){const t=eU(e);return`${t.getMonth()+1}/${t.getDate()}`}const Nve=["7d","30d","90d","all"],Cve=["gap","cited","uncited"],rU={forum:"bg-amber-500",social:"bg-blue-500",news:"bg-zinc-400",reference:"bg-purple-500",blog:"bg-emerald-500",ecommerce:"bg-orange-500",video:"bg-red-500",academic:"bg-cyan-500",other:"bg-zinc-600"};function Ove({projectName:e}){const[t,n]=x.useState("30d"),[r,i]=x.useState(null),[s,l]=x.useState(null),[c,f]=x.useState(null),[h,p]=x.useState(null),[g,v]=x.useState(!0);return x.useEffect(()=>{let y=!1;return v(!0),Promise.all([W9(e,t),Q9(e,t),X9(e,t)]).then(([w,S,N])=>{y||(i(w),l(S),f(N),v(!1))}).catch(()=>{y||v(!1)}),()=>{y=!0}},[e,t]),g&&!r?u.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading analytics…"}):u.jsxs(u.Fragment,{children:[u.jsxs("section",{children:[u.jsxs("div",{className:"flex items-center justify-between mb-4",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Citation Metrics"}),u.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Citation Rate Trends ",u.jsx(Vn,{text:"Citation rate over time across all runs within the selected window. Each data point represents the percentage of queries where your brand was cited by AI providers."})]})]}),u.jsx("div",{className:"flex gap-1",children:Nve.map(y=>u.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${t===y?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>n(y),children:y==="all"?"All":y},y))})]}),r&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center gap-6",children:[u.jsx(qI,{value:`${Math.round(r.overall.citationRate*100)}`,label:"Citation Rate",delta:`${r.overall.cited} / ${r.overall.total}`,tone:r.trend==="improving"?"positive":r.trend==="declining"?"negative":"neutral",description:`Trend: ${r.trend}`,isNumeric:!0}),u.jsxs("div",{className:"flex-1 space-y-3",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-xs text-zinc-500",children:"Trend"}),u.jsx(mt,{tone:r.trend==="improving"?"positive":r.trend==="declining"?"negative":"neutral",children:r.trend})]}),Object.keys(r.byProvider).length>0&&u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[u.jsx("th",{className:"text-left py-1 font-medium",children:"Provider"}),u.jsx("th",{className:"text-right py-1 font-medium",children:"Rate"}),u.jsx("th",{className:"text-right py-1 font-medium",children:"Cited / Total"})]})}),u.jsx("tbody",{children:Object.entries(r.byProvider).map(([y,w])=>u.jsxs("tr",{className:"border-t border-zinc-800/40",children:[u.jsx("td",{className:"py-1.5 text-zinc-300",children:y}),u.jsxs("td",{className:"py-1.5 text-right text-zinc-200",children:[(w.citationRate*100).toFixed(1),"%"]}),u.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[w.cited," / ",w.total]})]},y))})]})]})]}),r.buckets.length>=1&&u.jsx(_ve,{buckets:r.buckets,keywordChanges:r.keywordChanges??[]})]})]}),u.jsx("div",{className:"page-section-divider"}),u.jsxs("section",{children:[u.jsx("div",{className:"flex items-center justify-between mb-4",children:u.jsxs("div",{children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Opportunity Analysis"}),u.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Brand Gap Analysis ",u.jsx(Vn,{text:"Classification based on the most recent completed run. Cited: your brand appeared in the AI answer. Gap: a competitor was cited but you were not. Not Cited: neither mentioned. Consistency shows how often each key phrase was cited across all runs in the selected window."})]})]})}),s&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"flex gap-1 mb-4",children:Cve.map(y=>{const w=y==="cited"?s.cited.length:y==="gap"?s.gap.length:s.uncited.length,S=h===y;return u.jsxs("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${S?y==="gap"?"bg-amber-900/40 border-amber-700/60 text-amber-300":y==="cited"?"bg-emerald-900/40 border-emerald-700/60 text-emerald-300":"bg-zinc-800/40 border-zinc-700 text-zinc-300":"border-zinc-800 text-zinc-400 hover:border-zinc-700"}`,onClick:()=>p(S?null:y),children:[y==="gap"?"Gap":y==="cited"?"Cited":"Not Cited"," (",w,")"]},y)})}),u.jsx(kve,{gaps:s,filter:h})]})]}),u.jsx("div",{className:"page-section-divider"}),u.jsxs("section",{children:[u.jsxs("div",{className:"mb-4",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Source Intelligence"}),u.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Source Origin Breakdown ",u.jsx(Vn,{text:"Aggregated across all runs in the selected window. Shows what types of websites AI engines cite as grounding sources. More runs = more statistically meaningful breakdown."})]})]}),c&&c.overall.length>0&&u.jsxs("div",{className:"space-y-4",children:[u.jsx(Ave,{categories:c.overall}),u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[u.jsx("th",{className:"text-left py-1 font-medium",children:"Category"}),u.jsx("th",{className:"text-right py-1 font-medium",children:"Count"}),u.jsx("th",{className:"text-right py-1 font-medium",children:"%"}),u.jsx("th",{className:"text-left py-1 pl-4 font-medium",children:"Top Sources"})]})}),u.jsx("tbody",{children:c.overall.map(y=>u.jsxs("tr",{className:"border-t border-zinc-800/40",children:[u.jsxs("td",{className:"py-1.5 text-zinc-300 flex items-center gap-2",children:[u.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${rU[y.category]??"bg-zinc-600"}`}),y.label]}),u.jsx("td",{className:"py-1.5 text-right text-zinc-200",children:y.count}),u.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[(y.percentage*100).toFixed(1),"%"]}),u.jsx("td",{className:"py-1.5 pl-4 text-zinc-500 text-xs truncate max-w-[200px]",children:y.topDomains.slice(0,3).map(w=>w.domain).join(", ")})]},y.category))})]})]}),c&&c.overall.length===0&&u.jsx("p",{className:"text-sm text-zinc-500 py-4",children:"No source data available. Run a visibility sweep first."})]})]})}function _ve({buckets:e,keywordChanges:t}){const n=e.map(i=>({date:i.startDate,citationRate:Math.round(i.citationRate*1e3)/10,keywordCount:i.keywordCount??0})),r=x.useMemo(()=>{if(!t||t.length===0||e.length<2)return[];const i=new Date(e[0].startDate).getTime(),s=new Date(e[e.length-1].startDate).getTime();return t.filter(l=>{const c=new Date(l.date).getTime();return c>=i&&c<=s}).map(l=>{const c=new Date(l.date).getTime();let f=e[0].startDate,h=Math.abs(c-new Date(f).getTime());for(const p of e){const g=Math.abs(c-new Date(p.startDate).getTime());g<h&&(f=p.startDate,h=g)}return{...l,date:f}})},[e,t]);return u.jsxs("div",{className:"surface-card rounded-lg p-3 border border-zinc-800/60",children:[u.jsx("p",{className:"text-[10px] text-zinc-500 mb-1 flex items-center gap-1",children:"kp = key phrases tracked in this window"}),u.jsx("div",{className:"h-40",role:"img","aria-label":"Citation rate trend chart",children:u.jsx(m$,{width:"100%",height:"100%",children:u.jsxs(Q4,{data:n,margin:{top:8,right:8,bottom:0,left:0},children:[u.jsx(O4,{strokeDasharray:"3 3",stroke:jve,vertical:!1}),u.jsx(bN,{dataKey:"date",tick:yg,tickLine:!1,axisLine:{stroke:J4},tickFormatter:nU}),u.jsx(xN,{tick:yg,tickLine:!1,axisLine:!1,domain:[0,100],tickFormatter:i=>`${i}%`,width:40}),u.jsx(Q3,{...X4,labelFormatter:tU,formatter:(i,s)=>{const l=typeof i=="number"?i:Number(i??0);return String(s)==="citationRate"?[`${l.toFixed(1)}%`,"Citation Rate"]:[String(l),String(s)]}}),r.map(i=>u.jsx(S4,{x:i.date,stroke:"#52525b",strokeDasharray:"4 2",label:{value:i.label,position:"top",fill:"#71717a",fontSize:9}},i.date)),u.jsx(mg,{type:"monotone",dataKey:"citationRate",stroke:Cd[0],fill:Cd[0],fillOpacity:.15,strokeWidth:2,dot:{fill:Cd[0],r:3,strokeWidth:0},activeDot:{fill:Cd[0],r:5,strokeWidth:0,opacity:.8}})]})})})]})}function kve({gaps:e,filter:t}){const n=x.useMemo(()=>{const r=[...e.gap.map(i=>({...i,_sort:0})),...e.cited.map(i=>({...i,_sort:1})),...e.uncited.map(i=>({...i,_sort:2}))];return t?r.filter(i=>i.category===t):r.sort((i,s)=>i._sort-s._sort)},[e,t]);return n.length===0?u.jsxs("p",{className:"text-sm text-zinc-500 py-4",children:["No key phrases found",t?` with status "${t}"`:"","."]}):u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[u.jsx("th",{className:"text-left py-1 font-medium",children:"Keyword"}),u.jsx("th",{className:"text-left py-1 font-medium",children:"Status"}),u.jsx("th",{className:"text-left py-1 font-medium",children:"Providers Citing"}),u.jsx("th",{className:"text-left py-1 font-medium",children:"Competitors Citing"}),u.jsx("th",{className:"text-right py-1 font-medium",children:"Consistency"})]})}),u.jsx("tbody",{children:n.map(r=>{const i=r.category==="cited"?"positive":r.category==="gap"?"caution":"neutral";return u.jsxs("tr",{className:`border-t border-zinc-800/40 ${r.category==="gap"?"border-l-2 border-l-amber-600/60":""}`,children:[u.jsx("td",{className:"py-1.5 text-zinc-200",children:r.keyword}),u.jsx("td",{className:"py-1.5",children:u.jsx(mt,{tone:i,children:r.category==="gap"?"Gap":r.category==="cited"?"Cited":"Not Cited"})}),u.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:r.providers.length>0?r.providers.join(", "):"—"}),u.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:r.competitorsCiting.length>0?r.competitorsCiting.join(", "):"—"}),u.jsx("td",{className:"py-1.5 text-right text-zinc-400 text-xs",children:r.consistency.totalRuns>0?`${r.consistency.citedRuns}/${r.consistency.totalRuns} runs`:"—"})]},r.keywordId)})})]})}function Ave({categories:e}){const t=e.reduce((n,r)=>n+r.count,0);return t===0?null:u.jsx("div",{className:"flex rounded-full overflow-hidden h-3 bg-zinc-800","aria-label":"Source category distribution",children:e.map(n=>{const r=n.count/t*100;return r<.5?null:u.jsx("div",{className:`${rU[n.category]??"bg-zinc-600"} transition-all`,style:{width:`${r}%`},title:`${n.label}: ${(n.percentage*100).toFixed(1)}%`},n.category)})})}const Rp=Cd;function Dp(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function Eve(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function Tve({projectName:e}){const[t,n]=x.useState(null),[r,i]=x.useState(null),[s,l]=x.useState(!0),[c,f]=x.useState(!1),[h,p]=x.useState(!1),[g,v]=x.useState(null),[y,w]=x.useState(null),[S,N]=x.useState("sessions"),[C,E]=x.useState("desc"),[k,O]=x.useState("sessions"),[T,P]=x.useState("desc"),[A,z]=x.useState([]),[R,q]=x.useState([]);function U(Q){l(!0),cA(e).then(de=>{if(!Q.current)return n(de),de.connected?Promise.all([uA(e),dA(e).catch(()=>[]),fA(e).catch(()=>[])]):null}).then(de=>{Q.current||(Array.isArray(de)?(i(de[0]),z(de[1]),q(de[2])):(i(null),z([]),q([])),l(!1))}).catch(de=>{Q.current||(v(de instanceof Error?de.message:"Failed to load GA4 data"),l(!1))})}x.useEffect(()=>{const Q={current:!1};return U(Q),()=>{Q.current=!0}},[e]);async function L(){f(!0),v(null),w(null);try{const Q=await tR(e);w(`Synced ${Q.rowCount.toLocaleString()} page rows and ${Q.aiReferralCount.toLocaleString()} AI referral rows (${Q.days} days)`);const[de,ye,Z]=await Promise.all([uA(e),dA(e).catch(()=>[]),fA(e).catch(()=>[])]);i(de),z(ye),q(Z);const le=await cA(e);n(le)}catch(Q){v(Q instanceof Error?Q.message:"Sync failed")}finally{f(!1)}}async function ae(){p(!0),v(null),w(null);try{await eF(e),n({connected:!1,propertyId:null,clientEmail:null,lastSyncedAt:null,createdAt:null,updatedAt:null}),i(null),w("GA4 disconnected")}catch(Q){v(Q instanceof Error?Q.message:"Disconnect failed")}finally{p(!1)}}function pe(Q){S===Q?E(de=>de==="desc"?"asc":"desc"):(N(Q),E("desc"))}function ge(Q){k===Q?P(de=>de==="desc"?"asc":"desc"):(O(Q),P("desc"))}const V=x.useMemo(()=>r?.topPages?[...r.topPages].sort((Q,de)=>{const ye=Q[S],Z=de[S];return typeof ye=="string"&&typeof Z=="string"?C==="asc"?ye.localeCompare(Z):Z.localeCompare(ye):C==="asc"?ye-Z:Z-ye}):[],[r?.topPages,S,C]),re=x.useMemo(()=>r?.aiReferrals?[...r.aiReferrals].sort((Q,de)=>{const ye=Q[k],Z=de[k];return typeof ye=="string"&&typeof Z=="string"?T==="asc"?ye.localeCompare(Z):Z.localeCompare(ye):T==="asc"?ye-Z:Z-ye}):[],[r?.aiReferrals,k,T]),{chartData:ve,chartSources:we,dateRange:B}=x.useMemo(()=>{const Q=[...new Set(A.map(F=>F.source))],de=new Map;for(const F of R)de.set(F.date,{_totalSessions:F.sessions,_organicSessions:F.organicSessions});const ye=new Map;for(const F of A){const Ae=`${F.date}::${F.source}`,Oe=ye.get(Ae)??0;ye.set(Ae,Math.max(Oe,F.sessions))}for(const[F,Ae]of ye){const[Oe,nt]=F.split("::");let Ve=de.get(Oe);Ve||(Ve={_totalSessions:0,_organicSessions:0},de.set(Oe,Ve)),Ve[nt]=(Ve[nt]??0)+Ae}const Z=[...de.entries()].sort(([F],[Ae])=>F.localeCompare(Ae)).map(([F,Ae])=>({date:F,...Ae})),le=Z.map(F=>F.date),Se=le.length>0?{start:le[0],end:le[le.length-1]}:null;return{chartData:Z,chartSources:Q,dateRange:Se}},[A,R]);if(s&&!t)return u.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading traffic data…"});if(!t?.connected)return u.jsx(Pve,{projectName:e,onConnected:()=>U({current:!1})});const D=r&&r.totalSessions>0?Math.round(r.totalOrganicSessions/r.totalSessions*100):0,G=r?.aiSessionsDeduped??0,oe=r&&r.totalSessions>0?Math.round(G/r.totalSessions*100):0,W=r?new Set(r.aiReferrals.map(Q=>Q.source.toLowerCase())).size:0,X=re[0]??null;return u.jsxs(u.Fragment,{children:[g&&u.jsx("div",{className:"mb-4 px-4 py-2 rounded-lg bg-rose-900/20 border border-rose-800/60 text-sm text-rose-300",children:g}),y&&u.jsx("div",{className:"mb-4 px-4 py-2 rounded-lg bg-emerald-900/20 border border-emerald-800/60 text-sm text-emerald-300",children:y}),u.jsxs("div",{className:"flex items-center justify-between mb-6",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-emerald-500"}),u.jsxs("span",{className:"text-xs text-zinc-400",children:["Property ",u.jsx("span",{className:"text-zinc-300",children:t.propertyId}),t.clientEmail&&u.jsxs(u.Fragment,{children:[" · ",u.jsx("span",{className:"text-zinc-500",children:t.clientEmail})]})]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs(me,{variant:"outline",size:"sm",disabled:c,onClick:L,children:[u.jsx(vA,{className:`w-3.5 h-3.5 mr-1.5 ${c?"animate-spin":""}`}),c?"Syncing…":"Sync"]}),u.jsxs(me,{variant:"ghost",size:"sm",className:"text-rose-400 hover:text-rose-300",disabled:h,onClick:ae,children:[u.jsx(BF,{className:"w-3.5 h-3.5 mr-1.5"}),"Disconnect"]})]})]}),u.jsxs("section",{children:[u.jsxs("div",{className:"mb-4",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Traffic Overview"}),u.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Site Traffic",u.jsx(Vn,{text:"Aggregated traffic metrics from Google Analytics 4. Sessions and users are summed across all synced dates. Organic sessions are Google organic search sessions specifically."})]})]}),r?u.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[u.jsx(rw,{value:Dp(r.totalSessions),label:"Total Sessions",subtitle:r.totalSessions.toLocaleString(),tone:"neutral"}),u.jsx(rw,{value:Dp(r.totalOrganicSessions),label:"Organic Sessions",subtitle:`${D}% of total`,tone:"positive"}),u.jsx(rw,{value:Dp(r.totalUsers),label:"Total Users",subtitle:r.totalUsers.toLocaleString(),tone:"neutral"})]}):u.jsxs("div",{className:"surface-card rounded-lg p-6 text-center border border-zinc-800/60",children:[u.jsx("p",{className:"text-sm text-zinc-400 mb-3",children:"No traffic data yet."}),u.jsxs(me,{variant:"outline",size:"sm",disabled:c,onClick:L,children:[u.jsx(vA,{className:`w-3.5 h-3.5 mr-1.5 ${c?"animate-spin":""}`}),"Sync from GA4"]})]})]}),r&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"page-section-divider"}),u.jsxs("section",{children:[u.jsxs("div",{className:"mb-4 flex items-end justify-between",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"AI Attribution"}),u.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["AI Referral Sources",u.jsx(Vn,{text:"Tracks sessions from known AI referrers and matching AI-tagged UTMs detected in GA4 sessionSource, firstUserSource, and sessionManualSource. Generic search sources are excluded to avoid false positives."})]})]}),B&&u.jsxs("p",{className:"text-xs text-zinc-500",children:[new Date(B.start+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})," – ",new Date(B.end+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})]})]}),ve.length>0&&u.jsxs(Be,{className:"surface-card p-5 mb-4",children:[u.jsxs("div",{className:"mb-4 flex items-end justify-between",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Trend"}),u.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:we.length>0?"AI vs. total sessions":"All sessions (baseline)"}),we.length===0&&u.jsx("p",{className:"text-xs text-zinc-500 mt-0.5",children:"AI referral sessions will be overlaid here once detected"})]}),we.length===0&&u.jsx("p",{className:"text-xs text-zinc-500",children:"No AI referrals detected yet"})]}),u.jsx("div",{className:"h-64",children:u.jsx(m$,{width:"100%",height:"100%",children:u.jsxs(Q4,{data:ve,margin:{top:4,right:4,bottom:0,left:0},children:[u.jsx(bN,{dataKey:"date",tick:yg,tickLine:!1,axisLine:{stroke:J4},tickFormatter:nU}),u.jsx(xN,{tick:yg,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),u.jsx(Q3,{...X4,labelFormatter:tU,formatter:(Q,de)=>{const ye=typeof Q=="number"?Q.toLocaleString():String(Q??0),Z=String(de??"");return Z==="_totalSessions"?[ye,"Total Sessions"]:Z==="_organicSessions"?[ye,"Organic Sessions"]:[ye,Z]}}),u.jsx(C$,{wrapperStyle:{fontSize:11,color:"#a1a1aa"},formatter:Q=>Q==="_totalSessions"?"Total Sessions":Q==="_organicSessions"?"Organic Sessions":Q}),u.jsx(mg,{type:"monotone",dataKey:"_totalSessions",stroke:"#52525b",fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),we.map((Q,de)=>u.jsx(mg,{type:"monotone",dataKey:Q,stackId:"ai",stroke:Rp[de%Rp.length],fill:Rp[de%Rp.length],fillOpacity:.4,strokeWidth:1.5},Q))]})})})]}),u.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,0.9fr)_minmax(0,1.5fr)]",children:[u.jsxs(Be,{className:"surface-card p-5",children:[u.jsxs("div",{className:"mb-4",children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Summary"}),u.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Attributable AI visits"})]}),r.aiReferrals.length>0?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[u.jsx(hc,{label:"AI Sessions",value:Dp(G),hint:`${G.toLocaleString()} sessions`,tone:"positive",tooltip:"Total sessions attributed to AI referral sources detected via GA4 sessionSource, firstUserSource, and sessionManualSource dimensions."}),u.jsx(hc,{label:"Share of Traffic",value:`${oe}%`,hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions that originated from AI answer engines. A higher share indicates stronger AI-driven discovery."}),u.jsx(hc,{label:"Tracked Sources",value:String(W),hint:`${r.aiReferrals.length} source rows`,tone:"neutral",tooltip:"Number of distinct AI referral sources detected. Each unique source/medium combination (e.g. chatgpt.com/referral) counts as one source row."})]}),X&&u.jsxs("div",{className:"mt-4 rounded-lg border border-emerald-800/40 bg-emerald-500/6 px-4 py-3 text-sm text-emerald-100",children:["Top AI referrer: ",u.jsx("span",{className:"font-medium",children:X.source})," via ",X.medium,", accounting for ",X.sessions.toLocaleString()," sessions."]})]}):u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[u.jsx(hc,{label:"AI Sessions",value:"0",hint:"0 sessions",tone:"neutral",tooltip:"Total sessions attributed to AI referral sources detected via GA4 sessionSource, firstUserSource, and sessionManualSource dimensions."}),u.jsx(hc,{label:"Share of Traffic",value:"0%",hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions that originated from AI answer engines."}),u.jsx(hc,{label:"Tracked Sources",value:"0",hint:"known AI sources",tone:"neutral",tooltip:"Number of distinct AI referral sources detected after matching known AI engine referrers and AI-tagged UTM sources."})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3 text-sm text-zinc-400",children:[u.jsx("p",{className:"mb-1.5 text-zinc-300",children:"Monitoring for AI referral traffic from:"}),u.jsx("p",{className:"text-xs text-zinc-500",children:"Known AI answer engines and matching UTM-tagged variants. Sessions will appear here once GA4 detects visits from tracked AI sources."})]})]})]}),u.jsxs(Be,{className:"surface-card p-5",children:[u.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Breakdown"}),u.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Source / medium"})]}),u.jsx("p",{className:"text-xs text-zinc-500",children:r.aiReferrals.length>0?`${r.aiReferrals.length} rows`:"No source rows"})]}),r.aiReferrals.length>0?u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[u.jsx(xs,{label:"Source",sortKey:"source",current:k,dir:T,onSort:ge,align:"left"}),u.jsx(xs,{label:"Medium",sortKey:"medium",current:k,dir:T,onSort:ge,align:"left"}),u.jsx("th",{className:"py-1 font-medium text-left",children:"Attribution"}),u.jsx(xs,{label:"Sessions",sortKey:"sessions",current:k,dir:T,onSort:ge,align:"right"}),u.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),u.jsx(xs,{label:"Users",sortKey:"users",current:k,dir:T,onSort:ge,align:"right"})]})}),u.jsx("tbody",{children:re.map(Q=>u.jsx(Dve,{referral:Q,totalSessions:G},`${Q.source}:${Q.medium}:${Q.sourceDimension}`))})]})}):u.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[u.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No AI referrer sessions detected yet"}),u.jsx("p",{className:"text-xs text-zinc-500 max-w-sm",children:"When visitors arrive from ChatGPT, Claude, Gemini, or other AI platforms, their sessions will be broken down here by source and medium."})]})]})]})]})]}),r&&r.topPages.length>0&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"page-section-divider"}),u.jsxs("section",{children:[u.jsxs("div",{className:"mb-4",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Page Performance"}),u.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Top Landing Pages",u.jsx(Vn,{text:"Landing pages ranked by session volume. Click column headers to sort. Organic % shows the share of sessions coming from Google organic search."})]})]}),u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[u.jsx(xs,{label:"Landing Page",sortKey:"landingPage",current:S,dir:C,onSort:pe,align:"left"}),u.jsx(xs,{label:"Sessions",sortKey:"sessions",current:S,dir:C,onSort:pe,align:"right"}),u.jsx(xs,{label:"Organic",sortKey:"organicSessions",current:S,dir:C,onSort:pe,align:"right"}),u.jsx("th",{className:"text-right py-1 font-medium",children:"Organic %"}),u.jsx(xs,{label:"Users",sortKey:"users",current:S,dir:C,onSort:pe,align:"right"})]})}),u.jsx("tbody",{children:V.map(Q=>u.jsx(zve,{page:Q},Q.landingPage))})]})})]})]}),u.jsxs("div",{className:"mt-6 flex items-center justify-between text-xs text-zinc-500",children:[u.jsx("span",{children:r?.lastSyncedAt?`Last synced ${Eve(r.lastSyncedAt)}`:"Never synced"}),u.jsx("span",{children:r?`${r.topPages.length} pages · ${r.aiReferrals.length} AI rows`:""})]})]})}function Pve({projectName:e,onConnected:t}){const[n,r]=x.useState(""),[i,s]=x.useState(null),[l,c]=x.useState(null),[f,h]=x.useState(!1),[p,g]=x.useState(null),v=x.useRef(null),y=x.useCallback(S=>{const N=S.target.files?.[0];if(!N)return;g(null),s(N.name);const C=new FileReader;C.onload=()=>{const E=C.result;try{const k=JSON.parse(E);if(!k.client_email||!k.private_key){g("JSON file is missing required fields: client_email and private_key. Make sure you downloaded a service account key (not an OAuth client)."),c(null);return}c(E)}catch{g("File is not valid JSON. Please upload a service account key file (.json) downloaded from Google Cloud Console."),c(null)}},C.onerror=()=>{g("Failed to read file."),c(null)},C.readAsText(N)},[]);async function w(){if(g(null),!n.trim()){g("Property ID is required.");return}if(!l){g("Please upload a service account key file.");return}h(!0);try{await J9(e,{propertyId:n.trim(),keyJson:l});try{await tR(e)}catch{}t()}catch(S){g(S instanceof Error?S.message:"Failed to connect GA4")}finally{h(!1)}}return u.jsxs(Be,{className:"surface-card p-6",children:[u.jsx("h3",{className:"text-base font-semibold text-zinc-50 mb-1",children:"Connect Google Analytics 4"}),u.jsx("p",{className:"text-sm text-zinc-400 mb-5",children:"Connect a GA4 property to see traffic data for this project. You'll need a service account key file from Google Cloud Console."}),p&&u.jsx("div",{className:"mb-4 px-4 py-2 rounded-lg bg-rose-900/20 border border-rose-800/60 text-sm text-rose-300",children:p}),u.jsxs("div",{className:"mb-4",children:[u.jsx("label",{htmlFor:"ga4-property-id",className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"GA4 Property ID"}),u.jsx("input",{id:"ga4-property-id",type:"text",placeholder:"e.g. 123456789",value:n,onChange:S=>r(S.target.value),className:"w-full rounded-lg bg-zinc-900/60 border border-zinc-800/60 px-3 py-2 text-sm text-zinc-200 placeholder:text-zinc-600 focus:outline-none focus:ring-1 focus:ring-zinc-600"}),u.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:"Find this in GA4 → Admin → Property Settings. It's a numeric ID, not the Measurement ID (G-XXXXXX)."})]}),u.jsxs("div",{className:"mb-5",children:[u.jsx("label",{className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"Service Account Key File"}),u.jsx("input",{ref:v,type:"file",accept:".json,application/json",onChange:y,className:"hidden"}),u.jsxs("button",{type:"button",onClick:()=>v.current?.click(),className:"flex items-center gap-2 w-full rounded-lg bg-zinc-900/60 border border-zinc-800/60 border-dashed px-4 py-3 text-sm text-zinc-400 hover:border-zinc-600 hover:text-zinc-300 transition-colors cursor-pointer",children:[u.jsx(FF,{className:"w-4 h-4 shrink-0"}),i?u.jsx("span",{className:"text-zinc-200 truncate",children:i}):u.jsx("span",{children:"Upload .json key file"})]}),u.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Download from Google Cloud Console → IAM & Admin → Service Accounts → Keys → Add Key → JSON. The service account must have ",u.jsx("span",{className:"text-zinc-400",children:"Viewer"})," access on the GA4 property."]})]}),u.jsx(me,{variant:"default",size:"sm",disabled:f||!n.trim()||!l,onClick:w,children:f?"Connecting & syncing…":"Connect GA4"})]})}function xs({label:e,sortKey:t,current:n,dir:r,onSort:i,align:s}){const l=n===t;return u.jsxs("th",{className:`py-1 font-medium cursor-pointer select-none hover:text-zinc-300 transition-colors ${s==="right"?"text-right":"text-left"}`,onClick:()=>i(t),children:[e,l&&u.jsx("span",{className:"ml-0.5",children:r==="asc"?"↑":"↓"})]})}const iU={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-50"};function rw({value:e,label:t,subtitle:n,tone:r}){return u.jsxs("div",{className:"rounded-lg bg-zinc-900/30 border border-zinc-800/60 px-5 py-4",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:t}),u.jsx("p",{className:`text-2xl font-bold tabular-nums ${iU[r]}`,children:e}),u.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function hc({value:e,label:t,hint:n,tone:r,tooltip:i}){return u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-950/40 px-4 py-3 flex flex-col",children:[u.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1 flex items-center gap-1",children:[t,i&&u.jsx(Vn,{text:i})]}),u.jsx("p",{className:`text-xl font-semibold tabular-nums ${iU[r]}`,children:e}),u.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function zve({page:e}){const t=e.sessions>0?(e.organicSessions/e.sessions*100).toFixed(1):"0.0";return u.jsxs("tr",{className:"border-t border-zinc-800/40",children:[u.jsx("td",{className:"py-1.5 text-zinc-300 max-w-[400px] truncate",title:e.landingPage,children:e.landingPage}),u.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.sessions.toLocaleString()}),u.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.organicSessions.toLocaleString()}),u.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[t,"%"]}),u.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}const Mve={session:"Session",first_user:"First Visit",manual_utm:"UTM"},Rve={session:"Detected via GA4 sessionSource (referrer or utm_source for this session)",first_user:"Detected via GA4 firstUserSource (referrer from the user's first-ever visit)",manual_utm:"Detected via GA4 sessionManualSource (explicit utm_source parameter for the session)"};function Dve({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=Mve[e.sourceDimension]??e.sourceDimension,i=Rve[e.sourceDimension]??"";return u.jsxs("tr",{className:"border-t border-zinc-800/40",children:[u.jsx("td",{className:"py-1.5 text-zinc-200 max-w-[220px] truncate",title:e.source,children:e.source}),u.jsx("td",{className:"py-1.5 text-zinc-500 max-w-[180px] truncate",title:e.medium,children:e.medium}),u.jsx("td",{className:"py-1.5",children:u.jsx("span",{className:"inline-block text-[10px] px-1.5 py-0.5 rounded-full border border-zinc-700 text-zinc-400",title:i,children:r})}),u.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.sessions.toLocaleString()}),u.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[n,"%"]}),u.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function Pf(e){e.invalidateQueries({queryKey:Jr.runs.all}),e.invalidateQueries({queryKey:Jr.projects.all})}function Ive(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function Lve(e,t){const n=e??"Project";return t==="gsc-sync"?`${n} will refresh after the sync completes.`:t==="inspect-sitemap"?`${n} will notify you when sitemap inspection finishes.`:`${n} will notify you when the run finishes.`}function Dv(e,t){sR({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:t.projectLabel,sourceAction:t.sourceAction,lastAnnouncedStatus:"queued"}),Qe({title:Ive(e.kind),detail:Lve(t.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function $ve(e){const t=e.filter(i=>i.status!=="conflict"),n=e.filter(i=>i.status==="conflict");if(t.length===0){Qe({title:"No runs queued",detail:n.length>0?`${n.length} project${n.length===1?"":"s"} already had a run in progress.`:"No projects were available to queue.",tone:"caution",durationMs:8e3,dedupeKey:"run-all:conflict",dedupeMode:"replace"});return}for(const i of t)sR({id:i.id,projectId:i.projectId,kind:i.kind,projectLabel:i.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=eK({runIds:t.map(i=>i.id),queuedCount:t.length,skippedCount:n.length});Qe({title:"Run-all batch queued",detail:n.length>0?`${t.length} project${t.length===1?"":"s"} queued, ${n.length} skipped because a run is already active.`:`${t.length} project${t.length===1?"":"s"} queued.`,tone:n.length>0?"caution":"neutral",dedupeKey:`batch:${r}`,dedupeMode:"replace"})}function Iv(e,t){if(e instanceof cm&&e.code==="RUN_IN_PROGRESS"){Qe({title:"Run already in progress",detail:t?.projectLabel?`${t.projectLabel} already has an active run. Wait for it to finish, then retry.`:"This project already has an active run. Wait for it to finish, then retry.",tone:"caution",durationMs:8e3,dedupeKey:`run-in-progress:${t?.projectKey??"project"}:${t?.sourceAction??"run"}`,dedupeMode:"replace"});return}Qe({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function aU(){const e=Fs();return of({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>u9(t,n),onSuccess:(t,n)=>{Pf(e),Dv(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})},onError:(t,n)=>{Iv(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})}})}function Uve(){const e=Fs();return of({meta:{skipGlobalErrorToast:!0},mutationFn:t=>A9(t),onSuccess:t=>{Pf(e),$ve(t)},onError:t=>{Qe({title:t instanceof Error?t.message:"Failed to queue runs",tone:"negative"})}})}function Bve(){const e=Fs();return of({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>QM(t,n),onSuccess:(t,n)=>{Pf(e),Dv(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})},onError:(t,n)=>{Iv(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})}})}function qve(){const e=Fs();return of({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t})=>q9(t),onSuccess:(t,n)=>{Pf(e),Dv(t.run,{projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})},onError:(t,n)=>{Iv(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})}})}function Fve(){const e=Fs();return of({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>U9(t,n),onSuccess:(t,n)=>{Pf(e),Dv(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})},onError:(t,n)=>{Iv(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})}})}function Kve({projectName:e}){const[t,n]=x.useState(!1),[r,i]=x.useState([]),[s,l]=x.useState([]),[c,f]=x.useState([]),[h,p]=x.useState([]),[g,v]=x.useState([]),[y,w]=x.useState(null),[S,N]=x.useState(""),[C,E]=x.useState(""),[k,O]=x.useState("30"),[T,P]=x.useState(!1),[A,z]=x.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[R,q]=x.useState(""),[U,L]=x.useState(!0),[ae,pe]=x.useState(!1),[ge,V]=x.useState(!1),[re,ve]=x.useState(!1),[we,B]=x.useState(!1),[D,G]=x.useState(!1),[oe,W]=x.useState(!1),[X,Q]=x.useState(null),[de,ye]=x.useState(!1),[Z,le]=x.useState(!1),[Se,F]=x.useState(null),[Ae,Oe]=x.useState(""),[nt,Ve]=x.useState(!1),[sn,pn]=x.useState(!1),[Gt,he]=x.useState("indexed"),[Fe,St]=x.useState(null),lr=x.useMemo(()=>{if(!Fe)return c;const{key:K,dir:xe}=Fe;return[...c].sort((vt,Vt)=>{const Ut=K===As.CTR?Number.isFinite(vt.ctr)?vt.ctr:0:vt[K],zt=K===As.CTR?Number.isFinite(Vt.ctr)?Vt.ctr:0:Vt[K];return xe==="asc"?Ut-zt:zt-Ut})},[c,Fe]),[st,Xe]=x.useState([]),[at,Pt]=x.useState(null),[cr,qa]=x.useState(!1),[Qs,ut]=x.useState(null),[gl,An]=x.useState(null),$e=r.find(K=>K.connectionType==="gsc"),Rr=c.length>0||h.length>0||g.length>0,be=Bve(),Wn=qve(),du=Fve();async function Mf(K){if(!K){l([]),N("");return}V(!0);try{const{sites:xe}=await P9(e);l(xe),N(K.propertyId??xe[0]?.siteUrl??"")}catch(xe){l([]),ut(xe instanceof Error?xe.message:"Failed to load Search Console properties")}finally{V(!1)}}async function Fa(){B(!0);try{const K=await R9(e,{startDate:A.startDate||void 0,endDate:A.endDate||void 0,query:A.query||void 0,page:A.page||void 0,limit:parseInt(A.limit,10)||20});f(K)}catch(K){f([]),ut(K instanceof Error?K.message:"Failed to load GSC performance data")}finally{B(!1)}}async function ia(){G(!0);try{const[K,xe]=await Promise.all([I9(e,{url:R.trim()||void 0,limit:20}),L9(e)]);p(K),v(xe)}catch(K){p([]),v([]),ut(K instanceof Error?K.message:"Failed to load GSC inspection history")}finally{G(!1)}}async function Xs(){ye(!0);try{const[K,xe]=await Promise.all([a1(e),$9(e).catch(()=>[])]);Q(K),Xe(xe)}catch(K){Q(null),Xe([]),ut(K instanceof Error?K.message:"Failed to load coverage data")}finally{ye(!1)}}async function Ti(K){qa(!0),ut(null);try{const xe=await oA(e,{urls:K}),{succeeded:vt,failed:Vt,total:Ut}=xe.summary;Qe({title:"Indexing requested",detail:Vt===0?`${vt} URL${vt!==1?"s":""} submitted for indexing.`:`${vt}/${Ut} submitted successfully, ${Vt} failed.`,tone:Vt===0?"positive":"caution",dedupeKey:`gsc:indexing:${e}`,dedupeMode:"replace"})}catch(xe){ut(xe instanceof Error?xe.message:"Failed to request indexing")}finally{qa(!1)}}async function vl(){qa(!0),ut(null);try{const K=await oA(e,{urls:[],allUnindexed:!0}),{succeeded:xe,failed:vt,total:Vt}=K.summary;Qe({title:"Indexing requested",detail:vt===0?`${xe} unindexed URL${xe!==1?"s":""} submitted for indexing.`:`${xe}/${Vt} submitted successfully, ${vt} failed.`,tone:vt===0?"positive":"caution",dedupeKey:`gsc:indexing-all:${e}`,dedupeMode:"replace"})}catch(K){ut(K instanceof Error?K.message:"Failed to request indexing")}finally{qa(!1)}}async function Pi(){if(Ae.trim()){Ve(!0),ut(null);try{await M9(e,"gsc",Ae.trim()),i(K=>K.map(xe=>xe.connectionType==="gsc"?{...xe,sitemapUrl:Ae.trim()}:xe)),Qe({title:"Sitemap URL saved",detail:`${e} will use the updated sitemap URL.`,tone:"positive",dedupeKey:`gsc:sitemap:${e}`,dedupeMode:"drop"}),Oe("")}catch(K){ut(K instanceof Error?K.message:"Failed to save sitemap URL")}finally{Ve(!1)}}}async function Rf(){ut(null);try{const K=await Wn.mutateAsync({projectName:e,projectLabel:e});F(K.sitemaps),i(xe=>xe.map(vt=>vt.connectionType==="gsc"?{...vt,sitemapUrl:K.primarySitemapUrl}:vt))}catch{}}async function Df(){le(!0),ut(null);try{const K=await B9(e);F(K.sitemaps),K.sitemaps.length===0&&An("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch(K){ut(K instanceof Error?K.message:"Failed to list sitemaps")}finally{le(!1)}}async function yl(){L(!0),ut(null);try{const[K,xe]=await Promise.all([i1().catch(()=>null),WM(e).catch(()=>[])]);n(!!K?.google?.configured),i(xe);const vt=xe.find(Vt=>Vt.connectionType==="gsc");await Promise.all([Mf(vt),Fa(),ia(),Xs()])}finally{L(!1)}}x.useEffect(()=>{yl()},[e]);async function Js(){if(!t){ut("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}pe(!0),ut(null),An(null);try{const{authUrl:K}=await E9(e,"gsc");if(!K.startsWith("https://accounts.google.com/")){ut("Unexpected OAuth redirect URL. Please try again.");return}const xe=window.open(K,"_blank","width=600,height=700");if(!xe){window.location.assign(K);return}An("Finish the Google consent flow in the popup, then close it to refresh this project.");const vt=window.setInterval(()=>{xe.closed&&(window.clearInterval(vt),An(null),yl())},1e3)}catch(K){ut(K instanceof Error?K.message:"Failed to start OAuth flow")}finally{pe(!1)}}async function $v(){ut(null),An(null);try{await T9(e,"gsc"),i(K=>K.filter(xe=>xe.connectionType!=="gsc")),l([]),N("")}catch(K){ut(K instanceof Error?K.message:"Failed to disconnect")}}async function If(){if(S){ve(!0),ut(null);try{await z9(e,"gsc",S),i(K=>K.map(xe=>xe.connectionType==="gsc"?{...xe,propertyId:S}:xe)),Qe({title:"GSC property updated",detail:`${e} is now linked to ${S}.`,tone:"positive",dedupeKey:`gsc:property:${e}`,dedupeMode:"drop"})}catch(K){ut(K instanceof Error?K.message:"Failed to save GSC property")}finally{ve(!1)}}}async function Lf(){ut(null),An(null);try{await be.mutateAsync({projectName:e,projectLabel:e,opts:{days:parseInt(k,10)||void 0,full:T||void 0}})}catch{}}async function fu(){if(C.trim()){W(!0),ut(null),An(null);try{const K=await D9(e,C.trim());w(K),E(""),await ia()}catch(K){ut(K instanceof Error?K.message:"Failed to inspect URL")}finally{W(!1)}}}return u.jsxs("section",{className:"page-section-divider",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search Console"}),u.jsx("h2",{children:"Google Search Console"})]}),u.jsx("div",{className:"flex items-center gap-2",children:$e&&u.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:we,onClick:()=>{Fa()},children:we?"Refreshing…":"Refresh data"})})]}),Qs&&u.jsxs("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:[Qs,u.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>ut(null),children:"×"})]}),gl&&u.jsxs("div",{className:"mb-3 rounded-lg border border-emerald-800/40 bg-emerald-950/20 px-3 py-2 text-sm text-emerald-300",children:[gl,u.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>An(null),children:"×"})]}),U?u.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):u.jsxs("div",{className:"space-y-3",children:[u.jsxs(Be,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),u.jsx("h3",{children:"Domain authorization"})]}),u.jsx(mt,{tone:$e?"positive":t?"caution":"negative",children:$e?"Connected":t?"Ready to connect":"App credentials missing"})]}),$e?u.jsxs("div",{className:"mt-3 space-y-3",children:[u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),u.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),u.jsx("span",{className:"text-xs text-zinc-500",children:$e.domain}),u.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:$v,children:"Disconnect"})]}),u.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores OAuth tokens per canonical domain. This project currently maps to ",u.jsx("code",{children:$e.domain}),"."]})]}),u.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected property"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:$e.propertyId??"No property selected yet"})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:yi($e.updatedAt)})]})]})]}):u.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-5",children:[u.jsx("p",{className:"text-sm text-zinc-300",children:t?"Generate a Google OAuth link for this project and have the client sign in with a Google account that already has access to the correct Search Console property.":"Set Google OAuth client credentials first. Once configured, you can generate a consent link for this project domain."}),u.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[t?u.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:ae,onClick:Js,children:ae?"Opening…":"Connect Google Search Console"}):u.jsx(me,{type:"button",variant:"outline",size:"sm",asChild:!0,children:u.jsx(Rt,{to:"/settings",children:"Open Settings"})}),!t&&u.jsx("p",{className:"text-xs text-zinc-500",children:"The same Google OAuth app credentials are shared across all projects."})]})]})]}),$e&&!$e.sitemapUrl&&u.jsx("div",{className:"rounded-lg border border-amber-800/40 bg-amber-950/20 px-4 py-3",children:u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx("span",{className:"mt-0.5 text-amber-400",children:u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"h-5 w-5","aria-hidden":"true",children:u.jsx("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 6a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 6zm0 9a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Set your sitemap URL"}),u.jsx("p",{className:"mt-1 text-xs text-amber-400/70",children:"Canonry uses your sitemap to discover URLs for index coverage inspection. Auto-discover from GSC or enter it manually."}),u.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[u.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[u.jsx(me,{type:"button",size:"sm",disabled:Wn.isPending||!$e.propertyId,onClick:Rf,children:Wn.isPending?"Discovering…":"Auto-discover from GSC"}),u.jsx("span",{className:"self-center text-xs text-amber-400/60",children:"or enter manually:"})]}),u.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[u.jsx("input",{className:"flex-1 rounded border border-amber-800/40 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-500 focus:border-amber-600 focus:outline-none",type:"url",placeholder:"https://example.com/sitemap.xml",value:Ae,onChange:K=>Oe(K.target.value),onKeyDown:K=>K.key==="Enter"&&void Pi()}),u.jsx(me,{type:"button",size:"sm",variant:"outline",disabled:nt||!Ae.trim(),onClick:Pi,children:nt?"Saving…":"Save sitemap URL"})]})]})]})]})}),($e||Rr)&&u.jsxs(u.Fragment,{children:[u.jsxs(Be,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),u.jsx("h3",{children:"Index coverage"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[X&&X.notIndexed.length>0&&u.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:cr,onClick:()=>{vl()},children:cr?"Requesting…":`Request indexing (${X.notIndexed.length})`}),u.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:de,onClick:()=>{Xs()},children:de?"Loading…":"Refresh coverage"})]})]}),X&&X.summary.total>0?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const K=X.summary.indexed+X.summary.notIndexed,xe=K>0?X.summary.indexed/K:0,vt=K>0?X.summary.notIndexed/K:0,Vt=54,Ut=2*Math.PI*Vt,zt=Ut*(1-xe),Zt=Ut*vt,Sr=Ut*xe;return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"relative h-48 w-48",children:[u.jsxs("svg",{viewBox:"0 0 128 128",className:"h-full w-full","aria-hidden":"true",children:[u.jsx("circle",{cx:"64",cy:"64",r:Vt,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),u.jsx("circle",{cx:"64",cy:"64",r:Vt,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:Ut,strokeDashoffset:zt,strokeLinecap:"round",transform:"rotate(-90 64 64)",style:{transition:"stroke-dashoffset 0.6s ease"}}),X.summary.notIndexed>0&&u.jsx("circle",{cx:"64",cy:"64",r:Vt,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${Zt} ${Ut-Zt}`,strokeDashoffset:-Sr,transform:"rotate(-90 64 64)",style:{transition:"stroke-dasharray 0.6s ease, stroke-dashoffset 0.6s ease"}})]}),u.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[u.jsxs("span",{className:"text-3xl font-bold tabular-nums text-zinc-50",children:[(xe*100).toFixed(0),"%"]}),u.jsx("span",{className:"text-xs uppercase tracking-widest text-zinc-500 mt-0.5",children:"Indexed"})]})]}),u.jsxs("div",{className:"mt-4 flex items-center justify-center gap-8",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-emerald-500"}),u.jsxs("div",{children:[u.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:X.summary.indexed.toLocaleString()}),u.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Indexed"})]})]}),u.jsx("div",{className:"h-8 w-px bg-zinc-800"}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-zinc-500"}),u.jsxs("div",{children:[u.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:X.summary.notIndexed.toLocaleString()}),u.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(X.reasonGroups??[]).length>0&&u.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(X.reasonGroups??[]).length," ",(X.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),X.summary.deindexed>0&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"h-8 w-px bg-zinc-800"}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-rose-500"}),u.jsxs("div",{children:[u.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:X.summary.deindexed.toLocaleString()}),u.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Deindexed"})]})]})]})]})]})})()}),u.jsx("div",{className:"mt-3 flex gap-1",children:["indexed","notIndexed","deindexed"].map(K=>{const xe=K==="indexed"?X.indexed.length:K==="notIndexed"?X.notIndexed.length:X.deindexed.length,vt=K==="indexed"?"Indexed":K==="notIndexed"?"Not Indexed":"Deindexed";return u.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${Gt===K?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{he(K),Pt(null)},children:[vt," (",xe,")"]},K)})}),u.jsxs("div",{className:"mt-3 overflow-x-auto",children:[Gt==="indexed"&&X.indexed.length>0&&u.jsxs("table",{className:"data-table w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left",children:"URL"}),u.jsx("th",{className:"text-left",children:"Verdict"}),u.jsx("th",{className:"text-left",children:"Last Crawl"}),u.jsx("th",{className:"text-left",children:"Mobile"})]})}),u.jsx("tbody",{children:X.indexed.map(K=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:K.url}),u.jsx("td",{className:"text-zinc-400",children:K.verdict??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:K.crawlTime?K.crawlTime.split("T")[0]:"—"}),u.jsx("td",{className:"text-zinc-400",children:K.isMobileFriendly===!0?"Yes":K.isMobileFriendly===!1?"No":"—"})]},K.id))})]}),Gt==="notIndexed"&&!at&&(X.reasonGroups??[]).length>0&&u.jsxs("table",{className:"data-table w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left",children:"Reason"}),u.jsx("th",{className:"text-right",children:"Pages"})]})}),u.jsx("tbody",{children:(X.reasonGroups??[]).map(K=>u.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>Pt(K.reason),children:[u.jsx("td",{className:"text-zinc-200",children:K.reason}),u.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:K.count})]},K.reason))})]}),Gt==="notIndexed"&&!at&&(X.reasonGroups??[]).length===0&&X.notIndexed.length>0&&u.jsxs("table",{className:"data-table w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left",children:"URL"}),u.jsx("th",{className:"text-left",children:"Indexing State"}),u.jsx("th",{className:"text-left",children:"Coverage"})]})}),u.jsx("tbody",{children:X.notIndexed.map(K=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:K.url}),u.jsx("td",{className:"text-zinc-400",children:K.indexingState??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:K.coverageState??"Unknown"})]},K.id))})]}),Gt==="notIndexed"&&at&&(()=>{const K=(X.reasonGroups??[]).find(xe=>xe.reason===at);return K?u.jsxs("div",{children:[u.jsx("div",{className:"flex items-center gap-2 mb-3",children:u.jsxs("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>Pt(null),children:["←"," Back to reasons"]})}),u.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-sm font-medium text-zinc-200",children:K.reason}),u.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[K.count," affected page",K.count!==1?"s":""]})]}),u.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:cr,onClick:()=>{Ti(K.urls.map(xe=>xe.url))},children:cr?"Requesting…":`Request indexing (${K.count})`})]}),u.jsxs("table",{className:"data-table w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left",children:"URL"}),u.jsx("th",{className:"text-left",children:"Last Crawl"}),u.jsx("th",{className:"w-8"})]})}),u.jsx("tbody",{children:K.urls.map(xe=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:xe.url}),u.jsx("td",{className:"text-zinc-400",children:xe.crawlTime?xe.crawlTime.split("T")[0]:"—"}),u.jsx("td",{children:u.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-200 transition-colors",disabled:cr,onClick:()=>{Ti([xe.url])},title:"Request indexing",children:"Index"})})]},xe.id))})]})]}):null})(),Gt==="deindexed"&&X.deindexed.length>0&&u.jsxs("table",{className:"data-table w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left",children:"URL"}),u.jsx("th",{className:"text-left",children:"Previous"}),u.jsx("th",{className:"text-left",children:"Current"}),u.jsx("th",{className:"text-left",children:"Detected"})]})}),u.jsx("tbody",{children:X.deindexed.map((K,xe)=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:K.url}),u.jsx("td",{className:"text-zinc-400",children:K.previousState}),u.jsx("td",{className:"text-zinc-400",children:K.currentState}),u.jsx("td",{className:"text-zinc-400",children:K.transitionDate.split("T")[0]})]},`${K.url}-${xe}`))})]}),(Gt==="indexed"&&X.indexed.length===0||Gt==="notIndexed"&&!at&&X.notIndexed.length===0||Gt==="deindexed"&&X.deindexed.length===0)&&u.jsx("p",{className:"text-sm text-zinc-500",children:"No URLs in this category."})]})]}):u.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:de?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),u.jsxs(Be,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Performance"}),u.jsx("h3",{children:"Search performance"})]}),u.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:we,onClick:()=>{Fa()},children:we?"Loading…":"Apply filters"})]}),c.length>0&&(()=>{const K=new Map;for(const Je of c){const yt=K.get(Je.date);yt?(yt.clicks+=Je.clicks,yt.impressions+=Je.impressions):K.set(Je.date,{clicks:Je.clicks,impressions:Je.impressions})}const xe=[...K.entries()].sort(([Je],[yt])=>Je.localeCompare(yt));if(xe.length===0)return null;const vt=Math.max(...xe.map(([,Je])=>Je.impressions),1),Vt=xe.reduce((Je,[,yt])=>Je+yt.clicks,0),Ut=xe.reduce((Je,[,yt])=>Je+yt.impressions,0),zt=Ut>0?(Vt/Ut*100).toFixed(1):"0.0",Zt=700,Sr=220,Bn={top:12,bottom:36,left:48,right:12},Uv=Zt-Bn.left-Bn.right,Ka=Sr-Bn.top-Bn.bottom,Ha=Uv/xe.length,zi=Math.max(Math.min(Ha*.35,24),4),bl=Math.max(zi*.15,1),Ga=Je=>{if(Je<=0)return 1;const yt=Math.pow(10,Math.floor(Math.log10(Je))),mn=Je/yt,Qn=mn<=1.5?1.5:mn<=3?3:mn<=5?5:10;return Math.ceil(Qn*yt)},fi=4,Mi=Math.ceil(Ga(vt)/fi)*fi,Va=Array.from({length:fi+1},(Je,yt)=>Mi/fi*yt),on=Je=>Je>=1e3?`${(Je/1e3).toFixed(Je>=1e4?0:1)}k`:String(Je);return u.jsxs("div",{className:"mt-3",children:[u.jsxs("div",{className:"flex items-center gap-5 mb-2",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-emerald-500"}),u.jsxs("span",{className:"text-xs text-zinc-400",children:["Clicks ",u.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:Vt.toLocaleString()})]})]}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-blue-500"}),u.jsxs("span",{className:"text-xs text-zinc-400",children:["Impressions ",u.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:Ut.toLocaleString()})]})]}),u.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",u.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[zt,"%"]})]})]}),u.jsx("div",{className:"relative w-full",style:{aspectRatio:`${Zt} / ${Sr}`},children:u.jsxs("svg",{viewBox:`0 0 ${Zt} ${Sr}`,className:"h-full w-full",children:[Va.map((Je,yt)=>{const mn=Bn.top+Ka-Je/Mi*Ka;return u.jsxs("g",{children:[u.jsx("line",{x1:Bn.left,y1:mn,x2:Zt-Bn.right,y2:mn,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),u.jsx("text",{x:Bn.left-6,y:mn+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:on(Je)})]},`t-${yt}`)}),xe.map(([Je,yt],mn)=>{const Qn=Bn.left+Ha*mn+Ha/2,xl=yt.impressions/Mi*Ka,hu=yt.clicks/Mi*Ka;return u.jsxs("g",{children:[u.jsx("title",{children:`${Je}
269
- Clicks: ${yt.clicks}
270
- Impressions: ${yt.impressions}
271
- CTR: ${yt.impressions>0?(yt.clicks/yt.impressions*100).toFixed(1):0}%`}),u.jsx("rect",{x:Qn-zi-bl/2,y:Bn.top+Ka-xl,width:zi,height:Math.max(xl,1),rx:2,fill:"#3b82f6",opacity:.85}),u.jsx("rect",{x:Qn+bl/2,y:Bn.top+Ka-hu,width:zi,height:Math.max(hu,1),rx:2,fill:"#10b981",opacity:.85})]},Je)}),(()=>{const Je=Math.min(xe.length,7);return Array.from({length:Je},(yt,mn)=>{const Qn=xe.length===1?0:Math.round(mn/(Je-1)*(xe.length-1)),xl=Bn.left+Ha*Qn+Ha/2;return u.jsx("text",{x:xl,y:Sr-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:xe[Qn][0].slice(5)},`xl-${Qn}`)})})()]})})]})})(),u.jsxs("div",{className:"mt-3 grid gap-2 lg:grid-cols-5",children:[u.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"date",value:A.startDate,onChange:K=>z(xe=>({...xe,startDate:K.target.value}))}),u.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"date",value:A.endDate,onChange:K=>z(xe=>({...xe,endDate:K.target.value}))}),u.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter query",value:A.query,onChange:K=>z(xe=>({...xe,query:K.target.value}))}),u.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter page",value:A.page,onChange:K=>z(xe=>({...xe,page:K.target.value}))}),u.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"number",min:"1",placeholder:"Limit",value:A.limit,onChange:K=>z(xe=>({...xe,limit:K.target.value}))})]}),c.length>0?u.jsx("div",{className:"mt-3 overflow-x-auto",children:u.jsxs("table",{className:"data-table w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left",children:"Date"}),u.jsx("th",{className:"text-left",children:"Query"}),u.jsx("th",{className:"text-left",children:"Page"}),Object.values(As).map(K=>u.jsx("th",{className:"text-right","aria-sort":Fe?.key===K?Fe.dir==="asc"?"ascending":"descending":"none",children:u.jsxs("button",{type:"button",className:"w-full cursor-pointer select-none text-right hover:text-zinc-200 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-zinc-400 rounded px-1 -mx-1",onClick:()=>St(xe=>xe?.key===K?xe.dir==="desc"?{key:K,dir:"asc"}:null:{key:K,dir:"desc"}),children:[HF[K],Fe?.key===K?Fe.dir==="desc"?" ↓":" ↑":""]})},K))]})}),u.jsx("tbody",{children:lr.map((K,xe)=>u.jsxs("tr",{children:[u.jsx("td",{className:"text-zinc-400",children:K.date}),u.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:K.query}),u.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:K.page}),u.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:K.clicks.toLocaleString()}),u.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:K.impressions.toLocaleString()}),u.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(Number.isFinite(K.ctr)?K.ctr*100:0).toFixed(1),"%"]}),u.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:K.position.toFixed(1)})]},`${K.date}:${K.query}:${K.page}:${xe}`))})]})}):u.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),u.jsxs(Be,{className:"surface-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Inspection"}),u.jsx("h3",{children:"Inspect a URL"})]})}),u.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[u.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://example.com/page",value:C,onChange:K=>E(K.target.value),onKeyDown:K=>K.key==="Enter"&&void fu()}),u.jsx(me,{type:"button",size:"sm",disabled:oe||!$e?.propertyId||!C.trim(),onClick:fu,children:oe?"Inspecting…":"Inspect URL"})]}),y&&u.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Indexing state"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:y.indexingState??"Unknown"})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Verdict"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:y.verdict??"Unknown"})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Mobile friendly"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:yA(y.isMobileFriendly)})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last crawl"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:yi(y.crawlTime)})]})]})]}),u.jsxs(Be,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),u.jsx("h3",{children:"Inspection log"})]}),u.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:D,onClick:()=>{ia()},children:D?"Loading…":"Refresh history"})]}),u.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[u.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter exact URL",value:R,onChange:K=>q(K.target.value)}),u.jsx(me,{type:"button",size:"sm",variant:"outline",disabled:D,onClick:()=>{ia()},children:"Apply filter"})]}),h.length>0?u.jsx("div",{className:"mt-3 overflow-x-auto",children:u.jsxs("table",{className:"data-table w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left",children:"URL"}),u.jsx("th",{className:"text-left",children:"Indexing"}),u.jsx("th",{className:"text-left",children:"Verdict"}),u.jsx("th",{className:"text-left",children:"Coverage"}),u.jsx("th",{className:"text-left",children:"Mobile"}),u.jsx("th",{className:"text-left",children:"Inspected"})]})}),u.jsx("tbody",{children:h.map(K=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:K.url}),u.jsx("td",{className:"text-zinc-300",children:K.indexingState??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:K.verdict??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:K.coverageState??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:yA(K.isMobileFriendly)}),u.jsx("td",{className:"text-zinc-400",children:yi(K.inspectedAt)})]},K.id))})]})}):u.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),u.jsxs(Be,{className:"surface-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Deindexed"}),u.jsx("h3",{children:"Recent indexing losses"})]})}),g.length>0?u.jsx("div",{className:"mt-3 overflow-x-auto",children:u.jsxs("table",{className:"data-table w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left",children:"URL"}),u.jsx("th",{className:"text-left",children:"Previous"}),u.jsx("th",{className:"text-left",children:"Current"}),u.jsx("th",{className:"text-left",children:"Changed at"})]})}),u.jsx("tbody",{children:g.map(K=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:K.url}),u.jsx("td",{className:"text-zinc-400",children:K.previousState??"Unknown"}),u.jsx("td",{className:"text-zinc-300",children:K.currentState??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:yi(K.transitionDate)})]},`${K.url}:${K.transitionDate}`))})]})}):u.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),$e&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"border-t border-zinc-800/60 pt-3",children:u.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 text-left",onClick:()=>pn(K=>!K),children:[u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:`h-4 w-4 text-zinc-500 transition-transform ${sn?"rotate-90":""}`,"aria-hidden":"true",children:u.jsx("path",{fillRule:"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z",clipRule:"evenodd"})}),u.jsx("span",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Setup & Configuration"})]})}),sn&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[u.jsxs(Be,{className:"surface-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Property"}),u.jsx("h3",{children:"Pick the Search Console property"})]})}),u.jsxs("div",{className:"mt-3 space-y-2",children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-property-${e}`,children:"Property URL"}),u.jsx("select",{id:`gsc-property-${e}`,className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:S,disabled:ge||s.length===0,onChange:K=>N(K.target.value),children:s.length===0?u.jsx("option",{value:"",children:ge?"Loading properties…":"No properties available"}):s.map(K=>u.jsxs("option",{value:K.siteUrl,children:[K.siteUrl," · ",K.permissionLevel]},K.siteUrl))}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(me,{type:"button",size:"sm",variant:"outline",disabled:ge,onClick:()=>{Mf($e)},children:ge?"Refreshing…":"Refresh properties"}),u.jsx(me,{type:"button",size:"sm",disabled:!S||re,onClick:If,children:re?"Saving…":"Save property"})]}),u.jsx("p",{className:"text-xs text-zinc-500",children:"The selected property is used for future syncs and URL inspections for this project."})]})]}),u.jsxs(Be,{className:"surface-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sync"}),u.jsx("h3",{children:"Import GSC performance data"})]})}),u.jsxs("div",{className:"mt-3 space-y-3",children:[u.jsxs("div",{className:"grid gap-3 sm:grid-cols-[160px_1fr]",children:[u.jsxs("div",{children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-sync-days-${e}`,children:"Days"}),u.jsx("input",{id:`gsc-sync-days-${e}`,type:"number",min:"1",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",value:k,onChange:K=>O(K.target.value)})]}),u.jsxs("label",{className:"flex items-center gap-2 rounded border border-zinc-800/60 bg-zinc-900/20 px-3 py-2 text-sm text-zinc-300",children:[u.jsx("input",{type:"checkbox",checked:T,onChange:K=>P(K.target.checked)}),"Replace existing imported rows for the requested range"]})]}),u.jsx(me,{type:"button",size:"sm",disabled:be.isPending||!$e.propertyId,onClick:Lf,children:be.isPending?"Queueing…":"Queue sync"}),!$e.propertyId&&u.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),u.jsxs(Be,{className:"surface-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sitemap"}),u.jsx("h3",{children:"Sitemap configuration"})]})}),u.jsxs("div",{className:"mt-3 space-y-3",children:[$e.sitemapUrl&&u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Current sitemap URL"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200 break-all",children:$e.sitemapUrl})]}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(me,{type:"button",size:"sm",variant:"outline",disabled:Z||!$e.propertyId,onClick:()=>{Df()},children:Z?"Loading…":"Browse sitemaps from GSC"}),u.jsx(me,{type:"button",size:"sm",variant:"outline",disabled:Wn.isPending||!$e.propertyId,onClick:Rf,children:Wn.isPending?"Discovering…":"Auto-discover and queue inspection"})]}),u.jsx("p",{className:"text-xs text-zinc-500",children:"Browse lists available sitemaps without queueing a run. Auto-discover saves the primary sitemap and queues an inspection."}),Se&&Se.length>0&&u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3 space-y-2",children:[u.jsxs("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:["Sitemaps (",Se.length,")"]}),Se.map(K=>{const xe=K.contents?.[0];return u.jsxs("div",{className:"flex items-start justify-between gap-2 text-xs",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-zinc-200 break-all",children:K.path}),K.lastSubmitted&&u.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",K.lastSubmitted.split("T")[0]]})]}),u.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[xe&&u.jsxs("div",{className:"text-right",children:[u.jsxs("p",{className:"text-zinc-300",children:[xe.indexed," / ",xe.submitted]}),u.jsx("p",{className:"text-zinc-500",children:"indexed"})]}),u.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>Oe(K.path),children:"Use"})]})]},K.path)})]}),u.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[u.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:$e.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:Ae,onChange:K=>Oe(K.target.value),onKeyDown:K=>K.key==="Enter"&&Ae.trim()&&void Pi()}),u.jsx(me,{type:"button",size:"sm",disabled:nt||!Ae.trim(),onClick:Pi,children:nt?"Saving…":$e.sitemapUrl?"Update":"Save"})]}),u.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[u.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"Sitemap URL for inspection (leave empty for saved default)",id:`gsc-sitemap-inspect-${e}`}),u.jsx(me,{type:"button",size:"sm",variant:"outline",disabled:du.isPending||!$e.propertyId,onClick:async()=>{const xe=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||$e.sitemapUrl||void 0;ut(null),An(null);try{await du.mutateAsync({projectName:e,projectLabel:e,opts:{sitemapUrl:xe}})}catch{}},children:du.isPending?"Queueing…":"Inspect sitemap"})]}),!$e.propertyId&&u.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function Hve({project:e,onUpdateProject:t,onRefresh:n}){const[r,i]=x.useState(!1),[s,l]=x.useState(!1),[c,f]=x.useState(null),[h,p]=x.useState(e.displayName),[g,v]=x.useState(e.canonicalDomain),[y,w]=x.useState(e.country),[S,N]=x.useState(e.language),[C,E]=x.useState(e.ownedDomains??[]),[k,O]=x.useState(""),[T,P]=x.useState(null),[A,z]=x.useState(!1),[R,q]=x.useState(!1),[U,L]=x.useState(""),[ae,pe]=x.useState(""),[ge,V]=x.useState(""),[re,ve]=x.useState(""),[we,B]=x.useState("");x.useEffect(()=>{r||(p(e.displayName),v(e.canonicalDomain),w(e.country),N(e.language),E(e.ownedDomains??[]))},[e,r]);function D(){i(!1),f(null),p(e.displayName),v(e.canonicalDomain),w(e.country),N(e.language),E(e.ownedDomains??[]),O("")}function G(){const F=k.trim();F&&(C.includes(F)||E([...C,F]),O(""))}function oe(F){E(C.filter(Ae=>Ae!==F))}async function W(){if(!(!h.trim()||!g.trim()||!y.trim()||!S.trim())){l(!0),f(null);try{await t(e.name,{displayName:h.trim(),canonicalDomain:g.trim(),ownedDomains:C,country:y.trim(),language:S.trim()}),i(!1),Qe({title:"Project settings saved",detail:`${h.trim()} was updated.`,tone:"positive",dedupeKey:`project:update:${e.name}`,dedupeMode:"replace"})}catch(F){f(F instanceof Error?F.message:"Failed to save")}finally{l(!1)}}}async function X(){const F=U.trim(),Ae=ae.trim(),Oe=ge.trim(),nt=re.trim();if(!(!F||!Ae||!Oe||!nt)){z(!0),P(null);try{const Ve={label:F,city:Ae,region:Oe,country:nt};we.trim()&&(Ve.timezone=we.trim()),await d9(e.name,Ve),n(),L(""),pe(""),V(""),ve(""),B(""),q(!1),Qe({title:"Location added",detail:`${F} is now available for ${e.name}.`,tone:"positive",dedupeKey:`project:location:add:${e.name}:${F}`,dedupeMode:"drop"})}catch(Ve){P(Ve instanceof Error?Ve.message:"Failed to add location")}finally{z(!1)}}}async function Q(F){z(!0),P(null);try{await f9(e.name,F),n(),Qe({title:"Location removed",detail:`${F} was removed from ${e.name}.`,tone:"positive",dedupeKey:`project:location:remove:${e.name}:${F}`,dedupeMode:"drop"})}catch(Ae){P(Ae instanceof Error?Ae.message:"Failed to remove location")}finally{z(!1)}}async function de(F){z(!0),P(null);try{await h9(e.name,F),n(),Qe({title:"Default location updated",detail:`${F} is now the default for ${e.name}.`,tone:"positive",dedupeKey:`project:location:default:${e.name}`,dedupeMode:"replace"})}catch(Ae){P(Ae instanceof Error?Ae.message:"Failed to set default location")}finally{z(!1)}}const ye=h!==e.displayName||g!==e.canonicalDomain||y!==e.country||S!==e.language||JSON.stringify(C)!==JSON.stringify(e.ownedDomains??[]),Z="w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",le="block text-xs font-medium text-zinc-400 mb-1",Se=U.trim()&&ae.trim()&&ge.trim()&&re.trim();return u.jsxs("section",{className:"page-section-divider",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Configuration"}),u.jsx("h2",{children:"Project settings"})]}),!r&&u.jsx(me,{type:"button",variant:"outline",size:"sm",onClick:()=>i(!0),children:"Edit settings"})]}),c&&u.jsxs("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:[c,u.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>f(null),children:"×"})]}),r?u.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-4",children:[u.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:le,children:"Display name"}),u.jsx("input",{className:Z,type:"text",value:h,onChange:F=>p(F.target.value),placeholder:"My Project"})]}),u.jsxs("div",{children:[u.jsx("label",{className:le,children:"Canonical domain"}),u.jsx("input",{className:Z,type:"text",value:g,onChange:F=>v(F.target.value),placeholder:"example.com"})]}),u.jsxs("div",{children:[u.jsx("label",{className:le,children:"Country"}),u.jsx("input",{className:Z,type:"text",value:y,onChange:F=>w(F.target.value),placeholder:"US",maxLength:2})]}),u.jsxs("div",{children:[u.jsx("label",{className:le,children:"Language"}),u.jsx("input",{className:Z,type:"text",value:S,onChange:F=>N(F.target.value),placeholder:"en"})]})]}),u.jsxs("div",{children:[u.jsx("label",{className:le,children:"Owned domains"}),u.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:C.map(F=>u.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:[F,u.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>oe(F),"aria-label":`Remove ${F}`,children:"×"})]},F))}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{className:`${Z} flex-1`,type:"text",placeholder:"docs.example.com",value:k,onChange:F=>O(F.target.value),onKeyDown:F=>F.key==="Enter"&&(F.preventDefault(),G())}),u.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:!k.trim(),onClick:G,children:"Add"})]})]}),u.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[u.jsx(me,{type:"button",disabled:s||!ye||!h.trim()||!g.trim(),onClick:W,children:s?"Saving...":"Save changes"}),u.jsx(me,{type:"button",variant:"outline",disabled:s,onClick:D,children:"Cancel"})]})]}):u.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:u.jsx("table",{className:"w-full text-sm",children:u.jsxs("tbody",{children:[u.jsxs("tr",{className:"border-b border-zinc-800/40",children:[u.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium w-40",children:"Display name"}),u.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.displayName||"—"})]}),u.jsxs("tr",{className:"border-b border-zinc-800/40",children:[u.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Canonical domain"}),u.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.canonicalDomain})]}),u.jsxs("tr",{className:"border-b border-zinc-800/40",children:[u.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Owned domains"}),u.jsx("td",{className:"px-4 py-2.5",children:(e.ownedDomains??[]).length>0?u.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.ownedDomains.map(F=>u.jsx("span",{className:"rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:F},F))}):u.jsx("span",{className:"text-zinc-500",children:"—"})})]}),u.jsxs("tr",{className:"border-b border-zinc-800/40",children:[u.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Country"}),u.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.country})]}),u.jsxs("tr",{className:"border-b border-zinc-800/40",children:[u.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Language"}),u.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.language})]}),u.jsxs("tr",{children:[u.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium align-top pt-3",children:"Locations"}),u.jsxs("td",{className:"px-4 py-2.5",children:[T&&u.jsxs("div",{className:"mb-2 rounded border border-rose-800/40 bg-rose-950/20 px-2 py-1 text-xs text-rose-300",children:[T,u.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>P(null),children:"×"})]}),(e.locations??[]).length>0?u.jsxs("table",{className:"w-full text-xs mb-2",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"text-zinc-600",children:[u.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Label"}),u.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"City"}),u.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Region"}),u.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Country"}),u.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Timezone"}),u.jsx("th",{className:"pb-1"})]})}),u.jsx("tbody",{children:e.locations.map(F=>u.jsxs("tr",{className:"border-t border-zinc-800/30",children:[u.jsx("td",{className:"py-1.5 pr-3",children:u.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${F.label===e.defaultLocation?"border-emerald-700/60 bg-emerald-950/30 text-emerald-300":"border-zinc-700/60 bg-zinc-800/40 text-zinc-300"}`,children:[F.label,F.label===e.defaultLocation?" ★":""]})}),u.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:F.city}),u.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:F.region}),u.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:F.country}),u.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:F.timezone??"—"}),u.jsx("td",{className:"py-1.5",children:u.jsxs("div",{className:"flex items-center gap-1.5",children:[F.label!==e.defaultLocation&&u.jsx("button",{type:"button",disabled:A,onClick:()=>de(F.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${F.label} as default location`,children:"Set default"}),u.jsx("button",{type:"button",disabled:A,onClick:()=>Q(F.label),className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${F.label}`,children:"Remove"})]})})]},F.label))})]}):u.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),R?u.jsxs("div",{className:"mt-2 rounded border border-zinc-800 bg-zinc-900/50 p-3 space-y-2",children:[u.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-zinc-500",children:"Add location"}),u.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Label *"}),u.jsx("input",{className:Z,type:"text",value:U,onChange:F=>L(F.target.value),placeholder:"nyc"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"City *"}),u.jsx("input",{className:Z,type:"text",value:ae,onChange:F=>pe(F.target.value),placeholder:"New York"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Region *"}),u.jsx("input",{className:Z,type:"text",value:ge,onChange:F=>V(F.target.value),placeholder:"NY"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Country *"}),u.jsx("input",{className:Z,type:"text",value:re,onChange:F=>ve(F.target.value),placeholder:"US",maxLength:2})]}),u.jsxs("div",{className:"col-span-2",children:[u.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Timezone (optional)"}),u.jsx("input",{className:Z,type:"text",value:we,onChange:F=>B(F.target.value),placeholder:"America/New_York"})]})]}),u.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[u.jsx(me,{type:"button",size:"sm",disabled:A||!Se,onClick:X,children:A?"Adding...":"Add location"}),u.jsx(me,{type:"button",size:"sm",variant:"outline",disabled:A,onClick:()=>{q(!1),P(null)},children:"Cancel"})]})]}):u.jsx(me,{type:"button",size:"sm",variant:"outline",onClick:()=>q(!0),children:"+ Add location"})]})]})]})})})]})}const Gve=[{value:"daily",label:"Every day"},{value:"weekly@mon",label:"Every Monday"},{value:"weekly@wed",label:"Every Wednesday"},{value:"weekly@fri",label:"Every Friday"},{value:"twice-daily",label:"Twice a day (6am & 6pm)"},{value:"custom",label:"Custom cron expression"}],sM=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","America/Toronto","America/Vancouver","Europe/London","Europe/Paris","Europe/Berlin","Asia/Tokyo","Asia/Shanghai","Asia/Singapore","Australia/Sydney"];function Vve({projectName:e}){const[t,n]=x.useState("loading"),[r,i]=x.useState(!1),[s,l]=x.useState("daily"),[c,f]=x.useState(6),[h,p]=x.useState(""),[g,v]=x.useState("UTC"),[y,w]=x.useState(!1),[S,N]=x.useState(""),[C,E]=x.useState(!1),[k,O]=x.useState(!1),[T,P]=x.useState(null);x.useEffect(()=>{w9(e).then(n).catch(()=>n(null))},[e]);const A=()=>{if(t&&t!=="loading"){const U=ZF(t.preset??null,t.cronExpr);l(U.freq),f(U.hour),p(U.customCron);const L=sM.includes(t.timezone);v(L?t.timezone:"Other"),w(!L),N(L?"":t.timezone)}else l("daily"),f(6),p(""),v("UTC"),w(!1),N("");P(null),i(!0)},z=async()=>{E(!0),P(null);try{const L={timezone:y?S.trim()||"UTC":g};s==="custom"?L.cron=h.trim():L.preset=VF(s,c);const ae=await aA(e,L);n(ae),i(!1),Qe({title:"Schedule saved",detail:db(ae.preset??null,ae.cronExpr,ae.timezone),tone:"positive",dedupeKey:`schedule:${e}`,dedupeMode:"replace"})}catch(U){P(U instanceof Error?U.message:"Failed to save schedule")}finally{E(!1)}},R=async()=>{if(!(!t||t==="loading")){E(!0),P(null);try{const U={timezone:t.timezone,enabled:!t.enabled};t.preset?U.preset=t.preset:U.cron=t.cronExpr;const L=await aA(e,U);n(L),Qe({title:L.enabled?"Schedule resumed":"Schedule paused",detail:db(L.preset??null,L.cronExpr,L.timezone),tone:"positive",dedupeKey:`schedule:toggle:${e}`,dedupeMode:"replace"})}catch(U){P(U instanceof Error?U.message:"Failed to update schedule")}finally{E(!1)}}},q=async()=>{O(!0),P(null);try{await S9(e),n(null),i(!1),Qe({title:"Schedule removed",detail:`${e} will no longer run automatically.`,tone:"positive",dedupeKey:`schedule:remove:${e}`,dedupeMode:"drop"})}catch(U){P(U instanceof Error?U.message:"Failed to remove schedule")}finally{O(!1)}};return u.jsxs("section",{className:"page-section-divider",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),u.jsx("h2",{children:"Scheduled runs"})]}),t!=="loading"&&!r&&u.jsx(me,{type:"button",variant:"outline",size:"sm",onClick:A,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&u.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!r&&t===null&&u.jsx(Be,{className:"surface-card compact-card",children:u.jsx("p",{className:"supporting-copy",children:"No schedule configured. Set one to automatically trigger visibility sweeps."})}),t!=="loading"&&!r&&t!==null&&u.jsxs(Be,{className:"surface-card compact-card",children:[u.jsxs("div",{className:"flex items-start justify-between gap-4",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx("p",{className:"text-sm font-medium text-zinc-200",children:db(t.preset??null,t.cronExpr,t.timezone)}),u.jsxs("p",{className:"text-xs text-zinc-500",children:["Cron: ",u.jsx("span",{className:"font-mono",children:t.cronExpr})]}),t.nextRunAt&&u.jsxs("p",{className:"text-xs text-zinc-500",children:["Next run: ",new Date(t.nextRunAt).toLocaleString()]}),t.lastRunAt&&u.jsxs("p",{className:"text-xs text-zinc-500",children:["Last run: ",new Date(t.lastRunAt).toLocaleString()]})]}),u.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u.jsx(mt,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),u.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:C,onClick:R,children:t.enabled?"Pause":"Resume"}),u.jsx(me,{type:"button",variant:"ghost",size:"sm",disabled:k,onClick:q,children:k?"Removing...":"Remove"})]})]}),T&&u.jsx("p",{className:"text-rose-400 text-sm mt-2",children:T})]}),r&&u.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Frequency"}),u.jsx("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:s,onChange:U=>l(U.target.value),children:Gve.map(U=>u.jsx("option",{value:U.value,children:U.label},U.value))})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Time"}),u.jsx("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none disabled:opacity-40",value:c,disabled:s==="twice-daily"||s==="custom",onChange:U=>f(parseInt(U.target.value)),children:Array.from({length:24},(U,L)=>u.jsx("option",{value:L,children:ww(L)},L))})]})]}),s==="custom"&&u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Cron expression"}),u.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 font-mono focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"0 9 * * 1-5",value:h,onChange:U=>p(U.target.value)})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Timezone"}),u.jsxs("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:y?"Other":g,onChange:U=>{U.target.value==="Other"?(w(!0),v("Other")):(w(!1),v(U.target.value))},children:[sM.map(U=>u.jsx("option",{value:U,children:U},U)),u.jsxs("option",{value:"Other",children:["Other (enter manually)","…"]})]}),y&&u.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"e.g. America/New_York",value:S,onChange:U=>N(U.target.value)})]}),T&&u.jsx("p",{className:"text-rose-400 text-sm",children:T}),u.jsxs("div",{className:"flex gap-2 justify-end",children:[u.jsx(me,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),P(null)},children:"Cancel"}),u.jsx(me,{type:"button",size:"sm",disabled:C||s==="custom"&&!h.trim(),onClick:z,children:C?"Saving...":"Save schedule"})]})]})]})}const Zve=[{value:"citation.lost",label:"Citation lost"},{value:"citation.gained",label:"Citation gained"},{value:"run.completed",label:"Run completed"},{value:"run.failed",label:"Run failed"}];function Yve({projectName:e}){const[t,n]=x.useState("loading"),[r,i]=x.useState(!1),[s,l]=x.useState(""),[c,f]=x.useState(["citation.lost","citation.gained"]),[h,p]=x.useState(!1),[g,v]=x.useState(null),[y,w]=x.useState({});x.useEffect(()=>{j9(e).then(n).catch(()=>n([]))},[e]);const S=k=>{f(O=>O.includes(k)?O.filter(T=>T!==k):[...O,k])},N=async()=>{if(!(!s.trim()||c.length===0)){p(!0),v(null);try{const k=await N9(e,{channel:"webhook",url:s.trim(),events:c});n(O=>O==="loading"?[k]:[...O,k]),l(""),f(["citation.lost","citation.gained"]),i(!1),Qe({title:"Webhook added",detail:`Notifications will be sent to ${k.url}.`,tone:"positive",dedupeKey:`notification:add:${e}`,dedupeMode:"drop"})}catch(k){v(k instanceof Error?k.message:"Failed to add webhook")}finally{p(!1)}}},C=async k=>{try{await C9(e,k),n(O=>O==="loading"?O:O.filter(T=>T.id!==k)),Qe({title:"Webhook removed",detail:`${e} no longer sends notifications to this endpoint.`,tone:"positive",dedupeKey:`notification:remove:${e}:${k}`,dedupeMode:"drop"})}catch(O){v(O instanceof Error?O.message:"Failed to remove webhook")}},E=async k=>{w(O=>({...O,[k]:{state:"testing"}}));try{const O=await O9(e,k);w(T=>({...T,[k]:{state:O.ok?"ok":"fail",status:O.status}})),O.ok&&Qe({title:"Test notification sent",detail:`Webhook returned status ${O.status}.`,tone:"positive",dedupeKey:`notification:test:${e}:${k}`,dedupeMode:"replace"})}catch{w(O=>({...O,[k]:{state:"fail"}}))}};return u.jsxs("section",{className:"page-section-divider",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),u.jsx("h2",{children:"Notifications"})]}),t!=="loading"&&u.jsx(me,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!r),v(null)},children:r?"Cancel":"+ Add webhook"})]}),r&&u.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Webhook URL"}),u.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://hooks.example.com/canonry",value:s,onChange:k=>l(k.target.value)})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Trigger on"}),u.jsx("div",{className:"flex flex-wrap gap-3",children:Zve.map(k=>u.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[u.jsx("input",{type:"checkbox",className:"rounded border-zinc-600 bg-zinc-800",checked:c.includes(k.value),onChange:()=>S(k.value)}),u.jsx("span",{className:"text-sm text-zinc-300",children:k.label})]},k.value))})]}),g&&u.jsx("p",{className:"text-rose-400 text-sm",children:g}),u.jsxs("div",{className:"flex gap-2 justify-end",children:[u.jsx(me,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),v(null)},children:"Cancel"}),u.jsx(me,{type:"button",size:"sm",disabled:h||!s.trim()||c.length===0,onClick:N,children:h?"Adding...":"Add webhook"})]})]}),t==="loading"&&u.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!r&&u.jsx(Be,{className:"surface-card compact-card",children:u.jsx("p",{className:"supporting-copy",children:"No webhooks configured. Add one to get alerted when citations change or runs complete."})}),t!=="loading"&&t.length>0&&u.jsxs("div",{className:"evidence-table-wrap",children:[u.jsxs("table",{className:"evidence-table",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Endpoint"}),u.jsx("th",{children:"Events"}),u.jsx("th",{children:"Status"}),u.jsx("th",{})]})}),u.jsx("tbody",{children:t.map(k=>u.jsxs("tr",{children:[u.jsx("td",{className:"evidence-keyword-cell",children:u.jsx("span",{className:"font-mono text-xs text-zinc-300 break-all",title:k.urlHost,children:k.urlDisplay??k.url})}),u.jsx("td",{children:u.jsx("div",{className:"flex flex-wrap gap-1",children:k.events.map(O=>u.jsx("span",{className:"inline-flex items-center rounded-full border border-zinc-700 bg-zinc-800/60 px-2 py-0.5 text-[10px] font-medium text-zinc-400 uppercase tracking-wide",children:O.replace("."," ")},O))})}),u.jsx("td",{children:u.jsx(mt,{tone:k.enabled?"positive":"neutral",children:k.enabled?"Active":"Paused"})}),u.jsx("td",{children:u.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[y[k.id]&&(()=>{const O=y[k.id],T=O.state==="testing"?"Sending…":O.state==="ok"?`Delivered${O.status?` (${O.status})`:""}`:`Failed${O.status?` (${O.status})`:""}`;return u.jsx(mt,{tone:O.state==="ok"?"positive":O.state==="fail"?"negative":"neutral",children:T})})(),u.jsx(me,{variant:"ghost",size:"sm",type:"button",disabled:y[k.id]?.state==="testing",onClick:()=>E(k.id),children:"Test"}),u.jsx(me,{variant:"ghost",size:"sm",type:"button",onClick:()=>C(k.id),children:"Remove"})]})})]},k.id))})]}),g&&u.jsx("p",{className:"text-rose-400 text-sm mt-2",children:g})]})]})}function Wve({projectName:e,refreshNonce:t}){const[n,r]=x.useState(null),[i,s]=x.useState([]),[l,c]=x.useState(null),[f,h]=x.useState([]),[p,g]=x.useState([]),[v,y]=x.useState(null),[w,S]=x.useState(""),[N,C]=x.useState(""),[E,k]=x.useState(""),[O,T]=x.useState(!0),[P,A]=x.useState(!1),[z,R]=x.useState(null),[q,U]=x.useState("coverage");x.useEffect(()=>{L()},[e,t]);async function L(){T(!0),R(null);try{const B=await XM(e);if(r(B),B.connected){const[D,G,oe,W]=await Promise.all([s1(e).catch(()=>null),JM(e).catch(()=>[]),Z9(e).catch(()=>[]),B.siteUrl?Promise.resolve([]):G9(e).then(X=>X.sites).catch(()=>[])]);c(D),h(G),g(oe),s(W)}else c(null),h([]),g([]),s([])}catch(B){R(B instanceof Error?B.message:"Failed to load Bing data")}finally{T(!1)}}async function ae(){if(N.trim()){R(null);try{const B=await K9(e,N.trim());C(""),B.availableSites.length>0&&s(B.availableSites),await L()}catch(B){R(B instanceof Error?B.message:"Failed to connect")}}}async function pe(){try{await H9(e),r(null),s([]),c(null),h([]),g([]),y(null),k(""),R(null)}catch(B){R(B instanceof Error?B.message:"Failed to disconnect")}}async function ge(){if(E)try{await V9(e,E),await L()}catch(B){R(B instanceof Error?B.message:"Failed to set site")}}async function V(){if(w.trim())try{const B=await eR(e,w.trim());y(B),h(D=>[B,...D])}catch(B){R(B instanceof Error?B.message:"Inspection failed")}}async function re(B){A(!0),R(null);try{const D=await lA(e,{urls:[B]}),{succeeded:G,failed:oe,total:W}=D.summary;Qe({title:"Bing submission requested",detail:oe===0?`${G} URL submitted to Bing.`:`${G}/${W} submitted successfully, ${oe} failed.`,tone:oe===0?"positive":"caution",dedupeKey:`bing:indexing:${e}:${B}`,dedupeMode:"replace"})}catch(D){const G=D instanceof Error?D.message:"Submission failed";R(G),Qe({title:"Bing submission failed",detail:G,tone:"negative",dedupeKey:`bing:indexing:${e}:${B}`,dedupeMode:"replace"})}finally{A(!1)}}async function ve(){A(!0),R(null),Qe({title:"Submitting URLs to Bing",detail:"Requesting indexing for all currently unindexed URLs.",tone:"neutral",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"});try{const B=await lA(e,{allUnindexed:!0}),{succeeded:D,failed:G,total:oe}=B.summary;Qe({title:"Bing submissions requested",detail:G===0?`${D}/${oe} URL${oe!==1?"s":""} submitted to Bing.`:`${D}/${oe} submitted successfully, ${G} failed.`,tone:G===0?"positive":"caution",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}catch(B){const D=B instanceof Error?B.message:"Batch submission failed";R(D),Qe({title:"Bing submissions failed",detail:D,tone:"negative",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}finally{A(!1)}}if(O)return u.jsx(Be,{className:"surface-card",children:u.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!n?.connected)return u.jsxs(Be,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),u.jsx("h3",{children:"Domain authorization"})]}),u.jsx(mt,{tone:"caution",children:"Not connected"})]}),u.jsx("p",{className:"text-sm text-zinc-300",children:"Connect Bing Webmaster Tools to inspect URLs, monitor index coverage, and submit pages for indexing."}),u.jsxs("div",{className:"mt-3",children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),u.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[u.jsx("input",{id:"bing-api-key",type:"password",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Bing Webmaster Tools API key",value:N,onChange:B=>C(B.target.value),onKeyDown:B=>B.key==="Enter"&&ae()}),u.jsx(me,{size:"sm",disabled:!N.trim(),onClick:ae,children:"Connect"})]}),u.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Get your API key from"," ",u.jsx("a",{href:"https://www.bing.com/webmasters/",target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-300 underline underline-offset-2",children:"Bing Webmaster Tools"})]})]}),z&&u.jsx("p",{className:"mt-3 text-xs text-rose-400",children:z})]});if(!n.siteUrl)return u.jsxs(Be,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),u.jsx("h3",{children:"Domain authorization"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(mt,{tone:"positive",children:"Connected"}),u.jsx(me,{size:"sm",variant:"ghost",onClick:pe,children:"Disconnect"})]})]}),u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),u.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),u.jsx("span",{className:"text-xs text-zinc-500",children:n.domain})]}),u.jsx("p",{className:"mt-2 text-xs text-zinc-500",children:"The API key is connected, but no Bing site is selected yet. Pick the verified site that should receive inspections and indexing requests."})]}),u.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Registered domain"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:n.domain})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:n.updatedAt?yi(n.updatedAt):"—"})]})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Select site"}),i.length>0?u.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[u.jsxs("select",{className:"flex-1 rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:E,onChange:B=>k(B.target.value),children:[u.jsx("option",{value:"",children:"Select a site..."}),i.map(B=>u.jsxs("option",{value:B.url,children:[B.url,B.verified?" (verified)":""]},B.url))]}),u.jsx(me,{size:"sm",disabled:!E,onClick:ge,children:"Set Site"})]}):u.jsx("p",{className:"mt-3 text-xs text-zinc-500",children:"No verified Bing sites are available yet. Verify the domain in Bing Webmaster Tools, then use the page-level refresh to reload everything."})]})]}),z&&u.jsx("p",{className:"mt-3 text-xs text-rose-400",children:z})]});const we=[{key:"coverage",label:"Coverage"},{key:"inspections",label:"Inspections"},{key:"performance",label:"Performance"}];return u.jsxs("div",{className:"space-y-3",children:[u.jsxs(Be,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),u.jsx("h3",{children:"Domain authorization"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(mt,{tone:"positive",children:"Connected"}),u.jsx(me,{size:"sm",variant:"ghost",onClick:pe,children:"Disconnect"})]})]}),z&&u.jsx("p",{className:"mb-3 text-xs text-rose-400",children:z}),u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),u.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),u.jsx("span",{className:"text-xs text-zinc-500",children:n.domain})]}),u.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores Bing connections per canonical domain. This project is currently mapped to ",u.jsx("code",{children:n.siteUrl}),"."]})]}),u.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected site"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:n.siteUrl})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:n.updatedAt?yi(n.updatedAt):"—"})]})]})]})]}),u.jsxs(Be,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),u.jsx("h3",{children:"Index monitoring"})]}),u.jsx("p",{className:"text-xs text-zinc-500",children:l?.lastInspectedAt?`Last inspected ${yi(l.lastInspectedAt)}`:"No inspection history yet"})]}),u.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:we.map(B=>u.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${q===B.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>U(B.key),children:B.label},B.key))}),q==="coverage"&&l&&u.jsxs("div",{className:"mt-4 space-y-4",children:[u.jsxs("div",{className:"grid gap-3 sm:grid-cols-4",children:[u.jsx(yp,{label:"Indexed",value:l.summary.indexed,tone:"positive"}),u.jsx(yp,{label:"Not in index",value:l.summary.notIndexed+(l.summary.unknown??0),tone:"negative"}),u.jsx(yp,{label:"Status unknown",value:l.summary.unknown??0,tone:"neutral"}),u.jsx(yp,{label:"Coverage",value:`${l.summary.percentage}%`,tone:"neutral"})]}),l.notIndexed.length>0&&u.jsxs("div",{children:[u.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[u.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Not Indexed (",l.notIndexed.length,")"]}),u.jsx(me,{size:"sm",variant:"ghost",disabled:P,onClick:ve,children:P?"Submitting…":"Submit all to Bing"})]}),u.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:u.jsxs("table",{className:"w-full text-xs",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-zinc-800",children:[u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"HTTP"}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),u.jsx("tbody",{children:l.notIndexed.map(B=>u.jsxs("tr",{className:"border-b border-zinc-800/50",children:[u.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:B.url}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:B.httpCode??"—"}),u.jsx("td",{className:"py-1.5 px-3 text-right",children:u.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:P,onClick:()=>re(B.url),children:"Submit"})})]},B.id))})]})})]}),(l.unknown??[]).length>0&&u.jsxs("div",{children:[u.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[u.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Unknown — not yet confirmed (",(l.unknown??[]).length,")"]}),u.jsx(me,{size:"sm",variant:"ghost",disabled:P,onClick:ve,children:P?"Submitting…":"Submit all to Bing"})]}),u.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:u.jsxs("table",{className:"w-full text-xs",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-zinc-800",children:[u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),u.jsx("tbody",{children:(l.unknown??[]).map(B=>u.jsxs("tr",{className:"border-b border-zinc-800/50",children:[u.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:B.url}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:B.lastCrawledDate?yi(B.lastCrawledDate):"—"}),u.jsx("td",{className:"py-1.5 px-3 text-right",children:u.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:P,onClick:()=>re(B.url),children:"Submit"})})]},B.id))})]})})]}),l.indexed.length>0&&u.jsxs("div",{children:[u.jsxs("h4",{className:"mb-2 text-xs font-medium text-zinc-400",children:["Indexed (",l.indexed.length,")"]}),u.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:u.jsxs("table",{className:"w-full text-xs",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-zinc-800",children:[u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"})]})}),u.jsx("tbody",{children:l.indexed.map(B=>u.jsxs("tr",{className:"border-b border-zinc-800/50",children:[u.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:B.url}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:B.lastCrawledDate?yi(B.lastCrawledDate):"—"})]},B.id))})]})})]})]}),q==="coverage"&&!l&&u.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),q==="inspections"&&u.jsxs("div",{className:"mt-4 space-y-3",children:[u.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[u.jsx("input",{type:"text",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"URL to inspect",value:w,onChange:B=>S(B.target.value),onKeyDown:B=>B.key==="Enter"&&V()}),u.jsx(me,{size:"sm",disabled:!w.trim(),onClick:V,children:"Inspect"})]}),v&&u.jsxs("div",{className:"rounded border border-zinc-800 bg-zinc-900/40 p-3 text-xs space-y-1",children:[u.jsx("div",{className:"font-medium text-zinc-200",children:v.url}),u.jsxs("div",{className:"text-zinc-400",children:["In Index: ",u.jsx("span",{className:v.inIndex?"text-emerald-400":"text-rose-400",children:v.inIndex?"Yes":"No"})," · ","HTTP: ",v.httpCode??"—"," · ","Crawled: ",v.lastCrawledDate??"—"]})]}),f.length>0&&u.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:u.jsxs("table",{className:"w-full text-xs",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-zinc-800",children:[u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Index"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-14",children:"HTTP"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Inspected"})]})}),u.jsx("tbody",{children:f.map(B=>u.jsxs("tr",{className:"border-b border-zinc-800/50",children:[u.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:B.url}),u.jsx("td",{className:"py-1.5 px-3",children:u.jsx(mt,{tone:B.inIndex?"positive":"negative",children:B.inIndex?"Yes":"No"})}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:B.httpCode??"—"}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:yi(B.inspectedAt)})]},B.id))})]})})]}),q==="performance"&&u.jsx("div",{className:"mt-4",children:p.length===0?u.jsx("p",{className:"text-xs text-zinc-500",children:"No Bing performance data available."}):u.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:u.jsxs("table",{className:"w-full text-xs",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-zinc-800",children:[u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"Query"}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:tp[As.Clicks]}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:tp[As.Impressions]}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:tp[As.CTR]}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:tp[As.Position]})]})}),u.jsx("tbody",{children:p.map((B,D)=>u.jsxs("tr",{className:"border-b border-zinc-800/50",children:[u.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:B.query}),u.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-200",children:B.clicks}),u.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:B.impressions}),u.jsxs("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:[(Number.isFinite(B.ctr)?B.ctr*100:0).toFixed(1),"%"]}),u.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:B.averagePosition.toFixed(1)})]},D))})]})})})]})]})}function Qve({projectName:e}){const[t,n]=x.useState("google"),[r,i]=x.useState(!0),[s,l]=x.useState("idle"),[c,f]=x.useState(null),h=x.useRef(null),[p,g]=x.useState(!1),[v,y]=x.useState(null),[w,S]=x.useState(null),[N,C]=x.useState(!1),[E,k]=x.useState(null),[O,T]=x.useState(null),[P,A]=x.useState(0);async function z(D=!1){D||i(!0),f(null);try{const[G,oe,W]=await Promise.all([i1().catch(()=>null),WM(e).catch(()=>[]),XM(e).catch(()=>null)]),X=oe.find(ye=>ye.connectionType==="gsc")??null;g(!!G?.google?.configured),C(!!G?.bing?.configured),y(X),k(W);const[Q,de]=await Promise.all([X?a1(e).catch(()=>null):Promise.resolve(null),W?.connected?s1(e).catch(()=>null):Promise.resolve(null)]);S(Q),T(de)}catch(G){f(G instanceof Error?G.message:"Failed to load search console overview")}finally{i(!1)}}async function R(){if(s!=="idle")return;h.current?.abort();const D=new AbortController;h.current=D;const G=D.signal;l("syncing"),f(null);const oe=[];try{async function W(){if(!v)return;const ye=await QM(e);if(!ye?.id)return;const Z=2e3,Se=Date.now()+12e4;for(;Date.now()<Se;){if(G.aborted||(await new Promise(Ae=>setTimeout(Ae,Z)),G.aborted))return;const F=await Pc(ye.id).catch(()=>null);if(!F)break;if(["completed","failed","cancelled"].includes(F.status)){F.status!=="completed"&&oe.push(`Google sync ${F.status}`);break}}}const X=10;async function Q(){if(!E?.connected)return;const ye=await JM(e).catch(()=>[]),Z=[...new Set(ye.map(le=>le.url))];if(Z.length!==0)for(let le=0;le<Z.length;le+=X){if(G.aborted)return;const Se=Z.slice(le,le+X),Ae=(await Promise.allSettled(Se.map(Oe=>eR(e,Oe)))).filter(Oe=>Oe.status==="rejected").length;Ae>0&&oe.push(`${Ae} Bing inspection(s) failed`)}}const de=await Promise.allSettled([W(),Q()]);for(const ye of de)ye.status==="rejected"&&oe.push(ye.reason instanceof Error?ye.reason.message:"Sync failed");if(G.aborted)return;l("reloading"),await z(!0),A(ye=>ye+1),oe.length>0&&f(`Partial refresh: ${oe.join("; ")}`)}catch(W){G.aborted||f(W instanceof Error?W.message:"Refresh failed")}finally{G.aborted||l("idle")}}x.useEffect(()=>(z(),()=>{h.current?.abort()}),[e]);const q=v?"positive":p?"caution":"negative",U=v?"Connected":p?"Ready to connect":"Needs setup",L=w?`${w.summary.percentage}% indexed`:v?"Awaiting coverage":"No coverage data",ae=w?`${w.summary.notIndexed} not indexed${w.summary.deindexed>0?` · ${w.summary.deindexed} deindexed`:""}`:v?"Run sitemap inspection to populate coverage":p?"Connect Search Console for this domain":"Add Google OAuth credentials in Settings",pe=w?.lastInspectedAt??v?.updatedAt??null,ge=E?.connected?"positive":N?"caution":"negative",V=E?.connected?"Connected":N?"Ready to connect":"Needs setup",re=O?`${O.summary.percentage}% indexed`:E?.connected?"Awaiting coverage":"No coverage data",ve=O?O.summary.notIndexed+(O.summary.unknown??0):0,we=O?`${ve} not in index`:E?.connected?"Inspect URLs to populate coverage":N?"Connect Bing Webmaster Tools for this domain":"Add a Bing API key in Settings",B=O?.lastInspectedAt??E?.updatedAt??null;return u.jsxs("div",{className:"space-y-6",children:[u.jsxs(Be,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search console"}),u.jsx("h2",{children:"Search Engine Intelligence"}),u.jsx("p",{className:"mt-1 max-w-3xl text-sm leading-6 text-zinc-500",children:"Scan both engines at a glance, then open the Google or Bing workspace when you need to inspect coverage or take action."})]}),u.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:r||s!=="idle",onClick:()=>{R()},children:r?"Loading…":s==="syncing"?"Refreshing Google & Bing…":s==="reloading"?"Reloading workspaces…":"Refresh all"})]}),c&&u.jsx("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:c}),u.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[u.jsx(PE,{eyebrow:"Google",title:"Google Search Console",status:r?"Loading…":U,tone:r?"neutral":q,targetLabel:"Selected property",targetValue:v?.propertyId??"No property selected",coverageValue:r?"Loading…":L,note:r?"Loading overview…":ae,updatedAt:pe,active:t==="google",onClick:()=>n("google")}),u.jsx(PE,{eyebrow:"Bing",title:"Bing Webmaster Tools",status:r?"Loading…":V,tone:r?"neutral":ge,targetLabel:"Selected site",targetValue:E?.siteUrl??"No site selected",coverageValue:r?"Loading…":re,note:r?"Loading overview…":we,updatedAt:B,active:t==="bing",onClick:()=>n("bing")})]})]}),u.jsx("div",{className:"flex flex-wrap gap-2",role:"tablist","aria-label":"Search engine workspaces",children:[["google","Google"],["bing","Bing"]].map(([D,G])=>u.jsx("button",{type:"button",role:"tab","aria-selected":t===D,className:`project-subnav-link ${t===D?"project-subnav-link-active":""}`,onClick:()=>n(D),children:G},D))}),t==="google"&&u.jsx(Kve,{projectName:e}),t==="bing"&&u.jsxs("section",{className:"page-section-divider",children:[u.jsx("div",{className:"section-head section-head-inline",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search engine"}),u.jsx("h2",{children:"Bing Webmaster Tools"})]})}),u.jsx(Wve,{projectName:e,refreshNonce:P})]})]})}function Xve({insights:e}){const{openEvidence:t}=Wc(),[n,r]=x.useState(null);return u.jsx("div",{className:"insight-list",children:e.map(i=>{const s=n===i.id,l=i.affectedPhrases.length>0;return u.jsxs("div",{children:[u.jsxs("div",{className:`insight-row insight-row-${i.tone} ${l?"cursor-pointer":""}`,onClick:l?()=>r(s?null:i.id):void 0,children:[u.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l&&u.jsx(_g,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${s?"rotate-90":""}`}),u.jsx(mt,{tone:i.tone,children:i.actionLabel}),u.jsx("span",{className:"text-sm font-medium text-zinc-100 truncate",children:i.title}),u.jsx("span",{className:"hidden sm:inline text-xs text-zinc-500 truncate",children:i.detail})]}),l&&u.jsxs("span",{className:"text-[11px] text-zinc-600 whitespace-nowrap",children:[i.affectedPhrases.length," phrase",i.affectedPhrases.length>1?"s":""]})]}),s&&u.jsx("div",{className:"divide-y divide-zinc-800/20",children:i.affectedPhrases.map((c,f)=>u.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2 pl-9 bg-zinc-900/40",children:[u.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[u.jsx(Fw,{state:c.citationState}),u.jsx("span",{className:"text-sm text-zinc-200 truncate",children:c.keyword}),u.jsx("div",{className:"hidden sm:flex gap-1",children:c.provider&&u.jsx(Id,{provider:c.provider})})]}),c.evidenceId&&u.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 whitespace-nowrap transition-colors",onClick:h=>{h.stopPropagation(),t(c.evidenceId)},children:"View →"})]},c.evidenceId||`${i.id}-${f}`))})]},i.id)})})}function Lv({tab:e}){const{projectId:t}=Ng({from:"/projects/$projectId"}),n=Hs(),{dashboard:r,isLoading:i,refetch:s}=dl();if(!r||i)return u.jsxs("div",{className:"page-skeleton",children:[u.jsxs("div",{className:"page-skeleton-header",children:[u.jsx("div",{className:"skeleton-text h-6 w-48"}),u.jsx("div",{className:"skeleton-text-sm w-32"})]}),u.jsx("div",{className:"grid grid-cols-3 gap-4",children:[1,2,3].map(he=>u.jsxs("div",{className:"page-skeleton-card flex flex-col items-center",children:[u.jsx("div",{className:"skeleton-circle size-20"}),u.jsx("div",{className:"skeleton-text w-16 mt-3"})]},he))}),u.jsxs("div",{className:"page-skeleton-card",children:[u.jsx("div",{className:"skeleton-text w-28"}),u.jsx("div",{className:"space-y-2 mt-2",children:[1,2,3,4].map(he=>u.jsx("div",{className:"skeleton-text-sm w-full"},he))})]})]});const l=lQ(r,t),[c,f]=x.useState(!1),[h,p]=x.useState(!1),[g,v]=x.useState(!1),[y,w]=x.useState(""),[S,N]=x.useState(!1),[C,E]=x.useState(!1),[k,O]=x.useState(""),[T,P]=x.useState(!1),[A,z]=x.useState(!1),[R,q]=x.useState(""),[U,L]=x.useState(!1),[ae,pe]=x.useState(void 0),[ge,V]=x.useState(!1),[re,ve]=x.useState(null),[we,B]=x.useState(!1),D=l?.visibilityEvidence??[],G=l?.project.name??"",oe=l?.project.displayName||l?.project.name||G,W=aU(),X=x.useMemo(()=>new Set(D.map(he=>he.location??"")),[D]),Q=X.has(""),de=x.useMemo(()=>[...X].filter(Boolean),[X]);x.useEffect(()=>{if(ae===void 0||ae===""||!G){ve(null),B(!1);return}B(!0),ZM(G,ae).then(he=>{ve(he),B(!1)}).catch(()=>{ve(null),B(!1)})},[ae,G]);const ye=x.useMemo(()=>{if(!re)return null;const he=new Map;for(const Fe of re){for(const[St,lr]of Object.entries(Fe.providerRuns??{}))he.set(`${Fe.keyword}::${St}`,lr.map(st=>({runId:st.runId,citationState:st.citationState,createdAt:st.createdAt,answerMentioned:st.answerMentioned,visibilityState:st.visibilityState,visibilityTransition:st.visibilityTransition})));(!Fe.providerRuns||Object.keys(Fe.providerRuns).length===0)&&he.set(`${Fe.keyword}::`,Fe.runs.map(St=>({runId:St.runId,citationState:St.citationState,createdAt:St.createdAt,answerMentioned:St.answerMentioned,visibilityState:St.visibilityState,visibilityTransition:St.visibilityTransition})))}return he},[re]),Z=x.useMemo(()=>{const he=ae!==void 0?D.filter(Fe=>ae===""?!Fe.location:Fe.location===ae):D;return ye?he.map(Fe=>{const St=ye.get(`${Fe.keyword}::${Fe.provider}`)??ye.get(`${Fe.keyword}::`);return St?{...Fe,runHistory:St}:Fe}):he},[D,ae,ye]);if(!l)return u.jsx("div",{className:"page-container",children:u.jsxs(Be,{className:"surface-card empty-card",children:[u.jsx("h1",{children:"Project not found"}),u.jsxs("p",{children:['Could not find a project with ID "',t,'".']}),u.jsx(me,{asChild:!0,children:u.jsx(Rt,{to:"/",children:"Return to overview"})})]})});async function le(){try{await W.mutateAsync({projectName:G,projectLabel:oe,sourceAction:"project-run"}),s()}catch{}}async function Se(){p(!0);try{await p9(G),Qe({title:"Project deleted",detail:`${oe} was removed.`,tone:"positive",dedupeKey:`project:delete:${G}`,dedupeMode:"drop"}),n({to:"/"}),s()}catch(he){console.error("Failed to delete project:",he)}finally{p(!1)}}async function F(){try{const he=await m9(G),Fe=typeof he=="string"?he:JSON.stringify(he,null,2),St=new Blob([Fe],{type:"text/yaml"}),lr=URL.createObjectURL(St),st=document.createElement("a");st.href=lr,st.download=`${G}.yaml`,st.click()}catch(he){Qe({title:"Export failed",detail:he instanceof Error?he.message:"Could not export project YAML.",tone:"negative"})}}async function Ae(){const he=y.split(`
272
- `).map(Fe=>Fe.trim()).filter(Boolean);if(he.length!==0){N(!0);try{await l9(G,he),s(),w(""),v(!1)}finally{N(!1)}}}async function Oe(){const he=k.trim();if(he){P(!0);try{const St=(await VM(G)).map(st=>st.domain),lr=[...new Set([...St,he])];await YM(G,lr),s(),O(""),E(!1)}finally{P(!1)}}}async function nt(){const he=R.trim();if(he){L(!0);try{const Fe=l?.project.ownedDomains??[];await iA(G,[...Fe,he]),s(),q(""),z(!1)}finally{L(!1)}}}async function Ve(he){L(!0);try{const Fe=l?.project.ownedDomains??[];await iA(G,Fe.filter(St=>St!==he)),s()}finally{L(!1)}}async function sn(he,Fe){await c9(he,Fe),s()}const pn=he=>!Number.isNaN(Number.parseInt(he,10)),Gt=[{key:"overview",label:"Overview",href:`/projects/${l.project.id}`},{key:"search-console",label:"Search Engine Intelligence",href:`/projects/${l.project.id}/search-console`},{key:"traffic",label:"Traffic",href:`/projects/${l.project.id}/traffic`},{key:"analytics",label:"Visibility",href:`/projects/${l.project.id}/analytics`}];return u.jsxs("div",{className:"page-container",children:[c?u.jsxs(Be,{className:"surface-card p-6 mb-6 border-rose-800/60",children:[u.jsx("h3",{className:"text-base font-semibold text-rose-400 mb-2",children:"Delete project?"}),u.jsxs("p",{className:"text-sm text-zinc-400 mb-4",children:["This will permanently delete ",u.jsx("strong",{className:"text-zinc-200",children:l.project.displayName||l.project.name})," and all its key phrases, competitors, runs, and snapshots. This cannot be undone."]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(me,{type:"button",variant:"destructive",disabled:h,onClick:Se,children:h?"Deleting...":"Yes, delete project"}),u.jsx(me,{type:"button",variant:"outline",disabled:h,onClick:()=>f(!1),children:"Cancel"})]})]}):null,u.jsxs("div",{className:"page-header",children:[u.jsxs("div",{className:"page-header-left",children:[u.jsx("h1",{className:"page-title",children:l.project.displayName||l.project.name}),u.jsxs("p",{className:"page-subtitle",children:[l.project.canonicalDomain,(l.project.ownedDomains??[]).length===0&&!A&&u.jsx("button",{type:"button",className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-600 hover:text-zinc-400 transition-colors",onClick:()=>z(!0),children:"+ add domain"})," "," · ",l.contextLabel]}),u.jsxs("div",{className:"tag-row",children:[u.jsx("span",{className:"tag",children:l.project.country}),u.jsx("span",{className:"tag",children:l.project.language.toUpperCase()}),l.project.tags.map(he=>u.jsx("span",{className:"tag",children:he},he))]}),((l.project.ownedDomains??[]).length>0||A)&&u.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[u.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mr-1",children:"Also tracking"}),(l.project.ownedDomains??[]).map(he=>u.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:[he,u.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:U,onClick:()=>Ve(he),"aria-label":`Remove ${he}`,children:"×"})]},he)),A?u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-1.5 py-0.5 text-xs text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none w-40",type:"text",placeholder:"docs.example.com",value:R,onChange:he=>q(he.target.value),onKeyDown:he=>he.key==="Enter"&&nt(),autoFocus:!0}),u.jsx(me,{type:"button",size:"sm",disabled:!R.trim()||U,onClick:nt,children:U?"...":"Add"}),u.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{z(!1),q("")},children:"Cancel"})]}):u.jsx("button",{type:"button",className:"rounded-full border border-dashed border-zinc-700 px-2 py-0.5 text-[10px] uppercase tracking-wide text-zinc-500 hover:text-zinc-300 hover:border-zinc-500 transition-colors",onClick:()=>z(!0),children:"+ domain"})]})]}),u.jsxs("div",{className:"page-header-right",children:[u.jsx("p",{className:"text-sm text-zinc-500",children:l.dateRangeLabel}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(me,{type:"button",variant:"outline",size:"icon",onClick:F,"aria-label":"Export project as YAML",children:u.jsx(vF,{className:"h-4 w-4 text-zinc-400"})}),u.jsx(me,{type:"button",variant:"outline",size:"icon",onClick:()=>f(!0),"aria-label":"Delete project",children:u.jsx(IF,{className:"h-4 w-4 text-zinc-400"})}),u.jsx(me,{type:"button",disabled:W.isPending,onClick:le,children:W.isPending?"Starting...":"Run now"})]})]})]}),u.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:Gt.map(he=>u.jsx(Rt,{to:he.href,className:`project-subnav-link ${he.key===e?"project-subnav-link-active":""}`,"aria-current":he.key===e?"page":void 0,children:he.label},he.key))}),e==="overview"?u.jsxs(u.Fragment,{children:[u.jsxs("section",{className:"gauge-row",children:[u.jsx(qI,{value:l.visibilitySummary.value,label:l.visibilitySummary.label,delta:l.visibilitySummary.delta,tone:l.visibilitySummary.tone,description:l.visibilitySummary.description,tooltip:l.visibilitySummary.tooltip,isNumeric:pn(l.visibilitySummary.value),progress:l.visibilitySummary.progress,providerCoverage:l.visibilitySummary.providerCoverage}),u.jsxs("div",{className:"metric-card",children:[u.jsxs("p",{className:"metric-card-eyebrow",children:["Gap Key Phrases",u.jsx(Vn,{text:"Tracked key phrases where competitors are cited in the latest completed visibility run but your domain is not."})]}),u.jsxs("p",{className:"metric-card-big-value",children:[u.jsx("span",{className:"text-zinc-50",children:l.gapKeyPhrases.value}),u.jsxs("span",{className:"text-zinc-600",children:[" / ",l.keywordCounts.total]})]}),u.jsx("div",{className:"metric-card-bar",children:u.jsx("div",{className:`metric-card-bar-fill progress-fill-${l.gapKeyPhrases.tone}`,style:{width:l.gapKeyPhrases.progress!==void 0?`${l.gapKeyPhrases.progress*100}%`:"0%"}})}),u.jsx("p",{className:"metric-card-detail",children:l.gapKeyPhrases.delta}),u.jsx("p",{className:"metric-card-sub",children:l.gapKeyPhrases.description})]}),u.jsxs("div",{className:"metric-card",children:[u.jsxs("p",{className:"metric-card-eyebrow",children:["Index Coverage",u.jsx(Vn,{text:"Percentage of inspected URLs that are currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used."})]}),u.jsxs("p",{className:"metric-card-big-value",children:[u.jsx("span",{className:"text-zinc-50",children:l.indexCoverage.value}),u.jsx("span",{className:"text-zinc-600",children:"%"})]}),u.jsx("div",{className:"metric-card-bar",children:u.jsx("div",{className:`metric-card-bar-fill progress-fill-${l.indexCoverage.tone}`,style:{width:`${Number.parseInt(l.indexCoverage.value,10)||0}%`}})}),u.jsx("p",{className:"metric-card-detail",children:l.indexCoverage.delta}),u.jsx("p",{className:"metric-card-sub",children:l.indexCoverage.description})]}),u.jsxs("div",{className:"metric-card",children:[u.jsxs("p",{className:"metric-card-eyebrow",children:["Since Last Run",u.jsx(Vn,{text:"Keyword-level citation changes compared to the previous completed run."})]}),l.movementSummary.hasPreviousRun?u.jsxs("div",{className:"metric-card-movement",children:[u.jsxs("span",{className:l.movementSummary.gained>0?"text-emerald-400":"text-zinc-500",children:["+",l.movementSummary.gained," gained"]}),u.jsx("span",{className:"text-zinc-600 mx-1.5",children:"·"}),u.jsxs("span",{className:l.movementSummary.lost>0?"text-rose-400":"text-zinc-500",children:["−",l.movementSummary.lost," lost"]})]}):u.jsx("p",{className:"metric-card-movement text-zinc-500",children:"First run — no comparison yet"}),u.jsx("p",{className:"metric-card-sub mt-auto",children:l.movementSummary.gained===0&&l.movementSummary.lost===0&&l.movementSummary.hasPreviousRun?"No changes since last run":l.movementSummary.gained>l.movementSummary.lost?"Visibility improving":l.movementSummary.lost>l.movementSummary.gained?"Visibility declining":""})]})]}),l.providerScores.length>1&&u.jsxs("section",{className:"page-section-divider",children:[u.jsx("div",{className:"section-head section-head-inline",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Model breakdown"}),u.jsxs("h2",{children:["Visibility by model ",u.jsx(Vn,{text:"Per-model citation rate. Shows how often each AI model cites your domain across all tracked key phrases. Switching models can significantly affect citation rates."})]})]})}),u.jsx("div",{className:"evidence-table-wrap",children:u.jsxs("table",{className:"evidence-table",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Model"}),u.jsx("th",{children:"Score"}),u.jsx("th",{children:"Cited key phrases"})]})}),u.jsx("tbody",{children:l.providerScores.map(he=>u.jsxs("tr",{children:[u.jsx("td",{children:u.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[u.jsx(Id,{provider:he.provider}),he.model&&u.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:he.model})]})}),u.jsx("td",{children:u.jsxs("span",{className:`font-semibold ${he.score>=70?"text-emerald-400":he.score>=40?"text-amber-400":"text-rose-400"}`,children:[he.score,"%"]})}),u.jsxs("td",{className:"text-zinc-500",children:[he.cited," of ",he.total]})]},`${he.provider}::${he.model??"unknown"}`))})]})})]}),u.jsxs("section",{className:"page-section-divider",children:[u.jsx("div",{className:"section-head section-head-inline",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"What changed"}),u.jsx("h2",{children:"Citation signals"})]})}),u.jsx(Xve,{insights:l.insights})]}),u.jsxs("section",{className:"page-section-divider",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Visibility evidence"}),u.jsx("h2",{children:"Key phrase citation tracking"})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("p",{className:"supporting-copy",children:[new Set(l.visibilityEvidence.map(he=>he.keyword)).size," key phrases tracked"]}),u.jsx(me,{type:"button",variant:"outline",size:"sm",onClick:()=>v(!g),children:g?"Cancel":"+ Add key phrases"})]})]}),g&&u.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[u.jsx("textarea",{className:"w-full resize-none rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",rows:3,placeholder:"Enter key phrases, one per line",value:y,onChange:he=>w(he.target.value)}),u.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[u.jsxs("p",{className:"text-xs text-zinc-500",children:[y.split(`
273
- `).filter(he=>he.trim()).length," key phrases"]}),u.jsx(me,{type:"button",size:"sm",disabled:!y.trim()||S,onClick:Ae,children:S?"Adding...":"Add key phrases"})]})]}),l.project.locations&&l.project.locations.length>0&&u.jsxs("div",{className:"filter-row mb-3",role:"toolbar","aria-label":"Location filters",children:[u.jsx("button",{className:`filter-chip ${ae===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":ae===void 0,onClick:()=>{pe(void 0)},children:"All locations"}),l.project.locations.map(he=>X.has(he.label)&&u.jsx("button",{className:`filter-chip ${ae===he.label?"filter-chip-active":""}`,type:"button","aria-pressed":ae===he.label,onClick:()=>{pe(he.label),V(!1)},children:he.label},he.label)),Q&&u.jsx("button",{className:`filter-chip ${ae===""?"filter-chip-active":""}`,type:"button","aria-pressed":ae==="",onClick:()=>{pe(""),V(!1)},children:"No location"}),de.length>1&&ae===void 0&&u.jsx("button",{className:`filter-chip filter-chip-compare ${ge?"filter-chip-active":""}`,type:"button","aria-pressed":ge,onClick:()=>V(he=>!he),title:"Side-by-side location comparison",children:"Compare"})]}),u.jsx(SJ,{evidence:Z})]}),u.jsxs("section",{className:"page-section-divider",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Competitors"}),u.jsx("h2",{children:"Competitive landscape"})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("p",{className:"supporting-copy",children:[l.competitors.length," tracked"]}),u.jsx(me,{type:"button",variant:"outline",size:"sm",onClick:()=>E(!C),children:C?"Cancel":"+ Add competitor"})]})]}),C&&u.jsxs("div",{className:"mb-3 flex gap-2 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[u.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"competitor.com",value:k,onChange:he=>O(he.target.value),onKeyDown:he=>he.key==="Enter"&&Oe()}),u.jsx(me,{type:"button",size:"sm",disabled:!k.trim()||T,onClick:Oe,children:T?"Adding...":"Add"})]}),u.jsx(jJ,{competitors:l.competitors})]}),u.jsxs("section",{className:"page-section-divider",children:[u.jsx("div",{className:"section-head section-head-inline",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Run timeline"}),u.jsx("h2",{children:"Recent execution history"})]})}),u.jsx("div",{className:"run-list",children:l.recentRuns.map(he=>u.jsx(BI,{run:he},he.id))})]}),u.jsx(Hve,{project:{...l.project,displayName:l.project.displayName??l.project.name,defaultLocation:l.project.defaultLocation??null},onUpdateProject:sn,onRefresh:()=>{s()}}),u.jsx(Vve,{projectName:l.project.name}),u.jsx(Yve,{projectName:l.project.name})]}):e==="analytics"?u.jsx(Ove,{projectName:l.project.name}):e==="traffic"?u.jsx(Tve,{projectName:l.project.name}):u.jsx(Qve,{projectName:l.project.name})]})}function Jve(){const{dashboard:e,isLoading:t}=dl(),n=Uve();if(!e||t)return u.jsxs("div",{className:"page-skeleton",children:[u.jsxs("div",{className:"page-skeleton-header",children:[u.jsx("div",{className:"skeleton-text h-6 w-20"}),u.jsx("div",{className:"skeleton-text-sm w-72"})]}),u.jsx("div",{className:"space-y-2",children:[1,2,3,4].map(f=>u.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3 flex items-center gap-3",children:[u.jsxs("div",{className:"flex-1 space-y-1.5",children:[u.jsx("div",{className:"skeleton-text w-40"}),u.jsx("div",{className:"skeleton-text-sm w-56"})]}),u.jsx("div",{className:"skeleton h-5 w-16 rounded-full"})]},f))})]});const r=e.runs,[i,s]=x.useState("all"),l=i==="all"?r:r.filter(f=>f.status===i),c=async()=>{try{await n.mutateAsync(void 0)}catch{}};return u.jsxs("div",{className:"page-container",children:[u.jsxs("div",{className:"page-header",children:[u.jsxs("div",{className:"page-header-left",children:[u.jsx("h1",{className:"page-title",children:"Runs"}),u.jsx("p",{className:"page-subtitle",children:"Status, type, project, duration, and the shortest explanation that makes the outcome trustworthy."})]}),u.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:n.isPending,onClick:()=>{c()},children:n.isPending?"Queueing…":"Run all projects"})]}),u.jsxs("section",{children:[u.jsx("div",{className:"filter-row",role:"toolbar","aria-label":"Run filters",children:["all","queued","running","completed","partial","failed","cancelled"].map(f=>u.jsx("button",{className:`filter-chip ${i===f?"filter-chip-active":""}`,type:"button","aria-pressed":i===f,onClick:()=>s(f),children:f==="all"?"All runs":Ag(f)},f))}),u.jsx("div",{className:"run-list",children:l.length>0?l.map(f=>u.jsx(BI,{run:f},f.id)):u.jsxs(Be,{className:"surface-card empty-card",children:[u.jsx("h2",{children:"No runs match this filter"}),u.jsx("p",{children:"Try another status filter or queue a new run from a project command center."})]})})]})]})}function eye({providerName:e,keyUrl:t,modelHint:n,onSaved:r}){const i=e.toLowerCase()==="local",[s,l]=x.useState(""),[c,f]=x.useState(""),[h,p]=x.useState(""),[g,v]=x.useState(""),[y,w]=x.useState(""),[S,N]=x.useState(""),[C,E]=x.useState(!1),[k,O]=x.useState(null),[T,P]=x.useState(!1),A=i?c.trim().length>0:s.trim().length>0;async function z(){if(A){E(!0),O(null),P(!1);try{const q=ge=>{const V=parseInt(ge.trim(),10);return Number.isFinite(V)&&V>0?V:void 0},U={},L=q(g);L!==void 0&&(U.maxConcurrency=L);const ae=q(y);ae!==void 0&&(U.maxRequestsPerMinute=ae);const pe=q(S);pe!==void 0&&(U.maxRequestsPerDay=pe),await b9(e.toLowerCase(),{...s.trim()?{apiKey:s.trim()}:{},...c.trim()?{baseUrl:c.trim()}:{},...h.trim()?{model:h.trim()}:{},...Object.keys(U).length>0?{quota:U}:{}}),l(""),f(""),p(""),v(""),w(""),N(""),P(!0),Qe({title:"Provider updated",detail:`${e} configuration saved.`,tone:"positive",dedupeKey:`settings:provider:${e}`,dedupeMode:"replace"}),r()}catch(q){O(q instanceof Error?q.message:"Failed to update provider")}finally{E(!1)}}}const R=n??"Use default model";return u.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[i&&u.jsxs("div",{children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`base-url-${e}`,children:"Base URL"}),u.jsx("input",{id:`base-url-${e}`,type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"http://localhost:11434/v1",value:c,onChange:q=>f(q.target.value)}),u.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Any OpenAI-compatible endpoint — Ollama, LM Studio, llama.cpp, vLLM"})]}),u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("label",{className:"text-xs text-zinc-500",htmlFor:`api-key-${e}`,children:["API Key",i?" (optional)":""]}),t&&u.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:["Get API key ","↗"]})]}),u.jsx("input",{id:`api-key-${e}`,type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:i?"Optional — most local servers don't need one":`Enter ${e} API key`,value:s,onChange:q=>l(q.target.value)})]}),u.jsxs("div",{children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`model-${e}`,children:"Model (optional)"}),u.jsx("input",{id:`model-${e}`,type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:R,value:h,onChange:q=>p(q.target.value)})]}),u.jsxs("div",{children:[u.jsx("label",{className:"text-xs text-zinc-500",children:"Quota (optional)"}),u.jsxs("div",{className:"mt-0.5 grid grid-cols-3 gap-1.5",children:[u.jsxs("div",{children:[u.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Concurrent",value:g,onChange:q=>v(q.target.value)}),u.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Max concurrent"})]}),u.jsxs("div",{children:[u.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"/min",value:y,onChange:q=>w(q.target.value)}),u.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per minute"})]}),u.jsxs("div",{children:[u.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"/day",value:S,onChange:q=>N(q.target.value)}),u.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),k&&u.jsx("p",{className:"text-xs text-rose-400",children:k}),T&&u.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),u.jsx(me,{type:"button",size:"sm",disabled:!A||C,onClick:z,children:C?"Saving...":"Save"})]})}function tye({onSaved:e}){const[t,n]=x.useState(""),[r,i]=x.useState(""),[s,l]=x.useState(!1),[c,f]=x.useState(null),[h,p]=x.useState(!1),g=t.trim().length>0&&r.trim().length>0;async function v(){if(g){l(!0),f(null),p(!1);try{await x9({clientId:t.trim(),clientSecret:r.trim()}),n(""),i(""),p(!0),Qe({title:"Google OAuth app updated",detail:"Dashboard Google credentials were saved.",tone:"positive",dedupeKey:"settings:google-oauth",dedupeMode:"replace"}),e()}catch(y){f(y instanceof Error?y.message:"Failed to update Google OAuth credentials")}finally{l(!1)}}}return u.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-id",children:"Client ID"}),u.jsxs("a",{href:"https://console.cloud.google.com/apis/credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:["Google Cloud ","↗"]})]}),u.jsx("input",{id:"google-client-id",type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Google OAuth client ID",value:t,onChange:y=>n(y.target.value)})]}),u.jsxs("div",{children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-secret",children:"Client secret"}),u.jsx("input",{id:"google-client-secret",type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Google OAuth client secret",value:r,onChange:y=>i(y.target.value)})]}),u.jsxs("p",{className:"text-[11px] text-zinc-500",children:["These credentials are stored in ",u.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Search Console connections are created separately per canonical domain."]}),c&&u.jsx("p",{className:"text-xs text-rose-400",children:c}),h&&u.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),u.jsx(me,{type:"button",size:"sm",disabled:!g||s,onClick:v,children:s?"Saving...":"Save Google OAuth app"})]})}function nye(){const[e,t]=x.useState(null),[n,r]=x.useState(null),[i,s]=x.useState(!1),[l,c]=x.useState("localhost"),[f,h]=x.useState("9222"),[p,g]=x.useState(!1);return x.useEffect(()=>{sA().then(t).catch(v=>{const y=v instanceof Error?v.message:String(v);y.includes("501")||r(y)})},[]),u.jsxs(Be,{className:"surface-card",children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Browser provider"}),u.jsx("h2",{children:"ChatGPT (CDP)"})]}),u.jsx(mt,{tone:e?.connected?"positive":"caution",children:e?.connected?"Connected":"Not connected"})]}),u.jsxs("dl",{className:"definition-list mt-3",children:[e?.endpoint&&u.jsxs("div",{children:[u.jsx("dt",{children:"Endpoint"}),u.jsx("dd",{className:"font-mono text-xs",children:e.endpoint})]}),e?.browserVersion&&u.jsxs("div",{children:[u.jsx("dt",{children:"Browser"}),u.jsx("dd",{className:"text-xs",children:e.browserVersion})]}),e?.targets&&e.targets.length>0&&u.jsxs("div",{children:[u.jsx("dt",{children:"Tabs"}),u.jsx("dd",{children:e.targets.map(v=>u.jsxs("span",{className:"mr-2",children:[v.name,": ",v.alive?"● alive":"○ idle"]},v.name))})]})]}),u.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:e?.connected?"Connected to Chrome via CDP. Launch Chrome with --remote-debugging-port to use this provider.":n||"Not configured. Set an endpoint below or run: canonry cdp connect --host localhost --port 9222"}),u.jsx("div",{className:"mt-2",children:u.jsx(me,{type:"button",variant:"outline",size:"sm",onClick:()=>s(!i),children:i?"Cancel":e?.connected?"Update endpoint":"Configure"})}),i&&u.jsxs("form",{className:"mt-3 flex flex-col gap-2",onSubmit:async v=>{v.preventDefault(),g(!0);try{await F9(l,parseInt(f,10)||9222);const y=await sA().catch(()=>null);y&&t(y),s(!1),Qe({title:"CDP endpoint saved",detail:`${l}:${parseInt(f,10)||9222} is now configured.`,tone:"positive",dedupeKey:"settings:cdp",dedupeMode:"replace"})}catch(y){r(y instanceof Error?y.message:String(y))}finally{g(!1)}},children:[u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-zinc-900 px-2 py-1 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500",placeholder:"localhost",value:l,onChange:v=>c(v.target.value),"aria-label":"CDP host"}),u.jsx("input",{className:"w-24 rounded border border-zinc-700 bg-zinc-900 px-2 py-1 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500",placeholder:"9222",value:f,onChange:v=>h(v.target.value),"aria-label":"CDP port"})]}),u.jsx("div",{children:u.jsx(me,{type:"submit",size:"sm",disabled:p,children:p?"Saving…":"Save endpoint"})})]})]})}const rye={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function iye(){const e=cf(),{dashboard:t}=dl(),n=t?.settings??e?.dashboard?.settings,s=Ug(!e,e?.health).data??e?.health??rye,[l,c]=x.useState(null),[f,h]=x.useState(!1),[p,g]=x.useState(!1),[v,y]=x.useState(""),[w,S]=x.useState(!1),[N,C]=x.useState(null),[E,k]=x.useState(!1);return n?u.jsxs("div",{className:"page-container",children:[u.jsx("div",{className:"page-header",children:u.jsxs("div",{className:"page-header-left",children:[u.jsx("h1",{className:"page-title",children:"Settings"}),u.jsx("p",{className:"page-subtitle",children:"Provider state, Google OAuth, Bing WMT setup, and service health."})]})}),u.jsxs("section",{className:"settings-grid",children:[n.providerStatuses.map(O=>u.jsxs(Be,{className:"surface-card",children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Provider"}),u.jsx("h2",{children:O.displayName??O.name})]}),u.jsx(mt,{tone:O.state==="ready"?"positive":"caution",children:O.state==="ready"?"Ready":"Needs config"})]}),u.jsxs("dl",{className:"definition-list mt-3",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Model"}),u.jsx("dd",{className:"font-mono text-xs",children:O.model})]}),O.quota&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Concurrency"}),u.jsx("dd",{children:O.quota.maxConcurrency})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Rate limit"}),u.jsxs("dd",{children:[O.quota.maxRequestsPerMinute,"/min · ",O.quota.maxRequestsPerDay,"/day"]})]})]})]}),u.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:O.detail}),u.jsx("div",{className:"mt-2",children:u.jsx(me,{type:"button",variant:"outline",size:"sm",onClick:()=>c(l===O.name?null:O.name),children:l===O.name?"Cancel":O.state==="ready"?O.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),l===O.name&&u.jsx(eye,{providerName:O.name,keyUrl:O.keyUrl,modelHint:O.modelHint,onSaved:()=>{c(null)}})]},O.name)),u.jsxs(Be,{className:"surface-card",children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Google"}),u.jsx("h2",{children:"Search Console OAuth"})]}),u.jsx(mt,{tone:n.google.state==="ready"?"positive":"caution",children:n.google.state==="ready"?"Ready":"Needs config"})]}),u.jsxs("dl",{className:"definition-list mt-3",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Auth model"}),u.jsx("dd",{children:"One app credential set, then one OAuth connection per project domain"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Storage"}),u.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),u.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:n.google.detail}),u.jsx("div",{className:"mt-2",children:u.jsx(me,{type:"button",variant:"outline",size:"sm",onClick:()=>h(!f),children:f?"Cancel":n.google.state==="ready"?"Update OAuth app":"Configure Google OAuth"})}),f&&u.jsx(tye,{onSaved:()=>{h(!1)}})]}),u.jsxs(Be,{className:"surface-card",children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Bing"}),u.jsx("h2",{children:"Webmaster Tools"})]}),u.jsx(mt,{tone:n.bing.state==="ready"?"positive":"caution",children:n.bing.state==="ready"?"Ready":"Needs config"})]}),u.jsxs("dl",{className:"definition-list mt-3",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Auth model"}),u.jsx("dd",{children:"API key authentication — no OAuth needed"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Storage"}),u.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),u.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:n.bing.detail}),u.jsx("div",{className:"mt-2",children:u.jsx(me,{type:"button",variant:"outline",size:"sm",onClick:()=>g(!p),children:p?"Cancel":n.bing.state==="ready"?"Update API key":"Configure Bing"})}),p&&u.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),u.jsx("a",{href:"https://www.bing.com/webmasters/",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:"Bing Webmaster Tools"})]}),u.jsx("input",{id:"bing-api-key",type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Bing Webmaster Tools API key",value:v,onChange:O=>y(O.target.value)})]}),u.jsxs("p",{className:"text-[11px] text-zinc-500",children:["This key is stored in ",u.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Bing connections are created separately per canonical domain."]}),N&&u.jsx("p",{className:"text-xs text-rose-400",children:N}),E&&u.jsx("p",{className:"text-xs text-emerald-400",children:"Bing API key updated."}),u.jsx(me,{type:"button",size:"sm",disabled:!v.trim()||w,onClick:async()=>{if(v.trim()){S(!0),C(null),k(!1);try{await Y9(v.trim()),y(""),k(!0),g(!1),Qe({title:"Bing API key updated",detail:"Dashboard Bing credentials were saved.",tone:"positive",dedupeKey:"settings:bing",dedupeMode:"replace"})}catch(O){C(O instanceof Error?O.message:"Failed to update Bing API key")}finally{S(!1)}}},children:w?"Saving...":"Save Bing API key"})]})]}),u.jsx(nye,{}),u.jsxs(Be,{className:"surface-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Service health"}),u.jsx("h2",{children:"API and worker"})]})}),u.jsxs("div",{className:"compact-stack",children:[u.jsxs("div",{className:"health-row",children:[u.jsxs("div",{children:[u.jsx("p",{className:"run-row-title",children:"API"}),u.jsx("p",{className:"supporting-copy",children:s.apiStatus.detail})]}),u.jsx(mt,{tone:hm(s.apiStatus),children:s.apiStatus.state==="ok"?"Healthy":"Attention"})]}),u.jsxs("div",{className:"health-row",children:[u.jsxs("div",{children:[u.jsx("p",{className:"run-row-title",children:"Worker"}),u.jsx("p",{className:"supporting-copy",children:s.workerStatus.detail})]}),u.jsx(mt,{tone:hm(s.workerStatus),children:s.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),u.jsx("section",{className:"page-section",children:u.jsxs(Be,{className:"surface-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Self-host notes"}),u.jsx("h2",{children:"Operational guidance"})]})}),u.jsx("ul",{className:"detail-list",children:n.selfHostNotes.map(O=>u.jsx("li",{children:O},O))}),u.jsx("p",{className:"supporting-copy",children:n.bootstrapNote})]})})]}):null}const aye=[{label:"System check",description:"Verify your instance is ready"},{label:"Create project",description:"Name, domain, and locale"},{label:"Key phrases",description:"Add key phrases to track"},{label:"Competitors",description:"Add competitor domains"},{label:"Launch",description:"Start your first visibility sweep"}];function sye({current:e,labels:t}){return u.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:t.map((n,r)=>{const i=r<e,s=r===e;return u.jsxs("div",{className:`setup-step ${i?"setup-step-done":""} ${s?"setup-step-active":""}`,role:"listitem","aria-current":s?"step":void 0,children:[u.jsx("span",{className:"setup-step-number",children:i?"✓":r+1}),u.jsx("span",{className:"setup-step-label",children:n.label})]},n.label)})})}function oye(){const e=cf(),{dashboard:t,isLoading:n,refetch:r}=dl(),i=t??e?.dashboard;if(!i||n)return u.jsxs("div",{className:"page-skeleton",children:[u.jsxs("div",{className:"page-skeleton-header",children:[u.jsx("div",{className:"skeleton-text h-6 w-24"}),u.jsx("div",{className:"skeleton-text-sm w-80"})]}),u.jsxs("div",{className:"page-skeleton-card",children:[u.jsx("div",{className:"skeleton-text w-32"}),u.jsx("div",{className:"space-y-3 mt-3",children:[1,2,3].map(be=>u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"space-y-1 flex-1",children:[u.jsx("div",{className:"skeleton-text w-24"}),u.jsx("div",{className:"skeleton-text-sm w-48"})]}),u.jsx("div",{className:"skeleton h-6 w-16 rounded-full"})]},be))})]})]});const s=i.settings,f=Ug(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},h=sX(i.setup,f,s),p=Hs(),[g,v]=x.useState(0),[y,w]=x.useState(""),[S,N]=x.useState(""),[C,E]=x.useState(""),[k,O]=x.useState("US"),[T,P]=x.useState("en"),[A,z]=x.useState(null),[R,q]=x.useState(null),[U,L]=x.useState(null),[ae,pe]=x.useState(!1),[ge,V]=x.useState(""),[re,ve]=x.useState(!1),[we,B]=x.useState(null),[D,G]=x.useState(!1),oe=s.providerStatuses.filter(be=>be.state==="ready"),[W,X]=x.useState(oe[0]?.name??""),[Q,de]=x.useState(5),[ye,Z]=x.useState(!1),[le,Se]=x.useState(null),[F,Ae]=x.useState(""),[Oe,nt]=x.useState(!1),[Ve,sn]=x.useState(null),[pn,Gt]=x.useState(!1),[he,Fe]=x.useState(!1),[St,lr]=x.useState(!1),st=aU(),Xe=y.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),at=ge.split(`
274
- `).map(be=>be.trim()).filter(Boolean),Pt=F.split(`
275
- `).map(be=>be.trim()).filter(Boolean),cr=h.healthChecks.some(be=>be.id==="api"&&be.state==="ready"),qa=async()=>{if(!(!Xe||!C)){pe(!0),L(null);try{const be=await Og(Xe,{displayName:S||y,canonicalDomain:C,country:k,language:T});z(Xe),q(be.id),Qe({title:"Project created",detail:`${be.displayName||be.name} is ready for setup.`,tone:"positive",dedupeKey:`project:create:${be.name}`,dedupeMode:"drop"}),r(),v(2)}catch(be){L(be instanceof Error?be.message:"Failed to create project")}finally{pe(!1)}}},Qs=async()=>{if(!A)return;const be=at;if(be.length!==0){G(!0),B(null);try{await o9(A,be),ve(!0),r(),v(3)}catch(Wn){B(Wn instanceof Error?Wn.message:"Failed to save key phrases")}finally{G(!1)}}},ut=async()=>{if(!(!A||!W)){Z(!0),Se(null);try{const be=await _9(A,W,Q);if(be.keywords.length>0){const Wn=ge?ge.trimEnd()+`
276
- `+be.keywords.join(`
277
- `):be.keywords.join(`
278
- `);V(Wn)}}catch(be){Se(be instanceof Error?be.message:"Failed to generate key phrases")}finally{Z(!1)}}},gl=async()=>{if(!A)return;const be=Pt;if(be.length!==0){Gt(!0),sn(null);try{await YM(A,be),nt(!0),r(),v(4)}catch(Wn){sn(Wn instanceof Error?Wn.message:"Failed to save competitors")}finally{Gt(!1)}}},An=async()=>{if(A){lr(!0);try{await st.mutateAsync({projectName:A,projectLabel:S||y||A,sourceAction:"setup-launch"}),Fe(!0),r()}catch{}finally{lr(!1)}}},$e=()=>v(be=>Math.max(0,be-1)),Rr=(()=>{switch(g){case 0:return u.jsxs(Be,{className:"surface-card step-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),u.jsx("h2",{children:"System ready"})]})}),u.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),u.jsx("div",{className:"compact-stack",children:h.healthChecks.map(be=>u.jsxs("div",{className:"health-check-row",children:[u.jsxs("div",{children:[u.jsx("p",{className:"run-row-title",children:be.label}),u.jsx("p",{className:"supporting-copy",children:be.detail}),be.id==="provider"&&be.state!=="ready"&&u.jsx(Rt,{to:"/settings",className:"text-emerald-400 hover:text-emerald-300 text-sm mt-1 underline underline-offset-2 cursor-pointer",children:"Configure providers"})]}),u.jsx(mt,{tone:be.state==="ready"?"positive":"caution",children:be.state==="ready"?"Ready":"Attention"})]},be.id))}),u.jsxs("div",{className:"setup-nav",children:[u.jsx("span",{}),u.jsx(me,{type:"button",disabled:!cr,onClick:()=>v(1),children:"Continue"})]})]});case 1:return u.jsxs(Be,{className:"surface-card step-card",children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 2 of 5"}),u.jsx("h2",{children:"Create project"})]}),A?u.jsx(mt,{tone:"positive",children:"Created"}):null]}),A?u.jsxs("div",{className:"compact-stack",children:[u.jsxs("p",{className:"text-zinc-300",children:["Project ",u.jsx("span",{className:"text-zinc-100 font-medium",children:A})," created successfully."]}),u.jsxs("div",{className:"setup-nav",children:[u.jsx(me,{type:"button",variant:"outline",onClick:$e,children:"Back"}),u.jsx(me,{type:"button",onClick:()=>v(2),children:"Continue"})]})]}):u.jsxs("div",{className:"compact-stack",children:[u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"project-name",children:"Project name"}),u.jsx("input",{id:"project-name",className:"setup-input",type:"text",placeholder:"my-website",value:y,onChange:be=>w(be.target.value)}),Xe&&Xe!==y?u.jsxs("p",{className:"supporting-copy",children:["Slug: ",Xe]}):null]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),u.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:S,onChange:be=>N(be.target.value)})]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),u.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:C,onChange:be=>E(be.target.value)})]}),u.jsxs("div",{className:"setup-field-row",children:[u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),u.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:k,onChange:be=>O(be.target.value.toUpperCase())})]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),u.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:T,onChange:be=>P(be.target.value.toLowerCase())})]})]}),U?u.jsx("p",{className:"text-rose-400 text-sm",children:U}):null,u.jsxs("div",{className:"setup-nav",children:[u.jsx(me,{type:"button",variant:"outline",onClick:$e,children:"Back"}),u.jsx(me,{type:"button",disabled:!Xe||!C||ae,onClick:qa,children:ae?"Creating...":"Create project"})]})]})]});case 2:return u.jsxs(Be,{className:"surface-card step-card",children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),u.jsx("h2",{children:"Add key phrases"})]}),re?u.jsxs(mt,{tone:"positive",children:[at.length," saved"]}):u.jsxs(mt,{tone:"neutral",children:[at.length," key phrase",at.length!==1?"s":""]})]}),u.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),re?u.jsxs("div",{className:"compact-stack",children:[u.jsx("ul",{className:"detail-list",children:at.map(be=>u.jsx("li",{children:be},be))}),u.jsxs("div",{className:"setup-nav",children:[u.jsx(me,{type:"button",variant:"outline",onClick:$e,children:"Back"}),u.jsx(me,{type:"button",onClick:()=>v(3),children:"Continue"})]})]}):u.jsxs("div",{className:"compact-stack",children:[oe.length>0?u.jsxs("div",{className:"compact-stack",children:[u.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[u.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"auto-generate",u.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),u.jsxs("div",{className:"flex items-end gap-2",children:[u.jsxs("div",{className:"setup-field flex-1",children:[u.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),u.jsx("select",{id:"gen-provider",className:"setup-input",value:W,onChange:be=>X(be.target.value),children:oe.map(be=>u.jsxs("option",{value:be.name,children:[be.displayName??be.name,be.model?` (${be.model})`:""]},be.name))})]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"gen-count",children:"Count"}),u.jsx("select",{id:"gen-count",className:"setup-input",value:Q,onChange:be=>de(Number(be.target.value)),children:[3,5,10,15,20].map(be=>u.jsx("option",{value:be,children:be},be))})]}),u.jsx(me,{type:"button",variant:"outline",disabled:ye||!W,onClick:ut,children:ye?"Analyzing site...":"Generate"})]}),le?u.jsx("p",{className:"text-rose-400 text-sm",children:le}):null]}):null,u.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[u.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",u.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"keywords",children:"Key phrases (one per line)"}),u.jsx("textarea",{id:"keywords",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
279
- best invisalign downtown brooklyn
280
- pediatric dentist brooklyn heights`,value:ge,onChange:be=>V(be.target.value)})]}),we?u.jsx("p",{className:"text-rose-400 text-sm",children:we}):null,u.jsxs("div",{className:"setup-nav",children:[u.jsx(me,{type:"button",variant:"outline",onClick:$e,children:"Back"}),u.jsx(me,{type:"button",disabled:at.length===0||D,onClick:Qs,children:D?"Saving...":`Save ${at.length} key phrase${at.length!==1?"s":""}`})]})]})]});case 3:return u.jsxs(Be,{className:"surface-card step-card",children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 4 of 5"}),u.jsx("h2",{children:"Add competitors"})]}),Oe?u.jsx(mt,{tone:"positive",children:"Saved"}):null]}),u.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same key phrases. One per line."}),Oe?u.jsxs("div",{className:"compact-stack",children:[u.jsx("ul",{className:"detail-list",children:Pt.map(be=>u.jsx("li",{children:be},be))}),u.jsxs("div",{className:"setup-nav",children:[u.jsx(me,{type:"button",variant:"outline",onClick:$e,children:"Back"}),u.jsx(me,{type:"button",onClick:()=>v(4),children:"Continue"})]})]}):u.jsxs("div",{className:"compact-stack",children:[u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"competitors",children:"Competitor domains (one per line)"}),u.jsx("textarea",{id:"competitors",className:"setup-textarea",rows:4,placeholder:`competitor1.com
281
- competitor2.com`,value:F,onChange:be=>Ae(be.target.value)})]}),Ve?u.jsx("p",{className:"text-rose-400 text-sm",children:Ve}):null,u.jsxs("div",{className:"setup-nav",children:[u.jsx(me,{type:"button",variant:"outline",onClick:$e,children:"Back"}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(me,{type:"button",variant:"outline",onClick:()=>v(4),children:"Skip"}),u.jsx(me,{type:"button",disabled:Pt.length===0||pn,onClick:gl,children:pn?"Saving...":`Save ${Pt.length} competitor${Pt.length!==1?"s":""}`})]})]})]})]});case 4:return u.jsxs(Be,{className:"surface-card step-card",children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),u.jsx("h2",{children:"Launch first run"})]}),he?u.jsx(mt,{tone:"positive",children:"Queued"}):null]}),he?u.jsxs("div",{className:"compact-stack",children:[u.jsx("p",{className:"text-zinc-300",children:"Visibility sweep has been queued. View progress on the project page."}),u.jsxs("div",{className:"setup-nav",children:[u.jsx("span",{}),u.jsx(me,{type:"button",onClick:()=>p({to:R?`/projects/${R}`:"/"}),children:"Open project"})]})]}):u.jsxs("div",{className:"compact-stack",children:[u.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",u.jsx("span",{className:"text-zinc-100 font-medium",children:A}),"."]}),u.jsxs("div",{className:"setup-nav",children:[u.jsx(me,{type:"button",variant:"outline",onClick:$e,children:"Back"}),u.jsx(me,{type:"button",disabled:St,onClick:An,children:St?"Launching...":"Launch visibility sweep"})]})]})]});default:return null}})();return u.jsxs("div",{className:"page-container",children:[u.jsx("div",{className:"page-header",children:u.jsxs("div",{className:"page-header-left",children:[u.jsx("h1",{className:"page-title",children:"Setup"}),u.jsx("p",{className:"page-subtitle",children:"Create a project, add key phrases, add competitors, and launch the first run."})]})}),u.jsx(sye,{current:g,labels:aye}),u.jsx("section",{className:"setup-wizard",children:Rr})]})}function lye(){return u.jsx("div",{className:"page-container",children:u.jsx("section",{className:"page-section",children:u.jsxs(Be,{className:"surface-card empty-card",children:[u.jsx("h1",{children:"Route not found"}),u.jsx("p",{children:"The current path does not map to a dashboard view."}),u.jsx(me,{asChild:!0,children:u.jsx(Rt,{to:"/",children:"Return to overview"})})]})})})}function cye(){return u.jsx(tX,{children:u.jsx(eX,{})})}const ji=qq()({component:cye,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),uye=li({getParentRoute:()=>ji,path:"/",component:lX,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Jr.projects.all);if(t&&t.length===0)throw ZS({to:"/setup"})}}),dye=li({getParentRoute:()=>ji,path:"/projects",component:xJ}),zf=li({getParentRoute:()=>ji,path:"/projects/$projectId",component:()=>u.jsx(r1,{})}),fye=li({getParentRoute:()=>zf,path:"/",component:()=>u.jsx(Lv,{tab:"overview"})}),hye=li({getParentRoute:()=>zf,path:"/search-console",component:()=>u.jsx(Lv,{tab:"search-console"})}),pye=li({getParentRoute:()=>zf,path:"/analytics",component:()=>u.jsx(Lv,{tab:"analytics"})}),mye=li({getParentRoute:()=>zf,path:"/traffic",component:()=>u.jsx(Lv,{tab:"traffic"})}),gye=li({getParentRoute:()=>ji,path:"/runs",component:Jve}),vye=li({getParentRoute:()=>ji,path:"/settings",component:iye,beforeLoad:({context:e})=>{}}),yye=li({getParentRoute:()=>ji,path:"/setup",component:oye,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Jr.projects.all);if(t&&t.length>0)throw ZS({to:"/"})}}),bye=li({getParentRoute:()=>ji,path:"*",component:lye}),xye=ji.addChildren([uye,dye,zf.addChildren([fye,hye,pye,mye]),gye,vye,yye,bye]);function wye(e,t){return Xq({routeTree:xye,basepath:zw||"/",context:{queryClient:e},...t?.initialEntries})}const sU=cF(),Sye=wye(sU),oU=document.getElementById("root");if(!oU)throw new Error("Expected #root element for web app bootstrap.");function jye(){const[e,t]=x.useState(rA()?"ready":"checking"),[n,r]=x.useState(""),[i,s]=x.useState(""),[l,c]=x.useState(null),[f,h]=x.useState(!1);x.useEffect(()=>{if(rA())return;let v=!1;return g9().then(y=>{v||(y.authenticated?t("ready"):t(y.setupRequired?"setup":"login"))}).catch(y=>{v||(c(y instanceof Error?y.message:"Failed to reach the Canonry API"),t("login"))}),()=>{v=!0}},[]);const p=async v=>{if(v.preventDefault(),!n.trim()||n.trim().length<8){c("Password must be at least 8 characters");return}if(n!==i){c("Passwords do not match");return}h(!0),c(null);try{if(!(await v9(n.trim())).authenticated){c("Setup failed");return}r(""),s(""),t("ready")}catch(y){c(y instanceof cm||y instanceof Error?y.message:"Setup failed")}finally{h(!1)}},g=async v=>{if(v.preventDefault(),!!n.trim()){h(!0),c(null);try{if(!(await y9(n.trim())).authenticated){c("Incorrect password");return}r(""),t("ready")}catch(y){c(y instanceof cm||y instanceof Error?y.message:"Authentication failed")}finally{h(!1)}}};return e==="ready"?u.jsx(WB,{client:sU,children:u.jsx(t9,{router:Sye})}):u.jsx("div",{className:"min-h-screen bg-zinc-950 px-4 py-8",children:u.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md items-center justify-center",children:u.jsx(Be,{className:"surface-card w-full",children:e==="checking"?u.jsx(Kp,{className:"py-8",children:u.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):e==="setup"?u.jsxs(u.Fragment,{children:[u.jsxs(Mw,{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),u.jsx(Rw,{children:"Create a dashboard password"}),u.jsx(Dw,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),u.jsx(Kp,{children:u.jsxs("form",{className:"space-y-4",onSubmit:p,children:[u.jsxs("label",{className:"block space-y-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),u.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:n,onChange:v=>r(v.target.value),placeholder:"At least 8 characters"})]}),u.jsxs("label",{className:"block space-y-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Confirm password"}),u.jsx("input",{className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:i,onChange:v=>s(v.target.value),placeholder:"Re-enter password"})]}),l?u.jsx("p",{className:"text-sm text-rose-400",children:l}):null,u.jsx(me,{type:"submit",disabled:f||!n.trim()||!i.trim(),children:f?"Setting up…":"Create password & open dashboard"})]})})]}):u.jsxs(u.Fragment,{children:[u.jsxs(Mw,{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),u.jsx(Rw,{children:"Sign in to Canonry"}),u.jsx(Dw,{children:"Enter your dashboard password to continue."})]}),u.jsx(Kp,{children:u.jsxs("form",{className:"space-y-4",onSubmit:g,children:[u.jsxs("label",{className:"block space-y-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),u.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:n,onChange:v=>r(v.target.value),placeholder:"Dashboard password"})]}),l?u.jsx("p",{className:"text-sm text-rose-400",children:l}):null,u.jsx(me,{type:"submit",disabled:f||!n.trim(),children:f?"Signing in…":"Open dashboard"})]})})]})})})})}CB.createRoot(oU).render(u.jsx(x.StrictMode,{children:u.jsx(jye,{})}));