@ainyc/canonry 1.34.0 → 1.36.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.
@@ -0,0 +1,281 @@
1
+ function A6(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 Ms(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var z0={exports:{}},Zu={};var FO;function E6(){if(FO)return Zu;FO=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 Zu.Fragment=t,Zu.jsx=n,Zu.jsxs=n,Zu}var KO;function T6(){return KO||(KO=1,z0.exports=E6()),z0.exports}var u=T6(),M0={exports:{}},$e={};var HO;function P6(){if(HO)return $e;HO=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"),m=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function v(R){return R===null||typeof R!="object"?null:(R=y&&R[y]||R["@@iterator"],typeof R=="function"?R:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,N={};function C(R,H,oe){this.props=R,this.context=H,this.refs=N,this.updater=oe||w}C.prototype.isReactComponent={},C.prototype.setState=function(R,H){if(typeof R!="object"&&typeof R!="function"&&R!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,R,H,"setState")},C.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function A(){}A.prototype=C.prototype;function k(R,H,oe){this.props=R,this.context=H,this.refs=N,this.updater=oe||w}var _=k.prototype=new A;_.constructor=k,S(_,C.prototype),_.isPureReactComponent=!0;var T=Array.isArray;function P(){}var E={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function D(R,H,oe){var Q=oe.ref;return{$$typeof:e,type:R,key:H,ref:Q!==void 0?Q:null,props:oe}}function F(R,H){return D(R.type,H,R.props)}function U(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function I(R){var H={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(oe){return H[oe]})}var ae=/\/+/g;function ve(R,H){return typeof R=="object"&&R!==null&&R.key!=null?I(""+R.key):H.toString(36)}function me(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(P,P):(R.status="pending",R.then(function(H){R.status==="pending"&&(R.status="fulfilled",R.value=H)},function(H){R.status==="pending"&&(R.status="rejected",R.reason=H)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function G(R,H,oe,Q,X){var W=typeof R;(W==="undefined"||W==="boolean")&&(R=null);var le=!1;if(R===null)le=!0;else switch(W){case"bigint":case"string":case"number":le=!0;break;case"object":switch(R.$$typeof){case e:case t:le=!0;break;case m:return le=R._init,G(le(R._payload),H,oe,Q,X)}}if(le)return X=X(R),le=Q===""?"."+ve(R,0):Q,T(X)?(oe="",le!=null&&(oe=le.replace(ae,"$&/")+"/"),G(X,H,oe,"",function(ce){return ce})):X!=null&&(U(X)&&(X=F(X,oe+(X.key==null||R&&R.key===X.key?"":(""+X.key).replace(ae,"$&/")+"/")+le)),H.push(X)),1;le=0;var ye=Q===""?".":Q+":";if(T(R))for(var Z=0;Z<R.length;Z++)Q=R[Z],W=ye+ve(Q,Z),le+=G(Q,H,oe,W,X);else if(Z=v(R),typeof Z=="function")for(R=Z.call(R),Z=0;!(Q=R.next()).done;)Q=Q.value,W=ye+ve(Q,Z++),le+=G(Q,H,oe,W,X);else if(W==="object"){if(typeof R.then=="function")return G(me(R),H,oe,Q,X);throw H=String(R),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return le}function re(R,H,oe){if(R==null)return R;var Q=[],X=0;return G(R,Q,"","",function(W){return H.call(oe,W,X++)}),Q}function ge(R){if(R._status===-1){var H=R._result;H=H(),H.then(function(oe){(R._status===0||R._status===-1)&&(R._status=1,R._result=oe)},function(oe){(R._status===0||R._status===-1)&&(R._status=2,R._result=oe)}),R._status===-1&&(R._status=0,R._result=H)}if(R._status===1)return R._result.default;throw R._result}var Se=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},B={map:re,forEach:function(R,H,oe){re(R,function(){H.apply(this,arguments)},oe)},count:function(R){var H=0;return re(R,function(){H++}),H},toArray:function(R){return re(R,function(H){return H})||[]},only:function(R){if(!U(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return $e.Activity=g,$e.Children=B,$e.Component=C,$e.Fragment=n,$e.Profiler=i,$e.PureComponent=k,$e.StrictMode=r,$e.Suspense=f,$e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=E,$e.__COMPILER_RUNTIME={__proto__:null,c:function(R){return E.H.useMemoCache(R)}},$e.cache=function(R){return function(){return R.apply(null,arguments)}},$e.cacheSignal=function(){return null},$e.cloneElement=function(R,H,oe){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var Q=S({},R.props),X=R.key;if(H!=null)for(W in H.key!==void 0&&(X=""+H.key),H)!z.call(H,W)||W==="key"||W==="__self"||W==="__source"||W==="ref"&&H.ref===void 0||(Q[W]=H[W]);var W=arguments.length-2;if(W===1)Q.children=oe;else if(1<W){for(var le=Array(W),ye=0;ye<W;ye++)le[ye]=arguments[ye+2];Q.children=le}return D(R.type,X,Q)},$e.createContext=function(R){return R={$$typeof:l,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:s,_context:R},R},$e.createElement=function(R,H,oe){var Q,X={},W=null;if(H!=null)for(Q in H.key!==void 0&&(W=""+H.key),H)z.call(H,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(X[Q]=H[Q]);var le=arguments.length-2;if(le===1)X.children=oe;else if(1<le){for(var ye=Array(le),Z=0;Z<le;Z++)ye[Z]=arguments[Z+2];X.children=ye}if(R&&R.defaultProps)for(Q in le=R.defaultProps,le)X[Q]===void 0&&(X[Q]=le[Q]);return D(R,W,X)},$e.createRef=function(){return{current:null}},$e.forwardRef=function(R){return{$$typeof:c,render:R}},$e.isValidElement=U,$e.lazy=function(R){return{$$typeof:m,_payload:{_status:-1,_result:R},_init:ge}},$e.memo=function(R,H){return{$$typeof:h,type:R,compare:H===void 0?null:H}},$e.startTransition=function(R){var H=E.T,oe={};E.T=oe;try{var Q=R(),X=E.S;X!==null&&X(oe,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(P,Se)}catch(W){Se(W)}finally{H!==null&&oe.types!==null&&(H.types=oe.types),E.T=H}},$e.unstable_useCacheRefresh=function(){return E.H.useCacheRefresh()},$e.use=function(R){return E.H.use(R)},$e.useActionState=function(R,H,oe){return E.H.useActionState(R,H,oe)},$e.useCallback=function(R,H){return E.H.useCallback(R,H)},$e.useContext=function(R){return E.H.useContext(R)},$e.useDebugValue=function(){},$e.useDeferredValue=function(R,H){return E.H.useDeferredValue(R,H)},$e.useEffect=function(R,H){return E.H.useEffect(R,H)},$e.useEffectEvent=function(R){return E.H.useEffectEvent(R)},$e.useId=function(){return E.H.useId()},$e.useImperativeHandle=function(R,H,oe){return E.H.useImperativeHandle(R,H,oe)},$e.useInsertionEffect=function(R,H){return E.H.useInsertionEffect(R,H)},$e.useLayoutEffect=function(R,H){return E.H.useLayoutEffect(R,H)},$e.useMemo=function(R,H){return E.H.useMemo(R,H)},$e.useOptimistic=function(R,H){return E.H.useOptimistic(R,H)},$e.useReducer=function(R,H,oe){return E.H.useReducer(R,H,oe)},$e.useRef=function(R){return E.H.useRef(R)},$e.useState=function(R){return E.H.useState(R)},$e.useSyncExternalStore=function(R,H,oe){return E.H.useSyncExternalStore(R,H,oe)},$e.useTransition=function(){return E.H.useTransition()},$e.version="19.2.4",$e}var GO;function Uc(){return GO||(GO=1,M0.exports=P6()),M0.exports}var x=Uc();const fi=Ms(x),rg=A6({__proto__:null,default:fi},[x]);var R0={exports:{}},Yu={},D0={exports:{}},L0={};var VO;function z6(){return VO||(VO=1,(function(e){function t(G,re){var ge=G.length;G.push(re);e:for(;0<ge;){var Se=ge-1>>>1,B=G[Se];if(0<i(B,re))G[Se]=re,G[ge]=B,ge=Se;else break e}}function n(G){return G.length===0?null:G[0]}function r(G){if(G.length===0)return null;var re=G[0],ge=G.pop();if(ge!==re){G[0]=ge;e:for(var Se=0,B=G.length,R=B>>>1;Se<R;){var H=2*(Se+1)-1,oe=G[H],Q=H+1,X=G[Q];if(0>i(oe,ge))Q<B&&0>i(X,oe)?(G[Se]=X,G[Q]=ge,Se=Q):(G[Se]=oe,G[H]=ge,Se=H);else if(Q<B&&0>i(X,ge))G[Se]=X,G[Q]=ge,Se=Q;else break e}}return re}function i(G,re){var ge=G.sortIndex-re.sortIndex;return ge!==0?ge:G.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=[],m=1,g=null,y=3,v=!1,w=!1,S=!1,N=!1,C=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function _(G){for(var re=n(h);re!==null;){if(re.callback===null)r(h);else if(re.startTime<=G)r(h),re.sortIndex=re.expirationTime,t(f,re);else break;re=n(h)}}function T(G){if(S=!1,_(G),!w)if(n(f)!==null)w=!0,P||(P=!0,I());else{var re=n(h);re!==null&&me(T,re.startTime-G)}}var P=!1,E=-1,z=5,D=-1;function F(){return N?!0:!(e.unstable_now()-D<z)}function U(){if(N=!1,P){var G=e.unstable_now();D=G;var re=!0;try{e:{w=!1,S&&(S=!1,A(E),E=-1),v=!0;var ge=y;try{t:{for(_(G),g=n(f);g!==null&&!(g.expirationTime>G&&F());){var Se=g.callback;if(typeof Se=="function"){g.callback=null,y=g.priorityLevel;var B=Se(g.expirationTime<=G);if(G=e.unstable_now(),typeof B=="function"){g.callback=B,_(G),re=!0;break t}g===n(f)&&r(f),_(G)}else r(f);g=n(f)}if(g!==null)re=!0;else{var R=n(h);R!==null&&me(T,R.startTime-G),re=!1}}break e}finally{g=null,y=ge,v=!1}re=void 0}}finally{re?I():P=!1}}}var I;if(typeof k=="function")I=function(){k(U)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,ve=ae.port2;ae.port1.onmessage=U,I=function(){ve.postMessage(null)}}else I=function(){C(U,0)};function me(G,re){E=C(function(){G(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(G){G.callback=null},e.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<G?Math.floor(1e3/G):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(G){switch(y){case 1:case 2:case 3:var re=3;break;default:re=y}var ge=y;y=re;try{return G()}finally{y=ge}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(G,re){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var ge=y;y=G;try{return re()}finally{y=ge}},e.unstable_scheduleCallback=function(G,re,ge){var Se=e.unstable_now();switch(typeof ge=="object"&&ge!==null?(ge=ge.delay,ge=typeof ge=="number"&&0<ge?Se+ge:Se):ge=Se,G){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=ge+B,G={id:m++,callback:re,priorityLevel:G,startTime:ge,expirationTime:B,sortIndex:-1},ge>Se?(G.sortIndex=ge,t(h,G),n(f)===null&&G===n(h)&&(S?(A(E),E=-1):S=!0,me(T,ge-Se))):(G.sortIndex=B,t(f,G),w||v||(w=!0,P||(P=!0,I()))),G},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(G){var re=y;return function(){var ge=y;y=re;try{return G.apply(this,arguments)}finally{y=ge}}}})(L0)),L0}var ZO;function M6(){return ZO||(ZO=1,D0.exports=z6()),D0.exports}var I0={exports:{}},$n={};var YO;function R6(){if(YO)return $n;YO=1;var e=Uc();function t(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)h+="&args[]="+encodeURIComponent(arguments[m])}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,m){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:m}}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 $n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,$n.createPortal=function(f,h){var m=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,m)},$n.flushSync=function(f){var h=l.T,m=r.p;try{if(l.T=null,r.p=2,f)return f()}finally{l.T=h,r.p=m,r.d.f()}},$n.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))},$n.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},$n.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var m=h.as,g=c(m,h.crossOrigin),y=typeof h.integrity=="string"?h.integrity:void 0,v=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;m==="style"?r.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:v}):m==="script"&&r.d.X(f,{crossOrigin:g,integrity:y,fetchPriority:v,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},$n.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var m=c(h.as,h.crossOrigin);r.d.M(f,{crossOrigin:m,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)},$n.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var m=h.as,g=c(m,h.crossOrigin);r.d.L(f,m,{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})}},$n.preloadModule=function(f,h){if(typeof f=="string")if(h){var m=c(h.as,h.crossOrigin);r.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(f)},$n.requestFormReset=function(f){r.d.r(f)},$n.unstable_batchedUpdates=function(f,h){return f(h)},$n.useFormState=function(f,h,m){return l.H.useFormState(f,h,m)},$n.useFormStatus=function(){return l.H.useHostTransitionStatus()},$n.version="19.2.4",$n}var WO;function $z(){if(WO)return I0.exports;WO=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(),I0.exports=R6(),I0.exports}var QO;function D6(){if(QO)return Yu;QO=1;var e=M6(),t=Uc(),n=$z();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,p=o;;){var b=d.return;if(b===null)break;var j=b.alternate;if(j===null){if(p=b.return,p!==null){d=p;continue}break}if(b.child===j.child){for(j=b.child;j;){if(j===d)return f(b),a;if(j===p)return f(b),o;j=j.sibling}throw Error(r(188))}if(d.return!==p.return)d=b,p=j;else{for(var O=!1,M=b.child;M;){if(M===d){O=!0,d=b,p=j;break}if(M===p){O=!0,p=b,d=j;break}M=M.sibling}if(!O){for(M=j.child;M;){if(M===d){O=!0,d=j,p=b;break}if(M===p){O=!0,p=j,d=b;break}M=M.sibling}if(!O)throw Error(r(189))}}if(d.alternate!==p)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?a:o}function m(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a;for(a=a.child;a!==null;){if(o=m(a),o!==null)return o;a=a.sibling}return null}var g=Object.assign,y=Symbol.for("react.element"),v=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"),A=Symbol.for("react.consumer"),k=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),D=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function I(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 ve(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 D:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case w:return"Portal";case k:return a.displayName||"Context";case A:return(a._context.displayName||"Context")+".Consumer";case _:var o=a.render;return a=a.displayName,a||(a=o.displayName||o.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case E:return o=a.displayName||null,o!==null?o:ve(a.type)||"Memo";case z:o=a._payload,a=a._init;try{return ve(a(o))}catch{}}return null}var me=Array.isArray,G=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,ge={pending:!1,data:null,method:null,action:null},Se=[],B=-1;function R(a){return{current:a}}function H(a){0>B||(a.current=Se[B],Se[B]=null,B--)}function oe(a,o){B++,Se[B]=a.current,a.current=o}var Q=R(null),X=R(null),W=R(null),le=R(null);function ye(a,o){switch(oe(W,o),oe(X,a),oe(Q,null),o.nodeType){case 9:case 11:a=(a=o.documentElement)&&(a=a.namespaceURI)?fO(a):0;break;default:if(a=o.tagName,o=o.namespaceURI)o=fO(o),a=hO(o,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}H(Q),oe(Q,a)}function Z(){H(Q),H(X),H(W)}function ce(a){a.memoizedState!==null&&oe(le,a);var o=Q.current,d=hO(o,a.type);o!==d&&(oe(X,a),oe(Q,d))}function be(a){X.current===a&&(H(Q),H(X)),le.current===a&&(H(le),Ku._currentValue=ge)}var K,Re;function Ee(a){if(K===void 0)try{throw Error()}catch(d){var o=d.stack.trim().match(/\n( *(at )?)/);K=o&&o[1]||"",Re=-1<d.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+K+a+Re}var it=!1;function rt(a,o){if(!a||it)return"";it=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={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]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var j=p.DetermineComponentFrameRoot(),O=j[0],M=j[1];if(O&&M){var $=O.split(`
4
+ `),ee=M.split(`
5
+ `);for(b=p=0;p<$.length&&!$[p].includes("DetermineComponentFrameRoot");)p++;for(;b<ee.length&&!ee[b].includes("DetermineComponentFrameRoot");)b++;if(p===$.length||b===ee.length)for(p=$.length-1,b=ee.length-1;1<=p&&0<=b&&$[p]!==ee[b];)b--;for(;1<=p&&0<=b;p--,b--)if($[p]!==ee[b]){if(p!==1||b!==1)do if(p--,b--,0>b||$[p]!==ee[b]){var se=`
6
+ `+$[p].replace(" at new "," at ");return a.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",a.displayName)),se}while(1<=p&&0<=b);break}}}finally{it=!1,Error.prepareStackTrace=d}return(d=a?a.displayName||a.name:"")?Ee(d):""}function rn(a,o){switch(a.tag){case 26:case 27:case 5:return Ee(a.type);case 16:return Ee("Lazy");case 13:return a.child!==o&&o!==null?Ee("Suspense Fallback"):Ee("Suspense");case 19:return Ee("SuspenseList");case 0:case 15:return rt(a.type,!1);case 11:return rt(a.type.render,!1);case 1:return rt(a.type,!0);case 31:return Ee("Activity");default:return""}}function dn(a){try{var o="",d=null;do o+=rn(a,d),d=a,a=a.return;while(a);return o}catch(p){return`
7
+ Error generating stack: `+p.message+`
8
+ `+p.stack}}var Gt=Object.prototype.hasOwnProperty,he=e.unstable_scheduleCallback,Je=e.unstable_cancelCallback,xt=e.unstable_shouldYield,xn=e.unstable_requestPaint,et=e.unstable_now,Ke=e.unstable_getCurrentPriorityLevel,at=e.unstable_ImmediatePriority,Bt=e.unstable_UserBlockingPriority,Ye=e.unstable_NormalPriority,cl=e.unstable_LowPriority,tr=e.unstable_IdlePriority,ft=e.log,au=e.unstable_setDisableYieldValue,ii=null,Nt=null;function nr(a){if(typeof ft=="function"&&au(a),Nt&&typeof Nt.setStrictMode=="function")try{Nt.setStrictMode(ii,a)}catch{}}var xe=Math.clz32?Math.clz32:Cf,pr=Math.log,ul=Math.LN2;function Cf(a){return a>>>=0,a===0?32:31-(pr(a)/ul|0)|0}var Ks=256,dl=262144,Wi=4194304;function ji(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 fl(a,o,d){var p=a.pendingLanes;if(p===0)return 0;var b=0,j=a.suspendedLanes,O=a.pingedLanes;a=a.warmLanes;var M=p&134217727;return M!==0?(p=M&~j,p!==0?b=ji(p):(O&=M,O!==0?b=ji(O):d||(d=M&~a,d!==0&&(b=ji(d))))):(M=p&~j,M!==0?b=ji(M):O!==0?b=ji(O):d||(d=p&~a,d!==0&&(b=ji(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 Da(a,o){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&o)===0}function Cy(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 _f(){var a=Wi;return Wi<<=1,(Wi&62914560)===0&&(Wi=4194304),a}function su(a){for(var o=[],d=0;31>d;d++)o.push(a);return o}function Hs(a,o){a.pendingLanes|=o,o!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Of(a,o,d,p,b,j){var O=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=O&~d;0<d;){var se=31-xe(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}p!==0&&V(a,p,0),j!==0&&b===0&&a.tag!==0&&(a.suspendedLanes|=j&~(O&~o))}function V(a,o,d){a.pendingLanes|=o,a.suspendedLanes&=~o;var p=31-xe(o);a.entangledLanes|=o,a.entanglements[p]=a.entanglements[p]|1073741824|d&261930}function we(a,o){var d=a.entangledLanes|=o;for(a=a.entanglements;d;){var p=31-xe(d),b=1<<p;b&o|a[p]&o&&(a[p]|=o),d&=~b}}function zt(a,o){var d=o&-o;return d=(d&42)!==0?1:fn(d),(d&(a.suspendedLanes|o))!==0?0:d}function fn(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 Kn(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function hl(){var a=re.p;return a!==0?a:(a=window.event,a===void 0?32:DO(a.type))}function Ni(a,o){var d=re.p;try{return re.p=a,o()}finally{re.p=d}}var Hn=Math.random().toString(36).slice(2),ht="__reactFiber$"+Hn,In="__reactProps$"+Hn,mr="__reactContainer$"+Hn,Qi="__reactEvents$"+Hn,pl="__reactListeners$"+Hn,kf="__reactHandles$"+Hn,Af="__reactResources$"+Hn,Ci="__reactMarker$"+Hn;function La(a){delete a[ht],delete a[In],delete a[Qi],delete a[pl],delete a[kf]}function Ia(a){var o=a[ht];if(o)return o;for(var d=a.parentNode;d;){if(o=d[mr]||d[ht]){if(d=o.alternate,o.child!==null||d!==null&&d.child!==null)for(a=xO(a);a!==null;){if(d=a[ht])return d;a=xO(a)}return o}a=d,d=a.parentNode}return null}function $a(a){if(a=a[ht]||a[mr]){var o=a.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return a}return null}function He(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a.stateNode;throw Error(r(33))}function st(a){var o=a[Af];return o||(o=a[Af]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function pt(a){a[Ci]=!0}var ai=new Set,Gs={};function _i(a,o){ml(a,o),ml(a+"Capture",o)}function ml(a,o){for(Gs[a]=o,a=0;a<o.length;a++)ai.add(o[a])}var x4=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]*$"),nN={},rN={};function w4(a){return Gt.call(rN,a)?!0:Gt.call(nN,a)?!1:x4.test(a)?rN[a]=!0:(nN[a]=!0,!1)}function Ef(a,o,d){if(w4(o))if(d===null)a.removeAttribute(o);else{switch(typeof d){case"undefined":case"function":case"symbol":a.removeAttribute(o);return;case"boolean":var p=o.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){a.removeAttribute(o);return}}a.setAttribute(o,""+d)}}function Tf(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 Xi(a,o,d,p){if(p===null)a.removeAttribute(d);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(d);return}a.setAttributeNS(o,d,""+p)}}function Tr(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function iN(a){var o=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function S4(a,o,d){var p=Object.getOwnPropertyDescriptor(a.constructor.prototype,o);if(!a.hasOwnProperty(o)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var b=p.get,j=p.set;return Object.defineProperty(a,o,{configurable:!0,get:function(){return b.call(this)},set:function(O){d=""+O,j.call(this,O)}}),Object.defineProperty(a,o,{enumerable:p.enumerable}),{getValue:function(){return d},setValue:function(O){d=""+O},stopTracking:function(){a._valueTracker=null,delete a[o]}}}}function _y(a){if(!a._valueTracker){var o=iN(a)?"checked":"value";a._valueTracker=S4(a,o,""+a[o])}}function aN(a){if(!a)return!1;var o=a._valueTracker;if(!o)return!0;var d=o.getValue(),p="";return a&&(p=iN(a)?a.checked?"true":"false":a.value),a=p,a!==d?(o.setValue(a),!0):!1}function Pf(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 j4=/[\n"\\]/g;function Pr(a){return a.replace(j4,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Oy(a,o,d,p,b,j,O,M){a.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?a.type=O:a.removeAttribute("type"),o!=null?O==="number"?(o===0&&a.value===""||a.value!=o)&&(a.value=""+Tr(o)):a.value!==""+Tr(o)&&(a.value=""+Tr(o)):O!=="submit"&&O!=="reset"||a.removeAttribute("value"),o!=null?ky(a,O,Tr(o)):d!=null?ky(a,O,Tr(d)):p!=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=""+Tr(M):a.removeAttribute("name")}function sN(a,o,d,p,b,j,O,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)){_y(a);return}d=d!=null?""+Tr(d):"",o=o!=null?""+Tr(o):d,M||o===a.value||(a.value=o),a.defaultValue=o}p=p??b,p=typeof p!="function"&&typeof p!="symbol"&&!!p,a.checked=M?a.checked:!!p,a.defaultChecked=!!p,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(a.name=O),_y(a)}function ky(a,o,d){o==="number"&&Pf(a.ownerDocument)===a||a.defaultValue===""+d||(a.defaultValue=""+d)}function gl(a,o,d,p){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&&p&&(a[d].defaultSelected=!0)}else{for(d=""+Tr(d),o=null,b=0;b<a.length;b++){if(a[b].value===d){a[b].selected=!0,p&&(a[b].defaultSelected=!0);return}o!==null||a[b].disabled||(o=a[b])}o!==null&&(o.selected=!0)}}function oN(a,o,d){if(o!=null&&(o=""+Tr(o),o!==a.value&&(a.value=o),d==null)){a.defaultValue!==o&&(a.defaultValue=o);return}a.defaultValue=d!=null?""+Tr(d):""}function lN(a,o,d,p){if(o==null){if(p!=null){if(d!=null)throw Error(r(92));if(me(p)){if(1<p.length)throw Error(r(93));p=p[0]}d=p}d==null&&(d=""),o=d}d=Tr(o),a.defaultValue=d,p=a.textContent,p===d&&p!==""&&p!==null&&(a.value=p),_y(a)}function yl(a,o){if(o){var d=a.firstChild;if(d&&d===a.lastChild&&d.nodeType===3){d.nodeValue=o;return}}a.textContent=o}var N4=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 cN(a,o,d){var p=o.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?p?a.setProperty(o,""):o==="float"?a.cssFloat="":a[o]="":p?a.setProperty(o,d):typeof d!="number"||d===0||N4.has(o)?o==="float"?a.cssFloat=d:a[o]=(""+d).trim():a[o]=d+"px"}function uN(a,o,d){if(o!=null&&typeof o!="object")throw Error(r(62));if(a=a.style,d!=null){for(var p in d)!d.hasOwnProperty(p)||o!=null&&o.hasOwnProperty(p)||(p.indexOf("--")===0?a.setProperty(p,""):p==="float"?a.cssFloat="":a[p]="");for(var b in o)p=o[b],o.hasOwnProperty(b)&&d[b]!==p&&cN(a,b,p)}else for(var j in o)o.hasOwnProperty(j)&&cN(a,j,o[j])}function Ay(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 C4=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"]]),_4=/^[\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 zf(a){return _4.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function Ji(){}var Ey=null;function Ty(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var vl=null,bl=null;function dN(a){var o=$a(a);if(o&&(a=o.stateNode)){var d=a[In]||null;e:switch(a=o.stateNode,o.type){case"input":if(Oy(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="'+Pr(""+o)+'"][type="radio"]'),o=0;o<d.length;o++){var p=d[o];if(p!==a&&p.form===a.form){var b=p[In]||null;if(!b)throw Error(r(90));Oy(p,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(o=0;o<d.length;o++)p=d[o],p.form===a.form&&aN(p)}break e;case"textarea":oN(a,d.value,d.defaultValue);break e;case"select":o=d.value,o!=null&&gl(a,!!d.multiple,o,!1)}}}var Py=!1;function fN(a,o,d){if(Py)return a(o,d);Py=!0;try{var p=a(o);return p}finally{if(Py=!1,(vl!==null||bl!==null)&&(xh(),vl&&(o=vl,a=bl,bl=vl=null,dN(o),a)))for(o=0;o<a.length;o++)dN(a[o])}}function ou(a,o){var d=a.stateNode;if(d===null)return null;var p=d[In]||null;if(p===null)return null;d=p[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":(p=!p.disabled)||(a=a.type,p=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!p;break e;default:a=!1}if(a)return null;if(d&&typeof d!="function")throw Error(r(231,o,typeof d));return d}var ea=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zy=!1;if(ea)try{var lu={};Object.defineProperty(lu,"passive",{get:function(){zy=!0}}),window.addEventListener("test",lu,lu),window.removeEventListener("test",lu,lu)}catch{zy=!1}var Ua=null,My=null,Mf=null;function hN(){if(Mf)return Mf;var a,o=My,d=o.length,p,b="value"in Ua?Ua.value:Ua.textContent,j=b.length;for(a=0;a<d&&o[a]===b[a];a++);var O=d-a;for(p=1;p<=O&&o[d-p]===b[j-p];p++);return Mf=b.slice(a,1<p?1-p:void 0)}function Rf(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 Df(){return!0}function pN(){return!1}function rr(a){function o(d,p,b,j,O){this._reactName=d,this._targetInst=b,this.type=p,this.nativeEvent=j,this.target=O,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)?Df:pN,this.isPropagationStopped=pN,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=Df)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=Df)},persist:function(){},isPersistent:Df}),o}var Vs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Lf=rr(Vs),cu=g({},Vs,{view:0,detail:0}),O4=rr(cu),Ry,Dy,uu,If=g({},cu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Iy,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!==uu&&(uu&&a.type==="mousemove"?(Ry=a.screenX-uu.screenX,Dy=a.screenY-uu.screenY):Dy=Ry=0,uu=a),Ry)},movementY:function(a){return"movementY"in a?a.movementY:Dy}}),mN=rr(If),k4=g({},If,{dataTransfer:0}),A4=rr(k4),E4=g({},cu,{relatedTarget:0}),Ly=rr(E4),T4=g({},Vs,{animationName:0,elapsedTime:0,pseudoElement:0}),P4=rr(T4),z4=g({},Vs,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),M4=rr(z4),R4=g({},Vs,{data:0}),gN=rr(R4),D4={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},L4={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"},I4={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $4(a){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(a):(a=I4[a])?!!o[a]:!1}function Iy(){return $4}var U4=g({},cu,{key:function(a){if(a.key){var o=D4[a.key]||a.key;if(o!=="Unidentified")return o}return a.type==="keypress"?(a=Rf(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?L4[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Iy,charCode:function(a){return a.type==="keypress"?Rf(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Rf(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),B4=rr(U4),q4=g({},If,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),yN=rr(q4),F4=g({},cu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Iy}),K4=rr(F4),H4=g({},Vs,{propertyName:0,elapsedTime:0,pseudoElement:0}),G4=rr(H4),V4=g({},If,{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}),Z4=rr(V4),Y4=g({},Vs,{newState:0,oldState:0}),W4=rr(Y4),Q4=[9,13,27,32],$y=ea&&"CompositionEvent"in window,du=null;ea&&"documentMode"in document&&(du=document.documentMode);var X4=ea&&"TextEvent"in window&&!du,vN=ea&&(!$y||du&&8<du&&11>=du),bN=" ",xN=!1;function wN(a,o){switch(a){case"keyup":return Q4.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function SN(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var xl=!1;function J4(a,o){switch(a){case"compositionend":return SN(o);case"keypress":return o.which!==32?null:(xN=!0,bN);case"textInput":return a=o.data,a===bN&&xN?null:a;default:return null}}function eU(a,o){if(xl)return a==="compositionend"||!$y&&wN(a,o)?(a=hN(),Mf=My=Ua=null,xl=!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 vN&&o.locale!=="ko"?null:o.data;default:return null}}var tU={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 jN(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o==="input"?!!tU[a.type]:o==="textarea"}function NN(a,o,d,p){vl?bl?bl.push(p):bl=[p]:vl=p,o=Oh(o,"onChange"),0<o.length&&(d=new Lf("onChange","change",null,d,p),a.push({event:d,listeners:o}))}var fu=null,hu=null;function nU(a){sO(a,0)}function $f(a){var o=He(a);if(aN(o))return a}function CN(a,o){if(a==="change")return o}var _N=!1;if(ea){var Uy;if(ea){var By="oninput"in document;if(!By){var ON=document.createElement("div");ON.setAttribute("oninput","return;"),By=typeof ON.oninput=="function"}Uy=By}else Uy=!1;_N=Uy&&(!document.documentMode||9<document.documentMode)}function kN(){fu&&(fu.detachEvent("onpropertychange",AN),hu=fu=null)}function AN(a){if(a.propertyName==="value"&&$f(hu)){var o=[];NN(o,hu,a,Ty(a)),fN(nU,o)}}function rU(a,o,d){a==="focusin"?(kN(),fu=o,hu=d,fu.attachEvent("onpropertychange",AN)):a==="focusout"&&kN()}function iU(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return $f(hu)}function aU(a,o){if(a==="click")return $f(o)}function sU(a,o){if(a==="input"||a==="change")return $f(o)}function oU(a,o){return a===o&&(a!==0||1/a===1/o)||a!==a&&o!==o}var gr=typeof Object.is=="function"?Object.is:oU;function pu(a,o){if(gr(a,o))return!0;if(typeof a!="object"||a===null||typeof o!="object"||o===null)return!1;var d=Object.keys(a),p=Object.keys(o);if(d.length!==p.length)return!1;for(p=0;p<d.length;p++){var b=d[p];if(!Gt.call(o,b)||!gr(a[b],o[b]))return!1}return!0}function EN(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function TN(a,o){var d=EN(a);a=0;for(var p;d;){if(d.nodeType===3){if(p=a+d.textContent.length,a<=o&&p>=o)return{node:d,offset:o-a};a=p}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=EN(d)}}function PN(a,o){return a&&o?a===o?!0:a&&a.nodeType===3?!1:o&&o.nodeType===3?PN(a,o.parentNode):"contains"in a?a.contains(o):a.compareDocumentPosition?!!(a.compareDocumentPosition(o)&16):!1:!1}function zN(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var o=Pf(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=Pf(a.document)}return o}function qy(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 lU=ea&&"documentMode"in document&&11>=document.documentMode,wl=null,Fy=null,mu=null,Ky=!1;function MN(a,o,d){var p=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;Ky||wl==null||wl!==Pf(p)||(p=wl,"selectionStart"in p&&qy(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),mu&&pu(mu,p)||(mu=p,p=Oh(Fy,"onSelect"),0<p.length&&(o=new Lf("onSelect","select",null,o,d),a.push({event:o,listeners:p}),o.target=wl)))}function Zs(a,o){var d={};return d[a.toLowerCase()]=o.toLowerCase(),d["Webkit"+a]="webkit"+o,d["Moz"+a]="moz"+o,d}var Sl={animationend:Zs("Animation","AnimationEnd"),animationiteration:Zs("Animation","AnimationIteration"),animationstart:Zs("Animation","AnimationStart"),transitionrun:Zs("Transition","TransitionRun"),transitionstart:Zs("Transition","TransitionStart"),transitioncancel:Zs("Transition","TransitionCancel"),transitionend:Zs("Transition","TransitionEnd")},Hy={},RN={};ea&&(RN=document.createElement("div").style,"AnimationEvent"in window||(delete Sl.animationend.animation,delete Sl.animationiteration.animation,delete Sl.animationstart.animation),"TransitionEvent"in window||delete Sl.transitionend.transition);function Ys(a){if(Hy[a])return Hy[a];if(!Sl[a])return a;var o=Sl[a],d;for(d in o)if(o.hasOwnProperty(d)&&d in RN)return Hy[a]=o[d];return a}var DN=Ys("animationend"),LN=Ys("animationiteration"),IN=Ys("animationstart"),cU=Ys("transitionrun"),uU=Ys("transitionstart"),dU=Ys("transitioncancel"),$N=Ys("transitionend"),UN=new Map,Gy="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(" ");Gy.push("scrollEnd");function si(a,o){UN.set(a,o),_i(o,[a])}var Uf=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)},zr=[],jl=0,Vy=0;function Bf(){for(var a=jl,o=Vy=jl=0;o<a;){var d=zr[o];zr[o++]=null;var p=zr[o];zr[o++]=null;var b=zr[o];zr[o++]=null;var j=zr[o];if(zr[o++]=null,p!==null&&b!==null){var O=p.pending;O===null?b.next=b:(b.next=O.next,O.next=b),p.pending=b}j!==0&&BN(d,b,j)}}function qf(a,o,d,p){zr[jl++]=a,zr[jl++]=o,zr[jl++]=d,zr[jl++]=p,Vy|=p,a.lanes|=p,a=a.alternate,a!==null&&(a.lanes|=p)}function Zy(a,o,d,p){return qf(a,o,d,p),Ff(a)}function Ws(a,o){return qf(a,null,null,o),Ff(a)}function BN(a,o,d){a.lanes|=d;var p=a.alternate;p!==null&&(p.lanes|=d);for(var b=!1,j=a.return;j!==null;)j.childLanes|=d,p=j.alternate,p!==null&&(p.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-xe(d),a=j.hiddenUpdates,p=a[b],p===null?a[b]=[o]:p.push(o),o.lane=d|536870912),j):null}function Ff(a){if(50<Lu)throw Lu=0,r0=null,Error(r(185));for(var o=a.return;o!==null;)a=o,o=a.return;return a.tag===3?a.stateNode:null}var Nl={};function fU(a,o,d,p){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=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yr(a,o,d,p){return new fU(a,o,d,p)}function Yy(a){return a=a.prototype,!(!a||!a.isReactComponent)}function ta(a,o){var d=a.alternate;return d===null?(d=yr(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 qN(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 Kf(a,o,d,p,b,j){var O=0;if(p=a,typeof a=="function")Yy(a)&&(O=1);else if(typeof a=="string")O=y6(a,d,Q.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case D:return a=yr(31,d,o,b),a.elementType=D,a.lanes=j,a;case S:return Qs(d.children,b,j,o);case N:O=8,b|=24;break;case C:return a=yr(12,d,o,b|2),a.elementType=C,a.lanes=j,a;case T:return a=yr(13,d,o,b),a.elementType=T,a.lanes=j,a;case P:return a=yr(19,d,o,b),a.elementType=P,a.lanes=j,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case k:O=10;break e;case A:O=9;break e;case _:O=11;break e;case E:O=14;break e;case z:O=16,p=null;break e}O=29,d=Error(r(130,a===null?"null":typeof a,"")),p=null}return o=yr(O,d,o,b),o.elementType=a,o.type=p,o.lanes=j,o}function Qs(a,o,d,p){return a=yr(7,a,p,o),a.lanes=d,a}function Wy(a,o,d){return a=yr(6,a,null,o),a.lanes=d,a}function FN(a){var o=yr(18,null,null,0);return o.stateNode=a,o}function Qy(a,o,d){return o=yr(4,a.children!==null?a.children:[],a.key,o),o.lanes=d,o.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},o}var KN=new WeakMap;function Mr(a,o){if(typeof a=="object"&&a!==null){var d=KN.get(a);return d!==void 0?d:(o={value:a,source:o,stack:dn(o)},KN.set(a,o),o)}return{value:a,source:o,stack:dn(o)}}var Cl=[],_l=0,Hf=null,gu=0,Rr=[],Dr=0,Ba=null,Oi=1,ki="";function na(a,o){Cl[_l++]=gu,Cl[_l++]=Hf,Hf=a,gu=o}function HN(a,o,d){Rr[Dr++]=Oi,Rr[Dr++]=ki,Rr[Dr++]=Ba,Ba=a;var p=Oi;a=ki;var b=32-xe(p)-1;p&=~(1<<b),d+=1;var j=32-xe(o)+b;if(30<j){var O=b-b%5;j=(p&(1<<O)-1).toString(32),p>>=O,b-=O,Oi=1<<32-xe(o)+b|d<<b|p,ki=j+a}else Oi=1<<j|d<<b|p,ki=a}function Xy(a){a.return!==null&&(na(a,1),HN(a,1,0))}function Jy(a){for(;a===Hf;)Hf=Cl[--_l],Cl[_l]=null,gu=Cl[--_l],Cl[_l]=null;for(;a===Ba;)Ba=Rr[--Dr],Rr[Dr]=null,ki=Rr[--Dr],Rr[Dr]=null,Oi=Rr[--Dr],Rr[Dr]=null}function GN(a,o){Rr[Dr++]=Oi,Rr[Dr++]=ki,Rr[Dr++]=Ba,Oi=o.id,ki=o.overflow,Ba=a}var On=null,At=null,tt=!1,qa=null,Lr=!1,ev=Error(r(519));function Fa(a){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw yu(Mr(o,a)),ev}function VN(a){var o=a.stateNode,d=a.type,p=a.memoizedProps;switch(o[ht]=a,o[In]=p,d){case"dialog":Ze("cancel",o),Ze("close",o);break;case"iframe":case"object":case"embed":Ze("load",o);break;case"video":case"audio":for(d=0;d<$u.length;d++)Ze($u[d],o);break;case"source":Ze("error",o);break;case"img":case"image":case"link":Ze("error",o),Ze("load",o);break;case"details":Ze("toggle",o);break;case"input":Ze("invalid",o),sN(o,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":Ze("invalid",o);break;case"textarea":Ze("invalid",o),lN(o,p.value,p.defaultValue,p.children)}d=p.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||o.textContent===""+d||p.suppressHydrationWarning===!0||uO(o.textContent,d)?(p.popover!=null&&(Ze("beforetoggle",o),Ze("toggle",o)),p.onScroll!=null&&Ze("scroll",o),p.onScrollEnd!=null&&Ze("scrollend",o),p.onClick!=null&&(o.onclick=Ji),o=!0):o=!1,o||Fa(a,!0)}function ZN(a){for(On=a.return;On;)switch(On.tag){case 5:case 31:case 13:Lr=!1;return;case 27:case 3:Lr=!0;return;default:On=On.return}}function Ol(a){if(a!==On)return!1;if(!tt)return ZN(a),tt=!0,!1;var o=a.tag,d;if((d=o!==3&&o!==27)&&((d=o===5)&&(d=a.type,d=!(d!=="form"&&d!=="button")||v0(a.type,a.memoizedProps)),d=!d),d&&At&&Fa(a),ZN(a),o===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));At=bO(a)}else if(o===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));At=bO(a)}else o===27?(o=At,rs(a.type)?(a=j0,j0=null,At=a):At=o):At=On?$r(a.stateNode.nextSibling):null;return!0}function Xs(){At=On=null,tt=!1}function tv(){var a=qa;return a!==null&&(or===null?or=a:or.push.apply(or,a),qa=null),a}function yu(a){qa===null?qa=[a]:qa.push(a)}var nv=R(null),Js=null,ra=null;function Ka(a,o,d){oe(nv,o._currentValue),o._currentValue=d}function ia(a){a._currentValue=nv.current,H(nv)}function rv(a,o,d){for(;a!==null;){var p=a.alternate;if((a.childLanes&o)!==o?(a.childLanes|=o,p!==null&&(p.childLanes|=o)):p!==null&&(p.childLanes&o)!==o&&(p.childLanes|=o),a===d)break;a=a.return}}function iv(a,o,d,p){var b=a.child;for(b!==null&&(b.return=a);b!==null;){var j=b.dependencies;if(j!==null){var O=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),rv(j.return,d,a),p||(O=null);break e}j=M.next}}else if(b.tag===18){if(O=b.return,O===null)throw Error(r(341));O.lanes|=d,j=O.alternate,j!==null&&(j.lanes|=d),rv(O,d,a),O=null}else O=b.child;if(O!==null)O.return=b;else for(O=b;O!==null;){if(O===a){O=null;break}if(b=O.sibling,b!==null){b.return=O.return,O=b;break}O=O.return}b=O}}function kl(a,o,d,p){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 O=b.alternate;if(O===null)throw Error(r(387));if(O=O.memoizedProps,O!==null){var M=b.type;gr(b.pendingProps.value,O.value)||(a!==null?a.push(M):a=[M])}}else if(b===le.current){if(O=b.alternate,O===null)throw Error(r(387));O.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(a!==null?a.push(Ku):a=[Ku])}b=b.return}a!==null&&iv(o,a,d,p),o.flags|=262144}function Gf(a){for(a=a.firstContext;a!==null;){if(!gr(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function eo(a){Js=a,ra=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function kn(a){return YN(Js,a)}function Vf(a,o){return Js===null&&eo(a),YN(a,o)}function YN(a,o){var d=o._currentValue;if(o={context:o,memoizedValue:d,next:null},ra===null){if(a===null)throw Error(r(308));ra=o,a.dependencies={lanes:0,firstContext:o},a.flags|=524288}else ra=ra.next=o;return d}var hU=typeof AbortController<"u"?AbortController:function(){var a=[],o=this.signal={aborted:!1,addEventListener:function(d,p){a.push(p)}};this.abort=function(){o.aborted=!0,a.forEach(function(d){return d()})}},pU=e.unstable_scheduleCallback,mU=e.unstable_NormalPriority,an={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function av(){return{controller:new hU,data:new Map,refCount:0}}function vu(a){a.refCount--,a.refCount===0&&pU(mU,function(){a.controller.abort()})}var bu=null,sv=0,Al=0,El=null;function gU(a,o){if(bu===null){var d=bu=[];sv=0,Al=c0(),El={status:"pending",value:void 0,then:function(p){d.push(p)}}}return sv++,o.then(WN,WN),o}function WN(){if(--sv===0&&bu!==null){El!==null&&(El.status="fulfilled");var a=bu;bu=null,Al=0,El=null;for(var o=0;o<a.length;o++)(0,a[o])()}}function yU(a,o){var d=[],p={status:"pending",value:null,reason:null,then:function(b){d.push(b)}};return a.then(function(){p.status="fulfilled",p.value=o;for(var b=0;b<d.length;b++)(0,d[b])(o)},function(b){for(p.status="rejected",p.reason=b,b=0;b<d.length;b++)(0,d[b])(void 0)}),p}var QN=G.S;G.S=function(a,o){M_=et(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&gU(a,o),QN!==null&&QN(a,o)};var to=R(null);function ov(){var a=to.current;return a!==null?a:Ct.pooledCache}function Zf(a,o){o===null?oe(to,to.current):oe(to,o.pool)}function XN(){var a=ov();return a===null?null:{parent:an._currentValue,pool:a}}var Tl=Error(r(460)),lv=Error(r(474)),Yf=Error(r(542)),Wf={then:function(){}};function JN(a){return a=a.status,a==="fulfilled"||a==="rejected"}function eC(a,o,d){switch(d=a[d],d===void 0?a.push(o):d!==o&&(o.then(Ji,Ji),o=d),o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,nC(a),a;default:if(typeof o.status=="string")o.then(Ji,Ji);else{if(a=Ct,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=o,a.status="pending",a.then(function(p){if(o.status==="pending"){var b=o;b.status="fulfilled",b.value=p}},function(p){if(o.status==="pending"){var b=o;b.status="rejected",b.reason=p}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,nC(a),a}throw ro=o,Tl}}function no(a){try{var o=a._init;return o(a._payload)}catch(d){throw d!==null&&typeof d=="object"&&typeof d.then=="function"?(ro=d,Tl):d}}var ro=null;function tC(){if(ro===null)throw Error(r(459));var a=ro;return ro=null,a}function nC(a){if(a===Tl||a===Yf)throw Error(r(483))}var Pl=null,xu=0;function Qf(a){var o=xu;return xu+=1,Pl===null&&(Pl=[]),eC(Pl,a,o)}function wu(a,o){o=o.props.ref,a.ref=o!==void 0?o:null}function Xf(a,o){throw o.$$typeof===y?Error(r(525)):(a=Object.prototype.toString.call(o),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":a)))}function rC(a){function o(Y,q){if(a){var J=Y.deletions;J===null?(Y.deletions=[q],Y.flags|=16):J.push(q)}}function d(Y,q){if(!a)return null;for(;q!==null;)o(Y,q),q=q.sibling;return null}function p(Y){for(var q=new Map;Y!==null;)Y.key!==null?q.set(Y.key,Y):q.set(Y.index,Y),Y=Y.sibling;return q}function b(Y,q){return Y=ta(Y,q),Y.index=0,Y.sibling=null,Y}function j(Y,q,J){return Y.index=J,a?(J=Y.alternate,J!==null?(J=J.index,J<q?(Y.flags|=67108866,q):J):(Y.flags|=67108866,q)):(Y.flags|=1048576,q)}function O(Y){return a&&Y.alternate===null&&(Y.flags|=67108866),Y}function M(Y,q,J,ue){return q===null||q.tag!==6?(q=Wy(J,Y.mode,ue),q.return=Y,q):(q=b(q,J),q.return=Y,q)}function $(Y,q,J,ue){var De=J.type;return De===S?se(Y,q,J.props.children,ue,J.key):q!==null&&(q.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===z&&no(De)===q.type)?(q=b(q,J.props),wu(q,J),q.return=Y,q):(q=Kf(J.type,J.key,J.props,null,Y.mode,ue),wu(q,J),q.return=Y,q)}function ee(Y,q,J,ue){return q===null||q.tag!==4||q.stateNode.containerInfo!==J.containerInfo||q.stateNode.implementation!==J.implementation?(q=Qy(J,Y.mode,ue),q.return=Y,q):(q=b(q,J.children||[]),q.return=Y,q)}function se(Y,q,J,ue,De){return q===null||q.tag!==7?(q=Qs(J,Y.mode,ue,De),q.return=Y,q):(q=b(q,J),q.return=Y,q)}function fe(Y,q,J){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=Wy(""+q,Y.mode,J),q.return=Y,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case v:return J=Kf(q.type,q.key,q.props,null,Y.mode,J),wu(J,q),J.return=Y,J;case w:return q=Qy(q,Y.mode,J),q.return=Y,q;case z:return q=no(q),fe(Y,q,J)}if(me(q)||I(q))return q=Qs(q,Y.mode,J,null),q.return=Y,q;if(typeof q.then=="function")return fe(Y,Qf(q),J);if(q.$$typeof===k)return fe(Y,Vf(Y,q),J);Xf(Y,q)}return null}function te(Y,q,J,ue){var De=q!==null?q.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return De!==null?null:M(Y,q,""+J,ue);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case v:return J.key===De?$(Y,q,J,ue):null;case w:return J.key===De?ee(Y,q,J,ue):null;case z:return J=no(J),te(Y,q,J,ue)}if(me(J)||I(J))return De!==null?null:se(Y,q,J,ue,null);if(typeof J.then=="function")return te(Y,q,Qf(J),ue);if(J.$$typeof===k)return te(Y,q,Vf(Y,J),ue);Xf(Y,J)}return null}function ie(Y,q,J,ue,De){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return Y=Y.get(J)||null,M(q,Y,""+ue,De);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case v:return Y=Y.get(ue.key===null?J:ue.key)||null,$(q,Y,ue,De);case w:return Y=Y.get(ue.key===null?J:ue.key)||null,ee(q,Y,ue,De);case z:return ue=no(ue),ie(Y,q,J,ue,De)}if(me(ue)||I(ue))return Y=Y.get(J)||null,se(q,Y,ue,De,null);if(typeof ue.then=="function")return ie(Y,q,J,Qf(ue),De);if(ue.$$typeof===k)return ie(Y,q,J,Vf(q,ue),De);Xf(q,ue)}return null}function Oe(Y,q,J,ue){for(var De=null,ot=null,Te=q,Fe=q=0,Qe=null;Te!==null&&Fe<J.length;Fe++){Te.index>Fe?(Qe=Te,Te=null):Qe=Te.sibling;var lt=te(Y,Te,J[Fe],ue);if(lt===null){Te===null&&(Te=Qe);break}a&&Te&&lt.alternate===null&&o(Y,Te),q=j(lt,q,Fe),ot===null?De=lt:ot.sibling=lt,ot=lt,Te=Qe}if(Fe===J.length)return d(Y,Te),tt&&na(Y,Fe),De;if(Te===null){for(;Fe<J.length;Fe++)Te=fe(Y,J[Fe],ue),Te!==null&&(q=j(Te,q,Fe),ot===null?De=Te:ot.sibling=Te,ot=Te);return tt&&na(Y,Fe),De}for(Te=p(Te);Fe<J.length;Fe++)Qe=ie(Te,Y,Fe,J[Fe],ue),Qe!==null&&(a&&Qe.alternate!==null&&Te.delete(Qe.key===null?Fe:Qe.key),q=j(Qe,q,Fe),ot===null?De=Qe:ot.sibling=Qe,ot=Qe);return a&&Te.forEach(function(ls){return o(Y,ls)}),tt&&na(Y,Fe),De}function Ie(Y,q,J,ue){if(J==null)throw Error(r(151));for(var De=null,ot=null,Te=q,Fe=q=0,Qe=null,lt=J.next();Te!==null&&!lt.done;Fe++,lt=J.next()){Te.index>Fe?(Qe=Te,Te=null):Qe=Te.sibling;var ls=te(Y,Te,lt.value,ue);if(ls===null){Te===null&&(Te=Qe);break}a&&Te&&ls.alternate===null&&o(Y,Te),q=j(ls,q,Fe),ot===null?De=ls:ot.sibling=ls,ot=ls,Te=Qe}if(lt.done)return d(Y,Te),tt&&na(Y,Fe),De;if(Te===null){for(;!lt.done;Fe++,lt=J.next())lt=fe(Y,lt.value,ue),lt!==null&&(q=j(lt,q,Fe),ot===null?De=lt:ot.sibling=lt,ot=lt);return tt&&na(Y,Fe),De}for(Te=p(Te);!lt.done;Fe++,lt=J.next())lt=ie(Te,Y,Fe,lt.value,ue),lt!==null&&(a&&lt.alternate!==null&&Te.delete(lt.key===null?Fe:lt.key),q=j(lt,q,Fe),ot===null?De=lt:ot.sibling=lt,ot=lt);return a&&Te.forEach(function(k6){return o(Y,k6)}),tt&&na(Y,Fe),De}function jt(Y,q,J,ue){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 v:e:{for(var De=J.key;q!==null;){if(q.key===De){if(De=J.type,De===S){if(q.tag===7){d(Y,q.sibling),ue=b(q,J.props.children),ue.return=Y,Y=ue;break e}}else if(q.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===z&&no(De)===q.type){d(Y,q.sibling),ue=b(q,J.props),wu(ue,J),ue.return=Y,Y=ue;break e}d(Y,q);break}else o(Y,q);q=q.sibling}J.type===S?(ue=Qs(J.props.children,Y.mode,ue,J.key),ue.return=Y,Y=ue):(ue=Kf(J.type,J.key,J.props,null,Y.mode,ue),wu(ue,J),ue.return=Y,Y=ue)}return O(Y);case w:e:{for(De=J.key;q!==null;){if(q.key===De)if(q.tag===4&&q.stateNode.containerInfo===J.containerInfo&&q.stateNode.implementation===J.implementation){d(Y,q.sibling),ue=b(q,J.children||[]),ue.return=Y,Y=ue;break e}else{d(Y,q);break}else o(Y,q);q=q.sibling}ue=Qy(J,Y.mode,ue),ue.return=Y,Y=ue}return O(Y);case z:return J=no(J),jt(Y,q,J,ue)}if(me(J))return Oe(Y,q,J,ue);if(I(J)){if(De=I(J),typeof De!="function")throw Error(r(150));return J=De.call(J),Ie(Y,q,J,ue)}if(typeof J.then=="function")return jt(Y,q,Qf(J),ue);if(J.$$typeof===k)return jt(Y,q,Vf(Y,J),ue);Xf(Y,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,q!==null&&q.tag===6?(d(Y,q.sibling),ue=b(q,J),ue.return=Y,Y=ue):(d(Y,q),ue=Wy(J,Y.mode,ue),ue.return=Y,Y=ue),O(Y)):d(Y,q)}return function(Y,q,J,ue){try{xu=0;var De=jt(Y,q,J,ue);return Pl=null,De}catch(Te){if(Te===Tl||Te===Yf)throw Te;var ot=yr(29,Te,null,Y.mode);return ot.lanes=ue,ot.return=Y,ot}}}var io=rC(!0),iC=rC(!1),Ha=!1;function cv(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function uv(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 Ga(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Va(a,o,d){var p=a.updateQueue;if(p===null)return null;if(p=p.shared,(dt&2)!==0){var b=p.pending;return b===null?o.next=o:(o.next=b.next,b.next=o),p.pending=o,o=Ff(a),BN(a,null,d),o}return qf(a,p,o,d),Ff(a)}function Su(a,o,d){if(o=o.updateQueue,o!==null&&(o=o.shared,(d&4194048)!==0)){var p=o.lanes;p&=a.pendingLanes,d|=p,o.lanes=d,we(a,d)}}function dv(a,o){var d=a.updateQueue,p=a.alternate;if(p!==null&&(p=p.updateQueue,d===p)){var b=null,j=null;if(d=d.firstBaseUpdate,d!==null){do{var O={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};j===null?b=j=O:j=j.next=O,d=d.next}while(d!==null);j===null?b=j=o:j=j.next=o}else b=j=o;d={baseState:p.baseState,firstBaseUpdate:b,lastBaseUpdate:j,shared:p.shared,callbacks:p.callbacks},a.updateQueue=d;return}a=d.lastBaseUpdate,a===null?d.firstBaseUpdate=o:a.next=o,d.lastBaseUpdate=o}var fv=!1;function ju(){if(fv){var a=El;if(a!==null)throw a}}function Nu(a,o,d,p){fv=!1;var b=a.updateQueue;Ha=!1;var j=b.firstBaseUpdate,O=b.lastBaseUpdate,M=b.shared.pending;if(M!==null){b.shared.pending=null;var $=M,ee=$.next;$.next=null,O===null?j=ee:O.next=ee,O=$;var se=a.alternate;se!==null&&(se=se.updateQueue,M=se.lastBaseUpdate,M!==O&&(M===null?se.firstBaseUpdate=ee:M.next=ee,se.lastBaseUpdate=$))}if(j!==null){var fe=b.baseState;O=0,se=ee=$=null,M=j;do{var te=M.lane&-536870913,ie=te!==M.lane;if(ie?(We&te)===te:(p&te)===te){te!==0&&te===Al&&(fv=!0),se!==null&&(se=se.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var Oe=a,Ie=M;te=o;var jt=d;switch(Ie.tag){case 1:if(Oe=Ie.payload,typeof Oe=="function"){fe=Oe.call(jt,fe,te);break e}fe=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=Ie.payload,te=typeof Oe=="function"?Oe.call(jt,fe,te):Oe,te==null)break e;fe=g({},fe,te);break e;case 2:Ha=!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,O|=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),Xa|=O,a.lanes=O,a.memoizedState=fe}}function aC(a,o){if(typeof a!="function")throw Error(r(191,a));a.call(o)}function sC(a,o){var d=a.callbacks;if(d!==null)for(a.callbacks=null,a=0;a<d.length;a++)aC(d[a],o)}var zl=R(null),Jf=R(0);function oC(a,o){a=ha,oe(Jf,a),oe(zl,o),ha=a|o.baseLanes}function hv(){oe(Jf,ha),oe(zl,zl.current)}function pv(){ha=Jf.current,H(zl),H(Jf)}var vr=R(null),Ir=null;function Za(a){var o=a.alternate;oe(Xt,Xt.current&1),oe(vr,a),Ir===null&&(o===null||zl.current!==null||o.memoizedState!==null)&&(Ir=a)}function mv(a){oe(Xt,Xt.current),oe(vr,a),Ir===null&&(Ir=a)}function lC(a){a.tag===22?(oe(Xt,Xt.current),oe(vr,a),Ir===null&&(Ir=a)):Ya()}function Ya(){oe(Xt,Xt.current),oe(vr,vr.current)}function br(a){H(vr),Ir===a&&(Ir=null),H(Xt)}var Xt=R(0);function eh(a){for(var o=a;o!==null;){if(o.tag===13){var d=o.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||w0(d)||S0(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 aa=0,qe=null,wt=null,sn=null,th=!1,Ml=!1,ao=!1,nh=0,Cu=0,Rl=null,vU=0;function Vt(){throw Error(r(321))}function gv(a,o){if(o===null)return!1;for(var d=0;d<o.length&&d<a.length;d++)if(!gr(a[d],o[d]))return!1;return!0}function yv(a,o,d,p,b,j){return aa=j,qe=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,G.H=a===null||a.memoizedState===null?HC:Pv,ao=!1,j=d(p,b),ao=!1,Ml&&(j=uC(o,d,p,b)),cC(a),j}function cC(a){G.H=ku;var o=wt!==null&&wt.next!==null;if(aa=0,sn=wt=qe=null,th=!1,Cu=0,Rl=null,o)throw Error(r(300));a===null||on||(a=a.dependencies,a!==null&&Gf(a)&&(on=!0))}function uC(a,o,d,p){qe=a;var b=0;do{if(Ml&&(Rl=null),Cu=0,Ml=!1,25<=b)throw Error(r(301));if(b+=1,sn=wt=null,a.updateQueue!=null){var j=a.updateQueue;j.lastEffect=null,j.events=null,j.stores=null,j.memoCache!=null&&(j.memoCache.index=0)}G.H=GC,j=o(d,p)}while(Ml);return j}function bU(){var a=G.H,o=a.useState()[0];return o=typeof o.then=="function"?_u(o):o,a=a.useState()[0],(wt!==null?wt.memoizedState:null)!==a&&(qe.flags|=1024),o}function vv(){var a=nh!==0;return nh=0,a}function bv(a,o,d){o.updateQueue=a.updateQueue,o.flags&=-2053,a.lanes&=~d}function xv(a){if(th){for(a=a.memoizedState;a!==null;){var o=a.queue;o!==null&&(o.pending=null),a=a.next}th=!1}aa=0,sn=wt=qe=null,Ml=!1,Cu=nh=0,Rl=null}function Gn(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return sn===null?qe.memoizedState=sn=a:sn=sn.next=a,sn}function Jt(){if(wt===null){var a=qe.alternate;a=a!==null?a.memoizedState:null}else a=wt.next;var o=sn===null?qe.memoizedState:sn.next;if(o!==null)sn=o,wt=a;else{if(a===null)throw qe.alternate===null?Error(r(467)):Error(r(310));wt=a,a={memoizedState:wt.memoizedState,baseState:wt.baseState,baseQueue:wt.baseQueue,queue:wt.queue,next:null},sn===null?qe.memoizedState=sn=a:sn=sn.next=a}return sn}function rh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function _u(a){var o=Cu;return Cu+=1,Rl===null&&(Rl=[]),a=eC(Rl,a,o),o=qe,(sn===null?o.memoizedState:sn.next)===null&&(o=o.alternate,G.H=o===null||o.memoizedState===null?HC:Pv),a}function ih(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return _u(a);if(a.$$typeof===k)return kn(a)}throw Error(r(438,String(a)))}function wv(a){var o=null,d=qe.updateQueue;if(d!==null&&(o=d.memoCache),o==null){var p=qe.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(o={data:p.data.map(function(b){return b.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),d===null&&(d=rh(),qe.updateQueue=d),d.memoCache=o,d=o.data[o.index],d===void 0)for(d=o.data[o.index]=Array(a),p=0;p<a;p++)d[p]=F;return o.index++,d}function sa(a,o){return typeof o=="function"?o(a):o}function ah(a){var o=Jt();return Sv(o,wt,a)}function Sv(a,o,d){var p=a.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=d;var b=a.baseQueue,j=p.pending;if(j!==null){if(b!==null){var O=b.next;b.next=j.next,j.next=O}o.baseQueue=b=j,p.pending=null}if(j=a.baseState,b===null)a.memoizedState=j;else{o=b.next;var M=O=null,$=null,ee=o,se=!1;do{var fe=ee.lane&-536870913;if(fe!==ee.lane?(We&fe)===fe:(aa&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===Al&&(se=!0);else if((aa&te)===te){ee=ee.next,te===Al&&(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,O=j):$=$.next=fe,qe.lanes|=te,Xa|=te;fe=ee.action,ao&&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,O=j):$=$.next=te,qe.lanes|=fe,Xa|=fe;ee=ee.next}while(ee!==null&&ee!==o);if($===null?O=j:$.next=M,!gr(j,a.memoizedState)&&(on=!0,se&&(d=El,d!==null)))throw d;a.memoizedState=j,a.baseState=O,a.baseQueue=$,p.lastRenderedState=j}return b===null&&(p.lanes=0),[a.memoizedState,p.dispatch]}function jv(a){var o=Jt(),d=o.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=a;var p=d.dispatch,b=d.pending,j=o.memoizedState;if(b!==null){d.pending=null;var O=b=b.next;do j=a(j,O.action),O=O.next;while(O!==b);gr(j,o.memoizedState)||(on=!0),o.memoizedState=j,o.baseQueue===null&&(o.baseState=j),d.lastRenderedState=j}return[j,p]}function dC(a,o,d){var p=qe,b=Jt(),j=tt;if(j){if(d===void 0)throw Error(r(407));d=d()}else d=o();var O=!gr((wt||b).memoizedState,d);if(O&&(b.memoizedState=d,on=!0),b=b.queue,_v(pC.bind(null,p,b,a),[a]),b.getSnapshot!==o||O||sn!==null&&sn.memoizedState.tag&1){if(p.flags|=2048,Dl(9,{destroy:void 0},hC.bind(null,p,b,d,o),null),Ct===null)throw Error(r(349));j||(aa&127)!==0||fC(p,o,d)}return d}function fC(a,o,d){a.flags|=16384,a={getSnapshot:o,value:d},o=qe.updateQueue,o===null?(o=rh(),qe.updateQueue=o,o.stores=[a]):(d=o.stores,d===null?o.stores=[a]:d.push(a))}function hC(a,o,d,p){o.value=d,o.getSnapshot=p,mC(o)&&gC(a)}function pC(a,o,d){return d(function(){mC(o)&&gC(a)})}function mC(a){var o=a.getSnapshot;a=a.value;try{var d=o();return!gr(a,d)}catch{return!0}}function gC(a){var o=Ws(a,2);o!==null&&lr(o,a,2)}function Nv(a){var o=Gn();if(typeof a=="function"){var d=a;if(a=d(),ao){nr(!0);try{d()}finally{nr(!1)}}}return o.memoizedState=o.baseState=a,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:a},o}function yC(a,o,d,p){return a.baseState=d,Sv(a,wt,typeof p=="function"?p:sa)}function xU(a,o,d,p,b){if(lh(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(O){j.listeners.push(O)}};G.T!==null?d(!0):j.isTransition=!1,p(j),d=o.pending,d===null?(j.next=o.pending=j,vC(o,j)):(j.next=d.next,o.pending=d.next=j)}}function vC(a,o){var d=o.action,p=o.payload,b=a.state;if(o.isTransition){var j=G.T,O={};G.T=O;try{var M=d(b,p),$=G.S;$!==null&&$(O,M),bC(a,o,M)}catch(ee){Cv(a,o,ee)}finally{j!==null&&O.types!==null&&(j.types=O.types),G.T=j}}else try{j=d(b,p),bC(a,o,j)}catch(ee){Cv(a,o,ee)}}function bC(a,o,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(p){xC(a,o,p)},function(p){return Cv(a,o,p)}):xC(a,o,d)}function xC(a,o,d){o.status="fulfilled",o.value=d,wC(o),a.state=d,o=a.pending,o!==null&&(d=o.next,d===o?a.pending=null:(d=d.next,o.next=d,vC(a,d)))}function Cv(a,o,d){var p=a.pending;if(a.pending=null,p!==null){p=p.next;do o.status="rejected",o.reason=d,wC(o),o=o.next;while(o!==p)}a.action=null}function wC(a){a=a.listeners;for(var o=0;o<a.length;o++)(0,a[o])()}function SC(a,o){return o}function jC(a,o){if(tt){var d=Ct.formState;if(d!==null){e:{var p=qe;if(tt){if(At){t:{for(var b=At,j=Lr;b.nodeType!==8;){if(!j){b=null;break t}if(b=$r(b.nextSibling),b===null){b=null;break t}}j=b.data,b=j==="F!"||j==="F"?b:null}if(b){At=$r(b.nextSibling),p=b.data==="F!";break e}}Fa(p)}p=!1}p&&(o=d[0])}}return d=Gn(),d.memoizedState=d.baseState=o,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:SC,lastRenderedState:o},d.queue=p,d=qC.bind(null,qe,p),p.dispatch=d,p=Nv(!1),j=Tv.bind(null,qe,!1,p.queue),p=Gn(),b={state:o,dispatch:null,action:a,pending:null},p.queue=b,d=xU.bind(null,qe,b,j,d),b.dispatch=d,p.memoizedState=a,[o,d,!1]}function NC(a){var o=Jt();return CC(o,wt,a)}function CC(a,o,d){if(o=Sv(a,o,SC)[0],a=ah(sa)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var p=_u(o)}catch(O){throw O===Tl?Yf:O}else p=o;o=Jt();var b=o.queue,j=b.dispatch;return d!==o.memoizedState&&(qe.flags|=2048,Dl(9,{destroy:void 0},wU.bind(null,b,d),null)),[p,j,a]}function wU(a,o){a.action=o}function _C(a){var o=Jt(),d=wt;if(d!==null)return CC(o,d,a);Jt(),o=o.memoizedState,d=Jt();var p=d.queue.dispatch;return d.memoizedState=a,[o,p,!1]}function Dl(a,o,d,p){return a={tag:a,create:d,deps:p,inst:o,next:null},o=qe.updateQueue,o===null&&(o=rh(),qe.updateQueue=o),d=o.lastEffect,d===null?o.lastEffect=a.next=a:(p=d.next,d.next=a,a.next=p,o.lastEffect=a),a}function OC(){return Jt().memoizedState}function sh(a,o,d,p){var b=Gn();qe.flags|=a,b.memoizedState=Dl(1|o,{destroy:void 0},d,p===void 0?null:p)}function oh(a,o,d,p){var b=Jt();p=p===void 0?null:p;var j=b.memoizedState.inst;wt!==null&&p!==null&&gv(p,wt.memoizedState.deps)?b.memoizedState=Dl(o,j,d,p):(qe.flags|=a,b.memoizedState=Dl(1|o,j,d,p))}function kC(a,o){sh(8390656,8,a,o)}function _v(a,o){oh(2048,8,a,o)}function SU(a){qe.flags|=4;var o=qe.updateQueue;if(o===null)o=rh(),qe.updateQueue=o,o.events=[a];else{var d=o.events;d===null?o.events=[a]:d.push(a)}}function AC(a){var o=Jt().memoizedState;return SU({ref:o,nextImpl:a}),function(){if((dt&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function EC(a,o){return oh(4,2,a,o)}function TC(a,o){return oh(4,4,a,o)}function PC(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 zC(a,o,d){d=d!=null?d.concat([a]):null,oh(4,4,PC.bind(null,o,a),d)}function Ov(){}function MC(a,o){var d=Jt();o=o===void 0?null:o;var p=d.memoizedState;return o!==null&&gv(o,p[1])?p[0]:(d.memoizedState=[a,o],a)}function RC(a,o){var d=Jt();o=o===void 0?null:o;var p=d.memoizedState;if(o!==null&&gv(o,p[1]))return p[0];if(p=a(),ao){nr(!0);try{a()}finally{nr(!1)}}return d.memoizedState=[p,o],p}function kv(a,o,d){return d===void 0||(aa&1073741824)!==0&&(We&261930)===0?a.memoizedState=o:(a.memoizedState=d,a=D_(),qe.lanes|=a,Xa|=a,d)}function DC(a,o,d,p){return gr(d,o)?d:zl.current!==null?(a=kv(a,d,p),gr(a,o)||(on=!0),a):(aa&42)===0||(aa&1073741824)!==0&&(We&261930)===0?(on=!0,a.memoizedState=d):(a=D_(),qe.lanes|=a,Xa|=a,o)}function LC(a,o,d,p,b){var j=re.p;re.p=j!==0&&8>j?j:8;var O=G.T,M={};G.T=M,Tv(a,!1,o,d);try{var $=b(),ee=G.S;if(ee!==null&&ee(M,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var se=yU($,p);Ou(a,o,se,Sr(a))}else Ou(a,o,p,Sr(a))}catch(fe){Ou(a,o,{then:function(){},status:"rejected",reason:fe},Sr())}finally{re.p=j,O!==null&&M.types!==null&&(O.types=M.types),G.T=O}}function jU(){}function Av(a,o,d,p){if(a.tag!==5)throw Error(r(476));var b=IC(a).queue;LC(a,b,o,ge,d===null?jU:function(){return $C(a),d(p)})}function IC(a){var o=a.memoizedState;if(o!==null)return o;o={memoizedState:ge,baseState:ge,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:ge},next:null};var d={};return o.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:d},next:null},a.memoizedState=o,a=a.alternate,a!==null&&(a.memoizedState=o),o}function $C(a){var o=IC(a);o.next===null&&(o=a.alternate.memoizedState),Ou(a,o.next.queue,{},Sr())}function Ev(){return kn(Ku)}function UC(){return Jt().memoizedState}function BC(){return Jt().memoizedState}function NU(a){for(var o=a.return;o!==null;){switch(o.tag){case 24:case 3:var d=Sr();a=Ga(d);var p=Va(o,a,d);p!==null&&(lr(p,o,d),Su(p,o,d)),o={cache:av()},a.payload=o;return}o=o.return}}function CU(a,o,d){var p=Sr();d={lane:p,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},lh(a)?FC(o,d):(d=Zy(a,o,d,p),d!==null&&(lr(d,a,p),KC(d,o,p)))}function qC(a,o,d){var p=Sr();Ou(a,o,d,p)}function Ou(a,o,d,p){var b={lane:p,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null};if(lh(a))FC(o,b);else{var j=a.alternate;if(a.lanes===0&&(j===null||j.lanes===0)&&(j=o.lastRenderedReducer,j!==null))try{var O=o.lastRenderedState,M=j(O,d);if(b.hasEagerState=!0,b.eagerState=M,gr(M,O))return qf(a,o,b,0),Ct===null&&Bf(),!1}catch{}if(d=Zy(a,o,b,p),d!==null)return lr(d,a,p),KC(d,o,p),!0}return!1}function Tv(a,o,d,p){if(p={lane:2,revertLane:c0(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},lh(a)){if(o)throw Error(r(479))}else o=Zy(a,d,p,2),o!==null&&lr(o,a,2)}function lh(a){var o=a.alternate;return a===qe||o!==null&&o===qe}function FC(a,o){Ml=th=!0;var d=a.pending;d===null?o.next=o:(o.next=d.next,d.next=o),a.pending=o}function KC(a,o,d){if((d&4194048)!==0){var p=o.lanes;p&=a.pendingLanes,d|=p,o.lanes=d,we(a,d)}}var ku={readContext:kn,use:ih,useCallback:Vt,useContext:Vt,useEffect:Vt,useImperativeHandle:Vt,useLayoutEffect:Vt,useInsertionEffect:Vt,useMemo:Vt,useReducer:Vt,useRef:Vt,useState:Vt,useDebugValue:Vt,useDeferredValue:Vt,useTransition:Vt,useSyncExternalStore:Vt,useId:Vt,useHostTransitionStatus:Vt,useFormState:Vt,useActionState:Vt,useOptimistic:Vt,useMemoCache:Vt,useCacheRefresh:Vt};ku.useEffectEvent=Vt;var HC={readContext:kn,use:ih,useCallback:function(a,o){return Gn().memoizedState=[a,o===void 0?null:o],a},useContext:kn,useEffect:kC,useImperativeHandle:function(a,o,d){d=d!=null?d.concat([a]):null,sh(4194308,4,PC.bind(null,o,a),d)},useLayoutEffect:function(a,o){return sh(4194308,4,a,o)},useInsertionEffect:function(a,o){sh(4,2,a,o)},useMemo:function(a,o){var d=Gn();o=o===void 0?null:o;var p=a();if(ao){nr(!0);try{a()}finally{nr(!1)}}return d.memoizedState=[p,o],p},useReducer:function(a,o,d){var p=Gn();if(d!==void 0){var b=d(o);if(ao){nr(!0);try{d(o)}finally{nr(!1)}}}else b=o;return p.memoizedState=p.baseState=b,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b},p.queue=a,a=a.dispatch=CU.bind(null,qe,a),[p.memoizedState,a]},useRef:function(a){var o=Gn();return a={current:a},o.memoizedState=a},useState:function(a){a=Nv(a);var o=a.queue,d=qC.bind(null,qe,o);return o.dispatch=d,[a.memoizedState,d]},useDebugValue:Ov,useDeferredValue:function(a,o){var d=Gn();return kv(d,a,o)},useTransition:function(){var a=Nv(!1);return a=LC.bind(null,qe,a.queue,!0,!1),Gn().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,o,d){var p=qe,b=Gn();if(tt){if(d===void 0)throw Error(r(407));d=d()}else{if(d=o(),Ct===null)throw Error(r(349));(We&127)!==0||fC(p,o,d)}b.memoizedState=d;var j={value:d,getSnapshot:o};return b.queue=j,kC(pC.bind(null,p,j,a),[a]),p.flags|=2048,Dl(9,{destroy:void 0},hC.bind(null,p,j,d,o),null),d},useId:function(){var a=Gn(),o=Ct.identifierPrefix;if(tt){var d=ki,p=Oi;d=(p&~(1<<32-xe(p)-1)).toString(32)+d,o="_"+o+"R_"+d,d=nh++,0<d&&(o+="H"+d.toString(32)),o+="_"}else d=vU++,o="_"+o+"r_"+d.toString(32)+"_";return a.memoizedState=o},useHostTransitionStatus:Ev,useFormState:jC,useActionState:jC,useOptimistic:function(a){var o=Gn();o.memoizedState=o.baseState=a;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=d,o=Tv.bind(null,qe,!0,d),d.dispatch=o,[a,o]},useMemoCache:wv,useCacheRefresh:function(){return Gn().memoizedState=NU.bind(null,qe)},useEffectEvent:function(a){var o=Gn(),d={impl:a};return o.memoizedState=d,function(){if((dt&2)!==0)throw Error(r(440));return d.impl.apply(void 0,arguments)}}},Pv={readContext:kn,use:ih,useCallback:MC,useContext:kn,useEffect:_v,useImperativeHandle:zC,useInsertionEffect:EC,useLayoutEffect:TC,useMemo:RC,useReducer:ah,useRef:OC,useState:function(){return ah(sa)},useDebugValue:Ov,useDeferredValue:function(a,o){var d=Jt();return DC(d,wt.memoizedState,a,o)},useTransition:function(){var a=ah(sa)[0],o=Jt().memoizedState;return[typeof a=="boolean"?a:_u(a),o]},useSyncExternalStore:dC,useId:UC,useHostTransitionStatus:Ev,useFormState:NC,useActionState:NC,useOptimistic:function(a,o){var d=Jt();return yC(d,wt,a,o)},useMemoCache:wv,useCacheRefresh:BC};Pv.useEffectEvent=AC;var GC={readContext:kn,use:ih,useCallback:MC,useContext:kn,useEffect:_v,useImperativeHandle:zC,useInsertionEffect:EC,useLayoutEffect:TC,useMemo:RC,useReducer:jv,useRef:OC,useState:function(){return jv(sa)},useDebugValue:Ov,useDeferredValue:function(a,o){var d=Jt();return wt===null?kv(d,a,o):DC(d,wt.memoizedState,a,o)},useTransition:function(){var a=jv(sa)[0],o=Jt().memoizedState;return[typeof a=="boolean"?a:_u(a),o]},useSyncExternalStore:dC,useId:UC,useHostTransitionStatus:Ev,useFormState:_C,useActionState:_C,useOptimistic:function(a,o){var d=Jt();return wt!==null?yC(d,wt,a,o):(d.baseState=a,[a,d.queue.dispatch])},useMemoCache:wv,useCacheRefresh:BC};GC.useEffectEvent=AC;function zv(a,o,d,p){o=a.memoizedState,d=d(p,o),d=d==null?o:g({},o,d),a.memoizedState=d,a.lanes===0&&(a.updateQueue.baseState=d)}var Mv={enqueueSetState:function(a,o,d){a=a._reactInternals;var p=Sr(),b=Ga(p);b.payload=o,d!=null&&(b.callback=d),o=Va(a,b,p),o!==null&&(lr(o,a,p),Su(o,a,p))},enqueueReplaceState:function(a,o,d){a=a._reactInternals;var p=Sr(),b=Ga(p);b.tag=1,b.payload=o,d!=null&&(b.callback=d),o=Va(a,b,p),o!==null&&(lr(o,a,p),Su(o,a,p))},enqueueForceUpdate:function(a,o){a=a._reactInternals;var d=Sr(),p=Ga(d);p.tag=2,o!=null&&(p.callback=o),o=Va(a,p,d),o!==null&&(lr(o,a,d),Su(o,a,d))}};function VC(a,o,d,p,b,j,O){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(p,j,O):o.prototype&&o.prototype.isPureReactComponent?!pu(d,p)||!pu(b,j):!0}function ZC(a,o,d,p){a=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(d,p),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(d,p),o.state!==a&&Mv.enqueueReplaceState(o,o.state,null)}function so(a,o){var d=o;if("ref"in o){d={};for(var p in o)p!=="ref"&&(d[p]=o[p])}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 YC(a){Uf(a)}function WC(a){console.error(a)}function QC(a){Uf(a)}function ch(a,o){try{var d=a.onUncaughtError;d(o.value,{componentStack:o.stack})}catch(p){setTimeout(function(){throw p})}}function XC(a,o,d){try{var p=a.onCaughtError;p(d.value,{componentStack:d.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function Rv(a,o,d){return d=Ga(d),d.tag=3,d.payload={element:null},d.callback=function(){ch(a,o)},d}function JC(a){return a=Ga(a),a.tag=3,a}function e_(a,o,d,p){var b=d.type.getDerivedStateFromError;if(typeof b=="function"){var j=p.value;a.payload=function(){return b(j)},a.callback=function(){XC(o,d,p)}}var O=d.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(a.callback=function(){XC(o,d,p),typeof b!="function"&&(Ja===null?Ja=new Set([this]):Ja.add(this));var M=p.stack;this.componentDidCatch(p.value,{componentStack:M!==null?M:""})})}function _U(a,o,d,p,b){if(d.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(o=d.alternate,o!==null&&kl(o,d,b,!0),d=vr.current,d!==null){switch(d.tag){case 31:case 13:return Ir===null?wh():d.alternate===null&&Zt===0&&(Zt=3),d.flags&=-257,d.flags|=65536,d.lanes=b,p===Wf?d.flags|=16384:(o=d.updateQueue,o===null?d.updateQueue=new Set([p]):o.add(p),s0(a,p,b)),!1;case 22:return d.flags|=65536,p===Wf?d.flags|=16384:(o=d.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([p])},d.updateQueue=o):(d=o.retryQueue,d===null?o.retryQueue=new Set([p]):d.add(p)),s0(a,p,b)),!1}throw Error(r(435,d.tag))}return s0(a,p,b),wh(),!1}if(tt)return o=vr.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=b,p!==ev&&(a=Error(r(422),{cause:p}),yu(Mr(a,d)))):(p!==ev&&(o=Error(r(423),{cause:p}),yu(Mr(o,d))),a=a.current.alternate,a.flags|=65536,b&=-b,a.lanes|=b,p=Mr(p,d),b=Rv(a.stateNode,p,b),dv(a,b),Zt!==4&&(Zt=2)),!1;var j=Error(r(520),{cause:p});if(j=Mr(j,d),Du===null?Du=[j]:Du.push(j),Zt!==4&&(Zt=2),o===null)return!0;p=Mr(p,d),d=o;do{switch(d.tag){case 3:return d.flags|=65536,a=b&-b,d.lanes|=a,a=Rv(d.stateNode,p,a),dv(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"&&(Ja===null||!Ja.has(j))))return d.flags|=65536,b&=-b,d.lanes|=b,b=JC(b),e_(b,a,d,p),dv(d,b),!1}d=d.return}while(d!==null);return!1}var Dv=Error(r(461)),on=!1;function An(a,o,d,p){o.child=a===null?iC(o,null,d,p):io(o,a.child,d,p)}function t_(a,o,d,p,b){d=d.render;var j=o.ref;if("ref"in p){var O={};for(var M in p)M!=="ref"&&(O[M]=p[M])}else O=p;return eo(o),p=yv(a,o,d,O,j,b),M=vv(),a!==null&&!on?(bv(a,o,b),oa(a,o,b)):(tt&&M&&Xy(o),o.flags|=1,An(a,o,p,b),o.child)}function n_(a,o,d,p,b){if(a===null){var j=d.type;return typeof j=="function"&&!Yy(j)&&j.defaultProps===void 0&&d.compare===null?(o.tag=15,o.type=j,r_(a,o,j,p,b)):(a=Kf(d.type,null,p,o,o.mode,b),a.ref=o.ref,a.return=o,o.child=a)}if(j=a.child,!Kv(a,b)){var O=j.memoizedProps;if(d=d.compare,d=d!==null?d:pu,d(O,p)&&a.ref===o.ref)return oa(a,o,b)}return o.flags|=1,a=ta(j,p),a.ref=o.ref,a.return=o,o.child=a}function r_(a,o,d,p,b){if(a!==null){var j=a.memoizedProps;if(pu(j,p)&&a.ref===o.ref)if(on=!1,o.pendingProps=p=j,Kv(a,b))(a.flags&131072)!==0&&(on=!0);else return o.lanes=a.lanes,oa(a,o,b)}return Lv(a,o,d,p,b)}function i_(a,o,d,p){var b=p.children,j=a!==null?a.memoizedState:null;if(a===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((o.flags&128)!==0){if(j=j!==null?j.baseLanes|d:d,a!==null){for(p=o.child=a.child,b=0;p!==null;)b=b|p.lanes|p.childLanes,p=p.sibling;p=b&~j}else p=0,o.child=null;return a_(a,o,j,d,p)}if((d&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},a!==null&&Zf(o,j!==null?j.cachePool:null),j!==null?oC(o,j):hv(),lC(o);else return p=o.lanes=536870912,a_(a,o,j!==null?j.baseLanes|d:d,d,p)}else j!==null?(Zf(o,j.cachePool),oC(o,j),Ya(),o.memoizedState=null):(a!==null&&Zf(o,null),hv(),Ya());return An(a,o,b,d),o.child}function Au(a,o){return a!==null&&a.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function a_(a,o,d,p,b){var j=ov();return j=j===null?null:{parent:an._currentValue,pool:j},o.memoizedState={baseLanes:d,cachePool:j},a!==null&&Zf(o,null),hv(),lC(o),a!==null&&kl(a,o,p,!0),o.childLanes=b,null}function uh(a,o){return o=fh({mode:o.mode,children:o.children},a.mode),o.ref=a.ref,a.child=o,o.return=a,o}function s_(a,o,d){return io(o,a.child,null,d),a=uh(o,o.pendingProps),a.flags|=2,br(o),o.memoizedState=null,a}function OU(a,o,d){var p=o.pendingProps,b=(o.flags&128)!==0;if(o.flags&=-129,a===null){if(tt){if(p.mode==="hidden")return a=uh(o,p),o.lanes=536870912,Au(null,a);if(mv(o),(a=At)?(a=vO(a,Lr),a=a!==null&&a.data==="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:Ba!==null?{id:Oi,overflow:ki}:null,retryLane:536870912,hydrationErrors:null},d=FN(a),d.return=o,o.child=d,On=o,At=null)):a=null,a===null)throw Fa(o);return o.lanes=536870912,null}return uh(o,p)}var j=a.memoizedState;if(j!==null){var O=j.dehydrated;if(mv(o),b)if(o.flags&256)o.flags&=-257,o=s_(a,o,d);else if(o.memoizedState!==null)o.child=a.child,o.flags|=128,o=null;else throw Error(r(558));else if(on||kl(a,o,d,!1),b=(d&a.childLanes)!==0,on||b){if(p=Ct,p!==null&&(O=zt(p,d),O!==0&&O!==j.retryLane))throw j.retryLane=O,Ws(a,O),lr(p,a,O),Dv;wh(),o=s_(a,o,d)}else a=j.treeContext,At=$r(O.nextSibling),On=o,tt=!0,qa=null,Lr=!1,a!==null&&GN(o,a),o=uh(o,p),o.flags|=4096;return o}return a=ta(a.child,{mode:p.mode,children:p.children}),a.ref=o.ref,o.child=a,a.return=o,a}function dh(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 Lv(a,o,d,p,b){return eo(o),d=yv(a,o,d,p,void 0,b),p=vv(),a!==null&&!on?(bv(a,o,b),oa(a,o,b)):(tt&&p&&Xy(o),o.flags|=1,An(a,o,d,b),o.child)}function o_(a,o,d,p,b,j){return eo(o),o.updateQueue=null,d=uC(o,p,d,b),cC(a),p=vv(),a!==null&&!on?(bv(a,o,j),oa(a,o,j)):(tt&&p&&Xy(o),o.flags|=1,An(a,o,d,j),o.child)}function l_(a,o,d,p,b){if(eo(o),o.stateNode===null){var j=Nl,O=d.contextType;typeof O=="object"&&O!==null&&(j=kn(O)),j=new d(p,j),o.memoizedState=j.state!==null&&j.state!==void 0?j.state:null,j.updater=Mv,o.stateNode=j,j._reactInternals=o,j=o.stateNode,j.props=p,j.state=o.memoizedState,j.refs={},cv(o),O=d.contextType,j.context=typeof O=="object"&&O!==null?kn(O):Nl,j.state=o.memoizedState,O=d.getDerivedStateFromProps,typeof O=="function"&&(zv(o,d,O,p),j.state=o.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof j.getSnapshotBeforeUpdate=="function"||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(O=j.state,typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount(),O!==j.state&&Mv.enqueueReplaceState(j,j.state,null),Nu(o,p,j,b),ju(),j.state=o.memoizedState),typeof j.componentDidMount=="function"&&(o.flags|=4194308),p=!0}else if(a===null){j=o.stateNode;var M=o.memoizedProps,$=so(d,M);j.props=$;var ee=j.context,se=d.contextType;O=Nl,typeof se=="object"&&se!==null&&(O=kn(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!==O)&&ZC(o,j,p,O),Ha=!1;var te=o.memoizedState;j.state=te,Nu(o,p,j,b),ju(),ee=o.memoizedState,M||te!==ee||Ha?(typeof fe=="function"&&(zv(o,d,fe,p),ee=o.memoizedState),($=Ha||VC(o,d,$,p,te,ee,O))?(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=p,o.memoizedState=ee),j.props=p,j.state=ee,j.context=O,p=$):(typeof j.componentDidMount=="function"&&(o.flags|=4194308),p=!1)}else{j=o.stateNode,uv(a,o),O=o.memoizedProps,se=so(d,O),j.props=se,fe=o.pendingProps,te=j.context,ee=d.contextType,$=Nl,typeof ee=="object"&&ee!==null&&($=kn(ee)),M=d.getDerivedStateFromProps,(ee=typeof M=="function"||typeof j.getSnapshotBeforeUpdate=="function")||typeof j.UNSAFE_componentWillReceiveProps!="function"&&typeof j.componentWillReceiveProps!="function"||(O!==fe||te!==$)&&ZC(o,j,p,$),Ha=!1,te=o.memoizedState,j.state=te,Nu(o,p,j,b),ju();var ie=o.memoizedState;O!==fe||te!==ie||Ha||a!==null&&a.dependencies!==null&&Gf(a.dependencies)?(typeof M=="function"&&(zv(o,d,M,p),ie=o.memoizedState),(se=Ha||VC(o,d,se,p,te,ie,$)||a!==null&&a.dependencies!==null&&Gf(a.dependencies))?(ee||typeof j.UNSAFE_componentWillUpdate!="function"&&typeof j.componentWillUpdate!="function"||(typeof j.componentWillUpdate=="function"&&j.componentWillUpdate(p,ie,$),typeof j.UNSAFE_componentWillUpdate=="function"&&j.UNSAFE_componentWillUpdate(p,ie,$)),typeof j.componentDidUpdate=="function"&&(o.flags|=4),typeof j.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof j.componentDidUpdate!="function"||O===a.memoizedProps&&te===a.memoizedState||(o.flags|=4),typeof j.getSnapshotBeforeUpdate!="function"||O===a.memoizedProps&&te===a.memoizedState||(o.flags|=1024),o.memoizedProps=p,o.memoizedState=ie),j.props=p,j.state=ie,j.context=$,p=se):(typeof j.componentDidUpdate!="function"||O===a.memoizedProps&&te===a.memoizedState||(o.flags|=4),typeof j.getSnapshotBeforeUpdate!="function"||O===a.memoizedProps&&te===a.memoizedState||(o.flags|=1024),p=!1)}return j=p,dh(a,o),p=(o.flags&128)!==0,j||p?(j=o.stateNode,d=p&&typeof d.getDerivedStateFromError!="function"?null:j.render(),o.flags|=1,a!==null&&p?(o.child=io(o,a.child,null,b),o.child=io(o,null,d,b)):An(a,o,d,b),o.memoizedState=j.state,a=o.child):a=oa(a,o,b),a}function c_(a,o,d,p){return Xs(),o.flags|=256,An(a,o,d,p),o.child}var Iv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $v(a){return{baseLanes:a,cachePool:XN()}}function Uv(a,o,d){return a=a!==null?a.childLanes&~d:0,o&&(a|=wr),a}function u_(a,o,d){var p=o.pendingProps,b=!1,j=(o.flags&128)!==0,O;if((O=j)||(O=a!==null&&a.memoizedState===null?!1:(Xt.current&2)!==0),O&&(b=!0,o.flags&=-129),O=(o.flags&32)!==0,o.flags&=-33,a===null){if(tt){if(b?Za(o):Ya(),(a=At)?(a=vO(a,Lr),a=a!==null&&a.data!=="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:Ba!==null?{id:Oi,overflow:ki}:null,retryLane:536870912,hydrationErrors:null},d=FN(a),d.return=o,o.child=d,On=o,At=null)):a=null,a===null)throw Fa(o);return S0(a)?o.lanes=32:o.lanes=536870912,null}var M=p.children;return p=p.fallback,b?(Ya(),b=o.mode,M=fh({mode:"hidden",children:M},b),p=Qs(p,b,d,null),M.return=o,p.return=o,M.sibling=p,o.child=M,p=o.child,p.memoizedState=$v(d),p.childLanes=Uv(a,O,d),o.memoizedState=Iv,Au(null,p)):(Za(o),Bv(o,M))}var $=a.memoizedState;if($!==null&&(M=$.dehydrated,M!==null)){if(j)o.flags&256?(Za(o),o.flags&=-257,o=qv(a,o,d)):o.memoizedState!==null?(Ya(),o.child=a.child,o.flags|=128,o=null):(Ya(),M=p.fallback,b=o.mode,p=fh({mode:"visible",children:p.children},b),M=Qs(M,b,d,null),M.flags|=2,p.return=o,M.return=o,p.sibling=M,o.child=p,io(o,a.child,null,d),p=o.child,p.memoizedState=$v(d),p.childLanes=Uv(a,O,d),o.memoizedState=Iv,o=Au(null,p));else if(Za(o),S0(M)){if(O=M.nextSibling&&M.nextSibling.dataset,O)var ee=O.dgst;O=ee,p=Error(r(419)),p.stack="",p.digest=O,yu({value:p,source:null,stack:null}),o=qv(a,o,d)}else if(on||kl(a,o,d,!1),O=(d&a.childLanes)!==0,on||O){if(O=Ct,O!==null&&(p=zt(O,d),p!==0&&p!==$.retryLane))throw $.retryLane=p,Ws(a,p),lr(O,a,p),Dv;w0(M)||wh(),o=qv(a,o,d)}else w0(M)?(o.flags|=192,o.child=a.child,o=null):(a=$.treeContext,At=$r(M.nextSibling),On=o,tt=!0,qa=null,Lr=!1,a!==null&&GN(o,a),o=Bv(o,p.children),o.flags|=4096);return o}return b?(Ya(),M=p.fallback,b=o.mode,$=a.child,ee=$.sibling,p=ta($,{mode:"hidden",children:p.children}),p.subtreeFlags=$.subtreeFlags&65011712,ee!==null?M=ta(ee,M):(M=Qs(M,b,d,null),M.flags|=2),M.return=o,p.return=o,p.sibling=M,o.child=p,Au(null,p),p=o.child,M=a.child.memoizedState,M===null?M=$v(d):(b=M.cachePool,b!==null?($=an._currentValue,b=b.parent!==$?{parent:$,pool:$}:b):b=XN(),M={baseLanes:M.baseLanes|d,cachePool:b}),p.memoizedState=M,p.childLanes=Uv(a,O,d),o.memoizedState=Iv,Au(a.child,p)):(Za(o),d=a.child,a=d.sibling,d=ta(d,{mode:"visible",children:p.children}),d.return=o,d.sibling=null,a!==null&&(O=o.deletions,O===null?(o.deletions=[a],o.flags|=16):O.push(a)),o.child=d,o.memoizedState=null,d)}function Bv(a,o){return o=fh({mode:"visible",children:o},a.mode),o.return=a,a.child=o}function fh(a,o){return a=yr(22,a,null,o),a.lanes=0,a}function qv(a,o,d){return io(o,a.child,null,d),a=Bv(o,o.pendingProps.children),a.flags|=2,o.memoizedState=null,a}function d_(a,o,d){a.lanes|=o;var p=a.alternate;p!==null&&(p.lanes|=o),rv(a.return,o,d)}function Fv(a,o,d,p,b,j){var O=a.memoizedState;O===null?a.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:p,tail:d,tailMode:b,treeForkCount:j}:(O.isBackwards=o,O.rendering=null,O.renderingStartTime=0,O.last=p,O.tail=d,O.tailMode=b,O.treeForkCount=j)}function f_(a,o,d){var p=o.pendingProps,b=p.revealOrder,j=p.tail;p=p.children;var O=Xt.current,M=(O&2)!==0;if(M?(O=O&1|2,o.flags|=128):O&=1,oe(Xt,O),An(a,o,p,d),p=tt?gu:0,!M&&a!==null&&(a.flags&128)!==0)e:for(a=o.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&d_(a,d,o);else if(a.tag===19)d_(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&&eh(a)===null&&(b=d),d=d.sibling;d=b,d===null?(b=o.child,o.child=null):(b=d.sibling,d.sibling=null),Fv(o,!1,b,d,j,p);break;case"backwards":case"unstable_legacy-backwards":for(d=null,b=o.child,o.child=null;b!==null;){if(a=b.alternate,a!==null&&eh(a)===null){o.child=b;break}a=b.sibling,b.sibling=d,d=b,b=a}Fv(o,!0,d,null,j,p);break;case"together":Fv(o,!1,null,null,void 0,p);break;default:o.memoizedState=null}return o.child}function oa(a,o,d){if(a!==null&&(o.dependencies=a.dependencies),Xa|=o.lanes,(d&o.childLanes)===0)if(a!==null){if(kl(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=ta(a,a.pendingProps),o.child=d,d.return=o;a.sibling!==null;)a=a.sibling,d=d.sibling=ta(a,a.pendingProps),d.return=o;d.sibling=null}return o.child}function Kv(a,o){return(a.lanes&o)!==0?!0:(a=a.dependencies,!!(a!==null&&Gf(a)))}function kU(a,o,d){switch(o.tag){case 3:ye(o,o.stateNode.containerInfo),Ka(o,an,a.memoizedState.cache),Xs();break;case 27:case 5:ce(o);break;case 4:ye(o,o.stateNode.containerInfo);break;case 10:Ka(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,mv(o),null;break;case 13:var p=o.memoizedState;if(p!==null)return p.dehydrated!==null?(Za(o),o.flags|=128,null):(d&o.child.childLanes)!==0?u_(a,o,d):(Za(o),a=oa(a,o,d),a!==null?a.sibling:null);Za(o);break;case 19:var b=(a.flags&128)!==0;if(p=(d&o.childLanes)!==0,p||(kl(a,o,d,!1),p=(d&o.childLanes)!==0),b){if(p)return f_(a,o,d);o.flags|=128}if(b=o.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),oe(Xt,Xt.current),p)break;return null;case 22:return o.lanes=0,i_(a,o,d,o.pendingProps);case 24:Ka(o,an,a.memoizedState.cache)}return oa(a,o,d)}function h_(a,o,d){if(a!==null)if(a.memoizedProps!==o.pendingProps)on=!0;else{if(!Kv(a,d)&&(o.flags&128)===0)return on=!1,kU(a,o,d);on=(a.flags&131072)!==0}else on=!1,tt&&(o.flags&1048576)!==0&&HN(o,gu,o.index);switch(o.lanes=0,o.tag){case 16:e:{var p=o.pendingProps;if(a=no(o.elementType),o.type=a,typeof a=="function")Yy(a)?(p=so(a,p),o.tag=1,o=l_(null,o,a,p,d)):(o.tag=0,o=Lv(null,o,a,p,d));else{if(a!=null){var b=a.$$typeof;if(b===_){o.tag=11,o=t_(null,o,a,p,d);break e}else if(b===E){o.tag=14,o=n_(null,o,a,p,d);break e}}throw o=ve(a)||a,Error(r(306,o,""))}}return o;case 0:return Lv(a,o,o.type,o.pendingProps,d);case 1:return p=o.type,b=so(p,o.pendingProps),l_(a,o,p,b,d);case 3:e:{if(ye(o,o.stateNode.containerInfo),a===null)throw Error(r(387));p=o.pendingProps;var j=o.memoizedState;b=j.element,uv(a,o),Nu(o,p,null,d);var O=o.memoizedState;if(p=O.cache,Ka(o,an,p),p!==j.cache&&iv(o,[an],d,!0),ju(),p=O.element,j.isDehydrated)if(j={element:p,isDehydrated:!1,cache:O.cache},o.updateQueue.baseState=j,o.memoizedState=j,o.flags&256){o=c_(a,o,p,d);break e}else if(p!==b){b=Mr(Error(r(424)),o),yu(b),o=c_(a,o,p,d);break e}else for(a=o.stateNode.containerInfo,a.nodeType===9?a=a.body:a=a.nodeName==="HTML"?a.ownerDocument.body:a,At=$r(a.firstChild),On=o,tt=!0,qa=null,Lr=!0,d=iC(o,null,p,d),o.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(Xs(),p===b){o=oa(a,o,d);break e}An(a,o,p,d)}o=o.child}return o;case 26:return dh(a,o),a===null?(d=NO(o.type,null,o.pendingProps,null))?o.memoizedState=d:tt||(d=o.type,a=o.pendingProps,p=kh(W.current).createElement(d),p[ht]=o,p[In]=a,En(p,d,a),pt(p),o.stateNode=p):o.memoizedState=NO(o.type,a.memoizedProps,o.pendingProps,a.memoizedState),null;case 27:return ce(o),a===null&&tt&&(p=o.stateNode=wO(o.type,o.pendingProps,W.current),On=o,Lr=!0,b=At,rs(o.type)?(j0=b,At=$r(p.firstChild)):At=b),An(a,o,o.pendingProps.children,d),dh(a,o),a===null&&(o.flags|=4194304),o.child;case 5:return a===null&&tt&&((b=p=At)&&(p=i6(p,o.type,o.pendingProps,Lr),p!==null?(o.stateNode=p,On=o,At=$r(p.firstChild),Lr=!1,b=!0):b=!1),b||Fa(o)),ce(o),b=o.type,j=o.pendingProps,O=a!==null?a.memoizedProps:null,p=j.children,v0(b,j)?p=null:O!==null&&v0(b,O)&&(o.flags|=32),o.memoizedState!==null&&(b=yv(a,o,bU,null,null,d),Ku._currentValue=b),dh(a,o),An(a,o,p,d),o.child;case 6:return a===null&&tt&&((a=d=At)&&(d=a6(d,o.pendingProps,Lr),d!==null?(o.stateNode=d,On=o,At=null,a=!0):a=!1),a||Fa(o)),null;case 13:return u_(a,o,d);case 4:return ye(o,o.stateNode.containerInfo),p=o.pendingProps,a===null?o.child=io(o,null,p,d):An(a,o,p,d),o.child;case 11:return t_(a,o,o.type,o.pendingProps,d);case 7:return An(a,o,o.pendingProps,d),o.child;case 8:return An(a,o,o.pendingProps.children,d),o.child;case 12:return An(a,o,o.pendingProps.children,d),o.child;case 10:return p=o.pendingProps,Ka(o,o.type,p.value),An(a,o,p.children,d),o.child;case 9:return b=o.type._context,p=o.pendingProps.children,eo(o),b=kn(b),p=p(b),o.flags|=1,An(a,o,p,d),o.child;case 14:return n_(a,o,o.type,o.pendingProps,d);case 15:return r_(a,o,o.type,o.pendingProps,d);case 19:return f_(a,o,d);case 31:return OU(a,o,d);case 22:return i_(a,o,d,o.pendingProps);case 24:return eo(o),p=kn(an),a===null?(b=ov(),b===null&&(b=Ct,j=av(),b.pooledCache=j,j.refCount++,j!==null&&(b.pooledCacheLanes|=d),b=j),o.memoizedState={parent:p,cache:b},cv(o),Ka(o,an,b)):((a.lanes&d)!==0&&(uv(a,o),Nu(o,null,null,d),ju()),b=a.memoizedState,j=o.memoizedState,b.parent!==p?(b={parent:p,cache:p},o.memoizedState=b,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=b),Ka(o,an,p)):(p=j.cache,Ka(o,an,p),p!==b.cache&&iv(o,[an],d,!0))),An(a,o,o.pendingProps.children,d),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function la(a){a.flags|=4}function Hv(a,o,d,p,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(U_())a.flags|=8192;else throw ro=Wf,lv}else a.flags&=-16777217}function p_(a,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!AO(o))if(U_())a.flags|=8192;else throw ro=Wf,lv}function hh(a,o){o!==null&&(a.flags|=4),a.flags&16384&&(o=a.tag!==22?_f():536870912,a.lanes|=o,Ul|=o)}function Eu(a,o){if(!tt)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 p=null;d!==null;)d.alternate!==null&&(p=d),d=d.sibling;p===null?o||a.tail===null?a.tail=null:a.tail.sibling=null:p.sibling=null}}function Et(a){var o=a.alternate!==null&&a.alternate.child===a.child,d=0,p=0;if(o)for(var b=a.child;b!==null;)d|=b.lanes|b.childLanes,p|=b.subtreeFlags&65011712,p|=b.flags&65011712,b.return=a,b=b.sibling;else for(b=a.child;b!==null;)d|=b.lanes|b.childLanes,p|=b.subtreeFlags,p|=b.flags,b.return=a,b=b.sibling;return a.subtreeFlags|=p,a.childLanes=d,o}function AU(a,o,d){var p=o.pendingProps;switch(Jy(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Et(o),null;case 1:return Et(o),null;case 3:return d=o.stateNode,p=null,a!==null&&(p=a.memoizedState.cache),o.memoizedState.cache!==p&&(o.flags|=2048),ia(an),Z(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(a===null||a.child===null)&&(Ol(o)?la(o):a===null||a.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,tv())),Et(o),null;case 26:var b=o.type,j=o.memoizedState;return a===null?(la(o),j!==null?(Et(o),p_(o,j)):(Et(o),Hv(o,b,null,p,d))):j?j!==a.memoizedState?(la(o),Et(o),p_(o,j)):(Et(o),o.flags&=-16777217):(a=a.memoizedProps,a!==p&&la(o),Et(o),Hv(o,b,a,p,d)),null;case 27:if(be(o),d=W.current,b=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==p&&la(o);else{if(!p){if(o.stateNode===null)throw Error(r(166));return Et(o),null}a=Q.current,Ol(o)?VN(o):(a=wO(b,p,d),o.stateNode=a,la(o))}return Et(o),null;case 5:if(be(o),b=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==p&&la(o);else{if(!p){if(o.stateNode===null)throw Error(r(166));return Et(o),null}if(j=Q.current,Ol(o))VN(o);else{var O=kh(W.current);switch(j){case 1:j=O.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:j=O.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":j=O.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":j=O.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":j=O.createElement("div"),j.innerHTML="<script><\/script>",j=j.removeChild(j.firstChild);break;case"select":j=typeof p.is=="string"?O.createElement("select",{is:p.is}):O.createElement("select"),p.multiple?j.multiple=!0:p.size&&(j.size=p.size);break;default:j=typeof p.is=="string"?O.createElement(b,{is:p.is}):O.createElement(b)}}j[ht]=o,j[In]=p;e:for(O=o.child;O!==null;){if(O.tag===5||O.tag===6)j.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===o)break e;for(;O.sibling===null;){if(O.return===null||O.return===o)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}o.stateNode=j;e:switch(En(j,b,p),b){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&la(o)}}return Et(o),Hv(o,o.type,a===null?null:a.memoizedProps,o.pendingProps,d),null;case 6:if(a&&o.stateNode!=null)a.memoizedProps!==p&&la(o);else{if(typeof p!="string"&&o.stateNode===null)throw Error(r(166));if(a=W.current,Ol(o)){if(a=o.stateNode,d=o.memoizedProps,p=null,b=On,b!==null)switch(b.tag){case 27:case 5:p=b.memoizedProps}a[ht]=o,a=!!(a.nodeValue===d||p!==null&&p.suppressHydrationWarning===!0||uO(a.nodeValue,d)),a||Fa(o,!0)}else a=kh(a).createTextNode(p),a[ht]=o,o.stateNode=a}return Et(o),null;case 31:if(d=o.memoizedState,a===null||a.memoizedState!==null){if(p=Ol(o),d!==null){if(a===null){if(!p)throw Error(r(318));if(a=o.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[ht]=o}else Xs(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Et(o),a=!1}else d=tv(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=d),a=!0;if(!a)return o.flags&256?(br(o),o):(br(o),null);if((o.flags&128)!==0)throw Error(r(558))}return Et(o),null;case 13:if(p=o.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(b=Ol(o),p!==null&&p.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[ht]=o}else Xs(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Et(o),b=!1}else b=tv(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=b),b=!0;if(!b)return o.flags&256?(br(o),o):(br(o),null)}return br(o),(o.flags&128)!==0?(o.lanes=d,o):(d=p!==null,a=a!==null&&a.memoizedState!==null,d&&(p=o.child,b=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(b=p.alternate.memoizedState.cachePool.pool),j=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(j=p.memoizedState.cachePool.pool),j!==b&&(p.flags|=2048)),d!==a&&d&&(o.child.flags|=8192),hh(o,o.updateQueue),Et(o),null);case 4:return Z(),a===null&&h0(o.stateNode.containerInfo),Et(o),null;case 10:return ia(o.type),Et(o),null;case 19:if(H(Xt),p=o.memoizedState,p===null)return Et(o),null;if(b=(o.flags&128)!==0,j=p.rendering,j===null)if(b)Eu(p,!1);else{if(Zt!==0||a!==null&&(a.flags&128)!==0)for(a=o.child;a!==null;){if(j=eh(a),j!==null){for(o.flags|=128,Eu(p,!1),a=j.updateQueue,o.updateQueue=a,hh(o,a),o.subtreeFlags=0,a=d,d=o.child;d!==null;)qN(d,a),d=d.sibling;return oe(Xt,Xt.current&1|2),tt&&na(o,p.treeForkCount),o.child}a=a.sibling}p.tail!==null&&et()>vh&&(o.flags|=128,b=!0,Eu(p,!1),o.lanes=4194304)}else{if(!b)if(a=eh(j),a!==null){if(o.flags|=128,b=!0,a=a.updateQueue,o.updateQueue=a,hh(o,a),Eu(p,!0),p.tail===null&&p.tailMode==="hidden"&&!j.alternate&&!tt)return Et(o),null}else 2*et()-p.renderingStartTime>vh&&d!==536870912&&(o.flags|=128,b=!0,Eu(p,!1),o.lanes=4194304);p.isBackwards?(j.sibling=o.child,o.child=j):(a=p.last,a!==null?a.sibling=j:o.child=j,p.last=j)}return p.tail!==null?(a=p.tail,p.rendering=a,p.tail=a.sibling,p.renderingStartTime=et(),a.sibling=null,d=Xt.current,oe(Xt,b?d&1|2:d&1),tt&&na(o,p.treeForkCount),a):(Et(o),null);case 22:case 23:return br(o),pv(),p=o.memoizedState!==null,a!==null?a.memoizedState!==null!==p&&(o.flags|=8192):p&&(o.flags|=8192),p?(d&536870912)!==0&&(o.flags&128)===0&&(Et(o),o.subtreeFlags&6&&(o.flags|=8192)):Et(o),d=o.updateQueue,d!==null&&hh(o,d.retryQueue),d=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(d=a.memoizedState.cachePool.pool),p=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(p=o.memoizedState.cachePool.pool),p!==d&&(o.flags|=2048),a!==null&&H(to),null;case 24:return d=null,a!==null&&(d=a.memoizedState.cache),o.memoizedState.cache!==d&&(o.flags|=2048),ia(an),Et(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function EU(a,o){switch(Jy(o),o.tag){case 1:return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 3:return ia(an),Z(),a=o.flags,(a&65536)!==0&&(a&128)===0?(o.flags=a&-65537|128,o):null;case 26:case 27:case 5:return be(o),null;case 31:if(o.memoizedState!==null){if(br(o),o.alternate===null)throw Error(r(340));Xs()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 13:if(br(o),a=o.memoizedState,a!==null&&a.dehydrated!==null){if(o.alternate===null)throw Error(r(340));Xs()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 19:return H(Xt),null;case 4:return Z(),null;case 10:return ia(o.type),null;case 22:case 23:return br(o),pv(),a!==null&&H(to),a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 24:return ia(an),null;case 25:return null;default:return null}}function m_(a,o){switch(Jy(o),o.tag){case 3:ia(an),Z();break;case 26:case 27:case 5:be(o);break;case 4:Z();break;case 31:o.memoizedState!==null&&br(o);break;case 13:br(o);break;case 19:H(Xt);break;case 10:ia(o.type);break;case 22:case 23:br(o),pv(),a!==null&&H(to);break;case 24:ia(an)}}function Tu(a,o){try{var d=o.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var b=p.next;d=b;do{if((d.tag&a)===a){p=void 0;var j=d.create,O=d.inst;p=j(),O.destroy=p}d=d.next}while(d!==b)}}catch(M){gt(o,o.return,M)}}function Wa(a,o,d){try{var p=o.updateQueue,b=p!==null?p.lastEffect:null;if(b!==null){var j=b.next;p=j;do{if((p.tag&a)===a){var O=p.inst,M=O.destroy;if(M!==void 0){O.destroy=void 0,b=o;var $=d,ee=M;try{ee()}catch(se){gt(b,$,se)}}}p=p.next}while(p!==j)}}catch(se){gt(o,o.return,se)}}function g_(a){var o=a.updateQueue;if(o!==null){var d=a.stateNode;try{sC(o,d)}catch(p){gt(a,a.return,p)}}}function y_(a,o,d){d.props=so(a.type,a.memoizedProps),d.state=a.memoizedState;try{d.componentWillUnmount()}catch(p){gt(a,o,p)}}function Pu(a,o){try{var d=a.ref;if(d!==null){switch(a.tag){case 26:case 27:case 5:var p=a.stateNode;break;case 30:p=a.stateNode;break;default:p=a.stateNode}typeof d=="function"?a.refCleanup=d(p):d.current=p}}catch(b){gt(a,o,b)}}function Ai(a,o){var d=a.ref,p=a.refCleanup;if(d!==null)if(typeof p=="function")try{p()}catch(b){gt(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){gt(a,o,b)}else d.current=null}function v_(a){var o=a.type,d=a.memoizedProps,p=a.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":d.autoFocus&&p.focus();break e;case"img":d.src?p.src=d.src:d.srcSet&&(p.srcset=d.srcSet)}}catch(b){gt(a,a.return,b)}}function Gv(a,o,d){try{var p=a.stateNode;XU(p,a.type,d,o),p[In]=o}catch(b){gt(a,a.return,b)}}function b_(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&rs(a.type)||a.tag===4}function Vv(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||b_(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&&rs(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 Zv(a,o,d){var p=a.tag;if(p===5||p===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=Ji));else if(p!==4&&(p===27&&rs(a.type)&&(d=a.stateNode,o=null),a=a.child,a!==null))for(Zv(a,o,d),a=a.sibling;a!==null;)Zv(a,o,d),a=a.sibling}function ph(a,o,d){var p=a.tag;if(p===5||p===6)a=a.stateNode,o?d.insertBefore(a,o):d.appendChild(a);else if(p!==4&&(p===27&&rs(a.type)&&(d=a.stateNode),a=a.child,a!==null))for(ph(a,o,d),a=a.sibling;a!==null;)ph(a,o,d),a=a.sibling}function x_(a){var o=a.stateNode,d=a.memoizedProps;try{for(var p=a.type,b=o.attributes;b.length;)o.removeAttributeNode(b[0]);En(o,p,d),o[ht]=a,o[In]=d}catch(j){gt(a,a.return,j)}}var ca=!1,ln=!1,Yv=!1,w_=typeof WeakSet=="function"?WeakSet:Set,wn=null;function TU(a,o){if(a=a.containerInfo,g0=Rh,a=zN(a),qy(a)){if("selectionStart"in a)var d={start:a.selectionStart,end:a.selectionEnd};else e:{d=(d=a.ownerDocument)&&d.defaultView||window;var p=d.getSelection&&d.getSelection();if(p&&p.rangeCount!==0){d=p.anchorNode;var b=p.anchorOffset,j=p.focusNode;p=p.focusOffset;try{d.nodeType,j.nodeType}catch{d=null;break e}var O=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=O+b),fe!==j||p!==0&&fe.nodeType!==3||($=O+p),fe.nodeType===3&&(O+=fe.nodeValue.length),(ie=fe.firstChild)!==null;)te=fe,fe=ie;for(;;){if(fe===a)break t;if(te===d&&++ee===b&&(M=O),te===j&&++se===p&&($=O),(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(y0={focusedElem:a,selectionRange:d},Rh=!1,wn=o;wn!==null;)if(o=wn,a=o.child,(o.subtreeFlags&1028)!==0&&a!==null)a.return=o,wn=a;else for(;wn!==null;){switch(o=wn,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,p=d.stateNode;try{var Oe=so(d.type,b);a=p.getSnapshotBeforeUpdate(Oe,j),p.__reactInternalSnapshotBeforeUpdate=a}catch(Ie){gt(d,d.return,Ie)}}break;case 3:if((a&1024)!==0){if(a=o.stateNode.containerInfo,d=a.nodeType,d===9)x0(a);else if(d===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":x0(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,wn=a;break}wn=o.return}}function S_(a,o,d){var p=d.flags;switch(d.tag){case 0:case 11:case 15:da(a,d),p&4&&Tu(5,d);break;case 1:if(da(a,d),p&4)if(a=d.stateNode,o===null)try{a.componentDidMount()}catch(O){gt(d,d.return,O)}else{var b=so(d.type,o.memoizedProps);o=o.memoizedState;try{a.componentDidUpdate(b,o,a.__reactInternalSnapshotBeforeUpdate)}catch(O){gt(d,d.return,O)}}p&64&&g_(d),p&512&&Pu(d,d.return);break;case 3:if(da(a,d),p&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{sC(a,o)}catch(O){gt(d,d.return,O)}}break;case 27:o===null&&p&4&&x_(d);case 26:case 5:da(a,d),o===null&&p&4&&v_(d),p&512&&Pu(d,d.return);break;case 12:da(a,d);break;case 31:da(a,d),p&4&&C_(a,d);break;case 13:da(a,d),p&4&&__(a,d),p&64&&(a=d.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(d=UU.bind(null,d),s6(a,d))));break;case 22:if(p=d.memoizedState!==null||ca,!p){o=o!==null&&o.memoizedState!==null||ln,b=ca;var j=ln;ca=p,(ln=o)&&!j?fa(a,d,(d.subtreeFlags&8772)!==0):da(a,d),ca=b,ln=j}break;case 30:break;default:da(a,d)}}function j_(a){var o=a.alternate;o!==null&&(a.alternate=null,j_(o)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(o=a.stateNode,o!==null&&La(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,ir=!1;function ua(a,o,d){for(d=d.child;d!==null;)N_(a,o,d),d=d.sibling}function N_(a,o,d){if(Nt&&typeof Nt.onCommitFiberUnmount=="function")try{Nt.onCommitFiberUnmount(ii,d)}catch{}switch(d.tag){case 26:ln||Ai(d,o),ua(a,o,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:ln||Ai(d,o);var p=Mt,b=ir;rs(d.type)&&(Mt=d.stateNode,ir=!1),ua(a,o,d),Bu(d.stateNode),Mt=p,ir=b;break;case 5:ln||Ai(d,o);case 6:if(p=Mt,b=ir,Mt=null,ua(a,o,d),Mt=p,ir=b,Mt!==null)if(ir)try{(Mt.nodeType===9?Mt.body:Mt.nodeName==="HTML"?Mt.ownerDocument.body:Mt).removeChild(d.stateNode)}catch(j){gt(d,o,j)}else try{Mt.removeChild(d.stateNode)}catch(j){gt(d,o,j)}break;case 18:Mt!==null&&(ir?(a=Mt,gO(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,d.stateNode),Zl(a)):gO(Mt,d.stateNode));break;case 4:p=Mt,b=ir,Mt=d.stateNode.containerInfo,ir=!0,ua(a,o,d),Mt=p,ir=b;break;case 0:case 11:case 14:case 15:Wa(2,d,o),ln||Wa(4,d,o),ua(a,o,d);break;case 1:ln||(Ai(d,o),p=d.stateNode,typeof p.componentWillUnmount=="function"&&y_(d,o,p)),ua(a,o,d);break;case 21:ua(a,o,d);break;case 22:ln=(p=ln)||d.memoizedState!==null,ua(a,o,d),ln=p;break;default:ua(a,o,d)}}function C_(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Zl(a)}catch(d){gt(o,o.return,d)}}}function __(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Zl(a)}catch(d){gt(o,o.return,d)}}function PU(a){switch(a.tag){case 31:case 13:case 19:var o=a.stateNode;return o===null&&(o=a.stateNode=new w_),o;case 22:return a=a.stateNode,o=a._retryCache,o===null&&(o=a._retryCache=new w_),o;default:throw Error(r(435,a.tag))}}function mh(a,o){var d=PU(a);o.forEach(function(p){if(!d.has(p)){d.add(p);var b=BU.bind(null,a,p);p.then(b,b)}})}function ar(a,o){var d=o.deletions;if(d!==null)for(var p=0;p<d.length;p++){var b=d[p],j=a,O=o,M=O;e:for(;M!==null;){switch(M.tag){case 27:if(rs(M.type)){Mt=M.stateNode,ir=!1;break e}break;case 5:Mt=M.stateNode,ir=!1;break e;case 3:case 4:Mt=M.stateNode.containerInfo,ir=!0;break e}M=M.return}if(Mt===null)throw Error(r(160));N_(j,O,b),Mt=null,ir=!1,j=b.alternate,j!==null&&(j.return=null),b.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)O_(o,a),o=o.sibling}var oi=null;function O_(a,o){var d=a.alternate,p=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:ar(o,a),sr(a),p&4&&(Wa(3,a,a.return),Tu(3,a),Wa(5,a,a.return));break;case 1:ar(o,a),sr(a),p&512&&(ln||d===null||Ai(d,d.return)),p&64&&ca&&(a=a.updateQueue,a!==null&&(p=a.callbacks,p!==null&&(d=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=d===null?p:d.concat(p))));break;case 26:var b=oi;if(ar(o,a),sr(a),p&512&&(ln||d===null||Ai(d,d.return)),p&4){var j=d!==null?d.memoizedState:null;if(p=a.memoizedState,d===null)if(p===null)if(a.stateNode===null){e:{p=a.type,d=a.memoizedProps,b=b.ownerDocument||b;t:switch(p){case"title":j=b.getElementsByTagName("title")[0],(!j||j[Ci]||j[ht]||j.namespaceURI==="http://www.w3.org/2000/svg"||j.hasAttribute("itemprop"))&&(j=b.createElement(p),b.head.insertBefore(j,b.querySelector("head > title"))),En(j,p,d),j[ht]=a,pt(j),p=j;break e;case"link":var O=OO("link","href",b).get(p+(d.href||""));if(O){for(var M=0;M<O.length;M++)if(j=O[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)){O.splice(M,1);break t}}j=b.createElement(p),En(j,p,d),b.head.appendChild(j);break;case"meta":if(O=OO("meta","content",b).get(p+(d.content||""))){for(M=0;M<O.length;M++)if(j=O[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)){O.splice(M,1);break t}}j=b.createElement(p),En(j,p,d),b.head.appendChild(j);break;default:throw Error(r(468,p))}j[ht]=a,pt(j),p=j}a.stateNode=p}else kO(b,a.type,a.stateNode);else a.stateNode=_O(b,p,a.memoizedProps);else j!==p?(j===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):j.count--,p===null?kO(b,a.type,a.stateNode):_O(b,p,a.memoizedProps)):p===null&&a.stateNode!==null&&Gv(a,a.memoizedProps,d.memoizedProps)}break;case 27:ar(o,a),sr(a),p&512&&(ln||d===null||Ai(d,d.return)),d!==null&&p&4&&Gv(a,a.memoizedProps,d.memoizedProps);break;case 5:if(ar(o,a),sr(a),p&512&&(ln||d===null||Ai(d,d.return)),a.flags&32){b=a.stateNode;try{yl(b,"")}catch(Oe){gt(a,a.return,Oe)}}p&4&&a.stateNode!=null&&(b=a.memoizedProps,Gv(a,b,d!==null?d.memoizedProps:b)),p&1024&&(Yv=!0);break;case 6:if(ar(o,a),sr(a),p&4){if(a.stateNode===null)throw Error(r(162));p=a.memoizedProps,d=a.stateNode;try{d.nodeValue=p}catch(Oe){gt(a,a.return,Oe)}}break;case 3:if(Th=null,b=oi,oi=Ah(o.containerInfo),ar(o,a),oi=b,sr(a),p&4&&d!==null&&d.memoizedState.isDehydrated)try{Zl(o.containerInfo)}catch(Oe){gt(a,a.return,Oe)}Yv&&(Yv=!1,k_(a));break;case 4:p=oi,oi=Ah(a.stateNode.containerInfo),ar(o,a),sr(a),oi=p;break;case 12:ar(o,a),sr(a);break;case 31:ar(o,a),sr(a),p&4&&(p=a.updateQueue,p!==null&&(a.updateQueue=null,mh(a,p)));break;case 13:ar(o,a),sr(a),a.child.flags&8192&&a.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(yh=et()),p&4&&(p=a.updateQueue,p!==null&&(a.updateQueue=null,mh(a,p)));break;case 22:b=a.memoizedState!==null;var $=d!==null&&d.memoizedState!==null,ee=ca,se=ln;if(ca=ee||b,ln=se||$,ar(o,a),ln=se,ca=ee,sr(a),p&8192)e:for(o=a.stateNode,o._visibility=b?o._visibility&-2:o._visibility|1,b&&(d===null||$||ca||ln||oo(a)),d=null,o=a;;){if(o.tag===5||o.tag===26){if(d===null){$=d=o;try{if(j=$.stateNode,b)O=j.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.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(Oe){gt($,$.return,Oe)}}}else if(o.tag===6){if(d===null){$=o;try{$.stateNode.nodeValue=b?"":$.memoizedProps}catch(Oe){gt($,$.return,Oe)}}}else if(o.tag===18){if(d===null){$=o;try{var ie=$.stateNode;b?yO(ie,!0):yO($.stateNode,!1)}catch(Oe){gt($,$.return,Oe)}}}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}p&4&&(p=a.updateQueue,p!==null&&(d=p.retryQueue,d!==null&&(p.retryQueue=null,mh(a,d))));break;case 19:ar(o,a),sr(a),p&4&&(p=a.updateQueue,p!==null&&(a.updateQueue=null,mh(a,p)));break;case 30:break;case 21:break;default:ar(o,a),sr(a)}}function sr(a){var o=a.flags;if(o&2){try{for(var d,p=a.return;p!==null;){if(b_(p)){d=p;break}p=p.return}if(d==null)throw Error(r(160));switch(d.tag){case 27:var b=d.stateNode,j=Vv(a);ph(a,j,b);break;case 5:var O=d.stateNode;d.flags&32&&(yl(O,""),d.flags&=-33);var M=Vv(a);ph(a,M,O);break;case 3:case 4:var $=d.stateNode.containerInfo,ee=Vv(a);Zv(a,ee,$);break;default:throw Error(r(161))}}catch(se){gt(a,a.return,se)}a.flags&=-3}o&4096&&(a.flags&=-4097)}function k_(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var o=a;k_(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),a=a.sibling}}function da(a,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)S_(a,o.alternate,o),o=o.sibling}function oo(a){for(a=a.child;a!==null;){var o=a;switch(o.tag){case 0:case 11:case 14:case 15:Wa(4,o,o.return),oo(o);break;case 1:Ai(o,o.return);var d=o.stateNode;typeof d.componentWillUnmount=="function"&&y_(o,o.return,d),oo(o);break;case 27:Bu(o.stateNode);case 26:case 5:Ai(o,o.return),oo(o);break;case 22:o.memoizedState===null&&oo(o);break;case 30:oo(o);break;default:oo(o)}a=a.sibling}}function fa(a,o,d){for(d=d&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var p=o.alternate,b=a,j=o,O=j.flags;switch(j.tag){case 0:case 11:case 15:fa(b,j,d),Tu(4,j);break;case 1:if(fa(b,j,d),p=j,b=p.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(ee){gt(p,p.return,ee)}if(p=j,b=p.updateQueue,b!==null){var M=p.stateNode;try{var $=b.shared.hiddenCallbacks;if($!==null)for(b.shared.hiddenCallbacks=null,b=0;b<$.length;b++)aC($[b],M)}catch(ee){gt(p,p.return,ee)}}d&&O&64&&g_(j),Pu(j,j.return);break;case 27:x_(j);case 26:case 5:fa(b,j,d),d&&p===null&&O&4&&v_(j),Pu(j,j.return);break;case 12:fa(b,j,d);break;case 31:fa(b,j,d),d&&O&4&&C_(b,j);break;case 13:fa(b,j,d),d&&O&4&&__(b,j);break;case 22:j.memoizedState===null&&fa(b,j,d),Pu(j,j.return);break;case 30:break;default:fa(b,j,d)}o=o.sibling}}function Wv(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&&vu(d))}function Qv(a,o){a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&vu(a))}function li(a,o,d,p){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)A_(a,o,d,p),o=o.sibling}function A_(a,o,d,p){var b=o.flags;switch(o.tag){case 0:case 11:case 15:li(a,o,d,p),b&2048&&Tu(9,o);break;case 1:li(a,o,d,p);break;case 3:li(a,o,d,p),b&2048&&(a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&vu(a)));break;case 12:if(b&2048){li(a,o,d,p),a=o.stateNode;try{var j=o.memoizedProps,O=j.id,M=j.onPostCommit;typeof M=="function"&&M(O,o.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch($){gt(o,o.return,$)}}else li(a,o,d,p);break;case 31:li(a,o,d,p);break;case 13:li(a,o,d,p);break;case 23:break;case 22:j=o.stateNode,O=o.alternate,o.memoizedState!==null?j._visibility&2?li(a,o,d,p):zu(a,o):j._visibility&2?li(a,o,d,p):(j._visibility|=2,Ll(a,o,d,p,(o.subtreeFlags&10256)!==0||!1)),b&2048&&Wv(O,o);break;case 24:li(a,o,d,p),b&2048&&Qv(o.alternate,o);break;default:li(a,o,d,p)}}function Ll(a,o,d,p,b){for(b=b&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var j=a,O=o,M=d,$=p,ee=O.flags;switch(O.tag){case 0:case 11:case 15:Ll(j,O,M,$,b),Tu(8,O);break;case 23:break;case 22:var se=O.stateNode;O.memoizedState!==null?se._visibility&2?Ll(j,O,M,$,b):zu(j,O):(se._visibility|=2,Ll(j,O,M,$,b)),b&&ee&2048&&Wv(O.alternate,O);break;case 24:Ll(j,O,M,$,b),b&&ee&2048&&Qv(O.alternate,O);break;default:Ll(j,O,M,$,b)}o=o.sibling}}function zu(a,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var d=a,p=o,b=p.flags;switch(p.tag){case 22:zu(d,p),b&2048&&Wv(p.alternate,p);break;case 24:zu(d,p),b&2048&&Qv(p.alternate,p);break;default:zu(d,p)}o=o.sibling}}var Mu=8192;function Il(a,o,d){if(a.subtreeFlags&Mu)for(a=a.child;a!==null;)E_(a,o,d),a=a.sibling}function E_(a,o,d){switch(a.tag){case 26:Il(a,o,d),a.flags&Mu&&a.memoizedState!==null&&v6(d,oi,a.memoizedState,a.memoizedProps);break;case 5:Il(a,o,d);break;case 3:case 4:var p=oi;oi=Ah(a.stateNode.containerInfo),Il(a,o,d),oi=p;break;case 22:a.memoizedState===null&&(p=a.alternate,p!==null&&p.memoizedState!==null?(p=Mu,Mu=16777216,Il(a,o,d),Mu=p):Il(a,o,d));break;default:Il(a,o,d)}}function T_(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 Ru(a){var o=a.deletions;if((a.flags&16)!==0){if(o!==null)for(var d=0;d<o.length;d++){var p=o[d];wn=p,z_(p,a)}T_(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)P_(a),a=a.sibling}function P_(a){switch(a.tag){case 0:case 11:case 15:Ru(a),a.flags&2048&&Wa(9,a,a.return);break;case 3:Ru(a);break;case 12:Ru(a);break;case 22:var o=a.stateNode;a.memoizedState!==null&&o._visibility&2&&(a.return===null||a.return.tag!==13)?(o._visibility&=-3,gh(a)):Ru(a);break;default:Ru(a)}}function gh(a){var o=a.deletions;if((a.flags&16)!==0){if(o!==null)for(var d=0;d<o.length;d++){var p=o[d];wn=p,z_(p,a)}T_(a)}for(a=a.child;a!==null;){switch(o=a,o.tag){case 0:case 11:case 15:Wa(8,o,o.return),gh(o);break;case 22:d=o.stateNode,d._visibility&2&&(d._visibility&=-3,gh(o));break;default:gh(o)}a=a.sibling}}function z_(a,o){for(;wn!==null;){var d=wn;switch(d.tag){case 0:case 11:case 15:Wa(8,d,o);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var p=d.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:vu(d.memoizedState.cache)}if(p=d.child,p!==null)p.return=d,wn=p;else e:for(d=a;wn!==null;){p=wn;var b=p.sibling,j=p.return;if(j_(p),p===d){wn=null;break e}if(b!==null){b.return=j,wn=b;break e}wn=j}}}var zU={getCacheForType:function(a){var o=kn(an),d=o.data.get(a);return d===void 0&&(d=a(),o.data.set(a,d)),d},cacheSignal:function(){return kn(an).controller.signal}},MU=typeof WeakMap=="function"?WeakMap:Map,dt=0,Ct=null,Ve=null,We=0,mt=0,xr=null,Qa=!1,$l=!1,Xv=!1,ha=0,Zt=0,Xa=0,lo=0,Jv=0,wr=0,Ul=0,Du=null,or=null,e0=!1,yh=0,M_=0,vh=1/0,bh=null,Ja=null,hn=0,es=null,Bl=null,pa=0,t0=0,n0=null,R_=null,Lu=0,r0=null;function Sr(){return(dt&2)!==0&&We!==0?We&-We:G.T!==null?c0():hl()}function D_(){if(wr===0)if((We&536870912)===0||tt){var a=dl;dl<<=1,(dl&3932160)===0&&(dl=262144),wr=a}else wr=536870912;return a=vr.current,a!==null&&(a.flags|=32),wr}function lr(a,o,d){(a===Ct&&(mt===2||mt===9)||a.cancelPendingCommit!==null)&&(ql(a,0),ts(a,We,wr,!1)),Hs(a,d),((dt&2)===0||a!==Ct)&&(a===Ct&&((dt&2)===0&&(lo|=d),Zt===4&&ts(a,We,wr,!1)),Ei(a))}function L_(a,o,d){if((dt&6)!==0)throw Error(r(327));var p=!d&&(o&127)===0&&(o&a.expiredLanes)===0||Da(a,o),b=p?LU(a,o):a0(a,o,!0),j=p;do{if(b===0){$l&&!p&&ts(a,o,0,!1);break}else{if(d=a.current.alternate,j&&!RU(d)){b=a0(a,o,!1),j=!1;continue}if(b===2){if(j=o,a.errorRecoveryDisabledLanes&j)var O=0;else O=a.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){o=O;e:{var M=a;b=Du;var $=M.current.memoizedState.isDehydrated;if($&&(ql(M,O).flags|=256),O=a0(M,O,!1),O!==2){if(Xv&&!$){M.errorRecoveryDisabledLanes|=j,lo|=j,b=4;break e}j=or,or=b,j!==null&&(or===null?or=j:or.push.apply(or,j))}b=O}if(j=!1,b!==2)continue}}if(b===1){ql(a,0),ts(a,o,0,!0);break}e:{switch(p=a,j=b,j){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:ts(p,o,wr,!Qa);break e;case 2:or=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(b=yh+300-et(),10<b)){if(ts(p,o,wr,!Qa),fl(p,0,!0)!==0)break e;pa=o,p.timeoutHandle=pO(I_.bind(null,p,d,or,bh,e0,o,wr,lo,Ul,Qa,j,"Throttled",-0,0),b);break e}I_(p,d,or,bh,e0,o,wr,lo,Ul,Qa,j,null,-0,0)}}break}while(!0);Ei(a)}function I_(a,o,d,p,b,j,O,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:Ji},E_(o,j,fe);var Oe=(j&62914560)===j?yh-et():(j&4194048)===j?M_-et():0;if(Oe=b6(fe,Oe),Oe!==null){pa=j,a.cancelPendingCommit=Oe(G_.bind(null,a,o,j,d,p,b,O,M,$,se,fe,null,te,ie)),ts(a,j,O,!ee);return}}G_(a,o,j,d,p,b,O,M,$)}function RU(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 p=0;p<d.length;p++){var b=d[p],j=b.getSnapshot;b=b.value;try{if(!gr(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 ts(a,o,d,p){o&=~Jv,o&=~lo,a.suspendedLanes|=o,a.pingedLanes&=~o,p&&(a.warmLanes|=o),p=a.expirationTimes;for(var b=o;0<b;){var j=31-xe(b),O=1<<j;p[j]=-1,b&=~O}d!==0&&V(a,d,o)}function xh(){return(dt&6)===0?(Iu(0),!1):!0}function i0(){if(Ve!==null){if(mt===0)var a=Ve.return;else a=Ve,ra=Js=null,xv(a),Pl=null,xu=0,a=Ve;for(;a!==null;)m_(a.alternate,a),a=a.return;Ve=null}}function ql(a,o){var d=a.timeoutHandle;d!==-1&&(a.timeoutHandle=-1,t6(d)),d=a.cancelPendingCommit,d!==null&&(a.cancelPendingCommit=null,d()),pa=0,i0(),Ct=a,Ve=d=ta(a.current,null),We=o,mt=0,xr=null,Qa=!1,$l=Da(a,o),Xv=!1,Ul=wr=Jv=lo=Xa=Zt=0,or=Du=null,e0=!1,(o&8)!==0&&(o|=o&32);var p=a.entangledLanes;if(p!==0)for(a=a.entanglements,p&=o;0<p;){var b=31-xe(p),j=1<<b;o|=a[b],p&=~j}return ha=o,Bf(),d}function $_(a,o){qe=null,G.H=ku,o===Tl||o===Yf?(o=tC(),mt=3):o===lv?(o=tC(),mt=4):mt=o===Dv?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,xr=o,Ve===null&&(Zt=1,ch(a,Mr(o,a.current)))}function U_(){var a=vr.current;return a===null?!0:(We&4194048)===We?Ir===null:(We&62914560)===We||(We&536870912)!==0?a===Ir:!1}function B_(){var a=G.H;return G.H=ku,a===null?ku:a}function q_(){var a=G.A;return G.A=zU,a}function wh(){Zt=4,Qa||(We&4194048)!==We&&vr.current!==null||($l=!0),(Xa&134217727)===0&&(lo&134217727)===0||Ct===null||ts(Ct,We,wr,!1)}function a0(a,o,d){var p=dt;dt|=2;var b=B_(),j=q_();(Ct!==a||We!==o)&&(bh=null,ql(a,o)),o=!1;var O=Zt;e:do try{if(mt!==0&&Ve!==null){var M=Ve,$=xr;switch(mt){case 8:i0(),O=6;break e;case 3:case 2:case 9:case 6:vr.current===null&&(o=!0);var ee=mt;if(mt=0,xr=null,Fl(a,M,$,ee),d&&$l){O=0;break e}break;default:ee=mt,mt=0,xr=null,Fl(a,M,$,ee)}}DU(),O=Zt;break}catch(se){$_(a,se)}while(!0);return o&&a.shellSuspendCounter++,ra=Js=null,dt=p,G.H=b,G.A=j,Ve===null&&(Ct=null,We=0,Bf()),O}function DU(){for(;Ve!==null;)F_(Ve)}function LU(a,o){var d=dt;dt|=2;var p=B_(),b=q_();Ct!==a||We!==o?(bh=null,vh=et()+500,ql(a,o)):$l=Da(a,o);e:do try{if(mt!==0&&Ve!==null){o=Ve;var j=xr;t:switch(mt){case 1:mt=0,xr=null,Fl(a,o,j,1);break;case 2:case 9:if(JN(j)){mt=0,xr=null,K_(o);break}o=function(){mt!==2&&mt!==9||Ct!==a||(mt=7),Ei(a)},j.then(o,o);break e;case 3:mt=7;break e;case 4:mt=5;break e;case 7:JN(j)?(mt=0,xr=null,K_(o)):(mt=0,xr=null,Fl(a,o,j,7));break;case 5:var O=null;switch(Ve.tag){case 26:O=Ve.memoizedState;case 5:case 27:var M=Ve;if(O?AO(O):M.stateNode.complete){mt=0,xr=null;var $=M.sibling;if($!==null)Ve=$;else{var ee=M.return;ee!==null?(Ve=ee,Sh(ee)):Ve=null}break t}}mt=0,xr=null,Fl(a,o,j,5);break;case 6:mt=0,xr=null,Fl(a,o,j,6);break;case 8:i0(),Zt=6;break e;default:throw Error(r(462))}}IU();break}catch(se){$_(a,se)}while(!0);return ra=Js=null,G.H=p,G.A=b,dt=d,Ve!==null?0:(Ct=null,We=0,Bf(),Zt)}function IU(){for(;Ve!==null&&!xt();)F_(Ve)}function F_(a){var o=h_(a.alternate,a,ha);a.memoizedProps=a.pendingProps,o===null?Sh(a):Ve=o}function K_(a){var o=a,d=o.alternate;switch(o.tag){case 15:case 0:o=o_(d,o,o.pendingProps,o.type,void 0,We);break;case 11:o=o_(d,o,o.pendingProps,o.type.render,o.ref,We);break;case 5:xv(o);default:m_(d,o),o=Ve=qN(o,ha),o=h_(d,o,ha)}a.memoizedProps=a.pendingProps,o===null?Sh(a):Ve=o}function Fl(a,o,d,p){ra=Js=null,xv(o),Pl=null,xu=0;var b=o.return;try{if(_U(a,b,o,d,We)){Zt=1,ch(a,Mr(d,a.current)),Ve=null;return}}catch(j){if(b!==null)throw Ve=b,j;Zt=1,ch(a,Mr(d,a.current)),Ve=null;return}o.flags&32768?(tt||p===1?a=!0:$l||(We&536870912)!==0?a=!1:(Qa=a=!0,(p===2||p===9||p===3||p===6)&&(p=vr.current,p!==null&&p.tag===13&&(p.flags|=16384))),H_(o,a)):Sh(o)}function Sh(a){var o=a;do{if((o.flags&32768)!==0){H_(o,Qa);return}a=o.return;var d=AU(o.alternate,o,ha);if(d!==null){Ve=d;return}if(o=o.sibling,o!==null){Ve=o;return}Ve=o=a}while(o!==null);Zt===0&&(Zt=5)}function H_(a,o){do{var d=EU(a.alternate,a);if(d!==null){d.flags&=32767,Ve=d;return}if(d=a.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!o&&(a=a.sibling,a!==null)){Ve=a;return}Ve=a=d}while(a!==null);Zt=6,Ve=null}function G_(a,o,d,p,b,j,O,M,$){a.cancelPendingCommit=null;do jh();while(hn!==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|=Vy,Of(a,d,j,O,M,$),a===Ct&&(Ve=Ct=null,We=0),Bl=o,es=a,pa=d,t0=j,n0=b,R_=p,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,qU(Ye,function(){return Q_(),null})):(a.callbackNode=null,a.callbackPriority=0),p=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||p){p=G.T,G.T=null,b=re.p,re.p=2,O=dt,dt|=4;try{TU(a,o,d)}finally{dt=O,re.p=b,G.T=p}}hn=1,V_(),Z_(),Y_()}}function V_(){if(hn===1){hn=0;var a=es,o=Bl,d=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||d){d=G.T,G.T=null;var p=re.p;re.p=2;var b=dt;dt|=4;try{O_(o,a);var j=y0,O=zN(a.containerInfo),M=j.focusedElem,$=j.selectionRange;if(O!==M&&M&&M.ownerDocument&&PN(M.ownerDocument.documentElement,M)){if($!==null&&qy(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(),Oe=M.textContent.length,Ie=Math.min($.start,Oe),jt=$.end===void 0?Ie:Math.min($.end,Oe);!ie.extend&&Ie>jt&&(O=jt,jt=Ie,Ie=O);var Y=TN(M,Ie),q=TN(M,jt);if(Y&&q&&(ie.rangeCount!==1||ie.anchorNode!==Y.node||ie.anchorOffset!==Y.offset||ie.focusNode!==q.node||ie.focusOffset!==q.offset)){var J=fe.createRange();J.setStart(Y.node,Y.offset),ie.removeAllRanges(),Ie>jt?(ie.addRange(J),ie.extend(q.node,q.offset)):(J.setEnd(q.node,q.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 ue=fe[M];ue.element.scrollLeft=ue.left,ue.element.scrollTop=ue.top}}Rh=!!g0,y0=g0=null}finally{dt=b,re.p=p,G.T=d}}a.current=o,hn=2}}function Z_(){if(hn===2){hn=0;var a=es,o=Bl,d=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||d){d=G.T,G.T=null;var p=re.p;re.p=2;var b=dt;dt|=4;try{S_(a,o.alternate,o)}finally{dt=b,re.p=p,G.T=d}}hn=3}}function Y_(){if(hn===4||hn===3){hn=0,xn();var a=es,o=Bl,d=pa,p=R_;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?hn=5:(hn=0,Bl=es=null,W_(a,a.pendingLanes));var b=a.pendingLanes;if(b===0&&(Ja=null),Kn(d),o=o.stateNode,Nt&&typeof Nt.onCommitFiberRoot=="function")try{Nt.onCommitFiberRoot(ii,o,void 0,(o.current.flags&128)===128)}catch{}if(p!==null){o=G.T,b=re.p,re.p=2,G.T=null;try{for(var j=a.onRecoverableError,O=0;O<p.length;O++){var M=p[O];j(M.value,{componentStack:M.stack})}}finally{G.T=o,re.p=b}}(pa&3)!==0&&jh(),Ei(a),b=a.pendingLanes,(d&261930)!==0&&(b&42)!==0?a===r0?Lu++:(Lu=0,r0=a):Lu=0,Iu(0)}}function W_(a,o){(a.pooledCacheLanes&=o)===0&&(o=a.pooledCache,o!=null&&(a.pooledCache=null,vu(o)))}function jh(){return V_(),Z_(),Y_(),Q_()}function Q_(){if(hn!==5)return!1;var a=es,o=t0;t0=0;var d=Kn(pa),p=G.T,b=re.p;try{re.p=32>d?32:d,G.T=null,d=n0,n0=null;var j=es,O=pa;if(hn=0,Bl=es=null,pa=0,(dt&6)!==0)throw Error(r(331));var M=dt;if(dt|=4,P_(j.current),A_(j,j.current,O,d),dt=M,Iu(0,!1),Nt&&typeof Nt.onPostCommitFiberRoot=="function")try{Nt.onPostCommitFiberRoot(ii,j)}catch{}return!0}finally{re.p=b,G.T=p,W_(a,o)}}function X_(a,o,d){o=Mr(d,o),o=Rv(a.stateNode,o,2),a=Va(a,o,2),a!==null&&(Hs(a,2),Ei(a))}function gt(a,o,d){if(a.tag===3)X_(a,a,d);else for(;o!==null;){if(o.tag===3){X_(o,a,d);break}else if(o.tag===1){var p=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Ja===null||!Ja.has(p))){a=Mr(d,a),d=JC(2),p=Va(o,d,2),p!==null&&(e_(d,p,o,a),Hs(p,2),Ei(p));break}}o=o.return}}function s0(a,o,d){var p=a.pingCache;if(p===null){p=a.pingCache=new MU;var b=new Set;p.set(o,b)}else b=p.get(o),b===void 0&&(b=new Set,p.set(o,b));b.has(d)||(Xv=!0,b.add(d),a=$U.bind(null,a,o,d),o.then(a,a))}function $U(a,o,d){var p=a.pingCache;p!==null&&p.delete(o),a.pingedLanes|=a.suspendedLanes&d,a.warmLanes&=~d,Ct===a&&(We&d)===d&&(Zt===4||Zt===3&&(We&62914560)===We&&300>et()-yh?(dt&2)===0&&ql(a,0):Jv|=d,Ul===We&&(Ul=0)),Ei(a)}function J_(a,o){o===0&&(o=_f()),a=Ws(a,o),a!==null&&(Hs(a,o),Ei(a))}function UU(a){var o=a.memoizedState,d=0;o!==null&&(d=o.retryLane),J_(a,d)}function BU(a,o){var d=0;switch(a.tag){case 31:case 13:var p=a.stateNode,b=a.memoizedState;b!==null&&(d=b.retryLane);break;case 19:p=a.stateNode;break;case 22:p=a.stateNode._retryCache;break;default:throw Error(r(314))}p!==null&&p.delete(o),J_(a,d)}function qU(a,o){return he(a,o)}var Nh=null,Kl=null,o0=!1,Ch=!1,l0=!1,ns=0;function Ei(a){a!==Kl&&a.next===null&&(Kl===null?Nh=Kl=a:Kl=Kl.next=a),Ch=!0,o0||(o0=!0,KU())}function Iu(a,o){if(!l0&&Ch){l0=!0;do for(var d=!1,p=Nh;p!==null;){if(a!==0){var b=p.pendingLanes;if(b===0)var j=0;else{var O=p.suspendedLanes,M=p.pingedLanes;j=(1<<31-xe(42|a)+1)-1,j&=b&~(O&~M),j=j&201326741?j&201326741|1:j?j|2:0}j!==0&&(d=!0,rO(p,j))}else j=We,j=fl(p,p===Ct?j:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(j&3)===0||Da(p,j)||(d=!0,rO(p,j));p=p.next}while(d);l0=!1}}function FU(){eO()}function eO(){Ch=o0=!1;var a=0;ns!==0&&e6()&&(a=ns);for(var o=et(),d=null,p=Nh;p!==null;){var b=p.next,j=tO(p,o);j===0?(p.next=null,d===null?Nh=b:d.next=b,b===null&&(Kl=d)):(d=p,(a!==0||(j&3)!==0)&&(Ch=!0)),p=b}hn!==0&&hn!==5||Iu(a),ns!==0&&(ns=0)}function tO(a,o){for(var d=a.suspendedLanes,p=a.pingedLanes,b=a.expirationTimes,j=a.pendingLanes&-62914561;0<j;){var O=31-xe(j),M=1<<O,$=b[O];$===-1?((M&d)===0||(M&p)!==0)&&(b[O]=Cy(M,o)):$<=o&&(a.expiredLanes|=M),j&=~M}if(o=Ct,d=We,d=fl(a,a===o?d:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),p=a.callbackNode,d===0||a===o&&(mt===2||mt===9)||a.cancelPendingCommit!==null)return p!==null&&p!==null&&Je(p),a.callbackNode=null,a.callbackPriority=0;if((d&3)===0||Da(a,d)){if(o=d&-d,o===a.callbackPriority)return o;switch(p!==null&&Je(p),Kn(d)){case 2:case 8:d=Bt;break;case 32:d=Ye;break;case 268435456:d=tr;break;default:d=Ye}return p=nO.bind(null,a),d=he(d,p),a.callbackPriority=o,a.callbackNode=d,o}return p!==null&&p!==null&&Je(p),a.callbackPriority=2,a.callbackNode=null,2}function nO(a,o){if(hn!==0&&hn!==5)return a.callbackNode=null,a.callbackPriority=0,null;var d=a.callbackNode;if(jh()&&a.callbackNode!==d)return null;var p=We;return p=fl(a,a===Ct?p:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),p===0?null:(L_(a,p,o),tO(a,et()),a.callbackNode!=null&&a.callbackNode===d?nO.bind(null,a):null)}function rO(a,o){if(jh())return null;L_(a,o,!0)}function KU(){n6(function(){(dt&6)!==0?he(at,FU):eO()})}function c0(){if(ns===0){var a=Al;a===0&&(a=Ks,Ks<<=1,(Ks&261888)===0&&(Ks=256)),ns=a}return ns}function iO(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:zf(""+a)}function aO(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 HU(a,o,d,p,b){if(o==="submit"&&d&&d.stateNode===b){var j=iO((b[In]||null).action),O=p.submitter;O&&(o=(o=O[In]||null)?iO(o.formAction):O.getAttribute("formAction"),o!==null&&(j=o,O=null));var M=new Lf("action","action",null,p,b);a.push({event:M,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(ns!==0){var $=O?aO(b,O):new FormData(b);Av(d,{pending:!0,data:$,method:b.method,action:j},null,$)}}else typeof j=="function"&&(M.preventDefault(),$=O?aO(b,O):new FormData(b),Av(d,{pending:!0,data:$,method:b.method,action:j},j,$))},currentTarget:b}]})}}for(var u0=0;u0<Gy.length;u0++){var d0=Gy[u0],GU=d0.toLowerCase(),VU=d0[0].toUpperCase()+d0.slice(1);si(GU,"on"+VU)}si(DN,"onAnimationEnd"),si(LN,"onAnimationIteration"),si(IN,"onAnimationStart"),si("dblclick","onDoubleClick"),si("focusin","onFocus"),si("focusout","onBlur"),si(cU,"onTransitionRun"),si(uU,"onTransitionStart"),si(dU,"onTransitionCancel"),si($N,"onTransitionEnd"),ml("onMouseEnter",["mouseout","mouseover"]),ml("onMouseLeave",["mouseout","mouseover"]),ml("onPointerEnter",["pointerout","pointerover"]),ml("onPointerLeave",["pointerout","pointerover"]),_i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),_i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),_i("onBeforeInput",["compositionend","keypress","textInput","paste"]),_i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),_i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),_i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $u="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(" "),ZU=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat($u));function sO(a,o){o=(o&4)!==0;for(var d=0;d<a.length;d++){var p=a[d],b=p.event;p=p.listeners;e:{var j=void 0;if(o)for(var O=p.length-1;0<=O;O--){var M=p[O],$=M.instance,ee=M.currentTarget;if(M=M.listener,$!==j&&b.isPropagationStopped())break e;j=M,b.currentTarget=ee;try{j(b)}catch(se){Uf(se)}b.currentTarget=null,j=$}else for(O=0;O<p.length;O++){if(M=p[O],$=M.instance,ee=M.currentTarget,M=M.listener,$!==j&&b.isPropagationStopped())break e;j=M,b.currentTarget=ee;try{j(b)}catch(se){Uf(se)}b.currentTarget=null,j=$}}}}function Ze(a,o){var d=o[Qi];d===void 0&&(d=o[Qi]=new Set);var p=a+"__bubble";d.has(p)||(oO(o,a,2,!1),d.add(p))}function f0(a,o,d){var p=0;o&&(p|=4),oO(d,a,p,o)}var _h="_reactListening"+Math.random().toString(36).slice(2);function h0(a){if(!a[_h]){a[_h]=!0,ai.forEach(function(d){d!=="selectionchange"&&(ZU.has(d)||f0(d,!1,a),f0(d,!0,a))});var o=a.nodeType===9?a:a.ownerDocument;o===null||o[_h]||(o[_h]=!0,f0("selectionchange",!1,o))}}function oO(a,o,d,p){switch(DO(o)){case 2:var b=S6;break;case 8:b=j6;break;default:b=k0}d=b.bind(null,o,d,a),b=void 0,!zy||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(b=!0),p?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 p0(a,o,d,p,b){var j=p;if((o&1)===0&&(o&2)===0&&p!==null)e:for(;;){if(p===null)return;var O=p.tag;if(O===3||O===4){var M=p.stateNode.containerInfo;if(M===b)break;if(O===4)for(O=p.return;O!==null;){var $=O.tag;if(($===3||$===4)&&O.stateNode.containerInfo===b)return;O=O.return}for(;M!==null;){if(O=Ia(M),O===null)return;if($=O.tag,$===5||$===6||$===26||$===27){p=j=O;continue e}M=M.parentNode}}p=p.return}fN(function(){var ee=j,se=Ty(d),fe=[];e:{var te=UN.get(a);if(te!==void 0){var ie=Lf,Oe=a;switch(a){case"keypress":if(Rf(d)===0)break e;case"keydown":case"keyup":ie=B4;break;case"focusin":Oe="focus",ie=Ly;break;case"focusout":Oe="blur",ie=Ly;break;case"beforeblur":case"afterblur":ie=Ly;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=mN;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=A4;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=K4;break;case DN:case LN:case IN:ie=P4;break;case $N:ie=G4;break;case"scroll":case"scrollend":ie=O4;break;case"wheel":ie=Z4;break;case"copy":case"cut":case"paste":ie=M4;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=yN;break;case"toggle":case"beforetoggle":ie=W4}var Ie=(o&4)!==0,jt=!Ie&&(a==="scroll"||a==="scrollend"),Y=Ie?te!==null?te+"Capture":null:te;Ie=[];for(var q=ee,J;q!==null;){var ue=q;if(J=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||J===null||Y===null||(ue=ou(q,Y),ue!=null&&Ie.push(Uu(q,ue,J))),jt)break;q=q.return}0<Ie.length&&(te=new ie(te,Oe,null,d,se),fe.push({event:te,listeners:Ie}))}}if((o&7)===0){e:{if(te=a==="mouseover"||a==="pointerover",ie=a==="mouseout"||a==="pointerout",te&&d!==Ey&&(Oe=d.relatedTarget||d.fromElement)&&(Ia(Oe)||Oe[mr]))break e;if((ie||te)&&(te=se.window===se?se:(te=se.ownerDocument)?te.defaultView||te.parentWindow:window,ie?(Oe=d.relatedTarget||d.toElement,ie=ee,Oe=Oe?Ia(Oe):null,Oe!==null&&(jt=s(Oe),Ie=Oe.tag,Oe!==jt||Ie!==5&&Ie!==27&&Ie!==6)&&(Oe=null)):(ie=null,Oe=ee),ie!==Oe)){if(Ie=mN,ue="onMouseLeave",Y="onMouseEnter",q="mouse",(a==="pointerout"||a==="pointerover")&&(Ie=yN,ue="onPointerLeave",Y="onPointerEnter",q="pointer"),jt=ie==null?te:He(ie),J=Oe==null?te:He(Oe),te=new Ie(ue,q+"leave",ie,d,se),te.target=jt,te.relatedTarget=J,ue=null,Ia(se)===ee&&(Ie=new Ie(Y,q+"enter",Oe,d,se),Ie.target=J,Ie.relatedTarget=jt,ue=Ie),jt=ue,ie&&Oe)t:{for(Ie=YU,Y=ie,q=Oe,J=0,ue=Y;ue;ue=Ie(ue))J++;ue=0;for(var De=q;De;De=Ie(De))ue++;for(;0<J-ue;)Y=Ie(Y),J--;for(;0<ue-J;)q=Ie(q),ue--;for(;J--;){if(Y===q||q!==null&&Y===q.alternate){Ie=Y;break t}Y=Ie(Y),q=Ie(q)}Ie=null}else Ie=null;ie!==null&&lO(fe,te,ie,Ie,!1),Oe!==null&&jt!==null&&lO(fe,jt,Oe,Ie,!0)}}e:{if(te=ee?He(ee):window,ie=te.nodeName&&te.nodeName.toLowerCase(),ie==="select"||ie==="input"&&te.type==="file")var ot=CN;else if(jN(te))if(_N)ot=sU;else{ot=iU;var Te=rU}else ie=te.nodeName,!ie||ie.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?ee&&Ay(ee.elementType)&&(ot=CN):ot=aU;if(ot&&(ot=ot(a,ee))){NN(fe,ot,d,se);break e}Te&&Te(a,te,ee),a==="focusout"&&ee&&te.type==="number"&&ee.memoizedProps.value!=null&&ky(te,"number",te.value)}switch(Te=ee?He(ee):window,a){case"focusin":(jN(Te)||Te.contentEditable==="true")&&(wl=Te,Fy=ee,mu=null);break;case"focusout":mu=Fy=wl=null;break;case"mousedown":Ky=!0;break;case"contextmenu":case"mouseup":case"dragend":Ky=!1,MN(fe,d,se);break;case"selectionchange":if(lU)break;case"keydown":case"keyup":MN(fe,d,se)}var Fe;if($y)e:{switch(a){case"compositionstart":var Qe="onCompositionStart";break e;case"compositionend":Qe="onCompositionEnd";break e;case"compositionupdate":Qe="onCompositionUpdate";break e}Qe=void 0}else xl?wN(a,d)&&(Qe="onCompositionEnd"):a==="keydown"&&d.keyCode===229&&(Qe="onCompositionStart");Qe&&(vN&&d.locale!=="ko"&&(xl||Qe!=="onCompositionStart"?Qe==="onCompositionEnd"&&xl&&(Fe=hN()):(Ua=se,My="value"in Ua?Ua.value:Ua.textContent,xl=!0)),Te=Oh(ee,Qe),0<Te.length&&(Qe=new gN(Qe,a,null,d,se),fe.push({event:Qe,listeners:Te}),Fe?Qe.data=Fe:(Fe=SN(d),Fe!==null&&(Qe.data=Fe)))),(Fe=X4?J4(a,d):eU(a,d))&&(Qe=Oh(ee,"onBeforeInput"),0<Qe.length&&(Te=new gN("onBeforeInput","beforeinput",null,d,se),fe.push({event:Te,listeners:Qe}),Te.data=Fe)),HU(fe,a,ee,d,se)}sO(fe,o)})}function Uu(a,o,d){return{instance:a,listener:o,currentTarget:d}}function Oh(a,o){for(var d=o+"Capture",p=[];a!==null;){var b=a,j=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||j===null||(b=ou(a,d),b!=null&&p.unshift(Uu(a,b,j)),b=ou(a,o),b!=null&&p.push(Uu(a,b,j))),a.tag===3)return p;a=a.return}return[]}function YU(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function lO(a,o,d,p,b){for(var j=o._reactName,O=[];d!==null&&d!==p;){var M=d,$=M.alternate,ee=M.stateNode;if(M=M.tag,$!==null&&$===p)break;M!==5&&M!==26&&M!==27||ee===null||($=ee,b?(ee=ou(d,j),ee!=null&&O.unshift(Uu(d,ee,$))):b||(ee=ou(d,j),ee!=null&&O.push(Uu(d,ee,$)))),d=d.return}O.length!==0&&a.push({event:o,listeners:O})}var WU=/\r\n?/g,QU=/\u0000|\uFFFD/g;function cO(a){return(typeof a=="string"?a:""+a).replace(WU,`
9
+ `).replace(QU,"")}function uO(a,o){return o=cO(o),cO(a)===o}function St(a,o,d,p,b,j){switch(d){case"children":typeof p=="string"?o==="body"||o==="textarea"&&p===""||yl(a,p):(typeof p=="number"||typeof p=="bigint")&&o!=="body"&&yl(a,""+p);break;case"className":Tf(a,"class",p);break;case"tabIndex":Tf(a,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":Tf(a,d,p);break;case"style":uN(a,p,j);break;case"data":if(o!=="object"){Tf(a,"data",p);break}case"src":case"href":if(p===""&&(o!=="a"||d!=="href")){a.removeAttribute(d);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){a.removeAttribute(d);break}p=zf(""+p),a.setAttribute(d,p);break;case"action":case"formAction":if(typeof p=="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"&&St(a,o,"name",b.name,b,null),St(a,o,"formEncType",b.formEncType,b,null),St(a,o,"formMethod",b.formMethod,b,null),St(a,o,"formTarget",b.formTarget,b,null)):(St(a,o,"encType",b.encType,b,null),St(a,o,"method",b.method,b,null),St(a,o,"target",b.target,b,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){a.removeAttribute(d);break}p=zf(""+p),a.setAttribute(d,p);break;case"onClick":p!=null&&(a.onclick=Ji);break;case"onScroll":p!=null&&Ze("scroll",a);break;case"onScrollEnd":p!=null&&Ze("scrollend",a);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(d=p.__html,d!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=d}}break;case"multiple":a.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":a.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){a.removeAttribute("xlink:href");break}d=zf(""+p),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":p!=null&&typeof p!="function"&&typeof p!="symbol"?a.setAttribute(d,""+p):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":p&&typeof p!="function"&&typeof p!="symbol"?a.setAttribute(d,""):a.removeAttribute(d);break;case"capture":case"download":p===!0?a.setAttribute(d,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?a.setAttribute(d,p):a.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?a.setAttribute(d,p):a.removeAttribute(d);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?a.removeAttribute(d):a.setAttribute(d,p);break;case"popover":Ze("beforetoggle",a),Ze("toggle",a),Ef(a,"popover",p);break;case"xlinkActuate":Xi(a,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":Xi(a,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":Xi(a,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":Xi(a,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":Xi(a,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":Xi(a,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":Xi(a,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":Xi(a,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":Xi(a,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":Ef(a,"is",p);break;case"innerText":case"textContent":break;default:(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(d=C4.get(d)||d,Ef(a,d,p))}}function m0(a,o,d,p,b,j){switch(d){case"style":uN(a,p,j);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(d=p.__html,d!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=d}}break;case"children":typeof p=="string"?yl(a,p):(typeof p=="number"||typeof p=="bigint")&&yl(a,""+p);break;case"onScroll":p!=null&&Ze("scroll",a);break;case"onScrollEnd":p!=null&&Ze("scrollend",a);break;case"onClick":p!=null&&(a.onclick=Ji);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Gs.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[In]||null,j=j!=null?j[d]:null,typeof j=="function"&&a.removeEventListener(o,j,b),typeof p=="function")){typeof j!="function"&&j!==null&&(d in a?a[d]=null:a.hasAttribute(d)&&a.removeAttribute(d)),a.addEventListener(o,p,b);break e}d in a?a[d]=p:p===!0?a.setAttribute(d,""):Ef(a,d,p)}}}function En(a,o,d){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ze("error",a),Ze("load",a);var p=!1,b=!1,j;for(j in d)if(d.hasOwnProperty(j)){var O=d[j];if(O!=null)switch(j){case"src":p=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:St(a,o,j,O,d,null)}}b&&St(a,o,"srcSet",d.srcSet,d,null),p&&St(a,o,"src",d.src,d,null);return;case"input":Ze("invalid",a);var M=j=O=b=null,$=null,ee=null;for(p in d)if(d.hasOwnProperty(p)){var se=d[p];if(se!=null)switch(p){case"name":b=se;break;case"type":O=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:St(a,o,p,se,d,null)}}sN(a,j,M,$,ee,O,b,!1);return;case"select":Ze("invalid",a),p=O=j=null;for(b in d)if(d.hasOwnProperty(b)&&(M=d[b],M!=null))switch(b){case"value":j=M;break;case"defaultValue":O=M;break;case"multiple":p=M;default:St(a,o,b,M,d,null)}o=j,d=O,a.multiple=!!p,o!=null?gl(a,!!p,o,!1):d!=null&&gl(a,!!p,d,!0);return;case"textarea":Ze("invalid",a),j=b=p=null;for(O in d)if(d.hasOwnProperty(O)&&(M=d[O],M!=null))switch(O){case"value":p=M;break;case"defaultValue":b=M;break;case"children":j=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(r(91));break;default:St(a,o,O,M,d,null)}lN(a,p,b,j);return;case"option":for($ in d)d.hasOwnProperty($)&&(p=d[$],p!=null)&&($==="selected"?a.selected=p&&typeof p!="function"&&typeof p!="symbol":St(a,o,$,p,d,null));return;case"dialog":Ze("beforetoggle",a),Ze("toggle",a),Ze("cancel",a),Ze("close",a);break;case"iframe":case"object":Ze("load",a);break;case"video":case"audio":for(p=0;p<$u.length;p++)Ze($u[p],a);break;case"image":Ze("error",a),Ze("load",a);break;case"details":Ze("toggle",a);break;case"embed":case"source":case"link":Ze("error",a),Ze("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)&&(p=d[ee],p!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:St(a,o,ee,p,d,null)}return;default:if(Ay(o)){for(se in d)d.hasOwnProperty(se)&&(p=d[se],p!==void 0&&m0(a,o,se,p,d,void 0));return}}for(M in d)d.hasOwnProperty(M)&&(p=d[M],p!=null&&St(a,o,M,p,d,null))}function XU(a,o,d,p){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,O=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:p.hasOwnProperty(ie)||St(a,o,ie,null,p,fe)}}for(var te in p){var ie=p[te];if(fe=d[te],p.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":O=ie;break;case"defaultValue":M=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,o));break;default:ie!==fe&&St(a,o,te,ie,p,fe)}}Oy(a,O,M,$,ee,se,j,b);return;case"select":ie=O=M=te=null;for(j in d)if($=d[j],d.hasOwnProperty(j)&&$!=null)switch(j){case"value":break;case"multiple":ie=$;default:p.hasOwnProperty(j)||St(a,o,j,null,p,$)}for(b in p)if(j=p[b],$=d[b],p.hasOwnProperty(b)&&(j!=null||$!=null))switch(b){case"value":te=j;break;case"defaultValue":M=j;break;case"multiple":O=j;default:j!==$&&St(a,o,b,j,p,$)}o=M,d=O,p=ie,te!=null?gl(a,!!d,te,!1):!!p!=!!d&&(o!=null?gl(a,!!d,o,!0):gl(a,!!d,d?[]:"",!1));return;case"textarea":ie=te=null;for(M in d)if(b=d[M],d.hasOwnProperty(M)&&b!=null&&!p.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:St(a,o,M,null,p,b)}for(O in p)if(b=p[O],j=d[O],p.hasOwnProperty(O)&&(b!=null||j!=null))switch(O){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&&St(a,o,O,b,p,j)}oN(a,te,ie);return;case"option":for(var Oe in d)te=d[Oe],d.hasOwnProperty(Oe)&&te!=null&&!p.hasOwnProperty(Oe)&&(Oe==="selected"?a.selected=!1:St(a,o,Oe,null,p,te));for($ in p)te=p[$],ie=d[$],p.hasOwnProperty($)&&te!==ie&&(te!=null||ie!=null)&&($==="selected"?a.selected=te&&typeof te!="function"&&typeof te!="symbol":St(a,o,$,te,p,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 Ie in d)te=d[Ie],d.hasOwnProperty(Ie)&&te!=null&&!p.hasOwnProperty(Ie)&&St(a,o,Ie,null,p,te);for(ee in p)if(te=p[ee],ie=d[ee],p.hasOwnProperty(ee)&&te!==ie&&(te!=null||ie!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(r(137,o));break;default:St(a,o,ee,te,p,ie)}return;default:if(Ay(o)){for(var jt in d)te=d[jt],d.hasOwnProperty(jt)&&te!==void 0&&!p.hasOwnProperty(jt)&&m0(a,o,jt,void 0,p,te);for(se in p)te=p[se],ie=d[se],!p.hasOwnProperty(se)||te===ie||te===void 0&&ie===void 0||m0(a,o,se,te,p,ie);return}}for(var Y in d)te=d[Y],d.hasOwnProperty(Y)&&te!=null&&!p.hasOwnProperty(Y)&&St(a,o,Y,null,p,te);for(fe in p)te=p[fe],ie=d[fe],!p.hasOwnProperty(fe)||te===ie||te==null&&ie==null||St(a,o,fe,te,p,ie)}function dO(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function JU(){if(typeof performance.getEntriesByType=="function"){for(var a=0,o=0,d=performance.getEntriesByType("resource"),p=0;p<d.length;p++){var b=d[p],j=b.transferSize,O=b.initiatorType,M=b.duration;if(j&&M&&dO(O)){for(O=0,M=b.responseEnd,p+=1;p<d.length;p++){var $=d[p],ee=$.startTime;if(ee>M)break;var se=$.transferSize,fe=$.initiatorType;se&&dO(fe)&&($=$.responseEnd,O+=se*($<M?1:(M-ee)/($-ee)))}if(--p,o+=8*(j+O)/(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 g0=null,y0=null;function kh(a){return a.nodeType===9?a:a.ownerDocument}function fO(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 hO(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 v0(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 b0=null;function e6(){var a=window.event;return a&&a.type==="popstate"?a===b0?!1:(b0=a,!0):(b0=null,!1)}var pO=typeof setTimeout=="function"?setTimeout:void 0,t6=typeof clearTimeout=="function"?clearTimeout:void 0,mO=typeof Promise=="function"?Promise:void 0,n6=typeof queueMicrotask=="function"?queueMicrotask:typeof mO<"u"?function(a){return mO.resolve(null).then(a).catch(r6)}:pO;function r6(a){setTimeout(function(){throw a})}function rs(a){return a==="head"}function gO(a,o){var d=o,p=0;do{var b=d.nextSibling;if(a.removeChild(d),b&&b.nodeType===8)if(d=b.data,d==="/$"||d==="/&"){if(p===0){a.removeChild(b),Zl(o);return}p--}else if(d==="$"||d==="$?"||d==="$~"||d==="$!"||d==="&")p++;else if(d==="html")Bu(a.ownerDocument.documentElement);else if(d==="head"){d=a.ownerDocument.head,Bu(d);for(var j=d.firstChild;j;){var O=j.nextSibling,M=j.nodeName;j[Ci]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&j.rel.toLowerCase()==="stylesheet"||d.removeChild(j),j=O}}else d==="body"&&Bu(a.ownerDocument.body);d=b}while(d);Zl(o)}function yO(a,o){var d=a;a=0;do{var p=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||""),p&&p.nodeType===8)if(d=p.data,d==="/$"){if(a===0)break;a--}else d!=="$"&&d!=="$?"&&d!=="$~"&&d!=="$!"||a++;d=p}while(d)}function x0(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":x0(d),La(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}a.removeChild(d)}}function i6(a,o,d,p){for(;a.nodeType===1;){var b=d;if(a.nodeName.toLowerCase()!==o.toLowerCase()){if(!p&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(p){if(!a[Ci])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=$r(a.nextSibling),a===null)break}return null}function a6(a,o,d){if(o==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!d||(a=$r(a.nextSibling),a===null))return null;return a}function vO(a,o){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!o||(a=$r(a.nextSibling),a===null))return null;return a}function w0(a){return a.data==="$?"||a.data==="$~"}function S0(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function s6(a,o){var d=a.ownerDocument;if(a.data==="$~")a._reactRetry=o;else if(a.data!=="$?"||d.readyState!=="loading")o();else{var p=function(){o(),d.removeEventListener("DOMContentLoaded",p)};d.addEventListener("DOMContentLoaded",p),a._reactRetry=p}}function $r(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 j0=null;function bO(a){a=a.nextSibling;for(var o=0;a;){if(a.nodeType===8){var d=a.data;if(d==="/$"||d==="/&"){if(o===0)return $r(a.nextSibling);o--}else d!=="$"&&d!=="$!"&&d!=="$?"&&d!=="$~"&&d!=="&"||o++}a=a.nextSibling}return null}function xO(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 wO(a,o,d){switch(o=kh(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 Bu(a){for(var o=a.attributes;o.length;)a.removeAttributeNode(o[0]);La(a)}var Ur=new Map,SO=new Set;function Ah(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var ma=re.d;re.d={f:o6,r:l6,D:c6,C:u6,L:d6,m:f6,X:p6,S:h6,M:m6};function o6(){var a=ma.f(),o=xh();return a||o}function l6(a){var o=$a(a);o!==null&&o.tag===5&&o.type==="form"?$C(o):ma.r(a)}var Hl=typeof document>"u"?null:document;function jO(a,o,d){var p=Hl;if(p&&typeof o=="string"&&o){var b=Pr(o);b='link[rel="'+a+'"][href="'+b+'"]',typeof d=="string"&&(b+='[crossorigin="'+d+'"]'),SO.has(b)||(SO.add(b),a={rel:a,crossOrigin:d,href:o},p.querySelector(b)===null&&(o=p.createElement("link"),En(o,"link",a),pt(o),p.head.appendChild(o)))}}function c6(a){ma.D(a),jO("dns-prefetch",a,null)}function u6(a,o){ma.C(a,o),jO("preconnect",a,o)}function d6(a,o,d){ma.L(a,o,d);var p=Hl;if(p&&a&&o){var b='link[rel="preload"][as="'+Pr(o)+'"]';o==="image"&&d&&d.imageSrcSet?(b+='[imagesrcset="'+Pr(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(b+='[imagesizes="'+Pr(d.imageSizes)+'"]')):b+='[href="'+Pr(a)+'"]';var j=b;switch(o){case"style":j=Gl(a);break;case"script":j=Vl(a)}Ur.has(j)||(a=g({rel:"preload",href:o==="image"&&d&&d.imageSrcSet?void 0:a,as:o},d),Ur.set(j,a),p.querySelector(b)!==null||o==="style"&&p.querySelector(qu(j))||o==="script"&&p.querySelector(Fu(j))||(o=p.createElement("link"),En(o,"link",a),pt(o),p.head.appendChild(o)))}}function f6(a,o){ma.m(a,o);var d=Hl;if(d&&a){var p=o&&typeof o.as=="string"?o.as:"script",b='link[rel="modulepreload"][as="'+Pr(p)+'"][href="'+Pr(a)+'"]',j=b;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":j=Vl(a)}if(!Ur.has(j)&&(a=g({rel:"modulepreload",href:a},o),Ur.set(j,a),d.querySelector(b)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(Fu(j)))return}p=d.createElement("link"),En(p,"link",a),pt(p),d.head.appendChild(p)}}}function h6(a,o,d){ma.S(a,o,d);var p=Hl;if(p&&a){var b=st(p).hoistableStyles,j=Gl(a);o=o||"default";var O=b.get(j);if(!O){var M={loading:0,preload:null};if(O=p.querySelector(qu(j)))M.loading=5;else{a=g({rel:"stylesheet",href:a,"data-precedence":o},d),(d=Ur.get(j))&&N0(a,d);var $=O=p.createElement("link");pt($),En($,"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,Eh(O,o,p)}O={type:"stylesheet",instance:O,count:1,state:M},b.set(j,O)}}}function p6(a,o){ma.X(a,o);var d=Hl;if(d&&a){var p=st(d).hoistableScripts,b=Vl(a),j=p.get(b);j||(j=d.querySelector(Fu(b)),j||(a=g({src:a,async:!0},o),(o=Ur.get(b))&&C0(a,o),j=d.createElement("script"),pt(j),En(j,"link",a),d.head.appendChild(j)),j={type:"script",instance:j,count:1,state:null},p.set(b,j))}}function m6(a,o){ma.M(a,o);var d=Hl;if(d&&a){var p=st(d).hoistableScripts,b=Vl(a),j=p.get(b);j||(j=d.querySelector(Fu(b)),j||(a=g({src:a,async:!0,type:"module"},o),(o=Ur.get(b))&&C0(a,o),j=d.createElement("script"),pt(j),En(j,"link",a),d.head.appendChild(j)),j={type:"script",instance:j,count:1,state:null},p.set(b,j))}}function NO(a,o,d,p){var b=(b=W.current)?Ah(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=Gl(d.href),d=st(b).hoistableStyles,p=d.get(o),p||(p={type:"style",instance:null,count:0,state:null},d.set(o,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){a=Gl(d.href);var j=st(b).hoistableStyles,O=j.get(a);if(O||(b=b.ownerDocument||b,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},j.set(a,O),(j=b.querySelector(qu(a)))&&!j._p&&(O.instance=j,O.state.loading=5),Ur.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},Ur.set(a,d),j||g6(b,a,d,O.state))),o&&p===null)throw Error(r(528,""));return O}if(o&&p!==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=Vl(d),d=st(b).hoistableScripts,p=d.get(o),p||(p={type:"script",instance:null,count:0,state:null},d.set(o,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function Gl(a){return'href="'+Pr(a)+'"'}function qu(a){return'link[rel="stylesheet"]['+a+"]"}function CO(a){return g({},a,{"data-precedence":a.precedence,precedence:null})}function g6(a,o,d,p){a.querySelector('link[rel="preload"][as="style"]['+o+"]")?p.loading=1:(o=a.createElement("link"),p.preload=o,o.addEventListener("load",function(){return p.loading|=1}),o.addEventListener("error",function(){return p.loading|=2}),En(o,"link",d),pt(o),a.head.appendChild(o))}function Vl(a){return'[src="'+Pr(a)+'"]'}function Fu(a){return"script[async]"+a}function _O(a,o,d){if(o.count++,o.instance===null)switch(o.type){case"style":var p=a.querySelector('style[data-href~="'+Pr(d.href)+'"]');if(p)return o.instance=p,pt(p),p;var b=g({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return p=(a.ownerDocument||a).createElement("style"),pt(p),En(p,"style",b),Eh(p,d.precedence,a),o.instance=p;case"stylesheet":b=Gl(d.href);var j=a.querySelector(qu(b));if(j)return o.state.loading|=4,o.instance=j,pt(j),j;p=CO(d),(b=Ur.get(b))&&N0(p,b),j=(a.ownerDocument||a).createElement("link"),pt(j);var O=j;return O._p=new Promise(function(M,$){O.onload=M,O.onerror=$}),En(j,"link",p),o.state.loading|=4,Eh(j,d.precedence,a),o.instance=j;case"script":return j=Vl(d.src),(b=a.querySelector(Fu(j)))?(o.instance=b,pt(b),b):(p=d,(b=Ur.get(j))&&(p=g({},d),C0(p,b)),a=a.ownerDocument||a,b=a.createElement("script"),pt(b),En(b,"link",p),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&&(p=o.instance,o.state.loading|=4,Eh(p,d.precedence,a));return o.instance}function Eh(a,o,d){for(var p=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=p.length?p[p.length-1]:null,j=b,O=0;O<p.length;O++){var M=p[O];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 N0(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.title==null&&(a.title=o.title)}function C0(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.integrity==null&&(a.integrity=o.integrity)}var Th=null;function OO(a,o,d){if(Th===null){var p=new Map,b=Th=new Map;b.set(d,p)}else b=Th,p=b.get(d),p||(p=new Map,b.set(d,p));if(p.has(a))return p;for(p.set(a,null),d=d.getElementsByTagName(a),b=0;b<d.length;b++){var j=d[b];if(!(j[Ci]||j[ht]||a==="link"&&j.getAttribute("rel")==="stylesheet")&&j.namespaceURI!=="http://www.w3.org/2000/svg"){var O=j.getAttribute(o)||"";O=a+O;var M=p.get(O);M?M.push(j):p.set(O,[j])}}return p}function kO(a,o,d){a=a.ownerDocument||a,a.head.insertBefore(d,o==="title"?a.querySelector("head > title"):null)}function y6(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 AO(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function v6(a,o,d,p){if(d.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(d.state.loading&4)===0){if(d.instance===null){var b=Gl(p.href),j=o.querySelector(qu(b));if(j){o=j._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(a.count++,a=Ph.bind(a),o.then(a,a)),d.state.loading|=4,d.instance=j,pt(j);return}j=o.ownerDocument||o,p=CO(p),(b=Ur.get(b))&&N0(p,b),j=j.createElement("link"),pt(j);var O=j;O._p=new Promise(function(M,$){O.onload=M,O.onerror=$}),En(j,"link",p),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=Ph.bind(a),o.addEventListener("load",d),o.addEventListener("error",d))}}var _0=0;function b6(a,o){return a.stylesheets&&a.count===0&&Mh(a,a.stylesheets),0<a.count||0<a.imgCount?function(d){var p=setTimeout(function(){if(a.stylesheets&&Mh(a,a.stylesheets),a.unsuspend){var j=a.unsuspend;a.unsuspend=null,j()}},6e4+o);0<a.imgBytes&&_0===0&&(_0=62500*JU());var b=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&Mh(a,a.stylesheets),a.unsuspend)){var j=a.unsuspend;a.unsuspend=null,j()}},(a.imgBytes>_0?50:800)+o);return a.unsuspend=d,function(){a.unsuspend=null,clearTimeout(p),clearTimeout(b)}}:null}function Ph(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Mh(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var zh=null;function Mh(a,o){a.stylesheets=null,a.unsuspend!==null&&(a.count++,zh=new Map,o.forEach(x6,a),zh=null,Ph.call(a))}function x6(a,o){if(!(o.state.loading&4)){var d=zh.get(a);if(d)var p=d.get(null);else{d=new Map,zh.set(a,d);for(var b=a.querySelectorAll("link[data-precedence],style[data-precedence]"),j=0;j<b.length;j++){var O=b[j];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(d.set(O.dataset.precedence,O),p=O)}p&&d.set(null,p)}b=o.instance,O=b.getAttribute("data-precedence"),j=d.get(O)||p,j===p&&d.set(null,b),d.set(O,b),this.count++,p=Ph.bind(this),b.addEventListener("load",p),b.addEventListener("error",p),j?j.parentNode.insertBefore(b,j.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(b,a.firstChild)),o.state.loading|=4}}var Ku={$$typeof:k,Provider:null,Consumer:null,_currentValue:ge,_currentValue2:ge,_threadCount:0};function w6(a,o,d,p,b,j,O,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=su(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=su(0),this.hiddenUpdates=su(null),this.identifierPrefix=p,this.onUncaughtError=b,this.onCaughtError=j,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=$,this.incompleteTransitions=new Map}function EO(a,o,d,p,b,j,O,M,$,ee,se,fe){return a=new w6(a,o,d,O,$,ee,se,fe,M),o=1,j===!0&&(o|=24),j=yr(3,null,null,o),a.current=j,j.stateNode=a,o=av(),o.refCount++,a.pooledCache=o,o.refCount++,j.memoizedState={element:p,isDehydrated:d,cache:o},cv(j),a}function TO(a){return a?(a=Nl,a):Nl}function PO(a,o,d,p,b,j){b=TO(b),p.context===null?p.context=b:p.pendingContext=b,p=Ga(o),p.payload={element:d},j=j===void 0?null:j,j!==null&&(p.callback=j),d=Va(a,p,o),d!==null&&(lr(d,a,o),Su(d,a,o))}function zO(a,o){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var d=a.retryLane;a.retryLane=d!==0&&d<o?d:o}}function O0(a,o){zO(a,o),(a=a.alternate)&&zO(a,o)}function MO(a){if(a.tag===13||a.tag===31){var o=Ws(a,67108864);o!==null&&lr(o,a,67108864),O0(a,67108864)}}function RO(a){if(a.tag===13||a.tag===31){var o=Sr();o=fn(o);var d=Ws(a,o);d!==null&&lr(d,a,o),O0(a,o)}}var Rh=!0;function S6(a,o,d,p){var b=G.T;G.T=null;var j=re.p;try{re.p=2,k0(a,o,d,p)}finally{re.p=j,G.T=b}}function j6(a,o,d,p){var b=G.T;G.T=null;var j=re.p;try{re.p=8,k0(a,o,d,p)}finally{re.p=j,G.T=b}}function k0(a,o,d,p){if(Rh){var b=A0(p);if(b===null)p0(a,o,p,Dh,d),LO(a,p);else if(C6(b,a,o,d,p))p.stopPropagation();else if(LO(a,p),o&4&&-1<N6.indexOf(a)){for(;b!==null;){var j=$a(b);if(j!==null)switch(j.tag){case 3:if(j=j.stateNode,j.current.memoizedState.isDehydrated){var O=ji(j.pendingLanes);if(O!==0){var M=j;for(M.pendingLanes|=2,M.entangledLanes|=2;O;){var $=1<<31-xe(O);M.entanglements[1]|=$,O&=~$}Ei(j),(dt&6)===0&&(vh=et()+500,Iu(0))}}break;case 31:case 13:M=Ws(j,2),M!==null&&lr(M,j,2),xh(),O0(j,2)}if(j=A0(p),j===null&&p0(a,o,p,Dh,d),j===b)break;b=j}b!==null&&p.stopPropagation()}else p0(a,o,p,null,d)}}function A0(a){return a=Ty(a),E0(a)}var Dh=null;function E0(a){if(Dh=null,a=Ia(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 Dh=a,null}function DO(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(Ke()){case at:return 2;case Bt:return 8;case Ye:case cl:return 32;case tr:return 268435456;default:return 32}default:return 32}}var T0=!1,is=null,as=null,ss=null,Hu=new Map,Gu=new Map,os=[],N6="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 LO(a,o){switch(a){case"focusin":case"focusout":is=null;break;case"dragenter":case"dragleave":as=null;break;case"mouseover":case"mouseout":ss=null;break;case"pointerover":case"pointerout":Hu.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gu.delete(o.pointerId)}}function Vu(a,o,d,p,b,j){return a===null||a.nativeEvent!==j?(a={blockedOn:o,domEventName:d,eventSystemFlags:p,nativeEvent:j,targetContainers:[b]},o!==null&&(o=$a(o),o!==null&&MO(o)),a):(a.eventSystemFlags|=p,o=a.targetContainers,b!==null&&o.indexOf(b)===-1&&o.push(b),a)}function C6(a,o,d,p,b){switch(o){case"focusin":return is=Vu(is,a,o,d,p,b),!0;case"dragenter":return as=Vu(as,a,o,d,p,b),!0;case"mouseover":return ss=Vu(ss,a,o,d,p,b),!0;case"pointerover":var j=b.pointerId;return Hu.set(j,Vu(Hu.get(j)||null,a,o,d,p,b)),!0;case"gotpointercapture":return j=b.pointerId,Gu.set(j,Vu(Gu.get(j)||null,a,o,d,p,b)),!0}return!1}function IO(a){var o=Ia(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,Ni(a.priority,function(){RO(d)});return}}else if(o===31){if(o=c(d),o!==null){a.blockedOn=o,Ni(a.priority,function(){RO(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 Lh(a){if(a.blockedOn!==null)return!1;for(var o=a.targetContainers;0<o.length;){var d=A0(a.nativeEvent);if(d===null){d=a.nativeEvent;var p=new d.constructor(d.type,d);Ey=p,d.target.dispatchEvent(p),Ey=null}else return o=$a(d),o!==null&&MO(o),a.blockedOn=d,!1;o.shift()}return!0}function $O(a,o,d){Lh(a)&&d.delete(o)}function _6(){T0=!1,is!==null&&Lh(is)&&(is=null),as!==null&&Lh(as)&&(as=null),ss!==null&&Lh(ss)&&(ss=null),Hu.forEach($O),Gu.forEach($O)}function Ih(a,o){a.blockedOn===o&&(a.blockedOn=null,T0||(T0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,_6)))}var $h=null;function UO(a){$h!==a&&($h=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){$h===a&&($h=null);for(var o=0;o<a.length;o+=3){var d=a[o],p=a[o+1],b=a[o+2];if(typeof p!="function"){if(E0(p||d)===null)continue;break}var j=$a(d);j!==null&&(a.splice(o,3),o-=3,Av(j,{pending:!0,data:b,method:d.method,action:p},p,b))}}))}function Zl(a){function o($){return Ih($,a)}is!==null&&Ih(is,a),as!==null&&Ih(as,a),ss!==null&&Ih(ss,a),Hu.forEach(o),Gu.forEach(o);for(var d=0;d<os.length;d++){var p=os[d];p.blockedOn===a&&(p.blockedOn=null)}for(;0<os.length&&(d=os[0],d.blockedOn===null);)IO(d),d.blockedOn===null&&os.shift();if(d=(a.ownerDocument||a).$$reactFormReplay,d!=null)for(p=0;p<d.length;p+=3){var b=d[p],j=d[p+1],O=b[In]||null;if(typeof j=="function")O||UO(d);else if(O){var M=null;if(j&&j.hasAttribute("formAction")){if(b=j,O=j[In]||null)M=O.formAction;else if(E0(b)!==null)continue}else M=O.action;typeof M=="function"?d[p+1]=M:(d.splice(p,3),p-=3),UO(d)}}}function BO(){function a(j){j.canIntercept&&j.info==="react-transition"&&j.intercept({handler:function(){return new Promise(function(O){return b=O})},focusReset:"manual",scroll:"manual"})}function o(){b!==null&&(b(),b=null),p||setTimeout(d,20)}function d(){if(!p&&!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 p=!1,b=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(d,100),function(){p=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),b!==null&&(b(),b=null)}}}function P0(a){this._internalRoot=a}Uh.prototype.render=P0.prototype.render=function(a){var o=this._internalRoot;if(o===null)throw Error(r(409));var d=o.current,p=Sr();PO(d,p,a,o,null,null)},Uh.prototype.unmount=P0.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var o=a.containerInfo;PO(a.current,2,null,a,null,null),xh(),o[mr]=null}};function Uh(a){this._internalRoot=a}Uh.prototype.unstable_scheduleHydration=function(a){if(a){var o=hl();a={blockedOn:null,target:a,priority:o};for(var d=0;d<os.length&&o!==0&&o<os[d].priority;d++);os.splice(d,0,a),d===0&&IO(a)}};var qO=t.version;if(qO!=="19.2.4")throw Error(r(527,qO,"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?m(a):null,a=a===null?null:a.stateNode,a};var O6={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Bh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bh.isDisabled&&Bh.supportsFiber)try{ii=Bh.inject(O6),Nt=Bh}catch{}}return Yu.createRoot=function(a,o){if(!i(a))throw Error(r(299));var d=!1,p="",b=YC,j=WC,O=QC;return o!=null&&(o.unstable_strictMode===!0&&(d=!0),o.identifierPrefix!==void 0&&(p=o.identifierPrefix),o.onUncaughtError!==void 0&&(b=o.onUncaughtError),o.onCaughtError!==void 0&&(j=o.onCaughtError),o.onRecoverableError!==void 0&&(O=o.onRecoverableError)),o=EO(a,1,!1,null,null,d,p,null,b,j,O,BO),a[mr]=o.current,h0(a),new P0(o)},Yu.hydrateRoot=function(a,o,d){if(!i(a))throw Error(r(299));var p=!1,b="",j=YC,O=WC,M=QC,$=null;return d!=null&&(d.unstable_strictMode===!0&&(p=!0),d.identifierPrefix!==void 0&&(b=d.identifierPrefix),d.onUncaughtError!==void 0&&(j=d.onUncaughtError),d.onCaughtError!==void 0&&(O=d.onCaughtError),d.onRecoverableError!==void 0&&(M=d.onRecoverableError),d.formState!==void 0&&($=d.formState)),o=EO(a,1,!0,o,d??null,p,b,$,j,O,M,BO),o.context=TO(null),d=o.current,p=Sr(),p=fn(p),b=Ga(p),b.callback=null,Va(d,b,p),d=p,o.current.lanes=d,Hs(o,d),Ei(o),a[mr]=o.current,h0(a),new Uh(o)},Yu.version="19.2.4",Yu}var XO;function L6(){if(XO)return R0.exports;XO=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(),R0.exports=D6(),R0.exports}var I6=L6(),Jo=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(){}},$6={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},U6=class{#t=$6;#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)}},wo=new U6;function B6(e){setTimeout(e,0)}var Uo=typeof window>"u"||"Deno"in globalThis;function Bn(){}function q6(e,t){return typeof e=="function"?e(t):e}function Fx(e){return typeof e=="number"&&e>=0&&e!==1/0}function Uz(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ss(e,t){return typeof e=="function"?e(t):e}function Hr(e,t){return typeof e=="function"?e(t):e}function JO(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:l,stale:c}=e;if(l){if(r){if(t.queryHash!==jS(l,t.options))return!1}else if(!Nd(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 ek(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Bo(t.options.mutationKey)!==Bo(s))return!1}else if(!Nd(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function jS(e,t){return(t?.queryKeyHashFn||Bo)(e)}function Bo(e){return JSON.stringify(e,(t,n)=>Kx(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Nd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Nd(e[n],t[n])):!1}var F6=Object.prototype.hasOwnProperty;function NS(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=tk(e)&&tk(t);if(!r&&!(Kx(e)&&Kx(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 m=0;m<c;m++){const g=r?m:l[m],y=e[g],v=t[g];if(y===v){f[g]=y,(r?m<s:F6.call(e,g))&&h++;continue}if(y===null||v===null||typeof y!="object"||typeof v!="object"){f[g]=v;continue}const w=NS(y,v,n+1);f[g]=w,w===y&&h++}return s===c&&h===s?e:f}function Cd(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 tk(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Kx(e){if(!nk(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!nk(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function nk(e){return Object.prototype.toString.call(e)==="[object Object]"}function K6(e){return new Promise(t=>{wo.setTimeout(t,e)})}function Hx(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?NS(e,t):t}function H6(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function G6(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var CS=Symbol();function Bz(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===CS?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function _S(e,t){return typeof e=="function"?e(...t):!!e}function V6(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 Z6=class extends Jo{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Uo&&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"}},OS=new Z6;function Gx(){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 Y6=B6;function W6(){let e=[],t=0,n=c=>{c()},r=c=>{c()},i=Y6;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 Wt=W6(),Q6=class extends Jo{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Uo&&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}},Fp=new Q6;function X6(e){return Math.min(1e3*2**e,3e4)}function qz(e){return(e??"online")==="online"?Fp.isOnline():!0}var Vx=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Fz(e){let t=!1,n=0,r;const i=Gx(),s=()=>i.status!=="pending",l=S=>{if(!s()){const N=new Vx(S);y(N),e.onCancel?.(N)}},c=()=>{t=!0},f=()=>{t=!1},h=()=>OS.isFocused()&&(e.networkMode==="always"||Fp.isOnline())&&e.canRun(),m=()=>qz(e.networkMode)&&e.canRun(),g=S=>{s()||(r?.(),i.resolve(S))},y=S=>{s()||(r?.(),i.reject(S))},v=()=>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 A=e.retry??(Uo?0:3),k=e.retryDelay??X6,_=typeof k=="function"?k(n,C):k,T=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,C);if(t||!T){y(C);return}n++,e.onFail?.(n,C),K6(_).then(()=>h()?void 0:v()).then(()=>{t?y(C):w()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:f,canStart:m,start:()=>(m()?w():v().then(w),i)}}var Kz=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Fx(this.gcTime)&&(this.#t=wo.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Uo?1/0:300*1e3))}clearGcTimeout(){this.#t&&(wo.clearTimeout(this.#t),this.#t=void 0)}},J6=class extends Kz{#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=ik(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=ik(this.options);t.data!==void 0&&(this.setState(rk(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=Hx(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(Bn).catch(Bn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>Hr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===CS||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ss(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:!Uz(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=Bz(this.options,t),h=(()=>{const m={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(m),m})();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=Fz({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:c=>{c instanceof Vx&&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 Vx){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,...Hz(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...rk(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),Wt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function Hz(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:qz(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function rk(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ik(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 kS=class extends Jo{constructor(e,t){super(),this.options=t,this.#t=e,this.#s=null,this.#o=Gx(),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),ak(this.#e,this.options)?this.#m():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Zx(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Zx(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 Hr(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&&!Cd(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&sk(this.#e,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#e!==n||Hr(this.options.enabled,this.#e)!==Hr(t.enabled,this.#e)||Ss(this.options.staleTime,this.#e)!==Ss(t.staleTime,this.#e))&&this.#g();const i=this.#y();r&&(this.#e!==n||Hr(this.options.enabled,this.#e)!==Hr(t.enabled,this.#e)||i!==this.#l)&&this.#v(i)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),n=this.createResult(t,e);return tB(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(Bn)),t}#g(){this.#x();const e=Ss(this.options.staleTime,this.#e);if(Uo||this.#i.isStale||!Fx(e))return;const n=Uz(this.#i.dataUpdatedAt,e)+1;this.#c=wo.setTimeout(()=>{this.#i.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#v(e){this.#w(),this.#l=e,!(Uo||Hr(this.options.enabled,this.#e)===!1||!Fx(this.#l)||this.#l===0)&&(this.#u=wo.setInterval(()=>{(this.options.refetchIntervalInBackground||OS.isFocused())&&this.#m()},this.#l))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#c&&(wo.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(wo.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 m={...h},g=!1,y;if(t._optimisticResults){const z=this.hasListeners(),D=!z&&ak(e,t),F=z&&sk(e,n,t,r);(D||F)&&(m={...m,...Hz(h.data,e.options)}),t._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:v,errorUpdatedAt:w,status:S}=m;y=m.data;let N=!1;if(t.placeholderData!==void 0&&y===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",y=Hx(i?.data,z,t),g=!0)}if(t.select&&y!==void 0&&!N)if(i&&y===s?.data&&t.select===this.#p)y=this.#d;else try{this.#p=t.select,y=t.select(y),y=Hx(i?.data,y,t),this.#d=y,this.#s=null}catch(z){this.#s=z}this.#s&&(v=this.#s,y=this.#d,w=Date.now(),S="error");const C=m.fetchStatus==="fetching",A=S==="pending",k=S==="error",_=A&&C,T=y!==void 0,E={status:S,fetchStatus:m.fetchStatus,isPending:A,isSuccess:S==="success",isError:k,isInitialLoading:_,isLoading:_,data:y,dataUpdatedAt:m.dataUpdatedAt,error:v,errorUpdatedAt:w,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>f.dataUpdateCount||m.errorUpdateCount>f.errorUpdateCount,isFetching:C,isRefetching:C&&!A,isLoadingError:k&&!T,isPaused:m.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:k&&T,isStale:AS(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Hr(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const z=E.data!==void 0,D=E.status==="error"&&!z,F=ae=>{D?ae.reject(E.error):z&&ae.resolve(E.data)},U=()=>{const ae=this.#o=E.promise=Gx();F(ae)},I=this.#o;switch(I.status){case"pending":e.queryHash===n.queryHash&&F(I);break;case"fulfilled":(D||E.data!==I.value)&&U();break;case"rejected":(!D||E.error!==I.reason)&&U();break}}return E}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),Cd(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){Wt.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function eB(e,t){return Hr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function ak(e,t){return eB(e,t)||e.state.data!==void 0&&Zx(e,t,t.refetchOnMount)}function Zx(e,t,n){if(Hr(t.enabled,e)!==!1&&Ss(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&AS(e,t)}return!1}function sk(e,t,n,r){return(e!==t||Hr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&AS(e,n)}function AS(e,t){return Hr(t.enabled,e)!==!1&&e.isStaleByTime(Ss(t.staleTime,e))}function tB(e,t){return!Cd(e.getCurrentResult(),t)}function ok(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 m=!1;const g=w=>{V6(w,()=>t.signal,()=>m=!0)},y=Bz(t.options,t.fetchOptions),v=async(w,S,N)=>{if(m)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const A=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:S,direction:N?"backward":"forward",meta:t.options.meta};return g(P),P})(),k=await y(A),{maxPages:_}=t.options,T=N?G6:H6;return{pages:T(w.pages,k,_),pageParams:T(w.pageParams,S,_)}};if(i&&s.length){const w=i==="backward",S=w?nB:lk,N={pages:s,pageParams:l},C=S(r,N);c=await v(N,C,w)}else{const w=e??s.length;do{const S=f===0?l[0]??r.initialPageParam:lk(r,c);if(f>0&&S==null)break;c=await v(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 lk(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 nB(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var rB=class extends Kz{#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||Gz(),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=Fz({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),Wt.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function Gz(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Vz=class extends Jo{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 rB({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(){Wt.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=>ek(t,n))}findAll(e={}){return this.getAll().filter(t=>ek(e,t))}notify(e){Wt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Wt.batch(()=>Promise.all(e.map(t=>t.continue().catch(Bn))))}};function qh(e){return e.options.scope?.id}var iB=class extends Jo{#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),Cd(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Bo(n.mutationKey)!==Bo(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??Gz();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){Wt.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 ck(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function aB(e,t,n){const r=e.slice(0);return r[t]=n,r}var sB=class extends Jo{#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,Wt.batch(()=>{const n=this.#r,r=this.#u(this.#n);r.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions));const i=r.map(m=>m.observer),s=i.map(m=>m.getCurrentResult()),l=n.length!==i.length,c=i.some((m,g)=>m!==n[g]),f=l||c,h=f?!0:s.some((m,g)=>{const y=this.#e[g];return!y||!Cd(m,y)});!f&&!h||(f&&(this.#d=r,this.#r=i),this.#e=s,this.hasListeners()&&(f&&(ck(n,i).forEach(m=>{m.destroy()}),ck(i,n).forEach(m=>{m.subscribe(g=>{this.#l(m,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=NS(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 kS(this.#t,i);n.push({defaultedQueryOptions:i,observer:l})}),n}#l(e,t){const n=this.#r.indexOf(e);n!==-1&&(this.#e=aB(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&&Wt.batch(()=>{this.listeners.forEach(r=>{r(this.#e)})})}}},oB=class extends Jo{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const r=t.queryKey,i=t.queryHash??jS(r,t);let s=this.get(i);return s||(s=new J6({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(){Wt.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=>JO(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>JO(e,n)):t}notify(e){Wt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Wt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Wt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},lB=class{#t;#e;#n;#i;#r;#a;#o;#s;constructor(e={}){this.#t=e.queryCache||new oB,this.#e=e.mutationCache||new Vz,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=OS.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#s=Fp.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(Ss(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=q6(t,s);if(l!==void 0)return this.#t.build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Wt.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;Wt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return Wt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Wt.batch(()=>this.#t.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Bn).catch(Bn)}invalidateQueries(e,t={}){return Wt.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=Wt.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(Bn)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Bn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime(Ss(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Bn).catch(Bn)}fetchInfiniteQuery(e){return e.behavior=ok(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Bn).catch(Bn)}ensureInfiniteQueryData(e){return e.behavior=ok(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Fp.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(Bo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{Nd(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Bo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Nd(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=jS(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===CS&&(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()}},Zz=x.createContext(void 0),Rs=e=>{const t=x.useContext(Zz);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},cB=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(Zz.Provider,{value:e,children:t})),Yz=x.createContext(!1),Wz=()=>x.useContext(Yz);Yz.Provider;function uB(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var dB=x.createContext(uB()),Qz=()=>x.useContext(dB),Xz=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?_S(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Jz=e=>{x.useEffect(()=>{e.clearReset()},[e])},eM=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||_S(n,[e.error,r])),tM=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))}},fB=(e,t)=>e.isLoading&&e.isFetching&&!t,Yx=(e,t)=>e?.suspense&&t.isPending,Wx=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function hB({queries:e,...t},n){const r=Rs(),i=Wz(),s=Qz(),l=x.useMemo(()=>e.map(S=>{const N=r.defaultQueryOptions(S);return N._optimisticResults=i?"isRestoring":"optimistic",N}),[e,r,i]);l.forEach(S=>{tM(S);const N=r.getQueryCache().get(S.queryHash);Xz(S,s,N)}),Jz(s);const[c]=x.useState(()=>new sB(r,l,t)),[f,h,m]=c.getOptimisticResult(l,t.combine),g=!i&&t.subscribed!==!1;x.useSyncExternalStore(x.useCallback(S=>g?c.subscribe(Wt.batchCalls(S)):Bn,[c,g]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),x.useEffect(()=>{c.setQueries(l,t)},[l,t,c]);const v=f.some((S,N)=>Yx(l[N],S))?f.flatMap((S,N)=>{const C=l[N];if(C&&Yx(C,S)){const A=new kS(r,C);return Wx(C,A,s)}return[]}):[];if(v.length>0)throw Promise.all(v);const w=f.find((S,N)=>{const C=l[N];return C&&eM({result:S,errorResetBoundary:s,throwOnError:C.throwOnError,query:r.getQueryCache().get(C.queryHash),suspense:C.suspense})});if(w?.error)throw w.error;return h(m())}function pB(e,t,n){const r=Wz(),i=Qz(),s=Rs(),l=s.defaultQueryOptions(e);s.getDefaultOptions().queries?._experimental_beforeQuery?.(l);const c=s.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",tM(l),Xz(l,i,c),Jz(i);const f=!s.getQueryCache().get(l.queryHash),[h]=x.useState(()=>new t(s,l)),m=h.getOptimisticResult(l),g=!r&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(y=>{const v=g?h.subscribe(Wt.batchCalls(y)):Bn;return h.updateResult(),v},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),x.useEffect(()=>{h.setOptions(l)},[l,h]),Yx(l,m))throw Wx(l,h,i);if(eM({result:m,errorResetBoundary:i,throwOnError:l.throwOnError,query:c,suspense:l.suspense}))throw m.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(l,m),l.experimental_prefetchInRender&&!Uo&&fB(m,r)&&(f?Wx(l,h,i):c?.promise)?.catch(Bn).finally(()=>{h.updateResult()}),l.notifyOnChangeProps?m:h.trackResult(m)}function Eo(e,t){return pB(e,kS)}function Xd(e,t){const n=Rs(),[r]=x.useState(()=>new iB(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);const i=x.useSyncExternalStore(x.useCallback(l=>r.subscribe(Wt.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=x.useCallback((l,c)=>{r.mutate(l,c).catch(Bn)},[r]);if(i.error&&_S(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}var Fh=typeof window<"u"?x.useLayoutEffect:x.useEffect;function $0(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 mB(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 gB(e){const t=x.useRef(null);return x.useImperativeHandle(e,()=>t.current,[]),t}var yB=!1;function _d(e){return e[e.length-1]}function vB(e){return typeof e=="function"}function bs(e,t){return vB(e)?e(t):e}var bB=Object.prototype.hasOwnProperty,uk=Object.prototype.propertyIsEnumerable,xB=()=>Object.create(null),co=(e,t)=>So(e,t,xB);function So(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const i=t,s=hk(e)&&hk(i);if(!s&&!(Kp(e)&&Kp(i)))return i;const l=s?e:dk(e);if(!l)return i;const c=s?i:dk(i);if(!c)return i;const f=l.length,h=c.length,m=s?new Array(h):n();let g=0;for(let y=0;y<h;y++){const v=s?y:c[y],w=e[v],S=i[v];if(w===S){m[v]=w,(s?y<f:bB.call(e,v))&&g++;continue}if(w===null||S===null||typeof w!="object"||typeof S!="object"){m[v]=S;continue}const N=So(w,S,n,r+1);m[v]=N,N===w&&g++}return f===h&&g===f?e:m}function dk(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!uk.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(!uk.call(e,i))return!1;r.push(i)}return r}function Kp(e){if(!fk(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!fk(n)||!n.hasOwnProperty("isPrototypeOf"))}function fk(e){return Object.prototype.toString.call(e)==="[object Object]"}function hk(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function To(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(!To(e[r],t[r],n))return!1;return!0}if(Kp(e)&&Kp(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const l in t)if((!r||t[l]!==void 0)&&!To(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||!To(e[l],t[l],n)))return!1;return i===s}return!1}function _c(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 Od(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function wB(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function pk(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 wB(t)}var SB=["http:","https:","mailto:","tel:"];function Hp(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Wu(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+=pk(e.slice(n,i.index))+i[0],n=t.lastIndex;r=r+pk(n?e.slice(n):e);let s=!1;return r.startsWith("//")&&(s=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:s}}function jB(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Gp(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 NB="Invariant failed";function As(e,t){if(!e)throw new Error(NB)}var jo=4,nM=5;function CB(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 ES(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=CB(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 m=c+3,g=f;if(m<g)return n[0]=3,n[1]=t+c,n[2]=t+m,n[3]=t+g,n[4]=t+f+1,n[5]=i,n}}else if(h===36){const m=c+1,g=c+2;return g===f?(n[0]=2,n[1]=t+c,n[2]=t+m,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 ig(e,t,n,r,i,s,l){l?.(n);let c=r;{const f=n.fullPath??n.from,h=f.length,m=n.options?.caseSensitive??e,g=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;c<h;){const v=ES(f,c,t);let w;const S=c,N=v[5];switch(c=N+1,s++,v[0]){case 0:{const C=f.substring(v[2],v[3]);if(m){const A=i.static?.get(C);if(A)w=A;else{i.static??=new Map;const k=No(n.fullPath??n.from);k.parent=i,k.depth=s,w=k,i.static.set(C,k)}}else{const A=C.toLowerCase(),k=i.staticInsensitive?.get(A);if(k)w=k;else{i.staticInsensitive??=new Map;const _=No(n.fullPath??n.from);_.parent=i,_.depth=s,w=_,i.staticInsensitive.set(A,_)}}break}case 1:{const C=f.substring(S,v[1]),A=f.substring(v[4],N),k=m&&!!(C||A),_=C?k?C:C.toLowerCase():void 0,T=A?k?A:A.toLowerCase():void 0,P=!g&&i.dynamic?.find(E=>!E.skipOnParamError&&E.caseSensitive===k&&E.prefix===_&&E.suffix===T);if(P)w=P;else{const E=B0(1,n.fullPath??n.from,k,_,T);w=E,E.depth=s,E.parent=i,i.dynamic??=[],i.dynamic.push(E)}break}case 3:{const C=f.substring(S,v[1]),A=f.substring(v[4],N),k=m&&!!(C||A),_=C?k?C:C.toLowerCase():void 0,T=A?k?A:A.toLowerCase():void 0,P=!g&&i.optional?.find(E=>!E.skipOnParamError&&E.caseSensitive===k&&E.prefix===_&&E.suffix===T);if(P)w=P;else{const E=B0(3,n.fullPath??n.from,k,_,T);w=E,E.parent=i,E.depth=s,i.optional??=[],i.optional.push(E)}break}case 2:{const C=f.substring(S,v[1]),A=f.substring(v[4],N),k=m&&!!(C||A),_=C?k?C:C.toLowerCase():void 0,T=A?k?A:A.toLowerCase():void 0,P=B0(2,n.fullPath??n.from,k,_,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 v=No(n.fullPath??n.from);v.kind=nM,v.parent=i,s++,v.depth=s,i.pathless??=[],i.pathless.push(v),i=v}const y=(n.path||!n.children)&&!n.isRoot;if(y&&f.endsWith("/")){const v=No(n.fullPath??n.from);v.kind=jo,v.parent=i,s++,v.depth=s,i.index=v,i=v}i.parse=n.options?.params?.parse??null,i.skipOnParamError=g,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,y&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const f of n.children)ig(e,t,f,c,i,s,l)}function U0(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 ps(e){if(e.pathless)for(const t of e.pathless)ps(t);if(e.static)for(const t of e.static.values())ps(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())ps(t);if(e.dynamic?.length){e.dynamic.sort(U0);for(const t of e.dynamic)ps(t)}if(e.optional?.length){e.optional.sort(U0);for(const t of e.optional)ps(t)}if(e.wildcard?.length){e.wildcard.sort(U0);for(const t of e.wildcard)ps(t)}}function No(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 B0(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 _B(e,t){const n=No("/"),r=new Uint16Array(6);for(const i of e)ig(!1,r,i,1,n,0);ps(n),t.masksTree=n,t.flatCache=Gp(1e3)}function OB(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=TS(e,t.masksTree);return t.flatCache.set(e,r),r}function kB(e,t,n,r,i){e||="/",r||="/";const s=t?`case\0${e}`:e;let l=i.singleCache.get(s);return l||(l=No("/"),ig(t,new Uint16Array(6),{from:e},1,l,0),i.singleCache.set(s,l)),TS(r,l,n)}function AB(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=TS(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)s=null;else throw l}return s&&(s.branch=PB(s.route)),t.matchCache.set(r,s),s}function EB(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function TB(e,t=!1,n){const r=No(e.fullPath),i=new Uint16Array(6),s={},l={};let c=0;return ig(t,i,e,1,r,0,f=>{if(n?.(f,c),As(!(f.id in s),`Duplicate routes found with id: ${String(f.id)}`),s[f.id]=f,c!==0&&f.path){const h=EB(f.fullPath);(!l[h]||f.fullPath.endsWith("/"))&&(l[h]=f)}c++}),ps(r),{processedTree:{segmentTree:r,singleCache:Gp(1e3),matchCache:Gp(1e3),flatCache:null,masksTree:null},routesById:s,routesByPath:l}}function TS(e,t,n=!1){const r=e.split("/"),i=MB(e,r,t,n);if(!i)return null;const[s]=rM(e,r,i);return{route:i.node.route,rawParams:s,parsedParams:i.parsedParams}}function rM(e,t,n){const r=zB(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 m=r[c];if(m.kind===jo)break;if(m.kind===nM){h--,l--,f--;continue}const g=t[l],y=f;if(g&&(f+=g.length),m.kind===1){i??=n.node.fullPath.split("/");const v=i[h],w=m.prefix?.length??0;if(v.charCodeAt(w)===123){const S=m.suffix?.length??0,N=v.substring(w+2,v.length-S-1),C=g.substring(w,g.length-S);s[N]=decodeURIComponent(C)}else{const S=v.substring(1);s[S]=decodeURIComponent(g)}}else if(m.kind===3){if(n.skipped&1<<c){l--,f=y-1;continue}i??=n.node.fullPath.split("/");const v=i[h],w=m.prefix?.length??0,S=m.suffix?.length??0,N=v.substring(w+3,v.length-S-1),C=m.suffix||m.prefix?g.substring(w,g.length-S):g;C&&(s[N]=decodeURIComponent(C))}else if(m.kind===2){const v=m,w=e.substring(y+(v.prefix?.length??0),e.length-(v.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 PB(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function zB(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function MB(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!_d(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,m=null;for(;c.length;){const g=c.pop(),{node:y,index:v,skipped:w,depth:S,statics:N,dynamics:C,optionals:A}=g;let{extract:k,rawParams:_,parsedParams:T}=g;if(y.skipOnParamError){if(!q0(e,t,g))continue;_=g.rawParams,k=g.extract,T=g.parsedParams}r&&y.route&&y.kind!==jo&&Qu(h,g)&&(h=g);const P=v===l;if(P&&(y.route&&!s&&Qu(m,g)&&(m=g),!y.optional&&!y.wildcard&&!y.index&&!y.pathless))continue;const E=P?void 0:t[v];let z;if(P&&y.index){const D={node:y.index,index:v,skipped:w,depth:S+1,statics:N,dynamics:C,optionals:A,extract:k,rawParams:_,parsedParams:T};let F=!0;if(y.index.skipOnParamError&&(q0(e,t,D)||(F=!1)),F){if(N===l&&!C&&!A&&!w)return D;Qu(m,D)&&(m=D)}}if(y.wildcard&&Qu(f,g))for(const D of y.wildcard){const{prefix:F,suffix:U}=D;if(F&&(P||!(D.caseSensitive?E:z??=E.toLowerCase()).startsWith(F)))continue;if(U){if(P)continue;const ae=t.slice(v).join("/").slice(-U.length);if((D.caseSensitive?ae:ae.toLowerCase())!==U)continue}const I={node:D,index:l,skipped:w,depth:S,statics:N,dynamics:C,optionals:A,extract:k,rawParams:_,parsedParams:T};if(!(D.skipOnParamError&&!q0(e,t,I))){f=I;break}}if(y.optional){const D=w|1<<S,F=S+1;for(let U=y.optional.length-1;U>=0;U--){const I=y.optional[U];c.push({node:I,index:v,skipped:D,depth:F,statics:N,dynamics:C,optionals:A,extract:k,rawParams:_,parsedParams:T})}if(!P)for(let U=y.optional.length-1;U>=0;U--){const I=y.optional[U],{prefix:ae,suffix:ve}=I;if(ae||ve){const me=I.caseSensitive?E:z??=E.toLowerCase();if(ae&&!me.startsWith(ae)||ve&&!me.endsWith(ve))continue}c.push({node:I,index:v+1,skipped:w,depth:F,statics:N,dynamics:C,optionals:A+1,extract:k,rawParams:_,parsedParams:T})}}if(!P&&y.dynamic&&E)for(let D=y.dynamic.length-1;D>=0;D--){const F=y.dynamic[D],{prefix:U,suffix:I}=F;if(U||I){const ae=F.caseSensitive?E:z??=E.toLowerCase();if(U&&!ae.startsWith(U)||I&&!ae.endsWith(I))continue}c.push({node:F,index:v+1,skipped:w,depth:S+1,statics:N,dynamics:C+1,optionals:A,extract:k,rawParams:_,parsedParams:T})}if(!P&&y.staticInsensitive){const D=y.staticInsensitive.get(z??=E.toLowerCase());D&&c.push({node:D,index:v+1,skipped:w,depth:S+1,statics:N+1,dynamics:C,optionals:A,extract:k,rawParams:_,parsedParams:T})}if(!P&&y.static){const D=y.static.get(E);D&&c.push({node:D,index:v+1,skipped:w,depth:S+1,statics:N+1,dynamics:C,optionals:A,extract:k,rawParams:_,parsedParams:T})}if(y.pathless){const D=S+1;for(let F=y.pathless.length-1;F>=0;F--){const U=y.pathless[F];c.push({node:U,index:v,skipped:w,depth:D,statics:N,dynamics:C,optionals:A,extract:k,rawParams:_,parsedParams:T})}}}if(m&&f)return Qu(f,m)?m:f;if(m)return m;if(f)return f;if(r&&h){let g=h.index;for(let v=0;v<h.index;v++)g+=t[v].length;const y=g===e.length?"/":e.slice(g);return h.rawParams??=Object.create(null),h.rawParams["**"]=decodeURIComponent(y),h}return null}function q0(e,t,n){try{const[r,i]=rM(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 Qu(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===jo)>(e.node.kind===jo)||t.node.kind===jo==(e.node.kind===jo)&&t.depth>e.depth))):!0}function Op(e){return PS(e.filter(t=>t!==void 0).join("/"))}function PS(e){return e.replace(/\/{2,}/g,"/")}function iM(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function js(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function aM(e){return js(iM(e))}function Vp(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function RB(e,t,n){return Vp(e,n)===Vp(t,n)}function DB({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&&_d(c)==="";)c.pop();const g=t.split("/");for(let y=0,v=g.length;y<v;y++){const w=g[y];w===""?y?y===v-1&&c.push(w):c=[w]:w===".."?c.pop():w==="."||c.push(w)}}c.length>1&&(_d(c)===""?n==="never"&&c.pop():n==="always"&&c.push(""));let f,h="";for(let g=0;g<c.length;g++){g>0&&(h+="/");const y=c[g];if(!y)continue;f=ES(y,0,f);const v=f[0];if(v===0){h+=y;continue}const w=f[5],S=y.substring(0,f[1]),N=y.substring(f[4],w),C=y.substring(f[2],f[3]);v===1?h+=S||N?`${S}{$${C}}${N}`:`$${C}`:v===2?h+=S||N?`${S}{$}${N}`:"$":h+=`${S}{-$${C}}${N}`}h=PS(h);const m=h||"/";return l&&r&&r.set(l,m),m}function LB(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 F0(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=>gk(i,n)).join("/"):gk(r,n)}function mk({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 m=c;f=ES(e,m,f);const g=f[5];if(c=g+1,m===g)continue;const y=f[0];if(y===0){h+="/"+e.substring(m,g);continue}if(y===2){const v=t._splat;s._splat=v,s["*"]=v;const w=e.substring(m,f[1]),S=e.substring(f[4],g);if(!v){i=!0,(w||S)&&(h+="/"+w+S);continue}const N=F0("_splat",t,n);h+="/"+w+N+S;continue}if(y===1){const v=e.substring(f[2],f[3]);!i&&!(v in t)&&(i=!0),s[v]=t[v];const w=e.substring(m,f[1]),S=e.substring(f[4],g),N=F0(v,t,n)??"undefined";h+="/"+w+N+S;continue}if(y===3){const v=e.substring(f[2],f[3]),w=t[v];if(w==null)continue;s[v]=w;const S=e.substring(m,f[1]),N=e.substring(f[4],g),C=F0(v,t,n)??"";h+="/"+S+C+N;continue}}return e.endsWith("/")&&(h+="/"),{usedParams:s,interpolatedPath:h||"/",isMissingParams:i}}function gk(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function Qn(e){return!!e?.isNotFound}function IB(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var Qx="tsr-scroll-restoration-v1_3",$B=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function UB(){const e=IB();if(!e)return null;const t=e.getItem(Qx);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=bs(r,n)||n;try{e.setItem(Qx,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var Kh=UB(),BB=e=>e.state.__TSR_key||e.href;function qB(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 Zp=!1;function FB({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];Zp=!0;e:{if(r&&f&&Object.keys(f).length>0){for(const g in f){const y=f[g];if(g==="window")window.scrollTo({top:y.scrollY,left:y.scrollX,behavior:n});else if(g){const v=document.querySelector(g);v&&(v.scrollLeft=y.scrollX,v.scrollTop=y.scrollY)}}break e}const h=(s??window.location).hash.split("#",2)[1];if(h){const g=window.history.state?.__hashScrollIntoViewOptions??!0;if(g){const y=document.getElementById(h);y&&y.scrollIntoView(g)}break e}const m={top:0,left:0,behavior:n};if(window.scrollTo(m),i)for(const g of i){if(g==="window")continue;const y=typeof g=="function"?g():document.querySelector(g);y&&y.scrollTo(m)}}Zp=!1}function KB(e,t){if(!Kh||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Kh))return;e.isScrollRestorationSetup=!0,Zp=!1;const n=e.options.getScrollRestorationKey||BB;window.history.scrollRestoration="manual";const r=i=>{if(Zp||!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=qB(i.target)}const l=n(e.state.location);Kh.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 m=document.querySelector(s);m&&(h.scrollX=m.scrollLeft||0,h.scrollY=m.scrollTop||0)}return c})};typeof document<"u"&&document.addEventListener("scroll",$B(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})||(FB({storageKey:Qx,key:s,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Kh.set(l=>(l[s]||={},l)))})}function HB(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 GB(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 K0(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function VB(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]=K0(i):Array.isArray(s)?s.push(K0(i)):n[r]=[s,K0(i)]}return n}var ZB=WB(JSON.parse),YB=QB(JSON.stringify,JSON.parse);function WB(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=VB(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function QB(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=GB(i,r);return s?`?${s}`:""}}var Po="__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 cr(e){return e instanceof Response&&!!e.options}function XB(e){return{input:({url:t})=>{for(const n of e)t=Xx(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=sM(e[n],t);return t}}}function JB(e){const t=aM(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=Op(["/",t,l.pathname]),l)}}function Xx(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 sM(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 oM({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:s,checkDirty:l,shallowPropagate:c};function r(h,m,g){const y=m.depsTail;if(y!==void 0&&y.dep===h)return;const v=y!==void 0?y.nextDep:m.deps;if(v!==void 0&&v.dep===h){v.version=g,m.depsTail=v;return}const w=h.subsTail;if(w!==void 0&&w.version===g&&w.sub===m)return;const S=m.depsTail=h.subsTail={version:g,dep:h,sub:m,prevDep:y,nextDep:v,prevSub:w,nextSub:void 0};v!==void 0&&(v.prevDep=S),y!==void 0?y.nextDep=S:m.deps=S,w!==void 0?w.nextSub=S:h.subs=S}function i(h,m=h.sub){const g=h.dep,y=h.prevDep,v=h.nextDep,w=h.nextSub,S=h.prevSub;return v!==void 0?v.prevDep=y:m.depsTail=y,y!==void 0?y.nextDep=v:m.deps=v,w!==void 0?w.prevSub=S:g.subsTail=S,S!==void 0?S.nextSub=w:(g.subs=w)===void 0&&n(g),v}function s(h){let m=h.nextSub,g;e:do{const y=h.sub;let v=y.flags;if(v&60?v&12?v&4?!(v&48)&&f(h,y)?(y.flags=v|40,v&=1):v=0:y.flags=v&-9|32:v=0:y.flags=v|32,v&2&&t(y),v&1){const w=y.subs;if(w!==void 0){const S=(h=w).nextSub;S!==void 0&&(g={value:m,prev:g},m=S);continue}}if((h=m)!==void 0){m=h.nextSub;continue}for(;g!==void 0;)if(h=g.value,g=g.prev,h!==void 0){m=h.nextSub;continue e}break}while(!0)}function l(h,m){let g,y=0,v=!1;e:do{const w=h.dep,S=w.flags;if(m.flags&16)v=!0;else if((S&17)===17){if(e(w)){const N=w.subs;N.nextSub!==void 0&&c(N),v=!0}}else if((S&33)===33){(h.nextSub!==void 0||h.prevSub!==void 0)&&(g={value:h,prev:g}),h=w.deps,m=w,++y;continue}if(!v){const N=h.nextDep;if(N!==void 0){h=N;continue}}for(;y--;){const N=m.subs,C=N.nextSub!==void 0;if(C?(h=g.value,g=g.prev):h=N,v){if(e(m)){C&&c(N),m=h.sub;continue}v=!1}else m.flags&=-33;m=h.sub;const A=h.nextDep;if(A!==void 0){h=A;continue e}}return v}while(!0)}function c(h){do{const m=h.sub,g=m.flags;(g&48)===32&&(m.flags=g|16,(g&6)===2&&t(m))}while((h=h.nextSub)!==void 0)}function f(h,m){let g=m.depsTail;for(;g!==void 0;){if(g===h)return!0;g=g.prevDep}return!1}}let MS=0,uo=0,vd=0;const va=[],{link:cye,unlink:lM,propagate:uye,checkDirty:e8,shallowPropagate:dye}=oM({update(e){return e.depsTail!==void 0?i8(e):a8(e)},notify(e){let t=vd,n=t;do if(va[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(vd=t;n<--t;){const r=va[n];va[n++]=va[t],va[t]=r}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,ag(e)):l8.call(e)}});function t8(){return MS}function n8(){++MS}function r8(){--MS||o8()}function i8(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,ag(e)}}function a8(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function s8(e){const t=e.flags;if(t&16||t&32&&e8(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,ag(e)}}else e.flags=2}function o8(){try{for(;uo<vd;){const e=va[uo];va[uo++]=void 0,s8(e)}}finally{for(;uo<vd;){const e=va[uo];va[uo++]=void 0,e.flags|=10}uo=0,vd=0}}function l8(){this.depsTail=void 0,this.flags=0,ag(this);const e=this.subs;e!==void 0&&lM(e)}function ag(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=lM(n,e)}function RS(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 Jx=[];let kp=0;const{link:yk,unlink:c8,propagate:u8,checkDirty:cM,shallowPropagate:vk}=oM({update(e){return e._update()},notify(e){Jx[ew++]=e,e.flags&=~Dt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Dt.Mutable|Dt.Dirty,Yp(e))}});let Hh=0,ew=0,Mi;function Yp(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=c8(n,e)}function uM(){if(!(t8()>0)){for(;Hh<ew;){const e=Jx[Hh];Jx[Hh++]=void 0,e.notify()}Hh=0,ew=0}}function dM(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 Mi!==void 0&&yk(i,Mi,kp),i._snapshot},subscribe(s){const l=RS(s),c={current:!1},f=d8(()=>{i.get(),c.current?l.next?.(i._snapshot):c.current=!0});return{unsubscribe:()=>{f.stop()}}},_update(s){const l=Mi,c=Object.is;if(n)Mi=i,++kp,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{Mi=l,n&&(i.flags&=~Dt.RecursedCheck),Yp(i)}}};return n?(i.flags=Dt.Mutable|Dt.Dirty,i.get=function(){const s=i.flags;if(s&Dt.Dirty||s&Dt.Pending&&cM(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&vk(l)}}else s&Dt.Pending&&(i.flags=s&~Dt.Pending);return Mi!==void 0&&yk(i,Mi,kp),i._snapshot}):i.set=function(s){if(i._update(s)){const l=i.subs;l!==void 0&&(u8(l),vk(l),uM())}},i}function d8(e){const t=()=>{const r=Mi;Mi=n,++kp,n.depsTail=void 0,n.flags=Dt.Watching|Dt.RecursedCheck;try{return e()}finally{Mi=r,n.flags&=~Dt.RecursedCheck,Yp(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&&cM(this.deps,this)?t():this.flags=Dt.Watching},stop(){this.flags=Dt.None,this.depsTail=void 0,Yp(this)}};return t(),n}class f8{constructor(t){this.atom=dM(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(RS(t))}}class h8{constructor(t){this.atom=dM(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(RS(t))}}function p8(e){return typeof e=="function"?new h8(e):new f8(e)}function m8(e){try{n8(),e()}finally{r8(),uM()}}function bd(e){let t;return m8(()=>{t=e()}),t}var tw=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},sg=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),zo=(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},bk=(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},xs=(e,t,n)=>{if(!(!cr(n)&&!Qn(n)))throw cr(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:cr(n)?"redirected":r.status==="pending"?"success":r.status,context:zo(e,t.index),isFetching:!1,error:n})),Qn(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),cr(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},fM=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},xk=(e,t,n)=>{const r=zo(e,n);e.updateMatch(t,i=>({...i,context:r}))},Xu=(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,xs(e,e.router.getMatch(i),n);try{l.options.onError?.(n)}catch(c){n=c,xs(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&&!cr(n)&&!Qn(n)&&(e.serialError??=n)},hM=(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||mM(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const s=setTimeout(()=>{tw(e)},i);r._nonReactive.pendingTimeout=s}},g8=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;hM(e,t,n,r);const i=()=>{const s=e.router.getMatch(t);s.preload&&(s.status==="redirected"||s.status==="notFound")&&xs(e,s,s.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},y8=(e,t,n,r)=>{const i=e.router.getMatch(t);let s=i._nonReactive.loadPromise;i._nonReactive.loadPromise=_c(()=>{s?.resolve(),s=void 0});const{paramsError:l,searchError:c}=i;l&&Xu(e,n,l,"PARSE_PARAMS"),c&&Xu(e,n,c,"VALIDATE_SEARCH"),hM(e,t,r,i);const f=new AbortController;let h=!1;const m=()=>{h||(h=!0,e.updateMatch(t,_=>({..._,isFetching:"beforeLoad",fetchCount:_.fetchCount+1,abortController:f})))},g=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,_=>({..._,isFetching:!1}))};if(!r.options.beforeLoad){bd(()=>{m(),g()});return}i._nonReactive.beforeLoadPromise=_c();const y={...zo(e,n,!1),...i.__routeContext},{search:v,params:w,cause:S}=i,N=sg(e,t),C={search:v,abortController:f,params:w,preload:N,context:y,location:e.location,navigate:_=>e.router.navigate({..._,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:N?"preload":S,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},A=_=>{if(_===void 0){bd(()=>{m(),g()});return}(cr(_)||Qn(_))&&(m(),Xu(e,n,_,"BEFORE_LOAD")),bd(()=>{m(),e.updateMatch(t,T=>({...T,__beforeLoadContext:_})),g()})};let k;try{if(k=r.options.beforeLoad(C),Od(k))return m(),k.catch(_=>{Xu(e,n,_,"BEFORE_LOAD")}).then(A)}catch(_){m(),Xu(e,n,_,"BEFORE_LOAD")}A(k)},v8=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],s=()=>c(),l=()=>y8(e,n,t,i),c=()=>{if(fM(e,n))return;const f=g8(e,n,i);return Od(f)?f.then(l):l()};return s()},b8=(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}))},pM=(e,t,n,r,i)=>{const s=t[r-1],{params:l,loaderDeps:c,abortController:f,cause:h}=e.router.getMatch(n),m=zo(e,r),g=sg(e,n);return{params:l,deps:c,preload:!!g,parentMatchPromise:s,abortController:f,context:m,location:e.location,navigate:y=>e.router.navigate({...y,_fromLocation:e.location}),cause:g?"preload":h,route:i,...e.router.options.additionalContext}},wk=async(e,t,n,r,i)=>{try{const s=e.router.getMatch(n);try{(!(yB??e.router.isServer)||s.ssr===!0)&&kd(i);const l=i.options.loader,c=typeof l=="function"?l:l?.handler,f=c?.(pM(e,t,n,r,i)),h=!!c&&Od(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;xs(e,e.router.getMatch(n),g),g!==void 0&&e.updateMatch(n,y=>({...y,loaderData:g}))}i._lazyPromise&&await i._lazyPromise;const m=s._nonReactive.minPendingPromise;m&&await m,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,g=>({...g,error:void 0,context:zo(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:zo(e,r)}));return}const f=s._nonReactive.minPendingPromise;f&&await f,Qn(l)&&await i.options.notFoundComponent?.preload?.(),xs(e,e.router.getMatch(n),l);try{i.options.onError?.(l)}catch(h){c=h,xs(e,e.router.getMatch(n),h)}!cr(c)&&!Qn(c)&&await kd(i,["errorComponent"]),e.updateMatch(n,h=>({...h,error:c,context:zo(e,r),status:"error",isFetching:!1}))}}catch(s){const l=e.router.getMatch(n);l&&(l._nonReactive.loaderPromise=void 0),xs(e,l,s)}},x8=async(e,t,n)=>{async function r(v,w,S,N,C){const A=Date.now()-w.updatedAt,k=v?C.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:C.options.staleTime??e.router.options.defaultStaleTime??0,_=C.options.shouldReload,T=typeof _=="function"?_(pM(e,t,i,n,C)):_,{status:P,invalid:E}=N,z=A>k&&(!!e.forceStaleReload||N.cause==="enter"||S!==void 0&&S!==N.id);l=P==="success"&&(E||(T??z)),v&&C.options.preload===!1||(l&&!e.sync&&m?(c=!0,(async()=>{try{await wk(e,t,i,n,C);const D=e.router.getMatch(i);D._nonReactive.loaderPromise?.resolve(),D._nonReactive.loadPromise?.resolve(),D._nonReactive.loaderPromise=void 0,D._nonReactive.loadPromise=void 0}catch(D){cr(D)&&await e.router.navigate(D.options)}})()):P!=="success"||l?await wk(e,t,i,n,C):xk(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,m=((typeof h=="function"?void 0:h?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(fM(e,i)){if(!e.router.getMatch(i))return e.matches[n];xk(e,i,n)}else{const v=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(v._nonReactive.loaderPromise){if(v.status==="success"&&!e.sync&&!v.preload&&m)return v;await v._nonReactive.loaderPromise;const N=e.router.getMatch(i),C=N._nonReactive.error||N.error;C&&xs(e,N,C),N.status==="pending"&&await r(S,v,w,N,f)}else{const N=S&&!e.router.state.matches.some(A=>A.id===i),C=e.router.getMatch(i);C._nonReactive.loaderPromise=_c(),N!==C.preload&&e.updateMatch(i,A=>({...A,preload:N})),await r(S,v,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 y=c?g.isFetching:!1;return y!==g.isFetching||g.invalid!==!1?(e.updateMatch(i,v=>({...v,isFetching:y,invalid:!1})),e.router.getMatch(i)):g};async function Sk(e){const t=e,n=[];t.router.state.matches.some(y=>y._forcePending)&&tw(t);let r;for(let y=0;y<t.matches.length;y++){try{const v=v8(t,y);Od(v)&&await v}catch(v){if(cr(v))throw v;if(Qn(v))r=v;else if(!t.preload)throw v;break}if(t.serialError)break}const i=t.firstBadMatchIndex??t.matches.length,s=r&&!t.preload?bk(t,r):void 0,l=r&&t.preload?0:s!==void 0?Math.min(s+1,i):i;let c,f;for(let y=0;y<l;y++)n.push(x8(t,n,y));try{await Promise.all(n)}catch{const y=await Promise.allSettled(n);for(const v of y){if(v.status!=="rejected")continue;const w=v.reason;if(cr(w))throw w;Qn(w)?c??=w:f??=w}if(f!==void 0)throw f}const h=c??(r&&!t.preload?r:void 0);let m=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!h&&r&&t.preload)return t.matches;if(h){const y=bk(t,h);As(y!==void 0);const v=t.matches[y],w=t.router.looseRoutesById[v.routeId],S=t.router.options?.defaultNotFoundComponent;!w.options.notFoundComponent&&S&&(w.options.notFoundComponent=S),h.routeId=v.routeId;const N=v.routeId===t.router.routeTree.id;t.updateMatch(v.id,C=>({...C,...N?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:h},isFetching:!1})),m=y,await kd(w,["notFoundComponent"])}else if(!t.preload){const y=t.matches[0];y.globalNotFound||t.router.getMatch(y.id)?.globalNotFound&&t.updateMatch(y.id,v=>({...v,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const y=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await kd(y,["errorComponent"])}for(let y=0;y<=m;y++){const{id:v,routeId:w}=t.matches[y],S=t.router.looseRoutesById[w];try{const N=b8(t,v,S);if(N){const C=await N;t.updateMatch(v,A=>({...A,...C}))}}catch(N){console.error(`Error executing head for route ${w}:`,N)}}const g=tw(t);if(Od(g)&&await g,h)throw h;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function jk(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function kd(e,t=Ap){!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===Ap?(()=>{if(e._componentsPromise===void 0){const r=jk(e,Ap);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():jk(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function mM(e){for(const t of Ap)if(e.options[t]?.preload)return!0;return!1}var Ap=["component","errorComponent","pendingComponent","notFoundComponent"],Ns="__TSR_index",Nk="popstate",Ck="beforeunload";function w8(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?.()??[],m=f.type==="PUSH"||f.type==="REPLACE";if(typeof document<"u"&&h.length&&m)for(const g of h){const y=Wp(f.path,f.state);if(await g.blockerFn({currentLocation:t,nextLocation:y,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[Ns];c=_k(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[Ns];c=_k(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[Ns]!==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 _k(e,t){t||(t={});const n=DS();return{...t,key:n,__TSR_key:n,[Ns]:e}}function S8(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=(()=>Wp(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const z=DS();t.history.replaceState({[Ns]:0,key:z,__TSR_key:z},"")}let h=f(),m,g=!1,y=!1,v=!1,w=!1;const S=()=>h;let N,C;const A=()=>{N&&(E._ignoreSubscribers=!0,(N.isPush?t.history.pushState:t.history.replaceState)(N.state,"",N.href),E._ignoreSubscribers=!1,N=void 0,C=void 0,m=void 0)},k=(z,D,F)=>{const U=c(D);C||(m=h),h=Wp(D,F),N={href:U,state:F,isPush:N?.isPush||z==="push"},C||(C=Promise.resolve().then(()=>A()))},_=z=>{h=f(),E.notify({type:z})},T=async()=>{if(y){y=!1;return}const z=f(),D=z.state[Ns]-h.state[Ns],F=D===1,U=D===-1,I=!F&&!U||g;g=!1;const ae=I?"GO":U?"BACK":"FORWARD",ve=I?{type:"GO",index:D}:{type:U?"BACK":"FORWARD"};if(v)v=!1;else{const me=s();if(typeof document<"u"&&me.length){for(const G of me)if(await G.blockerFn({currentLocation:h,nextLocation:z,action:ae})){y=!0,t.history.go(1),E.notify(ve);return}}}h=f(),E.notify(ve)},P=z=>{if(w){w=!1;return}let D=!1;const F=s();if(typeof document<"u"&&F.length)for(const U of F){const I=U.enableBeforeUnload??!0;if(I===!0){D=!0;break}if(typeof I=="function"&&I()===!0){D=!0;break}}if(D)return z.preventDefault(),z.returnValue=""},E=w8({getLocation:S,getLength:()=>t.history.length,pushState:(z,D)=>k("push",z,D),replaceState:(z,D)=>k("replace",z,D),back:z=>(z&&(v=!0),w=!0,t.history.back()),forward:z=>{z&&(v=!0),w=!0,t.history.forward()},go:z=>{g=!0,t.history.go(z)},createHref:z=>c(z),flush:A,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Ck,P,{capture:!0}),t.removeEventListener(Nk,T)},onBlocked:()=>{m&&h!==m&&(h=m)},getBlockers:s,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(Ck,P,{capture:!0}),t.addEventListener(Nk,T),t.history.pushState=function(...z){const D=n.apply(t.history,z);return E._ignoreSubscribers||_("PUSH"),D},t.history.replaceState=function(...z){const D=r.apply(t.history,z);return E._ignoreSubscribers||_("REPLACE"),D},E}function j8(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Wp(e,t){const n=j8(e),r=n.indexOf("#"),i=n.indexOf("?"),s=DS();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||{[Ns]:0,key:s,__TSR_key:s}}}function DS(){return(Math.random()+1).toString(36).substring(7)}function Mo(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 N8(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}var C8=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=LB(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=S8()),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=Gp(1e3),h=this.buildRouteTree(),this.setRoutes(h)}!this.__store&&this.latestLocation&&(this.__store=p8(O8(this.latestLocation)),KB(this));let l=!1;const c=this.options.basepath??"/",f=this.options.rewrite;if(i||r!==c||s!==f){this.basepath=c;const h=[],m=aM(c);m&&m!=="/"&&h.push(JB({basepath:c})),f&&h.push(f),this.rewrite=h.length===0?void 0:h.length===1?h[0]:XB(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=TB(this.routeTree,this.options.caseSensitive,(n,r)=>{n.init({originalIndex:r})});return this.options.routeMasks&&_B(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:m,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:m,pathname:Wu(c).path,external:!1,searchStr:C,search:co(n?.search,N),hash:Wu(h.slice(1)).path,state:So(n?.state,g)}}const y=new URL(m,this.origin),v=Xx(this.rewrite,y),w=this.options.parseSearch(v.search),S=this.options.stringifySearch(w);return v.search=S,{href:v.href.replace(v.origin,""),publicHref:m,pathname:Wu(v.pathname).path,external:!!this.rewrite&&v.origin!==this.origin,searchStr:S,search:co(n?.search,w),hash:Wu(v.hash.slice(1)).path,state:So(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)=>DB({base:t,to:PS(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=>k8({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,m=Object.assign(Object.create(null),l.params),g=i.to?this.resolvePathWithBase(f,`${i.to}`):this.resolvePathWithBase(f,"."),y=i.params===!1||i.params===null?Object.create(null):(i.params??!0)===!0?m:Object.assign(m,bs(i.params,m)),v=this.getMatchedRoutes(g);let w=v.matchedRoutes;if((!v.foundRoute||v.foundRoute.path!=="/"&&v.routeParams["**"])&&this.options.notFoundRoute&&(w=[...w,this.options.notFoundRoute]),Object.keys(y).length>0)for(const D of w){const F=D.options.params?.stringify??D.options.stringifyParams;if(F)try{Object.assign(y,F(y))}catch{}}const S=t.leaveParams?g:Wu(mk({path:g,params:y,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let N=h;if(t._includeValidateSearch&&this.options.search?.strict){const D={};w.forEach(F=>{if(F.options.validateSearch)try{Object.assign(D,Ep(F.options.validateSearch,{...D,...N}))}catch{}}),N=D}N=A8({search:N,dest:i,destRoutes:w,_includeValidateSearch:t._includeValidateSearch}),N=co(h,N);const C=this.options.stringifySearch(N),A=i.hash===!0?s.hash:i.hash?bs(i.hash,s.hash):void 0,k=A?`#${A}`:"";let _=i.state===!0?s.state:i.state?bs(i.state,s.state):{};_=So(s.state,_);const T=`${S}${C}${k}`;let P,E,z=!1;if(this.rewrite){const D=new URL(T,this.origin),F=sM(this.rewrite,D);P=D.href.replace(D.origin,""),F.origin!==this.origin?(E=F.href,z=!0):E=F.pathname+F.search+F.hash}else P=jB(T),E=P;return{publicHref:E,href:P,pathname:S,search:N,searchStr:C,state:_,hash:A??"",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=OB(l.pathname,this.processedTree);if(h){Object.assign(f,h.rawParams);const{from:m,params:g,...y}=h.route,v=g===!1||g===null?Object.create(null):(g??!0)===!0?f:Object.assign(f,bs(g,f));s={from:t.from,...y,params:v},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=To(r.state,this.latestLocation.state);return c.forEach(h=>{delete r.state[h]}),f},s=js(this.latestLocation.href)===js(r.href);let l=this.commitLocationPromise;if(this.commitLocationPromise=_c(()=>{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 m=this.history.location.state.__TSR_index,g=Wp(l,{__TSR_index:t?m:m+1}),y=new URL(g.pathname,this.origin);c.to=Xx(this.rewrite,y).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(Hp(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",...Mo({resolvedLocation:h,location:f})}),this.emit({type:"onBeforeLoad",...Mo({resolvedLocation:h,location:f})}),await Sk({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 m=[],g=[],y=[],v=[];bd(()=>{this.__store.setState(w=>{const S=w.matches,N=w.pendingMatches||w.matches;return m=S.filter(C=>!N.some(A=>A.id===C.id)),g=S.filter(C=>!N.some(A=>A.routeId===C.routeId)),y=N.filter(C=>!S.some(A=>A.routeId===C.routeId)),v=N.filter(C=>S.some(A=>A.routeId===C.routeId)),{...w,isLoading:!1,loadedAt:Date.now(),matches:N,pendingMatches:void 0,cachedMatches:[...w.cachedMatches,...m.filter(C=>C.status!=="error"&&C.status!=="notFound"&&C.status!=="redirected")]}}),this.clearExpiredCache()}),[[g,"onLeave"],[y,"onEnter"],[v,"onStay"]].forEach(([w,S])=>{w.forEach(N=>{this.looseRoutesById[N.routeId].options[S]?.(N)})})})})}})}catch(f){cr(f)?(n=f,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):Qn(f)&&(r=f),this.__store.setState(h=>({...h,statusCode:n?n.status:r?404:h.matches.some(m=>m.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(Mo({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:N8(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&&Hp(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=kd,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)]);bd(()=>{r.forEach(l=>{s.has(l.id)||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,l]}))})});try{return r=await Sk({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(cr(l))return l.options.reloadDocument?void 0:await this.preloadRoute({...l.options,_fromLocation:n});Qn(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=kB(i.pathname,n?.caseSensitive??!1,n?.fuzzy??!1,s.pathname,this.processedTree);return!l||t.params&&!To(l.rawParams,t.params,{partial:!0})?!1:n?.includeSearch??!0?To(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??YB,parseSearch:e.parseSearch??ZB,protocolAllowlist:e.protocolAllowlist??SB}),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["**"]:js(e.pathname))&&(this.options.notFoundRoute?l=[...l,this.options.notFoundRoute]:c=!0);const f=c?T8(this.options.notFoundMode,l):void 0,h=new Array(l.length),m=new Map(this.state.matches.map(g=>[g.routeId,g]));for(let g=0;g<l.length;g++){const y=l[g],v=h[g-1];let w,S,N;{const ae=v?.search??e.search,ve=v?._strictSearch??void 0;try{const me=Ep(y.options.validateSearch,{...ae})??void 0;w={...ae,...me},S={...ve,...me},N=void 0}catch(me){let G=me;if(me instanceof Qp||(G=new Qp(me.message,{cause:me})),t?.throwOnError)throw G;w=ae,S={},N=G}}const C=y.options.loaderDeps?.({search:w})??"",A=C?JSON.stringify(C):"",{interpolatedPath:k,usedParams:_}=mk({path:y.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),T=y.id+k+A,P=this.getMatch(T),E=m.get(y.id),z=P?._strictParams??_;let D;if(!P)try{Ok(y,_,s,z)}catch(ae){if(Qn(ae)||cr(ae)?D=ae:D=new _8(ae.message,{cause:ae}),t?.throwOnError)throw D}Object.assign(i,z);const F=E?"stay":"enter";let U;if(P)U={...P,cause:F,params:E?.params??i,_strictParams:z,search:co(E?E.search:P.search,w),_strictSearch:S};else{const ae=y.options.loader||y.options.beforeLoad||y.lazyFn||mM(y)?"pending":"success";U={id:T,ssr:y.options.ssr,index:g,routeId:y.id,params:E?.params??i,_strictParams:z,pathname:k,updatedAt:Date.now(),search:E?co(E.search,w):w,_strictSearch:S,searchError:void 0,status:ae,isFetching:!1,error:void 0,paramsError:D,__routeContext:void 0,_nonReactive:{loadPromise:_c()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:F,loaderDeps:E?So(E.loaderDeps,C):C,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:y.options.staticData||{},fullPath:y.fullPath}}t?.preload||(U.globalNotFound=f===y.id),U.searchError=N;const I=this.getParentContext(v);U.context={...I,...U.__routeContext,...U.__beforeLoadContext},h[g]=U}for(let g=0;g<h.length;g++){const y=h[g],v=this.looseRoutesById[y.routeId],w=this.getMatch(y.id),S=m.get(y.routeId);if(y.params=S?co(S.params,i):i,!w){const N=h[g-1],C=this.getParentContext(N);if(v.options.context){const A={deps:y.loaderDeps,params:y.params,context:C??{},location:e,navigate:k=>this.navigate({...k,_fromLocation:e}),buildLocation:this.buildLocation,cause:y.cause,abortController:y.abortController,preload:!!y.preload,matches:h,routeId:v.id};y.__routeContext=v.options.context(A)??void 0}y.context={...C,...y.__routeContext,...y.__beforeLoadContext}}}return h}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=_d(t),s={...e.search};for(const h of t)try{Object.assign(s,Ep(h.options.validateSearch,s))}catch{}const l=_d(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 m of t)try{Ok(m,n,r??{},h)}catch{}f=h}return{matchedRoutes:t,fullPath:i.fullPath,search:s,params:f}}},Qp=class extends Error{},_8=class extends Error{};function O8(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Ep(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Qp("Async validation not supported");if(n.issues)throw new Qp(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 k8({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),i=js(e);let s,l;const c=AB(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 A8({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return E8(n)(e,t,r??!1)}function E8(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((m,g)=>g(m),l));const h=c(f);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((m,g)=>g(m),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,...Ep(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:bs(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 T8(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 Po}function Ok(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 P8="Error preloading route! ☝️",gM=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=Po:this.parentRoute||As(!1);let i=r?Po:n?.path;i&&i!=="/"&&(i=iM(i));const s=n?.id||i;let l=r?Po:Op([this.parentRoute.id==="__root__"?"":this.parentRoute.id,s]);i==="__root__"&&(i="/"),l!=="__root__"&&(l=Op(["/",l]));const c=l==="__root__"?"/":Op([this.parentRoute.fullPath,i]);this._path=i,this._id=l,this._fullPath=c,this._to=js(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.")}},z8=class extends gM{constructor(e){super(e)}};function LS(e){const t=e.errorComponent??IS;return u.jsx(M8,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?x.createElement(t,{error:n,reset:r}):e.children})}var M8=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 IS({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 R8({children:e,fallback:t=null}){return yM()?u.jsx(fi.Fragment,{children:e}):u.jsx(fi.Fragment,{children:t})}function yM(){return fi.useSyncExternalStore(D8,()=>!0,()=>!1)}function D8(){return()=>{}}var vM=x.createContext(null);function Jr(e){const t=x.useContext(vM);return e?.warn,t}var H0={exports:{}},G0={},V0={exports:{}},Z0={};var kk;function L8(){if(kk)return Z0;kk=1;var e=Uc();function t(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,s=e.useLayoutEffect,l=e.useDebugValue;function c(g,y){var v=y(),w=r({inst:{value:v,getSnapshot:y}}),S=w[0].inst,N=w[1];return s(function(){S.value=v,S.getSnapshot=y,f(S)&&N({inst:S})},[g,v,y]),i(function(){return f(S)&&N({inst:S}),g(function(){f(S)&&N({inst:S})})},[g]),l(v),v}function f(g){var y=g.getSnapshot;g=g.value;try{var v=y();return!n(g,v)}catch{return!0}}function h(g,y){return y()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:c;return Z0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Z0}var Ak;function I8(){return Ak||(Ak=1,V0.exports=L8()),V0.exports}var Ek;function $8(){if(Ek)return G0;Ek=1;var e=Uc(),t=I8();function n(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}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 G0.useSyncExternalStoreWithSelector=function(h,m,g,y,v){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(!A){if(A=!0,k=P,P=y(P),v!==void 0&&S.hasValue){var E=S.value;if(v(E,P))return _=E}return _=P}if(E=_,r(k,P))return E;var z=y(P);return v!==void 0&&v(E,z)?(k=P,E):(k=P,_=z)}var A=!1,k,_,T=g===void 0?null:g;return[function(){return C(m())},T===null?void 0:function(){return C(T())}]},[m,g,y,v]);var N=i(h,w[0],w[1]);return l(function(){S.hasValue=!0,S.value=N},[N]),f(N),N},G0}var Tk;function U8(){return Tk||(Tk=1,H0.exports=$8()),H0.exports}var bM=U8();function B8(e,t){return e===t}function q8(e,t,n=B8){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 fr(e){const t=Jr({warn:e?.router===void 0}),n=e?.router||t,r=x.useRef(void 0);return q8(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const s=So(r.current,e.select(i));return r.current=s,s}return e.select(i)}return i})}var og=x.createContext(void 0),F8=x.createContext(void 0);function Ds(e){const t=x.useContext(e.from?F8:og);return fr({select:n=>{const r=n.matches.find(i=>e.from?e.from===i.routeId:i.id===t);if(As(!((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 $S(e){return Ds({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function US(e){const{select:t,...n}=e;return Ds({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function lg(e){return Ds({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 Ds({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Ls(e){const t=Jr();return x.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function BS(e){return Ds({...e,select:t=>e.select?e.select(t.context):t.context})}var el=$z();const K8=Ms(el);function H8(e,t){const n=Jr(),r=gB(t),{activeProps:i,inactiveProps:s,activeOptions:l,to:c,preload:f,preloadDelay:h,hashScrollIntoView:m,replace:g,startTransition:y,resetScroll:v,viewTransition:w,children:S,target:N,disabled:C,style:A,className:k,onClick:_,onBlur:T,onFocus:P,onMouseEnter:E,onMouseLeave:z,onTouchStart:D,ignoreBlocker:F,params:U,search:I,hash:ae,state:ve,mask:me,reloadDocument:G,unsafeRelative:re,from:ge,_fromLocation:Se,...B}=e,R=yM(),H=fr({select:Ke=>{const at=Ke.matches[Ke.matches.length-1];return{search:at?.search,hash:Ke.location.hash,path:at?.pathname}},structuralSharing:!0}),oe=e.from,Q=x.useMemo(()=>({...e,from:oe}),[n,H,oe,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),X=x.useMemo(()=>n.buildLocation({...Q}),[n,Q]),W=X.maskedLocation?X.maskedLocation.publicHref:X.publicHref,le=X.maskedLocation?X.maskedLocation.external:X.external,ye=x.useMemo(()=>Q8(W,le,n.history,C),[C,le,W,n.history]),Z=x.useMemo(()=>{if(ye?.external)return Hp(ye.href,n.protocolAllowlist)?void 0:ye.href;if(!X8(c)&&!(typeof c!="string"||c.indexOf(":")===-1))try{return new URL(c),Hp(c,n.protocolAllowlist)?void 0:c}catch{}},[c,ye,n.protocolAllowlist]),ce=fr({select:Ke=>{if(Z)return!1;if(l?.exact){if(!RB(Ke.location.pathname,X.pathname,n.basepath))return!1}else{const at=Vp(Ke.location.pathname,n.basepath),Bt=Vp(X.pathname,n.basepath);if(!(at.startsWith(Bt)&&(at.length===Bt.length||at[Bt.length]==="/")))return!1}return(l?.includeSearch??!0)&&!To(Ke.location.search,X.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?R&&Ke.location.hash===X.hash:!0}}),be=ce?bs(i,{})??G8:Y0,K=ce?Y0:bs(s,{})??Y0,Re=[k,be.className,K.className].filter(Boolean).join(" "),Ee=(A||be.style||K.style)&&{...A,...be.style,...K.style},[it,rt]=x.useState(!1),rn=x.useRef(!1),dn=e.reloadDocument||Z?!1:f??n.options.defaultPreload,Gt=h??n.options.defaultPreloadDelay??0,he=x.useCallback(()=>{n.preloadRoute({...Q,_builtLocation:X}).catch(Ke=>{console.warn(Ke),console.warn(P8)})},[n,Q,X]);mB(r,x.useCallback(Ke=>{Ke?.isIntersecting&&he()},[he]),W8,{disabled:!!C||dn!=="viewport"}),x.useEffect(()=>{rn.current||!C&&dn==="render"&&(he(),rn.current=!0)},[C,he,dn]);const Je=Ke=>{const at=Ke.currentTarget.getAttribute("target"),Bt=N!==void 0?N:at;if(!C&&!J8(Ke)&&!Ke.defaultPrevented&&(!Bt||Bt==="_self")&&Ke.button===0){Ke.preventDefault(),el.flushSync(()=>{rt(!0)});const Ye=n.subscribe("onResolved",()=>{Ye(),rt(!1)});n.navigate({...Q,replace:g,resetScroll:v,hashScrollIntoView:m,startTransition:y,viewTransition:w,ignoreBlocker:F})}};if(Z)return{...B,ref:r,href:Z,...S&&{children:S},...N&&{target:N},...C&&{disabled:C},...A&&{style:A},...k&&{className:k},..._&&{onClick:_},...T&&{onBlur:T},...P&&{onFocus:P},...E&&{onMouseEnter:E},...z&&{onMouseLeave:z},...D&&{onTouchStart:D}};const xt=Ke=>{if(C||dn!=="intent")return;if(!Gt){he();return}const at=Ke.currentTarget;if(Ju.has(at))return;const Bt=setTimeout(()=>{Ju.delete(at),he()},Gt);Ju.set(at,Bt)},xn=Ke=>{C||dn!=="intent"||he()},et=Ke=>{if(C||!dn||!Gt)return;const at=Ke.currentTarget,Bt=Ju.get(at);Bt&&(clearTimeout(Bt),Ju.delete(at))};return{...B,...be,...K,href:ye?.href,ref:r,onClick:Yl([_,Je]),onBlur:Yl([T,et]),onFocus:Yl([P,xt]),onMouseEnter:Yl([E,xt]),onMouseLeave:Yl([z,et]),onTouchStart:Yl([D,xn]),disabled:!!C,target:N,...Ee&&{style:Ee},...Re&&{className:Re},...C&&V8,...ce&&Z8,...R&&it&&Y8}}var Y0={},G8={className:"active"},V8={role:"link","aria-disabled":!0},Z8={"data-status":"active","aria-current":"page"},Y8={"data-transitioning":"transitioning"},Ju=new WeakMap,W8={rootMargin:"100px"},Yl=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Q8(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function X8(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}=H8(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 J8(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var eq=class extends gM{constructor(e){super(e),this.useMatch=t=>Ds({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>BS({...t,from:this.id}),this.useSearch=t=>cg({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>lg({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>US({...t,from:this.id}),this.useLoaderData=t=>$S({...t,from:this.id}),this.useNavigate=()=>Ls({from:this.fullPath}),this.Link=fi.forwardRef((t,n)=>u.jsx(Rt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function ei(e){return new eq(e)}function tq(){return e=>rq(e)}var nq=class extends z8{constructor(e){super(e),this.useMatch=t=>Ds({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>BS({...t,from:this.id}),this.useSearch=t=>cg({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>lg({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>US({...t,from:this.id}),this.useLoaderData=t=>$S({...t,from:this.id}),this.useNavigate=()=>Ls({from:this.fullPath}),this.Link=fi.forwardRef((t,n)=>u.jsx(Rt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function rq(e){return new nq(e)}function Pk(e){return typeof e=="object"?new zk(e,{silent:!0}).createRoute(e):new zk(e,{silent:!0}).createRoute}var zk=class{constructor(e,t){this.path=e,this.createRoute=n=>{const r=ei(n);return r.isRoot=!1,r},this.silent=t?.silent}},Mk=class{constructor(e){this.useMatch=t=>Ds({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>BS({...t,from:this.options.id}),this.useSearch=t=>cg({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>lg({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>US({...t,from:this.options.id}),this.useLoaderData=t=>$S({...t,from:this.options.id}),this.useNavigate=()=>Ls({from:Jr().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function Rk(e){return typeof e=="object"?new Mk(e):t=>new Mk({id:e,...t})}function iq(e){const t=fr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return u.jsx(LS,{getResetKey:()=>t,onCatch:(n,r)=>{if(Qn(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(Qn(n))return e.fallback?.(n);throw n},children:e.children})}function aq(){return u.jsx("p",{children:"Not Found"})}function cc(e){return u.jsx(u.Fragment,{children:e.children})}function xM(e,t,n){return t.options.notFoundComponent?u.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?u.jsx(e.options.defaultNotFoundComponent,{...n}):u.jsx(aq,{})}function sq(){return Jr().isScrollRestoring,null}var wM=x.memo(function({matchId:t}){const n=Jr(),r=fr({select:w=>{const S=w.matches.findIndex(C=>C.id===t),N=w.matches[S];return As(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,m=r.ssr===!1||r.ssr==="data-only",g=(!i.isRoot||i.options.wrapInSuspense||m)&&(i.options.wrapInSuspense??s??(i.options.errorComponent?.preload||m))?x.Suspense:cc,y=c?LS:cc,v=h?iq:cc;return u.jsxs(i.isRoot?i.options.shellComponent??cc:cc,{children:[u.jsx(og.Provider,{value:t,children:u.jsx(g,{fallback:l,children:u.jsx(y,{getResetKey:()=>r.resetKey,errorComponent:c||IS,onCatch:(w,S)=>{if(Qn(w))throw w;f?.(w,S)},children:u.jsx(v,{fallback:w=>{if(!h||w.routeId&&w.routeId!==r.routeId||!w.routeId&&!i.isRoot)throw w;return x.createElement(h,w)},children:m||r._displayPending?u.jsx(R8,{fallback:l,children:u.jsx(Dk,{matchId:t})}):u.jsx(Dk,{matchId:t})})})})}),r.parentRouteId===Po&&n.options.scrollRestoration?u.jsxs(u.Fragment,{children:[u.jsx(oq,{}),u.jsx(sq,{})]}):null]})});function oq(){const e=Jr(),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",...Mo(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var Dk=x.memo(function({matchId:t}){const n=Jr(),{match:r,key:i,routeId:s}=fr({select:f=>{const h=f.matches.find(y=>y.id===t),m=h.routeId,g=(n.routesById[m].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:m,loaderDeps:h.loaderDeps,params:h._strictParams,search:h._strictSearch});return{key:g?JSON.stringify(g):void 0,routeId:m,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(qS,{})},[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 m=_c();h._nonReactive.minPendingPromise=m,setTimeout(()=>{m.resolve(),h._nonReactive.minPendingPromise=void 0},f)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return As(Qn(r.error)),xM(n,l,r.error);if(r.status==="redirected")throw As(cr(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return c}),qS=x.memo(function(){const t=Jr(),n=x.useContext(og),r=fr({select:h=>h.matches.find(m=>m.id===n)?.routeId}),i=t.routesById[r],s=fr({select:h=>{const m=h.matches.find(g=>g.id===n);return As(m),m.globalNotFound}}),l=fr({select:h=>{const m=h.matches;return m[m.findIndex(g=>g.id===n)+1]?.id}}),c=t.options.defaultPendingComponent?u.jsx(t.options.defaultPendingComponent,{}):null;if(s)return xM(t,i,void 0);if(!l)return null;const f=u.jsx(wM,{matchId:l});return r===Po?u.jsx(x.Suspense,{fallback:c,children:f}):f});function lq(){const e=Jr(),t=x.useRef({router:e,mounted:!1}),[n,r]=x.useState(!1),{hasPendingMatches:i,isLoading:s}=fr({select:g=>({isLoading:g.isLoading,hasPendingMatches:g.matches.some(y=>y.status==="pending")}),structuralSharing:!0}),l=$0(s),c=s||n||i,f=$0(c),h=s||i,m=$0(h);return e.startTransition=g=>{r(!0),x.startTransition(()=>{g(),r(!1)})},x.useEffect(()=>{const g=e.history.subscribe(e.load),y=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return js(e.latestLocation.publicHref)!==js(y.publicHref)&&e.commitLocation({...y,replace:!0}),()=>{g()}},[e,e.history]),Fh(()=>{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(y){console.error(y)}})()},[e]),Fh(()=>{l&&!s&&e.emit({type:"onLoad",...Mo(e.state)})},[l,e,s]),Fh(()=>{m&&!h&&e.emit({type:"onBeforeRouteMount",...Mo(e.state)})},[h,m,e]),Fh(()=>{if(f&&!c){const g=Mo(e.state);e.emit({type:"onResolved",...g}),e.__store.setState(y=>({...y,status:"idle",resolvedLocation:y.location})),g.hrefChanged&&HB(e)}},[c,f,e]),null}function cq(){const e=Jr(),t=e.routesById[Po].options.pendingComponent??e.options.defaultPendingComponent,n=t?u.jsx(t,{}):null,r=u.jsxs(typeof document<"u"&&e.ssr?cc:x.Suspense,{fallback:n,children:[u.jsx(lq,{}),u.jsx(uq,{})]});return e.options.InnerWrap?u.jsx(e.options.InnerWrap,{children:r}):r}function uq(){const e=Jr(),t=fr({select:i=>i.matches[0]?.id}),n=fr({select:i=>i.loadedAt}),r=t?u.jsx(wM,{matchId:t}):null;return u.jsx(og.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:u.jsx(LS,{getResetKey:()=>n,errorComponent:IS,onCatch:void 0,children:r})})}var dq=e=>new fq(e),fq=class extends C8{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=Pk,globalThis.createLazyFileRoute=Rk):typeof window<"u"&&(window.createFileRoute=Pk,window.createLazyFileRoute=Rk);function hq({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(vM.Provider,{value:e,children:t});return e.options.Wrap?u.jsx(e.options.Wrap,{children:r}):r}function pq({router:e,...t}){return u.jsx(hq,{router:e,...t,children:u.jsx(cq,{})})}function mq(e){return fr({select:t=>t.location})}class Xp extends Error{code;statusCode;constructor(t,n,r){super(t),this.name="ApiError",this.code=r??"UNKNOWN",this.statusCode=n}}function gq(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const yq=gq();function vq(){return""}function Lk(){return!!vq()}async function je(e,t){const n=await fetch(`${yq}${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 Xp(i,n.status,s)}if(n.status!==204)return n.json()}function SM(){return je("/projects")}function jM(e){return je(`/projects/${encodeURIComponent(e)}`)}function NM(){return je("/runs")}function Oc(e){return je(`/runs/${encodeURIComponent(e)}`)}function bq(e){return je(`/projects/${encodeURIComponent(e)}/keywords`)}function CM(e){return je(`/projects/${encodeURIComponent(e)}/competitors`)}function _M(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 ug(e,t){return je(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function xq(e,t){return je(`/projects/${encodeURIComponent(e)}/keywords`,{method:"PUT",body:JSON.stringify({keywords:t})})}function wq(e,t){return je(`/projects/${encodeURIComponent(e)}/keywords`,{method:"POST",body:JSON.stringify({keywords:t})})}function OM(e,t){return je(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function Ik(e,t){const n=await jM(e);return ug(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 Sq(e,t){const n=await jM(e);return ug(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 jq(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 Nq(e,t){return je(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function Cq(e,t){await je(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function _q(e,t){return je(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function Oq(e){await je(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function kq(e){return je(`/projects/${encodeURIComponent(e)}/export`)}function FS(){return je("/settings")}function Aq(){return je("/session")}function Eq(e){return je("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function Tq(e){return je("/session",{method:"POST",body:JSON.stringify({password:e})})}function Pq(e,t){return je(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function zq(e){return je("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function Mq(e){try{return await je(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof Error&&t.message.includes("404"))return null;throw t}}function $k(e,t){return je(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function Rq(e){await je(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function Dq(e){return je(`/projects/${encodeURIComponent(e)}/notifications`)}function Lq(e,t){return je(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function Iq(e,t){await je(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function $q(e,t){return je(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function Uq(e,t,n){return je(`/projects/${encodeURIComponent(e)}/keywords/generate`,{method:"POST",body:JSON.stringify({provider:t,count:n})})}function Bq(e){return je("/apply",{method:"POST",body:JSON.stringify(e)})}function qq(e){return je("/runs",{method:"POST",body:JSON.stringify(e??{})})}function kM(e){return je(`/projects/${encodeURIComponent(e)}/google/connections`)}function Fq(e,t){return je(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function Kq(e,t){return je(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function Hq(e){return je(`/projects/${encodeURIComponent(e)}/google/properties`)}function Gq(e,t,n){return je(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:n})})}function Vq(e,t,n){return je(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:n})})}function AM(e,t){return je(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function Zq(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 Yq(e,t){return je(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function Wq(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 Qq(e){return je(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function KS(e){return je(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function Xq(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return je(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${r}`)}function Jq(e,t){return je(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function e9(e){return je(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function t9(e){return je(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function Uk(){return je("/cdp/status")}function n9(e,t){return je("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function Bk(e,t){return je(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function EM(e){return je(`/projects/${encodeURIComponent(e)}/bing/status`)}function r9(e,t){return je(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function i9(e){return je(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function a9(e){return je(`/projects/${encodeURIComponent(e)}/bing/sites`)}function s9(e,t){return je(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function HS(e){return je(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function TM(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return je(`/projects/${encodeURIComponent(e)}/bing/inspections${r}`)}function PM(e,t){return je(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function qk(e,t){return je(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function o9(e){return je(`/projects/${encodeURIComponent(e)}/bing/performance`)}function l9(e){return je("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function c9(e,t){const n=t?`?window=${t}`:"";return je(`/projects/${encodeURIComponent(e)}/analytics/metrics${n}`)}function u9(e,t){const n=t?`?window=${t}`:"";return je(`/projects/${encodeURIComponent(e)}/analytics/gaps${n}`)}function d9(e,t){const n=t?`?window=${t}`:"";return je(`/projects/${encodeURIComponent(e)}/analytics/sources${n}`)}function Fk(e){return je(`/projects/${encodeURIComponent(e)}/ga/status`)}function Kk(e,t){return je(`/projects/${encodeURIComponent(e)}/ga/traffic`)}function zM(e,t){return je(`/projects/${encodeURIComponent(e)}/ga/sync`,{method:"POST",body:JSON.stringify({})})}function f9(e,t){return je(`/projects/${encodeURIComponent(e)}/ga/connect`,{method:"POST",body:JSON.stringify(t)})}function Hk(e){return je(`/projects/${encodeURIComponent(e)}/ga/ai-referral-history`)}function Gk(e){return je(`/projects/${encodeURIComponent(e)}/ga/session-history`)}function h9(e){return je(`/projects/${encodeURIComponent(e)}/ga/disconnect`,{method:"DELETE",body:"{}"})}async function p9(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 m9=6e3,g9=5,y9=180;let qn=[],v9=0;const nw=new Set,rw=new Map,iw=new Map;function Jp(){const e=[...qn];for(const t of nw)t(e)}function GS(e){const t=rw.get(e);t&&(clearTimeout(t),rw.delete(e));const n=iw.get(e);n&&(clearTimeout(n),iw.delete(e))}function MM(e){GS(e);const t=qn.length;qn=qn.filter(n=>n.id!==e),qn.length!==t&&Jp()}function Vk(e){GS(e.id),rw.set(e.id,setTimeout(()=>{aw(e.id)},e.durationMs))}function b9(e,t,n){return typeof e=="string"?{title:e,tone:t,durationMs:n}:e}function Xe(e,t="negative",n=m9){const r=b9(e,t,n),i={id:String(++v9),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=qn.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 qn=qn.map(c=>c.id===s.id?l:c),Jp(),Vk(l),s.id}}return qn.length>=g9&&MM(qn[0].id),qn=[...qn,i],Jp(),Vk(i),i.id}function aw(e){const t=qn.find(n=>n.id===e);!t||t.state==="closing"||(GS(e),qn=qn.map(n=>n.id===e?{...n,state:"closing"}:n),Jp(),iw.set(e,setTimeout(()=>{MM(e)},y9)))}function x9(e){return nw.add(e),()=>{nw.delete(e)}}function Zk(){return qn}function w9(){return new lB({defaultOptions:{queries:{staleTime:3e4,retry:1,refetchOnWindowFocus:!1}},mutationCache:new Vz({onError:(e,t,n,r)=>{r.meta?.skipGlobalErrorToast||Xe({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const S9=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),j9=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Yk=e=>{const t=j9(e);return t.charAt(0).toUpperCase()+t.slice(1)},RM=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),N9=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var C9={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 _9=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,...C9,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:RM("lucide",i),...!s&&!N9(c)&&{"aria-hidden":"true"},...c},[...l.map(([h,m])=>x.createElement(h,m)),...Array.isArray(s)?s:[s]]));const Dn=(e,t)=>{const n=x.forwardRef(({className:r,...i},s)=>x.createElement(_9,{ref:s,iconNode:t,className:RM(`lucide-${S9(Yk(e))}`,`lucide-${e}`,r),...i}));return n.displayName=Yk(e),n};const O9=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],dg=Dn("chevron-right",O9);const k9=[["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"}]],A9=Dn("download",k9);const E9=[["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"}]],T9=Dn("github",E9);const P9=[["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"}]],z9=Dn("globe",P9);const M9=[["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"}]],R9=Dn("layout-dashboard",M9);const D9=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],L9=Dn("menu",D9);const I9=[["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"}]],$9=Dn("play",I9);const U9=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Wk=Dn("plus",U9);const B9=[["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"}]],Qk=Dn("refresh-cw",B9);const q9=[["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"}]],F9=Dn("rocket",q9);const K9=[["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"}]],H9=Dn("rotate-ccw",K9);const G9=[["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"}]],V9=Dn("settings",G9);const Z9=[["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"}]],Y9=Dn("trash-2",Z9);const W9=[["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"}]],Q9=Dn("triangle-alert",W9);const X9=[["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"}]],J9=Dn("unplug",X9);const eF=[["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"}]],tF=Dn("upload",eF);const nF=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],fg=Dn("x",nF);function rF(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 hg(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function di(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function Xk(e){return e===null?"Unknown":e?"Pass":"Fail"}function sw(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function iF(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function aF(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 W0(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 ${sw(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 ${sw(c)} · ${r}`}return`${e} · ${r}`}const DM="canonry.run-tracker",ow=new Set;let Jk=!1,sF=0,pg={runs:{},batches:{}};function oF(){const e=qo();for(const t of ow)t(e)}function lF(e){if(!e)return{runs:{},batches:{}};try{const t=JSON.parse(e);return{runs:t.runs??{},batches:t.batches??{}}}catch{return{runs:{},batches:{}}}}function cF(){typeof window>"u"||window.sessionStorage.setItem(DM,JSON.stringify(pg))}function LM(){Jk||(Jk=!0,!(typeof window>"u")&&(pg=lF(window.sessionStorage.getItem(DM))))}function mg(e){pg=e,cF(),oF()}function qo(){return LM(),pg}function uF(e){return LM(),ow.add(e),()=>{ow.delete(e)}}function IM(e){const t=qo();mg({...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 eA(e){const t=qo();if(!t.runs[e])return;const{[e]:n,...r}=t.runs;mg({...t,runs:r})}function dF(e){const t=qo(),n=`batch_${Date.now()}_${++sF}`;return mg({...t,batches:{...t.batches,[n]:{batchId:n,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),n}function fF(e){const t=qo();if(!t.batches[e])return;const{[e]:n,...r}=t.batches;mg({...t,batches:r})}function hF(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}function pF(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 tA(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function VS(...e){return t=>{let n=!1;const r=e.map(i=>{const s=tA(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():tA(e[i],null)}}}}function tl(...e){return x.useCallback(VS(...e),e)}var mF=Symbol.for("react.lazy"),em=rg[" use ".trim().toString()];function gF(e){return typeof e=="object"&&e!==null&&"then"in e}function $M(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===mF&&"_payload"in e&&gF(e._payload)}function yF(e){const t=bF(e),n=x.forwardRef((r,i)=>{let{children:s,...l}=r;$M(s)&&typeof em=="function"&&(s=em(s._payload));const c=x.Children.toArray(s),f=c.find(wF);if(f){const h=f.props.children,m=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,m):null})}return u.jsx(t,{...l,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}var vF=yF("Slot");function bF(e){const t=x.forwardRef((n,r)=>{let{children:i,...s}=n;if($M(i)&&typeof em=="function"&&(i=em(i._payload)),x.isValidElement(i)){const l=jF(i),c=SF(s,i.props);return i.type!==x.Fragment&&(c.ref=r?VS(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 xF=Symbol("radix.slottable");function wF(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===xF}function SF(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 jF(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 UM(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=UM(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function bt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=UM(e))&&(r&&(r+=" "),r+=t);return r}const nA=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,rA=bt,BM=(e,t)=>n=>{var r;if(t?.variants==null)return rA(e,n?.class,n?.className);const{variants:i,defaultVariants:s}=t,l=Object.keys(i).map(h=>{const m=n?.[h],g=s?.[h];if(m===null)return null;const y=nA(m)||nA(g);return i[h][y]}),c=n&&Object.entries(n).reduce((h,m)=>{let[g,y]=m;return y===void 0||(h[g]=y),h},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((h,m)=>{let{class:g,className:y,...v}=m;return Object.entries(v).every(w=>{let[S,N]=w;return Array.isArray(N)?N.includes({...s,...c}[S]):{...s,...c}[S]===N})?[...h,g,y]:h},[]);return rA(e,l,f,n?.class,n?.className)},NF=(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},CF=(e,t)=>({classGroupId:e,validator:t}),qM=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),tm="-",iA=[],_F="arbitrary..",OF=e=>{const t=AF(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return kF(l);const c=l.split(tm),f=c[0]===""&&c.length>1?1:0;return FM(c,f,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const f=r[l],h=n[l];return f?h?NF(h,f):f:h||iA}return n[l]||iA}}},FM=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],s=n.nextPart.get(i);if(s){const h=FM(e,t+1,s);if(h)return h}const l=n.validators;if(l===null)return;const c=t===0?e.join(tm):e.slice(t).join(tm),f=l.length;for(let h=0;h<f;h++){const m=l[h];if(m.validator(c))return m.classGroupId}},kF=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?_F+r:void 0})(),AF=e=>{const{theme:t,classGroups:n}=e;return EF(n,t)},EF=(e,t)=>{const n=qM();for(const r in e){const i=e[r];ZS(i,n,r,t)}return n},ZS=(e,t,n,r)=>{const i=e.length;for(let s=0;s<i;s++){const l=e[s];TF(l,t,n,r)}},TF=(e,t,n,r)=>{if(typeof e=="string"){PF(e,t,n);return}if(typeof e=="function"){zF(e,t,n,r);return}MF(e,t,n,r)},PF=(e,t,n)=>{const r=e===""?t:KM(t,e);r.classGroupId=n},zF=(e,t,n,r)=>{if(RF(e)){ZS(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(CF(n,e))},MF=(e,t,n,r)=>{const i=Object.entries(e),s=i.length;for(let l=0;l<s;l++){const[c,f]=i[l];ZS(f,KM(t,c),n,r)}},KM=(e,t)=>{let n=e;const r=t.split(tm),i=r.length;for(let s=0;s<i;s++){const l=r[s];let c=n.nextPart.get(l);c||(c=qM(),n.nextPart.set(l,c)),n=c}return n},RF=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,DF=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)}}},lw="!",aA=":",LF=[],sA=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),IF=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const s=[];let l=0,c=0,f=0,h;const m=i.length;for(let S=0;S<m;S++){const N=i[S];if(l===0&&c===0){if(N===aA){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 y=g,v=!1;g.endsWith(lw)?(y=g.slice(0,-1),v=!0):g.startsWith(lw)&&(y=g.slice(1),v=!0);const w=h&&h>f?h-f:void 0;return sA(s,v,y,w)};if(t){const i=t+aA,s=r;r=l=>l.startsWith(i)?s(l.slice(i.length)):sA(LF,!1,l,void 0,!0)}if(n){const i=r;r=s=>n({className:s,parseClassName:i})}return r},$F=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}},UF=e=>({cache:DF(e.cacheSize),parseClassName:IF(e),sortModifiers:$F(e),...OF(e)}),BF=/\s+/,qF=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:s}=t,l=[],c=e.trim().split(BF);let f="";for(let h=c.length-1;h>=0;h-=1){const m=c[h],{isExternal:g,modifiers:y,hasImportantModifier:v,baseClassName:w,maybePostfixModifierPosition:S}=n(m);if(g){f=m+(f.length>0?" "+f:f);continue}let N=!!S,C=r(N?w.substring(0,S):w);if(!C){if(!N){f=m+(f.length>0?" "+f:f);continue}if(C=r(w),!C){f=m+(f.length>0?" "+f:f);continue}N=!1}const A=y.length===0?"":y.length===1?y[0]:s(y).join(":"),k=v?A+lw:A,_=k+C;if(l.indexOf(_)>-1)continue;l.push(_);const T=i(C,N);for(let P=0;P<T.length;++P){const E=T[P];l.push(k+E)}f=m+(f.length>0?" "+f:f)}return f},FF=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=HM(n))&&(i&&(i+=" "),i+=r);return i},HM=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=HM(e[r]))&&(n&&(n+=" "),n+=t);return n},KF=(e,...t)=>{let n,r,i,s;const l=f=>{const h=t.reduce((m,g)=>g(m),e());return n=UF(h),r=n.cache.get,i=n.cache.set,s=c,c(f)},c=f=>{const h=r(f);if(h)return h;const m=qF(f,n);return i(f,m),m};return s=l,(...f)=>s(FF(...f))},HF=[],pn=e=>{const t=n=>n[e]||HF;return t.isThemeGetter=!0,t},GM=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,VM=/^\((?:(\w[\w-]*):)?(.+)\)$/i,GF=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,VF=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ZF=/\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$/,YF=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,WF=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,QF=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cs=e=>GF.test(e),Ge=e=>!!e&&!Number.isNaN(Number(e)),us=e=>!!e&&Number.isInteger(Number(e)),Q0=e=>e.endsWith("%")&&Ge(e.slice(0,-1)),ga=e=>VF.test(e),ZM=()=>!0,XF=e=>ZF.test(e)&&!YF.test(e),YS=()=>!1,JF=e=>WF.test(e),eK=e=>QF.test(e),tK=e=>!ke(e)&&!Ae(e),nK=e=>Is(e,QM,YS),ke=e=>GM.test(e),fo=e=>Is(e,XM,XF),oA=e=>Is(e,uK,Ge),rK=e=>Is(e,eR,ZM),iK=e=>Is(e,JM,YS),lA=e=>Is(e,YM,YS),aK=e=>Is(e,WM,eK),Gh=e=>Is(e,tR,JF),Ae=e=>VM.test(e),ed=e=>nl(e,XM),sK=e=>nl(e,JM),cA=e=>nl(e,YM),oK=e=>nl(e,QM),lK=e=>nl(e,WM),Vh=e=>nl(e,tR,!0),cK=e=>nl(e,eR,!0),Is=(e,t,n)=>{const r=GM.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},nl=(e,t,n=!1)=>{const r=VM.exec(e);return r?r[1]?t(r[1]):n:!1},YM=e=>e==="position"||e==="percentage",WM=e=>e==="image"||e==="url",QM=e=>e==="length"||e==="size"||e==="bg-size",XM=e=>e==="length",uK=e=>e==="number",JM=e=>e==="family-name",eR=e=>e==="number"||e==="weight",tR=e=>e==="shadow",dK=()=>{const e=pn("color"),t=pn("font"),n=pn("text"),r=pn("font-weight"),i=pn("tracking"),s=pn("leading"),l=pn("breakpoint"),c=pn("container"),f=pn("spacing"),h=pn("radius"),m=pn("shadow"),g=pn("inset-shadow"),y=pn("text-shadow"),v=pn("drop-shadow"),w=pn("blur"),S=pn("perspective"),N=pn("aspect"),C=pn("ease"),A=pn("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[..._(),Ae,ke],P=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto","contain","none"],z=()=>[Ae,ke,f],D=()=>[cs,"full","auto",...z()],F=()=>[us,"none","subgrid",Ae,ke],U=()=>["auto",{span:["full",us,Ae,ke]},us,Ae,ke],I=()=>[us,"auto",Ae,ke],ae=()=>["auto","min","max","fr",Ae,ke],ve=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],me=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...z()],re=()=>[cs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...z()],ge=()=>[cs,"screen","full","dvw","lvw","svw","min","max","fit",...z()],Se=()=>[cs,"screen","full","lh","dvh","lvh","svh","min","max","fit",...z()],B=()=>[e,Ae,ke],R=()=>[..._(),cA,lA,{position:[Ae,ke]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],oe=()=>["auto","cover","contain",oK,nK,{size:[Ae,ke]}],Q=()=>[Q0,ed,fo],X=()=>["","none","full",h,Ae,ke],W=()=>["",Ge,ed,fo],le=()=>["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=()=>[Ge,Q0,cA,lA],ce=()=>["","none",w,Ae,ke],be=()=>["none",Ge,Ae,ke],K=()=>["none",Ge,Ae,ke],Re=()=>[Ge,Ae,ke],Ee=()=>[cs,"full",...z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ga],breakpoint:[ga],color:[ZM],container:[ga],"drop-shadow":[ga],ease:["in","out","in-out"],font:[tK],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ga],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ga],shadow:[ga],spacing:["px",Ge],text:[ga],"text-shadow":[ga],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",cs,ke,Ae,N]}],container:["container"],columns:[{columns:[Ge,ke,Ae,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:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:D()}],"inset-x":[{"inset-x":D()}],"inset-y":[{"inset-y":D()}],start:[{"inset-s":D(),start:D()}],end:[{"inset-e":D(),end:D()}],"inset-bs":[{"inset-bs":D()}],"inset-be":[{"inset-be":D()}],top:[{top:D()}],right:[{right:D()}],bottom:[{bottom:D()}],left:[{left:D()}],visibility:["visible","invisible","collapse"],z:[{z:[us,"auto",Ae,ke]}],basis:[{basis:[cs,"full","auto",c,...z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ge,cs,"auto","initial","none",ke]}],grow:[{grow:["",Ge,Ae,ke]}],shrink:[{shrink:["",Ge,Ae,ke]}],order:[{order:[us,"first","last","none",Ae,ke]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"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:[...ve(),"normal"]}],"justify-items":[{"justify-items":[...me(),"normal"]}],"justify-self":[{"justify-self":["auto",...me()]}],"align-content":[{content:["normal",...ve()]}],"align-items":[{items:[...me(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...me(),{baseline:["","last"]}]}],"place-content":[{"place-content":ve()}],"place-items":[{"place-items":[...me(),"baseline"]}],"place-self":[{"place-self":["auto",...me()]}],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:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mbs:[{mbs:G()}],mbe:[{mbe:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"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",...ge()]}],"min-inline-size":[{"min-inline":["auto",...ge()]}],"max-inline-size":[{"max-inline":["none",...ge()]}],"block-size":[{block:["auto",...Se()]}],"min-block-size":[{"min-block":["auto",...Se()]}],"max-block-size":[{"max-block":["none",...Se()]}],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,ed,fo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,cK,rK]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Q0,ke]}],"font-family":[{font:[sK,iK,t]}],"font-features":[{"font-features":[ke]}],"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,Ae,ke]}],"line-clamp":[{"line-clamp":[Ge,"none",Ae,oA]}],leading:[{leading:[s,...z()]}],"list-image":[{"list-image":["none",Ae,ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ae,ke]}],"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:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ge,"from-font","auto",Ae,fo]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[Ge,"auto",Ae,ke]}],"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",Ae,ke]}],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",Ae,ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:R()}],"bg-repeat":[{bg:H()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},us,Ae,ke],radial:["",Ae,ke],conic:[us,Ae,ke]},lK,aK]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"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:W()}],"border-w-x":[{"border-x":W()}],"border-w-y":[{"border-y":W()}],"border-w-s":[{"border-s":W()}],"border-w-e":[{"border-e":W()}],"border-w-bs":[{"border-bs":W()}],"border-w-be":[{"border-be":W()}],"border-w-t":[{"border-t":W()}],"border-w-r":[{"border-r":W()}],"border-w-b":[{"border-b":W()}],"border-w-l":[{"border-l":W()}],"divide-x":[{"divide-x":W()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":W()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...le(),"hidden","none"]}],"divide-style":[{divide:[...le(),"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:[...le(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ge,Ae,ke]}],"outline-w":[{outline:["",Ge,ed,fo]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",m,Vh,Gh]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",g,Vh,Gh]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[Ge,fo]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":W()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",y,Vh,Gh]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[Ge,Ae,ke]}],"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":[Ge]}],"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":[Ae,ke]}],"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":_()}],"mask-image-conic-pos":[{"mask-conic":[Ge]}],"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:R()}],"mask-repeat":[{mask:H()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ae,ke]}],filter:[{filter:["","none",Ae,ke]}],blur:[{blur:ce()}],brightness:[{brightness:[Ge,Ae,ke]}],contrast:[{contrast:[Ge,Ae,ke]}],"drop-shadow":[{"drop-shadow":["","none",v,Vh,Gh]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",Ge,Ae,ke]}],"hue-rotate":[{"hue-rotate":[Ge,Ae,ke]}],invert:[{invert:["",Ge,Ae,ke]}],saturate:[{saturate:[Ge,Ae,ke]}],sepia:[{sepia:["",Ge,Ae,ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Ae,ke]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[Ge,Ae,ke]}],"backdrop-contrast":[{"backdrop-contrast":[Ge,Ae,ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ge,Ae,ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ge,Ae,ke]}],"backdrop-invert":[{"backdrop-invert":["",Ge,Ae,ke]}],"backdrop-opacity":[{"backdrop-opacity":[Ge,Ae,ke]}],"backdrop-saturate":[{"backdrop-saturate":[Ge,Ae,ke]}],"backdrop-sepia":[{"backdrop-sepia":["",Ge,Ae,ke]}],"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",Ae,ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ge,"initial",Ae,ke]}],ease:[{ease:["linear","initial",C,Ae,ke]}],delay:[{delay:[Ge,Ae,ke]}],animate:[{animate:["none",A,Ae,ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ae,ke]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:be()}],"rotate-x":[{"rotate-x":be()}],"rotate-y":[{"rotate-y":be()}],"rotate-z":[{"rotate-z":be()}],scale:[{scale:K()}],"scale-x":[{"scale-x":K()}],"scale-y":[{"scale-y":K()}],"scale-z":[{"scale-z":K()}],"scale-3d":["scale-3d"],skew:[{skew:Re()}],"skew-x":[{"skew-x":Re()}],"skew-y":[{"skew-y":Re()}],transform:[{transform:[Ae,ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ee()}],"translate-x":[{"translate-x":Ee()}],"translate-y":[{"translate-y":Ee()}],"translate-z":[{"translate-z":Ee()}],"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",Ae,ke]}],"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",Ae,ke]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[Ge,ed,fo,oA]}],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"]}},fK=KF(dK);function ti(...e){return fK(bt(e))}const hK=BM("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"}}),pe=x.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},s)=>{const l=r?vF:"button";return u.jsx(l,{ref:s,className:ti(hK({variant:t,size:n,className:e})),...i})});pe.displayName="Button";const pK=BM("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:ti(pK({variant:t}),e),...n})}function uA({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 Ad({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 nm(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function rR(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 mK(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 gK(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function yt({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 gg({status:e}){return u.jsx(yt,{tone:rR(e),children:hg(e)})}function Cs(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function yK(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 vK(e,t=[]){let n=[];function r(s,l){const c=x.createContext(l),f=n.length;n=[...n,l];const h=g=>{const{scope:y,children:v,...w}=g,S=y?.[e]?.[f]||c,N=x.useMemo(()=>w,Object.values(w));return u.jsx(S.Provider,{value:N,children:v})};h.displayName=s+"Provider";function m(g,y){const v=y?.[e]?.[f]||c,w=x.useContext(v);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${g}\` must be used within \`${s}\``)}return[h,m]}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,bK(i,...t)]}function bK(...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 Ed=globalThis?.document?x.useLayoutEffect:()=>{},xK=rg[" useId ".trim().toString()]||(()=>{}),wK=0;function X0(e){const[t,n]=x.useState(xK());return Ed(()=>{n(r=>r??String(wK++))},[e]),e||(t?`radix-${t}`:"")}var SK=rg[" useInsertionEffect ".trim().toString()]||Ed;function jK({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,s,l]=NK({defaultProp:t,onChange:n}),c=e!==void 0,f=c?e:i;{const m=x.useRef(e!==void 0);x.useEffect(()=>{const g=m.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.`),m.current=c},[c,r])}const h=x.useCallback(m=>{if(c){const g=CK(m)?m(e):m;g!==e&&l.current?.(g)}else s(m)},[c,e,s,l]);return[f,h]}function NK({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),i=x.useRef(n),s=x.useRef(t);return SK(()=>{s.current=t},[t]),x.useEffect(()=>{i.current!==n&&(s.current?.(n),i.current=n)},[n,i]),[n,r,s]}function CK(e){return typeof e=="function"}function iR(e){const t=_K(e),n=x.forwardRef((r,i)=>{const{children:s,...l}=r,c=x.Children.toArray(s),f=c.find(kK);if(f){const h=f.props.children,m=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,m):null})}return u.jsx(t,{...l,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}function _K(e){const t=x.forwardRef((n,r)=>{const{children:i,...s}=n;if(x.isValidElement(i)){const l=EK(i),c=AK(s,i.props);return i.type!==x.Fragment&&(c.ref=r?VS(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 OK=Symbol("radix.slottable");function kK(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===OK}function AK(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 EK(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 TK=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Aa=TK.reduce((e,t)=>{const n=iR(`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 PK(e,t){e&&el.flushSync(()=>e.dispatchEvent(t))}function Td(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>t.current?.(...n),[])}function zK(e,t=globalThis?.document){const n=Td(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 MK="DismissableLayer",cw="dismissableLayer.update",RK="dismissableLayer.pointerDownOutside",DK="dismissableLayer.focusOutside",dA,aR=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),sR=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...f}=e,h=x.useContext(aR),[m,g]=x.useState(null),y=m?.ownerDocument??globalThis?.document,[,v]=x.useState({}),w=tl(t,E=>g(E)),S=Array.from(h.layers),[N]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=S.indexOf(N),A=m?S.indexOf(m):-1,k=h.layersWithOutsidePointerEventsDisabled.size>0,_=A>=C,T=$K(E=>{const z=E.target,D=[...h.branches].some(F=>F.contains(z));!_||D||(i?.(E),l?.(E),E.defaultPrevented||c?.())},y),P=UK(E=>{const z=E.target;[...h.branches].some(F=>F.contains(z))||(s?.(E),l?.(E),E.defaultPrevented||c?.())},y);return zK(E=>{A===h.layers.size-1&&(r?.(E),!E.defaultPrevented&&c&&(E.preventDefault(),c()))},y),x.useEffect(()=>{if(m)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(dA=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(m)),h.layers.add(m),fA(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=dA)}},[m,y,n,h]),x.useEffect(()=>()=>{m&&(h.layers.delete(m),h.layersWithOutsidePointerEventsDisabled.delete(m),fA())},[m,h]),x.useEffect(()=>{const E=()=>v({});return document.addEventListener(cw,E),()=>document.removeEventListener(cw,E)},[]),u.jsx(Aa.div,{...f,ref:w,style:{pointerEvents:k?_?"auto":"none":void 0,...e.style},onFocusCapture:Cs(e.onFocusCapture,P.onFocusCapture),onBlurCapture:Cs(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:Cs(e.onPointerDownCapture,T.onPointerDownCapture)})});sR.displayName=MK;var LK="DismissableLayerBranch",IK=x.forwardRef((e,t)=>{const n=x.useContext(aR),r=x.useRef(null),i=tl(t,r);return x.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),u.jsx(Aa.div,{...e,ref:i})});IK.displayName=LK;function $K(e,t=globalThis?.document){const n=Td(e),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const s=c=>{if(c.target&&!r.current){let f=function(){oR(RK,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 UK(e,t=globalThis?.document){const n=Td(e),r=x.useRef(!1);return x.useEffect(()=>{const i=s=>{s.target&&!r.current&&oR(DK,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 fA(){const e=new CustomEvent(cw);document.dispatchEvent(e)}function oR(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?PK(i,s):i.dispatchEvent(s)}var J0="focusScope.autoFocusOnMount",eb="focusScope.autoFocusOnUnmount",hA={bubbles:!1,cancelable:!0},BK="FocusScope",lR=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...l}=e,[c,f]=x.useState(null),h=Td(i),m=Td(s),g=x.useRef(null),y=tl(t,S=>f(S)),v=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let S=function(k){if(v.paused||!c)return;const _=k.target;c.contains(_)?g.current=_:hs(g.current,{select:!0})},N=function(k){if(v.paused||!c)return;const _=k.relatedTarget;_!==null&&(c.contains(_)||hs(g.current,{select:!0}))},C=function(k){if(document.activeElement===document.body)for(const T of k)T.removedNodes.length>0&&hs(c)};document.addEventListener("focusin",S),document.addEventListener("focusout",N);const A=new MutationObserver(C);return c&&A.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",N),A.disconnect()}}},[r,c,v.paused]),x.useEffect(()=>{if(c){mA.add(v);const S=document.activeElement;if(!c.contains(S)){const C=new CustomEvent(J0,hA);c.addEventListener(J0,h),c.dispatchEvent(C),C.defaultPrevented||(qK(VK(cR(c)),{select:!0}),document.activeElement===S&&hs(c))}return()=>{c.removeEventListener(J0,h),setTimeout(()=>{const C=new CustomEvent(eb,hA);c.addEventListener(eb,m),c.dispatchEvent(C),C.defaultPrevented||hs(S??document.body,{select:!0}),c.removeEventListener(eb,m),mA.remove(v)},0)}}},[c,h,m,v]);const w=x.useCallback(S=>{if(!n&&!r||v.paused)return;const N=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,C=document.activeElement;if(N&&C){const A=S.currentTarget,[k,_]=FK(A);k&&_?!S.shiftKey&&C===_?(S.preventDefault(),n&&hs(k,{select:!0})):S.shiftKey&&C===k&&(S.preventDefault(),n&&hs(_,{select:!0})):C===A&&S.preventDefault()}},[n,r,v.paused]);return u.jsx(Aa.div,{tabIndex:-1,...l,ref:y,onKeyDown:w})});lR.displayName=BK;function qK(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(hs(r,{select:t}),document.activeElement!==n)return}function FK(e){const t=cR(e),n=pA(t,e),r=pA(t.reverse(),e);return[n,r]}function cR(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 pA(e,t){for(const n of e)if(!KK(n,{upTo:t}))return n}function KK(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 HK(e){return e instanceof HTMLInputElement&&"select"in e}function hs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&HK(e)&&t&&e.select()}}var mA=GK();function GK(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=gA(e,t),e.unshift(t)},remove(t){e=gA(e,t),e[0]?.resume()}}}function gA(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function VK(e){return e.filter(t=>t.tagName!=="A")}var ZK="Portal",uR=x.forwardRef((e,t)=>{const{container:n,...r}=e,[i,s]=x.useState(!1);Ed(()=>s(!0),[]);const l=n||i&&globalThis?.document?.body;return l?K8.createPortal(u.jsx(Aa.div,{...r,ref:t}),l):null});uR.displayName=ZK;function YK(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var yg=e=>{const{present:t,children:n}=e,r=WK(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),s=tl(r.ref,QK(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:s}):null};yg.displayName="Presence";function WK(e){const[t,n]=x.useState(),r=x.useRef(null),i=x.useRef(e),s=x.useRef("none"),l=e?"mounted":"unmounted",[c,f]=YK(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const h=Zh(r.current);s.current=c==="mounted"?h:"none"},[c]),Ed(()=>{const h=r.current,m=i.current;if(m!==e){const y=s.current,v=Zh(h);e?f("MOUNT"):v==="none"||h?.display==="none"?f("UNMOUNT"):f(m&&y!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,f]),Ed(()=>{if(t){let h;const m=t.ownerDocument.defaultView??window,g=v=>{const S=Zh(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&S&&(f("ANIMATION_END"),!i.current)){const N=t.style.animationFillMode;t.style.animationFillMode="forwards",h=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=N)})}},y=v=>{v.target===t&&(s.current=Zh(r.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{m.clearTimeout(h),t.removeEventListener("animationstart",y),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 Zh(e){return e?.animationName||"none"}function QK(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 tb=0;function XK(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??yA()),document.body.insertAdjacentElement("beforeend",e[1]??yA()),tb++,()=>{tb===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),tb--}},[])}function yA(){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 Di=function(){return Di=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},Di.apply(this,arguments)};function dR(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 JK(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 Tp="right-scroll-bar-position",Pp="width-before-scroll-bar",eH="with-scroll-bars-hidden",tH="--removed-body-scroll-bar-size";function nb(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function nH(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 rH=typeof window<"u"?x.useLayoutEffect:x.useEffect,vA=new WeakMap;function iH(e,t){var n=nH(null,function(r){return e.forEach(function(i){return nb(i,r)})});return rH(function(){var r=vA.get(n);if(r){var i=new Set(r),s=new Set(e),l=n.current;i.forEach(function(c){s.has(c)||nb(c,null)}),s.forEach(function(c){i.has(c)||nb(c,l)})}vA.set(n,e)},[e]),n}function aH(e){return e}function sH(e,t){t===void 0&&(t=aH);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 m=l;l=[],m.forEach(s)},h=function(){return Promise.resolve().then(f)};h(),n={push:function(m){l.push(m),h()},filter:function(m){return l=l.filter(m),n}}}};return i}function oH(e){e===void 0&&(e={});var t=sH(null);return t.options=Di({async:!0,ssr:!1},e),t}var fR=function(e){var t=e.sideCar,n=dR(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,Di({},n))};fR.isSideCarExport=!0;function lH(e,t){return e.useMedium(t),fR}var hR=oH(),rb=function(){},vg=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:rb,onWheelCapture:rb,onTouchMoveCapture:rb}),i=r[0],s=r[1],l=e.forwardProps,c=e.children,f=e.className,h=e.removeScrollBar,m=e.enabled,g=e.shards,y=e.sideCar,v=e.noRelative,w=e.noIsolation,S=e.inert,N=e.allowPinchZoom,C=e.as,A=C===void 0?"div":C,k=e.gapMode,_=dR(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=y,P=iH([n,t]),E=Di(Di({},_),i);return x.createElement(x.Fragment,null,m&&x.createElement(T,{sideCar:hR,removeScrollBar:h,shards:g,noRelative:v,noIsolation:w,inert:S,setCallbacks:s,allowPinchZoom:!!N,lockRef:n,gapMode:k}),l?x.cloneElement(x.Children.only(c),Di(Di({},E),{ref:P})):x.createElement(A,Di({},E,{className:f,ref:P}),c))});vg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};vg.classNames={fullWidth:Pp,zeroRight:Tp};var cH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function uH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=cH();return t&&e.setAttribute("nonce",t),e}function dH(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function fH(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var hH=function(){var e=0,t=null;return{add:function(n){e==0&&(t=uH())&&(dH(t,n),fH(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},pH=function(){var e=hH();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},pR=function(){var e=pH(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},mH={left:0,top:0,right:0,gap:0},ib=function(e){return parseInt(e||"",10)||0},gH=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[ib(n),ib(r),ib(i)]},yH=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return mH;var t=gH(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])}},vH=pR(),bc="data-scroll-locked",bH=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(eH,` {
14
+ overflow: hidden `).concat(r,`;
15
+ padding-right: `).concat(c,"px ").concat(r,`;
16
+ }
17
+ body[`).concat(bc,`] {
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(Tp,` {
31
+ right: `).concat(c,"px ").concat(r,`;
32
+ }
33
+
34
+ .`).concat(Pp,` {
35
+ margin-right: `).concat(c,"px ").concat(r,`;
36
+ }
37
+
38
+ .`).concat(Tp," .").concat(Tp,` {
39
+ right: 0 `).concat(r,`;
40
+ }
41
+
42
+ .`).concat(Pp," .").concat(Pp,` {
43
+ margin-right: 0 `).concat(r,`;
44
+ }
45
+
46
+ body[`).concat(bc,`] {
47
+ `).concat(tH,": ").concat(c,`px;
48
+ }
49
+ `)},bA=function(){var e=parseInt(document.body.getAttribute(bc)||"0",10);return isFinite(e)?e:0},xH=function(){x.useEffect(function(){return document.body.setAttribute(bc,(bA()+1).toString()),function(){var e=bA()-1;e<=0?document.body.removeAttribute(bc):document.body.setAttribute(bc,e.toString())}},[])},wH=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;xH();var s=x.useMemo(function(){return yH(i)},[i]);return x.createElement(vH,{styles:bH(s,!t,i,n?"":"!important")})},uw=!1;if(typeof window<"u")try{var Yh=Object.defineProperty({},"passive",{get:function(){return uw=!0,!0}});window.addEventListener("test",Yh,Yh),window.removeEventListener("test",Yh,Yh)}catch{uw=!1}var Wl=uw?{passive:!1}:!1,SH=function(e){return e.tagName==="TEXTAREA"},mR=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!SH(e)&&n[t]==="visible")},jH=function(e){return mR(e,"overflowY")},NH=function(e){return mR(e,"overflowX")},xA=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=gR(e,r);if(i){var s=yR(e,r),l=s[1],c=s[2];if(l>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},CH=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},_H=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},gR=function(e,t){return e==="v"?jH(t):NH(t)},yR=function(e,t){return e==="v"?CH(t):_H(t)},OH=function(e,t){return e==="h"&&t==="rtl"?-1:1},kH=function(e,t,n,r,i){var s=OH(e,window.getComputedStyle(t).direction),l=s*r,c=n.target,f=t.contains(c),h=!1,m=l>0,g=0,y=0;do{if(!c)break;var v=yR(e,c),w=v[0],S=v[1],N=v[2],C=S-N-s*w;(w||C)&&gR(e,c)&&(g+=C,y+=w);var A=c.parentNode;c=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!f&&c!==document.body||f&&(t.contains(c)||t===c));return(m&&Math.abs(g)<1||!m&&Math.abs(y)<1)&&(h=!0),h},Wh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},wA=function(e){return[e.deltaX,e.deltaY]},SA=function(e){return e&&"current"in e?e.current:e},AH=function(e,t){return e[0]===t[0]&&e[1]===t[1]},EH=function(e){return`
50
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
51
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
52
+ `)},TH=0,Ql=[];function PH(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(TH++)[0],s=x.useState(pR)[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=JK([e.lockRef.current],(e.shards||[]).map(SA),!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=Wh(S),A=n.current,k="deltaX"in S?S.deltaX:A[0]-C[0],_="deltaY"in S?S.deltaY:A[1]-C[1],T,P=S.target,E=Math.abs(k)>Math.abs(_)?"h":"v";if("touches"in S&&E==="h"&&P.type==="range")return!1;var z=window.getSelection(),D=z&&z.anchorNode,F=D?D===P||D.contains(P):!1;if(F)return!1;var U=xA(E,P);if(!U)return!0;if(U?T=E:(T=E==="v"?"h":"v",U=xA(E,P)),!U)return!1;if(!r.current&&"changedTouches"in S&&(k||_)&&(r.current=T),!T)return!0;var I=r.current||T;return kH(I,N,S,I==="h"?k:_)},[]),f=x.useCallback(function(S){var N=S;if(!(!Ql.length||Ql[Ql.length-1]!==s)){var C="deltaY"in N?wA(N):Wh(N),A=t.current.filter(function(T){return T.name===N.type&&(T.target===N.target||N.target===T.shadowParent)&&AH(T.delta,C)})[0];if(A&&A.should){N.cancelable&&N.preventDefault();return}if(!A){var k=(l.current.shards||[]).map(SA).filter(Boolean).filter(function(T){return T.contains(N.target)}),_=k.length>0?c(N,k[0]):!l.current.noIsolation;_&&N.cancelable&&N.preventDefault()}}},[]),h=x.useCallback(function(S,N,C,A){var k={name:S,delta:N,target:C,should:A,shadowParent:zH(C)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(_){return _!==k})},1)},[]),m=x.useCallback(function(S){n.current=Wh(S),r.current=void 0},[]),g=x.useCallback(function(S){h(S.type,wA(S),S.target,c(S,e.lockRef.current))},[]),y=x.useCallback(function(S){h(S.type,Wh(S),S.target,c(S,e.lockRef.current))},[]);x.useEffect(function(){return Ql.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:y}),document.addEventListener("wheel",f,Wl),document.addEventListener("touchmove",f,Wl),document.addEventListener("touchstart",m,Wl),function(){Ql=Ql.filter(function(S){return S!==s}),document.removeEventListener("wheel",f,Wl),document.removeEventListener("touchmove",f,Wl),document.removeEventListener("touchstart",m,Wl)}},[]);var v=e.removeScrollBar,w=e.inert;return x.createElement(x.Fragment,null,w?x.createElement(s,{styles:EH(i)}):null,v?x.createElement(wH,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function zH(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const MH=lH(hR,PH);var vR=x.forwardRef(function(e,t){return x.createElement(vg,Di({},e,{ref:t,sideCar:MH}))});vR.classNames=vg.classNames;var RH=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Xl=new WeakMap,Qh=new WeakMap,Xh={},ab=0,bR=function(e){return e&&(e.host||bR(e.parentNode))},DH=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})},LH=function(e,t,n,r){var i=DH(t,Array.isArray(e)?e:[e]);Xh[n]||(Xh[n]=new WeakMap);var s=Xh[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 m=function(g){!g||f.has(g)||Array.prototype.forEach.call(g.children,function(y){if(c.has(y))m(y);else try{var v=y.getAttribute(r),w=v!==null&&v!=="false",S=(Xl.get(y)||0)+1,N=(s.get(y)||0)+1;Xl.set(y,S),s.set(y,N),l.push(y),S===1&&w&&Qh.set(y,!0),N===1&&y.setAttribute(n,"true"),w||y.setAttribute(r,"true")}catch(C){console.error("aria-hidden: cannot operate on ",y,C)}})};return m(t),c.clear(),ab++,function(){l.forEach(function(g){var y=Xl.get(g)-1,v=s.get(g)-1;Xl.set(g,y),s.set(g,v),y||(Qh.has(g)||g.removeAttribute(r),Qh.delete(g)),v||g.removeAttribute(n)}),ab--,ab||(Xl=new WeakMap,Xl=new WeakMap,Qh=new WeakMap,Xh={})}},IH=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=RH(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),LH(r,i,n,"aria-hidden")):function(){return null}},bg="Dialog",[xR]=vK(bg),[$H,bi]=xR(bg),wR=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,m]=jK({prop:r,defaultProp:i??!1,onChange:s,caller:bg});return u.jsx($H,{scope:t,triggerRef:c,contentRef:f,contentId:X0(),titleId:X0(),descriptionId:X0(),open:h,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(g=>!g),[m]),modal:l,children:n})};wR.displayName=bg;var SR="DialogTrigger",UH=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=bi(SR,n),s=tl(t,i.triggerRef);return u.jsx(Aa.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":XS(i.open),...r,ref:s,onClick:Cs(e.onClick,i.onOpenToggle)})});UH.displayName=SR;var WS="DialogPortal",[BH,jR]=xR(WS,{forceMount:void 0}),NR=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,s=bi(WS,t);return u.jsx(BH,{scope:t,forceMount:n,children:x.Children.map(r,l=>u.jsx(yg,{present:n||s.open,children:u.jsx(uR,{asChild:!0,container:i,children:l})}))})};NR.displayName=WS;var rm="DialogOverlay",CR=x.forwardRef((e,t)=>{const n=jR(rm,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=bi(rm,e.__scopeDialog);return s.modal?u.jsx(yg,{present:r||s.open,children:u.jsx(FH,{...i,ref:t})}):null});CR.displayName=rm;var qH=iR("DialogOverlay.RemoveScroll"),FH=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=bi(rm,n);return u.jsx(vR,{as:qH,allowPinchZoom:!0,shards:[i.contentRef],children:u.jsx(Aa.div,{"data-state":XS(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Fo="DialogContent",_R=x.forwardRef((e,t)=>{const n=jR(Fo,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=bi(Fo,e.__scopeDialog);return u.jsx(yg,{present:r||s.open,children:s.modal?u.jsx(KH,{...i,ref:t}):u.jsx(HH,{...i,ref:t})})});_R.displayName=Fo;var KH=x.forwardRef((e,t)=>{const n=bi(Fo,e.__scopeDialog),r=x.useRef(null),i=tl(t,n.contentRef,r);return x.useEffect(()=>{const s=r.current;if(s)return IH(s)},[]),u.jsx(OR,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Cs(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Cs(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&s.preventDefault()}),onFocusOutside:Cs(e.onFocusOutside,s=>s.preventDefault())})}),HH=x.forwardRef((e,t)=>{const n=bi(Fo,e.__scopeDialog),r=x.useRef(!1),i=x.useRef(!1);return u.jsx(OR,{...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()}})}),OR=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...l}=e,c=bi(Fo,n),f=x.useRef(null),h=tl(t,f);return XK(),u.jsxs(u.Fragment,{children:[u.jsx(lR,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:u.jsx(sR,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":XS(c.open),...l,ref:h,onDismiss:()=>c.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(GH,{titleId:c.titleId}),u.jsx(ZH,{contentRef:f,descriptionId:c.descriptionId})]})]})}),QS="DialogTitle",kR=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=bi(QS,n);return u.jsx(Aa.h2,{id:i.titleId,...r,ref:t})});kR.displayName=QS;var AR="DialogDescription",ER=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=bi(AR,n);return u.jsx(Aa.p,{id:i.descriptionId,...r,ref:t})});ER.displayName=AR;var TR="DialogClose",PR=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=bi(TR,n);return u.jsx(Aa.button,{type:"button",...r,ref:t,onClick:Cs(e.onClick,()=>i.onOpenChange(!1))})});PR.displayName=TR;function XS(e){return e?"open":"closed"}var zR="DialogTitleWarning",[fye,MR]=yK(zR,{contentName:Fo,titleName:QS,docsSlug:"dialog"}),GH=({titleId:e})=>{const t=MR(zR),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},VH="DialogDescriptionWarning",ZH=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${MR(VH).contentName}}.`;return x.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},RR=wR,DR=NR,JS=CR,e1=_R,t1=kR,LR=ER,IR=PR;const YH=RR,WH=DR,$R=x.forwardRef(({className:e,...t},n)=>u.jsx(JS,{ref:n,className:ti("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));$R.displayName=JS.displayName;const QH=400,XH=1200,JH=720,UR=x.forwardRef(({className:e,children:t,...n},r)=>{const[i,s]=x.useState(JH),l=x.useRef(!1),c=x.useRef(0),f=x.useRef(0),h=x.useCallback(y=>{l.current=!0,c.current=y.clientX,f.current=i,y.target.setPointerCapture(y.pointerId),y.preventDefault()},[i]),m=x.useCallback(y=>{if(!l.current)return;const v=c.current-y.clientX,w=Math.min(XH,Math.max(QH,f.current+v));s(w)},[]),g=x.useCallback(()=>{l.current=!1},[]);return u.jsxs(WH,{children:[u.jsx($R,{}),u.jsxs(e1,{ref:r,className:ti("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:m,onPointerUp:g}),t,u.jsxs(IR,{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(fg,{className:"size-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});UR.displayName=e1.displayName;const e7=({className:e,...t})=>u.jsx("div",{className:ti("flex flex-col gap-1.5 pr-10",e),...t}),BR=x.forwardRef(({className:e,...t},n)=>u.jsx(t1,{ref:n,className:ti("text-lg font-medium text-zinc-50",e),...t}));BR.displayName=t1.displayName;const qR=x.forwardRef(({className:e,...t},n)=>u.jsx(LR,{ref:n,className:ti("text-sm text-zinc-500",e),...t}));qR.displayName=LR.displayName;function t7({title:e,subtitle:t,children:n,open:r,onClose:i}){return u.jsx(YH,{open:r,onOpenChange:s=>s?void 0:i(),children:u.jsxs(UR,{children:[u.jsxs(e7,{className:"drawer-head",children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),u.jsx(BR,{id:"drawer-title",children:e}),u.jsx(qR,{className:"sr-only",children:t})]}),u.jsx("div",{className:"drawer-body",children:n})]})})}function de(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,m=Object.keys(h);for(let g=0;g<m.length;g++){const y=m[g];y in c||(c[y]=h[y].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 m of h._zod.deferred)m();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 xc extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class FR extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const KR={};function Es(e){return KR}function HR(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 dw(e,t){return typeof t=="bigint"?t.toString():t}function n1(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function r1(e){return e==null}function i1(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function n7(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 jA=Symbol("evaluating");function vt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==jA)return r===void 0&&(r=jA,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function rl(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function $s(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function NA(e){return JSON.stringify(e)}function r7(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const GR="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function im(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const i7=n1(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function kc(e){if(im(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(im(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function VR(e){return kc(e)?{...e}:Array.isArray(e)?[...e]:e}const a7=new Set(["string","number","symbol"]);function Ac(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Us(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Me(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 s7(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const o7={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 l7(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=$s(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 rl(this,"shape",l),l},checks:[]});return Us(e,s)}function c7(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=$s(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 rl(this,"shape",l),l},checks:[]});return Us(e,s)}function u7(e,t){if(!kc(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=$s(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return rl(this,"shape",s),s}});return Us(e,i)}function d7(e,t){if(!kc(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=$s(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return rl(this,"shape",r),r}});return Us(e,n)}function f7(e,t){const n=$s(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return rl(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Us(e,n)}function h7(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=$s(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 rl(this,"shape",f),f},checks:[]});return Us(t,l)}function p7(e,t,n){const r=$s(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 rl(this,"shape",s),s}});return Us(t,r)}function dc(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 fc(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Jh(e){return typeof e=="string"?e:e?.message}function Ts(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=Jh(e.inst?._zod.def?.error?.(e))??Jh(t?.error?.(e))??Jh(n.customError?.(e))??Jh(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function a1(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Pd(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const ZR=(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,dw,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},YR=de("$ZodError",ZR),WR=de("$ZodError",ZR,{Parent:Error});function m7(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 g7(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 s1=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 xc;if(l.issues.length){const c=new(i?.Err??e)(l.issues.map(f=>Ts(f,s,Es())));throw GR(c,i?.callee),c}return l.value},o1=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=>Ts(f,s,Es())));throw GR(c,i?.callee),c}return l.value},xg=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 xc;return s.issues.length?{success:!1,error:new(e??YR)(s.issues.map(l=>Ts(l,i,Es())))}:{success:!0,data:s.value}},y7=xg(WR),wg=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=>Ts(l,i,Es())))}:{success:!0,data:s.value}},v7=wg(WR),b7=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return s1(e)(t,n,i)},x7=e=>(t,n,r)=>s1(e)(t,n,r),w7=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return o1(e)(t,n,i)},S7=e=>async(t,n,r)=>o1(e)(t,n,r),j7=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return xg(e)(t,n,i)},N7=e=>(t,n,r)=>xg(e)(t,n,r),C7=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return wg(e)(t,n,i)},_7=e=>async(t,n,r)=>wg(e)(t,n,r),O7=/^[cC][^\s-]{8,}$/,k7=/^[0-9a-z]+$/,A7=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,E7=/^[0-9a-vA-V]{20}$/,T7=/^[A-Za-z0-9]{27}$/,P7=/^[a-zA-Z0-9_-]{21}$/,z7=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,M7=/^([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})$/,CA=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)$/,R7=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,D7="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function L7(){return new RegExp(D7,"u")}const I7=/^(?:(?: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])$/,$7=/^(([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}|:))$/,U7=/^((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])$/,B7=/^(([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])$/,q7=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,QR=/^[A-Za-z0-9_-]*$/,F7=/^\+[1-9]\d{6,14}$/,XR="(?:(?:\\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])))",K7=new RegExp(`^${XR}$`);function JR(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 H7(e){return new RegExp(`^${JR(e)}$`)}function G7(e){const t=JR({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(`^${XR}T(?:${r})$`)}const V7=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Z7=/^-?\d+$/,eD=/^-?\d+(?:\.\d+)?$/,Y7=/^(?:true|false)$/i,W7=/^[^A-Z]*$/,Q7=/^[^a-z]*$/,hr=de("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),tD={number:"number",bigint:"bigint",object:"date"},nD=de("$ZodCheckLessThan",(e,t)=>{hr.init(e,t);const n=tD[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})}}),rD=de("$ZodCheckGreaterThan",(e,t)=>{hr.init(e,t);const n=tD[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})}}),X7=de("$ZodCheckMultipleOf",(e,t)=>{hr.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):n7(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})}}),J7=de("$ZodCheckNumberFormat",(e,t)=>{hr.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,s]=o7[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=Z7)}),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})}}),eG=de("$ZodCheckMaxLength",(e,t)=>{var n;hr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!r1(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=a1(i);r.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),tG=de("$ZodCheckMinLength",(e,t)=>{var n;hr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!r1(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=a1(i);r.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),nG=de("$ZodCheckLengthEquals",(e,t)=>{var n;hr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!r1(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=a1(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})}}),Sg=de("$ZodCheckStringFormat",(e,t)=>{var n,r;hr.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=()=>{})}),rG=de("$ZodCheckRegex",(e,t)=>{Sg.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})}}),iG=de("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=W7),Sg.init(e,t)}),aG=de("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Q7),Sg.init(e,t)}),sG=de("$ZodCheckIncludes",(e,t)=>{hr.init(e,t);const n=Ac(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})}}),oG=de("$ZodCheckStartsWith",(e,t)=>{hr.init(e,t);const n=new RegExp(`^${Ac(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})}}),lG=de("$ZodCheckEndsWith",(e,t)=>{hr.init(e,t);const n=new RegExp(`.*${Ac(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})}}),cG=de("$ZodCheckOverwrite",(e,t)=>{hr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class uG{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 dG={major:4,minor:3,patch:6},Ft=de("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=dG;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=dc(l),m;for(const g of c){if(g._zod.def.when){if(!g._zod.def.when(l))continue}else if(h)continue;const y=l.issues.length,v=g._zod.check(l);if(v instanceof Promise&&f?.async===!1)throw new xc;if(m||v instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await v,l.issues.length!==y&&(h||(h=dc(l,y)))});else{if(l.issues.length===y)continue;h||(h=dc(l,y))}}return m?m.then(()=>l):l},s=(l,c,f)=>{if(dc(l))return l.aborted=!0,l;const h=i(c,r,f);if(h instanceof Promise){if(f.async===!1)throw new xc;return h.then(m=>e._zod.parse(m,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(m=>s(m,l,c)):s(h,l,c)}const f=e._zod.parse(l,c);if(f instanceof Promise){if(c.async===!1)throw new xc;return f.then(h=>i(h,r,c))}return i(f,r,c)}}vt(e,"~standard",()=>({validate:i=>{try{const s=y7(e,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return v7(e,i).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),l1=de("$ZodString",(e,t)=>{Ft.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??V7(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}}),$t=de("$ZodStringFormat",(e,t)=>{Sg.init(e,t),l1.init(e,t)}),fG=de("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=M7),$t.init(e,t)}),hG=de("$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=CA(r))}else t.pattern??(t.pattern=CA());$t.init(e,t)}),pG=de("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=R7),$t.init(e,t)}),mG=de("$ZodURL",(e,t)=>{$t.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})}}}),gG=de("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=L7()),$t.init(e,t)}),yG=de("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=P7),$t.init(e,t)}),vG=de("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=O7),$t.init(e,t)}),bG=de("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=k7),$t.init(e,t)}),xG=de("$ZodULID",(e,t)=>{t.pattern??(t.pattern=A7),$t.init(e,t)}),wG=de("$ZodXID",(e,t)=>{t.pattern??(t.pattern=E7),$t.init(e,t)}),SG=de("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=T7),$t.init(e,t)}),jG=de("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=G7(t)),$t.init(e,t)}),NG=de("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=K7),$t.init(e,t)}),CG=de("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=H7(t)),$t.init(e,t)}),_G=de("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=z7),$t.init(e,t)}),OG=de("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=I7),$t.init(e,t),e._zod.bag.format="ipv4"}),kG=de("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=$7),$t.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})}}}),AG=de("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=U7),$t.init(e,t)}),EG=de("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=B7),$t.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 iD(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const TG=de("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=q7),$t.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{iD(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function PG(e){if(!QR.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return iD(n)}const zG=de("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=QR),$t.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{PG(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),MG=de("$ZodE164",(e,t)=>{t.pattern??(t.pattern=F7),$t.init(e,t)});function RG(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 DG=de("$ZodJWT",(e,t)=>{$t.init(e,t),e._zod.check=n=>{RG(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),aD=de("$ZodNumber",(e,t)=>{Ft.init(e,t),e._zod.pattern=e._zod.bag.pattern??eD,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}}),LG=de("$ZodNumberFormat",(e,t)=>{J7.init(e,t),aD.init(e,t)}),IG=de("$ZodBoolean",(e,t)=>{Ft.init(e,t),e._zod.pattern=Y7,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}}),$G=de("$ZodUnknown",(e,t)=>{Ft.init(e,t),e._zod.parse=n=>n}),UG=de("$ZodNever",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function _A(e,t,n){e.issues.length&&t.issues.push(...fc(n,e.issues)),t.value[n]=e.value}const BG=de("$ZodArray",(e,t)=>{Ft.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=>_A(h,n,l))):_A(f,n,l)}return s.length?Promise.all(s).then(()=>n):n}});function am(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...fc(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function sD(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=s7(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function oD(e,t,n,r,i,s){const l=[],c=i.keySet,f=i.catchall._zod,h=f.def.type,m=f.optout==="optional";for(const g in t){if(c.has(g))continue;if(h==="never"){l.push(g);continue}const y=f.run({value:t[g],issues:[]},r);y instanceof Promise?e.push(y.then(v=>am(v,n,g,t,m))):am(y,n,g,t,m)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const qG=de("$ZodObject",(e,t)=>{if(Ft.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=n1(()=>sD(t));vt(e._zod,"propValues",()=>{const c=t.shape,f={};for(const h in c){const m=c[h]._zod;if(m.values){f[h]??(f[h]=new Set);for(const g of m.values)f[h].add(g)}}return f});const i=im,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 m=[],g=l.shape;for(const y of l.keys){const v=g[y],w=v._zod.optout==="optional",S=v._zod.run({value:h[y],issues:[]},f);S instanceof Promise?m.push(S.then(N=>am(N,c,y,h,w))):am(S,c,y,h,w)}return s?oD(m,h,c,f,r.value,e):m.length?Promise.all(m).then(()=>c):c}}),FG=de("$ZodObjectJIT",(e,t)=>{qG.init(e,t);const n=e._zod.parse,r=n1(()=>sD(t)),i=y=>{const v=new uG(["shape","payload","ctx"]),w=r.value,S=k=>{const _=NA(k);return`shape[${_}]._zod.run({ value: input[${_}], issues: [] }, ctx)`};v.write("const input = payload.value;");const N=Object.create(null);let C=0;for(const k of w.keys)N[k]=`key_${C++}`;v.write("const newResult = {};");for(const k of w.keys){const _=N[k],T=NA(k),E=y[k]?._zod?.optout==="optional";v.write(`const ${_} = ${S(k)};`),E?v.write(`
59
+ if (${_}.issues.length) {
60
+ if (${T} in input) {
61
+ payload.issues = payload.issues.concat(${_}.issues.map(iss => ({
62
+ ...iss,
63
+ path: iss.path ? [${T}, ...iss.path] : [${T}]
64
+ })));
65
+ }
66
+ }
67
+
68
+ if (${_}.value === undefined) {
69
+ if (${T} in input) {
70
+ newResult[${T}] = undefined;
71
+ }
72
+ } else {
73
+ newResult[${T}] = ${_}.value;
74
+ }
75
+
76
+ `):v.write(`
77
+ if (${_}.issues.length) {
78
+ payload.issues = payload.issues.concat(${_}.issues.map(iss => ({
79
+ ...iss,
80
+ path: iss.path ? [${T}, ...iss.path] : [${T}]
81
+ })));
82
+ }
83
+
84
+ if (${_}.value === undefined) {
85
+ if (${T} in input) {
86
+ newResult[${T}] = undefined;
87
+ }
88
+ } else {
89
+ newResult[${T}] = ${_}.value;
90
+ }
91
+
92
+ `)}v.write("payload.value = newResult;"),v.write("return payload;");const A=v.compile();return(k,_)=>A(y,k,_)};let s;const l=im,c=!KR.jitless,h=c&&i7.value,m=t.catchall;let g;e._zod.parse=(y,v)=>{g??(g=r.value);const w=y.value;return l(w)?c&&h&&v?.async===!1&&v.jitless!==!0?(s||(s=i(t.shape)),y=s(y,v),m?oD([],w,y,v,g,e):y):n(y,v):(y.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),y)}});function OA(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=>!dc(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=>Ts(l,r,Es())))}),t)}const KG=de("$ZodUnion",(e,t)=>{Ft.init(e,t),vt(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),vt(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),vt(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),vt(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=>i1(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=>OA(f,i,e,s)):OA(c,i,e,s)}}),HG=de("$ZodIntersection",(e,t)=>{Ft.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])=>kA(n,f,h)):kA(n,s,l)}});function fw(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(kc(e)&&kc(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=fw(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=fw(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 kA(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}),dc(e))return e;const l=fw(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 GG=de("$ZodRecord",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!kc(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 m=t.valueType._zod.run({value:i[h],issues:[]},r);m instanceof Promise?s.push(m.then(g=>{g.issues.length&&n.issues.push(...fc(h,g.issues)),n.value[h]=g.value})):(m.issues.length&&n.issues.push(...fc(h,m.issues)),n.value[h]=m.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"&&eD.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=>Ts(g,r,Es())),input:c,path:[c],inst:e});continue}const m=t.valueType._zod.run({value:i[c],issues:[]},r);m instanceof Promise?s.push(m.then(g=>{g.issues.length&&n.issues.push(...fc(c,g.issues)),n.value[f.value]=g.value})):(m.issues.length&&n.issues.push(...fc(c,m.issues)),n.value[f.value]=m.value)}}return s.length?Promise.all(s).then(()=>n):n}}),VG=de("$ZodEnum",(e,t)=>{Ft.init(e,t);const n=HR(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>a7.has(typeof i)).map(i=>typeof i=="string"?Ac(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}}),ZG=de("$ZodLiteral",(e,t)=>{if(Ft.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"?Ac(r):r?Ac(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}}),YG=de("$ZodTransform",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new FR(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 xc;return n.value=i,n}});function AA(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const lD=de("$ZodOptional",(e,t)=>{Ft.init(e,t),e._zod.optin="optional",e._zod.optout="optional",vt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),vt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${i1(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=>AA(s,n.value)):AA(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),WG=de("$ZodExactOptional",(e,t)=>{lD.init(e,t),vt(e._zod,"values",()=>t.innerType._zod.values),vt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),QG=de("$ZodNullable",(e,t)=>{Ft.init(e,t),vt(e._zod,"optin",()=>t.innerType._zod.optin),vt(e._zod,"optout",()=>t.innerType._zod.optout),vt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${i1(n.source)}|null)$`):void 0}),vt(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)}),XG=de("$ZodDefault",(e,t)=>{Ft.init(e,t),e._zod.optin="optional",vt(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=>EA(s,t)):EA(i,t)}});function EA(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const JG=de("$ZodPrefault",(e,t)=>{Ft.init(e,t),e._zod.optin="optional",vt(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))}),eV=de("$ZodNonOptional",(e,t)=>{Ft.init(e,t),vt(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=>TA(s,e)):TA(i,e)}});function TA(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 tV=de("$ZodCatch",(e,t)=>{Ft.init(e,t),vt(e._zod,"optin",()=>t.innerType._zod.optin),vt(e._zod,"optout",()=>t.innerType._zod.optout),vt(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=>Ts(l,r,Es()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>Ts(s,r,Es()))},input:n.value}),n.issues=[]),n)}}),nV=de("$ZodPipe",(e,t)=>{Ft.init(e,t),vt(e._zod,"values",()=>t.in._zod.values),vt(e._zod,"optin",()=>t.in._zod.optin),vt(e._zod,"optout",()=>t.out._zod.optout),vt(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=>ep(l,t.in,r)):ep(s,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(s=>ep(s,t.out,r)):ep(i,t.out,r)}});function ep(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const rV=de("$ZodReadonly",(e,t)=>{Ft.init(e,t),vt(e._zod,"propValues",()=>t.innerType._zod.propValues),vt(e._zod,"values",()=>t.innerType._zod.values),vt(e._zod,"optin",()=>t.innerType?._zod?.optin),vt(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(PA):PA(i)}});function PA(e){return e.value=Object.freeze(e.value),e}const iV=de("$ZodCustom",(e,t)=>{hr.init(e,t),Ft.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=>zA(s,n,r,e));zA(i,n,r,e)}});function zA(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(Pd(i))}}var MA;class aV{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 sV(){return new aV}(MA=globalThis).__zod_globalRegistry??(MA.__zod_globalRegistry=sV());const hd=globalThis.__zod_globalRegistry;function oV(e,t){return new e({type:"string",...Me(t)})}function lV(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Me(t)})}function RA(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Me(t)})}function cV(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Me(t)})}function uV(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Me(t)})}function dV(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Me(t)})}function fV(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Me(t)})}function hV(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Me(t)})}function pV(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Me(t)})}function mV(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Me(t)})}function gV(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Me(t)})}function yV(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Me(t)})}function vV(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Me(t)})}function bV(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Me(t)})}function xV(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Me(t)})}function wV(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Me(t)})}function SV(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Me(t)})}function jV(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Me(t)})}function NV(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Me(t)})}function CV(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Me(t)})}function _V(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Me(t)})}function OV(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Me(t)})}function kV(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Me(t)})}function AV(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Me(t)})}function EV(e,t){return new e({type:"string",format:"date",check:"string_format",...Me(t)})}function TV(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Me(t)})}function PV(e,t){return new e({type:"string",format:"duration",check:"string_format",...Me(t)})}function zV(e,t){return new e({type:"number",checks:[],...Me(t)})}function MV(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Me(t)})}function RV(e,t){return new e({type:"boolean",...Me(t)})}function DV(e){return new e({type:"unknown"})}function LV(e,t){return new e({type:"never",...Me(t)})}function DA(e,t){return new nD({check:"less_than",...Me(t),value:e,inclusive:!1})}function sb(e,t){return new nD({check:"less_than",...Me(t),value:e,inclusive:!0})}function LA(e,t){return new rD({check:"greater_than",...Me(t),value:e,inclusive:!1})}function ob(e,t){return new rD({check:"greater_than",...Me(t),value:e,inclusive:!0})}function IA(e,t){return new X7({check:"multiple_of",...Me(t),value:e})}function cD(e,t){return new eG({check:"max_length",...Me(t),maximum:e})}function sm(e,t){return new tG({check:"min_length",...Me(t),minimum:e})}function uD(e,t){return new nG({check:"length_equals",...Me(t),length:e})}function IV(e,t){return new rG({check:"string_format",format:"regex",...Me(t),pattern:e})}function $V(e){return new iG({check:"string_format",format:"lowercase",...Me(e)})}function UV(e){return new aG({check:"string_format",format:"uppercase",...Me(e)})}function BV(e,t){return new sG({check:"string_format",format:"includes",...Me(t),includes:e})}function qV(e,t){return new oG({check:"string_format",format:"starts_with",...Me(t),prefix:e})}function FV(e,t){return new lG({check:"string_format",format:"ends_with",...Me(t),suffix:e})}function Bc(e){return new cG({check:"overwrite",tx:e})}function KV(e){return Bc(t=>t.normalize(e))}function HV(){return Bc(e=>e.trim())}function GV(){return Bc(e=>e.toLowerCase())}function VV(){return Bc(e=>e.toUpperCase())}function ZV(){return Bc(e=>r7(e))}function YV(e,t,n){return new e({type:"array",element:t,...Me(n)})}function WV(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Me(n)})}function QV(e){const t=XV(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Pd(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(Pd(i))}},e(n.value,n)));return t}function XV(e,t){const n=new hr({check:"custom",...Me(t)});return n._zod.check=e,n}function dD(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??hd,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 cn(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 m={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,m);else{const y=l.schema,v=t.processors[i.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);v(e,t,y,m)}const g=e._zod.parent;g&&(l.ref||(l.ref=g),cn(g,t,m),t.seen.get(g).isParent=!0)}const f=t.metadataRegistry.get(e);return f&&Object.assign(l.schema,f),t.io==="input"&&Vn(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 fD(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,y=e.external.uri??(w=>w);if(g)return{ref:y(g)};const v=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=v,{defId:v,ref:`${y("__shared")}#/${c}/${v}`}}if(l[1]===n)return{ref:"#"};const h=`#/${c}/`,m=l[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:h+m}},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 m=c.schema;for(const g in m)delete m[g];m.$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 hD(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},m=c.ref;if(c.ref=null,m){r(m);const y=e.seen.get(m),v=y.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(f.allOf=f.allOf??[],f.allOf.push(v)):Object.assign(f,v),Object.assign(f,h),l._zod.parent===m)for(const S in f)S==="$ref"||S==="allOf"||S in h||delete f[S];if(v.$ref&&y.def)for(const S in f)S==="$ref"||S==="allOf"||S in y.def&&JSON.stringify(f[S])===JSON.stringify(y.def[S])&&delete f[S]}const g=l._zod.parent;if(g&&g!==m){r(g);const y=e.seen.get(g);if(y?.schema.$ref&&(f.$ref=y.schema.$ref,y.def))for(const v in f)v==="$ref"||v==="allOf"||v in y.def&&JSON.stringify(f[v])===JSON.stringify(y.def[v])&&delete f[v]}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:om(t,"input",e.processors),output:om(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function Vn(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 Vn(r.element,n);if(r.type==="set")return Vn(r.valueType,n);if(r.type==="lazy")return Vn(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 Vn(r.innerType,n);if(r.type==="intersection")return Vn(r.left,n)||Vn(r.right,n);if(r.type==="record"||r.type==="map")return Vn(r.keyType,n)||Vn(r.valueType,n);if(r.type==="pipe")return Vn(r.in,n)||Vn(r.out,n);if(r.type==="object"){for(const i in r.shape)if(Vn(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(Vn(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(Vn(i,n))return!0;return!!(r.rest&&Vn(r.rest,n))}return!1}const JV=(e,t={})=>n=>{const r=dD({...n,processors:t});return cn(e,r),fD(r,e),hD(r,e)},om=(e,t,n={})=>r=>{const{libraryOptions:i,target:s}=r??{},l=dD({...i??{},target:s,io:t,processors:n});return cn(e,l),fD(l,e),hD(l,e)},eZ={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},tZ=(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=eZ[c]??c,i.format===""&&delete i.format,c==="time"&&delete i.format),h&&(i.contentEncoding=h),f&&f.size>0){const m=[...f];m.length===1?i.pattern=m[0].source:m.length>1&&(i.allOf=[...m.map(g=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},nZ=(e,t,n,r)=>{const i=n,{minimum:s,maximum:l,format:c,multipleOf:f,exclusiveMaximum:h,exclusiveMinimum:m}=e._zod.bag;typeof c=="string"&&c.includes("int")?i.type="integer":i.type="number",typeof m=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=m,i.exclusiveMinimum=!0):i.exclusiveMinimum=m),typeof s=="number"&&(i.minimum=s,typeof m=="number"&&t.target!=="draft-04"&&(m>=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)},rZ=(e,t,n,r)=>{n.type="boolean"},iZ=(e,t,n,r)=>{n.not={}},aZ=(e,t,n,r)=>{},sZ=(e,t,n,r)=>{const i=e._zod.def,s=HR(i.entries);s.every(l=>typeof l=="number")&&(n.type="number"),s.every(l=>typeof l=="string")&&(n.type="string"),n.enum=s},oZ=(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},lZ=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},cZ=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},uZ=(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=cn(s.element,t,{...r,path:[...r.path,"items"]})},dZ=(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]=cn(l[h],t,{...r,path:[...r.path,"properties",h]});const c=new Set(Object.keys(l)),f=new Set([...c].filter(h=>{const m=s.shape[h]._zod;return t.io==="input"?m.optin===void 0:m.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=cn(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},fZ=(e,t,n,r)=>{const i=e._zod.def,s=i.inclusive===!1,l=i.options.map((c,f)=>cn(c,t,{...r,path:[...r.path,s?"oneOf":"anyOf",f]}));s?n.oneOf=l:n.anyOf=l},hZ=(e,t,n,r)=>{const i=e._zod.def,s=cn(i.left,t,{...r,path:[...r.path,"allOf",0]}),l=cn(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},pZ=(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 m=cn(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const g of f)i.patternProperties[g.source]=m}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=cn(s.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=cn(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const h=l._zod.values;if(h){const m=[...h].filter(g=>typeof g=="string"||typeof g=="number");m.length>0&&(i.required=m)}},mZ=(e,t,n,r)=>{const i=e._zod.def,s=cn(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"}]},gZ=(e,t,n,r)=>{const i=e._zod.def;cn(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType},yZ=(e,t,n,r)=>{const i=e._zod.def;cn(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},vZ=(e,t,n,r)=>{const i=e._zod.def;cn(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)))},bZ=(e,t,n,r)=>{const i=e._zod.def;cn(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},xZ=(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;cn(s,t,r);const l=t.seen.get(e);l.ref=s},wZ=(e,t,n,r)=>{const i=e._zod.def;cn(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType,n.readOnly=!0},pD=(e,t,n,r)=>{const i=e._zod.def;cn(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType},SZ=de("ZodISODateTime",(e,t)=>{jG.init(e,t),Ht.init(e,t)});function jZ(e){return AV(SZ,e)}const NZ=de("ZodISODate",(e,t)=>{NG.init(e,t),Ht.init(e,t)});function CZ(e){return EV(NZ,e)}const _Z=de("ZodISOTime",(e,t)=>{CG.init(e,t),Ht.init(e,t)});function OZ(e){return TV(_Z,e)}const kZ=de("ZodISODuration",(e,t)=>{_G.init(e,t),Ht.init(e,t)});function AZ(e){return PV(kZ,e)}const EZ=(e,t)=>{YR.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>g7(e,n)},flatten:{value:n=>m7(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,dw,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,dw,2)}},isEmpty:{get(){return e.issues.length===0}}})},ni=de("ZodError",EZ,{Parent:Error}),TZ=s1(ni),PZ=o1(ni),zZ=xg(ni),MZ=wg(ni),RZ=b7(ni),DZ=x7(ni),LZ=w7(ni),IZ=S7(ni),$Z=j7(ni),UZ=N7(ni),BZ=C7(ni),qZ=_7(ni),Kt=de("ZodType",(e,t)=>(Ft.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:om(e,"input"),output:om(e,"output")}}),e.toJSONSchema=JV(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone($s(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)=>Us(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>TZ(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>zZ(e,n,r),e.parseAsync=async(n,r)=>PZ(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>MZ(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>RZ(e,n,r),e.decode=(n,r)=>DZ(e,n,r),e.encodeAsync=async(n,r)=>LZ(e,n,r),e.decodeAsync=async(n,r)=>IZ(e,n,r),e.safeEncode=(n,r)=>$Z(e,n,r),e.safeDecode=(n,r)=>UZ(e,n,r),e.safeEncodeAsync=async(n,r)=>BZ(e,n,r),e.safeDecodeAsync=async(n,r)=>qZ(e,n,r),e.refine=(n,r)=>e.check(DY(n,r)),e.superRefine=n=>e.check(LY(n)),e.overwrite=n=>e.check(Bc(n)),e.optional=()=>BA(e),e.exactOptional=()=>jY(e),e.nullable=()=>qA(e),e.nullish=()=>BA(qA(e)),e.nonoptional=n=>AY(e,n),e.array=()=>Ce(e),e.or=n=>mY([e,n]),e.and=n=>yY(e,n),e.transform=n=>FA(e,wY(n)),e.default=n=>_Y(e,n),e.prefault=n=>kY(e,n),e.catch=n=>TY(e,n),e.pipe=n=>FA(e,n),e.readonly=()=>MY(e),e.describe=n=>{const r=e.clone();return hd.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return hd.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return hd.get(e);const r=e.clone();return hd.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),mD=de("_ZodString",(e,t)=>{l1.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(r,i,s)=>tZ(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(IV(...r)),e.includes=(...r)=>e.check(BV(...r)),e.startsWith=(...r)=>e.check(qV(...r)),e.endsWith=(...r)=>e.check(FV(...r)),e.min=(...r)=>e.check(sm(...r)),e.max=(...r)=>e.check(cD(...r)),e.length=(...r)=>e.check(uD(...r)),e.nonempty=(...r)=>e.check(sm(1,...r)),e.lowercase=r=>e.check($V(r)),e.uppercase=r=>e.check(UV(r)),e.trim=()=>e.check(HV()),e.normalize=(...r)=>e.check(KV(...r)),e.toLowerCase=()=>e.check(GV()),e.toUpperCase=()=>e.check(VV()),e.slugify=()=>e.check(ZV())}),FZ=de("ZodString",(e,t)=>{l1.init(e,t),mD.init(e,t),e.email=n=>e.check(lV(KZ,n)),e.url=n=>e.check(hV(HZ,n)),e.jwt=n=>e.check(kV(sY,n)),e.emoji=n=>e.check(pV(GZ,n)),e.guid=n=>e.check(RA($A,n)),e.uuid=n=>e.check(cV(tp,n)),e.uuidv4=n=>e.check(uV(tp,n)),e.uuidv6=n=>e.check(dV(tp,n)),e.uuidv7=n=>e.check(fV(tp,n)),e.nanoid=n=>e.check(mV(VZ,n)),e.guid=n=>e.check(RA($A,n)),e.cuid=n=>e.check(gV(ZZ,n)),e.cuid2=n=>e.check(yV(YZ,n)),e.ulid=n=>e.check(vV(WZ,n)),e.base64=n=>e.check(CV(rY,n)),e.base64url=n=>e.check(_V(iY,n)),e.xid=n=>e.check(bV(QZ,n)),e.ksuid=n=>e.check(xV(XZ,n)),e.ipv4=n=>e.check(wV(JZ,n)),e.ipv6=n=>e.check(SV(eY,n)),e.cidrv4=n=>e.check(jV(tY,n)),e.cidrv6=n=>e.check(NV(nY,n)),e.e164=n=>e.check(OV(aY,n)),e.datetime=n=>e.check(jZ(n)),e.date=n=>e.check(CZ(n)),e.time=n=>e.check(OZ(n)),e.duration=n=>e.check(AZ(n))});function L(e){return oV(FZ,e)}const Ht=de("ZodStringFormat",(e,t)=>{$t.init(e,t),mD.init(e,t)}),KZ=de("ZodEmail",(e,t)=>{pG.init(e,t),Ht.init(e,t)}),$A=de("ZodGUID",(e,t)=>{fG.init(e,t),Ht.init(e,t)}),tp=de("ZodUUID",(e,t)=>{hG.init(e,t),Ht.init(e,t)}),HZ=de("ZodURL",(e,t)=>{mG.init(e,t),Ht.init(e,t)}),GZ=de("ZodEmoji",(e,t)=>{gG.init(e,t),Ht.init(e,t)}),VZ=de("ZodNanoID",(e,t)=>{yG.init(e,t),Ht.init(e,t)}),ZZ=de("ZodCUID",(e,t)=>{vG.init(e,t),Ht.init(e,t)}),YZ=de("ZodCUID2",(e,t)=>{bG.init(e,t),Ht.init(e,t)}),WZ=de("ZodULID",(e,t)=>{xG.init(e,t),Ht.init(e,t)}),QZ=de("ZodXID",(e,t)=>{wG.init(e,t),Ht.init(e,t)}),XZ=de("ZodKSUID",(e,t)=>{SG.init(e,t),Ht.init(e,t)}),JZ=de("ZodIPv4",(e,t)=>{OG.init(e,t),Ht.init(e,t)}),eY=de("ZodIPv6",(e,t)=>{kG.init(e,t),Ht.init(e,t)}),tY=de("ZodCIDRv4",(e,t)=>{AG.init(e,t),Ht.init(e,t)}),nY=de("ZodCIDRv6",(e,t)=>{EG.init(e,t),Ht.init(e,t)}),rY=de("ZodBase64",(e,t)=>{TG.init(e,t),Ht.init(e,t)}),iY=de("ZodBase64URL",(e,t)=>{zG.init(e,t),Ht.init(e,t)}),aY=de("ZodE164",(e,t)=>{MG.init(e,t),Ht.init(e,t)}),sY=de("ZodJWT",(e,t)=>{DG.init(e,t),Ht.init(e,t)}),gD=de("ZodNumber",(e,t)=>{aD.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(r,i,s)=>nZ(e,r,i),e.gt=(r,i)=>e.check(LA(r,i)),e.gte=(r,i)=>e.check(ob(r,i)),e.min=(r,i)=>e.check(ob(r,i)),e.lt=(r,i)=>e.check(DA(r,i)),e.lte=(r,i)=>e.check(sb(r,i)),e.max=(r,i)=>e.check(sb(r,i)),e.int=r=>e.check(UA(r)),e.safe=r=>e.check(UA(r)),e.positive=r=>e.check(LA(0,r)),e.nonnegative=r=>e.check(ob(0,r)),e.negative=r=>e.check(DA(0,r)),e.nonpositive=r=>e.check(sb(0,r)),e.multipleOf=(r,i)=>e.check(IA(r,i)),e.step=(r,i)=>e.check(IA(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 Pe(e){return zV(gD,e)}const oY=de("ZodNumberFormat",(e,t)=>{LG.init(e,t),gD.init(e,t)});function UA(e){return MV(oY,e)}const lY=de("ZodBoolean",(e,t)=>{IG.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>rZ(e,n,r)});function qt(e){return RV(lY,e)}const cY=de("ZodUnknown",(e,t)=>{$G.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>aZ()});function lm(){return DV(cY)}const uY=de("ZodNever",(e,t)=>{UG.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>iZ(e,n,r)});function dY(e){return LV(uY,e)}const fY=de("ZodArray",(e,t)=>{BG.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>uZ(e,n,r,i),e.element=t.element,e.min=(n,r)=>e.check(sm(n,r)),e.nonempty=n=>e.check(sm(1,n)),e.max=(n,r)=>e.check(cD(n,r)),e.length=(n,r)=>e.check(uD(n,r)),e.unwrap=()=>e.element});function Ce(e,t){return YV(fY,e,t)}const hY=de("ZodObject",(e,t)=>{FG.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>dZ(e,n,r,i),vt(e,"shape",()=>t.shape),e.keyof=()=>It(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:lm()}),e.loose=()=>e.clone({...e._zod.def,catchall:lm()}),e.strict=()=>e.clone({...e._zod.def,catchall:dY()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>u7(e,n),e.safeExtend=n=>d7(e,n),e.merge=n=>f7(e,n),e.pick=n=>l7(e,n),e.omit=n=>c7(e,n),e.partial=(...n)=>h7(yD,e,n[0]),e.required=(...n)=>p7(vD,e,n[0])});function Ne(e,t){const n={type:"object",shape:e??{},...Me(t)};return new hY(n)}const pY=de("ZodUnion",(e,t)=>{KG.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>fZ(e,n,r,i),e.options=t.options});function mY(e,t){return new pY({type:"union",options:e,...Me(t)})}const gY=de("ZodIntersection",(e,t)=>{HG.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>hZ(e,n,r,i)});function yY(e,t){return new gY({type:"intersection",left:e,right:t})}const vY=de("ZodRecord",(e,t)=>{GG.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>pZ(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function Jd(e,t,n){return new vY({type:"record",keyType:e,valueType:t,...Me(n)})}const hw=de("ZodEnum",(e,t)=>{VG.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(r,i,s)=>sZ(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 hw({...t,checks:[],...Me(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 hw({...t,checks:[],...Me(i),entries:s})}});function It(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new hw({type:"enum",entries:n,...Me(t)})}const bY=de("ZodLiteral",(e,t)=>{ZG.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>oZ(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 zd(e,t){return new bY({type:"literal",values:Array.isArray(e)?e:[e],...Me(t)})}const xY=de("ZodTransform",(e,t)=>{YG.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>cZ(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new FR(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Pd(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(Pd(l))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(s=>(n.value=s,n)):(n.value=i,n)}});function wY(e){return new xY({type:"transform",transform:e})}const yD=de("ZodOptional",(e,t)=>{lD.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>pD(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function BA(e){return new yD({type:"optional",innerType:e})}const SY=de("ZodExactOptional",(e,t)=>{WG.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>pD(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function jY(e){return new SY({type:"optional",innerType:e})}const NY=de("ZodNullable",(e,t)=>{QG.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>mZ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function qA(e){return new NY({type:"nullable",innerType:e})}const CY=de("ZodDefault",(e,t)=>{XG.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>yZ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function _Y(e,t){return new CY({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():VR(t)}})}const OY=de("ZodPrefault",(e,t)=>{JG.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>vZ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function kY(e,t){return new OY({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():VR(t)}})}const vD=de("ZodNonOptional",(e,t)=>{eV.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>gZ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function AY(e,t){return new vD({type:"nonoptional",innerType:e,...Me(t)})}const EY=de("ZodCatch",(e,t)=>{tV.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>bZ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function TY(e,t){return new EY({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const PY=de("ZodPipe",(e,t)=>{nV.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>xZ(e,n,r,i),e.in=t.in,e.out=t.out});function FA(e,t){return new PY({type:"pipe",in:e,out:t})}const zY=de("ZodReadonly",(e,t)=>{rV.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>wZ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function MY(e){return new zY({type:"readonly",innerType:e})}const RY=de("ZodCustom",(e,t)=>{iV.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>lZ(e,n)});function DY(e,t={}){return WV(RY,e,t)}function LY(e){return QV(e)}Ne({maxConcurrency:Pe().int().positive(),maxRequestsPerMinute:Pe().int().positive(),maxRequestsPerDay:Pe().int().positive()});const qc=L().min(1);L().min(1);const c1=Ne({label:L().min(1),city:L().min(1),region:L().min(1),country:L().length(2),timezone:L().optional()}),bD=It(["citation.lost","citation.gained","run.completed","run.failed"]);Ne({id:L(),projectId:L(),channel:zd("webhook"),url:L().url(),urlDisplay:L(),urlHost:L(),events:Ce(bD),enabled:qt().default(!0),webhookSecret:L().optional(),createdAt:L(),updatedAt:L()});const xD=It(["cli","api","config-file"]);function IY(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 $Y(e,t){return t?e.some(n=>n.label===t):!0}Ne({displayName:L().min(1),canonicalDomain:L().min(1),ownedDomains:Ce(L().min(1)).optional(),country:L().length(2),language:L().min(2),tags:Ce(L()).optional(),labels:Jd(L(),L()).optional(),providers:Ce(qc).optional(),locations:Ce(c1).optional(),defaultLocation:L().nullable().optional(),configSource:xD.optional()});Ne({id:L(),name:L(),displayName:L().optional(),canonicalDomain:L(),ownedDomains:Ce(L()).default([]),country:L().length(2),language:L().min(2),tags:Ce(L()).default([]),labels:Jd(L(),L()).default({}),locations:Ce(c1).default([]),defaultLocation:L().nullable().optional(),configSource:xD.default("cli"),configRevision:Pe().int().positive().default(1),createdAt:L().optional(),updatedAt:L().optional()});function pw(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}function UY(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=pw(s);n.has(l)||(n.add(l),r.push(s))}return r}const BY=Ne({name:L().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:Jd(L(),L()).optional().default({})}),qY=Ne({preset:L().optional(),cron:L().optional(),timezone:L().optional().default("UTC"),providers:Ce(qc).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),FY=Ne({channel:zd("webhook"),url:L().url(),events:Ce(bD).min(1)}),KY=Ne({gsc:Ne({propertyUrl:L()}).optional(),syncSchedule:Ne({preset:L().optional(),cron:L().optional()}).optional()}).optional(),HY=Ne({displayName:L().min(1),canonicalDomain:L().min(1),ownedDomains:Ce(L().min(1)).optional().default([]),country:L().length(2),language:L().min(2),keywords:Ce(L().min(1)).optional().default([]),competitors:Ce(L().min(1)).optional().default([]),providers:Ce(qc).optional().default([]),locations:Ce(c1).optional().default([]),defaultLocation:L().optional(),schedule:qY,notifications:Ce(FY).optional().default([]),google:KY}).superRefine((e,t)=>{const n=IY(e.locations);n.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${n.join(", ")}`,path:["locations"]}),$Y(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});Ne({apiVersion:zd("canonry/v1"),kind:zd("Project"),metadata:BY,spec:HY});const GY=It(["gsc","ga4"]);Ne({id:L(),domain:L(),connectionType:GY,propertyId:L().nullable().optional(),sitemapUrl:L().nullable().optional(),scopes:Ce(L()).default([]),createdAt:L(),updatedAt:L()});Ne({date:L(),query:L(),page:L(),country:L().nullable().optional(),device:L().nullable().optional(),clicks:Pe(),impressions:Pe(),ctr:Pe(),position:Pe()});const mw=Ne({id:L(),url:L(),indexingState:L().nullable().optional(),verdict:L().nullable().optional(),coverageState:L().nullable().optional(),pageFetchState:L().nullable().optional(),robotsTxtState:L().nullable().optional(),crawlTime:L().nullable().optional(),lastCrawlResult:L().nullable().optional(),isMobileFriendly:qt().nullable().optional(),richResults:Ce(L()).default([]),inspectedAt:L()});It(["stable","reindexed","deindexed","still-missing","new"]);const VY=Ne({url:L(),previousState:L().nullable(),currentState:L().nullable(),transitionDate:L()}),ZY=Ne({reason:L(),count:Pe(),urls:Ce(mw).default([])});Ne({summary:Ne({total:Pe(),indexed:Pe(),notIndexed:Pe(),deindexed:Pe(),percentage:Pe()}),lastInspectedAt:L().nullable(),indexed:Ce(mw).default([]),notIndexed:Ce(mw).default([]),deindexed:Ce(VY).default([]),reasonGroups:Ce(ZY).default([])});Ne({url:L(),type:It(["URL_UPDATED","URL_DELETED"]),notifiedAt:L()});Ne({url:L(),type:It(["URL_UPDATED","URL_DELETED"]),notifiedAt:L(),status:It(["success","error"]),error:L().optional()});Ne({date:L(),indexed:Pe(),notIndexed:Pe(),reasonBreakdown:Jd(L(),Pe()).default({})});Ne({id:L(),domain:L(),siteUrl:L().nullable().optional(),createdAt:L(),updatedAt:L()});const lb=Ne({id:L(),url:L(),httpCode:Pe().nullable().optional(),inIndex:qt().nullable().optional(),lastCrawledDate:L().nullable().optional(),inIndexDate:L().nullable().optional(),inspectedAt:L(),documentSize:Pe().nullable().optional(),anchorCount:Pe().nullable().optional(),discoveryDate:L().nullable().optional()});Ne({summary:Ne({total:Pe(),indexed:Pe(),notIndexed:Pe(),unknown:Pe().optional(),percentage:Pe()}),lastInspectedAt:L().nullable(),indexed:Ce(lb).default([]),notIndexed:Ce(lb).default([]),unknown:Ce(lb).default([]).optional()});Ne({query:L(),impressions:Pe(),clicks:Pe(),ctr:Pe(),averagePosition:Pe()});Ne({url:L(),status:It(["success","error"]),submittedAt:L(),error:L().optional()});const Fc=It(["live","staging"]);Ne({projectName:L(),url:L(),stagingUrl:L().optional(),username:L(),defaultEnv:Fc,createdAt:L(),updatedAt:L()});const KA=Ne({url:L(),reachable:qt(),pageCount:Pe().nullable().optional(),version:L().nullable().optional(),error:L().nullable().optional(),plugins:Ce(L()).optional(),authenticatedUser:Ne({id:Pe(),slug:L()}).nullable().optional()});Ne({connected:qt(),projectName:L(),defaultEnv:Fc,live:KA.nullable(),staging:KA.nullable(),adminUrl:L().nullable().optional()});const YY=Ne({id:Pe(),slug:L(),title:L(),status:L(),modifiedAt:L().nullable().optional(),link:L().nullable().optional()}),wD=Ne({title:L().nullable(),description:L().nullable(),noindex:qt().nullable(),writable:qt().default(!1),writeTargets:Ce(L()).default([])}),WY=Ne({type:L(),json:Jd(L(),lm())}),QY=YY.extend({env:Fc,content:L(),seo:wD,schemaBlocks:Ce(WY).default([])}),HA=QY.extend({contentHash:L(),contentSnippet:L()}),SD=Ne({manualRequired:zd(!0),targetUrl:L(),adminUrl:L().nullable().optional(),content:L(),nextSteps:Ce(L()).default([])}),XY=Ne({slug:L(),severity:It(["high","medium","low"]),code:It(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:L()});Ne({slug:L(),title:L(),status:L(),wordCount:Pe(),seo:wD,schemaPresent:qt(),issues:Ce(XY).default([])});const JY=Ne({slug:L(),status:It(["applied","skipped","manual"]),error:L().optional(),manualAssist:SD.optional()});Ne({env:Fc,strategy:It(["plugin","manual"]),results:Ce(JY)});const eW=Ne({slug:L(),status:It(["deployed","stripped","skipped","failed"]),schemasInjected:Ce(L()).optional(),manualAssist:SD.optional(),error:L().optional()});Ne({env:Fc,results:Ce(eW)});const tW=Ne({slug:L(),title:L(),canonrySchemas:Ce(L()),thirdPartySchemas:Ce(L()),hasCanonrySchema:qt()});Ne({env:Fc,pages:Ce(tW)});const nW=Ne({name:L(),status:It(["completed","skipped","failed"]),summary:L().optional(),error:L().optional()});Ne({projectName:L(),steps:Ce(nW)});Ne({slug:L(),live:HA,staging:HA,hasDifferences:qt(),differences:Ne({title:qt(),slug:qt(),content:qt(),seoTitle:qt(),seoDescription:qt(),noindex:qt(),schema:qt()})});const rW=It(["queued","running","completed","partial","failed","cancelled"]),iW=It(["answer-visibility","site-audit","gsc-sync","inspect-sitemap"]),aW=It(["manual","scheduled","config-apply"]),sW=It(["cited","not-cited"]),oW=It(["visible","not-visible"]),lW=It(["new","cited","lost","emerging","not-cited"]);Ne({id:L(),projectId:L(),kind:iW,status:rW,trigger:aW.default("manual"),location:L().nullable().optional(),startedAt:L().nullable().optional(),finishedAt:L().nullable().optional(),error:L().nullable().optional(),createdAt:L()});const jD=Ne({uri:L(),title:L()});Ne({id:L(),runId:L(),keywordId:L(),keyword:L().optional(),provider:qc,citationState:sW,answerMentioned:qt().optional(),visibilityState:oW.optional(),transition:lW.optional(),answerText:L().nullable().optional(),citedDomains:Ce(L()).default([]),competitorOverlap:Ce(L()).default([]),recommendedCompetitors:Ce(L()).default([]),matchedTerms:Ce(L()).default([]),groundingSources:Ce(jD).default([]),searchQueries:Ce(L()).default([]),model:L().nullable().optional(),location:L().nullable().optional(),createdAt:L()});Ne({id:L(),projectId:L().nullable().optional(),actor:L(),action:L(),entityType:L(),entityId:L().nullable().optional(),diff:lm().optional(),createdAt:L()});const cW=It(["yes","no","unknown","not-mentioned"]);Ne({companyName:L().min(1),domain:L().min(1),phrases:Ce(L().min(1)).optional().default([]),competitors:Ce(L().min(1)).optional().default([])});const uW=Ne({name:L(),count:Pe().int().nonnegative()}),dW=Ne({id:L(),name:L(),weight:Pe(),score:Pe(),grade:L(),status:It(["pass","partial","fail"]),findings:Ce(Ne({type:L(),message:L()})).default([]),recommendations:Ce(L()).default([])}),fW=Ne({url:L(),finalUrl:L(),auditedAt:L(),overallScore:Pe(),overallGrade:L(),summary:L(),factors:Ce(dW).default([])}),hW=Ne({industry:L(),summary:L(),services:Ce(L()).default([]),categoryTerms:Ce(L()).default([])}),pW=Ne({provider:L(),displayName:L(),model:L().nullable().optional(),mentioned:qt(),cited:qt(),describedAccurately:cW,accuracyNotes:L().nullable().optional(),incorrectClaims:Ce(L()).default([]),recommendedCompetitors:Ce(L()).default([]),citedDomains:Ce(L()).default([]),groundingSources:Ce(jD).default([]),searchQueries:Ce(L()).default([]),answerText:L(),error:L().nullable().optional()}),mW=Ne({phrase:L(),providerResults:Ce(pW).default([])}),gW=Ne({totalQueries:Pe().int().nonnegative(),totalProviders:Pe().int().nonnegative(),totalComparisons:Pe().int().nonnegative(),mentionCount:Pe().int().nonnegative(),citationCount:Pe().int().nonnegative(),topCompetitors:Ce(uW).default([]),visibilityGap:L(),whatThisMeans:Ce(L()).default([]),recommendedActions:Ce(L()).default([])});Ne({companyName:L(),domain:L(),homepageUrl:L(),generatedAt:L(),phrases:Ce(L()).default([]),competitors:Ce(L()).default([]),profile:hW,audit:fW,queryResults:Ce(mW).default([]),summary:gW});Ne({id:L(),projectId:L(),cronExpr:L(),preset:L().nullable().optional(),timezone:L().default("UTC"),enabled:qt().default(!0),providers:Ce(qc).default([]),lastRunAt:L().nullable().optional(),nextRunAt:L().nullable().optional(),createdAt:L(),updatedAt:L()});Ne({preset:L().optional(),cron:L().optional(),timezone:L().optional().default("UTC"),enabled:qt().optional().default(!0),providers:Ce(qc).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});Ne({id:L(),projectId:L(),propertyId:L(),clientEmail:L(),connected:qt(),createdAt:L(),updatedAt:L()});Ne({date:L(),landingPage:L(),sessions:Pe(),organicSessions:Pe(),users:Pe()});const yW=Ne({source:L(),medium:L(),sessions:Pe(),users:Pe()});Ne({totalSessions:Pe(),totalOrganicSessions:Pe(),totalUsers:Pe(),topPages:Ce(Ne({landingPage:L(),sessions:Pe(),organicSessions:Pe(),users:Pe()})),aiReferrals:Ce(yW),lastSyncedAt:L().nullable()});Ne({date:L(),source:L(),medium:L(),sessions:Pe(),users:Pe()});Ne({date:L(),sessions:Pe(),organicSessions:Pe(),users:Pe()});function GA(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}function Yn({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+window.scrollY,left:l.left+l.width/2+window.scrollX})},[]),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&&el.createPortal(u.jsx("span",{role:"tooltip",className:"info-tooltip-bubble info-tooltip-bubble--fixed",style:{top:t.top,left:t.left},children:e}),document.body)]})}function VA(e,t){const n=vW(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,m)=>h.type==="bold"?fi.createElement("strong",{key:`b-${m}`,className:"text-zinc-200 font-semibold"},h.value):h.value).filter(Boolean);const l=[...i].sort((h,m)=>m.length-h.length).map(h=>h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),c=new RegExp(`(${l.join("|")})`,"gi"),f=new Map;for(const h of n)for(const m of h.terms){const g=m.toLowerCase();f.has(g)||f.set(g,h.className)}return r.flatMap((h,m)=>h.value.split(c).map((y,v)=>{if(!y)return null;if(v%2===1){const S=f.get(y.toLowerCase())??"answer-highlight";return h.type==="bold"?fi.createElement("mark",{key:`hl-${m}-${v}`,className:S},fi.createElement("strong",{className:"text-zinc-200 font-semibold"},y)):fi.createElement("mark",{key:`hl-${m}-${v}`,className:S},y)}return h.type==="bold"?fi.createElement("strong",{key:`b-${m}-${v}`,className:"text-zinc-200 font-semibold"},y):y})).filter(Boolean)}function vW(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function cb(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 bW({evidence:e,project:t,onClose:n}){const[r,i]=x.useState(!1),[s,l]=x.useState("mentions"),[c,f]=x.useState(-1),[h,m]=x.useState(null),[g,y]=x.useState(!1),[v,w]=x.useState({}),S=UY(t.project),N=new Set(S.map(pw)),C=e.runHistory,A=C.length>1,[k,_]=x.useState(null),T=x.useRef(!1);x.useEffect(()=>{if(T.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const Q=C.at(-1);Q&&(T.current=!0,Oc(Q.runId).then(X=>{const W=X.snapshots.find(le=>le.keyword===e.keyword&&le.provider===e.provider);W&&_({citationState:W.citationState,answerMentioned:W.answerMentioned,visibilityState:W.visibilityState,visibilityTransition:Q.visibilityTransition,provider:W.provider,model:W.model??e.model,answerSnippet:W.answerText??e.answerSnippet,citedDomains:W.citedDomains??e.citedDomains,competitorDomains:W.competitorOverlap??e.competitorDomains,recommendedCompetitors:W.recommendedCompetitors??e.recommendedCompetitors??[],matchedTerms:W.matchedTerms??e.matchedTerms??[],groundingSources:W.groundingSources??e.groundingSources,evidenceUrls:[],changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,C]);const P=c>=0&&h!==null,E=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=E.visibilityState==="pending"||E.citationState==="pending",D=z?!1:E.visibilityState!=null?E.visibilityState==="visible":E.answerMentioned!=null?E.answerMentioned:E.citationState==="cited"||E.citationState==="emerging",F=E.answerMentioned!=null||E.visibilityState!=null||E.recommendedCompetitors.length>0,U=E.citedDomains.length>0||E.groundingSources.length>0||E.evidenceUrls.length>0,I=t.project.displayName||t.project.name,ae=[...S.map(pw),I,I.split(" ").slice(0,2).join(" "),...E.matchedTerms].filter(Q=>Q.trim().length>2),ve=[...E.competitorDomains.flatMap(Q=>{const X=Q.split(".")[0];return X&&X.length>=4?[X]:[]}),...E.recommendedCompetitors].filter(Q=>Q.trim().length>2),me=[{terms:ae,className:"answer-highlight-brand"},...ve.length>0?[{terms:ve,className:"answer-highlight-competitor"}]:[]],G=z?"pending":E.visibilityTransition==="lost"?"lost":D?"cited":"not-cited",re=x.useRef(0),ge=x.useCallback(async Q=>{const X=++re.current;if(Q===-1||Q===C.length-1){f(-1),m(null),i(!1);return}f(Q),i(!1);const W=C[Q],le=`${W.runId}::${e.keyword}::${e.provider}`;if(v[le]){m(v[le]);return}y(!0);try{const ye=await Oc(W.runId);if(X!==re.current)return;const Z=ye.snapshots.find(be=>be.keyword===e.keyword&&be.provider===e.provider)??ye.snapshots.find(be=>be.keyword===e.keyword),ce=Z?{citationState:Z.citationState,answerMentioned:Z.answerMentioned,visibilityState:Z.visibilityState,visibilityTransition:W.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:cb(W.visibilityTransition,W.visibilityState),summary:""}:{citationState:W.citationState,answerMentioned:W.answerMentioned,visibilityState:W.visibilityState,visibilityTransition:W.visibilityTransition,provider:e.provider,model:W.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:cb(W.visibilityTransition,W.visibilityState),summary:"Snapshot data not available for this run."};w(be=>({...be,[le]:ce})),m(ce)}catch{if(X!==re.current)return;m({citationState:W.citationState,answerMentioned:W.answerMentioned,visibilityState:W.visibilityState,visibilityTransition:W.visibilityTransition,provider:e.provider,model:W.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:cb(W.visibilityTransition,W.visibilityState),summary:"Failed to load historical run data."})}finally{X===re.current&&y(!1)}},[C,e.keyword,e.provider,v]),B=(P||e.historyScope!=="provider")&&E.model?`${E.provider} (${E.model}) · ${E.changeLabel.toLowerCase()}`:`${E.provider} · ${E.changeLabel.toLowerCase()}`,R=!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(" · "):"",H=D?{label:"Visible in answer",title:"Your brand or domain is mentioned in this answer",meta:B}:E.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(!E.answerSnippet)return null;const Q=E.answerSnippet.split(`
95
+ `),X=[];let W=[],le=0;const ye=()=>{if(W.length===0)return;const Z=W.join(" ").trim();Z&&X.push(u.jsx("p",{className:X.length>0?"mt-2.5":"",children:VA(Z,me)},le++)),W=[]};for(const Z of Q){const ce=Z.trim();if(/^[-\u2013\u2014]{3,}$/.test(ce)){ye(),X.push(u.jsx("hr",{className:"border-zinc-800/60 my-3"},le++));continue}const be=ce.match(/^(#{1,3})\s+(.+)$/);if(be){ye();const K=be[1].length,Re=be[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||be[2],Ee=K===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":K===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:Ee,children:VA(Re,me)},le++));continue}if(ce===""){ye();continue}W.push(ce)}return ye(),X};return u.jsx(RR,{open:!0,onOpenChange:Q=>{Q||n()},children:u.jsxs(DR,{children:[u.jsx(JS,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),u.jsxs(e1,{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," ","·"," ",E.provider||"All providers"]}),u.jsx(t1,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.keyword})]}),u.jsxs(IR,{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(fg,{className:"size-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]}),A&&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((Q,X)=>{const W=c===-1&&X===C.length-1||c===X,le=Q.visibilityState??(Q.answerMentioned?"visible":"not-visible"),ye=Q.visibilityTransition??le,Z=le==="visible"?"bg-emerald-400":ye==="emerging"?"bg-amber-400":ye==="lost"?"bg-rose-400":"bg-zinc-600",be=new Date(Q.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),K=!!(Q.model&&X>0&&C[X-1]?.model&&C[X-1].model!==Q.model);return u.jsxs("button",{type:"button",className:`evidence-run-dot ${W?"evidence-run-dot--selected":""}`,onClick:()=>ge(X===C.length-1?-1:X),"aria-label":[`Run ${be}: ${le}`,Q.model?`model ${Q.model}`:null,K?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":W,children:[u.jsx("span",{className:`size-2 rounded-full ${Z} ${K?"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:be})]},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:()=>ge(-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(Q=>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:`${Q.fromModel??"unknown"} -> ${Q.toModel??"unknown"} on ${new Date(Q.createdAt).toLocaleDateString()}`},`${Q.runId}:${Q.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--${G}`,children:[u.jsx("p",{className:`evidence-position-label evidence-position-label--${G}`,children:H.label}),u.jsx("p",{className:`evidence-position-title evidence-position-title--${G}`,children:H.title}),u.jsx("p",{className:"evidence-position-meta",children:H.meta}),R&&u.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:R})]}),E.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()}),E.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"})]}),!E.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:D?"Why you're visible":"What to fix"}),u.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((Q,X)=>u.jsxs("div",{className:"action-item",children:[u.jsx("svg",{className:`action-item-icon ${D?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:D?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:Q})]},X))})]}),E.summary&&u.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:E.summary})]}),u.jsxs("div",{className:"evidence-modal-sidebar",children:[(F||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(Yn,{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--${D?"visible":"not-visible"}`,children:[u.jsx("span",{className:"mention-status-icon",children:z?"…":D?"✓":"—"}),u.jsx("span",{className:"mention-status-label",children:z?"Pending":D?"Visible":"Not visible"})]}),E.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:E.matchedTerms.map(Q=>u.jsx("span",{className:"mention-chip mention-chip--brand",children:Q},Q))})]}),!z&&!D&&E.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(Q=>u.jsx("span",{className:"mention-chip mention-chip--muted",children:Q},Q))}),u.jsx("p",{className:"text-[11px] text-zinc-600 mt-1.5",children:"None of these appear in the answer text."})]})]}),(E.recommendedCompetitors.length>0||E.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(Yn,{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 Q=E.competitorDomains.map(le=>le.replace(/^www\./,"")),X=new Set(Q.map(le=>GA(le.replace(/\.[^.]+$/,""))));return[...E.recommendedCompetitors.filter(le=>!X.has(GA(le))),...Q].map(le=>u.jsx("span",{className:"mention-chip mention-chip--competitor",children:le},le))})()})]})]}),s==="sources"&&u.jsxs(u.Fragment,{children:[E.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(Yn,{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:E.citedDomains.map((Q,X)=>{const W=Q.toLowerCase().replace(/^www\./,""),le=N.has(W),ye=!le&&E.competitorDomains.some(ce=>ce.toLowerCase().replace(/^www\./,"")===W),Z=le?"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:Q}),le&&u.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),ye&&u.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},Q)})})]}),E.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 (",E.groundingSources.length,")"]}),u.jsx(Yn,{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:E.groundingSources.map((Q,X)=>u.jsx("li",{className:"truncate text-sm",children:u.jsx("a",{href:Q.uri,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:Q.title||Q.uri})},X))})]}),E.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:E.evidenceUrls.map(Q=>u.jsx("li",{className:"truncate text-sm",children:u.jsx("a",{href:Q,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:Q})},Q))})]}),E.citedDomains.length===0&&E.groundingSources.length===0&&E.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"]})]}),!F&&!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 ui(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 ub=[{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 jg(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 xW=jg({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"}),wW=jg({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"}),SW=jg({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"}),jW=jg({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"}),NW=[{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:ui(["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:ui(["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:ui(["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:ui(["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:ui(["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:ui(["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:ui(["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:ui(["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:ui(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];ub[0],ub[1],ui(["cited","cited","cited","cited","cited"]),ub[2],2/7,ui(["not-cited","not-cited","not-cited","cited"]);function CW(e,t){return e.projects.find(n=>n.project.id===t)}function _W(e,t){return e.runs.find(n=>n.id===t)}function OW(e,t){for(const n of e.projects){const r=n.visibilityEvidence.find(i=>i.id===t);if(r)return{project:n,evidence:r}}}function ND(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 ZA(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function kW(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 CD(e){return e==="answer-visibility"?"Answer visibility sweep":e}function AW(e){return e==="manual"?"Manual":e==="scheduled"?"Scheduled":e==="config-apply"?"Config apply":e}function u1(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:CD(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?ZA(e.startedAt):ZA(e.createdAt),duration:kW(e.startedAt,e.finishedAt),statusDetail:e.error?_D(e.error):EW(e),summary:TW(e),triggerLabel:AW(e.trigger)}}function _D(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 EW(e){switch(e.status){case"queued":return"Waiting for execution slot.";case"running":return"Provider queries in progress.";case"completed":return"All key phrases checked.";case"partial":return"Run completed with some key phrases skipped.";case"failed":return e.error?_D(e.error):"Run failed.";default:return""}}function TW(e){switch(e.status){case"queued":return"Queued for execution";case"running":return"In progress";case"completed":return"Visibility sweep completed";case"partial":return"Partial completion";case"failed":return"Run failed";default:return e.status}}function OD(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 PW(e){return e>=70?"positive":e>=40?"caution":"negative"}function zW(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function MW(e,t){return e===0?"positive":(t>0?e/t:0)>=.3?"negative":"caution"}function RW(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:MW(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 DW(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 LW(e){return e.provider==="Google"&&e.deindexed>0?"negative":e.percentage>=90?"positive":e.percentage>=70?"caution":"negative"}function IW(e,t){const n=DW(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:LW(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 kD(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 $W(e,t,n,r){const i=[];let s=0;const l=new Set;if(n){const c=new Map;for(const y of n.snapshots)if(y.keyword){const v=`${y.keyword}::${y.provider}`;c.set(v,y)}const f=new Set(n.snapshots.map(y=>y.provider)),h=new Set(t.flatMap(y=>Object.keys(y.providerRuns??{}))),m=[...new Set([...f,...h])].sort(),g=m.length>0?m:["gemini"];for(const y of t){if(y.runs.length===0)continue;l.add(y.keyword);const v=y.runs.at(-1),w=v?.transition??"not-cited";for(const S of g){const N=c.get(`${y.keyword}::${S}`),C=(y.providerRuns?.[S]?.length??0)>0;if(!N&&!C)continue;const A=N?.model??null,k=A?`${S}:${A}`:null,_=k?y.modelRuns?.[k]:void 0,T=y.providerRuns?.[S],P=(T?.length?T:null)??(_?.length?_:null),E=T?.length?"provider":_?.length?"model":"keyword",z=P?P.at(-1).transition:w,D=P?P.at(-1).visibilityTransition??(P.at(-1).visibilityState==="visible"?"visible":"not-visible"):v?.visibilityTransition??(v?.visibilityState==="visible"?"visible":"not-visible"),F=P?.at(-1)?.citationState,U=P?.at(-1)?.visibilityState,I=N?z==="lost"?"lost":z==="emerging"?"emerging":N.citationState==="cited"?"cited":"not-cited":F==="cited"?"cited":"not-cited",ae=N?.visibilityState??(U==="visible"?"visible":U==="pending"?"pending":"not-visible"),ve=gw(P||y.runs),me=YA(P||y.runs),G=UW(y,S),re=(P??y.runs).map(R=>({runId:R.runId,citationState:R.citationState,createdAt:R.createdAt,model:G.get(R.runId)??null,answerMentioned:R.answerMentioned,visibilityState:R.visibilityState,visibilityTransition:R.visibilityTransition})),ge=BW(re),Se=E==="provider"&&ge.length<=1?"model":E,B=qW(re);i.push({id:`evidence_${e}_${s++}`,keyword:y.keyword,provider:N?.provider??S,model:N?.model??null,location:N?.location??null,citationState:I,answerMentioned:N?.answerMentioned,visibilityState:ae,visibilityChangeLabel:WA(D,me,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:WA(z,ve),answerSnippet:N?.answerText??"",citedDomains:N?.citedDomains??[],evidenceUrls:[],competitorDomains:N?.competitorOverlap??[],recommendedCompetitors:N?.recommendedCompetitors??[],matchedTerms:N?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:N?.groundingSources??[],summary:FW(ae,D,y.keyword),runHistory:re,historyScope:Se,modelsSeen:ge,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 UW(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 BW(e){const t=new Set;for(const n of e)n.model&&t.add(n.model);return[...t]}function qW(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 gw(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 YA(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 WA(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?`${td(r.positive)} in latest run`:`${td(r.positive)} for ${t} runs`;case"lost":return"Lost since last run";case"emerging":return td(r.first);case"not-cited":case"not-visible":return t<=1?`${td(r.negative)} in latest run`:`${td(r.negative)} across ${t} runs`;default:return e}}function td(e){return e.charAt(0).toUpperCase()+e.slice(1)}function FW(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 QA(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 db=3;function KW(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=QA(r,s),m=QA(i,s);for(const C of s){const A=h.get(C)??new Set,k=m.get(C)??new Set,_=[...A].filter(T=>!k.has(T));_.length>0&&l.push({id:`insight_comp_gained_${C}`,tone:"negative",title:`${C} appeared on ${_.length} key phrase${_.length>1?"s":""}`,detail:"A tracked competitor gained new citations.",actionLabel:"Competitor",affectedPhrases:_.map(T=>{const P=t.find(E=>E.keyword===T);return{keyword:T,evidenceId:P?.id??"",citationState:"cited"}})})}const g=new Map;for(const C of n){const A=C.runs.at(-1);A&&g.set(C.keyword,{transition:A.transition,citationState:A.citationState})}const y=[],v=[],w=new Set;for(const[C,{transition:A,citationState:k}]of g){if(!(A==="emerging"||A==="new"&&k==="cited"))continue;w.add(C);const T=t.find(P=>P.keyword===C&&(P.citationState==="emerging"||P.citationState==="cited"));y.push({keyword:C,evidenceId:T?.id??"",provider:T?.provider,citationState:"emerging"})}for(const C of t)C.citationState==="emerging"&&(w.has(C.keyword)||v.push({keyword:C.keyword,evidenceId:C.id,provider:C.provider,citationState:"emerging"}));if(v.length>0){const C=new Set(v.map(A=>A.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:v})}y.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:y});const S=new Set(t.map(C=>C.keyword)),N=[];for(const C of n){if(!S.has(C.keyword)||C.runs.length<db||C.runs.at(-1)?.citationState!=="not-cited")continue;if(gw(C.runs)>=db){const _=t.find(T=>T.keyword===C.keyword);N.push({keyword:C.keyword,evidenceId:_?.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 ${db}+ 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 A=h.get(C)??new Set,_=[...m.get(C)??new Set].filter(T=>!A.has(T));_.length>0&&l.push({id:`insight_comp_lost_${C}`,tone:"neutral",title:`${C} dropped from ${_.length} key phrase${_.length>1?"s":""}`,detail:"A tracked competitor lost citations.",actionLabel:"Competitor",affectedPhrases:_.map(T=>{const P=t.find(E=>E.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 HW(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 m of f)m.citationState==="cited"&&m.keyword&&h.add(m.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 GW(e){const t=e[0];if(!t)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=t.status==="completed"?"Healthy":t.status==="running"?"Running":t.status==="queued"?"Queued":t.status==="partial"?"Partial":"Failed",r=t.status==="completed"?"positive":t.status==="failed"?"negative":t.status==="partial"?"caution":"neutral";return{label:"Run Status",value:n,delta:`${e.length} total runs`,tone:r,description:`Latest: ${CD(t.kind)} — ${t.status}`,tooltip:"Current execution state of visibility sweeps. Shows the status of the most recent run and total run count.",trend:[]}}function VW(e){const t=ND(e.project),n=$W(t.name,e.timeline,e.latestRunDetail,e.keywords),r=e.latestRunDetail?.snapshots??[],i=OD(r),s=RW(r),l=IW(e.gscCoverage,e.bingCoverage),c=kD(r,e.competitors.map(v=>v.domain)),f=KW({evidence:n,timeline:e.timeline,latestSnapshots:e.latestRunDetail?.snapshots??[],previousSnapshots:e.previousRunDetail?.snapshots??[],trackedCompetitors:e.competitors.map(v=>v.domain)}),h=[...e.runs].sort((v,w)=>w.createdAt.localeCompare(v.createdAt)),m=h.map(v=>u1(v,e.project.displayName||e.project.name)),g=new Map;for(const v of r){const w=v.provider||"gemini",S=v.model??null,N=`${w}::${S??"unknown"}`,C=g.get(N)??{provider:w,model:S,cited:0,total:0};C.total++,v.citationState==="cited"&&C.cited++,g.set(N,C)}const y=[...g.values()].sort((v,w)=>v.provider.localeCompare(w.provider)||(v.model??"").localeCompare(w.model??"")).map(({provider:v,model:w,cited:S,total:N})=>({provider:v,model:w,score:N>0?Math.round(S/N*100):0,cited:S,total:N}));return{project:t,dateRangeLabel:"All time",contextLabel:`${t.country} / ${t.language.toUpperCase()}`,visibilitySummary:{label:"Answer Visibility",value:r.length>0?`${i.score}`:"No data",delta:r.length>0?`${i.citedCount} of ${i.totalCount} key phrases visible`:"Run a sweep first",tone:r.length>0?PW(i.score):"neutral",description:r.length>0?`${i.citedCount} of ${i.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:[]},keywordCounts:{cited:i.citedCount,total:i.totalCount},gapKeyPhrases:s,indexCoverage:l,providerScores:y,competitorPressure:{label:"Competitor Pressure",value:c.label,delta:c.count>0?`${c.count} overlapping citations`:"No overlap detected",tone:zW(c.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:GW(h),movementSummary:HW(e.latestRunDetail?.snapshots??[],e.previousRunDetail?.snapshots??[]),insights:f,visibilityEvidence:n,competitors:e.competitors.map((v,w)=>{const S=new Set;for(const _ of r)(_.competitorOverlap.includes(v.domain)||_.citedDomains.includes(v.domain))&&_.keyword&&S.add(_.keyword);const N=[...S],C=new Set(r.map(_=>_.keyword).filter(Boolean)),A=C.size>0?N.length/C.size:0,k=A>=.5?"High":A>=.2?"Moderate":N.length>0?"Low":"None";return{id:v.id||`comp_${w}`,domain:v.domain,citationCount:N.length,totalKeywords:C.size,pressureLabel:k,citedKeywords:N,movement:"",notes:""}}),recentRuns:m.slice(0,5)}}function ZW(e){const t=ND(e.project),n=e.latestRunDetail?.snapshots??[],r=OD(n),i=kD(n,e.competitors.map(f=>f.domain)),l=[...e.runs].sort((f,h)=>h.createdAt.localeCompare(f.createdAt))[0],c=l?u1(l,e.project.displayName||e.project.name):{id:"none",projectId:e.project.id,projectName:e.project.displayName||e.project.name,kind:"answer-visibility",kindLabel:"No runs yet",status:"queued",trigger:"manual",createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""};return{project:t,visibilityScore:r.score,visibilityDelta:n.length>0?`${r.citedCount} of ${r.totalCount} key phrases`:"No data",lastRun:c,insight:n.length>0?`${r.citedCount} of ${r.totalCount} key phrases visible across ${new Set(n.map(f=>f.provider)).size} provider${new Set(n.map(f=>f.provider)).size>1?"s":""}.`:"No runs completed yet.",trend:[],competitorPressureLabel:i.label}}function YW(e,t){const n=[],r=[],i=[];for(const l of e){r.push(VW(l)),i.push(ZW(l));const c=[...l.runs].sort((f,h)=>h.createdAt.localeCompare(f.createdAt));for(const f of c)n.push(u1(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?WW(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 WW(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==="running"||s.status==="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 Vr={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"]},AD=x.createContext(null);AD.Provider;function ef(){return x.useContext(AD)}function il(e){const n=ef()?.dashboard??null,r=Eo({queryKey:Vr.projects.all,queryFn:SM,enabled:!n}),i=Eo({queryKey:Vr.runs.all,queryFn:NM,enabled:!n,refetchInterval:w=>w.state.data?.some(C=>C.status==="running"||C.status==="queued")?3e3:!1}),s=Eo({queryKey:Vr.settings,queryFn:()=>FS().catch(()=>null),enabled:!n}),l=r.data??[],c=i.data??[],f=hB({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,A)=>A.createdAt.localeCompare(C.createdAt));return{queryKey:Vr.projects.detail(w.id,N[0]?.id),queryFn:async()=>{const[C,A,k,_,T,P,E]=await Promise.all([bq(w.name).catch(()=>[]),CM(w.name).catch(()=>[]),_M(w.name).catch(()=>[]),N[0]?Oc(N[0].id).catch(()=>null):Promise.resolve(null),N[1]?Oc(N[1].id).catch(()=>null):Promise.resolve(null),KS(w.name).catch(()=>null),HS(w.name).catch(()=>null)]);return{project:w,runs:S,keywords:C,competitors:A,timeline:k,latestRunDetail:_,previousRunDetail:T,gscCoverage:P,bingCoverage:E}},enabled:!n&&r.isSuccess&&i.isSuccess}})}),h=f.every(w=>w.isSuccess),m=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 YW(w,s.data??null)},[n,r.data,i.data,s.data,h,f,l.length]),g=!n&&(r.isError||i.isError),y=!n&&!m&&!g,v=x.useCallback(async()=>{await Promise.all([r.refetch(),i.refetch(),s.refetch()])},[r.refetch,i.refetch,s.refetch]);return{dashboard:m,isLoading:y,isError:g,refetch:v}}function QW(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const XA=QW(),yw=XA==="/"?"":XA.replace(/\/$/,"");async function XW(){const e=yw?`${yw}/health`:"/health",t=await p9(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 Ng(e,t){return Eo({queryKey:Vr.health,queryFn:XW,enabled:e,refetchInterval:15e3,initialData:t})}function JW(e){return Eo({queryKey:Vr.runs.detail(e??""),queryFn:()=>Oc(e),enabled:!!e,refetchInterval:t=>{const n=t.state.data?.status;return n==="running"||n==="queued"?3e3:!1}})}function Kc(){const e=Ls(),t=cg({strict:!1}),n=fr({select:f=>f.location.pathname}),r=t.runId??null,i=t.evidenceId??null;return{runId:r,evidenceId:i,openRun:f=>e({to:n,from:yi.to,search:h=>({...h,runId:f,evidenceId:void 0})}),openEvidence:f=>e({to:n,from:yi.to,search:h=>({...h,evidenceId:f,runId:void 0})}),closeDrawer:()=>e({to:n,from:yi.to,search:f=>({...f,runId:void 0,evidenceId:void 0})})}}const eQ={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function tQ(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function nQ(){const e=x.useSyncExternalStore(x9,Zk,Zk),t=Ls(),{openRun:n}=Kc(),r=x.useCallback(s=>{aw(s)},[]),i=x.useCallback(s=>{s.cta&&(s.cta.intent==="open-run-drawer"?n(s.cta.runId):t({to:"/runs"}),aw(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 ${eQ[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":tQ(s),children:s.cta.label}):null]}),u.jsx("button",{type:"button",onClick:()=>r(s.id),className:"toast-dismiss","aria-label":"Dismiss",children:u.jsx(fg,{className:"size-3.5"})})]},s.id))})}const JA=[{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"}],eE=e=>({label:e,state:"checking",detail:"Checking service health"}),rQ={apiStatus:eE("API"),workerStatus:eE("Worker")};function iQ(e){return e==="gsc-sync"?"GSC sync":e==="inspect-sitemap"?"Sitemap inspection":"Visibility sweep"}function aQ(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function sQ(e){const t=iQ(e.kind);return e.status==="completed"?`${t} completed`:e.status==="partial"?`${t} completed with partial results`:e.status==="cancelled"?`${t} cancelled`:`${t} failed`}function oQ(e,t){return e.error?`${t}: ${e.error}`:e.location?`${t} · ${e.location}`:t}function lQ(e,t,n){if(t)return t;const r=n.find(i=>i.id===e);return r?.displayName||r?.name||e}function cQ(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 uQ(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function dQ(){const e=x.useSyncExternalStore(uF,qo,qo),t=Object.keys(e.runs).length>0||Object.keys(e.batches).length>0,n=Eo({queryKey:Vr.runs.all,queryFn:NM,enabled:t}),r=Eo({queryKey:Vr.projects.all,queryFn:SM,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(m=>[m.id,m])),h=Object.fromEntries(l.map(m=>[m.id,m.status]));for(const m of Object.values(e.runs)){const g=f[m.runId];if(!g||!hF(g.status)||(i.current[g.id]??m.lastAnnouncedStatus)===g.status)continue;if(m.sourceAction==="run-all"){eA(g.id);continue}const v=lQ(g.projectId,m.projectLabel,c);Xe({title:sQ(g),detail:oQ(g,v),tone:aQ(g.status),dedupeKey:`run:${g.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:g.id}}),eA(g.id)}for(const m of Object.values(e.batches)){const g=pF(m.runIds,f);g.finished&&(Xe({title:"Run-all batch finished",detail:cQ(g,m.skippedCount),tone:uQ(g),dedupeKey:`batch:${m.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),fF(m.batchId))}i.current=h},[r.data,n.data,e]),null}function fQ(){const e=ef(),{dashboard:t,isLoading:n,refetch:r}=il(),l=Ng(!e,e?.health).data??e?.health??rQ,c=mq(),{runId:f,evidenceId:h,closeDrawer:m}=Kc(),[g,y]=x.useState(!1),v=JW(f),w=v.data??null,S=v.isLoading;x.useEffect(()=>{w&&w.status!=="running"&&w.status!=="queued"&&r()},[w?.status,r]),x.useEffect(()=>{y(!1)},[c.pathname]),x.useEffect(()=>{if(typeof window>"u"||!f&&!h)return;const _=T=>{T.key==="Escape"&&m()};return window.addEventListener("keydown",_),()=>{window.removeEventListener("keydown",_)}},[f,h,m]);const N=t??e?.dashboard??null,C=f&&N?_W(N,f):void 0,A=h&&N?OW(N,h):void 0,k=(()=>{const _=c.pathname;if(_==="/")return"Portfolio";if(_==="/projects")return"Projects";if(_==="/runs")return"Runs";if(_==="/settings")return"Settings";if(_==="/setup")return"Setup";if(_.startsWith("/projects/")){const P=_.split("/").filter(Boolean)[1];if(P&&N){const E=N.projects.find(z=>z.project.id===P);if(E)return E.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(uA,{})}),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(R9,{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(z9,{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($9,{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(V9,{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(_=>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+_*15}%`}})]},_))]}):N&&N.projects.length>0?u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"sidebar-section-title",children:"Projects"}),N.projects.map(_=>{const T=_.visibilitySummary.tone;return u.jsxs(Rt,{to:"/projects/$projectId",params:{projectId:_.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:_.project.name})]},_.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(F9,{className:"sidebar-icon"}),u.jsx("span",{children:"Setup"})]})]})]}),u.jsx("div",{className:"sidebar-footer",children:JA.map(_=>u.jsx("a",{className:"sidebar-footer-link",href:_.href,target:"_blank",rel:"noreferrer",children:_.label},_.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(uA,{compact:!0})}),u.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[u.jsx(Rt,{to:"/",children:"Home"}),u.jsx(dg,{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(pe,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":g,"aria-controls":"mobile-nav",onClick:()=>y(_=>!_),children:[u.jsx(L9,{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(pe,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>y(!1),children:[u.jsx(fg,{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(_=>u.jsx(Rt,{to:"/projects/$projectId",params:{projectId:_.project.id},className:"mobile-nav-link",children:_.project.name},_.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(_=>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"})]},_))}),u.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(_=>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))})]},_))})]}):u.jsx(qS,{})}),u.jsxs("footer",{className:"footer",children:[u.jsxs("a",{href:"https://github.com/AINYC/canonry",target:"_blank",rel:"noreferrer",className:"footer-brand",children:[u.jsx(T9,{className:"size-3.5"}),u.jsx("span",{children:"Canonry"})]}),u.jsx("div",{className:"footer-links",children:JA.map(_=>u.jsx("a",{href:_.href,target:"_blank",rel:"noreferrer",children:_.label},_.href))})]})]}),C?u.jsxs(t7,{open:C!==void 0,title:C.summary,subtitle:`${C.projectName} · ${C.kindLabel}`,onClose:m,children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[u.jsx(gg,{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(_=>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:_.keyword??"Unknown key phrase"}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx(Ad,{provider:_.provider}),u.jsx(nR,{variant:_.citationState==="cited"?"success":"neutral",children:_.citationState})]})]}),_.model&&u.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:_.model}),_.citedDomains.length>0&&u.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[u.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",_.citedDomains.join(", ")]}),_.competitorOverlap.length>0&&u.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",_.competitorOverlap.join(", ")]}),_.groundingSources&&_.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:[_.groundingSources.length," grounding source",_.groundingSources.length!==1?"s":""]}),u.jsx("ul",{className:"mt-1 space-y-0.5",children:_.groundingSources.map((T,P)=>u.jsx("li",{className:"text-xs text-zinc-500 truncate",children:u.jsx("a",{href:T.uri,target:"_blank",rel:"noreferrer",className:"hover:text-zinc-300",children:T.title||T.uri})},P))})]}),_.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:_.answerText})]})]},_.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:rF(w.error)})]}):u.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,A?u.jsx(bW,{evidence:A.evidence,project:A.project,onClose:m}):null,u.jsx(dQ,{}),u.jsx(nQ,{})]})}class hQ 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(Q9,{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(pe,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[u.jsx(H9,{className:"size-3.5 mr-1.5"}),"Try again"]}),u.jsx(pe,{variant:"secondary",size:"sm",onClick:()=>{window.location.href="/"},children:"Go home"})]})]})}):this.props.children}}const Ue=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ti("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}));Ue.displayName="Card";const vw=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ti("flex flex-col gap-1.5 p-5",e),...t}));vw.displayName="CardHeader";const bw=x.forwardRef(({className:e,...t},n)=>u.jsx("h3",{ref:n,className:ti("font-medium tracking-tight text-zinc-50",e),...t}));bw.displayName="CardTitle";const xw=x.forwardRef(({className:e,...t},n)=>u.jsx("p",{ref:n,className:ti("text-sm text-zinc-500",e),...t}));xw.displayName="CardDescription";const zp=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ti("p-5 pt-0",e),...t}));zp.displayName="CardContent";function pQ({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,m=r-s*2,g=e.map((y,v)=>{const w=s+v/Math.max(e.length-1,1)*h,S=s+(1-(y-l)/f)*m;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:m,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 mQ(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function gQ(e,t,n){return e.map(r=>{if(r.id==="api")return{...r,tone:nm(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(r.id==="worker")return{...r,tone:nm(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=>mQ(f)).join(" · ");return{...r,label:"Providers",tone:l?"positive":"caution",detail:`${i} of ${s} configured`,meta:c||"None configured"}})}function yQ(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 vQ(e,t,n){const r=yQ(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 bQ({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",children:e.visibilityScore}),u.jsx("p",{className:"metric-inline-delta",children:e.visibilityDelta})]})}),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," · ",hg(e.lastRun.status)]})]})}),u.jsx("div",{className:"project-row-chart",children:u.jsx(pQ,{points:e.trend,tone:rR(e.lastRun.status)})}),u.jsx("span",{className:"project-row-link",children:u.jsx(dg,{className:"h-4 w-4 text-zinc-500"})})]})}function xQ(){const e=ef(),{dashboard:t,isLoading:n}=il(),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(m=>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"})]},m))})]});const i=r.portfolioOverview,c=Ng(!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=gQ(i.systemHealth,c,r.settings),{openRun:h}=Kc();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(m=>u.jsx(bQ,{project:m},m.project.id))}):u.jsxs(Ue,{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(pe,{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(m=>u.jsxs(Rt,{to:m.href,className:`attention-item attention-item-${m.tone}`,children:[u.jsxs("div",{children:[u.jsx("p",{className:"attention-title",children:m.title}),u.jsx("p",{className:"attention-detail",children:m.detail})]}),u.jsx("span",{className:"attention-action",children:m.actionLabel})]},m.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(m=>u.jsxs("button",{className:"compact-run",type:"button",onClick:()=>h(m.id),children:[u.jsxs("div",{children:[u.jsx("p",{className:"compact-run-title",children:m.projectName}),u.jsx("p",{className:"compact-run-detail",children:m.summary})]}),u.jsx(gg,{status:m.status})]},m.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(m=>u.jsxs(Ue,{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:m.label}),u.jsx("h3",{children:m.detail})]}),u.jsx(yt,{tone:m.tone,children:m.label})]}),u.jsx("p",{className:"supporting-copy",children:m.meta})]},m.id))})]})]})}const d1=Symbol.for("yaml.alias"),ww=Symbol.for("yaml.document"),_s=Symbol.for("yaml.map"),ED=Symbol.for("yaml.pair"),qi=Symbol.for("yaml.scalar"),Hc=Symbol.for("yaml.seq"),Qr=Symbol.for("yaml.node.type"),al=e=>!!e&&typeof e=="object"&&e[Qr]===d1,Cg=e=>!!e&&typeof e=="object"&&e[Qr]===ww,tf=e=>!!e&&typeof e=="object"&&e[Qr]===_s,nn=e=>!!e&&typeof e=="object"&&e[Qr]===ED,kt=e=>!!e&&typeof e=="object"&&e[Qr]===qi,nf=e=>!!e&&typeof e=="object"&&e[Qr]===Hc;function en(e){if(e&&typeof e=="object")switch(e[Qr]){case _s:case Hc:return!0}return!1}function tn(e){if(e&&typeof e=="object")switch(e[Qr]){case d1:case _s:case qi:case Hc:return!0}return!1}const TD=e=>(kt(e)||en(e))&&!!e.anchor,yo=Symbol("break visit"),wQ=Symbol("skip children"),xd=Symbol("remove node");function Gc(e,t){const n=SQ(t);Cg(e)?hc(null,e.contents,n,Object.freeze([e]))===xd&&(e.contents=null):hc(null,e,n,Object.freeze([]))}Gc.BREAK=yo;Gc.SKIP=wQ;Gc.REMOVE=xd;function hc(e,t,n,r){const i=jQ(e,t,n,r);if(tn(i)||nn(i))return NQ(e,r,i),hc(e,i,n,r);if(typeof i!="symbol"){if(en(t)){r=Object.freeze(r.concat(t));for(let s=0;s<t.items.length;++s){const l=hc(s,t.items[s],n,r);if(typeof l=="number")s=l-1;else{if(l===yo)return yo;l===xd&&(t.items.splice(s,1),s-=1)}}}else if(nn(t)){r=Object.freeze(r.concat(t));const s=hc("key",t.key,n,r);if(s===yo)return yo;s===xd&&(t.key=null);const l=hc("value",t.value,n,r);if(l===yo)return yo;l===xd&&(t.value=null)}}return i}function SQ(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 jQ(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(tf(t))return n.Map?.(e,t,r);if(nf(t))return n.Seq?.(e,t,r);if(nn(t))return n.Pair?.(e,t,r);if(kt(t))return n.Scalar?.(e,t,r);if(al(t))return n.Alias?.(e,t,r)}function NQ(e,t,n){const r=t[t.length-1];if(en(r))r.items[e]=n;else if(nn(r))e==="key"?r.key=n:r.value=n;else if(Cg(r))r.contents=n;else{const i=al(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const CQ={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},_Q=e=>e.replace(/[!,[\]{}]/g,t=>CQ[t]);class Zn{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Zn.defaultYaml,t),this.tags=Object.assign({},Zn.defaultTags,n)}clone(){const t=new Zn(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Zn(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Zn.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Zn.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Zn.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Zn.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+_Q(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&&tn(t.contents)){const s={};Gc(t.contents,(l,c)=>{tn(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
+ `)}}Zn.defaultYaml={explicit:!1,version:"1.2"};Zn.defaultTags={"!!":"tag:yaml.org,2002:"};function PD(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 zD(e){const t=new Set;return Gc(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function MD(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function OQ(e,t){const n=[],r=new Map;let i=null;return{onAnchor:s=>{n.push(s),i??(i=zD(e));const l=MD(t,i);return i.add(l),l},setAnchors:()=>{for(const s of n){const l=r.get(s);if(typeof l=="object"&&l.anchor&&(kt(l.node)||en(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 pc(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=pc(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=pc(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=pc(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=pc(e,r,i,s);l===void 0?delete r[i]:l!==s&&(r[i]=l)}return e.call(t,n,r)}function Wr(e,t,n){if(Array.isArray(e))return e.map((r,i)=>Wr(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!TD(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 f1{constructor(t){Object.defineProperty(this,Qr,{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(!Cg(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=Wr(this,"",l);if(typeof i=="function")for(const{count:f,res:h}of l.anchors.values())i(h,f);return typeof s=="function"?pc(s,{"":c},"",c):c}}class h1 extends f1{constructor(t){super(d1),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=[],Gc(t,{Node:(s,l)=>{(al(l)||TD(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||(Wr(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=Mp(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(PD(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 Mp(e,t,n){if(al(t)){const r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(en(t)){let r=0;for(const i of t.items){const s=Mp(e,i,n);s>r&&(r=s)}return r}else if(nn(t)){const r=Mp(e,t.key,n),i=Mp(e,t.value,n);return Math.max(r,i)}return 1}const RD=e=>!e||typeof e!="function"&&typeof e!="object";class Be extends f1{constructor(t){super(qi),this.value=t}toJSON(t,n){return n?.keep?this.value:Wr(this.value,t,n)}toString(){return String(this.value)}}Be.BLOCK_FOLDED="BLOCK_FOLDED";Be.BLOCK_LITERAL="BLOCK_LITERAL";Be.PLAIN="PLAIN";Be.QUOTE_DOUBLE="QUOTE_DOUBLE";Be.QUOTE_SINGLE="QUOTE_SINGLE";const kQ="tag:yaml.org,2002:";function AQ(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 Md(e,t,n){if(Cg(e)&&(e=e.contents),tn(e))return e;if(nn(e)){const g=n.schema[_s].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 h1(f.anchor);f={anchor:null,node:null},c.set(e,f)}t?.startsWith("!!")&&(t=kQ+t.slice(2));let h=AQ(e,t,l.tags);if(!h){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const g=new Be(e);return f&&(f.node=g),g}h=e instanceof Map?l[_s]:Symbol.iterator in Object(e)?l[Hc]:l[_s]}s&&(s(h),delete n.onTagObj);const m=h?.createNode?h.createNode(n.schema,e,n):typeof h?.nodeClass?.from=="function"?h.nodeClass.from(n.schema,e,n):new Be(e);return t?m.tag=t:h.default||(m.tag=h.tag),f&&(f.node=m),m}function cm(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 Md(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 pd=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class DD extends f1{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=>tn(r)||nn(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(pd(t))this.add(n);else{const[r,...i]=t,s=this.get(r,!0);if(en(s))s.addIn(i,n);else if(s===void 0&&this.schema)this.set(r,cm(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(en(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&&kt(s)?s.value:s:en(s)?s.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!nn(n))return!1;const r=n.value;return r==null||t&&kt(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 en(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(en(s))s.setIn(i,n);else if(s===void 0&&this.schema)this.set(r,cm(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}}const EQ=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function xa(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Co=(e,t,n)=>e.endsWith(`
97
+ `)?xa(n,t):n.includes(`
98
+ `)?`
99
+ `+xa(n,t):(e.endsWith(" ")?"":" ")+n,LD="flow",Sw="block",Rp="quoted";function _g(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=[],m={};let g=i-t.length;typeof r=="number"&&(r>i-Math.max(2,s)?h.push(0):g=i-r);let y,v,w=!1,S=-1,N=-1,C=-1;n===Sw&&(S=tE(e,S,t.length),S!==-1&&(g=S+f));for(let k;k=e[S+=1];){if(n===Rp&&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===Sw&&(S=tE(e,S,t.length)),g=S+t.length+f,y=void 0;else{if(k===" "&&v&&v!==" "&&v!==`
101
+ `&&v!==" "){const _=e[S+1];_&&_!==" "&&_!==`
102
+ `&&_!==" "&&(y=S)}if(S>=g)if(y)h.push(y),g=y+f,y=void 0;else if(n===Rp){for(;v===" "||v===" ";)v=k,k=e[S+=1],w=!0;const _=S>C+1?S-2:N-1;if(m[_])return e;h.push(_),m[_]=!0,g=_+f,y=void 0}else w=!0}v=k}if(w&&c&&c(),h.length===0)return e;l&&l();let A=e.slice(0,h[0]);for(let k=0;k<h.length;++k){const _=h[k],T=h[k+1]||e.length;_===0?A=`
103
+ ${t}${e.slice(0,T)}`:(n===Rp&&m[_]&&(A+=`${e[_]}\\`),A+=`
104
+ ${t}${e.slice(_+1,T)}`)}return A}function tE(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 Og=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),kg=e=>/^(%|---|\.\.\.)/m.test(e);function TQ(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 wd(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 m=n.substr(f+2,4);switch(m){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:m.substr(0,2)==="00"?l+="\\x"+m.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:_g(l,s,Rp,Og(t,!1))}function jw(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
110
+ `)||/[ \t]\n|\n[ \t]/.test(e))return wd(e,t);const n=t.indent||(kg(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
111
+ ${n}`)+"'";return t.implicitKey?r:_g(r,n,LD,Og(t,!1))}function mc(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=wd;else{const i=e.includes('"'),s=e.includes("'");i&&!s?r=jw:s&&!i?r=wd:r=n?jw:wd}return r(e,t)}let Nw;try{Nw=new RegExp(`(^|(?<!
112
+ ))
113
+ +(?!
114
+ |$)`,"g")}catch{Nw=/\n+(?!\n|$)/g}function Dp({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 mc(n,r);const h=r.indent||(r.forceBlockIndent||kg(n)?" ":""),m=l==="literal"?!0:l==="folded"||t===Be.BLOCK_FOLDED?!1:t===Be.BLOCK_LITERAL?!0:!TQ(n,f,h.length);if(!n)return m?`|
115
+ `:`>
116
+ `;let g,y;for(y=n.length;y>0;--y){const T=n[y-1];if(T!==`
117
+ `&&T!==" "&&T!==" ")break}let v=n.substring(y);const w=v.indexOf(`
118
+ `);w===-1?g="-":n===v||w!==v.length-1?(g="+",s&&s()):g="",v&&(n=n.slice(0,-v.length),v[v.length-1]===`
119
+ `&&(v=v.slice(0,-1)),v=v.replace(Nw,`$&${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 A=n.substring(0,C<N?C+1:N);A&&(n=n.substring(A.length),A=A.replace(/\n+/g,`$&${h}`));let _=(S?h?"2":"1":"")+g;if(e&&(_+=" "+c(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!m){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 E=Og(r,!0);l!=="folded"&&t!==Be.BLOCK_FOLDED&&(E.onOverflow=()=>{P=!0});const z=_g(`${A}${T}${v}`,h,Sw,E);if(!P)return`>${_}
122
+ ${h}${z}`}return n=n.replace(/\n+/g,`$&${h}`),`|${_}
123
+ ${h}${A}${n}${v}`}function PQ(e,t,n,r){const{type:i,value:s}=e,{actualString:l,implicitKey:c,indent:f,indentStep:h,inFlow:m}=t;if(c&&s.includes(`
124
+ `)||m&&/[[\]{},]/.test(s))return mc(s,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return c||m||!s.includes(`
125
+ `)?mc(s,t):Dp(e,t,n,r);if(!c&&!m&&i!==Be.PLAIN&&s.includes(`
126
+ `))return Dp(e,t,n,r);if(kg(s)){if(f==="")return t.forceBlockIndent=!0,Dp(e,t,n,r);if(c&&f===h)return mc(s,t)}const g=s.replace(/\n+/g,`$&
127
+ ${f}`);if(l){const y=S=>S.default&&S.tag!=="tag:yaml.org,2002:str"&&S.test?.test(g),{compat:v,tags:w}=t.doc.schema;if(w.some(y)||v?.some(y))return mc(s,t)}return c?g:_g(g,f,LD,Og(t,!1))}function p1(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!==Be.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(l.value)&&(c=Be.QUOTE_DOUBLE);const f=m=>{switch(m){case Be.BLOCK_FOLDED:case Be.BLOCK_LITERAL:return i||s?mc(l.value,t):Dp(l,t,n,r);case Be.QUOTE_DOUBLE:return wd(l.value,t);case Be.QUOTE_SINGLE:return jw(l.value,t);case Be.PLAIN:return PQ(l,t,n,r);default:return null}};let h=f(c);if(h===null){const{defaultKeyType:m,defaultStringType:g}=t.options,y=i&&m||g;if(h=f(y),h===null)throw new Error(`Unsupported default string type ${y}`)}return h}function ID(e,t){const n=Object.assign({blockQuote:!0,commentString:EQ,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 zQ(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(kt(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 MQ(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],s=(kt(e)||en(e))&&e.anchor;s&&PD(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 Ec(e,t,n,r){if(nn(e))return e.toString(t,n,r);if(al(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=tn(e)?e:t.doc.createNode(e,{onTagObj:f=>i=f});i??(i=zQ(t.doc.schema.tags,s));const l=MQ(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):kt(s)?p1(s,t,n,r):s.toString(t,n,r);return l?kt(s)||c[0]==="{"||c[0]==="["?`${l} ${c}`:`${l}
128
+ ${t.indent}${c}`:c}function RQ({key:e,value:t},n,r,i){const{allNullValues:s,doc:l,indent:c,indentStep:f,options:{commentString:h,indentSeq:m,simpleKeys:g}}=n;let y=tn(e)&&e.comment||null;if(g){if(y)throw new Error("With simple keys, key nodes cannot have comments");if(en(e)||!tn(e)&&typeof e=="object"){const E="With simple keys, collection cannot be used as a key value";throw new Error(E)}}let v=!g&&(!e||y&&t==null&&!n.inFlow||en(e)||(kt(e)?e.type===Be.BLOCK_FOLDED||e.type===Be.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!v&&(g||!s),indent:c+f});let w=!1,S=!1,N=Ec(e,n,()=>w=!0,()=>S=!0);if(!v&&!n.inFlow&&N.length>1024){if(g)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(n.inFlow){if(s||t==null)return w&&r&&r(),N===""?"?":v?`? ${N}`:N}else if(s&&!g||t==null&&v)return N=`? ${N}`,y&&!w?N+=Co(N,n.indent,h(y)):S&&i&&i(),N;w&&(y=null),v?(y&&(N+=Co(N,n.indent,h(y))),N=`? ${N}
129
+ ${c}:`):(N=`${N}:`,y&&(N+=Co(N,n.indent,h(y))));let C,A,k;tn(t)?(C=!!t.spaceBefore,A=t.commentBefore,k=t.comment):(C=!1,A=null,k=null,t&&typeof t=="object"&&(t=l.createNode(t))),n.implicitKey=!1,!v&&!y&&kt(t)&&(n.indentAtStart=N.length+1),S=!1,!m&&f.length>=2&&!n.inFlow&&!v&&nf(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let _=!1;const T=Ec(t,n,()=>_=!0,()=>S=!0);let P=" ";if(y||C||A){if(P=C?`
130
+ `:"",A){const E=h(A);P+=`
131
+ ${xa(E,n.indent)}`}T===""&&!n.inFlow?P===`
132
+ `&&k&&(P=`
133
+
134
+ `):P+=`
135
+ ${n.indent}`}else if(!v&&en(t)){const E=T[0],z=T.indexOf(`
136
+ `),D=z!==-1,F=n.inFlow??t.flow??t.items.length===0;if(D||!F){let U=!1;if(D&&(E==="&"||E==="!")){let I=T.indexOf(" ");E==="&"&&I!==-1&&I<z&&T[I+1]==="!"&&(I=T.indexOf(" ",I+1)),(I===-1||z<I)&&(U=!0)}U||(P=`
137
+ ${n.indent}`)}}else(T===""||T[0]===`
138
+ `)&&(P="");return N+=P+T,n.inFlow?_&&r&&r():k&&!_?N+=Co(N,n.indent,h(k)):S&&i&&i(),N}function DQ(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const np="<<",ja={identify:e=>e===np||typeof e=="symbol"&&e.description===np,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Be(Symbol(np)),{addToJSMap:$D}),stringify:()=>np},LQ=(e,t)=>(ja.identify(t)||kt(t)&&(!t.type||t.type===Be.PLAIN)&&ja.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===ja.tag&&n.default);function $D(e,t,n){if(n=e&&al(n)?n.resolve(e.doc):n,nf(n))for(const r of n.items)fb(e,t,r);else if(Array.isArray(n))for(const r of n)fb(e,t,r);else fb(e,t,n)}function fb(e,t,n){const r=e&&al(n)?n.resolve(e.doc):n;if(!tf(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 UD(e,t,{key:n,value:r}){if(tn(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(LQ(e,n))$D(e,t,r);else{const i=Wr(n,"",e);if(t instanceof Map)t.set(i,Wr(r,i,e));else if(t instanceof Set)t.add(i);else{const s=IQ(n,i,e),l=Wr(r,s,e);s in t?Object.defineProperty(t,s,{value:l,writable:!0,enumerable:!0,configurable:!0}):t[s]=l}}return t}function IQ(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(tn(e)&&n?.doc){const r=ID(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)+'..."'),DQ(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 m1(e,t,n){const r=Md(e,void 0,n),i=Md(t,void 0,n);return new Xn(r,i)}class Xn{constructor(t,n=null){Object.defineProperty(this,Qr,{value:ED}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return tn(n)&&(n=n.clone(t)),tn(r)&&(r=r.clone(t)),new Xn(n,r)}toJSON(t,n){const r=n?.mapAsMap?new Map:{};return UD(n,r,this)}toString(t,n,r){return t?.doc?RQ(this,t,n,r):JSON.stringify(this)}}function BD(e,t,n){return(t.inFlow??e.flow?UQ:$Q)(e,t,n)}function $Q({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:s,onChompKeep:l,onComment:c}){const{indent:f,options:{commentString:h}}=n,m=Object.assign({},n,{indent:s,type:null});let g=!1;const y=[];for(let w=0;w<t.length;++w){const S=t[w];let N=null;if(tn(S))!g&&S.spaceBefore&&y.push(""),um(n,y,S.commentBefore,g),S.comment&&(N=S.comment);else if(nn(S)){const A=tn(S.key)?S.key:null;A&&(!g&&A.spaceBefore&&y.push(""),um(n,y,A.commentBefore,g))}g=!1;let C=Ec(S,m,()=>N=null,()=>g=!0);N&&(C+=Co(C,s,h(N))),g&&N&&(g=!1),y.push(r+C)}let v;if(y.length===0)v=i.start+i.end;else{v=y[0];for(let w=1;w<y.length;++w){const S=y[w];v+=S?`
139
+ ${f}${S}`:`
140
+ `}}return e?(v+=`
141
+ `+xa(h(e),f),c&&c()):g&&l&&l(),v}function UQ({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,m=0;const g=[];for(let w=0;w<e.length;++w){const S=e[w];let N=null;if(tn(S))S.spaceBefore&&g.push(""),um(t,g,S.commentBefore,!1),S.comment&&(N=S.comment);else if(nn(S)){const A=tn(S.key)?S.key:null;A&&(A.spaceBefore&&g.push(""),um(t,g,A.commentBefore,!1),A.comment&&(h=!0));const k=tn(S.value)?S.value:null;k?(k.comment&&(N=k.comment),k.commentBefore&&(h=!0)):S.value==null&&A?.comment&&(N=A.comment)}N&&(h=!0);let C=Ec(S,f,()=>N=null);w<e.length-1&&(C+=","),N&&(C+=Co(C,r,c(N))),!h&&(g.length>m||C.includes(`
142
+ `))&&(h=!0),g.push(C),m=g.length}const{start:y,end:v}=n;if(g.length===0)return y+v;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=y;for(const S of g)w+=S?`
143
+ ${s}${i}${S}`:`
144
+ `;return`${w}
145
+ ${i}${v}`}else return`${y}${l}${g.join(" ")}${l}${v}`}function um({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const s=xa(t(r),e);n.push(s.trimStart())}}function _o(e,t){const n=kt(t)?t.value:t;for(const r of e)if(nn(r)&&(r.key===t||r.key===n||kt(r.key)&&r.key.value===n))return r}class Gr extends DD{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(_s,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(m1(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;nn(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Xn(t,t?.value):r=new Xn(t.key,t.value);const i=_o(this.items,r.key),s=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);kt(i.value)&&RD(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=_o(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=_o(this.items,t)?.value;return(!n&&kt(i)?i.value:i)??void 0}has(t){return!!_o(this.items,t)}set(t,n){this.add(new Xn(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)UD(n,i,s);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(const i of this.items)if(!nn(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})),BD(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const Vc={collection:"map",default:!0,nodeClass:Gr,tag:"tag:yaml.org,2002:map",resolve(e,t){return tf(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Gr.from(e,t,n)};class Ko extends DD{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Hc,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=rp(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=rp(t);if(typeof r!="number")return;const i=this.items[r];return!n&&kt(i)?i.value:i}has(t){const n=rp(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=rp(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const i=this.items[r];kt(i)&&RD(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(Wr(s,String(i++),n));return r}toString(t,n,r){return t?BD(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(Md(c,void 0,r))}}return s}}function rp(e){let t=kt(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const Zc={collection:"seq",default:!0,nodeClass:Ko,tag:"tag:yaml.org,2002:seq",resolve(e,t){return nf(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Ko.from(e,t,n)},Ag={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),p1(e,t,n,r)}},Eg={identify:e=>e==null,createNode:()=>new Be(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Be(null),stringify:({source:e},t)=>typeof e=="string"&&Eg.test.test(e)?e:t.options.nullStr},g1={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Be(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&g1.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 xi({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 qD={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:xi},FD={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():xi(e)}},KD={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 Be(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:xi},Tg=e=>typeof e=="bigint"||Number.isInteger(e),y1=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function HD(e,t,n){const{value:r}=e;return Tg(r)&&r>=0?n+r.toString(t):xi(e)}const GD={identify:e=>Tg(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>y1(e,2,8,n),stringify:e=>HD(e,8,"0o")},VD={identify:Tg,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>y1(e,0,10,n),stringify:xi},ZD={identify:e=>Tg(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>y1(e,2,16,n),stringify:e=>HD(e,16,"0x")},BQ=[Vc,Zc,Ag,Eg,g1,GD,VD,ZD,qD,FD,KD];function nE(e){return typeof e=="bigint"||Number.isInteger(e)}const ip=({value:e})=>JSON.stringify(e),qQ=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:ip},{identify:e=>e==null,createNode:()=>new Be(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:ip},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:ip},{identify:nE,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})=>nE(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:ip}],FQ={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},KQ=[Vc,Zc].concat(qQ,FQ),v1={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=Be.BLOCK_LITERAL),t!==Be.QUOTE_DOUBLE){const f=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),h=Math.ceil(c.length/f),m=new Array(h);for(let g=0,y=0;g<h;++g,y+=f)m[g]=c.substr(y,f);c=m.join(t===Be.BLOCK_LITERAL?`
146
+ `:" ")}return p1({comment:e,type:t,value:c},r,i,s)}};function YD(e,t){if(nf(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!nn(r)){if(tf(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const i=r.items[0]||new Xn(new Be(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]=nn(r)?r:new Xn(r)}}else t("Expected a sequence for this tag");return e}function WD(e,t,n){const{replacer:r}=n,i=new Ko(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(m1(c,f,n))}return i}const b1={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:YD,createNode:WD};class wc extends Ko{constructor(){super(),this.add=Gr.prototype.add.bind(this),this.delete=Gr.prototype.delete.bind(this),this.get=Gr.prototype.get.bind(this),this.has=Gr.prototype.has.bind(this),this.set=Gr.prototype.set.bind(this),this.tag=wc.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(nn(i)?(s=Wr(i.key,"",n),l=Wr(i.value,s,n)):s=Wr(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=WD(t,n,r),s=new this;return s.items=i.items,s}}wc.tag="tag:yaml.org,2002:omap";const x1={collection:"seq",identify:e=>e instanceof Map,nodeClass:wc,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=YD(e,t),r=[];for(const{key:i}of n.items)kt(i)&&(r.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new wc,n)},createNode:(e,t,n)=>wc.from(e,t,n)};function QD({value:e,source:t},n){return t&&(e?XD:JD).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const XD={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 Be(!0),stringify:QD},JD={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 Be(!1),stringify:QD},HQ={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:xi},GQ={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():xi(e)}},VQ={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 Be(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:xi},rf=e=>typeof e=="bigint"||Number.isInteger(e);function Pg(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 w1(e,t,n){const{value:r}=e;if(rf(r)){const i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return xi(e)}const ZQ={identify:rf,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Pg(e,2,2,n),stringify:e=>w1(e,2,"0b")},YQ={identify:rf,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Pg(e,1,8,n),stringify:e=>w1(e,8,"0")},WQ={identify:rf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Pg(e,0,10,n),stringify:xi},QQ={identify:rf,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Pg(e,2,16,n),stringify:e=>w1(e,16,"0x")};class Sc extends Gr{constructor(t){super(t),this.tag=Sc.tag}add(t){let n;nn(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Xn(t.key,null):n=new Xn(t,null),_o(this.items,n.key)||this.items.push(n)}get(t,n){const r=_o(this.items,t);return!n&&nn(r)?kt(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=_o(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Xn(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(m1(l,null,r));return s}}Sc.tag="tag:yaml.org,2002:set";const S1={collection:"map",identify:e=>e instanceof Set,nodeClass:Sc,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Sc.from(e,t,n),resolve(e,t){if(tf(e)){if(e.hasAllNullValues(!0))return Object.assign(new Sc,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function j1(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 eL(e){let{value:t}=e,n=l=>l;if(typeof t=="bigint")n=l=>BigInt(l);else if(isNaN(t)||!isFinite(t))return xi(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 tL={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})=>j1(e,n),stringify:eL},nL={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=>j1(e,!1),stringify:eL},zg={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(zg.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 m=t[8];if(m&&m!=="Z"){let g=j1(m,!1);Math.abs(g)<30&&(g*=60),h-=6e4*g}return new Date(h)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},rE=[Vc,Zc,Ag,Eg,XD,JD,ZQ,YQ,WQ,QQ,HQ,GQ,VQ,v1,ja,x1,b1,S1,tL,nL,zg],iE=new Map([["core",BQ],["failsafe",[Vc,Zc,Ag]],["json",KQ],["yaml11",rE],["yaml-1.1",rE]]),aE={binary:v1,bool:g1,float:KD,floatExp:FD,floatNaN:qD,floatTime:nL,int:VD,intHex:ZD,intOct:GD,intTime:tL,map:Vc,merge:ja,null:Eg,omap:x1,pairs:b1,seq:Zc,set:S1,timestamp:zg},XQ={"tag:yaml.org,2002:binary":v1,"tag:yaml.org,2002:merge":ja,"tag:yaml.org,2002:omap":x1,"tag:yaml.org,2002:pairs":b1,"tag:yaml.org,2002:set":S1,"tag:yaml.org,2002:timestamp":zg};function hb(e,t,n){const r=iE.get(t);if(r&&!e)return n&&!r.includes(ja)?r.concat(ja):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{const s=Array.from(iE.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(ja)),i.reduce((s,l)=>{const c=typeof l=="string"?aE[l]:l;if(!c){const f=JSON.stringify(l),h=Object.keys(aE).map(m=>JSON.stringify(m)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${h}`)}return s.includes(c)||s.push(c),s},[])}const JQ=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class N1{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:s,sortMapEntries:l,toStringDefaults:c}){this.compat=Array.isArray(t)?hb(t,"compat"):t?hb(null,t):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?XQ:{},this.tags=hb(n,this.name,r),this.toStringOptions=c??null,Object.defineProperty(this,_s,{value:Vc}),Object.defineProperty(this,qi,{value:Ag}),Object.defineProperty(this,Hc,{value:Zc}),this.sortMapEntries=typeof l=="function"?l:l===!0?JQ:null}clone(){const t=Object.create(N1.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function eX(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=ID(e,t),{commentString:s}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const f=s(e.commentBefore);n.unshift(xa(f,""))}let l=!1,c=null;if(e.contents){if(tn(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const m=s(e.contents.commentBefore);n.push(xa(m,""))}i.forceBlockIndent=!!e.comment,c=e.contents.comment}const f=c?void 0:()=>l=!0;let h=Ec(e.contents,i,()=>c=null,f);c&&(h+=Co(h,"",s(c))),(h[0]==="|"||h[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${h}`:n.push(h)}else n.push(Ec(e.contents,i));if(e.directives?.docEnd)if(e.comment){const f=s(e.comment);f.includes(`
149
+ `)?(n.push("..."),n.push(xa(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(xa(s(f),"")))}return n.join(`
150
+ `)+`
151
+ `}class Mg{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Qr,{value:ww});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 Zn({version:l}),this.setSchema(l,r),this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){const t=Object.create(Mg.prototype,{[Qr]:{value:ww}});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=tn(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Jl(this.contents)&&this.contents.add(t)}addIn(t,n){Jl(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=zD(this);t.anchor=!n||r.has(n)?MD(n||"a",r):n}return new h1(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=A=>typeof A=="number"||A instanceof String||A 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:m}=r??{},{onAnchor:g,setAnchors:y,sourceObjects:v}=OQ(this,l||"a"),w={aliasDuplicateObjects:s??!0,keepUndefined:f??!1,onAnchor:g,onTagObj:h,replacer:i,schema:this.schema,sourceObjects:v},S=Md(t,m,w);return c&&en(S)&&(S.flow=!0),y(),S}createPair(t,n,r={}){const i=this.createNode(t,null,r),s=this.createNode(n,null,r);return new Xn(i,s)}delete(t){return Jl(this.contents)?this.contents.delete(t):!1}deleteIn(t){return pd(t)?this.contents==null?!1:(this.contents=null,!0):Jl(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return en(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return pd(t)?!n&&kt(this.contents)?this.contents.value:this.contents:en(this.contents)?this.contents.getIn(t,n):void 0}has(t){return en(this.contents)?this.contents.has(t):!1}hasIn(t){return pd(t)?this.contents!==void 0:en(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=cm(this.schema,[t],n):Jl(this.contents)&&this.contents.set(t,n)}setIn(t,n){pd(t)?this.contents=n:this.contents==null?this.contents=cm(this.schema,Array.from(t),n):Jl(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 Zn({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 Zn({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 N1(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=Wr(this.contents,n??"",c);if(typeof s=="function")for(const{count:h,res:m}of c.anchors.values())s(m,h);return typeof l=="function"?pc(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 eX(this,t)}}function Jl(e){if(en(e))return!0;throw new Error("Expected a YAML collection as document contents")}class rL extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}}class ap extends rL{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class tX extends rL{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const sE=(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 Tc(e,{flow:t,indicator:n,next:r,offset:i,onError:s,parentIndent:l,startOnNewline:c}){let f=!1,h=c,m=c,g="",y="",v=!1,w=!1,S=null,N=null,C=null,A=null,k=null,_=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),m=!0;break;case"comment":{m||s(z,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const D=z.source.substring(1)||" ";g?g+=y+D:g=D,y="",h=!1;break}case"newline":h?g?g+=z.source:(!_||n!=="seq-item-ind")&&(f=!0):y+=z.source,h=!0,v=!0,(N||C)&&(A=z),m=!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,m=!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,m=!1,w=!0;break}case n:(N||C)&&s(z,"BAD_PROP_ORDER",`Anchors and tags must be after the ${z.source} indicator`),_&&s(z,"UNEXPECTED_TOKEN",`Unexpected ${z.source} in ${t??"collection"}`),_=z,h=n==="seq-item-ind"||n==="explicit-key-ind",m=!1;break;case"comma":if(t){k&&s(z,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),k=z,h=!1,m=!1;break}default:s(z,"UNEXPECTED_TOKEN",`Unexpected ${z.type} token`),h=!1,m=!1}const P=e[e.length-1],E=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:_,spaceBefore:f,comment:g,hasNewline:v,anchor:N,tag:C,newlineAfterProp:A,end:E,start:T??E}}function Rd(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(Rd(t.key)||Rd(t.value))return!0}return!1;default:return!0}}function Cw(e,t,n){if(t?.type==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Rd(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function iL(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const i=typeof r=="function"?r:(s,l)=>s===l||kt(s)&&kt(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 nX({composeNode:e,composeEmptyNode:t},n,r,i,s){const l=s?.nodeClass??Gr,c=new l(n.schema);n.atRoot&&(n.atRoot=!1);let f=r.offset,h=null;for(const m of r.items){const{start:g,key:y,sep:v,value:w}=m,S=Tc(g,{indicator:"explicit-key-ind",next:y??v?.[0],offset:f,onError:i,parentIndent:r.indent,startOnNewline:!0}),N=!S.found;if(N){if(y&&(y.type==="block-seq"?i(f,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==r.indent&&i(f,"BAD_INDENT",oE)),!S.anchor&&!S.tag&&!v){h=S.end,S.comment&&(c.comment?c.comment+=`
158
+ `+S.comment:c.comment=S.comment);continue}(S.newlineAfterProp||Rd(y))&&i(y??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,A=y?e(n,y,S,i):t(n,C,g,null,S,i);n.schema.compat&&Cw(r.indent,y,i),n.atKey=!1,iL(n,c.items,A)&&i(C,"DUPLICATE_KEY","Map keys must be unique");const k=Tc(v??[],{indicator:"map-value-ind",next:w,offset:A.range[2],onError:i,parentIndent:r.indent,startOnNewline:!y||y.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(A.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const _=w?e(n,w,k,i):t(n,f,v,null,k,i);n.schema.compat&&Cw(r.indent,w,i),f=_.range[2];const T=new Xn(A,_);n.options.keepSourceTokens&&(T.srcToken=m),c.items.push(T)}else{N&&i(A.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(A.comment?A.comment+=`
159
+ `+k.comment:A.comment=k.comment);const _=new Xn(A);n.options.keepSourceTokens&&(_.srcToken=m),c.items.push(_)}}return h&&h<f&&i(h,"IMPOSSIBLE","Map comment with trailing content"),c.range=[r.offset,f,h??f],c}function rX({composeNode:e,composeEmptyNode:t},n,r,i,s){const l=s?.nodeClass??Ko,c=new l(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=r.offset,h=null;for(const{start:m,value:g}of r.items){const y=Tc(m,{indicator:"seq-item-ind",next:g,offset:f,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||g)g?.type==="block-seq"?i(y.end,"BAD_INDENT","All sequence items must start at the same column"):i(f,"MISSING_CHAR","Sequence item without - indicator");else{h=y.end,y.comment&&(c.comment=y.comment);continue}const v=g?e(n,g,y,i):t(n,y.end,m,null,y,i);n.schema.compat&&Cw(r.indent,g,i),f=v.range[2],c.items.push(v)}return c.range=[r.offset,f,h??f],c}function af(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 m=f.substring(1)||" ";i?i+=l+m:i=m,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 pb="Block collections are not allowed within flow collections",mb=e=>e&&(e.type==="block-map"||e.type==="block-seq");function iX({composeNode:e,composeEmptyNode:t},n,r,i,s){const l=r.start.source==="{",c=l?"flow map":"flow sequence",f=s?.nodeClass??(l?Gr:Ko),h=new f(n.schema);h.flow=!0;const m=n.atRoot;m&&(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:A,key:k,sep:_,value:T}=C,P=Tc(A,{flow:c,indicator:"explicit-key-ind",next:k??_?.[0],offset:g,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!P.found){if(!P.anchor&&!P.tag&&!_&&!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&&Rd(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 E="";e:for(const z of A)switch(z.type){case"comma":case"space":break;case"comment":E=z.source.substring(1);break e;default:break e}if(E){let z=h.items[h.items.length-1];nn(z)&&(z=z.value??z.key),z.comment?z.comment+=`
161
+ `+E:z.comment=E,P.comment=P.comment.substring(E.length+1)}}if(!l&&!_&&!P.found){const E=T?e(n,T,P,i):t(n,P.end,_,null,P,i);h.items.push(E),g=E.range[2],mb(T)&&i(E.range,"BLOCK_IN_FLOW",pb)}else{n.atKey=!0;const E=P.end,z=k?e(n,k,P,i):t(n,E,A,null,P,i);mb(k)&&i(z.range,"BLOCK_IN_FLOW",pb),n.atKey=!1;const D=Tc(_??[],{flow:c,indicator:"map-value-ind",next:T,offset:z.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(D.found){if(!l&&!P.found&&n.options.strict){if(_)for(const I of _){if(I===D.found)break;if(I.type==="newline"){i(I,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}P.start<D.found.offset-1024&&i(D.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(D.start,"MISSING_CHAR",`Missing , or : between ${c} items`));const F=T?e(n,T,D,i):D.found?t(n,D.end,_,null,D,i):null;F?mb(T)&&i(F.range,"BLOCK_IN_FLOW",pb):D.comment&&(z.comment?z.comment+=`
162
+ `+D.comment:z.comment=D.comment);const U=new Xn(z,F);if(n.options.keepSourceTokens&&(U.srcToken=C),l){const I=h;iL(n,I.items,z)&&i(E,"DUPLICATE_KEY","Map keys must be unique"),I.items.push(U)}else{const I=new Gr(n.schema);I.flow=!0,I.items.push(U);const ae=(F??z).range;I.range=[z.range[0],ae[1],ae[2]],h.items.push(I)}g=F?F.range[2]:D.end}}const y=l?"}":"]",[v,...w]=r.end;let S=g;if(v?.source===y)S=v.offset+v.source.length;else{const N=c[0].toUpperCase()+c.substring(1),C=m?`${N} must end with a ${y}`:`${N} in block collection must be sufficiently indented and end with a ${y}`;i(g,m?"MISSING_CHAR":"BAD_INDENT",C),v&&v.source.length!==1&&w.unshift(v)}if(w.length>0){const N=af(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 gb(e,t,n,r,i,s){const l=n.type==="block-map"?nX(e,t,n,r,s):n.type==="block-seq"?rX(e,t,n,r,s):iX(e,t,n,r,s),c=l.constructor;return i==="!"||i===c.tagName?(l.tag=c.tagName,l):(i&&(l.tag=i),l)}function aX(e,t,n,r,i){const s=r.tag,l=s?t.directives.tagName(s.source,y=>i(s,"TAG_RESOLVE_FAILED",y)):null;if(n.type==="block-seq"){const{anchor:y,newlineAfterProp:v}=r,w=y&&s?y.offset>s.offset?y:s:y??s;w&&(!v||v.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===Gr.tagName&&c==="map"||l===Ko.tagName&&c==="seq")return gb(e,t,n,i,l);let f=t.schema.tags.find(y=>y.tag===l&&y.collection===c);if(!f){const y=t.schema.knownTags[l];if(y?.collection===c)t.schema.tags.push(Object.assign({},y,{default:!1})),f=y;else return y?i(s,"BAD_COLLECTION_TYPE",`${y.tag} used for ${c} collection, but expects ${y.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${l}`,!0),gb(e,t,n,i,l)}const h=gb(e,t,n,i,l,f),m=f.resolve?.(h,y=>i(s,"TAG_RESOLVE_FAILED",y),t.options)??h,g=tn(m)?m:new Be(m);return g.range=h.range,g.tag=l,f?.format&&(g.format=f.format),g}function sX(e,t,n){const r=t.offset,i=oX(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};const s=i.mode===">"?Be.BLOCK_FOLDED:Be.BLOCK_LITERAL,l=t.source?lX(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,m=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),m=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="",y="",v=!1;for(let S=0;S<m;++S)g+=l[S][0].slice(f)+`
165
+ `;for(let S=m;S<c;++S){let[N,C]=l[S];h+=N.length+C.length+1;const A=C[C.length-1]==="\r";if(A&&(C=C.slice(0,-1)),C&&N.length<f){const _=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(h-C.length-(A?2:1),"BAD_INDENT",_),N=""}s===Be.BLOCK_LITERAL?(g+=y+N.slice(f)+C,y=`
166
+ `):N.length>f||C[0]===" "?(y===" "?y=`
167
+ `:!v&&y===`
168
+ `&&(y=`
169
+
170
+ `),g+=y+N.slice(f)+C,y=`
171
+ `,v=!0):C===""?y===`
172
+ `?g+=`
173
+ `:y=`
174
+ `:(g+=y+C,y=" ",v=!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 oX({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 y=1;y<i.length;++y){const v=i[y];if(!c&&(v==="-"||v==="+"))c=v;else{const w=Number(v);!l&&w?l=w:f===-1&&(f=e+y)}}f!==-1&&r(f,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let h=!1,m="",g=i.length;for(let y=1;y<t.length;++y){const v=t[y];switch(v.type){case"space":h=!0;case"newline":g+=v.source.length;break;case"comment":n&&!h&&r(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),g+=v.source.length,m=v.source.substring(1);break;case"error":r(v,"UNEXPECTED_TOKEN",v.message),g+=v.source.length;break;default:{const w=`Unexpected token in block scalar header: ${v.type}`;r(v,"UNEXPECTED_TOKEN",w);const S=v.source;S&&typeof S=="string"&&(g+=S.length)}}}return{mode:s,indent:l,chomp:c,comment:m,length:g}}function lX(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 cX(e,t,n){const{offset:r,type:i,source:s,end:l}=e;let c,f;const h=(y,v,w)=>n(r+y,v,w);switch(i){case"scalar":c=Be.PLAIN,f=uX(s,h);break;case"single-quoted-scalar":c=Be.QUOTE_SINGLE,f=dX(s,h);break;case"double-quoted-scalar":c=Be.QUOTE_DOUBLE,f=fX(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 m=r+s.length,g=af(l,m,t,n);return{value:f,type:c,comment:g.comment,range:[r,m,g.offset]}}function uX(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}`),aL(e)}function dX(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),aL(e.slice(1,-1)).replace(/''/g,"'")}function aL(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 fX(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}=hX(e,r);n+=s,r=l}else if(i==="\\"){let s=e[++r];const l=pX[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+=mX(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 hX(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 pX={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
193
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function mX(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 sL(e,t,n,r){const{value:i,type:s,comment:l,range:c}=t.type==="block-scalar"?sX(e,t,r):cX(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[qi]:f?h=gX(e.schema,i,f,n,r):t.type==="scalar"?h=yX(e,i,t,r):h=e.schema[qi];let m;try{const g=h.resolve(i,y=>r(n??t,"TAG_RESOLVE_FAILED",y),e.options);m=kt(g)?g:new Be(g)}catch(g){const y=g instanceof Error?g.message:String(g);r(n??t,"TAG_RESOLVE_FAILED",y),m=new Be(i)}return m.range=c,m.source=i,s&&(m.type=s),f&&(m.tag=f),h.format&&(m.format=h.format),l&&(m.comment=l),m}function gX(e,t,n,r,i){if(n==="!")return e[qi];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[qi])}function yX({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[qi];if(n.compat){const c=n.compat.find(f=>f.default&&f.test?.test(r))??n[qi];if(l.tag!==c.tag){const f=t.tagString(l.tag),h=t.tagString(c.tag),m=`Value may be parsed as either ${f} or ${h}`;s(i,"TAG_RESOLVE_FAILED",m,!0)}}return l}function vX(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 bX={composeNode:oL,composeEmptyNode:C1};function oL(e,t,n,r){const i=e.atKey,{spaceBefore:s,comment:l,anchor:c,tag:f}=n;let h,m=!0;switch(t.type){case"alias":h=xX(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=sL(e,t,f,r),c&&(h.anchor=c.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":h=aX(bX,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=C1(e,t.offset,void 0,null,n,r),m=!1}}return c&&h.anchor===""&&r(c,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!kt(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&&m&&(h.srcToken=t),h}function C1(e,t,n,r,{spaceBefore:i,comment:s,anchor:l,tag:c,end:f},h){const m={type:"scalar",offset:vX(t,n,r),indent:-1,source:""},g=sL(e,m,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 xX({options:e},{offset:t,source:n,end:r},i){const s=new h1(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=af(r,l,e.strict,i);return s.range=[t,l,c.offset],c.comment&&(s.comment=c.comment),s}function wX(e,t,{offset:n,start:r,value:i,end:s},l){const c=Object.assign({_directives:t},e),f=new Mg(void 0,c),h={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},m=Tc(r,{indicator:"doc-start",next:i??s?.[0],offset:n,onError:l,parentIndent:0,startOnNewline:!0});m.found&&(f.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!m.hasNewline&&l(m.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),f.contents=i?oL(h,i,m,l):C1(h,m.end,r,null,m,l);const g=f.contents.range[2],y=af(s,g,!1,l);return y.comment&&(f.comment=y.comment),f.range=[n,g,y.offset],f}function nd(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 lE(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 SX{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,s)=>{const l=nd(n);s?this.warnings.push(new tX(l,r,i)):this.errors.push(new ap(l,r,i))},this.directives=new Zn({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:i}=lE(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(en(s)&&!s.flow&&s.items.length>0){let l=s.items[0];nn(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:lE(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=nd(t);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=wX(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 ap(nd(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 ap(nd(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=af(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 ap(nd(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 Mg(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 lL="\uFEFF",cL="",uL="",_w="";function jX(e){switch(e){case lL:return"byte-order-mark";case cL:return"doc-mode";case uL:return"flow-error-end";case _w: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 ci(e){switch(e){case void 0:case" ":case`
203
+ `:case"\r":case" ":return!0;default:return!1}}const cE=new Set("0123456789ABCDEFabcdef"),NX=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),sp=new Set(",[]{}"),CX=new Set(` ,[]{}
204
+ \r `),yb=e=>!e||CX.has(e);class _X{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==="...")&&ci(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]===lL&&(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 cL,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==="...")&&ci(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&&!ci(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===":")&&ci(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(yb),"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("..."))&&ci(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield uL,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(yb),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const l=this.charAt(1);if(this.flowKey||ci(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=>ci(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 _w,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(ci(s)||t&&sp.has(s))break;n=r}else if(ci(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&&sp.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&&sp.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield _w,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(yb))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(ci(n)||t&&sp.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(;!ci(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(NX.has(n))n=this.buffer[++t];else if(n==="%"&&cE.has(this.buffer[t+1])&&cE.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 OX{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 ms(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function uE(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 dL(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 op(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 ec(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 dE(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!ms(t.start,"explicit-key-ind")&&!ms(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,dL(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 kX{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 _X,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=jX(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"&&dE(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&&uE(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":{uE(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=op(this.peek(2)),r=ec(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(ms(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(dL(n.key)&&!ms(n.sep,"newline")){const l=ec(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(ms(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=ec(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]}):ms(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&&!ms(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||ms(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=op(r),s=ec(i);dE(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=op(t),r=ec(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=op(t),r=ec(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 AX(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new OX||null,prettyErrors:t}}function EX(e,t={}){const{lineCounter:n,prettyErrors:r}=AX(t),i=new kX(n?.addNewLine),s=new SX(t),l=Array.from(s.compose(i.parse(e)));if(r&&n)for(const c of l)c.errors.forEach(sE(e,n)),c.warnings.forEach(sE(e,n));return l.length>0?l:Object.assign([],{empty:!0},s.streamInfo())}function TX({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 m=EX(t),g=[],y=[];for(let v=0;v<m.length;v++){const w=m[v];if(w.errors.length>0){g.push(`Document ${v+1}: ${w.errors[0]?.message}`);continue}const S=w.toJSON();if(!(!S||typeof S!="object"))try{const N=await Bq(S);y.push(`Applied "${N.displayName||N.name}" (revision ${N.configRevision})`)}catch(N){g.push(`Document ${v+1}: ${N instanceof Error?N.message:String(N)}`)}}l(y),f(g),i(!1),y.length>0&&(Xe({title:"YAML applied",detail:`Applied ${y.length} document${y.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:m=>n(m.target.value)}),s.length>0&&u.jsx("ul",{className:"mt-2 space-y-1",children:s.map((m,g)=>u.jsx("li",{className:"text-emerald-400 text-sm",children:m},g))}),c.length>0&&u.jsx("ul",{className:"mt-2 space-y-1",children:c.map((m,g)=>u.jsx("li",{className:"text-rose-400 text-sm",children:m},g))}),u.jsx("div",{className:"mt-3",children:u.jsx(pe,{type:"button",disabled:!t.trim()||r,onClick:h,children:r?"Applying...":"Apply"})})]})}function PX(){const{dashboard:e,isLoading:t,refetch:n}=il();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(E=>u.jsx("div",{className:"skeleton-text-sm w-16"},E))}),[1,2,3].map(E=>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"})]},E))]})]});const r=e.projects,i=Ls(),[s,l]=x.useState(!1),[c,f]=x.useState(""),[h,m]=x.useState(""),[g,y]=x.useState(""),[v,w]=x.useState("US"),[S,N]=x.useState("en"),[C,A]=x.useState(!1),[k,_]=x.useState(null),T=c.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),P=async()=>{if(!(!T||!g)){A(!0),_(null);try{const E=await ug(T,{displayName:h||c,canonicalDomain:g,country:v,language:S});Xe({title:"Project created",detail:`${E.displayName||E.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${E.name}`,dedupeMode:"drop"}),n(),f(""),m(""),y(""),w("US"),N("en"),l(!1),i({to:"/projects/$projectId",params:{projectId:E.id}})}catch(E){_(E instanceof Error?E.message:"Failed to create project")}finally{A(!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(pe,{type:"button",onClick:()=>l(E=>!E),children:[u.jsx(Wk,{className:"size-4 mr-1.5"}),"Add project"]})})]}),s?u.jsxs(Ue,{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:E=>f(E.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:E=>m(E.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:E=>y(E.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:v,onChange:E=>w(E.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:E=>N(E.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(pe,{type:"button",disabled:!T||!g||C,onClick:P,children:C?"Creating...":"Create project"}),u.jsx(pe,{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(E=>{const z=E.recentRuns[0];return u.jsxs("tr",{className:"cursor-pointer",onClick:()=>i({to:"/projects/$projectId",params:{projectId:E.project.id}}),children:[u.jsxs("td",{children:[u.jsx(Rt,{to:"/projects/$projectId",params:{projectId:E.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:D=>D.stopPropagation(),children:E.project.displayName||E.project.name}),u.jsx("p",{className:"text-[11px] text-zinc-500",children:E.project.name})]}),u.jsx("td",{className:"text-zinc-400",children:E.project.canonicalDomain}),u.jsx("td",{children:u.jsx(yt,{tone:E.visibilitySummary.tone,children:E.visibilitySummary.value})}),u.jsx("td",{className:"text-zinc-500 text-sm",children:z?u.jsx(gg,{status:z.status}):u.jsx("span",{className:"text-zinc-600",children:"No runs"})}),u.jsx("td",{className:"text-right text-zinc-500",children:E.project.country})]},E.project.id)})})]})}):s?null:u.jsxs(Ue,{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(pe,{type:"button",onClick:()=>l(!0),children:[u.jsx(Wk,{className:"size-4 mr-1.5"}),"Add project"]})]}),u.jsx(TX,{onApplied:()=>{n()}})]})}function Ow({state:e}){return u.jsx(yt,{tone:mK(e),children:hg(e)})}function fL({run:e}){const{openRun:t}=Kc();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(gg,{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(pe,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function hL({value:e,label:t,delta:n,tone:r,description:i,tooltip:s,isNumeric:l=!0,progress:c}){const m=2*Math.PI*48,g=Number.parseInt(e,10),y=typeof c=="number"&&Number.isFinite(c)?Math.min(Math.max(c,0),1):l&&!Number.isNaN(g)?Math.min(g/100,1):.5,v=m*(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:m,strokeDashoffset:v,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(Yn,{text:s})]}),u.jsx("p",{className:"gauge-delta",children:n}),u.jsx("p",{className:"gauge-description",children:i})]})}function fE({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 zX(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 MX({evidence:e}){const{openEvidence:t}=Kc(),[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),m=h.includes("cited")?"cited":h.includes("emerging")?"emerging":h.includes("lost")?"lost":h.every(w=>w==="pending")?"pending":"not-cited",g=zX(c),y=c.filter(w=>w.citationState==="cited"||w.citationState==="emerging").length,v=(()=>{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(dg,{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(Ad,{provider:w.provider},w.id))})]})}),u.jsx("td",{children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Ow,{state:m}),u.jsxs("span",{className:"text-[11px] text-zinc-500",children:[y,"/",c.length]})]})}),u.jsx("td",{children:u.jsx(fE,{history:g})}),u.jsx("td",{className:"evidence-change-cell",children:v}),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(Ad,{provider:w.provider})}),u.jsx("td",{children:u.jsx(Ow,{state:w.citationState})}),u.jsx("td",{children:u.jsx(fE,{history:w.runHistory})}),u.jsx("td",{className:"evidence-change-cell",children:w.changeLabel}),u.jsx("td",{children:u.jsx(pe,{variant:"ghost",size:"sm",type:"button",onClick:S=>{S.stopPropagation(),t(w.id)},children:"View"})})]},w.id))]},l)})})]})})}function RX({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(yt,{tone:gK(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 hE({eyebrow:e,title:t,status:n,tone:r,targetLabel:i,targetValue:s,coverageValue:l,note:c,updatedAt:f,active:h,onClick:m}){return u.jsxs("button",{type:"button",onClick:m,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(yt,{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 ${di(f)}`:"No recent sync yet"})]})]})}function lp({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})]})}const DX=["7d","30d","90d","all"],LX=["gap","cited","uncited"],pL={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 IX({projectName:e}){const[t,n]=x.useState("30d"),[r,i]=x.useState(null),[s,l]=x.useState(null),[c,f]=x.useState(null),[h,m]=x.useState(null),[g,y]=x.useState(!0);return x.useEffect(()=>{let v=!1;return y(!0),Promise.all([c9(e,t),u9(e,t),d9(e,t)]).then(([w,S,N])=>{v||(i(w),l(S),f(N),y(!1))}).catch(()=>{v||y(!1)}),()=>{v=!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(Yn,{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:DX.map(v=>u.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${t===v?"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(v),children:v==="all"?"All":v},v))})]}),r&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center gap-6",children:[u.jsx(hL,{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(yt,{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(([v,w])=>u.jsxs("tr",{className:"border-t border-zinc-800/40",children:[u.jsx("td",{className:"py-1.5 text-zinc-300",children:v}),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]})]},v))})]})]})]}),r.buckets.length>=1&&u.jsx($X,{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(Yn,{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:LX.map(v=>{const w=v==="cited"?s.cited.length:v==="gap"?s.gap.length:s.uncited.length,S=h===v;return u.jsxs("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${S?v==="gap"?"bg-amber-900/40 border-amber-700/60 text-amber-300":v==="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:()=>m(S?null:v),children:[v==="gap"?"Gap":v==="cited"?"Cited":"Not Cited"," (",w,")"]},v)})}),u.jsx(UX,{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(Yn,{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(BX,{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(v=>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 ${pL[v.category]??"bg-zinc-600"}`}),v.label]}),u.jsx("td",{className:"py-1.5 text-right text-zinc-200",children:v.count}),u.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[(v.percentage*100).toFixed(1),"%"]}),u.jsx("td",{className:"py-1.5 pl-4 text-zinc-500 text-xs truncate max-w-[200px]",children:v.topDomains.slice(0,3).map(w=>w.domain).join(", ")})]},v.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 $X({buckets:e,keywordChanges:t}){const[n,r]=x.useState(null),i=600,s=140,l={top:30,right:10,bottom:20,left:40},c=i-l.left-l.right,f=s-l.top-l.bottom,h=1,m=e.map((v,w)=>{const S=l.left+(e.length>1?w/(e.length-1)*c:c/2),N=l.top+f-v.citationRate/h*f;return{x:S,y:N}}),g=x.useMemo(()=>{if(!t||t.length===0||e.length<2)return[];const v=new Date(e[0].startDate).getTime(),S=new Date(e[e.length-1].startDate).getTime()-v;return S<=0?[]:t.map(N=>{const A=(new Date(N.date).getTime()-v)/S;return A<0||A>1?null:{...N,x:l.left+A*c}}).filter(N=>N!==null)},[e,t,l.left,c]),y=m.map(v=>`${v.x},${v.y}`).join(" ");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.jsxs("svg",{viewBox:`0 0 ${i} ${s}`,className:"w-full h-auto","aria-label":"Citation rate trend chart",onMouseLeave:()=>r(null),children:[u.jsxs("text",{x:l.left-4,y:l.top+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:[(h*100).toFixed(0),"%"]}),u.jsx("text",{x:l.left-4,y:l.top+f+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:"0%"}),u.jsx("line",{x1:l.left,y1:l.top+f,x2:l.left+c,y2:l.top+f,stroke:"currentColor",className:"text-zinc-800",strokeWidth:"0.5"}),u.jsx("polyline",{fill:"none",stroke:"currentColor",className:"text-emerald-500",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",points:y}),g.map((v,w)=>u.jsxs("g",{children:[u.jsx("line",{x1:v.x,y1:l.top,x2:v.x,y2:l.top+f,stroke:"currentColor",className:"text-zinc-600",strokeWidth:"0.5",strokeDasharray:"4 2"}),u.jsx("text",{x:v.x,y:l.top-6,textAnchor:"middle",className:"fill-zinc-500",fontSize:"7",fontWeight:"500",children:v.label})]},`kw-change-${w}`)),n!==null&&u.jsx("line",{x1:m[n].x,y1:l.top,x2:m[n].x,y2:l.top+f,stroke:"currentColor",className:"text-zinc-600",strokeWidth:"0.5",strokeDasharray:"3 2"}),e.map((v,w)=>{const{x:S,y:N}=m[w],C=n===w;return u.jsxs("g",{children:[u.jsx("circle",{cx:S,cy:N,r:"10",fill:"transparent",onMouseEnter:()=>r(w),style:{cursor:"pointer"}}),u.jsx("circle",{cx:S,cy:N,r:C?5:3,className:C?"fill-emerald-400":"fill-emerald-500"})]},w)}),n!==null&&(()=>{const v=e[n],{x:w,y:S}=m[n],N=`${(v.citationRate*100).toFixed(1)}%`,C=v.keywordCount?`${v.keywordCount} kp`:"",A=56,k=30,_=Math.max(l.left,Math.min(w-A/2,i-l.right-A)),T=S-k-8;return u.jsxs("g",{children:[u.jsx("rect",{x:_,y:T,width:A,height:k,rx:"4",className:"fill-zinc-800",stroke:"currentColor",strokeWidth:"0.5"}),u.jsx("text",{x:_+A/2,y:T+13,textAnchor:"middle",className:"fill-zinc-50",fontSize:"11",fontWeight:"600",children:N}),C&&u.jsx("text",{x:_+A/2,y:T+24,textAnchor:"middle",className:"fill-zinc-400",fontSize:"8",children:C})]})})(),e.map((v,w)=>({b:v,i:w})).filter(({i:v})=>v===0||v===e.length-1||e.length<=7).map(({b:v,i:w})=>{const S=m[w].x;return u.jsx("text",{x:S,y:s-2,textAnchor:"middle",className:"fill-zinc-500",fontSize:"8",children:v.startDate.slice(5,10)},w)})]})]})}function UX({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(yt,{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 BX({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:`${pL[n.category]??"bg-zinc-600"} transition-all`,style:{width:`${r}%`},title:`${n.label}: ${(n.percentage*100).toFixed(1)}%`},n.category)})})}var qX=["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 _1(e){if(typeof e!="string")return!1;var t=qX;return t.includes(e)}var FX=["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"],KX=new Set(FX);function mL(e){return typeof e!="string"?!1:KX.has(e)}function gL(e){return typeof e=="string"&&e.startsWith("data-")}function Fi(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(mL(n)||gL(n))&&(t[n]=e[n]);return t}function Rg(e){if(e==null)return null;if(x.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Fi(t)}return typeof e=="object"&&!Array.isArray(e)?Fi(e):null}function _r(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(mL(n)||gL(n)||_1(n))&&(t[n]=e[n]);return t}function HX(e){return e==null?null:x.isValidElement(e)?_r(e.props):typeof e=="object"&&!Array.isArray(e)?_r(e):null}var GX=["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 VX(e,t){if(e==null)return{};var n,r,i=ZX(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 ZX(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 O1=x.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:s,className:l,style:c,title:f,desc:h}=e,m=VX(e,GX),g=s||{width:r,height:i,x:0,y:0},y=bt("recharts-surface",l);return x.createElement("svg",kw({},_r(m),{className:y,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)}),YX=["children","className"];function Aw(){return Aw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Aw.apply(null,arguments)}function WX(e,t){if(e==null)return{};var n,r,i=QX(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 QX(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 Ki=x.forwardRef((e,t)=>{var{children:n,className:r}=e,i=WX(e,YX),s=bt("recharts-layer",r);return x.createElement("g",Aw({className:s},_r(i),{ref:t}),n)}),yL=x.createContext(null),XX=()=>x.useContext(yL);function Ot(e){return function(){return e}}const vL=Math.cos,dm=Math.sin,wi=Math.sqrt,fm=Math.PI,Dg=2*fm,Ew=Math.PI,Tw=2*Ew,vo=1e-6,JX=Tw-vo;function bL(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function eJ(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return bL;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 tJ{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?bL:eJ(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,m=l-t,g=c-n,y=m*m+g*g;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(y>vo)if(!(Math.abs(g*f-h*m)>vo)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let v=r-l,w=i-c,S=f*f+h*h,N=v*v+w*w,C=Math.sqrt(S),A=Math.sqrt(y),k=s*Math.tan((Ew-Math.acos((S+y-N)/(2*C*A)))/2),_=k/A,T=k/C;Math.abs(_-1)>vo&&this._append`L${t+_*m},${n+_*g}`,this._append`A${s},${s},0,0,${+(g*v>m*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,m=n+f,g=1^l,y=l?i-s:s-i;this._x1===null?this._append`M${h},${m}`:(Math.abs(this._x1-h)>vo||Math.abs(this._y1-m)>vo)&&this._append`L${h},${m}`,r&&(y<0&&(y=y%Tw+Tw),y>JX?this._append`A${r},${r},0,1,${g},${t-c},${n-f}A${r},${r},0,1,${g},${this._x1=h},${this._y1=m}`:y>vo&&this._append`A${r},${r},0,${+(y>=Ew)},${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 tJ(t)}function A1(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function xL(e){this._context=e}xL.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 Lg(e){return new xL(e)}function wL(e){return e[0]}function SL(e){return e[1]}function jL(e,t){var n=Ot(!0),r=null,i=Lg,s=null,l=k1(c);e=typeof e=="function"?e:e===void 0?wL:Ot(e),t=typeof t=="function"?t:t===void 0?SL:Ot(t);function c(f){var h,m=(f=A1(f)).length,g,y=!1,v;for(r==null&&(s=i(v=l())),h=0;h<=m;++h)!(h<m&&n(g=f[h],h,f))===y&&((y=!y)?s.lineStart():s.lineEnd()),y&&s.point(+e(g,h,f),+t(g,h,f));if(v)return s=null,v+""||null}return c.x=function(f){return arguments.length?(e=typeof f=="function"?f:Ot(+f),c):e},c.y=function(f){return arguments.length?(t=typeof f=="function"?f:Ot(+f),c):t},c.defined=function(f){return arguments.length?(n=typeof f=="function"?f:Ot(!!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 cp(e,t,n){var r=null,i=Ot(!0),s=null,l=Lg,c=null,f=k1(h);e=typeof e=="function"?e:e===void 0?wL:Ot(+e),t=typeof t=="function"?t:Ot(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?SL:Ot(+n);function h(g){var y,v,w,S=(g=A1(g)).length,N,C=!1,A,k=new Array(S),_=new Array(S);for(s==null&&(c=l(A=f())),y=0;y<=S;++y){if(!(y<S&&i(N=g[y],y,g))===C)if(C=!C)v=y,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),w=y-1;w>=v;--w)c.point(k[w],_[w]);c.lineEnd(),c.areaEnd()}C&&(k[y]=+e(N,y,g),_[y]=+t(N,y,g),c.point(r?+r(N,y,g):k[y],n?+n(N,y,g):_[y]))}if(A)return c=null,A+""||null}function m(){return jL().defined(i).curve(l).context(s)}return h.x=function(g){return arguments.length?(e=typeof g=="function"?g:Ot(+g),r=null,h):e},h.x0=function(g){return arguments.length?(e=typeof g=="function"?g:Ot(+g),h):e},h.x1=function(g){return arguments.length?(r=g==null?null:typeof g=="function"?g:Ot(+g),h):r},h.y=function(g){return arguments.length?(t=typeof g=="function"?g:Ot(+g),n=null,h):t},h.y0=function(g){return arguments.length?(t=typeof g=="function"?g:Ot(+g),h):t},h.y1=function(g){return arguments.length?(n=g==null?null:typeof g=="function"?g:Ot(+g),h):n},h.lineX0=h.lineY0=function(){return m().x(e).y(t)},h.lineY1=function(){return m().x(e).y(n)},h.lineX1=function(){return m().x(r).y(t)},h.defined=function(g){return arguments.length?(i=typeof g=="function"?g:Ot(!!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 NL{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 nJ(e){return new NL(e,!0)}function rJ(e){return new NL(e,!1)}const E1={draw(e,t){const n=wi(t/fm);e.moveTo(n,0),e.arc(0,0,n,0,Dg)}},iJ={draw(e,t){const n=wi(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()}},CL=wi(1/3),aJ=CL*2,sJ={draw(e,t){const n=wi(t/aJ),r=n*CL;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},oJ={draw(e,t){const n=wi(t),r=-n/2;e.rect(r,r,n,n)}},lJ=.8908130915292852,_L=dm(fm/10)/dm(7*fm/10),cJ=dm(Dg/10)*_L,uJ=-vL(Dg/10)*_L,dJ={draw(e,t){const n=wi(t*lJ),r=cJ*n,i=uJ*n;e.moveTo(0,-n),e.lineTo(r,i);for(let s=1;s<5;++s){const l=Dg*s/5,c=vL(l),f=dm(l);e.lineTo(f*n,-c*n),e.lineTo(c*r-f*i,f*r+c*i)}e.closePath()}},vb=wi(3),fJ={draw(e,t){const n=-wi(t/(vb*3));e.moveTo(0,n*2),e.lineTo(-vb*n,-n),e.lineTo(vb*n,-n),e.closePath()}},Br=-.5,qr=wi(3)/2,Pw=1/wi(12),hJ=(Pw/2+1)*3,pJ={draw(e,t){const n=wi(t/hJ),r=n/2,i=n*Pw,s=r,l=n*Pw+n,c=-s,f=l;e.moveTo(r,i),e.lineTo(s,l),e.lineTo(c,f),e.lineTo(Br*r-qr*i,qr*r+Br*i),e.lineTo(Br*s-qr*l,qr*s+Br*l),e.lineTo(Br*c-qr*f,qr*c+Br*f),e.lineTo(Br*r+qr*i,Br*i-qr*r),e.lineTo(Br*s+qr*l,Br*l-qr*s),e.lineTo(Br*c+qr*f,Br*f-qr*c),e.closePath()}};function mJ(e,t){let n=null,r=k1(i);e=typeof e=="function"?e:Ot(e||E1),t=typeof t=="function"?t:Ot(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:Ot(s),i):e},i.size=function(s){return arguments.length?(t=typeof s=="function"?s:Ot(+s),i):t},i.context=function(s){return arguments.length?(n=s??null,i):n},i}function hm(){}function pm(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 OL(e){this._context=e}OL.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:pm(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:pm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function gJ(e){return new OL(e)}function kL(e){this._context=e}kL.prototype={areaStart:hm,areaEnd:hm,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:pm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function yJ(e){return new kL(e)}function AL(e){this._context=e}AL.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:pm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function vJ(e){return new AL(e)}function EL(e){this._context=e}EL.prototype={areaStart:hm,areaEnd:hm,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 bJ(e){return new EL(e)}function pE(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(pE(s)+pE(l))*Math.min(Math.abs(s),Math.abs(l),.5*Math.abs(c))||0}function gE(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function bb(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 mm(e){this._context=e}mm.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:bb(this,this._t0,gE(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,bb(this,gE(this,n=mE(this,e,t)),n);break;default:bb(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 TL(e){this._context=new PL(e)}(TL.prototype=Object.create(mm.prototype)).point=function(e,t){mm.prototype.point.call(this,t,e)};function PL(e){this._context=e}PL.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 xJ(e){return new mm(e)}function wJ(e){return new TL(e)}function zL(e){this._context=e}zL.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=yE(e),i=yE(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 yE(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 SJ(e){return new zL(e)}function Ig(e,t){this._context=e,this._t=t}Ig.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 jJ(e){return new Ig(e,.5)}function NJ(e){return new Ig(e,0)}function CJ(e){return new Ig(e,1)}function Ho(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 zw(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function _J(e,t){return e[t]}function OJ(e){const t=[];return t.key=e,t}function kJ(){var e=Ot([]),t=zw,n=Ho,r=_J;function i(s){var l=Array.from(e.apply(this,arguments),OJ),c,f=l.length,h=-1,m;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,m=A1(t(l));c<f;++c)l[m[c]].index=c;return n(l,m),l}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:Ot(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:Ot(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?zw:typeof s=="function"?s:Ot(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??Ho,i):n},i}function AJ(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}Ho(e,t)}}function EJ(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}Ho(e,t)}}function TJ(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 m=e[t[c]],g=m[r][1]||0,y=m[r-1][1]||0,v=(g-y)/2,w=0;w<c;++w){var S=e[t[w]],N=S[r][1]||0,C=S[r-1][1]||0;v+=N-C}f+=g,h+=v*g}i[r-1][1]+=i[r-1][0]=n,f&&(n-=h/f)}i[r-1][1]+=i[r-1][0]=n,Ho(e,t)}}var xb={},wb={},vE;function PJ(){return vE||(vE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(wb)),wb}var Sb={},bE;function ML(){return bE||(bE=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})(Sb)),Sb}var jb={},xE;function T1(){return xE||(xE=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})(jb)),jb}var Nb={},Cb={},wE;function zJ(){return wE||(wE=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})(Cb)),Cb}var SE;function P1(){return SE||(SE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=zJ(),n=T1();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="",m=!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:m?g==='"'||g==="'"?h=g:g==="]"?(m=!1,s.push(f),f=""):f+=g:g==="["?(m=!0,f&&(s.push(f),f="")):g==="."?f&&(s.push(f),f=""):f+=g,c++}return f&&s.push(f),s}e.toPath=r})(Nb)),Nb}var jE;function z1(){return jE||(jE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=PJ(),n=ML(),r=T1(),i=P1();function s(c,f,h){if(c==null)return h;switch(typeof f){case"string":{if(t.isUnsafeProperty(f))return h;const m=c[f];return m===void 0?n.isDeepKey(f)?s(c,i.toPath(f),h):h:m}case"number":case"symbol":{typeof f=="number"&&(f=r.toKey(f));const m=c[f];return m===void 0?h:m}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 m=c[f];return m===void 0?h:m}}}function l(c,f,h){if(f.length===0)return h;let m=c;for(let g=0;g<f.length;g++){if(m==null||t.isUnsafeProperty(f[g]))return h;m=m[f[g]]}return m===void 0?h:m}e.get=s})(xb)),xb}var _b,NE;function MJ(){return NE||(NE=1,_b=z1().get),_b}var RJ=MJ();const $g=Ms(RJ);var DJ=4;function ws(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:DJ,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Pn(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+ws(c)+s:i+s},"")}var gi=e=>e===0?0:e>0?1:-1,Hi=e=>typeof e=="number"&&e!=+e,Go=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,ze=e=>(typeof e=="number"||e instanceof Number)&&!Hi(e),Gi=e=>ze(e)||typeof e=="string",LJ=0,Dd=e=>{var t=++LJ;return"".concat(e||"").concat(t)},Ps=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(!ze(t)&&typeof t!="string")return r;var s;if(Go(t)){if(n==null)return r;var l=t.indexOf("%");s=n*parseFloat(t.slice(0,l))/100}else s=+t;return Hi(s)&&(s=r),i&&n!=null&&s>n&&(s=n),s},RL=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 Ri(e,t,n){return ze(e)&&ze(t)?ws(e+n*(t-e)):t}function DL(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):$g(r,t))===n)}var Rn=e=>e===null||typeof e>"u",sf=e=>Rn(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Li(e){return e!=null}function Yc(){}var IJ=["type","size","sizeType"];function Mw(){return Mw=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},Mw.apply(null,arguments)}function CE(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 _E(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CE(Object(n),!0).forEach(function(r){$J(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $J(e,t,n){return(t=UJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UJ(e){var t=BJ(e,"string");return typeof t=="symbol"?t:t+""}function BJ(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 qJ(e,t){if(e==null)return{};var n,r,i=FJ(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 FJ(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 LL={symbolCircle:E1,symbolCross:iJ,symbolDiamond:sJ,symbolSquare:oJ,symbolStar:dJ,symbolTriangle:fJ,symbolWye:pJ},KJ=Math.PI/180,HJ=e=>{var t="symbol".concat(sf(e));return LL[t]||E1},GJ=(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*KJ;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}},VJ=(e,t)=>{LL["symbol".concat(sf(e))]=t},IL=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=qJ(e,IJ),s=_E(_E({},i),{},{type:t,size:n,sizeType:r}),l="circle";typeof t=="string"&&(l=t);var c=()=>{var y=HJ(l),v=mJ().type(y).size(GJ(n,r,l)),w=v();if(w!==null)return w},{className:f,cx:h,cy:m}=s,g=_r(s);return ze(h)&&ze(m)&&ze(n)?x.createElement("path",Mw({},g,{className:bt("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(m,")"),d:c()})):null};IL.registerSymbol=VJ;var $L=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,M1=(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=>{_1(i)&&typeof n[i]=="function"&&(r[i]=(s=>n[i](n,s)))}),r},ZJ=(e,t,n)=>r=>(e(t,n,r),null),UL=(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];_1(i)&&typeof s=="function"&&(r||(r={}),r[i]=ZJ(s,t,n))}),r};function OE(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 YJ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OE(Object(n),!0).forEach(function(r){WJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WJ(e,t,n){return(t=QJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QJ(e){var t=XJ(e,"string");return typeof t=="symbol"?t:t+""}function XJ(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=YJ({},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 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 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 BL(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){JJ(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 JJ(e,t,n){return(t=eee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eee(e){var t=tee(e,"string");return typeof t=="symbol"?t:t+""}function tee(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 Kr=32,nee={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function ree(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function iee(e){var{data:t,iconType:n,inactiveColor:r}=e,i=Kr/2,s=Kr/6,l=Kr/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:ree(t.payload),x1:0,y1:i,x2:Kr,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(Kr,"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(Kr/8,"h").concat(Kr,"v").concat(Kr*3/4,"h").concat(-Kr,"z"),className:"recharts-legend-icon"});if(x.isValidElement(t.legendIcon)){var h=BL({},t);return delete h.legendIcon,x.cloneElement(t.legendIcon,h)}return x.createElement(IL,{fill:c,cx:i,cy:i,size:Kr,sizeType:"diameter",type:f})}function aee(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:s,iconType:l,labelStyle:c}=e,f={x:0,y:0,width:Kr,height:Kr},h={display:r==="horizontal"?"inline-block":"block",marginRight:10},m={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((g,y)=>{var v=g.formatter||i,w=bt({"recharts-legend-item":!0,["legend-item-".concat(y)]:!0,inactive:g.inactive});if(g.type==="none")return null;var S=typeof c=="object"?BL({},c):{};S.color=g.inactive?s:S.color||g.color;var N=v?v(g.value,g,y):g.value;return x.createElement("li",gm({className:w,style:h,key:"legend-item-".concat(y)},UL(e,g,y)),x.createElement(O1,{width:n,height:n,viewBox:f,style:m,"aria-label":"".concat(g.value," legend icon")},x.createElement(iee,{data:g,iconType:l,inactiveColor:s})),x.createElement("span",{className:"recharts-legend-item-text",style:S},N))})}var see=e=>{var t=Ar(e,nee),{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(aee,gm({},t,{payload:n})))},Ob={},kb={},AE;function oee(){return AE||(AE=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})(kb)),kb}var Ab={},EE;function lee(){return EE||(EE=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})(Ab)),Ab}var Eb={},TE;function qL(){return TE||(TE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(Eb)),Eb}var Tb={},Pb={},zb={},PE;function cee(){return PE||(PE=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 zE;function FL(){return zE||(zE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=cee();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(Pb)),Pb}var Mb={},ME;function uee(){return ME||(ME=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(Mb)),Mb}var RE;function dee(){return RE||(RE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=FL(),n=uee();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(Tb)),Tb}var Rb={},Db={},DE;function fee(){return DE||(DE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=z1();function n(r){return function(i){return t.get(i,r)}}e.property=n})(Db)),Db}var Lb={},Ib={},$b={},Ub={},LE;function KL(){return LE||(LE=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})(Ub)),Ub}var Bb={},IE;function HL(){return IE||(IE=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})(Bb)),Bb}var qb={},$E;function GL(){return $E||($E=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})(qb)),qb}var UE;function hee(){return UE||(UE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=KL(),n=HL(),r=GL();function i(m,g,y){return typeof y!="function"?i(m,g,()=>{}):s(m,g,function v(w,S,N,C,A,k){const _=y(w,S,N,C,A,k);return _!==void 0?!!_:s(w,S,v,k)},new Map)}function s(m,g,y,v){if(g===m)return!0;switch(typeof g){case"object":return l(m,g,y,v);case"function":return Object.keys(g).length>0?s(m,{...g},y,v):r.isEqualsSameValueZero(m,g);default:return t.isObject(m)?typeof g=="string"?g==="":!0:r.isEqualsSameValueZero(m,g)}}function l(m,g,y,v){if(g==null)return!0;if(Array.isArray(g))return f(m,g,y,v);if(g instanceof Map)return c(m,g,y,v);if(g instanceof Set)return h(m,g,y,v);const w=Object.keys(g);if(m==null||n.isPrimitive(m))return w.length===0;if(w.length===0)return!0;if(v?.has(g))return v.get(g)===m;v?.set(g,m);try{for(let S=0;S<w.length;S++){const N=w[S];if(!n.isPrimitive(m)&&!(N in m)||g[N]===void 0&&m[N]!==void 0||g[N]===null&&m[N]!==null||!y(m[N],g[N],N,m,g,v))return!1}return!0}finally{v?.delete(g)}}function c(m,g,y,v){if(g.size===0)return!0;if(!(m instanceof Map))return!1;for(const[w,S]of g.entries()){const N=m.get(w);if(y(N,S,w,m,g,v)===!1)return!1}return!0}function f(m,g,y,v){if(g.length===0)return!0;if(!Array.isArray(m))return!1;const w=new Set;for(let S=0;S<g.length;S++){const N=g[S];let C=!1;for(let A=0;A<m.length;A++){if(w.has(A))continue;const k=m[A];let _=!1;if(y(k,N,S,m,g,v)&&(_=!0),_){w.add(A),C=!0;break}}if(!C)return!1}return!0}function h(m,g,y,v){return g.size===0?!0:m instanceof Set?f([...m],[...g],y,v):!1}e.isMatchWith=i,e.isSetMatch=h})($b)),$b}var BE;function VL(){return BE||(BE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=hee();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(Ib)),Ib}var Fb={},Kb={},Hb={},qE;function pee(){return qE||(qE=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})(Hb)),Hb}var Gb={},FE;function R1(){return FE||(FE=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})(Gb)),Gb}var Vb={},KE;function ZL(){return KE||(KE=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]",m="[object Array]",g="[object Function]",y="[object ArrayBuffer]",v="[object Object]",w="[object Error]",S="[object DataView]",N="[object Uint8Array]",C="[object Uint8ClampedArray]",A="[object Uint16Array]",k="[object Uint32Array]",_="[object BigUint64Array]",T="[object Int8Array]",P="[object Int16Array]",E="[object Int32Array]",z="[object BigInt64Array]",D="[object Float32Array]",F="[object Float64Array]";e.argumentsTag=s,e.arrayBufferTag=y,e.arrayTag=m,e.bigInt64ArrayTag=z,e.bigUint64ArrayTag=_,e.booleanTag=i,e.dataViewTag=S,e.dateTag=c,e.errorTag=w,e.float32ArrayTag=D,e.float64ArrayTag=F,e.functionTag=g,e.int16ArrayTag=P,e.int32ArrayTag=E,e.int8ArrayTag=T,e.mapTag=f,e.numberTag=r,e.objectTag=v,e.regexpTag=t,e.setTag=h,e.stringTag=n,e.symbolTag=l,e.uint16ArrayTag=A,e.uint32ArrayTag=k,e.uint8ArrayTag=N,e.uint8ClampedArrayTag=C})(Vb)),Vb}var Zb={},HE;function mee(){return HE||(HE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(Zb)),Zb}var GE;function YL(){return GE||(GE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=pee(),n=R1(),r=ZL(),i=HL(),s=mee();function l(m,g){return c(m,void 0,m,new Map,g)}function c(m,g,y,v=new Map,w=void 0){const S=w?.(m,g,y,v);if(S!==void 0)return S;if(i.isPrimitive(m))return m;if(v.has(m))return v.get(m);if(Array.isArray(m)){const N=new Array(m.length);v.set(m,N);for(let C=0;C<m.length;C++)N[C]=c(m[C],C,y,v,w);return Object.hasOwn(m,"index")&&(N.index=m.index),Object.hasOwn(m,"input")&&(N.input=m.input),N}if(m instanceof Date)return new Date(m.getTime());if(m instanceof RegExp){const N=new RegExp(m.source,m.flags);return N.lastIndex=m.lastIndex,N}if(m instanceof Map){const N=new Map;v.set(m,N);for(const[C,A]of m)N.set(C,c(A,C,y,v,w));return N}if(m instanceof Set){const N=new Set;v.set(m,N);for(const C of m)N.add(c(C,void 0,y,v,w));return N}if(typeof Buffer<"u"&&Buffer.isBuffer(m))return m.subarray();if(s.isTypedArray(m)){const N=new(Object.getPrototypeOf(m)).constructor(m.length);v.set(m,N);for(let C=0;C<m.length;C++)N[C]=c(m[C],C,y,v,w);return N}if(m instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&m instanceof SharedArrayBuffer)return m.slice(0);if(m instanceof DataView){const N=new DataView(m.buffer.slice(0),m.byteOffset,m.byteLength);return v.set(m,N),f(N,m,y,v,w),N}if(typeof File<"u"&&m instanceof File){const N=new File([m],m.name,{type:m.type});return v.set(m,N),f(N,m,y,v,w),N}if(typeof Blob<"u"&&m instanceof Blob){const N=new Blob([m],{type:m.type});return v.set(m,N),f(N,m,y,v,w),N}if(m instanceof Error){const N=structuredClone(m);return v.set(m,N),N.message=m.message,N.name=m.name,N.stack=m.stack,N.cause=m.cause,N.constructor=m.constructor,f(N,m,y,v,w),N}if(m instanceof Boolean){const N=new Boolean(m.valueOf());return v.set(m,N),f(N,m,y,v,w),N}if(m instanceof Number){const N=new Number(m.valueOf());return v.set(m,N),f(N,m,y,v,w),N}if(m instanceof String){const N=new String(m.valueOf());return v.set(m,N),f(N,m,y,v,w),N}if(typeof m=="object"&&h(m)){const N=Object.create(Object.getPrototypeOf(m));return v.set(m,N),f(N,m,y,v,w),N}return m}function f(m,g,y=m,v,w){const S=[...Object.keys(g),...t.getSymbols(g)];for(let N=0;N<S.length;N++){const C=S[N],A=Object.getOwnPropertyDescriptor(m,C);(A==null||A.writable)&&(m[C]=c(g[C],C,y,v,w))}}function h(m){switch(n.getTag(m)){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})(Kb)),Kb}var VE;function gee(){return VE||(VE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=YL();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(Fb)),Fb}var ZE;function yee(){return ZE||(ZE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=VL(),n=gee();function r(i){return i=n.cloneDeep(i),s=>t.isMatch(s,i)}e.matches=r})(Lb)),Lb}var Yb={},Wb={},Qb={},YE;function vee(){return YE||(YE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=YL(),n=R1(),r=ZL();function i(s,l){return t.cloneDeepWith(s,(c,f,h,m)=>{const g=l?.(c,f,h,m);if(g!==void 0)return g;if(typeof s=="object"){if(n.getTag(s)===r.objectTag&&typeof s.constructor!="function"){const y={};return m.set(s,y),t.copyProperties(y,s,h,m),y}switch(Object.prototype.toString.call(s)){case r.numberTag:case r.stringTag:case r.booleanTag:{const y=new s.constructor(s?.valueOf());return t.copyProperties(y,s),y}case r.argumentsTag:{const y={};return t.copyProperties(y,s),y.length=s.length,y[Symbol.iterator]=s[Symbol.iterator],y}default:return}}})}e.cloneDeepWith=i})(Qb)),Qb}var WE;function bee(){return WE||(WE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=vee();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(Wb)),Wb}var Xb={},Jb={},QE;function WL(){return QE||(QE=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})(Jb)),Jb}var ex={},XE;function xee(){return XE||(XE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=R1();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(ex)),ex}var JE;function wee(){return JE||(JE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ML(),n=WL(),r=xee(),i=P1();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 m=0;m<f.length;m++){const g=f[m];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})(Xb)),Xb}var eT;function See(){return eT||(eT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=VL(),n=T1(),r=bee(),i=z1(),s=wee();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 m=i.get(h,c);return m===void 0?s.has(h,c):f===void 0?m===void 0:t.isMatch(m,f)}}e.matchesProperty=l})(Yb)),Yb}var tT;function jee(){return tT||(tT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=qL(),n=fee(),r=yee(),i=See();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})(Rb)),Rb}var nT;function Nee(){return nT||(nT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=oee(),n=lee(),r=qL(),i=dee(),s=jee();function l(c,f=r.identity){return i.isArrayLikeObject(c)?t.uniqBy(Array.from(c),n.ary(s.iteratee(f),1)):[]}e.uniqBy=l})(Ob)),Ob}var tx,rT;function Cee(){return rT||(rT=1,tx=Nee().uniqBy),tx}var _ee=Cee();const iT=Ms(_ee);function QL(e,t,n){return t===!0?iT(e,n):typeof t=="function"?iT(e,t):e}var D1=x.createContext(null),Oee=e=>e,Qt=()=>{var e=x.useContext(D1);return e?e.store.dispatch:Oee},Lp=()=>{},kee=()=>Lp,Aee=(e,t)=>e===t;function Le(e){var t=x.useContext(D1),n=x.useMemo(()=>t?r=>{if(r!=null)return e(r)}:Lp,[t,e]);return bM.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:kee,t?t.store.getState:Lp,t?t.store.getState:Lp,n,Aee)}function Eee(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Tee(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Pee(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 aT=e=>Array.isArray(e)?e:[e];function zee(e){const t=Array.isArray(e[0])?e[0]:e;return Pee(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Mee(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Ree=class{constructor(e){this.value=e}deref(){return this.value}},Dee=typeof WeakRef<"u"?WeakRef:Ree,Lee=0,sT=1;function up(){return{s:Lee,v:void 0,o:null,p:null}}function XL(e,t={}){let n=up();const{resultEqualityCheck:r}=t;let i,s=0;function l(){let c=n;const{length:f}=arguments;for(let g=0,y=f;g<y;g++){const v=arguments[g];if(typeof v=="function"||typeof v=="object"&&v!==null){let w=c.o;w===null&&(c.o=w=new WeakMap);const S=w.get(v);S===void 0?(c=up(),w.set(v,c)):c=S}else{let w=c.p;w===null&&(c.p=w=new Map);const S=w.get(v);S===void 0?(c=up(),w.set(v,c)):c=S}}const h=c;let m;if(c.s===sT)m=c.v;else if(m=e.apply(null,arguments),s++,r){const g=i?.deref?.()??i;g!=null&&r(g,m)&&(m=g,s!==0&&s--),i=typeof m=="object"&&m!==null||typeof m=="function"?new Dee(m):m}return h.s=sT,h.v=m,m}return l.clearCache=()=>{n=up(),l.resetResultsCount()},l.resultsCount=()=>s,l.resetResultsCount=()=>{s=0},l}function Iee(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()),Eee(h,`createSelector expects an output function after the inputs, but received: [${typeof h}]`);const m={...n,...f},{memoize:g,memoizeOptions:y=[],argsMemoize:v=XL,argsMemoizeOptions:w=[]}=m,S=aT(y),N=aT(w),C=zee(i),A=g(function(){return s++,h.apply(null,arguments)},...S),k=v(function(){l++;const T=Mee(C,arguments);return c=A.apply(null,T),c},...N);return Object.assign(k,{resultFunc:h,memoizedResultFunc:A,dependencies:C,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>c,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:g,argsMemoize:v})};return Object.assign(r,{withTypes:()=>r}),r}var ne=Iee(XL),$ee=Object.assign((e,t=ne)=>{Tee(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:()=>$ee}),nx={},rx={},ix={},oT;function Uee(){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})(ix)),ix}var ax={},sx={},lT;function JL(){return lT||(lT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(sx)),sx}var cT;function Bee(){return cT||(cT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=JL(),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})(ax)),ax}var uT;function qee(){return uT||(uT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Uee(),n=Bee(),r=P1();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(v=>String(v));const h=(v,w)=>{let S=v;for(let N=0;N<w.length&&S!=null;++N)S=S[w[N]];return S},m=(v,w)=>w==null||v==null?w:typeof v=="object"&&"key"in v?Object.hasOwn(w,v.key)?w[v.key]:h(w,v.path):typeof v=="function"?v(w):Array.isArray(v)?h(w,v):typeof w=="object"?w[v]:w,g=l.map(v=>(Array.isArray(v)&&v.length===1&&(v=v[0]),v==null||typeof v=="function"||Array.isArray(v)||n.isKey(v)?v:{key:v,path:r.toPath(v)}));return s.map(v=>({original:v,criteria:g.map(w=>m(w,v))})).slice().sort((v,w)=>{for(let S=0;S<g.length;S++){const N=t.compareValues(v.criteria[S],w.criteria[S],c[S]);if(N!==0)return N}return 0}).map(v=>v.original)}e.orderBy=i})(rx)),rx}var ox={},dT;function Fee(){return dT||(dT=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 m=c[h];Array.isArray(m)&&f<s?l(m,f+1):i.push(m)}};return l(n,0),i}e.flatten=t})(ox)),ox}var lx={},fT;function eI(){return fT||(fT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=WL(),n=FL(),r=KL(),i=GL();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})(lx)),lx}var hT;function Kee(){return hT||(hT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=qee(),n=Fee(),r=eI();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})(nx)),nx}var cx,pT;function Hee(){return pT||(pT=1,cx=Kee().sortBy),cx}var Gee=Hee();const Ug=Ms(Gee);var tI=e=>e.legend.settings,Vee=e=>e.legend.size,Zee=e=>e.legend.payload,Yee=ne([Zee,tI],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?Ug(r,n):r});function Wee(){return Le(Yee)}var dp=1;function nI(){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)>dp||Math.abs(l.left-t.left)>dp||Math.abs(l.top-t.top)>dp||Math.abs(l.width-t.width)>dp)&&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 Tn(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 Qee=typeof Symbol=="function"&&Symbol.observable||"@@observable",mT=Qee,ux=()=>Math.random().toString(36).substring(7).split("").join("."),Xee={INIT:`@@redux/INIT${ux()}`,REPLACE:`@@redux/REPLACE${ux()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${ux()}`},ym=Xee;function L1(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 rI(e,t,n){if(typeof e!="function")throw new Error(Tn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Tn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Tn(1));return n(rI)(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 m(){if(f)throw new Error(Tn(3));return i}function g(N){if(typeof N!="function")throw new Error(Tn(4));if(f)throw new Error(Tn(5));let C=!0;h();const A=c++;return l.set(A,N),function(){if(C){if(f)throw new Error(Tn(6));C=!1,h(),l.delete(A),s=null}}}function y(N){if(!L1(N))throw new Error(Tn(7));if(typeof N.type>"u")throw new Error(Tn(8));if(typeof N.type!="string")throw new Error(Tn(17));if(f)throw new Error(Tn(9));try{f=!0,i=r(i,N)}finally{f=!1}return(s=l).forEach(A=>{A()}),N}function v(N){if(typeof N!="function")throw new Error(Tn(10));r=N,y({type:ym.REPLACE})}function w(){const N=g;return{subscribe(C){if(typeof C!="object"||C===null)throw new Error(Tn(11));function A(){const _=C;_.next&&_.next(m())}return A(),{unsubscribe:N(A)}},[mT](){return this}}}return y({type:ym.INIT}),{dispatch:y,subscribe:g,getState:m,replaceReducer:v,[mT]:w}}function Jee(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:ym.INIT})>"u")throw new Error(Tn(12));if(typeof n(void 0,{type:ym.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Tn(13))})}function iI(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{Jee(n)}catch(s){i=s}return function(l={},c){if(i)throw i;let f=!1;const h={};for(let m=0;m<r.length;m++){const g=r[m],y=n[g],v=l[g],w=y(v,c);if(typeof w>"u")throw c&&c.type,new Error(Tn(14));h[g]=w,f=f||w!==v}return f=f||r.length!==Object.keys(l).length,f?h:l}}function vm(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function ete(...e){return t=>(n,r)=>{const i=t(n,r);let s=()=>{throw new Error(Tn(15))};const l={getState:i.getState,dispatch:(f,...h)=>s(f,...h)},c=e.map(f=>f(l));return s=vm(...c)(i.dispatch),{...i,dispatch:s}}}function aI(e){return L1(e)&&"type"in e&&typeof e.type=="string"}var sI=Symbol.for("immer-nothing"),gT=Symbol.for("immer-draftable"),Jn=Symbol.for("immer-state");function hi(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Nr=Object,Pc=Nr.getPrototypeOf,bm="constructor",Bg="prototype",Rw="configurable",xm="enumerable",Ip="writable",Ld="value",Ca=e=>!!e&&!!e[Jn];function vi(e){return e?oI(e)||Fg(e)||!!e[gT]||!!e[bm]?.[gT]||Kg(e)||Hg(e):!1}var tte=Nr[Bg][bm].toString(),yT=new WeakMap;function oI(e){if(!e||!I1(e))return!1;const t=Pc(e);if(t===null||t===Nr[Bg])return!0;const n=Nr.hasOwnProperty.call(t,bm)&&t[bm];if(n===Object)return!0;if(!uc(n))return!1;let r=yT.get(n);return r===void 0&&(r=Function.toString.call(n),yT.set(n,r)),r===tte}function qg(e,t,n=!0){of(e)===0?(n?Reflect.ownKeys(e):Nr.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function of(e){const t=e[Jn];return t?t.type_:Fg(e)?1:Kg(e)?2:Hg(e)?3:0}var vT=(e,t,n=of(e))=>n===2?e.has(t):Nr[Bg].hasOwnProperty.call(e,t),Dw=(e,t,n=of(e))=>n===2?e.get(t):e[t],wm=(e,t,n,r=of(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function nte(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Fg=Array.isArray,Kg=e=>e instanceof Map,Hg=e=>e instanceof Set,I1=e=>typeof e=="object",uc=e=>typeof e=="function",dx=e=>typeof e=="boolean";function rte(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var ya=e=>e.copy_||e.base_,$1=e=>e.modified_?e.copy_:e.base_;function Lw(e,t){if(Kg(e))return new Map(e);if(Hg(e))return new Set(e);if(Fg(e))return Array[Bg].slice.call(e);const n=oI(e);if(t===!0||t==="class_only"&&!n){const r=Nr.getOwnPropertyDescriptors(e);delete r[Jn];let i=Reflect.ownKeys(r);for(let s=0;s<i.length;s++){const l=i[s],c=r[l];c[Ip]===!1&&(c[Ip]=!0,c[Rw]=!0),(c.get||c.set)&&(r[l]={[Rw]:!0,[Ip]:!0,[xm]:c[xm],[Ld]:e[l]})}return Nr.create(Pc(e),r)}else{const r=Pc(e);if(r!==null&&n)return{...e};const i=Nr.create(r);return Nr.assign(i,e)}}function U1(e,t=!1){return Gg(e)||Ca(e)||!vi(e)||(of(e)>1&&Nr.defineProperties(e,{set:fp,add:fp,clear:fp,delete:fp}),Nr.freeze(e),t&&qg(e,(n,r)=>{U1(r,!0)},!1)),e}function ite(){hi(2)}var fp={[Ld]:ite};function Gg(e){return e===null||!I1(e)?!0:Nr.isFrozen(e)}var Sm="MapSet",Iw="Patches",bT="ArrayMethods",lI={};function Vo(e){const t=lI[e];return t||hi(0,e),t}var xT=e=>!!lI[e],Id,cI=()=>Id,ate=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:xT(Sm)?Vo(Sm):void 0,arrayMethodsPlugin_:xT(bT)?Vo(bT):void 0});function wT(e,t){t&&(e.patchPlugin_=Vo(Iw),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function $w(e){Uw(e),e.drafts_.forEach(ste),e.drafts_=null}function Uw(e){e===Id&&(Id=e.parent_)}var ST=e=>Id=ate(Id,e);function ste(e){const t=e[Jn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function jT(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Jn].modified_&&($w(t),hi(4)),vi(e)&&(e=NT(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Jn].base_,e,t)}else e=NT(t,n);return ote(t,e,!0),$w(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==sI?e:void 0}function NT(e,t){if(Gg(t))return t;const n=t[Jn];if(!n)return jm(t,e.handledSet_,e);if(!Vg(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);fI(n,e)}return n.copy_}function ote(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&U1(t,n)}function uI(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Vg=(e,t)=>e.scope_===t,lte=[];function dI(e,t,n,r){const i=ya(e),s=e.type_;if(r!==void 0&&Dw(i,r,s)===t){wm(i,r,n,s);return}if(!e.draftLocations_){const c=e.draftLocations_=new Map;qg(i,(f,h)=>{if(Ca(h)){const m=c.get(h)||[];m.push(f),c.set(h,m)}})}const l=e.draftLocations_.get(t)??lte;for(const c of l)wm(i,c,n,s)}function cte(e,t,n){e.callbacks_.push(function(i){const s=t;if(!s||!Vg(s,i))return;i.mapSetPlugin_?.fixSetContents(s);const l=$1(s);dI(e,s.draft_??s,l,n),fI(s,i)})}function fI(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)}uI(e)}}function ute(e,t,n){const{scope_:r}=e;if(Ca(n)){const i=n[Jn];Vg(i,r)&&i.callbacks_.push(function(){$p(e);const l=$1(i);dI(e,n,l,t)})}else vi(n)&&e.callbacks_.push(function(){const s=ya(e);e.type_===3?s.has(n)&&jm(n,r.handledSet_,r):Dw(s,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&jm(Dw(e.copy_,t,e.type_),r.handledSet_,r)})}function jm(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Ca(e)||t.has(e)||!vi(e)||Gg(e)||(t.add(e),qg(e,(r,i)=>{if(Ca(i)){const s=i[Jn];if(Vg(s,n)){const l=$1(s);wm(e,r,l,e.type_),uI(s)}}else vi(i)&&jm(i,t,n)})),e}function dte(e,t){const n=Fg(e),r={type_:n?1:0,scope_:t?t.scope_:cI(),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=Nm;n&&(i=[r],s=$d);const{revoke:l,proxy:c}=Proxy.revocable(i,s);return r.draft_=c,r.revoke_=l,[c,r]}var Nm={get(e,t){if(t===Jn)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=ya(e);if(!vT(i,t,e.type_))return fte(e,i,t);const s=i[t];if(e.finalized_||!vi(s)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&rte(t))return s;if(s===fx(e.base_,t)){$p(e);const l=e.type_===1?+t:t,c=qw(e.scope_,s,e,l);return e.copy_[l]=c}return s},has(e,t){return t in ya(e)},ownKeys(e){return Reflect.ownKeys(ya(e))},set(e,t,n){const r=hI(ya(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=fx(ya(e),t),s=i?.[Jn];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(nte(n,i)&&(n!==void 0||vT(e.base_,t,e.type_)))return!0;$p(e),Bw(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),ute(e,t,n)),!0},deleteProperty(e,t){return $p(e),fx(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Bw(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=ya(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Ip]:!0,[Rw]:e.type_!==1||t!=="length",[xm]:r[xm],[Ld]:n[t]}},defineProperty(){hi(11)},getPrototypeOf(e){return Pc(e.base_)},setPrototypeOf(){hi(12)}},$d={};for(let e in Nm){let t=Nm[e];$d[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}$d.deleteProperty=function(e,t){return $d.set.call(this,e,t,void 0)};$d.set=function(e,t,n){return Nm.set.call(this,e[0],t,n,e[0])};function fx(e,t){const n=e[Jn];return(n?ya(n):e)[t]}function fte(e,t,n){const r=hI(t,n);return r?Ld in r?r[Ld]:r.get?.call(e.draft_):void 0}function hI(e,t){if(!(t in e))return;let n=Pc(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Pc(n)}}function Bw(e){e.modified_||(e.modified_=!0,e.parent_&&Bw(e.parent_))}function $p(e){e.copy_||(e.assigned_=new Map,e.copy_=Lw(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var hte=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(uc(n)&&!uc(r)){const l=r;r=n;const c=this;return function(h=l,...m){return c.produce(h,g=>r.call(this,g,...m))}}uc(r)||hi(6),i!==void 0&&!uc(i)&&hi(7);let s;if(vi(n)){const l=ST(this),c=qw(l,n,void 0);let f=!0;try{s=r(c),f=!1}finally{f?$w(l):Uw(l)}return wT(l,i),jT(s,l)}else if(!n||!I1(n)){if(s=r(n),s===void 0&&(s=n),s===sI&&(s=void 0),this.autoFreeze_&&U1(s,!0),i){const l=[],c=[];Vo(Iw).generateReplacementPatches_(n,s,{patches_:l,inversePatches_:c}),i(l,c)}return s}else hi(1,n)},this.produceWithPatches=(n,r)=>{if(uc(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]},dx(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),dx(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),dx(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){vi(t)||hi(8),Ca(t)&&(t=Zr(t));const n=ST(this),r=qw(n,t,void 0);return r[Jn].isManual_=!0,Uw(n),r}finishDraft(t,n){const r=t&&t[Jn];(!r||!r.isManual_)&&hi(9);const{scope_:i}=r;return wT(i,n),jT(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=Vo(Iw).applyPatches_;return Ca(t)?i(t,n):this.produce(t,s=>i(s,n))}};function qw(e,t,n,r){const[i,s]=Kg(t)?Vo(Sm).proxyMap_(t,n):Hg(t)?Vo(Sm).proxySet_(t,n):dte(t,n);return(n?.scope_??cI()).drafts_.push(i),s.callbacks_=n?.callbacks_??[],s.key_=r,n&&r!==void 0?cte(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 Zr(e){return Ca(e)||hi(10,e),pI(e)}function pI(e){if(!vi(e)||Gg(e))return e;const t=e[Jn];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Lw(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Lw(e,!0);return qg(n,(i,s)=>{wm(n,i,pI(s))},r),t&&(t.finalized_=!1),n}var pte=new hte,mI=pte.produce;function gI(e){return({dispatch:n,getState:r})=>i=>s=>typeof s=="function"?s(n,r,e):i(s)}var mte=gI(),gte=gI,yte=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?vm:vm.apply(null,arguments)};function Or(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(Cr(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=>aI(r)&&r.type===e,n}var yI=class md extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,md.prototype)}static get[Symbol.species](){return md}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new md(...t[0].concat(this)):new md(...t.concat(this))}};function CT(e){return vi(e)?mI(e,()=>{}):e}function hp(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function vte(e){return typeof e=="boolean"}var bte=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:s=!0}=t??{};let l=new yI;return n&&(vte(n)?l.push(mte):l.push(gte(n.extraArgument))),l},vI="RTK_autoBatch",Tt=()=>e=>({payload:e,meta:{[vI]:!0}}),_T=e=>t=>{setTimeout(t,e)},bI=(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:_T(10):e.type==="callback"?e.queueNotification:_T(e.timeout),h=()=>{l=!1,s&&(s=!1,c.forEach(m=>m()))};return Object.assign({},r,{subscribe(m){const g=()=>i&&m(),y=r.subscribe(g);return c.add(m),()=>{y(),c.delete(m)}},dispatch(m){try{return i=!m?.meta?.[vI],s=!i,s&&(l||(l=!0,f(h))),r.dispatch(m)}finally{i=!0}}})},xte=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new yI(e);return r&&i.push(bI(typeof r=="object"?r:void 0)),i};function wte(e){const t=bte(),{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(L1(n))c=iI(n);else throw new Error(Cr(1));let f;typeof r=="function"?f=r(t):f=t();let h=vm;i&&(h=yte({trace:!1,...typeof i=="object"&&i}));const m=ete(...f),g=xte(m);let y=typeof l=="function"?l(g):g();const v=h(...y);return rI(c,s,v)}function xI(e){const t={},n=[];let r;const i={addCase(s,l){const c=typeof s=="string"?s:s.type;if(!c)throw new Error(Cr(28));if(c in t)throw new Error(Cr(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 Ste(e){return typeof e=="function"}function jte(e,t){let[n,r,i]=xI(t),s;if(Ste(e))s=()=>CT(e());else{const c=CT(e);s=()=>c}function l(c=s(),f){let h=[n[f.type],...r.filter(({matcher:m})=>m(f)).map(({reducer:m})=>m)];return h.filter(m=>!!m).length===0&&(h=[i]),h.reduce((m,g)=>{if(g)if(Ca(m)){const v=g(m,f);return v===void 0?m:v}else{if(vi(m))return mI(m,y=>g(y,f));{const y=g(m,f);if(y===void 0){if(m===null)return m;throw Error("A case reducer on a non-draftable value must not return undefined")}return y}}return m},c)}return l.getInitialState=s,l}var Nte="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Cte=(e=21)=>{let t="",n=e;for(;n--;)t+=Nte[Math.random()*64|0];return t},_te=Symbol.for("rtk-slice-createasyncthunk");function Ote(e,t){return`${e}/${t}`}function kte({creators:e}={}){const t=e?.asyncThunk?.[_te];return function(r){const{name:i,reducerPath:s=i}=r;if(!i)throw new Error(Cr(11));const l=(typeof r.reducers=="function"?r.reducers(Ete()):r.reducers)||{},c=Object.keys(l),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},h={addCase(k,_){const T=typeof k=="string"?k:k.type;if(!T)throw new Error(Cr(12));if(T in f.sliceCaseReducersByType)throw new Error(Cr(13));return f.sliceCaseReducersByType[T]=_,h},addMatcher(k,_){return f.sliceMatchers.push({matcher:k,reducer:_}),h},exposeAction(k,_){return f.actionCreators[k]=_,h},exposeCaseReducer(k,_){return f.sliceCaseReducersByName[k]=_,h}};c.forEach(k=>{const _=l[k],T={reducerName:k,type:Ote(i,k),createNotation:typeof r.reducers=="function"};Pte(_)?Mte(T,_,h,t):Tte(T,_,h)});function m(){const[k={},_=[],T=void 0]=typeof r.extraReducers=="function"?xI(r.extraReducers):[r.extraReducers],P={...k,...f.sliceCaseReducersByType};return jte(r.initialState,E=>{for(let z in P)E.addCase(z,P[z]);for(let z of f.sliceMatchers)E.addMatcher(z.matcher,z.reducer);for(let z of _)E.addMatcher(z.matcher,z.reducer);T&&E.addDefaultCase(T)})}const g=k=>k,y=new Map,v=new WeakMap;let w;function S(k,_){return w||(w=m()),w(k,_)}function N(){return w||(w=m()),w.getInitialState()}function C(k,_=!1){function T(E){let z=E[k];return typeof z>"u"&&_&&(z=hp(v,T,N)),z}function P(E=g){const z=hp(y,_,()=>new WeakMap);return hp(z,E,()=>{const D={};for(const[F,U]of Object.entries(r.selectors??{}))D[F]=Ate(U,E,()=>hp(v,E,N),_);return D})}return{reducerPath:k,getSelectors:P,get selectors(){return P(T)},selectSlice:T}}const A={name:i,reducer:S,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:N,...C(s),injectInto(k,{reducerPath:_,...T}={}){const P=_??s;return k.inject({reducerPath:P,reducer:S},T),{...A,...C(P,!0)}}};return A}}function Ate(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 Fn=kte();function Ete(){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 Tte({type:e,reducerName:t,createNotation:n},r,i){let s,l;if("reducer"in r){if(n&&!zte(r))throw new Error(Cr(17));s=r.reducer,l=r.prepare}else s=r;i.addCase(e,s).exposeCaseReducer(t,s).exposeAction(t,l?Or(e,l):Or(e))}function Pte(e){return e._reducerDefinitionType==="asyncThunk"}function zte(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Mte({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Cr(18));const{payloadCreator:s,fulfilled:l,pending:c,rejected:f,settled:h,options:m}=n,g=i(e,s,m);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||pp,pending:c||pp,rejected:f||pp,settled:h||pp})}function pp(){}var Rte="task",wI="listener",SI="completed",B1="cancelled",Dte=`task-${B1}`,Lte=`task-${SI}`,Fw=`${wI}-${B1}`,Ite=`${wI}-${SI}`,Zg=class{constructor(e){this.code=e,this.message=`${Rte} ${B1} (reason: ${e})`}name="TaskAbortError";message},q1=(e,t)=>{if(typeof e!="function")throw new TypeError(Cr(32))},Cm=()=>{},jI=(e,t=Cm)=>(e.catch(t),e),NI=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Ro=e=>{if(e.aborted)throw new Zg(e.reason)};function CI(e,t){let n=Cm;return new Promise((r,i)=>{const s=()=>i(new Zg(e.reason));if(e.aborted){s();return}n=NI(e,s),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Cm})}var $te=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof Zg?"cancelled":"rejected",error:n}}finally{t?.()}},_m=e=>t=>jI(CI(e,t).then(n=>(Ro(e),n))),_I=e=>{const t=_m(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:jc}=Object,OT={},Yg="listenerMiddleware",Ute=(e,t)=>{const n=r=>NI(e,()=>r.abort(e.reason));return(r,i)=>{q1(r);const s=new AbortController;n(s);const l=$te(async()=>{Ro(e),Ro(s.signal);const c=await r({pause:_m(s.signal),delay:_I(s.signal),signal:s.signal});return Ro(s.signal),c},()=>s.abort(Lte));return i?.autoJoin&&t.push(l.catch(Cm)),{result:_m(e)(l),cancel(){s.abort(Dte)}}}},Bte=(e,t)=>{const n=async(r,i)=>{Ro(t);let s=()=>{};const c=[new Promise((f,h)=>{let m=e({predicate:r,effect:(g,y)=>{y.unsubscribe(),f([g,y.getState(),y.getOriginalState()])}});s=()=>{m(),h()}})];i!=null&&c.push(new Promise(f=>setTimeout(f,i,null)));try{const f=await CI(t,Promise.race(c));return Ro(t),f}finally{s()}};return(r,i)=>jI(n(r,i))},OI=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:s}=e;if(t)i=Or(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Cr(21));return q1(s),{predicate:i,type:t,effect:s}},kI=jc(e=>{const{type:t,predicate:n,effect:r}=OI(e);return{id:Cte(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Cr(22))}}},{withTypes:()=>kI}),kT=(e,t)=>{const{type:n,effect:r,predicate:i}=OI(t);return Array.from(e.values()).find(s=>(typeof n=="string"?s.type===n:s.predicate===i)&&s.effect===r)},Kw=e=>{e.pending.forEach(t=>{t.abort(Fw)})},qte=(e,t)=>()=>{for(const n of t.keys())Kw(n);e.clear()},AT=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},AI=jc(Or(`${Yg}/add`),{withTypes:()=>AI}),Fte=Or(`${Yg}/removeAll`),EI=jc(Or(`${Yg}/remove`),{withTypes:()=>EI}),Kte=(...e)=>{console.error(`${Yg}/error`,...e)},lf=(e={})=>{const t=new Map,n=new Map,r=v=>{const w=n.get(v)??0;n.set(v,w+1)},i=v=>{const w=n.get(v)??1;w===1?n.delete(v):n.set(v,w-1)},{extra:s,onError:l=Kte}=e;q1(l);const c=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),w=>{v.unsubscribe(),w?.cancelActive&&Kw(v)}),f=v=>{const w=kT(t,v)??kI(v);return c(w)};jc(f,{withTypes:()=>f});const h=v=>{const w=kT(t,v);return w&&(w.unsubscribe(),v.cancelActive&&Kw(w)),!!w};jc(h,{withTypes:()=>h});const m=async(v,w,S,N)=>{const C=new AbortController,A=Bte(f,C.signal),k=[];try{v.pending.add(C),r(v),await Promise.resolve(v.effect(w,jc({},S,{getOriginalState:N,condition:(_,T)=>A(_,T).then(Boolean),take:A,delay:_I(C.signal),pause:_m(C.signal),extra:s,signal:C.signal,fork:Ute(C.signal,k),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((_,T,P)=>{_!==C&&(_.abort(Fw),P.delete(_))})},cancel:()=>{C.abort(Fw),v.pending.delete(C)},throwIfCancelled:()=>{Ro(C.signal)}})))}catch(_){_ instanceof Zg||AT(l,_,{raisedBy:"effect"})}finally{await Promise.all(k),C.abort(Ite),i(v),v.pending.delete(C)}},g=qte(t,n);return{middleware:v=>w=>S=>{if(!aI(S))return w(S);if(AI.match(S))return f(S.payload);if(Fte.match(S)){g();return}if(EI.match(S))return h(S.payload);let N=v.getState();const C=()=>{if(N===OT)throw new Error(Cr(23));return N};let A;try{if(A=w(S),t.size>0){const k=v.getState(),_=Array.from(t.values());for(const T of _){let P=!1;try{P=T.predicate(S,k,N)}catch(E){P=!1,AT(l,E,{raisedBy:"predicate"})}P&&m(T,S,v,C)}}}finally{N=OT}return A},startListening:f,stopListening:h,clearListeners:g}};function Cr(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 Hte={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},TI=Fn({name:"chartLayout",initialState:Hte,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:Gte,setLayout:Vte,setChartSize:Zte,setScale:Yte}=TI.actions,Wte=TI.reducer;function PI(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function ct(e){return Number.isFinite(e)}function zs(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function ET(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 gc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ET(Object(n),!0).forEach(function(r){Qte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ET(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qte(e,t,n){return(t=Xte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xte(e){var t=Jte(e,"string");return typeof t=="symbol"?t:t+""}function Jte(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 jn(e,t,n){return Rn(e)||Rn(t)?n:Gi(t)?$g(e,t,n):typeof t=="function"?t(e):n}var ene=(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"&&ze(e[s]))return gc(gc({},e),{},{[s]:e[s]+(r||0)});if((c==="horizontal"||c==="vertical"&&s==="center")&&l!=="middle"&&ze(e[l]))return gc(gc({},e),{},{[l]:e[l]+(i||0)})}return e},Yi=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",tne=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 m=h[1],g=h[0],y=Hi(m)?g:m;y>=0?(h[0]=s,s+=y,h[1]=s):(h[0]=l,l+=y,h[1]=l)}}}},nne=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=Hi(f[1])?f[0]:f[1];h>=0?(f[0]=s,s+=h,f[1]=s):(f[0]=0,f[1]=0)}}}},rne={sign:tne,expand:AJ,none:Ho,silhouette:EJ,wiggle:TJ,positive:nne},ine=(e,t,n)=>{var r,i=(r=rne[n])!==null&&r!==void 0?r:Ho,s=kJ().keys(t).value((c,f)=>Number(jn(c,f,0))).order(zw).offset(i),l=s(e);return l.forEach((c,f)=>{c.forEach((h,m)=>{var g=jn(e[m],t[f],0);Array.isArray(g)&&g.length===2&&ze(g[0])&&ze(g[1])&&(h[0]=g[0],h[1]=g[1])})}),l};function ane(e){return e==null?void 0:String(e)}function TT(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:s,dataKey:l}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Rn(i[t.dataKey])){var c=DL(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=jn(i,Rn(l)?t.dataKey:l),h=t.scale.map(f);return ze(h)?h:null}var sne=e=>{var t=e.flat(2).filter(ze);return[Math.min(...t),Math.max(...t)]},one=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],lne=(e,t,n)=>{if(e!=null)return one(Object.keys(e).reduce((r,i)=>{var s=e[i];if(!s)return r;var{stackedData:l}=s,c=l.reduce((f,h)=>{var m=PI(h,t,n),g=sne(m);return!ct(g[0])||!ct(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]))},PT=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,zT=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Om=(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=Ug(t,m=>m.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 MT(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:s}=e;return gc(gc({},t),{},{dataKey:n,payload:r,value:i,name:s})}function zI(e,t){if(e)return String(e);if(typeof t=="string")return t}var cne=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},une=(e,t)=>t==="centric"?e.angle:e.radius,Ea=e=>e.layout.width,Ta=e=>e.layout.height,dne=e=>e.layout.scale,MI=e=>e.layout.margin,Wg=ne(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Qg=ne(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),fne="data-recharts-item-index",hne="data-recharts-item-id",cf=60;function RT(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 mp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RT(Object(n),!0).forEach(function(r){pne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pne(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=gne(e,"string");return typeof t=="symbol"?t:t+""}function gne(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 yne=e=>e.brush.height;function vne(e){var t=Qg(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:cf;return n+i}return n},0)}function bne(e){var t=Qg(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:cf;return n+i}return n},0)}function xne(e){var t=Wg(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function wne(e){var t=Wg(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var Ln=ne([Ea,Ta,MI,yne,vne,bne,xne,wne,tI,Vee],(e,t,n,r,i,s,l,c,f,h)=>{var m={left:(n.left||0)+i,right:(n.right||0)+s},g={top:(n.top||0)+l,bottom:(n.bottom||0)+c},y=mp(mp({},g),m),v=y.bottom;y.bottom+=r,y=ene(y,f,h);var w=e-y.left-y.right,S=t-y.top-y.bottom;return mp(mp({brushBottom:v},y),{},{width:Math.max(w,0),height:Math.max(S,0)})}),Sne=ne(Ln,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),RI=ne(Ea,Ta,(e,t)=>({x:0,y:0,width:e,height:t})),jne=x.createContext(null),Er=()=>x.useContext(jne)!=null,Xg=e=>e.brush,Jg=ne([Xg,Ln,MI],(e,t,n)=>({height:e.height,x:ze(e.x)?e.x:t.left,y:ze(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:ze(e.width)?e.width:t.width})),hx={},px={},mx={},DT;function Nne(){return DT||(DT=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"),m=()=>{c!==null&&(n.apply(l,c),l=void 0,c=null)},g=()=>{h&&m(),S()};let y=null;const v=()=>{y!=null&&clearTimeout(y),y=setTimeout(()=>{y=null,g()},r)},w=()=>{y!==null&&(clearTimeout(y),y=null)},S=()=>{w(),l=void 0,c=null},N=()=>{m()},C=function(...A){if(i?.aborted)return;l=this,c=A;const k=y==null;v(),f&&k&&m()};return C.schedule=v,C.cancel=S,C.flush=N,i?.addEventListener("abort",S,{once:!0}),C}e.debounce=t})(mx)),mx}var LT;function Cne(){return LT||(LT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Nne();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 m,g=null;const y=t.debounce(function(...S){m=r.apply(this,S),g=null},i,{edges:h}),v=function(...S){return f!=null&&(g===null&&(g=Date.now()),Date.now()-g>=f)?(m=r.apply(this,S),g=Date.now(),y.cancel(),y.schedule(),m):(y.apply(this,S),m)},w=()=>(y.flush(),m);return v.cancel=y.cancel,v.flush=w,v}e.debounce=n})(px)),px}var IT;function _ne(){return IT||(IT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Cne();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})(hx)),hx}var gx,$T;function One(){return $T||($T=1,gx=_ne().throttle),gx}var kne=One();const Ane=Ms(kne);var UT=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++]))}},Ii={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},DI=(e,t,n)=>{var{width:r=Ii.width,height:i=Ii.height,aspect:s,maxHeight:l}=n,c=Go(r)?e:Number(r),f=Go(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}},Ene={width:0,height:0,overflow:"visible"},Tne={width:0,overflowX:"visible"},Pne={height:0,overflowY:"visible"},zne={},Mne=e=>{var{width:t,height:n}=e,r=Go(t),i=Go(n);return r&&i?Ene:r?Tne:i?Pne:zne};function Rne(e){var{width:t,height:n,aspect:r}=e,i=t,s=n;return i===void 0&&s===void 0?(i=Ii.width,s=Ii.height):i===void 0?i=r&&r>0?void 0:Ii.width:s===void 0&&(s=r&&r>0?void 0:Ii.height),{width:i,height:s}}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 BT(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?BT(Object(n),!0).forEach(function(r){Dne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dne(e,t,n){return(t=Lne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lne(e){var t=Ine(e,"string");return typeof t=="symbol"?t:t+""}function Ine(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 LI=x.createContext(Ii.initialDimension);function $ne(e){return zs(e.width)&&zs(e.height)}function II(e){var{children:t,width:n,height:r}=e,i=x.useMemo(()=>({width:n,height:r}),[n,r]);return $ne(i)?x.createElement(LI.Provider,{value:i},t):null}var F1=()=>x.useContext(LI),Une=x.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=Ii.initialDimension,width:i,height:s,minWidth:l=Ii.minWidth,minHeight:c,maxHeight:f,children:h,debounce:m=Ii.debounce,id:g,className:y,onResize:v,style:w={}}=e,S=x.useRef(null),N=x.useRef();N.current=v,x.useImperativeHandle(t,()=>S.current);var[C,A]=x.useState({containerWidth:r.width,containerHeight:r.height}),k=x.useCallback((z,D)=>{A(F=>{var U=Math.round(z),I=Math.round(D);return F.containerWidth===U&&F.containerHeight===I?F:{containerWidth:U,containerHeight:I}})},[]);x.useEffect(()=>{if(S.current==null||typeof ResizeObserver>"u")return Yc;var z=I=>{var ae,ve=I[0];if(ve!=null){var{width:me,height:G}=ve.contentRect;k(me,G),(ae=N.current)===null||ae===void 0||ae.call(N,me,G)}};m>0&&(z=Ane(z,m,{trailing:!0,leading:!1}));var D=new ResizeObserver(z),{width:F,height:U}=S.current.getBoundingClientRect();return k(F,U),D.observe(S.current),()=>{D.disconnect()}},[k,m]);var{containerWidth:_,containerHeight:T}=C;UT(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:P,calculatedHeight:E}=DI(_,T,{width:i,height:s,aspect:n,maxHeight:f});return UT(P!=null&&P>0||E!=null&&E>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,E,i,s,l,c,n),x.createElement("div",{id:g?"".concat(g):void 0,className:bt("recharts-responsive-container",y),style:qT(qT({},w),{},{width:i,height:s,minWidth:l,minHeight:c,maxHeight:f}),ref:S},x.createElement("div",{style:Mne({width:i,height:s})},x.createElement(II,{width:P,height:E},h)))}),Bne=x.forwardRef((e,t)=>{var n=F1();if(zs(n.width)&&zs(n.height))return e.children;var{width:r,height:i}=Rne({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:s,calculatedHeight:l}=DI(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return ze(s)&&ze(l)?x.createElement(II,{width:s,height:l},e.children):x.createElement(Une,Hw({},e,{width:r,height:i,ref:t}))});function K1(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 ey=()=>{var e,t=Er(),n=Le(Sne),r=Le(Jg),i=(e=Le(Xg))===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}},qne={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},Fne=()=>{var e;return(e=Le(Ln))!==null&&e!==void 0?e:qne},$I=()=>Le(Ea),UI=()=>Le(Ta),Kne=()=>Le(e=>e.layout.margin),Ut=e=>e.layout.layoutType,Wc=()=>Le(Ut),H1=()=>{var e=Wc();if(e==="horizontal"||e==="vertical")return e},BI=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},Hne=()=>{var e=Wc();return e!==void 0},uf=e=>{var t=Qt(),n=Er(),{width:r,height:i}=e,s=F1(),l=r,c=i;return s&&(l=s.width>0?s.width:r,c=s.height>0?s.height:i),x.useEffect(()=>{!n&&zs(l)&&zs(c)&&t(Zte({width:l,height:c}))},[t,n,l,c]),null},qI=Symbol.for("immer-nothing"),FT=Symbol.for("immer-draftable"),kr=Symbol.for("immer-state");function pi(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ud=Object.getPrototypeOf;function zc(e){return!!e&&!!e[kr]}function Zo(e){return e?FI(e)||Array.isArray(e)||!!e[FT]||!!e.constructor?.[FT]||df(e)||ny(e):!1}var Gne=Object.prototype.constructor.toString(),KT=new WeakMap;function FI(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=KT.get(n);return r===void 0&&(r=Function.toString.call(n),KT.set(n,r)),r===Gne}function km(e,t,n=!0){ty(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 ty(e){const t=e[kr];return t?t.type_:Array.isArray(e)?1:df(e)?2:ny(e)?3:0}function Gw(e,t){return ty(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function KI(e,t,n){const r=ty(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Vne(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function df(e){return e instanceof Map}function ny(e){return e instanceof Set}function bo(e){return e.copy_||e.base_}function Vw(e,t){if(df(e))return new Map(e);if(ny(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=FI(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[kr];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(Ud(e),r)}else{const r=Ud(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function G1(e,t=!1){return ry(e)||zc(e)||!Zo(e)||(ty(e)>1&&Object.defineProperties(e,{set:gp,add:gp,clear:gp,delete:gp}),Object.freeze(e),t&&Object.values(e).forEach(n=>G1(n,!0))),e}function Zne(){pi(2)}var gp={value:Zne};function ry(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Yne={};function Yo(e){const t=Yne[e];return t||pi(0,e),t}var Bd;function HI(){return Bd}function Wne(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function HT(e,t){t&&(Yo("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Zw(e){Yw(e),e.drafts_.forEach(Qne),e.drafts_=null}function Yw(e){e===Bd&&(Bd=e.parent_)}function GT(e){return Bd=Wne(Bd,e)}function Qne(e){const t=e[kr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function VT(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[kr].modified_&&(Zw(t),pi(4)),Zo(e)&&(e=Am(t,e),t.parent_||Em(t,e)),t.patches_&&Yo("Patches").generateReplacementPatches_(n[kr].base_,e,t.patches_,t.inversePatches_)):e=Am(t,n,[]),Zw(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==qI?e:void 0}function Am(e,t,n){if(ry(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[kr];if(!i)return km(t,(s,l)=>ZT(e,i,t,s,l,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return Em(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),km(l,(f,h)=>ZT(e,i,s,f,h,n,c),r),Em(e,s,!1),n&&e.patches_&&Yo("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function ZT(e,t,n,r,i,s,l){if(i==null||typeof i!="object"&&!l)return;const c=ry(i);if(!(c&&!l)){if(zc(i)){const f=s&&t&&t.type_!==3&&!Gw(t.assigned_,r)?s.concat(r):void 0,h=Am(e,i,f);if(KI(n,r,h),zc(h))e.canAutoFreeze_=!1;else return}else l&&n.add(i);if(Zo(i)&&!c){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&c)return;Am(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(df(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&Em(e,i)}}}function Em(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&G1(t,n)}function Xne(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:HI(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,s=V1;n&&(i=[r],s=qd);const{revoke:l,proxy:c}=Proxy.revocable(i,s);return r.draft_=c,r.revoke_=l,c}var V1={get(e,t){if(t===kr)return e;const n=bo(e);if(!Gw(n,t))return Jne(e,n,t);const r=n[t];return e.finalized_||!Zo(r)?r:r===yx(e.base_,t)?(vx(e),e.copy_[t]=Qw(r,e)):r},has(e,t){return t in bo(e)},ownKeys(e){return Reflect.ownKeys(bo(e))},set(e,t,n){const r=GI(bo(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=yx(bo(e),t),s=i?.[kr];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Vne(n,i)&&(n!==void 0||Gw(e.base_,t)))return!0;vx(e),Ww(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 yx(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,vx(e),Ww(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=bo(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){pi(11)},getPrototypeOf(e){return Ud(e.base_)},setPrototypeOf(){pi(12)}},qd={};km(V1,(e,t)=>{qd[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});qd.deleteProperty=function(e,t){return qd.set.call(this,e,t,void 0)};qd.set=function(e,t,n){return V1.set.call(this,e[0],t,n,e[0])};function yx(e,t){const n=e[kr];return(n?bo(n):e)[t]}function Jne(e,t,n){const r=GI(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function GI(e,t){if(!(t in e))return;let n=Ud(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Ud(n)}}function Ww(e){e.modified_||(e.modified_=!0,e.parent_&&Ww(e.parent_))}function vx(e){e.copy_||(e.copy_=Vw(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var ere=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,m=>n.call(this,m,...h))}}typeof n!="function"&&pi(6),r!==void 0&&typeof r!="function"&&pi(7);let i;if(Zo(t)){const s=GT(this),l=Qw(t,void 0);let c=!0;try{i=n(l),c=!1}finally{c?Zw(s):Yw(s)}return HT(s,r),VT(i,s)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===qI&&(i=void 0),this.autoFreeze_&&G1(i,!0),r){const s=[],l=[];Yo("Patches").generateReplacementPatches_(t,i,s,l),r(s,l)}return i}else pi(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){Zo(e)||pi(8),zc(e)&&(e=tre(e));const t=GT(this),n=Qw(e,void 0);return n[kr].isManual_=!0,Yw(t),n}finishDraft(e,t){const n=e&&e[kr];(!n||!n.isManual_)&&pi(9);const{scope_:r}=n;return HT(r,t),VT(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=Yo("Patches").applyPatches_;return zc(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Qw(e,t){const n=df(e)?Yo("MapSet").proxyMap_(e,t):ny(e)?Yo("MapSet").proxySet_(e,t):Xne(e,t);return(t?t.scope_:HI()).drafts_.push(n),n}function tre(e){return zc(e)||pi(10,e),VI(e)}function VI(e){if(!Zo(e)||ry(e))return e;const t=e[kr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Vw(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Vw(e,!0);return km(n,(i,s)=>{KI(n,i,VI(s))},r),t&&(t.finalized_=!1),n}var nre=new ere;nre.produce;var rre={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},ZI=Fn({name:"legend",initialState:rre,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:Tt()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Zr(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:Tt()},removeLegendPayload:{reducer(e,t){var n=Zr(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:Tt()}}}),{setLegendSize:YT,setLegendSettings:ire,addLegendPayload:are,replaceLegendPayload:sre,removeLegendPayload:ore}=ZI.actions,lre=ZI.reducer,bx={exports:{}},xx={};var WT;function cre(){if(WT)return xx;WT=1;var e=Uc();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 xx.useSyncExternalStoreWithSelector=function(f,h,m,g,y){var v=i(null);if(v.current===null){var w={hasValue:!1,value:null};v.current=w}else w=v.current;v=l(function(){function N(T){if(!C){if(C=!0,A=T,T=g(T),y!==void 0&&w.hasValue){var P=w.value;if(y(P,T))return k=P}return k=T}if(P=k,n(A,T))return P;var E=g(T);return y!==void 0&&y(P,E)?(A=T,P):(A=T,k=E)}var C=!1,A,k,_=m===void 0?null:m;return[function(){return N(h())},_===null?void 0:function(){return N(_())}]},[h,m,g,y]);var S=r(f,v[0],v[1]);return s(function(){w.hasValue=!0,w.value=S},[S]),c(S),S},xx}var QT;function ure(){return QT||(QT=1,bx.exports=cre()),bx.exports}ure();function dre(e){e()}function fre(){let e=null,t=null;return{clear(){e=null,t=null},notify(){dre(()=>{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 XT={notify(){},get:()=>[]};function hre(e,t){let n,r=XT,i=0,s=!1;function l(S){m();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 m(){i++,n||(n=e.subscribe(f),r=fre())}function g(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=XT)}function y(){s||(s=!0,m())}function v(){s&&(s=!1,g())}const w={addNestedSub:l,notifyNestedSubs:c,handleChangeWrapper:f,isSubscribed:h,trySubscribe:y,tryUnsubscribe:v,getListeners:()=>r};return w}var pre=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",mre=pre(),gre=()=>typeof navigator<"u"&&navigator.product==="ReactNative",yre=gre(),vre=()=>mre||yre?x.useLayoutEffect:x.useEffect,bre=vre();function JT(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function xre(e,t){if(JT(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])||!JT(e[n[i]],t[n[i]]))return!1;return!0}var wre=Symbol.for("react-redux-context"),Sre=typeof globalThis<"u"?globalThis:{};function jre(){if(!x.createContext)return{};const e=Sre[wre]??=new Map;let t=e.get(x.createContext);return t||(t=x.createContext(null),e.set(x.createContext,t)),t}var Nre=jre();function Cre(e){const{children:t,context:n,serverState:r,store:i}=e,s=x.useMemo(()=>{const f=hre(i);return{store:i,subscription:f,getServerState:r?()=>r:void 0}},[i,r]),l=x.useMemo(()=>i.getState(),[i]);bre(()=>{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||Nre;return x.createElement(c.Provider,{value:s},t)}var _re=Cre,Ore=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function kre(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function ff(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(Ore.has(r)){if(e[r]==null&&t[r]==null)continue;if(!xre(e[r],t[r]))return!1}else if(!kre(e[r],t[r]))return!1;return!0}var Are=["contextPayload"];function Xw(){return Xw=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},Xw.apply(null,arguments)}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 Mc(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){Ere(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 Ere(e,t,n){return(t=Tre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tre(e){var t=Pre(e,"string");return typeof t=="symbol"?t:t+""}function Pre(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 zre(e,t){if(e==null)return{};var n,r,i=Mre(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 Mre(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 Rre(e){return e.value}function Dre(e){var{contextPayload:t}=e,n=zre(e,Are),r=QL(t,e.payloadUniqBy,Rre),i=Mc(Mc({},n),{},{payload:r});return x.isValidElement(e.content)?x.cloneElement(e.content,i):typeof e.content=="function"?x.createElement(e.content,i):x.createElement(see,i)}function Lre(e,t,n,r,i,s){var{layout:l,align:c,verticalAlign:f}=t,h,m;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"?m={top:((i||0)-s.height)/2}:m=f==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),Mc(Mc({},h),m)}function Ire(e){var t=Qt();return x.useEffect(()=>{t(ire(e))},[t,e]),null}function $re(e){var t=Qt();return x.useEffect(()=>(t(YT(e)),()=>{t(YT({width:0,height:0}))}),[t,e]),null}function Ure(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var Bre={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function qre(e){var t=Ar(e,Bre),n=Wee(),r=XX(),i=Kne(),{width:s,height:l,wrapperStyle:c,portal:f}=t,[h,m]=nI([n]),g=$I(),y=UI();if(g==null||y==null)return null;var v=g-(i?.left||0)-(i?.right||0),w=Ure(t.layout,l,s,v),S=f?c:Mc(Mc({position:"absolute",width:w?.width||s||"auto",height:w?.height||l||"auto"},Lre(c,t,i,g,y,h)),c),N=f??r;if(N==null||n==null)return null;var C=x.createElement("div",{className:"recharts-legend-wrapper",style:S,ref:m},x.createElement(Ire,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!f&&x.createElement($re,{width:h.width,height:h.height}),x.createElement(Dre,Xw({},t,w,{margin:i,chartWidth:g,chartHeight:y,contextPayload:n})));return el.createPortal(C,N)}var YI=x.memo(qre,ff);YI.displayName="Legend";function Jw(){return Jw=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},Jw.apply(null,arguments)}function t2(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 rd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?t2(Object(n),!0).forEach(function(r){Fre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fre(e,t,n){return(t=Kre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kre(e){var t=Hre(e,"string");return typeof t=="symbol"?t:t+""}function Hre(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 Gre(e){return Array.isArray(e)&&Gi(e[0])&&Gi(e[1])?e.join(" ~ "):e}var tc={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 Vre(e,t){return t==null?e:Ug(e,t)}var Zre=e=>{var{separator:t=tc.separator,contentStyle:n,itemStyle:r,labelStyle:i=tc.labelStyle,payload:s,formatter:l,itemSorter:c,wrapperClassName:f,labelClassName:h,label:m,labelFormatter:g,accessibilityLayer:y=tc.accessibilityLayer}=e,v=()=>{if(s&&s.length){var T={padding:0,margin:0},P=Vre(s,c),E=P.map((z,D)=>{if(!z||z.type==="none")return null;var F=z.formatter||l||Gre,{value:U,name:I}=z,ae=U,ve=I;if(F){var me=F(U,I,z,D,s);if(Array.isArray(me))[ae,ve]=me;else if(me!=null)ae=me;else return null}var G=rd(rd({},tc.itemStyle),{},{color:z.color||tc.itemStyle.color},r);return x.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(D),style:G},Gi(ve)?x.createElement("span",{className:"recharts-tooltip-item-name"},ve):null,Gi(ve)?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},E)}return null},w=rd(rd({},tc.contentStyle),n),S=rd({margin:0},i),N=!Rn(m),C=N?m:"",A=bt("recharts-default-tooltip",f),k=bt("recharts-tooltip-label",h);N&&g&&s!==void 0&&s!==null&&(C=g(m,s));var _=y?{role:"status","aria-live":"assertive"}:{};return x.createElement("div",Jw({className:A,style:w},_),x.createElement("p",{className:k,style:S},x.isValidElement(C)?C:"".concat(C)),v())},id="recharts-tooltip-wrapper",Yre={visibility:"hidden"};function Wre(e){var{coordinate:t,translateX:n,translateY:r}=e;return bt(id,{["".concat(id,"-right")]:ze(n)&&t&&ze(t.x)&&n>=t.x,["".concat(id,"-left")]:ze(n)&&t&&ze(t.x)&&n<t.x,["".concat(id,"-bottom")]:ze(r)&&t&&ze(t.y)&&r>=t.y,["".concat(id,"-top")]:ze(r)&&t&&ze(t.y)&&r<t.y})}function n2(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:s,reverseDirection:l,tooltipDimension:c,viewBox:f,viewBoxDimension:h}=e;if(s&&ze(s[r]))return s[r];var m=n[r]-c-(i>0?i:0),g=n[r]+i;if(t[r])return l[r]?m:g;var y=f[r];if(y==null)return 0;if(l[r]){var v=m,w=y;return v<w?Math.max(g,y):Math.max(m,y)}if(h==null)return 0;var S=g+c,N=y+h;return S>N?Math.max(m,y):Math.max(g,y)}function Qre(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 Xre(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:s,reverseDirection:l,tooltipBox:c,useTranslate3d:f,viewBox:h}=e,m,g,y;return c.height>0&&c.width>0&&n?(g=n2({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:s,reverseDirection:l,tooltipDimension:c.width,viewBox:h,viewBoxDimension:h.width}),y=n2({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:s,reverseDirection:l,tooltipDimension:c.height,viewBox:h,viewBoxDimension:h.height}),m=Qre({translateX:g,translateY:y,useTranslate3d:f})):m=Yre,{cssProperties:m,cssClasses:Wre({translateX:g,translateY:y,coordinate:n})}}var Jre=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),hf={isSsr:Jre()};function WI(){var[e,t]=x.useState(()=>hf.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 r2(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 nc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?r2(Object(n),!0).forEach(function(r){eie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eie(e,t,n){return(t=tie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tie(e){var t=nie(e,"string");return typeof t=="symbol"?t:t+""}function nie(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 rie(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function iie(e){var t,n,r,i,s,l,c=WI(),[f,h]=x.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));x.useEffect(()=>{var w=S=>{if(S.key==="Escape"){var N,C,A,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:(A=(k=e.coordinate)===null||k===void 0?void 0:k.y)!==null&&A!==void 0?A: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(nc(nc({},f),{},{dismissed:!1}));var{cssClasses:m,cssProperties:g}=Xre({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}),y=e.hasPortalFromProps?{}:nc(nc({transition:rie({prefersReducedMotion:c,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},g),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),v=nc(nc({},y),{},{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:m,style:v,ref:e.innerRef},e.children)}var aie=x.memo(iie),QI=()=>{var e;return(e=Le(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};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 i2(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?i2(Object(n),!0).forEach(function(r){sie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sie(e,t,n){return(t=oie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oie(e){var t=lie(e,"string");return typeof t=="symbol"?t:t+""}function lie(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 s2={curveBasisClosed:yJ,curveBasisOpen:vJ,curveBasis:gJ,curveBumpX:nJ,curveBumpY:rJ,curveLinearClosed:bJ,curveLinear:Lg,curveMonotoneX:xJ,curveMonotoneY:wJ,curveNatural:SJ,curveStep:jJ,curveStepAfter:CJ,curveStepBefore:NJ},Tm=e=>ct(e.x)&&ct(e.y),o2=e=>e.base!=null&&Tm(e.base)&&Tm(e),ad=e=>e.x,sd=e=>e.y,cie=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(sf(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=s2["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return s2[n]||Lg},l2={connectNulls:!1,type:"linear"},uie=e=>{var{type:t=l2.type,points:n=[],baseLine:r,layout:i,connectNulls:s=l2.connectNulls}=e,l=cie(t,i),c=s?n.filter(Tm):n;if(Array.isArray(r)){var f,h=n.map((w,S)=>a2(a2({},w),{},{base:r[S]}));i==="vertical"?f=cp().y(sd).x1(ad).x0(w=>w.base.x):f=cp().x(ad).y1(sd).y0(w=>w.base.y);var m=f.defined(o2).curve(l),g=s?h.filter(o2):h;return m(g)}var y;i==="vertical"&&ze(r)?y=cp().y(sd).x1(ad).x0(r):ze(r)?y=cp().x(ad).y1(sd).y0(r):y=jL().x(ad).y(sd);var v=y.defined(Tm).curve(l);return v(c)},Up=e=>{var{className:t,points:n,path:r,pathRef:i}=e,s=Wc();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?uie(l):r;return x.createElement("path",eS({},Fi(e),M1(e),{className:bt("recharts-curve",t),d:c===null?void 0:c,ref:i}))},die=["x","y","top","left","width","height","className"];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)}function c2(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 fie(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?c2(Object(n),!0).forEach(function(r){hie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hie(e,t,n){return(t=pie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pie(e){var t=mie(e,"string");return typeof t=="symbol"?t:t+""}function mie(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 gie(e,t){if(e==null)return{};var n,r,i=yie(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 yie(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 vie=(e,t,n,r,i,s)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(s,",").concat(t,"h").concat(n),bie=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:s=0,height:l=0,className:c}=e,f=gie(e,die),h=fie({x:t,y:n,top:r,left:i,width:s,height:l},f);return!ze(t)||!ze(n)||!ze(s)||!ze(l)||!ze(r)||!ze(i)?null:x.createElement("path",tS({},_r(h),{className:bt("recharts-cross",c),d:vie(t,n,s,l,r,i)}))};function xie(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 u2(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 d2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?u2(Object(n),!0).forEach(function(r){wie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wie(e,t,n){return(t=Sie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sie(e){var t=jie(e,"string");return typeof t=="symbol"?t:t+""}function jie(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 Nie=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),Cie=(e,t,n)=>e.map(r=>"".concat(Nie(r)," ").concat(t,"ms ").concat(n)).join(","),_ie=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),Fd=(e,t)=>Object.keys(t).reduce((n,r)=>d2(d2({},n),{},{[r]:e(r,t[r])}),{});function f2(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 yn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?f2(Object(n),!0).forEach(function(r){Oie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Oie(e,t,n){return(t=kie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kie(e){var t=Aie(e,"string");return typeof t=="symbol"?t:t+""}function Aie(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 Pm=(e,t,n)=>e+(t-e)*n,nS=e=>{var{from:t,to:n}=e;return t!==n},XI=(e,t,n)=>{var r=Fd((i,s)=>{if(nS(s)){var[l,c]=e(s.from,s.to,s.velocity);return yn(yn({},s),{},{from:l,velocity:c})}return s},t);return n<1?Fd((i,s)=>nS(s)&&r[i]!=null?yn(yn({},s),{},{velocity:Pm(s.velocity,r[i].velocity,n),from:Pm(s.from,r[i].from,n)}):s,t):XI(e,r,n-1)};function Eie(e,t,n,r,i,s){var l,c=r.reduce((y,v)=>yn(yn({},y),{},{[v]:{from:e[v],velocity:0,to:t[v]}}),{}),f=()=>Fd((y,v)=>v.from,c),h=()=>!Object.values(c).filter(nS).length,m=null,g=y=>{l||(l=y);var v=y-l,w=v/n.dt;c=XI(n,c,w),i(yn(yn(yn({},e),t),f())),l=y,h()||(m=s.setTimeout(g))};return()=>(m=s.setTimeout(g),()=>{var y;(y=m)===null||y===void 0||y()})}function Tie(e,t,n,r,i,s,l){var c=null,f=i.reduce((g,y)=>{var v=e[y],w=t[y];return v==null||w==null?g:yn(yn({},g),{},{[y]:[v,w]})},{}),h,m=g=>{h||(h=g);var y=(g-h)/r,v=Fd((S,N)=>Pm(...N,n(y)),f);if(s(yn(yn(yn({},e),t),v)),y<1)c=l.setTimeout(m);else{var w=Fd((S,N)=>Pm(...N,n(1)),f);s(yn(yn(yn({},e),t),w))}};return()=>(c=l.setTimeout(m),()=>{var g;(g=c)===null||g===void 0||g()})}const Pie=(e,t,n,r,i,s)=>{var l=_ie(e,t);return n==null?()=>(i(yn(yn({},e),t)),()=>{}):n.isStepper===!0?Eie(e,t,n,l,i,s):Tie(e,t,n,r,l,i,s)};var zm=1e-4,JI=(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),h2=(e,t)=>n=>{var r=JI(e,t);return e$(r,n)},zie=(e,t)=>n=>{var r=JI(e,t),i=[...r.map((s,l)=>s*l).slice(1),0];return e$(i,n)},Mie=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]]},Rie=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=Mie(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},Die=(e,t,n,r)=>{var i=h2(e,n),s=h2(t,r),l=zie(e,n),c=h=>h>1?1:h<0?0:h,f=h=>{for(var m=h>1?1:h,g=m,y=0;y<8;++y){var v=i(g)-m,w=l(g);if(Math.abs(v-m)<zm||w<zm)return s(g);g=c(g-v/w)}return s(g)};return f.isStepper=!1,f},p2=function(){return Die(...Rie(...arguments))},Lie=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,m=f*r,g=f+(h-m)*i/1e3,y=f*i/1e3+l;return Math.abs(y-c)<zm&&Math.abs(g)<zm?[c,0]:[y,g]};return s.isStepper=!0,s.dt=i,s},Iie=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 Lie();default:if(e.split("(")[0]==="cubic-bezier")return p2(e)}return typeof e=="function"?e:null};function $ie(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 Uie{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 Bie(){return $ie(new Uie)}var qie=x.createContext(Bie);function Fie(e,t){var n=x.useContext(qie);return x.useMemo(()=>t??n(e),[e,t,n])}var Kie={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},m2={t:0},wx={t:1};function t$(e){var t=Ar(e,Kie),{isActive:n,canBegin:r,duration:i,easing:s,begin:l,onAnimationEnd:c,onAnimationStart:f,children:h}=t,m=WI(),g=n==="auto"?!hf.isSsr&&!m:n,y=Fie(t.animationId,t.animationManager),[v,w]=x.useState(g?m2:wx),S=x.useRef(null);return x.useEffect(()=>{g||w(wx)},[g]),x.useEffect(()=>{if(!g||!r)return Yc;var N=Pie(m2,wx,Iie(s),i,w,y.getTimeoutController()),C=()=>{S.current=N()};return y.start([f,l,C,i,c]),()=>{y.stop(),S.current&&S.current(),c()}},[g,r,i,s,l,f,c,y]),h(v.t)}function n$(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=x.useRef(Dd(t)),r=x.useRef(e);return r.current!==e&&(n.current=Dd(t),r.current=e),n.current}var Hie=["radius"],Gie=["radius"],g2,y2,v2,b2,x2,w2,S2,j2,N2,C2;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 O2(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 Mm(){return Mm=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},Mm.apply(null,arguments)}function k2(e,t){if(e==null)return{};var n,r,i=Wie(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 Wie(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 Ti(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var A2=(e,t,n,r,i)=>{var s=ws(n),l=ws(r),c=Math.min(Math.abs(s)/2,Math.abs(l)/2),f=l>=0?1:-1,h=s>=0?1:-1,m=l>=0&&s>=0||l<0&&s<0?1:0,g;if(c>0&&Array.isArray(i)){for(var y=[0,0,0,0],v=0,w=4;v<w;v++){var S,N=(S=i[v])!==null&&S!==void 0?S:0;y[v]=N>c?c:N}g=Pn(g2||(g2=Ti(["M",",",""])),e,t+f*y[0]),y[0]>0&&(g+=Pn(y2||(y2=Ti(["A ",",",",0,0,",",",",",""])),y[0],y[0],m,e+h*y[0],t)),g+=Pn(v2||(v2=Ti(["L ",",",""])),e+n-h*y[1],t),y[1]>0&&(g+=Pn(b2||(b2=Ti(["A ",",",",0,0,",`,
240
+ `,",",""])),y[1],y[1],m,e+n,t+f*y[1])),g+=Pn(x2||(x2=Ti(["L ",",",""])),e+n,t+r-f*y[2]),y[2]>0&&(g+=Pn(w2||(w2=Ti(["A ",",",",0,0,",`,
241
+ `,",",""])),y[2],y[2],m,e+n-h*y[2],t+r)),g+=Pn(S2||(S2=Ti(["L ",",",""])),e+h*y[3],t+r),y[3]>0&&(g+=Pn(j2||(j2=Ti(["A ",",",",0,0,",`,
242
+ `,",",""])),y[3],y[3],m,e,t+r-f*y[3])),g+="Z"}else if(c>0&&i===+i&&i>0){var C=Math.min(c,i);g=Pn(N2||(N2=Ti(["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,m,e+h*C,t,e+n-h*C,t,C,C,m,e+n,t+f*C,e+n,t+r-f*C,C,C,m,e+n-h*C,t+r,e+h*C,t+r,C,C,m,e,t+r-f*C)}else g=Pn(C2||(C2=Ti(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return g},E2={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Qie=e=>{var t=Ar(e,E2),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:m}=t,{animationEasing:g,animationDuration:y,animationBegin:v,isAnimationActive:w,isUpdateAnimationActive:S}=t,N=x.useRef(c),C=x.useRef(f),A=x.useRef(s),k=x.useRef(l),_=x.useMemo(()=>({x:s,y:l,width:c,height:f,radius:h}),[s,l,c,f,h]),T=n$(_,"rectangle-");if(s!==+s||l!==+l||c!==+c||f!==+f||c===0||f===0)return null;var P=bt("recharts-rectangle",m);if(!S){var E=_r(t),{radius:z}=E,D=k2(E,Hie);return x.createElement("path",Mm({},D,{x:ws(s),y:ws(l),width:ws(c),height:ws(f),radius:typeof h=="number"?h:void 0,className:P,d:A2(s,l,c,f,h)}))}var F=N.current,U=C.current,I=A.current,ae=k.current,ve="0px ".concat(r===-1?1:r,"px"),me="".concat(r,"px ").concat(r,"px"),G=Cie(["strokeDasharray"],y,typeof g=="string"?g:E2.animationEasing);return x.createElement(t$,{animationId:T,key:T,canBegin:r>0,duration:y,easing:g,isActive:S,begin:v},re=>{var ge=Ri(F,c,re),Se=Ri(U,f,re),B=Ri(I,s,re),R=Ri(ae,l,re);n.current&&(N.current=ge,C.current=Se,A.current=B,k.current=R);var H;w?re>0?H={transition:G,strokeDasharray:me}:H={strokeDasharray:ve}:H={strokeDasharray:me};var oe=_r(t),{radius:Q}=oe,X=k2(oe,Gie);return x.createElement("path",Mm({},X,{radius:typeof h=="number"?h:void 0,className:P,d:A2(B,R,ge,Se,h),ref:n,style:O2(O2({},H),t.style)}))})};function T2(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 P2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?T2(Object(n),!0).forEach(function(r){Xie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xie(e,t,n){return(t=Jie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jie(e){var t=eae(e,"string");return typeof t=="symbol"?t:t+""}function eae(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 Rm=Math.PI/180,tae=e=>e*180/Math.PI,Mn=(e,t,n,r)=>({x:e+Math.cos(-Rm*r)*n,y:t+Math.sin(-Rm*r)*n}),nae=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},rae=(e,t)=>{var{x:n,y:r}=e,{x:i,y:s}=t;return Math.sqrt((n-i)**2+(r-s)**2)},iae=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:s}=t,l=rae({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:tae(f),angleInRadian:f}},aae=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}},sae=(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},oae=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:s}=iae({x:n,y:r},t),{innerRadius:l,outerRadius:c}=t;if(i<l||i>c||i===0)return null;var{startAngle:f,endAngle:h}=aae(t),m=s,g;if(f<=h){for(;m>h;)m-=360;for(;m<f;)m+=360;g=m>=f&&m<=h}else{for(;m>f;)m-=360;for(;m<h;)m+=360;g=m>=h&&m<=f}return g?P2(P2({},t),{},{radius:i,angle:sae(m,t)}):null};function r$(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:s}=e,l=Mn(t,n,r,i),c=Mn(t,n,r,s);return{points:[l,c],cx:t,cy:n,radius:r,startAngle:i,endAngle:s}}var z2,M2,R2,D2,L2,I2,$2;function rS(){return rS=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},rS.apply(null,arguments)}function Oo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var lae=(e,t)=>{var n=gi(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},yp=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,m=Math.asin(c/h)/Rm,g=f?i:i+s*m,y=Mn(t,n,h,g),v=Mn(t,n,r,g),w=f?i-s*m:i,S=Mn(t,n,h*Math.cos(m*Rm),w);return{center:y,circleTangency:v,lineTangency:S,theta:m}},i$=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:s,endAngle:l}=e,c=lae(s,l),f=s+c,h=Mn(t,n,i,s),m=Mn(t,n,i,f),g=Pn(z2||(z2=Oo(["M ",",",`
250
+ A `,",",`,0,
251
+ `,",",`,
252
+ `,",",`
253
+ `])),h.x,h.y,i,i,+(Math.abs(c)>180),+(s>f),m.x,m.y);if(r>0){var y=Mn(t,n,r,s),v=Mn(t,n,r,f);g+=Pn(M2||(M2=Oo(["L ",",",`
254
+ A `,",",`,0,
255
+ `,",",`,
256
+ `,","," Z"])),v.x,v.y,r,r,+(Math.abs(c)>180),+(s<=f),y.x,y.y)}else g+=Pn(R2||(R2=Oo(["L ",","," Z"])),t,n);return g},cae=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:s,forceCornerRadius:l,cornerIsExternal:c,startAngle:f,endAngle:h}=e,m=gi(h-f),{circleTangency:g,lineTangency:y,theta:v}=yp({cx:t,cy:n,radius:i,angle:f,sign:m,cornerRadius:s,cornerIsExternal:c}),{circleTangency:w,lineTangency:S,theta:N}=yp({cx:t,cy:n,radius:i,angle:h,sign:-m,cornerRadius:s,cornerIsExternal:c}),C=c?Math.abs(f-h):Math.abs(f-h)-v-N;if(C<0)return l?Pn(D2||(D2=Oo(["M ",",",`
257
+ a`,",",",0,0,1,",`,0
258
+ a`,",",",0,0,1,",`,0
259
+ `])),y.x,y.y,s,s,s*2,s,s,-s*2):i$({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:f,endAngle:h});var A=Pn(L2||(L2=Oo(["M ",",",`
260
+ A`,",",",0,0,",",",",",`
261
+ A`,",",",0,",",",",",",",`
262
+ A`,",",",0,0,",",",",",`
263
+ `])),y.x,y.y,s,s,+(m<0),g.x,g.y,i,i,+(C>180),+(m<0),w.x,w.y,s,s,+(m<0),S.x,S.y);if(r>0){var{circleTangency:k,lineTangency:_,theta:T}=yp({cx:t,cy:n,radius:r,angle:f,sign:m,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),{circleTangency:P,lineTangency:E,theta:z}=yp({cx:t,cy:n,radius:r,angle:h,sign:-m,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),D=c?Math.abs(f-h):Math.abs(f-h)-T-z;if(D<0&&s===0)return"".concat(A,"L").concat(t,",").concat(n,"Z");A+=Pn(I2||(I2=Oo(["L",",",`
264
+ A`,",",",0,0,",",",",",`
265
+ A`,",",",0,",",",",",",",`
266
+ A`,",",",0,0,",",",",","Z"])),E.x,E.y,s,s,+(m<0),P.x,P.y,r,r,+(D>180),+(m>0),k.x,k.y,s,s,+(m<0),_.x,_.y)}else A+=Pn($2||($2=Oo(["L",",","Z"])),t,n);return A},uae={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},dae=e=>{var t=Ar(e,uae),{cx:n,cy:r,innerRadius:i,outerRadius:s,cornerRadius:l,forceCornerRadius:c,cornerIsExternal:f,startAngle:h,endAngle:m,className:g}=t;if(s<i||h===m)return null;var y=bt("recharts-sector",g),v=s-i,w=Ps(l,v,0,!0),S;return w>0&&Math.abs(h-m)<360?S=cae({cx:n,cy:r,innerRadius:i,outerRadius:s,cornerRadius:Math.min(w,v/2),forceCornerRadius:c,cornerIsExternal:f,startAngle:h,endAngle:m}):S=i$({cx:n,cy:r,innerRadius:i,outerRadius:s,startAngle:h,endAngle:m}),x.createElement("path",rS({},_r(t),{className:y,d:S}))};function fae(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($L(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:s,outerRadius:l,angle:c}=t,f=Mn(r,i,s,c),h=Mn(r,i,l,c);return[{x:f.x,y:f.y},{x:h.x,y:h.y}]}return r$(t)}}var Sx={},jx={},Nx={},U2;function hae(){return U2||(U2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=JL();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(Nx)),Nx}var B2;function pae(){return B2||(B2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=hae();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})(jx)),jx}var q2;function mae(){return q2||(q2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=eI(),n=pae();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})(Sx)),Sx}var Cx,F2;function gae(){return F2||(F2=1,Cx=mae().range),Cx}var yae=gae();const a$=Ms(yae);var Si=e=>e.chartData,Z1=ne([Si],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),iy=(e,t,n,r)=>r?Z1(e):Si(e),vae=(e,t,n)=>n?Z1(e):Si(e),bae=ne([iy],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});ne([Z1],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});var xae=ne([Si],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});function Ui(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(ct(t)&&ct(n))return!0}return!1}function K2(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function s$(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,s;if(ct(n))i=n;else if(typeof n=="function")return;if(ct(r))s=r;else if(typeof r=="function")return;var l=[i,s];if(Ui(l))return l}}function wae(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(Ui(r))return K2(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(ze(i))l=i;else if(typeof i=="function")try{t!=null&&(l=i(t?.[0]))}catch{}else if(typeof i=="string"&&PT.test(i)){var f=PT.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(ze(s))c=s;else if(typeof s=="function")try{t!=null&&(c=s(t?.[1]))}catch{}else if(typeof s=="string"&&zT.test(s)){var m=zT.exec(s);if(m==null||m[1]==null||t==null)c=void 0;else{var g=+m[1];c=t[1]+g}}else c=t?.[1];var y=[l,c];if(Ui(y))return t==null?y:K2(y,t,n)}}}var Qc=1e9,Sae={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},W1,Lt=!0,Xr="[DecimalError] ",Do=Xr+"Invalid argument: ",Y1=Xr+"Exponent out of range: ",Xc=Math.floor,xo=Math.pow,jae=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,jr,Sn=1e7,Pt=7,o$=9007199254740991,Dm=Xc(o$/Pt),_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)*Pt;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 Na(this,new this.constructor(e))};_e.dividedToIntegerBy=_e.idiv=function(e){var t=this,n=t.constructor;return _t(Na(t,new n(e),0,1),n.precision)};_e.equals=_e.eq=function(e){return!this.cmp(e)};_e.exponent=function(){return un(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(jr))throw Error(Xr+"NaN");if(n.s<1)throw Error(Xr+(n.s?"NaN":"-Infinity"));return n.eq(jr)?new r(0):(Lt=!1,t=Na(Kd(n,s),Kd(e,s),s),Lt=!0,_t(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(Xr+"NaN");return n.s?(Lt=!1,t=Na(n,e,0,1).times(e),Lt=!0,n.minus(t)):_t(new r(n),i)};_e.naturalExponential=_e.exp=function(){return c$(this)};_e.naturalLogarithm=_e.ln=function(){return Kd(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(Do+e);if(t=un(i)+1,r=i.d.length-1,n=r*Pt+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(Xr+"NaN")}for(e=un(c),Lt=!1,i=Math.sqrt(+c),i==0||i==1/0?(t=$i(c.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Xc((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(Na(c,s,l+2)).times(.5),$i(s.d).slice(0,l)===(t=$i(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),i==l&&t=="4999"){if(_t(s,n+1,0),s.times(s).eq(c)){r=s;break}}else if(t!="9999")break;l+=4}return Lt=!0,_t(r,n)};_e.times=_e.mul=function(e){var t,n,r,i,s,l,c,f,h,m=this,g=m.constructor,y=m.d,v=(e=new g(e)).d;if(!m.s||!e.s)return new g(0);for(e.s*=m.s,n=m.e+e.e,f=y.length,h=v.length,f<h&&(s=y,y=v,v=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]+v[r]*y[i-r-1]+t,s[i--]=c%Sn|0,t=c/Sn|0;s[i]=(s[i]+t)%Sn|0}for(;!s[--l];)s.pop();return t?++n:s.shift(),e.d=s,e.e=n,Lt?_t(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:(Vi(e,0,Qc),t===void 0?t=r.rounding:Vi(t,0,8),_t(n,e+un(n)+1,t))};_e.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=Wo(r,!0):(Vi(e,0,Qc),t===void 0?t=i.rounding:Vi(t,0,8),r=_t(new i(r),e+1,t),n=Wo(r,!0,e+1)),n};_e.toFixed=function(e,t){var n,r,i=this,s=i.constructor;return e===void 0?Wo(i):(Vi(e,0,Qc),t===void 0?t=s.rounding:Vi(t,0,8),r=_t(new s(i),e+un(i)+1,t),n=Wo(r.abs(),!1,e+un(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};_e.toInteger=_e.toint=function(){var e=this,t=e.constructor;return _t(new t(e),un(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,m=+(e=new f(e));if(!e.s)return new f(jr);if(c=new f(c),!c.s){if(e.s<1)throw Error(Xr+"Infinity");return c}if(c.eq(jr))return c;if(r=f.precision,e.eq(jr))return _t(c,r);if(t=e.e,n=e.d.length-1,l=t>=n,s=c.s,l){if((n=m<0?-m:m)<=o$){for(i=new f(jr),t=Math.ceil(r/Pt+4),Lt=!1;n%2&&(i=i.times(c),G2(i.d,t)),n=Xc(n/2),n!==0;)c=c.times(c),G2(c.d,t);return Lt=!0,e.s<0?new f(jr).div(i):_t(i,r)}}else if(s<0)throw Error(Xr+"NaN");return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,Lt=!1,i=e.times(Kd(c,r+h)),Lt=!0,i=c$(i),i.s=s,i};_e.toPrecision=function(e,t){var n,r,i=this,s=i.constructor;return e===void 0?(n=un(i),r=Wo(i,n<=s.toExpNeg||n>=s.toExpPos)):(Vi(e,1,Qc),t===void 0?t=s.rounding:Vi(t,0,8),i=_t(new s(i),e,t),n=un(i),r=Wo(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):(Vi(e,1,Qc),t===void 0?t=r.rounding:Vi(t,0,8)),_t(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=un(e),n=e.constructor;return Wo(e,t<=n.toExpNeg||t>=n.toExpPos)};function l$(e,t){var n,r,i,s,l,c,f,h,m=e.constructor,g=m.precision;if(!e.s||!t.s)return t.s||(t=new m(e)),Lt?_t(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/Pt),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)/Sn|0,f[s]%=Sn;for(n&&(f.unshift(n),++i),c=f.length;f[--c]==0;)f.pop();return t.d=f,t.e=i,Lt?_t(t,g):t}function Vi(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Do+e)}function $i(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=Pt-r.length,n&&(s+=gs(n)),s+=r;l=e[t],r=l+"",n=Pt-r.length,n&&(s+=gs(n))}else if(l===0)return"0";for(;l%10===0;)l/=10;return s+l}var Na=(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%Sn|0,l=s/Sn|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*Sn+r[s]-i[s];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,s,l){var c,f,h,m,g,y,v,w,S,N,C,A,k,_,T,P,E,z,D=r.constructor,F=r.s==i.s?1:-1,U=r.d,I=i.d;if(!r.s)return new D(r);if(!i.s)throw Error(Xr+"Division by zero");for(f=r.e-i.e,E=I.length,T=U.length,v=new D(F),w=v.d=[],h=0;I[h]==(U[h]||0);)++h;if(I[h]>(U[h]||0)&&--f,s==null?A=s=D.precision:l?A=s+(un(r)-un(i))+1:A=s,A<0)return new D(0);if(A=A/Pt+2|0,h=0,E==1)for(m=0,I=I[0],A++;(h<T||m)&&A--;h++)k=m*Sn+(U[h]||0),w[h]=k/I|0,m=k%I|0;else{for(m=Sn/(I[0]+1)|0,m>1&&(I=e(I,m),U=e(U,m),E=I.length,T=U.length),_=E,S=U.slice(0,E),N=S.length;N<E;)S[N++]=0;z=I.slice(),z.unshift(0),P=I[0],I[1]>=Sn/2&&++P;do m=0,c=t(I,S,E,N),c<0?(C=S[0],E!=N&&(C=C*Sn+(S[1]||0)),m=C/P|0,m>1?(m>=Sn&&(m=Sn-1),g=e(I,m),y=g.length,N=S.length,c=t(g,S,y,N),c==1&&(m--,n(g,E<y?z:I,y))):(m==0&&(c=m=1),g=I.slice()),y=g.length,y<N&&g.unshift(0),n(S,g,N),c==-1&&(N=S.length,c=t(I,S,E,N),c<1&&(m++,n(S,E<N?z:I,N))),N=S.length):c===0&&(m++,S=[0]),w[h++]=m,c&&S[0]?S[N++]=U[_]||0:(S=[U[_]],N=1);while((_++<T||S[0]!==void 0)&&A--)}return w[0]||w.shift(),v.e=f,_t(v,l?s+un(v)+1:s)}})();function c$(e,t){var n,r,i,s,l,c,f=0,h=0,m=e.constructor,g=m.precision;if(un(e)>16)throw Error(Y1+un(e));if(!e.s)return new m(jr);for(Lt=!1,c=g,l=new m(.03125);e.abs().gte(.1);)e=e.times(l),h+=5;for(r=Math.log(xo(2,h))/Math.LN10*2+5|0,c+=r,n=i=s=new m(jr),m.precision=c;;){if(i=_t(i.times(e),c),n=n.times(++f),l=s.plus(Na(i,n,c)),$i(l.d).slice(0,c)===$i(s.d).slice(0,c)){for(;h--;)s=_t(s.times(s),c);return m.precision=g,t==null?(Lt=!0,_t(s,g)):s}s=l}}function un(e){for(var t=e.e*Pt,n=e.d[0];n>=10;n/=10)t++;return t}function _x(e,t,n){if(t>e.LN10.sd())throw Lt=!0,n&&(e.precision=n),Error(Xr+"LN10 precision limit exceeded");return _t(new e(e.LN10),t)}function gs(e){for(var t="";e--;)t+="0";return t}function Kd(e,t){var n,r,i,s,l,c,f,h,m,g=1,y=10,v=e,w=v.d,S=v.constructor,N=S.precision;if(v.s<1)throw Error(Xr+(v.s?"NaN":"-Infinity"));if(v.eq(jr))return new S(0);if(t==null?(Lt=!1,h=N):h=t,v.eq(10))return t==null&&(Lt=!0),_x(S,h);if(h+=y,S.precision=h,n=$i(w),r=n.charAt(0),s=un(v),Math.abs(s)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)v=v.times(e),n=$i(v.d),r=n.charAt(0),g++;s=un(v),r>1?(v=new S("0."+n),s++):v=new S(r+"."+n.slice(1))}else return f=_x(S,h+2,N).times(s+""),v=Kd(new S(r+"."+n.slice(1)),h-y).plus(f),S.precision=N,t==null?(Lt=!0,_t(v,N)):v;for(c=l=v=Na(v.minus(jr),v.plus(jr),h),m=_t(v.times(v),h),i=3;;){if(l=_t(l.times(m),h),f=c.plus(Na(l,new S(i),h)),$i(f.d).slice(0,h)===$i(c.d).slice(0,h))return c=c.times(2),s!==0&&(c=c.plus(_x(S,h+2,N).times(s+""))),c=Na(c,new S(g),h),S.precision=N,t==null?(Lt=!0,_t(c,N)):c;c=f,i+=2}}function H2(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=Xc(n/Pt),e.d=[],r=(n+1)%Pt,n<0&&(r+=Pt),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=Pt;r<i;)e.d.push(+t.slice(r,r+=Pt));t=t.slice(r),r=Pt-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),Lt&&(e.e>Dm||e.e<-Dm))throw Error(Y1+n)}else e.s=0,e.e=0,e.d=[0];return e}function _t(e,t,n){var r,i,s,l,c,f,h,m,g=e.d;for(l=1,s=g[0];s>=10;s/=10)l++;if(r=t-l,r<0)r+=Pt,i=t,h=g[m=0];else{if(m=Math.ceil((r+1)/Pt),s=g.length,m>=s)return e;for(h=s=g[m],l=1;s>=10;s/=10)l++;r%=Pt,i=r-Pt+l}if(n!==void 0&&(s=xo(10,l-i-1),c=h/s%10|0,f=t<0||g[m+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/xo(10,l-i):0:g[m-1])%10&1||n==(e.s<0?8:7))),t<1||!g[0])return f?(s=un(e),g.length=1,t=t-s-1,g[0]=xo(10,(Pt-t%Pt)%Pt),e.e=Xc(-t/Pt)||0):(g.length=1,g[0]=e.e=e.s=0),e;if(r==0?(g.length=m,s=1,m--):(g.length=m+1,s=xo(10,Pt-r),g[m]=i>0?(h/xo(10,l-i)%xo(10,i)|0)*s:0),f)for(;;)if(m==0){(g[0]+=s)==Sn&&(g[0]=1,++e.e);break}else{if(g[m]+=s,g[m]!=Sn)break;g[m--]=0,s=1}for(r=g.length;g[--r]===0;)g.pop();if(Lt&&(e.e>Dm||e.e<-Dm))throw Error(Y1+un(e));return e}function u$(e,t){var n,r,i,s,l,c,f,h,m,g,y=e.constructor,v=y.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new y(e),Lt?_t(t,v):t;if(f=e.d,g=t.d,r=t.e,h=e.e,f=f.slice(),l=h-r,l){for(m=l<0,m?(n=f,l=-l,c=g.length):(n=g,r=h,c=f.length),i=Math.max(Math.ceil(v/Pt),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,m=i<c,m&&(c=i),i=0;i<c;i++)if(f[i]!=g[i]){m=f[i]<g[i];break}l=0}for(m&&(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]=Sn-1;--f[s],f[i]+=Sn}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,Lt?_t(t,v):t):new y(0)}function Wo(e,t,n){var r,i=un(e),s=$i(e.d),l=s.length;return t?(n&&(r=n-l)>0?s=s.charAt(0)+"."+s.slice(1)+gs(r):l>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(i<0?"e":"e+")+i):i<0?(s="0."+gs(-i-1)+s,n&&(r=n-l)>0&&(s+=gs(r))):i>=l?(s+=gs(i+1-l),n&&(r=n-i-1)>0&&(s=s+"."+gs(r))):((r=i+1)<l&&(s=s.slice(0,r)+"."+s.slice(r)),n&&(r=n-l)>0&&(i+1===l&&(s+="."),s+=gs(r))),e.s<0?"-"+s:s}function G2(e,t){if(e.length>t)return e.length=t,!0}function d$(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(Do+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 H2(l,s.toString())}else if(typeof s!="string")throw Error(Do+s);if(s.charCodeAt(0)===45?(s=s.slice(1),l.s=-1):l.s=1,jae.test(s))H2(l,s);else throw Error(Do+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=d$,i.config=i.set=Nae,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 Nae(e){if(!e||typeof e!="object")throw Error(Xr+"Object expected");var t,n,r,i=["precision",1,Qc,"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(Xc(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Do+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Do+n+": "+r);return this}var W1=d$(Sae);jr=new W1(1);const nt=W1;function f$(e){var t;return e===0?t=1:t=Math.floor(new nt(e).abs().log(10).toNumber())+1,t}function h$(e,t,n){for(var r=new nt(e),i=0,s=[];r.lt(t)&&i<1e5;)s.push(r.toNumber()),r=r.add(n),i++;return s}var p$=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},Q1=(e,t,n)=>{if(e.lte(0))return new nt(0);var r=f$(e.toNumber()),i=new nt(10).pow(r),s=e.div(i),l=r!==1?.05:.1,c=new nt(Math.ceil(s.div(l).toNumber())).add(n).mul(l),f=c.mul(i);return t?new nt(f.toNumber()):new nt(Math.ceil(f.toNumber()))},m$=(e,t,n)=>{var r;if(e.lte(0))return new nt(0);var i=[1,2,2.5,5],s=e.toNumber(),l=Math.floor(new nt(s).abs().log(10).toNumber()),c=new nt(10).pow(l),f=e.div(c).toNumber(),h=i.findIndex(v=>v>=f-1e-10);if(h===-1&&(c=c.mul(10),h=0),h+=n,h>=i.length){var m=Math.floor(h/i.length);h%=i.length,c=c.mul(new nt(10).pow(m))}var g=(r=i[h])!==null&&r!==void 0?r:1,y=new nt(g).mul(c);return t?y:new nt(Math.ceil(y.toNumber()))},Cae=(e,t,n)=>{var r=new nt(1),i=new nt(e);if(!i.isint()&&n){var s=Math.abs(e);s<1?(r=new nt(10).pow(f$(e)-1),i=new nt(Math.floor(i.div(r).toNumber())).mul(r)):s>1&&(i=new nt(Math.floor(e)))}else e===0?i=new nt(Math.floor((t-1)/2)):n||(i=new nt(Math.floor(e)));for(var l=Math.floor((t-1)/2),c=[],f=0;f<t;f++)c.push(i.add(new nt(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]:Q1;if(!Number.isFinite((n-t)/(r-1)))return{step:new nt(0),tickMin:new nt(0),tickMax:new nt(0)};var c=l(new nt(n).sub(t).div(r-1),i,s),f;t<=0&&n>=0?f=new nt(0):(f=new nt(t).add(n).div(2),f=f.sub(new nt(f).mod(c)));var h=Math.ceil(f.sub(t).div(c).toNumber()),m=Math.ceil(new nt(n).sub(f).div(c).toNumber()),g=h+m+1;return g>r?g$(t,n,r,i,s+1,l):(g<r&&(m=n>0?m+(r-g):m,h=n>0?h:h+(r-g)),{step:c,tickMin:f.sub(new nt(h).mul(c)),tickMax:f.add(new nt(m).mul(c))})},V2=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]=p$([n,r]);if(f===-1/0||h===1/0){var m=h===1/0?[f,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),h];return n>r?m.reverse():m}if(f===h)return Cae(f,i,s);var g=l==="snap125"?m$:Q1,{step:y,tickMin:v,tickMax:w}=g$(f,h,c,s,0,g),S=h$(v,w.add(new nt(.1).mul(y)),y);return n>r?S.reverse():S},Z2=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]=p$([r,i]);if(c===-1/0||f===1/0)return[r,i];if(c===f)return[c];var h=l==="snap125"?m$:Q1,m=Math.max(n,2),g=h(new nt(f).sub(c).div(m-1),s,0),y=[...h$(new nt(c),new nt(f),g),f];return s===!1&&(y=y.map(v=>Math.round(v))),r>i?y.reverse():y},_ae=e=>e.rootProps.barCategoryGap,ay=e=>e.rootProps.stackOffset,y$=e=>e.rootProps.reverseStackOrder,X1=e=>e.options.chartName,J1=e=>e.rootProps.syncId,v$=e=>e.rootProps.syncMethod,ej=e=>e.options.eventEmitter,Oae=e=>e.rootProps.baseValue,ur={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},ho={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},Pi={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},sy=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function oy(e,t,n){if(n!=="auto")return n;if(e!=null)return Yi(e,t)?"category":"number"}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 Lm(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){kae(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 kae(e,t,n){return(t=Aae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Aae(e){var t=Eae(e,"string");return typeof t=="symbol"?t:t+""}function Eae(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 W2={allowDataOverflow:ho.allowDataOverflow,allowDecimals:ho.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:ho.angleAxisId,includeHidden:!1,name:void 0,reversed:ho.reversed,scale:ho.scale,tick:ho.tick,tickCount:void 0,ticks:void 0,type:ho.type,unit:void 0,niceTicks:"auto"},Q2={allowDataOverflow:Pi.allowDataOverflow,allowDecimals:Pi.allowDecimals,allowDuplicatedCategory:Pi.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:Pi.radiusAxisId,includeHidden:Pi.includeHidden,name:void 0,reversed:Pi.reversed,scale:Pi.scale,tick:Pi.tick,tickCount:Pi.tickCount,ticks:void 0,type:Pi.type,unit:void 0,niceTicks:"auto"},Tae=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},tj=ne([Tae,BI],(e,t)=>{var n;if(e!=null)return e;var r=(n=oy(t,"angleAxis",W2.type))!==null&&n!==void 0?n:"category";return Lm(Lm({},W2),{},{type:r})}),Pae=(e,t)=>e.polarAxis.radiusAxis[t],nj=ne([Pae,BI],(e,t)=>{var n;if(e!=null)return e;var r=(n=oy(t,"radiusAxis",Q2.type))!==null&&n!==void 0?n:"category";return Lm(Lm({},Q2),{},{type:r})}),ly=e=>e.polarOptions,rj=ne([Ea,Ta,Ln],nae),b$=ne([ly,rj],(e,t)=>{if(e!=null)return Ps(e.innerRadius,t,0)}),x$=ne([ly,rj],(e,t)=>{if(e!=null)return Ps(e.outerRadius,t,t*.8)}),zae=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},w$=ne([ly],zae);ne([tj,w$],sy);var S$=ne([rj,b$,x$],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});ne([nj,S$],sy);var j$=ne([Ut,ly,b$,x$,Ea,Ta],(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:Ps(l,i,i/2),cy:Ps(c,s,s/2),innerRadius:n,outerRadius:r,startAngle:f,endAngle:h,clockWise:!1}}}),Nn=(e,t)=>t,cy=(e,t,n)=>n;function ij(e){return e?.id}function N$(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 m=ij(c);h.forEach((g,y)=>{var v=s==null||i?y:String(jn(g,s,null)),w=jn(g,c.dataKey,0),S;l.has(v)?S=l.get(v):S={},Object.assign(S,{[m]:w}),l.set(v,S)})}}),Array.from(l.values())}function aj(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var uy=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function dy(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function Mae(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 Cn=e=>{var t=Ut(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Jc=e=>e.tooltip.settings.axisId;function sj(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 Rae=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Ui(t)){for(var n,r,i=0;i<t.length;i++){var s=t[i];ct(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 Os(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Dae(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function oj(e){let t,n,r;e.length!==2?(t=Os,n=(c,f)=>Os(e(c),f),r=(c,f)=>e(c)-f):(t=e===Os||e===Dae?e:Lae,n=e,r=e);function i(c,f,h=0,m=c.length){if(h<m){if(t(f,f)!==0)return m;do{const g=h+m>>>1;n(c[g],f)<0?h=g+1:m=g}while(h<m)}return h}function s(c,f,h=0,m=c.length){if(h<m){if(t(f,f)!==0)return m;do{const g=h+m>>>1;n(c[g],f)<=0?h=g+1:m=g}while(h<m)}return h}function l(c,f,h=0,m=c.length){const g=i(c,f,h,m-1);return g>h&&r(c[g-1],f)>-r(c[g],f)?g-1:g}return{left:i,center:l,right:s}}function Lae(){return 0}function C$(e){return e===null?NaN:+e}function*Iae(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const $ae=oj(Os),pf=$ae.right;oj(C$).center;class X2 extends Map{constructor(t,n=qae){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(J2(this,t))}has(t){return super.has(J2(this,t))}set(t,n){return super.set(Uae(this,t),n)}delete(t){return super.delete(Bae(this,t))}}function J2({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Uae({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Bae({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function qae(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Fae(e=Os){if(e===Os)return _$;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 _$(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Kae=Math.sqrt(50),Hae=Math.sqrt(10),Gae=Math.sqrt(2);function Im(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>=Kae?10:s>=Hae?5:s>=Gae?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?Im(e,t,n*2):[c,f,h]}function iS(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?Im(t,e,n):Im(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 aS(e,t,n){return t=+t,e=+e,n=+n,Im(e,t,n)[2]}function sS(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?aS(t,e,n):aS(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function eP(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function tP(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function O$(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?_$:Fae(i);r>n;){if(r-n>600){const f=r-n+1,h=t-n+1,m=Math.log(f),g=.5*Math.exp(2*m/3),y=.5*Math.sqrt(m*g*(f-g)/f)*(h-f/2<0?-1:1),v=Math.max(n,Math.floor(t-h*g/f+y)),w=Math.min(r,Math.floor(t+(f-h)*g/f+y));O$(e,t,v,w,i)}const s=e[t];let l=n,c=r;for(od(e,n,t),i(e[r],s)>0&&od(e,n,r);l<c;){for(od(e,l,c),++l,--c;i(e[l],s)<0;)++l;for(;i(e[c],s)>0;)--c}i(e[n],s)===0?od(e,n,c):(++c,od(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function od(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Vae(e,t,n){if(e=Float64Array.from(Iae(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return tP(e);if(t>=1)return eP(e);var r,i=(r-1)*t,s=Math.floor(i),l=eP(O$(e,s).subarray(0,s+1)),c=tP(e.subarray(s+1));return l+(c-l)*(i-s)}}function Zae(e,t,n=C$){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 Yae(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 ri(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Pa(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 oS=Symbol("implicit");function lj(){var e=new X2,t=[],n=[],r=oS;function i(s){let l=e.get(s);if(l===void 0){if(r!==oS)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 X2;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 lj(t,n).unknown(r)},ri.apply(i,arguments),i}function cj(){var e=lj().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,s,l,c=!1,f=0,h=0,m=.5;delete e.unknown;function g(){var y=t().length,v=i<r,w=v?i:r,S=v?r:i;s=(S-w)/Math.max(1,y-f+h*2),c&&(s=Math.floor(s)),w+=(S-w-s*(y-f))*m,l=s*(1-f),c&&(w=Math.round(w),l=Math.round(l));var N=Yae(y).map(function(C){return w+s*C});return n(v?N.reverse():N)}return e.domain=function(y){return arguments.length?(t(y),g()):t()},e.range=function(y){return arguments.length?([r,i]=y,r=+r,i=+i,g()):[r,i]},e.rangeRound=function(y){return[r,i]=y,r=+r,i=+i,c=!0,g()},e.bandwidth=function(){return l},e.step=function(){return s},e.round=function(y){return arguments.length?(c=!!y,g()):c},e.padding=function(y){return arguments.length?(f=Math.min(1,h=+y),g()):f},e.paddingInner=function(y){return arguments.length?(f=Math.min(1,y),g()):f},e.paddingOuter=function(y){return arguments.length?(h=+y,g()):h},e.align=function(y){return arguments.length?(m=Math.max(0,Math.min(1,y)),g()):m},e.copy=function(){return cj(t(),[r,i]).round(c).paddingInner(f).paddingOuter(h).align(m)},ri.apply(g(),arguments)}function k$(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return k$(t())},e}function Wae(){return k$(cj.apply(null,arguments).paddingInner(1))}function uj(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function A$(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function mf(){}var Hd=.7,$m=1/Hd,Nc="\\s*([+-]?\\d+)\\s*",Gd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Bi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Qae=/^#([0-9a-f]{3,8})$/,Xae=new RegExp(`^rgb\\(${Nc},${Nc},${Nc}\\)$`),Jae=new RegExp(`^rgb\\(${Bi},${Bi},${Bi}\\)$`),ese=new RegExp(`^rgba\\(${Nc},${Nc},${Nc},${Gd}\\)$`),tse=new RegExp(`^rgba\\(${Bi},${Bi},${Bi},${Gd}\\)$`),nse=new RegExp(`^hsl\\(${Gd},${Bi},${Bi}\\)$`),rse=new RegExp(`^hsla\\(${Gd},${Bi},${Bi},${Gd}\\)$`),nP={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};uj(mf,Vd,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:rP,formatHex:rP,formatHex8:ise,formatHsl:ase,formatRgb:iP,toString:iP});function rP(){return this.rgb().formatHex()}function ise(){return this.rgb().formatHex8()}function ase(){return E$(this).formatHsl()}function iP(){return this.rgb().formatRgb()}function Vd(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Qae.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?aP(t):n===3?new dr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?vp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?vp(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=Xae.exec(e))?new dr(t[1],t[2],t[3],1):(t=Jae.exec(e))?new dr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ese.exec(e))?vp(t[1],t[2],t[3],t[4]):(t=tse.exec(e))?vp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=nse.exec(e))?lP(t[1],t[2]/100,t[3]/100,1):(t=rse.exec(e))?lP(t[1],t[2]/100,t[3]/100,t[4]):nP.hasOwnProperty(e)?aP(nP[e]):e==="transparent"?new dr(NaN,NaN,NaN,0):null}function aP(e){return new dr(e>>16&255,e>>8&255,e&255,1)}function vp(e,t,n,r){return r<=0&&(e=t=n=NaN),new dr(e,t,n,r)}function sse(e){return e instanceof mf||(e=Vd(e)),e?(e=e.rgb(),new dr(e.r,e.g,e.b,e.opacity)):new dr}function lS(e,t,n,r){return arguments.length===1?sse(e):new dr(e,t,n,r??1)}function dr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}uj(dr,lS,A$(mf,{brighter(e){return e=e==null?$m:Math.pow($m,e),new dr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Hd:Math.pow(Hd,e),new dr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new dr(Lo(this.r),Lo(this.g),Lo(this.b),Um(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:sP,formatHex:sP,formatHex8:ose,formatRgb:oP,toString:oP}));function sP(){return`#${ko(this.r)}${ko(this.g)}${ko(this.b)}`}function ose(){return`#${ko(this.r)}${ko(this.g)}${ko(this.b)}${ko((isNaN(this.opacity)?1:this.opacity)*255)}`}function oP(){const e=Um(this.opacity);return`${e===1?"rgb(":"rgba("}${Lo(this.r)}, ${Lo(this.g)}, ${Lo(this.b)}${e===1?")":`, ${e})`}`}function Um(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Lo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ko(e){return e=Lo(e),(e<16?"0":"")+e.toString(16)}function lP(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new mi(e,t,n,r)}function E$(e){if(e instanceof mi)return new mi(e.h,e.s,e.l,e.opacity);if(e instanceof mf||(e=Vd(e)),!e)return new mi;if(e instanceof mi)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 mi(l,c,f,e.opacity)}function lse(e,t,n,r){return arguments.length===1?E$(e):new mi(e,t,n,r??1)}function mi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}uj(mi,lse,A$(mf,{brighter(e){return e=e==null?$m:Math.pow($m,e),new mi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Hd:Math.pow(Hd,e),new mi(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 dr(Ox(e>=240?e-240:e+120,i,r),Ox(e,i,r),Ox(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new mi(cP(this.h),bp(this.s),bp(this.l),Um(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=Um(this.opacity);return`${e===1?"hsl(":"hsla("}${cP(this.h)}, ${bp(this.s)*100}%, ${bp(this.l)*100}%${e===1?")":`, ${e})`}`}}));function cP(e){return e=(e||0)%360,e<0?e+360:e}function bp(e){return Math.max(0,Math.min(1,e||0))}function Ox(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 dj=e=>()=>e;function cse(e,t){return function(n){return e+n*t}}function use(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 dse(e){return(e=+e)==1?T$:function(t,n){return n-t?use(t,n,e):dj(isNaN(t)?n:t)}}function T$(e,t){var n=t-e;return n?cse(e,n):dj(isNaN(e)?t:e)}const uP=(function e(t){var n=dse(t);function r(i,s){var l=n((i=lS(i)).r,(s=lS(s)).r),c=n(i.g,s.g),f=n(i.b,s.b),h=T$(i.opacity,s.opacity);return function(m){return i.r=l(m),i.g=c(m),i.b=f(m),i.opacity=h(m),i+""}}return r.gamma=e,r})(1);function fse(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 hse(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function pse(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]=eu(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 mse(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Bm(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function gse(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]=eu(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,kx=new RegExp(cS.source,"g");function yse(e){return function(){return e}}function vse(e){return function(t){return e(t)+""}}function bse(e,t){var n=cS.lastIndex=kx.lastIndex=0,r,i,s,l=-1,c=[],f=[];for(e=e+"",t=t+"";(r=cS.exec(e))&&(i=kx.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:Bm(r,i)})),n=kx.lastIndex;return n<t.length&&(s=t.slice(n),c[l]?c[l]+=s:c[++l]=s),c.length<2?f[0]?vse(f[0].x):yse(t):(t=f.length,function(h){for(var m=0,g;m<t;++m)c[(g=f[m]).i]=g.x(h);return c.join("")})}function eu(e,t){var n=typeof t,r;return t==null||n==="boolean"?dj(t):(n==="number"?Bm:n==="string"?(r=Vd(t))?(t=r,uP):bse:t instanceof Vd?uP:t instanceof Date?mse:hse(t)?fse:Array.isArray(t)?pse:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?gse:Bm)(e,t)}function fj(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function xse(e,t){t===void 0&&(t=e,e=eu);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 wse(e){return function(){return e}}function qm(e){return+e}var dP=[0,1];function Wn(e){return e}function uS(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:wse(isNaN(t)?NaN:.5)}function Sse(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function jse(e,t,n){var r=e[0],i=e[1],s=t[0],l=t[1];return i<r?(r=uS(i,r),s=n(l,s)):(r=uS(r,i),s=n(s,l)),function(c){return s(r(c))}}function Nse(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]=uS(e[l],e[l+1]),s[l]=n(t[l],t[l+1]);return function(c){var f=pf(e,c,1,r)-1;return s[f](i[f](c))}}function gf(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function fy(){var e=dP,t=dP,n=eu,r,i,s,l=Wn,c,f,h;function m(){var y=Math.min(e.length,t.length);return l!==Wn&&(l=Sse(e[0],e[y-1])),c=y>2?Nse:jse,f=h=null,g}function g(y){return y==null||isNaN(y=+y)?s:(f||(f=c(e.map(r),t,n)))(r(l(y)))}return g.invert=function(y){return l(i((h||(h=c(t,e.map(r),Bm)))(y)))},g.domain=function(y){return arguments.length?(e=Array.from(y,qm),m()):e.slice()},g.range=function(y){return arguments.length?(t=Array.from(y),m()):t.slice()},g.rangeRound=function(y){return t=Array.from(y),n=fj,m()},g.clamp=function(y){return arguments.length?(l=y?!0:Wn,m()):l!==Wn},g.interpolate=function(y){return arguments.length?(n=y,m()):n},g.unknown=function(y){return arguments.length?(s=y,g):s},function(y,v){return r=y,i=v,m()}}function hj(){return fy()(Wn,Wn)}function Cse(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Fm(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 Rc(e){return e=Fm(Math.abs(e)),e?e[1]:NaN}function _se(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 Ose(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var kse=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Zd(e){if(!(t=kse.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]})}Zd.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 Ase(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 Km;function Ese(e,t){var n=Fm(e,t);if(!n)return Km=void 0,e.toPrecision(t);var r=n[0],i=n[1],s=i-(Km=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")+Fm(e,Math.max(0,t+s-1))[0]}function fP(e,t){var n=Fm(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 hP={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Cse,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)=>fP(e*100,t),r:fP,s:Ese,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function pP(e){return e}var mP=Array.prototype.map,gP=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Tse(e){var t=e.grouping===void 0||e.thousands===void 0?pP:_se(mP.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:Ose(mP.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,y){g=Zd(g);var v=g.fill,w=g.align,S=g.sign,N=g.symbol,C=g.zero,A=g.width,k=g.comma,_=g.precision,T=g.trim,P=g.type;P==="n"?(k=!0,P="g"):hP[P]||(_===void 0&&(_=12),T=!0,P="g"),(C||v==="0"&&w==="=")&&(C=!0,v="0",w="=");var E=(y&&y.prefix!==void 0?y.prefix:"")+(N==="$"?n:N==="#"&&/[boxX]/.test(P)?"0"+P.toLowerCase():""),z=(N==="$"?r:/[%p]/.test(P)?l:"")+(y&&y.suffix!==void 0?y.suffix:""),D=hP[P],F=/[defgprs%]/.test(P);_=_===void 0?6:/[gprs]/.test(P)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function U(I){var ae=E,ve=z,me,G,re;if(P==="c")ve=D(I)+ve,I="";else{I=+I;var ge=I<0||1/I<0;if(I=isNaN(I)?f:D(Math.abs(I),_),T&&(I=Ase(I)),ge&&+I==0&&S!=="+"&&(ge=!1),ae=(ge?S==="("?S:c:S==="-"||S==="("?"":S)+ae,ve=(P==="s"&&!isNaN(I)&&Km!==void 0?gP[8+Km/3]:"")+ve+(ge&&S==="("?")":""),F){for(me=-1,G=I.length;++me<G;)if(re=I.charCodeAt(me),48>re||re>57){ve=(re===46?i+I.slice(me+1):I.slice(me))+ve,I=I.slice(0,me);break}}}k&&!C&&(I=t(I,1/0));var Se=ae.length+I.length+ve.length,B=Se<A?new Array(A-Se+1).join(v):"";switch(k&&C&&(I=t(B+I,B.length?A-ve.length:1/0),B=""),w){case"<":I=ae+I+ve+B;break;case"=":I=ae+B+I+ve;break;case"^":I=B.slice(0,Se=B.length>>1)+ae+I+ve+B.slice(Se);break;default:I=B+ae+I+ve;break}return s(I)}return U.toString=function(){return g+""},U}function m(g,y){var v=Math.max(-8,Math.min(8,Math.floor(Rc(y)/3)))*3,w=Math.pow(10,-v),S=h((g=Zd(g),g.type="f",g),{suffix:gP[8+v/3]});return function(N){return S(w*N)}}return{format:h,formatPrefix:m}}var xp,mj,P$;Pse({thousands:",",grouping:[3],currency:["$",""]});function Pse(e){return xp=Tse(e),mj=xp.format,P$=xp.formatPrefix,xp}function zse(e){return Math.max(0,-Rc(Math.abs(e)))}function Mse(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Rc(t)/3)))*3-Rc(Math.abs(e)))}function Rse(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Rc(t)-Rc(e))+1}function z$(e,t,n,r){var i=sS(e,t,n),s;switch(r=Zd(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=Mse(i,l))&&(r.precision=s),P$(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=Rse(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=zse(i))&&(r.precision=s-(r.type==="%")*2);break}}return mj(r)}function Bs(e){var t=e.domain;return e.ticks=function(n){var r=t();return iS(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return z$(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,m=10;for(c<l&&(h=l,l=c,c=h,h=i,i=s,s=h);m-- >0;){if(h=aS(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 M$(){var e=hj();return e.copy=function(){return gf(e,M$())},ri.apply(e,arguments),Bs(e)}function R$(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,qm),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return R$(e).unknown(t)},e=arguments.length?Array.from(e,qm):[0,1],Bs(n)}function D$(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 yP(e){return Math.log(e)}function vP(e){return Math.exp(e)}function Dse(e){return-Math.log(-e)}function Lse(e){return-Math.exp(-e)}function Ise(e){return isFinite(e)?+("1e"+e):e<0?0:e}function $se(e){return e===10?Ise:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Use(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 bP(e){return(t,n)=>-e(-t,n)}function gj(e){const t=e(yP,vP),n=t.domain;let r=10,i,s;function l(){return i=Use(r),s=$se(r),n()[0]<0?(i=bP(i),s=bP(s),e(Dse,Lse)):e(yP,vP),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],m=f[f.length-1];const g=m<h;g&&([h,m]=[m,h]);let y=i(h),v=i(m),w,S;const N=c==null?10:+c;let C=[];if(!(r%1)&&v-y<N){if(y=Math.floor(y),v=Math.ceil(v),h>0){for(;y<=v;++y)for(w=1;w<r;++w)if(S=y<0?w/s(-y):w*s(y),!(S<h)){if(S>m)break;C.push(S)}}else for(;y<=v;++y)for(w=r-1;w>=1;--w)if(S=y>0?w/s(-y):w*s(y),!(S<h)){if(S>m)break;C.push(S)}C.length*2<N&&(C=iS(h,m,N))}else C=iS(y,v,Math.min(v-y,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=Zd(f)).precision==null&&(f.trim=!0),f=mj(f)),c===1/0)return f;const h=Math.max(1,r*c/t.ticks().length);return m=>{let g=m/s(Math.round(i(m)));return g*r<r-.5&&(g*=r),g<=h?f(m):""}},t.nice=()=>n(D$(n(),{floor:c=>s(Math.floor(i(c))),ceil:c=>s(Math.ceil(i(c)))})),t}function L$(){const e=gj(fy()).domain([1,10]);return e.copy=()=>gf(e,L$()).base(e.base()),ri.apply(e,arguments),e}function xP(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function wP(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function yj(e){var t=1,n=e(xP(t),wP(t));return n.constant=function(r){return arguments.length?e(xP(t=+r),wP(t)):t},Bs(n)}function I$(){var e=yj(fy());return e.copy=function(){return gf(e,I$()).constant(e.constant())},ri.apply(e,arguments)}function SP(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Bse(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function qse(e){return e<0?-e*e:e*e}function vj(e){var t=e(Wn,Wn),n=1;function r(){return n===1?e(Wn,Wn):n===.5?e(Bse,qse):e(SP(n),SP(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Bs(t)}function bj(){var e=vj(fy());return e.copy=function(){return gf(e,bj()).exponent(e.exponent())},ri.apply(e,arguments),e}function Fse(){return bj.apply(null,arguments).exponent(.5)}function jP(e){return Math.sign(e)*e*e}function Kse(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function $$(){var e=hj(),t=[0,1],n=!1,r;function i(s){var l=Kse(e(s));return isNaN(l)?r:n?Math.round(l):l}return i.invert=function(s){return e.invert(jP(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,qm)).map(jP)),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 $$(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},ri.apply(i,arguments),Bs(i)}function U$(){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]=Zae(e,l/c);return s}function s(l){return l==null||isNaN(l=+l)?r:t[pf(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(Os),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 U$().domain(e).range(t).unknown(r)},ri.apply(s,arguments)}function B$(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function l(f){return f!=null&&f<=f?i[pf(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 B$().domain([e,t]).range(i).unknown(s)},ri.apply(Bs(l),arguments)}function q$(){var e=[.5],t=[0,1],n,r=1;function i(s){return s!=null&&s<=s?t[pf(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 q$().domain(e).range(t).unknown(n)},ri.apply(i,arguments)}const Ax=new Date,Ex=new Date;function vn(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=>vn(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)=>(Ax.setTime(+s),Ex.setTime(+l),e(Ax),e(Ex),Math.floor(n(Ax,Ex))),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 Hm=vn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Hm.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?vn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Hm);Hm.range;const wa=1e3,Yr=wa*60,Sa=Yr*60,_a=Sa*24,xj=_a*7,NP=_a*30,Tx=_a*365,Ao=vn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*wa)},(e,t)=>(t-e)/wa,e=>e.getUTCSeconds());Ao.range;const wj=vn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*wa)},(e,t)=>{e.setTime(+e+t*Yr)},(e,t)=>(t-e)/Yr,e=>e.getMinutes());wj.range;const Sj=vn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Yr)},(e,t)=>(t-e)/Yr,e=>e.getUTCMinutes());Sj.range;const jj=vn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*wa-e.getMinutes()*Yr)},(e,t)=>{e.setTime(+e+t*Sa)},(e,t)=>(t-e)/Sa,e=>e.getHours());jj.range;const Nj=vn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Sa)},(e,t)=>(t-e)/Sa,e=>e.getUTCHours());Nj.range;const yf=vn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Yr)/_a,e=>e.getDate()-1);yf.range;const hy=vn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/_a,e=>e.getUTCDate()-1);hy.range;const F$=vn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/_a,e=>Math.floor(e/_a));F$.range;function sl(e){return vn(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())*Yr)/xj)}const py=sl(0),Gm=sl(1),Hse=sl(2),Gse=sl(3),Dc=sl(4),Vse=sl(5),Zse=sl(6);py.range;Gm.range;Hse.range;Gse.range;Dc.range;Vse.range;Zse.range;function ol(e){return vn(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)/xj)}const my=ol(0),Vm=ol(1),Yse=ol(2),Wse=ol(3),Lc=ol(4),Qse=ol(5),Xse=ol(6);my.range;Vm.range;Yse.range;Wse.range;Lc.range;Qse.range;Xse.range;const Cj=vn(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());Cj.range;const _j=vn(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());_j.range;const Oa=vn(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());Oa.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:vn(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)});Oa.range;const ka=vn(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());ka.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:vn(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)});ka.range;function K$(e,t,n,r,i,s){const l=[[Ao,1,wa],[Ao,5,5*wa],[Ao,15,15*wa],[Ao,30,30*wa],[s,1,Yr],[s,5,5*Yr],[s,15,15*Yr],[s,30,30*Yr],[i,1,Sa],[i,3,3*Sa],[i,6,6*Sa],[i,12,12*Sa],[r,1,_a],[r,2,2*_a],[n,1,xj],[t,1,NP],[t,3,3*NP],[e,1,Tx]];function c(h,m,g){const y=m<h;y&&([h,m]=[m,h]);const v=g&&typeof g.range=="function"?g:f(h,m,g),w=v?v.range(h,+m+1):[];return y?w.reverse():w}function f(h,m,g){const y=Math.abs(m-h)/g,v=oj(([,,N])=>N).right(l,y);if(v===l.length)return e.every(sS(h/Tx,m/Tx,g));if(v===0)return Hm.every(Math.max(sS(h,m,g),1));const[w,S]=l[y/l[v-1][2]<l[v][2]/y?v-1:v];return w.every(S)}return[c,f]}const[Jse,eoe]=K$(ka,_j,my,F$,Nj,Sj),[toe,noe]=K$(Oa,Cj,py,yf,jj,wj);function Px(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 ld(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function roe(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=cd(i),m=ud(i),g=cd(s),y=ud(s),v=cd(l),w=ud(l),S=cd(c),N=ud(c),C=cd(f),A=ud(f),k={a:re,A:ge,b:Se,B,c:null,d:EP,e:EP,f:_oe,g:Doe,G:Ioe,H:joe,I:Noe,j:Coe,L:H$,m:Ooe,M:koe,p:R,q:H,Q:zP,s:MP,S:Aoe,u:Eoe,U:Toe,V:Poe,w:zoe,W:Moe,x:null,X:null,y:Roe,Y:Loe,Z:$oe,"%":PP},_={a:oe,A:Q,b:X,B:W,c:null,d:TP,e:TP,f:Foe,g:Joe,G:tle,H:Uoe,I:Boe,j:qoe,L:V$,m:Koe,M:Hoe,p:le,q:ye,Q:zP,s:MP,S:Goe,u:Voe,U:Zoe,V:Yoe,w:Woe,W:Qoe,x:null,X:null,y:Xoe,Y:ele,Z:nle,"%":PP},T={a:F,A:U,b:I,B:ae,c:ve,d:kP,e:kP,f:boe,g:OP,G:_P,H:AP,I:AP,j:moe,L:voe,m:poe,M:goe,p:D,q:hoe,Q:woe,s:Soe,S:yoe,u:loe,U:coe,V:uoe,w:ooe,W:doe,x:me,X:G,y:OP,Y:_P,Z:foe,"%":xoe};k.x=P(n,k),k.X=P(r,k),k.c=P(t,k),_.x=P(n,_),_.X=P(r,_),_.c=P(t,_);function P(Z,ce){return function(be){var K=[],Re=-1,Ee=0,it=Z.length,rt,rn,dn;for(be instanceof Date||(be=new Date(+be));++Re<it;)Z.charCodeAt(Re)===37&&(K.push(Z.slice(Ee,Re)),(rn=CP[rt=Z.charAt(++Re)])!=null?rt=Z.charAt(++Re):rn=rt==="e"?" ":"0",(dn=ce[rt])&&(rt=dn(be,rn)),K.push(rt),Ee=Re+1);return K.push(Z.slice(Ee,Re)),K.join("")}}function E(Z,ce){return function(be){var K=ld(1900,void 0,1),Re=z(K,Z,be+="",0),Ee,it;if(Re!=be.length)return null;if("Q"in K)return new Date(K.Q);if("s"in K)return new Date(K.s*1e3+("L"in K?K.L:0));if(ce&&!("Z"in K)&&(K.Z=0),"p"in K&&(K.H=K.H%12+K.p*12),K.m===void 0&&(K.m="q"in K?K.q:0),"V"in K){if(K.V<1||K.V>53)return null;"w"in K||(K.w=1),"Z"in K?(Ee=zx(ld(K.y,0,1)),it=Ee.getUTCDay(),Ee=it>4||it===0?Vm.ceil(Ee):Vm(Ee),Ee=hy.offset(Ee,(K.V-1)*7),K.y=Ee.getUTCFullYear(),K.m=Ee.getUTCMonth(),K.d=Ee.getUTCDate()+(K.w+6)%7):(Ee=Px(ld(K.y,0,1)),it=Ee.getDay(),Ee=it>4||it===0?Gm.ceil(Ee):Gm(Ee),Ee=yf.offset(Ee,(K.V-1)*7),K.y=Ee.getFullYear(),K.m=Ee.getMonth(),K.d=Ee.getDate()+(K.w+6)%7)}else("W"in K||"U"in K)&&("w"in K||(K.w="u"in K?K.u%7:"W"in K?1:0),it="Z"in K?zx(ld(K.y,0,1)).getUTCDay():Px(ld(K.y,0,1)).getDay(),K.m=0,K.d="W"in K?(K.w+6)%7+K.W*7-(it+5)%7:K.w+K.U*7-(it+6)%7);return"Z"in K?(K.H+=K.Z/100|0,K.M+=K.Z%100,zx(K)):Px(K)}}function z(Z,ce,be,K){for(var Re=0,Ee=ce.length,it=be.length,rt,rn;Re<Ee;){if(K>=it)return-1;if(rt=ce.charCodeAt(Re++),rt===37){if(rt=ce.charAt(Re++),rn=T[rt in CP?ce.charAt(Re++):rt],!rn||(K=rn(Z,be,K))<0)return-1}else if(rt!=be.charCodeAt(K++))return-1}return K}function D(Z,ce,be){var K=h.exec(ce.slice(be));return K?(Z.p=m.get(K[0].toLowerCase()),be+K[0].length):-1}function F(Z,ce,be){var K=v.exec(ce.slice(be));return K?(Z.w=w.get(K[0].toLowerCase()),be+K[0].length):-1}function U(Z,ce,be){var K=g.exec(ce.slice(be));return K?(Z.w=y.get(K[0].toLowerCase()),be+K[0].length):-1}function I(Z,ce,be){var K=C.exec(ce.slice(be));return K?(Z.m=A.get(K[0].toLowerCase()),be+K[0].length):-1}function ae(Z,ce,be){var K=S.exec(ce.slice(be));return K?(Z.m=N.get(K[0].toLowerCase()),be+K[0].length):-1}function ve(Z,ce,be){return z(Z,t,ce,be)}function me(Z,ce,be){return z(Z,n,ce,be)}function G(Z,ce,be){return z(Z,r,ce,be)}function re(Z){return l[Z.getDay()]}function ge(Z){return s[Z.getDay()]}function Se(Z){return f[Z.getMonth()]}function B(Z){return c[Z.getMonth()]}function R(Z){return i[+(Z.getHours()>=12)]}function H(Z){return 1+~~(Z.getMonth()/3)}function oe(Z){return l[Z.getUTCDay()]}function Q(Z){return s[Z.getUTCDay()]}function X(Z){return f[Z.getUTCMonth()]}function W(Z){return c[Z.getUTCMonth()]}function le(Z){return i[+(Z.getUTCHours()>=12)]}function ye(Z){return 1+~~(Z.getUTCMonth()/3)}return{format:function(Z){var ce=P(Z+="",k);return ce.toString=function(){return Z},ce},parse:function(Z){var ce=E(Z+="",!1);return ce.toString=function(){return Z},ce},utcFormat:function(Z){var ce=P(Z+="",_);return ce.toString=function(){return Z},ce},utcParse:function(Z){var ce=E(Z+="",!0);return ce.toString=function(){return Z},ce}}}var CP={"-":"",_:" ",0:"0"},_n=/^\s*\d+/,ioe=/^%/,aoe=/[\\^$*+?|[\]().{}]/g;function ut(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 soe(e){return e.replace(aoe,"\\$&")}function cd(e){return new RegExp("^(?:"+e.map(soe).join("|")+")","i")}function ud(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function ooe(e,t,n){var r=_n.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function loe(e,t,n){var r=_n.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function coe(e,t,n){var r=_n.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function uoe(e,t,n){var r=_n.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function doe(e,t,n){var r=_n.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function _P(e,t,n){var r=_n.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function OP(e,t,n){var r=_n.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function foe(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 hoe(e,t,n){var r=_n.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function poe(e,t,n){var r=_n.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function kP(e,t,n){var r=_n.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function moe(e,t,n){var r=_n.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function AP(e,t,n){var r=_n.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function goe(e,t,n){var r=_n.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function yoe(e,t,n){var r=_n.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function voe(e,t,n){var r=_n.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function boe(e,t,n){var r=_n.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function xoe(e,t,n){var r=ioe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function woe(e,t,n){var r=_n.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Soe(e,t,n){var r=_n.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function EP(e,t){return ut(e.getDate(),t,2)}function joe(e,t){return ut(e.getHours(),t,2)}function Noe(e,t){return ut(e.getHours()%12||12,t,2)}function Coe(e,t){return ut(1+yf.count(Oa(e),e),t,3)}function H$(e,t){return ut(e.getMilliseconds(),t,3)}function _oe(e,t){return H$(e,t)+"000"}function Ooe(e,t){return ut(e.getMonth()+1,t,2)}function koe(e,t){return ut(e.getMinutes(),t,2)}function Aoe(e,t){return ut(e.getSeconds(),t,2)}function Eoe(e){var t=e.getDay();return t===0?7:t}function Toe(e,t){return ut(py.count(Oa(e)-1,e),t,2)}function G$(e){var t=e.getDay();return t>=4||t===0?Dc(e):Dc.ceil(e)}function Poe(e,t){return e=G$(e),ut(Dc.count(Oa(e),e)+(Oa(e).getDay()===4),t,2)}function zoe(e){return e.getDay()}function Moe(e,t){return ut(Gm.count(Oa(e)-1,e),t,2)}function Roe(e,t){return ut(e.getFullYear()%100,t,2)}function Doe(e,t){return e=G$(e),ut(e.getFullYear()%100,t,2)}function Loe(e,t){return ut(e.getFullYear()%1e4,t,4)}function Ioe(e,t){var n=e.getDay();return e=n>=4||n===0?Dc(e):Dc.ceil(e),ut(e.getFullYear()%1e4,t,4)}function $oe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ut(t/60|0,"0",2)+ut(t%60,"0",2)}function TP(e,t){return ut(e.getUTCDate(),t,2)}function Uoe(e,t){return ut(e.getUTCHours(),t,2)}function Boe(e,t){return ut(e.getUTCHours()%12||12,t,2)}function qoe(e,t){return ut(1+hy.count(ka(e),e),t,3)}function V$(e,t){return ut(e.getUTCMilliseconds(),t,3)}function Foe(e,t){return V$(e,t)+"000"}function Koe(e,t){return ut(e.getUTCMonth()+1,t,2)}function Hoe(e,t){return ut(e.getUTCMinutes(),t,2)}function Goe(e,t){return ut(e.getUTCSeconds(),t,2)}function Voe(e){var t=e.getUTCDay();return t===0?7:t}function Zoe(e,t){return ut(my.count(ka(e)-1,e),t,2)}function Z$(e){var t=e.getUTCDay();return t>=4||t===0?Lc(e):Lc.ceil(e)}function Yoe(e,t){return e=Z$(e),ut(Lc.count(ka(e),e)+(ka(e).getUTCDay()===4),t,2)}function Woe(e){return e.getUTCDay()}function Qoe(e,t){return ut(Vm.count(ka(e)-1,e),t,2)}function Xoe(e,t){return ut(e.getUTCFullYear()%100,t,2)}function Joe(e,t){return e=Z$(e),ut(e.getUTCFullYear()%100,t,2)}function ele(e,t){return ut(e.getUTCFullYear()%1e4,t,4)}function tle(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Lc(e):Lc.ceil(e),ut(e.getUTCFullYear()%1e4,t,4)}function nle(){return"+0000"}function PP(){return"%"}function zP(e){return+e}function MP(e){return Math.floor(+e/1e3)}var rc,Y$,W$;rle({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 rle(e){return rc=roe(e),Y$=rc.format,rc.parse,W$=rc.utcFormat,rc.utcParse,rc}function ile(e){return new Date(e)}function ale(e){return e instanceof Date?+e:+new Date(+e)}function Oj(e,t,n,r,i,s,l,c,f,h){var m=hj(),g=m.invert,y=m.domain,v=h(".%L"),w=h(":%S"),S=h("%I:%M"),N=h("%I %p"),C=h("%a %d"),A=h("%b %d"),k=h("%B"),_=h("%Y");function T(P){return(f(P)<P?v:c(P)<P?w:l(P)<P?S:s(P)<P?N:r(P)<P?i(P)<P?C:A:n(P)<P?k:_)(P)}return m.invert=function(P){return new Date(g(P))},m.domain=function(P){return arguments.length?y(Array.from(P,ale)):y().map(ile)},m.ticks=function(P){var E=y();return e(E[0],E[E.length-1],P??10)},m.tickFormat=function(P,E){return E==null?T:h(E)},m.nice=function(P){var E=y();return(!P||typeof P.range!="function")&&(P=t(E[0],E[E.length-1],P??10)),P?y(D$(E,P)):m},m.copy=function(){return gf(m,Oj(e,t,n,r,i,s,l,c,f,h))},m}function sle(){return ri.apply(Oj(toe,noe,Oa,Cj,py,yf,jj,wj,Ao,Y$).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function ole(){return ri.apply(Oj(Jse,eoe,ka,_j,my,hy,Nj,Sj,Ao,W$).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function gy(){var e=0,t=1,n,r,i,s,l=Wn,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 m(g){return function(y){var v,w;return arguments.length?([v,w]=y,l=g(v,w),h):[l(0),l(1)]}}return h.range=m(eu),h.rangeRound=m(fj),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 qs(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Q$(){var e=Bs(gy()(Wn));return e.copy=function(){return qs(e,Q$())},Pa.apply(e,arguments)}function X$(){var e=gj(gy()).domain([1,10]);return e.copy=function(){return qs(e,X$()).base(e.base())},Pa.apply(e,arguments)}function J$(){var e=yj(gy());return e.copy=function(){return qs(e,J$()).constant(e.constant())},Pa.apply(e,arguments)}function kj(){var e=vj(gy());return e.copy=function(){return qs(e,kj()).exponent(e.exponent())},Pa.apply(e,arguments)}function lle(){return kj.apply(null,arguments).exponent(.5)}function e5(){var e=[],t=Wn;function n(r){if(r!=null&&!isNaN(r=+r))return t((pf(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(Os),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)=>Vae(e,s/r))},n.copy=function(){return e5(t).domain(e)},Pa.apply(n,arguments)}function yy(){var e=0,t=.5,n=1,r=1,i,s,l,c,f,h=Wn,m,g=!1,y;function v(S){return isNaN(S=+S)?y:(S=.5+((S=+m(S))-s)*(r*S<r*s?c:f),h(g?Math.max(0,Math.min(1,S)):S))}v.domain=function(S){return arguments.length?([e,t,n]=S,i=m(e=+e),s=m(t=+t),l=m(n=+n),c=i===s?0:.5/(s-i),f=s===l?0:.5/(l-s),r=s<i?-1:1,v):[e,t,n]},v.clamp=function(S){return arguments.length?(g=!!S,v):g},v.interpolator=function(S){return arguments.length?(h=S,v):h};function w(S){return function(N){var C,A,k;return arguments.length?([C,A,k]=N,h=xse(S,[C,A,k]),v):[h(0),h(.5),h(1)]}}return v.range=w(eu),v.rangeRound=w(fj),v.unknown=function(S){return arguments.length?(y=S,v):y},function(S){return m=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,v}}function t5(){var e=Bs(yy()(Wn));return e.copy=function(){return qs(e,t5())},Pa.apply(e,arguments)}function n5(){var e=gj(yy()).domain([.1,1,10]);return e.copy=function(){return qs(e,n5()).base(e.base())},Pa.apply(e,arguments)}function r5(){var e=yj(yy());return e.copy=function(){return qs(e,r5()).constant(e.constant())},Pa.apply(e,arguments)}function Aj(){var e=vj(yy());return e.copy=function(){return qs(e,Aj()).exponent(e.exponent())},Pa.apply(e,arguments)}function cle(){return Aj.apply(null,arguments).exponent(.5)}const i5=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:cj,scaleDiverging:t5,scaleDivergingLog:n5,scaleDivergingPow:Aj,scaleDivergingSqrt:cle,scaleDivergingSymlog:r5,scaleIdentity:R$,scaleImplicit:oS,scaleLinear:M$,scaleLog:L$,scaleOrdinal:lj,scalePoint:Wae,scalePow:bj,scaleQuantile:U$,scaleQuantize:B$,scaleRadial:$$,scaleSequential:Q$,scaleSequentialLog:X$,scaleSequentialPow:kj,scaleSequentialQuantile:e5,scaleSequentialSqrt:lle,scaleSequentialSymlog:J$,scaleSqrt:Fse,scaleSymlog:I$,scaleThreshold:q$,scaleTime:sle,scaleUtc:ole,tickFormat:z$},Symbol.toStringTag,{value:"Module"}));function ule(e){var t=i5;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(sf(e));if(n in t&&typeof t[n]=="function")return t[n]()}function RP(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=ule(e);if(r!=null)return r.domain(t).range(n),r}}function Ej(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?RP(e.scale,n,r):RP(t,n,r)}function dle(e){return"scale".concat(sf(e))}function fle(e){return dle(e)in i5}var a5=(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 fle(r)?r:"point"}};function hle(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 s5(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=hle(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,m=(c=r[f])!==null&&c!==void 0?c:0;return Math.abs(s-h)<=Math.abs(s-m)?n[f-1]:n[f]}}}function ple(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):s5(e,void 0)}function DP(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 Zm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DP(Object(n),!0).forEach(function(r){mle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mle(e,t,n){return(t=gle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gle(e){var t=yle(e,"string");return typeof t=="symbol"?t:t+""}function yle(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 dS=[0,"auto"],mn={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"},o5=(e,t)=>e.cartesianAxis.xAxis[t],za=(e,t)=>{var n=o5(e,t);return n??mn},gn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:dS,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:cf},l5=(e,t)=>e.cartesianAxis.yAxis[t],Ma=(e,t)=>{var n=l5(e,t);return n??gn},vle={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:""},Tj=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??vle},er=(e,t,n)=>{switch(t){case"xAxis":return za(e,n);case"yAxis":return Ma(e,n);case"zAxis":return Tj(e,n);case"angleAxis":return tj(e,n);case"radiusAxis":return nj(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},ble=(e,t,n)=>{switch(t){case"xAxis":return za(e,n);case"yAxis":return Ma(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},vf=(e,t,n)=>{switch(t){case"xAxis":return za(e,n);case"yAxis":return Ma(e,n);case"angleAxis":return tj(e,n);case"radiusAxis":return nj(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},c5=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 d5=e=>e.graphicalItems.cartesianItems,xle=ne([Nn,cy],u5),f5=(e,t,n)=>e.filter(n).filter(r=>t?.includeHidden===!0?!0:!r.hide),tu=ne([d5,er,xle],f5,{memoizeOptions:{resultEqualityCheck:dy}}),h5=ne([tu],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(aj)),p5=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),wle=ne([tu],p5),m5=e=>e.map(t=>t.data).filter(Boolean).flat(1),Sle=ne([tu],e=>e.some(t=>!t.data)),g5=ne([tu],m5,{memoizeOptions:{resultEqualityCheck:dy}}),y5=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},Pj=ne([g5,iy],y5),jle=(e,t,n)=>t?.dataKey!=null?e.map(r=>({value:jn(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:jn(i,r)}))):e.map(r=>({value:r})),v5=(e,t,n,r,i,s)=>{var{chartData:l=[],dataStartIndex:c,dataEndIndex:f}=r,h=jle(e,t,n);if(i&&t?.dataKey!=null&&s.length>0){var m=l.slice(c,f+1),g=m.map(y=>({value:jn(y,t.dataKey)})).filter(y=>y.value!=null);return[...g,...h]}return h},bf=ne([Pj,er,tu,iy,Sle,g5],v5);function Cc(e){if(Gi(e)||e instanceof Date){var t=Number(e);if(ct(t))return t}}function LP(e){if(Array.isArray(e)){var t=[Cc(e[0]),Cc(e[1])];return Ui(t)?t:void 0}var n=Cc(e);if(n!=null)return[n,n]}function Zi(e){return e.map(Cc).filter(Li)}function Nle(e,t){var n=Cc(e),r=Cc(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var Cle=ne([bf],e=>e?.map(t=>t.value).sort(Nle));function b5(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function _le(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!Hi(t))r=t;else if(Array.isArray(t)){var i=Zi(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:Zi(n.flatMap(s=>{var l=jn(e,s.dataKey),c,f;if(Array.isArray(l)?[c,f]=l:c=f=l,!(!ct(c)||!ct(f)))return[r-c,r+f]}))}var bn=e=>{var t=Cn(e),n=Jc(e);return vf(e,t,n)},Ic=ne([bn],e=>e?.dataKey),Ole=ne([h5,iy,bn],N$),x5=(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,m=h.map(ij);return[c,{stackedData:ine(e,m,n),graphicalItems:h}]}))},w5=ne([Ole,h5,ay,y$],x5),S5=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:s}=t;if(r==null&&n!=="zAxis"){var l=lne(e,i,s);if(!(l!=null&&l[0]===0&&l[1]===0))return l}},kle=ne([er],e=>e.allowDataOverflow),zj=e=>{var t;if(e==null||!("domain"in e))return dS;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Zi(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:dS},j5=ne([er],zj),N5=ne([j5,kle],s$),Ale=ne([w5,Si,Nn,N5],S5,{memoizeOptions:{resultEqualityCheck:uy}}),Mj=e=>e.errorBars,Ele=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>b5(n,r)),Ym=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]}},C5=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 m,g=h.data!=null?[...h.data]:l,y=(m=i[h.id])===null||m===void 0?void 0:m.filter(v=>b5(s,v));g.forEach(v=>{var w,S=jn(v,(w=n.dataKey)!==null&&w!==void 0?w:h.dataKey),N=_le(v,S,y);if(N.length>=2){var C=Math.min(...N),A=Math.max(...N);(c==null||C<c)&&(c=C),(f==null||A>f)&&(f=A)}var k=LP(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 m=LP(jn(h,n.dataKey));m!=null&&(c=c==null?m[0]:Math.min(c,m[0]),f=f==null?m[1]:Math.max(f,m[1]))}),ct(c)&&ct(f))return[c,f]},Tle=ne([Pj,er,wle,Mj,Nn,bae],C5,{memoizeOptions:{resultEqualityCheck:uy}});function Ple(e){var{value:t}=e;if(Gi(t)||t instanceof Date)return t}var zle=(e,t,n)=>{var r=e.map(Ple).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&RL(r))?a$(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},_5=e=>e.referenceElements.dots,nu=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),Mle=ne([_5,Nn,cy],nu),O5=e=>e.referenceElements.areas,Rle=ne([O5,Nn,cy],nu),k5=e=>e.referenceElements.lines,Dle=ne([k5,Nn,cy],nu),A5=(e,t)=>{if(e!=null){var n=Zi(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Lle=ne(Mle,Nn,A5),E5=(e,t)=>{if(e!=null){var n=Zi(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)]}},Ile=ne([Rle,Nn],E5);function $le(e){var t;if(e.x!=null)return Zi([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:Zi(n)}function Ule(e){var t;if(e.y!=null)return Zi([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:Zi(n)}var T5=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?$le(r):Ule(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Ble=ne([Dle,Nn],T5),qle=ne(Lle,Ble,Ile,(e,t,n)=>Ym(e,n,t)),P5=(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?Ym(r,s,i):Ym(s,i);return wae(t,h,e.allowDataOverflow)},Fle=ne([er,j5,N5,Ale,Tle,qle,Ut,Nn],P5,{memoizeOptions:{resultEqualityCheck:uy}}),Kle=[0,1],z5=(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=Yi(t,s);if(h&&c==null){var m;return a$(0,(m=n?.length)!==null&&m!==void 0?m:0)}return f==="category"?zle(r,e,h):i==="expand"&&!h?Kle:l}},Rj=ne([er,Ut,Pj,bf,ay,Nn,Fle],z5),ru=ne([er,c5,X1],a5),M5=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=zj(t),s=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&Ui(e)){if(s)return V2(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return Z2(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(s&&Ui(e))return V2(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&Ui(e))return Z2(e,t.tickCount,t.allowDecimals,"adaptive")}}},Dj=ne([Rj,vf,ru],M5),R5=(e,t,n,r)=>{if(r!=="angleAxis"&&e?.type==="number"&&Ui(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},Hle=ne([er,Rj,Dj,Nn],R5),Gle=ne(bf,er,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Zi(e.map(g=>g.value))).sort((g,y)=>g-y),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 m=h-f;n=Math.min(n,m)}}return n/l}}),D5=ne(Gle,Ut,_ae,Ln,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!ct(e))return 0;var s=t==="vertical"?r.height:r.width;if(i==="gap")return e*s/2;if(i==="no-gap"){var l=Ps(n,e*s),c=e*s/2;return c-l-(c-l)/s*l}return 0}),Vle=(e,t,n)=>{var r=za(e,t);return r==null||typeof r.padding!="string"?0:D5(e,"xAxis",t,n,r.padding)},Zle=(e,t,n)=>{var r=Ma(e,t);return r==null||typeof r.padding!="string"?0:D5(e,"yAxis",t,n,r.padding)},Yle=ne(za,Vle,(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}}),Wle=ne(Ma,Zle,(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}}),Qle=ne([Ln,Yle,Jg,Xg,(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]}),Xle=ne([Ln,Ut,Wle,Jg,Xg,(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]}),xf=(e,t,n,r)=>{var i;switch(t){case"xAxis":return Qle(e,n,r);case"yAxis":return Xle(e,n,r);case"zAxis":return(i=Tj(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return w$(e);case"radiusAxis":return S$(e,n);default:return}},L5=ne([er,xf],sy),Jle=ne([ru,Hle],Rae),Lj=ne([er,ru,Jle,L5],Ej),I5=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:s}=n,l=Yi(e,r);if(l&&(i==="number"||s!=="auto"))return t.map(c=>c.value)}},Ij=ne([Ut,bf,vf,Nn],I5),vy=ne([Lj],sj);ne([Lj],ple);ne([Lj,Cle],s5);ne([tu,Mj,Nn],Ele);function $5(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var by=(e,t)=>t,xy=(e,t,n)=>n,ece=ne(Wg,by,xy,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort($5)),tce=ne(Qg,by,xy,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort($5)),U5=(e,t)=>({width:e.width,height:t.height}),nce=(e,t)=>{var n=typeof t.width=="number"?t.width:cf;return{width:n,height:e.height}},rce=ne(Ln,za,U5),ice=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},ace=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},sce=ne(Ta,Ln,ece,by,xy,(e,t,n,r,i)=>{var s={},l;return n.forEach(c=>{var f=U5(t,c);l==null&&(l=ice(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}),oce=ne(Ea,Ln,tce,by,xy,(e,t,n,r,i)=>{var s={},l;return n.forEach(c=>{var f=nce(t,c);l==null&&(l=ace(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}),lce=(e,t)=>{var n=za(e,t);if(n!=null)return sce(e,n.orientation,n.mirror)},cce=ne([Ln,za,lce,(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}}}),uce=(e,t)=>{var n=Ma(e,t);if(n!=null)return oce(e,n.orientation,n.mirror)},dce=ne([Ln,Ma,uce,(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}}}),fce=ne(Ln,Ma,(e,t)=>{var n=typeof t.width=="number"?t.width:cf;return{width:n,height:e.height}}),B5=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:s,dataKey:l}=n,c=Yi(e,r),f=t.map(m=>m.value),h=f.filter(m=>m!=null);if(l&&c&&s==="category"&&i&&RL(h))return f}},$j=ne([Ut,bf,er,Nn],B5);ne([Ut,ble,ru,vy,$j,Ij,xf,Dj,Nn],(e,t,n,r,i,s,l,c,f)=>{if(t!=null){var h=Yi(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}}});var hce=(e,t,n,r,i,s,l,c,f)=>{if(!(t==null||r==null)){var h=Yi(e,f),{type:m,ticks:g,tickCount:y}=t,v=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,w=m==="category"&&r.bandwidth?r.bandwidth()/v:0;w=f==="angleAxis"&&s!=null&&s.length>=2?gi(s[0]-s[1])*2*w:w;var S=g||i;return S?S.map((N,C)=>{var A=l?l.indexOf(N):N,k=r.map(A);return ct(k)?{index:C,coordinate:k+w,value:N,offset:w}:null}).filter(Li):h&&c?c.map((N,C)=>{var A=r.map(N);return ct(A)?{coordinate:A+w,value:N,index:C,offset:w}:null}).filter(Li):r.ticks?r.ticks(y).map((N,C)=>{var A=r.map(N);return ct(A)?{coordinate:A+w,value:N,index:C,offset:w}:null}).filter(Li):r.domain().map((N,C)=>{var A=r.map(N);return ct(A)?{coordinate:A+w,value:l?l[N]:N,index:C,offset:w}:null}).filter(Li)}},q5=ne([Ut,vf,ru,vy,Dj,xf,$j,Ij,Nn],hce),pce=(e,t,n,r,i,s,l)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var c=Yi(e,l),{tickCount:f}=t,h=0;return h=l==="angleAxis"&&r?.length>=2?gi(r[0]-r[1])*2*h:h,c&&s?s.map((m,g)=>{var y=n.map(m);return ct(y)?{coordinate:y+h,value:m,index:g,offset:h}:null}).filter(Li):n.ticks?n.ticks(f).map((m,g)=>{var y=n.map(m);return ct(y)?{coordinate:y+h,value:m,index:g,offset:h}:null}).filter(Li):n.domain().map((m,g)=>{var y=n.map(m);return ct(y)?{coordinate:y+h,value:i?i[m]:m,index:g,offset:h}:null}).filter(Li)}},F5=ne([Ut,vf,vy,xf,$j,Ij,Nn],pce),K5=ne(er,vy,(e,t)=>{if(!(e==null||t==null))return Zm(Zm({},e),{},{scale:t})}),mce=ne([er,ru,Rj,L5],Ej),gce=ne([mce],sj);ne((e,t,n)=>Tj(e,n),gce,(e,t)=>{if(!(e==null||t==null))return Zm(Zm({},e),{},{scale:t})});var yce=ne([Ut,Wg,Qg],(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}}),vce=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};ne([vce],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 H5=e=>e.options.defaultTooltipEventType,G5=e=>e.options.validateTooltipEventTypes;function V5(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function wf(e,t){var n=H5(e),r=G5(e);return V5(t,n,r)}function bce(e){return Le(t=>wf(t,e))}var Z5=(e,t)=>{var n,r=Number(t);if(!(Hi(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},xce=e=>e.tooltip.settings,vs={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},wce={itemInteraction:{click:vs,hover:vs},axisInteraction:{click:vs,hover:vs},keyboardInteraction:vs,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}},Y5=Fn({name:"tooltip",initialState:wce,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:Tt()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Zr(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:Tt()},removeTooltipEntrySettings:{reducer(e,t){var n=Zr(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:Tt()},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:Sce,replaceTooltipEntrySettings:jce,removeTooltipEntrySettings:Nce,setTooltipSettingsState:Cce,setActiveMouseOverItemIndex:_ce,mouseLeaveItem:pye,mouseLeaveChart:W5,setActiveClickItemIndex:mye,setMouseOverAxisIndex:Q5,setMouseClickAxisIndex:Oce,setSyncInteraction:gd,setKeyboardInteraction:Wm}=Y5.actions,kce=Y5.reducer;function IP(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 wp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IP(Object(n),!0).forEach(function(r){Ace(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ace(e,t,n){return(t=Ece(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ece(e){var t=Tce(e,"string");return typeof t=="symbol"?t:t+""}function Tce(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 Pce(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function zce(e){return e.index!=null}var X5=(e,t,n,r)=>{if(t==null)return vs;var i=Pce(e,t,n);if(i==null)return vs;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(zce(i)){if(s)return wp(wp({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return wp(wp({},vs),{},{coordinate:i.coordinate})};function Mce(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 Rce(e,t){var n=Mce(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 Dce(e,t,n){if(n==null||t==null)return!0;var r=jn(e,t);return r==null||!Ui(n)?!0:Rce(r,n)}var Sd=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var s=Number(i);if(!ct(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||Dce(h,n,r)?String(f):null},J5=(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,iu=e=>e.tooltip;function $P(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 UP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$P(Object(n),!0).forEach(function(r){Lce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$P(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lce(e,t,n){return(t=Ice(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ice(e){var t=$ce(e,"string");return typeof t=="symbol"?t:t+""}function $ce(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 Uce(e){if(typeof e=="string"||typeof e=="number")return e}function Bce(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function qce(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function BP(e){if(typeof e=="string")return e}function Fce(e){if(!(e==null||typeof e!="object")){var t="name"in e?Uce(e.name):void 0,n="unit"in e?Bce(e.unit):void 0,r="dataKey"in e?qce(e.dataKey):void 0,i="payload"in e?e.payload:void 0,s="color"in e?BP(e.color):void 0,l="fill"in e?BP(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:s,fill:l}}}function Kce(e,t){return e??t}var n3=(e,t,n,r,i,s,l)=>{if(!(t==null||s==null)){var{chartData:c,computedData:f,dataStartIndex:h,dataEndIndex:m}=n,g=[];return e.reduce((y,v)=>{var w,{dataDefinedOnItem:S,settings:N}=v,C=Kce(S,c),A=Array.isArray(C)?PI(C,h,m):C,k=(w=N?.dataKey)!==null&&w!==void 0?w:r,_=N?.nameKey,T;if(r&&Array.isArray(A)&&!Array.isArray(A[0])&&l==="axis"?T=DL(A,r,i):T=s(A,t,f,_),Array.isArray(T))T.forEach(E=>{var z,D,F=Fce(E),U=F?.name,I=F?.dataKey,ae=F?.payload,ve=UP(UP({},N),{},{name:U,unit:F?.unit,color:(z=F?.color)!==null&&z!==void 0?z:N?.color,fill:(D=F?.fill)!==null&&D!==void 0?D:N?.fill});y.push(MT({tooltipEntrySettings:ve,dataKey:I,payload:ae,value:jn(ae,I),name:U==null?void 0:String(U)}))});else{var P;y.push(MT({tooltipEntrySettings:N,dataKey:k,payload:T,value:jn(T,k),name:(P=jn(T,_))!==null&&P!==void 0?P:N?.name}))}return y},g)}},Uj=ne([bn,c5,X1],a5),Hce=ne([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),Gce=ne([Cn,Jc],u5),ll=ne([Hce,bn,Gce],f5,{memoizeOptions:{resultEqualityCheck:dy}}),Vce=ne([ll],e=>e.filter(aj)),r3=ne([ll],m5,{memoizeOptions:{resultEqualityCheck:dy}}),Zce=ne([ll],e=>e.some(t=>!t.data)),Qo=ne([r3,Si],y5),Yce=ne([Vce,Si,bn],N$),Bj=ne([Qo,bn,ll,Si,Zce,r3],v5),i3=ne([bn],zj),Wce=ne([bn],e=>e.allowDataOverflow),a3=ne([i3,Wce],s$),Qce=ne([ll],e=>e.filter(aj)),Xce=ne([Yce,Qce,ay,y$],x5),Jce=ne([Xce,Si,Cn,a3],S5),eue=ne([ll],p5),tue=ne([Qo,bn,eue,Mj,Cn,xae],C5,{memoizeOptions:{resultEqualityCheck:uy}}),nue=ne([_5,Cn,Jc],nu),rue=ne([nue,Cn],A5),iue=ne([O5,Cn,Jc],nu),aue=ne([iue,Cn],E5),sue=ne([k5,Cn,Jc],nu),oue=ne([sue,Cn],T5),lue=ne([rue,oue,aue],Ym),cue=ne([bn,i3,a3,Jce,tue,lue,Ut,Cn],P5),$c=ne([bn,Ut,Qo,Bj,ay,Cn,cue],z5),uue=ne([$c,bn,Uj],M5),due=ne([bn,$c,uue,Cn],R5),s3=e=>{var t=Cn(e),n=Jc(e),r=!1;return xf(e,t,n,r)},o3=ne([bn,s3],sy),fue=ne([bn,Uj,due,o3],Ej),l3=ne([fue],sj),hue=ne([Ut,Bj,bn,Cn],B5),pue=ne([Ut,Bj,bn,Cn],I5),mue=(e,t,n,r,i,s,l,c)=>{if(t){var{type:f}=t,h=Yi(e,c);if(r){var m=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,g=f==="category"&&r.bandwidth?r.bandwidth()/m:0;return g=c==="angleAxis"&&i!=null&&i?.length>=2?gi(i[0]-i[1])*2*g:g,h&&l?l.map((y,v)=>{var w=r.map(y);return ct(w)?{coordinate:w+g,value:y,index:v,offset:g}:null}).filter(Li):r.domain().map((y,v)=>{var w=r.map(y);return ct(w)?{coordinate:w+g,value:s?s[y]:y,index:v,offset:g}:null}).filter(Li)}}},Ra=ne([Ut,bn,Uj,l3,s3,hue,pue,Cn],mue),qj=ne([H5,G5,xce],(e,t,n)=>V5(n.shared,e,t)),c3=e=>e.tooltip.settings.trigger,Fj=e=>e.tooltip.settings.defaultIndex,Sf=ne([iu,qj,c3,Fj],X5),Yd=ne([Sf,Qo,Ic,$c],Sd),u3=ne([Ra,Yd],Z5),gue=ne([Sf],e=>{if(e)return e.dataKey}),yue=ne([Sf],e=>{if(e)return e.graphicalItemId}),d3=ne([iu,qj,c3,Fj],e3),vue=ne([Ea,Ta,Ut,Ln,Ra,Fj,d3],J5),bue=ne([Sf,vue],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),xue=ne([Sf],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),wue=ne([d3,Yd,Si,Ic,u3,t3,qj],n3),Sue=ne([wue],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function qP(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 FP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qP(Object(n),!0).forEach(function(r){jue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jue(e,t,n){return(t=Nue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nue(e){var t=Cue(e,"string");return typeof t=="symbol"?t:t+""}function Cue(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 _ue=()=>Le(bn),Oue=()=>{var e=_ue(),t=Le(Ra),n=Le(l3);return Om(!e||!n?void 0:FP(FP({},e),{},{scale:n}),t)};function KP(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 ic(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KP(Object(n),!0).forEach(function(r){kue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kue(e,t,n){return(t=Aue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Aue(e){var t=Eue(e,"string");return typeof t=="symbol"?t:t+""}function Eue(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 Tue=(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}},Pue=(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 ic(ic(ic({},r),Mn(r.cx,r.cy,l,s)),{},{angle:s,radius:l})}var c=i.coordinate,{angle:f}=r;return ic(ic(ic({},r),Mn(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 zue(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 f3=(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,m,g,y,v=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=(m=n[c])===null||m===void 0?void 0:m.coordinate,S=c>=l-1?(g=n[0])===null||g===void 0?void 0:g.coordinate:(y=n[c+1])===null||y===void 0?void 0:y.coordinate,N=void 0;if(!(v==null||w==null||S==null))if(gi(w-v)!==gi(S-w)){var C=[];if(gi(S-w)===gi(i[1]-i[0])){N=S;var A=w+i[1]-i[0];C[0]=Math.min(A,(A+v)/2),C[1]=Math.max(A,(A+v)/2)}else{N=v;var k=S+i[1]-i[0];C[0]=Math.min(w,(k+w)/2),C[1]=Math.max(w,(k+w)/2)}var _=[Math.min(w,(N+w)/2),Math.max(w,(N+w)/2)];if(e>_[0]&&e<=_[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(v,S),E=Math.max(v,S);if(e>(P+w)/2&&e<=(E+w)/2){var z;return(z=n[c])===null||z===void 0?void 0:z.index}}}else if(t)for(var D=0;D<l;D++){var F=t[D];if(F!=null){var U=t[D+1],I=t[D-1];if(D===0&&U!=null&&e<=(F.coordinate+U.coordinate)/2||D===l-1&&I!=null&&e>(F.coordinate+I.coordinate)/2||D>0&&D<l-1&&I!=null&&U!=null&&e>(F.coordinate+I.coordinate)/2&&e<=(F.coordinate+U.coordinate)/2)return F.index}}return-1},h3=()=>Le(X1),Kj=(e,t)=>t,p3=(e,t,n)=>n,Hj=(e,t,n,r)=>r,Mue=ne(Ra,e=>Ug(e,t=>t.coordinate)),Gj=ne([iu,Kj,p3,Hj],X5),Vj=ne([Gj,Qo,Ic,$c],Sd),Rue=(e,t,n)=>{if(t!=null){var r=iu(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},m3=ne([iu,Kj,p3,Hj],e3),Qm=ne([Ea,Ta,Ut,Ln,Ra,Hj,m3],J5),Due=ne([Gj,Qm],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),g3=ne([Ra,Vj],Z5),Lue=ne([m3,Vj,Si,Ic,g3,t3,Kj],n3),Iue=ne([Gj,Vj],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),$ue=(e,t,n,r,i,s,l)=>{if(!(!e||!n||!r||!i)&&zue(e,l)){var c=cne(e,t),f=f3(c,s,i,n,r),h=Tue(t,i,f,e);return{activeIndex:String(f),activeCoordinate:h}}},Uue=(e,t,n,r,i,s,l)=>{if(!(!e||!r||!i||!s||!n)){var c=oae(e,n);if(c){var f=une(c,t),h=f3(f,l,s,r,i),m=Pue(t,s,h,c);return{activeIndex:String(h),activeCoordinate:m}}}},Bue=(e,t,n,r,i,s,l,c)=>{if(!(!e||!t||!r||!i||!s))return t==="horizontal"||t==="vertical"?$ue(e,t,r,i,s,l,c):Uue(e,t,n,r,i,s,l)},que=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}}),Fue=ne(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(ur)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:Mae}});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 GP(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){Kue(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 Kue(e,t,n){return(t=Hue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hue(e){var t=Gue(e,"string");return typeof t=="symbol"?t:t+""}function Gue(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 Vue={},Zue={zIndexMap:Object.values(ur).reduce((e,t)=>GP(GP({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),Vue)},Yue=new Set(Object.values(ur));function Wue(e){return Yue.has(e)}var y3=Fn({name:"zIndex",initialState:Zue,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:Tt()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!Wue(n)&&delete e.zIndexMap[n])},prepare:Tt()},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:Tt()},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:Tt()}}}),{registerZIndexPortal:Que,unregisterZIndexPortal:Mx,registerZIndexPortalElement:Xue,unregisterZIndexPortalElement:Jue}=y3.actions,ede=y3.reducer;function Fs(e){var{zIndex:t,children:n}=e,r=Hne(),i=r&&t!==void 0&&t!==0,s=Er(),l=x.useRef(void 0),c=x.useRef(new Set),f=Qt(),h=Le(g=>que(g,t,s));if(x.useLayoutEffect(()=>{if(!i){var g=c.current;g.forEach(v=>{f(Mx({zIndex:v}))}),g.clear(),l.current=void 0;return}if(c.current.has(t)||(f(Que({zIndex:t})),c.current.add(t)),h){l.current=h;var y=c.current;y.forEach(v=>{v!==t&&(f(Mx({zIndex:v})),y.delete(v))})}},[f,t,i,h]),x.useLayoutEffect(()=>{var g=c.current;return()=>{g.forEach(y=>{f(Mx({zIndex:y}))}),g.clear()}},[f]),!i)return n;var m=h??l.current;return m?el.createPortal(n,m):null}function fS(){return fS=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},fS.apply(null,arguments)}function VP(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 Sp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VP(Object(n),!0).forEach(function(r){tde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tde(e,t,n){return(t=nde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nde(e){var t=rde(e,"string");return typeof t=="symbol"?t:t+""}function rde(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 ide(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return x.isValidElement(t)?x.cloneElement(t,r):x.createElement(n,r)}function ade(e){var t,{coordinate:n,payload:r,index:i,offset:s,tooltipAxisBandSize:l,layout:c,cursor:f,tooltipEventType:h,chartName:m}=e,g=n,y=r,v=i;if(!f||!g||m!=="ScatterChart"&&h!=="axis")return null;var w,S,N;if(m==="ScatterChart")w=g,S=bie,N=ur.cursorLine;else if(m==="BarChart")w=xie(c,g,s,l),S=Qie,N=ur.cursorRectangle;else if(c==="radial"&&$L(g)){var{cx:C,cy:A,radius:k,startAngle:_,endAngle:T}=r$(g);w={cx:C,cy:A,startAngle:_,endAngle:T,innerRadius:k,outerRadius:k},S=dae,N=ur.cursorLine}else w={points:fae(c,g,s)},S=Up,N=ur.cursorLine;var P=typeof f=="object"&&"className"in f?f.className:void 0,E=Sp(Sp(Sp(Sp({stroke:"#ccc",pointerEvents:"none"},s),w),Rg(f)),{},{payload:y,payloadIndex:v,className:bt("recharts-tooltip-cursor",P)});return x.createElement(Fs,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:N},x.createElement(ide,{cursor:f,cursorComp:S,cursorProps:E}))}function sde(e){var t=Oue(),n=Fne(),r=Wc(),i=h3();return t==null||n==null||r==null||i==null?null:x.createElement(ade,fS({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var v3=x.createContext(null),ode=()=>x.useContext(v3),Rx={exports:{}},ZP;function lde(){return ZP||(ZP=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,m){this.fn=f,this.context=h,this.once=m||!1}function s(f,h,m,g,y){if(typeof m!="function")throw new TypeError("The listener must be a function");var v=new i(m,g||f,y),w=n?n+h:h;return f._events[w]?f._events[w].fn?f._events[w]=[f._events[w],v]:f._events[w].push(v):(f._events[w]=v,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=[],m,g;if(this._eventsCount===0)return h;for(g in m=this._events)t.call(m,g)&&h.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(m)):h},c.prototype.listeners=function(h){var m=n?n+h:h,g=this._events[m];if(!g)return[];if(g.fn)return[g.fn];for(var y=0,v=g.length,w=new Array(v);y<v;y++)w[y]=g[y].fn;return w},c.prototype.listenerCount=function(h){var m=n?n+h:h,g=this._events[m];return g?g.fn?1:g.length:0},c.prototype.emit=function(h,m,g,y,v,w){var S=n?n+h:h;if(!this._events[S])return!1;var N=this._events[S],C=arguments.length,A,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,m),!0;case 3:return N.fn.call(N.context,m,g),!0;case 4:return N.fn.call(N.context,m,g,y),!0;case 5:return N.fn.call(N.context,m,g,y,v),!0;case 6:return N.fn.call(N.context,m,g,y,v,w),!0}for(k=1,A=new Array(C-1);k<C;k++)A[k-1]=arguments[k];N.fn.apply(N.context,A)}else{var _=N.length,T;for(k=0;k<_;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,m);break;case 3:N[k].fn.call(N[k].context,m,g);break;case 4:N[k].fn.call(N[k].context,m,g,y);break;default:if(!A)for(T=1,A=new Array(C-1);T<C;T++)A[T-1]=arguments[T];N[k].fn.apply(N[k].context,A)}}return!0},c.prototype.on=function(h,m,g){return s(this,h,m,g,!1)},c.prototype.once=function(h,m,g){return s(this,h,m,g,!0)},c.prototype.removeListener=function(h,m,g,y){var v=n?n+h:h;if(!this._events[v])return this;if(!m)return l(this,v),this;var w=this._events[v];if(w.fn)w.fn===m&&(!y||w.once)&&(!g||w.context===g)&&l(this,v);else{for(var S=0,N=[],C=w.length;S<C;S++)(w[S].fn!==m||y&&!w[S].once||g&&w[S].context!==g)&&N.push(w[S]);N.length?this._events[v]=N.length===1?N[0]:N:l(this,v)}return this},c.prototype.removeAllListeners=function(h){var m;return h?(m=n?n+h:h,this._events[m]&&l(this,m)):(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})(Rx)),Rx.exports}var cde=lde();const ude=Ms(cde);var Wd=new ude,hS="recharts.syncEvent.tooltip",YP="recharts.syncEvent.brush",dde=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!Hi(n))return e[n]}},fde={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},b3=Fn({name:"options",initialState:fde,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),hde=b3.reducer,{createEventEmitter:pde}=b3.actions;function mde(e){return e.tooltip.syncInteraction}var gde={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},x3=Fn({name:"chartData",initialState:gde,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:WP,setDataStartEndIndexes:yde,setComputedData:gye}=x3.actions,vde=x3.reducer,bde=["x","y"];function QP(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 ac(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QP(Object(n),!0).forEach(function(r){xde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xde(e,t,n){return(t=wde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wde(e){var t=Sde(e,"string");return typeof t=="symbol"?t:t+""}function Sde(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 jde(e,t){if(e==null)return{};var n,r,i=Nde(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 Nde(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 Cde(){var e=Le(J1),t=Le(ej),n=Qt(),r=Le(v$),i=Le(Ra),s=Wc(),l=ey(),c=Le(f=>f.rootProps.className);x.useEffect(()=>{if(e==null)return Yc;var f=(h,m,g)=>{if(t!==g&&e===h){if(m.payload.active===!1){n(gd({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r==="index"){var y;if(l&&m!==null&&m!==void 0&&(y=m.payload)!==null&&y!==void 0&&y.coordinate&&m.payload.sourceViewBox){var v=m.payload.coordinate,{x:w,y:S}=v,N=jde(v,bde),{x:C,y:A,width:k,height:_}=m.payload.sourceViewBox,T=ac(ac({},N),{},{x:l.x+(k?(w-C)/k:0)*l.width,y:l.y+(_?(S-A)/_:0)*l.height});n(ac(ac({},m),{},{payload:ac(ac({},m.payload),{},{coordinate:T})}))}else n(m);return}if(i!=null){var P;if(typeof r=="function"){var E={activeTooltipIndex:m.payload.index==null?void 0:Number(m.payload.index),isTooltipActive:m.payload.active,activeIndex:m.payload.index==null?void 0:Number(m.payload.index),activeLabel:m.payload.label,activeDataKey:m.payload.dataKey,activeCoordinate:m.payload.coordinate},z=r(i,E);P=i[z]}else r==="value"&&(P=i.find(G=>String(G.value)===m.payload.label));var{coordinate:D}=m.payload;if(D==null||l==null){n(gd({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(P==null){n(gd({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:m.payload.sourceViewBox,graphicalItemId:void 0}));return}var{x:F,y:U}=D,I=Math.min(F,l.x+l.width),ae=Math.min(U,l.y+l.height),ve={x:s==="horizontal"?P.coordinate:I,y:s==="horizontal"?ae:P.coordinate},me=gd({active:m.payload.active,coordinate:ve,dataKey:m.payload.dataKey,index:String(P.index),label:m.payload.label,sourceViewBox:m.payload.sourceViewBox,graphicalItemId:m.payload.graphicalItemId});n(me)}}};return Wd.on(hS,f),()=>{Wd.off(hS,f)}},[c,n,t,e,r,i,s,l])}function _de(){var e=Le(J1),t=Le(ej),n=Qt();x.useEffect(()=>{if(e==null)return Yc;var r=(i,s,l)=>{t!==l&&e===i&&n(yde(s))};return Wd.on(YP,r),()=>{Wd.off(YP,r)}},[n,t,e])}function Ode(){var e=Qt();x.useEffect(()=>{e(pde())},[e]),Cde(),_de()}function kde(e,t,n,r,i,s){var l=Le(w=>Rue(w,e,t)),c=Le(yue),f=Le(ej),h=Le(J1),m=Le(v$),g=Le(mde),y=g?.sourceViewBox!=null,v=ey();x.useEffect(()=>{if(!y&&h!=null&&f!=null){var w=gd({active:s,coordinate:n,dataKey:l,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:c});Wd.emit(hS,h,w,f)}},[y,n,l,c,i,r,f,h,m,s,v])}function XP(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 JP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XP(Object(n),!0).forEach(function(r){Ade(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ade(e,t,n){return(t=Ede(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ede(e){var t=Tde(e,"string");return typeof t=="symbol"?t:t+""}function Tde(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 Pde(e){return e.dataKey}function zde(e,t){return x.isValidElement(e)?x.cloneElement(e,t):typeof e=="function"?x.createElement(e,t):x.createElement(Zre,t)}var ez=[],Mde={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 Rde(e){var t,n,r=Ar(e,Mde),{active:i,allowEscapeViewBox:s,animationDuration:l,animationEasing:c,content:f,filterNull:h,isAnimationActive:m,offset:g,payloadUniqBy:y,position:v,reverseDirection:w,useTranslate3d:S,wrapperStyle:N,cursor:C,shared:A,trigger:k,defaultIndex:_,portal:T,axisId:P}=r,E=Qt(),z=typeof _=="number"?String(_):_;x.useEffect(()=>{E(Cce({shared:A,trigger:k,axisId:P,active:i,defaultIndex:z}))},[E,A,k,P,i,z]);var D=ey(),F=QI(),U=bce(A),{activeIndex:I,isActive:ae}=(t=Le(ye=>Iue(ye,U,k,z)))!==null&&t!==void 0?t:{},ve=Le(ye=>Lue(ye,U,k,z)),me=Le(ye=>g3(ye,U,k,z)),G=Le(ye=>Due(ye,U,k,z)),re=ve,ge=ode(),Se=(n=i??ae)!==null&&n!==void 0?n:!1,[B,R]=nI([re,Se]),H=U==="axis"?me:void 0;kde(U,k,G,H,I,Se);var oe=T??ge;if(oe==null||D==null||U==null)return null;var Q=re??ez;Se||(Q=ez),h&&Q.length&&(Q=QL(Q.filter(ye=>ye.value!=null&&(ye.hide!==!0||r.includeHidden)),y,Pde));var X=Q.length>0,W=JP(JP({},r),{},{payload:Q,label:H,active:Se,activeIndex:I,coordinate:G,accessibilityLayer:F}),le=x.createElement(aie,{allowEscapeViewBox:s,animationDuration:l,animationEasing:c,isAnimationActive:m,active:Se,coordinate:G,hasPayload:X,offset:g,position:v,reverseDirection:w,useTranslate3d:S,viewBox:D,wrapperStyle:N,lastBoundingBox:B,innerRef:R,hasPortalFromProps:!!T},zde(f,W));return x.createElement(x.Fragment,null,el.createPortal(le,oe),Se&&x.createElement(sde,{cursor:C,tooltipEventType:U,coordinate:G,payload:Q,index:I}))}function Dde(e,t,n){return(t=Lde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lde(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)}class $de{constructor(t){Dde(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 tz(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 Ude(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tz(Object(n),!0).forEach(function(r){Bde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bde(e,t,n){return(t=qde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qde(e){var t=Fde(e,"string");return typeof t=="symbol"?t:t+""}function Fde(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 Kde={cacheSize:2e3,enableCache:!0},w3=Ude({},Kde),nz=new $de(w3.cacheSize),Hde={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},rz="recharts_measurement_span";function Gde(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 iz=(e,t)=>{try{var n=document.getElementById(rz);n||(n=document.createElement("span"),n.setAttribute("id",rz),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,Hde,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},jd=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||hf.isSsr)return{width:0,height:0};if(!w3.enableCache)return iz(t,n);var r=Gde(t,n),i=nz.get(r);if(i)return i;var s=iz(t,n);return nz.set(r,s),s},S3;function Vde(e,t,n){return(t=Zde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zde(e){var t=Yde(e,"string");return typeof t=="symbol"?t:t+""}function Yde(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 az=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,sz=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Wde=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,Qde=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Xde={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Jde=["cm","mm","pt","pc","in","Q","px"];function efe(e){return Jde.includes(e)}var yc="NaN";function tfe(e,t){return e*Xde[t]}class zn{static parse(t){var n,[,r,i]=(n=Qde.exec(t))!==null&&n!==void 0?n:[];return r==null?zn.NaN:new zn(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,Hi(t)&&(this.unit=""),n!==""&&!Wde.test(n)&&(this.num=NaN,this.unit=""),efe(n)&&(this.num=tfe(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new zn(NaN,""):new zn(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new zn(NaN,""):new zn(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new zn(NaN,""):new zn(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new zn(NaN,""):new zn(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Hi(this.num)}}S3=zn;Vde(zn,"NaN",new S3(NaN,""));function j3(e){if(e==null||e.includes(yc))return yc;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,s]=(n=az.exec(t))!==null&&n!==void 0?n:[],l=zn.parse(r??""),c=zn.parse(s??""),f=i==="*"?l.multiply(c):l.divide(c);if(f.isNaN())return yc;t=t.replace(az,f.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var h,[,m,g,y]=(h=sz.exec(t))!==null&&h!==void 0?h:[],v=zn.parse(m??""),w=zn.parse(y??""),S=g==="+"?v.add(w):v.subtract(w);if(S.isNaN())return yc;t=t.replace(sz,S.toString())}return t}var oz=/\(([^()]*)\)/;function nfe(e){for(var t=e,n;(n=oz.exec(t))!=null;){var[,r]=n;t=t.replace(oz,j3(r))}return t}function rfe(e){var t=e.replace(/\s+/g,"");return t=nfe(t),t=j3(t),t}function ife(e){try{return rfe(e)}catch{return yc}}function Dx(e){var t=ife(e.slice(5,-1));return t===yc?"":t}var afe=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],sfe=["dx","dy","angle","className","breakAll"];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 lz(e,t){if(e==null)return{};var n,r,i=ofe(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 ofe(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 N3=/[ \f\n\r\t\v\u2028\u2029]+/,C3=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];Rn(t)||(n?i=t.toString().split(""):i=t.toString().split(N3));var s=i.map(c=>({word:c,width:jd(c,r).width})),l=n?0:jd(" ",r).width;return{wordsWithComputedWidth:s,spaceWidth:l}}catch{return null}};function _3(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function lfe(e){return Rn(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var O3=(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},[]),k3=e=>e.reduce((t,n)=>t.width>n.width?t:n),cfe="…",cz=(e,t,n,r,i,s,l,c)=>{var f=e.slice(0,t),h=C3({breakAll:n,style:r,children:f+cfe});if(!h)return[!1,[]];var m=O3(h.wordsWithComputedWidth,s,l,c),g=m.length>i||k3(m).width>Number(s);return[g,m]},ufe=(e,t,n,r,i)=>{var{maxLines:s,children:l,style:c,breakAll:f}=e,h=ze(s),m=String(l),g=O3(t,r,n,i);if(!h||i)return g;var y=g.length>s||k3(g).width>Number(r);if(!y)return g;for(var v=0,w=m.length-1,S=0,N;v<=w&&S<=m.length-1;){var C=Math.floor((v+w)/2),A=C-1,[k,_]=cz(m,A,f,c,s,r,n,i),[T]=cz(m,C,f,c,s,r,n,i);if(!k&&!T&&(v=C+1),k&&T&&(w=C-1),!k&&T){N=_;break}S++}return N||g},uz=e=>{var t=Rn(e)?[]:e.toString().split(N3);return[{words:t,width:void 0}]},dfe=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:s,maxLines:l}=e;if((t||n)&&!hf.isSsr){var c,f,h=C3({breakAll:s,children:r,style:i});if(h){var{wordsWithComputedWidth:m,spaceWidth:g}=h;c=m,f=g}else return uz(r);return ufe({breakAll:s,children:r,maxLines:l,style:i},c,f,t,!!n)}return uz(r)},A3="#808080",ffe={angle:0,breakAll:!1,capHeight:"0.71em",fill:A3,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Zj=x.forwardRef((e,t)=>{var n=Ar(e,ffe),{x:r,y:i,lineHeight:s,capHeight:l,fill:c,scaleToFit:f,textAnchor:h,verticalAnchor:m}=n,g=lz(n,afe),y=x.useMemo(()=>dfe({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:v,dy:w,angle:S,className:N,breakAll:C}=g,A=lz(g,sfe);if(!Gi(r)||!Gi(i)||y.length===0)return null;var k=Number(r)+(ze(v)?v:0),_=Number(i)+(ze(w)?w:0);if(!ct(k)||!ct(_))return null;var T;switch(m){case"start":T=Dx("calc(".concat(l,")"));break;case"middle":T=Dx("calc(".concat((y.length-1)/2," * -").concat(s," + (").concat(l," / 2))"));break;default:T=Dx("calc(".concat(y.length-1," * -").concat(s,")"));break}var P=[],E=y[0];if(f&&E!=null){var z=E.width,{width:D}=g;P.push("scale(".concat(ze(D)&&ze(z)?D/z:1,")"))}return S&&P.push("rotate(".concat(S,", ").concat(k,", ").concat(_,")")),P.length&&(A.transform=P.join(" ")),x.createElement("text",pS({},_r(A),{ref:t,x:k,y:_,className:bt("recharts-text",N),textAnchor:h,fill:c.includes("url")?A3:c}),y.map((F,U)=>{var I=F.words.join(C?"":" ");return x.createElement("tspan",{x:k,dy:U===0?T:s,key:"".concat(I,"-").concat(U)},I)}))});Zj.displayName="Text";function dz(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 zi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dz(Object(n),!0).forEach(function(r){hfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hfe(e,t,n){return(t=pfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pfe(e){var t=mfe(e,"string");return typeof t=="symbol"?t:t+""}function mfe(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 gfe=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:s,y:l,height:c,upperWidth:f,lowerWidth:h}=K1(t),m=s,g=s+(f-h)/2,y=(m+g)/2,v=(f+h)/2,w=m+f/2,S=c>=0?1:-1,N=S*r,C=S>0?"end":"start",A=S>0?"start":"end",k=f>=0?1:-1,_=k*r,T=k>0?"end":"start",P=k>0?"start":"end",E=i;if(n==="top"){var z={x:m+f/2,y:l-N,horizontalAnchor:"middle",verticalAnchor:C};return E&&(z.height=Math.max(l-E.y,0),z.width=f),z}if(n==="bottom"){var D={x:g+h/2,y:l+c+N,horizontalAnchor:"middle",verticalAnchor:A};return E&&(D.height=Math.max(E.y+E.height-(l+c),0),D.width=h),D}if(n==="left"){var F={x:y-_,y:l+c/2,horizontalAnchor:T,verticalAnchor:"middle"};return E&&(F.width=Math.max(F.x-E.x,0),F.height=c),F}if(n==="right"){var U={x:y+v+_,y:l+c/2,horizontalAnchor:P,verticalAnchor:"middle"};return E&&(U.width=Math.max(E.x+E.width-U.x,0),U.height=c),U}var I=E?{width:v,height:c}:{};return n==="insideLeft"?zi({x:y+_,y:l+c/2,horizontalAnchor:P,verticalAnchor:"middle"},I):n==="insideRight"?zi({x:y+v-_,y:l+c/2,horizontalAnchor:T,verticalAnchor:"middle"},I):n==="insideTop"?zi({x:m+f/2,y:l+N,horizontalAnchor:"middle",verticalAnchor:A},I):n==="insideBottom"?zi({x:g+h/2,y:l+c-N,horizontalAnchor:"middle",verticalAnchor:C},I):n==="insideTopLeft"?zi({x:m+_,y:l+N,horizontalAnchor:P,verticalAnchor:A},I):n==="insideTopRight"?zi({x:m+f-_,y:l+N,horizontalAnchor:T,verticalAnchor:A},I):n==="insideBottomLeft"?zi({x:g+_,y:l+c-N,horizontalAnchor:P,verticalAnchor:C},I):n==="insideBottomRight"?zi({x:g+h-_,y:l+c-N,horizontalAnchor:T,verticalAnchor:C},I):n&&typeof n=="object"&&(ze(n.x)||Go(n.x))&&(ze(n.y)||Go(n.y))?zi({x:s+Ps(n.x,v),y:l+Ps(n.y,c),horizontalAnchor:"end",verticalAnchor:"end"},I):zi({x:w,y:l+c/2,horizontalAnchor:"middle",verticalAnchor:"middle"},I)},yfe=["labelRef"],vfe=["content"];function fz(e,t){if(e==null)return{};var n,r,i=bfe(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 bfe(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 yd(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){xfe(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 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)}function ba(){return ba=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},ba.apply(null,arguments)}var E3=x.createContext(null),jfe=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(E3.Provider,{value:f},c)},T3=()=>{var e=x.useContext(E3),t=ey();return e||(t?K1(t):void 0)},Nfe=x.createContext(null),Cfe=()=>{var e=x.useContext(Nfe),t=Le(j$);return e||t},_fe=e=>{var{value:t,formatter:n}=e,r=Rn(e.children)?t:e.children;return typeof n=="function"?n(r):r},Yj=e=>e!=null&&typeof e=="function",Ofe=(e,t)=>{var n=gi(t-e),r=Math.min(Math.abs(t-e),360);return n*r},kfe=(e,t,n,r,i)=>{var{offset:s,className:l}=e,{cx:c,cy:f,innerRadius:h,outerRadius:m,startAngle:g,endAngle:y,clockWise:v}=i,w=(h+m)/2,S=Ofe(g,y),N=S>=0?1:-1,C,A;switch(t){case"insideStart":C=g+N*s,A=v;break;case"insideEnd":C=y-N*s,A=!v;break;case"end":C=y+N*s,A=v;break;default:throw new Error("Unsupported position ".concat(t))}A=S<=0?A:!A;var k=Mn(c,f,w,C),_=Mn(c,f,w,C+(A?1:-1)*359),T="M".concat(k.x,",").concat(k.y,`
267
+ A`).concat(w,",").concat(w,",0,1,").concat(A?0:1,`,
268
+ `).concat(_.x,",").concat(_.y),P=Rn(e.id)?Dd("recharts-radial-line-"):e.id;return x.createElement("text",ba({},r,{dominantBaseline:"central",className:bt("recharts-radial-bar-label",l)}),x.createElement("defs",null,x.createElement("path",{id:P,d:T})),x.createElement("textPath",{xlinkHref:"#".concat(P)},n))},Afe=(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:m,y:g}=Mn(r,i,l+t,h);return{x:m,y:g,textAnchor:m>=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 y=(s+l)/2,{x:v,y:w}=Mn(r,i,y,h);return{x:v,y:w,textAnchor:"middle",verticalAnchor:"middle"}},Bp=e=>e!=null&&"cx"in e&&ze(e.cx),Efe={angle:0,offset:5,zIndex:ur.label,position:"middle",textBreakAll:!1};function Tfe(e){if(!Bp(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 ys(e){var t=Ar(e,Efe),{viewBox:n,parentViewBox:r,position:i,value:s,children:l,content:c,className:f="",textBreakAll:h,labelRef:m}=t,g=Cfe(),y=T3(),v=i==="center"?y:g??y,w,S,N;n==null?w=v:Bp(n)?w=n:w=K1(n);var C=Tfe(w);if(!w||Rn(s)&&Rn(l)&&!x.isValidElement(c)&&typeof c!="function")return null;var A=yd(yd({},t),{},{viewBox:w});if(x.isValidElement(c)){var{labelRef:k}=A,_=fz(A,yfe);return x.cloneElement(c,_)}if(typeof c=="function"){var{content:T}=A,P=fz(A,vfe);if(S=x.createElement(c,P),x.isValidElement(S))return S}else S=_fe(t);var E=_r(t);if(Bp(w)){if(i==="insideStart"||i==="insideEnd"||i==="end")return kfe(t,i,S,E,w);N=Afe(w,t.offset,t.position)}else{if(!C)return null;var z=gfe({viewBox:C,position:i,offset:t.offset,parentViewBox:Bp(r)?void 0:r});N=yd(yd({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(Fs,{zIndex:t.zIndex},x.createElement(Zj,ba({ref:m,className:bt("recharts-label",f)},E,N,{textAnchor:_3(E.textAnchor)?E.textAnchor:N.textAnchor,breakAll:h}),S))}ys.displayName="Label";var Pfe=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?x.createElement(ys,ba({key:"label-implicit"},r)):Gi(e)?x.createElement(ys,ba({key:"label-implicit",value:e},r)):x.isValidElement(e)?e.type===ys?x.cloneElement(e,yd({key:"label-implicit"},r)):x.createElement(ys,ba({key:"label-implicit",content:e},r)):Yj(e)?x.createElement(ys,ba({key:"label-implicit",content:e},r)):e&&typeof e=="object"?x.createElement(ys,ba({},e,{key:"label-implicit"},r)):null};function zfe(e){var{label:t,labelRef:n}=e,r=T3();return Pfe(t,r,n)||null}var Mfe=["valueAccessor"],Rfe=["dataKey","clockWise","id","textBreakAll","zIndex"];function Xm(){return Xm=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},Xm.apply(null,arguments)}function pz(e,t){if(e==null)return{};var n,r,i=Dfe(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 Dfe(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 Lfe=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(lfe(t))return t},P3=x.createContext(void 0),Ife=P3.Provider,z3=x.createContext(void 0);z3.Provider;function $fe(){return x.useContext(P3)}function Ufe(){return x.useContext(z3)}function qp(e){var{valueAccessor:t=Lfe}=e,n=pz(e,Mfe),{dataKey:r,clockWise:i,id:s,textBreakAll:l,zIndex:c}=n,f=pz(n,Rfe),h=$fe(),m=Ufe(),g=h||m;return!g||!g.length?null:x.createElement(Fs,{zIndex:c??ur.label},x.createElement(Ki,{className:"recharts-label-list"},g.map((y,v)=>{var w,S=Rn(r)?t(y,v):jn(y.payload,r),N=Rn(s)?{}:{id:"".concat(s,"-").concat(v)};return x.createElement(ys,Xm({key:"label-".concat(v)},_r(y),f,N,{fill:(w=n.fill)!==null&&w!==void 0?w:y.fill,parentViewBox:y.parentViewBox,value:S,textBreakAll:l,viewBox:y.viewBox,index:v,zIndex:0}))})))}qp.displayName="LabelList";function Bfe(e){var{label:t}=e;return t?t===!0?x.createElement(qp,{key:"labelList-implicit"}):x.isValidElement(t)||Yj(t)?x.createElement(qp,{key:"labelList-implicit",content:t}):typeof t=="object"?x.createElement(qp,Xm({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}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)}var M3=e=>{var{cx:t,cy:n,r,className:i}=e,s=bt("recharts-dot",i);return ze(t)&&ze(n)&&ze(r)?x.createElement("circle",mS({},Fi(e),M1(e),{className:s,cx:t,cy:n,r})):null},qfe={radiusAxis:{},angleAxis:{}},R3=Fn({name:"polarAxis",initialState:qfe,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:yye,removeRadiusAxis:vye,addAngleAxis:bye,removeAngleAxis:xye}=R3.actions,Ffe=R3.reducer;function Kfe(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var D3=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function Hfe(e){var{tooltipEntrySettings:t}=e,n=Qt(),r=Er(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(Sce(t)):i.current!==t&&n(jce({prev:i.current,next:t})),i.current=t)},[t,n,r]),x.useLayoutEffect(()=>()=>{i.current&&(n(Nce(i.current)),i.current=null)},[n]),null}function Gfe(e){var{legendPayload:t}=e,n=Qt(),r=Er(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(are(t)):i.current!==t&&n(sre({prev:i.current,next:t})),i.current=t)},[n,r,t]),x.useLayoutEffect(()=>()=>{i.current&&(n(ore(i.current)),i.current=null)},[n]),null}var Lx,Vfe=()=>{var[e]=x.useState(()=>Dd("uid-"));return e},Zfe=(Lx=rg.useId)!==null&&Lx!==void 0?Lx:Vfe;function Yfe(e,t){var n=Zfe();return t||(e?"".concat(e,"-").concat(n):n)}var Wfe=x.createContext(void 0),Qfe=e=>{var{id:t,type:n,children:r}=e,i=Yfe("recharts-".concat(n),t);return x.createElement(Wfe.Provider,{value:i},r(i))},Xfe={cartesianItems:[],polarItems:[]},L3=Fn({name:"graphicalItems",initialState:Xfe,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:Tt()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Zr(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:Tt()},removeCartesianGraphicalItem:{reducer(e,t){var n=Zr(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:Tt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:Tt()},removePolarGraphicalItem:{reducer(e,t){var n=Zr(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:Tt()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Zr(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:Tt()}}}),{addCartesianGraphicalItem:Jfe,replaceCartesianGraphicalItem:ehe,removeCartesianGraphicalItem:the,addPolarGraphicalItem:wye,removePolarGraphicalItem:Sye,replacePolarGraphicalItem:jye}=L3.actions,nhe=L3.reducer,rhe=e=>{var t=Qt(),n=x.useRef(null);return x.useLayoutEffect(()=>{n.current===null?t(Jfe(e)):n.current!==e&&t(ehe({prev:n.current,next:e})),n.current=e},[t,e]),x.useLayoutEffect(()=>()=>{n.current&&(t(the(n.current)),n.current=null)},[t]),null},ihe=x.memo(rhe),ahe=["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 Ix(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){she(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 she(e,t,n){return(t=ohe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ohe(e){var t=lhe(e,"string");return typeof t=="symbol"?t:t+""}function lhe(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 Jm(){return Jm=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},Jm.apply(null,arguments)}function che(e,t){if(e==null)return{};var n,r,i=uhe(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 uhe(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 dhe(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=bt(r,typeof t!="boolean"?t.className:""),s=n??{},{points:l}=s,c=che(s,ahe);return x.createElement(M3,Jm({},c,{className:i}))}function fhe(e,t){return e==null?!1:t?!0:e.length===1}function hhe(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:s,baseProps:l,needClip:c,clipPathId:f,zIndex:h=ur.scatter}=e;if(!fhe(t,n))return null;var m=D3(n),g=HX(n),y=t.map((w,S)=>{var N,C,A=Ix(Ix(Ix({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(dhe,{key:"dot-".concat(S),option:n,dotProps:A,className:i})}),v={};return c&&f!=null&&(v.clipPath="url(#clipPath-".concat(m?"":"dots-").concat(f,")")),x.createElement(Fs,{zIndex:h},x.createElement(Ki,Jm({className:r},v),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 yz(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){phe(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 phe(e,t,n){return(t=mhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mhe(e){var t=ghe(e,"string");return typeof t=="symbol"?t:t+""}function ghe(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 I3=0,yhe={xAxis:{},yAxis:{},zAxis:{}},$3=Fn({name:"cartesianAxis",initialState:yhe,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:Tt()},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:Tt()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:Tt()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:Tt()},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:Tt()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:Tt()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:Tt()},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:Tt()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:Tt()},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]=yz(yz({},i),{},{width:r,widthHistory:c})}}}}),{addXAxis:vhe,replaceXAxis:bhe,removeXAxis:xhe,addYAxis:whe,replaceYAxis:She,removeYAxis:jhe,addZAxis:Nye,replaceZAxis:Cye,removeZAxis:_ye,updateYAxisWidth:Nhe}=$3.actions,Che=$3.reducer,_he=ne([Ln],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),Ohe=ne([_he,Ea,Ta],(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)}}),Wj=()=>Le(Ohe),khe=()=>Le(Sue);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 $x(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){Ahe(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 Ahe(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)}var Phe=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=$x($x($x({},c),Rg(i)),M1(i)),h;return x.isValidElement(i)?h=x.cloneElement(i,f):typeof i=="function"?h=i(f):h=x.createElement(M3,f),x.createElement(Ki,{className:"recharts-active-dot",clipPath:l},h)};function bz(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:s,zIndex:l=ur.activeDot}=e,c=Le(Yd),f=khe();if(t==null||f==null)return null;var h=t.find(m=>f.includes(m.payload));return Rn(h)?null:x.createElement(Fs,{zIndex:l},x.createElement(Phe,{point:h,childIndex:Number(c),mainColor:n,dataKey:i,activeDot:r,clipPath:s}))}var zhe=e=>{var{chartData:t}=e,n=Qt(),r=Er();return x.useEffect(()=>r?()=>{}:(n(WP(t)),()=>{n(WP(void 0))}),[t,n,r]),null},xz={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},U3=Fn({name:"brush",initialState:xz,reducers:{setBrushSettings(e,t){return t.payload==null?xz:t.payload}}}),{setBrushSettings:Oye}=U3.actions,Mhe=U3.reducer;function Rhe(e){return(e%180+180)%180}var Dhe=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=Rhe(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)},Lhe={dots:[],areas:[],lines:[]},B3=Fn({name:"referenceElements",initialState:Lhe,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=Zr(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=Zr(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=Zr(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:kye,removeDot:Aye,addArea:Eye,removeArea:Tye,addLine:Pye,removeLine:zye}=B3.actions,Ihe=B3.reducer,$he=x.createContext(void 0),Uhe=e=>{var{children:t}=e,[n]=x.useState("".concat(Dd("recharts"),"-clip")),r=Wj();if(r==null)return null;var{x:i,y:s,width:l,height:c}=r;return x.createElement($he.Provider,{value:n},x.createElement("defs",null,x.createElement("clipPath",{id:n},x.createElement("rect",{x:i,y:s,height:c,width:l}))),t)};function q3(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 Bhe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Dhe(r,n)}function qhe(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 Qd(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 Fhe(e,t){return q3(e,t+1)}function Khe(e,t,n,r,i){for(var s=(r||[]).slice(),{start:l,end:c}=t,f=0,h=1,m=l,g=function(){var w=r?.[f];if(w===void 0)return{v:q3(r,h)};var S=f,N,C=()=>(N===void 0&&(N=n(w,S)),N),A=w.coordinate,k=f===0||Qd(e,A,C,m,c);k||(f=0,m=l,h+=1),k&&(m=A+e*(C()/2+i),f+=h)},y;h<=s.length;)if(y=g(),y)return y.v;return[]}function Hhe(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 m=(l-1)%h,g=c,y=!0,v=function(){var _=r[S];if(_==null)return 0;var T=S,P,E=()=>(P===void 0&&(P=n(_,T)),P),z=_.coordinate,D=S===m||Qd(e,z,E,g,f);if(!D)return y=!1,1;D&&(g=z+e*(E()/2+i))},w,S=m;S<l&&(w=v(),!(w!==0&&w===1));S+=h);if(y){for(var N=[],C=m;C<l;C+=h){var A=r[C];A!=null&&N.push(A)}return N}}return[]}function wz(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 Un(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wz(Object(n),!0).forEach(function(r){Ghe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ghe(e,t,n){return(t=Vhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vhe(e){var t=Zhe(e,"string");return typeof t=="symbol"?t:t+""}function Zhe(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 Yhe(e,t,n,r,i){for(var s=(r||[]).slice(),l=s.length,{start:c}=t,{end:f}=t,h=function(y){var v=s[y];if(v==null)return 1;var w=v,S,N=()=>(S===void 0&&(S=n(v,y)),S);if(y===l-1){var C=e*(w.coordinate+e*N()/2-f);s[y]=w=Un(Un({},w),{},{tickCoord:C>0?w.coordinate-C*e:w.coordinate})}else s[y]=w=Un(Un({},w),{},{tickCoord:w.coordinate});if(w.tickCoord!=null){var A=Qd(e,w.tickCoord,N,c,f);A&&(f=w.tickCoord-e*(N()/2+i),s[y]=Un(Un({},w),{},{isShow:!0}))}},m=l-1;m>=0;m--)h(m);return s}function Whe(e,t,n,r,i,s){var l=(r||[]).slice(),c=l.length,{start:f,end:h}=t;if(s){var m=r[c-1];if(m!=null){var g=n(m,c-1),y=e*(m.coordinate+e*g/2-h);if(l[c-1]=m=Un(Un({},m),{},{tickCoord:y>0?m.coordinate-y*e:m.coordinate}),m.tickCoord!=null){var v=Qd(e,m.tickCoord,()=>g,f,h);v&&(h=m.tickCoord-e*(g/2+i),l[c-1]=Un(Un({},m),{},{isShow:!0}))}}}for(var w=s?c-1:c,S=function(A){var k=l[A];if(k==null)return 1;var _=k,T,P=()=>(T===void 0&&(T=n(k,A)),T);if(A===0){var E=e*(_.coordinate-e*P()/2-f);l[A]=_=Un(Un({},_),{},{tickCoord:E<0?_.coordinate-E*e:_.coordinate})}else l[A]=_=Un(Un({},_),{},{tickCoord:_.coordinate});if(_.tickCoord!=null){var z=Qd(e,_.tickCoord,P,f,h);z&&(f=_.tickCoord+e*(P()/2+i),l[A]=Un(Un({},_),{},{isShow:!0}))}},N=0;N<w;N++)S(N);return l}function Qhe(e,t,n){var{tick:r,ticks:i,viewBox:s,minTickGap:l,orientation:c,interval:f,tickFormatter:h,unit:m,angle:g}=e;if(!i||!i.length||!r)return[];if(ze(f)||hf.isSsr){var y;return(y=Fhe(i,ze(f)?f:0))!==null&&y!==void 0?y:[]}var v=[],w=c==="top"||c==="bottom"?"width":"height",S=m&&w==="width"?jd(m,{fontSize:t,letterSpacing:n}):{width:0,height:0},N=(T,P)=>{var E=typeof h=="function"?h(T.value,P):T.value;return w==="width"?Bhe(jd(E,{fontSize:t,letterSpacing:n}),S,g):jd(E,{fontSize:t,letterSpacing:n})[w]},C=i[0],A=i[1],k=i.length>=2&&C!=null&&A!=null?gi(A.coordinate-C.coordinate):1,_=qhe(s,k,w);return f==="equidistantPreserveStart"?Khe(k,_,N,i,l):f==="equidistantPreserveEnd"?Hhe(k,_,N,i,l):(f==="preserveStart"||f==="preserveStartEnd"?v=Whe(k,_,N,i,l,f==="preserveStartEnd"):v=Yhe(k,_,N,i,l),v.filter(T=>T.isShow))}var Xhe=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:s=0}=e,l=0;if(t){Array.from(t).forEach(m=>{if(m){var g=m.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},Jhe={xAxis:{},yAxis:{}},F3=Fn({name:"renderedTicks",initialState:Jhe,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:epe,removeRenderedTicks:tpe}=F3.actions,npe=F3.reducer,rpe=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function ipe(e,t){if(e==null)return{};var n,r,i=ape(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 ape(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 Xo(){return Xo=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},Xo.apply(null,arguments)}function Sz(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 Yt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Sz(Object(n),!0).forEach(function(r){spe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sz(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 Io={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:ur.axis};function cpe(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=Yt(Yt(Yt({},f),Fi(c)),{},{fill:"none"});if(s==="top"||s==="bottom"){var m=+(s==="top"&&!l||s==="bottom"&&l);h=Yt(Yt({},h),{},{x1:t,y1:n+m*i,x2:t+r,y2:n+m*i})}else{var g=+(s==="left"&&!l||s==="right"&&l);h=Yt(Yt({},h),{},{x1:t+g*r,y1:n,x2:t+g*r,y2:n+i})}return x.createElement("line",Xo({},h,{className:bt("recharts-cartesian-axis-line",$g(c,"className"))}))}function upe(e,t,n,r,i,s,l,c,f){var h,m,g,y,v,w,S=c?-1:1,N=e.tickSize||l,C=ze(e.tickCoord)?e.tickCoord:e.coordinate;switch(s){case"top":h=m=e.coordinate,y=n+ +!c*i,g=y-S*N,w=g-S*f,v=C;break;case"left":g=y=e.coordinate,m=t+ +!c*r,h=m-S*N,v=h-S*f,w=C;break;case"right":g=y=e.coordinate,m=t+ +c*r,h=m+S*N,v=h+S*f,w=C;break;default:h=m=e.coordinate,y=n+ +c*i,g=y+S*N,w=g+S*f,v=C;break}return{line:{x1:h,y1:g,x2:m,y2:y},tick:{x:v,y:w}}}function dpe(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function fpe(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function hpe(e){var{option:t,tickProps:n,value:r}=e,i,s=bt(n.className,"recharts-cartesian-axis-tick-value");if(x.isValidElement(t))i=x.cloneElement(t,Yt(Yt({},n),{},{className:s}));else if(typeof t=="function")i=t(Yt(Yt({},n),{},{className:s}));else{var l="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(l=bt(l,Kfe(t))),i=x.createElement(Zj,Xo({},n,{className:l}),r)}return i}function ppe(e){var{ticks:t,axisType:n,axisId:r}=e,i=Qt();return x.useEffect(()=>{if(r==null||n==null)return Yc;var s=t.map(l=>({value:l.value,coordinate:l.coordinate,offset:l.offset,index:l.index}));return i(epe({ticks:s,axisId:r,axisType:n})),()=>{i(tpe({axisId:r,axisType:n}))}},[i,t,r,n]),null}var mpe=x.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:s,tickFormatter:l,unit:c,padding:f,tickTextProps:h,orientation:m,mirror:g,x:y,y:v,width:w,height:S,tickSize:N,tickMargin:C,fontSize:A,letterSpacing:k,getTicksConfig:_,events:T,axisType:P,axisId:E}=e,z=Qhe(Yt(Yt({},_),{},{ticks:n}),A,k),D=Fi(_),F=Rg(r),U=_3(D.textAnchor)?D.textAnchor:dpe(m,g),I=fpe(m,g),ae={};typeof i=="object"&&(ae=i);var ve=Yt(Yt({},D),{},{fill:"none"},ae),me=z.map(ge=>Yt({entry:ge},upe(ge,y,v,w,S,m,N,g,C))),G=me.map(ge=>{var{entry:Se,line:B}=ge;return x.createElement(Ki,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(Se.value,"-").concat(Se.coordinate,"-").concat(Se.tickCoord)},i&&x.createElement("line",Xo({},ve,B,{className:bt("recharts-cartesian-axis-tick-line",$g(i,"className"))})))}),re=me.map((ge,Se)=>{var B,R,{entry:H,tick:oe}=ge,Q=Yt(Yt(Yt(Yt({verticalAnchor:I},D),{},{textAnchor:U,stroke:"none",fill:s},oe),{},{index:Se,payload:H,visibleTicksCount:z.length,tickFormatter:l,padding:f},h),{},{angle:(B=(R=h?.angle)!==null&&R!==void 0?R:D.angle)!==null&&B!==void 0?B:0}),X=Yt(Yt({},Q),F);return x.createElement(Ki,Xo({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(H.value,"-").concat(H.coordinate,"-").concat(H.tickCoord)},UL(T,H,Se)),r&&x.createElement(hpe,{option:r,tickProps:X,value:"".concat(typeof l=="function"?l(H.value,Se):H.value).concat(c||"")}))});return x.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(P,"-ticks")},x.createElement(ppe,{ticks:z,axisId:E,axisType:P}),re.length>0&&x.createElement(Fs,{zIndex:ur.label},x.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(P,"-tick-labels"),ref:t},re)),G.length>0&&x.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(P,"-tick-lines")},G))}),gpe=x.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:s,hide:l,ticks:c,axisType:f,axisId:h}=e,m=ipe(e,rpe),[g,y]=x.useState(""),[v,w]=x.useState(""),S=x.useRef(null);x.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var C;return Xhe({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 A=C.getElementsByClassName("recharts-cartesian-axis-tick-value");S.current=A;var k=A[0];if(k){var _=window.getComputedStyle(k),T=_.fontSize,P=_.letterSpacing;(T!==g||P!==v)&&(y(T),w(P))}}},[g,v]);return l||r!=null&&r<=0||i!=null&&i<=0?null:x.createElement(Fs,{zIndex:e.zIndex},x.createElement(Ki,{className:bt("recharts-cartesian-axis",s)},x.createElement(cpe,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Fi(e)}),x.createElement(mpe,{ref:N,axisType:f,events:m,fontSize:g,getTicksConfig:e,height:e.height,letterSpacing:v,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(jfe,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},x.createElement(zfe,{label:e.label,labelRef:e.labelRef}),e.children)))}),Qj=x.forwardRef((e,t)=>{var n=Ar(e,Io);return x.createElement(gpe,Xo({},n,{ref:t}))});Qj.displayName="CartesianAxis";var ype={},K3=Fn({name:"errorBars",initialState:ype,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:Mye,replaceErrorBar:Rye,removeErrorBar:Dye}=K3.actions,vpe=K3.reducer;function H3(e,t){var n,r,i=Le(h=>za(h,e)),s=Le(h=>Ma(h,t)),l=(n=i?.allowDataOverflow)!==null&&n!==void 0?n:mn.allowDataOverflow,c=(r=s?.allowDataOverflow)!==null&&r!==void 0?r:gn.allowDataOverflow,f=l||c;return{needClip:f,needClipX:l,needClipY:c}}function bpe(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=Wj(),{needClipX:s,needClipY:l,needClip:c}=H3(t,n);if(!c||!i)return null;var{x:f,y:h,width:m,height:g}=i;return x.createElement("clipPath",{id:"clipPath-".concat(r)},x.createElement("rect",{x:s?f:f-m/2,y:l?h:h-g/2,width:s?m:m*2,height:l?g:g*2}))}function xpe(e){var t=Rg(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 Xj(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:I3}function Jj(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:I3}var G3=(e,t,n)=>K5(e,"xAxis",Xj(e,t),n),V3=(e,t,n)=>F5(e,"xAxis",Xj(e,t),n),Z3=(e,t,n)=>K5(e,"yAxis",Jj(e,t),n),Y3=(e,t,n)=>F5(e,"yAxis",Jj(e,t),n),wpe=ne([Ut,G3,Z3,V3,Y3],(e,t,n,r,i)=>Yi(e,"xAxis")?Om(t,r,!1):Om(n,i,!1)),Spe=(e,t)=>t,W3=ne([d5,Spe],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),Q3=e=>{var t=Ut(e),n=Yi(t,"xAxis");return n?"yAxis":"xAxis"},jpe=(e,t)=>{var n=Q3(e);return n==="yAxis"?Jj(e,t):Xj(e,t)},Npe=(e,t,n)=>w5(e,Q3(e),jpe(e,t),n),Cpe=ne([W3,Npe],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=ij(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]])}}}),_pe=ne([Ut,G3,Z3,V3,Y3,Cpe,vae,wpe,W3,Oae],(e,t,n,r,i,s,l,c,f,h)=>{var{chartData:m,dataStartIndex:g,dataEndIndex:y}=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:v}=f,w;if(v&&v.length>0?w=v:w=m?.slice(g,y+1),w!=null)return Gpe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:g,areaSettings:f,stackedData:s,displayedData:w,chartBaseValue:h,bandSize:c})}}),Ope=["id"],kpe=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function $o(){return $o=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},$o.apply(null,arguments)}function X3(e,t){if(e==null)return{};var n,r,i=Ape(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 Ape(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 jz(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 vc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jz(Object(n),!0).forEach(function(r){Epe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Epe(e,t,n){return(t=Tpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tpe(e){var t=Ppe(e,"string");return typeof t=="symbol"?t:t+""}function Ppe(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 eg(e,t){return e&&e!=="none"?e:t}var zpe=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:s,hide:l}=e;return[{inactive:l,dataKey:t,type:s,color:eg(r,i),value:zI(n,t),payload:e}]},Mpe=x.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:s,name:l,hide:c,unit:f,tooltipType:h,id:m}=e,g={dataDefinedOnItem:n,getPosition:Yc,settings:{stroke:r,strokeWidth:i,fill:s,dataKey:t,nameKey:void 0,name:zI(l,t),hide:c,type:h,color:eg(r,s),unit:f,graphicalItemId:m}};return x.createElement(Hfe,{tooltipEntrySettings:g})});function Rpe(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:s,dataKey:l}=r,c=Fi(r);return x.createElement(hhe,{points:n,dot:s,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:l,baseProps:c,needClip:i,clipPathId:t})}function Dpe(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 vc(vc({},f),{},{value:s.value,payload:s.payload,parentViewBox:void 0,viewBox:f,fill:void 0})});return x.createElement(Ife,{value:t?i:void 0},n)}function Nz(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:s}=e,{layout:l,type:c,stroke:f,connectNulls:h,isRange:m}=s,{id:g}=s,y=X3(s,Ope),v=Fi(y),w=_r(y);return x.createElement(x.Fragment,null,t?.length>1&&x.createElement(Ki,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},x.createElement(Up,$o({},w,{id:g,points:t,connectNulls:h,type:c,baseLine:n,layout:l,stroke:"none",className:"recharts-area-area"})),f!=="none"&&x.createElement(Up,$o({},v,{className:"recharts-area-curve",layout:l,type:c,connectNulls:h,fill:"none",points:t})),f!=="none"&&m&&Array.isArray(n)&&x.createElement(Up,$o({},v,{className:"recharts-area-curve",layout:l,type:c,connectNulls:h,fill:"none",points:n}))),x.createElement(Rpe,{points:t,props:y,clipPathId:i}))}function Lpe(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(!ct(c)||!ct(f))return null;var h=r*Math.abs(c-f),m=Math.max(...s.map(g=>g.x||0));return ze(i)?m=Math.max(i,m):i&&Array.isArray(i)&&i.length&&(m=Math.max(...i.map(g=>g.x||0),m)),ze(m)?x.createElement("rect",{x:0,y:c<f?c:c-h,width:m+(l?parseInt("".concat(l),10):1),height:Math.floor(h)}):null}function Ipe(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(!ct(c)||!ct(f))return null;var h=r*Math.abs(c-f),m=Math.max(...s.map(g=>g.y||0));return ze(i)?m=Math.max(i,m):i&&Array.isArray(i)&&i.length&&(m=Math.max(...i.map(g=>g.y||0),m)),ze(m)?x.createElement("rect",{x:c<f?c:c-h,y:0,width:h,height:Math.floor(m+(l?parseInt("".concat(l),10):1))}):null}function $pe(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:s}=e;return n==="vertical"?x.createElement(Lpe,{alpha:t,points:r,baseLine:i,strokeWidth:s}):x.createElement(Ipe,{alpha:t,points:r,baseLine:i,strokeWidth:s})}function Upe(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:s}=e,{points:l,baseLine:c,isAnimationActive:f,animationBegin:h,animationDuration:m,animationEasing:g,onAnimationStart:y,onAnimationEnd:v}=r,w=x.useMemo(()=>({points:l,baseLine:c}),[l,c]),S=n$(w,"recharts-area-"),N=H1(),[C,A]=x.useState(!1),k=!C,_=x.useCallback(()=>{typeof v=="function"&&v(),A(!1)},[v]),T=x.useCallback(()=>{typeof y=="function"&&y(),A(!0)},[y]);if(N==null)return null;var P=i.current,E=s.current;return x.createElement(Dpe,{showLabels:k,points:l},r.children,x.createElement(t$,{animationId:S,begin:h,duration:m,isActive:f,easing:g,onAnimationEnd:_,onAnimationStart:T,key:S},z=>{if(P){var D=P.length/l.length,F=z===1?l:l.map((I,ae)=>{var ve=Math.floor(ae*D);if(P[ve]){var me=P[ve];return vc(vc({},I),{},{x:Ri(me.x,I.x,z),y:Ri(me.y,I.y,z)})}return I}),U;return ze(c)?U=Ri(E,c,z):Rn(c)||Hi(c)?U=Ri(E,0,z):U=c.map((I,ae)=>{var ve=Math.floor(ae*D);if(Array.isArray(E)&&E[ve]){var me=E[ve];return vc(vc({},I),{},{x:Ri(me.x,I.x,z),y:Ri(me.y,I.y,z)})}return I}),z>0&&(i.current=F,s.current=U),x.createElement(Nz,{points:F,baseLine:U,needClip:t,clipPathId:n,props:r})}return z>0&&(i.current=l,s.current=c),x.createElement(Ki,null,f&&x.createElement("defs",null,x.createElement("clipPath",{id:"animationClipPath-".concat(n)},x.createElement($pe,{alpha:z,points:l,baseLine:c,layout:N,strokeWidth:r.strokeWidth}))),x.createElement(Ki,{clipPath:"url(#animationClipPath-".concat(n,")")},x.createElement(Nz,{points:l,baseLine:c,needClip:t,clipPathId:n,props:r})))}),x.createElement(Bfe,{label:r.label}))}function Bpe(e){var{needClip:t,clipPathId:n,props:r}=e,i=x.useRef(null),s=x.useRef();return x.createElement(Upe,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:s})}class qpe extends x.PureComponent{render(){var{hide:t,dot:n,points:r,className:i,top:s,left:l,needClip:c,xAxisId:f,yAxisId:h,width:m,height:g,id:y,baseLine:v,zIndex:w}=this.props;if(t)return null;var S=bt("recharts-area",i),N=y,{r:C,strokeWidth:A}=xpe(n),k=D3(n),_=C*2+A,T=c?"url(#clipPath-".concat(k?"":"dots-").concat(N,")"):void 0;return x.createElement(Fs,{zIndex:w},x.createElement(Ki,{className:S},c&&x.createElement("defs",null,x.createElement(bpe,{clipPathId:N,xAxisId:f,yAxisId:h}),!k&&x.createElement("clipPath",{id:"clipPath-dots-".concat(N)},x.createElement("rect",{x:l-_/2,y:s-_/2,width:m+_,height:g+_}))),x.createElement(Bpe,{needClip:c,clipPathId:N,props:this.props})),x.createElement(bz,{points:r,mainColor:eg(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:T}),this.props.isRange&&Array.isArray(v)&&x.createElement(bz,{points:v,mainColor:eg(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:T}))}}var Fpe={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:ur.area};function Kpe(e){var t,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:s,connectNulls:l,dot:c,fill:f,fillOpacity:h,hide:m,isAnimationActive:g,legendType:y,stroke:v,xAxisId:w,yAxisId:S}=e,N=X3(e,kpe),C=Wc(),A=h3(),{needClip:k}=H3(w,S),_=Er(),{points:T,isRange:P,baseLine:E}=(t=Le(ae=>_pe(ae,e.id,_)))!==null&&t!==void 0?t:{},z=Wj();if(C!=="horizontal"&&C!=="vertical"||z==null||A!=="AreaChart"&&A!=="ComposedChart")return null;var{height:D,width:F,x:U,y:I}=z;return!T||!T.length?null:x.createElement(qpe,$o({},N,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:s,baseLine:E,connectNulls:l,dot:c,fill:f,fillOpacity:h,height:D,hide:m,layout:C,isAnimationActive:g,isRange:P,legendType:y,needClip:k,points:T,stroke:v,width:F,left:U,top:I,xAxisId:w,yAxisId:S}))}var Hpe=(e,t,n,r,i)=>{var s=n??t;if(ze(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 Gpe(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:s,chartBaseValue:l,xAxis:c,yAxis:f,displayedData:h,dataStartIndex:m,xAxisTicks:g,yAxisTicks:y,bandSize:v}=e,w=i&&i.length,S=Hpe(s,l,n,c,f),N=s==="horizontal",C=!1,A=h.map((_,T)=>{var P,E,z,D;if(w)D=i[m+T];else{var F=jn(_,r);Array.isArray(F)?(D=F,C=!0):D=[S,F]}var U=(P=(E=D)===null||E===void 0?void 0:E[1])!==null&&P!==void 0?P:null,I=U==null||w&&!t&&jn(_,r)==null;if(N){var ae;return{x:TT({axis:c,ticks:g,bandSize:v,entry:_,index:T}),y:I?null:(ae=f.scale.map(U))!==null&&ae!==void 0?ae:null,value:D,payload:_}}return{x:I?null:(z=c.scale.map(U))!==null&&z!==void 0?z:null,y:TT({axis:f,ticks:y,bandSize:v,entry:_,index:T}),value:D,payload:_}}),k;return w||C?k=A.map(_=>{var T,P=Array.isArray(_.value)?_.value[0]:null;if(N){var E;return{x:_.x,y:P!=null&&_.y!=null&&(E=f.scale.map(P))!==null&&E!==void 0?E:null,payload:_.payload}}return{x:P!=null&&(T=c.scale.map(P))!==null&&T!==void 0?T:null,y:_.y,payload:_.payload}}):k=N?f.scale.map(S):c.scale.map(S),{points:A,baseLine:k??0,isRange:C}}function Vpe(e){var t=Ar(e,Fpe),n=Er();return x.createElement(Qfe,{id:t.id,type:"area"},r=>x.createElement(x.Fragment,null,x.createElement(Gfe,{legendPayload:zpe(t)}),x.createElement(Mpe,{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(ihe,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:ane(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),x.createElement(Kpe,$o({},t,{id:r}))))}var gS=x.memo(Vpe,ff);gS.displayName="Area";var Zpe=["domain","range"],Ype=["domain","range"];function Cz(e,t){if(e==null)return{};var n,r,i=Wpe(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 Wpe(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 _z(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 J3(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=Cz(e,Zpe),{domain:s,range:l}=t,c=Cz(t,Ype);return!_z(n,s)||!_z(r,l)?!1:ff(i,c)}var Qpe=["type"],Xpe=["dangerouslySetInnerHTML","ticks","scale"],Jpe=["id","scale"];function yS(){return yS=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},yS.apply(null,arguments)}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 kz(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){eme(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 eme(e,t,n){return(t=tme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tme(e){var t=nme(e,"string");return typeof t=="symbol"?t:t+""}function nme(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 vS(e,t){if(e==null)return{};var n,r,i=rme(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 rme(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 ime(e){var t=Qt(),n=x.useRef(null),r=H1(),{type:i}=e,s=vS(e,Qpe),l=oy(r,"xAxis",i),c=x.useMemo(()=>{if(l!=null)return kz(kz({},s),{},{type:l})},[s,l]);return x.useLayoutEffect(()=>{c!=null&&(n.current===null?t(vhe(c)):n.current!==c&&t(bhe({prev:n.current,next:c})),n.current=c)},[c,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(xhe(n.current)),n.current=null)},[t]),null}var ame=e=>{var{xAxisId:t,className:n}=e,r=Le(RI),i=Er(),s="xAxis",l=Le(C=>q5(C,s,t,i)),c=Le(C=>rce(C,t)),f=Le(C=>cce(C,t)),h=Le(C=>o5(C,t));if(c==null||f==null||h==null)return null;var{dangerouslySetInnerHTML:m,ticks:g,scale:y}=e,v=vS(e,Xpe),{id:w,scale:S}=h,N=vS(h,Jpe);return x.createElement(Qj,yS({},v,N,{x:f.x,y:f.y,width:c.width,height:c.height,className:bt("recharts-".concat(s," ").concat(s),n),viewBox:r,ticks:l,axisType:s,axisId:t}))},sme={allowDataOverflow:mn.allowDataOverflow,allowDecimals:mn.allowDecimals,allowDuplicatedCategory:mn.allowDuplicatedCategory,angle:mn.angle,axisLine:Io.axisLine,height:mn.height,hide:!1,includeHidden:mn.includeHidden,interval:mn.interval,label:!1,minTickGap:mn.minTickGap,mirror:mn.mirror,orientation:mn.orientation,padding:mn.padding,reversed:mn.reversed,scale:mn.scale,tick:mn.tick,tickCount:mn.tickCount,tickLine:Io.tickLine,tickSize:Io.tickSize,type:mn.type,niceTicks:mn.niceTicks,xAxisId:0},ome=e=>{var t=Ar(e,sme);return x.createElement(x.Fragment,null,x.createElement(ime,{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(ame,t))},e4=x.memo(ome,J3);e4.displayName="XAxis";var lme=["type"],cme=["dangerouslySetInnerHTML","ticks","scale"],ume=["id","scale"];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 Az(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 Ez(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Az(Object(n),!0).forEach(function(r){dme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Az(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dme(e,t,n){return(t=fme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fme(e){var t=hme(e,"string");return typeof t=="symbol"?t:t+""}function hme(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 xS(e,t){if(e==null)return{};var n,r,i=pme(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 pme(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 mme(e){var t=Qt(),n=x.useRef(null),r=H1(),{type:i}=e,s=xS(e,lme),l=oy(r,"yAxis",i),c=x.useMemo(()=>{if(l!=null)return Ez(Ez({},s),{},{type:l})},[l,s]);return x.useLayoutEffect(()=>{c!=null&&(n.current===null?t(whe(c)):n.current!==c&&t(She({prev:n.current,next:c})),n.current=c)},[c,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(jhe(n.current)),n.current=null)},[t]),null}function gme(e){var{yAxisId:t,className:n,width:r,label:i}=e,s=x.useRef(null),l=x.useRef(null),c=Le(RI),f=Er(),h=Qt(),m="yAxis",g=Le(P=>fce(P,t)),y=Le(P=>dce(P,t)),v=Le(P=>q5(P,m,t,f)),w=Le(P=>l5(P,t));if(x.useLayoutEffect(()=>{if(!(r!=="auto"||!g||Yj(i)||x.isValidElement(i)||w==null)){var P=s.current;if(P){var E=P.getCalculatedWidth();Math.round(g.width)!==Math.round(E)&&h(Nhe({id:t,width:E}))}}},[v,g,h,i,t,r,w]),g==null||y==null||w==null)return null;var{dangerouslySetInnerHTML:S,ticks:N,scale:C}=e,A=xS(e,cme),{id:k,scale:_}=w,T=xS(w,ume);return x.createElement(Qj,bS({},A,T,{ref:s,labelRef:l,x:y.x,y:y.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:g.width,height:g.height,className:bt("recharts-".concat(m," ").concat(m),n),viewBox:c,ticks:v,axisType:m,axisId:t}))}var yme={allowDataOverflow:gn.allowDataOverflow,allowDecimals:gn.allowDecimals,allowDuplicatedCategory:gn.allowDuplicatedCategory,angle:gn.angle,axisLine:Io.axisLine,hide:!1,includeHidden:gn.includeHidden,interval:gn.interval,label:!1,minTickGap:gn.minTickGap,mirror:gn.mirror,orientation:gn.orientation,padding:gn.padding,reversed:gn.reversed,scale:gn.scale,tick:gn.tick,tickCount:gn.tickCount,tickLine:Io.tickLine,tickSize:Io.tickSize,type:gn.type,niceTicks:gn.niceTicks,width:gn.width,yAxisId:0},vme=e=>{var t=Ar(e,yme);return x.createElement(x.Fragment,null,x.createElement(mme,{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(gme,t))},t4=x.memo(vme,J3);t4.displayName="YAxis";var bme=(e,t)=>t,eN=ne([bme,Ut,j$,Cn,o3,Ra,Mue,Ln],Bue);function xme(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function tN(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(xme(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 n4=Or("mouseClick"),r4=lf();r4.startListening({actionCreator:n4,effect:(e,t)=>{var n=e.payload,r=eN(t.getState(),tN(n));r?.activeIndex!=null&&t.dispatch(Oce({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var wS=Or("mouseMove"),i4=lf(),sc=null,po=null,Ux=null;i4.startListening({actionCreator:wS,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:s}=r.eventSettings,l=s==="all"||s?.includes("mousemove");sc!==null&&(cancelAnimationFrame(sc),sc=null),po!==null&&(typeof i!="number"||!l)&&(clearTimeout(po),po=null),Ux=tN(n);var c=()=>{var f=t.getState(),h=wf(f,f.tooltip.settings.shared);if(!Ux){sc=null,po=null;return}if(h==="axis"){var m=eN(f,Ux);m?.activeIndex!=null?t.dispatch(Q5({activeIndex:m.activeIndex,activeDataKey:void 0,activeCoordinate:m.activeCoordinate})):t.dispatch(W5())}sc=null,po=null};if(!l){c();return}i==="raf"?sc=requestAnimationFrame(c):typeof i=="number"&&po===null&&(po=setTimeout(c,i))}});function wme(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 Tz={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},a4=Fn({name:"rootProps",initialState:Tz,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:Tz.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}}}),Sme=a4.reducer,{updateOptions:jme}=a4.actions,Nme=null,Cme={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)},s4=Fn({name:"polarOptions",initialState:Nme,reducers:Cme}),{updatePolarOptions:Lye}=s4.actions,_me=s4.reducer,o4=Or("keyDown"),l4=Or("focus"),c4=Or("blur"),wy=lf(),oc=null,mo=null,jp=null;wy.startListening({actionCreator:o4,effect:(e,t)=>{jp=e.payload,oc!==null&&(cancelAnimationFrame(oc),oc=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,s=i==="all"||i.includes("keydown");mo!==null&&(typeof r!="number"||!s)&&(clearTimeout(mo),mo=null);var l=()=>{try{var c=t.getState(),f=c.rootProps.accessibilityLayer!==!1;if(!f)return;var{keyboardInteraction:h}=c.tooltip,m=jp;if(m!=="ArrowRight"&&m!=="ArrowLeft"&&m!=="Enter")return;var g=Sd(h,Qo(c),Ic(c),$c(c)),y=g==null?-1:Number(g),v=!Number.isFinite(y)||y<0,w=Ra(c),S=Qo(c),N=wf(c,c.tooltip.settings.shared);if(m==="Enter"){if(v)return;var C=Qm(c,N,"hover",String(h.index));t.dispatch(Wm({active:!h.active,activeIndex:h.index,activeCoordinate:C}));return}var A=yce(c),k=A==="left-to-right"?1:-1,_=m==="ArrowRight"?1:-1,T;if(v){var P=Ic(c),E=$c(c),z=_*k,D=ve=>({active:!1,index:String(ve),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(T=-1,z>0){for(var F=0;F<S.length;F++)if(Sd(D(F),S,P,E)!=null){T=F;break}}else for(var U=S.length-1;U>=0;U--)if(Sd(D(U),S,P,E)!=null){T=U;break}if(T<0)return}else{T=y+_*k;var I=w?.length||S.length;if(I===0||T>=I||T<0)return}var ae=Qm(c,N,"hover",String(T));t.dispatch(Wm({active:!0,activeIndex:T.toString(),activeCoordinate:ae}))}finally{oc=null,mo=null}};if(!s){l();return}r==="raf"?oc=requestAnimationFrame(l):typeof r=="number"&&mo===null&&(l(),jp=null,mo=setTimeout(()=>{jp?l():(mo=null,oc=null)},r))}});wy.startListening({actionCreator:l4,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=wf(n,n.tooltip.settings.shared),c=Qm(n,l,"hover",String(s));t.dispatch(Wm({active:!0,activeIndex:s,activeCoordinate:c}))}}}});wy.startListening({actionCreator:c4,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(Wm({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function u4(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 Fr=Or("externalEvent"),d4=lf(),Np=new Map,dd=new Map,Bx=new Map;d4.startListening({actionCreator:Fr,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,s=u4(r);Bx.set(i,{handler:n,reactEvent:s});var l=Np.get(i);l!==void 0&&(cancelAnimationFrame(l),Np.delete(i));var c=t.getState(),{throttleDelay:f,throttledEvents:h}=c.eventSettings,m=h,g=m==="all"||m?.includes(i),y=dd.get(i);y!==void 0&&(typeof f!="number"||!g)&&(clearTimeout(y),dd.delete(i));var v=()=>{var N=Bx.get(i);try{if(!N)return;var{handler:C,reactEvent:A}=N,k=t.getState(),_={activeCoordinate:bue(k),activeDataKey:gue(k),activeIndex:Yd(k),activeLabel:u3(k),activeTooltipIndex:Yd(k),isTooltipActive:xue(k)};C&&C(_,A)}finally{Np.delete(i),dd.delete(i),Bx.delete(i)}};if(!g){v();return}if(f==="raf"){var w=requestAnimationFrame(v);Np.set(i,w)}else if(typeof f=="number"){if(!dd.has(i)){v();var S=setTimeout(v,f);dd.set(i,S)}}else v()}}});var Ome=ne([iu],e=>e.tooltipItemPayloads),kme=ne([Ome,(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)}}}),f4=Or("touchMove"),h4=lf(),go=null,ds=null,Pz=null,fd=null;h4.startListening({actionCreator:f4,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){fd=u4(n);var r=t.getState(),{throttleDelay:i,throttledEvents:s}=r.eventSettings,l=s==="all"||s.includes("touchmove");go!==null&&(cancelAnimationFrame(go),go=null),ds!==null&&(typeof i!="number"||!l)&&(clearTimeout(ds),ds=null),Pz=Array.from(n.touches).map(f=>tN({clientX:f.clientX,clientY:f.clientY,currentTarget:n.currentTarget}));var c=()=>{if(fd!=null){var f=t.getState(),h=wf(f,f.tooltip.settings.shared);if(h==="axis"){var m,g=(m=Pz)===null||m===void 0?void 0:m[0];if(g==null){go=null,ds=null;return}var y=eN(f,g);y?.activeIndex!=null&&t.dispatch(Q5({activeIndex:y.activeIndex,activeDataKey:void 0,activeCoordinate:y.activeCoordinate}))}else if(h==="item"){var v,w=fd.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(fne),C=(v=S.getAttribute(hne))!==null&&v!==void 0?v:void 0,A=ll(f).find(T=>T.id===C);if(N==null||A==null||C==null)return;var{dataKey:k}=A,_=kme(f,N,C);t.dispatch(_ce({activeDataKey:k,activeIndex:N,activeCoordinate:_,activeGraphicalItemId:C}))}go=null,ds=null}};if(!l){c();return}i==="raf"?go=requestAnimationFrame(c):typeof i=="number"&&ds===null&&(c(),fd=null,ds=setTimeout(()=>{fd?c():(ds=null,go=null)},i))}}});var p4={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},m4=Fn({name:"eventSettings",initialState:p4,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:Ame}=m4.actions,Eme=m4.reducer,Tme=iI({brush:Mhe,cartesianAxis:Che,chartData:vde,errorBars:vpe,eventSettings:Eme,graphicalItems:nhe,layout:Wte,legend:lre,options:hde,polarAxis:Ffe,polarOptions:_me,referenceElements:Ihe,renderedTicks:npe,rootProps:Sme,tooltip:kce,zIndex:ede}),Pme=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return wte({reducer:Tme,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([r4.middleware,i4.middleware,wy.middleware,d4.middleware,h4.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(bI({type:"raf"}))},devTools:{serialize:{replacer:wme},name:"recharts-".concat(n)}})};function zme(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=Er(),s=x.useRef(null);if(i)return n;s.current==null&&(s.current=Pme(t,r));var l=D1;return x.createElement(_re,{context:l,store:s.current},n)}function Mme(e){var{layout:t,margin:n}=e,r=Qt(),i=Er();return x.useEffect(()=>{i||(r(Vte(t)),r(Gte(n)))},[r,i,t,n]),null}var Rme=x.memo(Mme,ff);function Dme(e){var t=Qt();return x.useEffect(()=>{t(jme(e))},[t,e]),null}var Lme=e=>{var t=Qt();return x.useEffect(()=>{t(Ame(e))},[t,e]),null},Ime=x.memo(Lme,ff);function zz(e){var{zIndex:t,isPanorama:n}=e,r=x.useRef(null),i=Qt();return x.useLayoutEffect(()=>(r.current&&i(Xue({zIndex:t,element:r.current,isPanorama:n})),()=>{i(Jue({zIndex:t,isPanorama:n}))}),[i,t,n]),x.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function Mz(e){var{children:t,isPanorama:n}=e,r=Le(Fue);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(zz,{key:l,zIndex:l,isPanorama:n})),t,s.map(l=>x.createElement(zz,{key:l,zIndex:l,isPanorama:n})))}var $me=["children"];function Ume(e,t){if(e==null)return{};var n,r,i=Bme(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 Bme(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 tg(){return tg=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},tg.apply(null,arguments)}var qme={width:"100%",height:"100%",display:"block"},Fme=x.forwardRef((e,t)=>{var n=$I(),r=UI(),i=QI();if(!zs(n)||!zs(r))return null;var{children:s,otherAttributes:l,title:c,desc:f}=e,h,m;return l!=null&&(typeof l.tabIndex=="number"?h=l.tabIndex:h=i?0:void 0,typeof l.role=="string"?m=l.role:m=i?"application":void 0),x.createElement(O1,tg({},l,{title:c,desc:f,role:m,tabIndex:h,width:n,height:r,style:qme,ref:t}),s)}),Kme=e=>{var{children:t}=e,n=Le(Jg);if(!n)return null;var{width:r,height:i,y:s,x:l}=n;return x.createElement(O1,{width:r,height:i,x:l,y:s},t)},Rz=x.forwardRef((e,t)=>{var{children:n}=e,r=Ume(e,$me),i=Er();return i?x.createElement(Kme,null,x.createElement(Mz,{isPanorama:!0},n)):x.createElement(Fme,tg({ref:t},r),x.createElement(Mz,{isPanorama:!1},n))});function Hme(){var e=Qt(),[t,n]=x.useState(null),r=Le(dne);return x.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),s=i.width/t.offsetWidth;ct(s)&&s!==r&&e(Yte(s))}},[t,e,r]),n}function Dz(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 Gme(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Dz(Object(n),!0).forEach(function(r){Vme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vme(e,t,n){return(t=Zme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zme(e){var t=Yme(e,"string");return typeof t=="symbol"?t:t+""}function Yme(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 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)}var Wme=()=>(Ode(),null);function ng(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var Qme=x.forwardRef((e,t)=>{var n,r,i=x.useRef(null),[s,l]=x.useState({containerWidth:ng((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:ng((r=e.style)===null||r===void 0?void 0:r.height)}),c=x.useCallback((h,m)=>{l(g=>{var y=Math.round(h),v=Math.round(m);return g.containerWidth===y&&g.containerHeight===v?g:{containerWidth:y,containerHeight:v}})},[]),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:m,height:g}=h.getBoundingClientRect();c(m,g);var y=w=>{var S=w[0];if(S!=null){var{width:N,height:C}=S.contentRect;c(N,C)}},v=new ResizeObserver(y);v.observe(h),i.current=v}},[t,c]);return x.useEffect(()=>()=>{var h=i.current;h?.disconnect()},[c]),x.createElement(x.Fragment,null,x.createElement(uf,{width:s.containerWidth,height:s.containerHeight}),x.createElement("div",ks({ref:f},e)))}),Xme=x.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,s]=x.useState({containerWidth:ng(n),containerHeight:ng(r)}),l=x.useCallback((f,h)=>{s(m=>{var g=Math.round(f),y=Math.round(h);return m.containerWidth===g&&m.containerHeight===y?m:{containerWidth:g,containerHeight:y}})},[]),c=x.useCallback(f=>{if(typeof t=="function"&&t(f),f!=null){var{width:h,height:m}=f.getBoundingClientRect();l(h,m)}},[t,l]);return x.createElement(x.Fragment,null,x.createElement(uf,{width:i.containerWidth,height:i.containerHeight}),x.createElement("div",ks({ref:c},e)))}),Jme=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return x.createElement(x.Fragment,null,x.createElement(uf,{width:n,height:r}),x.createElement("div",ks({ref:t},e)))}),ege=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?x.createElement(Xme,ks({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?x.createElement(Jme,ks({},e,{width:n,height:r,ref:t})):x.createElement(x.Fragment,null,x.createElement(uf,{width:n,height:r}),x.createElement("div",ks({ref:t},e)))});function tge(e){return e?Qme:ege}var nge=x.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:s,onContextMenu:l,onDoubleClick:c,onMouseDown:f,onMouseEnter:h,onMouseLeave:m,onMouseMove:g,onMouseUp:y,onTouchEnd:v,onTouchMove:w,onTouchStart:S,style:N,width:C,responsive:A,dispatchTouchEvents:k=!0}=e,_=x.useRef(null),T=Qt(),[P,E]=x.useState(null),[z,D]=x.useState(null),F=Hme(),U=F1(),I=U?.width>0?U.width:C,ae=U?.height>0?U.height:i,ve=x.useCallback(ce=>{F(ce),typeof t=="function"&&t(ce),E(ce),D(ce),ce!=null&&(_.current=ce)},[F,t,E,D]),me=x.useCallback(ce=>{T(n4(ce)),T(Fr({handler:s,reactEvent:ce}))},[T,s]),G=x.useCallback(ce=>{T(wS(ce)),T(Fr({handler:h,reactEvent:ce}))},[T,h]),re=x.useCallback(ce=>{T(W5()),T(Fr({handler:m,reactEvent:ce}))},[T,m]),ge=x.useCallback(ce=>{T(wS(ce)),T(Fr({handler:g,reactEvent:ce}))},[T,g]),Se=x.useCallback(()=>{T(l4())},[T]),B=x.useCallback(()=>{T(c4())},[T]),R=x.useCallback(ce=>{T(o4(ce.key))},[T]),H=x.useCallback(ce=>{T(Fr({handler:l,reactEvent:ce}))},[T,l]),oe=x.useCallback(ce=>{T(Fr({handler:c,reactEvent:ce}))},[T,c]),Q=x.useCallback(ce=>{T(Fr({handler:f,reactEvent:ce}))},[T,f]),X=x.useCallback(ce=>{T(Fr({handler:y,reactEvent:ce}))},[T,y]),W=x.useCallback(ce=>{T(Fr({handler:S,reactEvent:ce}))},[T,S]),le=x.useCallback(ce=>{k&&T(f4(ce)),T(Fr({handler:w,reactEvent:ce}))},[T,k,w]),ye=x.useCallback(ce=>{T(Fr({handler:v,reactEvent:ce}))},[T,v]),Z=tge(A);return x.createElement(v3.Provider,{value:P},x.createElement(yL.Provider,{value:z},x.createElement(Z,{width:I??N?.width,height:ae??N?.height,className:bt("recharts-wrapper",r),style:Gme({position:"relative",cursor:"default",width:I,height:ae},N),onClick:me,onContextMenu:H,onDoubleClick:oe,onFocus:Se,onBlur:B,onKeyDown:R,onMouseDown:Q,onMouseEnter:G,onMouseLeave:re,onMouseMove:ge,onMouseUp:X,onTouchEnd:ye,onTouchMove:le,onTouchStart:W,ref:ve},x.createElement(Wme,null),n)))}),rge=["width","height","responsive","children","className","style","compact","title","desc"];function ige(e,t){if(e==null)return{};var n,r,i=age(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 age(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 sge=x.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:s,className:l,style:c,compact:f,title:h,desc:m}=e,g=ige(e,rge),y=Fi(g);return f?x.createElement(x.Fragment,null,x.createElement(uf,{width:n,height:r}),x.createElement(Rz,{otherAttributes:y,title:h,desc:m},s)):x.createElement(nge,{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(Rz,{otherAttributes:y,title:h,desc:m,ref:t},x.createElement(Uhe,null,s)))});function SS(){return SS=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},SS.apply(null,arguments)}function Lz(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 oge(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Lz(Object(n),!0).forEach(function(r){lge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lz(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)}var dge={top:5,right:5,bottom:5,left:5},fge=oge({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:dge,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},p4),hge=x.forwardRef(function(t,n){var r,i=Ar(t.categoricalChartProps,fge),{chartName:s,defaultTooltipEventType:l,validateTooltipEventTypes:c,tooltipPayloadSearcher:f,categoricalChartProps:h}=t,m={chartName:s,defaultTooltipEventType:l,validateTooltipEventTypes:c,tooltipPayloadSearcher:f,eventEmitter:void 0};return x.createElement(zme,{preloadedState:{options:m},reduxStoreName:(r=h.id)!==null&&r!==void 0?r:s},x.createElement(zhe,{chartData:h.data}),x.createElement(Rme,{layout:i.layout,margin:i.margin}),x.createElement(Ime,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),x.createElement(Dme,{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(sge,SS({},i,{ref:n})))}),pge=["axis"],mge=x.forwardRef((e,t)=>x.createElement(hge,{chartName:"ComposedChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:pge,tooltipPayloadSearcher:dde,categoricalChartProps:e,ref:t}));const Cp=["#34d399","#60a5fa","#f472b6","#facc15","#a78bfa","#fb923c","#22d3ee","#f87171"];function _p(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function gge(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 yge({projectName:e}){const[t,n]=x.useState(null),[r,i]=x.useState(null),[s,l]=x.useState(!0),[c,f]=x.useState(!1),[h,m]=x.useState(!1),[g,y]=x.useState(null),[v,w]=x.useState(null),[S,N]=x.useState("sessions"),[C,A]=x.useState("desc"),[k,_]=x.useState("sessions"),[T,P]=x.useState("desc"),[E,z]=x.useState([]),[D,F]=x.useState([]);function U(W){l(!0),Fk(e).then(le=>{if(!W.current)return n(le),le.connected?Promise.all([Kk(e),Hk(e).catch(()=>[]),Gk(e).catch(()=>[])]):null}).then(le=>{W.current||(Array.isArray(le)?(i(le[0]),z(le[1]),F(le[2])):(i(null),z([]),F([])),l(!1))}).catch(le=>{W.current||(y(le instanceof Error?le.message:"Failed to load GA4 data"),l(!1))})}x.useEffect(()=>{const W={current:!1};return U(W),()=>{W.current=!0}},[e]);async function I(){f(!0),y(null),w(null);try{const W=await zM(e);w(`Synced ${W.rowCount.toLocaleString()} page rows and ${W.aiReferralCount.toLocaleString()} AI referral rows (${W.days} days)`);const[le,ye,Z]=await Promise.all([Kk(e),Hk(e).catch(()=>[]),Gk(e).catch(()=>[])]);i(le),z(ye),F(Z);const ce=await Fk(e);n(ce)}catch(W){y(W instanceof Error?W.message:"Sync failed")}finally{f(!1)}}async function ae(){m(!0),y(null),w(null);try{await h9(e),n({connected:!1,propertyId:null,clientEmail:null,lastSyncedAt:null,createdAt:null,updatedAt:null}),i(null),w("GA4 disconnected")}catch(W){y(W instanceof Error?W.message:"Disconnect failed")}finally{m(!1)}}function ve(W){S===W?A(le=>le==="desc"?"asc":"desc"):(N(W),A("desc"))}function me(W){k===W?P(le=>le==="desc"?"asc":"desc"):(_(W),P("desc"))}const G=x.useMemo(()=>r?.topPages?[...r.topPages].sort((W,le)=>{const ye=W[S],Z=le[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((W,le)=>{const ye=W[k],Z=le[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:ge,chartSources:Se,dateRange:B}=x.useMemo(()=>{const W=[...new Set(E.map(be=>be.source))],le=new Map;for(const be of D)le.set(be.date,{_totalSessions:be.sessions,_organicSessions:be.organicSessions});for(const be of E){let K=le.get(be.date);K||(K={_totalSessions:0,_organicSessions:0},le.set(be.date,K)),K[be.source]=(K[be.source]??0)+be.sessions}const ye=[...le.entries()].sort(([be],[K])=>be.localeCompare(K)).map(([be,K])=>({date:be,...K})),Z=ye.map(be=>be.date),ce=Z.length>0?{start:Z[0],end:Z[Z.length-1]}:null;return{chartData:ye,chartSources:W,dateRange:ce}},[E,D]);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(vge,{projectName:e,onConnected:()=>U({current:!1})});const R=r&&r.totalSessions>0?Math.round(r.totalOrganicSessions/r.totalSessions*100):0,H=r?.aiReferrals.reduce((W,le)=>W+le.sessions,0)??0,oe=r&&r.totalSessions>0?Math.round(H/r.totalSessions*100):0,Q=r?new Set(r.aiReferrals.map(W=>W.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}),v&&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:v}),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(pe,{variant:"outline",size:"sm",disabled:c,onClick:I,children:[u.jsx(Qk,{className:`w-3.5 h-3.5 mr-1.5 ${c?"animate-spin":""}`}),c?"Syncing…":"Sync"]}),u.jsxs(pe,{variant:"ghost",size:"sm",className:"text-rose-400 hover:text-rose-300",disabled:h,onClick:ae,children:[u.jsx(J9,{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(Yn,{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(qx,{value:_p(r.totalSessions),label:"Total Sessions",subtitle:r.totalSessions.toLocaleString(),tone:"neutral"}),u.jsx(qx,{value:_p(r.totalOrganicSessions),label:"Organic Sessions",subtitle:`${R}% of total`,tone:"positive"}),u.jsx(qx,{value:_p(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(pe,{variant:"outline",size:"sm",disabled:c,onClick:I,children:[u.jsx(Qk,{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(Yn,{text:"Tracks sessions from known AI referrers (ChatGPT, Claude, Gemini, Perplexity, OpenAI, Copilot) detected in GA4 sessionSource. 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"})]})]}),ge.length>0&&u.jsxs(Ue,{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:Se.length>0?"AI vs. total sessions":"Total sessions over time"})]}),Se.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(Bne,{width:"100%",height:"100%",children:u.jsxs(mge,{data:ge,margin:{top:4,right:4,bottom:0,left:0},children:[u.jsx(e4,{dataKey:"date",tick:{fill:"#71717a",fontSize:11},tickLine:!1,axisLine:{stroke:"#27272a"},tickFormatter:W=>{const le=new Date(W+"T00:00:00");return`${le.getMonth()+1}/${le.getDate()}`}}),u.jsx(t4,{tick:{fill:"#71717a",fontSize:11},tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),u.jsx(Rde,{contentStyle:{backgroundColor:"#18181b",border:"1px solid #3f3f46",borderRadius:8,fontSize:12},labelStyle:{color:"#e4e4e7"},itemStyle:{color:"#a1a1aa"},labelFormatter:W=>new Date(String(W)+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}),formatter:(W,le)=>{const ye=typeof W=="number"?W.toLocaleString():String(W??0),Z=String(le??"");return Z==="_totalSessions"?[ye,"Total Sessions"]:Z==="_organicSessions"?[ye,"Organic Sessions"]:[ye,Z]}}),u.jsx(YI,{wrapperStyle:{fontSize:11,color:"#a1a1aa"},formatter:W=>W==="_totalSessions"?"Total Sessions":W==="_organicSessions"?"Organic Sessions":W}),u.jsx(gS,{type:"monotone",dataKey:"_totalSessions",stroke:"#52525b",fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),Se.map((W,le)=>u.jsx(gS,{type:"monotone",dataKey:W,stackId:"ai",stroke:Cp[le%Cp.length],fill:Cp[le%Cp.length],fillOpacity:.4,strokeWidth:1.5},W))]})})})]}),u.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,0.9fr)_minmax(0,1.5fr)]",children:[u.jsxs(Ue,{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(lc,{label:"AI Sessions",value:_p(H),hint:`${H.toLocaleString()} sessions`,tone:"positive"}),u.jsx(lc,{label:"Share of Traffic",value:`${oe}%`,hint:"of total sessions",tone:"neutral"}),u.jsx(lc,{label:"Tracked Sources",value:String(Q),hint:`${r.aiReferrals.length} source rows`,tone:"neutral"})]}),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(lc,{label:"AI Sessions",value:"0",hint:"no AI referrals detected",tone:"neutral"}),u.jsx(lc,{label:"Share of Traffic",value:"0%",hint:"of total sessions",tone:"neutral"}),u.jsx(lc,{label:"Tracked Sources",value:"0",hint:"sources monitored: 7",tone:"neutral"})]}),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:"ChatGPT, Claude, Gemini, Perplexity, OpenAI, Anthropic, and Copilot. Sessions will appear here once GA4 detects visits from these sources."})]})]})]}),u.jsxs(Ue,{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(fs,{label:"Source",sortKey:"source",current:k,dir:T,onSort:me,align:"left"}),u.jsx(fs,{label:"Medium",sortKey:"medium",current:k,dir:T,onSort:me,align:"left"}),u.jsx(fs,{label:"Sessions",sortKey:"sessions",current:k,dir:T,onSort:me,align:"right"}),u.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),u.jsx(fs,{label:"Users",sortKey:"users",current:k,dir:T,onSort:me,align:"right"})]})}),u.jsx("tbody",{children:re.map(W=>u.jsx(xge,{referral:W,totalSessions:H},`${W.source}:${W.medium}`))})]})}):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(Yn,{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(fs,{label:"Landing Page",sortKey:"landingPage",current:S,dir:C,onSort:ve,align:"left"}),u.jsx(fs,{label:"Sessions",sortKey:"sessions",current:S,dir:C,onSort:ve,align:"right"}),u.jsx(fs,{label:"Organic",sortKey:"organicSessions",current:S,dir:C,onSort:ve,align:"right"}),u.jsx("th",{className:"text-right py-1 font-medium",children:"Organic %"}),u.jsx(fs,{label:"Users",sortKey:"users",current:S,dir:C,onSort:ve,align:"right"})]})}),u.jsx("tbody",{children:G.map(W=>u.jsx(bge,{page:W},W.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 ${gge(r.lastSyncedAt)}`:"Never synced"}),u.jsx("span",{children:r?`${r.topPages.length} pages · ${r.aiReferrals.length} AI rows`:""})]})]})}function vge({projectName:e,onConnected:t}){const[n,r]=x.useState(""),[i,s]=x.useState(null),[l,c]=x.useState(null),[f,h]=x.useState(!1),[m,g]=x.useState(null),y=x.useRef(null),v=x.useCallback(S=>{const N=S.target.files?.[0];if(!N)return;g(null),s(N.name);const C=new FileReader;C.onload=()=>{const A=C.result;try{const k=JSON.parse(A);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(A)}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 f9(e,{propertyId:n.trim(),keyJson:l});try{await zM(e)}catch{}t()}catch(S){g(S instanceof Error?S.message:"Failed to connect GA4")}finally{h(!1)}}return u.jsxs(Ue,{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."}),m&&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:m}),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:y,type:"file",accept:".json,application/json",onChange:v,className:"hidden"}),u.jsxs("button",{type:"button",onClick:()=>y.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(tF,{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(pe,{variant:"default",size:"sm",disabled:f||!n.trim()||!l,onClick:w,children:f?"Connecting & syncing…":"Connect GA4"})]})}function fs({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 g4={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-50"};function qx({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 ${g4[r]}`,children:e}),u.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function lc({value:e,label:t,hint:n,tone:r}){return u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-950/40 px-4 py-3",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:t}),u.jsx("p",{className:`text-xl font-semibold tabular-nums ${g4[r]}`,children:e}),u.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function bge({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()})]})}function xge({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*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-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 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 jf(e){e.invalidateQueries({queryKey:Vr.runs.all}),e.invalidateQueries({queryKey:Vr.projects.all})}function wge(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function Sge(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 Sy(e,t){IM({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:t.projectLabel,sourceAction:t.sourceAction,lastAnnouncedStatus:"queued"}),Xe({title:wge(e.kind),detail:Sge(t.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function jge(e){const t=e.filter(i=>i.status!=="conflict"),n=e.filter(i=>i.status==="conflict");if(t.length===0){Xe({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)IM({id:i.id,projectId:i.projectId,kind:i.kind,projectLabel:i.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=dF({runIds:t.map(i=>i.id),queuedCount:t.length,skippedCount:n.length});Xe({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 jy(e,t){if(e instanceof Xp&&e.code==="RUN_IN_PROGRESS"){Xe({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}Xe({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function y4(){const e=Rs();return Xd({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>jq(t,n),onSuccess:(t,n)=>{jf(e),Sy(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})},onError:(t,n)=>{jy(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})}})}function Nge(){const e=Rs();return Xd({meta:{skipGlobalErrorToast:!0},mutationFn:t=>qq(t),onSuccess:t=>{jf(e),jge(t)},onError:t=>{Xe({title:t instanceof Error?t.message:"Failed to queue runs",tone:"negative"})}})}function Cge(){const e=Rs();return Xd({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>AM(t,n),onSuccess:(t,n)=>{jf(e),Sy(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})},onError:(t,n)=>{jy(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})}})}function _ge(){const e=Rs();return Xd({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t})=>t9(t),onSuccess:(t,n)=>{jf(e),Sy(t.run,{projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})},onError:(t,n)=>{jy(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})}})}function Oge(){const e=Rs();return Xd({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>Jq(t,n),onSuccess:(t,n)=>{jf(e),Sy(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})},onError:(t,n)=>{jy(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})}})}function kge({projectName:e}){const[t,n]=x.useState(!1),[r,i]=x.useState([]),[s,l]=x.useState([]),[c,f]=x.useState([]),[h,m]=x.useState([]),[g,y]=x.useState([]),[v,w]=x.useState(null),[S,N]=x.useState(""),[C,A]=x.useState(""),[k,_]=x.useState("30"),[T,P]=x.useState(!1),[E,z]=x.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[D,F]=x.useState(""),[U,I]=x.useState(!0),[ae,ve]=x.useState(!1),[me,G]=x.useState(!1),[re,ge]=x.useState(!1),[Se,B]=x.useState(!1),[R,H]=x.useState(!1),[oe,Q]=x.useState(!1),[X,W]=x.useState(null),[le,ye]=x.useState(!1),[Z,ce]=x.useState(!1),[be,K]=x.useState(null),[Re,Ee]=x.useState(""),[it,rt]=x.useState(!1),[rn,dn]=x.useState(!1),[Gt,he]=x.useState("indexed"),[Je,xt]=x.useState([]),[xn,et]=x.useState(null),[Ke,at]=x.useState(!1),[Bt,Ye]=x.useState(null),[cl,tr]=x.useState(null),ft=r.find(V=>V.connectionType==="gsc"),au=c.length>0||h.length>0||g.length>0,ii=Cge(),Nt=_ge(),nr=Oge();async function xe(V){if(!V){l([]),N("");return}G(!0);try{const{sites:we}=await Hq(e);l(we),N(V.propertyId??we[0]?.siteUrl??"")}catch(we){l([]),Ye(we instanceof Error?we.message:"Failed to load Search Console properties")}finally{G(!1)}}async function pr(){B(!0);try{const V=await Zq(e,{startDate:E.startDate||void 0,endDate:E.endDate||void 0,query:E.query||void 0,page:E.page||void 0,limit:parseInt(E.limit,10)||20});f(V)}catch(V){f([]),Ye(V instanceof Error?V.message:"Failed to load GSC performance data")}finally{B(!1)}}async function ul(){H(!0);try{const[V,we]=await Promise.all([Wq(e,{url:D.trim()||void 0,limit:20}),Qq(e)]);m(V),y(we)}catch(V){m([]),y([]),Ye(V instanceof Error?V.message:"Failed to load GSC inspection history")}finally{H(!1)}}async function Cf(){ye(!0);try{const[V,we]=await Promise.all([KS(e),Xq(e).catch(()=>[])]);W(V),xt(we)}catch(V){W(null),xt([]),Ye(V instanceof Error?V.message:"Failed to load coverage data")}finally{ye(!1)}}async function Ks(V){at(!0),Ye(null);try{const we=await Bk(e,{urls:V}),{succeeded:zt,failed:fn,total:Kn}=we.summary;Xe({title:"Indexing requested",detail:fn===0?`${zt} URL${zt!==1?"s":""} submitted for indexing.`:`${zt}/${Kn} submitted successfully, ${fn} failed.`,tone:fn===0?"positive":"caution",dedupeKey:`gsc:indexing:${e}`,dedupeMode:"replace"})}catch(we){Ye(we instanceof Error?we.message:"Failed to request indexing")}finally{at(!1)}}async function dl(){at(!0),Ye(null);try{const V=await Bk(e,{urls:[],allUnindexed:!0}),{succeeded:we,failed:zt,total:fn}=V.summary;Xe({title:"Indexing requested",detail:zt===0?`${we} unindexed URL${we!==1?"s":""} submitted for indexing.`:`${we}/${fn} submitted successfully, ${zt} failed.`,tone:zt===0?"positive":"caution",dedupeKey:`gsc:indexing-all:${e}`,dedupeMode:"replace"})}catch(V){Ye(V instanceof Error?V.message:"Failed to request indexing")}finally{at(!1)}}async function Wi(){if(Re.trim()){rt(!0),Ye(null);try{await Vq(e,"gsc",Re.trim()),i(V=>V.map(we=>we.connectionType==="gsc"?{...we,sitemapUrl:Re.trim()}:we)),Xe({title:"Sitemap URL saved",detail:`${e} will use the updated sitemap URL.`,tone:"positive",dedupeKey:`gsc:sitemap:${e}`,dedupeMode:"drop"}),Ee("")}catch(V){Ye(V instanceof Error?V.message:"Failed to save sitemap URL")}finally{rt(!1)}}}async function ji(){Ye(null);try{const V=await Nt.mutateAsync({projectName:e,projectLabel:e});K(V.sitemaps),i(we=>we.map(zt=>zt.connectionType==="gsc"?{...zt,sitemapUrl:V.primarySitemapUrl}:zt))}catch{}}async function fl(){ce(!0),Ye(null);try{const V=await e9(e);K(V.sitemaps),V.sitemaps.length===0&&tr("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch(V){Ye(V instanceof Error?V.message:"Failed to list sitemaps")}finally{ce(!1)}}async function Da(){I(!0),Ye(null);try{const[V,we]=await Promise.all([FS().catch(()=>null),kM(e).catch(()=>[])]);n(!!V?.google?.configured),i(we);const zt=we.find(fn=>fn.connectionType==="gsc");await Promise.all([xe(zt),pr(),ul(),Cf()])}finally{I(!1)}}x.useEffect(()=>{Da()},[e]);async function Cy(){if(!t){Ye("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}ve(!0),Ye(null),tr(null);try{const{authUrl:V}=await Fq(e,"gsc");if(!V.startsWith("https://accounts.google.com/")){Ye("Unexpected OAuth redirect URL. Please try again.");return}const we=window.open(V,"_blank","width=600,height=700");if(!we){window.location.assign(V);return}tr("Finish the Google consent flow in the popup, then close it to refresh this project.");const zt=window.setInterval(()=>{we.closed&&(window.clearInterval(zt),tr(null),Da())},1e3)}catch(V){Ye(V instanceof Error?V.message:"Failed to start OAuth flow")}finally{ve(!1)}}async function _f(){Ye(null),tr(null);try{await Kq(e,"gsc"),i(V=>V.filter(we=>we.connectionType!=="gsc")),l([]),N("")}catch(V){Ye(V instanceof Error?V.message:"Failed to disconnect")}}async function su(){if(S){ge(!0),Ye(null);try{await Gq(e,"gsc",S),i(V=>V.map(we=>we.connectionType==="gsc"?{...we,propertyId:S}:we)),Xe({title:"GSC property updated",detail:`${e} is now linked to ${S}.`,tone:"positive",dedupeKey:`gsc:property:${e}`,dedupeMode:"drop"})}catch(V){Ye(V instanceof Error?V.message:"Failed to save GSC property")}finally{ge(!1)}}}async function Hs(){Ye(null),tr(null);try{await ii.mutateAsync({projectName:e,projectLabel:e,opts:{days:parseInt(k,10)||void 0,full:T||void 0}})}catch{}}async function Of(){if(C.trim()){Q(!0),Ye(null),tr(null);try{const V=await Yq(e,C.trim());w(V),A(""),await ul()}catch(V){Ye(V instanceof Error?V.message:"Failed to inspect URL")}finally{Q(!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:ft&&u.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:Se,onClick:()=>{pr()},children:Se?"Refreshing…":"Refresh data"})})]}),Bt&&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:[Bt,u.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>Ye(null),children:"×"})]}),cl&&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:[cl,u.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>tr(null),children:"×"})]}),U?u.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):u.jsxs("div",{className:"space-y-3",children:[u.jsxs(Ue,{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(yt,{tone:ft?"positive":t?"caution":"negative",children:ft?"Connected":t?"Ready to connect":"App credentials missing"})]}),ft?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:ft.domain}),u.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:_f,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:ft.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:ft.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:di(ft.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(pe,{type:"button",variant:"outline",size:"sm",disabled:ae,onClick:Cy,children:ae?"Opening…":"Connect Google Search Console"}):u.jsx(pe,{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."})]})]})]}),ft&&!ft.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(pe,{type:"button",size:"sm",disabled:Nt.isPending||!ft.propertyId,onClick:ji,children:Nt.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:Re,onChange:V=>Ee(V.target.value),onKeyDown:V=>V.key==="Enter"&&void Wi()}),u.jsx(pe,{type:"button",size:"sm",variant:"outline",disabled:it||!Re.trim(),onClick:Wi,children:it?"Saving…":"Save sitemap URL"})]})]})]})]})}),(ft||au)&&u.jsxs(u.Fragment,{children:[u.jsxs(Ue,{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(pe,{type:"button",variant:"outline",size:"sm",disabled:Ke,onClick:()=>{dl()},children:Ke?"Requesting…":`Request indexing (${X.notIndexed.length})`}),u.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:le,onClick:()=>{Cf()},children:le?"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 V=X.summary.indexed+X.summary.notIndexed,we=V>0?X.summary.indexed/V:0,zt=V>0?X.summary.notIndexed/V:0,fn=54,Kn=2*Math.PI*fn,hl=Kn*(1-we),Ni=Kn*zt,Hn=Kn*we;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:fn,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),u.jsx("circle",{cx:"64",cy:"64",r:fn,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:Kn,strokeDashoffset:hl,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:fn,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${Ni} ${Kn-Ni}`,strokeDashoffset:-Hn,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:[(we*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(V=>{const we=V==="indexed"?X.indexed.length:V==="notIndexed"?X.notIndexed.length:X.deindexed.length,zt=V==="indexed"?"Indexed":V==="notIndexed"?"Not Indexed":"Deindexed";return u.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${Gt===V?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{he(V),et(null)},children:[zt," (",we,")"]},V)})}),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(V=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:V.url}),u.jsx("td",{className:"text-zinc-400",children:V.verdict??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:V.crawlTime?V.crawlTime.split("T")[0]:"—"}),u.jsx("td",{className:"text-zinc-400",children:V.isMobileFriendly===!0?"Yes":V.isMobileFriendly===!1?"No":"—"})]},V.id))})]}),Gt==="notIndexed"&&!xn&&(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(V=>u.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>et(V.reason),children:[u.jsx("td",{className:"text-zinc-200",children:V.reason}),u.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:V.count})]},V.reason))})]}),Gt==="notIndexed"&&!xn&&(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(V=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:V.url}),u.jsx("td",{className:"text-zinc-400",children:V.indexingState??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:V.coverageState??"Unknown"})]},V.id))})]}),Gt==="notIndexed"&&xn&&(()=>{const V=(X.reasonGroups??[]).find(we=>we.reason===xn);return V?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:()=>et(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:V.reason}),u.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[V.count," affected page",V.count!==1?"s":""]})]}),u.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:Ke,onClick:()=>{Ks(V.urls.map(we=>we.url))},children:Ke?"Requesting…":`Request indexing (${V.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:V.urls.map(we=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:we.url}),u.jsx("td",{className:"text-zinc-400",children:we.crawlTime?we.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:Ke,onClick:()=>{Ks([we.url])},title:"Request indexing",children:"Index"})})]},we.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((V,we)=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:V.url}),u.jsx("td",{className:"text-zinc-400",children:V.previousState}),u.jsx("td",{className:"text-zinc-400",children:V.currentState}),u.jsx("td",{className:"text-zinc-400",children:V.transitionDate.split("T")[0]})]},`${V.url}-${we}`))})]}),(Gt==="indexed"&&X.indexed.length===0||Gt==="notIndexed"&&!xn&&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:le?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),u.jsxs(Ue,{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(pe,{type:"button",variant:"outline",size:"sm",disabled:Se,onClick:()=>{pr()},children:Se?"Loading…":"Apply filters"})]}),c.length>0&&(()=>{const V=new Map;for(const He of c){const st=V.get(He.date);st?(st.clicks+=He.clicks,st.impressions+=He.impressions):V.set(He.date,{clicks:He.clicks,impressions:He.impressions})}const we=[...V.entries()].sort(([He],[st])=>He.localeCompare(st));if(we.length===0)return null;const zt=Math.max(...we.map(([,He])=>He.impressions),1),fn=we.reduce((He,[,st])=>He+st.clicks,0),Kn=we.reduce((He,[,st])=>He+st.impressions,0),hl=Kn>0?(fn/Kn*100).toFixed(1):"0.0",Ni=700,Hn=220,ht={top:12,bottom:36,left:48,right:12},In=Ni-ht.left-ht.right,mr=Hn-ht.top-ht.bottom,Qi=In/we.length,pl=Math.max(Math.min(Qi*.35,24),4),kf=Math.max(pl*.15,1),Af=He=>{if(He<=0)return 1;const st=Math.pow(10,Math.floor(Math.log10(He))),pt=He/st,ai=pt<=1.5?1.5:pt<=3?3:pt<=5?5:10;return Math.ceil(ai*st)},Ci=4,La=Math.ceil(Af(zt)/Ci)*Ci,Ia=Array.from({length:Ci+1},(He,st)=>La/Ci*st),$a=He=>He>=1e3?`${(He/1e3).toFixed(He>=1e4?0:1)}k`:String(He);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:fn.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:Kn.toLocaleString()})]})]}),u.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",u.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[hl,"%"]})]})]}),u.jsx("div",{className:"relative w-full",style:{aspectRatio:`${Ni} / ${Hn}`},children:u.jsxs("svg",{viewBox:`0 0 ${Ni} ${Hn}`,className:"h-full w-full",children:[Ia.map((He,st)=>{const pt=ht.top+mr-He/La*mr;return u.jsxs("g",{children:[u.jsx("line",{x1:ht.left,y1:pt,x2:Ni-ht.right,y2:pt,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),u.jsx("text",{x:ht.left-6,y:pt+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:$a(He)})]},`t-${st}`)}),we.map(([He,st],pt)=>{const ai=ht.left+Qi*pt+Qi/2,Gs=st.impressions/La*mr,_i=st.clicks/La*mr;return u.jsxs("g",{children:[u.jsx("title",{children:`${He}
269
+ Clicks: ${st.clicks}
270
+ Impressions: ${st.impressions}
271
+ CTR: ${st.impressions>0?(st.clicks/st.impressions*100).toFixed(1):0}%`}),u.jsx("rect",{x:ai-pl-kf/2,y:ht.top+mr-Gs,width:pl,height:Math.max(Gs,1),rx:2,fill:"#3b82f6",opacity:.85}),u.jsx("rect",{x:ai+kf/2,y:ht.top+mr-_i,width:pl,height:Math.max(_i,1),rx:2,fill:"#10b981",opacity:.85})]},He)}),(()=>{const He=Math.min(we.length,7);return Array.from({length:He},(st,pt)=>{const ai=we.length===1?0:Math.round(pt/(He-1)*(we.length-1)),Gs=ht.left+Qi*ai+Qi/2;return u.jsx("text",{x:Gs,y:Hn-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:we[ai][0].slice(5)},`xl-${ai}`)})})()]})})]})})(),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:E.startDate,onChange:V=>z(we=>({...we,startDate:V.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:E.endDate,onChange:V=>z(we=>({...we,endDate:V.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:E.query,onChange:V=>z(we=>({...we,query:V.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:E.page,onChange:V=>z(we=>({...we,page:V.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:E.limit,onChange:V=>z(we=>({...we,limit:V.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"}),u.jsx("th",{className:"text-right",children:"Clicks"}),u.jsx("th",{className:"text-right",children:"Impressions"}),u.jsx("th",{className:"text-right",children:"CTR"}),u.jsx("th",{className:"text-right",children:"Position"})]})}),u.jsx("tbody",{children:c.map((V,we)=>u.jsxs("tr",{children:[u.jsx("td",{className:"text-zinc-400",children:V.date}),u.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:V.query}),u.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:V.page}),u.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:V.clicks.toLocaleString()}),u.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:V.impressions.toLocaleString()}),u.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(Number.isFinite(V.ctr)?V.ctr*100:0).toFixed(1),"%"]}),u.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:V.position.toFixed(1)})]},`${V.date}:${V.query}:${V.page}:${we}`))})]})}):u.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),u.jsxs(Ue,{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:V=>A(V.target.value),onKeyDown:V=>V.key==="Enter"&&void Of()}),u.jsx(pe,{type:"button",size:"sm",disabled:oe||!ft?.propertyId||!C.trim(),onClick:Of,children:oe?"Inspecting…":"Inspect URL"})]}),v&&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:v.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:v.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:Xk(v.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:di(v.crawlTime)})]})]})]}),u.jsxs(Ue,{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(pe,{type:"button",variant:"outline",size:"sm",disabled:R,onClick:()=>{ul()},children:R?"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:D,onChange:V=>F(V.target.value)}),u.jsx(pe,{type:"button",size:"sm",variant:"outline",disabled:R,onClick:()=>{ul()},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(V=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:V.url}),u.jsx("td",{className:"text-zinc-300",children:V.indexingState??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:V.verdict??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:V.coverageState??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:Xk(V.isMobileFriendly)}),u.jsx("td",{className:"text-zinc-400",children:di(V.inspectedAt)})]},V.id))})]})}):u.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),u.jsxs(Ue,{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(V=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:V.url}),u.jsx("td",{className:"text-zinc-400",children:V.previousState??"Unknown"}),u.jsx("td",{className:"text-zinc-300",children:V.currentState??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:di(V.transitionDate)})]},`${V.url}:${V.transitionDate}`))})]})}):u.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),ft&&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:()=>dn(V=>!V),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 ${rn?"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"})]})}),rn&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[u.jsxs(Ue,{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:me||s.length===0,onChange:V=>N(V.target.value),children:s.length===0?u.jsx("option",{value:"",children:me?"Loading properties…":"No properties available"}):s.map(V=>u.jsxs("option",{value:V.siteUrl,children:[V.siteUrl," · ",V.permissionLevel]},V.siteUrl))}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(pe,{type:"button",size:"sm",variant:"outline",disabled:me,onClick:()=>{xe(ft)},children:me?"Refreshing…":"Refresh properties"}),u.jsx(pe,{type:"button",size:"sm",disabled:!S||re,onClick:su,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(Ue,{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:V=>_(V.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:V=>P(V.target.checked)}),"Replace existing imported rows for the requested range"]})]}),u.jsx(pe,{type:"button",size:"sm",disabled:ii.isPending||!ft.propertyId,onClick:Hs,children:ii.isPending?"Queueing…":"Queue sync"}),!ft.propertyId&&u.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),u.jsxs(Ue,{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:[ft.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:ft.sitemapUrl})]}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(pe,{type:"button",size:"sm",variant:"outline",disabled:Z||!ft.propertyId,onClick:()=>{fl()},children:Z?"Loading…":"Browse sitemaps from GSC"}),u.jsx(pe,{type:"button",size:"sm",variant:"outline",disabled:Nt.isPending||!ft.propertyId,onClick:ji,children:Nt.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."}),be&&be.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 (",be.length,")"]}),be.map(V=>{const we=V.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:V.path}),V.lastSubmitted&&u.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",V.lastSubmitted.split("T")[0]]})]}),u.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[we&&u.jsxs("div",{className:"text-right",children:[u.jsxs("p",{className:"text-zinc-300",children:[we.indexed," / ",we.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:()=>Ee(V.path),children:"Use"})]})]},V.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:ft.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:Re,onChange:V=>Ee(V.target.value),onKeyDown:V=>V.key==="Enter"&&Re.trim()&&void Wi()}),u.jsx(pe,{type:"button",size:"sm",disabled:it||!Re.trim(),onClick:Wi,children:it?"Saving…":ft.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(pe,{type:"button",size:"sm",variant:"outline",disabled:nr.isPending||!ft.propertyId,onClick:async()=>{const we=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||ft.sitemapUrl||void 0;Ye(null),tr(null);try{await nr.mutateAsync({projectName:e,projectLabel:e,opts:{sitemapUrl:we}})}catch{}},children:nr.isPending?"Queueing…":"Inspect sitemap"})]}),!ft.propertyId&&u.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function Age({project:e,onUpdateProject:t,onRefresh:n}){const[r,i]=x.useState(!1),[s,l]=x.useState(!1),[c,f]=x.useState(null),[h,m]=x.useState(e.displayName),[g,y]=x.useState(e.canonicalDomain),[v,w]=x.useState(e.country),[S,N]=x.useState(e.language),[C,A]=x.useState(e.ownedDomains??[]),[k,_]=x.useState(""),[T,P]=x.useState(null),[E,z]=x.useState(!1),[D,F]=x.useState(!1),[U,I]=x.useState(""),[ae,ve]=x.useState(""),[me,G]=x.useState(""),[re,ge]=x.useState(""),[Se,B]=x.useState("");x.useEffect(()=>{r||(m(e.displayName),y(e.canonicalDomain),w(e.country),N(e.language),A(e.ownedDomains??[]))},[e,r]);function R(){i(!1),f(null),m(e.displayName),y(e.canonicalDomain),w(e.country),N(e.language),A(e.ownedDomains??[]),_("")}function H(){const K=k.trim();K&&(C.includes(K)||A([...C,K]),_(""))}function oe(K){A(C.filter(Re=>Re!==K))}async function Q(){if(!(!h.trim()||!g.trim()||!v.trim()||!S.trim())){l(!0),f(null);try{await t(e.name,{displayName:h.trim(),canonicalDomain:g.trim(),ownedDomains:C,country:v.trim(),language:S.trim()}),i(!1),Xe({title:"Project settings saved",detail:`${h.trim()} was updated.`,tone:"positive",dedupeKey:`project:update:${e.name}`,dedupeMode:"replace"})}catch(K){f(K instanceof Error?K.message:"Failed to save")}finally{l(!1)}}}async function X(){const K=U.trim(),Re=ae.trim(),Ee=me.trim(),it=re.trim();if(!(!K||!Re||!Ee||!it)){z(!0),P(null);try{const rt={label:K,city:Re,region:Ee,country:it};Se.trim()&&(rt.timezone=Se.trim()),await Nq(e.name,rt),n(),I(""),ve(""),G(""),ge(""),B(""),F(!1),Xe({title:"Location added",detail:`${K} is now available for ${e.name}.`,tone:"positive",dedupeKey:`project:location:add:${e.name}:${K}`,dedupeMode:"drop"})}catch(rt){P(rt instanceof Error?rt.message:"Failed to add location")}finally{z(!1)}}}async function W(K){z(!0),P(null);try{await Cq(e.name,K),n(),Xe({title:"Location removed",detail:`${K} was removed from ${e.name}.`,tone:"positive",dedupeKey:`project:location:remove:${e.name}:${K}`,dedupeMode:"drop"})}catch(Re){P(Re instanceof Error?Re.message:"Failed to remove location")}finally{z(!1)}}async function le(K){z(!0),P(null);try{await _q(e.name,K),n(),Xe({title:"Default location updated",detail:`${K} is now the default for ${e.name}.`,tone:"positive",dedupeKey:`project:location:default:${e.name}`,dedupeMode:"replace"})}catch(Re){P(Re instanceof Error?Re.message:"Failed to set default location")}finally{z(!1)}}const ye=h!==e.displayName||g!==e.canonicalDomain||v!==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",ce="block text-xs font-medium text-zinc-400 mb-1",be=U.trim()&&ae.trim()&&me.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(pe,{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:ce,children:"Display name"}),u.jsx("input",{className:Z,type:"text",value:h,onChange:K=>m(K.target.value),placeholder:"My Project"})]}),u.jsxs("div",{children:[u.jsx("label",{className:ce,children:"Canonical domain"}),u.jsx("input",{className:Z,type:"text",value:g,onChange:K=>y(K.target.value),placeholder:"example.com"})]}),u.jsxs("div",{children:[u.jsx("label",{className:ce,children:"Country"}),u.jsx("input",{className:Z,type:"text",value:v,onChange:K=>w(K.target.value),placeholder:"US",maxLength:2})]}),u.jsxs("div",{children:[u.jsx("label",{className:ce,children:"Language"}),u.jsx("input",{className:Z,type:"text",value:S,onChange:K=>N(K.target.value),placeholder:"en"})]})]}),u.jsxs("div",{children:[u.jsx("label",{className:ce,children:"Owned domains"}),u.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:C.map(K=>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:[K,u.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>oe(K),"aria-label":`Remove ${K}`,children:"×"})]},K))}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{className:`${Z} flex-1`,type:"text",placeholder:"docs.example.com",value:k,onChange:K=>_(K.target.value),onKeyDown:K=>K.key==="Enter"&&(K.preventDefault(),H())}),u.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:!k.trim(),onClick:H,children:"Add"})]})]}),u.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[u.jsx(pe,{type:"button",disabled:s||!ye||!h.trim()||!g.trim(),onClick:Q,children:s?"Saving...":"Save changes"}),u.jsx(pe,{type:"button",variant:"outline",disabled:s,onClick:R,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(K=>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:K},K))}):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(K=>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 ${K.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:[K.label,K.label===e.defaultLocation?" ★":""]})}),u.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:K.city}),u.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:K.region}),u.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:K.country}),u.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:K.timezone??"—"}),u.jsx("td",{className:"py-1.5",children:u.jsxs("div",{className:"flex items-center gap-1.5",children:[K.label!==e.defaultLocation&&u.jsx("button",{type:"button",disabled:E,onClick:()=>le(K.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${K.label} as default location`,children:"Set default"}),u.jsx("button",{type:"button",disabled:E,onClick:()=>W(K.label),className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${K.label}`,children:"Remove"})]})})]},K.label))})]}):u.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),D?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:K=>I(K.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:K=>ve(K.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:me,onChange:K=>G(K.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:K=>ge(K.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:Se,onChange:K=>B(K.target.value),placeholder:"America/New_York"})]})]}),u.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[u.jsx(pe,{type:"button",size:"sm",disabled:E||!be,onClick:X,children:E?"Adding...":"Add location"}),u.jsx(pe,{type:"button",size:"sm",variant:"outline",disabled:E,onClick:()=>{F(!1),P(null)},children:"Cancel"})]})]}):u.jsx(pe,{type:"button",size:"sm",variant:"outline",onClick:()=>F(!0),children:"+ Add location"})]})]})]})})})]})}const Ege=[{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"}],Iz=["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 Tge({projectName:e}){const[t,n]=x.useState("loading"),[r,i]=x.useState(!1),[s,l]=x.useState("daily"),[c,f]=x.useState(6),[h,m]=x.useState(""),[g,y]=x.useState("UTC"),[v,w]=x.useState(!1),[S,N]=x.useState(""),[C,A]=x.useState(!1),[k,_]=x.useState(!1),[T,P]=x.useState(null);x.useEffect(()=>{Mq(e).then(n).catch(()=>n(null))},[e]);const E=()=>{if(t&&t!=="loading"){const U=aF(t.preset??null,t.cronExpr);l(U.freq),f(U.hour),m(U.customCron);const I=Iz.includes(t.timezone);y(I?t.timezone:"Other"),w(!I),N(I?"":t.timezone)}else l("daily"),f(6),m(""),y("UTC"),w(!1),N("");P(null),i(!0)},z=async()=>{A(!0),P(null);try{const I={timezone:v?S.trim()||"UTC":g};s==="custom"?I.cron=h.trim():I.preset=iF(s,c);const ae=await $k(e,I);n(ae),i(!1),Xe({title:"Schedule saved",detail:W0(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{A(!1)}},D=async()=>{if(!(!t||t==="loading")){A(!0),P(null);try{const U={timezone:t.timezone,enabled:!t.enabled};t.preset?U.preset=t.preset:U.cron=t.cronExpr;const I=await $k(e,U);n(I),Xe({title:I.enabled?"Schedule resumed":"Schedule paused",detail:W0(I.preset??null,I.cronExpr,I.timezone),tone:"positive",dedupeKey:`schedule:toggle:${e}`,dedupeMode:"replace"})}catch(U){P(U instanceof Error?U.message:"Failed to update schedule")}finally{A(!1)}}},F=async()=>{_(!0),P(null);try{await Rq(e),n(null),i(!1),Xe({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{_(!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(pe,{type:"button",variant:"outline",size:"sm",onClick:E,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&u.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!r&&t===null&&u.jsx(Ue,{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(Ue,{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:W0(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(yt,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),u.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:C,onClick:D,children:t.enabled?"Pause":"Resume"}),u.jsx(pe,{type:"button",variant:"ghost",size:"sm",disabled:k,onClick:F,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:Ege.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,I)=>u.jsx("option",{value:I,children:sw(I)},I))})]})]}),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=>m(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:v?"Other":g,onChange:U=>{U.target.value==="Other"?(w(!0),y("Other")):(w(!1),y(U.target.value))},children:[Iz.map(U=>u.jsx("option",{value:U,children:U},U)),u.jsxs("option",{value:"Other",children:["Other (enter manually)","…"]})]}),v&&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(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),P(null)},children:"Cancel"}),u.jsx(pe,{type:"button",size:"sm",disabled:C||s==="custom"&&!h.trim(),onClick:z,children:C?"Saving...":"Save schedule"})]})]})]})}const Pge=[{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 zge({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,m]=x.useState(!1),[g,y]=x.useState(null),[v,w]=x.useState({});x.useEffect(()=>{Dq(e).then(n).catch(()=>n([]))},[e]);const S=k=>{f(_=>_.includes(k)?_.filter(T=>T!==k):[..._,k])},N=async()=>{if(!(!s.trim()||c.length===0)){m(!0),y(null);try{const k=await Lq(e,{channel:"webhook",url:s.trim(),events:c});n(_=>_==="loading"?[k]:[..._,k]),l(""),f(["citation.lost","citation.gained"]),i(!1),Xe({title:"Webhook added",detail:`Notifications will be sent to ${k.url}.`,tone:"positive",dedupeKey:`notification:add:${e}`,dedupeMode:"drop"})}catch(k){y(k instanceof Error?k.message:"Failed to add webhook")}finally{m(!1)}}},C=async k=>{try{await Iq(e,k),n(_=>_==="loading"?_:_.filter(T=>T.id!==k)),Xe({title:"Webhook removed",detail:`${e} no longer sends notifications to this endpoint.`,tone:"positive",dedupeKey:`notification:remove:${e}:${k}`,dedupeMode:"drop"})}catch(_){y(_ instanceof Error?_.message:"Failed to remove webhook")}},A=async k=>{w(_=>({..._,[k]:{state:"testing"}}));try{const _=await $q(e,k);w(T=>({...T,[k]:{state:_.ok?"ok":"fail",status:_.status}})),_.ok&&Xe({title:"Test notification sent",detail:`Webhook returned status ${_.status}.`,tone:"positive",dedupeKey:`notification:test:${e}:${k}`,dedupeMode:"replace"})}catch{w(_=>({..._,[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(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!r),y(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:Pge.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(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),y(null)},children:"Cancel"}),u.jsx(pe,{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(Ue,{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(_=>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:_.replace("."," ")},_))})}),u.jsx("td",{children:u.jsx(yt,{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:[v[k.id]&&(()=>{const _=v[k.id],T=_.state==="testing"?"Sending…":_.state==="ok"?`Delivered${_.status?` (${_.status})`:""}`:`Failed${_.status?` (${_.status})`:""}`;return u.jsx(yt,{tone:_.state==="ok"?"positive":_.state==="fail"?"negative":"neutral",children:T})})(),u.jsx(pe,{variant:"ghost",size:"sm",type:"button",disabled:v[k.id]?.state==="testing",onClick:()=>A(k.id),children:"Test"}),u.jsx(pe,{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 Mge({projectName:e,refreshNonce:t}){const[n,r]=x.useState(null),[i,s]=x.useState([]),[l,c]=x.useState(null),[f,h]=x.useState([]),[m,g]=x.useState([]),[y,v]=x.useState(null),[w,S]=x.useState(""),[N,C]=x.useState(""),[A,k]=x.useState(""),[_,T]=x.useState(!0),[P,E]=x.useState(!1),[z,D]=x.useState(null),[F,U]=x.useState("coverage");x.useEffect(()=>{I()},[e,t]);async function I(){T(!0),D(null);try{const B=await EM(e);if(r(B),B.connected){const[R,H,oe,Q]=await Promise.all([HS(e).catch(()=>null),TM(e).catch(()=>[]),o9(e).catch(()=>[]),B.siteUrl?Promise.resolve([]):a9(e).then(X=>X.sites).catch(()=>[])]);c(R),h(H),g(oe),s(Q)}else c(null),h([]),g([]),s([])}catch(B){D(B instanceof Error?B.message:"Failed to load Bing data")}finally{T(!1)}}async function ae(){if(N.trim()){D(null);try{const B=await r9(e,N.trim());C(""),B.availableSites.length>0&&s(B.availableSites),await I()}catch(B){D(B instanceof Error?B.message:"Failed to connect")}}}async function ve(){try{await i9(e),r(null),s([]),c(null),h([]),g([]),v(null),k(""),D(null)}catch(B){D(B instanceof Error?B.message:"Failed to disconnect")}}async function me(){if(A)try{await s9(e,A),await I()}catch(B){D(B instanceof Error?B.message:"Failed to set site")}}async function G(){if(w.trim())try{const B=await PM(e,w.trim());v(B),h(R=>[B,...R])}catch(B){D(B instanceof Error?B.message:"Inspection failed")}}async function re(B){E(!0),D(null);try{const R=await qk(e,{urls:[B]}),{succeeded:H,failed:oe,total:Q}=R.summary;Xe({title:"Bing submission requested",detail:oe===0?`${H} URL submitted to Bing.`:`${H}/${Q} submitted successfully, ${oe} failed.`,tone:oe===0?"positive":"caution",dedupeKey:`bing:indexing:${e}:${B}`,dedupeMode:"replace"})}catch(R){const H=R instanceof Error?R.message:"Submission failed";D(H),Xe({title:"Bing submission failed",detail:H,tone:"negative",dedupeKey:`bing:indexing:${e}:${B}`,dedupeMode:"replace"})}finally{E(!1)}}async function ge(){E(!0),D(null),Xe({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 qk(e,{allUnindexed:!0}),{succeeded:R,failed:H,total:oe}=B.summary;Xe({title:"Bing submissions requested",detail:H===0?`${R}/${oe} URL${oe!==1?"s":""} submitted to Bing.`:`${R}/${oe} submitted successfully, ${H} failed.`,tone:H===0?"positive":"caution",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}catch(B){const R=B instanceof Error?B.message:"Batch submission failed";D(R),Xe({title:"Bing submissions failed",detail:R,tone:"negative",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}finally{E(!1)}}if(_)return u.jsx(Ue,{className:"surface-card",children:u.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!n?.connected)return u.jsxs(Ue,{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(yt,{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(pe,{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(Ue,{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(yt,{tone:"positive",children:"Connected"}),u.jsx(pe,{size:"sm",variant:"ghost",onClick:ve,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?di(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:A,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(pe,{size:"sm",disabled:!A,onClick:me,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 Se=[{key:"coverage",label:"Coverage"},{key:"inspections",label:"Inspections"},{key:"performance",label:"Performance"}];return u.jsxs("div",{className:"space-y-3",children:[u.jsxs(Ue,{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(yt,{tone:"positive",children:"Connected"}),u.jsx(pe,{size:"sm",variant:"ghost",onClick:ve,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?di(n.updatedAt):"—"})]})]})]})]}),u.jsxs(Ue,{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 ${di(l.lastInspectedAt)}`:"No inspection history yet"})]}),u.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:Se.map(B=>u.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${F===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))}),F==="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(lp,{label:"Indexed",value:l.summary.indexed,tone:"positive"}),u.jsx(lp,{label:"Not in index",value:l.summary.notIndexed+(l.summary.unknown??0),tone:"negative"}),u.jsx(lp,{label:"Status unknown",value:l.summary.unknown??0,tone:"neutral"}),u.jsx(lp,{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(pe,{size:"sm",variant:"ghost",disabled:P,onClick:ge,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(pe,{size:"sm",variant:"ghost",disabled:P,onClick:ge,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?di(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?di(B.lastCrawledDate):"—"})]},B.id))})]})})]})]}),F==="coverage"&&!l&&u.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),F==="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"&&G()}),u.jsx(pe,{size:"sm",disabled:!w.trim(),onClick:G,children:"Inspect"})]}),y&&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:y.url}),u.jsxs("div",{className:"text-zinc-400",children:["In Index: ",u.jsx("span",{className:y.inIndex?"text-emerald-400":"text-rose-400",children:y.inIndex?"Yes":"No"})," · ","HTTP: ",y.httpCode??"—"," · ","Crawled: ",y.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(yt,{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:di(B.inspectedAt)})]},B.id))})]})})]}),F==="performance"&&u.jsx("div",{className:"mt-4",children:m.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:"Clicks"}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Impr"}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:"CTR"}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:"Pos"})]})}),u.jsx("tbody",{children:m.map((B,R)=>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)})]},R))})]})})})]})]})}function Rge({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),[m,g]=x.useState(!1),[y,v]=x.useState(null),[w,S]=x.useState(null),[N,C]=x.useState(!1),[A,k]=x.useState(null),[_,T]=x.useState(null),[P,E]=x.useState(0);async function z(R=!1){R||i(!0),f(null);try{const[H,oe,Q]=await Promise.all([FS().catch(()=>null),kM(e).catch(()=>[]),EM(e).catch(()=>null)]),X=oe.find(ye=>ye.connectionType==="gsc")??null;g(!!H?.google?.configured),C(!!H?.bing?.configured),v(X),k(Q);const[W,le]=await Promise.all([X?KS(e).catch(()=>null):Promise.resolve(null),Q?.connected?HS(e).catch(()=>null):Promise.resolve(null)]);S(W),T(le)}catch(H){f(H instanceof Error?H.message:"Failed to load search console overview")}finally{i(!1)}}async function D(){if(s!=="idle")return;h.current?.abort();const R=new AbortController;h.current=R;const H=R.signal;l("syncing"),f(null);const oe=[];try{async function Q(){if(!y)return;const ye=await AM(e);if(!ye?.id)return;const Z=2e3,be=Date.now()+12e4;for(;Date.now()<be;){if(H.aborted||(await new Promise(Re=>setTimeout(Re,Z)),H.aborted))return;const K=await Oc(ye.id).catch(()=>null);if(!K)break;if(["completed","failed","cancelled"].includes(K.status)){K.status!=="completed"&&oe.push(`Google sync ${K.status}`);break}}}const X=10;async function W(){if(!A?.connected)return;const ye=await TM(e).catch(()=>[]),Z=[...new Set(ye.map(ce=>ce.url))];if(Z.length!==0)for(let ce=0;ce<Z.length;ce+=X){if(H.aborted)return;const be=Z.slice(ce,ce+X),Re=(await Promise.allSettled(be.map(Ee=>PM(e,Ee)))).filter(Ee=>Ee.status==="rejected").length;Re>0&&oe.push(`${Re} Bing inspection(s) failed`)}}const le=await Promise.allSettled([Q(),W()]);for(const ye of le)ye.status==="rejected"&&oe.push(ye.reason instanceof Error?ye.reason.message:"Sync failed");if(H.aborted)return;l("reloading"),await z(!0),E(ye=>ye+1),oe.length>0&&f(`Partial refresh: ${oe.join("; ")}`)}catch(Q){H.aborted||f(Q instanceof Error?Q.message:"Refresh failed")}finally{H.aborted||l("idle")}}x.useEffect(()=>(z(),()=>{h.current?.abort()}),[e]);const F=y?"positive":m?"caution":"negative",U=y?"Connected":m?"Ready to connect":"Needs setup",I=w?`${w.summary.percentage}% indexed`:y?"Awaiting coverage":"No coverage data",ae=w?`${w.summary.notIndexed} not indexed${w.summary.deindexed>0?` · ${w.summary.deindexed} deindexed`:""}`:y?"Run sitemap inspection to populate coverage":m?"Connect Search Console for this domain":"Add Google OAuth credentials in Settings",ve=w?.lastInspectedAt??y?.updatedAt??null,me=A?.connected?"positive":N?"caution":"negative",G=A?.connected?"Connected":N?"Ready to connect":"Needs setup",re=_?`${_.summary.percentage}% indexed`:A?.connected?"Awaiting coverage":"No coverage data",ge=_?_.summary.notIndexed+(_.summary.unknown??0):0,Se=_?`${ge} not in index`:A?.connected?"Inspect URLs to populate coverage":N?"Connect Bing Webmaster Tools for this domain":"Add a Bing API key in Settings",B=_?.lastInspectedAt??A?.updatedAt??null;return u.jsxs("div",{className:"space-y-6",children:[u.jsxs(Ue,{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(pe,{type:"button",variant:"outline",size:"sm",disabled:r||s!=="idle",onClick:()=>{D()},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(hE,{eyebrow:"Google",title:"Google Search Console",status:r?"Loading…":U,tone:r?"neutral":F,targetLabel:"Selected property",targetValue:y?.propertyId??"No property selected",coverageValue:r?"Loading…":I,note:r?"Loading overview…":ae,updatedAt:ve,active:t==="google",onClick:()=>n("google")}),u.jsx(hE,{eyebrow:"Bing",title:"Bing Webmaster Tools",status:r?"Loading…":G,tone:r?"neutral":me,targetLabel:"Selected site",targetValue:A?.siteUrl??"No site selected",coverageValue:r?"Loading…":re,note:r?"Loading overview…":Se,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(([R,H])=>u.jsx("button",{type:"button",role:"tab","aria-selected":t===R,className:`project-subnav-link ${t===R?"project-subnav-link-active":""}`,onClick:()=>n(R),children:H},R))}),t==="google"&&u.jsx(kge,{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(Mge,{projectName:e,refreshNonce:P})]})]})}function Dge({insights:e}){const{openEvidence:t}=Kc(),[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(dg,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${s?"rotate-90":""}`}),u.jsx(yt,{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=>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(Ow,{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(Ad,{provider:c.provider})})]}),u.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 whitespace-nowrap transition-colors",onClick:f=>{f.stopPropagation(),t(c.evidenceId)},children:"View →"})]},c.evidenceId))})]},i.id)})})}function Ny({tab:e}){const{projectId:t}=lg({from:"/projects/$projectId"}),n=Ls(),{dashboard:r,isLoading:i,refetch:s}=il();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=CW(r,t),[c,f]=x.useState(!1),[h,m]=x.useState(!1),[g,y]=x.useState(!1),[v,w]=x.useState(""),[S,N]=x.useState(!1),[C,A]=x.useState(!1),[k,_]=x.useState(""),[T,P]=x.useState(!1),[E,z]=x.useState(!1),[D,F]=x.useState(""),[U,I]=x.useState(!1),[ae,ve]=x.useState(void 0),[me,G]=x.useState(!1),[re,ge]=x.useState(null),[Se,B]=x.useState(!1),R=l?.visibilityEvidence??[],H=l?.project.name??"",oe=l?.project.displayName||l?.project.name||H,Q=y4(),X=x.useMemo(()=>new Set(R.map(he=>he.location??"")),[R]),W=X.has(""),le=x.useMemo(()=>[...X].filter(Boolean),[X]);x.useEffect(()=>{if(ae===void 0||ae===""||!H){ge(null),B(!1);return}B(!0),_M(H,ae).then(he=>{ge(he),B(!1)}).catch(()=>{ge(null),B(!1)})},[ae,H]);const ye=x.useMemo(()=>{if(!re)return null;const he=new Map;for(const Je of re){for(const[xt,xn]of Object.entries(Je.providerRuns??{}))he.set(`${Je.keyword}::${xt}`,xn.map(et=>({runId:et.runId,citationState:et.citationState,createdAt:et.createdAt,answerMentioned:et.answerMentioned,visibilityState:et.visibilityState,visibilityTransition:et.visibilityTransition})));(!Je.providerRuns||Object.keys(Je.providerRuns).length===0)&&he.set(`${Je.keyword}::`,Je.runs.map(xt=>({runId:xt.runId,citationState:xt.citationState,createdAt:xt.createdAt,answerMentioned:xt.answerMentioned,visibilityState:xt.visibilityState,visibilityTransition:xt.visibilityTransition})))}return he},[re]),Z=x.useMemo(()=>{const he=ae!==void 0?R.filter(Je=>ae===""?!Je.location:Je.location===ae):R;return ye?he.map(Je=>{const xt=ye.get(`${Je.keyword}::${Je.provider}`)??ye.get(`${Je.keyword}::`);return xt?{...Je,runHistory:xt}:Je}):he},[R,ae,ye]);if(!l)return u.jsx("div",{className:"page-container",children:u.jsxs(Ue,{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(pe,{asChild:!0,children:u.jsx(Rt,{to:"/",children:"Return to overview"})})]})});async function ce(){try{await Q.mutateAsync({projectName:H,projectLabel:oe,sourceAction:"project-run"}),s()}catch{}}async function be(){m(!0);try{await Oq(H),Xe({title:"Project deleted",detail:`${oe} was removed.`,tone:"positive",dedupeKey:`project:delete:${H}`,dedupeMode:"drop"}),n({to:"/"}),s()}catch(he){console.error("Failed to delete project:",he)}finally{m(!1)}}async function K(){const he=await kq(H),Je=typeof he=="string"?he:JSON.stringify(he,null,2),xt=new Blob([Je],{type:"text/yaml"}),xn=URL.createObjectURL(xt),et=document.createElement("a");et.href=xn,et.download=`${H}.yaml`,et.click()}async function Re(){const he=v.split(`
272
+ `).map(Je=>Je.trim()).filter(Boolean);if(he.length!==0){N(!0);try{await wq(H,he),s(),w(""),y(!1)}finally{N(!1)}}}async function Ee(){const he=k.trim();if(he){P(!0);try{const xt=(await CM(H)).map(et=>et.domain),xn=[...new Set([...xt,he])];await OM(H,xn),s(),_(""),A(!1)}finally{P(!1)}}}async function it(){const he=D.trim();if(he){I(!0);try{const Je=l?.project.ownedDomains??[];await Ik(H,[...Je,he]),s(),F(""),z(!1)}finally{I(!1)}}}async function rt(he){I(!0);try{const Je=l?.project.ownedDomains??[];await Ik(H,Je.filter(xt=>xt!==he)),s()}finally{I(!1)}}async function rn(he,Je){await Sq(he,Je),s()}const dn=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(Ue,{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(pe,{type:"button",variant:"destructive",disabled:h,onClick:be,children:h?"Deleting...":"Yes, delete project"}),u.jsx(pe,{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&&!E&&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||E)&&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:()=>rt(he),"aria-label":`Remove ${he}`,children:"×"})]},he)),E?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:D,onChange:he=>F(he.target.value),onKeyDown:he=>he.key==="Enter"&&it(),autoFocus:!0}),u.jsx(pe,{type:"button",size:"sm",disabled:!D.trim()||U,onClick:it,children:U?"...":"Add"}),u.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{z(!1),F("")},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(pe,{type:"button",variant:"outline",size:"icon",onClick:K,"aria-label":"Export project as YAML",children:u.jsx(A9,{className:"h-4 w-4 text-zinc-400"})}),u.jsx(pe,{type:"button",variant:"outline",size:"icon",onClick:()=>f(!0),"aria-label":"Delete project",children:u.jsx(Y9,{className:"h-4 w-4 text-zinc-400"})}),u.jsx(pe,{type:"button",disabled:Q.isPending,onClick:ce,children:Q.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(hL,{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:dn(l.visibilitySummary.value),progress:l.visibilitySummary.progress}),u.jsxs("div",{className:"metric-card",children:[u.jsxs("p",{className:"metric-card-eyebrow",children:["Gap Key Phrases",u.jsx(Yn,{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(Yn,{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(Yn,{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(Yn,{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(Ad,{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(Dge,{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(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>y(!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:v,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:[v.split(`
273
+ `).filter(he=>he.trim()).length," key phrases"]}),u.jsx(pe,{type:"button",size:"sm",disabled:!v.trim()||S,onClick:Re,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:()=>{ve(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:()=>{ve(he.label),G(!1)},children:he.label},he.label)),W&&u.jsx("button",{className:`filter-chip ${ae===""?"filter-chip-active":""}`,type:"button","aria-pressed":ae==="",onClick:()=>{ve(""),G(!1)},children:"No location"}),le.length>1&&ae===void 0&&u.jsx("button",{className:`filter-chip filter-chip-compare ${me?"filter-chip-active":""}`,type:"button","aria-pressed":me,onClick:()=>G(he=>!he),title:"Side-by-side location comparison",children:"Compare"})]}),u.jsx(MX,{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(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>A(!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=>_(he.target.value),onKeyDown:he=>he.key==="Enter"&&Ee()}),u.jsx(pe,{type:"button",size:"sm",disabled:!k.trim()||T,onClick:Ee,children:T?"Adding...":"Add"})]}),u.jsx(RX,{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(fL,{run:he},he.id))})]}),u.jsx(Age,{project:{...l.project,displayName:l.project.displayName??l.project.name,defaultLocation:l.project.defaultLocation??null},onUpdateProject:rn,onRefresh:()=>{s()}}),u.jsx(Tge,{projectName:l.project.name}),u.jsx(zge,{projectName:l.project.name})]}):e==="analytics"?u.jsx(IX,{projectName:l.project.name}):e==="traffic"?u.jsx(yge,{projectName:l.project.name}):u.jsx(Rge,{projectName:l.project.name})]})}function Lge(){const{dashboard:e,isLoading:t}=il(),n=Nge();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(pe,{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":hg(f)},f))}),u.jsx("div",{className:"run-list",children:l.length>0?l.map(f=>u.jsx(fL,{run:f},f.id)):u.jsxs(Ue,{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 Ige({providerName:e,keyUrl:t,modelHint:n,onSaved:r}){const i=e.toLowerCase()==="local",[s,l]=x.useState(""),[c,f]=x.useState(""),[h,m]=x.useState(""),[g,y]=x.useState(""),[v,w]=x.useState(""),[S,N]=x.useState(""),[C,A]=x.useState(!1),[k,_]=x.useState(null),[T,P]=x.useState(!1),E=i?c.trim().length>0:s.trim().length>0;async function z(){if(E){A(!0),_(null),P(!1);try{const F=me=>{const G=parseInt(me.trim(),10);return Number.isFinite(G)&&G>0?G:void 0},U={},I=F(g);I!==void 0&&(U.maxConcurrency=I);const ae=F(v);ae!==void 0&&(U.maxRequestsPerMinute=ae);const ve=F(S);ve!==void 0&&(U.maxRequestsPerDay=ve),await Pq(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(""),m(""),y(""),w(""),N(""),P(!0),Xe({title:"Provider updated",detail:`${e} configuration saved.`,tone:"positive",dedupeKey:`settings:provider:${e}`,dedupeMode:"replace"}),r()}catch(F){_(F instanceof Error?F.message:"Failed to update provider")}finally{A(!1)}}}const D=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:F=>f(F.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:F=>l(F.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:D,value:h,onChange:F=>m(F.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:F=>y(F.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:v,onChange:F=>w(F.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:F=>N(F.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(pe,{type:"button",size:"sm",disabled:!E||C,onClick:z,children:C?"Saving...":"Save"})]})}function $ge({onSaved:e}){const[t,n]=x.useState(""),[r,i]=x.useState(""),[s,l]=x.useState(!1),[c,f]=x.useState(null),[h,m]=x.useState(!1),g=t.trim().length>0&&r.trim().length>0;async function y(){if(g){l(!0),f(null),m(!1);try{await zq({clientId:t.trim(),clientSecret:r.trim()}),n(""),i(""),m(!0),Xe({title:"Google OAuth app updated",detail:"Dashboard Google credentials were saved.",tone:"positive",dedupeKey:"settings:google-oauth",dedupeMode:"replace"}),e()}catch(v){f(v instanceof Error?v.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:v=>n(v.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:v=>i(v.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(pe,{type:"button",size:"sm",disabled:!g||s,onClick:y,children:s?"Saving...":"Save Google OAuth app"})]})}function Uge(){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"),[m,g]=x.useState(!1);return x.useEffect(()=>{Uk().then(t).catch(y=>{const v=y instanceof Error?y.message:String(y);v.includes("501")||r(v)})},[]),u.jsxs(Ue,{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(yt,{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(y=>u.jsxs("span",{className:"mr-2",children:[y.name,": ",y.alive?"● alive":"○ idle"]},y.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(pe,{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 y=>{y.preventDefault(),g(!0);try{await n9(l,parseInt(f,10)||9222);const v=await Uk().catch(()=>null);v&&t(v),s(!1),Xe({title:"CDP endpoint saved",detail:`${l}:${parseInt(f,10)||9222} is now configured.`,tone:"positive",dedupeKey:"settings:cdp",dedupeMode:"replace"})}catch(v){r(v instanceof Error?v.message:String(v))}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:y=>c(y.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:y=>h(y.target.value),"aria-label":"CDP port"})]}),u.jsx("div",{children:u.jsx(pe,{type:"submit",size:"sm",disabled:m,children:m?"Saving…":"Save endpoint"})})]})]})}const Bge={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function qge(){const e=ef(),{dashboard:t}=il(),n=t?.settings??e?.dashboard?.settings,s=Ng(!e,e?.health).data??e?.health??Bge,[l,c]=x.useState(null),[f,h]=x.useState(!1),[m,g]=x.useState(!1),[y,v]=x.useState(""),[w,S]=x.useState(!1),[N,C]=x.useState(null),[A,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(_=>u.jsxs(Ue,{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:_.displayName??_.name})]}),u.jsx(yt,{tone:_.state==="ready"?"positive":"caution",children:_.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:_.model})]}),_.quota&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Concurrency"}),u.jsx("dd",{children:_.quota.maxConcurrency})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Rate limit"}),u.jsxs("dd",{children:[_.quota.maxRequestsPerMinute,"/min · ",_.quota.maxRequestsPerDay,"/day"]})]})]})]}),u.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:_.detail}),u.jsx("div",{className:"mt-2",children:u.jsx(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>c(l===_.name?null:_.name),children:l===_.name?"Cancel":_.state==="ready"?_.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),l===_.name&&u.jsx(Ige,{providerName:_.name,keyUrl:_.keyUrl,modelHint:_.modelHint,onSaved:()=>{c(null)}})]},_.name)),u.jsxs(Ue,{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(yt,{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(pe,{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($ge,{onSaved:()=>{h(!1)}})]}),u.jsxs(Ue,{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(yt,{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(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>g(!m),children:m?"Cancel":n.bing.state==="ready"?"Update API key":"Configure Bing"})}),m&&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:y,onChange:_=>v(_.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}),A&&u.jsx("p",{className:"text-xs text-emerald-400",children:"Bing API key updated."}),u.jsx(pe,{type:"button",size:"sm",disabled:!y.trim()||w,onClick:async()=>{if(y.trim()){S(!0),C(null),k(!1);try{await l9(y.trim()),v(""),k(!0),g(!1),Xe({title:"Bing API key updated",detail:"Dashboard Bing credentials were saved.",tone:"positive",dedupeKey:"settings:bing",dedupeMode:"replace"})}catch(_){C(_ instanceof Error?_.message:"Failed to update Bing API key")}finally{S(!1)}}},children:w?"Saving...":"Save Bing API key"})]})]}),u.jsx(Uge,{}),u.jsxs(Ue,{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(yt,{tone:nm(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(yt,{tone:nm(s.workerStatus),children:s.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),u.jsx("section",{className:"page-section",children:u.jsxs(Ue,{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(_=>u.jsx("li",{children:_},_))}),u.jsx("p",{className:"supporting-copy",children:n.bootstrapNote})]})})]}):null}const Fge=[{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 Kge({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 Hge(){const e=ef(),{dashboard:t,isLoading:n,refetch:r}=il(),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(xe=>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"})]},xe))})]})]});const s=i.settings,f=Ng(!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=vQ(i.setup,f,s),m=Ls(),[g,y]=x.useState(0),[v,w]=x.useState(""),[S,N]=x.useState(""),[C,A]=x.useState(""),[k,_]=x.useState("US"),[T,P]=x.useState("en"),[E,z]=x.useState(null),[D,F]=x.useState(null),[U,I]=x.useState(null),[ae,ve]=x.useState(!1),[me,G]=x.useState(""),[re,ge]=x.useState(!1),[Se,B]=x.useState(null),[R,H]=x.useState(!1),oe=s.providerStatuses.filter(xe=>xe.state==="ready"),[Q,X]=x.useState(oe[0]?.name??""),[W,le]=x.useState(5),[ye,Z]=x.useState(!1),[ce,be]=x.useState(null),[K,Re]=x.useState(""),[Ee,it]=x.useState(!1),[rt,rn]=x.useState(null),[dn,Gt]=x.useState(!1),[he,Je]=x.useState(!1),[xt,xn]=x.useState(!1),et=y4(),Ke=v.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),at=me.split(`
274
+ `).map(xe=>xe.trim()).filter(Boolean),Bt=K.split(`
275
+ `).map(xe=>xe.trim()).filter(Boolean),Ye=h.healthChecks.some(xe=>xe.id==="api"&&xe.state==="ready"),cl=async()=>{if(!(!Ke||!C)){ve(!0),I(null);try{const xe=await ug(Ke,{displayName:S||v,canonicalDomain:C,country:k,language:T});z(Ke),F(xe.id),Xe({title:"Project created",detail:`${xe.displayName||xe.name} is ready for setup.`,tone:"positive",dedupeKey:`project:create:${xe.name}`,dedupeMode:"drop"}),r(),y(2)}catch(xe){I(xe instanceof Error?xe.message:"Failed to create project")}finally{ve(!1)}}},tr=async()=>{if(!E)return;const xe=at;if(xe.length!==0){H(!0),B(null);try{await xq(E,xe),ge(!0),r(),y(3)}catch(pr){B(pr instanceof Error?pr.message:"Failed to save key phrases")}finally{H(!1)}}},ft=async()=>{if(!(!E||!Q)){Z(!0),be(null);try{const xe=await Uq(E,Q,W);if(xe.keywords.length>0){const pr=me?me.trimEnd()+`
276
+ `+xe.keywords.join(`
277
+ `):xe.keywords.join(`
278
+ `);G(pr)}}catch(xe){be(xe instanceof Error?xe.message:"Failed to generate key phrases")}finally{Z(!1)}}},au=async()=>{if(!E)return;const xe=Bt;if(xe.length!==0){Gt(!0),rn(null);try{await OM(E,xe),it(!0),r(),y(4)}catch(pr){rn(pr instanceof Error?pr.message:"Failed to save competitors")}finally{Gt(!1)}}},ii=async()=>{if(E){xn(!0);try{await et.mutateAsync({projectName:E,projectLabel:S||v||E,sourceAction:"setup-launch"}),Je(!0),r()}catch{}finally{xn(!1)}}},Nt=()=>y(xe=>Math.max(0,xe-1)),nr=(()=>{switch(g){case 0:return u.jsxs(Ue,{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(xe=>u.jsxs("div",{className:"health-check-row",children:[u.jsxs("div",{children:[u.jsx("p",{className:"run-row-title",children:xe.label}),u.jsx("p",{className:"supporting-copy",children:xe.detail}),xe.id==="provider"&&xe.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(yt,{tone:xe.state==="ready"?"positive":"caution",children:xe.state==="ready"?"Ready":"Attention"})]},xe.id))}),u.jsxs("div",{className:"setup-nav",children:[u.jsx("span",{}),u.jsx(pe,{type:"button",disabled:!Ye,onClick:()=>y(1),children:"Continue"})]})]});case 1:return u.jsxs(Ue,{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"})]}),E?u.jsx(yt,{tone:"positive",children:"Created"}):null]}),E?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:E})," created successfully."]}),u.jsxs("div",{className:"setup-nav",children:[u.jsx(pe,{type:"button",variant:"outline",onClick:Nt,children:"Back"}),u.jsx(pe,{type:"button",onClick:()=>y(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:v,onChange:xe=>w(xe.target.value)}),Ke&&Ke!==v?u.jsxs("p",{className:"supporting-copy",children:["Slug: ",Ke]}):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:xe=>N(xe.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:xe=>A(xe.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:xe=>_(xe.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:xe=>P(xe.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(pe,{type:"button",variant:"outline",onClick:Nt,children:"Back"}),u.jsx(pe,{type:"button",disabled:!Ke||!C||ae,onClick:cl,children:ae?"Creating...":"Create project"})]})]})]});case 2:return u.jsxs(Ue,{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(yt,{tone:"positive",children:[at.length," saved"]}):u.jsxs(yt,{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(xe=>u.jsx("li",{children:xe},xe))}),u.jsxs("div",{className:"setup-nav",children:[u.jsx(pe,{type:"button",variant:"outline",onClick:Nt,children:"Back"}),u.jsx(pe,{type:"button",onClick:()=>y(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:Q,onChange:xe=>X(xe.target.value),children:oe.map(xe=>u.jsxs("option",{value:xe.name,children:[xe.displayName??xe.name,xe.model?` (${xe.model})`:""]},xe.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:W,onChange:xe=>le(Number(xe.target.value)),children:[3,5,10,15,20].map(xe=>u.jsx("option",{value:xe,children:xe},xe))})]}),u.jsx(pe,{type:"button",variant:"outline",disabled:ye||!Q,onClick:ft,children:ye?"Analyzing site...":"Generate"})]}),ce?u.jsx("p",{className:"text-rose-400 text-sm",children:ce}):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:me,onChange:xe=>G(xe.target.value)})]}),Se?u.jsx("p",{className:"text-rose-400 text-sm",children:Se}):null,u.jsxs("div",{className:"setup-nav",children:[u.jsx(pe,{type:"button",variant:"outline",onClick:Nt,children:"Back"}),u.jsx(pe,{type:"button",disabled:at.length===0||R,onClick:tr,children:R?"Saving...":`Save ${at.length} key phrase${at.length!==1?"s":""}`})]})]})]});case 3:return u.jsxs(Ue,{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"})]}),Ee?u.jsx(yt,{tone:"positive",children:"Saved"}):null]}),u.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same key phrases. One per line."}),Ee?u.jsxs("div",{className:"compact-stack",children:[u.jsx("ul",{className:"detail-list",children:Bt.map(xe=>u.jsx("li",{children:xe},xe))}),u.jsxs("div",{className:"setup-nav",children:[u.jsx(pe,{type:"button",variant:"outline",onClick:Nt,children:"Back"}),u.jsx(pe,{type:"button",onClick:()=>y(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:K,onChange:xe=>Re(xe.target.value)})]}),rt?u.jsx("p",{className:"text-rose-400 text-sm",children:rt}):null,u.jsxs("div",{className:"setup-nav",children:[u.jsx(pe,{type:"button",variant:"outline",onClick:Nt,children:"Back"}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(pe,{type:"button",variant:"outline",onClick:()=>y(4),children:"Skip"}),u.jsx(pe,{type:"button",disabled:Bt.length===0||dn,onClick:au,children:dn?"Saving...":`Save ${Bt.length} competitor${Bt.length!==1?"s":""}`})]})]})]})]});case 4:return u.jsxs(Ue,{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(yt,{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(pe,{type:"button",onClick:()=>m({to:D?`/projects/${D}`:"/"}),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:E}),"."]}),u.jsxs("div",{className:"setup-nav",children:[u.jsx(pe,{type:"button",variant:"outline",onClick:Nt,children:"Back"}),u.jsx(pe,{type:"button",disabled:xt,onClick:ii,children:xt?"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(Kge,{current:g,labels:Fge}),u.jsx("section",{className:"setup-wizard",children:nr})]})}function Gge(){return u.jsx("div",{className:"page-container",children:u.jsx("section",{className:"page-section",children:u.jsxs(Ue,{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(pe,{asChild:!0,children:u.jsx(Rt,{to:"/",children:"Return to overview"})})]})})})}function Vge(){return u.jsx(hQ,{children:u.jsx(fQ,{})})}const yi=tq()({component:Vge,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),Zge=ei({getParentRoute:()=>yi,path:"/",component:xQ,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Vr.projects.all);if(t&&t.length===0)throw zS({to:"/setup"})}}),Yge=ei({getParentRoute:()=>yi,path:"/projects",component:PX}),Nf=ei({getParentRoute:()=>yi,path:"/projects/$projectId",component:()=>u.jsx(qS,{})}),Wge=ei({getParentRoute:()=>Nf,path:"/",component:()=>u.jsx(Ny,{tab:"overview"})}),Qge=ei({getParentRoute:()=>Nf,path:"/search-console",component:()=>u.jsx(Ny,{tab:"search-console"})}),Xge=ei({getParentRoute:()=>Nf,path:"/analytics",component:()=>u.jsx(Ny,{tab:"analytics"})}),Jge=ei({getParentRoute:()=>Nf,path:"/traffic",component:()=>u.jsx(Ny,{tab:"traffic"})}),eye=ei({getParentRoute:()=>yi,path:"/runs",component:Lge}),tye=ei({getParentRoute:()=>yi,path:"/settings",component:qge,beforeLoad:({context:e})=>{}}),nye=ei({getParentRoute:()=>yi,path:"/setup",component:Hge,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Vr.projects.all);if(t&&t.length>0)throw zS({to:"/"})}}),rye=ei({getParentRoute:()=>yi,path:"*",component:Gge}),iye=yi.addChildren([Zge,Yge,Nf.addChildren([Wge,Qge,Xge,Jge]),eye,tye,nye,rye]);function aye(e,t){return dq({routeTree:iye,basepath:yw||"/",context:{queryClient:e},...t?.initialEntries})}const v4=w9(),sye=aye(v4),b4=document.getElementById("root");if(!b4)throw new Error("Expected #root element for web app bootstrap.");function oye(){const[e,t]=x.useState(Lk()?"ready":"checking"),[n,r]=x.useState(""),[i,s]=x.useState(""),[l,c]=x.useState(null),[f,h]=x.useState(!1);x.useEffect(()=>{if(Lk())return;let y=!1;return Aq().then(v=>{y||(v.authenticated?t("ready"):t(v.setupRequired?"setup":"login"))}).catch(v=>{y||(c(v instanceof Error?v.message:"Failed to reach the Canonry API"),t("login"))}),()=>{y=!0}},[]);const m=async y=>{if(y.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 Eq(n.trim())).authenticated){c("Setup failed");return}r(""),s(""),t("ready")}catch(v){c(v instanceof Xp||v instanceof Error?v.message:"Setup failed")}finally{h(!1)}},g=async y=>{if(y.preventDefault(),!!n.trim()){h(!0),c(null);try{if(!(await Tq(n.trim())).authenticated){c("Incorrect password");return}r(""),t("ready")}catch(v){c(v instanceof Xp||v instanceof Error?v.message:"Authentication failed")}finally{h(!1)}}};return e==="ready"?u.jsx(cB,{client:v4,children:u.jsx(pq,{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(Ue,{className:"surface-card w-full",children:e==="checking"?u.jsx(zp,{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(vw,{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),u.jsx(bw,{children:"Create a dashboard password"}),u.jsx(xw,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),u.jsx(zp,{children:u.jsxs("form",{className:"space-y-4",onSubmit:m,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:y=>r(y.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:y=>s(y.target.value),placeholder:"Re-enter password"})]}),l?u.jsx("p",{className:"text-sm text-rose-400",children:l}):null,u.jsx(pe,{type:"submit",disabled:f||!n.trim()||!i.trim(),children:f?"Setting up…":"Create password & open dashboard"})]})})]}):u.jsxs(u.Fragment,{children:[u.jsxs(vw,{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),u.jsx(bw,{children:"Sign in to Canonry"}),u.jsx(xw,{children:"Enter your dashboard password to continue."})]}),u.jsx(zp,{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:y=>r(y.target.value),placeholder:"Dashboard password"})]}),l?u.jsx("p",{className:"text-sm text-rose-400",children:l}):null,u.jsx(pe,{type:"submit",disabled:f||!n.trim(),children:f?"Signing in…":"Open dashboard"})]})})]})})})})}I6.createRoot(b4).render(u.jsx(x.StrictMode,{children:u.jsx(oye,{})}));