@ainyc/canonry 4.8.0 → 4.11.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.
- package/assets/assets/{index-DAS6pOry.css → index-CGXCbiM_.css} +1 -1
- package/assets/assets/index-DOcemxPD.js +302 -0
- package/assets/index.html +2 -2
- package/dist/{chunk-QEPFB7UW.js → chunk-5G6WYP2S.js} +1 -1
- package/dist/{chunk-O4VXWABZ.js → chunk-NG2PJHVL.js} +275 -122
- package/dist/{chunk-IJEP6LB4.js → chunk-WWU65YPN.js} +127 -0
- package/dist/{chunk-5KIFQH52.js → chunk-ZR4AVT4T.js} +1 -1
- package/dist/cli.js +5 -5
- package/dist/index.js +4 -4
- package/dist/{intelligence-service-X7CBN7S4.js → intelligence-service-ZFIYBHLQ.js} +2 -2
- package/dist/mcp.js +2 -2
- package/package.json +7 -7
- package/assets/assets/index-C2ZxtVjD.js +0 -302
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
function WH(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 a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{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 a of i)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function pa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var nw={exports:{}},Of={};var Sz;function ZH(){if(Sz)return Of;Sz=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,a){var l=null;if(a!==void 0&&(l=""+a),i.key!==void 0&&(l=""+i.key),"key"in i){a={};for(var u in i)u!=="key"&&(a[u]=i[u])}else a=i;return i=a.ref,{$$typeof:e,type:r,key:l,ref:i!==void 0?i:null,props:a}}return Of.Fragment=t,Of.jsx=n,Of.jsxs=n,Of}var jz;function XH(){return jz||(jz=1,nw.exports=ZH()),nw.exports}var o=XH(),rw={exports:{}},rt={};var Nz;function JH(){if(Nz)return rt;Nz=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"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),g=Symbol.iterator;function v(M){return M===null||typeof M!="object"?null:(M=g&&M[g]||M["@@iterator"],typeof M=="function"?M:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,j={};function k(M,q,D){this.props=M,this.context=q,this.refs=j,this.updater=D||S}k.prototype.isReactComponent={},k.prototype.setState=function(M,q){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,q,"setState")},k.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function E(){}E.prototype=k.prototype;function C(M,q,D){this.props=M,this.context=q,this.refs=j,this.updater=D||S}var A=C.prototype=new E;A.constructor=C,b(A,k.prototype),A.isPureReactComponent=!0;var P=Array.isArray;function O(){}var _={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function $(M,q,D){var G=D.ref;return{$$typeof:e,type:M,key:q,ref:G!==void 0?G:null,props:D}}function F(M,q){return $(M.type,q,M.props)}function U(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function B(M){var q={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(D){return q[D]})}var V=/\/+/g;function X(M,q){return typeof M=="object"&&M!==null&&M.key!=null?B(""+M.key):q.toString(36)}function Z(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(O,O):(M.status="pending",M.then(function(q){M.status==="pending"&&(M.status="fulfilled",M.value=q)},function(q){M.status==="pending"&&(M.status="rejected",M.reason=q)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function H(M,q,D,G,se){var ne=typeof M;(ne==="undefined"||ne==="boolean")&&(M=null);var Ce=!1;if(M===null)Ce=!0;else switch(ne){case"bigint":case"string":case"number":Ce=!0;break;case"object":switch(M.$$typeof){case e:case t:Ce=!0;break;case p:return Ce=M._init,H(Ce(M._payload),q,D,G,se)}}if(Ce)return se=se(M),Ce=G===""?"."+X(M,0):G,P(se)?(D="",Ce!=null&&(D=Ce.replace(V,"$&/")+"/"),H(se,q,D,"",function(pe){return pe})):se!=null&&(U(se)&&(se=F(se,D+(se.key==null||M&&M.key===se.key?"":(""+se.key).replace(V,"$&/")+"/")+Ce)),q.push(se)),1;Ce=0;var je=G===""?".":G+":";if(P(M))for(var ee=0;ee<M.length;ee++)G=M[ee],ne=je+X(G,ee),Ce+=H(G,q,D,ne,se);else if(ee=v(M),typeof ee=="function")for(M=ee.call(M),ee=0;!(G=M.next()).done;)G=G.value,ne=je+X(G,ee++),Ce+=H(G,q,D,ne,se);else if(ne==="object"){if(typeof M.then=="function")return H(Z(M),q,D,G,se);throw q=String(M),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return Ce}function J(M,q,D){if(M==null)return M;var G=[],se=0;return H(M,G,"","",function(ne){return q.call(D,ne,se++)}),G}function oe(M){if(M._status===-1){var q=M._result;q=q(),q.then(function(D){(M._status===0||M._status===-1)&&(M._status=1,M._result=D)},function(D){(M._status===0||M._status===-1)&&(M._status=2,M._result=D)}),M._status===-1&&(M._status=0,M._result=q)}if(M._status===1)return M._result.default;throw M._result}var ye=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},I={map:J,forEach:function(M,q,D){J(M,function(){q.apply(this,arguments)},D)},count:function(M){var q=0;return J(M,function(){q++}),q},toArray:function(M){return J(M,function(q){return q})||[]},only:function(M){if(!U(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return rt.Activity=m,rt.Children=I,rt.Component=k,rt.Fragment=n,rt.Profiler=i,rt.PureComponent=C,rt.StrictMode=r,rt.Suspense=d,rt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,rt.__COMPILER_RUNTIME={__proto__:null,c:function(M){return _.H.useMemoCache(M)}},rt.cache=function(M){return function(){return M.apply(null,arguments)}},rt.cacheSignal=function(){return null},rt.cloneElement=function(M,q,D){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var G=b({},M.props),se=M.key;if(q!=null)for(ne in q.key!==void 0&&(se=""+q.key),q)!T.call(q,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&q.ref===void 0||(G[ne]=q[ne]);var ne=arguments.length-2;if(ne===1)G.children=D;else if(1<ne){for(var Ce=Array(ne),je=0;je<ne;je++)Ce[je]=arguments[je+2];G.children=Ce}return $(M.type,se,G)},rt.createContext=function(M){return M={$$typeof:l,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:a,_context:M},M},rt.createElement=function(M,q,D){var G,se={},ne=null;if(q!=null)for(G in q.key!==void 0&&(ne=""+q.key),q)T.call(q,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(se[G]=q[G]);var Ce=arguments.length-2;if(Ce===1)se.children=D;else if(1<Ce){for(var je=Array(Ce),ee=0;ee<Ce;ee++)je[ee]=arguments[ee+2];se.children=je}if(M&&M.defaultProps)for(G in Ce=M.defaultProps,Ce)se[G]===void 0&&(se[G]=Ce[G]);return $(M,ne,se)},rt.createRef=function(){return{current:null}},rt.forwardRef=function(M){return{$$typeof:u,render:M}},rt.isValidElement=U,rt.lazy=function(M){return{$$typeof:p,_payload:{_status:-1,_result:M},_init:oe}},rt.memo=function(M,q){return{$$typeof:f,type:M,compare:q===void 0?null:q}},rt.startTransition=function(M){var q=_.T,D={};_.T=D;try{var G=M(),se=_.S;se!==null&&se(D,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(O,ye)}catch(ne){ye(ne)}finally{q!==null&&D.types!==null&&(q.types=D.types),_.T=q}},rt.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},rt.use=function(M){return _.H.use(M)},rt.useActionState=function(M,q,D){return _.H.useActionState(M,q,D)},rt.useCallback=function(M,q){return _.H.useCallback(M,q)},rt.useContext=function(M){return _.H.useContext(M)},rt.useDebugValue=function(){},rt.useDeferredValue=function(M,q){return _.H.useDeferredValue(M,q)},rt.useEffect=function(M,q){return _.H.useEffect(M,q)},rt.useEffectEvent=function(M){return _.H.useEffectEvent(M)},rt.useId=function(){return _.H.useId()},rt.useImperativeHandle=function(M,q,D){return _.H.useImperativeHandle(M,q,D)},rt.useInsertionEffect=function(M,q){return _.H.useInsertionEffect(M,q)},rt.useLayoutEffect=function(M,q){return _.H.useLayoutEffect(M,q)},rt.useMemo=function(M,q){return _.H.useMemo(M,q)},rt.useOptimistic=function(M,q){return _.H.useOptimistic(M,q)},rt.useReducer=function(M,q,D){return _.H.useReducer(M,q,D)},rt.useRef=function(M){return _.H.useRef(M)},rt.useState=function(M){return _.H.useState(M)},rt.useSyncExternalStore=function(M,q,D){return _.H.useSyncExternalStore(M,q,D)},rt.useTransition=function(){return _.H.useTransition()},rt.version="19.2.4",rt}var kz;function gd(){return kz||(kz=1,rw.exports=JH()),rw.exports}var x=gd();const Ii=pa(x),xv=WH({__proto__:null,default:Ii},[x]);var iw={exports:{}},Ef={},aw={exports:{}},sw={};var Cz;function eK(){return Cz||(Cz=1,(function(e){function t(H,J){var oe=H.length;H.push(J);e:for(;0<oe;){var ye=oe-1>>>1,I=H[ye];if(0<i(I,J))H[ye]=J,H[oe]=I,oe=ye;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var J=H[0],oe=H.pop();if(oe!==J){H[0]=oe;e:for(var ye=0,I=H.length,M=I>>>1;ye<M;){var q=2*(ye+1)-1,D=H[q],G=q+1,se=H[G];if(0>i(D,oe))G<I&&0>i(se,D)?(H[ye]=se,H[G]=oe,ye=G):(H[ye]=D,H[q]=oe,ye=q);else if(G<I&&0>i(se,oe))H[ye]=se,H[G]=oe,ye=G;else break e}}return J}function i(H,J){var oe=H.sortIndex-J.sortIndex;return oe!==0?oe:H.id-J.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],f=[],p=1,m=null,g=3,v=!1,S=!1,b=!1,j=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function A(H){for(var J=n(f);J!==null;){if(J.callback===null)r(f);else if(J.startTime<=H)r(f),J.sortIndex=J.expirationTime,t(d,J);else break;J=n(f)}}function P(H){if(b=!1,A(H),!S)if(n(d)!==null)S=!0,O||(O=!0,B());else{var J=n(f);J!==null&&Z(P,J.startTime-H)}}var O=!1,_=-1,T=5,$=-1;function F(){return j?!0:!(e.unstable_now()-$<T)}function U(){if(j=!1,O){var H=e.unstable_now();$=H;var J=!0;try{e:{S=!1,b&&(b=!1,E(_),_=-1),v=!0;var oe=g;try{t:{for(A(H),m=n(d);m!==null&&!(m.expirationTime>H&&F());){var ye=m.callback;if(typeof ye=="function"){m.callback=null,g=m.priorityLevel;var I=ye(m.expirationTime<=H);if(H=e.unstable_now(),typeof I=="function"){m.callback=I,A(H),J=!0;break t}m===n(d)&&r(d),A(H)}else r(d);m=n(d)}if(m!==null)J=!0;else{var M=n(f);M!==null&&Z(P,M.startTime-H),J=!1}}break e}finally{m=null,g=oe,v=!1}J=void 0}}finally{J?B():O=!1}}}var B;if(typeof C=="function")B=function(){C(U)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,X=V.port2;V.port1.onmessage=U,B=function(){X.postMessage(null)}}else B=function(){k(U,0)};function Z(H,J){_=k(function(){H(e.unstable_now())},J)}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(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(H){switch(g){case 1:case 2:case 3:var J=3;break;default:J=g}var oe=g;g=J;try{return H()}finally{g=oe}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(H,J){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var oe=g;g=H;try{return J()}finally{g=oe}},e.unstable_scheduleCallback=function(H,J,oe){var ye=e.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?ye+oe:ye):oe=ye,H){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=oe+I,H={id:p++,callback:J,priorityLevel:H,startTime:oe,expirationTime:I,sortIndex:-1},oe>ye?(H.sortIndex=oe,t(f,H),n(d)===null&&H===n(f)&&(b?(E(_),_=-1):b=!0,Z(P,oe-ye))):(H.sortIndex=I,t(d,H),S||v||(S=!0,O||(O=!0,B()))),H},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(H){var J=g;return function(){var oe=g;g=J;try{return H.apply(this,arguments)}finally{g=oe}}}})(sw)),sw}var Az;function tK(){return Az||(Az=1,aw.exports=eK()),aw.exports}var ow={exports:{}},yr={};var Oz;function nK(){if(Oz)return yr;Oz=1;var e=gd();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+f+" 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 a(d,f,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:m==null?null:""+m,children:d,containerInfo:f,implementation:p}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return yr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,yr.createPortal=function(d,f){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return a(d,f,null,p)},yr.flushSync=function(d){var f=l.T,p=r.p;try{if(l.T=null,r.p=2,d)return d()}finally{l.T=f,r.p=p,r.d.f()}},yr.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(d,f))},yr.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},yr.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var p=f.as,m=u(p,f.crossOrigin),g=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?r.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:m,integrity:g,fetchPriority:v}):p==="script"&&r.d.X(d,{crossOrigin:m,integrity:g,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},yr.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=u(f.as,f.crossOrigin);r.d.M(d,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(d)},yr.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,m=u(p,f.crossOrigin);r.d.L(d,p,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},yr.preloadModule=function(d,f){if(typeof d=="string")if(f){var p=u(f.as,f.crossOrigin);r.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(d)},yr.requestFormReset=function(d){r.d.r(d)},yr.unstable_batchedUpdates=function(d,f){return d(f)},yr.useFormState=function(d,f,p){return l.H.useFormState(d,f,p)},yr.useFormStatus=function(){return l.H.useHostTransitionStatus()},yr.version="19.2.4",yr}var Ez;function zL(){if(Ez)return ow.exports;Ez=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(),ow.exports=nK(),ow.exports}var _z;function rK(){if(_z)return Ef;_z=1;var e=tK(),t=gd(),n=zL();function r(s){var c="https://react.dev/errors/"+s;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)c+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+s+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function a(s){var c=s,h=s;if(s.alternate)for(;c.return;)c=c.return;else{s=c;do c=s,(c.flags&4098)!==0&&(h=c.return),s=c.return;while(s)}return c.tag===3?h:null}function l(s){if(s.tag===13){var c=s.memoizedState;if(c===null&&(s=s.alternate,s!==null&&(c=s.memoizedState)),c!==null)return c.dehydrated}return null}function u(s){if(s.tag===31){var c=s.memoizedState;if(c===null&&(s=s.alternate,s!==null&&(c=s.memoizedState)),c!==null)return c.dehydrated}return null}function d(s){if(a(s)!==s)throw Error(r(188))}function f(s){var c=s.alternate;if(!c){if(c=a(s),c===null)throw Error(r(188));return c!==s?null:s}for(var h=s,y=c;;){var w=h.return;if(w===null)break;var N=w.alternate;if(N===null){if(y=w.return,y!==null){h=y;continue}break}if(w.child===N.child){for(N=w.child;N;){if(N===h)return d(w),s;if(N===y)return d(w),c;N=N.sibling}throw Error(r(188))}if(h.return!==y.return)h=w,y=N;else{for(var z=!1,L=w.child;L;){if(L===h){z=!0,h=w,y=N;break}if(L===y){z=!0,y=w,h=N;break}L=L.sibling}if(!z){for(L=N.child;L;){if(L===h){z=!0,h=N,y=w;break}if(L===y){z=!0,y=N,h=w;break}L=L.sibling}if(!z)throw Error(r(189))}}if(h.alternate!==y)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?s:c}function p(s){var c=s.tag;if(c===5||c===26||c===27||c===6)return s;for(s=s.child;s!==null;){if(c=p(s),c!==null)return c;s=s.sibling}return null}var m=Object.assign,g=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),C=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function B(s){return s===null||typeof s!="object"?null:(s=U&&s[U]||s["@@iterator"],typeof s=="function"?s:null)}var V=Symbol.for("react.client.reference");function X(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===V?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case b:return"Fragment";case k:return"Profiler";case j:return"StrictMode";case P:return"Suspense";case O:return"SuspenseList";case $:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case S:return"Portal";case C:return s.displayName||"Context";case E:return(s._context.displayName||"Context")+".Consumer";case A:var c=s.render;return s=s.displayName,s||(s=c.displayName||c.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case _:return c=s.displayName||null,c!==null?c:X(s.type)||"Memo";case T:c=s._payload,s=s._init;try{return X(s(c))}catch{}}return null}var Z=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},ye=[],I=-1;function M(s){return{current:s}}function q(s){0>I||(s.current=ye[I],ye[I]=null,I--)}function D(s,c){I++,ye[I]=s.current,s.current=c}var G=M(null),se=M(null),ne=M(null),Ce=M(null);function je(s,c){switch(D(ne,c),D(se,s),D(G,null),c.nodeType){case 9:case 11:s=(s=c.documentElement)&&(s=s.namespaceURI)?K_(s):0;break;default:if(s=c.tagName,c=c.namespaceURI)c=K_(c),s=G_(c,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}q(G),D(G,s)}function ee(){q(G),q(se),q(ne)}function pe(s){s.memoizedState!==null&&D(Ce,s);var c=G.current,h=G_(c,s.type);c!==h&&(D(se,s),D(G,h))}function Ee(s){se.current===s&&(q(G),q(se)),Ce.current===s&&(q(Ce),Nf._currentValue=oe)}var W,He;function Te(s){if(W===void 0)try{throw Error()}catch(h){var c=h.stack.trim().match(/\n( *(at )?)/);W=c&&c[1]||"",He=-1<h.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+W+s+He}var st=!1;function Ve(s,c){if(!s||st)return"";st=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var y={DetermineComponentFrameRoot:function(){try{if(c){var we=function(){throw Error()};if(Object.defineProperty(we.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(we,[])}catch(ue){var le=ue}Reflect.construct(s,[],we)}else{try{we.call()}catch(ue){le=ue}s.call(we.prototype)}}else{try{throw Error()}catch(ue){le=ue}(we=s())&&typeof we.catch=="function"&&we.catch(function(){})}}catch(ue){if(ue&&le&&typeof ue.stack=="string")return[ue.stack,le.stack]}return[null,null]}};y.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var w=Object.getOwnPropertyDescriptor(y.DetermineComponentFrameRoot,"name");w&&w.configurable&&Object.defineProperty(y.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var N=y.DetermineComponentFrameRoot(),z=N[0],L=N[1];if(z&&L){var K=z.split(`
|
|
4
|
-
`),ae=L.split(`
|
|
5
|
-
`);for(w=y=0;y<K.length&&!K[y].includes("DetermineComponentFrameRoot");)y++;for(;w<ae.length&&!ae[w].includes("DetermineComponentFrameRoot");)w++;if(y===K.length||w===ae.length)for(y=K.length-1,w=ae.length-1;1<=y&&0<=w&&K[y]!==ae[w];)w--;for(;1<=y&&0<=w;y--,w--)if(K[y]!==ae[w]){if(y!==1||w!==1)do if(y--,w--,0>w||K[y]!==ae[w]){var me=`
|
|
6
|
-
`+K[y].replace(" at new "," at ");return s.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",s.displayName)),me}while(1<=y&&0<=w);break}}}finally{st=!1,Error.prepareStackTrace=h}return(h=s?s.displayName||s.name:"")?Te(h):""}function Ht(s,c){switch(s.tag){case 26:case 27:case 5:return Te(s.type);case 16:return Te("Lazy");case 13:return s.child!==c&&c!==null?Te("Suspense Fallback"):Te("Suspense");case 19:return Te("SuspenseList");case 0:case 15:return Ve(s.type,!1);case 11:return Ve(s.type.render,!1);case 1:return Ve(s.type,!0);case 31:return Te("Activity");default:return""}}function Lt(s){try{var c="",h=null;do c+=Ht(s,h),h=s,s=s.return;while(s);return c}catch(y){return`
|
|
7
|
-
Error generating stack: `+y.message+`
|
|
8
|
-
`+y.stack}}var un=Object.prototype.hasOwnProperty,tn=e.unstable_scheduleCallback,Se=e.unstable_cancelCallback,Ze=e.unstable_shouldYield,Tt=e.unstable_requestPaint,mt=e.unstable_now,Je=e.unstable_getCurrentPriorityLevel,ce=e.unstable_ImmediatePriority,Ne=e.unstable_UserBlockingPriority,Me=e.unstable_NormalPriority,Ge=e.unstable_LowPriority,pt=e.unstable_IdlePriority,mn=e.log,An=e.unstable_setDisableYieldValue,gn=null,Ye=null;function Kt(s){if(typeof mn=="function"&&An(s),Ye&&typeof Ye.setStrictMode=="function")try{Ye.setStrictMode(gn,s)}catch{}}var de=Math.clz32?Math.clz32:Qe,ze=Math.log,fe=Math.LN2;function Qe(s){return s>>>=0,s===0?32:31-(ze(s)/fe|0)|0}var qn=256,bi=262144,nn=4194304;function On(s){var c=s&42;if(c!==0)return c;switch(s&-s){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 s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Lr(s,c,h){var y=s.pendingLanes;if(y===0)return 0;var w=0,N=s.suspendedLanes,z=s.pingedLanes;s=s.warmLanes;var L=y&134217727;return L!==0?(y=L&~N,y!==0?w=On(y):(z&=L,z!==0?w=On(z):h||(h=L&~s,h!==0&&(w=On(h))))):(L=y&~N,L!==0?w=On(L):z!==0?w=On(z):h||(h=y&~s,h!==0&&(w=On(h)))),w===0?0:c!==0&&c!==w&&(c&N)===0&&(N=w&-w,h=c&-c,N>=h||N===32&&(h&4194048)!==0)?c:w}function Zi(s,c){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&c)===0}function ba(s,c){switch(s){case 1:case 2:case 4:case 8:case 64:return c+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 c+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 jp(){var s=nn;return nn<<=1,(nn&62914560)===0&&(nn=4194304),s}function Ks(s){for(var c=[],h=0;31>h;h++)c.push(s);return c}function Gs(s,c){s.pendingLanes|=c,c!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function Qx(s,c,h,y,w,N){var z=s.pendingLanes;s.pendingLanes=h,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=h,s.entangledLanes&=h,s.errorRecoveryDisabledLanes&=h,s.shellSuspendCounter=0;var L=s.entanglements,K=s.expirationTimes,ae=s.hiddenUpdates;for(h=z&~h;0<h;){var me=31-de(h),we=1<<me;L[me]=0,K[me]=-1;var le=ae[me];if(le!==null)for(ae[me]=null,me=0;me<le.length;me++){var ue=le[me];ue!==null&&(ue.lane&=-536870913)}h&=~we}y!==0&&Md(s,y,0),N!==0&&w===0&&s.tag!==0&&(s.suspendedLanes|=N&~(z&~c))}function Md(s,c,h){s.pendingLanes|=c,s.suspendedLanes&=~c;var y=31-de(c);s.entangledLanes|=c,s.entanglements[y]=s.entanglements[y]|1073741824|h&261930}function Np(s,c){var h=s.entangledLanes|=c;for(s=s.entanglements;h;){var y=31-de(h),w=1<<y;w&c|s[y]&c&&(s[y]|=c),h&=~w}}function kp(s,c){var h=c&-c;return h=(h&42)!==0?1:Id(h),(h&(s.suspendedLanes|c))!==0?0:h}function Id(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function Ld(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function $d(){var s=J.p;return s!==0?s:(s=window.event,s===void 0?32:mz(s.type))}function Q(s,c){var h=J.p;try{return J.p=s,c()}finally{J.p=h}}var ke=Math.random().toString(36).slice(2),tt="__reactFiber$"+ke,jt="__reactProps$"+ke,En="__reactContainer$"+ke,wa="__reactEvents$"+ke,Ja="__reactListeners$"+ke,Vs="__reactHandles$"+ke,Or="__reactResources$"+ke,rl="__reactMarker$"+ke;function Sa(s){delete s[tt],delete s[jt],delete s[wa],delete s[Ja],delete s[Vs]}function wi(s){var c=s[tt];if(c)return c;for(var h=s.parentNode;h;){if(c=h[En]||h[tt]){if(h=c.alternate,c.child!==null||h!==null&&h.child!==null)for(s=J_(s);s!==null;){if(h=s[tt])return h;s=J_(s)}return c}s=h,h=s.parentNode}return null}function Xi(s){if(s=s[tt]||s[En]){var c=s.tag;if(c===5||c===6||c===13||c===31||c===26||c===27||c===3)return s}return null}function Qs(s){var c=s.tag;if(c===5||c===26||c===27||c===6)return s.stateNode;throw Error(r(33))}function Ys(s){var c=s[Or];return c||(c=s[Or]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function yn(s){s[rl]=!0}var il=new Set,Cp={};function es(s,c){dt(s,c),dt(s+"Capture",c)}function dt(s,c){for(Cp[s]=c,s=0;s<c.length;s++)il.add(c[s])}var Gt=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]*$"),$r={},Ji={};function Oc(s){return un.call(Ji,s)?!0:un.call($r,s)?!1:Gt.test(s)?Ji[s]=!0:($r[s]=!0,!1)}function al(s,c,h){if(Oc(c))if(h===null)s.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":s.removeAttribute(c);return;case"boolean":var y=c.toLowerCase().slice(0,5);if(y!=="data-"&&y!=="aria-"){s.removeAttribute(c);return}}s.setAttribute(c,""+h)}}function Ap(s,c,h){if(h===null)s.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(c);return}s.setAttribute(c,""+h)}}function ts(s,c,h,y){if(y===null)s.removeAttribute(h);else{switch(typeof y){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(h);return}s.setAttributeNS(c,h,""+y)}}function Si(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function IA(s){var c=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function FF(s,c,h){var y=Object.getOwnPropertyDescriptor(s.constructor.prototype,c);if(!s.hasOwnProperty(c)&&typeof y<"u"&&typeof y.get=="function"&&typeof y.set=="function"){var w=y.get,N=y.set;return Object.defineProperty(s,c,{configurable:!0,get:function(){return w.call(this)},set:function(z){h=""+z,N.call(this,z)}}),Object.defineProperty(s,c,{enumerable:y.enumerable}),{getValue:function(){return h},setValue:function(z){h=""+z},stopTracking:function(){s._valueTracker=null,delete s[c]}}}}function Yx(s){if(!s._valueTracker){var c=IA(s)?"checked":"value";s._valueTracker=FF(s,c,""+s[c])}}function LA(s){if(!s)return!1;var c=s._valueTracker;if(!c)return!0;var h=c.getValue(),y="";return s&&(y=IA(s)?s.checked?"true":"false":s.value),s=y,s!==h?(c.setValue(s),!0):!1}function Op(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var HF=/[\n"\\]/g;function ji(s){return s.replace(HF,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function Wx(s,c,h,y,w,N,z,L){s.name="",z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?s.type=z:s.removeAttribute("type"),c!=null?z==="number"?(c===0&&s.value===""||s.value!=c)&&(s.value=""+Si(c)):s.value!==""+Si(c)&&(s.value=""+Si(c)):z!=="submit"&&z!=="reset"||s.removeAttribute("value"),c!=null?Zx(s,z,Si(c)):h!=null?Zx(s,z,Si(h)):y!=null&&s.removeAttribute("value"),w==null&&N!=null&&(s.defaultChecked=!!N),w!=null&&(s.checked=w&&typeof w!="function"&&typeof w!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?s.name=""+Si(L):s.removeAttribute("name")}function $A(s,c,h,y,w,N,z,L){if(N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(s.type=N),c!=null||h!=null){if(!(N!=="submit"&&N!=="reset"||c!=null)){Yx(s);return}h=h!=null?""+Si(h):"",c=c!=null?""+Si(c):h,L||c===s.value||(s.value=c),s.defaultValue=c}y=y??w,y=typeof y!="function"&&typeof y!="symbol"&&!!y,s.checked=L?s.checked:!!y,s.defaultChecked=!!y,z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"&&(s.name=z),Yx(s)}function Zx(s,c,h){c==="number"&&Op(s.ownerDocument)===s||s.defaultValue===""+h||(s.defaultValue=""+h)}function Ec(s,c,h,y){if(s=s.options,c){c={};for(var w=0;w<h.length;w++)c["$"+h[w]]=!0;for(h=0;h<s.length;h++)w=c.hasOwnProperty("$"+s[h].value),s[h].selected!==w&&(s[h].selected=w),w&&y&&(s[h].defaultSelected=!0)}else{for(h=""+Si(h),c=null,w=0;w<s.length;w++){if(s[w].value===h){s[w].selected=!0,y&&(s[w].defaultSelected=!0);return}c!==null||s[w].disabled||(c=s[w])}c!==null&&(c.selected=!0)}}function BA(s,c,h){if(c!=null&&(c=""+Si(c),c!==s.value&&(s.value=c),h==null)){s.defaultValue!==c&&(s.defaultValue=c);return}s.defaultValue=h!=null?""+Si(h):""}function UA(s,c,h,y){if(c==null){if(y!=null){if(h!=null)throw Error(r(92));if(Z(y)){if(1<y.length)throw Error(r(93));y=y[0]}h=y}h==null&&(h=""),c=h}h=Si(c),s.defaultValue=h,y=s.textContent,y===h&&y!==""&&y!==null&&(s.value=y),Yx(s)}function _c(s,c){if(c){var h=s.firstChild;if(h&&h===s.lastChild&&h.nodeType===3){h.nodeValue=c;return}}s.textContent=c}var KF=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 qA(s,c,h){var y=c.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?y?s.setProperty(c,""):c==="float"?s.cssFloat="":s[c]="":y?s.setProperty(c,h):typeof h!="number"||h===0||KF.has(c)?c==="float"?s.cssFloat=h:s[c]=(""+h).trim():s[c]=h+"px"}function FA(s,c,h){if(c!=null&&typeof c!="object")throw Error(r(62));if(s=s.style,h!=null){for(var y in h)!h.hasOwnProperty(y)||c!=null&&c.hasOwnProperty(y)||(y.indexOf("--")===0?s.setProperty(y,""):y==="float"?s.cssFloat="":s[y]="");for(var w in c)y=c[w],c.hasOwnProperty(w)&&h[w]!==y&&qA(s,w,y)}else for(var N in c)c.hasOwnProperty(N)&&qA(s,N,c[N])}function Xx(s){if(s.indexOf("-")===-1)return!1;switch(s){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 GF=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"]]),VF=/^[\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 Ep(s){return VF.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function ns(){}var Jx=null;function e0(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var zc=null,Pc=null;function HA(s){var c=Xi(s);if(c&&(s=c.stateNode)){var h=s[jt]||null;e:switch(s=c.stateNode,c.type){case"input":if(Wx(s,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),c=h.name,h.type==="radio"&&c!=null){for(h=s;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+ji(""+c)+'"][type="radio"]'),c=0;c<h.length;c++){var y=h[c];if(y!==s&&y.form===s.form){var w=y[jt]||null;if(!w)throw Error(r(90));Wx(y,w.value,w.defaultValue,w.defaultValue,w.checked,w.defaultChecked,w.type,w.name)}}for(c=0;c<h.length;c++)y=h[c],y.form===s.form&&LA(y)}break e;case"textarea":BA(s,h.value,h.defaultValue);break e;case"select":c=h.value,c!=null&&Ec(s,!!h.multiple,c,!1)}}}var t0=!1;function KA(s,c,h){if(t0)return s(c,h);t0=!0;try{var y=s(c);return y}finally{if(t0=!1,(zc!==null||Pc!==null)&&(gm(),zc&&(c=zc,s=Pc,Pc=zc=null,HA(c),s)))for(c=0;c<s.length;c++)HA(s[c])}}function Bd(s,c){var h=s.stateNode;if(h===null)return null;var y=h[jt]||null;if(y===null)return null;h=y[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(s=s.type,y=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!y;break e;default:s=!1}if(s)return null;if(h&&typeof h!="function")throw Error(r(231,c,typeof h));return h}var rs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),n0=!1;if(rs)try{var Ud={};Object.defineProperty(Ud,"passive",{get:function(){n0=!0}}),window.addEventListener("test",Ud,Ud),window.removeEventListener("test",Ud,Ud)}catch{n0=!1}var Ws=null,r0=null,_p=null;function GA(){if(_p)return _p;var s,c=r0,h=c.length,y,w="value"in Ws?Ws.value:Ws.textContent,N=w.length;for(s=0;s<h&&c[s]===w[s];s++);var z=h-s;for(y=1;y<=z&&c[h-y]===w[N-y];y++);return _p=w.slice(s,1<y?1-y:void 0)}function zp(s){var c=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&c===13&&(s=13)):s=c,s===10&&(s=13),32<=s||s===13?s:0}function Pp(){return!0}function VA(){return!1}function Br(s){function c(h,y,w,N,z){this._reactName=h,this._targetInst=w,this.type=y,this.nativeEvent=N,this.target=z,this.currentTarget=null;for(var L in s)s.hasOwnProperty(L)&&(h=s[L],this[L]=h?h(N):N[L]);return this.isDefaultPrevented=(N.defaultPrevented!=null?N.defaultPrevented:N.returnValue===!1)?Pp:VA,this.isPropagationStopped=VA,this}return m(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=Pp)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=Pp)},persist:function(){},isPersistent:Pp}),c}var sl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Tp=Br(sl),qd=m({},sl,{view:0,detail:0}),QF=Br(qd),i0,a0,Fd,Rp=m({},qd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:o0,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Fd&&(Fd&&s.type==="mousemove"?(i0=s.screenX-Fd.screenX,a0=s.screenY-Fd.screenY):a0=i0=0,Fd=s),i0)},movementY:function(s){return"movementY"in s?s.movementY:a0}}),QA=Br(Rp),YF=m({},Rp,{dataTransfer:0}),WF=Br(YF),ZF=m({},qd,{relatedTarget:0}),s0=Br(ZF),XF=m({},sl,{animationName:0,elapsedTime:0,pseudoElement:0}),JF=Br(XF),e9=m({},sl,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),t9=Br(e9),n9=m({},sl,{data:0}),YA=Br(n9),r9={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},i9={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"},a9={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function s9(s){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(s):(s=a9[s])?!!c[s]:!1}function o0(){return s9}var o9=m({},qd,{key:function(s){if(s.key){var c=r9[s.key]||s.key;if(c!=="Unidentified")return c}return s.type==="keypress"?(s=zp(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?i9[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:o0,charCode:function(s){return s.type==="keypress"?zp(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?zp(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),l9=Br(o9),c9=m({},Rp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),WA=Br(c9),u9=m({},qd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:o0}),d9=Br(u9),f9=m({},sl,{propertyName:0,elapsedTime:0,pseudoElement:0}),h9=Br(f9),p9=m({},Rp,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),m9=Br(p9),g9=m({},sl,{newState:0,oldState:0}),y9=Br(g9),v9=[9,13,27,32],l0=rs&&"CompositionEvent"in window,Hd=null;rs&&"documentMode"in document&&(Hd=document.documentMode);var x9=rs&&"TextEvent"in window&&!Hd,ZA=rs&&(!l0||Hd&&8<Hd&&11>=Hd),XA=" ",JA=!1;function eO(s,c){switch(s){case"keyup":return v9.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function tO(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Tc=!1;function b9(s,c){switch(s){case"compositionend":return tO(c);case"keypress":return c.which!==32?null:(JA=!0,XA);case"textInput":return s=c.data,s===XA&&JA?null:s;default:return null}}function w9(s,c){if(Tc)return s==="compositionend"||!l0&&eO(s,c)?(s=GA(),_p=r0=Ws=null,Tc=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return ZA&&c.locale!=="ko"?null:c.data;default:return null}}var S9={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 nO(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c==="input"?!!S9[s.type]:c==="textarea"}function rO(s,c,h,y){zc?Pc?Pc.push(y):Pc=[y]:zc=y,c=jm(c,"onChange"),0<c.length&&(h=new Tp("onChange","change",null,h,y),s.push({event:h,listeners:c}))}var Kd=null,Gd=null;function j9(s){$_(s,0)}function Dp(s){var c=Qs(s);if(LA(c))return s}function iO(s,c){if(s==="change")return c}var aO=!1;if(rs){var c0;if(rs){var u0="oninput"in document;if(!u0){var sO=document.createElement("div");sO.setAttribute("oninput","return;"),u0=typeof sO.oninput=="function"}c0=u0}else c0=!1;aO=c0&&(!document.documentMode||9<document.documentMode)}function oO(){Kd&&(Kd.detachEvent("onpropertychange",lO),Gd=Kd=null)}function lO(s){if(s.propertyName==="value"&&Dp(Gd)){var c=[];rO(c,Gd,s,e0(s)),KA(j9,c)}}function N9(s,c,h){s==="focusin"?(oO(),Kd=c,Gd=h,Kd.attachEvent("onpropertychange",lO)):s==="focusout"&&oO()}function k9(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Dp(Gd)}function C9(s,c){if(s==="click")return Dp(c)}function A9(s,c){if(s==="input"||s==="change")return Dp(c)}function O9(s,c){return s===c&&(s!==0||1/s===1/c)||s!==s&&c!==c}var ri=typeof Object.is=="function"?Object.is:O9;function Vd(s,c){if(ri(s,c))return!0;if(typeof s!="object"||s===null||typeof c!="object"||c===null)return!1;var h=Object.keys(s),y=Object.keys(c);if(h.length!==y.length)return!1;for(y=0;y<h.length;y++){var w=h[y];if(!un.call(c,w)||!ri(s[w],c[w]))return!1}return!0}function cO(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function uO(s,c){var h=cO(s);s=0;for(var y;h;){if(h.nodeType===3){if(y=s+h.textContent.length,s<=c&&y>=c)return{node:h,offset:c-s};s=y}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=cO(h)}}function dO(s,c){return s&&c?s===c?!0:s&&s.nodeType===3?!1:c&&c.nodeType===3?dO(s,c.parentNode):"contains"in s?s.contains(c):s.compareDocumentPosition?!!(s.compareDocumentPosition(c)&16):!1:!1}function fO(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var c=Op(s.document);c instanceof s.HTMLIFrameElement;){try{var h=typeof c.contentWindow.location.href=="string"}catch{h=!1}if(h)s=c.contentWindow;else break;c=Op(s.document)}return c}function d0(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c&&(c==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||c==="textarea"||s.contentEditable==="true")}var E9=rs&&"documentMode"in document&&11>=document.documentMode,Rc=null,f0=null,Qd=null,h0=!1;function hO(s,c,h){var y=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;h0||Rc==null||Rc!==Op(y)||(y=Rc,"selectionStart"in y&&d0(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),Qd&&Vd(Qd,y)||(Qd=y,y=jm(f0,"onSelect"),0<y.length&&(c=new Tp("onSelect","select",null,c,h),s.push({event:c,listeners:y}),c.target=Rc)))}function ol(s,c){var h={};return h[s.toLowerCase()]=c.toLowerCase(),h["Webkit"+s]="webkit"+c,h["Moz"+s]="moz"+c,h}var Dc={animationend:ol("Animation","AnimationEnd"),animationiteration:ol("Animation","AnimationIteration"),animationstart:ol("Animation","AnimationStart"),transitionrun:ol("Transition","TransitionRun"),transitionstart:ol("Transition","TransitionStart"),transitioncancel:ol("Transition","TransitionCancel"),transitionend:ol("Transition","TransitionEnd")},p0={},pO={};rs&&(pO=document.createElement("div").style,"AnimationEvent"in window||(delete Dc.animationend.animation,delete Dc.animationiteration.animation,delete Dc.animationstart.animation),"TransitionEvent"in window||delete Dc.transitionend.transition);function ll(s){if(p0[s])return p0[s];if(!Dc[s])return s;var c=Dc[s],h;for(h in c)if(c.hasOwnProperty(h)&&h in pO)return p0[s]=c[h];return s}var mO=ll("animationend"),gO=ll("animationiteration"),yO=ll("animationstart"),_9=ll("transitionrun"),z9=ll("transitionstart"),P9=ll("transitioncancel"),vO=ll("transitionend"),xO=new Map,m0="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(" ");m0.push("scrollEnd");function ea(s,c){xO.set(s,c),es(c,[s])}var Mp=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},Ni=[],Mc=0,g0=0;function Ip(){for(var s=Mc,c=g0=Mc=0;c<s;){var h=Ni[c];Ni[c++]=null;var y=Ni[c];Ni[c++]=null;var w=Ni[c];Ni[c++]=null;var N=Ni[c];if(Ni[c++]=null,y!==null&&w!==null){var z=y.pending;z===null?w.next=w:(w.next=z.next,z.next=w),y.pending=w}N!==0&&bO(h,w,N)}}function Lp(s,c,h,y){Ni[Mc++]=s,Ni[Mc++]=c,Ni[Mc++]=h,Ni[Mc++]=y,g0|=y,s.lanes|=y,s=s.alternate,s!==null&&(s.lanes|=y)}function y0(s,c,h,y){return Lp(s,c,h,y),$p(s)}function cl(s,c){return Lp(s,null,null,c),$p(s)}function bO(s,c,h){s.lanes|=h;var y=s.alternate;y!==null&&(y.lanes|=h);for(var w=!1,N=s.return;N!==null;)N.childLanes|=h,y=N.alternate,y!==null&&(y.childLanes|=h),N.tag===22&&(s=N.stateNode,s===null||s._visibility&1||(w=!0)),s=N,N=N.return;return s.tag===3?(N=s.stateNode,w&&c!==null&&(w=31-de(h),s=N.hiddenUpdates,y=s[w],y===null?s[w]=[c]:y.push(c),c.lane=h|536870912),N):null}function $p(s){if(50<yf)throw yf=0,Cb=null,Error(r(185));for(var c=s.return;c!==null;)s=c,c=s.return;return s.tag===3?s.stateNode:null}var Ic={};function T9(s,c,h,y){this.tag=s,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ii(s,c,h,y){return new T9(s,c,h,y)}function v0(s){return s=s.prototype,!(!s||!s.isReactComponent)}function is(s,c){var h=s.alternate;return h===null?(h=ii(s.tag,c,s.key,s.mode),h.elementType=s.elementType,h.type=s.type,h.stateNode=s.stateNode,h.alternate=s,s.alternate=h):(h.pendingProps=c,h.type=s.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=s.flags&65011712,h.childLanes=s.childLanes,h.lanes=s.lanes,h.child=s.child,h.memoizedProps=s.memoizedProps,h.memoizedState=s.memoizedState,h.updateQueue=s.updateQueue,c=s.dependencies,h.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},h.sibling=s.sibling,h.index=s.index,h.ref=s.ref,h.refCleanup=s.refCleanup,h}function wO(s,c){s.flags&=65011714;var h=s.alternate;return h===null?(s.childLanes=0,s.lanes=c,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=h.childLanes,s.lanes=h.lanes,s.child=h.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=h.memoizedProps,s.memoizedState=h.memoizedState,s.updateQueue=h.updateQueue,s.type=h.type,c=h.dependencies,s.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),s}function Bp(s,c,h,y,w,N){var z=0;if(y=s,typeof s=="function")v0(s)&&(z=1);else if(typeof s=="string")z=LH(s,h,G.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case $:return s=ii(31,h,c,w),s.elementType=$,s.lanes=N,s;case b:return ul(h.children,w,N,c);case j:z=8,w|=24;break;case k:return s=ii(12,h,c,w|2),s.elementType=k,s.lanes=N,s;case P:return s=ii(13,h,c,w),s.elementType=P,s.lanes=N,s;case O:return s=ii(19,h,c,w),s.elementType=O,s.lanes=N,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case C:z=10;break e;case E:z=9;break e;case A:z=11;break e;case _:z=14;break e;case T:z=16,y=null;break e}z=29,h=Error(r(130,s===null?"null":typeof s,"")),y=null}return c=ii(z,h,c,w),c.elementType=s,c.type=y,c.lanes=N,c}function ul(s,c,h,y){return s=ii(7,s,y,c),s.lanes=h,s}function x0(s,c,h){return s=ii(6,s,null,c),s.lanes=h,s}function SO(s){var c=ii(18,null,null,0);return c.stateNode=s,c}function b0(s,c,h){return c=ii(4,s.children!==null?s.children:[],s.key,c),c.lanes=h,c.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},c}var jO=new WeakMap;function ki(s,c){if(typeof s=="object"&&s!==null){var h=jO.get(s);return h!==void 0?h:(c={value:s,source:c,stack:Lt(c)},jO.set(s,c),c)}return{value:s,source:c,stack:Lt(c)}}var Lc=[],$c=0,Up=null,Yd=0,Ci=[],Ai=0,Zs=null,ja=1,Na="";function as(s,c){Lc[$c++]=Yd,Lc[$c++]=Up,Up=s,Yd=c}function NO(s,c,h){Ci[Ai++]=ja,Ci[Ai++]=Na,Ci[Ai++]=Zs,Zs=s;var y=ja;s=Na;var w=32-de(y)-1;y&=~(1<<w),h+=1;var N=32-de(c)+w;if(30<N){var z=w-w%5;N=(y&(1<<z)-1).toString(32),y>>=z,w-=z,ja=1<<32-de(c)+w|h<<w|y,Na=N+s}else ja=1<<N|h<<w|y,Na=s}function w0(s){s.return!==null&&(as(s,1),NO(s,1,0))}function S0(s){for(;s===Up;)Up=Lc[--$c],Lc[$c]=null,Yd=Lc[--$c],Lc[$c]=null;for(;s===Zs;)Zs=Ci[--Ai],Ci[Ai]=null,Na=Ci[--Ai],Ci[Ai]=null,ja=Ci[--Ai],Ci[Ai]=null}function kO(s,c){Ci[Ai++]=ja,Ci[Ai++]=Na,Ci[Ai++]=Zs,ja=c.id,Na=c.overflow,Zs=s}var sr=null,rn=null,wt=!1,Xs=null,Oi=!1,j0=Error(r(519));function Js(s){var c=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Wd(ki(c,s)),j0}function CO(s){var c=s.stateNode,h=s.type,y=s.memoizedProps;switch(c[tt]=s,c[jt]=y,h){case"dialog":yt("cancel",c),yt("close",c);break;case"iframe":case"object":case"embed":yt("load",c);break;case"video":case"audio":for(h=0;h<xf.length;h++)yt(xf[h],c);break;case"source":yt("error",c);break;case"img":case"image":case"link":yt("error",c),yt("load",c);break;case"details":yt("toggle",c);break;case"input":yt("invalid",c),$A(c,y.value,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name,!0);break;case"select":yt("invalid",c);break;case"textarea":yt("invalid",c),UA(c,y.value,y.defaultValue,y.children)}h=y.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||c.textContent===""+h||y.suppressHydrationWarning===!0||F_(c.textContent,h)?(y.popover!=null&&(yt("beforetoggle",c),yt("toggle",c)),y.onScroll!=null&&yt("scroll",c),y.onScrollEnd!=null&&yt("scrollend",c),y.onClick!=null&&(c.onclick=ns),c=!0):c=!1,c||Js(s,!0)}function AO(s){for(sr=s.return;sr;)switch(sr.tag){case 5:case 31:case 13:Oi=!1;return;case 27:case 3:Oi=!0;return;default:sr=sr.return}}function Bc(s){if(s!==sr)return!1;if(!wt)return AO(s),wt=!0,!1;var c=s.tag,h;if((h=c!==3&&c!==27)&&((h=c===5)&&(h=s.type,h=!(h!=="form"&&h!=="button")||Ub(s.type,s.memoizedProps)),h=!h),h&&rn&&Js(s),AO(s),c===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));rn=X_(s)}else if(c===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));rn=X_(s)}else c===27?(c=rn,po(s.type)?(s=Gb,Gb=null,rn=s):rn=c):rn=sr?_i(s.stateNode.nextSibling):null;return!0}function dl(){rn=sr=null,wt=!1}function N0(){var s=Xs;return s!==null&&(Hr===null?Hr=s:Hr.push.apply(Hr,s),Xs=null),s}function Wd(s){Xs===null?Xs=[s]:Xs.push(s)}var k0=M(null),fl=null,ss=null;function eo(s,c,h){D(k0,c._currentValue),c._currentValue=h}function os(s){s._currentValue=k0.current,q(k0)}function C0(s,c,h){for(;s!==null;){var y=s.alternate;if((s.childLanes&c)!==c?(s.childLanes|=c,y!==null&&(y.childLanes|=c)):y!==null&&(y.childLanes&c)!==c&&(y.childLanes|=c),s===h)break;s=s.return}}function A0(s,c,h,y){var w=s.child;for(w!==null&&(w.return=s);w!==null;){var N=w.dependencies;if(N!==null){var z=w.child;N=N.firstContext;e:for(;N!==null;){var L=N;N=w;for(var K=0;K<c.length;K++)if(L.context===c[K]){N.lanes|=h,L=N.alternate,L!==null&&(L.lanes|=h),C0(N.return,h,s),y||(z=null);break e}N=L.next}}else if(w.tag===18){if(z=w.return,z===null)throw Error(r(341));z.lanes|=h,N=z.alternate,N!==null&&(N.lanes|=h),C0(z,h,s),z=null}else z=w.child;if(z!==null)z.return=w;else for(z=w;z!==null;){if(z===s){z=null;break}if(w=z.sibling,w!==null){w.return=z.return,z=w;break}z=z.return}w=z}}function Uc(s,c,h,y){s=null;for(var w=c,N=!1;w!==null;){if(!N){if((w.flags&524288)!==0)N=!0;else if((w.flags&262144)!==0)break}if(w.tag===10){var z=w.alternate;if(z===null)throw Error(r(387));if(z=z.memoizedProps,z!==null){var L=w.type;ri(w.pendingProps.value,z.value)||(s!==null?s.push(L):s=[L])}}else if(w===Ce.current){if(z=w.alternate,z===null)throw Error(r(387));z.memoizedState.memoizedState!==w.memoizedState.memoizedState&&(s!==null?s.push(Nf):s=[Nf])}w=w.return}s!==null&&A0(c,s,h,y),c.flags|=262144}function qp(s){for(s=s.firstContext;s!==null;){if(!ri(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function hl(s){fl=s,ss=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function or(s){return OO(fl,s)}function Fp(s,c){return fl===null&&hl(s),OO(s,c)}function OO(s,c){var h=c._currentValue;if(c={context:c,memoizedValue:h,next:null},ss===null){if(s===null)throw Error(r(308));ss=c,s.dependencies={lanes:0,firstContext:c},s.flags|=524288}else ss=ss.next=c;return h}var R9=typeof AbortController<"u"?AbortController:function(){var s=[],c=this.signal={aborted:!1,addEventListener:function(h,y){s.push(y)}};this.abort=function(){c.aborted=!0,s.forEach(function(h){return h()})}},D9=e.unstable_scheduleCallback,M9=e.unstable_NormalPriority,Dn={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function O0(){return{controller:new R9,data:new Map,refCount:0}}function Zd(s){s.refCount--,s.refCount===0&&D9(M9,function(){s.controller.abort()})}var Xd=null,E0=0,qc=0,Fc=null;function I9(s,c){if(Xd===null){var h=Xd=[];E0=0,qc=Pb(),Fc={status:"pending",value:void 0,then:function(y){h.push(y)}}}return E0++,c.then(EO,EO),c}function EO(){if(--E0===0&&Xd!==null){Fc!==null&&(Fc.status="fulfilled");var s=Xd;Xd=null,qc=0,Fc=null;for(var c=0;c<s.length;c++)(0,s[c])()}}function L9(s,c){var h=[],y={status:"pending",value:null,reason:null,then:function(w){h.push(w)}};return s.then(function(){y.status="fulfilled",y.value=c;for(var w=0;w<h.length;w++)(0,h[w])(c)},function(w){for(y.status="rejected",y.reason=w,w=0;w<h.length;w++)(0,h[w])(void 0)}),y}var _O=H.S;H.S=function(s,c){h_=mt(),typeof c=="object"&&c!==null&&typeof c.then=="function"&&I9(s,c),_O!==null&&_O(s,c)};var pl=M(null);function _0(){var s=pl.current;return s!==null?s:Vt.pooledCache}function Hp(s,c){c===null?D(pl,pl.current):D(pl,c.pool)}function zO(){var s=_0();return s===null?null:{parent:Dn._currentValue,pool:s}}var Hc=Error(r(460)),z0=Error(r(474)),Kp=Error(r(542)),Gp={then:function(){}};function PO(s){return s=s.status,s==="fulfilled"||s==="rejected"}function TO(s,c,h){switch(h=s[h],h===void 0?s.push(c):h!==c&&(c.then(ns,ns),c=h),c.status){case"fulfilled":return c.value;case"rejected":throw s=c.reason,DO(s),s;default:if(typeof c.status=="string")c.then(ns,ns);else{if(s=Vt,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=c,s.status="pending",s.then(function(y){if(c.status==="pending"){var w=c;w.status="fulfilled",w.value=y}},function(y){if(c.status==="pending"){var w=c;w.status="rejected",w.reason=y}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw s=c.reason,DO(s),s}throw gl=c,Hc}}function ml(s){try{var c=s._init;return c(s._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(gl=h,Hc):h}}var gl=null;function RO(){if(gl===null)throw Error(r(459));var s=gl;return gl=null,s}function DO(s){if(s===Hc||s===Kp)throw Error(r(483))}var Kc=null,Jd=0;function Vp(s){var c=Jd;return Jd+=1,Kc===null&&(Kc=[]),TO(Kc,s,c)}function ef(s,c){c=c.props.ref,s.ref=c!==void 0?c:null}function Qp(s,c){throw c.$$typeof===g?Error(r(525)):(s=Object.prototype.toString.call(c),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":s)))}function MO(s){function c(te,Y){if(s){var ie=te.deletions;ie===null?(te.deletions=[Y],te.flags|=16):ie.push(Y)}}function h(te,Y){if(!s)return null;for(;Y!==null;)c(te,Y),Y=Y.sibling;return null}function y(te){for(var Y=new Map;te!==null;)te.key!==null?Y.set(te.key,te):Y.set(te.index,te),te=te.sibling;return Y}function w(te,Y){return te=is(te,Y),te.index=0,te.sibling=null,te}function N(te,Y,ie){return te.index=ie,s?(ie=te.alternate,ie!==null?(ie=ie.index,ie<Y?(te.flags|=67108866,Y):ie):(te.flags|=67108866,Y)):(te.flags|=1048576,Y)}function z(te){return s&&te.alternate===null&&(te.flags|=67108866),te}function L(te,Y,ie,xe){return Y===null||Y.tag!==6?(Y=x0(ie,te.mode,xe),Y.return=te,Y):(Y=w(Y,ie),Y.return=te,Y)}function K(te,Y,ie,xe){var Ke=ie.type;return Ke===b?me(te,Y,ie.props.children,xe,ie.key):Y!==null&&(Y.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===T&&ml(Ke)===Y.type)?(Y=w(Y,ie.props),ef(Y,ie),Y.return=te,Y):(Y=Bp(ie.type,ie.key,ie.props,null,te.mode,xe),ef(Y,ie),Y.return=te,Y)}function ae(te,Y,ie,xe){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==ie.containerInfo||Y.stateNode.implementation!==ie.implementation?(Y=b0(ie,te.mode,xe),Y.return=te,Y):(Y=w(Y,ie.children||[]),Y.return=te,Y)}function me(te,Y,ie,xe,Ke){return Y===null||Y.tag!==7?(Y=ul(ie,te.mode,xe,Ke),Y.return=te,Y):(Y=w(Y,ie),Y.return=te,Y)}function we(te,Y,ie){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Y=x0(""+Y,te.mode,ie),Y.return=te,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case v:return ie=Bp(Y.type,Y.key,Y.props,null,te.mode,ie),ef(ie,Y),ie.return=te,ie;case S:return Y=b0(Y,te.mode,ie),Y.return=te,Y;case T:return Y=ml(Y),we(te,Y,ie)}if(Z(Y)||B(Y))return Y=ul(Y,te.mode,ie,null),Y.return=te,Y;if(typeof Y.then=="function")return we(te,Vp(Y),ie);if(Y.$$typeof===C)return we(te,Fp(te,Y),ie);Qp(te,Y)}return null}function le(te,Y,ie,xe){var Ke=Y!==null?Y.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return Ke!==null?null:L(te,Y,""+ie,xe);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case v:return ie.key===Ke?K(te,Y,ie,xe):null;case S:return ie.key===Ke?ae(te,Y,ie,xe):null;case T:return ie=ml(ie),le(te,Y,ie,xe)}if(Z(ie)||B(ie))return Ke!==null?null:me(te,Y,ie,xe,null);if(typeof ie.then=="function")return le(te,Y,Vp(ie),xe);if(ie.$$typeof===C)return le(te,Y,Fp(te,ie),xe);Qp(te,ie)}return null}function ue(te,Y,ie,xe,Ke){if(typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint")return te=te.get(ie)||null,L(Y,te,""+xe,Ke);if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case v:return te=te.get(xe.key===null?ie:xe.key)||null,K(Y,te,xe,Ke);case S:return te=te.get(xe.key===null?ie:xe.key)||null,ae(Y,te,xe,Ke);case T:return xe=ml(xe),ue(te,Y,ie,xe,Ke)}if(Z(xe)||B(xe))return te=te.get(ie)||null,me(Y,te,xe,Ke,null);if(typeof xe.then=="function")return ue(te,Y,ie,Vp(xe),Ke);if(xe.$$typeof===C)return ue(te,Y,ie,Fp(Y,xe),Ke);Qp(Y,xe)}return null}function De(te,Y,ie,xe){for(var Ke=null,kt=null,Be=Y,lt=Y=0,bt=null;Be!==null&<<ie.length;lt++){Be.index>lt?(bt=Be,Be=null):bt=Be.sibling;var Ct=le(te,Be,ie[lt],xe);if(Ct===null){Be===null&&(Be=bt);break}s&&Be&&Ct.alternate===null&&c(te,Be),Y=N(Ct,Y,lt),kt===null?Ke=Ct:kt.sibling=Ct,kt=Ct,Be=bt}if(lt===ie.length)return h(te,Be),wt&&as(te,lt),Ke;if(Be===null){for(;lt<ie.length;lt++)Be=we(te,ie[lt],xe),Be!==null&&(Y=N(Be,Y,lt),kt===null?Ke=Be:kt.sibling=Be,kt=Be);return wt&&as(te,lt),Ke}for(Be=y(Be);lt<ie.length;lt++)bt=ue(Be,te,lt,ie[lt],xe),bt!==null&&(s&&bt.alternate!==null&&Be.delete(bt.key===null?lt:bt.key),Y=N(bt,Y,lt),kt===null?Ke=bt:kt.sibling=bt,kt=bt);return s&&Be.forEach(function(xo){return c(te,xo)}),wt&&as(te,lt),Ke}function We(te,Y,ie,xe){if(ie==null)throw Error(r(151));for(var Ke=null,kt=null,Be=Y,lt=Y=0,bt=null,Ct=ie.next();Be!==null&&!Ct.done;lt++,Ct=ie.next()){Be.index>lt?(bt=Be,Be=null):bt=Be.sibling;var xo=le(te,Be,Ct.value,xe);if(xo===null){Be===null&&(Be=bt);break}s&&Be&&xo.alternate===null&&c(te,Be),Y=N(xo,Y,lt),kt===null?Ke=xo:kt.sibling=xo,kt=xo,Be=bt}if(Ct.done)return h(te,Be),wt&&as(te,lt),Ke;if(Be===null){for(;!Ct.done;lt++,Ct=ie.next())Ct=we(te,Ct.value,xe),Ct!==null&&(Y=N(Ct,Y,lt),kt===null?Ke=Ct:kt.sibling=Ct,kt=Ct);return wt&&as(te,lt),Ke}for(Be=y(Be);!Ct.done;lt++,Ct=ie.next())Ct=ue(Be,te,lt,Ct.value,xe),Ct!==null&&(s&&Ct.alternate!==null&&Be.delete(Ct.key===null?lt:Ct.key),Y=N(Ct,Y,lt),kt===null?Ke=Ct:kt.sibling=Ct,kt=Ct);return s&&Be.forEach(function(YH){return c(te,YH)}),wt&&as(te,lt),Ke}function Ut(te,Y,ie,xe){if(typeof ie=="object"&&ie!==null&&ie.type===b&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case v:e:{for(var Ke=ie.key;Y!==null;){if(Y.key===Ke){if(Ke=ie.type,Ke===b){if(Y.tag===7){h(te,Y.sibling),xe=w(Y,ie.props.children),xe.return=te,te=xe;break e}}else if(Y.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===T&&ml(Ke)===Y.type){h(te,Y.sibling),xe=w(Y,ie.props),ef(xe,ie),xe.return=te,te=xe;break e}h(te,Y);break}else c(te,Y);Y=Y.sibling}ie.type===b?(xe=ul(ie.props.children,te.mode,xe,ie.key),xe.return=te,te=xe):(xe=Bp(ie.type,ie.key,ie.props,null,te.mode,xe),ef(xe,ie),xe.return=te,te=xe)}return z(te);case S:e:{for(Ke=ie.key;Y!==null;){if(Y.key===Ke)if(Y.tag===4&&Y.stateNode.containerInfo===ie.containerInfo&&Y.stateNode.implementation===ie.implementation){h(te,Y.sibling),xe=w(Y,ie.children||[]),xe.return=te,te=xe;break e}else{h(te,Y);break}else c(te,Y);Y=Y.sibling}xe=b0(ie,te.mode,xe),xe.return=te,te=xe}return z(te);case T:return ie=ml(ie),Ut(te,Y,ie,xe)}if(Z(ie))return De(te,Y,ie,xe);if(B(ie)){if(Ke=B(ie),typeof Ke!="function")throw Error(r(150));return ie=Ke.call(ie),We(te,Y,ie,xe)}if(typeof ie.then=="function")return Ut(te,Y,Vp(ie),xe);if(ie.$$typeof===C)return Ut(te,Y,Fp(te,ie),xe);Qp(te,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,Y!==null&&Y.tag===6?(h(te,Y.sibling),xe=w(Y,ie),xe.return=te,te=xe):(h(te,Y),xe=x0(ie,te.mode,xe),xe.return=te,te=xe),z(te)):h(te,Y)}return function(te,Y,ie,xe){try{Jd=0;var Ke=Ut(te,Y,ie,xe);return Kc=null,Ke}catch(Be){if(Be===Hc||Be===Kp)throw Be;var kt=ii(29,Be,null,te.mode);return kt.lanes=xe,kt.return=te,kt}}}var yl=MO(!0),IO=MO(!1),to=!1;function P0(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function T0(s,c){s=s.updateQueue,c.updateQueue===s&&(c.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function no(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function ro(s,c,h){var y=s.updateQueue;if(y===null)return null;if(y=y.shared,(_t&2)!==0){var w=y.pending;return w===null?c.next=c:(c.next=w.next,w.next=c),y.pending=c,c=$p(s),bO(s,null,h),c}return Lp(s,y,c,h),$p(s)}function tf(s,c,h){if(c=c.updateQueue,c!==null&&(c=c.shared,(h&4194048)!==0)){var y=c.lanes;y&=s.pendingLanes,h|=y,c.lanes=h,Np(s,h)}}function R0(s,c){var h=s.updateQueue,y=s.alternate;if(y!==null&&(y=y.updateQueue,h===y)){var w=null,N=null;if(h=h.firstBaseUpdate,h!==null){do{var z={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};N===null?w=N=z:N=N.next=z,h=h.next}while(h!==null);N===null?w=N=c:N=N.next=c}else w=N=c;h={baseState:y.baseState,firstBaseUpdate:w,lastBaseUpdate:N,shared:y.shared,callbacks:y.callbacks},s.updateQueue=h;return}s=h.lastBaseUpdate,s===null?h.firstBaseUpdate=c:s.next=c,h.lastBaseUpdate=c}var D0=!1;function nf(){if(D0){var s=Fc;if(s!==null)throw s}}function rf(s,c,h,y){D0=!1;var w=s.updateQueue;to=!1;var N=w.firstBaseUpdate,z=w.lastBaseUpdate,L=w.shared.pending;if(L!==null){w.shared.pending=null;var K=L,ae=K.next;K.next=null,z===null?N=ae:z.next=ae,z=K;var me=s.alternate;me!==null&&(me=me.updateQueue,L=me.lastBaseUpdate,L!==z&&(L===null?me.firstBaseUpdate=ae:L.next=ae,me.lastBaseUpdate=K))}if(N!==null){var we=w.baseState;z=0,me=ae=K=null,L=N;do{var le=L.lane&-536870913,ue=le!==L.lane;if(ue?(xt&le)===le:(y&le)===le){le!==0&&le===qc&&(D0=!0),me!==null&&(me=me.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var De=s,We=L;le=c;var Ut=h;switch(We.tag){case 1:if(De=We.payload,typeof De=="function"){we=De.call(Ut,we,le);break e}we=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=We.payload,le=typeof De=="function"?De.call(Ut,we,le):De,le==null)break e;we=m({},we,le);break e;case 2:to=!0}}le=L.callback,le!==null&&(s.flags|=64,ue&&(s.flags|=8192),ue=w.callbacks,ue===null?w.callbacks=[le]:ue.push(le))}else ue={lane:le,tag:L.tag,payload:L.payload,callback:L.callback,next:null},me===null?(ae=me=ue,K=we):me=me.next=ue,z|=le;if(L=L.next,L===null){if(L=w.shared.pending,L===null)break;ue=L,L=ue.next,ue.next=null,w.lastBaseUpdate=ue,w.shared.pending=null}}while(!0);me===null&&(K=we),w.baseState=K,w.firstBaseUpdate=ae,w.lastBaseUpdate=me,N===null&&(w.shared.lanes=0),lo|=z,s.lanes=z,s.memoizedState=we}}function LO(s,c){if(typeof s!="function")throw Error(r(191,s));s.call(c)}function $O(s,c){var h=s.callbacks;if(h!==null)for(s.callbacks=null,s=0;s<h.length;s++)LO(h[s],c)}var Gc=M(null),Yp=M(0);function BO(s,c){s=gs,D(Yp,s),D(Gc,c),gs=s|c.baseLanes}function M0(){D(Yp,gs),D(Gc,Gc.current)}function I0(){gs=Yp.current,q(Gc),q(Yp)}var ai=M(null),Ei=null;function io(s){var c=s.alternate;D(_n,_n.current&1),D(ai,s),Ei===null&&(c===null||Gc.current!==null||c.memoizedState!==null)&&(Ei=s)}function L0(s){D(_n,_n.current),D(ai,s),Ei===null&&(Ei=s)}function UO(s){s.tag===22?(D(_n,_n.current),D(ai,s),Ei===null&&(Ei=s)):ao()}function ao(){D(_n,_n.current),D(ai,ai.current)}function si(s){q(ai),Ei===s&&(Ei=null),q(_n)}var _n=M(0);function Wp(s){for(var c=s;c!==null;){if(c.tag===13){var h=c.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||Hb(h)||Kb(h)))return c}else if(c.tag===19&&(c.memoizedProps.revealOrder==="forwards"||c.memoizedProps.revealOrder==="backwards"||c.memoizedProps.revealOrder==="unstable_legacy-backwards"||c.memoizedProps.revealOrder==="together")){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var ls=0,ot=null,$t=null,Mn=null,Zp=!1,Vc=!1,vl=!1,Xp=0,af=0,Qc=null,$9=0;function Sn(){throw Error(r(321))}function $0(s,c){if(c===null)return!1;for(var h=0;h<c.length&&h<s.length;h++)if(!ri(s[h],c[h]))return!1;return!0}function B0(s,c,h,y,w,N){return ls=N,ot=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,H.H=s===null||s.memoizedState===null?NE:tb,vl=!1,N=h(y,w),vl=!1,Vc&&(N=FO(c,h,y,w)),qO(s),N}function qO(s){H.H=lf;var c=$t!==null&&$t.next!==null;if(ls=0,Mn=$t=ot=null,Zp=!1,af=0,Qc=null,c)throw Error(r(300));s===null||In||(s=s.dependencies,s!==null&&qp(s)&&(In=!0))}function FO(s,c,h,y){ot=s;var w=0;do{if(Vc&&(Qc=null),af=0,Vc=!1,25<=w)throw Error(r(301));if(w+=1,Mn=$t=null,s.updateQueue!=null){var N=s.updateQueue;N.lastEffect=null,N.events=null,N.stores=null,N.memoCache!=null&&(N.memoCache.index=0)}H.H=kE,N=c(h,y)}while(Vc);return N}function B9(){var s=H.H,c=s.useState()[0];return c=typeof c.then=="function"?sf(c):c,s=s.useState()[0],($t!==null?$t.memoizedState:null)!==s&&(ot.flags|=1024),c}function U0(){var s=Xp!==0;return Xp=0,s}function q0(s,c,h){c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~h}function F0(s){if(Zp){for(s=s.memoizedState;s!==null;){var c=s.queue;c!==null&&(c.pending=null),s=s.next}Zp=!1}ls=0,Mn=$t=ot=null,Vc=!1,af=Xp=0,Qc=null}function Er(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mn===null?ot.memoizedState=Mn=s:Mn=Mn.next=s,Mn}function zn(){if($t===null){var s=ot.alternate;s=s!==null?s.memoizedState:null}else s=$t.next;var c=Mn===null?ot.memoizedState:Mn.next;if(c!==null)Mn=c,$t=s;else{if(s===null)throw ot.alternate===null?Error(r(467)):Error(r(310));$t=s,s={memoizedState:$t.memoizedState,baseState:$t.baseState,baseQueue:$t.baseQueue,queue:$t.queue,next:null},Mn===null?ot.memoizedState=Mn=s:Mn=Mn.next=s}return Mn}function Jp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function sf(s){var c=af;return af+=1,Qc===null&&(Qc=[]),s=TO(Qc,s,c),c=ot,(Mn===null?c.memoizedState:Mn.next)===null&&(c=c.alternate,H.H=c===null||c.memoizedState===null?NE:tb),s}function em(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return sf(s);if(s.$$typeof===C)return or(s)}throw Error(r(438,String(s)))}function H0(s){var c=null,h=ot.updateQueue;if(h!==null&&(c=h.memoCache),c==null){var y=ot.alternate;y!==null&&(y=y.updateQueue,y!==null&&(y=y.memoCache,y!=null&&(c={data:y.data.map(function(w){return w.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),h===null&&(h=Jp(),ot.updateQueue=h),h.memoCache=c,h=c.data[c.index],h===void 0)for(h=c.data[c.index]=Array(s),y=0;y<s;y++)h[y]=F;return c.index++,h}function cs(s,c){return typeof c=="function"?c(s):c}function tm(s){var c=zn();return K0(c,$t,s)}function K0(s,c,h){var y=s.queue;if(y===null)throw Error(r(311));y.lastRenderedReducer=h;var w=s.baseQueue,N=y.pending;if(N!==null){if(w!==null){var z=w.next;w.next=N.next,N.next=z}c.baseQueue=w=N,y.pending=null}if(N=s.baseState,w===null)s.memoizedState=N;else{c=w.next;var L=z=null,K=null,ae=c,me=!1;do{var we=ae.lane&-536870913;if(we!==ae.lane?(xt&we)===we:(ls&we)===we){var le=ae.revertLane;if(le===0)K!==null&&(K=K.next={lane:0,revertLane:0,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),we===qc&&(me=!0);else if((ls&le)===le){ae=ae.next,le===qc&&(me=!0);continue}else we={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},K===null?(L=K=we,z=N):K=K.next=we,ot.lanes|=le,lo|=le;we=ae.action,vl&&h(N,we),N=ae.hasEagerState?ae.eagerState:h(N,we)}else le={lane:we,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},K===null?(L=K=le,z=N):K=K.next=le,ot.lanes|=we,lo|=we;ae=ae.next}while(ae!==null&&ae!==c);if(K===null?z=N:K.next=L,!ri(N,s.memoizedState)&&(In=!0,me&&(h=Fc,h!==null)))throw h;s.memoizedState=N,s.baseState=z,s.baseQueue=K,y.lastRenderedState=N}return w===null&&(y.lanes=0),[s.memoizedState,y.dispatch]}function G0(s){var c=zn(),h=c.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=s;var y=h.dispatch,w=h.pending,N=c.memoizedState;if(w!==null){h.pending=null;var z=w=w.next;do N=s(N,z.action),z=z.next;while(z!==w);ri(N,c.memoizedState)||(In=!0),c.memoizedState=N,c.baseQueue===null&&(c.baseState=N),h.lastRenderedState=N}return[N,y]}function HO(s,c,h){var y=ot,w=zn(),N=wt;if(N){if(h===void 0)throw Error(r(407));h=h()}else h=c();var z=!ri(($t||w).memoizedState,h);if(z&&(w.memoizedState=h,In=!0),w=w.queue,Y0(VO.bind(null,y,w,s),[s]),w.getSnapshot!==c||z||Mn!==null&&Mn.memoizedState.tag&1){if(y.flags|=2048,Yc(9,{destroy:void 0},GO.bind(null,y,w,h,c),null),Vt===null)throw Error(r(349));N||(ls&127)!==0||KO(y,c,h)}return h}function KO(s,c,h){s.flags|=16384,s={getSnapshot:c,value:h},c=ot.updateQueue,c===null?(c=Jp(),ot.updateQueue=c,c.stores=[s]):(h=c.stores,h===null?c.stores=[s]:h.push(s))}function GO(s,c,h,y){c.value=h,c.getSnapshot=y,QO(c)&&YO(s)}function VO(s,c,h){return h(function(){QO(c)&&YO(s)})}function QO(s){var c=s.getSnapshot;s=s.value;try{var h=c();return!ri(s,h)}catch{return!0}}function YO(s){var c=cl(s,2);c!==null&&Kr(c,s,2)}function V0(s){var c=Er();if(typeof s=="function"){var h=s;if(s=h(),vl){Kt(!0);try{h()}finally{Kt(!1)}}}return c.memoizedState=c.baseState=s,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:s},c}function WO(s,c,h,y){return s.baseState=h,K0(s,$t,typeof y=="function"?y:cs)}function U9(s,c,h,y,w){if(im(s))throw Error(r(485));if(s=c.action,s!==null){var N={payload:w,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(z){N.listeners.push(z)}};H.T!==null?h(!0):N.isTransition=!1,y(N),h=c.pending,h===null?(N.next=c.pending=N,ZO(c,N)):(N.next=h.next,c.pending=h.next=N)}}function ZO(s,c){var h=c.action,y=c.payload,w=s.state;if(c.isTransition){var N=H.T,z={};H.T=z;try{var L=h(w,y),K=H.S;K!==null&&K(z,L),XO(s,c,L)}catch(ae){Q0(s,c,ae)}finally{N!==null&&z.types!==null&&(N.types=z.types),H.T=N}}else try{N=h(w,y),XO(s,c,N)}catch(ae){Q0(s,c,ae)}}function XO(s,c,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(y){JO(s,c,y)},function(y){return Q0(s,c,y)}):JO(s,c,h)}function JO(s,c,h){c.status="fulfilled",c.value=h,eE(c),s.state=h,c=s.pending,c!==null&&(h=c.next,h===c?s.pending=null:(h=h.next,c.next=h,ZO(s,h)))}function Q0(s,c,h){var y=s.pending;if(s.pending=null,y!==null){y=y.next;do c.status="rejected",c.reason=h,eE(c),c=c.next;while(c!==y)}s.action=null}function eE(s){s=s.listeners;for(var c=0;c<s.length;c++)(0,s[c])()}function tE(s,c){return c}function nE(s,c){if(wt){var h=Vt.formState;if(h!==null){e:{var y=ot;if(wt){if(rn){t:{for(var w=rn,N=Oi;w.nodeType!==8;){if(!N){w=null;break t}if(w=_i(w.nextSibling),w===null){w=null;break t}}N=w.data,w=N==="F!"||N==="F"?w:null}if(w){rn=_i(w.nextSibling),y=w.data==="F!";break e}}Js(y)}y=!1}y&&(c=h[0])}}return h=Er(),h.memoizedState=h.baseState=c,y={pending:null,lanes:0,dispatch:null,lastRenderedReducer:tE,lastRenderedState:c},h.queue=y,h=wE.bind(null,ot,y),y.dispatch=h,y=V0(!1),N=eb.bind(null,ot,!1,y.queue),y=Er(),w={state:c,dispatch:null,action:s,pending:null},y.queue=w,h=U9.bind(null,ot,w,N,h),w.dispatch=h,y.memoizedState=s,[c,h,!1]}function rE(s){var c=zn();return iE(c,$t,s)}function iE(s,c,h){if(c=K0(s,c,tE)[0],s=tm(cs)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var y=sf(c)}catch(z){throw z===Hc?Kp:z}else y=c;c=zn();var w=c.queue,N=w.dispatch;return h!==c.memoizedState&&(ot.flags|=2048,Yc(9,{destroy:void 0},q9.bind(null,w,h),null)),[y,N,s]}function q9(s,c){s.action=c}function aE(s){var c=zn(),h=$t;if(h!==null)return iE(c,h,s);zn(),c=c.memoizedState,h=zn();var y=h.queue.dispatch;return h.memoizedState=s,[c,y,!1]}function Yc(s,c,h,y){return s={tag:s,create:h,deps:y,inst:c,next:null},c=ot.updateQueue,c===null&&(c=Jp(),ot.updateQueue=c),h=c.lastEffect,h===null?c.lastEffect=s.next=s:(y=h.next,h.next=s,s.next=y,c.lastEffect=s),s}function sE(){return zn().memoizedState}function nm(s,c,h,y){var w=Er();ot.flags|=s,w.memoizedState=Yc(1|c,{destroy:void 0},h,y===void 0?null:y)}function rm(s,c,h,y){var w=zn();y=y===void 0?null:y;var N=w.memoizedState.inst;$t!==null&&y!==null&&$0(y,$t.memoizedState.deps)?w.memoizedState=Yc(c,N,h,y):(ot.flags|=s,w.memoizedState=Yc(1|c,N,h,y))}function oE(s,c){nm(8390656,8,s,c)}function Y0(s,c){rm(2048,8,s,c)}function F9(s){ot.flags|=4;var c=ot.updateQueue;if(c===null)c=Jp(),ot.updateQueue=c,c.events=[s];else{var h=c.events;h===null?c.events=[s]:h.push(s)}}function lE(s){var c=zn().memoizedState;return F9({ref:c,nextImpl:s}),function(){if((_t&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}function cE(s,c){return rm(4,2,s,c)}function uE(s,c){return rm(4,4,s,c)}function dE(s,c){if(typeof c=="function"){s=s();var h=c(s);return function(){typeof h=="function"?h():c(null)}}if(c!=null)return s=s(),c.current=s,function(){c.current=null}}function fE(s,c,h){h=h!=null?h.concat([s]):null,rm(4,4,dE.bind(null,c,s),h)}function W0(){}function hE(s,c){var h=zn();c=c===void 0?null:c;var y=h.memoizedState;return c!==null&&$0(c,y[1])?y[0]:(h.memoizedState=[s,c],s)}function pE(s,c){var h=zn();c=c===void 0?null:c;var y=h.memoizedState;if(c!==null&&$0(c,y[1]))return y[0];if(y=s(),vl){Kt(!0);try{s()}finally{Kt(!1)}}return h.memoizedState=[y,c],y}function Z0(s,c,h){return h===void 0||(ls&1073741824)!==0&&(xt&261930)===0?s.memoizedState=c:(s.memoizedState=h,s=m_(),ot.lanes|=s,lo|=s,h)}function mE(s,c,h,y){return ri(h,c)?h:Gc.current!==null?(s=Z0(s,h,y),ri(s,c)||(In=!0),s):(ls&42)===0||(ls&1073741824)!==0&&(xt&261930)===0?(In=!0,s.memoizedState=h):(s=m_(),ot.lanes|=s,lo|=s,c)}function gE(s,c,h,y,w){var N=J.p;J.p=N!==0&&8>N?N:8;var z=H.T,L={};H.T=L,eb(s,!1,c,h);try{var K=w(),ae=H.S;if(ae!==null&&ae(L,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var me=L9(K,y);of(s,c,me,ci(s))}else of(s,c,y,ci(s))}catch(we){of(s,c,{then:function(){},status:"rejected",reason:we},ci())}finally{J.p=N,z!==null&&L.types!==null&&(z.types=L.types),H.T=z}}function H9(){}function X0(s,c,h,y){if(s.tag!==5)throw Error(r(476));var w=yE(s).queue;gE(s,w,c,oe,h===null?H9:function(){return vE(s),h(y)})}function yE(s){var c=s.memoizedState;if(c!==null)return c;c={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:oe},next:null};var h={};return c.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:h},next:null},s.memoizedState=c,s=s.alternate,s!==null&&(s.memoizedState=c),c}function vE(s){var c=yE(s);c.next===null&&(c=s.alternate.memoizedState),of(s,c.next.queue,{},ci())}function J0(){return or(Nf)}function xE(){return zn().memoizedState}function bE(){return zn().memoizedState}function K9(s){for(var c=s.return;c!==null;){switch(c.tag){case 24:case 3:var h=ci();s=no(h);var y=ro(c,s,h);y!==null&&(Kr(y,c,h),tf(y,c,h)),c={cache:O0()},s.payload=c;return}c=c.return}}function G9(s,c,h){var y=ci();h={lane:y,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},im(s)?SE(c,h):(h=y0(s,c,h,y),h!==null&&(Kr(h,s,y),jE(h,c,y)))}function wE(s,c,h){var y=ci();of(s,c,h,y)}function of(s,c,h,y){var w={lane:y,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(im(s))SE(c,w);else{var N=s.alternate;if(s.lanes===0&&(N===null||N.lanes===0)&&(N=c.lastRenderedReducer,N!==null))try{var z=c.lastRenderedState,L=N(z,h);if(w.hasEagerState=!0,w.eagerState=L,ri(L,z))return Lp(s,c,w,0),Vt===null&&Ip(),!1}catch{}if(h=y0(s,c,w,y),h!==null)return Kr(h,s,y),jE(h,c,y),!0}return!1}function eb(s,c,h,y){if(y={lane:2,revertLane:Pb(),gesture:null,action:y,hasEagerState:!1,eagerState:null,next:null},im(s)){if(c)throw Error(r(479))}else c=y0(s,h,y,2),c!==null&&Kr(c,s,2)}function im(s){var c=s.alternate;return s===ot||c!==null&&c===ot}function SE(s,c){Vc=Zp=!0;var h=s.pending;h===null?c.next=c:(c.next=h.next,h.next=c),s.pending=c}function jE(s,c,h){if((h&4194048)!==0){var y=c.lanes;y&=s.pendingLanes,h|=y,c.lanes=h,Np(s,h)}}var lf={readContext:or,use:em,useCallback:Sn,useContext:Sn,useEffect:Sn,useImperativeHandle:Sn,useLayoutEffect:Sn,useInsertionEffect:Sn,useMemo:Sn,useReducer:Sn,useRef:Sn,useState:Sn,useDebugValue:Sn,useDeferredValue:Sn,useTransition:Sn,useSyncExternalStore:Sn,useId:Sn,useHostTransitionStatus:Sn,useFormState:Sn,useActionState:Sn,useOptimistic:Sn,useMemoCache:Sn,useCacheRefresh:Sn};lf.useEffectEvent=Sn;var NE={readContext:or,use:em,useCallback:function(s,c){return Er().memoizedState=[s,c===void 0?null:c],s},useContext:or,useEffect:oE,useImperativeHandle:function(s,c,h){h=h!=null?h.concat([s]):null,nm(4194308,4,dE.bind(null,c,s),h)},useLayoutEffect:function(s,c){return nm(4194308,4,s,c)},useInsertionEffect:function(s,c){nm(4,2,s,c)},useMemo:function(s,c){var h=Er();c=c===void 0?null:c;var y=s();if(vl){Kt(!0);try{s()}finally{Kt(!1)}}return h.memoizedState=[y,c],y},useReducer:function(s,c,h){var y=Er();if(h!==void 0){var w=h(c);if(vl){Kt(!0);try{h(c)}finally{Kt(!1)}}}else w=c;return y.memoizedState=y.baseState=w,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:w},y.queue=s,s=s.dispatch=G9.bind(null,ot,s),[y.memoizedState,s]},useRef:function(s){var c=Er();return s={current:s},c.memoizedState=s},useState:function(s){s=V0(s);var c=s.queue,h=wE.bind(null,ot,c);return c.dispatch=h,[s.memoizedState,h]},useDebugValue:W0,useDeferredValue:function(s,c){var h=Er();return Z0(h,s,c)},useTransition:function(){var s=V0(!1);return s=gE.bind(null,ot,s.queue,!0,!1),Er().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,c,h){var y=ot,w=Er();if(wt){if(h===void 0)throw Error(r(407));h=h()}else{if(h=c(),Vt===null)throw Error(r(349));(xt&127)!==0||KO(y,c,h)}w.memoizedState=h;var N={value:h,getSnapshot:c};return w.queue=N,oE(VO.bind(null,y,N,s),[s]),y.flags|=2048,Yc(9,{destroy:void 0},GO.bind(null,y,N,h,c),null),h},useId:function(){var s=Er(),c=Vt.identifierPrefix;if(wt){var h=Na,y=ja;h=(y&~(1<<32-de(y)-1)).toString(32)+h,c="_"+c+"R_"+h,h=Xp++,0<h&&(c+="H"+h.toString(32)),c+="_"}else h=$9++,c="_"+c+"r_"+h.toString(32)+"_";return s.memoizedState=c},useHostTransitionStatus:J0,useFormState:nE,useActionState:nE,useOptimistic:function(s){var c=Er();c.memoizedState=c.baseState=s;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=h,c=eb.bind(null,ot,!0,h),h.dispatch=c,[s,c]},useMemoCache:H0,useCacheRefresh:function(){return Er().memoizedState=K9.bind(null,ot)},useEffectEvent:function(s){var c=Er(),h={impl:s};return c.memoizedState=h,function(){if((_t&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},tb={readContext:or,use:em,useCallback:hE,useContext:or,useEffect:Y0,useImperativeHandle:fE,useInsertionEffect:cE,useLayoutEffect:uE,useMemo:pE,useReducer:tm,useRef:sE,useState:function(){return tm(cs)},useDebugValue:W0,useDeferredValue:function(s,c){var h=zn();return mE(h,$t.memoizedState,s,c)},useTransition:function(){var s=tm(cs)[0],c=zn().memoizedState;return[typeof s=="boolean"?s:sf(s),c]},useSyncExternalStore:HO,useId:xE,useHostTransitionStatus:J0,useFormState:rE,useActionState:rE,useOptimistic:function(s,c){var h=zn();return WO(h,$t,s,c)},useMemoCache:H0,useCacheRefresh:bE};tb.useEffectEvent=lE;var kE={readContext:or,use:em,useCallback:hE,useContext:or,useEffect:Y0,useImperativeHandle:fE,useInsertionEffect:cE,useLayoutEffect:uE,useMemo:pE,useReducer:G0,useRef:sE,useState:function(){return G0(cs)},useDebugValue:W0,useDeferredValue:function(s,c){var h=zn();return $t===null?Z0(h,s,c):mE(h,$t.memoizedState,s,c)},useTransition:function(){var s=G0(cs)[0],c=zn().memoizedState;return[typeof s=="boolean"?s:sf(s),c]},useSyncExternalStore:HO,useId:xE,useHostTransitionStatus:J0,useFormState:aE,useActionState:aE,useOptimistic:function(s,c){var h=zn();return $t!==null?WO(h,$t,s,c):(h.baseState=s,[s,h.queue.dispatch])},useMemoCache:H0,useCacheRefresh:bE};kE.useEffectEvent=lE;function nb(s,c,h,y){c=s.memoizedState,h=h(y,c),h=h==null?c:m({},c,h),s.memoizedState=h,s.lanes===0&&(s.updateQueue.baseState=h)}var rb={enqueueSetState:function(s,c,h){s=s._reactInternals;var y=ci(),w=no(y);w.payload=c,h!=null&&(w.callback=h),c=ro(s,w,y),c!==null&&(Kr(c,s,y),tf(c,s,y))},enqueueReplaceState:function(s,c,h){s=s._reactInternals;var y=ci(),w=no(y);w.tag=1,w.payload=c,h!=null&&(w.callback=h),c=ro(s,w,y),c!==null&&(Kr(c,s,y),tf(c,s,y))},enqueueForceUpdate:function(s,c){s=s._reactInternals;var h=ci(),y=no(h);y.tag=2,c!=null&&(y.callback=c),c=ro(s,y,h),c!==null&&(Kr(c,s,h),tf(c,s,h))}};function CE(s,c,h,y,w,N,z){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(y,N,z):c.prototype&&c.prototype.isPureReactComponent?!Vd(h,y)||!Vd(w,N):!0}function AE(s,c,h,y){s=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(h,y),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(h,y),c.state!==s&&rb.enqueueReplaceState(c,c.state,null)}function xl(s,c){var h=c;if("ref"in c){h={};for(var y in c)y!=="ref"&&(h[y]=c[y])}if(s=s.defaultProps){h===c&&(h=m({},h));for(var w in s)h[w]===void 0&&(h[w]=s[w])}return h}function OE(s){Mp(s)}function EE(s){console.error(s)}function _E(s){Mp(s)}function am(s,c){try{var h=s.onUncaughtError;h(c.value,{componentStack:c.stack})}catch(y){setTimeout(function(){throw y})}}function zE(s,c,h){try{var y=s.onCaughtError;y(h.value,{componentStack:h.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(w){setTimeout(function(){throw w})}}function ib(s,c,h){return h=no(h),h.tag=3,h.payload={element:null},h.callback=function(){am(s,c)},h}function PE(s){return s=no(s),s.tag=3,s}function TE(s,c,h,y){var w=h.type.getDerivedStateFromError;if(typeof w=="function"){var N=y.value;s.payload=function(){return w(N)},s.callback=function(){zE(c,h,y)}}var z=h.stateNode;z!==null&&typeof z.componentDidCatch=="function"&&(s.callback=function(){zE(c,h,y),typeof w!="function"&&(co===null?co=new Set([this]):co.add(this));var L=y.stack;this.componentDidCatch(y.value,{componentStack:L!==null?L:""})})}function V9(s,c,h,y,w){if(h.flags|=32768,y!==null&&typeof y=="object"&&typeof y.then=="function"){if(c=h.alternate,c!==null&&Uc(c,h,w,!0),h=ai.current,h!==null){switch(h.tag){case 31:case 13:return Ei===null?ym():h.alternate===null&&jn===0&&(jn=3),h.flags&=-257,h.flags|=65536,h.lanes=w,y===Gp?h.flags|=16384:(c=h.updateQueue,c===null?h.updateQueue=new Set([y]):c.add(y),Eb(s,y,w)),!1;case 22:return h.flags|=65536,y===Gp?h.flags|=16384:(c=h.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([y])},h.updateQueue=c):(h=c.retryQueue,h===null?c.retryQueue=new Set([y]):h.add(y)),Eb(s,y,w)),!1}throw Error(r(435,h.tag))}return Eb(s,y,w),ym(),!1}if(wt)return c=ai.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=w,y!==j0&&(s=Error(r(422),{cause:y}),Wd(ki(s,h)))):(y!==j0&&(c=Error(r(423),{cause:y}),Wd(ki(c,h))),s=s.current.alternate,s.flags|=65536,w&=-w,s.lanes|=w,y=ki(y,h),w=ib(s.stateNode,y,w),R0(s,w),jn!==4&&(jn=2)),!1;var N=Error(r(520),{cause:y});if(N=ki(N,h),gf===null?gf=[N]:gf.push(N),jn!==4&&(jn=2),c===null)return!0;y=ki(y,h),h=c;do{switch(h.tag){case 3:return h.flags|=65536,s=w&-w,h.lanes|=s,s=ib(h.stateNode,y,s),R0(h,s),!1;case 1:if(c=h.type,N=h.stateNode,(h.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&(co===null||!co.has(N))))return h.flags|=65536,w&=-w,h.lanes|=w,w=PE(w),TE(w,s,h,y),R0(h,w),!1}h=h.return}while(h!==null);return!1}var ab=Error(r(461)),In=!1;function lr(s,c,h,y){c.child=s===null?IO(c,null,h,y):yl(c,s.child,h,y)}function RE(s,c,h,y,w){h=h.render;var N=c.ref;if("ref"in y){var z={};for(var L in y)L!=="ref"&&(z[L]=y[L])}else z=y;return hl(c),y=B0(s,c,h,z,N,w),L=U0(),s!==null&&!In?(q0(s,c,w),us(s,c,w)):(wt&&L&&w0(c),c.flags|=1,lr(s,c,y,w),c.child)}function DE(s,c,h,y,w){if(s===null){var N=h.type;return typeof N=="function"&&!v0(N)&&N.defaultProps===void 0&&h.compare===null?(c.tag=15,c.type=N,ME(s,c,N,y,w)):(s=Bp(h.type,null,y,c,c.mode,w),s.ref=c.ref,s.return=c,c.child=s)}if(N=s.child,!hb(s,w)){var z=N.memoizedProps;if(h=h.compare,h=h!==null?h:Vd,h(z,y)&&s.ref===c.ref)return us(s,c,w)}return c.flags|=1,s=is(N,y),s.ref=c.ref,s.return=c,c.child=s}function ME(s,c,h,y,w){if(s!==null){var N=s.memoizedProps;if(Vd(N,y)&&s.ref===c.ref)if(In=!1,c.pendingProps=y=N,hb(s,w))(s.flags&131072)!==0&&(In=!0);else return c.lanes=s.lanes,us(s,c,w)}return sb(s,c,h,y,w)}function IE(s,c,h,y){var w=y.children,N=s!==null?s.memoizedState:null;if(s===null&&c.stateNode===null&&(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),y.mode==="hidden"){if((c.flags&128)!==0){if(N=N!==null?N.baseLanes|h:h,s!==null){for(y=c.child=s.child,w=0;y!==null;)w=w|y.lanes|y.childLanes,y=y.sibling;y=w&~N}else y=0,c.child=null;return LE(s,c,N,h,y)}if((h&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},s!==null&&Hp(c,N!==null?N.cachePool:null),N!==null?BO(c,N):M0(),UO(c);else return y=c.lanes=536870912,LE(s,c,N!==null?N.baseLanes|h:h,h,y)}else N!==null?(Hp(c,N.cachePool),BO(c,N),ao(),c.memoizedState=null):(s!==null&&Hp(c,null),M0(),ao());return lr(s,c,w,h),c.child}function cf(s,c){return s!==null&&s.tag===22||c.stateNode!==null||(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.sibling}function LE(s,c,h,y,w){var N=_0();return N=N===null?null:{parent:Dn._currentValue,pool:N},c.memoizedState={baseLanes:h,cachePool:N},s!==null&&Hp(c,null),M0(),UO(c),s!==null&&Uc(s,c,y,!0),c.childLanes=w,null}function sm(s,c){return c=lm({mode:c.mode,children:c.children},s.mode),c.ref=s.ref,s.child=c,c.return=s,c}function $E(s,c,h){return yl(c,s.child,null,h),s=sm(c,c.pendingProps),s.flags|=2,si(c),c.memoizedState=null,s}function Q9(s,c,h){var y=c.pendingProps,w=(c.flags&128)!==0;if(c.flags&=-129,s===null){if(wt){if(y.mode==="hidden")return s=sm(c,y),c.lanes=536870912,cf(null,s);if(L0(c),(s=rn)?(s=Z_(s,Oi),s=s!==null&&s.data==="&"?s:null,s!==null&&(c.memoizedState={dehydrated:s,treeContext:Zs!==null?{id:ja,overflow:Na}:null,retryLane:536870912,hydrationErrors:null},h=SO(s),h.return=c,c.child=h,sr=c,rn=null)):s=null,s===null)throw Js(c);return c.lanes=536870912,null}return sm(c,y)}var N=s.memoizedState;if(N!==null){var z=N.dehydrated;if(L0(c),w)if(c.flags&256)c.flags&=-257,c=$E(s,c,h);else if(c.memoizedState!==null)c.child=s.child,c.flags|=128,c=null;else throw Error(r(558));else if(In||Uc(s,c,h,!1),w=(h&s.childLanes)!==0,In||w){if(y=Vt,y!==null&&(z=kp(y,h),z!==0&&z!==N.retryLane))throw N.retryLane=z,cl(s,z),Kr(y,s,z),ab;ym(),c=$E(s,c,h)}else s=N.treeContext,rn=_i(z.nextSibling),sr=c,wt=!0,Xs=null,Oi=!1,s!==null&&kO(c,s),c=sm(c,y),c.flags|=4096;return c}return s=is(s.child,{mode:y.mode,children:y.children}),s.ref=c.ref,c.child=s,s.return=c,s}function om(s,c){var h=c.ref;if(h===null)s!==null&&s.ref!==null&&(c.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(r(284));(s===null||s.ref!==h)&&(c.flags|=4194816)}}function sb(s,c,h,y,w){return hl(c),h=B0(s,c,h,y,void 0,w),y=U0(),s!==null&&!In?(q0(s,c,w),us(s,c,w)):(wt&&y&&w0(c),c.flags|=1,lr(s,c,h,w),c.child)}function BE(s,c,h,y,w,N){return hl(c),c.updateQueue=null,h=FO(c,y,h,w),qO(s),y=U0(),s!==null&&!In?(q0(s,c,N),us(s,c,N)):(wt&&y&&w0(c),c.flags|=1,lr(s,c,h,N),c.child)}function UE(s,c,h,y,w){if(hl(c),c.stateNode===null){var N=Ic,z=h.contextType;typeof z=="object"&&z!==null&&(N=or(z)),N=new h(y,N),c.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,N.updater=rb,c.stateNode=N,N._reactInternals=c,N=c.stateNode,N.props=y,N.state=c.memoizedState,N.refs={},P0(c),z=h.contextType,N.context=typeof z=="object"&&z!==null?or(z):Ic,N.state=c.memoizedState,z=h.getDerivedStateFromProps,typeof z=="function"&&(nb(c,h,z,y),N.state=c.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(z=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),z!==N.state&&rb.enqueueReplaceState(N,N.state,null),rf(c,y,N,w),nf(),N.state=c.memoizedState),typeof N.componentDidMount=="function"&&(c.flags|=4194308),y=!0}else if(s===null){N=c.stateNode;var L=c.memoizedProps,K=xl(h,L);N.props=K;var ae=N.context,me=h.contextType;z=Ic,typeof me=="object"&&me!==null&&(z=or(me));var we=h.getDerivedStateFromProps;me=typeof we=="function"||typeof N.getSnapshotBeforeUpdate=="function",L=c.pendingProps!==L,me||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(L||ae!==z)&&AE(c,N,y,z),to=!1;var le=c.memoizedState;N.state=le,rf(c,y,N,w),nf(),ae=c.memoizedState,L||le!==ae||to?(typeof we=="function"&&(nb(c,h,we,y),ae=c.memoizedState),(K=to||CE(c,h,K,y,le,ae,z))?(me||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(c.flags|=4194308)):(typeof N.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=y,c.memoizedState=ae),N.props=y,N.state=ae,N.context=z,y=K):(typeof N.componentDidMount=="function"&&(c.flags|=4194308),y=!1)}else{N=c.stateNode,T0(s,c),z=c.memoizedProps,me=xl(h,z),N.props=me,we=c.pendingProps,le=N.context,ae=h.contextType,K=Ic,typeof ae=="object"&&ae!==null&&(K=or(ae)),L=h.getDerivedStateFromProps,(ae=typeof L=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(z!==we||le!==K)&&AE(c,N,y,K),to=!1,le=c.memoizedState,N.state=le,rf(c,y,N,w),nf();var ue=c.memoizedState;z!==we||le!==ue||to||s!==null&&s.dependencies!==null&&qp(s.dependencies)?(typeof L=="function"&&(nb(c,h,L,y),ue=c.memoizedState),(me=to||CE(c,h,me,y,le,ue,K)||s!==null&&s.dependencies!==null&&qp(s.dependencies))?(ae||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(y,ue,K),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(y,ue,K)),typeof N.componentDidUpdate=="function"&&(c.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof N.componentDidUpdate!="function"||z===s.memoizedProps&&le===s.memoizedState||(c.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||z===s.memoizedProps&&le===s.memoizedState||(c.flags|=1024),c.memoizedProps=y,c.memoizedState=ue),N.props=y,N.state=ue,N.context=K,y=me):(typeof N.componentDidUpdate!="function"||z===s.memoizedProps&&le===s.memoizedState||(c.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||z===s.memoizedProps&&le===s.memoizedState||(c.flags|=1024),y=!1)}return N=y,om(s,c),y=(c.flags&128)!==0,N||y?(N=c.stateNode,h=y&&typeof h.getDerivedStateFromError!="function"?null:N.render(),c.flags|=1,s!==null&&y?(c.child=yl(c,s.child,null,w),c.child=yl(c,null,h,w)):lr(s,c,h,w),c.memoizedState=N.state,s=c.child):s=us(s,c,w),s}function qE(s,c,h,y){return dl(),c.flags|=256,lr(s,c,h,y),c.child}var ob={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function lb(s){return{baseLanes:s,cachePool:zO()}}function cb(s,c,h){return s=s!==null?s.childLanes&~h:0,c&&(s|=li),s}function FE(s,c,h){var y=c.pendingProps,w=!1,N=(c.flags&128)!==0,z;if((z=N)||(z=s!==null&&s.memoizedState===null?!1:(_n.current&2)!==0),z&&(w=!0,c.flags&=-129),z=(c.flags&32)!==0,c.flags&=-33,s===null){if(wt){if(w?io(c):ao(),(s=rn)?(s=Z_(s,Oi),s=s!==null&&s.data!=="&"?s:null,s!==null&&(c.memoizedState={dehydrated:s,treeContext:Zs!==null?{id:ja,overflow:Na}:null,retryLane:536870912,hydrationErrors:null},h=SO(s),h.return=c,c.child=h,sr=c,rn=null)):s=null,s===null)throw Js(c);return Kb(s)?c.lanes=32:c.lanes=536870912,null}var L=y.children;return y=y.fallback,w?(ao(),w=c.mode,L=lm({mode:"hidden",children:L},w),y=ul(y,w,h,null),L.return=c,y.return=c,L.sibling=y,c.child=L,y=c.child,y.memoizedState=lb(h),y.childLanes=cb(s,z,h),c.memoizedState=ob,cf(null,y)):(io(c),ub(c,L))}var K=s.memoizedState;if(K!==null&&(L=K.dehydrated,L!==null)){if(N)c.flags&256?(io(c),c.flags&=-257,c=db(s,c,h)):c.memoizedState!==null?(ao(),c.child=s.child,c.flags|=128,c=null):(ao(),L=y.fallback,w=c.mode,y=lm({mode:"visible",children:y.children},w),L=ul(L,w,h,null),L.flags|=2,y.return=c,L.return=c,y.sibling=L,c.child=y,yl(c,s.child,null,h),y=c.child,y.memoizedState=lb(h),y.childLanes=cb(s,z,h),c.memoizedState=ob,c=cf(null,y));else if(io(c),Kb(L)){if(z=L.nextSibling&&L.nextSibling.dataset,z)var ae=z.dgst;z=ae,y=Error(r(419)),y.stack="",y.digest=z,Wd({value:y,source:null,stack:null}),c=db(s,c,h)}else if(In||Uc(s,c,h,!1),z=(h&s.childLanes)!==0,In||z){if(z=Vt,z!==null&&(y=kp(z,h),y!==0&&y!==K.retryLane))throw K.retryLane=y,cl(s,y),Kr(z,s,y),ab;Hb(L)||ym(),c=db(s,c,h)}else Hb(L)?(c.flags|=192,c.child=s.child,c=null):(s=K.treeContext,rn=_i(L.nextSibling),sr=c,wt=!0,Xs=null,Oi=!1,s!==null&&kO(c,s),c=ub(c,y.children),c.flags|=4096);return c}return w?(ao(),L=y.fallback,w=c.mode,K=s.child,ae=K.sibling,y=is(K,{mode:"hidden",children:y.children}),y.subtreeFlags=K.subtreeFlags&65011712,ae!==null?L=is(ae,L):(L=ul(L,w,h,null),L.flags|=2),L.return=c,y.return=c,y.sibling=L,c.child=y,cf(null,y),y=c.child,L=s.child.memoizedState,L===null?L=lb(h):(w=L.cachePool,w!==null?(K=Dn._currentValue,w=w.parent!==K?{parent:K,pool:K}:w):w=zO(),L={baseLanes:L.baseLanes|h,cachePool:w}),y.memoizedState=L,y.childLanes=cb(s,z,h),c.memoizedState=ob,cf(s.child,y)):(io(c),h=s.child,s=h.sibling,h=is(h,{mode:"visible",children:y.children}),h.return=c,h.sibling=null,s!==null&&(z=c.deletions,z===null?(c.deletions=[s],c.flags|=16):z.push(s)),c.child=h,c.memoizedState=null,h)}function ub(s,c){return c=lm({mode:"visible",children:c},s.mode),c.return=s,s.child=c}function lm(s,c){return s=ii(22,s,null,c),s.lanes=0,s}function db(s,c,h){return yl(c,s.child,null,h),s=ub(c,c.pendingProps.children),s.flags|=2,c.memoizedState=null,s}function HE(s,c,h){s.lanes|=c;var y=s.alternate;y!==null&&(y.lanes|=c),C0(s.return,c,h)}function fb(s,c,h,y,w,N){var z=s.memoizedState;z===null?s.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:y,tail:h,tailMode:w,treeForkCount:N}:(z.isBackwards=c,z.rendering=null,z.renderingStartTime=0,z.last=y,z.tail=h,z.tailMode=w,z.treeForkCount=N)}function KE(s,c,h){var y=c.pendingProps,w=y.revealOrder,N=y.tail;y=y.children;var z=_n.current,L=(z&2)!==0;if(L?(z=z&1|2,c.flags|=128):z&=1,D(_n,z),lr(s,c,y,h),y=wt?Yd:0,!L&&s!==null&&(s.flags&128)!==0)e:for(s=c.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&HE(s,h,c);else if(s.tag===19)HE(s,h,c);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===c)break e;for(;s.sibling===null;){if(s.return===null||s.return===c)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(w){case"forwards":for(h=c.child,w=null;h!==null;)s=h.alternate,s!==null&&Wp(s)===null&&(w=h),h=h.sibling;h=w,h===null?(w=c.child,c.child=null):(w=h.sibling,h.sibling=null),fb(c,!1,w,h,N,y);break;case"backwards":case"unstable_legacy-backwards":for(h=null,w=c.child,c.child=null;w!==null;){if(s=w.alternate,s!==null&&Wp(s)===null){c.child=w;break}s=w.sibling,w.sibling=h,h=w,w=s}fb(c,!0,h,null,N,y);break;case"together":fb(c,!1,null,null,void 0,y);break;default:c.memoizedState=null}return c.child}function us(s,c,h){if(s!==null&&(c.dependencies=s.dependencies),lo|=c.lanes,(h&c.childLanes)===0)if(s!==null){if(Uc(s,c,h,!1),(h&c.childLanes)===0)return null}else return null;if(s!==null&&c.child!==s.child)throw Error(r(153));if(c.child!==null){for(s=c.child,h=is(s,s.pendingProps),c.child=h,h.return=c;s.sibling!==null;)s=s.sibling,h=h.sibling=is(s,s.pendingProps),h.return=c;h.sibling=null}return c.child}function hb(s,c){return(s.lanes&c)!==0?!0:(s=s.dependencies,!!(s!==null&&qp(s)))}function Y9(s,c,h){switch(c.tag){case 3:je(c,c.stateNode.containerInfo),eo(c,Dn,s.memoizedState.cache),dl();break;case 27:case 5:pe(c);break;case 4:je(c,c.stateNode.containerInfo);break;case 10:eo(c,c.type,c.memoizedProps.value);break;case 31:if(c.memoizedState!==null)return c.flags|=128,L0(c),null;break;case 13:var y=c.memoizedState;if(y!==null)return y.dehydrated!==null?(io(c),c.flags|=128,null):(h&c.child.childLanes)!==0?FE(s,c,h):(io(c),s=us(s,c,h),s!==null?s.sibling:null);io(c);break;case 19:var w=(s.flags&128)!==0;if(y=(h&c.childLanes)!==0,y||(Uc(s,c,h,!1),y=(h&c.childLanes)!==0),w){if(y)return KE(s,c,h);c.flags|=128}if(w=c.memoizedState,w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),D(_n,_n.current),y)break;return null;case 22:return c.lanes=0,IE(s,c,h,c.pendingProps);case 24:eo(c,Dn,s.memoizedState.cache)}return us(s,c,h)}function GE(s,c,h){if(s!==null)if(s.memoizedProps!==c.pendingProps)In=!0;else{if(!hb(s,h)&&(c.flags&128)===0)return In=!1,Y9(s,c,h);In=(s.flags&131072)!==0}else In=!1,wt&&(c.flags&1048576)!==0&&NO(c,Yd,c.index);switch(c.lanes=0,c.tag){case 16:e:{var y=c.pendingProps;if(s=ml(c.elementType),c.type=s,typeof s=="function")v0(s)?(y=xl(s,y),c.tag=1,c=UE(null,c,s,y,h)):(c.tag=0,c=sb(null,c,s,y,h));else{if(s!=null){var w=s.$$typeof;if(w===A){c.tag=11,c=RE(null,c,s,y,h);break e}else if(w===_){c.tag=14,c=DE(null,c,s,y,h);break e}}throw c=X(s)||s,Error(r(306,c,""))}}return c;case 0:return sb(s,c,c.type,c.pendingProps,h);case 1:return y=c.type,w=xl(y,c.pendingProps),UE(s,c,y,w,h);case 3:e:{if(je(c,c.stateNode.containerInfo),s===null)throw Error(r(387));y=c.pendingProps;var N=c.memoizedState;w=N.element,T0(s,c),rf(c,y,null,h);var z=c.memoizedState;if(y=z.cache,eo(c,Dn,y),y!==N.cache&&A0(c,[Dn],h,!0),nf(),y=z.element,N.isDehydrated)if(N={element:y,isDehydrated:!1,cache:z.cache},c.updateQueue.baseState=N,c.memoizedState=N,c.flags&256){c=qE(s,c,y,h);break e}else if(y!==w){w=ki(Error(r(424)),c),Wd(w),c=qE(s,c,y,h);break e}else for(s=c.stateNode.containerInfo,s.nodeType===9?s=s.body:s=s.nodeName==="HTML"?s.ownerDocument.body:s,rn=_i(s.firstChild),sr=c,wt=!0,Xs=null,Oi=!0,h=IO(c,null,y,h),c.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(dl(),y===w){c=us(s,c,h);break e}lr(s,c,y,h)}c=c.child}return c;case 26:return om(s,c),s===null?(h=rz(c.type,null,c.pendingProps,null))?c.memoizedState=h:wt||(h=c.type,s=c.pendingProps,y=Nm(ne.current).createElement(h),y[tt]=c,y[jt]=s,cr(y,h,s),yn(y),c.stateNode=y):c.memoizedState=rz(c.type,s.memoizedProps,c.pendingProps,s.memoizedState),null;case 27:return pe(c),s===null&&wt&&(y=c.stateNode=ez(c.type,c.pendingProps,ne.current),sr=c,Oi=!0,w=rn,po(c.type)?(Gb=w,rn=_i(y.firstChild)):rn=w),lr(s,c,c.pendingProps.children,h),om(s,c),s===null&&(c.flags|=4194304),c.child;case 5:return s===null&&wt&&((w=y=rn)&&(y=kH(y,c.type,c.pendingProps,Oi),y!==null?(c.stateNode=y,sr=c,rn=_i(y.firstChild),Oi=!1,w=!0):w=!1),w||Js(c)),pe(c),w=c.type,N=c.pendingProps,z=s!==null?s.memoizedProps:null,y=N.children,Ub(w,N)?y=null:z!==null&&Ub(w,z)&&(c.flags|=32),c.memoizedState!==null&&(w=B0(s,c,B9,null,null,h),Nf._currentValue=w),om(s,c),lr(s,c,y,h),c.child;case 6:return s===null&&wt&&((s=h=rn)&&(h=CH(h,c.pendingProps,Oi),h!==null?(c.stateNode=h,sr=c,rn=null,s=!0):s=!1),s||Js(c)),null;case 13:return FE(s,c,h);case 4:return je(c,c.stateNode.containerInfo),y=c.pendingProps,s===null?c.child=yl(c,null,y,h):lr(s,c,y,h),c.child;case 11:return RE(s,c,c.type,c.pendingProps,h);case 7:return lr(s,c,c.pendingProps,h),c.child;case 8:return lr(s,c,c.pendingProps.children,h),c.child;case 12:return lr(s,c,c.pendingProps.children,h),c.child;case 10:return y=c.pendingProps,eo(c,c.type,y.value),lr(s,c,y.children,h),c.child;case 9:return w=c.type._context,y=c.pendingProps.children,hl(c),w=or(w),y=y(w),c.flags|=1,lr(s,c,y,h),c.child;case 14:return DE(s,c,c.type,c.pendingProps,h);case 15:return ME(s,c,c.type,c.pendingProps,h);case 19:return KE(s,c,h);case 31:return Q9(s,c,h);case 22:return IE(s,c,h,c.pendingProps);case 24:return hl(c),y=or(Dn),s===null?(w=_0(),w===null&&(w=Vt,N=O0(),w.pooledCache=N,N.refCount++,N!==null&&(w.pooledCacheLanes|=h),w=N),c.memoizedState={parent:y,cache:w},P0(c),eo(c,Dn,w)):((s.lanes&h)!==0&&(T0(s,c),rf(c,null,null,h),nf()),w=s.memoizedState,N=c.memoizedState,w.parent!==y?(w={parent:y,cache:y},c.memoizedState=w,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=w),eo(c,Dn,y)):(y=N.cache,eo(c,Dn,y),y!==w.cache&&A0(c,[Dn],h,!0))),lr(s,c,c.pendingProps.children,h),c.child;case 29:throw c.pendingProps}throw Error(r(156,c.tag))}function ds(s){s.flags|=4}function pb(s,c,h,y,w){if((c=(s.mode&32)!==0)&&(c=!1),c){if(s.flags|=16777216,(w&335544128)===w)if(s.stateNode.complete)s.flags|=8192;else if(x_())s.flags|=8192;else throw gl=Gp,z0}else s.flags&=-16777217}function VE(s,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!lz(c))if(x_())s.flags|=8192;else throw gl=Gp,z0}function cm(s,c){c!==null&&(s.flags|=4),s.flags&16384&&(c=s.tag!==22?jp():536870912,s.lanes|=c,Jc|=c)}function uf(s,c){if(!wt)switch(s.tailMode){case"hidden":c=s.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?s.tail=null:h.sibling=null;break;case"collapsed":h=s.tail;for(var y=null;h!==null;)h.alternate!==null&&(y=h),h=h.sibling;y===null?c||s.tail===null?s.tail=null:s.tail.sibling=null:y.sibling=null}}function an(s){var c=s.alternate!==null&&s.alternate.child===s.child,h=0,y=0;if(c)for(var w=s.child;w!==null;)h|=w.lanes|w.childLanes,y|=w.subtreeFlags&65011712,y|=w.flags&65011712,w.return=s,w=w.sibling;else for(w=s.child;w!==null;)h|=w.lanes|w.childLanes,y|=w.subtreeFlags,y|=w.flags,w.return=s,w=w.sibling;return s.subtreeFlags|=y,s.childLanes=h,c}function W9(s,c,h){var y=c.pendingProps;switch(S0(c),c.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return an(c),null;case 1:return an(c),null;case 3:return h=c.stateNode,y=null,s!==null&&(y=s.memoizedState.cache),c.memoizedState.cache!==y&&(c.flags|=2048),os(Dn),ee(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(s===null||s.child===null)&&(Bc(c)?ds(c):s===null||s.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,N0())),an(c),null;case 26:var w=c.type,N=c.memoizedState;return s===null?(ds(c),N!==null?(an(c),VE(c,N)):(an(c),pb(c,w,null,y,h))):N?N!==s.memoizedState?(ds(c),an(c),VE(c,N)):(an(c),c.flags&=-16777217):(s=s.memoizedProps,s!==y&&ds(c),an(c),pb(c,w,s,y,h)),null;case 27:if(Ee(c),h=ne.current,w=c.type,s!==null&&c.stateNode!=null)s.memoizedProps!==y&&ds(c);else{if(!y){if(c.stateNode===null)throw Error(r(166));return an(c),null}s=G.current,Bc(c)?CO(c):(s=ez(w,y,h),c.stateNode=s,ds(c))}return an(c),null;case 5:if(Ee(c),w=c.type,s!==null&&c.stateNode!=null)s.memoizedProps!==y&&ds(c);else{if(!y){if(c.stateNode===null)throw Error(r(166));return an(c),null}if(N=G.current,Bc(c))CO(c);else{var z=Nm(ne.current);switch(N){case 1:N=z.createElementNS("http://www.w3.org/2000/svg",w);break;case 2:N=z.createElementNS("http://www.w3.org/1998/Math/MathML",w);break;default:switch(w){case"svg":N=z.createElementNS("http://www.w3.org/2000/svg",w);break;case"math":N=z.createElementNS("http://www.w3.org/1998/Math/MathML",w);break;case"script":N=z.createElement("div"),N.innerHTML="<script><\/script>",N=N.removeChild(N.firstChild);break;case"select":N=typeof y.is=="string"?z.createElement("select",{is:y.is}):z.createElement("select"),y.multiple?N.multiple=!0:y.size&&(N.size=y.size);break;default:N=typeof y.is=="string"?z.createElement(w,{is:y.is}):z.createElement(w)}}N[tt]=c,N[jt]=y;e:for(z=c.child;z!==null;){if(z.tag===5||z.tag===6)N.appendChild(z.stateNode);else if(z.tag!==4&&z.tag!==27&&z.child!==null){z.child.return=z,z=z.child;continue}if(z===c)break e;for(;z.sibling===null;){if(z.return===null||z.return===c)break e;z=z.return}z.sibling.return=z.return,z=z.sibling}c.stateNode=N;e:switch(cr(N,w,y),w){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}y&&ds(c)}}return an(c),pb(c,c.type,s===null?null:s.memoizedProps,c.pendingProps,h),null;case 6:if(s&&c.stateNode!=null)s.memoizedProps!==y&&ds(c);else{if(typeof y!="string"&&c.stateNode===null)throw Error(r(166));if(s=ne.current,Bc(c)){if(s=c.stateNode,h=c.memoizedProps,y=null,w=sr,w!==null)switch(w.tag){case 27:case 5:y=w.memoizedProps}s[tt]=c,s=!!(s.nodeValue===h||y!==null&&y.suppressHydrationWarning===!0||F_(s.nodeValue,h)),s||Js(c,!0)}else s=Nm(s).createTextNode(y),s[tt]=c,c.stateNode=s}return an(c),null;case 31:if(h=c.memoizedState,s===null||s.memoizedState!==null){if(y=Bc(c),h!==null){if(s===null){if(!y)throw Error(r(318));if(s=c.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[tt]=c}else dl(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;an(c),s=!1}else h=N0(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=h),s=!0;if(!s)return c.flags&256?(si(c),c):(si(c),null);if((c.flags&128)!==0)throw Error(r(558))}return an(c),null;case 13:if(y=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(w=Bc(c),y!==null&&y.dehydrated!==null){if(s===null){if(!w)throw Error(r(318));if(w=c.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(r(317));w[tt]=c}else dl(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;an(c),w=!1}else w=N0(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=w),w=!0;if(!w)return c.flags&256?(si(c),c):(si(c),null)}return si(c),(c.flags&128)!==0?(c.lanes=h,c):(h=y!==null,s=s!==null&&s.memoizedState!==null,h&&(y=c.child,w=null,y.alternate!==null&&y.alternate.memoizedState!==null&&y.alternate.memoizedState.cachePool!==null&&(w=y.alternate.memoizedState.cachePool.pool),N=null,y.memoizedState!==null&&y.memoizedState.cachePool!==null&&(N=y.memoizedState.cachePool.pool),N!==w&&(y.flags|=2048)),h!==s&&h&&(c.child.flags|=8192),cm(c,c.updateQueue),an(c),null);case 4:return ee(),s===null&&Mb(c.stateNode.containerInfo),an(c),null;case 10:return os(c.type),an(c),null;case 19:if(q(_n),y=c.memoizedState,y===null)return an(c),null;if(w=(c.flags&128)!==0,N=y.rendering,N===null)if(w)uf(y,!1);else{if(jn!==0||s!==null&&(s.flags&128)!==0)for(s=c.child;s!==null;){if(N=Wp(s),N!==null){for(c.flags|=128,uf(y,!1),s=N.updateQueue,c.updateQueue=s,cm(c,s),c.subtreeFlags=0,s=h,h=c.child;h!==null;)wO(h,s),h=h.sibling;return D(_n,_n.current&1|2),wt&&as(c,y.treeForkCount),c.child}s=s.sibling}y.tail!==null&&mt()>pm&&(c.flags|=128,w=!0,uf(y,!1),c.lanes=4194304)}else{if(!w)if(s=Wp(N),s!==null){if(c.flags|=128,w=!0,s=s.updateQueue,c.updateQueue=s,cm(c,s),uf(y,!0),y.tail===null&&y.tailMode==="hidden"&&!N.alternate&&!wt)return an(c),null}else 2*mt()-y.renderingStartTime>pm&&h!==536870912&&(c.flags|=128,w=!0,uf(y,!1),c.lanes=4194304);y.isBackwards?(N.sibling=c.child,c.child=N):(s=y.last,s!==null?s.sibling=N:c.child=N,y.last=N)}return y.tail!==null?(s=y.tail,y.rendering=s,y.tail=s.sibling,y.renderingStartTime=mt(),s.sibling=null,h=_n.current,D(_n,w?h&1|2:h&1),wt&&as(c,y.treeForkCount),s):(an(c),null);case 22:case 23:return si(c),I0(),y=c.memoizedState!==null,s!==null?s.memoizedState!==null!==y&&(c.flags|=8192):y&&(c.flags|=8192),y?(h&536870912)!==0&&(c.flags&128)===0&&(an(c),c.subtreeFlags&6&&(c.flags|=8192)):an(c),h=c.updateQueue,h!==null&&cm(c,h.retryQueue),h=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),y=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(y=c.memoizedState.cachePool.pool),y!==h&&(c.flags|=2048),s!==null&&q(pl),null;case 24:return h=null,s!==null&&(h=s.memoizedState.cache),c.memoizedState.cache!==h&&(c.flags|=2048),os(Dn),an(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function Z9(s,c){switch(S0(c),c.tag){case 1:return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return os(Dn),ee(),s=c.flags,(s&65536)!==0&&(s&128)===0?(c.flags=s&-65537|128,c):null;case 26:case 27:case 5:return Ee(c),null;case 31:if(c.memoizedState!==null){if(si(c),c.alternate===null)throw Error(r(340));dl()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 13:if(si(c),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(r(340));dl()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return q(_n),null;case 4:return ee(),null;case 10:return os(c.type),null;case 22:case 23:return si(c),I0(),s!==null&&q(pl),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 24:return os(Dn),null;case 25:return null;default:return null}}function QE(s,c){switch(S0(c),c.tag){case 3:os(Dn),ee();break;case 26:case 27:case 5:Ee(c);break;case 4:ee();break;case 31:c.memoizedState!==null&&si(c);break;case 13:si(c);break;case 19:q(_n);break;case 10:os(c.type);break;case 22:case 23:si(c),I0(),s!==null&&q(pl);break;case 24:os(Dn)}}function df(s,c){try{var h=c.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var w=y.next;h=w;do{if((h.tag&s)===s){y=void 0;var N=h.create,z=h.inst;y=N(),z.destroy=y}h=h.next}while(h!==w)}}catch(L){It(c,c.return,L)}}function so(s,c,h){try{var y=c.updateQueue,w=y!==null?y.lastEffect:null;if(w!==null){var N=w.next;y=N;do{if((y.tag&s)===s){var z=y.inst,L=z.destroy;if(L!==void 0){z.destroy=void 0,w=c;var K=h,ae=L;try{ae()}catch(me){It(w,K,me)}}}y=y.next}while(y!==N)}}catch(me){It(c,c.return,me)}}function YE(s){var c=s.updateQueue;if(c!==null){var h=s.stateNode;try{$O(c,h)}catch(y){It(s,s.return,y)}}}function WE(s,c,h){h.props=xl(s.type,s.memoizedProps),h.state=s.memoizedState;try{h.componentWillUnmount()}catch(y){It(s,c,y)}}function ff(s,c){try{var h=s.ref;if(h!==null){switch(s.tag){case 26:case 27:case 5:var y=s.stateNode;break;case 30:y=s.stateNode;break;default:y=s.stateNode}typeof h=="function"?s.refCleanup=h(y):h.current=y}}catch(w){It(s,c,w)}}function ka(s,c){var h=s.ref,y=s.refCleanup;if(h!==null)if(typeof y=="function")try{y()}catch(w){It(s,c,w)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(w){It(s,c,w)}else h.current=null}function ZE(s){var c=s.type,h=s.memoizedProps,y=s.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":h.autoFocus&&y.focus();break e;case"img":h.src?y.src=h.src:h.srcSet&&(y.srcset=h.srcSet)}}catch(w){It(s,s.return,w)}}function mb(s,c,h){try{var y=s.stateNode;xH(y,s.type,h,c),y[jt]=c}catch(w){It(s,s.return,w)}}function XE(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&po(s.type)||s.tag===4}function gb(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||XE(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&po(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function yb(s,c,h){var y=s.tag;if(y===5||y===6)s=s.stateNode,c?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(s,c):(c=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,c.appendChild(s),h=h._reactRootContainer,h!=null||c.onclick!==null||(c.onclick=ns));else if(y!==4&&(y===27&&po(s.type)&&(h=s.stateNode,c=null),s=s.child,s!==null))for(yb(s,c,h),s=s.sibling;s!==null;)yb(s,c,h),s=s.sibling}function um(s,c,h){var y=s.tag;if(y===5||y===6)s=s.stateNode,c?h.insertBefore(s,c):h.appendChild(s);else if(y!==4&&(y===27&&po(s.type)&&(h=s.stateNode),s=s.child,s!==null))for(um(s,c,h),s=s.sibling;s!==null;)um(s,c,h),s=s.sibling}function JE(s){var c=s.stateNode,h=s.memoizedProps;try{for(var y=s.type,w=c.attributes;w.length;)c.removeAttributeNode(w[0]);cr(c,y,h),c[tt]=s,c[jt]=h}catch(N){It(s,s.return,N)}}var fs=!1,Ln=!1,vb=!1,e_=typeof WeakSet=="function"?WeakSet:Set,Zn=null;function X9(s,c){if(s=s.containerInfo,$b=zm,s=fO(s),d0(s)){if("selectionStart"in s)var h={start:s.selectionStart,end:s.selectionEnd};else e:{h=(h=s.ownerDocument)&&h.defaultView||window;var y=h.getSelection&&h.getSelection();if(y&&y.rangeCount!==0){h=y.anchorNode;var w=y.anchorOffset,N=y.focusNode;y=y.focusOffset;try{h.nodeType,N.nodeType}catch{h=null;break e}var z=0,L=-1,K=-1,ae=0,me=0,we=s,le=null;t:for(;;){for(var ue;we!==h||w!==0&&we.nodeType!==3||(L=z+w),we!==N||y!==0&&we.nodeType!==3||(K=z+y),we.nodeType===3&&(z+=we.nodeValue.length),(ue=we.firstChild)!==null;)le=we,we=ue;for(;;){if(we===s)break t;if(le===h&&++ae===w&&(L=z),le===N&&++me===y&&(K=z),(ue=we.nextSibling)!==null)break;we=le,le=we.parentNode}we=ue}h=L===-1||K===-1?null:{start:L,end:K}}else h=null}h=h||{start:0,end:0}}else h=null;for(Bb={focusedElem:s,selectionRange:h},zm=!1,Zn=c;Zn!==null;)if(c=Zn,s=c.child,(c.subtreeFlags&1028)!==0&&s!==null)s.return=c,Zn=s;else for(;Zn!==null;){switch(c=Zn,N=c.alternate,s=c.flags,c.tag){case 0:if((s&4)!==0&&(s=c.updateQueue,s=s!==null?s.events:null,s!==null))for(h=0;h<s.length;h++)w=s[h],w.ref.impl=w.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&N!==null){s=void 0,h=c,w=N.memoizedProps,N=N.memoizedState,y=h.stateNode;try{var De=xl(h.type,w);s=y.getSnapshotBeforeUpdate(De,N),y.__reactInternalSnapshotBeforeUpdate=s}catch(We){It(h,h.return,We)}}break;case 3:if((s&1024)!==0){if(s=c.stateNode.containerInfo,h=s.nodeType,h===9)Fb(s);else if(h===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Fb(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=c.sibling,s!==null){s.return=c.return,Zn=s;break}Zn=c.return}}function t_(s,c,h){var y=h.flags;switch(h.tag){case 0:case 11:case 15:ps(s,h),y&4&&df(5,h);break;case 1:if(ps(s,h),y&4)if(s=h.stateNode,c===null)try{s.componentDidMount()}catch(z){It(h,h.return,z)}else{var w=xl(h.type,c.memoizedProps);c=c.memoizedState;try{s.componentDidUpdate(w,c,s.__reactInternalSnapshotBeforeUpdate)}catch(z){It(h,h.return,z)}}y&64&&YE(h),y&512&&ff(h,h.return);break;case 3:if(ps(s,h),y&64&&(s=h.updateQueue,s!==null)){if(c=null,h.child!==null)switch(h.child.tag){case 27:case 5:c=h.child.stateNode;break;case 1:c=h.child.stateNode}try{$O(s,c)}catch(z){It(h,h.return,z)}}break;case 27:c===null&&y&4&&JE(h);case 26:case 5:ps(s,h),c===null&&y&4&&ZE(h),y&512&&ff(h,h.return);break;case 12:ps(s,h);break;case 31:ps(s,h),y&4&&i_(s,h);break;case 13:ps(s,h),y&4&&a_(s,h),y&64&&(s=h.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(h=oH.bind(null,h),AH(s,h))));break;case 22:if(y=h.memoizedState!==null||fs,!y){c=c!==null&&c.memoizedState!==null||Ln,w=fs;var N=Ln;fs=y,(Ln=c)&&!N?ms(s,h,(h.subtreeFlags&8772)!==0):ps(s,h),fs=w,Ln=N}break;case 30:break;default:ps(s,h)}}function n_(s){var c=s.alternate;c!==null&&(s.alternate=null,n_(c)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(c=s.stateNode,c!==null&&Sa(c)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var dn=null,Ur=!1;function hs(s,c,h){for(h=h.child;h!==null;)r_(s,c,h),h=h.sibling}function r_(s,c,h){if(Ye&&typeof Ye.onCommitFiberUnmount=="function")try{Ye.onCommitFiberUnmount(gn,h)}catch{}switch(h.tag){case 26:Ln||ka(h,c),hs(s,c,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:Ln||ka(h,c);var y=dn,w=Ur;po(h.type)&&(dn=h.stateNode,Ur=!1),hs(s,c,h),wf(h.stateNode),dn=y,Ur=w;break;case 5:Ln||ka(h,c);case 6:if(y=dn,w=Ur,dn=null,hs(s,c,h),dn=y,Ur=w,dn!==null)if(Ur)try{(dn.nodeType===9?dn.body:dn.nodeName==="HTML"?dn.ownerDocument.body:dn).removeChild(h.stateNode)}catch(N){It(h,c,N)}else try{dn.removeChild(h.stateNode)}catch(N){It(h,c,N)}break;case 18:dn!==null&&(Ur?(s=dn,Y_(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,h.stateNode),ou(s)):Y_(dn,h.stateNode));break;case 4:y=dn,w=Ur,dn=h.stateNode.containerInfo,Ur=!0,hs(s,c,h),dn=y,Ur=w;break;case 0:case 11:case 14:case 15:so(2,h,c),Ln||so(4,h,c),hs(s,c,h);break;case 1:Ln||(ka(h,c),y=h.stateNode,typeof y.componentWillUnmount=="function"&&WE(h,c,y)),hs(s,c,h);break;case 21:hs(s,c,h);break;case 22:Ln=(y=Ln)||h.memoizedState!==null,hs(s,c,h),Ln=y;break;default:hs(s,c,h)}}function i_(s,c){if(c.memoizedState===null&&(s=c.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{ou(s)}catch(h){It(c,c.return,h)}}}function a_(s,c){if(c.memoizedState===null&&(s=c.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{ou(s)}catch(h){It(c,c.return,h)}}function J9(s){switch(s.tag){case 31:case 13:case 19:var c=s.stateNode;return c===null&&(c=s.stateNode=new e_),c;case 22:return s=s.stateNode,c=s._retryCache,c===null&&(c=s._retryCache=new e_),c;default:throw Error(r(435,s.tag))}}function dm(s,c){var h=J9(s);c.forEach(function(y){if(!h.has(y)){h.add(y);var w=lH.bind(null,s,y);y.then(w,w)}})}function qr(s,c){var h=c.deletions;if(h!==null)for(var y=0;y<h.length;y++){var w=h[y],N=s,z=c,L=z;e:for(;L!==null;){switch(L.tag){case 27:if(po(L.type)){dn=L.stateNode,Ur=!1;break e}break;case 5:dn=L.stateNode,Ur=!1;break e;case 3:case 4:dn=L.stateNode.containerInfo,Ur=!0;break e}L=L.return}if(dn===null)throw Error(r(160));r_(N,z,w),dn=null,Ur=!1,N=w.alternate,N!==null&&(N.return=null),w.return=null}if(c.subtreeFlags&13886)for(c=c.child;c!==null;)s_(c,s),c=c.sibling}var ta=null;function s_(s,c){var h=s.alternate,y=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:qr(c,s),Fr(s),y&4&&(so(3,s,s.return),df(3,s),so(5,s,s.return));break;case 1:qr(c,s),Fr(s),y&512&&(Ln||h===null||ka(h,h.return)),y&64&&fs&&(s=s.updateQueue,s!==null&&(y=s.callbacks,y!==null&&(h=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=h===null?y:h.concat(y))));break;case 26:var w=ta;if(qr(c,s),Fr(s),y&512&&(Ln||h===null||ka(h,h.return)),y&4){var N=h!==null?h.memoizedState:null;if(y=s.memoizedState,h===null)if(y===null)if(s.stateNode===null){e:{y=s.type,h=s.memoizedProps,w=w.ownerDocument||w;t:switch(y){case"title":N=w.getElementsByTagName("title")[0],(!N||N[rl]||N[tt]||N.namespaceURI==="http://www.w3.org/2000/svg"||N.hasAttribute("itemprop"))&&(N=w.createElement(y),w.head.insertBefore(N,w.querySelector("head > title"))),cr(N,y,h),N[tt]=s,yn(N),y=N;break e;case"link":var z=sz("link","href",w).get(y+(h.href||""));if(z){for(var L=0;L<z.length;L++)if(N=z[L],N.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&N.getAttribute("rel")===(h.rel==null?null:h.rel)&&N.getAttribute("title")===(h.title==null?null:h.title)&&N.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){z.splice(L,1);break t}}N=w.createElement(y),cr(N,y,h),w.head.appendChild(N);break;case"meta":if(z=sz("meta","content",w).get(y+(h.content||""))){for(L=0;L<z.length;L++)if(N=z[L],N.getAttribute("content")===(h.content==null?null:""+h.content)&&N.getAttribute("name")===(h.name==null?null:h.name)&&N.getAttribute("property")===(h.property==null?null:h.property)&&N.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&N.getAttribute("charset")===(h.charSet==null?null:h.charSet)){z.splice(L,1);break t}}N=w.createElement(y),cr(N,y,h),w.head.appendChild(N);break;default:throw Error(r(468,y))}N[tt]=s,yn(N),y=N}s.stateNode=y}else oz(w,s.type,s.stateNode);else s.stateNode=az(w,y,s.memoizedProps);else N!==y?(N===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):N.count--,y===null?oz(w,s.type,s.stateNode):az(w,y,s.memoizedProps)):y===null&&s.stateNode!==null&&mb(s,s.memoizedProps,h.memoizedProps)}break;case 27:qr(c,s),Fr(s),y&512&&(Ln||h===null||ka(h,h.return)),h!==null&&y&4&&mb(s,s.memoizedProps,h.memoizedProps);break;case 5:if(qr(c,s),Fr(s),y&512&&(Ln||h===null||ka(h,h.return)),s.flags&32){w=s.stateNode;try{_c(w,"")}catch(De){It(s,s.return,De)}}y&4&&s.stateNode!=null&&(w=s.memoizedProps,mb(s,w,h!==null?h.memoizedProps:w)),y&1024&&(vb=!0);break;case 6:if(qr(c,s),Fr(s),y&4){if(s.stateNode===null)throw Error(r(162));y=s.memoizedProps,h=s.stateNode;try{h.nodeValue=y}catch(De){It(s,s.return,De)}}break;case 3:if(Am=null,w=ta,ta=km(c.containerInfo),qr(c,s),ta=w,Fr(s),y&4&&h!==null&&h.memoizedState.isDehydrated)try{ou(c.containerInfo)}catch(De){It(s,s.return,De)}vb&&(vb=!1,o_(s));break;case 4:y=ta,ta=km(s.stateNode.containerInfo),qr(c,s),Fr(s),ta=y;break;case 12:qr(c,s),Fr(s);break;case 31:qr(c,s),Fr(s),y&4&&(y=s.updateQueue,y!==null&&(s.updateQueue=null,dm(s,y)));break;case 13:qr(c,s),Fr(s),s.child.flags&8192&&s.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(hm=mt()),y&4&&(y=s.updateQueue,y!==null&&(s.updateQueue=null,dm(s,y)));break;case 22:w=s.memoizedState!==null;var K=h!==null&&h.memoizedState!==null,ae=fs,me=Ln;if(fs=ae||w,Ln=me||K,qr(c,s),Ln=me,fs=ae,Fr(s),y&8192)e:for(c=s.stateNode,c._visibility=w?c._visibility&-2:c._visibility|1,w&&(h===null||K||fs||Ln||bl(s)),h=null,c=s;;){if(c.tag===5||c.tag===26){if(h===null){K=h=c;try{if(N=K.stateNode,w)z=N.style,typeof z.setProperty=="function"?z.setProperty("display","none","important"):z.display="none";else{L=K.stateNode;var we=K.memoizedProps.style,le=we!=null&&we.hasOwnProperty("display")?we.display:null;L.style.display=le==null||typeof le=="boolean"?"":(""+le).trim()}}catch(De){It(K,K.return,De)}}}else if(c.tag===6){if(h===null){K=c;try{K.stateNode.nodeValue=w?"":K.memoizedProps}catch(De){It(K,K.return,De)}}}else if(c.tag===18){if(h===null){K=c;try{var ue=K.stateNode;w?W_(ue,!0):W_(K.stateNode,!1)}catch(De){It(K,K.return,De)}}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===s)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break e;for(;c.sibling===null;){if(c.return===null||c.return===s)break e;h===c&&(h=null),c=c.return}h===c&&(h=null),c.sibling.return=c.return,c=c.sibling}y&4&&(y=s.updateQueue,y!==null&&(h=y.retryQueue,h!==null&&(y.retryQueue=null,dm(s,h))));break;case 19:qr(c,s),Fr(s),y&4&&(y=s.updateQueue,y!==null&&(s.updateQueue=null,dm(s,y)));break;case 30:break;case 21:break;default:qr(c,s),Fr(s)}}function Fr(s){var c=s.flags;if(c&2){try{for(var h,y=s.return;y!==null;){if(XE(y)){h=y;break}y=y.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var w=h.stateNode,N=gb(s);um(s,N,w);break;case 5:var z=h.stateNode;h.flags&32&&(_c(z,""),h.flags&=-33);var L=gb(s);um(s,L,z);break;case 3:case 4:var K=h.stateNode.containerInfo,ae=gb(s);yb(s,ae,K);break;default:throw Error(r(161))}}catch(me){It(s,s.return,me)}s.flags&=-3}c&4096&&(s.flags&=-4097)}function o_(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var c=s;o_(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),s=s.sibling}}function ps(s,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)t_(s,c.alternate,c),c=c.sibling}function bl(s){for(s=s.child;s!==null;){var c=s;switch(c.tag){case 0:case 11:case 14:case 15:so(4,c,c.return),bl(c);break;case 1:ka(c,c.return);var h=c.stateNode;typeof h.componentWillUnmount=="function"&&WE(c,c.return,h),bl(c);break;case 27:wf(c.stateNode);case 26:case 5:ka(c,c.return),bl(c);break;case 22:c.memoizedState===null&&bl(c);break;case 30:bl(c);break;default:bl(c)}s=s.sibling}}function ms(s,c,h){for(h=h&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var y=c.alternate,w=s,N=c,z=N.flags;switch(N.tag){case 0:case 11:case 15:ms(w,N,h),df(4,N);break;case 1:if(ms(w,N,h),y=N,w=y.stateNode,typeof w.componentDidMount=="function")try{w.componentDidMount()}catch(ae){It(y,y.return,ae)}if(y=N,w=y.updateQueue,w!==null){var L=y.stateNode;try{var K=w.shared.hiddenCallbacks;if(K!==null)for(w.shared.hiddenCallbacks=null,w=0;w<K.length;w++)LO(K[w],L)}catch(ae){It(y,y.return,ae)}}h&&z&64&&YE(N),ff(N,N.return);break;case 27:JE(N);case 26:case 5:ms(w,N,h),h&&y===null&&z&4&&ZE(N),ff(N,N.return);break;case 12:ms(w,N,h);break;case 31:ms(w,N,h),h&&z&4&&i_(w,N);break;case 13:ms(w,N,h),h&&z&4&&a_(w,N);break;case 22:N.memoizedState===null&&ms(w,N,h),ff(N,N.return);break;case 30:break;default:ms(w,N,h)}c=c.sibling}}function xb(s,c){var h=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),s=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(s=c.memoizedState.cachePool.pool),s!==h&&(s!=null&&s.refCount++,h!=null&&Zd(h))}function bb(s,c){s=null,c.alternate!==null&&(s=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==s&&(c.refCount++,s!=null&&Zd(s))}function na(s,c,h,y){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)l_(s,c,h,y),c=c.sibling}function l_(s,c,h,y){var w=c.flags;switch(c.tag){case 0:case 11:case 15:na(s,c,h,y),w&2048&&df(9,c);break;case 1:na(s,c,h,y);break;case 3:na(s,c,h,y),w&2048&&(s=null,c.alternate!==null&&(s=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==s&&(c.refCount++,s!=null&&Zd(s)));break;case 12:if(w&2048){na(s,c,h,y),s=c.stateNode;try{var N=c.memoizedProps,z=N.id,L=N.onPostCommit;typeof L=="function"&&L(z,c.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(K){It(c,c.return,K)}}else na(s,c,h,y);break;case 31:na(s,c,h,y);break;case 13:na(s,c,h,y);break;case 23:break;case 22:N=c.stateNode,z=c.alternate,c.memoizedState!==null?N._visibility&2?na(s,c,h,y):hf(s,c):N._visibility&2?na(s,c,h,y):(N._visibility|=2,Wc(s,c,h,y,(c.subtreeFlags&10256)!==0||!1)),w&2048&&xb(z,c);break;case 24:na(s,c,h,y),w&2048&&bb(c.alternate,c);break;default:na(s,c,h,y)}}function Wc(s,c,h,y,w){for(w=w&&((c.subtreeFlags&10256)!==0||!1),c=c.child;c!==null;){var N=s,z=c,L=h,K=y,ae=z.flags;switch(z.tag){case 0:case 11:case 15:Wc(N,z,L,K,w),df(8,z);break;case 23:break;case 22:var me=z.stateNode;z.memoizedState!==null?me._visibility&2?Wc(N,z,L,K,w):hf(N,z):(me._visibility|=2,Wc(N,z,L,K,w)),w&&ae&2048&&xb(z.alternate,z);break;case 24:Wc(N,z,L,K,w),w&&ae&2048&&bb(z.alternate,z);break;default:Wc(N,z,L,K,w)}c=c.sibling}}function hf(s,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var h=s,y=c,w=y.flags;switch(y.tag){case 22:hf(h,y),w&2048&&xb(y.alternate,y);break;case 24:hf(h,y),w&2048&&bb(y.alternate,y);break;default:hf(h,y)}c=c.sibling}}var pf=8192;function Zc(s,c,h){if(s.subtreeFlags&pf)for(s=s.child;s!==null;)c_(s,c,h),s=s.sibling}function c_(s,c,h){switch(s.tag){case 26:Zc(s,c,h),s.flags&pf&&s.memoizedState!==null&&$H(h,ta,s.memoizedState,s.memoizedProps);break;case 5:Zc(s,c,h);break;case 3:case 4:var y=ta;ta=km(s.stateNode.containerInfo),Zc(s,c,h),ta=y;break;case 22:s.memoizedState===null&&(y=s.alternate,y!==null&&y.memoizedState!==null?(y=pf,pf=16777216,Zc(s,c,h),pf=y):Zc(s,c,h));break;default:Zc(s,c,h)}}function u_(s){var c=s.alternate;if(c!==null&&(s=c.child,s!==null)){c.child=null;do c=s.sibling,s.sibling=null,s=c;while(s!==null)}}function mf(s){var c=s.deletions;if((s.flags&16)!==0){if(c!==null)for(var h=0;h<c.length;h++){var y=c[h];Zn=y,f_(y,s)}u_(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)d_(s),s=s.sibling}function d_(s){switch(s.tag){case 0:case 11:case 15:mf(s),s.flags&2048&&so(9,s,s.return);break;case 3:mf(s);break;case 12:mf(s);break;case 22:var c=s.stateNode;s.memoizedState!==null&&c._visibility&2&&(s.return===null||s.return.tag!==13)?(c._visibility&=-3,fm(s)):mf(s);break;default:mf(s)}}function fm(s){var c=s.deletions;if((s.flags&16)!==0){if(c!==null)for(var h=0;h<c.length;h++){var y=c[h];Zn=y,f_(y,s)}u_(s)}for(s=s.child;s!==null;){switch(c=s,c.tag){case 0:case 11:case 15:so(8,c,c.return),fm(c);break;case 22:h=c.stateNode,h._visibility&2&&(h._visibility&=-3,fm(c));break;default:fm(c)}s=s.sibling}}function f_(s,c){for(;Zn!==null;){var h=Zn;switch(h.tag){case 0:case 11:case 15:so(8,h,c);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var y=h.memoizedState.cachePool.pool;y!=null&&y.refCount++}break;case 24:Zd(h.memoizedState.cache)}if(y=h.child,y!==null)y.return=h,Zn=y;else e:for(h=s;Zn!==null;){y=Zn;var w=y.sibling,N=y.return;if(n_(y),y===h){Zn=null;break e}if(w!==null){w.return=N,Zn=w;break e}Zn=N}}}var eH={getCacheForType:function(s){var c=or(Dn),h=c.data.get(s);return h===void 0&&(h=s(),c.data.set(s,h)),h},cacheSignal:function(){return or(Dn).controller.signal}},tH=typeof WeakMap=="function"?WeakMap:Map,_t=0,Vt=null,gt=null,xt=0,Mt=0,oi=null,oo=!1,Xc=!1,wb=!1,gs=0,jn=0,lo=0,wl=0,Sb=0,li=0,Jc=0,gf=null,Hr=null,jb=!1,hm=0,h_=0,pm=1/0,mm=null,co=null,Fn=0,uo=null,eu=null,ys=0,Nb=0,kb=null,p_=null,yf=0,Cb=null;function ci(){return(_t&2)!==0&&xt!==0?xt&-xt:H.T!==null?Pb():$d()}function m_(){if(li===0)if((xt&536870912)===0||wt){var s=bi;bi<<=1,(bi&3932160)===0&&(bi=262144),li=s}else li=536870912;return s=ai.current,s!==null&&(s.flags|=32),li}function Kr(s,c,h){(s===Vt&&(Mt===2||Mt===9)||s.cancelPendingCommit!==null)&&(tu(s,0),fo(s,xt,li,!1)),Gs(s,h),((_t&2)===0||s!==Vt)&&(s===Vt&&((_t&2)===0&&(wl|=h),jn===4&&fo(s,xt,li,!1)),Ca(s))}function g_(s,c,h){if((_t&6)!==0)throw Error(r(327));var y=!h&&(c&127)===0&&(c&s.expiredLanes)===0||Zi(s,c),w=y?iH(s,c):Ob(s,c,!0),N=y;do{if(w===0){Xc&&!y&&fo(s,c,0,!1);break}else{if(h=s.current.alternate,N&&!nH(h)){w=Ob(s,c,!1),N=!1;continue}if(w===2){if(N=c,s.errorRecoveryDisabledLanes&N)var z=0;else z=s.pendingLanes&-536870913,z=z!==0?z:z&536870912?536870912:0;if(z!==0){c=z;e:{var L=s;w=gf;var K=L.current.memoizedState.isDehydrated;if(K&&(tu(L,z).flags|=256),z=Ob(L,z,!1),z!==2){if(wb&&!K){L.errorRecoveryDisabledLanes|=N,wl|=N,w=4;break e}N=Hr,Hr=w,N!==null&&(Hr===null?Hr=N:Hr.push.apply(Hr,N))}w=z}if(N=!1,w!==2)continue}}if(w===1){tu(s,0),fo(s,c,0,!0);break}e:{switch(y=s,N=w,N){case 0:case 1:throw Error(r(345));case 4:if((c&4194048)!==c)break;case 6:fo(y,c,li,!oo);break e;case 2:Hr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((c&62914560)===c&&(w=hm+300-mt(),10<w)){if(fo(y,c,li,!oo),Lr(y,0,!0)!==0)break e;ys=c,y.timeoutHandle=V_(y_.bind(null,y,h,Hr,mm,jb,c,li,wl,Jc,oo,N,"Throttled",-0,0),w);break e}y_(y,h,Hr,mm,jb,c,li,wl,Jc,oo,N,null,-0,0)}}break}while(!0);Ca(s)}function y_(s,c,h,y,w,N,z,L,K,ae,me,we,le,ue){if(s.timeoutHandle=-1,we=c.subtreeFlags,we&8192||(we&16785408)===16785408){we={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ns},c_(c,N,we);var De=(N&62914560)===N?hm-mt():(N&4194048)===N?h_-mt():0;if(De=BH(we,De),De!==null){ys=N,s.cancelPendingCommit=De(k_.bind(null,s,c,N,h,y,w,z,L,K,me,we,null,le,ue)),fo(s,N,z,!ae);return}}k_(s,c,N,h,y,w,z,L,K)}function nH(s){for(var c=s;;){var h=c.tag;if((h===0||h===11||h===15)&&c.flags&16384&&(h=c.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var y=0;y<h.length;y++){var w=h[y],N=w.getSnapshot;w=w.value;try{if(!ri(N(),w))return!1}catch{return!1}}if(h=c.child,c.subtreeFlags&16384&&h!==null)h.return=c,c=h;else{if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function fo(s,c,h,y){c&=~Sb,c&=~wl,s.suspendedLanes|=c,s.pingedLanes&=~c,y&&(s.warmLanes|=c),y=s.expirationTimes;for(var w=c;0<w;){var N=31-de(w),z=1<<N;y[N]=-1,w&=~z}h!==0&&Md(s,h,c)}function gm(){return(_t&6)===0?(vf(0),!1):!0}function Ab(){if(gt!==null){if(Mt===0)var s=gt.return;else s=gt,ss=fl=null,F0(s),Kc=null,Jd=0,s=gt;for(;s!==null;)QE(s.alternate,s),s=s.return;gt=null}}function tu(s,c){var h=s.timeoutHandle;h!==-1&&(s.timeoutHandle=-1,SH(h)),h=s.cancelPendingCommit,h!==null&&(s.cancelPendingCommit=null,h()),ys=0,Ab(),Vt=s,gt=h=is(s.current,null),xt=c,Mt=0,oi=null,oo=!1,Xc=Zi(s,c),wb=!1,Jc=li=Sb=wl=lo=jn=0,Hr=gf=null,jb=!1,(c&8)!==0&&(c|=c&32);var y=s.entangledLanes;if(y!==0)for(s=s.entanglements,y&=c;0<y;){var w=31-de(y),N=1<<w;c|=s[w],y&=~N}return gs=c,Ip(),h}function v_(s,c){ot=null,H.H=lf,c===Hc||c===Kp?(c=RO(),Mt=3):c===z0?(c=RO(),Mt=4):Mt=c===ab?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,oi=c,gt===null&&(jn=1,am(s,ki(c,s.current)))}function x_(){var s=ai.current;return s===null?!0:(xt&4194048)===xt?Ei===null:(xt&62914560)===xt||(xt&536870912)!==0?s===Ei:!1}function b_(){var s=H.H;return H.H=lf,s===null?lf:s}function w_(){var s=H.A;return H.A=eH,s}function ym(){jn=4,oo||(xt&4194048)!==xt&&ai.current!==null||(Xc=!0),(lo&134217727)===0&&(wl&134217727)===0||Vt===null||fo(Vt,xt,li,!1)}function Ob(s,c,h){var y=_t;_t|=2;var w=b_(),N=w_();(Vt!==s||xt!==c)&&(mm=null,tu(s,c)),c=!1;var z=jn;e:do try{if(Mt!==0&>!==null){var L=gt,K=oi;switch(Mt){case 8:Ab(),z=6;break e;case 3:case 2:case 9:case 6:ai.current===null&&(c=!0);var ae=Mt;if(Mt=0,oi=null,nu(s,L,K,ae),h&&Xc){z=0;break e}break;default:ae=Mt,Mt=0,oi=null,nu(s,L,K,ae)}}rH(),z=jn;break}catch(me){v_(s,me)}while(!0);return c&&s.shellSuspendCounter++,ss=fl=null,_t=y,H.H=w,H.A=N,gt===null&&(Vt=null,xt=0,Ip()),z}function rH(){for(;gt!==null;)S_(gt)}function iH(s,c){var h=_t;_t|=2;var y=b_(),w=w_();Vt!==s||xt!==c?(mm=null,pm=mt()+500,tu(s,c)):Xc=Zi(s,c);e:do try{if(Mt!==0&>!==null){c=gt;var N=oi;t:switch(Mt){case 1:Mt=0,oi=null,nu(s,c,N,1);break;case 2:case 9:if(PO(N)){Mt=0,oi=null,j_(c);break}c=function(){Mt!==2&&Mt!==9||Vt!==s||(Mt=7),Ca(s)},N.then(c,c);break e;case 3:Mt=7;break e;case 4:Mt=5;break e;case 7:PO(N)?(Mt=0,oi=null,j_(c)):(Mt=0,oi=null,nu(s,c,N,7));break;case 5:var z=null;switch(gt.tag){case 26:z=gt.memoizedState;case 5:case 27:var L=gt;if(z?lz(z):L.stateNode.complete){Mt=0,oi=null;var K=L.sibling;if(K!==null)gt=K;else{var ae=L.return;ae!==null?(gt=ae,vm(ae)):gt=null}break t}}Mt=0,oi=null,nu(s,c,N,5);break;case 6:Mt=0,oi=null,nu(s,c,N,6);break;case 8:Ab(),jn=6;break e;default:throw Error(r(462))}}aH();break}catch(me){v_(s,me)}while(!0);return ss=fl=null,H.H=y,H.A=w,_t=h,gt!==null?0:(Vt=null,xt=0,Ip(),jn)}function aH(){for(;gt!==null&&!Ze();)S_(gt)}function S_(s){var c=GE(s.alternate,s,gs);s.memoizedProps=s.pendingProps,c===null?vm(s):gt=c}function j_(s){var c=s,h=c.alternate;switch(c.tag){case 15:case 0:c=BE(h,c,c.pendingProps,c.type,void 0,xt);break;case 11:c=BE(h,c,c.pendingProps,c.type.render,c.ref,xt);break;case 5:F0(c);default:QE(h,c),c=gt=wO(c,gs),c=GE(h,c,gs)}s.memoizedProps=s.pendingProps,c===null?vm(s):gt=c}function nu(s,c,h,y){ss=fl=null,F0(c),Kc=null,Jd=0;var w=c.return;try{if(V9(s,w,c,h,xt)){jn=1,am(s,ki(h,s.current)),gt=null;return}}catch(N){if(w!==null)throw gt=w,N;jn=1,am(s,ki(h,s.current)),gt=null;return}c.flags&32768?(wt||y===1?s=!0:Xc||(xt&536870912)!==0?s=!1:(oo=s=!0,(y===2||y===9||y===3||y===6)&&(y=ai.current,y!==null&&y.tag===13&&(y.flags|=16384))),N_(c,s)):vm(c)}function vm(s){var c=s;do{if((c.flags&32768)!==0){N_(c,oo);return}s=c.return;var h=W9(c.alternate,c,gs);if(h!==null){gt=h;return}if(c=c.sibling,c!==null){gt=c;return}gt=c=s}while(c!==null);jn===0&&(jn=5)}function N_(s,c){do{var h=Z9(s.alternate,s);if(h!==null){h.flags&=32767,gt=h;return}if(h=s.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!c&&(s=s.sibling,s!==null)){gt=s;return}gt=s=h}while(s!==null);jn=6,gt=null}function k_(s,c,h,y,w,N,z,L,K){s.cancelPendingCommit=null;do xm();while(Fn!==0);if((_t&6)!==0)throw Error(r(327));if(c!==null){if(c===s.current)throw Error(r(177));if(N=c.lanes|c.childLanes,N|=g0,Qx(s,h,N,z,L,K),s===Vt&&(gt=Vt=null,xt=0),eu=c,uo=s,ys=h,Nb=N,kb=w,p_=y,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,cH(Me,function(){return __(),null})):(s.callbackNode=null,s.callbackPriority=0),y=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||y){y=H.T,H.T=null,w=J.p,J.p=2,z=_t,_t|=4;try{X9(s,c,h)}finally{_t=z,J.p=w,H.T=y}}Fn=1,C_(),A_(),O_()}}function C_(){if(Fn===1){Fn=0;var s=uo,c=eu,h=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||h){h=H.T,H.T=null;var y=J.p;J.p=2;var w=_t;_t|=4;try{s_(c,s);var N=Bb,z=fO(s.containerInfo),L=N.focusedElem,K=N.selectionRange;if(z!==L&&L&&L.ownerDocument&&dO(L.ownerDocument.documentElement,L)){if(K!==null&&d0(L)){var ae=K.start,me=K.end;if(me===void 0&&(me=ae),"selectionStart"in L)L.selectionStart=ae,L.selectionEnd=Math.min(me,L.value.length);else{var we=L.ownerDocument||document,le=we&&we.defaultView||window;if(le.getSelection){var ue=le.getSelection(),De=L.textContent.length,We=Math.min(K.start,De),Ut=K.end===void 0?We:Math.min(K.end,De);!ue.extend&&We>Ut&&(z=Ut,Ut=We,We=z);var te=uO(L,We),Y=uO(L,Ut);if(te&&Y&&(ue.rangeCount!==1||ue.anchorNode!==te.node||ue.anchorOffset!==te.offset||ue.focusNode!==Y.node||ue.focusOffset!==Y.offset)){var ie=we.createRange();ie.setStart(te.node,te.offset),ue.removeAllRanges(),We>Ut?(ue.addRange(ie),ue.extend(Y.node,Y.offset)):(ie.setEnd(Y.node,Y.offset),ue.addRange(ie))}}}}for(we=[],ue=L;ue=ue.parentNode;)ue.nodeType===1&&we.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<we.length;L++){var xe=we[L];xe.element.scrollLeft=xe.left,xe.element.scrollTop=xe.top}}zm=!!$b,Bb=$b=null}finally{_t=w,J.p=y,H.T=h}}s.current=c,Fn=2}}function A_(){if(Fn===2){Fn=0;var s=uo,c=eu,h=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||h){h=H.T,H.T=null;var y=J.p;J.p=2;var w=_t;_t|=4;try{t_(s,c.alternate,c)}finally{_t=w,J.p=y,H.T=h}}Fn=3}}function O_(){if(Fn===4||Fn===3){Fn=0,Tt();var s=uo,c=eu,h=ys,y=p_;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?Fn=5:(Fn=0,eu=uo=null,E_(s,s.pendingLanes));var w=s.pendingLanes;if(w===0&&(co=null),Ld(h),c=c.stateNode,Ye&&typeof Ye.onCommitFiberRoot=="function")try{Ye.onCommitFiberRoot(gn,c,void 0,(c.current.flags&128)===128)}catch{}if(y!==null){c=H.T,w=J.p,J.p=2,H.T=null;try{for(var N=s.onRecoverableError,z=0;z<y.length;z++){var L=y[z];N(L.value,{componentStack:L.stack})}}finally{H.T=c,J.p=w}}(ys&3)!==0&&xm(),Ca(s),w=s.pendingLanes,(h&261930)!==0&&(w&42)!==0?s===Cb?yf++:(yf=0,Cb=s):yf=0,vf(0)}}function E_(s,c){(s.pooledCacheLanes&=c)===0&&(c=s.pooledCache,c!=null&&(s.pooledCache=null,Zd(c)))}function xm(){return C_(),A_(),O_(),__()}function __(){if(Fn!==5)return!1;var s=uo,c=Nb;Nb=0;var h=Ld(ys),y=H.T,w=J.p;try{J.p=32>h?32:h,H.T=null,h=kb,kb=null;var N=uo,z=ys;if(Fn=0,eu=uo=null,ys=0,(_t&6)!==0)throw Error(r(331));var L=_t;if(_t|=4,d_(N.current),l_(N,N.current,z,h),_t=L,vf(0,!1),Ye&&typeof Ye.onPostCommitFiberRoot=="function")try{Ye.onPostCommitFiberRoot(gn,N)}catch{}return!0}finally{J.p=w,H.T=y,E_(s,c)}}function z_(s,c,h){c=ki(h,c),c=ib(s.stateNode,c,2),s=ro(s,c,2),s!==null&&(Gs(s,2),Ca(s))}function It(s,c,h){if(s.tag===3)z_(s,s,h);else for(;c!==null;){if(c.tag===3){z_(c,s,h);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(co===null||!co.has(y))){s=ki(h,s),h=PE(2),y=ro(c,h,2),y!==null&&(TE(h,y,c,s),Gs(y,2),Ca(y));break}}c=c.return}}function Eb(s,c,h){var y=s.pingCache;if(y===null){y=s.pingCache=new tH;var w=new Set;y.set(c,w)}else w=y.get(c),w===void 0&&(w=new Set,y.set(c,w));w.has(h)||(wb=!0,w.add(h),s=sH.bind(null,s,c,h),c.then(s,s))}function sH(s,c,h){var y=s.pingCache;y!==null&&y.delete(c),s.pingedLanes|=s.suspendedLanes&h,s.warmLanes&=~h,Vt===s&&(xt&h)===h&&(jn===4||jn===3&&(xt&62914560)===xt&&300>mt()-hm?(_t&2)===0&&tu(s,0):Sb|=h,Jc===xt&&(Jc=0)),Ca(s)}function P_(s,c){c===0&&(c=jp()),s=cl(s,c),s!==null&&(Gs(s,c),Ca(s))}function oH(s){var c=s.memoizedState,h=0;c!==null&&(h=c.retryLane),P_(s,h)}function lH(s,c){var h=0;switch(s.tag){case 31:case 13:var y=s.stateNode,w=s.memoizedState;w!==null&&(h=w.retryLane);break;case 19:y=s.stateNode;break;case 22:y=s.stateNode._retryCache;break;default:throw Error(r(314))}y!==null&&y.delete(c),P_(s,h)}function cH(s,c){return tn(s,c)}var bm=null,ru=null,_b=!1,wm=!1,zb=!1,ho=0;function Ca(s){s!==ru&&s.next===null&&(ru===null?bm=ru=s:ru=ru.next=s),wm=!0,_b||(_b=!0,dH())}function vf(s,c){if(!zb&&wm){zb=!0;do for(var h=!1,y=bm;y!==null;){if(s!==0){var w=y.pendingLanes;if(w===0)var N=0;else{var z=y.suspendedLanes,L=y.pingedLanes;N=(1<<31-de(42|s)+1)-1,N&=w&~(z&~L),N=N&201326741?N&201326741|1:N?N|2:0}N!==0&&(h=!0,M_(y,N))}else N=xt,N=Lr(y,y===Vt?N:0,y.cancelPendingCommit!==null||y.timeoutHandle!==-1),(N&3)===0||Zi(y,N)||(h=!0,M_(y,N));y=y.next}while(h);zb=!1}}function uH(){T_()}function T_(){wm=_b=!1;var s=0;ho!==0&&wH()&&(s=ho);for(var c=mt(),h=null,y=bm;y!==null;){var w=y.next,N=R_(y,c);N===0?(y.next=null,h===null?bm=w:h.next=w,w===null&&(ru=h)):(h=y,(s!==0||(N&3)!==0)&&(wm=!0)),y=w}Fn!==0&&Fn!==5||vf(s),ho!==0&&(ho=0)}function R_(s,c){for(var h=s.suspendedLanes,y=s.pingedLanes,w=s.expirationTimes,N=s.pendingLanes&-62914561;0<N;){var z=31-de(N),L=1<<z,K=w[z];K===-1?((L&h)===0||(L&y)!==0)&&(w[z]=ba(L,c)):K<=c&&(s.expiredLanes|=L),N&=~L}if(c=Vt,h=xt,h=Lr(s,s===c?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),y=s.callbackNode,h===0||s===c&&(Mt===2||Mt===9)||s.cancelPendingCommit!==null)return y!==null&&y!==null&&Se(y),s.callbackNode=null,s.callbackPriority=0;if((h&3)===0||Zi(s,h)){if(c=h&-h,c===s.callbackPriority)return c;switch(y!==null&&Se(y),Ld(h)){case 2:case 8:h=Ne;break;case 32:h=Me;break;case 268435456:h=pt;break;default:h=Me}return y=D_.bind(null,s),h=tn(h,y),s.callbackPriority=c,s.callbackNode=h,c}return y!==null&&y!==null&&Se(y),s.callbackPriority=2,s.callbackNode=null,2}function D_(s,c){if(Fn!==0&&Fn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var h=s.callbackNode;if(xm()&&s.callbackNode!==h)return null;var y=xt;return y=Lr(s,s===Vt?y:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),y===0?null:(g_(s,y,c),R_(s,mt()),s.callbackNode!=null&&s.callbackNode===h?D_.bind(null,s):null)}function M_(s,c){if(xm())return null;g_(s,c,!0)}function dH(){jH(function(){(_t&6)!==0?tn(ce,uH):T_()})}function Pb(){if(ho===0){var s=qc;s===0&&(s=qn,qn<<=1,(qn&261888)===0&&(qn=256)),ho=s}return ho}function I_(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Ep(""+s)}function L_(s,c){var h=c.ownerDocument.createElement("input");return h.name=c.name,h.value=c.value,s.id&&h.setAttribute("form",s.id),c.parentNode.insertBefore(h,c),s=new FormData(s),h.parentNode.removeChild(h),s}function fH(s,c,h,y,w){if(c==="submit"&&h&&h.stateNode===w){var N=I_((w[jt]||null).action),z=y.submitter;z&&(c=(c=z[jt]||null)?I_(c.formAction):z.getAttribute("formAction"),c!==null&&(N=c,z=null));var L=new Tp("action","action",null,y,w);s.push({event:L,listeners:[{instance:null,listener:function(){if(y.defaultPrevented){if(ho!==0){var K=z?L_(w,z):new FormData(w);X0(h,{pending:!0,data:K,method:w.method,action:N},null,K)}}else typeof N=="function"&&(L.preventDefault(),K=z?L_(w,z):new FormData(w),X0(h,{pending:!0,data:K,method:w.method,action:N},N,K))},currentTarget:w}]})}}for(var Tb=0;Tb<m0.length;Tb++){var Rb=m0[Tb],hH=Rb.toLowerCase(),pH=Rb[0].toUpperCase()+Rb.slice(1);ea(hH,"on"+pH)}ea(mO,"onAnimationEnd"),ea(gO,"onAnimationIteration"),ea(yO,"onAnimationStart"),ea("dblclick","onDoubleClick"),ea("focusin","onFocus"),ea("focusout","onBlur"),ea(_9,"onTransitionRun"),ea(z9,"onTransitionStart"),ea(P9,"onTransitionCancel"),ea(vO,"onTransitionEnd"),dt("onMouseEnter",["mouseout","mouseover"]),dt("onMouseLeave",["mouseout","mouseover"]),dt("onPointerEnter",["pointerout","pointerover"]),dt("onPointerLeave",["pointerout","pointerover"]),es("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),es("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),es("onBeforeInput",["compositionend","keypress","textInput","paste"]),es("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),es("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),es("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xf="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(" "),mH=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(xf));function $_(s,c){c=(c&4)!==0;for(var h=0;h<s.length;h++){var y=s[h],w=y.event;y=y.listeners;e:{var N=void 0;if(c)for(var z=y.length-1;0<=z;z--){var L=y[z],K=L.instance,ae=L.currentTarget;if(L=L.listener,K!==N&&w.isPropagationStopped())break e;N=L,w.currentTarget=ae;try{N(w)}catch(me){Mp(me)}w.currentTarget=null,N=K}else for(z=0;z<y.length;z++){if(L=y[z],K=L.instance,ae=L.currentTarget,L=L.listener,K!==N&&w.isPropagationStopped())break e;N=L,w.currentTarget=ae;try{N(w)}catch(me){Mp(me)}w.currentTarget=null,N=K}}}}function yt(s,c){var h=c[wa];h===void 0&&(h=c[wa]=new Set);var y=s+"__bubble";h.has(y)||(B_(c,s,2,!1),h.add(y))}function Db(s,c,h){var y=0;c&&(y|=4),B_(h,s,y,c)}var Sm="_reactListening"+Math.random().toString(36).slice(2);function Mb(s){if(!s[Sm]){s[Sm]=!0,il.forEach(function(h){h!=="selectionchange"&&(mH.has(h)||Db(h,!1,s),Db(h,!0,s))});var c=s.nodeType===9?s:s.ownerDocument;c===null||c[Sm]||(c[Sm]=!0,Db("selectionchange",!1,c))}}function B_(s,c,h,y){switch(mz(c)){case 2:var w=FH;break;case 8:w=HH;break;default:w=Zb}h=w.bind(null,c,h,s),w=void 0,!n0||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(w=!0),y?w!==void 0?s.addEventListener(c,h,{capture:!0,passive:w}):s.addEventListener(c,h,!0):w!==void 0?s.addEventListener(c,h,{passive:w}):s.addEventListener(c,h,!1)}function Ib(s,c,h,y,w){var N=y;if((c&1)===0&&(c&2)===0&&y!==null)e:for(;;){if(y===null)return;var z=y.tag;if(z===3||z===4){var L=y.stateNode.containerInfo;if(L===w)break;if(z===4)for(z=y.return;z!==null;){var K=z.tag;if((K===3||K===4)&&z.stateNode.containerInfo===w)return;z=z.return}for(;L!==null;){if(z=wi(L),z===null)return;if(K=z.tag,K===5||K===6||K===26||K===27){y=N=z;continue e}L=L.parentNode}}y=y.return}KA(function(){var ae=N,me=e0(h),we=[];e:{var le=xO.get(s);if(le!==void 0){var ue=Tp,De=s;switch(s){case"keypress":if(zp(h)===0)break e;case"keydown":case"keyup":ue=l9;break;case"focusin":De="focus",ue=s0;break;case"focusout":De="blur",ue=s0;break;case"beforeblur":case"afterblur":ue=s0;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ue=QA;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=WF;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=d9;break;case mO:case gO:case yO:ue=JF;break;case vO:ue=h9;break;case"scroll":case"scrollend":ue=QF;break;case"wheel":ue=m9;break;case"copy":case"cut":case"paste":ue=t9;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=WA;break;case"toggle":case"beforetoggle":ue=y9}var We=(c&4)!==0,Ut=!We&&(s==="scroll"||s==="scrollend"),te=We?le!==null?le+"Capture":null:le;We=[];for(var Y=ae,ie;Y!==null;){var xe=Y;if(ie=xe.stateNode,xe=xe.tag,xe!==5&&xe!==26&&xe!==27||ie===null||te===null||(xe=Bd(Y,te),xe!=null&&We.push(bf(Y,xe,ie))),Ut)break;Y=Y.return}0<We.length&&(le=new ue(le,De,null,h,me),we.push({event:le,listeners:We}))}}if((c&7)===0){e:{if(le=s==="mouseover"||s==="pointerover",ue=s==="mouseout"||s==="pointerout",le&&h!==Jx&&(De=h.relatedTarget||h.fromElement)&&(wi(De)||De[En]))break e;if((ue||le)&&(le=me.window===me?me:(le=me.ownerDocument)?le.defaultView||le.parentWindow:window,ue?(De=h.relatedTarget||h.toElement,ue=ae,De=De?wi(De):null,De!==null&&(Ut=a(De),We=De.tag,De!==Ut||We!==5&&We!==27&&We!==6)&&(De=null)):(ue=null,De=ae),ue!==De)){if(We=QA,xe="onMouseLeave",te="onMouseEnter",Y="mouse",(s==="pointerout"||s==="pointerover")&&(We=WA,xe="onPointerLeave",te="onPointerEnter",Y="pointer"),Ut=ue==null?le:Qs(ue),ie=De==null?le:Qs(De),le=new We(xe,Y+"leave",ue,h,me),le.target=Ut,le.relatedTarget=ie,xe=null,wi(me)===ae&&(We=new We(te,Y+"enter",De,h,me),We.target=ie,We.relatedTarget=Ut,xe=We),Ut=xe,ue&&De)t:{for(We=gH,te=ue,Y=De,ie=0,xe=te;xe;xe=We(xe))ie++;xe=0;for(var Ke=Y;Ke;Ke=We(Ke))xe++;for(;0<ie-xe;)te=We(te),ie--;for(;0<xe-ie;)Y=We(Y),xe--;for(;ie--;){if(te===Y||Y!==null&&te===Y.alternate){We=te;break t}te=We(te),Y=We(Y)}We=null}else We=null;ue!==null&&U_(we,le,ue,We,!1),De!==null&&Ut!==null&&U_(we,Ut,De,We,!0)}}e:{if(le=ae?Qs(ae):window,ue=le.nodeName&&le.nodeName.toLowerCase(),ue==="select"||ue==="input"&&le.type==="file")var kt=iO;else if(nO(le))if(aO)kt=A9;else{kt=k9;var Be=N9}else ue=le.nodeName,!ue||ue.toLowerCase()!=="input"||le.type!=="checkbox"&&le.type!=="radio"?ae&&Xx(ae.elementType)&&(kt=iO):kt=C9;if(kt&&(kt=kt(s,ae))){rO(we,kt,h,me);break e}Be&&Be(s,le,ae),s==="focusout"&&ae&&le.type==="number"&&ae.memoizedProps.value!=null&&Zx(le,"number",le.value)}switch(Be=ae?Qs(ae):window,s){case"focusin":(nO(Be)||Be.contentEditable==="true")&&(Rc=Be,f0=ae,Qd=null);break;case"focusout":Qd=f0=Rc=null;break;case"mousedown":h0=!0;break;case"contextmenu":case"mouseup":case"dragend":h0=!1,hO(we,h,me);break;case"selectionchange":if(E9)break;case"keydown":case"keyup":hO(we,h,me)}var lt;if(l0)e:{switch(s){case"compositionstart":var bt="onCompositionStart";break e;case"compositionend":bt="onCompositionEnd";break e;case"compositionupdate":bt="onCompositionUpdate";break e}bt=void 0}else Tc?eO(s,h)&&(bt="onCompositionEnd"):s==="keydown"&&h.keyCode===229&&(bt="onCompositionStart");bt&&(ZA&&h.locale!=="ko"&&(Tc||bt!=="onCompositionStart"?bt==="onCompositionEnd"&&Tc&&(lt=GA()):(Ws=me,r0="value"in Ws?Ws.value:Ws.textContent,Tc=!0)),Be=jm(ae,bt),0<Be.length&&(bt=new YA(bt,s,null,h,me),we.push({event:bt,listeners:Be}),lt?bt.data=lt:(lt=tO(h),lt!==null&&(bt.data=lt)))),(lt=x9?b9(s,h):w9(s,h))&&(bt=jm(ae,"onBeforeInput"),0<bt.length&&(Be=new YA("onBeforeInput","beforeinput",null,h,me),we.push({event:Be,listeners:bt}),Be.data=lt)),fH(we,s,ae,h,me)}$_(we,c)})}function bf(s,c,h){return{instance:s,listener:c,currentTarget:h}}function jm(s,c){for(var h=c+"Capture",y=[];s!==null;){var w=s,N=w.stateNode;if(w=w.tag,w!==5&&w!==26&&w!==27||N===null||(w=Bd(s,h),w!=null&&y.unshift(bf(s,w,N)),w=Bd(s,c),w!=null&&y.push(bf(s,w,N))),s.tag===3)return y;s=s.return}return[]}function gH(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function U_(s,c,h,y,w){for(var N=c._reactName,z=[];h!==null&&h!==y;){var L=h,K=L.alternate,ae=L.stateNode;if(L=L.tag,K!==null&&K===y)break;L!==5&&L!==26&&L!==27||ae===null||(K=ae,w?(ae=Bd(h,N),ae!=null&&z.unshift(bf(h,ae,K))):w||(ae=Bd(h,N),ae!=null&&z.push(bf(h,ae,K)))),h=h.return}z.length!==0&&s.push({event:c,listeners:z})}var yH=/\r\n?/g,vH=/\u0000|\uFFFD/g;function q_(s){return(typeof s=="string"?s:""+s).replace(yH,`
|
|
9
|
-
`).replace(vH,"")}function F_(s,c){return c=q_(c),q_(s)===c}function Bt(s,c,h,y,w,N){switch(h){case"children":typeof y=="string"?c==="body"||c==="textarea"&&y===""||_c(s,y):(typeof y=="number"||typeof y=="bigint")&&c!=="body"&&_c(s,""+y);break;case"className":Ap(s,"class",y);break;case"tabIndex":Ap(s,"tabindex",y);break;case"dir":case"role":case"viewBox":case"width":case"height":Ap(s,h,y);break;case"style":FA(s,y,N);break;case"data":if(c!=="object"){Ap(s,"data",y);break}case"src":case"href":if(y===""&&(c!=="a"||h!=="href")){s.removeAttribute(h);break}if(y==null||typeof y=="function"||typeof y=="symbol"||typeof y=="boolean"){s.removeAttribute(h);break}y=Ep(""+y),s.setAttribute(h,y);break;case"action":case"formAction":if(typeof y=="function"){s.setAttribute(h,"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 N=="function"&&(h==="formAction"?(c!=="input"&&Bt(s,c,"name",w.name,w,null),Bt(s,c,"formEncType",w.formEncType,w,null),Bt(s,c,"formMethod",w.formMethod,w,null),Bt(s,c,"formTarget",w.formTarget,w,null)):(Bt(s,c,"encType",w.encType,w,null),Bt(s,c,"method",w.method,w,null),Bt(s,c,"target",w.target,w,null)));if(y==null||typeof y=="symbol"||typeof y=="boolean"){s.removeAttribute(h);break}y=Ep(""+y),s.setAttribute(h,y);break;case"onClick":y!=null&&(s.onclick=ns);break;case"onScroll":y!=null&&yt("scroll",s);break;case"onScrollEnd":y!=null&&yt("scrollend",s);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(r(61));if(h=y.__html,h!=null){if(w.children!=null)throw Error(r(60));s.innerHTML=h}}break;case"multiple":s.multiple=y&&typeof y!="function"&&typeof y!="symbol";break;case"muted":s.muted=y&&typeof y!="function"&&typeof y!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(y==null||typeof y=="function"||typeof y=="boolean"||typeof y=="symbol"){s.removeAttribute("xlink:href");break}h=Ep(""+y),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":y!=null&&typeof y!="function"&&typeof y!="symbol"?s.setAttribute(h,""+y):s.removeAttribute(h);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":y&&typeof y!="function"&&typeof y!="symbol"?s.setAttribute(h,""):s.removeAttribute(h);break;case"capture":case"download":y===!0?s.setAttribute(h,""):y!==!1&&y!=null&&typeof y!="function"&&typeof y!="symbol"?s.setAttribute(h,y):s.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":y!=null&&typeof y!="function"&&typeof y!="symbol"&&!isNaN(y)&&1<=y?s.setAttribute(h,y):s.removeAttribute(h);break;case"rowSpan":case"start":y==null||typeof y=="function"||typeof y=="symbol"||isNaN(y)?s.removeAttribute(h):s.setAttribute(h,y);break;case"popover":yt("beforetoggle",s),yt("toggle",s),al(s,"popover",y);break;case"xlinkActuate":ts(s,"http://www.w3.org/1999/xlink","xlink:actuate",y);break;case"xlinkArcrole":ts(s,"http://www.w3.org/1999/xlink","xlink:arcrole",y);break;case"xlinkRole":ts(s,"http://www.w3.org/1999/xlink","xlink:role",y);break;case"xlinkShow":ts(s,"http://www.w3.org/1999/xlink","xlink:show",y);break;case"xlinkTitle":ts(s,"http://www.w3.org/1999/xlink","xlink:title",y);break;case"xlinkType":ts(s,"http://www.w3.org/1999/xlink","xlink:type",y);break;case"xmlBase":ts(s,"http://www.w3.org/XML/1998/namespace","xml:base",y);break;case"xmlLang":ts(s,"http://www.w3.org/XML/1998/namespace","xml:lang",y);break;case"xmlSpace":ts(s,"http://www.w3.org/XML/1998/namespace","xml:space",y);break;case"is":al(s,"is",y);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=GF.get(h)||h,al(s,h,y))}}function Lb(s,c,h,y,w,N){switch(h){case"style":FA(s,y,N);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(r(61));if(h=y.__html,h!=null){if(w.children!=null)throw Error(r(60));s.innerHTML=h}}break;case"children":typeof y=="string"?_c(s,y):(typeof y=="number"||typeof y=="bigint")&&_c(s,""+y);break;case"onScroll":y!=null&&yt("scroll",s);break;case"onScrollEnd":y!=null&&yt("scrollend",s);break;case"onClick":y!=null&&(s.onclick=ns);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Cp.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(w=h.endsWith("Capture"),c=h.slice(2,w?h.length-7:void 0),N=s[jt]||null,N=N!=null?N[h]:null,typeof N=="function"&&s.removeEventListener(c,N,w),typeof y=="function")){typeof N!="function"&&N!==null&&(h in s?s[h]=null:s.hasAttribute(h)&&s.removeAttribute(h)),s.addEventListener(c,y,w);break e}h in s?s[h]=y:y===!0?s.setAttribute(h,""):al(s,h,y)}}}function cr(s,c,h){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":yt("error",s),yt("load",s);var y=!1,w=!1,N;for(N in h)if(h.hasOwnProperty(N)){var z=h[N];if(z!=null)switch(N){case"src":y=!0;break;case"srcSet":w=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:Bt(s,c,N,z,h,null)}}w&&Bt(s,c,"srcSet",h.srcSet,h,null),y&&Bt(s,c,"src",h.src,h,null);return;case"input":yt("invalid",s);var L=N=z=w=null,K=null,ae=null;for(y in h)if(h.hasOwnProperty(y)){var me=h[y];if(me!=null)switch(y){case"name":w=me;break;case"type":z=me;break;case"checked":K=me;break;case"defaultChecked":ae=me;break;case"value":N=me;break;case"defaultValue":L=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,c));break;default:Bt(s,c,y,me,h,null)}}$A(s,N,L,K,ae,z,w,!1);return;case"select":yt("invalid",s),y=z=N=null;for(w in h)if(h.hasOwnProperty(w)&&(L=h[w],L!=null))switch(w){case"value":N=L;break;case"defaultValue":z=L;break;case"multiple":y=L;default:Bt(s,c,w,L,h,null)}c=N,h=z,s.multiple=!!y,c!=null?Ec(s,!!y,c,!1):h!=null&&Ec(s,!!y,h,!0);return;case"textarea":yt("invalid",s),N=w=y=null;for(z in h)if(h.hasOwnProperty(z)&&(L=h[z],L!=null))switch(z){case"value":y=L;break;case"defaultValue":w=L;break;case"children":N=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(91));break;default:Bt(s,c,z,L,h,null)}UA(s,y,w,N);return;case"option":for(K in h)h.hasOwnProperty(K)&&(y=h[K],y!=null)&&(K==="selected"?s.selected=y&&typeof y!="function"&&typeof y!="symbol":Bt(s,c,K,y,h,null));return;case"dialog":yt("beforetoggle",s),yt("toggle",s),yt("cancel",s),yt("close",s);break;case"iframe":case"object":yt("load",s);break;case"video":case"audio":for(y=0;y<xf.length;y++)yt(xf[y],s);break;case"image":yt("error",s),yt("load",s);break;case"details":yt("toggle",s);break;case"embed":case"source":case"link":yt("error",s),yt("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ae in h)if(h.hasOwnProperty(ae)&&(y=h[ae],y!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:Bt(s,c,ae,y,h,null)}return;default:if(Xx(c)){for(me in h)h.hasOwnProperty(me)&&(y=h[me],y!==void 0&&Lb(s,c,me,y,h,void 0));return}}for(L in h)h.hasOwnProperty(L)&&(y=h[L],y!=null&&Bt(s,c,L,y,h,null))}function xH(s,c,h,y){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var w=null,N=null,z=null,L=null,K=null,ae=null,me=null;for(ue in h){var we=h[ue];if(h.hasOwnProperty(ue)&&we!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":K=we;default:y.hasOwnProperty(ue)||Bt(s,c,ue,null,y,we)}}for(var le in y){var ue=y[le];if(we=h[le],y.hasOwnProperty(le)&&(ue!=null||we!=null))switch(le){case"type":N=ue;break;case"name":w=ue;break;case"checked":ae=ue;break;case"defaultChecked":me=ue;break;case"value":z=ue;break;case"defaultValue":L=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,c));break;default:ue!==we&&Bt(s,c,le,ue,y,we)}}Wx(s,z,L,K,ae,me,N,w);return;case"select":ue=z=L=le=null;for(N in h)if(K=h[N],h.hasOwnProperty(N)&&K!=null)switch(N){case"value":break;case"multiple":ue=K;default:y.hasOwnProperty(N)||Bt(s,c,N,null,y,K)}for(w in y)if(N=y[w],K=h[w],y.hasOwnProperty(w)&&(N!=null||K!=null))switch(w){case"value":le=N;break;case"defaultValue":L=N;break;case"multiple":z=N;default:N!==K&&Bt(s,c,w,N,y,K)}c=L,h=z,y=ue,le!=null?Ec(s,!!h,le,!1):!!y!=!!h&&(c!=null?Ec(s,!!h,c,!0):Ec(s,!!h,h?[]:"",!1));return;case"textarea":ue=le=null;for(L in h)if(w=h[L],h.hasOwnProperty(L)&&w!=null&&!y.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:Bt(s,c,L,null,y,w)}for(z in y)if(w=y[z],N=h[z],y.hasOwnProperty(z)&&(w!=null||N!=null))switch(z){case"value":le=w;break;case"defaultValue":ue=w;break;case"children":break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(r(91));break;default:w!==N&&Bt(s,c,z,w,y,N)}BA(s,le,ue);return;case"option":for(var De in h)le=h[De],h.hasOwnProperty(De)&&le!=null&&!y.hasOwnProperty(De)&&(De==="selected"?s.selected=!1:Bt(s,c,De,null,y,le));for(K in y)le=y[K],ue=h[K],y.hasOwnProperty(K)&&le!==ue&&(le!=null||ue!=null)&&(K==="selected"?s.selected=le&&typeof le!="function"&&typeof le!="symbol":Bt(s,c,K,le,y,ue));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 We in h)le=h[We],h.hasOwnProperty(We)&&le!=null&&!y.hasOwnProperty(We)&&Bt(s,c,We,null,y,le);for(ae in y)if(le=y[ae],ue=h[ae],y.hasOwnProperty(ae)&&le!==ue&&(le!=null||ue!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(r(137,c));break;default:Bt(s,c,ae,le,y,ue)}return;default:if(Xx(c)){for(var Ut in h)le=h[Ut],h.hasOwnProperty(Ut)&&le!==void 0&&!y.hasOwnProperty(Ut)&&Lb(s,c,Ut,void 0,y,le);for(me in y)le=y[me],ue=h[me],!y.hasOwnProperty(me)||le===ue||le===void 0&&ue===void 0||Lb(s,c,me,le,y,ue);return}}for(var te in h)le=h[te],h.hasOwnProperty(te)&&le!=null&&!y.hasOwnProperty(te)&&Bt(s,c,te,null,y,le);for(we in y)le=y[we],ue=h[we],!y.hasOwnProperty(we)||le===ue||le==null&&ue==null||Bt(s,c,we,le,y,ue)}function H_(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function bH(){if(typeof performance.getEntriesByType=="function"){for(var s=0,c=0,h=performance.getEntriesByType("resource"),y=0;y<h.length;y++){var w=h[y],N=w.transferSize,z=w.initiatorType,L=w.duration;if(N&&L&&H_(z)){for(z=0,L=w.responseEnd,y+=1;y<h.length;y++){var K=h[y],ae=K.startTime;if(ae>L)break;var me=K.transferSize,we=K.initiatorType;me&&H_(we)&&(K=K.responseEnd,z+=me*(K<L?1:(L-ae)/(K-ae)))}if(--y,c+=8*(N+z)/(w.duration/1e3),s++,10<s)break}}if(0<s)return c/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var $b=null,Bb=null;function Nm(s){return s.nodeType===9?s:s.ownerDocument}function K_(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function G_(s,c){if(s===0)switch(c){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&c==="foreignObject"?0:s}function Ub(s,c){return s==="textarea"||s==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.children=="bigint"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var qb=null;function wH(){var s=window.event;return s&&s.type==="popstate"?s===qb?!1:(qb=s,!0):(qb=null,!1)}var V_=typeof setTimeout=="function"?setTimeout:void 0,SH=typeof clearTimeout=="function"?clearTimeout:void 0,Q_=typeof Promise=="function"?Promise:void 0,jH=typeof queueMicrotask=="function"?queueMicrotask:typeof Q_<"u"?function(s){return Q_.resolve(null).then(s).catch(NH)}:V_;function NH(s){setTimeout(function(){throw s})}function po(s){return s==="head"}function Y_(s,c){var h=c,y=0;do{var w=h.nextSibling;if(s.removeChild(h),w&&w.nodeType===8)if(h=w.data,h==="/$"||h==="/&"){if(y===0){s.removeChild(w),ou(c);return}y--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")y++;else if(h==="html")wf(s.ownerDocument.documentElement);else if(h==="head"){h=s.ownerDocument.head,wf(h);for(var N=h.firstChild;N;){var z=N.nextSibling,L=N.nodeName;N[rl]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&N.rel.toLowerCase()==="stylesheet"||h.removeChild(N),N=z}}else h==="body"&&wf(s.ownerDocument.body);h=w}while(h);ou(c)}function W_(s,c){var h=s;s=0;do{var y=h.nextSibling;if(h.nodeType===1?c?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(c?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),y&&y.nodeType===8)if(h=y.data,h==="/$"){if(s===0)break;s--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||s++;h=y}while(h)}function Fb(s){var c=s.firstChild;for(c&&c.nodeType===10&&(c=c.nextSibling);c;){var h=c;switch(c=c.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":Fb(h),Sa(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}s.removeChild(h)}}function kH(s,c,h,y){for(;s.nodeType===1;){var w=h;if(s.nodeName.toLowerCase()!==c.toLowerCase()){if(!y&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(y){if(!s[rl])switch(c){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(N=s.getAttribute("rel"),N==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(N!==w.rel||s.getAttribute("href")!==(w.href==null||w.href===""?null:w.href)||s.getAttribute("crossorigin")!==(w.crossOrigin==null?null:w.crossOrigin)||s.getAttribute("title")!==(w.title==null?null:w.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(N=s.getAttribute("src"),(N!==(w.src==null?null:w.src)||s.getAttribute("type")!==(w.type==null?null:w.type)||s.getAttribute("crossorigin")!==(w.crossOrigin==null?null:w.crossOrigin))&&N&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(c==="input"&&s.type==="hidden"){var N=w.name==null?null:""+w.name;if(w.type==="hidden"&&s.getAttribute("name")===N)return s}else return s;if(s=_i(s.nextSibling),s===null)break}return null}function CH(s,c,h){if(c==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!h||(s=_i(s.nextSibling),s===null))return null;return s}function Z_(s,c){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!c||(s=_i(s.nextSibling),s===null))return null;return s}function Hb(s){return s.data==="$?"||s.data==="$~"}function Kb(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function AH(s,c){var h=s.ownerDocument;if(s.data==="$~")s._reactRetry=c;else if(s.data!=="$?"||h.readyState!=="loading")c();else{var y=function(){c(),h.removeEventListener("DOMContentLoaded",y)};h.addEventListener("DOMContentLoaded",y),s._reactRetry=y}}function _i(s){for(;s!=null;s=s.nextSibling){var c=s.nodeType;if(c===1||c===3)break;if(c===8){if(c=s.data,c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"||c==="F!"||c==="F")break;if(c==="/$"||c==="/&")return null}}return s}var Gb=null;function X_(s){s=s.nextSibling;for(var c=0;s;){if(s.nodeType===8){var h=s.data;if(h==="/$"||h==="/&"){if(c===0)return _i(s.nextSibling);c--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||c++}s=s.nextSibling}return null}function J_(s){s=s.previousSibling;for(var c=0;s;){if(s.nodeType===8){var h=s.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(c===0)return s;c--}else h!=="/$"&&h!=="/&"||c++}s=s.previousSibling}return null}function ez(s,c,h){switch(c=Nm(h),s){case"html":if(s=c.documentElement,!s)throw Error(r(452));return s;case"head":if(s=c.head,!s)throw Error(r(453));return s;case"body":if(s=c.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function wf(s){for(var c=s.attributes;c.length;)s.removeAttributeNode(c[0]);Sa(s)}var zi=new Map,tz=new Set;function km(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var vs=J.d;J.d={f:OH,r:EH,D:_H,C:zH,L:PH,m:TH,X:DH,S:RH,M:MH};function OH(){var s=vs.f(),c=gm();return s||c}function EH(s){var c=Xi(s);c!==null&&c.tag===5&&c.type==="form"?vE(c):vs.r(s)}var iu=typeof document>"u"?null:document;function nz(s,c,h){var y=iu;if(y&&typeof c=="string"&&c){var w=ji(c);w='link[rel="'+s+'"][href="'+w+'"]',typeof h=="string"&&(w+='[crossorigin="'+h+'"]'),tz.has(w)||(tz.add(w),s={rel:s,crossOrigin:h,href:c},y.querySelector(w)===null&&(c=y.createElement("link"),cr(c,"link",s),yn(c),y.head.appendChild(c)))}}function _H(s){vs.D(s),nz("dns-prefetch",s,null)}function zH(s,c){vs.C(s,c),nz("preconnect",s,c)}function PH(s,c,h){vs.L(s,c,h);var y=iu;if(y&&s&&c){var w='link[rel="preload"][as="'+ji(c)+'"]';c==="image"&&h&&h.imageSrcSet?(w+='[imagesrcset="'+ji(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(w+='[imagesizes="'+ji(h.imageSizes)+'"]')):w+='[href="'+ji(s)+'"]';var N=w;switch(c){case"style":N=au(s);break;case"script":N=su(s)}zi.has(N)||(s=m({rel:"preload",href:c==="image"&&h&&h.imageSrcSet?void 0:s,as:c},h),zi.set(N,s),y.querySelector(w)!==null||c==="style"&&y.querySelector(Sf(N))||c==="script"&&y.querySelector(jf(N))||(c=y.createElement("link"),cr(c,"link",s),yn(c),y.head.appendChild(c)))}}function TH(s,c){vs.m(s,c);var h=iu;if(h&&s){var y=c&&typeof c.as=="string"?c.as:"script",w='link[rel="modulepreload"][as="'+ji(y)+'"][href="'+ji(s)+'"]',N=w;switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":N=su(s)}if(!zi.has(N)&&(s=m({rel:"modulepreload",href:s},c),zi.set(N,s),h.querySelector(w)===null)){switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(jf(N)))return}y=h.createElement("link"),cr(y,"link",s),yn(y),h.head.appendChild(y)}}}function RH(s,c,h){vs.S(s,c,h);var y=iu;if(y&&s){var w=Ys(y).hoistableStyles,N=au(s);c=c||"default";var z=w.get(N);if(!z){var L={loading:0,preload:null};if(z=y.querySelector(Sf(N)))L.loading=5;else{s=m({rel:"stylesheet",href:s,"data-precedence":c},h),(h=zi.get(N))&&Vb(s,h);var K=z=y.createElement("link");yn(K),cr(K,"link",s),K._p=new Promise(function(ae,me){K.onload=ae,K.onerror=me}),K.addEventListener("load",function(){L.loading|=1}),K.addEventListener("error",function(){L.loading|=2}),L.loading|=4,Cm(z,c,y)}z={type:"stylesheet",instance:z,count:1,state:L},w.set(N,z)}}}function DH(s,c){vs.X(s,c);var h=iu;if(h&&s){var y=Ys(h).hoistableScripts,w=su(s),N=y.get(w);N||(N=h.querySelector(jf(w)),N||(s=m({src:s,async:!0},c),(c=zi.get(w))&&Qb(s,c),N=h.createElement("script"),yn(N),cr(N,"link",s),h.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},y.set(w,N))}}function MH(s,c){vs.M(s,c);var h=iu;if(h&&s){var y=Ys(h).hoistableScripts,w=su(s),N=y.get(w);N||(N=h.querySelector(jf(w)),N||(s=m({src:s,async:!0,type:"module"},c),(c=zi.get(w))&&Qb(s,c),N=h.createElement("script"),yn(N),cr(N,"link",s),h.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},y.set(w,N))}}function rz(s,c,h,y){var w=(w=ne.current)?km(w):null;if(!w)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(c=au(h.href),h=Ys(w).hoistableStyles,y=h.get(c),y||(y={type:"style",instance:null,count:0,state:null},h.set(c,y)),y):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){s=au(h.href);var N=Ys(w).hoistableStyles,z=N.get(s);if(z||(w=w.ownerDocument||w,z={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},N.set(s,z),(N=w.querySelector(Sf(s)))&&!N._p&&(z.instance=N,z.state.loading=5),zi.has(s)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},zi.set(s,h),N||IH(w,s,h,z.state))),c&&y===null)throw Error(r(528,""));return z}if(c&&y!==null)throw Error(r(529,""));return null;case"script":return c=h.async,h=h.src,typeof h=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=su(h),h=Ys(w).hoistableScripts,y=h.get(c),y||(y={type:"script",instance:null,count:0,state:null},h.set(c,y)),y):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function au(s){return'href="'+ji(s)+'"'}function Sf(s){return'link[rel="stylesheet"]['+s+"]"}function iz(s){return m({},s,{"data-precedence":s.precedence,precedence:null})}function IH(s,c,h,y){s.querySelector('link[rel="preload"][as="style"]['+c+"]")?y.loading=1:(c=s.createElement("link"),y.preload=c,c.addEventListener("load",function(){return y.loading|=1}),c.addEventListener("error",function(){return y.loading|=2}),cr(c,"link",h),yn(c),s.head.appendChild(c))}function su(s){return'[src="'+ji(s)+'"]'}function jf(s){return"script[async]"+s}function az(s,c,h){if(c.count++,c.instance===null)switch(c.type){case"style":var y=s.querySelector('style[data-href~="'+ji(h.href)+'"]');if(y)return c.instance=y,yn(y),y;var w=m({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return y=(s.ownerDocument||s).createElement("style"),yn(y),cr(y,"style",w),Cm(y,h.precedence,s),c.instance=y;case"stylesheet":w=au(h.href);var N=s.querySelector(Sf(w));if(N)return c.state.loading|=4,c.instance=N,yn(N),N;y=iz(h),(w=zi.get(w))&&Vb(y,w),N=(s.ownerDocument||s).createElement("link"),yn(N);var z=N;return z._p=new Promise(function(L,K){z.onload=L,z.onerror=K}),cr(N,"link",y),c.state.loading|=4,Cm(N,h.precedence,s),c.instance=N;case"script":return N=su(h.src),(w=s.querySelector(jf(N)))?(c.instance=w,yn(w),w):(y=h,(w=zi.get(N))&&(y=m({},h),Qb(y,w)),s=s.ownerDocument||s,w=s.createElement("script"),yn(w),cr(w,"link",y),s.head.appendChild(w),c.instance=w);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(y=c.instance,c.state.loading|=4,Cm(y,h.precedence,s));return c.instance}function Cm(s,c,h){for(var y=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),w=y.length?y[y.length-1]:null,N=w,z=0;z<y.length;z++){var L=y[z];if(L.dataset.precedence===c)N=L;else if(N!==w)break}N?N.parentNode.insertBefore(s,N.nextSibling):(c=h.nodeType===9?h.head:h,c.insertBefore(s,c.firstChild))}function Vb(s,c){s.crossOrigin==null&&(s.crossOrigin=c.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=c.referrerPolicy),s.title==null&&(s.title=c.title)}function Qb(s,c){s.crossOrigin==null&&(s.crossOrigin=c.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=c.referrerPolicy),s.integrity==null&&(s.integrity=c.integrity)}var Am=null;function sz(s,c,h){if(Am===null){var y=new Map,w=Am=new Map;w.set(h,y)}else w=Am,y=w.get(h),y||(y=new Map,w.set(h,y));if(y.has(s))return y;for(y.set(s,null),h=h.getElementsByTagName(s),w=0;w<h.length;w++){var N=h[w];if(!(N[rl]||N[tt]||s==="link"&&N.getAttribute("rel")==="stylesheet")&&N.namespaceURI!=="http://www.w3.org/2000/svg"){var z=N.getAttribute(c)||"";z=s+z;var L=y.get(z);L?L.push(N):y.set(z,[N])}}return y}function oz(s,c,h){s=s.ownerDocument||s,s.head.insertBefore(h,c==="title"?s.querySelector("head > title"):null)}function LH(s,c,h){if(h===1||c.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;return c.rel==="stylesheet"?(s=c.disabled,typeof c.precedence=="string"&&s==null):!0;case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function lz(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function $H(s,c,h,y){if(h.type==="stylesheet"&&(typeof y.media!="string"||matchMedia(y.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var w=au(y.href),N=c.querySelector(Sf(w));if(N){c=N._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(s.count++,s=Om.bind(s),c.then(s,s)),h.state.loading|=4,h.instance=N,yn(N);return}N=c.ownerDocument||c,y=iz(y),(w=zi.get(w))&&Vb(y,w),N=N.createElement("link"),yn(N);var z=N;z._p=new Promise(function(L,K){z.onload=L,z.onerror=K}),cr(N,"link",y),h.instance=N}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(h,c),(c=h.state.preload)&&(h.state.loading&3)===0&&(s.count++,h=Om.bind(s),c.addEventListener("load",h),c.addEventListener("error",h))}}var Yb=0;function BH(s,c){return s.stylesheets&&s.count===0&&_m(s,s.stylesheets),0<s.count||0<s.imgCount?function(h){var y=setTimeout(function(){if(s.stylesheets&&_m(s,s.stylesheets),s.unsuspend){var N=s.unsuspend;s.unsuspend=null,N()}},6e4+c);0<s.imgBytes&&Yb===0&&(Yb=62500*bH());var w=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&_m(s,s.stylesheets),s.unsuspend)){var N=s.unsuspend;s.unsuspend=null,N()}},(s.imgBytes>Yb?50:800)+c);return s.unsuspend=h,function(){s.unsuspend=null,clearTimeout(y),clearTimeout(w)}}:null}function Om(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)_m(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Em=null;function _m(s,c){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Em=new Map,c.forEach(UH,s),Em=null,Om.call(s))}function UH(s,c){if(!(c.state.loading&4)){var h=Em.get(s);if(h)var y=h.get(null);else{h=new Map,Em.set(s,h);for(var w=s.querySelectorAll("link[data-precedence],style[data-precedence]"),N=0;N<w.length;N++){var z=w[N];(z.nodeName==="LINK"||z.getAttribute("media")!=="not all")&&(h.set(z.dataset.precedence,z),y=z)}y&&h.set(null,y)}w=c.instance,z=w.getAttribute("data-precedence"),N=h.get(z)||y,N===y&&h.set(null,w),h.set(z,w),this.count++,y=Om.bind(this),w.addEventListener("load",y),w.addEventListener("error",y),N?N.parentNode.insertBefore(w,N.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(w,s.firstChild)),c.state.loading|=4}}var Nf={$$typeof:C,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function qH(s,c,h,y,w,N,z,L,K){this.tag=1,this.containerInfo=s,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=Ks(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ks(0),this.hiddenUpdates=Ks(null),this.identifierPrefix=y,this.onUncaughtError=w,this.onCaughtError=N,this.onRecoverableError=z,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=K,this.incompleteTransitions=new Map}function cz(s,c,h,y,w,N,z,L,K,ae,me,we){return s=new qH(s,c,h,z,K,ae,me,we,L),c=1,N===!0&&(c|=24),N=ii(3,null,null,c),s.current=N,N.stateNode=s,c=O0(),c.refCount++,s.pooledCache=c,c.refCount++,N.memoizedState={element:y,isDehydrated:h,cache:c},P0(N),s}function uz(s){return s?(s=Ic,s):Ic}function dz(s,c,h,y,w,N){w=uz(w),y.context===null?y.context=w:y.pendingContext=w,y=no(c),y.payload={element:h},N=N===void 0?null:N,N!==null&&(y.callback=N),h=ro(s,y,c),h!==null&&(Kr(h,s,c),tf(h,s,c))}function fz(s,c){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var h=s.retryLane;s.retryLane=h!==0&&h<c?h:c}}function Wb(s,c){fz(s,c),(s=s.alternate)&&fz(s,c)}function hz(s){if(s.tag===13||s.tag===31){var c=cl(s,67108864);c!==null&&Kr(c,s,67108864),Wb(s,67108864)}}function pz(s){if(s.tag===13||s.tag===31){var c=ci();c=Id(c);var h=cl(s,c);h!==null&&Kr(h,s,c),Wb(s,c)}}var zm=!0;function FH(s,c,h,y){var w=H.T;H.T=null;var N=J.p;try{J.p=2,Zb(s,c,h,y)}finally{J.p=N,H.T=w}}function HH(s,c,h,y){var w=H.T;H.T=null;var N=J.p;try{J.p=8,Zb(s,c,h,y)}finally{J.p=N,H.T=w}}function Zb(s,c,h,y){if(zm){var w=Xb(y);if(w===null)Ib(s,c,y,Pm,h),gz(s,y);else if(GH(w,s,c,h,y))y.stopPropagation();else if(gz(s,y),c&4&&-1<KH.indexOf(s)){for(;w!==null;){var N=Xi(w);if(N!==null)switch(N.tag){case 3:if(N=N.stateNode,N.current.memoizedState.isDehydrated){var z=On(N.pendingLanes);if(z!==0){var L=N;for(L.pendingLanes|=2,L.entangledLanes|=2;z;){var K=1<<31-de(z);L.entanglements[1]|=K,z&=~K}Ca(N),(_t&6)===0&&(pm=mt()+500,vf(0))}}break;case 31:case 13:L=cl(N,2),L!==null&&Kr(L,N,2),gm(),Wb(N,2)}if(N=Xb(y),N===null&&Ib(s,c,y,Pm,h),N===w)break;w=N}w!==null&&y.stopPropagation()}else Ib(s,c,y,null,h)}}function Xb(s){return s=e0(s),Jb(s)}var Pm=null;function Jb(s){if(Pm=null,s=wi(s),s!==null){var c=a(s);if(c===null)s=null;else{var h=c.tag;if(h===13){if(s=l(c),s!==null)return s;s=null}else if(h===31){if(s=u(c),s!==null)return s;s=null}else if(h===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;s=null}else c!==s&&(s=null)}}return Pm=s,null}function mz(s){switch(s){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(Je()){case ce:return 2;case Ne:return 8;case Me:case Ge:return 32;case pt:return 268435456;default:return 32}default:return 32}}var ew=!1,mo=null,go=null,yo=null,kf=new Map,Cf=new Map,vo=[],KH="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 gz(s,c){switch(s){case"focusin":case"focusout":mo=null;break;case"dragenter":case"dragleave":go=null;break;case"mouseover":case"mouseout":yo=null;break;case"pointerover":case"pointerout":kf.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":Cf.delete(c.pointerId)}}function Af(s,c,h,y,w,N){return s===null||s.nativeEvent!==N?(s={blockedOn:c,domEventName:h,eventSystemFlags:y,nativeEvent:N,targetContainers:[w]},c!==null&&(c=Xi(c),c!==null&&hz(c)),s):(s.eventSystemFlags|=y,c=s.targetContainers,w!==null&&c.indexOf(w)===-1&&c.push(w),s)}function GH(s,c,h,y,w){switch(c){case"focusin":return mo=Af(mo,s,c,h,y,w),!0;case"dragenter":return go=Af(go,s,c,h,y,w),!0;case"mouseover":return yo=Af(yo,s,c,h,y,w),!0;case"pointerover":var N=w.pointerId;return kf.set(N,Af(kf.get(N)||null,s,c,h,y,w)),!0;case"gotpointercapture":return N=w.pointerId,Cf.set(N,Af(Cf.get(N)||null,s,c,h,y,w)),!0}return!1}function yz(s){var c=wi(s.target);if(c!==null){var h=a(c);if(h!==null){if(c=h.tag,c===13){if(c=l(h),c!==null){s.blockedOn=c,Q(s.priority,function(){pz(h)});return}}else if(c===31){if(c=u(h),c!==null){s.blockedOn=c,Q(s.priority,function(){pz(h)});return}}else if(c===3&&h.stateNode.current.memoizedState.isDehydrated){s.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Tm(s){if(s.blockedOn!==null)return!1;for(var c=s.targetContainers;0<c.length;){var h=Xb(s.nativeEvent);if(h===null){h=s.nativeEvent;var y=new h.constructor(h.type,h);Jx=y,h.target.dispatchEvent(y),Jx=null}else return c=Xi(h),c!==null&&hz(c),s.blockedOn=h,!1;c.shift()}return!0}function vz(s,c,h){Tm(s)&&h.delete(c)}function VH(){ew=!1,mo!==null&&Tm(mo)&&(mo=null),go!==null&&Tm(go)&&(go=null),yo!==null&&Tm(yo)&&(yo=null),kf.forEach(vz),Cf.forEach(vz)}function Rm(s,c){s.blockedOn===c&&(s.blockedOn=null,ew||(ew=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,VH)))}var Dm=null;function xz(s){Dm!==s&&(Dm=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Dm===s&&(Dm=null);for(var c=0;c<s.length;c+=3){var h=s[c],y=s[c+1],w=s[c+2];if(typeof y!="function"){if(Jb(y||h)===null)continue;break}var N=Xi(h);N!==null&&(s.splice(c,3),c-=3,X0(N,{pending:!0,data:w,method:h.method,action:y},y,w))}}))}function ou(s){function c(K){return Rm(K,s)}mo!==null&&Rm(mo,s),go!==null&&Rm(go,s),yo!==null&&Rm(yo,s),kf.forEach(c),Cf.forEach(c);for(var h=0;h<vo.length;h++){var y=vo[h];y.blockedOn===s&&(y.blockedOn=null)}for(;0<vo.length&&(h=vo[0],h.blockedOn===null);)yz(h),h.blockedOn===null&&vo.shift();if(h=(s.ownerDocument||s).$$reactFormReplay,h!=null)for(y=0;y<h.length;y+=3){var w=h[y],N=h[y+1],z=w[jt]||null;if(typeof N=="function")z||xz(h);else if(z){var L=null;if(N&&N.hasAttribute("formAction")){if(w=N,z=N[jt]||null)L=z.formAction;else if(Jb(w)!==null)continue}else L=z.action;typeof L=="function"?h[y+1]=L:(h.splice(y,3),y-=3),xz(h)}}}function bz(){function s(N){N.canIntercept&&N.info==="react-transition"&&N.intercept({handler:function(){return new Promise(function(z){return w=z})},focusReset:"manual",scroll:"manual"})}function c(){w!==null&&(w(),w=null),y||setTimeout(h,20)}function h(){if(!y&&!navigation.transition){var N=navigation.currentEntry;N&&N.url!=null&&navigation.navigate(N.url,{state:N.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var y=!1,w=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",c),navigation.addEventListener("navigateerror",c),setTimeout(h,100),function(){y=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",c),navigation.removeEventListener("navigateerror",c),w!==null&&(w(),w=null)}}}function tw(s){this._internalRoot=s}Mm.prototype.render=tw.prototype.render=function(s){var c=this._internalRoot;if(c===null)throw Error(r(409));var h=c.current,y=ci();dz(h,y,s,c,null,null)},Mm.prototype.unmount=tw.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var c=s.containerInfo;dz(s.current,2,null,s,null,null),gm(),c[En]=null}};function Mm(s){this._internalRoot=s}Mm.prototype.unstable_scheduleHydration=function(s){if(s){var c=$d();s={blockedOn:null,target:s,priority:c};for(var h=0;h<vo.length&&c!==0&&c<vo[h].priority;h++);vo.splice(h,0,s),h===0&&yz(s)}};var wz=t.version;if(wz!=="19.2.4")throw Error(r(527,wz,"19.2.4"));J.findDOMNode=function(s){var c=s._reactInternals;if(c===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=f(c),s=s!==null?p(s):null,s=s===null?null:s.stateNode,s};var QH={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Im=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Im.isDisabled&&Im.supportsFiber)try{gn=Im.inject(QH),Ye=Im}catch{}}return Ef.createRoot=function(s,c){if(!i(s))throw Error(r(299));var h=!1,y="",w=OE,N=EE,z=_E;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onUncaughtError!==void 0&&(w=c.onUncaughtError),c.onCaughtError!==void 0&&(N=c.onCaughtError),c.onRecoverableError!==void 0&&(z=c.onRecoverableError)),c=cz(s,1,!1,null,null,h,y,null,w,N,z,bz),s[En]=c.current,Mb(s),new tw(c)},Ef.hydrateRoot=function(s,c,h){if(!i(s))throw Error(r(299));var y=!1,w="",N=OE,z=EE,L=_E,K=null;return h!=null&&(h.unstable_strictMode===!0&&(y=!0),h.identifierPrefix!==void 0&&(w=h.identifierPrefix),h.onUncaughtError!==void 0&&(N=h.onUncaughtError),h.onCaughtError!==void 0&&(z=h.onCaughtError),h.onRecoverableError!==void 0&&(L=h.onRecoverableError),h.formState!==void 0&&(K=h.formState)),c=cz(s,1,!0,c,h??null,y,w,K,N,z,L,bz),c.context=uz(null),h=c.current,y=ci(),y=Id(y),w=no(y),w.callback=null,ro(h,w,y),h=y,c.current.lanes=h,Gs(c,h),Ca(c),s[En]=c.current,Mb(s),new Mm(c)},Ef.version="19.2.4",Ef}var zz;function iK(){if(zz)return iw.exports;zz=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(),iw.exports=rK(),iw.exports}var aK=iK(),mc=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(){}},sK={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},oK=class{#t=sK;#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)}},Rl=new oK;function lK(e){setTimeout(e,0)}var Xl=typeof window>"u"||"Deno"in globalThis;function br(){}function cK(e,t){return typeof e=="function"?e(t):e}function zj(e){return typeof e=="number"&&e>=0&&e!==1/0}function PL(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Do(e,t){return typeof e=="function"?e(t):e}function Mi(e,t){return typeof e=="function"?e(t):e}function Pz(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:l,stale:u}=e;if(l){if(r){if(t.queryHash!==NN(l,t.options))return!1}else if(!gh(t.queryKey,l))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||i&&i!==t.state.fetchStatus||a&&!a(t))}function Tz(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Jl(t.options.mutationKey)!==Jl(a))return!1}else if(!gh(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function NN(e,t){return(t?.queryKeyHashFn||Jl)(e)}function Jl(e){return JSON.stringify(e,(t,n)=>Pj(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function gh(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>gh(e[n],t[n])):!1}var uK=Object.prototype.hasOwnProperty;function kN(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Rz(e)&&Rz(t);if(!r&&!(Pj(e)&&Pj(t)))return t;const a=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),u=l.length,d=r?new Array(u):{};let f=0;for(let p=0;p<u;p++){const m=r?p:l[p],g=e[m],v=t[m];if(g===v){d[m]=g,(r?p<a:uK.call(e,m))&&f++;continue}if(g===null||v===null||typeof g!="object"||typeof v!="object"){d[m]=v;continue}const S=kN(g,v,n+1);d[m]=S,S===g&&f++}return a===u&&f===a?e:d}function yh(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 Rz(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Pj(e){if(!Dz(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Dz(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Dz(e){return Object.prototype.toString.call(e)==="[object Object]"}function dK(e){return new Promise(t=>{Rl.setTimeout(t,e)})}function Tj(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?kN(e,t):t}function fK(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function hK(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var CN=Symbol();function TL(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===CN?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function AN(e,t){return typeof e=="function"?e(...t):!!e}function pK(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 mK=class extends mc{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Xl&&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"}},ON=new mK;function Rj(){let e,t;const n=new Promise((i,a)=>{e=i,t=a});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 gK=lK;function yK(){let e=[],t=0,n=u=>{u()},r=u=>{u()},i=gK;const a=u=>{t?e.push(u):i(()=>{n(u)})},l=()=>{const u=e;e=[],u.length&&i(()=>{r(()=>{u.forEach(d=>{n(d)})})})};return{batch:u=>{let d;t++;try{d=u()}finally{t--,t||l()}return d},batchCalls:u=>(...d)=>{a(()=>{u(...d)})},schedule:a,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{i=u}}}var Cn=yK(),vK=class extends mc{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Xl&&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}},Vg=new vK;function xK(e){return Math.min(1e3*2**e,3e4)}function RL(e){return(e??"online")==="online"?Vg.isOnline():!0}var Dj=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function DL(e){let t=!1,n=0,r;const i=Rj(),a=()=>i.status!=="pending",l=b=>{if(!a()){const j=new Dj(b);g(j),e.onCancel?.(j)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>ON.isFocused()&&(e.networkMode==="always"||Vg.isOnline())&&e.canRun(),p=()=>RL(e.networkMode)&&e.canRun(),m=b=>{a()||(r?.(),i.resolve(b))},g=b=>{a()||(r?.(),i.reject(b))},v=()=>new Promise(b=>{r=j=>{(a()||f())&&b(j)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),S=()=>{if(a())return;let b;const j=n===0?e.initialPromise:void 0;try{b=j??e.fn()}catch(k){b=Promise.reject(k)}Promise.resolve(b).then(m).catch(k=>{if(a())return;const E=e.retry??(Xl?0:3),C=e.retryDelay??xK,A=typeof C=="function"?C(n,k):C,P=E===!0||typeof E=="number"&&n<E||typeof E=="function"&&E(n,k);if(t||!P){g(k);return}n++,e.onFail?.(n,k),dK(A).then(()=>f()?void 0:v()).then(()=>{t?g(k):S()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(r?.(),i),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?S():v().then(S),i)}}var ML=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),zj(this.gcTime)&&(this.#t=Rl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Xl?1/0:300*1e3))}clearGcTimeout(){this.#t&&(Rl.clearTimeout(this.#t),this.#t=void 0)}},bK=class extends ML{#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=Iz(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=Iz(this.options);t.data!==void 0&&(this.setState(Mz(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=Tj(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(br).catch(br):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>Mi(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===CN||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Do(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:!PL(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 u=this.observers.find(d=>d.options.queryFn);u&&this.setOptions(u.options)}const n=new AbortController,r=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{const u=TL(this.options,t),f=(()=>{const p={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(p),p})();return this.#o=!1,this.options.persister?this.options.persister(u,f,this):u(f)},l=(()=>{const u={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(u),u})();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=DL({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:u=>{u instanceof Dj&&u.revert&&this.setState({...this.#e,fetchStatus:"idle"}),n.abort()},onFail:(u,d)=>{this.#s({type:"failed",failureCount:u,error:d})},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 u=await this.#r.start();if(u===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(u),this.#n.config.onSuccess?.(u,this),this.#n.config.onSettled?.(u,this.state.error,this),u}catch(u){if(u instanceof Dj){if(u.silent)return this.#r.promise;if(u.revert){if(this.state.data===void 0)throw u;return this.state.data}}throw this.#s({type:"error",error:u}),this.#n.config.onError?.(u,this),this.#n.config.onSettled?.(this.state.data,u,this),u}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,...IL(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...Mz(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),Cn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function IL(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:RL(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Mz(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Iz(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 EN=class extends mc{constructor(e,t){super(),this.options=t,this.#t=e,this.#s=null,this.#o=Rj(),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),Lz(this.#e,this.options)?this.#m():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Mj(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Mj(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),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 Mi(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&&!yh(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&$z(this.#e,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#e!==n||Mi(this.options.enabled,this.#e)!==Mi(t.enabled,this.#e)||Do(this.options.staleTime,this.#e)!==Do(t.staleTime,this.#e))&&this.#g();const i=this.#y();r&&(this.#e!==n||Mi(this.options.enabled,this.#e)!==Mi(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 SK(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(br)),t}#g(){this.#b();const e=Do(this.options.staleTime,this.#e);if(Xl||this.#i.isStale||!zj(e))return;const n=PL(this.#i.dataUpdatedAt,e)+1;this.#c=Rl.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,!(Xl||Mi(this.options.enabled,this.#e)===!1||!zj(this.#l)||this.#l===0)&&(this.#u=Rl.setInterval(()=>{(this.options.refetchIntervalInBackground||ON.isFocused())&&this.#m()},this.#l))}#x(){this.#g(),this.#v(this.#y())}#b(){this.#c&&(Rl.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(Rl.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#e,r=this.options,i=this.#i,a=this.#r,l=this.#a,d=e!==n?e.state:this.#n,{state:f}=e;let p={...f},m=!1,g;if(t._optimisticResults){const T=this.hasListeners(),$=!T&&Lz(e,t),F=T&&$z(e,n,t,r);($||F)&&(p={...p,...IL(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:v,errorUpdatedAt:S,status:b}=p;g=p.data;let j=!1;if(t.placeholderData!==void 0&&g===void 0&&b==="pending"){let T;i?.isPlaceholderData&&t.placeholderData===l?.placeholderData?(T=i.data,j=!0):T=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,T!==void 0&&(b="success",g=Tj(i?.data,T,t),m=!0)}if(t.select&&g!==void 0&&!j)if(i&&g===a?.data&&t.select===this.#p)g=this.#d;else try{this.#p=t.select,g=t.select(g),g=Tj(i?.data,g,t),this.#d=g,this.#s=null}catch(T){this.#s=T}this.#s&&(v=this.#s,g=this.#d,S=Date.now(),b="error");const k=p.fetchStatus==="fetching",E=b==="pending",C=b==="error",A=E&&k,P=g!==void 0,_={status:b,fetchStatus:p.fetchStatus,isPending:E,isSuccess:b==="success",isError:C,isInitialLoading:A,isLoading:A,data:g,dataUpdatedAt:p.dataUpdatedAt,error:v,errorUpdatedAt:S,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>d.dataUpdateCount||p.errorUpdateCount>d.errorUpdateCount,isFetching:k,isRefetching:k&&!E,isLoadingError:C&&!P,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:C&&P,isStale:_N(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Mi(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const T=_.data!==void 0,$=_.status==="error"&&!T,F=V=>{$?V.reject(_.error):T&&V.resolve(_.data)},U=()=>{const V=this.#o=_.promise=Rj();F(V)},B=this.#o;switch(B.status){case"pending":e.queryHash===n.queryHash&&F(B);break;case"fulfilled":($||_.data!==B.value)&&U();break;case"rejected":(!$||_.error!==B.reason)&&U();break}}return _}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),yh(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 a=new Set(i??this.#h);return this.options.throwOnError&&a.add("error"),Object.keys(this.#i).some(l=>{const u=l;return this.#i[u]!==e[u]&&a.has(u)})};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.#x()}#j(e){Cn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function wK(e,t){return Mi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Lz(e,t){return wK(e,t)||e.state.data!==void 0&&Mj(e,t,t.refetchOnMount)}function Mj(e,t,n){if(Mi(t.enabled,e)!==!1&&Do(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&_N(e,t)}return!1}function $z(e,t,n,r){return(e!==t||Mi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&_N(e,n)}function _N(e,t){return Mi(t.enabled,e)!==!1&&e.isStaleByTime(Do(t.staleTime,e))}function SK(e,t){return!yh(e.getCurrentResult(),t)}function Bz(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],l=t.state.data?.pageParams||[];let u={pages:[],pageParams:[]},d=0;const f=async()=>{let p=!1;const m=S=>{pK(S,()=>t.signal,()=>p=!0)},g=TL(t.options,t.fetchOptions),v=async(S,b,j)=>{if(p)return Promise.reject();if(b==null&&S.pages.length)return Promise.resolve(S);const E=(()=>{const O={client:t.client,queryKey:t.queryKey,pageParam:b,direction:j?"backward":"forward",meta:t.options.meta};return m(O),O})(),C=await g(E),{maxPages:A}=t.options,P=j?hK:fK;return{pages:P(S.pages,C,A),pageParams:P(S.pageParams,b,A)}};if(i&&a.length){const S=i==="backward",b=S?jK:Uz,j={pages:a,pageParams:l},k=b(r,j);u=await v(j,k,S)}else{const S=e??a.length;do{const b=d===0?l[0]??r.initialPageParam:Uz(r,u);if(d>0&&b==null)break;u=await v(u,b),d++}while(d<S)}return u};t.options.persister?t.fetchFn=()=>t.options.persister?.(f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=f}}}function Uz(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 jK(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var NK=class extends ML{#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||LL(),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=DL({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,l)=>{this.#r({type:"failed",failureCount:a,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 a=await this.#i.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#r({type:"success",data:a}),a}catch(a){try{await this.#n.config.onError?.(a,e,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onError?.(a,e,this.state.context,n)}catch(l){Promise.reject(l)}try{await this.#n.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,n)}catch(l){Promise.reject(l)}throw this.#r({type:"error",error:a}),a}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),Cn.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function LL(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $L=class extends mc{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 NK({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=Lm(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=Lm(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=Lm(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=Lm(e);return typeof t=="string"?this.#e.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Cn.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=>Tz(t,n))}findAll(e={}){return this.getAll().filter(t=>Tz(e,t))}notify(e){Cn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Cn.batch(()=>Promise.all(e.map(t=>t.continue().catch(br))))}};function Lm(e){return e.options.scope?.id}var kK=class extends mc{#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),yh(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Jl(n.mutationKey)!==Jl(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??LL();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){Cn.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(a){Promise.reject(a)}try{this.#i.onSettled?.(t.data,null,n,r,i)}catch(a){Promise.reject(a)}}else if(t?.type==="error"){try{this.#i.onError?.(t.error,n,r,i)}catch(a){Promise.reject(a)}try{this.#i.onSettled?.(void 0,t.error,n,r,i)}catch(a){Promise.reject(a)}}}this.listeners.forEach(n=>{n(this.#e)})})}};function qz(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function CK(e,t,n){const r=e.slice(0);return r[t]=n,r}var AK=class extends mc{#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,Cn.batch(()=>{const n=this.#r,r=this.#u(this.#n);r.forEach(p=>p.observer.setOptions(p.defaultedQueryOptions));const i=r.map(p=>p.observer),a=i.map(p=>p.getCurrentResult()),l=n.length!==i.length,u=i.some((p,m)=>p!==n[m]),d=l||u,f=d?!0:a.some((p,m)=>{const g=this.#e[m];return!g||!yh(p,g)});!d&&!f||(d&&(this.#d=r,this.#r=i),this.#e=a,this.hasListeners()&&(d&&(qz(n,i).forEach(p=>{p.destroy()}),qz(i,n).forEach(p=>{p.subscribe(m=>{this.#l(p,m)})})),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(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),i=n.map(a=>a.defaultedQueryOptions.queryHash);return[r,a=>this.#c(a??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,a=>{t.forEach(l=>{l.observer.trackProp(a)})})})}#c(e,t,n){if(t){const r=this.#p,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((a,l)=>a!==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=kN(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 a=t.get(i);a?a.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 EN(this.#t,i);n.push({defaultedQueryOptions:i,observer:l})}),n}#l(e,t){const n=this.#r.indexOf(e);n!==-1&&(this.#e=CK(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&&Cn.batch(()=>{this.listeners.forEach(r=>{r(this.#e)})})}}},OK=class extends mc{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const r=t.queryKey,i=t.queryHash??NN(r,t);let a=this.get(i);return a||(a=new bK({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}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(){Cn.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=>Pz(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>Pz(e,n)):t}notify(e){Cn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Cn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Cn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},EK=class{#t;#e;#n;#i;#r;#a;#o;#s;constructor(e={}){this.#t=e.queryCache||new OK,this.#e=e.mutationCache||new $L,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=ON.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#s=Vg.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(Do(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}),a=this.#t.get(r.queryHash)?.state.data,l=cK(t,a);if(l!==void 0)return this.#t.build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Cn.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;Cn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return Cn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Cn.batch(()=>this.#t.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(br).catch(br)}invalidateQueries(e,t={}){return Cn.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=Cn.batch(()=>this.#t.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(br)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(br)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime(Do(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(br).catch(br)}fetchInfiniteQuery(e){return e.behavior=Bz(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(br).catch(br)}ensureInfiniteQueryData(e){return e.behavior=Bz(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Vg.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(Jl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{gh(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Jl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{gh(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=NN(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===CN&&(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()}},BL=x.createContext(void 0),vi=e=>{const t=x.useContext(BL);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},_K=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx(BL.Provider,{value:e,children:t})),UL=x.createContext(!1),qL=()=>x.useContext(UL);UL.Provider;function zK(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var PK=x.createContext(zK()),FL=()=>x.useContext(PK),HL=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?AN(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},KL=e=>{x.useEffect(()=>{e.clearReset()},[e])},GL=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||AN(n,[e.error,r])),VL=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))}},TK=(e,t)=>e.isLoading&&e.isFetching&&!t,Ij=(e,t)=>e?.suspense&&t.isPending,Lj=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function RK({queries:e,...t},n){const r=vi(),i=qL(),a=FL(),l=x.useMemo(()=>e.map(b=>{const j=r.defaultQueryOptions(b);return j._optimisticResults=i?"isRestoring":"optimistic",j}),[e,r,i]);l.forEach(b=>{VL(b);const j=r.getQueryCache().get(b.queryHash);HL(b,a,j)}),KL(a);const[u]=x.useState(()=>new AK(r,l,t)),[d,f,p]=u.getOptimisticResult(l,t.combine),m=!i&&t.subscribed!==!1;x.useSyncExternalStore(x.useCallback(b=>m?u.subscribe(Cn.batchCalls(b)):br,[u,m]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),x.useEffect(()=>{u.setQueries(l,t)},[l,t,u]);const v=d.some((b,j)=>Ij(l[j],b))?d.flatMap((b,j)=>{const k=l[j];if(k&&Ij(k,b)){const E=new EN(r,k);return Lj(k,E,a)}return[]}):[];if(v.length>0)throw Promise.all(v);const S=d.find((b,j)=>{const k=l[j];return k&&GL({result:b,errorResetBoundary:a,throwOnError:k.throwOnError,query:r.getQueryCache().get(k.queryHash),suspense:k.suspense})});if(S?.error)throw S.error;return f(p())}function DK(e,t,n){const r=qL(),i=FL(),a=vi(),l=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(l);const u=a.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",VL(l),HL(l,i,u),KL(i);const d=!a.getQueryCache().get(l.queryHash),[f]=x.useState(()=>new t(a,l)),p=f.getOptimisticResult(l),m=!r&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(g=>{const v=m?f.subscribe(Cn.batchCalls(g)):br;return f.updateResult(),v},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),x.useEffect(()=>{f.setOptions(l)},[l,f]),Ij(l,p))throw Lj(l,f,i);if(GL({result:p,errorResetBoundary:i,throwOnError:l.throwOnError,query:u,suspense:l.suspense}))throw p.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(l,p),l.experimental_prefetchInRender&&!Xl&&TK(p,r)&&(d?Lj(l,f,i):u?.promise)?.catch(br).finally(()=>{f.updateResult()}),l.notifyOnChangeProps?p:f.trackResult(p)}function ca(e,t){return DK(e,EN)}function Hh(e,t){const n=vi(),[r]=x.useState(()=>new kK(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);const i=x.useSyncExternalStore(x.useCallback(l=>r.subscribe(Cn.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=x.useCallback((l,u)=>{r.mutate(l,u).catch(br)},[r]);if(i.error&&AN(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var $m=typeof window<"u"?x.useLayoutEffect:x.useEffect;function lw(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 MK(e,t,n={},r={}){x.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([a])=>{t(a)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function IK(e){const t=x.useRef(null);return x.useImperativeHandle(e,()=>t.current,[]),t}var LK=!1;function vh(e){return e[e.length-1]}function $K(e){return typeof e=="function"}function zo(e,t){return $K(e)?e(t):e}var BK=Object.prototype.hasOwnProperty,Fz=Object.prototype.propertyIsEnumerable,UK=()=>Object.create(null),Sl=(e,t)=>Dl(e,t,UK);function Dl(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const i=t,a=Gz(e)&&Gz(i);if(!a&&!(Qg(e)&&Qg(i)))return i;const l=a?e:Hz(e);if(!l)return i;const u=a?i:Hz(i);if(!u)return i;const d=l.length,f=u.length,p=a?new Array(f):n();let m=0;for(let g=0;g<f;g++){const v=a?g:u[g],S=e[v],b=i[v];if(S===b){p[v]=S,(a?g<d:BK.call(e,v))&&m++;continue}if(S===null||b===null||typeof S!="object"||typeof b!="object"){p[v]=b;continue}const j=Dl(S,b,n,r+1);p[v]=j,j===S&&m++}return d===f&&m===d?e:p}function Hz(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!Fz.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(!Fz.call(e,i))return!1;r.push(i)}return r}function Qg(e){if(!Kz(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Kz(n)||!n.hasOwnProperty("isPrototypeOf"))}function Kz(e){return Object.prototype.toString.call(e)==="[object Object]"}function Gz(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Hl(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(!Hl(e[r],t[r],n))return!1;return!0}if(Qg(e)&&Qg(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const l in t)if((!r||t[l]!==void 0)&&!Hl(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 a=0;for(const l in t)if((!r||t[l]!==void 0)&&(a++,a>i||!Hl(e[l],t[l],n)))return!1;return i===a}return!1}function Qu(e){let t,n;const r=new Promise((i,a)=>{t=i,n=a});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 xh(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function qK(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Vz(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 qK(t)}var FK=["http:","https:","mailto:","tel:"];function Yg(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function _f(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+=Vz(e.slice(n,i.index))+i[0],n=t.lastIndex;r=r+Vz(n?e.slice(n):e);let a=!1;return r.startsWith("//")&&(a=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:a}}function HK(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Wg(e){const t=new Map;let n,r;const i=a=>{a.next&&(a.prev?(a.prev.next=a.next,a.next.prev=a.prev,a.next=void 0,r&&(r.next=a,a.prev=r)):(a.next.prev=void 0,n=a.next,a.next=void 0,r&&(a.prev=r,r.next=a)),r=a)};return{get(a){const l=t.get(a);if(l)return i(l),l.value},set(a,l){if(t.size>=e&&n){const d=n;t.delete(d.key),d.next&&(n=d.next,d.next.prev=void 0),d===r&&(r=void 0)}const u=t.get(a);if(u)u.value=l,i(u);else{const d={key:a,value:l,prev:r};r&&(r.next=d),r=d,n||(n=d),t.set(a,d)}},clear(){t.clear(),n=void 0,r=void 0}}}var KK="Invariant failed";function Es(e,t){if(!e)throw new Error(KK)}var Ml=4,QL=5;function GK(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 zN(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a==="$"){const u=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=u,n[4]=u,n[5]=u,n}if(a.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=GK(a);if(l){const[u,d]=l,f=a.charCodeAt(u+1);if(f===45){if(u+2<a.length&&a.charCodeAt(u+2)===36){const p=u+3,m=d;if(p<m)return n[0]=3,n[1]=t+u,n[2]=t+p,n[3]=t+m,n[4]=t+d+1,n[5]=i,n}}else if(f===36){const p=u+1,m=u+2;return m===d?(n[0]=2,n[1]=t+u,n[2]=t+p,n[3]=t+m,n[4]=t+d+1,n[5]=e.length,n):(n[0]=1,n[1]=t+u,n[2]=t+m,n[3]=t+d,n[4]=t+d+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 bv(e,t,n,r,i,a,l){l?.(n);let u=r;{const d=n.fullPath??n.from,f=d.length,p=n.options?.caseSensitive??e,m=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;u<f;){const v=zN(d,u,t);let S;const b=u,j=v[5];switch(u=j+1,a++,v[0]){case 0:{const k=d.substring(v[2],v[3]);if(p){const E=i.static?.get(k);if(E)S=E;else{i.static??=new Map;const C=Il(n.fullPath??n.from);C.parent=i,C.depth=a,S=C,i.static.set(k,C)}}else{const E=k.toLowerCase(),C=i.staticInsensitive?.get(E);if(C)S=C;else{i.staticInsensitive??=new Map;const A=Il(n.fullPath??n.from);A.parent=i,A.depth=a,S=A,i.staticInsensitive.set(E,A)}}break}case 1:{const k=d.substring(b,v[1]),E=d.substring(v[4],j),C=p&&!!(k||E),A=k?C?k:k.toLowerCase():void 0,P=E?C?E:E.toLowerCase():void 0,O=!m&&i.dynamic?.find(_=>!_.skipOnParamError&&_.caseSensitive===C&&_.prefix===A&&_.suffix===P);if(O)S=O;else{const _=uw(1,n.fullPath??n.from,C,A,P);S=_,_.depth=a,_.parent=i,i.dynamic??=[],i.dynamic.push(_)}break}case 3:{const k=d.substring(b,v[1]),E=d.substring(v[4],j),C=p&&!!(k||E),A=k?C?k:k.toLowerCase():void 0,P=E?C?E:E.toLowerCase():void 0,O=!m&&i.optional?.find(_=>!_.skipOnParamError&&_.caseSensitive===C&&_.prefix===A&&_.suffix===P);if(O)S=O;else{const _=uw(3,n.fullPath??n.from,C,A,P);S=_,_.parent=i,_.depth=a,i.optional??=[],i.optional.push(_)}break}case 2:{const k=d.substring(b,v[1]),E=d.substring(v[4],j),C=p&&!!(k||E),A=k?C?k:k.toLowerCase():void 0,P=E?C?E:E.toLowerCase():void 0,O=uw(2,n.fullPath??n.from,C,A,P);S=O,O.parent=i,O.depth=a,i.wildcard??=[],i.wildcard.push(O)}}i=S}if(m&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const v=Il(n.fullPath??n.from);v.kind=QL,v.parent=i,a++,v.depth=a,i.pathless??=[],i.pathless.push(v),i=v}const g=(n.path||!n.children)&&!n.isRoot;if(g&&d.endsWith("/")){const v=Il(n.fullPath??n.from);v.kind=Ml,v.parent=i,a++,v.depth=a,i.index=v,i=v}i.parse=n.options?.params?.parse??null,i.skipOnParamError=m,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,g&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const d of n.children)bv(e,t,d,u,i,a,l)}function cw(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 ko(e){if(e.pathless)for(const t of e.pathless)ko(t);if(e.static)for(const t of e.static.values())ko(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())ko(t);if(e.dynamic?.length){e.dynamic.sort(cw);for(const t of e.dynamic)ko(t)}if(e.optional?.length){e.optional.sort(cw);for(const t of e.optional)ko(t)}if(e.wildcard?.length){e.wildcard.sort(cw);for(const t of e.wildcard)ko(t)}}function Il(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 uw(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 VK(e,t){const n=Il("/"),r=new Uint16Array(6);for(const i of e)bv(!1,r,i,1,n,0);ko(n),t.masksTree=n,t.flatCache=Wg(1e3)}function QK(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=PN(e,t.masksTree);return t.flatCache.set(e,r),r}function YK(e,t,n,r,i){e||="/",r||="/";const a=t?`case\0${e}`:e;let l=i.singleCache.get(a);return l||(l=Il("/"),bv(t,new Uint16Array(6),{from:e},1,l,0),i.singleCache.set(a,l)),PN(r,l,n)}function WK(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||="/";let a;try{a=PN(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)a=null;else throw l}return a&&(a.branch=JK(a.route)),t.matchCache.set(r,a),a}function ZK(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function XK(e,t=!1,n){const r=Il(e.fullPath),i=new Uint16Array(6),a={},l={};let u=0;return bv(t,i,e,1,r,0,d=>{if(n?.(d,u),Es(!(d.id in a),`Duplicate routes found with id: ${String(d.id)}`),a[d.id]=d,u!==0&&d.path){const f=ZK(d.fullPath);(!l[f]||d.fullPath.endsWith("/"))&&(l[f]=d)}u++}),ko(r),{processedTree:{segmentTree:r,singleCache:Wg(1e3),matchCache:Wg(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:l}}function PN(e,t,n=!1){const r=e.split("/"),i=t7(e,r,t,n);if(!i)return null;const[a]=YL(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function YL(e,t,n){const r=e7(n.node);let i=null;const a=Object.create(null);let l=n.extract?.part??0,u=n.extract?.node??0,d=n.extract?.path??0,f=n.extract?.segment??0;for(;u<r.length;l++,u++,d++,f++){const p=r[u];if(p.kind===Ml)break;if(p.kind===QL){f--,l--,d--;continue}const m=t[l],g=d;if(m&&(d+=m.length),p.kind===1){i??=n.node.fullPath.split("/");const v=i[f],S=p.prefix?.length??0;if(v.charCodeAt(S)===123){const b=p.suffix?.length??0,j=v.substring(S+2,v.length-b-1),k=m.substring(S,m.length-b);a[j]=decodeURIComponent(k)}else{const b=v.substring(1);a[b]=decodeURIComponent(m)}}else if(p.kind===3){if(n.skipped&1<<u){l--,d=g-1;continue}i??=n.node.fullPath.split("/");const v=i[f],S=p.prefix?.length??0,b=p.suffix?.length??0,j=v.substring(S+3,v.length-b-1),k=p.suffix||p.prefix?m.substring(S,m.length-b):m;k&&(a[j]=decodeURIComponent(k))}else if(p.kind===2){const v=p,S=e.substring(g+(v.prefix?.length??0),e.length-(v.suffix?.length??0)),b=decodeURIComponent(S);a["*"]=b,a._splat=b;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:l,node:u,path:d,segment:f}]}function JK(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function e7(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function t7(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!vh(t),a=i&&e!=="/",l=t.length-(i?1:0),u=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let d=null,f=null,p=null;for(;u.length;){const m=u.pop(),{node:g,index:v,skipped:S,depth:b,statics:j,dynamics:k,optionals:E}=m;let{extract:C,rawParams:A,parsedParams:P}=m;if(g.skipOnParamError){if(!dw(e,t,m))continue;A=m.rawParams,C=m.extract,P=m.parsedParams}r&&g.route&&g.kind!==Ml&&zf(f,m)&&(f=m);const O=v===l;if(O&&(g.route&&!a&&zf(p,m)&&(p=m),!g.optional&&!g.wildcard&&!g.index&&!g.pathless))continue;const _=O?void 0:t[v];let T;if(O&&g.index){const $={node:g.index,index:v,skipped:S,depth:b+1,statics:j,dynamics:k,optionals:E,extract:C,rawParams:A,parsedParams:P};let F=!0;if(g.index.skipOnParamError&&(dw(e,t,$)||(F=!1)),F){if(j===l&&!k&&!E&&!S)return $;zf(p,$)&&(p=$)}}if(g.wildcard&&zf(d,m))for(const $ of g.wildcard){const{prefix:F,suffix:U}=$;if(F&&(O||!($.caseSensitive?_:T??=_.toLowerCase()).startsWith(F)))continue;if(U){if(O)continue;const V=t.slice(v).join("/").slice(-U.length);if(($.caseSensitive?V:V.toLowerCase())!==U)continue}const B={node:$,index:l,skipped:S,depth:b,statics:j,dynamics:k,optionals:E,extract:C,rawParams:A,parsedParams:P};if(!($.skipOnParamError&&!dw(e,t,B))){d=B;break}}if(g.optional){const $=S|1<<b,F=b+1;for(let U=g.optional.length-1;U>=0;U--){const B=g.optional[U];u.push({node:B,index:v,skipped:$,depth:F,statics:j,dynamics:k,optionals:E,extract:C,rawParams:A,parsedParams:P})}if(!O)for(let U=g.optional.length-1;U>=0;U--){const B=g.optional[U],{prefix:V,suffix:X}=B;if(V||X){const Z=B.caseSensitive?_:T??=_.toLowerCase();if(V&&!Z.startsWith(V)||X&&!Z.endsWith(X))continue}u.push({node:B,index:v+1,skipped:S,depth:F,statics:j,dynamics:k,optionals:E+1,extract:C,rawParams:A,parsedParams:P})}}if(!O&&g.dynamic&&_)for(let $=g.dynamic.length-1;$>=0;$--){const F=g.dynamic[$],{prefix:U,suffix:B}=F;if(U||B){const V=F.caseSensitive?_:T??=_.toLowerCase();if(U&&!V.startsWith(U)||B&&!V.endsWith(B))continue}u.push({node:F,index:v+1,skipped:S,depth:b+1,statics:j,dynamics:k+1,optionals:E,extract:C,rawParams:A,parsedParams:P})}if(!O&&g.staticInsensitive){const $=g.staticInsensitive.get(T??=_.toLowerCase());$&&u.push({node:$,index:v+1,skipped:S,depth:b+1,statics:j+1,dynamics:k,optionals:E,extract:C,rawParams:A,parsedParams:P})}if(!O&&g.static){const $=g.static.get(_);$&&u.push({node:$,index:v+1,skipped:S,depth:b+1,statics:j+1,dynamics:k,optionals:E,extract:C,rawParams:A,parsedParams:P})}if(g.pathless){const $=b+1;for(let F=g.pathless.length-1;F>=0;F--){const U=g.pathless[F];u.push({node:U,index:v,skipped:S,depth:$,statics:j,dynamics:k,optionals:E,extract:C,rawParams:A,parsedParams:P})}}}if(p&&d)return zf(d,p)?p:d;if(p)return p;if(d)return d;if(r&&f){let m=f.index;for(let v=0;v<f.index;v++)m+=t[v].length;const g=m===e.length?"/":e.slice(m);return f.rawParams??=Object.create(null),f.rawParams["**"]=decodeURIComponent(g),f}return null}function dw(e,t,n){try{const[r,i]=YL(e,t,n);n.rawParams=r,n.extract=i;const a=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,a),!0}catch{return null}}function zf(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===Ml)>(e.node.kind===Ml)||t.node.kind===Ml==(e.node.kind===Ml)&&t.depth>e.depth))):!0}function zg(e){return TN(e.filter(t=>t!==void 0).join("/"))}function TN(e){return e.replace(/\/{2,}/g,"/")}function WL(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Mo(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function ZL(e){return Mo(WL(e))}function Zg(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function n7(e,t,n){return Zg(e,n)===Zg(t,n)}function r7({base:e,to:t,trailingSlash:n="never",cache:r}){const i=t.startsWith("/"),a=!i&&t===".";let l;if(r){l=i?t:a?e:e+"\0"+t;const m=r.get(l);if(m)return m}let u;if(a)u=e.split("/");else if(i)u=t.split("/");else{for(u=e.split("/");u.length>1&&vh(u)==="";)u.pop();const m=t.split("/");for(let g=0,v=m.length;g<v;g++){const S=m[g];S===""?g?g===v-1&&u.push(S):u=[S]:S===".."?u.pop():S==="."||u.push(S)}}u.length>1&&(vh(u)===""?n==="never"&&u.pop():n==="always"&&u.push(""));let d,f="";for(let m=0;m<u.length;m++){m>0&&(f+="/");const g=u[m];if(!g)continue;d=zN(g,0,d);const v=d[0];if(v===0){f+=g;continue}const S=d[5],b=g.substring(0,d[1]),j=g.substring(d[4],S),k=g.substring(d[2],d[3]);v===1?f+=b||j?`${b}{$${k}}${j}`:`$${k}`:v===2?f+=b||j?`${b}{$}${j}`:"$":f+=`${b}{-$${k}}${j}`}f=TN(f);const p=f||"/";return l&&r&&r.set(l,p),p}function i7(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,a=>t.get(a)??a)}function fw(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=>Yz(i,n)).join("/"):Yz(r,n)}function Qz({path:e,params:t,decoder:n,...r}){let i=!1;const a=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:a,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:a,isMissingParams:i};const l=e.length;let u=0,d,f="";for(;u<l;){const p=u;d=zN(e,p,d);const m=d[5];if(u=m+1,p===m)continue;const g=d[0];if(g===0){f+="/"+e.substring(p,m);continue}if(g===2){const v=t._splat;a._splat=v,a["*"]=v;const S=e.substring(p,d[1]),b=e.substring(d[4],m);if(!v){i=!0,(S||b)&&(f+="/"+S+b);continue}const j=fw("_splat",t,n);f+="/"+S+j+b;continue}if(g===1){const v=e.substring(d[2],d[3]);!i&&!(v in t)&&(i=!0),a[v]=t[v];const S=e.substring(p,d[1]),b=e.substring(d[4],m),j=fw(v,t,n)??"undefined";f+="/"+S+j+b;continue}if(g===3){const v=e.substring(d[2],d[3]),S=t[v];if(S==null)continue;a[v]=S;const b=e.substring(p,d[1]),j=e.substring(d[4],m),k=fw(v,t,n)??"";f+="/"+b+k+j;continue}}return e.endsWith("/")&&(f+="/"),{usedParams:a,interpolatedPath:f||"/",isMissingParams:i}}function Yz(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function Rr(e){return!!e?.isNotFound}function a7(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var $j="tsr-scroll-restoration-v1_3",s7=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function o7(){const e=a7();if(!e)return null;const t=e.getItem($j);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=zo(r,n)||n;try{e.setItem($j,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var Bm=o7(),l7=e=>e.state.__TSR_key||e.href;function c7(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 Xg=!1;function u7({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:a}){let l;try{l=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(f){console.error(f);return}const u=t||window.history.state?.__TSR_key,d=l[u];Xg=!0;e:{if(r&&d&&Object.keys(d).length>0){for(const m in d){const g=d[m];if(m==="window")window.scrollTo({top:g.scrollY,left:g.scrollX,behavior:n});else if(m){const v=document.querySelector(m);v&&(v.scrollLeft=g.scrollX,v.scrollTop=g.scrollY)}}break e}const f=(a??window.location).hash.split("#",2)[1];if(f){const m=window.history.state?.__hashScrollIntoViewOptions??!0;if(m){const g=document.getElementById(f);g&&g.scrollIntoView(m)}break e}const p={top:0,left:0,behavior:n};if(window.scrollTo(p),i)for(const m of i){if(m==="window")continue;const g=typeof m=="function"?m():document.querySelector(m);g&&g.scrollTo(p)}}Xg=!1}function d7(e,t){if(!Bm||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Bm))return;e.isScrollRestorationSetup=!0,Xg=!1;const n=e.options.getScrollRestorationKey||l7;window.history.scrollRestoration="manual";const r=i=>{if(Xg||!e.isScrollRestoring)return;let a="";if(i.target===document||i.target===window)a="window";else{const u=i.target.getAttribute("data-scroll-restoration-id");u?a=`[data-scroll-restoration-id="${u}"]`:a=c7(i.target)}const l=n(e.state.location);Bm.set(u=>{const d=u[l]||={},f=d[a]||={};if(a==="window")f.scrollX=window.scrollX||0,f.scrollY=window.scrollY||0;else if(a){const p=document.querySelector(a);p&&(f.scrollX=p.scrollLeft||0,f.scrollY=p.scrollTop||0)}return u})};typeof document<"u"&&document.addEventListener("scroll",s7(r,100),!0),e.subscribe("onRendered",i=>{const a=n(i.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(u7({storageKey:$j,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Bm.set(l=>(l[a]||={},l)))})}function f7(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 h7(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 hw(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function p7(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[r,i]of t.entries()){const a=n[r];a==null?n[r]=hw(i):Array.isArray(a)?a.push(hw(i)):n[r]=[a,hw(i)]}return n}var m7=y7(JSON.parse),g7=v7(JSON.stringify,JSON.parse);function y7(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=p7(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function v7(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 a=h7(i,r);return a?`?${a}`:""}}var Kl="__root__";function RN(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 Vr(e){return e instanceof Response&&!!e.options}function x7(e){return{input:({url:t})=>{for(const n of e)t=Bj(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=XL(e[n],t);return t}}}function b7(e){const t=ZL(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:l})=>{const u=e.caseSensitive?l.pathname:l.pathname.toLowerCase();return u===i?l.pathname="/":u.startsWith(a)&&(l.pathname=l.pathname.slice(n.length)),l},output:({url:l})=>(l.pathname=zg(["/",t,l.pathname]),l)}}function Bj(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 XL(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 fn=(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))(fn||{});function JL({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:l,shallowPropagate:u};function r(f,p,m){const g=p.depsTail;if(g!==void 0&&g.dep===f)return;const v=g!==void 0?g.nextDep:p.deps;if(v!==void 0&&v.dep===f){v.version=m,p.depsTail=v;return}const S=f.subsTail;if(S!==void 0&&S.version===m&&S.sub===p)return;const b=p.depsTail=f.subsTail={version:m,dep:f,sub:p,prevDep:g,nextDep:v,prevSub:S,nextSub:void 0};v!==void 0&&(v.prevDep=b),g!==void 0?g.nextDep=b:p.deps=b,S!==void 0?S.nextSub=b:f.subs=b}function i(f,p=f.sub){const m=f.dep,g=f.prevDep,v=f.nextDep,S=f.nextSub,b=f.prevSub;return v!==void 0?v.prevDep=g:p.depsTail=g,g!==void 0?g.nextDep=v:p.deps=v,S!==void 0?S.prevSub=b:m.subsTail=b,b!==void 0?b.nextSub=S:(m.subs=S)===void 0&&n(m),v}function a(f){let p=f.nextSub,m;e:do{const g=f.sub;let v=g.flags;if(v&60?v&12?v&4?!(v&48)&&d(f,g)?(g.flags=v|40,v&=1):v=0:g.flags=v&-9|32:v=0:g.flags=v|32,v&2&&t(g),v&1){const S=g.subs;if(S!==void 0){const b=(f=S).nextSub;b!==void 0&&(m={value:p,prev:m},p=b);continue}}if((f=p)!==void 0){p=f.nextSub;continue}for(;m!==void 0;)if(f=m.value,m=m.prev,f!==void 0){p=f.nextSub;continue e}break}while(!0)}function l(f,p){let m,g=0,v=!1;e:do{const S=f.dep,b=S.flags;if(p.flags&16)v=!0;else if((b&17)===17){if(e(S)){const j=S.subs;j.nextSub!==void 0&&u(j),v=!0}}else if((b&33)===33){(f.nextSub!==void 0||f.prevSub!==void 0)&&(m={value:f,prev:m}),f=S.deps,p=S,++g;continue}if(!v){const j=f.nextDep;if(j!==void 0){f=j;continue}}for(;g--;){const j=p.subs,k=j.nextSub!==void 0;if(k?(f=m.value,m=m.prev):f=j,v){if(e(p)){k&&u(j),p=f.sub;continue}v=!1}else p.flags&=-33;p=f.sub;const E=f.nextDep;if(E!==void 0){f=E;continue e}}return v}while(!0)}function u(f){do{const p=f.sub,m=p.flags;(m&48)===32&&(p.flags=m|16,(m&6)===2&&t(p))}while((f=f.nextSub)!==void 0)}function d(f,p){let m=p.depsTail;for(;m!==void 0;){if(m===f)return!0;m=m.prevDep}return!1}}let DN=0,jl=0,ah=0;const ws=[],{link:D_e,unlink:e5,propagate:M_e,checkDirty:w7,shallowPropagate:I_e}=JL({update(e){return e.depsTail!==void 0?k7(e):C7(e)},notify(e){let t=ah,n=t;do if(ws[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(ah=t;n<--t;){const r=ws[n];ws[n++]=ws[t],ws[t]=r}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,wv(e)):E7.call(e)}});function S7(){return DN}function j7(){++DN}function N7(){--DN||O7()}function k7(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,wv(e)}}function C7(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function A7(e){const t=e.flags;if(t&16||t&32&&w7(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,wv(e)}}else e.flags=2}function O7(){try{for(;jl<ah;){const e=ws[jl];ws[jl++]=void 0,A7(e)}}finally{for(;jl<ah;){const e=ws[jl];ws[jl++]=void 0,e.flags|=10}jl=0,ah=0}}function E7(){this.depsTail=void 0,this.flags=0,wv(this);const e=this.subs;e!==void 0&&e5(e)}function wv(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=e5(n,e)}function MN(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 Uj=[];let Pg=0;const{link:Wz,unlink:_7,propagate:z7,checkDirty:t5,shallowPropagate:Zz}=JL({update(e){return e._update()},notify(e){Uj[qj++]=e,e.flags&=~fn.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=fn.Mutable|fn.Dirty,Jg(e))}});let Um=0,qj=0,Pa;function Jg(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=_7(n,e)}function n5(){if(!(S7()>0)){for(;Um<qj;){const e=Uj[Um];Uj[Um++]=void 0,e.notify()}Um=0,qj=0}}function r5(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?fn.None:fn.Mutable,get(){return Pa!==void 0&&Wz(i,Pa,Pg),i._snapshot},subscribe(a){const l=MN(a),u={current:!1},d=P7(()=>{i.get(),u.current?l.next?.(i._snapshot):u.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const l=Pa,u=Object.is;if(n)Pa=i,++Pg,i.depsTail=void 0;else if(a===void 0)return!1;n&&(i.flags=fn.Mutable|fn.RecursedCheck);try{const d=i._snapshot,f=typeof a=="function"?a(d):a===void 0&&n?r(d):a;return d===void 0||!u(d,f)?(i._snapshot=f,!0):!1}finally{Pa=l,n&&(i.flags&=~fn.RecursedCheck),Jg(i)}}};return n?(i.flags=fn.Mutable|fn.Dirty,i.get=function(){const a=i.flags;if(a&fn.Dirty||a&fn.Pending&&t5(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&Zz(l)}}else a&fn.Pending&&(i.flags=a&~fn.Pending);return Pa!==void 0&&Wz(i,Pa,Pg),i._snapshot}):i.set=function(a){if(i._update(a)){const l=i.subs;l!==void 0&&(z7(l),Zz(l),n5())}},i}function P7(e){const t=()=>{const r=Pa;Pa=n,++Pg,n.depsTail=void 0,n.flags=fn.Watching|fn.RecursedCheck;try{return e()}finally{Pa=r,n.flags&=~fn.RecursedCheck,Jg(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:fn.Watching|fn.RecursedCheck,notify(){const r=this.flags;r&fn.Dirty||r&fn.Pending&&t5(this.deps,this)?t():this.flags=fn.Watching},stop(){this.flags=fn.None,this.depsTail=void 0,Jg(this)}};return t(),n}class T7{constructor(t){this.atom=r5(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(MN(t))}}class R7{constructor(t){this.atom=r5(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(MN(t))}}function D7(e){return typeof e=="function"?new R7(e):new T7(e)}function M7(e){try{j7(),e()}finally{N7(),n5()}}function sh(e){let t;return M7(()=>{t=e()}),t}var Fj=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Sv=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),Gl=(e,t,n=!0)=>{const r={...e.router.options.context??{}},i=n?t:t-1;for(let a=0;a<=i;a++){const l=e.matches[a];if(!l)continue;const u=e.router.getMatch(l.id);u&&Object.assign(r,u.__routeContext,u.__beforeLoadContext)}return r},Xz=(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 a=n?e.matches.findIndex(l=>l.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let l=a;l>=0;l--){const u=e.matches[l];if(e.router.looseRoutesById[u.routeId].options.notFoundComponent)return l}return n?a:i},Po=(e,t,n)=>{if(!(!Vr(n)&&!Rr(n)))throw Vr(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:Vr(n)?"redirected":r.status==="pending"?"success":r.status,context:Gl(e,t.index),isFetching:!1,error:n})),Rr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Vr(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},i5=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Jz=(e,t,n)=>{const r=Gl(e,n);e.updateMatch(t,i=>({...i,context:r}))},Pf=(e,t,n,r)=>{const{id:i,routeId:a}=e.matches[t],l=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,Po(e,e.router.getMatch(i),n);try{l.options.onError?.(n)}catch(u){n=u,Po(e,e.router.getMatch(i),n)}e.updateMatch(i,u=>(u._nonReactive.beforeLoadPromise?.resolve(),u._nonReactive.beforeLoadPromise=void 0,u._nonReactive.loadPromise?.resolve(),{...u,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!Vr(n)&&!Rr(n)&&(e.serialError??=n)},a5=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Sv(e,t)&&(n.options.loader||n.options.beforeLoad||o5(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const a=setTimeout(()=>{Fj(e)},i);r._nonReactive.pendingTimeout=a}},I7=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;a5(e,t,n,r);const i=()=>{const a=e.router.getMatch(t);a.preload&&(a.status==="redirected"||a.status==="notFound")&&Po(e,a,a.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},L7=(e,t,n,r)=>{const i=e.router.getMatch(t);let a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Qu(()=>{a?.resolve(),a=void 0});const{paramsError:l,searchError:u}=i;l&&Pf(e,n,l,"PARSE_PARAMS"),u&&Pf(e,n,u,"VALIDATE_SEARCH"),a5(e,t,r,i);const d=new AbortController;let f=!1;const p=()=>{f||(f=!0,e.updateMatch(t,A=>({...A,isFetching:"beforeLoad",fetchCount:A.fetchCount+1,abortController:d})))},m=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,A=>({...A,isFetching:!1}))};if(!r.options.beforeLoad){sh(()=>{p(),m()});return}i._nonReactive.beforeLoadPromise=Qu();const g={...Gl(e,n,!1),...i.__routeContext},{search:v,params:S,cause:b}=i,j=Sv(e,t),k={search:v,abortController:d,params:S,preload:j,context:g,location:e.location,navigate:A=>e.router.navigate({...A,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:j?"preload":b,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},E=A=>{if(A===void 0){sh(()=>{p(),m()});return}(Vr(A)||Rr(A))&&(p(),Pf(e,n,A,"BEFORE_LOAD")),sh(()=>{p(),e.updateMatch(t,P=>({...P,__beforeLoadContext:A})),m()})};let C;try{if(C=r.options.beforeLoad(k),xh(C))return p(),C.catch(A=>{Pf(e,n,A,"BEFORE_LOAD")}).then(E)}catch(A){p(),Pf(e,n,A,"BEFORE_LOAD")}E(C)},$7=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>u(),l=()=>L7(e,n,t,i),u=()=>{if(i5(e,n))return;const d=I7(e,n,i);return xh(d)?d.then(l):l()};return a()},B7=(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(([a,l,u])=>({meta:a?.meta,links:a?.links,headScripts:a?.scripts,headers:u,scripts:l,styles:a?.styles}))},s5=(e,t,n,r,i)=>{const a=t[r-1],{params:l,loaderDeps:u,abortController:d,cause:f}=e.router.getMatch(n),p=Gl(e,r),m=Sv(e,n);return{params:l,deps:u,preload:!!m,parentMatchPromise:a,abortController:d,context:p,location:e.location,navigate:g=>e.router.navigate({...g,_fromLocation:e.location}),cause:m?"preload":f,route:i,...e.router.options.additionalContext}},e2=async(e,t,n,r,i)=>{try{const a=e.router.getMatch(n);try{(!(LK??e.router.isServer)||a.ssr===!0)&&bh(i);const l=i.options.loader,u=typeof l=="function"?l:l?.handler,d=u?.(s5(e,t,n,r,i)),f=!!u&&xh(d);if((f||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,m=>({...m,isFetching:"loader"})),u){const m=f?await d:d;Po(e,e.router.getMatch(n),m),m!==void 0&&e.updateMatch(n,g=>({...g,loaderData:m}))}i._lazyPromise&&await i._lazyPromise;const p=a._nonReactive.minPendingPromise;p&&await p,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,m=>({...m,error:void 0,context:Gl(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let u=l;if(u?.name==="AbortError"){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,f=>({...f,status:f.status==="pending"?"success":f.status,isFetching:!1,context:Gl(e,r)}));return}const d=a._nonReactive.minPendingPromise;d&&await d,Rr(l)&&await i.options.notFoundComponent?.preload?.(),Po(e,e.router.getMatch(n),l);try{i.options.onError?.(l)}catch(f){u=f,Po(e,e.router.getMatch(n),f)}!Vr(u)&&!Rr(u)&&await bh(i,["errorComponent"]),e.updateMatch(n,f=>({...f,error:u,context:Gl(e,r),status:"error",isFetching:!1}))}}catch(a){const l=e.router.getMatch(n);l&&(l._nonReactive.loaderPromise=void 0),Po(e,l,a)}},U7=async(e,t,n)=>{async function r(v,S,b,j,k){const E=Date.now()-S.updatedAt,C=v?k.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:k.options.staleTime??e.router.options.defaultStaleTime??0,A=k.options.shouldReload,P=typeof A=="function"?A(s5(e,t,i,n,k)):A,{status:O,invalid:_}=j,T=E>C&&(!!e.forceStaleReload||j.cause==="enter"||b!==void 0&&b!==j.id);l=O==="success"&&(_||(P??T)),v&&k.options.preload===!1||(l&&!e.sync&&p?(u=!0,(async()=>{try{await e2(e,t,i,n,k);const $=e.router.getMatch(i);$._nonReactive.loaderPromise?.resolve(),$._nonReactive.loadPromise?.resolve(),$._nonReactive.loaderPromise=void 0,$._nonReactive.loadPromise=void 0}catch($){Vr($)&&await e.router.navigate($.options)}})()):O!=="success"||l?await e2(e,t,i,n,k):Jz(e,i,n))}const{id:i,routeId:a}=e.matches[n];let l=!1,u=!1;const d=e.router.looseRoutesById[a],f=d.options.loader,p=((typeof f=="function"?void 0:f?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(i5(e,i)){if(!e.router.getMatch(i))return e.matches[n];Jz(e,i,n)}else{const v=e.router.getMatch(i),S=e.router.state.matches[n]?.routeId===a?e.router.state.matches[n].id:e.router.state.matches.find(j=>j.routeId===a)?.id,b=Sv(e,i);if(v._nonReactive.loaderPromise){if(v.status==="success"&&!e.sync&&!v.preload&&p)return v;await v._nonReactive.loaderPromise;const j=e.router.getMatch(i),k=j._nonReactive.error||j.error;k&&Po(e,j,k),j.status==="pending"&&await r(b,v,S,j,d)}else{const j=b&&!e.router.state.matches.some(E=>E.id===i),k=e.router.getMatch(i);k._nonReactive.loaderPromise=Qu(),j!==k.preload&&e.updateMatch(i,E=>({...E,preload:j})),await r(b,v,S,k,d)}}const m=e.router.getMatch(i);u||(m._nonReactive.loaderPromise?.resolve(),m._nonReactive.loadPromise?.resolve(),m._nonReactive.loadPromise=void 0),clearTimeout(m._nonReactive.pendingTimeout),m._nonReactive.pendingTimeout=void 0,u||(m._nonReactive.loaderPromise=void 0),m._nonReactive.dehydrated=void 0;const g=u?m.isFetching:!1;return g!==m.isFetching||m.invalid!==!1?(e.updateMatch(i,v=>({...v,isFetching:g,invalid:!1})),e.router.getMatch(i)):m};async function t2(e){const t=e,n=[];t.router.state.matches.some(g=>g._forcePending)&&Fj(t);let r;for(let g=0;g<t.matches.length;g++){try{const v=$7(t,g);xh(v)&&await v}catch(v){if(Vr(v))throw v;if(Rr(v))r=v;else if(!t.preload)throw v;break}if(t.serialError)break}const i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?Xz(t,r):void 0,l=r&&t.preload?0:a!==void 0?Math.min(a+1,i):i;let u,d;for(let g=0;g<l;g++)n.push(U7(t,n,g));try{await Promise.all(n)}catch{const g=await Promise.allSettled(n);for(const v of g){if(v.status!=="rejected")continue;const S=v.reason;if(Vr(S))throw S;Rr(S)?u??=S:d??=S}if(d!==void 0)throw d}const f=u??(r&&!t.preload?r:void 0);let p=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!f&&r&&t.preload)return t.matches;if(f){const g=Xz(t,f);Es(g!==void 0);const v=t.matches[g],S=t.router.looseRoutesById[v.routeId],b=t.router.options?.defaultNotFoundComponent;!S.options.notFoundComponent&&b&&(S.options.notFoundComponent=b),f.routeId=v.routeId;const j=v.routeId===t.router.routeTree.id;t.updateMatch(v.id,k=>({...k,...j?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:f},isFetching:!1})),p=g,await bh(S,["notFoundComponent"])}else if(!t.preload){const g=t.matches[0];g.globalNotFound||t.router.getMatch(g.id)?.globalNotFound&&t.updateMatch(g.id,v=>({...v,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const g=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await bh(g,["errorComponent"])}for(let g=0;g<=p;g++){const{id:v,routeId:S}=t.matches[g],b=t.router.looseRoutesById[S];try{const j=B7(t,v,b);if(j){const k=await j;t.updateMatch(v,E=>({...E,...k}))}}catch(j){console.error(`Error executing head for route ${S}:`,j)}}const m=Fj(t);if(xh(m)&&await m,f)throw f;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function n2(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function bh(e,t=Tg){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:i,...a}=r.options;Object.assign(e.options,a),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===Tg?(()=>{if(e._componentsPromise===void 0){const r=n2(e,Tg);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():n2(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function o5(e){for(const t of Tg)if(e.options[t]?.preload)return!0;return!1}var Tg=["component","errorComponent","pendingComponent","notFoundComponent"],Io="__TSR_index",r2="popstate",i2="beforeunload";function q7(e){let t=e.getLocation();const n=new Set,r=l=>{t=e.getLocation(),n.forEach(u=>u({location:t,action:l}))},i=l=>{e.notifyOnIndexChange??!0?r(l):t=e.getLocation()},a=async({task:l,navigateOpts:u,...d})=>{if(u?.ignoreBlocker??!1){l();return}const f=e.getBlockers?.()??[],p=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&f.length&&p)for(const m of f){const g=ey(d.path,d.state);if(await m.blockerFn({currentLocation:t,nextLocation:g,action:d.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,u,d)=>{const f=t.state[Io];u=a2(f+1,u),a({task:()=>{e.pushState(l,u),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:l,state:u})},replace:(l,u,d)=>{const f=t.state[Io];u=a2(f,u),a({task:()=>{e.replaceState(l,u),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:l,state:u})},go:(l,u)=>{a({task:()=>{e.go(l),i({type:"GO",index:l})},navigateOpts:u,type:"GO"})},back:l=>{a({task:()=>{e.back(l?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{a({task:()=>{e.forward(l?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[Io]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const u=e.getBlockers?.()??[];return e.setBlockers([...u,l]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(f=>f!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function a2(e,t){t||(t={});const n=IN();return{...t,key:n,__TSR_key:n,[Io]:e}}function F7(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let i=[];const a=()=>i,l=T=>i=T,u=(T=>T),d=(()=>ey(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const T=IN();t.history.replaceState({[Io]:0,key:T,__TSR_key:T},"")}let f=d(),p,m=!1,g=!1,v=!1,S=!1;const b=()=>f;let j,k;const E=()=>{j&&(_._ignoreSubscribers=!0,(j.isPush?t.history.pushState:t.history.replaceState)(j.state,"",j.href),_._ignoreSubscribers=!1,j=void 0,k=void 0,p=void 0)},C=(T,$,F)=>{const U=u($);k||(p=f),f=ey($,F),j={href:U,state:F,isPush:j?.isPush||T==="push"},k||(k=Promise.resolve().then(()=>E()))},A=T=>{f=d(),_.notify({type:T})},P=async()=>{if(g){g=!1;return}const T=d(),$=T.state[Io]-f.state[Io],F=$===1,U=$===-1,B=!F&&!U||m;m=!1;const V=B?"GO":U?"BACK":"FORWARD",X=B?{type:"GO",index:$}:{type:U?"BACK":"FORWARD"};if(v)v=!1;else{const Z=a();if(typeof document<"u"&&Z.length){for(const H of Z)if(await H.blockerFn({currentLocation:f,nextLocation:T,action:V})){g=!0,t.history.go(1),_.notify(X);return}}}f=d(),_.notify(X)},O=T=>{if(S){S=!1;return}let $=!1;const F=a();if(typeof document<"u"&&F.length)for(const U of F){const B=U.enableBeforeUnload??!0;if(B===!0){$=!0;break}if(typeof B=="function"&&B()===!0){$=!0;break}}if($)return T.preventDefault(),T.returnValue=""},_=q7({getLocation:b,getLength:()=>t.history.length,pushState:(T,$)=>C("push",T,$),replaceState:(T,$)=>C("replace",T,$),back:T=>(T&&(v=!0),S=!0,t.history.back()),forward:T=>{T&&(v=!0),S=!0,t.history.forward()},go:T=>{m=!0,t.history.go(T)},createHref:T=>u(T),flush:E,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(i2,O,{capture:!0}),t.removeEventListener(r2,P)},onBlocked:()=>{p&&f!==p&&(f=p)},getBlockers:a,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(i2,O,{capture:!0}),t.addEventListener(r2,P),t.history.pushState=function(...T){const $=n.apply(t.history,T);return _._ignoreSubscribers||A("PUSH"),$},t.history.replaceState=function(...T){const $=r.apply(t.history,T);return _._ignoreSubscribers||A("REPLACE"),$},_}function H7(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function ey(e,t){const n=H7(e),r=n.indexOf("#"),i=n.indexOf("?"),a=IN();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||{[Io]:0,key:a,__TSR_key:a}}}function IN(){return(Math.random()+1).toString(36).substring(7)}function Vl(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 K7(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}var G7=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,a=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=i7(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=F7()),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 f;this.resolvePathCache=Wg(1e3),f=this.buildRouteTree(),this.setRoutes(f)}!this.__store&&this.latestLocation&&(this.__store=D7(Q7(this.latestLocation)),d7(this));let l=!1;const u=this.options.basepath??"/",d=this.options.rewrite;if(i||r!==u||a!==d){this.basepath=u;const f=[],p=ZL(u);p&&p!=="/"&&f.push(b7({basepath:u})),d&&f.push(d),this.rewrite=f.length===0?void 0:f.length===1?f[0]:x7(f),this.history&&this.updateLatestLocation(),l=!0}l&&this.__store&&this.__store.setState(f=>({...f,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=XK(this.routeTree,this.options.caseSensitive,(n,r)=>{n.init({originalIndex:r})});return this.options.routeMasks&&VK(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:u,search:d,hash:f,href:p,state:m})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(u)){const j=this.options.parseSearch(d),k=this.options.stringifySearch(j);return{href:u+k+f,publicHref:p,pathname:_f(u).path,external:!1,searchStr:k,search:Sl(n?.search,j),hash:_f(f.slice(1)).path,state:Dl(n?.state,m)}}const g=new URL(p,this.origin),v=Bj(this.rewrite,g),S=this.options.parseSearch(v.search),b=this.options.stringifySearch(S);return v.search=b,{href:v.href.replace(v.origin,""),publicHref:p,pathname:_f(v.pathname).path,external:!!this.rewrite&&v.origin!==this.origin,searchStr:b,search:Sl(n?.search,S),hash:_f(v.hash.slice(1)).path,state:Dl(n?.state,m)}},i=r(t),{__tempLocation:a,__tempKey:l}=i.state;if(a&&(!l||l===this.tempLocationKey)){const u=r(a);return u.state.key=i.state.key,u.state.__TSR_key=i.state.__TSR_key,delete u.state.__tempLocation,{...u,maskedLocation:i}}return i},this.resolvePathWithBase=(t,n)=>r7({base:t,to:TN(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=>Y7({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 a=i._fromLocation||this.pendingBuiltLocation||this.latestLocation,l=this.matchRoutesLightweight(a);i.from;const u=i.unsafeRelative==="path"?a.pathname:i.from??l.fullPath,d=this.resolvePathWithBase(u,"."),f=l.search,p=Object.assign(Object.create(null),l.params),m=i.to?this.resolvePathWithBase(d,`${i.to}`):this.resolvePathWithBase(d,"."),g=i.params===!1||i.params===null?Object.create(null):(i.params??!0)===!0?p:Object.assign(p,zo(i.params,p)),v=this.getMatchedRoutes(m);let S=v.matchedRoutes;if((!v.foundRoute||v.foundRoute.path!=="/"&&v.routeParams["**"])&&this.options.notFoundRoute&&(S=[...S,this.options.notFoundRoute]),Object.keys(g).length>0)for(const $ of S){const F=$.options.params?.stringify??$.options.stringifyParams;if(F)try{Object.assign(g,F(g))}catch{}}const b=t.leaveParams?m:_f(Qz({path:m,params:g,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let j=f;if(t._includeValidateSearch&&this.options.search?.strict){const $={};S.forEach(F=>{if(F.options.validateSearch)try{Object.assign($,Rg(F.options.validateSearch,{...$,...j}))}catch{}}),j=$}j=W7({search:j,dest:i,destRoutes:S,_includeValidateSearch:t._includeValidateSearch}),j=Sl(f,j);const k=this.options.stringifySearch(j),E=i.hash===!0?a.hash:i.hash?zo(i.hash,a.hash):void 0,C=E?`#${E}`:"";let A=i.state===!0?a.state:i.state?zo(i.state,a.state):{};A=Dl(a.state,A);const P=`${b}${k}${C}`;let O,_,T=!1;if(this.rewrite){const $=new URL(P,this.origin),F=XL(this.rewrite,$);O=$.href.replace($.origin,""),F.origin!==this.origin?(_=F.href,T=!0):_=F.pathname+F.search+F.hash}else O=HK(P),_=O;return{publicHref:_,href:O,pathname:b,search:j,searchStr:k,state:A,hash:E??"",external:T,unmaskOnReload:i.unmaskOnReload}},r=(i={},a)=>{const l=n(i);let u=a?n(a):void 0;if(!u){const d=Object.create(null);if(this.options.routeMasks){const f=QK(l.pathname,this.processedTree);if(f){Object.assign(d,f.rawParams);const{from:p,params:m,...g}=f.route,v=m===!1||m===null?Object.create(null):(m??!0)===!0?d:Object.assign(d,zo(m,d));a={from:t.from,...g,params:v},u=n(a)}}}return u&&(l.maskedLocation=u),l};return t.mask?r(t,{from:t.from,...t.mask}):r(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:n,...r})=>{const i=()=>{const u=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];u.forEach(f=>{r.state[f]=this.latestLocation.state[f]});const d=Hl(r.state,this.latestLocation.state);return u.forEach(f=>{delete r.state[f]}),d},a=Mo(this.latestLocation.href)===Mo(r.href);let l=this.commitLocationPromise;if(this.commitLocationPromise=Qu(()=>{l?.resolve(),l=void 0}),a&&i())this.load();else{let{maskedLocation:u,hashScrollIntoView:d,...f}=r;u&&(f={...u,state:{...u.state,__tempKey:void 0,__tempLocation:{...f,search:f.searchStr,state:{...f.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(f.unmaskOnReload??this.options.unmaskOnReload??!1)&&(f.state.__tempKey=this.tempLocationKey)),f.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[r.replace?"replace":"push"](f.publicHref,f.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:a,href:l,...u}={})=>{if(l){const p=this.history.location.state.__TSR_index,m=ey(l,{__TSR_index:t?p:p+1}),g=new URL(m.pathname,this.origin);u.to=Bj(this.rewrite,g).pathname,u.search=this.options.parseSearch(m.search),u.hash=m.hash.slice(1)}const d=this.buildLocation({...u,_includeValidateSearch:!0});this.pendingBuiltLocation=d;const f=this.commitLocation({...d,viewTransition:i,replace:t,resetScroll:n,hashScrollIntoView:r,ignoreBlocker:a});return Promise.resolve().then(()=>{this.pendingBuiltLocation===d&&(this.pendingBuiltLocation=void 0)}),f},this.navigate=async({to:t,reloadDocument:n,href:r,publicHref:i,...a})=>{let l=!1;if(r)try{new URL(`${r}`),l=!0}catch{}if(l&&!n&&(n=!0),n){if(t!==void 0||!r){const d=this.buildLocation({to:t,...a});r=r??d.publicHref,i=i??d.publicHref}const u=!l&&i?i:r;if(Yg(u,this.protocolAllowlist))return Promise.resolve();if(!a.ignoreBlocker){const d=this.history.getBlockers?.()??[];for(const f of d)if(f?.blockerFn&&await f.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return a.replace?window.location.replace(u):window.location.href=u,Promise.resolve()}return this.buildAndCommitLocation({...a,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 a=this.state.resolvedLocation??this.state.location;for(i=new Promise(u=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,f=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Vl({resolvedLocation:f,location:d})}),this.emit({type:"onBeforeLoad",...Vl({resolvedLocation:f,location:d})}),await t2({router:this,sync:t?.sync,forceStaleReload:a.href===d.href,matches:this.state.pendingMatches,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let p=[],m=[],g=[],v=[];sh(()=>{this.__store.setState(S=>{const b=S.matches,j=S.pendingMatches||S.matches;return p=b.filter(k=>!j.some(E=>E.id===k.id)),m=b.filter(k=>!j.some(E=>E.routeId===k.routeId)),g=j.filter(k=>!b.some(E=>E.routeId===k.routeId)),v=j.filter(k=>b.some(E=>E.routeId===k.routeId)),{...S,isLoading:!1,loadedAt:Date.now(),matches:j,pendingMatches:void 0,cachedMatches:[...S.cachedMatches,...p.filter(k=>k.status!=="error"&&k.status!=="notFound"&&k.status!=="redirected")]}}),this.clearExpiredCache()}),[[m,"onLeave"],[g,"onEnter"],[v,"onStay"]].forEach(([S,b])=>{S.forEach(j=>{this.looseRoutesById[j.routeId].options[b]?.(j)})})})})}})}catch(d){Vr(d)?(n=d,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):Rr(d)&&(r=d),this.__store.setState(f=>({...f,statusCode:n?n.status:r?404:f.matches.some(p=>p.status==="error")?500:200,redirect:n}))}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),u()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let l;this.hasNotFoundMatch()?l=404:this.__store.state.matches.some(u=>u.status==="error")&&(l=500),l!==void 0&&this.__store.setState(u=>({...u,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,a=this.state.resolvedLocation,l=typeof n.types=="function"?n.types(Vl({resolvedLocation:a,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:K7(i.cachedMatches.map(a=>a.id===t?n(a):a))})):this.__store.setState(i=>({...i,[r]:i[r]?.map(a=>a.id===t?n(a):a)})))})},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&&Yg(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=bh,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)),a=new Set([...i,...this.state.cachedMatches.map(l=>l.id)]);sh(()=>{r.forEach(l=>{a.has(l.id)||this.__store.setState(u=>({...u,cachedMatches:[...u.cachedMatches,l]}))})});try{return r=await t2({router:this,matches:r,location:n,preload:!0,updateMatch:(l,u)=>{i.has(l)?r=r.map(d=>d.id===l?u(d):d):this.updateMatch(l,u)}}),r}catch(l){if(Vr(l))return l.options.reloadDocument?void 0:await this.preloadRoute({...l.options,_fromLocation:n});Rr(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 a=(n?.pending===void 0?!this.state.isLoading:n.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,l=YK(i.pathname,n?.caseSensitive??!1,n?.fuzzy??!1,a.pathname,this.processedTree);return!l||t.params&&!Hl(l.rawParams,t.params,{partial:!0})?!1:n?.includeSearch??!0?Hl(a.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??g7,parseSearch:e.parseSearch??m7,protocolAllowlist:e.protocolAllowlist??FK}),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:a}=n;let{matchedRoutes:l}=n,u=!1;(r?r.path!=="/"&&i["**"]:Mo(e.pathname))&&(this.options.notFoundRoute?l=[...l,this.options.notFoundRoute]:u=!0);const d=u?X7(this.options.notFoundMode,l):void 0,f=new Array(l.length),p=new Map(this.state.matches.map(m=>[m.routeId,m]));for(let m=0;m<l.length;m++){const g=l[m],v=f[m-1];let S,b,j;{const V=v?.search??e.search,X=v?._strictSearch??void 0;try{const Z=Rg(g.options.validateSearch,{...V})??void 0;S={...V,...Z},b={...X,...Z},j=void 0}catch(Z){let H=Z;if(Z instanceof ty||(H=new ty(Z.message,{cause:Z})),t?.throwOnError)throw H;S=V,b={},j=H}}const k=g.options.loaderDeps?.({search:S})??"",E=k?JSON.stringify(k):"",{interpolatedPath:C,usedParams:A}=Qz({path:g.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),P=g.id+C+E,O=this.getMatch(P),_=p.get(g.id),T=O?._strictParams??A;let $;if(!O)try{s2(g,A,a,T)}catch(V){if(Rr(V)||Vr(V)?$=V:$=new V7(V.message,{cause:V}),t?.throwOnError)throw $}Object.assign(i,T);const F=_?"stay":"enter";let U;if(O)U={...O,cause:F,params:_?.params??i,_strictParams:T,search:Sl(_?_.search:O.search,S),_strictSearch:b};else{const V=g.options.loader||g.options.beforeLoad||g.lazyFn||o5(g)?"pending":"success";U={id:P,ssr:g.options.ssr,index:m,routeId:g.id,params:_?.params??i,_strictParams:T,pathname:C,updatedAt:Date.now(),search:_?Sl(_.search,S):S,_strictSearch:b,searchError:void 0,status:V,isFetching:!1,error:void 0,paramsError:$,__routeContext:void 0,_nonReactive:{loadPromise:Qu()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:F,loaderDeps:_?Dl(_.loaderDeps,k):k,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:g.options.staticData||{},fullPath:g.fullPath}}t?.preload||(U.globalNotFound=d===g.id),U.searchError=j;const B=this.getParentContext(v);U.context={...B,...U.__routeContext,...U.__beforeLoadContext},f[m]=U}for(let m=0;m<f.length;m++){const g=f[m],v=this.looseRoutesById[g.routeId],S=this.getMatch(g.id),b=p.get(g.routeId);if(g.params=b?Sl(b.params,i):i,!S){const j=f[m-1],k=this.getParentContext(j);if(v.options.context){const E={deps:g.loaderDeps,params:g.params,context:k??{},location:e,navigate:C=>this.navigate({...C,_fromLocation:e}),buildLocation:this.buildLocation,cause:g.cause,abortController:g.abortController,preload:!!g.preload,matches:f,routeId:v.id};g.__routeContext=v.options.context(E)??void 0}g.context={...k,...g.__routeContext,...g.__beforeLoadContext}}}return f}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=vh(t),a={...e.search};for(const f of t)try{Object.assign(a,Rg(f.options.validateSearch,a))}catch{}const l=vh(this.state.matches),u=l&&l.routeId===i.id&&e.pathname===this.state.location.pathname;let d;if(u)d=l.params;else{const f=Object.assign(Object.create(null),n);for(const p of t)try{s2(p,n,r??{},f)}catch{}d=f}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:d}}},ty=class extends Error{},V7=class extends Error{};function Q7(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Rg(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new ty("Async validation not supported");if(n.issues)throw new ty(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 Y7({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),i=Mo(e);let a,l;const u=WK(i,n,!0);return u&&(a=u.route,Object.assign(r,u.rawParams),l=Object.assign(Object.create(null),u.parsedParams)),{matchedRoutes:u?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:l}}function W7({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return Z7(n)(e,t,r??!1)}function Z7(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 a=({search:l,next:u})=>{let d=l;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(d=i.options.preSearchFilters.reduce((p,m)=>m(p),l));const f=u(d);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((p,m)=>m(p),f):f};t.middlewares.push(a)}if(i.options.validateSearch){const a=({search:l,next:u})=>{const d=u(l);if(!t._includeValidateSearch)return d;try{return{...d,...Rg(i.options.validateSearch,d)??void 0}}catch{return d}};t.middlewares.push(a)}}const n=({search:i})=>{const a=t.dest;return a.search?a.search===!0?i:zo(a.search,i):{}};t.middlewares.push(n);const r=(i,a,l)=>{if(i>=l.length)return a;const u=l[i];return u({search:a,next:f=>r(i+1,f,l)})};return function(a,l,u){return t.dest=l,t._includeValidateSearch=u,r(0,a,t.middlewares)}}function X7(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 Kl}function s2(e,t,n,r){const i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(const a in t)a in n&&(r[a]=n[a]);else{const a=i(r);Object.assign(r,a)}}var J7="Error preloading route! ☝️",l5=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=Kl:this.parentRoute||Es(!1);let i=r?Kl:n?.path;i&&i!=="/"&&(i=WL(i));const a=n?.id||i;let l=r?Kl:zg([this.parentRoute.id==="__root__"?"":this.parentRoute.id,a]);i==="__root__"&&(i="/"),l!=="__root__"&&(l=zg(["/",l]));const u=l==="__root__"?"/":zg([this.parentRoute.fullPath,i]);this._path=i,this._id=l,this._fullPath=u,this._to=Mo(u)},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=>RN({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.")}},eG=class extends l5{constructor(e){super(e)}};function LN(e){const t=e.errorComponent??$N;return o.jsx(tG,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?x.createElement(t,{error:n,reset:r}):e.children})}var tG=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 $N({error:e}){const[t,n]=x.useState(!1);return o.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[o.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),o.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"})]}),o.jsx("div",{style:{height:".25rem"}}),t?o.jsx("div",{children:o.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?o.jsx("code",{children:e.message}):null})}):null]})}function nG({children:e,fallback:t=null}){return c5()?o.jsx(Ii.Fragment,{children:e}):o.jsx(Ii.Fragment,{children:t})}function c5(){return Ii.useSyncExternalStore(rG,()=>!0,()=>!1)}function rG(){return()=>{}}var u5=x.createContext(null);function Vi(e){const t=x.useContext(u5);return e?.warn,t}var pw={exports:{}},mw={},gw={exports:{}},yw={};var o2;function iG(){if(o2)return yw;o2=1;var e=gd();function t(m,g){return m===g&&(m!==0||1/m===1/g)||m!==m&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function u(m,g){var v=g(),S=r({inst:{value:v,getSnapshot:g}}),b=S[0].inst,j=S[1];return a(function(){b.value=v,b.getSnapshot=g,d(b)&&j({inst:b})},[m,v,g]),i(function(){return d(b)&&j({inst:b}),m(function(){d(b)&&j({inst:b})})},[m]),l(v),v}function d(m){var g=m.getSnapshot;m=m.value;try{var v=g();return!n(m,v)}catch{return!0}}function f(m,g){return g()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return yw.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,yw}var l2;function aG(){return l2||(l2=1,gw.exports=iG()),gw.exports}var c2;function sG(){if(c2)return mw;c2=1;var e=gd(),t=aG();function n(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,l=e.useEffect,u=e.useMemo,d=e.useDebugValue;return mw.useSyncExternalStoreWithSelector=function(f,p,m,g,v){var S=a(null);if(S.current===null){var b={hasValue:!1,value:null};S.current=b}else b=S.current;S=u(function(){function k(O){if(!E){if(E=!0,C=O,O=g(O),v!==void 0&&b.hasValue){var _=b.value;if(v(_,O))return A=_}return A=O}if(_=A,r(C,O))return _;var T=g(O);return v!==void 0&&v(_,T)?(C=O,_):(C=O,A=T)}var E=!1,C,A,P=m===void 0?null:m;return[function(){return k(p())},P===null?void 0:function(){return k(P())}]},[p,m,g,v]);var j=i(f,S[0],S[1]);return l(function(){b.hasValue=!0,b.value=j},[j]),d(j),j},mw}var u2;function oG(){return u2||(u2=1,pw.exports=sG()),pw.exports}var d5=oG();function lG(e,t){return e===t}function cG(e,t,n=lG){const r=x.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:u}=e.subscribe(l);return u},[e]),i=x.useCallback(()=>e?.get(),[e]);return d5.useSyncExternalStoreWithSelector(r,i,i,t,n)}function Zr(e){const t=Vi({warn:e?.router===void 0}),n=e?.router||t,r=x.useRef(void 0);return cG(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const a=Dl(r.current,e.select(i));return r.current=a,a}return e.select(i)}return i})}var jv=x.createContext(void 0),uG=x.createContext(void 0);function Vo(e){const t=x.useContext(e.from?uG:jv);return Zr({select:n=>{const r=n.matches.find(i=>e.from?e.from===i.routeId:i.id===t);if(Es(!((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 BN(e){return Vo({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function UN(e){const{select:t,...n}=e;return Vo({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Nv(e){return Vo({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 kv(e){return Vo({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Qo(e){const t=Vi();return x.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function qN(e){return Vo({...e,select:t=>e.select?e.select(t.context):t.context})}var gc=zL();const dG=pa(gc);function fG(e,t){const n=Vi(),r=IK(t),{activeProps:i,inactiveProps:a,activeOptions:l,to:u,preload:d,preloadDelay:f,hashScrollIntoView:p,replace:m,startTransition:g,resetScroll:v,viewTransition:S,children:b,target:j,disabled:k,style:E,className:C,onClick:A,onBlur:P,onFocus:O,onMouseEnter:_,onMouseLeave:T,onTouchStart:$,ignoreBlocker:F,params:U,search:B,hash:V,state:X,mask:Z,reloadDocument:H,unsafeRelative:J,from:oe,_fromLocation:ye,...I}=e,M=c5(),q=Zr({select:Je=>{const ce=Je.matches[Je.matches.length-1];return{search:ce?.search,hash:Je.location.hash,path:ce?.pathname}},structuralSharing:!0}),D=e.from,G=x.useMemo(()=>({...e,from:D}),[n,q,D,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),se=x.useMemo(()=>n.buildLocation({...G}),[n,G]),ne=se.maskedLocation?se.maskedLocation.publicHref:se.publicHref,Ce=se.maskedLocation?se.maskedLocation.external:se.external,je=x.useMemo(()=>vG(ne,Ce,n.history,k),[k,Ce,ne,n.history]),ee=x.useMemo(()=>{if(je?.external)return Yg(je.href,n.protocolAllowlist)?void 0:je.href;if(!xG(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),Yg(u,n.protocolAllowlist)?void 0:u}catch{}},[u,je,n.protocolAllowlist]),pe=Zr({select:Je=>{if(ee)return!1;if(l?.exact){if(!n7(Je.location.pathname,se.pathname,n.basepath))return!1}else{const ce=Zg(Je.location.pathname,n.basepath),Ne=Zg(se.pathname,n.basepath);if(!(ce.startsWith(Ne)&&(ce.length===Ne.length||ce[Ne.length]==="/")))return!1}return(l?.includeSearch??!0)&&!Hl(Je.location.search,se.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?M&&Je.location.hash===se.hash:!0}}),Ee=pe?zo(i,{})??hG:vw,W=pe?vw:zo(a,{})??vw,He=[C,Ee.className,W.className].filter(Boolean).join(" "),Te=(E||Ee.style||W.style)&&{...E,...Ee.style,...W.style},[st,Ve]=x.useState(!1),Ht=x.useRef(!1),Lt=e.reloadDocument||ee?!1:d??n.options.defaultPreload,un=f??n.options.defaultPreloadDelay??0,tn=x.useCallback(()=>{n.preloadRoute({...G,_builtLocation:se}).catch(Je=>{console.warn(Je),console.warn(J7)})},[n,G,se]);MK(r,x.useCallback(Je=>{Je?.isIntersecting&&tn()},[tn]),yG,{disabled:!!k||Lt!=="viewport"}),x.useEffect(()=>{Ht.current||!k&&Lt==="render"&&(tn(),Ht.current=!0)},[k,tn,Lt]);const Se=Je=>{const ce=Je.currentTarget.getAttribute("target"),Ne=j!==void 0?j:ce;if(!k&&!bG(Je)&&!Je.defaultPrevented&&(!Ne||Ne==="_self")&&Je.button===0){Je.preventDefault(),gc.flushSync(()=>{Ve(!0)});const Me=n.subscribe("onResolved",()=>{Me(),Ve(!1)});n.navigate({...G,replace:m,resetScroll:v,hashScrollIntoView:p,startTransition:g,viewTransition:S,ignoreBlocker:F})}};if(ee)return{...I,ref:r,href:ee,...b&&{children:b},...j&&{target:j},...k&&{disabled:k},...E&&{style:E},...C&&{className:C},...A&&{onClick:A},...P&&{onBlur:P},...O&&{onFocus:O},..._&&{onMouseEnter:_},...T&&{onMouseLeave:T},...$&&{onTouchStart:$}};const Ze=Je=>{if(k||Lt!=="intent")return;if(!un){tn();return}const ce=Je.currentTarget;if(Tf.has(ce))return;const Ne=setTimeout(()=>{Tf.delete(ce),tn()},un);Tf.set(ce,Ne)},Tt=Je=>{k||Lt!=="intent"||tn()},mt=Je=>{if(k||!Lt||!un)return;const ce=Je.currentTarget,Ne=Tf.get(ce);Ne&&(clearTimeout(Ne),Tf.delete(ce))};return{...I,...Ee,...W,href:je?.href,ref:r,onClick:lu([A,Se]),onBlur:lu([P,mt]),onFocus:lu([O,Ze]),onMouseEnter:lu([_,Ze]),onMouseLeave:lu([T,mt]),onTouchStart:lu([$,Tt]),disabled:!!k,target:j,...Te&&{style:Te},...He&&{className:He},...k&&pG,...pe&&mG,...M&&st&&gG}}var vw={},hG={className:"active"},pG={role:"link","aria-disabled":!0},mG={"data-status":"active","aria-current":"page"},gG={"data-transitioning":"transitioning"},Tf=new WeakMap,yG={rootMargin:"100px"},lu=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function vG(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function xG(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Zt=x.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,...a}=fG(r,t),l=typeof r.children=="function"?r.children({isActive:a["data-status"]==="active"}):r.children;if(!n){const{disabled:u,...d}=a;return x.createElement("a",d,l)}return x.createElement(n,a,l)});function bG(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var wG=class extends l5{constructor(e){super(e),this.useMatch=t=>Vo({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>qN({...t,from:this.id}),this.useSearch=t=>kv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Nv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>UN({...t,from:this.id}),this.useLoaderData=t=>BN({...t,from:this.id}),this.useNavigate=()=>Qo({from:this.fullPath}),this.Link=Ii.forwardRef((t,n)=>o.jsx(Zt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function ei(e){return new wG(e)}function SG(){return e=>NG(e)}var jG=class extends eG{constructor(e){super(e),this.useMatch=t=>Vo({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>qN({...t,from:this.id}),this.useSearch=t=>kv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Nv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>UN({...t,from:this.id}),this.useLoaderData=t=>BN({...t,from:this.id}),this.useNavigate=()=>Qo({from:this.fullPath}),this.Link=Ii.forwardRef((t,n)=>o.jsx(Zt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function NG(e){return new jG(e)}function d2(e){return typeof e=="object"?new f2(e,{silent:!0}).createRoute(e):new f2(e,{silent:!0}).createRoute}var f2=class{constructor(e,t){this.path=e,this.createRoute=n=>{const r=ei(n);return r.isRoot=!1,r},this.silent=t?.silent}},h2=class{constructor(e){this.useMatch=t=>Vo({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>qN({...t,from:this.options.id}),this.useSearch=t=>kv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>Nv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>UN({...t,from:this.options.id}),this.useLoaderData=t=>BN({...t,from:this.options.id}),this.useNavigate=()=>Qo({from:Vi().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function p2(e){return typeof e=="object"?new h2(e):t=>new h2({id:e,...t})}function kG(e){const t=Zr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return o.jsx(LN,{getResetKey:()=>t,onCatch:(n,r)=>{if(Rr(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(Rr(n))return e.fallback?.(n);throw n},children:e.children})}function CG(){return o.jsx("p",{children:"Not Found"})}function ku(e){return o.jsx(o.Fragment,{children:e.children})}function f5(e,t,n){return t.options.notFoundComponent?o.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?o.jsx(e.options.defaultNotFoundComponent,{...n}):o.jsx(CG,{})}function AG(){return Vi().isScrollRestoring,null}var h5=x.memo(function({matchId:t}){const n=Vi(),r=Zr({select:S=>{const b=S.matches.findIndex(k=>k.id===t),j=S.matches[b];return Es(j),{routeId:j.routeId,ssr:j.ssr,_displayPending:j._displayPending,resetKey:S.loadedAt,parentRouteId:S.matches[b-1]?.routeId}},structuralSharing:!0}),i=n.routesById[r.routeId],a=i.options.pendingComponent??n.options.defaultPendingComponent,l=a?o.jsx(a,{}):null,u=i.options.errorComponent??n.options.defaultErrorComponent,d=i.options.onCatch??n.options.defaultOnCatch,f=i.isRoot?i.options.notFoundComponent??n.options.notFoundRoute?.options.component:i.options.notFoundComponent,p=r.ssr===!1||r.ssr==="data-only",m=(!i.isRoot||i.options.wrapInSuspense||p)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||p))?x.Suspense:ku,g=u?LN:ku,v=f?kG:ku;return o.jsxs(i.isRoot?i.options.shellComponent??ku:ku,{children:[o.jsx(jv.Provider,{value:t,children:o.jsx(m,{fallback:l,children:o.jsx(g,{getResetKey:()=>r.resetKey,errorComponent:u||$N,onCatch:(S,b)=>{if(Rr(S))throw S;d?.(S,b)},children:o.jsx(v,{fallback:S=>{if(!f||S.routeId&&S.routeId!==r.routeId||!S.routeId&&!i.isRoot)throw S;return x.createElement(f,S)},children:p||r._displayPending?o.jsx(nG,{fallback:l,children:o.jsx(m2,{matchId:t})}):o.jsx(m2,{matchId:t})})})})}),r.parentRouteId===Kl&&n.options.scrollRestoration?o.jsxs(o.Fragment,{children:[o.jsx(OG,{}),o.jsx(AG,{})]}):null]})});function OG(){const e=Vi(),t=x.useRef(void 0);return o.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Vl(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var m2=x.memo(function({matchId:t}){const n=Vi(),{match:r,key:i,routeId:a}=Zr({select:d=>{const f=d.matches.find(g=>g.id===t),p=f.routeId,m=(n.routesById[p].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:p,loaderDeps:f.loaderDeps,params:f._strictParams,search:f._strictSearch});return{key:m?JSON.stringify(m):void 0,routeId:p,match:{id:f.id,status:f.status,error:f.error,_forcePending:f._forcePending,_displayPending:f._displayPending}}},structuralSharing:!0}),l=n.routesById[a],u=x.useMemo(()=>{const d=l.options.component??n.options.defaultComponent;return d?o.jsx(d,{},i):o.jsx(FN,{})},[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 d=l.options.pendingMinMs??n.options.defaultPendingMinMs;if(d){const f=n.getMatch(r.id);if(f&&!f._nonReactive.minPendingPromise){const p=Qu();f._nonReactive.minPendingPromise=p,setTimeout(()=>{p.resolve(),f._nonReactive.minPendingPromise=void 0},d)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return Es(Rr(r.error)),f5(n,l,r.error);if(r.status==="redirected")throw Es(Vr(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return u}),FN=x.memo(function(){const t=Vi(),n=x.useContext(jv),r=Zr({select:f=>f.matches.find(p=>p.id===n)?.routeId}),i=t.routesById[r],a=Zr({select:f=>{const p=f.matches.find(m=>m.id===n);return Es(p),p.globalNotFound}}),l=Zr({select:f=>{const p=f.matches;return p[p.findIndex(m=>m.id===n)+1]?.id}}),u=t.options.defaultPendingComponent?o.jsx(t.options.defaultPendingComponent,{}):null;if(a)return f5(t,i,void 0);if(!l)return null;const d=o.jsx(h5,{matchId:l});return r===Kl?o.jsx(x.Suspense,{fallback:u,children:d}):d});function EG(){const e=Vi(),t=x.useRef({router:e,mounted:!1}),[n,r]=x.useState(!1),{hasPendingMatches:i,isLoading:a}=Zr({select:m=>({isLoading:m.isLoading,hasPendingMatches:m.matches.some(g=>g.status==="pending")}),structuralSharing:!0}),l=lw(a),u=a||n||i,d=lw(u),f=a||i,p=lw(f);return e.startTransition=m=>{r(!0),x.startTransition(()=>{m(),r(!1)})},x.useEffect(()=>{const m=e.history.subscribe(e.load),g=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Mo(e.latestLocation.publicHref)!==Mo(g.publicHref)&&e.commitLocation({...g,replace:!0}),()=>{m()}},[e,e.history]),$m(()=>{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(g){console.error(g)}})()},[e]),$m(()=>{l&&!a&&e.emit({type:"onLoad",...Vl(e.state)})},[l,e,a]),$m(()=>{p&&!f&&e.emit({type:"onBeforeRouteMount",...Vl(e.state)})},[f,p,e]),$m(()=>{if(d&&!u){const m=Vl(e.state);e.emit({type:"onResolved",...m}),e.__store.setState(g=>({...g,status:"idle",resolvedLocation:g.location})),m.hrefChanged&&f7(e)}},[u,d,e]),null}function _G(){const e=Vi(),t=e.routesById[Kl].options.pendingComponent??e.options.defaultPendingComponent,n=t?o.jsx(t,{}):null,r=o.jsxs(typeof document<"u"&&e.ssr?ku:x.Suspense,{fallback:n,children:[o.jsx(EG,{}),o.jsx(zG,{})]});return e.options.InnerWrap?o.jsx(e.options.InnerWrap,{children:r}):r}function zG(){const e=Vi(),t=Zr({select:i=>i.matches[0]?.id}),n=Zr({select:i=>i.loadedAt}),r=t?o.jsx(h5,{matchId:t}):null;return o.jsx(jv.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:o.jsx(LN,{getResetKey:()=>n,errorComponent:$N,onCatch:void 0,children:r})})}var PG=e=>new TG(e),TG=class extends G7{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=d2,globalThis.createLazyFileRoute=p2):typeof window<"u"&&(window.createFileRoute=d2,window.createLazyFileRoute=p2);function RG({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=o.jsx(u5.Provider,{value:e,children:t});return e.options.Wrap?o.jsx(e.options.Wrap,{children:r}):r}function DG({router:e,...t}){return o.jsx(RG,{router:e,...t,children:o.jsx(_G,{})})}function p5(e){return Zr({select:t=>t.location})}class Jr extends Error{code;statusCode;constructor(t,n,r){super(t),this.name="ApiError",this.code=r??"UNKNOWN",this.statusCode=n}}function MG(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const m5=MG();function IG(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):""}function LG(e){return`${IG()}${e}`}function $G(e,t){if(t===404)return"Health endpoint returned 404. Check basePath or reverse-proxy configuration and make sure the dashboard reaches /health instead of an API-prefixed route."}function BG(){return""}function g2(){return!!BG()}async function _e(e,t){const n=t?.body!=null,r=await fetch(`${m5}${e}`,{...t,credentials:t?.credentials??"same-origin",headers:{...n?{"Content-Type":"application/json"}:{},...t?.headers}});if(!r.ok){const i=await r.text();let a=`API ${r.status}: ${r.statusText}`,l;if(i)try{const u=JSON.parse(i);typeof u.error=="string"?a=u.error:u.error?.message?(a=u.error.message,l=u.error.code):u.message&&(a=u.message)}catch{a=i}throw new Jr(a,r.status,l)}if(r.status!==204)return r.json()}function HN(){return _e("/projects")}function g5(e){return _e(`/projects/${encodeURIComponent(e)}`)}function y5(){return _e("/runs")}function UG(e){return _e(`/projects/${encodeURIComponent(e)}/runs`)}function ec(e){return _e(`/runs/${encodeURIComponent(e)}`)}function qG(e){return _e(`/projects/${encodeURIComponent(e)}/queries`)}function v5(e){return _e(`/projects/${encodeURIComponent(e)}/competitors`)}function x5(e,t){const n=new URLSearchParams;t!==void 0&&n.set("location",t);const r=n.toString();return _e(`/projects/${encodeURIComponent(e)}/timeline${r?`?${r}`:""}`)}function FG(e,t){const r=new URLSearchParams().toString();return _e(`/projects/${encodeURIComponent(e)}/overview${r?`?${r}`:""}`)}function Cv(e,t){return _e(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function HG(e,t){return _e(`/projects/${encodeURIComponent(e)}/queries`,{method:"PUT",body:JSON.stringify({queries:t})})}function KG(e,t){return _e(`/projects/${encodeURIComponent(e)}/queries`,{method:"POST",body:JSON.stringify({queries:t})})}function b5(e,t){return _e(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function y2(e,t){const n=await g5(e);return Cv(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 GG(e,t){const n=await g5(e);return Cv(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 VG(e,t){const n={};return t?.location&&(n.location=t.location),t?.allLocations&&(n.allLocations=!0),t?.noLocation&&(n.noLocation=!0),_e(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(n)})}function QG(e,t){return _e(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function YG(e,t){await _e(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function WG(e,t){return _e(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function ZG(e){await _e(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function XG(e){return _e(`/projects/${encodeURIComponent(e)}/export`)}function KN(){return _e("/settings")}function JG(){return _e("/session")}function eV(e){return _e("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function tV(e){return _e("/session",{method:"POST",body:JSON.stringify({password:e})})}function nV(e,t){return _e(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function rV(e){return _e("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function iV(e){try{return await _e(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof Jr&&t.statusCode===404)return null;throw t}}function v2(e,t){return _e(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function aV(e){await _e(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function sV(e){return _e(`/projects/${encodeURIComponent(e)}/notifications`)}function oV(e,t){return _e(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function lV(e,t){await _e(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function cV(e,t){return _e(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function uV(e,t,n){return _e(`/projects/${encodeURIComponent(e)}/queries/generate`,{method:"POST",body:JSON.stringify({provider:t,count:n})})}function dV(e){return _e("/apply",{method:"POST",body:JSON.stringify(e)})}function fV(e){return _e("/runs",{method:"POST",body:JSON.stringify(e??{})})}function w5(e){return _e(`/projects/${encodeURIComponent(e)}/google/connections`)}function hV(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function pV(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function mV(e){return _e(`/projects/${encodeURIComponent(e)}/google/properties`)}function gV(e,t,n){return _e(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:n})})}function yV(e,t,n){return _e(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:n})})}function S5(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function vV(e,t){const n=new URLSearchParams;t?.startDate&&n.set("startDate",t.startDate),t?.endDate&&n.set("endDate",t.endDate),t?.window&&t.window!=="all"&&!t.startDate&&n.set("window",t.window),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 _e(`/projects/${encodeURIComponent(e)}/google/gsc/performance${r}`)}function xV(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function bV(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 _e(`/projects/${encodeURIComponent(e)}/google/gsc/inspections${r}`)}function wV(e){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function GN(e){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function SV(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return _e(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${r}`)}function jV(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function NV(e){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function kV(e){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function x2(){return _e("/cdp/status")}function CV(e,t){return _e("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function b2(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function j5(e){return _e(`/projects/${encodeURIComponent(e)}/bing/status`)}function AV(e,t){return _e(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function OV(e){return _e(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function EV(e){return _e(`/projects/${encodeURIComponent(e)}/bing/sites`)}function _V(e,t){return _e(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function VN(e){return _e(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function N5(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return _e(`/projects/${encodeURIComponent(e)}/bing/inspections${r}`)}function k5(e,t){return _e(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function w2(e,t){return _e(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function zV(e){return _e(`/projects/${encodeURIComponent(e)}/bing/performance`)}function PV(e){return _e("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function TV(e){return _e(`/projects/${encodeURIComponent(e)}/report`)}function RV(e){return e?/filename\s*=\s*"?([^";]+)"?/i.exec(e)?.[1]??null:null}async function DV(e,t="agency"){const n=new URLSearchParams({audience:t}),r=await fetch(`${m5}/projects/${encodeURIComponent(e)}/report.html?${n.toString()}`,{credentials:"same-origin",headers:{}});if(!r.ok)throw new Jr(`Failed to download report: ${r.status}`,r.status);const i=await r.blob(),a=URL.createObjectURL(i),l=RV(r.headers.get("Content-Disposition"))??`canonry-report-${e}.html`,u=document.createElement("a");u.href=a,u.download=l,document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(a)}function MV(e){return _e(`/projects/${encodeURIComponent(e)}/ga/status`)}function IV(e,t,n){const r=new URLSearchParams;n&&n!=="all"&&r.set("window",n);const i=r.toString()?`?${r}`:"";return _e(`/projects/${encodeURIComponent(e)}/ga/traffic${i}`)}function C5(e,t){return _e(`/projects/${encodeURIComponent(e)}/ga/sync`,{method:"POST",body:JSON.stringify({})})}function LV(e,t){return _e(`/projects/${encodeURIComponent(e)}/ga/connect`,{method:"POST",body:JSON.stringify(t)})}function $V(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return _e(`/projects/${encodeURIComponent(e)}/ga/ai-referral-history${n}`)}function BV(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return _e(`/projects/${encodeURIComponent(e)}/ga/social-referral-history${n}`)}function UV(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return _e(`/projects/${encodeURIComponent(e)}/ga/session-history${n}`)}function qV(e){return _e(`/projects/${encodeURIComponent(e)}/ga/disconnect`,{method:"DELETE",body:"{}"})}function FV(e,t){const n=t?`?runId=${encodeURIComponent(t)}`:"";return _e(`/projects/${encodeURIComponent(e)}/insights${n}`)}function HV(e){return _e(`/projects/${encodeURIComponent(e)}/citations/visibility`)}async function KV(e,t){const n=LG(e);try{const r=await fetch(n,{credentials:"same-origin"});if(!r.ok)return{label:t,state:"error",detail:`${t} ${r.status}: ${r.statusText}`,statusCode:r.status,hint:$G(e,r.status)};const i=await r.json(),a=typeof i.version=="string"?i.version:"unknown",l=typeof i.databaseUrlConfigured=="boolean"?i.databaseUrlConfigured:void 0,u=typeof i.lastHeartbeatAt=="string"?i.lastHeartbeatAt:void 0,d=[a,l===!1?"database not configured":"database configured",u?`heartbeat ${u}`:void 0].filter(Boolean).join(" · ");return{label:t,state:"ok",detail:d,version:a,databaseConfigured:l,lastHeartbeatAt:u}}catch(r){return{label:t,state:"error",detail:r instanceof Error?r.message:"unreachable",hint:e==="/health"?`Request failed while checking ${n}. If this instance is served behind a sub-path, verify the dashboard basePath and reverse-proxy rewrites.`:void 0}}}function GV(){return _e("/backlinks/status")}function VV(){return _e("/backlinks/install",{method:"POST"})}function A5(){return _e("/backlinks/syncs/latest")}function QV(){return _e("/backlinks/syncs")}function YV(e){return _e("/backlinks/syncs",{method:"POST",body:JSON.stringify(e?{release:e}:{})})}function WV(){return _e("/backlinks/releases")}function ZV(){return _e("/backlinks/latest-release")}function XV(e){return _e(`/backlinks/cache/${encodeURIComponent(e)}`,{method:"DELETE"})}function JV(e,t={}){const n=new URLSearchParams;t.release&&n.set("release",t.release),t.excludeCrawlers&&n.set("excludeCrawlers","1");const r=n.toString();return _e(`/projects/${encodeURIComponent(e)}/backlinks/summary${r?`?${r}`:""}`)}function eQ(e,t={}){const n=new URLSearchParams;t.limit!==void 0&&n.set("limit",String(t.limit)),t.offset!==void 0&&n.set("offset",String(t.offset)),t.release&&n.set("release",t.release),t.excludeCrawlers&&n.set("excludeCrawlers","1");const r=n.toString();return _e(`/projects/${encodeURIComponent(e)}/backlinks/domains${r?`?${r}`:""}`)}function tQ(e){return _e(`/projects/${encodeURIComponent(e)}/backlinks/history`)}function nQ(e,t){return _e(`/projects/${encodeURIComponent(e)}/backlinks/extract`,{method:"POST",body:JSON.stringify({release:void 0})})}const rQ=6e3,iQ=5,aQ=180;let wr=[],sQ=0;const Hj=new Set,Kj=new Map,Gj=new Map;function ny(){const e=[...wr];for(const t of Hj)t(e)}function QN(e){const t=Kj.get(e);t&&(clearTimeout(t),Kj.delete(e));const n=Gj.get(e);n&&(clearTimeout(n),Gj.delete(e))}function O5(e){QN(e);const t=wr.length;wr=wr.filter(n=>n.id!==e),wr.length!==t&&ny()}function S2(e){QN(e.id),Kj.set(e.id,setTimeout(()=>{Vj(e.id)},e.durationMs))}function oQ(e,t,n){return typeof e=="string"?{title:e,tone:t,durationMs:n}:e}function vt(e,t="negative",n=rQ){const r=oQ(e,t,n),i={id:String(++sQ),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 a=wr.find(l=>l.dedupeKey===r.dedupeKey);if(a){if((r.dedupeMode??"drop")==="drop")return a.id;const l={...a,title:i.title,detail:i.detail,tone:i.tone,durationMs:i.durationMs,cta:i.cta,state:"open"};return wr=wr.map(u=>u.id===a.id?l:u),ny(),S2(l),a.id}}return wr.length>=iQ&&O5(wr[0].id),wr=[...wr,i],ny(),S2(i),i.id}function Vj(e){const t=wr.find(n=>n.id===e);!t||t.state==="closing"||(QN(e),wr=wr.map(n=>n.id===e?{...n,state:"closing"}:n),ny(),Gj.set(e,setTimeout(()=>{O5(e)},aQ)))}function lQ(e){return Hj.add(e),()=>{Hj.delete(e)}}function j2(){return wr}const cQ=5*6e4,E5=30*6e4,Rf=3e4,Sr=6e4,Qj=3e4;function uQ(){return new EK({defaultOptions:{queries:{staleTime:cQ,retry:1,refetchOnWindowFocus:!1}},mutationCache:new $L({onError:(e,t,n,r)=>{r.meta?.skipGlobalErrorToast||vt({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const dQ=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),fQ=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),N2=e=>{const t=fQ(e);return t.charAt(0).toUpperCase()+t.slice(1)},_5=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),hQ=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var pQ={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 mQ=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:l,...u},d)=>x.createElement("svg",{ref:d,...pQ,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:_5("lucide",i),...!a&&!hQ(u)&&{"aria-hidden":"true"},...u},[...l.map(([f,p])=>x.createElement(f,p)),...Array.isArray(a)?a:[a]]));const Nt=(e,t)=>{const n=x.forwardRef(({className:r,...i},a)=>x.createElement(mQ,{ref:a,iconNode:t,className:_5(`lucide-${dQ(N2(e))}`,`lucide-${e}`,r),...i}));return n.displayName=N2(e),n};const gQ=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],yQ=Nt("arrow-up",gQ);const vQ=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],xQ=Nt("book-open",vQ);const bQ=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],z5=Nt("check",bQ);const wQ=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],SQ=Nt("chevron-down",wQ);const jQ=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Kh=Nt("chevron-right",jQ);const NQ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],kQ=Nt("circle-alert",NQ);const CQ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],P5=Nt("circle-check",CQ);const AQ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],T5=Nt("circle-question-mark",AQ);const OQ=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],EQ=Nt("copy",OQ);const _Q=[["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"}]],Av=Nt("download",_Q);const zQ=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],PQ=Nt("external-link",zQ);const TQ=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],RQ=Nt("file-text",TQ);const DQ=[["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"}]],MQ=Nt("github",DQ);const IQ=[["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"}]],LQ=Nt("globe",IQ);const $Q=[["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"}]],BQ=Nt("layout-dashboard",$Q);const UQ=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],R5=Nt("link-2",UQ);const qQ=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],D5=Nt("loader-circle",qQ);const FQ=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],HQ=Nt("maximize-2",FQ);const KQ=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],GQ=Nt("menu",KQ);const VQ=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],QQ=Nt("minimize-2",VQ);const YQ=[["path",{d:"M5 12h14",key:"1ays0h"}]],WQ=Nt("minus",YQ);const ZQ=[["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"}]],ry=Nt("play",ZQ);const XQ=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],k2=Nt("plus",XQ);const JQ=[["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"}]],C2=Nt("refresh-cw",JQ);const eY=[["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"}]],tY=Nt("rocket",eY);const nY=[["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"}]],M5=Nt("rotate-ccw",nY);const rY=[["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"}]],iY=Nt("settings",rY);const aY=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],A2=Nt("sparkles",aY);const sY=[["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"}]],I5=Nt("trash-2",sY);const oY=[["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"}]],iy=Nt("triangle-alert",oY);const lY=[["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"}]],cY=Nt("unplug",lY);const uY=[["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"}]],dY=Nt("upload",uY);const fY=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],hY=Nt("wrench",fY);const pY=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Gh=Nt("x",pY);function ve(e,t,n){function r(u,d){if(u._zod||Object.defineProperty(u,"_zod",{value:{def:d,constr:l,traits:new Set},enumerable:!1}),u._zod.traits.has(e))return;u._zod.traits.add(e),t(u,d);const f=l.prototype,p=Object.keys(f);for(let m=0;m<p.length;m++){const g=p[m];g in u||(u[g]=f[g].bind(u))}}const i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function l(u){var d;const f=n?.Parent?new a:this;r(f,u),(d=f._zod).deferred??(d.deferred=[]);for(const p of f._zod.deferred)p();return f}return Object.defineProperty(l,"init",{value:r}),Object.defineProperty(l,Symbol.hasInstance,{value:u=>n?.Parent&&u instanceof n.Parent?!0:u?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}class Iu extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class L5 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const $5={};function qo(e){return $5}function B5(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 Yj(e,t){return typeof t=="bigint"?t.toString():t}function Ov(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function YN(e){return e==null}function WN(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function mY(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 d=r.match(/\d?e-(\d?)/);d?.[1]&&(i=Number.parseInt(d[1]))}const a=n>i?n:i,l=Number.parseInt(e.toFixed(a).replace(".","")),u=Number.parseInt(t.toFixed(a).replace(".",""));return l%u/10**a}const O2=Symbol("evaluating");function Rt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==O2)return r===void 0&&(r=O2,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function yc(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Yo(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function E2(e){return JSON.stringify(e)}function gY(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const U5="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function wh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const yY=Ov(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Yu(e){if(wh(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(wh(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function q5(e){return Yu(e)?{...e}:Array.isArray(e)?[...e]:e}const vY=new Set(["string","number","symbol"]);function Wu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Wo(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Fe(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 xY(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const bY={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 wY(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 a=Yo(e._zod.def,{get shape(){const l={};for(const u in t){if(!(u in n.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(l[u]=n.shape[u])}return yc(this,"shape",l),l},checks:[]});return Wo(e,a)}function SY(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 a=Yo(e._zod.def,{get shape(){const l={...e._zod.def.shape};for(const u in t){if(!(u in n.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&delete l[u]}return yc(this,"shape",l),l},checks:[]});return Wo(e,a)}function jY(e,t){if(!Yu(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const a=e._zod.def.shape;for(const l in t)if(Object.getOwnPropertyDescriptor(a,l)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=Yo(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return yc(this,"shape",a),a}});return Wo(e,i)}function NY(e,t){if(!Yu(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Yo(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return yc(this,"shape",r),r}});return Wo(e,n)}function kY(e,t){const n=Yo(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return yc(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Wo(e,n)}function CY(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=Yo(t._zod.def,{get shape(){const u=t._zod.def.shape,d={...u};if(n)for(const f in n){if(!(f in u))throw new Error(`Unrecognized key: "${f}"`);n[f]&&(d[f]=e?new e({type:"optional",innerType:u[f]}):u[f])}else for(const f in u)d[f]=e?new e({type:"optional",innerType:u[f]}):u[f];return yc(this,"shape",d),d},checks:[]});return Wo(t,l)}function AY(e,t,n){const r=Yo(t._zod.def,{get shape(){const i=t._zod.def.shape,a={...i};if(n)for(const l in n){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(a[l]=new e({type:"nonoptional",innerType:i[l]}))}else for(const l in i)a[l]=new e({type:"nonoptional",innerType:i[l]});return yc(this,"shape",a),a}});return Wo(t,r)}function Au(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 Ou(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function qm(e){return typeof e=="string"?e:e?.message}function Fo(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=qm(e.inst?._zod.def?.error?.(e))??qm(t?.error?.(e))??qm(n.customError?.(e))??qm(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function ZN(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Sh(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const F5=(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,Yj,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},H5=ve("$ZodError",F5),K5=ve("$ZodError",F5,{Parent:Error});function OY(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 EY(e,t=n=>n.message){const n={_errors:[]},r=i=>{for(const a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(l=>r({issues:l}));else if(a.code==="invalid_key")r({issues:a.issues});else if(a.code==="invalid_element")r({issues:a.issues});else if(a.path.length===0)n._errors.push(t(a));else{let l=n,u=0;for(;u<a.path.length;){const d=a.path[u];u===a.path.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(t(a))):l[d]=l[d]||{_errors:[]},l=l[d],u++}}};return r(e),n}const XN=e=>(t,n,r,i)=>{const a=r?Object.assign(r,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},a);if(l instanceof Promise)throw new Iu;if(l.issues.length){const u=new(i?.Err??e)(l.issues.map(d=>Fo(d,a,qo())));throw U5(u,i?.callee),u}return l.value},JN=e=>async(t,n,r,i)=>{const a=r?Object.assign(r,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},a);if(l instanceof Promise&&(l=await l),l.issues.length){const u=new(i?.Err??e)(l.issues.map(d=>Fo(d,a,qo())));throw U5(u,i?.callee),u}return l.value},Ev=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Iu;return a.issues.length?{success:!1,error:new(e??H5)(a.issues.map(l=>Fo(l,i,qo())))}:{success:!0,data:a.value}},_Y=Ev(K5),_v=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(l=>Fo(l,i,qo())))}:{success:!0,data:a.value}},zY=_v(K5),PY=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return XN(e)(t,n,i)},TY=e=>(t,n,r)=>XN(e)(t,n,r),RY=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return JN(e)(t,n,i)},DY=e=>async(t,n,r)=>JN(e)(t,n,r),MY=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ev(e)(t,n,i)},IY=e=>(t,n,r)=>Ev(e)(t,n,r),LY=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return _v(e)(t,n,i)},$Y=e=>async(t,n,r)=>_v(e)(t,n,r),BY=/^[cC][^\s-]{8,}$/,UY=/^[0-9a-z]+$/,qY=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,FY=/^[0-9a-vA-V]{20}$/,HY=/^[A-Za-z0-9]{27}$/,KY=/^[a-zA-Z0-9_-]{21}$/,GY=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,VY=/^([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})$/,_2=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)$/,QY=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,YY="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function WY(){return new RegExp(YY,"u")}const ZY=/^(?:(?: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])$/,XY=/^(([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}|:))$/,JY=/^((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])$/,eW=/^(([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])$/,tW=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,G5=/^[A-Za-z0-9_-]*$/,nW=/^\+[1-9]\d{6,14}$/,V5="(?:(?:\\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])))",rW=new RegExp(`^${V5}$`);function Q5(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 iW(e){return new RegExp(`^${Q5(e)}$`)}function aW(e){const t=Q5({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(`^${V5}T(?:${r})$`)}const sW=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},oW=/^-?\d+$/,Y5=/^-?\d+(?:\.\d+)?$/,lW=/^(?:true|false)$/i,cW=/^[^A-Z]*$/,uW=/^[^a-z]*$/,ti=ve("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),W5={number:"number",bigint:"bigint",object:"date"},Z5=ve("$ZodCheckLessThan",(e,t)=>{ti.init(e,t);const n=W5[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,a=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(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})}}),X5=ve("$ZodCheckGreaterThan",(e,t)=>{ti.init(e,t);const n=W5[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,a=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(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})}}),dW=ve("$ZodCheckMultipleOf",(e,t)=>{ti.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):mY(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})}}),fW=ve("$ZodCheckNumberFormat",(e,t)=>{ti.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,a]=bY[t.format];e._zod.onattach.push(l=>{const u=l._zod.bag;u.format=t.format,u.minimum=i,u.maximum=a,n&&(u.pattern=oW)}),e._zod.check=l=>{const u=l.value;if(n){if(!Number.isInteger(u)){l.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?l.issues.push({input:u,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:u,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}}u<i&&l.issues.push({origin:"number",input:u,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),u>a&&l.issues.push({origin:"number",input:u,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),hW=ve("$ZodCheckMaxLength",(e,t)=>{var n;ti.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!YN(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=ZN(i);r.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),pW=ve("$ZodCheckMinLength",(e,t)=>{var n;ti.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!YN(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=ZN(i);r.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),mW=ve("$ZodCheckLengthEquals",(e,t)=>{var n;ti.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!YN(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,a=i.length;if(a===t.length)return;const l=ZN(i),u=a>t.length;r.issues.push({origin:l,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),zv=ve("$ZodCheckStringFormat",(e,t)=>{var n,r;ti.init(e,t),e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.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=()=>{})}),gW=ve("$ZodCheckRegex",(e,t)=>{zv.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})}}),yW=ve("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=cW),zv.init(e,t)}),vW=ve("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=uW),zv.init(e,t)}),xW=ve("$ZodCheckIncludes",(e,t)=>{ti.init(e,t);const n=Wu(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(i=>{const a=i._zod.bag;a.patterns??(a.patterns=new Set),a.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})}}),bW=ve("$ZodCheckStartsWith",(e,t)=>{ti.init(e,t);const n=new RegExp(`^${Wu(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})}}),wW=ve("$ZodCheckEndsWith",(e,t)=>{ti.init(e,t);const n=new RegExp(`.*${Wu(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})}}),SW=ve("$ZodCheckOverwrite",(e,t)=>{ti.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class jW{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(`
|
|
10
|
-
`).filter(l=>l),i=Math.min(...r.map(l=>l.length-l.trimStart().length)),a=r.map(l=>l.slice(i)).map(l=>" ".repeat(this.indent*2)+l);for(const l of a)this.content.push(l)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(a=>` ${a}`)];return new t(...n,i.join(`
|
|
11
|
-
`))}}const NW={major:4,minor:3,patch:6},xn=ve("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=NW;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const a of i._zod.onattach)a(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,u,d)=>{let f=Au(l),p;for(const m of u){if(m._zod.def.when){if(!m._zod.def.when(l))continue}else if(f)continue;const g=l.issues.length,v=m._zod.check(l);if(v instanceof Promise&&d?.async===!1)throw new Iu;if(p||v instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await v,l.issues.length!==g&&(f||(f=Au(l,g)))});else{if(l.issues.length===g)continue;f||(f=Au(l,g))}}return p?p.then(()=>l):l},a=(l,u,d)=>{if(Au(l))return l.aborted=!0,l;const f=i(u,r,d);if(f instanceof Promise){if(d.async===!1)throw new Iu;return f.then(p=>e._zod.parse(p,d))}return e._zod.parse(f,d)};e._zod.run=(l,u)=>{if(u.skipChecks)return e._zod.parse(l,u);if(u.direction==="backward"){const f=e._zod.parse({value:l.value,issues:[]},{...u,skipChecks:!0});return f instanceof Promise?f.then(p=>a(p,l,u)):a(f,l,u)}const d=e._zod.parse(l,u);if(d instanceof Promise){if(u.async===!1)throw new Iu;return d.then(f=>i(f,r,u))}return i(d,r,u)}}Rt(e,"~standard",()=>({validate:i=>{try{const a=_Y(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return zY(e,i).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),ek=ve("$ZodString",(e,t)=>{xn.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??sW(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}}),pn=ve("$ZodStringFormat",(e,t)=>{zv.init(e,t),ek.init(e,t)}),kW=ve("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=VY),pn.init(e,t)}),CW=ve("$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=_2(r))}else t.pattern??(t.pattern=_2());pn.init(e,t)}),AW=ve("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=QY),pn.init(e,t)}),OW=ve("$ZodURL",(e,t)=>{pn.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})}}}),EW=ve("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=WY()),pn.init(e,t)}),_W=ve("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=KY),pn.init(e,t)}),zW=ve("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=BY),pn.init(e,t)}),PW=ve("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=UY),pn.init(e,t)}),TW=ve("$ZodULID",(e,t)=>{t.pattern??(t.pattern=qY),pn.init(e,t)}),RW=ve("$ZodXID",(e,t)=>{t.pattern??(t.pattern=FY),pn.init(e,t)}),DW=ve("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=HY),pn.init(e,t)}),MW=ve("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=aW(t)),pn.init(e,t)}),IW=ve("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=rW),pn.init(e,t)}),LW=ve("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=iW(t)),pn.init(e,t)}),$W=ve("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=GY),pn.init(e,t)}),BW=ve("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ZY),pn.init(e,t),e._zod.bag.format="ipv4"}),UW=ve("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=XY),pn.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})}}}),qW=ve("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=JY),pn.init(e,t)}),FW=ve("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=eW),pn.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[i,a]=r;if(!a)throw new Error;const l=Number(a);if(`${l}`!==a)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 J5(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const HW=ve("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=tW),pn.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{J5(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function KW(e){if(!G5.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return J5(n)}const GW=ve("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=G5),pn.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{KW(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),VW=ve("$ZodE164",(e,t)=>{t.pattern??(t.pattern=nW),pn.init(e,t)});function QW(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 YW=ve("$ZodJWT",(e,t)=>{pn.init(e,t),e._zod.check=n=>{QW(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),e$=ve("$ZodNumber",(e,t)=>{xn.init(e,t),e._zod.pattern=e._zod.bag.pattern??Y5,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 a=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,...a?{received:a}:{}}),n}}),WW=ve("$ZodNumberFormat",(e,t)=>{fW.init(e,t),e$.init(e,t)}),ZW=ve("$ZodBoolean",(e,t)=>{xn.init(e,t),e._zod.pattern=lW,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}}),XW=ve("$ZodUnknown",(e,t)=>{xn.init(e,t),e._zod.parse=n=>n}),JW=ve("$ZodNever",(e,t)=>{xn.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function z2(e,t,n){e.issues.length&&t.issues.push(...Ou(n,e.issues)),t.value[n]=e.value}const eZ=ve("$ZodArray",(e,t)=>{xn.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 a=[];for(let l=0;l<i.length;l++){const u=i[l],d=t.element._zod.run({value:u,issues:[]},r);d instanceof Promise?a.push(d.then(f=>z2(f,n,l))):z2(d,n,l)}return a.length?Promise.all(a).then(()=>n):n}});function ay(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...Ou(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function t$(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=xY(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function n$(e,t,n,r,i,a){const l=[],u=i.keySet,d=i.catchall._zod,f=d.def.type,p=d.optout==="optional";for(const m in t){if(u.has(m))continue;if(f==="never"){l.push(m);continue}const g=d.run({value:t[m],issues:[]},r);g instanceof Promise?e.push(g.then(v=>ay(v,n,m,t,p))):ay(g,n,m,t,p)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const tZ=ve("$ZodObject",(e,t)=>{if(xn.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const u=t.shape;Object.defineProperty(t,"shape",{get:()=>{const d={...u};return Object.defineProperty(t,"shape",{value:d}),d}})}const r=Ov(()=>t$(t));Rt(e._zod,"propValues",()=>{const u=t.shape,d={};for(const f in u){const p=u[f]._zod;if(p.values){d[f]??(d[f]=new Set);for(const m of p.values)d[f].add(m)}}return d});const i=wh,a=t.catchall;let l;e._zod.parse=(u,d)=>{l??(l=r.value);const f=u.value;if(!i(f))return u.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),u;u.value={};const p=[],m=l.shape;for(const g of l.keys){const v=m[g],S=v._zod.optout==="optional",b=v._zod.run({value:f[g],issues:[]},d);b instanceof Promise?p.push(b.then(j=>ay(j,u,g,f,S))):ay(b,u,g,f,S)}return a?n$(p,f,u,d,r.value,e):p.length?Promise.all(p).then(()=>u):u}}),nZ=ve("$ZodObjectJIT",(e,t)=>{tZ.init(e,t);const n=e._zod.parse,r=Ov(()=>t$(t)),i=g=>{const v=new jW(["shape","payload","ctx"]),S=r.value,b=C=>{const A=E2(C);return`shape[${A}]._zod.run({ value: input[${A}], issues: [] }, ctx)`};v.write("const input = payload.value;");const j=Object.create(null);let k=0;for(const C of S.keys)j[C]=`key_${k++}`;v.write("const newResult = {};");for(const C of S.keys){const A=j[C],P=E2(C),_=g[C]?._zod?.optout==="optional";v.write(`const ${A} = ${b(C)};`),_?v.write(`
|
|
12
|
-
if (${A}.issues.length) {
|
|
13
|
-
if (${P} in input) {
|
|
14
|
-
payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
|
|
15
|
-
...iss,
|
|
16
|
-
path: iss.path ? [${P}, ...iss.path] : [${P}]
|
|
17
|
-
})));
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (${A}.value === undefined) {
|
|
22
|
-
if (${P} in input) {
|
|
23
|
-
newResult[${P}] = undefined;
|
|
24
|
-
}
|
|
25
|
-
} else {
|
|
26
|
-
newResult[${P}] = ${A}.value;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
`):v.write(`
|
|
30
|
-
if (${A}.issues.length) {
|
|
31
|
-
payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
|
|
32
|
-
...iss,
|
|
33
|
-
path: iss.path ? [${P}, ...iss.path] : [${P}]
|
|
34
|
-
})));
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (${A}.value === undefined) {
|
|
38
|
-
if (${P} in input) {
|
|
39
|
-
newResult[${P}] = undefined;
|
|
40
|
-
}
|
|
41
|
-
} else {
|
|
42
|
-
newResult[${P}] = ${A}.value;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
`)}v.write("payload.value = newResult;"),v.write("return payload;");const E=v.compile();return(C,A)=>E(g,C,A)};let a;const l=wh,u=!$5.jitless,f=u&&yY.value,p=t.catchall;let m;e._zod.parse=(g,v)=>{m??(m=r.value);const S=g.value;return l(S)?u&&f&&v?.async===!1&&v.jitless!==!0?(a||(a=i(t.shape)),g=a(g,v),p?n$([],S,g,v,m,e):g):n(g,v):(g.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),g)}});function P2(e,t,n,r){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const i=e.filter(a=>!Au(a));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(a=>a.issues.map(l=>Fo(l,r,qo())))}),t)}const r$=ve("$ZodUnion",(e,t)=>{xn.init(e,t),Rt(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Rt(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Rt(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Rt(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(a=>a._zod.pattern);return new RegExp(`^(${i.map(a=>WN(a.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let l=!1;const u=[];for(const d of t.options){const f=d._zod.run({value:i.value,issues:[]},a);if(f instanceof Promise)u.push(f),l=!0;else{if(f.issues.length===0)return f;u.push(f)}}return l?Promise.all(u).then(d=>P2(d,i,e,a)):P2(u,i,e,a)}}),rZ=ve("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,r$.init(e,t);const n=e._zod.parse;Rt(e._zod,"propValues",()=>{const i={};for(const a of t.options){const l=a._zod.propValues;if(!l||Object.keys(l).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const[u,d]of Object.entries(l)){i[u]||(i[u]=new Set);for(const f of d)i[u].add(f)}}return i});const r=Ov(()=>{const i=t.options,a=new Map;for(const l of i){const u=l._zod.propValues?.[t.discriminator];if(!u||u.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(l)}"`);for(const d of u){if(a.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);a.set(d,l)}}return a});e._zod.parse=(i,a)=>{const l=i.value;if(!wh(l))return i.issues.push({code:"invalid_type",expected:"object",input:l,inst:e}),i;const u=r.value.get(l?.[t.discriminator]);return u?u._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:l,path:[t.discriminator],inst:e}),i)}}),iZ=ve("$ZodIntersection",(e,t)=>{xn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,a=t.left._zod.run({value:i,issues:[]},r),l=t.right._zod.run({value:i,issues:[]},r);return a instanceof Promise||l instanceof Promise?Promise.all([a,l]).then(([d,f])=>T2(n,d,f)):T2(n,a,l)}});function Wj(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(Yu(e)&&Yu(t)){const n=Object.keys(t),r=Object.keys(e).filter(a=>n.indexOf(a)!==-1),i={...e,...t};for(const a of r){const l=Wj(e[a],t[a]);if(!l.valid)return{valid:!1,mergeErrorPath:[a,...l.mergeErrorPath]};i[a]=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],a=t[r],l=Wj(i,a);if(!l.valid)return{valid:!1,mergeErrorPath:[r,...l.mergeErrorPath]};n.push(l.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function T2(e,t,n){const r=new Map;let i;for(const u of t.issues)if(u.code==="unrecognized_keys"){i??(i=u);for(const d of u.keys)r.has(d)||r.set(d,{}),r.get(d).l=!0}else e.issues.push(u);for(const u of n.issues)if(u.code==="unrecognized_keys")for(const d of u.keys)r.has(d)||r.set(d,{}),r.get(d).r=!0;else e.issues.push(u);const a=[...r].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length&&i&&e.issues.push({...i,keys:a}),Au(e))return e;const l=Wj(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 aZ=ve("$ZodRecord",(e,t)=>{xn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Yu(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const a=[],l=t.keyType._zod.values;if(l){n.value={};const u=new Set;for(const f of l)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){u.add(typeof f=="number"?f.toString():f);const p=t.valueType._zod.run({value:i[f],issues:[]},r);p instanceof Promise?a.push(p.then(m=>{m.issues.length&&n.issues.push(...Ou(f,m.issues)),n.value[f]=m.value})):(p.issues.length&&n.issues.push(...Ou(f,p.issues)),n.value[f]=p.value)}let d;for(const f in i)u.has(f)||(d=d??[],d.push(f));d&&d.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:d})}else{n.value={};for(const u of Reflect.ownKeys(i)){if(u==="__proto__")continue;let d=t.keyType._zod.run({value:u,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&Y5.test(u)&&d.issues.length){const m=t.keyType._zod.run({value:Number(u),issues:[]},r);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(d=m)}if(d.issues.length){t.mode==="loose"?n.value[u]=i[u]:n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(m=>Fo(m,r,qo())),input:u,path:[u],inst:e});continue}const p=t.valueType._zod.run({value:i[u],issues:[]},r);p instanceof Promise?a.push(p.then(m=>{m.issues.length&&n.issues.push(...Ou(u,m.issues)),n.value[d.value]=m.value})):(p.issues.length&&n.issues.push(...Ou(u,p.issues)),n.value[d.value]=p.value)}}return a.length?Promise.all(a).then(()=>n):n}}),sZ=ve("$ZodEnum",(e,t)=>{xn.init(e,t);const n=B5(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>vY.has(typeof i)).map(i=>typeof i=="string"?Wu(i):i.toString()).join("|")})$`),e._zod.parse=(i,a)=>{const l=i.value;return r.has(l)||i.issues.push({code:"invalid_value",values:n,input:l,inst:e}),i}}),oZ=ve("$ZodLiteral",(e,t)=>{if(xn.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"?Wu(r):r?Wu(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,i)=>{const a=r.value;return n.has(a)||r.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),r}}),lZ=ve("$ZodTransform",(e,t)=>{xn.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new L5(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 Iu;return n.value=i,n}});function R2(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const i$=ve("$ZodOptional",(e,t)=>{xn.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Rt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Rt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${WN(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(a=>R2(a,n.value)):R2(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),cZ=ve("$ZodExactOptional",(e,t)=>{i$.init(e,t),Rt(e._zod,"values",()=>t.innerType._zod.values),Rt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),uZ=ve("$ZodNullable",(e,t)=>{xn.init(e,t),Rt(e._zod,"optin",()=>t.innerType._zod.optin),Rt(e._zod,"optout",()=>t.innerType._zod.optout),Rt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${WN(n.source)}|null)$`):void 0}),Rt(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)}),dZ=ve("$ZodDefault",(e,t)=>{xn.init(e,t),e._zod.optin="optional",Rt(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(a=>D2(a,t)):D2(i,t)}});function D2(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const fZ=ve("$ZodPrefault",(e,t)=>{xn.init(e,t),e._zod.optin="optional",Rt(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))}),hZ=ve("$ZodNonOptional",(e,t)=>{xn.init(e,t),Rt(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(a=>M2(a,e)):M2(i,e)}});function M2(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 pZ=ve("$ZodCatch",(e,t)=>{xn.init(e,t),Rt(e._zod,"optin",()=>t.innerType._zod.optin),Rt(e._zod,"optout",()=>t.innerType._zod.optout),Rt(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(a=>(n.value=a.value,a.issues.length&&(n.value=t.catchValue({...n,error:{issues:a.issues.map(l=>Fo(l,r,qo()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>Fo(a,r,qo()))},input:n.value}),n.issues=[]),n)}}),mZ=ve("$ZodPipe",(e,t)=>{xn.init(e,t),Rt(e._zod,"values",()=>t.in._zod.values),Rt(e._zod,"optin",()=>t.in._zod.optin),Rt(e._zod,"optout",()=>t.out._zod.optout),Rt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const a=t.out._zod.run(n,r);return a instanceof Promise?a.then(l=>Fm(l,t.in,r)):Fm(a,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(a=>Fm(a,t.out,r)):Fm(i,t.out,r)}});function Fm(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const gZ=ve("$ZodReadonly",(e,t)=>{xn.init(e,t),Rt(e._zod,"propValues",()=>t.innerType._zod.propValues),Rt(e._zod,"values",()=>t.innerType._zod.values),Rt(e._zod,"optin",()=>t.innerType?._zod?.optin),Rt(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(I2):I2(i)}});function I2(e){return e.value=Object.freeze(e.value),e}const yZ=ve("$ZodCustom",(e,t)=>{ti.init(e,t),xn.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(a=>L2(a,n,r,e));L2(i,n,r,e)}});function L2(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(Sh(i))}}var $2;class vZ{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 xZ(){return new vZ}($2=globalThis).__zod_globalRegistry??($2.__zod_globalRegistry=xZ());const eh=globalThis.__zod_globalRegistry;function bZ(e,t){return new e({type:"string",...Fe(t)})}function wZ(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Fe(t)})}function B2(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Fe(t)})}function SZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Fe(t)})}function jZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Fe(t)})}function NZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Fe(t)})}function kZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Fe(t)})}function CZ(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Fe(t)})}function AZ(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Fe(t)})}function OZ(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Fe(t)})}function EZ(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Fe(t)})}function _Z(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Fe(t)})}function zZ(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Fe(t)})}function PZ(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Fe(t)})}function TZ(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Fe(t)})}function RZ(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Fe(t)})}function DZ(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Fe(t)})}function MZ(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Fe(t)})}function IZ(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Fe(t)})}function LZ(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Fe(t)})}function $Z(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Fe(t)})}function BZ(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Fe(t)})}function UZ(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Fe(t)})}function qZ(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Fe(t)})}function FZ(e,t){return new e({type:"string",format:"date",check:"string_format",...Fe(t)})}function HZ(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Fe(t)})}function KZ(e,t){return new e({type:"string",format:"duration",check:"string_format",...Fe(t)})}function GZ(e,t){return new e({type:"number",checks:[],...Fe(t)})}function VZ(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Fe(t)})}function QZ(e,t){return new e({type:"boolean",...Fe(t)})}function YZ(e){return new e({type:"unknown"})}function WZ(e,t){return new e({type:"never",...Fe(t)})}function U2(e,t){return new Z5({check:"less_than",...Fe(t),value:e,inclusive:!1})}function xw(e,t){return new Z5({check:"less_than",...Fe(t),value:e,inclusive:!0})}function q2(e,t){return new X5({check:"greater_than",...Fe(t),value:e,inclusive:!1})}function bw(e,t){return new X5({check:"greater_than",...Fe(t),value:e,inclusive:!0})}function F2(e,t){return new dW({check:"multiple_of",...Fe(t),value:e})}function a$(e,t){return new hW({check:"max_length",...Fe(t),maximum:e})}function sy(e,t){return new pW({check:"min_length",...Fe(t),minimum:e})}function s$(e,t){return new mW({check:"length_equals",...Fe(t),length:e})}function ZZ(e,t){return new gW({check:"string_format",format:"regex",...Fe(t),pattern:e})}function XZ(e){return new yW({check:"string_format",format:"lowercase",...Fe(e)})}function JZ(e){return new vW({check:"string_format",format:"uppercase",...Fe(e)})}function eX(e,t){return new xW({check:"string_format",format:"includes",...Fe(t),includes:e})}function tX(e,t){return new bW({check:"string_format",format:"starts_with",...Fe(t),prefix:e})}function nX(e,t){return new wW({check:"string_format",format:"ends_with",...Fe(t),suffix:e})}function yd(e){return new SW({check:"overwrite",tx:e})}function rX(e){return yd(t=>t.normalize(e))}function iX(){return yd(e=>e.trim())}function aX(){return yd(e=>e.toLowerCase())}function sX(){return yd(e=>e.toUpperCase())}function oX(){return yd(e=>gY(e))}function lX(e,t,n){return new e({type:"array",element:t,...Fe(n)})}function cX(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Fe(n)})}function uX(e){const t=dX(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Sh(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(Sh(i))}},e(n.value,n)));return t}function dX(e,t){const n=new ti({check:"custom",...Fe(t)});return n._zod.check=e,n}function o$(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??eh,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 Bn(e,t,n={path:[],schemaPath:[]}){var r;const i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;const l={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,l);const u=e._zod.toJSONSchema?.();if(u)l.schema=u;else{const p={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,p);else{const g=l.schema,v=t.processors[i.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);v(e,t,g,p)}const m=e._zod.parent;m&&(l.ref||(l.ref=m),Bn(m,t,p),t.seen.get(m).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(l.schema,d),t.io==="input"&&_r(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 l$(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 u=e.metadataRegistry.get(l[0])?.id;if(u){const d=r.get(u);if(d&&d!==l[0])throw new Error(`Duplicate schema id "${u}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(u,l[0])}}const i=l=>{const u=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const m=e.external.registry.get(l[0])?.id,g=e.external.uri??(S=>S);if(m)return{ref:g(m)};const v=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=v,{defId:v,ref:`${g("__shared")}#/${u}/${v}`}}if(l[1]===n)return{ref:"#"};const f=`#/${u}/`,p=l[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:f+p}},a=l=>{if(l[1].schema.$ref)return;const u=l[1],{ref:d,defId:f}=i(l);u.def={...u.schema},f&&(u.defId=f);const p=u.schema;for(const m in p)delete p[m];p.$ref=d};if(e.cycles==="throw")for(const l of e.seen.entries()){const u=l[1];if(u.cycle)throw new Error(`Cycle detected: #/${u.cycle?.join("/")}/<root>
|
|
46
|
-
|
|
47
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const u=l[1];if(t===l[0]){a(l);continue}if(e.external){const f=e.external.registry.get(l[0])?.id;if(t!==l[0]&&f){a(l);continue}}if(e.metadataRegistry.get(l[0])?.id){a(l);continue}if(u.cycle){a(l);continue}if(u.count>1&&e.reused==="ref"){a(l);continue}}}function c$(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 u=e.seen.get(l);if(u.ref===null)return;const d=u.def??u.schema,f={...d},p=u.ref;if(u.ref=null,p){r(p);const g=e.seen.get(p),v=g.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(v)):Object.assign(d,v),Object.assign(d,f),l._zod.parent===p)for(const b in d)b==="$ref"||b==="allOf"||b in f||delete d[b];if(v.$ref&&g.def)for(const b in d)b==="$ref"||b==="allOf"||b in g.def&&JSON.stringify(d[b])===JSON.stringify(g.def[b])&&delete d[b]}const m=l._zod.parent;if(m&&m!==p){r(m);const g=e.seen.get(m);if(g?.schema.$ref&&(d.$ref=g.schema.$ref,g.def))for(const v in d)v==="$ref"||v==="allOf"||v in g.def&&JSON.stringify(d[v])===JSON.stringify(g.def[v])&&delete d[v]}e.override({zodSchema:l,jsonSchema:d,path:u.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 a=e.external?.defs??{};for(const l of e.seen.entries()){const u=l[1];u.def&&u.defId&&(a[u.defId]=u.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?i.$defs=a:i.definitions=a);try{const l=JSON.parse(JSON.stringify(i));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:oy(t,"input",e.processors),output:oy(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function _r(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 _r(r.element,n);if(r.type==="set")return _r(r.valueType,n);if(r.type==="lazy")return _r(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 _r(r.innerType,n);if(r.type==="intersection")return _r(r.left,n)||_r(r.right,n);if(r.type==="record"||r.type==="map")return _r(r.keyType,n)||_r(r.valueType,n);if(r.type==="pipe")return _r(r.in,n)||_r(r.out,n);if(r.type==="object"){for(const i in r.shape)if(_r(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(_r(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(_r(i,n))return!0;return!!(r.rest&&_r(r.rest,n))}return!1}const fX=(e,t={})=>n=>{const r=o$({...n,processors:t});return Bn(e,r),l$(r,e),c$(r,e)},oy=(e,t,n={})=>r=>{const{libraryOptions:i,target:a}=r??{},l=o$({...i??{},target:a,io:t,processors:n});return Bn(e,l),l$(l,e),c$(l,e)},hX={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},pX=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:a,maximum:l,format:u,patterns:d,contentEncoding:f}=e._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof l=="number"&&(i.maxLength=l),u&&(i.format=hX[u]??u,i.format===""&&delete i.format,u==="time"&&delete i.format),f&&(i.contentEncoding=f),d&&d.size>0){const p=[...d];p.length===1?i.pattern=p[0].source:p.length>1&&(i.allOf=[...p.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},mX=(e,t,n,r)=>{const i=n,{minimum:a,maximum:l,format:u,multipleOf:d,exclusiveMaximum:f,exclusiveMinimum:p}=e._zod.bag;typeof u=="string"&&u.includes("int")?i.type="integer":i.type="number",typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=p,i.exclusiveMinimum=!0):i.exclusiveMinimum=p),typeof a=="number"&&(i.minimum=a,typeof p=="number"&&t.target!=="draft-04"&&(p>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof f=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=f,i.exclusiveMaximum=!0):i.exclusiveMaximum=f),typeof l=="number"&&(i.maximum=l,typeof f=="number"&&t.target!=="draft-04"&&(f<=l?delete i.maximum:delete i.exclusiveMaximum)),typeof d=="number"&&(i.multipleOf=d)},gX=(e,t,n,r)=>{n.type="boolean"},yX=(e,t,n,r)=>{n.not={}},vX=(e,t,n,r)=>{},xX=(e,t,n,r)=>{const i=e._zod.def,a=B5(i.entries);a.every(l=>typeof l=="number")&&(n.type="number"),a.every(l=>typeof l=="string")&&(n.type="string"),n.enum=a},bX=(e,t,n,r)=>{const i=e._zod.def,a=[];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");a.push(Number(l))}else a.push(l);if(a.length!==0)if(a.length===1){const l=a[0];n.type=l===null?"null":typeof l,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[l]:n.const=l}else a.every(l=>typeof l=="number")&&(n.type="number"),a.every(l=>typeof l=="string")&&(n.type="string"),a.every(l=>typeof l=="boolean")&&(n.type="boolean"),a.every(l=>l===null)&&(n.type="null"),n.enum=a},wX=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},SX=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},jX=(e,t,n,r)=>{const i=n,a=e._zod.def,{minimum:l,maximum:u}=e._zod.bag;typeof l=="number"&&(i.minItems=l),typeof u=="number"&&(i.maxItems=u),i.type="array",i.items=Bn(a.element,t,{...r,path:[...r.path,"items"]})},NX=(e,t,n,r)=>{const i=n,a=e._zod.def;i.type="object",i.properties={};const l=a.shape;for(const f in l)i.properties[f]=Bn(l[f],t,{...r,path:[...r.path,"properties",f]});const u=new Set(Object.keys(l)),d=new Set([...u].filter(f=>{const p=a.shape[f]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));d.size>0&&(i.required=Array.from(d)),a.catchall?._zod.def.type==="never"?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Bn(a.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},kX=(e,t,n,r)=>{const i=e._zod.def,a=i.inclusive===!1,l=i.options.map((u,d)=>Bn(u,t,{...r,path:[...r.path,a?"oneOf":"anyOf",d]}));a?n.oneOf=l:n.anyOf=l},CX=(e,t,n,r)=>{const i=e._zod.def,a=Bn(i.left,t,{...r,path:[...r.path,"allOf",0]}),l=Bn(i.right,t,{...r,path:[...r.path,"allOf",1]}),u=f=>"allOf"in f&&Object.keys(f).length===1,d=[...u(a)?a.allOf:[a],...u(l)?l.allOf:[l]];n.allOf=d},AX=(e,t,n,r)=>{const i=n,a=e._zod.def;i.type="object";const l=a.keyType,d=l._zod.bag?.patterns;if(a.mode==="loose"&&d&&d.size>0){const p=Bn(a.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const m of d)i.patternProperties[m.source]=p}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=Bn(a.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=Bn(a.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const f=l._zod.values;if(f){const p=[...f].filter(m=>typeof m=="string"||typeof m=="number");p.length>0&&(i.required=p)}},OX=(e,t,n,r)=>{const i=e._zod.def,a=Bn(i.innerType,t,r),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:"null"}]},EX=(e,t,n,r)=>{const i=e._zod.def;Bn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},_X=(e,t,n,r)=>{const i=e._zod.def;Bn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},zX=(e,t,n,r)=>{const i=e._zod.def;Bn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},PX=(e,t,n,r)=>{const i=e._zod.def;Bn(i.innerType,t,r);const a=t.seen.get(e);a.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},TX=(e,t,n,r)=>{const i=e._zod.def,a=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;Bn(a,t,r);const l=t.seen.get(e);l.ref=a},RX=(e,t,n,r)=>{const i=e._zod.def;Bn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},u$=(e,t,n,r)=>{const i=e._zod.def;Bn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},DX=ve("ZodISODateTime",(e,t)=>{MW.init(e,t),wn.init(e,t)});function MX(e){return qZ(DX,e)}const IX=ve("ZodISODate",(e,t)=>{IW.init(e,t),wn.init(e,t)});function LX(e){return FZ(IX,e)}const $X=ve("ZodISOTime",(e,t)=>{LW.init(e,t),wn.init(e,t)});function BX(e){return HZ($X,e)}const UX=ve("ZodISODuration",(e,t)=>{$W.init(e,t),wn.init(e,t)});function qX(e){return KZ(UX,e)}const FX=(e,t)=>{H5.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>EY(e,n)},flatten:{value:n=>OY(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Yj,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Yj,2)}},isEmpty:{get(){return e.issues.length===0}}})},Qi=ve("ZodError",FX,{Parent:Error}),HX=XN(Qi),KX=JN(Qi),GX=Ev(Qi),VX=_v(Qi),QX=PY(Qi),YX=TY(Qi),WX=RY(Qi),ZX=DY(Qi),XX=MY(Qi),JX=IY(Qi),eJ=LY(Qi),tJ=$Y(Qi),bn=ve("ZodType",(e,t)=>(xn.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:oy(e,"input"),output:oy(e,"output")}}),e.toJSONSchema=fX(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Yo(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)=>Wo(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>HX(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>GX(e,n,r),e.parseAsync=async(n,r)=>KX(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>VX(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>QX(e,n,r),e.decode=(n,r)=>YX(e,n,r),e.encodeAsync=async(n,r)=>WX(e,n,r),e.decodeAsync=async(n,r)=>ZX(e,n,r),e.safeEncode=(n,r)=>XX(e,n,r),e.safeDecode=(n,r)=>JX(e,n,r),e.safeEncodeAsync=async(n,r)=>eJ(e,n,r),e.safeDecodeAsync=async(n,r)=>tJ(e,n,r),e.refine=(n,r)=>e.check(WJ(n,r)),e.superRefine=n=>e.check(ZJ(n)),e.overwrite=n=>e.check(yd(n)),e.optional=()=>G2(e),e.exactOptional=()=>IJ(e),e.nullable=()=>V2(e),e.nullish=()=>G2(V2(e)),e.nonoptional=n=>FJ(e,n),e.array=()=>Ae(e),e.or=n=>AJ([e,n]),e.and=n=>zJ(e,n),e.transform=n=>Q2(e,DJ(n)),e.default=n=>BJ(e,n),e.prefault=n=>qJ(e,n),e.catch=n=>KJ(e,n),e.pipe=n=>Q2(e,n),e.readonly=()=>QJ(e),e.describe=n=>{const r=e.clone();return eh.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return eh.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return eh.get(e);const r=e.clone();return eh.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),d$=ve("_ZodString",(e,t)=>{ek.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>pX(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(ZZ(...r)),e.includes=(...r)=>e.check(eX(...r)),e.startsWith=(...r)=>e.check(tX(...r)),e.endsWith=(...r)=>e.check(nX(...r)),e.min=(...r)=>e.check(sy(...r)),e.max=(...r)=>e.check(a$(...r)),e.length=(...r)=>e.check(s$(...r)),e.nonempty=(...r)=>e.check(sy(1,...r)),e.lowercase=r=>e.check(XZ(r)),e.uppercase=r=>e.check(JZ(r)),e.trim=()=>e.check(iX()),e.normalize=(...r)=>e.check(rX(...r)),e.toLowerCase=()=>e.check(aX()),e.toUpperCase=()=>e.check(sX()),e.slugify=()=>e.check(oX())}),nJ=ve("ZodString",(e,t)=>{ek.init(e,t),d$.init(e,t),e.email=n=>e.check(wZ(rJ,n)),e.url=n=>e.check(CZ(iJ,n)),e.jwt=n=>e.check(UZ(xJ,n)),e.emoji=n=>e.check(AZ(aJ,n)),e.guid=n=>e.check(B2(H2,n)),e.uuid=n=>e.check(SZ(Hm,n)),e.uuidv4=n=>e.check(jZ(Hm,n)),e.uuidv6=n=>e.check(NZ(Hm,n)),e.uuidv7=n=>e.check(kZ(Hm,n)),e.nanoid=n=>e.check(OZ(sJ,n)),e.guid=n=>e.check(B2(H2,n)),e.cuid=n=>e.check(EZ(oJ,n)),e.cuid2=n=>e.check(_Z(lJ,n)),e.ulid=n=>e.check(zZ(cJ,n)),e.base64=n=>e.check(LZ(gJ,n)),e.base64url=n=>e.check($Z(yJ,n)),e.xid=n=>e.check(PZ(uJ,n)),e.ksuid=n=>e.check(TZ(dJ,n)),e.ipv4=n=>e.check(RZ(fJ,n)),e.ipv6=n=>e.check(DZ(hJ,n)),e.cidrv4=n=>e.check(MZ(pJ,n)),e.cidrv6=n=>e.check(IZ(mJ,n)),e.e164=n=>e.check(BZ(vJ,n)),e.datetime=n=>e.check(MX(n)),e.date=n=>e.check(LX(n)),e.time=n=>e.check(BX(n)),e.duration=n=>e.check(qX(n))});function R(e){return bZ(nJ,e)}const wn=ve("ZodStringFormat",(e,t)=>{pn.init(e,t),d$.init(e,t)}),rJ=ve("ZodEmail",(e,t)=>{AW.init(e,t),wn.init(e,t)}),H2=ve("ZodGUID",(e,t)=>{kW.init(e,t),wn.init(e,t)}),Hm=ve("ZodUUID",(e,t)=>{CW.init(e,t),wn.init(e,t)}),iJ=ve("ZodURL",(e,t)=>{OW.init(e,t),wn.init(e,t)}),aJ=ve("ZodEmoji",(e,t)=>{EW.init(e,t),wn.init(e,t)}),sJ=ve("ZodNanoID",(e,t)=>{_W.init(e,t),wn.init(e,t)}),oJ=ve("ZodCUID",(e,t)=>{zW.init(e,t),wn.init(e,t)}),lJ=ve("ZodCUID2",(e,t)=>{PW.init(e,t),wn.init(e,t)}),cJ=ve("ZodULID",(e,t)=>{TW.init(e,t),wn.init(e,t)}),uJ=ve("ZodXID",(e,t)=>{RW.init(e,t),wn.init(e,t)}),dJ=ve("ZodKSUID",(e,t)=>{DW.init(e,t),wn.init(e,t)}),fJ=ve("ZodIPv4",(e,t)=>{BW.init(e,t),wn.init(e,t)}),hJ=ve("ZodIPv6",(e,t)=>{UW.init(e,t),wn.init(e,t)}),pJ=ve("ZodCIDRv4",(e,t)=>{qW.init(e,t),wn.init(e,t)}),mJ=ve("ZodCIDRv6",(e,t)=>{FW.init(e,t),wn.init(e,t)}),gJ=ve("ZodBase64",(e,t)=>{HW.init(e,t),wn.init(e,t)}),yJ=ve("ZodBase64URL",(e,t)=>{GW.init(e,t),wn.init(e,t)}),vJ=ve("ZodE164",(e,t)=>{VW.init(e,t),wn.init(e,t)}),xJ=ve("ZodJWT",(e,t)=>{YW.init(e,t),wn.init(e,t)}),f$=ve("ZodNumber",(e,t)=>{e$.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>mX(e,r,i),e.gt=(r,i)=>e.check(q2(r,i)),e.gte=(r,i)=>e.check(bw(r,i)),e.min=(r,i)=>e.check(bw(r,i)),e.lt=(r,i)=>e.check(U2(r,i)),e.lte=(r,i)=>e.check(xw(r,i)),e.max=(r,i)=>e.check(xw(r,i)),e.int=r=>e.check(K2(r)),e.safe=r=>e.check(K2(r)),e.positive=r=>e.check(q2(0,r)),e.nonnegative=r=>e.check(bw(0,r)),e.negative=r=>e.check(U2(0,r)),e.nonpositive=r=>e.check(xw(0,r)),e.multipleOf=(r,i)=>e.check(F2(r,i)),e.step=(r,i)=>e.check(F2(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 he(e){return GZ(f$,e)}const bJ=ve("ZodNumberFormat",(e,t)=>{WW.init(e,t),f$.init(e,t)});function K2(e){return VZ(bJ,e)}const wJ=ve("ZodBoolean",(e,t)=>{ZW.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>gX(e,n,r)});function ut(e){return QZ(wJ,e)}const SJ=ve("ZodUnknown",(e,t)=>{XW.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>vX()});function Zu(){return YZ(SJ)}const jJ=ve("ZodNever",(e,t)=>{JW.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>yX(e,n,r)});function NJ(e){return WZ(jJ,e)}const kJ=ve("ZodArray",(e,t)=>{eZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>jX(e,n,r,i),e.element=t.element,e.min=(n,r)=>e.check(sy(n,r)),e.nonempty=n=>e.check(sy(1,n)),e.max=(n,r)=>e.check(a$(n,r)),e.length=(n,r)=>e.check(s$(n,r)),e.unwrap=()=>e.element});function Ae(e,t){return lX(kJ,e,t)}const CJ=ve("ZodObject",(e,t)=>{nZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>NX(e,n,r,i),Rt(e,"shape",()=>t.shape),e.keyof=()=>nt(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Zu()}),e.loose=()=>e.clone({...e._zod.def,catchall:Zu()}),e.strict=()=>e.clone({...e._zod.def,catchall:NJ()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>jY(e,n),e.safeExtend=n=>NY(e,n),e.merge=n=>kY(e,n),e.pick=n=>wY(e,n),e.omit=n=>SY(e,n),e.partial=(...n)=>CY(p$,e,n[0]),e.required=(...n)=>AY(m$,e,n[0])});function ge(e,t){const n={type:"object",shape:e??{},...Fe(t)};return new CJ(n)}const h$=ve("ZodUnion",(e,t)=>{r$.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>kX(e,n,r,i),e.options=t.options});function AJ(e,t){return new h$({type:"union",options:e,...Fe(t)})}const OJ=ve("ZodDiscriminatedUnion",(e,t)=>{h$.init(e,t),rZ.init(e,t)});function EJ(e,t,n){return new OJ({type:"union",options:t,discriminator:e,...Fe(n)})}const _J=ve("ZodIntersection",(e,t)=>{iZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>CX(e,n,r,i)});function zJ(e,t){return new _J({type:"intersection",left:e,right:t})}const PJ=ve("ZodRecord",(e,t)=>{aZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>AX(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function vc(e,t,n){return new PJ({type:"record",keyType:e,valueType:t,...Fe(n)})}const Zj=ve("ZodEnum",(e,t)=>{sZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>xX(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 a={};for(const l of r)if(n.has(l))a[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new Zj({...t,checks:[],...Fe(i),entries:a})},e.exclude=(r,i)=>{const a={...t.entries};for(const l of r)if(n.has(l))delete a[l];else throw new Error(`Key ${l} not found in enum`);return new Zj({...t,checks:[],...Fe(i),entries:a})}});function nt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Zj({type:"enum",entries:n,...Fe(t)})}const TJ=ve("ZodLiteral",(e,t)=>{oZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>bX(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 Ba(e,t){return new TJ({type:"literal",values:Array.isArray(e)?e:[e],...Fe(t)})}const RJ=ve("ZodTransform",(e,t)=>{lZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>SX(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new L5(e.constructor.name);n.addIssue=a=>{if(typeof a=="string")n.issues.push(Sh(a,n.value,t));else{const l=a;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(Sh(l))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(a=>(n.value=a,n)):(n.value=i,n)}});function DJ(e){return new RJ({type:"transform",transform:e})}const p$=ve("ZodOptional",(e,t)=>{i$.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>u$(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function G2(e){return new p$({type:"optional",innerType:e})}const MJ=ve("ZodExactOptional",(e,t)=>{cZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>u$(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function IJ(e){return new MJ({type:"optional",innerType:e})}const LJ=ve("ZodNullable",(e,t)=>{uZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>OX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function V2(e){return new LJ({type:"nullable",innerType:e})}const $J=ve("ZodDefault",(e,t)=>{dZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>_X(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function BJ(e,t){return new $J({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():q5(t)}})}const UJ=ve("ZodPrefault",(e,t)=>{fZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>zX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function qJ(e,t){return new UJ({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():q5(t)}})}const m$=ve("ZodNonOptional",(e,t)=>{hZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>EX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function FJ(e,t){return new m$({type:"nonoptional",innerType:e,...Fe(t)})}const HJ=ve("ZodCatch",(e,t)=>{pZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>PX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function KJ(e,t){return new HJ({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const GJ=ve("ZodPipe",(e,t)=>{mZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>TX(e,n,r,i),e.in=t.in,e.out=t.out});function Q2(e,t){return new GJ({type:"pipe",in:e,out:t})}const VJ=ve("ZodReadonly",(e,t)=>{gZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>RX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function QJ(e){return new VJ({type:"readonly",innerType:e})}const YJ=ve("ZodCustom",(e,t)=>{yZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>wX(e,n)});function WJ(e,t={}){return cX(YJ,e,t)}function ZJ(e){return uX(e)}ge({maxConcurrency:he().int().positive(),maxRequestsPerMinute:he().int().positive(),maxRequestsPerDay:he().int().positive()});const Is=R().min(1);R().min(1);const tk=ge({label:R().min(1),city:R().min(1),region:R().min(1),country:R().length(2),timezone:R().optional()}),nk=nt(["citation.lost","citation.gained","run.completed","run.failed","insight.critical","insight.high"]);ge({id:R(),projectId:R(),channel:Ba("webhook"),url:R().url(),urlDisplay:R(),urlHost:R(),events:Ae(nk),enabled:ut().default(!0),source:R().optional(),webhookSecret:R().optional(),createdAt:R(),updatedAt:R()});ge({channel:Ba("webhook"),url:R().url(),events:Ae(nk).min(1),source:R().optional()});const g$=nt(["cli","api","config-file"]);function XJ(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 JJ(e,t){return t?e.some(n=>n.label===t):!0}ge({displayName:R().min(1),canonicalDomain:R().min(1),ownedDomains:Ae(R().min(1)).optional(),country:R().length(2),language:R().min(2),tags:Ae(R()).optional(),labels:vc(R(),R()).optional(),providers:Ae(Is).optional(),locations:Ae(tk).optional(),defaultLocation:R().nullable().optional(),autoExtractBacklinks:ut().optional(),configSource:g$.optional()});ge({id:R(),name:R(),displayName:R().optional(),canonicalDomain:R(),ownedDomains:Ae(R()).default([]),country:R().length(2),language:R().min(2),tags:Ae(R()).default([]),labels:vc(R(),R()).default({}),locations:Ae(tk).default([]),defaultLocation:R().nullable().optional(),autoExtractBacklinks:ut().default(!1),configSource:g$.default("cli"),configRevision:he().int().positive().default(1),createdAt:R().optional(),updatedAt:R().optional()});ge({id:R(),query:R(),createdAt:R()});ge({id:R(),keyword:R(),createdAt:R()});ge({queries:Ae(R().trim().min(1)).min(1)});ge({keywords:Ae(R().trim().min(1)).min(1)});ge({provider:Is,count:he().int().min(1).max(20).optional()});ge({id:R(),domain:R(),createdAt:R()});ge({competitors:Ae(R().trim().min(1)).min(1)});function ly(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}const eee=new Set(["ac.uk","co.id","co.il","co.in","co.jp","co.kr","co.nz","co.th","co.uk","co.za","com.au","com.br","com.cn","com.mx","com.ph","com.sg","com.tr","edu.au","edu.sg","gov.au","gov.uk","me.uk","ne.jp","net.au","net.br","net.cn","net.in","net.tr","or.jp","or.kr","org.au","org.br","org.in","org.nz","org.tr","org.uk","org.za"]);function tee(e){const t=ly(e);if(!t)return"";const n=t.split("/")[0]?.split(":")[0]??"";if(!n)return"";const r=n.split(".").filter(Boolean);if(r.length<2)return"";if(r.length===2)return r.join(".");const i=r.slice(-2).join(".");return eee.has(i)?r.length>=3?r.slice(-3).join("."):"":r.slice(-2).join(".")}function nee(e){const t=tee(e);return t?t.split(".")[0]??"":""}function ree(e){const t=[e.canonicalDomain,...e.ownedDomains??[]],n=new Set,r=[];for(const i of t){const a=i.trim();if(!a)continue;const l=ly(a);n.has(l)||(n.add(l),r.push(a))}return r}const iee=ge({name:R().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:vc(R(),R()).optional().default({})}),aee=ge({preset:R().optional(),cron:R().optional(),timezone:R().optional().default("UTC"),providers:Ae(Is).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),see=ge({channel:Ba("webhook"),url:R().url(),events:Ae(nk).min(1)}),oee=ge({gsc:ge({propertyUrl:R()}).optional(),syncSchedule:ge({preset:R().optional(),cron:R().optional()}).optional()}).optional(),Y2=Ae(R().min(1)),lee=ge({displayName:R().min(1),canonicalDomain:R().min(1),ownedDomains:Ae(R().min(1)).optional().default([]),country:R().length(2),language:R().min(2),queries:Y2.optional(),keywords:Y2.optional(),competitors:Ae(R().min(1)).optional().default([]),providers:Ae(Is).optional().default([]),locations:Ae(tk).optional().default([]),defaultLocation:R().optional(),schedule:aee,notifications:Ae(see).optional().default([]),google:oee,autoExtractBacklinks:ut().optional().default(!1)}).superRefine((e,t)=>{e.queries!==void 0&&e.keywords!==void 0&&t.addIssue({code:"custom",message:"Use spec.queries; spec.keywords is accepted only as a legacy alias when spec.queries is omitted",path:["keywords"]});const n=XJ(e.locations);n.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${n.join(", ")}`,path:["locations"]}),JJ(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});ge({apiVersion:Ba("canonry/v1"),kind:Ba("Project"),metadata:iee,spec:lee});const cee=nt(["gsc","ga4"]);ge({id:R(),domain:R(),connectionType:cee,propertyId:R().nullable().optional(),sitemapUrl:R().nullable().optional(),scopes:Ae(R()).default([]),createdAt:R(),updatedAt:R()});ge({date:R(),query:R(),page:R(),country:R().nullable().optional(),device:R().nullable().optional(),clicks:he(),impressions:he(),ctr:he(),position:he()});const Xj=ge({id:R(),url:R(),indexingState:R().nullable().optional(),verdict:R().nullable().optional(),coverageState:R().nullable().optional(),pageFetchState:R().nullable().optional(),robotsTxtState:R().nullable().optional(),crawlTime:R().nullable().optional(),lastCrawlResult:R().nullable().optional(),isMobileFriendly:ut().nullable().optional(),richResults:Ae(R()).default([]),inspectedAt:R()});nt(["stable","reindexed","deindexed","still-missing","new"]);const uee=ge({url:R(),previousState:R().nullable(),currentState:R().nullable(),transitionDate:R()}),dee=ge({reason:R(),count:he(),urls:Ae(Xj).default([])});ge({summary:ge({total:he(),indexed:he(),notIndexed:he(),deindexed:he(),percentage:he()}),lastInspectedAt:R().nullable(),lastSyncedAt:R().nullable(),indexed:Ae(Xj).default([]),notIndexed:Ae(Xj).default([]),deindexed:Ae(uee).default([]),reasonGroups:Ae(dee).default([])});ge({url:R(),type:nt(["URL_UPDATED","URL_DELETED"]),notifiedAt:R()});ge({url:R(),type:nt(["URL_UPDATED","URL_DELETED"]),notifiedAt:R(),status:nt(["success","error"]),error:R().optional()});ge({date:R(),indexed:he(),notIndexed:he(),reasonBreakdown:vc(R(),he()).default({})});ge({id:R(),domain:R(),siteUrl:R().nullable().optional(),createdAt:R(),updatedAt:R()});const ww=ge({id:R(),url:R(),httpCode:he().nullable().optional(),inIndex:ut().nullable().optional(),lastCrawledDate:R().nullable().optional(),inIndexDate:R().nullable().optional(),inspectedAt:R(),documentSize:he().nullable().optional(),anchorCount:he().nullable().optional(),discoveryDate:R().nullable().optional()});ge({summary:ge({total:he(),indexed:he(),notIndexed:he(),unknown:he().optional(),percentage:he()}),lastInspectedAt:R().nullable(),indexed:Ae(ww).default([]),notIndexed:Ae(ww).default([]),unknown:Ae(ww).default([]).optional()});ge({query:R(),impressions:he(),clicks:he(),ctr:he(),averagePosition:he()});ge({date:R(),indexed:he(),notIndexed:he(),unknown:he()});ge({url:R(),status:nt(["success","error"]),submittedAt:R(),error:R().optional()});const vd=nt(["live","staging"]);ge({projectName:R(),url:R(),stagingUrl:R().optional(),username:R(),defaultEnv:vd,createdAt:R(),updatedAt:R()});const W2=ge({url:R(),reachable:ut(),pageCount:he().nullable().optional(),version:R().nullable().optional(),error:R().nullable().optional(),plugins:Ae(R()).optional(),authenticatedUser:ge({id:he(),slug:R()}).nullable().optional()});ge({connected:ut(),projectName:R(),defaultEnv:vd,live:W2.nullable(),staging:W2.nullable(),adminUrl:R().nullable().optional()});const fee=ge({id:he(),slug:R(),title:R(),status:R(),modifiedAt:R().nullable().optional(),link:R().nullable().optional()}),y$=ge({title:R().nullable(),description:R().nullable(),noindex:ut().nullable(),writable:ut().default(!1),writeTargets:Ae(R()).default([])}),hee=ge({type:R(),json:vc(R(),Zu())}),pee=fee.extend({env:vd,content:R(),seo:y$,schemaBlocks:Ae(hee).default([])}),Z2=pee.extend({contentHash:R(),contentSnippet:R()}),v$=ge({manualRequired:Ba(!0),targetUrl:R(),adminUrl:R().nullable().optional(),content:R(),nextSteps:Ae(R()).default([])}),mee=ge({slug:R(),severity:nt(["high","medium","low"]),code:nt(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:R()});ge({slug:R(),title:R(),status:R(),wordCount:he(),seo:y$,schemaPresent:ut(),issues:Ae(mee).default([])});const gee=ge({slug:R(),status:nt(["applied","skipped","manual"]),error:R().optional(),manualAssist:v$.optional()});ge({env:vd,strategy:nt(["plugin","manual"]),results:Ae(gee)});const yee=ge({slug:R(),status:nt(["deployed","stripped","skipped","failed"]),schemasInjected:Ae(R()).optional(),manualAssist:v$.optional(),error:R().optional()});ge({env:vd,results:Ae(yee)});const vee=ge({slug:R(),title:R(),canonrySchemas:Ae(R()),thirdPartySchemas:Ae(R()),hasCanonrySchema:ut()});ge({env:vd,pages:Ae(vee)});const xee=ge({name:R(),status:nt(["completed","skipped","failed"]),summary:R().optional(),error:R().optional()});ge({projectName:R(),steps:Ae(xee)});ge({slug:R(),live:Z2,staging:Z2,hasDifferences:ut(),differences:ge({title:ut(),slug:ut(),content:ut(),seoTitle:ut(),seoDescription:ut(),noindex:ut(),schema:ut()})});const x$=nt(["queued","running","completed","partial","failed","cancelled"]),fr=x$.enum,b$=nt(["answer-visibility","site-audit","gsc-sync","inspect-sitemap","ga-sync","bing-inspect","bing-inspect-sitemap","backlink-extract"]),zt=b$.enum,w$=nt(["manual","scheduled","config-apply"]),oh=w$.enum,Xu=nt(["cited","not-cited"]),Ju=Xu.enum,cy=nt(["visible","not-visible"]);cy.enum;const S$=nt(["new","cited","lost","emerging","not-cited"]);S$.enum;ge({kind:Ba(zt["answer-visibility"]).optional(),trigger:Ba(oh.manual).optional(),providers:Ae(Is).optional(),location:R().min(1).optional(),allLocations:ut().optional(),noLocation:ut().optional()}).refine(e=>+!!e.location+ +!!e.allLocations+ +!!e.noLocation<=1,{message:'Only one of "location", "allLocations", or "noLocation" may be provided'});const bee=ge({message:R(),raw:Zu().optional()}),wee=ge({message:R().optional(),providers:vc(R(),bee).optional()}),See=ge({id:R(),projectId:R(),kind:b$,status:x$,trigger:w$.default("manual"),location:R().nullable().optional(),startedAt:R().nullable().optional(),finishedAt:R().nullable().optional(),error:wee.nullable().optional(),createdAt:R()});function rk(e){if(e.providers){const t=Object.entries(e.providers);if(t.length===1){const[n,r]=t[0];return`${n}: ${r.message}`}if(t.length>1)return t.map(([n,r])=>`${n}: ${r.message}`).join(" • ")}return e.message??"Run failed."}const j$=ge({uri:R(),title:R()}),N$=ge({id:R(),runId:R(),queryId:R(),query:R().optional(),provider:Is,citationState:Xu,answerMentioned:ut().optional(),visibilityState:cy.optional(),transition:S$.optional(),answerText:R().nullable().optional(),citedDomains:Ae(R()).default([]),competitorOverlap:Ae(R()).default([]),recommendedCompetitors:Ae(R()).default([]),matchedTerms:Ae(R()).default([]),groundingSources:Ae(j$).default([]),searchQueries:Ae(R()).default([]),model:R().nullable().optional(),location:R().nullable().optional(),createdAt:R()});ge({snapshots:Ae(N$),total:he().int().nonnegative()});const jee=ge({queryId:R().nullable(),query:R().nullable(),run1State:Xu.nullable(),run2State:Xu.nullable(),run1AnswerMentioned:ut().nullable(),run2AnswerMentioned:ut().nullable(),run1VisibilityState:cy.nullable(),run2VisibilityState:cy.nullable(),changed:ut(),visibilityChanged:ut()});ge({run1:R(),run2:R(),diff:Ae(jee)});const Nee=See.extend({snapshots:Ae(N$).optional()});ge({totalRuns:he().int().nonnegative(),run:Nee.nullable()});ge({id:R(),projectId:R().nullable().optional(),actor:R(),action:R(),entityType:R(),entityId:R().nullable().optional(),diff:Zu().optional(),createdAt:R()});const kee=nt(["yes","no","unknown","not-mentioned"]),X2=Ae(R().min(1));ge({companyName:R().min(1),domain:R().min(1),queries:X2.optional(),phrases:X2.optional(),competitors:Ae(R().min(1)).optional().default([])}).superRefine((e,t)=>{e.queries!==void 0&&e.phrases!==void 0&&t.addIssue({code:"custom",message:"Use queries; phrases is accepted only as a legacy alias when queries is omitted",path:["phrases"]})});const Cee=ge({name:R(),count:he().int().nonnegative()}),Aee=ge({id:R(),name:R(),weight:he(),score:he(),grade:R(),status:nt(["pass","partial","fail"]),findings:Ae(ge({type:R(),message:R()})).default([]),recommendations:Ae(R()).default([])}),Oee=ge({url:R(),finalUrl:R(),auditedAt:R(),overallScore:he(),overallGrade:R(),summary:R(),factors:Ae(Aee).default([])}),Eee=ge({industry:R(),summary:R(),services:Ae(R()).default([]),categoryTerms:Ae(R()).default([])}),_ee=ge({provider:R(),displayName:R(),model:R().nullable().optional(),mentioned:ut(),cited:ut(),describedAccurately:kee,accuracyNotes:R().nullable().optional(),incorrectClaims:Ae(R()).default([]),recommendedCompetitors:Ae(R()).default([]),citedDomains:Ae(R()).default([]),groundingSources:Ae(j$).default([]),searchQueries:Ae(R()).default([]),answerText:R(),error:R().nullable().optional()}),zee=ge({query:R(),providerResults:Ae(_ee).default([])}),Pee=ge({totalQueries:he().int().nonnegative(),totalProviders:he().int().nonnegative(),totalComparisons:he().int().nonnegative(),mentionCount:he().int().nonnegative(),citationCount:he().int().nonnegative(),topCompetitors:Ae(Cee).default([]),visibilityGap:R(),whatThisMeans:Ae(R()).default([]),recommendedActions:Ae(R()).default([])});ge({companyName:R(),domain:R(),homepageUrl:R(),generatedAt:R(),queries:Ae(R()).default([]),competitors:Ae(R()).default([]),profile:Eee,audit:Oee,queryResults:Ae(zee).default([]),summary:Pee});ge({id:R(),projectId:R(),cronExpr:R(),preset:R().nullable().optional(),timezone:R().default("UTC"),enabled:ut().default(!0),providers:Ae(Is).default([]),lastRunAt:R().nullable().optional(),nextRunAt:R().nullable().optional(),createdAt:R(),updatedAt:R()});ge({preset:R().optional(),cron:R().optional(),timezone:R().optional().default("UTC"),enabled:ut().optional().default(!0),providers:Ae(Is).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});const Tee=nt(["mentioned","cited"]);Tee.enum;ge({id:R(),projectId:R(),propertyId:R(),clientEmail:R(),connected:ut(),createdAt:R(),updatedAt:R()});ge({date:R(),landingPage:R(),sessions:he(),organicSessions:he(),users:he()});const ik=nt(["session","first_user","manual_utm"]),Ree=ge({source:R(),medium:R(),sessions:he(),users:he(),sourceDimension:ik}),Dee=ge({source:R(),medium:R(),sourceDimension:ik,landingPage:R(),sessions:he(),users:he()}),Mee=ge({source:R(),medium:R(),sessions:he(),users:he(),channelGroup:R()});ge({totalSessions:he(),totalOrganicSessions:he(),totalDirectSessions:he(),totalUsers:he(),topPages:Ae(ge({landingPage:R(),sessions:he(),organicSessions:he(),directSessions:he(),users:he()})),aiReferrals:Ae(Ree),aiReferralLandingPages:Ae(Dee),aiSessionsDeduped:he(),aiUsersDeduped:he(),aiSessionsBySession:he(),aiUsersBySession:he(),socialReferrals:Ae(Mee),socialSessions:he(),socialUsers:he(),organicSharePct:he(),aiSharePct:he(),aiSharePctBySession:he(),directSharePct:he(),socialSharePct:he(),organicSharePctDisplay:R(),aiSharePctDisplay:R(),aiSharePctBySessionDisplay:R(),directSharePctDisplay:R(),socialSharePctDisplay:R(),lastSyncedAt:R().nullable()});ge({date:R(),source:R(),medium:R(),landingPage:R(),sessions:he(),users:he(),sourceDimension:ik});ge({date:R(),source:R(),medium:R(),sessions:he(),users:he(),channelGroup:R()});ge({date:R(),sessions:he(),organicSessions:he(),users:he()});function uy(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}const Iee=nt(["aero","user","compaction"]);Iee.enum;const k$=128;ge({key:R().min(1).max(k$),value:R().min(1)});ge({key:R().min(1).max(k$)});const ak=nt(["queued","downloading","querying","ready","failed"]);ak.enum;ge({id:R(),release:R(),status:ak,phaseDetail:R().nullable().optional(),vertexPath:R().nullable().optional(),edgesPath:R().nullable().optional(),vertexSha256:R().nullable().optional(),edgesSha256:R().nullable().optional(),vertexBytes:he().int().nullable().optional(),edgesBytes:he().int().nullable().optional(),projectsProcessed:he().int().nullable().optional(),domainsDiscovered:he().int().nullable().optional(),downloadStartedAt:R().nullable().optional(),downloadFinishedAt:R().nullable().optional(),queryStartedAt:R().nullable().optional(),queryFinishedAt:R().nullable().optional(),error:R().nullable().optional(),createdAt:R(),updatedAt:R()});const Lee=ge({linkingDomain:R(),numHosts:he().int()}),$ee=ge({projectId:R(),release:R(),targetDomain:R(),totalLinkingDomains:he().int(),totalHosts:he().int(),top10HostsShare:R(),queriedAt:R(),excludedLinkingDomains:he().int().optional(),excludedHosts:he().int().optional()});ge({summary:$ee.nullable(),total:he().int(),rows:Ae(Lee)});ge({release:R(),totalLinkingDomains:he().int(),totalHosts:he().int(),top10HostsShare:R(),queriedAt:R()});ge({duckdbInstalled:ut(),duckdbVersion:R().nullable().optional(),duckdbSpec:R(),pluginDir:R()});ge({installed:ut(),version:R(),path:R(),alreadyPresent:ut()});ge({release:R(),vertexUrl:R(),edgesUrl:R(),vertexBytes:he().int().nullable(),edgesBytes:he().int().nullable(),lastModified:R().nullable()});ge({release:R(),syncStatus:ak.nullable(),bytes:he().int(),lastUsedAt:R().nullable()});nt(["snapshot","insight"]);const Bee=ge({kind:Ba("snapshot"),id:R(),runId:R(),query:R(),provider:R(),model:R().nullable(),citationState:Xu,matchedField:nt(["answerText","citedDomains","searchQueries","query"]),snippet:R(),createdAt:R()}),Uee=ge({kind:Ba("insight"),id:R(),runId:R().nullable(),type:nt(["regression","gain","opportunity","first-citation","provider-pickup","persistent-gap","competitor-gained","competitor-lost"]),severity:nt(["critical","high","medium","low"]),title:R(),query:R(),provider:R(),matchedField:nt(["title","query","recommendation","cause"]),snippet:R(),dismissed:ut(),createdAt:R()}),qee=EJ("kind",[Bee,Uee]);ge({query:R(),totalHits:he().int().nonnegative(),truncated:ut(),hits:Ae(qee)});const C$=nt(["create","expand","refresh","add-schema"]);C$.enum;function A$(e){switch(e){case"create":return"Create";case"expand":return"Expand";case"refresh":return"Refresh";case"add-schema":return"Add schema"}}const O$=nt(["gsc","competitor-evidence","both"]);O$.enum;const E$=nt(["high","medium","low"]);E$.enum;function Fee(e){switch(e){case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}const Hee=nt(["blog-post","comparison","listicle","how-to","guide","glossary"]);Hee.enum;const _$=nt(["proposed","briefed","payload-generated","draft-created","published","validated","dismissed"]);_$.enum;const Kee=ge({url:R(),gscImpressions:he().nonnegative(),gscClicks:he().nonnegative(),gscAvgPosition:he().nonnegative().nullable(),organicSessions:he().nonnegative()}),Gee=ge({domain:R(),url:R(),title:R(),citationCount:he().int().nonnegative()}),Vee=ge({demand:he(),competitor:he(),absence:he(),gapSeverity:he()}),Qee=ge({actionId:R(),state:_$,lastUpdated:R()}),Yee=ge({targetRef:R(),query:R(),action:C$,ourBestPage:Kee.nullable(),winningCompetitor:Gee.nullable(),score:he(),scoreBreakdown:Vee,drivers:Ae(R()),demandSource:O$,actionConfidence:E$,existingAction:Qee.nullable()});ge({targets:Ae(Yee),contextMetrics:ge({totalAiReferralSessions:he().int().nonnegative(),latestRunId:R(),runTimestamp:R()})});const Wee=ge({uri:R(),title:R(),domain:R(),isOurDomain:ut(),isCompetitor:ut(),citationCount:he().int().nonnegative(),providers:Ae(Is)}),Zee=ge({query:R(),groundingSources:Ae(Wee)});ge({sources:Ae(Zee),latestRunId:R()});const Xee=ge({query:R(),competitorDomains:Ae(R()),competitorCount:he().int().nonnegative(),missRate:he().min(0).max(1),lastSeenInRunId:R()});ge({gaps:Ae(Xee),latestRunId:R()});const z$=nt(["ok","warn","fail","skipped"]);z$.enum;const sk=nt(["global","project"]);sk.enum;const P$=nt(["auth","config","providers","integrations","database","schedules"]);P$.enum;const Jee=ge({id:R(),category:P$,scope:sk,title:R(),status:z$,code:R().describe('Stable machine-readable code (e.g. "google.token.refresh-failed"). Use this for filtering and remediation logic.'),summary:R(),remediation:R().nullable().optional().describe('Operator-facing next step. Null when status is "ok" or no specific remediation applies.'),details:vc(R(),Zu()).optional().describe("Structured context — principal email, redirect URI, missing scopes, etc. Stable per check id."),durationMs:he().int().nonnegative().describe("How long the check took to execute.")});ge({scope:sk,project:R().nullable().describe('Project name when scope is "project", null otherwise.'),generatedAt:R().describe("ISO-8601 timestamp when this doctor run started."),durationMs:he().int().nonnegative(),summary:ge({total:he().int().nonnegative(),ok:he().int().nonnegative(),warn:he().int().nonnegative(),fail:he().int().nonnegative(),skipped:he().int().nonnegative()}),checks:Ae(Jee)});function ete(e,t){if(!e)return"";const n=e.trim();if(!n)return"";if(/^https?:\/\//i.test(n))return n;if(n.startsWith("//"))return`https:${n}`;const r=t.trim().replace(/^https?:\/\//i,"").replace(/\/+$/,"");return r?n.startsWith("/")?`https://${r}${n}`:`https://${r}/${n}`:n}const tte=ge({provider:R(),citationState:Xu,cited:ut(),mentioned:ut(),runId:R(),runCreatedAt:R()}),nte=ge({queryId:R(),query:R(),providers:Ae(tte),citedCount:he().int().nonnegative(),mentionedCount:he().int().nonnegative(),totalProviders:he().int().nonnegative()}),rte=ge({queryId:R(),query:R(),provider:R(),citingCompetitors:Ae(R()),runId:R(),runCreatedAt:R()}),ite=ge({providersConfigured:he().int().nonnegative(),providersCiting:he().int().nonnegative(),providersMentioning:he().int().nonnegative(),totalQueries:he().int().nonnegative(),queriesCitedAndMentioned:he().int().nonnegative(),queriesCitedOnly:he().int().nonnegative(),queriesMentionedOnly:he().int().nonnegative(),queriesInvisible:he().int().nonnegative(),latestRunId:R().nullable(),latestRunAt:R().nullable()});ge({summary:ite,byQuery:Ae(nte),competitorGaps:Ae(rte),status:nt(["ready","no-data"]),reason:nt(["no-runs-yet","no-queries"]).optional()});function ate(e){return e.horizon==="immediate"?"negative":e.confidence==="high"?"caution":e.confidence==="low"?"neutral":"caution"}function ste(e){switch(e){case"critical":return"Critical";case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}function T$(e){switch(e){case"immediate":return"Immediate";case"short-term":return"Short term";case"medium-term":return"Medium term"}}function ote(e){switch(e){case"content":return"Content";case"competitors":return"Competitors";case"provider":return"Provider";case"search-demand":return"Search demand";case"indexing":return"Indexing";case"location":return"Location";case"monitoring":return"Monitoring"}}function lte(e){switch(e){case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}const cte=nt(["claude","codex"]);cte.enum;const ute=nt(["claude","codex","all"]);ute.enum;var To=(e=>(e.Clicks="clicks",e.Impressions="impressions",e.CTR="ctr",e.Position="position",e))(To||{});const dte={clicks:"Clicks",impressions:"Impressions",ctr:"CTR",position:"Position"},Km={clicks:"Clicks",impressions:"Impr",ctr:"CTR",position:"Pos"},fte=rk;function hte(e){const t=[];if(e.message&&t.push(e.message),e.providers)for(const[n,r]of Object.entries(e.providers)){const i=`[${n}] ${r.message}`;r.raw!==void 0?t.push(`${i}
|
|
48
|
-
|
|
49
|
-
${JSON.stringify(r.raw,null,2)}`):t.push(i)}return t.length>0?t.join(`
|
|
50
|
-
|
|
51
|
-
`):"Run failed."}function Pv(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function aa(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function J2(e){return e===null?"Unknown":e?"Pass":"Fail"}function Jj(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function pte(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function mte(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 Sw(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 ${Jj(l)} · ${r}`}const a=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(a){const l={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},u=a[2]?parseInt(a[2]):6;return`Every ${l[a[1]]} at ${Jj(u)} · ${r}`}return`${e} · ${r}`}function dy(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function R$(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 gte(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 yte(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function vte(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function Ho(e){const t=[e.detail,e.hint].filter(Boolean);return t.length>0?t.join(`
|
|
52
|
-
`):void 0}function xte(e,t,n){return e.map(r=>{if(r.id==="api")return{...r,tone:dy(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(r.id==="worker")return{...r,tone:dy(t.workerStatus),detail:t.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:t.workerStatus.detail};const i=n.providerStatuses.filter(d=>d.state==="ready").length,a=n.providerStatuses.length,l=i>0,u=n.providerStatuses.filter(d=>d.state==="ready").map(d=>vte(d)).join(" · ");return{...r,label:"Providers",tone:l?"positive":"caution",detail:`${i} of ${a} configured`,meta:u||"None configured"}})}function bte(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 wte(e,t,n){const r=bte(t,n),i=structuredClone(e);return i.healthChecks=i.healthChecks.map(a=>{if(a.id==="api")return{...a,detail:t.apiStatus.detail,state:t.apiStatus.state==="ok"?"ready":"attention"};if(a.id==="worker")return{...a,detail:t.workerStatus.detail,state:t.workerStatus.state==="ok"?"ready":"attention"};const l=n.providerStatuses.some(u=>u.state==="ready");return{...a,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}const D$="canonry.run-tracker",e1=new Set;let eP=!1,Ste=0,Tv={runs:{},batches:{}};function jte(){const e=tc();for(const t of e1)t(e)}function Nte(e){if(!e)return{runs:{},batches:{}};try{const t=JSON.parse(e);return{runs:t.runs??{},batches:t.batches??{}}}catch{return{runs:{},batches:{}}}}function kte(){typeof window>"u"||window.sessionStorage.setItem(D$,JSON.stringify(Tv))}function M$(){eP||(eP=!0,!(typeof window>"u")&&(Tv=Nte(window.sessionStorage.getItem(D$))))}function Rv(e){Tv=e,kte(),jte()}function tc(){return M$(),Tv}function Cte(e){return M$(),e1.add(e),()=>{e1.delete(e)}}function I$(e){const t=tc();Rv({...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 tP(e){const t=tc();if(!t.runs[e])return;const{[e]:n,...r}=t.runs;Rv({...t,runs:r})}function Ate(e){const t=tc(),n=`batch_${Date.now()}_${++Ste}`;return Rv({...t,batches:{...t.batches,[n]:{batchId:n,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),n}function Ote(e){const t=tc();if(!t.batches[e])return;const{[e]:n,...r}=t.batches;Rv({...t,batches:r})}function ok(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}function Ete(e,t){let n=0,r=0,i=0,a=0,l=0;for(const u of e){const d=t[u]?.status;d==="completed"?n+=1:d==="partial"?r+=1:d==="failed"?i+=1:d==="cancelled"?a+=1:l+=1}return{completed:n,partial:r,failed:i,cancelled:a,pending:l,finished:l===0}}function nP(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function lk(...e){return t=>{let n=!1;const r=e.map(i=>{const a=nP(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():nP(e[i],null)}}}}function xc(...e){return x.useCallback(lk(...e),e)}var _te=Symbol.for("react.lazy"),fy=xv[" use ".trim().toString()];function zte(e){return typeof e=="object"&&e!==null&&"then"in e}function L$(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===_te&&"_payload"in e&&zte(e._payload)}function Pte(e){const t=Rte(e),n=x.forwardRef((r,i)=>{let{children:a,...l}=r;L$(a)&&typeof fy=="function"&&(a=fy(a._payload));const u=x.Children.toArray(a),d=u.find(Mte);if(d){const f=d.props.children,p=u.map(m=>m===d?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:m);return o.jsx(t,{...l,ref:i,children:x.isValidElement(f)?x.cloneElement(f,void 0,p):null})}return o.jsx(t,{...l,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}var Tte=Pte("Slot");function Rte(e){const t=x.forwardRef((n,r)=>{let{children:i,...a}=n;if(L$(i)&&typeof fy=="function"&&(i=fy(i._payload)),x.isValidElement(i)){const l=Lte(i),u=Ite(a,i.props);return i.type!==x.Fragment&&(u.ref=r?lk(r,l):l),x.cloneElement(i,u)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Dte=Symbol("radix.slottable");function Mte(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Dte}function Ite(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...u)=>{const d=a(...u);return i(...u),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function Lte(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 $$(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=$$(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function At(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=$$(e))&&(r&&(r+=" "),r+=t);return r}const rP=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,iP=At,B$=(e,t)=>n=>{var r;if(t?.variants==null)return iP(e,n?.class,n?.className);const{variants:i,defaultVariants:a}=t,l=Object.keys(i).map(f=>{const p=n?.[f],m=a?.[f];if(p===null)return null;const g=rP(p)||rP(m);return i[f][g]}),u=n&&Object.entries(n).reduce((f,p)=>{let[m,g]=p;return g===void 0||(f[m]=g),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,p)=>{let{class:m,className:g,...v}=p;return Object.entries(v).every(S=>{let[b,j]=S;return Array.isArray(j)?j.includes({...a,...u}[b]):{...a,...u}[b]===j})?[...f,m,g]:f},[]);return iP(e,l,d,n?.class,n?.className)},$te=(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},Bte=(e,t)=>({classGroupId:e,validator:t}),U$=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),hy="-",aP=[],Ute="arbitrary..",qte=e=>{const t=Hte(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return Fte(l);const u=l.split(hy),d=u[0]===""&&u.length>1?1:0;return q$(u,d,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const d=r[l],f=n[l];return d?f?$te(f,d):d:f||aP}return n[l]||aP}}},q$=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const f=q$(e,t+1,a);if(f)return f}const l=n.validators;if(l===null)return;const u=t===0?e.join(hy):e.slice(t).join(hy),d=l.length;for(let f=0;f<d;f++){const p=l[f];if(p.validator(u))return p.classGroupId}},Fte=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?Ute+r:void 0})(),Hte=e=>{const{theme:t,classGroups:n}=e;return Kte(n,t)},Kte=(e,t)=>{const n=U$();for(const r in e){const i=e[r];ck(i,n,r,t)}return n},ck=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const l=e[a];Gte(l,t,n,r)}},Gte=(e,t,n,r)=>{if(typeof e=="string"){Vte(e,t,n);return}if(typeof e=="function"){Qte(e,t,n,r);return}Yte(e,t,n,r)},Vte=(e,t,n)=>{const r=e===""?t:F$(t,e);r.classGroupId=n},Qte=(e,t,n,r)=>{if(Wte(e)){ck(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Bte(n,e))},Yte=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let l=0;l<a;l++){const[u,d]=i[l];ck(d,F$(t,u),n,r)}},F$=(e,t)=>{let n=e;const r=t.split(hy),i=r.length;for(let a=0;a<i;a++){const l=r[a];let u=n.nextPart.get(l);u||(u=U$(),n.nextPart.set(l,u)),n=u}return n},Wte=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Zte=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(a,l)=>{n[a]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let l=n[a];if(l!==void 0)return l;if((l=r[a])!==void 0)return i(a,l),l},set(a,l){a in n?n[a]=l:i(a,l)}}},t1="!",sP=":",Xte=[],oP=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Jte=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let l=0,u=0,d=0,f;const p=i.length;for(let b=0;b<p;b++){const j=i[b];if(l===0&&u===0){if(j===sP){a.push(i.slice(d,b)),d=b+1;continue}if(j==="/"){f=b;continue}}j==="["?l++:j==="]"?l--:j==="("?u++:j===")"&&u--}const m=a.length===0?i:i.slice(d);let g=m,v=!1;m.endsWith(t1)?(g=m.slice(0,-1),v=!0):m.startsWith(t1)&&(g=m.slice(1),v=!0);const S=f&&f>d?f-d:void 0;return oP(a,v,g,S)};if(t){const i=t+sP,a=r;r=l=>l.startsWith(i)?a(l.slice(i.length)):oP(Xte,!1,l,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},ene=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let a=0;a<n.length;a++){const l=n[a],u=l[0]==="[",d=t.has(l);u||d?(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}},tne=e=>({cache:Zte(e.cacheSize),parseClassName:Jte(e),sortModifiers:ene(e),...qte(e)}),nne=/\s+/,rne=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,l=[],u=e.trim().split(nne);let d="";for(let f=u.length-1;f>=0;f-=1){const p=u[f],{isExternal:m,modifiers:g,hasImportantModifier:v,baseClassName:S,maybePostfixModifierPosition:b}=n(p);if(m){d=p+(d.length>0?" "+d:d);continue}let j=!!b,k=r(j?S.substring(0,b):S);if(!k){if(!j){d=p+(d.length>0?" "+d:d);continue}if(k=r(S),!k){d=p+(d.length>0?" "+d:d);continue}j=!1}const E=g.length===0?"":g.length===1?g[0]:a(g).join(":"),C=v?E+t1:E,A=C+k;if(l.indexOf(A)>-1)continue;l.push(A);const P=i(k,j);for(let O=0;O<P.length;++O){const _=P[O];l.push(C+_)}d=p+(d.length>0?" "+d:d)}return d},ine=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=H$(n))&&(i&&(i+=" "),i+=r);return i},H$=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=H$(e[r]))&&(n&&(n+=" "),n+=t);return n},ane=(e,...t)=>{let n,r,i,a;const l=d=>{const f=t.reduce((p,m)=>m(p),e());return n=tne(f),r=n.cache.get,i=n.cache.set,a=u,u(d)},u=d=>{const f=r(d);if(f)return f;const p=rne(d,n);return i(d,p),p};return a=l,(...d)=>a(ine(...d))},sne=[],Hn=e=>{const t=n=>n[e]||sne;return t.isThemeGetter=!0,t},K$=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,G$=/^\((?:(\w[\w-]*):)?(.+)\)$/i,one=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,lne=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,cne=/\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$/,une=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,dne=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fne=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,bo=e=>one.test(e),ft=e=>!!e&&!Number.isNaN(Number(e)),wo=e=>!!e&&Number.isInteger(Number(e)),jw=e=>e.endsWith("%")&&ft(e.slice(0,-1)),xs=e=>lne.test(e),V$=()=>!0,hne=e=>cne.test(e)&&!une.test(e),uk=()=>!1,pne=e=>dne.test(e),mne=e=>fne.test(e),gne=e=>!Ie(e)&&!Le(e),yne=e=>Zo(e,W$,uk),Ie=e=>K$.test(e),Nl=e=>Zo(e,Z$,hne),lP=e=>Zo(e,kne,ft),vne=e=>Zo(e,J$,V$),xne=e=>Zo(e,X$,uk),cP=e=>Zo(e,Q$,uk),bne=e=>Zo(e,Y$,mne),Gm=e=>Zo(e,e4,pne),Le=e=>G$.test(e),Df=e=>bc(e,Z$),wne=e=>bc(e,X$),uP=e=>bc(e,Q$),Sne=e=>bc(e,W$),jne=e=>bc(e,Y$),Vm=e=>bc(e,e4,!0),Nne=e=>bc(e,J$,!0),Zo=(e,t,n)=>{const r=K$.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},bc=(e,t,n=!1)=>{const r=G$.exec(e);return r?r[1]?t(r[1]):n:!1},Q$=e=>e==="position"||e==="percentage",Y$=e=>e==="image"||e==="url",W$=e=>e==="length"||e==="size"||e==="bg-size",Z$=e=>e==="length",kne=e=>e==="number",X$=e=>e==="family-name",J$=e=>e==="number"||e==="weight",e4=e=>e==="shadow",Cne=()=>{const e=Hn("color"),t=Hn("font"),n=Hn("text"),r=Hn("font-weight"),i=Hn("tracking"),a=Hn("leading"),l=Hn("breakpoint"),u=Hn("container"),d=Hn("spacing"),f=Hn("radius"),p=Hn("shadow"),m=Hn("inset-shadow"),g=Hn("text-shadow"),v=Hn("drop-shadow"),S=Hn("blur"),b=Hn("perspective"),j=Hn("aspect"),k=Hn("ease"),E=Hn("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],P=()=>[...A(),Le,Ie],O=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],T=()=>[Le,Ie,d],$=()=>[bo,"full","auto",...T()],F=()=>[wo,"none","subgrid",Le,Ie],U=()=>["auto",{span:["full",wo,Le,Ie]},wo,Le,Ie],B=()=>[wo,"auto",Le,Ie],V=()=>["auto","min","max","fr",Le,Ie],X=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Z=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...T()],J=()=>[bo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],oe=()=>[bo,"screen","full","dvw","lvw","svw","min","max","fit",...T()],ye=()=>[bo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],I=()=>[e,Le,Ie],M=()=>[...A(),uP,cP,{position:[Le,Ie]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",Sne,yne,{size:[Le,Ie]}],G=()=>[jw,Df,Nl],se=()=>["","none","full",f,Le,Ie],ne=()=>["",ft,Df,Nl],Ce=()=>["solid","dashed","dotted","double"],je=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[ft,jw,uP,cP],pe=()=>["","none",S,Le,Ie],Ee=()=>["none",ft,Le,Ie],W=()=>["none",ft,Le,Ie],He=()=>[ft,Le,Ie],Te=()=>[bo,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[xs],breakpoint:[xs],color:[V$],container:[xs],"drop-shadow":[xs],ease:["in","out","in-out"],font:[gne],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[xs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[xs],shadow:[xs],spacing:["px",ft],text:[xs],"text-shadow":[xs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",bo,Ie,Le,j]}],container:["container"],columns:[{columns:[ft,Ie,Le,u]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:P()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{"inset-s":$(),start:$()}],end:[{"inset-e":$(),end:$()}],"inset-bs":[{"inset-bs":$()}],"inset-be":[{"inset-be":$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[wo,"auto",Le,Ie]}],basis:[{basis:[bo,"full","auto",u,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ft,bo,"auto","initial","none",Ie]}],grow:[{grow:["",ft,Le,Ie]}],shrink:[{shrink:["",ft,Le,Ie]}],order:[{order:[wo,"first","last","none",Le,Ie]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...X(),"normal"]}],"justify-items":[{"justify-items":[...Z(),"normal"]}],"justify-self":[{"justify-self":["auto",...Z()]}],"align-content":[{content:["normal",...X()]}],"align-items":[{items:[...Z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Z(),{baseline:["","last"]}]}],"place-content":[{"place-content":X()}],"place-items":[{"place-items":[...Z(),"baseline"]}],"place-self":[{"place-self":["auto",...Z()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],"inline-size":[{inline:["auto",...oe()]}],"min-inline-size":[{"min-inline":["auto",...oe()]}],"max-inline-size":[{"max-inline":["none",...oe()]}],"block-size":[{block:["auto",...ye()]}],"min-block-size":[{"min-block":["auto",...ye()]}],"max-block-size":[{"max-block":["none",...ye()]}],w:[{w:[u,"screen",...J()]}],"min-w":[{"min-w":[u,"screen","none",...J()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh",...J()]}],"font-size":[{text:["base",n,Df,Nl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Nne,vne]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",jw,Ie]}],"font-family":[{font:[wne,xne,t]}],"font-features":[{"font-features":[Ie]}],"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,Le,Ie]}],"line-clamp":[{"line-clamp":[ft,"none",Le,lP]}],leading:[{leading:[a,...T()]}],"list-image":[{"list-image":["none",Le,Ie]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Le,Ie]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[ft,"from-font","auto",Le,Nl]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[ft,"auto",Le,Ie]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Le,Ie]}],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",Le,Ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:M()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},wo,Le,Ie],radial:["",Le,Ie],conic:[wo,Le,Ie]},jne,bne]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ce(),"hidden","none"]}],"divide-style":[{divide:[...Ce(),"hidden","none"]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...Ce(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ft,Le,Ie]}],"outline-w":[{outline:["",ft,Df,Nl]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","none",p,Vm,Gm]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",m,Vm,Gm]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[ft,Nl]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",g,Vm,Gm]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[ft,Le,Ie]}],"mix-blend":[{"mix-blend":[...je(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":je()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ft]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[Le,Ie]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"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":A()}],"mask-image-conic-pos":[{"mask-conic":[ft]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:M()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Le,Ie]}],filter:[{filter:["","none",Le,Ie]}],blur:[{blur:pe()}],brightness:[{brightness:[ft,Le,Ie]}],contrast:[{contrast:[ft,Le,Ie]}],"drop-shadow":[{"drop-shadow":["","none",v,Vm,Gm]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",ft,Le,Ie]}],"hue-rotate":[{"hue-rotate":[ft,Le,Ie]}],invert:[{invert:["",ft,Le,Ie]}],saturate:[{saturate:[ft,Le,Ie]}],sepia:[{sepia:["",ft,Le,Ie]}],"backdrop-filter":[{"backdrop-filter":["","none",Le,Ie]}],"backdrop-blur":[{"backdrop-blur":pe()}],"backdrop-brightness":[{"backdrop-brightness":[ft,Le,Ie]}],"backdrop-contrast":[{"backdrop-contrast":[ft,Le,Ie]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ft,Le,Ie]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ft,Le,Ie]}],"backdrop-invert":[{"backdrop-invert":["",ft,Le,Ie]}],"backdrop-opacity":[{"backdrop-opacity":[ft,Le,Ie]}],"backdrop-saturate":[{"backdrop-saturate":[ft,Le,Ie]}],"backdrop-sepia":[{"backdrop-sepia":["",ft,Le,Ie]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Le,Ie]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ft,"initial",Le,Ie]}],ease:[{ease:["linear","initial",k,Le,Ie]}],delay:[{delay:[ft,Le,Ie]}],animate:[{animate:["none",E,Le,Ie]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,Le,Ie]}],"perspective-origin":[{"perspective-origin":P()}],rotate:[{rotate:Ee()}],"rotate-x":[{"rotate-x":Ee()}],"rotate-y":[{"rotate-y":Ee()}],"rotate-z":[{"rotate-z":Ee()}],scale:[{scale:W()}],"scale-x":[{"scale-x":W()}],"scale-y":[{"scale-y":W()}],"scale-z":[{"scale-z":W()}],"scale-3d":["scale-3d"],skew:[{skew:He()}],"skew-x":[{"skew-x":He()}],"skew-y":[{"skew-y":He()}],transform:[{transform:[Le,Ie,"","none","gpu","cpu"]}],"transform-origin":[{origin:P()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Te()}],"translate-x":[{"translate-x":Te()}],"translate-y":[{"translate-y":Te()}],"translate-z":[{"translate-z":Te()}],"translate-none":["translate-none"],accent:[{accent:I()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:I()}],"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",Le,Ie]}],"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":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",Le,Ie]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[ft,Df,Nl,lP]}],stroke:[{stroke:["none",...I()]}],"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"]}},Ane=ane(Cne);function Yi(...e){return Ane(At(e))}const One=B$("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"}}),be=x.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>{const l=r?Tte:"button";return o.jsx(l,{ref:a,className:Yi(One({variant:t,size:n,className:e})),...i})});be.displayName="Button";const Ene=B$("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 t4({className:e,variant:t,...n}){return o.jsx("div",{className:Yi(Ene({variant:t}),e),...n})}function dP({compact:e=!1,version:t}){const n=!e&&t&&t!=="unknown";return o.jsxs(Zt,{to:"/",className:`brand-lockup ${e?"brand-lockup-compact":""}`,"aria-label":"Canonry home",children:[o.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"}),o.jsxs("span",{className:"brand-copy",children:[o.jsx("span",{className:"brand-mark",children:"Canonry"}),n?o.jsxs("span",{className:"brand-version",children:["v",t]}):null]})]})}function nc({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 o.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 Xe({tone:e,children:t,...n}){const r=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return o.jsx(t4,{variant:r,...n,children:t})}function Dv({status:e}){return o.jsx(Xe,{tone:R$(e),children:Pv(e)})}function Lo(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function _ne(e,t){const n=x.createContext(t),r=a=>{const{children:l,...u}=a,d=x.useMemo(()=>u,Object.values(u));return o.jsx(n.Provider,{value:d,children:l})};r.displayName=e+"Provider";function i(a){const l=x.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,i]}function zne(e,t=[]){let n=[];function r(a,l){const u=x.createContext(l),d=n.length;n=[...n,l];const f=m=>{const{scope:g,children:v,...S}=m,b=g?.[e]?.[d]||u,j=x.useMemo(()=>S,Object.values(S));return o.jsx(b.Provider,{value:j,children:v})};f.displayName=a+"Provider";function p(m,g){const v=g?.[e]?.[d]||u,S=x.useContext(v);if(S)return S;if(l!==void 0)return l;throw new Error(`\`${m}\` must be used within \`${a}\``)}return[f,p]}const i=()=>{const a=n.map(l=>x.createContext(l));return function(u){const d=u?.[e]||a;return x.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return i.scopeName=e,[r,Pne(i,...t)]}function Pne(...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(a){const l=r.reduce((u,{useScope:d,scopeName:f})=>{const m=d(a)[`__scope${f}`];return{...u,...m}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var jh=globalThis?.document?x.useLayoutEffect:()=>{},Tne=xv[" useId ".trim().toString()]||(()=>{}),Rne=0;function Nw(e){const[t,n]=x.useState(Tne());return jh(()=>{n(r=>r??String(Rne++))},[e]),e||(t?`radix-${t}`:"")}var Dne=xv[" useInsertionEffect ".trim().toString()]||jh;function Mne({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,l]=Ine({defaultProp:t,onChange:n}),u=e!==void 0,d=u?e:i;{const p=x.useRef(e!==void 0);x.useEffect(()=>{const m=p.current;m!==u&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=u},[u,r])}const f=x.useCallback(p=>{if(u){const m=Lne(p)?p(e):p;m!==e&&l.current?.(m)}else a(p)},[u,e,a,l]);return[d,f]}function Ine({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),i=x.useRef(n),a=x.useRef(t);return Dne(()=>{a.current=t},[t]),x.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Lne(e){return typeof e=="function"}function n4(e){const t=$ne(e),n=x.forwardRef((r,i)=>{const{children:a,...l}=r,u=x.Children.toArray(a),d=u.find(Une);if(d){const f=d.props.children,p=u.map(m=>m===d?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:m);return o.jsx(t,{...l,ref:i,children:x.isValidElement(f)?x.cloneElement(f,void 0,p):null})}return o.jsx(t,{...l,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}function $ne(e){const t=x.forwardRef((n,r)=>{const{children:i,...a}=n;if(x.isValidElement(i)){const l=Fne(i),u=qne(a,i.props);return i.type!==x.Fragment&&(u.ref=r?lk(r,l):l),x.cloneElement(i,u)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Bne=Symbol("radix.slottable");function Une(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Bne}function qne(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...u)=>{const d=a(...u);return i(...u),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function Fne(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 Hne=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ls=Hne.reduce((e,t)=>{const n=n4(`Primitive.${t}`),r=x.forwardRef((i,a)=>{const{asChild:l,...u}=i,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(d,{...u,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Kne(e,t){e&&gc.flushSync(()=>e.dispatchEvent(t))}function Nh(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>t.current?.(...n),[])}function Gne(e,t=globalThis?.document){const n=Nh(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 Vne="DismissableLayer",n1="dismissableLayer.update",Qne="dismissableLayer.pointerDownOutside",Yne="dismissableLayer.focusOutside",fP,r4=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),i4=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:l,onDismiss:u,...d}=e,f=x.useContext(r4),[p,m]=x.useState(null),g=p?.ownerDocument??globalThis?.document,[,v]=x.useState({}),S=xc(t,_=>m(_)),b=Array.from(f.layers),[j]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),k=b.indexOf(j),E=p?b.indexOf(p):-1,C=f.layersWithOutsidePointerEventsDisabled.size>0,A=E>=k,P=Xne(_=>{const T=_.target,$=[...f.branches].some(F=>F.contains(T));!A||$||(i?.(_),l?.(_),_.defaultPrevented||u?.())},g),O=Jne(_=>{const T=_.target;[...f.branches].some(F=>F.contains(T))||(a?.(_),l?.(_),_.defaultPrevented||u?.())},g);return Gne(_=>{E===f.layers.size-1&&(r?.(_),!_.defaultPrevented&&u&&(_.preventDefault(),u()))},g),x.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(fP=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),hP(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=fP)}},[p,g,n,f]),x.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),hP())},[p,f]),x.useEffect(()=>{const _=()=>v({});return document.addEventListener(n1,_),()=>document.removeEventListener(n1,_)},[]),o.jsx(Ls.div,{...d,ref:S,style:{pointerEvents:C?A?"auto":"none":void 0,...e.style},onFocusCapture:Lo(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Lo(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Lo(e.onPointerDownCapture,P.onPointerDownCapture)})});i4.displayName=Vne;var Wne="DismissableLayerBranch",Zne=x.forwardRef((e,t)=>{const n=x.useContext(r4),r=x.useRef(null),i=xc(t,r);return x.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),o.jsx(Ls.div,{...e,ref:i})});Zne.displayName=Wne;function Xne(e,t=globalThis?.document){const n=Nh(e),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const a=u=>{if(u.target&&!r.current){let d=function(){a4(Qne,n,f,{discrete:!0})};const f={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=d,t.addEventListener("click",i.current,{once:!0})):d()}else t.removeEventListener("click",i.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Jne(e,t=globalThis?.document){const n=Nh(e),r=x.useRef(!1);return x.useEffect(()=>{const i=a=>{a.target&&!r.current&&a4(Yne,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function hP(){const e=new CustomEvent(n1);document.dispatchEvent(e)}function a4(e,t,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Kne(i,a):i.dispatchEvent(a)}var kw="focusScope.autoFocusOnMount",Cw="focusScope.autoFocusOnUnmount",pP={bubbles:!1,cancelable:!0},ere="FocusScope",s4=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...l}=e,[u,d]=x.useState(null),f=Nh(i),p=Nh(a),m=x.useRef(null),g=xc(t,b=>d(b)),v=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let b=function(C){if(v.paused||!u)return;const A=C.target;u.contains(A)?m.current=A:No(m.current,{select:!0})},j=function(C){if(v.paused||!u)return;const A=C.relatedTarget;A!==null&&(u.contains(A)||No(m.current,{select:!0}))},k=function(C){if(document.activeElement===document.body)for(const P of C)P.removedNodes.length>0&&No(u)};document.addEventListener("focusin",b),document.addEventListener("focusout",j);const E=new MutationObserver(k);return u&&E.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",j),E.disconnect()}}},[r,u,v.paused]),x.useEffect(()=>{if(u){gP.add(v);const b=document.activeElement;if(!u.contains(b)){const k=new CustomEvent(kw,pP);u.addEventListener(kw,f),u.dispatchEvent(k),k.defaultPrevented||(tre(sre(o4(u)),{select:!0}),document.activeElement===b&&No(u))}return()=>{u.removeEventListener(kw,f),setTimeout(()=>{const k=new CustomEvent(Cw,pP);u.addEventListener(Cw,p),u.dispatchEvent(k),k.defaultPrevented||No(b??document.body,{select:!0}),u.removeEventListener(Cw,p),gP.remove(v)},0)}}},[u,f,p,v]);const S=x.useCallback(b=>{if(!n&&!r||v.paused)return;const j=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,k=document.activeElement;if(j&&k){const E=b.currentTarget,[C,A]=nre(E);C&&A?!b.shiftKey&&k===A?(b.preventDefault(),n&&No(C,{select:!0})):b.shiftKey&&k===C&&(b.preventDefault(),n&&No(A,{select:!0})):k===E&&b.preventDefault()}},[n,r,v.paused]);return o.jsx(Ls.div,{tabIndex:-1,...l,ref:g,onKeyDown:S})});s4.displayName=ere;function tre(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(No(r,{select:t}),document.activeElement!==n)return}function nre(e){const t=o4(e),n=mP(t,e),r=mP(t.reverse(),e);return[n,r]}function o4(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 mP(e,t){for(const n of e)if(!rre(n,{upTo:t}))return n}function rre(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 ire(e){return e instanceof HTMLInputElement&&"select"in e}function No(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ire(e)&&t&&e.select()}}var gP=are();function are(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=yP(e,t),e.unshift(t)},remove(t){e=yP(e,t),e[0]?.resume()}}}function yP(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function sre(e){return e.filter(t=>t.tagName!=="A")}var ore="Portal",l4=x.forwardRef((e,t)=>{const{container:n,...r}=e,[i,a]=x.useState(!1);jh(()=>a(!0),[]);const l=n||i&&globalThis?.document?.body;return l?dG.createPortal(o.jsx(Ls.div,{...r,ref:t}),l):null});l4.displayName=ore;function lre(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var Mv=e=>{const{present:t,children:n}=e,r=cre(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),a=xc(r.ref,ure(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:a}):null};Mv.displayName="Presence";function cre(e){const[t,n]=x.useState(),r=x.useRef(null),i=x.useRef(e),a=x.useRef("none"),l=e?"mounted":"unmounted",[u,d]=lre(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const f=Qm(r.current);a.current=u==="mounted"?f:"none"},[u]),jh(()=>{const f=r.current,p=i.current;if(p!==e){const g=a.current,v=Qm(f);e?d("MOUNT"):v==="none"||f?.display==="none"?d("UNMOUNT"):d(p&&g!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),jh(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,m=v=>{const b=Qm(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&b&&(d("ANIMATION_END"),!i.current)){const j=t.style.animationFillMode;t.style.animationFillMode="forwards",f=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=j)})}},g=v=>{v.target===t&&(a.current=Qm(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:x.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Qm(e){return e?.animationName||"none"}function ure(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 Aw=0;function dre(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??vP()),document.body.insertAdjacentElement("beforeend",e[1]??vP()),Aw++,()=>{Aw===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Aw--}},[])}function vP(){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 Ra=function(){return Ra=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Ra.apply(this,arguments)};function c4(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 fre(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Dg="right-scroll-bar-position",Mg="width-before-scroll-bar",hre="with-scroll-bars-hidden",pre="--removed-body-scroll-bar-size";function Ow(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function mre(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 gre=typeof window<"u"?x.useLayoutEffect:x.useEffect,xP=new WeakMap;function yre(e,t){var n=mre(null,function(r){return e.forEach(function(i){return Ow(i,r)})});return gre(function(){var r=xP.get(n);if(r){var i=new Set(r),a=new Set(e),l=n.current;i.forEach(function(u){a.has(u)||Ow(u,null)}),a.forEach(function(u){i.has(u)||Ow(u,l)})}xP.set(n,e)},[e]),n}function vre(e){return e}function xre(e,t){t===void 0&&(t=vre);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(a){var l=t(a,r);return n.push(l),function(){n=n.filter(function(u){return u!==l})}},assignSyncMedium:function(a){for(r=!0;n.length;){var l=n;n=[],l.forEach(a)}n={push:function(u){return a(u)},filter:function(){return n}}},assignMedium:function(a){r=!0;var l=[];if(n.length){var u=n;n=[],u.forEach(a),l=n}var d=function(){var p=l;l=[],p.forEach(a)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(p){l.push(p),f()},filter:function(p){return l=l.filter(p),n}}}};return i}function bre(e){e===void 0&&(e={});var t=xre(null);return t.options=Ra({async:!0,ssr:!1},e),t}var u4=function(e){var t=e.sideCar,n=c4(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,Ra({},n))};u4.isSideCarExport=!0;function wre(e,t){return e.useMedium(t),u4}var d4=bre(),Ew=function(){},Iv=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:Ew,onWheelCapture:Ew,onTouchMoveCapture:Ew}),i=r[0],a=r[1],l=e.forwardProps,u=e.children,d=e.className,f=e.removeScrollBar,p=e.enabled,m=e.shards,g=e.sideCar,v=e.noRelative,S=e.noIsolation,b=e.inert,j=e.allowPinchZoom,k=e.as,E=k===void 0?"div":k,C=e.gapMode,A=c4(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=g,O=yre([n,t]),_=Ra(Ra({},A),i);return x.createElement(x.Fragment,null,p&&x.createElement(P,{sideCar:d4,removeScrollBar:f,shards:m,noRelative:v,noIsolation:S,inert:b,setCallbacks:a,allowPinchZoom:!!j,lockRef:n,gapMode:C}),l?x.cloneElement(x.Children.only(u),Ra(Ra({},_),{ref:O})):x.createElement(E,Ra({},_,{className:d,ref:O}),u))});Iv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Iv.classNames={fullWidth:Mg,zeroRight:Dg};var Sre=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function jre(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Sre();return t&&e.setAttribute("nonce",t),e}function Nre(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function kre(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Cre=function(){var e=0,t=null;return{add:function(n){e==0&&(t=jre())&&(Nre(t,n),kre(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Are=function(){var e=Cre();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},f4=function(){var e=Are(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Ore={left:0,top:0,right:0,gap:0},_w=function(e){return parseInt(e||"",10)||0},Ere=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[_w(n),_w(r),_w(i)]},_re=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Ore;var t=Ere(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])}},zre=f4(),Lu="data-scroll-locked",Pre=function(e,t,n,r){var i=e.left,a=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
53
|
-
.`.concat(hre,` {
|
|
54
|
-
overflow: hidden `).concat(r,`;
|
|
55
|
-
padding-right: `).concat(u,"px ").concat(r,`;
|
|
56
|
-
}
|
|
57
|
-
body[`).concat(Lu,`] {
|
|
58
|
-
overflow: hidden `).concat(r,`;
|
|
59
|
-
overscroll-behavior: contain;
|
|
60
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
61
|
-
padding-left: `.concat(i,`px;
|
|
62
|
-
padding-top: `).concat(a,`px;
|
|
63
|
-
padding-right: `).concat(l,`px;
|
|
64
|
-
margin-left:0;
|
|
65
|
-
margin-top:0;
|
|
66
|
-
margin-right: `).concat(u,"px ").concat(r,`;
|
|
67
|
-
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.`).concat(Dg,` {
|
|
71
|
-
right: `).concat(u,"px ").concat(r,`;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.`).concat(Mg,` {
|
|
75
|
-
margin-right: `).concat(u,"px ").concat(r,`;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.`).concat(Dg," .").concat(Dg,` {
|
|
79
|
-
right: 0 `).concat(r,`;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.`).concat(Mg," .").concat(Mg,` {
|
|
83
|
-
margin-right: 0 `).concat(r,`;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
body[`).concat(Lu,`] {
|
|
87
|
-
`).concat(pre,": ").concat(u,`px;
|
|
88
|
-
}
|
|
89
|
-
`)},bP=function(){var e=parseInt(document.body.getAttribute(Lu)||"0",10);return isFinite(e)?e:0},Tre=function(){x.useEffect(function(){return document.body.setAttribute(Lu,(bP()+1).toString()),function(){var e=bP()-1;e<=0?document.body.removeAttribute(Lu):document.body.setAttribute(Lu,e.toString())}},[])},Rre=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;Tre();var a=x.useMemo(function(){return _re(i)},[i]);return x.createElement(zre,{styles:Pre(a,!t,i,n?"":"!important")})},r1=!1;if(typeof window<"u")try{var Ym=Object.defineProperty({},"passive",{get:function(){return r1=!0,!0}});window.addEventListener("test",Ym,Ym),window.removeEventListener("test",Ym,Ym)}catch{r1=!1}var cu=r1?{passive:!1}:!1,Dre=function(e){return e.tagName==="TEXTAREA"},h4=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Dre(e)&&n[t]==="visible")},Mre=function(e){return h4(e,"overflowY")},Ire=function(e){return h4(e,"overflowX")},wP=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=p4(e,r);if(i){var a=m4(e,r),l=a[1],u=a[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Lre=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},$re=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},p4=function(e,t){return e==="v"?Mre(t):Ire(t)},m4=function(e,t){return e==="v"?Lre(t):$re(t)},Bre=function(e,t){return e==="h"&&t==="rtl"?-1:1},Ure=function(e,t,n,r,i){var a=Bre(e,window.getComputedStyle(t).direction),l=a*r,u=n.target,d=t.contains(u),f=!1,p=l>0,m=0,g=0;do{if(!u)break;var v=m4(e,u),S=v[0],b=v[1],j=v[2],k=b-j-a*S;(S||k)&&p4(e,u)&&(m+=k,g+=S);var E=u.parentNode;u=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!d&&u!==document.body||d&&(t.contains(u)||t===u));return(p&&Math.abs(m)<1||!p&&Math.abs(g)<1)&&(f=!0),f},Wm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},SP=function(e){return[e.deltaX,e.deltaY]},jP=function(e){return e&&"current"in e?e.current:e},qre=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Fre=function(e){return`
|
|
90
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
91
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
92
|
-
`)},Hre=0,uu=[];function Kre(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(Hre++)[0],a=x.useState(f4)[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 b=fre([e.lockRef.current],(e.shards||[]).map(jP),!0).filter(Boolean);return b.forEach(function(j){return j.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),b.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=x.useCallback(function(b,j){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!l.current.allowPinchZoom;var k=Wm(b),E=n.current,C="deltaX"in b?b.deltaX:E[0]-k[0],A="deltaY"in b?b.deltaY:E[1]-k[1],P,O=b.target,_=Math.abs(C)>Math.abs(A)?"h":"v";if("touches"in b&&_==="h"&&O.type==="range")return!1;var T=window.getSelection(),$=T&&T.anchorNode,F=$?$===O||$.contains(O):!1;if(F)return!1;var U=wP(_,O);if(!U)return!0;if(U?P=_:(P=_==="v"?"h":"v",U=wP(_,O)),!U)return!1;if(!r.current&&"changedTouches"in b&&(C||A)&&(r.current=P),!P)return!0;var B=r.current||P;return Ure(B,j,b,B==="h"?C:A)},[]),d=x.useCallback(function(b){var j=b;if(!(!uu.length||uu[uu.length-1]!==a)){var k="deltaY"in j?SP(j):Wm(j),E=t.current.filter(function(P){return P.name===j.type&&(P.target===j.target||j.target===P.shadowParent)&&qre(P.delta,k)})[0];if(E&&E.should){j.cancelable&&j.preventDefault();return}if(!E){var C=(l.current.shards||[]).map(jP).filter(Boolean).filter(function(P){return P.contains(j.target)}),A=C.length>0?u(j,C[0]):!l.current.noIsolation;A&&j.cancelable&&j.preventDefault()}}},[]),f=x.useCallback(function(b,j,k,E){var C={name:b,delta:j,target:k,should:E,shadowParent:Gre(k)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(A){return A!==C})},1)},[]),p=x.useCallback(function(b){n.current=Wm(b),r.current=void 0},[]),m=x.useCallback(function(b){f(b.type,SP(b),b.target,u(b,e.lockRef.current))},[]),g=x.useCallback(function(b){f(b.type,Wm(b),b.target,u(b,e.lockRef.current))},[]);x.useEffect(function(){return uu.push(a),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:g}),document.addEventListener("wheel",d,cu),document.addEventListener("touchmove",d,cu),document.addEventListener("touchstart",p,cu),function(){uu=uu.filter(function(b){return b!==a}),document.removeEventListener("wheel",d,cu),document.removeEventListener("touchmove",d,cu),document.removeEventListener("touchstart",p,cu)}},[]);var v=e.removeScrollBar,S=e.inert;return x.createElement(x.Fragment,null,S?x.createElement(a,{styles:Fre(i)}):null,v?x.createElement(Rre,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Gre(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Vre=wre(d4,Kre);var g4=x.forwardRef(function(e,t){return x.createElement(Iv,Ra({},e,{ref:t,sideCar:Vre}))});g4.classNames=Iv.classNames;var Qre=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},du=new WeakMap,Zm=new WeakMap,Xm={},zw=0,y4=function(e){return e&&(e.host||y4(e.parentNode))},Yre=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=y4(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})},Wre=function(e,t,n,r){var i=Yre(t,Array.isArray(e)?e:[e]);Xm[n]||(Xm[n]=new WeakMap);var a=Xm[n],l=[],u=new Set,d=new Set(i),f=function(m){!m||u.has(m)||(u.add(m),f(m.parentNode))};i.forEach(f);var p=function(m){!m||d.has(m)||Array.prototype.forEach.call(m.children,function(g){if(u.has(g))p(g);else try{var v=g.getAttribute(r),S=v!==null&&v!=="false",b=(du.get(g)||0)+1,j=(a.get(g)||0)+1;du.set(g,b),a.set(g,j),l.push(g),b===1&&S&&Zm.set(g,!0),j===1&&g.setAttribute(n,"true"),S||g.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",g,k)}})};return p(t),u.clear(),zw++,function(){l.forEach(function(m){var g=du.get(m)-1,v=a.get(m)-1;du.set(m,g),a.set(m,v),g||(Zm.has(m)||m.removeAttribute(r),Zm.delete(m)),v||m.removeAttribute(n)}),zw--,zw||(du=new WeakMap,du=new WeakMap,Zm=new WeakMap,Xm={})}},Zre=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=Qre(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),Wre(r,i,n,"aria-hidden")):function(){return null}},Lv="Dialog",[v4]=zne(Lv),[Xre,ma]=v4(Lv),x4=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:l=!0}=e,u=x.useRef(null),d=x.useRef(null),[f,p]=Mne({prop:r,defaultProp:i??!1,onChange:a,caller:Lv});return o.jsx(Xre,{scope:t,triggerRef:u,contentRef:d,contentId:Nw(),titleId:Nw(),descriptionId:Nw(),open:f,onOpenChange:p,onOpenToggle:x.useCallback(()=>p(m=>!m),[p]),modal:l,children:n})};x4.displayName=Lv;var b4="DialogTrigger",Jre=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ma(b4,n),a=xc(t,i.triggerRef);return o.jsx(Ls.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":hk(i.open),...r,ref:a,onClick:Lo(e.onClick,i.onOpenToggle)})});Jre.displayName=b4;var dk="DialogPortal",[eie,w4]=v4(dk,{forceMount:void 0}),S4=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=ma(dk,t);return o.jsx(eie,{scope:t,forceMount:n,children:x.Children.map(r,l=>o.jsx(Mv,{present:n||a.open,children:o.jsx(l4,{asChild:!0,container:i,children:l})}))})};S4.displayName=dk;var py="DialogOverlay",j4=x.forwardRef((e,t)=>{const n=w4(py,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ma(py,e.__scopeDialog);return a.modal?o.jsx(Mv,{present:r||a.open,children:o.jsx(nie,{...i,ref:t})}):null});j4.displayName=py;var tie=n4("DialogOverlay.RemoveScroll"),nie=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ma(py,n);return o.jsx(g4,{as:tie,allowPinchZoom:!0,shards:[i.contentRef],children:o.jsx(Ls.div,{"data-state":hk(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),rc="DialogContent",N4=x.forwardRef((e,t)=>{const n=w4(rc,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ma(rc,e.__scopeDialog);return o.jsx(Mv,{present:r||a.open,children:a.modal?o.jsx(rie,{...i,ref:t}):o.jsx(iie,{...i,ref:t})})});N4.displayName=rc;var rie=x.forwardRef((e,t)=>{const n=ma(rc,e.__scopeDialog),r=x.useRef(null),i=xc(t,n.contentRef,r);return x.useEffect(()=>{const a=r.current;if(a)return Zre(a)},[]),o.jsx(k4,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Lo(e.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Lo(e.onPointerDownOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&a.preventDefault()}),onFocusOutside:Lo(e.onFocusOutside,a=>a.preventDefault())})}),iie=x.forwardRef((e,t)=>{const n=ma(rc,e.__scopeDialog),r=x.useRef(!1),i=x.useRef(!1);return o.jsx(k4,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||n.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=a.target;n.triggerRef.current?.contains(l)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),k4=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...l}=e,u=ma(rc,n),d=x.useRef(null),f=xc(t,d);return dre(),o.jsxs(o.Fragment,{children:[o.jsx(s4,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:o.jsx(i4,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":hk(u.open),...l,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),o.jsxs(o.Fragment,{children:[o.jsx(aie,{titleId:u.titleId}),o.jsx(oie,{contentRef:d,descriptionId:u.descriptionId})]})]})}),fk="DialogTitle",C4=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ma(fk,n);return o.jsx(Ls.h2,{id:i.titleId,...r,ref:t})});C4.displayName=fk;var A4="DialogDescription",O4=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ma(A4,n);return o.jsx(Ls.p,{id:i.descriptionId,...r,ref:t})});O4.displayName=A4;var E4="DialogClose",_4=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ma(E4,n);return o.jsx(Ls.button,{type:"button",...r,ref:t,onClick:Lo(e.onClick,()=>i.onOpenChange(!1))})});_4.displayName=E4;function hk(e){return e?"open":"closed"}var z4="DialogTitleWarning",[L_e,P4]=_ne(z4,{contentName:rc,titleName:fk,docsSlug:"dialog"}),aie=({titleId:e})=>{const t=P4(z4),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
93
|
-
|
|
94
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
95
|
-
|
|
96
|
-
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},sie="DialogDescriptionWarning",oie=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${P4(sie).contentName}}.`;return x.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},T4=x4,R4=S4,pk=j4,mk=N4,gk=C4,D4=O4,M4=_4;const lie=T4,cie=R4,I4=x.forwardRef(({className:e,...t},n)=>o.jsx(pk,{ref:n,className:Yi("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));I4.displayName=pk.displayName;const uie=400,die=1200,fie=720,L4=x.forwardRef(({className:e,children:t,...n},r)=>{const[i,a]=x.useState(fie),l=x.useRef(!1),u=x.useRef(0),d=x.useRef(0),f=x.useCallback(g=>{l.current=!0,u.current=g.clientX,d.current=i,g.target.setPointerCapture(g.pointerId),g.preventDefault()},[i]),p=x.useCallback(g=>{if(!l.current)return;const v=u.current-g.clientX,S=Math.min(die,Math.max(uie,d.current+v));a(S)},[]),m=x.useCallback(()=>{l.current=!1},[]);return o.jsxs(cie,{children:[o.jsx(I4,{}),o.jsxs(mk,{ref:r,className:Yi("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:[o.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:f,onPointerMove:p,onPointerUp:m}),t,o.jsxs(M4,{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:[o.jsx(Gh,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});L4.displayName=mk.displayName;const hie=({className:e,...t})=>o.jsx("div",{className:Yi("flex flex-col gap-1.5 pr-10",e),...t}),$4=x.forwardRef(({className:e,...t},n)=>o.jsx(gk,{ref:n,className:Yi("text-lg font-medium text-zinc-50",e),...t}));$4.displayName=gk.displayName;const B4=x.forwardRef(({className:e,...t},n)=>o.jsx(D4,{ref:n,className:Yi("text-sm text-zinc-500",e),...t}));B4.displayName=D4.displayName;function pie({title:e,subtitle:t,children:n,open:r,onClose:i}){return o.jsx(lie,{open:r,onOpenChange:a=>a?void 0:i(),children:o.jsxs(L4,{children:[o.jsxs(hie,{className:"drawer-head",children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),o.jsx($4,{id:"drawer-title",children:e}),o.jsx(B4,{className:"sr-only",children:t})]}),o.jsx("div",{className:"drawer-body",children:n})]})})}function hr({text:e}){const[t,n]=x.useState(null),r=x.useRef(null),i=x.useCallback(()=>{if(!r.current)return;const l=r.current.getBoundingClientRect();n({top:l.top,left:l.left+l.width/2})},[]),a=x.useCallback(()=>n(null),[]);return o.jsxs("span",{className:"info-tooltip-wrapper",onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,children:[o.jsxs("svg",{ref:r,className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),t!==null&&gc.createPortal(o.jsx("span",{role:"tooltip",style:{position:"fixed",top:t.top,left:t.left,transform:"translateX(-50%) translateY(calc(-100% - 8px))",zIndex:9999,pointerEvents:"none",width:"14rem",padding:"0.5rem 0.75rem",fontSize:"11px",fontWeight:400,textTransform:"none",letterSpacing:"normal",lineHeight:"1rem",color:"#d4d4d8",backgroundColor:"#18181b",border:"1px solid rgba(63, 63, 70, 0.6)",borderRadius:"0.5rem",boxShadow:"0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1)"},children:e}),document.body)]})}const mie=/[\s\-_]+/;function gie(e){const t=e.split(mie).filter(Boolean);return t.length===0?null:t.map(n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("[\\s\\-_]*")}function NP(e,t){const n=yie(t),r=e.split(/(\*\*[^*]+\*\*)/).filter(Boolean).map(f=>f.startsWith("**")&&f.endsWith("**")?{type:"bold",value:f.slice(2,-2)}:{type:"text",value:f}),i=n.flatMap(f=>f.terms).filter(f=>f.trim().length>1);if(i.length===0)return r.map((f,p)=>f.type==="bold"?Ii.createElement("strong",{key:`b-${p}`,className:"text-zinc-200 font-semibold"},f.value):f.value).filter(Boolean);const l=[...i].sort((f,p)=>p.length-f.length).map(gie).filter(f=>!!f);if(l.length===0)return r.map((f,p)=>f.type==="bold"?Ii.createElement("strong",{key:`b-${p}`,className:"text-zinc-200 font-semibold"},f.value):f.value).filter(Boolean);const u=new RegExp(`(${l.join("|")})`,"gi"),d=new Map;for(const f of n)for(const p of f.terms){const m=uy(p);m&&!d.has(m)&&d.set(m,f.className)}return r.flatMap((f,p)=>f.value.split(u).map((g,v)=>{if(!g)return null;if(v%2===1){const b=d.get(uy(g))??"answer-highlight";return f.type==="bold"?Ii.createElement("mark",{key:`hl-${p}-${v}`,className:b},Ii.createElement("strong",{className:"text-zinc-200 font-semibold"},g)):Ii.createElement("mark",{key:`hl-${p}-${v}`,className:b},g)}return f.type==="bold"?Ii.createElement("strong",{key:`b-${p}-${v}`,className:"text-zinc-200 font-semibold"},g):g})).filter(Boolean)}function yie(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function Pw(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 vie({evidence:e,project:t,onClose:n}){const[r,i]=x.useState(!1),[a,l]=x.useState("mentions"),[u,d]=x.useState(-1),[f,p]=x.useState(null),[m,g]=x.useState(!1),[v,S]=x.useState({}),b=ree(t.project),j=new Set(b.map(ly)),k=e.runHistory,E=k.length>1,[C,A]=x.useState(null),P=x.useRef(!1);x.useEffect(()=>{if(P.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const G=k.at(-1);G&&(P.current=!0,ec(G.runId).then(se=>{const ne=se.snapshots.find(Ce=>Ce.query===e.query&&Ce.provider===e.provider);ne&&A({citationState:ne.citationState,answerMentioned:ne.answerMentioned,visibilityState:ne.visibilityState,visibilityTransition:G.visibilityTransition,provider:ne.provider,model:ne.model??e.model,answerSnippet:ne.answerText??e.answerSnippet,citedDomains:ne.citedDomains??e.citedDomains,competitorDomains:ne.competitorOverlap??e.competitorDomains,recommendedCompetitors:ne.recommendedCompetitors??e.recommendedCompetitors??[],matchedTerms:ne.matchedTerms??e.matchedTerms??[],groundingSources:ne.groundingSources??e.groundingSources,evidenceUrls:[],changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,k]);const O=u>=0&&f!==null,_=O?f:C||{citationState:e.citationState,answerMentioned:e.answerMentioned,visibilityState:e.visibilityState,visibilityTransition:k.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},T=_.visibilityState==="pending"||_.citationState==="pending",$=T?!1:_.visibilityState!=null?_.visibilityState==="visible":_.answerMentioned!=null?_.answerMentioned:_.citationState===Ju.cited||_.citationState==="emerging",F=_.answerMentioned!=null||_.visibilityState!=null||_.recommendedCompetitors.length>0,U=_.citedDomains.length>0||_.groundingSources.length>0||_.evidenceUrls.length>0,B=t.project.displayName||t.project.name,V=[...b.map(ly),B,B.split(" ").slice(0,2).join(" "),..._.matchedTerms].filter(G=>G.trim().length>2),X=[..._.competitorDomains.flatMap(G=>{const se=nee(G);return se.length>=4?[se]:[]}),..._.recommendedCompetitors].filter(G=>G.trim().length>2),Z=[{terms:V,className:"answer-highlight-brand"},...X.length>0?[{terms:X,className:"answer-highlight-competitor"}]:[]],H=T?"pending":_.visibilityTransition==="lost"?"lost":$?"cited":"not-cited",J=x.useRef(0),oe=x.useCallback(async G=>{const se=++J.current;if(G===-1||G===k.length-1){d(-1),p(null),i(!1);return}d(G),i(!1);const ne=k[G],Ce=`${ne.runId}::${e.query}::${e.provider}`;if(v[Ce]){p(v[Ce]);return}g(!0);try{const je=await ec(ne.runId);if(se!==J.current)return;const ee=je.snapshots.find(Ee=>Ee.query===e.query&&Ee.provider===e.provider)??je.snapshots.find(Ee=>Ee.query===e.query),pe=ee?{citationState:ee.citationState,answerMentioned:ee.answerMentioned,visibilityState:ee.visibilityState,visibilityTransition:ne.visibilityTransition,provider:ee.provider,model:ee.model??null,answerSnippet:ee.answerText??"",citedDomains:ee.citedDomains,competitorDomains:ee.competitorOverlap,recommendedCompetitors:ee.recommendedCompetitors??[],matchedTerms:ee.matchedTerms??[],groundingSources:ee.groundingSources,evidenceUrls:[],changeLabel:Pw(ne.visibilityTransition,ne.visibilityState),summary:""}:{citationState:ne.citationState,answerMentioned:ne.answerMentioned,visibilityState:ne.visibilityState,visibilityTransition:ne.visibilityTransition,provider:e.provider,model:ne.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:Pw(ne.visibilityTransition,ne.visibilityState),summary:"Snapshot data not available for this run."};S(Ee=>({...Ee,[Ce]:pe})),p(pe)}catch{if(se!==J.current)return;p({citationState:ne.citationState,answerMentioned:ne.answerMentioned,visibilityState:ne.visibilityState,visibilityTransition:ne.visibilityTransition,provider:e.provider,model:ne.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:Pw(ne.visibilityTransition,ne.visibilityState),summary:"Failed to load historical run data."})}finally{se===J.current&&g(!1)}},[k,e.query,e.provider,v]),I=(O||e.historyScope!=="provider")&&_.model?`${_.provider} (${_.model}) · ${_.changeLabel.toLowerCase()}`:`${_.provider} · ${_.changeLabel.toLowerCase()}`,M=!O&&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(" · "):"",q=$?{label:"Visible in answer",title:"Your brand or domain is mentioned in this answer",meta:I}:_.visibilityTransition==="lost"?{label:"Visibility lost",title:"Your brand no longer appears in this answer",meta:I}:T?{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:I},D=()=>{if(!_.answerSnippet)return null;const G=_.answerSnippet.split(`
|
|
97
|
-
`),se=[];let ne=[],Ce=0;const je=()=>{if(ne.length===0)return;const ee=ne.join(" ").trim();ee&&se.push(o.jsx("p",{className:se.length>0?"mt-2.5":"",children:NP(ee,Z)},Ce++)),ne=[]};for(const ee of G){const pe=ee.trim();if(/^[-\u2013\u2014]{3,}$/.test(pe)){je(),se.push(o.jsx("hr",{className:"border-zinc-800/60 my-3"},Ce++));continue}const Ee=pe.match(/^(#{1,3})\s+(.+)$/);if(Ee){je();const W=Ee[1].length,He=Ee[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||Ee[2],Te=W===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":W===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";se.push(o.jsx("p",{className:Te,children:NP(He,Z)},Ce++));continue}if(pe===""){je();continue}ne.push(pe)}return je(),se};return o.jsx(T4,{open:!0,onOpenChange:G=>{G||n()},children:o.jsxs(R4,{children:[o.jsx(pk,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),o.jsxs(mk,{className:"evidence-modal","aria-describedby":void 0,children:[o.jsxs("div",{className:"evidence-modal-header",children:[o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("p",{className:"eyebrow eyebrow-soft",children:[t.project.name," ","·"," ",_.provider||"All providers"]}),o.jsx(gk,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.query})]}),o.jsxs(M4,{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:[o.jsx(Gh,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]}),E&&o.jsxs("div",{className:"evidence-modal-timeline",children:[o.jsx("p",{className:"drawer-section-label mb-1.5",children:"Run history"}),o.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:k.map((G,se)=>{const ne=u===-1&&se===k.length-1||u===se,Ce=G.visibilityState??(G.answerMentioned?"visible":"not-visible"),je=G.visibilityTransition??Ce,ee=Ce==="visible"?"bg-emerald-400":je==="emerging"?"bg-amber-400":je==="lost"?"bg-rose-400":"bg-zinc-600",Ee=new Date(G.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),W=!!(G.model&&se>0&&k[se-1]?.model&&k[se-1].model!==G.model);return o.jsxs("button",{type:"button",className:`evidence-run-dot ${ne?"evidence-run-dot--selected":""}`,onClick:()=>oe(se===k.length-1?-1:se),"aria-label":[`Run ${Ee}: ${Ce}`,G.model?`model ${G.model}`:null,W?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":ne,children:[o.jsx("span",{className:`size-2 rounded-full ${ee} ${W?"ring-1 ring-amber-300/80 ring-offset-2 ring-offset-zinc-950":""}`,"aria-hidden":"true"}),o.jsx("span",{className:"text-[10px] text-zinc-500",children:Ee})]},se)})}),u>=0&&u<k.length&&o.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(k[u].createdAt).toLocaleString()," ","—"," ",o.jsx("span",{className:"capitalize",children:k[u].visibilityState??(k[u].answerMentioned?"visible":"not-visible")}),o.jsxs("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>oe(-1),children:["←"," Back to latest"]})]}),!O&&(e.modelTransitions?.length??0)>0&&o.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(G=>o.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:`${G.fromModel??"unknown"} -> ${G.toModel??"unknown"} on ${new Date(G.createdAt).toLocaleDateString()}`},`${G.runId}:${G.toModel??"unknown"}`))})]}),o.jsxs("div",{className:"evidence-modal-body",children:[m&&o.jsxs("div",{className:"md:col-span-2 flex items-center justify-center py-12 text-zinc-500 text-sm",children:["Loading historical run data","…"]}),!m&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"evidence-modal-main",children:[o.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${H}`,children:[o.jsx("p",{className:`evidence-position-label evidence-position-label--${H}`,children:q.label}),o.jsx("p",{className:`evidence-position-title evidence-position-title--${H}`,children:q.title}),o.jsx("p",{className:"evidence-position-meta",children:q.meta}),M&&o.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:M})]}),_.answerSnippet&&o.jsxs("div",{children:[o.jsx("p",{className:"drawer-section-label",children:"What the AI said"}),o.jsx("div",{className:`answer-snippet-block ${r?"evidence-answer-expanded":"evidence-answer-collapsed"}`,children:D()}),_.answerSnippet.length>280&&o.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"})]}),!_.answerSnippet&&!m&&o.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"}),!O&&e.relatedTechnicalSignals.length>0&&o.jsxs("div",{children:[o.jsx("p",{className:"drawer-section-label",children:$?"Why you're visible":"What to fix"}),o.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((G,se)=>o.jsxs("div",{className:"action-item",children:[o.jsx("svg",{className:`action-item-icon ${$?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:$?o.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):o.jsxs(o.Fragment,{children:[o.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("path",{d:"M8 5v3.5M8 10.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),o.jsx("span",{className:"action-item-text",children:G})]},se))})]}),_.summary&&o.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:_.summary})]}),o.jsxs("div",{className:"evidence-modal-sidebar",children:[(F||U)&&o.jsxs("div",{className:"sidebar-tabs",children:[o.jsx("button",{className:`sidebar-tab ${a==="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"}),o.jsx("button",{className:`sidebar-tab ${a==="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"})]}),a==="mentions"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsxs("div",{className:"drawer-section-label flex items-center",children:[o.jsx("span",{children:"Answer visibility"}),o.jsx(hr,{text:"Canonry scans the AI answer for your owned domains and project name. This is independent from grounding or citation sources."})]}),o.jsxs("div",{className:`mention-status mention-status--${$?"visible":"not-visible"}`,children:[o.jsx("span",{className:"mention-status-icon",children:T?"…":$?"✓":"—"}),o.jsx("span",{className:"mention-status-label",children:T?"Pending":$?"Visible":"Not visible"})]}),_.matchedTerms.length>0&&o.jsxs("div",{className:"mt-2",children:[o.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Matched in answer"}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:_.matchedTerms.map(G=>o.jsx("span",{className:"mention-chip mention-chip--brand",children:G},G))})]}),!T&&!$&&_.matchedTerms.length===0&&o.jsxs("div",{className:"mt-2",children:[o.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Searched for"}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:V.map(G=>o.jsx("span",{className:"mention-chip mention-chip--muted",children:G},G))}),o.jsx("p",{className:"text-[11px] text-zinc-600 mt-1.5",children:"None of these appear in the answer text."})]})]}),(_.recommendedCompetitors.length>0||_.competitorDomains.length>0)&&o.jsxs("div",{children:[o.jsxs("div",{className:"drawer-section-label flex items-center",children:[o.jsx("span",{children:"Competitors in answer"}),o.jsx(hr,{text:"Competitors detected in the answer text or cited source links. Includes both tracked competitors and names extracted by Canonry."})]}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:(()=>{const G=_.competitorDomains.map(Ce=>Ce.replace(/^www\./,"")),se=new Set(G.map(Ce=>uy(Ce.replace(/\.[^.]+$/,""))));return[..._.recommendedCompetitors.filter(Ce=>!se.has(uy(Ce))),...G].map(Ce=>o.jsx("span",{className:"mention-chip mention-chip--competitor",children:Ce},Ce))})()})]})]}),a==="sources"&&o.jsxs(o.Fragment,{children:[_.citedDomains.length>0&&o.jsxs("div",{children:[o.jsxs("div",{className:"drawer-section-label flex items-center",children:[o.jsx("span",{children:"Domains from source links"}),o.jsx(hr,{text:"These domains were extracted from grounding or citation URLs. They are supporting-source metadata, not proof that the answer text mentioned them."})]}),o.jsx("div",{className:"citation-leaderboard",children:_.citedDomains.map((G,se)=>{const ne=G.toLowerCase().replace(/^www\./,""),Ce=j.has(ne),je=!Ce&&_.competitorDomains.some(pe=>pe.toLowerCase().replace(/^www\./,"")===ne),ee=Ce?"you":je?"competitor":"other";return o.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${ee}`,children:[o.jsxs("span",{className:"citation-leaderboard-rank",children:["#",se+1]}),o.jsx("span",{className:"citation-leaderboard-domain",children:G}),Ce&&o.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),je&&o.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},G)})})]}),_.groundingSources.length>0&&o.jsxs("div",{children:[o.jsxs("div",{className:"drawer-section-label flex items-center",children:[o.jsxs("span",{children:["Grounding source links (",_.groundingSources.length,")"]}),o.jsx(hr,{text:"Links the model used as grounding or supporting context while producing the answer. These are not the same thing as answer visibility."})]}),o.jsx("ul",{className:"grid gap-0.5",children:_.groundingSources.map((G,se)=>o.jsx("li",{className:"truncate text-sm",children:o.jsx("a",{href:G.uri,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:G.title||G.uri})},se))})]}),_.evidenceUrls.length>0&&o.jsxs("div",{children:[o.jsx("p",{className:"drawer-section-label",children:"Evidence URLs"}),o.jsx("ul",{className:"grid gap-1",children:_.evidenceUrls.map(G=>o.jsx("li",{className:"truncate text-sm",children:o.jsx("a",{href:G,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:G})},G))})]}),_.citedDomains.length===0&&_.groundingSources.length===0&&_.evidenceUrls.length===0&&o.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No source data ",O?"for this run":"yet"]})]}),!F&&!U&&o.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No answer visibility data ",O?"for this run":"yet"]})]})]})]})]})]})})}function ia(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 Tw=[{id:"project_citypoint",name:"Citypoint Dental NYC",canonicalDomain:"citypointdental.com",ownedDomains:[],country:"US",language:"en",tags:["local intent","priority"],labels:{},locations:[],defaultLocation:null,autoExtractBacklinks:!1,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,autoExtractBacklinks:!1,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,autoExtractBacklinks:!1,configSource:"cli",configRevision:1}];function $v(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 xie=$v({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"}),bie=$v({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"}),wie=$v({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"}),Sie=$v({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"}),jie=[{id:"evidence_citypoint_emergency_gemini",query:"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:ia(["cited","cited","cited","cited","cited","cited","cited","not-cited","not-cited"])},{id:"evidence_citypoint_emergency_openai",query:"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:ia(["not-cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_emergency_claude",query:"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:ia(["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",query:"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:ia(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","cited"])},{id:"evidence_citypoint_invisalign_gemini",query:"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:ia(["cited","cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_invisalign_claude",query:"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:ia(["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",query:"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:ia(["not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_gemini",query:"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:ia(["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",query:"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:ia(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];Tw[0],Tw[1],ia(["cited","cited","cited","cited","cited"]),Tw[2],2/7,ia(["not-cited","not-cited","not-cited","cited"]);function Nie(e,t){return e.projects.find(n=>n.project.id===t)}function kie(e,t){return e.runs.find(n=>n.id===t)}function Cie(e,t){for(const n of e.projects){const r=n.visibilityEvidence.find(i=>i.id===t);if(r)return{project:n,evidence:r}}}const Aie={regression:"negative",gain:"positive",opportunity:"caution","first-citation":"positive","provider-pickup":"positive","persistent-gap":"caution","competitor-gained":"negative","competitor-lost":"neutral"},Oie={regression:"lost",gain:"emerging",opportunity:"not-cited","first-citation":"emerging","provider-pickup":"emerging","persistent-gap":"not-cited","competitor-gained":"cited","competitor-lost":"not-cited"},Eie={regression:"Regression",gain:"Gain",opportunity:"Opportunity","first-citation":"First citation","provider-pickup":"Pickup","persistent-gap":"Gap","competitor-gained":"Competitor","competitor-lost":"Competitor"};function _ie(e){return{id:e.id,tone:Aie[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??"",actionLabel:e.recommendation?.action??Eie[e.type],affectedPhrases:[{query:e.query,evidenceId:"",provider:e.provider,citationState:Oie[e.type]}]}}function zie(e){return e.filter(t=>!t.dismissed).map(_ie)}function U4(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,autoExtractBacklinks:e.autoExtractBacklinks??!1,configSource:e.configSource,configRevision:e.configRevision,createdAt:e.createdAt,updatedAt:e.updatedAt}}function kP(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function Pie(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),a=r%60;return`${i}m ${a}s`}function q4(e){switch(e){case zt["answer-visibility"]:return"Answer visibility sweep";case zt["gsc-sync"]:return"GSC sync";case zt["inspect-sitemap"]:return"Sitemap inspection";case zt["ga-sync"]:return"GA sync";case zt["bing-inspect"]:return"Bing URL inspection";case zt["bing-inspect-sitemap"]:return"Bing sitemap inspection";case zt["site-audit"]:return"Site audit";case zt["backlink-extract"]:return"Backlink extract"}}function Tie(e){return e===oh.manual?"Manual":e===oh.scheduled?"Scheduled":e===oh["config-apply"]?"Config apply":e}function yk(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:q4(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?kP(e.startedAt):kP(e.createdAt),duration:Pie(e.startedAt,e.finishedAt),statusDetail:e.error?F4(e.error):Rie(e),summary:Die(e),triggerLabel:Tie(e.trigger)}}function F4(e){const t=rk(e);return t.length>200?t.slice(0,200)+"…":t}function Rie(e){switch(e.status){case fr.queued:return"Waiting for execution slot.";case fr.running:return"Provider queries in progress.";case fr.completed:return"All queries checked.";case fr.partial:return"Run completed with some queries skipped.";case fr.failed:return e.error?F4(e.error):"Run failed.";case fr.cancelled:return"Run was cancelled.";default:return""}}function Die(e){const t=q4(e.kind);switch(e.status){case fr.queued:return`${t} queued`;case fr.running:return`${t} in progress`;case fr.completed:return`${t} completed`;case fr.partial:return`${t} partially completed`;case fr.failed:return`${t} failed`;case fr.cancelled:return`${t} cancelled`;default:return e.status}}function Mie(e,t,n,r){const i=[];let a=0;const l=new Set;if(n){const u=new Map;for(const g of n.snapshots)if(g.query){const v=`${g.query}::${g.provider}`;u.set(v,g)}const d=new Set(n.snapshots.map(g=>g.provider)),f=new Set(t.flatMap(g=>Object.keys(g.providerRuns??{}))),p=[...new Set([...d,...f])].sort(),m=p.length>0?p:["gemini"];for(const g of t){if(g.runs.length===0)continue;l.add(g.query);const v=g.runs.at(-1),S=v?.transition??"not-cited";for(const b of m){const j=u.get(`${g.query}::${b}`),k=(g.providerRuns?.[b]?.length??0)>0;if(!j&&!k)continue;const E=j?.model??null,C=E?`${b}:${E}`:null,A=C?g.modelRuns?.[C]:void 0,P=g.providerRuns?.[b],O=(P?.length?P:null)??(A?.length?A:null),_=P?.length?"provider":A?.length?"model":"query",T=O?O.at(-1).transition:S,$=O?O.at(-1).visibilityTransition??(O.at(-1).visibilityState==="visible"?"visible":"not-visible"):v?.visibilityTransition??(v?.visibilityState==="visible"?"visible":"not-visible"),F=O?.at(-1)?.citationState,U=O?.at(-1)?.visibilityState,B=j?T==="lost"?"lost":T==="emerging"?"emerging":j.citationState===Ju.cited?"cited":"not-cited":F===Ju.cited?"cited":"not-cited",V=j?.visibilityState??(U==="visible"?"visible":U==="pending"?"pending":"not-visible"),X=CP(O||g.runs),Z=AP(O||g.runs),H=Iie(g,b),J=(O??g.runs).map(M=>({runId:M.runId,citationState:M.citationState,createdAt:M.createdAt,model:H.get(M.runId)??null,answerMentioned:M.answerMentioned,visibilityState:M.visibilityState,visibilityTransition:M.visibilityTransition})),oe=Lie(J),ye=_==="provider"&&oe.length<=1?"model":_,I=$ie(J);i.push({id:`evidence_${e}_${a++}`,query:g.query,provider:j?.provider??b,model:j?.model??null,location:j?.location??null,citationState:B,answerMentioned:j?.answerMentioned,visibilityState:V,visibilityChangeLabel:OP($,Z,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:OP(T,X),answerSnippet:j?.answerText??"",citedDomains:j?.citedDomains??[],evidenceUrls:[],competitorDomains:j?.competitorOverlap??[],recommendedCompetitors:j?.recommendedCompetitors??[],matchedTerms:j?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:j?.groundingSources??[],summary:Bie(V,$,g.query),runHistory:J,historyScope:ye,modelsSeen:oe,modelTransitions:I})}}}for(const u of r)l.has(u.query)||i.push({id:`evidence_${e}_${a++}`,query:u.query,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:`"${u.query}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"query",modelsSeen:[],modelTransitions:[]});return i}function Iie(e,t){const n=new Map,r=`${t}:`;for(const[i,a]of Object.entries(e.modelRuns??{})){if(!i.startsWith(r))continue;const l=i.slice(r.length),u=l==="unknown"?null:l;for(const d of a)n.set(d.runId,u)}return n}function Lie(e){const t=new Set;for(const n of e)n.model&&t.add(n.model);return[...t]}function $ie(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 CP(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 AP(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 OP(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?`${Mf(r.positive)} in latest run`:`${Mf(r.positive)} for ${t} runs`;case"lost":return"Lost since last run";case"emerging":return Mf(r.first);case"not-cited":case"not-visible":return t<=1?`${Mf(r.negative)} in latest run`:`${Mf(r.negative)} across ${t} runs`;default:return e}}function Mf(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Bie(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 Uie(e){const t=U4(e.project),n=Mie(t.name,e.timeline,e.latestRunDetail,e.queries),i=[...e.runs].sort((a,l)=>l.createdAt.localeCompare(a.createdAt)).map(a=>yk(a,e.project.displayName||e.project.name));return e.overview?qie(t,e.overview,n,i):Fie(t,n,i)}function qie(e,t,n,r){const i=zie(t.topInsights);for(const a of t.attentionItems)a.id.startsWith("insight_")||i.push({id:a.id,tone:a.tone,title:a.title,detail:a.detail,actionLabel:a.actionLabel,affectedPhrases:[]});return{project:e,dateRangeLabel:t.dateRangeLabel,contextLabel:t.contextLabel,visibilitySummary:t.scores.visibility,queryCounts:{cited:t.queryCounts.citedQueries,total:t.queryCounts.totalQueries},gapQueries:t.scores.gapQueries,indexCoverage:t.scores.indexCoverage,providerScores:t.providerScores,competitorPressure:t.scores.competitorPressure,runStatus:t.scores.runStatus,movementSummary:t.movementSummary,insights:i,visibilityEvidence:n,competitors:t.competitors.map(a=>({id:a.id,domain:a.domain,citationCount:a.citationCount,totalQueries:a.totalQueries,pressureLabel:a.pressureLabel,citedQueries:a.citedQueries,movement:"",notes:""})),recentRuns:r.slice(0,5)}}function Fie(e,t,n){const r={label:"",value:"No data",delta:"Loading…",tone:"neutral",description:"",tooltip:"",trend:[]};return{project:e,dateRangeLabel:"All time",contextLabel:`${e.country} / ${e.language.toUpperCase()}`,visibilitySummary:{...r,label:"Answer Visibility"},queryCounts:{cited:0,total:0},gapQueries:{...r,label:"Gap Queries"},indexCoverage:{...r,label:"Index Coverage"},providerScores:[],competitorPressure:{...r,label:"Competitor Pressure"},runStatus:{...r,label:"Run Status"},movementSummary:{gained:0,lost:0,tone:"neutral",hasPreviousRun:!1},insights:[],visibilityEvidence:t,competitors:[],recentRuns:n.slice(0,5)}}function Hie(e){const t=U4(e.project),n=[...e.runs].sort((g,v)=>v.createdAt.localeCompare(g.createdAt)),r=n.find(g=>g.kind===zt["answer-visibility"])??n[0],i=e.project.displayName||e.project.name,a=r?yk(r,i):Kie(e.project.id,i),l=e.overview;if(!l)return{project:t,visibilityScore:0,visibilityDelta:"No data",visibilityTone:"neutral",lastRun:a,insight:"No runs completed yet.",trend:[],competitorPressureLabel:"None"};const u=l.scores.visibility,d=u.progress??0,f=l.queryCounts.citedQueries,p=l.queryCounts.totalQueries,m=l.providers.length;return{project:t,visibilityScore:d,visibilityDelta:p>0?`${f} of ${p} queries`:"No data",visibilityTone:u.tone,providerCoverage:u.providerCoverage,lastRun:a,insight:p>0?`${f} of ${p} queries visible across ${m} provider${m===1?"":"s"}.`:"No runs completed yet.",trend:[],competitorPressureLabel:l.scores.competitorPressure.value}}function Kie(e,t){return{id:"none",projectId:e,projectName:t,kind:zt["answer-visibility"],kindLabel:"No runs yet",status:fr.queued,trigger:oh.manual,createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""}}function Gie(e,t){const n=[],r=[],i=[];for(const l of e){r.push(Uie(l)),i.push(Hie(l));const u=[...l.runs].sort((d,f)=>f.createdAt.localeCompare(d.createdAt));for(const d of u)n.push(yk(d,l.project.displayName||l.project.name))}n.sort((l,u)=>u.createdAt.localeCompare(l.createdAt));const a=e.length>0;return{portfolioOverview:{projects:i,attentionItems:a?Vie(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"}),...a?{}:{emptyState:{title:"No projects yet",detail:"Canonry becomes useful after one project, a small query 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"},queryImportState:{mode:"paste",queryCount:0,preview:[]},competitorDraft:{domains:[],notes:"Use the CLI to add competitors."},launchState:{enabled:a,ctaLabel:a?"Trigger run":"Create a project first",summary:a?"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 Vie(e){const t=[];for(const n of e){const r=n.visibilityEvidence.filter(a=>a.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} quer${r.length>1?"ies":"y"} lost citation.`,actionLabel:"Open project",href:`/projects/${n.project.id}`});const i=n.recentRuns.filter(a=>a.status===fr.running||a.status===fr.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 qe={projects:{all:["projects"],detail:(e,t)=>["projects",e,t],queries:e=>["projects",e,"queries"],competitors:e=>["projects",e,"competitors"],timeline:(e,t)=>["projects",e,"timeline",t]},runs:{all:["runs"],detail:e=>["runs",e]},settings:["settings"],health:["health"],gsc:{project:e=>["gsc",e],connections:e=>["gsc",e,"connections"],properties:e=>["gsc",e,"properties"],performance:(e,t)=>["gsc",e,"performance",t],inspections:(e,t)=>["gsc",e,"inspections",t],deindexed:e=>["gsc",e,"deindexed"],coverage:e=>["gsc",e,"coverage"],coverageHistory:e=>["gsc",e,"coverage-history"],sitemaps:e=>["gsc",e,"sitemaps"]},bing:{project:e=>["bing",e],status:e=>["bing",e,"status"],coverage:e=>["bing",e,"coverage"],inspections:e=>["bing",e,"inspections"],performance:e=>["bing",e,"performance"],sites:e=>["bing",e,"sites"]},schedule:e=>["schedule",e],notifications:e=>["notifications",e],agent:{providers:e=>["agent",e,"providers"]},citationVisibility:e=>["citation-visibility",e],report:e=>["report",e],traffic:{project:e=>["traffic",e],status:e=>["traffic",e,"status"],summary:(e,t)=>["traffic",e,"summary",t],aiHistory:(e,t)=>["traffic",e,"ai-history",t],sessionHistory:(e,t)=>["traffic",e,"session-history",t],socialHistory:(e,t)=>["traffic",e,"social-history",t]}},H4=x.createContext(null);H4.Provider;function Vh(){return x.useContext(H4)}function wc(e){const n=Vh()?.dashboard??null,r=ca({queryKey:qe.projects.all,queryFn:HN,enabled:!n}),i=ca({queryKey:qe.runs.all,queryFn:y5,enabled:!n,staleTime:Qj,refetchInterval:S=>S.state.data?.some(k=>k.status==="running"||k.status==="queued")?3e3:Qj}),a=ca({queryKey:qe.settings,queryFn:()=>KN().catch(()=>null),enabled:!n}),l=r.data??[],u=i.data??[],d=RK({queries:l.map(S=>{const b=u.filter(k=>k.projectId===S.id),j=b.filter(k=>(k.status==="completed"||k.status==="partial")&&k.kind==="answer-visibility").sort((k,E)=>E.createdAt.localeCompare(k.createdAt));return{queryKey:qe.projects.detail(S.id,j[0]?.id),queryFn:async()=>{const k=j[0]?.id,[E,C,A,P,O,_,T,$,F]=await Promise.all([qG(S.name).catch(()=>[]),v5(S.name).catch(()=>[]),x5(S.name).catch(()=>[]),k?ec(k).catch(()=>null):Promise.resolve(null),j[1]?ec(j[1].id).catch(()=>null):Promise.resolve(null),GN(S.name).catch(()=>null),VN(S.name).catch(()=>null),k?FV(S.name,k).catch(()=>null):Promise.resolve(null),FG(S.name).catch(()=>null)]);return{project:S,runs:b,queries:E,competitors:C,timeline:A,latestRunDetail:P,previousRunDetail:O,gscCoverage:_,bingCoverage:T,dbInsights:$,overview:F}},enabled:!n&&r.isSuccess&&i.isSuccess,staleTime:E5}})}),f=d.every(S=>S.isSuccess),p=x.useMemo(()=>{if(n)return n;if(!r.data||!i.data||l.length>0&&!f)return null;const S=d.map(b=>b.data?{...b.data,runs:u.filter(j=>j.projectId===b.data.project.id)}:null).filter(b=>b!=null);return Gie(S,a.data??null)},[n,r.data,i.data,a.data,f,d,l.length,u]),m=!n&&(r.isError||i.isError),g=!n&&!p&&!m,v=x.useCallback(async()=>{await Promise.all([r.refetch(),i.refetch(),a.refetch()])},[r.refetch,i.refetch,a.refetch]);return{dashboard:p,isLoading:g,isError:m,refetch:v}}async function Qie(){const e=await KV("/health","API"),t=e.state==="ok"?{label:"Worker",state:"ok",detail:"In-process job runner"}:{label:"Worker",state:e.state,detail:`Depends on API health check · ${e.detail}`,statusCode:e.statusCode,hint:e.hint?`Worker status is inferred from API health in this deployment mode. ${e.hint}`:"Worker status is inferred from API health in this deployment mode."};return{apiStatus:e,workerStatus:t}}function Bv(e,t){return ca({queryKey:qe.health,queryFn:Qie,enabled:e,refetchInterval:15e3,initialData:t})}function Yie(e){return ca({queryKey:qe.runs.detail(e??""),queryFn:()=>ec(e),enabled:!!e,refetchInterval:t=>{const n=t.state.data?.status;return n==="running"||n==="queued"?3e3:!1}})}function xd(){const e=Qo(),t=kv({strict:!1}),n=Zr({select:d=>d.location.pathname}),r=t.runId??null,i=t.evidenceId??null;return{runId:r,evidenceId:i,openRun:d=>e({to:n,from:Hi.to,search:f=>({...f,runId:d,evidenceId:void 0})}),openEvidence:d=>e({to:n,from:Hi.to,search:f=>({...f,evidenceId:d,runId:void 0})}),closeDrawer:()=>e({to:n,from:Hi.to,search:d=>({...d,runId:void 0,evidenceId:void 0})})}}const Wie={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function Zie(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function Xie(){const e=x.useSyncExternalStore(lQ,j2,j2),t=Qo(),{openRun:n}=xd(),r=x.useCallback(a=>{Vj(a)},[]),i=x.useCallback(a=>{a.cta&&(a.cta.intent==="open-run-drawer"?n(a.cta.runId):t({to:"/runs"}),Vj(a.id))},[t,n]);return e.length===0?null:o.jsx("div",{className:"toast-viewport","aria-label":"Notifications",children:e.map(a=>o.jsxs("section",{role:a.tone==="negative"?"alert":"status","aria-live":a.tone==="negative"?"assertive":"polite","data-state":a.state,className:`toast-card ${Wie[a.tone]}`,children:[o.jsxs("div",{className:"toast-copy",children:[o.jsx("p",{className:"toast-title",children:a.title}),a.detail?o.jsx("p",{className:"toast-detail",children:a.detail}):null,a.cta?o.jsx("button",{type:"button",className:"toast-action",onClick:()=>i(a),"aria-label":Zie(a),children:a.cta.label}):null]}),o.jsx("button",{type:"button",onClick:()=>r(a.id),className:"toast-dismiss","aria-label":"Dismiss",children:o.jsx(Gh,{className:"size-3.5"})})]},a.id))})}function Jie(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const eae=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,tae=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nae={};function EP(e,t){return(nae.jsx?tae:eae).test(e)}const rae=/[ \t\n\f\r]/g;function iae(e){return typeof e=="object"?e.type==="text"?_P(e.value):!1:_P(e)}function _P(e){return e.replace(rae,"")===""}let Qh=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};Qh.prototype.normal={};Qh.prototype.property={};Qh.prototype.space=void 0;function K4(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Qh(n,r,t)}function i1(e){return e.toLowerCase()}class ni{constructor(t,n){this.attribute=n,this.property=t}}ni.prototype.attribute="";ni.prototype.booleanish=!1;ni.prototype.boolean=!1;ni.prototype.commaOrSpaceSeparated=!1;ni.prototype.commaSeparated=!1;ni.prototype.defined=!1;ni.prototype.mustUseProperty=!1;ni.prototype.number=!1;ni.prototype.overloadedBoolean=!1;ni.prototype.property="";ni.prototype.spaceSeparated=!1;ni.prototype.space=void 0;let aae=0;const ct=Sc(),$n=Sc(),a1=Sc(),Oe=Sc(),Wt=Sc(),$u=Sc(),ui=Sc();function Sc(){return 2**++aae}const s1=Object.freeze(Object.defineProperty({__proto__:null,boolean:ct,booleanish:$n,commaOrSpaceSeparated:ui,commaSeparated:$u,number:Oe,overloadedBoolean:a1,spaceSeparated:Wt},Symbol.toStringTag,{value:"Module"})),Rw=Object.keys(s1);class vk extends ni{constructor(t,n,r,i){let a=-1;if(super(t,n),zP(this,"space",i),typeof r=="number")for(;++a<Rw.length;){const l=Rw[a];zP(this,Rw[a],(r&s1[l])===s1[l])}}}vk.prototype.defined=!0;function zP(e,t,n){n&&(e[t]=n)}function bd(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new vk(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[i1(r)]=r,n[i1(a.attribute)]=r}return new Qh(t,n,e.space)}const G4=bd({properties:{ariaActiveDescendant:null,ariaAtomic:$n,ariaAutoComplete:null,ariaBusy:$n,ariaChecked:$n,ariaColCount:Oe,ariaColIndex:Oe,ariaColSpan:Oe,ariaControls:Wt,ariaCurrent:null,ariaDescribedBy:Wt,ariaDetails:null,ariaDisabled:$n,ariaDropEffect:Wt,ariaErrorMessage:null,ariaExpanded:$n,ariaFlowTo:Wt,ariaGrabbed:$n,ariaHasPopup:null,ariaHidden:$n,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Wt,ariaLevel:Oe,ariaLive:null,ariaModal:$n,ariaMultiLine:$n,ariaMultiSelectable:$n,ariaOrientation:null,ariaOwns:Wt,ariaPlaceholder:null,ariaPosInSet:Oe,ariaPressed:$n,ariaReadOnly:$n,ariaRelevant:null,ariaRequired:$n,ariaRoleDescription:Wt,ariaRowCount:Oe,ariaRowIndex:Oe,ariaRowSpan:Oe,ariaSelected:$n,ariaSetSize:Oe,ariaSort:null,ariaValueMax:Oe,ariaValueMin:Oe,ariaValueNow:Oe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function V4(e,t){return t in e?e[t]:t}function Q4(e,t){return V4(e,t.toLowerCase())}const sae=bd({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:$u,acceptCharset:Wt,accessKey:Wt,action:null,allow:null,allowFullScreen:ct,allowPaymentRequest:ct,allowUserMedia:ct,alt:null,as:null,async:ct,autoCapitalize:null,autoComplete:Wt,autoFocus:ct,autoPlay:ct,blocking:Wt,capture:null,charSet:null,checked:ct,cite:null,className:Wt,cols:Oe,colSpan:null,content:null,contentEditable:$n,controls:ct,controlsList:Wt,coords:Oe|$u,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ct,defer:ct,dir:null,dirName:null,disabled:ct,download:a1,draggable:$n,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ct,formTarget:null,headers:Wt,height:Oe,hidden:a1,high:Oe,href:null,hrefLang:null,htmlFor:Wt,httpEquiv:Wt,id:null,imageSizes:null,imageSrcSet:null,inert:ct,inputMode:null,integrity:null,is:null,isMap:ct,itemId:null,itemProp:Wt,itemRef:Wt,itemScope:ct,itemType:Wt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ct,low:Oe,manifest:null,max:null,maxLength:Oe,media:null,method:null,min:null,minLength:Oe,multiple:ct,muted:ct,name:null,nonce:null,noModule:ct,noValidate:ct,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ct,optimum:Oe,pattern:null,ping:Wt,placeholder:null,playsInline:ct,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ct,referrerPolicy:null,rel:Wt,required:ct,reversed:ct,rows:Oe,rowSpan:Oe,sandbox:Wt,scope:null,scoped:ct,seamless:ct,selected:ct,shadowRootClonable:ct,shadowRootDelegatesFocus:ct,shadowRootMode:null,shape:null,size:Oe,sizes:null,slot:null,span:Oe,spellCheck:$n,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Oe,step:null,style:null,tabIndex:Oe,target:null,title:null,translate:null,type:null,typeMustMatch:ct,useMap:null,value:$n,width:Oe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Wt,axis:null,background:null,bgColor:null,border:Oe,borderColor:null,bottomMargin:Oe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ct,declare:ct,event:null,face:null,frame:null,frameBorder:null,hSpace:Oe,leftMargin:Oe,link:null,longDesc:null,lowSrc:null,marginHeight:Oe,marginWidth:Oe,noResize:ct,noHref:ct,noShade:ct,noWrap:ct,object:null,profile:null,prompt:null,rev:null,rightMargin:Oe,rules:null,scheme:null,scrolling:$n,standby:null,summary:null,text:null,topMargin:Oe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Oe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ct,disableRemotePlayback:ct,prefix:null,property:null,results:Oe,security:null,unselectable:null},space:"html",transform:Q4}),oae=bd({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ui,accentHeight:Oe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Oe,amplitude:Oe,arabicForm:null,ascent:Oe,attributeName:null,attributeType:null,azimuth:Oe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Oe,by:null,calcMode:null,capHeight:Oe,className:Wt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Oe,diffuseConstant:Oe,direction:null,display:null,dur:null,divisor:Oe,dominantBaseline:null,download:ct,dx:null,dy:null,edgeMode:null,editable:null,elevation:Oe,enableBackground:null,end:null,event:null,exponent:Oe,externalResourcesRequired:null,fill:null,fillOpacity:Oe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:$u,g2:$u,glyphName:$u,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Oe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Oe,horizOriginX:Oe,horizOriginY:Oe,id:null,ideographic:Oe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Oe,k:Oe,k1:Oe,k2:Oe,k3:Oe,k4:Oe,kernelMatrix:ui,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Oe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Oe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Oe,overlineThickness:Oe,paintOrder:null,panose1:null,path:null,pathLength:Oe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Wt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Oe,pointsAtY:Oe,pointsAtZ:Oe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ui,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ui,rev:ui,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ui,requiredFeatures:ui,requiredFonts:ui,requiredFormats:ui,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Oe,specularExponent:Oe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Oe,strikethroughThickness:Oe,string:null,stroke:null,strokeDashArray:ui,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Oe,strokeOpacity:Oe,strokeWidth:null,style:null,surfaceScale:Oe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ui,tabIndex:Oe,tableValues:null,target:null,targetX:Oe,targetY:Oe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ui,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Oe,underlineThickness:Oe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Oe,values:null,vAlphabetic:Oe,vMathematical:Oe,vectorEffect:null,vHanging:Oe,vIdeographic:Oe,version:null,vertAdvY:Oe,vertOriginX:Oe,vertOriginY:Oe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Oe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:V4}),Y4=bd({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),W4=bd({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Q4}),Z4=bd({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),lae={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},cae=/[A-Z]/g,PP=/-[a-z]/g,uae=/^data[-\w.:]+$/i;function dae(e,t){const n=i1(t);let r=t,i=ni;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&uae.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(PP,hae);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!PP.test(a)){let l=a.replace(cae,fae);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=vk}return new i(r,t)}function fae(e){return"-"+e.toLowerCase()}function hae(e){return e.charAt(1).toUpperCase()}const pae=K4([G4,sae,Y4,W4,Z4],"html"),xk=K4([G4,oae,Y4,W4,Z4],"svg");function mae(e){return e.join(" ").trim()}var fu={},Dw,TP;function gae(){if(TP)return Dw;TP=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,u=/^\s+|\s+$/g,d=`
|
|
98
|
-
`,f="/",p="*",m="",g="comment",v="declaration";function S(j,k){if(typeof j!="string")throw new TypeError("First argument must be a string");if(!j)return[];k=k||{};var E=1,C=1;function A(X){var Z=X.match(t);Z&&(E+=Z.length);var H=X.lastIndexOf(d);C=~H?X.length-H:C+X.length}function P(){var X={line:E,column:C};return function(Z){return Z.position=new O(X),$(),Z}}function O(X){this.start=X,this.end={line:E,column:C},this.source=k.source}O.prototype.content=j;function _(X){var Z=new Error(k.source+":"+E+":"+C+": "+X);if(Z.reason=X,Z.filename=k.source,Z.line=E,Z.column=C,Z.source=j,!k.silent)throw Z}function T(X){var Z=X.exec(j);if(Z){var H=Z[0];return A(H),j=j.slice(H.length),Z}}function $(){T(n)}function F(X){var Z;for(X=X||[];Z=U();)Z!==!1&&X.push(Z);return X}function U(){var X=P();if(!(f!=j.charAt(0)||p!=j.charAt(1))){for(var Z=2;m!=j.charAt(Z)&&(p!=j.charAt(Z)||f!=j.charAt(Z+1));)++Z;if(Z+=2,m===j.charAt(Z-1))return _("End of comment missing");var H=j.slice(2,Z-2);return C+=2,A(H),j=j.slice(Z),C+=2,X({type:g,comment:H})}}function B(){var X=P(),Z=T(r);if(Z){if(U(),!T(i))return _("property missing ':'");var H=T(a),J=X({type:v,property:b(Z[0].replace(e,m)),value:H?b(H[0].replace(e,m)):m});return T(l),J}}function V(){var X=[];F(X);for(var Z;Z=B();)Z!==!1&&(X.push(Z),F(X));return X}return $(),V()}function b(j){return j?j.replace(u,m):m}return Dw=S,Dw}var RP;function yae(){if(RP)return fu;RP=1;var e=fu&&fu.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(fu,"__esModule",{value:!0}),fu.default=n;const t=e(gae());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const l=(0,t.default)(r),u=typeof i=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:p}=d;u?i(f,p,d):p&&(a=a||{},a[f]=p)}),a}return fu}var If={},DP;function vae(){if(DP)return If;DP=1,Object.defineProperty(If,"__esModule",{value:!0}),If.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(f){return!f||n.test(f)||e.test(f)},l=function(f,p){return p.toUpperCase()},u=function(f,p){return"".concat(p,"-")},d=function(f,p){return p===void 0&&(p={}),a(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(i,u):f=f.replace(r,u),f.replace(t,l))};return If.camelCase=d,If}var Lf,MP;function xae(){if(MP)return Lf;MP=1;var e=Lf&&Lf.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(yae()),n=vae();function r(i,a){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(u,d){u&&d&&(l[(0,n.camelCase)(u,a)]=d)}),l}return r.default=r,Lf=r,Lf}var bae=xae();const wae=pa(bae),X4=J4("end"),bk=J4("start");function J4(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Sae(e){const t=bk(e),n=X4(e);if(t&&n)return{start:t,end:n}}function lh(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?IP(e.position):"start"in e||"end"in e?IP(e):"line"in e||"column"in e?o1(e):""}function o1(e){return LP(e&&e.line)+":"+LP(e&&e.column)}function IP(e){return o1(e&&e.start)+"-"+o1(e&&e.end)}function LP(e){return e&&typeof e=="number"?e:1}class Cr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},l=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(l=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?a.ruleId=r:(a.source=r.slice(0,d),a.ruleId=r.slice(d+1))}if(!a.place&&a.ancestors&&a.ancestors){const d=a.ancestors[a.ancestors.length-1];d&&(a.place=d.position)}const u=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=u?u.line:void 0,this.name=lh(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Cr.prototype.file="";Cr.prototype.name="";Cr.prototype.reason="";Cr.prototype.message="";Cr.prototype.stack="";Cr.prototype.column=void 0;Cr.prototype.line=void 0;Cr.prototype.ancestors=void 0;Cr.prototype.cause=void 0;Cr.prototype.fatal=void 0;Cr.prototype.place=void 0;Cr.prototype.ruleId=void 0;Cr.prototype.source=void 0;const wk={}.hasOwnProperty,jae=new Map,Nae=/[A-Z]/g,kae=new Set(["table","tbody","thead","tfoot","tr"]),Cae=new Set(["td","th"]),e3="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Aae(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Dae(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Rae(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?xk:pae,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=t3(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function t3(e,t,n){if(t.type==="element")return Oae(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Eae(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return zae(e,t,n);if(t.type==="mdxjsEsm")return _ae(e,t);if(t.type==="root")return Pae(e,t,n);if(t.type==="text")return Tae(e,t)}function Oae(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=xk,e.schema=i),e.ancestors.push(t);const a=r3(e,t.tagName,!1),l=Mae(e,t);let u=jk(e,t);return kae.has(t.tagName)&&(u=u.filter(function(d){return typeof d=="string"?!iae(d):!0})),n3(e,l,a,t),Sk(l,u),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function Eae(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}kh(e,t.position)}function _ae(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);kh(e,t.position)}function zae(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=xk,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:r3(e,t.name,!0),l=Iae(e,t),u=jk(e,t);return n3(e,l,a,t),Sk(l,u),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function Pae(e,t,n){const r={};return Sk(r,jk(e,t)),e.create(t,e.Fragment,r,n)}function Tae(e,t){return t.value}function n3(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Sk(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Rae(e,t,n){return r;function r(i,a,l,u){const f=Array.isArray(l.children)?n:t;return u?f(a,l,u):f(a,l)}}function Dae(e,t){return n;function n(r,i,a,l){const u=Array.isArray(a.children),d=bk(r);return t(i,a,l,u,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function Mae(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&wk.call(t.properties,i)){const a=Lae(e,i,t.properties[i]);if(a){const[l,u]=a;e.tableCellAlignToStyle&&l==="align"&&typeof u=="string"&&Cae.has(t.tagName)?r=u:n[l]=u}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Iae(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const l=a.expression;l.type;const u=l.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else kh(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,a=e.evaluater.evaluateExpression(u.expression)}else kh(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function jk(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:jae;for(;++r<t.children.length;){const a=t.children[r];let l;if(e.passKeys){const d=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(d){const f=i.get(d)||0;l=d+"-"+f,i.set(d,f+1)}}const u=t3(e,a,l);u!==void 0&&n.push(u)}return n}function Lae(e,t,n){const r=dae(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Jie(n):mae(n)),r.property==="style"){let i=typeof n=="object"?n:$ae(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Bae(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?lae[r.property]||r.property:r.attribute,n]}}function $ae(e,t){try{return wae(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Cr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=e3+"#cannot-parse-style-attribute",i}}function r3(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,l;for(;++a<i.length;){const u=EP(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};l=l?{type:"MemberExpression",object:l,property:u,computed:!!(a&&u.type==="Literal"),optional:!1}:u}r=l}else r=EP(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return wk.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);kh(e)}function kh(e,t){const n=new Cr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=e3+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Bae(e){const t={};let n;for(n in e)wk.call(e,n)&&(t[Uae(n)]=e[n]);return t}function Uae(e){let t=e.replace(Nae,qae);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function qae(e){return"-"+e.toLowerCase()}const Mw={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Fae={};function Hae(e,t){const n=Fae,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return i3(e,r,i)}function i3(e,t,n){if(Kae(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return $P(e.children,t,n)}return Array.isArray(e)?$P(e,t,n):""}function $P(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=i3(e[i],t,n);return r.join("")}function Kae(e){return!!(e&&typeof e=="object")}const BP=document.createElement("i");function Nk(e){const t="&"+e+";";BP.innerHTML=t;const n=BP.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ua(e,t,n,r){const i=e.length;let a=0,l;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a<r.length;)l=r.slice(a,a+1e4),l.unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function Li(e,t){return e.length>0?(Ua(e,e.length,0,t),e):t}const UP={}.hasOwnProperty;function Gae(e){const t={};let n=-1;for(;++n<e.length;)Vae(t,e[n]);return t}function Vae(e,t){let n;for(n in t){const i=(UP.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){UP.call(i,l)||(i[l]=[]);const u=a[l];Qae(i[l],Array.isArray(u)?u:u?[u]:[])}}}function Qae(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ua(e,0,0,r)}function a3(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Bu(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Da=Xo(/[A-Za-z]/),fi=Xo(/[\dA-Za-z]/),Yae=Xo(/[#-'*+\--9=?A-Z^-~]/);function l1(e){return e!==null&&(e<32||e===127)}const c1=Xo(/\d/),Wae=Xo(/[\dA-Fa-f]/),Zae=Xo(/[!-/:-@[-`{-~]/);function et(e){return e!==null&&e<-2}function Xr(e){return e!==null&&(e<0||e===32)}function Pt(e){return e===-2||e===-1||e===32}const Xae=Xo(new RegExp("\\p{P}|\\p{S}","u")),Jae=Xo(/\s/);function Xo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function wd(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&fi(e.charCodeAt(n+1))&&fi(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){const u=e.charCodeAt(n+1);a<56320&&u>56319&&u<57344?(l=String.fromCharCode(a,u),i=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Jt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(d){return Pt(d)?(e.enter(n),u(d)):t(d)}function u(d){return Pt(d)&&a++<i?(e.consume(d),u):(e.exit(n),t(d))}}const ese={tokenize:tse};function tse(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Jt(e,t,"linePrefix")}function i(u){return e.enter("paragraph"),a(u)}function a(u){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(u)}function l(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return et(u)?(e.consume(u),e.exit("chunkText"),a):(e.consume(u),l)}}const nse={tokenize:rse},qP={tokenize:ise};function rse(e){const t=this,n=[];let r=0,i,a,l;return u;function u(C){if(r<n.length){const A=n[r];return t.containerState=A[1],e.attempt(A[0].continuation,d,f)(C)}return f(C)}function d(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&E();const A=t.events.length;let P=A,O;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){O=t.events[P][1].end;break}k(r);let _=A;for(;_<t.events.length;)t.events[_][1].end={...O},_++;return Ua(t.events,P+1,0,t.events.slice(A)),t.events.length=_,f(C)}return u(C)}function f(C){if(r===n.length){if(!i)return g(C);if(i.currentConstruct&&i.currentConstruct.concrete)return S(C);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(qP,p,m)(C)}function p(C){return i&&E(),k(r),g(C)}function m(C){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,S(C)}function g(C){return t.containerState={},e.attempt(qP,v,S)(C)}function v(C){return r++,n.push([t.currentConstruct,t.containerState]),g(C)}function S(C){if(C===null){i&&E(),k(0),e.consume(C);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),b(C)}function b(C){if(C===null){j(e.exit("chunkFlow"),!0),k(0),e.consume(C);return}return et(C)?(e.consume(C),j(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(C),b)}function j(C,A){const P=t.sliceStream(C);if(A&&P.push(null),C.previous=a,a&&(a.next=C),a=C,i.defineSkip(C.start),i.write(P),t.parser.lazy[C.start.line]){let O=i.events.length;for(;O--;)if(i.events[O][1].start.offset<l&&(!i.events[O][1].end||i.events[O][1].end.offset>l))return;const _=t.events.length;let T=_,$,F;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if($){F=t.events[T][1].end;break}$=!0}for(k(r),O=_;O<t.events.length;)t.events[O][1].end={...F},O++;Ua(t.events,T+1,0,t.events.slice(_)),t.events.length=O}}function k(C){let A=n.length;for(;A-- >C;){const P=n[A];t.containerState=P[1],P[0].exit.call(t,e)}n.length=C}function E(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ise(e,t,n){return Jt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function FP(e){if(e===null||Xr(e)||Jae(e))return 1;if(Xae(e))return 2}function kk(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const u1={name:"attention",resolveAll:ase,tokenize:sse};function ase(e,t){let n=-1,r,i,a,l,u,d,f,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},g={...e[n][1].start};HP(m,-d),HP(g,d),l={type:d>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},u={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:g},a={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:d>1?"strong":"emphasis",start:{...l.start},end:{...u.end}},e[r][1].end={...l.start},e[n][1].start={...u.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=Li(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=Li(f,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",a,t]]),f=Li(f,kk(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=Li(f,[["exit",a,t],["enter",u,t],["exit",u,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=Li(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Ua(e,r-1,n-r+3,f),n=r+f.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function sse(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=FP(r);let a;return l;function l(d){return a=d,e.enter("attentionSequence"),u(d)}function u(d){if(d===a)return e.consume(d),u;const f=e.exit("attentionSequence"),p=FP(d),m=!p||p===2&&i||n.includes(d),g=!i||i===2&&p||n.includes(r);return f._open=!!(a===42?m:m&&(i||!g)),f._close=!!(a===42?g:g&&(p||!m)),t(d)}}function HP(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const ose={name:"autolink",tokenize:lse};function lse(e,t,n){let r=0;return i;function i(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(v){return Da(v)?(e.consume(v),l):v===64?n(v):f(v)}function l(v){return v===43||v===45||v===46||fi(v)?(r=1,u(v)):f(v)}function u(v){return v===58?(e.consume(v),r=0,d):(v===43||v===45||v===46||fi(v))&&r++<32?(e.consume(v),u):(r=0,f(v))}function d(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||l1(v)?n(v):(e.consume(v),d)}function f(v){return v===64?(e.consume(v),p):Yae(v)?(e.consume(v),f):n(v)}function p(v){return fi(v)?m(v):n(v)}function m(v){return v===46?(e.consume(v),r=0,p):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):g(v)}function g(v){if((v===45||fi(v))&&r++<63){const S=v===45?g:m;return e.consume(v),S}return n(v)}}const Uv={partial:!0,tokenize:cse};function cse(e,t,n){return r;function r(a){return Pt(a)?Jt(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||et(a)?t(a):n(a)}}const s3={continuation:{tokenize:dse},exit:fse,name:"blockQuote",tokenize:use};function use(e,t,n){const r=this;return i;function i(l){if(l===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),a}return n(l)}function a(l){return Pt(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function dse(e,t,n){const r=this;return i;function i(l){return Pt(l)?Jt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(s3,t,n)(l)}}function fse(e){e.exit("blockQuote")}const o3={name:"characterEscape",tokenize:hse};function hse(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return Zae(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const l3={name:"characterReference",tokenize:pse};function pse(e,t,n){const r=this;let i=0,a,l;return u;function u(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),d}function d(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),a=31,l=fi,p(m))}function f(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,l=Wae,p):(e.enter("characterReferenceValue"),a=7,l=c1,p(m))}function p(m){if(m===59&&i){const g=e.exit("characterReferenceValue");return l===fi&&!Nk(r.sliceSerialize(g))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(m)&&i++<a?(e.consume(m),p):n(m)}}const KP={partial:!0,tokenize:gse},GP={concrete:!0,name:"codeFenced",tokenize:mse};function mse(e,t,n){const r=this,i={partial:!0,tokenize:P};let a=0,l=0,u;return d;function d(O){return f(O)}function f(O){const _=r.events[r.events.length-1];return a=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,u=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(O)}function p(O){return O===u?(l++,e.consume(O),p):l<3?n(O):(e.exit("codeFencedFenceSequence"),Pt(O)?Jt(e,m,"whitespace")(O):m(O))}function m(O){return O===null||et(O)?(e.exit("codeFencedFence"),r.interrupt?t(O):e.check(KP,b,A)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(O))}function g(O){return O===null||et(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(O)):Pt(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Jt(e,v,"whitespace")(O)):O===96&&O===u?n(O):(e.consume(O),g)}function v(O){return O===null||et(O)?m(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(O))}function S(O){return O===null||et(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(O)):O===96&&O===u?n(O):(e.consume(O),S)}function b(O){return e.attempt(i,A,j)(O)}function j(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),k}function k(O){return a>0&&Pt(O)?Jt(e,E,"linePrefix",a+1)(O):E(O)}function E(O){return O===null||et(O)?e.check(KP,b,A)(O):(e.enter("codeFlowValue"),C(O))}function C(O){return O===null||et(O)?(e.exit("codeFlowValue"),E(O)):(e.consume(O),C)}function A(O){return e.exit("codeFenced"),t(O)}function P(O,_,T){let $=0;return F;function F(Z){return O.enter("lineEnding"),O.consume(Z),O.exit("lineEnding"),U}function U(Z){return O.enter("codeFencedFence"),Pt(Z)?Jt(O,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):B(Z)}function B(Z){return Z===u?(O.enter("codeFencedFenceSequence"),V(Z)):T(Z)}function V(Z){return Z===u?($++,O.consume(Z),V):$>=l?(O.exit("codeFencedFenceSequence"),Pt(Z)?Jt(O,X,"whitespace")(Z):X(Z)):T(Z)}function X(Z){return Z===null||et(Z)?(O.exit("codeFencedFence"),_(Z)):T(Z)}}}function gse(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Iw={name:"codeIndented",tokenize:vse},yse={partial:!0,tokenize:xse};function vse(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),Jt(e,a,"linePrefix",5)(f)}function a(f){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?l(f):n(f)}function l(f){return f===null?d(f):et(f)?e.attempt(yse,l,d)(f):(e.enter("codeFlowValue"),u(f))}function u(f){return f===null||et(f)?(e.exit("codeFlowValue"),l(f)):(e.consume(f),u)}function d(f){return e.exit("codeIndented"),t(f)}}function xse(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):et(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):Jt(e,a,"linePrefix",5)(l)}function a(l){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):et(l)?i(l):n(l)}}const bse={name:"codeText",previous:Sse,resolve:wse,tokenize:jse};function wse(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Sse(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function jse(e,t,n){let r=0,i,a;return l;function l(m){return e.enter("codeText"),e.enter("codeTextSequence"),u(m)}function u(m){return m===96?(e.consume(m),r++,u):(e.exit("codeTextSequence"),d(m))}function d(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),d):m===96?(a=e.enter("codeTextSequence"),i=0,p(m)):et(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("codeTextData"),f(m))}function f(m){return m===null||m===32||m===96||et(m)?(e.exit("codeTextData"),d(m)):(e.consume(m),f)}function p(m){return m===96?(e.consume(m),i++,p):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(a.type="codeTextData",f(m))}}class Nse{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&$f(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),$f(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),$f(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);$f(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);$f(this.left,n.reverse())}}}function $f(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function c3(e){const t={};let n=-1,r,i,a,l,u,d,f;const p=new Nse(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,a=0,a<d.length&&d[a][1].type==="lineEndingBlank"&&(a+=2),a<d.length&&d[a][1].type==="content"))for(;++a<d.length&&d[a][1].type!=="content";)d[a][1].type==="chunkText"&&(d[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,kse(p,n)),n=t[n],f=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(l=p.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=a);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...p.get(i)[1].start},u=p.slice(i,n),u.unshift(r),p.splice(i,n-i+1,u))}}return Ua(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function kse(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const u=l.events,d=[],f={};let p,m,g=-1,v=n,S=0,b=0;const j=[b];for(;v;){for(;e.get(++i)[1]!==v;);a.push(i),v._tokenizer||(p=r.sliceStream(v),v.next||p.push(null),m&&l.defineSkip(v.start),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(p),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),m=v,v=v.next}for(v=n;++g<u.length;)u[g][0]==="exit"&&u[g-1][0]==="enter"&&u[g][1].type===u[g-1][1].type&&u[g][1].start.line!==u[g][1].end.line&&(b=g+1,j.push(b),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(l.events=[],v?(v._tokenizer=void 0,v.previous=void 0):j.pop(),g=j.length;g--;){const k=u.slice(j[g],j[g+1]),E=a.pop();d.push([E,E+k.length-1]),e.splice(E,2,k)}for(d.reverse(),g=-1;++g<d.length;)f[S+d[g][0]]=S+d[g][1],S+=d[g][1]-d[g][0]-1;return f}const Cse={resolve:Ose,tokenize:Ese},Ase={partial:!0,tokenize:_se};function Ose(e){return c3(e),e}function Ese(e,t){let n;return r;function r(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(u)}function i(u){return u===null?a(u):et(u)?e.check(Ase,l,a)(u):(e.consume(u),i)}function a(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function l(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function _se(e,t,n){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Jt(e,a,"linePrefix")}function a(l){if(l===null||et(l))return n(l);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function u3(e,t,n,r,i,a,l,u,d){const f=d||Number.POSITIVE_INFINITY;let p=0;return m;function m(k){return k===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(k),e.exit(a),g):k===null||k===32||k===41||l1(k)?n(k):(e.enter(r),e.enter(l),e.enter(u),e.enter("chunkString",{contentType:"string"}),b(k))}function g(k){return k===62?(e.enter(a),e.consume(k),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),v(k))}function v(k){return k===62?(e.exit("chunkString"),e.exit(u),g(k)):k===null||k===60||et(k)?n(k):(e.consume(k),k===92?S:v)}function S(k){return k===60||k===62||k===92?(e.consume(k),v):v(k)}function b(k){return!p&&(k===null||k===41||Xr(k))?(e.exit("chunkString"),e.exit(u),e.exit(l),e.exit(r),t(k)):p<f&&k===40?(e.consume(k),p++,b):k===41?(e.consume(k),p--,b):k===null||k===32||k===40||l1(k)?n(k):(e.consume(k),k===92?j:b)}function j(k){return k===40||k===41||k===92?(e.consume(k),b):b(k)}}function d3(e,t,n,r,i,a){const l=this;let u=0,d;return f;function f(v){return e.enter(r),e.enter(i),e.consume(v),e.exit(i),e.enter(a),p}function p(v){return u>999||v===null||v===91||v===93&&!d||v===94&&!u&&"_hiddenFootnoteSupport"in l.parser.constructs?n(v):v===93?(e.exit(a),e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):et(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===null||v===91||v===93||et(v)||u++>999?(e.exit("chunkString"),p(v)):(e.consume(v),d||(d=!Pt(v)),v===92?g:m)}function g(v){return v===91||v===92||v===93?(e.consume(v),u++,m):m(v)}}function f3(e,t,n,r,i,a){let l;return u;function u(g){return g===34||g===39||g===40?(e.enter(r),e.enter(i),e.consume(g),e.exit(i),l=g===40?41:g,d):n(g)}function d(g){return g===l?(e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):(e.enter(a),f(g))}function f(g){return g===l?(e.exit(a),d(l)):g===null?n(g):et(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),Jt(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===l||g===null||et(g)?(e.exit("chunkString"),f(g)):(e.consume(g),g===92?m:p)}function m(g){return g===l||g===92?(e.consume(g),p):p(g)}}function ch(e,t){let n;return r;function r(i){return et(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Pt(i)?Jt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const zse={name:"definition",tokenize:Tse},Pse={partial:!0,tokenize:Rse};function Tse(e,t,n){const r=this;let i;return a;function a(v){return e.enter("definition"),l(v)}function l(v){return d3.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function u(v){return i=Bu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),d):n(v)}function d(v){return Xr(v)?ch(e,f)(v):f(v)}function f(v){return u3(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(Pse,m,m)(v)}function m(v){return Pt(v)?Jt(e,g,"whitespace")(v):g(v)}function g(v){return v===null||et(v)?(e.exit("definition"),r.parser.defined.push(i),t(v)):n(v)}}function Rse(e,t,n){return r;function r(u){return Xr(u)?ch(e,i)(u):n(u)}function i(u){return f3(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function a(u){return Pt(u)?Jt(e,l,"whitespace")(u):l(u)}function l(u){return u===null||et(u)?t(u):n(u)}}const Dse={name:"hardBreakEscape",tokenize:Mse};function Mse(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return et(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const Ise={name:"headingAtx",resolve:Lse,tokenize:$se};function Lse(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Ua(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function $se(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),a(p)}function a(p){return e.enter("atxHeadingSequence"),l(p)}function l(p){return p===35&&r++<6?(e.consume(p),l):p===null||Xr(p)?(e.exit("atxHeadingSequence"),u(p)):n(p)}function u(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||et(p)?(e.exit("atxHeading"),t(p)):Pt(p)?Jt(e,u,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),u(p))}function f(p){return p===null||p===35||Xr(p)?(e.exit("atxHeadingText"),u(p)):(e.consume(p),f)}}const Bse=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],VP=["pre","script","style","textarea"],Use={concrete:!0,name:"htmlFlow",resolveTo:Hse,tokenize:Kse},qse={partial:!0,tokenize:Vse},Fse={partial:!0,tokenize:Gse};function Hse(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Kse(e,t,n){const r=this;let i,a,l,u,d;return f;function f(D){return p(D)}function p(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),m}function m(D){return D===33?(e.consume(D),g):D===47?(e.consume(D),a=!0,b):D===63?(e.consume(D),i=3,r.interrupt?t:I):Da(D)?(e.consume(D),l=String.fromCharCode(D),j):n(D)}function g(D){return D===45?(e.consume(D),i=2,v):D===91?(e.consume(D),i=5,u=0,S):Da(D)?(e.consume(D),i=4,r.interrupt?t:I):n(D)}function v(D){return D===45?(e.consume(D),r.interrupt?t:I):n(D)}function S(D){const G="CDATA[";return D===G.charCodeAt(u++)?(e.consume(D),u===G.length?r.interrupt?t:B:S):n(D)}function b(D){return Da(D)?(e.consume(D),l=String.fromCharCode(D),j):n(D)}function j(D){if(D===null||D===47||D===62||Xr(D)){const G=D===47,se=l.toLowerCase();return!G&&!a&&VP.includes(se)?(i=1,r.interrupt?t(D):B(D)):Bse.includes(l.toLowerCase())?(i=6,G?(e.consume(D),k):r.interrupt?t(D):B(D)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(D):a?E(D):C(D))}return D===45||fi(D)?(e.consume(D),l+=String.fromCharCode(D),j):n(D)}function k(D){return D===62?(e.consume(D),r.interrupt?t:B):n(D)}function E(D){return Pt(D)?(e.consume(D),E):F(D)}function C(D){return D===47?(e.consume(D),F):D===58||D===95||Da(D)?(e.consume(D),A):Pt(D)?(e.consume(D),C):F(D)}function A(D){return D===45||D===46||D===58||D===95||fi(D)?(e.consume(D),A):P(D)}function P(D){return D===61?(e.consume(D),O):Pt(D)?(e.consume(D),P):C(D)}function O(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),d=D,_):Pt(D)?(e.consume(D),O):T(D)}function _(D){return D===d?(e.consume(D),d=null,$):D===null||et(D)?n(D):(e.consume(D),_)}function T(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||Xr(D)?P(D):(e.consume(D),T)}function $(D){return D===47||D===62||Pt(D)?C(D):n(D)}function F(D){return D===62?(e.consume(D),U):n(D)}function U(D){return D===null||et(D)?B(D):Pt(D)?(e.consume(D),U):n(D)}function B(D){return D===45&&i===2?(e.consume(D),H):D===60&&i===1?(e.consume(D),J):D===62&&i===4?(e.consume(D),M):D===63&&i===3?(e.consume(D),I):D===93&&i===5?(e.consume(D),ye):et(D)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(qse,q,V)(D)):D===null||et(D)?(e.exit("htmlFlowData"),V(D)):(e.consume(D),B)}function V(D){return e.check(Fse,X,q)(D)}function X(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),Z}function Z(D){return D===null||et(D)?V(D):(e.enter("htmlFlowData"),B(D))}function H(D){return D===45?(e.consume(D),I):B(D)}function J(D){return D===47?(e.consume(D),l="",oe):B(D)}function oe(D){if(D===62){const G=l.toLowerCase();return VP.includes(G)?(e.consume(D),M):B(D)}return Da(D)&&l.length<8?(e.consume(D),l+=String.fromCharCode(D),oe):B(D)}function ye(D){return D===93?(e.consume(D),I):B(D)}function I(D){return D===62?(e.consume(D),M):D===45&&i===2?(e.consume(D),I):B(D)}function M(D){return D===null||et(D)?(e.exit("htmlFlowData"),q(D)):(e.consume(D),M)}function q(D){return e.exit("htmlFlow"),t(D)}}function Gse(e,t,n){const r=this;return i;function i(l){return et(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):n(l)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function Vse(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Uv,t,n)}}const Qse={name:"htmlText",tokenize:Yse};function Yse(e,t,n){const r=this;let i,a,l;return u;function u(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),d}function d(I){return I===33?(e.consume(I),f):I===47?(e.consume(I),P):I===63?(e.consume(I),C):Da(I)?(e.consume(I),T):n(I)}function f(I){return I===45?(e.consume(I),p):I===91?(e.consume(I),a=0,S):Da(I)?(e.consume(I),E):n(I)}function p(I){return I===45?(e.consume(I),v):n(I)}function m(I){return I===null?n(I):I===45?(e.consume(I),g):et(I)?(l=m,J(I)):(e.consume(I),m)}function g(I){return I===45?(e.consume(I),v):m(I)}function v(I){return I===62?H(I):I===45?g(I):m(I)}function S(I){const M="CDATA[";return I===M.charCodeAt(a++)?(e.consume(I),a===M.length?b:S):n(I)}function b(I){return I===null?n(I):I===93?(e.consume(I),j):et(I)?(l=b,J(I)):(e.consume(I),b)}function j(I){return I===93?(e.consume(I),k):b(I)}function k(I){return I===62?H(I):I===93?(e.consume(I),k):b(I)}function E(I){return I===null||I===62?H(I):et(I)?(l=E,J(I)):(e.consume(I),E)}function C(I){return I===null?n(I):I===63?(e.consume(I),A):et(I)?(l=C,J(I)):(e.consume(I),C)}function A(I){return I===62?H(I):C(I)}function P(I){return Da(I)?(e.consume(I),O):n(I)}function O(I){return I===45||fi(I)?(e.consume(I),O):_(I)}function _(I){return et(I)?(l=_,J(I)):Pt(I)?(e.consume(I),_):H(I)}function T(I){return I===45||fi(I)?(e.consume(I),T):I===47||I===62||Xr(I)?$(I):n(I)}function $(I){return I===47?(e.consume(I),H):I===58||I===95||Da(I)?(e.consume(I),F):et(I)?(l=$,J(I)):Pt(I)?(e.consume(I),$):H(I)}function F(I){return I===45||I===46||I===58||I===95||fi(I)?(e.consume(I),F):U(I)}function U(I){return I===61?(e.consume(I),B):et(I)?(l=U,J(I)):Pt(I)?(e.consume(I),U):$(I)}function B(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),i=I,V):et(I)?(l=B,J(I)):Pt(I)?(e.consume(I),B):(e.consume(I),X)}function V(I){return I===i?(e.consume(I),i=void 0,Z):I===null?n(I):et(I)?(l=V,J(I)):(e.consume(I),V)}function X(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||Xr(I)?$(I):(e.consume(I),X)}function Z(I){return I===47||I===62||Xr(I)?$(I):n(I)}function H(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):n(I)}function J(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),oe}function oe(I){return Pt(I)?Jt(e,ye,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):ye(I)}function ye(I){return e.enter("htmlTextData"),l(I)}}const Ck={name:"labelEnd",resolveAll:Jse,resolveTo:eoe,tokenize:toe},Wse={tokenize:noe},Zse={tokenize:roe},Xse={tokenize:ioe};function Jse(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Ua(e,0,e.length,n),e}function eoe(e,t){let n=e.length,r=0,i,a,l,u;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=n);const d={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[a][1].start},end:{...e[l][1].end}},p={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[l-2][1].start}};return u=[["enter",d,t],["enter",f,t]],u=Li(u,e.slice(a+1,a+r+3)),u=Li(u,[["enter",p,t]]),u=Li(u,kk(t.parser.constructs.insideSpan.null,e.slice(a+r+4,l-3),t)),u=Li(u,[["exit",p,t],e[l-2],e[l-1],["exit",f,t]]),u=Li(u,e.slice(l+1)),u=Li(u,[["exit",d,t]]),Ua(e,a,e.length,u),e}function toe(e,t,n){const r=this;let i=r.events.length,a,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return u;function u(g){return a?a._inactive?m(g):(l=r.parser.defined.includes(Bu(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),d):n(g)}function d(g){return g===40?e.attempt(Wse,p,l?p:m)(g):g===91?e.attempt(Zse,p,l?f:m)(g):l?p(g):m(g)}function f(g){return e.attempt(Xse,p,m)(g)}function p(g){return t(g)}function m(g){return a._balanced=!0,n(g)}}function noe(e,t,n){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),i}function i(m){return Xr(m)?ch(e,a)(m):a(m)}function a(m){return m===41?p(m):u3(e,l,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function l(m){return Xr(m)?ch(e,d)(m):p(m)}function u(m){return n(m)}function d(m){return m===34||m===39||m===40?f3(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function f(m){return Xr(m)?ch(e,p)(m):p(m)}function p(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function roe(e,t,n){const r=this;return i;function i(u){return d3.call(r,e,a,l,"reference","referenceMarker","referenceString")(u)}function a(u){return r.parser.defined.includes(Bu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function l(u){return n(u)}}function ioe(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const aoe={name:"labelStartImage",resolveAll:Ck.resolveAll,tokenize:soe};function soe(e,t,n){const r=this;return i;function i(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),a}function a(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),l):n(u)}function l(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const ooe={name:"labelStartLink",resolveAll:Ck.resolveAll,tokenize:loe};function loe(e,t,n){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const Lw={name:"lineEnding",tokenize:coe};function coe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Jt(e,t,"linePrefix")}}const Ig={name:"thematicBreak",tokenize:uoe};function uoe(e,t,n){let r=0,i;return a;function a(f){return e.enter("thematicBreak"),l(f)}function l(f){return i=f,u(f)}function u(f){return f===i?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||et(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===i?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),Pt(f)?Jt(e,u,"whitespace")(f):u(f))}}const Gr={continuation:{tokenize:poe},exit:goe,name:"list",tokenize:hoe},doe={partial:!0,tokenize:yoe},foe={partial:!0,tokenize:moe};function hoe(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return u;function u(v){const S=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:c1(v)){if(r.containerState.type||(r.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Ig,n,f)(v):f(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(v)}return n(v)}function d(v){return c1(v)&&++l<10?(e.consume(v),d):(!r.interrupt||l<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),f(v)):n(v)}function f(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(Uv,r.interrupt?n:p,e.attempt(doe,g,m))}function p(v){return r.containerState.initialBlankLine=!0,a++,g(v)}function m(v){return Pt(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),g):n(v)}function g(v){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function poe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Uv,i,a);function i(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Jt(e,t,"listItemIndent",r.containerState.size+1)(u)}function a(u){return r.containerState.furtherBlankLines||!Pt(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(foe,t,l)(u))}function l(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,Jt(e,e.attempt(Gr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function moe(e,t,n){const r=this;return Jt(e,i,"listItemIndent",r.containerState.size+1);function i(a){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(a):n(a)}}function goe(e){e.exit(this.containerState.type)}function yoe(e,t,n){const r=this;return Jt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const l=r.events[r.events.length-1];return!Pt(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const QP={name:"setextUnderline",resolveTo:voe,tokenize:xoe};function voe(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",l,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function xoe(e,t,n){const r=this;let i;return a;function a(f){let p=r.events.length,m;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){m=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),i=f,l(f)):n(f)}function l(f){return e.enter("setextHeadingLineSequence"),u(f)}function u(f){return f===i?(e.consume(f),u):(e.exit("setextHeadingLineSequence"),Pt(f)?Jt(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||et(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const boe={tokenize:woe};function woe(e){const t=this,n=e.attempt(Uv,r,e.attempt(this.parser.constructs.flowInitial,i,Jt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Cse,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Soe={resolveAll:p3()},joe=h3("string"),Noe=h3("text");function h3(e){return{resolveAll:p3(e==="text"?koe:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,l,u);return l;function l(p){return f(p)?a(p):u(p)}function u(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return f(p)?(n.exit("data"),a(p)):(n.consume(p),d)}function f(p){if(p===null)return!0;const m=i[p];let g=-1;if(m)for(;++g<m.length;){const v=m[g];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function p3(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function koe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let a=i.length,l=-1,u=0,d;for(;a--;){const f=i[a];if(typeof f=="string"){for(l=f.length;f.charCodeAt(l-1)===32;)u++,l--;if(l)break;l=-1}else if(f===-2)d=!0,u++;else if(f!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const f={type:n===e.length||d||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:r.start._bufferIndex+l,_index:r.start._index+a,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const Coe={42:Gr,43:Gr,45:Gr,48:Gr,49:Gr,50:Gr,51:Gr,52:Gr,53:Gr,54:Gr,55:Gr,56:Gr,57:Gr,62:s3},Aoe={91:zse},Ooe={[-2]:Iw,[-1]:Iw,32:Iw},Eoe={35:Ise,42:Ig,45:[QP,Ig],60:Use,61:QP,95:Ig,96:GP,126:GP},_oe={38:l3,92:o3},zoe={[-5]:Lw,[-4]:Lw,[-3]:Lw,33:aoe,38:l3,42:u1,60:[ose,Qse],91:ooe,92:[Dse,o3],93:Ck,95:u1,96:bse},Poe={null:[u1,Soe]},Toe={null:[42,95]},Roe={null:[]},Doe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Toe,contentInitial:Aoe,disable:Roe,document:Coe,flow:Eoe,flowInitial:Ooe,insideSpan:Poe,string:_oe,text:zoe},Symbol.toStringTag,{value:"Module"}));function Moe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let l=[],u=[];const d={attempt:_(P),check:_(O),consume:E,enter:C,exit:A,interrupt:_(O,{interrupt:!0})},f={code:null,containerState:{},defineSkip:b,events:[],now:S,parser:e,previous:null,sliceSerialize:g,sliceStream:v,write:m};let p=t.tokenize.call(f,d);return t.resolveAll&&a.push(t),f;function m(U){return l=Li(l,U),j(),l[l.length-1]!==null?[]:(T(t,0),f.events=kk(a,f.events,f),f.events)}function g(U,B){return Loe(v(U),B)}function v(U){return Ioe(l,U)}function S(){const{_bufferIndex:U,_index:B,line:V,column:X,offset:Z}=r;return{_bufferIndex:U,_index:B,line:V,column:X,offset:Z}}function b(U){i[U.line]=U.column,F()}function j(){let U;for(;r._index<l.length;){const B=l[r._index];if(typeof B=="string")for(U=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===U&&r._bufferIndex<B.length;)k(B.charCodeAt(r._bufferIndex));else k(B)}}function k(U){p=p(U)}function E(U){et(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,F()):U!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=U}function C(U,B){const V=B||{};return V.type=U,V.start=S(),f.events.push(["enter",V,f]),u.push(V),V}function A(U){const B=u.pop();return B.end=S(),f.events.push(["exit",B,f]),B}function P(U,B){T(U,B.from)}function O(U,B){B.restore()}function _(U,B){return V;function V(X,Z,H){let J,oe,ye,I;return Array.isArray(X)?q(X):"tokenize"in X?q([X]):M(X);function M(ne){return Ce;function Ce(je){const ee=je!==null&&ne[je],pe=je!==null&&ne.null,Ee=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(pe)?pe:pe?[pe]:[]];return q(Ee)(je)}}function q(ne){return J=ne,oe=0,ne.length===0?H:D(ne[oe])}function D(ne){return Ce;function Ce(je){return I=$(),ye=ne,ne.partial||(f.currentConstruct=ne),ne.name&&f.parser.constructs.disable.null.includes(ne.name)?se():ne.tokenize.call(B?Object.assign(Object.create(f),B):f,d,G,se)(je)}}function G(ne){return U(ye,I),Z}function se(ne){return I.restore(),++oe<J.length?D(J[oe]):H}}}function T(U,B){U.resolveAll&&!a.includes(U)&&a.push(U),U.resolve&&Ua(f.events,B,f.events.length-B,U.resolve(f.events.slice(B),f)),U.resolveTo&&(f.events=U.resolveTo(f.events,f))}function $(){const U=S(),B=f.previous,V=f.currentConstruct,X=f.events.length,Z=Array.from(u);return{from:X,restore:H};function H(){r=U,f.previous=B,f.currentConstruct=V,f.events.length=X,u=Z,F()}}function F(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ioe(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let l;if(n===i)l=[e[n].slice(r,a)];else{if(l=e.slice(n,i),r>-1){const u=l[0];typeof u=="string"?l[0]=u.slice(r):l.shift()}a>0&&l.push(e[i].slice(0,a))}return l}function Loe(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let l;if(typeof a=="string")l=a;else switch(a){case-5:{l="\r";break}case-4:{l=`
|
|
99
|
-
`;break}case-3:{l=`\r
|
|
100
|
-
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(a)}i=a===-2,r.push(l)}return r.join("")}function $oe(e){const r={constructs:Gae([Doe,...(e||{}).extensions||[]]),content:i(ese),defined:[],document:i(nse),flow:i(boe),lazy:{},string:i(joe),text:i(Noe)};return r;function i(a){return l;function l(u){return Moe(r,a,u)}}}function Boe(e){for(;!c3(e););return e}const YP=/[\0\t\n\r]/g;function Uoe(){let e=1,t="",n=!0,r;return i;function i(a,l,u){const d=[];let f,p,m,g,v;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),m=0,t="",n&&(a.charCodeAt(0)===65279&&m++,n=void 0);m<a.length;){if(YP.lastIndex=m,f=YP.exec(a),g=f&&f.index!==void 0?f.index:a.length,v=a.charCodeAt(g),!f){t=a.slice(m);break}if(v===10&&m===g&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),m<g&&(d.push(a.slice(m,g)),e+=g-m),v){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}m=g+1}return u&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const qoe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Foe(e){return e.replace(qoe,Hoe)}function Hoe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return a3(n.slice(a?2:1),a?16:10)}return Nk(n)||e}const m3={}.hasOwnProperty;function Koe(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Goe(n)(Boe($oe(n).document().write(Uoe()(e,t,!0))))}function Goe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(un),autolinkProtocol:$,autolinkEmail:$,atxHeading:a(st),blockQuote:a(pe),characterEscape:$,characterReference:$,codeFenced:a(Ee),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(Ee,l),codeText:a(W,l),codeTextData:$,data:$,codeFlowValue:$,definition:a(He),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(Te),hardBreakEscape:a(Ve),hardBreakTrailing:a(Ve),htmlFlow:a(Ht,l),htmlFlowData:$,htmlText:a(Ht,l),htmlTextData:$,image:a(Lt),label:l,link:a(un),listItem:a(Se),listItemValue:g,listOrdered:a(tn,m),listUnordered:a(tn),paragraph:a(Ze),reference:D,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(st),strong:a(Tt),thematicBreak:a(Je)},exit:{atxHeading:d(),atxHeadingSequence:P,autolink:d(),autolinkEmail:ee,autolinkProtocol:je,blockQuote:d(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:ne,characterReference:Ce,codeFenced:d(j),codeFencedFence:b,codeFencedFenceInfo:v,codeFencedFenceMeta:S,codeFlowValue:F,codeIndented:d(k),codeText:d(Z),codeTextData:F,data:F,definition:d(),definitionDestinationString:A,definitionLabelString:E,definitionTitleString:C,emphasis:d(),hardBreakEscape:d(B),hardBreakTrailing:d(B),htmlFlow:d(V),htmlFlowData:F,htmlText:d(X),htmlTextData:F,image:d(J),label:ye,labelText:oe,lineEnding:U,link:d(H),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:G,resourceDestinationString:I,resourceTitleString:M,resource:q,setextHeading:d(T),setextHeadingLineSequence:_,setextHeadingText:O,strong:d(),thematicBreak:d()}};g3(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ce){let Ne={type:"root",children:[]};const Me={stack:[Ne],tokenStack:[],config:t,enter:u,exit:f,buffer:l,resume:p,data:n},Ge=[];let pt=-1;for(;++pt<ce.length;)if(ce[pt][1].type==="listOrdered"||ce[pt][1].type==="listUnordered")if(ce[pt][0]==="enter")Ge.push(pt);else{const mn=Ge.pop();pt=i(ce,mn,pt)}for(pt=-1;++pt<ce.length;){const mn=t[ce[pt][0]];m3.call(mn,ce[pt][1].type)&&mn[ce[pt][1].type].call(Object.assign({sliceSerialize:ce[pt][2].sliceSerialize},Me),ce[pt][1])}if(Me.tokenStack.length>0){const mn=Me.tokenStack[Me.tokenStack.length-1];(mn[1]||WP).call(Me,void 0,mn[0])}for(Ne.position={start:So(ce.length>0?ce[0][1].start:{line:1,column:1,offset:0}),end:So(ce.length>0?ce[ce.length-2][1].end:{line:1,column:1,offset:0})},pt=-1;++pt<t.transforms.length;)Ne=t.transforms[pt](Ne)||Ne;return Ne}function i(ce,Ne,Me){let Ge=Ne-1,pt=-1,mn=!1,An,gn,Ye,Kt;for(;++Ge<=Me;){const de=ce[Ge];switch(de[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{de[0]==="enter"?pt++:pt--,Kt=void 0;break}case"lineEndingBlank":{de[0]==="enter"&&(An&&!Kt&&!pt&&!Ye&&(Ye=Ge),Kt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Kt=void 0}if(!pt&&de[0]==="enter"&&de[1].type==="listItemPrefix"||pt===-1&&de[0]==="exit"&&(de[1].type==="listUnordered"||de[1].type==="listOrdered")){if(An){let ze=Ge;for(gn=void 0;ze--;){const fe=ce[ze];if(fe[1].type==="lineEnding"||fe[1].type==="lineEndingBlank"){if(fe[0]==="exit")continue;gn&&(ce[gn][1].type="lineEndingBlank",mn=!0),fe[1].type="lineEnding",gn=ze}else if(!(fe[1].type==="linePrefix"||fe[1].type==="blockQuotePrefix"||fe[1].type==="blockQuotePrefixWhitespace"||fe[1].type==="blockQuoteMarker"||fe[1].type==="listItemIndent"))break}Ye&&(!gn||Ye<gn)&&(An._spread=!0),An.end=Object.assign({},gn?ce[gn][1].start:de[1].end),ce.splice(gn||Ge,0,["exit",An,de[2]]),Ge++,Me++}if(de[1].type==="listItemPrefix"){const ze={type:"listItem",_spread:!1,start:Object.assign({},de[1].start),end:void 0};An=ze,ce.splice(Ge,0,["enter",ze,de[2]]),Ge++,Me++,Ye=void 0,Kt=!0}}}return ce[Ne][1]._spread=mn,Me}function a(ce,Ne){return Me;function Me(Ge){u.call(this,ce(Ge),Ge),Ne&&Ne.call(this,Ge)}}function l(){this.stack.push({type:"fragment",children:[]})}function u(ce,Ne,Me){this.stack[this.stack.length-1].children.push(ce),this.stack.push(ce),this.tokenStack.push([Ne,Me||void 0]),ce.position={start:So(Ne.start),end:void 0}}function d(ce){return Ne;function Ne(Me){ce&&ce.call(this,Me),f.call(this,Me)}}function f(ce,Ne){const Me=this.stack.pop(),Ge=this.tokenStack.pop();if(Ge)Ge[0].type!==ce.type&&(Ne?Ne.call(this,ce,Ge[0]):(Ge[1]||WP).call(this,ce,Ge[0]));else throw new Error("Cannot close `"+ce.type+"` ("+lh({start:ce.start,end:ce.end})+"): it’s not open");Me.position.end=So(ce.end)}function p(){return Hae(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function g(ce){if(this.data.expectingFirstListItemValue){const Ne=this.stack[this.stack.length-2];Ne.start=Number.parseInt(this.sliceSerialize(ce),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.lang=ce}function S(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.meta=ce}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function j(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ce.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ce.replace(/(\r?\n|\r)$/g,"")}function E(ce){const Ne=this.resume(),Me=this.stack[this.stack.length-1];Me.label=Ne,Me.identifier=Bu(this.sliceSerialize(ce)).toLowerCase()}function C(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.title=ce}function A(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.url=ce}function P(ce){const Ne=this.stack[this.stack.length-1];if(!Ne.depth){const Me=this.sliceSerialize(ce).length;Ne.depth=Me}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function _(ce){const Ne=this.stack[this.stack.length-1];Ne.depth=this.sliceSerialize(ce).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function $(ce){const Me=this.stack[this.stack.length-1].children;let Ge=Me[Me.length-1];(!Ge||Ge.type!=="text")&&(Ge=mt(),Ge.position={start:So(ce.start),end:void 0},Me.push(Ge)),this.stack.push(Ge)}function F(ce){const Ne=this.stack.pop();Ne.value+=this.sliceSerialize(ce),Ne.position.end=So(ce.end)}function U(ce){const Ne=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Me=Ne.children[Ne.children.length-1];Me.position.end=So(ce.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ne.type)&&($.call(this,ce),F.call(this,ce))}function B(){this.data.atHardBreak=!0}function V(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ce}function X(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ce}function Z(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ce}function H(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const Ne=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=Ne,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function J(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const Ne=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=Ne,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function oe(ce){const Ne=this.sliceSerialize(ce),Me=this.stack[this.stack.length-2];Me.label=Foe(Ne),Me.identifier=Bu(Ne).toLowerCase()}function ye(){const ce=this.stack[this.stack.length-1],Ne=this.resume(),Me=this.stack[this.stack.length-1];if(this.data.inReference=!0,Me.type==="link"){const Ge=ce.children;Me.children=Ge}else Me.alt=Ne}function I(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.url=ce}function M(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.title=ce}function q(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function G(ce){const Ne=this.resume(),Me=this.stack[this.stack.length-1];Me.label=Ne,Me.identifier=Bu(this.sliceSerialize(ce)).toLowerCase(),this.data.referenceType="full"}function se(ce){this.data.characterReferenceType=ce.type}function ne(ce){const Ne=this.sliceSerialize(ce),Me=this.data.characterReferenceType;let Ge;Me?(Ge=a3(Ne,Me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ge=Nk(Ne);const pt=this.stack[this.stack.length-1];pt.value+=Ge}function Ce(ce){const Ne=this.stack.pop();Ne.position.end=So(ce.end)}function je(ce){F.call(this,ce);const Ne=this.stack[this.stack.length-1];Ne.url=this.sliceSerialize(ce)}function ee(ce){F.call(this,ce);const Ne=this.stack[this.stack.length-1];Ne.url="mailto:"+this.sliceSerialize(ce)}function pe(){return{type:"blockquote",children:[]}}function Ee(){return{type:"code",lang:null,meta:null,value:""}}function W(){return{type:"inlineCode",value:""}}function He(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Te(){return{type:"emphasis",children:[]}}function st(){return{type:"heading",depth:0,children:[]}}function Ve(){return{type:"break"}}function Ht(){return{type:"html",value:""}}function Lt(){return{type:"image",title:null,url:"",alt:null}}function un(){return{type:"link",title:null,url:"",children:[]}}function tn(ce){return{type:"list",ordered:ce.type==="listOrdered",start:null,spread:ce._spread,children:[]}}function Se(ce){return{type:"listItem",spread:ce._spread,checked:null,children:[]}}function Ze(){return{type:"paragraph",children:[]}}function Tt(){return{type:"strong",children:[]}}function mt(){return{type:"text",value:""}}function Je(){return{type:"thematicBreak"}}}function So(e){return{line:e.line,column:e.column,offset:e.offset}}function g3(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?g3(e,r):Voe(e,r)}}function Voe(e,t){let n;for(n in t)if(m3.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function WP(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+lh({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+lh({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+lh({start:t.start,end:t.end})+") is still open")}function Qoe(e){const t=this;t.parser=n;function n(r){return Koe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Yoe(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Woe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
101
|
-
`}]}function Zoe(e,t){const n=t.value?t.value+`
|
|
102
|
-
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function Xoe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Joe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ele(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=wd(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let l,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=a+1,u+=1,e.footnoteCounts.set(r,u);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function tle(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nle(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function y3(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function rle(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return y3(e,t);const i={src:wd(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function ile(e,t){const n={src:wd(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function ale(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function sle(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return y3(e,t);const i={href:wd(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function ole(e,t){const n={href:wd(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function lle(e,t,n){const r=e.all(t),i=n?cle(n):v3(t),a={},l=[];if(typeof t.checked=="boolean"){const p=r[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const p=r[u];(i||u!==0||p.type!=="element"||p.tagName!=="p")&&l.push({type:"text",value:`
|
|
103
|
-
`}),p.type==="element"&&p.tagName==="p"&&!i?l.push(...p.children):l.push(p)}const d=r[r.length-1];d&&(i||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
|
|
104
|
-
`});const f={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,f),e.applyData(t,f)}function cle(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=v3(n[r])}return t}function v3(e){const t=e.spread;return t??e.children.length>1}function ule(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const l=r[i];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function dle(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fle(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function hle(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ple(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),i.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=bk(t.children[1]),d=X4(t.children[t.children.length-1]);u&&d&&(l.position={start:u,end:d}),i.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function mle(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,u=l?l.length:t.children.length;let d=-1;const f=[];for(;++d<u;){const m=t.children[d],g={},v=l?l[d]:void 0;v&&(g.align=v);let S={type:"element",tagName:a,properties:g,children:[]};m&&(S.children=e.all(m),e.patch(m,S),S=e.applyData(m,S)),f.push(S)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,p),e.applyData(t,p)}function gle(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const ZP=9,XP=32;function yle(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(JP(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(JP(t.slice(i),i>0,!1)),a.join("")}function JP(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===ZP||a===XP;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===ZP||a===XP;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function vle(e,t){const n={type:"text",value:yle(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function xle(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const ble={blockquote:Yoe,break:Woe,code:Zoe,delete:Xoe,emphasis:Joe,footnoteReference:ele,heading:tle,html:nle,imageReference:rle,image:ile,inlineCode:ale,linkReference:sle,link:ole,listItem:lle,list:ule,paragraph:dle,root:fle,strong:hle,table:ple,tableCell:gle,tableRow:mle,text:vle,thematicBreak:xle,toml:Jm,yaml:Jm,definition:Jm,footnoteDefinition:Jm};function Jm(){}const x3=-1,qv=0,uh=1,my=2,Ak=3,Ok=4,Ek=5,_k=6,b3=7,w3=8,eT=typeof self=="object"?self:globalThis,wle=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,l]=t[i];switch(a){case qv:case x3:return n(l,i);case uh:{const u=n([],i);for(const d of l)u.push(r(d));return u}case my:{const u=n({},i);for(const[d,f]of l)u[r(d)]=r(f);return u}case Ak:return n(new Date(l),i);case Ok:{const{source:u,flags:d}=l;return n(new RegExp(u,d),i)}case Ek:{const u=n(new Map,i);for(const[d,f]of l)u.set(r(d),r(f));return u}case _k:{const u=n(new Set,i);for(const d of l)u.add(r(d));return u}case b3:{const{name:u,message:d}=l;return n(new eT[u](d),i)}case w3:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:u}=new Uint8Array(l);return n(new DataView(u),l)}}return n(new eT[a](l),i)};return r},tT=e=>wle(new Map,e)(0),hu="",{toString:Sle}={},{keys:jle}=Object,Bf=e=>{const t=typeof e;if(t!=="object"||!e)return[qv,t];const n=Sle.call(e).slice(8,-1);switch(n){case"Array":return[uh,hu];case"Object":return[my,hu];case"Date":return[Ak,hu];case"RegExp":return[Ok,hu];case"Map":return[Ek,hu];case"Set":return[_k,hu];case"DataView":return[uh,n]}return n.includes("Array")?[uh,n]:n.includes("Error")?[b3,n]:[my,n]},eg=([e,t])=>e===qv&&(t==="function"||t==="symbol"),Nle=(e,t,n,r)=>{const i=(l,u)=>{const d=r.push(l)-1;return n.set(u,d),d},a=l=>{if(n.has(l))return n.get(l);let[u,d]=Bf(l);switch(u){case qv:{let p=l;switch(d){case"bigint":u=w3,p=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return i([x3],l)}return i([u,p],l)}case uh:{if(d){let g=l;return d==="DataView"?g=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(g=new Uint8Array(l)),i([d,[...g]],l)}const p=[],m=i([u,p],l);for(const g of l)p.push(a(g));return m}case my:{if(d)switch(d){case"BigInt":return i([d,l.toString()],l);case"Boolean":case"Number":case"String":return i([d,l.valueOf()],l)}if(t&&"toJSON"in l)return a(l.toJSON());const p=[],m=i([u,p],l);for(const g of jle(l))(e||!eg(Bf(l[g])))&&p.push([a(g),a(l[g])]);return m}case Ak:return i([u,l.toISOString()],l);case Ok:{const{source:p,flags:m}=l;return i([u,{source:p,flags:m}],l)}case Ek:{const p=[],m=i([u,p],l);for(const[g,v]of l)(e||!(eg(Bf(g))||eg(Bf(v))))&&p.push([a(g),a(v)]);return m}case _k:{const p=[],m=i([u,p],l);for(const g of l)(e||!eg(Bf(g)))&&p.push(a(g));return m}}const{message:f}=l;return i([u,{name:d,message:f}],l)};return a},nT=(e,{json:t,lossy:n}={})=>{const r=[];return Nle(!(t||n),!!t,new Map,r)(e),r},gy=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?tT(nT(e,t)):structuredClone(e):(e,t)=>tT(nT(e,t));function kle(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Cle(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Ale(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||kle,r=e.options.footnoteBackLabel||Cle,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let d=-1;for(;++d<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[d]);if(!f)continue;const p=e.all(f),m=String(f.identifier).toUpperCase(),g=wd(m.toLowerCase());let v=0;const S=[],b=e.footnoteCounts.get(m);for(;b!==void 0&&++v<=b;){S.length>0&&S.push({type:"text",value:" "});let E=typeof n=="string"?n:n(d,v);typeof E=="string"&&(E={type:"text",value:E}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+g+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,v),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const j=p[p.length-1];if(j&&j.type==="element"&&j.tagName==="p"){const E=j.children[j.children.length-1];E&&E.type==="text"?E.value+=" ":j.children.push({type:"text",value:" "}),j.children.push(...S)}else p.push(...S);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+g},children:e.wrap(p,!0)};e.patch(f,k),u.push(k)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...gy(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
105
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
|
|
106
|
-
`}]}}const S3=(function(e){if(e==null)return zle;if(typeof e=="function")return Fv(e);if(typeof e=="object")return Array.isArray(e)?Ole(e):Ele(e);if(typeof e=="string")return _le(e);throw new Error("Expected function, string, or object as test")});function Ole(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=S3(e[n]);return Fv(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function Ele(e){const t=e;return Fv(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function _le(e){return Fv(t);function t(n){return n&&n.type===e}}function Fv(e){return t;function t(n,r,i){return!!(Ple(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function zle(){return!0}function Ple(e){return e!==null&&typeof e=="object"&&"type"in e}const j3=[],Tle=!0,rT=!1,Rle="skip";function Dle(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=S3(i),l=r?-1:1;u(e,void 0,[])();function u(d,f,p){const m=d&&typeof d=="object"?d:{};if(typeof m.type=="string"){const v=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(d.type+(v?"<"+v+">":""))+")"})}return g;function g(){let v=j3,S,b,j;if((!t||a(d,f,p[p.length-1]||void 0))&&(v=Mle(n(d,p)),v[0]===rT))return v;if("children"in d&&d.children){const k=d;if(k.children&&v[0]!==Rle)for(b=(r?k.children.length:-1)+l,j=p.concat(k);b>-1&&b<k.children.length;){const E=k.children[b];if(S=u(E,b,j)(),S[0]===rT)return S;b=typeof S[1]=="number"?S[1]:b+l}}return v}}}function Mle(e){return Array.isArray(e)?e:typeof e=="number"?[Tle,e]:e==null?j3:[e]}function N3(e,t,n,r){let i,a,l;typeof t=="function"&&typeof n!="function"?(a=void 0,l=t,i=n):(a=t,l=n,i=r),Dle(e,a,u,i);function u(d,f){const p=f[f.length-1],m=p?p.children.indexOf(d):void 0;return l(d,m,p)}}const d1={}.hasOwnProperty,Ile={};function Lle(e,t){const n=t||Ile,r=new Map,i=new Map,a=new Map,l={...ble,...n.handlers},u={all:f,applyData:Ble,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:l,one:d,options:n,patch:$le,wrap:qle};return N3(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const m=p.type==="definition"?r:i,g=String(p.identifier).toUpperCase();m.has(g)||m.set(g,p)}}),u;function d(p,m){const g=p.type,v=u.handlers[g];if(d1.call(u.handlers,g)&&v)return v(u,p,m);if(u.options.passThrough&&u.options.passThrough.includes(g)){if("children"in p){const{children:b,...j}=p,k=gy(j);return k.children=u.all(p),k}return gy(p)}return(u.options.unknownHandler||Ule)(u,p,m)}function f(p){const m=[];if("children"in p){const g=p.children;let v=-1;for(;++v<g.length;){const S=u.one(g[v],p);if(S){if(v&&g[v-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=iT(S.value)),!Array.isArray(S)&&S.type==="element")){const b=S.children[0];b&&b.type==="text"&&(b.value=iT(b.value))}Array.isArray(S)?m.push(...S):m.push(S)}}}return m}}function $le(e,t){e.position&&(t.position=Sae(e))}function Ble(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&a&&Object.assign(n.properties,gy(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Ule(e,t){const n=t.data||{},r="value"in t&&!(d1.call(n,"hProperties")||d1.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function qle(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
107
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
108
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
109
|
-
`}),n}function iT(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function aT(e,t){const n=Lle(e,t),r=n.one(e,void 0),i=Ale(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
|
|
110
|
-
`},i),a}function Fle(e,t){return e&&"run"in e?async function(n,r){const i=aT(n,{file:r,...t});await e.run(i,r)}:function(n,r){return aT(n,{file:r,...e||t})}}function sT(e){if(e)throw e}var $w,oT;function Hle(){if(oT)return $w;oT=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},a=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),m=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!m)return!1;var g;for(g in f);return typeof g>"u"||e.call(f,g)},l=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},u=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(r)return r(f,p).value}else return;return f[p]};return $w=function d(){var f,p,m,g,v,S,b=arguments[0],j=1,k=arguments.length,E=!1;for(typeof b=="boolean"&&(E=b,b=arguments[1]||{},j=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});j<k;++j)if(f=arguments[j],f!=null)for(p in f)m=u(b,p),g=u(f,p),b!==g&&(E&&g&&(a(g)||(v=i(g)))?(v?(v=!1,S=m&&i(m)?m:[]):S=m&&a(m)?m:{},l(b,{name:p,newValue:d(E,S,g)})):typeof g<"u"&&l(b,{name:p,newValue:g}));return b},$w}var Kle=Hle();const Bw=pa(Kle);function f1(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Gle(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);u(null,...i);function u(d,...f){const p=e[++a];let m=-1;if(d){l(d);return}for(;++m<i.length;)(f[m]===null||f[m]===void 0)&&(f[m]=i[m]);i=f,p?Vle(p,u)(...f):l(null,...f)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Vle(e,t){let n;return r;function r(...l){const u=e.length>l.length;let d;u&&l.push(i);try{d=e.apply(this,l)}catch(f){const p=f;if(u&&n)throw p;return i(p)}u||(d&&d.then&&typeof d.then=="function"?d.then(a,i):d instanceof Error?i(d):a(d))}function i(l,...u){n||(n=!0,t(l,...u))}function a(l){i(null,l)}}const za={basename:Qle,dirname:Yle,extname:Wle,join:Zle,sep:"/"};function Qle(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Yh(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,u=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else l<0&&(a=!0,l=i+1),u>-1&&(e.codePointAt(i)===t.codePointAt(u--)?u<0&&(r=i):(u=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function Yle(e){if(Yh(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Wle(e){Yh(e);let t=e.length,n=-1,r=0,i=-1,a=0,l;for(;t--;){const u=e.codePointAt(t);if(u===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),u===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Zle(...e){let t=-1,n;for(;++t<e.length;)Yh(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Xle(n)}function Xle(e){Yh(e);const t=e.codePointAt(0)===47;let n=Jle(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Jle(e,t){let n="",r=0,i=-1,a=0,l=-1,u,d;for(;++l<=e.length;){if(l<e.length)u=e.codePointAt(l);else{if(u===47)break;u=47}if(u===47){if(!(i===l-1||a===1))if(i!==l-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),i=l,a=0;continue}}else if(n.length>0){n="",r=0,i=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,a=0}else u===46&&a>-1?a++:a=-1}return n}function Yh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const ece={cwd:tce};function tce(){return"/"}function h1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function nce(e){if(typeof e=="string")e=new URL(e);else if(!h1(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return rce(e)}function rce(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Uw=["history","path","basename","stem","extname","dirname"];class k3{constructor(t){let n;t?h1(t)?n={path:t}:typeof t=="string"||ice(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":ece.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Uw.length;){const a=Uw[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)Uw.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?za.basename(this.path):void 0}set basename(t){Fw(t,"basename"),qw(t,"basename"),this.path=za.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?za.dirname(this.path):void 0}set dirname(t){lT(this.basename,"dirname"),this.path=za.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?za.extname(this.path):void 0}set extname(t){if(qw(t,"extname"),lT(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=za.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){h1(t)&&(t=nce(t)),Fw(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?za.basename(this.path,this.extname):void 0}set stem(t){Fw(t,"stem"),qw(t,"stem"),this.path=za.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Cr(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function qw(e,t){if(e&&e.includes(za.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+za.sep+"`")}function Fw(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function lT(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function ice(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ace=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),sce={}.hasOwnProperty;class zk extends ace{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Gle()}copy(){const t=new zk;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Bw(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Gw("data",this.frozen),this.namespace[t]=n,this):sce.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Gw("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=tg(t),r=this.parser||this.Parser;return Hw("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Hw("process",this.parser||this.Parser),Kw("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,l){const u=tg(t),d=r.parse(u);r.run(d,u,function(p,m,g){if(p||!m||!g)return f(p);const v=m,S=r.stringify(v,g);cce(S)?g.value=S:g.result=S,f(p,g)});function f(p,m){p||!m?l(p):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),Hw("processSync",this.parser||this.Parser),Kw("processSync",this.compiler||this.Compiler),this.process(t,i),uT("processSync","process",n),r;function i(a,l){n=!0,sT(a),r=l}}run(t,n,r){cT(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(l,u){const d=tg(n);i.run(t,d,f);function f(p,m,g){const v=m||t;p?u(p):l?l(v):r(void 0,v,g)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),uT("runSync","run",r),i;function a(l,u){sT(l),i=u,r=!0}}stringify(t,n){this.freeze();const r=tg(n),i=this.compiler||this.Compiler;return Kw("stringify",i),cT(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Gw("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...m]=f;d(p,m)}else l(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function l(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(f.plugins),f.settings&&(i.settings=Bw(!0,i.settings,f.settings))}function u(f){let p=-1;if(f!=null)if(Array.isArray(f))for(;++p<f.length;){const m=f[p];a(m)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,p){let m=-1,g=-1;for(;++m<r.length;)if(r[m][0]===f){g=m;break}if(g===-1)r.push([f,...p]);else if(p.length>0){let[v,...S]=p;const b=r[g][1];f1(b)&&f1(v)&&(v=Bw(!0,b,v)),r[g]=[f,v,...S]}}}}const oce=new zk().freeze();function Hw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Kw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Gw(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function cT(e){if(!f1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function uT(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function tg(e){return lce(e)?e:new k3(e)}function lce(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function cce(e){return typeof e=="string"||uce(e)}function uce(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const dce="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",dT=[],fT={allowDangerousHtml:!0},fce=/^(https?|ircs?|mailto|xmpp)$/i,hce=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function pce(e){const t=mce(e),n=gce(e);return yce(t.runSync(t.parse(n),n),e)}function mce(e){const t=e.rehypePlugins||dT,n=e.remarkPlugins||dT,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...fT}:fT;return oce().use(Qoe).use(n).use(Fle,r).use(t)}function gce(e){const t=e.children||"",n=new k3;return typeof t=="string"&&(n.value=t),n}function yce(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,l=t.skipHtml,u=t.unwrapDisallowed,d=t.urlTransform||vce;for(const p of hce)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+dce+p.id,void 0);return N3(e,f),Aae(e,{Fragment:o.Fragment,components:i,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function f(p,m,g){if(p.type==="raw"&&g&&typeof m=="number")return l?g.children.splice(m,1):g.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let v;for(v in Mw)if(Object.hasOwn(Mw,v)&&Object.hasOwn(p.properties,v)){const S=p.properties[v],b=Mw[v];(b===null||b.includes(p.tagName))&&(p.properties[v]=d(String(S||""),v,p))}}if(p.type==="element"){let v=n?!n.includes(p.tagName):a?a.includes(p.tagName):!1;if(!v&&r&&typeof m=="number"&&(v=!r(p,m,g)),v&&g&&typeof m=="number")return u&&p.children?g.children.splice(m,1,...p.children):g.children.splice(m,1),m}}}function vce(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||fce.test(e.slice(0,t))?e:""}function xce(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const Hv=xce();async function hT(e){const t=await fetch(`${Hv}/projects/${encodeURIComponent(e)}/agent/transcript`,{credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Jr(n?.error?.message??`transcript fetch failed: ${t.status}`,t.status,n?.error?.code)}return t.json()}async function bce(e){const t=await fetch(`${Hv}/projects/${encodeURIComponent(e)}/agent/providers`,{credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Jr(n?.error?.message??`providers fetch failed: ${t.status}`,t.status,n?.error?.code)}return t.json()}async function wce(e){const t=await fetch(`${Hv}/projects/${encodeURIComponent(e)}/agent/transcript`,{method:"DELETE",credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Jr(n?.error?.message??`reset failed: ${t.status}`,t.status,n?.error?.code)}}async function Sce({project:e,prompt:t,provider:n,modelId:r,scope:i,signal:a,onEvent:l}){const u={prompt:t};n&&(u.provider=n),r&&(u.modelId=r),i&&(u.scope=i);const d=await fetch(`${Hv}/projects/${encodeURIComponent(e)}/agent/prompt`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(u),signal:a});if(!d.ok||!d.body){const v=await d.json().catch(()=>({}));throw new Jr(v?.error?.message??`prompt failed: ${d.status}`,d.status,v?.error?.code)}const f=d.body.getReader(),p=new TextDecoder;let m="";const g=()=>{f.cancel().catch(()=>{})};a?.addEventListener("abort",g,{once:!0});try{for(;;){const{value:v,done:S}=await f.read();if(S)break;m+=p.decode(v,{stream:!0});let b=m.indexOf(`
|
|
111
|
-
|
|
112
|
-
`);for(;b!==-1;){const j=m.slice(0,b);m=m.slice(b+2);for(const k of j.split(`
|
|
113
|
-
`)){if(!k.startsWith("data:"))continue;const E=k.slice(5).trim();if(E)try{l(JSON.parse(E))}catch{}}b=m.indexOf(`
|
|
114
|
-
|
|
115
|
-
`)}}}finally{a?.removeEventListener("abort",g);try{f.releaseLock()}catch{}}}function C3(e){return!e||e.role!=="assistant"?"":e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}const jce=[{label:"Status",prompt:"Quick status overview for this project — latest runs, current health, anything unusual."},{label:"Top insights",prompt:"Walk me through the 3 most severe active insights and what to do about each."},{label:"Last failed run",prompt:"If the latest run failed, dig into it and tell me what went wrong plus how to fix it."},{label:"Schedule",prompt:"What is the current sweep schedule, and is it appropriate given recent volatility?"}],Nce=[{command:"/status",label:"Status",hint:"Latest runs, health, anything unusual",prompt:"Quick status overview for this project — latest runs, current health, anything unusual."},{command:"/insights",label:"Top insights",hint:"Walk through the most severe active insights",prompt:"Walk me through the 3 most severe active insights and what to do about each."},{command:"/last-run",label:"Last run",hint:"Summarize the latest sweep",prompt:"Summarize the latest run for this project — provider mix, visibility changes, and anything that moved."},{command:"/last-failed",label:"Last failed run",hint:"Diagnose the most recent failure",prompt:"If the latest run failed, dig into it and tell me what went wrong plus how to fix it."},{command:"/run-sweep",label:"Run sweep now",hint:"Trigger a new visibility sweep",prompt:"Run a new answer-visibility sweep for this project now and tell me when it lands."},{command:"/schedule",label:"Schedule",hint:"Review the sweep schedule",prompt:"What is the current sweep schedule, and is it appropriate given recent volatility?"},{command:"/queries",label:"Queries",hint:"List tracked queries",prompt:"List the tracked queries for this project and flag any that are obvious duplicates or underperformers."},{command:"/competitors",label:"Competitors",hint:"List tracked competitors",prompt:"List this project's tracked competitors and call out which ones are showing up in answer citations."},{command:"/clear",label:"Clear conversation",hint:"Wipe transcript and start fresh",action:"clear"}],ng=e=>`canonry:aero:provider:${e}`,pT=e=>`canonry:aero:scope:${e}`;function kce({projectName:e}){const[t,n]=x.useState(!1),[r,i]=x.useState(!1),[a,l]=x.useState([]),[u,d]=x.useState(""),[f,p]=x.useState(!1),[m,g]=x.useState([]),[v,S]=x.useState(""),[b,j]=x.useState(null),[k,E]=x.useState(()=>typeof window>"u"?null:window.localStorage.getItem(ng(e))??null),[C,A]=x.useState(()=>typeof window>"u"?"read-only":window.localStorage.getItem(pT(e))==="all"?"all":"read-only"),P=x.useRef(null),O=x.useRef(null),_=x.useRef(null),[T,$]=x.useState(0),F=x.useMemo(()=>{const q=u.trimStart();if(!q.startsWith("/"))return[];if(/\s/.test(q))return[];const D=q.toLowerCase();return Nce.filter(G=>G.command.startsWith(D)||G.label.toLowerCase().includes(D.slice(1)))},[u]);x.useEffect(()=>{$(q=>F.length===0?0:Math.min(q,F.length-1))},[F.length]);const U=ca({queryKey:qe.agent.providers(e),queryFn:()=>bce(e),enabled:t,staleTime:6e4}),B=x.useMemo(()=>{const q=U.data?.providers??[];if(k){const G=q.find(se=>se.id===k&&se.configured);if(G)return G}const D=U.data?.defaultProvider;return D?q.find(G=>G.id===D)??null:null},[k,U.data]);x.useEffect(()=>{if(!U.data||!k)return;U.data.providers.find(D=>D.id===k&&D.configured)||(E(null),window.localStorage.removeItem(ng(e)))},[U.data,k,e]);const V=x.useCallback(q=>{E(q),!(typeof window>"u")&&(q?window.localStorage.setItem(ng(e),q):window.localStorage.removeItem(ng(e)))},[e]),X=x.useCallback(()=>{A(q=>{const D=q==="all"?"read-only":"all";return typeof window<"u"&&window.localStorage.setItem(pT(e),D),D})},[e]);x.useEffect(()=>{if(!t)return;const q=D=>{D.key==="Escape"&&(r?i(!1):n(!1))};return window.addEventListener("keydown",q),()=>window.removeEventListener("keydown",q)},[t,r]),x.useEffect(()=>{if(!t)return;let q=!1;j(null);const D=()=>{q||f||hT(e).then(ne=>{q||l(ne.messages)}).catch(ne=>{q||j(ne instanceof Error?ne.message:"Failed to load transcript")})};D();const se=window.setInterval(D,15e3);return()=>{q=!0,window.clearInterval(se)}},[t,e,f]),x.useEffect(()=>()=>{P.current?.abort()},[e]),x.useEffect(()=>{const q=O.current;q&&(q.scrollTop=q.scrollHeight)},[a,v,m]);async function Z(q){const D=q.trim();if(!D||f)return;j(null),d(""),p(!0),S(""),g([]);const G={role:"user",content:D,timestamp:Date.now()};l(ne=>[...ne,G]);const se=new AbortController;P.current=se;try{await Sce({project:e,prompt:D,provider:k??void 0,scope:C,signal:se.signal,onEvent:H});const ne=await hT(e);l(ne.messages)}catch(ne){ne.name!=="AbortError"&&j(ne instanceof Error?ne.message:"Prompt failed")}finally{p(!1),S(""),P.current=null}}function H(q){switch(q.type){case"message_update":S(C3(q.message));break;case"message_end":q.message.role==="assistant"&&S("");break;case"tool_execution_start":g(D=>[...D,{id:q.toolCallId,name:q.toolName,args:q.args,startedAt:Date.now()}]);break;case"tool_execution_end":g(D=>D.map(G=>G.id===q.toolCallId?{...G,endedAt:Date.now(),isError:q.isError,result:q.result}:G));break;case"error":j(q.message);break}}async function J(){P.current?.abort();try{await wce(e),l([]),j(null)}catch(q){j(q instanceof Error?q.message:"Reset failed")}}const oe=a.length===0,ye=t&&r?"pointer-events-auto fixed inset-0 z-40 flex items-stretch justify-center bg-zinc-950/70 p-4 sm:p-8 backdrop-blur-sm":"pointer-events-none fixed inset-x-0 bottom-0 z-40 flex justify-center p-3",I=r?"pointer-events-auto flex h-full w-full max-w-5xl flex-col overflow-hidden rounded-2xl border border-zinc-800/80 bg-zinc-950/95 shadow-2xl":"pointer-events-auto w-full max-w-3xl",M=r?"flex-1 overflow-y-auto px-6 py-5 text-sm text-zinc-200":"max-h-[40vh] min-h-[120px] overflow-y-auto px-4 py-3 text-sm text-zinc-200";return o.jsx("div",{className:ye,onClick:q=>{r&&q.target===q.currentTarget&&i(!1)},children:o.jsx("div",{className:I,children:t?o.jsxs("div",{className:r?"flex h-full flex-col":"flex flex-col overflow-hidden rounded-2xl border border-zinc-800/80 bg-zinc-950/95 shadow-xl backdrop-blur",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-zinc-800/70 px-4 py-2.5",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(A2,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),o.jsx("span",{className:"text-sm font-medium text-zinc-100",children:"Aero"}),o.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:f?"working…":e})]}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Cce,{providers:U.data?.providers??[],active:B,override:k,onPick:V,disabled:f}),o.jsx("button",{type:"button",onClick:J,className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":"Reset conversation",title:"Reset conversation",children:o.jsx(M5,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),o.jsx("button",{type:"button",onClick:()=>i(q=>!q),className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":r?"Collapse":"Expand",title:r?"Collapse":"Expand",children:r?o.jsx(QQ,{className:"h-3.5 w-3.5","aria-hidden":"true"}):o.jsx(HQ,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),o.jsx("button",{type:"button",onClick:()=>{i(!1),n(!1)},className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":"Close Aero",children:o.jsx(Gh,{className:"h-4 w-4","aria-hidden":"true"})})]})]}),o.jsxs("div",{ref:O,className:M,children:[b&&o.jsx("div",{className:"mb-2 rounded-md border border-rose-700/40 bg-rose-950/40 px-3 py-2 text-xs text-rose-200",children:b}),oe&&!f&&o.jsxs("div",{className:"flex flex-col gap-3 py-2",children:[o.jsxs("p",{className:"text-xs text-zinc-500",children:["Ask anything about ",o.jsx("span",{className:"text-zinc-300",children:e}),", or start with:"]}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:jce.map(q=>o.jsx("button",{type:"button",onClick:()=>Z(q.prompt),className:"rounded-full border border-zinc-800 bg-zinc-900/70 px-3 py-1 text-xs text-zinc-300 transition hover:border-zinc-700 hover:bg-zinc-800/70 hover:text-zinc-100",children:q.label},q.label))})]}),zce(a,e,k,C),m.length>0&&o.jsx("div",{className:"mt-3 space-y-1.5",children:m.map(q=>o.jsx(A3,{trail:q},q.id))}),f&&v&&o.jsxs("div",{className:"mt-3",children:[o.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),o.jsx(O3,{content:v})]}),f&&!v&&m.every(q=>q.endedAt!==void 0)&&o.jsx(Dce,{})]}),o.jsx(Ace,{projectName:e,activeProvider:B,scope:C,onToggleScope:X,disabled:f}),o.jsxs("div",{className:"relative",children:[F.length>0&&o.jsx(Oce,{matches:F,selectedIndex:T,onHover:$,onPick:q=>{d(""),_.current?.focus(),q.action==="clear"?J():Z(q.prompt)}}),o.jsxs("form",{className:"flex items-end gap-2 border-t border-zinc-800/70 bg-zinc-950/80 px-3 py-2.5",onSubmit:q=>{if(q.preventDefault(),F.length>0){const D=F[T];d(""),D.action==="clear"?J():Z(D.prompt);return}Z(u)},children:[o.jsx("textarea",{ref:_,value:u,onChange:q=>d(q.target.value),onKeyDown:q=>{if(F.length>0){if(q.key==="ArrowDown"){q.preventDefault(),$(D=>(D+1)%F.length);return}if(q.key==="ArrowUp"){q.preventDefault(),$(D=>(D-1+F.length)%F.length);return}if(q.key==="Tab"){q.preventDefault();const D=F[T];d(`${D.command} `);return}if(q.key==="Escape"){q.preventDefault(),d("");return}}if(q.key==="Enter"&&!q.shiftKey)if(q.preventDefault(),F.length>0){const D=F[T];d(""),D.action==="clear"?J():Z(D.prompt)}else Z(u)},placeholder:"Ask Aero, or / for commands…",disabled:f,rows:r?3:1,className:"flex-1 resize-none bg-transparent text-sm text-zinc-100 placeholder:text-zinc-600 focus:outline-none disabled:opacity-60"}),o.jsx("button",{type:"submit",disabled:f||!u.trim(),className:"inline-flex h-7 w-7 items-center justify-center rounded-md bg-emerald-500 text-zinc-950 transition hover:bg-emerald-400 disabled:opacity-40","aria-label":"Send",children:o.jsx(yQ,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})]}):o.jsxs("button",{type:"button",onClick:()=>n(!0),className:"flex w-full items-center justify-between rounded-full border border-zinc-800/80 bg-zinc-950/95 px-4 py-2 text-left text-sm text-zinc-400 shadow-lg backdrop-blur transition hover:border-zinc-700 hover:bg-zinc-900/90 hover:text-zinc-200",children:[o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx(A2,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),"Ask Aero about ",e,"…"]}),o.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-600",children:"Enter"})]})})})}function Cce({providers:e,active:t,override:n,onPick:r,disabled:i}){const[a,l]=x.useState(!1),u=x.useRef(null);if(x.useEffect(()=>{if(!a)return;const p=g=>{u.current?.contains(g.target)||l(!1)},m=g=>{g.key==="Escape"&&l(!1)};return window.addEventListener("mousedown",p),window.addEventListener("keydown",m),()=>{window.removeEventListener("mousedown",p),window.removeEventListener("keydown",m)}},[a]),e.length===0)return null;const d=t?.label.replace(/\s+\(.+\)$/,"")??"No provider",f=t?.defaultModel;return o.jsxs("div",{ref:u,className:"relative",children:[o.jsxs("button",{type:"button",onClick:()=>l(p=>!p),disabled:i,className:"flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] text-zinc-400 transition hover:bg-zinc-800/60 hover:text-zinc-200 disabled:opacity-50","aria-label":"Switch agent model","aria-haspopup":"listbox","aria-expanded":a,title:t?`${t.label} · ${t.defaultModel}`:"Pick a provider",children:[o.jsx("span",{className:"font-medium text-zinc-200",children:d}),f&&o.jsx("span",{className:"hidden font-mono text-[10px] text-zinc-500 sm:inline",children:f}),o.jsx(SQ,{className:"h-3 w-3","aria-hidden":"true"})]}),a&&o.jsxs("div",{role:"listbox",className:"absolute right-0 top-full z-50 mt-1 w-64 overflow-hidden rounded-lg border border-zinc-800 bg-zinc-950 shadow-xl",children:[o.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-2 text-[10px] uppercase tracking-wider text-zinc-500",children:"Aero provider"}),o.jsx("ul",{className:"max-h-72 overflow-y-auto py-1",children:e.map(p=>{const m=t?.id===p.id,g=n===p.id;return o.jsx("li",{children:o.jsxs("button",{type:"button",role:"option","aria-selected":m,disabled:!p.configured,onClick:()=>{p.configured&&(r(g?null:p.id),l(!1))},className:"flex w-full items-start gap-2 px-3 py-2 text-left text-xs transition enabled:hover:bg-zinc-900 disabled:cursor-not-allowed disabled:opacity-50",children:[o.jsx("span",{className:"mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:m?o.jsx(z5,{className:"h-3 w-3 text-emerald-400","aria-hidden":"true"}):null}),o.jsxs("span",{className:"flex-1",children:[o.jsxs("span",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"font-medium text-zinc-100",children:p.label}),g&&o.jsx("span",{className:"rounded-full border border-emerald-800/60 bg-emerald-950/60 px-1.5 text-[9px] uppercase tracking-wider text-emerald-300",children:"Pinned"}),!p.configured&&o.jsx("span",{className:"rounded-full border border-zinc-800 px-1.5 text-[9px] uppercase tracking-wider text-zinc-500",children:"Key missing"})]}),o.jsx("span",{className:"mt-0.5 block font-mono text-[10px] text-zinc-500",children:p.defaultModel}),p.keySource==="env"&&o.jsx("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:"via env var"}),!p.configured&&o.jsxs("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:["Add key in config.yaml or export"," ",o.jsx("code",{className:"font-mono text-zinc-400",children:Ece(p.id)})]})]})]})},p.id)})}),n&&o.jsx("button",{type:"button",onClick:()=>{r(null),l(!1)},className:"w-full border-t border-zinc-800/60 px-3 py-2 text-left text-[11px] text-zinc-400 transition hover:bg-zinc-900 hover:text-zinc-100",children:"Reset to auto-detected default"})]})]})}function Ace({projectName:e,activeProvider:t,scope:n,onToggleScope:r,disabled:i}){const a=t?.label.replace(/\s+\(.+\)$/,"")??null,l=n==="all";return o.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 border-t border-zinc-800/70 bg-zinc-950/80 px-3 pt-2",children:[o.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-800 bg-zinc-900/70 px-2 py-0.5 text-[10px] text-zinc-400",children:[o.jsx("span",{className:"text-zinc-600",children:"project"}),o.jsx("span",{className:"font-medium text-zinc-200",children:e})]}),a&&o.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-800 bg-zinc-900/70 px-2 py-0.5 text-[10px] text-zinc-400",children:[o.jsx("span",{className:"text-zinc-600",children:"model"}),o.jsx("span",{className:"font-medium text-zinc-200",children:a})]}),o.jsxs("button",{type:"button",onClick:r,disabled:i,className:`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] transition disabled:opacity-50 ${l?"border-amber-800/60 bg-amber-950/40 text-amber-300 hover:border-amber-700 hover:text-amber-200":"border-zinc-800 bg-zinc-900/70 text-zinc-400 hover:border-zinc-700 hover:text-zinc-200"}`,title:l?"Aero can invoke write tools (run sweep, dismiss insight, etc). Click to restrict.":"Aero is restricted to read-only tools. Click to allow writes.",children:[o.jsx("span",{className:l?"text-amber-500":"text-zinc-600",children:"scope"}),o.jsx("span",{className:"font-medium",children:l?"all tools":"read-only"})]})]})}function Oce({matches:e,selectedIndex:t,onHover:n,onPick:r}){return o.jsxs("div",{className:"absolute inset-x-3 bottom-full mb-2 overflow-hidden rounded-lg border border-zinc-800 bg-zinc-950/98 shadow-2xl",children:[o.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-1.5 text-[10px] uppercase tracking-wider text-zinc-500",children:"Commands"}),o.jsx("ul",{role:"listbox",className:"max-h-72 overflow-y-auto py-1",children:e.map((i,a)=>{const l=a===t;return o.jsx("li",{children:o.jsxs("button",{type:"button",role:"option","aria-selected":l,onMouseEnter:()=>n(a),onClick:()=>r(i),className:`flex w-full items-center gap-3 px-3 py-1.5 text-left text-xs transition ${l?"bg-zinc-900 text-zinc-100":"text-zinc-300 hover:bg-zinc-900/60"}`,children:[o.jsx("span",{className:"font-mono text-[11px] text-emerald-400",children:i.command}),o.jsx("span",{className:"font-medium",children:i.label}),o.jsx("span",{className:"ml-auto text-[10px] text-zinc-500",children:i.hint})]})},i.command)})}),o.jsxs("div",{className:"border-t border-zinc-800/60 px-3 py-1.5 text-[10px] text-zinc-600",children:[o.jsx("span",{className:"mr-3",children:"↑↓ to select"}),o.jsx("span",{className:"mr-3",children:"Enter to run"}),o.jsx("span",{children:"Tab to autocomplete"})]})]})}function Ece(e){switch(e){case"claude":return"ANTHROPIC_API_KEY";case"openai":return"OPENAI_API_KEY";case"gemini":return"GOOGLE_API_KEY";case"zai":return"ZAI_API_KEY"}}function _ce(e,t){const n=e.timestamp??0;return`${e.role}:${n}:${t}`}function zce(e,t,n,r){const i=[];for(let a=0;a<e.length;a++){const l=e[a],u=_ce(l,a);if(l.role==="user"){const d=typeof l.content=="string"?l.content:JSON.stringify(l.content);if(d.startsWith("[system]"))continue;i.push(o.jsx(Pce,{text:d,projectName:t,providerOverride:n,scope:r},u));continue}if(l.role==="assistant"){const d=new Map;let f=a+1;for(;f<e.length&&e[f].role==="toolResult";){const g=e[f];d.set(g.toolCallId,g),f++}const p=Rce(l,d,l.timestamp??0),m=C3(l);i.push(o.jsxs(x.Fragment,{children:[p.length>0&&o.jsx("div",{className:"mt-3 space-y-1.5",children:p.map(g=>o.jsx(A3,{trail:g},g.id))}),m.trim()&&o.jsxs("div",{className:"mt-3",children:[o.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),o.jsx(O3,{content:m})]})]},u)),a=f-1;continue}}return i}function Pce({text:e,projectName:t,providerOverride:n,scope:r}){const[i,a]=x.useState(!1),l=x.useMemo(()=>Tce(t,e,n,r),[t,e,n,r]);async function u(){try{await navigator.clipboard.writeText(l),a(!0),window.setTimeout(()=>a(!1),1500)}catch{}}return o.jsxs("div",{className:"group relative mt-3 rounded-md bg-zinc-900/60 px-3 py-2 text-zinc-200",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:"You"}),o.jsx("button",{type:"button",onClick:u,className:"inline-flex items-center gap-1 rounded border border-zinc-800/70 bg-zinc-950/60 px-1.5 py-0.5 text-[10px] text-zinc-400 opacity-0 transition hover:border-zinc-700 hover:text-zinc-100 group-hover:opacity-100 focus:opacity-100","aria-label":"Copy as CLI command",title:l,children:i?o.jsxs(o.Fragment,{children:[o.jsx(z5,{className:"h-2.5 w-2.5 text-emerald-400","aria-hidden":"true"}),"Copied"]}):o.jsxs(o.Fragment,{children:[o.jsx(EQ,{className:"h-2.5 w-2.5","aria-hidden":"true"}),"Copy as CLI"]})})]}),o.jsx("div",{className:"whitespace-pre-wrap",children:e})]})}function Tce(e,t,n,r){const i=["canonry","agent","ask",mT(e),mT(t)];return n&&i.push("--provider",n),r==="read-only"&&i.push("--scope","read-only"),i.join(" ")}function mT(e){return`'${e.replace(/'/g,"'\\''")}'`}function Rce(e,t,n){const r=[];for(const i of e.content){if(i.type!=="toolCall")continue;const a=i,l=t.get(a.id);r.push({id:a.id,name:a.name,args:a.arguments,startedAt:n,endedAt:l?.timestamp,isError:l?.isError,result:l?.content})}return r}function A3({trail:e}){const[t,n]=x.useState(!1),r=e.endedAt===void 0,i=!r&&e.isError===!0,a=e.endedAt!=null?e.endedAt-e.startedAt:null,l=a==null||a<0?null:a<1e3?`${a}ms`:`${(a/1e3).toFixed(1)}s`,u=i?"border-rose-800/50":r?"border-emerald-800/50":"border-zinc-800/70",d=i?"bg-rose-950/20":r?"bg-emerald-950/20":"bg-zinc-900/40";return o.jsxs("div",{className:`rounded-md border ${u} ${d} font-mono`,children:[o.jsxs("button",{type:"button",onClick:()=>n(f=>!f),className:"flex w-full items-center gap-2 px-2.5 py-1.5 text-left","aria-expanded":t,children:[o.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:r?o.jsx(D5,{className:"h-3 w-3 animate-spin text-emerald-400","aria-hidden":"true"}):i?o.jsx(iy,{className:"h-3 w-3 text-rose-400","aria-hidden":"true"}):o.jsx(hY,{className:"h-3 w-3 text-zinc-500","aria-hidden":"true"})}),o.jsx("span",{className:"text-[11px] font-semibold text-zinc-100",children:e.name}),o.jsxs("span",{className:"ml-auto flex items-center gap-2 text-[10px] text-zinc-500",children:[r?o.jsx("span",{className:"text-emerald-400",children:"running…"}):o.jsxs(o.Fragment,{children:[o.jsx("span",{children:i?"failed":"ok"}),l&&o.jsx("span",{children:l})]}),o.jsx(Kh,{className:`h-3 w-3 transition-transform ${t?"rotate-90":""}`,"aria-hidden":"true"})]})]}),t&&o.jsxs("div",{className:"border-t border-zinc-800/60 px-2.5 py-2 text-[11px] text-zinc-400",children:[o.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:"Args"}),o.jsx("pre",{className:"mb-2 overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:gT(e.args)}),!r&&e.result!==void 0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:i?"Error":"Result"}),o.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:gT(e.result)})]})]})]})}function gT(e){try{const t=typeof e=="string"?e:JSON.stringify(e,null,2);return t.length>2e3?`${t.slice(0,2e3)}
|
|
116
|
-
… (${t.length-2e3} more chars)`:t}catch{return String(e)}}function O3({content:e}){return o.jsx("div",{className:"aero-markdown text-zinc-100",children:o.jsx(pce,{components:{h1:t=>o.jsx("h1",{...t,className:"mt-3 mb-2 text-base font-semibold text-zinc-50"}),h2:t=>o.jsx("h2",{...t,className:"mt-3 mb-2 text-sm font-semibold text-zinc-50"}),h3:t=>o.jsx("h3",{...t,className:"mt-3 mb-1.5 text-sm font-semibold text-zinc-100"}),h4:t=>o.jsx("h4",{...t,className:"mt-2 mb-1 text-xs font-semibold uppercase tracking-wide text-zinc-300"}),p:t=>o.jsx("p",{...t,className:"mb-2 leading-relaxed"}),ul:t=>o.jsx("ul",{...t,className:"mb-2 ml-4 list-disc space-y-1"}),ol:t=>o.jsx("ol",{...t,className:"mb-2 ml-4 list-decimal space-y-1"}),li:t=>o.jsx("li",{...t,className:"marker:text-zinc-600"}),strong:t=>o.jsx("strong",{...t,className:"font-semibold text-zinc-50"}),em:t=>o.jsx("em",{...t,className:"text-zinc-200"}),code:({children:t,...n})=>o.jsx("code",{...n,className:"rounded bg-zinc-800/70 px-1 py-0.5 font-mono text-[12px] text-emerald-200",children:t}),pre:t=>o.jsx("pre",{...t,className:"mb-2 overflow-x-auto rounded-md border border-zinc-800 bg-zinc-900/70 p-3 font-mono text-xs text-zinc-200"}),a:t=>o.jsx("a",{...t,className:"text-emerald-400 underline decoration-emerald-700 hover:decoration-emerald-400",target:"_blank",rel:"noopener noreferrer"}),table:t=>o.jsx("div",{className:"mb-2 overflow-x-auto",children:o.jsx("table",{...t,className:"w-full border-collapse text-xs"})}),thead:t=>o.jsx("thead",{...t,className:"border-b border-zinc-800"}),th:t=>o.jsx("th",{...t,className:"px-2 py-1 text-left font-semibold text-zinc-300"}),tr:t=>o.jsx("tr",{...t,className:"border-b border-zinc-900"}),td:t=>o.jsx("td",{...t,className:"px-2 py-1 text-zinc-200"}),blockquote:t=>o.jsx("blockquote",{...t,className:"mb-2 border-l-2 border-zinc-700 pl-3 italic text-zinc-400"}),hr:()=>o.jsx("hr",{className:"my-3 border-zinc-800"})},children:e})})}function Dce(){return o.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),o.jsxs("div",{className:"flex items-center gap-1","aria-label":"Aero is thinking",children:[o.jsx("span",{className:"aero-dot h-1.5 w-1.5 rounded-full bg-emerald-400/80"}),o.jsx("span",{className:"aero-dot aero-dot-2 h-1.5 w-1.5 rounded-full bg-emerald-400/60"}),o.jsx("span",{className:"aero-dot aero-dot-3 h-1.5 w-1.5 rounded-full bg-emerald-400/40"})]})]})}function Mce(){const e=p5(),t=/^\/projects\/([^/]+)/.exec(e.pathname),n=t?decodeURIComponent(t[1]):null,r=ca({queryKey:qe.projects.all,queryFn:HN,enabled:n!==null,staleTime:6e4});if(!n)return null;const i=r.data??[],a=i.find(l=>l.id===n)??i.find(l=>l.name===n);return a?o.jsx(kce,{projectName:a.name},a.name):null}function Kv(e,t,n){switch(e.invalidateQueries({queryKey:qe.runs.all}),e.invalidateQueries({queryKey:qe.projects.all}),t){case zt["answer-visibility"]:case zt["site-audit"]:case zt["backlink-extract"]:return;case zt["gsc-sync"]:case zt["inspect-sitemap"]:e.invalidateQueries({queryKey:qe.gsc.project(n)});return;case zt["ga-sync"]:e.invalidateQueries({queryKey:qe.traffic.project(n)});return;case zt["bing-inspect"]:case zt["bing-inspect-sitemap"]:e.invalidateQueries({queryKey:qe.bing.project(n)});return;default:return t}}const yT=[{label:"GitHub",href:"https://github.com/AINYC/canonry",Icon:MQ},{label:"Docs",href:"https://github.com/AINYC/canonry/tree/main/docs",Icon:xQ},{label:"Changelog",href:"https://github.com/AINYC/canonry/releases",Icon:RQ}],vT=e=>({label:e,state:"checking",detail:"Checking service health"}),Ice={apiStatus:vT("API"),workerStatus:vT("Worker")};function Lce(e){switch(e){case zt["answer-visibility"]:return"Visibility sweep";case zt["gsc-sync"]:return"GSC sync";case zt["inspect-sitemap"]:return"Sitemap inspection";case zt["ga-sync"]:return"GA sync";case zt["bing-inspect"]:return"Bing URL inspection";case zt["bing-inspect-sitemap"]:return"Bing sitemap inspection";case zt["site-audit"]:return"Site audit";case zt["backlink-extract"]:return"Backlink extract"}}function $ce(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function Bce(e){const t=Lce(e.kind);return e.status==="completed"?`${t} completed`:e.status==="partial"?`${t} completed with partial results`:e.status==="cancelled"?`${t} cancelled`:`${t} failed`}function Uce(e,t){return e.error?`${t}: ${rk(e.error)}`:e.location?`${t} · ${e.location}`:t}function qce(e,t,n){if(t)return t;const r=n.find(i=>i.id===e);return r?.displayName||r?.name||e}function Fce(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 Hce(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function Kce(){const e=vi(),t=x.useSyncExternalStore(Cte,tc,tc),n=Object.keys(t.runs).length>0||Object.keys(t.batches).length>0,r=ca({queryKey:qe.runs.all,queryFn:y5,enabled:n,staleTime:Qj,refetchInterval:3e3}),i=ca({queryKey:qe.projects.all,queryFn:HN,enabled:n}),a=x.useRef({}),l=x.useCallback(()=>{r.refetch()},[r.refetch]);return x.useEffect(()=>{n&&l()},[n,l]),x.useEffect(()=>{if(!n||typeof window>"u")return;const u=()=>{document.visibilityState==="visible"&&l()};return window.addEventListener("focus",l),document.addEventListener("visibilitychange",u),()=>{window.removeEventListener("focus",l),document.removeEventListener("visibilitychange",u)}},[n,l]),x.useEffect(()=>{const u=r.data??[],d=i.data??[],f=Object.fromEntries(u.map(m=>[m.id,m])),p=Object.fromEntries(u.map(m=>[m.id,m.status]));for(const m of Object.values(t.runs)){const g=f[m.runId];if(!g||!ok(g.status)||(a.current[g.id]??m.lastAnnouncedStatus)===g.status)continue;const S=d.find(j=>j.id===g.projectId);if(S&&Kv(e,g.kind,S.name),m.sourceAction==="run-all"){tP(g.id);continue}const b=qce(g.projectId,m.projectLabel,d);vt({title:Bce(g),detail:Uce(g,b),tone:$ce(g.status),dedupeKey:`run:${g.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:g.id}}),tP(g.id)}for(const m of Object.values(t.batches)){const g=Ete(m.runIds,f);g.finished&&(vt({title:"Run-all batch finished",detail:Fce(g,m.skippedCount),tone:Hce(g),dedupeKey:`batch:${m.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),Ote(m.batchId))}a.current=p},[i.data,r.data,t,e]),null}function Gce(){const e=Vh(),{dashboard:t,isLoading:n,refetch:r}=wc(),l=Bv(!e,e?.health).data??e?.health??Ice,u=p5(),{runId:d,evidenceId:f,closeDrawer:p}=xd(),[m,g]=x.useState(!1),v=Yie(d),S=v.data??null,b=v.isLoading;x.useEffect(()=>{S&&S.status!=="running"&&S.status!=="queued"&&r()},[S?.status,r]),x.useEffect(()=>{g(!1)},[u.pathname]),x.useEffect(()=>{if(typeof window>"u"||!d&&!f)return;const A=P=>{P.key==="Escape"&&p()};return window.addEventListener("keydown",A),()=>{window.removeEventListener("keydown",A)}},[d,f,p]);const j=t??e?.dashboard??null,k=d&&j?kie(j,d):void 0,E=f&&j?Cie(j,f):void 0,C=(()=>{const A=u.pathname;if(A==="/")return"Portfolio";if(A==="/projects")return"Projects";if(A==="/runs")return"Runs";if(A==="/settings")return"Settings";if(A==="/setup")return"Setup";if(A==="/backlinks")return"Backlinks";if(A.startsWith("/projects/")){const O=A.split("/").filter(Boolean)[1];if(O&&j){const _=j.projects.find(T=>T.project.id===O);if(_)return _.project.name}return"Project"}return"Not found"})();return o.jsxs("div",{className:"app-shell",children:[o.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),o.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[o.jsx("div",{className:"sidebar-brand",children:o.jsx(dP,{version:l.apiStatus.version})}),o.jsxs("nav",{className:"sidebar-nav",children:[o.jsxs(Zt,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[o.jsx(BQ,{className:"sidebar-icon"}),o.jsx("span",{children:"Overview"})]}),o.jsxs(Zt,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[o.jsx(LQ,{className:"sidebar-icon"}),o.jsx("span",{children:"Projects"})]}),o.jsxs(Zt,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[o.jsx(ry,{className:"sidebar-icon"}),o.jsx("span",{children:"Runs"})]}),o.jsxs(Zt,{to:"/backlinks",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[o.jsx(R5,{className:"sidebar-icon"}),o.jsx("span",{children:"Backlinks"})]}),o.jsxs(Zt,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[o.jsx(iY,{className:"sidebar-icon"}),o.jsx("span",{children:"Settings"})]}),n?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"sidebar-section-title",children:"Projects"}),[1,2,3].map(A=>o.jsxs("div",{className:"sidebar-skeleton-item",children:[o.jsx("span",{className:"skeleton-circle size-2"}),o.jsx("span",{className:"skeleton-text flex-1",style:{width:`${50+A*15}%`}})]},A))]}):j&&j.projects.length>0?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"sidebar-section-title",children:"Projects"}),j.projects.map(A=>{const P=A.visibilitySummary.tone;return o.jsxs(Zt,{to:"/projects/$projectId",params:{projectId:A.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[o.jsx("span",{className:`sidebar-dot sidebar-dot-${P}`}),o.jsx("span",{children:A.project.name})]},A.project.id)})]}):n?null:o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"sidebar-section-title",children:"Resources"}),o.jsxs(Zt,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[o.jsx(tY,{className:"sidebar-icon"}),o.jsx("span",{children:"Setup"})]})]})]}),o.jsx("div",{className:"sidebar-footer",children:yT.map(({label:A,href:P,Icon:O})=>o.jsx("a",{className:"sidebar-footer-icon",href:P,target:"_blank",rel:"noopener noreferrer",title:A,"aria-label":A,children:o.jsx(O,{className:"size-4"})},P))})]}),o.jsxs("div",{className:"main-area",children:[o.jsxs("header",{className:"topbar",children:[o.jsxs("div",{className:"topbar-left",children:[o.jsx("div",{className:"topbar-brand-mobile",children:o.jsx(dP,{compact:!0})}),o.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[o.jsx(Zt,{to:"/",children:"Home"}),o.jsx(Kh,{className:"breadcrumb-sep size-3"}),o.jsx("span",{className:"breadcrumb-current",children:C})]})]}),o.jsxs("div",{className:"topbar-actions",children:[o.jsxs("div",{className:"health-pill-row",children:[o.jsxs("span",{className:`health-pill health-pill-${l.apiStatus.state}`,title:Ho(l.apiStatus),children:["API ",l.apiStatus.state==="ok"?"ok":l.apiStatus.state]}),o.jsxs("span",{className:`health-pill health-pill-${l.workerStatus.state}`,title:Ho(l.workerStatus),children:["Worker ",l.workerStatus.state==="ok"?"ok":l.workerStatus.state]})]}),o.jsxs(be,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":m,"aria-controls":"mobile-nav",onClick:()=>g(A=>!A),children:[o.jsx(GQ,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),o.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${m?"mobile-nav-open":""}`,children:[o.jsxs(be,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>g(!1),children:[o.jsx(Gh,{className:"size-5"}),o.jsx("span",{className:"sr-only",children:"Close navigation"})]}),o.jsx(Zt,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),o.jsx(Zt,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),o.jsx(Zt,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),o.jsx(Zt,{to:"/settings",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Settings"}),j&&j.projects.length>0?o.jsxs("div",{className:"mobile-nav-section",children:[o.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),j.projects.map(A=>o.jsx(Zt,{to:"/projects/$projectId",params:{projectId:A.project.id},className:"mobile-nav-link",children:A.project.name},A.project.id))]}):null]}),o.jsx("main",{id:"content",className:"page-shell",children:n&&!e?o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-40"}),o.jsx("div",{className:"skeleton-text-sm w-72"})]}),o.jsx("div",{className:"page-skeleton-grid",children:[1,2,3].map(A=>o.jsxs("div",{className:"page-skeleton-card",children:[o.jsx("div",{className:"skeleton-text w-24"}),o.jsx("div",{className:"skeleton-text w-full"}),o.jsx("div",{className:"skeleton-text-sm w-3/4"})]},A))}),o.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(A=>o.jsxs("div",{className:"page-skeleton-card",children:[o.jsx("div",{className:"skeleton-text w-20"}),o.jsx("div",{className:"space-y-2",children:[1,2,3].map(P=>o.jsx("div",{className:"skeleton-text-sm w-full"},P))})]},A))})]}):o.jsx(FN,{})}),o.jsxs("footer",{className:"footer",children:[o.jsxs("span",{className:"footer-brand",children:[o.jsx("span",{children:"Canonry"}),l.apiStatus.version&&l.apiStatus.version!=="unknown"?o.jsxs("span",{className:"footer-version",children:["v",l.apiStatus.version]}):null]}),o.jsx("div",{className:"footer-links",children:yT.map(({label:A,href:P,Icon:O})=>o.jsx("a",{href:P,target:"_blank",rel:"noopener noreferrer",title:A,"aria-label":A,className:"footer-icon",children:o.jsx(O,{className:"size-3.5"})},P))})]})]}),k?o.jsxs(pie,{open:k!==void 0,title:k.summary,subtitle:`${k.projectName} · ${k.kindLabel}`,onClose:p,children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[o.jsx(Dv,{status:k.status}),o.jsx("span",{className:"text-zinc-400",children:k.startedAt}),o.jsx("span",{className:"text-zinc-500",children:k.duration}),o.jsx("span",{className:"text-zinc-600",children:k.triggerLabel})]}),k.status==="failed"&&k.statusDetail&&o.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:k.statusDetail}),o.jsxs("div",{className:"mt-4",children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),b?o.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):S&&S.snapshots.length>0?o.jsxs("div",{className:"space-y-2",children:[S.snapshots.map(A=>o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-3",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[o.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:A.query??"Unknown query"}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(nc,{provider:A.provider}),o.jsx(t4,{variant:A.citationState===Ju.cited?"success":"neutral",children:A.citationState})]})]}),A.model&&o.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:A.model}),A.citedDomains.length>0&&o.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[o.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",A.citedDomains.join(", ")]}),A.competitorOverlap.length>0&&o.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",A.competitorOverlap.join(", ")]}),A.groundingSources&&A.groundingSources.length>0&&o.jsxs("details",{className:"mt-2",children:[o.jsxs("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:[A.groundingSources.length," grounding source",A.groundingSources.length!==1?"s":""]}),o.jsx("ul",{className:"mt-1 space-y-0.5",children:A.groundingSources.map((P,O)=>o.jsx("li",{className:"text-xs text-zinc-500 truncate",children:o.jsx("a",{href:P.uri,target:"_blank",rel:"noopener noreferrer",className:"hover:text-zinc-300",children:P.title||P.uri})},O))})]}),A.answerText&&o.jsxs("details",{className:"mt-1",children:[o.jsx("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:"Answer preview"}),o.jsx("p",{className:"mt-1 text-xs text-zinc-400 leading-relaxed whitespace-pre-wrap",children:A.answerText})]})]},A.id)),S.status==="running"&&o.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Running remaining queries..."]})]}):S&&S.status==="running"?o.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Waiting for first query result..."]}):S&&S.status==="queued"?o.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-zinc-500 animate-pulse"}),"Run queued, waiting for execution slot..."]}):S&&S.error?o.jsxs("div",{className:"rounded-lg border border-rose-800/40 bg-rose-950/20 p-3",children:[o.jsx("p",{className:"text-sm font-medium text-rose-300 mb-2",children:"Run failed"}),o.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:hte(S.error)})]}):o.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,E?o.jsx(vie,{evidence:E.evidence,project:E.project,onClose:p}):null,o.jsx(Kce,{}),o.jsx(Xie,{}),o.jsx(Mce,{})]})}class Vce 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?o.jsx("div",{className:"page-container",children:o.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[o.jsx("div",{className:"rounded-full bg-rose-950/40 p-3",children:o.jsx(iy,{className:"size-6 text-rose-400"})}),o.jsx("h2",{className:"text-lg font-semibold text-zinc-100",children:"Something went wrong"}),o.jsx("p",{className:"text-sm text-zinc-400 max-w-md",children:this.state.error.message||"An unexpected error occurred while rendering this page."}),o.jsxs("div",{className:"flex gap-3 mt-2",children:[o.jsxs(be,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[o.jsx(M5,{className:"size-3.5 mr-1.5"}),"Try again"]}),o.jsx(be,{variant:"secondary",size:"sm",onClick:()=>{const t=window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??"";window.location.href=t||"/"},children:"Go home"})]})]})}):this.props.children}}const $e=x.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:Yi("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}));$e.displayName="Card";const p1=x.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:Yi("flex flex-col gap-1.5 p-5",e),...t}));p1.displayName="CardHeader";const m1=x.forwardRef(({className:e,...t},n)=>o.jsx("h3",{ref:n,className:Yi("font-medium tracking-tight text-zinc-50",e),...t}));m1.displayName="CardTitle";const g1=x.forwardRef(({className:e,...t},n)=>o.jsx("p",{ref:n,className:Yi("text-sm text-zinc-500",e),...t}));g1.displayName="CardDescription";const Lg=x.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:Yi("p-5 pt-0",e),...t}));Lg.displayName="CardContent";function Qce({points:e,tone:t}){const n=x.useId();if(e.length===0)return null;const r=42,i=132,a=5,l=Math.min(...e),d=Math.max(...e)-l||1,f=i-a*2,p=r-a*2,m=e.map((g,v)=>{const S=a+v/Math.max(e.length-1,1)*f,b=a+(1-(g-l)/d)*p;return`${S},${b}`}).join(" ");return o.jsxs("svg",{className:`sparkline sparkline-${t}`,viewBox:`0 0 ${i} ${r}`,"aria-hidden":"true",children:[o.jsx("defs",{children:o.jsx("clipPath",{id:n,children:o.jsx("rect",{x:a,y:a,width:f,height:p,rx:"8"})})}),o.jsx("line",{className:"sparkline-guide",x1:a,x2:i-a,y1:r-a,y2:r-a}),o.jsx("polyline",{clipPath:`url(#${n})`,points:m,vectorEffect:"non-scaling-stroke"})]})}function Yce({project:e}){return o.jsxs(Zt,{to:"/projects/$projectId",params:{projectId:e.project.id},className:"project-row cursor-pointer",children:[o.jsxs("div",{className:"project-row-primary",children:[o.jsxs("div",{children:[o.jsx("p",{className:"project-name",children:e.project.name}),o.jsx("p",{className:"project-domain",children:e.project.canonicalDomain})]}),o.jsx("p",{className:"project-insight",children:e.insight})]}),o.jsx("div",{className:"project-row-stat",children:o.jsxs("div",{className:"metric-inline-block",children:[o.jsx("p",{className:"metric-inline-label",children:"Answer Visibility"}),o.jsx("p",{className:`metric-inline-value ${e.visibilityTone==="caution"?"text-amber-400":""}`,children:e.visibilityScore}),o.jsx("p",{className:"metric-inline-delta",children:e.visibilityDelta}),e.providerCoverage&&o.jsx("p",{className:"text-[10px] font-medium text-amber-400/80",children:e.providerCoverage})]})}),o.jsx("div",{className:"project-row-stat",children:o.jsxs("div",{className:"metric-inline-block",children:[o.jsx("p",{className:"metric-inline-label",children:"Competitor Pressure"}),o.jsx("p",{className:"metric-inline-value",children:e.competitorPressureLabel}),o.jsxs("p",{className:"metric-inline-delta",children:[e.lastRun.kindLabel," · ",Pv(e.lastRun.status)]})]})}),o.jsx("div",{className:"project-row-chart",children:o.jsx(Qce,{points:e.trend,tone:R$(e.lastRun.status)})}),o.jsx("span",{className:"project-row-link",children:o.jsx(Kh,{className:"h-4 w-4 text-zinc-500"})})]})}function Wce(){const e=Vh(),{dashboard:t,isLoading:n}=wc(),r=t??e?.dashboard;if(!r||n)return o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-32"}),o.jsx("div",{className:"skeleton-text-sm w-64"})]}),o.jsx("div",{className:"space-y-3",children:[1,2,3].map(p=>o.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4 flex items-center gap-4",children:[o.jsxs("div",{className:"flex-1 space-y-2",children:[o.jsx("div",{className:"skeleton-text w-36"}),o.jsx("div",{className:"skeleton-text-sm w-48"})]}),o.jsx("div",{className:"skeleton-text w-16"}),o.jsx("div",{className:"skeleton-text w-16"}),o.jsx("div",{className:"skeleton h-8 w-20 rounded"})]},p))})]});const i=r.portfolioOverview,u=Bv(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},d=xte(i.systemHealth,u,r.settings),{openRun:f}=xd();return o.jsxs("div",{className:"page-container",children:[o.jsxs("div",{className:"page-header",children:[o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:"Portfolio"}),o.jsx("p",{className:"page-subtitle",children:"Visibility and execution state across all projects"})]}),o.jsx("div",{className:"page-header-right",children:o.jsx("p",{className:"text-[11px] text-zinc-600",children:i.lastUpdatedAt})})]}),i.projects.length>0?o.jsx("div",{className:"project-list project-list-scrollable",children:i.projects.map(p=>o.jsx(Yce,{project:p},p.project.id))}):o.jsxs($e,{className:"surface-card empty-card",children:[o.jsx("h3",{children:i.emptyState?.title??"No projects yet"}),o.jsx("p",{className:"supporting-copy",children:i.emptyState?.detail}),o.jsx(be,{size:"sm",asChild:!0,children:o.jsx(Zt,{to:i.emptyState?.ctaHref==="/setup"||!i.emptyState?.ctaHref?"/setup":"/",children:i.emptyState?.ctaLabel??"Launch setup"})})]}),o.jsxs("div",{className:"overview-secondary-grid",children:[i.attentionItems.length>0&&o.jsxs("section",{className:"overview-secondary-section",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Needs attention"}),o.jsx("h2",{className:"section-title-sm",children:"What changed"})]})}),o.jsx("div",{className:"attention-list attention-list-scrollable",children:i.attentionItems.map(p=>o.jsxs(Zt,{to:p.href,className:`attention-item attention-item-${p.tone}`,children:[o.jsxs("div",{children:[o.jsx("p",{className:"attention-title",children:p.title}),o.jsx("p",{className:"attention-detail",children:p.detail})]}),o.jsx("span",{className:"attention-action",children:p.actionLabel})]},p.id))})]}),o.jsxs("section",{className:"overview-secondary-section",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Recent runs"}),o.jsx("h2",{className:"section-title-sm",children:"Activity"})]})}),o.jsx("div",{className:"compact-stack compact-stack-scrollable",children:i.recentRuns.length>0?i.recentRuns.map(p=>o.jsxs("button",{className:"compact-run",type:"button",onClick:()=>f(p.id),children:[o.jsxs("div",{children:[o.jsx("p",{className:"compact-run-title",children:p.projectName}),o.jsx("p",{className:"compact-run-detail",children:p.summary})]}),o.jsx(Dv,{status:p.status})]},p.id)):o.jsx("p",{className:"supporting-copy",children:"Run history appears here after the first launch."})})]})]}),o.jsxs("section",{className:"page-section",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"System health"}),o.jsx("h2",{className:"section-title-sm",children:"Infrastructure"})]})}),o.jsx("div",{className:"health-grid",children:d.map(p=>o.jsxs($e,{className:"surface-card compact-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:p.label}),o.jsx("h3",{children:p.detail})]}),o.jsx(Xe,{tone:p.tone,title:p.id==="api"?Ho(u.apiStatus):p.id==="worker"?Ho(u.workerStatus):void 0,children:p.label})]}),o.jsx("p",{className:"supporting-copy",children:p.meta})]},p.id))})]})]})}const Pk=Symbol.for("yaml.alias"),y1=Symbol.for("yaml.document"),$o=Symbol.for("yaml.map"),E3=Symbol.for("yaml.pair"),qa=Symbol.for("yaml.scalar"),Sd=Symbol.for("yaml.seq"),Ki=Symbol.for("yaml.node.type"),jc=e=>!!e&&typeof e=="object"&&e[Ki]===Pk,Gv=e=>!!e&&typeof e=="object"&&e[Ki]===y1,Wh=e=>!!e&&typeof e=="object"&&e[Ki]===$o,Rn=e=>!!e&&typeof e=="object"&&e[Ki]===E3,en=e=>!!e&&typeof e=="object"&&e[Ki]===qa,Zh=e=>!!e&&typeof e=="object"&&e[Ki]===Sd;function Pn(e){if(e&&typeof e=="object")switch(e[Ki]){case $o:case Sd:return!0}return!1}function Tn(e){if(e&&typeof e=="object")switch(e[Ki]){case Pk:case $o:case qa:case Sd:return!0}return!1}const _3=e=>(en(e)||Pn(e))&&!!e.anchor,_l=Symbol("break visit"),Zce=Symbol("skip children"),dh=Symbol("remove node");function jd(e,t){const n=Xce(t);Gv(e)?Eu(null,e.contents,n,Object.freeze([e]))===dh&&(e.contents=null):Eu(null,e,n,Object.freeze([]))}jd.BREAK=_l;jd.SKIP=Zce;jd.REMOVE=dh;function Eu(e,t,n,r){const i=Jce(e,t,n,r);if(Tn(i)||Rn(i))return eue(e,r,i),Eu(e,i,n,r);if(typeof i!="symbol"){if(Pn(t)){r=Object.freeze(r.concat(t));for(let a=0;a<t.items.length;++a){const l=Eu(a,t.items[a],n,r);if(typeof l=="number")a=l-1;else{if(l===_l)return _l;l===dh&&(t.items.splice(a,1),a-=1)}}}else if(Rn(t)){r=Object.freeze(r.concat(t));const a=Eu("key",t.key,n,r);if(a===_l)return _l;a===dh&&(t.key=null);const l=Eu("value",t.value,n,r);if(l===_l)return _l;l===dh&&(t.value=null)}}return i}function Xce(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 Jce(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(Wh(t))return n.Map?.(e,t,r);if(Zh(t))return n.Seq?.(e,t,r);if(Rn(t))return n.Pair?.(e,t,r);if(en(t))return n.Scalar?.(e,t,r);if(jc(t))return n.Alias?.(e,t,r)}function eue(e,t,n){const r=t[t.length-1];if(Pn(r))r.items[e]=n;else if(Rn(r))e==="key"?r.key=n:r.value=n;else if(Gv(r))r.contents=n;else{const i=jc(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const tue={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},nue=e=>e.replace(/[!,[\]{}]/g,t=>tue[t]);class zr{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},zr.defaultYaml,t),this.tags=Object.assign({},zr.defaultTags,n)}clone(){const t=new zr(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new zr(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:zr.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},zr.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:zr.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},zr.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[a,l]=r;return this.tags[a]=l,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[a]=r;if(a==="1.1"||a==="1.2")return this.yaml.version=a,!0;{const l=/^\d+\.\d+$/.test(a);return n(6,`Unsupported YAML version ${a}`,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 a=this.tags[r];if(a)try{return a+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+nue(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 a={};jd(t.contents,(l,u)=>{Tn(u)&&u.tag&&(a[u.tag]=!0)}),i=Object.keys(a)}else i=[];for(const[a,l]of r)a==="!!"&&l==="tag:yaml.org,2002:"||(!t||i.some(u=>u.startsWith(l)))&&n.push(`%TAG ${a} ${l}`);return n.join(`
|
|
117
|
-
`)}}zr.defaultYaml={explicit:!1,version:"1.2"};zr.defaultTags={"!!":"tag:yaml.org,2002:"};function z3(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 P3(e){const t=new Set;return jd(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function T3(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function rue(e,t){const n=[],r=new Map;let i=null;return{onAnchor:a=>{n.push(a),i??(i=P3(e));const l=T3(t,i);return i.add(l),l},setAnchors:()=>{for(const a of n){const l=r.get(a);if(typeof l=="object"&&l.anchor&&(en(l.node)||Pn(l.node)))l.node.anchor=l.anchor;else{const u=new Error("Failed to resolve repeated object (this should not happen)");throw u.source=a,u}}},sourceObjects:r}}function _u(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,a=r.length;i<a;++i){const l=r[i],u=_u(e,r,String(i),l);u===void 0?delete r[i]:u!==l&&(r[i]=u)}else if(r instanceof Map)for(const i of Array.from(r.keys())){const a=r.get(i),l=_u(e,r,i,a);l===void 0?r.delete(i):l!==a&&r.set(i,l)}else if(r instanceof Set)for(const i of Array.from(r)){const a=_u(e,r,i,i);a===void 0?r.delete(i):a!==i&&(r.delete(i),r.add(a))}else for(const[i,a]of Object.entries(r)){const l=_u(e,r,i,a);l===void 0?delete r[i]:l!==a&&(r[i]=l)}return e.call(t,n,r)}function Fi(e,t,n){if(Array.isArray(e))return e.map((r,i)=>Fi(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!_3(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=a=>{r.res=a,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 Tk{constructor(t){Object.defineProperty(this,Ki,{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:a}={}){if(!Gv(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},u=Fi(this,"",l);if(typeof i=="function")for(const{count:d,res:f}of l.anchors.values())i(f,d);return typeof a=="function"?_u(a,{"":u},"",u):u}}class Rk extends Tk{constructor(t){super(Pk),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=[],jd(t,{Node:(a,l)=>{(jc(l)||_3(l))&&r.push(l)}}),n&&(n.aliasResolveCache=r));let i;for(const a of r){if(a===this)break;a.anchor===this.source&&(i=a)}return i}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:i,maxAliasCount:a}=n,l=this.resolve(i,n);if(!l){const d=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(d)}let u=r.get(l);if(u||(Fi(l,null,n),u=r.get(l)),u?.res===void 0){const d="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(d)}if(a>=0&&(u.count+=1,u.aliasCount===0&&(u.aliasCount=$g(i,l,r)),u.count*u.aliasCount>a)){const d="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(d)}return u.res}toString(t,n,r){const i=`*${this.source}`;if(t){if(z3(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(a)}if(t.implicitKey)return`${i} `}return i}}function $g(e,t,n){if(jc(t)){const r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Pn(t)){let r=0;for(const i of t.items){const a=$g(e,i,n);a>r&&(r=a)}return r}else if(Rn(t)){const r=$g(e,t.key,n),i=$g(e,t.value,n);return Math.max(r,i)}return 1}const R3=e=>!e||typeof e!="function"&&typeof e!="object";class at extends Tk{constructor(t){super(qa),this.value=t}toJSON(t,n){return n?.keep?this.value:Fi(this.value,t,n)}toString(){return String(this.value)}}at.BLOCK_FOLDED="BLOCK_FOLDED";at.BLOCK_LITERAL="BLOCK_LITERAL";at.PLAIN="PLAIN";at.QUOTE_DOUBLE="QUOTE_DOUBLE";at.QUOTE_SINGLE="QUOTE_SINGLE";const iue="tag:yaml.org,2002:";function aue(e,t,n){if(t){const r=n.filter(a=>a.tag===t),i=r.find(a=>!a.format)??r[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(r=>r.identify?.(e)&&!r.format)}function Ch(e,t,n){if(Gv(e)&&(e=e.contents),Tn(e))return e;if(Rn(e)){const m=n.schema[$o].createNode?.(n.schema,null,n);return m.items.push(e),m}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:l,sourceObjects:u}=n;let d;if(r&&e&&typeof e=="object"){if(d=u.get(e),d)return d.anchor??(d.anchor=i(e)),new Rk(d.anchor);d={anchor:null,node:null},u.set(e,d)}t?.startsWith("!!")&&(t=iue+t.slice(2));let f=aue(e,t,l.tags);if(!f){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new at(e);return d&&(d.node=m),m}f=e instanceof Map?l[$o]:Symbol.iterator in Object(e)?l[Sd]:l[$o]}a&&(a(f),delete n.onTagObj);const p=f?.createNode?f.createNode(n.schema,e,n):typeof f?.nodeClass?.from=="function"?f.nodeClass.from(n.schema,e,n):new at(e);return t?p.tag=t:f.default||(p.tag=f.tag),d&&(d.node=p),p}function yy(e,t,n){let r=n;for(let i=t.length-1;i>=0;--i){const a=t[i];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){const l=[];l[a]=r,r=l}else r=new Map([[a,r]])}return Ch(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 th=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class D3 extends Tk{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)||Rn(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(th(t))this.add(n);else{const[r,...i]=t,a=this.get(r,!0);if(Pn(a))a.addIn(i,n);else if(a===void 0&&this.schema)this.set(r,yy(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(Pn(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...i]=t,a=this.get(r,!0);return i.length===0?!n&&en(a)?a.value:a:Pn(a)?a.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Rn(n))return!1;const r=n.value;return r==null||t&&en(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 Pn(i)?i.hasIn(r):!1}setIn(t,n){const[r,...i]=t;if(i.length===0)this.set(r,n);else{const a=this.get(r,!0);if(Pn(a))a.setIn(i,n);else if(a===void 0&&this.schema)this.set(r,yy(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}}const sue=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function js(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Ll=(e,t,n)=>e.endsWith(`
|
|
118
|
-
`)?js(n,t):n.includes(`
|
|
119
|
-
`)?`
|
|
120
|
-
`+js(n,t):(e.endsWith(" ")?"":" ")+n,M3="flow",v1="block",Bg="quoted";function Vv(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:l,onOverflow:u}={}){if(!i||i<0)return e;i<a&&(a=0);const d=Math.max(1+a,1+i-t.length);if(e.length<=d)return e;const f=[],p={};let m=i-t.length;typeof r=="number"&&(r>i-Math.max(2,a)?f.push(0):m=i-r);let g,v,S=!1,b=-1,j=-1,k=-1;n===v1&&(b=xT(e,b,t.length),b!==-1&&(m=b+d));for(let C;C=e[b+=1];){if(n===Bg&&C==="\\"){switch(j=b,e[b+1]){case"x":b+=3;break;case"u":b+=5;break;case"U":b+=9;break;default:b+=1}k=b}if(C===`
|
|
121
|
-
`)n===v1&&(b=xT(e,b,t.length)),m=b+t.length+d,g=void 0;else{if(C===" "&&v&&v!==" "&&v!==`
|
|
122
|
-
`&&v!==" "){const A=e[b+1];A&&A!==" "&&A!==`
|
|
123
|
-
`&&A!==" "&&(g=b)}if(b>=m)if(g)f.push(g),m=g+d,g=void 0;else if(n===Bg){for(;v===" "||v===" ";)v=C,C=e[b+=1],S=!0;const A=b>k+1?b-2:j-1;if(p[A])return e;f.push(A),p[A]=!0,m=A+d,g=void 0}else S=!0}v=C}if(S&&u&&u(),f.length===0)return e;l&&l();let E=e.slice(0,f[0]);for(let C=0;C<f.length;++C){const A=f[C],P=f[C+1]||e.length;A===0?E=`
|
|
124
|
-
${t}${e.slice(0,P)}`:(n===Bg&&p[A]&&(E+=`${e[A]}\\`),E+=`
|
|
125
|
-
${t}${e.slice(A+1,P)}`)}return E}function xT(e,t,n){let r=t,i=t+1,a=e[i];for(;a===" "||a===" ";)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
|
|
126
|
-
`);r=t,i=t+1,a=e[i]}return r}const Qv=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Yv=e=>/^(%|---|\.\.\.)/m.test(e);function oue(e,t,n){if(!t||t<0)return!1;const r=t-n,i=e.length;if(i<=r)return!1;for(let a=0,l=0;a<i;++a)if(e[a]===`
|
|
127
|
-
`){if(a-l>r)return!0;if(l=a+1,i-l<=r)return!1}return!0}function fh(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(Yv(e)?" ":"");let l="",u=0;for(let d=0,f=n[d];f;f=n[++d])if(f===" "&&n[d+1]==="\\"&&n[d+2]==="n"&&(l+=n.slice(u,d)+"\\ ",d+=1,u=d,f="\\"),f==="\\")switch(n[d+1]){case"u":{l+=n.slice(u,d);const p=n.substr(d+2,4);switch(p){case"0000":l+="\\0";break;case"0007":l+="\\a";break;case"000b":l+="\\v";break;case"001b":l+="\\e";break;case"0085":l+="\\N";break;case"00a0":l+="\\_";break;case"2028":l+="\\L";break;case"2029":l+="\\P";break;default:p.substr(0,2)==="00"?l+="\\x"+p.substr(2):l+=n.substr(d,6)}d+=5,u=d+1}break;case"n":if(r||n[d+2]==='"'||n.length<i)d+=1;else{for(l+=n.slice(u,d)+`
|
|
128
|
-
|
|
129
|
-
`;n[d+2]==="\\"&&n[d+3]==="n"&&n[d+4]!=='"';)l+=`
|
|
130
|
-
`,d+=2;l+=a,n[d+2]===" "&&(l+="\\"),d+=1,u=d+1}break;default:d+=1}return l=u?l+n.slice(u):n,r?l:Vv(l,a,Bg,Qv(t,!1))}function x1(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
131
|
-
`)||/[ \t]\n|\n[ \t]/.test(e))return fh(e,t);const n=t.indent||(Yv(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
132
|
-
${n}`)+"'";return t.implicitKey?r:Vv(r,n,M3,Qv(t,!1))}function zu(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=fh;else{const i=e.includes('"'),a=e.includes("'");i&&!a?r=x1:a&&!i?r=fh:r=n?x1:fh}return r(e,t)}let b1;try{b1=new RegExp(`(^|(?<!
|
|
133
|
-
))
|
|
134
|
-
+(?!
|
|
135
|
-
|$)`,"g")}catch{b1=/\n+(?!\n|$)/g}function Ug({comment:e,type:t,value:n},r,i,a){const{blockQuote:l,commentString:u,lineWidth:d}=r.options;if(!l||/\n[\t ]+$/.test(n))return zu(n,r);const f=r.indent||(r.forceBlockIndent||Yv(n)?" ":""),p=l==="literal"?!0:l==="folded"||t===at.BLOCK_FOLDED?!1:t===at.BLOCK_LITERAL?!0:!oue(n,d,f.length);if(!n)return p?`|
|
|
136
|
-
`:`>
|
|
137
|
-
`;let m,g;for(g=n.length;g>0;--g){const P=n[g-1];if(P!==`
|
|
138
|
-
`&&P!==" "&&P!==" ")break}let v=n.substring(g);const S=v.indexOf(`
|
|
139
|
-
`);S===-1?m="-":n===v||S!==v.length-1?(m="+",a&&a()):m="",v&&(n=n.slice(0,-v.length),v[v.length-1]===`
|
|
140
|
-
`&&(v=v.slice(0,-1)),v=v.replace(b1,`$&${f}`));let b=!1,j,k=-1;for(j=0;j<n.length;++j){const P=n[j];if(P===" ")b=!0;else if(P===`
|
|
141
|
-
`)k=j;else break}let E=n.substring(0,k<j?k+1:j);E&&(n=n.substring(E.length),E=E.replace(/\n+/g,`$&${f}`));let A=(b?f?"2":"1":"")+m;if(e&&(A+=" "+u(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!p){const P=n.replace(/\n+/g,`
|
|
142
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${f}`);let O=!1;const _=Qv(r,!0);l!=="folded"&&t!==at.BLOCK_FOLDED&&(_.onOverflow=()=>{O=!0});const T=Vv(`${E}${P}${v}`,f,v1,_);if(!O)return`>${A}
|
|
143
|
-
${f}${T}`}return n=n.replace(/\n+/g,`$&${f}`),`|${A}
|
|
144
|
-
${f}${E}${n}${v}`}function lue(e,t,n,r){const{type:i,value:a}=e,{actualString:l,implicitKey:u,indent:d,indentStep:f,inFlow:p}=t;if(u&&a.includes(`
|
|
145
|
-
`)||p&&/[[\]{},]/.test(a))return zu(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return u||p||!a.includes(`
|
|
146
|
-
`)?zu(a,t):Ug(e,t,n,r);if(!u&&!p&&i!==at.PLAIN&&a.includes(`
|
|
147
|
-
`))return Ug(e,t,n,r);if(Yv(a)){if(d==="")return t.forceBlockIndent=!0,Ug(e,t,n,r);if(u&&d===f)return zu(a,t)}const m=a.replace(/\n+/g,`$&
|
|
148
|
-
${d}`);if(l){const g=b=>b.default&&b.tag!=="tag:yaml.org,2002:str"&&b.test?.test(m),{compat:v,tags:S}=t.doc.schema;if(S.some(g)||v?.some(g))return zu(a,t)}return u?m:Vv(m,d,M3,Qv(t,!1))}function Dk(e,t,n,r){const{implicitKey:i,inFlow:a}=t,l=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:u}=e;u!==at.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(l.value)&&(u=at.QUOTE_DOUBLE);const d=p=>{switch(p){case at.BLOCK_FOLDED:case at.BLOCK_LITERAL:return i||a?zu(l.value,t):Ug(l,t,n,r);case at.QUOTE_DOUBLE:return fh(l.value,t);case at.QUOTE_SINGLE:return x1(l.value,t);case at.PLAIN:return lue(l,t,n,r);default:return null}};let f=d(u);if(f===null){const{defaultKeyType:p,defaultStringType:m}=t.options,g=i&&p||m;if(f=d(g),f===null)throw new Error(`Unsupported default string type ${g}`)}return f}function I3(e,t){const n=Object.assign({blockQuote:!0,commentString:sue,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 cue(e,t){if(t.tag){const i=e.filter(a=>a.tag===t.tag);if(i.length>0)return i.find(a=>a.format===t.format)??i[0]}let n,r;if(en(t)){r=t.value;let i=e.filter(a=>a.identify?.(r));if(i.length>1){const a=i.filter(l=>l.test);a.length>0&&(i=a)}n=i.find(a=>a.format===t.format)??i.find(a=>!a.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 uue(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],a=(en(e)||Pn(e))&&e.anchor;a&&z3(a)&&(n.add(a),i.push(`&${a}`));const l=e.tag??(t.default?null:t.tag);return l&&i.push(r.directives.tagString(l)),i.join(" ")}function ed(e,t,n,r){if(Rn(e))return e.toString(t,n,r);if(jc(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 a=Tn(e)?e:t.doc.createNode(e,{onTagObj:d=>i=d});i??(i=cue(t.doc.schema.tags,a));const l=uue(a,i,t);l.length>0&&(t.indentAtStart=(t.indentAtStart??0)+l.length+1);const u=typeof i.stringify=="function"?i.stringify(a,t,n,r):en(a)?Dk(a,t,n,r):a.toString(t,n,r);return l?en(a)||u[0]==="{"||u[0]==="["?`${l} ${u}`:`${l}
|
|
149
|
-
${t.indent}${u}`:u}function due({key:e,value:t},n,r,i){const{allNullValues:a,doc:l,indent:u,indentStep:d,options:{commentString:f,indentSeq:p,simpleKeys:m}}=n;let g=Tn(e)&&e.comment||null;if(m){if(g)throw new Error("With simple keys, key nodes cannot have comments");if(Pn(e)||!Tn(e)&&typeof e=="object"){const _="With simple keys, collection cannot be used as a key value";throw new Error(_)}}let v=!m&&(!e||g&&t==null&&!n.inFlow||Pn(e)||(en(e)?e.type===at.BLOCK_FOLDED||e.type===at.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!v&&(m||!a),indent:u+d});let S=!1,b=!1,j=ed(e,n,()=>S=!0,()=>b=!0);if(!v&&!n.inFlow&&j.length>1024){if(m)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(n.inFlow){if(a||t==null)return S&&r&&r(),j===""?"?":v?`? ${j}`:j}else if(a&&!m||t==null&&v)return j=`? ${j}`,g&&!S?j+=Ll(j,n.indent,f(g)):b&&i&&i(),j;S&&(g=null),v?(g&&(j+=Ll(j,n.indent,f(g))),j=`? ${j}
|
|
150
|
-
${u}:`):(j=`${j}:`,g&&(j+=Ll(j,n.indent,f(g))));let k,E,C;Tn(t)?(k=!!t.spaceBefore,E=t.commentBefore,C=t.comment):(k=!1,E=null,C=null,t&&typeof t=="object"&&(t=l.createNode(t))),n.implicitKey=!1,!v&&!g&&en(t)&&(n.indentAtStart=j.length+1),b=!1,!p&&d.length>=2&&!n.inFlow&&!v&&Zh(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let A=!1;const P=ed(t,n,()=>A=!0,()=>b=!0);let O=" ";if(g||k||E){if(O=k?`
|
|
151
|
-
`:"",E){const _=f(E);O+=`
|
|
152
|
-
${js(_,n.indent)}`}P===""&&!n.inFlow?O===`
|
|
153
|
-
`&&C&&(O=`
|
|
154
|
-
|
|
155
|
-
`):O+=`
|
|
156
|
-
${n.indent}`}else if(!v&&Pn(t)){const _=P[0],T=P.indexOf(`
|
|
157
|
-
`),$=T!==-1,F=n.inFlow??t.flow??t.items.length===0;if($||!F){let U=!1;if($&&(_==="&"||_==="!")){let B=P.indexOf(" ");_==="&"&&B!==-1&&B<T&&P[B+1]==="!"&&(B=P.indexOf(" ",B+1)),(B===-1||T<B)&&(U=!0)}U||(O=`
|
|
158
|
-
${n.indent}`)}}else(P===""||P[0]===`
|
|
159
|
-
`)&&(O="");return j+=O+P,n.inFlow?A&&r&&r():C&&!A?j+=Ll(j,n.indent,f(C)):b&&i&&i(),j}function fue(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const rg="<<",Cs={identify:e=>e===rg||typeof e=="symbol"&&e.description===rg,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new at(Symbol(rg)),{addToJSMap:L3}),stringify:()=>rg},hue=(e,t)=>(Cs.identify(t)||en(t)&&(!t.type||t.type===at.PLAIN)&&Cs.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===Cs.tag&&n.default);function L3(e,t,n){if(n=e&&jc(n)?n.resolve(e.doc):n,Zh(n))for(const r of n.items)Vw(e,t,r);else if(Array.isArray(n))for(const r of n)Vw(e,t,r);else Vw(e,t,n)}function Vw(e,t,n){const r=e&&jc(n)?n.resolve(e.doc):n;if(!Wh(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,e,Map);for(const[a,l]of i)t instanceof Map?t.has(a)||t.set(a,l):t instanceof Set?t.add(a):Object.prototype.hasOwnProperty.call(t,a)||Object.defineProperty(t,a,{value:l,writable:!0,enumerable:!0,configurable:!0});return t}function $3(e,t,{key:n,value:r}){if(Tn(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(hue(e,n))L3(e,t,r);else{const i=Fi(n,"",e);if(t instanceof Map)t.set(i,Fi(r,i,e));else if(t instanceof Set)t.add(i);else{const a=pue(n,i,e),l=Fi(r,a,e);a in t?Object.defineProperty(t,a,{value:l,writable:!0,enumerable:!0,configurable:!0}):t[a]=l}}return t}function pue(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Tn(e)&&n?.doc){const r=I3(n.doc,{});r.anchors=new Set;for(const a of n.anchors.keys())r.anchors.add(a.anchor);r.inFlow=!0,r.inStringifyKey=!0;const i=e.toString(r);if(!n.mapKeyWarned){let a=JSON.stringify(i);a.length>40&&(a=a.substring(0,36)+'..."'),fue(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(t)}function Mk(e,t,n){const r=Ch(e,void 0,n),i=Ch(t,void 0,n);return new Dr(r,i)}class Dr{constructor(t,n=null){Object.defineProperty(this,Ki,{value:E3}),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 Dr(n,r)}toJSON(t,n){const r=n?.mapAsMap?new Map:{};return $3(n,r,this)}toString(t,n,r){return t?.doc?due(this,t,n,r):JSON.stringify(this)}}function B3(e,t,n){return(t.inFlow??e.flow?gue:mue)(e,t,n)}function mue({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:l,onComment:u}){const{indent:d,options:{commentString:f}}=n,p=Object.assign({},n,{indent:a,type:null});let m=!1;const g=[];for(let S=0;S<t.length;++S){const b=t[S];let j=null;if(Tn(b))!m&&b.spaceBefore&&g.push(""),vy(n,g,b.commentBefore,m),b.comment&&(j=b.comment);else if(Rn(b)){const E=Tn(b.key)?b.key:null;E&&(!m&&E.spaceBefore&&g.push(""),vy(n,g,E.commentBefore,m))}m=!1;let k=ed(b,p,()=>j=null,()=>m=!0);j&&(k+=Ll(k,a,f(j))),m&&j&&(m=!1),g.push(r+k)}let v;if(g.length===0)v=i.start+i.end;else{v=g[0];for(let S=1;S<g.length;++S){const b=g[S];v+=b?`
|
|
160
|
-
${d}${b}`:`
|
|
161
|
-
`}}return e?(v+=`
|
|
162
|
-
`+js(f(e),d),u&&u()):m&&l&&l(),v}function gue({items:e},t,{flowChars:n,itemIndent:r}){const{indent:i,indentStep:a,flowCollectionPadding:l,options:{commentString:u}}=t;r+=a;const d=Object.assign({},t,{indent:r,inFlow:!0,type:null});let f=!1,p=0;const m=[];for(let S=0;S<e.length;++S){const b=e[S];let j=null;if(Tn(b))b.spaceBefore&&m.push(""),vy(t,m,b.commentBefore,!1),b.comment&&(j=b.comment);else if(Rn(b)){const E=Tn(b.key)?b.key:null;E&&(E.spaceBefore&&m.push(""),vy(t,m,E.commentBefore,!1),E.comment&&(f=!0));const C=Tn(b.value)?b.value:null;C?(C.comment&&(j=C.comment),C.commentBefore&&(f=!0)):b.value==null&&E?.comment&&(j=E.comment)}j&&(f=!0);let k=ed(b,d,()=>j=null);S<e.length-1&&(k+=","),j&&(k+=Ll(k,r,u(j))),!f&&(m.length>p||k.includes(`
|
|
163
|
-
`))&&(f=!0),m.push(k),p=m.length}const{start:g,end:v}=n;if(m.length===0)return g+v;if(!f){const S=m.reduce((b,j)=>b+j.length+2,2);f=t.options.lineWidth>0&&S>t.options.lineWidth}if(f){let S=g;for(const b of m)S+=b?`
|
|
164
|
-
${a}${i}${b}`:`
|
|
165
|
-
`;return`${S}
|
|
166
|
-
${i}${v}`}else return`${g}${l}${m.join(" ")}${l}${v}`}function vy({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const a=js(t(r),e);n.push(a.trimStart())}}function $l(e,t){const n=en(t)?t.value:t;for(const r of e)if(Rn(r)&&(r.key===t||r.key===n||en(r.key)&&r.key.value===n))return r}class $i extends D3{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super($o,t),this.items=[]}static from(t,n,r){const{keepUndefined:i,replacer:a}=r,l=new this(t),u=(d,f)=>{if(typeof a=="function")f=a.call(n,d,f);else if(Array.isArray(a)&&!a.includes(d))return;(f!==void 0||i)&&l.items.push(Mk(d,f,r))};if(n instanceof Map)for(const[d,f]of n)u(d,f);else if(n&&typeof n=="object")for(const d of Object.keys(n))u(d,n[d]);return typeof t.sortMapEntries=="function"&&l.items.sort(t.sortMapEntries),l}add(t,n){let r;Rn(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Dr(t,t?.value):r=new Dr(t.key,t.value);const i=$l(this.items,r.key),a=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);en(i.value)&&R3(r.value)?i.value.value=r.value:i.value=r.value}else if(a){const l=this.items.findIndex(u=>a(r,u)<0);l===-1?this.items.push(r):this.items.splice(l,0,r)}else this.items.push(r)}delete(t){const n=$l(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=$l(this.items,t)?.value;return(!n&&en(i)?i.value:i)??void 0}has(t){return!!$l(this.items,t)}set(t,n){this.add(new Dr(t,n),!0)}toJSON(t,n,r){const i=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(i);for(const a of this.items)$3(n,i,a);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(const i of this.items)if(!Rn(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})),B3(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const Nd={collection:"map",default:!0,nodeClass:$i,tag:"tag:yaml.org,2002:map",resolve(e,t){return Wh(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>$i.from(e,t,n)};class ic extends D3{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Sd,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=ig(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=ig(t);if(typeof r!="number")return;const i=this.items[r];return!n&&en(i)?i.value:i}has(t){const n=ig(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=ig(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const i=this.items[r];en(i)&&R3(n)?i.value=n:this.items[r]=n}toJSON(t,n){const r=[];n?.onCreate&&n.onCreate(r);let i=0;for(const a of this.items)r.push(Fi(a,String(i++),n));return r}toString(t,n,r){return t?B3(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,a=new this(t);if(n&&Symbol.iterator in Object(n)){let l=0;for(let u of n){if(typeof i=="function"){const d=n instanceof Set?u:String(l++);u=i.call(n,d,u)}a.items.push(Ch(u,void 0,r))}}return a}}function ig(e){let t=en(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const kd={collection:"seq",default:!0,nodeClass:ic,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Zh(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>ic.from(e,t,n)},Wv={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),Dk(e,t,n,r)}},Zv={identify:e=>e==null,createNode:()=>new at(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new at(null),stringify:({source:e},t)=>typeof e=="string"&&Zv.test.test(e)?e:t.options.nullStr},Ik={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new at(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Ik.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 ga({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 a=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(a)){let l=a.indexOf(".");l<0&&(l=a.length,a+=".");let u=t-(a.length-l-1);for(;u-- >0;)a+="0"}return a}const U3={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:ga},q3={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():ga(e)}},F3={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 at(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:ga},Xv=e=>typeof e=="bigint"||Number.isInteger(e),Lk=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function H3(e,t,n){const{value:r}=e;return Xv(r)&&r>=0?n+r.toString(t):ga(e)}const K3={identify:e=>Xv(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Lk(e,2,8,n),stringify:e=>H3(e,8,"0o")},G3={identify:Xv,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Lk(e,0,10,n),stringify:ga},V3={identify:e=>Xv(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Lk(e,2,16,n),stringify:e=>H3(e,16,"0x")},yue=[Nd,kd,Wv,Zv,Ik,K3,G3,V3,U3,q3,F3];function bT(e){return typeof e=="bigint"||Number.isInteger(e)}const ag=({value:e})=>JSON.stringify(e),vue=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:ag},{identify:e=>e==null,createNode:()=>new at(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:ag},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:ag},{identify:bT,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})=>bT(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:ag}],xue={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},bue=[Nd,kd].concat(vue,xue),$k={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,a){if(!n)return"";const l=n;let u;if(typeof btoa=="function"){let d="";for(let f=0;f<l.length;++f)d+=String.fromCharCode(l[f]);u=btoa(d)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=at.BLOCK_LITERAL),t!==at.QUOTE_DOUBLE){const d=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),f=Math.ceil(u.length/d),p=new Array(f);for(let m=0,g=0;m<f;++m,g+=d)p[m]=u.substr(g,d);u=p.join(t===at.BLOCK_LITERAL?`
|
|
167
|
-
`:" ")}return Dk({comment:e,type:t,value:u},r,i,a)}};function Q3(e,t){if(Zh(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!Rn(r)){if(Wh(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const i=r.items[0]||new Dr(new at(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
|
|
168
|
-
${i.key.commentBefore}`:r.commentBefore),r.comment){const a=i.value??i.key;a.comment=a.comment?`${r.comment}
|
|
169
|
-
${a.comment}`:r.comment}r=i}e.items[n]=Rn(r)?r:new Dr(r)}}else t("Expected a sequence for this tag");return e}function Y3(e,t,n){const{replacer:r}=n,i=new ic(e);i.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let l of t){typeof r=="function"&&(l=r.call(t,String(a++),l));let u,d;if(Array.isArray(l))if(l.length===2)u=l[0],d=l[1];else throw new TypeError(`Expected [key, value] tuple: ${l}`);else if(l&&l instanceof Object){const f=Object.keys(l);if(f.length===1)u=f[0],d=l[u];else throw new TypeError(`Expected tuple with one key, not ${f.length} keys`)}else u=l;i.items.push(Mk(u,d,n))}return i}const Bk={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Q3,createNode:Y3};class Uu extends ic{constructor(){super(),this.add=$i.prototype.add.bind(this),this.delete=$i.prototype.delete.bind(this),this.get=$i.prototype.get.bind(this),this.has=$i.prototype.has.bind(this),this.set=$i.prototype.set.bind(this),this.tag=Uu.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 a,l;if(Rn(i)?(a=Fi(i.key,"",n),l=Fi(i.value,a,n)):a=Fi(i,"",n),r.has(a))throw new Error("Ordered maps must not include duplicate keys");r.set(a,l)}return r}static from(t,n,r){const i=Y3(t,n,r),a=new this;return a.items=i.items,a}}Uu.tag="tag:yaml.org,2002:omap";const Uk={collection:"seq",identify:e=>e instanceof Map,nodeClass:Uu,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=Q3(e,t),r=[];for(const{key:i}of n.items)en(i)&&(r.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new Uu,n)},createNode:(e,t,n)=>Uu.from(e,t,n)};function W3({value:e,source:t},n){return t&&(e?Z3:X3).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const Z3={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 at(!0),stringify:W3},X3={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 at(!1),stringify:W3},wue={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:ga},Sue={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():ga(e)}},jue={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 at(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:ga},Xh=e=>typeof e=="bigint"||Number.isInteger(e);function Jv(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 a=parseInt(e,n);return i==="-"?-1*a:a}function qk(e,t,n){const{value:r}=e;if(Xh(r)){const i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return ga(e)}const Nue={identify:Xh,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Jv(e,2,2,n),stringify:e=>qk(e,2,"0b")},kue={identify:Xh,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Jv(e,1,8,n),stringify:e=>qk(e,8,"0")},Cue={identify:Xh,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Jv(e,0,10,n),stringify:ga},Aue={identify:Xh,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Jv(e,2,16,n),stringify:e=>qk(e,16,"0x")};class qu extends $i{constructor(t){super(t),this.tag=qu.tag}add(t){let n;Rn(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Dr(t.key,null):n=new Dr(t,null),$l(this.items,n.key)||this.items.push(n)}get(t,n){const r=$l(this.items,t);return!n&&Rn(r)?en(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=$l(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Dr(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,a=new this(t);if(n&&Symbol.iterator in Object(n))for(let l of n)typeof i=="function"&&(l=i.call(n,l,l)),a.items.push(Mk(l,null,r));return a}}qu.tag="tag:yaml.org,2002:set";const Fk={collection:"map",identify:e=>e instanceof Set,nodeClass:qu,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>qu.from(e,t,n),resolve(e,t){if(Wh(e)){if(e.hasAllNullValues(!0))return Object.assign(new qu,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Hk(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,i=l=>t?BigInt(l):Number(l),a=r.replace(/_/g,"").split(":").reduce((l,u)=>l*i(60)+i(u),i(0));return n==="-"?i(-1)*a:a}function J3(e){let{value:t}=e,n=l=>l;if(typeof t=="bigint")n=l=>BigInt(l);else if(isNaN(t)||!isFinite(t))return ga(e);let r="";t<0&&(r="-",t*=n(-1));const i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(l=>String(l).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const eB={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})=>Hk(e,n),stringify:J3},tB={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=>Hk(e,!1),stringify:J3},ex={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(ex.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,a,l,u]=t.map(Number),d=t[7]?Number((t[7]+"00").substr(1,3)):0;let f=Date.UTC(n,r-1,i,a||0,l||0,u||0,d);const p=t[8];if(p&&p!=="Z"){let m=Hk(p,!1);Math.abs(m)<30&&(m*=60),f-=6e4*m}return new Date(f)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},wT=[Nd,kd,Wv,Zv,Z3,X3,Nue,kue,Cue,Aue,wue,Sue,jue,$k,Cs,Uk,Bk,Fk,eB,tB,ex],ST=new Map([["core",yue],["failsafe",[Nd,kd,Wv]],["json",bue],["yaml11",wT],["yaml-1.1",wT]]),jT={binary:$k,bool:Ik,float:F3,floatExp:q3,floatNaN:U3,floatTime:tB,int:G3,intHex:V3,intOct:K3,intTime:eB,map:Nd,merge:Cs,null:Zv,omap:Uk,pairs:Bk,seq:kd,set:Fk,timestamp:ex},Oue={"tag:yaml.org,2002:binary":$k,"tag:yaml.org,2002:merge":Cs,"tag:yaml.org,2002:omap":Uk,"tag:yaml.org,2002:pairs":Bk,"tag:yaml.org,2002:set":Fk,"tag:yaml.org,2002:timestamp":ex};function Qw(e,t,n){const r=ST.get(t);if(r&&!e)return n&&!r.includes(Cs)?r.concat(Cs):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{const a=Array.from(ST.keys()).filter(l=>l!=="yaml11").map(l=>JSON.stringify(l)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${a} or define customTags array`)}if(Array.isArray(e))for(const a of e)i=i.concat(a);else typeof e=="function"&&(i=e(i.slice()));return n&&(i=i.concat(Cs)),i.reduce((a,l)=>{const u=typeof l=="string"?jT[l]:l;if(!u){const d=JSON.stringify(l),f=Object.keys(jT).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${d}; use one of ${f}`)}return a.includes(u)||a.push(u),a},[])}const Eue=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Kk{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:a,sortMapEntries:l,toStringDefaults:u}){this.compat=Array.isArray(t)?Qw(t,"compat"):t?Qw(null,t):null,this.name=typeof a=="string"&&a||"core",this.knownTags=i?Oue:{},this.tags=Qw(n,this.name,r),this.toStringOptions=u??null,Object.defineProperty(this,$o,{value:Nd}),Object.defineProperty(this,qa,{value:Wv}),Object.defineProperty(this,Sd,{value:kd}),this.sortMapEntries=typeof l=="function"?l:l===!0?Eue:null}clone(){const t=Object.create(Kk.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function _ue(e,t){const n=[];let r=t.directives===!0;if(t.directives!==!1&&e.directives){const d=e.directives.toString(e);d?(n.push(d),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const i=I3(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const d=a(e.commentBefore);n.unshift(js(d,""))}let l=!1,u=null;if(e.contents){if(Tn(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const p=a(e.contents.commentBefore);n.push(js(p,""))}i.forceBlockIndent=!!e.comment,u=e.contents.comment}const d=u?void 0:()=>l=!0;let f=ed(e.contents,i,()=>u=null,d);u&&(f+=Ll(f,"",a(u))),(f[0]==="|"||f[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${f}`:n.push(f)}else n.push(ed(e.contents,i));if(e.directives?.docEnd)if(e.comment){const d=a(e.comment);d.includes(`
|
|
170
|
-
`)?(n.push("..."),n.push(js(d,""))):n.push(`... ${d}`)}else n.push("...");else{let d=e.comment;d&&l&&(d=d.replace(/^\n+/,"")),d&&((!l||u)&&n[n.length-1]!==""&&n.push(""),n.push(js(a(d),"")))}return n.join(`
|
|
171
|
-
`)+`
|
|
172
|
-
`}class tx{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Ki,{value:y1});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);const a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=a;let{version:l}=a;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(l=this.directives.yaml.version)):this.directives=new zr({version:l}),this.setSchema(l,r),this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){const t=Object.create(tx.prototype,{[Ki]:{value:y1}});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){pu(this.contents)&&this.contents.add(t)}addIn(t,n){pu(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=P3(this);t.anchor=!n||r.has(n)?T3(n||"a",r):n}return new Rk(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 j=E=>typeof E=="number"||E instanceof String||E instanceof Number,k=n.filter(j).map(String);k.length>0&&(n=n.concat(k)),i=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:a,anchorPrefix:l,flow:u,keepUndefined:d,onTagObj:f,tag:p}=r??{},{onAnchor:m,setAnchors:g,sourceObjects:v}=rue(this,l||"a"),S={aliasDuplicateObjects:a??!0,keepUndefined:d??!1,onAnchor:m,onTagObj:f,replacer:i,schema:this.schema,sourceObjects:v},b=Ch(t,p,S);return u&&Pn(b)&&(b.flow=!0),g(),b}createPair(t,n,r={}){const i=this.createNode(t,null,r),a=this.createNode(n,null,r);return new Dr(i,a)}delete(t){return pu(this.contents)?this.contents.delete(t):!1}deleteIn(t){return th(t)?this.contents==null?!1:(this.contents=null,!0):pu(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Pn(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return th(t)?!n&&en(this.contents)?this.contents.value:this.contents:Pn(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Pn(this.contents)?this.contents.has(t):!1}hasIn(t){return th(t)?this.contents!==void 0:Pn(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=yy(this.schema,[t],n):pu(this.contents)&&this.contents.set(t,n)}setIn(t,n){th(t)?this.contents=n:this.contents==null?this.contents=yy(this.schema,Array.from(t),n):pu(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 zr({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 zr({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 Kk(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:a,reviver:l}={}){const u={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},d=Fi(this.contents,n??"",u);if(typeof a=="function")for(const{count:f,res:p}of u.anchors.values())a(p,f);return typeof l=="function"?_u(l,{"":d},"",d):d}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 _ue(this,t)}}function pu(e){if(Pn(e))return!0;throw new Error("Expected a YAML collection as document contents")}class nB extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}}class sg extends nB{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class zue extends nB{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const NT=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(u=>t.linePos(u));const{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,l=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(a>=60&&l.length>80){const u=Math.min(a-39,l.length-79);l="…"+l.substring(u),a-=u-1}if(l.length>80&&(l=l.substring(0,79)+"…"),r>1&&/^ *$/.test(l.substring(0,a))){let u=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);u.length>80&&(u=u.substring(0,79)+`…
|
|
173
|
-
`),l=u+l}if(/[^ ]/.test(l)){let u=1;const d=n.linePos[1];d?.line===r&&d.col>i&&(u=Math.max(1,Math.min(d.col-i,80-a)));const f=" ".repeat(a)+"^".repeat(u);n.message+=`:
|
|
174
|
-
|
|
175
|
-
${l}
|
|
176
|
-
${f}
|
|
177
|
-
`}};function td(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:l,startOnNewline:u}){let d=!1,f=u,p=u,m="",g="",v=!1,S=!1,b=null,j=null,k=null,E=null,C=null,A=null,P=null;for(const T of e)switch(S&&(T.type!=="space"&&T.type!=="newline"&&T.type!=="comma"&&a(T.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),S=!1),b&&(f&&T.type!=="comment"&&T.type!=="newline"&&a(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),b=null),T.type){case"space":!t&&(n!=="doc-start"||r?.type!=="flow-collection")&&T.source.includes(" ")&&(b=T),p=!0;break;case"comment":{p||a(T,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const $=T.source.substring(1)||" ";m?m+=g+$:m=$,g="",f=!1;break}case"newline":f?m?m+=T.source:(!A||n!=="seq-item-ind")&&(d=!0):g+=T.source,f=!0,v=!0,(j||k)&&(E=T),p=!0;break;case"anchor":j&&a(T,"MULTIPLE_ANCHORS","A node can have at most one anchor"),T.source.endsWith(":")&&a(T.offset+T.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),j=T,P??(P=T.offset),f=!1,p=!1,S=!0;break;case"tag":{k&&a(T,"MULTIPLE_TAGS","A node can have at most one tag"),k=T,P??(P=T.offset),f=!1,p=!1,S=!0;break}case n:(j||k)&&a(T,"BAD_PROP_ORDER",`Anchors and tags must be after the ${T.source} indicator`),A&&a(T,"UNEXPECTED_TOKEN",`Unexpected ${T.source} in ${t??"collection"}`),A=T,f=n==="seq-item-ind"||n==="explicit-key-ind",p=!1;break;case"comma":if(t){C&&a(T,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),C=T,f=!1,p=!1;break}default:a(T,"UNEXPECTED_TOKEN",`Unexpected ${T.type} token`),f=!1,p=!1}const O=e[e.length-1],_=O?O.offset+O.source.length:i;return S&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&a(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b&&(f&&b.indent<=l||r?.type==="block-map"||r?.type==="block-seq")&&a(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:C,found:A,spaceBefore:d,comment:m,hasNewline:v,anchor:j,tag:k,newlineAfterProp:E,end:_,start:P??_}}function Ah(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
178
|
-
`))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(Ah(t.key)||Ah(t.value))return!0}return!1;default:return!0}}function w1(e,t,n){if(t?.type==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Ah(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function rB(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const i=typeof r=="function"?r:(a,l)=>a===l||en(a)&&en(l)&&a.value===l.value;return t.some(a=>i(a.key,n))}const kT="All mapping items must start at the same column";function Pue({composeNode:e,composeEmptyNode:t},n,r,i,a){const l=a?.nodeClass??$i,u=new l(n.schema);n.atRoot&&(n.atRoot=!1);let d=r.offset,f=null;for(const p of r.items){const{start:m,key:g,sep:v,value:S}=p,b=td(m,{indicator:"explicit-key-ind",next:g??v?.[0],offset:d,onError:i,parentIndent:r.indent,startOnNewline:!0}),j=!b.found;if(j){if(g&&(g.type==="block-seq"?i(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in g&&g.indent!==r.indent&&i(d,"BAD_INDENT",kT)),!b.anchor&&!b.tag&&!v){f=b.end,b.comment&&(u.comment?u.comment+=`
|
|
179
|
-
`+b.comment:u.comment=b.comment);continue}(b.newlineAfterProp||Ah(g))&&i(g??m[m.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else b.found?.indent!==r.indent&&i(d,"BAD_INDENT",kT);n.atKey=!0;const k=b.end,E=g?e(n,g,b,i):t(n,k,m,null,b,i);n.schema.compat&&w1(r.indent,g,i),n.atKey=!1,rB(n,u.items,E)&&i(k,"DUPLICATE_KEY","Map keys must be unique");const C=td(v??[],{indicator:"map-value-ind",next:S,offset:E.range[2],onError:i,parentIndent:r.indent,startOnNewline:!g||g.type==="block-scalar"});if(d=C.end,C.found){j&&(S?.type==="block-map"&&!C.hasNewline&&i(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&b.start<C.found.offset-1024&&i(E.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const A=S?e(n,S,C,i):t(n,d,v,null,C,i);n.schema.compat&&w1(r.indent,S,i),d=A.range[2];const P=new Dr(E,A);n.options.keepSourceTokens&&(P.srcToken=p),u.items.push(P)}else{j&&i(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),C.comment&&(E.comment?E.comment+=`
|
|
180
|
-
`+C.comment:E.comment=C.comment);const A=new Dr(E);n.options.keepSourceTokens&&(A.srcToken=p),u.items.push(A)}}return f&&f<d&&i(f,"IMPOSSIBLE","Map comment with trailing content"),u.range=[r.offset,d,f??d],u}function Tue({composeNode:e,composeEmptyNode:t},n,r,i,a){const l=a?.nodeClass??ic,u=new l(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=r.offset,f=null;for(const{start:p,value:m}of r.items){const g=td(p,{indicator:"seq-item-ind",next:m,offset:d,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!g.found)if(g.anchor||g.tag||m)m?.type==="block-seq"?i(g.end,"BAD_INDENT","All sequence items must start at the same column"):i(d,"MISSING_CHAR","Sequence item without - indicator");else{f=g.end,g.comment&&(u.comment=g.comment);continue}const v=m?e(n,m,g,i):t(n,g.end,p,null,g,i);n.schema.compat&&w1(r.indent,m,i),d=v.range[2],u.items.push(v)}return u.range=[r.offset,d,f??d],u}function Jh(e,t,n,r){let i="";if(e){let a=!1,l="";for(const u of e){const{source:d,type:f}=u;switch(f){case"space":a=!0;break;case"comment":{n&&!a&&r(u,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const p=d.substring(1)||" ";i?i+=l+p:i=p,l="";break}case"newline":i&&(l+=d),a=!0;break;default:r(u,"UNEXPECTED_TOKEN",`Unexpected ${f} at node end`)}t+=d.length}}return{comment:i,offset:t}}const Yw="Block collections are not allowed within flow collections",Ww=e=>e&&(e.type==="block-map"||e.type==="block-seq");function Rue({composeNode:e,composeEmptyNode:t},n,r,i,a){const l=r.start.source==="{",u=l?"flow map":"flow sequence",d=a?.nodeClass??(l?$i:ic),f=new d(n.schema);f.flow=!0;const p=n.atRoot;p&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let m=r.offset+r.start.source.length;for(let j=0;j<r.items.length;++j){const k=r.items[j],{start:E,key:C,sep:A,value:P}=k,O=td(E,{flow:u,indicator:"explicit-key-ind",next:C??A?.[0],offset:m,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!O.found){if(!O.anchor&&!O.tag&&!A&&!P){j===0&&O.comma?i(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${u}`):j<r.items.length-1&&i(O.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${u}`),O.comment&&(f.comment?f.comment+=`
|
|
181
|
-
`+O.comment:f.comment=O.comment),m=O.end;continue}!l&&n.options.strict&&Ah(C)&&i(C,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(j===0)O.comma&&i(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${u}`);else if(O.comma||i(O.start,"MISSING_CHAR",`Missing , between ${u} items`),O.comment){let _="";e:for(const T of E)switch(T.type){case"comma":case"space":break;case"comment":_=T.source.substring(1);break e;default:break e}if(_){let T=f.items[f.items.length-1];Rn(T)&&(T=T.value??T.key),T.comment?T.comment+=`
|
|
182
|
-
`+_:T.comment=_,O.comment=O.comment.substring(_.length+1)}}if(!l&&!A&&!O.found){const _=P?e(n,P,O,i):t(n,O.end,A,null,O,i);f.items.push(_),m=_.range[2],Ww(P)&&i(_.range,"BLOCK_IN_FLOW",Yw)}else{n.atKey=!0;const _=O.end,T=C?e(n,C,O,i):t(n,_,E,null,O,i);Ww(C)&&i(T.range,"BLOCK_IN_FLOW",Yw),n.atKey=!1;const $=td(A??[],{flow:u,indicator:"map-value-ind",next:P,offset:T.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if($.found){if(!l&&!O.found&&n.options.strict){if(A)for(const B of A){if(B===$.found)break;if(B.type==="newline"){i(B,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}O.start<$.found.offset-1024&&i($.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else P&&("source"in P&&P.source?.[0]===":"?i(P,"MISSING_CHAR",`Missing space after : in ${u}`):i($.start,"MISSING_CHAR",`Missing , or : between ${u} items`));const F=P?e(n,P,$,i):$.found?t(n,$.end,A,null,$,i):null;F?Ww(P)&&i(F.range,"BLOCK_IN_FLOW",Yw):$.comment&&(T.comment?T.comment+=`
|
|
183
|
-
`+$.comment:T.comment=$.comment);const U=new Dr(T,F);if(n.options.keepSourceTokens&&(U.srcToken=k),l){const B=f;rB(n,B.items,T)&&i(_,"DUPLICATE_KEY","Map keys must be unique"),B.items.push(U)}else{const B=new $i(n.schema);B.flow=!0,B.items.push(U);const V=(F??T).range;B.range=[T.range[0],V[1],V[2]],f.items.push(B)}m=F?F.range[2]:$.end}}const g=l?"}":"]",[v,...S]=r.end;let b=m;if(v?.source===g)b=v.offset+v.source.length;else{const j=u[0].toUpperCase()+u.substring(1),k=p?`${j} must end with a ${g}`:`${j} in block collection must be sufficiently indented and end with a ${g}`;i(m,p?"MISSING_CHAR":"BAD_INDENT",k),v&&v.source.length!==1&&S.unshift(v)}if(S.length>0){const j=Jh(S,b,n.options.strict,i);j.comment&&(f.comment?f.comment+=`
|
|
184
|
-
`+j.comment:f.comment=j.comment),f.range=[r.offset,b,j.offset]}else f.range=[r.offset,b,b];return f}function Zw(e,t,n,r,i,a){const l=n.type==="block-map"?Pue(e,t,n,r,a):n.type==="block-seq"?Tue(e,t,n,r,a):Rue(e,t,n,r,a),u=l.constructor;return i==="!"||i===u.tagName?(l.tag=u.tagName,l):(i&&(l.tag=i),l)}function Due(e,t,n,r,i){const a=r.tag,l=a?t.directives.tagName(a.source,g=>i(a,"TAG_RESOLVE_FAILED",g)):null;if(n.type==="block-seq"){const{anchor:g,newlineAfterProp:v}=r,S=g&&a?g.offset>a.offset?g:a:g??a;S&&(!v||v.offset<S.offset)&&i(S,"MISSING_CHAR","Missing newline after block sequence props")}const u=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!a||!l||l==="!"||l===$i.tagName&&u==="map"||l===ic.tagName&&u==="seq")return Zw(e,t,n,i,l);let d=t.schema.tags.find(g=>g.tag===l&&g.collection===u);if(!d){const g=t.schema.knownTags[l];if(g?.collection===u)t.schema.tags.push(Object.assign({},g,{default:!1})),d=g;else return g?i(a,"BAD_COLLECTION_TYPE",`${g.tag} used for ${u} collection, but expects ${g.collection??"scalar"}`,!0):i(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${l}`,!0),Zw(e,t,n,i,l)}const f=Zw(e,t,n,i,l,d),p=d.resolve?.(f,g=>i(a,"TAG_RESOLVE_FAILED",g),t.options)??f,m=Tn(p)?p:new at(p);return m.range=f.range,m.tag=l,d?.format&&(m.format=d.format),m}function Mue(e,t,n){const r=t.offset,i=Iue(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};const a=i.mode===">"?at.BLOCK_FOLDED:at.BLOCK_LITERAL,l=t.source?Lue(t.source):[];let u=l.length;for(let b=l.length-1;b>=0;--b){const j=l[b][1];if(j===""||j==="\r")u=b;else break}if(u===0){const b=i.chomp==="+"&&l.length>0?`
|
|
185
|
-
`.repeat(Math.max(1,l.length-1)):"";let j=r+i.length;return t.source&&(j+=t.source.length),{value:b,type:a,comment:i.comment,range:[r,j,j]}}let d=t.indent+i.indent,f=t.offset+i.length,p=0;for(let b=0;b<u;++b){const[j,k]=l[b];if(k===""||k==="\r")i.indent===0&&j.length>d&&(d=j.length);else{j.length<d&&n(f+j.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(d=j.length),p=b,d===0&&!e.atRoot&&n(f,"BAD_INDENT","Block scalar values in collections must be indented");break}f+=j.length+k.length+1}for(let b=l.length-1;b>=u;--b)l[b][0].length>d&&(u=b+1);let m="",g="",v=!1;for(let b=0;b<p;++b)m+=l[b][0].slice(d)+`
|
|
186
|
-
`;for(let b=p;b<u;++b){let[j,k]=l[b];f+=j.length+k.length+1;const E=k[k.length-1]==="\r";if(E&&(k=k.slice(0,-1)),k&&j.length<d){const A=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(f-k.length-(E?2:1),"BAD_INDENT",A),j=""}a===at.BLOCK_LITERAL?(m+=g+j.slice(d)+k,g=`
|
|
187
|
-
`):j.length>d||k[0]===" "?(g===" "?g=`
|
|
188
|
-
`:!v&&g===`
|
|
189
|
-
`&&(g=`
|
|
190
|
-
|
|
191
|
-
`),m+=g+j.slice(d)+k,g=`
|
|
192
|
-
`,v=!0):k===""?g===`
|
|
193
|
-
`?m+=`
|
|
194
|
-
`:g=`
|
|
195
|
-
`:(m+=g+k,g=" ",v=!1)}switch(i.chomp){case"-":break;case"+":for(let b=u;b<l.length;++b)m+=`
|
|
196
|
-
`+l[b][0].slice(d);m[m.length-1]!==`
|
|
197
|
-
`&&(m+=`
|
|
198
|
-
`);break;default:m+=`
|
|
199
|
-
`}const S=r+i.length+t.source.length;return{value:m,type:a,comment:i.comment,range:[r,S,S]}}function Iue({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],a=i[0];let l=0,u="",d=-1;for(let g=1;g<i.length;++g){const v=i[g];if(!u&&(v==="-"||v==="+"))u=v;else{const S=Number(v);!l&&S?l=S:d===-1&&(d=e+g)}}d!==-1&&r(d,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let f=!1,p="",m=i.length;for(let g=1;g<t.length;++g){const v=t[g];switch(v.type){case"space":f=!0;case"newline":m+=v.source.length;break;case"comment":n&&!f&&r(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),m+=v.source.length,p=v.source.substring(1);break;case"error":r(v,"UNEXPECTED_TOKEN",v.message),m+=v.source.length;break;default:{const S=`Unexpected token in block scalar header: ${v.type}`;r(v,"UNEXPECTED_TOKEN",S);const b=v.source;b&&typeof b=="string"&&(m+=b.length)}}}return{mode:a,indent:l,chomp:u,comment:p,length:m}}function Lue(e){const t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),a=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let l=1;l<t.length;l+=2)a.push([t[l],t[l+1]]);return a}function $ue(e,t,n){const{offset:r,type:i,source:a,end:l}=e;let u,d;const f=(g,v,S)=>n(r+g,v,S);switch(i){case"scalar":u=at.PLAIN,d=Bue(a,f);break;case"single-quoted-scalar":u=at.QUOTE_SINGLE,d=Uue(a,f);break;case"double-quoted-scalar":u=at.QUOTE_DOUBLE,d=que(a,f);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+a.length,r+a.length]}}const p=r+a.length,m=Jh(l,p,t,n);return{value:d,type:u,comment:m.comment,range:[r,p,m.offset]}}function Bue(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}`),iB(e)}function Uue(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),iB(e.slice(1,-1)).replace(/''/g,"'")}function iB(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
200
|
-
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
201
|
-
`,"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],a=" ",l=t.lastIndex;for(n.lastIndex=l;r=n.exec(e);)r[1]===""?a===`
|
|
202
|
-
`?i+=a:a=`
|
|
203
|
-
`:(i+=a+r[1],a=" "),l=n.lastIndex;const u=/[ \t]*(.*)/sy;return u.lastIndex=l,r=u.exec(e),i+a+(r?.[1]??"")}function que(e,t){let n="";for(let r=1;r<e.length-1;++r){const i=e[r];if(!(i==="\r"&&e[r+1]===`
|
|
204
|
-
`))if(i===`
|
|
205
|
-
`){const{fold:a,offset:l}=Fue(e,r);n+=a,r=l}else if(i==="\\"){let a=e[++r];const l=Hue[a];if(l)n+=l;else if(a===`
|
|
206
|
-
`)for(a=e[r+1];a===" "||a===" ";)a=e[++r+1];else if(a==="\r"&&e[r+1]===`
|
|
207
|
-
`)for(a=e[++r+1];a===" "||a===" ";)a=e[++r+1];else if(a==="x"||a==="u"||a==="U"){const u={x:2,u:4,U:8}[a];n+=Kue(e,r+1,u,t),r+=u}else{const u=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${u}`),n+=u}}else if(i===" "||i===" "){const a=r;let l=e[r+1];for(;l===" "||l===" ";)l=e[++r+1];l!==`
|
|
208
|
-
`&&!(l==="\r"&&e[r+2]===`
|
|
209
|
-
`)&&(n+=r>a?e.slice(a,r+1):i)}else n+=i}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function Fue(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===`
|
|
210
|
-
`||r==="\r")&&!(r==="\r"&&e[t+2]!==`
|
|
211
|
-
`);)r===`
|
|
212
|
-
`&&(n+=`
|
|
213
|
-
`),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const Hue={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
214
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Kue(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 u=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${u}`),u}return String.fromCodePoint(l)}function aB(e,t,n,r){const{value:i,type:a,comment:l,range:u}=t.type==="block-scalar"?Mue(e,t,r):$ue(t,e.options.strict,r),d=n?e.directives.tagName(n.source,m=>r(n,"TAG_RESOLVE_FAILED",m)):null;let f;e.options.stringKeys&&e.atKey?f=e.schema[qa]:d?f=Gue(e.schema,i,d,n,r):t.type==="scalar"?f=Vue(e,i,t,r):f=e.schema[qa];let p;try{const m=f.resolve(i,g=>r(n??t,"TAG_RESOLVE_FAILED",g),e.options);p=en(m)?m:new at(m)}catch(m){const g=m instanceof Error?m.message:String(m);r(n??t,"TAG_RESOLVE_FAILED",g),p=new at(i)}return p.range=u,p.source=i,a&&(p.type=a),d&&(p.tag=d),f.format&&(p.format=f.format),l&&(p.comment=l),p}function Gue(e,t,n,r,i){if(n==="!")return e[qa];const a=[];for(const u of e.tags)if(!u.collection&&u.tag===n)if(u.default&&u.test)a.push(u);else return u;for(const u of a)if(u.test?.test(t))return u;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[qa])}function Vue({atKey:e,directives:t,schema:n},r,i,a){const l=n.tags.find(u=>(u.default===!0||e&&u.default==="key")&&u.test?.test(r))||n[qa];if(n.compat){const u=n.compat.find(d=>d.default&&d.test?.test(r))??n[qa];if(l.tag!==u.tag){const d=t.tagString(l.tag),f=t.tagString(u.tag),p=`Value may be parsed as either ${d} or ${f}`;a(i,"TAG_RESOLVE_FAILED",p,!0)}}return l}function Que(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 Yue={composeNode:sB,composeEmptyNode:Gk};function sB(e,t,n,r){const i=e.atKey,{spaceBefore:a,comment:l,anchor:u,tag:d}=n;let f,p=!0;switch(t.type){case"alias":f=Wue(e,t,r),(u||d)&&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":f=aB(e,t,d,r),u&&(f.anchor=u.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":f=Due(Yue,e,t,n,r),u&&(f.anchor=u.source.substring(1));break;default:{const m=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",m),f=Gk(e,t.offset,void 0,null,n,r),p=!1}}return u&&f.anchor===""&&r(u,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!en(f)||typeof f.value!="string"||f.tag&&f.tag!=="tag:yaml.org,2002:str")&&r(d??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),a&&(f.spaceBefore=!0),l&&(t.type==="scalar"&&t.source===""?f.comment=l:f.commentBefore=l),e.options.keepSourceTokens&&p&&(f.srcToken=t),f}function Gk(e,t,n,r,{spaceBefore:i,comment:a,anchor:l,tag:u,end:d},f){const p={type:"scalar",offset:Que(t,n,r),indent:-1,source:""},m=aB(e,p,u,f);return l&&(m.anchor=l.source.substring(1),m.anchor===""&&f(l,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(m.spaceBefore=!0),a&&(m.comment=a,m.range[2]=d),m}function Wue({options:e},{offset:t,source:n,end:r},i){const a=new Rk(n.substring(1));a.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const l=t+n.length,u=Jh(r,l,e.strict,i);return a.range=[t,l,u.offset],u.comment&&(a.comment=u.comment),a}function Zue(e,t,{offset:n,start:r,value:i,end:a},l){const u=Object.assign({_directives:t},e),d=new tx(void 0,u),f={atKey:!1,atRoot:!0,directives:d.directives,options:d.options,schema:d.schema},p=td(r,{indicator:"doc-start",next:i??a?.[0],offset:n,onError:l,parentIndent:0,startOnNewline:!0});p.found&&(d.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!p.hasNewline&&l(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),d.contents=i?sB(f,i,p,l):Gk(f,p.end,r,null,p,l);const m=d.contents.range[2],g=Jh(a,m,!1,l);return g.comment&&(d.comment=g.comment),d.range=[n,m,g.offset],d}function Uf(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 CT(e){let t="",n=!1,r=!1;for(let i=0;i<e.length;++i){const a=e[i];switch(a[0]){case"#":t+=(t===""?"":r?`
|
|
215
|
-
|
|
216
|
-
`:`
|
|
217
|
-
`)+(a.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 Xue{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,a)=>{const l=Uf(n);a?this.warnings.push(new zue(l,r,i)):this.errors.push(new sg(l,r,i))},this.directives=new zr({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:i}=CT(this.prelude);if(r){const a=t.contents;if(n)t.comment=t.comment?`${t.comment}
|
|
218
|
-
${r}`:r;else if(i||t.directives.docStart||!a)t.commentBefore=r;else if(Pn(a)&&!a.flow&&a.items.length>0){let l=a.items[0];Rn(l)&&(l=l.key);const u=l.commentBefore;l.commentBefore=u?`${r}
|
|
219
|
-
${u}`:r}else{const l=a.commentBefore;a.commentBefore=l?`${r}
|
|
220
|
-
${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:CT(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 a=Uf(t);a[0]+=n,this.onError(a,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=Zue(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 sg(Uf(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 sg(Uf(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Jh(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}
|
|
221
|
-
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new sg(Uf(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 tx(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 oB="\uFEFF",lB="",cB="",S1="";function Jue(e){switch(e){case oB:return"byte-order-mark";case lB:return"doc-mode";case cB:return"flow-error-end";case S1:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
222
|
-
`:case`\r
|
|
223
|
-
`: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 ra(e){switch(e){case void 0:case" ":case`
|
|
224
|
-
`:case"\r":case" ":return!0;default:return!1}}const AT=new Set("0123456789ABCDEFabcdef"),ede=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),og=new Set(",[]{}"),tde=new Set(` ,[]{}
|
|
225
|
-
\r `),Xw=e=>!e||tde.has(e);class nde{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===`
|
|
226
|
-
`?!0:n==="\r"?this.buffer[t+1]===`
|
|
227
|
-
`:!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===`
|
|
228
|
-
`||!i&&!this.atEnd)return t+r+1}return n===`
|
|
229
|
-
`||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&ra(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(`
|
|
230
|
-
`,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]===oB&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,r=t.indexOf("#");for(;r!==-1;){const a=t[r-1];if(a===" "||a===" "){n=r-1;break}else r=t.indexOf("#",r+1)}for(;;){const a=t[n-1];if(a===" "||a===" ")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 lB,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==="...")&&ra(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&&!ra(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===":")&&ra(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(Xw),"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("..."))&&ra(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield cB,yield*this.parseLineStart();let a=0;for(;i[a]===",";)a+=yield*this.pushCount(1),a+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(a+=yield*this.pushIndicators(),i[a]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-a),"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(Xw),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const l=this.charAt(1);if(this.flowKey||ra(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 a=0;for(;this.buffer[n-1-a]==="\\";)a+=1;if(a%2===0)break;n=this.buffer.indexOf('"',n+1)}const r=this.buffer.substring(0,n);let i=r.indexOf(`
|
|
231
|
-
`,this.pos);if(i!==-1){for(;i!==-1;){const a=this.continueScalar(i+1);if(a===-1)break;i=r.indexOf(`
|
|
232
|
-
`,a)}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=>ra(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let a=this.pos;r=this.buffer[a];++a)switch(r){case" ":n+=1;break;case`
|
|
233
|
-
`:t=a,n=0;break;case"\r":{const l=this.buffer[a+1];if(!l&&!this.atEnd)return this.setNext("block-scalar");if(l===`
|
|
234
|
-
`)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 a=this.continueScalar(t+1);if(a===-1)break;t=this.buffer.indexOf(`
|
|
235
|
-
`,a)}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===`
|
|
236
|
-
`;)r=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep)do{let a=t-1,l=this.buffer[a];l==="\r"&&(l=this.buffer[--a]);const u=a;for(;l===" ";)l=this.buffer[--a];if(l===`
|
|
237
|
-
`&&a>=this.pos&&a+1+n>u)t=a;else break}while(!0);return yield S1,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 a=this.buffer[r+1];if(ra(a)||t&&og.has(a))break;n=r}else if(ra(i)){let a=this.buffer[r+1];if(i==="\r"&&(a===`
|
|
238
|
-
`?(r+=1,i=`
|
|
239
|
-
`,a=this.buffer[r+1]):n=r),a==="#"||t&&og.has(a))break;if(i===`
|
|
240
|
-
`){const l=this.continueScalar(r+1);if(l===-1)break;r=Math.max(r,l-2)}}else{if(t&&og.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield S1,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(Xw))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(ra(n)||t&&og.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(;!ra(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(ede.has(n))n=this.buffer[++t];else if(n==="%"&&AT.has(this.buffer[t+1])&&AT.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===`
|
|
241
|
-
`?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
|
|
242
|
-
`?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 rde{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n<r;){const a=n+r>>1;this.lineStarts[a]<t?n=a+1:r=a}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 Co(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function OT(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 uB(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 lg(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 mu(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 ET(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!Co(t.start,"explicit-key-ind")&&!Co(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,uB(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 ide{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 nde,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=Jue(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"&&ET(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&&OT(i.start)===-1&&(n.indent===0||i.start.every(a=>a.type!=="comment"||a.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":{OT(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=lg(this.peek(2)),r=mu(n);let i;t.end?(i=t.end,i.push(this.sourceToken),delete t.end):i=[this.sourceToken];const a={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]=a}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(`
|
|
243
|
-
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
244
|
-
`,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 a=[];if(i&&n.sep&&!n.value){const l=[];for(let u=0;u<n.sep.length;++u){const d=n.sep[u];switch(d.type){case"newline":l.push(u);break;case"space":break;case"comment":d.indent>t.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(a=n.sep.splice(l[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(a.push(this.sourceToken),t.items.push({start:a}),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?(a.push(this.sourceToken),t.items.push({start:a,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(Co(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(uB(n.key)&&!Co(n.sep,"newline")){const l=mu(n.start),u=n.key,d=n.sep;d.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:u,sep:d}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(Co(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=mu(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:a,key:null,sep:[this.sourceToken]}):Co(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:a,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&&!Co(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:a});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||Co(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=lg(r),a=mu(i);ET(t);const l=t.end.splice(1,t.end.length);l.push(this.sourceToken);const u={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:a,key:t,sep:l}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=u}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
|
|
245
|
-
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
246
|
-
`,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=lg(t),r=mu(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=lg(t),r=mu(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 ade(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new rde||null,prettyErrors:t}}function sde(e,t={}){const{lineCounter:n,prettyErrors:r}=ade(t),i=new ide(n?.addNewLine),a=new Xue(t),l=Array.from(a.compose(i.parse(e)));if(r&&n)for(const u of l)u.errors.forEach(NT(e,n)),u.warnings.forEach(NT(e,n));return l.length>0?l:Object.assign([],{empty:!0},a.streamInfo())}function ode({onApplied:e}){const[t,n]=x.useState(""),[r,i]=x.useState(!1),[a,l]=x.useState([]),[u,d]=x.useState([]),f=async()=>{if(!t.trim())return;i(!0),l([]),d([]);const p=sde(t),m=[],g=[];for(let v=0;v<p.length;v++){const S=p[v];if(S.errors.length>0){m.push(`Document ${v+1}: ${S.errors[0]?.message}`);continue}const b=S.toJSON();if(!(!b||typeof b!="object"))try{const j=await dV(b);g.push(`Applied "${j.displayName||j.name}" (revision ${j.configRevision})`)}catch(j){m.push(`Document ${v+1}: ${j instanceof Error?j.message:String(j)}`)}}l(g),d(m),i(!1),g.length>0&&(vt({title:"YAML applied",detail:`Applied ${g.length} document${g.length===1?"":"s"} successfully.`,tone:m.length>0?"caution":"positive",dedupeKey:"yaml:apply",dedupeMode:"replace"}),e())};return o.jsxs("section",{className:"mt-8",children:[o.jsx("div",{className:"page-section-divider"}),o.jsx("div",{className:"section-head mt-6",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Config as code"}),o.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Apply YAML"})]})}),o.jsxs("p",{className:"text-zinc-500 text-sm mb-3",children:["Paste a ",o.jsx("code",{className:"text-zinc-400",children:"canonry.yaml"})," config (multi-document YAML with ",o.jsx("code",{className:"text-zinc-400",children:"---"})," separators supported)."]}),o.jsx("textarea",{className:"setup-input w-full font-mono text-xs",rows:10,placeholder:`apiVersion: canonry/v1
|
|
247
|
-
kind: Project
|
|
248
|
-
metadata:
|
|
249
|
-
name: my-project
|
|
250
|
-
spec:
|
|
251
|
-
canonicalDomain: example.com
|
|
252
|
-
country: US
|
|
253
|
-
language: en
|
|
254
|
-
queries: []`,value:t,onChange:p=>n(p.target.value)}),a.length>0&&o.jsx("ul",{className:"mt-2 space-y-1",children:a.map((p,m)=>o.jsx("li",{className:"text-emerald-400 text-sm",children:p},m))}),u.length>0&&o.jsx("ul",{className:"mt-2 space-y-1",children:u.map((p,m)=>o.jsx("li",{className:"text-rose-400 text-sm",children:p},m))}),o.jsx("div",{className:"mt-3",children:o.jsx(be,{type:"button",disabled:!t.trim()||r,onClick:f,children:r?"Applying...":"Apply"})})]})}function lde(){const{dashboard:e,isLoading:t,refetch:n}=wc();if(!e||t)return o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-28"}),o.jsx("div",{className:"skeleton-text-sm w-40"})]}),o.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:[o.jsx("div",{className:"p-3 border-b border-zinc-800/60 flex gap-8",children:["Name","Domain","Visibility","Last run","Country"].map(_=>o.jsx("div",{className:"skeleton-text-sm w-16"},_))}),[1,2,3].map(_=>o.jsxs("div",{className:"p-3 border-b border-zinc-800/40 flex gap-8 items-center",children:[o.jsxs("div",{className:"flex-1 space-y-1",children:[o.jsx("div",{className:"skeleton-text w-28"}),o.jsx("div",{className:"skeleton-text-sm w-16"})]}),o.jsx("div",{className:"skeleton-text w-24"}),o.jsx("div",{className:"skeleton h-5 w-14 rounded-full"}),o.jsx("div",{className:"skeleton h-5 w-16 rounded-full"}),o.jsx("div",{className:"skeleton-text-sm w-8"})]},_))]})]});const r=e.projects,i=Qo(),[a,l]=x.useState(!1),[u,d]=x.useState(""),[f,p]=x.useState(""),[m,g]=x.useState(""),[v,S]=x.useState("US"),[b,j]=x.useState("en"),[k,E]=x.useState(!1),[C,A]=x.useState(null),P=u.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),O=async()=>{if(!(!P||!m)){E(!0),A(null);try{const _=await Cv(P,{displayName:f||u,canonicalDomain:m,country:v,language:b});vt({title:"Project created",detail:`${_.displayName||_.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${_.name}`,dedupeMode:"drop"}),n(),d(""),p(""),g(""),S("US"),j("en"),l(!1),i({to:"/projects/$projectId",params:{projectId:_.id}})}catch(_){A(_ instanceof Error?_.message:"Failed to create project")}finally{E(!1)}}};return o.jsxs("div",{className:"page-container",children:[o.jsxs("div",{className:"page-header",children:[o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:"Projects"}),o.jsxs("p",{className:"page-subtitle",children:[r.length," project",r.length!==1?"s":""," tracked"]})]}),o.jsx("div",{className:"page-header-right",children:o.jsxs(be,{type:"button",onClick:()=>l(_=>!_),children:[o.jsx(k2,{className:"size-4 mr-1.5"}),"Add project"]})})]}),a?o.jsxs($e,{className:"surface-card mb-6",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"New project"}),o.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Create a new monitoring project"})]})}),o.jsxs("div",{className:"compact-stack mt-4",children:[o.jsxs("div",{className:"setup-field-row",children:[o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"new-project-name",children:"Project name"}),o.jsx("input",{id:"new-project-name",className:"setup-input",type:"text",placeholder:"my-project",value:u,onChange:_=>d(_.target.value)}),P&&P!==u?o.jsxs("p",{className:"supporting-copy",children:["Slug: ",P]}):null]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),o.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:f,onChange:_=>p(_.target.value)})]})]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),o.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:m,onChange:_=>g(_.target.value)})]}),o.jsxs("div",{className:"setup-field-row",children:[o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"new-country",children:"Country"}),o.jsx("input",{id:"new-country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:v,onChange:_=>S(_.target.value.toUpperCase())})]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"new-language",children:"Language"}),o.jsx("input",{id:"new-language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:b,onChange:_=>j(_.target.value.toLowerCase())})]})]})]}),C?o.jsx("p",{className:"text-rose-400 text-sm mt-3",children:C}):null,o.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[o.jsx(be,{type:"button",disabled:!P||!m||k,onClick:O,children:k?"Creating...":"Create project"}),o.jsx(be,{type:"button",variant:"ghost",onClick:()=>l(!1),children:"Cancel"})]})]}):null,r.length>0?o.jsx("div",{className:"data-table-wrapper",children:o.jsxs("table",{className:"data-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Name"}),o.jsx("th",{children:"Domain"}),o.jsx("th",{children:"Visibility"}),o.jsx("th",{children:"Last run"}),o.jsx("th",{className:"text-right",children:"Country"})]})}),o.jsx("tbody",{children:r.map(_=>{const T=_.recentRuns[0];return o.jsxs("tr",{className:"cursor-pointer",onClick:()=>i({to:"/projects/$projectId",params:{projectId:_.project.id}}),children:[o.jsxs("td",{children:[o.jsx(Zt,{to:"/projects/$projectId",params:{projectId:_.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:$=>$.stopPropagation(),children:_.project.displayName||_.project.name}),o.jsx("p",{className:"text-[11px] text-zinc-500",children:_.project.name})]}),o.jsx("td",{className:"text-zinc-400",children:_.project.canonicalDomain}),o.jsx("td",{children:o.jsx(Xe,{tone:_.visibilitySummary.tone,children:_.visibilitySummary.value})}),o.jsx("td",{className:"text-zinc-500 text-sm",children:T?o.jsx(Dv,{status:T.status}):o.jsx("span",{className:"text-zinc-600",children:"No runs"})}),o.jsx("td",{className:"text-right text-zinc-500",children:_.project.country})]},_.project.id)})})]})}):a?null:o.jsxs($e,{className:"surface-card empty-card",children:[o.jsx("h3",{children:"No projects yet"}),o.jsx("p",{className:"supporting-copy",children:"Create your first monitoring project to start tracking AI visibility."}),o.jsxs(be,{type:"button",onClick:()=>l(!0),children:[o.jsx(k2,{className:"size-4 mr-1.5"}),"Add project"]})]}),o.jsx(ode,{onApplied:()=>{n()}})]})}function j1({state:e,label:t}){return o.jsx(Xe,{tone:gte(e),children:t??Pv(e)})}function dB({run:e}){const{openRun:t}=xd();return o.jsxs("article",{className:"run-row",children:[o.jsxs("div",{className:"run-row-main",children:[o.jsxs("div",{className:"run-row-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"run-row-title",children:e.summary}),o.jsxs("p",{className:"run-row-subtitle",children:[e.projectName,e.location?` · ${e.location}`:""," · ",e.kindLabel]})]}),o.jsx(Dv,{status:e.status})]}),o.jsx("p",{className:"run-row-detail",children:e.statusDetail})]}),o.jsxs("dl",{className:"run-row-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Started"}),o.jsx("dd",{children:e.startedAt})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Duration"}),o.jsx("dd",{children:e.duration})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Trigger"}),o.jsx("dd",{children:e.triggerLabel})]})]}),o.jsx(be,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function cde({value:e,label:t,delta:n,tone:r,description:i,tooltip:a,isNumeric:l=!0,progress:u,providerCoverage:d}){const m=2*Math.PI*48,g=Number.parseInt(e,10),v=typeof u=="number"&&Number.isFinite(u)?Math.min(Math.max(u,0),100)/100:l&&!Number.isNaN(g)?Math.min(g/100,1):.5,S=m*(1-v);return o.jsxs("div",{className:"score-gauge",children:[o.jsxs("div",{className:"gauge-ring-wrapper",children:[o.jsxs("svg",{className:"gauge-ring",viewBox:"0 0 120 120","aria-hidden":"true",children:[o.jsx("circle",{className:"gauge-bg",cx:"60",cy:"60",r:48,strokeWidth:6}),o.jsx("circle",{className:`gauge-fill gauge-fill-${r}`,cx:"60",cy:"60",r:48,strokeWidth:6,strokeDasharray:m,strokeDashoffset:S,transform:"rotate(-90 60 60)"})]}),o.jsx("div",{className:"gauge-center",children:o.jsx("span",{className:l?"gauge-value":"gauge-value-text",children:e.split(" / ")[0]})})]}),o.jsxs("p",{className:"gauge-label",children:[t,a&&o.jsx(hr,{text:a})]}),o.jsx("p",{className:"gauge-delta",children:n}),d&&o.jsx("p",{className:"gauge-provider-coverage",children:d}),o.jsx("p",{className:"gauge-description",children:i})]})}function _T({history:e,maxDots:t=12}){const n=e.slice(-t);if(n.length===0)return o.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"}),a=new Date(n[n.length-1].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"});return o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:i}),o.jsx("div",{className:"flex items-center gap-[3px]",title:`${n.length} runs`,children:n.map((l,u)=>o.jsx("div",{className:`h-2.5 w-2.5 rounded-sm ${r[l.citationState]??"bg-zinc-700"} ${l.model&&u>0&&n[u-1]?.model&&n[u-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&&u>0&&n[u-1]?.model&&n[u-1].model!==l.model?"model changed":null].filter(Boolean).join(" — ")},u))}),o.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:a})]})}function ude(e){const t=new Map;for(const r of e)for(const i of r.runHistory){const a=t.get(i.createdAt);a?a.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:a}])=>({runId:a,createdAt:r,citationState:i.includes("cited")?"cited":i.includes("emerging")?"emerging":"not-cited"}))}function zT(e,t){return t==="citations"?e.citationState:e.visibilityState==="pending"||e.answerMentioned==null&&e.visibilityState==null?"pending":e.visibilityState==="visible"||e.answerMentioned===!0?"cited":"not-cited"}function PT(e,t){if(t==="mentions")switch(e){case"cited":return"Mentioned";case"not-cited":return"Not Mentioned";case"pending":return"Pending";case"emerging":return"Newly Mentioned";case"lost":return"No Longer Mentioned"}switch(e){case"cited":return"Cited";case"not-cited":return"Not Cited";case"lost":return"Lost";case"emerging":return"Emerging";case"pending":return"Pending"}}function TT(e,t){const n=t==="mentions"?"mentioned":"cited",r=t==="mentions"?"Mentioned":"Cited";if(e.length===0)return"Awaiting first run";if(e.length===1)return"First observation";const i=e[e.length-1].citationState,a=e[e.length-2].citationState;if(a!=="cited"&&i==="cited")return`Newly ${n}`;if(a==="cited"&&i!=="cited")return"Lost since last run";let l=0;for(let u=e.length-1;u>=0&&e[u].citationState===i;u--)l++;return i==="cited"?l<=1?`${r} in latest run`:`${r} for ${l} runs`:l<=1?`Not ${n} in latest run`:`Not ${n} across ${l} runs`}function dde(e,t){return t==="citations"?e:e.map(n=>({...n,citationState:zT(n,t),runHistory:n.runHistory.map(r=>({...r,citationState:zT(r,t)}))}))}function fde({evidence:e}){const{openEvidence:t}=xd(),[n,r]=x.useState(new Set),[i,a]=x.useState("citations"),l=x.useMemo(()=>{const m=dde(e,i),g=new Map;for(const v of m){const S=g.get(v.query)??[];g.set(v.query,[...S,v])}return[...g.entries()].map(([v,S])=>({phrase:v,items:S}))},[e,i]),u=m=>{r(g=>{const v=new Set(g);return v.has(m)?v.delete(m):v.add(m),v})},d=i==="mentions"?"mentioned":"cited",f=i==="mentions"?"Mention History":"Citation History",p=i==="mentions"?"mentioned":"cited";return o.jsxs("div",{children:[o.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[o.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"View by"}),o.jsxs("div",{className:"inline-flex gap-0.5 p-0.5 rounded-md bg-zinc-900/60 border border-zinc-800/40",role:"tablist","aria-label":"Citation tracking view",children:[o.jsx("button",{type:"button",role:"tab","aria-selected":i==="citations",className:`px-2.5 py-1 text-xs font-medium rounded transition-colors ${i==="citations"?"bg-zinc-800 text-zinc-100":"text-zinc-400 hover:text-zinc-200"}`,onClick:()=>a("citations"),children:"Citations"}),o.jsx("button",{type:"button",role:"tab","aria-selected":i==="mentions",className:`px-2.5 py-1 text-xs font-medium rounded transition-colors ${i==="mentions"?"bg-zinc-800 text-zinc-100":"text-zinc-400 hover:text-zinc-200"}`,onClick:()=>a("mentions"),children:"Mentions"})]}),o.jsx("span",{className:"text-[11px] text-zinc-500",children:i==="mentions"?"Brand or domain in answer text":"Brand or domain in source links"})]}),o.jsx("div",{className:"evidence-table-wrap",children:o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{style:{width:"2rem"}}),o.jsx("th",{children:"Query"}),o.jsx("th",{children:"Status"}),o.jsx("th",{children:f}),o.jsx("th",{children:"Change"}),o.jsx("th",{})]})}),o.jsx("tbody",{children:l.map(({phrase:m,items:g})=>{const v=n.has(m),S=g.map(C=>C.citationState),b=S.includes("cited")?"cited":S.includes("emerging")?"emerging":S.includes("lost")?"lost":S.every(C=>C==="pending")?"pending":"not-cited",j=ude(g),k=g.filter(C=>C.citationState===Ju.cited||C.citationState==="emerging").length,E=TT(j,i);return o.jsxs(x.Fragment,{children:[o.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>u(m),"aria-expanded":v,children:[o.jsx("td",{children:o.jsx(Kh,{size:14,className:`transition-transform duration-150 text-zinc-500 ${v?"rotate-90":""}`})}),o.jsx("td",{className:"evidence-query-cell",children:o.jsxs("div",{children:[o.jsx("span",{className:"font-medium text-zinc-100",children:m}),o.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:g.map(C=>o.jsx(nc,{provider:C.provider},C.id))})]})}),o.jsx("td",{children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(j1,{state:b,label:PT(b,i)}),o.jsxs("span",{className:"text-[11px] text-zinc-500",title:`${k} of ${g.length} engines ${p}`,children:[k,"/",g.length]})]})}),o.jsx("td",{children:o.jsx(_T,{history:j})}),o.jsx("td",{className:"evidence-change-cell",children:E}),o.jsx("td",{})]}),v&&g.map(C=>o.jsxs("tr",{className:"bg-zinc-900/30",children:[o.jsx("td",{}),o.jsx("td",{className:"evidence-query-cell pl-5",children:o.jsx(nc,{provider:C.provider})}),o.jsx("td",{children:o.jsx(j1,{state:C.citationState,label:PT(C.citationState,i)})}),o.jsx("td",{children:o.jsx(_T,{history:C.runHistory})}),o.jsx("td",{className:"evidence-change-cell",children:TT(C.runHistory,i)}),o.jsx("td",{children:o.jsx(be,{variant:"ghost",size:"sm",type:"button",onClick:A=>{A.stopPropagation(),t(C.id)},children:"View"})})]},C.id))]},m)})})]})}),o.jsxs("p",{className:"sr-only","aria-live":"polite",children:["Showing ",d==="cited"?"citations (sources)":"mentions (answer text)","."]})]})}function hde({competitors:e}){return e.length===0?o.jsx("p",{className:"text-sm text-zinc-500",children:"No competitors configured. Add competitors to track overlap."}):o.jsx("div",{className:"competitor-table-wrap",children:o.jsxs("table",{className:"competitor-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Domain"}),o.jsx("th",{children:"Pressure"}),o.jsx("th",{children:"Citations"}),o.jsx("th",{children:"Queries"})]})}),o.jsx("tbody",{children:e.map(t=>o.jsxs("tr",{children:[o.jsx("td",{className:"font-medium text-zinc-100",children:t.domain}),o.jsx("td",{children:o.jsx(Xe,{tone:yte(t.pressureLabel),children:t.pressureLabel})}),o.jsx("td",{className:"text-zinc-300 tabular-nums",children:t.totalQueries>0?`${t.citationCount} / ${t.totalQueries}`:"—"}),o.jsx("td",{className:"text-zinc-500 text-xs",children:t.citedQueries.length>0?t.citedQueries.join(", "):"Not cited"})]},t.id))})]})})}function RT({eyebrow:e,title:t,status:n,tone:r,targetLabel:i,targetValue:a,coverageValue:l,note:u,updatedAt:d,active:f,onClick:p}){return o.jsxs("button",{type:"button",onClick:p,className:`surface-card w-full text-left transition-colors ${f?"border-zinc-200 bg-zinc-900/50":"hover:border-zinc-700 hover:bg-zinc-900/40"}`,children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:e}),o.jsx("h3",{children:t})]}),o.jsx(Xe,{tone:r,children:n})]}),o.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:i}),o.jsx("p",{className:"mt-1 truncate text-sm text-zinc-200",children:a})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Coverage"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:l})]})]}),o.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:[o.jsx("span",{children:u}),o.jsx("span",{children:d?`Updated ${aa(d)}`:"No recent sync yet"})]})]})}function cg({label:e,value:t,tone:n}){const r=n==="positive"?"text-emerald-400":n==="negative"?"text-rose-400":"text-zinc-200";return o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:e}),o.jsx("p",{className:`mt-2 text-2xl font-semibold ${r}`,children:t})]})}var pde=["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 Vk(e){if(typeof e!="string")return!1;var t=pde;return t.includes(e)}var mde=["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"],gde=new Set(mde);function fB(e){return typeof e!="string"?!1:gde.has(e)}function hB(e){return typeof e=="string"&&e.startsWith("data-")}function mi(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(fB(n)||hB(n))&&(t[n]=e[n]);return t}function ep(e){if(e==null)return null;if(x.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return mi(t)}return typeof e=="object"&&!Array.isArray(e)?mi(e):null}function kr(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(fB(n)||hB(n)||Vk(n))&&(t[n]=e[n]);return t}function yde(e){return e==null?null:x.isValidElement(e)?kr(e.props):typeof e=="object"&&!Array.isArray(e)?kr(e):null}var vde=["children","width","height","viewBox","className","style","title","desc"];function N1(){return N1=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},N1.apply(null,arguments)}function xde(e,t){if(e==null)return{};var n,r,i=bde(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function bde(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 Qk=x.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:l,style:u,title:d,desc:f}=e,p=xde(e,vde),m=a||{width:r,height:i,x:0,y:0},g=At("recharts-surface",l);return x.createElement("svg",N1({},kr(p),{className:g,width:r,height:i,style:u,viewBox:"".concat(m.x," ").concat(m.y," ").concat(m.width," ").concat(m.height),ref:t}),x.createElement("title",null,d),x.createElement("desc",null,f),n)}),wde=["children","className"];function k1(){return k1=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},k1.apply(null,arguments)}function Sde(e,t){if(e==null)return{};var n,r,i=jde(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function jde(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 gr=x.forwardRef((e,t)=>{var{children:n,className:r}=e,i=Sde(e,wde),a=At("recharts-layer",r);return x.createElement("g",k1({className:a},kr(i),{ref:t}),n)}),pB=x.createContext(null),Nde=()=>x.useContext(pB);function Xt(e){return function(){return e}}const mB=Math.cos,xy=Math.sin,ya=Math.sqrt,by=Math.PI,nx=2*by,C1=Math.PI,A1=2*C1,zl=1e-6,kde=A1-zl;function gB(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Cde(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return gB;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class Ade{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?gB:Cde(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,a,l){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+l}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let l=this._x1,u=this._y1,d=r-t,f=i-n,p=l-t,m=u-n,g=p*p+m*m;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(g>zl)if(!(Math.abs(m*d-f*p)>zl)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let v=r-l,S=i-u,b=d*d+f*f,j=v*v+S*S,k=Math.sqrt(b),E=Math.sqrt(g),C=a*Math.tan((C1-Math.acos((b+g-j)/(2*k*E)))/2),A=C/E,P=C/k;Math.abs(A-1)>zl&&this._append`L${t+A*p},${n+A*m}`,this._append`A${a},${a},0,0,${+(m*v>p*S)},${this._x1=t+P*d},${this._y1=n+P*f}`}}arc(t,n,r,i,a,l){if(t=+t,n=+n,r=+r,l=!!l,r<0)throw new Error(`negative radius: ${r}`);let u=r*Math.cos(i),d=r*Math.sin(i),f=t+u,p=n+d,m=1^l,g=l?i-a:a-i;this._x1===null?this._append`M${f},${p}`:(Math.abs(this._x1-f)>zl||Math.abs(this._y1-p)>zl)&&this._append`L${f},${p}`,r&&(g<0&&(g=g%A1+A1),g>kde?this._append`A${r},${r},0,1,${m},${t-u},${n-d}A${r},${r},0,1,${m},${this._x1=f},${this._y1=p}`:g>zl&&this._append`A${r},${r},0,${+(g>=C1)},${m},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}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 Yk(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 Ade(t)}function Wk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function yB(e){this._context=e}yB.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 rx(e){return new yB(e)}function vB(e){return e[0]}function xB(e){return e[1]}function bB(e,t){var n=Xt(!0),r=null,i=rx,a=null,l=Yk(u);e=typeof e=="function"?e:e===void 0?vB:Xt(e),t=typeof t=="function"?t:t===void 0?xB:Xt(t);function u(d){var f,p=(d=Wk(d)).length,m,g=!1,v;for(r==null&&(a=i(v=l())),f=0;f<=p;++f)!(f<p&&n(m=d[f],f,d))===g&&((g=!g)?a.lineStart():a.lineEnd()),g&&a.point(+e(m,f,d),+t(m,f,d));if(v)return a=null,v+""||null}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:Xt(+d),u):e},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:Xt(+d),u):t},u.defined=function(d){return arguments.length?(n=typeof d=="function"?d:Xt(!!d),u):n},u.curve=function(d){return arguments.length?(i=d,r!=null&&(a=i(r)),u):i},u.context=function(d){return arguments.length?(d==null?r=a=null:a=i(r=d),u):r},u}function ug(e,t,n){var r=null,i=Xt(!0),a=null,l=rx,u=null,d=Yk(f);e=typeof e=="function"?e:e===void 0?vB:Xt(+e),t=typeof t=="function"?t:Xt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?xB:Xt(+n);function f(m){var g,v,S,b=(m=Wk(m)).length,j,k=!1,E,C=new Array(b),A=new Array(b);for(a==null&&(u=l(E=d())),g=0;g<=b;++g){if(!(g<b&&i(j=m[g],g,m))===k)if(k=!k)v=g,u.areaStart(),u.lineStart();else{for(u.lineEnd(),u.lineStart(),S=g-1;S>=v;--S)u.point(C[S],A[S]);u.lineEnd(),u.areaEnd()}k&&(C[g]=+e(j,g,m),A[g]=+t(j,g,m),u.point(r?+r(j,g,m):C[g],n?+n(j,g,m):A[g]))}if(E)return u=null,E+""||null}function p(){return bB().defined(i).curve(l).context(a)}return f.x=function(m){return arguments.length?(e=typeof m=="function"?m:Xt(+m),r=null,f):e},f.x0=function(m){return arguments.length?(e=typeof m=="function"?m:Xt(+m),f):e},f.x1=function(m){return arguments.length?(r=m==null?null:typeof m=="function"?m:Xt(+m),f):r},f.y=function(m){return arguments.length?(t=typeof m=="function"?m:Xt(+m),n=null,f):t},f.y0=function(m){return arguments.length?(t=typeof m=="function"?m:Xt(+m),f):t},f.y1=function(m){return arguments.length?(n=m==null?null:typeof m=="function"?m:Xt(+m),f):n},f.lineX0=f.lineY0=function(){return p().x(e).y(t)},f.lineY1=function(){return p().x(e).y(n)},f.lineX1=function(){return p().x(r).y(t)},f.defined=function(m){return arguments.length?(i=typeof m=="function"?m:Xt(!!m),f):i},f.curve=function(m){return arguments.length?(l=m,a!=null&&(u=l(a)),f):l},f.context=function(m){return arguments.length?(m==null?a=u=null:u=l(a=m),f):a},f}class wB{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 Ode(e){return new wB(e,!0)}function Ede(e){return new wB(e,!1)}const Zk={draw(e,t){const n=ya(t/by);e.moveTo(n,0),e.arc(0,0,n,0,nx)}},_de={draw(e,t){const n=ya(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()}},SB=ya(1/3),zde=SB*2,Pde={draw(e,t){const n=ya(t/zde),r=n*SB;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Tde={draw(e,t){const n=ya(t),r=-n/2;e.rect(r,r,n,n)}},Rde=.8908130915292852,jB=xy(by/10)/xy(7*by/10),Dde=xy(nx/10)*jB,Mde=-mB(nx/10)*jB,Ide={draw(e,t){const n=ya(t*Rde),r=Dde*n,i=Mde*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const l=nx*a/5,u=mB(l),d=xy(l);e.lineTo(d*n,-u*n),e.lineTo(u*r-d*i,d*r+u*i)}e.closePath()}},Jw=ya(3),Lde={draw(e,t){const n=-ya(t/(Jw*3));e.moveTo(0,n*2),e.lineTo(-Jw*n,-n),e.lineTo(Jw*n,-n),e.closePath()}},Pi=-.5,Ti=ya(3)/2,O1=1/ya(12),$de=(O1/2+1)*3,Bde={draw(e,t){const n=ya(t/$de),r=n/2,i=n*O1,a=r,l=n*O1+n,u=-a,d=l;e.moveTo(r,i),e.lineTo(a,l),e.lineTo(u,d),e.lineTo(Pi*r-Ti*i,Ti*r+Pi*i),e.lineTo(Pi*a-Ti*l,Ti*a+Pi*l),e.lineTo(Pi*u-Ti*d,Ti*u+Pi*d),e.lineTo(Pi*r+Ti*i,Pi*i-Ti*r),e.lineTo(Pi*a+Ti*l,Pi*l-Ti*a),e.lineTo(Pi*u+Ti*d,Pi*d-Ti*u),e.closePath()}};function Ude(e,t){let n=null,r=Yk(i);e=typeof e=="function"?e:Xt(e||Zk),t=typeof t=="function"?t:Xt(t===void 0?64:+t);function i(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:Xt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Xt(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function wy(){}function Sy(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 NB(e){this._context=e}NB.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:Sy(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:Sy(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function qde(e){return new NB(e)}function kB(e){this._context=e}kB.prototype={areaStart:wy,areaEnd:wy,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:Sy(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Fde(e){return new kB(e)}function CB(e){this._context=e}CB.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:Sy(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Hde(e){return new CB(e)}function AB(e){this._context=e}AB.prototype={areaStart:wy,areaEnd:wy,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 Kde(e){return new AB(e)}function DT(e){return e<0?-1:1}function MT(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),l=(n-e._y1)/(i||r<0&&-0),u=(a*i+l*r)/(r+i);return(DT(a)+DT(l))*Math.min(Math.abs(a),Math.abs(l),.5*Math.abs(u))||0}function IT(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function eS(e,t,n){var r=e._x0,i=e._y0,a=e._x1,l=e._y1,u=(a-r)/3;e._context.bezierCurveTo(r+u,i+u*t,a-u,l-u*n,a,l)}function jy(e){this._context=e}jy.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:eS(this,this._t0,IT(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,eS(this,IT(this,n=MT(this,e,t)),n);break;default:eS(this,this._t0,n=MT(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function OB(e){this._context=new EB(e)}(OB.prototype=Object.create(jy.prototype)).point=function(e,t){jy.prototype.point.call(this,t,e)};function EB(e){this._context=e}EB.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,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function Gde(e){return new jy(e)}function Vde(e){return new OB(e)}function _B(e){this._context=e}_B.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=LT(e),i=LT(t),a=0,l=1;l<n;++a,++l)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],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 LT(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),l=new Array(n);for(i[0]=0,a[0]=2,l[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,l[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,l[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,l[t]-=r*l[t-1];for(i[n-1]=l[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(l[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Qde(e){return new _B(e)}function ix(e,t){this._context=e,this._t=t}ix.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 Yde(e){return new ix(e,.5)}function Wde(e){return new ix(e,0)}function Zde(e){return new ix(e,1)}function ac(e,t){if((l=e.length)>1)for(var n=1,r,i,a=e[t[0]],l,u=a.length;n<l;++n)for(i=a,a=e[t[n]],r=0;r<u;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function E1(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Xde(e,t){return e[t]}function Jde(e){const t=[];return t.key=e,t}function efe(){var e=Xt([]),t=E1,n=ac,r=Xde;function i(a){var l=Array.from(e.apply(this,arguments),Jde),u,d=l.length,f=-1,p;for(const m of a)for(u=0,++f;u<d;++u)(l[u][f]=[0,+r(m,l[u].key,f,a)]).data=m;for(u=0,p=Wk(t(l));u<d;++u)l[p[u]].index=u;return n(l,p),l}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:Xt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:Xt(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?E1:typeof a=="function"?a:Xt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??ac,i):n},i}function tfe(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,l;i<a;++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}ac(e,t)}}function nfe(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var l=0,u=0;l<i;++l)u+=e[l][n][1]||0;r[n][1]+=r[n][0]=-u/2}ac(e,t)}}function rfe(e,t){if(!(!((l=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,l;r<a;++r){for(var u=0,d=0,f=0;u<l;++u){for(var p=e[t[u]],m=p[r][1]||0,g=p[r-1][1]||0,v=(m-g)/2,S=0;S<u;++S){var b=e[t[S]],j=b[r][1]||0,k=b[r-1][1]||0;v+=j-k}d+=m,f+=v*m}i[r-1][1]+=i[r-1][0]=n,d&&(n-=f/d)}i[r-1][1]+=i[r-1][0]=n,ac(e,t)}}var tS={},nS={},$T;function ife(){return $T||($T=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(nS)),nS}var rS={},BT;function zB(){return BT||(BT=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})(rS)),rS}var iS={},UT;function Xk(){return UT||(UT=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})(iS)),iS}var aS={},sS={},qT;function afe(){return qT||(qT=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})(sS)),sS}var FT;function Jk(){return FT||(FT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=afe(),n=Xk();function r(i){if(Array.isArray(i))return i.map(n.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const a=[],l=i.length;if(l===0)return a;let u=0,d="",f="",p=!1;for(i.charCodeAt(0)===46&&(a.push(""),u++);u<l;){const m=i[u];f?m==="\\"&&u+1<l?(u++,d+=i[u]):m===f?f="":d+=m:p?m==='"'||m==="'"?f=m:m==="]"?(p=!1,a.push(d),d=""):d+=m:m==="["?(p=!0,d&&(a.push(d),d="")):m==="."?d&&(a.push(d),d=""):d+=m,u++}return d&&a.push(d),a}e.toPath=r})(aS)),aS}var HT;function eC(){return HT||(HT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ife(),n=zB(),r=Xk(),i=Jk();function a(u,d,f){if(u==null)return f;switch(typeof d){case"string":{if(t.isUnsafeProperty(d))return f;const p=u[d];return p===void 0?n.isDeepKey(d)?a(u,i.toPath(d),f):f:p}case"number":case"symbol":{typeof d=="number"&&(d=r.toKey(d));const p=u[d];return p===void 0?f:p}default:{if(Array.isArray(d))return l(u,d,f);if(Object.is(d?.valueOf(),-0)?d="-0":d=String(d),t.isUnsafeProperty(d))return f;const p=u[d];return p===void 0?f:p}}}function l(u,d,f){if(d.length===0)return f;let p=u;for(let m=0;m<d.length;m++){if(p==null||t.isUnsafeProperty(d[m]))return f;p=p[d[m]]}return p===void 0?f:p}e.get=a})(tS)),tS}var oS,KT;function sfe(){return KT||(KT=1,oS=eC().get),oS}var ofe=sfe();const nd=pa(ofe);var lfe=4;function Ro(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:lfe,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function kn(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,a,l)=>{var u=n[l-1];return typeof u=="string"?i+u+a:u!==void 0?i+Ro(u)+a:i+a},"")}var Qr=e=>e===0?0:e>0?1:-1,da=e=>typeof e=="number"&&e!=+e,sc=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Pe=e=>(typeof e=="number"||e instanceof Number)&&!da(e),Fa=e=>Pe(e)||typeof e=="string",cfe=0,Oh=e=>{var t=++cfe;return"".concat(e||"").concat(t)},fa=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Pe(t)&&typeof t!="string")return r;var a;if(sc(t)){if(n==null)return r;var l=t.indexOf("%");a=n*parseFloat(t.slice(0,l))/100}else a=+t;return da(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},PB=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 Ft(e,t,n){return Pe(e)&&Pe(t)?Ro(e+n*(t-e)):t}function TB(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):nd(r,t))===n)}var ln=e=>e===null||typeof e>"u",tp=e=>ln(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Yr(e){return e!=null}function Jo(){}var ufe=["type","size","sizeType"];function _1(){return _1=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},_1.apply(null,arguments)}function GT(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 VT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GT(Object(n),!0).forEach(function(r){dfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dfe(e,t,n){return(t=ffe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ffe(e){var t=hfe(e,"string");return typeof t=="symbol"?t:t+""}function hfe(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 pfe(e,t){if(e==null)return{};var n,r,i=mfe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function mfe(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 RB={symbolCircle:Zk,symbolCross:_de,symbolDiamond:Pde,symbolSquare:Tde,symbolStar:Ide,symbolTriangle:Lde,symbolWye:Bde},gfe=Math.PI/180,yfe=e=>{var t="symbol".concat(tp(e));return RB[t]||Zk},vfe=(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*gfe;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}},xfe=(e,t)=>{RB["symbol".concat(tp(e))]=t},tC=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=pfe(e,ufe),a=VT(VT({},i),{},{type:t,size:n,sizeType:r}),l="circle";typeof t=="string"&&(l=t);var u=()=>{var g=yfe(l),v=Ude().type(g).size(vfe(n,r,l)),S=v();if(S!==null)return S},{className:d,cx:f,cy:p}=a,m=kr(a);return Pe(f)&&Pe(p)&&Pe(n)?x.createElement("path",_1({},m,{className:At("recharts-symbols",d),transform:"translate(".concat(f,", ").concat(p,")"),d:u()})):null};tC.registerSymbol=xfe;var DB=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,nC=(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=>{Vk(i)&&typeof n[i]=="function"&&(r[i]=(a=>n[i](n,a)))}),r},bfe=(e,t,n)=>r=>(e(t,n,r),null),ax=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];Vk(i)&&typeof a=="function"&&(r||(r={}),r[i]=bfe(a,t,n))}),r};function QT(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 wfe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QT(Object(n),!0).forEach(function(r){Sfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Sfe(e,t,n){return(t=jfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jfe(e){var t=Nfe(e,"string");return typeof t=="symbol"?t:t+""}function Nfe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function er(e,t){var n=wfe({},e),r=t,i=Object.keys(t),a=i.reduce((l,u)=>(l[u]===void 0&&r[u]!==void 0&&(l[u]=r[u]),l),n);return a}function Ny(){return Ny=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},Ny.apply(null,arguments)}function YT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function MB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YT(Object(n),!0).forEach(function(r){kfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kfe(e,t,n){return(t=Cfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cfe(e){var t=Afe(e,"string");return typeof t=="symbol"?t:t+""}function Afe(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 Di=32,Ofe={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function Efe(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function _fe(e){var{data:t,iconType:n,inactiveColor:r}=e,i=Di/2,a=Di/6,l=Di/3,u=t.inactive?r:t.color,d=n??t.type;if(d==="none")return null;if(d==="plainline")return x.createElement("line",{strokeWidth:4,fill:"none",stroke:u,strokeDasharray:Efe(t.payload),x1:0,y1:i,x2:Di,y2:i,className:"recharts-legend-icon"});if(d==="line")return x.createElement("path",{strokeWidth:4,fill:"none",stroke:u,d:"M0,".concat(i,"h").concat(l,`
|
|
255
|
-
A`).concat(a,",").concat(a,",0,1,1,").concat(2*l,",").concat(i,`
|
|
256
|
-
H`).concat(Di,"M").concat(2*l,",").concat(i,`
|
|
257
|
-
A`).concat(a,",").concat(a,",0,1,1,").concat(l,",").concat(i),className:"recharts-legend-icon"});if(d==="rect")return x.createElement("path",{stroke:"none",fill:u,d:"M0,".concat(Di/8,"h").concat(Di,"v").concat(Di*3/4,"h").concat(-Di,"z"),className:"recharts-legend-icon"});if(x.isValidElement(t.legendIcon)){var f=MB({},t);return delete f.legendIcon,x.cloneElement(t.legendIcon,f)}return x.createElement(tC,{fill:u,cx:i,cy:i,size:Di,sizeType:"diameter",type:d})}function zfe(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:l,labelStyle:u}=e,d={x:0,y:0,width:Di,height:Di},f={display:r==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((m,g)=>{var v=m.formatter||i,S=At({"recharts-legend-item":!0,["legend-item-".concat(g)]:!0,inactive:m.inactive});if(m.type==="none")return null;var b=typeof u=="object"?MB({},u):{};b.color=m.inactive?a:b.color||m.color;var j=v?v(m.value,m,g):m.value;return x.createElement("li",Ny({className:S,style:f,key:"legend-item-".concat(g)},ax(e,m,g)),x.createElement(Qk,{width:n,height:n,viewBox:d,style:p,"aria-label":"".concat(m.value," legend icon")},x.createElement(_fe,{data:m,iconType:l,inactiveColor:a})),x.createElement("span",{className:"recharts-legend-item-text",style:b},j))})}var Pfe=e=>{var t=er(e,Ofe),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r==="horizontal"?i:"left"};return x.createElement("ul",{className:"recharts-default-legend",style:a},x.createElement(zfe,Ny({},t,{payload:n})))},lS={},cS={},WT;function Tfe(){return WT||(WT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){const i=new Map;for(let a=0;a<n.length;a++){const l=n[a],u=r(l,a,n);i.has(u)||i.set(u,l)}return Array.from(i.values())}e.uniqBy=t})(cS)),cS}var uS={},ZT;function Rfe(){return ZT||(ZT=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})(uS)),uS}var dS={},XT;function IB(){return XT||(XT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(dS)),dS}var fS={},hS={},pS={},JT;function Dfe(){return JT||(JT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(pS)),pS}var eR;function LB(){return eR||(eR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Dfe();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(hS)),hS}var mS={},tR;function Mfe(){return tR||(tR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(mS)),mS}var nR;function Ife(){return nR||(nR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=LB(),n=Mfe();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(fS)),fS}var gS={},yS={},rR;function Lfe(){return rR||(rR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=eC();function n(r){return function(i){return t.get(i,r)}}e.property=n})(yS)),yS}var vS={},xS={},bS={},wS={},iR;function $B(){return iR||(iR=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})(wS)),wS}var SS={},aR;function BB(){return aR||(aR=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})(SS)),SS}var jS={},sR;function UB(){return sR||(sR=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})(jS)),jS}var oR;function $fe(){return oR||(oR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$B(),n=BB(),r=UB();function i(p,m,g){return typeof g!="function"?i(p,m,()=>{}):a(p,m,function v(S,b,j,k,E,C){const A=g(S,b,j,k,E,C);return A!==void 0?!!A:a(S,b,v,C)},new Map)}function a(p,m,g,v){if(m===p)return!0;switch(typeof m){case"object":return l(p,m,g,v);case"function":return Object.keys(m).length>0?a(p,{...m},g,v):r.isEqualsSameValueZero(p,m);default:return t.isObject(p)?typeof m=="string"?m==="":!0:r.isEqualsSameValueZero(p,m)}}function l(p,m,g,v){if(m==null)return!0;if(Array.isArray(m))return d(p,m,g,v);if(m instanceof Map)return u(p,m,g,v);if(m instanceof Set)return f(p,m,g,v);const S=Object.keys(m);if(p==null||n.isPrimitive(p))return S.length===0;if(S.length===0)return!0;if(v?.has(m))return v.get(m)===p;v?.set(m,p);try{for(let b=0;b<S.length;b++){const j=S[b];if(!n.isPrimitive(p)&&!(j in p)||m[j]===void 0&&p[j]!==void 0||m[j]===null&&p[j]!==null||!g(p[j],m[j],j,p,m,v))return!1}return!0}finally{v?.delete(m)}}function u(p,m,g,v){if(m.size===0)return!0;if(!(p instanceof Map))return!1;for(const[S,b]of m.entries()){const j=p.get(S);if(g(j,b,S,p,m,v)===!1)return!1}return!0}function d(p,m,g,v){if(m.length===0)return!0;if(!Array.isArray(p))return!1;const S=new Set;for(let b=0;b<m.length;b++){const j=m[b];let k=!1;for(let E=0;E<p.length;E++){if(S.has(E))continue;const C=p[E];let A=!1;if(g(C,j,b,p,m,v)&&(A=!0),A){S.add(E),k=!0;break}}if(!k)return!1}return!0}function f(p,m,g,v){return m.size===0?!0:p instanceof Set?d([...p],[...m],g,v):!1}e.isMatchWith=i,e.isSetMatch=f})(bS)),bS}var lR;function qB(){return lR||(lR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$fe();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(xS)),xS}var NS={},kS={},CS={},cR;function Bfe(){return cR||(cR=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})(CS)),CS}var AS={},uR;function rC(){return uR||(uR=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})(AS)),AS}var OS={},dR;function FB(){return dR||(dR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",r="[object Number]",i="[object Boolean]",a="[object Arguments]",l="[object Symbol]",u="[object Date]",d="[object Map]",f="[object Set]",p="[object Array]",m="[object Function]",g="[object ArrayBuffer]",v="[object Object]",S="[object Error]",b="[object DataView]",j="[object Uint8Array]",k="[object Uint8ClampedArray]",E="[object Uint16Array]",C="[object Uint32Array]",A="[object BigUint64Array]",P="[object Int8Array]",O="[object Int16Array]",_="[object Int32Array]",T="[object BigInt64Array]",$="[object Float32Array]",F="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=g,e.arrayTag=p,e.bigInt64ArrayTag=T,e.bigUint64ArrayTag=A,e.booleanTag=i,e.dataViewTag=b,e.dateTag=u,e.errorTag=S,e.float32ArrayTag=$,e.float64ArrayTag=F,e.functionTag=m,e.int16ArrayTag=O,e.int32ArrayTag=_,e.int8ArrayTag=P,e.mapTag=d,e.numberTag=r,e.objectTag=v,e.regexpTag=t,e.setTag=f,e.stringTag=n,e.symbolTag=l,e.uint16ArrayTag=E,e.uint32ArrayTag=C,e.uint8ArrayTag=j,e.uint8ClampedArrayTag=k})(OS)),OS}var ES={},fR;function Ufe(){return fR||(fR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(ES)),ES}var hR;function HB(){return hR||(hR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Bfe(),n=rC(),r=FB(),i=BB(),a=Ufe();function l(p,m){return u(p,void 0,p,new Map,m)}function u(p,m,g,v=new Map,S=void 0){const b=S?.(p,m,g,v);if(b!==void 0)return b;if(i.isPrimitive(p))return p;if(v.has(p))return v.get(p);if(Array.isArray(p)){const j=new Array(p.length);v.set(p,j);for(let k=0;k<p.length;k++)j[k]=u(p[k],k,g,v,S);return Object.hasOwn(p,"index")&&(j.index=p.index),Object.hasOwn(p,"input")&&(j.input=p.input),j}if(p instanceof Date)return new Date(p.getTime());if(p instanceof RegExp){const j=new RegExp(p.source,p.flags);return j.lastIndex=p.lastIndex,j}if(p instanceof Map){const j=new Map;v.set(p,j);for(const[k,E]of p)j.set(k,u(E,k,g,v,S));return j}if(p instanceof Set){const j=new Set;v.set(p,j);for(const k of p)j.add(u(k,void 0,g,v,S));return j}if(typeof Buffer<"u"&&Buffer.isBuffer(p))return p.subarray();if(a.isTypedArray(p)){const j=new(Object.getPrototypeOf(p)).constructor(p.length);v.set(p,j);for(let k=0;k<p.length;k++)j[k]=u(p[k],k,g,v,S);return j}if(p instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&p instanceof SharedArrayBuffer)return p.slice(0);if(p instanceof DataView){const j=new DataView(p.buffer.slice(0),p.byteOffset,p.byteLength);return v.set(p,j),d(j,p,g,v,S),j}if(typeof File<"u"&&p instanceof File){const j=new File([p],p.name,{type:p.type});return v.set(p,j),d(j,p,g,v,S),j}if(typeof Blob<"u"&&p instanceof Blob){const j=new Blob([p],{type:p.type});return v.set(p,j),d(j,p,g,v,S),j}if(p instanceof Error){const j=structuredClone(p);return v.set(p,j),j.message=p.message,j.name=p.name,j.stack=p.stack,j.cause=p.cause,j.constructor=p.constructor,d(j,p,g,v,S),j}if(p instanceof Boolean){const j=new Boolean(p.valueOf());return v.set(p,j),d(j,p,g,v,S),j}if(p instanceof Number){const j=new Number(p.valueOf());return v.set(p,j),d(j,p,g,v,S),j}if(p instanceof String){const j=new String(p.valueOf());return v.set(p,j),d(j,p,g,v,S),j}if(typeof p=="object"&&f(p)){const j=Object.create(Object.getPrototypeOf(p));return v.set(p,j),d(j,p,g,v,S),j}return p}function d(p,m,g=p,v,S){const b=[...Object.keys(m),...t.getSymbols(m)];for(let j=0;j<b.length;j++){const k=b[j],E=Object.getOwnPropertyDescriptor(p,k);(E==null||E.writable)&&(p[k]=u(m[k],k,g,v,S))}}function f(p){switch(n.getTag(p)){case r.argumentsTag:case r.arrayTag:case r.arrayBufferTag:case r.dataViewTag:case r.booleanTag:case r.dateTag:case r.float32ArrayTag:case r.float64ArrayTag:case r.int8ArrayTag:case r.int16ArrayTag:case r.int32ArrayTag:case r.mapTag:case r.numberTag:case r.objectTag:case r.regexpTag:case r.setTag:case r.stringTag:case r.symbolTag:case r.uint8ArrayTag:case r.uint8ClampedArrayTag:case r.uint16ArrayTag:case r.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=l,e.cloneDeepWithImpl=u,e.copyProperties=d})(kS)),kS}var pR;function qfe(){return pR||(pR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=HB();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(NS)),NS}var mR;function Ffe(){return mR||(mR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=qB(),n=qfe();function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})(vS)),vS}var _S={},zS={},PS={},gR;function Hfe(){return gR||(gR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=HB(),n=rC(),r=FB();function i(a,l){return t.cloneDeepWith(a,(u,d,f,p)=>{const m=l?.(u,d,f,p);if(m!==void 0)return m;if(typeof a=="object"){if(n.getTag(a)===r.objectTag&&typeof a.constructor!="function"){const g={};return p.set(a,g),t.copyProperties(g,a,f,p),g}switch(Object.prototype.toString.call(a)){case r.numberTag:case r.stringTag:case r.booleanTag:{const g=new a.constructor(a?.valueOf());return t.copyProperties(g,a),g}case r.argumentsTag:{const g={};return t.copyProperties(g,a),g.length=a.length,g[Symbol.iterator]=a[Symbol.iterator],g}default:return}}})}e.cloneDeepWith=i})(PS)),PS}var yR;function Kfe(){return yR||(yR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Hfe();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(zS)),zS}var TS={},RS={},vR;function KB(){return vR||(vR=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})(RS)),RS}var DS={},xR;function Gfe(){return xR||(xR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=rC();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(DS)),DS}var bR;function Vfe(){return bR||(bR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=zB(),n=KB(),r=Gfe(),i=Jk();function a(l,u){let d;if(Array.isArray(u)?d=u:typeof u=="string"&&t.isDeepKey(u)&&l?.[u]==null?d=i.toPath(u):d=[u],d.length===0)return!1;let f=l;for(let p=0;p<d.length;p++){const m=d[p];if((f==null||!Object.hasOwn(f,m))&&!((Array.isArray(f)||r.isArguments(f))&&n.isIndex(m)&&m<f.length))return!1;f=f[m]}return!0}e.has=a})(TS)),TS}var wR;function Qfe(){return wR||(wR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=qB(),n=Xk(),r=Kfe(),i=eC(),a=Vfe();function l(u,d){switch(typeof u){case"object":{Object.is(u?.valueOf(),-0)&&(u="-0");break}case"number":{u=n.toKey(u);break}}return d=r.cloneDeep(d),function(f){const p=i.get(f,u);return p===void 0?a.has(f,u):d===void 0?p===void 0:t.isMatch(p,d)}}e.matchesProperty=l})(_S)),_S}var SR;function Yfe(){return SR||(SR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=IB(),n=Lfe(),r=Ffe(),i=Qfe();function a(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=a})(gS)),gS}var jR;function Wfe(){return jR||(jR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Tfe(),n=Rfe(),r=IB(),i=Ife(),a=Yfe();function l(u,d=r.identity){return i.isArrayLikeObject(u)?t.uniqBy(Array.from(u),n.ary(a.iteratee(d),1)):[]}e.uniqBy=l})(lS)),lS}var MS,NR;function Zfe(){return NR||(NR=1,MS=Wfe().uniqBy),MS}var Xfe=Zfe();const kR=pa(Xfe);function GB(e,t,n){return t===!0?kR(e,n):typeof t=="function"?kR(e,t):e}var iC=x.createContext(null),Jfe=e=>e,cn=()=>{var e=x.useContext(iC);return e?e.store.dispatch:Jfe},qg=()=>{},ehe=()=>qg,the=(e,t)=>e===t;function Ue(e){var t=x.useContext(iC),n=x.useMemo(()=>t?r=>{if(r!=null)return e(r)}:qg,[t,e]);return d5.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:ehe,t?t.store.getState:qg,t?t.store.getState:qg,n,the)}function nhe(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function rhe(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function ihe(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 CR=e=>Array.isArray(e)?e:[e];function ahe(e){const t=Array.isArray(e[0])?e[0]:e;return ihe(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function she(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var ohe=class{constructor(e){this.value=e}deref(){return this.value}},lhe=typeof WeakRef<"u"?WeakRef:ohe,che=0,AR=1;function dg(){return{s:che,v:void 0,o:null,p:null}}function VB(e,t={}){let n=dg();const{resultEqualityCheck:r}=t;let i,a=0;function l(){let u=n;const{length:d}=arguments;for(let m=0,g=d;m<g;m++){const v=arguments[m];if(typeof v=="function"||typeof v=="object"&&v!==null){let S=u.o;S===null&&(u.o=S=new WeakMap);const b=S.get(v);b===void 0?(u=dg(),S.set(v,u)):u=b}else{let S=u.p;S===null&&(u.p=S=new Map);const b=S.get(v);b===void 0?(u=dg(),S.set(v,u)):u=b}}const f=u;let p;if(u.s===AR)p=u.v;else if(p=e.apply(null,arguments),a++,r){const m=i?.deref?.()??i;m!=null&&r(m,p)&&(p=m,a!==0&&a--),i=typeof p=="object"&&p!==null||typeof p=="function"?new lhe(p):p}return f.s=AR,f.v=p,p}return l.clearCache=()=>{n=dg(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function uhe(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,l=0,u,d={},f=i.pop();typeof f=="object"&&(d=f,f=i.pop()),nhe(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const p={...n,...d},{memoize:m,memoizeOptions:g=[],argsMemoize:v=VB,argsMemoizeOptions:S=[]}=p,b=CR(g),j=CR(S),k=ahe(i),E=m(function(){return a++,f.apply(null,arguments)},...b),C=v(function(){l++;const P=she(k,arguments);return u=E.apply(null,P),u},...j);return Object.assign(C,{resultFunc:f,memoizedResultFunc:E,dependencies:k,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>u,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:m,argsMemoize:v})};return Object.assign(r,{withTypes:()=>r}),r}var re=uhe(VB),dhe=Object.assign((e,t=re)=>{rhe(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(a=>e[a]);return t(r,(...a)=>a.reduce((l,u,d)=>(l[n[d]]=u,l),{}))},{withTypes:()=>dhe}),IS={},LS={},$S={},OR;function fhe(){return OR||(OR=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,a)=>{if(r!==i){const l=t(r),u=t(i);if(l===u&&l===0){if(r<i)return a==="desc"?1:-1;if(r>i)return a==="desc"?-1:1}return a==="desc"?u-l:l-u}return 0};e.compareValues=n})($S)),$S}var BS={},US={},ER;function QB(){return ER||(ER=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(US)),US}var _R;function hhe(){return _R||(_R=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=QB(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,l){return Array.isArray(a)?!1:typeof a=="number"||typeof a=="boolean"||a==null||t.isSymbol(a)?!0:typeof a=="string"&&(r.test(a)||!n.test(a))||l!=null&&Object.hasOwn(l,a)}e.isKey=i})(BS)),BS}var zR;function phe(){return zR||(zR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=fhe(),n=hhe(),r=Jk();function i(a,l,u,d){if(a==null)return[];u=d?void 0:u,Array.isArray(a)||(a=Object.values(a)),Array.isArray(l)||(l=l==null?[null]:[l]),l.length===0&&(l=[null]),Array.isArray(u)||(u=u==null?[]:[u]),u=u.map(v=>String(v));const f=(v,S)=>{let b=v;for(let j=0;j<S.length&&b!=null;++j)b=b[S[j]];return b},p=(v,S)=>S==null||v==null?S:typeof v=="object"&&"key"in v?Object.hasOwn(S,v.key)?S[v.key]:f(S,v.path):typeof v=="function"?v(S):Array.isArray(v)?f(S,v):typeof S=="object"?S[v]:S,m=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 a.map(v=>({original:v,criteria:m.map(S=>p(S,v))})).slice().sort((v,S)=>{for(let b=0;b<m.length;b++){const j=t.compareValues(v.criteria[b],S.criteria[b],u[b]);if(j!==0)return j}return 0}).map(v=>v.original)}e.orderBy=i})(LS)),LS}var qS={},PR;function mhe(){return PR||(PR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],a=Math.floor(r),l=(u,d)=>{for(let f=0;f<u.length;f++){const p=u[f];Array.isArray(p)&&d<a?l(p,d+1):i.push(p)}};return l(n,0),i}e.flatten=t})(qS)),qS}var FS={},TR;function YB(){return TR||(TR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=KB(),n=LB(),r=$B(),i=UB();function a(l,u,d){return r.isObject(d)&&(typeof u=="number"&&n.isArrayLike(d)&&t.isIndex(u)&&u<d.length||typeof u=="string"&&u in d)?i.isEqualsSameValueZero(d[u],l):!1}e.isIterateeCall=a})(FS)),FS}var RR;function ghe(){return RR||(RR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=phe(),n=mhe(),r=YB();function i(a,...l){const u=l.length;return u>1&&r.isIterateeCall(a,l[0],l[1])?l=[]:u>2&&r.isIterateeCall(l[0],l[1],l[2])&&(l=[l[0]]),t.orderBy(a,n.flatten(l),["asc"])}e.sortBy=i})(IS)),IS}var HS,DR;function yhe(){return DR||(DR=1,HS=ghe().sortBy),HS}var vhe=yhe();const sx=pa(vhe);var WB=e=>e.legend.settings,xhe=e=>e.legend.size,bhe=e=>e.legend.payload,whe=re([bhe,WB],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?sx(r,n):r});function She(){return Ue(whe)}var fg=1;function ZB(){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 a=i.getBoundingClientRect(),l={height:a.height,left:a.left,top:a.top,width:a.width};(Math.abs(l.height-t.height)>fg||Math.abs(l.left-t.left)>fg||Math.abs(l.top-t.top)>fg||Math.abs(l.width-t.width)>fg)&&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 ur(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 jhe=typeof Symbol=="function"&&Symbol.observable||"@@observable",MR=jhe,KS=()=>Math.random().toString(36).substring(7).split("").join("."),Nhe={INIT:`@@redux/INIT${KS()}`,REPLACE:`@@redux/REPLACE${KS()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${KS()}`},ky=Nhe;function aC(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 XB(e,t,n){if(typeof e!="function")throw new Error(ur(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(ur(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(ur(1));return n(XB)(e,t)}let r=e,i=t,a=new Map,l=a,u=0,d=!1;function f(){l===a&&(l=new Map,a.forEach((j,k)=>{l.set(k,j)}))}function p(){if(d)throw new Error(ur(3));return i}function m(j){if(typeof j!="function")throw new Error(ur(4));if(d)throw new Error(ur(5));let k=!0;f();const E=u++;return l.set(E,j),function(){if(k){if(d)throw new Error(ur(6));k=!1,f(),l.delete(E),a=null}}}function g(j){if(!aC(j))throw new Error(ur(7));if(typeof j.type>"u")throw new Error(ur(8));if(typeof j.type!="string")throw new Error(ur(17));if(d)throw new Error(ur(9));try{d=!0,i=r(i,j)}finally{d=!1}return(a=l).forEach(E=>{E()}),j}function v(j){if(typeof j!="function")throw new Error(ur(10));r=j,g({type:ky.REPLACE})}function S(){const j=m;return{subscribe(k){if(typeof k!="object"||k===null)throw new Error(ur(11));function E(){const A=k;A.next&&A.next(p())}return E(),{unsubscribe:j(E)}},[MR](){return this}}}return g({type:ky.INIT}),{dispatch:g,subscribe:m,getState:p,replaceReducer:v,[MR]:S}}function khe(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:ky.INIT})>"u")throw new Error(ur(12));if(typeof n(void 0,{type:ky.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ur(13))})}function JB(e){const t=Object.keys(e),n={};for(let a=0;a<t.length;a++){const l=t[a];typeof e[l]=="function"&&(n[l]=e[l])}const r=Object.keys(n);let i;try{khe(n)}catch(a){i=a}return function(l={},u){if(i)throw i;let d=!1;const f={};for(let p=0;p<r.length;p++){const m=r[p],g=n[m],v=l[m],S=g(v,u);if(typeof S>"u")throw u&&u.type,new Error(ur(14));f[m]=S,d=d||S!==v}return d=d||r.length!==Object.keys(l).length,d?f:l}}function Cy(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function Che(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(ur(15))};const l={getState:i.getState,dispatch:(d,...f)=>a(d,...f)},u=e.map(d=>d(l));return a=Cy(...u)(i.dispatch),{...i,dispatch:a}}}function e6(e){return aC(e)&&"type"in e&&typeof e.type=="string"}var t6=Symbol.for("immer-nothing"),IR=Symbol.for("immer-draftable"),Mr=Symbol.for("immer-state");function sa(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var hi=Object,rd=hi.getPrototypeOf,Ay="constructor",ox="prototype",z1="configurable",Oy="enumerable",Fg="writable",Eh="value",_s=e=>!!e&&!!e[Mr];function ha(e){return e?n6(e)||cx(e)||!!e[IR]||!!e[Ay]?.[IR]||ux(e)||dx(e):!1}var Ahe=hi[ox][Ay].toString(),LR=new WeakMap;function n6(e){if(!e||!sC(e))return!1;const t=rd(e);if(t===null||t===hi[ox])return!0;const n=hi.hasOwnProperty.call(t,Ay)&&t[Ay];if(n===Object)return!0;if(!Cu(n))return!1;let r=LR.get(n);return r===void 0&&(r=Function.toString.call(n),LR.set(n,r)),r===Ahe}function lx(e,t,n=!0){np(e)===0?(n?Reflect.ownKeys(e):hi.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function np(e){const t=e[Mr];return t?t.type_:cx(e)?1:ux(e)?2:dx(e)?3:0}var $R=(e,t,n=np(e))=>n===2?e.has(t):hi[ox].hasOwnProperty.call(e,t),P1=(e,t,n=np(e))=>n===2?e.get(t):e[t],Ey=(e,t,n,r=np(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Ohe(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var cx=Array.isArray,ux=e=>e instanceof Map,dx=e=>e instanceof Set,sC=e=>typeof e=="object",Cu=e=>typeof e=="function",GS=e=>typeof e=="boolean";function Ehe(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var bs=e=>e.copy_||e.base_,oC=e=>e.modified_?e.copy_:e.base_;function T1(e,t){if(ux(e))return new Map(e);if(dx(e))return new Set(e);if(cx(e))return Array[ox].slice.call(e);const n=n6(e);if(t===!0||t==="class_only"&&!n){const r=hi.getOwnPropertyDescriptors(e);delete r[Mr];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const l=i[a],u=r[l];u[Fg]===!1&&(u[Fg]=!0,u[z1]=!0),(u.get||u.set)&&(r[l]={[z1]:!0,[Fg]:!0,[Oy]:u[Oy],[Eh]:e[l]})}return hi.create(rd(e),r)}else{const r=rd(e);if(r!==null&&n)return{...e};const i=hi.create(r);return hi.assign(i,e)}}function lC(e,t=!1){return fx(e)||_s(e)||!ha(e)||(np(e)>1&&hi.defineProperties(e,{set:hg,add:hg,clear:hg,delete:hg}),hi.freeze(e),t&&lx(e,(n,r)=>{lC(r,!0)},!1)),e}function _he(){sa(2)}var hg={[Eh]:_he};function fx(e){return e===null||!sC(e)?!0:hi.isFrozen(e)}var _y="MapSet",R1="Patches",BR="ArrayMethods",r6={};function oc(e){const t=r6[e];return t||sa(0,e),t}var UR=e=>!!r6[e],_h,i6=()=>_h,zhe=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:UR(_y)?oc(_y):void 0,arrayMethodsPlugin_:UR(BR)?oc(BR):void 0});function qR(e,t){t&&(e.patchPlugin_=oc(R1),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function D1(e){M1(e),e.drafts_.forEach(Phe),e.drafts_=null}function M1(e){e===_h&&(_h=e.parent_)}var FR=e=>_h=zhe(_h,e);function Phe(e){const t=e[Mr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function HR(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Mr].modified_&&(D1(t),sa(4)),ha(e)&&(e=KR(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Mr].base_,e,t)}else e=KR(t,n);return The(t,e,!0),D1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==t6?e:void 0}function KR(e,t){if(fx(t))return t;const n=t[Mr];if(!n)return zy(t,e.handledSet_,e);if(!hx(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);o6(n,e)}return n.copy_}function The(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&lC(t,n)}function a6(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var hx=(e,t)=>e.scope_===t,Rhe=[];function s6(e,t,n,r){const i=bs(e),a=e.type_;if(r!==void 0&&P1(i,r,a)===t){Ey(i,r,n,a);return}if(!e.draftLocations_){const u=e.draftLocations_=new Map;lx(i,(d,f)=>{if(_s(f)){const p=u.get(f)||[];p.push(d),u.set(f,p)}})}const l=e.draftLocations_.get(t)??Rhe;for(const u of l)Ey(i,u,n,a)}function Dhe(e,t,n){e.callbacks_.push(function(i){const a=t;if(!a||!hx(a,i))return;i.mapSetPlugin_?.fixSetContents(a);const l=oC(a);s6(e,a.draft_??a,l,n),o6(a,i)})}function o6(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)}a6(e)}}function Mhe(e,t,n){const{scope_:r}=e;if(_s(n)){const i=n[Mr];hx(i,r)&&i.callbacks_.push(function(){Hg(e);const l=oC(i);s6(e,n,l,t)})}else ha(n)&&e.callbacks_.push(function(){const a=bs(e);e.type_===3?a.has(n)&&zy(n,r.handledSet_,r):P1(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&zy(P1(e.copy_,t,e.type_),r.handledSet_,r)})}function zy(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||_s(e)||t.has(e)||!ha(e)||fx(e)||(t.add(e),lx(e,(r,i)=>{if(_s(i)){const a=i[Mr];if(hx(a,n)){const l=oC(a);Ey(e,r,l,e.type_),a6(a)}}else ha(i)&&zy(i,t,n)})),e}function Ihe(e,t){const n=cx(e),r={type_:n?1:0,scope_:t?t.scope_:i6(),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,a=Py;n&&(i=[r],a=zh);const{revoke:l,proxy:u}=Proxy.revocable(i,a);return r.draft_=u,r.revoke_=l,[u,r]}var Py={get(e,t){if(t===Mr)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=bs(e);if(!$R(i,t,e.type_))return Lhe(e,i,t);const a=i[t];if(e.finalized_||!ha(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Ehe(t))return a;if(a===VS(e.base_,t)){Hg(e);const l=e.type_===1?+t:t,u=L1(e.scope_,a,e,l);return e.copy_[l]=u}return a},has(e,t){return t in bs(e)},ownKeys(e){return Reflect.ownKeys(bs(e))},set(e,t,n){const r=l6(bs(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=VS(bs(e),t),a=i?.[Mr];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(Ohe(n,i)&&(n!==void 0||$R(e.base_,t,e.type_)))return!0;Hg(e),I1(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),Mhe(e,t,n)),!0},deleteProperty(e,t){return Hg(e),VS(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),I1(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=bs(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Fg]:!0,[z1]:e.type_!==1||t!=="length",[Oy]:r[Oy],[Eh]:n[t]}},defineProperty(){sa(11)},getPrototypeOf(e){return rd(e.base_)},setPrototypeOf(){sa(12)}},zh={};for(let e in Py){let t=Py[e];zh[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}zh.deleteProperty=function(e,t){return zh.set.call(this,e,t,void 0)};zh.set=function(e,t,n){return Py.set.call(this,e[0],t,n,e[0])};function VS(e,t){const n=e[Mr];return(n?bs(n):e)[t]}function Lhe(e,t,n){const r=l6(t,n);return r?Eh in r?r[Eh]:r.get?.call(e.draft_):void 0}function l6(e,t){if(!(t in e))return;let n=rd(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=rd(n)}}function I1(e){e.modified_||(e.modified_=!0,e.parent_&&I1(e.parent_))}function Hg(e){e.copy_||(e.assigned_=new Map,e.copy_=T1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var $he=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(Cu(n)&&!Cu(r)){const l=r;r=n;const u=this;return function(f=l,...p){return u.produce(f,m=>r.call(this,m,...p))}}Cu(r)||sa(6),i!==void 0&&!Cu(i)&&sa(7);let a;if(ha(n)){const l=FR(this),u=L1(l,n,void 0);let d=!0;try{a=r(u),d=!1}finally{d?D1(l):M1(l)}return qR(l,i),HR(a,l)}else if(!n||!sC(n)){if(a=r(n),a===void 0&&(a=n),a===t6&&(a=void 0),this.autoFreeze_&&lC(a,!0),i){const l=[],u=[];oc(R1).generateReplacementPatches_(n,a,{patches_:l,inversePatches_:u}),i(l,u)}return a}else sa(1,n)},this.produceWithPatches=(n,r)=>{if(Cu(n))return(u,...d)=>this.produceWithPatches(u,f=>n(f,...d));let i,a;return[this.produce(n,r,(u,d)=>{i=u,a=d}),i,a]},GS(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),GS(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),GS(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){ha(t)||sa(8),_s(t)&&(t=Bi(t));const n=FR(this),r=L1(n,t,void 0);return r[Mr].isManual_=!0,M1(n),r}finishDraft(t,n){const r=t&&t[Mr];(!r||!r.isManual_)&&sa(9);const{scope_:i}=r;return qR(i,n),HR(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 a=n[r];if(a.path.length===0&&a.op==="replace"){t=a.value;break}}r>-1&&(n=n.slice(r+1));const i=oc(R1).applyPatches_;return _s(t)?i(t,n):this.produce(t,a=>i(a,n))}};function L1(e,t,n,r){const[i,a]=ux(t)?oc(_y).proxyMap_(t,n):dx(t)?oc(_y).proxySet_(t,n):Ihe(t,n);return(n?.scope_??i6()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?Dhe(n,a,r):a.callbacks_.push(function(d){d.mapSetPlugin_?.fixSetContents(a);const{patchPlugin_:f}=d;a.modified_&&f&&f.generatePatches_(a,[],d)}),i}function Bi(e){return _s(e)||sa(10,e),c6(e)}function c6(e){if(!ha(e)||fx(e))return e;const t=e[Mr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=T1(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=T1(e,!0);return lx(n,(i,a)=>{Ey(n,i,c6(a))},r),t&&(t.finalized_=!1),n}var Bhe=new $he,u6=Bhe.produce;function d6(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var Uhe=d6(),qhe=d6,Fhe=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Cy:Cy.apply(null,arguments)};function gi(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(pi(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=>e6(r)&&r.type===e,n}var f6=class nh extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,nh.prototype)}static get[Symbol.species](){return nh}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new nh(...t[0].concat(this)):new nh(...t.concat(this))}};function GR(e){return ha(e)?u6(e,()=>{}):e}function pg(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function Hhe(e){return typeof e=="boolean"}var Khe=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let l=new f6;return n&&(Hhe(n)?l.push(Uhe):l.push(qhe(n.extraArgument))),l},h6="RTK_autoBatch",sn=()=>e=>({payload:e,meta:{[h6]:!0}}),VR=e=>t=>{setTimeout(t,e)},p6=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,l=!1;const u=new Set,d=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:VR(10):e.type==="callback"?e.queueNotification:VR(e.timeout),f=()=>{l=!1,a&&(a=!1,u.forEach(p=>p()))};return Object.assign({},r,{subscribe(p){const m=()=>i&&p(),g=r.subscribe(m);return u.add(p),()=>{g(),u.delete(p)}},dispatch(p){try{return i=!p?.meta?.[h6],a=!i,a&&(l||(l=!0,d(f))),r.dispatch(p)}finally{i=!0}}})},Ghe=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new f6(e);return r&&i.push(p6(typeof r=="object"?r:void 0)),i};function Vhe(e){const t=Khe(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:l=void 0}=e||{};let u;if(typeof n=="function")u=n;else if(aC(n))u=JB(n);else throw new Error(pi(1));let d;typeof r=="function"?d=r(t):d=t();let f=Cy;i&&(f=Fhe({trace:!1,...typeof i=="object"&&i}));const p=Che(...d),m=Ghe(p);let g=typeof l=="function"?l(m):m();const v=f(...g);return XB(u,a,v)}function m6(e){const t={},n=[];let r;const i={addCase(a,l){const u=typeof a=="string"?a:a.type;if(!u)throw new Error(pi(28));if(u in t)throw new Error(pi(29));return t[u]=l,i},addAsyncThunk(a,l){return l.pending&&(t[a.pending.type]=l.pending),l.rejected&&(t[a.rejected.type]=l.rejected),l.fulfilled&&(t[a.fulfilled.type]=l.fulfilled),l.settled&&n.push({matcher:a.settled,reducer:l.settled}),i},addMatcher(a,l){return n.push({matcher:a,reducer:l}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function Qhe(e){return typeof e=="function"}function Yhe(e,t){let[n,r,i]=m6(t),a;if(Qhe(e))a=()=>GR(e());else{const u=GR(e);a=()=>u}function l(u=a(),d){let f=[n[d.type],...r.filter(({matcher:p})=>p(d)).map(({reducer:p})=>p)];return f.filter(p=>!!p).length===0&&(f=[i]),f.reduce((p,m)=>{if(m)if(_s(p)){const v=m(p,d);return v===void 0?p:v}else{if(ha(p))return u6(p,g=>m(g,d));{const g=m(p,d);if(g===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return g}}return p},u)}return l.getInitialState=a,l}var Whe="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Zhe=(e=21)=>{let t="",n=e;for(;n--;)t+=Whe[Math.random()*64|0];return t},Xhe=Symbol.for("rtk-slice-createasyncthunk");function Jhe(e,t){return`${e}/${t}`}function epe({creators:e}={}){const t=e?.asyncThunk?.[Xhe];return function(r){const{name:i,reducerPath:a=i}=r;if(!i)throw new Error(pi(11));const l=(typeof r.reducers=="function"?r.reducers(npe()):r.reducers)||{},u=Object.keys(l),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(C,A){const P=typeof C=="string"?C:C.type;if(!P)throw new Error(pi(12));if(P in d.sliceCaseReducersByType)throw new Error(pi(13));return d.sliceCaseReducersByType[P]=A,f},addMatcher(C,A){return d.sliceMatchers.push({matcher:C,reducer:A}),f},exposeAction(C,A){return d.actionCreators[C]=A,f},exposeCaseReducer(C,A){return d.sliceCaseReducersByName[C]=A,f}};u.forEach(C=>{const A=l[C],P={reducerName:C,type:Jhe(i,C),createNotation:typeof r.reducers=="function"};ipe(A)?spe(P,A,f,t):rpe(P,A,f)});function p(){const[C={},A=[],P=void 0]=typeof r.extraReducers=="function"?m6(r.extraReducers):[r.extraReducers],O={...C,...d.sliceCaseReducersByType};return Yhe(r.initialState,_=>{for(let T in O)_.addCase(T,O[T]);for(let T of d.sliceMatchers)_.addMatcher(T.matcher,T.reducer);for(let T of A)_.addMatcher(T.matcher,T.reducer);P&&_.addDefaultCase(P)})}const m=C=>C,g=new Map,v=new WeakMap;let S;function b(C,A){return S||(S=p()),S(C,A)}function j(){return S||(S=p()),S.getInitialState()}function k(C,A=!1){function P(_){let T=_[C];return typeof T>"u"&&A&&(T=pg(v,P,j)),T}function O(_=m){const T=pg(g,A,()=>new WeakMap);return pg(T,_,()=>{const $={};for(const[F,U]of Object.entries(r.selectors??{}))$[F]=tpe(U,_,()=>pg(v,_,j),A);return $})}return{reducerPath:C,getSelectors:O,get selectors(){return O(P)},selectSlice:P}}const E={name:i,reducer:b,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:j,...k(a),injectInto(C,{reducerPath:A,...P}={}){const O=A??a;return C.inject({reducerPath:O,reducer:b},P),{...E,...k(O,!0)}}};return E}}function tpe(e,t,n,r){function i(a,...l){let u=t(a);return typeof u>"u"&&r&&(u=n()),e(u,...l)}return i.unwrapped=e,i}var Ar=epe();function npe(){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 rpe({type:e,reducerName:t,createNotation:n},r,i){let a,l;if("reducer"in r){if(n&&!ape(r))throw new Error(pi(17));a=r.reducer,l=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,l?gi(e,l):gi(e))}function ipe(e){return e._reducerDefinitionType==="asyncThunk"}function ape(e){return e._reducerDefinitionType==="reducerWithPrepare"}function spe({type:e,reducerName:t},n,r,i){if(!i)throw new Error(pi(18));const{payloadCreator:a,fulfilled:l,pending:u,rejected:d,settled:f,options:p}=n,m=i(e,a,p);r.exposeAction(t,m),l&&r.addCase(m.fulfilled,l),u&&r.addCase(m.pending,u),d&&r.addCase(m.rejected,d),f&&r.addMatcher(m.settled,f),r.exposeCaseReducer(t,{fulfilled:l||mg,pending:u||mg,rejected:d||mg,settled:f||mg})}function mg(){}var ope="task",g6="listener",y6="completed",cC="cancelled",lpe=`task-${cC}`,cpe=`task-${y6}`,$1=`${g6}-${cC}`,upe=`${g6}-${y6}`,px=class{constructor(e){this.code=e,this.message=`${ope} ${cC} (reason: ${e})`}name="TaskAbortError";message},uC=(e,t)=>{if(typeof e!="function")throw new TypeError(pi(32))},Ty=()=>{},v6=(e,t=Ty)=>(e.catch(t),e),x6=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Ql=e=>{if(e.aborted)throw new px(e.reason)};function b6(e,t){let n=Ty;return new Promise((r,i)=>{const a=()=>i(new px(e.reason));if(e.aborted){a();return}n=x6(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Ty})}var dpe=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof px?"cancelled":"rejected",error:n}}finally{t?.()}},Ry=e=>t=>v6(b6(e,t).then(n=>(Ql(e),n))),w6=e=>{const t=Ry(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Fu}=Object,QR={},mx="listenerMiddleware",fpe=(e,t)=>{const n=r=>x6(e,()=>r.abort(e.reason));return(r,i)=>{uC(r);const a=new AbortController;n(a);const l=dpe(async()=>{Ql(e),Ql(a.signal);const u=await r({pause:Ry(a.signal),delay:w6(a.signal),signal:a.signal});return Ql(a.signal),u},()=>a.abort(cpe));return i?.autoJoin&&t.push(l.catch(Ty)),{result:Ry(e)(l),cancel(){a.abort(lpe)}}}},hpe=(e,t)=>{const n=async(r,i)=>{Ql(t);let a=()=>{};const u=[new Promise((d,f)=>{let p=e({predicate:r,effect:(m,g)=>{g.unsubscribe(),d([m,g.getState(),g.getOriginalState()])}});a=()=>{p(),f()}})];i!=null&&u.push(new Promise(d=>setTimeout(d,i,null)));try{const d=await b6(t,Promise.race(u));return Ql(t),d}finally{a()}};return(r,i)=>v6(n(r,i))},S6=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=gi(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(pi(21));return uC(a),{predicate:i,type:t,effect:a}},j6=Fu(e=>{const{type:t,predicate:n,effect:r}=S6(e);return{id:Zhe(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(pi(22))}}},{withTypes:()=>j6}),YR=(e,t)=>{const{type:n,effect:r,predicate:i}=S6(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},B1=e=>{e.pending.forEach(t=>{t.abort($1)})},ppe=(e,t)=>()=>{for(const n of t.keys())B1(n);e.clear()},WR=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},N6=Fu(gi(`${mx}/add`),{withTypes:()=>N6}),mpe=gi(`${mx}/removeAll`),k6=Fu(gi(`${mx}/remove`),{withTypes:()=>k6}),gpe=(...e)=>{console.error(`${mx}/error`,...e)},rp=(e={})=>{const t=new Map,n=new Map,r=v=>{const S=n.get(v)??0;n.set(v,S+1)},i=v=>{const S=n.get(v)??1;S===1?n.delete(v):n.set(v,S-1)},{extra:a,onError:l=gpe}=e;uC(l);const u=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),S=>{v.unsubscribe(),S?.cancelActive&&B1(v)}),d=v=>{const S=YR(t,v)??j6(v);return u(S)};Fu(d,{withTypes:()=>d});const f=v=>{const S=YR(t,v);return S&&(S.unsubscribe(),v.cancelActive&&B1(S)),!!S};Fu(f,{withTypes:()=>f});const p=async(v,S,b,j)=>{const k=new AbortController,E=hpe(d,k.signal),C=[];try{v.pending.add(k),r(v),await Promise.resolve(v.effect(S,Fu({},b,{getOriginalState:j,condition:(A,P)=>E(A,P).then(Boolean),take:E,delay:w6(k.signal),pause:Ry(k.signal),extra:a,signal:k.signal,fork:fpe(k.signal,C),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((A,P,O)=>{A!==k&&(A.abort($1),O.delete(A))})},cancel:()=>{k.abort($1),v.pending.delete(k)},throwIfCancelled:()=>{Ql(k.signal)}})))}catch(A){A instanceof px||WR(l,A,{raisedBy:"effect"})}finally{await Promise.all(C),k.abort(upe),i(v),v.pending.delete(k)}},m=ppe(t,n);return{middleware:v=>S=>b=>{if(!e6(b))return S(b);if(N6.match(b))return d(b.payload);if(mpe.match(b)){m();return}if(k6.match(b))return f(b.payload);let j=v.getState();const k=()=>{if(j===QR)throw new Error(pi(23));return j};let E;try{if(E=S(b),t.size>0){const C=v.getState(),A=Array.from(t.values());for(const P of A){let O=!1;try{O=P.predicate(b,C,j)}catch(_){O=!1,WR(l,_,{raisedBy:"predicate"})}O&&p(P,b,v,k)}}}finally{j=QR}return E},startListening:d,stopListening:f,clearListeners:m}};function pi(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 ype={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},C6=Ar({name:"chartLayout",initialState:ype,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,a;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=(a=t.payload.left)!==null&&a!==void 0?a:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:vpe,setLayout:xpe,setChartSize:bpe,setScale:wpe}=C6.actions,Spe=C6.reducer;function A6(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function ht(e){return Number.isFinite(e)}function Ha(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function ZR(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 Pu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZR(Object(n),!0).forEach(function(r){jpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jpe(e,t,n){return(t=Npe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Npe(e){var t=kpe(e,"string");return typeof t=="symbol"?t:t+""}function kpe(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 vn(e,t,n){return ln(e)||ln(t)?n:Fa(t)?nd(e,t,n):typeof t=="function"?t(e):n}var Cpe=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:l,layout:u}=t;if((u==="vertical"||u==="horizontal"&&l==="middle")&&a!=="center"&&Pe(e[a]))return Pu(Pu({},e),{},{[a]:e[a]+(r||0)});if((u==="horizontal"||u==="vertical"&&a==="center")&&l!=="middle"&&Pe(e[l]))return Pu(Pu({},e),{},{[l]:e[l]+(i||0)})}return e},va=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",O6=(e,t,n,r)=>{if(r)return e.map(u=>u.coordinate);var i,a,l=e.map(u=>(u.coordinate===t&&(i=!0),u.coordinate===n&&(a=!0),u.coordinate));return i||l.push(t),a||l.push(n),l},E6=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:l,realScaleType:u,isCategorical:d,categoricalDomain:f,tickCount:p,ticks:m,niceTicks:g,axisType:v}=e;if(!l)return null;var S=u==="scaleBand"&&l.bandwidth?l.bandwidth()/2:2,b=i==="category"&&l.bandwidth?l.bandwidth()/S:0;if(b=v==="angleAxis"&&a&&a.length>=2?Qr(a[0]-a[1])*2*b:b,m||g){var j=(m||g||[]).map((k,E)=>{var C=r?r.indexOf(k):k,A=l.map(C);return ht(A)?{coordinate:A+b,value:k,offset:b,index:E}:null}).filter(Yr);return j}return d&&f?f.map((k,E)=>{var C=l.map(k);return ht(C)?{coordinate:C+b,value:k,index:E,offset:b}:null}).filter(Yr):l.ticks&&p!=null?l.ticks(p).map((k,E)=>{var C=l.map(k);return ht(C)?{coordinate:C+b,value:k,index:E,offset:b}:null}).filter(Yr):l.domain().map((k,E)=>{var C=l.map(k);return ht(C)?{coordinate:C+b,value:r?r[k]:k,index:E,offset:b}:null}).filter(Yr)},Ape=(e,t)=>{if(!t||t.length!==2||!Pe(t[0])||!Pe(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!Pe(e[0])||e[0]<n)&&(i[0]=n),(!Pe(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},Ope=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 a=0,l=0,u=0;u<n;++u){var d=e[u],f=d?.[i];if(f!=null){var p=f[1],m=f[0],g=da(p)?m:p;g>=0?(f[0]=a,a+=g,f[1]=a):(f[0]=l,l+=g,f[1]=l)}}}},Epe=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 a=0,l=0;l<n;++l){var u=e[l],d=u?.[i];if(d!=null){var f=da(d[1])?d[0]:d[1];f>=0?(d[0]=a,a+=f,d[1]=a):(d[0]=0,d[1]=0)}}}},_pe={sign:Ope,expand:tfe,none:ac,silhouette:nfe,wiggle:rfe,positive:Epe},zpe=(e,t,n)=>{var r,i=(r=_pe[n])!==null&&r!==void 0?r:ac,a=efe().keys(t).value((u,d)=>Number(vn(u,d,0))).order(E1).offset(i),l=a(e);return l.forEach((u,d)=>{u.forEach((f,p)=>{var m=vn(e[p],t[d],0);Array.isArray(m)&&m.length===2&&Pe(m[0])&&Pe(m[1])&&(f[0]=m[0],f[1]=m[1])})}),l};function _6(e){return e==null?void 0:String(e)}function Dy(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:l}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!ln(i[t.dataKey])){var u=TB(n,"value",i[t.dataKey]);if(u)return u.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var d=vn(i,ln(l)?t.dataKey:l),f=t.scale.map(d);return Pe(f)?f:null}var XR=e=>{var{axis:t,ticks:n,offset:r,bandSize:i,entry:a,index:l}=e;if(t.type==="category")return n[l]?n[l].coordinate+r:null;var u=vn(a,t.dataKey,t.scale.domain()[l]);if(ln(u))return null;var d=t.scale.map(u);return Pe(d)?d-i/2+r:null},Ppe=e=>{var{numericAxis:t}=e,n=t.scale.domain();if(t.type==="number"){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},Tpe=e=>{var t=e.flat(2).filter(Pe);return[Math.min(...t),Math.max(...t)]},Rpe=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],Dpe=(e,t,n)=>{if(e!=null)return Rpe(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:l}=a,u=l.reduce((d,f)=>{var p=A6(f,t,n),m=Tpe(p);return!ht(m[0])||!ht(m[1])?d:[Math.min(d[0],m[0]),Math.max(d[1],m[1])]},[1/0,-1/0]);return[Math.min(u[0],r[0]),Math.max(u[1],r[1])]},[1/0,-1/0]))},JR=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,eD=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Ko=(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=sx(t,p=>p.coordinate),a=1/0,l=1,u=i.length;l<u;l++){var d=i[l],f=i[l-1];a=Math.min((d?.coordinate||0)-(f?.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0};function tD(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return Pu(Pu({},t),{},{dataKey:n,payload:r,value:i,name:a})}function Cd(e,t){if(e)return String(e);if(typeof t=="string")return t}var Mpe=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},Ipe=(e,t)=>t==="centric"?e.angle:e.radius,$s=e=>e.layout.width,Bs=e=>e.layout.height,Lpe=e=>e.layout.scale,z6=e=>e.layout.margin,gx=re(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),yx=re(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),$pe="data-recharts-item-index",Bpe="data-recharts-item-id",ip=60;function nD(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 gg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nD(Object(n),!0).forEach(function(r){Upe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Upe(e,t,n){return(t=qpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qpe(e){var t=Fpe(e,"string");return typeof t=="symbol"?t:t+""}function Fpe(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 Hpe=e=>e.brush.height;function Kpe(e){var t=yx(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:ip;return n+i}return n},0)}function Gpe(e){var t=yx(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:ip;return n+i}return n},0)}function Vpe(e){var t=gx(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function Qpe(e){var t=gx(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var tr=re([$s,Bs,z6,Hpe,Kpe,Gpe,Vpe,Qpe,WB,xhe],(e,t,n,r,i,a,l,u,d,f)=>{var p={left:(n.left||0)+i,right:(n.right||0)+a},m={top:(n.top||0)+l,bottom:(n.bottom||0)+u},g=gg(gg({},m),p),v=g.bottom;g.bottom+=r,g=Cpe(g,d,f);var S=e-g.left-g.right,b=t-g.top-g.bottom;return gg(gg({brushBottom:v},g),{},{width:Math.max(S,0),height:Math.max(b,0)})}),Ype=re(tr,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),dC=re($s,Bs,(e,t)=>({x:0,y:0,width:e,height:t})),Wpe=x.createContext(null),nr=()=>x.useContext(Wpe)!=null,vx=e=>e.brush,xx=re([vx,tr,z6],(e,t,n)=>({height:e.height,x:Pe(e.x)?e.x:t.left,y:Pe(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:Pe(e.width)?e.width:t.width})),QS={},YS={},WS={},rD;function Zpe(){return rD||(rD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:a}={}){let l,u=null;const d=a!=null&&a.includes("leading"),f=a==null||a.includes("trailing"),p=()=>{u!==null&&(n.apply(l,u),l=void 0,u=null)},m=()=>{f&&p(),b()};let g=null;const v=()=>{g!=null&&clearTimeout(g),g=setTimeout(()=>{g=null,m()},r)},S=()=>{g!==null&&(clearTimeout(g),g=null)},b=()=>{S(),l=void 0,u=null},j=()=>{p()},k=function(...E){if(i?.aborted)return;l=this,u=E;const C=g==null;v(),d&&C&&p()};return k.schedule=v,k.cancel=b,k.flush=j,i?.addEventListener("abort",b,{once:!0}),k}e.debounce=t})(WS)),WS}var iD;function Xpe(){return iD||(iD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Zpe();function n(r,i=0,a={}){typeof a!="object"&&(a={});const{leading:l=!1,trailing:u=!0,maxWait:d}=a,f=Array(2);l&&(f[0]="leading"),u&&(f[1]="trailing");let p,m=null;const g=t.debounce(function(...b){p=r.apply(this,b),m=null},i,{edges:f}),v=function(...b){return d!=null&&(m===null&&(m=Date.now()),Date.now()-m>=d)?(p=r.apply(this,b),m=Date.now(),g.cancel(),g.schedule(),p):(g.apply(this,b),p)},S=()=>(g.flush(),p);return v.cancel=g.cancel,v.flush=S,v}e.debounce=n})(YS)),YS}var aD;function Jpe(){return aD||(aD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Xpe();function n(r,i=0,a={}){const{leading:l=!0,trailing:u=!0}=a;return t.debounce(r,i,{leading:l,maxWait:i,trailing:u})}e.throttle=n})(QS)),QS}var ZS,sD;function eme(){return sD||(sD=1,ZS=Jpe().throttle),ZS}var tme=eme();const nme=pa(tme);var My=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];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++]))}},Ma={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},P6=(e,t,n)=>{var{width:r=Ma.width,height:i=Ma.height,aspect:a,maxHeight:l}=n,u=sc(r)?e:Number(r),d=sc(i)?t:Number(i);return a&&a>0&&(u?d=u/a:d&&(u=d*a),l&&d!=null&&d>l&&(d=l)),{calculatedWidth:u,calculatedHeight:d}},rme={width:0,height:0,overflow:"visible"},ime={width:0,overflowX:"visible"},ame={height:0,overflowY:"visible"},sme={},ome=e=>{var{width:t,height:n}=e,r=sc(t),i=sc(n);return r&&i?rme:r?ime:i?ame:sme};function lme(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=Ma.width,a=Ma.height):i===void 0?i=r&&r>0?void 0:Ma.width:a===void 0&&(a=r&&r>0?void 0:Ma.height),{width:i,height:a}}function U1(){return U1=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},U1.apply(null,arguments)}function oD(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 lD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oD(Object(n),!0).forEach(function(r){cme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cme(e,t,n){return(t=ume(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ume(e){var t=dme(e,"string");return typeof t=="symbol"?t:t+""}function dme(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 T6=x.createContext(Ma.initialDimension);function fme(e){return Ha(e.width)&&Ha(e.height)}function R6(e){var{children:t,width:n,height:r}=e,i=x.useMemo(()=>({width:n,height:r}),[n,r]);return fme(i)?x.createElement(T6.Provider,{value:i},t):null}var fC=()=>x.useContext(T6),hme=x.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=Ma.initialDimension,width:i,height:a,minWidth:l=Ma.minWidth,minHeight:u,maxHeight:d,children:f,debounce:p=Ma.debounce,id:m,className:g,onResize:v,style:S={}}=e,b=x.useRef(null),j=x.useRef();j.current=v,x.useImperativeHandle(t,()=>b.current);var[k,E]=x.useState({containerWidth:r.width,containerHeight:r.height}),C=x.useCallback((T,$)=>{E(F=>{var U=Math.round(T),B=Math.round($);return F.containerWidth===U&&F.containerHeight===B?F:{containerWidth:U,containerHeight:B}})},[]);x.useEffect(()=>{if(b.current==null||typeof ResizeObserver>"u")return Jo;var T=B=>{var V,X=B[0];if(X!=null){var{width:Z,height:H}=X.contentRect;C(Z,H),(V=j.current)===null||V===void 0||V.call(j,Z,H)}};p>0&&(T=nme(T,p,{trailing:!0,leading:!1}));var $=new ResizeObserver(T),{width:F,height:U}=b.current.getBoundingClientRect();return C(F,U),$.observe(b.current),()=>{$.disconnect()}},[C,p]);var{containerWidth:A,containerHeight:P}=k;My(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:O,calculatedHeight:_}=P6(A,P,{width:i,height:a,aspect:n,maxHeight:d});return My(O!=null&&O>0||_!=null&&_>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
258
|
-
please check the style of container, or the props width(%s) and height(%s),
|
|
259
|
-
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
260
|
-
height and width.`,O,_,i,a,l,u,n),x.createElement("div",{id:m?"".concat(m):void 0,className:At("recharts-responsive-container",g),style:lD(lD({},S),{},{width:i,height:a,minWidth:l,minHeight:u,maxHeight:d}),ref:b},x.createElement("div",{style:ome({width:i,height:a})},x.createElement(R6,{width:O,height:_},f)))}),zs=x.forwardRef((e,t)=>{var n=fC();if(Ha(n.width)&&Ha(n.height))return e.children;var{width:r,height:i}=lme({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:l}=P6(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Pe(a)&&Pe(l)?x.createElement(R6,{width:a,height:l},e.children):x.createElement(hme,U1({},e,{width:r,height:i,ref:t}))});function hC(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 bx=()=>{var e,t=nr(),n=Ue(Ype),r=Ue(xx),i=(e=Ue(vx))===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}},pme={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},D6=()=>{var e;return(e=Ue(tr))!==null&&e!==void 0?e:pme},pC=()=>Ue($s),mC=()=>Ue(Bs),mme=()=>Ue(e=>e.layout.margin),Et=e=>e.layout.layoutType,el=()=>Ue(Et),gC=()=>{var e=el();if(e==="horizontal"||e==="vertical")return e},M6=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},gme=()=>{var e=el();return e!==void 0},ap=e=>{var t=cn(),n=nr(),{width:r,height:i}=e,a=fC(),l=r,u=i;return a&&(l=a.width>0?a.width:r,u=a.height>0?a.height:i),x.useEffect(()=>{!n&&Ha(l)&&Ha(u)&&t(bpe({width:l,height:u}))},[t,n,l,u]),null},I6=Symbol.for("immer-nothing"),cD=Symbol.for("immer-draftable"),yi=Symbol.for("immer-state");function oa(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ph=Object.getPrototypeOf;function id(e){return!!e&&!!e[yi]}function lc(e){return e?L6(e)||Array.isArray(e)||!!e[cD]||!!e.constructor?.[cD]||sp(e)||Sx(e):!1}var yme=Object.prototype.constructor.toString(),uD=new WeakMap;function L6(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=uD.get(n);return r===void 0&&(r=Function.toString.call(n),uD.set(n,r)),r===yme}function Iy(e,t,n=!0){wx(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 wx(e){const t=e[yi];return t?t.type_:Array.isArray(e)?1:sp(e)?2:Sx(e)?3:0}function q1(e,t){return wx(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function $6(e,t,n){const r=wx(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function vme(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function sp(e){return e instanceof Map}function Sx(e){return e instanceof Set}function Pl(e){return e.copy_||e.base_}function F1(e,t){if(sp(e))return new Map(e);if(Sx(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=L6(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[yi];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const l=i[a],u=r[l];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(r[l]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[l]})}return Object.create(Ph(e),r)}else{const r=Ph(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function yC(e,t=!1){return jx(e)||id(e)||!lc(e)||(wx(e)>1&&Object.defineProperties(e,{set:yg,add:yg,clear:yg,delete:yg}),Object.freeze(e),t&&Object.values(e).forEach(n=>yC(n,!0))),e}function xme(){oa(2)}var yg={value:xme};function jx(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var bme={};function cc(e){const t=bme[e];return t||oa(0,e),t}var Th;function B6(){return Th}function wme(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function dD(e,t){t&&(cc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function H1(e){K1(e),e.drafts_.forEach(Sme),e.drafts_=null}function K1(e){e===Th&&(Th=e.parent_)}function fD(e){return Th=wme(Th,e)}function Sme(e){const t=e[yi];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function hD(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[yi].modified_&&(H1(t),oa(4)),lc(e)&&(e=Ly(t,e),t.parent_||$y(t,e)),t.patches_&&cc("Patches").generateReplacementPatches_(n[yi].base_,e,t.patches_,t.inversePatches_)):e=Ly(t,n,[]),H1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==I6?e:void 0}function Ly(e,t,n){if(jx(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[yi];if(!i)return Iy(t,(a,l)=>pD(e,i,t,a,l,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return $y(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let l=a,u=!1;i.type_===3&&(l=new Set(a),a.clear(),u=!0),Iy(l,(d,f)=>pD(e,i,a,d,f,n,u),r),$y(e,a,!1),n&&e.patches_&&cc("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function pD(e,t,n,r,i,a,l){if(i==null||typeof i!="object"&&!l)return;const u=jx(i);if(!(u&&!l)){if(id(i)){const d=a&&t&&t.type_!==3&&!q1(t.assigned_,r)?a.concat(r):void 0,f=Ly(e,i,d);if($6(n,r,f),id(f))e.canAutoFreeze_=!1;else return}else l&&n.add(i);if(lc(i)&&!u){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&u)return;Ly(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(sp(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&$y(e,i)}}}function $y(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&yC(t,n)}function jme(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:B6(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=vC;n&&(i=[r],a=Rh);const{revoke:l,proxy:u}=Proxy.revocable(i,a);return r.draft_=u,r.revoke_=l,u}var vC={get(e,t){if(t===yi)return e;const n=Pl(e);if(!q1(n,t))return Nme(e,n,t);const r=n[t];return e.finalized_||!lc(r)?r:r===XS(e.base_,t)?(JS(e),e.copy_[t]=V1(r,e)):r},has(e,t){return t in Pl(e)},ownKeys(e){return Reflect.ownKeys(Pl(e))},set(e,t,n){const r=U6(Pl(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=XS(Pl(e),t),a=i?.[yi];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(vme(n,i)&&(n!==void 0||q1(e.base_,t)))return!0;JS(e),G1(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 XS(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,JS(e),G1(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Pl(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){oa(11)},getPrototypeOf(e){return Ph(e.base_)},setPrototypeOf(){oa(12)}},Rh={};Iy(vC,(e,t)=>{Rh[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Rh.deleteProperty=function(e,t){return Rh.set.call(this,e,t,void 0)};Rh.set=function(e,t,n){return vC.set.call(this,e[0],t,n,e[0])};function XS(e,t){const n=e[yi];return(n?Pl(n):e)[t]}function Nme(e,t,n){const r=U6(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function U6(e,t){if(!(t in e))return;let n=Ph(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Ph(n)}}function G1(e){e.modified_||(e.modified_=!0,e.parent_&&G1(e.parent_))}function JS(e){e.copy_||(e.copy_=F1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var kme=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 a=n;n=t;const l=this;return function(d=a,...f){return l.produce(d,p=>n.call(this,p,...f))}}typeof n!="function"&&oa(6),r!==void 0&&typeof r!="function"&&oa(7);let i;if(lc(t)){const a=fD(this),l=V1(t,void 0);let u=!0;try{i=n(l),u=!1}finally{u?H1(a):K1(a)}return dD(a,r),hD(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===I6&&(i=void 0),this.autoFreeze_&&yC(i,!0),r){const a=[],l=[];cc("Patches").generateReplacementPatches_(t,i,a,l),r(a,l)}return i}else oa(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(l,...u)=>this.produceWithPatches(l,d=>t(d,...u));let r,i;return[this.produce(t,n,(l,u)=>{r=l,i=u}),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){lc(e)||oa(8),id(e)&&(e=Cme(e));const t=fD(this),n=V1(e,void 0);return n[yi].isManual_=!0,K1(t),n}finishDraft(e,t){const n=e&&e[yi];(!n||!n.isManual_)&&oa(9);const{scope_:r}=n;return dD(r,t),hD(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=cc("Patches").applyPatches_;return id(e)?r(e,t):this.produce(e,i=>r(i,t))}};function V1(e,t){const n=sp(e)?cc("MapSet").proxyMap_(e,t):Sx(e)?cc("MapSet").proxySet_(e,t):jme(e,t);return(t?t.scope_:B6()).drafts_.push(n),n}function Cme(e){return id(e)||oa(10,e),q6(e)}function q6(e){if(!lc(e)||jx(e))return e;const t=e[yi];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=F1(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=F1(e,!0);return Iy(n,(i,a)=>{$6(n,i,q6(a))},r),t&&(t.finalized_=!1),n}var Ame=new kme;Ame.produce;var Ome={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},F6=Ar({name:"legend",initialState:Ome,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:sn()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Bi(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:sn()},removeLegendPayload:{reducer(e,t){var n=Bi(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:sn()}}}),{setLegendSize:mD,setLegendSettings:Eme,addLegendPayload:_me,replaceLegendPayload:zme,removeLegendPayload:Pme}=F6.actions,Tme=F6.reducer,ej={exports:{}},tj={};var gD;function Rme(){if(gD)return tj;gD=1;var e=gd();function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,a=e.useEffect,l=e.useMemo,u=e.useDebugValue;return tj.useSyncExternalStoreWithSelector=function(d,f,p,m,g){var v=i(null);if(v.current===null){var S={hasValue:!1,value:null};v.current=S}else S=v.current;v=l(function(){function j(P){if(!k){if(k=!0,E=P,P=m(P),g!==void 0&&S.hasValue){var O=S.value;if(g(O,P))return C=O}return C=P}if(O=C,n(E,P))return O;var _=m(P);return g!==void 0&&g(O,_)?(E=P,O):(E=P,C=_)}var k=!1,E,C,A=p===void 0?null:p;return[function(){return j(f())},A===null?void 0:function(){return j(A())}]},[f,p,m,g]);var b=r(d,v[0],v[1]);return a(function(){S.hasValue=!0,S.value=b},[b]),u(b),b},tj}var yD;function Dme(){return yD||(yD=1,ej.exports=Rme()),ej.exports}Dme();function Mme(e){e()}function Ime(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Mme(()=>{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 vD={notify(){},get:()=>[]};function Lme(e,t){let n,r=vD,i=0,a=!1;function l(b){p();const j=r.subscribe(b);let k=!1;return()=>{k||(k=!0,j(),m())}}function u(){r.notify()}function d(){S.onStateChange&&S.onStateChange()}function f(){return a}function p(){i++,n||(n=e.subscribe(d),r=Ime())}function m(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=vD)}function g(){a||(a=!0,p())}function v(){a&&(a=!1,m())}const S={addNestedSub:l,notifyNestedSubs:u,handleChangeWrapper:d,isSubscribed:f,trySubscribe:g,tryUnsubscribe:v,getListeners:()=>r};return S}var $me=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Bme=$me(),Ume=()=>typeof navigator<"u"&&navigator.product==="ReactNative",qme=Ume(),Fme=()=>Bme||qme?x.useLayoutEffect:x.useEffect,Hme=Fme();function xD(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Kme(e,t){if(xD(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])||!xD(e[n[i]],t[n[i]]))return!1;return!0}var Gme=Symbol.for("react-redux-context"),Vme=typeof globalThis<"u"?globalThis:{};function Qme(){if(!x.createContext)return{};const e=Vme[Gme]??=new Map;let t=e.get(x.createContext);return t||(t=x.createContext(null),e.set(x.createContext,t)),t}var Yme=Qme();function Wme(e){const{children:t,context:n,serverState:r,store:i}=e,a=x.useMemo(()=>{const d=Lme(i);return{store:i,subscription:d,getServerState:r?()=>r:void 0}},[i,r]),l=x.useMemo(()=>i.getState(),[i]);Hme(()=>{const{subscription:d}=a;return d.onStateChange=d.notifyNestedSubs,d.trySubscribe(),l!==i.getState()&&d.notifyNestedSubs(),()=>{d.tryUnsubscribe(),d.onStateChange=void 0}},[a,l]);const u=n||Yme;return x.createElement(u.Provider,{value:a},t)}var Zme=Wme,Xme=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function Jme(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Nc(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(Xme.has(r)){if(e[r]==null&&t[r]==null)continue;if(!Kme(e[r],t[r]))return!1}else if(!Jme(e[r],t[r]))return!1;return!0}var ege=["contextPayload"];function Q1(){return Q1=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},Q1.apply(null,arguments)}function bD(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 ad(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bD(Object(n),!0).forEach(function(r){tge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tge(e,t,n){return(t=nge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nge(e){var t=rge(e,"string");return typeof t=="symbol"?t:t+""}function rge(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 ige(e,t){if(e==null)return{};var n,r,i=age(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[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}function sge(e){return e.value}function oge(e){var{contextPayload:t}=e,n=ige(e,ege),r=GB(t,e.payloadUniqBy,sge),i=ad(ad({},n),{},{payload:r});return x.isValidElement(e.content)?x.cloneElement(e.content,i):typeof e.content=="function"?x.createElement(e.content,i):x.createElement(Pfe,i)}function lge(e,t,n,r,i,a){var{layout:l,align:u,verticalAlign:d}=t,f,p;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(u==="center"&&l==="vertical"?f={left:((r||0)-a.width)/2}:f=u==="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))&&(d==="middle"?p={top:((i||0)-a.height)/2}:p=d==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),ad(ad({},f),p)}function cge(e){var t=cn();return x.useEffect(()=>{t(Eme(e))},[t,e]),null}function uge(e){var t=cn();return x.useEffect(()=>(t(mD(e)),()=>{t(mD({width:0,height:0}))}),[t,e]),null}function dge(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var fge={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function hge(e){var t=er(e,fge),n=She(),r=Nde(),i=mme(),{width:a,height:l,wrapperStyle:u,portal:d}=t,[f,p]=ZB([n]),m=pC(),g=mC();if(m==null||g==null)return null;var v=m-(i?.left||0)-(i?.right||0),S=dge(t.layout,l,a,v),b=d?u:ad(ad({position:"absolute",width:S?.width||a||"auto",height:S?.height||l||"auto"},lge(u,t,i,m,g,f)),u),j=d??r;if(j==null||n==null)return null;var k=x.createElement("div",{className:"recharts-legend-wrapper",style:b,ref:p},x.createElement(cge,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!d&&x.createElement(uge,{width:f.width,height:f.height}),x.createElement(oge,Q1({},t,S,{margin:i,chartWidth:m,chartHeight:g,contextPayload:n})));return gc.createPortal(k,j)}var H6=x.memo(hge,Nc);H6.displayName="Legend";function Y1(){return Y1=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},Y1.apply(null,arguments)}function wD(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 qf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wD(Object(n),!0).forEach(function(r){pge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pge(e,t,n){return(t=mge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mge(e){var t=gge(e,"string");return typeof t=="symbol"?t:t+""}function gge(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 yge(e){return Array.isArray(e)&&Fa(e[0])&&Fa(e[1])?e.join(" ~ "):e}var gu={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 vge(e,t){return t==null?e:sx(e,t)}var xge=e=>{var{separator:t=gu.separator,contentStyle:n,itemStyle:r,labelStyle:i=gu.labelStyle,payload:a,formatter:l,itemSorter:u,wrapperClassName:d,labelClassName:f,label:p,labelFormatter:m,accessibilityLayer:g=gu.accessibilityLayer}=e,v=()=>{if(a&&a.length){var P={padding:0,margin:0},O=vge(a,u),_=O.map((T,$)=>{if(!T||T.type==="none")return null;var F=T.formatter||l||yge,{value:U,name:B}=T,V=U,X=B;if(F){var Z=F(U,B,T,$,a);if(Array.isArray(Z))[V,X]=Z;else if(Z!=null)V=Z;else return null}var H=qf(qf({},gu.itemStyle),{},{color:T.color||gu.itemStyle.color},r);return x.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat($),style:H},Fa(X)?x.createElement("span",{className:"recharts-tooltip-item-name"},X):null,Fa(X)?x.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,x.createElement("span",{className:"recharts-tooltip-item-value"},V),x.createElement("span",{className:"recharts-tooltip-item-unit"},T.unit||""))});return x.createElement("ul",{className:"recharts-tooltip-item-list",style:P},_)}return null},S=qf(qf({},gu.contentStyle),n),b=qf({margin:0},i),j=!ln(p),k=j?p:"",E=At("recharts-default-tooltip",d),C=At("recharts-tooltip-label",f);j&&m&&a!==void 0&&a!==null&&(k=m(p,a));var A=g?{role:"status","aria-live":"assertive"}:{};return x.createElement("div",Y1({className:E,style:S},A),x.createElement("p",{className:C,style:b},x.isValidElement(k)?k:"".concat(k)),v())},Ff="recharts-tooltip-wrapper",bge={visibility:"hidden"};function wge(e){var{coordinate:t,translateX:n,translateY:r}=e;return At(Ff,{["".concat(Ff,"-right")]:Pe(n)&&t&&Pe(t.x)&&n>=t.x,["".concat(Ff,"-left")]:Pe(n)&&t&&Pe(t.x)&&n<t.x,["".concat(Ff,"-bottom")]:Pe(r)&&t&&Pe(t.y)&&r>=t.y,["".concat(Ff,"-top")]:Pe(r)&&t&&Pe(t.y)&&r<t.y})}function SD(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:l,tooltipDimension:u,viewBox:d,viewBoxDimension:f}=e;if(a&&Pe(a[r]))return a[r];var p=n[r]-u-(i>0?i:0),m=n[r]+i;if(t[r])return l[r]?p:m;var g=d[r];if(g==null)return 0;if(l[r]){var v=p,S=g;return v<S?Math.max(m,g):Math.max(p,g)}if(f==null)return 0;var b=m+u,j=g+f;return b>j?Math.max(p,g):Math.max(m,g)}function Sge(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 jge(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:l,tooltipBox:u,useTranslate3d:d,viewBox:f}=e,p,m,g;return u.height>0&&u.width>0&&n?(m=SD({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:l,tooltipDimension:u.width,viewBox:f,viewBoxDimension:f.width}),g=SD({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:l,tooltipDimension:u.height,viewBox:f,viewBoxDimension:f.height}),p=Sge({translateX:m,translateY:g,useTranslate3d:d})):p=bge,{cssProperties:p,cssClasses:wge({translateX:m,translateY:g,coordinate:n})}}var Nge=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),op={isSsr:Nge()};function K6(){var[e,t]=x.useState(()=>op.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 jD(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 yu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jD(Object(n),!0).forEach(function(r){kge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kge(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=Age(e,"string");return typeof t=="symbol"?t:t+""}function Age(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 Oge(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function Ege(e){var t,n,r,i,a,l,u=K6(),[d,f]=x.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));x.useEffect(()=>{var S=b=>{if(b.key==="Escape"){var j,k,E,C;f({dismissed:!0,dismissedAtCoordinate:{x:(j=(k=e.coordinate)===null||k===void 0?void 0:k.x)!==null&&j!==void 0?j:0,y:(E=(C=e.coordinate)===null||C===void 0?void 0:C.y)!==null&&E!==void 0?E:0}})}};return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),d.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==d.dismissedAtCoordinate.x||((a=(l=e.coordinate)===null||l===void 0?void 0:l.y)!==null&&a!==void 0?a:0)!==d.dismissedAtCoordinate.y)&&f(yu(yu({},d),{},{dismissed:!1}));var{cssClasses:p,cssProperties:m}=jge({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}),g=e.hasPortalFromProps?{}:yu(yu({transition:Oge({prefersReducedMotion:u,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},m),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),v=yu(yu({},g),{},{visibility:!d.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return x.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:p,style:v,ref:e.innerRef},e.children)}var _ge=x.memo(Ege),G6=()=>{var e;return(e=Ue(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function W1(){return W1=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},W1.apply(null,arguments)}function ND(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 kD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ND(Object(n),!0).forEach(function(r){zge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ND(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zge(e,t,n){return(t=Pge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pge(e){var t=Tge(e,"string");return typeof t=="symbol"?t:t+""}function Tge(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 CD={curveBasisClosed:Fde,curveBasisOpen:Hde,curveBasis:qde,curveBumpX:Ode,curveBumpY:Ede,curveLinearClosed:Kde,curveLinear:rx,curveMonotoneX:Gde,curveMonotoneY:Vde,curveNatural:Qde,curveStep:Yde,curveStepAfter:Zde,curveStepBefore:Wde},By=e=>ht(e.x)&&ht(e.y),AD=e=>e.base!=null&&By(e.base)&&By(e),Hf=e=>e.x,Kf=e=>e.y,Rge=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(tp(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=CD["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return CD[n]||rx},OD={connectNulls:!1,type:"linear"},Dge=e=>{var{type:t=OD.type,points:n=[],baseLine:r,layout:i,connectNulls:a=OD.connectNulls}=e,l=Rge(t,i),u=a?n.filter(By):n;if(Array.isArray(r)){var d,f=n.map((S,b)=>kD(kD({},S),{},{base:r[b]}));i==="vertical"?d=ug().y(Kf).x1(Hf).x0(S=>S.base.x):d=ug().x(Hf).y1(Kf).y0(S=>S.base.y);var p=d.defined(AD).curve(l),m=a?f.filter(AD):f;return p(m)}var g;i==="vertical"&&Pe(r)?g=ug().y(Kf).x1(Hf).x0(r):Pe(r)?g=ug().x(Hf).y1(Kf).y0(r):g=bB().x(Hf).y(Kf);var v=g.defined(By).curve(l);return v(u)},hh=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=el();if((!n||!n.length)&&!r)return null;var l={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},u=n&&n.length?Dge(l):r;return x.createElement("path",W1({},mi(e),nC(e),{className:At("recharts-curve",t),d:u===null?void 0:u,ref:i}))},Mge=["x","y","top","left","width","height","className"];function Z1(){return Z1=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},Z1.apply(null,arguments)}function ED(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 Ige(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ED(Object(n),!0).forEach(function(r){Lge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ED(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lge(e,t,n){return(t=$ge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $ge(e){var t=Bge(e,"string");return typeof t=="symbol"?t:t+""}function Bge(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 Uge(e,t){if(e==null)return{};var n,r,i=qge(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function qge(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 Fge=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),Hge=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:l=0,className:u}=e,d=Uge(e,Mge),f=Ige({x:t,y:n,top:r,left:i,width:a,height:l},d);return!Pe(t)||!Pe(n)||!Pe(a)||!Pe(l)||!Pe(r)||!Pe(i)?null:x.createElement("path",Z1({},kr(f),{className:At("recharts-cross",u),d:Fge(t,n,a,l,r,i)}))};function Kge(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 _D(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 zD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_D(Object(n),!0).forEach(function(r){Gge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_D(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gge(e,t,n){return(t=Vge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vge(e){var t=Qge(e,"string");return typeof t=="symbol"?t:t+""}function Qge(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 Yge=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),V6=(e,t,n)=>e.map(r=>"".concat(Yge(r)," ").concat(t,"ms ").concat(n)).join(","),Wge=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),Dh=(e,t)=>Object.keys(t).reduce((n,r)=>zD(zD({},n),{},{[r]:e(r,t[r])}),{});function PD(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 Vn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PD(Object(n),!0).forEach(function(r){Zge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Zge(e,t,n){return(t=Xge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xge(e){var t=Jge(e,"string");return typeof t=="symbol"?t:t+""}function Jge(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 Uy=(e,t,n)=>e+(t-e)*n,X1=e=>{var{from:t,to:n}=e;return t!==n},Q6=(e,t,n)=>{var r=Dh((i,a)=>{if(X1(a)){var[l,u]=e(a.from,a.to,a.velocity);return Vn(Vn({},a),{},{from:l,velocity:u})}return a},t);return n<1?Dh((i,a)=>X1(a)&&r[i]!=null?Vn(Vn({},a),{},{velocity:Uy(a.velocity,r[i].velocity,n),from:Uy(a.from,r[i].from,n)}):a,t):Q6(e,r,n-1)};function eye(e,t,n,r,i,a){var l,u=r.reduce((g,v)=>Vn(Vn({},g),{},{[v]:{from:e[v],velocity:0,to:t[v]}}),{}),d=()=>Dh((g,v)=>v.from,u),f=()=>!Object.values(u).filter(X1).length,p=null,m=g=>{l||(l=g);var v=g-l,S=v/n.dt;u=Q6(n,u,S),i(Vn(Vn(Vn({},e),t),d())),l=g,f()||(p=a.setTimeout(m))};return()=>(p=a.setTimeout(m),()=>{var g;(g=p)===null||g===void 0||g()})}function tye(e,t,n,r,i,a,l){var u=null,d=i.reduce((m,g)=>{var v=e[g],S=t[g];return v==null||S==null?m:Vn(Vn({},m),{},{[g]:[v,S]})},{}),f,p=m=>{f||(f=m);var g=(m-f)/r,v=Dh((b,j)=>Uy(...j,n(g)),d);if(a(Vn(Vn(Vn({},e),t),v)),g<1)u=l.setTimeout(p);else{var S=Dh((b,j)=>Uy(...j,n(1)),d);a(Vn(Vn(Vn({},e),t),S))}};return()=>(u=l.setTimeout(p),()=>{var m;(m=u)===null||m===void 0||m()})}const nye=(e,t,n,r,i,a)=>{var l=Wge(e,t);return n==null?()=>(i(Vn(Vn({},e),t)),()=>{}):n.isStepper===!0?eye(e,t,n,l,i,a):tye(e,t,n,r,l,i,a)};var qy=1e-4,Y6=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],W6=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),TD=(e,t)=>n=>{var r=Y6(e,t);return W6(r,n)},rye=(e,t)=>n=>{var r=Y6(e,t),i=[...r.map((a,l)=>a*l).slice(1),0];return W6(i,n)},iye=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(a=>parseFloat(a));return[i[0],i[1],i[2],i[3]]},aye=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=iye(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},sye=(e,t,n,r)=>{var i=TD(e,n),a=TD(t,r),l=rye(e,n),u=f=>f>1?1:f<0?0:f,d=f=>{for(var p=f>1?1:f,m=p,g=0;g<8;++g){var v=i(m)-p,S=l(m);if(Math.abs(v-p)<qy||S<qy)return a(m);m=u(m-v/S)}return a(m)};return d.isStepper=!1,d},RD=function(){return sye(...aye(...arguments))},oye=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,a=(l,u,d)=>{var f=-(l-u)*n,p=d*r,m=d+(f-p)*i/1e3,g=d*i/1e3+l;return Math.abs(g-u)<qy&&Math.abs(m)<qy?[u,0]:[g,m]};return a.isStepper=!0,a.dt=i,a},lye=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return RD(e);case"spring":return oye();default:if(e.split("(")[0]==="cubic-bezier")return RD(e)}return typeof e=="function"?e:null};function cye(e){var t,n=()=>null,r=!1,i=null,a=l=>{if(!r){if(Array.isArray(l)){if(!l.length)return;var u=l,[d,...f]=u;if(typeof d=="number"){i=e.setTimeout(a.bind(null,f),d);return}a(d),i=e.setTimeout(a.bind(null,f));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),a(l)},subscribe:l=>(n=l,()=>{n=()=>null}),getTimeoutController:()=>e}}class uye{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,a=l=>{l-r>=n?t(l):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(a))};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function dye(){return cye(new uye)}var fye=x.createContext(dye);function hye(e,t){var n=x.useContext(fye);return x.useMemo(()=>t??n(e),[e,t,n])}var pye={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},DD={t:0},nj={t:1};function lp(e){var t=er(e,pye),{isActive:n,canBegin:r,duration:i,easing:a,begin:l,onAnimationEnd:u,onAnimationStart:d,children:f}=t,p=K6(),m=n==="auto"?!op.isSsr&&!p:n,g=hye(t.animationId,t.animationManager),[v,S]=x.useState(m?DD:nj),b=x.useRef(null);return x.useEffect(()=>{m||S(nj)},[m]),x.useEffect(()=>{if(!m||!r)return Jo;var j=nye(DD,nj,lye(a),i,S,g.getTimeoutController()),k=()=>{b.current=j()};return g.start([d,l,k,i,u]),()=>{g.stop(),b.current&&b.current(),u()}},[m,r,i,a,l,d,u,g]),f(v.t)}function cp(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=x.useRef(Oh(t)),r=x.useRef(e);return r.current!==e&&(n.current=Oh(t),r.current=e),n.current}var mye=["radius"],gye=["radius"],MD,ID,LD,$D,BD,UD,qD,FD,HD,KD;function GD(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 VD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GD(Object(n),!0).forEach(function(r){yye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yye(e,t,n){return(t=vye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vye(e){var t=xye(e,"string");return typeof t=="symbol"?t:t+""}function xye(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 Fy(){return Fy=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},Fy.apply(null,arguments)}function QD(e,t){if(e==null)return{};var n,r,i=bye(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function bye(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 Aa(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var YD=(e,t,n,r,i)=>{var a=Ro(n),l=Ro(r),u=Math.min(Math.abs(a)/2,Math.abs(l)/2),d=l>=0?1:-1,f=a>=0?1:-1,p=l>=0&&a>=0||l<0&&a<0?1:0,m;if(u>0&&Array.isArray(i)){for(var g=[0,0,0,0],v=0,S=4;v<S;v++){var b,j=(b=i[v])!==null&&b!==void 0?b:0;g[v]=j>u?u:j}m=kn(MD||(MD=Aa(["M",",",""])),e,t+d*g[0]),g[0]>0&&(m+=kn(ID||(ID=Aa(["A ",",",",0,0,",",",",",""])),g[0],g[0],p,e+f*g[0],t)),m+=kn(LD||(LD=Aa(["L ",",",""])),e+n-f*g[1],t),g[1]>0&&(m+=kn($D||($D=Aa(["A ",",",",0,0,",`,
|
|
261
|
-
`,",",""])),g[1],g[1],p,e+n,t+d*g[1])),m+=kn(BD||(BD=Aa(["L ",",",""])),e+n,t+r-d*g[2]),g[2]>0&&(m+=kn(UD||(UD=Aa(["A ",",",",0,0,",`,
|
|
262
|
-
`,",",""])),g[2],g[2],p,e+n-f*g[2],t+r)),m+=kn(qD||(qD=Aa(["L ",",",""])),e+f*g[3],t+r),g[3]>0&&(m+=kn(FD||(FD=Aa(["A ",",",",0,0,",`,
|
|
263
|
-
`,",",""])),g[3],g[3],p,e,t+r-d*g[3])),m+="Z"}else if(u>0&&i===+i&&i>0){var k=Math.min(u,i);m=kn(HD||(HD=Aa(["M ",",",`
|
|
264
|
-
A `,",",",0,0,",",",",",`
|
|
265
|
-
L `,",",`
|
|
266
|
-
A `,",",",0,0,",",",",",`
|
|
267
|
-
L `,",",`
|
|
268
|
-
A `,",",",0,0,",",",",",`
|
|
269
|
-
L `,",",`
|
|
270
|
-
A `,",",",0,0,",",",","," Z"])),e,t+d*k,k,k,p,e+f*k,t,e+n-f*k,t,k,k,p,e+n,t+d*k,e+n,t+r-d*k,k,k,p,e+n-f*k,t+r,e+f*k,t+r,k,k,p,e,t+r-d*k)}else m=kn(KD||(KD=Aa(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return m},WD={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Z6=e=>{var t=er(e,WD),n=x.useRef(null),[r,i]=x.useState(-1);x.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var J=n.current.getTotalLength();J&&i(J)}catch{}},[]);var{x:a,y:l,width:u,height:d,radius:f,className:p}=t,{animationEasing:m,animationDuration:g,animationBegin:v,isAnimationActive:S,isUpdateAnimationActive:b}=t,j=x.useRef(u),k=x.useRef(d),E=x.useRef(a),C=x.useRef(l),A=x.useMemo(()=>({x:a,y:l,width:u,height:d,radius:f}),[a,l,u,d,f]),P=cp(A,"rectangle-");if(a!==+a||l!==+l||u!==+u||d!==+d||u===0||d===0)return null;var O=At("recharts-rectangle",p);if(!b){var _=kr(t),{radius:T}=_,$=QD(_,mye);return x.createElement("path",Fy({},$,{x:Ro(a),y:Ro(l),width:Ro(u),height:Ro(d),radius:typeof f=="number"?f:void 0,className:O,d:YD(a,l,u,d,f)}))}var F=j.current,U=k.current,B=E.current,V=C.current,X="0px ".concat(r===-1?1:r,"px"),Z="".concat(r,"px ").concat(r,"px"),H=V6(["strokeDasharray"],g,typeof m=="string"?m:WD.animationEasing);return x.createElement(lp,{animationId:P,key:P,canBegin:r>0,duration:g,easing:m,isActive:b,begin:v},J=>{var oe=Ft(F,u,J),ye=Ft(U,d,J),I=Ft(B,a,J),M=Ft(V,l,J);n.current&&(j.current=oe,k.current=ye,E.current=I,C.current=M);var q;S?J>0?q={transition:H,strokeDasharray:Z}:q={strokeDasharray:X}:q={strokeDasharray:Z};var D=kr(t),{radius:G}=D,se=QD(D,gye);return x.createElement("path",Fy({},se,{radius:typeof f=="number"?f:void 0,className:O,d:YD(I,M,oe,ye,f),ref:n,style:VD(VD({},q),t.style)}))})};function ZD(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 XD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZD(Object(n),!0).forEach(function(r){wye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wye(e,t,n){return(t=Sye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sye(e){var t=jye(e,"string");return typeof t=="symbol"?t:t+""}function jye(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 Hy=Math.PI/180,Nye=e=>e*180/Math.PI,pr=(e,t,n,r)=>({x:e+Math.cos(-Hy*r)*n,y:t+Math.sin(-Hy*r)*n}),kye=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},Cye=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},Aye=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,l=Cye({x:n,y:r},{x:i,y:a});if(l<=0)return{radius:l,angle:0};var u=(n-i)/l,d=Math.acos(u);return r>a&&(d=2*Math.PI-d),{radius:l,angle:Nye(d),angleInRadian:d}},Oye=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},Eye=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360),l=Math.min(i,a);return e+l*360},_ye=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=Aye({x:n,y:r},t),{innerRadius:l,outerRadius:u}=t;if(i<l||i>u||i===0)return null;var{startAngle:d,endAngle:f}=Oye(t),p=a,m;if(d<=f){for(;p>f;)p-=360;for(;p<d;)p+=360;m=p>=d&&p<=f}else{for(;p>d;)p-=360;for(;p<f;)p+=360;m=p>=f&&p<=d}return m?XD(XD({},t),{},{radius:i,angle:Eye(p,t)}):null};function X6(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,l=pr(t,n,r,i),u=pr(t,n,r,a);return{points:[l,u],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var JD,eM,tM,nM,rM,iM,aM;function J1(){return J1=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},J1.apply(null,arguments)}function Bl(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var zye=(e,t)=>{var n=Qr(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},vg=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:l,cornerRadius:u,cornerIsExternal:d}=e,f=u*(l?1:-1)+r,p=Math.asin(u/f)/Hy,m=d?i:i+a*p,g=pr(t,n,f,m),v=pr(t,n,r,m),S=d?i-a*p:i,b=pr(t,n,f*Math.cos(p*Hy),S);return{center:g,circleTangency:v,lineTangency:b,theta:p}},J6=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:l}=e,u=zye(a,l),d=a+u,f=pr(t,n,i,a),p=pr(t,n,i,d),m=kn(JD||(JD=Bl(["M ",",",`
|
|
271
|
-
A `,",",`,0,
|
|
272
|
-
`,",",`,
|
|
273
|
-
`,",",`
|
|
274
|
-
`])),f.x,f.y,i,i,+(Math.abs(u)>180),+(a>d),p.x,p.y);if(r>0){var g=pr(t,n,r,a),v=pr(t,n,r,d);m+=kn(eM||(eM=Bl(["L ",",",`
|
|
275
|
-
A `,",",`,0,
|
|
276
|
-
`,",",`,
|
|
277
|
-
`,","," Z"])),v.x,v.y,r,r,+(Math.abs(u)>180),+(a<=d),g.x,g.y)}else m+=kn(tM||(tM=Bl(["L ",","," Z"])),t,n);return m},Pye=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:l,cornerIsExternal:u,startAngle:d,endAngle:f}=e,p=Qr(f-d),{circleTangency:m,lineTangency:g,theta:v}=vg({cx:t,cy:n,radius:i,angle:d,sign:p,cornerRadius:a,cornerIsExternal:u}),{circleTangency:S,lineTangency:b,theta:j}=vg({cx:t,cy:n,radius:i,angle:f,sign:-p,cornerRadius:a,cornerIsExternal:u}),k=u?Math.abs(d-f):Math.abs(d-f)-v-j;if(k<0)return l?kn(nM||(nM=Bl(["M ",",",`
|
|
278
|
-
a`,",",",0,0,1,",`,0
|
|
279
|
-
a`,",",",0,0,1,",`,0
|
|
280
|
-
`])),g.x,g.y,a,a,a*2,a,a,-a*2):J6({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:d,endAngle:f});var E=kn(rM||(rM=Bl(["M ",",",`
|
|
281
|
-
A`,",",",0,0,",",",",",`
|
|
282
|
-
A`,",",",0,",",",",",",",`
|
|
283
|
-
A`,",",",0,0,",",",",",`
|
|
284
|
-
`])),g.x,g.y,a,a,+(p<0),m.x,m.y,i,i,+(k>180),+(p<0),S.x,S.y,a,a,+(p<0),b.x,b.y);if(r>0){var{circleTangency:C,lineTangency:A,theta:P}=vg({cx:t,cy:n,radius:r,angle:d,sign:p,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),{circleTangency:O,lineTangency:_,theta:T}=vg({cx:t,cy:n,radius:r,angle:f,sign:-p,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),$=u?Math.abs(d-f):Math.abs(d-f)-P-T;if($<0&&a===0)return"".concat(E,"L").concat(t,",").concat(n,"Z");E+=kn(iM||(iM=Bl(["L",",",`
|
|
285
|
-
A`,",",",0,0,",",",",",`
|
|
286
|
-
A`,",",",0,",",",",",",",`
|
|
287
|
-
A`,",",",0,0,",",",",","Z"])),_.x,_.y,a,a,+(p<0),O.x,O.y,r,r,+($>180),+(p>0),C.x,C.y,a,a,+(p<0),A.x,A.y)}else E+=kn(aM||(aM=Bl(["L",",","Z"])),t,n);return E},Tye={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},eU=e=>{var t=er(e,Tye),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:l,forceCornerRadius:u,cornerIsExternal:d,startAngle:f,endAngle:p,className:m}=t;if(a<i||f===p)return null;var g=At("recharts-sector",m),v=a-i,S=fa(l,v,0,!0),b;return S>0&&Math.abs(f-p)<360?b=Pye({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(S,v/2),forceCornerRadius:u,cornerIsExternal:d,startAngle:f,endAngle:p}):b=J6({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:f,endAngle:p}),x.createElement("path",J1({},kr(t),{className:g,d:b}))};function Rye(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(DB(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:l,angle:u}=t,d=pr(r,i,a,u),f=pr(r,i,l,u);return[{x:d.x,y:d.y},{x:f.x,y:f.y}]}return X6(t)}}var rj={},ij={},aj={},sM;function Dye(){return sM||(sM=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=QB();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(aj)),aj}var oM;function Mye(){return oM||(oM=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Dye();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})(ij)),ij}var lM;function Iye(){return lM||(lM=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=YB(),n=Mye();function r(i,a,l){l&&typeof l!="number"&&t.isIterateeCall(i,a,l)&&(a=l=void 0),i=n.toFinite(i),a===void 0?(a=i,i=0):a=n.toFinite(a),l=l===void 0?i<a?1:-1:n.toFinite(l);const u=Math.max(Math.ceil((a-i)/(l||1)),0),d=new Array(u);for(let f=0;f<u;f++)d[f]=i,i+=l;return d}e.range=r})(rj)),rj}var sj,cM;function Lye(){return cM||(cM=1,sj=Iye().range),sj}var $ye=Lye();const tU=pa($ye);var xa=e=>e.chartData,xC=re([xa],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),up=(e,t,n,r)=>r?xC(e):xa(e),nU=(e,t,n)=>n?xC(e):xa(e),Bye=re([up],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});re([xC],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});var Uye=re([xa],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});function La(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(ht(t)&&ht(n))return!0}return!1}function uM(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function rU(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(ht(n))i=n;else if(typeof n=="function")return;if(ht(r))a=r;else if(typeof r=="function")return;var l=[i,a];if(La(l))return l}}function qye(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(La(r))return uM(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,l,u;if(i==="auto")t!=null&&(l=Math.min(...t));else if(Pe(i))l=i;else if(typeof i=="function")try{t!=null&&(l=i(t?.[0]))}catch{}else if(typeof i=="string"&&JR.test(i)){var d=JR.exec(i);if(d==null||d[1]==null||t==null)l=void 0;else{var f=+d[1];l=t[0]-f}}else l=t?.[0];if(a==="auto")t!=null&&(u=Math.max(...t));else if(Pe(a))u=a;else if(typeof a=="function")try{t!=null&&(u=a(t?.[1]))}catch{}else if(typeof a=="string"&&eD.test(a)){var p=eD.exec(a);if(p==null||p[1]==null||t==null)u=void 0;else{var m=+p[1];u=t[1]+m}}else u=t?.[1];var g=[l,u];if(La(g))return t==null?g:uM(g,t,n)}}}var Ad=1e9,Fye={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},wC,hn=!0,Gi="[DecimalError] ",Yl=Gi+"Invalid argument: ",bC=Gi+"Exponent out of range: ",Od=Math.floor,Tl=Math.pow,Hye=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,di,Xn=1e7,on=7,iU=9007199254740991,Ky=Od(iU/on),Re={};Re.absoluteValue=Re.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Re.comparedTo=Re.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};Re.decimalPlaces=Re.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*on;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Re.dividedBy=Re.div=function(e){return As(this,new this.constructor(e))};Re.dividedToIntegerBy=Re.idiv=function(e){var t=this,n=t.constructor;return Yt(As(t,new n(e),0,1),n.precision)};Re.equals=Re.eq=function(e){return!this.cmp(e)};Re.exponent=function(){return Un(this)};Re.greaterThan=Re.gt=function(e){return this.cmp(e)>0};Re.greaterThanOrEqualTo=Re.gte=function(e){return this.cmp(e)>=0};Re.isInteger=Re.isint=function(){return this.e>this.d.length-2};Re.isNegative=Re.isneg=function(){return this.s<0};Re.isPositive=Re.ispos=function(){return this.s>0};Re.isZero=function(){return this.s===0};Re.lessThan=Re.lt=function(e){return this.cmp(e)<0};Re.lessThanOrEqualTo=Re.lte=function(e){return this.cmp(e)<1};Re.logarithm=Re.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(di))throw Error(Gi+"NaN");if(n.s<1)throw Error(Gi+(n.s?"NaN":"-Infinity"));return n.eq(di)?new r(0):(hn=!1,t=As(Mh(n,a),Mh(e,a),a),hn=!0,Yt(t,i))};Re.minus=Re.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?oU(t,e):aU(t,(e.s=-e.s,e))};Re.modulo=Re.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Gi+"NaN");return n.s?(hn=!1,t=As(n,e,0,1).times(e),hn=!0,n.minus(t)):Yt(new r(n),i)};Re.naturalExponential=Re.exp=function(){return sU(this)};Re.naturalLogarithm=Re.ln=function(){return Mh(this)};Re.negated=Re.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Re.plus=Re.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?aU(t,e):oU(t,(e.s=-e.s,e))};Re.precision=Re.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Yl+e);if(t=Un(i)+1,r=i.d.length-1,n=r*on+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};Re.squareRoot=Re.sqrt=function(){var e,t,n,r,i,a,l,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(Gi+"NaN")}for(e=Un(u),hn=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=Ia(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Od((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 d(t)):r=new d(i.toString()),n=d.precision,i=l=n+3;;)if(a=r,r=a.plus(As(u,a,l+2)).times(.5),Ia(a.d).slice(0,l)===(t=Ia(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),i==l&&t=="4999"){if(Yt(a,n+1,0),a.times(a).eq(u)){r=a;break}}else if(t!="9999")break;l+=4}return hn=!0,Yt(r,n)};Re.times=Re.mul=function(e){var t,n,r,i,a,l,u,d,f,p=this,m=p.constructor,g=p.d,v=(e=new m(e)).d;if(!p.s||!e.s)return new m(0);for(e.s*=p.s,n=p.e+e.e,d=g.length,f=v.length,d<f&&(a=g,g=v,v=a,l=d,d=f,f=l),a=[],l=d+f,r=l;r--;)a.push(0);for(r=f;--r>=0;){for(t=0,i=d+r;i>r;)u=a[i]+v[r]*g[i-r-1]+t,a[i--]=u%Xn|0,t=u/Xn|0;a[i]=(a[i]+t)%Xn|0}for(;!a[--l];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,hn?Yt(e,m.precision):e};Re.toDecimalPlaces=Re.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Ka(e,0,Ad),t===void 0?t=r.rounding:Ka(t,0,8),Yt(n,e+Un(n)+1,t))};Re.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=uc(r,!0):(Ka(e,0,Ad),t===void 0?t=i.rounding:Ka(t,0,8),r=Yt(new i(r),e+1,t),n=uc(r,!0,e+1)),n};Re.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?uc(i):(Ka(e,0,Ad),t===void 0?t=a.rounding:Ka(t,0,8),r=Yt(new a(i),e+Un(i)+1,t),n=uc(r.abs(),!1,e+Un(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Re.toInteger=Re.toint=function(){var e=this,t=e.constructor;return Yt(new t(e),Un(e)+1,t.rounding)};Re.toNumber=function(){return+this};Re.toPower=Re.pow=function(e){var t,n,r,i,a,l,u=this,d=u.constructor,f=12,p=+(e=new d(e));if(!e.s)return new d(di);if(u=new d(u),!u.s){if(e.s<1)throw Error(Gi+"Infinity");return u}if(u.eq(di))return u;if(r=d.precision,e.eq(di))return Yt(u,r);if(t=e.e,n=e.d.length-1,l=t>=n,a=u.s,l){if((n=p<0?-p:p)<=iU){for(i=new d(di),t=Math.ceil(r/on+4),hn=!1;n%2&&(i=i.times(u),fM(i.d,t)),n=Od(n/2),n!==0;)u=u.times(u),fM(u.d,t);return hn=!0,e.s<0?new d(di).div(i):Yt(i,r)}}else if(a<0)throw Error(Gi+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,hn=!1,i=e.times(Mh(u,r+f)),hn=!0,i=sU(i),i.s=a,i};Re.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=Un(i),r=uc(i,n<=a.toExpNeg||n>=a.toExpPos)):(Ka(e,1,Ad),t===void 0?t=a.rounding:Ka(t,0,8),i=Yt(new a(i),e,t),n=Un(i),r=uc(i,e<=n||n<=a.toExpNeg,e)),r};Re.toSignificantDigits=Re.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Ka(e,1,Ad),t===void 0?t=r.rounding:Ka(t,0,8)),Yt(new r(n),e,t)};Re.toString=Re.valueOf=Re.val=Re.toJSON=Re[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Un(e),n=e.constructor;return uc(e,t<=n.toExpNeg||t>=n.toExpPos)};function aU(e,t){var n,r,i,a,l,u,d,f,p=e.constructor,m=p.precision;if(!e.s||!t.s)return t.s||(t=new p(e)),hn?Yt(t,m):t;if(d=e.d,f=t.d,l=e.e,i=t.e,d=d.slice(),a=l-i,a){for(a<0?(r=d,a=-a,u=f.length):(r=f,i=l,u=d.length),l=Math.ceil(m/on),u=l>u?l+1:u+1,a>u&&(a=u,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(u=d.length,a=f.length,u-a<0&&(a=u,r=f,f=d,d=r),n=0;a;)n=(d[--a]=d[a]+f[a]+n)/Xn|0,d[a]%=Xn;for(n&&(d.unshift(n),++i),u=d.length;d[--u]==0;)d.pop();return t.d=d,t.e=i,hn?Yt(t,m):t}function Ka(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Yl+e)}function Ia(e){var t,n,r,i=e.length-1,a="",l=e[0];if(i>0){for(a+=l,t=1;t<i;t++)r=e[t]+"",n=on-r.length,n&&(a+=Ao(n)),a+=r;l=e[t],r=l+"",n=on-r.length,n&&(a+=Ao(n))}else if(l===0)return"0";for(;l%10===0;)l/=10;return a+l}var As=(function(){function e(r,i){var a,l=0,u=r.length;for(r=r.slice();u--;)a=r[u]*i+l,r[u]=a%Xn|0,l=a/Xn|0;return l&&r.unshift(l),r}function t(r,i,a,l){var u,d;if(a!=l)d=a>l?1:-1;else for(u=d=0;u<a;u++)if(r[u]!=i[u]){d=r[u]>i[u]?1:-1;break}return d}function n(r,i,a){for(var l=0;a--;)r[a]-=l,l=r[a]<i[a]?1:0,r[a]=l*Xn+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,l){var u,d,f,p,m,g,v,S,b,j,k,E,C,A,P,O,_,T,$=r.constructor,F=r.s==i.s?1:-1,U=r.d,B=i.d;if(!r.s)return new $(r);if(!i.s)throw Error(Gi+"Division by zero");for(d=r.e-i.e,_=B.length,P=U.length,v=new $(F),S=v.d=[],f=0;B[f]==(U[f]||0);)++f;if(B[f]>(U[f]||0)&&--d,a==null?E=a=$.precision:l?E=a+(Un(r)-Un(i))+1:E=a,E<0)return new $(0);if(E=E/on+2|0,f=0,_==1)for(p=0,B=B[0],E++;(f<P||p)&&E--;f++)C=p*Xn+(U[f]||0),S[f]=C/B|0,p=C%B|0;else{for(p=Xn/(B[0]+1)|0,p>1&&(B=e(B,p),U=e(U,p),_=B.length,P=U.length),A=_,b=U.slice(0,_),j=b.length;j<_;)b[j++]=0;T=B.slice(),T.unshift(0),O=B[0],B[1]>=Xn/2&&++O;do p=0,u=t(B,b,_,j),u<0?(k=b[0],_!=j&&(k=k*Xn+(b[1]||0)),p=k/O|0,p>1?(p>=Xn&&(p=Xn-1),m=e(B,p),g=m.length,j=b.length,u=t(m,b,g,j),u==1&&(p--,n(m,_<g?T:B,g))):(p==0&&(u=p=1),m=B.slice()),g=m.length,g<j&&m.unshift(0),n(b,m,j),u==-1&&(j=b.length,u=t(B,b,_,j),u<1&&(p++,n(b,_<j?T:B,j))),j=b.length):u===0&&(p++,b=[0]),S[f++]=p,u&&b[0]?b[j++]=U[A]||0:(b=[U[A]],j=1);while((A++<P||b[0]!==void 0)&&E--)}return S[0]||S.shift(),v.e=d,Yt(v,l?a+Un(v)+1:a)}})();function sU(e,t){var n,r,i,a,l,u,d=0,f=0,p=e.constructor,m=p.precision;if(Un(e)>16)throw Error(bC+Un(e));if(!e.s)return new p(di);for(hn=!1,u=m,l=new p(.03125);e.abs().gte(.1);)e=e.times(l),f+=5;for(r=Math.log(Tl(2,f))/Math.LN10*2+5|0,u+=r,n=i=a=new p(di),p.precision=u;;){if(i=Yt(i.times(e),u),n=n.times(++d),l=a.plus(As(i,n,u)),Ia(l.d).slice(0,u)===Ia(a.d).slice(0,u)){for(;f--;)a=Yt(a.times(a),u);return p.precision=m,t==null?(hn=!0,Yt(a,m)):a}a=l}}function Un(e){for(var t=e.e*on,n=e.d[0];n>=10;n/=10)t++;return t}function oj(e,t,n){if(t>e.LN10.sd())throw hn=!0,n&&(e.precision=n),Error(Gi+"LN10 precision limit exceeded");return Yt(new e(e.LN10),t)}function Ao(e){for(var t="";e--;)t+="0";return t}function Mh(e,t){var n,r,i,a,l,u,d,f,p,m=1,g=10,v=e,S=v.d,b=v.constructor,j=b.precision;if(v.s<1)throw Error(Gi+(v.s?"NaN":"-Infinity"));if(v.eq(di))return new b(0);if(t==null?(hn=!1,f=j):f=t,v.eq(10))return t==null&&(hn=!0),oj(b,f);if(f+=g,b.precision=f,n=Ia(S),r=n.charAt(0),a=Un(v),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)v=v.times(e),n=Ia(v.d),r=n.charAt(0),m++;a=Un(v),r>1?(v=new b("0."+n),a++):v=new b(r+"."+n.slice(1))}else return d=oj(b,f+2,j).times(a+""),v=Mh(new b(r+"."+n.slice(1)),f-g).plus(d),b.precision=j,t==null?(hn=!0,Yt(v,j)):v;for(u=l=v=As(v.minus(di),v.plus(di),f),p=Yt(v.times(v),f),i=3;;){if(l=Yt(l.times(p),f),d=u.plus(As(l,new b(i),f)),Ia(d.d).slice(0,f)===Ia(u.d).slice(0,f))return u=u.times(2),a!==0&&(u=u.plus(oj(b,f+2,j).times(a+""))),u=As(u,new b(m),f),b.precision=j,t==null?(hn=!0,Yt(u,j)):u;u=d,i+=2}}function dM(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=Od(n/on),e.d=[],r=(n+1)%on,n<0&&(r+=on),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=on;r<i;)e.d.push(+t.slice(r,r+=on));t=t.slice(r),r=on-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),hn&&(e.e>Ky||e.e<-Ky))throw Error(bC+n)}else e.s=0,e.e=0,e.d=[0];return e}function Yt(e,t,n){var r,i,a,l,u,d,f,p,m=e.d;for(l=1,a=m[0];a>=10;a/=10)l++;if(r=t-l,r<0)r+=on,i=t,f=m[p=0];else{if(p=Math.ceil((r+1)/on),a=m.length,p>=a)return e;for(f=a=m[p],l=1;a>=10;a/=10)l++;r%=on,i=r-on+l}if(n!==void 0&&(a=Tl(10,l-i-1),u=f/a%10|0,d=t<0||m[p+1]!==void 0||f%a,d=n<4?(u||d)&&(n==0||n==(e.s<0?3:2)):u>5||u==5&&(n==4||d||n==6&&(r>0?i>0?f/Tl(10,l-i):0:m[p-1])%10&1||n==(e.s<0?8:7))),t<1||!m[0])return d?(a=Un(e),m.length=1,t=t-a-1,m[0]=Tl(10,(on-t%on)%on),e.e=Od(-t/on)||0):(m.length=1,m[0]=e.e=e.s=0),e;if(r==0?(m.length=p,a=1,p--):(m.length=p+1,a=Tl(10,on-r),m[p]=i>0?(f/Tl(10,l-i)%Tl(10,i)|0)*a:0),d)for(;;)if(p==0){(m[0]+=a)==Xn&&(m[0]=1,++e.e);break}else{if(m[p]+=a,m[p]!=Xn)break;m[p--]=0,a=1}for(r=m.length;m[--r]===0;)m.pop();if(hn&&(e.e>Ky||e.e<-Ky))throw Error(bC+Un(e));return e}function oU(e,t){var n,r,i,a,l,u,d,f,p,m,g=e.constructor,v=g.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new g(e),hn?Yt(t,v):t;if(d=e.d,m=t.d,r=t.e,f=e.e,d=d.slice(),l=f-r,l){for(p=l<0,p?(n=d,l=-l,u=m.length):(n=m,r=f,u=d.length),i=Math.max(Math.ceil(v/on),u)+2,l>i&&(l=i,n.length=1),n.reverse(),i=l;i--;)n.push(0);n.reverse()}else{for(i=d.length,u=m.length,p=i<u,p&&(u=i),i=0;i<u;i++)if(d[i]!=m[i]){p=d[i]<m[i];break}l=0}for(p&&(n=d,d=m,m=n,t.s=-t.s),u=d.length,i=m.length-u;i>0;--i)d[u++]=0;for(i=m.length;i>l;){if(d[--i]<m[i]){for(a=i;a&&d[--a]===0;)d[a]=Xn-1;--d[a],d[i]+=Xn}d[i]-=m[i]}for(;d[--u]===0;)d.pop();for(;d[0]===0;d.shift())--r;return d[0]?(t.d=d,t.e=r,hn?Yt(t,v):t):new g(0)}function uc(e,t,n){var r,i=Un(e),a=Ia(e.d),l=a.length;return t?(n&&(r=n-l)>0?a=a.charAt(0)+"."+a.slice(1)+Ao(r):l>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Ao(-i-1)+a,n&&(r=n-l)>0&&(a+=Ao(r))):i>=l?(a+=Ao(i+1-l),n&&(r=n-i-1)>0&&(a=a+"."+Ao(r))):((r=i+1)<l&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-l)>0&&(i+1===l&&(a+="."),a+=Ao(r))),e.s<0?"-"+a:a}function fM(e,t){if(e.length>t)return e.length=t,!0}function lU(e){var t,n,r;function i(a){var l=this;if(!(l instanceof i))return new i(a);if(l.constructor=i,a instanceof i){l.s=a.s,l.e=a.e,l.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Yl+a);if(a>0)l.s=1;else if(a<0)a=-a,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(a===~~a&&a<1e7){l.e=0,l.d=[a];return}return dM(l,a.toString())}else if(typeof a!="string")throw Error(Yl+a);if(a.charCodeAt(0)===45?(a=a.slice(1),l.s=-1):l.s=1,Hye.test(a))dM(l,a);else throw Error(Yl+a)}if(i.prototype=Re,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=lU,i.config=i.set=Kye,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 Kye(e){if(!e||typeof e!="object")throw Error(Gi+"Object expected");var t,n,r,i=["precision",1,Ad,"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(Od(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Yl+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Yl+n+": "+r);return this}var wC=lU(Fye);di=new wC(1);const St=wC;function cU(e){var t;return e===0?t=1:t=Math.floor(new St(e).abs().log(10).toNumber())+1,t}function uU(e,t,n){for(var r=new St(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var dU=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},SC=(e,t,n)=>{if(e.lte(0))return new St(0);var r=cU(e.toNumber()),i=new St(10).pow(r),a=e.div(i),l=r!==1?.05:.1,u=new St(Math.ceil(a.div(l).toNumber())).add(n).mul(l),d=u.mul(i);return t?new St(d.toNumber()):new St(Math.ceil(d.toNumber()))},fU=(e,t,n)=>{var r;if(e.lte(0))return new St(0);var i=[1,2,2.5,5],a=e.toNumber(),l=Math.floor(new St(a).abs().log(10).toNumber()),u=new St(10).pow(l),d=e.div(u).toNumber(),f=i.findIndex(v=>v>=d-1e-10);if(f===-1&&(u=u.mul(10),f=0),f+=n,f>=i.length){var p=Math.floor(f/i.length);f%=i.length,u=u.mul(new St(10).pow(p))}var m=(r=i[f])!==null&&r!==void 0?r:1,g=new St(m).mul(u);return t?g:new St(Math.ceil(g.toNumber()))},Gye=(e,t,n)=>{var r=new St(1),i=new St(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new St(10).pow(cU(e)-1),i=new St(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new St(Math.floor(e)))}else e===0?i=new St(Math.floor((t-1)/2)):n||(i=new St(Math.floor(e)));for(var l=Math.floor((t-1)/2),u=[],d=0;d<t;d++)u.push(i.add(new St(d-l).mul(r)).toNumber());return u},hU=function(t,n,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:SC;if(!Number.isFinite((n-t)/(r-1)))return{step:new St(0),tickMin:new St(0),tickMax:new St(0)};var u=l(new St(n).sub(t).div(r-1),i,a),d;t<=0&&n>=0?d=new St(0):(d=new St(t).add(n).div(2),d=d.sub(new St(d).mod(u)));var f=Math.ceil(d.sub(t).div(u).toNumber()),p=Math.ceil(new St(n).sub(d).div(u).toNumber()),m=f+p+1;return m>r?hU(t,n,r,i,a+1,l):(m<r&&(p=n>0?p+(r-m):p,f=n>0?f:f+(r-m)),{step:u,tickMin:d.sub(new St(f).mul(u)),tickMax:d.add(new St(p).mul(u))})},hM=function(t){var[n,r]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",u=Math.max(i,2),[d,f]=dU([n,r]);if(d===-1/0||f===1/0){var p=f===1/0?[d,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),f];return n>r?p.reverse():p}if(d===f)return Gye(d,i,a);var m=l==="snap125"?fU:SC,{step:g,tickMin:v,tickMax:S}=hU(d,f,u,a,0,m),b=uU(v,S.add(new St(.1).mul(g)),g);return n>r?b.reverse():b},pM=function(t,n){var[r,i]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[u,d]=dU([r,i]);if(u===-1/0||d===1/0)return[r,i];if(u===d)return[u];var f=l==="snap125"?fU:SC,p=Math.max(n,2),m=f(new St(d).sub(u).div(p-1),a,0),g=[...uU(new St(u),new St(d),m),d];return a===!1&&(g=g.map(v=>Math.round(v))),r>i?g.reverse():g},pU=e=>e.rootProps.maxBarSize,Vye=e=>e.rootProps.barGap,mU=e=>e.rootProps.barCategoryGap,Qye=e=>e.rootProps.barSize,Nx=e=>e.rootProps.stackOffset,gU=e=>e.rootProps.reverseStackOrder,jC=e=>e.options.chartName,NC=e=>e.rootProps.syncId,yU=e=>e.rootProps.syncMethod,kC=e=>e.options.eventEmitter,Yye=e=>e.rootProps.baseValue,Qn={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},kl={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},Oa={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},kx=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Cx(e,t,n){if(n!=="auto")return n;if(e!=null)return va(e,t)?"category":"number"}function mM(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 Gy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mM(Object(n),!0).forEach(function(r){Wye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wye(e,t,n){return(t=Zye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zye(e){var t=Xye(e,"string");return typeof t=="symbol"?t:t+""}function Xye(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 gM={allowDataOverflow:kl.allowDataOverflow,allowDecimals:kl.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:kl.angleAxisId,includeHidden:!1,name:void 0,reversed:kl.reversed,scale:kl.scale,tick:kl.tick,tickCount:void 0,ticks:void 0,type:kl.type,unit:void 0,niceTicks:"auto"},yM={allowDataOverflow:Oa.allowDataOverflow,allowDecimals:Oa.allowDecimals,allowDuplicatedCategory:Oa.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:Oa.radiusAxisId,includeHidden:Oa.includeHidden,name:void 0,reversed:Oa.reversed,scale:Oa.scale,tick:Oa.tick,tickCount:Oa.tickCount,ticks:void 0,type:Oa.type,unit:void 0,niceTicks:"auto"},Jye=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},CC=re([Jye,M6],(e,t)=>{var n;if(e!=null)return e;var r=(n=Cx(t,"angleAxis",gM.type))!==null&&n!==void 0?n:"category";return Gy(Gy({},gM),{},{type:r})}),eve=(e,t)=>e.polarAxis.radiusAxis[t],AC=re([eve,M6],(e,t)=>{var n;if(e!=null)return e;var r=(n=Cx(t,"radiusAxis",yM.type))!==null&&n!==void 0?n:"category";return Gy(Gy({},yM),{},{type:r})}),Ax=e=>e.polarOptions,OC=re([$s,Bs,tr],kye),vU=re([Ax,OC],(e,t)=>{if(e!=null)return fa(e.innerRadius,t,0)}),xU=re([Ax,OC],(e,t)=>{if(e!=null)return fa(e.outerRadius,t,t*.8)}),tve=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},bU=re([Ax],tve);re([CC,bU],kx);var wU=re([OC,vU,xU],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});re([AC,wU],kx);var SU=re([Et,Ax,vU,xU,$s,Bs],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:l,cy:u,startAngle:d,endAngle:f}=t;return{cx:fa(l,i,i/2),cy:fa(u,a,a/2),innerRadius:n,outerRadius:r,startAngle:d,endAngle:f,clockWise:!1}}}),rr=(e,t)=>t,Ox=(e,t,n)=>n;function Ex(e){return e?.id}function jU(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,l=new Map;return e.forEach(u=>{var d,f=(d=u.data)!==null&&d!==void 0?d:r;if(!(f==null||f.length===0)){var p=Ex(u);f.forEach((m,g)=>{var v=a==null||i?g:String(vn(m,a,null)),S=vn(m,u.dataKey,0),b;l.has(v)?b=l.get(v):b={},Object.assign(b,{[p]:S}),l.set(v,b)})}}),Array.from(l.values())}function _x(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var zx=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Px(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function nve(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 ir=e=>{var t=Et(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Ed=e=>e.tooltip.settings.axisId;function EC(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(a){function l(){return a.apply(this,arguments)}return l.toString=function(){return a.toString()},l})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var l=i[0],u=i[1];return l<=u?a>=l&&a<=u:a>=u&&a<=l},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,l)=>{var u=e(a);if(u!=null){if(e.bandwidth&&l!==null&&l!==void 0&&l.position){var d=e.bandwidth();switch(l.position){case"middle":u+=d/2;break;case"end":u+=d;break}}return u}}}}}var rve=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!La(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];ht(a)&&((n===void 0||a<n)&&(n=a),(r===void 0||a>r)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};function Bo(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function ive(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function _C(e){let t,n,r;e.length!==2?(t=Bo,n=(u,d)=>Bo(e(u),d),r=(u,d)=>e(u)-d):(t=e===Bo||e===ive?e:ave,n=e,r=e);function i(u,d,f=0,p=u.length){if(f<p){if(t(d,d)!==0)return p;do{const m=f+p>>>1;n(u[m],d)<0?f=m+1:p=m}while(f<p)}return f}function a(u,d,f=0,p=u.length){if(f<p){if(t(d,d)!==0)return p;do{const m=f+p>>>1;n(u[m],d)<=0?f=m+1:p=m}while(f<p)}return f}function l(u,d,f=0,p=u.length){const m=i(u,d,f,p-1);return m>f&&r(u[m-1],d)>-r(u[m],d)?m-1:m}return{left:i,center:l,right:a}}function ave(){return 0}function NU(e){return e===null?NaN:+e}function*sve(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const ove=_C(Bo),dp=ove.right;_C(NU).center;class vM extends Map{constructor(t,n=uve){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(xM(this,t))}has(t){return super.has(xM(this,t))}set(t,n){return super.set(lve(this,t),n)}delete(t){return super.delete(cve(this,t))}}function xM({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function lve({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function cve({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function uve(e){return e!==null&&typeof e=="object"?e.valueOf():e}function dve(e=Bo){if(e===Bo)return kU;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 kU(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const fve=Math.sqrt(50),hve=Math.sqrt(10),pve=Math.sqrt(2);function Vy(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),l=a>=fve?10:a>=hve?5:a>=pve?2:1;let u,d,f;return i<0?(f=Math.pow(10,-i)/l,u=Math.round(e*f),d=Math.round(t*f),u/f<e&&++u,d/f>t&&--d,f=-f):(f=Math.pow(10,i)*l,u=Math.round(e/f),d=Math.round(t/f),u*f<e&&++u,d*f>t&&--d),d<u&&.5<=n&&n<2?Vy(e,t,n*2):[u,d,f]}function eN(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,l]=r?Vy(t,e,n):Vy(e,t,n);if(!(a>=i))return[];const u=a-i+1,d=new Array(u);if(r)if(l<0)for(let f=0;f<u;++f)d[f]=(a-f)/-l;else for(let f=0;f<u;++f)d[f]=(a-f)*l;else if(l<0)for(let f=0;f<u;++f)d[f]=(i+f)/-l;else for(let f=0;f<u;++f)d[f]=(i+f)*l;return d}function tN(e,t,n){return t=+t,e=+e,n=+n,Vy(e,t,n)[2]}function nN(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?tN(t,e,n):tN(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function bM(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function wM(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function CU(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?kU:dve(i);r>n;){if(r-n>600){const d=r-n+1,f=t-n+1,p=Math.log(d),m=.5*Math.exp(2*p/3),g=.5*Math.sqrt(p*m*(d-m)/d)*(f-d/2<0?-1:1),v=Math.max(n,Math.floor(t-f*m/d+g)),S=Math.min(r,Math.floor(t+(d-f)*m/d+g));CU(e,t,v,S,i)}const a=e[t];let l=n,u=r;for(Gf(e,n,t),i(e[r],a)>0&&Gf(e,n,r);l<u;){for(Gf(e,l,u),++l,--u;i(e[l],a)<0;)++l;for(;i(e[u],a)>0;)--u}i(e[n],a)===0?Gf(e,n,u):(++u,Gf(e,u,r)),u<=t&&(n=u+1),t<=u&&(r=u-1)}return e}function Gf(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function mve(e,t,n){if(e=Float64Array.from(sve(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return wM(e);if(t>=1)return bM(e);var r,i=(r-1)*t,a=Math.floor(i),l=bM(CU(e,a).subarray(0,a+1)),u=wM(e.subarray(a+1));return l+(u-l)*(i-a)}}function gve(e,t,n=NU){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,a=Math.floor(i),l=+n(e[a],a,e),u=+n(e[a+1],a+1,e);return l+(u-l)*(i-a)}}function yve(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,a=new Array(i);++r<i;)a[r]=e+r*n;return a}function Wi(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Us(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 rN=Symbol("implicit");function zC(){var e=new vM,t=[],n=[],r=rN;function i(a){let l=e.get(a);if(l===void 0){if(r!==rN)return r;e.set(a,l=t.push(a)-1)}return n[l%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new vM;for(const l of a)e.has(l)||e.set(l,t.push(l)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return zC(t,n).unknown(r)},Wi.apply(i,arguments),i}function PC(){var e=zC().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,l,u=!1,d=0,f=0,p=.5;delete e.unknown;function m(){var g=t().length,v=i<r,S=v?i:r,b=v?r:i;a=(b-S)/Math.max(1,g-d+f*2),u&&(a=Math.floor(a)),S+=(b-S-a*(g-d))*p,l=a*(1-d),u&&(S=Math.round(S),l=Math.round(l));var j=yve(g).map(function(k){return S+a*k});return n(v?j.reverse():j)}return e.domain=function(g){return arguments.length?(t(g),m()):t()},e.range=function(g){return arguments.length?([r,i]=g,r=+r,i=+i,m()):[r,i]},e.rangeRound=function(g){return[r,i]=g,r=+r,i=+i,u=!0,m()},e.bandwidth=function(){return l},e.step=function(){return a},e.round=function(g){return arguments.length?(u=!!g,m()):u},e.padding=function(g){return arguments.length?(d=Math.min(1,f=+g),m()):d},e.paddingInner=function(g){return arguments.length?(d=Math.min(1,g),m()):d},e.paddingOuter=function(g){return arguments.length?(f=+g,m()):f},e.align=function(g){return arguments.length?(p=Math.max(0,Math.min(1,g)),m()):p},e.copy=function(){return PC(t(),[r,i]).round(u).paddingInner(d).paddingOuter(f).align(p)},Wi.apply(m(),arguments)}function AU(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return AU(t())},e}function vve(){return AU(PC.apply(null,arguments).paddingInner(1))}function TC(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function OU(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function fp(){}var Ih=.7,Qy=1/Ih,Hu="\\s*([+-]?\\d+)\\s*",Lh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",$a="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",xve=/^#([0-9a-f]{3,8})$/,bve=new RegExp(`^rgb\\(${Hu},${Hu},${Hu}\\)$`),wve=new RegExp(`^rgb\\(${$a},${$a},${$a}\\)$`),Sve=new RegExp(`^rgba\\(${Hu},${Hu},${Hu},${Lh}\\)$`),jve=new RegExp(`^rgba\\(${$a},${$a},${$a},${Lh}\\)$`),Nve=new RegExp(`^hsl\\(${Lh},${$a},${$a}\\)$`),kve=new RegExp(`^hsla\\(${Lh},${$a},${$a},${Lh}\\)$`),SM={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};TC(fp,$h,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:jM,formatHex:jM,formatHex8:Cve,formatHsl:Ave,formatRgb:NM,toString:NM});function jM(){return this.rgb().formatHex()}function Cve(){return this.rgb().formatHex8()}function Ave(){return EU(this).formatHsl()}function NM(){return this.rgb().formatRgb()}function $h(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=xve.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?kM(t):n===3?new Wr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?xg(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?xg(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=bve.exec(e))?new Wr(t[1],t[2],t[3],1):(t=wve.exec(e))?new Wr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Sve.exec(e))?xg(t[1],t[2],t[3],t[4]):(t=jve.exec(e))?xg(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Nve.exec(e))?OM(t[1],t[2]/100,t[3]/100,1):(t=kve.exec(e))?OM(t[1],t[2]/100,t[3]/100,t[4]):SM.hasOwnProperty(e)?kM(SM[e]):e==="transparent"?new Wr(NaN,NaN,NaN,0):null}function kM(e){return new Wr(e>>16&255,e>>8&255,e&255,1)}function xg(e,t,n,r){return r<=0&&(e=t=n=NaN),new Wr(e,t,n,r)}function Ove(e){return e instanceof fp||(e=$h(e)),e?(e=e.rgb(),new Wr(e.r,e.g,e.b,e.opacity)):new Wr}function iN(e,t,n,r){return arguments.length===1?Ove(e):new Wr(e,t,n,r??1)}function Wr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}TC(Wr,iN,OU(fp,{brighter(e){return e=e==null?Qy:Math.pow(Qy,e),new Wr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ih:Math.pow(Ih,e),new Wr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Wr(Wl(this.r),Wl(this.g),Wl(this.b),Yy(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:CM,formatHex:CM,formatHex8:Eve,formatRgb:AM,toString:AM}));function CM(){return`#${Ul(this.r)}${Ul(this.g)}${Ul(this.b)}`}function Eve(){return`#${Ul(this.r)}${Ul(this.g)}${Ul(this.b)}${Ul((isNaN(this.opacity)?1:this.opacity)*255)}`}function AM(){const e=Yy(this.opacity);return`${e===1?"rgb(":"rgba("}${Wl(this.r)}, ${Wl(this.g)}, ${Wl(this.b)}${e===1?")":`, ${e})`}`}function Yy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Wl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ul(e){return e=Wl(e),(e<16?"0":"")+e.toString(16)}function OM(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new la(e,t,n,r)}function EU(e){if(e instanceof la)return new la(e.h,e.s,e.l,e.opacity);if(e instanceof fp||(e=$h(e)),!e)return new la;if(e instanceof la)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),l=NaN,u=a-i,d=(a+i)/2;return u?(t===a?l=(n-r)/u+(n<r)*6:n===a?l=(r-t)/u+2:l=(t-n)/u+4,u/=d<.5?a+i:2-a-i,l*=60):u=d>0&&d<1?0:l,new la(l,u,d,e.opacity)}function _ve(e,t,n,r){return arguments.length===1?EU(e):new la(e,t,n,r??1)}function la(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}TC(la,_ve,OU(fp,{brighter(e){return e=e==null?Qy:Math.pow(Qy,e),new la(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ih:Math.pow(Ih,e),new la(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 Wr(lj(e>=240?e-240:e+120,i,r),lj(e,i,r),lj(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new la(EM(this.h),bg(this.s),bg(this.l),Yy(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=Yy(this.opacity);return`${e===1?"hsl(":"hsla("}${EM(this.h)}, ${bg(this.s)*100}%, ${bg(this.l)*100}%${e===1?")":`, ${e})`}`}}));function EM(e){return e=(e||0)%360,e<0?e+360:e}function bg(e){return Math.max(0,Math.min(1,e||0))}function lj(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 RC=e=>()=>e;function zve(e,t){return function(n){return e+n*t}}function Pve(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 Tve(e){return(e=+e)==1?_U:function(t,n){return n-t?Pve(t,n,e):RC(isNaN(t)?n:t)}}function _U(e,t){var n=t-e;return n?zve(e,n):RC(isNaN(e)?t:e)}const _M=(function e(t){var n=Tve(t);function r(i,a){var l=n((i=iN(i)).r,(a=iN(a)).r),u=n(i.g,a.g),d=n(i.b,a.b),f=_U(i.opacity,a.opacity);return function(p){return i.r=l(p),i.g=u(p),i.b=d(p),i.opacity=f(p),i+""}}return r.gamma=e,r})(1);function Rve(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function Dve(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Mve(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),l;for(l=0;l<r;++l)i[l]=_d(e[l],t[l]);for(;l<n;++l)a[l]=t[l];return function(u){for(l=0;l<r;++l)a[l]=i[l](u);return a}}function Ive(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Wy(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Lve(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]=_d(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var aN=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,cj=new RegExp(aN.source,"g");function $ve(e){return function(){return e}}function Bve(e){return function(t){return e(t)+""}}function Uve(e,t){var n=aN.lastIndex=cj.lastIndex=0,r,i,a,l=-1,u=[],d=[];for(e=e+"",t=t+"";(r=aN.exec(e))&&(i=cj.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),u[l]?u[l]+=a:u[++l]=a),(r=r[0])===(i=i[0])?u[l]?u[l]+=i:u[++l]=i:(u[++l]=null,d.push({i:l,x:Wy(r,i)})),n=cj.lastIndex;return n<t.length&&(a=t.slice(n),u[l]?u[l]+=a:u[++l]=a),u.length<2?d[0]?Bve(d[0].x):$ve(t):(t=d.length,function(f){for(var p=0,m;p<t;++p)u[(m=d[p]).i]=m.x(f);return u.join("")})}function _d(e,t){var n=typeof t,r;return t==null||n==="boolean"?RC(t):(n==="number"?Wy:n==="string"?(r=$h(t))?(t=r,_M):Uve:t instanceof $h?_M:t instanceof Date?Ive:Dve(t)?Rve:Array.isArray(t)?Mve:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Lve:Wy)(e,t)}function DC(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function qve(e,t){t===void 0&&(t=e,e=_d);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(l){var u=Math.max(0,Math.min(r-1,Math.floor(l*=r)));return a[u](l-u)}}function Fve(e){return function(){return e}}function Zy(e){return+e}var zM=[0,1];function Tr(e){return e}function sN(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Fve(isNaN(t)?NaN:.5)}function Hve(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Kve(e,t,n){var r=e[0],i=e[1],a=t[0],l=t[1];return i<r?(r=sN(i,r),a=n(l,a)):(r=sN(r,i),a=n(a,l)),function(u){return a(r(u))}}function Gve(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),l=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++l<r;)i[l]=sN(e[l],e[l+1]),a[l]=n(t[l],t[l+1]);return function(u){var d=dp(e,u,1,r)-1;return a[d](i[d](u))}}function hp(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Tx(){var e=zM,t=zM,n=_d,r,i,a,l=Tr,u,d,f;function p(){var g=Math.min(e.length,t.length);return l!==Tr&&(l=Hve(e[0],e[g-1])),u=g>2?Gve:Kve,d=f=null,m}function m(g){return g==null||isNaN(g=+g)?a:(d||(d=u(e.map(r),t,n)))(r(l(g)))}return m.invert=function(g){return l(i((f||(f=u(t,e.map(r),Wy)))(g)))},m.domain=function(g){return arguments.length?(e=Array.from(g,Zy),p()):e.slice()},m.range=function(g){return arguments.length?(t=Array.from(g),p()):t.slice()},m.rangeRound=function(g){return t=Array.from(g),n=DC,p()},m.clamp=function(g){return arguments.length?(l=g?!0:Tr,p()):l!==Tr},m.interpolate=function(g){return arguments.length?(n=g,p()):n},m.unknown=function(g){return arguments.length?(a=g,m):a},function(g,v){return r=g,i=v,p()}}function MC(){return Tx()(Tr,Tr)}function Vve(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Xy(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 sd(e){return e=Xy(Math.abs(e)),e?e[1]:NaN}function Qve(e,t){return function(n,r){for(var i=n.length,a=[],l=0,u=e[0],d=0;i>0&&u>0&&(d+u+1>r&&(u=Math.max(1,r-d)),a.push(n.substring(i-=u,i+u)),!((d+=u+1)>r));)u=e[l=(l+1)%e.length];return a.reverse().join(t)}}function Yve(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Wve=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Bh(e){if(!(t=Wve.exec(e)))throw new Error("invalid format: "+e);var t;return new IC({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]})}Bh.prototype=IC.prototype;function IC(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+""}IC.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 Zve(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 Jy;function Xve(e,t){var n=Xy(e,t);if(!n)return Jy=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Jy=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,l=r.length;return a===l?r:a>l?r+new Array(a-l+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Xy(e,Math.max(0,t+a-1))[0]}function PM(e,t){var n=Xy(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 TM={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Vve,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)=>PM(e*100,t),r:PM,s:Xve,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function RM(e){return e}var DM=Array.prototype.map,MM=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Jve(e){var t=e.grouping===void 0||e.thousands===void 0?RM:Qve(DM.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+"",a=e.numerals===void 0?RM:Yve(DM.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function f(m,g){m=Bh(m);var v=m.fill,S=m.align,b=m.sign,j=m.symbol,k=m.zero,E=m.width,C=m.comma,A=m.precision,P=m.trim,O=m.type;O==="n"?(C=!0,O="g"):TM[O]||(A===void 0&&(A=12),P=!0,O="g"),(k||v==="0"&&S==="=")&&(k=!0,v="0",S="=");var _=(g&&g.prefix!==void 0?g.prefix:"")+(j==="$"?n:j==="#"&&/[boxX]/.test(O)?"0"+O.toLowerCase():""),T=(j==="$"?r:/[%p]/.test(O)?l:"")+(g&&g.suffix!==void 0?g.suffix:""),$=TM[O],F=/[defgprs%]/.test(O);A=A===void 0?6:/[gprs]/.test(O)?Math.max(1,Math.min(21,A)):Math.max(0,Math.min(20,A));function U(B){var V=_,X=T,Z,H,J;if(O==="c")X=$(B)+X,B="";else{B=+B;var oe=B<0||1/B<0;if(B=isNaN(B)?d:$(Math.abs(B),A),P&&(B=Zve(B)),oe&&+B==0&&b!=="+"&&(oe=!1),V=(oe?b==="("?b:u:b==="-"||b==="("?"":b)+V,X=(O==="s"&&!isNaN(B)&&Jy!==void 0?MM[8+Jy/3]:"")+X+(oe&&b==="("?")":""),F){for(Z=-1,H=B.length;++Z<H;)if(J=B.charCodeAt(Z),48>J||J>57){X=(J===46?i+B.slice(Z+1):B.slice(Z))+X,B=B.slice(0,Z);break}}}C&&!k&&(B=t(B,1/0));var ye=V.length+B.length+X.length,I=ye<E?new Array(E-ye+1).join(v):"";switch(C&&k&&(B=t(I+B,I.length?E-X.length:1/0),I=""),S){case"<":B=V+B+X+I;break;case"=":B=V+I+B+X;break;case"^":B=I.slice(0,ye=I.length>>1)+V+B+X+I.slice(ye);break;default:B=I+V+B+X;break}return a(B)}return U.toString=function(){return m+""},U}function p(m,g){var v=Math.max(-8,Math.min(8,Math.floor(sd(g)/3)))*3,S=Math.pow(10,-v),b=f((m=Bh(m),m.type="f",m),{suffix:MM[8+v/3]});return function(j){return b(S*j)}}return{format:f,formatPrefix:p}}var wg,LC,zU;exe({thousands:",",grouping:[3],currency:["$",""]});function exe(e){return wg=Jve(e),LC=wg.format,zU=wg.formatPrefix,wg}function txe(e){return Math.max(0,-sd(Math.abs(e)))}function nxe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(sd(t)/3)))*3-sd(Math.abs(e)))}function rxe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,sd(t)-sd(e))+1}function PU(e,t,n,r){var i=nN(e,t,n),a;switch(r=Bh(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=nxe(i,l))&&(r.precision=a),zU(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=rxe(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=txe(i))&&(r.precision=a-(r.type==="%")*2);break}}return LC(r)}function tl(e){var t=e.domain;return e.ticks=function(n){var r=t();return eN(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return PU(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,l=r[i],u=r[a],d,f,p=10;for(u<l&&(f=l,l=u,u=f,f=i,i=a,a=f);p-- >0;){if(f=tN(l,u,n),f===d)return r[i]=l,r[a]=u,t(r);if(f>0)l=Math.floor(l/f)*f,u=Math.ceil(u/f)*f;else if(f<0)l=Math.ceil(l*f)/f,u=Math.floor(u*f)/f;else break;d=f}return e},e}function TU(){var e=MC();return e.copy=function(){return hp(e,TU())},Wi.apply(e,arguments),tl(e)}function RU(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,Zy),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return RU(e).unknown(t)},e=arguments.length?Array.from(e,Zy):[0,1],tl(n)}function DU(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],l;return a<i&&(l=n,n=r,r=l,l=i,i=a,a=l),e[n]=t.floor(i),e[r]=t.ceil(a),e}function IM(e){return Math.log(e)}function LM(e){return Math.exp(e)}function ixe(e){return-Math.log(-e)}function axe(e){return-Math.exp(-e)}function sxe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function oxe(e){return e===10?sxe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function lxe(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 $M(e){return(t,n)=>-e(-t,n)}function $C(e){const t=e(IM,LM),n=t.domain;let r=10,i,a;function l(){return i=lxe(r),a=oxe(r),n()[0]<0?(i=$M(i),a=$M(a),e(ixe,axe)):e(IM,LM),t}return t.base=function(u){return arguments.length?(r=+u,l()):r},t.domain=function(u){return arguments.length?(n(u),l()):n()},t.ticks=u=>{const d=n();let f=d[0],p=d[d.length-1];const m=p<f;m&&([f,p]=[p,f]);let g=i(f),v=i(p),S,b;const j=u==null?10:+u;let k=[];if(!(r%1)&&v-g<j){if(g=Math.floor(g),v=Math.ceil(v),f>0){for(;g<=v;++g)for(S=1;S<r;++S)if(b=g<0?S/a(-g):S*a(g),!(b<f)){if(b>p)break;k.push(b)}}else for(;g<=v;++g)for(S=r-1;S>=1;--S)if(b=g>0?S/a(-g):S*a(g),!(b<f)){if(b>p)break;k.push(b)}k.length*2<j&&(k=eN(f,p,j))}else k=eN(g,v,Math.min(v-g,j)).map(a);return m?k.reverse():k},t.tickFormat=(u,d)=>{if(u==null&&(u=10),d==null&&(d=r===10?"s":","),typeof d!="function"&&(!(r%1)&&(d=Bh(d)).precision==null&&(d.trim=!0),d=LC(d)),u===1/0)return d;const f=Math.max(1,r*u/t.ticks().length);return p=>{let m=p/a(Math.round(i(p)));return m*r<r-.5&&(m*=r),m<=f?d(p):""}},t.nice=()=>n(DU(n(),{floor:u=>a(Math.floor(i(u))),ceil:u=>a(Math.ceil(i(u)))})),t}function MU(){const e=$C(Tx()).domain([1,10]);return e.copy=()=>hp(e,MU()).base(e.base()),Wi.apply(e,arguments),e}function BM(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function UM(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function BC(e){var t=1,n=e(BM(t),UM(t));return n.constant=function(r){return arguments.length?e(BM(t=+r),UM(t)):t},tl(n)}function IU(){var e=BC(Tx());return e.copy=function(){return hp(e,IU()).constant(e.constant())},Wi.apply(e,arguments)}function qM(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function cxe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function uxe(e){return e<0?-e*e:e*e}function UC(e){var t=e(Tr,Tr),n=1;function r(){return n===1?e(Tr,Tr):n===.5?e(cxe,uxe):e(qM(n),qM(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},tl(t)}function qC(){var e=UC(Tx());return e.copy=function(){return hp(e,qC()).exponent(e.exponent())},Wi.apply(e,arguments),e}function dxe(){return qC.apply(null,arguments).exponent(.5)}function FM(e){return Math.sign(e)*e*e}function fxe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function LU(){var e=MC(),t=[0,1],n=!1,r;function i(a){var l=fxe(e(a));return isNaN(l)?r:n?Math.round(l):l}return i.invert=function(a){return e.invert(FM(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,Zy)).map(FM)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(n=!!a,i):n},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return LU(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Wi.apply(i,arguments),tl(i)}function $U(){var e=[],t=[],n=[],r;function i(){var l=0,u=Math.max(1,t.length);for(n=new Array(u-1);++l<u;)n[l-1]=gve(e,l/u);return a}function a(l){return l==null||isNaN(l=+l)?r:t[dp(n,l)]}return a.invertExtent=function(l){var u=t.indexOf(l);return u<0?[NaN,NaN]:[u>0?n[u-1]:e[0],u<n.length?n[u]:e[e.length-1]]},a.domain=function(l){if(!arguments.length)return e.slice();e=[];for(let u of l)u!=null&&!isNaN(u=+u)&&e.push(u);return e.sort(Bo),i()},a.range=function(l){return arguments.length?(t=Array.from(l),i()):t.slice()},a.unknown=function(l){return arguments.length?(r=l,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return $U().domain(e).range(t).unknown(r)},Wi.apply(a,arguments)}function BU(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function l(d){return d!=null&&d<=d?i[dp(r,d,0,n)]:a}function u(){var d=-1;for(r=new Array(n);++d<n;)r[d]=((d+1)*t-(d-n)*e)/(n+1);return l}return l.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,u()):[e,t]},l.range=function(d){return arguments.length?(n=(i=Array.from(d)).length-1,u()):i.slice()},l.invertExtent=function(d){var f=i.indexOf(d);return f<0?[NaN,NaN]:f<1?[e,r[0]]:f>=n?[r[n-1],t]:[r[f-1],r[f]]},l.unknown=function(d){return arguments.length&&(a=d),l},l.thresholds=function(){return r.slice()},l.copy=function(){return BU().domain([e,t]).range(i).unknown(a)},Wi.apply(tl(l),arguments)}function UU(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[dp(e,a,0,r)]:n}return i.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var l=t.indexOf(a);return[e[l-1],e[l]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return UU().domain(e).range(t).unknown(n)},Wi.apply(i,arguments)}const uj=new Date,dj=new Date;function Yn(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const l=i(a),u=i.ceil(a);return a-l<u-a?l:u},i.offset=(a,l)=>(t(a=new Date(+a),l==null?1:Math.floor(l)),a),i.range=(a,l,u)=>{const d=[];if(a=i.ceil(a),u=u==null?1:Math.floor(u),!(a<l)||!(u>0))return d;let f;do d.push(f=new Date(+a)),t(a,u),e(a);while(f<a&&a<l);return d},i.filter=a=>Yn(l=>{if(l>=l)for(;e(l),!a(l);)l.setTime(l-1)},(l,u)=>{if(l>=l)if(u<0)for(;++u<=0;)for(;t(l,-1),!a(l););else for(;--u>=0;)for(;t(l,1),!a(l););}),n&&(i.count=(a,l)=>(uj.setTime(+a),dj.setTime(+l),e(uj),e(dj),Math.floor(n(uj,dj))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?l=>r(l)%a===0:l=>i.count(0,l)%a===0):i)),i}const ev=Yn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ev.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Yn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):ev);ev.range;const Ns=1e3,Ui=Ns*60,ks=Ui*60,Ps=ks*24,FC=Ps*7,HM=Ps*30,fj=Ps*365,ql=Yn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ns)},(e,t)=>(t-e)/Ns,e=>e.getUTCSeconds());ql.range;const HC=Yn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ns)},(e,t)=>{e.setTime(+e+t*Ui)},(e,t)=>(t-e)/Ui,e=>e.getMinutes());HC.range;const KC=Yn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ui)},(e,t)=>(t-e)/Ui,e=>e.getUTCMinutes());KC.range;const GC=Yn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ns-e.getMinutes()*Ui)},(e,t)=>{e.setTime(+e+t*ks)},(e,t)=>(t-e)/ks,e=>e.getHours());GC.range;const VC=Yn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ks)},(e,t)=>(t-e)/ks,e=>e.getUTCHours());VC.range;const pp=Yn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ui)/Ps,e=>e.getDate()-1);pp.range;const Rx=Yn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ps,e=>e.getUTCDate()-1);Rx.range;const qU=Yn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ps,e=>Math.floor(e/Ps));qU.range;function kc(e){return Yn(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())*Ui)/FC)}const Dx=kc(0),tv=kc(1),hxe=kc(2),pxe=kc(3),od=kc(4),mxe=kc(5),gxe=kc(6);Dx.range;tv.range;hxe.range;pxe.range;od.range;mxe.range;gxe.range;function Cc(e){return Yn(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)/FC)}const Mx=Cc(0),nv=Cc(1),yxe=Cc(2),vxe=Cc(3),ld=Cc(4),xxe=Cc(5),bxe=Cc(6);Mx.range;nv.range;yxe.range;vxe.range;ld.range;xxe.range;bxe.range;const QC=Yn(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());QC.range;const YC=Yn(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());YC.range;const Ts=Yn(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());Ts.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Yn(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)});Ts.range;const Rs=Yn(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());Rs.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Yn(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)});Rs.range;function FU(e,t,n,r,i,a){const l=[[ql,1,Ns],[ql,5,5*Ns],[ql,15,15*Ns],[ql,30,30*Ns],[a,1,Ui],[a,5,5*Ui],[a,15,15*Ui],[a,30,30*Ui],[i,1,ks],[i,3,3*ks],[i,6,6*ks],[i,12,12*ks],[r,1,Ps],[r,2,2*Ps],[n,1,FC],[t,1,HM],[t,3,3*HM],[e,1,fj]];function u(f,p,m){const g=p<f;g&&([f,p]=[p,f]);const v=m&&typeof m.range=="function"?m:d(f,p,m),S=v?v.range(f,+p+1):[];return g?S.reverse():S}function d(f,p,m){const g=Math.abs(p-f)/m,v=_C(([,,j])=>j).right(l,g);if(v===l.length)return e.every(nN(f/fj,p/fj,m));if(v===0)return ev.every(Math.max(nN(f,p,m),1));const[S,b]=l[g/l[v-1][2]<l[v][2]/g?v-1:v];return S.every(b)}return[u,d]}const[wxe,Sxe]=FU(Rs,YC,Mx,qU,VC,KC),[jxe,Nxe]=FU(Ts,QC,Dx,pp,GC,HC);function hj(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 pj(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 Vf(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function kxe(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,l=e.shortDays,u=e.months,d=e.shortMonths,f=Qf(i),p=Yf(i),m=Qf(a),g=Yf(a),v=Qf(l),S=Yf(l),b=Qf(u),j=Yf(u),k=Qf(d),E=Yf(d),C={a:J,A:oe,b:ye,B:I,c:null,d:WM,e:WM,f:Qxe,g:i0e,G:s0e,H:Kxe,I:Gxe,j:Vxe,L:HU,m:Yxe,M:Wxe,p:M,q,Q:JM,s:eI,S:Zxe,u:Xxe,U:Jxe,V:e0e,w:t0e,W:n0e,x:null,X:null,y:r0e,Y:a0e,Z:o0e,"%":XM},A={a:D,A:G,b:se,B:ne,c:null,d:ZM,e:ZM,f:d0e,g:w0e,G:j0e,H:l0e,I:c0e,j:u0e,L:GU,m:f0e,M:h0e,p:Ce,q:je,Q:JM,s:eI,S:p0e,u:m0e,U:g0e,V:y0e,w:v0e,W:x0e,x:null,X:null,y:b0e,Y:S0e,Z:N0e,"%":XM},P={a:F,A:U,b:B,B:V,c:X,d:QM,e:QM,f:Uxe,g:VM,G:GM,H:YM,I:YM,j:Ixe,L:Bxe,m:Mxe,M:Lxe,p:$,q:Dxe,Q:Fxe,s:Hxe,S:$xe,u:_xe,U:zxe,V:Pxe,w:Exe,W:Txe,x:Z,X:H,y:VM,Y:GM,Z:Rxe,"%":qxe};C.x=O(n,C),C.X=O(r,C),C.c=O(t,C),A.x=O(n,A),A.X=O(r,A),A.c=O(t,A);function O(ee,pe){return function(Ee){var W=[],He=-1,Te=0,st=ee.length,Ve,Ht,Lt;for(Ee instanceof Date||(Ee=new Date(+Ee));++He<st;)ee.charCodeAt(He)===37&&(W.push(ee.slice(Te,He)),(Ht=KM[Ve=ee.charAt(++He)])!=null?Ve=ee.charAt(++He):Ht=Ve==="e"?" ":"0",(Lt=pe[Ve])&&(Ve=Lt(Ee,Ht)),W.push(Ve),Te=He+1);return W.push(ee.slice(Te,He)),W.join("")}}function _(ee,pe){return function(Ee){var W=Vf(1900,void 0,1),He=T(W,ee,Ee+="",0),Te,st;if(He!=Ee.length)return null;if("Q"in W)return new Date(W.Q);if("s"in W)return new Date(W.s*1e3+("L"in W?W.L:0));if(pe&&!("Z"in W)&&(W.Z=0),"p"in W&&(W.H=W.H%12+W.p*12),W.m===void 0&&(W.m="q"in W?W.q:0),"V"in W){if(W.V<1||W.V>53)return null;"w"in W||(W.w=1),"Z"in W?(Te=pj(Vf(W.y,0,1)),st=Te.getUTCDay(),Te=st>4||st===0?nv.ceil(Te):nv(Te),Te=Rx.offset(Te,(W.V-1)*7),W.y=Te.getUTCFullYear(),W.m=Te.getUTCMonth(),W.d=Te.getUTCDate()+(W.w+6)%7):(Te=hj(Vf(W.y,0,1)),st=Te.getDay(),Te=st>4||st===0?tv.ceil(Te):tv(Te),Te=pp.offset(Te,(W.V-1)*7),W.y=Te.getFullYear(),W.m=Te.getMonth(),W.d=Te.getDate()+(W.w+6)%7)}else("W"in W||"U"in W)&&("w"in W||(W.w="u"in W?W.u%7:"W"in W?1:0),st="Z"in W?pj(Vf(W.y,0,1)).getUTCDay():hj(Vf(W.y,0,1)).getDay(),W.m=0,W.d="W"in W?(W.w+6)%7+W.W*7-(st+5)%7:W.w+W.U*7-(st+6)%7);return"Z"in W?(W.H+=W.Z/100|0,W.M+=W.Z%100,pj(W)):hj(W)}}function T(ee,pe,Ee,W){for(var He=0,Te=pe.length,st=Ee.length,Ve,Ht;He<Te;){if(W>=st)return-1;if(Ve=pe.charCodeAt(He++),Ve===37){if(Ve=pe.charAt(He++),Ht=P[Ve in KM?pe.charAt(He++):Ve],!Ht||(W=Ht(ee,Ee,W))<0)return-1}else if(Ve!=Ee.charCodeAt(W++))return-1}return W}function $(ee,pe,Ee){var W=f.exec(pe.slice(Ee));return W?(ee.p=p.get(W[0].toLowerCase()),Ee+W[0].length):-1}function F(ee,pe,Ee){var W=v.exec(pe.slice(Ee));return W?(ee.w=S.get(W[0].toLowerCase()),Ee+W[0].length):-1}function U(ee,pe,Ee){var W=m.exec(pe.slice(Ee));return W?(ee.w=g.get(W[0].toLowerCase()),Ee+W[0].length):-1}function B(ee,pe,Ee){var W=k.exec(pe.slice(Ee));return W?(ee.m=E.get(W[0].toLowerCase()),Ee+W[0].length):-1}function V(ee,pe,Ee){var W=b.exec(pe.slice(Ee));return W?(ee.m=j.get(W[0].toLowerCase()),Ee+W[0].length):-1}function X(ee,pe,Ee){return T(ee,t,pe,Ee)}function Z(ee,pe,Ee){return T(ee,n,pe,Ee)}function H(ee,pe,Ee){return T(ee,r,pe,Ee)}function J(ee){return l[ee.getDay()]}function oe(ee){return a[ee.getDay()]}function ye(ee){return d[ee.getMonth()]}function I(ee){return u[ee.getMonth()]}function M(ee){return i[+(ee.getHours()>=12)]}function q(ee){return 1+~~(ee.getMonth()/3)}function D(ee){return l[ee.getUTCDay()]}function G(ee){return a[ee.getUTCDay()]}function se(ee){return d[ee.getUTCMonth()]}function ne(ee){return u[ee.getUTCMonth()]}function Ce(ee){return i[+(ee.getUTCHours()>=12)]}function je(ee){return 1+~~(ee.getUTCMonth()/3)}return{format:function(ee){var pe=O(ee+="",C);return pe.toString=function(){return ee},pe},parse:function(ee){var pe=_(ee+="",!1);return pe.toString=function(){return ee},pe},utcFormat:function(ee){var pe=O(ee+="",A);return pe.toString=function(){return ee},pe},utcParse:function(ee){var pe=_(ee+="",!0);return pe.toString=function(){return ee},pe}}}var KM={"-":"",_:" ",0:"0"},ar=/^\s*\d+/,Cxe=/^%/,Axe=/[\\^$*+?|[\]().{}]/g;function Ot(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function Oxe(e){return e.replace(Axe,"\\$&")}function Qf(e){return new RegExp("^(?:"+e.map(Oxe).join("|")+")","i")}function Yf(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Exe(e,t,n){var r=ar.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function _xe(e,t,n){var r=ar.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function zxe(e,t,n){var r=ar.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Pxe(e,t,n){var r=ar.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Txe(e,t,n){var r=ar.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function GM(e,t,n){var r=ar.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function VM(e,t,n){var r=ar.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Rxe(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 Dxe(e,t,n){var r=ar.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Mxe(e,t,n){var r=ar.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function QM(e,t,n){var r=ar.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Ixe(e,t,n){var r=ar.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function YM(e,t,n){var r=ar.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Lxe(e,t,n){var r=ar.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function $xe(e,t,n){var r=ar.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Bxe(e,t,n){var r=ar.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Uxe(e,t,n){var r=ar.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function qxe(e,t,n){var r=Cxe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Fxe(e,t,n){var r=ar.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Hxe(e,t,n){var r=ar.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function WM(e,t){return Ot(e.getDate(),t,2)}function Kxe(e,t){return Ot(e.getHours(),t,2)}function Gxe(e,t){return Ot(e.getHours()%12||12,t,2)}function Vxe(e,t){return Ot(1+pp.count(Ts(e),e),t,3)}function HU(e,t){return Ot(e.getMilliseconds(),t,3)}function Qxe(e,t){return HU(e,t)+"000"}function Yxe(e,t){return Ot(e.getMonth()+1,t,2)}function Wxe(e,t){return Ot(e.getMinutes(),t,2)}function Zxe(e,t){return Ot(e.getSeconds(),t,2)}function Xxe(e){var t=e.getDay();return t===0?7:t}function Jxe(e,t){return Ot(Dx.count(Ts(e)-1,e),t,2)}function KU(e){var t=e.getDay();return t>=4||t===0?od(e):od.ceil(e)}function e0e(e,t){return e=KU(e),Ot(od.count(Ts(e),e)+(Ts(e).getDay()===4),t,2)}function t0e(e){return e.getDay()}function n0e(e,t){return Ot(tv.count(Ts(e)-1,e),t,2)}function r0e(e,t){return Ot(e.getFullYear()%100,t,2)}function i0e(e,t){return e=KU(e),Ot(e.getFullYear()%100,t,2)}function a0e(e,t){return Ot(e.getFullYear()%1e4,t,4)}function s0e(e,t){var n=e.getDay();return e=n>=4||n===0?od(e):od.ceil(e),Ot(e.getFullYear()%1e4,t,4)}function o0e(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ot(t/60|0,"0",2)+Ot(t%60,"0",2)}function ZM(e,t){return Ot(e.getUTCDate(),t,2)}function l0e(e,t){return Ot(e.getUTCHours(),t,2)}function c0e(e,t){return Ot(e.getUTCHours()%12||12,t,2)}function u0e(e,t){return Ot(1+Rx.count(Rs(e),e),t,3)}function GU(e,t){return Ot(e.getUTCMilliseconds(),t,3)}function d0e(e,t){return GU(e,t)+"000"}function f0e(e,t){return Ot(e.getUTCMonth()+1,t,2)}function h0e(e,t){return Ot(e.getUTCMinutes(),t,2)}function p0e(e,t){return Ot(e.getUTCSeconds(),t,2)}function m0e(e){var t=e.getUTCDay();return t===0?7:t}function g0e(e,t){return Ot(Mx.count(Rs(e)-1,e),t,2)}function VU(e){var t=e.getUTCDay();return t>=4||t===0?ld(e):ld.ceil(e)}function y0e(e,t){return e=VU(e),Ot(ld.count(Rs(e),e)+(Rs(e).getUTCDay()===4),t,2)}function v0e(e){return e.getUTCDay()}function x0e(e,t){return Ot(nv.count(Rs(e)-1,e),t,2)}function b0e(e,t){return Ot(e.getUTCFullYear()%100,t,2)}function w0e(e,t){return e=VU(e),Ot(e.getUTCFullYear()%100,t,2)}function S0e(e,t){return Ot(e.getUTCFullYear()%1e4,t,4)}function j0e(e,t){var n=e.getUTCDay();return e=n>=4||n===0?ld(e):ld.ceil(e),Ot(e.getUTCFullYear()%1e4,t,4)}function N0e(){return"+0000"}function XM(){return"%"}function JM(e){return+e}function eI(e){return Math.floor(+e/1e3)}var vu,QU,YU;k0e({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 k0e(e){return vu=kxe(e),QU=vu.format,vu.parse,YU=vu.utcFormat,vu.utcParse,vu}function C0e(e){return new Date(e)}function A0e(e){return e instanceof Date?+e:+new Date(+e)}function WC(e,t,n,r,i,a,l,u,d,f){var p=MC(),m=p.invert,g=p.domain,v=f(".%L"),S=f(":%S"),b=f("%I:%M"),j=f("%I %p"),k=f("%a %d"),E=f("%b %d"),C=f("%B"),A=f("%Y");function P(O){return(d(O)<O?v:u(O)<O?S:l(O)<O?b:a(O)<O?j:r(O)<O?i(O)<O?k:E:n(O)<O?C:A)(O)}return p.invert=function(O){return new Date(m(O))},p.domain=function(O){return arguments.length?g(Array.from(O,A0e)):g().map(C0e)},p.ticks=function(O){var _=g();return e(_[0],_[_.length-1],O??10)},p.tickFormat=function(O,_){return _==null?P:f(_)},p.nice=function(O){var _=g();return(!O||typeof O.range!="function")&&(O=t(_[0],_[_.length-1],O??10)),O?g(DU(_,O)):p},p.copy=function(){return hp(p,WC(e,t,n,r,i,a,l,u,d,f))},p}function O0e(){return Wi.apply(WC(jxe,Nxe,Ts,QC,Dx,pp,GC,HC,ql,QU).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function E0e(){return Wi.apply(WC(wxe,Sxe,Rs,YC,Mx,Rx,VC,KC,ql,YU).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Ix(){var e=0,t=1,n,r,i,a,l=Tr,u=!1,d;function f(m){return m==null||isNaN(m=+m)?d:l(i===0?.5:(m=(a(m)-n)*i,u?Math.max(0,Math.min(1,m)):m))}f.domain=function(m){return arguments.length?([e,t]=m,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),f):[e,t]},f.clamp=function(m){return arguments.length?(u=!!m,f):u},f.interpolator=function(m){return arguments.length?(l=m,f):l};function p(m){return function(g){var v,S;return arguments.length?([v,S]=g,l=m(v,S),f):[l(0),l(1)]}}return f.range=p(_d),f.rangeRound=p(DC),f.unknown=function(m){return arguments.length?(d=m,f):d},function(m){return a=m,n=m(e),r=m(t),i=n===r?0:1/(r-n),f}}function nl(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function WU(){var e=tl(Ix()(Tr));return e.copy=function(){return nl(e,WU())},Us.apply(e,arguments)}function ZU(){var e=$C(Ix()).domain([1,10]);return e.copy=function(){return nl(e,ZU()).base(e.base())},Us.apply(e,arguments)}function XU(){var e=BC(Ix());return e.copy=function(){return nl(e,XU()).constant(e.constant())},Us.apply(e,arguments)}function ZC(){var e=UC(Ix());return e.copy=function(){return nl(e,ZC()).exponent(e.exponent())},Us.apply(e,arguments)}function _0e(){return ZC.apply(null,arguments).exponent(.5)}function JU(){var e=[],t=Tr;function n(r){if(r!=null&&!isNaN(r=+r))return t((dp(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(Bo),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,a)=>mve(e,a/r))},n.copy=function(){return JU(t).domain(e)},Us.apply(n,arguments)}function Lx(){var e=0,t=.5,n=1,r=1,i,a,l,u,d,f=Tr,p,m=!1,g;function v(b){return isNaN(b=+b)?g:(b=.5+((b=+p(b))-a)*(r*b<r*a?u:d),f(m?Math.max(0,Math.min(1,b)):b))}v.domain=function(b){return arguments.length?([e,t,n]=b,i=p(e=+e),a=p(t=+t),l=p(n=+n),u=i===a?0:.5/(a-i),d=a===l?0:.5/(l-a),r=a<i?-1:1,v):[e,t,n]},v.clamp=function(b){return arguments.length?(m=!!b,v):m},v.interpolator=function(b){return arguments.length?(f=b,v):f};function S(b){return function(j){var k,E,C;return arguments.length?([k,E,C]=j,f=qve(b,[k,E,C]),v):[f(0),f(.5),f(1)]}}return v.range=S(_d),v.rangeRound=S(DC),v.unknown=function(b){return arguments.length?(g=b,v):g},function(b){return p=b,i=b(e),a=b(t),l=b(n),u=i===a?0:.5/(a-i),d=a===l?0:.5/(l-a),r=a<i?-1:1,v}}function eq(){var e=tl(Lx()(Tr));return e.copy=function(){return nl(e,eq())},Us.apply(e,arguments)}function tq(){var e=$C(Lx()).domain([.1,1,10]);return e.copy=function(){return nl(e,tq()).base(e.base())},Us.apply(e,arguments)}function nq(){var e=BC(Lx());return e.copy=function(){return nl(e,nq()).constant(e.constant())},Us.apply(e,arguments)}function XC(){var e=UC(Lx());return e.copy=function(){return nl(e,XC()).exponent(e.exponent())},Us.apply(e,arguments)}function z0e(){return XC.apply(null,arguments).exponent(.5)}const rq=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:PC,scaleDiverging:eq,scaleDivergingLog:tq,scaleDivergingPow:XC,scaleDivergingSqrt:z0e,scaleDivergingSymlog:nq,scaleIdentity:RU,scaleImplicit:rN,scaleLinear:TU,scaleLog:MU,scaleOrdinal:zC,scalePoint:vve,scalePow:qC,scaleQuantile:$U,scaleQuantize:BU,scaleRadial:LU,scaleSequential:WU,scaleSequentialLog:ZU,scaleSequentialPow:ZC,scaleSequentialQuantile:JU,scaleSequentialSqrt:_0e,scaleSequentialSymlog:XU,scaleSqrt:dxe,scaleSymlog:IU,scaleThreshold:UU,scaleTime:O0e,scaleUtc:E0e,tickFormat:PU},Symbol.toStringTag,{value:"Module"}));function P0e(e){var t=rq;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(tp(e));if(n in t&&typeof t[n]=="function")return t[n]()}function tI(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=P0e(e);if(r!=null)return r.domain(t).range(n),r}}function JC(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?tI(e.scale,n,r):tI(t,n,r)}function T0e(e){return"scale".concat(tp(e))}function R0e(e){return T0e(e)in rq}var iq=(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 R0e(r)?r:"point"}};function D0e(e,t){for(var n=0,r=e.length,i=e[0]<e[e.length-1];n<r;){var a=Math.floor((n+r)/2);(i?e[a]<t:e[a]>t)?n=a+1:r=a}return n}function aq(e,t){if(e){var n=t??e.domain(),r=n.map(a=>{var l;return(l=e(a))!==null&&l!==void 0?l:0}),i=e.range();if(!(n.length===0||i.length<2))return a=>{var l,u,d=D0e(r,a);if(d<=0)return n[0];if(d>=n.length)return n[n.length-1];var f=(l=r[d-1])!==null&&l!==void 0?l:0,p=(u=r[d])!==null&&u!==void 0?u:0;return Math.abs(a-f)<=Math.abs(a-p)?n[d-1]:n[d]}}}function M0e(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):aq(e,void 0)}function nI(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 rv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nI(Object(n),!0).forEach(function(r){I0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function I0e(e,t,n){return(t=L0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L0e(e){var t=$0e(e,"string");return typeof t=="symbol"?t:t+""}function $0e(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 oN=[0,"auto"],Kn={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"},sq=(e,t)=>e.cartesianAxis.xAxis[t],qs=(e,t)=>{var n=sq(e,t);return n??Kn},Gn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:oN,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:ip},oq=(e,t)=>e.cartesianAxis.yAxis[t],Fs=(e,t)=>{var n=oq(e,t);return n??Gn},B0e={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:""},eA=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??B0e},Ir=(e,t,n)=>{switch(t){case"xAxis":return qs(e,n);case"yAxis":return Fs(e,n);case"zAxis":return eA(e,n);case"angleAxis":return CC(e,n);case"radiusAxis":return AC(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},U0e=(e,t,n)=>{switch(t){case"xAxis":return qs(e,n);case"yAxis":return Fs(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},mp=(e,t,n)=>{switch(t){case"xAxis":return qs(e,n);case"yAxis":return Fs(e,n);case"angleAxis":return CC(e,n);case"radiusAxis":return AC(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},lq=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function cq(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 gp=e=>e.graphicalItems.cartesianItems,q0e=re([rr,Ox],cq),uq=(e,t,n)=>e.filter(n).filter(r=>t?.includeHidden===!0?!0:!r.hide),zd=re([gp,Ir,q0e],uq,{memoizeOptions:{resultEqualityCheck:Px}}),dq=re([zd],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(_x)),fq=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),F0e=re([zd],fq),hq=e=>e.map(t=>t.data).filter(Boolean).flat(1),H0e=re([zd],e=>e.some(t=>!t.data)),pq=re([zd],hq,{memoizeOptions:{resultEqualityCheck:Px}}),mq=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},tA=re([pq,up],mq),K0e=(e,t,n)=>t?.dataKey!=null?e.map(r=>({value:vn(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:vn(i,r)}))):e.map(r=>({value:r})),gq=(e,t,n,r,i,a)=>{var{chartData:l=[],dataStartIndex:u,dataEndIndex:d}=r,f=K0e(e,t,n);if(i&&t?.dataKey!=null&&a.length>0){var p=l.slice(u,d+1),m=p.map(g=>({value:vn(g,t.dataKey)})).filter(g=>g.value!=null);return[...m,...f]}return f},yp=re([tA,Ir,zd,up,H0e,pq],gq);function Ku(e){if(Fa(e)||e instanceof Date){var t=Number(e);if(ht(t))return t}}function rI(e){if(Array.isArray(e)){var t=[Ku(e[0]),Ku(e[1])];return La(t)?t:void 0}var n=Ku(e);if(n!=null)return[n,n]}function Ga(e){return e.map(Ku).filter(Yr)}function G0e(e,t){var n=Ku(e),r=Ku(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var V0e=re([yp],e=>e?.map(t=>t.value).sort(G0e));function yq(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function Q0e(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!da(t))r=t;else if(Array.isArray(t)){var i=Ga(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:Ga(n.flatMap(a=>{var l=vn(e,a.dataKey),u,d;if(Array.isArray(l)?[u,d]=l:u=d=l,!(!ht(u)||!ht(d)))return[r-u,r+d]}))}var Wn=e=>{var t=ir(e),n=Ed(e);return mp(e,t,n)},cd=re([Wn],e=>e?.dataKey),Y0e=re([dq,up,Wn],jU),vq=(e,t,n,r)=>{var i={},a=t.reduce((l,u)=>{if(u.stackId==null)return l;var d=l[u.stackId];return d==null&&(d=[]),d.push(u),l[u.stackId]=d,l},i);return Object.fromEntries(Object.entries(a).map(l=>{var[u,d]=l,f=r?[...d].reverse():d,p=f.map(Ex);return[u,{stackedData:zpe(e,p,n),graphicalItems:f}]}))},iv=re([Y0e,dq,Nx,gU],vq),xq=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var l=Dpe(e,i,a);if(!(l!=null&&l[0]===0&&l[1]===0))return l}},W0e=re([Ir],e=>e.allowDataOverflow),nA=e=>{var t;if(e==null||!("domain"in e))return oN;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Ga(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:oN},bq=re([Ir],nA),wq=re([bq,W0e],rU),Z0e=re([iv,xa,rr,wq],xq,{memoizeOptions:{resultEqualityCheck:zx}}),rA=e=>e.errorBars,X0e=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>yq(n,r)),av=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 a=i.flat(),l=Math.min(...a),u=Math.max(...a);return[l,u]}},Sq=function(t,n,r,i,a){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],u,d;if(r.length>0&&r.forEach(f=>{var p,m=f.data!=null?[...f.data]:l,g=(p=i[f.id])===null||p===void 0?void 0:p.filter(v=>yq(a,v));m.forEach(v=>{var S,b=vn(v,(S=n.dataKey)!==null&&S!==void 0?S:f.dataKey),j=Q0e(v,b,g);if(j.length>=2){var k=Math.min(...j),E=Math.max(...j);(u==null||k<u)&&(u=k),(d==null||E>d)&&(d=E)}var C=rI(b);C!=null&&(u=u==null?C[0]:Math.min(u,C[0]),d=d==null?C[1]:Math.max(d,C[1]))})}),n?.dataKey!=null&&r.length===0&&t.forEach(f=>{var p=rI(vn(f,n.dataKey));p!=null&&(u=u==null?p[0]:Math.min(u,p[0]),d=d==null?p[1]:Math.max(d,p[1]))}),ht(u)&&ht(d))return[u,d]},J0e=re([tA,Ir,F0e,rA,rr,Bye],Sq,{memoizeOptions:{resultEqualityCheck:zx}});function ebe(e){var{value:t}=e;if(Fa(t)||t instanceof Date)return t}var tbe=(e,t,n)=>{var r=e.map(ebe).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&PB(r))?tU(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},jq=e=>e.referenceElements.dots,Pd=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),nbe=re([jq,rr,Ox],Pd),Nq=e=>e.referenceElements.areas,rbe=re([Nq,rr,Ox],Pd),kq=e=>e.referenceElements.lines,ibe=re([kq,rr,Ox],Pd),Cq=(e,t)=>{if(e!=null){var n=Ga(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},abe=re(nbe,rr,Cq),Aq=(e,t)=>{if(e!=null){var n=Ga(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)]}},sbe=re([rbe,rr],Aq);function obe(e){var t;if(e.x!=null)return Ga([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:Ga(n)}function lbe(e){var t;if(e.y!=null)return Ga([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:Ga(n)}var Oq=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?obe(r):lbe(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},cbe=re([ibe,rr],Oq),ube=re(abe,cbe,sbe,(e,t,n)=>av(e,n,t)),Eq=(e,t,n,r,i,a,l,u)=>{if(n!=null)return n;var d=l==="vertical"&&u==="xAxis"||l==="horizontal"&&u==="yAxis",f=d?av(r,a,i):av(a,i);return qye(t,f,e.allowDataOverflow)},dbe=re([Ir,bq,wq,Z0e,J0e,ube,Et,rr],Eq,{memoizeOptions:{resultEqualityCheck:zx}}),fbe=[0,1],_q=(e,t,n,r,i,a,l)=>{if(!((e==null||n==null||n.length===0)&&l===void 0)){var{dataKey:u,type:d}=e,f=va(t,a);if(f&&u==null){var p;return tU(0,(p=n?.length)!==null&&p!==void 0?p:0)}return d==="category"?tbe(r,e,f):i==="expand"&&!f?fbe:l}},iA=re([Ir,Et,tA,yp,Nx,rr,dbe],_q),Td=re([Ir,lq,jC],iq),zq=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=nA(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&La(e)){if(a)return hM(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return pM(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&La(e))return hM(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&La(e))return pM(e,t.tickCount,t.allowDecimals,"adaptive")}}},aA=re([iA,mp,Td],zq),Pq=(e,t,n,r)=>{if(r!=="angleAxis"&&e?.type==="number"&&La(t)&&Array.isArray(n)&&n.length>0){var i,a,l=t[0],u=(i=n[0])!==null&&i!==void 0?i:0,d=t[1],f=(a=n[n.length-1])!==null&&a!==void 0?a:0;return[Math.min(l,u),Math.max(d,f)]}return t},hbe=re([Ir,iA,aA,rr],Pq),pbe=re(yp,Ir,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Ga(e.map(m=>m.value))).sort((m,g)=>m-g),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var l=a-i;if(l===0)return 1/0;for(var u=0;u<r.length-1;u++){var d=r[u],f=r[u+1];if(!(d==null||f==null)){var p=f-d;n=Math.min(n,p)}}return n/l}}),Tq=re(pbe,Et,mU,tr,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!ht(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var l=fa(n,e*a),u=e*a/2;return u-l-(u-l)/a*l}return 0}),mbe=(e,t,n)=>{var r=qs(e,t);return r==null||typeof r.padding!="string"?0:Tq(e,"xAxis",t,n,r.padding)},gbe=(e,t,n)=>{var r=Fs(e,t);return r==null||typeof r.padding!="string"?0:Tq(e,"yAxis",t,n,r.padding)},ybe=re(qs,mbe,(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}}),vbe=re(Fs,gbe,(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}}),xbe=re([tr,ybe,xx,vx,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:a}=r;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),bbe=re([tr,Et,vbe,xx,vx,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:l}=i;return a?[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]}),vp=(e,t,n,r)=>{var i;switch(t){case"xAxis":return xbe(e,n,r);case"yAxis":return bbe(e,n,r);case"zAxis":return(i=eA(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return bU(e);case"radiusAxis":return wU(e,n);default:return}},Rq=re([Ir,vp],kx),wbe=re([Td,hbe],rve),sA=re([Ir,Td,wbe,Rq],JC),Dq=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,l=va(e,r);if(l&&(i==="number"||a!=="auto"))return t.map(u=>u.value)}},oA=re([Et,yp,mp,rr],Dq),$x=re([sA],EC);re([sA],M0e);re([sA,V0e],aq);re([zd,rA,rr],X0e);function Mq(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Bx=(e,t)=>t,Ux=(e,t,n)=>n,Sbe=re(gx,Bx,Ux,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(Mq)),jbe=re(yx,Bx,Ux,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(Mq)),Iq=(e,t)=>({width:e.width,height:t.height}),Nbe=(e,t)=>{var n=typeof t.width=="number"?t.width:ip;return{width:n,height:e.height}},Lq=re(tr,qs,Iq),kbe=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},Cbe=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},Abe=re(Bs,tr,Sbe,Bx,Ux,(e,t,n,r,i)=>{var a={},l;return n.forEach(u=>{var d=Iq(t,u);l==null&&(l=kbe(t,r,e));var f=r==="top"&&!i||r==="bottom"&&i;a[u.id]=l-Number(f)*d.height,l+=(f?-1:1)*d.height}),a}),Obe=re($s,tr,jbe,Bx,Ux,(e,t,n,r,i)=>{var a={},l;return n.forEach(u=>{var d=Nbe(t,u);l==null&&(l=Cbe(t,r,e));var f=r==="left"&&!i||r==="right"&&i;a[u.id]=l-Number(f)*d.width,l+=(f?-1:1)*d.width}),a}),Ebe=(e,t)=>{var n=qs(e,t);if(n!=null)return Abe(e,n.orientation,n.mirror)},_be=re([tr,qs,Ebe,(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}}}),zbe=(e,t)=>{var n=Fs(e,t);if(n!=null)return Obe(e,n.orientation,n.mirror)},Pbe=re([tr,Fs,zbe,(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}}}),$q=re(tr,Fs,(e,t)=>{var n=typeof t.width=="number"?t.width:ip;return{width:n,height:e.height}}),iI=(e,t,n)=>{switch(t){case"xAxis":return Lq(e,n).width;case"yAxis":return $q(e,n).height;default:return}},Bq=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:l}=n,u=va(e,r),d=t.map(p=>p.value),f=d.filter(p=>p!=null);if(l&&u&&a==="category"&&i&&PB(f))return d}},lA=re([Et,yp,Ir,rr],Bq),aI=re([Et,U0e,Td,$x,lA,oA,vp,aA,rr],(e,t,n,r,i,a,l,u,d)=>{if(t!=null){var f=va(e,d);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:d,categoricalDomain:a,duplicateDomain:i,isCategorical:f,niceTicks:u,range:l,realScaleType:n,scale:r}}}),Tbe=(e,t,n,r,i,a,l,u,d)=>{if(!(t==null||r==null)){var f=va(e,d),{type:p,ticks:m,tickCount:g}=t,v=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,S=p==="category"&&r.bandwidth?r.bandwidth()/v:0;S=d==="angleAxis"&&a!=null&&a.length>=2?Qr(a[0]-a[1])*2*S:S;var b=m||i;return b?b.map((j,k)=>{var E=l?l.indexOf(j):j,C=r.map(E);return ht(C)?{index:k,coordinate:C+S,value:j,offset:S}:null}).filter(Yr):f&&u?u.map((j,k)=>{var E=r.map(j);return ht(E)?{coordinate:E+S,value:j,index:k,offset:S}:null}).filter(Yr):r.ticks?r.ticks(g).map((j,k)=>{var E=r.map(j);return ht(E)?{coordinate:E+S,value:j,index:k,offset:S}:null}).filter(Yr):r.domain().map((j,k)=>{var E=r.map(j);return ht(E)?{coordinate:E+S,value:l?l[j]:j,index:k,offset:S}:null}).filter(Yr)}},Uq=re([Et,mp,Td,$x,aA,vp,lA,oA,rr],Tbe),Rbe=(e,t,n,r,i,a,l)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var u=va(e,l),{tickCount:d}=t,f=0;return f=l==="angleAxis"&&r?.length>=2?Qr(r[0]-r[1])*2*f:f,u&&a?a.map((p,m)=>{var g=n.map(p);return ht(g)?{coordinate:g+f,value:p,index:m,offset:f}:null}).filter(Yr):n.ticks?n.ticks(d).map((p,m)=>{var g=n.map(p);return ht(g)?{coordinate:g+f,value:p,index:m,offset:f}:null}).filter(Yr):n.domain().map((p,m)=>{var g=n.map(p);return ht(g)?{coordinate:g+f,value:i?i[p]:p,index:m,offset:f}:null}).filter(Yr)}},Va=re([Et,mp,$x,vp,lA,oA,rr],Rbe),Qa=re(Ir,$x,(e,t)=>{if(!(e==null||t==null))return rv(rv({},e),{},{scale:t})}),Dbe=re([Ir,Td,iA,Rq],JC),Mbe=re([Dbe],EC);re((e,t,n)=>eA(e,n),Mbe,(e,t)=>{if(!(e==null||t==null))return rv(rv({},e),{},{scale:t})});var Ibe=re([Et,gx,yx],(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}}),Lbe=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};re([Lbe],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,i=e[0];for(var a of e){var l=Math.abs(a.coordinate-t);l<r&&(r=l,i=a)}return(n=i)===null||n===void 0?void 0:n.value}});var qq=e=>e.options.defaultTooltipEventType,Fq=e=>e.options.validateTooltipEventTypes;function Hq(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function xp(e,t){var n=qq(e),r=Fq(e);return Hq(t,n,r)}function $be(e){return Ue(t=>xp(t,e))}var Kq=(e,t)=>{var n,r=Number(t);if(!(da(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},Bbe=e=>e.tooltip.settings,_o={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},Ube={itemInteraction:{click:_o,hover:_o},axisInteraction:{click:_o,hover:_o},keyboardInteraction:_o,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}},Gq=Ar({name:"tooltip",initialState:Ube,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:sn()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Bi(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:sn()},removeTooltipEntrySettings:{reducer(e,t){var n=Bi(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:sn()},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:qbe,replaceTooltipEntrySettings:Fbe,removeTooltipEntrySettings:Hbe,setTooltipSettingsState:Kbe,setActiveMouseOverItemIndex:Vq,mouseLeaveItem:Gbe,mouseLeaveChart:Qq,setActiveClickItemIndex:Vbe,setMouseOverAxisIndex:Yq,setMouseClickAxisIndex:Qbe,setSyncInteraction:rh,setKeyboardInteraction:sv}=Gq.actions,Ybe=Gq.reducer;function sI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sI(Object(n),!0).forEach(function(r){Wbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wbe(e,t,n){return(t=Zbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zbe(e){var t=Xbe(e,"string");return typeof t=="symbol"?t:t+""}function Xbe(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 Jbe(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function ewe(e){return e.index!=null}var Wq=(e,t,n,r)=>{if(t==null)return _o;var i=Jbe(e,t,n);if(i==null)return _o;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(ewe(i)){if(a)return Sg(Sg({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return Sg(Sg({},_o),{},{coordinate:i.coordinate})};function twe(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 nwe(e,t){var n=twe(e),r=t[0],i=t[1];if(n===void 0)return!1;var a=Math.min(r,i),l=Math.max(r,i);return n>=a&&n<=l}function rwe(e,t,n){if(n==null||t==null)return!0;var r=vn(e,t);return r==null||!La(n)?!0:nwe(r,n)}var ph=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!ht(a))return i;var l=0,u=1/0;t.length>0&&(u=t.length-1);var d=Math.max(l,Math.min(a,u)),f=t[d];return f==null||rwe(f,n,r)?String(d):null},Zq=(e,t,n,r,i,a,l)=>{if(a!=null){var u=l[0],d=u?.getPosition(a);if(d!=null)return d;var f=i?.[Number(a)];if(f)return n==="horizontal"?{x:f.coordinate,y:(r.top+t)/2}:{x:(r.left+e)/2,y:f.coordinate}}},Xq=(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 a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(l=>{var u;return((u=l.settings)===null||u===void 0?void 0:u.graphicalItemId)===i})},Jq=e=>e.options.tooltipPayloadSearcher,Rd=e=>e.tooltip;function oI(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 lI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oI(Object(n),!0).forEach(function(r){iwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function iwe(e,t,n){return(t=awe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function awe(e){var t=swe(e,"string");return typeof t=="symbol"?t:t+""}function swe(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 owe(e){if(typeof e=="string"||typeof e=="number")return e}function lwe(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function cwe(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function cI(e){if(typeof e=="string")return e}function uwe(e){if(!(e==null||typeof e!="object")){var t="name"in e?owe(e.name):void 0,n="unit"in e?lwe(e.unit):void 0,r="dataKey"in e?cwe(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?cI(e.color):void 0,l="fill"in e?cI(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:l}}}function dwe(e,t){return e??t}var e8=(e,t,n,r,i,a,l)=>{if(!(t==null||a==null)){var{chartData:u,computedData:d,dataStartIndex:f,dataEndIndex:p}=n,m=[];return e.reduce((g,v)=>{var S,{dataDefinedOnItem:b,settings:j}=v,k=dwe(b,u),E=Array.isArray(k)?A6(k,f,p):k,C=(S=j?.dataKey)!==null&&S!==void 0?S:r,A=j?.nameKey,P;if(r&&Array.isArray(E)&&!Array.isArray(E[0])&&l==="axis"?P=TB(E,r,i):P=a(E,t,d,A),Array.isArray(P))P.forEach(_=>{var T,$,F=uwe(_),U=F?.name,B=F?.dataKey,V=F?.payload,X=lI(lI({},j),{},{name:U,unit:F?.unit,color:(T=F?.color)!==null&&T!==void 0?T:j?.color,fill:($=F?.fill)!==null&&$!==void 0?$:j?.fill});g.push(tD({tooltipEntrySettings:X,dataKey:B,payload:V,value:vn(V,B),name:U==null?void 0:String(U)}))});else{var O;g.push(tD({tooltipEntrySettings:j,dataKey:C,payload:P,value:vn(P,C),name:(O=vn(P,A))!==null&&O!==void 0?O:j?.name}))}return g},m)}},cA=re([Wn,lq,jC],iq),fwe=re([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),hwe=re([ir,Ed],cq),Ac=re([fwe,Wn,hwe],uq,{memoizeOptions:{resultEqualityCheck:Px}}),pwe=re([Ac],e=>e.filter(_x)),t8=re([Ac],hq,{memoizeOptions:{resultEqualityCheck:Px}}),mwe=re([Ac],e=>e.some(t=>!t.data)),dc=re([t8,xa],mq),gwe=re([pwe,xa,Wn],jU),uA=re([dc,Wn,Ac,xa,mwe,t8],gq),n8=re([Wn],nA),ywe=re([Wn],e=>e.allowDataOverflow),r8=re([n8,ywe],rU),vwe=re([Ac],e=>e.filter(_x)),xwe=re([gwe,vwe,Nx,gU],vq),bwe=re([xwe,xa,ir,r8],xq),wwe=re([Ac],fq),Swe=re([dc,Wn,wwe,rA,ir,Uye],Sq,{memoizeOptions:{resultEqualityCheck:zx}}),jwe=re([jq,ir,Ed],Pd),Nwe=re([jwe,ir],Cq),kwe=re([Nq,ir,Ed],Pd),Cwe=re([kwe,ir],Aq),Awe=re([kq,ir,Ed],Pd),Owe=re([Awe,ir],Oq),Ewe=re([Nwe,Owe,Cwe],av),_we=re([Wn,n8,r8,bwe,Swe,Ewe,Et,ir],Eq),ud=re([Wn,Et,dc,uA,Nx,ir,_we],_q),zwe=re([ud,Wn,cA],zq),Pwe=re([Wn,ud,zwe,ir],Pq),i8=e=>{var t=ir(e),n=Ed(e),r=!1;return vp(e,t,n,r)},a8=re([Wn,i8],kx),Twe=re([Wn,cA,Pwe,a8],JC),s8=re([Twe],EC),Rwe=re([Et,uA,Wn,ir],Bq),Dwe=re([Et,uA,Wn,ir],Dq),Mwe=(e,t,n,r,i,a,l,u)=>{if(t){var{type:d}=t,f=va(e,u);if(r){var p=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,m=d==="category"&&r.bandwidth?r.bandwidth()/p:0;return m=u==="angleAxis"&&i!=null&&i?.length>=2?Qr(i[0]-i[1])*2*m:m,f&&l?l.map((g,v)=>{var S=r.map(g);return ht(S)?{coordinate:S+m,value:g,index:v,offset:m}:null}).filter(Yr):r.domain().map((g,v)=>{var S=r.map(g);return ht(S)?{coordinate:S+m,value:a?a[g]:g,index:v,offset:m}:null}).filter(Yr)}}},Hs=re([Et,Wn,cA,s8,i8,Rwe,Dwe,ir],Mwe),dA=re([qq,Fq,Bbe],(e,t,n)=>Hq(n.shared,e,t)),o8=e=>e.tooltip.settings.trigger,fA=e=>e.tooltip.settings.defaultIndex,bp=re([Rd,dA,o8,fA],Wq),fc=re([bp,dc,cd,ud],ph),l8=re([Hs,fc],Kq),c8=re([bp],e=>{if(e)return e.dataKey}),Iwe=re([bp],e=>{if(e)return e.graphicalItemId}),u8=re([Rd,dA,o8,fA],Xq),Lwe=re([$s,Bs,Et,tr,Hs,fA,u8],Zq),$we=re([bp,Lwe],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),Bwe=re([bp],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),Uwe=re([u8,fc,xa,cd,l8,Jq,dA],e8),qwe=re([Uwe],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function uI(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 dI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uI(Object(n),!0).forEach(function(r){Fwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fwe(e,t,n){return(t=Hwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hwe(e){var t=Kwe(e,"string");return typeof t=="symbol"?t:t+""}function Kwe(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 Gwe=()=>Ue(Wn),Vwe=()=>{var e=Gwe(),t=Ue(Hs),n=Ue(s8);return Ko(!e||!n?void 0:dI(dI({},e),{},{scale:n}),t)};function fI(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 xu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fI(Object(n),!0).forEach(function(r){Qwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qwe(e,t,n){return(t=Ywe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ywe(e){var t=Wwe(e,"string");return typeof t=="symbol"?t:t+""}function Wwe(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 Zwe=(e,t,n,r)=>{var i=t.find(a=>a&&a.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}},Xwe=(e,t,n,r)=>{var i=t.find(f=>f&&f.index===n);if(i){if(e==="centric"){var a=i.coordinate,{radius:l}=r;return xu(xu(xu({},r),pr(r.cx,r.cy,l,a)),{},{angle:a,radius:l})}var u=i.coordinate,{angle:d}=r;return xu(xu(xu({},r),pr(r.cx,r.cy,u,d)),{},{angle:d,radius:u})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function Jwe(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 d8=(e,t,n,r,i)=>{var a,l=(a=t?.length)!==null&&a!==void 0?a: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 u=0;u<l;u++){var d,f,p,m,g,v=u>0?(d=n[u-1])===null||d===void 0?void 0:d.coordinate:(f=n[l-1])===null||f===void 0?void 0:f.coordinate,S=(p=n[u])===null||p===void 0?void 0:p.coordinate,b=u>=l-1?(m=n[0])===null||m===void 0?void 0:m.coordinate:(g=n[u+1])===null||g===void 0?void 0:g.coordinate,j=void 0;if(!(v==null||S==null||b==null))if(Qr(S-v)!==Qr(b-S)){var k=[];if(Qr(b-S)===Qr(i[1]-i[0])){j=b;var E=S+i[1]-i[0];k[0]=Math.min(E,(E+v)/2),k[1]=Math.max(E,(E+v)/2)}else{j=v;var C=b+i[1]-i[0];k[0]=Math.min(S,(C+S)/2),k[1]=Math.max(S,(C+S)/2)}var A=[Math.min(S,(j+S)/2),Math.max(S,(j+S)/2)];if(e>A[0]&&e<=A[1]||e>=k[0]&&e<=k[1]){var P;return(P=n[u])===null||P===void 0?void 0:P.index}}else{var O=Math.min(v,b),_=Math.max(v,b);if(e>(O+S)/2&&e<=(_+S)/2){var T;return(T=n[u])===null||T===void 0?void 0:T.index}}}else if(t)for(var $=0;$<l;$++){var F=t[$];if(F!=null){var U=t[$+1],B=t[$-1];if($===0&&U!=null&&e<=(F.coordinate+U.coordinate)/2||$===l-1&&B!=null&&e>(F.coordinate+B.coordinate)/2||$>0&&$<l-1&&B!=null&&U!=null&&e>(F.coordinate+B.coordinate)/2&&e<=(F.coordinate+U.coordinate)/2)return F.index}}return-1},f8=()=>Ue(jC),hA=(e,t)=>t,h8=(e,t,n)=>n,pA=(e,t,n,r)=>r,eSe=re(Hs,e=>sx(e,t=>t.coordinate)),mA=re([Rd,hA,h8,pA],Wq),gA=re([mA,dc,cd,ud],ph),tSe=(e,t,n)=>{if(t!=null){var r=Rd(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},p8=re([Rd,hA,h8,pA],Xq),ov=re([$s,Bs,Et,tr,Hs,pA,p8],Zq),nSe=re([mA,ov],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),m8=re([Hs,gA],Kq),rSe=re([p8,gA,xa,cd,m8,Jq,hA],e8),iSe=re([mA,gA],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),aSe=(e,t,n,r,i,a,l)=>{if(!(!e||!n||!r||!i)&&Jwe(e,l)){var u=Mpe(e,t),d=d8(u,a,i,n,r),f=Zwe(t,i,d,e);return{activeIndex:String(d),activeCoordinate:f}}},sSe=(e,t,n,r,i,a,l)=>{if(!(!e||!r||!i||!a||!n)){var u=_ye(e,n);if(u){var d=Ipe(u,t),f=d8(d,l,a,r,i),p=Xwe(t,a,f,u);return{activeIndex:String(f),activeCoordinate:p}}}},oSe=(e,t,n,r,i,a,l,u)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?aSe(e,t,r,i,a,l,u):sSe(e,t,n,r,i,a,l)},lSe=re(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}}),cSe=re(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(Qn)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:nve}});function hI(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 pI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hI(Object(n),!0).forEach(function(r){uSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uSe(e,t,n){return(t=dSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dSe(e){var t=fSe(e,"string");return typeof t=="symbol"?t:t+""}function fSe(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 hSe={},pSe={zIndexMap:Object.values(Qn).reduce((e,t)=>pI(pI({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),hSe)},mSe=new Set(Object.values(Qn));function gSe(e){return mSe.has(e)}var g8=Ar({name:"zIndex",initialState:pSe,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:sn()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!gSe(n)&&delete e.zIndexMap[n])},prepare:sn()},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:sn()},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:sn()}}}),{registerZIndexPortal:ySe,unregisterZIndexPortal:mj,registerZIndexPortalElement:vSe,unregisterZIndexPortalElement:xSe}=g8.actions,bSe=g8.reducer;function xi(e){var{zIndex:t,children:n}=e,r=gme(),i=r&&t!==void 0&&t!==0,a=nr(),l=x.useRef(void 0),u=x.useRef(new Set),d=cn(),f=Ue(m=>lSe(m,t,a));if(x.useLayoutEffect(()=>{if(!i){var m=u.current;m.forEach(v=>{d(mj({zIndex:v}))}),m.clear(),l.current=void 0;return}if(u.current.has(t)||(d(ySe({zIndex:t})),u.current.add(t)),f){l.current=f;var g=u.current;g.forEach(v=>{v!==t&&(d(mj({zIndex:v})),g.delete(v))})}},[d,t,i,f]),x.useLayoutEffect(()=>{var m=u.current;return()=>{m.forEach(g=>{d(mj({zIndex:g}))}),m.clear()}},[d]),!i)return n;var p=f??l.current;return p?gc.createPortal(n,p):null}function lN(){return lN=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},lN.apply(null,arguments)}function mI(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 jg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mI(Object(n),!0).forEach(function(r){wSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wSe(e,t,n){return(t=SSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SSe(e){var t=jSe(e,"string");return typeof t=="symbol"?t:t+""}function jSe(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 NSe(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return x.isValidElement(t)?x.cloneElement(t,r):x.createElement(n,r)}function kSe(e){var t,{coordinate:n,payload:r,index:i,offset:a,tooltipAxisBandSize:l,layout:u,cursor:d,tooltipEventType:f,chartName:p}=e,m=n,g=r,v=i;if(!d||!m||p!=="ScatterChart"&&f!=="axis")return null;var S,b,j;if(p==="ScatterChart")S=m,b=Hge,j=Qn.cursorLine;else if(p==="BarChart")S=Kge(u,m,a,l),b=Z6,j=Qn.cursorRectangle;else if(u==="radial"&&DB(m)){var{cx:k,cy:E,radius:C,startAngle:A,endAngle:P}=X6(m);S={cx:k,cy:E,startAngle:A,endAngle:P,innerRadius:C,outerRadius:C},b=eU,j=Qn.cursorLine}else S={points:Rye(u,m,a)},b=hh,j=Qn.cursorLine;var O=typeof d=="object"&&"className"in d?d.className:void 0,_=jg(jg(jg(jg({stroke:"#ccc",pointerEvents:"none"},a),S),ep(d)),{},{payload:g,payloadIndex:v,className:At("recharts-tooltip-cursor",O)});return x.createElement(xi,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:j},x.createElement(NSe,{cursor:d,cursorComp:b,cursorProps:_}))}function CSe(e){var t=Vwe(),n=D6(),r=el(),i=f8();return t==null||n==null||r==null||i==null?null:x.createElement(kSe,lN({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var y8=x.createContext(null),ASe=()=>x.useContext(y8),gj={exports:{}},gI;function OSe(){return gI||(gI=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(d,f,p){this.fn=d,this.context=f,this.once=p||!1}function a(d,f,p,m,g){if(typeof p!="function")throw new TypeError("The listener must be a function");var v=new i(p,m||d,g),S=n?n+f:f;return d._events[S]?d._events[S].fn?d._events[S]=[d._events[S],v]:d._events[S].push(v):(d._events[S]=v,d._eventsCount++),d}function l(d,f){--d._eventsCount===0?d._events=new r:delete d._events[f]}function u(){this._events=new r,this._eventsCount=0}u.prototype.eventNames=function(){var f=[],p,m;if(this._eventsCount===0)return f;for(m in p=this._events)t.call(p,m)&&f.push(n?m.slice(1):m);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(p)):f},u.prototype.listeners=function(f){var p=n?n+f:f,m=this._events[p];if(!m)return[];if(m.fn)return[m.fn];for(var g=0,v=m.length,S=new Array(v);g<v;g++)S[g]=m[g].fn;return S},u.prototype.listenerCount=function(f){var p=n?n+f:f,m=this._events[p];return m?m.fn?1:m.length:0},u.prototype.emit=function(f,p,m,g,v,S){var b=n?n+f:f;if(!this._events[b])return!1;var j=this._events[b],k=arguments.length,E,C;if(j.fn){switch(j.once&&this.removeListener(f,j.fn,void 0,!0),k){case 1:return j.fn.call(j.context),!0;case 2:return j.fn.call(j.context,p),!0;case 3:return j.fn.call(j.context,p,m),!0;case 4:return j.fn.call(j.context,p,m,g),!0;case 5:return j.fn.call(j.context,p,m,g,v),!0;case 6:return j.fn.call(j.context,p,m,g,v,S),!0}for(C=1,E=new Array(k-1);C<k;C++)E[C-1]=arguments[C];j.fn.apply(j.context,E)}else{var A=j.length,P;for(C=0;C<A;C++)switch(j[C].once&&this.removeListener(f,j[C].fn,void 0,!0),k){case 1:j[C].fn.call(j[C].context);break;case 2:j[C].fn.call(j[C].context,p);break;case 3:j[C].fn.call(j[C].context,p,m);break;case 4:j[C].fn.call(j[C].context,p,m,g);break;default:if(!E)for(P=1,E=new Array(k-1);P<k;P++)E[P-1]=arguments[P];j[C].fn.apply(j[C].context,E)}}return!0},u.prototype.on=function(f,p,m){return a(this,f,p,m,!1)},u.prototype.once=function(f,p,m){return a(this,f,p,m,!0)},u.prototype.removeListener=function(f,p,m,g){var v=n?n+f:f;if(!this._events[v])return this;if(!p)return l(this,v),this;var S=this._events[v];if(S.fn)S.fn===p&&(!g||S.once)&&(!m||S.context===m)&&l(this,v);else{for(var b=0,j=[],k=S.length;b<k;b++)(S[b].fn!==p||g&&!S[b].once||m&&S[b].context!==m)&&j.push(S[b]);j.length?this._events[v]=j.length===1?j[0]:j:l(this,v)}return this},u.prototype.removeAllListeners=function(f){var p;return f?(p=n?n+f:f,this._events[p]&&l(this,p)):(this._events=new r,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,e.exports=u})(gj)),gj.exports}var ESe=OSe();const _Se=pa(ESe);var Uh=new _Se,cN="recharts.syncEvent.tooltip",yI="recharts.syncEvent.brush",yA=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!da(n))return e[n]}},zSe={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},v8=Ar({name:"options",initialState:zSe,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),PSe=v8.reducer,{createEventEmitter:TSe}=v8.actions;function RSe(e){return e.tooltip.syncInteraction}var DSe={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},x8=Ar({name:"chartData",initialState:DSe,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:vI,setDataStartEndIndexes:MSe,setComputedData:U_e}=x8.actions,ISe=x8.reducer,LSe=["x","y"];function xI(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 bu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xI(Object(n),!0).forEach(function(r){$Se(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $Se(e,t,n){return(t=BSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BSe(e){var t=USe(e,"string");return typeof t=="symbol"?t:t+""}function USe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qSe(e,t){if(e==null)return{};var n,r,i=FSe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function FSe(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 HSe(){var e=Ue(NC),t=Ue(kC),n=cn(),r=Ue(yU),i=Ue(Hs),a=el(),l=bx(),u=Ue(d=>d.rootProps.className);x.useEffect(()=>{if(e==null)return Jo;var d=(f,p,m)=>{if(t!==m&&e===f){if(p.payload.active===!1){n(rh({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r==="index"){var g;if(l&&p!==null&&p!==void 0&&(g=p.payload)!==null&&g!==void 0&&g.coordinate&&p.payload.sourceViewBox){var v=p.payload.coordinate,{x:S,y:b}=v,j=qSe(v,LSe),{x:k,y:E,width:C,height:A}=p.payload.sourceViewBox,P=bu(bu({},j),{},{x:l.x+(C?(S-k)/C:0)*l.width,y:l.y+(A?(b-E)/A:0)*l.height});n(bu(bu({},p),{},{payload:bu(bu({},p.payload),{},{coordinate:P})}))}else n(p);return}if(i!=null){var O;if(typeof r=="function"){var _={activeTooltipIndex:p.payload.index==null?void 0:Number(p.payload.index),isTooltipActive:p.payload.active,activeIndex:p.payload.index==null?void 0:Number(p.payload.index),activeLabel:p.payload.label,activeDataKey:p.payload.dataKey,activeCoordinate:p.payload.coordinate},T=r(i,_);O=i[T]}else r==="value"&&(O=i.find(H=>String(H.value)===p.payload.label));var{coordinate:$}=p.payload;if($==null||l==null){n(rh({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(O==null){n(rh({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:void 0}));return}var{x:F,y:U}=$,B=Math.min(F,l.x+l.width),V=Math.min(U,l.y+l.height),X={x:a==="horizontal"?O.coordinate:B,y:a==="horizontal"?V:O.coordinate},Z=rh({active:p.payload.active,coordinate:X,dataKey:p.payload.dataKey,index:String(O.index),label:p.payload.label,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:p.payload.graphicalItemId});n(Z)}}};return Uh.on(cN,d),()=>{Uh.off(cN,d)}},[u,n,t,e,r,i,a,l])}function KSe(){var e=Ue(NC),t=Ue(kC),n=cn();x.useEffect(()=>{if(e==null)return Jo;var r=(i,a,l)=>{t!==l&&e===i&&n(MSe(a))};return Uh.on(yI,r),()=>{Uh.off(yI,r)}},[n,t,e])}function GSe(){var e=cn();x.useEffect(()=>{e(TSe())},[e]),HSe(),KSe()}function VSe(e,t,n,r,i,a){var l=Ue(S=>tSe(S,e,t)),u=Ue(Iwe),d=Ue(kC),f=Ue(NC),p=Ue(yU),m=Ue(RSe),g=m?.sourceViewBox!=null,v=bx();x.useEffect(()=>{if(!g&&f!=null&&d!=null){var S=rh({active:a,coordinate:n,dataKey:l,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:u});Uh.emit(cN,f,S,d)}},[g,n,l,u,i,r,d,f,p,a,v])}function bI(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 wI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bI(Object(n),!0).forEach(function(r){QSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function QSe(e,t,n){return(t=YSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YSe(e){var t=WSe(e,"string");return typeof t=="symbol"?t:t+""}function WSe(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 ZSe(e){return e.dataKey}function XSe(e,t){return x.isValidElement(e)?x.cloneElement(e,t):typeof e=="function"?x.createElement(e,t):x.createElement(xge,t)}var SI=[],JSe={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 Ds(e){var t,n,r=er(e,JSe),{active:i,allowEscapeViewBox:a,animationDuration:l,animationEasing:u,content:d,filterNull:f,isAnimationActive:p,offset:m,payloadUniqBy:g,position:v,reverseDirection:S,useTranslate3d:b,wrapperStyle:j,cursor:k,shared:E,trigger:C,defaultIndex:A,portal:P,axisId:O}=r,_=cn(),T=typeof A=="number"?String(A):A;x.useEffect(()=>{_(Kbe({shared:E,trigger:C,axisId:O,active:i,defaultIndex:T}))},[_,E,C,O,i,T]);var $=bx(),F=G6(),U=$be(E),{activeIndex:B,isActive:V}=(t=Ue(je=>iSe(je,U,C,T)))!==null&&t!==void 0?t:{},X=Ue(je=>rSe(je,U,C,T)),Z=Ue(je=>m8(je,U,C,T)),H=Ue(je=>nSe(je,U,C,T)),J=X,oe=ASe(),ye=(n=i??V)!==null&&n!==void 0?n:!1,[I,M]=ZB([J,ye]),q=U==="axis"?Z:void 0;VSe(U,C,H,q,B,ye);var D=P??oe;if(D==null||$==null||U==null)return null;var G=J??SI;ye||(G=SI),f&&G.length&&(G=GB(G.filter(je=>je.value!=null&&(je.hide!==!0||r.includeHidden)),g,ZSe));var se=G.length>0,ne=wI(wI({},r),{},{payload:G,label:q,active:ye,activeIndex:B,coordinate:H,accessibilityLayer:F}),Ce=x.createElement(_ge,{allowEscapeViewBox:a,animationDuration:l,animationEasing:u,isAnimationActive:p,active:ye,coordinate:H,hasPayload:se,offset:m,position:v,reverseDirection:S,useTranslate3d:b,viewBox:$,wrapperStyle:j,lastBoundingBox:I,innerRef:M,hasPortalFromProps:!!P},XSe(d,ne));return x.createElement(x.Fragment,null,gc.createPortal(Ce,D),ye&&x.createElement(CSe,{cursor:k,tooltipEventType:U,coordinate:H,payload:G,index:B}))}var lv=e=>null;lv.displayName="Cell";function eje(e,t,n){return(t=tje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tje(e){var t=nje(e,"string");return typeof t=="symbol"?t:t+""}function nje(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 rje{constructor(t){eje(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 jI(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 ije(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jI(Object(n),!0).forEach(function(r){aje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aje(e,t,n){return(t=sje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sje(e){var t=oje(e,"string");return typeof t=="symbol"?t:t+""}function oje(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 lje={cacheSize:2e3,enableCache:!0},b8=ije({},lje),NI=new rje(b8.cacheSize),cje={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},kI="recharts_measurement_span";function uje(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",l=t.letterSpacing||"",u=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(a,"|").concat(l,"|").concat(u)}var CI=(e,t)=>{try{var n=document.getElementById(kI);n||(n=document.createElement("span"),n.setAttribute("id",kI),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,cje,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},mh=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||op.isSsr)return{width:0,height:0};if(!b8.enableCache)return CI(t,n);var r=uje(t,n),i=NI.get(r);if(i)return i;var a=CI(t,n);return NI.set(r,a),a},w8;function dje(e,t,n){return(t=fje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fje(e){var t=hje(e,"string");return typeof t=="symbol"?t:t+""}function hje(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 AI=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,OI=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,pje=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,mje=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,gje={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},yje=["cm","mm","pt","pc","in","Q","px"];function vje(e){return yje.includes(e)}var Tu="NaN";function xje(e,t){return e*gje[t]}class dr{static parse(t){var n,[,r,i]=(n=mje.exec(t))!==null&&n!==void 0?n:[];return r==null?dr.NaN:new dr(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,da(t)&&(this.unit=""),n!==""&&!pje.test(n)&&(this.num=NaN,this.unit=""),vje(n)&&(this.num=xje(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new dr(NaN,""):new dr(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new dr(NaN,""):new dr(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new dr(NaN,""):new dr(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new dr(NaN,""):new dr(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return da(this.num)}}w8=dr;dje(dr,"NaN",new w8(NaN,""));function S8(e){if(e==null||e.includes(Tu))return Tu;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=AI.exec(t))!==null&&n!==void 0?n:[],l=dr.parse(r??""),u=dr.parse(a??""),d=i==="*"?l.multiply(u):l.divide(u);if(d.isNaN())return Tu;t=t.replace(AI,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,[,p,m,g]=(f=OI.exec(t))!==null&&f!==void 0?f:[],v=dr.parse(p??""),S=dr.parse(g??""),b=m==="+"?v.add(S):v.subtract(S);if(b.isNaN())return Tu;t=t.replace(OI,b.toString())}return t}var EI=/\(([^()]*)\)/;function bje(e){for(var t=e,n;(n=EI.exec(t))!=null;){var[,r]=n;t=t.replace(EI,S8(r))}return t}function wje(e){var t=e.replace(/\s+/g,"");return t=bje(t),t=S8(t),t}function Sje(e){try{return wje(e)}catch{return Tu}}function yj(e){var t=Sje(e.slice(5,-1));return t===Tu?"":t}var jje=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],Nje=["dx","dy","angle","className","breakAll"];function uN(){return uN=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},uN.apply(null,arguments)}function _I(e,t){if(e==null)return{};var n,r,i=kje(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function kje(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 j8=/[ \f\n\r\t\v\u2028\u2029]+/,N8=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];ln(t)||(n?i=t.toString().split(""):i=t.toString().split(j8));var a=i.map(u=>({word:u,width:mh(u,r).width})),l=n?0:mh(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:l}}catch{return null}};function k8(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function Cje(e){return ln(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var C8=(e,t,n,r)=>e.reduce((i,a)=>{var{word:l,width:u}=a,d=i[i.length-1];if(d&&u!=null&&(t==null||r||d.width+u+n<Number(t)))d.words.push(l),d.width+=u+n;else{var f={words:[l],width:u};i.push(f)}return i},[]),A8=e=>e.reduce((t,n)=>t.width>n.width?t:n),Aje="…",zI=(e,t,n,r,i,a,l,u)=>{var d=e.slice(0,t),f=N8({breakAll:n,style:r,children:d+Aje});if(!f)return[!1,[]];var p=C8(f.wordsWithComputedWidth,a,l,u),m=p.length>i||A8(p).width>Number(a);return[m,p]},Oje=(e,t,n,r,i)=>{var{maxLines:a,children:l,style:u,breakAll:d}=e,f=Pe(a),p=String(l),m=C8(t,r,n,i);if(!f||i)return m;var g=m.length>a||A8(m).width>Number(r);if(!g)return m;for(var v=0,S=p.length-1,b=0,j;v<=S&&b<=p.length-1;){var k=Math.floor((v+S)/2),E=k-1,[C,A]=zI(p,E,d,u,a,r,n,i),[P]=zI(p,k,d,u,a,r,n,i);if(!C&&!P&&(v=k+1),C&&P&&(S=k-1),!C&&P){j=A;break}b++}return j||m},PI=e=>{var t=ln(e)?[]:e.toString().split(j8);return[{words:t,width:void 0}]},Eje=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:l}=e;if((t||n)&&!op.isSsr){var u,d,f=N8({breakAll:a,children:r,style:i});if(f){var{wordsWithComputedWidth:p,spaceWidth:m}=f;u=p,d=m}else return PI(r);return Oje({breakAll:a,children:r,maxLines:l,style:i},u,d,t,!!n)}return PI(r)},O8="#808080",_je={angle:0,breakAll:!1,capHeight:"0.71em",fill:O8,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},vA=x.forwardRef((e,t)=>{var n=er(e,_je),{x:r,y:i,lineHeight:a,capHeight:l,fill:u,scaleToFit:d,textAnchor:f,verticalAnchor:p}=n,m=_I(n,jje),g=x.useMemo(()=>Eje({breakAll:m.breakAll,children:m.children,maxLines:m.maxLines,scaleToFit:d,style:m.style,width:m.width}),[m.breakAll,m.children,m.maxLines,d,m.style,m.width]),{dx:v,dy:S,angle:b,className:j,breakAll:k}=m,E=_I(m,Nje);if(!Fa(r)||!Fa(i)||g.length===0)return null;var C=Number(r)+(Pe(v)?v:0),A=Number(i)+(Pe(S)?S:0);if(!ht(C)||!ht(A))return null;var P;switch(p){case"start":P=yj("calc(".concat(l,")"));break;case"middle":P=yj("calc(".concat((g.length-1)/2," * -").concat(a," + (").concat(l," / 2))"));break;default:P=yj("calc(".concat(g.length-1," * -").concat(a,")"));break}var O=[],_=g[0];if(d&&_!=null){var T=_.width,{width:$}=m;O.push("scale(".concat(Pe($)&&Pe(T)?$/T:1,")"))}return b&&O.push("rotate(".concat(b,", ").concat(C,", ").concat(A,")")),O.length&&(E.transform=O.join(" ")),x.createElement("text",uN({},kr(E),{ref:t,x:C,y:A,className:At("recharts-text",j),textAnchor:f,fill:u.includes("url")?O8:u}),g.map((F,U)=>{var B=F.words.join(k?"":" ");return x.createElement("tspan",{x:C,dy:U===0?P:a,key:"".concat(B,"-").concat(U)},B)}))});vA.displayName="Text";function TI(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 Ea(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TI(Object(n),!0).forEach(function(r){zje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zje(e,t,n){return(t=Pje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pje(e){var t=Tje(e,"string");return typeof t=="symbol"?t:t+""}function Tje(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 Rje=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:l,height:u,upperWidth:d,lowerWidth:f}=hC(t),p=a,m=a+(d-f)/2,g=(p+m)/2,v=(d+f)/2,S=p+d/2,b=u>=0?1:-1,j=b*r,k=b>0?"end":"start",E=b>0?"start":"end",C=d>=0?1:-1,A=C*r,P=C>0?"end":"start",O=C>0?"start":"end",_=i;if(n==="top"){var T={x:p+d/2,y:l-j,horizontalAnchor:"middle",verticalAnchor:k};return _&&(T.height=Math.max(l-_.y,0),T.width=d),T}if(n==="bottom"){var $={x:m+f/2,y:l+u+j,horizontalAnchor:"middle",verticalAnchor:E};return _&&($.height=Math.max(_.y+_.height-(l+u),0),$.width=f),$}if(n==="left"){var F={x:g-A,y:l+u/2,horizontalAnchor:P,verticalAnchor:"middle"};return _&&(F.width=Math.max(F.x-_.x,0),F.height=u),F}if(n==="right"){var U={x:g+v+A,y:l+u/2,horizontalAnchor:O,verticalAnchor:"middle"};return _&&(U.width=Math.max(_.x+_.width-U.x,0),U.height=u),U}var B=_?{width:v,height:u}:{};return n==="insideLeft"?Ea({x:g+A,y:l+u/2,horizontalAnchor:O,verticalAnchor:"middle"},B):n==="insideRight"?Ea({x:g+v-A,y:l+u/2,horizontalAnchor:P,verticalAnchor:"middle"},B):n==="insideTop"?Ea({x:p+d/2,y:l+j,horizontalAnchor:"middle",verticalAnchor:E},B):n==="insideBottom"?Ea({x:m+f/2,y:l+u-j,horizontalAnchor:"middle",verticalAnchor:k},B):n==="insideTopLeft"?Ea({x:p+A,y:l+j,horizontalAnchor:O,verticalAnchor:E},B):n==="insideTopRight"?Ea({x:p+d-A,y:l+j,horizontalAnchor:P,verticalAnchor:E},B):n==="insideBottomLeft"?Ea({x:m+A,y:l+u-j,horizontalAnchor:O,verticalAnchor:k},B):n==="insideBottomRight"?Ea({x:m+f-A,y:l+u-j,horizontalAnchor:P,verticalAnchor:k},B):n&&typeof n=="object"&&(Pe(n.x)||sc(n.x))&&(Pe(n.y)||sc(n.y))?Ea({x:a+fa(n.x,v),y:l+fa(n.y,u),horizontalAnchor:"end",verticalAnchor:"end"},B):Ea({x:S,y:l+u/2,horizontalAnchor:"middle",verticalAnchor:"middle"},B)},Dje=["labelRef"],Mje=["content"];function RI(e,t){if(e==null)return{};var n,r,i=Ije(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ije(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 DI(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 ih(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DI(Object(n),!0).forEach(function(r){Lje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lje(e,t,n){return(t=$je(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $je(e){var t=Bje(e,"string");return typeof t=="symbol"?t:t+""}function Bje(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 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)}var E8=x.createContext(null),Uje=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:l,children:u}=e,d=x.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:l}),[t,n,r,i,a,l]);return x.createElement(E8.Provider,{value:d},u)},_8=()=>{var e=x.useContext(E8),t=bx();return e||(t?hC(t):void 0)},qje=x.createContext(null),Fje=()=>{var e=x.useContext(qje),t=Ue(SU);return e||t},Hje=e=>{var{value:t,formatter:n}=e,r=ln(e.children)?t:e.children;return typeof n=="function"?n(r):r},xA=e=>e!=null&&typeof e=="function",Kje=(e,t)=>{var n=Qr(t-e),r=Math.min(Math.abs(t-e),360);return n*r},Gje=(e,t,n,r,i)=>{var{offset:a,className:l}=e,{cx:u,cy:d,innerRadius:f,outerRadius:p,startAngle:m,endAngle:g,clockWise:v}=i,S=(f+p)/2,b=Kje(m,g),j=b>=0?1:-1,k,E;switch(t){case"insideStart":k=m+j*a,E=v;break;case"insideEnd":k=g-j*a,E=!v;break;case"end":k=g+j*a,E=v;break;default:throw new Error("Unsupported position ".concat(t))}E=b<=0?E:!E;var C=pr(u,d,S,k),A=pr(u,d,S,k+(E?1:-1)*359),P="M".concat(C.x,",").concat(C.y,`
|
|
288
|
-
A`).concat(S,",").concat(S,",0,1,").concat(E?0:1,`,
|
|
289
|
-
`).concat(A.x,",").concat(A.y),O=ln(e.id)?Oh("recharts-radial-line-"):e.id;return x.createElement("text",Ss({},r,{dominantBaseline:"central",className:At("recharts-radial-bar-label",l)}),x.createElement("defs",null,x.createElement("path",{id:O,d:P})),x.createElement("textPath",{xlinkHref:"#".concat(O)},n))},Vje=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:l,startAngle:u,endAngle:d}=e,f=(u+d)/2;if(n==="outside"){var{x:p,y:m}=pr(r,i,l+t,f);return{x:p,y:m,textAnchor:p>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"end"};var g=(a+l)/2,{x:v,y:S}=pr(r,i,g,f);return{x:v,y:S,textAnchor:"middle",verticalAnchor:"middle"}},Kg=e=>e!=null&&"cx"in e&&Pe(e.cx),Qje={angle:0,offset:5,zIndex:Qn.label,position:"middle",textBreakAll:!1};function Yje(e){if(!Kg(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 Oo(e){var t=er(e,Qje),{viewBox:n,parentViewBox:r,position:i,value:a,children:l,content:u,className:d="",textBreakAll:f,labelRef:p}=t,m=Fje(),g=_8(),v=i==="center"?g:m??g,S,b,j;n==null?S=v:Kg(n)?S=n:S=hC(n);var k=Yje(S);if(!S||ln(a)&&ln(l)&&!x.isValidElement(u)&&typeof u!="function")return null;var E=ih(ih({},t),{},{viewBox:S});if(x.isValidElement(u)){var{labelRef:C}=E,A=RI(E,Dje);return x.cloneElement(u,A)}if(typeof u=="function"){var{content:P}=E,O=RI(E,Mje);if(b=x.createElement(u,O),x.isValidElement(b))return b}else b=Hje(t);var _=kr(t);if(Kg(S)){if(i==="insideStart"||i==="insideEnd"||i==="end")return Gje(t,i,b,_,S);j=Vje(S,t.offset,t.position)}else{if(!k)return null;var T=Rje({viewBox:k,position:i,offset:t.offset,parentViewBox:Kg(r)?void 0:r});j=ih(ih({x:T.x,y:T.y,textAnchor:T.horizontalAnchor,verticalAnchor:T.verticalAnchor},T.width!==void 0?{width:T.width}:{}),T.height!==void 0?{height:T.height}:{})}return x.createElement(xi,{zIndex:t.zIndex},x.createElement(vA,Ss({ref:p,className:At("recharts-label",d)},_,j,{textAnchor:k8(_.textAnchor)?_.textAnchor:j.textAnchor,breakAll:f}),b))}Oo.displayName="Label";var Wje=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?x.createElement(Oo,Ss({key:"label-implicit"},r)):Fa(e)?x.createElement(Oo,Ss({key:"label-implicit",value:e},r)):x.isValidElement(e)?e.type===Oo?x.cloneElement(e,ih({key:"label-implicit"},r)):x.createElement(Oo,Ss({key:"label-implicit",content:e},r)):xA(e)?x.createElement(Oo,Ss({key:"label-implicit",content:e},r)):e&&typeof e=="object"?x.createElement(Oo,Ss({},e,{key:"label-implicit"},r)):null};function Zje(e){var{label:t,labelRef:n}=e,r=_8();return Wje(t,r,n)||null}var Xje=["valueAccessor"],Jje=["dataKey","clockWise","id","textBreakAll","zIndex"];function cv(){return cv=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},cv.apply(null,arguments)}function MI(e,t){if(e==null)return{};var n,r,i=e1e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function e1e(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 t1e=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(Cje(t))return t},z8=x.createContext(void 0),bA=z8.Provider,P8=x.createContext(void 0);P8.Provider;function n1e(){return x.useContext(z8)}function r1e(){return x.useContext(P8)}function Gg(e){var{valueAccessor:t=t1e}=e,n=MI(e,Xje),{dataKey:r,clockWise:i,id:a,textBreakAll:l,zIndex:u}=n,d=MI(n,Jje),f=n1e(),p=r1e(),m=f||p;return!m||!m.length?null:x.createElement(xi,{zIndex:u??Qn.label},x.createElement(gr,{className:"recharts-label-list"},m.map((g,v)=>{var S,b=ln(r)?t(g,v):vn(g.payload,r),j=ln(a)?{}:{id:"".concat(a,"-").concat(v)};return x.createElement(Oo,cv({key:"label-".concat(v)},kr(g),d,j,{fill:(S=n.fill)!==null&&S!==void 0?S:g.fill,parentViewBox:g.parentViewBox,value:b,textBreakAll:l,viewBox:g.viewBox,index:v,zIndex:0}))})))}Gg.displayName="LabelList";function wA(e){var{label:t}=e;return t?t===!0?x.createElement(Gg,{key:"labelList-implicit"}):x.isValidElement(t)||xA(t)?x.createElement(Gg,{key:"labelList-implicit",content:t}):typeof t=="object"?x.createElement(Gg,cv({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function dN(){return dN=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},dN.apply(null,arguments)}var T8=e=>{var{cx:t,cy:n,r,className:i}=e,a=At("recharts-dot",i);return Pe(t)&&Pe(n)&&Pe(r)?x.createElement("circle",dN({},mi(e),nC(e),{className:a,cx:t,cy:n,r})):null},i1e={radiusAxis:{},angleAxis:{}},R8=Ar({name:"polarAxis",initialState:i1e,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:q_e,removeRadiusAxis:F_e,addAngleAxis:H_e,removeAngleAxis:K_e}=R8.actions,a1e=R8.reducer;function s1e(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var vj={exports:{}},qt={};var II;function o1e(){if(II)return qt;II=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"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.view_transition"),v=Symbol.for("react.client.reference");function S(b){if(typeof b=="object"&&b!==null){var j=b.$$typeof;switch(j){case e:switch(b=b.type,b){case n:case i:case r:case d:case f:case g:return b;default:switch(b=b&&b.$$typeof,b){case l:case u:case m:case p:return b;case a:return b;default:return j}}case t:return j}}}return qt.ContextConsumer=a,qt.ContextProvider=l,qt.Element=e,qt.ForwardRef=u,qt.Fragment=n,qt.Lazy=m,qt.Memo=p,qt.Portal=t,qt.Profiler=i,qt.StrictMode=r,qt.Suspense=d,qt.SuspenseList=f,qt.isContextConsumer=function(b){return S(b)===a},qt.isContextProvider=function(b){return S(b)===l},qt.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},qt.isForwardRef=function(b){return S(b)===u},qt.isFragment=function(b){return S(b)===n},qt.isLazy=function(b){return S(b)===m},qt.isMemo=function(b){return S(b)===p},qt.isPortal=function(b){return S(b)===t},qt.isProfiler=function(b){return S(b)===i},qt.isStrictMode=function(b){return S(b)===r},qt.isSuspense=function(b){return S(b)===d},qt.isSuspenseList=function(b){return S(b)===f},qt.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===i||b===r||b===d||b===f||typeof b=="object"&&b!==null&&(b.$$typeof===m||b.$$typeof===p||b.$$typeof===l||b.$$typeof===a||b.$$typeof===u||b.$$typeof===v||b.getModuleId!==void 0)},qt.typeOf=S,qt}var LI;function l1e(){return LI||(LI=1,vj.exports=o1e()),vj.exports}var c1e=l1e(),$I=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",BI=null,xj=null,D8=e=>{if(e===BI&&Array.isArray(xj))return xj;var t=[];return x.Children.forEach(e,n=>{ln(n)||(c1e.isFragment(n)?t=t.concat(D8(n.props.children)):t.push(n))}),xj=t,BI=e,t};function u1e(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>$I(i)):r=[$I(t)],D8(e).forEach(i=>{var a=nd(i,"type.displayName")||nd(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var SA=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,bj={},UI;function d1e(){return UI||(UI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){if(typeof n!="object"||n==null)return!1;if(Object.getPrototypeOf(n)===null)return!0;if(Object.prototype.toString.call(n)!=="[object Object]"){const i=n[Symbol.toStringTag];return i==null||!Object.getOwnPropertyDescriptor(n,Symbol.toStringTag)?.writable?!1:n.toString()===`[object ${i}]`}let r=n;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(n)===r}e.isPlainObject=t})(bj)),bj}var wj,qI;function f1e(){return qI||(qI=1,wj=d1e().isPlainObject),wj}var h1e=f1e();const p1e=pa(h1e);var FI,HI,KI,GI,VI;function QI(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 YI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QI(Object(n),!0).forEach(function(r){m1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function m1e(e,t,n){return(t=g1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g1e(e){var t=y1e(e,"string");return typeof t=="symbol"?t:t+""}function y1e(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 uv(){return uv=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},uv.apply(null,arguments)}function Wf(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var WI=(e,t,n,r,i)=>{var a=n-r,l;return l=kn(FI||(FI=Wf(["M ",",",""])),e,t),l+=kn(HI||(HI=Wf(["L ",",",""])),e+n,t),l+=kn(KI||(KI=Wf(["L ",",",""])),e+n-a/2,t+i),l+=kn(GI||(GI=Wf(["L ",",",""])),e+n-a/2-r,t+i),l+=kn(VI||(VI=Wf(["L ",","," Z"])),e,t),l},v1e={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},x1e=e=>{var t=er(e,v1e),{x:n,y:r,upperWidth:i,lowerWidth:a,height:l,className:u}=t,{animationEasing:d,animationDuration:f,animationBegin:p,isUpdateAnimationActive:m}=t,g=x.useRef(null),[v,S]=x.useState(-1),b=x.useRef(i),j=x.useRef(a),k=x.useRef(l),E=x.useRef(n),C=x.useRef(r),A=cp(e,"trapezoid-");if(x.useEffect(()=>{if(g.current&&g.current.getTotalLength)try{var X=g.current.getTotalLength();X&&S(X)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||l!==+l||i===0&&a===0||l===0)return null;var P=At("recharts-trapezoid",u);if(!m)return x.createElement("g",null,x.createElement("path",uv({},kr(t),{className:P,d:WI(n,r,i,a,l)})));var O=b.current,_=j.current,T=k.current,$=E.current,F=C.current,U="0px ".concat(v===-1?1:v,"px"),B="".concat(v,"px ").concat(v,"px"),V=V6(["strokeDasharray"],f,d);return x.createElement(lp,{animationId:A,key:A,canBegin:v>0,duration:f,easing:d,isActive:m,begin:p},X=>{var Z=Ft(O,i,X),H=Ft(_,a,X),J=Ft(T,l,X),oe=Ft($,n,X),ye=Ft(F,r,X);g.current&&(b.current=Z,j.current=H,k.current=J,E.current=oe,C.current=ye);var I=X>0?{transition:V,strokeDasharray:B}:{strokeDasharray:U};return x.createElement("path",uv({},kr(t),{className:P,d:WI(oe,ye,Z,H,J),ref:g,style:YI(YI({},I),t.style)}))})},b1e=["option","shapeType","activeClassName","inActiveClassName"];function w1e(e,t){if(e==null)return{};var n,r,i=S1e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function S1e(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 ZI(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 dv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZI(Object(n),!0).forEach(function(r){j1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function j1e(e,t,n){return(t=N1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N1e(e){var t=k1e(e,"string");return typeof t=="symbol"?t:t+""}function k1e(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 C1e(e,t){return dv(dv({},t),e)}function A1e(e,t){return e==="symbols"}function XI(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return x.createElement(Z6,n);case"trapezoid":return x.createElement(x1e,n);case"sector":return x.createElement(eU,n);case"symbols":if(A1e(t))return x.createElement(tC,n);break;case"curve":return x.createElement(hh,n);default:return null}}function O1e(e){return x.isValidElement(e)?e.props:e}function M8(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape",inActiveClassName:i="recharts-shape"}=e,a=w1e(e,b1e),l;if(x.isValidElement(t))l=x.cloneElement(t,dv(dv({},a),O1e(t)));else if(typeof t=="function")l=t(a,a.index);else if(p1e(t)&&typeof t!="boolean"){var u=C1e(t,a);l=x.createElement(XI,{shapeType:n,elementProps:u})}else{var d=a;l=x.createElement(XI,{shapeType:n,elementProps:d})}return a.isActive?x.createElement(gr,{className:r},l):x.createElement(gr,{className:i},l)}var I8=(e,t,n)=>{var r=cn();return(i,a)=>l=>{e?.(i,a,l),r(Vq({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},L8=e=>{var t=cn();return(n,r)=>i=>{e?.(n,r,i),t(Gbe())}},$8=(e,t,n)=>{var r=cn();return(i,a)=>l=>{e?.(i,a,l),r(Vbe({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function jA(e){var{tooltipEntrySettings:t}=e,n=cn(),r=nr(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(qbe(t)):i.current!==t&&n(Fbe({prev:i.current,next:t})),i.current=t)},[t,n,r]),x.useLayoutEffect(()=>()=>{i.current&&(n(Hbe(i.current)),i.current=null)},[n]),null}function NA(e){var{legendPayload:t}=e,n=cn(),r=nr(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(_me(t)):i.current!==t&&n(zme({prev:i.current,next:t})),i.current=t)},[n,r,t]),x.useLayoutEffect(()=>()=>{i.current&&(n(Pme(i.current)),i.current=null)},[n]),null}var Sj,E1e=()=>{var[e]=x.useState(()=>Oh("uid-"));return e},_1e=(Sj=xv.useId)!==null&&Sj!==void 0?Sj:E1e;function z1e(e,t){var n=_1e();return t||(e?"".concat(e,"-").concat(n):n)}var P1e=x.createContext(void 0),kA=e=>{var{id:t,type:n,children:r}=e,i=z1e("recharts-".concat(n),t);return x.createElement(P1e.Provider,{value:i},r(i))},T1e={cartesianItems:[],polarItems:[]},B8=Ar({name:"graphicalItems",initialState:T1e,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:sn()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Bi(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:sn()},removeCartesianGraphicalItem:{reducer(e,t){var n=Bi(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:sn()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:sn()},removePolarGraphicalItem:{reducer(e,t){var n=Bi(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:sn()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Bi(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:sn()}}}),{addCartesianGraphicalItem:R1e,replaceCartesianGraphicalItem:D1e,removeCartesianGraphicalItem:M1e,addPolarGraphicalItem:G_e,removePolarGraphicalItem:V_e,replacePolarGraphicalItem:Q_e}=B8.actions,I1e=B8.reducer,L1e=e=>{var t=cn(),n=x.useRef(null);return x.useLayoutEffect(()=>{n.current===null?t(R1e(e)):n.current!==e&&t(D1e({prev:n.current,next:e})),n.current=e},[t,e]),x.useLayoutEffect(()=>()=>{n.current&&(t(M1e(n.current)),n.current=null)},[t]),null},CA=x.memo(L1e),$1e=["points"];function JI(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 jj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JI(Object(n),!0).forEach(function(r){B1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function B1e(e,t,n){return(t=U1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U1e(e){var t=q1e(e,"string");return typeof t=="symbol"?t:t+""}function q1e(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 fv(){return fv=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},fv.apply(null,arguments)}function F1e(e,t){if(e==null)return{};var n,r,i=H1e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function H1e(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 K1e(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=At(r,typeof t!="boolean"?t.className:""),a=n??{},{points:l}=a,u=F1e(a,$1e);return x.createElement(T8,fv({},u,{className:i}))}function G1e(e,t){return e==null?!1:t?!0:e.length===1}function U8(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:l,needClip:u,clipPathId:d,zIndex:f=Qn.scatter}=e;if(!G1e(t,n))return null;var p=SA(n),m=yde(n),g=t.map((S,b)=>{var j,k,E=jj(jj(jj({r:3},l),m),{},{index:b,cx:(j=S.x)!==null&&j!==void 0?j:void 0,cy:(k=S.y)!==null&&k!==void 0?k:void 0,dataKey:a,value:S.value,payload:S.payload,points:t});return x.createElement(K1e,{key:"dot-".concat(b),option:n,dotProps:E,className:i})}),v={};return u&&d!=null&&(v.clipPath="url(#clipPath-".concat(p?"":"dots-").concat(d,")")),x.createElement(xi,{zIndex:f},x.createElement(gr,fv({className:r},v),g))}function eL(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 tL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eL(Object(n),!0).forEach(function(r){V1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function V1e(e,t,n){return(t=Q1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Q1e(e){var t=Y1e(e,"string");return typeof t=="symbol"?t:t+""}function Y1e(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 q8=0,W1e={xAxis:{},yAxis:{},zAxis:{}},F8=Ar({name:"cartesianAxis",initialState:W1e,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:sn()},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:sn()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:sn()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:sn()},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:sn()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:sn()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:sn()},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:sn()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:sn()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var a,l=i.widthHistory||[];if(l.length===3&&l[0]===l[2]&&r===l[1]&&r!==i.width&&Math.abs(r-((a=l[0])!==null&&a!==void 0?a:0))<=1)return;var u=[...l,r].slice(-3);e.yAxis[n]=tL(tL({},i),{},{width:r,widthHistory:u})}}}}),{addXAxis:Z1e,replaceXAxis:X1e,removeXAxis:J1e,addYAxis:eNe,replaceYAxis:tNe,removeYAxis:nNe,addZAxis:Y_e,replaceZAxis:W_e,removeZAxis:Z_e,updateYAxisWidth:rNe}=F8.actions,iNe=F8.reducer,aNe=re([tr],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),sNe=re([aNe,$s,Bs],(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)}}),qx=()=>Ue(sNe),oNe=()=>Ue(qwe);function nL(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 Nj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nL(Object(n),!0).forEach(function(r){lNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lNe(e,t,n){return(t=cNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cNe(e){var t=uNe(e,"string");return typeof t=="symbol"?t:t+""}function uNe(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 dNe=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:a,clipPath:l}=e;if(i===!1||t.x==null||t.y==null)return null;var u={index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},d=Nj(Nj(Nj({},u),ep(i)),nC(i)),f;return x.isValidElement(i)?f=x.cloneElement(i,d):typeof i=="function"?f=i(d):f=x.createElement(T8,d),x.createElement(gr,{className:"recharts-active-dot",clipPath:l},f)};function fN(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:l=Qn.activeDot}=e,u=Ue(fc),d=oNe();if(t==null||d==null)return null;var f=t.find(p=>d.includes(p.payload));return ln(f)?null:x.createElement(xi,{zIndex:l},x.createElement(dNe,{point:f,childIndex:Number(u),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var rL=(e,t,n)=>{var r=n??e;if(!ln(r))return fa(r,t,0)},fNe=(e,t,n)=>{var r={},i=e.filter(_x),a=e.filter(f=>f.stackId==null),l=i.reduce((f,p)=>{var m=f[p.stackId];return m==null&&(m=[]),m.push(p),f[p.stackId]=m,f},r),u=Object.entries(l).map(f=>{var p,[m,g]=f,v=g.map(b=>b.dataKey),S=rL(t,n,(p=g[0])===null||p===void 0?void 0:p.barSize);return{stackId:m,dataKeys:v,barSize:S}}),d=a.map(f=>{var p=[f.dataKey].filter(g=>g!=null),m=rL(t,n,f.barSize);return{stackId:void 0,dataKeys:p,barSize:m}});return[...u,...d]};function iL(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 Ng(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iL(Object(n),!0).forEach(function(r){hNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hNe(e,t,n){return(t=pNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pNe(e){var t=mNe(e,"string");return typeof t=="symbol"?t:t+""}function mNe(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 gNe(e,t,n,r,i){var a,l=r.length;if(!(l<1)){var u=fa(e,n,0,!0),d,f=[];if(ht((a=r[0])===null||a===void 0?void 0:a.barSize)){var p=!1,m=n/l,g=r.reduce((E,C)=>E+(C.barSize||0),0);g+=(l-1)*u,g>=n&&(g-=(l-1)*u,u=0),g>=n&&m>0&&(p=!0,m*=.9,g=l*m);var v=(n-g)/2>>0,S={offset:v-u,size:0};d=r.reduce((E,C)=>{var A,P={stackId:C.stackId,dataKeys:C.dataKeys,position:{offset:S.offset+S.size+u,size:p?m:(A=C.barSize)!==null&&A!==void 0?A:0}},O=[...E,P];return S=P.position,O},f)}else{var b=fa(t,n,0,!0);n-2*b-(l-1)*u<=0&&(u=0);var j=(n-2*b-(l-1)*u)/l;j>1&&(j>>=0);var k=ht(i)?Math.min(j,i):j;d=r.reduce((E,C,A)=>[...E,{stackId:C.stackId,dataKeys:C.dataKeys,position:{offset:b+(j+u)*A+(j-k)/2,size:k}}],f)}return d}}var yNe=(e,t,n,r,i,a,l)=>{var u=ln(l)?t:l,d=gNe(n,r,i!==a?i:a,e,u);return i!==a&&d!=null&&(d=d.map(f=>Ng(Ng({},f),{},{position:Ng(Ng({},f.position),{},{offset:f.position.offset-i/2})}))),d},vNe=(e,t)=>{var n=Ex(t);if(!(!e||n==null||t==null)){var{stackId:r}=t;if(r!=null){var i=e[r];if(i){var{stackedData:a}=i;if(a)return a.find(l=>l.key===n)}}}},xNe=(e,t)=>{if(!(e==null||t==null)){var n=e.find(r=>r.stackId===t.stackId&&t.dataKey!=null&&r.dataKeys.includes(t.dataKey));if(n!=null)return n.position}};function bNe(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&ht(e.zIndex)?e.zIndex:t}var wNe=e=>{var{chartData:t}=e,n=cn(),r=nr();return x.useEffect(()=>r?()=>{}:(n(vI(t)),()=>{n(vI(void 0))}),[t,n,r]),null},aL={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},H8=Ar({name:"brush",initialState:aL,reducers:{setBrushSettings(e,t){return t.payload==null?aL:t.payload}}}),{setBrushSettings:X_e}=H8.actions,SNe=H8.reducer;function jNe(e){return(e%180+180)%180}var NNe=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=jNe(i),l=a*Math.PI/180,u=Math.atan(r/n),d=l>u&&l<Math.PI-u?r/Math.sin(l):n/Math.cos(l);return Math.abs(d)},kNe={dots:[],areas:[],lines:[]},K8=Ar({name:"referenceElements",initialState:kNe,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=Bi(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=Bi(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=Bi(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:J_e,removeDot:eze,addArea:tze,removeArea:nze,addLine:rze,removeLine:ize}=K8.actions,CNe=K8.reducer,ANe=x.createContext(void 0),ONe=e=>{var{children:t}=e,[n]=x.useState("".concat(Oh("recharts"),"-clip")),r=qx();if(r==null)return null;var{x:i,y:a,width:l,height:u}=r;return x.createElement(ANe.Provider,{value:n},x.createElement("defs",null,x.createElement("clipPath",{id:n},x.createElement("rect",{x:i,y:a,height:u,width:l}))),t)};function G8(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 ENe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return NNe(r,n)}function _Ne(e,t,n){var r=n==="width",{x:i,y:a,width:l,height:u}=e;return t===1?{start:r?i:a,end:r?i+l:a+u}:{start:r?i+l:a+u,end:r?i:a}}function qh(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function zNe(e,t){return G8(e,t+1)}function PNe(e,t,n,r,i){for(var a=(r||[]).slice(),{start:l,end:u}=t,d=0,f=1,p=l,m=function(){var S=r?.[d];if(S===void 0)return{v:G8(r,f)};var b=d,j,k=()=>(j===void 0&&(j=n(S,b)),j),E=S.coordinate,C=d===0||qh(e,E,k,p,u);C||(d=0,p=l,f+=1),C&&(p=E+e*(k()/2+i),d+=f)},g;f<=a.length;)if(g=m(),g)return g.v;return[]}function TNe(e,t,n,r,i){var a=(r||[]).slice(),l=a.length;if(l===0)return[];for(var{start:u,end:d}=t,f=1;f<=l;f++){for(var p=(l-1)%f,m=u,g=!0,v=function(){var A=r[b];if(A==null)return 0;var P=b,O,_=()=>(O===void 0&&(O=n(A,P)),O),T=A.coordinate,$=b===p||qh(e,T,_,m,d);if(!$)return g=!1,1;$&&(m=T+e*(_()/2+i))},S,b=p;b<l&&(S=v(),!(S!==0&&S===1));b+=f);if(g){for(var j=[],k=p;k<l;k+=f){var E=r[k];E!=null&&j.push(E)}return j}}return[]}function sL(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 xr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sL(Object(n),!0).forEach(function(r){RNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function RNe(e,t,n){return(t=DNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DNe(e){var t=MNe(e,"string");return typeof t=="symbol"?t:t+""}function MNe(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 INe(e,t,n,r,i){for(var a=(r||[]).slice(),l=a.length,{start:u}=t,{end:d}=t,f=function(g){var v=a[g];if(v==null)return 1;var S=v,b,j=()=>(b===void 0&&(b=n(v,g)),b);if(g===l-1){var k=e*(S.coordinate+e*j()/2-d);a[g]=S=xr(xr({},S),{},{tickCoord:k>0?S.coordinate-k*e:S.coordinate})}else a[g]=S=xr(xr({},S),{},{tickCoord:S.coordinate});if(S.tickCoord!=null){var E=qh(e,S.tickCoord,j,u,d);E&&(d=S.tickCoord-e*(j()/2+i),a[g]=xr(xr({},S),{},{isShow:!0}))}},p=l-1;p>=0;p--)f(p);return a}function LNe(e,t,n,r,i,a){var l=(r||[]).slice(),u=l.length,{start:d,end:f}=t;if(a){var p=r[u-1];if(p!=null){var m=n(p,u-1),g=e*(p.coordinate+e*m/2-f);if(l[u-1]=p=xr(xr({},p),{},{tickCoord:g>0?p.coordinate-g*e:p.coordinate}),p.tickCoord!=null){var v=qh(e,p.tickCoord,()=>m,d,f);v&&(f=p.tickCoord-e*(m/2+i),l[u-1]=xr(xr({},p),{},{isShow:!0}))}}}for(var S=a?u-1:u,b=function(E){var C=l[E];if(C==null)return 1;var A=C,P,O=()=>(P===void 0&&(P=n(C,E)),P);if(E===0){var _=e*(A.coordinate-e*O()/2-d);l[E]=A=xr(xr({},A),{},{tickCoord:_<0?A.coordinate-_*e:A.coordinate})}else l[E]=A=xr(xr({},A),{},{tickCoord:A.coordinate});if(A.tickCoord!=null){var T=qh(e,A.tickCoord,O,d,f);T&&(d=A.tickCoord+e*(O()/2+i),l[E]=xr(xr({},A),{},{isShow:!0}))}},j=0;j<S;j++)b(j);return l}function AA(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:l,orientation:u,interval:d,tickFormatter:f,unit:p,angle:m}=e;if(!i||!i.length||!r)return[];if(Pe(d)||op.isSsr){var g;return(g=zNe(i,Pe(d)?d:0))!==null&&g!==void 0?g:[]}var v=[],S=u==="top"||u==="bottom"?"width":"height",b=p&&S==="width"?mh(p,{fontSize:t,letterSpacing:n}):{width:0,height:0},j=(P,O)=>{var _=typeof f=="function"?f(P.value,O):P.value;return S==="width"?ENe(mh(_,{fontSize:t,letterSpacing:n}),b,m):mh(_,{fontSize:t,letterSpacing:n})[S]},k=i[0],E=i[1],C=i.length>=2&&k!=null&&E!=null?Qr(E.coordinate-k.coordinate):1,A=_Ne(a,C,S);return d==="equidistantPreserveStart"?PNe(C,A,j,i,l):d==="equidistantPreserveEnd"?TNe(C,A,j,i,l):(d==="preserveStart"||d==="preserveStartEnd"?v=LNe(C,A,j,i,l,d==="preserveStartEnd"):v=INe(C,A,j,i,l),v.filter(P=>P.isShow))}var $Ne=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,l=0;if(t){Array.from(t).forEach(p=>{if(p){var m=p.getBoundingClientRect();m.width>l&&(l=m.width)}});var u=n?n.getBoundingClientRect().width:0,d=i+a,f=l+d+u+(n?r:0);return Math.round(f)}return 0},BNe={xAxis:{},yAxis:{}},V8=Ar({name:"renderedTicks",initialState:BNe,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:UNe,removeRenderedTicks:qNe}=V8.actions,FNe=V8.reducer,HNe=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function KNe(e,t){if(e==null)return{};var n,r,i=GNe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function GNe(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 hc(){return hc=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},hc.apply(null,arguments)}function oL(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 Nn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oL(Object(n),!0).forEach(function(r){VNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function VNe(e,t,n){return(t=QNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QNe(e){var t=YNe(e,"string");return typeof t=="symbol"?t:t+""}function YNe(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 Os={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:Qn.axis};function WNe(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:l,axisLine:u,otherSvgProps:d}=e;if(!u)return null;var f=Nn(Nn(Nn({},d),mi(u)),{},{fill:"none"});if(a==="top"||a==="bottom"){var p=+(a==="top"&&!l||a==="bottom"&&l);f=Nn(Nn({},f),{},{x1:t,y1:n+p*i,x2:t+r,y2:n+p*i})}else{var m=+(a==="left"&&!l||a==="right"&&l);f=Nn(Nn({},f),{},{x1:t+m*r,y1:n,x2:t+m*r,y2:n+i})}return x.createElement("line",hc({},f,{className:At("recharts-cartesian-axis-line",nd(u,"className"))}))}function ZNe(e,t,n,r,i,a,l,u,d){var f,p,m,g,v,S,b=u?-1:1,j=e.tickSize||l,k=Pe(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":f=p=e.coordinate,g=n+ +!u*i,m=g-b*j,S=m-b*d,v=k;break;case"left":m=g=e.coordinate,p=t+ +!u*r,f=p-b*j,v=f-b*d,S=k;break;case"right":m=g=e.coordinate,p=t+ +u*r,f=p+b*j,v=f+b*d,S=k;break;default:f=p=e.coordinate,g=n+ +u*i,m=g+b*j,S=m+b*d,v=k;break}return{line:{x1:f,y1:m,x2:p,y2:g},tick:{x:v,y:S}}}function XNe(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function JNe(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function eke(e){var{option:t,tickProps:n,value:r}=e,i,a=At(n.className,"recharts-cartesian-axis-tick-value");if(x.isValidElement(t))i=x.cloneElement(t,Nn(Nn({},n),{},{className:a}));else if(typeof t=="function")i=t(Nn(Nn({},n),{},{className:a}));else{var l="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(l=At(l,s1e(t))),i=x.createElement(vA,hc({},n,{className:l}),r)}return i}function tke(e){var{ticks:t,axisType:n,axisId:r}=e,i=cn();return x.useEffect(()=>{if(r==null||n==null)return Jo;var a=t.map(l=>({value:l.value,coordinate:l.coordinate,offset:l.offset,index:l.index}));return i(UNe({ticks:a,axisId:r,axisType:n})),()=>{i(qNe({axisId:r,axisType:n}))}},[i,t,r,n]),null}var nke=x.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:l,unit:u,padding:d,tickTextProps:f,orientation:p,mirror:m,x:g,y:v,width:S,height:b,tickSize:j,tickMargin:k,fontSize:E,letterSpacing:C,getTicksConfig:A,events:P,axisType:O,axisId:_}=e,T=AA(Nn(Nn({},A),{},{ticks:n}),E,C),$=mi(A),F=ep(r),U=k8($.textAnchor)?$.textAnchor:XNe(p,m),B=JNe(p,m),V={};typeof i=="object"&&(V=i);var X=Nn(Nn({},$),{},{fill:"none"},V),Z=T.map(oe=>Nn({entry:oe},ZNe(oe,g,v,S,b,p,j,m,k))),H=Z.map(oe=>{var{entry:ye,line:I}=oe;return x.createElement(gr,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(ye.value,"-").concat(ye.coordinate,"-").concat(ye.tickCoord)},i&&x.createElement("line",hc({},X,I,{className:At("recharts-cartesian-axis-tick-line",nd(i,"className"))})))}),J=Z.map((oe,ye)=>{var I,M,{entry:q,tick:D}=oe,G=Nn(Nn(Nn(Nn({verticalAnchor:B},$),{},{textAnchor:U,stroke:"none",fill:a},D),{},{index:ye,payload:q,visibleTicksCount:T.length,tickFormatter:l,padding:d},f),{},{angle:(I=(M=f?.angle)!==null&&M!==void 0?M:$.angle)!==null&&I!==void 0?I:0}),se=Nn(Nn({},G),F);return x.createElement(gr,hc({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(q.value,"-").concat(q.coordinate,"-").concat(q.tickCoord)},ax(P,q,ye)),r&&x.createElement(eke,{option:r,tickProps:se,value:"".concat(typeof l=="function"?l(q.value,ye):q.value).concat(u||"")}))});return x.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(O,"-ticks")},x.createElement(tke,{ticks:T,axisId:_,axisType:O}),J.length>0&&x.createElement(xi,{zIndex:Qn.label},x.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(O,"-tick-labels"),ref:t},J)),H.length>0&&x.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(O,"-tick-lines")},H))}),rke=x.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:l,ticks:u,axisType:d,axisId:f}=e,p=KNe(e,HNe),[m,g]=x.useState(""),[v,S]=x.useState(""),b=x.useRef(null);x.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var k;return $Ne({ticks:b.current,label:(k=e.labelRef)===null||k===void 0?void 0:k.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var j=x.useCallback(k=>{if(k){var E=k.getElementsByClassName("recharts-cartesian-axis-tick-value");b.current=E;var C=E[0];if(C){var A=window.getComputedStyle(C),P=A.fontSize,O=A.letterSpacing;(P!==m||O!==v)&&(g(P),S(O))}}},[m,v]);return l||r!=null&&r<=0||i!=null&&i<=0?null:x.createElement(xi,{zIndex:e.zIndex},x.createElement(gr,{className:At("recharts-cartesian-axis",a)},x.createElement(WNe,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:mi(e)}),x.createElement(nke,{ref:j,axisType:d,events:p,fontSize:m,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:u,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:f}),x.createElement(Uje,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},x.createElement(Zje,{label:e.label,labelRef:e.labelRef}),e.children)))}),OA=x.forwardRef((e,t)=>{var n=er(e,Os);return x.createElement(rke,hc({},n,{ref:t}))});OA.displayName="CartesianAxis";var ike=["x1","y1","x2","y2","key"],ake=["offset"],ske=["xAxisId","yAxisId"],oke=["xAxisId","yAxisId"];function lL(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 jr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lL(Object(n),!0).forEach(function(r){lke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lke(e,t,n){return(t=cke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cke(e){var t=uke(e,"string");return typeof t=="symbol"?t:t+""}function uke(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 Fl(){return Fl=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},Fl.apply(null,arguments)}function hv(e,t){if(e==null)return{};var n,r,i=dke(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function dke(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 fke=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:i,width:a,height:l,ry:u}=e;return x.createElement("rect",{x:r,y:i,ry:u,width:a,height:l,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function Q8(e){var{option:t,lineItemProps:n}=e,r;if(x.isValidElement(t))r=x.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var i,{x1:a,y1:l,x2:u,y2:d,key:f}=n,p=hv(n,ike),m=(i=mi(p))!==null&&i!==void 0?i:{},{offset:g}=m,v=hv(m,ake);r=x.createElement("line",Fl({},v,{x1:a,y1:l,x2:u,y2:d,fill:"none",key:f}))}return r}function hke(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:l}=e,u=hv(e,ske),d=i.map((f,p)=>{var m=jr(jr({},u),{},{x1:t,y1:f,x2:t+n,y2:f,key:"line-".concat(p),index:p});return x.createElement(Q8,{key:"line-".concat(p),option:r,lineItemProps:m})});return x.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function pke(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:l}=e,u=hv(e,oke),d=i.map((f,p)=>{var m=jr(jr({},u),{},{x1:f,y1:t,x2:f,y2:t+n,key:"line-".concat(p),index:p});return x.createElement(Q8,{option:r,lineItemProps:m,key:"line-".concat(p)})});return x.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function mke(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:a,height:l,horizontalPoints:u,horizontal:d=!0}=e;if(!d||!t||!t.length||u==null)return null;var f=u.map(m=>Math.round(m+i-i)).sort((m,g)=>m-g);i!==f[0]&&f.unshift(0);var p=f.map((m,g)=>{var v=f[g+1],S=v==null,b=S?i+l-m:v-m;if(b<=0)return null;var j=g%t.length;return x.createElement("rect",{key:"react-".concat(g),y:m,x:r,height:b,width:a,stroke:"none",fill:t[j],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function gke(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:a,width:l,height:u,verticalPoints:d}=e;if(!t||!n||!n.length)return null;var f=d.map(m=>Math.round(m+i-i)).sort((m,g)=>m-g);i!==f[0]&&f.unshift(0);var p=f.map((m,g)=>{var v=f[g+1],S=v==null,b=S?i+l-m:v-m;if(b<=0)return null;var j=g%n.length;return x.createElement("rect",{key:"react-".concat(g),x:m,y:a,width:b,height:u,stroke:"none",fill:n[j],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var yke=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return O6(AA(jr(jr(jr({},Os),n),{},{ticks:E6(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},vke=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return O6(AA(jr(jr(jr({},Os),n),{},{ticks:E6(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},xke={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Qn.grid};function pc(e){var t=pC(),n=mC(),r=D6(),i=jr(jr({},er(e,xke)),{},{x:Pe(e.x)?e.x:r.left,y:Pe(e.y)?e.y:r.top,width:Pe(e.width)?e.width:r.width,height:Pe(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:l,x:u,y:d,width:f,height:p,syncWithTicks:m,horizontalValues:g,verticalValues:v}=i,S=nr(),b=Ue($=>aI($,"xAxis",a,S)),j=Ue($=>aI($,"yAxis",l,S));if(!Ha(f)||!Ha(p)||!Pe(u)||!Pe(d))return null;var k=i.verticalCoordinatesGenerator||yke,E=i.horizontalCoordinatesGenerator||vke,{horizontalPoints:C,verticalPoints:A}=i;if((!C||!C.length)&&typeof E=="function"){var P=g&&g.length,O=E({yAxis:j?jr(jr({},j),{},{ticks:P?g:j.ticks}):void 0,width:t??f,height:n??p,offset:r},P?!0:m);My(Array.isArray(O),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof O,"]")),Array.isArray(O)&&(C=O)}if((!A||!A.length)&&typeof k=="function"){var _=v&&v.length,T=k({xAxis:b?jr(jr({},b),{},{ticks:_?v:b.ticks}):void 0,width:t??f,height:n??p,offset:r},_?!0:m);My(Array.isArray(T),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof T,"]")),Array.isArray(T)&&(A=T)}return x.createElement(xi,{zIndex:i.zIndex},x.createElement("g",{className:"recharts-cartesian-grid"},x.createElement(fke,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),x.createElement(mke,Fl({},i,{horizontalPoints:C})),x.createElement(gke,Fl({},i,{verticalPoints:A})),x.createElement(hke,Fl({},i,{offset:r,horizontalPoints:C,xAxis:b,yAxis:j})),x.createElement(pke,Fl({},i,{offset:r,verticalPoints:A,xAxis:b,yAxis:j}))))}pc.displayName="CartesianGrid";var bke={},Y8=Ar({name:"errorBars",initialState:bke,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(a=>a.dataKey===r.dataKey&&a.direction===r.direction?i:a))},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:aze,replaceErrorBar:sze,removeErrorBar:oze}=Y8.actions,wke=Y8.reducer,Ske=["children"];function jke(e,t){if(e==null)return{};var n,r,i=Nke(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Nke(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 kke={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},Cke=x.createContext(kke);function W8(e){var{children:t}=e,n=jke(e,Ske);return x.createElement(Cke.Provider,{value:n},t)}function Fx(e,t){var n,r,i=Ue(f=>qs(f,e)),a=Ue(f=>Fs(f,t)),l=(n=i?.allowDataOverflow)!==null&&n!==void 0?n:Kn.allowDataOverflow,u=(r=a?.allowDataOverflow)!==null&&r!==void 0?r:Gn.allowDataOverflow,d=l||u;return{needClip:d,needClipX:l,needClipY:u}}function EA(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=qx(),{needClipX:a,needClipY:l,needClip:u}=Fx(t,n);if(!u||!i)return null;var{x:d,y:f,width:p,height:m}=i;return x.createElement("clipPath",{id:"clipPath-".concat(r)},x.createElement("rect",{x:a?d:d-p/2,y:l?f:f-m/2,width:a?p:p*2,height:l?m:m*2}))}var Z8=(e,t,n,r)=>Qa(e,"xAxis",t,r),X8=(e,t,n,r)=>Va(e,"xAxis",t,r),J8=(e,t,n,r)=>Qa(e,"yAxis",n,r),eF=(e,t,n,r)=>Va(e,"yAxis",n,r),Ake=re([Et,Z8,J8,X8,eF],(e,t,n,r,i)=>va(e,"xAxis")?Ko(t,r,!1):Ko(n,i,!1)),Oke=(e,t,n,r,i)=>i;function Eke(e){return e.type==="line"}var _ke=re([gp,Oke],(e,t)=>e.filter(Eke).find(n=>n.id===t)),zke=re([Et,Z8,J8,X8,eF,_ke,Ake,up],(e,t,n,r,i,a,l,u)=>{var{chartData:d,dataStartIndex:f,dataEndIndex:p}=u;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||l==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:m,data:g}=a,v;if(g!=null&&g.length>0?v=g:v=d?.slice(f,p+1),v!=null)return Zke({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:m,bandSize:l,displayedData:v})}});function tF(e){var t=ep(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:a}=t,l=Number(i),u=Number(a);return(Number.isNaN(l)||l<0)&&(l=n),(Number.isNaN(u)||u<0)&&(u=r),{r:l,strokeWidth:u}}return{r:n,strokeWidth:r}}var Pke=["id"],Tke=["type","layout","connectNulls","needClip","shape"],Rke=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function Fh(){return Fh=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},Fh.apply(null,arguments)}function cL(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 Ta(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cL(Object(n),!0).forEach(function(r){Dke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dke(e,t,n){return(t=Mke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mke(e){var t=Ike(e,"string");return typeof t=="symbol"?t:t+""}function Ike(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 _A(e,t){if(e==null)return{};var n,r,i=Lke(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Lke(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 $ke=e=>{var{dataKey:t,name:n,stroke:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:Cd(n,t),payload:e}]},Bke=x.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:l,hide:u,unit:d,tooltipType:f,id:p}=e,m={dataDefinedOnItem:n,getPosition:Jo,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:Cd(l,t),hide:u,type:f,color:r,unit:d,graphicalItemId:p}};return x.createElement(jA,{tooltipEntrySettings:m})}),nF=(e,t)=>"".concat(t,"px ").concat(e,"px");function Uke(e,t){for(var n=e.length%2!==0?[...e,0]:e,r=[],i=0;i<t;++i)r.push(...n);return r}var qke=(e,t,n)=>{var r=n.reduce((g,v)=>g+v,0);if(!r)return nF(t,e);for(var i=Math.floor(e/r),a=e%r,l=[],u=0,d=0;u<n.length;d+=(f=n[u])!==null&&f!==void 0?f:0,++u){var f,p=n[u];if(p!=null&&d+p>a){l=[...n.slice(0,u),a-d];break}}var m=l.length%2===0?[0,t]:[t];return[...Uke(n,i),...l,...m].map(g=>"".concat(g,"px")).join(", ")};function Fke(e){var{clipPathId:t,points:n,props:r}=e,{dot:i,dataKey:a,needClip:l}=r,{id:u}=r,d=_A(r,Pke),f=mi(d);return x.createElement(U8,{points:n,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:f,needClip:l,clipPathId:t})}function Hke(e){var{showLabels:t,children:n,points:r}=e,i=x.useMemo(()=>r?.map(a=>{var l,u,d={x:(l=a.x)!==null&&l!==void 0?l:0,y:(u=a.y)!==null&&u!==void 0?u:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Ta(Ta({},d),{},{value:a.value,payload:a.payload,viewBox:d,parentViewBox:void 0,fill:void 0})}),[r]);return x.createElement(bA,{value:t?i:void 0},n)}function uL(e){var{clipPathId:t,pathRef:n,points:r,strokeDasharray:i,props:a}=e,{type:l,layout:u,connectNulls:d,needClip:f,shape:p}=a,m=_A(a,Tke),g=Ta(Ta({},kr(m)),{},{fill:"none",className:"recharts-line-curve",clipPath:f?"url(#clipPath-".concat(t,")"):void 0,points:r,type:l,layout:u,connectNulls:d,strokeDasharray:i??a.strokeDasharray});return x.createElement(x.Fragment,null,r?.length>1&&x.createElement(M8,Fh({shapeType:"curve",option:p},g,{pathRef:n})),x.createElement(Fke,{points:r,clipPathId:t,props:a}))}function Kke(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function Gke(e){var{clipPathId:t,props:n,pathRef:r,previousPointsRef:i,longestAnimatedLengthRef:a}=e,{points:l,strokeDasharray:u,isAnimationActive:d,animationBegin:f,animationDuration:p,animationEasing:m,animateNewValues:g,width:v,height:S,onAnimationEnd:b,onAnimationStart:j}=n,k=i.current,E=cp(l,"recharts-line-"),C=x.useRef(E),[A,P]=x.useState(!1),O=!A,_=x.useCallback(()=>{typeof b=="function"&&b(),P(!1)},[b]),T=x.useCallback(()=>{typeof j=="function"&&j(),P(!0)},[j]),$=Kke(r.current),F=x.useRef(0);C.current!==E&&(F.current=a.current,C.current=E);var U=F.current;return x.createElement(Hke,{points:l,showLabels:O},n.children,x.createElement(lp,{animationId:E,begin:f,duration:p,isActive:d,easing:m,onAnimationEnd:_,onAnimationStart:T,key:E},B=>{var V=Ft(U,$+U,B),X=Math.min(V,$),Z;if(d)if(u){var H="".concat(u).split(/[,\s]+/gim).map(ye=>parseFloat(ye));Z=qke(X,$,H)}else Z=nF($,X);else Z=u==null?void 0:String(u);if(B>0&&$>0&&(i.current=l,a.current=Math.max(a.current,X)),k){var J=k.length/l.length,oe=B===1?l:l.map((ye,I)=>{var M=Math.floor(I*J);if(k[M]){var q=k[M];return Ta(Ta({},ye),{},{x:Ft(q.x,ye.x,B),y:Ft(q.y,ye.y,B)})}return g?Ta(Ta({},ye),{},{x:Ft(v*2,ye.x,B),y:Ft(S/2,ye.y,B)}):Ta(Ta({},ye),{},{x:ye.x,y:ye.y})});return i.current=oe,x.createElement(uL,{props:n,points:oe,clipPathId:t,pathRef:r,strokeDasharray:Z})}return x.createElement(uL,{props:n,points:l,clipPathId:t,pathRef:r,strokeDasharray:Z})}),x.createElement(wA,{label:n.label}))}function Vke(e){var{clipPathId:t,props:n}=e,r=x.useRef(null),i=x.useRef(0),a=x.useRef(null);return x.createElement(Gke,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:i,pathRef:a})}var Qke=(e,t)=>{var n,r;return{x:(n=e.x)!==null&&n!==void 0?n:void 0,y:(r=e.y)!==null&&r!==void 0?r:void 0,value:e.value,errorVal:vn(e.payload,t)}};class Yke extends x.Component{render(){var{hide:t,dot:n,points:r,className:i,xAxisId:a,yAxisId:l,top:u,left:d,width:f,height:p,id:m,needClip:g,zIndex:v}=this.props;if(t)return null;var S=At("recharts-line",i),b=m,{r:j,strokeWidth:k}=tF(n),E=SA(n),C=j*2+k,A=g?"url(#clipPath-".concat(E?"":"dots-").concat(b,")"):void 0;return x.createElement(xi,{zIndex:v},x.createElement(gr,{className:S},g&&x.createElement("defs",null,x.createElement(EA,{clipPathId:b,xAxisId:a,yAxisId:l}),!E&&x.createElement("clipPath",{id:"clipPath-dots-".concat(b)},x.createElement("rect",{x:d-C/2,y:u-C/2,width:f+C,height:p+C}))),x.createElement(W8,{xAxisId:a,yAxisId:l,data:r,dataPointFormatter:Qke,errorBarOffset:0},x.createElement(Vke,{props:this.props,clipPathId:b}))),x.createElement(fN,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:A}))}}var rF={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:Qn.line,type:"linear"};function Wke(e){var t=er(e,rF),{activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:l,connectNulls:u,dot:d,hide:f,isAnimationActive:p,label:m,legendType:g,xAxisId:v,yAxisId:S,id:b}=t,j=_A(t,Rke),{needClip:k}=Fx(v,S),E=qx(),C=el(),A=nr(),P=Ue(F=>zke(F,v,S,A,b));if(C!=="horizontal"&&C!=="vertical"||P==null||E==null)return null;var{height:O,width:_,x:T,y:$}=E;return x.createElement(Yke,Fh({},j,{id:b,connectNulls:u,dot:d,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:l,isAnimationActive:p,hide:f,label:m,legendType:g,xAxisId:v,yAxisId:S,points:P,layout:C,height:O,width:_,left:T,top:$,needClip:k}))}function Zke(e){var{layout:t,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,dataKey:l,bandSize:u,displayedData:d}=e;return d.map((f,p)=>{var m=vn(f,l);if(t==="horizontal"){var g=Dy({axis:n,ticks:i,bandSize:u,entry:f,index:p}),v=ln(m)?null:r.scale.map(m);return{x:g,y:v??null,value:m,payload:f}}var S=ln(m)?null:n.scale.map(m),b=Dy({axis:r,ticks:a,bandSize:u,entry:f,index:p});return S==null||b==null?null:{x:S,y:b,value:m,payload:f}}).filter(Boolean)}function Xke(e){var t=er(e,rF),n=nr();return x.createElement(kA,{id:t.id,type:"line"},r=>x.createElement(x.Fragment,null,x.createElement(NA,{legendPayload:$ke(t)}),x.createElement(Bke,{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(CA,{type:"line",id:r,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),x.createElement(Wke,Fh({},t,{id:r}))))}var Hx=x.memo(Xke,Nc);Hx.displayName="Line";function Za(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:q8}function Xa(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:q8}var iF=(e,t,n)=>Qa(e,"xAxis",Za(e,t),n),aF=(e,t,n)=>Va(e,"xAxis",Za(e,t),n),sF=(e,t,n)=>Qa(e,"yAxis",Xa(e,t),n),oF=(e,t,n)=>Va(e,"yAxis",Xa(e,t),n),Jke=re([Et,iF,sF,aF,oF],(e,t,n,r,i)=>va(e,"xAxis")?Ko(t,r,!1):Ko(n,i,!1)),eCe=(e,t)=>t,lF=re([gp,eCe],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),cF=e=>{var t=Et(e),n=va(t,"xAxis");return n?"yAxis":"xAxis"},tCe=(e,t)=>{var n=cF(e);return n==="yAxis"?Xa(e,t):Za(e,t)},nCe=(e,t,n)=>iv(e,cF(e),tCe(e,t),n),rCe=re([lF,nCe],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=Ex(e);if(!(r==null||i==null)){var a=(n=t[r])===null||n===void 0?void 0:n.stackedData,l=a?.find(u=>u.key===i);if(l!=null)return l.map(u=>[u[0],u[1]])}}}),iCe=re([Et,iF,sF,aF,oF,rCe,nU,Jke,lF,Yye],(e,t,n,r,i,a,l,u,d,f)=>{var{chartData:p,dataStartIndex:m,dataEndIndex:g}=l;if(!(d==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||i==null||r.length===0||i.length===0||u==null)){var{data:v}=d,S;if(v&&v.length>0?S=v:S=p?.slice(m,g+1),S!=null)return NCe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:m,areaSettings:d,stackedData:a,displayedData:S,chartBaseValue:f,bandSize:u})}}),aCe=["id"],sCe=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function Zl(){return Zl=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},Zl.apply(null,arguments)}function uF(e,t){if(e==null)return{};var n,r,i=oCe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function oCe(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 dL(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 Ru(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dL(Object(n),!0).forEach(function(r){lCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lCe(e,t,n){return(t=cCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cCe(e){var t=uCe(e,"string");return typeof t=="symbol"?t:t+""}function uCe(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 pv(e,t){return e&&e!=="none"?e:t}var dCe=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:a,hide:l}=e;return[{inactive:l,dataKey:t,type:a,color:pv(r,i),value:Cd(n,t),payload:e}]},fCe=x.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:l,hide:u,unit:d,tooltipType:f,id:p}=e,m={dataDefinedOnItem:n,getPosition:Jo,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:Cd(l,t),hide:u,type:f,color:pv(r,a),unit:d,graphicalItemId:p}};return x.createElement(jA,{tooltipEntrySettings:m})});function hCe(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:l}=r,u=mi(r);return x.createElement(U8,{points:n,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:l,baseProps:u,needClip:i,clipPathId:t})}function pCe(e){var{showLabels:t,children:n,points:r}=e,i=r.map(a=>{var l,u,d={x:(l=a.x)!==null&&l!==void 0?l:0,y:(u=a.y)!==null&&u!==void 0?u:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Ru(Ru({},d),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return x.createElement(bA,{value:t?i:void 0},n)}function fL(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:a}=e,{layout:l,type:u,stroke:d,connectNulls:f,isRange:p}=a,{id:m}=a,g=uF(a,aCe),v=mi(g),S=kr(g);return x.createElement(x.Fragment,null,t?.length>1&&x.createElement(gr,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},x.createElement(hh,Zl({},S,{id:m,points:t,connectNulls:f,type:u,baseLine:n,layout:l,stroke:"none",className:"recharts-area-area"})),d!=="none"&&x.createElement(hh,Zl({},v,{className:"recharts-area-curve",layout:l,type:u,connectNulls:f,fill:"none",points:t})),d!=="none"&&p&&Array.isArray(n)&&x.createElement(hh,Zl({},v,{className:"recharts-area-curve",layout:l,type:u,connectNulls:f,fill:"none",points:n}))),x.createElement(hCe,{points:t,props:g,clipPathId:i}))}function mCe(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:l}=e,u=(t=a[0])===null||t===void 0?void 0:t.y,d=(n=a[a.length-1])===null||n===void 0?void 0:n.y;if(!ht(u)||!ht(d))return null;var f=r*Math.abs(u-d),p=Math.max(...a.map(m=>m.x||0));return Pe(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(m=>m.x||0),p)),Pe(p)?x.createElement("rect",{x:0,y:u<d?u:u-f,width:p+(l?parseInt("".concat(l),10):1),height:Math.floor(f)}):null}function gCe(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:l}=e,u=(t=a[0])===null||t===void 0?void 0:t.x,d=(n=a[a.length-1])===null||n===void 0?void 0:n.x;if(!ht(u)||!ht(d))return null;var f=r*Math.abs(u-d),p=Math.max(...a.map(m=>m.y||0));return Pe(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(m=>m.y||0),p)),Pe(p)?x.createElement("rect",{x:u<d?u:u-f,y:0,width:f,height:Math.floor(p+(l?parseInt("".concat(l),10):1))}):null}function yCe(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:a}=e;return n==="vertical"?x.createElement(mCe,{alpha:t,points:r,baseLine:i,strokeWidth:a}):x.createElement(gCe,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function vCe(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a}=e,{points:l,baseLine:u,isAnimationActive:d,animationBegin:f,animationDuration:p,animationEasing:m,onAnimationStart:g,onAnimationEnd:v}=r,S=x.useMemo(()=>({points:l,baseLine:u}),[l,u]),b=cp(S,"recharts-area-"),j=gC(),[k,E]=x.useState(!1),C=!k,A=x.useCallback(()=>{typeof v=="function"&&v(),E(!1)},[v]),P=x.useCallback(()=>{typeof g=="function"&&g(),E(!0)},[g]);if(j==null)return null;var O=i.current,_=a.current;return x.createElement(pCe,{showLabels:C,points:l},r.children,x.createElement(lp,{animationId:b,begin:f,duration:p,isActive:d,easing:m,onAnimationEnd:A,onAnimationStart:P,key:b},T=>{if(O){var $=O.length/l.length,F=T===1?l:l.map((B,V)=>{var X=Math.floor(V*$);if(O[X]){var Z=O[X];return Ru(Ru({},B),{},{x:Ft(Z.x,B.x,T),y:Ft(Z.y,B.y,T)})}return B}),U;return Pe(u)?U=Ft(_,u,T):ln(u)||da(u)?U=Ft(_,0,T):U=u.map((B,V)=>{var X=Math.floor(V*$);if(Array.isArray(_)&&_[X]){var Z=_[X];return Ru(Ru({},B),{},{x:Ft(Z.x,B.x,T),y:Ft(Z.y,B.y,T)})}return B}),T>0&&(i.current=F,a.current=U),x.createElement(fL,{points:F,baseLine:U,needClip:t,clipPathId:n,props:r})}return T>0&&(i.current=l,a.current=u),x.createElement(gr,null,d&&x.createElement("defs",null,x.createElement("clipPath",{id:"animationClipPath-".concat(n)},x.createElement(yCe,{alpha:T,points:l,baseLine:u,layout:j,strokeWidth:r.strokeWidth}))),x.createElement(gr,{clipPath:"url(#animationClipPath-".concat(n,")")},x.createElement(fL,{points:l,baseLine:u,needClip:t,clipPathId:n,props:r})))}),x.createElement(wA,{label:r.label}))}function xCe(e){var{needClip:t,clipPathId:n,props:r}=e,i=x.useRef(null),a=x.useRef();return x.createElement(vCe,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}class bCe extends x.PureComponent{render(){var{hide:t,dot:n,points:r,className:i,top:a,left:l,needClip:u,xAxisId:d,yAxisId:f,width:p,height:m,id:g,baseLine:v,zIndex:S}=this.props;if(t)return null;var b=At("recharts-area",i),j=g,{r:k,strokeWidth:E}=tF(n),C=SA(n),A=k*2+E,P=u?"url(#clipPath-".concat(C?"":"dots-").concat(j,")"):void 0;return x.createElement(xi,{zIndex:S},x.createElement(gr,{className:b},u&&x.createElement("defs",null,x.createElement(EA,{clipPathId:j,xAxisId:d,yAxisId:f}),!C&&x.createElement("clipPath",{id:"clipPath-dots-".concat(j)},x.createElement("rect",{x:l-A/2,y:a-A/2,width:p+A,height:m+A}))),x.createElement(xCe,{needClip:u,clipPathId:j,props:this.props})),x.createElement(fN,{points:r,mainColor:pv(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:P}),this.props.isRange&&Array.isArray(v)&&x.createElement(fN,{points:v,mainColor:pv(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:P}))}}var wCe={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:Qn.area};function SCe(e){var t,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,connectNulls:l,dot:u,fill:d,fillOpacity:f,hide:p,isAnimationActive:m,legendType:g,stroke:v,xAxisId:S,yAxisId:b}=e,j=uF(e,sCe),k=el(),E=f8(),{needClip:C}=Fx(S,b),A=nr(),{points:P,isRange:O,baseLine:_}=(t=Ue(V=>iCe(V,e.id,A)))!==null&&t!==void 0?t:{},T=qx();if(k!=="horizontal"&&k!=="vertical"||T==null||E!=="AreaChart"&&E!=="ComposedChart")return null;var{height:$,width:F,x:U,y:B}=T;return!P||!P.length?null:x.createElement(bCe,Zl({},j,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,baseLine:_,connectNulls:l,dot:u,fill:d,fillOpacity:f,height:$,hide:p,layout:k,isAnimationActive:m,isRange:O,legendType:g,needClip:C,points:P,stroke:v,width:F,left:U,top:B,xAxisId:S,yAxisId:b}))}var jCe=(e,t,n,r,i)=>{var a=n??t;if(Pe(a))return a;var l=e==="horizontal"?i:r,u=l.scale.domain();if(l.type==="number"){var d=Math.max(u[0],u[1]),f=Math.min(u[0],u[1]);return a==="dataMin"?f:a==="dataMax"||d<0?d:Math.max(Math.min(u[0],u[1]),0)}return a==="dataMin"?u[0]:a==="dataMax"?u[1]:u[0]};function NCe(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:a,chartBaseValue:l,xAxis:u,yAxis:d,displayedData:f,dataStartIndex:p,xAxisTicks:m,yAxisTicks:g,bandSize:v}=e,S=i&&i.length,b=jCe(a,l,n,u,d),j=a==="horizontal",k=!1,E=f.map((A,P)=>{var O,_,T,$;if(S)$=i[p+P];else{var F=vn(A,r);Array.isArray(F)?($=F,k=!0):$=[b,F]}var U=(O=(_=$)===null||_===void 0?void 0:_[1])!==null&&O!==void 0?O:null,B=U==null||S&&!t&&vn(A,r)==null;if(j){var V;return{x:Dy({axis:u,ticks:m,bandSize:v,entry:A,index:P}),y:B?null:(V=d.scale.map(U))!==null&&V!==void 0?V:null,value:$,payload:A}}return{x:B?null:(T=u.scale.map(U))!==null&&T!==void 0?T:null,y:Dy({axis:d,ticks:g,bandSize:v,entry:A,index:P}),value:$,payload:A}}),C;return S||k?C=E.map(A=>{var P,O=Array.isArray(A.value)?A.value[0]:null;if(j){var _;return{x:A.x,y:O!=null&&A.y!=null&&(_=d.scale.map(O))!==null&&_!==void 0?_:null,payload:A.payload}}return{x:O!=null&&(P=u.scale.map(O))!==null&&P!==void 0?P:null,y:A.y,payload:A.payload}}):C=j?d.scale.map(b):u.scale.map(b),{points:E,baseLine:C??0,isRange:k}}function kCe(e){var t=er(e,wCe),n=nr();return x.createElement(kA,{id:t.id,type:"area"},r=>x.createElement(x.Fragment,null,x.createElement(NA,{legendPayload:dCe(t)}),x.createElement(fCe,{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(CA,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:_6(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),x.createElement(SCe,Zl({},t,{id:r}))))}var Du=x.memo(kCe,Nc);Du.displayName="Area";function hN(){return hN=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},hN.apply(null,arguments)}function zA(e){return x.createElement(M8,hN({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},e))}var CCe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(Pe(t))return t;var a=Pe(r)||ln(r);return a?t(r,i):(a||Es(!1),n)}},ACe=(e,t,n)=>n,OCe=(e,t)=>t,wp=re([gp,OCe],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),ECe=re([wp],e=>e?.maxBarSize),_Ce=(e,t,n,r)=>r,zCe=re([Et,gp,Za,Xa,ACe],(e,t,n,r,i)=>t.filter(a=>e==="horizontal"?a.xAxisId===n:a.yAxisId===r).filter(a=>a.isPanorama===i).filter(a=>a.hide===!1).filter(a=>a.type==="bar")),PCe=(e,t,n)=>{var r=Et(e),i=Za(e,t),a=Xa(e,t);if(!(i==null||a==null))return r==="horizontal"?iv(e,"yAxis",a,n):iv(e,"xAxis",i,n)},TCe=(e,t)=>{var n=Et(e),r=Za(e,t),i=Xa(e,t);if(!(r==null||i==null))return n==="horizontal"?iI(e,"xAxis",r):iI(e,"yAxis",i)},RCe=re([zCe,Qye,TCe],fNe),DCe=(e,t,n)=>{var r,i,a=wp(e,t);if(a==null)return 0;var l=Za(e,t),u=Xa(e,t);if(l==null||u==null)return 0;var d=Et(e),f=pU(e),{maxBarSize:p}=a,m=ln(p)?f:p,g,v;return d==="horizontal"?(g=Qa(e,"xAxis",l,n),v=Va(e,"xAxis",l,n)):(g=Qa(e,"yAxis",u,n),v=Va(e,"yAxis",u,n)),(r=(i=Ko(g,v,!0))!==null&&i!==void 0?i:m)!==null&&r!==void 0?r:0},dF=(e,t,n)=>{var r=Et(e),i=Za(e,t),a=Xa(e,t);if(!(i==null||a==null)){var l,u;return r==="horizontal"?(l=Qa(e,"xAxis",i,n),u=Va(e,"xAxis",i,n)):(l=Qa(e,"yAxis",a,n),u=Va(e,"yAxis",a,n)),Ko(l,u)}},MCe=re([RCe,pU,Vye,mU,DCe,dF,ECe],yNe),ICe=(e,t,n)=>{var r=Za(e,t);if(r!=null)return Qa(e,"xAxis",r,n)},LCe=(e,t,n)=>{var r=Xa(e,t);if(r!=null)return Qa(e,"yAxis",r,n)},$Ce=(e,t,n)=>{var r=Za(e,t);if(r!=null)return Va(e,"xAxis",r,n)},BCe=(e,t,n)=>{var r=Xa(e,t);if(r!=null)return Va(e,"yAxis",r,n)},UCe=re([MCe,wp],xNe),qCe=re([PCe,wp],vNe),FCe=re([tr,dC,ICe,LCe,$Ce,BCe,UCe,Et,nU,dF,qCe,wp,_Ce],(e,t,n,r,i,a,l,u,d,f,p,m,g)=>{var{chartData:v,dataStartIndex:S,dataEndIndex:b}=d;if(!(m==null||l==null||t==null||u!=="horizontal"&&u!=="vertical"||n==null||r==null||i==null||a==null||f==null)){var{data:j}=m,k;if(j!=null&&j.length>0?k=j:k=v?.slice(S,b+1),k!=null)return yAe({layout:u,barSettings:m,pos:l,parentViewBox:t,bandSize:f,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:p,displayedData:k,offset:e,cells:g,dataStartIndex:S})}}),HCe=["index"];function pN(){return pN=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},pN.apply(null,arguments)}function KCe(e,t){if(e==null)return{};var n,r,i=GCe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function GCe(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 fF=x.createContext(void 0),VCe=e=>{var t=x.useContext(fF);if(t!=null)return t.stackId;if(e!=null)return _6(e)},QCe=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),YCe=e=>{var t=x.useContext(fF);if(t!=null){var{stackId:n}=t;return"url(#".concat(QCe(n,e),")")}},hF=e=>{var{index:t}=e,n=KCe(e,HCe),r=YCe(t);return x.createElement(gr,pN({className:"recharts-bar-stack-layer",clipPath:r},n))},WCe=["onMouseEnter","onMouseLeave","onClick"],ZCe=["value","background","tooltipPosition"],XCe=["id"],JCe=["onMouseEnter","onClick","onMouseLeave"];function Go(){return Go=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Go.apply(null,arguments)}function hL(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 Pr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hL(Object(n),!0).forEach(function(r){eAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eAe(e,t,n){return(t=tAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tAe(e){var t=nAe(e,"string");return typeof t=="symbol"?t:t+""}function nAe(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 mv(e,t){if(e==null)return{};var n,r,i=rAe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function rAe(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 iAe=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:Cd(n,t),payload:e}]},aAe=x.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:a,hide:l,unit:u,tooltipType:d,id:f}=e,p={dataDefinedOnItem:void 0,getPosition:Jo,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:Cd(a,t),hide:l,type:d,color:i,unit:u,graphicalItemId:f}};return x.createElement(jA,{tooltipEntrySettings:p})});function sAe(e){var t=Ue(fc),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:l,onMouseLeave:u,onClick:d}=a,f=mv(a,WCe),p=I8(l,r,a.id),m=L8(u),g=$8(d,r,a.id);if(!i||n==null)return null;var v=ep(i);return x.createElement(xi,{zIndex:bNe(i,Qn.barBackground)},n.map((S,b)=>{var{value:j,background:k,tooltipPosition:E}=S,C=mv(S,ZCe);if(!k)return null;var A=p(S,b),P=m(S,b),O=g(S,b),_=Pr(Pr(Pr(Pr(Pr({option:i,isActive:String(b)===t},C),{},{fill:"#eee"},k),v),ax(f,S,b)),{},{onMouseEnter:A,onMouseLeave:P,onClick:O,dataKey:r,index:b,className:"recharts-bar-background-rectangle"});return x.createElement(zA,Go({key:"background-bar-".concat(b)},_))}))}function oAe(e){var{showLabels:t,children:n,rects:r}=e,i=r?.map(a=>{var l={x:a.x,y:a.y,width:a.width,lowerWidth:a.width,upperWidth:a.width,height:a.height};return Pr(Pr({},l),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:l,fill:a.fill})});return x.createElement(bA,{value:t?i:void 0},n)}function lAe(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:l}=e,u=Ue(fc),d=Ue(c8),f=n&&String(i.originalDataIndex)===u&&(d==null||l===d),[p,m]=x.useState(!1),[g,v]=x.useState(!1);x.useEffect(()=>{var C;return f?(m(!0),C=requestAnimationFrame(()=>{v(!0)})):v(!1),()=>{cancelAnimationFrame(C)}},[f]);var S=x.useCallback(()=>{f||m(!1)},[f]),b=f&&g,j=f||p,k;f?n===!0?k=t:k=n:k=t;var E=x.createElement(zA,Go({},r,{name:String(r.name)},i,{isActive:b,option:k,index:a,dataKey:l,onTransitionEnd:S}));return j?x.createElement(xi,{zIndex:Qn.activeBar},x.createElement(hF,{index:i.originalDataIndex},E)):E}function cAe(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return x.createElement(zA,Go({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function uAe(e){var t,{data:n,props:r}=e,i=(t=mi(r))!==null&&t!==void 0?t:{},{id:a}=i,l=mv(i,XCe),{shape:u,dataKey:d,activeBar:f}=r,{onMouseEnter:p,onClick:m,onMouseLeave:g}=r,v=mv(r,JCe),S=I8(p,d,a),b=L8(g),j=$8(m,d,a);return n?x.createElement(x.Fragment,null,n.map((k,E)=>x.createElement(hF,Go({index:k.originalDataIndex,key:"rectangle-".concat(k?.x,"-").concat(k?.y,"-").concat(k?.value,"-").concat(E),className:"recharts-bar-rectangle"},ax(v,k,E),{onMouseEnter:S(k,E),onMouseLeave:b(k,E),onClick:j(k,E)}),f?x.createElement(lAe,{shape:u,activeBar:f,baseProps:l,entry:k,index:E,dataKey:d}):x.createElement(cAe,{shape:u,baseProps:l,entry:k,index:E,dataKey:d})))):null}function dAe(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:a,animationBegin:l,animationDuration:u,animationEasing:d,onAnimationEnd:f,onAnimationStart:p}=t,m=n.current,g=cp(t,"recharts-bar-"),[v,S]=x.useState(!1),b=!v,j=x.useCallback(()=>{typeof f=="function"&&f(),S(!1)},[f]),k=x.useCallback(()=>{typeof p=="function"&&p(),S(!0)},[p]);return x.createElement(oAe,{showLabels:b,rects:r},x.createElement(lp,{animationId:g,begin:l,duration:u,isActive:a,easing:d,onAnimationEnd:j,onAnimationStart:k,key:g},E=>{var C=E===1?r:r?.map((A,P)=>{var O=m&&m[P];if(O)return Pr(Pr({},A),{},{x:Ft(O.x,A.x,E),y:Ft(O.y,A.y,E),width:Ft(O.width,A.width,E),height:Ft(O.height,A.height,E)});if(i==="horizontal"){var _=Ft(0,A.height,E),T=Ft(A.stackedBarStart,A.y,E);return Pr(Pr({},A),{},{y:T,height:_})}var $=Ft(0,A.width,E),F=Ft(A.stackedBarStart,A.x,E);return Pr(Pr({},A),{},{width:$,x:F})});return E>0&&(n.current=C??null),C==null?null:x.createElement(gr,null,x.createElement(uAe,{props:t,data:C}))}),x.createElement(wA,{label:t.label}),t.children)}function fAe(e){var t=x.useRef(null);return x.createElement(dAe,{previousRectanglesRef:t,props:e})}var pF=0,hAe=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:vn(e,t)}};class pAe extends x.PureComponent{render(){var{hide:t,data:n,dataKey:r,className:i,xAxisId:a,yAxisId:l,needClip:u,background:d,id:f}=this.props;if(t||n==null)return null;var p=At("recharts-bar",i),m=f;return x.createElement(gr,{className:p,id:f},u&&x.createElement("defs",null,x.createElement(EA,{clipPathId:m,xAxisId:a,yAxisId:l})),x.createElement(gr,{className:"recharts-bar-rectangles",clipPath:u?"url(#clipPath-".concat(m,")"):void 0},x.createElement(sAe,{data:n,dataKey:r,background:d,allOtherBarProps:this.props}),x.createElement(fAe,this.props)))}}var mAe={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:pF,xAxisId:0,yAxisId:0,zIndex:Qn.bar};function gAe(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:l,animationBegin:u,animationDuration:d,animationEasing:f,isAnimationActive:p}=e,{needClip:m}=Fx(t,n),g=el(),v=nr(),S=u1e(e.children,lv),b=Ue(E=>FCe(E,e.id,v,S));if(g!=="vertical"&&g!=="horizontal")return null;var j,k=b?.[0];return k==null||k.height==null||k.width==null?j=0:j=g==="vertical"?k.height/2:k.width/2,x.createElement(W8,{xAxisId:t,yAxisId:n,data:b,dataPointFormatter:hAe,errorBarOffset:j},x.createElement(pAe,Go({},e,{layout:g,needClip:m,data:b,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:l,animationBegin:u,animationDuration:d,animationEasing:f,isAnimationActive:p})))}function yAe(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:i},pos:a,bandSize:l,xAxis:u,yAxis:d,xAxisTicks:f,yAxisTicks:p,stackedData:m,displayedData:g,offset:v,cells:S,parentViewBox:b,dataStartIndex:j}=e,k=t==="horizontal"?d:u,E=m?k.scale.domain():null,C=Ppe({numericAxis:k}),A=k.scale.map(C);return g.map((P,O)=>{var _,T,$,F,U,B;if(m){var V=m[O+j];if(V==null)return null;_=Ape(V,E)}else _=vn(P,n),Array.isArray(_)||(_=[C,_]);var X=CCe(r,pF)(_[1],O);if(t==="horizontal"){var Z,H=d.scale.map(_[0]),J=d.scale.map(_[1]);if(H==null||J==null)return null;T=XR({axis:u,ticks:f,bandSize:l,offset:a.offset,entry:P,index:O}),$=(Z=J??H)!==null&&Z!==void 0?Z:void 0,F=a.size;var oe=H-J;if(U=da(oe)?0:oe,B={x:T,y:v.top,width:F,height:v.height},Math.abs(X)>0&&Math.abs(U)<Math.abs(X)){var ye=Qr(U||X)*(Math.abs(X)-Math.abs(U));$-=ye,U+=ye}}else{var I=u.scale.map(_[0]),M=u.scale.map(_[1]);if(I==null||M==null)return null;if(T=I,$=XR({axis:d,ticks:p,bandSize:l,offset:a.offset,entry:P,index:O}),F=M-I,U=a.size,B={x:v.left,y:$,width:v.width,height:U},Math.abs(X)>0&&Math.abs(F)<Math.abs(X)){var q=Qr(F||X)*(Math.abs(X)-Math.abs(F));F+=q}}if(T==null||$==null||F==null||U==null||!i&&(F===0||U===0))return null;var D=Pr(Pr({},P),{},{stackedBarStart:A,x:T,y:$,width:F,height:U,value:m?_:_[1],payload:P,background:B,tooltipPosition:{x:T+F/2,y:$+U/2},parentViewBox:b,originalDataIndex:O},S&&S[O]&&S[O].props);return D}).filter(Boolean)}function vAe(e){var t=er(e,mAe),n=VCe(t.stackId),r=nr();return x.createElement(kA,{id:t.id,type:"bar"},i=>x.createElement(x.Fragment,null,x.createElement(NA,{legendPayload:iAe(t)}),x.createElement(aAe,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:i}),x.createElement(CA,{type:"bar",id:i,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:n,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r,hasCustomShape:t.shape!=null}),x.createElement(xi,{zIndex:t.zIndex},x.createElement(gAe,Go({},t,{id:i})))))}var gv=x.memo(vAe,Nc);gv.displayName="Bar";var xAe=["domain","range"],bAe=["domain","range"];function pL(e,t){if(e==null)return{};var n,r,i=wAe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function wAe(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 mL(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 mF(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=pL(e,xAe),{domain:a,range:l}=t,u=pL(t,bAe);return!mL(n,a)||!mL(r,l)?!1:Nc(i,u)}var SAe=["type"],jAe=["dangerouslySetInnerHTML","ticks","scale"],NAe=["id","scale"];function mN(){return mN=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},mN.apply(null,arguments)}function gL(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 yL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gL(Object(n),!0).forEach(function(r){kAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kAe(e,t,n){return(t=CAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CAe(e){var t=AAe(e,"string");return typeof t=="symbol"?t:t+""}function AAe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gN(e,t){if(e==null)return{};var n,r,i=OAe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function OAe(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 EAe(e){var t=cn(),n=x.useRef(null),r=gC(),{type:i}=e,a=gN(e,SAe),l=Cx(r,"xAxis",i),u=x.useMemo(()=>{if(l!=null)return yL(yL({},a),{},{type:l})},[a,l]);return x.useLayoutEffect(()=>{u!=null&&(n.current===null?t(Z1e(u)):n.current!==u&&t(X1e({prev:n.current,next:u})),n.current=u)},[u,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(J1e(n.current)),n.current=null)},[t]),null}var _Ae=e=>{var{xAxisId:t,className:n}=e,r=Ue(dC),i=nr(),a="xAxis",l=Ue(k=>Uq(k,a,t,i)),u=Ue(k=>Lq(k,t)),d=Ue(k=>_be(k,t)),f=Ue(k=>sq(k,t));if(u==null||d==null||f==null)return null;var{dangerouslySetInnerHTML:p,ticks:m,scale:g}=e,v=gN(e,jAe),{id:S,scale:b}=f,j=gN(f,NAe);return x.createElement(OA,mN({},v,j,{x:d.x,y:d.y,width:u.width,height:u.height,className:At("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:l,axisType:a,axisId:t}))},zAe={allowDataOverflow:Kn.allowDataOverflow,allowDecimals:Kn.allowDecimals,allowDuplicatedCategory:Kn.allowDuplicatedCategory,angle:Kn.angle,axisLine:Os.axisLine,height:Kn.height,hide:!1,includeHidden:Kn.includeHidden,interval:Kn.interval,label:!1,minTickGap:Kn.minTickGap,mirror:Kn.mirror,orientation:Kn.orientation,padding:Kn.padding,reversed:Kn.reversed,scale:Kn.scale,tick:Kn.tick,tickCount:Kn.tickCount,tickLine:Os.tickLine,tickSize:Os.tickSize,type:Kn.type,niceTicks:Kn.niceTicks,xAxisId:0},PAe=e=>{var t=er(e,zAe);return x.createElement(x.Fragment,null,x.createElement(EAe,{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(_Ae,t))},Ya=x.memo(PAe,mF);Ya.displayName="XAxis";var TAe=["type"],RAe=["dangerouslySetInnerHTML","ticks","scale"],DAe=["id","scale"];function yN(){return yN=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},yN.apply(null,arguments)}function vL(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 xL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vL(Object(n),!0).forEach(function(r){MAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MAe(e,t,n){return(t=IAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IAe(e){var t=LAe(e,"string");return typeof t=="symbol"?t:t+""}function LAe(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 vN(e,t){if(e==null)return{};var n,r,i=$Ae(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function $Ae(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 BAe(e){var t=cn(),n=x.useRef(null),r=gC(),{type:i}=e,a=vN(e,TAe),l=Cx(r,"yAxis",i),u=x.useMemo(()=>{if(l!=null)return xL(xL({},a),{},{type:l})},[l,a]);return x.useLayoutEffect(()=>{u!=null&&(n.current===null?t(eNe(u)):n.current!==u&&t(tNe({prev:n.current,next:u})),n.current=u)},[u,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(nNe(n.current)),n.current=null)},[t]),null}function UAe(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=x.useRef(null),l=x.useRef(null),u=Ue(dC),d=nr(),f=cn(),p="yAxis",m=Ue(O=>$q(O,t)),g=Ue(O=>Pbe(O,t)),v=Ue(O=>Uq(O,p,t,d)),S=Ue(O=>oq(O,t));if(x.useLayoutEffect(()=>{if(!(r!=="auto"||!m||xA(i)||x.isValidElement(i)||S==null)){var O=a.current;if(O){var _=O.getCalculatedWidth();Math.round(m.width)!==Math.round(_)&&f(rNe({id:t,width:_}))}}},[v,m,f,i,t,r,S]),m==null||g==null||S==null)return null;var{dangerouslySetInnerHTML:b,ticks:j,scale:k}=e,E=vN(e,RAe),{id:C,scale:A}=S,P=vN(S,DAe);return x.createElement(OA,yN({},E,P,{ref:a,labelRef:l,x:g.x,y:g.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:m.width,height:m.height,className:At("recharts-".concat(p," ").concat(p),n),viewBox:u,ticks:v,axisType:p,axisId:t}))}var qAe={allowDataOverflow:Gn.allowDataOverflow,allowDecimals:Gn.allowDecimals,allowDuplicatedCategory:Gn.allowDuplicatedCategory,angle:Gn.angle,axisLine:Os.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:Os.tickLine,tickSize:Os.tickSize,type:Gn.type,niceTicks:Gn.niceTicks,width:Gn.width,yAxisId:0},FAe=e=>{var t=er(e,qAe);return x.createElement(x.Fragment,null,x.createElement(BAe,{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(UAe,t))},Wa=x.memo(FAe,mF);Wa.displayName="YAxis";var HAe=(e,t)=>t,PA=re([HAe,Et,SU,ir,a8,Hs,eSe,tr],oSe);function KAe(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function TA(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(KAe(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 a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var l=(u,d)=>({relativeX:Math.round((u-t.left)/n),relativeY:Math.round((d-t.top)/r)});return"touches"in e?Array.from(e.touches).map(u=>l(u.clientX,u.clientY)):l(e.clientX,e.clientY)}var gF=gi("mouseClick"),yF=rp();yF.startListening({actionCreator:gF,effect:(e,t)=>{var n=e.payload,r=PA(t.getState(),TA(n));r?.activeIndex!=null&&t.dispatch(Qbe({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var xN=gi("mouseMove"),vF=rp(),wu=null,Cl=null,kj=null;vF.startListening({actionCreator:xN,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,l=a==="all"||a?.includes("mousemove");wu!==null&&(cancelAnimationFrame(wu),wu=null),Cl!==null&&(typeof i!="number"||!l)&&(clearTimeout(Cl),Cl=null),kj=TA(n);var u=()=>{var d=t.getState(),f=xp(d,d.tooltip.settings.shared);if(!kj){wu=null,Cl=null;return}if(f==="axis"){var p=PA(d,kj);p?.activeIndex!=null?t.dispatch(Yq({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate})):t.dispatch(Qq())}wu=null,Cl=null};if(!l){u();return}i==="raf"?wu=requestAnimationFrame(u):typeof i=="number"&&Cl===null&&(Cl=setTimeout(u,i))}});function GAe(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 bL={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},xF=Ar({name:"rootProps",initialState:bL,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:bL.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}}}),VAe=xF.reducer,{updateOptions:QAe}=xF.actions,YAe=null,WAe={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)},bF=Ar({name:"polarOptions",initialState:YAe,reducers:WAe}),{updatePolarOptions:lze}=bF.actions,ZAe=bF.reducer,wF=gi("keyDown"),SF=gi("focus"),jF=gi("blur"),Kx=rp(),Su=null,Al=null,kg=null;Kx.startListening({actionCreator:wF,effect:(e,t)=>{kg=e.payload,Su!==null&&(cancelAnimationFrame(Su),Su=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,a=i==="all"||i.includes("keydown");Al!==null&&(typeof r!="number"||!a)&&(clearTimeout(Al),Al=null);var l=()=>{try{var u=t.getState(),d=u.rootProps.accessibilityLayer!==!1;if(!d)return;var{keyboardInteraction:f}=u.tooltip,p=kg;if(p!=="ArrowRight"&&p!=="ArrowLeft"&&p!=="Enter")return;var m=ph(f,dc(u),cd(u),ud(u)),g=m==null?-1:Number(m),v=!Number.isFinite(g)||g<0,S=Hs(u),b=dc(u),j=xp(u,u.tooltip.settings.shared);if(p==="Enter"){if(v)return;var k=ov(u,j,"hover",String(f.index));t.dispatch(sv({active:!f.active,activeIndex:f.index,activeCoordinate:k}));return}var E=Ibe(u),C=E==="left-to-right"?1:-1,A=p==="ArrowRight"?1:-1,P;if(v){var O=cd(u),_=ud(u),T=A*C,$=X=>({active:!1,index:String(X),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(P=-1,T>0){for(var F=0;F<b.length;F++)if(ph($(F),b,O,_)!=null){P=F;break}}else for(var U=b.length-1;U>=0;U--)if(ph($(U),b,O,_)!=null){P=U;break}if(P<0)return}else{P=g+A*C;var B=S?.length||b.length;if(B===0||P>=B||P<0)return}var V=ov(u,j,"hover",String(P));t.dispatch(sv({active:!0,activeIndex:P.toString(),activeCoordinate:V}))}finally{Su=null,Al=null}};if(!a){l();return}r==="raf"?Su=requestAnimationFrame(l):typeof r=="number"&&Al===null&&(l(),kg=null,Al=setTimeout(()=>{kg?l():(Al=null,Su=null)},r))}});Kx.startListening({actionCreator:SF,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 a="0",l=xp(n,n.tooltip.settings.shared),u=ov(n,l,"hover",String(a));t.dispatch(sv({active:!0,activeIndex:a,activeCoordinate:u}))}}}});Kx.startListening({actionCreator:jF,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(sv({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function NF(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 Ri=gi("externalEvent"),kF=rp(),Cg=new Map,Zf=new Map,Cj=new Map;kF.startListening({actionCreator:Ri,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=NF(r);Cj.set(i,{handler:n,reactEvent:a});var l=Cg.get(i);l!==void 0&&(cancelAnimationFrame(l),Cg.delete(i));var u=t.getState(),{throttleDelay:d,throttledEvents:f}=u.eventSettings,p=f,m=p==="all"||p?.includes(i),g=Zf.get(i);g!==void 0&&(typeof d!="number"||!m)&&(clearTimeout(g),Zf.delete(i));var v=()=>{var j=Cj.get(i);try{if(!j)return;var{handler:k,reactEvent:E}=j,C=t.getState(),A={activeCoordinate:$we(C),activeDataKey:c8(C),activeIndex:fc(C),activeLabel:l8(C),activeTooltipIndex:fc(C),isTooltipActive:Bwe(C)};k&&k(A,E)}finally{Cg.delete(i),Zf.delete(i),Cj.delete(i)}};if(!m){v();return}if(d==="raf"){var S=requestAnimationFrame(v);Cg.set(i,S)}else if(typeof d=="number"){if(!Zf.has(i)){v();var b=setTimeout(v,d);Zf.set(i,b)}}else v()}}});var XAe=re([Rd],e=>e.tooltipItemPayloads),JAe=re([XAe,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(a=>a.settings.graphicalItemId===n);if(r!=null){var{getPosition:i}=r;if(i!=null)return i(t)}}}),CF=gi("touchMove"),AF=rp(),Ol=null,jo=null,wL=null,Xf=null;AF.startListening({actionCreator:CF,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){Xf=NF(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,l=a==="all"||a.includes("touchmove");Ol!==null&&(cancelAnimationFrame(Ol),Ol=null),jo!==null&&(typeof i!="number"||!l)&&(clearTimeout(jo),jo=null),wL=Array.from(n.touches).map(d=>TA({clientX:d.clientX,clientY:d.clientY,currentTarget:n.currentTarget}));var u=()=>{if(Xf!=null){var d=t.getState(),f=xp(d,d.tooltip.settings.shared);if(f==="axis"){var p,m=(p=wL)===null||p===void 0?void 0:p[0];if(m==null){Ol=null,jo=null;return}var g=PA(d,m);g?.activeIndex!=null&&t.dispatch(Yq({activeIndex:g.activeIndex,activeDataKey:void 0,activeCoordinate:g.activeCoordinate}))}else if(f==="item"){var v,S=Xf.touches[0];if(document.elementFromPoint==null||S==null)return;var b=document.elementFromPoint(S.clientX,S.clientY);if(!b||!b.getAttribute)return;var j=b.getAttribute($pe),k=(v=b.getAttribute(Bpe))!==null&&v!==void 0?v:void 0,E=Ac(d).find(P=>P.id===k);if(j==null||E==null||k==null)return;var{dataKey:C}=E,A=JAe(d,j,k);t.dispatch(Vq({activeDataKey:C,activeIndex:j,activeCoordinate:A,activeGraphicalItemId:k}))}Ol=null,jo=null}};if(!l){u();return}i==="raf"?Ol=requestAnimationFrame(u):typeof i=="number"&&jo===null&&(u(),Xf=null,jo=setTimeout(()=>{Xf?u():(jo=null,Ol=null)},i))}}});var OF={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},EF=Ar({name:"eventSettings",initialState:OF,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:eOe}=EF.actions,tOe=EF.reducer,nOe=JB({brush:SNe,cartesianAxis:iNe,chartData:ISe,errorBars:wke,eventSettings:tOe,graphicalItems:I1e,layout:Spe,legend:Tme,options:PSe,polarAxis:a1e,polarOptions:ZAe,referenceElements:CNe,renderedTicks:FNe,rootProps:VAe,tooltip:Ybe,zIndex:bSe}),rOe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return Vhe({reducer:nOe,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([yF.middleware,vF.middleware,Kx.middleware,kF.middleware,AF.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(p6({type:"raf"}))},devTools:{serialize:{replacer:GAe},name:"recharts-".concat(n)}})};function iOe(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=nr(),a=x.useRef(null);if(i)return n;a.current==null&&(a.current=rOe(t,r));var l=iC;return x.createElement(Zme,{context:l,store:a.current},n)}function aOe(e){var{layout:t,margin:n}=e,r=cn(),i=nr();return x.useEffect(()=>{i||(r(xpe(t)),r(vpe(n)))},[r,i,t,n]),null}var sOe=x.memo(aOe,Nc);function oOe(e){var t=cn();return x.useEffect(()=>{t(QAe(e))},[t,e]),null}var lOe=e=>{var t=cn();return x.useEffect(()=>{t(eOe(e))},[t,e]),null},cOe=x.memo(lOe,Nc);function SL(e){var{zIndex:t,isPanorama:n}=e,r=x.useRef(null),i=cn();return x.useLayoutEffect(()=>(r.current&&i(vSe({zIndex:t,element:r.current,isPanorama:n})),()=>{i(xSe({zIndex:t,isPanorama:n}))}),[i,t,n]),x.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function jL(e){var{children:t,isPanorama:n}=e,r=Ue(cSe);if(!r||r.length===0)return t;var i=r.filter(l=>l<0),a=r.filter(l=>l>0);return x.createElement(x.Fragment,null,i.map(l=>x.createElement(SL,{key:l,zIndex:l,isPanorama:n})),t,a.map(l=>x.createElement(SL,{key:l,zIndex:l,isPanorama:n})))}var uOe=["children"];function dOe(e,t){if(e==null)return{};var n,r,i=fOe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function fOe(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 yv(){return yv=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},yv.apply(null,arguments)}var hOe={width:"100%",height:"100%",display:"block"},pOe=x.forwardRef((e,t)=>{var n=pC(),r=mC(),i=G6();if(!Ha(n)||!Ha(r))return null;var{children:a,otherAttributes:l,title:u,desc:d}=e,f,p;return l!=null&&(typeof l.tabIndex=="number"?f=l.tabIndex:f=i?0:void 0,typeof l.role=="string"?p=l.role:p=i?"application":void 0),x.createElement(Qk,yv({},l,{title:u,desc:d,role:p,tabIndex:f,width:n,height:r,style:hOe,ref:t}),a)}),mOe=e=>{var{children:t}=e,n=Ue(xx);if(!n)return null;var{width:r,height:i,y:a,x:l}=n;return x.createElement(Qk,{width:r,height:i,x:l,y:a},t)},NL=x.forwardRef((e,t)=>{var{children:n}=e,r=dOe(e,uOe),i=nr();return i?x.createElement(mOe,null,x.createElement(jL,{isPanorama:!0},n)):x.createElement(pOe,yv({ref:t},r),x.createElement(jL,{isPanorama:!1},n))});function gOe(){var e=cn(),[t,n]=x.useState(null),r=Ue(Lpe);return x.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;ht(a)&&a!==r&&e(wpe(a))}},[t,e,r]),n}function kL(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 yOe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kL(Object(n),!0).forEach(function(r){vOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vOe(e,t,n){return(t=xOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xOe(e){var t=bOe(e,"string");return typeof t=="symbol"?t:t+""}function bOe(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 Uo(){return Uo=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},Uo.apply(null,arguments)}var wOe=()=>(GSe(),null);function vv(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var SOe=x.forwardRef((e,t)=>{var n,r,i=x.useRef(null),[a,l]=x.useState({containerWidth:vv((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:vv((r=e.style)===null||r===void 0?void 0:r.height)}),u=x.useCallback((f,p)=>{l(m=>{var g=Math.round(f),v=Math.round(p);return m.containerWidth===g&&m.containerHeight===v?m:{containerWidth:g,containerHeight:v}})},[]),d=x.useCallback(f=>{if(typeof t=="function"&&t(f),i.current!=null&&(i.current.disconnect(),i.current=null),f!=null&&typeof ResizeObserver<"u"){var{width:p,height:m}=f.getBoundingClientRect();u(p,m);var g=S=>{var b=S[0];if(b!=null){var{width:j,height:k}=b.contentRect;u(j,k)}},v=new ResizeObserver(g);v.observe(f),i.current=v}},[t,u]);return x.useEffect(()=>()=>{var f=i.current;f?.disconnect()},[u]),x.createElement(x.Fragment,null,x.createElement(ap,{width:a.containerWidth,height:a.containerHeight}),x.createElement("div",Uo({ref:d},e)))}),jOe=x.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=x.useState({containerWidth:vv(n),containerHeight:vv(r)}),l=x.useCallback((d,f)=>{a(p=>{var m=Math.round(d),g=Math.round(f);return p.containerWidth===m&&p.containerHeight===g?p:{containerWidth:m,containerHeight:g}})},[]),u=x.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var{width:f,height:p}=d.getBoundingClientRect();l(f,p)}},[t,l]);return x.createElement(x.Fragment,null,x.createElement(ap,{width:i.containerWidth,height:i.containerHeight}),x.createElement("div",Uo({ref:u},e)))}),NOe=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return x.createElement(x.Fragment,null,x.createElement(ap,{width:n,height:r}),x.createElement("div",Uo({ref:t},e)))}),kOe=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?x.createElement(jOe,Uo({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?x.createElement(NOe,Uo({},e,{width:n,height:r,ref:t})):x.createElement(x.Fragment,null,x.createElement(ap,{width:n,height:r}),x.createElement("div",Uo({ref:t},e)))});function COe(e){return e?SOe:kOe}var AOe=x.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:l,onDoubleClick:u,onMouseDown:d,onMouseEnter:f,onMouseLeave:p,onMouseMove:m,onMouseUp:g,onTouchEnd:v,onTouchMove:S,onTouchStart:b,style:j,width:k,responsive:E,dispatchTouchEvents:C=!0}=e,A=x.useRef(null),P=cn(),[O,_]=x.useState(null),[T,$]=x.useState(null),F=gOe(),U=fC(),B=U?.width>0?U.width:k,V=U?.height>0?U.height:i,X=x.useCallback(pe=>{F(pe),typeof t=="function"&&t(pe),_(pe),$(pe),pe!=null&&(A.current=pe)},[F,t,_,$]),Z=x.useCallback(pe=>{P(gF(pe)),P(Ri({handler:a,reactEvent:pe}))},[P,a]),H=x.useCallback(pe=>{P(xN(pe)),P(Ri({handler:f,reactEvent:pe}))},[P,f]),J=x.useCallback(pe=>{P(Qq()),P(Ri({handler:p,reactEvent:pe}))},[P,p]),oe=x.useCallback(pe=>{P(xN(pe)),P(Ri({handler:m,reactEvent:pe}))},[P,m]),ye=x.useCallback(()=>{P(SF())},[P]),I=x.useCallback(()=>{P(jF())},[P]),M=x.useCallback(pe=>{P(wF(pe.key))},[P]),q=x.useCallback(pe=>{P(Ri({handler:l,reactEvent:pe}))},[P,l]),D=x.useCallback(pe=>{P(Ri({handler:u,reactEvent:pe}))},[P,u]),G=x.useCallback(pe=>{P(Ri({handler:d,reactEvent:pe}))},[P,d]),se=x.useCallback(pe=>{P(Ri({handler:g,reactEvent:pe}))},[P,g]),ne=x.useCallback(pe=>{P(Ri({handler:b,reactEvent:pe}))},[P,b]),Ce=x.useCallback(pe=>{C&&P(CF(pe)),P(Ri({handler:S,reactEvent:pe}))},[P,C,S]),je=x.useCallback(pe=>{P(Ri({handler:v,reactEvent:pe}))},[P,v]),ee=COe(E);return x.createElement(y8.Provider,{value:O},x.createElement(pB.Provider,{value:T},x.createElement(ee,{width:B??j?.width,height:V??j?.height,className:At("recharts-wrapper",r),style:yOe({position:"relative",cursor:"default",width:B,height:V},j),onClick:Z,onContextMenu:q,onDoubleClick:D,onFocus:ye,onBlur:I,onKeyDown:M,onMouseDown:G,onMouseEnter:H,onMouseLeave:J,onMouseMove:oe,onMouseUp:se,onTouchEnd:je,onTouchMove:Ce,onTouchStart:ne,ref:X},x.createElement(wOe,null),n)))}),OOe=["width","height","responsive","children","className","style","compact","title","desc"];function EOe(e,t){if(e==null)return{};var n,r,i=_Oe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function _Oe(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 zOe=x.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:l,style:u,compact:d,title:f,desc:p}=e,m=EOe(e,OOe),g=mi(m);return d?x.createElement(x.Fragment,null,x.createElement(ap,{width:n,height:r}),x.createElement(NL,{otherAttributes:g,title:f,desc:p},a)):x.createElement(AOe,{className:l,style:u,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(NL,{otherAttributes:g,title:f,desc:p,ref:t},x.createElement(ONe,null,a)))});function bN(){return bN=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},bN.apply(null,arguments)}function CL(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 POe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CL(Object(n),!0).forEach(function(r){TOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TOe(e,t,n){return(t=ROe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ROe(e){var t=DOe(e,"string");return typeof t=="symbol"?t:t+""}function DOe(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 MOe={top:5,right:5,bottom:5,left:5},IOe=POe({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:MOe,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},OF),RA=x.forwardRef(function(t,n){var r,i=er(t.categoricalChartProps,IOe),{chartName:a,defaultTooltipEventType:l,validateTooltipEventTypes:u,tooltipPayloadSearcher:d,categoricalChartProps:f}=t,p={chartName:a,defaultTooltipEventType:l,validateTooltipEventTypes:u,tooltipPayloadSearcher:d,eventEmitter:void 0};return x.createElement(iOe,{preloadedState:{options:p},reduxStoreName:(r=f.id)!==null&&r!==void 0?r:a},x.createElement(wNe,{chartData:f.data}),x.createElement(sOe,{layout:i.layout,margin:i.margin}),x.createElement(cOe,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),x.createElement(oOe,{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(zOe,bN({},i,{ref:n})))}),LOe=["axis"],DA=x.forwardRef((e,t)=>x.createElement(RA,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:LOe,tooltipPayloadSearcher:yA,categoricalChartProps:e,ref:t})),$Oe=["axis","item"],wN=x.forwardRef((e,t)=>x.createElement(RA,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:$Oe,tooltipPayloadSearcher:yA,categoricalChartProps:e,ref:t})),BOe=["axis"],SN=x.forwardRef((e,t)=>x.createElement(RA,{chartName:"ComposedChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:BOe,tooltipPayloadSearcher:yA,categoricalChartProps:e,ref:t}));const ua={contentStyle:{backgroundColor:"#18181b",border:"1px solid #3f3f46",borderRadius:8,fontSize:12},labelStyle:{color:"#e4e4e7"},itemStyle:{color:"#a1a1aa"}},Jn={fill:"#71717a",fontSize:11},dd="#27272a",Nr="#27272a",qi=["#34d399","#60a5fa","#f472b6","#facc15","#a78bfa","#fb923c","#22d3ee","#f87171"];function _F(e){const t=String(e);return t.includes("T")?new Date(t):new Date(t+"T00:00:00")}function fd(e){return _F(String(e)).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function hd(e){const t=_F(e);return`${t.getMonth()+1}/${t.getDate()}`}const UOe=6,pd="__other__",Gu="_socialTotal";function qOe(e,t=UOe){const n=new Map;for(const p of e)n.set(p.source,(n.get(p.source)??0)+p.sessions);const r=[...n.entries()].sort((p,m)=>m[1]!==p[1]?m[1]-p[1]:p[0].localeCompare(m[0])),i=r.slice(0,t),a=new Set(i.map(([p])=>p)),l=Math.max(0,r.length-t),u=new Map;for(const p of e){let m=u.get(p.date);m||(m={date:p.date,[Gu]:0},u.set(p.date,m));const g=a.has(p.source)?p.source:pd;m[g]=(m[g]??0)+p.sessions,m[Gu]=(m[Gu]??0)+p.sessions}const d=[...u.values()].sort((p,m)=>String(p.date).localeCompare(String(m.date))),f=i.map(([p])=>p);return l>0&&f.push(pd),{data:d,sources:f,otherCount:l}}function Vu(e){return e.replace(/\+/g," ")}function zF(e,t=30){return e.length<=t?e:e.slice(0,Math.max(1,t-1))+"…"}const FOe=["7d","30d","90d","all"],Eo=qi,jN="#71717a",PF="#52525b",Jf=25;function Ag(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function HOe(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 KOe({projectName:e}){const t=vi(),[n,r]=x.useState(null),[i,a]=x.useState(null),[l,u]=x.useState(!0),[d,f]=x.useState(!1),[p,m]=x.useState(!1),[g,v]=x.useState(null),[S,b]=x.useState(null),[j,k]=x.useState("sessions"),[E,C]=x.useState("desc"),[A,P]=x.useState("sessions"),[O,_]=x.useState("desc"),[T,$]=x.useState("sessions"),[F,U]=x.useState("desc"),[B,V]=x.useState("sessions"),[X,Z]=x.useState("desc"),[H,J]=x.useState([]),[oe,ye]=x.useState([]),[I,M]=x.useState([]),[q,D]=x.useState(!1),[G,se]=x.useState("30d");async function ne(de){u(!0),v(null);try{const ze=await t.fetchQuery({queryKey:qe.traffic.status(e),queryFn:()=>MV(e),staleTime:Rf});if(de.current)return;if(r(ze),!ze.connected){a(null),J([]),ye([]),M([]),u(!1);return}const[fe,Qe,qn,bi]=await Promise.all([t.fetchQuery({queryKey:qe.traffic.summary(e,G),queryFn:()=>IV(e,void 0,G),staleTime:Rf}),t.fetchQuery({queryKey:qe.traffic.aiHistory(e,G),queryFn:()=>$V(e,G).catch(()=>[]),staleTime:Rf}),t.fetchQuery({queryKey:qe.traffic.sessionHistory(e,G),queryFn:()=>UV(e,G).catch(()=>[]),staleTime:Rf}),t.fetchQuery({queryKey:qe.traffic.socialHistory(e,G),queryFn:()=>BV(e,G).catch(()=>[]),staleTime:Rf})]);if(de.current)return;a(fe),J(Qe),ye(qn),M(bi),u(!1)}catch(ze){if(de.current)return;v(ze instanceof Error?ze.message:"Failed to load GA4 data"),u(!1)}}x.useEffect(()=>{const de={current:!1};return ne(de),()=>{de.current=!0}},[e,G,t]);async function Ce(){f(!0),v(null),b(null);try{const de=await C5(e);b(`Synced ${de.rowCount.toLocaleString()} page rows, ${de.aiReferralCount.toLocaleString()} AI and ${de.socialReferralCount.toLocaleString()} social referral rows (${de.days} days)`),await t.invalidateQueries({queryKey:qe.traffic.project(e)}),await ne({current:!1})}catch(de){v(de instanceof Error?de.message:"Sync failed")}finally{f(!1)}}async function je(){m(!0),v(null),b(null);try{await qV(e),await t.invalidateQueries({queryKey:qe.traffic.project(e)}),r({connected:!1,propertyId:null,clientEmail:null,lastSyncedAt:null,createdAt:null,updatedAt:null}),a(null),b("GA4 disconnected")}catch(de){v(de instanceof Error?de.message:"Disconnect failed")}finally{m(!1)}}function ee(de){j===de?C(ze=>ze==="desc"?"asc":"desc"):(k(de),C("desc"))}function pe(de){A===de?_(ze=>ze==="desc"?"asc":"desc"):(P(de),_("desc"))}function Ee(de){T===de?U(ze=>ze==="desc"?"asc":"desc"):($(de),U("desc"))}function W(de){B===de?Z(ze=>ze==="desc"?"asc":"desc"):(V(de),Z("desc"))}const He=x.useMemo(()=>i?.topPages?[...i.topPages].sort((de,ze)=>{const fe=de[j],Qe=ze[j];return typeof fe=="string"&&typeof Qe=="string"?E==="asc"?fe.localeCompare(Qe):Qe.localeCompare(fe):E==="asc"?fe-Qe:Qe-fe}):[],[i?.topPages,j,E]),Te=x.useMemo(()=>i?.aiReferrals?[...i.aiReferrals].sort((de,ze)=>{const fe=de[A],Qe=ze[A];return typeof fe=="string"&&typeof Qe=="string"?O==="asc"?fe.localeCompare(Qe):Qe.localeCompare(fe):O==="asc"?fe-Qe:Qe-fe}):[],[i?.aiReferrals,A,O]),st=x.useMemo(()=>i?.aiReferralLandingPages?[...i.aiReferralLandingPages].sort((de,ze)=>{const fe=de[B],Qe=ze[B];return typeof fe=="string"&&typeof Qe=="string"?X==="asc"?fe.localeCompare(Qe):Qe.localeCompare(fe):X==="asc"?fe-Qe:Qe-fe}):[],[i?.aiReferralLandingPages,B,X]),Ve=x.useMemo(()=>i?.socialReferrals?[...i.socialReferrals].sort((de,ze)=>{const fe=de[T],Qe=ze[T];return typeof fe=="string"&&typeof Qe=="string"?F==="asc"?fe.localeCompare(Qe):Qe.localeCompare(fe):F==="asc"?fe-Qe:Qe-fe}):[],[i?.socialReferrals,T,F]),{socialChartData:Ht,socialChartSources:Lt,socialOtherCount:un}=x.useMemo(()=>{const de=qOe(I);return{socialChartData:de.data,socialChartSources:de.sources,socialOtherCount:de.otherCount}},[I]),{chartData:tn,chartSources:Se,dateRange:Ze}=x.useMemo(()=>{const de=[...new Set(H.map(nn=>nn.source))],ze=new Map;for(const nn of oe)ze.set(nn.date,{_totalSessions:nn.sessions,_organicSessions:nn.organicSessions});const fe=new Map;for(const nn of H){const On=`${nn.date}::${nn.source}`,Lr=fe.get(On)??0;fe.set(On,Math.max(Lr,nn.sessions))}for(const[nn,On]of fe){const[Lr,Zi]=nn.split("::");let ba=ze.get(Lr);ba||(ba={_totalSessions:0,_organicSessions:0},ze.set(Lr,ba)),ba[Zi]=(ba[Zi]??0)+On}const Qe=[...ze.entries()].sort(([nn],[On])=>nn.localeCompare(On)).map(([nn,On])=>({date:nn,...On})),qn=Qe.map(nn=>nn.date),bi=qn.length>0?{start:qn[0],end:qn[qn.length-1]}:null;return{chartData:Qe,chartSources:de,dateRange:bi}},[H,oe]);if(l&&!n)return o.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading traffic data…"});if(!n?.connected)return o.jsx(GOe,{projectName:e,onConnected:()=>{(async()=>(await t.invalidateQueries({queryKey:qe.traffic.project(e)}),await ne({current:!1})))()}});const Tt=i?.organicSharePctDisplay??"0%",mt=i?.totalOrganicSessions??0,Je=i?.aiSessionsDeduped??0,ce=i?.aiSessionsBySession??0,Ne=i?.aiSharePctBySessionDisplay??"0%",Me=i?new Set(i.aiReferrals.map(de=>de.source.toLowerCase())).size:0,Ge=Te[0]??null,pt=i?.totalDirectSessions??0,mn=i?.directSharePctDisplay??"0%",An=i?.socialSessions??0,gn=i?.socialSharePctDisplay??"0%",Ye=i?new Set(i.socialReferrals.map(de=>de.source.toLowerCase())).size:0,Kt=Ve[0]??null;return o.jsxs(o.Fragment,{children:[g&&o.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}),S&&o.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:S}),o.jsxs("div",{className:"flex items-center justify-between mb-6",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-emerald-500"}),o.jsxs("span",{className:"text-xs text-zinc-400",children:["Property ",o.jsx("span",{className:"text-zinc-300",children:n.propertyId}),n.clientEmail&&o.jsxs(o.Fragment,{children:[" · ",o.jsx("span",{className:"text-zinc-500",children:n.clientEmail})]})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs(be,{variant:"outline",size:"sm",disabled:d,onClick:Ce,children:[o.jsx(C2,{className:`w-3.5 h-3.5 mr-1.5 ${d?"animate-spin":""}`}),d?"Syncing…":"Sync"]}),o.jsxs(be,{variant:"ghost",size:"sm",className:"text-rose-400 hover:text-rose-300",disabled:p,onClick:je,children:[o.jsx(cY,{className:"w-3.5 h-3.5 mr-1.5"}),"Disconnect"]})]})]}),o.jsxs("section",{children:[o.jsxs("div",{className:"mb-4 flex items-start justify-between",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Traffic Overview"}),o.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Site Traffic",o.jsx(hr,{text:`Aggregated traffic metrics from Google Analytics 4. Sessions and users are summed across the selected period.${i?.periodStart&&i?.periodEnd?` Data available: ${new Date(i.periodStart+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})} – ${new Date(i.periodEnd+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}.`:""} Organic sessions are Google organic search sessions specifically.`})]})]}),o.jsx("div",{className:"flex gap-1",children:FOe.map(de=>o.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${G===de?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>se(de),children:de==="all"?"All":de},de))})]}),i?o.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[o.jsx(Aj,{value:Ag(i.totalSessions),label:"Total Sessions",subtitle:i.totalSessions.toLocaleString(),tone:"neutral"}),o.jsx(Aj,{value:Ag(i.totalOrganicSessions),label:"Organic Sessions",subtitle:`${Tt} of total`,tone:"positive"}),o.jsx(Aj,{value:Ag(i.totalUsers),label:"Total Users",subtitle:i.totalUsers.toLocaleString(),tone:"neutral"})]}):o.jsxs("div",{className:"surface-card rounded-lg p-6 text-center border border-zinc-800/60",children:[o.jsx("p",{className:"text-sm text-zinc-400 mb-3",children:"No traffic data yet."}),o.jsxs(be,{variant:"outline",size:"sm",disabled:d,onClick:Ce,children:[o.jsx(C2,{className:`w-3.5 h-3.5 mr-1.5 ${d?"animate-spin":""}`}),"Sync from GA4"]})]})]}),i&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"page-section-divider"}),o.jsxs("section",{children:[o.jsxs("div",{className:"mb-4 flex items-end justify-between",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Traffic Attribution"}),o.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Traffic by channel",o.jsx(hr,{text:"Decomposes GA4 sessions into four disjoint channels — organic search, social, direct, and known AI referrers. The AI cell is rendered separately so AI-driven traffic never inflates the Direct count. Detected via sessionDefaultChannelGrouping plus AI-source matching on sessionSource/firstUserSource/sessionManualSource (generic search sources excluded)."})]})]}),Ze&&o.jsxs("p",{className:"text-xs text-zinc-500",children:[new Date(Ze.start+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})," – ",new Date(Ze.end+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})]})]}),tn.length>0&&o.jsxs($e,{className:"surface-card p-5 mb-4",children:[o.jsxs("div",{className:"mb-4 flex items-end justify-between",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Trend"}),o.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:Se.length>0?"AI vs. total sessions":"All sessions (baseline)"}),Se.length===0&&o.jsx("p",{className:"text-xs text-zinc-500 mt-0.5",children:"AI referral sessions will be overlaid here once detected"})]}),Se.length===0&&o.jsx("p",{className:"text-xs text-zinc-500",children:"No AI referrals detected yet"})]}),o.jsx("div",{className:"h-64",children:o.jsx(zs,{width:"100%",height:"100%",children:o.jsxs(SN,{data:tn,margin:{top:4,right:4,bottom:0,left:0},children:[o.jsx(Ya,{dataKey:"date",tick:Jn,tickLine:!1,axisLine:{stroke:Nr},tickFormatter:hd}),o.jsx(Wa,{tick:Jn,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),o.jsx(Ds,{...ua,labelFormatter:fd,formatter:(de,ze)=>{const fe=typeof de=="number"?de.toLocaleString():String(de??0),Qe=String(ze??"");return Qe==="_totalSessions"?[fe,"Total Sessions"]:Qe==="_organicSessions"?[fe,"Organic Sessions"]:[fe,Qe]}}),o.jsx(H6,{wrapperStyle:{fontSize:11,color:"#a1a1aa"},formatter:de=>de==="_totalSessions"?"Total Sessions":de==="_organicSessions"?"Organic Sessions":de}),o.jsx(Du,{type:"monotone",dataKey:"_totalSessions",stroke:"#52525b",fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),Se.map((de,ze)=>o.jsx(Du,{type:"monotone",dataKey:de,stackId:"ai",stroke:Eo[ze%Eo.length],fill:Eo[ze%Eo.length],fillOpacity:.4,strokeWidth:1.5},de))]})})})]}),o.jsxs($e,{className:"surface-card p-5 mb-4",children:[o.jsxs("div",{className:"mb-4",children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Summary"}),o.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Channel breakdown"})]}),o.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[o.jsx(_a,{label:"Organic",value:Tt,hint:`${mt.toLocaleString()} sessions`,tone:"positive",tooltip:"Sessions from Google organic search (sessionDefaultChannelGrouping = 'Organic Search')."}),o.jsx(_a,{label:"Social",value:gn,hint:`${An.toLocaleString()} sessions`,tone:"neutral",tooltip:"Sessions from social platforms (sessionDefaultChannelGrouping = 'Organic Social' or 'Paid Social')."}),o.jsx(_a,{label:"Direct",value:mn,hint:`${pt.toLocaleString()} sessions`,tone:"neutral",tooltip:"Sessions with no source — bookmarks, typed URLs, untagged email, in-app browsers, and AI-driven traffic whose referrer header was stripped."}),o.jsx(_a,{label:"Known AI referrers (lower bound)",value:Ne,hint:`${ce.toLocaleString()} sessions`,tone:"positive",tooltip:"Sessions whose current sessionSource matched a known AI engine (e.g. chatgpt.com, claude.ai, gemini.google.com). Disjoint from Direct/Organic/Social. This is a strict lower bound: most AI traffic strips the referrer and falls into Direct, so the true AI share is typically higher than what's shown here. The detail table below also surfaces firstUserSource and UTM-tagged AI signals."})]}),Ge&&o.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: ",o.jsx("span",{className:"font-medium",children:Ge.source})," via ",Ge.medium,", accounting for ",Ge.sessions.toLocaleString()," sessions."]})]}),o.jsxs($e,{className:"surface-card p-5 mb-4",children:[o.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Detail"}),o.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Known AI referrers — sources detected"})]}),o.jsx("p",{className:"text-xs text-zinc-500",children:i.aiReferrals.length>0?`${Me} unique sources, ${i.aiReferrals.length} rows`:"No source rows"})]}),i.aiReferrals.length>0?o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[o.jsx(vr,{label:"Source",sortKey:"source",current:A,dir:O,onSort:pe,align:"left"}),o.jsx(vr,{label:"Medium",sortKey:"medium",current:A,dir:O,onSort:pe,align:"left"}),o.jsx("th",{className:"py-1 font-medium text-left",children:"Attribution"}),o.jsx(vr,{label:"Sessions",sortKey:"sessions",current:A,dir:O,onSort:pe,align:"right"}),o.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),o.jsx(vr,{label:"Users",sortKey:"users",current:A,dir:O,onSort:pe,align:"right"})]})}),o.jsx("tbody",{children:Te.map(de=>o.jsx(QOe,{referral:de,totalSessions:Je},`${de.source}:${de.medium}:${de.sourceDimension}`))})]})}):o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[o.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No AI referrer sessions detected yet"}),o.jsx("p",{className:"text-xs text-zinc-500 max-w-sm",children:"AI engines that preserve a referrer (Perplexity, copy/paste from ChatGPT, etc.) will appear here. Most AI traffic strips the referrer — see the Direct cell above for the upper bound."})]})]}),o.jsxs($e,{className:"surface-card p-5",children:[o.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Detail"}),o.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Known AI referrers — landing pages"})]}),o.jsx("p",{className:"text-xs text-zinc-500",children:st.length>0?`${st.length} rows`:"No landing-page rows"})]}),st.length>0?o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[o.jsx(vr,{label:"Landing Page",sortKey:"landingPage",current:B,dir:X,onSort:W,align:"left"}),o.jsx(vr,{label:"Source",sortKey:"source",current:B,dir:X,onSort:W,align:"left"}),o.jsx("th",{className:"py-1 font-medium text-left",children:"Attribution"}),o.jsx(vr,{label:"Sessions",sortKey:"sessions",current:B,dir:X,onSort:W,align:"right"}),o.jsx(vr,{label:"Users",sortKey:"users",current:B,dir:X,onSort:W,align:"right"})]})}),o.jsx("tbody",{children:st.map(de=>o.jsx(YOe,{row:de},`${de.landingPage}:${de.source}:${de.medium}:${de.sourceDimension}`))})]})}):o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[o.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No AI landing pages detected yet"}),o.jsx("p",{className:"text-xs text-zinc-500 max-w-sm",children:"Known-AI landing pages appear after a GA4 sync records visits from AI referrers."})]})]})]})]}),i&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"page-section-divider"}),o.jsxs("section",{children:[o.jsxs("div",{className:"mb-4",children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Social Attribution"}),o.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Social Media Traffic",o.jsx(hr,{text:"Tracks sessions classified as social traffic by GA4's default channel grouping (Organic Social and Paid Social). Google maintains the source-to-channel mapping."})]})]}),Ht.length>0&&o.jsxs($e,{className:"surface-card p-5 mb-4",children:[o.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Trend"}),o.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Social sessions over time"})]}),un>0&&o.jsxs("p",{className:"text-xs text-zinc-500",children:["Showing top ",Lt.length-1," sources · ",un," more grouped as Other"]})]}),o.jsx("div",{className:"h-64",children:o.jsx(zs,{width:"100%",height:"100%",children:o.jsxs(SN,{data:Ht,margin:{top:4,right:4,bottom:0,left:0},children:[o.jsx(Ya,{dataKey:"date",tick:Jn,tickLine:!1,axisLine:{stroke:Nr},tickFormatter:hd}),o.jsx(Wa,{tick:Jn,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),o.jsx(Ds,{...ua,labelFormatter:fd,formatter:(de,ze)=>{const fe=typeof de=="number"?de.toLocaleString():String(de??0),Qe=String(ze??"");if(Qe===Gu)return[fe,"Total Social"];if(Qe===pd){const qn=`Other (${un} source${un===1?"":"s"})`;return[fe,qn]}return[fe,Vu(Qe)]}}),o.jsx(Du,{type:"monotone",dataKey:Gu,stroke:PF,fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),Lt.map((de,ze)=>{const Qe=de===pd?jN:Eo[ze%Eo.length];return o.jsx(Du,{type:"monotone",dataKey:de,stackId:"social",stroke:Qe,fill:Qe,fillOpacity:.4,strokeWidth:1.5},de)})]})})}),o.jsx(ZOe,{sources:Lt,otherCount:un})]}),o.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,0.9fr)_minmax(0,1.5fr)]",children:[o.jsxs($e,{className:"surface-card p-5",children:[o.jsxs("div",{className:"mb-4",children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Summary"}),o.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Social media visits"})]}),i.socialReferrals.length>0?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[o.jsx(_a,{label:"Social Sessions",value:Ag(An),hint:`${An.toLocaleString()} sessions`,tone:"positive",tooltip:"Total sessions classified as Organic Social or Paid Social by GA4's default channel grouping."}),o.jsx(_a,{label:"Share of Traffic",value:gn,hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions that originated from social media platforms."}),o.jsx(_a,{label:"Platforms",value:String(Ye),hint:`${i.socialReferrals.length} source rows`,tone:"neutral",tooltip:"Number of distinct social media platforms detected. Each unique source/medium combination counts as one source row."})]}),Kt&&o.jsxs("div",{className:"mt-4 rounded-lg border border-sky-800/40 bg-sky-500/6 px-4 py-3 text-sm text-sky-100",children:[o.jsx("p",{className:"text-xs uppercase tracking-wider text-sky-300/70 mb-1",children:"Top social source"}),o.jsx("p",{className:"font-medium truncate",title:`${Kt.source} via ${Kt.medium}`,children:zF(Vu(Kt.source),64)}),o.jsxs("p",{className:"text-xs text-sky-200/70 mt-0.5 truncate",title:Kt.medium,children:["via ",Vu(Kt.medium)," · ",Kt.sessions.toLocaleString()," sessions"]})]})]}):o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[o.jsx(_a,{label:"Social Sessions",value:"0",hint:"0 sessions",tone:"neutral",tooltip:"Total sessions attributed to social media platforms."}),o.jsx(_a,{label:"Share of Traffic",value:"0%",hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions from social media."}),o.jsx(_a,{label:"Platforms",value:"0",hint:"known platforms",tone:"neutral",tooltip:"Number of distinct social media platforms detected."})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3 text-sm text-zinc-400",children:[o.jsx("p",{className:"mb-1.5 text-zinc-300",children:"Monitoring social media traffic via GA4 channel grouping"}),o.jsx("p",{className:"text-xs text-zinc-500",children:"Sessions classified as Organic Social or Paid Social by GA4 will appear here. Google maintains the source-to-channel mapping, which includes Facebook, Instagram, X/Twitter, LinkedIn, Reddit, Pinterest, Snapchat, and other platforms."})]})]})]}),o.jsxs($e,{className:"surface-card p-5",children:[o.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Breakdown"}),o.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Source / medium"})]}),o.jsx("p",{className:"text-xs text-zinc-500",children:i.socialReferrals.length>0?Ve.length>Jf&&!q?`Top ${Jf} of ${Ve.length}`:`${Ve.length} rows`:"No source rows"})]}),i.socialReferrals.length>0?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-sm table-fixed",children:[o.jsxs("colgroup",{children:[o.jsx("col",{className:"w-[32%]"}),o.jsx("col",{className:"w-[22%]"}),o.jsx("col",{className:"w-[12%]"}),o.jsx("col",{className:"w-[11%]"}),o.jsx("col",{className:"w-[11%]"}),o.jsx("col",{className:"w-[12%]"})]}),o.jsx("thead",{children:o.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[o.jsx(vr,{label:"Source",sortKey:"source",current:T,dir:F,onSort:Ee,align:"left"}),o.jsx(vr,{label:"Medium",sortKey:"medium",current:T,dir:F,onSort:Ee,align:"left"}),o.jsx("th",{className:"py-1 font-medium text-left",children:"Channel"}),o.jsx(vr,{label:"Sessions",sortKey:"sessions",current:T,dir:F,onSort:Ee,align:"right"}),o.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),o.jsx(vr,{label:"Users",sortKey:"users",current:T,dir:F,onSort:Ee,align:"right"})]})}),o.jsx("tbody",{children:(q?Ve:Ve.slice(0,Jf)).map(de=>o.jsx(WOe,{referral:de,totalSessions:An},`${de.source}:${de.medium}:${de.channelGroup}`))})]})}),Ve.length>Jf&&o.jsx("div",{className:"mt-3 flex justify-center",children:o.jsx("button",{type:"button",onClick:()=>D(de=>!de),className:"text-xs text-zinc-400 hover:text-zinc-200 px-3 py-1 rounded-full border border-zinc-800 hover:border-zinc-700 transition-colors",children:q?`Show top ${Jf}`:`Show all ${Ve.length} sources`})})]}):o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[o.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No social media sessions detected yet"}),o.jsx("p",{className:"text-xs text-zinc-500 max-w-sm",children:"When visitors arrive from Facebook, X/Twitter, LinkedIn, or other social platforms, their sessions will be broken down here by source and medium."})]})]})]})]})]}),i&&i.topPages.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"page-section-divider"}),o.jsxs("section",{children:[o.jsxs("div",{className:"mb-4",children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Page Performance"}),o.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Top Landing Pages",o.jsx(hr,{text:"Landing pages ranked by session volume. Click column headers to sort. Organic % shows the share of sessions coming from Google organic search."})]})]}),o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[o.jsx(vr,{label:"Landing Page",sortKey:"landingPage",current:j,dir:E,onSort:ee,align:"left"}),o.jsx(vr,{label:"Sessions",sortKey:"sessions",current:j,dir:E,onSort:ee,align:"right"}),o.jsx(vr,{label:"Organic",sortKey:"organicSessions",current:j,dir:E,onSort:ee,align:"right"}),o.jsx("th",{className:"text-right py-1 font-medium",children:"Organic %"}),o.jsx(vr,{label:"Users",sortKey:"users",current:j,dir:E,onSort:ee,align:"right"})]})}),o.jsx("tbody",{children:He.map(de=>o.jsx(VOe,{page:de},de.landingPage))})]})})]})]}),o.jsxs("div",{className:"mt-6 flex items-center justify-between text-xs text-zinc-500",children:[o.jsx("span",{children:i?.lastSyncedAt?`Last synced ${HOe(i.lastSyncedAt)}`:"Never synced"}),o.jsx("span",{children:i?`${i.topPages.length} pages · ${i.aiReferrals.length} AI rows · ${i.socialReferrals.length} social rows`:""})]})]})}function GOe({projectName:e,onConnected:t}){const[n,r]=x.useState(""),[i,a]=x.useState(null),[l,u]=x.useState(null),[d,f]=x.useState(!1),[p,m]=x.useState(null),g=x.useRef(null),v=x.useCallback(b=>{const j=b.target.files?.[0];if(!j)return;m(null),a(j.name);const k=new FileReader;k.onload=()=>{const E=k.result;try{const C=JSON.parse(E);if(!C.client_email||!C.private_key){m("JSON file is missing required fields: client_email and private_key. Make sure you downloaded a service account key (not an OAuth client)."),u(null);return}u(E)}catch{m("File is not valid JSON. Please upload a service account key file (.json) downloaded from Google Cloud Console."),u(null)}},k.onerror=()=>{m("Failed to read file."),u(null)},k.readAsText(j)},[]);async function S(){if(m(null),!n.trim()){m("Property ID is required.");return}if(!l){m("Please upload a service account key file.");return}f(!0);try{await LV(e,{propertyId:n.trim(),keyJson:l});try{await C5(e)}catch{}t()}catch(b){m(b instanceof Error?b.message:"Failed to connect GA4")}finally{f(!1)}}return o.jsxs($e,{className:"surface-card p-6",children:[o.jsx("h3",{className:"text-base font-semibold text-zinc-50 mb-1",children:"Connect Google Analytics 4"}),o.jsx("p",{className:"text-sm text-zinc-400 mb-5",children:"Connect a GA4 property to see traffic data for this project. You'll need a service account key file from Google Cloud Console."}),p&&o.jsx("div",{className:"mb-4 px-4 py-2 rounded-lg bg-rose-900/20 border border-rose-800/60 text-sm text-rose-300",children:p}),o.jsxs("div",{className:"mb-4",children:[o.jsx("label",{htmlFor:"ga4-property-id",className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"GA4 Property ID"}),o.jsx("input",{id:"ga4-property-id",type:"text",placeholder:"e.g. 123456789",value:n,onChange:b=>r(b.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"}),o.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)."})]}),o.jsxs("div",{className:"mb-5",children:[o.jsx("label",{className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"Service Account Key File"}),o.jsx("input",{ref:g,type:"file",accept:".json,application/json",onChange:v,className:"hidden"}),o.jsxs("button",{type:"button",onClick:()=>g.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:[o.jsx(dY,{className:"w-4 h-4 shrink-0"}),i?o.jsx("span",{className:"text-zinc-200 truncate",children:i}):o.jsx("span",{children:"Upload .json key file"})]}),o.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 ",o.jsx("span",{className:"text-zinc-400",children:"Viewer"})," access on the GA4 property."]})]}),o.jsx(be,{variant:"default",size:"sm",disabled:d||!n.trim()||!l,onClick:S,children:d?"Connecting & syncing…":"Connect GA4"})]})}function vr({label:e,sortKey:t,current:n,dir:r,onSort:i,align:a}){const l=n===t;return o.jsxs("th",{className:`py-1 font-medium cursor-pointer select-none hover:text-zinc-300 transition-colors ${a==="right"?"text-right":"text-left"}`,onClick:()=>i(t),children:[e,l&&o.jsx("span",{className:"ml-0.5",children:r==="asc"?"↑":"↓"})]})}const TF={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-50"};function Aj({value:e,label:t,subtitle:n,tone:r}){return o.jsxs("div",{className:"rounded-lg bg-zinc-900/30 border border-zinc-800/60 px-5 py-4",children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:t}),o.jsx("p",{className:`text-2xl font-bold tabular-nums ${TF[r]}`,children:e}),o.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function _a({value:e,label:t,hint:n,tone:r,tooltip:i}){return o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-950/40 px-4 py-3 flex flex-col",children:[o.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1 flex items-center gap-1",children:[t,i&&o.jsx(hr,{text:i})]}),o.jsx("p",{className:`text-xl font-semibold tabular-nums ${TF[r]}`,children:e}),o.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function VOe({page:e}){const t=e.sessions>0?(e.organicSessions/e.sessions*100).toFixed(1):"0.0";return o.jsxs("tr",{className:"border-t border-zinc-800/40",children:[o.jsx("td",{className:"py-1.5 text-zinc-300 max-w-[400px] truncate",title:e.landingPage,children:e.landingPage}),o.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.sessions.toLocaleString()}),o.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.organicSessions.toLocaleString()}),o.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[t,"%"]}),o.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}const RF={session:"Session",first_user:"First Visit",manual_utm:"UTM"},DF={session:"Detected via GA4 sessionSource (referrer or utm_source for this session)",first_user:"Detected via GA4 firstUserSource (referrer from the user's first-ever visit)",manual_utm:"Detected via GA4 sessionManualSource (explicit utm_source parameter for the session)"};function QOe({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=RF[e.sourceDimension]??e.sourceDimension,i=DF[e.sourceDimension]??"";return o.jsxs("tr",{className:"border-t border-zinc-800/40",children:[o.jsx("td",{className:"py-1.5 text-zinc-200 max-w-[220px] truncate",title:e.source,children:e.source}),o.jsx("td",{className:"py-1.5 text-zinc-500 max-w-[180px] truncate",title:e.medium,children:e.medium}),o.jsx("td",{className:"py-1.5",children:o.jsx("span",{className:"inline-block text-[10px] px-1.5 py-0.5 rounded-full border border-zinc-700 text-zinc-400",title:i,children:r})}),o.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.sessions.toLocaleString()}),o.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[n,"%"]}),o.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function YOe({row:e}){const t=RF[e.sourceDimension]??e.sourceDimension,n=DF[e.sourceDimension]??"";return o.jsxs("tr",{className:"border-t border-zinc-800/40",children:[o.jsx("td",{className:"py-1.5 text-zinc-300 max-w-[360px] truncate",title:e.landingPage,children:e.landingPage}),o.jsx("td",{className:"py-1.5 text-zinc-200 max-w-[220px] truncate",title:e.source,children:e.source}),o.jsx("td",{className:"py-1.5",children:o.jsx("span",{className:"inline-block text-[10px] px-1.5 py-0.5 rounded-full border border-zinc-700 text-zinc-400",title:n,children:t})}),o.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.sessions.toLocaleString()}),o.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function WOe({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=e.channelGroup==="Paid Social"?"Paid":"Organic",i=Vu(e.source),a=Vu(e.medium);return o.jsxs("tr",{className:"border-t border-zinc-800/40",children:[o.jsx("td",{className:"py-1.5 pr-3 text-zinc-200 truncate",title:e.source,children:i}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-500 truncate",title:e.medium,children:a}),o.jsx("td",{className:"py-1.5 pr-3",children:o.jsx("span",{className:"inline-block text-[10px] px-1.5 py-0.5 rounded-full border border-zinc-700 text-zinc-400",title:`GA4 channel group: ${e.channelGroup}`,children:r})}),o.jsx("td",{className:"py-1.5 text-right text-sky-400 tabular-nums",children:e.sessions.toLocaleString()}),o.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[n,"%"]}),o.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function ZOe({sources:e,otherCount:t}){const n=[{key:Gu,color:PF,label:"Total",tooltip:"All social sessions across every source."}];for(let r=0;r<e.length;r++){const i=e[r];if(i===pd)n.push({key:pd,color:jN,label:`Other (${t})`,tooltip:`${t} smaller source${t===1?"":"s"} grouped together`});else{const a=Vu(i);n.push({key:i,color:Eo[r%Eo.length]??jN,label:zF(a,32),tooltip:a})}}return o.jsx("div",{className:"mt-3 flex flex-wrap gap-x-4 gap-y-1.5 text-[11px] text-zinc-400",children:n.map(r=>o.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 max-w-[260px]",title:r.tooltip,children:[o.jsx("span",{className:"inline-block w-2.5 h-2.5 rounded-sm shrink-0",style:{backgroundColor:r.color},"aria-hidden":"true"}),o.jsx("span",{className:"truncate",children:r.label})]},r.key))})}function MF(e){e.invalidateQueries({queryKey:qe.runs.all}),e.invalidateQueries({queryKey:qe.projects.all})}function XOe(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function JOe(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 Gx(e,t){I$({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:t.projectLabel,sourceAction:t.sourceAction,lastAnnouncedStatus:"queued"}),vt({title:XOe(e.kind),detail:JOe(t.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function eEe(e){const t=e.filter(i=>i.status!=="conflict"),n=e.filter(i=>i.status==="conflict");if(t.length===0){vt({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)I$({id:i.id,projectId:i.projectId,kind:i.kind,projectLabel:i.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=Ate({runIds:t.map(i=>i.id),queuedCount:t.length,skippedCount:n.length});vt({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 Vx(e,t){if(e instanceof Jr&&e.code==="RUN_IN_PROGRESS"){vt({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}vt({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function IF(){const e=vi();return Hh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>VG(t,n),onSuccess:(t,n)=>{MF(e),Gx(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})},onError:(t,n)=>{Vx(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})}})}function tEe(){const e=vi();return Hh({meta:{skipGlobalErrorToast:!0},mutationFn:t=>fV(t),onSuccess:t=>{MF(e),eEe(t)},onError:t=>{vt({title:t instanceof Error?t.message:"Failed to queue runs",tone:"negative"})}})}function nEe(){const e=vi();return Hh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>S5(t,n),onSuccess:(t,n)=>{Kv(e,zt["gsc-sync"],n.projectName),Gx(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})},onError:(t,n)=>{Vx(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})}})}function rEe(){const e=vi();return Hh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t})=>kV(t),onSuccess:(t,n)=>{Kv(e,t.run.kind,n.projectName),Gx(t.run,{projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})},onError:(t,n)=>{Vx(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})}})}function iEe(){const e=vi();return Hh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>jV(t,n),onSuccess:(t,n)=>{Kv(e,zt["inspect-sitemap"],n.projectName),Gx(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})},onError:(t,n)=>{Vx(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})}})}const aEe=["7d","30d","90d","all"];function sEe({projectName:e}){const t=vi(),[n,r]=x.useState(!1),[i,a]=x.useState([]),[l,u]=x.useState([]),[d,f]=x.useState([]),[p,m]=x.useState([]),[g,v]=x.useState([]),[S,b]=x.useState(null),[j,k]=x.useState(""),[E,C]=x.useState(""),[A,P]=x.useState("30"),[O,_]=x.useState(!1),[T,$]=x.useState("30d"),[F,U]=x.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[B,V]=x.useState(""),[X,Z]=x.useState(!0),[H,J]=x.useState(!1),[oe,ye]=x.useState(!1),[I,M]=x.useState(!1),[q,D]=x.useState(!1),[G,se]=x.useState(!1),[ne,Ce]=x.useState(!1),[je,ee]=x.useState(null),[pe,Ee]=x.useState(!1),[W,He]=x.useState(!1),[Te,st]=x.useState(null),[Ve,Ht]=x.useState(""),[Lt,un]=x.useState(!1),[tn,Se]=x.useState(!1),[Ze,Tt]=x.useState("indexed"),[mt,Je]=x.useState(null),ce=x.useMemo(()=>{if(!mt)return d;const{key:Q,dir:ke}=mt;return[...d].sort((tt,jt)=>{const En=Q===To.CTR?Number.isFinite(tt.ctr)?tt.ctr:0:tt[Q],wa=Q===To.CTR?Number.isFinite(jt.ctr)?jt.ctr:0:jt[Q];return ke==="asc"?En-wa:wa-En})},[d,mt]),[Ne,Me]=x.useState([]),[Ge,pt]=x.useState(null),[mn,An]=x.useState(!1),[gn,Ye]=x.useState(null),[Kt,de]=x.useState(null),ze=i.find(Q=>Q.connectionType==="gsc"),fe=d.length>0||p.length>0||g.length>0,Qe=nEe(),qn=rEe(),bi=iEe();async function nn(Q){if(!Q){u([]),k("");return}ye(!0);try{const{sites:ke}=await t.fetchQuery({queryKey:qe.gsc.properties(e),queryFn:()=>mV(e),staleTime:Sr});u(ke),k(Q.propertyId??ke[0]?.siteUrl??"")}catch(ke){u([]),Ye(ke instanceof Error?ke.message:"Failed to load Search Console properties")}finally{ye(!1)}}async function On(){D(!0);try{const Q={startDate:F.startDate,endDate:F.endDate,query:F.query,page:F.page,limit:F.limit,window:T},ke=await t.fetchQuery({queryKey:qe.gsc.performance(e,Q),queryFn:()=>vV(e,{startDate:F.startDate||void 0,endDate:F.endDate||void 0,query:F.query||void 0,page:F.page||void 0,limit:parseInt(F.limit,10)||20,window:T}),staleTime:Sr});f(ke)}catch(Q){f([]),Ye(Q instanceof Error?Q.message:"Failed to load GSC performance data")}finally{D(!1)}}async function Lr(){se(!0);try{const Q=B.trim()||void 0,[ke,tt]=await Promise.all([t.fetchQuery({queryKey:qe.gsc.inspections(e,Q),queryFn:()=>bV(e,{url:Q,limit:20}),staleTime:Sr}),t.fetchQuery({queryKey:qe.gsc.deindexed(e),queryFn:()=>wV(e),staleTime:Sr})]);m(ke),v(tt)}catch(Q){m([]),v([]),Ye(Q instanceof Error?Q.message:"Failed to load GSC inspection history")}finally{se(!1)}}async function Zi(){Ee(!0);try{const[Q,ke]=await Promise.all([t.fetchQuery({queryKey:qe.gsc.coverage(e),queryFn:()=>GN(e),staleTime:Sr}),t.fetchQuery({queryKey:qe.gsc.coverageHistory(e),queryFn:()=>SV(e).catch(()=>[]),staleTime:Sr})]);ee(Q),Me(ke)}catch(Q){ee(null),Me([]),Ye(Q instanceof Error?Q.message:"Failed to load coverage data")}finally{Ee(!1)}}async function ba(Q){An(!0),Ye(null);try{const ke=await b2(e,{urls:Q}),{succeeded:tt,failed:jt,total:En}=ke.summary;vt({title:"Indexing requested",detail:jt===0?`${tt} URL${tt!==1?"s":""} submitted for indexing.`:`${tt}/${En} submitted successfully, ${jt} failed.`,tone:jt===0?"positive":"caution",dedupeKey:`gsc:indexing:${e}`,dedupeMode:"replace"})}catch(ke){Ye(ke instanceof Error?ke.message:"Failed to request indexing")}finally{An(!1)}}async function jp(){An(!0),Ye(null);try{const Q=await b2(e,{urls:[],allUnindexed:!0}),{succeeded:ke,failed:tt,total:jt}=Q.summary;vt({title:"Indexing requested",detail:tt===0?`${ke} unindexed URL${ke!==1?"s":""} submitted for indexing.`:`${ke}/${jt} submitted successfully, ${tt} failed.`,tone:tt===0?"positive":"caution",dedupeKey:`gsc:indexing-all:${e}`,dedupeMode:"replace"})}catch(Q){Ye(Q instanceof Error?Q.message:"Failed to request indexing")}finally{An(!1)}}async function Ks(){if(Ve.trim()){un(!0),Ye(null);try{await yV(e,"gsc",Ve.trim()),await t.invalidateQueries({queryKey:qe.gsc.project(e)}),a(Q=>Q.map(ke=>ke.connectionType==="gsc"?{...ke,sitemapUrl:Ve.trim()}:ke)),vt({title:"Sitemap URL saved",detail:`${e} will use the updated sitemap URL.`,tone:"positive",dedupeKey:`gsc:sitemap:${e}`,dedupeMode:"drop"}),Ht("")}catch(Q){Ye(Q instanceof Error?Q.message:"Failed to save sitemap URL")}finally{un(!1)}}}async function Gs(){Ye(null);try{const Q=await qn.mutateAsync({projectName:e,projectLabel:e});st(Q.sitemaps),a(ke=>ke.map(tt=>tt.connectionType==="gsc"?{...tt,sitemapUrl:Q.primarySitemapUrl}:tt))}catch{}}async function Qx(){He(!0),Ye(null);try{const Q=await NV(e);t.setQueryData(qe.gsc.sitemaps(e),Q),st(Q.sitemaps),Q.sitemaps.length===0&&de("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch(Q){Ye(Q instanceof Error?Q.message:"Failed to list sitemaps")}finally{He(!1)}}async function Md(){Z(!0),Ye(null);try{const[Q,ke]=await Promise.all([KN().catch(()=>null),t.fetchQuery({queryKey:qe.gsc.connections(e),queryFn:()=>w5(e).catch(()=>[]),staleTime:Sr})]);r(!!Q?.google?.configured),a(ke);const tt=ke.find(jt=>jt.connectionType==="gsc");await Promise.all([nn(tt),On(),Lr(),Zi()])}finally{Z(!1)}}x.useEffect(()=>{Md()},[e]),x.useEffect(()=>{On()},[T]);async function Np(){if(!n){Ye("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}J(!0),Ye(null),de(null);try{const{authUrl:Q}=await hV(e,"gsc");if(!Q.startsWith("https://accounts.google.com/")){Ye("Unexpected OAuth redirect URL. Please try again.");return}const ke=window.open(Q,"_blank","width=600,height=700");if(!ke){window.location.assign(Q);return}de("Finish the Google consent flow in the popup, then close it to refresh this project.");const tt=window.setInterval(()=>{ke.closed&&(window.clearInterval(tt),de(null),t.invalidateQueries({queryKey:qe.gsc.project(e)}),Md())},1e3)}catch(Q){Ye(Q instanceof Error?Q.message:"Failed to start OAuth flow")}finally{J(!1)}}async function kp(){Ye(null),de(null);try{await pV(e,"gsc"),await t.invalidateQueries({queryKey:qe.gsc.project(e)}),a(Q=>Q.filter(ke=>ke.connectionType!=="gsc")),u([]),k("")}catch(Q){Ye(Q instanceof Error?Q.message:"Failed to disconnect")}}async function Id(){if(j){M(!0),Ye(null);try{await gV(e,"gsc",j),await t.invalidateQueries({queryKey:qe.gsc.project(e)}),a(Q=>Q.map(ke=>ke.connectionType==="gsc"?{...ke,propertyId:j}:ke)),vt({title:"GSC property updated",detail:`${e} is now linked to ${j}.`,tone:"positive",dedupeKey:`gsc:property:${e}`,dedupeMode:"drop"})}catch(Q){Ye(Q instanceof Error?Q.message:"Failed to save GSC property")}finally{M(!1)}}}async function Ld(){Ye(null),de(null);try{await Qe.mutateAsync({projectName:e,projectLabel:e,opts:{days:parseInt(A,10)||void 0,full:O||void 0}}),await t.invalidateQueries({queryKey:qe.gsc.project(e)})}catch{}}async function $d(){if(E.trim()){Ce(!0),Ye(null),de(null);try{const Q=await xV(e,E.trim());await t.invalidateQueries({queryKey:qe.gsc.project(e)}),b(Q),C(""),await Lr()}catch(Q){Ye(Q instanceof Error?Q.message:"Failed to inspect URL")}finally{Ce(!1)}}}return o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search Console"}),o.jsx("h2",{children:"Google Search Console"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"flex gap-1",children:aEe.map(Q=>o.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${T===Q?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>$(Q),children:Q==="all"?"All":Q},Q))}),ze&&o.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:q,onClick:()=>{On()},children:q?"Refreshing…":"Refresh data"})]})]}),gn&&o.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:[gn,o.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>Ye(null),children:"×"})]}),Kt&&o.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:[Kt,o.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>de(null),children:"×"})]}),X?o.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):o.jsxs("div",{className:"space-y-3",children:[o.jsxs($e,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),o.jsx("h3",{children:"Domain authorization"})]}),o.jsx(Xe,{tone:ze?"positive":n?"caution":"negative",children:ze?"Connected":n?"Ready to connect":"App credentials missing"})]}),ze?o.jsxs("div",{className:"mt-3 space-y-3",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),o.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),o.jsx("span",{className:"text-xs text-zinc-500",children:ze.domain}),o.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:kp,children:"Disconnect"})]}),o.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores OAuth tokens per canonical domain. This project currently maps to ",o.jsx("code",{children:ze.domain}),"."]})]}),o.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected property"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:ze.propertyId??"No property selected yet"})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:aa(ze.updatedAt)})]})]})]}):o.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-5",children:[o.jsx("p",{className:"text-sm text-zinc-300",children:n?"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."}),o.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[n?o.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:H,onClick:Np,children:H?"Opening…":"Connect Google Search Console"}):o.jsx(be,{type:"button",variant:"outline",size:"sm",asChild:!0,children:o.jsx(Zt,{to:"/settings",children:"Open Settings"})}),!n&&o.jsx("p",{className:"text-xs text-zinc-500",children:"The same Google OAuth app credentials are shared across all projects."})]})]})]}),ze&&!ze.sitemapUrl&&o.jsx("div",{className:"rounded-lg border border-amber-800/40 bg-amber-950/20 px-4 py-3",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("span",{className:"mt-0.5 text-amber-400",children:o.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:o.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"})})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Set your sitemap URL"}),o.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."}),o.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[o.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[o.jsx(be,{type:"button",size:"sm",disabled:qn.isPending||!ze.propertyId,onClick:Gs,children:qn.isPending?"Discovering…":"Auto-discover from GSC"}),o.jsx("span",{className:"self-center text-xs text-amber-400/60",children:"or enter manually:"})]}),o.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[o.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:Ve,onChange:Q=>Ht(Q.target.value),onKeyDown:Q=>Q.key==="Enter"&&void Ks()}),o.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:Lt||!Ve.trim(),onClick:Ks,children:Lt?"Saving…":"Save sitemap URL"})]})]})]})]})}),(ze||fe)&&o.jsxs(o.Fragment,{children:[o.jsxs($e,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),o.jsx("h3",{children:"Index coverage"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[je&&je.notIndexed.length>0&&o.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:mn,onClick:()=>{jp()},children:mn?"Requesting…":`Request indexing (${je.notIndexed.length})`}),o.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:pe,onClick:()=>{Zi()},children:pe?"Loading…":"Refresh coverage"})]})]}),je&&je.summary.total>0?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const Q=je.summary.indexed+je.summary.notIndexed,ke=Q>0?je.summary.indexed/Q:0,tt=Q>0?je.summary.notIndexed/Q:0,jt=54,En=2*Math.PI*jt,wa=En*(1-ke),Ja=En*tt,Vs=En*ke;return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"relative h-48 w-48",children:[o.jsxs("svg",{viewBox:"0 0 128 128",className:"h-full w-full","aria-hidden":"true",children:[o.jsx("circle",{cx:"64",cy:"64",r:jt,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),o.jsx("circle",{cx:"64",cy:"64",r:jt,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:En,strokeDashoffset:wa,strokeLinecap:"round",transform:"rotate(-90 64 64)",style:{transition:"stroke-dashoffset 0.6s ease"}}),je.summary.notIndexed>0&&o.jsx("circle",{cx:"64",cy:"64",r:jt,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${Ja} ${En-Ja}`,strokeDashoffset:-Vs,transform:"rotate(-90 64 64)",style:{transition:"stroke-dasharray 0.6s ease, stroke-dashoffset 0.6s ease"}})]}),o.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[o.jsxs("span",{className:"text-3xl font-bold tabular-nums text-zinc-50",children:[(ke*100).toFixed(0),"%"]}),o.jsx("span",{className:"text-xs uppercase tracking-widest text-zinc-500 mt-0.5",children:"Indexed"})]})]}),o.jsxs("div",{className:"mt-4 flex items-center justify-center gap-8",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-emerald-500"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:je.summary.indexed.toLocaleString()}),o.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Indexed"})]})]}),o.jsx("div",{className:"h-8 w-px bg-zinc-800"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-zinc-500"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:je.summary.notIndexed.toLocaleString()}),o.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(je.reasonGroups??[]).length>0&&o.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(je.reasonGroups??[]).length," ",(je.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),je.summary.deindexed>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-8 w-px bg-zinc-800"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-rose-500"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:je.summary.deindexed.toLocaleString()}),o.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Deindexed"})]})]})]})]})]})})()}),o.jsx("div",{className:"mt-3 flex gap-1",children:["indexed","notIndexed","deindexed"].map(Q=>{const ke=Q==="indexed"?je.indexed.length:Q==="notIndexed"?je.notIndexed.length:je.deindexed.length,tt=Q==="indexed"?"Indexed":Q==="notIndexed"?"Not Indexed":"Deindexed";return o.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${Ze===Q?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{Tt(Q),pt(null)},children:[tt," (",ke,")"]},Q)})}),o.jsxs("div",{className:"mt-3 overflow-x-auto",children:[Ze==="indexed"&&je.indexed.length>0&&o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Verdict"}),o.jsx("th",{className:"text-left",children:"Last Crawl"}),o.jsx("th",{className:"text-left",children:"Mobile"})]})}),o.jsx("tbody",{children:je.indexed.map(Q=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),o.jsx("td",{className:"text-zinc-400",children:Q.verdict??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:Q.crawlTime?Q.crawlTime.split("T")[0]:"—"}),o.jsx("td",{className:"text-zinc-400",children:Q.isMobileFriendly===!0?"Yes":Q.isMobileFriendly===!1?"No":"—"})]},Q.id))})]}),Ze==="notIndexed"&&!Ge&&(je.reasonGroups??[]).length>0&&o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"Reason"}),o.jsx("th",{className:"text-right",children:"Pages"})]})}),o.jsx("tbody",{children:(je.reasonGroups??[]).map(Q=>o.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>pt(Q.reason),children:[o.jsx("td",{className:"text-zinc-200",children:Q.reason}),o.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Q.count})]},Q.reason))})]}),Ze==="notIndexed"&&!Ge&&(je.reasonGroups??[]).length===0&&je.notIndexed.length>0&&o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Indexing State"}),o.jsx("th",{className:"text-left",children:"Coverage"})]})}),o.jsx("tbody",{children:je.notIndexed.map(Q=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),o.jsx("td",{className:"text-zinc-400",children:Q.indexingState??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:Q.coverageState??"Unknown"})]},Q.id))})]}),Ze==="notIndexed"&&Ge&&(()=>{const Q=(je.reasonGroups??[]).find(ke=>ke.reason===Ge);return Q?o.jsxs("div",{children:[o.jsx("div",{className:"flex items-center gap-2 mb-3",children:o.jsxs("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>pt(null),children:["←"," Back to reasons"]})}),o.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-zinc-200",children:Q.reason}),o.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[Q.count," affected page",Q.count!==1?"s":""]})]}),o.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:mn,onClick:()=>{ba(Q.urls.map(ke=>ke.url))},children:mn?"Requesting…":`Request indexing (${Q.count})`})]}),o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Last Crawl"}),o.jsx("th",{className:"w-8"})]})}),o.jsx("tbody",{children:Q.urls.map(ke=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:ke.url}),o.jsx("td",{className:"text-zinc-400",children:ke.crawlTime?ke.crawlTime.split("T")[0]:"—"}),o.jsx("td",{children:o.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-200 transition-colors",disabled:mn,onClick:()=>{ba([ke.url])},title:"Request indexing",children:"Index"})})]},ke.id))})]})]}):null})(),Ze==="deindexed"&&je.deindexed.length>0&&o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Previous"}),o.jsx("th",{className:"text-left",children:"Current"}),o.jsx("th",{className:"text-left",children:"Detected"})]})}),o.jsx("tbody",{children:je.deindexed.map((Q,ke)=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),o.jsx("td",{className:"text-zinc-400",children:Q.previousState}),o.jsx("td",{className:"text-zinc-400",children:Q.currentState}),o.jsx("td",{className:"text-zinc-400",children:Q.transitionDate.split("T")[0]})]},`${Q.url}-${ke}`))})]}),(Ze==="indexed"&&je.indexed.length===0||Ze==="notIndexed"&&!Ge&&je.notIndexed.length===0||Ze==="deindexed"&&je.deindexed.length===0)&&o.jsx("p",{className:"text-sm text-zinc-500",children:"No URLs in this category."})]})]}):o.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:pe?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),o.jsxs($e,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Performance"}),o.jsx("h3",{children:"Search performance"})]}),o.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:q,onClick:()=>{On()},children:q?"Loading…":"Apply filters"})]}),d.length>0&&(()=>{const Q=new Map;for(const dt of d){const Gt=Q.get(dt.date);Gt?(Gt.clicks+=dt.clicks,Gt.impressions+=dt.impressions):Q.set(dt.date,{clicks:dt.clicks,impressions:dt.impressions})}const ke=[...Q.entries()].sort(([dt],[Gt])=>dt.localeCompare(Gt));if(ke.length===0)return null;const tt=Math.max(...ke.map(([,dt])=>dt.impressions),1),jt=ke.reduce((dt,[,Gt])=>dt+Gt.clicks,0),En=ke.reduce((dt,[,Gt])=>dt+Gt.impressions,0),wa=En>0?(jt/En*100).toFixed(1):"0.0",Ja=700,Vs=220,Or={top:12,bottom:36,left:48,right:12},rl=Ja-Or.left-Or.right,Sa=Vs-Or.top-Or.bottom,wi=rl/ke.length,Xi=Math.max(Math.min(wi*.35,24),4),Qs=Math.max(Xi*.15,1),Ys=dt=>{if(dt<=0)return 1;const Gt=Math.pow(10,Math.floor(Math.log10(dt))),$r=dt/Gt,Ji=$r<=1.5?1.5:$r<=3?3:$r<=5?5:10;return Math.ceil(Ji*Gt)},yn=4,il=Math.ceil(Ys(tt)/yn)*yn,Cp=Array.from({length:yn+1},(dt,Gt)=>il/yn*Gt),es=dt=>dt>=1e3?`${(dt/1e3).toFixed(dt>=1e4?0:1)}k`:String(dt);return o.jsxs("div",{className:"mt-3",children:[o.jsxs("div",{className:"flex items-center gap-5 mb-2",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-emerald-500"}),o.jsxs("span",{className:"text-xs text-zinc-400",children:["Clicks ",o.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:jt.toLocaleString()})]})]}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-blue-500"}),o.jsxs("span",{className:"text-xs text-zinc-400",children:["Impressions ",o.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:En.toLocaleString()})]})]}),o.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",o.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[wa,"%"]})]})]}),o.jsx("div",{className:"relative w-full",style:{aspectRatio:`${Ja} / ${Vs}`},children:o.jsxs("svg",{viewBox:`0 0 ${Ja} ${Vs}`,className:"h-full w-full",children:[Cp.map((dt,Gt)=>{const $r=Or.top+Sa-dt/il*Sa;return o.jsxs("g",{children:[o.jsx("line",{x1:Or.left,y1:$r,x2:Ja-Or.right,y2:$r,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),o.jsx("text",{x:Or.left-6,y:$r+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:es(dt)})]},`t-${Gt}`)}),ke.map(([dt,Gt],$r)=>{const Ji=Or.left+wi*$r+wi/2,Oc=Gt.impressions/il*Sa,al=Gt.clicks/il*Sa;return o.jsxs("g",{children:[o.jsx("title",{children:`${dt}
|
|
290
|
-
Clicks: ${Gt.clicks}
|
|
291
|
-
Impressions: ${Gt.impressions}
|
|
292
|
-
CTR: ${Gt.impressions>0?(Gt.clicks/Gt.impressions*100).toFixed(1):0}%`}),o.jsx("rect",{x:Ji-Xi-Qs/2,y:Or.top+Sa-Oc,width:Xi,height:Math.max(Oc,1),rx:2,fill:"#3b82f6",opacity:.85}),o.jsx("rect",{x:Ji+Qs/2,y:Or.top+Sa-al,width:Xi,height:Math.max(al,1),rx:2,fill:"#10b981",opacity:.85})]},dt)}),(()=>{const dt=Math.min(ke.length,7);return Array.from({length:dt},(Gt,$r)=>{const Ji=ke.length===1?0:Math.round($r/(dt-1)*(ke.length-1)),Oc=Or.left+wi*Ji+wi/2;return o.jsx("text",{x:Oc,y:Vs-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:ke[Ji][0].slice(5)},`xl-${Ji}`)})})()]})})]})})(),o.jsxs("div",{className:"mt-3 grid gap-2 lg:grid-cols-5",children:[o.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:F.startDate,onChange:Q=>U(ke=>({...ke,startDate:Q.target.value}))}),o.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:F.endDate,onChange:Q=>U(ke=>({...ke,endDate:Q.target.value}))}),o.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:F.query,onChange:Q=>U(ke=>({...ke,query:Q.target.value}))}),o.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:F.page,onChange:Q=>U(ke=>({...ke,page:Q.target.value}))}),o.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:F.limit,onChange:Q=>U(ke=>({...ke,limit:Q.target.value}))})]}),d.length>0?o.jsx("div",{className:"mt-3 overflow-x-auto",children:o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"Date"}),o.jsx("th",{className:"text-left",children:"Query"}),o.jsx("th",{className:"text-left",children:"Page"}),Object.values(To).map(Q=>o.jsx("th",{className:"text-right","aria-sort":mt?.key===Q?mt.dir==="asc"?"ascending":"descending":"none",children:o.jsxs("button",{type:"button",className:"w-full cursor-pointer select-none text-right hover:text-zinc-200 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-zinc-400 rounded px-1 -mx-1",onClick:()=>Je(ke=>ke?.key===Q?ke.dir==="desc"?{key:Q,dir:"asc"}:null:{key:Q,dir:"desc"}),children:[dte[Q],mt?.key===Q?mt.dir==="desc"?" ↓":" ↑":""]})},Q))]})}),o.jsx("tbody",{children:ce.map((Q,ke)=>o.jsxs("tr",{children:[o.jsx("td",{className:"text-zinc-400",children:Q.date}),o.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:Q.query}),o.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:Q.page}),o.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:Q.clicks.toLocaleString()}),o.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Q.impressions.toLocaleString()}),o.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(Number.isFinite(Q.ctr)?Q.ctr*100:0).toFixed(1),"%"]}),o.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Q.position.toFixed(1)})]},`${Q.date}:${Q.query}:${Q.page}:${ke}`))})]})}):o.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),o.jsxs($e,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Inspection"}),o.jsx("h3",{children:"Inspect a URL"})]})}),o.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[o.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:E,onChange:Q=>C(Q.target.value),onKeyDown:Q=>Q.key==="Enter"&&void $d()}),o.jsx(be,{type:"button",size:"sm",disabled:ne||!ze?.propertyId||!E.trim(),onClick:$d,children:ne?"Inspecting…":"Inspect URL"})]}),S&&o.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Indexing state"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:S.indexingState??"Unknown"})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Verdict"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:S.verdict??"Unknown"})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Mobile friendly"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:J2(S.isMobileFriendly)})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last crawl"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:aa(S.crawlTime)})]})]})]}),o.jsxs($e,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),o.jsx("h3",{children:"Inspection log"})]}),o.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:G,onClick:()=>{Lr()},children:G?"Loading…":"Refresh history"})]}),o.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[o.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:B,onChange:Q=>V(Q.target.value)}),o.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:G,onClick:()=>{Lr()},children:"Apply filter"})]}),p.length>0?o.jsx("div",{className:"mt-3 overflow-x-auto",children:o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Indexing"}),o.jsx("th",{className:"text-left",children:"Verdict"}),o.jsx("th",{className:"text-left",children:"Coverage"}),o.jsx("th",{className:"text-left",children:"Mobile"}),o.jsx("th",{className:"text-left",children:"Inspected"})]})}),o.jsx("tbody",{children:p.map(Q=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),o.jsx("td",{className:"text-zinc-300",children:Q.indexingState??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:Q.verdict??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:Q.coverageState??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:J2(Q.isMobileFriendly)}),o.jsx("td",{className:"text-zinc-400",children:aa(Q.inspectedAt)})]},Q.id))})]})}):o.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),o.jsxs($e,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Deindexed"}),o.jsx("h3",{children:"Recent indexing losses"})]})}),g.length>0?o.jsx("div",{className:"mt-3 overflow-x-auto",children:o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Previous"}),o.jsx("th",{className:"text-left",children:"Current"}),o.jsx("th",{className:"text-left",children:"Changed at"})]})}),o.jsx("tbody",{children:g.map(Q=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),o.jsx("td",{className:"text-zinc-400",children:Q.previousState??"Unknown"}),o.jsx("td",{className:"text-zinc-300",children:Q.currentState??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:aa(Q.transitionDate)})]},`${Q.url}:${Q.transitionDate}`))})]})}):o.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),ze&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"border-t border-zinc-800/60 pt-3",children:o.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 text-left",onClick:()=>Se(Q=>!Q),children:[o.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 ${tn?"rotate-90":""}`,"aria-hidden":"true",children:o.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"})}),o.jsx("span",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Setup & Configuration"})]})}),tn&&o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[o.jsxs($e,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Property"}),o.jsx("h3",{children:"Pick the Search Console property"})]})}),o.jsxs("div",{className:"mt-3 space-y-2",children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-property-${e}`,children:"Property URL"}),o.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:j,disabled:oe||l.length===0,onChange:Q=>k(Q.target.value),children:l.length===0?o.jsx("option",{value:"",children:oe?"Loading properties…":"No properties available"}):l.map(Q=>o.jsxs("option",{value:Q.siteUrl,children:[Q.siteUrl," · ",Q.permissionLevel]},Q.siteUrl))}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:oe,onClick:()=>{nn(ze)},children:oe?"Refreshing…":"Refresh properties"}),o.jsx(be,{type:"button",size:"sm",disabled:!j||I,onClick:Id,children:I?"Saving…":"Save property"})]}),o.jsx("p",{className:"text-xs text-zinc-500",children:"The selected property is used for future syncs and URL inspections for this project."})]})]}),o.jsxs($e,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sync"}),o.jsx("h3",{children:"Import GSC performance data"})]})}),o.jsxs("div",{className:"mt-3 space-y-3",children:[o.jsxs("div",{className:"grid gap-3 sm:grid-cols-[160px_1fr]",children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-sync-days-${e}`,children:"Days"}),o.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:A,onChange:Q=>P(Q.target.value)})]}),o.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:[o.jsx("input",{type:"checkbox",checked:O,onChange:Q=>_(Q.target.checked)}),"Replace existing imported rows for the requested range"]})]}),o.jsx(be,{type:"button",size:"sm",disabled:Qe.isPending||!ze.propertyId,onClick:Ld,children:Qe.isPending?"Queueing…":"Queue sync"}),!ze.propertyId&&o.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),o.jsxs($e,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sitemap"}),o.jsx("h3",{children:"Sitemap configuration"})]})}),o.jsxs("div",{className:"mt-3 space-y-3",children:[ze.sitemapUrl&&o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Current sitemap URL"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200 break-all",children:ze.sitemapUrl})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:W||!ze.propertyId,onClick:()=>{Qx()},children:W?"Loading…":"Browse sitemaps from GSC"}),o.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:qn.isPending||!ze.propertyId,onClick:Gs,children:qn.isPending?"Discovering…":"Auto-discover and queue inspection"})]}),o.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."}),Te&&Te.length>0&&o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3 space-y-2",children:[o.jsxs("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:["Sitemaps (",Te.length,")"]}),Te.map(Q=>{const ke=Q.contents?.[0];return o.jsxs("div",{className:"flex items-start justify-between gap-2 text-xs",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-zinc-200 break-all",children:Q.path}),Q.lastSubmitted&&o.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",Q.lastSubmitted.split("T")[0]]})]}),o.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[ke&&o.jsxs("div",{className:"text-right",children:[o.jsxs("p",{className:"text-zinc-300",children:[ke.indexed," / ",ke.submitted]}),o.jsx("p",{className:"text-zinc-500",children:"indexed"})]}),o.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>Ht(Q.path),children:"Use"})]})]},Q.path)})]}),o.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[o.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:ze.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:Ve,onChange:Q=>Ht(Q.target.value),onKeyDown:Q=>Q.key==="Enter"&&Ve.trim()&&void Ks()}),o.jsx(be,{type:"button",size:"sm",disabled:Lt||!Ve.trim(),onClick:Ks,children:Lt?"Saving…":ze.sitemapUrl?"Update":"Save"})]}),o.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[o.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}`}),o.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:bi.isPending||!ze.propertyId,onClick:async()=>{const ke=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||ze.sitemapUrl||void 0;Ye(null),de(null);try{await bi.mutateAsync({projectName:e,projectLabel:e,opts:{sitemapUrl:ke}})}catch{}},children:bi.isPending?"Queueing…":"Inspect sitemap"})]}),!ze.propertyId&&o.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function Oj({children:e,label:t="More info",placement:n="top",className:r}){const i=x.useId(),[a,l]=x.useState(!1);return o.jsxs("span",{className:`relative inline-flex ${r??""}`,children:[o.jsx("button",{type:"button","aria-label":t,"aria-describedby":a?i:void 0,className:"inline-flex h-4 w-4 items-center justify-center rounded-full text-zinc-500 hover:text-zinc-200 focus:text-zinc-200 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-500",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onFocus:()=>l(!0),onBlur:()=>l(!1),children:o.jsx(T5,{className:"h-3.5 w-3.5","aria-hidden":!0})}),a&&o.jsx("span",{id:i,role:"tooltip",className:`absolute z-50 w-64 rounded border border-zinc-700 bg-zinc-900 px-3 py-2 text-xs font-normal leading-relaxed text-zinc-200 shadow-lg ${n==="top"?"bottom-full mb-2":"top-full mt-2"} left-1/2 -translate-x-1/2 whitespace-normal`,children:e})]})}const El=50;function ju(e){return typeof window>"u"?e:`${window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??""}${e}`}function Og(e){return e.toLocaleString()}function oEe(e){const t=Number(e);return Number.isFinite(t)?`${(t*100).toFixed(1)}%`:"—"}function lEe(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 cEe(e){const t=e.filter(n=>n.kind===zt["backlink-extract"]&&!ok(n.status));return t.length===0?null:t.reduce((n,r)=>n.createdAt>r.createdAt?n:r)}function uEe(e,t){const n=new Date(e??t).getTime(),r=Math.max(0,Math.floor((Date.now()-n)/1e3));if(r<60)return`${r}s`;const i=Math.floor(r/60),a=r%60;return a===0?`${i}m`:`${i}m ${a}s`}function dEe({projectName:e}){const[t,n]=x.useState(null),[r,i]=x.useState(null),[a,l]=x.useState([]),[u,d]=x.useState(null),[f,p]=x.useState(null),[m,g]=x.useState(null),[v,S]=x.useState(Date.now()),[b,j]=x.useState(0),[k,E]=x.useState(!0),[C,A]=x.useState(!1),[P,O]=x.useState(null),_=x.useRef(null),T=x.useCallback(async()=>{E(!0),O(null);try{const[oe,ye,I,M,q]=await Promise.all([A5().catch(()=>null),JV(e,{excludeCrawlers:!0}).catch(()=>null),eQ(e,{limit:El,offset:b,excludeCrawlers:!0}).catch(G=>{if(G instanceof Jr&&G.code==="NOT_FOUND")return null;throw G}),tQ(e).catch(()=>[]),UG(e).catch(()=>[])]);d(oe),n(ye),i(I),l(M);const D=cEe(q);p(D),_.current=D?.id??null}catch(oe){O(oe instanceof Error?oe.message:"Failed to load backlinks")}finally{E(!1)}},[e,b]);x.useEffect(()=>{T()},[T]),x.useEffect(()=>{if(!f)return;const oe=f.id;let ye=!1;const I=async()=>{try{const q=await ec(oe);if(ye)return;ok(q.status)?(p(null),g(q),await T()):p(D=>D?.id===q.id?{...D,...q}:D)}catch{}},M=window.setInterval(()=>{I()},3e3);return()=>{ye=!0,window.clearInterval(M)}},[f,T]),x.useEffect(()=>{if(!f)return;const oe=window.setInterval(()=>S(Date.now()),1e3);return()=>window.clearInterval(oe)},[f]),x.useEffect(()=>{if(!m||m.status==="failed")return;const oe=window.setTimeout(()=>g(null),1e4);return()=>window.clearTimeout(oe)},[m]);async function $(){A(!0),O(null);try{const oe=await nQ(e);p(oe),_.current=oe.id}catch(oe){oe instanceof Jr&&oe.code==="MISSING_DEPENDENCY"?O("DuckDB is not installed. Visit the Backlinks admin page to install it."):O(oe instanceof Error?oe.message:"Failed to trigger extract")}finally{A(!1)}}const F=x.useMemo(()=>a.slice().sort((oe,ye)=>oe.queriedAt.localeCompare(ye.queriedAt)).map(oe=>({date:oe.queriedAt,linkingDomains:oe.totalLinkingDomains})),[a]),U=r?.rows??[],B=r?.total??0,V=t?.excludedLinkingDomains??0,X=B>El,Z=Math.floor(b/El)+1,H=Math.max(1,Math.ceil(B/El));return x.useEffect(()=>{b>0&&b>=B&&j(0)},[b,B]),o.jsxs("section",{className:"page-section-divider",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Backlinks"}),o.jsx("h2",{children:"Referring domains"}),o.jsxs("p",{className:"text-sm text-zinc-500 mt-1 max-w-2xl",children:["Domains linking to "," ",o.jsx("span",{className:"text-zinc-300",children:e}),", extracted from the Common Crawl hyperlink graph. Updates when a release sync completes — no live scraping, no paid API."]})]})}),P&&o.jsx($e,{className:"surface-card p-4 mb-4 border-rose-800/60",children:o.jsx("p",{className:"text-sm text-rose-300",children:P})}),f&&o.jsx($e,{className:"surface-card p-4 mb-4 border-sky-800/60",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(D5,{className:"h-5 w-5 text-sky-400 animate-spin shrink-0 mt-0.5","aria-hidden":!0}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[o.jsx("p",{className:"text-sm font-medium text-zinc-100",children:"Extract running"}),o.jsx(Xe,{tone:"neutral",children:f.status}),o.jsxs("span",{className:"text-xs text-zinc-500 tabular-nums",children:[uEe(f.startedAt,f.createdAt)," elapsed · refreshing every 3s"]}),o.jsxs("span",{className:"sr-only",children:["now=",v]})]}),o.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Re-querying the cached Common Crawl release for"," ",o.jsx("span",{className:"text-zinc-300",children:e}),". No re-download — the ~16 GB dump already lives at"," ",o.jsx("code",{className:"text-zinc-400",children:"~/.canonry/cache/commoncrawl/"}),". Typically takes ~5 minutes."]})]})]})}),m&&!f&&o.jsx($e,{className:`surface-card p-4 mb-4 ${m.status==="failed"?"border-rose-800/60":"border-emerald-800/60"}`,children:o.jsxs("div",{className:"flex items-start gap-3",children:[m.status==="failed"?o.jsx("span",{className:"h-5 w-5 shrink-0 mt-0.5 text-rose-400 text-lg leading-none","aria-hidden":!0,children:"!"}):o.jsx(P5,{className:"h-5 w-5 text-emerald-400 shrink-0 mt-0.5","aria-hidden":!0}),o.jsxs("div",{className:"flex-1",children:[o.jsx("p",{className:`text-sm font-medium ${m.status==="failed"?"text-rose-300":"text-emerald-300"}`,children:m.status==="failed"?"Extract failed":"Extract complete"}),m.error?o.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:fte(m.error)}):m.status!=="failed"?o.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:"Backlinks refreshed from the cached release."}):null]})]})}),J()]});function J(){if(k)return o.jsx($e,{className:"surface-card p-6",children:o.jsx("p",{className:"text-sm text-zinc-500",children:"Loading backlinks…"})});const oe=t!==null&&t.totalLinkingDomains>0,ye=m?.status==="failed",I=t!==null&&t.totalLinkingDomains===0&&!ye,M=u?.status==="ready",q=u?.status==="failed",D=u&&(u.status==="downloading"||u.status==="querying"||u.status==="queued");return oe?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"gauge-row",children:[o.jsxs("div",{className:"metric-card",children:[o.jsx("p",{className:"metric-card-eyebrow",children:"Referring domains"}),o.jsx("p",{className:"metric-card-big-value",children:o.jsx("span",{className:"text-zinc-50",children:Og(t.totalLinkingDomains)})}),o.jsxs("p",{className:"metric-card-sub",children:["unique domains linking to ",t.targetDomain]})]}),o.jsxs("div",{className:"metric-card",children:[o.jsx("p",{className:"metric-card-eyebrow",children:"Total linking hosts"}),o.jsx("p",{className:"metric-card-big-value",children:o.jsx("span",{className:"text-zinc-50",children:Og(t.totalHosts)})}),o.jsx("p",{className:"metric-card-sub",children:"aggregate host count across referring domains"})]}),o.jsxs("div",{className:"metric-card",children:[o.jsx("p",{className:"metric-card-eyebrow",children:"Top-10 concentration"}),o.jsx("p",{className:"metric-card-big-value",children:o.jsx("span",{className:"text-zinc-50",children:oEe(t.top10HostsShare)})}),o.jsx("p",{className:"metric-card-sub",children:"share of hosts from the 10 largest linking domains"})]})]}),o.jsxs("p",{className:"text-xs text-zinc-600 mt-2",children:["Release ",o.jsx("code",{className:"text-zinc-400",children:t.release})," · queried ",lEe(t.queriedAt),V>0&&o.jsxs(o.Fragment,{children:[" · ",o.jsxs("span",{className:"text-zinc-500",children:[V," crawler/proxy domain",V===1?"":"s"," hidden"]})]})]}),F.length>=2&&o.jsxs($e,{className:"surface-card p-4 mt-4",children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Referring domains over releases"}),o.jsx("div",{className:"h-40 mt-2",children:o.jsx(zs,{width:"100%",height:"100%",children:o.jsxs(SN,{data:F,margin:{top:8,right:12,bottom:0,left:12},children:[o.jsx("defs",{children:o.jsxs("linearGradient",{id:"bl-gradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[o.jsx("stop",{offset:"0%",stopColor:qi[0],stopOpacity:.4}),o.jsx("stop",{offset:"100%",stopColor:qi[0],stopOpacity:0})]})}),o.jsx(Ya,{dataKey:"date",tick:Jn,stroke:Nr,tickFormatter:hd}),o.jsx(Wa,{tick:Jn,stroke:Nr,allowDecimals:!1}),o.jsx(Ds,{contentStyle:ua.contentStyle,labelStyle:ua.labelStyle,itemStyle:ua.itemStyle,labelFormatter:fd}),o.jsx(Du,{type:"monotone",dataKey:"linkingDomains",name:"Referring domains",stroke:qi[0],fill:"url(#bl-gradient)",strokeWidth:2})]})})})]}),o.jsxs("div",{className:"mt-4",children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Top referring domains"}),X&&o.jsxs("p",{className:"text-xs text-zinc-600",children:["Page ",Z," of ",H," · ",Og(B)," total"]})]}),o.jsx($e,{className:"surface-card overflow-hidden",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800 text-left text-xs uppercase tracking-wide text-zinc-600",children:[o.jsx("th",{className:"px-4 py-2 font-medium",children:"Domain"}),o.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Linking hosts"})]})}),o.jsxs("tbody",{children:[U.map(G=>o.jsxs("tr",{className:"border-b border-zinc-900 last:border-0",children:[o.jsx("td",{className:"px-4 py-2 text-zinc-200",children:G.linkingDomain}),o.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:Og(G.numHosts)})]},G.linkingDomain)),U.length===0&&o.jsx("tr",{children:o.jsx("td",{className:"px-4 py-4 text-sm text-zinc-500",colSpan:2,children:V>0&&B===0?`Every referring domain in this release was a crawler/proxy host (${V} hidden).`:"No referring domains in this release."})})]})]})}),X&&o.jsxs("div",{className:"flex items-center justify-end gap-2 mt-2",children:[o.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:b===0,onClick:()=>j(G=>Math.max(0,G-El)),children:"Previous"}),o.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:b+El>=B,onClick:()=>j(G=>G+El),children:"Next"})]})]}),o.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[o.jsxs(be,{type:"button",variant:"outline",size:"sm",disabled:C||f!==null,onClick:$,children:[o.jsx(Av,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":C?"Queuing…":"Re-run extract"]}),o.jsxs(Oj,{label:"What does Re-run extract do?",children:[o.jsxs("span",{className:"block",children:["Re-queries the ",o.jsx("span",{className:"text-zinc-200",children:"cached release files"})," at"," ",o.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"})," for ",o.jsx("span",{className:"text-zinc-200",children:e}),". Replaces existing backlink rows for this project under the current release."]}),o.jsxs("span",{className:"mt-2 block text-zinc-400",children:[o.jsx("span",{className:"text-zinc-200",children:"No re-download"})," of the ~16 GB dump. Typically ",o.jsx("span",{className:"text-zinc-200",children:"~5 min"}),"."]})]}),o.jsx(be,{asChild:!0,type:"button",variant:"outline",size:"sm",children:o.jsx("a",{href:ju("/backlinks"),children:"Open admin"})})]})]}):o.jsx($e,{className:"surface-card p-6",children:o.jsxs("div",{className:"flex items-start gap-4",children:[o.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-zinc-900 text-zinc-400",children:o.jsx(R5,{className:"h-5 w-5","aria-hidden":!0})}),o.jsxs("div",{className:"flex-1",children:[!u&&o.jsxs(o.Fragment,{children:[o.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"No release sync yet"}),o.jsx("p",{className:"text-sm text-zinc-500 mt-1",children:"Run a workspace release sync to populate backlinks for every project in this workspace."}),o.jsx("div",{className:"mt-4",children:o.jsx(be,{asChild:!0,type:"button",size:"sm",children:o.jsx("a",{href:ju("/backlinks"),children:"Set up backlinks"})})})]}),D&&o.jsxs(o.Fragment,{children:[o.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"Sync in progress"}),o.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["A workspace release sync is running (",u.status,u.phaseDetail?` — ${u.phaseDetail}`:"","). Backlinks will appear here once it finishes."]}),o.jsx("div",{className:"mt-4",children:o.jsx(be,{asChild:!0,type:"button",variant:"outline",size:"sm",children:o.jsx("a",{href:ju("/backlinks"),children:"View sync status"})})})]}),q&&o.jsxs(o.Fragment,{children:[o.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"Last sync failed"}),o.jsx("p",{className:"text-sm text-zinc-500 mt-1",children:u.error??"The workspace release sync failed. Retry from the Backlinks admin page."}),o.jsx("div",{className:"mt-4",children:o.jsx(be,{asChild:!0,type:"button",size:"sm",children:o.jsx("a",{href:ju("/backlinks"),children:"Go to Backlinks admin"})})})]}),M&&!D&&!I&&!ye&&o.jsxs(o.Fragment,{children:[o.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"No backlinks yet for this project"}),o.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["Release ",o.jsx("code",{className:"text-zinc-300",children:u.release})," is ready but no backlinks have been extracted for"," ",o.jsx("code",{className:"text-zinc-300",children:e}),". Run an extract to populate data using the cached release."]}),o.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[o.jsxs(be,{type:"button",size:"sm",disabled:C||f!==null,onClick:$,children:[o.jsx(ry,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":C?"Queuing…":"Run extract"]}),o.jsxs(Oj,{label:"What does Run extract do?",children:[o.jsxs("span",{className:"block",children:["Runs a DuckDB query against the ",o.jsx("span",{className:"text-zinc-200",children:"cached release files"})," at"," ",o.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"})," to find referring domains for ",o.jsx("span",{className:"text-zinc-200",children:e}),"."]}),o.jsxs("span",{className:"mt-2 block text-zinc-400",children:["No re-download. Typically takes ",o.jsx("span",{className:"text-zinc-200",children:"~5 min"}),"."]})]})]})]}),ye&&o.jsxs(o.Fragment,{children:[o.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"Last extract failed"}),o.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["See the error above for details. If the cache files for release"," ",o.jsx("code",{className:"text-zinc-300",children:u?.release})," are missing, re-sync the release from the Backlinks admin to restore the ~16 GB dump, then re-run the extract."]}),o.jsx("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:o.jsx(be,{asChild:!0,type:"button",size:"sm",children:o.jsx("a",{href:ju("/backlinks"),children:"Go to Backlinks admin"})})})]}),I&&o.jsxs(o.Fragment,{children:[o.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"No referring domains found"}),o.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["The last extract against release ",o.jsx("code",{className:"text-zinc-300",children:t.release})," found"," ",o.jsx("span",{className:"text-zinc-300",children:"0 referring domains"})," for"," ",o.jsx("code",{className:"text-zinc-300",children:t.targetDomain}),". This can happen when:"]}),o.jsxs("ul",{className:"mt-2 space-y-1 text-xs text-zinc-500 list-disc list-inside",children:[o.jsx("li",{children:"the domain is newer than the release’s crawl window"}),o.jsx("li",{children:"the Common Crawl snapshot didn’t capture pages that link to it"}),o.jsx("li",{children:"the extract ran against a cache that was missing or incomplete"})]}),o.jsx("p",{className:"text-sm text-zinc-500 mt-3",children:"Try syncing a newer release — each Common Crawl dump is a different snapshot of the web graph."}),o.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[o.jsx(be,{asChild:!0,type:"button",size:"sm",children:o.jsx("a",{href:ju("/backlinks"),children:"Go to Backlinks admin"})}),o.jsxs(be,{type:"button",variant:"outline",size:"sm",disabled:C||f!==null,onClick:$,children:[o.jsx(ry,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":C?"Queuing…":"Re-run extract"]}),o.jsxs(Oj,{label:"What does Re-run extract do?",children:[o.jsxs("span",{className:"block",children:["Re-queries the cached release for ",o.jsx("span",{className:"text-zinc-200",children:t.targetDomain}),". Only useful if the cache files were incomplete last time."]}),o.jsx("span",{className:"mt-2 block text-zinc-400",children:"No re-download. ~5 min. If the release genuinely has no links for your domain, this won’t help — sync a different release instead."})]})]})]})]})]})})}}function fEe({projectName:e}){const t=ca({queryKey:qe.citationVisibility(e),queryFn:()=>HV(e),staleTime:E5}),n=t.data??null,r=t.error;if(t.isLoading&&!n)return null;if(r)return o.jsxs("section",{className:"page-section-divider",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Citation visibility"}),o.jsx("h2",{children:"Citation + answer-mention coverage"})]})}),o.jsx("p",{className:"text-sm text-rose-400",children:r instanceof Error?r.message:String(r)})]});if(!n)return null;if(n.status==="no-data")return o.jsxs("section",{className:"page-section-divider",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Citation visibility"}),o.jsx("h2",{children:"Citation + answer-mention coverage"})]})}),o.jsx("p",{className:"text-sm text-zinc-500",children:n.reason==="no-queries"?"Add queries to start tracking AI citations.":"Run a sweep to see which engines cite this project."})]});const{providersCiting:i,providersMentioning:a,providersConfigured:l}=n.summary;return o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Citation visibility"}),o.jsxs("h2",{className:"flex items-center gap-2",children:["Cited by ",i," of ",l," engines",o.jsx(hr,{text:"An engine is ‘citing’ when our domain appears in its grounding source list (the structured citation/search-result attribution it returns alongside the answer). Counts each configured engine that cites the project on at least one tracked query in the latest snapshot per (query × provider)."})]}),o.jsxs("p",{className:"text-base text-zinc-300 flex items-center gap-2",children:["Mentioned in ",a," of ",l," engine answers",o.jsx(hr,{text:"An engine is ‘mentioning’ when our brand or domain appears inside the prose of the answer text — independent of whether it’s in the citation list. Models often name-drop from training without citing a fresh page."})]})]}),n.summary.latestRunAt&&o.jsxs("p",{className:"supporting-copy",children:["Latest run ",new Date(n.summary.latestRunAt).toLocaleString()]})]}),o.jsx(hEe,{data:n}),o.jsx(pEe,{data:n}),n.competitorGaps.length>0&&o.jsx(vEe,{data:n})]})}function hEe({data:e}){const{totalQueries:t,queriesCitedAndMentioned:n,queriesCitedOnly:r,queriesMentionedOnly:i,queriesInvisible:a}=e.summary;return o.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4 mb-4",children:[o.jsx(Eg,{label:"Cited + mentioned",value:`${n} / ${t}`,helper:"In sources AND named in answer",tone:n>0?"positive":"neutral"}),o.jsx(Eg,{label:"Cited only",value:`${r} / ${t}`,helper:"In sources, not named in answer",tone:r>0?"positive-dim":"neutral"}),o.jsx(Eg,{label:"Mentioned only",value:`${i} / ${t}`,helper:"Named in answer, no source link",tone:i>0?"caution":"neutral"}),o.jsx(Eg,{label:"Invisible",value:`${a} / ${t}`,helper:"No engine cites or mentions",tone:a>0?"negative":"neutral"})]})}function Eg({label:e,value:t,helper:n,tone:r}){const i=r==="positive"?"text-emerald-300":r==="positive-dim"?"text-emerald-400/70":r==="caution"?"text-amber-300":r==="negative"?"text-rose-300":"text-zinc-100";return o.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[o.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:e}),o.jsx("p",{className:`mt-1 text-2xl font-semibold tabular-nums ${i}`,children:t}),o.jsx("p",{className:"text-[11px] text-zinc-500",children:n})]})}function pEe({data:e}){const t=x.useMemo(()=>{const n=new Set;for(const r of e.byQuery)for(const i of r.providers)n.add(i.provider);return Array.from(n).sort()},[e.byQuery]);return e.byQuery.length===0?o.jsx("p",{className:"text-sm text-zinc-500",children:"No query coverage rows."}):o.jsxs("div",{children:[o.jsx(mEe,{}),o.jsx("div",{className:"evidence-table-wrap",children:o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Query"}),t.map(n=>o.jsx("th",{className:"text-center",children:o.jsx(nc,{provider:n})},n)),o.jsx("th",{className:"text-right",children:"Cite"}),o.jsx("th",{className:"text-right",children:"Ment"})]})}),o.jsx("tbody",{children:e.byQuery.map(n=>o.jsxs("tr",{children:[o.jsx("td",{className:"font-medium text-zinc-100",children:n.query}),t.map(r=>{const i=n.providers.find(a=>a.provider===r);return o.jsx("td",{className:"text-center",children:i==null?o.jsx(WQ,{className:"inline h-3.5 w-3.5 text-zinc-700","aria-label":"no data"}):o.jsx(gEe,{provider:i})},r)}),o.jsx("td",{className:"text-right tabular-nums",children:o.jsxs("span",{className:n.totalProviders>0&&n.citedCount===n.totalProviders?"text-emerald-300":n.citedCount>0?"text-emerald-400/70":"text-zinc-500",children:[n.citedCount,"/",n.totalProviders]})}),o.jsx("td",{className:"text-right tabular-nums",children:o.jsxs("span",{className:n.totalProviders>0&&n.mentionedCount===n.totalProviders?"text-sky-300":n.mentionedCount>0?"text-sky-400/70":"text-zinc-500",children:[n.mentionedCount,"/",n.totalProviders]})})]},n.queryId))})]})})]})}function mEe(){return o.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-3 text-[11px] text-zinc-500",children:[o.jsxs("span",{className:"flex items-center gap-1.5",children:[o.jsx(Mu,{active:!0,tone:"cited"}),o.jsx("span",{children:"cited (in sources)"})]}),o.jsxs("span",{className:"flex items-center gap-1.5",children:[o.jsx(Mu,{active:!0,tone:"mentioned"}),o.jsx("span",{children:"mentioned (in answer)"})]}),o.jsxs("span",{className:"flex items-center gap-1.5",children:[o.jsx(Mu,{active:!1,tone:"cited"}),o.jsx(Mu,{active:!1,tone:"mentioned"}),o.jsx("span",{children:"neither"})]})]})}function gEe({provider:e}){const t=yEe(e);return o.jsxs("span",{className:"inline-flex items-center justify-center gap-1",title:t,children:[o.jsx(Mu,{active:e.cited,tone:"cited"}),o.jsx(Mu,{active:e.mentioned,tone:"mentioned"})]})}function yEe(e){return e.cited&&e.mentioned?"Cited in sources and mentioned in answer":e.cited?"Cited in sources, not mentioned in answer":e.mentioned?"Mentioned in answer, not in sources":"Not cited and not mentioned"}function Mu({active:e,tone:t}){if(!e)return o.jsx("span",{className:"inline-block h-2 w-2 rounded-full border border-zinc-700/80 bg-transparent","aria-hidden":"true"});const n=t==="cited"?"inline-block h-2 w-2 rounded-full bg-emerald-400 shadow-[0_0_0_1px_rgba(16,185,129,0.25)]":"inline-block h-2 w-2 rounded-full bg-sky-400 shadow-[0_0_0_1px_rgba(56,189,248,0.25)]";return o.jsx("span",{className:n,"aria-hidden":"true"})}function vEe({data:e}){return o.jsxs("div",{className:"mt-4",children:[o.jsxs("h3",{className:"text-sm font-semibold text-zinc-200 mb-2 flex items-center gap-2",children:["Competitor gaps",o.jsx(hr,{text:"Queries where the project is not cited but a configured competitor is. Each row maps to one (query, engine) pair — the same query may surface for multiple engines."}),o.jsxs("span",{className:"text-[10px] font-normal uppercase tracking-wide text-zinc-500",children:[e.competitorGaps.length," ",e.competitorGaps.length===1?"gap":"gaps"]})]}),o.jsx("div",{className:"evidence-table-wrap",children:o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Query"}),o.jsx("th",{children:"Engine"}),o.jsx("th",{children:"Competitors cited"})]})}),o.jsx("tbody",{children:e.competitorGaps.map(t=>o.jsxs("tr",{children:[o.jsx("td",{className:"font-medium text-zinc-100",children:t.query}),o.jsx("td",{children:o.jsx(nc,{provider:t.provider})}),o.jsx("td",{className:"text-zinc-300",children:t.citingCompetitors.join(", ")})]},`${t.queryId}::${t.provider}`))})]})})]})}const LF=4;function xEe(e){return e.length<LF}const bEe={critical:"negative",high:"negative",medium:"caution",low:"neutral"},wEe={positive:"Positive",caution:"Caution",negative:"Negative",neutral:"Neutral"};function it(e){return Number.isFinite(e)?Math.abs(e)>=1e6?`${(e/1e6).toFixed(1)}M`:Math.abs(e)>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString("en-US"):"—"}function Ms(e,t=1){return Number.isFinite(e)?`${e.toFixed(t)}%`:"—"}function MA(e){return Number.isFinite(e)?`${(e*100).toFixed(1)}%`:"—"}function md(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function $F(e){switch(e){case"up":return"positive";case"down":return"negative";case"flat":return"neutral";case"unknown":return"neutral"}}function BF(e){const t=[e.city,e.region,e.country].filter(Boolean).join(", ");return t?`${e.label} (${t})`:e.label}function SEe(e){switch(e){case"request-param":case"prompt":return"positive";case"browser-geo":return"caution";case"ignored":return"negative"}}const jEe={"request-param":"Request parameter",prompt:"Prompt-injected","browser-geo":"Browser geo",ignored:"Ignored"};function NEe({cell:e}){if(!e)return o.jsxs("span",{className:"inline-flex items-center gap-1 font-mono text-[12px] text-zinc-700",children:[o.jsx("span",{children:"—"}),o.jsx("span",{children:"—"})]});const t=e.citationState===Ju.cited,n=e.answerMentioned;return o.jsxs("span",{className:"inline-flex items-center gap-1 font-mono text-[12px]",children:[o.jsx("span",{className:t?"text-emerald-300":"text-zinc-500",title:t?"Cited (your domain in source list)":"Not cited",children:t?"C":"c"}),o.jsx("span",{className:n===!0?"text-emerald-300":n===!1?"text-zinc-500":"text-zinc-700",title:n===!0?"Mentioned (your brand in answer text)":n===!1?"Not mentioned":"No answer text",children:n===!0?"M":n===!1?"m":"–"})]})}function kEe(e){switch(e){case"High":return"negative";case"Moderate":return"caution";case"Low":return"neutral";case"None":return"neutral"}}function CEe({projectName:e}){const[t,n]=x.useState(!1),[r,i]=x.useState(null),[a,l]=x.useState("agency"),u=ca({queryKey:qe.report(e),queryFn:()=>TV(e)});async function d(){n(!0),i(null);try{await DV(e,a)}catch(p){const m=p instanceof Jr||p instanceof Error?p.message:"Download failed";i(m)}finally{n(!1)}}if(u.isLoading)return o.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading report…"});if(u.error){const p=u.error instanceof Error?u.error.message:"Failed to load report";return o.jsx("div",{className:"py-8 text-center",children:o.jsx("p",{className:"text-sm text-rose-400",children:p})})}const f=u.data;return f?o.jsxs("div",{children:[o.jsxs("div",{className:"page-header",children:[o.jsxs("div",{className:"page-header-left",children:[o.jsx("p",{className:"eyebrow",children:"AEO Report"}),o.jsx("h1",{className:"page-title",children:f.meta.project.displayName}),o.jsxs("p",{className:"page-subtitle",children:[f.meta.project.canonicalDomain," · ",f.meta.project.country," / ",f.meta.project.language.toUpperCase(),f.meta.location?` · Location: ${BF(f.meta.location)}`:" · No location set"," · ","Generated ",md(f.meta.generatedAt)]}),r&&o.jsx("p",{className:"mt-2 text-xs text-rose-400",children:r})]}),o.jsxs("div",{className:"page-header-right",children:[o.jsx("div",{className:"inline-flex rounded-lg border border-zinc-800/70 bg-zinc-950/60 p-1",role:"tablist","aria-label":"Report audience",children:["agency","client"].map(p=>o.jsx("button",{type:"button",role:"tab","aria-selected":a===p,onClick:()=>l(p),className:`rounded-md px-3 py-1.5 text-xs font-medium transition ${a===p?"bg-zinc-100 text-zinc-950":"text-zinc-400 hover:text-zinc-100"}`,children:p==="agency"?"Agency":"Client"},p))}),o.jsxs(be,{variant:"secondary",size:"sm",onClick:d,disabled:t,children:[o.jsx(Av,{className:"size-4"}),t?"Preparing…":"Download report HTML"]})]})]}),a==="client"?o.jsxs(o.Fragment,{children:[o.jsx(OEe,{report:f}),o.jsx(AL,{report:f,audience:"client"}),o.jsx(_Ee,{report:f})]}):o.jsxs(o.Fragment,{children:[o.jsx(zEe,{report:f}),o.jsx(AL,{report:f,audience:"agency"}),o.jsx(EEe,{report:f}),o.jsx(TEe,{report:f}),o.jsx(REe,{report:f}),o.jsx(DEe,{report:f}),o.jsx(MEe,{report:f}),o.jsx(LEe,{report:f}),o.jsx($Ee,{report:f}),o.jsx(BEe,{report:f}),o.jsx(UEe,{report:f}),o.jsx(FEe,{report:f}),o.jsx(KEe,{report:f}),o.jsx(GEe,{report:f}),o.jsx(VEe,{report:f}),o.jsx(QEe,{report:f})]})]}):null}function AEe(e,t){return e.audience==="both"||e.audience===t}function OEe({report:e}){const t=e.executiveSummary;return o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Client summary",title:"How you're appearing",subtitle:e.clientSummary.overview}),o.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[o.jsx("p",{className:"text-sm font-medium text-zinc-100",children:e.clientSummary.headline}),o.jsx("p",{className:"mt-1 text-sm text-zinc-400",children:e.clientSummary.overview})]}),o.jsxs("div",{className:"mt-3 grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[o.jsx(Qt,{label:"Citation coverage",value:Ms(t.citationRate,0),tone:$F(t.trend),subtitle:`${t.citedQueryCount}/${t.totalQueryCount} tracked queries cited`}),o.jsx(Qt,{label:"Mention coverage",value:Ms(t.mentionRate,0),subtitle:`${t.mentionedQueryCount}/${t.totalQueryCount} tracked queries mentioned`}),o.jsx(Qt,{label:"Providers checked",value:it(t.providerCount),subtitle:`${it(t.queryCount)} tracked queries`}),t.gsc&&o.jsx(Qt,{label:"Search impressions",value:it(t.gsc.impressions),subtitle:`${it(t.gsc.clicks)} clicks`})]}),e.clientSummary.confidenceNotes.length>0&&o.jsx("div",{className:"mt-4 grid gap-2",children:e.clientSummary.confidenceNotes.map((n,r)=>o.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-3 py-2 text-xs text-zinc-400",children:n},r))})]})}function AL({report:e,audience:t}){const n=t==="client"?e.clientSummary.actionItems:e.agencyDiagnostics.priorities.length>0?e.agencyDiagnostics.priorities:e.actionPlan.filter(r=>AEe(r,t));return o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:t==="client"?"Client actions":"Agency actions",title:t==="client"?"What we recommend next":"Agency action plan",subtitle:t==="client"?"Polished next steps backed by concise evidence.":"Technical priorities from the canonical action plan."}),n.length===0?o.jsx(mr,{message:"No prioritized actions yet."}):o.jsx("div",{className:"grid gap-3 lg:grid-cols-2",children:n.map(r=>o.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[o.jsxs("div",{className:"mb-3 flex flex-wrap gap-2",children:[o.jsx(Xe,{tone:ate(r),children:T$(r.horizon)}),o.jsx(Xe,{tone:"neutral",children:ote(r.category)}),o.jsxs(Xe,{tone:"neutral",children:[lte(r.confidence)," confidence"]})]}),o.jsx("p",{className:"text-sm font-medium text-zinc-100",children:r.title}),o.jsx("p",{className:"mt-1 text-sm text-zinc-400",children:r.action}),r.why.length>0&&o.jsxs("div",{className:"mt-3",children:[o.jsx("p",{className:"eyebrow-soft mb-1",children:"Why"}),o.jsx("ul",{className:"list-disc space-y-1 pl-4 text-xs text-zinc-400",children:r.why.map((i,a)=>o.jsx("li",{children:i},a))})]}),r.evidence.length>0&&o.jsxs("div",{className:"mt-3",children:[o.jsx("p",{className:"eyebrow-soft mb-1",children:"Evidence"}),o.jsx("ul",{className:"list-disc space-y-1 pl-4 text-xs text-zinc-400",children:r.evidence.map((i,a)=>o.jsx("li",{children:i},a))})]}),o.jsxs("p",{className:"mt-3 border-t border-zinc-800/60 pt-3 text-xs text-zinc-300",children:[o.jsx("span",{className:"font-medium",children:"Success metric:"})," ",r.successMetric]})]},`${r.priority}-${r.title}`))})]})}function EEe({report:e}){const t=e.agencyDiagnostics.diagnostics;return t.length===0?null:o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Agency diagnostics",title:"Technical diagnostics",subtitle:"Operator-facing evidence for provider, source-domain, search-demand, indexing, content, and location follow-up."}),o.jsx("div",{className:"grid gap-3 lg:grid-cols-2",children:t.map(n=>o.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[o.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[o.jsx(Xe,{tone:n.severity,children:n.severity}),o.jsx("p",{className:"text-sm font-medium text-zinc-100",children:n.title})]}),o.jsx("p",{className:"text-sm text-zinc-400",children:n.detail}),n.evidence.length>0&&o.jsx("ul",{className:"mt-3 list-disc space-y-1 pl-4 text-xs text-zinc-500",children:n.evidence.map((r,i)=>o.jsx("li",{children:r},i))})]},n.title))})]})}function _Ee({report:e}){const t=[];return e.aiSourceOrigin.topDomains.length>0&&t.push({key:"source-domains",tone:"neutral",title:"Sources AI engines trust",detail:"These domains appeared most often as cited sources outside your owned domain.",items:e.aiSourceOrigin.topDomains.slice(0,5).map(n=>`${n.domain}: ${it(n.count)} citation${n.count===1?"":"s"}`)}),e.gsc&&t.push({key:"search-demand",tone:"neutral",title:"Search demand",detail:`Search Console shows ${it(e.gsc.totalImpressions)} impressions and ${it(e.gsc.totalClicks)} clicks in the report window.`,items:e.gsc.topQueries.slice(0,5).map(n=>`${n.query}: ${it(n.impressions)} impressions`)}),e.indexingHealth&&t.push({key:"indexing",tone:e.indexingHealth.indexedPct>=90?"positive":e.indexingHealth.indexedPct>=70?"caution":"negative",title:"Indexing readiness",detail:`${e.indexingHealth.indexedPct}% of inspected URLs are indexed.`,items:[`${it(e.indexingHealth.indexed)} indexed`,`${it(e.indexingHealth.notIndexed)} not indexed`]}),e.contentOpportunities.length>0&&t.push({key:"content",tone:"caution",title:"Content opportunities",detail:"Canonry found topics where better content could improve AI citations.",items:e.contentOpportunities.slice(0,5).map(n=>`${n.query}: ${A$(n.action)} (score ${Math.round(n.score)}/100)`)}),o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Evidence",title:"Why this is the plan",subtitle:"Concise support for the client summary. Switch to Agency for the detailed tables and matrices."}),t.length===0?o.jsx(mr,{message:"No supporting evidence sections are populated yet."}):o.jsx("div",{className:"grid gap-3 lg:grid-cols-2",children:t.map(n=>o.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[o.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[o.jsx(Xe,{tone:n.tone,children:n.tone}),o.jsx("p",{className:"text-sm font-medium text-zinc-100",children:n.title})]}),o.jsx("p",{className:"text-sm text-zinc-400",children:n.detail}),n.items.length>0&&o.jsx("ul",{className:"mt-3 list-disc space-y-1 pl-4 text-xs text-zinc-500",children:n.items.map((r,i)=>o.jsx("li",{children:r},i))})]},n.key))})]})}function zEe({report:e}){const t=e.executiveSummary,n=t.trend==="up"?"↑ Up":t.trend==="down"?"↓ Down":t.trend==="flat"?"→ Flat":"—",r=t.totalQueryCount===1?"query":"queries",i=t.totalQueryCount>0?`${t.citedQueryCount}/${t.totalQueryCount} ${r} cited`:"no queries",a=t.totalQueryCount>0?`${t.mentionedQueryCount}/${t.totalQueryCount} ${r} mentioned`:"no queries",l=`${n} · ${i} · ${t.providerCount} provider${t.providerCount===1?"":"s"}`,u=`${t.competitorCount} competitor${t.competitorCount===1?"":"s"} tracked`;return o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Section 1",title:"Executive summary",subtitle:"Two independent signals: citation rate = your domain in the source list the AI used; mention rate = your brand in the answer text. A model can mention you without citing your domain, or vice versa. Both are computed per-query so they stay comparable when provider count changes."}),o.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[o.jsx(Qt,{label:"Citation rate",value:Ms(t.citationRate,0),tone:$F(t.trend),subtitle:l}),o.jsx(Qt,{label:"Mention rate",value:Ms(t.mentionRate,0),subtitle:a}),o.jsx(Qt,{label:"Queries tracked",value:it(t.queryCount),subtitle:u}),t.gsc&&o.jsx(Qt,{label:"GSC clicks",value:it(t.gsc.clicks),subtitle:`${it(t.gsc.impressions)} imp · ${MA(t.gsc.ctr)} CTR`}),t.ga&&o.jsx(Qt,{label:"GA sessions",value:it(t.ga.sessions),subtitle:`${it(t.ga.users)} users · ${md(t.ga.periodStart)} → ${md(t.ga.periodEnd)}`})]}),t.findings.length>0&&o.jsx("div",{className:"mt-5 space-y-2",children:t.findings.map((d,f)=>o.jsxs("div",{className:`insight-card rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-4 ${d.tone==="positive"?"insight-card-positive":d.tone==="caution"?"insight-card-caution":d.tone==="negative"?"insight-card-negative":""}`,children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Xe,{tone:d.tone,children:wEe[d.tone]}),o.jsx("span",{className:"text-sm font-medium text-zinc-100",children:d.title})]}),o.jsx("p",{className:"text-sm text-zinc-400",children:d.detail})]},f))}),o.jsx(PEe,{report:e})]})}function PEe({report:e}){const t=e.meta.location,n=e.meta.providerLocationHandling;return!t&&n.length===0?null:o.jsxs("div",{className:"mt-5 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[o.jsx("p",{className:"eyebrow mb-2",children:"Location handling"}),o.jsxs("p",{className:"text-sm text-zinc-300",children:[o.jsx("span",{className:"font-medium",children:"Location for this run: "}),t?BF(t):"none — providers received the queries verbatim with no geographic hint.",t&&t.otherConfiguredLabels.length>0&&o.jsxs("span",{className:"text-zinc-500",children:[" ","— other configured locations (",t.otherConfiguredLabels.join(", "),") need their own sweep to compare."]})]}),n.length>0&&o.jsx("div",{className:"evidence-table-wrap mt-3",children:o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Provider"}),o.jsx("th",{children:"Treatment"}),o.jsx("th",{children:"How the location reached the model"})]})}),o.jsx("tbody",{children:n.map(r=>o.jsxs("tr",{children:[o.jsx("td",{children:r.provider}),o.jsx("td",{children:o.jsx(Xe,{tone:SEe(r.treatment),children:jEe[r.treatment]})}),o.jsx("td",{className:"text-zinc-400",children:r.description})]},r.provider))})]})})]})}function Qt({label:e,value:t,tone:n,subtitle:r}){const i=n==="positive"?"text-emerald-400":n==="caution"?"text-amber-400":n==="negative"?"text-rose-400":"text-zinc-100";return o.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[o.jsx("p",{className:"eyebrow-soft",children:e}),o.jsx("p",{className:`text-2xl font-semibold tracking-tight ${i}`,children:t}),r&&o.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:r})]})}function TEe({report:e}){const t=e.citationScorecard;return t.providers.length===0||t.queries.length===0?o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Section 2",title:"Citation scorecard",subtitle:"Per (query × provider) view of citations and mentions for the latest sweep."}),o.jsx(mr,{message:"No completed answer-visibility runs yet."})]}):o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Section 2",title:"Citation scorecard",subtitle:"Per (query × provider) view of both signals — citations (your domain in the source list) and mentions (your brand in the answer text) — for the latest sweep."}),o.jsxs("div",{className:"mb-4",children:[o.jsx("p",{className:"eyebrow mb-2",children:"Provider citation rate"}),o.jsx("div",{className:"h-48 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",children:o.jsx(zs,{width:"100%",height:"100%",children:o.jsxs(wN,{data:t.providerRates,layout:"vertical",margin:{left:20,right:20,top:8,bottom:8},children:[o.jsx(pc,{stroke:dd,horizontal:!1}),o.jsx(Ya,{type:"number",domain:[0,100],tick:Jn,stroke:Nr}),o.jsx(Wa,{type:"category",dataKey:"provider",tick:Jn,stroke:Nr,width:90}),o.jsx(Ds,{...ua,formatter:(n,r,i)=>{const a=i?.payload;return a?`${a.citationRate}% (${a.citedCount}/${a.totalCount})`:""}}),o.jsx(gv,{dataKey:"citationRate",fill:qi[0],radius:[0,4,4,0]})]})})}),o.jsx("ul",{className:"mt-2 space-y-0.5 text-[11px] text-zinc-500",children:t.providerRates.map(n=>o.jsxs("li",{children:[o.jsx("span",{className:"font-medium text-zinc-300",children:n.provider}),": ",n.citationRate,"% (",n.citedCount,"/",n.totalCount,")"]},n.provider))})]}),o.jsx("p",{className:"eyebrow mb-2",children:"Query × provider"}),o.jsxs("p",{className:"mb-2 text-[11px] text-zinc-500",children:["Each cell shows two flags —"," ",o.jsx("span",{className:"font-mono text-emerald-300",children:"C"}),"/",o.jsx("span",{className:"font-mono text-zinc-500",children:"c"})," = cited / not cited (your domain in the source list),"," ",o.jsx("span",{className:"font-mono text-emerald-300",children:"M"}),"/",o.jsx("span",{className:"font-mono text-zinc-500",children:"m"})," = mentioned / not mentioned (your brand in the answer text),"," ",o.jsx("span",{className:"font-mono text-zinc-700",children:"–"})," = no data."]}),o.jsx("div",{className:"evidence-table-wrap",children:o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Query"}),t.providers.map(n=>o.jsx("th",{children:n},n))]})}),o.jsx("tbody",{children:t.queries.map((n,r)=>o.jsxs("tr",{children:[o.jsx("td",{className:"evidence-query-cell",children:n}),t.providers.map((i,a)=>{const l=t.matrix[r]?.[a]??null;return o.jsx("td",{children:o.jsx(NEe,{cell:l})},i)})]},n))})]})}),o.jsx("p",{className:"mt-2 text-[11px] text-zinc-500",children:"Cited = domain in source list · Not cited = absent · Pending = run incomplete · — = no snapshot"})]})}function REe({report:e}){const t=e.competitorLandscape,n=e.mentionLandscape,r=e.meta.project.canonicalDomain,i=t.competitors.length===0&&t.projectCitationCount===0,a=n.competitors.length===0&&n.projectMentionCount===0;if(i&&a)return o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Section 3",title:"Competitor landscape",subtitle:"Where tracked competitors appear in AI answers compared to your domain — both in source citations and in the answer text itself."}),o.jsx(mr,{message:"No competitor data yet. Add competitors and run a visibility sweep."})]});const l=[{label:r,count:t.projectCitationCount,isProject:!0},...t.competitors.map(m=>({label:m.domain,count:m.citationCount,isProject:!1}))],u=[{label:r,count:n.projectMentionCount,isProject:!0},...n.competitors.map(m=>({label:m.domain,count:m.mentionCount,isProject:!1}))],d=l.length>1,f=u.length>1,p=new Map(n.competitors.map(m=>[m.domain,m]));return o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Section 3",title:"Competitor landscape",subtitle:"Where tracked competitors appear in AI answers compared to your domain — both in source citations and in the answer text itself."}),o.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[d&&o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow mb-2",children:"Citations per domain"}),o.jsx("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",style:{height:l.length*32+32},children:o.jsx(zs,{width:"100%",height:"100%",children:o.jsxs(wN,{data:l,layout:"vertical",margin:{left:20,right:32,top:8,bottom:8},children:[o.jsx(pc,{stroke:dd,horizontal:!1}),o.jsx(Ya,{type:"number",tick:Jn,stroke:Nr}),o.jsx(Wa,{type:"category",dataKey:"label",tick:Jn,stroke:Nr,width:140}),o.jsx(Ds,{...ua}),o.jsx(gv,{dataKey:"count",radius:[0,4,4,0],children:l.map((m,g)=>o.jsx(lv,{fill:m.isProject?"#3b82f6":qi[(g+1)%qi.length]},g))})]})})})]}),f&&o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow mb-2",children:"Mentions per domain"}),o.jsx("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",style:{height:u.length*32+32},children:o.jsx(zs,{width:"100%",height:"100%",children:o.jsxs(wN,{data:u,layout:"vertical",margin:{left:20,right:32,top:8,bottom:8},children:[o.jsx(pc,{stroke:dd,horizontal:!1}),o.jsx(Ya,{type:"number",tick:Jn,stroke:Nr}),o.jsx(Wa,{type:"category",dataKey:"label",tick:Jn,stroke:Nr,width:140}),o.jsx(Ds,{...ua}),o.jsx(gv,{dataKey:"count",radius:[0,4,4,0],children:u.map((m,g)=>o.jsx(lv,{fill:m.isProject?"#3b82f6":qi[(g+1)%qi.length]},g))})]})})})]})]}),o.jsx("p",{className:"mt-2 text-[11px] text-zinc-500",children:"Citations = domain in source list · Mentions = brand or domain in answer text — independent signals."}),t.competitors.length===0?o.jsx(mr,{message:"No competitors configured."}):o.jsx("div",{className:"competitor-table-wrap mt-4",children:o.jsxs("table",{className:"competitor-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Domain"}),o.jsx("th",{children:"Pressure"}),o.jsx("th",{children:"Citations"}),o.jsx("th",{children:"Mentions"}),o.jsx("th",{children:"SOV"}),o.jsx("th",{children:"Cited queries"})]})}),o.jsx("tbody",{children:t.competitors.map(m=>{const g=p.get(m.domain),v=g?.mentionCount??0,S=g?.totalCount??n.totalAnswerSnapshots;return o.jsxs("tr",{children:[o.jsx("td",{className:"evidence-query-cell",children:m.domain}),o.jsx("td",{children:o.jsx(Xe,{tone:kEe(m.pressureLabel),children:m.pressureLabel})}),o.jsxs("td",{children:[m.citationCount," / ",m.totalCount]}),o.jsxs("td",{children:[v," / ",S]}),o.jsxs("td",{children:[m.sharePct,"%"]}),o.jsxs("td",{className:"text-xs text-zinc-400",children:[m.citedQueries.slice(0,5).join(", "),m.citedQueries.length>5?"…":"",m.theirCitedPages.length>0&&o.jsxs("details",{className:"mt-1",children:[o.jsxs("summary",{className:"cursor-pointer text-zinc-500 hover:text-zinc-300",children:[m.theirCitedPages.length," cited URL",m.theirCitedPages.length>1?"s":""]}),o.jsx("ul",{className:"mt-1 space-y-1 pl-3",children:m.theirCitedPages.map((b,j)=>o.jsxs("li",{children:[o.jsx("a",{href:b.url,className:"break-all text-blue-400 hover:underline",target:"_blank",rel:"noreferrer",children:b.url}),o.jsx("span",{className:"ml-2 text-zinc-500",children:b.citedFor.join(", ")})]},j))})]})]})]},m.domain)})})]})})]})}function DEe({report:e}){const t=e.aiSourceOrigin;if(t.categories.length===0&&t.topDomains.length===0)return o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Section 4",title:"AI citation sources",subtitle:"Every external website AI engines cited as a source for your tracked queries in the latest sweep, ranked by citation count. Tracked competitors are pulled into their own bucket. Your own domains are excluded."}),o.jsx(mr,{message:"No source data yet. Run a visibility sweep first."})]});const n=t.categories.reduce((a,l)=>a+l.count,0),r=t.categories.find(a=>a.category==="competitor"),i=Math.max(1,...t.categories.map(a=>a.count));return o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Section 4",title:"AI citation sources",subtitle:"Every external website AI engines cited as a source for your tracked queries in the latest sweep, ranked by citation count. Tracked competitors are pulled into their own bucket. Your own domains are excluded."}),r&&o.jsxs("p",{className:"mb-3 text-sm text-zinc-300",children:[o.jsxs("span",{className:"font-semibold",children:[r.sharePct,"%"]})," of citations went to tracked competitors (",r.count," of ",n,")."]}),o.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow mb-2",children:"Top source domains"}),t.topDomains.length===0?o.jsx(mr,{message:"No domains tracked yet."}):o.jsx("div",{className:"evidence-table-wrap",children:o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Domain"}),o.jsx("th",{children:"Citations"}),o.jsx("th",{children:"Tag"})]})}),o.jsx("tbody",{children:t.topDomains.map(a=>o.jsxs("tr",{children:[o.jsx("td",{className:"evidence-query-cell text-xs",children:a.domain}),o.jsx("td",{children:a.count}),o.jsx("td",{children:a.isCompetitor?o.jsx(Xe,{tone:"negative",children:"Tracked competitor"}):o.jsx(Xe,{tone:"neutral",children:"External"})})]},a.domain))})]})})]}),o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow mb-2",children:"By source type"}),t.categories.length===0?o.jsx(mr,{message:"No category data."}):o.jsx("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:o.jsx("div",{className:"space-y-2 text-sm",children:t.categories.map(a=>{const l=a.count/i*100,u=a.category==="competitor"?"negative":a.category==="directory"||a.category==="forum"?"caution":"neutral",d=u==="negative"?"bg-rose-400":u==="caution"?"bg-amber-400":"bg-blue-400";return o.jsxs("div",{className:"grid grid-cols-[180px_1fr_90px] items-center gap-2",children:[o.jsx("div",{className:"truncate text-xs text-zinc-400",children:a.label}),o.jsx("div",{className:"h-3 rounded-sm bg-zinc-800",children:o.jsx("div",{className:`h-full rounded-sm ${d}`,style:{width:`${l.toFixed(1)}%`}})}),o.jsxs("div",{className:"text-right text-xs text-zinc-200 tabular-nums",children:[a.count," ",o.jsxs("span",{className:"text-zinc-500",children:["(",a.sharePct,"%)"]})]})]},a.category)})})})]})]})]})}function MEe({report:e}){const t=e.gsc;return t?o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Section 5",title:"GSC performance",subtitle:"Your site's performance in Google's regular (non-AI) search results — top queries, intent breakdown, and the click trend, sourced from Google Search Console for the most recent sync window."}),o.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[o.jsx(Qt,{label:"Clicks",value:it(t.totalClicks)}),o.jsx(Qt,{label:"Impressions",value:it(t.totalImpressions)}),o.jsx(Qt,{label:"CTR",value:MA(t.ctr)}),o.jsx(Qt,{label:"Avg position",value:t.avgPosition.toFixed(1)})]}),t.trend.length>0&&o.jsxs("div",{className:"mt-4",children:[o.jsx("p",{className:"eyebrow mb-2",children:"Clicks over time"}),o.jsx("div",{className:"h-56 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",children:o.jsx(zs,{width:"100%",height:"100%",children:o.jsxs(DA,{data:t.trend,margin:{left:8,right:12,top:8,bottom:8},children:[o.jsx(pc,{stroke:dd}),o.jsx(Ya,{dataKey:"date",tick:Jn,stroke:Nr,tickFormatter:hd}),o.jsx(Wa,{tick:Jn,stroke:Nr}),o.jsx(Ds,{...ua,labelFormatter:fd}),o.jsx(Hx,{type:"monotone",dataKey:"clicks",stroke:qi[0],strokeWidth:2,dot:!0})]})})})]}),t.topQueries.length>0&&o.jsx(IEe,{rows:t.topQueries}),t.categoryBreakdown.length>0&&o.jsxs("div",{className:"mt-4",children:[o.jsx("p",{className:"eyebrow mb-2",children:"Query categories"}),o.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-4",children:t.categoryBreakdown.map(n=>o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-3 py-2",children:[o.jsx("p",{className:"eyebrow-soft",children:n.category}),o.jsxs("p",{className:"text-base font-semibold text-zinc-100",children:[it(n.clicks)," clicks"]}),o.jsxs("p",{className:"text-[11px] text-zinc-500",children:[Ms(n.sharePct)," share · ",it(n.impressions)," impressions"]})]},n.category))})]}),(t.trackedButNoGsc.length>0||t.gscButNotTracked.length>0)&&o.jsxs("div",{className:"mt-4 grid gap-3 lg:grid-cols-2",children:[t.trackedButNoGsc.length>0&&o.jsx(OL,{title:"Tracked but no GSC impressions",tone:"caution",items:t.trackedButNoGsc}),t.gscButNotTracked.length>0&&o.jsx(OL,{title:"GSC queries not yet tracked",tone:"neutral",items:t.gscButNotTracked})]})]}):o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Section 5",title:"GSC performance",subtitle:"Your site's performance in Google's regular (non-AI) search results — top queries, intent breakdown, and the click trend, sourced from Google Search Console for the most recent sync window."}),o.jsx(mr,{message:"Google Search Console is not connected for this project."})]})}function IEe({rows:e}){return o.jsxs("div",{className:"mt-4",children:[o.jsx("p",{className:"eyebrow mb-2",children:"Top queries"}),o.jsx("div",{className:"evidence-table-wrap",children:o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Query"}),o.jsx("th",{children:"Category"}),o.jsx("th",{children:"Clicks"}),o.jsx("th",{children:"Impr."}),o.jsx("th",{children:"CTR"}),o.jsx("th",{children:"Pos."})]})}),o.jsx("tbody",{children:e.map(t=>o.jsxs("tr",{children:[o.jsx("td",{className:"evidence-query-cell",children:t.query}),o.jsx("td",{className:"text-xs text-zinc-400",children:t.category}),o.jsx("td",{children:it(t.clicks)}),o.jsx("td",{children:it(t.impressions)}),o.jsx("td",{children:MA(t.ctr)}),o.jsx("td",{children:t.avgPosition.toFixed(1)})]},t.query))})]})})]})}function OL({title:e,items:t,tone:n}){return o.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("p",{className:"eyebrow",children:e}),o.jsx(Xe,{tone:n,children:t.length})]}),o.jsxs("ul",{className:"mt-2 space-y-1 text-xs text-zinc-400",children:[t.slice(0,8).map(r=>o.jsxs("li",{className:"truncate",children:["· ",r]},r)),t.length>8&&o.jsxs("li",{className:"text-zinc-600",children:["+ ",t.length-8," more"]})]})]})}function LEe({report:e}){const t=e.ga;return t?o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Section 6",title:"GA4 traffic",subtitle:`Total sessions and users on your site between ${md(t.periodStart)} and ${md(t.periodEnd)}, with top landing pages and channel breakdown — sourced from Google Analytics 4.`}),o.jsxs("div",{className:"mt-3 grid gap-3 sm:grid-cols-3",children:[o.jsx(Qt,{label:"Sessions",value:it(t.totalSessions)}),o.jsx(Qt,{label:"Users",value:it(t.totalUsers)}),o.jsx(Qt,{label:"Organic sessions",value:it(t.totalOrganicSessions)})]}),t.topLandingPages.length>0&&o.jsxs("div",{className:"mt-4",children:[o.jsx("p",{className:"eyebrow mb-2",children:"Top landing pages"}),o.jsx("div",{className:"evidence-table-wrap",children:o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Page"}),o.jsx("th",{children:"Sessions"}),o.jsx("th",{children:"Users"}),o.jsx("th",{children:"Organic"})]})}),o.jsx("tbody",{children:t.topLandingPages.slice(0,12).map(n=>o.jsxs("tr",{children:[o.jsx("td",{className:"evidence-query-cell text-xs",children:n.page}),o.jsx("td",{children:it(n.sessions)}),o.jsx("td",{children:it(n.users)}),o.jsx("td",{children:it(n.organicSessions)})]},n.page))})]})})]}),t.channelBreakdown.length>0&&o.jsxs("div",{className:"mt-4",children:[o.jsx("p",{className:"eyebrow mb-2",children:"Channel breakdown"}),o.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-4",children:t.channelBreakdown.map(n=>o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-3 py-2",children:[o.jsx("p",{className:"eyebrow-soft",children:n.channel}),o.jsx("p",{className:"text-base font-semibold text-zinc-100",children:it(n.sessions)}),o.jsx("p",{className:"text-[11px] text-zinc-500",children:Ms(n.sharePct)})]},n.channel))})]})]}):o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Section 6",title:"GA4 traffic",subtitle:"Total sessions and users on your site, with top landing pages and channel breakdown — sourced from Google Analytics 4."}),o.jsx(mr,{message:"Google Analytics 4 is not connected for this project."})]})}function $Ee({report:e}){const t=e.socialReferrals;return t?o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Section 7",title:"Social referrals",subtitle:"Sessions on your site sent by social platforms (LinkedIn, Facebook, X, etc.) — paid versus organic split with the top driving campaigns. Sourced from Google Analytics 4."}),o.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[o.jsx(Qt,{label:"Total sessions",value:it(t.totalSessions)}),o.jsx(Qt,{label:"Organic",value:it(t.organicSessions)}),o.jsx(Qt,{label:"Paid",value:it(t.paidSessions)})]}),t.channels.length>0&&o.jsxs("div",{className:"mt-4",children:[o.jsx("p",{className:"eyebrow mb-2",children:"By channel"}),o.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-4",children:t.channels.map(n=>o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-3 py-2",children:[o.jsx("p",{className:"eyebrow-soft",children:n.channelGroup}),o.jsx("p",{className:"text-base font-semibold text-zinc-100",children:it(n.sessions)}),o.jsx("p",{className:"text-[11px] text-zinc-500",children:Ms(n.sharePct)})]},n.channelGroup))})]}),t.topCampaigns.length>0&&o.jsxs("div",{className:"mt-4",children:[o.jsx("p",{className:"eyebrow mb-2",children:"Top campaigns"}),o.jsx("div",{className:"evidence-table-wrap",children:o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Source"}),o.jsx("th",{children:"Medium"}),o.jsx("th",{children:"Sessions"})]})}),o.jsx("tbody",{children:t.topCampaigns.map((n,r)=>o.jsxs("tr",{children:[o.jsx("td",{children:n.source}),o.jsx("td",{className:"text-xs text-zinc-400",children:n.medium}),o.jsx("td",{children:it(n.sessions)})]},`${n.source}-${n.medium}-${r}`))})]})})]})]}):o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Section 7",title:"Social referrals",subtitle:"Sessions on your site sent by social platforms (LinkedIn, Facebook, X, etc.) — paid versus organic split with the top driving campaigns. Sourced from Google Analytics 4."}),o.jsx(mr,{message:"No social referral data."})]})}function BEe({report:e}){const t=e.aiReferrals;return t?o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Section 8",title:"AI referral traffic",subtitle:"Sessions on your site referred by AI answer engines (ChatGPT, Perplexity, Claude, Copilot, Gemini, etc.) — broken down by referrer with a daily trend and the top landing pages. Sourced from Google Analytics 4."}),o.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[o.jsx(Qt,{label:"Sessions",value:it(t.totalSessions)}),o.jsx(Qt,{label:"Users",value:it(t.totalUsers)})]}),t.trend.length>0&&o.jsxs("div",{className:"mt-4",children:[o.jsx("p",{className:"eyebrow mb-2",children:"AI sessions trend"}),o.jsx("div",{className:"h-48 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",children:o.jsx(zs,{width:"100%",height:"100%",children:o.jsxs(DA,{data:t.trend,margin:{left:8,right:12,top:8,bottom:8},children:[o.jsx(pc,{stroke:dd}),o.jsx(Ya,{dataKey:"date",tick:Jn,stroke:Nr,tickFormatter:hd}),o.jsx(Wa,{tick:Jn,stroke:Nr}),o.jsx(Ds,{...ua,labelFormatter:fd}),o.jsx(Hx,{type:"monotone",dataKey:"sessions",stroke:qi[0],strokeWidth:2,dot:!1})]})})})]}),t.bySource.length>0&&o.jsxs("div",{className:"mt-4",children:[o.jsx("p",{className:"eyebrow mb-2",children:"By source"}),o.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-4",children:t.bySource.map(n=>o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-3 py-2",children:[o.jsx("p",{className:"eyebrow-soft",children:n.source}),o.jsx("p",{className:"text-base font-semibold text-zinc-100",children:it(n.sessions)}),o.jsxs("p",{className:"text-[11px] text-zinc-500",children:[it(n.users)," users · ",Ms(n.sharePct)]})]},n.source))})]}),t.topLandingPages.length>0&&o.jsxs("div",{className:"mt-4",children:[o.jsx("p",{className:"eyebrow mb-2",children:"Top AI landing pages"}),o.jsx("div",{className:"evidence-table-wrap",children:o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Page"}),o.jsx("th",{children:"Sessions"}),o.jsx("th",{children:"Users"})]})}),o.jsx("tbody",{children:t.topLandingPages.map(n=>o.jsxs("tr",{children:[o.jsx("td",{className:"evidence-query-cell text-xs",children:n.page}),o.jsx("td",{children:it(n.sessions)}),o.jsx("td",{children:it(n.users)})]},n.page))})]})})]})]}):o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Section 8",title:"AI referral traffic",subtitle:"Sessions on your site referred by AI answer engines (ChatGPT, Perplexity, Claude, Copilot, Gemini, etc.) — broken down by referrer with a daily trend and the top landing pages. Sourced from Google Analytics 4."}),o.jsx(mr,{message:"No AI referral data."})]})}function UEe({report:e}){const t=e.indexingHealth;if(!t||!t.provider)return o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Section 9",title:"Indexing health",subtitle:"What share of your tracked URLs are currently indexed in Google or Bing — connect Google Search Console or Bing Webmaster Tools to populate this section."}),o.jsx(mr,{message:"No indexing data — connect Google Search Console or Bing Webmaster Tools."})]});const n=t.indexedPct>=90?"positive":t.indexedPct>=70?"caution":"negative",r=`What share of your tracked URLs are currently indexed in ${t.provider==="google"?"Google":"Bing"} — sourced from ${t.provider==="google"?"Google Search Console URL Inspection":"Bing Webmaster Tools URL Inspection"}. Pages absent from the index can't be retrieved by AI engines either.`;return o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Section 9",title:`Indexing health — ${t.provider}`,subtitle:r}),o.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-5",children:[o.jsx(Qt,{label:"Indexed",value:Ms(t.indexedPct,0),tone:n}),o.jsx(Qt,{label:"Total pages",value:it(t.total)}),o.jsx(Qt,{label:"Indexed pages",value:it(t.indexed)}),o.jsx(Qt,{label:"Not indexed",value:it(t.notIndexed)}),o.jsx(qEe,{ih:t})]})]})}function qEe({ih:e}){return e.provider==="google"?o.jsx(Qt,{label:"Deindexed",value:it(e.deindexed)}):o.jsx(Qt,{label:"Unknown",value:it(e.unknown)})}function FEe({report:e}){const t=e.citationsTrend;return t.length===0?o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Section 10",title:"Citations over time",subtitle:"Citation rate across every visibility sweep — the share of tracked queries cited by at least one provider, with a per-provider breakdown beneath. Computed per-query so the headline stays comparable across runs that ran a different mix of providers."}),o.jsx(mr,{message:"Run multiple visibility sweeps to see a trend."})]}):xEe(t)?o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Section 10",title:"Citations over time",subtitle:"Citation rate across every visibility sweep — the share of tracked queries cited by at least one provider, with a per-provider breakdown beneath. Computed per-query so the headline stays comparable across runs that ran a different mix of providers."}),o.jsx(mr,{message:`Establishing baseline (${t.length} of ${LF} runs collected). Trend will appear once more sweeps are recorded.`})]}):o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Section 10",title:"Citations over time",subtitle:"Citation rate across every visibility sweep — the share of tracked queries cited by at least one provider, with a per-provider breakdown beneath. Computed per-query so the headline stays comparable across runs that ran a different mix of providers."}),o.jsx("div",{className:"h-64 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",children:o.jsx(zs,{width:"100%",height:"100%",children:o.jsxs(DA,{data:t,margin:{left:8,right:12,top:8,bottom:8},children:[o.jsx(pc,{stroke:dd}),o.jsx(Ya,{dataKey:"date",tick:Jn,stroke:Nr,tickFormatter:hd}),o.jsx(Wa,{tick:Jn,stroke:Nr,domain:[0,100],tickFormatter:n=>`${n}%`}),o.jsx(Ds,{...ua,labelFormatter:fd,formatter:n=>`${n}%`}),o.jsx(Hx,{type:"monotone",dataKey:"citationRate",stroke:qi[0],strokeWidth:2,dot:!0})]})})}),o.jsx(HEe,{trend:t})]})}function HEe({trend:e}){return e.length===0?null:o.jsxs("div",{className:"mt-4",children:[o.jsx("p",{className:"eyebrow mb-2",children:"Run-by-run breakdown"}),o.jsx("div",{className:"evidence-table-wrap",children:o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Run"}),o.jsx("th",{children:"Cited queries"}),o.jsx("th",{children:"Per-provider rates"})]})}),o.jsx("tbody",{children:e.map(t=>o.jsxs("tr",{children:[o.jsx("td",{className:"evidence-query-cell",children:md(t.date)}),o.jsxs("td",{children:[t.citationRate,"% ",o.jsxs("span",{className:"text-zinc-500",children:["(",t.citedQueryCount,"/",t.totalQueryCount,")"]})]}),o.jsx("td",{className:"text-xs text-zinc-400",children:t.providerRates.map(n=>`${n.provider}: ${n.citationRate}%`).join(" · ")})]},t.runId))})]})})]})}function KEe({report:e}){return e.insights.length===0?o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Section 11",title:"Insights & alerts",subtitle:"Regressions (citations lost), gains (citations won), and opportunities surfaced by the intelligence engine across the most recent sweeps — ordered by severity and recurrence."}),o.jsx(mr,{message:"No active insights — everything looks stable."})]}):o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Section 11",title:"Insights & alerts",subtitle:"Regressions (citations lost), gains (citations won), and opportunities surfaced by the intelligence engine across the most recent sweeps — ordered by severity and recurrence."}),o.jsx("div",{className:"evidence-table-wrap",children:o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Severity"}),o.jsx("th",{children:"Title"}),o.jsx("th",{children:"Query"}),o.jsx("th",{children:"Provider"}),o.jsx("th",{children:"Recommendation"})]})}),o.jsx("tbody",{children:e.insights.map(t=>o.jsxs("tr",{children:[o.jsxs("td",{children:[o.jsx(Xe,{tone:bEe[t.severity],children:ste(t.severity)}),t.instanceCount>1&&o.jsxs("span",{className:"ml-2 text-[11px] text-zinc-500",children:["×",t.instanceCount]})]}),o.jsx("td",{className:"evidence-query-cell",children:t.title}),o.jsx("td",{className:"text-xs text-zinc-400",children:t.query}),o.jsx("td",{className:"text-xs text-zinc-400",children:t.provider}),o.jsx("td",{className:"text-xs text-zinc-400",children:t.recommendation??"—"})]},t.id))})]})})]})}function GEe({report:e}){if(e.contentOpportunities.length===0)return null;const t=e.meta.project.canonicalDomain;return o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Section 12",title:"Content opportunities",subtitle:"Queries where you have search demand or competitor citation pressure but aren't winning AI citations. Each row pairs a suggested action with the signals driving the opportunity score (0–100, higher = stronger), the best matching page on your domain, and the competitor URL the AI most often cites. Top 10 shown."}),o.jsx("div",{className:"evidence-table-wrap",children:o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Query"}),o.jsx("th",{children:"Action"}),o.jsx("th",{title:"Opportunity score (0–100)",children:"Score"}),o.jsx("th",{children:"Why"}),o.jsx("th",{children:"Our page"}),o.jsx("th",{children:"Winning competitor"}),o.jsx("th",{children:"Confidence"})]})}),o.jsx("tbody",{children:e.contentOpportunities.slice(0,10).map(n=>o.jsxs("tr",{children:[o.jsx("td",{className:"evidence-query-cell",children:n.query}),o.jsx("td",{children:o.jsx(Xe,{tone:"neutral",children:A$(n.action)})}),o.jsxs("td",{title:"Opportunity score (0–100)",children:[Math.round(n.score),o.jsx("span",{className:"text-zinc-600",children:" / 100"})]}),o.jsx("td",{className:"text-xs text-zinc-400",children:n.drivers.length>0?o.jsx("ul",{className:"list-disc pl-4 space-y-0.5",children:n.drivers.map((r,i)=>o.jsx("li",{children:r},i))}):o.jsx("span",{className:"text-zinc-600",children:"No driver signal yet"})}),o.jsx("td",{className:"text-xs",children:n.ourBestPage?o.jsx("a",{href:ete(n.ourBestPage.url,t),target:"_blank",rel:"noreferrer",className:"text-blue-400 hover:underline break-all",children:n.ourBestPage.url}):o.jsx("span",{className:"text-zinc-600",children:"No page yet"})}),o.jsx("td",{className:"text-xs",children:n.winningCompetitor?o.jsx("a",{href:n.winningCompetitor.url,target:"_blank",rel:"noreferrer",className:"text-blue-400 hover:underline",children:n.winningCompetitor.domain}):o.jsx("span",{className:"text-zinc-600",children:"—"})}),o.jsx("td",{children:o.jsx(Xe,{tone:"neutral",children:Fee(n.actionConfidence)})})]},n.targetRef))})]})})]})}function VEe({report:e}){return e.contentGaps.length===0?null:o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Section 13",title:"Content gaps",subtitle:"Tracked queries where multiple competitors are cited by AI engines but you are not — explicit “they're answering, you're missing” signal. Sorted by recent miss rate, then by competitor count. Top 10 shown."}),o.jsx("div",{className:"evidence-table-wrap",children:o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Query"}),o.jsx("th",{children:"Competitors cited"}),o.jsx("th",{children:"Domains"}),o.jsx("th",{children:"Miss rate"})]})}),o.jsx("tbody",{children:e.contentGaps.slice(0,10).map(t=>{const n=t.competitorDomains.slice(0,5),r=t.competitorDomains.length-n.length;return o.jsxs("tr",{children:[o.jsx("td",{className:"evidence-query-cell",children:t.query}),o.jsx("td",{children:t.competitorCount}),o.jsxs("td",{className:"text-xs text-zinc-400",children:[n.join(", "),r>0?`, +${r} more`:""]}),o.jsxs("td",{children:[Math.round(t.missRate*100),"%"]})]},t.query)})})]})})]})}function QEe({report:e}){return e.recommendedNextSteps.length===0?o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Section 14",title:"Recommended next steps",subtitle:"Action items bucketed by horizon (immediate, short-term, medium-term), drawn from open insights and the highest-ranked content opportunities."}),o.jsx(mr,{message:"No prioritized actions yet."})]}):o.jsxs("section",{className:"page-section-divider",children:[o.jsx(Dt,{eyebrow:"Section 14",title:"Recommended next steps",subtitle:"Action items bucketed by horizon (immediate, short-term, medium-term), drawn from open insights and the highest-ranked content opportunities."}),o.jsx("div",{className:"grid gap-3 lg:grid-cols-3",children:["immediate","short-term","medium-term"].map(t=>{const n=e.recommendedNextSteps.filter(i=>i.horizon===t);if(n.length===0)return null;const r=t==="immediate"?"negative":t==="short-term"?"caution":"neutral";return o.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[o.jsx(Xe,{tone:r,children:T$(t)}),o.jsx("ul",{className:"mt-3 space-y-3",children:n.map((i,a)=>o.jsxs("li",{children:[o.jsx("p",{className:"text-sm font-medium text-zinc-100",children:i.title}),o.jsx("p",{className:"text-xs text-zinc-500",children:i.rationale})]},a))})]},t)})})]})}function Dt({eyebrow:e,title:t,subtitle:n}){return o.jsxs("div",{className:"mb-3",children:[o.jsx("p",{className:"eyebrow-soft",children:e}),o.jsx("h2",{className:"page-title",children:t}),n&&o.jsx("p",{className:"page-subtitle mt-1",children:n})]})}function mr({message:e}){return o.jsx("p",{className:"text-sm text-zinc-500 py-4 text-center",children:e})}function YEe({project:e,onUpdateProject:t,onRefresh:n}){const[r,i]=x.useState(!1),[a,l]=x.useState(!1),[u,d]=x.useState(null),[f,p]=x.useState(e.displayName),[m,g]=x.useState(e.canonicalDomain),[v,S]=x.useState(e.country),[b,j]=x.useState(e.language),[k,E]=x.useState(e.ownedDomains??[]),[C,A]=x.useState(""),[P,O]=x.useState(null),[_,T]=x.useState(!1),[$,F]=x.useState(!1),[U,B]=x.useState(""),[V,X]=x.useState(""),[Z,H]=x.useState(""),[J,oe]=x.useState(""),[ye,I]=x.useState("");x.useEffect(()=>{r||(p(e.displayName),g(e.canonicalDomain),S(e.country),j(e.language),E(e.ownedDomains??[]))},[e,r]);function M(){i(!1),d(null),p(e.displayName),g(e.canonicalDomain),S(e.country),j(e.language),E(e.ownedDomains??[]),A("")}function q(){const W=C.trim();W&&(k.includes(W)||E([...k,W]),A(""))}function D(W){E(k.filter(He=>He!==W))}async function G(){if(!(!f.trim()||!m.trim()||!v.trim()||!b.trim())){l(!0),d(null);try{await t(e.name,{displayName:f.trim(),canonicalDomain:m.trim(),ownedDomains:k,country:v.trim(),language:b.trim()}),i(!1),vt({title:"Project settings saved",detail:`${f.trim()} was updated.`,tone:"positive",dedupeKey:`project:update:${e.name}`,dedupeMode:"replace"})}catch(W){d(W instanceof Error?W.message:"Failed to save")}finally{l(!1)}}}async function se(){const W=U.trim(),He=V.trim(),Te=Z.trim(),st=J.trim();if(!(!W||!He||!Te||!st)){T(!0),O(null);try{const Ve={label:W,city:He,region:Te,country:st};ye.trim()&&(Ve.timezone=ye.trim()),await QG(e.name,Ve),n(),B(""),X(""),H(""),oe(""),I(""),F(!1),vt({title:"Location added",detail:`${W} is now available for ${e.name}.`,tone:"positive",dedupeKey:`project:location:add:${e.name}:${W}`,dedupeMode:"drop"})}catch(Ve){O(Ve instanceof Error?Ve.message:"Failed to add location")}finally{T(!1)}}}async function ne(W){T(!0),O(null);try{await YG(e.name,W),n(),vt({title:"Location removed",detail:`${W} was removed from ${e.name}.`,tone:"positive",dedupeKey:`project:location:remove:${e.name}:${W}`,dedupeMode:"drop"})}catch(He){O(He instanceof Error?He.message:"Failed to remove location")}finally{T(!1)}}async function Ce(W){T(!0),O(null);try{await WG(e.name,W),n(),vt({title:"Default location updated",detail:`${W} is now the default for ${e.name}.`,tone:"positive",dedupeKey:`project:location:default:${e.name}`,dedupeMode:"replace"})}catch(He){O(He instanceof Error?He.message:"Failed to set default location")}finally{T(!1)}}const je=f!==e.displayName||m!==e.canonicalDomain||v!==e.country||b!==e.language||JSON.stringify(k)!==JSON.stringify(e.ownedDomains??[]),ee="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",pe="block text-xs font-medium text-zinc-400 mb-1",Ee=U.trim()&&V.trim()&&Z.trim()&&J.trim();return o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Configuration"}),o.jsx("h2",{children:"Project settings"})]}),!r&&o.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>i(!0),children:"Edit settings"})]}),u&&o.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:[u,o.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>d(null),children:"×"})]}),r?o.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:pe,children:"Display name"}),o.jsx("input",{className:ee,type:"text",value:f,onChange:W=>p(W.target.value),placeholder:"My Project"})]}),o.jsxs("div",{children:[o.jsx("label",{className:pe,children:"Canonical domain"}),o.jsx("input",{className:ee,type:"text",value:m,onChange:W=>g(W.target.value),placeholder:"example.com"})]}),o.jsxs("div",{children:[o.jsx("label",{className:pe,children:"Country"}),o.jsx("input",{className:ee,type:"text",value:v,onChange:W=>S(W.target.value),placeholder:"US",maxLength:2})]}),o.jsxs("div",{children:[o.jsx("label",{className:pe,children:"Language"}),o.jsx("input",{className:ee,type:"text",value:b,onChange:W=>j(W.target.value),placeholder:"en"})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:pe,children:"Owned domains"}),o.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:k.map(W=>o.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:[W,o.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>D(W),"aria-label":`Remove ${W}`,children:"×"})]},W))}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{className:`${ee} flex-1`,type:"text",placeholder:"docs.example.com",value:C,onChange:W=>A(W.target.value),onKeyDown:W=>W.key==="Enter"&&(W.preventDefault(),q())}),o.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:!C.trim(),onClick:q,children:"Add"})]})]}),o.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[o.jsx(be,{type:"button",disabled:a||!je||!f.trim()||!m.trim(),onClick:G,children:a?"Saving...":"Save changes"}),o.jsx(be,{type:"button",variant:"outline",disabled:a,onClick:M,children:"Cancel"})]})]}):o.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:o.jsx("table",{className:"w-full text-sm",children:o.jsxs("tbody",{children:[o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium w-40",children:"Display name"}),o.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.displayName||"—"})]}),o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Canonical domain"}),o.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.canonicalDomain})]}),o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Owned domains"}),o.jsx("td",{className:"px-4 py-2.5",children:(e.ownedDomains??[]).length>0?o.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.ownedDomains.map(W=>o.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:W},W))}):o.jsx("span",{className:"text-zinc-500",children:"—"})})]}),o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Country"}),o.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.country})]}),o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Language"}),o.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.language})]}),o.jsxs("tr",{children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium align-top pt-3",children:"Locations"}),o.jsxs("td",{className:"px-4 py-2.5",children:[P&&o.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:[P,o.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>O(null),children:"×"})]}),(e.locations??[]).length>0?o.jsxs("table",{className:"w-full text-xs mb-2",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"text-zinc-600",children:[o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Label"}),o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"City"}),o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Region"}),o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Country"}),o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Timezone"}),o.jsx("th",{className:"pb-1"})]})}),o.jsx("tbody",{children:e.locations.map(W=>o.jsxs("tr",{className:"border-t border-zinc-800/30",children:[o.jsx("td",{className:"py-1.5 pr-3",children:o.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${W.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:[W.label,W.label===e.defaultLocation?" ★":""]})}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:W.city}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:W.region}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:W.country}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:W.timezone??"—"}),o.jsx("td",{className:"py-1.5",children:o.jsxs("div",{className:"flex items-center gap-1.5",children:[W.label!==e.defaultLocation&&o.jsx("button",{type:"button",disabled:_,onClick:()=>Ce(W.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${W.label} as default location`,children:"Set default"}),o.jsx("button",{type:"button",disabled:_,onClick:()=>ne(W.label),className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${W.label}`,children:"Remove"})]})})]},W.label))})]}):o.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),$?o.jsxs("div",{className:"mt-2 rounded border border-zinc-800 bg-zinc-900/50 p-3 space-y-2",children:[o.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-zinc-500",children:"Add location"}),o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Label *"}),o.jsx("input",{className:ee,type:"text",value:U,onChange:W=>B(W.target.value),placeholder:"nyc"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"City *"}),o.jsx("input",{className:ee,type:"text",value:V,onChange:W=>X(W.target.value),placeholder:"New York"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Region *"}),o.jsx("input",{className:ee,type:"text",value:Z,onChange:W=>H(W.target.value),placeholder:"NY"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Country *"}),o.jsx("input",{className:ee,type:"text",value:J,onChange:W=>oe(W.target.value),placeholder:"US",maxLength:2})]}),o.jsxs("div",{className:"col-span-2",children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Timezone (optional)"}),o.jsx("input",{className:ee,type:"text",value:ye,onChange:W=>I(W.target.value),placeholder:"America/New_York"})]})]}),o.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[o.jsx(be,{type:"button",size:"sm",disabled:_||!Ee,onClick:se,children:_?"Adding...":"Add location"}),o.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:_,onClick:()=>{F(!1),O(null)},children:"Cancel"})]})]}):o.jsx(be,{type:"button",size:"sm",variant:"outline",onClick:()=>F(!0),children:"+ Add location"})]})]})]})})})]})}const WEe=[{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"}],EL=["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 ZEe({projectName:e}){const[t,n]=x.useState("loading"),[r,i]=x.useState(!1),[a,l]=x.useState("daily"),[u,d]=x.useState(6),[f,p]=x.useState(""),[m,g]=x.useState("UTC"),[v,S]=x.useState(!1),[b,j]=x.useState(""),[k,E]=x.useState(!1),[C,A]=x.useState(!1),[P,O]=x.useState(null);x.useEffect(()=>{iV(e).then(n).catch(()=>n(null))},[e]);const _=()=>{if(t&&t!=="loading"){const U=mte(t.preset??null,t.cronExpr);l(U.freq),d(U.hour),p(U.customCron);const B=EL.includes(t.timezone);g(B?t.timezone:"Other"),S(!B),j(B?"":t.timezone)}else l("daily"),d(6),p(""),g("UTC"),S(!1),j("");O(null),i(!0)},T=async()=>{E(!0),O(null);try{const B={timezone:v?b.trim()||"UTC":m};a==="custom"?B.cron=f.trim():B.preset=pte(a,u);const V=await v2(e,B);n(V),i(!1),vt({title:"Schedule saved",detail:Sw(V.preset??null,V.cronExpr,V.timezone),tone:"positive",dedupeKey:`schedule:${e}`,dedupeMode:"replace"})}catch(U){O(U instanceof Error?U.message:"Failed to save schedule")}finally{E(!1)}},$=async()=>{if(!(!t||t==="loading")){E(!0),O(null);try{const U={timezone:t.timezone,enabled:!t.enabled};t.preset?U.preset=t.preset:U.cron=t.cronExpr;const B=await v2(e,U);n(B),vt({title:B.enabled?"Schedule resumed":"Schedule paused",detail:Sw(B.preset??null,B.cronExpr,B.timezone),tone:"positive",dedupeKey:`schedule:toggle:${e}`,dedupeMode:"replace"})}catch(U){O(U instanceof Error?U.message:"Failed to update schedule")}finally{E(!1)}}},F=async()=>{A(!0),O(null);try{await aV(e),n(null),i(!1),vt({title:"Schedule removed",detail:`${e} will no longer run automatically.`,tone:"positive",dedupeKey:`schedule:remove:${e}`,dedupeMode:"drop"})}catch(U){O(U instanceof Error?U.message:"Failed to remove schedule")}finally{A(!1)}};return o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),o.jsx("h2",{children:"Scheduled runs"})]}),t!=="loading"&&!r&&o.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:_,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&o.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!r&&t===null&&o.jsx($e,{className:"surface-card compact-card",children:o.jsx("p",{className:"supporting-copy",children:"No schedule configured. Set one to automatically trigger visibility sweeps."})}),t!=="loading"&&!r&&t!==null&&o.jsxs($e,{className:"surface-card compact-card",children:[o.jsxs("div",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-sm font-medium text-zinc-200",children:Sw(t.preset??null,t.cronExpr,t.timezone)}),o.jsxs("p",{className:"text-xs text-zinc-500",children:["Cron: ",o.jsx("span",{className:"font-mono",children:t.cronExpr})]}),t.nextRunAt&&o.jsxs("p",{className:"text-xs text-zinc-500",children:["Next run: ",new Date(t.nextRunAt).toLocaleString()]}),t.lastRunAt&&o.jsxs("p",{className:"text-xs text-zinc-500",children:["Last run: ",new Date(t.lastRunAt).toLocaleString()]})]}),o.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[o.jsx(Xe,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),o.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:k,onClick:$,children:t.enabled?"Pause":"Resume"}),o.jsx(be,{type:"button",variant:"ghost",size:"sm",disabled:C,onClick:F,children:C?"Removing...":"Remove"})]})]}),P&&o.jsx("p",{className:"text-rose-400 text-sm mt-2",children:P})]}),r&&o.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Frequency"}),o.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:a,onChange:U=>l(U.target.value),children:WEe.map(U=>o.jsx("option",{value:U.value,children:U.label},U.value))})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Time"}),o.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:u,disabled:a==="twice-daily"||a==="custom",onChange:U=>d(parseInt(U.target.value)),children:Array.from({length:24},(U,B)=>o.jsx("option",{value:B,children:Jj(B)},B))})]})]}),a==="custom"&&o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Cron expression"}),o.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:f,onChange:U=>p(U.target.value)})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Timezone"}),o.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":m,onChange:U=>{U.target.value==="Other"?(S(!0),g("Other")):(S(!1),g(U.target.value))},children:[EL.map(U=>o.jsx("option",{value:U,children:U},U)),o.jsxs("option",{value:"Other",children:["Other (enter manually)","…"]})]}),v&&o.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:b,onChange:U=>j(U.target.value)})]}),P&&o.jsx("p",{className:"text-rose-400 text-sm",children:P}),o.jsxs("div",{className:"flex gap-2 justify-end",children:[o.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),O(null)},children:"Cancel"}),o.jsx(be,{type:"button",size:"sm",disabled:k||a==="custom"&&!f.trim(),onClick:T,children:k?"Saving...":"Save schedule"})]})]})]})}const XEe=[{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 JEe({projectName:e}){const[t,n]=x.useState("loading"),[r,i]=x.useState(!1),[a,l]=x.useState(""),[u,d]=x.useState(["citation.lost","citation.gained"]),[f,p]=x.useState(!1),[m,g]=x.useState(null),[v,S]=x.useState({}),[b,j]=x.useState(new Set);x.useEffect(()=>{sV(e).then(n).catch(()=>n([]))},[e]);const k=P=>{d(O=>O.includes(P)?O.filter(_=>_!==P):[...O,P])},E=async()=>{if(!(!a.trim()||u.length===0)){p(!0),g(null);try{const P=await oV(e,{channel:"webhook",url:a.trim(),events:u});n(O=>O==="loading"?[P]:[...O,P]),l(""),d(["citation.lost","citation.gained"]),i(!1),vt({title:"Webhook added",detail:`Notifications will be sent to ${P.url}.`,tone:"positive",dedupeKey:`notification:add:${e}`,dedupeMode:"drop"})}catch(P){g(P instanceof Error?P.message:"Failed to add webhook")}finally{p(!1)}}},C=async P=>{if(!b.has(P)){j(O=>new Set(O).add(P));try{await lV(e,P),n(O=>O==="loading"?O:O.filter(_=>_.id!==P)),vt({title:"Webhook removed",detail:`${e} no longer sends notifications to this endpoint.`,tone:"positive",dedupeKey:`notification:remove:${e}:${P}`,dedupeMode:"drop"})}catch(O){g(O instanceof Error?O.message:"Failed to remove webhook")}finally{j(O=>{const _=new Set(O);return _.delete(P),_})}}},A=async P=>{S(O=>({...O,[P]:{state:"testing"}}));try{const O=await cV(e,P);S(_=>({..._,[P]:{state:O.ok?"ok":"fail",status:O.status}})),O.ok&&vt({title:"Test notification sent",detail:`Webhook returned status ${O.status}.`,tone:"positive",dedupeKey:`notification:test:${e}:${P}`,dedupeMode:"replace"})}catch{S(O=>({...O,[P]:{state:"fail"}}))}};return o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),o.jsx("h2",{children:"Notifications"})]}),t!=="loading"&&o.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!r),g(null)},children:r?"Cancel":"+ Add webhook"})]}),r&&o.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Webhook URL"}),o.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:a,onChange:P=>l(P.target.value)})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Trigger on"}),o.jsx("div",{className:"flex flex-wrap gap-3",children:XEe.map(P=>o.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[o.jsx("input",{type:"checkbox",className:"rounded border-zinc-600 bg-zinc-800",checked:u.includes(P.value),onChange:()=>k(P.value)}),o.jsx("span",{className:"text-sm text-zinc-300",children:P.label})]},P.value))})]}),m&&o.jsx("p",{className:"text-rose-400 text-sm",children:m}),o.jsxs("div",{className:"flex gap-2 justify-end",children:[o.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),g(null)},children:"Cancel"}),o.jsx(be,{type:"button",size:"sm",disabled:f||!a.trim()||u.length===0,onClick:E,children:f?"Adding...":"Add webhook"})]})]}),t==="loading"&&o.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!r&&o.jsx($e,{className:"surface-card compact-card",children:o.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&&o.jsxs("div",{className:"evidence-table-wrap",children:[o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Endpoint"}),o.jsx("th",{children:"Events"}),o.jsx("th",{children:"Status"}),o.jsx("th",{})]})}),o.jsx("tbody",{children:t.map(P=>o.jsxs("tr",{children:[o.jsx("td",{className:"evidence-query-cell",children:o.jsx("span",{className:"font-mono text-xs text-zinc-300 break-all",title:P.urlHost,children:P.urlDisplay??P.url})}),o.jsx("td",{children:o.jsx("div",{className:"flex flex-wrap gap-1",children:P.events.map(O=>o.jsx("span",{className:"inline-flex items-center rounded-full border border-zinc-700 bg-zinc-800/60 px-2 py-0.5 text-[10px] font-medium text-zinc-400 uppercase tracking-wide",children:O.replace("."," ")},O))})}),o.jsx("td",{children:o.jsx(Xe,{tone:P.enabled?"positive":"neutral",children:P.enabled?"Active":"Paused"})}),o.jsx("td",{children:o.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[v[P.id]&&(()=>{const O=v[P.id],_=O.state==="testing"?"Sending…":O.state==="ok"?`Delivered${O.status?` (${O.status})`:""}`:`Failed${O.status?` (${O.status})`:""}`;return o.jsx(Xe,{tone:O.state==="ok"?"positive":O.state==="fail"?"negative":"neutral",children:_})})(),o.jsx(be,{variant:"ghost",size:"sm",type:"button",disabled:v[P.id]?.state==="testing",onClick:()=>A(P.id),children:"Test"}),o.jsx(be,{variant:"ghost",size:"sm",type:"button",disabled:b.has(P.id),onClick:()=>C(P.id),children:b.has(P.id)?"Removing…":"Remove"})]})})]},P.id))})]}),m&&o.jsx("p",{className:"text-rose-400 text-sm mt-2",children:m})]})]})}function e_e({projectName:e,refreshNonce:t}){const n=vi(),[r,i]=x.useState(null),[a,l]=x.useState([]),[u,d]=x.useState(null),[f,p]=x.useState([]),[m,g]=x.useState([]),[v,S]=x.useState(null),[b,j]=x.useState(""),[k,E]=x.useState(""),[C,A]=x.useState(""),[P,O]=x.useState(!0),[_,T]=x.useState(!1),[$,F]=x.useState(null),[U,B]=x.useState("coverage");x.useEffect(()=>{V()},[e,t]);async function V(){O(!0),F(null);try{const M=await n.fetchQuery({queryKey:qe.bing.status(e),queryFn:()=>j5(e),staleTime:Sr});if(i(M),M.connected){const[q,D,G,se]=await Promise.all([n.fetchQuery({queryKey:qe.bing.coverage(e),queryFn:()=>VN(e).catch(()=>null),staleTime:Sr}),n.fetchQuery({queryKey:qe.bing.inspections(e),queryFn:()=>N5(e).catch(()=>[]),staleTime:Sr}),n.fetchQuery({queryKey:qe.bing.performance(e),queryFn:()=>zV(e).catch(()=>[]),staleTime:Sr}),M.siteUrl?Promise.resolve([]):n.fetchQuery({queryKey:qe.bing.sites(e),queryFn:()=>EV(e).then(ne=>ne.sites).catch(()=>[]),staleTime:Sr})]);d(q),p(D),g(G),l(se)}else d(null),p([]),g([]),l([])}catch(M){F(M instanceof Error?M.message:"Failed to load Bing data")}finally{O(!1)}}async function X(){if(k.trim()){F(null);try{const M=await AV(e,k.trim());await n.invalidateQueries({queryKey:qe.bing.project(e)}),E(""),M.availableSites.length>0&&l(M.availableSites),await V()}catch(M){F(M instanceof Error?M.message:"Failed to connect")}}}async function Z(){try{await OV(e),await n.invalidateQueries({queryKey:qe.bing.project(e)}),i(null),l([]),d(null),p([]),g([]),S(null),A(""),F(null)}catch(M){F(M instanceof Error?M.message:"Failed to disconnect")}}async function H(){if(C)try{await _V(e,C),await n.invalidateQueries({queryKey:qe.bing.project(e)}),await V()}catch(M){F(M instanceof Error?M.message:"Failed to set site")}}async function J(){if(b.trim())try{const M=await k5(e,b.trim());await n.invalidateQueries({queryKey:qe.bing.project(e)}),S(M),p(q=>[M,...q])}catch(M){F(M instanceof Error?M.message:"Inspection failed")}}async function oe(M){T(!0),F(null);try{const q=await w2(e,{urls:[M]}),{succeeded:D,failed:G,total:se}=q.summary;vt({title:"Bing submission requested",detail:G===0?`${D} URL submitted to Bing.`:`${D}/${se} submitted successfully, ${G} failed.`,tone:G===0?"positive":"caution",dedupeKey:`bing:indexing:${e}:${M}`,dedupeMode:"replace"})}catch(q){const D=q instanceof Error?q.message:"Submission failed";F(D),vt({title:"Bing submission failed",detail:D,tone:"negative",dedupeKey:`bing:indexing:${e}:${M}`,dedupeMode:"replace"})}finally{T(!1)}}async function ye(){T(!0),F(null),vt({title:"Submitting URLs to Bing",detail:"Requesting indexing for all currently unindexed URLs.",tone:"neutral",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"});try{const M=await w2(e,{allUnindexed:!0}),{succeeded:q,failed:D,total:G}=M.summary;vt({title:"Bing submissions requested",detail:D===0?`${q}/${G} URL${G!==1?"s":""} submitted to Bing.`:`${q}/${G} submitted successfully, ${D} failed.`,tone:D===0?"positive":"caution",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}catch(M){const q=M instanceof Error?M.message:"Batch submission failed";F(q),vt({title:"Bing submissions failed",detail:q,tone:"negative",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}finally{T(!1)}}if(P)return o.jsx($e,{className:"surface-card",children:o.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!r?.connected)return o.jsxs($e,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),o.jsx("h3",{children:"Domain authorization"})]}),o.jsx(Xe,{tone:"caution",children:"Not connected"})]}),o.jsx("p",{className:"text-sm text-zinc-300",children:"Connect Bing Webmaster Tools to inspect URLs, monitor index coverage, and submit pages for indexing."}),o.jsxs("div",{className:"mt-3",children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),o.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[o.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:k,onChange:M=>E(M.target.value),onKeyDown:M=>M.key==="Enter"&&X()}),o.jsx(be,{size:"sm",disabled:!k.trim(),onClick:X,children:"Connect"})]}),o.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Get your API key from"," ",o.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"})]})]}),$&&o.jsx("p",{className:"mt-3 text-xs text-rose-400",children:$})]});if(!r.siteUrl)return o.jsxs($e,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),o.jsx("h3",{children:"Domain authorization"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Xe,{tone:"positive",children:"Connected"}),o.jsx(be,{size:"sm",variant:"ghost",onClick:Z,children:"Disconnect"})]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),o.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),o.jsx("span",{className:"text-xs text-zinc-500",children:r.domain})]}),o.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."})]}),o.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Registered domain"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:r.domain})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:r.updatedAt?aa(r.updatedAt):"—"})]})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Select site"}),a.length>0?o.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[o.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:C,onChange:M=>A(M.target.value),children:[o.jsx("option",{value:"",children:"Select a site..."}),a.map(M=>o.jsxs("option",{value:M.url,children:[M.url,M.verified?" (verified)":""]},M.url))]}),o.jsx(be,{size:"sm",disabled:!C,onClick:H,children:"Set Site"})]}):o.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."})]})]}),$&&o.jsx("p",{className:"mt-3 text-xs text-rose-400",children:$})]});const I=[{key:"coverage",label:"Coverage"},{key:"inspections",label:"Inspections"},{key:"performance",label:"Performance"}];return o.jsxs("div",{className:"space-y-3",children:[o.jsxs($e,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),o.jsx("h3",{children:"Domain authorization"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Xe,{tone:"positive",children:"Connected"}),o.jsx(be,{size:"sm",variant:"ghost",onClick:Z,children:"Disconnect"})]})]}),$&&o.jsx("p",{className:"mb-3 text-xs text-rose-400",children:$}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),o.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),o.jsx("span",{className:"text-xs text-zinc-500",children:r.domain})]}),o.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores Bing connections per canonical domain. This project is currently mapped to ",o.jsx("code",{children:r.siteUrl}),"."]})]}),o.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected site"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:r.siteUrl})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:r.updatedAt?aa(r.updatedAt):"—"})]})]})]})]}),o.jsxs($e,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),o.jsx("h3",{children:"Index monitoring"})]}),o.jsx("p",{className:"text-xs text-zinc-500",children:u?.lastInspectedAt?`Last inspected ${aa(u.lastInspectedAt)}`:"No inspection history yet"})]}),o.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:I.map(M=>o.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${U===M.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>B(M.key),children:M.label},M.key))}),U==="coverage"&&u&&o.jsxs("div",{className:"mt-4 space-y-4",children:[o.jsxs("div",{className:"grid gap-3 sm:grid-cols-4",children:[o.jsx(cg,{label:"Indexed",value:u.summary.indexed,tone:"positive"}),o.jsx(cg,{label:"Not in index",value:u.summary.notIndexed+(u.summary.unknown??0),tone:"negative"}),o.jsx(cg,{label:"Status unknown",value:u.summary.unknown??0,tone:"neutral"}),o.jsx(cg,{label:"Coverage",value:`${u.summary.percentage}%`,tone:"neutral"})]}),u.notIndexed.length>0&&o.jsxs("div",{children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[o.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Not Indexed (",u.notIndexed.length,")"]}),o.jsx(be,{size:"sm",variant:"ghost",disabled:_,onClick:ye,children:_?"Submitting…":"Submit all to Bing"})]}),o.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800",children:[o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"HTTP"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),o.jsx("tbody",{children:u.notIndexed.map(M=>o.jsxs("tr",{className:"border-b border-zinc-800/50",children:[o.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:M.url}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:M.httpCode??"—"}),o.jsx("td",{className:"py-1.5 px-3 text-right",children:o.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:_,onClick:()=>oe(M.url),children:"Submit"})})]},M.id))})]})})]}),(u.unknown??[]).length>0&&o.jsxs("div",{children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[o.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Unknown — not yet confirmed (",(u.unknown??[]).length,")"]}),o.jsx(be,{size:"sm",variant:"ghost",disabled:_,onClick:ye,children:_?"Submitting…":"Submit all to Bing"})]}),o.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800",children:[o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),o.jsx("tbody",{children:(u.unknown??[]).map(M=>o.jsxs("tr",{className:"border-b border-zinc-800/50",children:[o.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:M.url}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:M.lastCrawledDate?aa(M.lastCrawledDate):"—"}),o.jsx("td",{className:"py-1.5 px-3 text-right",children:o.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:_,onClick:()=>oe(M.url),children:"Submit"})})]},M.id))})]})})]}),u.indexed.length>0&&o.jsxs("div",{children:[o.jsxs("h4",{className:"mb-2 text-xs font-medium text-zinc-400",children:["Indexed (",u.indexed.length,")"]}),o.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800",children:[o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"})]})}),o.jsx("tbody",{children:u.indexed.map(M=>o.jsxs("tr",{className:"border-b border-zinc-800/50",children:[o.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:M.url}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:M.lastCrawledDate?aa(M.lastCrawledDate):"—"})]},M.id))})]})})]})]}),U==="coverage"&&!u&&o.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),U==="inspections"&&o.jsxs("div",{className:"mt-4 space-y-3",children:[o.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[o.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:b,onChange:M=>j(M.target.value),onKeyDown:M=>M.key==="Enter"&&J()}),o.jsx(be,{size:"sm",disabled:!b.trim(),onClick:J,children:"Inspect"})]}),v&&o.jsxs("div",{className:"rounded border border-zinc-800 bg-zinc-900/40 p-3 text-xs space-y-1",children:[o.jsx("div",{className:"font-medium text-zinc-200",children:v.url}),o.jsxs("div",{className:"text-zinc-400",children:["In Index: ",o.jsx("span",{className:v.inIndex?"text-emerald-400":"text-rose-400",children:v.inIndex?"Yes":"No"})," · ","HTTP: ",v.httpCode??"—"," · ","Crawled: ",v.lastCrawledDate??"—"]})]}),f.length>0&&o.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800",children:[o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Index"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-14",children:"HTTP"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Inspected"})]})}),o.jsx("tbody",{children:f.map(M=>o.jsxs("tr",{className:"border-b border-zinc-800/50",children:[o.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:M.url}),o.jsx("td",{className:"py-1.5 px-3",children:o.jsx(Xe,{tone:M.inIndex?"positive":"negative",children:M.inIndex?"Yes":"No"})}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:M.httpCode??"—"}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:aa(M.inspectedAt)})]},M.id))})]})})]}),U==="performance"&&o.jsx("div",{className:"mt-4",children:m.length===0?o.jsx("p",{className:"text-xs text-zinc-500",children:"No Bing performance data available."}):o.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800",children:[o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"Query"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:Km[To.Clicks]}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:Km[To.Impressions]}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:Km[To.CTR]}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:Km[To.Position]})]})}),o.jsx("tbody",{children:m.map((M,q)=>o.jsxs("tr",{className:"border-b border-zinc-800/50",children:[o.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:M.query}),o.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-200",children:M.clicks}),o.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:M.impressions}),o.jsxs("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:[(Number.isFinite(M.ctr)?M.ctr*100:0).toFixed(1),"%"]}),o.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:M.averagePosition.toFixed(1)})]},q))})]})})})]})]})}function t_e({projectName:e}){const t=vi(),[n,r]=x.useState("google"),[i,a]=x.useState(!0),[l,u]=x.useState("idle"),[d,f]=x.useState(null),p=x.useRef(null),[m,g]=x.useState(!1),[v,S]=x.useState(null),[b,j]=x.useState(null),[k,E]=x.useState(!1),[C,A]=x.useState(null),[P,O]=x.useState(null),[_,T]=x.useState(0);async function $(q=!1){q||a(!0),f(null);try{const[D,G,se]=await Promise.all([KN().catch(()=>null),t.fetchQuery({queryKey:qe.gsc.connections(e),queryFn:()=>w5(e).catch(()=>[]),staleTime:Sr}),t.fetchQuery({queryKey:qe.bing.status(e),queryFn:()=>j5(e).catch(()=>null),staleTime:Sr})]),ne=G.find(ee=>ee.connectionType==="gsc")??null;g(!!D?.google?.configured),E(!!D?.bing?.configured),S(ne),A(se);const[Ce,je]=await Promise.all([ne?t.fetchQuery({queryKey:qe.gsc.coverage(e),queryFn:()=>GN(e).catch(()=>null),staleTime:Sr}):Promise.resolve(null),se?.connected?t.fetchQuery({queryKey:qe.bing.coverage(e),queryFn:()=>VN(e).catch(()=>null),staleTime:Sr}):Promise.resolve(null)]);j(Ce),O(je)}catch(D){f(D instanceof Error?D.message:"Failed to load search console overview")}finally{a(!1)}}async function F(){if(l!=="idle")return;p.current?.abort();const q=new AbortController;p.current=q;const D=q.signal;u("syncing"),f(null);const G=[];try{async function se(){if(!v)return;const ee=await S5(e);if(!ee?.id)return;const pe=2e3,W=Date.now()+12e4;for(;Date.now()<W;){if(D.aborted||(await new Promise(Te=>setTimeout(Te,pe)),D.aborted))return;const He=await ec(ee.id).catch(()=>null);if(!He)break;if(["completed","failed","cancelled"].includes(He.status)){He.status!=="completed"&&G.push(`Google sync ${He.status}`);break}}}const ne=10;async function Ce(){if(!C?.connected)return;const ee=await N5(e).catch(()=>[]),pe=[...new Set(ee.map(Ee=>Ee.url))];if(pe.length!==0)for(let Ee=0;Ee<pe.length;Ee+=ne){if(D.aborted)return;const W=pe.slice(Ee,Ee+ne),Te=(await Promise.allSettled(W.map(st=>k5(e,st)))).filter(st=>st.status==="rejected").length;Te>0&&G.push(`${Te} Bing inspection(s) failed`)}}const je=await Promise.allSettled([se(),Ce()]);for(const ee of je)ee.status==="rejected"&&G.push(ee.reason instanceof Error?ee.reason.message:"Sync failed");if(D.aborted)return;u("reloading"),await Promise.all([t.invalidateQueries({queryKey:qe.gsc.project(e)}),t.invalidateQueries({queryKey:qe.bing.project(e)})]),await $(!0),T(ee=>ee+1),G.length>0&&f(`Partial refresh: ${G.join("; ")}`)}catch(se){D.aborted||f(se instanceof Error?se.message:"Refresh failed")}finally{D.aborted||u("idle")}}x.useEffect(()=>($(),()=>{p.current?.abort()}),[e]);const U=v?"positive":m?"caution":"negative",B=v?"Connected":m?"Ready to connect":"Needs setup",V=b?`${b.summary.percentage}% indexed`:v?"Awaiting coverage":"No coverage data",X=b?`${b.summary.notIndexed} not indexed${b.summary.deindexed>0?` · ${b.summary.deindexed} deindexed`:""}`:v?"Run sitemap inspection to populate coverage":m?"Connect Search Console for this domain":"Add Google OAuth credentials in Settings",Z=b?.lastSyncedAt??b?.lastInspectedAt??v?.updatedAt??null,H=C?.connected?"positive":k?"caution":"negative",J=C?.connected?"Connected":k?"Ready to connect":"Needs setup",oe=P?`${P.summary.percentage}% indexed`:C?.connected?"Awaiting coverage":"No coverage data",ye=P?P.summary.notIndexed+(P.summary.unknown??0):0,I=P?`${ye} not in index`:C?.connected?"Inspect URLs to populate coverage":k?"Connect Bing Webmaster Tools for this domain":"Add a Bing API key in Settings",M=P?.lastInspectedAt??C?.updatedAt??null;return o.jsxs("div",{className:"space-y-6",children:[o.jsxs($e,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search console"}),o.jsx("h2",{children:"Search Engine Intelligence"}),o.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."})]}),o.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:i||l!=="idle",onClick:()=>{F()},children:i?"Loading…":l==="syncing"?"Refreshing Google & Bing…":l==="reloading"?"Reloading workspaces…":"Refresh all"})]}),d&&o.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:d}),o.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[o.jsx(RT,{eyebrow:"Google",title:"Google Search Console",status:i?"Loading…":B,tone:i?"neutral":U,targetLabel:"Selected property",targetValue:v?.propertyId??"No property selected",coverageValue:i?"Loading…":V,note:i?"Loading overview…":X,updatedAt:Z,active:n==="google",onClick:()=>r("google")}),o.jsx(RT,{eyebrow:"Bing",title:"Bing Webmaster Tools",status:i?"Loading…":J,tone:i?"neutral":H,targetLabel:"Selected site",targetValue:C?.siteUrl??"No site selected",coverageValue:i?"Loading…":oe,note:i?"Loading overview…":I,updatedAt:M,active:n==="bing",onClick:()=>r("bing")})]})]}),o.jsx("div",{className:"flex flex-wrap gap-2",role:"tablist","aria-label":"Search engine workspaces",children:[["google","Google"],["bing","Bing"]].map(([q,D])=>o.jsx("button",{type:"button",role:"tab","aria-selected":n===q,className:`project-subnav-link ${n===q?"project-subnav-link-active":""}`,onClick:()=>r(q),children:D},q))}),n==="google"&&o.jsx(sEe,{projectName:e}),n==="bing"&&o.jsxs("section",{className:"page-section-divider",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search engine"}),o.jsx("h2",{children:"Bing Webmaster Tools"})]})}),o.jsx(e_e,{projectName:e,refreshNonce:_})]})]})}function n_e({insights:e}){const{openEvidence:t}=xd(),[n,r]=x.useState(null);return o.jsx("div",{className:"insight-list",children:e.map(i=>{const a=n===i.id,l=i.affectedPhrases.length>0;return o.jsxs("div",{children:[o.jsxs("div",{className:`insight-row insight-row-${i.tone} ${l?"cursor-pointer":""}`,onClick:l?()=>r(a?null:i.id):void 0,children:[o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l&&o.jsx(Kh,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${a?"rotate-90":""}`}),o.jsx(Xe,{tone:i.tone,children:i.actionLabel}),o.jsx("span",{className:"text-sm font-medium text-zinc-100 truncate",children:i.title}),o.jsx("span",{className:"hidden sm:inline text-xs text-zinc-500 truncate",children:i.detail})]}),l&&o.jsxs("span",{className:"text-[11px] text-zinc-600 whitespace-nowrap",children:[i.affectedPhrases.length," phrase",i.affectedPhrases.length>1?"s":""]})]}),a&&o.jsx("div",{className:"divide-y divide-zinc-800/20",children:i.affectedPhrases.map((u,d)=>o.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2 pl-9 bg-zinc-900/40",children:[o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx(j1,{state:u.citationState}),o.jsx("span",{className:"text-sm text-zinc-200 truncate",children:u.query}),o.jsx("div",{className:"hidden sm:flex gap-1",children:u.provider&&o.jsx(nc,{provider:u.provider})})]}),u.evidenceId&&o.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 whitespace-nowrap transition-colors",onClick:f=>{f.stopPropagation(),t(u.evidenceId)},children:"View →"})]},u.evidenceId||`${i.id}-${d}`))})]},i.id)})})}function Sp({tab:e}){const{projectId:t}=Nv({from:"/projects/$projectId"}),n=Qo(),{dashboard:r,isLoading:i,refetch:a}=wc();if(!r||i)return o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-48"}),o.jsx("div",{className:"skeleton-text-sm w-32"})]}),o.jsx("div",{className:"grid grid-cols-3 gap-4",children:[1,2,3].map(Se=>o.jsxs("div",{className:"page-skeleton-card flex flex-col items-center",children:[o.jsx("div",{className:"skeleton-circle size-20"}),o.jsx("div",{className:"skeleton-text w-16 mt-3"})]},Se))}),o.jsxs("div",{className:"page-skeleton-card",children:[o.jsx("div",{className:"skeleton-text w-28"}),o.jsx("div",{className:"space-y-2 mt-2",children:[1,2,3,4].map(Se=>o.jsx("div",{className:"skeleton-text-sm w-full"},Se))})]})]});const l=Nie(r,t),[u,d]=x.useState(!1),[f,p]=x.useState(!1),[m,g]=x.useState(!1),[v,S]=x.useState(""),[b,j]=x.useState(!1),[k,E]=x.useState(!1),[C,A]=x.useState(""),[P,O]=x.useState(!1),[_,T]=x.useState(!1),[$,F]=x.useState(""),[U,B]=x.useState(!1),[V,X]=x.useState(void 0),[Z,H]=x.useState(!1),[J,oe]=x.useState(null),[ye,I]=x.useState(!1),M=l?.visibilityEvidence??[],q=l?.project.name??"",D=l?.project.displayName||l?.project.name||q,G=IF(),se=(l?.recentRuns??[]).some(Se=>Se.kind===zt["answer-visibility"]&&(Se.status===fr.running||Se.status===fr.queued)),ne=x.useMemo(()=>new Set(M.map(Se=>Se.location??"")),[M]),Ce=ne.has(""),je=x.useMemo(()=>[...ne].filter(Boolean),[ne]);x.useEffect(()=>{if(V===void 0||V===""||!q){oe(null),I(!1);return}I(!0),x5(q,V).then(Se=>{oe(Se),I(!1)}).catch(()=>{oe(null),I(!1)})},[V,q]);const ee=x.useMemo(()=>{if(!J)return null;const Se=new Map;for(const Ze of J){for(const[Tt,mt]of Object.entries(Ze.providerRuns??{}))Se.set(`${Ze.query}::${Tt}`,mt.map(Je=>({runId:Je.runId,citationState:Je.citationState,createdAt:Je.createdAt,answerMentioned:Je.answerMentioned,visibilityState:Je.visibilityState,visibilityTransition:Je.visibilityTransition})));(!Ze.providerRuns||Object.keys(Ze.providerRuns).length===0)&&Se.set(`${Ze.query}::`,Ze.runs.map(Tt=>({runId:Tt.runId,citationState:Tt.citationState,createdAt:Tt.createdAt,answerMentioned:Tt.answerMentioned,visibilityState:Tt.visibilityState,visibilityTransition:Tt.visibilityTransition})))}return Se},[J]),pe=x.useMemo(()=>{const Se=V!==void 0?M.filter(Ze=>V===""?!Ze.location:Ze.location===V):M;return ee?Se.map(Ze=>{const Tt=ee.get(`${Ze.query}::${Ze.provider}`)??ee.get(`${Ze.query}::`);return Tt?{...Ze,runHistory:Tt}:Ze}):Se},[M,V,ee]);if(!l)return o.jsx("div",{className:"page-container",children:o.jsxs($e,{className:"surface-card empty-card",children:[o.jsx("h1",{children:"Project not found"}),o.jsxs("p",{children:['Could not find a project with ID "',t,'".']}),o.jsx(be,{asChild:!0,children:o.jsx(Zt,{to:"/",children:"Return to overview"})})]})});async function Ee(){try{await G.mutateAsync({projectName:q,projectLabel:D,sourceAction:"project-run"}),a()}catch{}}async function W(){p(!0);try{await ZG(q),vt({title:"Project deleted",detail:`${D} was removed.`,tone:"positive",dedupeKey:`project:delete:${q}`,dedupeMode:"drop"}),n({to:"/"}),a()}catch(Se){console.error("Failed to delete project:",Se)}finally{p(!1)}}async function He(){try{const Se=await XG(q),Ze=typeof Se=="string"?Se:JSON.stringify(Se,null,2),Tt=new Blob([Ze],{type:"text/yaml"}),mt=URL.createObjectURL(Tt),Je=document.createElement("a");Je.href=mt,Je.download=`${q}.yaml`,Je.click()}catch(Se){vt({title:"Export failed",detail:Se instanceof Error?Se.message:"Could not export project YAML.",tone:"negative"})}}async function Te(){const Se=v.split(`
|
|
293
|
-
`).map(Ze=>Ze.trim()).filter(Boolean);if(Se.length!==0){j(!0);try{await KG(q,Se),a(),S(""),g(!1)}finally{j(!1)}}}async function st(){const Se=C.trim();if(Se){O(!0);try{const Tt=(await v5(q)).map(Je=>Je.domain),mt=[...new Set([...Tt,Se])];await b5(q,mt),a(),A(""),E(!1)}finally{O(!1)}}}async function Ve(){const Se=$.trim();if(Se){B(!0);try{const Ze=l?.project.ownedDomains??[];await y2(q,[...Ze,Se]),a(),F(""),T(!1)}finally{B(!1)}}}async function Ht(Se){B(!0);try{const Ze=l?.project.ownedDomains??[];await y2(q,Ze.filter(Tt=>Tt!==Se)),a()}finally{B(!1)}}async function Lt(Se,Ze){await GG(Se,Ze),a()}const un=Se=>!Number.isNaN(Number.parseInt(Se,10)),tn=[{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:"report",label:"Report",href:`/projects/${l.project.id}/report`},{key:"inbound",label:"Inbound",href:`/projects/${l.project.id}/inbound`}];return o.jsxs("div",{className:"page-container",children:[u?o.jsxs($e,{className:"surface-card p-6 mb-6 border-rose-800/60",children:[o.jsx("h3",{className:"text-base font-semibold text-rose-400 mb-2",children:"Delete project?"}),o.jsxs("p",{className:"text-sm text-zinc-400 mb-4",children:["This will permanently delete ",o.jsx("strong",{className:"text-zinc-200",children:l.project.displayName||l.project.name})," and all its queries, competitors, runs, and snapshots. This cannot be undone."]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(be,{type:"button",variant:"destructive",disabled:f,onClick:W,children:f?"Deleting...":"Yes, delete project"}),o.jsx(be,{type:"button",variant:"outline",disabled:f,onClick:()=>d(!1),children:"Cancel"})]})]}):null,o.jsxs("div",{className:"page-header",children:[o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:l.project.displayName||l.project.name}),o.jsxs("p",{className:"page-subtitle",children:[l.project.canonicalDomain,(l.project.ownedDomains??[]).length===0&&!_&&o.jsx("button",{type:"button",className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-600 hover:text-zinc-400 transition-colors",onClick:()=>T(!0),children:"+ add domain"})," "," · ",l.contextLabel]}),o.jsxs("div",{className:"tag-row",children:[o.jsx("span",{className:"tag",children:l.project.country}),o.jsx("span",{className:"tag",children:l.project.language.toUpperCase()}),l.project.tags.map(Se=>o.jsx("span",{className:"tag",children:Se},Se))]}),((l.project.ownedDomains??[]).length>0||_)&&o.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[o.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mr-1",children:"Also tracking"}),(l.project.ownedDomains??[]).map(Se=>o.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:[Se,o.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:U,onClick:()=>Ht(Se),"aria-label":`Remove ${Se}`,children:"×"})]},Se)),_?o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.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:$,onChange:Se=>F(Se.target.value),onKeyDown:Se=>Se.key==="Enter"&&Ve(),autoFocus:!0}),o.jsx(be,{type:"button",size:"sm",disabled:!$.trim()||U,onClick:Ve,children:U?"...":"Add"}),o.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{T(!1),F("")},children:"Cancel"})]}):o.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:()=>T(!0),children:"+ domain"})]})]}),o.jsxs("div",{className:"page-header-right",children:[o.jsx("p",{className:"text-sm text-zinc-500",children:l.dateRangeLabel}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(be,{type:"button",variant:"outline",size:"icon",onClick:He,"aria-label":"Export project as YAML",children:o.jsx(Av,{className:"h-4 w-4 text-zinc-400"})}),o.jsx(be,{type:"button",variant:"outline",size:"icon",onClick:()=>d(!0),"aria-label":"Delete project",children:o.jsx(I5,{className:"h-4 w-4 text-zinc-400"})}),o.jsx(be,{type:"button",disabled:G.isPending||se,onClick:Ee,children:G.isPending?"Starting…":se?"Sweep running…":"Run now"})]})]})]}),o.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:tn.map(Se=>o.jsx(Zt,{to:Se.href,className:`project-subnav-link ${Se.key===e?"project-subnav-link-active":""}`,"aria-current":Se.key===e?"page":void 0,children:Se.label},Se.key))}),e==="overview"?o.jsxs(o.Fragment,{children:[o.jsxs("section",{className:"gauge-row",children:[o.jsx(cde,{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:un(l.visibilitySummary.value),progress:l.visibilitySummary.progress,providerCoverage:l.visibilitySummary.providerCoverage}),o.jsxs("div",{className:"metric-card",children:[o.jsxs("p",{className:"metric-card-eyebrow",children:["Gap Queries",o.jsx(hr,{text:"Tracked queries where competitors are cited in the latest completed visibility run but your domain is not."})]}),o.jsxs("p",{className:"metric-card-big-value",children:[o.jsx("span",{className:"text-zinc-50",children:l.gapQueries.value}),o.jsxs("span",{className:"text-zinc-600",children:[" / ",l.queryCounts.total]})]}),o.jsx("div",{className:"metric-card-bar",children:o.jsx("div",{className:`metric-card-bar-fill progress-fill-${l.gapQueries.tone}`,style:{width:l.gapQueries.progress!==void 0?`${Math.min(Math.max(l.gapQueries.progress,0),100)}%`:"0%"}})}),o.jsx("p",{className:"metric-card-detail",children:l.gapQueries.delta}),o.jsx("p",{className:"metric-card-sub",children:l.gapQueries.description})]}),o.jsxs("div",{className:"metric-card",children:[o.jsxs("p",{className:"metric-card-eyebrow",children:["Index Coverage",o.jsx(hr,{text:"Percentage of inspected URLs that are currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used."})]}),o.jsxs("p",{className:"metric-card-big-value",children:[o.jsx("span",{className:"text-zinc-50",children:l.indexCoverage.value}),o.jsx("span",{className:"text-zinc-600",children:"%"})]}),o.jsx("div",{className:"metric-card-bar",children:o.jsx("div",{className:`metric-card-bar-fill progress-fill-${l.indexCoverage.tone}`,style:{width:`${Number.parseInt(l.indexCoverage.value,10)||0}%`}})}),o.jsx("p",{className:"metric-card-detail",children:l.indexCoverage.delta}),o.jsx("p",{className:"metric-card-sub",children:l.indexCoverage.description})]}),o.jsxs("div",{className:"metric-card",children:[o.jsxs("p",{className:"metric-card-eyebrow",children:["Since Last Run",o.jsx(hr,{text:"Query-level citation changes compared to the previous completed run."})]}),l.movementSummary.hasPreviousRun?o.jsxs("div",{className:"metric-card-movement",children:[o.jsxs("span",{className:l.movementSummary.gained>0?"text-emerald-400":"text-zinc-500",children:["+",l.movementSummary.gained," gained"]}),o.jsx("span",{className:"text-zinc-600 mx-1.5",children:"·"}),o.jsxs("span",{className:l.movementSummary.lost>0?"text-rose-400":"text-zinc-500",children:["−",l.movementSummary.lost," lost"]})]}):o.jsx("p",{className:"metric-card-movement text-zinc-500",children:"First run — no comparison yet"}),o.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":""})]})]}),o.jsx(fEe,{projectName:l.project.name}),l.providerScores.length>1&&o.jsxs("section",{className:"page-section-divider",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Model breakdown"}),o.jsxs("h2",{children:["Visibility by model ",o.jsx(hr,{text:"Per-model citation rate. Shows how often each AI model cites your domain across all tracked queries. Switching models can significantly affect citation rates."})]})]})}),o.jsx("div",{className:"evidence-table-wrap",children:o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Model"}),o.jsx("th",{children:"Score"}),o.jsx("th",{children:"Cited queries"})]})}),o.jsx("tbody",{children:l.providerScores.map(Se=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[o.jsx(nc,{provider:Se.provider}),Se.model&&o.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:Se.model})]})}),o.jsx("td",{children:o.jsxs("span",{className:`font-semibold ${Se.score>=70?"text-emerald-400":Se.score>=40?"text-amber-400":"text-rose-400"}`,children:[Se.score,"%"]})}),o.jsxs("td",{className:"text-zinc-500",children:[Se.cited," of ",Se.total]})]},`${Se.provider}::${Se.model??"unknown"}`))})]})})]}),o.jsxs("section",{className:"page-section-divider",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"What changed"}),o.jsx("h2",{children:"Citation signals"})]})}),o.jsx(n_e,{insights:l.insights})]}),o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Visibility evidence"}),o.jsx("h2",{children:"Query citation tracking"})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("p",{className:"supporting-copy",children:[new Set(l.visibilityEvidence.map(Se=>Se.query)).size," queries tracked"]}),o.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>g(!m),children:m?"Cancel":"+ Add queries"})]})]}),m&&o.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[o.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 queries, one per line",value:v,onChange:Se=>S(Se.target.value)}),o.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[o.jsxs("p",{className:"text-xs text-zinc-500",children:[v.split(`
|
|
294
|
-
`).filter(Se=>Se.trim()).length," queries"]}),o.jsx(be,{type:"button",size:"sm",disabled:!v.trim()||b,onClick:Te,children:b?"Adding...":"Add queries"})]})]}),l.project.locations&&l.project.locations.length>0&&o.jsxs("div",{className:"filter-row mb-3",role:"toolbar","aria-label":"Location filters",children:[o.jsx("button",{className:`filter-chip ${V===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":V===void 0,onClick:()=>{X(void 0)},children:"All locations"}),l.project.locations.map(Se=>ne.has(Se.label)&&o.jsx("button",{className:`filter-chip ${V===Se.label?"filter-chip-active":""}`,type:"button","aria-pressed":V===Se.label,onClick:()=>{X(Se.label),H(!1)},children:Se.label},Se.label)),Ce&&o.jsx("button",{className:`filter-chip ${V===""?"filter-chip-active":""}`,type:"button","aria-pressed":V==="",onClick:()=>{X(""),H(!1)},children:"No location"}),je.length>1&&V===void 0&&o.jsx("button",{className:`filter-chip filter-chip-compare ${Z?"filter-chip-active":""}`,type:"button","aria-pressed":Z,onClick:()=>H(Se=>!Se),title:"Side-by-side location comparison",children:"Compare"})]}),o.jsx(fde,{evidence:pe})]}),o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Competitors"}),o.jsx("h2",{children:"Competitive landscape"})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("p",{className:"supporting-copy",children:[l.competitors.length," tracked"]}),o.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>E(!k),children:k?"Cancel":"+ Add competitor"})]})]}),k&&o.jsxs("div",{className:"mb-3 flex gap-2 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[o.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:C,onChange:Se=>A(Se.target.value),onKeyDown:Se=>Se.key==="Enter"&&st()}),o.jsx(be,{type:"button",size:"sm",disabled:!C.trim()||P,onClick:st,children:P?"Adding...":"Add"})]}),o.jsx(hde,{competitors:l.competitors})]}),o.jsxs("section",{className:"page-section-divider",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Run timeline"}),o.jsx("h2",{children:"Recent execution history"})]})}),o.jsx("div",{className:"run-list",children:l.recentRuns.map(Se=>o.jsx(dB,{run:Se},Se.id))})]}),o.jsx(YEe,{project:{...l.project,displayName:l.project.displayName??l.project.name,defaultLocation:l.project.defaultLocation??null},onUpdateProject:Lt,onRefresh:()=>{a()}}),o.jsx(ZEe,{projectName:l.project.name}),o.jsx(JEe,{projectName:l.project.name})]}):e==="report"?o.jsx(CEe,{projectName:l.project.name}):e==="traffic"?o.jsx(KOe,{projectName:l.project.name}):e==="inbound"?o.jsx(dEe,{projectName:l.project.name}):o.jsx(t_e,{projectName:l.project.name})]})}function r_e(){const{dashboard:e,isLoading:t}=wc(),n=tEe();if(!e||t)return o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-20"}),o.jsx("div",{className:"skeleton-text-sm w-72"})]}),o.jsx("div",{className:"space-y-2",children:[1,2,3,4].map(d=>o.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3 flex items-center gap-3",children:[o.jsxs("div",{className:"flex-1 space-y-1.5",children:[o.jsx("div",{className:"skeleton-text w-40"}),o.jsx("div",{className:"skeleton-text-sm w-56"})]}),o.jsx("div",{className:"skeleton h-5 w-16 rounded-full"})]},d))})]});const r=e.runs,[i,a]=x.useState("all"),l=i==="all"?r:r.filter(d=>d.status===i),u=async()=>{try{await n.mutateAsync(void 0)}catch{}};return o.jsxs("div",{className:"page-container",children:[o.jsxs("div",{className:"page-header",children:[o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:"Runs"}),o.jsx("p",{className:"page-subtitle",children:"Status, type, project, duration, and the shortest explanation that makes the outcome trustworthy."})]}),o.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:n.isPending,onClick:()=>{u()},children:n.isPending?"Queueing…":"Run all projects"})]}),o.jsxs("section",{children:[o.jsx("div",{className:"filter-row",role:"toolbar","aria-label":"Run filters",children:["all","queued","running","completed","partial","failed","cancelled"].map(d=>o.jsx("button",{className:`filter-chip ${i===d?"filter-chip-active":""}`,type:"button","aria-pressed":i===d,onClick:()=>a(d),children:d==="all"?"All runs":Pv(d)},d))}),o.jsx("div",{className:"run-list",children:l.length>0?l.map(d=>o.jsx(dB,{run:d},d.id)):o.jsxs($e,{className:"surface-card empty-card",children:[o.jsx("h2",{children:"No runs match this filter"}),o.jsx("p",{children:"Try another status filter or queue a new run from a project command center."})]})})]})]})}function i_e({providerName:e,keyUrl:t,modelHint:n,onSaved:r}){const i=e.toLowerCase()==="local",[a,l]=x.useState(""),[u,d]=x.useState(""),[f,p]=x.useState(""),[m,g]=x.useState(""),[v,S]=x.useState(""),[b,j]=x.useState(""),[k,E]=x.useState(!1),[C,A]=x.useState(null),[P,O]=x.useState(!1),_=i?u.trim().length>0:a.trim().length>0;async function T(){if(_){E(!0),A(null),O(!1);try{const F=Z=>{const H=parseInt(Z.trim(),10);return Number.isFinite(H)&&H>0?H:void 0},U={},B=F(m);B!==void 0&&(U.maxConcurrency=B);const V=F(v);V!==void 0&&(U.maxRequestsPerMinute=V);const X=F(b);X!==void 0&&(U.maxRequestsPerDay=X),await nV(e.toLowerCase(),{...a.trim()?{apiKey:a.trim()}:{},...u.trim()?{baseUrl:u.trim()}:{},...f.trim()?{model:f.trim()}:{},...Object.keys(U).length>0?{quota:U}:{}}),l(""),d(""),p(""),g(""),S(""),j(""),O(!0),vt({title:"Provider updated",detail:`${e} configuration saved.`,tone:"positive",dedupeKey:`settings:provider:${e}`,dedupeMode:"replace"}),r()}catch(F){A(F instanceof Error?F.message:"Failed to update provider")}finally{E(!1)}}}const $=n??"Use default model";return o.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[i&&o.jsxs("div",{children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`base-url-${e}`,children:"Base URL"}),o.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:u,onChange:F=>d(F.target.value)}),o.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Any OpenAI-compatible endpoint — Ollama, LM Studio, llama.cpp, vLLM"})]}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("label",{className:"text-xs text-zinc-500",htmlFor:`api-key-${e}`,children:["API Key",i?" (optional)":""]}),t&&o.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 ","↗"]})]}),o.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:a,onChange:F=>l(F.target.value)})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`model-${e}`,children:"Model (optional)"}),o.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:$,value:f,onChange:F=>p(F.target.value)})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-xs text-zinc-500",children:"Quota (optional)"}),o.jsxs("div",{className:"mt-0.5 grid grid-cols-3 gap-1.5",children:[o.jsxs("div",{children:[o.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:m,onChange:F=>g(F.target.value)}),o.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Max concurrent"})]}),o.jsxs("div",{children:[o.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=>S(F.target.value)}),o.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per minute"})]}),o.jsxs("div",{children:[o.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:b,onChange:F=>j(F.target.value)}),o.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),C&&o.jsx("p",{className:"text-xs text-rose-400",children:C}),P&&o.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),o.jsx(be,{type:"button",size:"sm",disabled:!_||k,onClick:T,children:k?"Saving...":"Save"})]})}function a_e({onSaved:e}){const[t,n]=x.useState(""),[r,i]=x.useState(""),[a,l]=x.useState(!1),[u,d]=x.useState(null),[f,p]=x.useState(!1),m=t.trim().length>0&&r.trim().length>0;async function g(){if(m){l(!0),d(null),p(!1);try{await rV({clientId:t.trim(),clientSecret:r.trim()}),n(""),i(""),p(!0),vt({title:"Google OAuth app updated",detail:"Dashboard Google credentials were saved.",tone:"positive",dedupeKey:"settings:google-oauth",dedupeMode:"replace"}),e()}catch(v){d(v instanceof Error?v.message:"Failed to update Google OAuth credentials")}finally{l(!1)}}}return o.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-id",children:"Client ID"}),o.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 ","↗"]})]}),o.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)})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-secret",children:"Client secret"}),o.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)})]}),o.jsxs("p",{className:"text-[11px] text-zinc-500",children:["These credentials are stored in ",o.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Search Console connections are created separately per canonical domain."]}),u&&o.jsx("p",{className:"text-xs text-rose-400",children:u}),f&&o.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),o.jsx(be,{type:"button",size:"sm",disabled:!m||a,onClick:g,children:a?"Saving...":"Save Google OAuth app"})]})}function s_e(){const[e,t]=x.useState(null),[n,r]=x.useState(null),[i,a]=x.useState(!1),[l,u]=x.useState("localhost"),[d,f]=x.useState("9222"),[p,m]=x.useState(!1);return x.useEffect(()=>{x2().then(t).catch(g=>{const v=g instanceof Error?g.message:String(g);v.includes("501")||r(v)})},[]),o.jsxs($e,{className:"surface-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Browser provider"}),o.jsx("h2",{children:"ChatGPT (CDP)"})]}),o.jsx(Xe,{tone:e?.connected?"positive":"caution",children:e?.connected?"Connected":"Not connected"})]}),o.jsxs("dl",{className:"definition-list mt-3",children:[e?.endpoint&&o.jsxs("div",{children:[o.jsx("dt",{children:"Endpoint"}),o.jsx("dd",{className:"font-mono text-xs",children:e.endpoint})]}),e?.browserVersion&&o.jsxs("div",{children:[o.jsx("dt",{children:"Browser"}),o.jsx("dd",{className:"text-xs",children:e.browserVersion})]}),e?.targets&&e.targets.length>0&&o.jsxs("div",{children:[o.jsx("dt",{children:"Tabs"}),o.jsx("dd",{children:e.targets.map(g=>o.jsxs("span",{className:"mr-2",children:[g.name,": ",g.alive?"● alive":"○ idle"]},g.name))})]})]}),o.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"}),o.jsx("div",{className:"mt-2",children:o.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>a(!i),children:i?"Cancel":e?.connected?"Update endpoint":"Configure"})}),i&&o.jsxs("form",{className:"mt-3 flex flex-col gap-2",onSubmit:async g=>{g.preventDefault(),m(!0);try{await CV(l,parseInt(d,10)||9222);const v=await x2().catch(()=>null);v&&t(v),a(!1),vt({title:"CDP endpoint saved",detail:`${l}:${parseInt(d,10)||9222} is now configured.`,tone:"positive",dedupeKey:"settings:cdp",dedupeMode:"replace"})}catch(v){r(v instanceof Error?v.message:String(v))}finally{m(!1)}},children:[o.jsxs("div",{className:"flex gap-2",children:[o.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:g=>u(g.target.value),"aria-label":"CDP host"}),o.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:d,onChange:g=>f(g.target.value),"aria-label":"CDP port"})]}),o.jsx("div",{children:o.jsx(be,{type:"submit",size:"sm",disabled:p,children:p?"Saving…":"Save endpoint"})})]})]})}const o_e={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function l_e(){const e=Vh(),{dashboard:t}=wc(),n=t?.settings??e?.dashboard?.settings,a=Bv(!e,e?.health).data??e?.health??o_e,[l,u]=x.useState(null),[d,f]=x.useState(!1),[p,m]=x.useState(!1),[g,v]=x.useState(""),[S,b]=x.useState(!1),[j,k]=x.useState(null),[E,C]=x.useState(!1);return n?o.jsxs("div",{className:"page-container",children:[o.jsx("div",{className:"page-header",children:o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:"Settings"}),o.jsx("p",{className:"page-subtitle",children:"Provider state, Google OAuth, Bing WMT setup, and service health."})]})}),o.jsxs("section",{className:"settings-grid",children:[n.providerStatuses.map(A=>o.jsxs($e,{className:"surface-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Provider"}),o.jsx("h2",{children:A.displayName??A.name})]}),o.jsx(Xe,{tone:A.state==="ready"?"positive":"caution",children:A.state==="ready"?"Ready":"Needs config"})]}),o.jsxs("dl",{className:"definition-list mt-3",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Model"}),o.jsx("dd",{className:"font-mono text-xs",children:A.model})]}),A.quota&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Concurrency"}),o.jsx("dd",{children:A.quota.maxConcurrency})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Rate limit"}),o.jsxs("dd",{children:[A.quota.maxRequestsPerMinute,"/min · ",A.quota.maxRequestsPerDay,"/day"]})]})]})]}),o.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:A.detail}),o.jsx("div",{className:"mt-2",children:o.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>u(l===A.name?null:A.name),children:l===A.name?"Cancel":A.state==="ready"?A.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),l===A.name&&o.jsx(i_e,{providerName:A.name,keyUrl:A.keyUrl,modelHint:A.modelHint,onSaved:()=>{u(null)}})]},A.name)),o.jsxs($e,{className:"surface-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Google"}),o.jsx("h2",{children:"Search Console OAuth"})]}),o.jsx(Xe,{tone:n.google.state==="ready"?"positive":"caution",children:n.google.state==="ready"?"Ready":"Needs config"})]}),o.jsxs("dl",{className:"definition-list mt-3",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Auth model"}),o.jsx("dd",{children:"One app credential set, then one OAuth connection per project domain"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Storage"}),o.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),o.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:n.google.detail}),o.jsx("div",{className:"mt-2",children:o.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>f(!d),children:d?"Cancel":n.google.state==="ready"?"Update OAuth app":"Configure Google OAuth"})}),d&&o.jsx(a_e,{onSaved:()=>{f(!1)}})]}),o.jsxs($e,{className:"surface-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Bing"}),o.jsx("h2",{children:"Webmaster Tools"})]}),o.jsx(Xe,{tone:n.bing.state==="ready"?"positive":"caution",children:n.bing.state==="ready"?"Ready":"Needs config"})]}),o.jsxs("dl",{className:"definition-list mt-3",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Auth model"}),o.jsx("dd",{children:"API key authentication — no OAuth needed"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Storage"}),o.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),o.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:n.bing.detail}),o.jsx("div",{className:"mt-2",children:o.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>m(!p),children:p?"Cancel":n.bing.state==="ready"?"Update API key":"Configure Bing"})}),p&&o.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),o.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"})]}),o.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:g,onChange:A=>v(A.target.value)})]}),o.jsxs("p",{className:"text-[11px] text-zinc-500",children:["This key is stored in ",o.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Bing connections are created separately per canonical domain."]}),j&&o.jsx("p",{className:"text-xs text-rose-400",children:j}),E&&o.jsx("p",{className:"text-xs text-emerald-400",children:"Bing API key updated."}),o.jsx(be,{type:"button",size:"sm",disabled:!g.trim()||S,onClick:async()=>{if(g.trim()){b(!0),k(null),C(!1);try{await PV(g.trim()),v(""),C(!0),m(!1),vt({title:"Bing API key updated",detail:"Dashboard Bing credentials were saved.",tone:"positive",dedupeKey:"settings:bing",dedupeMode:"replace"})}catch(A){k(A instanceof Error?A.message:"Failed to update Bing API key")}finally{b(!1)}}},children:S?"Saving...":"Save Bing API key"})]})]}),o.jsx(s_e,{}),o.jsxs($e,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Service health"}),o.jsx("h2",{children:"API and worker"})]})}),o.jsxs("div",{className:"compact-stack",children:[o.jsxs("div",{className:"health-row",children:[o.jsxs("div",{children:[o.jsx("p",{className:"run-row-title",children:"API"}),o.jsx("p",{className:"supporting-copy",children:a.apiStatus.detail})]}),o.jsx(Xe,{tone:dy(a.apiStatus),title:Ho(a.apiStatus),children:a.apiStatus.state==="ok"?"Healthy":"Attention"})]}),o.jsxs("div",{className:"health-row",children:[o.jsxs("div",{children:[o.jsx("p",{className:"run-row-title",children:"Worker"}),o.jsx("p",{className:"supporting-copy",children:a.workerStatus.detail})]}),o.jsx(Xe,{tone:dy(a.workerStatus),title:Ho(a.workerStatus),children:a.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),o.jsx("section",{className:"page-section",children:o.jsxs($e,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Self-host notes"}),o.jsx("h2",{children:"Operational guidance"})]})}),o.jsx("ul",{className:"detail-list",children:n.selfHostNotes.map(A=>o.jsx("li",{children:A},A))}),o.jsx("p",{className:"supporting-copy",children:n.bootstrapNote})]})})]}):null}const c_e=[{label:"System check",description:"Verify your instance is ready"},{label:"Create project",description:"Name, domain, and locale"},{label:"Queries",description:"Add queries to track"},{label:"Competitors",description:"Add competitor domains"},{label:"Launch",description:"Start your first visibility sweep"}];function u_e({current:e,labels:t}){return o.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:t.map((n,r)=>{const i=r<e,a=r===e;return o.jsxs("div",{className:`setup-step ${i?"setup-step-done":""} ${a?"setup-step-active":""}`,role:"listitem","aria-current":a?"step":void 0,children:[o.jsx("span",{className:"setup-step-number",children:i?"✓":r+1}),o.jsx("span",{className:"setup-step-label",children:n.label})]},n.label)})})}function d_e(){const e=Vh(),{dashboard:t,isLoading:n,refetch:r}=wc(),i=t??e?.dashboard;if(!i||n)return o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-24"}),o.jsx("div",{className:"skeleton-text-sm w-80"})]}),o.jsxs("div",{className:"page-skeleton-card",children:[o.jsx("div",{className:"skeleton-text w-32"}),o.jsx("div",{className:"space-y-3 mt-3",children:[1,2,3].map(fe=>o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1 flex-1",children:[o.jsx("div",{className:"skeleton-text w-24"}),o.jsx("div",{className:"skeleton-text-sm w-48"})]}),o.jsx("div",{className:"skeleton h-6 w-16 rounded-full"})]},fe))})]})]});const a=i.settings,d=Bv(!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=wte(i.setup,d,a),p=Qo(),[m,g]=x.useState(0),[v,S]=x.useState(""),[b,j]=x.useState(""),[k,E]=x.useState(""),[C,A]=x.useState("US"),[P,O]=x.useState("en"),[_,T]=x.useState(!1),[$,F]=x.useState(null),[U,B]=x.useState(null),[V,X]=x.useState(null),[Z,H]=x.useState(!1),[J,oe]=x.useState(""),[ye,I]=x.useState(!1),[M,q]=x.useState(null),[D,G]=x.useState(!1),se=a.providerStatuses.filter(fe=>fe.state==="ready"),[ne,Ce]=x.useState(se[0]?.name??""),[je,ee]=x.useState(5),[pe,Ee]=x.useState(!1),[W,He]=x.useState(null),[Te,st]=x.useState(""),[Ve,Ht]=x.useState(!1),[Lt,un]=x.useState(null),[tn,Se]=x.useState(!1),[Ze,Tt]=x.useState(!1),[mt,Je]=x.useState(!1),ce=IF(),Ne=v.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),Me=J.split(`
|
|
295
|
-
`).map(fe=>fe.trim()).filter(Boolean),Ge=Te.split(`
|
|
296
|
-
`).map(fe=>fe.trim()).filter(Boolean),pt=f.healthChecks.some(fe=>fe.id==="api"&&fe.state==="ready"),mn=async()=>{if(!(!Ne||!k)){H(!0),X(null);try{const fe=await Cv(Ne,{displayName:b||v,canonicalDomain:k,country:C,language:P,autoExtractBacklinks:_});F(Ne),B(fe.id),vt({title:"Project created",detail:`${fe.displayName||fe.name} is ready for setup.`,tone:"positive",dedupeKey:`project:create:${fe.name}`,dedupeMode:"drop"}),r(),g(2)}catch(fe){X(fe instanceof Error?fe.message:"Failed to create project")}finally{H(!1)}}},An=async()=>{if(!$)return;const fe=Me;if(fe.length!==0){G(!0),q(null);try{await HG($,fe),I(!0),r(),g(3)}catch(Qe){q(Qe instanceof Error?Qe.message:"Failed to save queries")}finally{G(!1)}}},gn=async()=>{if(!(!$||!ne)){Ee(!0),He(null);try{const fe=await uV($,ne,je);if(fe.queries.length>0){const Qe=J?J.trimEnd()+`
|
|
297
|
-
`+fe.queries.join(`
|
|
298
|
-
`):fe.queries.join(`
|
|
299
|
-
`);oe(Qe)}}catch(fe){He(fe instanceof Error?fe.message:"Failed to generate queries")}finally{Ee(!1)}}},Ye=async()=>{if(!$)return;const fe=Ge;if(fe.length!==0){Se(!0),un(null);try{await b5($,fe),Ht(!0),r(),g(4)}catch(Qe){un(Qe instanceof Error?Qe.message:"Failed to save competitors")}finally{Se(!1)}}},Kt=async()=>{if($){Je(!0);try{await ce.mutateAsync({projectName:$,projectLabel:b||v||$,sourceAction:"setup-launch"}),Tt(!0),r()}catch{}finally{Je(!1)}}},de=()=>g(fe=>Math.max(0,fe-1)),ze=(()=>{switch(m){case 0:return o.jsxs($e,{className:"surface-card step-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),o.jsx("h2",{children:"System ready"})]})}),o.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),o.jsx("div",{className:"compact-stack",children:f.healthChecks.map(fe=>o.jsxs("div",{className:"health-check-row",children:[o.jsxs("div",{children:[o.jsx("p",{className:"run-row-title",children:fe.label}),o.jsx("p",{className:"supporting-copy",children:fe.detail}),fe.id==="provider"&&fe.state!=="ready"&&o.jsx(Zt,{to:"/settings",className:"text-emerald-400 hover:text-emerald-300 text-sm mt-1 underline underline-offset-2 cursor-pointer",children:"Configure providers"})]}),o.jsx(Xe,{tone:fe.state==="ready"?"positive":"caution",title:fe.id==="api"?Ho(d.apiStatus):fe.id==="worker"?Ho(d.workerStatus):fe.detail,children:fe.state==="ready"?"Ready":"Attention"})]},fe.id))}),o.jsxs("div",{className:"setup-nav",children:[o.jsx("span",{}),o.jsx(be,{type:"button",disabled:!pt,onClick:()=>g(1),children:"Continue"})]})]});case 1:return o.jsxs($e,{className:"surface-card step-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 2 of 5"}),o.jsx("h2",{children:"Create project"})]}),$?o.jsx(Xe,{tone:"positive",children:"Created"}):null]}),$?o.jsxs("div",{className:"compact-stack",children:[o.jsxs("p",{className:"text-zinc-300",children:["Project ",o.jsx("span",{className:"text-zinc-100 font-medium",children:$})," created successfully."]}),o.jsxs("div",{className:"setup-nav",children:[o.jsx(be,{type:"button",variant:"outline",onClick:de,children:"Back"}),o.jsx(be,{type:"button",onClick:()=>g(2),children:"Continue"})]})]}):o.jsxs("div",{className:"compact-stack",children:[o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"project-name",children:"Project name"}),o.jsx("input",{id:"project-name",className:"setup-input",type:"text",placeholder:"my-website",value:v,onChange:fe=>S(fe.target.value)}),Ne&&Ne!==v?o.jsxs("p",{className:"supporting-copy",children:["Slug: ",Ne]}):null]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),o.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:b,onChange:fe=>j(fe.target.value)})]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),o.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:k,onChange:fe=>E(fe.target.value)})]}),o.jsxs("div",{className:"setup-field-row",children:[o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),o.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:C,onChange:fe=>A(fe.target.value.toUpperCase())})]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),o.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:P,onChange:fe=>O(fe.target.value.toLowerCase())})]})]}),o.jsxs("label",{className:"flex items-start gap-3 rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3 cursor-pointer hover:border-zinc-700",children:[o.jsx("input",{type:"checkbox",className:"mt-0.5 h-4 w-4 rounded border-zinc-700 bg-zinc-950",checked:_,onChange:fe=>T(fe.target.checked)}),o.jsxs("span",{className:"flex-1",children:[o.jsx("span",{className:"block text-sm text-zinc-100",children:"Auto-extract backlinks"}),o.jsxs("span",{className:"block text-xs text-zinc-500 mt-0.5",children:["When a new Common Crawl release syncs, automatically extract backlinks for this project."," ",o.jsx(Zt,{to:"/backlinks",className:"text-emerald-400 hover:text-emerald-300 underline underline-offset-2",children:"Manage backlinks"})]})]})]}),V?o.jsx("p",{className:"text-rose-400 text-sm",children:V}):null,o.jsxs("div",{className:"setup-nav",children:[o.jsx(be,{type:"button",variant:"outline",onClick:de,children:"Back"}),o.jsx(be,{type:"button",disabled:!Ne||!k||Z,onClick:mn,children:Z?"Creating...":"Create project"})]})]})]});case 2:return o.jsxs($e,{className:"surface-card step-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),o.jsx("h2",{children:"Add queries"})]}),ye?o.jsxs(Xe,{tone:"positive",children:[Me.length," saved"]}):o.jsxs(Xe,{tone:"neutral",children:[Me.length," quer",Me.length!==1?"ies":"y"]})]}),o.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),ye?o.jsxs("div",{className:"compact-stack",children:[o.jsx("ul",{className:"detail-list",children:Me.map(fe=>o.jsx("li",{children:fe},fe))}),o.jsxs("div",{className:"setup-nav",children:[o.jsx(be,{type:"button",variant:"outline",onClick:de,children:"Back"}),o.jsx(be,{type:"button",onClick:()=>g(3),children:"Continue"})]})]}):o.jsxs("div",{className:"compact-stack",children:[se.length>0?o.jsxs("div",{className:"compact-stack",children:[o.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[o.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"auto-generate",o.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),o.jsxs("div",{className:"flex items-end gap-2",children:[o.jsxs("div",{className:"setup-field flex-1",children:[o.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),o.jsx("select",{id:"gen-provider",className:"setup-input",value:ne,onChange:fe=>Ce(fe.target.value),children:se.map(fe=>o.jsxs("option",{value:fe.name,children:[fe.displayName??fe.name,fe.model?` (${fe.model})`:""]},fe.name))})]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"gen-count",children:"Count"}),o.jsx("select",{id:"gen-count",className:"setup-input",value:je,onChange:fe=>ee(Number(fe.target.value)),children:[3,5,10,15,20].map(fe=>o.jsx("option",{value:fe,children:fe},fe))})]}),o.jsx(be,{type:"button",variant:"outline",disabled:pe||!ne,onClick:gn,children:pe?"Analyzing site...":"Generate"})]}),W?o.jsx("p",{className:"text-rose-400 text-sm",children:W}):null]}):null,o.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[o.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",o.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"queries",children:"Queries (one per line)"}),o.jsx("textarea",{id:"queries",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
|
|
300
|
-
best invisalign downtown brooklyn
|
|
301
|
-
pediatric dentist brooklyn heights`,value:J,onChange:fe=>oe(fe.target.value)})]}),M?o.jsx("p",{className:"text-rose-400 text-sm",children:M}):null,o.jsxs("div",{className:"setup-nav",children:[o.jsx(be,{type:"button",variant:"outline",onClick:de,children:"Back"}),o.jsx(be,{type:"button",disabled:Me.length===0||D,onClick:An,children:D?"Saving...":`Save ${Me.length} quer${Me.length!==1?"ies":"y"}`})]})]})]});case 3:return o.jsxs($e,{className:"surface-card step-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 4 of 5"}),o.jsx("h2",{children:"Add competitors"})]}),Ve?o.jsx(Xe,{tone:"positive",children:"Saved"}):null]}),o.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same queries. One per line."}),Ve?o.jsxs("div",{className:"compact-stack",children:[o.jsx("ul",{className:"detail-list",children:Ge.map(fe=>o.jsx("li",{children:fe},fe))}),o.jsxs("div",{className:"setup-nav",children:[o.jsx(be,{type:"button",variant:"outline",onClick:de,children:"Back"}),o.jsx(be,{type:"button",onClick:()=>g(4),children:"Continue"})]})]}):o.jsxs("div",{className:"compact-stack",children:[o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"competitors",children:"Competitor domains (one per line)"}),o.jsx("textarea",{id:"competitors",className:"setup-textarea",rows:4,placeholder:`competitor1.com
|
|
302
|
-
competitor2.com`,value:Te,onChange:fe=>st(fe.target.value)})]}),Lt?o.jsx("p",{className:"text-rose-400 text-sm",children:Lt}):null,o.jsxs("div",{className:"setup-nav",children:[o.jsx(be,{type:"button",variant:"outline",onClick:de,children:"Back"}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(be,{type:"button",variant:"outline",onClick:()=>g(4),children:"Skip"}),o.jsx(be,{type:"button",disabled:Ge.length===0||tn,onClick:Ye,children:tn?"Saving...":`Save ${Ge.length} competitor${Ge.length!==1?"s":""}`})]})]})]})]});case 4:return o.jsxs($e,{className:"surface-card step-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),o.jsx("h2",{children:"Launch first run"})]}),Ze?o.jsx(Xe,{tone:"positive",children:"Queued"}):null]}),Ze?o.jsxs("div",{className:"compact-stack",children:[o.jsx("p",{className:"text-zinc-300",children:"Visibility sweep has been queued. View progress on the project page."}),o.jsxs("div",{className:"setup-nav",children:[o.jsx("span",{}),o.jsx(be,{type:"button",onClick:()=>p({to:U?`/projects/${U}`:"/"}),children:"Open project"})]})]}):o.jsxs("div",{className:"compact-stack",children:[o.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",o.jsx("span",{className:"text-zinc-100 font-medium",children:$}),"."]}),o.jsxs("div",{className:"setup-nav",children:[o.jsx(be,{type:"button",variant:"outline",onClick:de,children:"Back"}),o.jsx(be,{type:"button",disabled:mt,onClick:Kt,children:mt?"Launching...":"Launch visibility sweep"})]})]})]});default:return null}})();return o.jsxs("div",{className:"page-container",children:[o.jsx("div",{className:"page-header",children:o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:"Setup"}),o.jsx("p",{className:"page-subtitle",children:"Create a project, add queries, add competitors, and launch the first run."})]})}),o.jsx(u_e,{current:m,labels:c_e}),o.jsx("section",{className:"setup-wizard",children:ze})]})}function Nu({children:e,label:t="More info",placement:n="top",className:r}){const i=x.useId(),[a,l]=x.useState(!1);return o.jsxs("span",{className:`relative inline-flex ${r??""}`,children:[o.jsx("button",{type:"button","aria-label":t,"aria-describedby":a?i:void 0,className:"inline-flex h-4 w-4 items-center justify-center rounded-full text-zinc-500 hover:text-zinc-200 focus:text-zinc-200 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-500",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onFocus:()=>l(!0),onBlur:()=>l(!1),children:o.jsx(T5,{className:"h-3.5 w-3.5","aria-hidden":!0})}),a&&o.jsx("span",{id:i,role:"tooltip",className:`absolute z-50 w-64 rounded border border-zinc-700 bg-zinc-900 px-3 py-2 text-xs font-normal leading-relaxed text-zinc-200 shadow-lg ${n==="top"?"bottom-full mb-2":"top-full mt-2"} left-1/2 -translate-x-1/2 whitespace-normal`,children:e})]})}const f_e="https://commoncrawl.org/web-graphs";function Ej(e){return e==null?"—":e>=1e12?`${(e/1e12).toFixed(1)} TB`:e>=1e9?`${(e/1e9).toFixed(1)} GB`:e>=1e6?`${(e/1e6).toFixed(1)} MB`:e>=1e3?`${(e/1e3).toFixed(1)} KB`:`${e} B`}function _g(e){if(!e)return"—";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 _j(e){switch(e){case"ready":return"positive";case"failed":return"negative";case"downloading":case"querying":case"queued":return"caution"}}function h_e(){const[e,t]=x.useState(null),[n,r]=x.useState(null),[i,a]=x.useState([]),[l,u]=x.useState([]),[d,f]=x.useState(null),[p,m]=x.useState(!0),[g,v]=x.useState(!1),[S,b]=x.useState(!1),[j,k]=x.useState(""),[E,C]=x.useState(!1),[A,P]=x.useState(null),[O,_]=x.useState(null),T=x.useCallback(async()=>{m(!0),P(null);try{const[V,X,Z,H,J]=await Promise.all([GV(),A5().catch(()=>null),QV().catch(()=>[]),WV().catch(()=>[]),ZV().catch(()=>null)]);t(V),r(X),a(Z),u(H),f(J)}catch(V){P(V instanceof Error?V.message:"Failed to load backlinks status")}finally{m(!1)}},[]);x.useEffect(()=>{T()},[T]);async function $(){v(!0),P(null),_(null);try{const V=await VV();_(V.alreadyPresent?`DuckDB already installed (${V.version}).`:`Installed DuckDB ${V.version}.`),await T()}catch(V){P(V instanceof Error?V.message:"Failed to install DuckDB")}finally{v(!1)}}async function F(){const V=j.trim()||void 0;b(!0),P(null),_(null);try{const X=await YV(V);_(V?`Queued sync for ${X.release}. Download + query runs in the background.`:`Queued sync for auto-discovered release ${X.release}. Download + query runs in the background.`),k(""),C(!1),await T()}catch(X){X instanceof Jr&&X.code==="MISSING_DEPENDENCY"?P("DuckDB is not installed. Install it first."):P(X instanceof Error?X.message:"Failed to trigger sync")}finally{b(!1)}}async function U(V){P(null),_(null);try{await XV(V),_(`Pruned cached release ${V}.`),await T()}catch(X){P(X instanceof Error?X.message:"Failed to prune release")}}const B=n?.status==="ready"&&l.every(V=>V.release!==n.release);return o.jsxs("div",{className:"page-container",children:[o.jsx("div",{className:"page-header",children:o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:"Backlinks"}),o.jsx("p",{className:"page-subtitle",children:"Find domains that link to your projects, computed from the open Common Crawl web graph. Runs entirely on your machine — nothing is sent to third parties."})]})}),o.jsx($e,{className:"surface-card p-4 mb-6 border-amber-800/60",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(iy,{className:"h-5 w-5 text-amber-400 shrink-0 mt-0.5","aria-hidden":!0}),o.jsxs("div",{className:"text-sm text-zinc-300 leading-relaxed",children:[o.jsx("p",{className:"font-medium text-amber-200",children:"Heads up — a release sync is a large download."}),o.jsxs("ul",{className:"mt-1.5 space-y-1 text-zinc-400",children:[o.jsxs("li",{children:[o.jsx("span",{className:"text-zinc-200",children:"~16 GB"})," of gzipped vertex + edge files per release, stored at"," ",o.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"}),"."]}),o.jsxs("li",{children:[o.jsx("span",{className:"text-zinc-200",children:"10–20 min on a fast connection"})," for the download, then ~5 min for the DuckDB query."]}),o.jsx("li",{children:"One sync covers every project in this workspace. Releases are immutable, so the download only happens once per release."})]})]})]})}),o.jsxs("section",{className:"page-section-divider",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"About"}),o.jsx("h2",{children:"How it works"})]})}),o.jsxs($e,{className:"surface-card p-5",children:[o.jsxs("p",{className:"text-sm text-zinc-400 leading-relaxed max-w-3xl mb-4",children:["Common Crawl publishes a quarterly snapshot of the public web’s hyperlink graph. Canonry downloads one"," ",o.jsx("span",{className:"text-zinc-200",children:"release"})," at a time and extracts backlinks for every project in this workspace in a single pass."]}),o.jsxs("ol",{className:"space-y-3 text-sm text-zinc-400 max-w-3xl",children:[o.jsxs("li",{className:"flex gap-3",children:[o.jsx("span",{className:"shrink-0 inline-flex h-6 w-6 items-center justify-center rounded-full border border-zinc-700 bg-zinc-900 text-xs font-semibold text-zinc-300 tabular-nums",children:"1"}),o.jsxs("span",{children:[o.jsx("span",{className:"text-zinc-200 font-medium",children:"Download (one-time, ~16 GB)"})," — vertex + edge files cached to"," ",o.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"}),". Runs once per release; subsequent operations reuse the cache."]})]}),o.jsxs("li",{className:"flex gap-3",children:[o.jsx("span",{className:"shrink-0 inline-flex h-6 w-6 items-center justify-center rounded-full border border-zinc-700 bg-zinc-900 text-xs font-semibold text-zinc-300 tabular-nums",children:"2"}),o.jsxs("span",{children:[o.jsx("span",{className:"text-zinc-200 font-medium",children:"Query (~5 min)"})," — one DuckDB pass scans the cached files and extracts referring domains for every project’s canonical domain. DuckDB is only used to ",o.jsx("span",{className:"text-zinc-200",children:"read"})," these dumps; it doesn’t store any canonry state."]})]}),o.jsxs("li",{className:"flex gap-3",children:[o.jsx("span",{className:"shrink-0 inline-flex h-6 w-6 items-center justify-center rounded-full border border-zinc-700 bg-zinc-900 text-xs font-semibold text-zinc-300 tabular-nums",children:"3"}),o.jsxs("span",{children:[o.jsx("span",{className:"text-zinc-200 font-medium",children:"Persist"})," — results land in the same SQLite database the rest of canonry uses. After the first sync, per-project reads (and re-run extracts against the cached release) are instant."]})]})]})]})]}),A&&o.jsx($e,{className:"surface-card p-4 mb-4 border-rose-800/60",children:o.jsx("p",{className:"text-sm text-rose-300",children:A})}),O&&o.jsx($e,{className:"surface-card p-4 mb-4 border-emerald-800/60",children:o.jsx("p",{className:"text-sm text-emerald-300",children:O})}),o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dependency"}),o.jsxs("h2",{className:"flex items-center gap-2",children:["DuckDB install status",o.jsxs(Nu,{label:"Why DuckDB?",children:[o.jsx("span",{className:"block",children:"DuckDB is a query engine canonry uses to scan the ~16 GB Common Crawl dumps and pull out your referring domains."}),o.jsxs("span",{className:"mt-2 block text-zinc-400",children:["It does ",o.jsx("span",{className:"text-zinc-200",children:"not"})," store any canonry data — your backlink results live in SQLite alongside the rest of your projects. DuckDB is purely a tool for processing the raw CSV files."]}),o.jsxs("span",{className:"mt-2 block text-zinc-500",children:["Installed on demand (not bundled) into ",o.jsx("code",{className:"text-zinc-300",children:"~/.canonry/plugins/"})," so users who never run backlinks don’t pay the ~40 MB install cost."]})]})]})]}),e?.duckdbInstalled?o.jsx(Xe,{tone:"positive",children:"Installed"}):o.jsx(Xe,{tone:"caution",children:"Not installed"})]}),o.jsx($e,{className:"surface-card p-5",children:p?o.jsx("p",{className:"text-sm text-zinc-500",children:"Checking…"}):e?.duckdbInstalled?o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(P5,{className:"h-5 w-5 text-emerald-400 shrink-0 mt-0.5","aria-hidden":!0}),o.jsxs("div",{children:[o.jsxs("p",{className:"text-sm text-zinc-200",children:["Version ",e.duckdbVersion??"unknown"," installed at"," ",o.jsx("code",{className:"text-zinc-300",children:e.pluginDir})]}),o.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Required spec: ",e.duckdbSpec]})]})]}):o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(kQ,{className:"h-5 w-5 text-amber-400 shrink-0 mt-0.5","aria-hidden":!0}),o.jsxs("div",{className:"flex-1",children:[o.jsx("p",{className:"text-sm text-zinc-200",children:"DuckDB is not installed. It’s the query engine canonry uses to scan Common Crawl dumps — required before you can run a release sync or per-project extract."}),o.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:"Installing doesn’t touch your project data. DuckDB only reads the downloaded CSV files; backlink results are written to the same SQLite database canonry already uses."}),e&&o.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Will be installed into ",o.jsx("code",{className:"text-zinc-300",children:e.pluginDir})," (~40 MB)."]}),o.jsx("div",{className:"mt-3",children:o.jsxs(be,{type:"button",size:"sm",disabled:g,onClick:$,children:[o.jsx(Av,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),g?"Installing…":"Install DuckDB"]})})]})]})})]}),o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Latest sync"}),o.jsxs("h2",{className:"flex items-center gap-2",children:["Release sync",o.jsx(Nu,{label:"What is a release sync?",children:"A release sync downloads one Common Crawl dump (~16 GB) and extracts backlinks for every project in this workspace in one pass. This is the heavy job — subsequent per-project re-runs skip the download and just re-query the cached files."})]})]}),n&&o.jsx(Xe,{tone:_j(n.status),children:n.status})]}),o.jsxs($e,{className:"surface-card p-5",children:[o.jsxs("p",{className:"text-xs text-zinc-500 max-w-3xl mb-4",children:["A release is one Common Crawl dump (e.g. ",o.jsx("code",{className:"text-zinc-400",children:"cc-main-2026-jan-feb-mar"}),"). Syncing it downloads the graph and populates backlinks for every project in this workspace."]}),n?o.jsxs("div",{className:"space-y-2 text-sm",children:[o.jsxs("p",{className:"text-zinc-200",children:["Release ",o.jsx("code",{className:"text-zinc-300",children:n.release})]}),n.phaseDetail&&o.jsx("p",{className:"text-zinc-500",children:n.phaseDetail}),o.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-xs text-zinc-500 pt-2",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-zinc-600 uppercase tracking-wide",children:"Projects"}),o.jsx("p",{className:"text-zinc-300 mt-0.5",children:n.projectsProcessed??"—"})]}),o.jsxs("div",{children:[o.jsxs("p",{className:"text-zinc-600 uppercase tracking-wide flex items-center gap-1",children:["Rows",o.jsx(Nu,{label:"What are rows?",children:"Total number of (project, referring domain) pairs persisted in SQLite from this sync, across every project in the workspace."})]}),o.jsx("p",{className:"text-zinc-300 mt-0.5",children:n.domainsDiscovered??"—"})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-zinc-600 uppercase tracking-wide",children:"Started"}),o.jsx("p",{className:"text-zinc-300 mt-0.5",children:_g(n.downloadStartedAt??n.createdAt)})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-zinc-600 uppercase tracking-wide",children:"Finished"}),o.jsx("p",{className:"text-zinc-300 mt-0.5",children:_g(n.queryFinishedAt)})]})]}),n.error&&o.jsx("p",{className:"text-sm text-rose-400 pt-2",children:n.error})]}):o.jsx("p",{className:"text-sm text-zinc-500",children:"No release sync has run in this workspace yet."}),B&&o.jsx("div",{className:"mt-4 rounded border border-amber-800/60 bg-amber-950/20 p-3",children:o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(iy,{className:"h-4 w-4 text-amber-400 shrink-0 mt-0.5","aria-hidden":!0}),o.jsxs("div",{className:"text-xs text-zinc-300 leading-relaxed",children:[o.jsx("p",{className:"font-medium text-amber-200",children:"Cached files for this release are missing."}),o.jsxs("p",{className:"mt-1 text-zinc-400",children:["The sync record in the database says this release finished successfully, but the ~16 GB dump at"," ",o.jsxs("code",{className:"text-zinc-300",children:["~/.canonry/cache/commoncrawl/",n?.release,"/"]})," isn’t on disk. Your backlink data is still intact (it lives in SQLite), but per-project re-run extracts will fail until you either re-sync this release or start a new one."]})]})]})}),o.jsxs("div",{className:"mt-4 rounded border border-zinc-800 bg-zinc-900/40 p-3",children:[o.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Auto-detected release"}),d?o.jsxs("p",{className:"text-sm text-zinc-200 mt-0.5",children:[o.jsx("code",{className:"text-zinc-100",children:d.release}),o.jsxs("span",{className:"ml-2 text-xs text-zinc-500",children:["— vertex ",Ej(d.vertexBytes),", edges ",Ej(d.edgesBytes)]})]}):o.jsx("p",{className:"text-sm text-zinc-500 mt-0.5",children:p?"Probing Common Crawl…":"Could not auto-detect — pass an explicit release below."}),o.jsxs("a",{href:f_e,target:"_blank",rel:"noopener noreferrer",className:"mt-1 inline-flex items-center gap-1 text-xs text-zinc-400 hover:text-zinc-200 focus:text-zinc-200 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-500 rounded",children:["Browse all Common Crawl web-graph releases",o.jsx(PQ,{className:"h-3 w-3","aria-hidden":!0})]})]}),o.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[o.jsxs(be,{type:"button",size:"sm",disabled:S||!e?.duckdbInstalled||!d&&!j.trim(),onClick:F,children:[o.jsx(ry,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),S?"Queuing…":"Run sync"]}),o.jsxs(Nu,{label:"What does Run sync do?",children:[o.jsxs("span",{className:"block",children:["Downloads the auto-detected (or chosen) Common Crawl release (~16 GB) to"," ",o.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"}),", then runs a single DuckDB query that extracts referring domains for every project in this workspace."]}),o.jsxs("span",{className:"mt-2 block text-zinc-400",children:["First time for a release: ",o.jsx("span",{className:"text-zinc-200",children:"~10–20 min download + ~5 min query"}),". Re-running the same release later: ",o.jsx("span",{className:"text-zinc-200",children:"skips download, just re-queries"})," (~5 min)."]})]})]})]}),E?o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx("input",{type:"text",className:"flex-1 min-w-[240px] rounded border border-zinc-700 bg-transparent px-2.5 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"cc-main-2026-jan-feb-mar",value:j,onChange:V=>k(V.target.value),disabled:S,autoFocus:!0}),o.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300 focus:text-zinc-300 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-500 rounded",onClick:()=>{k(""),C(!1)},disabled:S,children:"Cancel"})]}):o.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300 focus:text-zinc-300 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-500 rounded",onClick:()=>C(!0),disabled:S,children:"Use a different release →"})]}),!e?.duckdbInstalled&&o.jsx("p",{className:"text-xs text-zinc-600 mt-2",children:"Install DuckDB first to enable sync."})]})]}),o.jsxs("section",{className:"page-section-divider",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Cached releases"}),o.jsxs("h2",{className:"flex items-center gap-2",children:["Local disk cache",o.jsxs(Nu,{label:"What is this?",children:[o.jsxs("span",{className:"block",children:["Raw Common Crawl dumps stored at"," ",o.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/<release>/"}),". Each release takes ~16 GB."]}),o.jsxs("span",{className:"mt-2 block text-zinc-400",children:["These files are needed to re-run per-project extracts against a release without re-downloading. Pruning here ",o.jsx("span",{className:"text-zinc-200",children:"does not delete your backlink data"})," — that lives in SQLite."]})]})]})]})}),o.jsx("p",{className:"text-xs text-zinc-500 mb-3 max-w-3xl",children:"Each cached release is a ~16 GB pair of gzipped files. They’re needed to re-query the graph (e.g. for a newly-added project) without re-downloading. Safe to prune — backlink results persist in SQLite."}),o.jsx($e,{className:"surface-card overflow-hidden",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800 text-left text-xs uppercase tracking-wide text-zinc-600",children:[o.jsx("th",{className:"px-4 py-2 font-medium",children:"Release"}),o.jsx("th",{className:"px-4 py-2 font-medium",children:"Sync status"}),o.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Size"}),o.jsx("th",{className:"px-4 py-2 font-medium",children:"Last used"}),o.jsx("th",{className:"px-4 py-2 font-medium sr-only",children:"Actions"})]})}),o.jsxs("tbody",{children:[l.map(V=>o.jsxs("tr",{className:"border-b border-zinc-900 last:border-0",children:[o.jsx("td",{className:"px-4 py-2 text-zinc-200",children:o.jsx("code",{children:V.release})}),o.jsx("td",{className:"px-4 py-2",children:V.syncStatus?o.jsx(Xe,{tone:_j(V.syncStatus),children:V.syncStatus}):o.jsx("span",{className:"text-zinc-600",children:"—"})}),o.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:Ej(V.bytes)}),o.jsx("td",{className:"px-4 py-2 text-zinc-400",children:_g(V.lastUsedAt)}),o.jsx("td",{className:"px-4 py-2 text-right",children:o.jsxs("div",{className:"inline-flex items-center gap-1",children:[o.jsxs(be,{type:"button",variant:"outline",size:"sm",onClick:()=>U(V.release),children:[o.jsx(I5,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),"Prune"]}),o.jsx(Nu,{label:"What does Prune do?",placement:"top",children:"Deletes the ~16 GB cache for this release from disk. Backlink results already in SQLite remain untouched. To re-run extracts against this release, you’d have to sync it again (another ~16 GB download)."})]})})]},V.release)),l.length===0&&o.jsx("tr",{children:o.jsx("td",{className:"px-4 py-4 text-sm text-zinc-500",colSpan:5,children:"No cached releases on this machine. If you ran a sync from a different machine (or deleted the cache), the backlink data is still in the database — but you’ll need to re-sync a release to run new extracts."})})]})]})})]}),i.length>1&&o.jsxs("section",{className:"page-section-divider",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),o.jsx("h2",{children:"Past release syncs"})]})}),o.jsx($e,{className:"surface-card overflow-hidden",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800 text-left text-xs uppercase tracking-wide text-zinc-600",children:[o.jsx("th",{className:"px-4 py-2 font-medium",children:"Release"}),o.jsx("th",{className:"px-4 py-2 font-medium",children:"Status"}),o.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Projects"}),o.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Rows"}),o.jsx("th",{className:"px-4 py-2 font-medium",children:"Finished"})]})}),o.jsx("tbody",{children:i.map(V=>o.jsxs("tr",{className:"border-b border-zinc-900 last:border-0",children:[o.jsx("td",{className:"px-4 py-2 text-zinc-200",children:o.jsx("code",{children:V.release})}),o.jsx("td",{className:"px-4 py-2",children:o.jsx(Xe,{tone:_j(V.status),children:V.status})}),o.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:V.projectsProcessed??"—"}),o.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:V.domainsDiscovered??"—"}),o.jsx("td",{className:"px-4 py-2 text-zinc-400",children:_g(V.queryFinishedAt??V.updatedAt)})]},V.id))})]})})]})]})}function p_e(){return o.jsx("div",{className:"page-container",children:o.jsx("section",{className:"page-section",children:o.jsxs($e,{className:"surface-card empty-card",children:[o.jsx("h1",{children:"Route not found"}),o.jsx("p",{children:"The current path does not map to a dashboard view."}),o.jsx(be,{asChild:!0,children:o.jsx(Zt,{to:"/",children:"Return to overview"})})]})})})}function m_e(){return o.jsx(Vce,{children:o.jsx(Gce,{})})}const Hi=SG()({component:m_e,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),g_e=ei({getParentRoute:()=>Hi,path:"/",component:Wce,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(qe.projects.all);if(t&&t.length===0)throw RN({to:"/setup"})}}),y_e=ei({getParentRoute:()=>Hi,path:"/projects",component:lde}),Dd=ei({getParentRoute:()=>Hi,path:"/projects/$projectId",component:()=>o.jsx(FN,{})}),v_e=ei({getParentRoute:()=>Dd,path:"/",component:()=>o.jsx(Sp,{tab:"overview"})}),x_e=ei({getParentRoute:()=>Dd,path:"/search-console",component:()=>o.jsx(Sp,{tab:"search-console"})}),b_e=ei({getParentRoute:()=>Dd,path:"/report",component:()=>o.jsx(Sp,{tab:"report"})}),w_e=ei({getParentRoute:()=>Dd,path:"/traffic",component:()=>o.jsx(Sp,{tab:"traffic"})}),S_e=ei({getParentRoute:()=>Dd,path:"/inbound",component:()=>o.jsx(Sp,{tab:"inbound"})}),j_e=ei({getParentRoute:()=>Hi,path:"/runs",component:r_e}),N_e=ei({getParentRoute:()=>Hi,path:"/settings",component:l_e,beforeLoad:({context:e})=>{}}),k_e=ei({getParentRoute:()=>Hi,path:"/setup",component:d_e,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(qe.projects.all);if(t&&t.length>0)throw RN({to:"/"})}}),C_e=ei({getParentRoute:()=>Hi,path:"/backlinks",component:h_e}),A_e=ei({getParentRoute:()=>Hi,path:"*",component:p_e}),O_e=Hi.addChildren([g_e,y_e,Dd.addChildren([v_e,x_e,b_e,w_e,S_e]),j_e,N_e,k_e,C_e,A_e]);function E_e(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const _L=E_e(),__e=_L==="/"?"":_L.replace(/\/$/,"");function z_e(e,t){return PG({routeTree:O_e,basepath:__e||"/",context:{queryClient:e},...t?.initialEntries})}const UF=uQ(),P_e=z_e(UF),qF=document.getElementById("root");if(!qF)throw new Error("Expected #root element for web app bootstrap.");function T_e(){const[e,t]=x.useState(g2()?"ready":"checking"),[n,r]=x.useState(""),[i,a]=x.useState(""),[l,u]=x.useState(null),[d,f]=x.useState(!1);x.useEffect(()=>{if(g2())return;let g=!1;return JG().then(v=>{g||(v.authenticated?t("ready"):t(v.setupRequired?"setup":"login"))}).catch(v=>{g||(u(v instanceof Error?v.message:"Failed to reach the Canonry API"),t("login"))}),()=>{g=!0}},[]);const p=async g=>{if(g.preventDefault(),!n.trim()||n.trim().length<8){u("Password must be at least 8 characters");return}if(n!==i){u("Passwords do not match");return}f(!0),u(null);try{if(!(await eV(n.trim())).authenticated){u("Setup failed");return}r(""),a(""),t("ready")}catch(v){u(v instanceof Jr||v instanceof Error?v.message:"Setup failed")}finally{f(!1)}},m=async g=>{if(g.preventDefault(),!!n.trim()){f(!0),u(null);try{if(!(await tV(n.trim())).authenticated){u("Incorrect password");return}r(""),t("ready")}catch(v){u(v instanceof Jr||v instanceof Error?v.message:"Authentication failed")}finally{f(!1)}}};return e==="ready"?o.jsx(_K,{client:UF,children:o.jsx(DG,{router:P_e})}):o.jsx("div",{className:"min-h-screen bg-zinc-950 px-4 py-8",children:o.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md items-center justify-center",children:o.jsx($e,{className:"surface-card w-full",children:e==="checking"?o.jsx(Lg,{className:"py-8",children:o.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):e==="setup"?o.jsxs(o.Fragment,{children:[o.jsxs(p1,{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),o.jsx(m1,{children:"Create a dashboard password"}),o.jsx(g1,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),o.jsx(Lg,{children:o.jsxs("form",{className:"space-y-4",onSubmit:p,children:[o.jsxs("label",{className:"block space-y-1.5",children:[o.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),o.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:g=>r(g.target.value),placeholder:"At least 8 characters"})]}),o.jsxs("label",{className:"block space-y-1.5",children:[o.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Confirm password"}),o.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:g=>a(g.target.value),placeholder:"Re-enter password"})]}),l?o.jsx("p",{className:"text-sm text-rose-400",children:l}):null,o.jsx(be,{type:"submit",disabled:d||!n.trim()||!i.trim(),children:d?"Setting up…":"Create password & open dashboard"})]})})]}):o.jsxs(o.Fragment,{children:[o.jsxs(p1,{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),o.jsx(m1,{children:"Sign in to Canonry"}),o.jsx(g1,{children:"Enter your dashboard password to continue."})]}),o.jsx(Lg,{children:o.jsxs("form",{className:"space-y-4",onSubmit:m,children:[o.jsxs("label",{className:"block space-y-1.5",children:[o.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),o.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:g=>r(g.target.value),placeholder:"Dashboard password"})]}),l?o.jsx("p",{className:"text-sm text-rose-400",children:l}):null,o.jsx(be,{type:"submit",disabled:d||!n.trim(),children:d?"Signing in…":"Open dashboard"})]})})]})})})})}aK.createRoot(qF).render(o.jsx(x.StrictMode,{children:o.jsx(T_e,{})}));
|